@gopowerteam/modal-render 0.0.32 → 0.0.33

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -28,6 +28,7 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
28
28
  bodyStyle?: CSSProperties | undefined;
29
29
  submitText?: string | undefined;
30
30
  cancelText?: string | undefined;
31
+ zIndex?: number | undefined;
31
32
  }>, {
32
33
  header: boolean;
33
34
  closeable: boolean;
@@ -41,6 +42,7 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
41
42
  submitText: string;
42
43
  cancelText: string;
43
44
  maxHeight: number;
45
+ zIndex: number;
44
46
  }>, {
45
47
  showLoading: () => () => void;
46
48
  hideLoading: () => void;
@@ -74,6 +76,7 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
74
76
  bodyStyle?: CSSProperties | undefined;
75
77
  submitText?: string | undefined;
76
78
  cancelText?: string | undefined;
79
+ zIndex?: number | undefined;
77
80
  }>, {
78
81
  header: boolean;
79
82
  closeable: boolean;
@@ -87,6 +90,7 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
87
90
  submitText: string;
88
91
  cancelText: string;
89
92
  maxHeight: number;
93
+ zIndex: number;
90
94
  }>>> & {
91
95
  onSubmit?: ((...args: any[]) => any) | undefined;
92
96
  }, {
@@ -101,6 +105,7 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
101
105
  mode: 'dialog' | 'drawer';
102
106
  submitText: string;
103
107
  cancelText: string;
108
+ zIndex: number;
104
109
  }, {}>;
105
110
  export default _default;
