x-next 0.0.0-alpha.20 → 0.0.0-alpha.21
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/index.es.js +1 -1
- package/dist/index.umd.js +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
@@ -1286,7 +1286,7 @@ const Ut = /* @__PURE__ */ Vt(_t, [["render", Xt]]), ce = /* @__PURE__ */ new We
|
|
1286
1286
|
default: b(d.message) ? d.message : () => d.message
|
1287
1287
|
} : null
|
1288
1288
|
);
|
1289
|
-
return
|
1289
|
+
return N(f, n), t.tagName === "BODY" ? f.el.style.position = "fixed" : (t.style.position = "relative", f.el.style.position = "absolute"), t.appendChild(n.firstElementChild), l.push(f), {
|
1290
1290
|
close: () => {
|
1291
1291
|
f.component.proxy.handleClose();
|
1292
1292
|
}
|
package/dist/index.umd.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
(function(C,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],t):(C=typeof globalThis<"u"?globalThis:C||self,t(C.index={},C.Vue))})(this,function(C,t){"use strict";var Ct=Object.defineProperty;var Nt=(C,t,B)=>t in C?Ct(C,t,{enumerable:!0,configurable:!0,writable:!0,value:B}):C[t]=B;var T=(C,t,B)=>Nt(C,typeof t!="symbol"?t+"":t,B);const B="X",pe="x",ee=e=>e?pe+"-"+e:e||"",b=e=>B+e,V=e=>{const n=ee(e);return{block:n,element:c=>`${n}--${c}`,modifier:c=>`${n}-${c}`,is:c=>`${n}-is-${c}`}},M=Object.prototype.toString;function te(e){return M.call(e)==="[object Array]"}function ne(e){return M.call(e)==="[object Object]"}const le=e=>M.call(e)==="[object Promise]",Ve=e=>k(e)&&e.constructor.name==="AsyncFunction",we=e=>le(e)||Ve(e);function oe(e){return M.call(e)==="[object String]"}function Be(e){return M.call(e)==="[object Number]"&&e===e}function k(e){return typeof e=="function"}function $(){return typeof window<"u"}const E=e=>e,Se=e=>!!(e&&e.shapeFlag&1),xe=(e,n)=>!!(e&&e.shapeFlag&6),Oe=(e,n)=>!!(e&&e.shapeFlag&8),Te=(e,n)=>!!(e&&e.shapeFlag&16),Me=(e,n)=>!!(e&&e.shapeFlag&32),D=(e,n=!1)=>{var o,a;const l=[];for(const c of e??[])Se(c)||xe(c)||n&&Oe(c,c.children)?l.push(c):Te(c,c.children)?l.push(...D(c.children,n)):Me(c,c.children)?l.push(...D((a=(o=c.children).default)==null?void 0:a.call(o),n)):te(c)&&l.push(...D(c,n));return l},S=(e,n)=>Object.assign(n,{install(l){l.component(e)||l.component(e,n)}}),Ee={disabled:Boolean,block:Boolean,loading:Boolean,loadingFill:{type:Boolean,default:!1},debounce:{type:Number,default:0},shape:{type:E(String),default:void 0},link:{type:Boolean,default:!1},type:{type:E(String),default:void 0},status:{type:E(String),default:void 0},plain:{type:Boolean,default:!1},size:{type:E(String),default:"medium"},border:{type:Boolean,default:!0}},Fe=e=>oe(e)?e.split("-").map(n=>n.charAt(0).toUpperCase()+n.slice(1)).join(""):"",Ae=(e,n="px")=>{if(e===void 0)return"";const l=typeof e=="number"?`${e}`:e;return["px","%","vh","vw","calc"].some(a=>l.includes(a))?l:l+n};function x(e,n){return t.defineComponent({name:ee(`Icon${Fe(e)}`),props:{size:{type:[Number,String],default:void 0},rotate:{type:Number,default:void 0},spin:{type:Boolean,default:!1},color:{type:String,default:void 0},fillColor:{type:Array,default:void 0}},setup(l){const o="x-icon",a=t.computed(()=>{const f={};return l.size&&(f.fontSize=Ae(l.size)),l.rotate&&(f.transform=`rotate(${l.rotate}deg)`),l.color&&(f.color=l.color),f}),c=t.computed(()=>[o,{[`${o}-loading`]:l.spin}]);return()=>t.createVNode("div",{class:c.value,style:a.value},[n])}})}const ze=x("InfoCircleFill",t.h(t.createVNode("svg",{viewBox:"0 0 50 50",class:"x-icon-loading-svg"},[t.createVNode("circle",{cx:"25",cy:"25",r:"20",class:"path",fill:"none",stroke:"currentColor"},null)]))),$e=t.defineComponent({name:"Button",props:Ee,emits:["click"],$slots:["prefix","suffix"],setup(e,{slots:n,emit:l}){const o=t.reactive({clicked:!1,isDebounce:!1}),a=V("button"),c=t.computed(()=>[a.block,e.type&&a.modifier(e.type),e.status&&a.modifier(e.status),e.disabled&&a.is("disabled"),e.block&&a.modifier("block"),e.plain&&a.is("plain"),e.shape&&a.modifier(e.shape),e.link&&a.modifier("is-link"),e.size&&a.modifier(e.size),!e.border&&a.modifier("is-hide-border"),r.value&&a.modifier("is-loading")]),f=()=>{e.debounce>0&&!o.isDebounce&&(o.isDebounce=!0,setTimeout(()=>{o.isDebounce=!1},e.debounce))},r=t.computed(()=>e.loading||o.clicked||o.isDebounce),m=t.getCurrentInstance(),u=(s,i)=>{const d=s(i);we(d)&&(o.clicked=!0,d.finally(()=>{o.clicked=!1}))},h=s=>{var d,N,g,p;if(s.stopPropagation(),(N=(d=s.target).blur)==null||N.call(d),r.value)return;f();const i=(p=(g=m==null?void 0:m.vnode)==null?void 0:g.props)==null?void 0:p.onClick;if(te(i))i.forEach(Q=>u(Q,s));else if(k(i)){u(i,s);return}};return()=>{var s;return t.createVNode("button",{class:c.value,type:"button",disabled:e.disabled,onClick:h},[t.createVNode("span",{style:{display:r.value?"flex":"none",marginRight:r.value?"4px":"0px"},class:a.element("loading")},[t.createVNode(ze,null,null)]),n.prefix&&t.createVNode("span",{class:a.element("prefix")},[n.prefix()]),t.createVNode("span",{class:a.element("content")},[(s=n.default)==null?void 0:s.call(n)]),n.suffix&&t.createVNode("span",{class:a.element("suffix")},[n.suffix()])])}}}),O=S(b("Button"),$e),De=["px","%","vh","vw","calc"],re=(e,n="px")=>{if(e===void 0)return"";const l=String(e);return De.some(o=>l.includes(o))?l:l+n},Ie=1e3,Le=3e3,je=1;class Pe{constructor(){T(this,"popupStack",{popup:new Set,dialog:new Set,message:new Set});T(this,"getNextZIndex",n=>(n==="message"?Array.from(this.popupStack.message).pop()||Le:Array.from(this.popupStack.popup).pop()||Ie)+je);T(this,"add",n=>{const l=this.getNextZIndex(n);return this.popupStack[n].add(l),n==="dialog"&&this.popupStack.popup.add(l),l});T(this,"delete",(n,l)=>{this.popupStack[l].delete(n),l==="dialog"&&this.popupStack.popup.delete(n)});T(this,"isLastDialog",n=>this.popupStack.dialog.size>1?n===Array.from(this.popupStack.dialog).pop():!0)}}const K=new Pe;function I(e,{visible:n,runOnMounted:l}={}){const o=t.ref(0),a=()=>{o.value=K.add(e)},c=()=>{K.delete(o.value,e)},f=()=>e==="dialog"?K.isLastDialog(o.value):!1;return t.watch(()=>n==null?void 0:n.value,r=>{r?a():c()},{immediate:!0}),l&&(t.onMounted(a),t.onBeforeUnmount(c)),{zIndex:t.readonly(o),open:a,close:c,isLastDialog:f}}const ae=e=>e.replace(/^./,n=>n.toLowerCase()).replace(/-(\w)/g,(n,l)=>(l==null?void 0:l.toUpperCase())??""),ce=()=>{},He=(e,n)=>{if($)return(n??document).querySelector(e)??void 0},_e=e=>{if(e.tagName==="BODY")return window.innerWidth-(document.documentElement.offsetWidth||document.body.offsetWidth);const{borderLeftWidth:n,borderRightWidth:l}=window.getComputedStyle(e),o=Number(n.replace("px",""))+Number(l.replace("px",""));return e.offsetWidth-(e.clientWidth+o)},Xe=e=>e.tagName==="BODY"?document.documentElement.scrollHeight>window.innerHeight:e.scrollHeight>e.offsetHeight,We=(e,n)=>{var o;if(!$||!e||!n)return"";let l=ae(n);l==="float"&&(l="cssFloat");try{const a=e.style[l];if(a)return a;const c=(o=document.defaultView)==null?void 0:o.getComputedStyle(e,"");return c?c[l]:""}catch{return e.style[l]}},F=(e,n,l)=>{if(!(!e||!n))if(ne(n))Object.entries(n).forEach(([o,a])=>F(e,o,a));else{const o=ae(n);e.style[o]=l}},Y=(e,n)=>{if(oe(e)){const l=e[0]==="#"?`[id='${e.slice(1)}']`:e;return He(l,n)}return e},Ze=$?(e,n,l,o=!1)=>{e.addEventListener(n,l,o)}:ce,Ue=$?(e,n,l,o=!1)=>{e.removeEventListener(n,l,o)}:ce,Re=(e,n)=>{let l=!1;const o={overflow:"",width:""},a=r=>r.tagName==="BODY",c=()=>{if(e.value){const r=e.value;if(!l&&r.style.overflow!=="hidden"){const m=_e(r);if(m>0||Xe(r)){o.overflow=r.style.overflow,o.width=r.style.width;let u=0;a(r)&&(u=r.getBoundingClientRect().left||0),F(r,{width:`calc(100% - ${Math.ceil(m-u)}px)`,overflow:"hidden"}),l=!0}}}},f=()=>{if(e.value&&l){const r=e.value;F(r,{overflow:o.overflow,width:o.width}),l=!1}};return t.watch(()=>n==null?void 0:n.value,r=>{e.value&&!a(e.value)&&(r&&F(r,{position:"absolute"}),We(e.value,"position")==="static"&&F(e.value,{position:"relative"}))}),{setOverflowHidden:c,resetOverflow:f}},Ke={ENTER:"Enter",ESC:"Escape",BACKSPACE:"Backspace",TAB:"Tab",SPACE:" ",ARROW_UP:"ArrowUp",ARROW_DOWN:"ArrowDown",ARROW_LEFT:"ArrowLeft",ARROW_RIGHT:"ArrowRight"},Ye={renderTo:{type:E([String,Object]),default:"body"},disabled:{type:Boolean,default:!1},modelValue:{type:Boolean,default:!1},top:{type:[String,Number],default:"3vh"},center:{type:Boolean,default:!1},width:{type:[String,Number],default:0},height:{type:[String,Number],default:0},minWidth:{type:[String,Number],default:0},minHeight:{type:[String,Number],default:0},title:{type:String,default:""},mask:{type:Boolean,default:!0},destroyOnClosed:{type:Boolean,default:!0},onBeforeCancel:{type:Function},maskToClose:{type:Boolean,default:!0},escToClose:{type:Boolean,default:!0},fullscreen:{type:Boolean,default:!1},messageBox:{type:Boolean,default:!1},popupClass:{type:String,default:void 0},showClose:{type:Boolean,default:!0},showHeaderBottomLine:{type:Boolean,default:!1}},Ge=["width","minWidth","height","minHeight"],se=t.defineComponent({name:b("Dialog"),inheritAttrs:!1,props:Ye,emits:["closed","close","open","opened","update:modelValue"],setup(e,{emit:n,slots:l}){const o=V("dialog"),a=o.block,c=V("message-box");c.block;const f=t.computed(()=>[a,e.messageBox&&"is-message-box",e.popupClass&&e.popupClass]),r=t.computed(()=>Y(e.renderTo)),m=t.ref(),u=t.computed(()=>e.disabled||!r.value),h=t.computed(()=>({zIndex:g.value})),s=t.computed(()=>{const y={};return e.fullscreen||(!e.center&&e.top&&(y.top=re(e.top)),Ge.forEach(w=>{e[w]&&(y[w]=re(e[w]))})),y}),i=t.ref(!1),d=t.computed(()=>e.modelValue),N=t.computed(()=>d.value||i.value),{zIndex:g,isLastDialog:p}=I("dialog",{visible:d}),{setOverflowHidden:Q,resetOverflow:Ce}=Re(r,m),Ne=(y,w)=>{n("update:modelValue",!1),n("close",e.messageBox?y:void 0,e.messageBox?w:void 0)},dt=()=>{i.value=!1,Ce(),n("closed")},ft=()=>{n("opened")},U=t.reactive({ok:!1,cancel:!1}),z=(y,w)=>{let R=!0;if(U[y]=!0,k(e.onBeforeCancel)&&(R=e.onBeforeCancel(y)??!1),le(R)){R.then(yt=>{U[y]=!1,yt&&Ne(y,w)});return}U[y]=!1,R&&Ne(y,w)},ut=()=>{e.maskToClose&&e.mask&&z("cancel")},mt=y=>{z("cancel",y)},gt=y=>{z("ok",y)};let v=!1;const ke=y=>{e.escToClose&&y.key===Ke.ESC&&p()&&z("cancel")},ht=()=>{e.escToClose&&!v&&(v=!0,Ze(document.documentElement,"keydown",ke))},be=()=>{v=!1,Ue(document.documentElement,"keydown",ke)};return t.onBeforeUnmount(()=>{Ce(),be()}),t.watch(()=>d.value,y=>{y?(n("open"),Q(),i.value=!0,ht()):be()},{immediate:!0}),()=>t.createVNode(t.Teleport,{to:r.value,disabled:u.value},{default:()=>[N.value&&t.createVNode("div",{ref:m,class:f.value,style:h.value},[t.createVNode(t.Transition,{name:"x-fade-in-standard",appear:!0},{default:()=>[e.mask&&d.value&&t.createVNode("div",{class:o.element("mask")},null)]}),t.createVNode("div",{class:[o.element("wrapper"),{"is-center":e.center}],onClick:y=>y.target===y.currentTarget&&ut()},[t.createVNode(t.Transition,{name:"x-zoom-in",appear:!0,onAfterEnter:ft,onAfterLeave:dt},{default:()=>[d.value&&t.createVNode("div",{class:[o.element("container"),{"is-fullscreen":e.fullscreen}],style:s.value},[t.createVNode("div",{class:[e.messageBox?c.element("header"):o.element("header"),e.showHeaderBottomLine&&"is-bottom-line"]},[l.title?l.title():t.createVNode("div",{class:[o.element("header-title")]},[e.title])]),t.createVNode("div",{class:[e.messageBox?c.element("body"):o.element("body")]},[l.default&&l.default()]),t.createVNode("div",{class:[e.messageBox?c.element("footer"):o.element("footer")]},[l.footer&&l.footer({cancel:mt,ok:gt,"loading-obj":U})]),e.showClose&&t.createVNode("span",{class:[o.element("close-icon"),e.messageBox&&c.element("close-icon")],onClick:()=>z("cancel")},null)])]})])])]})}}),G=S(b("Dialog"),se),L=x("CloseCircleFill",t.h(t.createVNode("svg",{viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",stroke:"currentColor","stroke-width":"4","stroke-linecap":"butt","stroke-linejoin":"miter",filter:""},[t.createVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M24 44c11.046 0 20-8.954 20-20S35.046 4 24 4 4 12.954 4 24s8.954 20 20 20Zm4.955-27.771-4.95 4.95-4.95-4.95a1 1 0 0 0-1.414 0l-1.414 1.414a1 1 0 0 0 0 1.414l4.95 4.95-4.95 4.95a1 1 0 0 0 0 1.414l1.414 1.414a1 1 0 0 0 1.414 0l4.95-4.95 4.95 4.95a1 1 0 0 0 1.414 0l1.414-1.414a1 1 0 0 0 0-1.414l-4.95-4.95 4.95-4.95a1 1 0 0 0 0-1.414l-1.414-1.414a1 1 0 0 0-1.414 0Z",fill:"currentColor",stroke:"none"},null)]))),j=x("CheckCircleFill",t.h(t.createVNode("svg",{viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",stroke:"currentColor","stroke-width":"4","stroke-linecap":"butt","stroke-linejoin":"miter",filter:""},[t.createVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M24 44c11.046 0 20-8.954 20-20S35.046 4 24 4 4 12.954 4 24s8.954 20 20 20Zm10.207-24.379a1 1 0 0 0 0-1.414l-1.414-1.414a1 1 0 0 0-1.414 0L22 26.172l-4.878-4.88a1 1 0 0 0-1.415 0l-1.414 1.415a1 1 0 0 0 0 1.414l7 7a1 1 0 0 0 1.414 0l11.5-11.5Z",fill:"currentColor",stroke:"none"},null)]))),P=x("ExclamationCircleFill",t.h(t.createVNode("svg",{viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",stroke:"currentColor","stroke-width":"4","stroke-linecap":"butt","stroke-linejoin":"miter",filter:""},[t.createVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M24 44c11.046 0 20-8.954 20-20S35.046 4 24 4 4 12.954 4 24s8.954 20 20 20Zm2-30a1 1 0 0 0-1-1h-2a1 1 0 0 0-1 1v2a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1v-2Zm0 17h1a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1h-6a1 1 0 0 1-1-1v-2a1 1 0 0 1 1-1h1v-8a1 1 0 0 1-1-1v-2a1 1 0 0 1 1-1h3a1 1 0 0 1 1 1v11Z",fill:"currentColor",stroke:"none"},null)]))),H=x("InfoCircleFill",t.h(t.createVNode("svg",{viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",stroke:"currentColor","stroke-width":"4","stroke-linecap":"butt","stroke-linejoin":"miter",filter:""},[t.createVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M24 44c11.046 0 20-8.954 20-20S35.046 4 24 4 4 12.954 4 24s8.954 20 20 20Zm2-30a1 1 0 0 0-1-1h-2a1 1 0 0 0-1 1v2a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1v-2Zm0 17h1a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1h-6a1 1 0 0 1-1-1v-2a1 1 0 0 1 1-1h1v-8a1 1 0 0 1-1-1v-2a1 1 0 0 1 1-1h3a1 1 0 0 1 1 1v11Z",fill:"currentColor",stroke:"none"},null)]))),_=x("MinusCircleFill",t.h(t.createVNode("svg",{viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",stroke:"currentColor","stroke-width":"4","stroke-linecap":"butt","stroke-linejoin":"miter",filter:""},[t.createVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M24 44c11.046 0 20-8.954 20-20S35.046 4 24 4 4 12.954 4 24s8.954 20 20 20Zm-7-22a1 1 0 0 0-1 1v2a1 1 0 0 0 1 1h14a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1H17Z",fill:"currentColor",stroke:"none"},null)]))),qe=t.defineComponent({name:b("Message"),props:{id:{type:String,default:""},message:{type:[String,Number,Object],default:""},type:{type:String,default:"success"},duration:{type:Number,default:1500},center:{type:Boolean,default:!1},onClose:{type:Function,default:()=>{}},offset:{type:Number,default:20},zIndex:{type:Number,default:0},showClose:{type:Boolean,default:!1},useHTML:{type:Boolean,default:!1},popupClass:{type:String,default:void 0}},emits:["destroy"],setup(e,{emit:n,slots:l}){const o=V("message"),a=t.ref(!1),c=t.ref(null),f=t.computed(()=>[o.block,o.modifier(e.type),e.center&&o.modifier("center"),e.showClose&&!e.center&&o.element("show-close"),e.popupClass]),{zIndex:r}=I("message",{runOnMounted:!0}),m=t.computed(()=>({top:`${e.offset}px`,zIndex:r.value})),u=()=>{if(l.icon)return l.icon();switch(e.type){case"success":return t.createVNode(j,null,null);case"warning":return t.createVNode(P,null,null);case"strong":return t.createVNode(_,null,null);case"error":return t.createVNode(L,null,null);case"info":return t.createVNode(H,null,null);default:return null}},h=()=>{e.duration>0&&(c.value=setTimeout(()=>{a.value=!1},e.duration))},s=()=>{c.value&&(clearTimeout(c.value),c.value=null)};t.onMounted(()=>{a.value=!0,h()}),t.onUnmounted(()=>{s()});const i=()=>{var d;a.value=!1,s(),(d=e.onClose)==null||d.call(e)};return()=>t.createVNode(t.Transition,{name:"x-message-slide-top",onBeforeLeave:e.onClose,onAfterLeave:()=>n("destroy")},{default:()=>[a.value&&t.createVNode("div",{class:f.value,style:m.value},[t.createVNode("span",{class:[o.element("icon"),o.modifier(`icon-${e.type}`)]},[u()]),t.createVNode("div",null,[l.default?l.default():e.useHTML?t.createVNode("span",{innerHTML:e.message},null):t.createVNode("span",null,[e.message]),e.showClose&&t.createVNode("span",{class:o.element("close-icon"),onClick:i},null)])])]})}}),ie=S(b("Message"),qe),Je=t.defineComponent({name:"Space",props:{direction:{type:String,default:"horizontal"},size:{type:[Number,String],default:"small"},align:{type:String,default:"center"},fill:{type:Boolean,default:!1}},setup(e,{slots:n}){const l=V("space"),o=t.computed(()=>[l.block,l.element(e.direction),e.fill&&"is-fill",l.element(`${e.direction}-${e.align}`)]);function a(f){if(Be(f))return f;switch(f){case"mini":return 4;case"small":return 8;case"medium":return 16;case"large":return 24;default:return 8}}const c=f=>{const r={};if(f)return r;const m=`${a(e.size)}px`,u=`${a(e.size)}px`;return e.direction==="horizontal"&&(r.marginRight=m),e.direction==="vertical"&&(r.marginBottom=u),r};return()=>{var r;const f=D((r=n.default)==null?void 0:r.call(n),!0).filter(m=>m.type!==t.Comment);return t.createVNode("div",{class:[o.value]},[f.map((m,u)=>{var s;const h=n.split&&u>0;return t.createVNode(t.Fragment,{key:`space-item-${u}`},[h&&t.createVNode("div",{className:l.element("split"),style:c(!1)},[(s=n.split)==null?void 0:s.call(n)]),t.createVNode("div",{className:l.element("item"),style:c(u===f.length-1)},[m])])})])}}}),X=S(b("Space"),Je),Qe=["info","success","warning","strong","error"];function de(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!t.isVNode(e)}const q=V("message-box"),W=e=>{const n=document.createElement("div"),l=()=>{t.render(null,n)},o=i=>{if(i==="cancel")return e.beforeOnCancel?e.beforeOnCancel():!0;if(i==="ok")return e.beforeOnOk?e.beforeOnOk():!0},a=(i,d)=>{i==="cancel"&&e.onCancel&&e.onCancel(d),i==="ok"&&e.onOk&&e.onOk(d)},c=i=>{let d;switch(i){case"warning":d=t.createVNode(P,{size:"22px",color:"#f6c64b"},null);break;case"strong":d=t.createVNode(_,{size:"22px",color:"#ff7125"},null);break;case"error":d=t.createVNode(L,{size:"22px",color:"#e24f48"},null);break;case"success":d=t.createVNode(j,{size:"22px",color:"#68d1ab"},null);break;case"info":d=t.createVNode(H,{size:"22px",color:"#2355f5"},null);break}return t.createVNode("div",{class:q.element("icon")},[d])},f=i=>{if(t.isVNode(i))return i;if(k(i)){const d=i();return t.isVNode(d)?d:null}return t.createVNode("div",{class:q.element("title")},[t.createTextVNode(" "),i,t.createTextVNode(" ")])},r=i=>{if(t.isVNode(i))return i;if(k(i)){const d=i();return t.isVNode(d)?d:null}return t.createVNode("div",{class:q.element("content")},[t.createTextVNode(" "),e.content,t.createTextVNode(" ")])},m=()=>()=>t.createVNode(t.Fragment,null,[c(e.type||"success"),e.title&&f(e.title)]),u=()=>()=>t.createVNode(t.Fragment,null,[e.content&&r(e.content)]),h=()=>{if(t.isVNode(e.footer)||k(e.footer))return e.footer;const i=(e==null?void 0:e.cancelText)||"取消",d=(e==null?void 0:e.okText)||"确认";return N=>t.createVNode(X,{size:12},{default:()=>{var g,p;return[!e.hideCancel&&t.createVNode(O,{size:"small",onClick:N.cancel,loading:(g=N.loadingObj)==null?void 0:g.cancel},de(i)?i:{default:()=>[i]}),!e.hideOk&&t.createVNode(O,{type:"primary",size:"small",onClick:N.ok,loading:(p=N.loadingObj)==null?void 0:p.ok},de(d)?d:{default:()=>[d]})]}})},s=t.createVNode(G,{messageBox:!0,width:(e==null?void 0:e.width)??358,height:(e==null?void 0:e.height)??"auto",modelValue:!0,renderTo:e==null?void 0:e.renderTo,center:e!=null&&e.top?!1:(e==null?void 0:e.center)??!0,top:(e==null?void 0:e.top)??0,mask:(e==null?void 0:e.mask)??!0,maskToClose:(e==null?void 0:e.maskToClose)??!0,popupClass:e.popupClass,onClose:a,onBeforeCancel:o,"onUpdate:modelValue":()=>{s.component.props.modelValue=!1},onClosed:l,onOpened:()=>{}},{title:m(),default:u(),footer:h()});t.render(s,n)};(()=>{Qe.forEach(e=>{W[e]=(n,l)=>{const o=[],a=[];let c=()=>!0,f=()=>!0;return setTimeout(()=>{W({title:n,content:l,type:e,beforeOnCancel:f,beforeOnOk:c,onOk:()=>{o.forEach(r=>k(r)&&r())},onCancel:()=>{a.forEach(r=>k(r)&&r())}})},0),{ok(...r){return r.length===1&&o.push(r[0]),r.length===2&&(c=r[0],o.push(r[1])),this},cancel(...r){return r.length===1&&a.push(r[0]),r.length===2&&(f=r[0],a.push(r[1])),this}}}})})();const fe=S(b("MessageBox"),W),ve={position:{type:String,default:"top-right"},offset:{type:Number,default:0},title:{type:String,default:""},type:{type:String,default:"info"},message:{type:String,default:void 0},duration:{type:Number,default:3e3},showClose:{type:Boolean,default:!0},onClose:{type:Function,default:()=>{}},renderToBody:{type:Boolean,default:!1}},ue=t.defineComponent({name:b("Notification"),props:ve,emits:["close","destroy"],setup(e,{emit:n,slots:l}){const o=V("notification"),a=o.block,c=t.computed(()=>[a,o.modifier(r.value.ver)]),{zIndex:f}=I("message",{runOnMounted:!0}),r=t.computed(()=>{const g=e.position.split("-");return{hor:g[1],ver:g[0]}}),m=t.computed(()=>`x-notification-slide-${r.value.hor}`),u=t.computed(()=>{const g={};return g.position=e.renderToBody?"fixed":"absolute",g.zIndex=f.value,g[r.value.hor]="20px",g[r.value.ver]=`${e.offset}px`,g}),h=t.ref(!1);let s=0;const i=()=>{s=setTimeout(()=>{h.value=!1},e.duration)},d=t.computed(()=>e.type==="info"?H:e.type==="warning"?P:e.type==="strong"?_:e.type==="success"?j:e.type==="error"?L:""),N=()=>{h.value=!1};return t.onMounted(()=>{e.duration!==0&&i(),h.value=!0}),t.onUnmounted(()=>{clearTimeout(s)}),()=>t.createVNode(t.Transition,{name:m.value,onBeforeLeave:()=>n("close"),onAfterLeave:()=>n("destroy")},{default:()=>{var g;return[h.value&&t.createVNode("div",{class:c.value,style:u.value},[t.createVNode("div",{class:[o.element("header")]},[t.createVNode("div",{class:[o.element("icon"),o.modifier(`icon-${e.type}`)]},[d.value&&t.createVNode(d.value,null,null)]),t.createVNode("div",null,[t.createVNode("div",{class:[o.element("title")]},[e.title]),t.createVNode("div",{class:[o.element("message")]},[((g=l.default)==null?void 0:g.call(l))||e.message])])]),e.showClose&&t.createVNode("span",{class:[o.element("close-icon")],onClick:N},null)])]}})}}),me=S(b("Notification"),ue),ge=Object.freeze(Object.defineProperty({__proto__:null,XButton:O,XDialog:G,XMessage:ie,XMessageBox:fe,XNotification:me,XSpace:X},Symbol.toStringTag,{value:"Module"}));function he(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!t.isVNode(e)}const ye=V("dialog"),et=e=>{const n=document.createElement("div"),l=()=>{t.render(null,n)},o=s=>{if(s==="cancel")return e.beforeOnCancel?e.beforeOnCancel():!0;if(s==="ok")return e.beforeOnOk?e.beforeOnOk():!0},a=(s,i)=>{s==="cancel"&&e.onCancel&&e.onCancel(i),s==="ok"&&e.onOk&&e.onOk(i)},c=s=>{if(t.isVNode(s))return s;if(k(s)){const i=s();return t.isVNode(i)?i:null}return t.createVNode("div",{class:ye.element("header-title")},[t.createTextVNode(" "),s,t.createTextVNode(" ")])},f=s=>{if(t.isVNode(s))return s;if(k(s)){const i=s();return t.isVNode(i)?i:null}return t.createVNode("div",{class:ye.element("content")},[t.createTextVNode(" "),e.content,t.createTextVNode(" ")])},r=()=>()=>t.createVNode(t.Fragment,null,[e.title&&c(e.title)]),m=()=>()=>t.createVNode(t.Fragment,null,[e.content&&f(e.content)]),u=()=>{if(t.isVNode(e.footer)||k(e.footer))return e.footer;const s=(e==null?void 0:e.cancelText)||"取消",i=(e==null?void 0:e.okText)||"确认";return d=>t.createVNode(X,{size:12},{default:()=>{var N,g;return[!e.hideCancel&&t.createVNode(O,{size:"small",onClick:d.cancel,loading:(N=d.loadingObj)==null?void 0:N.cancel},he(s)?s:{default:()=>[s]}),!e.hideOk&&t.createVNode(O,{type:"primary",size:"small",onClick:d.ok,loading:(g=d.loadingObj)==null?void 0:g.ok},he(i)?i:{default:()=>[i]})]}})},h=t.createVNode(se,{width:(e==null?void 0:e.width)??368,height:(e==null?void 0:e.height)??"auto",modelValue:!0,renderTo:e==null?void 0:e.renderTo,center:e!=null&&e.top?!1:(e==null?void 0:e.center)??!0,top:(e==null?void 0:e.top)??0,mask:(e==null?void 0:e.mask)??!0,maskToClose:(e==null?void 0:e.maskToClose)??!0,popupClass:e.popupClass,onClose:a,onBeforeCancel:o,"onUpdate:modelValue":()=>{h.component.props.modelValue=!1},onClosed:l,onOpened:()=>{}},{title:r(),default:m(),footer:u()});t.render(h,n)},tt=["success","warning","error","strong","info"],nt=t.defineComponent({name:b("Message"),components:{CloseCircleFill:L,CheckCircleFill:j,ExclamationCircleFill:P,InfoCircleFill:H,MinusCircleFill:_},props:{id:{type:String,default:""},message:{type:[String,Number,Object],default:""},type:{type:String,default:"success"},duration:{type:Number,default:1500},center:{type:Boolean,default:!1},onClose:{type:Function,default:()=>{}},offset:{type:Number,default:20},zIndex:{type:Number,default:0},showClose:{type:Boolean,default:!1},useHTML:Boolean,popupClass:{type:String,default:void 0}},emits:["destroy"],setup(e){const n=V("message"),l=t.computed(()=>[n.block,n.modifier(e.type),e.center&&n.modifier("center"),e.showClose&&!e.center&&n.element("show-close"),e.popupClass&&e.popupClass]),o=t.ref(!1);let a=null;const c=()=>{a=setTimeout(()=>{o.value=!1},e.duration)};t.onMounted(()=>{o.value=!0,e.duration!==0&&c()}),t.onUnmounted(()=>{clearTimeout(a)});const{zIndex:f}=I("message",{runOnMounted:!0}),r=t.computed(()=>({top:`${e.offset}px`,zIndex:f.value}));return{cn:n,cls:l,styles:r,visible:o,handleClose:()=>{o.value=!1}}}}),lt=(e,n)=>{const l=e.__vccOpts||e;for(const[o,a]of n)l[o]=a;return l},ot=["innerHTML"],rt={key:1};function at(e,n,l,o,a,c){const f=t.resolveComponent("CheckCircleFill"),r=t.resolveComponent("ExclamationCircleFill"),m=t.resolveComponent("MinusCircleFill"),u=t.resolveComponent("CloseCircleFill"),h=t.resolveComponent("InfoCircleFill");return t.openBlock(),t.createBlock(t.Transition,{name:"x-message-slide-top",onBeforeLeave:e.onClose,onAfterLeave:n[1]||(n[1]=s=>e.$emit("destroy"))},{default:t.withCtx(()=>[t.withDirectives(t.createElementVNode("div",{class:t.normalizeClass(e.cls),style:t.normalizeStyle(e.styles)},[e.$slots.icon?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("span",{key:0,class:t.normalizeClass([e.cn.element("icon"),e.cn.modifier(`icon-${e.type}`)])},[t.renderSlot(e.$slots,"icon",{},()=>[e.type==="success"?(t.openBlock(),t.createBlock(f,{key:0})):e.type==="warning"?(t.openBlock(),t.createBlock(r,{key:1})):e.type==="strong"?(t.openBlock(),t.createBlock(m,{key:2})):e.type==="error"?(t.openBlock(),t.createBlock(u,{key:3})):e.type==="info"?(t.openBlock(),t.createBlock(h,{key:4})):t.createCommentVNode("",!0)])],2)),t.renderSlot(e.$slots,"default",{},()=>[e.useHTML?(t.openBlock(),t.createElementBlock("span",{key:0,innerHTML:e.message},null,8,ot)):(t.openBlock(),t.createElementBlock("span",rt,t.toDisplayString(e.message),1)),e.showClose?(t.openBlock(),t.createElementBlock("span",{key:2,class:t.normalizeClass([e.cn.element("close-icon")]),onClick:n[0]||(n[0]=(...s)=>e.handleClose&&e.handleClose(...s))},null,2)):t.createCommentVNode("",!0)])],6),[[t.vShow,e.visible]])]),_:3},8,["onBeforeLeave"])}const ct=lt(nt,[["render",at]]),J=new WeakMap,Z=e=>{(typeof e=="string"||t.isVNode(e))&&(e={message:e});const n=Y(e.renderTo||"body"),l=document.createElement("div");J.has(n)||J.set(n,[]);const o=J.get(n);let a=e.offset||20;o.forEach(s=>{var i;a+=((i=s.el)==null?void 0:i.offsetHeight)+20});const c=e.onClose;let f={};f={...e,onClose:()=>{var d;const s=o.findIndex(N=>N===u);if(s<0)return;const i=((d=u.el)==null?void 0:d.offsetHeight)+20;o.slice(s+1).forEach(N=>{var p;const g=(p=N.component)==null?void 0:p.props.offset;N.component.props.offset=g-i}),o.splice(s,1),c&&c(u)},onDestroy:()=>{t.render(null,l)},offset:a};const u=t.createVNode(ct,f,k(f.message)||t.isVNode(f.message)?{default:k(f.message)?f.message:()=>f.message}:null);return console.log("VM----",u),t.render(u,l),n.tagName==="BODY"?u.el.style.position="fixed":(n.style.position="relative",u.el.style.position="absolute"),n.appendChild(l.firstElementChild),o.push(u),{close:()=>{u.component.proxy.handleClose()}}};(()=>{tt.forEach(e=>{Z[e]=n=>ne(n)?Z({type:e,...n}):Z({message:n,type:e})})})();const A=new WeakMap,st=e=>{const n=Y(e.renderTo||"body"),l=document.createElement("div");A.get(n)||A.set(n,{}),A.get(n)[e.position]||(A.get(n)[e.position]=[]);const o=A.get(n)[e.position];let a=e.offset||20;o.forEach(h=>{var s;a+=((s=h.el)==null?void 0:s.offsetHeight)+20});const c=n.tagName==="BODY";c||(n.style.position="relative",n.style.overflowX="hidden");const f=e.onClose,r=()=>{var i;const h=o.findIndex(d=>d===u);if(h<0)return;const s=((i=u.el)==null?void 0:i.offsetHeight)+20;o.slice(h+1).forEach(d=>{var g;const N=(g=d.component)==null?void 0:g.props.offset;d.component.props.offset=N-s}),o.splice(h,1),f&&f(u)},m=()=>{t.render(null,l)},u=t.createVNode(ue,{message:e.message,title:e.title,type:e.type,offset:a,renderToBody:c,position:e.position,duration:e.duration??3e3,showClose:e.showClose??!0,onClose:r,onDestroy:m},k(e.message)||t.isVNode(e.message)?{default:k(e.message)?e.message:()=>e.message}:null);t.render(u,l),o.push(u),n==null||n.appendChild(l.firstChild)},it={install:function(e){Object.keys(ge).forEach(n=>{const l=ge[n];l.install&&e.use(l)})}};C.Dialog=et,C.Message=Z,C.MessageBox=W,C.Notification=st,C.XButton=O,C.XDialog=G,C.XMessage=ie,C.XMessageBox=fe,C.XNotification=me,C.XSpace=X,C.default=it,Object.defineProperties(C,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
1
|
+
(function(C,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],t):(C=typeof globalThis<"u"?globalThis:C||self,t(C.index={},C.Vue))})(this,function(C,t){"use strict";var Ct=Object.defineProperty;var Nt=(C,t,B)=>t in C?Ct(C,t,{enumerable:!0,configurable:!0,writable:!0,value:B}):C[t]=B;var T=(C,t,B)=>Nt(C,typeof t!="symbol"?t+"":t,B);const B="X",pe="x",ee=e=>e?pe+"-"+e:e||"",b=e=>B+e,V=e=>{const n=ee(e);return{block:n,element:c=>`${n}--${c}`,modifier:c=>`${n}-${c}`,is:c=>`${n}-is-${c}`}},M=Object.prototype.toString;function te(e){return M.call(e)==="[object Array]"}function ne(e){return M.call(e)==="[object Object]"}const le=e=>M.call(e)==="[object Promise]",Ve=e=>k(e)&&e.constructor.name==="AsyncFunction",we=e=>le(e)||Ve(e);function oe(e){return M.call(e)==="[object String]"}function Be(e){return M.call(e)==="[object Number]"&&e===e}function k(e){return typeof e=="function"}function $(){return typeof window<"u"}const E=e=>e,Se=e=>!!(e&&e.shapeFlag&1),xe=(e,n)=>!!(e&&e.shapeFlag&6),Oe=(e,n)=>!!(e&&e.shapeFlag&8),Te=(e,n)=>!!(e&&e.shapeFlag&16),Me=(e,n)=>!!(e&&e.shapeFlag&32),D=(e,n=!1)=>{var o,a;const l=[];for(const c of e??[])Se(c)||xe(c)||n&&Oe(c,c.children)?l.push(c):Te(c,c.children)?l.push(...D(c.children,n)):Me(c,c.children)?l.push(...D((a=(o=c.children).default)==null?void 0:a.call(o),n)):te(c)&&l.push(...D(c,n));return l},S=(e,n)=>Object.assign(n,{install(l){l.component(e)||l.component(e,n)}}),Ee={disabled:Boolean,block:Boolean,loading:Boolean,loadingFill:{type:Boolean,default:!1},debounce:{type:Number,default:0},shape:{type:E(String),default:void 0},link:{type:Boolean,default:!1},type:{type:E(String),default:void 0},status:{type:E(String),default:void 0},plain:{type:Boolean,default:!1},size:{type:E(String),default:"medium"},border:{type:Boolean,default:!0}},Fe=e=>oe(e)?e.split("-").map(n=>n.charAt(0).toUpperCase()+n.slice(1)).join(""):"",Ae=(e,n="px")=>{if(e===void 0)return"";const l=typeof e=="number"?`${e}`:e;return["px","%","vh","vw","calc"].some(a=>l.includes(a))?l:l+n};function x(e,n){return t.defineComponent({name:ee(`Icon${Fe(e)}`),props:{size:{type:[Number,String],default:void 0},rotate:{type:Number,default:void 0},spin:{type:Boolean,default:!1},color:{type:String,default:void 0},fillColor:{type:Array,default:void 0}},setup(l){const o="x-icon",a=t.computed(()=>{const f={};return l.size&&(f.fontSize=Ae(l.size)),l.rotate&&(f.transform=`rotate(${l.rotate}deg)`),l.color&&(f.color=l.color),f}),c=t.computed(()=>[o,{[`${o}-loading`]:l.spin}]);return()=>t.createVNode("div",{class:c.value,style:a.value},[n])}})}const ze=x("InfoCircleFill",t.h(t.createVNode("svg",{viewBox:"0 0 50 50",class:"x-icon-loading-svg"},[t.createVNode("circle",{cx:"25",cy:"25",r:"20",class:"path",fill:"none",stroke:"currentColor"},null)]))),$e=t.defineComponent({name:"Button",props:Ee,emits:["click"],$slots:["prefix","suffix"],setup(e,{slots:n,emit:l}){const o=t.reactive({clicked:!1,isDebounce:!1}),a=V("button"),c=t.computed(()=>[a.block,e.type&&a.modifier(e.type),e.status&&a.modifier(e.status),e.disabled&&a.is("disabled"),e.block&&a.modifier("block"),e.plain&&a.is("plain"),e.shape&&a.modifier(e.shape),e.link&&a.modifier("is-link"),e.size&&a.modifier(e.size),!e.border&&a.modifier("is-hide-border"),r.value&&a.modifier("is-loading")]),f=()=>{e.debounce>0&&!o.isDebounce&&(o.isDebounce=!0,setTimeout(()=>{o.isDebounce=!1},e.debounce))},r=t.computed(()=>e.loading||o.clicked||o.isDebounce),m=t.getCurrentInstance(),u=(s,i)=>{const d=s(i);we(d)&&(o.clicked=!0,d.finally(()=>{o.clicked=!1}))},h=s=>{var d,N,g,p;if(s.stopPropagation(),(N=(d=s.target).blur)==null||N.call(d),r.value)return;f();const i=(p=(g=m==null?void 0:m.vnode)==null?void 0:g.props)==null?void 0:p.onClick;if(te(i))i.forEach(Q=>u(Q,s));else if(k(i)){u(i,s);return}};return()=>{var s;return t.createVNode("button",{class:c.value,type:"button",disabled:e.disabled,onClick:h},[t.createVNode("span",{style:{display:r.value?"flex":"none",marginRight:r.value?"4px":"0px"},class:a.element("loading")},[t.createVNode(ze,null,null)]),n.prefix&&t.createVNode("span",{class:a.element("prefix")},[n.prefix()]),t.createVNode("span",{class:a.element("content")},[(s=n.default)==null?void 0:s.call(n)]),n.suffix&&t.createVNode("span",{class:a.element("suffix")},[n.suffix()])])}}}),O=S(b("Button"),$e),De=["px","%","vh","vw","calc"],re=(e,n="px")=>{if(e===void 0)return"";const l=String(e);return De.some(o=>l.includes(o))?l:l+n},Ie=1e3,Le=3e3,je=1;class Pe{constructor(){T(this,"popupStack",{popup:new Set,dialog:new Set,message:new Set});T(this,"getNextZIndex",n=>(n==="message"?Array.from(this.popupStack.message).pop()||Le:Array.from(this.popupStack.popup).pop()||Ie)+je);T(this,"add",n=>{const l=this.getNextZIndex(n);return this.popupStack[n].add(l),n==="dialog"&&this.popupStack.popup.add(l),l});T(this,"delete",(n,l)=>{this.popupStack[l].delete(n),l==="dialog"&&this.popupStack.popup.delete(n)});T(this,"isLastDialog",n=>this.popupStack.dialog.size>1?n===Array.from(this.popupStack.dialog).pop():!0)}}const K=new Pe;function I(e,{visible:n,runOnMounted:l}={}){const o=t.ref(0),a=()=>{o.value=K.add(e)},c=()=>{K.delete(o.value,e)},f=()=>e==="dialog"?K.isLastDialog(o.value):!1;return t.watch(()=>n==null?void 0:n.value,r=>{r?a():c()},{immediate:!0}),l&&(t.onMounted(a),t.onBeforeUnmount(c)),{zIndex:t.readonly(o),open:a,close:c,isLastDialog:f}}const ae=e=>e.replace(/^./,n=>n.toLowerCase()).replace(/-(\w)/g,(n,l)=>(l==null?void 0:l.toUpperCase())??""),ce=()=>{},He=(e,n)=>{if($)return(n??document).querySelector(e)??void 0},_e=e=>{if(e.tagName==="BODY")return window.innerWidth-(document.documentElement.offsetWidth||document.body.offsetWidth);const{borderLeftWidth:n,borderRightWidth:l}=window.getComputedStyle(e),o=Number(n.replace("px",""))+Number(l.replace("px",""));return e.offsetWidth-(e.clientWidth+o)},Xe=e=>e.tagName==="BODY"?document.documentElement.scrollHeight>window.innerHeight:e.scrollHeight>e.offsetHeight,We=(e,n)=>{var o;if(!$||!e||!n)return"";let l=ae(n);l==="float"&&(l="cssFloat");try{const a=e.style[l];if(a)return a;const c=(o=document.defaultView)==null?void 0:o.getComputedStyle(e,"");return c?c[l]:""}catch{return e.style[l]}},F=(e,n,l)=>{if(!(!e||!n))if(ne(n))Object.entries(n).forEach(([o,a])=>F(e,o,a));else{const o=ae(n);e.style[o]=l}},Y=(e,n)=>{if(oe(e)){const l=e[0]==="#"?`[id='${e.slice(1)}']`:e;return He(l,n)}return e},Ze=$?(e,n,l,o=!1)=>{e.addEventListener(n,l,o)}:ce,Ue=$?(e,n,l,o=!1)=>{e.removeEventListener(n,l,o)}:ce,Re=(e,n)=>{let l=!1;const o={overflow:"",width:""},a=r=>r.tagName==="BODY",c=()=>{if(e.value){const r=e.value;if(!l&&r.style.overflow!=="hidden"){const m=_e(r);if(m>0||Xe(r)){o.overflow=r.style.overflow,o.width=r.style.width;let u=0;a(r)&&(u=r.getBoundingClientRect().left||0),F(r,{width:`calc(100% - ${Math.ceil(m-u)}px)`,overflow:"hidden"}),l=!0}}}},f=()=>{if(e.value&&l){const r=e.value;F(r,{overflow:o.overflow,width:o.width}),l=!1}};return t.watch(()=>n==null?void 0:n.value,r=>{e.value&&!a(e.value)&&(r&&F(r,{position:"absolute"}),We(e.value,"position")==="static"&&F(e.value,{position:"relative"}))}),{setOverflowHidden:c,resetOverflow:f}},Ke={ENTER:"Enter",ESC:"Escape",BACKSPACE:"Backspace",TAB:"Tab",SPACE:" ",ARROW_UP:"ArrowUp",ARROW_DOWN:"ArrowDown",ARROW_LEFT:"ArrowLeft",ARROW_RIGHT:"ArrowRight"},Ye={renderTo:{type:E([String,Object]),default:"body"},disabled:{type:Boolean,default:!1},modelValue:{type:Boolean,default:!1},top:{type:[String,Number],default:"3vh"},center:{type:Boolean,default:!1},width:{type:[String,Number],default:0},height:{type:[String,Number],default:0},minWidth:{type:[String,Number],default:0},minHeight:{type:[String,Number],default:0},title:{type:String,default:""},mask:{type:Boolean,default:!0},destroyOnClosed:{type:Boolean,default:!0},onBeforeCancel:{type:Function},maskToClose:{type:Boolean,default:!0},escToClose:{type:Boolean,default:!0},fullscreen:{type:Boolean,default:!1},messageBox:{type:Boolean,default:!1},popupClass:{type:String,default:void 0},showClose:{type:Boolean,default:!0},showHeaderBottomLine:{type:Boolean,default:!1}},Ge=["width","minWidth","height","minHeight"],se=t.defineComponent({name:b("Dialog"),inheritAttrs:!1,props:Ye,emits:["closed","close","open","opened","update:modelValue"],setup(e,{emit:n,slots:l}){const o=V("dialog"),a=o.block,c=V("message-box");c.block;const f=t.computed(()=>[a,e.messageBox&&"is-message-box",e.popupClass&&e.popupClass]),r=t.computed(()=>Y(e.renderTo)),m=t.ref(),u=t.computed(()=>e.disabled||!r.value),h=t.computed(()=>({zIndex:g.value})),s=t.computed(()=>{const y={};return e.fullscreen||(!e.center&&e.top&&(y.top=re(e.top)),Ge.forEach(w=>{e[w]&&(y[w]=re(e[w]))})),y}),i=t.ref(!1),d=t.computed(()=>e.modelValue),N=t.computed(()=>d.value||i.value),{zIndex:g,isLastDialog:p}=I("dialog",{visible:d}),{setOverflowHidden:Q,resetOverflow:Ce}=Re(r,m),Ne=(y,w)=>{n("update:modelValue",!1),n("close",e.messageBox?y:void 0,e.messageBox?w:void 0)},dt=()=>{i.value=!1,Ce(),n("closed")},ft=()=>{n("opened")},U=t.reactive({ok:!1,cancel:!1}),z=(y,w)=>{let R=!0;if(U[y]=!0,k(e.onBeforeCancel)&&(R=e.onBeforeCancel(y)??!1),le(R)){R.then(yt=>{U[y]=!1,yt&&Ne(y,w)});return}U[y]=!1,R&&Ne(y,w)},ut=()=>{e.maskToClose&&e.mask&&z("cancel")},mt=y=>{z("cancel",y)},gt=y=>{z("ok",y)};let v=!1;const ke=y=>{e.escToClose&&y.key===Ke.ESC&&p()&&z("cancel")},ht=()=>{e.escToClose&&!v&&(v=!0,Ze(document.documentElement,"keydown",ke))},be=()=>{v=!1,Ue(document.documentElement,"keydown",ke)};return t.onBeforeUnmount(()=>{Ce(),be()}),t.watch(()=>d.value,y=>{y?(n("open"),Q(),i.value=!0,ht()):be()},{immediate:!0}),()=>t.createVNode(t.Teleport,{to:r.value,disabled:u.value},{default:()=>[N.value&&t.createVNode("div",{ref:m,class:f.value,style:h.value},[t.createVNode(t.Transition,{name:"x-fade-in-standard",appear:!0},{default:()=>[e.mask&&d.value&&t.createVNode("div",{class:o.element("mask")},null)]}),t.createVNode("div",{class:[o.element("wrapper"),{"is-center":e.center}],onClick:y=>y.target===y.currentTarget&&ut()},[t.createVNode(t.Transition,{name:"x-zoom-in",appear:!0,onAfterEnter:ft,onAfterLeave:dt},{default:()=>[d.value&&t.createVNode("div",{class:[o.element("container"),{"is-fullscreen":e.fullscreen}],style:s.value},[t.createVNode("div",{class:[e.messageBox?c.element("header"):o.element("header"),e.showHeaderBottomLine&&"is-bottom-line"]},[l.title?l.title():t.createVNode("div",{class:[o.element("header-title")]},[e.title])]),t.createVNode("div",{class:[e.messageBox?c.element("body"):o.element("body")]},[l.default&&l.default()]),t.createVNode("div",{class:[e.messageBox?c.element("footer"):o.element("footer")]},[l.footer&&l.footer({cancel:mt,ok:gt,"loading-obj":U})]),e.showClose&&t.createVNode("span",{class:[o.element("close-icon"),e.messageBox&&c.element("close-icon")],onClick:()=>z("cancel")},null)])]})])])]})}}),G=S(b("Dialog"),se),L=x("CloseCircleFill",t.h(t.createVNode("svg",{viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",stroke:"currentColor","stroke-width":"4","stroke-linecap":"butt","stroke-linejoin":"miter",filter:""},[t.createVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M24 44c11.046 0 20-8.954 20-20S35.046 4 24 4 4 12.954 4 24s8.954 20 20 20Zm4.955-27.771-4.95 4.95-4.95-4.95a1 1 0 0 0-1.414 0l-1.414 1.414a1 1 0 0 0 0 1.414l4.95 4.95-4.95 4.95a1 1 0 0 0 0 1.414l1.414 1.414a1 1 0 0 0 1.414 0l4.95-4.95 4.95 4.95a1 1 0 0 0 1.414 0l1.414-1.414a1 1 0 0 0 0-1.414l-4.95-4.95 4.95-4.95a1 1 0 0 0 0-1.414l-1.414-1.414a1 1 0 0 0-1.414 0Z",fill:"currentColor",stroke:"none"},null)]))),j=x("CheckCircleFill",t.h(t.createVNode("svg",{viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",stroke:"currentColor","stroke-width":"4","stroke-linecap":"butt","stroke-linejoin":"miter",filter:""},[t.createVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M24 44c11.046 0 20-8.954 20-20S35.046 4 24 4 4 12.954 4 24s8.954 20 20 20Zm10.207-24.379a1 1 0 0 0 0-1.414l-1.414-1.414a1 1 0 0 0-1.414 0L22 26.172l-4.878-4.88a1 1 0 0 0-1.415 0l-1.414 1.415a1 1 0 0 0 0 1.414l7 7a1 1 0 0 0 1.414 0l11.5-11.5Z",fill:"currentColor",stroke:"none"},null)]))),P=x("ExclamationCircleFill",t.h(t.createVNode("svg",{viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",stroke:"currentColor","stroke-width":"4","stroke-linecap":"butt","stroke-linejoin":"miter",filter:""},[t.createVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M24 44c11.046 0 20-8.954 20-20S35.046 4 24 4 4 12.954 4 24s8.954 20 20 20Zm2-30a1 1 0 0 0-1-1h-2a1 1 0 0 0-1 1v2a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1v-2Zm0 17h1a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1h-6a1 1 0 0 1-1-1v-2a1 1 0 0 1 1-1h1v-8a1 1 0 0 1-1-1v-2a1 1 0 0 1 1-1h3a1 1 0 0 1 1 1v11Z",fill:"currentColor",stroke:"none"},null)]))),H=x("InfoCircleFill",t.h(t.createVNode("svg",{viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",stroke:"currentColor","stroke-width":"4","stroke-linecap":"butt","stroke-linejoin":"miter",filter:""},[t.createVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M24 44c11.046 0 20-8.954 20-20S35.046 4 24 4 4 12.954 4 24s8.954 20 20 20Zm2-30a1 1 0 0 0-1-1h-2a1 1 0 0 0-1 1v2a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1v-2Zm0 17h1a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1h-6a1 1 0 0 1-1-1v-2a1 1 0 0 1 1-1h1v-8a1 1 0 0 1-1-1v-2a1 1 0 0 1 1-1h3a1 1 0 0 1 1 1v11Z",fill:"currentColor",stroke:"none"},null)]))),_=x("MinusCircleFill",t.h(t.createVNode("svg",{viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",stroke:"currentColor","stroke-width":"4","stroke-linecap":"butt","stroke-linejoin":"miter",filter:""},[t.createVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M24 44c11.046 0 20-8.954 20-20S35.046 4 24 4 4 12.954 4 24s8.954 20 20 20Zm-7-22a1 1 0 0 0-1 1v2a1 1 0 0 0 1 1h14a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1H17Z",fill:"currentColor",stroke:"none"},null)]))),qe=t.defineComponent({name:b("Message"),props:{id:{type:String,default:""},message:{type:[String,Number,Object],default:""},type:{type:String,default:"success"},duration:{type:Number,default:1500},center:{type:Boolean,default:!1},onClose:{type:Function,default:()=>{}},offset:{type:Number,default:20},zIndex:{type:Number,default:0},showClose:{type:Boolean,default:!1},useHTML:{type:Boolean,default:!1},popupClass:{type:String,default:void 0}},emits:["destroy"],setup(e,{emit:n,slots:l}){const o=V("message"),a=t.ref(!1),c=t.ref(null),f=t.computed(()=>[o.block,o.modifier(e.type),e.center&&o.modifier("center"),e.showClose&&!e.center&&o.element("show-close"),e.popupClass]),{zIndex:r}=I("message",{runOnMounted:!0}),m=t.computed(()=>({top:`${e.offset}px`,zIndex:r.value})),u=()=>{if(l.icon)return l.icon();switch(e.type){case"success":return t.createVNode(j,null,null);case"warning":return t.createVNode(P,null,null);case"strong":return t.createVNode(_,null,null);case"error":return t.createVNode(L,null,null);case"info":return t.createVNode(H,null,null);default:return null}},h=()=>{e.duration>0&&(c.value=setTimeout(()=>{a.value=!1},e.duration))},s=()=>{c.value&&(clearTimeout(c.value),c.value=null)};t.onMounted(()=>{a.value=!0,h()}),t.onUnmounted(()=>{s()});const i=()=>{var d;a.value=!1,s(),(d=e.onClose)==null||d.call(e)};return()=>t.createVNode(t.Transition,{name:"x-message-slide-top",onBeforeLeave:e.onClose,onAfterLeave:()=>n("destroy")},{default:()=>[a.value&&t.createVNode("div",{class:f.value,style:m.value},[t.createVNode("span",{class:[o.element("icon"),o.modifier(`icon-${e.type}`)]},[u()]),t.createVNode("div",null,[l.default?l.default():e.useHTML?t.createVNode("span",{innerHTML:e.message},null):t.createVNode("span",null,[e.message]),e.showClose&&t.createVNode("span",{class:o.element("close-icon"),onClick:i},null)])])]})}}),ie=S(b("Message"),qe),Je=t.defineComponent({name:"Space",props:{direction:{type:String,default:"horizontal"},size:{type:[Number,String],default:"small"},align:{type:String,default:"center"},fill:{type:Boolean,default:!1}},setup(e,{slots:n}){const l=V("space"),o=t.computed(()=>[l.block,l.element(e.direction),e.fill&&"is-fill",l.element(`${e.direction}-${e.align}`)]);function a(f){if(Be(f))return f;switch(f){case"mini":return 4;case"small":return 8;case"medium":return 16;case"large":return 24;default:return 8}}const c=f=>{const r={};if(f)return r;const m=`${a(e.size)}px`,u=`${a(e.size)}px`;return e.direction==="horizontal"&&(r.marginRight=m),e.direction==="vertical"&&(r.marginBottom=u),r};return()=>{var r;const f=D((r=n.default)==null?void 0:r.call(n),!0).filter(m=>m.type!==t.Comment);return t.createVNode("div",{class:[o.value]},[f.map((m,u)=>{var s;const h=n.split&&u>0;return t.createVNode(t.Fragment,{key:`space-item-${u}`},[h&&t.createVNode("div",{className:l.element("split"),style:c(!1)},[(s=n.split)==null?void 0:s.call(n)]),t.createVNode("div",{className:l.element("item"),style:c(u===f.length-1)},[m])])})])}}}),X=S(b("Space"),Je),Qe=["info","success","warning","strong","error"];function de(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!t.isVNode(e)}const q=V("message-box"),W=e=>{const n=document.createElement("div"),l=()=>{t.render(null,n)},o=i=>{if(i==="cancel")return e.beforeOnCancel?e.beforeOnCancel():!0;if(i==="ok")return e.beforeOnOk?e.beforeOnOk():!0},a=(i,d)=>{i==="cancel"&&e.onCancel&&e.onCancel(d),i==="ok"&&e.onOk&&e.onOk(d)},c=i=>{let d;switch(i){case"warning":d=t.createVNode(P,{size:"22px",color:"#f6c64b"},null);break;case"strong":d=t.createVNode(_,{size:"22px",color:"#ff7125"},null);break;case"error":d=t.createVNode(L,{size:"22px",color:"#e24f48"},null);break;case"success":d=t.createVNode(j,{size:"22px",color:"#68d1ab"},null);break;case"info":d=t.createVNode(H,{size:"22px",color:"#2355f5"},null);break}return t.createVNode("div",{class:q.element("icon")},[d])},f=i=>{if(t.isVNode(i))return i;if(k(i)){const d=i();return t.isVNode(d)?d:null}return t.createVNode("div",{class:q.element("title")},[t.createTextVNode(" "),i,t.createTextVNode(" ")])},r=i=>{if(t.isVNode(i))return i;if(k(i)){const d=i();return t.isVNode(d)?d:null}return t.createVNode("div",{class:q.element("content")},[t.createTextVNode(" "),e.content,t.createTextVNode(" ")])},m=()=>()=>t.createVNode(t.Fragment,null,[c(e.type||"success"),e.title&&f(e.title)]),u=()=>()=>t.createVNode(t.Fragment,null,[e.content&&r(e.content)]),h=()=>{if(t.isVNode(e.footer)||k(e.footer))return e.footer;const i=(e==null?void 0:e.cancelText)||"取消",d=(e==null?void 0:e.okText)||"确认";return N=>t.createVNode(X,{size:12},{default:()=>{var g,p;return[!e.hideCancel&&t.createVNode(O,{size:"small",onClick:N.cancel,loading:(g=N.loadingObj)==null?void 0:g.cancel},de(i)?i:{default:()=>[i]}),!e.hideOk&&t.createVNode(O,{type:"primary",size:"small",onClick:N.ok,loading:(p=N.loadingObj)==null?void 0:p.ok},de(d)?d:{default:()=>[d]})]}})},s=t.createVNode(G,{messageBox:!0,width:(e==null?void 0:e.width)??358,height:(e==null?void 0:e.height)??"auto",modelValue:!0,renderTo:e==null?void 0:e.renderTo,center:e!=null&&e.top?!1:(e==null?void 0:e.center)??!0,top:(e==null?void 0:e.top)??0,mask:(e==null?void 0:e.mask)??!0,maskToClose:(e==null?void 0:e.maskToClose)??!0,popupClass:e.popupClass,onClose:a,onBeforeCancel:o,"onUpdate:modelValue":()=>{s.component.props.modelValue=!1},onClosed:l,onOpened:()=>{}},{title:m(),default:u(),footer:h()});t.render(s,n)};(()=>{Qe.forEach(e=>{W[e]=(n,l)=>{const o=[],a=[];let c=()=>!0,f=()=>!0;return setTimeout(()=>{W({title:n,content:l,type:e,beforeOnCancel:f,beforeOnOk:c,onOk:()=>{o.forEach(r=>k(r)&&r())},onCancel:()=>{a.forEach(r=>k(r)&&r())}})},0),{ok(...r){return r.length===1&&o.push(r[0]),r.length===2&&(c=r[0],o.push(r[1])),this},cancel(...r){return r.length===1&&a.push(r[0]),r.length===2&&(f=r[0],a.push(r[1])),this}}}})})();const fe=S(b("MessageBox"),W),ve={position:{type:String,default:"top-right"},offset:{type:Number,default:0},title:{type:String,default:""},type:{type:String,default:"info"},message:{type:String,default:void 0},duration:{type:Number,default:3e3},showClose:{type:Boolean,default:!0},onClose:{type:Function,default:()=>{}},renderToBody:{type:Boolean,default:!1}},ue=t.defineComponent({name:b("Notification"),props:ve,emits:["close","destroy"],setup(e,{emit:n,slots:l}){const o=V("notification"),a=o.block,c=t.computed(()=>[a,o.modifier(r.value.ver)]),{zIndex:f}=I("message",{runOnMounted:!0}),r=t.computed(()=>{const g=e.position.split("-");return{hor:g[1],ver:g[0]}}),m=t.computed(()=>`x-notification-slide-${r.value.hor}`),u=t.computed(()=>{const g={};return g.position=e.renderToBody?"fixed":"absolute",g.zIndex=f.value,g[r.value.hor]="20px",g[r.value.ver]=`${e.offset}px`,g}),h=t.ref(!1);let s=0;const i=()=>{s=setTimeout(()=>{h.value=!1},e.duration)},d=t.computed(()=>e.type==="info"?H:e.type==="warning"?P:e.type==="strong"?_:e.type==="success"?j:e.type==="error"?L:""),N=()=>{h.value=!1};return t.onMounted(()=>{e.duration!==0&&i(),h.value=!0}),t.onUnmounted(()=>{clearTimeout(s)}),()=>t.createVNode(t.Transition,{name:m.value,onBeforeLeave:()=>n("close"),onAfterLeave:()=>n("destroy")},{default:()=>{var g;return[h.value&&t.createVNode("div",{class:c.value,style:u.value},[t.createVNode("div",{class:[o.element("header")]},[t.createVNode("div",{class:[o.element("icon"),o.modifier(`icon-${e.type}`)]},[d.value&&t.createVNode(d.value,null,null)]),t.createVNode("div",null,[t.createVNode("div",{class:[o.element("title")]},[e.title]),t.createVNode("div",{class:[o.element("message")]},[((g=l.default)==null?void 0:g.call(l))||e.message])])]),e.showClose&&t.createVNode("span",{class:[o.element("close-icon")],onClick:N},null)])]}})}}),me=S(b("Notification"),ue),ge=Object.freeze(Object.defineProperty({__proto__:null,XButton:O,XDialog:G,XMessage:ie,XMessageBox:fe,XNotification:me,XSpace:X},Symbol.toStringTag,{value:"Module"}));function he(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!t.isVNode(e)}const ye=V("dialog"),et=e=>{const n=document.createElement("div"),l=()=>{t.render(null,n)},o=s=>{if(s==="cancel")return e.beforeOnCancel?e.beforeOnCancel():!0;if(s==="ok")return e.beforeOnOk?e.beforeOnOk():!0},a=(s,i)=>{s==="cancel"&&e.onCancel&&e.onCancel(i),s==="ok"&&e.onOk&&e.onOk(i)},c=s=>{if(t.isVNode(s))return s;if(k(s)){const i=s();return t.isVNode(i)?i:null}return t.createVNode("div",{class:ye.element("header-title")},[t.createTextVNode(" "),s,t.createTextVNode(" ")])},f=s=>{if(t.isVNode(s))return s;if(k(s)){const i=s();return t.isVNode(i)?i:null}return t.createVNode("div",{class:ye.element("content")},[t.createTextVNode(" "),e.content,t.createTextVNode(" ")])},r=()=>()=>t.createVNode(t.Fragment,null,[e.title&&c(e.title)]),m=()=>()=>t.createVNode(t.Fragment,null,[e.content&&f(e.content)]),u=()=>{if(t.isVNode(e.footer)||k(e.footer))return e.footer;const s=(e==null?void 0:e.cancelText)||"取消",i=(e==null?void 0:e.okText)||"确认";return d=>t.createVNode(X,{size:12},{default:()=>{var N,g;return[!e.hideCancel&&t.createVNode(O,{size:"small",onClick:d.cancel,loading:(N=d.loadingObj)==null?void 0:N.cancel},he(s)?s:{default:()=>[s]}),!e.hideOk&&t.createVNode(O,{type:"primary",size:"small",onClick:d.ok,loading:(g=d.loadingObj)==null?void 0:g.ok},he(i)?i:{default:()=>[i]})]}})},h=t.createVNode(se,{width:(e==null?void 0:e.width)??368,height:(e==null?void 0:e.height)??"auto",modelValue:!0,renderTo:e==null?void 0:e.renderTo,center:e!=null&&e.top?!1:(e==null?void 0:e.center)??!0,top:(e==null?void 0:e.top)??0,mask:(e==null?void 0:e.mask)??!0,maskToClose:(e==null?void 0:e.maskToClose)??!0,popupClass:e.popupClass,onClose:a,onBeforeCancel:o,"onUpdate:modelValue":()=>{h.component.props.modelValue=!1},onClosed:l,onOpened:()=>{}},{title:r(),default:m(),footer:u()});t.render(h,n)},tt=["success","warning","error","strong","info"],nt=t.defineComponent({name:b("Message"),components:{CloseCircleFill:L,CheckCircleFill:j,ExclamationCircleFill:P,InfoCircleFill:H,MinusCircleFill:_},props:{id:{type:String,default:""},message:{type:[String,Number,Object],default:""},type:{type:String,default:"success"},duration:{type:Number,default:1500},center:{type:Boolean,default:!1},onClose:{type:Function,default:()=>{}},offset:{type:Number,default:20},zIndex:{type:Number,default:0},showClose:{type:Boolean,default:!1},useHTML:Boolean,popupClass:{type:String,default:void 0}},emits:["destroy"],setup(e){const n=V("message"),l=t.computed(()=>[n.block,n.modifier(e.type),e.center&&n.modifier("center"),e.showClose&&!e.center&&n.element("show-close"),e.popupClass&&e.popupClass]),o=t.ref(!1);let a=null;const c=()=>{a=setTimeout(()=>{o.value=!1},e.duration)};t.onMounted(()=>{o.value=!0,e.duration!==0&&c()}),t.onUnmounted(()=>{clearTimeout(a)});const{zIndex:f}=I("message",{runOnMounted:!0}),r=t.computed(()=>({top:`${e.offset}px`,zIndex:f.value}));return{cn:n,cls:l,styles:r,visible:o,handleClose:()=>{o.value=!1}}}}),lt=(e,n)=>{const l=e.__vccOpts||e;for(const[o,a]of n)l[o]=a;return l},ot=["innerHTML"],rt={key:1};function at(e,n,l,o,a,c){const f=t.resolveComponent("CheckCircleFill"),r=t.resolveComponent("ExclamationCircleFill"),m=t.resolveComponent("MinusCircleFill"),u=t.resolveComponent("CloseCircleFill"),h=t.resolveComponent("InfoCircleFill");return t.openBlock(),t.createBlock(t.Transition,{name:"x-message-slide-top",onBeforeLeave:e.onClose,onAfterLeave:n[1]||(n[1]=s=>e.$emit("destroy"))},{default:t.withCtx(()=>[t.withDirectives(t.createElementVNode("div",{class:t.normalizeClass(e.cls),style:t.normalizeStyle(e.styles)},[e.$slots.icon?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("span",{key:0,class:t.normalizeClass([e.cn.element("icon"),e.cn.modifier(`icon-${e.type}`)])},[t.renderSlot(e.$slots,"icon",{},()=>[e.type==="success"?(t.openBlock(),t.createBlock(f,{key:0})):e.type==="warning"?(t.openBlock(),t.createBlock(r,{key:1})):e.type==="strong"?(t.openBlock(),t.createBlock(m,{key:2})):e.type==="error"?(t.openBlock(),t.createBlock(u,{key:3})):e.type==="info"?(t.openBlock(),t.createBlock(h,{key:4})):t.createCommentVNode("",!0)])],2)),t.renderSlot(e.$slots,"default",{},()=>[e.useHTML?(t.openBlock(),t.createElementBlock("span",{key:0,innerHTML:e.message},null,8,ot)):(t.openBlock(),t.createElementBlock("span",rt,t.toDisplayString(e.message),1)),e.showClose?(t.openBlock(),t.createElementBlock("span",{key:2,class:t.normalizeClass([e.cn.element("close-icon")]),onClick:n[0]||(n[0]=(...s)=>e.handleClose&&e.handleClose(...s))},null,2)):t.createCommentVNode("",!0)])],6),[[t.vShow,e.visible]])]),_:3},8,["onBeforeLeave"])}const ct=lt(nt,[["render",at]]),J=new WeakMap,Z=e=>{(typeof e=="string"||t.isVNode(e))&&(e={message:e});const n=Y(e.renderTo||"body"),l=document.createElement("div");J.has(n)||J.set(n,[]);const o=J.get(n);let a=e.offset||20;o.forEach(s=>{var i;a+=((i=s.el)==null?void 0:i.offsetHeight)+20});const c=e.onClose;let f={};f={...e,onClose:()=>{var d;const s=o.findIndex(N=>N===u);if(s<0)return;const i=((d=u.el)==null?void 0:d.offsetHeight)+20;o.slice(s+1).forEach(N=>{var p;const g=(p=N.component)==null?void 0:p.props.offset;N.component.props.offset=g-i}),o.splice(s,1),c&&c(u)},onDestroy:()=>{t.render(null,l)},offset:a};const u=t.createVNode(ct,f,k(f.message)||t.isVNode(f.message)?{default:k(f.message)?f.message:()=>f.message}:null);return t.render(u,l),n.tagName==="BODY"?u.el.style.position="fixed":(n.style.position="relative",u.el.style.position="absolute"),n.appendChild(l.firstElementChild),o.push(u),{close:()=>{u.component.proxy.handleClose()}}};(()=>{tt.forEach(e=>{Z[e]=n=>ne(n)?Z({type:e,...n}):Z({message:n,type:e})})})();const A=new WeakMap,st=e=>{const n=Y(e.renderTo||"body"),l=document.createElement("div");A.get(n)||A.set(n,{}),A.get(n)[e.position]||(A.get(n)[e.position]=[]);const o=A.get(n)[e.position];let a=e.offset||20;o.forEach(h=>{var s;a+=((s=h.el)==null?void 0:s.offsetHeight)+20});const c=n.tagName==="BODY";c||(n.style.position="relative",n.style.overflowX="hidden");const f=e.onClose,r=()=>{var i;const h=o.findIndex(d=>d===u);if(h<0)return;const s=((i=u.el)==null?void 0:i.offsetHeight)+20;o.slice(h+1).forEach(d=>{var g;const N=(g=d.component)==null?void 0:g.props.offset;d.component.props.offset=N-s}),o.splice(h,1),f&&f(u)},m=()=>{t.render(null,l)},u=t.createVNode(ue,{message:e.message,title:e.title,type:e.type,offset:a,renderToBody:c,position:e.position,duration:e.duration??3e3,showClose:e.showClose??!0,onClose:r,onDestroy:m},k(e.message)||t.isVNode(e.message)?{default:k(e.message)?e.message:()=>e.message}:null);t.render(u,l),o.push(u),n==null||n.appendChild(l.firstChild)},it={install:function(e){Object.keys(ge).forEach(n=>{const l=ge[n];l.install&&e.use(l)})}};C.Dialog=et,C.Message=Z,C.MessageBox=W,C.Notification=st,C.XButton=O,C.XDialog=G,C.XMessage=ie,C.XMessageBox=fe,C.XNotification=me,C.XSpace=X,C.default=it,Object.defineProperties(C,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|