@gopowerteam/modal-render 0.0.30 → 0.0.32

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