@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
package/dist/es/index.mjs
CHANGED
|
@@ -1,217 +1,266 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
return _e() ? (xe(t), !0) : !1;
|
|
1
|
+
import { isRef as Te, toRefs as Ee, customRef as He, toValue as v, onMounted as ae, nextTick as Ae, watch as ce, getCurrentScope as Be, onScopeDispose as Oe, getCurrentInstance as q, ref as se, computed as A, shallowRef as O, unref as Pe, defineComponent as de, useCssVars as Re, inject as xe, onUnmounted as ze, openBlock as k, createElementBlock as E, withModifiers as We, normalizeStyle as K, createElementVNode as y, normalizeClass as Ie, toDisplayString as W, createCommentVNode as D, createBlock as N, resolveDynamicComponent as $e, normalizeProps as Ve, guardReactiveProps as De, triggerRef as U, Teleport as be, renderSlot as we, Fragment as ye, provide as Ne, createVNode as Fe, TransitionGroup as Xe, withCtx as Ye, renderList as je, mergeProps as Ge, defineAsyncComponent as Ke } from "vue";
|
|
2
|
+
function Ue(e, n) {
|
|
3
|
+
return Be() ? (Oe(e, n), !0) : !1;
|
|
5
4
|
}
|
|
6
|
-
|
|
7
|
-
return typeof t == "function" ? t() : me(t);
|
|
8
|
-
}
|
|
9
|
-
const ce = typeof window < "u" && typeof document < "u";
|
|
5
|
+
const Le = typeof window < "u" && typeof document < "u";
|
|
10
6
|
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
return V();
|
|
7
|
+
const qe = Object.prototype.toString, Je = (e) => qe.call(e) === "[object Object]";
|
|
8
|
+
function le(e) {
|
|
9
|
+
return Array.isArray(e) ? e : [e];
|
|
15
10
|
}
|
|
16
|
-
function
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
11
|
+
function Qe(e) {
|
|
12
|
+
return q();
|
|
13
|
+
}
|
|
14
|
+
function Ze(e, n = {}) {
|
|
15
|
+
if (!Te(e)) return Ee(e);
|
|
16
|
+
const o = Array.isArray(e.value) ? Array.from({ length: e.value.length }) : {};
|
|
17
|
+
for (const t in e.value) o[t] = He(() => ({
|
|
18
|
+
get() {
|
|
19
|
+
return e.value[t];
|
|
20
|
+
},
|
|
21
|
+
set(s) {
|
|
22
|
+
var r;
|
|
23
|
+
if (!((r = v(n.replaceRef)) !== null && r !== void 0) || r) if (Array.isArray(e.value)) {
|
|
24
|
+
const u = [...e.value];
|
|
25
|
+
u[t] = s, e.value = u;
|
|
26
|
+
} else {
|
|
27
|
+
const u = {
|
|
28
|
+
...e.value,
|
|
29
|
+
[t]: s
|
|
30
|
+
};
|
|
31
|
+
Object.setPrototypeOf(u, Object.getPrototypeOf(e.value)), e.value = u;
|
|
37
32
|
}
|
|
38
|
-
|
|
33
|
+
else e.value[t] = s;
|
|
34
|
+
}
|
|
35
|
+
}));
|
|
39
36
|
return o;
|
|
40
37
|
}
|
|
41
|
-
function
|
|
42
|
-
|
|
38
|
+
function et(e, n = !0, o) {
|
|
39
|
+
Qe() ? ae(e, o) : n ? e() : Ae(e);
|
|
43
40
|
}
|
|
44
|
-
function
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
41
|
+
function tt(e, n, o) {
|
|
42
|
+
return ce(e, n, {
|
|
43
|
+
...o,
|
|
44
|
+
immediate: !0
|
|
45
|
+
});
|
|
48
46
|
}
|
|
49
|
-
const
|
|
50
|
-
function
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
() =>
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
s.
|
|
64
|
-
|
|
65
|
-
)
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
47
|
+
const ue = Le ? window : void 0;
|
|
48
|
+
function I(e) {
|
|
49
|
+
var n;
|
|
50
|
+
const o = v(e);
|
|
51
|
+
return (n = o?.$el) !== null && n !== void 0 ? n : o;
|
|
52
|
+
}
|
|
53
|
+
function ge(...e) {
|
|
54
|
+
const n = (t, s, r, u) => (t.addEventListener(s, r, u), () => t.removeEventListener(s, r, u)), o = A(() => {
|
|
55
|
+
const t = le(v(e[0])).filter((s) => s != null);
|
|
56
|
+
return t.every((s) => typeof s != "string") ? t : void 0;
|
|
57
|
+
});
|
|
58
|
+
return tt(() => {
|
|
59
|
+
var t, s;
|
|
60
|
+
return [
|
|
61
|
+
(t = (s = o.value) === null || s === void 0 ? void 0 : s.map((r) => I(r))) !== null && t !== void 0 ? t : [ue].filter((r) => r != null),
|
|
62
|
+
le(v(o.value ? e[1] : e[0])),
|
|
63
|
+
le(Pe(o.value ? e[2] : e[1])),
|
|
64
|
+
v(o.value ? e[3] : e[2])
|
|
65
|
+
];
|
|
66
|
+
}, ([t, s, r, u], w, _) => {
|
|
67
|
+
if (!t?.length || !s?.length || !r?.length) return;
|
|
68
|
+
const M = Je(u) ? { ...u } : u, x = t.flatMap((c) => s.flatMap((f) => r.map((m) => n(c, f, m, M))));
|
|
69
|
+
_(() => {
|
|
70
|
+
x.forEach((c) => c());
|
|
71
|
+
});
|
|
72
|
+
}, { flush: "post" });
|
|
73
|
+
}
|
|
74
|
+
// @__NO_SIDE_EFFECTS__
|
|
75
|
+
function ot() {
|
|
76
|
+
const e = O(!1), n = q();
|
|
77
|
+
return n && ae(() => {
|
|
78
|
+
e.value = !0;
|
|
79
|
+
}, n), e;
|
|
72
80
|
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
}, i), t;
|
|
81
|
+
// @__NO_SIDE_EFFECTS__
|
|
82
|
+
function nt(e) {
|
|
83
|
+
const n = /* @__PURE__ */ ot();
|
|
84
|
+
return A(() => (n.value, !!e()));
|
|
78
85
|
}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
86
|
+
const ie = {
|
|
87
|
+
speed: 2,
|
|
88
|
+
margin: 30,
|
|
89
|
+
direction: "both"
|
|
90
|
+
};
|
|
91
|
+
function it(e) {
|
|
92
|
+
e.scrollLeft > e.scrollWidth - e.clientWidth && (e.scrollLeft = Math.max(0, e.scrollWidth - e.clientWidth)), e.scrollTop > e.scrollHeight - e.clientHeight && (e.scrollTop = Math.max(0, e.scrollHeight - e.clientHeight));
|
|
82
93
|
}
|
|
83
|
-
function
|
|
84
|
-
var o,
|
|
85
|
-
const {
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
94
|
+
function lt(e, n = {}) {
|
|
95
|
+
var o, t, s, r;
|
|
96
|
+
const { pointerTypes: u, preventDefault: w, stopPropagation: _, exact: M, onMove: x, onEnd: c, onStart: f, initialValue: m, axis: a = "both", draggingElement: b = ue, containerElement: p, handle: X = e, buttons: Y = [0], restrictInView: R, autoScroll: T = !1 } = n, $ = se((o = v(m)) !== null && o !== void 0 ? o : {
|
|
97
|
+
x: 0,
|
|
98
|
+
y: 0
|
|
99
|
+
}), H = se(), B = (i) => u ? u.includes(i.pointerType) : !0, j = (i) => {
|
|
100
|
+
v(w) && i.preventDefault(), v(_) && i.stopPropagation();
|
|
101
|
+
}, V = v(T), P = typeof V == "object" ? {
|
|
102
|
+
speed: (t = v(V.speed)) !== null && t !== void 0 ? t : ie.speed,
|
|
103
|
+
margin: (s = v(V.margin)) !== null && s !== void 0 ? s : ie.margin,
|
|
104
|
+
direction: (r = V.direction) !== null && r !== void 0 ? r : ie.direction
|
|
105
|
+
} : ie, J = (i) => typeof i == "number" ? [i, i] : [i.x, i.y], Q = (i, d, h) => {
|
|
106
|
+
const { clientWidth: C, clientHeight: g, scrollLeft: L, scrollTop: te, scrollWidth: pe, scrollHeight: _e } = i, [Ce, ke] = J(P.margin), [Me, Se] = J(P.speed);
|
|
107
|
+
let oe = 0, ne = 0;
|
|
108
|
+
(P.direction === "x" || P.direction === "both") && (h.x < Ce && L > 0 ? oe = -Me : h.x + d.width > C - Ce && L < pe - C && (oe = Me)), (P.direction === "y" || P.direction === "both") && (h.y < ke && te > 0 ? ne = -Se : h.y + d.height > g - ke && te < _e - g && (ne = Se)), (oe || ne) && i.scrollBy({
|
|
109
|
+
left: oe,
|
|
110
|
+
top: ne,
|
|
111
|
+
behavior: "auto"
|
|
112
|
+
});
|
|
113
|
+
};
|
|
114
|
+
let z = null;
|
|
115
|
+
const he = () => {
|
|
116
|
+
const i = v(p);
|
|
117
|
+
i && !z && (z = setInterval(() => {
|
|
118
|
+
const d = v(e).getBoundingClientRect(), { x: h, y: C } = $.value, g = {
|
|
119
|
+
x: h - i.scrollLeft,
|
|
120
|
+
y: C - i.scrollTop
|
|
121
|
+
};
|
|
122
|
+
g.x >= 0 && g.y >= 0 && (Q(i, d, g), g.x += i.scrollLeft, g.y += i.scrollTop, $.value = g);
|
|
123
|
+
}, 1e3 / 60));
|
|
124
|
+
}, Z = () => {
|
|
125
|
+
z && (clearInterval(z), z = null);
|
|
126
|
+
}, me = (i, d, h, C) => {
|
|
127
|
+
const [g, L] = typeof h == "number" ? [h, h] : [h.x, h.y], { clientWidth: te, clientHeight: pe } = d;
|
|
128
|
+
return i.x < g || i.x + C.width > te - g || i.y < L || i.y + C.height > pe - L;
|
|
129
|
+
}, ve = () => {
|
|
130
|
+
if (v(n.disabled) || !H.value) return;
|
|
131
|
+
const i = v(p);
|
|
132
|
+
if (!i) return;
|
|
133
|
+
const d = v(e).getBoundingClientRect(), { x: h, y: C } = $.value;
|
|
134
|
+
me({
|
|
135
|
+
x: h - i.scrollLeft,
|
|
136
|
+
y: C - i.scrollTop
|
|
137
|
+
}, i, P.margin, d) ? he() : Z();
|
|
138
|
+
};
|
|
139
|
+
v(T) && ce($, ve);
|
|
140
|
+
const ee = (i) => {
|
|
141
|
+
var d;
|
|
142
|
+
if (!v(Y).includes(i.button) || v(n.disabled) || !B(i) || v(M) && i.target !== v(e)) return;
|
|
143
|
+
const h = v(p), C = h == null || (d = h.getBoundingClientRect) === null || d === void 0 ? void 0 : d.call(h), g = v(e).getBoundingClientRect(), L = {
|
|
144
|
+
x: i.clientX - (h ? g.left - C.left + (T ? 0 : h.scrollLeft) : g.left),
|
|
145
|
+
y: i.clientY - (h ? g.top - C.top + (T ? 0 : h.scrollTop) : g.top)
|
|
109
146
|
};
|
|
110
|
-
(
|
|
111
|
-
},
|
|
112
|
-
if (
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
147
|
+
f?.(L, i) !== !1 && (H.value = L, j(i));
|
|
148
|
+
}, l = (i) => {
|
|
149
|
+
if (v(n.disabled) || !B(i) || !H.value) return;
|
|
150
|
+
const d = v(p);
|
|
151
|
+
d instanceof HTMLElement && it(d);
|
|
152
|
+
const h = v(e).getBoundingClientRect();
|
|
153
|
+
let { x: C, y: g } = $.value;
|
|
154
|
+
if ((a === "x" || a === "both") && (C = i.clientX - H.value.x, d && (C = Math.min(Math.max(0, C), d.scrollWidth - h.width))), (a === "y" || a === "both") && (g = i.clientY - H.value.y, d && (g = Math.min(Math.max(0, g), d.scrollHeight - h.height))), v(T) && d && (z === null && Q(d, h, {
|
|
155
|
+
x: C,
|
|
156
|
+
y: g
|
|
157
|
+
}), C += d.scrollLeft, g += d.scrollTop), d && (R || T)) {
|
|
158
|
+
if (a !== "y") {
|
|
159
|
+
const L = C - d.scrollLeft;
|
|
160
|
+
L < 0 ? C = d.scrollLeft : L > d.clientWidth - h.width && (C = d.clientWidth - h.width + d.scrollLeft);
|
|
161
|
+
}
|
|
162
|
+
if (a !== "x") {
|
|
163
|
+
const L = g - d.scrollTop;
|
|
164
|
+
L < 0 ? g = d.scrollTop : L > d.clientHeight - h.height && (g = d.clientHeight - h.height + d.scrollTop);
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
$.value = {
|
|
168
|
+
x: C,
|
|
169
|
+
y: g
|
|
170
|
+
}, x?.($.value, i), j(i);
|
|
171
|
+
}, S = (i) => {
|
|
172
|
+
v(n.disabled) || !B(i) || H.value && (H.value = void 0, T && Z(), c?.($.value, i), j(i));
|
|
122
173
|
};
|
|
123
|
-
if (
|
|
124
|
-
const
|
|
125
|
-
|
|
174
|
+
if (Le) {
|
|
175
|
+
const i = () => {
|
|
176
|
+
var d;
|
|
177
|
+
return {
|
|
178
|
+
capture: (d = n.capture) !== null && d !== void 0 ? d : !0,
|
|
179
|
+
passive: !v(w)
|
|
180
|
+
};
|
|
181
|
+
};
|
|
182
|
+
ge(X, "pointerdown", ee, i), ge(b, "pointermove", l, i), ge(b, "pointerup", S, i);
|
|
126
183
|
}
|
|
127
184
|
return {
|
|
128
|
-
...
|
|
129
|
-
position:
|
|
130
|
-
isDragging:
|
|
131
|
-
style:
|
|
132
|
-
|
|
133
|
-
|
|
185
|
+
...Ze($),
|
|
186
|
+
position: $,
|
|
187
|
+
isDragging: A(() => !!H.value),
|
|
188
|
+
style: A(() => `
|
|
189
|
+
left: ${$.value.x}px;
|
|
190
|
+
top: ${$.value.y}px;
|
|
191
|
+
${T ? "text-wrap: nowrap;" : ""}
|
|
192
|
+
`)
|
|
134
193
|
};
|
|
135
194
|
}
|
|
136
|
-
function
|
|
137
|
-
const { window:
|
|
138
|
-
let
|
|
139
|
-
const
|
|
140
|
-
|
|
141
|
-
}, _ =
|
|
142
|
-
|
|
143
|
-
(
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
195
|
+
function rt(e, n, o = {}) {
|
|
196
|
+
const { window: t = ue, ...s } = o;
|
|
197
|
+
let r;
|
|
198
|
+
const u = /* @__PURE__ */ nt(() => t && "ResizeObserver" in t), w = () => {
|
|
199
|
+
r && (r.disconnect(), r = void 0);
|
|
200
|
+
}, _ = ce(A(() => {
|
|
201
|
+
const x = v(e);
|
|
202
|
+
return Array.isArray(x) ? x.map((c) => I(c)) : [I(x)];
|
|
203
|
+
}), (x) => {
|
|
204
|
+
if (w(), u.value && t) {
|
|
205
|
+
r = new ResizeObserver(n);
|
|
206
|
+
for (const c of x) c && r.observe(c, s);
|
|
207
|
+
}
|
|
208
|
+
}, {
|
|
209
|
+
immediate: !0,
|
|
210
|
+
flush: "post"
|
|
211
|
+
}), M = () => {
|
|
212
|
+
w(), _();
|
|
153
213
|
};
|
|
154
|
-
return
|
|
155
|
-
isSupported:
|
|
156
|
-
stop:
|
|
214
|
+
return Ue(M), {
|
|
215
|
+
isSupported: u,
|
|
216
|
+
stop: M
|
|
157
217
|
};
|
|
158
218
|
}
|
|
159
|
-
function
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
(
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
)
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
u && (c.value = "offsetWidth" in u ? u.offsetWidth : i.width, h.value = "offsetHeight" in u ? u.offsetHeight : i.height);
|
|
219
|
+
function G(e, n = {
|
|
220
|
+
width: 0,
|
|
221
|
+
height: 0
|
|
222
|
+
}, o = {}) {
|
|
223
|
+
const { window: t = ue, box: s = "content-box" } = o, r = A(() => {
|
|
224
|
+
var c;
|
|
225
|
+
return (c = I(e)) === null || c === void 0 || (c = c.namespaceURI) === null || c === void 0 ? void 0 : c.includes("svg");
|
|
226
|
+
}), u = O(n.width), w = O(n.height), { stop: _ } = rt(e, ([c]) => {
|
|
227
|
+
const f = s === "border-box" ? c.borderBoxSize : s === "content-box" ? c.contentBoxSize : c.devicePixelContentBoxSize;
|
|
228
|
+
if (t && r.value) {
|
|
229
|
+
const m = I(e);
|
|
230
|
+
if (m) {
|
|
231
|
+
const a = m.getBoundingClientRect();
|
|
232
|
+
u.value = a.width, w.value = a.height;
|
|
233
|
+
}
|
|
234
|
+
} else if (f) {
|
|
235
|
+
const m = le(f);
|
|
236
|
+
u.value = m.reduce((a, { inlineSize: b }) => a + b, 0), w.value = m.reduce((a, { blockSize: b }) => a + b, 0);
|
|
237
|
+
} else
|
|
238
|
+
u.value = c.contentRect.width, w.value = c.contentRect.height;
|
|
239
|
+
}, o);
|
|
240
|
+
et(() => {
|
|
241
|
+
const c = I(e);
|
|
242
|
+
c && (u.value = "offsetWidth" in c ? c.offsetWidth : n.width, w.value = "offsetHeight" in c ? c.offsetHeight : n.height);
|
|
184
243
|
});
|
|
185
|
-
const
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
);
|
|
191
|
-
function v() {
|
|
192
|
-
_(), b();
|
|
244
|
+
const M = ce(() => I(e), (c) => {
|
|
245
|
+
u.value = c ? n.width : 0, w.value = c ? n.height : 0;
|
|
246
|
+
});
|
|
247
|
+
function x() {
|
|
248
|
+
_(), M();
|
|
193
249
|
}
|
|
194
250
|
return {
|
|
195
|
-
width:
|
|
196
|
-
height:
|
|
197
|
-
stop:
|
|
251
|
+
width: u,
|
|
252
|
+
height: w,
|
|
253
|
+
stop: x
|
|
198
254
|
};
|
|
199
255
|
}
|
|
200
|
-
const
|
|
256
|
+
const fe = /* @__PURE__ */ Symbol("__MODAL__"), st = { class: "title text-16px font-bold" }, at = { class: "action" }, ct = ["form"], dt = {
|
|
201
257
|
key: 2,
|
|
202
258
|
class: "modal-loading"
|
|
203
|
-
},
|
|
204
|
-
/* @__PURE__ */ m("div"),
|
|
205
|
-
/* @__PURE__ */ m("div"),
|
|
206
|
-
/* @__PURE__ */ m("div"),
|
|
207
|
-
/* @__PURE__ */ m("div")
|
|
208
|
-
], -1)), Qe = [
|
|
209
|
-
Je
|
|
210
|
-
], Ze = {
|
|
259
|
+
}, ut = {
|
|
211
260
|
name: "ModalContainer",
|
|
212
261
|
inheritAttrs: !1
|
|
213
|
-
},
|
|
214
|
-
...
|
|
262
|
+
}, ft = /* @__PURE__ */ de({
|
|
263
|
+
...ut,
|
|
215
264
|
props: {
|
|
216
265
|
id: {},
|
|
217
266
|
form: {},
|
|
@@ -244,160 +293,201 @@ const Xe = (t) => (le("data-v-e065fedd"), t = t(), ae(), t), Ye = { class: "titl
|
|
|
244
293
|
onCancel: {}
|
|
245
294
|
},
|
|
246
295
|
emits: ["submit"],
|
|
247
|
-
setup(
|
|
248
|
-
|
|
249
|
-
|
|
296
|
+
setup(e, { expose: n, emit: o }) {
|
|
297
|
+
Re((l) => ({
|
|
298
|
+
v4586ed24: l.zIndex
|
|
250
299
|
}));
|
|
251
|
-
const
|
|
252
|
-
let
|
|
253
|
-
const
|
|
300
|
+
const t = e, s = o, r = xe(fe), u = se(!1);
|
|
301
|
+
let w = 0, _ = 0;
|
|
302
|
+
const M = O(), x = O(), c = O(), f = O(), m = O(), a = O(), { height: b } = G(
|
|
303
|
+
M
|
|
304
|
+
), { height: p } = G(
|
|
305
|
+
c,
|
|
306
|
+
void 0,
|
|
307
|
+
{ box: "border-box" }
|
|
308
|
+
), { height: X } = G(
|
|
309
|
+
f,
|
|
310
|
+
void 0,
|
|
311
|
+
{ box: "border-box" }
|
|
312
|
+
), { height: Y } = G(
|
|
313
|
+
m
|
|
314
|
+
), { height: R } = G(
|
|
315
|
+
a
|
|
316
|
+
), { x: T, y: $ } = lt(c, {
|
|
254
317
|
initialValue: { x: 0, y: 0 }
|
|
255
318
|
});
|
|
256
|
-
function
|
|
257
|
-
|
|
319
|
+
function H() {
|
|
320
|
+
r?.close(t.id);
|
|
258
321
|
}
|
|
259
|
-
function
|
|
260
|
-
return typeof
|
|
322
|
+
function B(l) {
|
|
323
|
+
return typeof l == "number" ? `${l}px` : l;
|
|
261
324
|
}
|
|
262
|
-
const
|
|
263
|
-
const
|
|
264
|
-
return
|
|
325
|
+
const j = A(() => {
|
|
326
|
+
const l = {};
|
|
327
|
+
return t.mode === "dialog" && (l.justifyContent = "center"), t.mode === "drawer" && (l.justifyContent = {
|
|
265
328
|
left: "flex-start",
|
|
266
329
|
right: "flex-end",
|
|
267
330
|
top: "flex-start",
|
|
268
331
|
bottom: "flex-end"
|
|
269
|
-
}[
|
|
332
|
+
}[t.position], l.flexDirection = {
|
|
270
333
|
left: "row",
|
|
271
334
|
right: "row",
|
|
272
335
|
top: "column",
|
|
273
336
|
bottom: "column"
|
|
274
|
-
}[
|
|
275
|
-
}),
|
|
276
|
-
const
|
|
277
|
-
return
|
|
278
|
-
}),
|
|
279
|
-
const
|
|
280
|
-
return
|
|
281
|
-
}),
|
|
282
|
-
const
|
|
283
|
-
|
|
337
|
+
}[t.position]), l;
|
|
338
|
+
}), V = A(() => {
|
|
339
|
+
const l = {};
|
|
340
|
+
return t.mode === "drawer" && ["top", "bottom"].includes(t.position) ? l.maxHeight = B(t.maxHeight) : (l.width = B(t.sizes[t.size]), l.maxWidth = B(t.maxWidth)), t.width && (l.width = B(t.width)), t.height && (l.height = B(t.height)), t.fullscreen && (l.maxWidth = "unset", l.width = "100%", l.position = "fixed", l.top = 0, l.left = 0, l.bottom = 0, l.right = 0, l.borderRadius = 0), t.draggable && !t.fullscreen && t.mode === "dialog" && (l.transform = `translate3d(${T.value - w}px, ${$.value - _}px, 0px)`), t.mode === "drawer" && (l.borderRadius = 0, ["left", "right"].includes(t.position) ? l.height = "100%" : l.width = "100%"), t.offset && t.mode === "dialog" && (l.marginLeft = `${t.offset.x || 0}px`, l.marginTop = `${t.offset.y || 0}px`), t.backgroundColor && (l.backgroundColor = t.backgroundColor), l;
|
|
341
|
+
}), P = A(() => {
|
|
342
|
+
const l = {};
|
|
343
|
+
return t.draggable && !t.fullscreen && t.mode === "dialog" && (l.cursor = "move"), l;
|
|
344
|
+
}), J = A(() => {
|
|
345
|
+
const l = {}, S = Y.value + R.value + p.value + X.value, i = Math.floor(
|
|
346
|
+
b.value * (Number(B(t.maxHeight).replace("%", "")) / 100)
|
|
347
|
+
);
|
|
348
|
+
return t.maxHeight && (l.maxHeight = `${i - S}px`), t.mode === "drawer" && (l.maxHeight = "unset", ["left", "right"].includes(t.position) && (l.height = `${b.value - S}px`)), t.fullscreen && (l.maxHeight = "unset", l.height = `calc(100% - ${S}px)`), t.type !== "component" && (l.padding = "0"), t.bodyStyle && Object.assign(l, t.bodyStyle), l;
|
|
284
349
|
});
|
|
285
|
-
function
|
|
286
|
-
const
|
|
287
|
-
if (
|
|
288
|
-
const S =
|
|
350
|
+
function Q() {
|
|
351
|
+
const l = x.value;
|
|
352
|
+
if (t.form && l) {
|
|
353
|
+
const S = l.querySelector(
|
|
354
|
+
`form[name="${t.form}"]`
|
|
355
|
+
);
|
|
289
356
|
S && S.dispatchEvent(new Event("submit"));
|
|
290
357
|
}
|
|
291
|
-
|
|
292
|
-
close: () =>
|
|
293
|
-
}),
|
|
358
|
+
t.onOk && t.onOk({
|
|
359
|
+
close: () => r?.close(t.id)
|
|
360
|
+
}), s("submit");
|
|
294
361
|
}
|
|
295
|
-
function
|
|
296
|
-
|
|
362
|
+
function z() {
|
|
363
|
+
r?.close(t.id), t?.onCancel && t.onCancel();
|
|
297
364
|
}
|
|
298
|
-
function
|
|
365
|
+
function he() {
|
|
299
366
|
window && window.addEventListener("resize", () => {
|
|
300
|
-
|
|
367
|
+
U(M), U(x), x.value && (w = x.value.offsetLeft, _ = x.value.offsetTop);
|
|
301
368
|
});
|
|
302
369
|
}
|
|
303
|
-
function
|
|
304
|
-
if (
|
|
305
|
-
const
|
|
306
|
-
S === "Escape" && (
|
|
370
|
+
function Z() {
|
|
371
|
+
if (t.closeable && t.esc) {
|
|
372
|
+
const l = ({ key: S }) => {
|
|
373
|
+
S === "Escape" && (r?.close(t.id), window.removeEventListener("keydown", l));
|
|
307
374
|
};
|
|
308
|
-
window.addEventListener("keydown",
|
|
375
|
+
window.addEventListener("keydown", l);
|
|
309
376
|
}
|
|
310
377
|
}
|
|
311
|
-
function
|
|
312
|
-
|
|
378
|
+
function me() {
|
|
379
|
+
w = x.value.offsetLeft, _ = x.value.offsetTop;
|
|
313
380
|
}
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
}),
|
|
381
|
+
ae(() => {
|
|
382
|
+
Z(), he();
|
|
383
|
+
}), ze(() => {
|
|
317
384
|
});
|
|
318
385
|
function ve() {
|
|
319
|
-
return
|
|
386
|
+
return u.value = !0, () => ee();
|
|
320
387
|
}
|
|
321
|
-
function
|
|
322
|
-
|
|
388
|
+
function ee() {
|
|
389
|
+
u.value = !1;
|
|
323
390
|
}
|
|
324
|
-
return
|
|
391
|
+
return n({
|
|
325
392
|
showLoading: ve,
|
|
326
|
-
hideLoading:
|
|
327
|
-
}), (
|
|
393
|
+
hideLoading: ee
|
|
394
|
+
}), (l, S) => (k(), E("div", {
|
|
328
395
|
ref_key: "wrapperRef",
|
|
329
|
-
ref:
|
|
396
|
+
ref: M,
|
|
330
397
|
class: "modal-wrapper",
|
|
331
|
-
style:
|
|
332
|
-
onClick: S[0] || (S[0] =
|
|
398
|
+
style: K(j.value),
|
|
399
|
+
onClick: S[0] || (S[0] = We((i) => e.maskClosable && H(), ["self"]))
|
|
333
400
|
}, [
|
|
334
|
-
|
|
401
|
+
y("div", {
|
|
335
402
|
ref_key: "contentRef",
|
|
336
|
-
ref:
|
|
337
|
-
class:
|
|
338
|
-
style:
|
|
403
|
+
ref: x,
|
|
404
|
+
class: Ie(["modal-content", { [`${e.mode}-mode`]: !0, [`${e.position}-position`]: !0 }]),
|
|
405
|
+
style: K(V.value)
|
|
339
406
|
}, [
|
|
340
|
-
|
|
407
|
+
e.header ? (k(), E("div", {
|
|
341
408
|
key: 0,
|
|
342
409
|
ref_key: "headerRef",
|
|
343
|
-
ref:
|
|
410
|
+
ref: c,
|
|
344
411
|
class: "modal-header",
|
|
345
|
-
style:
|
|
346
|
-
onMousedown:
|
|
412
|
+
style: K(P.value),
|
|
413
|
+
onMousedown: me
|
|
347
414
|
}, [
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
415
|
+
y("div", st, W(e.title), 1),
|
|
416
|
+
y("div", at, [
|
|
417
|
+
e.closeable ? (k(), E("div", {
|
|
351
418
|
key: 0,
|
|
352
419
|
class: "i-icon-park-outline:close block cursor-pointer",
|
|
353
|
-
onClick:
|
|
354
|
-
})) :
|
|
420
|
+
onClick: H
|
|
421
|
+
})) : D("", !0)
|
|
355
422
|
])
|
|
356
|
-
], 36)) :
|
|
357
|
-
|
|
423
|
+
], 36)) : D("", !0),
|
|
424
|
+
y("div", {
|
|
358
425
|
id: "modal-header-slot",
|
|
359
426
|
ref_key: "headerSlotRef",
|
|
360
|
-
ref:
|
|
427
|
+
ref: m
|
|
361
428
|
}, null, 512),
|
|
362
|
-
|
|
429
|
+
y("div", {
|
|
363
430
|
class: "modal-body",
|
|
364
|
-
style:
|
|
431
|
+
style: K(J.value)
|
|
365
432
|
}, [
|
|
366
|
-
(
|
|
433
|
+
(k(), N($e(e.component), Ve(De(e.componentProps)), null, 16))
|
|
367
434
|
], 4),
|
|
368
|
-
|
|
435
|
+
y("div", {
|
|
369
436
|
id: "modal-footer-slot",
|
|
370
437
|
ref_key: "footerSlotRef",
|
|
371
438
|
ref: a
|
|
372
439
|
}, null, 512),
|
|
373
|
-
|
|
440
|
+
e.footer ? (k(), E("div", {
|
|
374
441
|
key: 1,
|
|
375
442
|
ref_key: "footerRef",
|
|
376
|
-
ref:
|
|
443
|
+
ref: f,
|
|
377
444
|
class: "modal-footer space-x-2"
|
|
378
445
|
}, [
|
|
379
|
-
|
|
446
|
+
y("button", {
|
|
380
447
|
class: "cancel-button",
|
|
381
448
|
type: "button",
|
|
382
|
-
onClick:
|
|
383
|
-
},
|
|
384
|
-
|
|
449
|
+
onClick: z
|
|
450
|
+
}, W(e.cancelText), 1),
|
|
451
|
+
y("button", {
|
|
385
452
|
class: "submit-button",
|
|
386
|
-
form:
|
|
387
|
-
type: "
|
|
388
|
-
onClick:
|
|
389
|
-
},
|
|
390
|
-
], 512)) :
|
|
391
|
-
|
|
453
|
+
form: e.form,
|
|
454
|
+
type: "submit",
|
|
455
|
+
onClick: Q
|
|
456
|
+
}, W(e.submitText), 9, ct)
|
|
457
|
+
], 512)) : D("", !0),
|
|
458
|
+
u.value ? (k(), E("div", dt, [...S[1] || (S[1] = [
|
|
459
|
+
y("div", { class: "lds-ring" }, [
|
|
460
|
+
y("div"),
|
|
461
|
+
y("div"),
|
|
462
|
+
y("div"),
|
|
463
|
+
y("div")
|
|
464
|
+
], -1)
|
|
465
|
+
])])) : D("", !0)
|
|
392
466
|
], 6)
|
|
393
467
|
], 4));
|
|
394
468
|
}
|
|
395
|
-
}),
|
|
396
|
-
const o =
|
|
397
|
-
for (const [
|
|
398
|
-
o[
|
|
469
|
+
}), F = (e, n) => {
|
|
470
|
+
const o = e.__vccOpts || e;
|
|
471
|
+
for (const [t, s] of n)
|
|
472
|
+
o[t] = s;
|
|
399
473
|
return o;
|
|
400
|
-
},
|
|
474
|
+
}, ht = /* @__PURE__ */ F(ft, [["__scopeId", "data-v-1d490f4f"]]), mt = {}, vt = { class: "modal-footer" };
|
|
475
|
+
function pt(e, n) {
|
|
476
|
+
return k(), N(be, { to: "#modal-footer-slot" }, [
|
|
477
|
+
y("div", vt, [
|
|
478
|
+
we(e.$slots, "default", {}, void 0, !0)
|
|
479
|
+
])
|
|
480
|
+
]);
|
|
481
|
+
}
|
|
482
|
+
const Pt = /* @__PURE__ */ F(mt, [["render", pt], ["__scopeId", "data-v-2b3b820b"]]), gt = {}, yt = { class: "modal-header" };
|
|
483
|
+
function xt(e, n) {
|
|
484
|
+
return k(), N(be, { to: "#modal-header-slot" }, [
|
|
485
|
+
y("div", yt, [
|
|
486
|
+
we(e.$slots, "default", {}, void 0, !0)
|
|
487
|
+
])
|
|
488
|
+
]);
|
|
489
|
+
}
|
|
490
|
+
const Rt = /* @__PURE__ */ F(gt, [["render", xt], ["__scopeId", "data-v-4d035831"]]), bt = { class: "modal-dialog" }, wt = { class: "dialog-body" }, Ct = { class: "dialog-title" }, kt = { class: "dialog-content" }, Mt = /* @__PURE__ */ de({
|
|
401
491
|
__name: "modal-dialog",
|
|
402
492
|
props: {
|
|
403
493
|
type: {},
|
|
@@ -409,71 +499,71 @@ const Xe = (t) => (le("data-v-e065fedd"), t = t(), ae(), t), Ye = { class: "titl
|
|
|
409
499
|
onCancel: {},
|
|
410
500
|
footer: {}
|
|
411
501
|
},
|
|
412
|
-
setup(
|
|
413
|
-
const
|
|
502
|
+
setup(e) {
|
|
503
|
+
const n = e, o = Bt(), t = A(() => n.title ? n.title : {
|
|
414
504
|
confirm: "提示",
|
|
415
505
|
info: "提示",
|
|
416
506
|
warning: "警告",
|
|
417
507
|
error: "错误",
|
|
418
508
|
success: "成功"
|
|
419
|
-
}[
|
|
420
|
-
async function l() {
|
|
421
|
-
i.onOk && await i.onOk(), o.close();
|
|
422
|
-
}
|
|
509
|
+
}[n.type]);
|
|
423
510
|
async function s() {
|
|
424
|
-
|
|
511
|
+
n.onOk && await n.onOk(), o.close();
|
|
512
|
+
}
|
|
513
|
+
async function r() {
|
|
514
|
+
n.onCancel && await n.onCancel(), o.close();
|
|
425
515
|
}
|
|
426
|
-
return (
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
516
|
+
return (u, w) => (k(), E("section", bt, [
|
|
517
|
+
y("div", wt, [
|
|
518
|
+
y("div", Ct, W(t.value), 1),
|
|
519
|
+
y("div", kt, W(e.content), 1)
|
|
430
520
|
]),
|
|
431
|
-
|
|
521
|
+
y("div", {
|
|
432
522
|
class: "dialog-footer space-x-2",
|
|
433
|
-
style:
|
|
523
|
+
style: K(e.type === "confirm" ? { "justify-content": "end" } : { "border-top": "none" })
|
|
434
524
|
}, [
|
|
435
|
-
|
|
436
|
-
|
|
525
|
+
e.footer ? (k(), N($e(e.footer), { key: 0 })) : (k(), E(ye, { key: 1 }, [
|
|
526
|
+
y("button", {
|
|
437
527
|
class: "submit-button",
|
|
438
|
-
type: "
|
|
439
|
-
onClick:
|
|
440
|
-
},
|
|
441
|
-
|
|
528
|
+
type: "button",
|
|
529
|
+
onClick: s
|
|
530
|
+
}, W(e.okText), 1),
|
|
531
|
+
e.type === "confirm" ? (k(), E("button", {
|
|
442
532
|
key: 0,
|
|
443
533
|
class: "cancel-button",
|
|
444
534
|
type: "button",
|
|
445
|
-
onClick:
|
|
446
|
-
},
|
|
535
|
+
onClick: r
|
|
536
|
+
}, W(e.cancelText), 1)) : D("", !0)
|
|
447
537
|
], 64))
|
|
448
538
|
], 4)
|
|
449
539
|
]));
|
|
450
540
|
}
|
|
451
|
-
}),
|
|
452
|
-
/* @__PURE__ */ m("div", { class: "lds-ring" }, [
|
|
453
|
-
/* @__PURE__ */ m("div"),
|
|
454
|
-
/* @__PURE__ */ m("div"),
|
|
455
|
-
/* @__PURE__ */ m("div"),
|
|
456
|
-
/* @__PURE__ */ m("div")
|
|
457
|
-
])
|
|
458
|
-
], -1)), ut = { class: "modal-loading-text" }, ft = /* @__PURE__ */ K({
|
|
541
|
+
}), St = /* @__PURE__ */ F(Mt, [["__scopeId", "data-v-f5ece095"]]), $t = { class: "flex-center" }, Lt = { class: "modal-loading-text" }, _t = /* @__PURE__ */ de({
|
|
459
542
|
__name: "modal-loading",
|
|
460
543
|
props: {
|
|
461
544
|
text: { default: "加载中" }
|
|
462
545
|
},
|
|
463
|
-
setup(
|
|
464
|
-
return (
|
|
465
|
-
|
|
466
|
-
|
|
546
|
+
setup(e) {
|
|
547
|
+
return (n, o) => (k(), E("section", $t, [
|
|
548
|
+
o[0] || (o[0] = y("div", { class: "modal-loading" }, [
|
|
549
|
+
y("div", { class: "lds-ring" }, [
|
|
550
|
+
y("div"),
|
|
551
|
+
y("div"),
|
|
552
|
+
y("div"),
|
|
553
|
+
y("div")
|
|
554
|
+
])
|
|
555
|
+
], -1)),
|
|
556
|
+
y("div", Lt, W(e.text), 1)
|
|
467
557
|
]));
|
|
468
558
|
}
|
|
469
|
-
}),
|
|
559
|
+
}), Tt = /* @__PURE__ */ F(_t, [["__scopeId", "data-v-27aee8fa"]]), Et = {
|
|
470
560
|
key: 0,
|
|
471
561
|
class: "modal-teleport"
|
|
472
|
-
},
|
|
562
|
+
}, Ht = {
|
|
473
563
|
name: "ModalProvider",
|
|
474
564
|
inheritAttrs: !1
|
|
475
|
-
},
|
|
476
|
-
...
|
|
565
|
+
}, At = /* @__PURE__ */ de({
|
|
566
|
+
...Ht,
|
|
477
567
|
props: {
|
|
478
568
|
appendToBody: { type: [Boolean, String], default: !1 },
|
|
479
569
|
sizes: { default: () => ({
|
|
@@ -485,234 +575,217 @@ const Xe = (t) => (le("data-v-e065fedd"), t = t(), ae(), t), Ye = { class: "titl
|
|
|
485
575
|
maxHeight: { default: "90%" },
|
|
486
576
|
offset: { default: () => ({ x: 0, y: 0 }) }
|
|
487
577
|
},
|
|
488
|
-
setup(
|
|
489
|
-
const o =
|
|
490
|
-
function
|
|
491
|
-
const
|
|
492
|
-
() => Promise.resolve(typeof
|
|
578
|
+
setup(e, { expose: n }) {
|
|
579
|
+
const o = O([]), t = se(!1), s = q();
|
|
580
|
+
function r(f, m = {}, a = {}) {
|
|
581
|
+
const b = Ke(
|
|
582
|
+
() => Promise.resolve(typeof f == "string" ? St : f)
|
|
493
583
|
);
|
|
494
|
-
typeof
|
|
495
|
-
const
|
|
496
|
-
|
|
497
|
-
|
|
584
|
+
typeof f == "string" && (m.type = f, a.size = "small", a.fullscreen = !1, a.mode = "dialog", a.footer = !1, a.header = !1);
|
|
585
|
+
const p = Math.random().toString(32).slice(2), X = Object.assign(
|
|
586
|
+
{
|
|
587
|
+
zIndex: typeof f == "string" ? 1100 : 1e3
|
|
588
|
+
},
|
|
589
|
+
a
|
|
590
|
+
), Y = new Promise((R, T) => {
|
|
498
591
|
o.value.push({
|
|
499
|
-
id:
|
|
500
|
-
component:
|
|
501
|
-
props:
|
|
592
|
+
id: p,
|
|
593
|
+
component: b,
|
|
594
|
+
props: m || {},
|
|
502
595
|
options: {
|
|
503
|
-
...
|
|
504
|
-
type: typeof
|
|
596
|
+
...X,
|
|
597
|
+
type: typeof f == "string" ? f : "component"
|
|
505
598
|
},
|
|
506
|
-
resolve:
|
|
507
|
-
reject:
|
|
599
|
+
resolve: R,
|
|
600
|
+
reject: T,
|
|
508
601
|
listeners: []
|
|
509
|
-
}),
|
|
510
|
-
}).catch((
|
|
511
|
-
}) : Promise.reject(
|
|
512
|
-
return Object.assign(
|
|
513
|
-
close: () =>
|
|
602
|
+
}), U(o);
|
|
603
|
+
}).catch((R) => R === "CANCEL" ? new Promise(() => {
|
|
604
|
+
}) : Promise.reject(R));
|
|
605
|
+
return Object.assign(Y, {
|
|
606
|
+
close: () => u(p)
|
|
514
607
|
});
|
|
515
608
|
}
|
|
516
|
-
function
|
|
517
|
-
const a = o.value.findIndex((
|
|
609
|
+
function u(f, m) {
|
|
610
|
+
const a = o.value.findIndex((p) => p.id === f);
|
|
518
611
|
if (a < 0)
|
|
519
612
|
return;
|
|
520
|
-
const
|
|
521
|
-
|
|
613
|
+
const b = o.value[a];
|
|
614
|
+
m === void 0 ? b?.reject("CANCEL") : b?.resolve(m), o.value.splice(a, 1), U(o);
|
|
522
615
|
}
|
|
523
|
-
function
|
|
524
|
-
!o.value || o.value.length === 0 || (o.value.forEach((
|
|
525
|
-
|
|
526
|
-
}), o.value = [],
|
|
616
|
+
function w() {
|
|
617
|
+
!o.value || o.value.length === 0 || (o.value.forEach((f) => {
|
|
618
|
+
f?.reject("CANCEL");
|
|
619
|
+
}), o.value = [], U(o));
|
|
527
620
|
}
|
|
528
|
-
function _(
|
|
529
|
-
const a = o.value.find((
|
|
621
|
+
function _(f, m) {
|
|
622
|
+
const a = o.value.find((p) => p.id === f);
|
|
530
623
|
if (!a)
|
|
531
624
|
return;
|
|
532
|
-
const
|
|
533
|
-
|
|
534
|
-
open:
|
|
535
|
-
close: (
|
|
536
|
-
closeAll:
|
|
537
|
-
showLoading: () =>
|
|
538
|
-
hideLoading: () =>
|
|
539
|
-
confirm: (
|
|
540
|
-
success: (
|
|
541
|
-
error: (
|
|
542
|
-
warning: (
|
|
543
|
-
info: (
|
|
625
|
+
const b = a.listeners.find((p) => p.event === m);
|
|
626
|
+
b && b.callback({
|
|
627
|
+
open: r,
|
|
628
|
+
close: (p) => u(a.id, p),
|
|
629
|
+
closeAll: w,
|
|
630
|
+
showLoading: () => M(a.id),
|
|
631
|
+
hideLoading: () => x(a.id),
|
|
632
|
+
confirm: (p) => r("confirm", p),
|
|
633
|
+
success: (p) => r("success", p),
|
|
634
|
+
error: (p) => r("error", p),
|
|
635
|
+
warning: (p) => r("warning", p),
|
|
636
|
+
info: (p) => r("info", p)
|
|
544
637
|
});
|
|
545
638
|
}
|
|
546
|
-
function
|
|
547
|
-
if (!
|
|
639
|
+
function M(f, m) {
|
|
640
|
+
if (!s)
|
|
548
641
|
return;
|
|
549
|
-
const [a] =
|
|
642
|
+
const [a] = s.refs[`modal-container_${f}`] || [];
|
|
550
643
|
if (a)
|
|
551
644
|
return a.showLoading();
|
|
552
645
|
{
|
|
553
|
-
const { close:
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
header: !1,
|
|
558
|
-
closeable: !1,
|
|
559
|
-
backgroundColor: "transparent"
|
|
560
|
-
});
|
|
561
|
-
return d != null && d.duration && setTimeout(
|
|
562
|
-
() => {
|
|
563
|
-
g();
|
|
646
|
+
const { close: b } = r(
|
|
647
|
+
Tt,
|
|
648
|
+
{
|
|
649
|
+
text: m?.text
|
|
564
650
|
},
|
|
565
|
-
|
|
566
|
-
|
|
651
|
+
{
|
|
652
|
+
footer: !1,
|
|
653
|
+
header: !1,
|
|
654
|
+
closeable: !1,
|
|
655
|
+
backgroundColor: "transparent"
|
|
656
|
+
}
|
|
657
|
+
);
|
|
658
|
+
return m?.duration && setTimeout(() => {
|
|
659
|
+
b();
|
|
660
|
+
}, m?.duration), b;
|
|
567
661
|
}
|
|
568
662
|
}
|
|
569
|
-
function
|
|
570
|
-
if (!
|
|
663
|
+
function x(f) {
|
|
664
|
+
if (!s)
|
|
571
665
|
return;
|
|
572
|
-
const [
|
|
573
|
-
if (
|
|
574
|
-
return
|
|
666
|
+
const [m] = s.refs[`modal-container_${f}`];
|
|
667
|
+
if (m)
|
|
668
|
+
return m.hideLoading();
|
|
575
669
|
}
|
|
576
|
-
function
|
|
577
|
-
const
|
|
578
|
-
|
|
579
|
-
event:
|
|
670
|
+
function c(f, m, a) {
|
|
671
|
+
const b = o.value.find((p) => p.id === f);
|
|
672
|
+
b && b.listeners.push({
|
|
673
|
+
event: m,
|
|
580
674
|
callback: a
|
|
581
675
|
});
|
|
582
676
|
}
|
|
583
|
-
return
|
|
584
|
-
open:
|
|
585
|
-
close:
|
|
586
|
-
closeAll:
|
|
587
|
-
addEventListener:
|
|
588
|
-
showLoading:
|
|
589
|
-
hideLoading:
|
|
590
|
-
}),
|
|
677
|
+
return Ne(fe, {
|
|
678
|
+
open: r,
|
|
679
|
+
close: u,
|
|
680
|
+
closeAll: w,
|
|
681
|
+
addEventListener: c,
|
|
682
|
+
showLoading: M,
|
|
683
|
+
hideLoading: x
|
|
684
|
+
}), n({
|
|
591
685
|
elements: o,
|
|
592
|
-
open:
|
|
593
|
-
close:
|
|
594
|
-
closeAll:
|
|
595
|
-
}),
|
|
596
|
-
|
|
597
|
-
}), (
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
(
|
|
601
|
-
disabled: !
|
|
602
|
-
to: typeof
|
|
686
|
+
open: r,
|
|
687
|
+
close: u,
|
|
688
|
+
closeAll: w
|
|
689
|
+
}), ae(() => {
|
|
690
|
+
t.value = !0;
|
|
691
|
+
}), (f, m) => (k(), E(ye, null, [
|
|
692
|
+
we(f.$slots, "default", {}, void 0, !0),
|
|
693
|
+
t.value ? (k(), E("div", Et, [
|
|
694
|
+
(k(), N(be, {
|
|
695
|
+
disabled: !e.appendToBody,
|
|
696
|
+
to: typeof e.appendToBody == "string" ? e.appendToBody : "body"
|
|
603
697
|
}, [
|
|
604
|
-
|
|
605
|
-
default:
|
|
606
|
-
(
|
|
698
|
+
Fe(Xe, { name: "modal-fade" }, {
|
|
699
|
+
default: Ye(() => [
|
|
700
|
+
(k(!0), E(ye, null, je(o.value, (a) => (k(), N(ht, Ge({
|
|
607
701
|
id: a.id,
|
|
608
702
|
key: a.id,
|
|
609
703
|
ref_for: !0,
|
|
610
704
|
ref: `modal-container_${a.id}`,
|
|
611
705
|
component: a.component,
|
|
612
706
|
"component-props": a.props,
|
|
613
|
-
"max-height":
|
|
614
|
-
"max-width":
|
|
615
|
-
offset:
|
|
616
|
-
sizes:
|
|
617
|
-
}, a.options, {
|
|
707
|
+
"max-height": e.maxHeight,
|
|
708
|
+
"max-width": e.maxWidth,
|
|
709
|
+
offset: e.offset,
|
|
710
|
+
sizes: e.sizes
|
|
711
|
+
}, { ref_for: !0 }, a.options, {
|
|
618
712
|
onSubmit: () => _(a.id, "submit")
|
|
619
713
|
}), null, 16, ["id", "component", "component-props", "max-height", "max-width", "offset", "sizes", "onSubmit"]))), 128))
|
|
620
714
|
]),
|
|
621
715
|
_: 1
|
|
622
716
|
})
|
|
623
717
|
], 8, ["disabled", "to"]))
|
|
624
|
-
])) :
|
|
718
|
+
])) : D("", !0)
|
|
625
719
|
], 64));
|
|
626
720
|
}
|
|
627
|
-
}),
|
|
628
|
-
function
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
oe(t.$slots, "default", {}, void 0, !0)
|
|
632
|
-
])
|
|
633
|
-
]);
|
|
634
|
-
}
|
|
635
|
-
const St = /* @__PURE__ */ I(gt, [["render", bt], ["__scopeId", "data-v-46f8d703"]]), wt = {}, _t = { class: "modal-header" };
|
|
636
|
-
function xt(t, i) {
|
|
637
|
-
return y(), P(ne, { to: "#modal-header-slot" }, [
|
|
638
|
-
m("div", _t, [
|
|
639
|
-
oe(t.$slots, "default", {}, void 0, !0)
|
|
640
|
-
])
|
|
641
|
-
]);
|
|
642
|
-
}
|
|
643
|
-
const $t = /* @__PURE__ */ I(wt, [["render", xt], ["__scopeId", "data-v-d0247172"]]);
|
|
644
|
-
function X(t, i) {
|
|
645
|
-
var e, l;
|
|
646
|
-
let o = t == null ? void 0 : t.parent;
|
|
647
|
-
for (; o && ((e = o == null ? void 0 : o.type) == null ? void 0 : e.name) !== i; )
|
|
721
|
+
}), zt = /* @__PURE__ */ F(At, [["__scopeId", "data-v-d74e77f1"]]);
|
|
722
|
+
function re(e, n) {
|
|
723
|
+
let o = e?.parent;
|
|
724
|
+
for (; o && o?.type?.name !== n; )
|
|
648
725
|
o = o.parent;
|
|
649
|
-
return
|
|
726
|
+
return o?.type?.name === n ? o : null;
|
|
650
727
|
}
|
|
651
|
-
function
|
|
652
|
-
const
|
|
653
|
-
function o(
|
|
654
|
-
if (!
|
|
728
|
+
function Bt() {
|
|
729
|
+
const e = xe(fe), n = q();
|
|
730
|
+
function o(t, s, r) {
|
|
731
|
+
if (!e)
|
|
655
732
|
throw new Error("Not Found Modal Provider Component");
|
|
656
|
-
return
|
|
733
|
+
return e.open(t, s, r);
|
|
657
734
|
}
|
|
658
735
|
return {
|
|
659
736
|
open: o,
|
|
660
|
-
close(
|
|
661
|
-
|
|
662
|
-
if (!t)
|
|
737
|
+
close(t) {
|
|
738
|
+
if (!e)
|
|
663
739
|
throw new Error("Not Found Modal Provider Component");
|
|
664
|
-
const
|
|
665
|
-
if (!
|
|
740
|
+
const r = re(n, "ModalContainer")?.props?.id;
|
|
741
|
+
if (!r)
|
|
666
742
|
throw new Error("Not Found Current Modal Container");
|
|
667
|
-
|
|
743
|
+
e.close(r, t);
|
|
668
744
|
},
|
|
669
745
|
closeAll() {
|
|
670
|
-
if (!
|
|
746
|
+
if (!e)
|
|
671
747
|
throw new Error("Not Found Modal Provider Component");
|
|
672
|
-
|
|
748
|
+
e.closeAll();
|
|
673
749
|
},
|
|
674
|
-
showLoading(
|
|
675
|
-
|
|
676
|
-
if (!t)
|
|
750
|
+
showLoading(t) {
|
|
751
|
+
if (!e)
|
|
677
752
|
throw new Error("Not Found Modal Provider Component");
|
|
678
|
-
const
|
|
679
|
-
return
|
|
753
|
+
const r = re(n, "ModalContainer")?.props?.id;
|
|
754
|
+
return e.showLoading(r, t);
|
|
680
755
|
},
|
|
681
756
|
hideLoading() {
|
|
682
|
-
|
|
683
|
-
if (!t)
|
|
757
|
+
if (!e)
|
|
684
758
|
throw new Error("Not Found Modal Provider Component");
|
|
685
|
-
const
|
|
686
|
-
return
|
|
759
|
+
const s = re(n, "ModalContainer")?.props?.id;
|
|
760
|
+
return e.hideLoading(s);
|
|
687
761
|
},
|
|
688
|
-
confirm(
|
|
689
|
-
return this.open("confirm",
|
|
762
|
+
confirm(t) {
|
|
763
|
+
return this.open("confirm", t);
|
|
690
764
|
},
|
|
691
|
-
info(
|
|
692
|
-
return this.open("info",
|
|
765
|
+
info(t) {
|
|
766
|
+
return this.open("info", t);
|
|
693
767
|
},
|
|
694
|
-
error(
|
|
695
|
-
return this.open("error",
|
|
768
|
+
error(t) {
|
|
769
|
+
return this.open("error", t);
|
|
696
770
|
},
|
|
697
|
-
warning(
|
|
698
|
-
return this.open("warning",
|
|
771
|
+
warning(t) {
|
|
772
|
+
return this.open("warning", t);
|
|
699
773
|
},
|
|
700
|
-
success(
|
|
701
|
-
return this.open("success",
|
|
774
|
+
success(t) {
|
|
775
|
+
return this.open("success", t);
|
|
702
776
|
}
|
|
703
777
|
};
|
|
704
778
|
}
|
|
705
|
-
function
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
i && l && i.addEventListener(l, "submit", t);
|
|
779
|
+
function Wt(e) {
|
|
780
|
+
const n = xe(fe), o = q(), s = re(o, "ModalContainer")?.props?.id;
|
|
781
|
+
n && s && n.addEventListener(s, "submit", e);
|
|
709
782
|
}
|
|
710
783
|
export {
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
784
|
+
ht as ModalContainer,
|
|
785
|
+
Pt as ModalFooter,
|
|
786
|
+
Rt as ModalHeader,
|
|
787
|
+
fe as ModalKey,
|
|
788
|
+
zt as ModalProvider,
|
|
789
|
+
Wt as onSubmit,
|
|
790
|
+
Bt as useModal
|
|
718
791
|
};
|