106
111
  type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue");const A=Symbol("__MODAL__");function W(o){return e.getCurrentScope()?(e.onScopeDispose(o),!0):!1}function b(o){return typeof o=="function"?o():e.unref(o)}const j=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const J=Object.prototype.toString,Q=o=>J.call(o)==="[object Object]",Z=()=>{};function ee(o,i={}){if(!e.isRef(o))return e.toRefs(o);const n=Array.isArray(o.value)?Array.from({length:o.value.length}):{};for(const t in o.value)n[t]=e.customRef(()=>({get(){return o.value[t]},set(c){var s;if((s=b(i.replaceRef))!=null?s:!0)if(Array.isArray(o.value)){const h=[...o.value];h[t]=c,o.value=h}else{const h={...o.value,[t]:c};Object.setPrototypeOf(h,Object.getPrototypeOf(o.value)),o.value=h}else o.value[t]=c}}));return n}function te(o,i=!0){e.getCurrentInstance()?e.onMounted(o):i?o():e.nextTick(o)}function R(o){var i;const n=b(o);return(i=n==null?void 0:n.$el)!=null?i:n}const P=j?window:void 0;function D(...o){let i,n,t,c;if(typeof o[0]=="string"||Array.isArray(o[0])?([n,t,c]=o,i=P):[i,n,t,c]=o,!i)return Z;Array.isArray(n)||(n=[n]),Array.isArray(t)||(t=[t]);const s=[],u=()=>{s.forEach(v=>v()),s.length=0},h=(v,d,l,f)=>(v.addEventListener(d,l,f),()=>v.removeEventListener(d,l,f)),_=e.watch(()=>[R(i),b(c)],([v,d])=>{if(u(),!v)return;const l=Q(d)?{...d}:d;s.push(...n.flatMap(f=>t.map(a=>h(v,f,a,l))))},{immediate:!0,flush:"post"}),y=()=>{_(),u()};return W(y),y}function oe(){const o=e.ref(!1);return e.getCurrentInstance()&&e.onMounted(()=>{o.value=!0}),o}function ne(o){const i=oe();return e.computed(()=>(i.value,!!o()))}function re(o,i={}){var n,t;const{pointerTypes:c,preventDefault:s,stopPropagation:u,exact:h,onMove:_,onEnd:y,onStart:v,initialValue:d,axis:l="both",draggingElement:f=P,containerElement:a,handle:g=o}=i,p=e.ref((n=b(d))!=null?n:{x:0,y:0}),k=e.ref(),x=m=>c?c.includes(m.pointerType):!0,B=m=>{b(s)&&m.preventDefault(),b(u)&&m.stopPropagation()},O=m=>{var M;if(!x(m)||b(h)&&m.target!==b(o))return;const w=b(a),N=(M=w==null?void 0:w.getBoundingClientRect)==null?void 0:M.call(w),E=b(o).getBoundingClientRect(),S={x:m.clientX-(w?E.left-N.left:E.left),y:m.clientY-(w?E.top-N.top:E.top)};(v==null?void 0:v(S,m))!==!1&&(k.value=S,B(m))},H=m=>{var M;if(!x(m)||!k.value)return;const w=b(a),N=(M=w==null?void 0:w.getBoundingClientRect)==null?void 0:M.call(w),E=b(o).getBoundingClientRect();let{x:S,y:$}=p.value;(l==="x"||l==="both")&&(S=m.clientX-k.value.x,w&&(S=Math.min(Math.max(0,S),N.width-E.width))),(l==="y"||l==="both")&&($=m.clientY-k.value.y,w&&($=Math.min(Math.max(0,$),N.height-E.height))),p.value={x:S,y:$},_==null||_(p.value,m),B(m)},T=m=>{x(m)&&k.value&&(k.value=void 0,y==null||y(p.value,m),B(m))};if(j){const m={capture:(t=i.capture)!=null?t:!0};D(g,"pointerdown",O,m),D(f,"pointermove",H,m),D(f,"pointerup",T,m)}return{...ee(p),position:p,isDragging:e.computed(()=>!!k.value),style:e.computed(()=>`left:${p.value.x}px;top:${p.value.y}px;`)}}function le(o,i,n={}){const{window:t=P,...c}=n;let s;const u=ne(()=>t&&"ResizeObserver"in t),h=()=>{s&&(s.disconnect(),s=void 0)},_=e.computed(()=>Array.isArray(o)?o.map(d=>R(d)):[R(o)]),y=e.watch(_,d=>{if(h(),u.value&&t){s=new ResizeObserver(i);for(const l of d)l&&s.observe(l,c)}},{immediate:!0,flush:"post",deep:!0}),v=()=>{h(),y()};return W(v),{isSupported:u,stop:v}}function V(o,i={width:0,height:0},n={}){const{window:t=P,box:c="content-box"}=n,s=e.computed(()=>{var d,l;return(l=(d=R(o))==null?void 0:d.namespaceURI)==null?void 0:l.includes("svg")}),u=e.ref(i.width),h=e.ref(i.height),{stop:_}=le(o,([d])=>{const l=c==="border-box"?d.borderBoxSize:c==="content-box"?d.contentBoxSize:d.devicePixelContentBoxSize;if(t&&s.value){const f=R(o);if(f){const a=t.getComputedStyle(f);u.value=Number.parseFloat(a.width),h.value=Number.parseFloat(a.height)}}else if(l){const f=Array.isArray(l)?l:[l];u.value=f.reduce((a,{inlineSize:g})=>a+g,0),h.value=f.reduce((a,{blockSize:g})=>a+g,0)}else u.value=d.contentRect.width,h.value=d.contentRect.height},n);te(()=>{const d=R(o);d&&(u.value="offsetWidth"in d?d.offsetWidth:i.width,h.value="offsetHeight"in d?d.offsetHeight:i.height)});const y=e.watch(()=>R(o),d=>{u.value=d?i.width:0,h.value=d?i.height:0});function v(){_(),y()}return{width:u,height:h,stop:v}}const ie=o=>(e.pushScopeId("data-v-d6dd5541"),o=o(),e.popScopeId(),o),se={class:"title text-16px font-bold"},ae={class:"action"},ce=["form"],de={key:2,class:"modal-loading"},ue=ie(()=>e.createElementVNode("div",{class:"lds-ring"},[e.createElementVNode("div"),e.createElementVNode("div"),e.createElementVNode("div"),e.createElementVNode("div")],-1)),fe=[ue],pe={name:"ModalContainer",inheritAttrs:!0},me=e.defineComponent({...pe,props:{id:{},form:{},component:{},componentProps:{},width:{},maxWidth:{},maxHeight:{default:90},sizes:{},size:{default:"middle"},fullscreen:{type:Boolean},title:{},header:{type:Boolean,default:!0},footer:{type:Boolean,default:!1},closeable:{type:Boolean,default:!0},esc:{type:Boolean,default:!1},maskClosable:{type:Boolean,default:!1},draggable:{type:Boolean,default:!1},mode:{default:"dialog"},type:{},offset:{},backgroundColor:{},bodyStyle:{},submitText:{default:"确定"},cancelText:{default:"取消"}},emits:["submit"],setup(o,{expose:i,emit:n}){const t=o,c=n,s=e.inject(A),u=e.ref(!1);let h=0,_=0;const y=e.shallowRef(),v=e.shallowRef(),d=e.shallowRef(),l=e.shallowRef(),f=e.shallowRef(),a=e.shallowRef(),{height:g}=V(y),{height:p}=V(d,void 0,{box:"border-box"}),{height:k}=V(l,void 0,{box:"border-box"}),{height:x}=V(f),{height:B}=V(a),{x:O,y:H}=re(d,{initialValue:{x:0,y:0}});function T(){s==null||s.close(t.id)}function m(r){return typeof r=="number"?`${r}px`:r}const M=e.computed(()=>{const r={};return t.mode==="dialog"&&(r.justifyContent="center"),t.mode==="drawer"&&(r.justifyContent="flex-end"),r}),w=e.computed(()=>{const r={};return t.size&&(r.width=m(t.sizes[t.size])),t.width&&(r.width=m(t.width)),t.maxWidth&&(r.maxWidth=m(t.maxWidth)),t.fullscreen&&(r.maxWidth="unset",r.width="100%",r.position="fixed",r.top=0,r.left=0,r.bottom=0,r.right=0,r.borderRadius=0),t.draggable&&!t.fullscreen&&t.mode==="dialog"&&(r.transform=`translate3d(${O.value-h}px, ${H.value-_}px, 0px)`),t.mode==="drawer"&&(r.borderRadius=0,r.height="100%"),t.offset&&t.mode==="dialog"&&(r.marginLeft=`${t.offset.x||0}px`,r.marginTop=`${t.offset.y||0}px`),t.backgroundColor&&(r.backgroundColor=t.backgroundColor),r}),N=e.computed(()=>{const r={};return t.draggable&&!t.fullscreen&&t.mode==="dialog"&&(r.cursor="move"),r}),E=e.computed(()=>{const r={},C=x.value+B.value+p.value+k.value,I=Math.floor(g.value*(Number(m(t.maxHeight).replace("%",""))/100));return t.maxHeight&&(r.maxHeight=`${I-C}px`),t.mode==="drawer"&&(r.maxHeight="unset",r.height=`${g.value-C}px`),t.fullscreen&&(r.maxHeight="unset",r.height=`calc(100% - ${C}px)`),t.type!=="component"&&(r.padding="0"),t.bodyStyle&&Object.assign(r,t.bodyStyle),r});function S(){const r=v.value;if(t.form&&r){const C=r.querySelector(`form[name="${t.form}"]`);C&&C.dispatchEvent(new Event("submit"))}c("submit")}function $(){s==null||s.close(t.id)}function X(){window&&window.addEventListener("resize",()=>{e.triggerRef(y),e.triggerRef(v),v.value&&(h=v.value.offsetLeft,_=v.value.offsetTop)})}function Y(){if(t.closeable&&t.esc){const r=({key:C})=>{C==="Escape"&&(s==null||s.close(t.id),window.removeEventListener("keydown",r))};window.addEventListener("keydown",r)}}function q(){h=v.value.offsetLeft,_=v.value.offsetTop}e.onMounted(()=>{Y(),X()}),e.onUnmounted(()=>{});function U(){return u.value=!0,()=>F()}function F(){u.value=!1}return i({showLoading:U,hideLoading:F}),(r,C)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"wrapperRef",ref:y,class:"modal-wrapper",style:e.normalizeStyle(M.value),onClick:C[0]||(C[0]=e.withModifiers(I=>r.maskClosable&&T(),["self"]))},[e.createElementVNode("div",{ref_key:"contentRef",ref:v,class:e.normalizeClass(["modal-content",{[`${r.mode}-mode`]:!0}]),style:e.normalizeStyle(w.value)},[r.header?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"headerRef",ref:d,class:"modal-header",style:e.normalizeStyle(N.value),onMousedown:q},[e.createElementVNode("div",se,e.toDisplayString(r.title),1),e.createElementVNode("div",ae,[r.closeable?(e.openBlock(),e.createElementBlock("div",{key:0,class:"i-icon-park-outline:close block cursor-pointer",onClick:T})):e.createCommentVNode("",!0)])],36)):e.createCommentVNode("",!0),e.createElementVNode("div",{id:"modal-header-slot",ref_key:"headerSlotRef",ref:f},null,512),e.createElementVNode("div",{class:"modal-body",style:e.normalizeStyle(E.value)},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(r.component),e.normalizeProps(e.guardReactiveProps(r.componentProps)),null,16))],4),e.createElementVNode("div",{id:"modal-footer-slot",ref_key:"footerSlotRef",ref:a},null,512),r.footer?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"footerRef",ref:l,class:"modal-footer space-x-2"},[e.createElementVNode("button",{class:"cancel-button",type:"button",onClick:$},e.toDisplayString(r.cancelText),1),e.createElementVNode("button",{class:"submit-button",form:r.form,type:"submit",onClick:S},e.toDisplayString(r.submitText),9,ce)],512)):e.createCommentVNode("",!0),u.value?(e.openBlock(),e.createElementBlock("div",de,fe)):e.createCommentVNode("",!0)],6)],4))}});const L=(o,i)=>{const n=o.__vccOpts||o;for(const[t,c]of i)n[t]=c;return n},G=L(me,[["__scopeId","data-v-d6dd5541"]]),he={class:"modal-dialog"},ve={class:"dialog-body"},ge={class:"dialog-title"},ye={class:"dialog-content"},_e=e.defineComponent({__name:"modal-dialog",props:{type:{},title:{},content:{},okText:{default:"确定"},cancelText:{default:"取消"},onOk:{},onCancel:{},footer:{}},setup(o){const i=o,n=K(),t=e.computed(()=>i.title?i.title:{confirm:"提示",info:"提示",warning:"警告",error:"错误",success:"成功"}[i.type]);async function c(){i.onOk&&await i.onOk(),n.close()}async function s(){i.onCancel&&await i.onCancel(),n.close()}return(u,h)=>(e.openBlock(),e.createElementBlock("section",he,[e.createElementVNode("div",ve,[e.createElementVNode("div",ge,e.toDisplayString(t.value),1),e.createElementVNode("div",ye,e.toDisplayString(u.content),1)]),e.createElementVNode("div",{class:"dialog-footer space-x-2",style:e.normalizeStyle(u.type==="confirm"?{"justify-content":"end"}:{"border-top":"none"})},[u.footer?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(u.footer),{key:0})):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("button",{class:"submit-button",type:"submit",onClick:c},e.toDisplayString(u.okText),1),u.type==="confirm"?(e.openBlock(),e.createElementBlock("button",{key:0,class:"cancel-button",type:"button",onClick:s},e.toDisplayString(u.cancelText),1)):e.createCommentVNode("",!0)],64))],4)]))}});const we=L(_e,[["__scopeId","data-v-8326e5a5"]]),be={key:0,class:"modal-teleport"},ke={name:"ModalProvider",inheritAttrs:!0},Ce=e.defineComponent({...ke,props:{appendToBody:{type:[Boolean,String],default:!1},sizes:{default:()=>({small:520,middle:860,large:1190})},maxWidth:{default:"90%"},maxHeight:{default:"90%"},offset:{default:()=>({x:0,y:0})}},setup(o,{expose:i}){const n=e.shallowRef([]),t=e.ref(!1),c=e.getCurrentInstance();function s(l,f={},a={}){const g=e.defineAsyncComponent(()=>Promise.resolve(typeof l=="string"?we:l));typeof l=="string"&&(f.type=l,a.size="small",a.fullscreen=!1,a.mode="dialog",a.footer=!1,a.header=!1);const p=Math.random().toString(32).slice(2),k=new Promise((x,B)=>{n.value.push({id:p,component:g,props:f||{},options:{...a,type:typeof l=="string"?l:"component"},resolve:x,reject:B,listeners:[]}),e.triggerRef(n)}).catch(x=>x==="CANCEL"?new Promise(()=>{}):Promise.reject(x));return Object.assign(k,{close:()=>u(p)})}function u(l,f){const a=n.value.findIndex(p=>p.id===l);if(a<0)return;const g=n.value[a];f===void 0?g==null||g.reject("CANCEL"):g==null||g.resolve(f),n.value.splice(a,1),e.triggerRef(n)}function h(){!n.value||n.value.length===0||(n.value.forEach(l=>{l==null||l.reject("CANCEL")}),n.value=[],e.triggerRef(n))}function _(l,f){const a=n.value.find(p=>p.id===l);if(!a)return;const g=a.listeners.find(p=>p.event===f);g&&g.callback({open:s,close:p=>u(a.id,p),closeAll:h,showLoading:()=>y(a.id),hideLoading:()=>v(a.id),confirm:p=>s("confirm",p),success:p=>s("success",p),error:p=>s("error",p),warning:p=>s("warning",p),info:p=>s("info",p)})}function y(l){if(!c)return;const[f]=c.refs[`modal-container_${l}`];if(f)return f.showLoading()}function v(l){if(!c)return;const[f]=c.refs[`modal-container_${l}`];if(f)return f.hideLoading()}function d(l,f,a){const g=n.value.find(p=>p.id===l);g&&g.listeners.push({event:f,callback:a})}return e.provide(A,{open:s,close:u,closeAll:h,addEventListener:d}),i({elements:n,open:s,close:u,closeAll:h}),e.onMounted(()=>{t.value=!0}),(l,f)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.renderSlot(l.$slots,"default",{},void 0,!0),t.value?(e.openBlock(),e.createElementBlock("div",be,[(e.openBlock(),e.createBlock(e.Teleport,{disabled:!l.appendToBody,to:typeof l.appendToBody=="string"?l.appendToBody:"body"},[e.createVNode(e.TransitionGroup,{name:"modal-fade"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,a=>(e.openBlock(),e.createBlock(G,e.mergeProps({id:a.id,key:a.id,ref_for:!0,ref:`modal-container_${a.id}`,component:a.component,"component-props":a.props,"max-height":l.maxHeight,"max-width":l.maxWidth,offset:l.offset,sizes:l.sizes},a.options,{onSubmit:()=>_(a.id,"submit")}),null,16,["id","component","component-props","max-height","max-width","offset","sizes","onSubmit"]))),128))]),_:1})],8,["disabled","to"]))])):e.createCommentVNode("",!0)],64))}});const xe=L(Ce,[["__scopeId","data-v-241a8304"]]);const Ee={},Se={class:"modal-footer"};function Be(o,i){return e.openBlock(),e.createBlock(e.Teleport,{to:"#modal-footer-slot"},[e.createElementVNode("div",Se,[e.renderSlot(o.$slots,"default",{},void 0,!0)])])}const Me=L(Ee,[["render",Be],["__scopeId","data-v-2080a86e"]]);const Ne={},Re={class:"modal-header"};function $e(o,i){return e.openBlock(),e.createBlock(e.Teleport,{to:"#modal-header-slot"},[e.createElementVNode("div",Re,[e.renderSlot(o.$slots,"default",{},void 0,!0)])])}const Ve=L(Ne,[["render",$e],["__scopeId","data-v-d0247172"]]);function z(o,i){var t,c;let n=o==null?void 0:o.parent;for(;n&&((t=n==null?void 0:n.type)==null?void 0:t.name)!==i;)n=n.parent;return((c=n==null?void 0:n.type)==null?void 0:c.name)===i?n:null}function K(){const o=e.inject(A),i=e.getCurrentInstance();function n(t,c,s){if(!o)throw new Error("Not Found Modal Provider Component");return o.open(t,c,s)}return{open:n,close(t){var u;if(!o)throw new Error("Not Found Modal Provider Component");const c=z(i,"ModalContainer"),s=(u=c==null?void 0:c.props)==null?void 0:u.id;if(!s)throw new Error("Not Found Current Modal Container");o.close(s,t)},closeAll(){if(!o)throw new Error("Not Found Modal Provider Component");o.closeAll()},showLoading(){var s;if(!o)throw new Error("Not Found Modal Provider Component");const t=z(i,"ModalContainer");if(!((s=t==null?void 0:t.props)==null?void 0:s.id))throw new Error("Not Found Current Modal Container");t!=null&&t.exposed&&(t==null||t.exposed.showLoading())},hideLoading(){var s;if(!o)throw new Error("Not Found Modal Provider Component");const t=z(i,"ModalContainer");if(!((s=t==null?void 0:t.props)==null?void 0:s.id))throw new Error("Not Found Current Modal Container");t!=null&&t.exposed&&(t==null||t.exposed.hideLoading())},confirm(t){return this.open("confirm",t)},info(t){return this.open("info",t)},error(t){return this.open("error",t)},warning(t){return this.open("warning",t)},success(t){return this.open("success",t)}}}function Ae(o){var s;const i=e.inject(A),n=e.getCurrentInstance(),t=z(n,"ModalContainer"),c=(s=t==null?void 0:t.props)==null?void 0:s.id;i&&c&&i.addEventListener(c,"submit",o)}exports.ModalContainer=G;exports.ModalFooter=Me;exports.ModalHeader=Ve;exports.ModalKey=A;exports.ModalProvider=xe;exports.onSubmit=Ae;exports.useModal=K;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue");const L=Symbol("__MODAL__");function W(o){return e.getCurrentScope()?(e.onScopeDispose(o),!0):!1}function k(o){return typeof o=="function"?o():e.unref(o)}const j=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const J=Object.prototype.toString,Q=o=>J.call(o)==="[object Object]",ee=()=>{};function te(o,l={}){if(!e.isRef(o))return e.toRefs(o);const n=Array.isArray(o.value)?Array.from({length:o.value.length}):{};for(const t in o.value)n[t]=e.customRef(()=>({get(){return o.value[t]},set(a){var i;if((i=k(l.replaceRef))!=null?i:!0)if(Array.isArray(o.value)){const m=[...o.value];m[t]=a,o.value=m}else{const m={...o.value,[t]:a};Object.setPrototypeOf(m,Object.getPrototypeOf(o.value)),o.value=m}else o.value[t]=a}}));return n}function oe(o,l=!0){e.getCurrentInstance()?e.onMounted(o):l?o():e.nextTick(o)}function $(o){var l;const n=k(o);return(l=n==null?void 0:n.$el)!=null?l:n}const O=j?window:void 0;function I(...o){let l,n,t,a;if(typeof o[0]=="string"||Array.isArray(o[0])?([n,t,a]=o,l=O):[l,n,t,a]=o,!l)return ee;Array.isArray(n)||(n=[n]),Array.isArray(t)||(t=[t]);const i=[],c=()=>{i.forEach(v=>v()),i.length=0},m=(v,d,g,s)=>(v.addEventListener(d,g,s),()=>v.removeEventListener(d,g,s)),_=e.watch(()=>[$(l),k(a)],([v,d])=>{if(c(),!v)return;const g=Q(d)?{...d}:d;i.push(...n.flatMap(s=>t.map(f=>m(v,s,f,g))))},{immediate:!0,flush:"post"}),w=()=>{_(),c()};return W(w),w}function ne(){const o=e.ref(!1);return e.getCurrentInstance()&&e.onMounted(()=>{o.value=!0}),o}function re(o){const l=ne();return e.computed(()=>(l.value,!!o()))}function le(o,l={}){var n,t;const{pointerTypes:a,preventDefault:i,stopPropagation:c,exact:m,onMove:_,onEnd:w,onStart:v,initialValue:d,axis:g="both",draggingElement:s=O,containerElement:f,handle:u=o}=l,y=e.ref((n=k(d))!=null?n:{x:0,y:0}),p=e.ref(),M=h=>a?a.includes(h.pointerType):!0,N=h=>{k(i)&&h.preventDefault(),k(c)&&h.stopPropagation()},B=h=>{var x;if(!M(h)||k(m)&&h.target!==k(o))return;const b=k(f),R=(x=b==null?void 0:b.getBoundingClientRect)==null?void 0:x.call(b),E=k(o).getBoundingClientRect(),S={x:h.clientX-(b?E.left-R.left:E.left),y:h.clientY-(b?E.top-R.top:E.top)};(v==null?void 0:v(S,h))!==!1&&(p.value=S,N(h))},z=h=>{var x;if(!M(h)||!p.value)return;const b=k(f),R=(x=b==null?void 0:b.getBoundingClientRect)==null?void 0:x.call(b),E=k(o).getBoundingClientRect();let{x:S,y:V}=y.value;(g==="x"||g==="both")&&(S=h.clientX-p.value.x,b&&(S=Math.min(Math.max(0,S),R.width-E.width))),(g==="y"||g==="both")&&(V=h.clientY-p.value.y,b&&(V=Math.min(Math.max(0,V),R.height-E.height))),y.value={x:S,y:V},_==null||_(y.value,h),N(h)},H=h=>{M(h)&&p.value&&(p.value=void 0,w==null||w(y.value,h),N(h))};if(j){const h={capture:(t=l.capture)!=null?t:!0};I(u,"pointerdown",B,h),I(s,"pointermove",z,h),I(s,"pointerup",H,h)}return{...te(y),position:y,isDragging:e.computed(()=>!!p.value),style:e.computed(()=>`left:${y.value.x}px;top:${y.value.y}px;`)}}function se(o,l,n={}){const{window:t=O,...a}=n;let i;const c=re(()=>t&&"ResizeObserver"in t),m=()=>{i&&(i.disconnect(),i=void 0)},_=e.computed(()=>Array.isArray(o)?o.map(d=>$(d)):[$(o)]),w=e.watch(_,d=>{if(m(),c.value&&t){i=new ResizeObserver(l);for(const g of d)g&&i.observe(g,a)}},{immediate:!0,flush:"post",deep:!0}),v=()=>{m(),w()};return W(v),{isSupported:c,stop:v}}function A(o,l={width:0,height:0},n={}){const{window:t=O,box:a="content-box"}=n,i=e.computed(()=>{var d,g;return(g=(d=$(o))==null?void 0:d.namespaceURI)==null?void 0:g.includes("svg")}),c=e.ref(l.width),m=e.ref(l.height),{stop:_}=se(o,([d])=>{const g=a==="border-box"?d.borderBoxSize:a==="content-box"?d.contentBoxSize:d.devicePixelContentBoxSize;if(t&&i.value){const s=$(o);if(s){const f=t.getComputedStyle(s);c.value=Number.parseFloat(f.width),m.value=Number.parseFloat(f.height)}}else if(g){const s=Array.isArray(g)?g:[g];c.value=s.reduce((f,{inlineSize:u})=>f+u,0),m.value=s.reduce((f,{blockSize:u})=>f+u,0)}else c.value=d.contentRect.width,m.value=d.contentRect.height},n);oe(()=>{const d=$(o);d&&(c.value="offsetWidth"in d?d.offsetWidth:l.width,m.value="offsetHeight"in d?d.offsetHeight:l.height)});const w=e.watch(()=>$(o),d=>{c.value=d?l.width:0,m.value=d?l.height:0});function v(){_(),w()}return{width:c,height:m,stop:v}}const ie=o=>(e.pushScopeId("data-v-8dfa7cd4"),o=o(),e.popScopeId(),o),ae={class:"title text-16px font-bold"},ce={class:"action"},de=["form"],ue={key:2,class:"modal-loading"},fe=ie(()=>e.createElementVNode("div",{class:"lds-ring"},[e.createElementVNode("div"),e.createElementVNode("div"),e.createElementVNode("div"),e.createElementVNode("div")],-1)),pe=[fe],me={name:"ModalContainer",inheritAttrs:!0},he=e.defineComponent({...me,props:{id:{},form:{},component:{},componentProps:{},width:{},maxWidth:{},maxHeight:{default:90},sizes:{},size:{default:"middle"},fullscreen:{type:Boolean},title:{},header:{type:Boolean,default:!0},footer:{type:Boolean,default:!1},closeable:{type:Boolean,default:!0},esc:{type:Boolean,default:!1},maskClosable:{type:Boolean,default:!1},draggable:{type:Boolean,default:!1},mode:{default:"dialog"},type:{},offset:{},backgroundColor:{},bodyStyle:{},submitText:{default:"确定"},cancelText:{default:"取消"},zIndex:{default:1e3}},emits:["submit"],setup(o,{expose:l,emit:n}){e.useCssVars(r=>({"359e2d1e":r.zIndex,"635715bb":B.value}));const t=o,a=n,i=e.inject(L),c=e.ref(!1);let m=0,_=0;const w=e.shallowRef(),v=e.shallowRef(),d=e.shallowRef(),g=e.shallowRef(),s=e.shallowRef(),f=e.shallowRef(),{height:u}=A(w),{height:y}=A(d,void 0,{box:"border-box"}),{height:p}=A(g,void 0,{box:"border-box"}),{height:M}=A(s),{height:N}=A(f),B=e.computed(()=>t.zIndex+100),{x:z,y:H}=le(d,{initialValue:{x:0,y:0}});function h(){i==null||i.close(t.id)}function x(r){return typeof r=="number"?`${r}px`:r}const b=e.computed(()=>{const r={};return t.mode==="dialog"&&(r.justifyContent="center"),t.mode==="drawer"&&(r.justifyContent="flex-end"),r}),R=e.computed(()=>{const r={};return t.size&&(r.width=x(t.sizes[t.size])),t.width&&(r.width=x(t.width)),t.maxWidth&&(r.maxWidth=x(t.maxWidth)),t.fullscreen&&(r.maxWidth="unset",r.width="100%",r.position="fixed",r.top=0,r.left=0,r.bottom=0,r.right=0,r.borderRadius=0),t.draggable&&!t.fullscreen&&t.mode==="dialog"&&(r.transform=`translate3d(${z.value-m}px, ${H.value-_}px, 0px)`),t.mode==="drawer"&&(r.borderRadius=0,r.height="100%"),t.offset&&t.mode==="dialog"&&(r.marginLeft=`${t.offset.x||0}px`,r.marginTop=`${t.offset.y||0}px`),t.backgroundColor&&(r.backgroundColor=t.backgroundColor),r}),E=e.computed(()=>{const r={};return t.draggable&&!t.fullscreen&&t.mode==="dialog"&&(r.cursor="move"),r}),S=e.computed(()=>{const r={},C=M.value+N.value+y.value+p.value,F=Math.floor(u.value*(Number(x(t.maxHeight).replace("%",""))/100));return t.maxHeight&&(r.maxHeight=`${F-C}px`),t.mode==="drawer"&&(r.maxHeight="unset",r.height=`${u.value-C}px`),t.fullscreen&&(r.maxHeight="unset",r.height=`calc(100% - ${C}px)`),t.type!=="component"&&(r.padding="0"),t.bodyStyle&&Object.assign(r,t.bodyStyle),r});function V(){const r=v.value;if(t.form&&r){const C=r.querySelector(`form[name="${t.form}"]`);C&&C.dispatchEvent(new Event("submit"))}a("submit")}function X(){i==null||i.close(t.id)}function Y(){window&&window.addEventListener("resize",()=>{e.triggerRef(w),e.triggerRef(v),v.value&&(m=v.value.offsetLeft,_=v.value.offsetTop)})}function q(){if(t.closeable&&t.esc){const r=({key:C})=>{C==="Escape"&&(i==null||i.close(t.id),window.removeEventListener("keydown",r))};window.addEventListener("keydown",r)}}function U(){m=v.value.offsetLeft,_=v.value.offsetTop}e.onMounted(()=>{q(),Y()}),e.onUnmounted(()=>{});function Z(){return c.value=!0,()=>D()}function D(){c.value=!1}return l({showLoading:Z,hideLoading:D}),(r,C)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"wrapperRef",ref:w,class:"modal-wrapper",style:e.normalizeStyle(b.value),onClick:C[0]||(C[0]=e.withModifiers(F=>r.maskClosable&&h(),["self"]))},[e.createElementVNode("div",{ref_key:"contentRef",ref:v,class:e.normalizeClass(["modal-content",{[`${r.mode}-mode`]:!0}]),style:e.normalizeStyle(R.value)},[r.header?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"headerRef",ref:d,class:"modal-header",style:e.normalizeStyle(E.value),onMousedown:U},[e.createElementVNode("div",ae,e.toDisplayString(r.title),1),e.createElementVNode("div",ce,[r.closeable?(e.openBlock(),e.createElementBlock("div",{key:0,class:"i-icon-park-outline:close block cursor-pointer",onClick:h})):e.createCommentVNode("",!0)])],36)):e.createCommentVNode("",!0),e.createElementVNode("div",{id:"modal-header-slot",ref_key:"headerSlotRef",ref:s},null,512),e.createElementVNode("div",{class:"modal-body",style:e.normalizeStyle(S.value)},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(r.component),e.normalizeProps(e.guardReactiveProps(r.componentProps)),null,16))],4),e.createElementVNode("div",{id:"modal-footer-slot",ref_key:"footerSlotRef",ref:f},null,512),r.footer?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"footerRef",ref:g,class:"modal-footer space-x-2"},[e.createElementVNode("button",{class:"cancel-button",type:"button",onClick:X},e.toDisplayString(r.cancelText),1),e.createElementVNode("button",{class:"submit-button",form:r.form,type:"submit",onClick:V},e.toDisplayString(r.submitText),9,de)],512)):e.createCommentVNode("",!0),c.value?(e.openBlock(),e.createElementBlock("div",ue,pe)):e.createCommentVNode("",!0)],6)],4))}});const P=(o,l)=>{const n=o.__vccOpts||o;for(const[t,a]of l)n[t]=a;return n},G=P(he,[["__scopeId","data-v-8dfa7cd4"]]),ve={class:"modal-dialog"},ge={class:"dialog-body"},ye={class:"dialog-title"},_e={class:"dialog-content"},we=e.defineComponent({__name:"modal-dialog",props:{type:{},title:{},content:{},okText:{default:"确定"},cancelText:{default:"取消"},onOk:{},onCancel:{},footer:{}},setup(o){const l=o,n=K(),t=e.computed(()=>l.title?l.title:{confirm:"提示",info:"提示",warning:"警告",error:"错误",success:"成功"}[l.type]);async function a(){l.onOk&&await l.onOk(),n.close()}async function i(){l.onCancel&&await l.onCancel(),n.close()}return(c,m)=>(e.openBlock(),e.createElementBlock("section",ve,[e.createElementVNode("div",ge,[e.createElementVNode("div",ye,e.toDisplayString(t.value),1),e.createElementVNode("div",_e,e.toDisplayString(c.content),1)]),e.createElementVNode("div",{class:"dialog-footer space-x-2",style:e.normalizeStyle(c.type==="confirm"?{"justify-content":"end"}:{"border-top":"none"})},[c.footer?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(c.footer),{key:0})):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("button",{class:"submit-button",type:"submit",onClick:a},e.toDisplayString(c.okText),1),c.type==="confirm"?(e.openBlock(),e.createElementBlock("button",{key:0,class:"cancel-button",type:"button",onClick:i},e.toDisplayString(c.cancelText),1)):e.createCommentVNode("",!0)],64))],4)]))}});const be=P(we,[["__scopeId","data-v-8326e5a5"]]),ke={key:0,class:"modal-teleport"},Ce={name:"ModalProvider",inheritAttrs:!0},xe=e.defineComponent({...Ce,props:{appendToBody:{type:[Boolean,String],default:!1},sizes:{default:()=>({small:520,middle:860,large:1190})},maxWidth:{default:"90%"},maxHeight:{default:"90%"},offset:{default:()=>({x:0,y:0})}},setup(o,{expose:l}){const n=e.shallowRef([]),t=e.ref(!1),a=e.getCurrentInstance();let i=1100;function c(s,f={},u={}){const y=e.defineAsyncComponent(()=>Promise.resolve(typeof s=="string"?be:s));typeof s=="string"&&(f.type=s,u.size="small",u.fullscreen=!1,u.mode="dialog",u.footer=!1,u.header=!1);const p=Math.random().toString(32).slice(2),M=Object.assign({zIndex:i++},f),N=new Promise((B,z)=>{n.value.push({id:p,component:y,props:f||{},options:{...M,type:typeof s=="string"?s:"component"},resolve:B,reject:z,listeners:[]}),e.triggerRef(n)}).catch(B=>B==="CANCEL"?new Promise(()=>{}):Promise.reject(B));return Object.assign(N,{close:()=>m(p)})}function m(s,f){const u=n.value.findIndex(p=>p.id===s);if(u<0)return;const y=n.value[u];f===void 0?y==null||y.reject("CANCEL"):y==null||y.resolve(f),n.value.splice(u,1),e.triggerRef(n)}function _(){!n.value||n.value.length===0||(n.value.forEach(s=>{s==null||s.reject("CANCEL")}),n.value=[],e.triggerRef(n))}function w(s,f){const u=n.value.find(p=>p.id===s);if(!u)return;const y=u.listeners.find(p=>p.event===f);y&&y.callback({open:c,close:p=>m(u.id,p),closeAll:_,showLoading:()=>v(u.id),hideLoading:()=>d(u.id),confirm:p=>c("confirm",p),success:p=>c("success",p),error:p=>c("error",p),warning:p=>c("warning",p),info:p=>c("info",p)})}function v(s){if(!a)return;const[f]=a.refs[`modal-container_${s}`];if(f)return f.showLoading()}function d(s){if(!a)return;const[f]=a.refs[`modal-container_${s}`];if(f)return f.hideLoading()}function g(s,f,u){const y=n.value.find(p=>p.id===s);y&&y.listeners.push({event:f,callback:u})}return e.provide(L,{open:c,close:m,closeAll:_,addEventListener:g}),l({elements:n,open:c,close:m,closeAll:_}),e.onMounted(()=>{t.value=!0}),(s,f)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.renderSlot(s.$slots,"default",{},void 0,!0),t.value?(e.openBlock(),e.createElementBlock("div",ke,[(e.openBlock(),e.createBlock(e.Teleport,{disabled:!s.appendToBody,to:typeof s.appendToBody=="string"?s.appendToBody:"body"},[e.createVNode(e.TransitionGroup,{name:"modal-fade"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,u=>(e.openBlock(),e.createBlock(G,e.mergeProps({id:u.id,key:u.id,ref_for:!0,ref:`modal-container_${u.id}`,component:u.component,"component-props":u.props,"max-height":s.maxHeight,"max-width":s.maxWidth,offset:s.offset,sizes:s.sizes},u.options,{onSubmit:()=>w(u.id,"submit")}),null,16,["id","component","component-props","max-height","max-width","offset","sizes","onSubmit"]))),128))]),_:1})],8,["disabled","to"]))])):e.createCommentVNode("",!0)],64))}});const Ee=P(xe,[["__scopeId","data-v-560682b4"]]);const Se={},Be={class:"modal-footer"};function Me(o,l){return e.openBlock(),e.createBlock(e.Teleport,{to:"#modal-footer-slot"},[e.createElementVNode("div",Be,[e.renderSlot(o.$slots,"default",{},void 0,!0)])])}const Ne=P(Se,[["render",Me],["__scopeId","data-v-2080a86e"]]);const Re={},$e={class:"modal-header"};function Ve(o,l){return e.openBlock(),e.createBlock(e.Teleport,{to:"#modal-header-slot"},[e.createElementVNode("div",$e,[e.renderSlot(o.$slots,"default",{},void 0,!0)])])}const ze=P(Re,[["render",Ve],["__scopeId","data-v-d0247172"]]);function T(o,l){var t,a;let n=o==null?void 0:o.parent;for(;n&&((t=n==null?void 0:n.type)==null?void 0:t.name)!==l;)n=n.parent;return((a=n==null?void 0:n.type)==null?void 0:a.name)===l?n:null}function K(){const o=e.inject(L),l=e.getCurrentInstance();function n(t,a,i){if(!o)throw new Error("Not Found Modal Provider Component");return o.open(t,a,i)}return{open:n,close(t){var c;if(!o)throw new Error("Not Found Modal Provider Component");const a=T(l,"ModalContainer"),i=(c=a==null?void 0:a.props)==null?void 0:c.id;if(!i)throw new Error("Not Found Current Modal Container");o.close(i,t)},closeAll(){if(!o)throw new Error("Not Found Modal Provider Component");o.closeAll()},showLoading(){var i;if(!o)throw new Error("Not Found Modal Provider Component");const t=T(l,"ModalContainer");if(!((i=t==null?void 0:t.props)==null?void 0:i.id))throw new Error("Not Found Current Modal Container");t!=null&&t.exposed&&(t==null||t.exposed.showLoading())},hideLoading(){var i;if(!o)throw new Error("Not Found Modal Provider Component");const t=T(l,"ModalContainer");if(!((i=t==null?void 0:t.props)==null?void 0:i.id))throw new Error("Not Found Current Modal Container");t!=null&&t.exposed&&(t==null||t.exposed.hideLoading())},confirm(t){return this.open("confirm",t)},info(t){return this.open("info",t)},error(t){return this.open("error",t)},warning(t){return this.open("warning",t)},success(t){return this.open("success",t)}}}function Ae(o){var i;const l=e.inject(L),n=e.getCurrentInstance(),t=T(n,"ModalContainer"),a=(i=t==null?void 0:t.props)==null?void 0:i.id;l&&a&&l.addEventListener(a,"submit",o)}exports.ModalContainer=G;exports.ModalFooter=Ne;exports.ModalHeader=ze;exports.ModalKey=L;exports.ModalProvider=Ee;exports.onSubmit=Ae;exports.useModal=K;
