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