x-next 0.0.0-alpha.6 → 0.0.0-alpha.7

Sign up to get free protection for your applications and to get access to all the features.
package/dist/index.d.ts CHANGED
@@ -6,3 +6,7 @@ import { default as Notification } from './componets/notification/warp';
6
6
  export * from './components';
7
7
  export { Dialog, Message, MessageBox, Notification };
8
8
  export declare const install: (vueApp: App) => void;
9
+ declare const _default: {
10
+ install: (vueApp: App) => void;
11
+ };
12
+ export default _default;
package/dist/index.es.js CHANGED
@@ -712,7 +712,7 @@ const Ve = /* @__PURE__ */ N(It, [["render", Pt]]), Re = /* @__PURE__ */ F({
712
712
  function Ee(e) {
713
713
  return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !O(e);
714
714
  }
715
- const $e = I("dialog"), an = (e) => {
715
+ const $e = I("dialog"), cn = (e) => {
716
716
  const t = document.createElement("div"), n = () => {
717
717
  D(null, t);
718
718
  }, l = (i) => {
@@ -1370,7 +1370,7 @@ function ln(e, t, n, l, s, o) {
1370
1370
  _: 3
1371
1371
  }, 8, ["name"]);
1372
1372
  }
1373
- const on = /* @__PURE__ */ N(nn, [["render", ln]]), Z = /* @__PURE__ */ new WeakMap(), cn = (e) => {
1373
+ const on = /* @__PURE__ */ N(nn, [["render", ln]]), Z = /* @__PURE__ */ new WeakMap(), un = (e) => {
1374
1374
  const t = me(e.renderTo || "body"), n = document.createElement("div");
1375
1375
  Z.get(t) || Z.set(t, {}), Z.get(t)[e.position] || (Z.get(t)[e.position] = []);
1376
1376
  const l = Z.get(t)[e.position];
@@ -1412,17 +1412,20 @@ const on = /* @__PURE__ */ N(nn, [["render", ln]]), Z = /* @__PURE__ */ new Weak
1412
1412
  } : null
1413
1413
  );
1414
1414
  D(f, n), l.push(f), t == null || t.appendChild(n.firstChild);
1415
- }, un = function(e) {
1415
+ }, rn = function(e) {
1416
1416
  Object.keys(re).forEach((t) => {
1417
1417
  const n = re[t];
1418
1418
  e.component(t, re[t]), n.install && e.use(n);
1419
1419
  });
1420
+ }, dn = {
1421
+ install: rn
1420
1422
  };
1421
1423
  export {
1422
1424
  A as Button,
1423
- an as Dialog,
1425
+ cn as Dialog,
1424
1426
  ie as Message,
1425
1427
  Be as MessageBox,
1426
- cn as Notification,
1427
- un as install
1428
+ un as Notification,
1429
+ dn as default,
1430
+ rn as install
1428
1431
  };
package/dist/index.umd.js CHANGED
@@ -1 +1 @@
1
- (function(k,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],t):(k=typeof globalThis<"u"?globalThis:k||self,t(k.index={},k.Vue))})(this,function(k,t){"use strict";var St=Object.defineProperty;var $t=(k,t,V)=>t in k?St(k,t,{enumerable:!0,configurable:!0,writable:!0,value:V}):k[t]=V;var $=(k,t,V)=>$t(k,typeof t!="symbol"?t+"":t,V);const V="X",ge="x",v=e=>e?ge+"-"+e:e||"",T=e=>V+e,B=e=>{const n=v(e);return{block:n,element:r=>`${n}--${r}`,modifier:r=>`${n}-${r}`,is:r=>`${n}-is-${r}`}},z=Object.prototype.toString;function ee(e){return z.call(e)==="[object Array]"}function te(e){return z.call(e)==="[object Object]"}const ne=e=>z.call(e)==="[object Promise]";function le(e){return z.call(e)==="[object String]"}function ke(e){return z.call(e)==="[object Number]"&&e===e}function p(e){return typeof e=="function"}function I(){return typeof window<"u"}const M=e=>e;var O;(function(e){e[e.ELEMENT=1]="ELEMENT",e[e.FUNCTIONAL_COMPONENT=2]="FUNCTIONAL_COMPONENT",e[e.STATEFUL_COMPONENT=4]="STATEFUL_COMPONENT",e[e.COMPONENT=6]="COMPONENT",e[e.TEXT_CHILDREN=8]="TEXT_CHILDREN",e[e.ARRAY_CHILDREN=16]="ARRAY_CHILDREN",e[e.SLOTS_CHILDREN=32]="SLOTS_CHILDREN",e[e.TELEPORT=64]="TELEPORT",e[e.SUSPENSE=128]="SUSPENSE",e[e.COMPONENT_SHOULD_KEEP_ALIVE=256]="COMPONENT_SHOULD_KEEP_ALIVE",e[e.COMPONENT_KEPT_ALIVE=512]="COMPONENT_KEPT_ALIVE"})(O||(O={}));const pe=e=>!!(e&&e.shapeFlag&O.ELEMENT),he=(e,n)=>!!(e&&e.shapeFlag&O.COMPONENT),Ne=(e,n)=>!!(e&&e.shapeFlag&8),Ee=(e,n)=>!!(e&&e.shapeFlag&O.ARRAY_CHILDREN),Be=(e,n)=>!!(e&&e.shapeFlag&O.SLOTS_CHILDREN),P=(e,n=!1)=>{var l,o;const a=[];for(const r of e??[])pe(r)||he(r)||n&&Ne(r,r.children)?a.push(r):Ee(r,r.children)?a.push(...P(r.children,n)):Be(r,r.children)?a.push(...P((o=(l=r.children).default)===null||o===void 0?void 0:o.call(l),n)):ee(r)&&a.push(...P(r,n));return a},be={disabled:Boolean,block:Boolean,loading:Boolean,loadingFill:{type:Boolean,default:!1},debounce:{type:Number,default:0},shape:{type:M(String),default:void 0},link:{type:Boolean,default:!1},type:{type:M(String),default:void 0},status:{type:M(String),default:void 0},plain:{type:Boolean,default:!1},size:{type:M(String),default:"medium"},border:{type:Boolean,default:!0}},we=e=>le(e)?e.split("-").map(n=>n.charAt(0).toUpperCase()+n.slice(1)).join(""):"",Ve=(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 S(e){return t.defineComponent({name:v(`Icon${we(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(n){const l="x-icon",o=t.computed(()=>{const r={};return n.size&&(r.fontSize=Ve(n.size)),n.rotate&&(r.transform=`rotate(${n.rotate}deg)`),n.color&&(r.color=n.color),r});return{cls:t.computed(()=>[l,{[`${l}-loading`]:n.spin}]),styles:o}}})}const Oe=S("animation-loading"),N=(e,n)=>{const l=e.__vccOpts||e;for(const[o,a]of n)l[o]=a;return l};function Se(e,n,l,o,a,r){return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(e.cls),style:t.normalizeStyle(e.styles)},n[0]||(n[0]=[t.createElementVNode("svg",{viewBox:"0 0 50 50",class:"icon-loading-svg"},[t.createElementVNode("circle",{cx:"25",cy:"25",r:"20",class:"path",fill:"none",stroke:"currentColor"})],-1)]),6)}const $e=N(Oe,[["render",Se],["__scopeId","data-v-62d46830"]]),Te=t.defineComponent({name:T("Button"),components:{AnimationLoading:$e},props:be,emits:["click"],setup(e){const n=t.reactive({clicked:!1,isDebounce:!1}),l=B("button"),o=t.computed(()=>[l.block,e.type&&l.modifier(e.type),e.status&&l.modifier(e.status),e.disabled&&l.is("disabled"),e.block&&l.modifier("block"),e.plain&&l.is("plain"),e.shape&&l.modifier(e.shape),e.link&&l.modifier("is-link"),e.size&&l.modifier(e.size),!e.border&&l.modifier("is-hide-border"),r.value&&l.modifier("is-loading")]),a=()=>{e.debounce>0&&!n.isDebounce&&(n.isDebounce=!0,setTimeout(()=>{n.isDebounce=!1},e.debounce))},r=t.computed(()=>e.loading||n.clicked||n.isDebounce),f=t.getCurrentInstance(),s=(u,C)=>{const c=u(C);ne(c)&&(n.clicked=!0,c.finally(()=>{n.clicked=!1}))};return{cn:l,cls:o,handleClick:async u=>{var c,i,d,g;if((i=(c=u.target).blur)==null||i.call(c),r.value)return;a();const C=(g=(d=f==null?void 0:f.vnode)==null?void 0:d.props)==null?void 0:g.onClick;ee(C)?C.forEach(h=>s(h,u)):p(C)&&s(C,u)},isLoading:r}}}),ze=["disabled"];function Me(e,n,l,o,a,r){const f=t.resolveComponent("AnimationLoading");return t.openBlock(),t.createElementBlock("button",{class:t.normalizeClass(e.cls),type:"button",disabled:e.disabled,onClick:n[0]||(n[0]=(...s)=>e.handleClick&&e.handleClick(...s))},[t.withDirectives(t.createElementVNode("span",{class:t.normalizeClass([e.cn.element("loading")])},[t.createVNode(f)],2),[[t.vShow,e.isLoading]]),e.$slots.prefix?(t.openBlock(),t.createElementBlock("span",{key:0,class:t.normalizeClass([e.cn.element("prefix")])},[t.renderSlot(e.$slots,"prefix")],2)):t.createCommentVNode("",!0),t.renderSlot(e.$slots,"default"),e.$slots.suffix?(t.openBlock(),t.createElementBlock("span",{key:1,class:t.normalizeClass([e.cn.element("suffix")])},[t.renderSlot(e.$slots,"suffix")],2)):t.createCommentVNode("",!0)],10,ze)}const E=N(Te,[["render",Me]]);E.install=function(e){e.component(E.name,E)};const R=Object.freeze(Object.defineProperty({__proto__:null,Button:E},Symbol.toStringTag,{value:"Module"})),Le=["px","%","vh","vw","calc"],oe=(e,n="px")=>{if(e===void 0)return"";const l=String(e);return Le.some(o=>l.includes(o))?l:l+n},Ae=1e3,De=3e3,Ie=1;class Pe{constructor(){$(this,"popupStack",{popup:new Set,dialog:new Set,message:new Set});$(this,"getNextZIndex",n=>(n==="message"?Array.from(this.popupStack.message).pop()||De:Array.from(this.popupStack.popup).pop()||Ae)+Ie);$(this,"add",n=>{const l=this.getNextZIndex(n);return this.popupStack[n].add(l),n==="dialog"&&this.popupStack.popup.add(l),l});$(this,"delete",(n,l)=>{this.popupStack[l].delete(n),l==="dialog"&&this.popupStack.popup.delete(n)});$(this,"isLastDialog",n=>this.popupStack.dialog.size>1?n===Array.from(this.popupStack.dialog).pop():!0)}}const U=new Pe;function W(e,{visible:n,runOnMounted:l}={}){const o=t.ref(0),a=()=>{o.value=U.add(e)},r=()=>{U.delete(o.value,e)},f=()=>e==="dialog"?U.isLastDialog(o.value):!1;return t.watch(()=>n==null?void 0:n.value,s=>{s?a():r()},{immediate:!0}),l&&(t.onMounted(()=>{a()}),t.onBeforeUnmount(()=>{r()})),{zIndex:t.readonly(o),open:a,close:r,isLastDialog:f}}const re=e=>e.replace(/^./,n=>n.toLowerCase()).replace(/-(\w)/g,(n,l)=>{var o;return(o=l==null?void 0:l.toUpperCase())!==null&&o!==void 0?o:""}),se=()=>{},je=(e,n)=>{var l;if(I)return(l=document.querySelector(e))!==null&&l!==void 0?l:void 0},He=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)},Fe=e=>e.tagName==="BODY"?document.documentElement.scrollHeight>window.innerHeight:e.scrollHeight>e.offsetHeight,Re=(e,n)=>{var l;if(!I||!e||!n)return"";let o=re(n);o==="float"&&(o="cssFloat");try{const a=e.style[o];if(a)return a;const r=(l=document.defaultView)===null||l===void 0?void 0:l.getComputedStyle(e,"");return r?r[o]:""}catch{return e.style[o]}},L=(e,n,l)=>{if(!(!e||!n))if(te(n))Object.entries(n).forEach(([o,a])=>L(e,o,a));else{const o=re(n);e.style[o]=l}},Z=(e,n)=>{if(le(e)){const l=e[0]==="#"?`[id='${e.slice(1)}']`:e;return je(l)}return e},Ue=I?(e,n,l,o=!1)=>{e.addEventListener(n,l,o)}:se,We=I?(e,n,l,o=!1)=>{e.removeEventListener(n,l,o)}:se,Ze=(e,n)=>{let l=!1;const o={overflow:"",width:""},a=s=>s.tagName==="BODY",r=()=>{if(e.value){const s=e.value;if(!l&&s.style.overflow!=="hidden"){const m=He(s);if(m>0||Fe(s)){o.overflow=s.style.overflow,o.width=s.style.width;let u=0;a(s)&&(u=s.getBoundingClientRect().left||0),L(s,{width:`calc(100% - ${Math.ceil(m-u)}px)`,overflow:"hidden"}),l=!0}}}},f=()=>{if(e.value&&l){const s=e.value;L(s,{overflow:o.overflow,width:o.width}),l=!1}};return t.watch(()=>n==null?void 0:n.value,s=>{e.value&&!a(e.value)&&(s&&L(s,{position:"absolute"}),Re(e.value,"position")==="static"&&L(e.value,{position:"relative"}))}),{setOverflowHidden:r,resetOverflow:f}},Ke={ENTER:"Enter",ESC:"Escape",BACKSPACE:"Backspace",TAB:"Tab",SPACE:" ",ARROW_UP:"ArrowUp",ARROW_DOWN:"ArrowDown",ARROW_LEFT:"ArrowLeft",ARROW_RIGHT:"ArrowRight"},Xe={renderTo:{type:M([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}},Ye=["width","minWidth","height","minHeight"],Ge=t.defineComponent({name:T("Dialog"),inheritAttrs:!1,props:Xe,emits:["closed","close","open","opened","update:modelValue"],setup(e,{emit:n}){const l=B("dialog"),o=l.block,a=B("message-box"),r=a.block,f=t.computed(()=>[o,e.messageBox&&"is-message-box",e.popupClass&&e.popupClass]),s=t.computed(()=>Z(e.renderTo)),m=t.ref(),u=t.computed(()=>e.disabled||!s.value),C=t.computed(()=>({zIndex:h.value})),c=t.computed(()=>{const y={};return e.fullscreen||(!e.center&&e.top&&(y.top=oe(e.top)),Ye.forEach(b=>{e[b]&&(y[b]=oe(e[b]))})),y}),i=t.ref(!1),d=t.computed(()=>e.modelValue),g=t.computed(()=>d.value||i.value),{zIndex:h,isLastDialog:w}=W("dialog",{visible:d}),{setOverflowHidden:ht,resetOverflow:me}=Ze(s,m),ue=(y,b)=>{n("update:modelValue",!1),n("close",e.messageBox?y:void 0,e.messageBox?b:void 0)},Nt=()=>{i.value=!1,me(),n("closed")},Et=()=>{n("opened")},H=t.reactive({ok:!1,cancel:!1}),D=(y,b)=>{let F=!0;if(H[y]=!0,p(e.onBeforeCancel)&&(F=e.onBeforeCancel(y)??!1),ne(F)){F.then(Ot=>{H[y]=!1,Ot&&ue(y,b)});return}H[y]=!1,F&&ue(y,b)},Bt=()=>{e.maskToClose&&e.mask&&D("cancel")},bt=y=>{D("cancel",y)},wt=y=>{D("ok",y)};let _=!1;const Ce=y=>{e.escToClose&&y.key===Ke.ESC&&w()&&D("cancel")},Vt=()=>{e.escToClose&&!_&&(_=!0,Ue(document.documentElement,"keydown",Ce))},ye=()=>{_=!1,We(document.documentElement,"keydown",Ce)};return t.onBeforeUnmount(()=>{me(),ye()}),t.watch(()=>d.value,y=>{y?(n("open"),ht(),i.value=!0,Vt()):ye()},{immediate:!0}),{cls:f,ns:o,cn:l,cnOMB:a,messageBoxNs:r,containerStyle:c,dialogStyle:C,dialogRef:m,teleportContainer:s,teleportDisabled:u,modelVisible:d,mergeVisible:g,interceptClose:D,afterLeave:Nt,afterEnter:Et,handleMaskClick:Bt,handleCancel:bt,handleOk:wt,loadingObj:H}}});function qe(e,n,l,o,a,r){return t.openBlock(),t.createBlock(t.Teleport,{to:e.teleportContainer,disabled:e.teleportDisabled},[!e.destroyOnClosed||e.mergeVisible?t.withDirectives((t.openBlock(),t.createElementBlock("div",{key:0,ref:"dialogRef",class:t.normalizeClass(e.cls),style:t.normalizeStyle(e.dialogStyle)},[t.createVNode(t.Transition,{name:"x-fade-in-standard",appear:""},{default:t.withCtx(()=>[e.mask?t.withDirectives((t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass([e.cn.element("mask")])},null,2)),[[t.vShow,e.modelVisible]]):t.createCommentVNode("",!0)]),_:1}),t.createElementVNode("div",{class:t.normalizeClass([e.cn.element("wrapper"),{"is-center":e.center}]),onClick:n[1]||(n[1]=t.withModifiers((...f)=>e.handleMaskClick&&e.handleMaskClick(...f),["self"]))},[t.createVNode(t.Transition,{name:"x-zoom-in",appear:"",onAfterEnter:e.afterEnter,onAfterLeave:e.afterLeave},{default:t.withCtx(()=>[t.withDirectives(t.createElementVNode("div",{class:t.normalizeClass([e.cn.element("container"),{"is-fullscreen":e.fullscreen}]),style:t.normalizeStyle(e.containerStyle)},[t.createElementVNode("div",{class:t.normalizeClass([e.messageBox?e.cnOMB.element("header"):e.cn.element("header"),e.showHeaderBottomLine&&"is-bottom-line"])},[t.renderSlot(e.$slots,"title",{},()=>[t.createElementVNode("div",{class:t.normalizeClass([e.cn.element("header-title")])},t.toDisplayString(e.title),3)])],2),t.createElementVNode("div",{class:t.normalizeClass([e.messageBox?e.cnOMB.element("body"):e.cn.element("body")])},[t.renderSlot(e.$slots,"default")],2),t.createElementVNode("div",{class:t.normalizeClass([e.messageBox?e.cnOMB.element("footer"):e.cn.element("footer")])},[t.renderSlot(e.$slots,"footer",{cancel:e.handleCancel,ok:e.handleOk,loadingObj:e.loadingObj})],2),e.showClose?(t.openBlock(),t.createElementBlock("span",{key:0,class:t.normalizeClass([e.cn.element("close-icon"),e.messageBox&&e.cnOMB.element("close-icon")]),onClick:n[0]||(n[0]=f=>e.interceptClose("cancel"))},null,2)):t.createCommentVNode("",!0)],6),[[t.vShow,e.modelVisible]])]),_:3},8,["onAfterEnter","onAfterLeave"])],2)],6)),[[t.vShow,e.mergeVisible]]):t.createCommentVNode("",!0)],8,["to","disabled"])}const ae=N(Ge,[["render",qe]]),ie=t.defineComponent({name:T("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=B("space"),o=t.computed(()=>[l.block,l.element(e.direction),e.fill&&"is-fill",l.element(`${e.direction}-${e.align}`)]);function a(f){if(ke(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 r=f=>{const s={};if(f)return s;const m=`${a(e.size)}px`,u=`${a(e.size)}px`;return e.direction==="horizontal"&&(s.marginRight=m),e.direction==="vertical"&&(s.marginBottom=u),s};return()=>{var s;const f=P((s=n.default)==null?void 0:s.call(n),!0).filter(m=>m.type!==t.Comment);return t.createVNode("div",{class:[o.value]},[f.map((m,u)=>{var c;const C=n.split&&u>0;return t.createVNode(t.Fragment,{key:`space-item-${u}`},[C&&t.createVNode("div",{className:l.element("split"),style:r(!1)},[(c=n.split)==null?void 0:c.call(n)]),t.createVNode("div",{className:l.element("item"),style:r(u===f.length-1)},[m])])})])}}});function ce(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!t.isVNode(e)}const de=B("dialog"),xe=e=>{const n=document.createElement("div"),l=()=>{t.render(null,n)},o=c=>{if(c==="cancel")return e.beforeOnCancel?e.beforeOnCancel():!0;if(c==="ok")return e.beforeOnOk?e.beforeOnOk():!0},a=(c,i)=>{c==="cancel"&&e.onCancel&&e.onCancel(i),c==="ok"&&e.onOk&&e.onOk(i)},r=c=>{if(t.isVNode(c))return c;if(p(c)){const i=c();return t.isVNode(i)?i:null}return t.createVNode("div",{className:de.element("header-title")},[t.createTextVNode(" "),c,t.createTextVNode(" ")])},f=c=>{if(t.isVNode(c))return c;if(p(c)){const i=c();return t.isVNode(i)?i:null}return t.createVNode("div",{className:de.element("content")},[t.createTextVNode(" "),e.content,t.createTextVNode(" ")])},s=()=>()=>t.createVNode(t.Fragment,null,[e.title&&r(e.title)]),m=()=>()=>t.createVNode(t.Fragment,null,[e.content&&f(e.content)]),u=()=>{if(t.isVNode(e.footer)||p(e.footer))return e.footer;const c=(e==null?void 0:e.cancelText)||"取消",i=(e==null?void 0:e.okText)||"确认";return d=>t.createVNode(ie,{size:12},{default:()=>{var g,h;return[!e.hideCancel&&t.createVNode(E,{size:"small",onClick:d.cancel,loading:(g=d.loadingObj)==null?void 0:g.cancel},ce(c)?c:{default:()=>[c]}),!e.hideOk&&t.createVNode(E,{type:"primary",size:"small",onClick:d.ok,loading:(h=d.loadingObj)==null?void 0:h.ok},ce(i)?i:{default:()=>[i]})]}})},C=t.createVNode(ae,{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":()=>{C.component.props.modelValue=!1},onClosed:l,onOpened:()=>{}},{title:s(),default:m(),footer:u()});t.render(C,n)},Je=["success","warning","error","strong","info"],Qe=S("close-circle-fill");function _e(e,n,l,o,a,r){return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(e.cls),style:t.normalizeStyle(e.styles)},n[0]||(n[0]=[t.createElementVNode("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.createElementVNode("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"})],-1)]),6)}const K=N(Qe,[["render",_e]]),ve=S("check-circle-fill");function et(e,n,l,o,a,r){return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(e.cls),style:t.normalizeStyle(e.styles)},n[0]||(n[0]=[t.createElementVNode("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.createElementVNode("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"})],-1)]),6)}const X=N(ve,[["render",et]]),tt=S("exclamation-circle-fill");function nt(e,n,l,o,a,r){return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(e.cls),style:t.normalizeStyle(e.styles)},n[0]||(n[0]=[t.createElementVNode("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.createElementVNode("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-2-11a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1h-2a1 1 0 0 0-1 1v2Zm4-18a1 1 0 0 0-1-1h-2a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1V15Z",fill:"currentColor",stroke:"none"})],-1)]),6)}const Y=N(tt,[["render",nt]]),lt=S("info-circle-fill");function ot(e,n,l,o,a,r){return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(e.cls),style:t.normalizeStyle(e.styles)},n[0]||(n[0]=[t.createElementVNode("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.createElementVNode("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"})],-1)]),6)}const G=N(lt,[["render",ot]]),rt=S("minus-circle-fill");function st(e,n,l,o,a,r){return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(e.cls),style:t.normalizeStyle(e.styles)},n[0]||(n[0]=[t.createElementVNode("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.createElementVNode("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"})],-1)]),6)}const q=N(rt,[["render",st]]),at=t.defineComponent({name:T("Message"),components:{CloseCircleFill:K,CheckCircleFill:X,ExclamationCircleFill:Y,InfoCircleFill:G,MinusCircleFill:q},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=B("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 r=()=>{a=setTimeout(()=>{o.value=!1},e.duration)};t.onMounted(()=>{o.value=!0,e.duration!==0&&r()}),t.onUnmounted(()=>{clearTimeout(a)});const{zIndex:f}=W("message",{runOnMounted:!0}),s=t.computed(()=>({top:`${e.offset}px`,zIndex:f.value}));return{cn:n,cls:l,styles:s,visible:o,handleClose:()=>{o.value=!1}}}}),it=["innerHTML"],ct={key:1};function dt(e,n,l,o,a,r){const f=t.resolveComponent("CheckCircleFill"),s=t.resolveComponent("ExclamationCircleFill"),m=t.resolveComponent("MinusCircleFill"),u=t.resolveComponent("CloseCircleFill"),C=t.resolveComponent("InfoCircleFill");return t.openBlock(),t.createBlock(t.Transition,{name:"x-message-slide-top",onBeforeLeave:e.onClose,onAfterLeave:n[1]||(n[1]=c=>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(s,{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(C,{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,it)):(t.openBlock(),t.createElementBlock("span",ct,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]=(...c)=>e.handleClose&&e.handleClose(...c))},null,2)):t.createCommentVNode("",!0)])],6),[[t.vShow,e.visible]])]),_:3},8,["onBeforeLeave"])}const ft=N(at,[["render",dt]]),x=new WeakMap,j=e=>{(typeof e=="string"||t.isVNode(e))&&(e={message:e});const n=Z(e.renderTo||"body");x.has(n)||x.set(n,[]);const l=x.get(n);let o=e.offset||20;l.forEach(c=>{var i;o+=((i=c.el)==null?void 0:i.offsetHeight)+20});const a=e.onClose;let r={};r={...e,onClose:()=>{var d;const c=l.findIndex(g=>g===m);if(c<0)return;const i=((d=m.el)==null?void 0:d.offsetHeight)+20;l.slice(c+1).forEach(g=>{var w;const h=(w=g.component)==null?void 0:w.props.offset;g.component.props.offset=h-i}),l.splice(c,1),a&&a(m)},onDestroy:()=>{t.render(null,u)},offset:o};const m=t.createVNode(ft,r,p(r.message)||t.isVNode(r.message)?{default:p(r.message)?r.message:()=>r.message}:null),u=document.createElement("div");return t.render(m,u),n.tagName==="BODY"?m.el.style.position="fixed":(n.style.position="relative",m.el.style.position="absolute"),n.appendChild(u.firstElementChild),l.push(m),{close:()=>{m.component.proxy.handleClose()}}};(()=>{Je.forEach(e=>{j[e]=n=>te(n)?j({type:e,...n}):j({message:n,type:e})})})();const mt=["info","success","warning","strong","error"];function fe(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!t.isVNode(e)}const J=B("message-box"),Q=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)},r=i=>{let d;switch(i){case"warning":d=t.createVNode(Y,{size:"22px",color:"#f6c64b"},null);break;case"strong":d=t.createVNode(q,{size:"22px",color:"#ff7125"},null);break;case"error":d=t.createVNode(K,{size:"22px",color:"#e24f48"},null);break;case"success":d=t.createVNode(X,{size:"22px",color:"#68d1ab"},null);break;case"info":d=t.createVNode(G,{size:"22px",color:"#2355f5"},null);break}return t.createVNode("div",{className:J.element("icon")},[d])},f=i=>{if(t.isVNode(i))return i;if(p(i)){const d=i();return t.isVNode(d)?d:null}return t.createVNode("div",{className:J.element("title")},[t.createTextVNode(" "),i,t.createTextVNode(" ")])},s=i=>{if(t.isVNode(i))return i;if(p(i)){const d=i();return t.isVNode(d)?d:null}return t.createVNode("div",{className:J.element("content")},[t.createTextVNode(" "),e.content,t.createTextVNode(" ")])},m=()=>()=>t.createVNode(t.Fragment,null,[r(e.type||"success"),e.title&&f(e.title)]),u=()=>()=>t.createVNode(t.Fragment,null,[e.content&&s(e.content)]),C=()=>{if(t.isVNode(e.footer)||p(e.footer))return e.footer;const i=(e==null?void 0:e.cancelText)||"取消",d=(e==null?void 0:e.okText)||"确认";return g=>t.createVNode(ie,{size:12},{default:()=>{var h,w;return[!e.hideCancel&&t.createVNode(E,{size:"small",onClick:g.cancel,loading:(h=g.loadingObj)==null?void 0:h.cancel},fe(i)?i:{default:()=>[i]}),!e.hideOk&&t.createVNode(E,{type:"primary",size:"small",onClick:g.ok,loading:(w=g.loadingObj)==null?void 0:w.ok},fe(d)?d:{default:()=>[d]})]}})},c=t.createVNode(ae,{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":()=>{c.component.props.modelValue=!1},onClosed:l,onOpened:()=>{}},{title:m(),default:u(),footer:C()});t.render(c,n)};(()=>{mt.forEach(e=>{Q[e]=(n,l)=>{const o=[],a=[];let r=()=>!0,f=()=>!0;return setTimeout(()=>{Q({title:n,content:l,type:e,beforeOnCancel:f,beforeOnOk:r,onOk:()=>{o.forEach(s=>p(s)&&s())},onCancel:()=>{a.forEach(s=>p(s)&&s())}})},0),{ok(...s){return s.length===1&&o.push(s[0]),s.length===2&&(r=s[0],o.push(s[1])),this},cancel(...s){return s.length===1&&a.push(s[0]),s.length===2&&(f=s[0],a.push(s[1])),this}}}})})();const ut={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}},Ct=t.defineComponent({name:T("Notification"),props:ut,emits:["close","destroy"],setup(e){const n=B("notification"),l=n.block,o=t.computed(()=>[l,n.modifier(r.value.ver)]),{zIndex:a}=W("message",{runOnMounted:!0}),r=t.computed(()=>{const d=e.position.split("-");return{hor:d[1],ver:d[0]}}),f=t.computed(()=>`x-notification-slide-${r.value.hor}`),s=t.computed(()=>{const d={};return d.position=e.renderToBody?"fixed":"absolute",d.zIndex=a.value,d[r.value.hor]="20px",d[r.value.ver]=`${e.offset}px`,d}),m=t.ref(!1);let u=0;const C=()=>{setTimeout(()=>{m.value=!1},e.duration)},c=t.computed(()=>e.type==="info"?G:e.type==="warning"?Y:e.type==="strong"?q:e.type==="success"?X:e.type==="error"?K:""),i=()=>{m.value=!1};return t.onMounted(()=>{e.duration!==0&&C(),m.value=!0}),t.onUnmounted(()=>{clearTimeout(u)}),{ns:l,cn:n,cls:o,animationClsName:f,positionStyle:s,visible:m,positionPropMap:r,currentIcon:c,handleClose:i}}});function yt(e,n,l,o,a,r){return t.openBlock(),t.createBlock(t.Transition,{name:e.animationClsName,onBeforeLeave:n[1]||(n[1]=f=>e.$emit("close")),onAfterLeave:n[2]||(n[2]=f=>e.$emit("destroy"))},{default:t.withCtx(()=>[t.withDirectives(t.createElementVNode("div",{class:t.normalizeClass(e.cls),style:t.normalizeStyle(e.positionStyle)},[t.createElementVNode("div",{class:t.normalizeClass([e.cn.element("header")])},[t.createElementVNode("div",{class:t.normalizeClass([e.cn.element("icon"),e.cn.modifier(`icon-${e.type}`)])},[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.currentIcon)))],2),t.createElementVNode("div",null,[t.createElementVNode("div",{class:t.normalizeClass([e.cn.element("title")])},t.toDisplayString(e.title),3),t.createElementVNode("div",{class:t.normalizeClass([e.cn.element("message")])},[t.renderSlot(e.$slots,"default",{},()=>[t.createTextVNode(t.toDisplayString(e.message),1)])],2)])],2),e.showClose?(t.openBlock(),t.createElementBlock("span",{key:0,class:t.normalizeClass([e.cn.element("close-icon")]),onClick:n[0]||(n[0]=t.withModifiers((...f)=>e.handleClose&&e.handleClose(...f),["self"]))},null,2)):t.createCommentVNode("",!0)],6),[[t.vShow,e.visible]])]),_:3},8,["name"])}const gt=N(Ct,[["render",yt]]),A=new WeakMap,kt=e=>{const n=Z(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(C=>{var c;a+=((c=C.el)==null?void 0:c.offsetHeight)+20});const r=n.tagName==="BODY";r||(n.style.position="relative",n.style.overflowX="hidden");const f=e.onClose,s=()=>{var i;const C=o.findIndex(d=>d===u);if(C<0)return;const c=((i=u.el)==null?void 0:i.offsetHeight)+20;o.slice(C+1).forEach(d=>{var h;const g=(h=d.component)==null?void 0:h.props.offset;d.component.props.offset=g-c}),o.splice(C,1),f&&f(u)},m=()=>{t.render(null,l)},u=t.createVNode(gt,{message:e.message,title:e.title,type:e.type,offset:a,renderToBody:r,position:e.position,duration:e.duration??3e3,showClose:e.showClose??!0,onClose:s,onDestroy:m},p(e.message)||t.isVNode(e.message)?{default:p(e.message)?e.message:()=>e.message}:null);t.render(u,l),o.push(u),n==null||n.appendChild(l.firstChild)},pt=function(e){Object.keys(R).forEach(n=>{const l=R[n];e.component(n,R[n]),l.install&&e.use(l)})};k.Button=E,k.Dialog=xe,k.Message=j,k.MessageBox=Q,k.Notification=kt,k.install=pt,Object.defineProperty(k,Symbol.toStringTag,{value:"Module"})});
1
+ (function(g,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],t):(g=typeof globalThis<"u"?globalThis:g||self,t(g.index={},g.Vue))})(this,function(g,t){"use strict";var $t=Object.defineProperty;var Tt=(g,t,V)=>t in g?$t(g,t,{enumerable:!0,configurable:!0,writable:!0,value:V}):g[t]=V;var $=(g,t,V)=>Tt(g,typeof t!="symbol"?t+"":t,V);const V="X",ke="x",v=e=>e?ke+"-"+e:e||"",T=e=>V+e,B=e=>{const n=v(e);return{block:n,element:r=>`${n}--${r}`,modifier:r=>`${n}-${r}`,is:r=>`${n}-is-${r}`}},z=Object.prototype.toString;function ee(e){return z.call(e)==="[object Array]"}function te(e){return z.call(e)==="[object Object]"}const ne=e=>z.call(e)==="[object Promise]";function le(e){return z.call(e)==="[object String]"}function pe(e){return z.call(e)==="[object Number]"&&e===e}function p(e){return typeof e=="function"}function I(){return typeof window<"u"}const M=e=>e;var O;(function(e){e[e.ELEMENT=1]="ELEMENT",e[e.FUNCTIONAL_COMPONENT=2]="FUNCTIONAL_COMPONENT",e[e.STATEFUL_COMPONENT=4]="STATEFUL_COMPONENT",e[e.COMPONENT=6]="COMPONENT",e[e.TEXT_CHILDREN=8]="TEXT_CHILDREN",e[e.ARRAY_CHILDREN=16]="ARRAY_CHILDREN",e[e.SLOTS_CHILDREN=32]="SLOTS_CHILDREN",e[e.TELEPORT=64]="TELEPORT",e[e.SUSPENSE=128]="SUSPENSE",e[e.COMPONENT_SHOULD_KEEP_ALIVE=256]="COMPONENT_SHOULD_KEEP_ALIVE",e[e.COMPONENT_KEPT_ALIVE=512]="COMPONENT_KEPT_ALIVE"})(O||(O={}));const he=e=>!!(e&&e.shapeFlag&O.ELEMENT),Ne=(e,n)=>!!(e&&e.shapeFlag&O.COMPONENT),Ee=(e,n)=>!!(e&&e.shapeFlag&8),Be=(e,n)=>!!(e&&e.shapeFlag&O.ARRAY_CHILDREN),be=(e,n)=>!!(e&&e.shapeFlag&O.SLOTS_CHILDREN),P=(e,n=!1)=>{var l,o;const a=[];for(const r of e??[])he(r)||Ne(r)||n&&Ee(r,r.children)?a.push(r):Be(r,r.children)?a.push(...P(r.children,n)):be(r,r.children)?a.push(...P((o=(l=r.children).default)===null||o===void 0?void 0:o.call(l),n)):ee(r)&&a.push(...P(r,n));return a},we={disabled:Boolean,block:Boolean,loading:Boolean,loadingFill:{type:Boolean,default:!1},debounce:{type:Number,default:0},shape:{type:M(String),default:void 0},link:{type:Boolean,default:!1},type:{type:M(String),default:void 0},status:{type:M(String),default:void 0},plain:{type:Boolean,default:!1},size:{type:M(String),default:"medium"},border:{type:Boolean,default:!0}},Ve=e=>le(e)?e.split("-").map(n=>n.charAt(0).toUpperCase()+n.slice(1)).join(""):"",Oe=(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 S(e){return t.defineComponent({name:v(`Icon${Ve(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(n){const l="x-icon",o=t.computed(()=>{const r={};return n.size&&(r.fontSize=Oe(n.size)),n.rotate&&(r.transform=`rotate(${n.rotate}deg)`),n.color&&(r.color=n.color),r});return{cls:t.computed(()=>[l,{[`${l}-loading`]:n.spin}]),styles:o}}})}const Se=S("animation-loading"),N=(e,n)=>{const l=e.__vccOpts||e;for(const[o,a]of n)l[o]=a;return l};function $e(e,n,l,o,a,r){return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(e.cls),style:t.normalizeStyle(e.styles)},n[0]||(n[0]=[t.createElementVNode("svg",{viewBox:"0 0 50 50",class:"icon-loading-svg"},[t.createElementVNode("circle",{cx:"25",cy:"25",r:"20",class:"path",fill:"none",stroke:"currentColor"})],-1)]),6)}const Te=N(Se,[["render",$e],["__scopeId","data-v-62d46830"]]),ze=t.defineComponent({name:T("Button"),components:{AnimationLoading:Te},props:we,emits:["click"],setup(e){const n=t.reactive({clicked:!1,isDebounce:!1}),l=B("button"),o=t.computed(()=>[l.block,e.type&&l.modifier(e.type),e.status&&l.modifier(e.status),e.disabled&&l.is("disabled"),e.block&&l.modifier("block"),e.plain&&l.is("plain"),e.shape&&l.modifier(e.shape),e.link&&l.modifier("is-link"),e.size&&l.modifier(e.size),!e.border&&l.modifier("is-hide-border"),r.value&&l.modifier("is-loading")]),a=()=>{e.debounce>0&&!n.isDebounce&&(n.isDebounce=!0,setTimeout(()=>{n.isDebounce=!1},e.debounce))},r=t.computed(()=>e.loading||n.clicked||n.isDebounce),f=t.getCurrentInstance(),s=(u,C)=>{const c=u(C);ne(c)&&(n.clicked=!0,c.finally(()=>{n.clicked=!1}))};return{cn:l,cls:o,handleClick:async u=>{var c,i,d,k;if((i=(c=u.target).blur)==null||i.call(c),r.value)return;a();const C=(k=(d=f==null?void 0:f.vnode)==null?void 0:d.props)==null?void 0:k.onClick;ee(C)?C.forEach(h=>s(h,u)):p(C)&&s(C,u)},isLoading:r}}}),Me=["disabled"];function Le(e,n,l,o,a,r){const f=t.resolveComponent("AnimationLoading");return t.openBlock(),t.createElementBlock("button",{class:t.normalizeClass(e.cls),type:"button",disabled:e.disabled,onClick:n[0]||(n[0]=(...s)=>e.handleClick&&e.handleClick(...s))},[t.withDirectives(t.createElementVNode("span",{class:t.normalizeClass([e.cn.element("loading")])},[t.createVNode(f)],2),[[t.vShow,e.isLoading]]),e.$slots.prefix?(t.openBlock(),t.createElementBlock("span",{key:0,class:t.normalizeClass([e.cn.element("prefix")])},[t.renderSlot(e.$slots,"prefix")],2)):t.createCommentVNode("",!0),t.renderSlot(e.$slots,"default"),e.$slots.suffix?(t.openBlock(),t.createElementBlock("span",{key:1,class:t.normalizeClass([e.cn.element("suffix")])},[t.renderSlot(e.$slots,"suffix")],2)):t.createCommentVNode("",!0)],10,Me)}const E=N(ze,[["render",Le]]);E.install=function(e){e.component(E.name,E)};const R=Object.freeze(Object.defineProperty({__proto__:null,Button:E},Symbol.toStringTag,{value:"Module"})),Ae=["px","%","vh","vw","calc"],oe=(e,n="px")=>{if(e===void 0)return"";const l=String(e);return Ae.some(o=>l.includes(o))?l:l+n},De=1e3,Ie=3e3,Pe=1;class je{constructor(){$(this,"popupStack",{popup:new Set,dialog:new Set,message:new Set});$(this,"getNextZIndex",n=>(n==="message"?Array.from(this.popupStack.message).pop()||Ie:Array.from(this.popupStack.popup).pop()||De)+Pe);$(this,"add",n=>{const l=this.getNextZIndex(n);return this.popupStack[n].add(l),n==="dialog"&&this.popupStack.popup.add(l),l});$(this,"delete",(n,l)=>{this.popupStack[l].delete(n),l==="dialog"&&this.popupStack.popup.delete(n)});$(this,"isLastDialog",n=>this.popupStack.dialog.size>1?n===Array.from(this.popupStack.dialog).pop():!0)}}const U=new je;function W(e,{visible:n,runOnMounted:l}={}){const o=t.ref(0),a=()=>{o.value=U.add(e)},r=()=>{U.delete(o.value,e)},f=()=>e==="dialog"?U.isLastDialog(o.value):!1;return t.watch(()=>n==null?void 0:n.value,s=>{s?a():r()},{immediate:!0}),l&&(t.onMounted(()=>{a()}),t.onBeforeUnmount(()=>{r()})),{zIndex:t.readonly(o),open:a,close:r,isLastDialog:f}}const re=e=>e.replace(/^./,n=>n.toLowerCase()).replace(/-(\w)/g,(n,l)=>{var o;return(o=l==null?void 0:l.toUpperCase())!==null&&o!==void 0?o:""}),se=()=>{},He=(e,n)=>{var l;if(I)return(l=document.querySelector(e))!==null&&l!==void 0?l:void 0},Fe=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)},Re=e=>e.tagName==="BODY"?document.documentElement.scrollHeight>window.innerHeight:e.scrollHeight>e.offsetHeight,Ue=(e,n)=>{var l;if(!I||!e||!n)return"";let o=re(n);o==="float"&&(o="cssFloat");try{const a=e.style[o];if(a)return a;const r=(l=document.defaultView)===null||l===void 0?void 0:l.getComputedStyle(e,"");return r?r[o]:""}catch{return e.style[o]}},L=(e,n,l)=>{if(!(!e||!n))if(te(n))Object.entries(n).forEach(([o,a])=>L(e,o,a));else{const o=re(n);e.style[o]=l}},Z=(e,n)=>{if(le(e)){const l=e[0]==="#"?`[id='${e.slice(1)}']`:e;return He(l)}return e},We=I?(e,n,l,o=!1)=>{e.addEventListener(n,l,o)}:se,Ze=I?(e,n,l,o=!1)=>{e.removeEventListener(n,l,o)}:se,Ke=(e,n)=>{let l=!1;const o={overflow:"",width:""},a=s=>s.tagName==="BODY",r=()=>{if(e.value){const s=e.value;if(!l&&s.style.overflow!=="hidden"){const m=Fe(s);if(m>0||Re(s)){o.overflow=s.style.overflow,o.width=s.style.width;let u=0;a(s)&&(u=s.getBoundingClientRect().left||0),L(s,{width:`calc(100% - ${Math.ceil(m-u)}px)`,overflow:"hidden"}),l=!0}}}},f=()=>{if(e.value&&l){const s=e.value;L(s,{overflow:o.overflow,width:o.width}),l=!1}};return t.watch(()=>n==null?void 0:n.value,s=>{e.value&&!a(e.value)&&(s&&L(s,{position:"absolute"}),Ue(e.value,"position")==="static"&&L(e.value,{position:"relative"}))}),{setOverflowHidden:r,resetOverflow:f}},Xe={ENTER:"Enter",ESC:"Escape",BACKSPACE:"Backspace",TAB:"Tab",SPACE:" ",ARROW_UP:"ArrowUp",ARROW_DOWN:"ArrowDown",ARROW_LEFT:"ArrowLeft",ARROW_RIGHT:"ArrowRight"},Ye={renderTo:{type:M([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"],qe=t.defineComponent({name:T("Dialog"),inheritAttrs:!1,props:Ye,emits:["closed","close","open","opened","update:modelValue"],setup(e,{emit:n}){const l=B("dialog"),o=l.block,a=B("message-box"),r=a.block,f=t.computed(()=>[o,e.messageBox&&"is-message-box",e.popupClass&&e.popupClass]),s=t.computed(()=>Z(e.renderTo)),m=t.ref(),u=t.computed(()=>e.disabled||!s.value),C=t.computed(()=>({zIndex:h.value})),c=t.computed(()=>{const y={};return e.fullscreen||(!e.center&&e.top&&(y.top=oe(e.top)),Ge.forEach(b=>{e[b]&&(y[b]=oe(e[b]))})),y}),i=t.ref(!1),d=t.computed(()=>e.modelValue),k=t.computed(()=>d.value||i.value),{zIndex:h,isLastDialog:w}=W("dialog",{visible:d}),{setOverflowHidden:Nt,resetOverflow:ue}=Ke(s,m),Ce=(y,b)=>{n("update:modelValue",!1),n("close",e.messageBox?y:void 0,e.messageBox?b:void 0)},Et=()=>{i.value=!1,ue(),n("closed")},Bt=()=>{n("opened")},H=t.reactive({ok:!1,cancel:!1}),D=(y,b)=>{let F=!0;if(H[y]=!0,p(e.onBeforeCancel)&&(F=e.onBeforeCancel(y)??!1),ne(F)){F.then(St=>{H[y]=!1,St&&Ce(y,b)});return}H[y]=!1,F&&Ce(y,b)},bt=()=>{e.maskToClose&&e.mask&&D("cancel")},wt=y=>{D("cancel",y)},Vt=y=>{D("ok",y)};let Q=!1;const ye=y=>{e.escToClose&&y.key===Xe.ESC&&w()&&D("cancel")},Ot=()=>{e.escToClose&&!Q&&(Q=!0,We(document.documentElement,"keydown",ye))},ge=()=>{Q=!1,Ze(document.documentElement,"keydown",ye)};return t.onBeforeUnmount(()=>{ue(),ge()}),t.watch(()=>d.value,y=>{y?(n("open"),Nt(),i.value=!0,Ot()):ge()},{immediate:!0}),{cls:f,ns:o,cn:l,cnOMB:a,messageBoxNs:r,containerStyle:c,dialogStyle:C,dialogRef:m,teleportContainer:s,teleportDisabled:u,modelVisible:d,mergeVisible:k,interceptClose:D,afterLeave:Et,afterEnter:Bt,handleMaskClick:bt,handleCancel:wt,handleOk:Vt,loadingObj:H}}});function xe(e,n,l,o,a,r){return t.openBlock(),t.createBlock(t.Teleport,{to:e.teleportContainer,disabled:e.teleportDisabled},[!e.destroyOnClosed||e.mergeVisible?t.withDirectives((t.openBlock(),t.createElementBlock("div",{key:0,ref:"dialogRef",class:t.normalizeClass(e.cls),style:t.normalizeStyle(e.dialogStyle)},[t.createVNode(t.Transition,{name:"x-fade-in-standard",appear:""},{default:t.withCtx(()=>[e.mask?t.withDirectives((t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass([e.cn.element("mask")])},null,2)),[[t.vShow,e.modelVisible]]):t.createCommentVNode("",!0)]),_:1}),t.createElementVNode("div",{class:t.normalizeClass([e.cn.element("wrapper"),{"is-center":e.center}]),onClick:n[1]||(n[1]=t.withModifiers((...f)=>e.handleMaskClick&&e.handleMaskClick(...f),["self"]))},[t.createVNode(t.Transition,{name:"x-zoom-in",appear:"",onAfterEnter:e.afterEnter,onAfterLeave:e.afterLeave},{default:t.withCtx(()=>[t.withDirectives(t.createElementVNode("div",{class:t.normalizeClass([e.cn.element("container"),{"is-fullscreen":e.fullscreen}]),style:t.normalizeStyle(e.containerStyle)},[t.createElementVNode("div",{class:t.normalizeClass([e.messageBox?e.cnOMB.element("header"):e.cn.element("header"),e.showHeaderBottomLine&&"is-bottom-line"])},[t.renderSlot(e.$slots,"title",{},()=>[t.createElementVNode("div",{class:t.normalizeClass([e.cn.element("header-title")])},t.toDisplayString(e.title),3)])],2),t.createElementVNode("div",{class:t.normalizeClass([e.messageBox?e.cnOMB.element("body"):e.cn.element("body")])},[t.renderSlot(e.$slots,"default")],2),t.createElementVNode("div",{class:t.normalizeClass([e.messageBox?e.cnOMB.element("footer"):e.cn.element("footer")])},[t.renderSlot(e.$slots,"footer",{cancel:e.handleCancel,ok:e.handleOk,loadingObj:e.loadingObj})],2),e.showClose?(t.openBlock(),t.createElementBlock("span",{key:0,class:t.normalizeClass([e.cn.element("close-icon"),e.messageBox&&e.cnOMB.element("close-icon")]),onClick:n[0]||(n[0]=f=>e.interceptClose("cancel"))},null,2)):t.createCommentVNode("",!0)],6),[[t.vShow,e.modelVisible]])]),_:3},8,["onAfterEnter","onAfterLeave"])],2)],6)),[[t.vShow,e.mergeVisible]]):t.createCommentVNode("",!0)],8,["to","disabled"])}const ae=N(qe,[["render",xe]]),ie=t.defineComponent({name:T("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=B("space"),o=t.computed(()=>[l.block,l.element(e.direction),e.fill&&"is-fill",l.element(`${e.direction}-${e.align}`)]);function a(f){if(pe(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 r=f=>{const s={};if(f)return s;const m=`${a(e.size)}px`,u=`${a(e.size)}px`;return e.direction==="horizontal"&&(s.marginRight=m),e.direction==="vertical"&&(s.marginBottom=u),s};return()=>{var s;const f=P((s=n.default)==null?void 0:s.call(n),!0).filter(m=>m.type!==t.Comment);return t.createVNode("div",{class:[o.value]},[f.map((m,u)=>{var c;const C=n.split&&u>0;return t.createVNode(t.Fragment,{key:`space-item-${u}`},[C&&t.createVNode("div",{className:l.element("split"),style:r(!1)},[(c=n.split)==null?void 0:c.call(n)]),t.createVNode("div",{className:l.element("item"),style:r(u===f.length-1)},[m])])})])}}});function ce(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!t.isVNode(e)}const de=B("dialog"),_e=e=>{const n=document.createElement("div"),l=()=>{t.render(null,n)},o=c=>{if(c==="cancel")return e.beforeOnCancel?e.beforeOnCancel():!0;if(c==="ok")return e.beforeOnOk?e.beforeOnOk():!0},a=(c,i)=>{c==="cancel"&&e.onCancel&&e.onCancel(i),c==="ok"&&e.onOk&&e.onOk(i)},r=c=>{if(t.isVNode(c))return c;if(p(c)){const i=c();return t.isVNode(i)?i:null}return t.createVNode("div",{className:de.element("header-title")},[t.createTextVNode(" "),c,t.createTextVNode(" ")])},f=c=>{if(t.isVNode(c))return c;if(p(c)){const i=c();return t.isVNode(i)?i:null}return t.createVNode("div",{className:de.element("content")},[t.createTextVNode(" "),e.content,t.createTextVNode(" ")])},s=()=>()=>t.createVNode(t.Fragment,null,[e.title&&r(e.title)]),m=()=>()=>t.createVNode(t.Fragment,null,[e.content&&f(e.content)]),u=()=>{if(t.isVNode(e.footer)||p(e.footer))return e.footer;const c=(e==null?void 0:e.cancelText)||"取消",i=(e==null?void 0:e.okText)||"确认";return d=>t.createVNode(ie,{size:12},{default:()=>{var k,h;return[!e.hideCancel&&t.createVNode(E,{size:"small",onClick:d.cancel,loading:(k=d.loadingObj)==null?void 0:k.cancel},ce(c)?c:{default:()=>[c]}),!e.hideOk&&t.createVNode(E,{type:"primary",size:"small",onClick:d.ok,loading:(h=d.loadingObj)==null?void 0:h.ok},ce(i)?i:{default:()=>[i]})]}})},C=t.createVNode(ae,{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":()=>{C.component.props.modelValue=!1},onClosed:l,onOpened:()=>{}},{title:s(),default:m(),footer:u()});t.render(C,n)},Je=["success","warning","error","strong","info"],Qe=S("close-circle-fill");function ve(e,n,l,o,a,r){return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(e.cls),style:t.normalizeStyle(e.styles)},n[0]||(n[0]=[t.createElementVNode("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.createElementVNode("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"})],-1)]),6)}const K=N(Qe,[["render",ve]]),et=S("check-circle-fill");function tt(e,n,l,o,a,r){return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(e.cls),style:t.normalizeStyle(e.styles)},n[0]||(n[0]=[t.createElementVNode("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.createElementVNode("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"})],-1)]),6)}const X=N(et,[["render",tt]]),nt=S("exclamation-circle-fill");function lt(e,n,l,o,a,r){return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(e.cls),style:t.normalizeStyle(e.styles)},n[0]||(n[0]=[t.createElementVNode("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.createElementVNode("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-2-11a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1h-2a1 1 0 0 0-1 1v2Zm4-18a1 1 0 0 0-1-1h-2a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1V15Z",fill:"currentColor",stroke:"none"})],-1)]),6)}const Y=N(nt,[["render",lt]]),ot=S("info-circle-fill");function rt(e,n,l,o,a,r){return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(e.cls),style:t.normalizeStyle(e.styles)},n[0]||(n[0]=[t.createElementVNode("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.createElementVNode("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"})],-1)]),6)}const G=N(ot,[["render",rt]]),st=S("minus-circle-fill");function at(e,n,l,o,a,r){return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(e.cls),style:t.normalizeStyle(e.styles)},n[0]||(n[0]=[t.createElementVNode("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.createElementVNode("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"})],-1)]),6)}const q=N(st,[["render",at]]),it=t.defineComponent({name:T("Message"),components:{CloseCircleFill:K,CheckCircleFill:X,ExclamationCircleFill:Y,InfoCircleFill:G,MinusCircleFill:q},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=B("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 r=()=>{a=setTimeout(()=>{o.value=!1},e.duration)};t.onMounted(()=>{o.value=!0,e.duration!==0&&r()}),t.onUnmounted(()=>{clearTimeout(a)});const{zIndex:f}=W("message",{runOnMounted:!0}),s=t.computed(()=>({top:`${e.offset}px`,zIndex:f.value}));return{cn:n,cls:l,styles:s,visible:o,handleClose:()=>{o.value=!1}}}}),ct=["innerHTML"],dt={key:1};function ft(e,n,l,o,a,r){const f=t.resolveComponent("CheckCircleFill"),s=t.resolveComponent("ExclamationCircleFill"),m=t.resolveComponent("MinusCircleFill"),u=t.resolveComponent("CloseCircleFill"),C=t.resolveComponent("InfoCircleFill");return t.openBlock(),t.createBlock(t.Transition,{name:"x-message-slide-top",onBeforeLeave:e.onClose,onAfterLeave:n[1]||(n[1]=c=>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(s,{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(C,{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,ct)):(t.openBlock(),t.createElementBlock("span",dt,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]=(...c)=>e.handleClose&&e.handleClose(...c))},null,2)):t.createCommentVNode("",!0)])],6),[[t.vShow,e.visible]])]),_:3},8,["onBeforeLeave"])}const mt=N(it,[["render",ft]]),x=new WeakMap,j=e=>{(typeof e=="string"||t.isVNode(e))&&(e={message:e});const n=Z(e.renderTo||"body");x.has(n)||x.set(n,[]);const l=x.get(n);let o=e.offset||20;l.forEach(c=>{var i;o+=((i=c.el)==null?void 0:i.offsetHeight)+20});const a=e.onClose;let r={};r={...e,onClose:()=>{var d;const c=l.findIndex(k=>k===m);if(c<0)return;const i=((d=m.el)==null?void 0:d.offsetHeight)+20;l.slice(c+1).forEach(k=>{var w;const h=(w=k.component)==null?void 0:w.props.offset;k.component.props.offset=h-i}),l.splice(c,1),a&&a(m)},onDestroy:()=>{t.render(null,u)},offset:o};const m=t.createVNode(mt,r,p(r.message)||t.isVNode(r.message)?{default:p(r.message)?r.message:()=>r.message}:null),u=document.createElement("div");return t.render(m,u),n.tagName==="BODY"?m.el.style.position="fixed":(n.style.position="relative",m.el.style.position="absolute"),n.appendChild(u.firstElementChild),l.push(m),{close:()=>{m.component.proxy.handleClose()}}};(()=>{Je.forEach(e=>{j[e]=n=>te(n)?j({type:e,...n}):j({message:n,type:e})})})();const ut=["info","success","warning","strong","error"];function fe(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!t.isVNode(e)}const _=B("message-box"),J=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)},r=i=>{let d;switch(i){case"warning":d=t.createVNode(Y,{size:"22px",color:"#f6c64b"},null);break;case"strong":d=t.createVNode(q,{size:"22px",color:"#ff7125"},null);break;case"error":d=t.createVNode(K,{size:"22px",color:"#e24f48"},null);break;case"success":d=t.createVNode(X,{size:"22px",color:"#68d1ab"},null);break;case"info":d=t.createVNode(G,{size:"22px",color:"#2355f5"},null);break}return t.createVNode("div",{className:_.element("icon")},[d])},f=i=>{if(t.isVNode(i))return i;if(p(i)){const d=i();return t.isVNode(d)?d:null}return t.createVNode("div",{className:_.element("title")},[t.createTextVNode(" "),i,t.createTextVNode(" ")])},s=i=>{if(t.isVNode(i))return i;if(p(i)){const d=i();return t.isVNode(d)?d:null}return t.createVNode("div",{className:_.element("content")},[t.createTextVNode(" "),e.content,t.createTextVNode(" ")])},m=()=>()=>t.createVNode(t.Fragment,null,[r(e.type||"success"),e.title&&f(e.title)]),u=()=>()=>t.createVNode(t.Fragment,null,[e.content&&s(e.content)]),C=()=>{if(t.isVNode(e.footer)||p(e.footer))return e.footer;const i=(e==null?void 0:e.cancelText)||"取消",d=(e==null?void 0:e.okText)||"确认";return k=>t.createVNode(ie,{size:12},{default:()=>{var h,w;return[!e.hideCancel&&t.createVNode(E,{size:"small",onClick:k.cancel,loading:(h=k.loadingObj)==null?void 0:h.cancel},fe(i)?i:{default:()=>[i]}),!e.hideOk&&t.createVNode(E,{type:"primary",size:"small",onClick:k.ok,loading:(w=k.loadingObj)==null?void 0:w.ok},fe(d)?d:{default:()=>[d]})]}})},c=t.createVNode(ae,{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":()=>{c.component.props.modelValue=!1},onClosed:l,onOpened:()=>{}},{title:m(),default:u(),footer:C()});t.render(c,n)};(()=>{ut.forEach(e=>{J[e]=(n,l)=>{const o=[],a=[];let r=()=>!0,f=()=>!0;return setTimeout(()=>{J({title:n,content:l,type:e,beforeOnCancel:f,beforeOnOk:r,onOk:()=>{o.forEach(s=>p(s)&&s())},onCancel:()=>{a.forEach(s=>p(s)&&s())}})},0),{ok(...s){return s.length===1&&o.push(s[0]),s.length===2&&(r=s[0],o.push(s[1])),this},cancel(...s){return s.length===1&&a.push(s[0]),s.length===2&&(f=s[0],a.push(s[1])),this}}}})})();const Ct={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}},yt=t.defineComponent({name:T("Notification"),props:Ct,emits:["close","destroy"],setup(e){const n=B("notification"),l=n.block,o=t.computed(()=>[l,n.modifier(r.value.ver)]),{zIndex:a}=W("message",{runOnMounted:!0}),r=t.computed(()=>{const d=e.position.split("-");return{hor:d[1],ver:d[0]}}),f=t.computed(()=>`x-notification-slide-${r.value.hor}`),s=t.computed(()=>{const d={};return d.position=e.renderToBody?"fixed":"absolute",d.zIndex=a.value,d[r.value.hor]="20px",d[r.value.ver]=`${e.offset}px`,d}),m=t.ref(!1);let u=0;const C=()=>{setTimeout(()=>{m.value=!1},e.duration)},c=t.computed(()=>e.type==="info"?G:e.type==="warning"?Y:e.type==="strong"?q:e.type==="success"?X:e.type==="error"?K:""),i=()=>{m.value=!1};return t.onMounted(()=>{e.duration!==0&&C(),m.value=!0}),t.onUnmounted(()=>{clearTimeout(u)}),{ns:l,cn:n,cls:o,animationClsName:f,positionStyle:s,visible:m,positionPropMap:r,currentIcon:c,handleClose:i}}});function gt(e,n,l,o,a,r){return t.openBlock(),t.createBlock(t.Transition,{name:e.animationClsName,onBeforeLeave:n[1]||(n[1]=f=>e.$emit("close")),onAfterLeave:n[2]||(n[2]=f=>e.$emit("destroy"))},{default:t.withCtx(()=>[t.withDirectives(t.createElementVNode("div",{class:t.normalizeClass(e.cls),style:t.normalizeStyle(e.positionStyle)},[t.createElementVNode("div",{class:t.normalizeClass([e.cn.element("header")])},[t.createElementVNode("div",{class:t.normalizeClass([e.cn.element("icon"),e.cn.modifier(`icon-${e.type}`)])},[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.currentIcon)))],2),t.createElementVNode("div",null,[t.createElementVNode("div",{class:t.normalizeClass([e.cn.element("title")])},t.toDisplayString(e.title),3),t.createElementVNode("div",{class:t.normalizeClass([e.cn.element("message")])},[t.renderSlot(e.$slots,"default",{},()=>[t.createTextVNode(t.toDisplayString(e.message),1)])],2)])],2),e.showClose?(t.openBlock(),t.createElementBlock("span",{key:0,class:t.normalizeClass([e.cn.element("close-icon")]),onClick:n[0]||(n[0]=t.withModifiers((...f)=>e.handleClose&&e.handleClose(...f),["self"]))},null,2)):t.createCommentVNode("",!0)],6),[[t.vShow,e.visible]])]),_:3},8,["name"])}const kt=N(yt,[["render",gt]]),A=new WeakMap,pt=e=>{const n=Z(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(C=>{var c;a+=((c=C.el)==null?void 0:c.offsetHeight)+20});const r=n.tagName==="BODY";r||(n.style.position="relative",n.style.overflowX="hidden");const f=e.onClose,s=()=>{var i;const C=o.findIndex(d=>d===u);if(C<0)return;const c=((i=u.el)==null?void 0:i.offsetHeight)+20;o.slice(C+1).forEach(d=>{var h;const k=(h=d.component)==null?void 0:h.props.offset;d.component.props.offset=k-c}),o.splice(C,1),f&&f(u)},m=()=>{t.render(null,l)},u=t.createVNode(kt,{message:e.message,title:e.title,type:e.type,offset:a,renderToBody:r,position:e.position,duration:e.duration??3e3,showClose:e.showClose??!0,onClose:s,onDestroy:m},p(e.message)||t.isVNode(e.message)?{default:p(e.message)?e.message:()=>e.message}:null);t.render(u,l),o.push(u),n==null||n.appendChild(l.firstChild)},me=function(e){Object.keys(R).forEach(n=>{const l=R[n];e.component(n,R[n]),l.install&&e.use(l)})},ht={install:me};g.Button=E,g.Dialog=_e,g.Message=j,g.MessageBox=J,g.Notification=pt,g.default=ht,g.install=me,Object.defineProperties(g,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "x-next",
3
3
  "private": false,
4
- "version": "0.0.0-alpha.6",
4
+ "version": "0.0.0-alpha.7",
5
5
  "description": "An amazing Vue3 UI library.",
6
6
  "type": "module",
7
7
  "main": "dist/index.umd.js",