@@ -28,6 +28,7 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
28
28
  bodyStyle?: CSSProperties | undefined;
29
29
  submitText?: string | undefined;
30
30
  cancelText?: string | undefined;
31
+ zIndex?: number | undefined;
31
32
  }>, {
32
33
  header: boolean;
33
34
  closeable: boolean;
@@ -41,6 +42,7 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
41
42
  submitText: string;
42
43
  cancelText: string;
43
44
  maxHeight: number;
45
+ zIndex: number;
44
46
  }>, {
45
47
  showLoading: () => () => void;
46
48
  hideLoading: () => void;
@@ -74,6 +76,7 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
74
76
  bodyStyle?: CSSProperties | undefined;
75
77
  submitText?: string | undefined;
76
78
  cancelText?: string | undefined;
79
+ zIndex?: number | undefined;
77
80
  }>, {
78
81
  header: boolean;
79
82
  closeable: boolean;
@@ -87,6 +90,7 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
87
90
  submitText: string;
88
91
  cancelText: string;
89
92
  maxHeight: number;
93
+ zIndex: number;
90
94
  }>>> & {
91
95
  onSubmit?: ((...args: any[]) => any) | undefined;
92
96
  }, {
@@ -101,6 +105,7 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
101
105
  mode: 'dialog' | 'drawer';
102
106
  submitText: string;
103
107
  cancelText: string;
108
+ zIndex: number;
104
109
  }, {}>;
