@xto/feedback 1.1.7 → 1.1.9
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 +180 -179
- package/es/style.css +1 -1
- package/lib/index.cjs +1 -1
- package/lib/style.css +1 -1
- package/package.json +47 -41
package/es/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as N, ref as I, computed as L, watch as te, resolveComponent as ke, openBlock as
|
|
1
|
+
import { defineComponent as N, ref as I, computed as L, watch as te, resolveComponent as ke, openBlock as f, createBlock as j, Teleport as oe, createVNode as K, Transition as q, withCtx as D, createElementBlock as x, normalizeStyle as O, normalizeClass as a, unref as i, createElementVNode as C, withModifiers as ie, renderSlot as S, createTextVNode as H, toDisplayString as z, createCommentVNode as $, withDirectives as re, vShow as ce, Fragment as ge, renderList as ye, nextTick as ee, onUnmounted as ue, onMounted as be, reactive as Ce, createApp as ve, h as T } from "vue";
|
|
2
2
|
import { useNamespace as F, useZIndex as $e, useEscape as Be, nextMessageZIndex as Te } from "@xto/core";
|
|
3
3
|
const ot = /* @__PURE__ */ N({
|
|
4
4
|
name: "XModal",
|
|
@@ -19,10 +19,10 @@ const ot = /* @__PURE__ */ N({
|
|
|
19
19
|
},
|
|
20
20
|
emits: ["update:modelValue", "update:open", "close", "open", "ok", "cancel"],
|
|
21
21
|
setup(e, { emit: s }) {
|
|
22
|
-
const t = e, r = s, o = F("modal"), { next: l } = $e(),
|
|
22
|
+
const t = e, r = s, o = F("modal"), { next: l } = $e(), m = I(l()), g = L({
|
|
23
23
|
get: () => t.modelValue !== void 0 ? t.modelValue : t.open !== void 0 ? t.open : !1,
|
|
24
|
-
set: (
|
|
25
|
-
r("update:modelValue",
|
|
24
|
+
set: (d) => {
|
|
25
|
+
t.modelValue !== void 0 && r("update:modelValue", d), t.open !== void 0 && r("update:open", d), t.modelValue === void 0 && t.open === void 0 && r("update:modelValue", d);
|
|
26
26
|
}
|
|
27
27
|
}), v = I(), c = () => {
|
|
28
28
|
g.value = !1, r("cancel"), r("close");
|
|
@@ -33,21 +33,21 @@ const ot = /* @__PURE__ */ N({
|
|
|
33
33
|
};
|
|
34
34
|
Be(() => {
|
|
35
35
|
t.closeOnPressEscape && g.value && c();
|
|
36
|
-
}), te(() => [t.modelValue, t.open], ([
|
|
37
|
-
(
|
|
36
|
+
}), te(() => [t.modelValue, t.open], ([d, n]) => {
|
|
37
|
+
(d !== void 0 ? d : n) && (m.value = l(), r("open"));
|
|
38
38
|
}, { immediate: !0 });
|
|
39
39
|
const w = L(() => ({
|
|
40
40
|
paddingTop: t.top
|
|
41
41
|
})), h = L(() => ({
|
|
42
42
|
width: typeof t.width == "number" ? `${t.width}px` : t.width,
|
|
43
|
-
zIndex:
|
|
43
|
+
zIndex: m.value
|
|
44
44
|
}));
|
|
45
|
-
return (
|
|
46
|
-
const
|
|
47
|
-
return
|
|
45
|
+
return (d, n) => {
|
|
46
|
+
const y = ke("x-button");
|
|
47
|
+
return f(), j(oe, { to: "body" }, [
|
|
48
48
|
K(q, { name: "x-modal-fade" }, {
|
|
49
49
|
default: D(() => [
|
|
50
|
-
g.value ? (
|
|
50
|
+
g.value ? (f(), x("div", {
|
|
51
51
|
key: 0,
|
|
52
52
|
class: a(i(o).e("wrapper")),
|
|
53
53
|
style: O(w.value),
|
|
@@ -67,11 +67,11 @@ const ot = /* @__PURE__ */ N({
|
|
|
67
67
|
C("span", {
|
|
68
68
|
class: a(i(o).e("title"))
|
|
69
69
|
}, [
|
|
70
|
-
S(
|
|
70
|
+
S(d.$slots, "title", {}, () => [
|
|
71
71
|
H(z(e.title), 1)
|
|
72
72
|
])
|
|
73
73
|
], 2),
|
|
74
|
-
e.showClose ? (
|
|
74
|
+
e.showClose ? (f(), x("button", {
|
|
75
75
|
key: 0,
|
|
76
76
|
class: a(i(o).e("close")),
|
|
77
77
|
onClick: c
|
|
@@ -80,27 +80,27 @@ const ot = /* @__PURE__ */ N({
|
|
|
80
80
|
C("div", {
|
|
81
81
|
class: a(i(o).e("body"))
|
|
82
82
|
}, [
|
|
83
|
-
S(
|
|
83
|
+
S(d.$slots, "default")
|
|
84
84
|
], 2),
|
|
85
|
-
|
|
85
|
+
d.$slots.footer ? (f(), x("div", {
|
|
86
86
|
key: 0,
|
|
87
87
|
class: a(i(o).e("footer"))
|
|
88
88
|
}, [
|
|
89
|
-
S(
|
|
89
|
+
S(d.$slots, "footer", {
|
|
90
90
|
ok: k,
|
|
91
91
|
cancel: c
|
|
92
92
|
})
|
|
93
|
-
], 2)) :
|
|
93
|
+
], 2)) : d.$slots.footer ? $("", !0) : (f(), x("div", {
|
|
94
94
|
key: 1,
|
|
95
95
|
class: a(i(o).e("footer"))
|
|
96
96
|
}, [
|
|
97
|
-
K(
|
|
97
|
+
K(y, { onClick: c }, {
|
|
98
98
|
default: D(() => [...n[1] || (n[1] = [
|
|
99
99
|
H("取消", -1)
|
|
100
100
|
])]),
|
|
101
101
|
_: 1
|
|
102
102
|
}),
|
|
103
|
-
K(
|
|
103
|
+
K(y, {
|
|
104
104
|
type: "primary",
|
|
105
105
|
style: { "margin-left": "8px" },
|
|
106
106
|
onClick: k
|
|
@@ -133,16 +133,17 @@ const ot = /* @__PURE__ */ N({
|
|
|
133
133
|
withHeader: { type: Boolean, default: !0 },
|
|
134
134
|
showClose: { type: Boolean, default: !0 },
|
|
135
135
|
closeOnClickModal: { type: Boolean, default: !0 },
|
|
136
|
-
destroyOnClose: { type: Boolean, default: !1 }
|
|
136
|
+
destroyOnClose: { type: Boolean, default: !1 },
|
|
137
|
+
modal: { type: Boolean, default: !0 }
|
|
137
138
|
},
|
|
138
139
|
emits: ["update:modelValue", "close", "open"],
|
|
139
140
|
setup(e, { emit: s }) {
|
|
140
|
-
const t = e, r = s, o = F("drawer"), l = I(2e3),
|
|
141
|
+
const t = e, r = s, o = F("drawer"), l = I(2e3), m = () => {
|
|
141
142
|
r("update:modelValue", !1), r("close");
|
|
142
143
|
}, g = () => {
|
|
143
|
-
t.closeOnClickModal &&
|
|
144
|
+
t.closeOnClickModal && m();
|
|
144
145
|
}, v = (p) => {
|
|
145
|
-
p.key === "Escape" && t.modelValue &&
|
|
146
|
+
p.key === "Escape" && t.modelValue && m();
|
|
146
147
|
};
|
|
147
148
|
te(() => t.modelValue, (p) => {
|
|
148
149
|
p ? (l.value = 2e3 + Math.floor(Math.random() * 100), r("open"), document.addEventListener("keydown", v)) : document.removeEventListener("keydown", v);
|
|
@@ -158,11 +159,11 @@ const ot = /* @__PURE__ */ N({
|
|
|
158
159
|
btt: { width: "100%", height: h }
|
|
159
160
|
}[p];
|
|
160
161
|
});
|
|
161
|
-
return (p, w) => (
|
|
162
|
+
return (p, w) => (f(), j(oe, { to: "body" }, [
|
|
162
163
|
K(q, { name: "x-drawer-fade" }, {
|
|
163
164
|
default: D(() => [
|
|
164
165
|
re(C("div", {
|
|
165
|
-
class: a(i(o).e("overlay")),
|
|
166
|
+
class: a([i(o).e("overlay"), { [i(o).em("overlay", "no-modal")]: !e.modal }]),
|
|
166
167
|
style: O(c.value),
|
|
167
168
|
onClick: g
|
|
168
169
|
}, [
|
|
@@ -172,7 +173,7 @@ const ot = /* @__PURE__ */ N({
|
|
|
172
173
|
onClick: w[0] || (w[0] = ie(() => {
|
|
173
174
|
}, ["stop"]))
|
|
174
175
|
}, [
|
|
175
|
-
e.withHeader ? (
|
|
176
|
+
e.withHeader ? (f(), x("div", {
|
|
176
177
|
key: 0,
|
|
177
178
|
class: a(i(o).e("header"))
|
|
178
179
|
}, [
|
|
@@ -183,10 +184,10 @@ const ot = /* @__PURE__ */ N({
|
|
|
183
184
|
H(z(e.title), 1)
|
|
184
185
|
])
|
|
185
186
|
], 2),
|
|
186
|
-
e.showClose ? (
|
|
187
|
+
e.showClose ? (f(), x("button", {
|
|
187
188
|
key: 0,
|
|
188
189
|
class: a(i(o).e("close")),
|
|
189
|
-
onClick:
|
|
190
|
+
onClick: m
|
|
190
191
|
}, " ✕ ", 2)) : $("", !0)
|
|
191
192
|
], 2)) : $("", !0),
|
|
192
193
|
C("div", {
|
|
@@ -194,7 +195,7 @@ const ot = /* @__PURE__ */ N({
|
|
|
194
195
|
}, [
|
|
195
196
|
S(p.$slots, "default")
|
|
196
197
|
], 2),
|
|
197
|
-
p.$slots.footer ? (
|
|
198
|
+
p.$slots.footer ? (f(), x("div", {
|
|
198
199
|
key: 1,
|
|
199
200
|
class: a(i(o).e("footer"))
|
|
200
201
|
}, [
|
|
@@ -230,7 +231,7 @@ const ot = /* @__PURE__ */ N({
|
|
|
230
231
|
},
|
|
231
232
|
emits: ["update:modelValue", "confirm", "cancel", "close", "field-change"],
|
|
232
233
|
setup(e, { emit: s }) {
|
|
233
|
-
const t = e, r = s, o = F("drawer-form"), l = I({}),
|
|
234
|
+
const t = e, r = s, o = F("drawer-form"), l = I({}), m = I({});
|
|
234
235
|
L(() => [
|
|
235
236
|
o.b()
|
|
236
237
|
]), te(() => t.formData, (h) => {
|
|
@@ -243,26 +244,26 @@ const ot = /* @__PURE__ */ N({
|
|
|
243
244
|
}, k = () => {
|
|
244
245
|
p() && (r("confirm", l.value), v());
|
|
245
246
|
}, p = () => {
|
|
246
|
-
|
|
247
|
+
m.value = {};
|
|
247
248
|
for (const h of t.fields) {
|
|
248
249
|
if (h.required) {
|
|
249
|
-
const
|
|
250
|
-
if (
|
|
251
|
-
|
|
250
|
+
const d = l.value[h.name];
|
|
251
|
+
if (d == null || d === "") {
|
|
252
|
+
m.value[h.name] = `${h.label}为必填项`;
|
|
252
253
|
continue;
|
|
253
254
|
}
|
|
254
255
|
}
|
|
255
256
|
if (h.rules)
|
|
256
|
-
for (const
|
|
257
|
+
for (const d of h.rules) {
|
|
257
258
|
const n = l.value[h.name];
|
|
258
|
-
|
|
259
|
+
d.type === "email" && n && !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(n) && (m.value[h.name] = d.message), d.type === "minLength" && n && n.length < d.min && (m.value[h.name] = d.message);
|
|
259
260
|
}
|
|
260
261
|
}
|
|
261
|
-
return Object.keys(
|
|
262
|
-
}, w = (h,
|
|
263
|
-
l.value[h] =
|
|
262
|
+
return Object.keys(m.value).length === 0;
|
|
263
|
+
}, w = (h, d) => {
|
|
264
|
+
l.value[h] = d, r("field-change", h, d);
|
|
264
265
|
};
|
|
265
|
-
return (h,
|
|
266
|
+
return (h, d) => (f(), j(oe, { to: "body" }, [
|
|
266
267
|
K(q, { name: "drawer-form-fade" }, {
|
|
267
268
|
default: D(() => [
|
|
268
269
|
re(C("div", {
|
|
@@ -272,7 +273,7 @@ const ot = /* @__PURE__ */ N({
|
|
|
272
273
|
C("div", {
|
|
273
274
|
class: a(i(o).b()),
|
|
274
275
|
style: O({ width: g.value }),
|
|
275
|
-
onClick:
|
|
276
|
+
onClick: d[0] || (d[0] = ie(() => {
|
|
276
277
|
}, ["stop"]))
|
|
277
278
|
}, [
|
|
278
279
|
C("div", {
|
|
@@ -289,11 +290,11 @@ const ot = /* @__PURE__ */ N({
|
|
|
289
290
|
C("div", {
|
|
290
291
|
class: a(i(o).e("body"))
|
|
291
292
|
}, [
|
|
292
|
-
!e.destroyOnClose || e.modelValue ? (
|
|
293
|
+
!e.destroyOnClose || e.modelValue ? (f(), x("div", {
|
|
293
294
|
key: 0,
|
|
294
295
|
class: a(i(o).e("form"))
|
|
295
296
|
}, [
|
|
296
|
-
(
|
|
297
|
+
(f(!0), x(ge, null, ye(e.fields, (n) => (f(), x("div", {
|
|
297
298
|
key: n.name,
|
|
298
299
|
class: a(i(o).e("field"))
|
|
299
300
|
}, [
|
|
@@ -301,68 +302,68 @@ const ot = /* @__PURE__ */ N({
|
|
|
301
302
|
class: a(i(o).e("label"))
|
|
302
303
|
}, [
|
|
303
304
|
H(z(n.label) + " ", 1),
|
|
304
|
-
n.required ? (
|
|
305
|
+
n.required ? (f(), x("span", Ee, "*")) : $("", !0)
|
|
305
306
|
], 2),
|
|
306
|
-
n.type === "input" ? (
|
|
307
|
+
n.type === "input" ? (f(), x("input", {
|
|
307
308
|
key: 0,
|
|
308
|
-
class: a([i(o).e("input"), { "has-error":
|
|
309
|
+
class: a([i(o).e("input"), { "has-error": m.value[n.name] }]),
|
|
309
310
|
value: l.value[n.name],
|
|
310
311
|
placeholder: n.placeholder,
|
|
311
312
|
disabled: e.disabled || n.disabled,
|
|
312
|
-
onInput: (
|
|
313
|
-
}, null, 42, Me)) : n.type === "textarea" ? (
|
|
313
|
+
onInput: (y) => w(n.name, y.target.value)
|
|
314
|
+
}, null, 42, Me)) : n.type === "textarea" ? (f(), x("textarea", {
|
|
314
315
|
key: 1,
|
|
315
|
-
class: a([i(o).e("textarea"), { "has-error":
|
|
316
|
+
class: a([i(o).e("textarea"), { "has-error": m.value[n.name] }]),
|
|
316
317
|
value: l.value[n.name],
|
|
317
318
|
placeholder: n.placeholder,
|
|
318
319
|
disabled: e.disabled || n.disabled,
|
|
319
320
|
rows: "4",
|
|
320
|
-
onInput: (
|
|
321
|
-
}, null, 42, ze)) : n.type === "number" ? (
|
|
321
|
+
onInput: (y) => w(n.name, y.target.value)
|
|
322
|
+
}, null, 42, ze)) : n.type === "number" ? (f(), x("input", {
|
|
322
323
|
key: 2,
|
|
323
324
|
type: "number",
|
|
324
|
-
class: a([i(o).e("input"), { "has-error":
|
|
325
|
+
class: a([i(o).e("input"), { "has-error": m.value[n.name] }]),
|
|
325
326
|
value: l.value[n.name],
|
|
326
327
|
placeholder: n.placeholder,
|
|
327
328
|
disabled: e.disabled || n.disabled,
|
|
328
|
-
onInput: (
|
|
329
|
-
}, null, 42, Ie)) : n.type === "select" ? (
|
|
329
|
+
onInput: (y) => w(n.name, Number(y.target.value))
|
|
330
|
+
}, null, 42, Ie)) : n.type === "select" ? (f(), x("select", {
|
|
330
331
|
key: 3,
|
|
331
|
-
class: a([i(o).e("select"), { "has-error":
|
|
332
|
+
class: a([i(o).e("select"), { "has-error": m.value[n.name] }]),
|
|
332
333
|
value: l.value[n.name],
|
|
333
334
|
disabled: e.disabled || n.disabled,
|
|
334
|
-
onChange: (
|
|
335
|
+
onChange: (y) => w(n.name, y.target.value)
|
|
335
336
|
}, [
|
|
336
|
-
(
|
|
337
|
-
key:
|
|
338
|
-
value:
|
|
339
|
-
}, z(
|
|
340
|
-
], 42, Se)) : n.type === "switch" ? (
|
|
337
|
+
(f(!0), x(ge, null, ye(n.options, (y) => (f(), x("option", {
|
|
338
|
+
key: y.value,
|
|
339
|
+
value: y.value
|
|
340
|
+
}, z(y.label), 9, Le))), 128))
|
|
341
|
+
], 42, Se)) : n.type === "switch" ? (f(), x("div", {
|
|
341
342
|
key: 4,
|
|
342
343
|
class: a(i(o).e("switch"))
|
|
343
344
|
}, [
|
|
344
345
|
C("button", {
|
|
345
346
|
class: a(["switch-btn", { "is-on": l.value[n.name] }]),
|
|
346
347
|
disabled: e.disabled || n.disabled,
|
|
347
|
-
onClick: (
|
|
348
|
+
onClick: (y) => w(n.name, !l.value[n.name])
|
|
348
349
|
}, z(l.value[n.name] ? "开启" : "关闭"), 11, Ve)
|
|
349
350
|
], 2)) : $("", !0),
|
|
350
|
-
|
|
351
|
+
m.value[n.name] ? (f(), x("span", {
|
|
351
352
|
key: 5,
|
|
352
353
|
class: a(i(o).e("error"))
|
|
353
|
-
}, z(
|
|
354
|
+
}, z(m.value[n.name]), 3)) : $("", !0)
|
|
354
355
|
], 2))), 128))
|
|
355
356
|
], 2)) : $("", !0)
|
|
356
357
|
], 2),
|
|
357
358
|
C("div", {
|
|
358
359
|
class: a(i(o).e("footer"))
|
|
359
360
|
}, [
|
|
360
|
-
e.showCancel ? (
|
|
361
|
+
e.showCancel ? (f(), x("button", {
|
|
361
362
|
key: 0,
|
|
362
363
|
class: a(i(o).e("cancel")),
|
|
363
364
|
onClick: c
|
|
364
365
|
}, z(e.cancelText), 3)) : $("", !0),
|
|
365
|
-
e.showConfirm ? (
|
|
366
|
+
e.showConfirm ? (f(), x("button", {
|
|
366
367
|
key: 1,
|
|
367
368
|
class: a(i(o).e("confirm")),
|
|
368
369
|
onClick: k
|
|
@@ -390,7 +391,7 @@ const ot = /* @__PURE__ */ N({
|
|
|
390
391
|
},
|
|
391
392
|
emits: ["close"],
|
|
392
393
|
setup(e, { emit: s }) {
|
|
393
|
-
const t = e, r = s, o = F("alert"), l = I(!0),
|
|
394
|
+
const t = e, r = s, o = F("alert"), l = I(!0), m = {
|
|
394
395
|
success: "✓",
|
|
395
396
|
warning: "⚠",
|
|
396
397
|
error: "✕",
|
|
@@ -403,20 +404,20 @@ const ot = /* @__PURE__ */ N({
|
|
|
403
404
|
]), v = (c) => {
|
|
404
405
|
l.value = !1, r("close", c);
|
|
405
406
|
};
|
|
406
|
-
return (c, k) => (
|
|
407
|
+
return (c, k) => (f(), j(q, { name: "x-alert-fade" }, {
|
|
407
408
|
default: D(() => [
|
|
408
|
-
l.value ? (
|
|
409
|
+
l.value ? (f(), x("div", {
|
|
409
410
|
key: 0,
|
|
410
411
|
class: a(g.value)
|
|
411
412
|
}, [
|
|
412
|
-
e.showIcon ? (
|
|
413
|
+
e.showIcon ? (f(), x("span", {
|
|
413
414
|
key: 0,
|
|
414
415
|
class: a(i(o).e("icon"))
|
|
415
|
-
}, z(
|
|
416
|
+
}, z(m[e.type]), 3)) : $("", !0),
|
|
416
417
|
C("div", {
|
|
417
418
|
class: a(i(o).e("content"))
|
|
418
419
|
}, [
|
|
419
|
-
e.title || c.$slots.title ? (
|
|
420
|
+
e.title || c.$slots.title ? (f(), x("span", {
|
|
420
421
|
key: 0,
|
|
421
422
|
class: a(i(o).e("title"))
|
|
422
423
|
}, [
|
|
@@ -424,7 +425,7 @@ const ot = /* @__PURE__ */ N({
|
|
|
424
425
|
H(z(e.title), 1)
|
|
425
426
|
])
|
|
426
427
|
], 2)) : $("", !0),
|
|
427
|
-
e.description || c.$slots.default ? (
|
|
428
|
+
e.description || c.$slots.default ? (f(), x("span", {
|
|
428
429
|
key: 1,
|
|
429
430
|
class: a(i(o).e("description"))
|
|
430
431
|
}, [
|
|
@@ -433,7 +434,7 @@ const ot = /* @__PURE__ */ N({
|
|
|
433
434
|
])
|
|
434
435
|
], 2)) : $("", !0)
|
|
435
436
|
], 2),
|
|
436
|
-
e.closable ? (
|
|
437
|
+
e.closable ? (f(), x("button", {
|
|
437
438
|
key: 1,
|
|
438
439
|
class: a(i(o).e("close")),
|
|
439
440
|
onClick: v
|
|
@@ -460,11 +461,11 @@ const ot = /* @__PURE__ */ N({
|
|
|
460
461
|
},
|
|
461
462
|
emits: ["update:visible", "show", "hide"],
|
|
462
463
|
setup(e, { emit: s }) {
|
|
463
|
-
const t = e, r = s, o = F("tooltip"), l = I(!1),
|
|
464
|
+
const t = e, r = s, o = F("tooltip"), l = I(!1), m = I(), g = I();
|
|
464
465
|
let v, c;
|
|
465
466
|
const k = I({}), p = () => {
|
|
466
|
-
if (!
|
|
467
|
-
const E =
|
|
467
|
+
if (!m.value || !g.value) return;
|
|
468
|
+
const E = m.value.getBoundingClientRect(), W = g.value;
|
|
468
469
|
W.style.visibility = "hidden", W.style.display = "block";
|
|
469
470
|
const A = W.offsetWidth, Z = W.offsetHeight, X = t.offset, fe = window.innerWidth, me = window.innerHeight;
|
|
470
471
|
let P = 0, R = 0, G = t.placement;
|
|
@@ -495,25 +496,25 @@ const ot = /* @__PURE__ */ N({
|
|
|
495
496
|
p();
|
|
496
497
|
});
|
|
497
498
|
}, t.openDelay));
|
|
498
|
-
},
|
|
499
|
+
}, d = () => {
|
|
499
500
|
clearTimeout(v), c = setTimeout(() => {
|
|
500
501
|
l.value = !1, r("update:visible", !1), r("hide");
|
|
501
502
|
}, t.closeDelay);
|
|
502
503
|
}, n = () => {
|
|
503
|
-
l.value ?
|
|
504
|
-
},
|
|
504
|
+
l.value ? d() : h();
|
|
505
|
+
}, y = () => {
|
|
505
506
|
t.trigger === "hover" && h();
|
|
506
507
|
}, u = () => {
|
|
507
|
-
t.trigger === "hover" &&
|
|
508
|
-
},
|
|
508
|
+
t.trigger === "hover" && d();
|
|
509
|
+
}, b = () => {
|
|
509
510
|
t.trigger === "click" && n();
|
|
510
511
|
}, U = () => {
|
|
511
512
|
t.trigger === "focus" && h();
|
|
512
513
|
}, V = () => {
|
|
513
|
-
t.trigger === "focus" &&
|
|
514
|
+
t.trigger === "focus" && d();
|
|
514
515
|
}, M = (E) => {
|
|
515
516
|
var W, A;
|
|
516
|
-
t.trigger === "click" && !((W =
|
|
517
|
+
t.trigger === "click" && !((W = m.value) != null && W.contains(E.target)) && !((A = g.value) != null && A.contains(E.target)) && d();
|
|
517
518
|
}, B = () => {
|
|
518
519
|
l.value && p();
|
|
519
520
|
};
|
|
@@ -531,22 +532,22 @@ const ot = /* @__PURE__ */ N({
|
|
|
531
532
|
o.e("arrow"),
|
|
532
533
|
o.e(`arrow-${w.value}`)
|
|
533
534
|
]);
|
|
534
|
-
return (E, W) => (
|
|
535
|
+
return (E, W) => (f(), x("div", {
|
|
535
536
|
class: a(i(o).e("wrapper"))
|
|
536
537
|
}, [
|
|
537
538
|
C("div", {
|
|
538
539
|
ref_key: "triggerRef",
|
|
539
|
-
ref:
|
|
540
|
+
ref: m,
|
|
540
541
|
class: a(i(o).e("trigger")),
|
|
541
|
-
onMouseenter:
|
|
542
|
+
onMouseenter: y,
|
|
542
543
|
onMouseleave: u,
|
|
543
|
-
onClick:
|
|
544
|
+
onClick: b,
|
|
544
545
|
onFocus: U,
|
|
545
546
|
onBlur: V
|
|
546
547
|
}, [
|
|
547
548
|
S(E.$slots, "default")
|
|
548
549
|
], 34),
|
|
549
|
-
(
|
|
550
|
+
(f(), j(oe, { to: "body" }, [
|
|
550
551
|
K(q, {
|
|
551
552
|
name: `x-tooltip-${e.transition}`
|
|
552
553
|
}, {
|
|
@@ -556,13 +557,13 @@ const ot = /* @__PURE__ */ N({
|
|
|
556
557
|
ref: g,
|
|
557
558
|
class: a(ne.value),
|
|
558
559
|
style: O(k.value),
|
|
559
|
-
onMouseenter:
|
|
560
|
+
onMouseenter: y,
|
|
560
561
|
onMouseleave: u
|
|
561
562
|
}, [
|
|
562
563
|
S(E.$slots, "content", {}, () => [
|
|
563
564
|
H(z(e.content), 1)
|
|
564
565
|
]),
|
|
565
|
-
e.visibleArrow ? (
|
|
566
|
+
e.visibleArrow ? (f(), x("div", {
|
|
566
567
|
key: 0,
|
|
567
568
|
class: a(se.value)
|
|
568
569
|
}, null, 2)) : $("", !0)
|
|
@@ -597,60 +598,60 @@ const ot = /* @__PURE__ */ N({
|
|
|
597
598
|
},
|
|
598
599
|
emits: ["confirm", "cancel"],
|
|
599
600
|
setup(e, { emit: s }) {
|
|
600
|
-
const t = e, r = s, o = I(!1), l = I(null),
|
|
601
|
-
if (!l.value || !
|
|
602
|
-
const u = l.value.getBoundingClientRect(),
|
|
601
|
+
const t = e, r = s, o = I(!1), l = I(null), m = I(null), g = I({}), v = () => {
|
|
602
|
+
if (!l.value || !m.value) return;
|
|
603
|
+
const u = l.value.getBoundingClientRect(), b = m.value.getBoundingClientRect(), U = t.placement, V = t.offset;
|
|
603
604
|
let M = 0, B = 0;
|
|
604
605
|
switch (U) {
|
|
605
606
|
case "top":
|
|
606
|
-
M = u.top -
|
|
607
|
+
M = u.top - b.height - V, B = u.left + (u.width - b.width) / 2;
|
|
607
608
|
break;
|
|
608
609
|
case "top-start":
|
|
609
|
-
M = u.top -
|
|
610
|
+
M = u.top - b.height - V, B = u.left;
|
|
610
611
|
break;
|
|
611
612
|
case "top-end":
|
|
612
|
-
M = u.top -
|
|
613
|
+
M = u.top - b.height - V, B = u.right - b.width;
|
|
613
614
|
break;
|
|
614
615
|
case "bottom":
|
|
615
|
-
M = u.bottom + V, B = u.left + (u.width -
|
|
616
|
+
M = u.bottom + V, B = u.left + (u.width - b.width) / 2;
|
|
616
617
|
break;
|
|
617
618
|
case "bottom-start":
|
|
618
619
|
M = u.bottom + V, B = u.left;
|
|
619
620
|
break;
|
|
620
621
|
case "bottom-end":
|
|
621
|
-
M = u.bottom + V, B = u.right -
|
|
622
|
+
M = u.bottom + V, B = u.right - b.width;
|
|
622
623
|
break;
|
|
623
624
|
case "left":
|
|
624
|
-
M = u.top + (u.height -
|
|
625
|
+
M = u.top + (u.height - b.height) / 2, B = u.left - b.width - V;
|
|
625
626
|
break;
|
|
626
627
|
case "left-start":
|
|
627
|
-
M = u.top, B = u.left -
|
|
628
|
+
M = u.top, B = u.left - b.width - V;
|
|
628
629
|
break;
|
|
629
630
|
case "left-end":
|
|
630
|
-
M = u.bottom -
|
|
631
|
+
M = u.bottom - b.height, B = u.left - b.width - V;
|
|
631
632
|
break;
|
|
632
633
|
case "right":
|
|
633
|
-
M = u.top + (u.height -
|
|
634
|
+
M = u.top + (u.height - b.height) / 2, B = u.right + V;
|
|
634
635
|
break;
|
|
635
636
|
case "right-start":
|
|
636
637
|
M = u.top, B = u.right + V;
|
|
637
638
|
break;
|
|
638
639
|
case "right-end":
|
|
639
|
-
M = u.bottom -
|
|
640
|
+
M = u.bottom - b.height, B = u.right + V;
|
|
640
641
|
break;
|
|
641
642
|
default:
|
|
642
|
-
M = u.top -
|
|
643
|
+
M = u.top - b.height - V, B = u.left + (u.width - b.width) / 2;
|
|
643
644
|
}
|
|
644
645
|
const ne = window.innerWidth, se = window.innerHeight;
|
|
645
|
-
B < 0 && (B = 10), B +
|
|
646
|
+
B < 0 && (B = 10), B + b.width > ne && (B = ne - b.width - 10), M < 0 && (M = 10), M + b.height > se && (M = se - b.height - 10), g.value = {
|
|
646
647
|
position: "fixed",
|
|
647
648
|
top: `${M}px`,
|
|
648
649
|
left: `${B}px`,
|
|
649
650
|
zIndex: "2000"
|
|
650
651
|
};
|
|
651
652
|
}, c = (u) => {
|
|
652
|
-
var
|
|
653
|
-
o.value && ((
|
|
653
|
+
var b, U;
|
|
654
|
+
o.value && ((b = l.value) != null && b.contains(u.target) || (U = m.value) != null && U.contains(u.target) || (o.value = !1));
|
|
654
655
|
}, k = (u) => {
|
|
655
656
|
t.disabled || (u.stopPropagation(), o.value = !o.value, o.value && setTimeout(v, 0));
|
|
656
657
|
}, p = () => {
|
|
@@ -659,43 +660,43 @@ const ot = /* @__PURE__ */ N({
|
|
|
659
660
|
o.value = !1, r("cancel");
|
|
660
661
|
}, h = () => {
|
|
661
662
|
o.value && v();
|
|
662
|
-
},
|
|
663
|
+
}, d = () => {
|
|
663
664
|
o.value && v();
|
|
664
665
|
};
|
|
665
666
|
te(o, (u) => {
|
|
666
|
-
u ? (setTimeout(v, 0), document.addEventListener("click", c), window.addEventListener("scroll", h, !0), window.addEventListener("resize",
|
|
667
|
+
u ? (setTimeout(v, 0), document.addEventListener("click", c), window.addEventListener("scroll", h, !0), window.addEventListener("resize", d)) : (document.removeEventListener("click", c), window.removeEventListener("scroll", h, !0), window.removeEventListener("resize", d));
|
|
667
668
|
}), ue(() => {
|
|
668
|
-
document.removeEventListener("click", c), window.removeEventListener("scroll", h, !0), window.removeEventListener("resize",
|
|
669
|
+
document.removeEventListener("click", c), window.removeEventListener("scroll", h, !0), window.removeEventListener("resize", d);
|
|
669
670
|
});
|
|
670
671
|
const n = L(() => ({
|
|
671
672
|
width: typeof t.width == "number" ? `${t.width}px` : t.width
|
|
672
|
-
})),
|
|
673
|
-
const u = t.placement,
|
|
673
|
+
})), y = L(() => {
|
|
674
|
+
const u = t.placement, b = {};
|
|
674
675
|
switch (u) {
|
|
675
676
|
case "top":
|
|
676
677
|
case "top-start":
|
|
677
678
|
case "top-end":
|
|
678
|
-
|
|
679
|
+
b.bottom = "-6px", b.transform = "rotate(45deg)";
|
|
679
680
|
break;
|
|
680
681
|
case "bottom":
|
|
681
682
|
case "bottom-start":
|
|
682
683
|
case "bottom-end":
|
|
683
|
-
|
|
684
|
+
b.top = "-6px", b.transform = "rotate(225deg)";
|
|
684
685
|
break;
|
|
685
686
|
case "left":
|
|
686
687
|
case "left-start":
|
|
687
688
|
case "left-end":
|
|
688
|
-
|
|
689
|
+
b.right = "-6px", b.transform = "rotate(315deg)";
|
|
689
690
|
break;
|
|
690
691
|
case "right":
|
|
691
692
|
case "right-start":
|
|
692
693
|
case "right-end":
|
|
693
|
-
|
|
694
|
+
b.left = "-6px", b.transform = "rotate(135deg)";
|
|
694
695
|
break;
|
|
695
696
|
}
|
|
696
|
-
return
|
|
697
|
+
return b;
|
|
697
698
|
});
|
|
698
|
-
return (u,
|
|
699
|
+
return (u, b) => (f(), x("span", Pe, [
|
|
699
700
|
C("span", {
|
|
700
701
|
ref_key: "triggerRef",
|
|
701
702
|
ref: l,
|
|
@@ -704,25 +705,25 @@ const ot = /* @__PURE__ */ N({
|
|
|
704
705
|
}, [
|
|
705
706
|
S(u.$slots, "default")
|
|
706
707
|
], 512),
|
|
707
|
-
(
|
|
708
|
+
(f(), j(oe, { to: "body" }, [
|
|
708
709
|
K(q, { name: "x-popconfirm-fade" }, {
|
|
709
710
|
default: D(() => [
|
|
710
|
-
o.value ? (
|
|
711
|
+
o.value ? (f(), x("div", {
|
|
711
712
|
key: 0,
|
|
712
713
|
ref_key: "popperRef",
|
|
713
|
-
ref:
|
|
714
|
+
ref: m,
|
|
714
715
|
class: "x-popconfirm",
|
|
715
716
|
style: O({ ...g.value, ...n.value }),
|
|
716
|
-
onClick:
|
|
717
|
+
onClick: b[0] || (b[0] = ie(() => {
|
|
717
718
|
}, ["stop"]))
|
|
718
719
|
}, [
|
|
719
|
-
e.showArrow ? (
|
|
720
|
+
e.showArrow ? (f(), x("span", {
|
|
720
721
|
key: 0,
|
|
721
722
|
class: "x-popconfirm__arrow",
|
|
722
|
-
style: O(
|
|
723
|
+
style: O(y.value)
|
|
723
724
|
}, null, 4)) : $("", !0),
|
|
724
725
|
C("div", Re, [
|
|
725
|
-
e.hideIcon ? $("", !0) : (
|
|
726
|
+
e.hideIcon ? $("", !0) : (f(), x("span", {
|
|
726
727
|
key: 0,
|
|
727
728
|
class: "x-popconfirm__icon",
|
|
728
729
|
style: O({ color: e.iconColor })
|
|
@@ -738,12 +739,12 @@ const ot = /* @__PURE__ */ N({
|
|
|
738
739
|
])
|
|
739
740
|
]),
|
|
740
741
|
C("div", Ne, [
|
|
741
|
-
e.hideCancelButton ? $("", !0) : (
|
|
742
|
+
e.hideCancelButton ? $("", !0) : (f(), x("button", {
|
|
742
743
|
key: 0,
|
|
743
744
|
class: "x-button p-button--default p-button--small",
|
|
744
745
|
onClick: w
|
|
745
746
|
}, z(e.cancelButtonText), 1)),
|
|
746
|
-
e.hideConfirmButton ? $("", !0) : (
|
|
747
|
+
e.hideConfirmButton ? $("", !0) : (f(), x("button", {
|
|
747
748
|
key: 1,
|
|
748
749
|
class: a(["x-button x-button--small", `x-button--${e.confirmButtonType}`]),
|
|
749
750
|
onClick: p
|
|
@@ -766,7 +767,7 @@ const ot = /* @__PURE__ */ N({
|
|
|
766
767
|
},
|
|
767
768
|
emits: ["click"],
|
|
768
769
|
setup(e, { emit: s }) {
|
|
769
|
-
const t = e, r = s, o = F("backtop"), l = I(!1),
|
|
770
|
+
const t = e, r = s, o = F("backtop"), l = I(!1), m = () => {
|
|
770
771
|
const c = window.scrollY || document.documentElement.scrollTop || document.body.scrollTop || 0;
|
|
771
772
|
l.value = c >= t.visibilityHeight;
|
|
772
773
|
}, g = (c) => {
|
|
@@ -778,11 +779,11 @@ const ot = /* @__PURE__ */ N({
|
|
|
778
779
|
right: `${t.right}px`,
|
|
779
780
|
bottom: `${t.bottom}px`
|
|
780
781
|
}));
|
|
781
|
-
return
|
|
782
|
-
window.addEventListener("scroll",
|
|
782
|
+
return be(() => {
|
|
783
|
+
window.addEventListener("scroll", m, { passive: !0, capture: !0 }), setTimeout(m, 100);
|
|
783
784
|
}), ue(() => {
|
|
784
|
-
window.removeEventListener("scroll",
|
|
785
|
-
}), (c, k) => (
|
|
785
|
+
window.removeEventListener("scroll", m, !0);
|
|
786
|
+
}), (c, k) => (f(), j(q, { name: "x-fade" }, {
|
|
786
787
|
default: D(() => [
|
|
787
788
|
re(C("div", {
|
|
788
789
|
class: a(i(o).b()),
|
|
@@ -806,7 +807,7 @@ const ot = /* @__PURE__ */ N({
|
|
|
806
807
|
__name: "index",
|
|
807
808
|
setup(e) {
|
|
808
809
|
const s = F("timeline");
|
|
809
|
-
return (t, r) => (
|
|
810
|
+
return (t, r) => (f(), x("ul", {
|
|
810
811
|
class: a(i(s).b())
|
|
811
812
|
}, [
|
|
812
813
|
S(t.$slots, "default")
|
|
@@ -826,7 +827,7 @@ const ot = /* @__PURE__ */ N({
|
|
|
826
827
|
},
|
|
827
828
|
setup(e) {
|
|
828
829
|
const s = F("timeline-item");
|
|
829
|
-
return (t, r) => (
|
|
830
|
+
return (t, r) => (f(), x("li", {
|
|
830
831
|
class: a([i(s).b(), i(s).m(e.placement)])
|
|
831
832
|
}, [
|
|
832
833
|
C("div", {
|
|
@@ -837,7 +838,7 @@ const ot = /* @__PURE__ */ N({
|
|
|
837
838
|
style: O(e.color ? { backgroundColor: e.color, borderColor: e.color } : void 0)
|
|
838
839
|
}, [
|
|
839
840
|
S(t.$slots, "icon", {}, () => [
|
|
840
|
-
e.icon ? (
|
|
841
|
+
e.icon ? (f(), x("span", {
|
|
841
842
|
key: 0,
|
|
842
843
|
class: a(i(s).e("icon"))
|
|
843
844
|
}, z(e.icon), 3)) : $("", !0)
|
|
@@ -846,7 +847,7 @@ const ot = /* @__PURE__ */ N({
|
|
|
846
847
|
C("div", {
|
|
847
848
|
class: a(i(s).e("wrapper"))
|
|
848
849
|
}, [
|
|
849
|
-
e.timestamp && e.placement === "top" ? (
|
|
850
|
+
e.timestamp && e.placement === "top" ? (f(), x("div", {
|
|
850
851
|
key: 0,
|
|
851
852
|
class: a(i(s).e("timestamp"))
|
|
852
853
|
}, z(e.timestamp), 3)) : $("", !0),
|
|
@@ -855,7 +856,7 @@ const ot = /* @__PURE__ */ N({
|
|
|
855
856
|
}, [
|
|
856
857
|
S(t.$slots, "default")
|
|
857
858
|
], 2),
|
|
858
|
-
e.timestamp && e.placement === "bottom" ? (
|
|
859
|
+
e.timestamp && e.placement === "bottom" ? (f(), x("div", {
|
|
859
860
|
key: 1,
|
|
860
861
|
class: a(i(s).e("timestamp"))
|
|
861
862
|
}, z(e.timestamp), 3)) : $("", !0)
|
|
@@ -877,7 +878,7 @@ const ot = /* @__PURE__ */ N({
|
|
|
877
878
|
},
|
|
878
879
|
emits: ["close", "destroy"],
|
|
879
880
|
setup(e, { expose: s, emit: t }) {
|
|
880
|
-
const r = e, o = t, l = F("message"),
|
|
881
|
+
const r = e, o = t, l = F("message"), m = I(!1), g = I(Te()), v = {
|
|
881
882
|
success: "✓",
|
|
882
883
|
warning: "⚠",
|
|
883
884
|
error: "✕",
|
|
@@ -895,28 +896,28 @@ const ot = /* @__PURE__ */ N({
|
|
|
895
896
|
let p = null;
|
|
896
897
|
const w = () => {
|
|
897
898
|
r.duration > 0 && (p = setTimeout(() => {
|
|
898
|
-
|
|
899
|
+
d();
|
|
899
900
|
}, r.duration));
|
|
900
901
|
}, h = () => {
|
|
901
902
|
p && (clearTimeout(p), p = null);
|
|
902
|
-
},
|
|
903
|
-
var
|
|
904
|
-
|
|
903
|
+
}, d = () => {
|
|
904
|
+
var y;
|
|
905
|
+
m.value = !1, (y = r.onClose) == null || y.call(r), o("close");
|
|
905
906
|
}, n = () => {
|
|
906
907
|
o("destroy");
|
|
907
908
|
};
|
|
908
|
-
return
|
|
909
|
-
w(),
|
|
909
|
+
return be(() => {
|
|
910
|
+
w(), m.value = !0;
|
|
910
911
|
}), ue(() => {
|
|
911
912
|
h();
|
|
912
913
|
}), s({
|
|
913
|
-
close:
|
|
914
|
-
}), (
|
|
914
|
+
close: d
|
|
915
|
+
}), (y, u) => (f(), j(q, {
|
|
915
916
|
name: "x-message-fade",
|
|
916
917
|
onAfterLeave: n
|
|
917
918
|
}, {
|
|
918
919
|
default: D(() => [
|
|
919
|
-
|
|
920
|
+
m.value ? (f(), x("div", {
|
|
920
921
|
key: 0,
|
|
921
922
|
class: a(c.value),
|
|
922
923
|
style: O(k.value),
|
|
@@ -929,14 +930,14 @@ const ot = /* @__PURE__ */ N({
|
|
|
929
930
|
C("span", {
|
|
930
931
|
class: a(i(l).e("content"))
|
|
931
932
|
}, [
|
|
932
|
-
S(
|
|
933
|
+
S(y.$slots, "default", {}, () => [
|
|
933
934
|
H(z(e.message), 1)
|
|
934
935
|
])
|
|
935
936
|
], 2),
|
|
936
|
-
e.showClose ? (
|
|
937
|
+
e.showClose ? (f(), x("button", {
|
|
937
938
|
key: 0,
|
|
938
939
|
class: a(i(l).e("close")),
|
|
939
|
-
onClick:
|
|
940
|
+
onClick: d
|
|
940
941
|
}, " ✕ ", 2)) : $("", !0)
|
|
941
942
|
], 38)) : $("", !0)
|
|
942
943
|
]),
|
|
@@ -956,21 +957,21 @@ function xe(e) {
|
|
|
956
957
|
warning: { bg: "#fdf6ec", border: "#e6a23c", icon: "⚠" },
|
|
957
958
|
error: { bg: "#fef0f0", border: "#f56c6c", icon: "✕" },
|
|
958
959
|
info: { bg: "#f4f4f5", border: "#909399", icon: "ℹ" }
|
|
959
|
-
}, o = e.type || "info", l = r[o] || r.info,
|
|
960
|
+
}, o = e.type || "info", l = r[o] || r.info, m = Ce({
|
|
960
961
|
visible: !1,
|
|
961
962
|
offset: e.offset ?? 20
|
|
962
963
|
});
|
|
963
964
|
let g = e.offset ?? 20;
|
|
964
965
|
J.forEach((n) => {
|
|
965
|
-
const
|
|
966
|
-
|
|
967
|
-
}),
|
|
966
|
+
const y = n.container.firstElementChild;
|
|
967
|
+
y && y.offsetHeight && (g += y.offsetHeight + 16);
|
|
968
|
+
}), m.offset = g;
|
|
968
969
|
let v = null, c = !1;
|
|
969
970
|
const k = () => {
|
|
970
|
-
c || (
|
|
971
|
+
c || (m.visible = !1, setTimeout(() => {
|
|
971
972
|
if (c) return;
|
|
972
973
|
c = !0;
|
|
973
|
-
const n = J.findIndex((
|
|
974
|
+
const n = J.findIndex((y) => y.id === s);
|
|
974
975
|
n !== -1 && J.splice(n, 1);
|
|
975
976
|
try {
|
|
976
977
|
h.unmount();
|
|
@@ -985,7 +986,7 @@ function xe(e) {
|
|
|
985
986
|
v && (clearTimeout(v), v = null);
|
|
986
987
|
}, h = ve({
|
|
987
988
|
render() {
|
|
988
|
-
if (!
|
|
989
|
+
if (!m.visible) return null;
|
|
989
990
|
const n = [
|
|
990
991
|
// Icon
|
|
991
992
|
T("span", {
|
|
@@ -1024,8 +1025,8 @@ function xe(e) {
|
|
|
1024
1025
|
color: "#909399",
|
|
1025
1026
|
padding: "0"
|
|
1026
1027
|
},
|
|
1027
|
-
onClick: (
|
|
1028
|
-
|
|
1028
|
+
onClick: (y) => {
|
|
1029
|
+
y.stopPropagation(), k();
|
|
1029
1030
|
}
|
|
1030
1031
|
}, "✕")
|
|
1031
1032
|
), T("div", {
|
|
@@ -1033,7 +1034,7 @@ function xe(e) {
|
|
|
1033
1034
|
style: {
|
|
1034
1035
|
position: "fixed",
|
|
1035
1036
|
left: "50%",
|
|
1036
|
-
top: `${
|
|
1037
|
+
top: `${m.offset}px`,
|
|
1037
1038
|
transform: "translateX(-50%)",
|
|
1038
1039
|
display: "flex",
|
|
1039
1040
|
alignItems: "center",
|
|
@@ -1053,10 +1054,10 @@ function xe(e) {
|
|
|
1053
1054
|
}
|
|
1054
1055
|
});
|
|
1055
1056
|
h.mount(t), ee(() => {
|
|
1056
|
-
|
|
1057
|
+
m.visible = !0, p();
|
|
1057
1058
|
});
|
|
1058
|
-
const
|
|
1059
|
-
return J.push(
|
|
1059
|
+
const d = { id: s, app: h, container: t, close: k };
|
|
1060
|
+
return J.push(d), { close: k };
|
|
1060
1061
|
}
|
|
1061
1062
|
function Fe(e) {
|
|
1062
1063
|
return xe(typeof e == "string" ? { message: e } : e);
|
|
@@ -1087,17 +1088,17 @@ function de(e) {
|
|
|
1087
1088
|
const o = N({
|
|
1088
1089
|
name: "TMessageBox",
|
|
1089
1090
|
setup() {
|
|
1090
|
-
const g = I(!1), v = I(e.inputValue ?? ""), c = I(""), k = 2e3 + Q.length + 1, p = (
|
|
1091
|
+
const g = I(!1), v = I(e.inputValue ?? ""), c = I(""), k = 2e3 + Q.length + 1, p = (y) => {
|
|
1091
1092
|
r || (r = !0, g.value = !1, setTimeout(() => {
|
|
1092
|
-
const u = Q.findIndex((
|
|
1093
|
+
const u = Q.findIndex((b) => b.container === t);
|
|
1093
1094
|
u !== -1 && Q.splice(u, 1);
|
|
1094
1095
|
try {
|
|
1095
1096
|
l.unmount();
|
|
1096
1097
|
} catch {
|
|
1097
1098
|
}
|
|
1098
1099
|
t.parentNode && t.parentNode.removeChild(t), s({
|
|
1099
|
-
action:
|
|
1100
|
-
value:
|
|
1100
|
+
action: y,
|
|
1101
|
+
value: y === "confirm" ? v.value : void 0
|
|
1101
1102
|
});
|
|
1102
1103
|
}, 300));
|
|
1103
1104
|
}, w = () => {
|
|
@@ -1108,10 +1109,10 @@ function de(e) {
|
|
|
1108
1109
|
c.value = "", p("confirm");
|
|
1109
1110
|
}, h = () => {
|
|
1110
1111
|
p("cancel");
|
|
1111
|
-
},
|
|
1112
|
+
}, d = () => {
|
|
1112
1113
|
p("close");
|
|
1113
1114
|
}, n = () => {
|
|
1114
|
-
e.closeOnClickModal !== !1 &&
|
|
1115
|
+
e.closeOnClickModal !== !1 && d();
|
|
1115
1116
|
};
|
|
1116
1117
|
return ee(() => {
|
|
1117
1118
|
g.value = !0;
|
|
@@ -1122,7 +1123,7 @@ function de(e) {
|
|
|
1122
1123
|
zIndex: k,
|
|
1123
1124
|
handleConfirm: w,
|
|
1124
1125
|
handleCancel: h,
|
|
1125
|
-
handleClose:
|
|
1126
|
+
handleClose: d,
|
|
1126
1127
|
handleMaskClick: n
|
|
1127
1128
|
};
|
|
1128
1129
|
},
|
|
@@ -1234,7 +1235,7 @@ function de(e) {
|
|
|
1234
1235
|
}
|
|
1235
1236
|
}), l = ve(o);
|
|
1236
1237
|
l.mount(t);
|
|
1237
|
-
const
|
|
1238
|
+
const m = {
|
|
1238
1239
|
app: l,
|
|
1239
1240
|
container: t,
|
|
1240
1241
|
close: () => {
|
|
@@ -1243,7 +1244,7 @@ function de(e) {
|
|
|
1243
1244
|
g != null && g.handleClose && g.handleClose();
|
|
1244
1245
|
}
|
|
1245
1246
|
};
|
|
1246
|
-
Q.push(
|
|
1247
|
+
Q.push(m);
|
|
1247
1248
|
});
|
|
1248
1249
|
}
|
|
1249
1250
|
async function je(e, s, t) {
|
|
@@ -1332,14 +1333,14 @@ function we(e) {
|
|
|
1332
1333
|
const s = Ue++, t = e.position || "top-right", r = document.createElement("div");
|
|
1333
1334
|
document.body.appendChild(r);
|
|
1334
1335
|
let o = null, l = !1;
|
|
1335
|
-
const
|
|
1336
|
+
const m = N({
|
|
1336
1337
|
name: "TNotification",
|
|
1337
1338
|
setup() {
|
|
1338
1339
|
const c = I(!1), k = () => {
|
|
1339
1340
|
l || (l = !0, c.value = !1, setTimeout(() => {
|
|
1340
|
-
var
|
|
1341
|
+
var y;
|
|
1341
1342
|
const n = _.findIndex((u) => u.id === s);
|
|
1342
|
-
n !== -1 && _.splice(n, 1), o && clearTimeout(o), (
|
|
1343
|
+
n !== -1 && _.splice(n, 1), o && clearTimeout(o), (y = e.onClose) == null || y.call(e);
|
|
1343
1344
|
try {
|
|
1344
1345
|
g.unmount();
|
|
1345
1346
|
} catch {
|
|
@@ -1351,13 +1352,13 @@ function we(e) {
|
|
|
1351
1352
|
n > 0 && (o = setTimeout(k, n));
|
|
1352
1353
|
}, w = () => {
|
|
1353
1354
|
o && (clearTimeout(o), o = null);
|
|
1354
|
-
}, h = L(() => (e.offset ?? 0) + Je(t, s)),
|
|
1355
|
+
}, h = L(() => (e.offset ?? 0) + Je(t, s)), d = L(() => Qe(t, h.value));
|
|
1355
1356
|
return ee(() => {
|
|
1356
1357
|
c.value = !0, p();
|
|
1357
1358
|
}), {
|
|
1358
1359
|
visible: c,
|
|
1359
1360
|
close: k,
|
|
1360
|
-
positionStyles:
|
|
1361
|
+
positionStyles: d,
|
|
1361
1362
|
startTimer: p,
|
|
1362
1363
|
clearTimer: w
|
|
1363
1364
|
};
|
|
@@ -1452,7 +1453,7 @@ function we(e) {
|
|
|
1452
1453
|
onMouseleave: this.startTimer
|
|
1453
1454
|
}, w);
|
|
1454
1455
|
}
|
|
1455
|
-
}), g = ve(
|
|
1456
|
+
}), g = ve(m);
|
|
1456
1457
|
g.mount(r);
|
|
1457
1458
|
const v = {
|
|
1458
1459
|
id: s,
|