@gopowerteam/modal-render 0.0.1
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/components/modal-container.vue.d.ts +82 -0
- package/dist/components/modal-provider.vue.d.ts +59 -0
- package/dist/constants.d.ts +3 -0
- package/dist/hooks/on-submit.d.ts +1 -0
- package/dist/hooks/use-modal.d.ts +8 -0
- package/dist/index.cjs +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +396 -0
- package/dist/interfaces.d.ts +33 -0
- package/dist/style.css +1 -0
- package/dist/utils/find-container.d.ts +2 -0
- package/package.json +63 -0
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import type { Component } from 'vue';
|
|
2
|
+
import type { SizeOptions } from '../interfaces';
|
|
3
|
+
declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
4
|
+
id: string;
|
|
5
|
+
formId?: string;
|
|
6
|
+
component: Component;
|
|
7
|
+
componentProps: Record<string, any>;
|
|
8
|
+
width?: number | string;
|
|
9
|
+
maxWidth?: number | string;
|
|
10
|
+
maxHeight?: number | string;
|
|
11
|
+
sizes: SizeOptions;
|
|
12
|
+
size: 'small' | 'middle' | 'large';
|
|
13
|
+
title?: string;
|
|
14
|
+
header?: boolean;
|
|
15
|
+
footer?: boolean;
|
|
16
|
+
closeable?: boolean;
|
|
17
|
+
esc?: boolean;
|
|
18
|
+
maskClosable?: boolean;
|
|
19
|
+
draggable?: boolean;
|
|
20
|
+
}>, {
|
|
21
|
+
header: boolean;
|
|
22
|
+
closeable: boolean;
|
|
23
|
+
footer: boolean;
|
|
24
|
+
keyboard: boolean;
|
|
25
|
+
maskClosable: boolean;
|
|
26
|
+
size: string;
|
|
27
|
+
esc: boolean;
|
|
28
|
+
draggable: boolean;
|
|
29
|
+
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
30
|
+
submit: (...args: any[]) => void;
|
|
31
|
+
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
32
|
+
id: string;
|
|
33
|
+
formId?: string;
|
|
34
|
+
component: Component;
|
|
35
|
+
componentProps: Record<string, any>;
|
|
36
|
+
width?: number | string;
|
|
37
|
+
maxWidth?: number | string;
|
|
38
|
+
maxHeight?: number | string;
|
|
39
|
+
sizes: SizeOptions;
|
|
40
|
+
size: 'small' | 'middle' | 'large';
|
|
41
|
+
title?: string;
|
|
42
|
+
header?: boolean;
|
|
43
|
+
footer?: boolean;
|
|
44
|
+
closeable?: boolean;
|
|
45
|
+
esc?: boolean;
|
|
46
|
+
maskClosable?: boolean;
|
|
47
|
+
draggable?: boolean;
|
|
48
|
+
}>, {
|
|
49
|
+
header: boolean;
|
|
50
|
+
closeable: boolean;
|
|
51
|
+
footer: boolean;
|
|
52
|
+
keyboard: boolean;
|
|
53
|
+
maskClosable: boolean;
|
|
54
|
+
size: string;
|
|
55
|
+
esc: boolean;
|
|
56
|
+
draggable: boolean;
|
|
57
|
+
}>>> & {
|
|
58
|
+
onSubmit?: (...args: any[]) => any;
|
|
59
|
+
}, {
|
|
60
|
+
header: boolean;
|
|
61
|
+
closeable: boolean;
|
|
62
|
+
footer: boolean;
|
|
63
|
+
maskClosable: boolean;
|
|
64
|
+
size: 'small' | 'middle' | 'large';
|
|
65
|
+
esc: boolean;
|
|
66
|
+
draggable: boolean;
|
|
67
|
+
}, {}>;
|
|
68
|
+
export default _default;
|
|
69
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
70
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
71
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
72
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
73
|
+
} : {
|
|
74
|
+
type: import('vue').PropType<T[K]>;
|
|
75
|
+
required: true;
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
type __VLS_WithDefaults<P, D> = {
|
|
79
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
80
|
+
default: D[K];
|
|
81
|
+
}> : P[K];
|
|
82
|
+
};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import type { ModalElement, SizeOptions } from '../interfaces';
|
|
2
|
+
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
3
|
+
appendToBody: boolean;
|
|
4
|
+
sizes: SizeOptions;
|
|
5
|
+
maxWidth: string | number;
|
|
6
|
+
maxHeight: string | number;
|
|
7
|
+
}>, {
|
|
8
|
+
appendToBody: boolean;
|
|
9
|
+
maxWidth: string;
|
|
10
|
+
maxHeight: string;
|
|
11
|
+
sizes: () => {
|
|
12
|
+
small: number;
|
|
13
|
+
middle: number;
|
|
14
|
+
large: number;
|
|
15
|
+
};
|
|
16
|
+
}>, {
|
|
17
|
+
elements: import("vue").ShallowRef<ModalElement[]>;
|
|
18
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
19
|
+
appendToBody: boolean;
|
|
20
|
+
sizes: SizeOptions;
|
|
21
|
+
maxWidth: string | number;
|
|
22
|
+
maxHeight: string | number;
|
|
23
|
+
}>, {
|
|
24
|
+
appendToBody: boolean;
|
|
25
|
+
maxWidth: string;
|
|
26
|
+
maxHeight: string;
|
|
27
|
+
sizes: () => {
|
|
28
|
+
small: number;
|
|
29
|
+
middle: number;
|
|
30
|
+
large: number;
|
|
31
|
+
};
|
|
32
|
+
}>>>, {
|
|
33
|
+
maxWidth: string | number;
|
|
34
|
+
maxHeight: string | number;
|
|
35
|
+
sizes: SizeOptions;
|
|
36
|
+
appendToBody: boolean;
|
|
37
|
+
}, {}>, {
|
|
38
|
+
default?(_: {}): any;
|
|
39
|
+
}>;
|
|
40
|
+
export default _default;
|
|
41
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
42
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
43
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
44
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
45
|
+
} : {
|
|
46
|
+
type: import('vue').PropType<T[K]>;
|
|
47
|
+
required: true;
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
type __VLS_WithDefaults<P, D> = {
|
|
51
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
52
|
+
default: D[K];
|
|
53
|
+
}> : P[K];
|
|
54
|
+
};
|
|
55
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
56
|
+
new (): {
|
|
57
|
+
$slots: S;
|
|
58
|
+
};
|
|
59
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function onSubmit(callback: () => void): void;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Component } from 'vue';
|
|
2
|
+
import type { OpenModalOptions } from '../interfaces';
|
|
3
|
+
export declare function useModal(): {
|
|
4
|
+
open(component: Component, props?: Record<string, any>, options?: OpenModalOptions): Promise<any>;
|
|
5
|
+
close(data?: any): void;
|
|
6
|
+
closeAll(): void;
|
|
7
|
+
onSubmit(fun: () => void): void;
|
|
8
|
+
};
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +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;
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import ModalProvider from './components/modal-provider.vue';
|
|
2
|
+
import ModalContainer from './components/modal-container.vue';
|
|
3
|
+
import { useModal } from './hooks/use-modal';
|
|
4
|
+
export { onSubmit } from './hooks/on-submit';
|
|
5
|
+
export * from './interfaces';
|
|
6
|
+
export { ModalContainer, ModalProvider, useModal, };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,396 @@
|
|
|
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) {
|
|
4
|
+
return ee() ? (te(t), !0) : !1;
|
|
5
|
+
}
|
|
6
|
+
function _(t) {
|
|
7
|
+
return typeof t == "function" ? t() : Q(t);
|
|
8
|
+
}
|
|
9
|
+
const G = typeof window < "u" && typeof document < "u", _e = Object.prototype.toString, ge = (t) => _e.call(t) === "[object Object]", be = () => {
|
|
10
|
+
};
|
|
11
|
+
function we(t, i = {}) {
|
|
12
|
+
if (!U(t))
|
|
13
|
+
return Z(t);
|
|
14
|
+
const e = Array.isArray(t.value) ? Array.from({ length: t.value.length }) : {};
|
|
15
|
+
for (const n in t.value)
|
|
16
|
+
e[n] = j(() => ({
|
|
17
|
+
get() {
|
|
18
|
+
return t.value[n];
|
|
19
|
+
},
|
|
20
|
+
set(o) {
|
|
21
|
+
var c;
|
|
22
|
+
if ((c = _(i.replaceRef)) != null ? c : !0)
|
|
23
|
+
if (Array.isArray(t.value)) {
|
|
24
|
+
const p = [...t.value];
|
|
25
|
+
p[n] = o, t.value = p;
|
|
26
|
+
} else {
|
|
27
|
+
const p = { ...t.value, [n]: o };
|
|
28
|
+
Object.setPrototypeOf(p, Object.getPrototypeOf(t.value)), t.value = p;
|
|
29
|
+
}
|
|
30
|
+
else
|
|
31
|
+
t.value[n] = o;
|
|
32
|
+
}
|
|
33
|
+
}));
|
|
34
|
+
return e;
|
|
35
|
+
}
|
|
36
|
+
function Ce(t) {
|
|
37
|
+
var i;
|
|
38
|
+
const e = _(t);
|
|
39
|
+
return (i = e == null ? void 0 : e.$el) != null ? i : e;
|
|
40
|
+
}
|
|
41
|
+
const q = G ? window : void 0;
|
|
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;
|
|
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)
|
|
53
|
+
return;
|
|
54
|
+
const u = ge(s) ? { ...s } : s;
|
|
55
|
+
c.push(
|
|
56
|
+
...e.flatMap((v) => n.map((E) => p(d, v, E, u)))
|
|
57
|
+
);
|
|
58
|
+
},
|
|
59
|
+
{ immediate: !0, flush: "post" }
|
|
60
|
+
), a = () => {
|
|
61
|
+
f(), m();
|
|
62
|
+
};
|
|
63
|
+
return he(a), a;
|
|
64
|
+
}
|
|
65
|
+
function xe(t, i = {}) {
|
|
66
|
+
var e, n;
|
|
67
|
+
const {
|
|
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))
|
|
87
|
+
return;
|
|
88
|
+
const F = ((w = _(E)) != null ? w : _(t)).getBoundingClientRect(), I = {
|
|
89
|
+
x: l.clientX - F.left,
|
|
90
|
+
y: l.clientY - F.top
|
|
91
|
+
};
|
|
92
|
+
(d == null ? void 0 : d(I, l)) !== !1 && (b.value = I, S(l));
|
|
93
|
+
}, r = (l) => {
|
|
94
|
+
if (!M(l) || !b.value)
|
|
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));
|
|
103
|
+
};
|
|
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);
|
|
107
|
+
}
|
|
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;`
|
|
114
|
+
)
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
const Ee = { class: "modal-container" }, Me = { class: "title font-bold" }, Se = { class: "action" }, ke = {
|
|
118
|
+
key: 1,
|
|
119
|
+
class: "modal-footer space-x-2"
|
|
120
|
+
}, Ae = ["form"], Pe = {
|
|
121
|
+
name: "ModalContainer",
|
|
122
|
+
inheritAttrs: !0
|
|
123
|
+
}, Oe = /* @__PURE__ */ X({
|
|
124
|
+
...Pe,
|
|
125
|
+
props: {
|
|
126
|
+
id: {},
|
|
127
|
+
formId: {},
|
|
128
|
+
component: {},
|
|
129
|
+
componentProps: {},
|
|
130
|
+
width: {},
|
|
131
|
+
maxWidth: {},
|
|
132
|
+
maxHeight: {},
|
|
133
|
+
sizes: {},
|
|
134
|
+
size: { default: "middle" },
|
|
135
|
+
title: {},
|
|
136
|
+
header: { type: Boolean, default: !0 },
|
|
137
|
+
footer: { type: Boolean, default: !1 },
|
|
138
|
+
closeable: { type: Boolean, default: !0 },
|
|
139
|
+
esc: { type: Boolean, default: !1 },
|
|
140
|
+
maskClosable: { type: Boolean, default: !1 },
|
|
141
|
+
draggable: { type: Boolean, default: !1 }
|
|
142
|
+
},
|
|
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, {
|
|
148
|
+
initialValue: { x: 0, y: 0 }
|
|
149
|
+
});
|
|
150
|
+
function s() {
|
|
151
|
+
o == null || o.close(e.id);
|
|
152
|
+
}
|
|
153
|
+
function u(r) {
|
|
154
|
+
if (typeof r == "number")
|
|
155
|
+
return `${r}px`;
|
|
156
|
+
if (typeof r == "string")
|
|
157
|
+
return r;
|
|
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;
|
|
169
|
+
});
|
|
170
|
+
function h() {
|
|
171
|
+
n("submit");
|
|
172
|
+
}
|
|
173
|
+
function b() {
|
|
174
|
+
o == null || o.close(e.id);
|
|
175
|
+
}
|
|
176
|
+
function M() {
|
|
177
|
+
window && window.addEventListener("resize", () => {
|
|
178
|
+
P(p), P(f), c = f.value.offsetLeft, m = f.value.offsetTop;
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
function S() {
|
|
182
|
+
if (e.closeable && e.esc) {
|
|
183
|
+
const r = ({ key: y }) => {
|
|
184
|
+
y === "Escape" && (o == null || o.close(e.id), window.removeEventListener("keydown", r));
|
|
185
|
+
};
|
|
186
|
+
window.addEventListener("keydown", r);
|
|
187
|
+
}
|
|
188
|
+
}
|
|
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);
|
|
194
|
+
});
|
|
195
|
+
}).observe(f.value, { attributes: !0, attributeFilter: ["style", "offsetHeight", "offsetWidth", "clientHeight", "clientWidth"], attributeOldValue: !0 });
|
|
196
|
+
}
|
|
197
|
+
return Y(() => {
|
|
198
|
+
S(), L(), M();
|
|
199
|
+
}), (r, y) => (g(), x("div", Ee, [
|
|
200
|
+
C("div", {
|
|
201
|
+
ref_key: "wrapperRef",
|
|
202
|
+
ref: p,
|
|
203
|
+
class: "modal-wrapper",
|
|
204
|
+
onClick: y[0] || (y[0] = oe((l) => r.maskClosable && s(), ["self"]))
|
|
205
|
+
}, [
|
|
206
|
+
C("div", {
|
|
207
|
+
ref_key: "contentRef",
|
|
208
|
+
ref: f,
|
|
209
|
+
class: "modal-content",
|
|
210
|
+
style: W(v.value)
|
|
211
|
+
}, [
|
|
212
|
+
r.header ? (g(), x("div", {
|
|
213
|
+
key: 0,
|
|
214
|
+
ref: "",
|
|
215
|
+
class: "modal-header",
|
|
216
|
+
style: W(E.value)
|
|
217
|
+
}, [
|
|
218
|
+
C("div", Me, re(r.title), 1),
|
|
219
|
+
C("div", Se, [
|
|
220
|
+
r.closeable ? (g(), x("div", {
|
|
221
|
+
key: 0,
|
|
222
|
+
class: "i-icon-park-outline:close block cursor-pointer",
|
|
223
|
+
onClick: s
|
|
224
|
+
})) : O("", !0)
|
|
225
|
+
])
|
|
226
|
+
], 4)) : O("", !0),
|
|
227
|
+
C("div", {
|
|
228
|
+
class: "modal-body",
|
|
229
|
+
style: W($.value)
|
|
230
|
+
}, [
|
|
231
|
+
(g(), N(ie(r.component), se(le(r.componentProps)), null, 16))
|
|
232
|
+
], 4),
|
|
233
|
+
r.footer ? (g(), x("div", ke, [
|
|
234
|
+
C("button", {
|
|
235
|
+
class: "submit-button",
|
|
236
|
+
form: r.formId,
|
|
237
|
+
type: "submit",
|
|
238
|
+
onClick: h
|
|
239
|
+
}, " 确定 ", 8, Ae),
|
|
240
|
+
C("button", {
|
|
241
|
+
class: "cancel-button",
|
|
242
|
+
type: "button",
|
|
243
|
+
onClick: b
|
|
244
|
+
}, " 取消 ")
|
|
245
|
+
])) : O("", !0)
|
|
246
|
+
], 4)
|
|
247
|
+
], 512)
|
|
248
|
+
]));
|
|
249
|
+
}
|
|
250
|
+
});
|
|
251
|
+
const J = (t, i) => {
|
|
252
|
+
const e = t.__vccOpts || t;
|
|
253
|
+
for (const [n, o] of i)
|
|
254
|
+
e[n] = o;
|
|
255
|
+
return e;
|
|
256
|
+
}, ze = /* @__PURE__ */ J(Oe, [["__scopeId", "data-v-16717585"]]), Be = {
|
|
257
|
+
key: 0,
|
|
258
|
+
class: "modal-teleport"
|
|
259
|
+
}, $e = {
|
|
260
|
+
name: "ModalProvider",
|
|
261
|
+
inheritAttrs: !0
|
|
262
|
+
}, Le = /* @__PURE__ */ X({
|
|
263
|
+
...$e,
|
|
264
|
+
props: {
|
|
265
|
+
appendToBody: { type: Boolean, default: !1 },
|
|
266
|
+
sizes: { default: () => ({
|
|
267
|
+
small: 520,
|
|
268
|
+
middle: 860,
|
|
269
|
+
large: 1190
|
|
270
|
+
}) },
|
|
271
|
+
maxWidth: { default: "80%" },
|
|
272
|
+
maxHeight: { default: "80%" }
|
|
273
|
+
},
|
|
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)
|
|
279
|
+
);
|
|
280
|
+
return new Promise((v) => {
|
|
281
|
+
e.value.push({
|
|
282
|
+
id: Math.random().toString(32).slice(2),
|
|
283
|
+
component: u,
|
|
284
|
+
props: d,
|
|
285
|
+
options: s,
|
|
286
|
+
resolve: v,
|
|
287
|
+
onSubmit: z(() => {
|
|
288
|
+
})
|
|
289
|
+
}), P(e);
|
|
290
|
+
});
|
|
291
|
+
}
|
|
292
|
+
function c(a, d) {
|
|
293
|
+
const s = e.value.findIndex((v) => v.id === a);
|
|
294
|
+
if (s < 0)
|
|
295
|
+
return;
|
|
296
|
+
const u = e.value[s];
|
|
297
|
+
u == null || u.resolve(d), e.value.splice(s, 1), P(e);
|
|
298
|
+
}
|
|
299
|
+
function m() {
|
|
300
|
+
e.value.forEach((a) => {
|
|
301
|
+
a.resolve();
|
|
302
|
+
}), e.value = [], P(e);
|
|
303
|
+
}
|
|
304
|
+
function p(a) {
|
|
305
|
+
return e.value.find((d) => d.id === a);
|
|
306
|
+
}
|
|
307
|
+
function f(a, d) {
|
|
308
|
+
const s = e.value.find((u) => u.id === a);
|
|
309
|
+
s && (s.onSubmit.value = d);
|
|
310
|
+
}
|
|
311
|
+
return ae(B, {
|
|
312
|
+
open: o,
|
|
313
|
+
close: c,
|
|
314
|
+
closeAll: m,
|
|
315
|
+
getElement: p,
|
|
316
|
+
addSubmitListener: f
|
|
317
|
+
}), i({
|
|
318
|
+
elements: e
|
|
319
|
+
}), Y(() => {
|
|
320
|
+
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,
|
|
326
|
+
to: "body"
|
|
327
|
+
}, [
|
|
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
|
|
340
|
+
}), null, 16, ["id", "component", "component-props", "max-height", "max-width", "sizes", "onSubmit"]))), 128))
|
|
341
|
+
]),
|
|
342
|
+
_: 1
|
|
343
|
+
})
|
|
344
|
+
], 8, ["disabled"]))
|
|
345
|
+
])) : O("", !0)
|
|
346
|
+
], 64));
|
|
347
|
+
}
|
|
348
|
+
});
|
|
349
|
+
const De = /* @__PURE__ */ J(Le, [["__scopeId", "data-v-171d9bdd"]]);
|
|
350
|
+
function T(t, i) {
|
|
351
|
+
var n, o;
|
|
352
|
+
let e = t == null ? void 0 : t.parent;
|
|
353
|
+
for (; e && ((n = e == null ? void 0 : e.type) == null ? void 0 : n.name) !== i; )
|
|
354
|
+
e = e.parent;
|
|
355
|
+
return ((o = e == null ? void 0 : e.type) == null ? void 0 : o.name) === i ? e : null;
|
|
356
|
+
}
|
|
357
|
+
function He() {
|
|
358
|
+
const t = V(B), i = K();
|
|
359
|
+
return {
|
|
360
|
+
open(e, n, o) {
|
|
361
|
+
if (!t)
|
|
362
|
+
throw new Error("Not Found Modal Provider Component");
|
|
363
|
+
return t.open(e, n || {}, o || {});
|
|
364
|
+
},
|
|
365
|
+
close(e) {
|
|
366
|
+
var c;
|
|
367
|
+
if (!t)
|
|
368
|
+
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;
|
|
370
|
+
if (!o)
|
|
371
|
+
throw new Error("Not Found Current Modal Container");
|
|
372
|
+
t.close(o, e);
|
|
373
|
+
},
|
|
374
|
+
closeAll() {
|
|
375
|
+
if (!t)
|
|
376
|
+
throw new Error("Not Found Modal Provider Component");
|
|
377
|
+
t.closeAll();
|
|
378
|
+
},
|
|
379
|
+
onSubmit(e) {
|
|
380
|
+
const n = T(i, "ModalContainer");
|
|
381
|
+
if (!(n == null ? void 0 : n.props.id))
|
|
382
|
+
throw new Error("Not Found Current Modal Container");
|
|
383
|
+
}
|
|
384
|
+
};
|
|
385
|
+
}
|
|
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);
|
|
390
|
+
}
|
|
391
|
+
export {
|
|
392
|
+
ze as ModalContainer,
|
|
393
|
+
De as ModalProvider,
|
|
394
|
+
Ne as onSubmit,
|
|
395
|
+
He as useModal
|
|
396
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { Component, Ref } from 'vue';
|
|
2
|
+
export interface SizeOptions {
|
|
3
|
+
small: number;
|
|
4
|
+
middle: number;
|
|
5
|
+
large: number;
|
|
6
|
+
}
|
|
7
|
+
export interface OpenModalOptions {
|
|
8
|
+
closeable?: boolean;
|
|
9
|
+
esc?: boolean;
|
|
10
|
+
mask?: boolean;
|
|
11
|
+
maskClosable?: boolean;
|
|
12
|
+
title?: string;
|
|
13
|
+
header?: boolean;
|
|
14
|
+
footer?: boolean;
|
|
15
|
+
width?: number | string;
|
|
16
|
+
size?: 'large' | 'middle' | 'small';
|
|
17
|
+
draggable?: boolean;
|
|
18
|
+
}
|
|
19
|
+
export interface ModalElement extends OpenModalOptions {
|
|
20
|
+
id: string;
|
|
21
|
+
resolve: (data?: any) => void;
|
|
22
|
+
component: Component;
|
|
23
|
+
props: Record<string, any>;
|
|
24
|
+
options: OpenModalOptions;
|
|
25
|
+
onSubmit: Ref<() => void>;
|
|
26
|
+
}
|
|
27
|
+
export interface ModalActions {
|
|
28
|
+
open: (component: Component, props: Record<string, any>, options: OpenModalOptions) => Promise<any | void>;
|
|
29
|
+
close: (id: string, data?: any) => void;
|
|
30
|
+
closeAll: () => void;
|
|
31
|
+
getElement: (id: string) => ModalElement | undefined;
|
|
32
|
+
addSubmitListener: (id: string, fun: () => void) => void;
|
|
33
|
+
}
|
package/dist/style.css
ADDED
|
@@ -0,0 +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}
|
package/package.json
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@gopowerteam/modal-render",
|
|
3
|
+
"type": "module",
|
|
4
|
+
"version": "0.0.1",
|
|
5
|
+
"author": {
|
|
6
|
+
"name": "zhuchentong",
|
|
7
|
+
"email": "2037630@gmail.com"
|
|
8
|
+
},
|
|
9
|
+
"license": "MIT",
|
|
10
|
+
"homepage": "https://github.com/gopowerteam/x-render",
|
|
11
|
+
"repository": {
|
|
12
|
+
"type": "git",
|
|
13
|
+
"url": "git+https://github.com/gopowerteam/x-render.git"
|
|
14
|
+
},
|
|
15
|
+
"bugs": {
|
|
16
|
+
"url": "https://github.com/gopowerteam/x-render/issues"
|
|
17
|
+
},
|
|
18
|
+
"exports": {
|
|
19
|
+
".": {
|
|
20
|
+
"require": "./dist/index.cjs",
|
|
21
|
+
"import": {
|
|
22
|
+
"types": "./dist/index.d.ts",
|
|
23
|
+
"default": "./dist/index.js"
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
"./dist/": "./dist/"
|
|
27
|
+
},
|
|
28
|
+
"main": "./dist/index.cjs",
|
|
29
|
+
"module": "./dist/index.js",
|
|
30
|
+
"types": "./dist/index.d.ts",
|
|
31
|
+
"files": [
|
|
32
|
+
"dist",
|
|
33
|
+
"README.md"
|
|
34
|
+
],
|
|
35
|
+
"peerDependencies": {
|
|
36
|
+
"vue": "^3.0.0"
|
|
37
|
+
},
|
|
38
|
+
"devDependencies": {
|
|
39
|
+
"@iconify-json/icon-park-outline": "^1.1.12",
|
|
40
|
+
"@types/node": "18.16.0",
|
|
41
|
+
"@unocss/preset-icons": "^0.57.1",
|
|
42
|
+
"@unocss/preset-uno": "^0.57.1",
|
|
43
|
+
"@vitejs/plugin-vue": "4.4.0",
|
|
44
|
+
"@vue/compiler-sfc": "3.3.7",
|
|
45
|
+
"@vueuse/core": "^10.5.0",
|
|
46
|
+
"less": "^4.2.0",
|
|
47
|
+
"typescript": "5.2.2",
|
|
48
|
+
"unocss": "^0.57.1",
|
|
49
|
+
"vite": "4.5.0",
|
|
50
|
+
"vite-plugin-dts": "^3.6.1",
|
|
51
|
+
"vue": "3.3.7",
|
|
52
|
+
"vue-tsc": "1.8.21"
|
|
53
|
+
},
|
|
54
|
+
"publishConfig": {
|
|
55
|
+
"registry": "https://registry.npmjs.org",
|
|
56
|
+
"access": "public"
|
|
57
|
+
},
|
|
58
|
+
"scripts": {
|
|
59
|
+
"dev": "vite build --watch",
|
|
60
|
+
"build": "vite build",
|
|
61
|
+
"npm:publish": "npm run build && npm publish --access publish"
|
|
62
|
+
}
|
|
63
|
+
}
|