@gopowerteam/modal-render 0.0.36 → 0.0.37

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