@gopowerteam/modal-render 0.0.47 → 1.0.0
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/components/modal-container.vue.d.ts +19 -60
- package/dist/cjs/components/modal-dialog.vue.d.ts +5 -36
- package/dist/cjs/components/modal-footer.vue.d.ts +9 -3
- package/dist/cjs/components/modal-header.vue.d.ts +9 -3
- package/dist/cjs/components/modal-loading.vue.d.ts +4 -26
- package/dist/cjs/components/modal-provider.vue.d.ts +14 -58
- package/dist/cjs/constants.d.ts +0 -1
- package/dist/cjs/hooks/on-submit.d.ts +0 -1
- package/dist/cjs/hooks/use-modal.d.ts +0 -1
- package/dist/cjs/index.cjs +5 -1
- package/dist/cjs/index.d.ts +3 -4
- package/dist/cjs/interfaces.d.ts +1 -2
- package/dist/cjs/utils/find-container.d.ts +0 -1
- package/dist/es/components/modal-container.vue.d.ts +19 -60
- package/dist/es/components/modal-dialog.vue.d.ts +5 -36
- package/dist/es/components/modal-footer.vue.d.ts +9 -3
- package/dist/es/components/modal-header.vue.d.ts +9 -3
- package/dist/es/components/modal-loading.vue.d.ts +4 -26
- package/dist/es/components/modal-provider.vue.d.ts +14 -58
- package/dist/es/constants.d.ts +0 -1
- package/dist/es/hooks/on-submit.d.ts +0 -1
- package/dist/es/hooks/use-modal.d.ts +0 -1
- package/dist/es/index.d.ts +3 -4
- package/dist/es/index.mjs +547 -474
- package/dist/es/interfaces.d.ts +1 -2
- package/dist/es/utils/find-container.d.ts +0 -1
- package/dist/style.css +1 -1
- package/package.json +25 -22
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Component, CSSProperties } from 'vue';
|
|
2
2
|
import { SizeOptions } from '../interfaces';
|
|
3
|
-
|
|
4
|
-
declare const _default: import('vue').DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
3
|
+
declare const _default: import('vue').DefineComponent<{
|
|
5
4
|
id: string;
|
|
6
5
|
form?: string;
|
|
7
6
|
component: Component;
|
|
@@ -10,8 +9,8 @@ declare const _default: import('vue').DefineComponent<__VLS_WithDefaults<__VLS_T
|
|
|
10
9
|
height?: number | string;
|
|
11
10
|
maxWidth?: number | string;
|
|
12
11
|
maxHeight?: number | string;
|
|
13
|
-
sizes
|
|
14
|
-
size
|
|
12
|
+
sizes?: SizeOptions;
|
|
13
|
+
size?: "small" | "middle" | "large";
|
|
15
14
|
fullscreen?: boolean;
|
|
16
15
|
title?: string;
|
|
17
16
|
header?: boolean;
|
|
@@ -36,27 +35,12 @@ declare const _default: import('vue').DefineComponent<__VLS_WithDefaults<__VLS_T
|
|
|
36
35
|
close: () => void;
|
|
37
36
|
}) => void;
|
|
38
37
|
onCancel?: () => void;
|
|
39
|
-
}
|
|
40
|
-
header: boolean;
|
|
41
|
-
closeable: boolean;
|
|
42
|
-
footer: boolean;
|
|
43
|
-
keyboard: boolean;
|
|
44
|
-
maskClosable: boolean;
|
|
45
|
-
size: string;
|
|
46
|
-
esc: boolean;
|
|
47
|
-
draggable: boolean;
|
|
48
|
-
mode: string;
|
|
49
|
-
position: string;
|
|
50
|
-
submitText: string;
|
|
51
|
-
cancelText: string;
|
|
52
|
-
maxHeight: number;
|
|
53
|
-
zIndex: number;
|
|
54
|
-
}>, {
|
|
38
|
+
}, {
|
|
55
39
|
showLoading: () => () => void;
|
|
56
40
|
hideLoading: () => void;
|
|
57
|
-
},
|
|
41
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
58
42
|
submit: (...args: any[]) => void;
|
|
59
|
-
}, string, import('vue').PublicProps, Readonly<
|
|
43
|
+
}, string, import('vue').PublicProps, Readonly<{
|
|
60
44
|
id: string;
|
|
61
45
|
form?: string;
|
|
62
46
|
component: Component;
|
|
@@ -65,8 +49,8 @@ declare const _default: import('vue').DefineComponent<__VLS_WithDefaults<__VLS_T
|
|
|
65
49
|
height?: number | string;
|
|
66
50
|
maxWidth?: number | string;
|
|
67
51
|
maxHeight?: number | string;
|
|
68
|
-
sizes
|
|
69
|
-
size
|
|
52
|
+
sizes?: SizeOptions;
|
|
53
|
+
size?: "small" | "middle" | "large";
|
|
70
54
|
fullscreen?: boolean;
|
|
71
55
|
title?: string;
|
|
72
56
|
header?: boolean;
|
|
@@ -91,24 +75,9 @@ declare const _default: import('vue').DefineComponent<__VLS_WithDefaults<__VLS_T
|
|
|
91
75
|
close: () => void;
|
|
92
76
|
}) => void;
|
|
93
77
|
onCancel?: () => void;
|
|
94
|
-
}
|
|
95
|
-
header: boolean;
|
|
96
|
-
closeable: boolean;
|
|
97
|
-
footer: boolean;
|
|
98
|
-
keyboard: boolean;
|
|
99
|
-
maskClosable: boolean;
|
|
100
|
-
size: string;
|
|
101
|
-
esc: boolean;
|
|
102
|
-
draggable: boolean;
|
|
103
|
-
mode: string;
|
|
104
|
-
position: string;
|
|
105
|
-
submitText: string;
|
|
106
|
-
cancelText: string;
|
|
107
|
-
maxHeight: number;
|
|
108
|
-
zIndex: number;
|
|
109
|
-
}>>> & {
|
|
78
|
+
}> & Readonly<{
|
|
110
79
|
onSubmit?: ((...args: any[]) => any) | undefined;
|
|
111
|
-
}
|
|
80
|
+
}>, {
|
|
112
81
|
size: "small" | "middle" | "large";
|
|
113
82
|
maxHeight: number | string;
|
|
114
83
|
header: boolean;
|
|
@@ -122,22 +91,12 @@ declare const _default: import('vue').DefineComponent<__VLS_WithDefaults<__VLS_T
|
|
|
122
91
|
submitText: string;
|
|
123
92
|
cancelText: string;
|
|
124
93
|
zIndex: number;
|
|
125
|
-
}, {}
|
|
94
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
95
|
+
wrapperRef: HTMLDivElement;
|
|
96
|
+
contentRef: HTMLDivElement;
|
|
97
|
+
headerRef: HTMLDivElement;
|
|
98
|
+
headerSlotRef: HTMLDivElement;
|
|
99
|
+
footerSlotRef: HTMLDivElement;
|
|
100
|
+
footerRef: HTMLDivElement;
|
|
101
|
+
}, any>;
|
|
126
102
|
export default _default;
|
|
127
|
-
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
128
|
-
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
129
|
-
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
130
|
-
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
131
|
-
} : {
|
|
132
|
-
type: import('vue').PropType<T[K]>;
|
|
133
|
-
required: true;
|
|
134
|
-
};
|
|
135
|
-
};
|
|
136
|
-
type __VLS_WithDefaults<P, D> = {
|
|
137
|
-
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
138
|
-
default: D[K];
|
|
139
|
-
}> : P[K];
|
|
140
|
-
};
|
|
141
|
-
type __VLS_Prettify<T> = {
|
|
142
|
-
[K in keyof T]: T[K];
|
|
143
|
-
} & {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
type:
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
type: 'confirm' | 'success' | 'error' | 'warning' | 'info';
|
|
3
3
|
title?: string;
|
|
4
4
|
content: string;
|
|
5
5
|
okText?: string;
|
|
@@ -7,40 +7,9 @@ declare const _default: import('vue').DefineComponent<__VLS_WithDefaults<__VLS_T
|
|
|
7
7
|
onOk?: () => Promise<void> | void;
|
|
8
8
|
onCancel?: () => Promise<void> | void;
|
|
9
9
|
footer?: () => JSX.Element;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
cancelText: string;
|
|
13
|
-
}>, {}, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
14
|
-
type: "confirm" | "success" | "error" | "warning" | "info";
|
|
15
|
-
title?: string;
|
|
16
|
-
content: string;
|
|
17
|
-
okText?: string;
|
|
18
|
-
cancelText?: string;
|
|
19
|
-
onOk?: () => Promise<void> | void;
|
|
20
|
-
onCancel?: () => Promise<void> | void;
|
|
21
|
-
footer?: () => JSX.Element;
|
|
22
|
-
}>, {
|
|
23
|
-
okText: string;
|
|
24
|
-
cancelText: string;
|
|
25
|
-
}>>>, {
|
|
10
|
+
};
|
|
11
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
26
12
|
cancelText: string;
|
|
27
13
|
okText: string;
|
|
28
|
-
}, {}>;
|
|
14
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLElement>;
|
|
29
15
|
export default _default;
|
|
30
|
-
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
31
|
-
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
32
|
-
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
33
|
-
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
34
|
-
} : {
|
|
35
|
-
type: import('vue').PropType<T[K]>;
|
|
36
|
-
required: true;
|
|
37
|
-
};
|
|
38
|
-
};
|
|
39
|
-
type __VLS_WithDefaults<P, D> = {
|
|
40
|
-
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
41
|
-
default: D[K];
|
|
42
|
-
}> : P[K];
|
|
43
|
-
};
|
|
44
|
-
type __VLS_Prettify<T> = {
|
|
45
|
-
[K in keyof T]: T[K];
|
|
46
|
-
} & {};
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
declare function __VLS_template(): {
|
|
2
|
-
|
|
2
|
+
attrs: Partial<{}>;
|
|
3
|
+
slots: {
|
|
4
|
+
default?(_: {}): any;
|
|
5
|
+
};
|
|
6
|
+
refs: {};
|
|
7
|
+
rootEl: any;
|
|
3
8
|
};
|
|
4
|
-
|
|
5
|
-
declare const
|
|
9
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
10
|
+
declare const __VLS_component: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
11
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
6
12
|
export default _default;
|
|
7
13
|
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
8
14
|
new (): {
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
declare function __VLS_template(): {
|
|
2
|
-
|
|
2
|
+
attrs: Partial<{}>;
|
|
3
|
+
slots: {
|
|
4
|
+
default?(_: {}): any;
|
|
5
|
+
};
|
|
6
|
+
refs: {};
|
|
7
|
+
rootEl: any;
|
|
3
8
|
};
|
|
4
|
-
|
|
5
|
-
declare const
|
|
9
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
10
|
+
declare const __VLS_component: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
11
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
6
12
|
export default _default;
|
|
7
13
|
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
8
14
|
new (): {
|
|
@@ -1,29 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
type __VLS_Props = {
|
|
2
2
|
text?: string;
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
}>, {}, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
6
|
-
text?: string;
|
|
7
|
-
}>, {
|
|
8
|
-
text: string;
|
|
9
|
-
}>>>, {
|
|
3
|
+
};
|
|
4
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
10
5
|
text: string;
|
|
11
|
-
}, {}>;
|
|
6
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLElement>;
|
|
12
7
|
export default _default;
|
|
13
|
-
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
14
|
-
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
15
|
-
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
16
|
-
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
17
|
-
} : {
|
|
18
|
-
type: import('vue').PropType<T[K]>;
|
|
19
|
-
required: true;
|
|
20
|
-
};
|
|
21
|
-
};
|
|
22
|
-
type __VLS_WithDefaults<P, D> = {
|
|
23
|
-
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
24
|
-
default: D[K];
|
|
25
|
-
}> : P[K];
|
|
26
|
-
};
|
|
27
|
-
type __VLS_Prettify<T> = {
|
|
28
|
-
[K in keyof T]: T[K];
|
|
29
|
-
} & {};
|
|
@@ -1,58 +1,31 @@
|
|
|
1
1
|
import { Component } from 'vue';
|
|
2
2
|
import { ModalElement, OpenModalOptions, SizeOptions } from '../interfaces';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
maxHeight: string | number;
|
|
3
|
+
declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<{
|
|
4
|
+
appendToBody?: boolean | string;
|
|
5
|
+
sizes?: SizeOptions;
|
|
6
|
+
maxWidth?: string | number;
|
|
7
|
+
maxHeight?: string | number;
|
|
9
8
|
offset?: {
|
|
10
9
|
x?: number;
|
|
11
10
|
y?: number;
|
|
12
11
|
};
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
maxWidth: string;
|
|
16
|
-
maxHeight: string;
|
|
17
|
-
sizes: () => {
|
|
18
|
-
small: string;
|
|
19
|
-
middle: string;
|
|
20
|
-
large: string;
|
|
21
|
-
};
|
|
22
|
-
offset: () => {
|
|
23
|
-
x: number;
|
|
24
|
-
y: number;
|
|
25
|
-
};
|
|
26
|
-
}>, {
|
|
27
|
-
elements: import('vue').ShallowRef<ModalElement[]>;
|
|
12
|
+
}, {
|
|
13
|
+
elements: import('vue').ShallowRef<ModalElement[], ModalElement[]>;
|
|
28
14
|
open: (component: Component | "confirm" | "info" | "warning" | "error" | "success", props?: Record<string, any>, options?: OpenModalOptions) => Promise<unknown> & {
|
|
29
15
|
close: () => void;
|
|
30
16
|
};
|
|
31
17
|
close: (id: string, data?: any) => void;
|
|
32
18
|
closeAll: () => void;
|
|
33
|
-
},
|
|
34
|
-
appendToBody
|
|
35
|
-
sizes
|
|
36
|
-
maxWidth
|
|
37
|
-
maxHeight
|
|
19
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{
|
|
20
|
+
appendToBody?: boolean | string;
|
|
21
|
+
sizes?: SizeOptions;
|
|
22
|
+
maxWidth?: string | number;
|
|
23
|
+
maxHeight?: string | number;
|
|
38
24
|
offset?: {
|
|
39
25
|
x?: number;
|
|
40
26
|
y?: number;
|
|
41
27
|
};
|
|
42
|
-
}>, {
|
|
43
|
-
appendToBody: boolean;
|
|
44
|
-
maxWidth: string;
|
|
45
|
-
maxHeight: string;
|
|
46
|
-
sizes: () => {
|
|
47
|
-
small: string;
|
|
48
|
-
middle: string;
|
|
49
|
-
large: string;
|
|
50
|
-
};
|
|
51
|
-
offset: () => {
|
|
52
|
-
x: number;
|
|
53
|
-
y: number;
|
|
54
|
-
};
|
|
55
|
-
}>>>, {
|
|
28
|
+
}> & Readonly<{}>, {
|
|
56
29
|
maxWidth: string | number;
|
|
57
30
|
maxHeight: string | number;
|
|
58
31
|
sizes: SizeOptions;
|
|
@@ -61,27 +34,10 @@ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<__
|
|
|
61
34
|
y?: number;
|
|
62
35
|
};
|
|
63
36
|
appendToBody: boolean | string;
|
|
64
|
-
}, {}>, {
|
|
37
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>, {
|
|
65
38
|
default?(_: {}): any;
|
|
66
39
|
}>;
|
|
67
40
|
export default _default;
|
|
68
|
-
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
69
|
-
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
70
|
-
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
71
|
-
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
72
|
-
} : {
|
|
73
|
-
type: import('vue').PropType<T[K]>;
|
|
74
|
-
required: true;
|
|
75
|
-
};
|
|
76
|
-
};
|
|
77
|
-
type __VLS_WithDefaults<P, D> = {
|
|
78
|
-
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
79
|
-
default: D[K];
|
|
80
|
-
}> : P[K];
|
|
81
|
-
};
|
|
82
|
-
type __VLS_Prettify<T> = {
|
|
83
|
-
[K in keyof T]: T[K];
|
|
84
|
-
} & {};
|
|
85
41
|
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
86
42
|
new (): {
|
|
87
43
|
$slots: S;
|
package/dist/cjs/constants.d.ts
CHANGED
package/dist/cjs/index.cjs
CHANGED
|
@@ -1 +1,5 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),L=Symbol("__MODAL__");function W(o){return e.getCurrentScope()?(e.onScopeDispose(o),!0):!1}function b(o){return typeof o=="function"?o():e.unref(o)}const F=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,l={}){if(!e.isRef(o))return e.toRefs(o);const n=Array.isArray(o.value)?Array.from({length:o.value.length}):{};for(const t in o.value)n[t]=e.customRef(()=>({get(){return o.value[t]},set(a){var i;if((i=b(l.replaceRef))!=null?i:!0)if(Array.isArray(o.value)){const h=[...o.value];h[t]=a,o.value=h}else{const h={...o.value,[t]:a};Object.setPrototypeOf(h,Object.getPrototypeOf(o.value)),o.value=h}else o.value[t]=a}}));return n}function oe(o,l=!0,n){ee()?e.onMounted(o,n):l?o():e.nextTick(o)}function N(o){var l;const n=b(o);return(l=n==null?void 0:n.$el)!=null?l:n}const z=F?window:void 0;function P(...o){let l,n,t,a;if(typeof o[0]=="string"||Array.isArray(o[0])?([n,t,a]=o,l=z):[l,n,t,a]=o,!l)return Z;Array.isArray(n)||(n=[n]),Array.isArray(t)||(t=[t]);const i=[],u=()=>{i.forEach(v=>v()),i.length=0},h=(v,f,s,d)=>(v.addEventListener(f,s,d),()=>v.removeEventListener(f,s,d)),w=e.watch(()=>[N(l),b(a)],([v,f])=>{if(u(),!v)return;const s=Q(f)?{...f}:f;i.push(...n.flatMap(d=>t.map(c=>h(v,d,c,s))))},{immediate:!0,flush:"post"}),y=()=>{w(),u()};return W(y),y}function ne(){const o=e.ref(!1),l=e.getCurrentInstance();return l&&e.onMounted(()=>{o.value=!0},l),o}function re(o){const l=ne();return e.computed(()=>(l.value,!!o()))}function le(o,l={}){var n,t;const{pointerTypes:a,preventDefault:i,stopPropagation:u,exact:h,onMove:w,onEnd:y,onStart:v,initialValue:f,axis:s="both",draggingElement:d=z,containerElement:c,handle:g=o}=l,p=e.ref((n=b(f))!=null?n:{x:0,y:0}),_=e.ref(),M=m=>a?a.includes(m.pointerType):!0,x=m=>{b(i)&&m.preventDefault(),b(u)&&m.stopPropagation()},$=m=>{var S;if(m.button!==0||b(l.disabled)||!M(m)||b(h)&&m.target!==b(o))return;const k=b(c),B=(S=k==null?void 0:k.getBoundingClientRect)==null?void 0:S.call(k),C=b(o).getBoundingClientRect(),O={x:m.clientX-(k?C.left-B.left+k.scrollLeft:C.left),y:m.clientY-(k?C.top-B.top+k.scrollTop:C.top)};(v==null?void 0:v(O,m))!==!1&&(_.value=O,x(m))},H=m=>{if(b(l.disabled)||!M(m)||!_.value)return;const S=b(c),k=b(o).getBoundingClientRect();let{x:B,y:C}=p.value;(s==="x"||s==="both")&&(B=m.clientX-_.value.x,S&&(B=Math.min(Math.max(0,B),S.scrollWidth-k.width))),(s==="y"||s==="both")&&(C=m.clientY-_.value.y,S&&(C=Math.min(Math.max(0,C),S.scrollHeight-k.height))),p.value={x:B,y:C},w==null||w(p.value,m),x(m)},A=m=>{b(l.disabled)||!M(m)||_.value&&(_.value=void 0,y==null||y(p.value,m),x(m))};if(F){const m={capture:(t=l.capture)!=null?t:!0};P(g,"pointerdown",$,m),P(d,"pointermove",H,m),P(d,"pointerup",A,m)}return{...te(p),position:p,isDragging:e.computed(()=>!!_.value),style:e.computed(()=>`left:${p.value.x}px;top:${p.value.y}px;`)}}function ie(o,l,n={}){const{window:t=z,...a}=n;let i;const u=re(()=>t&&"ResizeObserver"in t),h=()=>{i&&(i.disconnect(),i=void 0)},w=e.computed(()=>Array.isArray(o)?o.map(f=>N(f)):[N(o)]),y=e.watch(w,f=>{if(h(),u.value&&t){i=new ResizeObserver(l);for(const s of f)s&&i.observe(s,a)}},{immediate:!0,flush:"post"}),v=()=>{h(),y()};return W(v),{isSupported:u,stop:v}}function R(o,l={width:0,height:0},n={}){const{window:t=z,box:a="content-box"}=n,i=e.computed(()=>{var f,s;return(s=(f=N(o))==null?void 0:f.namespaceURI)==null?void 0:s.includes("svg")}),u=e.ref(l.width),h=e.ref(l.height),{stop:w}=ie(o,([f])=>{const s=a==="border-box"?f.borderBoxSize:a==="content-box"?f.contentBoxSize:f.devicePixelContentBoxSize;if(t&&i.value){const d=N(o);if(d){const c=d.getBoundingClientRect();u.value=c.width,h.value=c.height}}else if(s){const d=Array.isArray(s)?s:[s];u.value=d.reduce((c,{inlineSize:g})=>c+g,0),h.value=d.reduce((c,{blockSize:g})=>c+g,0)}else u.value=f.contentRect.width,h.value=f.contentRect.height},n);oe(()=>{const f=N(o);f&&(u.value="offsetWidth"in f?f.offsetWidth:l.width,h.value="offsetHeight"in f?f.offsetHeight:l.height)});const y=e.watch(()=>N(o),f=>{u.value=f?l.width:0,h.value=f?l.height:0});function v(){w(),y()}return{width:u,height:h,stop:v}}const se=o=>(e.pushScopeId("data-v-e065fedd"),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:!1},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},onOk:{},onCancel:{}},emits:["submit"],setup(o,{expose:l,emit:n}){e.useCssVars(r=>({"0b220c17":r.zIndex}));const t=o,a=n,i=e.inject(L),u=e.ref(!1);let h=0,w=0;const y=e.shallowRef(),v=e.shallowRef(),f=e.shallowRef(),s=e.shallowRef(),d=e.shallowRef(),c=e.shallowRef(),{height:g}=R(y),{height:p}=R(f,void 0,{box:"border-box"}),{height:_}=R(s,void 0,{box:"border-box"}),{height:M}=R(d),{height:x}=R(c),{x:$,y:H}=le(f,{initialValue:{x:0,y:0}});function A(){i==null||i.close(t.id)}function m(r){return typeof r=="number"?`${r}px`:r}const S=e.computed(()=>{const r={};return t.mode==="dialog"&&(r.justifyContent="center"),t.mode==="drawer"&&(r.justifyContent={left:"flex-start",right:"flex-end",top:"flex-start",bottom:"flex-end"}[t.position],r.flexDirection={left:"row",right:"row",top:"column",bottom:"column"}[t.position]),r}),k=e.computed(()=>{const r={};return t.mode==="drawer"&&["top","bottom"].includes(t.position)?r.maxHeight=m(t.maxHeight):(r.width=m(t.sizes[t.size]),r.maxWidth=m(t.maxWidth)),t.width&&(r.width=m(t.width)),t.height&&(r.height=m(t.height)),t.fullscreen&&(r.maxWidth="unset",r.width="100%",r.position="fixed",r.top=0,r.left=0,r.bottom=0,r.right=0,r.borderRadius=0),t.draggable&&!t.fullscreen&&t.mode==="dialog"&&(r.transform=`translate3d(${$.value-h}px, ${H.value-w}px, 0px)`),t.mode==="drawer"&&(r.borderRadius=0,["left","right"].includes(t.position)?r.height="100%":r.width="100%"),t.offset&&t.mode==="dialog"&&(r.marginLeft=`${t.offset.x||0}px`,r.marginTop=`${t.offset.y||0}px`),t.backgroundColor&&(r.backgroundColor=t.backgroundColor),r}),B=e.computed(()=>{const r={};return t.draggable&&!t.fullscreen&&t.mode==="dialog"&&(r.cursor="move"),r}),C=e.computed(()=>{const r={},E=M.value+x.value+p.value+_.value,D=Math.floor(g.value*(Number(m(t.maxHeight).replace("%",""))/100));return t.maxHeight&&(r.maxHeight=`${D-E}px`),t.mode==="drawer"&&(r.maxHeight="unset",["left","right"].includes(t.position)&&(r.height=`${g.value-E}px`)),t.fullscreen&&(r.maxHeight="unset",r.height=`calc(100% - ${E}px)`),t.type!=="component"&&(r.padding="0"),t.bodyStyle&&Object.assign(r,t.bodyStyle),r});function O(){const r=v.value;if(t.form&&r){const E=r.querySelector(`form[name="${t.form}"]`);E&&E.dispatchEvent(new Event("submit"))}t.onOk&&t.onOk({close:()=>i==null?void 0:i.close(t.id)}),a("submit")}function K(){i==null||i.close(t.id),t!=null&&t.onCancel&&t.onCancel()}function X(){window&&window.addEventListener("resize",()=>{e.triggerRef(y),e.triggerRef(v),v.value&&(h=v.value.offsetLeft,w=v.value.offsetTop)})}function Y(){if(t.closeable&&t.esc){const r=({key:E})=>{E==="Escape"&&(i==null||i.close(t.id),window.removeEventListener("keydown",r))};window.addEventListener("keydown",r)}}function q(){h=v.value.offsetLeft,w=v.value.offsetTop}e.onMounted(()=>{Y(),X()}),e.onUnmounted(()=>{});function U(){return u.value=!0,()=>I()}function I(){u.value=!1}return l({showLoading:U,hideLoading:I}),(r,E)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"wrapperRef",ref:y,class:"modal-wrapper",style:e.normalizeStyle(S.value),onClick:E[0]||(E[0]=e.withModifiers(D=>r.maskClosable&&A(),["self"]))},[e.createElementVNode("div",{ref_key:"contentRef",ref:v,class:e.normalizeClass(["modal-content",{[`${r.mode}-mode`]:!0,[`${r.position}-position`]:!0}]),style:e.normalizeStyle(k.value)},[r.header?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"headerRef",ref:f,class:"modal-header",style:e.normalizeStyle(B.value),onMousedown:q},[e.createElementVNode("div",ae,e.toDisplayString(r.title),1),e.createElementVNode("div",ce,[r.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:d},null,512),e.createElementVNode("div",{class:"modal-body",style:e.normalizeStyle(C.value)},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(r.component),e.normalizeProps(e.guardReactiveProps(r.componentProps)),null,16))],4),e.createElementVNode("div",{id:"modal-footer-slot",ref_key:"footerSlotRef",ref:c},null,512),r.footer?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"footerRef",ref:s,class:"modal-footer space-x-2"},[e.createElementVNode("button",{class:"cancel-button",type:"button",onClick:K},e.toDisplayString(r.cancelText),1),e.createElementVNode("button",{class:"submit-button",form:r.form,type:"button",onClick:O},e.toDisplayString(r.submitText),9,de)],512)):e.createCommentVNode("",!0),u.value?(e.openBlock(),e.createElementBlock("div",ue,pe)):e.createCommentVNode("",!0)],6)],4))}}),V=(o,l)=>{const n=o.__vccOpts||o;for(const[t,a]of l)n[t]=a;return n},j=V(he,[["__scopeId","data-v-e065fedd"]]),ve={class:"modal-dialog"},ge={class:"dialog-body"},ye={class:"dialog-title"},be={class:"dialog-content"},we=e.defineComponent({__name:"modal-dialog",props:{type:{},title:{},content:{},okText:{default:"确定"},cancelText:{default:"取消"},onOk:{},onCancel:{},footer:{}},setup(o){const l=o,n=G(),t=e.computed(()=>l.title?l.title:{confirm:"提示",info:"提示",warning:"警告",error:"错误",success:"成功"}[l.type]);async function a(){l.onOk&&await l.onOk(),n.close()}async function i(){l.onCancel&&await l.onCancel(),n.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",be,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:a},e.toDisplayString(u.okText),1),u.type==="confirm"?(e.openBlock(),e.createElementBlock("button",{key:0,class:"cancel-button",type:"button",onClick:i},e.toDisplayString(u.cancelText),1)):e.createCommentVNode("",!0)],64))],4)]))}}),ke=V(we,[["__scopeId","data-v-0c6b8db2"]]),_e=o=>(e.pushScopeId("data-v-559bdf2e"),o=o(),e.popScopeId(),o),Ce={class:"flex-center"},Ee=_e(()=>e.createElementVNode("div",{class:"modal-loading"},[e.createElementVNode("div",{class:"lds-ring"},[e.createElementVNode("div"),e.createElementVNode("div"),e.createElementVNode("div"),e.createElementVNode("div")])],-1)),xe={class:"modal-loading-text"},Se=e.defineComponent({__name:"modal-loading",props:{text:{default:"加载中"}},setup(o){return(l,n)=>(e.openBlock(),e.createElementBlock("section",Ce,[Ee,e.createElementVNode("div",xe,e.toDisplayString(l.text),1)]))}}),Be=V(Se,[["__scopeId","data-v-559bdf2e"]]),Me={key:0,class:"modal-teleport"},Ne={name:"ModalProvider",inheritAttrs:!1},Ve=e.defineComponent({...Ne,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:l}){const n=e.shallowRef([]),t=e.ref(!1),a=e.getCurrentInstance();function i(s,d={},c={}){const g=e.defineAsyncComponent(()=>Promise.resolve(typeof s=="string"?ke:s));typeof s=="string"&&(d.type=s,c.size="small",c.fullscreen=!1,c.mode="dialog",c.footer=!1,c.header=!1);const p=Math.random().toString(32).slice(2),_=Object.assign({zIndex:typeof s=="string"?1100:1e3},c),M=new Promise((x,$)=>{n.value.push({id:p,component:g,props:d||{},options:{..._,type:typeof s=="string"?s:"component"},resolve:x,reject:$,listeners:[]}),e.triggerRef(n)}).catch(x=>x==="CANCEL"?new Promise(()=>{}):Promise.reject(x));return Object.assign(M,{close:()=>u(p)})}function u(s,d){const c=n.value.findIndex(p=>p.id===s);if(c<0)return;const g=n.value[c];d===void 0?g==null||g.reject("CANCEL"):g==null||g.resolve(d),n.value.splice(c,1),e.triggerRef(n)}function h(){!n.value||n.value.length===0||(n.value.forEach(s=>{s==null||s.reject("CANCEL")}),n.value=[],e.triggerRef(n))}function w(s,d){const c=n.value.find(p=>p.id===s);if(!c)return;const g=c.listeners.find(p=>p.event===d);g&&g.callback({open:i,close:p=>u(c.id,p),closeAll:h,showLoading:()=>y(c.id),hideLoading:()=>v(c.id),confirm:p=>i("confirm",p),success:p=>i("success",p),error:p=>i("error",p),warning:p=>i("warning",p),info:p=>i("info",p)})}function y(s,d){if(!a)return;const[c]=a.refs[`modal-container_${s}`]||[];if(c)return c.showLoading();{const{close:g}=i(Be,{text:d==null?void 0:d.text},{footer:!1,header:!1,closeable:!1,backgroundColor:"transparent"});return d!=null&&d.duration&&setTimeout(()=>{g()},d==null?void 0:d.duration),g}}function v(s){if(!a)return;const[d]=a.refs[`modal-container_${s}`];if(d)return d.hideLoading()}function f(s,d,c){const g=n.value.find(p=>p.id===s);g&&g.listeners.push({event:d,callback:c})}return e.provide(L,{open:i,close:u,closeAll:h,addEventListener:f,showLoading:y,hideLoading:v}),l({elements:n,open:i,close:u,closeAll:h}),e.onMounted(()=>{t.value=!0}),(s,d)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.renderSlot(s.$slots,"default",{},void 0,!0),t.value?(e.openBlock(),e.createElementBlock("div",Me,[(e.openBlock(),e.createBlock(e.Teleport,{disabled:!s.appendToBody,to:typeof s.appendToBody=="string"?s.appendToBody:"body"},[e.createVNode(e.TransitionGroup,{name:"modal-fade"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,c=>(e.openBlock(),e.createBlock(j,e.mergeProps({id:c.id,key:c.id,ref_for:!0,ref:`modal-container_${c.id}`,component:c.component,"component-props":c.props,"max-height":s.maxHeight,"max-width":s.maxWidth,offset:s.offset,sizes:s.sizes},c.options,{onSubmit:()=>w(c.id,"submit")}),null,16,["id","component","component-props","max-height","max-width","offset","sizes","onSubmit"]))),128))]),_:1})],8,["disabled","to"]))])):e.createCommentVNode("",!0)],64))}}),$e=V(Ve,[["__scopeId","data-v-448d3772"]]),Re={},Le={class:"modal-footer"};function Ae(o,l){return e.openBlock(),e.createBlock(e.Teleport,{to:"#modal-footer-slot"},[e.createElementVNode("div",Le,[e.renderSlot(o.$slots,"default",{},void 0,!0)])])}const Oe=V(Re,[["render",Ae],["__scopeId","data-v-46f8d703"]]),Te={},ze={class:"modal-header"};function He(o,l){return e.openBlock(),e.createBlock(e.Teleport,{to:"#modal-header-slot"},[e.createElementVNode("div",ze,[e.renderSlot(o.$slots,"default",{},void 0,!0)])])}const Pe=V(Te,[["render",He],["__scopeId","data-v-d0247172"]]);function T(o,l){var t,a;let n=o==null?void 0:o.parent;for(;n&&((t=n==null?void 0:n.type)==null?void 0:t.name)!==l;)n=n.parent;return((a=n==null?void 0:n.type)==null?void 0:a.name)===l?n:null}function G(){const o=e.inject(L),l=e.getCurrentInstance();function n(t,a,i){if(!o)throw new Error("Not Found Modal Provider Component");return o.open(t,a,i)}return{open:n,close(t){var u;if(!o)throw new Error("Not Found Modal Provider Component");const a=T(l,"ModalContainer"),i=(u=a==null?void 0:a.props)==null?void 0:u.id;if(!i)throw new Error("Not Found Current Modal Container");o.close(i,t)},closeAll(){if(!o)throw new Error("Not Found Modal Provider Component");o.closeAll()},showLoading(t){var u;if(!o)throw new Error("Not Found Modal Provider Component");const a=T(l,"ModalContainer"),i=(u=a==null?void 0:a.props)==null?void 0:u.id;return o.showLoading(i,t)},hideLoading(){var i;if(!o)throw new Error("Not Found Modal Provider Component");const t=T(l,"ModalContainer"),a=(i=t==null?void 0:t.props)==null?void 0:i.id;return o.hideLoading(a)},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 Ie(o){var i;const l=e.inject(L),n=e.getCurrentInstance(),t=T(n,"ModalContainer"),a=(i=t==null?void 0:t.props)==null?void 0:i.id;l&&a&&l.addEventListener(a,"submit",o)}exports.ModalContainer=j;exports.ModalFooter=Oe;exports.ModalHeader=Pe;exports.ModalKey=L;exports.ModalProvider=$e;exports.onSubmit=Ie;exports.useModal=G;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue");function ue(t,l){return e.getCurrentScope()?(e.onScopeDispose(t,l),!0):!1}const ae=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const fe=Object.prototype.toString,me=t=>fe.call(t)==="[object Object]";function q(t){return Array.isArray(t)?t:[t]}function he(t){return e.getCurrentInstance()}function pe(t,l={}){if(!e.isRef(t))return e.toRefs(t);const n=Array.isArray(t.value)?Array.from({length:t.value.length}):{};for(const o in t.value)n[o]=e.customRef(()=>({get(){return t.value[o]},set(s){var a;if(!((a=e.toValue(l.replaceRef))!==null&&a!==void 0)||a)if(Array.isArray(t.value)){const f=[...t.value];f[o]=s,t.value=f}else{const f={...t.value,[o]:s};Object.setPrototypeOf(f,Object.getPrototypeOf(t.value)),t.value=f}else t.value[o]=s}}));return n}function ve(t,l=!0,n){he()?e.onMounted(t,n):l?t():e.nextTick(t)}function ge(t,l,n){return e.watch(t,l,{...n,immediate:!0})}const J=ae?window:void 0;function _(t){var l;const n=e.toValue(t);return(l=n?.$el)!==null&&l!==void 0?l:n}function oe(...t){const l=(o,s,a,f)=>(o.addEventListener(s,a,f),()=>o.removeEventListener(s,a,f)),n=e.computed(()=>{const o=q(e.toValue(t[0])).filter(s=>s!=null);return o.every(s=>typeof s!="string")?o:void 0});return ge(()=>{var o,s;return[(o=(s=n.value)===null||s===void 0?void 0:s.map(a=>_(a)))!==null&&o!==void 0?o:[J].filter(a=>a!=null),q(e.toValue(n.value?t[1]:t[0])),q(e.unref(n.value?t[2]:t[1])),e.toValue(n.value?t[3]:t[2])]},([o,s,a,f],b,S)=>{if(!o?.length||!s?.length||!a?.length)return;const k=me(f)?{...f}:f,y=o.flatMap(d=>s.flatMap(m=>a.map(p=>l(d,m,p,k))));S(()=>{y.forEach(d=>d())})},{flush:"post"})}function ye(){const t=e.shallowRef(!1),l=e.getCurrentInstance();return l&&e.onMounted(()=>{t.value=!0},l),t}function xe(t){const l=ye();return e.computed(()=>(l.value,!!t()))}const K={speed:2,margin:30,direction:"both"};function be(t){t.scrollLeft>t.scrollWidth-t.clientWidth&&(t.scrollLeft=Math.max(0,t.scrollWidth-t.clientWidth)),t.scrollTop>t.scrollHeight-t.clientHeight&&(t.scrollTop=Math.max(0,t.scrollHeight-t.clientHeight))}function we(t,l={}){var n,o,s,a;const{pointerTypes:f,preventDefault:b,stopPropagation:S,exact:k,onMove:y,onEnd:d,onStart:m,initialValue:p,axis:c="both",draggingElement:x=J,containerElement:v,handle:A=t,buttons:O=[0],restrictInView:L,autoScroll:B=!1}=l,V=e.ref((n=e.toValue(p))!==null&&n!==void 0?n:{x:0,y:0}),M=e.ref(),N=i=>f?f.includes(i.pointerType):!0,P=i=>{e.toValue(b)&&i.preventDefault(),e.toValue(S)&&i.stopPropagation()},R=e.toValue(B),$=typeof R=="object"?{speed:(o=e.toValue(R.speed))!==null&&o!==void 0?o:K.speed,margin:(s=e.toValue(R.margin))!==null&&s!==void 0?s:K.margin,direction:(a=R.direction)!==null&&a!==void 0?a:K.direction}:K,W=i=>typeof i=="number"?[i,i]:[i.x,i.y],I=(i,u,h)=>{const{clientWidth:w,clientHeight:g,scrollLeft:E,scrollTop:X,scrollWidth:te,scrollHeight:de}=i,[ne,le]=W($.margin),[ie,re]=W($.speed);let Y=0,G=0;($.direction==="x"||$.direction==="both")&&(h.x<ne&&E>0?Y=-ie:h.x+u.width>w-ne&&E<te-w&&(Y=ie)),($.direction==="y"||$.direction==="both")&&(h.y<le&&X>0?G=-re:h.y+u.height>g-le&&X<de-g&&(G=re)),(Y||G)&&i.scrollBy({left:Y,top:G,behavior:"auto"})};let T=null;const Q=()=>{const i=e.toValue(v);i&&!T&&(T=setInterval(()=>{const u=e.toValue(t).getBoundingClientRect(),{x:h,y:w}=V.value,g={x:h-i.scrollLeft,y:w-i.scrollTop};g.x>=0&&g.y>=0&&(I(i,u,g),g.x+=i.scrollLeft,g.y+=i.scrollTop,V.value=g)},1e3/60))},F=()=>{T&&(clearInterval(T),T=null)},Z=(i,u,h,w)=>{const[g,E]=typeof h=="number"?[h,h]:[h.x,h.y],{clientWidth:X,clientHeight:te}=u;return i.x<g||i.x+w.width>X-g||i.y<E||i.y+w.height>te-E},ee=()=>{if(e.toValue(l.disabled)||!M.value)return;const i=e.toValue(v);if(!i)return;const u=e.toValue(t).getBoundingClientRect(),{x:h,y:w}=V.value;Z({x:h-i.scrollLeft,y:w-i.scrollTop},i,$.margin,u)?Q():F()};e.toValue(B)&&e.watch(V,ee);const j=i=>{var u;if(!e.toValue(O).includes(i.button)||e.toValue(l.disabled)||!N(i)||e.toValue(k)&&i.target!==e.toValue(t))return;const h=e.toValue(v),w=h==null||(u=h.getBoundingClientRect)===null||u===void 0?void 0:u.call(h),g=e.toValue(t).getBoundingClientRect(),E={x:i.clientX-(h?g.left-w.left+(B?0:h.scrollLeft):g.left),y:i.clientY-(h?g.top-w.top+(B?0:h.scrollTop):g.top)};m?.(E,i)!==!1&&(M.value=E,P(i))},r=i=>{if(e.toValue(l.disabled)||!N(i)||!M.value)return;const u=e.toValue(v);u instanceof HTMLElement&&be(u);const h=e.toValue(t).getBoundingClientRect();let{x:w,y:g}=V.value;if((c==="x"||c==="both")&&(w=i.clientX-M.value.x,u&&(w=Math.min(Math.max(0,w),u.scrollWidth-h.width))),(c==="y"||c==="both")&&(g=i.clientY-M.value.y,u&&(g=Math.min(Math.max(0,g),u.scrollHeight-h.height))),e.toValue(B)&&u&&(T===null&&I(u,h,{x:w,y:g}),w+=u.scrollLeft,g+=u.scrollTop),u&&(L||B)){if(c!=="y"){const E=w-u.scrollLeft;E<0?w=u.scrollLeft:E>u.clientWidth-h.width&&(w=u.clientWidth-h.width+u.scrollLeft)}if(c!=="x"){const E=g-u.scrollTop;E<0?g=u.scrollTop:E>u.clientHeight-h.height&&(g=u.clientHeight-h.height+u.scrollTop)}}V.value={x:w,y:g},y?.(V.value,i),P(i)},C=i=>{e.toValue(l.disabled)||!N(i)||M.value&&(M.value=void 0,B&&F(),d?.(V.value,i),P(i))};if(ae){const i=()=>{var u;return{capture:(u=l.capture)!==null&&u!==void 0?u:!0,passive:!e.toValue(b)}};oe(A,"pointerdown",j,i),oe(x,"pointermove",r,i),oe(x,"pointerup",C,i)}return{...pe(V),position:V,isDragging:e.computed(()=>!!M.value),style:e.computed(()=>`
|
|
2
|
+
left: ${V.value.x}px;
|
|
3
|
+
top: ${V.value.y}px;
|
|
4
|
+
${B?"text-wrap: nowrap;":""}
|
|
5
|
+
`)}}function ke(t,l,n={}){const{window:o=J,...s}=n;let a;const f=xe(()=>o&&"ResizeObserver"in o),b=()=>{a&&(a.disconnect(),a=void 0)},S=e.watch(e.computed(()=>{const y=e.toValue(t);return Array.isArray(y)?y.map(d=>_(d)):[_(y)]}),y=>{if(b(),f.value&&o){a=new ResizeObserver(l);for(const d of y)d&&a.observe(d,s)}},{immediate:!0,flush:"post"}),k=()=>{b(),S()};return ue(k),{isSupported:f,stop:k}}function z(t,l={width:0,height:0},n={}){const{window:o=J,box:s="content-box"}=n,a=e.computed(()=>{var d;return(d=_(t))===null||d===void 0||(d=d.namespaceURI)===null||d===void 0?void 0:d.includes("svg")}),f=e.shallowRef(l.width),b=e.shallowRef(l.height),{stop:S}=ke(t,([d])=>{const m=s==="border-box"?d.borderBoxSize:s==="content-box"?d.contentBoxSize:d.devicePixelContentBoxSize;if(o&&a.value){const p=_(t);if(p){const c=p.getBoundingClientRect();f.value=c.width,b.value=c.height}}else if(m){const p=q(m);f.value=p.reduce((c,{inlineSize:x})=>c+x,0),b.value=p.reduce((c,{blockSize:x})=>c+x,0)}else f.value=d.contentRect.width,b.value=d.contentRect.height},n);ve(()=>{const d=_(t);d&&(f.value="offsetWidth"in d?d.offsetWidth:l.width,b.value="offsetHeight"in d?d.offsetHeight:l.height)});const k=e.watch(()=>_(t),d=>{f.value=d?l.width:0,b.value=d?l.height:0});function y(){S(),k()}return{width:f,height:b,stop:y}}const D=Symbol("__MODAL__"),Ce={class:"title text-16px font-bold"},Ve={class:"action"},Ee=["form"],Se={key:2,class:"modal-loading"},Be={name:"ModalContainer",inheritAttrs:!1},Me=e.defineComponent({...Be,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},onOk:{},onCancel:{}},emits:["submit"],setup(t,{expose:l,emit:n}){e.useCssVars(r=>({v4586ed24:r.zIndex}));const o=t,s=n,a=e.inject(D),f=e.ref(!1);let b=0,S=0;const k=e.shallowRef(),y=e.shallowRef(),d=e.shallowRef(),m=e.shallowRef(),p=e.shallowRef(),c=e.shallowRef(),{height:x}=z(k),{height:v}=z(d,void 0,{box:"border-box"}),{height:A}=z(m,void 0,{box:"border-box"}),{height:O}=z(p),{height:L}=z(c),{x:B,y:V}=we(d,{initialValue:{x:0,y:0}});function M(){a?.close(o.id)}function N(r){return typeof r=="number"?`${r}px`:r}const P=e.computed(()=>{const r={};return o.mode==="dialog"&&(r.justifyContent="center"),o.mode==="drawer"&&(r.justifyContent={left:"flex-start",right:"flex-end",top:"flex-start",bottom:"flex-end"}[o.position],r.flexDirection={left:"row",right:"row",top:"column",bottom:"column"}[o.position]),r}),R=e.computed(()=>{const r={};return o.mode==="drawer"&&["top","bottom"].includes(o.position)?r.maxHeight=N(o.maxHeight):(r.width=N(o.sizes[o.size]),r.maxWidth=N(o.maxWidth)),o.width&&(r.width=N(o.width)),o.height&&(r.height=N(o.height)),o.fullscreen&&(r.maxWidth="unset",r.width="100%",r.position="fixed",r.top=0,r.left=0,r.bottom=0,r.right=0,r.borderRadius=0),o.draggable&&!o.fullscreen&&o.mode==="dialog"&&(r.transform=`translate3d(${B.value-b}px, ${V.value-S}px, 0px)`),o.mode==="drawer"&&(r.borderRadius=0,["left","right"].includes(o.position)?r.height="100%":r.width="100%"),o.offset&&o.mode==="dialog"&&(r.marginLeft=`${o.offset.x||0}px`,r.marginTop=`${o.offset.y||0}px`),o.backgroundColor&&(r.backgroundColor=o.backgroundColor),r}),$=e.computed(()=>{const r={};return o.draggable&&!o.fullscreen&&o.mode==="dialog"&&(r.cursor="move"),r}),W=e.computed(()=>{const r={},C=O.value+L.value+v.value+A.value,i=Math.floor(x.value*(Number(N(o.maxHeight).replace("%",""))/100));return o.maxHeight&&(r.maxHeight=`${i-C}px`),o.mode==="drawer"&&(r.maxHeight="unset",["left","right"].includes(o.position)&&(r.height=`${x.value-C}px`)),o.fullscreen&&(r.maxHeight="unset",r.height=`calc(100% - ${C}px)`),o.type!=="component"&&(r.padding="0"),o.bodyStyle&&Object.assign(r,o.bodyStyle),r});function I(){const r=y.value;if(o.form&&r){const C=r.querySelector(`form[name="${o.form}"]`);C&&C.dispatchEvent(new Event("submit"))}o.onOk&&o.onOk({close:()=>a?.close(o.id)}),s("submit")}function T(){a?.close(o.id),o?.onCancel&&o.onCancel()}function Q(){window&&window.addEventListener("resize",()=>{e.triggerRef(k),e.triggerRef(y),y.value&&(b=y.value.offsetLeft,S=y.value.offsetTop)})}function F(){if(o.closeable&&o.esc){const r=({key:C})=>{C==="Escape"&&(a?.close(o.id),window.removeEventListener("keydown",r))};window.addEventListener("keydown",r)}}function Z(){b=y.value.offsetLeft,S=y.value.offsetTop}e.onMounted(()=>{F(),Q()}),e.onUnmounted(()=>{});function ee(){return f.value=!0,()=>j()}function j(){f.value=!1}return l({showLoading:ee,hideLoading:j}),(r,C)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"wrapperRef",ref:k,class:"modal-wrapper",style:e.normalizeStyle(P.value),onClick:C[0]||(C[0]=e.withModifiers(i=>t.maskClosable&&M(),["self"]))},[e.createElementVNode("div",{ref_key:"contentRef",ref:y,class:e.normalizeClass(["modal-content",{[`${t.mode}-mode`]:!0,[`${t.position}-position`]:!0}]),style:e.normalizeStyle(R.value)},[t.header?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"headerRef",ref:d,class:"modal-header",style:e.normalizeStyle($.value),onMousedown:Z},[e.createElementVNode("div",Ce,e.toDisplayString(t.title),1),e.createElementVNode("div",Ve,[t.closeable?(e.openBlock(),e.createElementBlock("div",{key:0,class:"i-icon-park-outline:close block cursor-pointer",onClick:M})):e.createCommentVNode("",!0)])],36)):e.createCommentVNode("",!0),e.createElementVNode("div",{id:"modal-header-slot",ref_key:"headerSlotRef",ref:p},null,512),e.createElementVNode("div",{class:"modal-body",style:e.normalizeStyle(W.value)},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.component),e.normalizeProps(e.guardReactiveProps(t.componentProps)),null,16))],4),e.createElementVNode("div",{id:"modal-footer-slot",ref_key:"footerSlotRef",ref:c},null,512),t.footer?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"footerRef",ref:m,class:"modal-footer space-x-2"},[e.createElementVNode("button",{class:"cancel-button",type:"button",onClick:T},e.toDisplayString(t.cancelText),1),e.createElementVNode("button",{class:"submit-button",form:t.form,type:"submit",onClick:I},e.toDisplayString(t.submitText),9,Ee)],512)):e.createCommentVNode("",!0),f.value?(e.openBlock(),e.createElementBlock("div",Se,[...C[1]||(C[1]=[e.createElementVNode("div",{class:"lds-ring"},[e.createElementVNode("div"),e.createElementVNode("div"),e.createElementVNode("div"),e.createElementVNode("div")],-1)])])):e.createCommentVNode("",!0)],6)],4))}}),H=(t,l)=>{const n=t.__vccOpts||t;for(const[o,s]of l)n[o]=s;return n},se=H(Me,[["__scopeId","data-v-1d490f4f"]]),Ne={},$e={class:"modal-footer"};function Le(t,l){return e.openBlock(),e.createBlock(e.Teleport,{to:"#modal-footer-slot"},[e.createElementVNode("div",$e,[e.renderSlot(t.$slots,"default",{},void 0,!0)])])}const Te=H(Ne,[["render",Le],["__scopeId","data-v-2b3b820b"]]),_e={},Re={class:"modal-header"};function He(t,l){return e.openBlock(),e.createBlock(e.Teleport,{to:"#modal-header-slot"},[e.createElementVNode("div",Re,[e.renderSlot(t.$slots,"default",{},void 0,!0)])])}const Ae=H(_e,[["render",He],["__scopeId","data-v-4d035831"]]),Oe={class:"modal-dialog"},Pe={class:"dialog-body"},ze={class:"dialog-title"},De={class:"dialog-content"},We=e.defineComponent({__name:"modal-dialog",props:{type:{},title:{},content:{},okText:{default:"确定"},cancelText:{default:"取消"},onOk:{},onCancel:{},footer:{}},setup(t){const l=t,n=ce(),o=e.computed(()=>l.title?l.title:{confirm:"提示",info:"提示",warning:"警告",error:"错误",success:"成功"}[l.type]);async function s(){l.onOk&&await l.onOk(),n.close()}async function a(){l.onCancel&&await l.onCancel(),n.close()}return(f,b)=>(e.openBlock(),e.createElementBlock("section",Oe,[e.createElementVNode("div",Pe,[e.createElementVNode("div",ze,e.toDisplayString(o.value),1),e.createElementVNode("div",De,e.toDisplayString(t.content),1)]),e.createElementVNode("div",{class:"dialog-footer space-x-2",style:e.normalizeStyle(t.type==="confirm"?{"justify-content":"end"}:{"border-top":"none"})},[t.footer?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.footer),{key:0})):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("button",{class:"submit-button",type:"button",onClick:s},e.toDisplayString(t.okText),1),t.type==="confirm"?(e.openBlock(),e.createElementBlock("button",{key:0,class:"cancel-button",type:"button",onClick:a},e.toDisplayString(t.cancelText),1)):e.createCommentVNode("",!0)],64))],4)]))}}),Ie=H(We,[["__scopeId","data-v-f5ece095"]]),Fe={class:"flex-center"},je={class:"modal-loading-text"},Xe=e.defineComponent({__name:"modal-loading",props:{text:{default:"加载中"}},setup(t){return(l,n)=>(e.openBlock(),e.createElementBlock("section",Fe,[n[0]||(n[0]=e.createElementVNode("div",{class:"modal-loading"},[e.createElementVNode("div",{class:"lds-ring"},[e.createElementVNode("div"),e.createElementVNode("div"),e.createElementVNode("div"),e.createElementVNode("div")])],-1)),e.createElementVNode("div",je,e.toDisplayString(t.text),1)]))}}),Ye=H(Xe,[["__scopeId","data-v-27aee8fa"]]),Ge={key:0,class:"modal-teleport"},Ke={name:"ModalProvider",inheritAttrs:!1},qe=e.defineComponent({...Ke,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(t,{expose:l}){const n=e.shallowRef([]),o=e.ref(!1),s=e.getCurrentInstance();function a(m,p={},c={}){const x=e.defineAsyncComponent(()=>Promise.resolve(typeof m=="string"?Ie:m));typeof m=="string"&&(p.type=m,c.size="small",c.fullscreen=!1,c.mode="dialog",c.footer=!1,c.header=!1);const v=Math.random().toString(32).slice(2),A=Object.assign({zIndex:typeof m=="string"?1100:1e3},c),O=new Promise((L,B)=>{n.value.push({id:v,component:x,props:p||{},options:{...A,type:typeof m=="string"?m:"component"},resolve:L,reject:B,listeners:[]}),e.triggerRef(n)}).catch(L=>L==="CANCEL"?new Promise(()=>{}):Promise.reject(L));return Object.assign(O,{close:()=>f(v)})}function f(m,p){const c=n.value.findIndex(v=>v.id===m);if(c<0)return;const x=n.value[c];p===void 0?x?.reject("CANCEL"):x?.resolve(p),n.value.splice(c,1),e.triggerRef(n)}function b(){!n.value||n.value.length===0||(n.value.forEach(m=>{m?.reject("CANCEL")}),n.value=[],e.triggerRef(n))}function S(m,p){const c=n.value.find(v=>v.id===m);if(!c)return;const x=c.listeners.find(v=>v.event===p);x&&x.callback({open:a,close:v=>f(c.id,v),closeAll:b,showLoading:()=>k(c.id),hideLoading:()=>y(c.id),confirm:v=>a("confirm",v),success:v=>a("success",v),error:v=>a("error",v),warning:v=>a("warning",v),info:v=>a("info",v)})}function k(m,p){if(!s)return;const[c]=s.refs[`modal-container_${m}`]||[];if(c)return c.showLoading();{const{close:x}=a(Ye,{text:p?.text},{footer:!1,header:!1,closeable:!1,backgroundColor:"transparent"});return p?.duration&&setTimeout(()=>{x()},p?.duration),x}}function y(m){if(!s)return;const[p]=s.refs[`modal-container_${m}`];if(p)return p.hideLoading()}function d(m,p,c){const x=n.value.find(v=>v.id===m);x&&x.listeners.push({event:p,callback:c})}return e.provide(D,{open:a,close:f,closeAll:b,addEventListener:d,showLoading:k,hideLoading:y}),l({elements:n,open:a,close:f,closeAll:b}),e.onMounted(()=>{o.value=!0}),(m,p)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.renderSlot(m.$slots,"default",{},void 0,!0),o.value?(e.openBlock(),e.createElementBlock("div",Ge,[(e.openBlock(),e.createBlock(e.Teleport,{disabled:!t.appendToBody,to:typeof t.appendToBody=="string"?t.appendToBody:"body"},[e.createVNode(e.TransitionGroup,{name:"modal-fade"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,c=>(e.openBlock(),e.createBlock(se,e.mergeProps({id:c.id,key:c.id,ref_for:!0,ref:`modal-container_${c.id}`,component:c.component,"component-props":c.props,"max-height":t.maxHeight,"max-width":t.maxWidth,offset:t.offset,sizes:t.sizes},{ref_for:!0},c.options,{onSubmit:()=>S(c.id,"submit")}),null,16,["id","component","component-props","max-height","max-width","offset","sizes","onSubmit"]))),128))]),_:1})],8,["disabled","to"]))])):e.createCommentVNode("",!0)],64))}}),Ue=H(qe,[["__scopeId","data-v-d74e77f1"]]);function U(t,l){let n=t?.parent;for(;n&&n?.type?.name!==l;)n=n.parent;return n?.type?.name===l?n:null}function ce(){const t=e.inject(D),l=e.getCurrentInstance();function n(o,s,a){if(!t)throw new Error("Not Found Modal Provider Component");return t.open(o,s,a)}return{open:n,close(o){if(!t)throw new Error("Not Found Modal Provider Component");const a=U(l,"ModalContainer")?.props?.id;if(!a)throw new Error("Not Found Current Modal Container");t.close(a,o)},closeAll(){if(!t)throw new Error("Not Found Modal Provider Component");t.closeAll()},showLoading(o){if(!t)throw new Error("Not Found Modal Provider Component");const a=U(l,"ModalContainer")?.props?.id;return t.showLoading(a,o)},hideLoading(){if(!t)throw new Error("Not Found Modal Provider Component");const s=U(l,"ModalContainer")?.props?.id;return t.hideLoading(s)},confirm(o){return this.open("confirm",o)},info(o){return this.open("info",o)},error(o){return this.open("error",o)},warning(o){return this.open("warning",o)},success(o){return this.open("success",o)}}}function Je(t){const l=e.inject(D),n=e.getCurrentInstance(),s=U(n,"ModalContainer")?.props?.id;l&&s&&l.addEventListener(s,"submit",t)}exports.ModalContainer=se;exports.ModalFooter=Te;exports.ModalHeader=Ae;exports.ModalKey=D;exports.ModalProvider=Ue;exports.onSubmit=Je;exports.useModal=ce;
|
package/dist/cjs/index.d.ts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { default as ModalProvider } from './components/modal-provider.vue';
|
|
2
1
|
import { default as ModalContainer } from './components/modal-container.vue';
|
|
3
2
|
import { default as ModalFooter } from './components/modal-footer.vue';
|
|
4
3
|
import { default as ModalHeader } from './components/modal-header.vue';
|
|
5
|
-
import {
|
|
4
|
+
import { default as ModalProvider } from './components/modal-provider.vue';
|
|
6
5
|
import { ModalKey } from './constants';
|
|
7
|
-
|
|
6
|
+
import { useModal } from './hooks/use-modal';
|
|
8
7
|
export { onSubmit } from './hooks/on-submit';
|
|
9
8
|
export * from './interfaces';
|
|
10
|
-
export { ModalContainer,
|
|
9
|
+
export { ModalContainer, ModalFooter, ModalHeader, ModalKey, ModalProvider, useModal, };
|
package/dist/cjs/interfaces.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Component, CSSProperties } from 'vue';
|
|
2
2
|
import { SizeOptions } from '../interfaces';
|
|
3
|
-
|
|
4
|
-
declare const _default: import('vue').DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
3
|
+
declare const _default: import('vue').DefineComponent<{
|
|
5
4
|
id: string;
|
|
6
5
|
form?: string;
|
|
7
6
|
component: Component;
|
|
@@ -10,8 +9,8 @@ declare const _default: import('vue').DefineComponent<__VLS_WithDefaults<__VLS_T
|
|
|
10
9
|
height?: number | string;
|
|
11
10
|
maxWidth?: number | string;
|
|
12
11
|
maxHeight?: number | string;
|
|
13
|
-
sizes
|
|
14
|
-
size
|
|
12
|
+
sizes?: SizeOptions;
|
|
13
|
+
size?: "small" | "middle" | "large";
|
|
15
14
|
fullscreen?: boolean;
|
|
16
15
|
title?: string;
|
|
17
16
|
header?: boolean;
|
|
@@ -36,27 +35,12 @@ declare const _default: import('vue').DefineComponent<__VLS_WithDefaults<__VLS_T
|
|
|
36
35
|
close: () => void;
|
|
37
36
|
}) => void;
|
|
38
37
|
onCancel?: () => void;
|
|
39
|
-
}
|
|
40
|
-
header: boolean;
|
|
41
|
-
closeable: boolean;
|
|
42
|
-
footer: boolean;
|
|
43
|
-
keyboard: boolean;
|
|
44
|
-
maskClosable: boolean;
|
|
45
|
-
size: string;
|
|
46
|
-
esc: boolean;
|
|
47
|
-
draggable: boolean;
|
|
48
|
-
mode: string;
|
|
49
|
-
position: string;
|
|
50
|
-
submitText: string;
|
|
51
|
-
cancelText: string;
|
|
52
|
-
maxHeight: number;
|
|
53
|
-
zIndex: number;
|
|
54
|
-
}>, {
|
|
38
|
+
}, {
|
|
55
39
|
showLoading: () => () => void;
|
|
56
40
|
hideLoading: () => void;
|
|
57
|
-
},
|
|
41
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
58
42
|
submit: (...args: any[]) => void;
|
|
59
|
-
}, string, import('vue').PublicProps, Readonly<
|
|
43
|
+
}, string, import('vue').PublicProps, Readonly<{
|
|
60
44
|
id: string;
|
|
61
45
|
form?: string;
|
|
62
46
|
component: Component;
|
|
@@ -65,8 +49,8 @@ declare const _default: import('vue').DefineComponent<__VLS_WithDefaults<__VLS_T
|
|
|
65
49
|
height?: number | string;
|
|
66
50
|
maxWidth?: number | string;
|
|
67
51
|
maxHeight?: number | string;
|
|
68
|
-
sizes
|
|
69
|
-
size
|
|
52
|
+
sizes?: SizeOptions;
|
|
53
|
+
size?: "small" | "middle" | "large";
|
|
70
54
|
fullscreen?: boolean;
|
|
71
55
|
title?: string;
|
|
72
56
|
header?: boolean;
|
|
@@ -91,24 +75,9 @@ declare const _default: import('vue').DefineComponent<__VLS_WithDefaults<__VLS_T
|
|
|
91
75
|
close: () => void;
|
|
92
76
|
}) => void;
|
|
93
77
|
onCancel?: () => void;
|
|
94
|
-
}
|
|
95
|
-
header: boolean;
|
|
96
|
-
closeable: boolean;
|
|
97
|
-
footer: boolean;
|
|
98
|
-
keyboard: boolean;
|
|
99
|
-
maskClosable: boolean;
|
|
100
|
-
size: string;
|
|
101
|
-
esc: boolean;
|
|
102
|
-
draggable: boolean;
|
|
103
|
-
mode: string;
|
|
104
|
-
position: string;
|
|
105
|
-
submitText: string;
|
|
106
|
-
cancelText: string;
|
|
107
|
-
maxHeight: number;
|
|
108
|
-
zIndex: number;
|
|
109
|
-
}>>> & {
|
|
78
|
+
}> & Readonly<{
|
|
110
79
|
onSubmit?: ((...args: any[]) => any) | undefined;
|
|
111
|
-
}
|
|
80
|
+
}>, {
|
|
112
81
|
size: "small" | "middle" | "large";
|
|
113
82
|
maxHeight: number | string;
|
|
114
83
|
header: boolean;
|
|
@@ -122,22 +91,12 @@ declare const _default: import('vue').DefineComponent<__VLS_WithDefaults<__VLS_T
|
|
|
122
91
|
submitText: string;
|
|
123
92
|
cancelText: string;
|
|
124
93
|
zIndex: number;
|
|
125
|
-
}, {}
|
|
94
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
95
|
+
wrapperRef: HTMLDivElement;
|
|
96
|
+
contentRef: HTMLDivElement;
|
|
97
|
+
headerRef: HTMLDivElement;
|
|
98
|
+
headerSlotRef: HTMLDivElement;
|
|
99
|
+
footerSlotRef: HTMLDivElement;
|
|
100
|
+
footerRef: HTMLDivElement;
|
|
101
|
+
}, any>;
|
|
126
102
|
export default _default;
|
|
127
|
-
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
128
|
-
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
129
|
-
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
130
|
-
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
131
|
-
} : {
|
|
132
|
-
type: import('vue').PropType<T[K]>;
|
|
133
|
-
required: true;
|
|
134
|
-
};
|
|
135
|
-
};
|
|
136
|
-
type __VLS_WithDefaults<P, D> = {
|
|
137
|
-
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
138
|
-
default: D[K];
|
|
139
|
-
}> : P[K];
|
|
140
|
-
};
|
|
141
|
-
type __VLS_Prettify<T> = {
|
|
142
|
-
[K in keyof T]: T[K];
|
|
143
|
-
} & {};
|