@xto/feedback 1.2.7 → 1.3.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 +368 -367
- package/es/style.css +1 -1
- package/lib/index.cjs +1 -1
- package/lib/style.css +1 -1
- package/package.json +3 -3
package/es/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useNamespace as
|
|
3
|
-
const
|
|
1
|
+
import { defineComponent as S, computed as $, openBlock as u, createElementBlock as f, normalizeStyle as A, normalizeClass as s, createElementVNode as z, renderSlot as L, createTextVNode as P, toDisplayString as H, ref as E, watch as ae, resolveComponent as ze, createBlock as Z, Teleport as oe, createVNode as I, Transition as K, withCtx as N, unref as o, withModifiers as re, createCommentVNode as C, withDirectives as ce, vShow as ue, Fragment as Me, renderList as be, nextTick as te, onUnmounted as de, onMounted as xe, reactive as Ce, createApp as ge, h as k } from "vue";
|
|
2
|
+
import { useNamespace as W, useZIndex as Be, useEscape as Ve, nextMessageZIndex as Le } from "@xto/core";
|
|
3
|
+
const ye = {
|
|
4
4
|
// 箭头类
|
|
5
5
|
"arrow-up": "M12 19V5m0 0l-7 7m7-7l7 7",
|
|
6
6
|
"arrow-down": "M12 5v14m0 0l7-7m-7 7l-7-7",
|
|
@@ -201,10 +201,10 @@ const we = {
|
|
|
201
201
|
up: "M5 15l7-7 7 7"
|
|
202
202
|
// 上箭头
|
|
203
203
|
};
|
|
204
|
-
function
|
|
205
|
-
return e in
|
|
204
|
+
function He(e) {
|
|
205
|
+
return e in ye;
|
|
206
206
|
}
|
|
207
|
-
const
|
|
207
|
+
const $e = ["aria-hidden", "aria-label"], Te = ["stroke-width"], Ee = ["d"], D = /* @__PURE__ */ S({
|
|
208
208
|
name: "XIcon",
|
|
209
209
|
__name: "index",
|
|
210
210
|
props: {
|
|
@@ -215,23 +215,23 @@ const Be = ["aria-hidden", "aria-label"], Te = ["stroke-width"], Ie = ["d"], X =
|
|
|
215
215
|
strokeWidth: { default: 2 }
|
|
216
216
|
},
|
|
217
217
|
setup(e, { expose: n }) {
|
|
218
|
-
const t = e, r =
|
|
218
|
+
const t = e, r = W("icon"), a = $(() => typeof t.size == "number" ? `${t.size}px` : t.size), i = $(() => ({
|
|
219
219
|
width: a.value,
|
|
220
220
|
height: a.value,
|
|
221
221
|
color: t.color
|
|
222
|
-
})), m =
|
|
222
|
+
})), m = $(() => ({
|
|
223
223
|
strokeWidth: t.strokeWidth
|
|
224
|
-
})),
|
|
224
|
+
})), M = $(() => [
|
|
225
225
|
r.b(),
|
|
226
226
|
r.is("spin", t.spin)
|
|
227
|
-
]), v =
|
|
227
|
+
]), v = $(() => t.name && He(t.name) ? ye[t.name] : "");
|
|
228
228
|
return n({
|
|
229
229
|
iconSize: a,
|
|
230
230
|
iconStyle: i,
|
|
231
231
|
iconPath: v
|
|
232
|
-
}), (c,
|
|
233
|
-
class: s(
|
|
234
|
-
style:
|
|
232
|
+
}), (c, w) => (u(), f("span", {
|
|
233
|
+
class: s(M.value),
|
|
234
|
+
style: A(i.value),
|
|
235
235
|
"aria-hidden": !e.name,
|
|
236
236
|
"aria-label": e.name,
|
|
237
237
|
role: "img"
|
|
@@ -244,16 +244,16 @@ const Be = ["aria-hidden", "aria-label"], Te = ["stroke-width"], Ie = ["d"], X =
|
|
|
244
244
|
"stroke-width": e.strokeWidth,
|
|
245
245
|
"stroke-linecap": "round",
|
|
246
246
|
"stroke-linejoin": "round",
|
|
247
|
-
style:
|
|
247
|
+
style: A(m.value),
|
|
248
248
|
"aria-hidden": "true"
|
|
249
249
|
}, [
|
|
250
|
-
z("path", { d: v.value }, null, 8,
|
|
251
|
-
], 12, Te)) :
|
|
252
|
-
|
|
250
|
+
z("path", { d: v.value }, null, 8, Ee)
|
|
251
|
+
], 12, Te)) : L(c.$slots, "default", { key: 1 }, () => [
|
|
252
|
+
P(H(e.name), 1)
|
|
253
253
|
])
|
|
254
|
-
], 14,
|
|
254
|
+
], 14, $e));
|
|
255
255
|
}
|
|
256
|
-
}), rt = /* @__PURE__ */
|
|
256
|
+
}), rt = /* @__PURE__ */ S({
|
|
257
257
|
name: "XModal",
|
|
258
258
|
inheritAttrs: !1,
|
|
259
259
|
__name: "index",
|
|
@@ -272,45 +272,45 @@ const Be = ["aria-hidden", "aria-label"], Te = ["stroke-width"], Ie = ["d"], X =
|
|
|
272
272
|
},
|
|
273
273
|
emits: ["update:modelValue", "update:open", "close", "open", "ok", "cancel"],
|
|
274
274
|
setup(e, { emit: n }) {
|
|
275
|
-
const t = e, r = n, a =
|
|
275
|
+
const t = e, r = n, a = W("modal"), { next: i } = Be(), m = E(i()), M = $({
|
|
276
276
|
get: () => t.modelValue !== void 0 ? t.modelValue : t.open !== void 0 ? t.open : !1,
|
|
277
277
|
set: (h) => {
|
|
278
278
|
t.modelValue !== void 0 && r("update:modelValue", h), t.open !== void 0 && r("update:open", h), t.modelValue === void 0 && t.open === void 0 && r("update:modelValue", h);
|
|
279
279
|
}
|
|
280
|
-
}), v =
|
|
281
|
-
|
|
282
|
-
},
|
|
280
|
+
}), v = E(), c = () => {
|
|
281
|
+
M.value = !1, r("cancel"), r("close");
|
|
282
|
+
}, w = () => {
|
|
283
283
|
r("ok");
|
|
284
284
|
}, p = () => {
|
|
285
285
|
t.closeOnClickModal && t.modal && c();
|
|
286
286
|
};
|
|
287
|
-
|
|
288
|
-
t.closeOnPressEscape &&
|
|
287
|
+
Ve(() => {
|
|
288
|
+
t.closeOnPressEscape && M.value && c();
|
|
289
289
|
}), ae(() => [t.modelValue, t.open], ([h, l]) => {
|
|
290
290
|
(h !== void 0 ? h : l) && (m.value = i(), r("open"));
|
|
291
291
|
}, { immediate: !0 });
|
|
292
|
-
const
|
|
292
|
+
const y = $(() => ({
|
|
293
293
|
paddingTop: t.top
|
|
294
|
-
})),
|
|
294
|
+
})), g = $(() => ({
|
|
295
295
|
width: typeof t.width == "number" ? `${t.width}px` : t.width,
|
|
296
296
|
zIndex: m.value
|
|
297
297
|
}));
|
|
298
298
|
return (h, l) => {
|
|
299
299
|
const b = ze("x-button");
|
|
300
300
|
return u(), Z(oe, { to: "body" }, [
|
|
301
|
-
|
|
302
|
-
default:
|
|
303
|
-
|
|
301
|
+
I(K, { name: "x-modal-fade" }, {
|
|
302
|
+
default: N(() => [
|
|
303
|
+
M.value ? (u(), f("div", {
|
|
304
304
|
key: 0,
|
|
305
305
|
class: s(o(a).e("wrapper")),
|
|
306
|
-
style:
|
|
306
|
+
style: A(y.value),
|
|
307
307
|
onClick: p
|
|
308
308
|
}, [
|
|
309
309
|
z("div", {
|
|
310
310
|
ref_key: "modalRef",
|
|
311
311
|
ref: v,
|
|
312
312
|
class: s(o(a).b()),
|
|
313
|
-
style:
|
|
313
|
+
style: A(g.value),
|
|
314
314
|
onClick: l[0] || (l[0] = re(() => {
|
|
315
315
|
}, ["stop"]))
|
|
316
316
|
}, [
|
|
@@ -320,8 +320,8 @@ const Be = ["aria-hidden", "aria-label"], Te = ["stroke-width"], Ie = ["d"], X =
|
|
|
320
320
|
z("span", {
|
|
321
321
|
class: s(o(a).e("title"))
|
|
322
322
|
}, [
|
|
323
|
-
|
|
324
|
-
|
|
323
|
+
L(h.$slots, "title", {}, () => [
|
|
324
|
+
P(H(e.title), 1)
|
|
325
325
|
])
|
|
326
326
|
], 2),
|
|
327
327
|
e.showClose ? (u(), f("button", {
|
|
@@ -329,7 +329,7 @@ const Be = ["aria-hidden", "aria-label"], Te = ["stroke-width"], Ie = ["d"], X =
|
|
|
329
329
|
class: s(o(a).e("close")),
|
|
330
330
|
onClick: c
|
|
331
331
|
}, [
|
|
332
|
-
|
|
332
|
+
I(o(D), {
|
|
333
333
|
name: "close",
|
|
334
334
|
size: 16
|
|
335
335
|
})
|
|
@@ -338,33 +338,33 @@ const Be = ["aria-hidden", "aria-label"], Te = ["stroke-width"], Ie = ["d"], X =
|
|
|
338
338
|
z("div", {
|
|
339
339
|
class: s(o(a).e("body"))
|
|
340
340
|
}, [
|
|
341
|
-
|
|
341
|
+
L(h.$slots, "default")
|
|
342
342
|
], 2),
|
|
343
343
|
h.$slots.footer ? (u(), f("div", {
|
|
344
344
|
key: 0,
|
|
345
345
|
class: s(o(a).e("footer"))
|
|
346
346
|
}, [
|
|
347
|
-
|
|
348
|
-
ok:
|
|
347
|
+
L(h.$slots, "footer", {
|
|
348
|
+
ok: w,
|
|
349
349
|
cancel: c
|
|
350
350
|
})
|
|
351
351
|
], 2)) : h.$slots.footer ? C("", !0) : (u(), f("div", {
|
|
352
352
|
key: 1,
|
|
353
353
|
class: s(o(a).e("footer"))
|
|
354
354
|
}, [
|
|
355
|
-
|
|
356
|
-
default:
|
|
357
|
-
|
|
355
|
+
I(b, { onClick: c }, {
|
|
356
|
+
default: N(() => [...l[1] || (l[1] = [
|
|
357
|
+
P("取消", -1)
|
|
358
358
|
])]),
|
|
359
359
|
_: 1
|
|
360
360
|
}),
|
|
361
|
-
|
|
361
|
+
I(b, {
|
|
362
362
|
type: "primary",
|
|
363
363
|
style: { "margin-left": "8px" },
|
|
364
|
-
onClick:
|
|
364
|
+
onClick: w
|
|
365
365
|
}, {
|
|
366
|
-
default:
|
|
367
|
-
|
|
366
|
+
default: N(() => [...l[2] || (l[2] = [
|
|
367
|
+
P("确定", -1)
|
|
368
368
|
])]),
|
|
369
369
|
_: 1
|
|
370
370
|
})
|
|
@@ -377,7 +377,7 @@ const Be = ["aria-hidden", "aria-label"], Te = ["stroke-width"], Ie = ["d"], X =
|
|
|
377
377
|
]);
|
|
378
378
|
};
|
|
379
379
|
}
|
|
380
|
-
}), ct = /* @__PURE__ */
|
|
380
|
+
}), ct = /* @__PURE__ */ S({
|
|
381
381
|
name: "XDrawer",
|
|
382
382
|
inheritAttrs: !1,
|
|
383
383
|
__name: "index",
|
|
@@ -396,9 +396,9 @@ const Be = ["aria-hidden", "aria-label"], Te = ["stroke-width"], Ie = ["d"], X =
|
|
|
396
396
|
},
|
|
397
397
|
emits: ["update:modelValue", "close", "open"],
|
|
398
398
|
setup(e, { emit: n }) {
|
|
399
|
-
const t = e, r = n, a =
|
|
399
|
+
const t = e, r = n, a = W("drawer"), i = E(2e3), m = () => {
|
|
400
400
|
r("update:modelValue", !1), r("close");
|
|
401
|
-
},
|
|
401
|
+
}, M = () => {
|
|
402
402
|
t.closeOnClickModal && m();
|
|
403
403
|
}, v = (p) => {
|
|
404
404
|
p.key === "Escape" && t.modelValue && m();
|
|
@@ -406,29 +406,29 @@ const Be = ["aria-hidden", "aria-label"], Te = ["stroke-width"], Ie = ["d"], X =
|
|
|
406
406
|
ae(() => t.modelValue, (p) => {
|
|
407
407
|
p ? (i.value = 2e3 + Math.floor(Math.random() * 100), r("open"), document.addEventListener("keydown", v)) : document.removeEventListener("keydown", v);
|
|
408
408
|
});
|
|
409
|
-
const c =
|
|
409
|
+
const c = $(() => ({
|
|
410
410
|
zIndex: i.value
|
|
411
|
-
})),
|
|
412
|
-
const p = t.direction ?? t.placement ?? "rtl",
|
|
411
|
+
})), w = $(() => {
|
|
412
|
+
const p = t.direction ?? t.placement ?? "rtl", y = t.size ?? t.width ?? "30%", g = typeof y == "number" ? `${y}px` : y;
|
|
413
413
|
return {
|
|
414
|
-
ltr: { width:
|
|
415
|
-
rtl: { width:
|
|
416
|
-
ttb: { width: "100%", height:
|
|
417
|
-
btt: { width: "100%", height:
|
|
414
|
+
ltr: { width: g, height: "100%" },
|
|
415
|
+
rtl: { width: g, height: "100%" },
|
|
416
|
+
ttb: { width: "100%", height: g },
|
|
417
|
+
btt: { width: "100%", height: g }
|
|
418
418
|
}[p];
|
|
419
419
|
});
|
|
420
|
-
return (p,
|
|
421
|
-
|
|
422
|
-
default:
|
|
420
|
+
return (p, y) => (u(), Z(oe, { to: "body" }, [
|
|
421
|
+
I(K, { name: "x-drawer-fade" }, {
|
|
422
|
+
default: N(() => [
|
|
423
423
|
ce(z("div", {
|
|
424
424
|
class: s([o(a).e("overlay"), { [o(a).em("overlay", "no-modal")]: !e.modal }]),
|
|
425
|
-
style:
|
|
426
|
-
onClick:
|
|
425
|
+
style: A(c.value),
|
|
426
|
+
onClick: M
|
|
427
427
|
}, [
|
|
428
428
|
z("div", {
|
|
429
429
|
class: s([o(a).b(), o(a).m(e.direction ?? e.placement ?? "rtl")]),
|
|
430
|
-
style:
|
|
431
|
-
onClick:
|
|
430
|
+
style: A(w.value),
|
|
431
|
+
onClick: y[0] || (y[0] = re(() => {
|
|
432
432
|
}, ["stop"]))
|
|
433
433
|
}, [
|
|
434
434
|
e.withHeader ? (u(), f("div", {
|
|
@@ -438,8 +438,8 @@ const Be = ["aria-hidden", "aria-label"], Te = ["stroke-width"], Ie = ["d"], X =
|
|
|
438
438
|
z("span", {
|
|
439
439
|
class: s(o(a).e("title"))
|
|
440
440
|
}, [
|
|
441
|
-
|
|
442
|
-
|
|
441
|
+
L(p.$slots, "title", {}, () => [
|
|
442
|
+
P(H(e.title), 1)
|
|
443
443
|
])
|
|
444
444
|
], 2),
|
|
445
445
|
e.showClose ? (u(), f("button", {
|
|
@@ -447,7 +447,7 @@ const Be = ["aria-hidden", "aria-label"], Te = ["stroke-width"], Ie = ["d"], X =
|
|
|
447
447
|
class: s(o(a).e("close")),
|
|
448
448
|
onClick: m
|
|
449
449
|
}, [
|
|
450
|
-
|
|
450
|
+
I(o(D), {
|
|
451
451
|
name: "close",
|
|
452
452
|
size: 18
|
|
453
453
|
})
|
|
@@ -456,13 +456,13 @@ const Be = ["aria-hidden", "aria-label"], Te = ["stroke-width"], Ie = ["d"], X =
|
|
|
456
456
|
z("div", {
|
|
457
457
|
class: s([o(a).e("body"), p.$slots.footer && o(a).em("body", "has-footer")])
|
|
458
458
|
}, [
|
|
459
|
-
|
|
459
|
+
L(p.$slots, "default")
|
|
460
460
|
], 2),
|
|
461
461
|
p.$slots.footer ? (u(), f("div", {
|
|
462
462
|
key: 1,
|
|
463
463
|
class: s(o(a).e("footer"))
|
|
464
464
|
}, [
|
|
465
|
-
|
|
465
|
+
L(p.$slots, "footer")
|
|
466
466
|
], 2)) : C("", !0)
|
|
467
467
|
], 6)
|
|
468
468
|
], 6), [
|
|
@@ -473,10 +473,10 @@ const Be = ["aria-hidden", "aria-label"], Te = ["stroke-width"], Ie = ["d"], X =
|
|
|
473
473
|
})
|
|
474
474
|
]));
|
|
475
475
|
}
|
|
476
|
-
}),
|
|
476
|
+
}), Ie = {
|
|
477
477
|
key: 0,
|
|
478
478
|
class: "required-mark"
|
|
479
|
-
},
|
|
479
|
+
}, Fe = ["value", "placeholder", "disabled", "onInput"], Ae = ["value", "placeholder", "disabled", "onInput"], Pe = ["value", "placeholder", "disabled", "onInput"], Se = ["value", "disabled", "onChange"], Re = ["value"], Oe = ["disabled", "onClick"], ut = /* @__PURE__ */ S({
|
|
480
480
|
name: "XDrawerForm",
|
|
481
481
|
__name: "index",
|
|
482
482
|
props: {
|
|
@@ -494,48 +494,48 @@ const Be = ["aria-hidden", "aria-label"], Te = ["stroke-width"], Ie = ["d"], X =
|
|
|
494
494
|
},
|
|
495
495
|
emits: ["update:modelValue", "confirm", "cancel", "close", "field-change"],
|
|
496
496
|
setup(e, { emit: n }) {
|
|
497
|
-
const t = e, r = n, a =
|
|
498
|
-
|
|
497
|
+
const t = e, r = n, a = W("drawer-form"), i = E({}), m = E({});
|
|
498
|
+
$(() => [
|
|
499
499
|
a.b()
|
|
500
|
-
]), ae(() => t.formData, (
|
|
501
|
-
i.value = { ...
|
|
500
|
+
]), ae(() => t.formData, (g) => {
|
|
501
|
+
i.value = { ...g };
|
|
502
502
|
}, { immediate: !0, deep: !0 });
|
|
503
|
-
const
|
|
503
|
+
const M = $(() => typeof t.size == "number" ? `${t.size}px` : t.size), v = () => {
|
|
504
504
|
r("update:modelValue", !1), r("close");
|
|
505
505
|
}, c = () => {
|
|
506
506
|
r("cancel"), v();
|
|
507
|
-
},
|
|
507
|
+
}, w = () => {
|
|
508
508
|
p() && (r("confirm", i.value), v());
|
|
509
509
|
}, p = () => {
|
|
510
510
|
m.value = {};
|
|
511
|
-
for (const
|
|
512
|
-
if (
|
|
513
|
-
const h = i.value[
|
|
511
|
+
for (const g of t.fields) {
|
|
512
|
+
if (g.required) {
|
|
513
|
+
const h = i.value[g.name];
|
|
514
514
|
if (h == null || h === "") {
|
|
515
|
-
m.value[
|
|
515
|
+
m.value[g.name] = `${g.label}为必填项`;
|
|
516
516
|
continue;
|
|
517
517
|
}
|
|
518
518
|
}
|
|
519
|
-
if (
|
|
520
|
-
for (const h of
|
|
521
|
-
const l = i.value[
|
|
522
|
-
h.type === "email" && l && !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(l) && (m.value[
|
|
519
|
+
if (g.rules)
|
|
520
|
+
for (const h of g.rules) {
|
|
521
|
+
const l = i.value[g.name];
|
|
522
|
+
h.type === "email" && l && !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(l) && (m.value[g.name] = h.message), h.type === "minLength" && l && l.length < h.min && (m.value[g.name] = h.message);
|
|
523
523
|
}
|
|
524
524
|
}
|
|
525
525
|
return Object.keys(m.value).length === 0;
|
|
526
|
-
},
|
|
527
|
-
i.value[
|
|
526
|
+
}, y = (g, h) => {
|
|
527
|
+
i.value[g] = h, r("field-change", g, h);
|
|
528
528
|
};
|
|
529
|
-
return (
|
|
530
|
-
|
|
531
|
-
default:
|
|
529
|
+
return (g, h) => (u(), Z(oe, { to: "body" }, [
|
|
530
|
+
I(K, { name: "drawer-form-fade" }, {
|
|
531
|
+
default: N(() => [
|
|
532
532
|
ce(z("div", {
|
|
533
533
|
class: s(o(a).e("overlay")),
|
|
534
534
|
onClick: v
|
|
535
535
|
}, [
|
|
536
536
|
z("div", {
|
|
537
537
|
class: s(o(a).b()),
|
|
538
|
-
style:
|
|
538
|
+
style: A({ width: M.value }),
|
|
539
539
|
onClick: h[0] || (h[0] = re(() => {
|
|
540
540
|
}, ["stop"]))
|
|
541
541
|
}, [
|
|
@@ -544,12 +544,12 @@ const Be = ["aria-hidden", "aria-label"], Te = ["stroke-width"], Ie = ["d"], X =
|
|
|
544
544
|
}, [
|
|
545
545
|
z("span", {
|
|
546
546
|
class: s(o(a).e("title"))
|
|
547
|
-
},
|
|
547
|
+
}, H(e.title), 3),
|
|
548
548
|
z("button", {
|
|
549
549
|
class: s(o(a).e("close")),
|
|
550
550
|
onClick: v
|
|
551
551
|
}, [
|
|
552
|
-
|
|
552
|
+
I(o(D), {
|
|
553
553
|
name: "close",
|
|
554
554
|
size: 16
|
|
555
555
|
})
|
|
@@ -562,15 +562,15 @@ const Be = ["aria-hidden", "aria-label"], Te = ["stroke-width"], Ie = ["d"], X =
|
|
|
562
562
|
key: 0,
|
|
563
563
|
class: s(o(a).e("form"))
|
|
564
564
|
}, [
|
|
565
|
-
(u(!0), f(
|
|
565
|
+
(u(!0), f(Me, null, be(e.fields, (l) => (u(), f("div", {
|
|
566
566
|
key: l.name,
|
|
567
567
|
class: s(o(a).e("field"))
|
|
568
568
|
}, [
|
|
569
569
|
z("label", {
|
|
570
570
|
class: s(o(a).e("label"))
|
|
571
571
|
}, [
|
|
572
|
-
|
|
573
|
-
l.required ? (u(), f("span",
|
|
572
|
+
P(H(l.label) + " ", 1),
|
|
573
|
+
l.required ? (u(), f("span", Ie, "*")) : C("", !0)
|
|
574
574
|
], 2),
|
|
575
575
|
l.type === "input" ? (u(), f("input", {
|
|
576
576
|
key: 0,
|
|
@@ -578,48 +578,48 @@ const Be = ["aria-hidden", "aria-label"], Te = ["stroke-width"], Ie = ["d"], X =
|
|
|
578
578
|
value: i.value[l.name],
|
|
579
579
|
placeholder: l.placeholder,
|
|
580
580
|
disabled: e.disabled || l.disabled,
|
|
581
|
-
onInput: (b) =>
|
|
582
|
-
}, null, 42,
|
|
581
|
+
onInput: (b) => y(l.name, b.target.value)
|
|
582
|
+
}, null, 42, Fe)) : l.type === "textarea" ? (u(), f("textarea", {
|
|
583
583
|
key: 1,
|
|
584
584
|
class: s([o(a).e("textarea"), { "has-error": m.value[l.name] }]),
|
|
585
585
|
value: i.value[l.name],
|
|
586
586
|
placeholder: l.placeholder,
|
|
587
587
|
disabled: e.disabled || l.disabled,
|
|
588
588
|
rows: "4",
|
|
589
|
-
onInput: (b) =>
|
|
590
|
-
}, null, 42,
|
|
589
|
+
onInput: (b) => y(l.name, b.target.value)
|
|
590
|
+
}, null, 42, Ae)) : l.type === "number" ? (u(), f("input", {
|
|
591
591
|
key: 2,
|
|
592
592
|
type: "number",
|
|
593
593
|
class: s([o(a).e("input"), { "has-error": m.value[l.name] }]),
|
|
594
594
|
value: i.value[l.name],
|
|
595
595
|
placeholder: l.placeholder,
|
|
596
596
|
disabled: e.disabled || l.disabled,
|
|
597
|
-
onInput: (b) =>
|
|
598
|
-
}, null, 42,
|
|
597
|
+
onInput: (b) => y(l.name, Number(b.target.value))
|
|
598
|
+
}, null, 42, Pe)) : l.type === "select" ? (u(), f("select", {
|
|
599
599
|
key: 3,
|
|
600
600
|
class: s([o(a).e("select"), { "has-error": m.value[l.name] }]),
|
|
601
601
|
value: i.value[l.name],
|
|
602
602
|
disabled: e.disabled || l.disabled,
|
|
603
|
-
onChange: (b) =>
|
|
603
|
+
onChange: (b) => y(l.name, b.target.value)
|
|
604
604
|
}, [
|
|
605
|
-
(u(!0), f(
|
|
605
|
+
(u(!0), f(Me, null, be(l.options, (b) => (u(), f("option", {
|
|
606
606
|
key: b.value,
|
|
607
607
|
value: b.value
|
|
608
|
-
},
|
|
609
|
-
], 42,
|
|
608
|
+
}, H(b.label), 9, Re))), 128))
|
|
609
|
+
], 42, Se)) : l.type === "switch" ? (u(), f("div", {
|
|
610
610
|
key: 4,
|
|
611
611
|
class: s(o(a).e("switch"))
|
|
612
612
|
}, [
|
|
613
613
|
z("button", {
|
|
614
614
|
class: s(["switch-btn", { "is-on": i.value[l.name] }]),
|
|
615
615
|
disabled: e.disabled || l.disabled,
|
|
616
|
-
onClick: (b) =>
|
|
617
|
-
},
|
|
616
|
+
onClick: (b) => y(l.name, !i.value[l.name])
|
|
617
|
+
}, H(i.value[l.name] ? "开启" : "关闭"), 11, Oe)
|
|
618
618
|
], 2)) : C("", !0),
|
|
619
619
|
m.value[l.name] ? (u(), f("span", {
|
|
620
620
|
key: 5,
|
|
621
621
|
class: s(o(a).e("error"))
|
|
622
|
-
},
|
|
622
|
+
}, H(m.value[l.name]), 3)) : C("", !0)
|
|
623
623
|
], 2))), 128))
|
|
624
624
|
], 2)) : C("", !0)
|
|
625
625
|
], 2),
|
|
@@ -630,12 +630,12 @@ const Be = ["aria-hidden", "aria-label"], Te = ["stroke-width"], Ie = ["d"], X =
|
|
|
630
630
|
key: 0,
|
|
631
631
|
class: s(o(a).e("cancel")),
|
|
632
632
|
onClick: c
|
|
633
|
-
},
|
|
633
|
+
}, H(e.cancelText), 3)) : C("", !0),
|
|
634
634
|
e.showConfirm ? (u(), f("button", {
|
|
635
635
|
key: 1,
|
|
636
636
|
class: s(o(a).e("confirm")),
|
|
637
|
-
onClick:
|
|
638
|
-
},
|
|
637
|
+
onClick: w
|
|
638
|
+
}, H(e.confirmText), 3)) : C("", !0)
|
|
639
639
|
], 2)
|
|
640
640
|
], 6)
|
|
641
641
|
], 2), [
|
|
@@ -646,7 +646,7 @@ const Be = ["aria-hidden", "aria-label"], Te = ["stroke-width"], Ie = ["d"], X =
|
|
|
646
646
|
})
|
|
647
647
|
]));
|
|
648
648
|
}
|
|
649
|
-
}), dt = /* @__PURE__ */
|
|
649
|
+
}), dt = /* @__PURE__ */ S({
|
|
650
650
|
name: "XAlert",
|
|
651
651
|
__name: "index",
|
|
652
652
|
props: {
|
|
@@ -659,12 +659,12 @@ const Be = ["aria-hidden", "aria-label"], Te = ["stroke-width"], Ie = ["d"], X =
|
|
|
659
659
|
},
|
|
660
660
|
emits: ["close"],
|
|
661
661
|
setup(e, { emit: n }) {
|
|
662
|
-
const t = e, r = n, a =
|
|
662
|
+
const t = e, r = n, a = W("alert"), i = E(!0), m = {
|
|
663
663
|
success: "check",
|
|
664
664
|
warning: "warning",
|
|
665
665
|
error: "close-circle",
|
|
666
666
|
info: "info"
|
|
667
|
-
},
|
|
667
|
+
}, M = $(() => [
|
|
668
668
|
a.b(),
|
|
669
669
|
a.m(t.type),
|
|
670
670
|
a.is("center", t.center),
|
|
@@ -672,17 +672,17 @@ const Be = ["aria-hidden", "aria-label"], Te = ["stroke-width"], Ie = ["d"], X =
|
|
|
672
672
|
]), v = (c) => {
|
|
673
673
|
i.value = !1, r("close", c);
|
|
674
674
|
};
|
|
675
|
-
return (c,
|
|
676
|
-
default:
|
|
675
|
+
return (c, w) => (u(), Z(K, { name: "x-alert-fade" }, {
|
|
676
|
+
default: N(() => [
|
|
677
677
|
i.value ? (u(), f("div", {
|
|
678
678
|
key: 0,
|
|
679
|
-
class: s(
|
|
679
|
+
class: s(M.value)
|
|
680
680
|
}, [
|
|
681
681
|
e.showIcon ? (u(), f("span", {
|
|
682
682
|
key: 0,
|
|
683
683
|
class: s(o(a).e("icon"))
|
|
684
684
|
}, [
|
|
685
|
-
|
|
685
|
+
I(o(D), {
|
|
686
686
|
name: m[e.type],
|
|
687
687
|
size: 16
|
|
688
688
|
}, null, 8, ["name"])
|
|
@@ -694,16 +694,16 @@ const Be = ["aria-hidden", "aria-label"], Te = ["stroke-width"], Ie = ["d"], X =
|
|
|
694
694
|
key: 0,
|
|
695
695
|
class: s(o(a).e("title"))
|
|
696
696
|
}, [
|
|
697
|
-
|
|
698
|
-
|
|
697
|
+
L(c.$slots, "title", {}, () => [
|
|
698
|
+
P(H(e.title), 1)
|
|
699
699
|
])
|
|
700
700
|
], 2)) : C("", !0),
|
|
701
701
|
e.description || c.$slots.default ? (u(), f("span", {
|
|
702
702
|
key: 1,
|
|
703
703
|
class: s(o(a).e("description"))
|
|
704
704
|
}, [
|
|
705
|
-
|
|
706
|
-
|
|
705
|
+
L(c.$slots, "default", {}, () => [
|
|
706
|
+
P(H(e.description), 1)
|
|
707
707
|
])
|
|
708
708
|
], 2)) : C("", !0)
|
|
709
709
|
], 2),
|
|
@@ -712,7 +712,7 @@ const Be = ["aria-hidden", "aria-label"], Te = ["stroke-width"], Ie = ["d"], X =
|
|
|
712
712
|
class: s(o(a).e("close")),
|
|
713
713
|
onClick: v
|
|
714
714
|
}, [
|
|
715
|
-
|
|
715
|
+
I(o(D), {
|
|
716
716
|
name: "close",
|
|
717
717
|
size: 14
|
|
718
718
|
})
|
|
@@ -722,7 +722,7 @@ const Be = ["aria-hidden", "aria-label"], Te = ["stroke-width"], Ie = ["d"], X =
|
|
|
722
722
|
_: 3
|
|
723
723
|
}));
|
|
724
724
|
}
|
|
725
|
-
}), mt = /* @__PURE__ */
|
|
725
|
+
}), mt = /* @__PURE__ */ S({
|
|
726
726
|
name: "XTooltip",
|
|
727
727
|
__name: "index",
|
|
728
728
|
props: {
|
|
@@ -739,36 +739,36 @@ const Be = ["aria-hidden", "aria-label"], Te = ["stroke-width"], Ie = ["d"], X =
|
|
|
739
739
|
},
|
|
740
740
|
emits: ["update:visible", "show", "hide"],
|
|
741
741
|
setup(e, { emit: n }) {
|
|
742
|
-
const t = e, r = n, a =
|
|
742
|
+
const t = e, r = n, a = W("tooltip"), i = E(!1), m = E(), M = E();
|
|
743
743
|
let v, c;
|
|
744
|
-
const
|
|
745
|
-
if (!m.value || !
|
|
746
|
-
const
|
|
747
|
-
|
|
748
|
-
const
|
|
749
|
-
let
|
|
744
|
+
const w = E({}), p = () => {
|
|
745
|
+
if (!m.value || !M.value) return;
|
|
746
|
+
const V = m.value.getBoundingClientRect(), X = M.value;
|
|
747
|
+
X.style.visibility = "hidden", X.style.display = "block";
|
|
748
|
+
const j = X.offsetWidth, U = X.offsetHeight, q = t.offset, he = window.innerWidth, fe = window.innerHeight;
|
|
749
|
+
let R = 0, O = 0, J = t.placement;
|
|
750
750
|
switch (t.placement) {
|
|
751
751
|
case "top":
|
|
752
|
-
|
|
752
|
+
R = V.top - U - q, O = V.left + (V.width - j) / 2;
|
|
753
753
|
break;
|
|
754
754
|
case "bottom":
|
|
755
|
-
|
|
755
|
+
R = V.bottom + q, O = V.left + (V.width - j) / 2;
|
|
756
756
|
break;
|
|
757
757
|
case "left":
|
|
758
|
-
|
|
758
|
+
R = V.top + (V.height - U) / 2, O = V.left - j - q;
|
|
759
759
|
break;
|
|
760
760
|
case "right":
|
|
761
|
-
|
|
761
|
+
R = V.top + (V.height - U) / 2, O = V.right + q;
|
|
762
762
|
break;
|
|
763
763
|
}
|
|
764
|
-
t.placement === "top" &&
|
|
764
|
+
t.placement === "top" && R < 0 ? (J = "bottom", R = V.bottom + q) : t.placement === "bottom" && R + U > fe ? (J = "top", R = V.top - U - q) : t.placement === "left" && O < 0 ? (J = "right", O = V.right + q) : t.placement === "right" && O + j > he && (J = "left", O = V.left - j - q), O < 8 && (O = 8), O + j > he - 8 && (O = he - j - 8), R < 8 && (R = 8), R + U > fe - 8 && (R = fe - U - 8), w.value = {
|
|
765
765
|
position: "fixed",
|
|
766
|
-
top: `${
|
|
767
|
-
left: `${
|
|
766
|
+
top: `${R}px`,
|
|
767
|
+
left: `${O}px`,
|
|
768
768
|
visibility: "visible",
|
|
769
769
|
zIndex: "2000"
|
|
770
|
-
},
|
|
771
|
-
},
|
|
770
|
+
}, y.value = J;
|
|
771
|
+
}, y = E(t.placement), g = () => {
|
|
772
772
|
t.disabled || (clearTimeout(c), v = setTimeout(() => {
|
|
773
773
|
i.value = !0, r("update:visible", !0), r("show"), te(() => {
|
|
774
774
|
p();
|
|
@@ -779,38 +779,38 @@ const Be = ["aria-hidden", "aria-label"], Te = ["stroke-width"], Ie = ["d"], X =
|
|
|
779
779
|
i.value = !1, r("update:visible", !1), r("hide");
|
|
780
780
|
}, t.closeDelay);
|
|
781
781
|
}, l = () => {
|
|
782
|
-
i.value ? h() :
|
|
782
|
+
i.value ? h() : g();
|
|
783
783
|
}, b = () => {
|
|
784
|
-
t.trigger === "hover" &&
|
|
784
|
+
t.trigger === "hover" && g();
|
|
785
785
|
}, d = () => {
|
|
786
786
|
t.trigger === "hover" && h();
|
|
787
|
-
},
|
|
787
|
+
}, x = () => {
|
|
788
788
|
t.trigger === "click" && l();
|
|
789
789
|
}, Y = () => {
|
|
790
|
-
t.trigger === "focus" &&
|
|
791
|
-
},
|
|
790
|
+
t.trigger === "focus" && g();
|
|
791
|
+
}, F = () => {
|
|
792
792
|
t.trigger === "focus" && h();
|
|
793
|
-
}, T = (
|
|
794
|
-
var
|
|
795
|
-
t.trigger === "click" && !((
|
|
796
|
-
},
|
|
793
|
+
}, T = (V) => {
|
|
794
|
+
var X, j;
|
|
795
|
+
t.trigger === "click" && !((X = m.value) != null && X.contains(V.target)) && !((j = M.value) != null && j.contains(V.target)) && h();
|
|
796
|
+
}, B = () => {
|
|
797
797
|
i.value && p();
|
|
798
798
|
};
|
|
799
|
-
ae(i, (
|
|
800
|
-
|
|
801
|
-
p(), t.trigger === "click" && document.addEventListener("click", T), window.addEventListener("scroll",
|
|
802
|
-
}) : (document.removeEventListener("click", T), window.removeEventListener("scroll",
|
|
799
|
+
ae(i, (V) => {
|
|
800
|
+
V ? te(() => {
|
|
801
|
+
p(), t.trigger === "click" && document.addEventListener("click", T), window.addEventListener("scroll", B, !0), window.addEventListener("resize", B);
|
|
802
|
+
}) : (document.removeEventListener("click", T), window.removeEventListener("scroll", B, !0), window.removeEventListener("resize", B));
|
|
803
803
|
}), de(() => {
|
|
804
|
-
clearTimeout(v), clearTimeout(c), document.removeEventListener("click", T), window.removeEventListener("scroll",
|
|
804
|
+
clearTimeout(v), clearTimeout(c), document.removeEventListener("click", T), window.removeEventListener("scroll", B, !0), window.removeEventListener("resize", B);
|
|
805
805
|
});
|
|
806
|
-
const le =
|
|
806
|
+
const le = $(() => [
|
|
807
807
|
a.b(),
|
|
808
808
|
a.m(t.effect)
|
|
809
|
-
]), ne =
|
|
809
|
+
]), ne = $(() => [
|
|
810
810
|
a.e("arrow"),
|
|
811
|
-
a.e(`arrow-${
|
|
811
|
+
a.e(`arrow-${y.value}`)
|
|
812
812
|
]);
|
|
813
|
-
return (
|
|
813
|
+
return (V, X) => (u(), f("div", {
|
|
814
814
|
class: s(o(a).e("wrapper"))
|
|
815
815
|
}, [
|
|
816
816
|
z("div", {
|
|
@@ -819,27 +819,27 @@ const Be = ["aria-hidden", "aria-label"], Te = ["stroke-width"], Ie = ["d"], X =
|
|
|
819
819
|
class: s(o(a).e("trigger")),
|
|
820
820
|
onMouseenter: b,
|
|
821
821
|
onMouseleave: d,
|
|
822
|
-
onClick:
|
|
822
|
+
onClick: x,
|
|
823
823
|
onFocus: Y,
|
|
824
|
-
onBlur:
|
|
824
|
+
onBlur: F
|
|
825
825
|
}, [
|
|
826
|
-
|
|
826
|
+
L(V.$slots, "default")
|
|
827
827
|
], 34),
|
|
828
828
|
(u(), Z(oe, { to: "body" }, [
|
|
829
|
-
|
|
829
|
+
I(K, {
|
|
830
830
|
name: `x-tooltip-${e.transition}`
|
|
831
831
|
}, {
|
|
832
|
-
default:
|
|
832
|
+
default: N(() => [
|
|
833
833
|
ce(z("div", {
|
|
834
834
|
ref_key: "tooltipRef",
|
|
835
|
-
ref:
|
|
835
|
+
ref: M,
|
|
836
836
|
class: s(le.value),
|
|
837
|
-
style:
|
|
837
|
+
style: A(w.value),
|
|
838
838
|
onMouseenter: b,
|
|
839
839
|
onMouseleave: d
|
|
840
840
|
}, [
|
|
841
|
-
|
|
842
|
-
|
|
841
|
+
L(V.$slots, "content", {}, () => [
|
|
842
|
+
P(H(e.content), 1)
|
|
843
843
|
]),
|
|
844
844
|
e.visibleArrow ? (u(), f("div", {
|
|
845
845
|
key: 0,
|
|
@@ -854,7 +854,7 @@ const Be = ["aria-hidden", "aria-label"], Te = ["stroke-width"], Ie = ["d"], X =
|
|
|
854
854
|
]))
|
|
855
855
|
], 2));
|
|
856
856
|
}
|
|
857
|
-
}),
|
|
857
|
+
}), We = { class: "x-popconfirm-wrapper" }, je = { class: "x-popconfirm__main" }, Ne = { class: "x-popconfirm__title" }, De = { class: "x-popconfirm__action" }, ht = /* @__PURE__ */ S({
|
|
858
858
|
name: "XPopconfirm",
|
|
859
859
|
__name: "index",
|
|
860
860
|
props: {
|
|
@@ -876,157 +876,157 @@ const Be = ["aria-hidden", "aria-label"], Te = ["stroke-width"], Ie = ["d"], X =
|
|
|
876
876
|
},
|
|
877
877
|
emits: ["confirm", "cancel"],
|
|
878
878
|
setup(e, { emit: n }) {
|
|
879
|
-
const t = e, r = n, a =
|
|
879
|
+
const t = e, r = n, a = E(!1), i = E(null), m = E(null), M = E({}), v = () => {
|
|
880
880
|
if (!i.value || !m.value) return;
|
|
881
|
-
const d = i.value.getBoundingClientRect(),
|
|
882
|
-
let T = 0,
|
|
881
|
+
const d = i.value.getBoundingClientRect(), x = m.value.getBoundingClientRect(), Y = t.placement, F = t.offset;
|
|
882
|
+
let T = 0, B = 0;
|
|
883
883
|
switch (Y) {
|
|
884
884
|
case "top":
|
|
885
|
-
T = d.top -
|
|
885
|
+
T = d.top - x.height - F, B = d.left + (d.width - x.width) / 2;
|
|
886
886
|
break;
|
|
887
887
|
case "top-start":
|
|
888
|
-
T = d.top -
|
|
888
|
+
T = d.top - x.height - F, B = d.left;
|
|
889
889
|
break;
|
|
890
890
|
case "top-end":
|
|
891
|
-
T = d.top -
|
|
891
|
+
T = d.top - x.height - F, B = d.right - x.width;
|
|
892
892
|
break;
|
|
893
893
|
case "bottom":
|
|
894
|
-
T = d.bottom +
|
|
894
|
+
T = d.bottom + F, B = d.left + (d.width - x.width) / 2;
|
|
895
895
|
break;
|
|
896
896
|
case "bottom-start":
|
|
897
|
-
T = d.bottom +
|
|
897
|
+
T = d.bottom + F, B = d.left;
|
|
898
898
|
break;
|
|
899
899
|
case "bottom-end":
|
|
900
|
-
T = d.bottom +
|
|
900
|
+
T = d.bottom + F, B = d.right - x.width;
|
|
901
901
|
break;
|
|
902
902
|
case "left":
|
|
903
|
-
T = d.top + (d.height -
|
|
903
|
+
T = d.top + (d.height - x.height) / 2, B = d.left - x.width - F;
|
|
904
904
|
break;
|
|
905
905
|
case "left-start":
|
|
906
|
-
T = d.top,
|
|
906
|
+
T = d.top, B = d.left - x.width - F;
|
|
907
907
|
break;
|
|
908
908
|
case "left-end":
|
|
909
|
-
T = d.bottom -
|
|
909
|
+
T = d.bottom - x.height, B = d.left - x.width - F;
|
|
910
910
|
break;
|
|
911
911
|
case "right":
|
|
912
|
-
T = d.top + (d.height -
|
|
912
|
+
T = d.top + (d.height - x.height) / 2, B = d.right + F;
|
|
913
913
|
break;
|
|
914
914
|
case "right-start":
|
|
915
|
-
T = d.top,
|
|
915
|
+
T = d.top, B = d.right + F;
|
|
916
916
|
break;
|
|
917
917
|
case "right-end":
|
|
918
|
-
T = d.bottom -
|
|
918
|
+
T = d.bottom - x.height, B = d.right + F;
|
|
919
919
|
break;
|
|
920
920
|
default:
|
|
921
|
-
T = d.top -
|
|
921
|
+
T = d.top - x.height - F, B = d.left + (d.width - x.width) / 2;
|
|
922
922
|
}
|
|
923
923
|
const le = window.innerWidth, ne = window.innerHeight;
|
|
924
|
-
|
|
924
|
+
B < 0 && (B = 10), B + x.width > le && (B = le - x.width - 10), T < 0 && (T = 10), T + x.height > ne && (T = ne - x.height - 10), M.value = {
|
|
925
925
|
position: "fixed",
|
|
926
926
|
top: `${T}px`,
|
|
927
|
-
left: `${
|
|
927
|
+
left: `${B}px`,
|
|
928
928
|
zIndex: "2000"
|
|
929
929
|
};
|
|
930
930
|
}, c = (d) => {
|
|
931
|
-
var
|
|
932
|
-
a.value && ((
|
|
933
|
-
},
|
|
931
|
+
var x, Y;
|
|
932
|
+
a.value && ((x = i.value) != null && x.contains(d.target) || (Y = m.value) != null && Y.contains(d.target) || (a.value = !1));
|
|
933
|
+
}, w = (d) => {
|
|
934
934
|
t.disabled || (d.stopPropagation(), a.value = !a.value, a.value && setTimeout(v, 0));
|
|
935
935
|
}, p = () => {
|
|
936
936
|
a.value = !1, r("confirm");
|
|
937
|
-
},
|
|
937
|
+
}, y = () => {
|
|
938
938
|
a.value = !1, r("cancel");
|
|
939
|
-
},
|
|
939
|
+
}, g = () => {
|
|
940
940
|
a.value && v();
|
|
941
941
|
}, h = () => {
|
|
942
942
|
a.value && v();
|
|
943
943
|
};
|
|
944
944
|
ae(a, (d) => {
|
|
945
|
-
d ? (setTimeout(v, 0), document.addEventListener("click", c), window.addEventListener("scroll",
|
|
945
|
+
d ? (setTimeout(v, 0), document.addEventListener("click", c), window.addEventListener("scroll", g, !0), window.addEventListener("resize", h)) : (document.removeEventListener("click", c), window.removeEventListener("scroll", g, !0), window.removeEventListener("resize", h));
|
|
946
946
|
}), de(() => {
|
|
947
|
-
document.removeEventListener("click", c), window.removeEventListener("scroll",
|
|
947
|
+
document.removeEventListener("click", c), window.removeEventListener("scroll", g, !0), window.removeEventListener("resize", h);
|
|
948
948
|
});
|
|
949
|
-
const l =
|
|
949
|
+
const l = $(() => ({
|
|
950
950
|
width: typeof t.width == "number" ? `${t.width}px` : t.width
|
|
951
|
-
})), b =
|
|
952
|
-
const d = t.placement,
|
|
951
|
+
})), b = $(() => {
|
|
952
|
+
const d = t.placement, x = {};
|
|
953
953
|
switch (d) {
|
|
954
954
|
case "top":
|
|
955
955
|
case "top-start":
|
|
956
956
|
case "top-end":
|
|
957
|
-
|
|
957
|
+
x.bottom = "-6px", x.transform = "rotate(45deg)";
|
|
958
958
|
break;
|
|
959
959
|
case "bottom":
|
|
960
960
|
case "bottom-start":
|
|
961
961
|
case "bottom-end":
|
|
962
|
-
|
|
962
|
+
x.top = "-6px", x.transform = "rotate(225deg)";
|
|
963
963
|
break;
|
|
964
964
|
case "left":
|
|
965
965
|
case "left-start":
|
|
966
966
|
case "left-end":
|
|
967
|
-
|
|
967
|
+
x.right = "-6px", x.transform = "rotate(315deg)";
|
|
968
968
|
break;
|
|
969
969
|
case "right":
|
|
970
970
|
case "right-start":
|
|
971
971
|
case "right-end":
|
|
972
|
-
|
|
972
|
+
x.left = "-6px", x.transform = "rotate(135deg)";
|
|
973
973
|
break;
|
|
974
974
|
}
|
|
975
|
-
return
|
|
975
|
+
return x;
|
|
976
976
|
});
|
|
977
|
-
return (d,
|
|
977
|
+
return (d, x) => (u(), f("span", We, [
|
|
978
978
|
z("span", {
|
|
979
979
|
ref_key: "triggerRef",
|
|
980
980
|
ref: i,
|
|
981
981
|
class: "x-popconfirm-trigger",
|
|
982
|
-
onClick:
|
|
982
|
+
onClick: w
|
|
983
983
|
}, [
|
|
984
|
-
|
|
984
|
+
L(d.$slots, "default")
|
|
985
985
|
], 512),
|
|
986
986
|
(u(), Z(oe, { to: "body" }, [
|
|
987
|
-
|
|
988
|
-
default:
|
|
987
|
+
I(K, { name: "x-popconfirm-fade" }, {
|
|
988
|
+
default: N(() => [
|
|
989
989
|
a.value ? (u(), f("div", {
|
|
990
990
|
key: 0,
|
|
991
991
|
ref_key: "popperRef",
|
|
992
992
|
ref: m,
|
|
993
993
|
class: "x-popconfirm",
|
|
994
|
-
style:
|
|
995
|
-
onClick:
|
|
994
|
+
style: A({ ...M.value, ...l.value }),
|
|
995
|
+
onClick: x[0] || (x[0] = re(() => {
|
|
996
996
|
}, ["stop"]))
|
|
997
997
|
}, [
|
|
998
998
|
e.showArrow ? (u(), f("span", {
|
|
999
999
|
key: 0,
|
|
1000
1000
|
class: "x-popconfirm__arrow",
|
|
1001
|
-
style:
|
|
1001
|
+
style: A(b.value)
|
|
1002
1002
|
}, null, 4)) : C("", !0),
|
|
1003
|
-
z("div",
|
|
1003
|
+
z("div", je, [
|
|
1004
1004
|
e.hideIcon ? C("", !0) : (u(), f("span", {
|
|
1005
1005
|
key: 0,
|
|
1006
1006
|
class: "x-popconfirm__icon",
|
|
1007
|
-
style:
|
|
1007
|
+
style: A({ color: e.iconColor })
|
|
1008
1008
|
}, [
|
|
1009
|
-
|
|
1010
|
-
|
|
1009
|
+
L(d.$slots, "icon", {}, () => [
|
|
1010
|
+
P(H(e.icon || "⚠"), 1)
|
|
1011
1011
|
])
|
|
1012
1012
|
], 4)),
|
|
1013
|
-
z("div",
|
|
1014
|
-
|
|
1015
|
-
|
|
1013
|
+
z("div", Ne, [
|
|
1014
|
+
L(d.$slots, "title", {}, () => [
|
|
1015
|
+
P(H(e.title), 1)
|
|
1016
1016
|
])
|
|
1017
1017
|
])
|
|
1018
1018
|
]),
|
|
1019
|
-
z("div",
|
|
1019
|
+
z("div", De, [
|
|
1020
1020
|
e.hideCancelButton ? C("", !0) : (u(), f("button", {
|
|
1021
1021
|
key: 0,
|
|
1022
1022
|
class: "x-button p-button--default p-button--small",
|
|
1023
|
-
onClick:
|
|
1024
|
-
},
|
|
1023
|
+
onClick: y
|
|
1024
|
+
}, H(e.cancelButtonText), 1)),
|
|
1025
1025
|
e.hideConfirmButton ? C("", !0) : (u(), f("button", {
|
|
1026
1026
|
key: 1,
|
|
1027
1027
|
class: s(["x-button x-button--small", `x-button--${e.confirmButtonType}`]),
|
|
1028
1028
|
onClick: p
|
|
1029
|
-
},
|
|
1029
|
+
}, H(e.confirmButtonText), 3))
|
|
1030
1030
|
])
|
|
1031
1031
|
], 4)) : C("", !0)
|
|
1032
1032
|
]),
|
|
@@ -1035,7 +1035,7 @@ const Be = ["aria-hidden", "aria-label"], Te = ["stroke-width"], Ie = ["d"], X =
|
|
|
1035
1035
|
]))
|
|
1036
1036
|
]));
|
|
1037
1037
|
}
|
|
1038
|
-
}), ft = /* @__PURE__ */
|
|
1038
|
+
}), ft = /* @__PURE__ */ S({
|
|
1039
1039
|
name: "XBacktop",
|
|
1040
1040
|
__name: "index",
|
|
1041
1041
|
props: {
|
|
@@ -1045,34 +1045,34 @@ const Be = ["aria-hidden", "aria-label"], Te = ["stroke-width"], Ie = ["d"], X =
|
|
|
1045
1045
|
},
|
|
1046
1046
|
emits: ["click"],
|
|
1047
1047
|
setup(e, { emit: n }) {
|
|
1048
|
-
const t = e, r = n, a =
|
|
1048
|
+
const t = e, r = n, a = W("backtop"), i = E(!1), m = () => {
|
|
1049
1049
|
const c = window.scrollY || document.documentElement.scrollTop || document.body.scrollTop || 0;
|
|
1050
1050
|
i.value = c >= t.visibilityHeight;
|
|
1051
|
-
},
|
|
1051
|
+
}, M = (c) => {
|
|
1052
1052
|
window.scrollTo({
|
|
1053
1053
|
top: 0,
|
|
1054
1054
|
behavior: "smooth"
|
|
1055
1055
|
}), r("click", c);
|
|
1056
|
-
}, v =
|
|
1056
|
+
}, v = $(() => ({
|
|
1057
1057
|
right: `${t.right}px`,
|
|
1058
1058
|
bottom: `${t.bottom}px`
|
|
1059
1059
|
}));
|
|
1060
|
-
return
|
|
1060
|
+
return xe(() => {
|
|
1061
1061
|
window.addEventListener("scroll", m, { passive: !0, capture: !0 }), setTimeout(m, 100);
|
|
1062
1062
|
}), de(() => {
|
|
1063
1063
|
window.removeEventListener("scroll", m, !0);
|
|
1064
|
-
}), (c,
|
|
1065
|
-
default:
|
|
1064
|
+
}), (c, w) => (u(), Z(K, { name: "x-fade" }, {
|
|
1065
|
+
default: N(() => [
|
|
1066
1066
|
ce(z("div", {
|
|
1067
1067
|
class: s(o(a).b()),
|
|
1068
|
-
style:
|
|
1069
|
-
onClick:
|
|
1068
|
+
style: A(v.value),
|
|
1069
|
+
onClick: M
|
|
1070
1070
|
}, [
|
|
1071
|
-
|
|
1071
|
+
L(c.$slots, "default", {}, () => [
|
|
1072
1072
|
z("span", {
|
|
1073
1073
|
class: s(o(a).e("icon"))
|
|
1074
1074
|
}, [
|
|
1075
|
-
|
|
1075
|
+
I(o(D), {
|
|
1076
1076
|
name: "back-top",
|
|
1077
1077
|
size: 20
|
|
1078
1078
|
})
|
|
@@ -1085,7 +1085,7 @@ const Be = ["aria-hidden", "aria-label"], Te = ["stroke-width"], Ie = ["d"], X =
|
|
|
1085
1085
|
_: 3
|
|
1086
1086
|
}));
|
|
1087
1087
|
}
|
|
1088
|
-
}), vt = /* @__PURE__ */
|
|
1088
|
+
}), vt = /* @__PURE__ */ S({
|
|
1089
1089
|
name: "XResult",
|
|
1090
1090
|
__name: "index",
|
|
1091
1091
|
props: {
|
|
@@ -1095,7 +1095,7 @@ const Be = ["aria-hidden", "aria-label"], Te = ["stroke-width"], Ie = ["d"], X =
|
|
|
1095
1095
|
icon: {}
|
|
1096
1096
|
},
|
|
1097
1097
|
setup(e) {
|
|
1098
|
-
const n = e, t =
|
|
1098
|
+
const n = e, t = W("result"), r = $(() => n.icon ? n.icon : {
|
|
1099
1099
|
success: "check-circle",
|
|
1100
1100
|
warning: "warning",
|
|
1101
1101
|
error: "close-circle",
|
|
@@ -1107,8 +1107,8 @@ const Be = ["aria-hidden", "aria-label"], Te = ["stroke-width"], Ie = ["d"], X =
|
|
|
1107
1107
|
z("div", {
|
|
1108
1108
|
class: s(o(t).e("icon"))
|
|
1109
1109
|
}, [
|
|
1110
|
-
|
|
1111
|
-
|
|
1110
|
+
L(a.$slots, "icon", {}, () => [
|
|
1111
|
+
I(o(D), {
|
|
1112
1112
|
name: r.value,
|
|
1113
1113
|
size: 72
|
|
1114
1114
|
}, null, 8, ["name"])
|
|
@@ -1118,44 +1118,44 @@ const Be = ["aria-hidden", "aria-label"], Te = ["stroke-width"], Ie = ["d"], X =
|
|
|
1118
1118
|
key: 0,
|
|
1119
1119
|
class: s(o(t).e("title"))
|
|
1120
1120
|
}, [
|
|
1121
|
-
|
|
1122
|
-
|
|
1121
|
+
L(a.$slots, "title", {}, () => [
|
|
1122
|
+
P(H(e.title), 1)
|
|
1123
1123
|
])
|
|
1124
1124
|
], 2)) : C("", !0),
|
|
1125
1125
|
e.subTitle || a.$slots.subTitle ? (u(), f("div", {
|
|
1126
1126
|
key: 1,
|
|
1127
1127
|
class: s(o(t).e("subtitle"))
|
|
1128
1128
|
}, [
|
|
1129
|
-
|
|
1130
|
-
|
|
1129
|
+
L(a.$slots, "subTitle", {}, () => [
|
|
1130
|
+
P(H(e.subTitle), 1)
|
|
1131
1131
|
])
|
|
1132
1132
|
], 2)) : C("", !0),
|
|
1133
1133
|
a.$slots.extra ? (u(), f("div", {
|
|
1134
1134
|
key: 2,
|
|
1135
1135
|
class: s(o(t).e("extra"))
|
|
1136
1136
|
}, [
|
|
1137
|
-
|
|
1137
|
+
L(a.$slots, "extra")
|
|
1138
1138
|
], 2)) : C("", !0),
|
|
1139
1139
|
a.$slots.default ? (u(), f("div", {
|
|
1140
1140
|
key: 3,
|
|
1141
1141
|
class: s(o(t).e("content"))
|
|
1142
1142
|
}, [
|
|
1143
|
-
|
|
1143
|
+
L(a.$slots, "default")
|
|
1144
1144
|
], 2)) : C("", !0)
|
|
1145
1145
|
], 2));
|
|
1146
1146
|
}
|
|
1147
|
-
}), pt = /* @__PURE__ */
|
|
1147
|
+
}), pt = /* @__PURE__ */ S({
|
|
1148
1148
|
name: "XTimeline",
|
|
1149
1149
|
__name: "index",
|
|
1150
1150
|
setup(e) {
|
|
1151
|
-
const n =
|
|
1151
|
+
const n = W("timeline");
|
|
1152
1152
|
return (t, r) => (u(), f("ul", {
|
|
1153
1153
|
class: s(o(n).b())
|
|
1154
1154
|
}, [
|
|
1155
|
-
|
|
1155
|
+
L(t.$slots, "default")
|
|
1156
1156
|
], 2));
|
|
1157
1157
|
}
|
|
1158
|
-
}),
|
|
1158
|
+
}), gt = /* @__PURE__ */ S({
|
|
1159
1159
|
name: "XTimelineItem",
|
|
1160
1160
|
__name: "TimelineItem",
|
|
1161
1161
|
props: {
|
|
@@ -1168,7 +1168,7 @@ const Be = ["aria-hidden", "aria-label"], Te = ["stroke-width"], Ie = ["d"], X =
|
|
|
1168
1168
|
hollow: { type: Boolean, default: !1 }
|
|
1169
1169
|
},
|
|
1170
1170
|
setup(e) {
|
|
1171
|
-
const n =
|
|
1171
|
+
const n = W("timeline-item");
|
|
1172
1172
|
return (t, r) => (u(), f("li", {
|
|
1173
1173
|
class: s([o(n).b(), o(n).m(e.placement)])
|
|
1174
1174
|
}, [
|
|
@@ -1177,13 +1177,13 @@ const Be = ["aria-hidden", "aria-label"], Te = ["stroke-width"], Ie = ["d"], X =
|
|
|
1177
1177
|
}, null, 2),
|
|
1178
1178
|
z("div", {
|
|
1179
1179
|
class: s([o(n).e("node"), o(n).m(e.type), o(n).is("hollow", e.hollow)]),
|
|
1180
|
-
style:
|
|
1180
|
+
style: A(e.color ? { backgroundColor: e.color, borderColor: e.color } : void 0)
|
|
1181
1181
|
}, [
|
|
1182
|
-
|
|
1182
|
+
L(t.$slots, "icon", {}, () => [
|
|
1183
1183
|
e.icon ? (u(), f("span", {
|
|
1184
1184
|
key: 0,
|
|
1185
1185
|
class: s(o(n).e("icon"))
|
|
1186
|
-
},
|
|
1186
|
+
}, H(e.icon), 3)) : C("", !0)
|
|
1187
1187
|
])
|
|
1188
1188
|
], 6),
|
|
1189
1189
|
z("div", {
|
|
@@ -1192,20 +1192,20 @@ const Be = ["aria-hidden", "aria-label"], Te = ["stroke-width"], Ie = ["d"], X =
|
|
|
1192
1192
|
e.timestamp && e.placement === "top" ? (u(), f("div", {
|
|
1193
1193
|
key: 0,
|
|
1194
1194
|
class: s(o(n).e("timestamp"))
|
|
1195
|
-
},
|
|
1195
|
+
}, H(e.timestamp), 3)) : C("", !0),
|
|
1196
1196
|
z("div", {
|
|
1197
1197
|
class: s(o(n).e("content"))
|
|
1198
1198
|
}, [
|
|
1199
|
-
|
|
1199
|
+
L(t.$slots, "default")
|
|
1200
1200
|
], 2),
|
|
1201
1201
|
e.timestamp && e.placement === "bottom" ? (u(), f("div", {
|
|
1202
1202
|
key: 1,
|
|
1203
1203
|
class: s(o(n).e("timestamp"))
|
|
1204
|
-
},
|
|
1204
|
+
}, H(e.timestamp), 3)) : C("", !0)
|
|
1205
1205
|
], 2)
|
|
1206
1206
|
], 2));
|
|
1207
1207
|
}
|
|
1208
|
-
}),
|
|
1208
|
+
}), Xe = /* @__PURE__ */ S({
|
|
1209
1209
|
name: "XMessage",
|
|
1210
1210
|
__name: "index",
|
|
1211
1211
|
props: {
|
|
@@ -1220,27 +1220,27 @@ const Be = ["aria-hidden", "aria-label"], Te = ["stroke-width"], Ie = ["d"], X =
|
|
|
1220
1220
|
},
|
|
1221
1221
|
emits: ["close", "destroy"],
|
|
1222
1222
|
setup(e, { expose: n, emit: t }) {
|
|
1223
|
-
const r = e, a = t, i =
|
|
1223
|
+
const r = e, a = t, i = W("message"), m = E(!1), M = E(Le()), v = {
|
|
1224
1224
|
success: "check",
|
|
1225
1225
|
warning: "warning",
|
|
1226
1226
|
error: "close-circle",
|
|
1227
1227
|
info: "info"
|
|
1228
|
-
}, c =
|
|
1228
|
+
}, c = $(() => [
|
|
1229
1229
|
i.b(),
|
|
1230
1230
|
i.m(r.type),
|
|
1231
1231
|
i.is("center", r.center),
|
|
1232
1232
|
i.is("closable", r.showClose),
|
|
1233
1233
|
r.customClass
|
|
1234
|
-
]),
|
|
1234
|
+
]), w = $(() => ({
|
|
1235
1235
|
top: `${r.offset}px`,
|
|
1236
|
-
zIndex:
|
|
1236
|
+
zIndex: M.value
|
|
1237
1237
|
}));
|
|
1238
1238
|
let p = null;
|
|
1239
|
-
const
|
|
1239
|
+
const y = () => {
|
|
1240
1240
|
r.duration > 0 && (p = setTimeout(() => {
|
|
1241
1241
|
h();
|
|
1242
1242
|
}, r.duration));
|
|
1243
|
-
},
|
|
1243
|
+
}, g = () => {
|
|
1244
1244
|
p && (clearTimeout(p), p = null);
|
|
1245
1245
|
}, h = () => {
|
|
1246
1246
|
var b;
|
|
@@ -1248,28 +1248,28 @@ const Be = ["aria-hidden", "aria-label"], Te = ["stroke-width"], Ie = ["d"], X =
|
|
|
1248
1248
|
}, l = () => {
|
|
1249
1249
|
a("destroy");
|
|
1250
1250
|
};
|
|
1251
|
-
return
|
|
1252
|
-
|
|
1251
|
+
return xe(() => {
|
|
1252
|
+
y(), m.value = !0;
|
|
1253
1253
|
}), de(() => {
|
|
1254
|
-
|
|
1254
|
+
g();
|
|
1255
1255
|
}), n({
|
|
1256
1256
|
close: h
|
|
1257
1257
|
}), (b, d) => (u(), Z(K, {
|
|
1258
1258
|
name: "x-message-fade",
|
|
1259
1259
|
onAfterLeave: l
|
|
1260
1260
|
}, {
|
|
1261
|
-
default:
|
|
1261
|
+
default: N(() => [
|
|
1262
1262
|
m.value ? (u(), f("div", {
|
|
1263
1263
|
key: 0,
|
|
1264
1264
|
class: s(c.value),
|
|
1265
|
-
style:
|
|
1266
|
-
onMouseenter:
|
|
1267
|
-
onMouseleave:
|
|
1265
|
+
style: A(w.value),
|
|
1266
|
+
onMouseenter: g,
|
|
1267
|
+
onMouseleave: y
|
|
1268
1268
|
}, [
|
|
1269
1269
|
z("span", {
|
|
1270
1270
|
class: s(o(i).e("icon"))
|
|
1271
1271
|
}, [
|
|
1272
|
-
|
|
1272
|
+
I(o(D), {
|
|
1273
1273
|
name: v[e.type],
|
|
1274
1274
|
size: 16
|
|
1275
1275
|
}, null, 8, ["name"])
|
|
@@ -1277,8 +1277,8 @@ const Be = ["aria-hidden", "aria-label"], Te = ["stroke-width"], Ie = ["d"], X =
|
|
|
1277
1277
|
z("span", {
|
|
1278
1278
|
class: s(o(i).e("content"))
|
|
1279
1279
|
}, [
|
|
1280
|
-
|
|
1281
|
-
|
|
1280
|
+
L(b.$slots, "default", {}, () => [
|
|
1281
|
+
P(H(e.message), 1)
|
|
1282
1282
|
])
|
|
1283
1283
|
], 2),
|
|
1284
1284
|
e.showClose ? (u(), f("button", {
|
|
@@ -1286,7 +1286,7 @@ const Be = ["aria-hidden", "aria-label"], Te = ["stroke-width"], Ie = ["d"], X =
|
|
|
1286
1286
|
class: s(o(i).e("close")),
|
|
1287
1287
|
onClick: h
|
|
1288
1288
|
}, [
|
|
1289
|
-
|
|
1289
|
+
I(o(D), {
|
|
1290
1290
|
name: "close",
|
|
1291
1291
|
size: 14
|
|
1292
1292
|
})
|
|
@@ -1301,42 +1301,42 @@ let qe = 1;
|
|
|
1301
1301
|
const Ze = () => {
|
|
1302
1302
|
Q.slice().forEach((e) => e.close());
|
|
1303
1303
|
};
|
|
1304
|
-
function
|
|
1304
|
+
function we(e) {
|
|
1305
1305
|
const n = qe++, t = document.createElement("div");
|
|
1306
1306
|
document.body.appendChild(t);
|
|
1307
1307
|
const r = {
|
|
1308
|
-
success: { bg: "#
|
|
1309
|
-
warning: { bg: "#
|
|
1310
|
-
error: { bg: "#
|
|
1311
|
-
info: { bg: "#
|
|
1308
|
+
success: { bg: "var(--xto-color-success-light-9, #ECFDF5)", border: "var(--xto-color-success, #10B981)", iconPath: "M5 13l4 4L19 7" },
|
|
1309
|
+
warning: { bg: "var(--xto-color-warning-light-9, #FFFBEB)", border: "var(--xto-color-warning, #F59E0B)", iconPath: "M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z" },
|
|
1310
|
+
error: { bg: "var(--xto-color-danger-light-9, #FEF2F2)", border: "var(--xto-color-danger, #EF4444)", iconPath: "M6 18L18 6M6 6l12 12" },
|
|
1311
|
+
info: { bg: "var(--xto-color-info-light-9, #F3F4F6)", border: "var(--xto-color-info, #6B7280)", iconPath: "M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" }
|
|
1312
1312
|
}, a = e.type || "info", i = r[a] || r.info, m = Ce({
|
|
1313
1313
|
visible: !1,
|
|
1314
1314
|
offset: e.offset ?? 20
|
|
1315
1315
|
});
|
|
1316
|
-
let
|
|
1316
|
+
let M = e.offset ?? 20;
|
|
1317
1317
|
Q.forEach((l) => {
|
|
1318
1318
|
const b = l.container.firstElementChild;
|
|
1319
|
-
b && b.offsetHeight && (
|
|
1320
|
-
}), m.offset =
|
|
1319
|
+
b && b.offsetHeight && (M += b.offsetHeight + 16);
|
|
1320
|
+
}), m.offset = M;
|
|
1321
1321
|
let v = null, c = !1;
|
|
1322
|
-
const
|
|
1322
|
+
const w = () => {
|
|
1323
1323
|
c || (m.visible = !1, setTimeout(() => {
|
|
1324
1324
|
if (c) return;
|
|
1325
1325
|
c = !0;
|
|
1326
1326
|
const l = Q.findIndex((b) => b.id === n);
|
|
1327
1327
|
l !== -1 && Q.splice(l, 1);
|
|
1328
1328
|
try {
|
|
1329
|
-
|
|
1329
|
+
g.unmount();
|
|
1330
1330
|
} catch {
|
|
1331
1331
|
}
|
|
1332
1332
|
t.parentNode && t.parentNode.removeChild(t);
|
|
1333
1333
|
}, 300));
|
|
1334
1334
|
}, p = () => {
|
|
1335
1335
|
const l = e.duration ?? 3e3;
|
|
1336
|
-
l > 0 && (v = setTimeout(
|
|
1337
|
-
},
|
|
1336
|
+
l > 0 && (v = setTimeout(w, l));
|
|
1337
|
+
}, y = () => {
|
|
1338
1338
|
v && (clearTimeout(v), v = null);
|
|
1339
|
-
},
|
|
1339
|
+
}, g = ge({
|
|
1340
1340
|
render() {
|
|
1341
1341
|
if (!m.visible) return null;
|
|
1342
1342
|
const l = [
|
|
@@ -1393,7 +1393,7 @@ function xe(e) {
|
|
|
1393
1393
|
justifyContent: "center"
|
|
1394
1394
|
},
|
|
1395
1395
|
onClick: (b) => {
|
|
1396
|
-
b.stopPropagation(),
|
|
1396
|
+
b.stopPropagation(), w();
|
|
1397
1397
|
}
|
|
1398
1398
|
}, [
|
|
1399
1399
|
k("svg", {
|
|
@@ -1429,49 +1429,49 @@ function xe(e) {
|
|
|
1429
1429
|
zIndex: 2e3 + n,
|
|
1430
1430
|
transition: "opacity 0.3s, transform 0.3s"
|
|
1431
1431
|
},
|
|
1432
|
-
onMouseenter:
|
|
1432
|
+
onMouseenter: y,
|
|
1433
1433
|
onMouseleave: p
|
|
1434
1434
|
}, l);
|
|
1435
1435
|
}
|
|
1436
1436
|
});
|
|
1437
|
-
|
|
1437
|
+
g.mount(t), te(() => {
|
|
1438
1438
|
m.visible = !0, p();
|
|
1439
1439
|
});
|
|
1440
|
-
const h = { id: n, app:
|
|
1441
|
-
return Q.push(h), { close:
|
|
1440
|
+
const h = { id: n, app: g, container: t, close: w };
|
|
1441
|
+
return Q.push(h), { close: w };
|
|
1442
1442
|
}
|
|
1443
1443
|
function Ke(e) {
|
|
1444
|
-
return
|
|
1444
|
+
return we(typeof e == "string" ? { message: e } : e);
|
|
1445
1445
|
}
|
|
1446
|
-
const se = (e) => (n) =>
|
|
1446
|
+
const se = (e) => (n) => we({ ...typeof n == "string" ? { message: n } : n, type: e }), ve = Object.assign(Ke, {
|
|
1447
1447
|
info: se("info"),
|
|
1448
1448
|
success: se("success"),
|
|
1449
1449
|
warning: se("warning"),
|
|
1450
1450
|
error: se("error"),
|
|
1451
1451
|
closeAll: Ze
|
|
1452
|
-
}),
|
|
1452
|
+
}), Mt = Xe, bt = {
|
|
1453
1453
|
install(e) {
|
|
1454
1454
|
e.config.globalProperties.$message = ve, e.provide("message", ve);
|
|
1455
1455
|
}
|
|
1456
1456
|
}, _ = [], Ue = () => {
|
|
1457
1457
|
_.slice().forEach((e) => e.close());
|
|
1458
1458
|
}, Ye = {
|
|
1459
|
-
success: { iconPath: "M5 13l4 4L19 7", color: "#
|
|
1460
|
-
warning: { iconPath: "M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z", color: "#
|
|
1461
|
-
error: { iconPath: "M6 18L18 6M6 6l12 12", color: "#
|
|
1462
|
-
info: { iconPath: "M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z", color: "#
|
|
1459
|
+
success: { iconPath: "M5 13l4 4L19 7", color: "var(--xto-color-success, #10B981)" },
|
|
1460
|
+
warning: { iconPath: "M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z", color: "var(--xto-color-warning, #F59E0B)" },
|
|
1461
|
+
error: { iconPath: "M6 18L18 6M6 6l12 12", color: "var(--xto-color-danger, #EF4444)" },
|
|
1462
|
+
info: { iconPath: "M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z", color: "var(--xto-color-info, #6B7280)" }
|
|
1463
1463
|
};
|
|
1464
1464
|
function me(e) {
|
|
1465
1465
|
return new Promise((n) => {
|
|
1466
1466
|
const t = document.createElement("div");
|
|
1467
1467
|
document.body.appendChild(t);
|
|
1468
1468
|
let r = !1;
|
|
1469
|
-
const a =
|
|
1469
|
+
const a = S({
|
|
1470
1470
|
name: "TMessageBox",
|
|
1471
1471
|
setup() {
|
|
1472
|
-
const
|
|
1473
|
-
r || (r = !0,
|
|
1474
|
-
const d = _.findIndex((
|
|
1472
|
+
const M = E(!1), v = E(e.inputValue ?? ""), c = E(""), w = 2e3 + _.length + 1, p = (b) => {
|
|
1473
|
+
r || (r = !0, M.value = !1, setTimeout(() => {
|
|
1474
|
+
const d = _.findIndex((x) => x.container === t);
|
|
1475
1475
|
d !== -1 && _.splice(d, 1);
|
|
1476
1476
|
try {
|
|
1477
1477
|
i.unmount();
|
|
@@ -1482,13 +1482,13 @@ function me(e) {
|
|
|
1482
1482
|
value: b === "confirm" ? v.value : void 0
|
|
1483
1483
|
});
|
|
1484
1484
|
}, 300));
|
|
1485
|
-
},
|
|
1485
|
+
}, y = () => {
|
|
1486
1486
|
if (e.showInput && e.inputPattern && !e.inputPattern.test(v.value)) {
|
|
1487
1487
|
c.value = e.inputErrorMessage || "输入格式不正确";
|
|
1488
1488
|
return;
|
|
1489
1489
|
}
|
|
1490
1490
|
c.value = "", p("confirm");
|
|
1491
|
-
},
|
|
1491
|
+
}, g = () => {
|
|
1492
1492
|
p("cancel");
|
|
1493
1493
|
}, h = () => {
|
|
1494
1494
|
p("close");
|
|
@@ -1496,21 +1496,21 @@ function me(e) {
|
|
|
1496
1496
|
e.closeOnClickModal !== !1 && h();
|
|
1497
1497
|
};
|
|
1498
1498
|
return te(() => {
|
|
1499
|
-
|
|
1499
|
+
M.value = !0;
|
|
1500
1500
|
}), {
|
|
1501
|
-
visible:
|
|
1501
|
+
visible: M,
|
|
1502
1502
|
inputValue: v,
|
|
1503
1503
|
inputError: c,
|
|
1504
|
-
zIndex:
|
|
1505
|
-
handleConfirm:
|
|
1506
|
-
handleCancel:
|
|
1504
|
+
zIndex: w,
|
|
1505
|
+
handleConfirm: y,
|
|
1506
|
+
handleCancel: g,
|
|
1507
1507
|
handleClose: h,
|
|
1508
1508
|
handleMaskClick: l
|
|
1509
1509
|
};
|
|
1510
1510
|
},
|
|
1511
1511
|
render() {
|
|
1512
1512
|
if (!this.visible) return null;
|
|
1513
|
-
const
|
|
1513
|
+
const M = e.type, v = M ? Ye[M] : null, c = [];
|
|
1514
1514
|
v && c.push(
|
|
1515
1515
|
k("span", {
|
|
1516
1516
|
class: "x-message-box__icon",
|
|
@@ -1553,24 +1553,24 @@ function me(e) {
|
|
|
1553
1553
|
])
|
|
1554
1554
|
])
|
|
1555
1555
|
);
|
|
1556
|
-
const
|
|
1557
|
-
|
|
1556
|
+
const w = [];
|
|
1557
|
+
w.push(
|
|
1558
1558
|
k("div", { class: "x-message-box__content" }, e.message || "")
|
|
1559
|
-
), e.showInput &&
|
|
1559
|
+
), e.showInput && w.push(
|
|
1560
1560
|
k("div", { class: "x-message-box__input", style: { marginTop: "12px" } }, [
|
|
1561
1561
|
k("input", {
|
|
1562
1562
|
class: ["x-message-box__input-inner", this.inputError ? "is-error" : ""].filter(Boolean),
|
|
1563
1563
|
type: e.inputType || "text",
|
|
1564
1564
|
placeholder: e.inputPlaceholder || "请输入",
|
|
1565
1565
|
value: this.inputValue,
|
|
1566
|
-
onInput: (
|
|
1567
|
-
this.inputValue =
|
|
1566
|
+
onInput: (y) => {
|
|
1567
|
+
this.inputValue = y.target.value, this.inputError = "";
|
|
1568
1568
|
},
|
|
1569
|
-
onKeyup: (
|
|
1570
|
-
|
|
1569
|
+
onKeyup: (y) => {
|
|
1570
|
+
y.key === "Enter" && this.handleConfirm();
|
|
1571
1571
|
}
|
|
1572
1572
|
}),
|
|
1573
|
-
this.inputError ? k("div", { class: "x-message-box__error", style: { color: "#
|
|
1573
|
+
this.inputError ? k("div", { class: "x-message-box__error", style: { color: "var(--xto-color-danger, #EF4444)", fontSize: "12px", marginTop: "4px" } }, this.inputError) : null
|
|
1574
1574
|
])
|
|
1575
1575
|
);
|
|
1576
1576
|
const p = [];
|
|
@@ -1597,6 +1597,7 @@ function me(e) {
|
|
|
1597
1597
|
alignItems: "center",
|
|
1598
1598
|
justifyContent: "center",
|
|
1599
1599
|
backgroundColor: "rgba(0, 0, 0, 0.5)",
|
|
1600
|
+
backdropFilter: "blur(4px)",
|
|
1600
1601
|
zIndex: this.zIndex
|
|
1601
1602
|
},
|
|
1602
1603
|
onClick: this.handleMaskClick
|
|
@@ -1604,13 +1605,13 @@ function me(e) {
|
|
|
1604
1605
|
k("div", {
|
|
1605
1606
|
class: ["x-message-box", e.customClass],
|
|
1606
1607
|
style: {
|
|
1607
|
-
backgroundColor: "#
|
|
1608
|
-
borderRadius: "
|
|
1609
|
-
boxShadow: "0
|
|
1608
|
+
backgroundColor: "var(--xto-bg-color, #FFFFFF)",
|
|
1609
|
+
borderRadius: "var(--xto-border-radius-xl, 12px)",
|
|
1610
|
+
boxShadow: "var(--xto-shadow-prominent, 0 12px 32px 4px rgba(0, 0, 0, 0.04), 0 8px 20px rgba(0, 0, 0, 0.08))",
|
|
1610
1611
|
minWidth: "300px",
|
|
1611
1612
|
maxWidth: "500px"
|
|
1612
1613
|
},
|
|
1613
|
-
onClick: (
|
|
1614
|
+
onClick: (y) => y.stopPropagation()
|
|
1614
1615
|
}, [
|
|
1615
1616
|
// Header
|
|
1616
1617
|
k("div", {
|
|
@@ -1620,7 +1621,7 @@ function me(e) {
|
|
|
1620
1621
|
alignItems: "center",
|
|
1621
1622
|
justifyContent: "space-between",
|
|
1622
1623
|
padding: "16px 20px",
|
|
1623
|
-
borderBottom: "1px solid #
|
|
1624
|
+
borderBottom: "1px solid var(--xto-border-color-lighter, #F3F4F6)"
|
|
1624
1625
|
}
|
|
1625
1626
|
}, c),
|
|
1626
1627
|
// Body
|
|
@@ -1629,9 +1630,9 @@ function me(e) {
|
|
|
1629
1630
|
style: {
|
|
1630
1631
|
padding: "20px",
|
|
1631
1632
|
fontSize: "14px",
|
|
1632
|
-
color: "#
|
|
1633
|
+
color: "var(--xto-color-text-regular, #4B5563)"
|
|
1633
1634
|
}
|
|
1634
|
-
},
|
|
1635
|
+
}, w),
|
|
1635
1636
|
// Footer
|
|
1636
1637
|
k("div", {
|
|
1637
1638
|
class: "x-message-box__footer",
|
|
@@ -1643,15 +1644,15 @@ function me(e) {
|
|
|
1643
1644
|
])
|
|
1644
1645
|
]);
|
|
1645
1646
|
}
|
|
1646
|
-
}), i =
|
|
1647
|
+
}), i = ge(a);
|
|
1647
1648
|
i.mount(t);
|
|
1648
1649
|
const m = {
|
|
1649
1650
|
app: i,
|
|
1650
1651
|
container: t,
|
|
1651
1652
|
close: () => {
|
|
1652
1653
|
var v;
|
|
1653
|
-
const
|
|
1654
|
-
|
|
1654
|
+
const M = (v = i._instance) == null ? void 0 : v.proxy;
|
|
1655
|
+
M != null && M.handleClose && M.handleClose();
|
|
1655
1656
|
}
|
|
1656
1657
|
};
|
|
1657
1658
|
_.push(m);
|
|
@@ -1693,7 +1694,7 @@ const G = Object.assign(_e, {
|
|
|
1693
1694
|
confirm: Je,
|
|
1694
1695
|
prompt: Qe,
|
|
1695
1696
|
closeAll: Ue
|
|
1696
|
-
}),
|
|
1697
|
+
}), xt = {
|
|
1697
1698
|
install(e) {
|
|
1698
1699
|
e.config.globalProperties.$msgbox = G, e.config.globalProperties.$alert = G.alert, e.config.globalProperties.$confirm = G.confirm, e.config.globalProperties.$prompt = G.prompt, e.provide("messageBox", G);
|
|
1699
1700
|
}
|
|
@@ -1702,10 +1703,10 @@ let et = 1;
|
|
|
1702
1703
|
const tt = () => {
|
|
1703
1704
|
ee.slice().forEach((e) => e.close());
|
|
1704
1705
|
}, at = {
|
|
1705
|
-
success: { iconPath: "M5 13l4 4L19 7", color: "#
|
|
1706
|
-
warning: { iconPath: "M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z", color: "#
|
|
1707
|
-
error: { iconPath: "M6 18L18 6M6 6l12 12", color: "#
|
|
1708
|
-
info: { iconPath: "M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z", color: "#
|
|
1706
|
+
success: { iconPath: "M5 13l4 4L19 7", color: "var(--xto-color-success, #10B981)" },
|
|
1707
|
+
warning: { iconPath: "M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z", color: "var(--xto-color-warning, #F59E0B)" },
|
|
1708
|
+
error: { iconPath: "M6 18L18 6M6 6l12 12", color: "var(--xto-color-danger, #EF4444)" },
|
|
1709
|
+
info: { iconPath: "M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z", color: "var(--xto-color-info, #6B7280)" }
|
|
1709
1710
|
}, ot = (e, n) => {
|
|
1710
1711
|
const t = ee.filter((a) => a.position === e);
|
|
1711
1712
|
let r = 16;
|
|
@@ -1743,46 +1744,46 @@ function ke(e) {
|
|
|
1743
1744
|
const n = et++, t = e.position || "top-right", r = document.createElement("div");
|
|
1744
1745
|
document.body.appendChild(r);
|
|
1745
1746
|
let a = null, i = !1;
|
|
1746
|
-
const m =
|
|
1747
|
+
const m = S({
|
|
1747
1748
|
name: "TNotification",
|
|
1748
1749
|
setup() {
|
|
1749
|
-
const c =
|
|
1750
|
+
const c = E(!1), w = () => {
|
|
1750
1751
|
i || (i = !0, c.value = !1, setTimeout(() => {
|
|
1751
1752
|
var b;
|
|
1752
1753
|
const l = ee.findIndex((d) => d.id === n);
|
|
1753
1754
|
l !== -1 && ee.splice(l, 1), a && clearTimeout(a), (b = e.onClose) == null || b.call(e);
|
|
1754
1755
|
try {
|
|
1755
|
-
|
|
1756
|
+
M.unmount();
|
|
1756
1757
|
} catch {
|
|
1757
1758
|
}
|
|
1758
1759
|
r.parentNode && r.parentNode.removeChild(r);
|
|
1759
1760
|
}, 300));
|
|
1760
1761
|
}, p = () => {
|
|
1761
1762
|
const l = e.duration ?? 4500;
|
|
1762
|
-
l > 0 && (a = setTimeout(
|
|
1763
|
-
},
|
|
1763
|
+
l > 0 && (a = setTimeout(w, l));
|
|
1764
|
+
}, y = () => {
|
|
1764
1765
|
a && (clearTimeout(a), a = null);
|
|
1765
|
-
},
|
|
1766
|
+
}, g = $(() => (e.offset ?? 0) + ot(t, n)), h = $(() => lt(t, g.value));
|
|
1766
1767
|
return te(() => {
|
|
1767
1768
|
c.value = !0, p();
|
|
1768
1769
|
}), {
|
|
1769
1770
|
visible: c,
|
|
1770
|
-
close:
|
|
1771
|
+
close: w,
|
|
1771
1772
|
positionStyles: h,
|
|
1772
1773
|
startTimer: p,
|
|
1773
|
-
clearTimer:
|
|
1774
|
+
clearTimer: y
|
|
1774
1775
|
};
|
|
1775
1776
|
},
|
|
1776
1777
|
render() {
|
|
1777
1778
|
if (!this.visible) return null;
|
|
1778
|
-
const c = e.type,
|
|
1779
|
+
const c = e.type, w = c ? at[c] : null, p = [];
|
|
1779
1780
|
e.title && p.push(
|
|
1780
1781
|
k("div", {
|
|
1781
1782
|
class: "x-notification__title",
|
|
1782
1783
|
style: {
|
|
1783
1784
|
fontWeight: "600",
|
|
1784
1785
|
fontSize: "16px",
|
|
1785
|
-
color: "#
|
|
1786
|
+
color: "var(--xto-color-text-primary, #1F2937)",
|
|
1786
1787
|
marginBottom: e.message ? "6px" : "0"
|
|
1787
1788
|
}
|
|
1788
1789
|
}, e.title)
|
|
@@ -1791,7 +1792,7 @@ function ke(e) {
|
|
|
1791
1792
|
class: "x-notification__content",
|
|
1792
1793
|
style: {
|
|
1793
1794
|
fontSize: "14px",
|
|
1794
|
-
color: "#
|
|
1795
|
+
color: "var(--xto-color-text-regular, #4B5563)",
|
|
1795
1796
|
lineHeight: "1.5"
|
|
1796
1797
|
},
|
|
1797
1798
|
innerHTML: e.message
|
|
@@ -1801,13 +1802,13 @@ function ke(e) {
|
|
|
1801
1802
|
class: "x-notification__content",
|
|
1802
1803
|
style: {
|
|
1803
1804
|
fontSize: "14px",
|
|
1804
|
-
color: "#
|
|
1805
|
+
color: "var(--xto-color-text-regular, #4B5563)",
|
|
1805
1806
|
lineHeight: "1.5"
|
|
1806
1807
|
}
|
|
1807
1808
|
}, e.message)
|
|
1808
1809
|
));
|
|
1809
|
-
const
|
|
1810
|
-
return
|
|
1810
|
+
const y = [];
|
|
1811
|
+
return w && y.push(
|
|
1811
1812
|
k("div", {
|
|
1812
1813
|
class: "x-notification__icon",
|
|
1813
1814
|
style: {
|
|
@@ -1817,7 +1818,7 @@ function ke(e) {
|
|
|
1817
1818
|
width: "24px",
|
|
1818
1819
|
height: "24px",
|
|
1819
1820
|
marginRight: "12px",
|
|
1820
|
-
color:
|
|
1821
|
+
color: w.color
|
|
1821
1822
|
}
|
|
1822
1823
|
}, [
|
|
1823
1824
|
k("svg", {
|
|
@@ -1831,17 +1832,17 @@ function ke(e) {
|
|
|
1831
1832
|
strokeLinecap: "round",
|
|
1832
1833
|
strokeLinejoin: "round"
|
|
1833
1834
|
}, [
|
|
1834
|
-
k("path", { d:
|
|
1835
|
+
k("path", { d: w.iconPath })
|
|
1835
1836
|
])
|
|
1836
1837
|
])
|
|
1837
|
-
),
|
|
1838
|
+
), y.push(
|
|
1838
1839
|
k("div", {
|
|
1839
1840
|
class: "x-notification__main",
|
|
1840
1841
|
style: {
|
|
1841
1842
|
flex: "1"
|
|
1842
1843
|
}
|
|
1843
1844
|
}, p)
|
|
1844
|
-
), e.showClose !== !1 &&
|
|
1845
|
+
), e.showClose !== !1 && y.push(
|
|
1845
1846
|
k("button", {
|
|
1846
1847
|
class: "x-notification__close",
|
|
1847
1848
|
style: {
|
|
@@ -1851,14 +1852,14 @@ function ke(e) {
|
|
|
1851
1852
|
background: "none",
|
|
1852
1853
|
border: "none",
|
|
1853
1854
|
cursor: "pointer",
|
|
1854
|
-
color: "#
|
|
1855
|
+
color: "var(--xto-color-text-secondary, #6B7280)",
|
|
1855
1856
|
padding: "0",
|
|
1856
1857
|
display: "flex",
|
|
1857
1858
|
alignItems: "center",
|
|
1858
1859
|
justifyContent: "center"
|
|
1859
1860
|
},
|
|
1860
|
-
onClick: (
|
|
1861
|
-
|
|
1861
|
+
onClick: (g) => {
|
|
1862
|
+
g.stopPropagation(), this.close();
|
|
1862
1863
|
}
|
|
1863
1864
|
}, [
|
|
1864
1865
|
k("svg", {
|
|
@@ -1882,26 +1883,26 @@ function ke(e) {
|
|
|
1882
1883
|
display: "flex",
|
|
1883
1884
|
alignItems: "flex-start",
|
|
1884
1885
|
padding: "14px 26px 14px 13px",
|
|
1885
|
-
borderRadius: "8px",
|
|
1886
|
-
backgroundColor: "#
|
|
1887
|
-
boxShadow: "0 4px
|
|
1888
|
-
transition: "opacity
|
|
1886
|
+
borderRadius: "var(--xto-border-radius-large, 8px)",
|
|
1887
|
+
backgroundColor: "var(--xto-bg-color, #FFFFFF)",
|
|
1888
|
+
boxShadow: "var(--xto-shadow-elevated, 0 6px 16px 0 rgba(0, 0, 0, 0.08), 0 3px 6px -4px rgba(0, 0, 0, 0.12), 0 9px 28px 8px rgba(0, 0, 0, 0.05))",
|
|
1889
|
+
transition: "opacity var(--xto-transition-duration-base, 250ms), transform var(--xto-transition-duration-base, 250ms)",
|
|
1889
1890
|
boxSizing: "border-box"
|
|
1890
1891
|
},
|
|
1891
1892
|
onMouseenter: this.clearTimer,
|
|
1892
1893
|
onMouseleave: this.startTimer
|
|
1893
|
-
},
|
|
1894
|
+
}, y);
|
|
1894
1895
|
}
|
|
1895
|
-
}),
|
|
1896
|
-
|
|
1896
|
+
}), M = ge(m);
|
|
1897
|
+
M.mount(r);
|
|
1897
1898
|
const v = {
|
|
1898
1899
|
id: n,
|
|
1899
|
-
app:
|
|
1900
|
+
app: M,
|
|
1900
1901
|
container: r,
|
|
1901
1902
|
position: t,
|
|
1902
1903
|
close: () => {
|
|
1903
|
-
var
|
|
1904
|
-
const c = (
|
|
1904
|
+
var w;
|
|
1905
|
+
const c = (w = M._instance) == null ? void 0 : w.proxy;
|
|
1905
1906
|
c != null && c.close && c.close();
|
|
1906
1907
|
}
|
|
1907
1908
|
};
|
|
@@ -1916,27 +1917,27 @@ const ie = (e) => (n) => ke({ ...typeof n == "string" ? { message: n } : n, type
|
|
|
1916
1917
|
warning: ie("warning"),
|
|
1917
1918
|
error: ie("error"),
|
|
1918
1919
|
closeAll: tt
|
|
1919
|
-
}),
|
|
1920
|
+
}), yt = {
|
|
1920
1921
|
install(e) {
|
|
1921
1922
|
e.config.globalProperties.$notify = pe, e.provide("notification", pe);
|
|
1922
1923
|
}
|
|
1923
|
-
},
|
|
1924
|
+
}, wt = ve, kt = G, zt = pe;
|
|
1924
1925
|
export {
|
|
1925
1926
|
dt as Alert,
|
|
1926
1927
|
ft as Backtop,
|
|
1927
1928
|
ct as Drawer,
|
|
1928
1929
|
ut as DrawerForm,
|
|
1929
|
-
|
|
1930
|
+
wt as Message,
|
|
1930
1931
|
kt as MessageBox,
|
|
1931
|
-
|
|
1932
|
+
Mt as MessageComponent,
|
|
1932
1933
|
rt as Modal,
|
|
1933
1934
|
zt as Notification,
|
|
1934
1935
|
ht as Popconfirm,
|
|
1935
1936
|
vt as Result,
|
|
1936
1937
|
bt as TMessage,
|
|
1937
|
-
|
|
1938
|
-
|
|
1938
|
+
xt as TMessageBox,
|
|
1939
|
+
yt as TNotification,
|
|
1939
1940
|
pt as Timeline,
|
|
1940
|
-
|
|
1941
|
+
gt as TimelineItem,
|
|
1941
1942
|
mt as Tooltip
|
|
1942
1943
|
};
|