test_lgq/niucloud/public/web/_nuxt/el-loading.95b1f580.js

2 lines
6.2 KiB
JavaScript
Raw Normal View History

2024-01-24 17:36:08 +08:00
import{p as D,M as q,a as w,q as K,o as L,e as A,y as S,u as g,x as E,h as Y,t as Z,k as F,j as x,z as G,B as H,C as J,r as T,D as Q,c9 as U,P as W,ca as X,ag as ee,bo as b,w as v,a0 as te,f as y,a1 as se,as as ae,bi as C,a9 as ne,ak as P,aA as z,bf as _,bg as B,aY as O,aE as oe,cb as le,b2 as re,c as ce,J as ie,K as de}from"./entry.539d3b49.js";import{E as ue,a as me}from"./el-tooltip.a101b1cd.js";import"./el-popper.6e1fd591.js";import{_ as ve}from"./_plugin-vue_export-helper.c27b6911.js";const fe=D({header:{type:String,default:""},bodyStyle:{type:q([String,Object,Array]),default:""},shadow:{type:String,values:["always","hover","never"],default:"always"}}),pe=w({name:"ElCard"}),be=w({...pe,props:fe,setup(t){const e=K("card");return(s,a)=>(L(),A("div",{class:S([g(e).b(),g(e).is(`${s.shadow}-shadow`)])},[s.$slots.header||s.header?(L(),A("div",{key:0,class:S(g(e).e("header"))},[E(s.$slots,"header",{},()=>[Y(Z(s.header),1)])],2)):F("v-if",!0),x("div",{class:S(g(e).e("body")),style:G(s.bodyStyle)},[E(s.$slots,"default")],6)],2))}});var _e=H(be,[["__file","/home/runner/work/element-plus/element-plus/packages/components/card/src/card.vue"]]);const Ne=J(_e);function ge(t){let e;const s=T(!1),a=Q({...t,originalPosition:"",originalOverflow:"",visible:!1});function l(n){a.text=n}function o(){const n=a.parent,r=d.ns;if(!n.vLoadingAddClassList){let i=n.getAttribute("loading-number");i=Number.parseInt(i)-1,i?n.setAttribute("loading-number",i.toString()):(C(n,r.bm("parent","relative")),n.removeAttribute("loading-number")),C(n,r.bm("parent","hidden"))}c(),p.unmount()}function c(){var n,r;(r=(n=d.$el)==null?void 0:n.parentNode)==null||r.removeChild(d.$el)}function u(){var n;t.beforeClose&&!t.beforeClose()||(s.value=!0,clearTimeout(e),e=window.setTimeout(f,400),a.visible=!1,(n=t.closed)==null||n.call(t))}function f(){if(!s.value)return;const n=a.parent;s.value=!1,n.vLoadingAddClassList=void 0,o()}const p=U(w({name:"ElLoading",setup(n,{expose:r}){const{ns:i}=X("loading"),j=ee();return r({ns:i,zIndex:j}),()=>{const $=a.spinner||a.svg,M=b("svg",{class:"circular",viewBox:a.svgViewBox?a.svgViewBox:"0 0 50 50",...$?{innerHTML:$}:{}},[b("circle",{class:"path",cx:"25",cy:"25",r:"20",fill:"none"})]),R=a.text?b("p",{class:i.b("text")},[a.text]):void 0;return b(ae,{name:i.b("fade"),onAfterLeave:f},{default:v(()=>[te(y("div",{style:{backgroundColor:a.background||""},class:[i.b("mask"),a.customClass,a.fullscreen?"is-fullscreen":""]},[b("div",{class:i.b("spinner")},[M,R])]),[[se,a.visible]])])})}}})),d=p.mount(document.createElement("div"));return{...W(a),setText:l,removeElLoadingChild:c,close:u,handleAfterLeave:f,vm:d,get $el(){return d.$el}}}let h;const ye=function(t={}){if(!ne)return;const e=xe(t);if(e.fullscreen&&h)return h;const s=ge({...e,closed:()=>{var l;(l=e.closed)==null||l.call(e),e.fullscreen&&(h=void 0)}});he(e,e.parent,s),N(e,e.parent,s),e.parent.vLoadingAddClassList=()=>N(e,e.parent,s);let a=e.parent.getAttribute("loading-number");return a?a=`${Number.parseInt(a)+1}`:a="1",e.parent.setAttribute("loading-number",a),e.parent.appendChild(s.$el),P(()=>s.visible.value=e.visible),e.fullscreen&&(h=s),s},xe=t=>{var e,s,a,l;let o;return z(t.target)?o=(e=document.querySelector(t.target))!=null?e:document.body:o=t.target||document.body,{parent:o===document.body||t.body?document.body:o,background:t.background||"",svg:t.svg||"",svgViewBox:t.svgViewBox||"",spinner:t.spinner||!1,text:t.text||"",fullscreen:o===document.body&&((s=t.fullscreen)!=null?s:!0),lock:(a=t.lock)!=null?a:!1,customClass:t.customClass||"",visible:(l=t.visible)!=null?l:!0,target:o}},he=async(t,e,s)=>{const{nextZIndex:a}=s.vm.zIndex,l={};if(t.fullscreen)s.originalPosition.value=_(document.body,"position"),s.originalOverflow.value=_(document.body,"overflow"),l.zIndex=a();else if(t.parent===document.body){s.originalPosition.value=_(document.body,"position"),await P();for(const o of["top","left"]){const c=o==="top"?"scrollTop":"scrollLeft";l[o]=`${t.target.getBoundingClientRect()[o]+document.body[c]+document.documentElement[c]-Number.parseInt(_(document.body,`margin-${o}`),10)}px`}for