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