mirror of
https://gitee.com/niucloud-team/niucloud-admin.git
synced 2025-12-14 19:52:48 +00:00
2 lines
4.5 KiB
JavaScript
2 lines
4.5 KiB
JavaScript
import{bi as S,h as A,a2 as Z,c8 as j,a$ as R,f as q,aZ as H,bs as M,a5 as m,w as X,L as D,m as F,M as G,X as J,$ as x,b0 as K,ae as B,a6 as V,bg as g,Z as I,ac as _,au as U,c9 as W,__tla as Y}from"./entry.ac74755d.js";let P,E,Q=Promise.all([(()=>{try{return Y}catch{}})()]).then(async()=>{P=n=>["",...S].includes(n);function T(n){let e;const l=A(!1),o=Z({...n,originalPosition:"",originalOverflow:"",visible:!1});function i(s){o.text=s}function t(){const s=o.parent,a=d.ns;if(!s.vLoadingAddClassList){let r=s.getAttribute("loading-number");r=Number.parseInt(r)-1,r?s.setAttribute("loading-number",r.toString()):(x(s,a.bm("parent","relative")),s.removeAttribute("loading-number")),x(s,a.bm("parent","hidden"))}u(),c.unmount()}function u(){var s,a;(a=(s=d.$el)==null?void 0:s.parentNode)==null||a.removeChild(d.$el)}function v(){var s;n.beforeClose&&!n.beforeClose()||(l.value=!0,clearTimeout(e),e=window.setTimeout(b,400),o.visible=!1,(s=n.closed)==null||s.call(n))}function b(){if(!l.value)return;const s=o.parent;l.value=!1,s.vLoadingAddClassList=void 0,t()}const c=j(q({name:"ElLoading",setup(s,{expose:a}){const{ns:r}=H("loading"),N=M();return a({ns:r,zIndex:N}),()=>{const $=o.spinner||o.svg,O=m("svg",{class:"circular",viewBox:o.svgViewBox?o.svgViewBox:"0 0 50 50",...$?{innerHTML:$}:{}},[m("circle",{class:"path",cx:"25",cy:"25",r:"20",fill:"none"})]),z=o.text?m("p",{class:r.b("text")},[o.text]):void 0;return m(J,{name:r.b("fade"),onAfterLeave:b},{default:X(()=>[D(F("div",{style:{backgroundColor:o.background||""},class:[r.b("mask"),o.customClass,o.fullscreen?"is-fullscreen":""]},[m("div",{class:r.b("spinner")},[O,z])]),[[G,o.visible]])])})}}})),d=c.mount(document.createElement("div"));return{...R(o),setText:i,removeElLoadingChild:u,close:v,handleAfterLeave:b,vm:d,get $el(){return d.$el}}}let f,k,w,h,y,p,C,L;k=function(n={}){if(!K)return;const e=w(n);if(e.fullscreen&&f)return f;const l=T({...e,closed:()=>{var i;(i=e.closed)==null||i.call(e),e.fullscreen&&(f=void 0)}});h(e,e.parent,l),y(e,e.parent,l),e.parent.vLoadingAddClassList=()=>y(e,e.parent,l);let o=e.parent.getAttribute("loading-number");return o?o=`${Number.parseInt(o)+1}`:o="1",e.parent.setAttribute("loading-number",o),e.parent.appendChild(l.$el),B(()=>l.visible.value=e.visible),e.fullscreen&&(f=l),l},w=n=>{var e,l,o,i;let t;return V(n.target)?t=(e=document.querySelector(n.target))!=null?e:document.body:t=n.target||document.body,{parent:t===document.body||n.body?document.body:t,background:n.background||"",svg:n.svg||"",svgViewBox:n.svgViewBox||"",spinner:n.spinner||!1,text:n.text||"",fullscreen:t===document.body&&((l=n.fullscreen)!=null?l:!0),lock:(o=n.lock)!=null?o:!1,customClass:n.customClass||"",visible:(i=n.visible)!=null?i:!0,target:t}},h=async(n,e,l)=>{const{nextZIndex:o}=l.vm.zIndex,i={};if(n.fullscreen)l.originalPosition.value=g(document.body,"position"),l.originalOverflow.value=g(document.body,"overflow"),i.zIndex=o();else if(n.parent===document.body){l.originalPosition.value=g(document.body,"position"),await B();for(const t of["top","left"]){const u=t==="top"?"scrollTop":"scrollLeft";i[t]=`${n.target.getBoundingClientRect()[t]+document.body[u]+document.documentElement[u]-Number.parseInt(g(document.body,`margin-${t}`),10)}px`}for(const t of["height","width"])i[t]=`${n.target.getBoundingClientRect()[t]}px`}else l.originalPosition.value=g(e,"position");for(const[t,u]of Object.entries(i))l.$el.style[t]=u},y=(n,e,l)=>{const o=l.vm.ns;["absolute","fixed","sticky"].includes(l.originalPosition.value)?x(e,o.bm("parent","relative")):I(e,o.bm("parent","relative")),n.fullscreen&&n.lock?I(e,o.bm("parent","hidden")):x(e,o.bm("parent","hidden"))},p=Symbol("ElLoading"),C=(n,e)=>{var l,o,i,t;const u=e.instance,v=a=>_(e.value)?e.value[a]:void 0,b=a=>{const r=V(a)&&(u==null?void 0:u[a])||a;return r&&A(r)},c=a=>b(v(a)||n.getAttribute(`element-loading-${W(a)}`)),d=(l=v("fullscreen"))!=null?l:e.modifiers.fullscreen,s={text:c("text"),svg:c("svg"),svgViewBox:c("svgViewBox"),spinner:c("spinner"),background:c("background"),customClass:c("customClass"),fullscreen:d,target:(o=v("target"))!=null?o:d?void 0:n,body:(i=v("body"))!=null?i:e.modifiers.body,lock:(t=v("lock"))!=null?t:e.modifiers.lock};n[p]={options:s,instance:k(s)}},L=(n,e)=>{for(const l of Object.keys(e))U(e[l])&&(e[l].value=n[l])},E={mounted(n,e){e.value&&C(n,e)},updated(n,e){const l=n[p];e.oldValue!==e.value&&(e.value&&!e.oldValue?C(n,e):e.value&&e.oldValue?_(e.value)&&L(e.value,l.options):l==null||l.instance.close())},unmounted(n){var e;(e=n[p])==null||e.instance.close()}}});export{Q as __tla,P as i,E as v};
|