@gopowerteam/modal-render 0.0.38 → 0.0.39
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 +5 -5
- 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"),V=Symbol("__MODAL__");function F(o){return e.getCurrentScope()?(e.onScopeDispose(o),!0):!1}function w(o){return typeof o=="function"?o():e.unref(o)}const W=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){return e.getCurrentInstance()}function te(o,i={}){if(!e.isRef(o))return e.toRefs(o);const r=Array.isArray(o.value)?Array.from({length:o.value.length}):{};for(const t in o.value)r[t]=e.customRef(()=>({get(){return o.value[t]},set(c){var s;if((s=w(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 r}function oe(o,i=!0,r){ee()?e.onMounted(o,r):i?o():e.nextTick(o)}function N(o){var i;const r=w(o);return(i=r==null?void 0:r.$el)!=null?i:r}const O=W?window:void 0;function P(...o){let i,r,t,c;if(typeof o[0]=="string"||Array.isArray(o[0])?([r,t,c]=o,i=O):[i,r,t,c]=o,!i)return Z;Array.isArray(r)||(r=[r]),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)),b=e.watch(()=>[N(i),w(c)],([v,d])=>{if(u(),!v)return;const l=Q(d)?{...d}:d;s.push(...r.flatMap(f=>t.map(a=>h(v,f,a,l))))},{immediate:!0,flush:"post"}),y=()=>{b(),u()};return F(y),y}function ne(){const o=e.ref(!1),i=e.getCurrentInstance();return i&&e.onMounted(()=>{o.value=!0},i),o}function re(o){const i=ne();return e.computed(()=>(i.value,!!o()))}function ie(o,i={}){var r,t;const{pointerTypes:c,preventDefault:s,stopPropagation:u,exact:h,onMove:b,onEnd:y,onStart:v,initialValue:d,axis:l="both",draggingElement:f=O,containerElement:a,handle:g=o}=i,p=e.ref((r=w(d))!=null?r:{x:0,y:0}),C=e.ref(),M=m=>c?c.includes(m.pointerType):!0,E=m=>{w(s)&&m.preventDefault(),w(u)&&m.stopPropagation()},$=m=>{var S;if(w(i.disabled)||!M(m)||w(h)&&m.target!==w(o))return;const k=w(a),B=(S=k==null?void 0:k.getBoundingClientRect)==null?void 0:S.call(k),_=w(o).getBoundingClientRect(),T={x:m.clientX-(k?_.left-B.left+k.scrollLeft:_.left),y:m.clientY-(k?_.top-B.top+k.scrollTop:_.top)};(v==null?void 0:v(T,m))!==!1&&(C.value=T,E(m))},H=m=>{if(w(i.disabled)||!M(m)||!C.value)return;const S=w(a),k=w(o).getBoundingClientRect();let{x:B,y:_}=p.value;(l==="x"||l==="both")&&(B=m.clientX-C.value.x,S&&(B=Math.min(Math.max(0,B),S.scrollWidth-k.width))),(l==="y"||l==="both")&&(_=m.clientY-C.value.y,S&&(_=Math.min(Math.max(0,_),S.scrollHeight-k.height))),p.value={x:B,y:_},b==null||b(p.value,m),E(m)},A=m=>{w(i.disabled)||!M(m)||C.value&&(C.value=void 0,y==null||y(p.value,m),E(m))};if(W){const m={capture:(t=i.capture)!=null?t:!0};P(g,"pointerdown",$,m),P(f,"pointermove",H,m),P(f,"pointerup",A,m)}return{...te(p),position:p,isDragging:e.computed(()=>!!C.value),style:e.computed(()=>`left:${p.value.x}px;top:${p.value.y}px;`)}}function le(o,i,r={}){const{window:t=O,...c}=r;let s;const u=re(()=>t&&"ResizeObserver"in t),h=()=>{s&&(s.disconnect(),s=void 0)},b=e.computed(()=>Array.isArray(o)?o.map(d=>N(d)):[N(o)]),y=e.watch(b,d=>{if(h(),u.value&&t){s=new ResizeObserver(i);for(const l of d)l&&s.observe(l,c)}},{immediate:!0,flush:"post"}),v=()=>{h(),y()};return F(v),{isSupported:u,stop:v}}function R(o,i={width:0,height:0},r={}){const{window:t=O,box:c="content-box"}=r,s=e.computed(()=>{var d,l;return(l=(d=N(o))==null?void 0:d.namespaceURI)==null?void 0:l.includes("svg")}),u=e.ref(i.width),h=e.ref(i.height),{stop:b}=le(o,([d])=>{const l=c==="border-box"?d.borderBoxSize:c==="content-box"?d.contentBoxSize:d.devicePixelContentBoxSize;if(t&&s.value){const f=N(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},r);oe(()=>{const d=N(o);d&&(u.value="offsetWidth"in d?d.offsetWidth:i.width,h.value="offsetHeight"in d?d.offsetHeight:i.height)});const y=e.watch(()=>N(o),d=>{u.value=d?i.width:0,h.value=d?i.height:0});function v(){b(),y()}return{width:u,height:h,stop:v}}const se=o=>(e.pushScopeId("data-v-a1713ed1"),o=o(),e.popScopeId(),o),ae={class:"title text-16px font-bold"},ce={class:"action"},de=["form"],ue={key:2,class:"modal-loading"},fe=se(()=>e.createElementVNode("div",{class:"lds-ring"},[e.createElementVNode("div"),e.createElementVNode("div"),e.createElementVNode("div"),e.createElementVNode("div")],-1)),pe=[fe],me={name:"ModalContainer",inheritAttrs:!0},he=e.defineComponent({...me,props:{id:{},form:{},component:{},componentProps:{},width:{},height:{},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"},position:{default:"right"},type:{},offset:{},backgroundColor:{},bodyStyle:{},submitText:{default:"确定"},cancelText:{default:"取消"},zIndex:{default:1e3}},emits:["submit"],setup(o,{expose:i,emit:r}){e.useCssVars(n=>({"1c652152":n.zIndex}));const t=o,c=r,s=e.inject(V),u=e.ref(!1);let h=0,b=0;const y=e.shallowRef(),v=e.shallowRef(),d=e.shallowRef(),l=e.shallowRef(),f=e.shallowRef(),a=e.shallowRef(),{height:g}=R(y);R(v);const{height:p}=R(d,void 0,{box:"border-box"}),{height:C}=R(l,void 0,{box:"border-box"}),{height:M}=R(f),{height:E}=R(a),{x:$,y:H}=ie(d,{initialValue:{x:0,y:0}});function A(){s==null||s.close(t.id)}function m(n){return typeof n=="number"?`${n}px`:n}const S=e.computed(()=>{const n={};return t.mode==="dialog"&&(n.justifyContent="center"),t.mode==="drawer"&&(n.justifyContent={left:"flex-start",right:"flex-end",top:"flex-start",bottom:"flex-end"}[t.position],n.flexDirection={left:"row",right:"row",top:"column",bottom:"column"}[t.position]),n}),k=e.computed(()=>{const n={};return t.mode==="drawer"&&["top","bottom"].includes(t.position)?n.maxHeight=m(t.maxHeight):(n.width=m(t.sizes[t.size]),n.maxWidth=m(t.maxWidth)),t.width&&(n.width=m(t.width)),t.height&&(n.height=m(t.height)),t.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),t.draggable&&!t.fullscreen&&t.mode==="dialog"&&(n.transform=`translate3d(${$.value-h}px, ${H.value-b}px, 0px)`),t.mode==="drawer"&&(n.borderRadius=0,["left","right"].includes(t.position)?n.height="100%":n.width="100%"),t.offset&&t.mode==="dialog"&&(n.marginLeft=`${t.offset.x||0}px`,n.marginTop=`${t.offset.y||0}px`),t.backgroundColor&&(n.backgroundColor=t.backgroundColor),n}),B=e.computed(()=>{const n={};return t.draggable&&!t.fullscreen&&t.mode==="dialog"&&(n.cursor="move"),n}),_=e.computed(()=>{const n={},x=M.value+E.value+p.value+C.value,I=Math.floor(g.value*(Number(m(t.maxHeight).replace("%",""))/100));return t.maxHeight&&(n.maxHeight=`${I-x}px`),t.mode==="drawer"&&(n.maxHeight="unset",["left","right"].includes(t.position)&&(n.height=`${g.value-x}px`)),t.fullscreen&&(n.maxHeight="unset",n.height=`calc(100% - ${x}px)`),t.type!=="component"&&(n.padding="0"),t.bodyStyle&&Object.assign(n,t.bodyStyle),n});function T(){const n=v.value;if(t.form&&n){const x=n.querySelector(`form[name="${t.form}"]`);x&&x.dispatchEvent(new Event("submit"))}c("submit")}function K(){s==null||s.close(t.id)}function X(){window&&window.addEventListener("resize",()=>{e.triggerRef(y),e.triggerRef(v),v.value&&(h=v.value.offsetLeft,b=v.value.offsetTop)})}function Y(){if(t.closeable&&t.esc){const n=({key:x})=>{x==="Escape"&&(s==null||s.close(t.id),window.removeEventListener("keydown",n))};window.addEventListener("keydown",n)}}function q(){h=v.value.offsetLeft,b=v.value.offsetTop}e.onMounted(()=>{Y(),X()}),e.onUnmounted(()=>{});function U(){return u.value=!0,()=>D()}function D(){u.value=!1}return i({showLoading:U,hideLoading:D}),(n,x)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"wrapperRef",ref:y,class:"modal-wrapper",style:e.normalizeStyle(S.value),onClick:x[0]||(x[0]=e.withModifiers(I=>n.maskClosable&&A(),["self"]))},[e.createElementVNode("div",{ref_key:"contentRef",ref:v,class:e.normalizeClass(["modal-content",{[`${n.mode}-mode`]:!0,[`${n.position}-position`]:!0}]),style:e.normalizeStyle(k.value)},[n.header?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"headerRef",ref:d,class:"modal-header",style:e.normalizeStyle(B.value),onMousedown:q},[e.createElementVNode("div",ae,e.toDisplayString(n.title),1),e.createElementVNode("div",ce,[n.closeable?(e.openBlock(),e.createElementBlock("div",{key:0,class:"i-icon-park-outline:close block cursor-pointer",onClick:A})):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(_.value)},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n.component),e.normalizeProps(e.guardReactiveProps(n.componentProps)),null,16))],4),e.createElementVNode("div",{id:"modal-footer-slot",ref_key:"footerSlotRef",ref:a},null,512),n.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:K},e.toDisplayString(n.cancelText),1),e.createElementVNode("button",{class:"submit-button",form:n.form,type:"submit",onClick:T},e.toDisplayString(n.submitText),9,de)],512)):e.createCommentVNode("",!0),u.value?(e.openBlock(),e.createElementBlock("div",ue,pe)):e.createCommentVNode("",!0)],6)],4))}}),L=(o,i)=>{const r=o.__vccOpts||o;for(const[t,c]of i)r[t]=c;return r},j=L(he,[["__scopeId","data-v-a1713ed1"]]),ve={class:"modal-dialog"},ge={class:"dialog-body"},ye={class:"dialog-title"},we={class:"dialog-content"},be=e.defineComponent({__name:"modal-dialog",props:{type:{},title:{},content:{},okText:{default:"确定"},cancelText:{default:"取消"},onOk:{},onCancel:{},footer:{}},setup(o){const i=o,r=G(),t=e.computed(()=>i.title?i.title:{confirm:"提示",info:"提示",warning:"警告",error:"错误",success:"成功"}[i.type]);async function c(){i.onOk&&await i.onOk(),r.close()}async function s(){i.onCancel&&await i.onCancel(),r.close()}return(u,h)=>(e.openBlock(),e.createElementBlock("section",ve,[e.createElementVNode("div",ge,[e.createElementVNode("div",ye,e.toDisplayString(t.value),1),e.createElementVNode("div",we,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)]))}}),ke=L(be,[["__scopeId","data-v-8326e5a5"]]),Ce={key:0,class:"modal-teleport"},_e={name:"ModalProvider",inheritAttrs:!0},xe=e.defineComponent({..._e,props:{appendToBody:{type:[Boolean,String],default:!1},sizes:{default:()=>({small:"50%",middle:"70%",large:"90%"})},maxWidth:{default:"90%"},maxHeight:{default:"90%"},offset:{default:()=>({x:0,y:0})}},setup(o,{expose:i}){const r=e.shallowRef([]),t=e.ref(!1),c=e.getCurrentInstance();function s(l,f={},a={}){const g=e.defineAsyncComponent(()=>Promise.resolve(typeof l=="string"?ke: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),C=Object.assign({zIndex:typeof l=="string"?1100:1e3},a),M=new Promise((E,$)=>{r.value.push({id:p,component:g,props:f||{},options:{...C,type:typeof l=="string"?l:"component"},resolve:E,reject:$,listeners:[]}),e.triggerRef(r)}).catch(E=>E==="CANCEL"?new Promise(()=>{}):Promise.reject(E));return Object.assign(M,{close:()=>u(p)})}function u(l,f){const a=r.value.findIndex(p=>p.id===l);if(a<0)return;const g=r.value[a];f===void 0?g==null||g.reject("CANCEL"):g==null||g.resolve(f),r.value.splice(a,1),e.triggerRef(r)}function h(){!r.value||r.value.length===0||(r.value.forEach(l=>{l==null||l.reject("CANCEL")}),r.value=[],e.triggerRef(r))}function b(l,f){const a=r.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=r.value.find(p=>p.id===l);g&&g.listeners.push({event:f,callback:a})}return e.provide(V,{open:s,close:u,closeAll:h,addEventListener:d}),i({elements:r,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",Ce,[(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(r.value,a=>(e.openBlock(),e.createBlock(j,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:()=>b(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))}}),Ee=L(xe,[["__scopeId","data-v-756481fe"]]),Se={},Be={class:"modal-footer"};function Me(o,i){return e.openBlock(),e.createBlock(e.Teleport,{to:"#modal-footer-slot"},[e.createElementVNode("div",Be,[e.renderSlot(o.$slots,"default",{},void 0,!0)])])}const Ne=L(Se,[["render",Me],["__scopeId","data-v-2080a86e"]]),Re={},$e={class:"modal-header"};function Ve(o,i){return e.openBlock(),e.createBlock(e.Teleport,{to:"#modal-header-slot"},[e.createElementVNode("div",$e,[e.renderSlot(o.$slots,"default",{},void 0,!0)])])}const Le=L(Re,[["render",Ve],["__scopeId","data-v-d0247172"]]);function z(o,i){var t,c;let r=o==null?void 0:o.parent;for(;r&&((t=r==null?void 0:r.type)==null?void 0:t.name)!==i;)r=r.parent;return((c=r==null?void 0:r.type)==null?void 0:c.name)===i?r:null}function G(){const o=e.inject(V),i=e.getCurrentInstance();function r(t,c,s){if(!o)throw new Error("Not Found Modal Provider Component");return o.open(t,c,s)}return{open:r,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(V),r=e.getCurrentInstance(),t=z(r,"ModalContainer"),c=(s=t==null?void 0:t.props)==null?void 0:s.id;i&&c&&i.addEventListener(c,"submit",o)}exports.ModalContainer=j;exports.ModalFooter=Ne;exports.ModalHeader=Le;exports.ModalKey=V;exports.ModalProvider=Ee;exports.onSubmit=Ae;exports.useModal=G;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),V=Symbol("__MODAL__");function F(o){return e.getCurrentScope()?(e.onScopeDispose(o),!0):!1}function w(o){return typeof o=="function"?o():e.unref(o)}const W=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){return e.getCurrentInstance()}function te(o,i={}){if(!e.isRef(o))return e.toRefs(o);const r=Array.isArray(o.value)?Array.from({length:o.value.length}):{};for(const t in o.value)r[t]=e.customRef(()=>({get(){return o.value[t]},set(c){var s;if((s=w(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 r}function oe(o,i=!0,r){ee()?e.onMounted(o,r):i?o():e.nextTick(o)}function N(o){var i;const r=w(o);return(i=r==null?void 0:r.$el)!=null?i:r}const O=W?window:void 0;function P(...o){let i,r,t,c;if(typeof o[0]=="string"||Array.isArray(o[0])?([r,t,c]=o,i=O):[i,r,t,c]=o,!i)return Z;Array.isArray(r)||(r=[r]),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)),b=e.watch(()=>[N(i),w(c)],([v,d])=>{if(u(),!v)return;const l=Q(d)?{...d}:d;s.push(...r.flatMap(f=>t.map(a=>h(v,f,a,l))))},{immediate:!0,flush:"post"}),y=()=>{b(),u()};return F(y),y}function ne(){const o=e.ref(!1),i=e.getCurrentInstance();return i&&e.onMounted(()=>{o.value=!0},i),o}function re(o){const i=ne();return e.computed(()=>(i.value,!!o()))}function ie(o,i={}){var r,t;const{pointerTypes:c,preventDefault:s,stopPropagation:u,exact:h,onMove:b,onEnd:y,onStart:v,initialValue:d,axis:l="both",draggingElement:f=O,containerElement:a,handle:g=o}=i,p=e.ref((r=w(d))!=null?r:{x:0,y:0}),C=e.ref(),M=m=>c?c.includes(m.pointerType):!0,E=m=>{w(s)&&m.preventDefault(),w(u)&&m.stopPropagation()},$=m=>{var S;if(w(i.disabled)||!M(m)||w(h)&&m.target!==w(o))return;const k=w(a),B=(S=k==null?void 0:k.getBoundingClientRect)==null?void 0:S.call(k),_=w(o).getBoundingClientRect(),T={x:m.clientX-(k?_.left-B.left+k.scrollLeft:_.left),y:m.clientY-(k?_.top-B.top+k.scrollTop:_.top)};(v==null?void 0:v(T,m))!==!1&&(C.value=T,E(m))},H=m=>{if(w(i.disabled)||!M(m)||!C.value)return;const S=w(a),k=w(o).getBoundingClientRect();let{x:B,y:_}=p.value;(l==="x"||l==="both")&&(B=m.clientX-C.value.x,S&&(B=Math.min(Math.max(0,B),S.scrollWidth-k.width))),(l==="y"||l==="both")&&(_=m.clientY-C.value.y,S&&(_=Math.min(Math.max(0,_),S.scrollHeight-k.height))),p.value={x:B,y:_},b==null||b(p.value,m),E(m)},A=m=>{w(i.disabled)||!M(m)||C.value&&(C.value=void 0,y==null||y(p.value,m),E(m))};if(W){const m={capture:(t=i.capture)!=null?t:!0};P(g,"pointerdown",$,m),P(f,"pointermove",H,m),P(f,"pointerup",A,m)}return{...te(p),position:p,isDragging:e.computed(()=>!!C.value),style:e.computed(()=>`left:${p.value.x}px;top:${p.value.y}px;`)}}function le(o,i,r={}){const{window:t=O,...c}=r;let s;const u=re(()=>t&&"ResizeObserver"in t),h=()=>{s&&(s.disconnect(),s=void 0)},b=e.computed(()=>Array.isArray(o)?o.map(d=>N(d)):[N(o)]),y=e.watch(b,d=>{if(h(),u.value&&t){s=new ResizeObserver(i);for(const l of d)l&&s.observe(l,c)}},{immediate:!0,flush:"post"}),v=()=>{h(),y()};return F(v),{isSupported:u,stop:v}}function R(o,i={width:0,height:0},r={}){const{window:t=O,box:c="content-box"}=r,s=e.computed(()=>{var d,l;return(l=(d=N(o))==null?void 0:d.namespaceURI)==null?void 0:l.includes("svg")}),u=e.ref(i.width),h=e.ref(i.height),{stop:b}=le(o,([d])=>{const l=c==="border-box"?d.borderBoxSize:c==="content-box"?d.contentBoxSize:d.devicePixelContentBoxSize;if(t&&s.value){const f=N(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},r);oe(()=>{const d=N(o);d&&(u.value="offsetWidth"in d?d.offsetWidth:i.width,h.value="offsetHeight"in d?d.offsetHeight:i.height)});const y=e.watch(()=>N(o),d=>{u.value=d?i.width:0,h.value=d?i.height:0});function v(){b(),y()}return{width:u,height:h,stop:v}}const se=o=>(e.pushScopeId("data-v-8d442648"),o=o(),e.popScopeId(),o),ae={class:"title text-16px font-bold"},ce={class:"action"},de=["form"],ue={key:2,class:"modal-loading"},fe=se(()=>e.createElementVNode("div",{class:"lds-ring"},[e.createElementVNode("div"),e.createElementVNode("div"),e.createElementVNode("div"),e.createElementVNode("div")],-1)),pe=[fe],me={name:"ModalContainer",inheritAttrs:!0},he=e.defineComponent({...me,props:{id:{},form:{},component:{},componentProps:{},width:{},height:{},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"},position:{default:"right"},type:{},offset:{},backgroundColor:{},bodyStyle:{},submitText:{default:"确定"},cancelText:{default:"取消"},zIndex:{default:1e3}},emits:["submit"],setup(o,{expose:i,emit:r}){e.useCssVars(n=>({"8796093c":n.zIndex}));const t=o,c=r,s=e.inject(V),u=e.ref(!1);let h=0,b=0;const y=e.shallowRef(),v=e.shallowRef(),d=e.shallowRef(),l=e.shallowRef(),f=e.shallowRef(),a=e.shallowRef(),{height:g}=R(y);R(v);const{height:p}=R(d,void 0,{box:"border-box"}),{height:C}=R(l,void 0,{box:"border-box"}),{height:M}=R(f),{height:E}=R(a),{x:$,y:H}=ie(d,{initialValue:{x:0,y:0}});function A(){s==null||s.close(t.id)}function m(n){return typeof n=="number"?`${n}px`:n}const S=e.computed(()=>{const n={};return t.mode==="dialog"&&(n.justifyContent="center"),t.mode==="drawer"&&(n.justifyContent={left:"flex-start",right:"flex-end",top:"flex-start",bottom:"flex-end"}[t.position],n.flexDirection={left:"row",right:"row",top:"column",bottom:"column"}[t.position]),n}),k=e.computed(()=>{const n={};return t.mode==="drawer"&&["top","bottom"].includes(t.position)?n.maxHeight=m(t.maxHeight):(n.width=m(t.sizes[t.size]),n.maxWidth=m(t.maxWidth)),t.width&&(n.width=m(t.width)),t.height&&(n.height=m(t.height)),t.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),t.draggable&&!t.fullscreen&&t.mode==="dialog"&&(n.transform=`translate3d(${$.value-h}px, ${H.value-b}px, 0px)`),t.mode==="drawer"&&(n.borderRadius=0,["left","right"].includes(t.position)?n.height="100%":n.width="100%"),t.offset&&t.mode==="dialog"&&(n.marginLeft=`${t.offset.x||0}px`,n.marginTop=`${t.offset.y||0}px`),t.backgroundColor&&(n.backgroundColor=t.backgroundColor),n}),B=e.computed(()=>{const n={};return t.draggable&&!t.fullscreen&&t.mode==="dialog"&&(n.cursor="move"),n}),_=e.computed(()=>{const n={},x=M.value+E.value+p.value+C.value,I=Math.floor(g.value*(Number(m(t.maxHeight).replace("%",""))/100));return t.maxHeight&&(n.maxHeight=`${I-x}px`),t.mode==="drawer"&&(n.maxHeight="unset",["left","right"].includes(t.position)&&(n.height=`${g.value-x}px`)),t.fullscreen&&(n.maxHeight="unset",n.height=`calc(100% - ${x}px)`),t.type!=="component"&&(n.padding="0"),t.bodyStyle&&Object.assign(n,t.bodyStyle),n});function T(){const n=v.value;if(t.form&&n){const x=n.querySelector(`form[name="${t.form}"]`);x&&x.dispatchEvent(new Event("submit"))}c("submit")}function K(){s==null||s.close(t.id)}function X(){window&&window.addEventListener("resize",()=>{e.triggerRef(y),e.triggerRef(v),v.value&&(h=v.value.offsetLeft,b=v.value.offsetTop)})}function Y(){if(t.closeable&&t.esc){const n=({key:x})=>{x==="Escape"&&(s==null||s.close(t.id),window.removeEventListener("keydown",n))};window.addEventListener("keydown",n)}}function q(){h=v.value.offsetLeft,b=v.value.offsetTop}e.onMounted(()=>{Y(),X()}),e.onUnmounted(()=>{});function U(){return u.value=!0,()=>D()}function D(){u.value=!1}return i({showLoading:U,hideLoading:D}),(n,x)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"wrapperRef",ref:y,class:"modal-wrapper",style:e.normalizeStyle(S.value),onClick:x[0]||(x[0]=e.withModifiers(I=>n.maskClosable&&A(),["self"]))},[e.createElementVNode("div",{ref_key:"contentRef",ref:v,class:e.normalizeClass(["modal-content",{[`${n.mode}-mode`]:!0,[`${n.position}-position`]:!0}]),style:e.normalizeStyle(k.value)},[n.header?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"headerRef",ref:d,class:"modal-header",style:e.normalizeStyle(B.value),onMousedown:q},[e.createElementVNode("div",ae,e.toDisplayString(n.title),1),e.createElementVNode("div",ce,[n.closeable?(e.openBlock(),e.createElementBlock("div",{key:0,class:"i-icon-park-outline:close block cursor-pointer",onClick:A})):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(_.value)},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n.component),e.normalizeProps(e.guardReactiveProps(n.componentProps)),null,16))],4),e.createElementVNode("div",{id:"modal-footer-slot",ref_key:"footerSlotRef",ref:a},null,512),n.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:K},e.toDisplayString(n.cancelText),1),e.createElementVNode("button",{class:"submit-button",form:n.form,type:"submit",onClick:T},e.toDisplayString(n.submitText),9,de)],512)):e.createCommentVNode("",!0),u.value?(e.openBlock(),e.createElementBlock("div",ue,pe)):e.createCommentVNode("",!0)],6)],4))}}),L=(o,i)=>{const r=o.__vccOpts||o;for(const[t,c]of i)r[t]=c;return r},j=L(he,[["__scopeId","data-v-8d442648"]]),ve={class:"modal-dialog"},ge={class:"dialog-body"},ye={class:"dialog-title"},we={class:"dialog-content"},be=e.defineComponent({__name:"modal-dialog",props:{type:{},title:{},content:{},okText:{default:"确定"},cancelText:{default:"取消"},onOk:{},onCancel:{},footer:{}},setup(o){const i=o,r=G(),t=e.computed(()=>i.title?i.title:{confirm:"提示",info:"提示",warning:"警告",error:"错误",success:"成功"}[i.type]);async function c(){i.onOk&&await i.onOk(),r.close()}async function s(){i.onCancel&&await i.onCancel(),r.close()}return(u,h)=>(e.openBlock(),e.createElementBlock("section",ve,[e.createElementVNode("div",ge,[e.createElementVNode("div",ye,e.toDisplayString(t.value),1),e.createElementVNode("div",we,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)]))}}),ke=L(be,[["__scopeId","data-v-0c6b8db2"]]),Ce={key:0,class:"modal-teleport"},_e={name:"ModalProvider",inheritAttrs:!0},xe=e.defineComponent({..._e,props:{appendToBody:{type:[Boolean,String],default:!1},sizes:{default:()=>({small:"50%",middle:"70%",large:"90%"})},maxWidth:{default:"90%"},maxHeight:{default:"90%"},offset:{default:()=>({x:0,y:0})}},setup(o,{expose:i}){const r=e.shallowRef([]),t=e.ref(!1),c=e.getCurrentInstance();function s(l,f={},a={}){const g=e.defineAsyncComponent(()=>Promise.resolve(typeof l=="string"?ke: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),C=Object.assign({zIndex:typeof l=="string"?1100:1e3},a),M=new Promise((E,$)=>{r.value.push({id:p,component:g,props:f||{},options:{...C,type:typeof l=="string"?l:"component"},resolve:E,reject:$,listeners:[]}),e.triggerRef(r)}).catch(E=>E==="CANCEL"?new Promise(()=>{}):Promise.reject(E));return Object.assign(M,{close:()=>u(p)})}function u(l,f){const a=r.value.findIndex(p=>p.id===l);if(a<0)return;const g=r.value[a];f===void 0?g==null||g.reject("CANCEL"):g==null||g.resolve(f),r.value.splice(a,1),e.triggerRef(r)}function h(){!r.value||r.value.length===0||(r.value.forEach(l=>{l==null||l.reject("CANCEL")}),r.value=[],e.triggerRef(r))}function b(l,f){const a=r.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=r.value.find(p=>p.id===l);g&&g.listeners.push({event:f,callback:a})}return e.provide(V,{open:s,close:u,closeAll:h,addEventListener:d}),i({elements:r,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",Ce,[(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(r.value,a=>(e.openBlock(),e.createBlock(j,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:()=>b(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))}}),Ee=L(xe,[["__scopeId","data-v-756481fe"]]),Se={},Be={class:"modal-footer"};function Me(o,i){return e.openBlock(),e.createBlock(e.Teleport,{to:"#modal-footer-slot"},[e.createElementVNode("div",Be,[e.renderSlot(o.$slots,"default",{},void 0,!0)])])}const Ne=L(Se,[["render",Me],["__scopeId","data-v-46f8d703"]]),Re={},$e={class:"modal-header"};function Ve(o,i){return e.openBlock(),e.createBlock(e.Teleport,{to:"#modal-header-slot"},[e.createElementVNode("div",$e,[e.renderSlot(o.$slots,"default",{},void 0,!0)])])}const Le=L(Re,[["render",Ve],["__scopeId","data-v-d0247172"]]);function z(o,i){var t,c;let r=o==null?void 0:o.parent;for(;r&&((t=r==null?void 0:r.type)==null?void 0:t.name)!==i;)r=r.parent;return((c=r==null?void 0:r.type)==null?void 0:c.name)===i?r:null}function G(){const o=e.inject(V),i=e.getCurrentInstance();function r(t,c,s){if(!o)throw new Error("Not Found Modal Provider Component");return o.open(t,c,s)}return{open:r,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(V),r=e.getCurrentInstance(),t=z(r,"ModalContainer"),c=(s=t==null?void 0:t.props)==null?void 0:s.id;i&&c&&i.addEventListener(c,"submit",o)}exports.ModalContainer=j;exports.ModalFooter=Ne;exports.ModalHeader=Le;exports.ModalKey=V;exports.ModalProvider=Ee;exports.onSubmit=Ae;exports.useModal=G;
|
package/dist/es/index.mjs
CHANGED
|
@@ -197,7 +197,7 @@ function z(t, r = { width: 0, height: 0 }, n = {}) {
|
|
|
197
197
|
stop: m
|
|
198
198
|
};
|
|
199
199
|
}
|
|
200
|
-
const Xe = (t) => ($e("data-v-
|
|
200
|
+
const Xe = (t) => ($e("data-v-8d442648"), t = t(), Ee(), t), Ye = { class: "title text-16px font-bold" }, Ke = { class: "action" }, Ue = ["form"], qe = {
|
|
201
201
|
key: 2,
|
|
202
202
|
class: "modal-loading"
|
|
203
203
|
}, Je = /* @__PURE__ */ Xe(() => /* @__PURE__ */ g("div", { class: "lds-ring" }, [
|
|
@@ -244,7 +244,7 @@ const Xe = (t) => ($e("data-v-a1713ed1"), t = t(), Ee(), t), Ye = { class: "titl
|
|
|
244
244
|
emits: ["submit"],
|
|
245
245
|
setup(t, { expose: r, emit: n }) {
|
|
246
246
|
_e((o) => ({
|
|
247
|
-
"
|
|
247
|
+
"8796093c": o.zIndex
|
|
248
248
|
}));
|
|
249
249
|
const e = t, a = n, i = te(K), c = H(!1);
|
|
250
250
|
let h = 0, _ = 0;
|
|
@@ -395,7 +395,7 @@ const Xe = (t) => ($e("data-v-a1713ed1"), t = t(), Ee(), t), Ye = { class: "titl
|
|
|
395
395
|
for (const [e, a] of r)
|
|
396
396
|
n[e] = a;
|
|
397
397
|
return n;
|
|
398
|
-
}, tt = /* @__PURE__ */ V(et, [["__scopeId", "data-v-
|
|
398
|
+
}, tt = /* @__PURE__ */ V(et, [["__scopeId", "data-v-8d442648"]]), ot = { class: "modal-dialog" }, nt = { class: "dialog-body" }, rt = { class: "dialog-title" }, st = { class: "dialog-content" }, it = /* @__PURE__ */ ee({
|
|
399
399
|
__name: "modal-dialog",
|
|
400
400
|
props: {
|
|
401
401
|
type: {},
|
|
@@ -446,7 +446,7 @@ const Xe = (t) => ($e("data-v-a1713ed1"), t = t(), Ee(), t), Ye = { class: "titl
|
|
|
446
446
|
], 4)
|
|
447
447
|
]));
|
|
448
448
|
}
|
|
449
|
-
}), lt = /* @__PURE__ */ V(it, [["__scopeId", "data-v-
|
|
449
|
+
}), lt = /* @__PURE__ */ V(it, [["__scopeId", "data-v-0c6b8db2"]]), at = {
|
|
450
450
|
key: 0,
|
|
451
451
|
class: "modal-teleport"
|
|
452
452
|
}, dt = {
|
|
@@ -594,7 +594,7 @@ function pt(t, r) {
|
|
|
594
594
|
])
|
|
595
595
|
]);
|
|
596
596
|
}
|
|
597
|
-
const wt = /* @__PURE__ */ V(ut, [["render", pt], ["__scopeId", "data-v-
|
|
597
|
+
const wt = /* @__PURE__ */ V(ut, [["render", pt], ["__scopeId", "data-v-46f8d703"]]), ht = {}, mt = { class: "modal-header" };
|
|
598
598
|
function vt(t, r) {
|
|
599
599
|
return y(), N(ne, { to: "#modal-header-slot" }, [
|
|
600
600
|
g("div", mt, [
|
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-8d442648]{z-index:var(--8796093c);position:fixed;top:0;right:0;bottom:0;left:0;display:flex;align-items:center;background:#0000004d}.modal-content[data-v-8d442648]{background:#fff;border-radius:5px;position:relative}.modal-header[data-v-8d442648]{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-8d442648]{padding:10px;box-sizing:border-box;overflow:auto;position:relative}.modal-footer[data-v-8d442648]{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-8d442648]{height:32px;line-height:28px;min-width:80px;outline:none;border-color:transparent;font-size:14px;border-radius:4px;padding:0 10px;box-sizing:border-box}.modal-footer button.submit-button[data-v-8d442648]{color:#fff;background-color:rgb(var(--primary-6, 45, 106, 251))}.modal-footer button.submit-button[data-v-8d442648]:hover{background-color:rgb(var(--primary-5, 28, 76, 207))}.modal-footer button.submit-button[data-v-8d442648]:active{background-color:rgb(var(--primary-7, 14, 66, 210))}.modal-footer button.cancel-button[data-v-8d442648]{color:rgb(var(--color-text-2, 78, 89, 105));background-color:var(--color-fill-1, #f5f5f5)}.modal-footer button.cancel-button[data-v-8d442648]:hover{background-color:var(--color-fill-3, #e5e6eb)}.modal-footer button.cancel-button[data-v-8d442648]:active{background-color:var(--color-fill-4, #c9cdd4)}.modal-loading[data-v-8d442648]{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;justify-content:center;align-items:center;background-color:#0000001a}.modal-loading .lds-ring[data-v-8d442648]{display:inline-block;position:relative;width:80px;height:80px}.modal-loading .lds-ring div[data-v-8d442648]{box-sizing:border-box;display:block;position:absolute;width:48px;height:48px;margin:8px;border:5px solid #fff;border-radius:50%;animation:lds-ring-8d442648 1.2s cubic-bezier(.5,0,.5,1) infinite;border-color:#fff transparent transparent transparent}.modal-loading .lds-ring div[data-v-8d442648]:nth-child(1){animation-delay:-.45s}.modal-loading .lds-ring div[data-v-8d442648]:nth-child(2){animation-delay:-.3s}.modal-loading .lds-ring div[data-v-8d442648]:nth-child(3){animation-delay:-.15s}@keyframes lds-ring-8d442648{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.dialog-body[data-v-0c6b8db2]{padding:20px 10px 10px}.dialog-title[data-v-0c6b8db2]{padding:5px;font-weight:700;font-size:16px}.dialog-content[data-v-0c6b8db2]{padding:5px}.dialog-footer[data-v-0c6b8db2]{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-0c6b8db2]{height:32px;line-height:28px;min-width:80px;outline:none;border-color:transparent;font-size:14px;border-radius:4px;padding:0;box-sizing:border-box}.dialog-footer button.submit-button[data-v-0c6b8db2]{color:#fff;background-color:rgb(var(--primary-6, 45, 106, 251))}.dialog-footer button.submit-button[data-v-0c6b8db2]:hover{background-color:rgb(var(--primary-5, 28, 76, 207))}.dialog-footer button.submit-button[data-v-0c6b8db2]:active{background-color:rgb(var(--primary-7, 14, 66, 210))}.dialog-footer button.cancel-button[data-v-0c6b8db2]{color:rgb(var(--color-text-2, 78, 89, 105));background-color:var(--color-fill-1, #f5f5f5)}.dialog-footer button.cancel-button[data-v-0c6b8db2]:hover{background-color:var(--color-fill-4, #c9cdd4)}.modal-fade-enter-active[data-v-756481fe],.modal-fade-leave-active[data-v-756481fe]{transition:opacity .5s ease}.modal-fade-enter-active[data-v-756481fe] .modal-content.drawer-mode,.modal-fade-leave-active[data-v-756481fe] .modal-content.drawer-mode{transition:transform .5s ease}.modal-fade-enter-from[data-v-756481fe],.modal-fade-leave-to[data-v-756481fe]{opacity:0}.modal-fade-enter-from[data-v-756481fe] .modal-content.drawer-mode.left-position,.modal-fade-leave-to[data-v-756481fe] .modal-content.drawer-mode.left-position{transform:translate3d(-100%,0,0)}.modal-fade-enter-from[data-v-756481fe] .modal-content.drawer-mode.right-position,.modal-fade-leave-to[data-v-756481fe] .modal-content.drawer-mode.right-position{transform:translate3d(100%,0,0)}.modal-fade-enter-from[data-v-756481fe] .modal-content.drawer-mode.top-position,.modal-fade-leave-to[data-v-756481fe] .modal-content.drawer-mode.top-position{transform:translate3d(0,-100%,0)}.modal-fade-enter-from[data-v-756481fe] .modal-content.drawer-mode.bottom-position,.modal-fade-leave-to[data-v-756481fe] .modal-content.drawer-mode.bottom-position{transform:translate3d(0,100%,0)}.modal-footer[data-v-46f8d703]{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-46f8d703]{height:32px;line-height:28px;min-width:80px;outline:none;border-color:transparent;font-size:14px;border-radius:4px;padding:0;box-sizing:border-box}.modal-footer button.submit-button[data-v-46f8d703]{color:#fff;background-color:rgb(var(--primary-6, 45, 106, 251))}.modal-footer button.submit-button[data-v-46f8d703]:hover{background-color:rgb(var(--primary-5, 28, 76, 207))}.modal-footer button.submit-button[data-v-46f8d703]:active{background-color:rgb(var(--primary-7, 14, 66, 210))}.modal-footer button.cancel-button[data-v-46f8d703]{color:rgb(var(--color-text-2, 78, 89, 105));background-color:var(--color-fill-1, #f5f5f5)}.modal-footer button.cancel-button[data-v-46f8d703]:hover{background-color:var(--color-fill-3, #e5e6eb)}.modal-footer button.cancel-button[data-v-46f8d703]:active{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)}
|