105
110
  export default _default;
106
111
  type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
package/dist/es/index.mjs CHANGED
@@ -1,215 +1,215 @@
1
- import { unref as ve, isRef as he, toRefs as me, customRef as ge, getCurrentInstance as V, onMounted as Y, nextTick as ye, getCurrentScope as _e, onScopeDispose as we, ref as H, computed as E, watch as ee, defineComponent as te, inject as oe, shallowRef as P, onUnmounted as be, openBlock as y, createElementBlock as M, normalizeStyle as D, withModifiers as xe, createElementVNode as g, normalizeClass as Ce, toDisplayString as O, createCommentVNode as N, createBlock as F, resolveDynamicComponent as le, normalizeProps as ke, guardReactiveProps as Me, triggerRef as I, pushScopeId as Se, popScopeId as Ee, Fragment as Z, provide as $e, renderSlot as ne, Teleport as re, createVNode as Ae, TransitionGroup as Le, withCtx as Re, renderList as Be, mergeProps as Pe, defineAsyncComponent as Oe } from "vue";
2
- const K = Symbol("__MODAL__");
1
+ import { unref as he, isRef as me, toRefs as ge, customRef as ye, getCurrentInstance as G, onMounted as K, nextTick as _e, getCurrentScope as be, onScopeDispose as we, ref as H, computed as M, watch as ee, defineComponent as te, useCssVars as xe, inject as oe, shallowRef as P, onUnmounted as Ce, openBlock as _, createElementBlock as S, normalizeStyle as V, withModifiers as ke, createElementVNode as y, normalizeClass as Me, toDisplayString as O, createCommentVNode as N, createBlock as F, resolveDynamicComponent as le, normalizeProps as Se, guardReactiveProps as Ee, triggerRef as j, pushScopeId as $e, popScopeId as Ae, Fragment as Q, provide as Le, renderSlot as ne, Teleport as se, createVNode as Re, TransitionGroup as ze, withCtx as Be, renderList as Pe, mergeProps as Oe, defineAsyncComponent as Te } from "vue";
2
+ const U = Symbol("__MODAL__");
3
3
  function ae(t) {
4
- return _e() ? (we(t), !0) : !1;
4
+ return be() ? (we(t), !0) : !1;
5
5
  }
