x-next 0.0.0-alpha.16 → 0.0.0-alpha.18
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/components/button/Button.d.ts +2 -2
- package/dist/components/button/index.d.ts +27 -27
- package/dist/components/dialog/{index.vue.d.ts → Dialog.d.ts} +4 -37
- package/dist/components/dialog/index.d.ts +334 -0
- package/dist/components/index.d.ts +5 -0
- package/dist/components/message/Message.d.ts +102 -0
- package/dist/components/message/index.d.ts +184 -0
- package/dist/components/message-box/MessageBox.d.ts +3 -0
- package/dist/components/message-box/index.d.ts +4 -3
- package/dist/components/message-box/warp.d.ts +1 -1
- package/dist/components/notification/Notification.d.ts +89 -0
- package/dist/components/notification/index.d.ts +166 -0
- package/dist/components/space/Space.d.ts +42 -0
- package/dist/components/space/index.d.ts +65 -25
- package/dist/icons/animation/animation-loading.d.ts +48 -4
- package/dist/icons/default/{exclamation-circle-fill.vue.d.ts → check-circle-fill.d.ts} +2 -7
- package/dist/icons/{animation/animation-loading.vue.d.ts → default/close-circle-fill.d.ts} +2 -7
- package/dist/icons/default/{check-circle-fill.vue.d.ts → exclamation-circle-fill.d.ts} +2 -7
- package/dist/icons/default/{close-circle-fill.vue.d.ts → info-circle-fill.d.ts} +2 -7
- package/dist/icons/default/minus-circle-fill.d.ts +50 -0
- package/dist/icons/icon.d.ts +50 -0
- package/dist/icons/index.d.ts +6 -6
- package/dist/index.es.js +787 -944
- package/dist/index.umd.js +1 -1
- package/dist/style.css +1 -1
- package/dist/types.d.ts +5 -0
- package/package.json +2 -2
- package/dist/_utils/icon.d.ts +0 -59
- package/dist/components/message/index.vue.d.ts +0 -387
- package/dist/components/notification/index.vue.d.ts +0 -160
- package/dist/icons/default/info-circle-fill.vue.d.ts +0 -55
- package/dist/icons/default/minus-circle-fill.vue.d.ts +0 -55
- package/dist/web-types.json +0 -11
package/dist/index.es.js
CHANGED
@@ -1,46 +1,46 @@
|
|
1
|
-
var
|
2
|
-
var
|
3
|
-
var
|
4
|
-
import { defineComponent as
|
5
|
-
const
|
6
|
-
const t =
|
1
|
+
var $e = Object.defineProperty;
|
2
|
+
var Pe = (e, t, n) => t in e ? $e(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
3
|
+
var N = (e, t, n) => Pe(e, typeof t != "symbol" ? t + "" : t, n);
|
4
|
+
import { defineComponent as T, computed as C, createVNode as r, h as E, reactive as ve, getCurrentInstance as _e, ref as I, watch as J, onMounted as Q, onBeforeUnmount as Ce, readonly as He, Teleport as We, Transition as V, onUnmounted as ke, Comment as Ve, Fragment as L, render as S, isVNode as k, createTextVNode as B } from "vue";
|
5
|
+
const Ze = "X", Xe = "x", be = (e) => e ? Xe + "-" + e : e || "", p = (e) => Ze + e, O = (e) => {
|
6
|
+
const t = be(e);
|
7
7
|
return {
|
8
8
|
block: t,
|
9
|
-
element: (
|
10
|
-
modifier: (
|
11
|
-
is: (
|
9
|
+
element: (o) => `${t}--${o}`,
|
10
|
+
modifier: (o) => `${t}-${o}`,
|
11
|
+
is: (o) => `${t}-is-${o}`
|
12
12
|
};
|
13
|
-
},
|
14
|
-
function
|
15
|
-
return
|
13
|
+
}, P = Object.prototype.toString;
|
14
|
+
function we(e) {
|
15
|
+
return P.call(e) === "[object Array]";
|
16
16
|
}
|
17
|
-
function
|
18
|
-
return
|
17
|
+
function xe(e) {
|
18
|
+
return P.call(e) === "[object Object]";
|
19
19
|
}
|
20
|
-
const
|
21
|
-
function
|
22
|
-
return
|
20
|
+
const Be = (e) => P.call(e) === "[object Promise]", Ue = (e) => b(e) && e.constructor.name === "AsyncFunction", Re = (e) => Be(e) || Ue(e);
|
21
|
+
function Se(e) {
|
22
|
+
return P.call(e) === "[object String]";
|
23
23
|
}
|
24
|
-
function
|
25
|
-
return
|
24
|
+
function Ke(e) {
|
25
|
+
return P.call(e) === "[object Number]" && e === e;
|
26
26
|
}
|
27
|
-
function
|
27
|
+
function b(e) {
|
28
28
|
return typeof e == "function";
|
29
29
|
}
|
30
|
-
function
|
30
|
+
function Z() {
|
31
31
|
return typeof window < "u";
|
32
32
|
}
|
33
|
-
const
|
34
|
-
var l,
|
33
|
+
const z = (e) => e, Ye = (e) => !!(e && e.shapeFlag & 1), Ge = (e, t) => !!(e && e.shapeFlag & 6), qe = (e, t) => !!(e && e.shapeFlag & 8), Je = (e, t) => !!(e && e.shapeFlag & 16), Qe = (e, t) => !!(e && e.shapeFlag & 32), W = (e, t = !1) => {
|
34
|
+
var l, s;
|
35
35
|
const n = [];
|
36
|
-
for (const
|
37
|
-
|
36
|
+
for (const o of e ?? [])
|
37
|
+
Ye(o) || Ge(o) || t && qe(o, o.children) ? n.push(o) : Je(o, o.children) ? n.push(...W(o.children, t)) : Qe(o, o.children) ? n.push(...W((s = (l = o.children).default) == null ? void 0 : s.call(l), t)) : we(o) && n.push(...W(o, t));
|
38
38
|
return n;
|
39
|
-
},
|
39
|
+
}, M = (e, t) => Object.assign(t, {
|
40
40
|
install(n) {
|
41
41
|
n.component(e) || n.component(e, t);
|
42
42
|
}
|
43
|
-
}),
|
43
|
+
}), et = {
|
44
44
|
disabled: Boolean,
|
45
45
|
block: Boolean,
|
46
46
|
loading: Boolean,
|
@@ -53,7 +53,7 @@ const W = (e) => e, st = (e) => !!(e && e.shapeFlag & 1), at = (e, t) => !!(e &&
|
|
53
53
|
default: 0
|
54
54
|
},
|
55
55
|
shape: {
|
56
|
-
type:
|
56
|
+
type: z(String),
|
57
57
|
default: void 0
|
58
58
|
},
|
59
59
|
link: {
|
@@ -61,11 +61,11 @@ const W = (e) => e, st = (e) => !!(e && e.shapeFlag & 1), at = (e, t) => !!(e &&
|
|
61
61
|
default: !1
|
62
62
|
},
|
63
63
|
type: {
|
64
|
-
type:
|
64
|
+
type: z(String),
|
65
65
|
default: void 0
|
66
66
|
},
|
67
67
|
status: {
|
68
|
-
type:
|
68
|
+
type: z(String),
|
69
69
|
default: void 0
|
70
70
|
},
|
71
71
|
plain: {
|
@@ -73,223 +73,258 @@ const W = (e) => e, st = (e) => !!(e && e.shapeFlag & 1), at = (e, t) => !!(e &&
|
|
73
73
|
default: !1
|
74
74
|
},
|
75
75
|
size: {
|
76
|
-
type:
|
76
|
+
type: z(String),
|
77
77
|
default: "medium"
|
78
78
|
},
|
79
79
|
border: {
|
80
80
|
type: Boolean,
|
81
81
|
default: !0
|
82
82
|
}
|
83
|
-
},
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
83
|
+
}, tt = (e) => Se(e) ? e.split("-").map((t) => t.charAt(0).toUpperCase() + t.slice(1)).join("") : "", nt = (e, t = "px") => {
|
84
|
+
if (e === void 0) return "";
|
85
|
+
const n = typeof e == "number" ? `${e}` : e;
|
86
|
+
return ["px", "%", "vh", "vw", "calc"].some((s) => n.includes(s)) ? n : n + t;
|
87
|
+
};
|
88
|
+
function A(e, t) {
|
89
|
+
return /* @__PURE__ */ T({
|
90
|
+
name: be(`Icon${tt(e)}`),
|
91
|
+
props: {
|
92
|
+
size: {
|
93
|
+
type: [Number, String],
|
94
|
+
default: void 0
|
95
|
+
},
|
96
|
+
rotate: {
|
97
|
+
type: Number,
|
98
|
+
default: void 0
|
99
|
+
},
|
100
|
+
spin: {
|
101
|
+
type: Boolean,
|
102
|
+
default: !1
|
103
|
+
},
|
104
|
+
color: {
|
105
|
+
type: String,
|
106
|
+
default: void 0
|
107
|
+
},
|
108
|
+
fillColor: {
|
109
|
+
type: Array,
|
110
|
+
default: void 0
|
111
|
+
}
|
112
|
+
},
|
113
|
+
setup(n) {
|
114
|
+
const l = "x-icon", s = C(() => {
|
115
|
+
const d = {};
|
116
|
+
return n.size && (d.fontSize = nt(n.size)), n.rotate && (d.transform = `rotate(${n.rotate}deg)`), n.color && (d.color = n.color), d;
|
117
|
+
}), o = C(() => [l, {
|
118
|
+
[`${l}-loading`]: n.spin
|
119
|
+
}]);
|
120
|
+
return () => r("div", {
|
121
|
+
class: o.value,
|
122
|
+
style: s.value
|
123
|
+
}, [t]);
|
124
|
+
}
|
125
|
+
});
|
126
|
+
}
|
127
|
+
const lt = A("InfoCircleFill", E(r("svg", {
|
128
|
+
viewBox: "0 0 50 50",
|
129
|
+
class: "x-icon-loading-svg"
|
130
|
+
}, [r("circle", {
|
131
|
+
cx: "25",
|
132
|
+
cy: "25",
|
133
|
+
r: "20",
|
134
|
+
class: "path",
|
135
|
+
fill: "none",
|
136
|
+
stroke: "currentColor"
|
137
|
+
}, null)]))), rt = /* @__PURE__ */ T({
|
102
138
|
name: "Button",
|
103
|
-
props:
|
139
|
+
props: et,
|
104
140
|
emits: ["click"],
|
141
|
+
// 显式导入插槽
|
142
|
+
$slots: ["prefix", "suffix"],
|
105
143
|
setup(e, {
|
106
144
|
slots: t,
|
107
145
|
emit: n
|
108
146
|
}) {
|
109
|
-
const l =
|
147
|
+
const l = ve({
|
110
148
|
clicked: !1,
|
111
149
|
isDebounce: !1
|
112
|
-
}),
|
150
|
+
}), s = O("button"), o = C(() => [s.block, e.type && s.modifier(e.type), e.status && s.modifier(e.status), e.disabled && s.is("disabled"), e.block && s.modifier("block"), e.plain && s.is("plain"), e.shape && s.modifier(e.shape), e.link && s.modifier("is-link"), e.size && s.modifier(e.size), !e.border && s.modifier("is-hide-border"), a.value && s.modifier("is-loading")]), d = () => {
|
113
151
|
e.debounce > 0 && !l.isDebounce && (l.isDebounce = !0, setTimeout(() => {
|
114
152
|
l.isDebounce = !1;
|
115
153
|
}, e.debounce));
|
116
|
-
},
|
117
|
-
const
|
118
|
-
|
154
|
+
}, a = C(() => e.loading || l.clicked || l.isDebounce), f = _e(), m = (i, c) => {
|
155
|
+
const u = i(c);
|
156
|
+
Re(u) && (l.clicked = !0, u.finally(() => {
|
119
157
|
l.clicked = !1;
|
120
158
|
}));
|
121
|
-
},
|
122
|
-
var
|
123
|
-
if (i.stopPropagation(), (
|
124
|
-
|
125
|
-
const
|
126
|
-
if (
|
127
|
-
|
128
|
-
else if (
|
129
|
-
m(
|
159
|
+
}, y = (i) => {
|
160
|
+
var u, v, g, w;
|
161
|
+
if (i.stopPropagation(), (v = (u = i.target).blur) == null || v.call(u), a.value) return;
|
162
|
+
d();
|
163
|
+
const c = (w = (g = f == null ? void 0 : f.vnode) == null ? void 0 : g.props) == null ? void 0 : w.onClick;
|
164
|
+
if (we(c))
|
165
|
+
c.forEach((X) => m(X, i));
|
166
|
+
else if (b(c)) {
|
167
|
+
m(c, i);
|
130
168
|
return;
|
131
169
|
}
|
132
170
|
};
|
133
171
|
return () => {
|
134
172
|
var i;
|
135
|
-
return
|
136
|
-
class:
|
173
|
+
return r("button", {
|
174
|
+
class: o.value,
|
137
175
|
type: "button",
|
138
176
|
disabled: e.disabled,
|
139
|
-
onClick:
|
140
|
-
}, [
|
177
|
+
onClick: y
|
178
|
+
}, [r("span", {
|
141
179
|
style: {
|
142
|
-
|
143
|
-
marginRight:
|
180
|
+
display: a.value ? "flex" : "none",
|
181
|
+
marginRight: a.value ? "4px" : "0px"
|
144
182
|
},
|
145
|
-
class:
|
146
|
-
}, [
|
147
|
-
class:
|
148
|
-
}, [t.prefix()]),
|
149
|
-
class:
|
150
|
-
}, [(i = t.default) == null ? void 0 : i.call(t)]), t.suffix &&
|
151
|
-
class:
|
183
|
+
class: s.element("loading")
|
184
|
+
}, [r(lt, null, null)]), t.prefix && r("span", {
|
185
|
+
class: s.element("prefix")
|
186
|
+
}, [t.prefix()]), r("span", {
|
187
|
+
class: s.element("content")
|
188
|
+
}, [(i = t.default) == null ? void 0 : i.call(t)]), t.suffix && r("span", {
|
189
|
+
class: s.element("suffix")
|
152
190
|
}, [t.suffix()])]);
|
153
191
|
};
|
154
192
|
}
|
155
|
-
}),
|
156
|
-
__proto__: null,
|
157
|
-
XButton: K
|
158
|
-
}, Symbol.toStringTag, { value: "Module" })), yt = ["px", "%", "vh", "vw", "calc"], Be = (e, t = "px") => {
|
193
|
+
}), $ = M(p("Button"), rt), at = ["px", "%", "vh", "vw", "calc"], fe = (e, t = "px") => {
|
159
194
|
if (e === void 0) return "";
|
160
195
|
const n = String(e);
|
161
|
-
return
|
162
|
-
},
|
163
|
-
class
|
196
|
+
return at.some((l) => n.includes(l)) ? n : n + t;
|
197
|
+
}, ot = 1e3, st = 3e3, ct = 1;
|
198
|
+
class it {
|
164
199
|
constructor() {
|
165
|
-
|
200
|
+
N(this, "popupStack", {
|
166
201
|
popup: /* @__PURE__ */ new Set(),
|
167
202
|
dialog: /* @__PURE__ */ new Set(),
|
168
203
|
message: /* @__PURE__ */ new Set()
|
169
204
|
});
|
170
|
-
|
171
|
-
|
205
|
+
N(this, "getNextZIndex", (t) => (t === "message" ? Array.from(this.popupStack.message).pop() || st : Array.from(this.popupStack.popup).pop() || ot) + ct);
|
206
|
+
N(this, "add", (t) => {
|
172
207
|
const n = this.getNextZIndex(t);
|
173
208
|
return this.popupStack[t].add(n), t === "dialog" && this.popupStack.popup.add(n), n;
|
174
209
|
});
|
175
|
-
|
210
|
+
N(this, "delete", (t, n) => {
|
176
211
|
this.popupStack[n].delete(t), n === "dialog" && this.popupStack.popup.delete(t);
|
177
212
|
});
|
178
|
-
|
213
|
+
N(this, "isLastDialog", (t) => this.popupStack.dialog.size > 1 ? t === Array.from(this.popupStack.dialog).pop() : !0);
|
179
214
|
}
|
180
215
|
}
|
181
|
-
const
|
182
|
-
function
|
216
|
+
const R = new it();
|
217
|
+
function ee(e, {
|
183
218
|
visible: t,
|
184
219
|
runOnMounted: n
|
185
220
|
} = {}) {
|
186
|
-
const l =
|
187
|
-
l.value =
|
188
|
-
},
|
189
|
-
|
190
|
-
},
|
191
|
-
return
|
221
|
+
const l = I(0), s = () => {
|
222
|
+
l.value = R.add(e);
|
223
|
+
}, o = () => {
|
224
|
+
R.delete(l.value, e);
|
225
|
+
}, d = () => e === "dialog" ? R.isLastDialog(l.value) : !1;
|
226
|
+
return J(
|
192
227
|
() => t == null ? void 0 : t.value,
|
193
|
-
(
|
194
|
-
|
228
|
+
(a) => {
|
229
|
+
a ? s() : o();
|
195
230
|
},
|
196
231
|
{
|
197
232
|
immediate: !0
|
198
233
|
}
|
199
|
-
), n && (
|
234
|
+
), n && (Q(() => {
|
235
|
+
s();
|
236
|
+
}), Ce(() => {
|
200
237
|
o();
|
201
|
-
}), Te(() => {
|
202
|
-
r();
|
203
238
|
})), {
|
204
|
-
zIndex:
|
205
|
-
open:
|
206
|
-
close:
|
207
|
-
isLastDialog:
|
239
|
+
zIndex: He(l),
|
240
|
+
open: s,
|
241
|
+
close: o,
|
242
|
+
isLastDialog: d
|
208
243
|
};
|
209
244
|
}
|
210
|
-
const
|
211
|
-
},
|
212
|
-
if (
|
245
|
+
const Oe = (e) => e.replace(/^./, (t) => t.toLowerCase()).replace(/-(\w)/g, (t, n) => (n == null ? void 0 : n.toUpperCase()) ?? ""), pe = () => {
|
246
|
+
}, ut = (e, t) => {
|
247
|
+
if (Z)
|
213
248
|
return (t ?? document).querySelector(e) ?? void 0;
|
214
|
-
},
|
249
|
+
}, dt = (e) => {
|
215
250
|
if (e.tagName === "BODY")
|
216
251
|
return window.innerWidth - (document.documentElement.offsetWidth || document.body.offsetWidth);
|
217
252
|
const { borderLeftWidth: t, borderRightWidth: n } = window.getComputedStyle(e), l = Number(t.replace("px", "")) + Number(n.replace("px", ""));
|
218
253
|
return e.offsetWidth - (e.clientWidth + l);
|
219
|
-
},
|
254
|
+
}, ft = (e) => e.tagName === "BODY" ? document.documentElement.scrollHeight > window.innerHeight : e.scrollHeight > e.offsetHeight, mt = (e, t) => {
|
220
255
|
var l;
|
221
|
-
if (!
|
222
|
-
let n =
|
256
|
+
if (!Z || !e || !t) return "";
|
257
|
+
let n = Oe(t);
|
223
258
|
n === "float" && (n = "cssFloat");
|
224
259
|
try {
|
225
|
-
const
|
226
|
-
if (
|
227
|
-
const
|
228
|
-
return
|
260
|
+
const s = e.style[n];
|
261
|
+
if (s) return s;
|
262
|
+
const o = (l = document.defaultView) == null ? void 0 : l.getComputedStyle(e, "");
|
263
|
+
return o ? o[n] : "";
|
229
264
|
} catch {
|
230
265
|
return e.style[n];
|
231
266
|
}
|
232
|
-
},
|
267
|
+
}, j = (e, t, n) => {
|
233
268
|
if (!(!e || !t))
|
234
|
-
if (
|
269
|
+
if (xe(t))
|
235
270
|
Object.entries(t).forEach(
|
236
|
-
([l,
|
271
|
+
([l, s]) => j(e, l, s)
|
237
272
|
);
|
238
273
|
else {
|
239
|
-
const l =
|
274
|
+
const l = Oe(t);
|
240
275
|
e.style[l] = n;
|
241
276
|
}
|
242
|
-
},
|
243
|
-
if (
|
277
|
+
}, te = (e, t) => {
|
278
|
+
if (Se(e)) {
|
244
279
|
const n = e[0] === "#" ? `[id='${e.slice(1)}']` : e;
|
245
|
-
return
|
280
|
+
return ut(n, t);
|
246
281
|
}
|
247
282
|
return e;
|
248
|
-
},
|
283
|
+
}, gt = Z ? (e, t, n, l = !1) => {
|
249
284
|
e.addEventListener(t, n, l);
|
250
|
-
} :
|
285
|
+
} : pe, ht = Z ? (e, t, n, l = !1) => {
|
251
286
|
e.removeEventListener(t, n, l);
|
252
|
-
} :
|
287
|
+
} : pe, yt = (e, t) => {
|
253
288
|
let n = !1;
|
254
289
|
const l = {
|
255
290
|
overflow: "",
|
256
291
|
width: ""
|
257
|
-
},
|
292
|
+
}, s = (a) => a.tagName === "BODY", o = () => {
|
258
293
|
if (e.value) {
|
259
|
-
const
|
260
|
-
if (!n &&
|
261
|
-
const
|
262
|
-
if (
|
263
|
-
l.overflow =
|
294
|
+
const a = e.value;
|
295
|
+
if (!n && a.style.overflow !== "hidden") {
|
296
|
+
const f = dt(a);
|
297
|
+
if (f > 0 || ft(a)) {
|
298
|
+
l.overflow = a.style.overflow, l.width = a.style.width;
|
264
299
|
let m = 0;
|
265
|
-
|
266
|
-
width: `calc(100% - ${Math.ceil(
|
300
|
+
s(a) && (m = a.getBoundingClientRect().left || 0), j(a, {
|
301
|
+
width: `calc(100% - ${Math.ceil(f - m)}px)`,
|
267
302
|
overflow: "hidden"
|
268
303
|
}), n = !0;
|
269
304
|
}
|
270
305
|
}
|
271
306
|
}
|
272
|
-
},
|
307
|
+
}, d = () => {
|
273
308
|
if (e.value && n) {
|
274
|
-
const
|
275
|
-
|
309
|
+
const a = e.value;
|
310
|
+
j(a, {
|
276
311
|
overflow: l.overflow,
|
277
312
|
width: l.width
|
278
313
|
}), n = !1;
|
279
314
|
}
|
280
315
|
};
|
281
|
-
return
|
316
|
+
return J(
|
282
317
|
() => t == null ? void 0 : t.value,
|
283
|
-
(
|
284
|
-
e.value && !
|
318
|
+
(a) => {
|
319
|
+
e.value && !s(e.value) && (a && j(a, {
|
285
320
|
position: "absolute"
|
286
|
-
}),
|
321
|
+
}), mt(e.value, "position") === "static" && j(e.value, { position: "relative" }));
|
287
322
|
}
|
288
323
|
), {
|
289
|
-
setOverflowHidden:
|
290
|
-
resetOverflow:
|
324
|
+
setOverflowHidden: o,
|
325
|
+
resetOverflow: d
|
291
326
|
};
|
292
|
-
},
|
327
|
+
}, vt = {
|
293
328
|
ENTER: "Enter",
|
294
329
|
ESC: "Escape",
|
295
330
|
BACKSPACE: "Backspace",
|
@@ -299,9 +334,9 @@ const Ie = (e) => e.replace(/^./, (t) => t.toLowerCase()).replace(/-(\w)/g, (t,
|
|
299
334
|
ARROW_DOWN: "ArrowDown",
|
300
335
|
ARROW_LEFT: "ArrowLeft",
|
301
336
|
ARROW_RIGHT: "ArrowRight"
|
302
|
-
},
|
337
|
+
}, Ct = {
|
303
338
|
renderTo: {
|
304
|
-
type:
|
339
|
+
type: z([String, Object]),
|
305
340
|
default: "body"
|
306
341
|
},
|
307
342
|
disabled: {
|
@@ -385,513 +420,196 @@ const Ie = (e) => e.replace(/^./, (t) => t.toLowerCase()).replace(/-(\w)/g, (t,
|
|
385
420
|
type: Boolean,
|
386
421
|
default: !1
|
387
422
|
}
|
388
|
-
},
|
389
|
-
name:
|
423
|
+
}, kt = ["width", "minWidth", "height", "minHeight"], Ne = /* @__PURE__ */ T({
|
424
|
+
name: p("Dialog"),
|
390
425
|
inheritAttrs: !1,
|
391
|
-
props:
|
426
|
+
props: Ct,
|
392
427
|
emits: ["closed", "close", "open", "opened", "update:modelValue"],
|
393
|
-
setup(e, {
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
})), i = k(() => {
|
428
|
+
setup(e, {
|
429
|
+
emit: t,
|
430
|
+
slots: n
|
431
|
+
}) {
|
432
|
+
const l = O("dialog"), s = l.block, o = O("message-box"), d = C(() => [s, e.messageBox && "is-message-box", e.popupClass && e.popupClass]), a = C(() => te(e.renderTo)), f = I(), m = C(() => e.disabled || !a.value), y = C(() => ({
|
433
|
+
zIndex: g.value
|
434
|
+
})), i = C(() => {
|
401
435
|
const h = {};
|
402
|
-
return e.fullscreen || (!e.center && e.top && (h.top =
|
403
|
-
e[
|
436
|
+
return e.fullscreen || (!e.center && e.top && (h.top = fe(e.top)), kt.forEach((x) => {
|
437
|
+
e[x] && (h[x] = fe(e[x]));
|
404
438
|
})), h;
|
405
|
-
}),
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
439
|
+
}), c = I(!1), u = C(() => e.modelValue), v = C(() => u.value || c.value), {
|
440
|
+
zIndex: g,
|
441
|
+
isLastDialog: w
|
442
|
+
} = ee("dialog", {
|
443
|
+
visible: u
|
444
|
+
}), {
|
445
|
+
setOverflowHidden: X,
|
446
|
+
resetOverflow: ce
|
447
|
+
} = yt(a, f), ie = (h, x) => {
|
448
|
+
t("update:modelValue", !1), t("close", e.messageBox ? h : void 0, e.messageBox ? x : void 0);
|
449
|
+
}, Ae = () => {
|
450
|
+
c.value = !1, ce(), t("closed");
|
451
|
+
}, Fe = () => {
|
412
452
|
t("opened");
|
413
|
-
},
|
453
|
+
}, _ = ve({
|
414
454
|
ok: !1,
|
415
455
|
cancel: !1
|
416
|
-
}),
|
417
|
-
let
|
418
|
-
if (
|
419
|
-
|
420
|
-
|
456
|
+
}), F = (h, x) => {
|
457
|
+
let H = !0;
|
458
|
+
if (_[h] = !0, b(e.onBeforeCancel) && (H = e.onBeforeCancel(h) ?? !1), Be(H)) {
|
459
|
+
H.then((Le) => {
|
460
|
+
_[h] = !1, Le && ie(h, x);
|
421
461
|
});
|
422
462
|
return;
|
423
463
|
}
|
424
|
-
|
425
|
-
},
|
426
|
-
e.maskToClose && e.mask &&
|
427
|
-
},
|
428
|
-
|
429
|
-
},
|
430
|
-
|
464
|
+
_[h] = !1, H && ie(h, x);
|
465
|
+
}, De = () => {
|
466
|
+
e.maskToClose && e.mask && F("cancel");
|
467
|
+
}, ze = (h) => {
|
468
|
+
F("cancel", h);
|
469
|
+
}, je = (h) => {
|
470
|
+
F("ok", h);
|
431
471
|
};
|
432
|
-
let
|
433
|
-
const
|
434
|
-
e.escToClose && h.key ===
|
435
|
-
},
|
436
|
-
e.escToClose && !
|
437
|
-
},
|
438
|
-
|
439
|
-
};
|
440
|
-
return Te(() => {
|
441
|
-
Ce(), be();
|
442
|
-
}), ce(
|
443
|
-
() => c.value,
|
444
|
-
(h) => {
|
445
|
-
h ? (t("open"), le(), a.value = !0, Xe()) : be();
|
446
|
-
},
|
447
|
-
{ immediate: !0 }
|
448
|
-
), {
|
449
|
-
cls: u,
|
450
|
-
ns: l,
|
451
|
-
cn: n,
|
452
|
-
cnOMB: o,
|
453
|
-
messageBoxNs: r,
|
454
|
-
containerStyle: i,
|
455
|
-
dialogStyle: C,
|
456
|
-
dialogRef: d,
|
457
|
-
teleportContainer: s,
|
458
|
-
teleportDisabled: m,
|
459
|
-
modelVisible: c,
|
460
|
-
mergeVisible: p,
|
461
|
-
interceptClose: P,
|
462
|
-
afterLeave: We,
|
463
|
-
afterEnter: Ze,
|
464
|
-
handleMaskClick: Ue,
|
465
|
-
handleCancel: xe,
|
466
|
-
handleOk: Re,
|
467
|
-
loadingObj: q
|
472
|
+
let U = !1;
|
473
|
+
const ue = (h) => {
|
474
|
+
e.escToClose && h.key === vt.ESC && w() && F("cancel");
|
475
|
+
}, Ie = () => {
|
476
|
+
e.escToClose && !U && (U = !0, gt(document.documentElement, "keydown", ue));
|
477
|
+
}, de = () => {
|
478
|
+
U = !1, ht(document.documentElement, "keydown", ue);
|
468
479
|
};
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
|
473
|
-
|
474
|
-
|
475
|
-
}
|
476
|
-
|
477
|
-
|
478
|
-
|
479
|
-
|
480
|
-
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
class: g(e.cls),
|
485
|
-
style: N(e.dialogStyle)
|
486
|
-
}, [
|
487
|
-
f(_, {
|
480
|
+
return Ce(() => {
|
481
|
+
ce(), de();
|
482
|
+
}), J(() => u.value, (h) => {
|
483
|
+
h ? (t("open"), X(), c.value = !0, Ie()) : de();
|
484
|
+
}, {
|
485
|
+
immediate: !0
|
486
|
+
}), () => r(We, {
|
487
|
+
to: a.value,
|
488
|
+
disabled: m.value
|
489
|
+
}, {
|
490
|
+
default: () => [v.value && r("div", {
|
491
|
+
ref: f,
|
492
|
+
class: d.value,
|
493
|
+
style: y.value
|
494
|
+
}, [r(V, {
|
488
495
|
name: "x-fade-in-standard",
|
489
|
-
appear:
|
496
|
+
appear: !0
|
490
497
|
}, {
|
491
|
-
default:
|
492
|
-
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
|
503
|
-
|
504
|
-
},
|
505
|
-
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
}, {
|
511
|
-
|
512
|
-
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
|
520
|
-
|
521
|
-
|
522
|
-
|
523
|
-
|
524
|
-
|
525
|
-
|
526
|
-
|
527
|
-
], 2),
|
528
|
-
y("div", {
|
529
|
-
class: g([e.messageBox ? e.cnOMB.element("body") : e.cn.element("body")])
|
530
|
-
}, [
|
531
|
-
j(e.$slots, "default")
|
532
|
-
], 2),
|
533
|
-
y("div", {
|
534
|
-
class: g([e.messageBox ? e.cnOMB.element("footer") : e.cn.element("footer")])
|
535
|
-
}, [
|
536
|
-
j(e.$slots, "footer", {
|
537
|
-
cancel: e.handleCancel,
|
538
|
-
ok: e.handleOk,
|
539
|
-
loadingObj: e.loadingObj
|
540
|
-
})
|
541
|
-
], 2),
|
542
|
-
e.showClose ? (v(), S("span", {
|
543
|
-
key: 0,
|
544
|
-
class: g([e.cn.element("close-icon"), e.messageBox && e.cnOMB.element("close-icon")]),
|
545
|
-
onClick: t[0] || (t[0] = (u) => e.interceptClose("cancel"))
|
546
|
-
}, null, 2)) : D("", !0)
|
547
|
-
], 6), [
|
548
|
-
[x, e.modelVisible]
|
549
|
-
])
|
550
|
-
]),
|
551
|
-
_: 3
|
552
|
-
}, 8, ["onAfterEnter", "onAfterLeave"])
|
553
|
-
], 2)
|
554
|
-
], 6)), [
|
555
|
-
[x, e.mergeVisible]
|
556
|
-
]) : D("", !0)
|
557
|
-
], 8, ["to", "disabled"]);
|
558
|
-
}
|
559
|
-
const Ve = /* @__PURE__ */ F(Mt, [["render", At]]), He = /* @__PURE__ */ z({
|
560
|
-
name: Y("Space"),
|
561
|
-
props: {
|
562
|
-
direction: {
|
563
|
-
type: String,
|
564
|
-
default: "horizontal"
|
565
|
-
},
|
566
|
-
size: {
|
567
|
-
type: [Number, String],
|
568
|
-
default: "small"
|
569
|
-
},
|
570
|
-
align: {
|
571
|
-
type: String,
|
572
|
-
default: "center"
|
573
|
-
},
|
574
|
-
fill: {
|
575
|
-
type: Boolean,
|
576
|
-
default: !1
|
577
|
-
}
|
578
|
-
},
|
579
|
-
setup(e, {
|
580
|
-
slots: t
|
581
|
-
}) {
|
582
|
-
const n = A("space"), l = k(() => [n.block, n.element(e.direction), e.fill && "is-fill", n.element(`${e.direction}-${e.align}`)]);
|
583
|
-
function o(u) {
|
584
|
-
if (ot(u))
|
585
|
-
return u;
|
586
|
-
switch (u) {
|
587
|
-
case "mini":
|
588
|
-
return 4;
|
589
|
-
case "small":
|
590
|
-
return 8;
|
591
|
-
case "medium":
|
592
|
-
return 16;
|
593
|
-
case "large":
|
594
|
-
return 24;
|
595
|
-
default:
|
596
|
-
return 8;
|
597
|
-
}
|
598
|
-
}
|
599
|
-
const r = (u) => {
|
600
|
-
const s = {};
|
601
|
-
if (u) return s;
|
602
|
-
const d = `${o(e.size)}px`, m = `${o(e.size)}px`;
|
603
|
-
return e.direction === "horizontal" && (s.marginRight = d), e.direction === "vertical" && (s.marginBottom = m), s;
|
604
|
-
};
|
605
|
-
return () => {
|
606
|
-
var s;
|
607
|
-
const u = Q((s = t.default) == null ? void 0 : s.call(t), !0).filter((d) => d.type !== _e);
|
608
|
-
return f("div", {
|
609
|
-
class: [l.value]
|
610
|
-
}, [u.map((d, m) => {
|
611
|
-
var i;
|
612
|
-
const C = t.split && m > 0;
|
613
|
-
return f(X, {
|
614
|
-
key: `space-item-${m}`
|
615
|
-
}, [C && f("div", {
|
616
|
-
className: n.element("split"),
|
617
|
-
style: r(!1)
|
618
|
-
}, [(i = t.split) == null ? void 0 : i.call(t)]), f("div", {
|
619
|
-
className: n.element("item"),
|
620
|
-
style: r(m === u.length - 1)
|
621
|
-
}, [d])]);
|
622
|
-
})]);
|
623
|
-
};
|
624
|
-
}
|
625
|
-
});
|
626
|
-
function Se(e) {
|
627
|
-
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !w(e);
|
628
|
-
}
|
629
|
-
const $e = A("dialog"), on = (e) => {
|
630
|
-
const t = document.createElement("div"), n = () => {
|
631
|
-
M(null, t);
|
632
|
-
}, l = (i) => {
|
633
|
-
if (i === "cancel")
|
634
|
-
return e.beforeOnCancel ? e.beforeOnCancel() : !0;
|
635
|
-
if (i === "ok")
|
636
|
-
return e.beforeOnOk ? e.beforeOnOk() : !0;
|
637
|
-
}, o = (i, a) => {
|
638
|
-
i === "cancel" && e.onCancel && e.onCancel(a), i === "ok" && e.onOk && e.onOk(a);
|
639
|
-
}, r = (i) => {
|
640
|
-
if (w(i)) return i;
|
641
|
-
if (B(i)) {
|
642
|
-
const a = i();
|
643
|
-
return w(a) ? a : null;
|
644
|
-
}
|
645
|
-
return f("div", {
|
646
|
-
class: $e.element("header-title")
|
647
|
-
}, [E(" "), i, E(" ")]);
|
648
|
-
}, u = (i) => {
|
649
|
-
if (w(i)) return i;
|
650
|
-
if (B(i)) {
|
651
|
-
const a = i();
|
652
|
-
return w(a) ? a : null;
|
653
|
-
}
|
654
|
-
return f("div", {
|
655
|
-
class: $e.element("content")
|
656
|
-
}, [E(" "), e.content, E(" ")]);
|
657
|
-
}, s = () => () => f(X, null, [e.title && r(e.title)]), d = () => () => f(X, null, [e.content && u(e.content)]), m = () => {
|
658
|
-
if (w(e.footer) || B(e.footer))
|
659
|
-
return e.footer;
|
660
|
-
const i = (e == null ? void 0 : e.cancelText) || "取消", a = (e == null ? void 0 : e.okText) || "确认";
|
661
|
-
return (c) => f(He, {
|
662
|
-
size: 12
|
663
|
-
}, {
|
664
|
-
default: () => {
|
665
|
-
var p, b;
|
666
|
-
return [!e.hideCancel && f(K, {
|
667
|
-
size: "small",
|
668
|
-
onClick: c.cancel,
|
669
|
-
loading: (p = c.loadingObj) == null ? void 0 : p.cancel
|
670
|
-
}, Se(i) ? i : {
|
671
|
-
default: () => [i]
|
672
|
-
}), !e.hideOk && f(K, {
|
673
|
-
type: "primary",
|
674
|
-
size: "small",
|
675
|
-
onClick: c.ok,
|
676
|
-
loading: (b = c.loadingObj) == null ? void 0 : b.ok
|
677
|
-
}, Se(a) ? a : {
|
678
|
-
default: () => [a]
|
679
|
-
})];
|
680
|
-
}
|
498
|
+
default: () => [e.mask && u.value && r("div", {
|
499
|
+
class: l.element("mask")
|
500
|
+
}, null)]
|
501
|
+
}), r("div", {
|
502
|
+
class: [l.element("wrapper"), {
|
503
|
+
"is-center": e.center
|
504
|
+
}],
|
505
|
+
onClick: (h) => h.target === h.currentTarget && De()
|
506
|
+
}, [r(V, {
|
507
|
+
name: "x-zoom-in",
|
508
|
+
appear: !0,
|
509
|
+
onAfterEnter: Fe,
|
510
|
+
onAfterLeave: Ae
|
511
|
+
}, {
|
512
|
+
default: () => [u.value && r("div", {
|
513
|
+
class: [l.element("container"), {
|
514
|
+
"is-fullscreen": e.fullscreen
|
515
|
+
}],
|
516
|
+
style: i.value
|
517
|
+
}, [r("div", {
|
518
|
+
class: [e.messageBox ? o.element("header") : l.element("header"), e.showHeaderBottomLine && "is-bottom-line"]
|
519
|
+
}, [n.title ? n.title() : r("div", {
|
520
|
+
class: [l.element("header-title")]
|
521
|
+
}, [e.title])]), r("div", {
|
522
|
+
class: [e.messageBox ? o.element("body") : l.element("body")]
|
523
|
+
}, [n.default && n.default()]), r("div", {
|
524
|
+
class: [e.messageBox ? o.element("footer") : l.element("footer")]
|
525
|
+
}, [n.footer && n.footer({
|
526
|
+
cancel: ze,
|
527
|
+
ok: je,
|
528
|
+
"loading-obj": _
|
529
|
+
})]), e.showClose && r("span", {
|
530
|
+
class: [l.element("close-icon"), e.messageBox && o.element("close-icon")],
|
531
|
+
onClick: () => F("cancel")
|
532
|
+
}, null)])]
|
533
|
+
})])])]
|
681
534
|
});
|
682
|
-
}
|
683
|
-
|
684
|
-
|
685
|
-
|
686
|
-
|
687
|
-
|
688
|
-
|
689
|
-
|
690
|
-
|
691
|
-
|
692
|
-
|
693
|
-
|
694
|
-
|
695
|
-
|
696
|
-
|
697
|
-
|
698
|
-
|
699
|
-
|
700
|
-
|
701
|
-
|
702
|
-
|
703
|
-
|
704
|
-
|
705
|
-
|
706
|
-
|
707
|
-
},
|
708
|
-
|
709
|
-
|
710
|
-
|
711
|
-
|
712
|
-
|
713
|
-
|
714
|
-
|
715
|
-
|
716
|
-
|
717
|
-
|
718
|
-
|
719
|
-
|
720
|
-
|
721
|
-
|
722
|
-
|
723
|
-
|
724
|
-
|
725
|
-
|
726
|
-
|
727
|
-
|
728
|
-
|
729
|
-
|
730
|
-
|
731
|
-
|
732
|
-
|
733
|
-
|
734
|
-
|
735
|
-
|
736
|
-
|
737
|
-
|
738
|
-
|
739
|
-
|
740
|
-
|
741
|
-
|
742
|
-
|
743
|
-
|
744
|
-
|
745
|
-
|
746
|
-
|
747
|
-
|
748
|
-
|
749
|
-
|
750
|
-
|
751
|
-
|
752
|
-
|
753
|
-
|
754
|
-
|
755
|
-
|
756
|
-
|
757
|
-
|
758
|
-
|
759
|
-
|
760
|
-
y("svg", {
|
761
|
-
viewBox: "0 0 48 48",
|
762
|
-
fill: "none",
|
763
|
-
xmlns: "http://www.w3.org/2000/svg",
|
764
|
-
stroke: "currentColor",
|
765
|
-
"stroke-width": "4",
|
766
|
-
"stroke-linecap": "butt",
|
767
|
-
"stroke-linejoin": "miter",
|
768
|
-
filter: ""
|
769
|
-
}, [
|
770
|
-
y("path", {
|
771
|
-
"fill-rule": "evenodd",
|
772
|
-
"clip-rule": "evenodd",
|
773
|
-
d: "M24 44c11.046 0 20-8.954 20-20S35.046 4 24 4 4 12.954 4 24s8.954 20 20 20Zm4.955-27.771-4.95 4.95-4.95-4.95a1 1 0 0 0-1.414 0l-1.414 1.414a1 1 0 0 0 0 1.414l4.95 4.95-4.95 4.95a1 1 0 0 0 0 1.414l1.414 1.414a1 1 0 0 0 1.414 0l4.95-4.95 4.95 4.95a1 1 0 0 0 1.414 0l1.414-1.414a1 1 0 0 0 0-1.414l-4.95-4.95 4.95-4.95a1 1 0 0 0 0-1.414l-1.414-1.414a1 1 0 0 0-1.414 0Z",
|
774
|
-
fill: "currentColor",
|
775
|
-
stroke: "none"
|
776
|
-
})
|
777
|
-
], -1)
|
778
|
-
]), 6);
|
779
|
-
}
|
780
|
-
const me = /* @__PURE__ */ F(Lt, [["render", jt]]), It = I("check-circle-fill");
|
781
|
-
function Pt(e, t, n, l, o, r) {
|
782
|
-
return v(), S("div", {
|
783
|
-
class: g(e.cls),
|
784
|
-
style: N(e.styles)
|
785
|
-
}, t[0] || (t[0] = [
|
786
|
-
y("svg", {
|
787
|
-
viewBox: "0 0 48 48",
|
788
|
-
fill: "none",
|
789
|
-
xmlns: "http://www.w3.org/2000/svg",
|
790
|
-
stroke: "currentColor",
|
791
|
-
"stroke-width": "4",
|
792
|
-
"stroke-linecap": "butt",
|
793
|
-
"stroke-linejoin": "miter",
|
794
|
-
filter: ""
|
795
|
-
}, [
|
796
|
-
y("path", {
|
797
|
-
"fill-rule": "evenodd",
|
798
|
-
"clip-rule": "evenodd",
|
799
|
-
d: "M24 44c11.046 0 20-8.954 20-20S35.046 4 24 4 4 12.954 4 24s8.954 20 20 20Zm10.207-24.379a1 1 0 0 0 0-1.414l-1.414-1.414a1 1 0 0 0-1.414 0L22 26.172l-4.878-4.88a1 1 0 0 0-1.415 0l-1.414 1.415a1 1 0 0 0 0 1.414l7 7a1 1 0 0 0 1.414 0l11.5-11.5Z",
|
800
|
-
fill: "currentColor",
|
801
|
-
stroke: "none"
|
802
|
-
})
|
803
|
-
], -1)
|
804
|
-
]), 6);
|
805
|
-
}
|
806
|
-
const ge = /* @__PURE__ */ F(It, [["render", Pt]]), Vt = I("exclamation-circle-fill");
|
807
|
-
function Ht(e, t, n, l, o, r) {
|
808
|
-
return v(), S("div", {
|
809
|
-
class: g(e.cls),
|
810
|
-
style: N(e.styles)
|
811
|
-
}, t[0] || (t[0] = [
|
812
|
-
y("svg", {
|
813
|
-
viewBox: "0 0 48 48",
|
814
|
-
fill: "none",
|
815
|
-
xmlns: "http://www.w3.org/2000/svg",
|
816
|
-
stroke: "currentColor",
|
817
|
-
"stroke-width": "4",
|
818
|
-
"stroke-linecap": "butt",
|
819
|
-
"stroke-linejoin": "miter",
|
820
|
-
filter: ""
|
821
|
-
}, [
|
822
|
-
y("path", {
|
823
|
-
"fill-rule": "evenodd",
|
824
|
-
"clip-rule": "evenodd",
|
825
|
-
d: "M24 44c11.046 0 20-8.954 20-20S35.046 4 24 4 4 12.954 4 24s8.954 20 20 20Zm-2-11a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1h-2a1 1 0 0 0-1 1v2Zm4-18a1 1 0 0 0-1-1h-2a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1V15Z",
|
826
|
-
fill: "currentColor",
|
827
|
-
stroke: "none"
|
828
|
-
})
|
829
|
-
], -1)
|
830
|
-
]), 6);
|
831
|
-
}
|
832
|
-
const ye = /* @__PURE__ */ F(Vt, [["render", Ht]]), Wt = I("info-circle-fill");
|
833
|
-
function Zt(e, t, n, l, o, r) {
|
834
|
-
return v(), S("div", {
|
835
|
-
class: g(e.cls),
|
836
|
-
style: N(e.styles)
|
837
|
-
}, t[0] || (t[0] = [
|
838
|
-
y("svg", {
|
839
|
-
viewBox: "0 0 48 48",
|
840
|
-
fill: "none",
|
841
|
-
xmlns: "http://www.w3.org/2000/svg",
|
842
|
-
stroke: "currentColor",
|
843
|
-
"stroke-width": "4",
|
844
|
-
"stroke-linecap": "butt",
|
845
|
-
"stroke-linejoin": "miter",
|
846
|
-
filter: ""
|
847
|
-
}, [
|
848
|
-
y("path", {
|
849
|
-
"fill-rule": "evenodd",
|
850
|
-
"clip-rule": "evenodd",
|
851
|
-
d: "M24 44c11.046 0 20-8.954 20-20S35.046 4 24 4 4 12.954 4 24s8.954 20 20 20Zm2-30a1 1 0 0 0-1-1h-2a1 1 0 0 0-1 1v2a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1v-2Zm0 17h1a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1h-6a1 1 0 0 1-1-1v-2a1 1 0 0 1 1-1h1v-8a1 1 0 0 1-1-1v-2a1 1 0 0 1 1-1h3a1 1 0 0 1 1 1v11Z",
|
852
|
-
fill: "currentColor",
|
853
|
-
stroke: "none"
|
854
|
-
})
|
855
|
-
], -1)
|
856
|
-
]), 6);
|
857
|
-
}
|
858
|
-
const he = /* @__PURE__ */ F(Wt, [["render", Zt]]), Ut = I("minus-circle-fill");
|
859
|
-
function xt(e, t, n, l, o, r) {
|
860
|
-
return v(), S("div", {
|
861
|
-
class: g(e.cls),
|
862
|
-
style: N(e.styles)
|
863
|
-
}, t[0] || (t[0] = [
|
864
|
-
y("svg", {
|
865
|
-
viewBox: "0 0 48 48",
|
866
|
-
fill: "none",
|
867
|
-
xmlns: "http://www.w3.org/2000/svg",
|
868
|
-
stroke: "currentColor",
|
869
|
-
"stroke-width": "4",
|
870
|
-
"stroke-linecap": "butt",
|
871
|
-
"stroke-linejoin": "miter",
|
872
|
-
filter: ""
|
873
|
-
}, [
|
874
|
-
y("path", {
|
875
|
-
"fill-rule": "evenodd",
|
876
|
-
"clip-rule": "evenodd",
|
877
|
-
d: "M24 44c11.046 0 20-8.954 20-20S35.046 4 24 4 4 12.954 4 24s8.954 20 20 20Zm-7-22a1 1 0 0 0-1 1v2a1 1 0 0 0 1 1h14a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1H17Z",
|
878
|
-
fill: "currentColor",
|
879
|
-
stroke: "none"
|
880
|
-
})
|
881
|
-
], -1)
|
882
|
-
]), 6);
|
883
|
-
}
|
884
|
-
const ve = /* @__PURE__ */ F(Ut, [["render", xt]]);
|
885
|
-
I("animation-loading");
|
886
|
-
const Rt = z({
|
887
|
-
name: Y("Message"),
|
888
|
-
components: {
|
889
|
-
CloseCircleFill: me,
|
890
|
-
CheckCircleFill: ge,
|
891
|
-
ExclamationCircleFill: ye,
|
892
|
-
InfoCircleFill: he,
|
893
|
-
MinusCircleFill: ve
|
894
|
-
},
|
535
|
+
}
|
536
|
+
}), Te = M(p("Dialog"), Ne), ne = A("CloseCircleFill", E(r("svg", {
|
537
|
+
viewBox: "0 0 48 48",
|
538
|
+
fill: "none",
|
539
|
+
xmlns: "http://www.w3.org/2000/svg",
|
540
|
+
stroke: "currentColor",
|
541
|
+
"stroke-width": "4",
|
542
|
+
"stroke-linecap": "butt",
|
543
|
+
"stroke-linejoin": "miter",
|
544
|
+
filter: ""
|
545
|
+
}, [r("path", {
|
546
|
+
"fill-rule": "evenodd",
|
547
|
+
"clip-rule": "evenodd",
|
548
|
+
d: "M24 44c11.046 0 20-8.954 20-20S35.046 4 24 4 4 12.954 4 24s8.954 20 20 20Zm4.955-27.771-4.95 4.95-4.95-4.95a1 1 0 0 0-1.414 0l-1.414 1.414a1 1 0 0 0 0 1.414l4.95 4.95-4.95 4.95a1 1 0 0 0 0 1.414l1.414 1.414a1 1 0 0 0 1.414 0l4.95-4.95 4.95 4.95a1 1 0 0 0 1.414 0l1.414-1.414a1 1 0 0 0 0-1.414l-4.95-4.95 4.95-4.95a1 1 0 0 0 0-1.414l-1.414-1.414a1 1 0 0 0-1.414 0Z",
|
549
|
+
fill: "currentColor",
|
550
|
+
stroke: "none"
|
551
|
+
}, null)]))), le = A("CheckCircleFill", E(r("svg", {
|
552
|
+
viewBox: "0 0 48 48",
|
553
|
+
fill: "none",
|
554
|
+
xmlns: "http://www.w3.org/2000/svg",
|
555
|
+
stroke: "currentColor",
|
556
|
+
"stroke-width": "4",
|
557
|
+
"stroke-linecap": "butt",
|
558
|
+
"stroke-linejoin": "miter",
|
559
|
+
filter: ""
|
560
|
+
}, [r("path", {
|
561
|
+
"fill-rule": "evenodd",
|
562
|
+
"clip-rule": "evenodd",
|
563
|
+
d: "M24 44c11.046 0 20-8.954 20-20S35.046 4 24 4 4 12.954 4 24s8.954 20 20 20Zm10.207-24.379a1 1 0 0 0 0-1.414l-1.414-1.414a1 1 0 0 0-1.414 0L22 26.172l-4.878-4.88a1 1 0 0 0-1.415 0l-1.414 1.415a1 1 0 0 0 0 1.414l7 7a1 1 0 0 0 1.414 0l11.5-11.5Z",
|
564
|
+
fill: "currentColor",
|
565
|
+
stroke: "none"
|
566
|
+
}, null)]))), re = A("ExclamationCircleFill", E(r("svg", {
|
567
|
+
viewBox: "0 0 48 48",
|
568
|
+
fill: "none",
|
569
|
+
xmlns: "http://www.w3.org/2000/svg",
|
570
|
+
stroke: "currentColor",
|
571
|
+
"stroke-width": "4",
|
572
|
+
"stroke-linecap": "butt",
|
573
|
+
"stroke-linejoin": "miter",
|
574
|
+
filter: ""
|
575
|
+
}, [r("path", {
|
576
|
+
"fill-rule": "evenodd",
|
577
|
+
"clip-rule": "evenodd",
|
578
|
+
d: "M24 44c11.046 0 20-8.954 20-20S35.046 4 24 4 4 12.954 4 24s8.954 20 20 20Zm2-30a1 1 0 0 0-1-1h-2a1 1 0 0 0-1 1v2a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1v-2Zm0 17h1a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1h-6a1 1 0 0 1-1-1v-2a1 1 0 0 1 1-1h1v-8a1 1 0 0 1-1-1v-2a1 1 0 0 1 1-1h3a1 1 0 0 1 1 1v11Z",
|
579
|
+
fill: "currentColor",
|
580
|
+
stroke: "none"
|
581
|
+
}, null)]))), ae = A("InfoCircleFill", E(r("svg", {
|
582
|
+
viewBox: "0 0 48 48",
|
583
|
+
fill: "none",
|
584
|
+
xmlns: "http://www.w3.org/2000/svg",
|
585
|
+
stroke: "currentColor",
|
586
|
+
"stroke-width": "4",
|
587
|
+
"stroke-linecap": "butt",
|
588
|
+
"stroke-linejoin": "miter",
|
589
|
+
filter: ""
|
590
|
+
}, [r("path", {
|
591
|
+
"fill-rule": "evenodd",
|
592
|
+
"clip-rule": "evenodd",
|
593
|
+
d: "M24 44c11.046 0 20-8.954 20-20S35.046 4 24 4 4 12.954 4 24s8.954 20 20 20Zm2-30a1 1 0 0 0-1-1h-2a1 1 0 0 0-1 1v2a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1v-2Zm0 17h1a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1h-6a1 1 0 0 1-1-1v-2a1 1 0 0 1 1-1h1v-8a1 1 0 0 1-1-1v-2a1 1 0 0 1 1-1h3a1 1 0 0 1 1 1v11Z",
|
594
|
+
fill: "currentColor",
|
595
|
+
stroke: "none"
|
596
|
+
}, null)]))), oe = A("MinusCircleFill", E(r("svg", {
|
597
|
+
viewBox: "0 0 48 48",
|
598
|
+
fill: "none",
|
599
|
+
xmlns: "http://www.w3.org/2000/svg",
|
600
|
+
stroke: "currentColor",
|
601
|
+
"stroke-width": "4",
|
602
|
+
"stroke-linecap": "butt",
|
603
|
+
"stroke-linejoin": "miter",
|
604
|
+
filter: ""
|
605
|
+
}, [r("path", {
|
606
|
+
"fill-rule": "evenodd",
|
607
|
+
"clip-rule": "evenodd",
|
608
|
+
d: "M24 44c11.046 0 20-8.954 20-20S35.046 4 24 4 4 12.954 4 24s8.954 20 20 20Zm-7-22a1 1 0 0 0-1 1v2a1 1 0 0 0 1 1h14a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1H17Z",
|
609
|
+
fill: "currentColor",
|
610
|
+
stroke: "none"
|
611
|
+
}, null)]))), Ee = /* @__PURE__ */ T({
|
612
|
+
name: "Message",
|
895
613
|
props: {
|
896
614
|
id: {
|
897
615
|
type: String,
|
@@ -937,224 +655,228 @@ const Rt = z({
|
|
937
655
|
}
|
938
656
|
},
|
939
657
|
emits: ["destroy"],
|
940
|
-
setup(e
|
941
|
-
|
942
|
-
|
943
|
-
|
944
|
-
|
945
|
-
|
946
|
-
|
947
|
-
|
948
|
-
|
949
|
-
const r = () => {
|
950
|
-
o = setTimeout(() => {
|
951
|
-
l.value = !1;
|
658
|
+
setup(e, {
|
659
|
+
emit: t,
|
660
|
+
slots: n
|
661
|
+
}) {
|
662
|
+
const l = O("message"), s = C(() => [l.block, l.modifier(e.type), e.center && l.modifier("center"), e.showClose && !e.center && l.element("show-close"), e.popupClass && e.popupClass]), o = I(!1);
|
663
|
+
let d = null;
|
664
|
+
const a = () => {
|
665
|
+
d = setTimeout(() => {
|
666
|
+
o.value = !1;
|
952
667
|
}, e.duration);
|
953
668
|
};
|
954
|
-
|
955
|
-
|
956
|
-
}),
|
957
|
-
clearTimeout(
|
669
|
+
Q(() => {
|
670
|
+
o.value = !0, e.duration !== 0 && a();
|
671
|
+
}), ke(() => {
|
672
|
+
d && clearTimeout(d);
|
958
673
|
});
|
959
|
-
const {
|
674
|
+
const {
|
675
|
+
zIndex: f
|
676
|
+
} = ee("message", {
|
677
|
+
runOnMounted: !0
|
678
|
+
}), m = C(() => ({
|
960
679
|
top: `${e.offset}px`,
|
961
|
-
zIndex:
|
962
|
-
}))
|
963
|
-
|
964
|
-
|
965
|
-
|
966
|
-
|
967
|
-
|
968
|
-
|
969
|
-
|
680
|
+
zIndex: f.value
|
681
|
+
})), y = () => {
|
682
|
+
o.value = !1;
|
683
|
+
}, i = () => {
|
684
|
+
if (n.icon)
|
685
|
+
return n.icon();
|
686
|
+
switch (e.type) {
|
687
|
+
case "success":
|
688
|
+
return r(le, null, null);
|
689
|
+
case "warning":
|
690
|
+
return r(re, null, null);
|
691
|
+
case "strong":
|
692
|
+
return r(oe, null, null);
|
693
|
+
case "error":
|
694
|
+
return r(ne, null, null);
|
695
|
+
case "info":
|
696
|
+
return r(ae, null, null);
|
697
|
+
default:
|
698
|
+
return null;
|
970
699
|
}
|
971
700
|
};
|
701
|
+
return () => r(V, {
|
702
|
+
name: "x-message-slide-top",
|
703
|
+
onBeforeLeave: e.onClose,
|
704
|
+
onAfterLeave: () => t("destroy")
|
705
|
+
}, {
|
706
|
+
default: () => [o.value && r("div", {
|
707
|
+
class: s.value,
|
708
|
+
style: m.value
|
709
|
+
}, [r("span", {
|
710
|
+
class: [l.element("icon"), l.modifier(`icon-${e.type}`)]
|
711
|
+
}, [i()]), r("div", null, [n.default ? n.default() : e.useHTML ? r("span", {
|
712
|
+
innerHTML: e.message
|
713
|
+
}, null) : r("span", null, [e.message]), e.showClose && r("span", {
|
714
|
+
class: l.element("close-icon"),
|
715
|
+
onClick: y
|
716
|
+
}, null)])])]
|
717
|
+
});
|
972
718
|
}
|
973
|
-
}),
|
974
|
-
|
975
|
-
|
976
|
-
|
977
|
-
|
978
|
-
|
979
|
-
|
980
|
-
|
981
|
-
|
982
|
-
|
983
|
-
|
984
|
-
|
985
|
-
|
986
|
-
|
987
|
-
|
988
|
-
|
989
|
-
|
990
|
-
|
991
|
-
e.type === "success" ? (v(), O(u, { key: 0 })) : e.type === "warning" ? (v(), O(s, { key: 1 })) : e.type === "strong" ? (v(), O(d, { key: 2 })) : e.type === "error" ? (v(), O(m, { key: 3 })) : e.type === "info" ? (v(), O(C, { key: 4 })) : D("", !0)
|
992
|
-
])
|
993
|
-
], 2)),
|
994
|
-
j(e.$slots, "default", {}, () => [
|
995
|
-
e.useHTML ? (v(), S("span", {
|
996
|
-
key: 0,
|
997
|
-
innerHTML: e.message
|
998
|
-
}, null, 8, Xt)) : (v(), S("span", Kt, te(e.message), 1)),
|
999
|
-
e.showClose ? (v(), S("span", {
|
1000
|
-
key: 2,
|
1001
|
-
class: g([e.cn.element("close-icon")]),
|
1002
|
-
onClick: t[0] || (t[0] = (...i) => e.handleClose && e.handleClose(...i))
|
1003
|
-
}, null, 2)) : D("", !0)
|
1004
|
-
])
|
1005
|
-
], 6), [
|
1006
|
-
[x, e.visible]
|
1007
|
-
])
|
1008
|
-
]),
|
1009
|
-
_: 3
|
1010
|
-
}, 8, ["onBeforeLeave"]);
|
1011
|
-
}
|
1012
|
-
const Gt = /* @__PURE__ */ F(Rt, [["render", Yt]]), se = /* @__PURE__ */ new WeakMap(), ae = (e) => {
|
1013
|
-
(typeof e == "string" || w(e)) && (e = {
|
1014
|
-
message: e
|
1015
|
-
});
|
1016
|
-
const t = fe(e.renderTo || "body");
|
1017
|
-
se.has(t) || se.set(t, []);
|
1018
|
-
const n = se.get(t);
|
1019
|
-
let l = e.offset || 20;
|
1020
|
-
n.forEach((i) => {
|
1021
|
-
var a;
|
1022
|
-
l += ((a = i.el) == null ? void 0 : a.offsetHeight) + 20;
|
1023
|
-
});
|
1024
|
-
const o = e.onClose;
|
1025
|
-
let r = {};
|
1026
|
-
r = { ...e, onClose: () => {
|
1027
|
-
var c;
|
1028
|
-
const i = n.findIndex((p) => p === d);
|
1029
|
-
if (i < 0) return;
|
1030
|
-
const a = ((c = d.el) == null ? void 0 : c.offsetHeight) + 20;
|
1031
|
-
n.slice(i + 1).forEach((p) => {
|
1032
|
-
var $;
|
1033
|
-
const b = ($ = p.component) == null ? void 0 : $.props.offset;
|
1034
|
-
p.component.props.offset = b - a;
|
1035
|
-
}), n.splice(i, 1), o && o(d);
|
1036
|
-
}, onDestroy: () => {
|
1037
|
-
M(null, m);
|
1038
|
-
}, offset: l };
|
1039
|
-
const d = f(
|
1040
|
-
Gt,
|
1041
|
-
r,
|
1042
|
-
B(r.message) || w(r.message) ? {
|
1043
|
-
default: B(r.message) ? r.message : () => r.message
|
1044
|
-
} : null
|
1045
|
-
), m = document.createElement("div");
|
1046
|
-
return M(d, m), t.tagName === "BODY" ? d.el.style.position = "fixed" : (t.style.position = "relative", d.el.style.position = "absolute"), t.appendChild(m.firstElementChild), n.push(d), {
|
1047
|
-
close: () => {
|
1048
|
-
d.component.proxy.handleClose();
|
719
|
+
}), bt = M(p("Message"), Ee), wt = /* @__PURE__ */ T({
|
720
|
+
name: "Space",
|
721
|
+
props: {
|
722
|
+
direction: {
|
723
|
+
type: String,
|
724
|
+
default: "horizontal"
|
725
|
+
},
|
726
|
+
size: {
|
727
|
+
type: [Number, String],
|
728
|
+
default: "small"
|
729
|
+
},
|
730
|
+
align: {
|
731
|
+
type: String,
|
732
|
+
default: "center"
|
733
|
+
},
|
734
|
+
fill: {
|
735
|
+
type: Boolean,
|
736
|
+
default: !1
|
1049
737
|
}
|
1050
|
-
}
|
1051
|
-
|
1052
|
-
|
1053
|
-
|
1054
|
-
|
1055
|
-
|
1056
|
-
|
1057
|
-
|
1058
|
-
|
1059
|
-
|
1060
|
-
|
1061
|
-
|
1062
|
-
|
1063
|
-
|
1064
|
-
|
1065
|
-
|
738
|
+
},
|
739
|
+
setup(e, {
|
740
|
+
slots: t
|
741
|
+
}) {
|
742
|
+
const n = O("space"), l = C(() => [n.block, n.element(e.direction), e.fill && "is-fill", n.element(`${e.direction}-${e.align}`)]);
|
743
|
+
function s(d) {
|
744
|
+
if (Ke(d))
|
745
|
+
return d;
|
746
|
+
switch (d) {
|
747
|
+
case "mini":
|
748
|
+
return 4;
|
749
|
+
case "small":
|
750
|
+
return 8;
|
751
|
+
case "medium":
|
752
|
+
return 16;
|
753
|
+
case "large":
|
754
|
+
return 24;
|
755
|
+
default:
|
756
|
+
return 8;
|
757
|
+
}
|
758
|
+
}
|
759
|
+
const o = (d) => {
|
760
|
+
const a = {};
|
761
|
+
if (d) return a;
|
762
|
+
const f = `${s(e.size)}px`, m = `${s(e.size)}px`;
|
763
|
+
return e.direction === "horizontal" && (a.marginRight = f), e.direction === "vertical" && (a.marginBottom = m), a;
|
764
|
+
};
|
765
|
+
return () => {
|
766
|
+
var a;
|
767
|
+
const d = W((a = t.default) == null ? void 0 : a.call(t), !0).filter((f) => f.type !== Ve);
|
768
|
+
return r("div", {
|
769
|
+
class: [l.value]
|
770
|
+
}, [d.map((f, m) => {
|
771
|
+
var i;
|
772
|
+
const y = t.split && m > 0;
|
773
|
+
return r(L, {
|
774
|
+
key: `space-item-${m}`
|
775
|
+
}, [y && r("div", {
|
776
|
+
className: n.element("split"),
|
777
|
+
style: o(!1)
|
778
|
+
}, [(i = t.split) == null ? void 0 : i.call(t)]), r("div", {
|
779
|
+
className: n.element("item"),
|
780
|
+
style: o(m === d.length - 1)
|
781
|
+
}, [f])]);
|
782
|
+
})]);
|
783
|
+
};
|
784
|
+
}
|
785
|
+
}), se = M(p("Space"), wt), xt = ["info", "success", "warning", "strong", "error"];
|
786
|
+
function me(e) {
|
787
|
+
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !k(e);
|
1066
788
|
}
|
1067
|
-
const
|
789
|
+
const K = O("message-box"), q = (e) => {
|
1068
790
|
const t = document.createElement("div"), n = () => {
|
1069
|
-
|
1070
|
-
}, l = (
|
1071
|
-
if (
|
791
|
+
S(null, t);
|
792
|
+
}, l = (c) => {
|
793
|
+
if (c === "cancel")
|
1072
794
|
return e.beforeOnCancel ? e.beforeOnCancel() : !0;
|
1073
|
-
if (
|
795
|
+
if (c === "ok")
|
1074
796
|
return e.beforeOnOk ? e.beforeOnOk() : !0;
|
1075
|
-
},
|
1076
|
-
|
1077
|
-
},
|
1078
|
-
let
|
1079
|
-
switch (
|
797
|
+
}, s = (c, u) => {
|
798
|
+
c === "cancel" && e.onCancel && e.onCancel(u), c === "ok" && e.onOk && e.onOk(u);
|
799
|
+
}, o = (c) => {
|
800
|
+
let u;
|
801
|
+
switch (c) {
|
1080
802
|
case "warning":
|
1081
|
-
|
803
|
+
u = r(re, {
|
1082
804
|
size: "22px",
|
1083
805
|
color: "#f6c64b"
|
1084
806
|
}, null);
|
1085
807
|
break;
|
1086
808
|
case "strong":
|
1087
|
-
|
809
|
+
u = r(oe, {
|
1088
810
|
size: "22px",
|
1089
811
|
color: "#ff7125"
|
1090
812
|
}, null);
|
1091
813
|
break;
|
1092
814
|
case "error":
|
1093
|
-
|
815
|
+
u = r(ne, {
|
1094
816
|
size: "22px",
|
1095
817
|
color: "#e24f48"
|
1096
818
|
}, null);
|
1097
819
|
break;
|
1098
820
|
case "success":
|
1099
|
-
|
821
|
+
u = r(le, {
|
1100
822
|
size: "22px",
|
1101
823
|
color: "#68d1ab"
|
1102
824
|
}, null);
|
1103
825
|
break;
|
1104
826
|
case "info":
|
1105
|
-
|
827
|
+
u = r(ae, {
|
1106
828
|
size: "22px",
|
1107
829
|
color: "#2355f5"
|
1108
830
|
}, null);
|
1109
831
|
break;
|
1110
832
|
}
|
1111
|
-
return
|
1112
|
-
class:
|
1113
|
-
}, [
|
1114
|
-
},
|
1115
|
-
if (
|
1116
|
-
if (
|
1117
|
-
const
|
1118
|
-
return
|
833
|
+
return r("div", {
|
834
|
+
class: K.element("icon")
|
835
|
+
}, [u]);
|
836
|
+
}, d = (c) => {
|
837
|
+
if (k(c)) return c;
|
838
|
+
if (b(c)) {
|
839
|
+
const u = c();
|
840
|
+
return k(u) ? u : null;
|
1119
841
|
}
|
1120
|
-
return
|
1121
|
-
class:
|
1122
|
-
}, [
|
1123
|
-
},
|
1124
|
-
if (
|
1125
|
-
if (
|
1126
|
-
const
|
1127
|
-
return
|
842
|
+
return r("div", {
|
843
|
+
class: K.element("title")
|
844
|
+
}, [B(" "), c, B(" ")]);
|
845
|
+
}, a = (c) => {
|
846
|
+
if (k(c)) return c;
|
847
|
+
if (b(c)) {
|
848
|
+
const u = c();
|
849
|
+
return k(u) ? u : null;
|
1128
850
|
}
|
1129
|
-
return
|
1130
|
-
class:
|
1131
|
-
}, [
|
1132
|
-
},
|
1133
|
-
if (
|
851
|
+
return r("div", {
|
852
|
+
class: K.element("content")
|
853
|
+
}, [B(" "), e.content, B(" ")]);
|
854
|
+
}, f = () => () => r(L, null, [o(e.type || "success"), e.title && d(e.title)]), m = () => () => r(L, null, [e.content && a(e.content)]), y = () => {
|
855
|
+
if (k(e.footer) || b(e.footer))
|
1134
856
|
return e.footer;
|
1135
|
-
const
|
1136
|
-
return (
|
857
|
+
const c = (e == null ? void 0 : e.cancelText) || "取消", u = (e == null ? void 0 : e.okText) || "确认";
|
858
|
+
return (v) => r(se, {
|
1137
859
|
size: 12
|
1138
860
|
}, {
|
1139
861
|
default: () => {
|
1140
|
-
var
|
1141
|
-
return [!e.hideCancel &&
|
862
|
+
var g, w;
|
863
|
+
return [!e.hideCancel && r($, {
|
1142
864
|
size: "small",
|
1143
|
-
onClick:
|
1144
|
-
loading: (
|
1145
|
-
},
|
1146
|
-
default: () => [
|
1147
|
-
}), !e.hideOk &&
|
865
|
+
onClick: v.cancel,
|
866
|
+
loading: (g = v.loadingObj) == null ? void 0 : g.cancel
|
867
|
+
}, me(c) ? c : {
|
868
|
+
default: () => [c]
|
869
|
+
}), !e.hideOk && r($, {
|
1148
870
|
type: "primary",
|
1149
871
|
size: "small",
|
1150
|
-
onClick:
|
1151
|
-
loading: (
|
1152
|
-
},
|
1153
|
-
default: () => [
|
872
|
+
onClick: v.ok,
|
873
|
+
loading: (w = v.loadingObj) == null ? void 0 : w.ok
|
874
|
+
}, me(u) ? u : {
|
875
|
+
default: () => [u]
|
1154
876
|
})];
|
1155
877
|
}
|
1156
878
|
});
|
1157
|
-
}, i =
|
879
|
+
}, i = r(Te, {
|
1158
880
|
messageBox: !0,
|
1159
881
|
width: (e == null ? void 0 : e.width) ?? 358,
|
1160
882
|
height: (e == null ? void 0 : e.height) ?? "auto",
|
@@ -1165,7 +887,7 @@ const ie = A("message-box"), Ee = (e) => {
|
|
1165
887
|
mask: (e == null ? void 0 : e.mask) ?? !0,
|
1166
888
|
maskToClose: (e == null ? void 0 : e.maskToClose) ?? !0,
|
1167
889
|
popupClass: e.popupClass,
|
1168
|
-
onClose:
|
890
|
+
onClose: s,
|
1169
891
|
onBeforeCancel: l,
|
1170
892
|
"onUpdate:modelValue": () => {
|
1171
893
|
i.component.props.modelValue = !1;
|
@@ -1175,43 +897,43 @@ const ie = A("message-box"), Ee = (e) => {
|
|
1175
897
|
onOpened: () => {
|
1176
898
|
}
|
1177
899
|
}, {
|
1178
|
-
title:
|
900
|
+
title: f(),
|
1179
901
|
default: m(),
|
1180
|
-
footer:
|
902
|
+
footer: y()
|
1181
903
|
});
|
1182
|
-
|
1183
|
-
},
|
1184
|
-
|
1185
|
-
|
1186
|
-
const l = [],
|
1187
|
-
let
|
904
|
+
S(i, t);
|
905
|
+
}, Bt = () => {
|
906
|
+
xt.forEach((e) => {
|
907
|
+
q[e] = (t, n) => {
|
908
|
+
const l = [], s = [];
|
909
|
+
let o = () => !0, d = () => !0;
|
1188
910
|
return setTimeout(() => {
|
1189
|
-
|
911
|
+
q({
|
1190
912
|
title: t,
|
1191
913
|
content: n,
|
1192
914
|
type: e,
|
1193
|
-
beforeOnCancel:
|
1194
|
-
beforeOnOk:
|
915
|
+
beforeOnCancel: d,
|
916
|
+
beforeOnOk: o,
|
1195
917
|
onOk: () => {
|
1196
|
-
l.forEach((
|
918
|
+
l.forEach((a) => b(a) && a());
|
1197
919
|
},
|
1198
920
|
onCancel: () => {
|
1199
|
-
|
921
|
+
s.forEach((a) => b(a) && a());
|
1200
922
|
}
|
1201
923
|
});
|
1202
924
|
}, 0), {
|
1203
|
-
ok(...
|
1204
|
-
return
|
925
|
+
ok(...a) {
|
926
|
+
return a.length === 1 && l.push(a[0]), a.length === 2 && (o = a[0], l.push(a[1])), this;
|
1205
927
|
},
|
1206
|
-
cancel(...
|
1207
|
-
return
|
928
|
+
cancel(...a) {
|
929
|
+
return a.length === 1 && s.push(a[0]), a.length === 2 && (d = a[0], s.push(a[1])), this;
|
1208
930
|
}
|
1209
931
|
};
|
1210
932
|
};
|
1211
933
|
});
|
1212
934
|
};
|
1213
|
-
|
1214
|
-
const
|
935
|
+
Bt();
|
936
|
+
const St = M(p("MessageBox"), q), Ot = {
|
1215
937
|
position: {
|
1216
938
|
type: String,
|
1217
939
|
default: "top-right"
|
@@ -1249,145 +971,266 @@ const _t = {
|
|
1249
971
|
type: Boolean,
|
1250
972
|
default: !1
|
1251
973
|
}
|
1252
|
-
},
|
1253
|
-
name:
|
1254
|
-
props:
|
974
|
+
}, Me = /* @__PURE__ */ T({
|
975
|
+
name: p("Notification"),
|
976
|
+
props: Ot,
|
1255
977
|
emits: ["close", "destroy"],
|
1256
|
-
setup(e
|
1257
|
-
|
1258
|
-
|
978
|
+
setup(e, {
|
979
|
+
emit: t,
|
980
|
+
slots: n
|
981
|
+
}) {
|
982
|
+
const l = O("notification"), s = l.block, o = C(() => [s, l.modifier(a.value.ver)]), {
|
983
|
+
zIndex: d
|
984
|
+
} = ee("message", {
|
985
|
+
runOnMounted: !0
|
986
|
+
}), a = C(() => {
|
987
|
+
const g = e.position.split("-");
|
1259
988
|
return {
|
1260
|
-
hor:
|
1261
|
-
ver:
|
989
|
+
hor: g[1],
|
990
|
+
ver: g[0]
|
1262
991
|
};
|
1263
|
-
}),
|
1264
|
-
const
|
1265
|
-
return
|
1266
|
-
}),
|
1267
|
-
let
|
1268
|
-
const
|
1269
|
-
setTimeout(() => {
|
1270
|
-
|
992
|
+
}), f = C(() => `x-notification-slide-${a.value.hor}`), m = C(() => {
|
993
|
+
const g = {};
|
994
|
+
return g.position = e.renderToBody ? "fixed" : "absolute", g.zIndex = d.value, g[a.value.hor] = "20px", g[a.value.ver] = `${e.offset}px`, g;
|
995
|
+
}), y = I(!1);
|
996
|
+
let i = 0;
|
997
|
+
const c = () => {
|
998
|
+
i = setTimeout(() => {
|
999
|
+
y.value = !1;
|
1271
1000
|
}, e.duration);
|
1272
|
-
},
|
1273
|
-
|
1274
|
-
};
|
1275
|
-
return ue(() => {
|
1276
|
-
e.duration !== 0 && C(), d.value = !0;
|
1277
|
-
}), Ae(() => {
|
1278
|
-
clearTimeout(m);
|
1279
|
-
}), {
|
1280
|
-
ns: n,
|
1281
|
-
cn: t,
|
1282
|
-
cls: l,
|
1283
|
-
animationClsName: u,
|
1284
|
-
positionStyle: s,
|
1285
|
-
visible: d,
|
1286
|
-
positionPropMap: r,
|
1287
|
-
currentIcon: i,
|
1288
|
-
handleClose: a
|
1001
|
+
}, u = C(() => e.type === "info" ? ae : e.type === "warning" ? re : e.type === "strong" ? oe : e.type === "success" ? le : e.type === "error" ? ne : ""), v = () => {
|
1002
|
+
y.value = !1;
|
1289
1003
|
};
|
1004
|
+
return Q(() => {
|
1005
|
+
e.duration !== 0 && c(), y.value = !0;
|
1006
|
+
}), ke(() => {
|
1007
|
+
clearTimeout(i);
|
1008
|
+
}), () => r(V, {
|
1009
|
+
name: f.value,
|
1010
|
+
onBeforeLeave: () => t("close"),
|
1011
|
+
onAfterLeave: () => t("destroy")
|
1012
|
+
}, {
|
1013
|
+
default: () => {
|
1014
|
+
var g;
|
1015
|
+
return [y.value && r("div", {
|
1016
|
+
class: o.value,
|
1017
|
+
style: m.value
|
1018
|
+
}, [r("div", {
|
1019
|
+
class: [l.element("header")]
|
1020
|
+
}, [r("div", {
|
1021
|
+
class: [l.element("icon"), l.modifier(`icon-${e.type}`)]
|
1022
|
+
}, [u.value && r(u.value, null, null)]), r("div", null, [r("div", {
|
1023
|
+
class: [l.element("title")]
|
1024
|
+
}, [e.title]), r("div", {
|
1025
|
+
class: [l.element("message")]
|
1026
|
+
}, [((g = n.default) == null ? void 0 : g.call(n)) || e.message])])]), e.showClose && r("span", {
|
1027
|
+
class: [l.element("close-icon")],
|
1028
|
+
onClick: v
|
1029
|
+
}, null)])];
|
1030
|
+
}
|
1031
|
+
});
|
1290
1032
|
}
|
1291
|
-
})
|
1292
|
-
|
1293
|
-
|
1294
|
-
|
1295
|
-
|
1296
|
-
|
1297
|
-
|
1298
|
-
|
1299
|
-
|
1300
|
-
|
1301
|
-
|
1302
|
-
}, [
|
1303
|
-
y("div", {
|
1304
|
-
class: g([e.cn.element("header")])
|
1305
|
-
}, [
|
1306
|
-
y("div", {
|
1307
|
-
class: g([e.cn.element("icon"), e.cn.modifier(`icon-${e.type}`)])
|
1308
|
-
}, [
|
1309
|
-
(v(), O(et(e.currentIcon)))
|
1310
|
-
], 2),
|
1311
|
-
y("div", null, [
|
1312
|
-
y("div", {
|
1313
|
-
class: g([e.cn.element("title")])
|
1314
|
-
}, te(e.title), 3),
|
1315
|
-
y("div", {
|
1316
|
-
class: g([e.cn.element("message")])
|
1317
|
-
}, [
|
1318
|
-
j(e.$slots, "default", {}, () => [
|
1319
|
-
E(te(e.message), 1)
|
1320
|
-
])
|
1321
|
-
], 2)
|
1322
|
-
])
|
1323
|
-
], 2),
|
1324
|
-
e.showClose ? (v(), S("span", {
|
1325
|
-
key: 0,
|
1326
|
-
class: g([e.cn.element("close-icon")]),
|
1327
|
-
onClick: t[0] || (t[0] = Me((...u) => e.handleClose && e.handleClose(...u), ["self"]))
|
1328
|
-
}, null, 2)) : D("", !0)
|
1329
|
-
], 6), [
|
1330
|
-
[x, e.visible]
|
1331
|
-
])
|
1332
|
-
]),
|
1333
|
-
_: 3
|
1334
|
-
}, 8, ["name"]);
|
1033
|
+
}), pt = M(p("Notification"), Me), ge = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
1034
|
+
__proto__: null,
|
1035
|
+
XButton: $,
|
1036
|
+
XDialog: Te,
|
1037
|
+
XMessage: bt,
|
1038
|
+
XMessageBox: St,
|
1039
|
+
XNotification: pt,
|
1040
|
+
XSpace: se
|
1041
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
1042
|
+
function he(e) {
|
1043
|
+
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !k(e);
|
1335
1044
|
}
|
1336
|
-
const
|
1337
|
-
const t =
|
1338
|
-
|
1339
|
-
|
1340
|
-
|
1341
|
-
|
1045
|
+
const ye = O("dialog"), At = (e) => {
|
1046
|
+
const t = document.createElement("div"), n = () => {
|
1047
|
+
S(null, t);
|
1048
|
+
}, l = (i) => {
|
1049
|
+
if (i === "cancel")
|
1050
|
+
return e.beforeOnCancel ? e.beforeOnCancel() : !0;
|
1051
|
+
if (i === "ok")
|
1052
|
+
return e.beforeOnOk ? e.beforeOnOk() : !0;
|
1053
|
+
}, s = (i, c) => {
|
1054
|
+
i === "cancel" && e.onCancel && e.onCancel(c), i === "ok" && e.onOk && e.onOk(c);
|
1055
|
+
}, o = (i) => {
|
1056
|
+
if (k(i)) return i;
|
1057
|
+
if (b(i)) {
|
1058
|
+
const c = i();
|
1059
|
+
return k(c) ? c : null;
|
1060
|
+
}
|
1061
|
+
return r("div", {
|
1062
|
+
class: ye.element("header-title")
|
1063
|
+
}, [B(" "), i, B(" ")]);
|
1064
|
+
}, d = (i) => {
|
1065
|
+
if (k(i)) return i;
|
1066
|
+
if (b(i)) {
|
1067
|
+
const c = i();
|
1068
|
+
return k(c) ? c : null;
|
1069
|
+
}
|
1070
|
+
return r("div", {
|
1071
|
+
class: ye.element("content")
|
1072
|
+
}, [B(" "), e.content, B(" ")]);
|
1073
|
+
}, a = () => () => r(L, null, [e.title && o(e.title)]), f = () => () => r(L, null, [e.content && d(e.content)]), m = () => {
|
1074
|
+
if (k(e.footer) || b(e.footer))
|
1075
|
+
return e.footer;
|
1076
|
+
const i = (e == null ? void 0 : e.cancelText) || "取消", c = (e == null ? void 0 : e.okText) || "确认";
|
1077
|
+
return (u) => r(se, {
|
1078
|
+
size: 12
|
1079
|
+
}, {
|
1080
|
+
default: () => {
|
1081
|
+
var v, g;
|
1082
|
+
return [!e.hideCancel && r($, {
|
1083
|
+
size: "small",
|
1084
|
+
onClick: u.cancel,
|
1085
|
+
loading: (v = u.loadingObj) == null ? void 0 : v.cancel
|
1086
|
+
}, he(i) ? i : {
|
1087
|
+
default: () => [i]
|
1088
|
+
}), !e.hideOk && r($, {
|
1089
|
+
type: "primary",
|
1090
|
+
size: "small",
|
1091
|
+
onClick: u.ok,
|
1092
|
+
loading: (g = u.loadingObj) == null ? void 0 : g.ok
|
1093
|
+
}, he(c) ? c : {
|
1094
|
+
default: () => [c]
|
1095
|
+
})];
|
1096
|
+
}
|
1097
|
+
});
|
1098
|
+
}, y = r(Ne, {
|
1099
|
+
width: (e == null ? void 0 : e.width) ?? 368,
|
1100
|
+
height: (e == null ? void 0 : e.height) ?? "auto",
|
1101
|
+
modelValue: !0,
|
1102
|
+
renderTo: e == null ? void 0 : e.renderTo,
|
1103
|
+
center: e != null && e.top ? !1 : (e == null ? void 0 : e.center) ?? !0,
|
1104
|
+
top: (e == null ? void 0 : e.top) ?? 0,
|
1105
|
+
mask: (e == null ? void 0 : e.mask) ?? !0,
|
1106
|
+
maskToClose: (e == null ? void 0 : e.maskToClose) ?? !0,
|
1107
|
+
popupClass: e.popupClass,
|
1108
|
+
onClose: s,
|
1109
|
+
onBeforeCancel: l,
|
1110
|
+
"onUpdate:modelValue": () => {
|
1111
|
+
y.component.props.modelValue = !1;
|
1112
|
+
},
|
1113
|
+
// 等待动画完全结束后销毁vm
|
1114
|
+
onClosed: n,
|
1115
|
+
onOpened: () => {
|
1116
|
+
}
|
1117
|
+
}, {
|
1118
|
+
title: a(),
|
1119
|
+
default: f(),
|
1120
|
+
footer: m()
|
1121
|
+
});
|
1122
|
+
S(y, t);
|
1123
|
+
}, Nt = ["success", "warning", "error", "strong", "info"], Y = /* @__PURE__ */ new WeakMap(), G = (e) => {
|
1124
|
+
(typeof e == "string" || k(e)) && (e = {
|
1125
|
+
message: e
|
1126
|
+
});
|
1127
|
+
const t = te(e.renderTo || "body");
|
1128
|
+
Y.has(t) || Y.set(t, []);
|
1129
|
+
const n = Y.get(t);
|
1130
|
+
let l = e.offset || 20;
|
1131
|
+
n.forEach((i) => {
|
1132
|
+
var c;
|
1133
|
+
l += ((c = i.el) == null ? void 0 : c.offsetHeight) + 20;
|
1134
|
+
});
|
1135
|
+
const s = e.onClose;
|
1136
|
+
let o = {};
|
1137
|
+
o = { ...e, onClose: () => {
|
1138
|
+
var u;
|
1139
|
+
const i = n.findIndex((v) => v === f);
|
1140
|
+
if (i < 0) return;
|
1141
|
+
const c = ((u = f.el) == null ? void 0 : u.offsetHeight) + 20;
|
1142
|
+
n.slice(i + 1).forEach((v) => {
|
1143
|
+
var w;
|
1144
|
+
const g = (w = v.component) == null ? void 0 : w.props.offset;
|
1145
|
+
v.component.props.offset = g - c;
|
1146
|
+
}), n.splice(i, 1), s && s(f);
|
1147
|
+
}, onDestroy: () => {
|
1148
|
+
S(null, m);
|
1149
|
+
}, offset: l };
|
1150
|
+
const f = r(
|
1151
|
+
Ee,
|
1152
|
+
o,
|
1153
|
+
b(o.message) || k(o.message) ? {
|
1154
|
+
default: b(o.message) ? o.message : () => o.message
|
1155
|
+
} : null
|
1156
|
+
), m = document.createElement("div");
|
1157
|
+
return S(f, m), t.tagName === "BODY" ? f.el.style.position = "fixed" : (t.style.position = "relative", f.el.style.position = "absolute"), t.appendChild(m.firstElementChild), n.push(f), {
|
1158
|
+
close: () => {
|
1159
|
+
f.component.proxy.handleClose();
|
1160
|
+
}
|
1161
|
+
};
|
1162
|
+
}, Tt = () => {
|
1163
|
+
Nt.forEach((e) => {
|
1164
|
+
G[e] = (t) => xe(t) ? G({
|
1165
|
+
type: e,
|
1166
|
+
...t
|
1167
|
+
}) : G({
|
1168
|
+
message: t,
|
1169
|
+
type: e
|
1170
|
+
});
|
1171
|
+
});
|
1172
|
+
};
|
1173
|
+
Tt();
|
1174
|
+
const D = /* @__PURE__ */ new WeakMap(), Ft = (e) => {
|
1175
|
+
const t = te(e.renderTo || "body"), n = document.createElement("div");
|
1176
|
+
D.get(t) || D.set(t, {}), D.get(t)[e.position] || (D.get(t)[e.position] = []);
|
1177
|
+
const l = D.get(t)[e.position];
|
1178
|
+
let s = e.offset || 20;
|
1179
|
+
l.forEach((y) => {
|
1342
1180
|
var i;
|
1343
|
-
|
1181
|
+
s += ((i = y.el) == null ? void 0 : i.offsetHeight) + 20;
|
1344
1182
|
});
|
1345
|
-
const
|
1346
|
-
|
1347
|
-
const
|
1348
|
-
var
|
1349
|
-
const
|
1350
|
-
if (
|
1351
|
-
const i = ((
|
1352
|
-
l.slice(
|
1353
|
-
var
|
1354
|
-
const
|
1355
|
-
|
1356
|
-
}), l.splice(
|
1357
|
-
},
|
1358
|
-
|
1359
|
-
}, m =
|
1360
|
-
|
1183
|
+
const o = t.tagName === "BODY";
|
1184
|
+
o || (t.style.position = "relative", t.style.overflowX = "hidden");
|
1185
|
+
const d = e.onClose, a = () => {
|
1186
|
+
var c;
|
1187
|
+
const y = l.findIndex((u) => u === m);
|
1188
|
+
if (y < 0) return;
|
1189
|
+
const i = ((c = m.el) == null ? void 0 : c.offsetHeight) + 20;
|
1190
|
+
l.slice(y + 1).forEach((u) => {
|
1191
|
+
var g;
|
1192
|
+
const v = (g = u.component) == null ? void 0 : g.props.offset;
|
1193
|
+
u.component.props.offset = v - i;
|
1194
|
+
}), l.splice(y, 1), d && d(m);
|
1195
|
+
}, f = () => {
|
1196
|
+
S(null, n);
|
1197
|
+
}, m = r(
|
1198
|
+
Me,
|
1361
1199
|
{
|
1362
1200
|
message: e.message,
|
1363
1201
|
title: e.title,
|
1364
1202
|
type: e.type,
|
1365
|
-
offset:
|
1366
|
-
renderToBody:
|
1203
|
+
offset: s,
|
1204
|
+
renderToBody: o,
|
1367
1205
|
position: e.position,
|
1368
1206
|
duration: e.duration ?? 3e3,
|
1369
1207
|
showClose: e.showClose ?? !0,
|
1370
|
-
onClose:
|
1371
|
-
onDestroy:
|
1208
|
+
onClose: a,
|
1209
|
+
onDestroy: f
|
1372
1210
|
},
|
1373
|
-
|
1374
|
-
default:
|
1211
|
+
b(e.message) || k(e.message) ? {
|
1212
|
+
default: b(e.message) ? e.message : () => e.message
|
1375
1213
|
} : null
|
1376
1214
|
);
|
1377
|
-
|
1378
|
-
},
|
1215
|
+
S(m, n), l.push(m), t == null || t.appendChild(n.firstChild);
|
1216
|
+
}, Dt = {
|
1379
1217
|
install: function(e) {
|
1380
|
-
Object.keys(
|
1381
|
-
const n =
|
1218
|
+
Object.keys(ge).forEach((t) => {
|
1219
|
+
const n = ge[t];
|
1382
1220
|
n.install && e.use(n);
|
1383
1221
|
});
|
1384
1222
|
}
|
1385
1223
|
};
|
1386
1224
|
export {
|
1387
|
-
|
1388
|
-
|
1389
|
-
|
1390
|
-
|
1391
|
-
|
1392
|
-
|
1225
|
+
At as Dialog,
|
1226
|
+
G as Message,
|
1227
|
+
q as MessageBox,
|
1228
|
+
Ft as Notification,
|
1229
|
+
$ as XButton,
|
1230
|
+
Te as XDialog,
|
1231
|
+
bt as XMessage,
|
1232
|
+
St as XMessageBox,
|
1233
|
+
pt as XNotification,
|
1234
|
+
se as XSpace,
|
1235
|
+
Dt as default
|
1393
1236
|
};
|