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