6
- function x(t) {
7
- return typeof t == "function" ? t() : ve(t);
6
+ function C(t) {
7
+ return typeof t == "function" ? t() : he(t);
8
8
  }
9
9
  const de = typeof window < "u" && typeof document < "u";
10
10
  typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
11
- const Te = Object.prototype.toString, He = (t) => Te.call(t) === "[object Object]", ze = () => {
11
+ const He = Object.prototype.toString, Ie = (t) => He.call(t) === "[object Object]", Ne = () => {
12
12
  };
13
- function Ne(t, s = {}) {
14
- if (!he(t))
15
- return me(t);
13
+ function Fe(t, s = {}) {
14
+ if (!me(t))
15
+ return ge(t);
16
16
  const o = Array.isArray(t.value) ? Array.from({ length: t.value.length }) : {};
17
17
  for (const e in t.value)
18
- o[e] = ge(() => ({
18
+ o[e] = ye(() => ({
19
19
  get() {
20
20
  return t.value[e];
21
21
  },
22
- set(a) {
22
+ set(l) {
23
23
  var i;
24
- if ((i = x(s.replaceRef)) != null ? i : !0)
24
+ if ((i = C(s.replaceRef)) != null ? i : !0)
25
25
  if (Array.isArray(t.value)) {
26
- const v = [...t.value];
27
- v[e] = a, t.value = v;
26
+ const p = [...t.value];
27
+ p[e] = l, t.value = p;
28
28
  } else {
29
- const v = { ...t.value, [e]: a };
30
- Object.setPrototypeOf(v, Object.getPrototypeOf(t.value)), t.value = v;
29
+ const p = { ...t.value, [e]: l };
30
+ Object.setPrototypeOf(p, Object.getPrototypeOf(t.value)), t.value = p;
31
31
  }
32
32
  else
33
- t.value[e] = a;
33
+ t.value[e] = l;
34
34
  }
35
35
  }));
36
36
  return o;
37
37
  }
38
- function Fe(t, s = !0) {
39
- V() ? Y(t) : s ? t() : ye(t);
38
+ function We(t, s = !0) {
39
+ G() ? K(t) : s ? t() : _e(t);
40
40
  }
41
41
  function T(t) {
42
42
  var s;
43
- const o = x(t);
43
+ const o = C(t);
44
44
  return (s = o == null ? void 0 : o.$el) != null ? s : o;
45
45
  }
46
- const U = de ? window : void 0;
47
- function Q(...t) {
48
- let s, o, e, a;
49
- if (typeof t[0] == "string" || Array.isArray(t[0]) ? ([o, e, a] = t, s = U) : [s, o, e, a] = t, !s)
50
- return ze;
46
+ const q = de ? window : void 0;
47
+ function J(...t) {
48
+ let s, o, e, l;
49
+ if (typeof t[0] == "string" || Array.isArray(t[0]) ? ([o, e, l] = t, s = q) : [s, o, e, l] = t, !s)
50
+ return Ne;
51
51
  Array.isArray(o) || (o = [o]), Array.isArray(e) || (e = [e]);
52
- const i = [], c = () => {
52
+ const i = [], a = () => {
53
53
  i.forEach((h) => h()), i.length = 0;
54
- }, v = (h, d, r, u) => (h.addEventListener(d, r, u), () => h.removeEventListener(d, r, u)), w = ee(
55
- () => [T(s), x(a)],
54
+ }, p = (h, d, m, r) => (h.addEventListener(d, m, r), () => h.removeEventListener(d, m, r)), b = ee(
55
+ () => [T(s), C(l)],
56
56
  ([h, d]) => {
57
- if (c(), !h)
57
+ if (a(), !h)
58
58
  return;
59
- const r = He(d) ? { ...d } : d;
59
+ const m = Ie(d) ? { ...d } : d;
60
60
  i.push(
61
- ...o.flatMap((u) => e.map((l) => v(h, u, l, r)))
61
+ ...o.flatMap((r) => e.map((u) => p(h, r, u, m)))
62
62
  );
63
63
  },
64
64
  { immediate: !0, flush: "post" }
65
- ), _ = () => {
66
- w(), c();
65
+ ), w = () => {
66
+ b(), a();
67
67
  };
68
- return ae(_), _;
68
+ return ae(w), w;
69
69
  }
70
- function We() {
70
+ function De() {
71
71
  const t = H(!1);
72
- return V() && Y(() => {
72
+ return G() && K(() => {
73
73
  t.value = !0;
74
74
  }), t;
75
75
  }
76
- function De(t) {
77
- const s = We();
78
- return E(() => (s.value, !!t()));
76
+ function Ve(t) {
77
+ const s = De();
78
+ return M(() => (s.value, !!t()));
79
79
  }
80
- function Ie(t, s = {}) {
80
+ function je(t, s = {}) {
81
81
  var o, e;
82
82
  const {
83
- pointerTypes: a,
83
+ pointerTypes: l,
84
84
  preventDefault: i,
85
- stopPropagation: c,
86
- exact: v,
87
- onMove: w,
88
- onEnd: _,
85
+ stopPropagation: a,
86
+ exact: p,
87
+ onMove: b,
88
+ onEnd: w,
89
89
  onStart: h,
90
90
  initialValue: d,
91
- axis: r = "both",
92
- draggingElement: u = U,
93
- containerElement: l,
94
- handle: m = t
95
- } = s, f = H(
96
- (o = x(d)) != null ? o : { x: 0, y: 0 }
97
- ), C = H(), S = (p) => a ? a.includes(p.pointerType) : !0, L = (p) => {
98
- x(i) && p.preventDefault(), x(c) && p.stopPropagation();
99
- }, q = (p) => {
100
- var R;
101
- if (!S(p) || x(v) && p.target !== x(t))
91
+ axis: m = "both",
92
+ draggingElement: r = q,
93
+ containerElement: u,
94
+ handle: c = t
95
+ } = s, g = H(
96
+ (o = C(d)) != null ? o : { x: 0, y: 0 }
97
+ ), f = H(), R = (v) => l ? l.includes(v.pointerType) : !0, z = (v) => {
98
+ C(i) && v.preventDefault(), C(a) && v.stopPropagation();
99
+ }, L = (v) => {
100
+ var E;
101
+ if (!R(v) || C(p) && v.target !== C(t))
102
102
  return;
103
- const b = x(l), B = (R = b == null ? void 0 : b.getBoundingClientRect) == null ? void 0 : R.call(b), $ = x(t).getBoundingClientRect(), A = {
104
- x: p.clientX - (b ? $.left - B.left : $.left),
105
- y: p.clientY - (b ? $.top - B.top : $.top)
103
+ const x = C(u), B = (E = x == null ? void 0 : x.getBoundingClientRect) == null ? void 0 : E.call(x), $ = C(t).getBoundingClientRect(), A = {
104
+ x: v.clientX - (x ? $.left - B.left : $.left),
105
+ y: v.clientY - (x ? $.top - B.top : $.top)
106
106
  };
107
- (h == null ? void 0 : h(A, p)) !== !1 && (C.value = A, L(p));
108
- }, J = (p) => {
109
- var R;
110
- if (!S(p) || !C.value)
107
+ (h == null ? void 0 : h(A, v)) !== !1 && (f.value = A, z(v));
108
+ }, W = (v) => {
109
+ var E;
110
+ if (!R(v) || !f.value)
111
111
  return;
112
- const b = x(l), B = (R = b == null ? void 0 : b.getBoundingClientRect) == null ? void 0 : R.call(b), $ = x(t).getBoundingClientRect();
113
- let { x: A, y: z } = f.value;
114
- (r === "x" || r === "both") && (A = p.clientX - C.value.x, b && (A = Math.min(Math.max(0, A), B.width - $.width))), (r === "y" || r === "both") && (z = p.clientY - C.value.y, b && (z = Math.min(Math.max(0, z), B.height - $.height))), f.value = {
112
+ const x = C(u), B = (E = x == null ? void 0 : x.getBoundingClientRect) == null ? void 0 : E.call(x), $ = C(t).getBoundingClientRect();
113
+ let { x: A, y: I } = g.value;
114
+ (m === "x" || m === "both") && (A = v.clientX - f.value.x, x && (A = Math.min(Math.max(0, A), B.width - $.width))), (m === "y" || m === "both") && (I = v.clientY - f.value.y, x && (I = Math.min(Math.max(0, I), B.height - $.height))), g.value = {
115
115
  x: A,
116
- y: z
117
- }, w == null || w(f.value, p), L(p);
118
- }, G = (p) => {
119
- S(p) && C.value && (C.value = void 0, _ == null || _(f.value, p), L(p));
116
+ y: I
117
+ }, b == null || b(g.value, v), z(v);
118
+ }, Z = (v) => {
119
+ R(v) && f.value && (f.value = void 0, w == null || w(g.value, v), z(v));
120
120
  };
121
121
  if (de) {
122
- const p = { capture: (e = s.capture) != null ? e : !0 };
123
- Q(m, "pointerdown", q, p), Q(u, "pointermove", J, p), Q(u, "pointerup", G, p);
122
+ const v = { capture: (e = s.capture) != null ? e : !0 };
123
+ J(c, "pointerdown", L, v), J(r, "pointermove", W, v), J(r, "pointerup", Z, v);
124
124
  }
125
125
  return {
126
- ...Ne(f),
127
- position: f,
128
- isDragging: E(() => !!C.value),
129
- style: E(
130
- () => `left:${f.value.x}px;top:${f.value.y}px;`
126
+ ...Fe(g),
127
+ position: g,
128
+ isDragging: M(() => !!f.value),
129
+ style: M(
130
+ () => `left:${g.value.x}px;top:${g.value.y}px;`
131
131
  )
132
132
  };
133
133
  }
134
- function Ve(t, s, o = {}) {
135
- const { window: e = U, ...a } = o;
134
+ function Ge(t, s, o = {}) {
135
+ const { window: e = q, ...l } = o;
136
136
  let i;
137
- const c = De(() => e && "ResizeObserver" in e), v = () => {
137
+ const a = Ve(() => e && "ResizeObserver" in e), p = () => {
138
138
  i && (i.disconnect(), i = void 0);
139
- }, w = E(() => Array.isArray(t) ? t.map((d) => T(d)) : [T(t)]), _ = ee(
140
- w,
139
+ }, b = M(() => Array.isArray(t) ? t.map((d) => T(d)) : [T(t)]), w = ee(
140
+ b,
141
141
  (d) => {
142
- if (v(), c.value && e) {
142
+ if (p(), a.value && e) {
143
143
  i = new ResizeObserver(s);
144
- for (const r of d)
145
- r && i.observe(r, a);
144
+ for (const m of d)
145
+ m && i.observe(m, l);
146
146
  }
147
147
  },
148
148
  { immediate: !0, flush: "post", deep: !0 }
149
149
  ), h = () => {
150
- v(), _();
150
+ p(), w();
151
151
  };
152
152
  return ae(h), {
153
- isSupported: c,
153
+ isSupported: a,
154
154
  stop: h
155
155
  };
156
156
  }
157
- function W(t, s = { width: 0, height: 0 }, o = {}) {
158
- const { window: e = U, box: a = "content-box" } = o, i = E(() => {
159
- var d, r;
160
- return (r = (d = T(t)) == null ? void 0 : d.namespaceURI) == null ? void 0 : r.includes("svg");
161
- }), c = H(s.width), v = H(s.height), { stop: w } = Ve(
157
+ function D(t, s = { width: 0, height: 0 }, o = {}) {
158
+ const { window: e = q, box: l = "content-box" } = o, i = M(() => {
159
+ var d, m;
160
+ return (m = (d = T(t)) == null ? void 0 : d.namespaceURI) == null ? void 0 : m.includes("svg");
161
+ }), a = H(s.width), p = H(s.height), { stop: b } = Ge(
162
162
  t,
163
163
  ([d]) => {
164
- const r = a === "border-box" ? d.borderBoxSize : a === "content-box" ? d.contentBoxSize : d.devicePixelContentBoxSize;
164
+ const m = l === "border-box" ? d.borderBoxSize : l === "content-box" ? d.contentBoxSize : d.devicePixelContentBoxSize;
165
165
  if (e && i.value) {
166
- const u = T(t);
167
- if (u) {
168
- const l = e.getComputedStyle(u);
169
- c.value = Number.parseFloat(l.width), v.value = Number.parseFloat(l.height);
166
+ const r = T(t);
167
+ if (r) {
168
+ const u = e.getComputedStyle(r);
169
+ a.value = Number.parseFloat(u.width), p.value = Number.parseFloat(u.height);
170
170
  }
171
- } else if (r) {
172
- const u = Array.isArray(r) ? r : [r];
173
- c.value = u.reduce((l, { inlineSize: m }) => l + m, 0), v.value = u.reduce((l, { blockSize: m }) => l + m, 0);
171
+ } else if (m) {
172
+ const r = Array.isArray(m) ? m : [m];
173
+ a.value = r.reduce((u, { inlineSize: c }) => u + c, 0), p.value = r.reduce((u, { blockSize: c }) => u + c, 0);
174
174
  } else
175
- c.value = d.contentRect.width, v.value = d.contentRect.height;
175
+ a.value = d.contentRect.width, p.value = d.contentRect.height;
176
176
  },
177
177
  o
178
178
  );
179
- Fe(() => {
179
+ We(() => {
180
180
  const d = T(t);
181
- d && (c.value = "offsetWidth" in d ? d.offsetWidth : s.width, v.value = "offsetHeight" in d ? d.offsetHeight : s.height);
181
+ d && (a.value = "offsetWidth" in d ? d.offsetWidth : s.width, p.value = "offsetHeight" in d ? d.offsetHeight : s.height);
182
182
  });
183
- const _ = ee(
183
+ const w = ee(
184
184
  () => T(t),
185
185
  (d) => {
186
- c.value = d ? s.width : 0, v.value = d ? s.height : 0;
186
+ a.value = d ? s.width : 0, p.value = d ? s.height : 0;
187
187
  }
188
188
  );
189
189
  function h() {
190
- w(), _();
190
+ b(), w();
191
191
  }
192
192
  return {
193
- width: c,
194
- height: v,
193
+ width: a,
194
+ height: p,
195
195
  stop: h
196
196
  };
197
197
  }
198
- const je = (t) => (Se("data-v-d6dd5541"), t = t(), Ee(), t), Ge = { class: "title text-16px font-bold" }, Xe = { class: "action" }, Ye = ["form"], Ke = {
198
+ const Xe = (t) => ($e("data-v-8dfa7cd4"), t = t(), Ae(), t), Ye = { class: "title text-16px font-bold" }, Ke = { class: "action" }, Ue = ["form"], qe = {
199
199
  key: 2,
200
200
  class: "modal-loading"
201
- }, Ue = /* @__PURE__ */ je(() => /* @__PURE__ */ g("div", { class: "lds-ring" }, [
202
- /* @__PURE__ */ g("div"),
203
- /* @__PURE__ */ g("div"),
204
- /* @__PURE__ */ g("div"),
205
- /* @__PURE__ */ g("div")
206
- ], -1)), qe = [
207
- Ue
208
- ], Je = {
201
+ }, Ze = /* @__PURE__ */ Xe(() => /* @__PURE__ */ y("div", { class: "lds-ring" }, [
202
+ /* @__PURE__ */ y("div"),
203
+ /* @__PURE__ */ y("div"),
204
+ /* @__PURE__ */ y("div"),
205
+ /* @__PURE__ */ y("div")
206
+ ], -1)), Je = [
207
+ Ze
208
+ ], Qe = {
209
209
  name: "ModalContainer",
210
210
  inheritAttrs: !0
211
- }, Qe = /* @__PURE__ */ te({
212
- ...Je,
211
+ }, et = /* @__PURE__ */ te({
212
+ ...Qe,
213
213
  props: {
214
214
  id: {},
215
215
  form: {},
@@ -234,51 +234,56 @@ const je = (t) => (Se("data-v-d6dd5541"), t = t(), Ee(), t), Ge = { class: "titl
234
234
  backgroundColor: {},
235
235
  bodyStyle: {},
236
236
  submitText: { default: "确定" },
237
- cancelText: { default: "取消" }
237
+ cancelText: { default: "取消" },
238
+ zIndex: { default: 1e3 }
238
239
  },
239
240
  emits: ["submit"],
240
241
  setup(t, { expose: s, emit: o }) {
241
- const e = t, a = o, i = oe(K), c = H(!1);
242
- let v = 0, w = 0;
243
- const _ = P(), h = P(), d = P(), r = P(), u = P(), l = P(), { height: m } = W(_), { height: f } = W(d, void 0, { box: "border-box" }), { height: C } = W(r, void 0, { box: "border-box" }), { height: S } = W(u), { height: L } = W(l), { x: q, y: J } = Ie(d, {
242
+ xe((n) => ({
243
+ "359e2d1e": n.zIndex,
244
+ "635715bb": L.value
245
+ }));
246
+ const e = t, l = o, i = oe(U), a = H(!1);
247
+ let p = 0, b = 0;
248
+ const w = P(), h = P(), d = P(), m = P(), r = P(), u = P(), { height: c } = D(w), { height: g } = D(d, void 0, { box: "border-box" }), { height: f } = D(m, void 0, { box: "border-box" }), { height: R } = D(r), { height: z } = D(u), L = M(() => e.zIndex + 100), { x: W, y: Z } = je(d, {
244
249
  initialValue: { x: 0, y: 0 }
245
250
  });
246
- function G() {
251
+ function v() {
247
252
  i == null || i.close(e.id);
248
253
  }
249
- function p(n) {
254
+ function E(n) {
250
255
  return typeof n == "number" ? `${n}px` : n;
251
256
  }
252
- const R = E(() => {
257
+ const x = M(() => {
253
258
  const n = {};
254
259
  return e.mode === "dialog" && (n.justifyContent = "center"), e.mode === "drawer" && (n.justifyContent = "flex-end"), n;
255
- }), b = E(() => {
260
+ }), B = M(() => {
256
261
  const n = {};
257
- return e.size && (n.width = p(e.sizes[e.size])), e.width && (n.width = p(e.width)), e.maxWidth && (n.maxWidth = p(e.maxWidth)), e.fullscreen && (n.maxWidth = "unset", n.width = "100%", n.position = "fixed", n.top = 0, n.left = 0, n.bottom = 0, n.right = 0, n.borderRadius = 0), e.draggable && !e.fullscreen && e.mode === "dialog" && (n.transform = `translate3d(${q.value - v}px, ${J.value - w}px, 0px)`), e.mode === "drawer" && (n.borderRadius = 0, n.height = "100%"), e.offset && e.mode === "dialog" && (n.marginLeft = `${e.offset.x || 0}px`, n.marginTop = `${e.offset.y || 0}px`), e.backgroundColor && (n.backgroundColor = e.backgroundColor), n;
258
- }), B = E(() => {
262
+ return e.size && (n.width = E(e.sizes[e.size])), e.width && (n.width = E(e.width)), e.maxWidth && (n.maxWidth = E(e.maxWidth)), e.fullscreen && (n.maxWidth = "unset", n.width = "100%", n.position = "fixed", n.top = 0, n.left = 0, n.bottom = 0, n.right = 0, n.borderRadius = 0), e.draggable && !e.fullscreen && e.mode === "dialog" && (n.transform = `translate3d(${W.value - p}px, ${Z.value - b}px, 0px)`), e.mode === "drawer" && (n.borderRadius = 0, n.height = "100%"), e.offset && e.mode === "dialog" && (n.marginLeft = `${e.offset.x || 0}px`, n.marginTop = `${e.offset.y || 0}px`), e.backgroundColor && (n.backgroundColor = e.backgroundColor), n;
263
+ }), $ = M(() => {
259
264
  const n = {};
260
265
  return e.draggable && !e.fullscreen && e.mode === "dialog" && (n.cursor = "move"), n;
261
- }), $ = E(() => {
262
- const n = {}, k = S.value + L.value + f.value + C.value, ie = Math.floor(m.value * (Number(p(e.maxHeight).replace("%", "")) / 100));
263
- return e.maxHeight && (n.maxHeight = `${ie - k}px`), e.mode === "drawer" && (n.maxHeight = "unset", n.height = `${m.value - k}px`), e.fullscreen && (n.maxHeight = "unset", n.height = `calc(100% - ${k}px)`), e.type !== "component" && (n.padding = "0"), e.bodyStyle && Object.assign(n, e.bodyStyle), n;
266
+ }), A = M(() => {
267
+ const n = {}, k = R.value + z.value + g.value + f.value, ie = Math.floor(c.value * (Number(E(e.maxHeight).replace("%", "")) / 100));
268
+ return e.maxHeight && (n.maxHeight = `${ie - k}px`), e.mode === "drawer" && (n.maxHeight = "unset", n.height = `${c.value - k}px`), e.fullscreen && (n.maxHeight = "unset", n.height = `calc(100% - ${k}px)`), e.type !== "component" && (n.padding = "0"), e.bodyStyle && Object.assign(n, e.bodyStyle), n;
264
269
  });
265
- function A() {
270
+ function I() {
266
271
  const n = h.value;
267
272
  if (e.form && n) {
268
273
  const k = n.querySelector(`form[name="${e.form}"]`);
269
274
  k && k.dispatchEvent(new Event("submit"));
270
275
  }
271
- a("submit");
276
+ l("submit");
272
277
  }
273
- function z() {
278
+ function ce() {
274
279
  i == null || i.close(e.id);
275
280
  }
276
- function ce() {
281
+ function ue() {
277
282
  window && window.addEventListener("resize", () => {
278
- I(_), I(h), h.value && (v = h.value.offsetLeft, w = h.value.offsetTop);
283
+ j(w), j(h), h.value && (p = h.value.offsetLeft, b = h.value.offsetTop);
279
284
  });
280
285
  }
281
- function ue() {
286
+ function fe() {
282
287
  if (e.closeable && e.esc) {
283
288
  const n = ({ key: k }) => {
284
289
  k === "Escape" && (i == null || i.close(e.id), window.removeEventListener("keydown", n));
@@ -286,97 +291,97 @@ const je = (t) => (Se("data-v-d6dd5541"), t = t(), Ee(), t), Ge = { class: "titl
286
291
  window.addEventListener("keydown", n);
287
292
  }
288
293
  }
289
- function fe() {
290
- v = h.value.offsetLeft, w = h.value.offsetTop;
294
+ function pe() {
295
+ p = h.value.offsetLeft, b = h.value.offsetTop;
291
296
  }
292
- Y(() => {
293
- ue(), ce();
294
- }), be(() => {
297
+ K(() => {
298
+ fe(), ue();
299
+ }), Ce(() => {
295
300
  });
296
- function pe() {
297
- return c.value = !0, () => se();
301
+ function ve() {
302
+ return a.value = !0, () => re();
298
303
  }
299
- function se() {
300
- c.value = !1;
304
+ function re() {
305
+ a.value = !1;
301
306
  }
302
307
  return s({
303
- showLoading: pe,
304
- hideLoading: se
305
- }), (n, k) => (y(), M("div", {
308
+ showLoading: ve,
309
+ hideLoading: re
310
+ }), (n, k) => (_(), S("div", {
306
311
  ref_key: "wrapperRef",
307
- ref: _,
312
+ ref: w,
308
313
  class: "modal-wrapper",
309
- style: D(R.value),
310
- onClick: k[0] || (k[0] = xe((ie) => n.maskClosable && G(), ["self"]))
314
+ style: V(x.value),
315
+ onClick: k[0] || (k[0] = ke((ie) => n.maskClosable && v(), ["self"]))
311
316
  }, [
312
- g("div", {
317
+ y("div", {
313
318
  ref_key: "contentRef",
314
319
  ref: h,
315
- class: Ce(["modal-content", { [`${n.mode}-mode`]: !0 }]),
316
- style: D(b.value)
320
+ class: Me(["modal-content", { [`${n.mode}-mode`]: !0 }]),
321
+ style: V(B.value)
317
322
  }, [
318
- n.header ? (y(), M("div", {
323
+ n.header ? (_(), S("div", {
319
324
  key: 0,
320
325
  ref_key: "headerRef",
321
326
  ref: d,
322
327
  class: "modal-header",
323
- style: D(B.value),
324
- onMousedown: fe
328
+ style: V($.value),
329
+ onMousedown: pe
325
330
  }, [
326
- g("div", Ge, O(n.title), 1),
327
- g("div", Xe, [
328
- n.closeable ? (y(), M("div", {
331
+ y("div", Ye, O(n.title), 1),
332
+ y("div", Ke, [
333
+ n.closeable ? (_(), S("div", {
329
334
  key: 0,
330
335
  class: "i-icon-park-outline:close block cursor-pointer",
331
- onClick: G
336
+ onClick: v
332
337
  })) : N("", !0)
333
338
  ])
334
339
  ], 36)) : N("", !0),
335
- g("div", {
340
+ y("div", {
336
341
  id: "modal-header-slot",
337
342
  ref_key: "headerSlotRef",
338
- ref: u
343
+ ref: r
339
344
  }, null, 512),
340
- g("div", {
345
+ y("div", {
341
346
  class: "modal-body",
342
- style: D($.value)
347
+ style: V(A.value)
343
348
  }, [
344
- (y(), F(le(n.component), ke(Me(n.componentProps)), null, 16))
349
+ (_(), F(le(n.component), Se(Ee(n.componentProps)), null, 16))
345
350
  ], 4),
346
- g("div", {
351
+ y("div", {
347
352
  id: "modal-footer-slot",
348
353
  ref_key: "footerSlotRef",
349
- ref: l
354
+ ref: u
350
355
  }, null, 512),
351
- n.footer ? (y(), M("div", {
356
+ n.footer ? (_(), S("div", {
352
357
  key: 1,
353
358
  ref_key: "footerRef",
354
- ref: r,
359
+ ref: m,
355
360
  class: "modal-footer space-x-2"
356
361
  }, [
357
- g("button", {
362
+ y("button", {
358
363
  class: "cancel-button",
359
364
  type: "button",
360
- onClick: z
365
+ onClick: ce
361
366
  }, O(n.cancelText), 1),
362
- g("button", {
367
+ y("button", {
363
368
  class: "submit-button",
364
369
  form: n.form,
365
370
  type: "submit",
366
- onClick: A
367
- }, O(n.submitText), 9, Ye)
371
+ onClick: I
372
+ }, O(n.submitText), 9, Ue)
368
373
  ], 512)) : N("", !0),
369
- c.value ? (y(), M("div", Ke, qe)) : N("", !0)
374
+ a.value ? (_(), S("div", qe, Je)) : N("", !0)
370
375
  ], 6)
371
376
  ], 4));
372
377
  }
373
378
  });
374
- const j = (t, s) => {
379
+ const X = (t, s) => {
375
380
  const o = t.__vccOpts || t;
376
- for (const [e, a] of s)
377
- o[e] = a;
381
+ for (const [e, l] of s)
382
+ o[e] = l;
378
383
  return o;
379
- }, Ze = /* @__PURE__ */ j(Qe, [["__scopeId", "data-v-d6dd5541"]]), et = { class: "modal-dialog" }, tt = { class: "dialog-body" }, ot = { class: "dialog-title" }, nt = { class: "dialog-content" }, rt = /* @__PURE__ */ te({
384
+ }, tt = /* @__PURE__ */ X(et, [["__scopeId", "data-v-8dfa7cd4"]]), ot = { class: "modal-dialog" }, nt = { class: "dialog-body" }, st = { class: "dialog-title" }, rt = { class: "dialog-content" }, it = /* @__PURE__ */ te({
380
385
  __name: "modal-dialog",
381
386
  props: {
382
387
  type: {},
@@ -389,53 +394,53 @@ const j = (t, s) => {
389
394
  footer: {}
390
395
  },
391
396
  setup(t) {
392
- const s = t, o = ht(), e = E(() => s.title ? s.title : {
397
+ const s = t, o = gt(), e = M(() => s.title ? s.title : {
393
398
  confirm: "提示",
394
399
  info: "提示",
395
400
  warning: "警告",
396
401
  error: "错误",
397
402
  success: "成功"
398
403
  }[s.type]);
399
- async function a() {
404
+ async function l() {
400
405
  s.onOk && await s.onOk(), o.close();
401
406
  }
402
407
  async function i() {
403
408
  s.onCancel && await s.onCancel(), o.close();
404
409
  }
405
- return (c, v) => (y(), M("section", et, [
406
- g("div", tt, [
407
- g("div", ot, O(e.value), 1),
408
- g("div", nt, O(c.content), 1)
410
+ return (a, p) => (_(), S("section", ot, [
411
+ y("div", nt, [
412
+ y("div", st, O(e.value), 1),
413
+ y("div", rt, O(a.content), 1)
409
414
  ]),
410
- g("div", {
415
+ y("div", {
411
416
  class: "dialog-footer space-x-2",
412
- style: D(c.type === "confirm" ? { "justify-content": "end" } : { "border-top": "none" })
417
+ style: V(a.type === "confirm" ? { "justify-content": "end" } : { "border-top": "none" })
413
418
  }, [
414
- c.footer ? (y(), F(le(c.footer), { key: 0 })) : (y(), M(Z, { key: 1 }, [
415
- g("button", {
419
+ a.footer ? (_(), F(le(a.footer), { key: 0 })) : (_(), S(Q, { key: 1 }, [
420
+ y("button", {
416
421
  class: "submit-button",
417
422
  type: "submit",
418
- onClick: a
419
- }, O(c.okText), 1),
420
- c.type === "confirm" ? (y(), M("button", {
423
+ onClick: l
424
+ }, O(a.okText), 1),
425
+ a.type === "confirm" ? (_(), S("button", {
421
426
  key: 0,
422
427
  class: "cancel-button",
423
428
  type: "button",
424
429
  onClick: i
425
- }, O(c.cancelText), 1)) : N("", !0)
430
+ }, O(a.cancelText), 1)) : N("", !0)
426
431
  ], 64))
427
432
  ], 4)
428
433
  ]));
429
434
  }
430
435
  });
431
- const st = /* @__PURE__ */ j(rt, [["__scopeId", "data-v-8326e5a5"]]), it = {
436
+ const lt = /* @__PURE__ */ X(it, [["__scopeId", "data-v-8326e5a5"]]), at = {
432
437
  key: 0,
433
438
  class: "modal-teleport"
434
- }, lt = {
439
+ }, dt = {
435
440
  name: "ModalProvider",
436
441
  inheritAttrs: !0
437
- }, at = /* @__PURE__ */ te({
438
- ...lt,
442
+ }, ct = /* @__PURE__ */ te({
443
+ ...dt,
439
444
  props: {
440
445
  appendToBody: { type: [Boolean, String], default: !1 },
441
446
  sizes: { default: () => ({
@@ -448,116 +453,117 @@ const st = /* @__PURE__ */ j(rt, [["__scopeId", "data-v-8326e5a5"]]), it = {
448
453
  offset: { default: () => ({ x: 0, y: 0 }) }
449
454
  },
450
455
  setup(t, { expose: s }) {
451
- const o = P([]), e = H(!1), a = V();
452
- function i(r, u = {}, l = {}) {
453
- const m = Oe(
454
- () => Promise.resolve(typeof r == "string" ? st : r)
456
+ const o = P([]), e = H(!1), l = G();
457
+ let i = 1100;
458
+ function a(r, u = {}, c = {}) {
459
+ const g = Te(
460
+ () => Promise.resolve(typeof r == "string" ? lt : r)
455
461
  );
456
- typeof r == "string" && (u.type = r, l.size = "small", l.fullscreen = !1, l.mode = "dialog", l.footer = !1, l.header = !1);
457
- const f = Math.random().toString(32).slice(2), C = new Promise((S, L) => {
462
+ typeof r == "string" && (u.type = r, c.size = "small", c.fullscreen = !1, c.mode = "dialog", c.footer = !1, c.header = !1);
463
+ const f = Math.random().toString(32).slice(2), R = Object.assign({ zIndex: i++ }, u), z = new Promise((L, W) => {
458
464
  o.value.push({
459
465
  id: f,
460
- component: m,
466
+ component: g,
461
467
  props: u || {},
462
468
  options: {
463
- ...l,
469
+ ...R,
464
470
  type: typeof r == "string" ? r : "component"
465
471
  },
466
- resolve: S,
467
- reject: L,
472
+ resolve: L,
473
+ reject: W,
468
474
  listeners: []
469
- }), I(o);
470
- }).catch((S) => S === "CANCEL" ? new Promise(() => {
471
- }) : Promise.reject(S));
472
- return Object.assign(C, {
473
- close: () => c(f)
475
+ }), j(o);
476
+ }).catch((L) => L === "CANCEL" ? new Promise(() => {
477
+ }) : Promise.reject(L));
478
+ return Object.assign(z, {
479
+ close: () => p(f)
474
480
  });
475
481
  }
476
- function c(r, u) {
477
- const l = o.value.findIndex((f) => f.id === r);
478
- if (l < 0)
482
+ function p(r, u) {
483
+ const c = o.value.findIndex((f) => f.id === r);
484
+ if (c < 0)
479
485
  return;
480
- const m = o.value[l];
481
- u === void 0 ? m == null || m.reject("CANCEL") : m == null || m.resolve(u), o.value.splice(l, 1), I(o);
486
+ const g = o.value[c];
487
+ u === void 0 ? g == null || g.reject("CANCEL") : g == null || g.resolve(u), o.value.splice(c, 1), j(o);
482
488
  }
483
- function v() {
489
+ function b() {
484
490
  !o.value || o.value.length === 0 || (o.value.forEach((r) => {
485
491
  r == null || r.reject("CANCEL");
486
- }), o.value = [], I(o));
492
+ }), o.value = [], j(o));
487
493
  }
488
494
  function w(r, u) {
489
- const l = o.value.find((f) => f.id === r);
490
- if (!l)
495
+ const c = o.value.find((f) => f.id === r);
496
+ if (!c)
491
497
  return;
492
- const m = l.listeners.find((f) => f.event === u);
493
- m && m.callback({
494
- open: i,
495
- close: (f) => c(l.id, f),
496
- closeAll: v,
497
- showLoading: () => _(l.id),
498
- hideLoading: () => h(l.id),
499
- confirm: (f) => i("confirm", f),
500
- success: (f) => i("success", f),
501
- error: (f) => i("error", f),
502
- warning: (f) => i("warning", f),
503
- info: (f) => i("info", f)
498
+ const g = c.listeners.find((f) => f.event === u);
499
+ g && g.callback({
500
+ open: a,
501
+ close: (f) => p(c.id, f),
502
+ closeAll: b,
503
+ showLoading: () => h(c.id),
504
+ hideLoading: () => d(c.id),
505
+ confirm: (f) => a("confirm", f),
506
+ success: (f) => a("success", f),
507
+ error: (f) => a("error", f),
508
+ warning: (f) => a("warning", f),
509
+ info: (f) => a("info", f)
504
510
  });
505
511
  }
506
- function _(r) {
507
- if (!a)
512
+ function h(r) {
513
+ if (!l)
508
514
  return;
509
- const [u] = a.refs[`modal-container_${r}`];
515
+ const [u] = l.refs[`modal-container_${r}`];
510
516
  if (u)
511
517
  return u.showLoading();
512
518
  }
513
- function h(r) {
514
- if (!a)
519
+ function d(r) {
520
+ if (!l)
515
521
  return;
516
- const [u] = a.refs[`modal-container_${r}`];
522
+ const [u] = l.refs[`modal-container_${r}`];
517
523
  if (u)
518
524
  return u.hideLoading();
519
525
  }
520
- function d(r, u, l) {
521
- const m = o.value.find((f) => f.id === r);
522
- m && m.listeners.push({
526
+ function m(r, u, c) {
527
+ const g = o.value.find((f) => f.id === r);
528
+ g && g.listeners.push({
523
529
  event: u,
524
- callback: l
530
+ callback: c
525
531
  });
526
532
  }
527
- return $e(K, {
528
- open: i,
529
- close: c,
530
- closeAll: v,
531
- addEventListener: d
533
+ return Le(U, {
534
+ open: a,
535
+ close: p,
536
+ closeAll: b,
537
+ addEventListener: m
532
538
  }), s({
533
539
  elements: o,
534
- open: i,
535
- close: c,
536
- closeAll: v
537
- }), Y(() => {
540
+ open: a,
541
+ close: p,
542
+ closeAll: b
543
+ }), K(() => {
538
544
  e.value = !0;
539
- }), (r, u) => (y(), M(Z, null, [
545
+ }), (r, u) => (_(), S(Q, null, [
540
546
  ne(r.$slots, "default", {}, void 0, !0),
541
- e.value ? (y(), M("div", it, [
542
- (y(), F(re, {
547
+ e.value ? (_(), S("div", at, [
548
+ (_(), F(se, {
543
549
  disabled: !r.appendToBody,
544
550
  to: typeof r.appendToBody == "string" ? r.appendToBody : "body"
545
551
  }, [
546
- Ae(Le, { name: "modal-fade" }, {
547
- default: Re(() => [
548
- (y(!0), M(Z, null, Be(o.value, (l) => (y(), F(Ze, Pe({
549
- id: l.id,
550
- key: l.id,
552
+ Re(ze, { name: "modal-fade" }, {
553
+ default: Be(() => [
554
+ (_(!0), S(Q, null, Pe(o.value, (c) => (_(), F(tt, Oe({
555
+ id: c.id,
556
+ key: c.id,
551
557
  ref_for: !0,
552
- ref: `modal-container_${l.id}`,
553
- component: l.component,
554
- "component-props": l.props,
558
+ ref: `modal-container_${c.id}`,
559
+ component: c.component,
560
+ "component-props": c.props,
555
561
  "max-height": r.maxHeight,
556
562
  "max-width": r.maxWidth,
557
563
  offset: r.offset,
558
564
  sizes: r.sizes
559
- }, l.options, {
560
- onSubmit: () => w(l.id, "submit")
565
+ }, c.options, {
566
+ onSubmit: () => w(c.id, "submit")
561
567
  }), null, 16, ["id", "component", "component-props", "max-height", "max-width", "offset", "sizes", "onSubmit"]))), 128))
562
568
  ]),
563
569
  _: 1
@@ -567,46 +573,46 @@ const st = /* @__PURE__ */ j(rt, [["__scopeId", "data-v-8326e5a5"]]), it = {
567
573
  ], 64));
568
574
  }
569
575
  });
570
- const gt = /* @__PURE__ */ j(at, [["__scopeId", "data-v-241a8304"]]);
571
- const dt = {}, ct = { class: "modal-footer" };
572
- function ut(t, s) {
573
- return y(), F(re, { to: "#modal-footer-slot" }, [
574
- g("div", ct, [
576
+ const _t = /* @__PURE__ */ X(ct, [["__scopeId", "data-v-560682b4"]]);
577
+ const ut = {}, ft = { class: "modal-footer" };
578
+ function pt(t, s) {
579
+ return _(), F(se, { to: "#modal-footer-slot" }, [
580
+ y("div", ft, [
575
581
  ne(t.$slots, "default", {}, void 0, !0)
576
582
  ])
577
583
  ]);
578
584
  }
579
- const yt = /* @__PURE__ */ j(dt, [["render", ut], ["__scopeId", "data-v-2080a86e"]]);
580
- const ft = {}, pt = { class: "modal-header" };
581
- function vt(t, s) {
582
- return y(), F(re, { to: "#modal-header-slot" }, [
583
- g("div", pt, [
585
+ const bt = /* @__PURE__ */ X(ut, [["render", pt], ["__scopeId", "data-v-2080a86e"]]);
586
+ const vt = {}, ht = { class: "modal-header" };
587
+ function mt(t, s) {
588
+ return _(), F(se, { to: "#modal-header-slot" }, [
589
+ y("div", ht, [
584
590
  ne(t.$slots, "default", {}, void 0, !0)
585
591
  ])
586
592
  ]);
587
593
  }
588
- const _t = /* @__PURE__ */ j(ft, [["render", vt], ["__scopeId", "data-v-d0247172"]]);
589
- function X(t, s) {
590
- var e, a;
594
+ const wt = /* @__PURE__ */ X(vt, [["render", mt], ["__scopeId", "data-v-d0247172"]]);
595
+ function Y(t, s) {
596
+ var e, l;
591
597
  let o = t == null ? void 0 : t.parent;
592
598
  for (; o && ((e = o == null ? void 0 : o.type) == null ? void 0 : e.name) !== s; )
593
599
  o = o.parent;
594
- return ((a = o == null ? void 0 : o.type) == null ? void 0 : a.name) === s ? o : null;
600
+ return ((l = o == null ? void 0 : o.type) == null ? void 0 : l.name) === s ? o : null;
595
601
  }
596
- function ht() {
597
- const t = oe(K), s = V();
598
- function o(e, a, i) {
602
+ function gt() {
603
+ const t = oe(U), s = G();
604
+ function o(e, l, i) {
599
605
  if (!t)
600
606
  throw new Error("Not Found Modal Provider Component");
601
- return t.open(e, a, i);
607
+ return t.open(e, l, i);
602
608
  }
603
609
  return {
604
610
  open: o,
605
611
  close(e) {
606
- var c;
612
+ var a;
607
613
  if (!t)
608
614
  throw new Error("Not Found Modal Provider Component");
609
- const a = X(s, "ModalContainer"), i = (c = a == null ? void 0 : a.props) == null ? void 0 : c.id;
615
+ const l = Y(s, "ModalContainer"), i = (a = l == null ? void 0 : l.props) == null ? void 0 : a.id;
610
616
  if (!i)
611
617
  throw new Error("Not Found Current Modal Container");
612
618
  t.close(i, e);
@@ -620,7 +626,7 @@ function ht() {
620
626
  var i;
621
627
  if (!t)
622
628
  throw new Error("Not Found Modal Provider Component");
623
- const e = X(s, "ModalContainer");
629
+ const e = Y(s, "ModalContainer");
624
630
  if (!((i = e == null ? void 0 : e.props) == null ? void 0 : i.id))
625
631
  throw new Error("Not Found Current Modal Container");
626
632
  e != null && e.exposed && (e == null || e.exposed.showLoading());
@@ -629,7 +635,7 @@ function ht() {
629
635
  var i;
630
636
  if (!t)
631
637
  throw new Error("Not Found Modal Provider Component");
632
- const e = X(s, "ModalContainer");
638
+ const e = Y(s, "ModalContainer");
633
639
  if (!((i = e == null ? void 0 : e.props) == null ? void 0 : i.id))
634
640
  throw new Error("Not Found Current Modal Container");
635
641
  e != null && e.exposed && (e == null || e.exposed.hideLoading());
@@ -651,17 +657,17 @@ function ht() {
651
657
  }
652
658
  };
653
659
  }
654
- function wt(t) {
660
+ function xt(t) {
655
661
  var i;
656
- const s = oe(K), o = V(), e = X(o, "ModalContainer"), a = (i = e == null ? void 0 : e.props) == null ? void 0 : i.id;
657
- s && a && s.addEventListener(a, "submit", t);
662
+ const s = oe(U), o = G(), e = Y(o, "ModalContainer"), l = (i = e == null ? void 0 : e.props) == null ? void 0 : i.id;
663
+ s && l && s.addEventListener(l, "submit", t);
658
664
  }
659
665
  export {
660
- Ze as ModalContainer,
661
- yt as ModalFooter,
662
- _t as ModalHeader,
663
- K as ModalKey,
664
- gt as ModalProvider,
665
- wt as onSubmit,
666
- ht as useModal
666
+ tt as ModalContainer,
667
+ bt as ModalFooter,
668
+ wt as ModalHeader,
669
+ U as ModalKey,
670
+ _t as ModalProvider,
671
+ xt as onSubmit,
672
+ gt as useModal
667
673
  };
package/dist/style.css CHANGED
@@ -1 +1 @@
1
- *,:before,:after{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 rgb(0 0 0 / 0);--un-ring-shadow:0 0 rgb(0 0 0 / 0);--un-shadow-inset: ;--un-shadow:0 0 rgb(0 0 0 / 0);--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgb(147 197 253 / .5);--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: }::backdrop{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 rgb(0 0 0 / 0);--un-ring-shadow:0 0 rgb(0 0 0 / 0);--un-shadow-inset: ;--un-shadow:0 0 rgb(0 0 0 / 0);--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgb(147 197 253 / .5);--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: }.i-icon-park-outline\:close{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 48 48' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='4' d='m8 8l32 32M8 40L40 8'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1em;height:1em}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.block{display:block}.inline-block{display:inline-block}.flex{display:flex}.transform{transform:translate(var(--un-translate-x)) translateY(var(--un-translate-y)) translateZ(var(--un-translate-z)) rotate(var(--un-rotate)) rotateX(var(--un-rotate-x)) rotateY(var(--un-rotate-y)) rotate(var(--un-rotate-z)) skew(var(--un-skew-x)) skewY(var(--un-skew-y)) scaleX(var(--un-scale-x)) scaleY(var(--un-scale-y)) scaleZ(var(--un-scale-z))}.cursor-pointer{cursor:pointer}.resize{resize:both}.space-x-2>:not([hidden])~:not([hidden]){--un-space-x-reverse:0;margin-left:calc(.5rem * calc(1 - var(--un-space-x-reverse)));margin-right:calc(.5rem * var(--un-space-x-reverse))}.border{border-width:1px}.px{padding-left:1rem;padding-right:1rem}.text-16px{font-size:16px}.font-bold{font-weight:700}.outline{outline-style:solid}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.ease{transition-timing-function:cubic-bezier(.4,0,.2,1)}.modal-wrapper[data-v-d6dd5541]{z-index:1000;position:fixed;top:0;right:0;bottom:0;left:0;display:flex;align-items:center;background:rgba(0,0,0,.3)}.modal-content[data-v-d6dd5541]{background:#ffffff;border-radius:5px;position:relative}.modal-header[data-v-d6dd5541]{box-sizing:border-box;padding:10px;height:50px;display:flex;justify-content:space-between;align-items:center;border-bottom:solid 1px var(--color-border-1, #e8e8e8);color:var(--color-text-2, #4E5969)}.modal-body[data-v-d6dd5541]{padding:10px;box-sizing:border-box;overflow:auto;position:relative}.modal-footer[data-v-d6dd5541]{box-sizing:border-box;height:50px;border-top:solid 1px var(--color-border-1, #e8e8e8);display:flex;justify-content:flex-end;padding:10px}.modal-footer button[data-v-d6dd5541]{height:28px;line-height:28px;width:80px;outline:none;border-color:transparent;font-size:14px;border-radius:4px;padding:0;box-sizing:content-box}.modal-footer button.submit-button[data-v-d6dd5541]{color:#fff;background-color:rgb(var(--primary-6, 45, 106, 251))}.modal-footer button.submit-button[data-v-d6dd5541]:hover{background-color:rgb(var(--primary-5, 28, 76, 207))}.modal-footer button.cancel-button[data-v-d6dd5541]{color:rgb(var(--color-text-2, 78, 89, 105));background-color:var(--color-fill-1, #f5f5f5)}.modal-footer button.cancel-button[data-v-d6dd5541]:hover{background-color:var(--color-fill-4, #c9cdd4)}.modal-loading[data-v-d6dd5541]{position:absolute;z-index:1001;top:0;right:0;bottom:0;left:0;display:flex;justify-content:center;align-items:center;background-color:#0000001a}.modal-loading .lds-ring[data-v-d6dd5541]{display:inline-block;position:relative;width:80px;height:80px}.modal-loading .lds-ring div[data-v-d6dd5541]{box-sizing:border-box;display:block;position:absolute;width:48px;height:48px;margin:8px;border:5px solid #fff;border-radius:50%;animation:lds-ring-d6dd5541 1.2s cubic-bezier(.5,0,.5,1) infinite;border-color:#fff transparent transparent transparent}.modal-loading .lds-ring div[data-v-d6dd5541]:nth-child(1){animation-delay:-.45s}.modal-loading .lds-ring div[data-v-d6dd5541]:nth-child(2){animation-delay:-.3s}.modal-loading .lds-ring div[data-v-d6dd5541]:nth-child(3){animation-delay:-.15s}@keyframes lds-ring-d6dd5541{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.dialog-body[data-v-8326e5a5]{padding:20px 10px 10px}.dialog-title[data-v-8326e5a5]{padding:5px;font-weight:700;font-size:16px}.dialog-content[data-v-8326e5a5]{padding:5px}.dialog-footer[data-v-8326e5a5]{box-sizing:border-box;height:50px;border-top:solid 1px var(--color-border-1, #e8e8e8);display:flex;justify-content:center;align-items:center;padding:0 10px}.dialog-footer button[data-v-8326e5a5]{height:28px;line-height:28px;width:80px;outline:none;border-color:transparent;font-size:14px;border-radius:4px;padding:0;box-sizing:content-box}.dialog-footer button.submit-button[data-v-8326e5a5]{color:#fff;background-color:rgb(var(--primary-6, 45, 106, 251))}.dialog-footer button.submit-button[data-v-8326e5a5]:hover{background-color:rgb(var(--primary-5, 28, 76, 207))}.dialog-footer button.cancel-button[data-v-8326e5a5]{color:rgb(var(--color-text-2, 78, 89, 105));background-color:var(--color-fill-1, #f5f5f5)}.dialog-footer button.cancel-button[data-v-8326e5a5]:hover{background-color:var(--color-fill-4, #c9cdd4)}.modal-fade-enter-active[data-v-241a8304],.modal-fade-leave-active[data-v-241a8304]{transition:opacity .5s ease}.modal-fade-enter-active[data-v-241a8304] .modal-content.drawer-mode,.modal-fade-leave-active[data-v-241a8304] .modal-content.drawer-mode{transition:transform .5s ease}.modal-fade-enter-from[data-v-241a8304],.modal-fade-leave-to[data-v-241a8304]{opacity:0}.modal-fade-enter-from[data-v-241a8304] .modal-content.drawer-mode,.modal-fade-leave-to[data-v-241a8304] .modal-content.drawer-mode{transform:translate3d(100%,0,0)}.modal-footer[data-v-2080a86e]{box-sizing:border-box;min-height:50px;border-top:solid 1px var(--color-border-1, rgb(232, 232, 232));padding:10px}.modal-footer button[data-v-2080a86e]{height:28px;line-height:28px;width:80px;outline:none;border-color:transparent;font-size:14px;border-radius:4px;padding:0;box-sizing:content-box}.modal-footer button.submit-button[data-v-2080a86e]{color:#fff;background-color:rgb(var(--primary-6, 45, 106, 251))}.modal-footer button.submit-button[data-v-2080a86e]:hover{background-color:rgb(var(--primary-5, 28, 76, 207))}.modal-footer button.cancel-button[data-v-2080a86e]{color:rgb(var(--color-text-2, 78, 89, 105));background-color:var(--color-fill-1, #f5f5f5)}.modal-footer button.cancel-button[data-v-2080a86e]:hover{background-color:var(--color-fill-4, #c9cdd4)}.modal-header[data-v-d0247172]{box-sizing:border-box;padding:10px;min-height:50px;border-bottom:solid 1px var(--color-border-1, rgb(232, 232, 232));color:var(--color-text-2, #4E5969)}
1
+ *,:before,:after{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 rgb(0 0 0 / 0);--un-ring-shadow:0 0 rgb(0 0 0 / 0);--un-shadow-inset: ;--un-shadow:0 0 rgb(0 0 0 / 0);--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgb(147 197 253 / .5);--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: }::backdrop{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 rgb(0 0 0 / 0);--un-ring-shadow:0 0 rgb(0 0 0 / 0);--un-shadow-inset: ;--un-shadow:0 0 rgb(0 0 0 / 0);--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgb(147 197 253 / .5);--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: }.i-icon-park-outline\:close{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 48 48' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='4' d='m8 8l32 32M8 40L40 8'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1em;height:1em}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.block{display:block}.inline-block{display:inline-block}.flex{display:flex}.transform{transform:translate(var(--un-translate-x)) translateY(var(--un-translate-y)) translateZ(var(--un-translate-z)) rotate(var(--un-rotate)) rotateX(var(--un-rotate-x)) rotateY(var(--un-rotate-y)) rotate(var(--un-rotate-z)) skew(var(--un-skew-x)) skewY(var(--un-skew-y)) scaleX(var(--un-scale-x)) scaleY(var(--un-scale-y)) scaleZ(var(--un-scale-z))}.cursor-pointer{cursor:pointer}.resize{resize:both}.space-x-2>:not([hidden])~:not([hidden]){--un-space-x-reverse:0;margin-left:calc(.5rem * calc(1 - var(--un-space-x-reverse)));margin-right:calc(.5rem * var(--un-space-x-reverse))}.border{border-width:1px}.px{padding-left:1rem;padding-right:1rem}.text-16px{font-size:16px}.font-bold{font-weight:700}.outline{outline-style:solid}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.ease{transition-timing-function:cubic-bezier(.4,0,.2,1)}.modal-wrapper[data-v-8dfa7cd4]{z-index:var(--359e2d1e);position:fixed;top:0;right:0;bottom:0;left:0;display:flex;align-items:center;background:rgba(0,0,0,.3)}.modal-content[data-v-8dfa7cd4]{background:#ffffff;border-radius:5px;position:relative}.modal-header[data-v-8dfa7cd4]{box-sizing:border-box;padding:10px;height:50px;display:flex;justify-content:space-between;align-items:center;border-bottom:solid 1px var(--color-border-1, #e8e8e8);color:var(--color-text-2, #4E5969)}.modal-body[data-v-8dfa7cd4]{padding:10px;box-sizing:border-box;overflow:auto;position:relative}.modal-footer[data-v-8dfa7cd4]{box-sizing:border-box;height:50px;border-top:solid 1px var(--color-border-1, #e8e8e8);display:flex;justify-content:flex-end;padding:10px}.modal-footer button[data-v-8dfa7cd4]{height:28px;line-height:28px;width:80px;outline:none;border-color:transparent;font-size:14px;border-radius:4px;padding:0;box-sizing:content-box}.modal-footer button.submit-button[data-v-8dfa7cd4]{color:#fff;background-color:rgb(var(--primary-6, 45, 106, 251))}.modal-footer button.submit-button[data-v-8dfa7cd4]:hover{background-color:rgb(var(--primary-5, 28, 76, 207))}.modal-footer button.cancel-button[data-v-8dfa7cd4]{color:rgb(var(--color-text-2, 78, 89, 105));background-color:var(--color-fill-1, #f5f5f5)}.modal-footer button.cancel-button[data-v-8dfa7cd4]:hover{background-color:var(--color-fill-4, #c9cdd4)}.modal-loading[data-v-8dfa7cd4]{position:absolute;z-index:var(--635715bb);top:0;right:0;bottom:0;left:0;display:flex;justify-content:center;align-items:center;background-color:#0000001a}.modal-loading .lds-ring[data-v-8dfa7cd4]{display:inline-block;position:relative;width:80px;height:80px}.modal-loading .lds-ring div[data-v-8dfa7cd4]{box-sizing:border-box;display:block;position:absolute;width:48px;height:48px;margin:8px;border:5px solid #fff;border-radius:50%;animation:lds-ring-8dfa7cd4 1.2s cubic-bezier(.5,0,.5,1) infinite;border-color:#fff transparent transparent transparent}.modal-loading .lds-ring div[data-v-8dfa7cd4]:nth-child(1){animation-delay:-.45s}.modal-loading .lds-ring div[data-v-8dfa7cd4]:nth-child(2){animation-delay:-.3s}.modal-loading .lds-ring div[data-v-8dfa7cd4]:nth-child(3){animation-delay:-.15s}@keyframes lds-ring-8dfa7cd4{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.dialog-body[data-v-8326e5a5]{padding:20px 10px 10px}.dialog-title[data-v-8326e5a5]{padding:5px;font-weight:700;font-size:16px}.dialog-content[data-v-8326e5a5]{padding:5px}.dialog-footer[data-v-8326e5a5]{box-sizing:border-box;height:50px;border-top:solid 1px var(--color-border-1, #e8e8e8);display:flex;justify-content:center;align-items:center;padding:0 10px}.dialog-footer button[data-v-8326e5a5]{height:28px;line-height:28px;width:80px;outline:none;border-color:transparent;font-size:14px;border-radius:4px;padding:0;box-sizing:content-box}.dialog-footer button.submit-button[data-v-8326e5a5]{color:#fff;background-color:rgb(var(--primary-6, 45, 106, 251))}.dialog-footer button.submit-button[data-v-8326e5a5]:hover{background-color:rgb(var(--primary-5, 28, 76, 207))}.dialog-footer button.cancel-button[data-v-8326e5a5]{color:rgb(var(--color-text-2, 78, 89, 105));background-color:var(--color-fill-1, #f5f5f5)}.dialog-footer button.cancel-button[data-v-8326e5a5]:hover{background-color:var(--color-fill-4, #c9cdd4)}.modal-fade-enter-active[data-v-560682b4],.modal-fade-leave-active[data-v-560682b4]{transition:opacity .5s ease}.modal-fade-enter-active[data-v-560682b4] .modal-content.drawer-mode,.modal-fade-leave-active[data-v-560682b4] .modal-content.drawer-mode{transition:transform .5s ease}.modal-fade-enter-from[data-v-560682b4],.modal-fade-leave-to[data-v-560682b4]{opacity:0}.modal-fade-enter-from[data-v-560682b4] .modal-content.drawer-mode,.modal-fade-leave-to[data-v-560682b4] .modal-content.drawer-mode{transform:translate3d(100%,0,0)}.modal-footer[data-v-2080a86e]{box-sizing:border-box;min-height:50px;border-top:solid 1px var(--color-border-1, rgb(232, 232, 232));padding:10px}.modal-footer button[data-v-2080a86e]{height:28px;line-height:28px;width:80px;outline:none;border-color:transparent;font-size:14px;border-radius:4px;padding:0;box-sizing:content-box}.modal-footer button.submit-button[data-v-2080a86e]{color:#fff;background-color:rgb(var(--primary-6, 45, 106, 251))}.modal-footer button.submit-button[data-v-2080a86e]:hover{background-color:rgb(var(--primary-5, 28, 76, 207))}.modal-footer button.cancel-button[data-v-2080a86e]{color:rgb(var(--color-text-2, 78, 89, 105));background-color:var(--color-fill-1, #f5f5f5)}.modal-footer button.cancel-button[data-v-2080a86e]:hover{background-color:var(--color-fill-4, #c9cdd4)}.modal-header[data-v-d0247172]{box-sizing:border-box;padding:10px;min-height:50px;border-bottom:solid 1px var(--color-border-1, rgb(232, 232, 232));color:var(--color-text-2, #4E5969)}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@gopowerteam/modal-render",
3
3
  "type": "module",
4
- "version": "0.0.32",
4
+ "version": "0.0.33",
5
5
  "author": {
6
6
  "name": "zhuchentong",
7
7
  "email": "2037630@gmail.com"