@xto/feedback 1.0.3 → 1.1.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/es/index.mjs +489 -456
- package/es/style.css +1 -1
- package/lib/index.cjs +1 -1
- package/lib/style.css +1 -1
- package/package.json +2 -2
package/es/index.mjs
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useNamespace as
|
|
3
|
-
const
|
|
1
|
+
import { defineComponent as A, ref as E, computed as I, watch as le, resolveComponent as be, openBlock as x, createBlock as j, Teleport as ie, createVNode as U, Transition as F, withCtx as O, createElementBlock as $, normalizeStyle as H, normalizeClass as v, unref as b, createElementVNode as z, withModifiers as pe, renderSlot as L, createTextVNode as N, toDisplayString as V, createCommentVNode as M, withDirectives as me, vShow as he, nextTick as ee, onUnmounted as ae, onMounted as ve, reactive as we, createApp as ge, h as C } from "vue";
|
|
2
|
+
import { useNamespace as Y, useZIndex as ke, useEscape as Ce, nextMessageZIndex as Be } from "@xto/core";
|
|
3
|
+
const Ke = /* @__PURE__ */ A({
|
|
4
4
|
name: "XModal",
|
|
5
|
+
inheritAttrs: !1,
|
|
5
6
|
__name: "index",
|
|
6
7
|
props: {
|
|
7
|
-
modelValue: { type: Boolean, default:
|
|
8
|
+
modelValue: { type: Boolean, default: void 0 },
|
|
9
|
+
open: { type: Boolean, default: void 0 },
|
|
8
10
|
title: { default: "" },
|
|
9
11
|
width: { default: "50%" },
|
|
10
12
|
top: { default: "15vh" },
|
|
@@ -15,79 +17,109 @@ const Ze = /* @__PURE__ */ O({
|
|
|
15
17
|
center: { type: Boolean, default: !1 },
|
|
16
18
|
destroyOnClose: { type: Boolean, default: !1 }
|
|
17
19
|
},
|
|
18
|
-
emits: ["update:modelValue", "close", "open"],
|
|
19
|
-
setup(e, { emit:
|
|
20
|
-
const t = e,
|
|
21
|
-
get: () => t.modelValue,
|
|
22
|
-
set: (
|
|
20
|
+
emits: ["update:modelValue", "update:open", "close", "open", "ok", "cancel"],
|
|
21
|
+
setup(e, { emit: i }) {
|
|
22
|
+
const t = e, l = i, o = Y("modal"), { next: a } = ke(), f = E(a()), d = I({
|
|
23
|
+
get: () => t.modelValue !== void 0 ? t.modelValue : t.open !== void 0 ? t.open : !1,
|
|
24
|
+
set: (g) => {
|
|
25
|
+
l("update:modelValue", g), l("update:open", g);
|
|
26
|
+
}
|
|
23
27
|
}), u = E(), n = () => {
|
|
24
|
-
d.value = !1,
|
|
25
|
-
},
|
|
28
|
+
d.value = !1, l("cancel"), l("close");
|
|
29
|
+
}, p = () => {
|
|
30
|
+
l("ok");
|
|
31
|
+
}, r = () => {
|
|
26
32
|
t.closeOnClickModal && t.modal && n();
|
|
27
33
|
};
|
|
28
34
|
Ce(() => {
|
|
29
35
|
t.closeOnPressEscape && d.value && n();
|
|
30
|
-
}),
|
|
31
|
-
|
|
32
|
-
});
|
|
33
|
-
const
|
|
36
|
+
}), le(() => [t.modelValue, t.open], ([g, h]) => {
|
|
37
|
+
(g !== void 0 ? g : h) && (f.value = a(), l("open"));
|
|
38
|
+
}, { immediate: !0 });
|
|
39
|
+
const m = I(() => ({
|
|
34
40
|
paddingTop: t.top
|
|
35
|
-
})),
|
|
41
|
+
})), w = I(() => ({
|
|
36
42
|
width: typeof t.width == "number" ? `${t.width}px` : t.width,
|
|
37
43
|
zIndex: f.value
|
|
38
44
|
}));
|
|
39
|
-
return (
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
ref_key: "modalRef",
|
|
50
|
-
ref: u,
|
|
51
|
-
class: g(x(o).b()),
|
|
52
|
-
style: N(h.value),
|
|
53
|
-
onClick: B[0] || (B[0] = pe(() => {
|
|
54
|
-
}, ["stop"]))
|
|
45
|
+
return (g, h) => {
|
|
46
|
+
const y = be("x-button");
|
|
47
|
+
return x(), j(ie, { to: "body" }, [
|
|
48
|
+
U(F, { name: "x-modal-fade" }, {
|
|
49
|
+
default: O(() => [
|
|
50
|
+
d.value ? (x(), $("div", {
|
|
51
|
+
key: 0,
|
|
52
|
+
class: v(b(o).e("wrapper")),
|
|
53
|
+
style: H(m.value),
|
|
54
|
+
onClick: r
|
|
55
55
|
}, [
|
|
56
56
|
z("div", {
|
|
57
|
-
|
|
57
|
+
ref_key: "modalRef",
|
|
58
|
+
ref: u,
|
|
59
|
+
class: v(b(o).b()),
|
|
60
|
+
style: H(w.value),
|
|
61
|
+
onClick: h[0] || (h[0] = pe(() => {
|
|
62
|
+
}, ["stop"]))
|
|
58
63
|
}, [
|
|
59
|
-
z("
|
|
60
|
-
class:
|
|
64
|
+
z("div", {
|
|
65
|
+
class: v(b(o).e("header"))
|
|
61
66
|
}, [
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
67
|
+
z("span", {
|
|
68
|
+
class: v(b(o).e("title"))
|
|
69
|
+
}, [
|
|
70
|
+
L(g.$slots, "title", {}, () => [
|
|
71
|
+
N(V(e.title), 1)
|
|
72
|
+
])
|
|
73
|
+
], 2),
|
|
74
|
+
e.showClose ? (x(), $("button", {
|
|
75
|
+
key: 0,
|
|
76
|
+
class: v(b(o).e("close")),
|
|
77
|
+
onClick: n
|
|
78
|
+
}, " ✕ ", 2)) : M("", !0)
|
|
65
79
|
], 2),
|
|
66
|
-
|
|
80
|
+
z("div", {
|
|
81
|
+
class: v(b(o).e("body"))
|
|
82
|
+
}, [
|
|
83
|
+
L(g.$slots, "default")
|
|
84
|
+
], 2),
|
|
85
|
+
g.$slots.footer ? (x(), $("div", {
|
|
67
86
|
key: 0,
|
|
68
|
-
class:
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
87
|
+
class: v(b(o).e("footer"))
|
|
88
|
+
}, [
|
|
89
|
+
L(g.$slots, "footer", {
|
|
90
|
+
ok: p,
|
|
91
|
+
cancel: n
|
|
92
|
+
})
|
|
93
|
+
], 2)) : g.$slots.footer ? M("", !0) : (x(), $("div", {
|
|
94
|
+
key: 1,
|
|
95
|
+
class: v(b(o).e("footer"))
|
|
96
|
+
}, [
|
|
97
|
+
U(y, { onClick: n }, {
|
|
98
|
+
default: O(() => [...h[1] || (h[1] = [
|
|
99
|
+
N("取消", -1)
|
|
100
|
+
])]),
|
|
101
|
+
_: 1
|
|
102
|
+
}),
|
|
103
|
+
U(y, {
|
|
104
|
+
type: "primary",
|
|
105
|
+
style: { "margin-left": "8px" },
|
|
106
|
+
onClick: p
|
|
107
|
+
}, {
|
|
108
|
+
default: O(() => [...h[2] || (h[2] = [
|
|
109
|
+
N("确定", -1)
|
|
110
|
+
])]),
|
|
111
|
+
_: 1
|
|
112
|
+
})
|
|
113
|
+
], 2))
|
|
114
|
+
], 6)
|
|
115
|
+
], 6)) : M("", !0)
|
|
116
|
+
]),
|
|
117
|
+
_: 3
|
|
118
|
+
})
|
|
119
|
+
]);
|
|
120
|
+
};
|
|
89
121
|
}
|
|
90
|
-
}),
|
|
122
|
+
}), Ue = /* @__PURE__ */ A({
|
|
91
123
|
name: "XDrawer",
|
|
92
124
|
inheritAttrs: !1,
|
|
93
125
|
__name: "index",
|
|
@@ -104,79 +136,80 @@ const Ze = /* @__PURE__ */ O({
|
|
|
104
136
|
destroyOnClose: { type: Boolean, default: !1 }
|
|
105
137
|
},
|
|
106
138
|
emits: ["update:modelValue", "close", "open"],
|
|
107
|
-
setup(e, { emit:
|
|
108
|
-
const t = e,
|
|
109
|
-
|
|
139
|
+
setup(e, { emit: i }) {
|
|
140
|
+
const t = e, l = i, o = Y("drawer"), a = E(2e3), f = () => {
|
|
141
|
+
l("update:modelValue", !1), l("close");
|
|
110
142
|
}, d = () => {
|
|
111
143
|
t.closeOnClickModal && f();
|
|
112
144
|
}, u = (r) => {
|
|
113
145
|
r.key === "Escape" && t.modelValue && f();
|
|
114
146
|
};
|
|
115
|
-
|
|
116
|
-
r ? (
|
|
147
|
+
le(() => t.modelValue, (r) => {
|
|
148
|
+
r ? (a.value = 2e3 + Math.floor(Math.random() * 100), l("open"), document.addEventListener("keydown", u)) : document.removeEventListener("keydown", u);
|
|
117
149
|
});
|
|
118
150
|
const n = I(() => ({
|
|
119
|
-
zIndex:
|
|
120
|
-
})),
|
|
121
|
-
const r = t.direction ?? t.placement ?? "rtl",
|
|
151
|
+
zIndex: a.value
|
|
152
|
+
})), p = I(() => {
|
|
153
|
+
const r = t.direction ?? t.placement ?? "rtl", m = t.size ?? t.width ?? "30%", w = typeof m == "number" ? `${m}px` : m;
|
|
122
154
|
return {
|
|
123
|
-
ltr: { width:
|
|
124
|
-
rtl: { width:
|
|
125
|
-
ttb: { width: "100%", height:
|
|
126
|
-
btt: { width: "100%", height:
|
|
155
|
+
ltr: { width: w, height: "100%" },
|
|
156
|
+
rtl: { width: w, height: "100%" },
|
|
157
|
+
ttb: { width: "100%", height: w },
|
|
158
|
+
btt: { width: "100%", height: w }
|
|
127
159
|
}[r];
|
|
128
160
|
});
|
|
129
|
-
return (r,
|
|
130
|
-
|
|
131
|
-
default:
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
style: N(n.value),
|
|
161
|
+
return (r, m) => (x(), j(ie, { to: "body" }, [
|
|
162
|
+
U(F, { name: "x-drawer-fade" }, {
|
|
163
|
+
default: O(() => [
|
|
164
|
+
me(z("div", {
|
|
165
|
+
class: v(b(o).e("overlay")),
|
|
166
|
+
style: H(n.value),
|
|
136
167
|
onClick: d
|
|
137
168
|
}, [
|
|
138
169
|
z("div", {
|
|
139
|
-
class:
|
|
140
|
-
style:
|
|
141
|
-
onClick:
|
|
170
|
+
class: v([b(o).b(), b(o).m(e.direction ?? e.placement)]),
|
|
171
|
+
style: H(p.value),
|
|
172
|
+
onClick: m[0] || (m[0] = pe(() => {
|
|
142
173
|
}, ["stop"]))
|
|
143
174
|
}, [
|
|
144
|
-
e.withHeader ? (
|
|
175
|
+
e.withHeader ? (x(), $("div", {
|
|
145
176
|
key: 0,
|
|
146
|
-
class:
|
|
177
|
+
class: v(b(o).e("header"))
|
|
147
178
|
}, [
|
|
148
179
|
z("span", {
|
|
149
|
-
class:
|
|
180
|
+
class: v(b(o).e("title"))
|
|
150
181
|
}, [
|
|
151
182
|
L(r.$slots, "title", {}, () => [
|
|
152
|
-
|
|
183
|
+
N(V(e.title), 1)
|
|
153
184
|
])
|
|
154
185
|
], 2),
|
|
155
|
-
e.showClose ? (
|
|
186
|
+
e.showClose ? (x(), $("button", {
|
|
156
187
|
key: 0,
|
|
157
|
-
class:
|
|
188
|
+
class: v(b(o).e("close")),
|
|
158
189
|
onClick: f
|
|
159
190
|
}, " ✕ ", 2)) : M("", !0)
|
|
160
191
|
], 2)) : M("", !0),
|
|
161
192
|
z("div", {
|
|
162
|
-
class:
|
|
193
|
+
class: v(b(o).e("body"))
|
|
163
194
|
}, [
|
|
164
195
|
L(r.$slots, "default")
|
|
165
196
|
], 2),
|
|
166
|
-
r.$slots.footer ? (
|
|
197
|
+
r.$slots.footer ? (x(), $("div", {
|
|
167
198
|
key: 1,
|
|
168
|
-
class:
|
|
199
|
+
class: v(b(o).e("footer"))
|
|
169
200
|
}, [
|
|
170
201
|
L(r.$slots, "footer")
|
|
171
202
|
], 2)) : M("", !0)
|
|
172
203
|
], 6)
|
|
173
|
-
], 6)
|
|
204
|
+
], 6), [
|
|
205
|
+
[he, e.modelValue]
|
|
206
|
+
])
|
|
174
207
|
]),
|
|
175
208
|
_: 3
|
|
176
209
|
})
|
|
177
210
|
]));
|
|
178
211
|
}
|
|
179
|
-
}),
|
|
212
|
+
}), Ye = /* @__PURE__ */ A({
|
|
180
213
|
name: "XAlert",
|
|
181
214
|
__name: "index",
|
|
182
215
|
props: {
|
|
@@ -188,8 +221,8 @@ const Ze = /* @__PURE__ */ O({
|
|
|
188
221
|
center: { type: Boolean, default: !1 }
|
|
189
222
|
},
|
|
190
223
|
emits: ["close"],
|
|
191
|
-
setup(e, { emit:
|
|
192
|
-
const t = e,
|
|
224
|
+
setup(e, { emit: i }) {
|
|
225
|
+
const t = e, l = i, o = Y("alert"), a = E(!0), f = {
|
|
193
226
|
success: "✓",
|
|
194
227
|
warning: "⚠",
|
|
195
228
|
error: "✕",
|
|
@@ -200,41 +233,41 @@ const Ze = /* @__PURE__ */ O({
|
|
|
200
233
|
o.is("center", t.center),
|
|
201
234
|
o.is("with-description", t.description)
|
|
202
235
|
]), u = (n) => {
|
|
203
|
-
|
|
236
|
+
a.value = !1, l("close", n);
|
|
204
237
|
};
|
|
205
|
-
return (n,
|
|
206
|
-
default:
|
|
207
|
-
|
|
238
|
+
return (n, p) => (x(), j(F, { name: "x-alert-fade" }, {
|
|
239
|
+
default: O(() => [
|
|
240
|
+
a.value ? (x(), $("div", {
|
|
208
241
|
key: 0,
|
|
209
|
-
class:
|
|
242
|
+
class: v(d.value)
|
|
210
243
|
}, [
|
|
211
|
-
e.showIcon ? (
|
|
244
|
+
e.showIcon ? (x(), $("span", {
|
|
212
245
|
key: 0,
|
|
213
|
-
class:
|
|
246
|
+
class: v(b(o).e("icon"))
|
|
214
247
|
}, V(f[e.type]), 3)) : M("", !0),
|
|
215
248
|
z("div", {
|
|
216
|
-
class:
|
|
249
|
+
class: v(b(o).e("content"))
|
|
217
250
|
}, [
|
|
218
|
-
e.title || n.$slots.title ? (
|
|
251
|
+
e.title || n.$slots.title ? (x(), $("span", {
|
|
219
252
|
key: 0,
|
|
220
|
-
class:
|
|
253
|
+
class: v(b(o).e("title"))
|
|
221
254
|
}, [
|
|
222
255
|
L(n.$slots, "title", {}, () => [
|
|
223
|
-
|
|
256
|
+
N(V(e.title), 1)
|
|
224
257
|
])
|
|
225
258
|
], 2)) : M("", !0),
|
|
226
|
-
e.description || n.$slots.default ? (
|
|
259
|
+
e.description || n.$slots.default ? (x(), $("span", {
|
|
227
260
|
key: 1,
|
|
228
|
-
class:
|
|
261
|
+
class: v(b(o).e("description"))
|
|
229
262
|
}, [
|
|
230
263
|
L(n.$slots, "default", {}, () => [
|
|
231
|
-
|
|
264
|
+
N(V(e.description), 1)
|
|
232
265
|
])
|
|
233
266
|
], 2)) : M("", !0)
|
|
234
267
|
], 2),
|
|
235
|
-
e.closable ? (
|
|
268
|
+
e.closable ? (x(), $("button", {
|
|
236
269
|
key: 1,
|
|
237
|
-
class:
|
|
270
|
+
class: v(b(o).e("close")),
|
|
238
271
|
onClick: u
|
|
239
272
|
}, " ✕ ", 2)) : M("", !0)
|
|
240
273
|
], 2)) : M("", !0)
|
|
@@ -242,7 +275,7 @@ const Ze = /* @__PURE__ */ O({
|
|
|
242
275
|
_: 3
|
|
243
276
|
}));
|
|
244
277
|
}
|
|
245
|
-
}),
|
|
278
|
+
}), qe = /* @__PURE__ */ A({
|
|
246
279
|
name: "XTooltip",
|
|
247
280
|
__name: "index",
|
|
248
281
|
props: {
|
|
@@ -258,115 +291,115 @@ const Ze = /* @__PURE__ */ O({
|
|
|
258
291
|
closeDelay: { default: 0 }
|
|
259
292
|
},
|
|
260
293
|
emits: ["update:visible", "show", "hide"],
|
|
261
|
-
setup(e, { emit:
|
|
262
|
-
const t = e,
|
|
294
|
+
setup(e, { emit: i }) {
|
|
295
|
+
const t = e, l = i, o = Y("tooltip"), a = E(!1), f = E(), d = E();
|
|
263
296
|
let u, n;
|
|
264
|
-
const
|
|
297
|
+
const p = E({}), r = () => {
|
|
265
298
|
if (!f.value || !d.value) return;
|
|
266
|
-
const
|
|
267
|
-
|
|
268
|
-
const
|
|
269
|
-
let P = 0, R = 0,
|
|
299
|
+
const B = f.value.getBoundingClientRect(), W = d.value;
|
|
300
|
+
W.style.visibility = "hidden", W.style.display = "block";
|
|
301
|
+
const _ = W.offsetWidth, X = W.offsetHeight, D = t.offset, ce = window.innerWidth, de = window.innerHeight;
|
|
302
|
+
let P = 0, R = 0, q = t.placement;
|
|
270
303
|
switch (t.placement) {
|
|
271
304
|
case "top":
|
|
272
|
-
P =
|
|
305
|
+
P = B.top - X - D, R = B.left + (B.width - _) / 2;
|
|
273
306
|
break;
|
|
274
307
|
case "bottom":
|
|
275
|
-
P =
|
|
308
|
+
P = B.bottom + D, R = B.left + (B.width - _) / 2;
|
|
276
309
|
break;
|
|
277
310
|
case "left":
|
|
278
|
-
P =
|
|
311
|
+
P = B.top + (B.height - X) / 2, R = B.left - _ - D;
|
|
279
312
|
break;
|
|
280
313
|
case "right":
|
|
281
|
-
P =
|
|
314
|
+
P = B.top + (B.height - X) / 2, R = B.right + D;
|
|
282
315
|
break;
|
|
283
316
|
}
|
|
284
|
-
t.placement === "top" && P < 0 ? (
|
|
317
|
+
t.placement === "top" && P < 0 ? (q = "bottom", P = B.bottom + D) : t.placement === "bottom" && P + X > de ? (q = "top", P = B.top - X - D) : t.placement === "left" && R < 0 ? (q = "right", R = B.right + D) : t.placement === "right" && R + _ > ce && (q = "left", R = B.left - _ - D), R < 8 && (R = 8), R + _ > ce - 8 && (R = ce - _ - 8), P < 8 && (P = 8), P + X > de - 8 && (P = de - X - 8), p.value = {
|
|
285
318
|
position: "fixed",
|
|
286
319
|
top: `${P}px`,
|
|
287
320
|
left: `${R}px`,
|
|
288
321
|
visibility: "visible",
|
|
289
322
|
zIndex: "2000"
|
|
290
|
-
},
|
|
291
|
-
},
|
|
323
|
+
}, m.value = q;
|
|
324
|
+
}, m = E(t.placement), w = () => {
|
|
292
325
|
t.disabled || (clearTimeout(n), u = setTimeout(() => {
|
|
293
|
-
|
|
326
|
+
a.value = !0, l("update:visible", !0), l("show"), ee(() => {
|
|
294
327
|
r();
|
|
295
328
|
});
|
|
296
329
|
}, t.openDelay));
|
|
297
|
-
},
|
|
330
|
+
}, g = () => {
|
|
298
331
|
clearTimeout(u), n = setTimeout(() => {
|
|
299
|
-
|
|
332
|
+
a.value = !1, l("update:visible", !1), l("hide");
|
|
300
333
|
}, t.closeDelay);
|
|
301
|
-
},
|
|
302
|
-
|
|
303
|
-
},
|
|
304
|
-
t.trigger === "hover" &&
|
|
334
|
+
}, h = () => {
|
|
335
|
+
a.value ? g() : w();
|
|
336
|
+
}, y = () => {
|
|
337
|
+
t.trigger === "hover" && w();
|
|
305
338
|
}, s = () => {
|
|
306
|
-
t.trigger === "hover" &&
|
|
339
|
+
t.trigger === "hover" && g();
|
|
307
340
|
}, c = () => {
|
|
308
|
-
t.trigger === "click" &&
|
|
341
|
+
t.trigger === "click" && h();
|
|
309
342
|
}, Z = () => {
|
|
310
|
-
t.trigger === "focus" &&
|
|
343
|
+
t.trigger === "focus" && w();
|
|
311
344
|
}, S = () => {
|
|
312
|
-
t.trigger === "focus" &&
|
|
313
|
-
}, T = (
|
|
314
|
-
var
|
|
315
|
-
t.trigger === "click" && !((
|
|
316
|
-
},
|
|
317
|
-
|
|
345
|
+
t.trigger === "focus" && g();
|
|
346
|
+
}, T = (B) => {
|
|
347
|
+
var W, _;
|
|
348
|
+
t.trigger === "click" && !((W = f.value) != null && W.contains(B.target)) && !((_ = d.value) != null && _.contains(B.target)) && g();
|
|
349
|
+
}, k = () => {
|
|
350
|
+
a.value && r();
|
|
318
351
|
};
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
r(), t.trigger === "click" && document.addEventListener("click", T), window.addEventListener("scroll",
|
|
322
|
-
}) : (document.removeEventListener("click", T), window.removeEventListener("scroll",
|
|
352
|
+
le(a, (B) => {
|
|
353
|
+
B ? ee(() => {
|
|
354
|
+
r(), t.trigger === "click" && document.addEventListener("click", T), window.addEventListener("scroll", k, !0), window.addEventListener("resize", k);
|
|
355
|
+
}) : (document.removeEventListener("click", T), window.removeEventListener("scroll", k, !0), window.removeEventListener("resize", k));
|
|
323
356
|
}), ae(() => {
|
|
324
|
-
clearTimeout(u), clearTimeout(n), document.removeEventListener("click", T), window.removeEventListener("scroll",
|
|
357
|
+
clearTimeout(u), clearTimeout(n), document.removeEventListener("click", T), window.removeEventListener("scroll", k, !0), window.removeEventListener("resize", k);
|
|
325
358
|
});
|
|
326
|
-
const
|
|
359
|
+
const te = I(() => [
|
|
327
360
|
o.b(),
|
|
328
361
|
o.m(t.effect)
|
|
329
|
-
]),
|
|
362
|
+
]), oe = I(() => [
|
|
330
363
|
o.e("arrow"),
|
|
331
|
-
o.e(`arrow-${
|
|
364
|
+
o.e(`arrow-${m.value}`)
|
|
332
365
|
]);
|
|
333
|
-
return (
|
|
334
|
-
class:
|
|
366
|
+
return (B, W) => (x(), $("div", {
|
|
367
|
+
class: v(b(o).e("wrapper"))
|
|
335
368
|
}, [
|
|
336
369
|
z("div", {
|
|
337
370
|
ref_key: "triggerRef",
|
|
338
371
|
ref: f,
|
|
339
|
-
class:
|
|
340
|
-
onMouseenter:
|
|
372
|
+
class: v(b(o).e("trigger")),
|
|
373
|
+
onMouseenter: y,
|
|
341
374
|
onMouseleave: s,
|
|
342
375
|
onClick: c,
|
|
343
376
|
onFocus: Z,
|
|
344
377
|
onBlur: S
|
|
345
378
|
}, [
|
|
346
|
-
L(
|
|
379
|
+
L(B.$slots, "default")
|
|
347
380
|
], 34),
|
|
348
|
-
(
|
|
349
|
-
|
|
381
|
+
(x(), j(ie, { to: "body" }, [
|
|
382
|
+
U(F, {
|
|
350
383
|
name: `x-tooltip-${e.transition}`
|
|
351
384
|
}, {
|
|
352
|
-
default:
|
|
353
|
-
|
|
385
|
+
default: O(() => [
|
|
386
|
+
me(z("div", {
|
|
354
387
|
ref_key: "tooltipRef",
|
|
355
388
|
ref: d,
|
|
356
|
-
class:
|
|
357
|
-
style:
|
|
358
|
-
onMouseenter:
|
|
389
|
+
class: v(te.value),
|
|
390
|
+
style: H(p.value),
|
|
391
|
+
onMouseenter: y,
|
|
359
392
|
onMouseleave: s
|
|
360
393
|
}, [
|
|
361
|
-
L(
|
|
362
|
-
|
|
394
|
+
L(B.$slots, "content", {}, () => [
|
|
395
|
+
N(V(e.content), 1)
|
|
363
396
|
]),
|
|
364
|
-
e.visibleArrow ? (
|
|
397
|
+
e.visibleArrow ? (x(), $("div", {
|
|
365
398
|
key: 0,
|
|
366
|
-
class:
|
|
399
|
+
class: v(oe.value)
|
|
367
400
|
}, null, 2)) : M("", !0)
|
|
368
401
|
], 38), [
|
|
369
|
-
[
|
|
402
|
+
[he, a.value]
|
|
370
403
|
])
|
|
371
404
|
]),
|
|
372
405
|
_: 3
|
|
@@ -374,7 +407,7 @@ const Ze = /* @__PURE__ */ O({
|
|
|
374
407
|
]))
|
|
375
408
|
], 2));
|
|
376
409
|
}
|
|
377
|
-
}),
|
|
410
|
+
}), Te = { class: "x-popconfirm-wrapper" }, $e = { class: "x-popconfirm__main" }, Ee = { class: "x-popconfirm__title" }, Me = { class: "x-popconfirm__action" }, Ge = /* @__PURE__ */ A({
|
|
378
411
|
name: "XPopconfirm",
|
|
379
412
|
__name: "index",
|
|
380
413
|
props: {
|
|
@@ -395,80 +428,80 @@ const Ze = /* @__PURE__ */ O({
|
|
|
395
428
|
showArrow: { type: Boolean, default: !0 }
|
|
396
429
|
},
|
|
397
430
|
emits: ["confirm", "cancel"],
|
|
398
|
-
setup(e, { emit:
|
|
399
|
-
const t = e,
|
|
400
|
-
if (!
|
|
401
|
-
const s =
|
|
402
|
-
let T = 0,
|
|
431
|
+
setup(e, { emit: i }) {
|
|
432
|
+
const t = e, l = i, o = E(!1), a = E(null), f = E(null), d = E({}), u = () => {
|
|
433
|
+
if (!a.value || !f.value) return;
|
|
434
|
+
const s = a.value.getBoundingClientRect(), c = f.value.getBoundingClientRect(), Z = t.placement, S = t.offset;
|
|
435
|
+
let T = 0, k = 0;
|
|
403
436
|
switch (Z) {
|
|
404
437
|
case "top":
|
|
405
|
-
T = s.top - c.height - S,
|
|
438
|
+
T = s.top - c.height - S, k = s.left + (s.width - c.width) / 2;
|
|
406
439
|
break;
|
|
407
440
|
case "top-start":
|
|
408
|
-
T = s.top - c.height - S,
|
|
441
|
+
T = s.top - c.height - S, k = s.left;
|
|
409
442
|
break;
|
|
410
443
|
case "top-end":
|
|
411
|
-
T = s.top - c.height - S,
|
|
444
|
+
T = s.top - c.height - S, k = s.right - c.width;
|
|
412
445
|
break;
|
|
413
446
|
case "bottom":
|
|
414
|
-
T = s.bottom + S,
|
|
447
|
+
T = s.bottom + S, k = s.left + (s.width - c.width) / 2;
|
|
415
448
|
break;
|
|
416
449
|
case "bottom-start":
|
|
417
|
-
T = s.bottom + S,
|
|
450
|
+
T = s.bottom + S, k = s.left;
|
|
418
451
|
break;
|
|
419
452
|
case "bottom-end":
|
|
420
|
-
T = s.bottom + S,
|
|
453
|
+
T = s.bottom + S, k = s.right - c.width;
|
|
421
454
|
break;
|
|
422
455
|
case "left":
|
|
423
|
-
T = s.top + (s.height - c.height) / 2,
|
|
456
|
+
T = s.top + (s.height - c.height) / 2, k = s.left - c.width - S;
|
|
424
457
|
break;
|
|
425
458
|
case "left-start":
|
|
426
|
-
T = s.top,
|
|
459
|
+
T = s.top, k = s.left - c.width - S;
|
|
427
460
|
break;
|
|
428
461
|
case "left-end":
|
|
429
|
-
T = s.bottom - c.height,
|
|
462
|
+
T = s.bottom - c.height, k = s.left - c.width - S;
|
|
430
463
|
break;
|
|
431
464
|
case "right":
|
|
432
|
-
T = s.top + (s.height - c.height) / 2,
|
|
465
|
+
T = s.top + (s.height - c.height) / 2, k = s.right + S;
|
|
433
466
|
break;
|
|
434
467
|
case "right-start":
|
|
435
|
-
T = s.top,
|
|
468
|
+
T = s.top, k = s.right + S;
|
|
436
469
|
break;
|
|
437
470
|
case "right-end":
|
|
438
|
-
T = s.bottom - c.height,
|
|
471
|
+
T = s.bottom - c.height, k = s.right + S;
|
|
439
472
|
break;
|
|
440
473
|
default:
|
|
441
|
-
T = s.top - c.height - S,
|
|
474
|
+
T = s.top - c.height - S, k = s.left + (s.width - c.width) / 2;
|
|
442
475
|
}
|
|
443
|
-
const
|
|
444
|
-
|
|
476
|
+
const te = window.innerWidth, oe = window.innerHeight;
|
|
477
|
+
k < 0 && (k = 10), k + c.width > te && (k = te - c.width - 10), T < 0 && (T = 10), T + c.height > oe && (T = oe - c.height - 10), d.value = {
|
|
445
478
|
position: "fixed",
|
|
446
479
|
top: `${T}px`,
|
|
447
|
-
left: `${
|
|
480
|
+
left: `${k}px`,
|
|
448
481
|
zIndex: "2000"
|
|
449
482
|
};
|
|
450
483
|
}, n = (s) => {
|
|
451
484
|
var c, Z;
|
|
452
|
-
o.value && ((c =
|
|
453
|
-
},
|
|
485
|
+
o.value && ((c = a.value) != null && c.contains(s.target) || (Z = f.value) != null && Z.contains(s.target) || (o.value = !1));
|
|
486
|
+
}, p = (s) => {
|
|
454
487
|
t.disabled || (s.stopPropagation(), o.value = !o.value, o.value && setTimeout(u, 0));
|
|
455
488
|
}, r = () => {
|
|
456
|
-
o.value = !1,
|
|
457
|
-
},
|
|
458
|
-
o.value = !1,
|
|
459
|
-
},
|
|
489
|
+
o.value = !1, l("confirm");
|
|
490
|
+
}, m = () => {
|
|
491
|
+
o.value = !1, l("cancel");
|
|
492
|
+
}, w = () => {
|
|
460
493
|
o.value && u();
|
|
461
|
-
},
|
|
494
|
+
}, g = () => {
|
|
462
495
|
o.value && u();
|
|
463
496
|
};
|
|
464
|
-
|
|
465
|
-
s ? (setTimeout(u, 0), document.addEventListener("click", n), window.addEventListener("scroll",
|
|
497
|
+
le(o, (s) => {
|
|
498
|
+
s ? (setTimeout(u, 0), document.addEventListener("click", n), window.addEventListener("scroll", w, !0), window.addEventListener("resize", g)) : (document.removeEventListener("click", n), window.removeEventListener("scroll", w, !0), window.removeEventListener("resize", g));
|
|
466
499
|
}), ae(() => {
|
|
467
|
-
document.removeEventListener("click", n), window.removeEventListener("scroll",
|
|
500
|
+
document.removeEventListener("click", n), window.removeEventListener("scroll", w, !0), window.removeEventListener("resize", g);
|
|
468
501
|
});
|
|
469
|
-
const
|
|
502
|
+
const h = I(() => ({
|
|
470
503
|
width: typeof t.width == "number" ? `${t.width}px` : t.width
|
|
471
|
-
})),
|
|
504
|
+
})), y = I(() => {
|
|
472
505
|
const s = t.placement, c = {};
|
|
473
506
|
switch (s) {
|
|
474
507
|
case "top":
|
|
@@ -494,57 +527,57 @@ const Ze = /* @__PURE__ */ O({
|
|
|
494
527
|
}
|
|
495
528
|
return c;
|
|
496
529
|
});
|
|
497
|
-
return (s, c) => (
|
|
530
|
+
return (s, c) => (x(), $("span", Te, [
|
|
498
531
|
z("span", {
|
|
499
532
|
ref_key: "triggerRef",
|
|
500
|
-
ref:
|
|
533
|
+
ref: a,
|
|
501
534
|
class: "x-popconfirm-trigger",
|
|
502
|
-
onClick:
|
|
535
|
+
onClick: p
|
|
503
536
|
}, [
|
|
504
537
|
L(s.$slots, "default")
|
|
505
538
|
], 512),
|
|
506
|
-
(
|
|
507
|
-
|
|
508
|
-
default:
|
|
509
|
-
o.value ? (
|
|
539
|
+
(x(), j(ie, { to: "body" }, [
|
|
540
|
+
U(F, { name: "x-popconfirm-fade" }, {
|
|
541
|
+
default: O(() => [
|
|
542
|
+
o.value ? (x(), $("div", {
|
|
510
543
|
key: 0,
|
|
511
544
|
ref_key: "popperRef",
|
|
512
545
|
ref: f,
|
|
513
546
|
class: "x-popconfirm",
|
|
514
|
-
style:
|
|
547
|
+
style: H({ ...d.value, ...h.value }),
|
|
515
548
|
onClick: c[0] || (c[0] = pe(() => {
|
|
516
549
|
}, ["stop"]))
|
|
517
550
|
}, [
|
|
518
|
-
e.showArrow ? (
|
|
551
|
+
e.showArrow ? (x(), $("span", {
|
|
519
552
|
key: 0,
|
|
520
553
|
class: "x-popconfirm__arrow",
|
|
521
|
-
style:
|
|
554
|
+
style: H(y.value)
|
|
522
555
|
}, null, 4)) : M("", !0),
|
|
523
|
-
z("div",
|
|
524
|
-
e.hideIcon ? M("", !0) : (
|
|
556
|
+
z("div", $e, [
|
|
557
|
+
e.hideIcon ? M("", !0) : (x(), $("span", {
|
|
525
558
|
key: 0,
|
|
526
559
|
class: "x-popconfirm__icon",
|
|
527
|
-
style:
|
|
560
|
+
style: H({ color: e.iconColor })
|
|
528
561
|
}, [
|
|
529
562
|
L(s.$slots, "icon", {}, () => [
|
|
530
|
-
|
|
563
|
+
N(V(e.icon || "⚠"), 1)
|
|
531
564
|
])
|
|
532
565
|
], 4)),
|
|
533
|
-
z("div",
|
|
566
|
+
z("div", Ee, [
|
|
534
567
|
L(s.$slots, "title", {}, () => [
|
|
535
|
-
|
|
568
|
+
N(V(e.title), 1)
|
|
536
569
|
])
|
|
537
570
|
])
|
|
538
571
|
]),
|
|
539
|
-
z("div",
|
|
540
|
-
e.hideCancelButton ? M("", !0) : (
|
|
572
|
+
z("div", Me, [
|
|
573
|
+
e.hideCancelButton ? M("", !0) : (x(), $("button", {
|
|
541
574
|
key: 0,
|
|
542
575
|
class: "x-button p-button--default p-button--small",
|
|
543
|
-
onClick:
|
|
576
|
+
onClick: m
|
|
544
577
|
}, V(e.cancelButtonText), 1)),
|
|
545
|
-
e.hideConfirmButton ? M("", !0) : (
|
|
578
|
+
e.hideConfirmButton ? M("", !0) : (x(), $("button", {
|
|
546
579
|
key: 1,
|
|
547
|
-
class:
|
|
580
|
+
class: v(["x-button x-button--small", `x-button--${e.confirmButtonType}`]),
|
|
548
581
|
onClick: r
|
|
549
582
|
}, V(e.confirmButtonText), 3))
|
|
550
583
|
])
|
|
@@ -555,7 +588,7 @@ const Ze = /* @__PURE__ */ O({
|
|
|
555
588
|
]))
|
|
556
589
|
]));
|
|
557
590
|
}
|
|
558
|
-
}),
|
|
591
|
+
}), Je = /* @__PURE__ */ A({
|
|
559
592
|
name: "XBacktop",
|
|
560
593
|
__name: "index",
|
|
561
594
|
props: {
|
|
@@ -564,15 +597,15 @@ const Ze = /* @__PURE__ */ O({
|
|
|
564
597
|
bottom: { default: 40 }
|
|
565
598
|
},
|
|
566
599
|
emits: ["click"],
|
|
567
|
-
setup(e, { emit:
|
|
568
|
-
const t = e,
|
|
600
|
+
setup(e, { emit: i }) {
|
|
601
|
+
const t = e, l = i, o = Y("backtop"), a = E(!1), f = () => {
|
|
569
602
|
const n = window.scrollY || document.documentElement.scrollTop || document.body.scrollTop || 0;
|
|
570
|
-
|
|
603
|
+
a.value = n >= t.visibilityHeight;
|
|
571
604
|
}, d = (n) => {
|
|
572
605
|
window.scrollTo({
|
|
573
606
|
top: 0,
|
|
574
607
|
behavior: "smooth"
|
|
575
|
-
}),
|
|
608
|
+
}), l("click", n);
|
|
576
609
|
}, u = I(() => ({
|
|
577
610
|
right: `${t.right}px`,
|
|
578
611
|
bottom: `${t.bottom}px`
|
|
@@ -581,26 +614,26 @@ const Ze = /* @__PURE__ */ O({
|
|
|
581
614
|
window.addEventListener("scroll", f, { passive: !0, capture: !0 }), setTimeout(f, 100);
|
|
582
615
|
}), ae(() => {
|
|
583
616
|
window.removeEventListener("scroll", f, !0);
|
|
584
|
-
}), (n,
|
|
585
|
-
default:
|
|
586
|
-
|
|
587
|
-
class:
|
|
588
|
-
style:
|
|
617
|
+
}), (n, p) => (x(), j(F, { name: "x-fade" }, {
|
|
618
|
+
default: O(() => [
|
|
619
|
+
me(z("div", {
|
|
620
|
+
class: v(b(o).b()),
|
|
621
|
+
style: H(u.value),
|
|
589
622
|
onClick: d
|
|
590
623
|
}, [
|
|
591
624
|
L(n.$slots, "default", {}, () => [
|
|
592
625
|
z("span", {
|
|
593
|
-
class:
|
|
626
|
+
class: v(b(o).e("icon"))
|
|
594
627
|
}, "↑", 2)
|
|
595
628
|
])
|
|
596
629
|
], 6), [
|
|
597
|
-
[
|
|
630
|
+
[he, a.value]
|
|
598
631
|
])
|
|
599
632
|
]),
|
|
600
633
|
_: 3
|
|
601
634
|
}));
|
|
602
635
|
}
|
|
603
|
-
}),
|
|
636
|
+
}), ze = /* @__PURE__ */ A({
|
|
604
637
|
name: "XMessage",
|
|
605
638
|
__name: "index",
|
|
606
639
|
props: {
|
|
@@ -614,119 +647,119 @@ const Ze = /* @__PURE__ */ O({
|
|
|
614
647
|
onClose: {}
|
|
615
648
|
},
|
|
616
649
|
emits: ["close", "destroy"],
|
|
617
|
-
setup(e, { expose:
|
|
618
|
-
const
|
|
650
|
+
setup(e, { expose: i, emit: t }) {
|
|
651
|
+
const l = e, o = t, a = Y("message"), f = E(!1), d = E(Be()), u = {
|
|
619
652
|
success: "✓",
|
|
620
653
|
warning: "⚠",
|
|
621
654
|
error: "✕",
|
|
622
655
|
info: "ℹ"
|
|
623
656
|
}, n = I(() => [
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
]),
|
|
630
|
-
top: `${
|
|
657
|
+
a.b(),
|
|
658
|
+
a.m(l.type),
|
|
659
|
+
a.is("center", l.center),
|
|
660
|
+
a.is("closable", l.showClose),
|
|
661
|
+
l.customClass
|
|
662
|
+
]), p = I(() => ({
|
|
663
|
+
top: `${l.offset}px`,
|
|
631
664
|
zIndex: d.value
|
|
632
665
|
}));
|
|
633
666
|
let r = null;
|
|
634
|
-
const
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
},
|
|
638
|
-
}, p = () => {
|
|
639
|
-
r && (clearTimeout(r), r = null);
|
|
640
|
-
}, B = () => {
|
|
641
|
-
var C;
|
|
642
|
-
f.value = !1, (C = a.onClose) == null || C.call(a), o("close");
|
|
667
|
+
const m = () => {
|
|
668
|
+
l.duration > 0 && (r = setTimeout(() => {
|
|
669
|
+
g();
|
|
670
|
+
}, l.duration));
|
|
643
671
|
}, w = () => {
|
|
672
|
+
r && (clearTimeout(r), r = null);
|
|
673
|
+
}, g = () => {
|
|
674
|
+
var y;
|
|
675
|
+
f.value = !1, (y = l.onClose) == null || y.call(l), o("close");
|
|
676
|
+
}, h = () => {
|
|
644
677
|
o("destroy");
|
|
645
678
|
};
|
|
646
679
|
return ve(() => {
|
|
647
|
-
|
|
680
|
+
m(), f.value = !0;
|
|
648
681
|
}), ae(() => {
|
|
649
|
-
|
|
650
|
-
}),
|
|
651
|
-
close:
|
|
652
|
-
}), (
|
|
682
|
+
w();
|
|
683
|
+
}), i({
|
|
684
|
+
close: g
|
|
685
|
+
}), (y, s) => (x(), j(F, {
|
|
653
686
|
name: "x-message-fade",
|
|
654
|
-
onAfterLeave:
|
|
687
|
+
onAfterLeave: h
|
|
655
688
|
}, {
|
|
656
|
-
default:
|
|
657
|
-
f.value ? (
|
|
689
|
+
default: O(() => [
|
|
690
|
+
f.value ? (x(), $("div", {
|
|
658
691
|
key: 0,
|
|
659
|
-
class:
|
|
660
|
-
style:
|
|
661
|
-
onMouseenter:
|
|
662
|
-
onMouseleave:
|
|
692
|
+
class: v(n.value),
|
|
693
|
+
style: H(p.value),
|
|
694
|
+
onMouseenter: w,
|
|
695
|
+
onMouseleave: m
|
|
663
696
|
}, [
|
|
664
697
|
z("span", {
|
|
665
|
-
class:
|
|
698
|
+
class: v(b(a).e("icon"))
|
|
666
699
|
}, V(u[e.type]), 3),
|
|
667
700
|
z("span", {
|
|
668
|
-
class:
|
|
701
|
+
class: v(b(a).e("content"))
|
|
669
702
|
}, [
|
|
670
|
-
L(
|
|
671
|
-
|
|
703
|
+
L(y.$slots, "default", {}, () => [
|
|
704
|
+
N(V(e.message), 1)
|
|
672
705
|
])
|
|
673
706
|
], 2),
|
|
674
|
-
e.showClose ? (
|
|
707
|
+
e.showClose ? (x(), $("button", {
|
|
675
708
|
key: 0,
|
|
676
|
-
class:
|
|
677
|
-
onClick:
|
|
709
|
+
class: v(b(a).e("close")),
|
|
710
|
+
onClick: g
|
|
678
711
|
}, " ✕ ", 2)) : M("", !0)
|
|
679
712
|
], 38)) : M("", !0)
|
|
680
713
|
]),
|
|
681
714
|
_: 3
|
|
682
715
|
}));
|
|
683
716
|
}
|
|
684
|
-
}),
|
|
685
|
-
let
|
|
686
|
-
const
|
|
687
|
-
|
|
717
|
+
}), G = [];
|
|
718
|
+
let Se = 1;
|
|
719
|
+
const Ie = () => {
|
|
720
|
+
G.slice().forEach((e) => e.close());
|
|
688
721
|
};
|
|
689
722
|
function xe(e) {
|
|
690
|
-
const
|
|
723
|
+
const i = Se++, t = document.createElement("div");
|
|
691
724
|
document.body.appendChild(t);
|
|
692
|
-
const
|
|
725
|
+
const l = {
|
|
693
726
|
success: { bg: "#f0f9eb", border: "#67c23a", icon: "✓" },
|
|
694
727
|
warning: { bg: "#fdf6ec", border: "#e6a23c", icon: "⚠" },
|
|
695
728
|
error: { bg: "#fef0f0", border: "#f56c6c", icon: "✕" },
|
|
696
729
|
info: { bg: "#f4f4f5", border: "#909399", icon: "ℹ" }
|
|
697
|
-
}, o = e.type || "info",
|
|
730
|
+
}, o = e.type || "info", a = l[o] || l.info, f = we({
|
|
698
731
|
visible: !1,
|
|
699
732
|
offset: e.offset ?? 20
|
|
700
733
|
});
|
|
701
734
|
let d = e.offset ?? 20;
|
|
702
|
-
|
|
703
|
-
const
|
|
704
|
-
|
|
735
|
+
G.forEach((h) => {
|
|
736
|
+
const y = h.container.firstElementChild;
|
|
737
|
+
y && y.offsetHeight && (d += y.offsetHeight + 16);
|
|
705
738
|
}), f.offset = d;
|
|
706
739
|
let u = null, n = !1;
|
|
707
|
-
const
|
|
740
|
+
const p = () => {
|
|
708
741
|
n || (f.visible = !1, setTimeout(() => {
|
|
709
742
|
if (n) return;
|
|
710
743
|
n = !0;
|
|
711
|
-
const
|
|
712
|
-
|
|
744
|
+
const h = G.findIndex((y) => y.id === i);
|
|
745
|
+
h !== -1 && G.splice(h, 1);
|
|
713
746
|
try {
|
|
714
|
-
|
|
747
|
+
w.unmount();
|
|
715
748
|
} catch {
|
|
716
749
|
}
|
|
717
750
|
t.parentNode && t.parentNode.removeChild(t);
|
|
718
751
|
}, 300));
|
|
719
752
|
}, r = () => {
|
|
720
|
-
const
|
|
721
|
-
|
|
722
|
-
},
|
|
753
|
+
const h = e.duration ?? 3e3;
|
|
754
|
+
h > 0 && (u = setTimeout(p, h));
|
|
755
|
+
}, m = () => {
|
|
723
756
|
u && (clearTimeout(u), u = null);
|
|
724
|
-
},
|
|
757
|
+
}, w = ge({
|
|
725
758
|
render() {
|
|
726
759
|
if (!f.visible) return null;
|
|
727
|
-
const
|
|
760
|
+
const h = [
|
|
728
761
|
// Icon
|
|
729
|
-
|
|
762
|
+
C("span", {
|
|
730
763
|
style: {
|
|
731
764
|
display: "inline-flex",
|
|
732
765
|
alignItems: "center",
|
|
@@ -735,11 +768,11 @@ function xe(e) {
|
|
|
735
768
|
height: "20px",
|
|
736
769
|
marginRight: "10px",
|
|
737
770
|
fontSize: "16px",
|
|
738
|
-
color:
|
|
771
|
+
color: a.border
|
|
739
772
|
}
|
|
740
|
-
},
|
|
773
|
+
}, a.icon),
|
|
741
774
|
// Content
|
|
742
|
-
|
|
775
|
+
C("span", {
|
|
743
776
|
style: {
|
|
744
777
|
flex: "1",
|
|
745
778
|
fontSize: "14px",
|
|
@@ -748,8 +781,8 @@ function xe(e) {
|
|
|
748
781
|
}
|
|
749
782
|
}, e.message || "")
|
|
750
783
|
];
|
|
751
|
-
return e.showClose &&
|
|
752
|
-
|
|
784
|
+
return e.showClose && h.push(
|
|
785
|
+
C("button", {
|
|
753
786
|
style: {
|
|
754
787
|
position: "absolute",
|
|
755
788
|
top: "50%",
|
|
@@ -762,11 +795,11 @@ function xe(e) {
|
|
|
762
795
|
color: "#909399",
|
|
763
796
|
padding: "0"
|
|
764
797
|
},
|
|
765
|
-
onClick: (
|
|
766
|
-
|
|
798
|
+
onClick: (y) => {
|
|
799
|
+
y.stopPropagation(), p();
|
|
767
800
|
}
|
|
768
801
|
}, "✕")
|
|
769
|
-
),
|
|
802
|
+
), C("div", {
|
|
770
803
|
class: ["x-message", `x-message--${o}`, e.center ? "is-center" : "", e.showClose ? "is-closable" : ""],
|
|
771
804
|
style: {
|
|
772
805
|
position: "fixed",
|
|
@@ -780,139 +813,139 @@ function xe(e) {
|
|
|
780
813
|
boxShadow: "0 2px 12px rgba(0,0,0,0.1)",
|
|
781
814
|
minWidth: "280px",
|
|
782
815
|
maxWidth: "480px",
|
|
783
|
-
backgroundColor:
|
|
784
|
-
border: `1px solid ${
|
|
785
|
-
zIndex: 2e3 +
|
|
816
|
+
backgroundColor: a.bg,
|
|
817
|
+
border: `1px solid ${a.border}`,
|
|
818
|
+
zIndex: 2e3 + i,
|
|
786
819
|
transition: "opacity 0.3s, transform 0.3s"
|
|
787
820
|
},
|
|
788
|
-
onMouseenter:
|
|
821
|
+
onMouseenter: m,
|
|
789
822
|
onMouseleave: r
|
|
790
|
-
},
|
|
823
|
+
}, h);
|
|
791
824
|
}
|
|
792
825
|
});
|
|
793
|
-
|
|
826
|
+
w.mount(t), ee(() => {
|
|
794
827
|
f.visible = !0, r();
|
|
795
828
|
});
|
|
796
|
-
const
|
|
797
|
-
return
|
|
829
|
+
const g = { id: i, app: w, container: t, close: p };
|
|
830
|
+
return G.push(g), { close: p };
|
|
798
831
|
}
|
|
799
|
-
function
|
|
832
|
+
function Le(e) {
|
|
800
833
|
return xe(typeof e == "string" ? { message: e } : e);
|
|
801
834
|
}
|
|
802
|
-
const
|
|
803
|
-
info:
|
|
804
|
-
success:
|
|
805
|
-
warning:
|
|
806
|
-
error:
|
|
807
|
-
closeAll:
|
|
808
|
-
}),
|
|
835
|
+
const ne = (e) => (i) => xe({ ...typeof i == "string" ? { message: i } : i, type: e }), ue = Object.assign(Le, {
|
|
836
|
+
info: ne("info"),
|
|
837
|
+
success: ne("success"),
|
|
838
|
+
warning: ne("warning"),
|
|
839
|
+
error: ne("error"),
|
|
840
|
+
closeAll: Ie
|
|
841
|
+
}), Qe = ue, et = ze, tt = {
|
|
809
842
|
install(e) {
|
|
810
843
|
e.config.globalProperties.$message = ue, e.provide("message", ue);
|
|
811
844
|
}
|
|
812
|
-
},
|
|
813
|
-
|
|
814
|
-
},
|
|
845
|
+
}, J = [], Pe = () => {
|
|
846
|
+
J.slice().forEach((e) => e.close());
|
|
847
|
+
}, Re = {
|
|
815
848
|
success: { icon: "✓", color: "#67c23a" },
|
|
816
849
|
warning: { icon: "⚠", color: "#e6a23c" },
|
|
817
850
|
error: { icon: "✕", color: "#f56c6c" },
|
|
818
851
|
info: { icon: "ℹ", color: "#909399" }
|
|
819
852
|
};
|
|
820
853
|
function re(e) {
|
|
821
|
-
return new Promise((
|
|
854
|
+
return new Promise((i) => {
|
|
822
855
|
const t = document.createElement("div");
|
|
823
856
|
document.body.appendChild(t);
|
|
824
|
-
let
|
|
825
|
-
const o =
|
|
857
|
+
let l = !1;
|
|
858
|
+
const o = A({
|
|
826
859
|
name: "TMessageBox",
|
|
827
860
|
setup() {
|
|
828
|
-
const d = E(!1), u = E(e.inputValue ?? ""), n = E(""),
|
|
829
|
-
|
|
830
|
-
const s =
|
|
831
|
-
s !== -1 &&
|
|
861
|
+
const d = E(!1), u = E(e.inputValue ?? ""), n = E(""), p = 2e3 + J.length + 1, r = (y) => {
|
|
862
|
+
l || (l = !0, d.value = !1, setTimeout(() => {
|
|
863
|
+
const s = J.findIndex((c) => c.container === t);
|
|
864
|
+
s !== -1 && J.splice(s, 1);
|
|
832
865
|
try {
|
|
833
|
-
|
|
866
|
+
a.unmount();
|
|
834
867
|
} catch {
|
|
835
868
|
}
|
|
836
|
-
t.parentNode && t.parentNode.removeChild(t),
|
|
837
|
-
action:
|
|
838
|
-
value:
|
|
869
|
+
t.parentNode && t.parentNode.removeChild(t), i({
|
|
870
|
+
action: y,
|
|
871
|
+
value: y === "confirm" ? u.value : void 0
|
|
839
872
|
});
|
|
840
873
|
}, 300));
|
|
841
|
-
},
|
|
874
|
+
}, m = () => {
|
|
842
875
|
if (e.showInput && e.inputPattern && !e.inputPattern.test(u.value)) {
|
|
843
876
|
n.value = e.inputErrorMessage || "输入格式不正确";
|
|
844
877
|
return;
|
|
845
878
|
}
|
|
846
879
|
n.value = "", r("confirm");
|
|
847
|
-
},
|
|
880
|
+
}, w = () => {
|
|
848
881
|
r("cancel");
|
|
849
|
-
},
|
|
882
|
+
}, g = () => {
|
|
850
883
|
r("close");
|
|
851
|
-
},
|
|
852
|
-
e.closeOnClickModal !== !1 &&
|
|
884
|
+
}, h = () => {
|
|
885
|
+
e.closeOnClickModal !== !1 && g();
|
|
853
886
|
};
|
|
854
|
-
return
|
|
887
|
+
return ee(() => {
|
|
855
888
|
d.value = !0;
|
|
856
889
|
}), {
|
|
857
890
|
visible: d,
|
|
858
891
|
inputValue: u,
|
|
859
892
|
inputError: n,
|
|
860
|
-
zIndex:
|
|
861
|
-
handleConfirm:
|
|
862
|
-
handleCancel:
|
|
863
|
-
handleClose:
|
|
864
|
-
handleMaskClick:
|
|
893
|
+
zIndex: p,
|
|
894
|
+
handleConfirm: m,
|
|
895
|
+
handleCancel: w,
|
|
896
|
+
handleClose: g,
|
|
897
|
+
handleMaskClick: h
|
|
865
898
|
};
|
|
866
899
|
},
|
|
867
900
|
render() {
|
|
868
901
|
if (!this.visible) return null;
|
|
869
|
-
const d = e.type, u = d ?
|
|
902
|
+
const d = e.type, u = d ? Re[d] : null, n = [];
|
|
870
903
|
u && n.push(
|
|
871
|
-
|
|
904
|
+
C("span", {
|
|
872
905
|
class: "x-message-box__icon",
|
|
873
906
|
style: { color: u.color, marginRight: "10px", fontSize: "20px" }
|
|
874
907
|
}, u.icon)
|
|
875
908
|
), n.push(
|
|
876
|
-
|
|
909
|
+
C("span", { class: "x-message-box__title" }, e.title || "提示")
|
|
877
910
|
), e.showClose !== !1 && n.push(
|
|
878
|
-
|
|
911
|
+
C("button", {
|
|
879
912
|
class: "x-message-box__close",
|
|
880
913
|
onClick: this.handleClose
|
|
881
914
|
}, "✕")
|
|
882
915
|
);
|
|
883
|
-
const
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
), e.showInput &&
|
|
887
|
-
|
|
888
|
-
|
|
916
|
+
const p = [];
|
|
917
|
+
p.push(
|
|
918
|
+
C("div", { class: "x-message-box__content" }, e.message || "")
|
|
919
|
+
), e.showInput && p.push(
|
|
920
|
+
C("div", { class: "x-message-box__input", style: { marginTop: "12px" } }, [
|
|
921
|
+
C("input", {
|
|
889
922
|
class: ["x-message-box__input-inner", this.inputError ? "is-error" : ""].filter(Boolean),
|
|
890
923
|
type: e.inputType || "text",
|
|
891
924
|
placeholder: e.inputPlaceholder || "请输入",
|
|
892
925
|
value: this.inputValue,
|
|
893
|
-
onInput: (
|
|
894
|
-
this.inputValue =
|
|
926
|
+
onInput: (m) => {
|
|
927
|
+
this.inputValue = m.target.value, this.inputError = "";
|
|
895
928
|
},
|
|
896
|
-
onKeyup: (
|
|
897
|
-
|
|
929
|
+
onKeyup: (m) => {
|
|
930
|
+
m.key === "Enter" && this.handleConfirm();
|
|
898
931
|
}
|
|
899
932
|
}),
|
|
900
|
-
this.inputError ?
|
|
933
|
+
this.inputError ? C("div", { class: "x-message-box__error", style: { color: "#f56c6c", fontSize: "12px", marginTop: "4px" } }, this.inputError) : null
|
|
901
934
|
])
|
|
902
935
|
);
|
|
903
936
|
const r = [];
|
|
904
937
|
return e.showCancelButton && r.push(
|
|
905
|
-
|
|
938
|
+
C("button", {
|
|
906
939
|
class: "x-button p-button--default",
|
|
907
940
|
onClick: this.handleCancel
|
|
908
941
|
}, e.cancelButtonText || "取消")
|
|
909
942
|
), e.showConfirmButton !== !1 && r.push(
|
|
910
|
-
|
|
943
|
+
C("button", {
|
|
911
944
|
class: "x-button p-button--primary",
|
|
912
945
|
onClick: this.handleConfirm,
|
|
913
946
|
style: { marginLeft: "10px" }
|
|
914
947
|
}, e.confirmButtonText || "确定")
|
|
915
|
-
),
|
|
948
|
+
), C("div", {
|
|
916
949
|
class: ["x-message-box-wrapper", e.center ? "is-center" : ""],
|
|
917
950
|
style: {
|
|
918
951
|
position: "fixed",
|
|
@@ -928,7 +961,7 @@ function re(e) {
|
|
|
928
961
|
},
|
|
929
962
|
onClick: this.handleMaskClick
|
|
930
963
|
}, [
|
|
931
|
-
|
|
964
|
+
C("div", {
|
|
932
965
|
class: ["x-message-box", e.customClass],
|
|
933
966
|
style: {
|
|
934
967
|
backgroundColor: "#fff",
|
|
@@ -937,10 +970,10 @@ function re(e) {
|
|
|
937
970
|
minWidth: "300px",
|
|
938
971
|
maxWidth: "500px"
|
|
939
972
|
},
|
|
940
|
-
onClick: (
|
|
973
|
+
onClick: (m) => m.stopPropagation()
|
|
941
974
|
}, [
|
|
942
975
|
// Header
|
|
943
|
-
|
|
976
|
+
C("div", {
|
|
944
977
|
class: "x-message-box__header",
|
|
945
978
|
style: {
|
|
946
979
|
display: "flex",
|
|
@@ -951,16 +984,16 @@ function re(e) {
|
|
|
951
984
|
}
|
|
952
985
|
}, n),
|
|
953
986
|
// Body
|
|
954
|
-
|
|
987
|
+
C("div", {
|
|
955
988
|
class: "x-message-box__body",
|
|
956
989
|
style: {
|
|
957
990
|
padding: "20px",
|
|
958
991
|
fontSize: "14px",
|
|
959
992
|
color: "#606266"
|
|
960
993
|
}
|
|
961
|
-
},
|
|
994
|
+
}, p),
|
|
962
995
|
// Footer
|
|
963
|
-
|
|
996
|
+
C("div", {
|
|
964
997
|
class: "x-message-box__footer",
|
|
965
998
|
style: {
|
|
966
999
|
padding: "10px 20px 16px",
|
|
@@ -970,42 +1003,42 @@ function re(e) {
|
|
|
970
1003
|
])
|
|
971
1004
|
]);
|
|
972
1005
|
}
|
|
973
|
-
}),
|
|
974
|
-
|
|
1006
|
+
}), a = ge(o);
|
|
1007
|
+
a.mount(t);
|
|
975
1008
|
const f = {
|
|
976
|
-
app:
|
|
1009
|
+
app: a,
|
|
977
1010
|
container: t,
|
|
978
1011
|
close: () => {
|
|
979
1012
|
var u;
|
|
980
|
-
const d = (u =
|
|
1013
|
+
const d = (u = a._instance) == null ? void 0 : u.proxy;
|
|
981
1014
|
d != null && d.handleClose && d.handleClose();
|
|
982
1015
|
}
|
|
983
1016
|
};
|
|
984
|
-
|
|
1017
|
+
J.push(f);
|
|
985
1018
|
});
|
|
986
1019
|
}
|
|
987
|
-
async function
|
|
1020
|
+
async function Ve(e, i, t) {
|
|
988
1021
|
return re({
|
|
989
1022
|
message: e,
|
|
990
|
-
title:
|
|
1023
|
+
title: i,
|
|
991
1024
|
...t,
|
|
992
1025
|
showConfirmButton: !0,
|
|
993
1026
|
showCancelButton: !1
|
|
994
1027
|
});
|
|
995
1028
|
}
|
|
996
|
-
async function
|
|
1029
|
+
async function _e(e, i, t) {
|
|
997
1030
|
return re({
|
|
998
1031
|
message: e,
|
|
999
|
-
title:
|
|
1032
|
+
title: i,
|
|
1000
1033
|
...t,
|
|
1001
1034
|
showConfirmButton: !0,
|
|
1002
1035
|
showCancelButton: !0
|
|
1003
1036
|
});
|
|
1004
1037
|
}
|
|
1005
|
-
async function He(e,
|
|
1038
|
+
async function He(e, i, t) {
|
|
1006
1039
|
return re({
|
|
1007
1040
|
message: e,
|
|
1008
|
-
title:
|
|
1041
|
+
title: i,
|
|
1009
1042
|
...t,
|
|
1010
1043
|
showInput: !0,
|
|
1011
1044
|
showConfirmButton: !0,
|
|
@@ -1016,33 +1049,33 @@ function Ne(e) {
|
|
|
1016
1049
|
return re(e);
|
|
1017
1050
|
}
|
|
1018
1051
|
const K = Object.assign(Ne, {
|
|
1019
|
-
alert:
|
|
1020
|
-
confirm:
|
|
1052
|
+
alert: Ve,
|
|
1053
|
+
confirm: _e,
|
|
1021
1054
|
prompt: He,
|
|
1022
|
-
closeAll:
|
|
1023
|
-
}),
|
|
1055
|
+
closeAll: Pe
|
|
1056
|
+
}), ot = K, nt = {
|
|
1024
1057
|
install(e) {
|
|
1025
1058
|
e.config.globalProperties.$msgbox = K, e.config.globalProperties.$alert = K.alert, e.config.globalProperties.$confirm = K.confirm, e.config.globalProperties.$prompt = K.prompt, e.provide("messageBox", K);
|
|
1026
1059
|
}
|
|
1027
|
-
},
|
|
1060
|
+
}, Q = [];
|
|
1028
1061
|
let Oe = 1;
|
|
1029
|
-
const
|
|
1030
|
-
|
|
1031
|
-
},
|
|
1062
|
+
const Ae = () => {
|
|
1063
|
+
Q.slice().forEach((e) => e.close());
|
|
1064
|
+
}, We = {
|
|
1032
1065
|
success: { icon: "✓", color: "#67c23a" },
|
|
1033
1066
|
warning: { icon: "⚠", color: "#e6a23c" },
|
|
1034
1067
|
error: { icon: "✕", color: "#f56c6c" },
|
|
1035
1068
|
info: { icon: "ℹ", color: "#909399" }
|
|
1036
|
-
},
|
|
1037
|
-
const t =
|
|
1038
|
-
let
|
|
1069
|
+
}, De = (e, i) => {
|
|
1070
|
+
const t = Q.filter((o) => o.position === e);
|
|
1071
|
+
let l = 16;
|
|
1039
1072
|
for (const o of t)
|
|
1040
|
-
if (o.id <
|
|
1041
|
-
const
|
|
1042
|
-
|
|
1073
|
+
if (o.id < i) {
|
|
1074
|
+
const a = o.container.firstElementChild;
|
|
1075
|
+
a && (l += a.offsetHeight + 16);
|
|
1043
1076
|
}
|
|
1044
|
-
return
|
|
1045
|
-
},
|
|
1077
|
+
return l;
|
|
1078
|
+
}, Xe = (e, i) => {
|
|
1046
1079
|
const t = {
|
|
1047
1080
|
position: "fixed",
|
|
1048
1081
|
width: "330px",
|
|
@@ -1050,61 +1083,61 @@ const _e = () => {
|
|
|
1050
1083
|
};
|
|
1051
1084
|
switch (e) {
|
|
1052
1085
|
case "top-right":
|
|
1053
|
-
t.top = `${
|
|
1086
|
+
t.top = `${i}px`, t.right = "16px";
|
|
1054
1087
|
break;
|
|
1055
1088
|
case "top-left":
|
|
1056
|
-
t.top = `${
|
|
1089
|
+
t.top = `${i}px`, t.left = "16px";
|
|
1057
1090
|
break;
|
|
1058
1091
|
case "bottom-right":
|
|
1059
|
-
t.bottom = `${
|
|
1092
|
+
t.bottom = `${i}px`, t.right = "16px";
|
|
1060
1093
|
break;
|
|
1061
1094
|
case "bottom-left":
|
|
1062
|
-
t.bottom = `${
|
|
1095
|
+
t.bottom = `${i}px`, t.left = "16px";
|
|
1063
1096
|
break;
|
|
1064
1097
|
default:
|
|
1065
|
-
t.top = `${
|
|
1098
|
+
t.top = `${i}px`, t.right = "16px";
|
|
1066
1099
|
}
|
|
1067
1100
|
return t;
|
|
1068
1101
|
};
|
|
1069
1102
|
function ye(e) {
|
|
1070
|
-
const
|
|
1071
|
-
document.body.appendChild(
|
|
1072
|
-
let o = null,
|
|
1073
|
-
const f =
|
|
1103
|
+
const i = Oe++, t = e.position || "top-right", l = document.createElement("div");
|
|
1104
|
+
document.body.appendChild(l);
|
|
1105
|
+
let o = null, a = !1;
|
|
1106
|
+
const f = A({
|
|
1074
1107
|
name: "TNotification",
|
|
1075
1108
|
setup() {
|
|
1076
|
-
const n = E(!1),
|
|
1077
|
-
|
|
1078
|
-
var
|
|
1079
|
-
const
|
|
1080
|
-
|
|
1109
|
+
const n = E(!1), p = () => {
|
|
1110
|
+
a || (a = !0, n.value = !1, setTimeout(() => {
|
|
1111
|
+
var y;
|
|
1112
|
+
const h = Q.findIndex((s) => s.id === i);
|
|
1113
|
+
h !== -1 && Q.splice(h, 1), o && clearTimeout(o), (y = e.onClose) == null || y.call(e);
|
|
1081
1114
|
try {
|
|
1082
1115
|
d.unmount();
|
|
1083
1116
|
} catch {
|
|
1084
1117
|
}
|
|
1085
|
-
|
|
1118
|
+
l.parentNode && l.parentNode.removeChild(l);
|
|
1086
1119
|
}, 300));
|
|
1087
1120
|
}, r = () => {
|
|
1088
|
-
const
|
|
1089
|
-
|
|
1090
|
-
},
|
|
1121
|
+
const h = e.duration ?? 4500;
|
|
1122
|
+
h > 0 && (o = setTimeout(p, h));
|
|
1123
|
+
}, m = () => {
|
|
1091
1124
|
o && (clearTimeout(o), o = null);
|
|
1092
|
-
},
|
|
1093
|
-
return
|
|
1125
|
+
}, w = I(() => (e.offset ?? 0) + De(t, i)), g = I(() => Xe(t, w.value));
|
|
1126
|
+
return ee(() => {
|
|
1094
1127
|
n.value = !0, r();
|
|
1095
1128
|
}), {
|
|
1096
1129
|
visible: n,
|
|
1097
|
-
close:
|
|
1098
|
-
positionStyles:
|
|
1130
|
+
close: p,
|
|
1131
|
+
positionStyles: g,
|
|
1099
1132
|
startTimer: r,
|
|
1100
|
-
clearTimer:
|
|
1133
|
+
clearTimer: m
|
|
1101
1134
|
};
|
|
1102
1135
|
},
|
|
1103
1136
|
render() {
|
|
1104
1137
|
if (!this.visible) return null;
|
|
1105
|
-
const n = e.type,
|
|
1138
|
+
const n = e.type, p = n ? We[n] : null, r = [];
|
|
1106
1139
|
e.title && r.push(
|
|
1107
|
-
|
|
1140
|
+
C("div", {
|
|
1108
1141
|
class: "x-notification__title",
|
|
1109
1142
|
style: {
|
|
1110
1143
|
fontWeight: "600",
|
|
@@ -1114,7 +1147,7 @@ function ye(e) {
|
|
|
1114
1147
|
}
|
|
1115
1148
|
}, e.title)
|
|
1116
1149
|
), e.message && (e.dangerouslyUseHTMLString ? r.push(
|
|
1117
|
-
|
|
1150
|
+
C("div", {
|
|
1118
1151
|
class: "x-notification__content",
|
|
1119
1152
|
style: {
|
|
1120
1153
|
fontSize: "14px",
|
|
@@ -1124,7 +1157,7 @@ function ye(e) {
|
|
|
1124
1157
|
innerHTML: e.message
|
|
1125
1158
|
})
|
|
1126
1159
|
) : r.push(
|
|
1127
|
-
|
|
1160
|
+
C("div", {
|
|
1128
1161
|
class: "x-notification__content",
|
|
1129
1162
|
style: {
|
|
1130
1163
|
fontSize: "14px",
|
|
@@ -1133,9 +1166,9 @@ function ye(e) {
|
|
|
1133
1166
|
}
|
|
1134
1167
|
}, e.message)
|
|
1135
1168
|
));
|
|
1136
|
-
const
|
|
1137
|
-
return
|
|
1138
|
-
|
|
1169
|
+
const m = [];
|
|
1170
|
+
return p && m.push(
|
|
1171
|
+
C("div", {
|
|
1139
1172
|
class: "x-notification__icon",
|
|
1140
1173
|
style: {
|
|
1141
1174
|
display: "flex",
|
|
@@ -1145,18 +1178,18 @@ function ye(e) {
|
|
|
1145
1178
|
height: "24px",
|
|
1146
1179
|
marginRight: "12px",
|
|
1147
1180
|
fontSize: "18px",
|
|
1148
|
-
color:
|
|
1181
|
+
color: p.color
|
|
1149
1182
|
}
|
|
1150
|
-
},
|
|
1151
|
-
),
|
|
1152
|
-
|
|
1183
|
+
}, p.icon)
|
|
1184
|
+
), m.push(
|
|
1185
|
+
C("div", {
|
|
1153
1186
|
class: "x-notification__main",
|
|
1154
1187
|
style: {
|
|
1155
1188
|
flex: "1"
|
|
1156
1189
|
}
|
|
1157
1190
|
}, r)
|
|
1158
|
-
), e.showClose !== !1 &&
|
|
1159
|
-
|
|
1191
|
+
), e.showClose !== !1 && m.push(
|
|
1192
|
+
C("button", {
|
|
1160
1193
|
class: "x-notification__close",
|
|
1161
1194
|
style: {
|
|
1162
1195
|
position: "absolute",
|
|
@@ -1169,11 +1202,11 @@ function ye(e) {
|
|
|
1169
1202
|
color: "#909399",
|
|
1170
1203
|
padding: "0"
|
|
1171
1204
|
},
|
|
1172
|
-
onClick: (
|
|
1173
|
-
|
|
1205
|
+
onClick: (w) => {
|
|
1206
|
+
w.stopPropagation(), this.close();
|
|
1174
1207
|
}
|
|
1175
1208
|
}, "✕")
|
|
1176
|
-
),
|
|
1209
|
+
), C("div", {
|
|
1177
1210
|
class: ["x-notification", e.customClass],
|
|
1178
1211
|
style: {
|
|
1179
1212
|
...this.positionStyles,
|
|
@@ -1188,49 +1221,49 @@ function ye(e) {
|
|
|
1188
1221
|
},
|
|
1189
1222
|
onMouseenter: this.clearTimer,
|
|
1190
1223
|
onMouseleave: this.startTimer
|
|
1191
|
-
},
|
|
1224
|
+
}, m);
|
|
1192
1225
|
}
|
|
1193
|
-
}), d =
|
|
1194
|
-
d.mount(
|
|
1226
|
+
}), d = ge(f);
|
|
1227
|
+
d.mount(l);
|
|
1195
1228
|
const u = {
|
|
1196
|
-
id:
|
|
1229
|
+
id: i,
|
|
1197
1230
|
app: d,
|
|
1198
|
-
container:
|
|
1231
|
+
container: l,
|
|
1199
1232
|
position: t,
|
|
1200
1233
|
close: () => {
|
|
1201
|
-
var
|
|
1202
|
-
const n = (
|
|
1234
|
+
var p;
|
|
1235
|
+
const n = (p = d._instance) == null ? void 0 : p.proxy;
|
|
1203
1236
|
n != null && n.close && n.close();
|
|
1204
1237
|
}
|
|
1205
1238
|
};
|
|
1206
|
-
return
|
|
1239
|
+
return Q.push(u), { close: u.close };
|
|
1207
1240
|
}
|
|
1208
|
-
function
|
|
1241
|
+
function je(e) {
|
|
1209
1242
|
return ye(typeof e == "string" ? { message: e } : e);
|
|
1210
1243
|
}
|
|
1211
|
-
const se = (e) => (
|
|
1244
|
+
const se = (e) => (i) => ye({ ...typeof i == "string" ? { message: i } : i, type: e }), fe = Object.assign(je, {
|
|
1212
1245
|
info: se("info"),
|
|
1213
1246
|
success: se("success"),
|
|
1214
1247
|
warning: se("warning"),
|
|
1215
1248
|
error: se("error"),
|
|
1216
|
-
closeAll:
|
|
1217
|
-
}), st = fe,
|
|
1249
|
+
closeAll: Ae
|
|
1250
|
+
}), st = fe, lt = {
|
|
1218
1251
|
install(e) {
|
|
1219
1252
|
e.config.globalProperties.$notify = fe, e.provide("notification", fe);
|
|
1220
1253
|
}
|
|
1221
1254
|
};
|
|
1222
1255
|
export {
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1256
|
+
Ye as Alert,
|
|
1257
|
+
Je as Backtop,
|
|
1258
|
+
Ue as Drawer,
|
|
1259
|
+
Qe as Message,
|
|
1260
|
+
ot as MessageBox,
|
|
1261
|
+
et as MessageComponent,
|
|
1262
|
+
Ke as Modal,
|
|
1230
1263
|
st as Notification,
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1264
|
+
Ge as Popconfirm,
|
|
1265
|
+
tt as TMessage,
|
|
1266
|
+
nt as TMessageBox,
|
|
1267
|
+
lt as TNotification,
|
|
1268
|
+
qe as Tooltip
|
|
1236
1269
|
};
|