x-next 0.0.0-alpha.2 → 0.0.0-alpha.21
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +15 -84
- package/dist/{types/_hooks → _hooks}/use-overflow.d.ts +1 -1
- package/dist/{types/_hooks → _hooks}/use-popup-manager.d.ts +1 -1
- package/dist/{types/_utils → _utils}/config.d.ts +1 -1
- package/dist/{types/_utils → _utils}/dom.d.ts +1 -1
- package/dist/{types/_utils → _utils}/is.d.ts +5 -6
- package/dist/{types/_utils → _utils}/keyboard.d.ts +1 -1
- package/dist/{types/_utils → _utils}/vue-eco.d.ts +10 -11
- package/dist/{types/componets/button/index.vue.d.ts → components/button/Button.d.ts} +18 -28
- package/dist/components/button/index.d.ts +181 -0
- package/dist/{types/componets → components}/button/props.d.ts +4 -4
- package/dist/{types/componets/dialog/index.vue.d.ts → components/dialog/Dialog.d.ts} +9 -42
- package/dist/components/dialog/index.d.ts +334 -0
- package/dist/{types/componets → components}/dialog/props.d.ts +7 -7
- package/dist/{types/componets → components}/dialog/use-props.d.ts +1 -1
- package/dist/{types/componets → components}/dialog/use.d.ts +1 -1
- package/dist/components/dialog/warp.d.ts +2 -0
- package/dist/components/index.d.ts +6 -0
- package/dist/{types/componets/message/index.vue.d.ts → components/message/Message.d.ts} +19 -27
- package/dist/components/message/MessageVue.vue.d.ts +362 -0
- package/dist/components/message/index.d.ts +193 -0
- package/dist/{types/componets → components}/message/props.d.ts +1 -1
- package/dist/{types/componets → components}/message/warp.d.ts +1 -1
- package/dist/{types/componets/message-box/index.d.ts → components/message-box/MessageBox.d.ts} +1 -1
- package/dist/components/message-box/index.d.ts +4 -0
- package/dist/{types/componets → components}/message-box/props.d.ts +1 -1
- package/dist/components/message-box/warp.d.ts +2 -0
- package/dist/components/notification/Notification.d.ts +89 -0
- package/dist/components/notification/index.d.ts +166 -0
- package/dist/{types/componets → components}/notification/props.d.ts +2 -2
- package/dist/{types/componets → components}/notification/warp.d.ts +1 -1
- package/dist/{types/componets/space/index.d.ts → components/space/Space.d.ts} +9 -9
- package/dist/components/space/index.d.ts +82 -0
- package/dist/{types/componets → components}/trend-chart/components/trend-chart-curve.d.ts +17 -17
- package/dist/{types/componets → components}/trend-chart/components/trend-chart-grid.d.ts +7 -7
- package/dist/{types/componets → components}/trend-chart/components/trend-chart-labels.d.ts +7 -7
- package/dist/{types/componets → components}/trend-chart/components/trend-chart.d.ts +47 -47
- package/dist/{types/componets → components}/trend-chart/helpers/genPoints.d.ts +1 -1
- package/dist/components/trend-chart/index.d.ts +2 -0
- package/dist/{types/componets → components}/trend-chart/props.d.ts +2 -2
- package/dist/directives/clipboard/cache.d.ts +8 -0
- package/dist/directives/clipboard/clipboard.d.ts +18 -0
- package/dist/directives/clipboard/convert.d.ts +3 -0
- package/dist/directives/clipboard/index.d.ts +3 -0
- package/dist/directives/clipboard/plugin.d.ts +2 -0
- package/dist/directives/clipboard/textarea.d.ts +3 -0
- package/dist/{types/icons/default/exclamation-circle-fill.vue.d.ts → icons/animation/animation-loading.d.ts} +5 -10
- package/dist/{types/icons/default/close-circle-fill.vue.d.ts → icons/default/check-circle-fill.d.ts} +5 -10
- package/dist/{types/icons/animation/animation-loading.vue.d.ts → icons/default/close-circle-fill.d.ts} +5 -10
- package/dist/{types/icons/default/check-circle-fill.vue.d.ts → icons/default/exclamation-circle-fill.d.ts} +5 -10
- package/dist/icons/default/info-circle-fill.d.ts +50 -0
- package/dist/icons/default/minus-circle-fill.d.ts +50 -0
- package/dist/icons/icon.d.ts +51 -0
- package/dist/icons/index.d.ts +7 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.es.js +1368 -0
- package/dist/index.umd.js +1 -0
- package/dist/style.css +1 -0
- package/dist/types.d.ts +11 -0
- package/package.json +45 -48
- package/volar.d.ts +12 -0
- package/LICENSE +0 -21
- package/dist/favicon.ico +0 -0
- package/dist/types/_utils/icon.d.ts +0 -59
- package/dist/types/componets/dialog/warp.d.ts +0 -2
- package/dist/types/componets/message-box/warp.d.ts +0 -2
- package/dist/types/componets/notification/index.vue.d.ts +0 -160
- package/dist/types/componets/trend-chart/index.d.ts +0 -2
- package/dist/types/icons/default/info-circle-fill.vue.d.ts +0 -55
- package/dist/types/icons/default/minus-circle-fill.vue.d.ts +0 -55
- package/dist/types/icons/index.d.ts +0 -7
- package/dist/types/ui.d.ts +0 -5
- package/dist/ui.cjs.js +0 -2
- package/dist/ui.es.js +0 -1395
- package/dist/ui.umd.js +0 -3
- /package/dist/{types/_props → _props}/css.d.ts +0 -0
- /package/dist/{types/_props → _props}/global.d.ts +0 -0
- /package/dist/{types/_utils → _utils}/convert-case.d.ts +0 -0
- /package/dist/{types/_utils → _utils}/helpers.d.ts +0 -0
- /package/dist/{types/_utils → _utils}/number.d.ts +0 -0
- /package/dist/{types/componets → components}/tag-cloud/index.d.ts +0 -0
- /package/dist/{types/componets → components}/trend-chart/helpers/genPath.d.ts +0 -0
- /package/dist/{types/componets → components}/trend-chart/helpers/getPadding.d.ts +0 -0
- /package/dist/{types/componets → components}/trend-chart/helpers/validatePadding.d.ts +0 -0
@@ -1,7 +0,0 @@
|
|
1
|
-
import CloseCircleFill from './default/close-circle-fill.vue';
|
2
|
-
import CheckCircleFill from './default/check-circle-fill.vue';
|
3
|
-
import ExclamationCircleFill from './default/exclamation-circle-fill.vue';
|
4
|
-
import InfoCircleFill from './default/info-circle-fill.vue';
|
5
|
-
import MinusCircleFill from './default/minus-circle-fill.vue';
|
6
|
-
import AnimationLoading from './animation/animation-loading.vue';
|
7
|
-
export { CloseCircleFill, CheckCircleFill, ExclamationCircleFill, InfoCircleFill, MinusCircleFill, AnimationLoading, };
|
package/dist/types/ui.d.ts
DELETED
package/dist/ui.cjs.js
DELETED
@@ -1,2 +0,0 @@
|
|
1
|
-
(function(){"use strict";try{if(typeof document<"u"){var a=document.createElement("style");a.appendChild(document.createTextNode(".icon-loading-svg[data-v-62d46830]{animation:animated-loading-rotate-62d46830 1.5s infinite ease-in-out}.icon-loading-svg>.path[data-v-62d46830]{stroke:#fffc;stroke-width:5;animation:animated-loading-62d46830 1.5s infinite ease-in-out}@keyframes animated-loading-62d46830{0%{stroke-dasharray:1,125;stroke-dashoffset:0}50%{stroke-dasharray:95,31;stroke-dashoffset:-31px}to{stroke-dasharray:6,120;stroke-dashoffset:-120px}}@keyframes animated-loading-rotate-62d46830{to{transform:rotate(1turn)}}")),document.head.appendChild(a)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
|
2
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),he="X",Ne="x",se=e=>e?Ne+"-"+e:e||"",A=e=>he+e,S=e=>{const n=se(e);return{block:n,element:r=>`${n}--${r}`,modifier:r=>`${n}-${r}`,is:r=>`${n}-is-${r}`}},Ee=["px","%","vh","vw","calc"],ne=(e,n="px")=>{if(e===void 0)return"";const o=String(e);return Ee.some(l=>o.includes(l))?o:o+n},I=Object.prototype.toString;function ae(e){return I.call(e)==="[object Array]"}function ie(e){return I.call(e)==="[object Object]"}const ce=e=>I.call(e)==="[object Promise]";function de(e){return I.call(e)==="[object String]"}function be(e){return I.call(e)==="[object Number]"&&e===e}function N(e){return typeof e=="function"}function F(){return typeof window<"u"}const Be=1e3,we=3e3,Ve=1;class Oe{constructor(){this.popupStack={popup:new Set,dialog:new Set,message:new Set},this.getNextZIndex=n=>(n==="message"?Array.from(this.popupStack.message).pop()||we:Array.from(this.popupStack.popup).pop()||Be)+Ve,this.add=n=>{const o=this.getNextZIndex(n);return this.popupStack[n].add(o),n==="dialog"&&this.popupStack.popup.add(o),o},this.delete=(n,o)=>{this.popupStack[o].delete(n),o==="dialog"&&this.popupStack.popup.delete(n)},this.isLastDialog=n=>this.popupStack.dialog.size>1?n===Array.from(this.popupStack.dialog).pop():!0}}const _=new Oe;function X(e,{visible:n,runOnMounted:o}={}){const l=t.ref(0),a=()=>{l.value=_.add(e)},r=()=>{_.delete(l.value,e)},i=()=>e==="dialog"?_.isLastDialog(l.value):!1;return t.watch(()=>n==null?void 0:n.value,s=>{s?a():r()},{immediate:!0}),o&&(t.onMounted(()=>{a()}),t.onBeforeUnmount(()=>{r()})),{zIndex:t.readonly(l),open:a,close:r,isLastDialog:i}}const ue=e=>e.replace(/^./,n=>n.toLowerCase()).replace(/-(\w)/g,(n,o)=>{var l;return(l=o==null?void 0:o.toUpperCase())!==null&&l!==void 0?l:""}),fe=()=>{},Se=(e,n)=>{var o;if(F)return(o=document.querySelector(e))!==null&&o!==void 0?o:void 0},$e=e=>{if(e.tagName==="BODY")return window.innerWidth-(document.documentElement.offsetWidth||document.body.offsetWidth);const{borderLeftWidth:n,borderRightWidth:o}=window.getComputedStyle(e),l=Number(n.replace("px",""))+Number(o.replace("px",""));return e.offsetWidth-(e.clientWidth+l)},Te=e=>e.tagName==="BODY"?document.documentElement.scrollHeight>window.innerHeight:e.scrollHeight>e.offsetHeight,ze=(e,n)=>{var o;if(!F||!e||!n)return"";let l=ue(n);l==="float"&&(l="cssFloat");try{const a=e.style[l];if(a)return a;const r=(o=document.defaultView)===null||o===void 0?void 0:o.getComputedStyle(e,"");return r?r[l]:""}catch{return e.style[l]}},L=(e,n,o)=>{if(!(!e||!n))if(ie(n))Object.entries(n).forEach(([l,a])=>L(e,l,a));else{const l=ue(n);e.style[l]=o}},Y=(e,n)=>{if(de(e)){const o=e[0]==="#"?`[id='${e.slice(1)}']`:e;return Se(o)}return e},Me=F?(e,n,o,l=!1)=>{e.addEventListener(n,o,l)}:fe,Le=F?(e,n,o,l=!1)=>{e.removeEventListener(n,o,l)}:fe,De=(e,n)=>{let o=!1;const l={overflow:"",width:""},a=s=>s.tagName==="BODY",r=()=>{if(e.value){const s=e.value;if(!o&&s.style.overflow!=="hidden"){const d=$e(s);if(d>0||Te(s)){l.overflow=s.style.overflow,l.width=s.style.width;let u=0;a(s)&&(u=s.getBoundingClientRect().left||0),L(s,{width:`calc(100% - ${Math.ceil(d-u)}px)`,overflow:"hidden"}),o=!0}}}},i=()=>{if(e.value&&o){const s=e.value;L(s,{overflow:l.overflow,width:l.width}),o=!1}};return t.watch(()=>n==null?void 0:n.value,s=>{e.value&&!a(e.value)&&(s&&L(s,{position:"absolute"}),ze(e.value,"position")==="static"&&L(e.value,{position:"relative"}))}),{setOverflowHidden:r,resetOverflow:i}},Ae={ENTER:"Enter",ESC:"Escape",BACKSPACE:"Backspace",TAB:"Tab",SPACE:" ",ARROW_UP:"ArrowUp",ARROW_DOWN:"ArrowDown",ARROW_LEFT:"ArrowLeft",ARROW_RIGHT:"ArrowRight"},D=e=>e;var $;(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"})($||($={}));const Ie=e=>!!(e&&e.shapeFlag&$.ELEMENT),Pe=(e,n)=>!!(e&&e.shapeFlag&$.COMPONENT),He=(e,n)=>!!(e&&e.shapeFlag&8),je=(e,n)=>!!(e&&e.shapeFlag&$.ARRAY_CHILDREN),Re=(e,n)=>!!(e&&e.shapeFlag&$.SLOTS_CHILDREN),H=(e,n=!1)=>{var o,l;const a=[];for(const r of e??[])Ie(r)||Pe(r)||n&&He(r,r.children)?a.push(r):je(r,r.children)?a.push(...H(r.children,n)):Re(r,r.children)?a.push(...H((l=(o=r.children).default)===null||l===void 0?void 0:l.call(o),n)):ae(r)&&a.push(...H(r,n));return a},Fe={renderTo:{type:D([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}},Ue=["width","minWidth","height","minHeight"],_e=t.defineComponent({name:A("Dialog"),inheritAttrs:!1,props:Fe,emits:["closed","close","open","opened","update:modelValue"],setup(e,{emit:n}){const o=S("dialog"),l=o.block,a=S("message-box"),r=a.block,i=t.computed(()=>[l,e.messageBox&&"is-message-box",e.popupClass&&e.popupClass]),s=t.computed(()=>Y(e.renderTo)),d=t.ref(),u=t.computed(()=>e.disabled||!s.value),y=t.computed(()=>({zIndex:k.value})),f=t.computed(()=>{const g={};return e.fullscreen||(!e.center&&e.top&&(g.top=ne(e.top)),Ue.forEach(O=>{e[O]&&(g[O]=ne(e[O]))})),g}),p=t.ref(!1),m=t.computed(()=>e.modelValue),h=t.computed(()=>m.value||p.value),{zIndex:k,isLastDialog:E}=X("dialog",{visible:m}),{setOverflowHidden:v,resetOverflow:c}=De(s,d),C=(g,O)=>{n("update:modelValue",!1),n("close",e.messageBox?g:void 0,e.messageBox?O:void 0)},b=()=>{p.value=!1,c(),n("closed")},w=()=>{n("opened")},V=t.reactive({ok:!1,cancel:!1}),z=(g,O)=>{let P=!0;if(V[g]=!0,N(e.onBeforeCancel)&&(P=e.onBeforeCancel(g)??!1),ce(P)){P.then(ke=>{V[g]=!1,ke&&C(g,O)});return}V[g]=!1,P&&C(g,O)},Ce=()=>{e.maskToClose&&e.mask&&z("cancel")},pe=g=>{z("cancel",g)},ye=g=>{z("ok",g)};let U=!1;const ee=g=>{e.escToClose&&g.key===Ae.ESC&&E()&&z("cancel")},ge=()=>{e.escToClose&&!U&&(U=!0,Me(document.documentElement,"keydown",ee))},te=()=>{U=!1,Le(document.documentElement,"keydown",ee)};return t.onBeforeUnmount(()=>{c(),te()}),t.watch(()=>m.value,g=>{g?(n("open"),v(),p.value=!0,ge()):te()},{immediate:!0}),{cls:i,ns:l,cn:o,cnOMB:a,messageBoxNs:r,containerStyle:f,dialogStyle:y,dialogRef:d,teleportContainer:s,teleportDisabled:u,modelVisible:m,mergeVisible:h,interceptClose:z,afterLeave:b,afterEnter:w,handleMaskClick:Ce,handleCancel:pe,handleOk:ye,loadingObj:V}}}),B=(e,n)=>{const o=e.__vccOpts||e;for(const[l,a]of n)o[l]=a;return o};function We(e,n,o,l,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((...i)=>e.handleMaskClick&&e.handleMaskClick(...i),["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]=i=>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 me=B(_e,[["render",We]]),Ze={disabled:Boolean,block:Boolean,loading:Boolean,loadingFill:{type:Boolean,default:!1},debounce:{type:Number,default:0},shape:{type:D(String),default:void 0},link:{type:Boolean,default:!1},type:{type:D(String),default:void 0},status:{type:D(String),default:void 0},plain:{type:Boolean,default:!1},size:{type:D(String),default:"medium"},border:{type:Boolean,default:!0}},Ke=e=>de(e)?e.split("-").map(n=>n.charAt(0).toUpperCase()+n.slice(1)).join(""):"",Xe=(e,n="px")=>{if(e===void 0)return"";const o=typeof e=="number"?`${e}`:e;return["px","%","vh","vw","calc"].some(a=>o.includes(a))?o:o+n};function T(e){return t.defineComponent({name:se(`Icon${Ke(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 o="x-icon",l=t.computed(()=>{const r={};return n.size&&(r.fontSize=Xe(n.size)),n.rotate&&(r.transform=`rotate(${n.rotate}deg)`),n.color&&(r.color=n.color),r});return{cls:t.computed(()=>[o,{[`${o}-loading`]:n.spin}]),styles:l}}})}const Ye=T("animation-loading");function Ge(e,n,o,l,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 qe=B(Ye,[["render",Ge],["__scopeId","data-v-62d46830"]]),xe=t.defineComponent({name:A("Button"),components:{AnimationLoading:qe},props:Ze,emits:["click"],setup(e){const n=t.reactive({clicked:!1,isDebounce:!1}),o=S("button"),l=t.computed(()=>[o.block,e.type&&o.modifier(e.type),e.status&&o.modifier(e.status),e.disabled&&o.is("disabled"),e.block&&o.modifier("block"),e.plain&&o.is("plain"),e.shape&&o.modifier(e.shape),e.link&&o.modifier("is-link"),e.size&&o.modifier(e.size),!e.border&&o.modifier("is-hide-border"),r.value&&o.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),i=t.getCurrentInstance(),s=(u,y)=>{const f=u(y);ce(f)&&(n.clicked=!0,f.finally(()=>{n.clicked=!1}))};return{cn:o,cls:l,handleClick:async u=>{var f,p,m,h;if((p=(f=u.target).blur)==null||p.call(f),r.value)return;a();const y=(h=(m=i==null?void 0:i.vnode)==null?void 0:m.props)==null?void 0:h.onClick;ae(y)?y.forEach(k=>s(k,u)):N(y)&&s(y,u)},isLoading:r}}}),Je=["disabled"];function Qe(e,n,o,l,a,r){const i=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(i)],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,Je)}const R=B(xe,[["render",Qe]]),ve=t.defineComponent({name:A("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 o=S("space"),l=t.computed(()=>[o.block,o.element(e.direction),e.fill&&"is-fill",o.element(`${e.direction}-${e.align}`)]);function a(i){if(be(i))return i;switch(i){case"mini":return 4;case"small":return 8;case"medium":return 16;case"large":return 24;default:return 8}}const r=i=>{const s={};if(i)return s;const d=`${a(e.size)}px`,u=`${a(e.size)}px`;return e.direction==="horizontal"&&(s.marginRight=d),e.direction==="vertical"&&(s.marginBottom=u),s};return()=>{var i;const s=H((i=n.default)===null||i===void 0?void 0:i.call(n),!0).filter(d=>d.type!==t.Comment);return t.createVNode("div",{class:[l.value]},[s.map((d,u)=>{var y;const f=n.split&&u>0;return t.createVNode(t.Fragment,{key:`space-item-${u}`},[f&&t.createVNode("div",{className:o.element("split"),style:r(!1)},[(y=n.split)===null||y===void 0?void 0:y.call(n)]),t.createVNode("div",{className:o.element("item"),style:r(u===s.length-1)},[d])])})])}}});function oe(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!t.isVNode(e)}const le=S("dialog"),et=e=>{var n,o,l,a,r,i;const s=document.createElement("div"),d=()=>{t.render(null,s)},u=v=>{if(v==="cancel")return e.beforeOnCancel?e.beforeOnCancel():!0;if(v==="ok")return e.beforeOnOk?e.beforeOnOk():!0},y=(v,c)=>{v==="cancel"&&e.onCancel&&e.onCancel(c),v==="ok"&&e.onOk&&e.onOk(c)},f=v=>{if(t.isVNode(v))return v;if(N(v)){const c=v();return t.isVNode(c)?c:null}return t.createVNode("div",{className:le.element("header-title")},[t.createTextVNode(" "),v,t.createTextVNode(" ")])},p=v=>{if(t.isVNode(v))return v;if(N(v)){const c=v();return t.isVNode(c)?c:null}return t.createVNode("div",{className:le.element("content")},[t.createTextVNode(" "),e.content,t.createTextVNode(" ")])},m=()=>()=>t.createVNode(t.Fragment,null,[e.title&&f(e.title)]),h=()=>()=>t.createVNode(t.Fragment,null,[e.content&&p(e.content)]),k=()=>{if(t.isVNode(e.footer)||N(e.footer))return e.footer;const v=(e==null?void 0:e.cancelText)||"取消",c=(e==null?void 0:e.okText)||"确认";return C=>{var b,w;return t.createVNode(ve,{size:12},{default:()=>[!e.hideCancel&&t.createVNode(R,{size:"small",onClick:C.cancel,loading:(b=C.loadingObj)===null||b===void 0?void 0:b.cancel},oe(v)?v:{default:()=>[v]}),!e.hideOk&&t.createVNode(R,{type:"primary",size:"small",onClick:C.ok,loading:(w=C.loadingObj)===null||w===void 0?void 0:w.ok},oe(c)?c:{default:()=>[c]})]})}},E=t.createVNode(me,{width:(n=e==null?void 0:e.width)!==null&&n!==void 0?n:368,height:(o=e==null?void 0:e.height)!==null&&o!==void 0?o:"auto",modelValue:!0,renderTo:e==null?void 0:e.renderTo,center:e!=null&&e.top?!1:(l=e==null?void 0:e.center)!==null&&l!==void 0?l:!0,top:(a=e==null?void 0:e.top)!==null&&a!==void 0?a:0,mask:(r=e==null?void 0:e.mask)!==null&&r!==void 0?r:!0,maskToClose:(i=e==null?void 0:e.maskToClose)!==null&&i!==void 0?i:!0,popupClass:e.popupClass,onClose:y,onBeforeCancel:u,"onUpdate:modelValue":()=>{E.component.props.modelValue=!1},onClosed:d,onOpened:()=>{}},{title:m(),default:h(),footer:k()});t.render(E,s)},tt=["success","warning","error","strong","info"],nt=T("close-circle-fill");function ot(e,n,o,l,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 G=B(nt,[["render",ot]]),lt=T("check-circle-fill");function rt(e,n,o,l,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 q=B(lt,[["render",rt]]),st=T("exclamation-circle-fill");function at(e,n,o,l,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 x=B(st,[["render",at]]),it=T("info-circle-fill");function ct(e,n,o,l,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 J=B(it,[["render",ct]]),dt=T("minus-circle-fill");function ut(e,n,o,l,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=B(dt,[["render",ut]]),ft=t.defineComponent({name:A("Message"),components:{CloseCircleFill:G,CheckCircleFill:q,ExclamationCircleFill:x,InfoCircleFill:J,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=S("message"),o=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]),l=t.ref(!1);let a=null;const r=()=>{a=setTimeout(()=>{l.value=!1},e.duration)};t.onMounted(()=>{l.value=!0,e.duration!==0&&r()}),t.onUnmounted(()=>{clearTimeout(a)});const{zIndex:i}=X("message",{runOnMounted:!0}),s=t.computed(()=>({top:`${e.offset}px`,zIndex:i.value}));return{cn:n,cls:o,styles:s,visible:l,handleClose:()=>{l.value=!1}}}}),mt=["innerHTML"],vt={key:1};function Ct(e,n,o,l,a,r){const i=t.resolveComponent("CheckCircleFill"),s=t.resolveComponent("ExclamationCircleFill"),d=t.resolveComponent("MinusCircleFill"),u=t.resolveComponent("CloseCircleFill"),y=t.resolveComponent("InfoCircleFill");return t.openBlock(),t.createBlock(t.Transition,{name:"x-message-slide-top",onBeforeLeave:e.onClose,onAfterLeave:n[1]||(n[1]=f=>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(i,{key:0})):e.type==="warning"?(t.openBlock(),t.createBlock(s,{key:1})):e.type==="strong"?(t.openBlock(),t.createBlock(d,{key:2})):e.type==="error"?(t.openBlock(),t.createBlock(u,{key:3})):e.type==="info"?(t.openBlock(),t.createBlock(y,{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,mt)):(t.openBlock(),t.createElementBlock("span",vt,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]=(...f)=>e.handleClose&&e.handleClose(...f))},null,2)):t.createCommentVNode("",!0)])],6),[[t.vShow,e.visible]])]),_:3},8,["onBeforeLeave"])}const pt=B(ft,[["render",Ct]]),W=new WeakMap,j=e=>{(typeof e=="string"||t.isVNode(e))&&(e={message:e});const n=Y(e.renderTo||"body");W.has(n)||W.set(n,[]);const o=W.get(n);let l=e.offset||20;o.forEach(f=>{var p;l+=((p=f.el)===null||p===void 0?void 0:p.offsetHeight)+20});const a=e.onClose;let r={};r={...e,onClose:()=>{var f;const p=o.findIndex(h=>h===d);if(p<0)return;const m=((f=d.el)===null||f===void 0?void 0:f.offsetHeight)+20;o.slice(p+1).forEach(h=>{var k;const E=(k=h.component)===null||k===void 0?void 0:k.props.offset;h.component.props.offset=E-m}),o.splice(p,1),a&&a(d)},onDestroy:()=>{t.render(null,u)},offset:l};const d=t.createVNode(pt,r,N(r.message)||t.isVNode(r.message)?{default:N(r.message)?r.message:()=>r.message}:null),u=document.createElement("div");return t.render(d,u),n.tagName==="BODY"?d.el.style.position="fixed":(n.style.position="relative",d.el.style.position="absolute"),n.appendChild(u.firstElementChild),o.push(d),{close:()=>{d.component.proxy.handleClose()}}},yt=()=>{tt.forEach(e=>{j[e]=n=>ie(n)?j({type:e,...n}):j({message:n,type:e})})};yt();const gt=["info","success","warning","strong","error"];function re(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!t.isVNode(e)}const Z=S("message-box"),K=e=>{var n,o,l,a,r,i;const s=document.createElement("div"),d=()=>{t.render(null,s)},u=c=>{if(c==="cancel")return e.beforeOnCancel?e.beforeOnCancel():!0;if(c==="ok")return e.beforeOnOk?e.beforeOnOk():!0},y=(c,C)=>{c==="cancel"&&e.onCancel&&e.onCancel(C),c==="ok"&&e.onOk&&e.onOk(C)},f=c=>{let C;switch(c){case"warning":C=t.createVNode(x,{size:"22px",color:"#f6c64b"},null);break;case"strong":C=t.createVNode(Q,{size:"22px",color:"#ff7125"},null);break;case"error":C=t.createVNode(G,{size:"22px",color:"#e24f48"},null);break;case"success":C=t.createVNode(q,{size:"22px",color:"#68d1ab"},null);break;case"info":C=t.createVNode(J,{size:"22px",color:"#2355f5"},null);break}return t.createVNode("div",{className:Z.element("icon")},[C])},p=c=>{if(t.isVNode(c))return c;if(N(c)){const C=c();return t.isVNode(C)?C:null}return t.createVNode("div",{className:Z.element("title")},[t.createTextVNode(" "),c,t.createTextVNode(" ")])},m=c=>{if(t.isVNode(c))return c;if(N(c)){const C=c();return t.isVNode(C)?C:null}return t.createVNode("div",{className:Z.element("content")},[t.createTextVNode(" "),e.content,t.createTextVNode(" ")])},h=()=>()=>t.createVNode(t.Fragment,null,[f(e.type||"success"),e.title&&p(e.title)]),k=()=>()=>t.createVNode(t.Fragment,null,[e.content&&m(e.content)]),E=()=>{if(t.isVNode(e.footer)||N(e.footer))return e.footer;const c=(e==null?void 0:e.cancelText)||"取消",C=(e==null?void 0:e.okText)||"确认";return b=>{var w,V;return t.createVNode(ve,{size:12},{default:()=>[!e.hideCancel&&t.createVNode(R,{size:"small",onClick:b.cancel,loading:(w=b.loadingObj)===null||w===void 0?void 0:w.cancel},re(c)?c:{default:()=>[c]}),!e.hideOk&&t.createVNode(R,{type:"primary",size:"small",onClick:b.ok,loading:(V=b.loadingObj)===null||V===void 0?void 0:V.ok},re(C)?C:{default:()=>[C]})]})}},v=t.createVNode(me,{messageBox:!0,width:(n=e==null?void 0:e.width)!==null&&n!==void 0?n:358,height:(o=e==null?void 0:e.height)!==null&&o!==void 0?o:"auto",modelValue:!0,renderTo:e==null?void 0:e.renderTo,center:e!=null&&e.top?!1:(l=e==null?void 0:e.center)!==null&&l!==void 0?l:!0,top:(a=e==null?void 0:e.top)!==null&&a!==void 0?a:0,mask:(r=e==null?void 0:e.mask)!==null&&r!==void 0?r:!0,maskToClose:(i=e==null?void 0:e.maskToClose)!==null&&i!==void 0?i:!0,popupClass:e.popupClass,onClose:y,onBeforeCancel:u,"onUpdate:modelValue":()=>{v.component.props.modelValue=!1},onClosed:d,onOpened:()=>{}},{title:h(),default:k(),footer:E()});t.render(v,s)},kt=()=>{gt.forEach(e=>{K[e]=(n,o)=>{const l=[],a=[];let r=()=>!0,i=()=>!0;return setTimeout(()=>{K({title:n,content:o,type:e,beforeOnCancel:i,beforeOnOk:r,onOk:()=>{l.forEach(s=>N(s)&&s())},onCancel:()=>{a.forEach(s=>N(s)&&s())}})},0),{ok(...s){return s.length===1&&l.push(s[0]),s.length===2&&(r=s[0],l.push(s[1])),this},cancel(...s){return s.length===1&&a.push(s[0]),s.length===2&&(i=s[0],a.push(s[1])),this}}}})};kt();const ht={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}},Nt=t.defineComponent({name:A("Notification"),props:ht,emits:["close","destroy"],setup(e){const n=S("notification"),o=n.block,l=t.computed(()=>[o,n.modifier(r.value.ver)]),{zIndex:a}=X("message",{runOnMounted:!0}),r=t.computed(()=>{const m=e.position.split("-");return{hor:m[1],ver:m[0]}}),i=t.computed(()=>`x-notification-slide-${r.value.hor}`),s=t.computed(()=>{const m={};return m.position=e.renderToBody?"fixed":"absolute",m.zIndex=a.value,m[r.value.hor]="20px",m[r.value.ver]=`${e.offset}px`,m}),d=t.ref(!1);let u=0;const y=()=>{u=setTimeout(()=>{d.value=!1},e.duration)},f=t.computed(()=>e.type==="info"?J:e.type==="warning"?x:e.type==="strong"?Q:e.type==="success"?q:e.type==="error"?G:""),p=()=>{d.value=!1};return t.onMounted(()=>{e.duration!==0&&y(),d.value=!0}),t.onUnmounted(()=>{clearTimeout(u)}),{ns:o,cn:n,cls:l,animationClsName:i,positionStyle:s,visible:d,positionPropMap:r,currentIcon:f,handleClose:p}}});function Et(e,n,o,l,a,r){return t.openBlock(),t.createBlock(t.Transition,{name:e.animationClsName,onBeforeLeave:n[1]||(n[1]=i=>e.$emit("close")),onAfterLeave:n[2]||(n[2]=i=>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((...i)=>e.handleClose&&e.handleClose(...i),["self"]))},null,2)):t.createCommentVNode("",!0)],6),[[t.vShow,e.visible]])]),_:3},8,["name"])}const bt=B(Nt,[["render",Et]]),M=new WeakMap,Bt=e=>{var n,o;const l=Y(e.renderTo||"body"),a=document.createElement("div");M.get(l)||M.set(l,{}),M.get(l)[e.position]||(M.get(l)[e.position]=[]);const r=M.get(l)[e.position];let i=e.offset||20;r.forEach(p=>{var m;i+=((m=p.el)===null||m===void 0?void 0:m.offsetHeight)+20});const s=l.tagName==="BODY";s||(l.style.position="relative",l.style.overflowX="hidden");const d=e.onClose,u=()=>{var p;const m=r.findIndex(k=>k===f);if(m<0)return;const h=((p=f.el)===null||p===void 0?void 0:p.offsetHeight)+20;r.slice(m+1).forEach(k=>{var E;const v=(E=k.component)===null||E===void 0?void 0:E.props.offset;k.component.props.offset=v-h}),r.splice(m,1),d&&d(f)},y=()=>{t.render(null,a)},f=t.createVNode(bt,{message:e.message,title:e.title,type:e.type,offset:i,renderToBody:s,position:e.position,duration:(n=e.duration)!==null&&n!==void 0?n:3e3,showClose:(o=e.showClose)!==null&&o!==void 0?o:!0,onClose:u,onDestroy:y},N(e.message)||t.isVNode(e.message)?{default:N(e.message)?e.message:()=>e.message}:null);t.render(f,a),r.push(f),l==null||l.appendChild(a.firstChild)};exports.Dialog=et;exports.Message=j;exports.MessageBox=K;exports.Notification=Bt;
|