@gopowerteam/modal-render 0.0.1 → 0.0.2

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/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue");const M=Symbol("__MODAL__");function W(o){return e.getCurrentScope()?(e.onScopeDispose(o),!0):!1}function _(o){return typeof o=="function"?o():e.unref(o)}const V=typeof window<"u"&&typeof document<"u",D=Object.prototype.toString,R=o=>D.call(o)==="[object Object]",T=()=>{};function F(o,i={}){if(!e.isRef(o))return e.toRefs(o);const t=Array.isArray(o.value)?Array.from({length:o.value.length}):{};for(const n in o.value)t[n]=e.customRef(()=>({get(){return o.value[n]},set(r){var d;if((d=_(i.replaceRef))!=null?d:!0)if(Array.isArray(o.value)){const m=[...o.value];m[n]=r,o.value=m}else{const m={...o.value,[n]:r};Object.setPrototypeOf(m,Object.getPrototypeOf(o.value)),o.value=m}else o.value[n]=r}}));return t}function H(o){var i;const t=_(o);return(i=t==null?void 0:t.$el)!=null?i:t}const z=V?window:void 0;function A(...o){let i,t,n,r;if(typeof o[0]=="string"||Array.isArray(o[0])?([t,n,r]=o,i=z):[i,t,n,r]=o,!i)return T;Array.isArray(t)||(t=[t]),Array.isArray(n)||(n=[n]);const d=[],y=()=>{d.forEach(f=>f()),d.length=0},m=(f,s,u,v)=>(f.addEventListener(s,u,v),()=>f.removeEventListener(s,u,v)),p=e.watch(()=>[H(i),_(r)],([f,s])=>{if(y(),!f)return;const u=R(s)?{...s}:s;d.push(...t.flatMap(v=>n.map(k=>m(f,v,k,u))))},{immediate:!0,flush:"post"}),c=()=>{p(),y()};return W(c),c}function I(o,i={}){var t,n;const{pointerTypes:r,preventDefault:d,stopPropagation:y,exact:m,onMove:p,onEnd:c,onStart:f,initialValue:s,axis:u="both",draggingElement:v=z,containerElement:k,handle:S=o}=i,g=e.ref((t=_(s))!=null?t:{x:0,y:0}),b=e.ref(),E=a=>r?r.includes(a.pointerType):!0,C=a=>{_(d)&&a.preventDefault(),_(y)&&a.stopPropagation()},x=a=>{var w;if(!E(a)||_(m)&&a.target!==_(o))return;const N=((w=_(k))!=null?w:_(o)).getBoundingClientRect(),O={x:a.clientX-N.left,y:a.clientY-N.top};(f==null?void 0:f(O,a))!==!1&&(b.value=O,C(a))},l=a=>{if(!E(a)||!b.value)return;let{x:w,y:B}=g.value;(u==="x"||u==="both")&&(w=a.clientX-b.value.x),(u==="y"||u==="both")&&(B=a.clientY-b.value.y),g.value={x:w,y:B},p==null||p(g.value,a),C(a)},h=a=>{E(a)&&b.value&&(b.value=void 0,c==null||c(g.value,a),C(a))};if(V){const a={capture:(n=i.capture)!=null?n:!0};A(S,"pointerdown",x,a),A(v,"pointermove",l,a),A(v,"pointerup",h,a)}return{...F(g),position:g,isDragging:e.computed(()=>!!b.value),style:e.computed(()=>`left:${g.value.x}px;top:${g.value.y}px;`)}}const X={class:"modal-container"},Y={class:"title font-bold"},K={class:"action"},q={key:1,class:"modal-footer space-x-2"},G=["form"],J={name:"ModalContainer",inheritAttrs:!0},Q=e.defineComponent({...J,props:{id:{},formId:{},component:{},componentProps:{},width:{},maxWidth:{},maxHeight:{},sizes:{},size:{default:"middle"},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}},emits:["submit"],setup(o,{emit:i}){const t=o,n=i,r=e.inject(M);let d=0,y=0;const m=e.shallowRef(),p=e.shallowRef(),{x:c,y:f}=I(p,{initialValue:{x:0,y:0}});function s(){r==null||r.close(t.id)}function u(l){if(typeof l=="number")return`${l}px`;if(typeof l=="string")return l}const v=e.computed(()=>{const l={};return t.size&&(l.width=u(t.sizes[t.size])),t.width&&(l.width=u(t.width)),t.maxWidth&&(l.maxWidth=u(t.maxWidth)),t.draggable&&(l.transform=`translate(${c.value-d}px, ${f.value-y}px)`),l}),k=e.computed(()=>{const l={};return t.draggable&&(l.cursor="move"),l}),S=e.computed(()=>{var h;const l={};return t.maxHeight&&(l.maxHeight=`calc(${(h=u(t.maxWidth))==null?void 0:h.replace("%","vh")} - 50px)`),l});function g(){n("submit")}function b(){r==null||r.close(t.id)}function E(){window&&window.addEventListener("resize",()=>{e.triggerRef(m),e.triggerRef(p),d=p.value.offsetLeft,y=p.value.offsetTop})}function C(){if(t.closeable&&t.esc){const l=({key:h})=>{h==="Escape"&&(r==null||r.close(t.id),window.removeEventListener("keydown",l))};window.addEventListener("keydown",l)}}function x(){new MutationObserver(h=>{h.forEach(a=>{const w=p.value.offsetLeft,B=p.value.offsetTop;w!==d&&(d=w),B!==y&&(y=w)})}).observe(p.value,{attributes:!0,attributeFilter:["style","offsetHeight","offsetWidth","clientHeight","clientWidth"],attributeOldValue:!0})}return e.onMounted(()=>{C(),x(),E()}),(l,h)=>(e.openBlock(),e.createElementBlock("div",X,[e.createElementVNode("div",{ref_key:"wrapperRef",ref:m,class:"modal-wrapper",onClick:h[0]||(h[0]=e.withModifiers(a=>l.maskClosable&&s(),["self"]))},[e.createElementVNode("div",{ref_key:"contentRef",ref:p,class:"modal-content",style:e.normalizeStyle(v.value)},[l.header?(e.openBlock(),e.createElementBlock("div",{key:0,ref:"",class:"modal-header",style:e.normalizeStyle(k.value)},[e.createElementVNode("div",Y,e.toDisplayString(l.title),1),e.createElementVNode("div",K,[l.closeable?(e.openBlock(),e.createElementBlock("div",{key:0,class:"i-icon-park-outline:close block cursor-pointer",onClick:s})):e.createCommentVNode("",!0)])],4)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"modal-body",style:e.normalizeStyle(S.value)},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(l.component),e.normalizeProps(e.guardReactiveProps(l.componentProps)),null,16))],4),l.footer?(e.openBlock(),e.createElementBlock("div",q,[e.createElementVNode("button",{class:"submit-button",form:l.formId,type:"submit",onClick:g}," 确定 ",8,G),e.createElementVNode("button",{class:"cancel-button",type:"button",onClick:b}," 取消 ")])):e.createCommentVNode("",!0)],4)],512)]))}});const L=(o,i)=>{const t=o.__vccOpts||o;for(const[n,r]of i)t[n]=r;return t},$=L(Q,[["__scopeId","data-v-16717585"]]),U={key:0,class:"modal-teleport"},Z={name:"ModalProvider",inheritAttrs:!0},j=e.defineComponent({...Z,props:{appendToBody:{type:Boolean,default:!1},sizes:{default:()=>({small:520,middle:860,large:1190})},maxWidth:{default:"80%"},maxHeight:{default:"80%"}},setup(o,{expose:i}){const t=e.shallowRef([]),n=e.ref(!1);async function r(c,f,s){const u=e.defineAsyncComponent(()=>Promise.resolve(c));return new Promise(v=>{t.value.push({id:Math.random().toString(32).slice(2),component:u,props:f,options:s,resolve:v,onSubmit:e.ref(()=>{})}),e.triggerRef(t)})}function d(c,f){const s=t.value.findIndex(v=>v.id===c);if(s<0)return;const u=t.value[s];u==null||u.resolve(f),t.value.splice(s,1),e.triggerRef(t)}function y(){t.value.forEach(c=>{c.resolve()}),t.value=[],e.triggerRef(t)}function m(c){return t.value.find(f=>f.id===c)}function p(c,f){const s=t.value.find(u=>u.id===c);s&&(s.onSubmit.value=f)}return e.provide(M,{open:r,close:d,closeAll:y,getElement:m,addSubmitListener:p}),i({elements:t}),e.onMounted(()=>{n.value=!0}),(c,f)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.renderSlot(c.$slots,"default",{},void 0,!0),n.value?(e.openBlock(),e.createElementBlock("div",U,[(e.openBlock(),e.createBlock(e.Teleport,{disabled:!c.appendToBody,to:"body"},[e.createVNode(e.TransitionGroup,{name:"modal-fade"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.value,s=>(e.openBlock(),e.createBlock($,e.mergeProps({id:s.id,key:s.id,component:s.component,"component-props":s.props,"max-height":c.maxHeight,"max-width":c.maxWidth,sizes:c.sizes},s.options,{onSubmit:s.onSubmit.value}),null,16,["id","component","component-props","max-height","max-width","sizes","onSubmit"]))),128))]),_:1})],8,["disabled"]))])):e.createCommentVNode("",!0)],64))}});const ee=L(j,[["__scopeId","data-v-171d9bdd"]]);function P(o,i){var n,r;let t=o==null?void 0:o.parent;for(;t&&((n=t==null?void 0:t.type)==null?void 0:n.name)!==i;)t=t.parent;return((r=t==null?void 0:t.type)==null?void 0:r.name)===i?t:null}function te(){const o=e.inject(M),i=e.getCurrentInstance();return{open(t,n,r){if(!o)throw new Error("Not Found Modal Provider Component");return o.open(t,n||{},r||{})},close(t){var d;if(!o)throw new Error("Not Found Modal Provider Component");const n=P(i,"ModalContainer"),r=(d=n==null?void 0:n.props)==null?void 0:d.id;if(!r)throw new Error("Not Found Current Modal Container");o.close(r,t)},closeAll(){if(!o)throw new Error("Not Found Modal Provider Component");o.closeAll()},onSubmit(t){const n=P(i,"ModalContainer");if(!(n==null?void 0:n.props.id))throw new Error("Not Found Current Modal Container")}}}function oe(o){var d;const i=e.inject(M),t=e.getCurrentInstance(),n=P(t,"ModalContainer"),r=(d=n==null?void 0:n.props)==null?void 0:d.id;i&&r&&i.addSubmitListener(r,o)}exports.ModalContainer=$;exports.ModalProvider=ee;exports.onSubmit=oe;exports.useModal=te;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue");const B=Symbol("__MODAL__");function R(o){return e.getCurrentScope()?(e.onScopeDispose(o),!0):!1}function g(o){return typeof o=="function"?o():e.unref(o)}const V=typeof window<"u"&&typeof document<"u",W=Object.prototype.toString,D=o=>W.call(o)==="[object Object]",T=()=>{};function F(o,a={}){if(!e.isRef(o))return e.toRefs(o);const t=Array.isArray(o.value)?Array.from({length:o.value.length}):{};for(const n in o.value)t[n]=e.customRef(()=>({get(){return o.value[n]},set(r){var u;if((u=g(a.replaceRef))!=null?u:!0)if(Array.isArray(o.value)){const p=[...o.value];p[n]=r,o.value=p}else{const p={...o.value,[n]:r};Object.setPrototypeOf(p,Object.getPrototypeOf(o.value)),o.value=p}else o.value[n]=r}}));return t}function H(o){var a;const t=g(o);return(a=t==null?void 0:t.$el)!=null?a:t}const z=V?window:void 0;function A(...o){let a,t,n,r;if(typeof o[0]=="string"||Array.isArray(o[0])?([t,n,r]=o,a=z):[a,t,n,r]=o,!a)return T;Array.isArray(t)||(t=[t]),Array.isArray(n)||(n=[n]);const u=[],v=()=>{u.forEach(d=>d()),u.length=0},p=(d,c,f,m)=>(d.addEventListener(c,f,m),()=>d.removeEventListener(c,f,m)),_=e.watch(()=>[H(a),g(r)],([d,c])=>{if(v(),!d)return;const f=D(c)?{...c}:c;u.push(...t.flatMap(m=>n.map(w=>p(d,m,w,f))))},{immediate:!0,flush:"post"}),s=()=>{_(),v()};return R(s),s}function I(o,a={}){var t,n;const{pointerTypes:r,preventDefault:u,stopPropagation:v,exact:p,onMove:_,onEnd:s,onStart:d,initialValue:c,axis:f="both",draggingElement:m=z,containerElement:w,handle:M=o}=a,y=e.ref((t=g(c))!=null?t:{x:0,y:0}),b=e.ref(),k=l=>r?r.includes(l.pointerType):!0,E=l=>{g(u)&&l.preventDefault(),g(v)&&l.stopPropagation()},S=l=>{var h;if(!k(l)||g(p)&&l.target!==g(o))return;const N=((h=g(w))!=null?h:g(o)).getBoundingClientRect(),O={x:l.clientX-N.left,y:l.clientY-N.top};(d==null?void 0:d(O,l))!==!1&&(b.value=O,E(l))},x=l=>{if(!k(l)||!b.value)return;let{x:h,y:C}=y.value;(f==="x"||f==="both")&&(h=l.clientX-b.value.x),(f==="y"||f==="both")&&(C=l.clientY-b.value.y),y.value={x:h,y:C},_==null||_(y.value,l),E(l)},i=l=>{k(l)&&b.value&&(b.value=void 0,s==null||s(y.value,l),E(l))};if(V){const l={capture:(n=a.capture)!=null?n:!0};A(M,"pointerdown",S,l),A(m,"pointermove",x,l),A(m,"pointerup",i,l)}return{...F(y),position:y,isDragging:e.computed(()=>!!b.value),style:e.computed(()=>`left:${y.value.x}px;top:${y.value.y}px;`)}}const X={class:"modal-container"},Y={class:"title font-bold"},K={class:"action"},q={key:1,class:"modal-footer space-x-2"},G=["form"],U={name:"ModalContainer",inheritAttrs:!0},J=e.defineComponent({...U,props:{id:{},formId:{},component:{},componentProps:{},width:{},maxWidth:{},maxHeight:{},sizes:{},size:{default:"middle"},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}},emits:["submit"],setup(o,{emit:a}){const t=o,n=a,r=e.inject(B);let u=0,v=0,p;const _=e.shallowRef(),s=e.shallowRef(),{x:d,y:c}=I(s,{initialValue:{x:0,y:0}});function f(){r==null||r.close(t.id)}function m(i){if(typeof i=="number")return`${i}px`;if(typeof i=="string")return i}const w=e.computed(()=>{const i={};return t.size&&(i.width=m(t.sizes[t.size])),t.width&&(i.width=m(t.width)),t.maxWidth&&(i.maxWidth=m(t.maxWidth)),t.draggable&&(i.transform=`translate(${d.value-u}px, ${c.value-v}px)`),i}),M=e.computed(()=>{const i={};return t.draggable&&(i.cursor="move"),i}),y=e.computed(()=>{var l;const i={};return t.maxHeight&&(i.maxHeight=`calc(${(l=m(t.maxWidth))==null?void 0:l.replace("%","vh")} - 50px)`),i});function b(){n("submit")}function k(){r==null||r.close(t.id)}function E(){window&&window.addEventListener("resize",()=>{e.triggerRef(_),e.triggerRef(s),u=s.value.offsetLeft,v=s.value.offsetTop})}function S(){if(t.closeable&&t.esc){const i=({key:l})=>{l==="Escape"&&(r==null||r.close(t.id),window.removeEventListener("keydown",i))};window.addEventListener("keydown",i)}}function x(){p=new MutationObserver(i=>{i.forEach(l=>{const h=s.value.offsetLeft,C=s.value.offsetTop;h!==u&&(u=h),C!==v&&(v=h)})}),p.observe(s.value,{attributes:!0,attributeFilter:["style","offsetHeight","offsetWidth","clientHeight","clientWidth"],attributeOldValue:!0})}return e.onMounted(()=>{S(),x(),E()}),e.onUnmounted(()=>{p&&(p.disconnect(),p.takeRecords())}),(i,l)=>(e.openBlock(),e.createElementBlock("div",X,[e.createElementVNode("div",{ref_key:"wrapperRef",ref:_,class:"modal-wrapper",onClick:l[0]||(l[0]=e.withModifiers(h=>i.maskClosable&&f(),["self"]))},[e.createElementVNode("div",{ref_key:"contentRef",ref:s,class:"modal-content",style:e.normalizeStyle(w.value)},[i.header?(e.openBlock(),e.createElementBlock("div",{key:0,ref:"",class:"modal-header",style:e.normalizeStyle(M.value)},[e.createElementVNode("div",Y,e.toDisplayString(i.title),1),e.createElementVNode("div",K,[i.closeable?(e.openBlock(),e.createElementBlock("div",{key:0,class:"i-icon-park-outline:close block cursor-pointer",onClick:f})):e.createCommentVNode("",!0)])],4)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"modal-body",style:e.normalizeStyle(y.value)},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(i.component),e.normalizeProps(e.guardReactiveProps(i.componentProps)),null,16))],4),i.footer?(e.openBlock(),e.createElementBlock("div",q,[e.createElementVNode("button",{class:"submit-button",form:i.formId,type:"submit",onClick:b}," 确定 ",8,G),e.createElementVNode("button",{class:"cancel-button",type:"button",onClick:k}," 取消 ")])):e.createCommentVNode("",!0)],4)],512)]))}});const L=(o,a)=>{const t=o.__vccOpts||o;for(const[n,r]of a)t[n]=r;return t},$=L(J,[["__scopeId","data-v-e6f6653f"]]),Q={key:0,class:"modal-teleport"},Z={name:"ModalProvider",inheritAttrs:!0},j=e.defineComponent({...Z,props:{appendToBody:{type:Boolean,default:!1},sizes:{default:()=>({small:520,middle:860,large:1190})},maxWidth:{default:"80%"},maxHeight:{default:"80%"}},setup(o,{expose:a}){const t=e.shallowRef([]),n=e.ref(!1);async function r(s,d,c){const f=e.defineAsyncComponent(()=>Promise.resolve(s));return new Promise(m=>{t.value.push({id:Math.random().toString(32).slice(2),component:f,props:d,options:c,resolve:m,onSubmit:e.ref(()=>{})}),e.triggerRef(t)})}function u(s,d){const c=t.value.findIndex(m=>m.id===s);if(c<0)return;const f=t.value[c];f==null||f.resolve(d),t.value.splice(c,1),e.triggerRef(t)}function v(){t.value.forEach(s=>{s.resolve()}),t.value=[],e.triggerRef(t)}function p(s){return t.value.find(d=>d.id===s)}function _(s,d){const c=t.value.find(f=>f.id===s);c&&(c.onSubmit.value=d)}return e.provide(B,{open:r,close:u,closeAll:v,getElement:p,addSubmitListener:_}),a({elements:t}),e.onMounted(()=>{n.value=!0}),(s,d)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.renderSlot(s.$slots,"default",{},void 0,!0),n.value?(e.openBlock(),e.createElementBlock("div",Q,[(e.openBlock(),e.createBlock(e.Teleport,{disabled:!s.appendToBody,to:"body"},[e.createVNode(e.TransitionGroup,{name:"modal-fade"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.value,c=>(e.openBlock(),e.createBlock($,e.mergeProps({id:c.id,key:c.id,component:c.component,"component-props":c.props,"max-height":s.maxHeight,"max-width":s.maxWidth,sizes:s.sizes},c.options,{onSubmit:c.onSubmit.value}),null,16,["id","component","component-props","max-height","max-width","sizes","onSubmit"]))),128))]),_:1})],8,["disabled"]))])):e.createCommentVNode("",!0)],64))}});const ee=L(j,[["__scopeId","data-v-171d9bdd"]]);function P(o,a){var n,r;let t=o==null?void 0:o.parent;for(;t&&((n=t==null?void 0:t.type)==null?void 0:n.name)!==a;)t=t.parent;return((r=t==null?void 0:t.type)==null?void 0:r.name)===a?t:null}function te(){const o=e.inject(B),a=e.getCurrentInstance();return{open(t,n,r){if(!o)throw new Error("Not Found Modal Provider Component");return o.open(t,n||{},r||{})},close(t){var u;if(!o)throw new Error("Not Found Modal Provider Component");const n=P(a,"ModalContainer"),r=(u=n==null?void 0:n.props)==null?void 0:u.id;if(!r)throw new Error("Not Found Current Modal Container");o.close(r,t)},closeAll(){if(!o)throw new Error("Not Found Modal Provider Component");o.closeAll()},onSubmit(t){const n=P(a,"ModalContainer");if(!(n==null?void 0:n.props.id))throw new Error("Not Found Current Modal Container")}}}function oe(o){var u;const a=e.inject(B),t=e.getCurrentInstance(),n=P(t,"ModalContainer"),r=(u=n==null?void 0:n.props)==null?void 0:u.id;a&&r&&a.addSubmitListener(r,o)}exports.ModalContainer=$;exports.ModalProvider=ee;exports.onSubmit=oe;exports.useModal=te;
package/dist/index.js CHANGED
@@ -1,15 +1,15 @@
1
- import { unref as Q, isRef as U, toRefs as Z, customRef as j, getCurrentScope as ee, onScopeDispose as te, ref as z, computed as A, watch as ne, defineComponent as X, inject as V, shallowRef as H, onMounted as Y, openBlock as g, createElementBlock as x, createElementVNode as C, withModifiers as oe, normalizeStyle as W, toDisplayString as re, createCommentVNode as O, createBlock as N, resolveDynamicComponent as ie, normalizeProps as se, guardReactiveProps as le, triggerRef as P, provide as ae, Fragment as R, renderSlot as ue, Teleport as ce, createVNode as de, TransitionGroup as fe, withCtx as pe, renderList as ve, mergeProps as me, defineAsyncComponent as ye, getCurrentInstance as K } from "vue";
2
- const B = Symbol("__MODAL__");
3
- function he(t) {
1
+ import { unref as J, isRef as Q, toRefs as Z, customRef as j, getCurrentScope as ee, onScopeDispose as te, ref as O, computed as k, watch as ne, defineComponent as X, inject as V, shallowRef as H, onMounted as Y, onUnmounted as oe, openBlock as _, createElementBlock as C, createElementVNode as w, withModifiers as re, normalizeStyle as W, toDisplayString as ie, createCommentVNode as P, createBlock as N, resolveDynamicComponent as se, normalizeProps as le, guardReactiveProps as ae, triggerRef as A, provide as ue, Fragment as R, renderSlot as ce, Teleport as de, createVNode as fe, TransitionGroup as pe, withCtx as ve, renderList as me, mergeProps as ye, defineAsyncComponent as he, getCurrentInstance as K } from "vue";
2
+ const z = Symbol("__MODAL__");
3
+ function _e(t) {
4
4
  return ee() ? (te(t), !0) : !1;
5
5
  }
6
- function _(t) {
7
- return typeof t == "function" ? t() : Q(t);
6
+ function h(t) {
7
+ return typeof t == "function" ? t() : J(t);
8
8
  }
9
- const G = typeof window < "u" && typeof document < "u", _e = Object.prototype.toString, ge = (t) => _e.call(t) === "[object Object]", be = () => {
9
+ const G = typeof window < "u" && typeof document < "u", ge = Object.prototype.toString, be = (t) => ge.call(t) === "[object Object]", we = () => {
10
10
  };
11
- function we(t, i = {}) {
12
- if (!U(t))
11
+ function Ce(t, l = {}) {
12
+ if (!Q(t))
13
13
  return Z(t);
14
14
  const e = Array.isArray(t.value) ? Array.from({ length: t.value.length }) : {};
15
15
  for (const n in t.value)
@@ -18,14 +18,14 @@ function we(t, i = {}) {
18
18
  return t.value[n];
19
19
  },
20
20
  set(o) {
21
- var c;
22
- if ((c = _(i.replaceRef)) != null ? c : !0)
21
+ var u;
22
+ if ((u = h(l.replaceRef)) != null ? u : !0)
23
23
  if (Array.isArray(t.value)) {
24
- const p = [...t.value];
25
- p[n] = o, t.value = p;
24
+ const f = [...t.value];
25
+ f[n] = o, t.value = f;
26
26
  } else {
27
- const p = { ...t.value, [n]: o };
28
- Object.setPrototypeOf(p, Object.getPrototypeOf(t.value)), t.value = p;
27
+ const f = { ...t.value, [n]: o };
28
+ Object.setPrototypeOf(f, Object.getPrototypeOf(t.value)), t.value = f;
29
29
  }
30
30
  else
31
31
  t.value[n] = o;
@@ -33,95 +33,95 @@ function we(t, i = {}) {
33
33
  }));
34
34
  return e;
35
35
  }
36
- function Ce(t) {
37
- var i;
38
- const e = _(t);
39
- return (i = e == null ? void 0 : e.$el) != null ? i : e;
36
+ function xe(t) {
37
+ var l;
38
+ const e = h(t);
39
+ return (l = e == null ? void 0 : e.$el) != null ? l : e;
40
40
  }
41
- const q = G ? window : void 0;
41
+ const U = G ? window : void 0;
42
42
  function D(...t) {
43
- let i, e, n, o;
44
- if (typeof t[0] == "string" || Array.isArray(t[0]) ? ([e, n, o] = t, i = q) : [i, e, n, o] = t, !i)
45
- return be;
43
+ let l, e, n, o;
44
+ if (typeof t[0] == "string" || Array.isArray(t[0]) ? ([e, n, o] = t, l = U) : [l, e, n, o] = t, !l)
45
+ return we;
46
46
  Array.isArray(e) || (e = [e]), Array.isArray(n) || (n = [n]);
47
- const c = [], m = () => {
48
- c.forEach((d) => d()), c.length = 0;
49
- }, p = (d, s, u, v) => (d.addEventListener(s, u, v), () => d.removeEventListener(s, u, v)), f = ne(
50
- () => [Ce(i), _(o)],
51
- ([d, s]) => {
52
- if (m(), !d)
47
+ const u = [], v = () => {
48
+ u.forEach((c) => c()), u.length = 0;
49
+ }, f = (c, a, d, p) => (c.addEventListener(a, d, p), () => c.removeEventListener(a, d, p)), g = ne(
50
+ () => [xe(l), h(o)],
51
+ ([c, a]) => {
52
+ if (v(), !c)
53
53
  return;
54
- const u = ge(s) ? { ...s } : s;
55
- c.push(
56
- ...e.flatMap((v) => n.map((E) => p(d, v, E, u)))
54
+ const d = be(a) ? { ...a } : a;
55
+ u.push(
56
+ ...e.flatMap((p) => n.map((x) => f(c, p, x, d)))
57
57
  );
58
58
  },
59
59
  { immediate: !0, flush: "post" }
60
- ), a = () => {
61
- f(), m();
60
+ ), s = () => {
61
+ g(), v();
62
62
  };
63
- return he(a), a;
63
+ return _e(s), s;
64
64
  }
65
- function xe(t, i = {}) {
65
+ function Ee(t, l = {}) {
66
66
  var e, n;
67
67
  const {
68
68
  pointerTypes: o,
69
- preventDefault: c,
70
- stopPropagation: m,
71
- exact: p,
72
- onMove: f,
73
- onEnd: a,
74
- onStart: d,
75
- initialValue: s,
76
- axis: u = "both",
77
- draggingElement: v = q,
78
- containerElement: E,
79
- handle: $ = t
80
- } = i, h = z(
81
- (e = _(s)) != null ? e : { x: 0, y: 0 }
82
- ), b = z(), M = (l) => o ? o.includes(l.pointerType) : !0, S = (l) => {
83
- _(c) && l.preventDefault(), _(m) && l.stopPropagation();
84
- }, L = (l) => {
85
- var w;
86
- if (!M(l) || _(p) && l.target !== _(t))
69
+ preventDefault: u,
70
+ stopPropagation: v,
71
+ exact: f,
72
+ onMove: g,
73
+ onEnd: s,
74
+ onStart: c,
75
+ initialValue: a,
76
+ axis: d = "both",
77
+ draggingElement: p = U,
78
+ containerElement: x,
79
+ handle: B = t
80
+ } = l, m = O(
81
+ (e = h(a)) != null ? e : { x: 0, y: 0 }
82
+ ), b = O(), E = (r) => o ? o.includes(r.pointerType) : !0, M = (r) => {
83
+ h(u) && r.preventDefault(), h(v) && r.stopPropagation();
84
+ }, $ = (r) => {
85
+ var y;
86
+ if (!E(r) || h(f) && r.target !== h(t))
87
87
  return;
88
- const F = ((w = _(E)) != null ? w : _(t)).getBoundingClientRect(), I = {
89
- x: l.clientX - F.left,
90
- y: l.clientY - F.top
88
+ const F = ((y = h(x)) != null ? y : h(t)).getBoundingClientRect(), I = {
89
+ x: r.clientX - F.left,
90
+ y: r.clientY - F.top
91
91
  };
92
- (d == null ? void 0 : d(I, l)) !== !1 && (b.value = I, S(l));
93
- }, r = (l) => {
94
- if (!M(l) || !b.value)
92
+ (c == null ? void 0 : c(I, r)) !== !1 && (b.value = I, M(r));
93
+ }, L = (r) => {
94
+ if (!E(r) || !b.value)
95
95
  return;
96
- let { x: w, y: k } = h.value;
97
- (u === "x" || u === "both") && (w = l.clientX - b.value.x), (u === "y" || u === "both") && (k = l.clientY - b.value.y), h.value = {
98
- x: w,
99
- y: k
100
- }, f == null || f(h.value, l), S(l);
101
- }, y = (l) => {
102
- M(l) && b.value && (b.value = void 0, a == null || a(h.value, l), S(l));
96
+ let { x: y, y: S } = m.value;
97
+ (d === "x" || d === "both") && (y = r.clientX - b.value.x), (d === "y" || d === "both") && (S = r.clientY - b.value.y), m.value = {
98
+ x: y,
99
+ y: S
100
+ }, g == null || g(m.value, r), M(r);
101
+ }, i = (r) => {
102
+ E(r) && b.value && (b.value = void 0, s == null || s(m.value, r), M(r));
103
103
  };
104
104
  if (G) {
105
- const l = { capture: (n = i.capture) != null ? n : !0 };
106
- D($, "pointerdown", L, l), D(v, "pointermove", r, l), D(v, "pointerup", y, l);
105
+ const r = { capture: (n = l.capture) != null ? n : !0 };
106
+ D(B, "pointerdown", $, r), D(p, "pointermove", L, r), D(p, "pointerup", i, r);
107
107
  }
108
108
  return {
109
- ...we(h),
110
- position: h,
111
- isDragging: A(() => !!b.value),
112
- style: A(
113
- () => `left:${h.value.x}px;top:${h.value.y}px;`
109
+ ...Ce(m),
110
+ position: m,
111
+ isDragging: k(() => !!b.value),
112
+ style: k(
113
+ () => `left:${m.value.x}px;top:${m.value.y}px;`
114
114
  )
115
115
  };
116
116
  }
117
- const Ee = { class: "modal-container" }, Me = { class: "title font-bold" }, Se = { class: "action" }, ke = {
117
+ const Me = { class: "modal-container" }, Se = { class: "title font-bold" }, ke = { class: "action" }, Ae = {
118
118
  key: 1,
119
119
  class: "modal-footer space-x-2"
120
- }, Ae = ["form"], Pe = {
120
+ }, Pe = ["form"], Oe = {
121
121
  name: "ModalContainer",
122
122
  inheritAttrs: !0
123
- }, Oe = /* @__PURE__ */ X({
124
- ...Pe,
123
+ }, ze = /* @__PURE__ */ X({
124
+ ...Oe,
125
125
  props: {
126
126
  id: {},
127
127
  formId: {},
@@ -141,126 +141,132 @@ const Ee = { class: "modal-container" }, Me = { class: "title font-bold" }, Se =
141
141
  draggable: { type: Boolean, default: !1 }
142
142
  },
143
143
  emits: ["submit"],
144
- setup(t, { emit: i }) {
145
- const e = t, n = i, o = V(B);
146
- let c = 0, m = 0;
147
- const p = H(), f = H(), { x: a, y: d } = xe(f, {
144
+ setup(t, { emit: l }) {
145
+ const e = t, n = l, o = V(z);
146
+ let u = 0, v = 0, f;
147
+ const g = H(), s = H(), { x: c, y: a } = Ee(s, {
148
148
  initialValue: { x: 0, y: 0 }
149
149
  });
150
- function s() {
150
+ function d() {
151
151
  o == null || o.close(e.id);
152
152
  }
153
- function u(r) {
154
- if (typeof r == "number")
155
- return `${r}px`;
156
- if (typeof r == "string")
157
- return r;
153
+ function p(i) {
154
+ if (typeof i == "number")
155
+ return `${i}px`;
156
+ if (typeof i == "string")
157
+ return i;
158
158
  }
159
- const v = A(() => {
160
- const r = {};
161
- return e.size && (r.width = u(e.sizes[e.size])), e.width && (r.width = u(e.width)), e.maxWidth && (r.maxWidth = u(e.maxWidth)), e.draggable && (r.transform = `translate(${a.value - c}px, ${d.value - m}px)`), r;
162
- }), E = A(() => {
163
- const r = {};
164
- return e.draggable && (r.cursor = "move"), r;
165
- }), $ = A(() => {
166
- var y;
167
- const r = {};
168
- return e.maxHeight && (r.maxHeight = `calc(${(y = u(e.maxWidth)) == null ? void 0 : y.replace("%", "vh")} - 50px)`), r;
159
+ const x = k(() => {
160
+ const i = {};
161
+ return e.size && (i.width = p(e.sizes[e.size])), e.width && (i.width = p(e.width)), e.maxWidth && (i.maxWidth = p(e.maxWidth)), e.draggable && (i.transform = `translate(${c.value - u}px, ${a.value - v}px)`), i;
162
+ }), B = k(() => {
163
+ const i = {};
164
+ return e.draggable && (i.cursor = "move"), i;
165
+ }), m = k(() => {
166
+ var r;
167
+ const i = {};
168
+ return e.maxHeight && (i.maxHeight = `calc(${(r = p(e.maxWidth)) == null ? void 0 : r.replace("%", "vh")} - 50px)`), i;
169
169
  });
170
- function h() {
170
+ function b() {
171
171
  n("submit");
172
172
  }
173
- function b() {
173
+ function E() {
174
174
  o == null || o.close(e.id);
175
175
  }
176
176
  function M() {
177
177
  window && window.addEventListener("resize", () => {
178
- P(p), P(f), c = f.value.offsetLeft, m = f.value.offsetTop;
178
+ A(g), A(s), u = s.value.offsetLeft, v = s.value.offsetTop;
179
179
  });
180
180
  }
181
- function S() {
181
+ function $() {
182
182
  if (e.closeable && e.esc) {
183
- const r = ({ key: y }) => {
184
- y === "Escape" && (o == null || o.close(e.id), window.removeEventListener("keydown", r));
183
+ const i = ({ key: r }) => {
184
+ r === "Escape" && (o == null || o.close(e.id), window.removeEventListener("keydown", i));
185
185
  };
186
- window.addEventListener("keydown", r);
186
+ window.addEventListener("keydown", i);
187
187
  }
188
188
  }
189
189
  function L() {
190
- new MutationObserver((y) => {
191
- y.forEach((l) => {
192
- const w = f.value.offsetLeft, k = f.value.offsetTop;
193
- w !== c && (c = w), k !== m && (m = w);
190
+ f = new MutationObserver((i) => {
191
+ i.forEach((r) => {
192
+ const y = s.value.offsetLeft, S = s.value.offsetTop;
193
+ y !== u && (u = y), S !== v && (v = y);
194
194
  });
195
- }).observe(f.value, { attributes: !0, attributeFilter: ["style", "offsetHeight", "offsetWidth", "clientHeight", "clientWidth"], attributeOldValue: !0 });
195
+ }), f.observe(s.value, {
196
+ attributes: !0,
197
+ attributeFilter: ["style", "offsetHeight", "offsetWidth", "clientHeight", "clientWidth"],
198
+ attributeOldValue: !0
199
+ });
196
200
  }
197
201
  return Y(() => {
198
- S(), L(), M();
199
- }), (r, y) => (g(), x("div", Ee, [
200
- C("div", {
202
+ $(), L(), M();
203
+ }), oe(() => {
204
+ f && (f.disconnect(), f.takeRecords());
205
+ }), (i, r) => (_(), C("div", Me, [
206
+ w("div", {
201
207
  ref_key: "wrapperRef",
202
- ref: p,
208
+ ref: g,
203
209
  class: "modal-wrapper",
204
- onClick: y[0] || (y[0] = oe((l) => r.maskClosable && s(), ["self"]))
210
+ onClick: r[0] || (r[0] = re((y) => i.maskClosable && d(), ["self"]))
205
211
  }, [
206
- C("div", {
212
+ w("div", {
207
213
  ref_key: "contentRef",
208
- ref: f,
214
+ ref: s,
209
215
  class: "modal-content",
210
- style: W(v.value)
216
+ style: W(x.value)
211
217
  }, [
212
- r.header ? (g(), x("div", {
218
+ i.header ? (_(), C("div", {
213
219
  key: 0,
214
220
  ref: "",
215
221
  class: "modal-header",
216
- style: W(E.value)
222
+ style: W(B.value)
217
223
  }, [
218
- C("div", Me, re(r.title), 1),
219
- C("div", Se, [
220
- r.closeable ? (g(), x("div", {
224
+ w("div", Se, ie(i.title), 1),
225
+ w("div", ke, [
226
+ i.closeable ? (_(), C("div", {
221
227
  key: 0,
222
228
  class: "i-icon-park-outline:close block cursor-pointer",
223
- onClick: s
224
- })) : O("", !0)
229
+ onClick: d
230
+ })) : P("", !0)
225
231
  ])
226
- ], 4)) : O("", !0),
227
- C("div", {
232
+ ], 4)) : P("", !0),
233
+ w("div", {
228
234
  class: "modal-body",
229
- style: W($.value)
235
+ style: W(m.value)
230
236
  }, [
231
- (g(), N(ie(r.component), se(le(r.componentProps)), null, 16))
237
+ (_(), N(se(i.component), le(ae(i.componentProps)), null, 16))
232
238
  ], 4),
233
- r.footer ? (g(), x("div", ke, [
234
- C("button", {
239
+ i.footer ? (_(), C("div", Ae, [
240
+ w("button", {
235
241
  class: "submit-button",
236
- form: r.formId,
242
+ form: i.formId,
237
243
  type: "submit",
238
- onClick: h
239
- }, " 确定 ", 8, Ae),
240
- C("button", {
244
+ onClick: b
245
+ }, " 确定 ", 8, Pe),
246
+ w("button", {
241
247
  class: "cancel-button",
242
248
  type: "button",
243
- onClick: b
249
+ onClick: E
244
250
  }, " 取消 ")
245
- ])) : O("", !0)
251
+ ])) : P("", !0)
246
252
  ], 4)
247
253
  ], 512)
248
254
  ]));
249
255
  }
250
256
  });
251
- const J = (t, i) => {
257
+ const q = (t, l) => {
252
258
  const e = t.__vccOpts || t;
253
- for (const [n, o] of i)
259
+ for (const [n, o] of l)
254
260
  e[n] = o;
255
261
  return e;
256
- }, ze = /* @__PURE__ */ J(Oe, [["__scopeId", "data-v-16717585"]]), Be = {
262
+ }, Be = /* @__PURE__ */ q(ze, [["__scopeId", "data-v-e6f6653f"]]), $e = {
257
263
  key: 0,
258
264
  class: "modal-teleport"
259
- }, $e = {
265
+ }, Le = {
260
266
  name: "ModalProvider",
261
267
  inheritAttrs: !0
262
- }, Le = /* @__PURE__ */ X({
263
- ...$e,
268
+ }, We = /* @__PURE__ */ X({
269
+ ...Le,
264
270
  props: {
265
271
  appendToBody: { type: Boolean, default: !1 },
266
272
  sizes: { default: () => ({
@@ -271,91 +277,91 @@ const J = (t, i) => {
271
277
  maxWidth: { default: "80%" },
272
278
  maxHeight: { default: "80%" }
273
279
  },
274
- setup(t, { expose: i }) {
275
- const e = H([]), n = z(!1);
276
- async function o(a, d, s) {
277
- const u = ye(
278
- () => Promise.resolve(a)
280
+ setup(t, { expose: l }) {
281
+ const e = H([]), n = O(!1);
282
+ async function o(s, c, a) {
283
+ const d = he(
284
+ () => Promise.resolve(s)
279
285
  );
280
- return new Promise((v) => {
286
+ return new Promise((p) => {
281
287
  e.value.push({
282
288
  id: Math.random().toString(32).slice(2),
283
- component: u,
284
- props: d,
285
- options: s,
286
- resolve: v,
287
- onSubmit: z(() => {
289
+ component: d,
290
+ props: c,
291
+ options: a,
292
+ resolve: p,
293
+ onSubmit: O(() => {
288
294
  })
289
- }), P(e);
295
+ }), A(e);
290
296
  });
291
297
  }
292
- function c(a, d) {
293
- const s = e.value.findIndex((v) => v.id === a);
294
- if (s < 0)
298
+ function u(s, c) {
299
+ const a = e.value.findIndex((p) => p.id === s);
300
+ if (a < 0)
295
301
  return;
296
- const u = e.value[s];
297
- u == null || u.resolve(d), e.value.splice(s, 1), P(e);
302
+ const d = e.value[a];
303
+ d == null || d.resolve(c), e.value.splice(a, 1), A(e);
298
304
  }
299
- function m() {
300
- e.value.forEach((a) => {
301
- a.resolve();
302
- }), e.value = [], P(e);
305
+ function v() {
306
+ e.value.forEach((s) => {
307
+ s.resolve();
308
+ }), e.value = [], A(e);
303
309
  }
304
- function p(a) {
305
- return e.value.find((d) => d.id === a);
310
+ function f(s) {
311
+ return e.value.find((c) => c.id === s);
306
312
  }
307
- function f(a, d) {
308
- const s = e.value.find((u) => u.id === a);
309
- s && (s.onSubmit.value = d);
313
+ function g(s, c) {
314
+ const a = e.value.find((d) => d.id === s);
315
+ a && (a.onSubmit.value = c);
310
316
  }
311
- return ae(B, {
317
+ return ue(z, {
312
318
  open: o,
313
- close: c,
314
- closeAll: m,
315
- getElement: p,
316
- addSubmitListener: f
317
- }), i({
319
+ close: u,
320
+ closeAll: v,
321
+ getElement: f,
322
+ addSubmitListener: g
323
+ }), l({
318
324
  elements: e
319
325
  }), Y(() => {
320
326
  n.value = !0;
321
- }), (a, d) => (g(), x(R, null, [
322
- ue(a.$slots, "default", {}, void 0, !0),
323
- n.value ? (g(), x("div", Be, [
324
- (g(), N(ce, {
325
- disabled: !a.appendToBody,
327
+ }), (s, c) => (_(), C(R, null, [
328
+ ce(s.$slots, "default", {}, void 0, !0),
329
+ n.value ? (_(), C("div", $e, [
330
+ (_(), N(de, {
331
+ disabled: !s.appendToBody,
326
332
  to: "body"
327
333
  }, [
328
- de(fe, { name: "modal-fade" }, {
329
- default: pe(() => [
330
- (g(!0), x(R, null, ve(e.value, (s) => (g(), N(ze, me({
331
- id: s.id,
332
- key: s.id,
333
- component: s.component,
334
- "component-props": s.props,
335
- "max-height": a.maxHeight,
336
- "max-width": a.maxWidth,
337
- sizes: a.sizes
338
- }, s.options, {
339
- onSubmit: s.onSubmit.value
334
+ fe(pe, { name: "modal-fade" }, {
335
+ default: ve(() => [
336
+ (_(!0), C(R, null, me(e.value, (a) => (_(), N(Be, ye({
337
+ id: a.id,
338
+ key: a.id,
339
+ component: a.component,
340
+ "component-props": a.props,
341
+ "max-height": s.maxHeight,
342
+ "max-width": s.maxWidth,
343
+ sizes: s.sizes
344
+ }, a.options, {
345
+ onSubmit: a.onSubmit.value
340
346
  }), null, 16, ["id", "component", "component-props", "max-height", "max-width", "sizes", "onSubmit"]))), 128))
341
347
  ]),
342
348
  _: 1
343
349
  })
344
350
  ], 8, ["disabled"]))
345
- ])) : O("", !0)
351
+ ])) : P("", !0)
346
352
  ], 64));
347
353
  }
348
354
  });
349
- const De = /* @__PURE__ */ J(Le, [["__scopeId", "data-v-171d9bdd"]]);
350
- function T(t, i) {
355
+ const He = /* @__PURE__ */ q(We, [["__scopeId", "data-v-171d9bdd"]]);
356
+ function T(t, l) {
351
357
  var n, o;
352
358
  let e = t == null ? void 0 : t.parent;
353
- for (; e && ((n = e == null ? void 0 : e.type) == null ? void 0 : n.name) !== i; )
359
+ for (; e && ((n = e == null ? void 0 : e.type) == null ? void 0 : n.name) !== l; )
354
360
  e = e.parent;
355
- return ((o = e == null ? void 0 : e.type) == null ? void 0 : o.name) === i ? e : null;
361
+ return ((o = e == null ? void 0 : e.type) == null ? void 0 : o.name) === l ? e : null;
356
362
  }
357
- function He() {
358
- const t = V(B), i = K();
363
+ function Ne() {
364
+ const t = V(z), l = K();
359
365
  return {
360
366
  open(e, n, o) {
361
367
  if (!t)
@@ -363,10 +369,10 @@ function He() {
363
369
  return t.open(e, n || {}, o || {});
364
370
  },
365
371
  close(e) {
366
- var c;
372
+ var u;
367
373
  if (!t)
368
374
  throw new Error("Not Found Modal Provider Component");
369
- const n = T(i, "ModalContainer"), o = (c = n == null ? void 0 : n.props) == null ? void 0 : c.id;
375
+ const n = T(l, "ModalContainer"), o = (u = n == null ? void 0 : n.props) == null ? void 0 : u.id;
370
376
  if (!o)
371
377
  throw new Error("Not Found Current Modal Container");
372
378
  t.close(o, e);
@@ -377,20 +383,20 @@ function He() {
377
383
  t.closeAll();
378
384
  },
379
385
  onSubmit(e) {
380
- const n = T(i, "ModalContainer");
386
+ const n = T(l, "ModalContainer");
381
387
  if (!(n == null ? void 0 : n.props.id))
382
388
  throw new Error("Not Found Current Modal Container");
383
389
  }
384
390
  };
385
391
  }
386
- function Ne(t) {
387
- var c;
388
- const i = V(B), e = K(), n = T(e, "ModalContainer"), o = (c = n == null ? void 0 : n.props) == null ? void 0 : c.id;
389
- i && o && i.addSubmitListener(o, t);
392
+ function Te(t) {
393
+ var u;
394
+ const l = V(z), e = K(), n = T(e, "ModalContainer"), o = (u = n == null ? void 0 : n.props) == null ? void 0 : u.id;
395
+ l && o && l.addSubmitListener(o, t);
390
396
  }
391
397
  export {
392
- ze as ModalContainer,
393
- De as ModalProvider,
394
- Ne as onSubmit,
395
- He as useModal
398
+ Be as ModalContainer,
399
+ He as ModalProvider,
400
+ Te as onSubmit,
401
+ Ne as useModal
396
402
  };
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}.fixed{position:fixed}.block{display:block}.flex{display:flex}.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))}.px{padding-left:1rem;padding-right:1rem}.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-16717585]{z-index:1000;position:fixed;top:0;right:0;bottom:0;left:0;display:flex;justify-content:center;align-items:center;background:rgba(0,0,0,.3)}.modal-content[data-v-16717585]{background:#ffffff;border-radius:5px}.modal-header[data-v-16717585]{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)}.modal-body[data-v-16717585]{padding:20px 10px;box-sizing:border-box;max-height:10vw;overflow:auto}.modal-footer[data-v-16717585]{box-sizing:border-box;height:50px;border-top:solid 1px var(--color-border-1, #E8E8E8);display:flex;justify-content:end;padding:10px}.modal-footer button[data-v-16717585]{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-16717585]{color:#fff;background-color:var(--primary-6, #2D6AFB)}.modal-footer button.submit-button[data-v-16717585]:hover{background-color:var(--primary-5, #1C4CCF)}.modal-footer button.cancel-button[data-v-16717585]{color:var(--color-text-2, #4E5969);background-color:var(--color-fill-1, #F5F5F5)}.modal-footer button.cancel-button[data-v-16717585]:hover{background-color:var(--color-fill-4, #C9CDD4)}.modal-fade-enter-active[data-v-171d9bdd],.modal-fade-leave-active[data-v-171d9bdd]{transition:all .5s ease}.modal-fade-enter-from[data-v-171d9bdd],.modal-fade-leave-to[data-v-171d9bdd]{opacity:0}
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}.fixed{position:fixed}.block{display:block}.flex{display:flex}.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))}.px{padding-left:1rem;padding-right:1rem}.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-e6f6653f]{z-index:1000;position:fixed;top:0;right:0;bottom:0;left:0;display:flex;justify-content:center;align-items:center;background:rgba(0,0,0,.3)}.modal-content[data-v-e6f6653f]{background:#ffffff;border-radius:5px}.modal-header[data-v-e6f6653f]{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)}.modal-body[data-v-e6f6653f]{padding:20px 10px;box-sizing:border-box;max-height:10vw;overflow:auto}.modal-footer[data-v-e6f6653f]{box-sizing:border-box;height:50px;border-top:solid 1px var(--color-border-1, #E8E8E8);display:flex;justify-content:end;padding:10px}.modal-footer button[data-v-e6f6653f]{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-e6f6653f]{color:#fff;background-color:rgb(var(--primary-6, 45, 106, 251))}.modal-footer button.submit-button[data-v-e6f6653f]:hover{background-color:rgb(var(--primary-5, 28, 76, 207))}.modal-footer button.cancel-button[data-v-e6f6653f]{color:rgb(var(--color-text-2, 78, 89, 105));background-color:rgb(var(--color-fill-1, 245, 245, 245))}.modal-footer button.cancel-button[data-v-e6f6653f]:hover{background-color:rgb(var(--color-fill-4, 201, 205, 212))}.modal-fade-enter-active[data-v-171d9bdd],.modal-fade-leave-active[data-v-171d9bdd]{transition:all .5s ease}.modal-fade-enter-from[data-v-171d9bdd],.modal-fade-leave-to[data-v-171d9bdd]{opacity:0}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@gopowerteam/modal-render",
3
3
  "type": "module",
4
- "version": "0.0.1",
4
+ "version": "0.0.2",
5
5
  "author": {
6
6
  "name": "zhuchentong",
7
7
  "email": "2037630@gmail.com"