@xto/data 1.4.5 → 1.5.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/Progress/types.d.ts +1 -1
- package/es/index.mjs +274 -274
- package/es/style.css +1 -1
- package/lib/index.cjs +1 -1
- package/lib/style.css +1 -1
- package/package.json +1 -1
package/es/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as G, computed as x, openBlock as h, createElementBlock as f, normalizeStyle as Y, normalizeClass as c, createElementVNode as p, renderSlot as X, createTextVNode as ae, toDisplayString as W, unref as s, createVNode as ee, createCommentVNode as D, ref as E, watch as ne, Fragment as Z, renderList as le, withDirectives as ge, withKeys as Ie, vModelText as $e, useSlots as me, withModifiers as ie, inject as ue, resolveComponent as Se, createBlock as oe, withCtx as ye, vShow as we, reactive as xe, provide as de, toRef as Ae, nextTick as be, onMounted as ce, onUnmounted as he, resolveDynamicComponent as pe, Teleport as Le, onBeforeUnmount as Ke } from "vue";
|
|
2
2
|
import { useNamespace as U } from "@xto/core";
|
|
3
3
|
const Ce = {
|
|
4
4
|
// 箭头类
|
|
@@ -201,10 +201,10 @@ const Ce = {
|
|
|
201
201
|
up: "M5 15l7-7 7 7"
|
|
202
202
|
// 上箭头
|
|
203
203
|
};
|
|
204
|
-
function
|
|
204
|
+
function De(n) {
|
|
205
205
|
return n in Ce;
|
|
206
206
|
}
|
|
207
|
-
const He = ["aria-hidden", "aria-label"], Ne = ["stroke-width"], Ve = ["d"], q = /* @__PURE__ */
|
|
207
|
+
const He = ["aria-hidden", "aria-label"], Ne = ["stroke-width"], Ve = ["d"], q = /* @__PURE__ */ G({
|
|
208
208
|
name: "XIcon",
|
|
209
209
|
__name: "index",
|
|
210
210
|
props: {
|
|
@@ -224,7 +224,7 @@ const He = ["aria-hidden", "aria-label"], Ne = ["stroke-width"], Ve = ["d"], q =
|
|
|
224
224
|
})), m = x(() => [
|
|
225
225
|
e.b(),
|
|
226
226
|
e.is("spin", t.spin)
|
|
227
|
-
]), M = x(() => t.name &&
|
|
227
|
+
]), M = x(() => t.name && De(t.name) ? Ce[t.name] : "");
|
|
228
228
|
return o({
|
|
229
229
|
iconSize: r,
|
|
230
230
|
iconStyle: l,
|
|
@@ -253,7 +253,7 @@ const He = ["aria-hidden", "aria-label"], Ne = ["stroke-width"], Ve = ["d"], q =
|
|
|
253
253
|
])
|
|
254
254
|
], 14, He));
|
|
255
255
|
}
|
|
256
|
-
}), Tt = /* @__PURE__ */
|
|
256
|
+
}), Tt = /* @__PURE__ */ G({
|
|
257
257
|
name: "XTag",
|
|
258
258
|
__name: "index",
|
|
259
259
|
props: {
|
|
@@ -293,10 +293,10 @@ const He = ["aria-hidden", "aria-label"], Ne = ["stroke-width"], Ve = ["d"], q =
|
|
|
293
293
|
name: "close",
|
|
294
294
|
size: 10
|
|
295
295
|
})
|
|
296
|
-
], 2)) :
|
|
296
|
+
], 2)) : D("", !0)
|
|
297
297
|
], 6));
|
|
298
298
|
}
|
|
299
|
-
}), Et = /* @__PURE__ */
|
|
299
|
+
}), Et = /* @__PURE__ */ G({
|
|
300
300
|
name: "XCard",
|
|
301
301
|
__name: "index",
|
|
302
302
|
props: {
|
|
@@ -319,7 +319,7 @@ const He = ["aria-hidden", "aria-label"], Ne = ["stroke-width"], Ve = ["d"], q =
|
|
|
319
319
|
X(r.$slots, "header", {}, () => [
|
|
320
320
|
ae(W(n.header), 1)
|
|
321
321
|
])
|
|
322
|
-
], 2)) :
|
|
322
|
+
], 2)) : D("", !0),
|
|
323
323
|
p("div", {
|
|
324
324
|
class: c(s(t).e("body")),
|
|
325
325
|
style: Y(n.bodyStyle)
|
|
@@ -328,7 +328,7 @@ const He = ["aria-hidden", "aria-label"], Ne = ["stroke-width"], Ve = ["d"], q =
|
|
|
328
328
|
], 6)
|
|
329
329
|
], 2));
|
|
330
330
|
}
|
|
331
|
-
}), Te = ["viewBox"], Ee = ["cx", "cy", "r", "stroke-width"], Be = ["cx", "cy", "r", "stroke-width", "stroke-dasharray", "stroke"], Bt = /* @__PURE__ */
|
|
331
|
+
}), Te = ["viewBox"], Ee = ["cx", "cy", "r", "stroke-width"], Be = ["cx", "cy", "r", "stroke-width", "stroke-dasharray", "stroke"], Bt = /* @__PURE__ */ G({
|
|
332
332
|
name: "XProgress",
|
|
333
333
|
__name: "index",
|
|
334
334
|
props: {
|
|
@@ -336,7 +336,7 @@ const He = ["aria-hidden", "aria-label"], Ne = ["stroke-width"], Ve = ["d"], q =
|
|
|
336
336
|
type: { default: "line" },
|
|
337
337
|
status: { default: "" },
|
|
338
338
|
strokeWidth: { default: 6 },
|
|
339
|
-
color: { type: [String, Array, Function], default: "#
|
|
339
|
+
color: { type: [String, Array, Function], default: "#12B6AF" },
|
|
340
340
|
width: { default: 126 },
|
|
341
341
|
showText: { type: Boolean, default: !0 }
|
|
342
342
|
},
|
|
@@ -372,7 +372,7 @@ const He = ["aria-hidden", "aria-label"], Ne = ["stroke-width"], Ve = ["d"], q =
|
|
|
372
372
|
n.showText ? (h(), f("div", {
|
|
373
373
|
key: 0,
|
|
374
374
|
class: c(s(t).e("text"))
|
|
375
|
-
}, W(e.value) + "% ", 3)) :
|
|
375
|
+
}, W(e.value) + "% ", 3)) : D("", !0)
|
|
376
376
|
], 2)) : (h(), f("div", {
|
|
377
377
|
key: 1,
|
|
378
378
|
class: c(s(t).e("circle"))
|
|
@@ -387,7 +387,7 @@ const He = ["aria-hidden", "aria-label"], Ne = ["stroke-width"], Ve = ["d"], q =
|
|
|
387
387
|
r: (n.width - n.strokeWidth) / 2,
|
|
388
388
|
fill: "none",
|
|
389
389
|
"stroke-width": n.strokeWidth,
|
|
390
|
-
stroke: "var(--xto-fill-color, #
|
|
390
|
+
stroke: "var(--xto-fill-color, #F2F3F5)"
|
|
391
391
|
}, null, 8, Ee),
|
|
392
392
|
p("circle", {
|
|
393
393
|
cx: n.width / 2,
|
|
@@ -404,11 +404,11 @@ const He = ["aria-hidden", "aria-label"], Ne = ["stroke-width"], Ve = ["d"], q =
|
|
|
404
404
|
n.showText ? (h(), f("div", {
|
|
405
405
|
key: 0,
|
|
406
406
|
class: c(s(t).e("circle-text"))
|
|
407
|
-
}, W(e.value) + "% ", 3)) :
|
|
407
|
+
}, W(e.value) + "% ", 3)) : D("", !0)
|
|
408
408
|
], 2))
|
|
409
409
|
], 2));
|
|
410
410
|
}
|
|
411
|
-
}), je = ["disabled"], Re = ["onClick"], We = ["disabled"], Pe = ["value"], Oe = ["value"], Ye = /* @__PURE__ */
|
|
411
|
+
}), je = ["disabled"], Re = ["onClick"], We = ["disabled"], Pe = ["value"], Oe = ["value"], Ye = /* @__PURE__ */ G({
|
|
412
412
|
name: "XPagination",
|
|
413
413
|
__name: "index",
|
|
414
414
|
props: {
|
|
@@ -428,7 +428,7 @@ const He = ["aria-hidden", "aria-label"], Ne = ["stroke-width"], Ve = ["d"], q =
|
|
|
428
428
|
});
|
|
429
429
|
const m = x(() => l.value), M = x(() => a.value), w = x(() => Math.max(1, Math.ceil(t.total / M.value))), $ = x(
|
|
430
430
|
() => t.layout.split(",").map((I) => I.trim()).filter(Boolean)
|
|
431
|
-
), H = (I) => $.value.includes(I),
|
|
431
|
+
), H = (I) => $.value.includes(I), A = x(() => {
|
|
432
432
|
const I = [], g = w.value, C = m.value;
|
|
433
433
|
if (g <= 7)
|
|
434
434
|
for (let z = 1; z <= g; z++) I.push(z);
|
|
@@ -446,7 +446,7 @@ const He = ["aria-hidden", "aria-label"], Ne = ["stroke-width"], Ve = ["d"], q =
|
|
|
446
446
|
return I;
|
|
447
447
|
}), N = (I) => {
|
|
448
448
|
I < 1 || I > w.value || I === m.value || (l.value = I, e("update:currentPage", I), e("current-change", I));
|
|
449
|
-
},
|
|
449
|
+
}, L = (I) => {
|
|
450
450
|
I !== M.value && (a.value = I, e("update:pageSize", I), e("size-change", I), l.value = 1, e("update:currentPage", 1), e("current-change", 1));
|
|
451
451
|
}, T = E(""), j = () => {
|
|
452
452
|
const I = parseInt(T.value, 10);
|
|
@@ -458,7 +458,7 @@ const He = ["aria-hidden", "aria-label"], Ne = ["stroke-width"], Ve = ["d"], q =
|
|
|
458
458
|
H("total") ? (h(), f("span", {
|
|
459
459
|
key: 0,
|
|
460
460
|
class: c(s(r).e("total"))
|
|
461
|
-
}, "共 " + W(n.total) + " 条", 3)) :
|
|
461
|
+
}, "共 " + W(n.total) + " 条", 3)) : D("", !0),
|
|
462
462
|
H("prev") ? (h(), f("button", {
|
|
463
463
|
key: 1,
|
|
464
464
|
class: c(s(r).e("btn")),
|
|
@@ -479,8 +479,8 @@ const He = ["aria-hidden", "aria-label"], Ne = ["stroke-width"], Ve = ["d"], q =
|
|
|
479
479
|
"stroke-linejoin": "round"
|
|
480
480
|
})
|
|
481
481
|
], -1)
|
|
482
|
-
])], 10, je)) :
|
|
483
|
-
H("pager") ? (h(!0), f(Z, { key: 2 }, le(
|
|
482
|
+
])], 10, je)) : D("", !0),
|
|
483
|
+
H("pager") ? (h(!0), f(Z, { key: 2 }, le(A.value, (C) => (h(), f(Z, { key: C }, [
|
|
484
484
|
C === -1 ? (h(), f("span", {
|
|
485
485
|
key: 0,
|
|
486
486
|
class: c(s(r).e("ellipsis"))
|
|
@@ -489,7 +489,7 @@ const He = ["aria-hidden", "aria-label"], Ne = ["stroke-width"], Ve = ["d"], q =
|
|
|
489
489
|
class: c([s(r).e("btn"), s(r).is("active", C === m.value)]),
|
|
490
490
|
onClick: (z) => N(C)
|
|
491
491
|
}, W(C), 11, Re))
|
|
492
|
-
], 64))), 128)) :
|
|
492
|
+
], 64))), 128)) : D("", !0),
|
|
493
493
|
H("next") ? (h(), f("button", {
|
|
494
494
|
key: 3,
|
|
495
495
|
class: c(s(r).e("btn")),
|
|
@@ -510,18 +510,18 @@ const He = ["aria-hidden", "aria-label"], Ne = ["stroke-width"], Ve = ["d"], q =
|
|
|
510
510
|
"stroke-linejoin": "round"
|
|
511
511
|
})
|
|
512
512
|
], -1)
|
|
513
|
-
])], 10, We)) :
|
|
513
|
+
])], 10, We)) : D("", !0),
|
|
514
514
|
H("sizes") ? (h(), f("select", {
|
|
515
515
|
key: 4,
|
|
516
516
|
class: c(s(r).e("sizes")),
|
|
517
517
|
value: M.value,
|
|
518
|
-
onChange: g[2] || (g[2] = (C) =>
|
|
518
|
+
onChange: g[2] || (g[2] = (C) => L(Number(C.target.value)))
|
|
519
519
|
}, [
|
|
520
520
|
(h(!0), f(Z, null, le(n.pageSizes, (C) => (h(), f("option", {
|
|
521
521
|
key: C,
|
|
522
522
|
value: C
|
|
523
523
|
}, W(C) + " 条/页", 9, Oe))), 128))
|
|
524
|
-
], 42, Pe)) :
|
|
524
|
+
], 42, Pe)) : D("", !0),
|
|
525
525
|
H("jumper") ? (h(), f("span", {
|
|
526
526
|
key: 5,
|
|
527
527
|
class: c(s(r).e("jumper"))
|
|
@@ -538,10 +538,10 @@ const He = ["aria-hidden", "aria-label"], Ne = ["stroke-width"], Ve = ["d"], q =
|
|
|
538
538
|
[$e, T.value]
|
|
539
539
|
]),
|
|
540
540
|
g[7] || (g[7] = ae(" 页 ", -1))
|
|
541
|
-
], 2)) :
|
|
541
|
+
], 2)) : D("", !0)
|
|
542
542
|
], 2));
|
|
543
543
|
}
|
|
544
|
-
}), Xe = { key: 0 },
|
|
544
|
+
}), Xe = { key: 0 }, Fe = ["checked", "indeterminate"], Qe = ["onClick"], Ge = { class: "sort-arrow up" }, Ue = { class: "sort-arrow down" }, Ze = ["onClick"], Je = ["checked", "onChange"], qe = ["onClick"], _e = ["onClick"], et = { key: 1 }, tt = ["colspan"], jt = /* @__PURE__ */ G({
|
|
545
545
|
name: "XDynamicTable",
|
|
546
546
|
__name: "index",
|
|
547
547
|
props: {
|
|
@@ -580,16 +580,16 @@ const He = ["aria-hidden", "aria-label"], Ne = ["stroke-width"], Ve = ["d"], q =
|
|
|
580
580
|
return [...a.value].sort((y, u) => {
|
|
581
581
|
const k = y[d], S = u[d];
|
|
582
582
|
if (k === S) return 0;
|
|
583
|
-
const
|
|
584
|
-
return v === "ascending" ?
|
|
583
|
+
const K = k > S ? 1 : -1;
|
|
584
|
+
return v === "ascending" ? K : -K;
|
|
585
585
|
});
|
|
586
|
-
}),
|
|
586
|
+
}), A = x(() => {
|
|
587
587
|
const d = {};
|
|
588
588
|
return e.height && (d.height = typeof e.height == "number" ? `${e.height}px` : e.height), e.maxHeight && (d.maxHeight = typeof e.maxHeight == "number" ? `${e.maxHeight}px` : e.maxHeight), d;
|
|
589
589
|
}), N = x(() => {
|
|
590
590
|
const d = typeof e.operationWidth == "number" ? `${e.operationWidth}px` : e.operationWidth;
|
|
591
591
|
return { width: d, minWidth: d };
|
|
592
|
-
}),
|
|
592
|
+
}), L = x(() => [
|
|
593
593
|
l.b(),
|
|
594
594
|
l.is("border", e.border),
|
|
595
595
|
l.is("stripe", e.stripe),
|
|
@@ -615,7 +615,7 @@ const He = ["aria-hidden", "aria-label"], Ne = ["stroke-width"], Ve = ["d"], q =
|
|
|
615
615
|
}, J = (d) => M.value.some((v) => typeof e.rowKey == "function" ? e.rowKey(v) === e.rowKey(d) : e.rowKey ? v[e.rowKey] === d[e.rowKey] : v === d), O = (d) => {
|
|
616
616
|
const v = {};
|
|
617
617
|
return d.width && (v.width = typeof d.width == "number" ? `${d.width}px` : d.width), d.minWidth && (v.minWidth = typeof d.minWidth == "number" ? `${d.minWidth}px` : d.minWidth), d.align && (v.textAlign = d.align), v;
|
|
618
|
-
},
|
|
618
|
+
}, Q = (d) => {
|
|
619
619
|
const v = d || {};
|
|
620
620
|
e.columns.forEach((y) => {
|
|
621
621
|
v[y.prop] === void 0 && (v[y.prop] = "");
|
|
@@ -630,11 +630,11 @@ const He = ["aria-hidden", "aria-label"], Ne = ["stroke-width"], Ve = ["d"], q =
|
|
|
630
630
|
},
|
|
631
631
|
getSelection: () => [...M.value],
|
|
632
632
|
sortState: m,
|
|
633
|
-
addRow:
|
|
633
|
+
addRow: Q,
|
|
634
634
|
deleteRow: te,
|
|
635
635
|
getData: () => [...a.value]
|
|
636
636
|
}), (d, v) => (h(), f("div", {
|
|
637
|
-
class: c(
|
|
637
|
+
class: c(L.value)
|
|
638
638
|
}, [
|
|
639
639
|
n.showAddButton ? (h(), f("div", {
|
|
640
640
|
key: 0,
|
|
@@ -643,23 +643,23 @@ const He = ["aria-hidden", "aria-label"], Ne = ["stroke-width"], Ve = ["d"], q =
|
|
|
643
643
|
X(d.$slots, "toolbar", {}, () => [
|
|
644
644
|
p("button", {
|
|
645
645
|
class: c(s(l).e("add-btn")),
|
|
646
|
-
onClick: v[0] || (v[0] = (y) =>
|
|
646
|
+
onClick: v[0] || (v[0] = (y) => Q())
|
|
647
647
|
}, [...v[2] || (v[2] = [
|
|
648
648
|
p("span", { class: "add-icon" }, "+", -1),
|
|
649
649
|
ae(" 新增一行 ", -1)
|
|
650
650
|
])], 2)
|
|
651
651
|
])
|
|
652
|
-
], 2)) :
|
|
652
|
+
], 2)) : D("", !0),
|
|
653
653
|
n.loading ? (h(), f("div", {
|
|
654
654
|
key: 1,
|
|
655
655
|
class: c(s(l).e("loading"))
|
|
656
656
|
}, [...v[3] || (v[3] = [
|
|
657
657
|
p("span", { class: "loading-spinner" }, null, -1),
|
|
658
658
|
p("span", { class: "loading-text" }, "加载中...", -1)
|
|
659
|
-
])], 2)) :
|
|
659
|
+
])], 2)) : D("", !0),
|
|
660
660
|
p("div", {
|
|
661
661
|
class: c(s(l).e("wrapper")),
|
|
662
|
-
style: Y(
|
|
662
|
+
style: Y(A.value)
|
|
663
663
|
}, [
|
|
664
664
|
p("table", null, [
|
|
665
665
|
n.showHeader ? (h(), f("thead", Xe, [
|
|
@@ -673,13 +673,13 @@ const He = ["aria-hidden", "aria-label"], Ne = ["stroke-width"], Ve = ["d"], q =
|
|
|
673
673
|
checked: w.value,
|
|
674
674
|
indeterminate: $.value,
|
|
675
675
|
onChange: z
|
|
676
|
-
}, null, 40,
|
|
677
|
-
], 2)) :
|
|
676
|
+
}, null, 40, Fe)
|
|
677
|
+
], 2)) : D("", !0),
|
|
678
678
|
n.showIndex ? (h(), f("th", {
|
|
679
679
|
key: 1,
|
|
680
680
|
class: c(s(l).e("header-cell")),
|
|
681
681
|
style: { width: "60px" }
|
|
682
|
-
}, " 序号 ", 2)) :
|
|
682
|
+
}, " 序号 ", 2)) : D("", !0),
|
|
683
683
|
(h(!0), f(Z, null, le(n.columns, (y) => (h(), f("th", {
|
|
684
684
|
key: y.prop,
|
|
685
685
|
class: c([s(l).e("header-cell"), j(y)]),
|
|
@@ -691,7 +691,7 @@ const He = ["aria-hidden", "aria-label"], Ne = ["stroke-width"], Ve = ["d"], q =
|
|
|
691
691
|
key: 0,
|
|
692
692
|
class: c(s(l).e("sort-icon"))
|
|
693
693
|
}, [
|
|
694
|
-
p("span",
|
|
694
|
+
p("span", Ge, [
|
|
695
695
|
ee(s(q), {
|
|
696
696
|
name: "sort-up",
|
|
697
697
|
size: 12
|
|
@@ -703,15 +703,15 @@ const He = ["aria-hidden", "aria-label"], Ne = ["stroke-width"], Ve = ["d"], q =
|
|
|
703
703
|
size: 12
|
|
704
704
|
})
|
|
705
705
|
])
|
|
706
|
-
], 2)) :
|
|
707
|
-
], 14,
|
|
706
|
+
], 2)) : D("", !0)
|
|
707
|
+
], 14, Qe))), 128)),
|
|
708
708
|
n.showOperation ? (h(), f("th", {
|
|
709
709
|
key: 2,
|
|
710
710
|
class: c(s(l).e("header-cell")),
|
|
711
711
|
style: Y(N.value)
|
|
712
|
-
}, W(n.operationLabel), 7)) :
|
|
712
|
+
}, W(n.operationLabel), 7)) : D("", !0)
|
|
713
713
|
])
|
|
714
|
-
])) :
|
|
714
|
+
])) : D("", !0),
|
|
715
715
|
p("tbody", null, [
|
|
716
716
|
(h(!0), f(Z, null, le(H.value, (y, u) => (h(), f("tr", {
|
|
717
717
|
key: n.rowKey ? typeof n.rowKey == "function" ? n.rowKey(y) : y[n.rowKey] : u,
|
|
@@ -729,11 +729,11 @@ const He = ["aria-hidden", "aria-label"], Ne = ["stroke-width"], Ve = ["d"], q =
|
|
|
729
729
|
}, ["stop"])),
|
|
730
730
|
onChange: (k) => R(y)
|
|
731
731
|
}, null, 40, Je)
|
|
732
|
-
], 2)) :
|
|
732
|
+
], 2)) : D("", !0),
|
|
733
733
|
n.showIndex ? (h(), f("td", {
|
|
734
734
|
key: 1,
|
|
735
735
|
class: c(s(l).e("cell"))
|
|
736
|
-
}, W(u + 1), 3)) :
|
|
736
|
+
}, W(u + 1), 3)) : D("", !0),
|
|
737
737
|
(h(!0), f(Z, null, le(n.columns, (k) => (h(), f("td", {
|
|
738
738
|
key: k.prop,
|
|
739
739
|
class: c(s(l).e("cell")),
|
|
@@ -762,7 +762,7 @@ const He = ["aria-hidden", "aria-label"], Ne = ["stroke-width"], Ve = ["d"], q =
|
|
|
762
762
|
onClick: ie((k) => te(u), ["stop"])
|
|
763
763
|
}, " 删除 ", 10, _e)
|
|
764
764
|
])
|
|
765
|
-
], 2)) :
|
|
765
|
+
], 2)) : D("", !0)
|
|
766
766
|
], 10, Ze))), 128))
|
|
767
767
|
]),
|
|
768
768
|
H.value.length === 0 && !n.loading ? (h(), f("tbody", et, [
|
|
@@ -776,7 +776,7 @@ const He = ["aria-hidden", "aria-label"], Ne = ["stroke-width"], Ve = ["d"], q =
|
|
|
776
776
|
])
|
|
777
777
|
], 10, tt)
|
|
778
778
|
])
|
|
779
|
-
])) :
|
|
779
|
+
])) : D("", !0)
|
|
780
780
|
])
|
|
781
781
|
], 6)
|
|
782
782
|
], 2));
|
|
@@ -790,26 +790,26 @@ const He = ["aria-hidden", "aria-label"], Ne = ["stroke-width"], Ve = ["d"], q =
|
|
|
790
790
|
}, st = {
|
|
791
791
|
key: 0,
|
|
792
792
|
class: "x-tree-node__icon"
|
|
793
|
-
}, ot = { class: "x-tree-node__label" }, it = /* @__PURE__ */
|
|
793
|
+
}, ot = { class: "x-tree-node__label" }, it = /* @__PURE__ */ G({
|
|
794
794
|
name: "XTreeNode",
|
|
795
795
|
__name: "tree-node",
|
|
796
796
|
props: {
|
|
797
797
|
node: {}
|
|
798
798
|
},
|
|
799
799
|
setup(n) {
|
|
800
|
-
const o = n, t = ue("tree"), { props: e, store: r, toggleExpand: l, toggleCheck: a, handleNodeClick: m, handleNodeContextmenu: M } = t, w = E(), $ = E(null), H = x(() => o.node.expanded),
|
|
800
|
+
const o = n, t = ue("tree"), { props: e, store: r, toggleExpand: l, toggleCheck: a, handleNodeClick: m, handleNodeContextmenu: M } = t, w = E(), $ = E(null), H = x(() => o.node.expanded), A = x(() => o.node.checked), N = x(() => o.node.indeterminate), L = x(() => o.node.disabled), T = x(() => o.node.loading), j = x(() => o.node.isLeaf), I = x(() => e.showCheckbox || e.checkable), g = x(() => o.node.selected), C = x(() => ({
|
|
801
801
|
paddingLeft: `${o.node.level * (e.indent || 16)}px`
|
|
802
802
|
})), z = (i) => {
|
|
803
803
|
m(o.node, i);
|
|
804
804
|
}, R = (i) => {
|
|
805
805
|
M(o.node, i);
|
|
806
806
|
}, J = (i) => {
|
|
807
|
-
i.stopPropagation(),
|
|
807
|
+
i.stopPropagation(), L.value || l(o.node);
|
|
808
808
|
}, O = (i) => {
|
|
809
|
-
i.stopPropagation(),
|
|
810
|
-
},
|
|
809
|
+
i.stopPropagation(), L.value || a(o.node);
|
|
810
|
+
}, Q = (i) => {
|
|
811
811
|
var d;
|
|
812
|
-
if (!(!e.draggable ||
|
|
812
|
+
if (!(!e.draggable || L.value)) {
|
|
813
813
|
if (e.allowDrag && !e.allowDrag(o.node)) {
|
|
814
814
|
i.preventDefault();
|
|
815
815
|
return;
|
|
@@ -824,7 +824,7 @@ const He = ["aria-hidden", "aria-label"], Ne = ["stroke-width"], Ve = ["d"], q =
|
|
|
824
824
|
$.value = null, (d = t.emit) == null || d.call(t, "node-drag-leave", o.node, i);
|
|
825
825
|
}, _ = (i) => {
|
|
826
826
|
var u, k;
|
|
827
|
-
if (i.preventDefault(), !e.draggable ||
|
|
827
|
+
if (i.preventDefault(), !e.draggable || L.value) return;
|
|
828
828
|
const d = (u = w.value) == null ? void 0 : u.getBoundingClientRect();
|
|
829
829
|
if (!d) return;
|
|
830
830
|
const v = i.clientY - d.top, y = d.height;
|
|
@@ -858,13 +858,13 @@ const He = ["aria-hidden", "aria-label"], Ne = ["stroke-width"], Ve = ["d"], q =
|
|
|
858
858
|
"is-expanded": H.value,
|
|
859
859
|
"is-current": i.isCurrent,
|
|
860
860
|
"is-selected": g.value,
|
|
861
|
-
"is-disabled":
|
|
861
|
+
"is-disabled": L.value,
|
|
862
862
|
"is-drop-inner": $.value === "inner",
|
|
863
863
|
"is-drop-prev": $.value === "prev",
|
|
864
864
|
"is-drop-next": $.value === "next"
|
|
865
865
|
}]),
|
|
866
|
-
draggable: s(e).draggable && !
|
|
867
|
-
onDragstart:
|
|
866
|
+
draggable: s(e).draggable && !L.value,
|
|
867
|
+
onDragstart: Q,
|
|
868
868
|
onDragenter: te,
|
|
869
869
|
onDragleave: se,
|
|
870
870
|
onDragover: _,
|
|
@@ -886,20 +886,20 @@ const He = ["aria-hidden", "aria-label"], Ne = ["stroke-width"], Ve = ["d"], q =
|
|
|
886
886
|
onClick: J
|
|
887
887
|
}, [
|
|
888
888
|
T.value ? (h(), f("span", lt)) : (h(), f(Z, { key: 1 }, [
|
|
889
|
-
j.value ?
|
|
889
|
+
j.value ? D("", !0) : (h(), f("span", nt))
|
|
890
890
|
], 64))
|
|
891
891
|
], 2),
|
|
892
|
-
n.node.icon || s(e).icon ? (h(), f("span", st, W(n.node.icon || s(e).icon), 1)) :
|
|
892
|
+
n.node.icon || s(e).icon ? (h(), f("span", st, W(n.node.icon || s(e).icon), 1)) : D("", !0),
|
|
893
893
|
I.value ? (h(), f("span", {
|
|
894
894
|
key: 1,
|
|
895
895
|
class: c(["x-tree-node__checkbox", {
|
|
896
|
-
"is-checked":
|
|
896
|
+
"is-checked": A.value,
|
|
897
897
|
"is-indeterminate": N.value,
|
|
898
|
-
"is-disabled":
|
|
898
|
+
"is-disabled": L.value
|
|
899
899
|
}]),
|
|
900
900
|
onClick: ie(O, ["stop"])
|
|
901
901
|
}, [
|
|
902
|
-
|
|
902
|
+
A.value ? (h(), oe(s(q), {
|
|
903
903
|
key: 0,
|
|
904
904
|
name: "check",
|
|
905
905
|
size: 12,
|
|
@@ -909,8 +909,8 @@ const He = ["aria-hidden", "aria-label"], Ne = ["stroke-width"], Ve = ["d"], q =
|
|
|
909
909
|
name: "minus",
|
|
910
910
|
size: 12,
|
|
911
911
|
class: "x-tree-node__checkbox-icon"
|
|
912
|
-
})) :
|
|
913
|
-
], 2)) :
|
|
912
|
+
})) : D("", !0)
|
|
913
|
+
], 2)) : D("", !0),
|
|
914
914
|
p("span", ot, [
|
|
915
915
|
X(i.$slots, "default", {
|
|
916
916
|
node: n.node,
|
|
@@ -935,8 +935,8 @@ const He = ["aria-hidden", "aria-label"], Ne = ["stroke-width"], Ve = ["d"], q =
|
|
|
935
935
|
})
|
|
936
936
|
]),
|
|
937
937
|
_: 3
|
|
938
|
-
}, 8, ["node"]))), 128)) :
|
|
939
|
-
], 2)) :
|
|
938
|
+
}, 8, ["node"]))), 128)) : D("", !0)
|
|
939
|
+
], 2)) : D("", !0)
|
|
940
940
|
], 42, at)), [
|
|
941
941
|
[we, n.node.visible && (((y = n.node.parent) == null ? void 0 : y.expanded) ?? !0)]
|
|
942
942
|
]);
|
|
@@ -950,7 +950,7 @@ class re {
|
|
|
950
950
|
this.key = o[a] ?? o.value ?? o.id ?? Math.random().toString(), this.label = o[m] ?? o.label ?? "", this.disabled = o[M] ?? o.disabled ?? !1, this.isLeaf = o[w] ?? o.isLeaf ?? !1;
|
|
951
951
|
const $ = l.children || "children", H = o[$] ?? o.children ?? [];
|
|
952
952
|
H.length > 0 ? this.children = H.map(
|
|
953
|
-
(
|
|
953
|
+
(A) => new re(A, t, e + 1, this)
|
|
954
954
|
) : this.isLeaf = !0;
|
|
955
955
|
}
|
|
956
956
|
/** 设置展开状态 */
|
|
@@ -1017,7 +1017,7 @@ class re {
|
|
|
1017
1017
|
return t(this.children), o;
|
|
1018
1018
|
}
|
|
1019
1019
|
}
|
|
1020
|
-
const Rt = /* @__PURE__ */
|
|
1020
|
+
const Rt = /* @__PURE__ */ G({
|
|
1021
1021
|
name: "XTree",
|
|
1022
1022
|
__name: "index",
|
|
1023
1023
|
props: {
|
|
@@ -1081,7 +1081,7 @@ const Rt = /* @__PURE__ */ F({
|
|
|
1081
1081
|
const d = M(), v = (y, u, k) => {
|
|
1082
1082
|
const S = new re(y, a, u, k);
|
|
1083
1083
|
a.nodesMap.set(S.key, S);
|
|
1084
|
-
const
|
|
1084
|
+
const K = (d == null ? void 0 : d.children) || "children", P = y[K] ?? y.children ?? [];
|
|
1085
1085
|
return P.length > 0 && (S.children = P.map(
|
|
1086
1086
|
(B) => v(B, u + 1, S)
|
|
1087
1087
|
), S.isLeaf = !1), S;
|
|
@@ -1089,7 +1089,7 @@ const Rt = /* @__PURE__ */ F({
|
|
|
1089
1089
|
a.rootNodes = i.map((y) => v(y, 0, null)), H();
|
|
1090
1090
|
}, H = () => {
|
|
1091
1091
|
var i, d, v;
|
|
1092
|
-
e.defaultExpandAll ?
|
|
1092
|
+
e.defaultExpandAll ? A() : (i = e.defaultExpandedKeys) != null && i.length && e.defaultExpandedKeys.forEach((y) => {
|
|
1093
1093
|
const u = a.nodesMap.get(y);
|
|
1094
1094
|
u && (u.expanded = !0, a.expandedKeys.add(y));
|
|
1095
1095
|
}), (d = e.defaultCheckedKeys) != null && d.length && e.defaultCheckedKeys.forEach((y) => {
|
|
@@ -1099,7 +1099,7 @@ const Rt = /* @__PURE__ */ F({
|
|
|
1099
1099
|
const u = a.nodesMap.get(y);
|
|
1100
1100
|
u && u.setChecked(!0, !e.checkStrictly);
|
|
1101
1101
|
});
|
|
1102
|
-
},
|
|
1102
|
+
}, A = () => {
|
|
1103
1103
|
a.nodesMap.forEach((i) => {
|
|
1104
1104
|
i.children.length > 0 && (i.expanded = !0, a.expandedKeys.add(i.key));
|
|
1105
1105
|
});
|
|
@@ -1107,7 +1107,7 @@ const Rt = /* @__PURE__ */ F({
|
|
|
1107
1107
|
a.nodesMap.forEach((i) => {
|
|
1108
1108
|
i.expanded = !1;
|
|
1109
1109
|
}), a.expandedKeys.clear();
|
|
1110
|
-
},
|
|
1110
|
+
}, L = (i) => {
|
|
1111
1111
|
if (i.disabled) return;
|
|
1112
1112
|
!i.expanded ? (i.expanded = !0, a.expandedKeys.add(i.key), r("node-expand", i.data, i, null)) : (i.expanded = !1, a.expandedKeys.delete(i.key), r("node-collapse", i.data, i, null));
|
|
1113
1113
|
}, T = (i, d) => {
|
|
@@ -1115,8 +1115,8 @@ const Rt = /* @__PURE__ */ F({
|
|
|
1115
1115
|
const v = d ?? !i.checked;
|
|
1116
1116
|
i.setChecked(v, !e.checkStrictly), r("check-change", i.data, i.checked, i.indeterminate);
|
|
1117
1117
|
const y = [], u = [], k = [], S = [];
|
|
1118
|
-
a.nodesMap.forEach((
|
|
1119
|
-
|
|
1118
|
+
a.nodesMap.forEach((K) => {
|
|
1119
|
+
K.checked && (y.push(K.data), u.push(K.key)), K.indeterminate && (k.push(K.data), S.push(K.key));
|
|
1120
1120
|
}), r("check", i.data, {
|
|
1121
1121
|
checkedNodes: y,
|
|
1122
1122
|
checkedKeys: u,
|
|
@@ -1124,7 +1124,7 @@ const Rt = /* @__PURE__ */ F({
|
|
|
1124
1124
|
halfCheckedKeys: S
|
|
1125
1125
|
});
|
|
1126
1126
|
}, j = (i, d) => {
|
|
1127
|
-
i.disabled || (r("node-click", i.data, i, null), e.expandOnClickNode && i.children.length > 0 &&
|
|
1127
|
+
i.disabled || (r("node-click", i.data, i, null), e.expandOnClickNode && i.children.length > 0 && L(i), e.highlightCurrent && (a.currentKey = i.key, r("current-change", i.data, i)));
|
|
1128
1128
|
}, I = (i) => {
|
|
1129
1129
|
if (m.value = i, a.filterValue = i, !i) {
|
|
1130
1130
|
a.nodesMap.forEach((d) => {
|
|
@@ -1164,7 +1164,7 @@ const Rt = /* @__PURE__ */ F({
|
|
|
1164
1164
|
const v = a.nodesMap.get(d);
|
|
1165
1165
|
v && v.setChecked(!0, !e.checkStrictly);
|
|
1166
1166
|
});
|
|
1167
|
-
},
|
|
1167
|
+
}, Q = () => {
|
|
1168
1168
|
const i = [];
|
|
1169
1169
|
return a.nodesMap.forEach((d) => {
|
|
1170
1170
|
d.indeterminate && i.push(d.data);
|
|
@@ -1194,10 +1194,10 @@ const Rt = /* @__PURE__ */ F({
|
|
|
1194
1194
|
props: e,
|
|
1195
1195
|
store: a,
|
|
1196
1196
|
emit: r,
|
|
1197
|
-
toggleExpand:
|
|
1197
|
+
toggleExpand: L,
|
|
1198
1198
|
toggleCheck: T,
|
|
1199
1199
|
handleNodeClick: j,
|
|
1200
|
-
filterValue:
|
|
1200
|
+
filterValue: Ae(m),
|
|
1201
1201
|
showCheckboxComputed: V
|
|
1202
1202
|
}), o({
|
|
1203
1203
|
filter: I,
|
|
@@ -1208,12 +1208,12 @@ const Rt = /* @__PURE__ */ F({
|
|
|
1208
1208
|
getCheckedNodes: R,
|
|
1209
1209
|
getCheckedKeys: J,
|
|
1210
1210
|
setCheckedKeys: O,
|
|
1211
|
-
getHalfCheckedNodes:
|
|
1211
|
+
getHalfCheckedNodes: Q,
|
|
1212
1212
|
getHalfCheckedKeys: te,
|
|
1213
1213
|
setChecked: se,
|
|
1214
1214
|
getSelectedNodes: _,
|
|
1215
1215
|
setSelectedKeys: b,
|
|
1216
|
-
expandAll:
|
|
1216
|
+
expandAll: A,
|
|
1217
1217
|
collapseAll: N,
|
|
1218
1218
|
// 额外方法
|
|
1219
1219
|
updateKeyChildren: (i, d) => {
|
|
@@ -1309,7 +1309,7 @@ const Rt = /* @__PURE__ */ F({
|
|
|
1309
1309
|
]),
|
|
1310
1310
|
_: 2
|
|
1311
1311
|
}, 1032, ["node"]))), 128)),
|
|
1312
|
-
a.rootNodes.length ?
|
|
1312
|
+
a.rootNodes.length ? D("", !0) : (h(), f("div", {
|
|
1313
1313
|
key: 0,
|
|
1314
1314
|
class: c(s(l).e("empty"))
|
|
1315
1315
|
}, [
|
|
@@ -1319,7 +1319,7 @@ const Rt = /* @__PURE__ */ F({
|
|
|
1319
1319
|
], 2))
|
|
1320
1320
|
], 2));
|
|
1321
1321
|
}
|
|
1322
|
-
}), rt = ["src"], dt = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTg0IiBoZWlnaHQ9IjE1MiIgdmlld0JveD0iMCAwIDE4NCAxNTIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgPGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4KICAgIDxnIHRyYW5zZm9ybT0idHJhbnNsYXRlKDI0IDMxLjY3KSI+CiAgICAgIDxlbGxpcHNlIGZpbGwtb3BhY2l0eT0iLjgiIGZpbGw9IiNGNUY1RjciIGN4PSI2Ny43OTciIGN5PSIxMDYuODkiIHJ4PSI2Ny43OTciIHJ5PSIxMi42NjgiLz4KICAgICAgPHBhdGggZD0iTTEyMi4wMzQgNjkuNjc0TDk5LjM5NCA0OC4xNjJsMCAyMS41MTYgMjIuNjQgMjIuNjQ0IDAtMjIuNjQ0em0tMjIuNjQgMjIuNjQ0TDc2Ljk5OCA3MC43OThsMCAyMS41MTYgMjIuMzk2IDIyLjM5NiAwLTIyLjM5NnoiIGZpbGw9IiNFRkVGRkYiLz4KICAgICAgPHBhdGggZD0iTTk5LjM5NCA0OC4xNjJsLTIyLjM5NiAyMi42MzYgMjIuMzk2IDIxLjUyIDAtNDQuMTU2eiIgZmlsbD0iI0YyRjZGQyIvPgogICAgICA8cGF0aCBkPSJNMTIxLjk3OCA2OS42NzRMOTkuMzk0IDkyLjI1OGwzLjE2OCAzLjE2OCAyMi41ODQtMjIuNTg0LTMuMTY4LTMuMTY4eiIgZmlsbD0iI0M3Q0NEQyIvPgogICAgICA8cGF0aCBkPSJNOTkuMzk0IDkyLjI1OEw3Ni44MSA2OS42NzRsMy4xNjgtMy4xNjggMjIuNTg0IDIyLjU4NC0zLjE2OCAzLjE2OHoiIGZpbGw9IiNDN0NEREMiLz4KICAgIDwvZz4KICAgIDxwYXRoIGQ9Ik0xNDcuODU3IDMxLjY3bC0zLjI5Mi0zLjI5MmEyLjUgMi41IDAgMCAwLTMuNTM2IDBsLTEzLjQ2IDEzLjQ2YTMuNSAzLjUgMCAwIDAgMCA0Ljk1bDMuMjkzIDMuMjkyYTMuNSAzLjUgMCAwIDAgNC45NSAwbDEzLjQ2LTEzLjQ2YTIuNSAyLjUgMCAwIDAgMC0zLjUzNnoiIGZpbGw9IiNENkRCRUMiLz4KICAgIDxwYXRoIGQ9Ik0zNi4xNDMgMzEuNjdsMy4yOTItMy4yOTJhMi41IDIuNSAwIDAgMSAzLjUzNiAwbDEzLjQ2IDEzLjQ2YTMuNSAzLjUgMCAwIDEgMCA0Ljk1bC0zLjI5MyAzLjI5MmEzLjUgMy41IDAgMCAxLTQuOTUgMEwzNi4xNDMgMzUuMmEyLjUgMi41IDAgMCAxIDAtMy41MzZ6IiBmaWxsPSIjRDZEQkVDIi8+CiAgICA8Y2lyY2xlIGZpbGw9IiNFQUVFRjQiIGN4PSI5MiIgY3k9IjgiIHI9IjgiLz4KICA8L2c+Cjwvc3ZnPg==", Wt = /* @__PURE__ */
|
|
1322
|
+
}), rt = ["src"], dt = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTg0IiBoZWlnaHQ9IjE1MiIgdmlld0JveD0iMCAwIDE4NCAxNTIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgPGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4KICAgIDxnIHRyYW5zZm9ybT0idHJhbnNsYXRlKDI0IDMxLjY3KSI+CiAgICAgIDxlbGxpcHNlIGZpbGwtb3BhY2l0eT0iLjgiIGZpbGw9IiNGNUY1RjciIGN4PSI2Ny43OTciIGN5PSIxMDYuODkiIHJ4PSI2Ny43OTciIHJ5PSIxMi42NjgiLz4KICAgICAgPHBhdGggZD0iTTEyMi4wMzQgNjkuNjc0TDk5LjM5NCA0OC4xNjJsMCAyMS41MTYgMjIuNjQgMjIuNjQ0IDAtMjIuNjQ0em0tMjIuNjQgMjIuNjQ0TDc2Ljk5OCA3MC43OThsMCAyMS41MTYgMjIuMzk2IDIyLjM5NiAwLTIyLjM5NnoiIGZpbGw9IiNFRkVGRkYiLz4KICAgICAgPHBhdGggZD0iTTk5LjM5NCA0OC4xNjJsLTIyLjM5NiAyMi42MzYgMjIuMzk2IDIxLjUyIDAtNDQuMTU2eiIgZmlsbD0iI0YyRjZGQyIvPgogICAgICA8cGF0aCBkPSJNMTIxLjk3OCA2OS42NzRMOTkuMzk0IDkyLjI1OGwzLjE2OCAzLjE2OCAyMi41ODQtMjIuNTg0LTMuMTY4LTMuMTY4eiIgZmlsbD0iI0M3Q0NEQyIvPgogICAgICA8cGF0aCBkPSJNOTkuMzk0IDkyLjI1OEw3Ni44MSA2OS42NzRsMy4xNjgtMy4xNjggMjIuNTg0IDIyLjU4NC0zLjE2OCAzLjE2OHoiIGZpbGw9IiNDN0NEREMiLz4KICAgIDwvZz4KICAgIDxwYXRoIGQ9Ik0xNDcuODU3IDMxLjY3bC0zLjI5Mi0zLjI5MmEyLjUgMi41IDAgMCAwLTMuNTM2IDBsLTEzLjQ2IDEzLjQ2YTMuNSAzLjUgMCAwIDAgMCA0Ljk1bDMuMjkzIDMuMjkyYTMuNSAzLjUgMCAwIDAgNC45NSAwbDEzLjQ2LTEzLjQ2YTIuNSAyLjUgMCAwIDAgMC0zLjUzNnoiIGZpbGw9IiNENkRCRUMiLz4KICAgIDxwYXRoIGQ9Ik0zNi4xNDMgMzEuNjdsMy4yOTItMy4yOTJhMi41IDIuNSAwIDAgMSAzLjUzNiAwbDEzLjQ2IDEzLjQ2YTMuNSAzLjUgMCAwIDEgMCA0Ljk1bC0zLjI5MyAzLjI5MmEzLjUgMy41IDAgMCAxLTQuOTUgMEwzNi4xNDMgMzUuMmEyLjUgMi41IDAgMCAxIDAtMy41MzZ6IiBmaWxsPSIjRDZEQkVDIi8+CiAgICA8Y2lyY2xlIGZpbGw9IiNFQUVFRjQiIGN4PSI5MiIgY3k9IjgiIHI9IjgiLz4KICA8L2c+Cjwvc3ZnPg==", Wt = /* @__PURE__ */ G({
|
|
1323
1323
|
name: "XEmpty",
|
|
1324
1324
|
__name: "index",
|
|
1325
1325
|
props: {
|
|
@@ -1366,10 +1366,10 @@ const Rt = /* @__PURE__ */ F({
|
|
|
1366
1366
|
class: c(s(t).e("bottom"))
|
|
1367
1367
|
}, [
|
|
1368
1368
|
X(l.$slots, "default")
|
|
1369
|
-
], 2)) :
|
|
1369
|
+
], 2)) : D("", !0)
|
|
1370
1370
|
], 2));
|
|
1371
1371
|
}
|
|
1372
|
-
}), Pt = /* @__PURE__ */
|
|
1372
|
+
}), Pt = /* @__PURE__ */ G({
|
|
1373
1373
|
name: "XTimeline",
|
|
1374
1374
|
__name: "index",
|
|
1375
1375
|
props: {
|
|
@@ -1391,7 +1391,7 @@ const Rt = /* @__PURE__ */ F({
|
|
|
1391
1391
|
X(r.$slots, "default")
|
|
1392
1392
|
], 2));
|
|
1393
1393
|
}
|
|
1394
|
-
}), Ot = /* @__PURE__ */
|
|
1394
|
+
}), Ot = /* @__PURE__ */ G({
|
|
1395
1395
|
name: "XTimelineItem",
|
|
1396
1396
|
__name: "TimelineItem",
|
|
1397
1397
|
props: {
|
|
@@ -1404,11 +1404,11 @@ const Rt = /* @__PURE__ */ F({
|
|
|
1404
1404
|
},
|
|
1405
1405
|
setup(n) {
|
|
1406
1406
|
const o = n, t = U("timeline-item"), e = {
|
|
1407
|
-
primary: "#
|
|
1408
|
-
success: "#
|
|
1409
|
-
warning: "#
|
|
1410
|
-
danger: "#
|
|
1411
|
-
info: "#
|
|
1407
|
+
primary: "#12B6AF",
|
|
1408
|
+
success: "#00A870",
|
|
1409
|
+
warning: "#FF7D00",
|
|
1410
|
+
danger: "#F53F3F",
|
|
1411
|
+
info: "#86909C"
|
|
1412
1412
|
}, r = x(() => {
|
|
1413
1413
|
const a = {};
|
|
1414
1414
|
return o.color ? a.backgroundColor = o.color : o.type && e[o.type] && (a.backgroundColor = e[o.type]), a;
|
|
@@ -1434,7 +1434,7 @@ const Rt = /* @__PURE__ */ F({
|
|
|
1434
1434
|
!n.hideTimestamp && n.timestamp && n.placement === "top" ? (h(), f("div", {
|
|
1435
1435
|
key: 0,
|
|
1436
1436
|
class: c(s(t).e("timestamp"))
|
|
1437
|
-
}, W(n.timestamp), 3)) :
|
|
1437
|
+
}, W(n.timestamp), 3)) : D("", !0),
|
|
1438
1438
|
p("div", {
|
|
1439
1439
|
class: c(s(t).e("content"))
|
|
1440
1440
|
}, [
|
|
@@ -1443,11 +1443,11 @@ const Rt = /* @__PURE__ */ F({
|
|
|
1443
1443
|
!n.hideTimestamp && n.timestamp && n.placement === "bottom" ? (h(), f("div", {
|
|
1444
1444
|
key: 1,
|
|
1445
1445
|
class: c(s(t).e("timestamp"))
|
|
1446
|
-
}, W(n.timestamp), 3)) :
|
|
1446
|
+
}, W(n.timestamp), 3)) : D("", !0)
|
|
1447
1447
|
], 2)
|
|
1448
1448
|
], 2));
|
|
1449
1449
|
}
|
|
1450
|
-
}), ct = ["onMouseenter", "onClick"], Yt = /* @__PURE__ */
|
|
1450
|
+
}), ct = ["onMouseenter", "onClick"], Yt = /* @__PURE__ */ G({
|
|
1451
1451
|
name: "XCarousel",
|
|
1452
1452
|
__name: "index",
|
|
1453
1453
|
props: {
|
|
@@ -1472,13 +1472,13 @@ const Rt = /* @__PURE__ */ F({
|
|
|
1472
1472
|
e.loop ? a.value = (R + m.value) % m.value : a.value = Math.max(0, Math.min(R, m.value - 1)), r("update:activeIndex", a.value), r("change", a.value, J);
|
|
1473
1473
|
}, H = () => {
|
|
1474
1474
|
$(a.value - 1);
|
|
1475
|
-
},
|
|
1475
|
+
}, A = () => {
|
|
1476
1476
|
$(a.value + 1);
|
|
1477
1477
|
}, N = () => {
|
|
1478
|
-
e.autoplay && m.value > 1 && (
|
|
1479
|
-
w.value ||
|
|
1478
|
+
e.autoplay && m.value > 1 && (L(), M.value = setInterval(() => {
|
|
1479
|
+
w.value || A();
|
|
1480
1480
|
}, e.interval));
|
|
1481
|
-
},
|
|
1481
|
+
}, L = () => {
|
|
1482
1482
|
M.value && (clearInterval(M.value), M.value = null);
|
|
1483
1483
|
}, T = () => {
|
|
1484
1484
|
w.value = !0, e.arrow;
|
|
@@ -1506,10 +1506,10 @@ const Rt = /* @__PURE__ */ F({
|
|
|
1506
1506
|
}), ce(() => {
|
|
1507
1507
|
N();
|
|
1508
1508
|
}), he(() => {
|
|
1509
|
-
|
|
1509
|
+
L();
|
|
1510
1510
|
}), o({
|
|
1511
1511
|
prev: H,
|
|
1512
|
-
next:
|
|
1512
|
+
next: A,
|
|
1513
1513
|
setActiveItem: $
|
|
1514
1514
|
}), (R, J) => (h(), f("div", {
|
|
1515
1515
|
class: c(z.value),
|
|
@@ -1526,12 +1526,12 @@ const Rt = /* @__PURE__ */ F({
|
|
|
1526
1526
|
key: 0,
|
|
1527
1527
|
class: c([s(l).e("arrow"), s(l).e("arrow-left")]),
|
|
1528
1528
|
onClick: H
|
|
1529
|
-
}, " ‹ ", 2)) :
|
|
1529
|
+
}, " ‹ ", 2)) : D("", !0),
|
|
1530
1530
|
n.arrow !== "never" ? (h(), f("button", {
|
|
1531
1531
|
key: 1,
|
|
1532
1532
|
class: c([s(l).e("arrow"), s(l).e("arrow-right")]),
|
|
1533
|
-
onClick:
|
|
1534
|
-
}, " › ", 2)) :
|
|
1533
|
+
onClick: A
|
|
1534
|
+
}, " › ", 2)) : D("", !0),
|
|
1535
1535
|
n.indicatorPosition !== "none" ? (h(), f("ul", {
|
|
1536
1536
|
key: 2,
|
|
1537
1537
|
class: c(s(l).e("indicators"))
|
|
@@ -1539,17 +1539,17 @@ const Rt = /* @__PURE__ */ F({
|
|
|
1539
1539
|
(h(!0), f(Z, null, le(m.value, (O) => (h(), f("li", {
|
|
1540
1540
|
key: O,
|
|
1541
1541
|
class: c([s(l).e("indicator"), s(l).is("active", O - 1 === a.value)]),
|
|
1542
|
-
onMouseenter: (
|
|
1543
|
-
onClick: (
|
|
1542
|
+
onMouseenter: (Q) => I(O - 1),
|
|
1543
|
+
onClick: (Q) => g(O - 1)
|
|
1544
1544
|
}, [
|
|
1545
1545
|
p("button", {
|
|
1546
1546
|
class: c(s(l).e("indicator-btn"))
|
|
1547
1547
|
}, null, 2)
|
|
1548
1548
|
], 42, ct))), 128))
|
|
1549
|
-
], 2)) :
|
|
1549
|
+
], 2)) : D("", !0)
|
|
1550
1550
|
], 38));
|
|
1551
1551
|
}
|
|
1552
|
-
}), Xt = /* @__PURE__ */
|
|
1552
|
+
}), Xt = /* @__PURE__ */ G({
|
|
1553
1553
|
name: "XCarouselItem",
|
|
1554
1554
|
__name: "CarouselItem",
|
|
1555
1555
|
setup(n) {
|
|
@@ -1569,7 +1569,7 @@ const Rt = /* @__PURE__ */ F({
|
|
|
1569
1569
|
X(a.$slots, "default")
|
|
1570
1570
|
], 2));
|
|
1571
1571
|
}
|
|
1572
|
-
}), ut = { key: 0 }, ht = ["onClick"], vt = { class: "sort-arrow up" }, ft = { class: "sort-arrow down" }, pt = ["onClick"], mt = ["onClick"], gt = { key: 1 }, yt = ["colspan"], Mt = { style: { display: "none" } },
|
|
1572
|
+
}), ut = { key: 0 }, ht = ["onClick"], vt = { class: "sort-arrow up" }, ft = { class: "sort-arrow down" }, pt = ["onClick"], mt = ["onClick"], gt = { key: 1 }, yt = ["colspan"], Mt = { style: { display: "none" } }, Ft = /* @__PURE__ */ G({
|
|
1573
1573
|
name: "XTable",
|
|
1574
1574
|
__name: "index",
|
|
1575
1575
|
props: {
|
|
@@ -1593,26 +1593,26 @@ const Rt = /* @__PURE__ */ F({
|
|
|
1593
1593
|
const a = xe([]);
|
|
1594
1594
|
de("x-table", {
|
|
1595
1595
|
registerColumn: (u, k) => {
|
|
1596
|
-
a.findIndex((
|
|
1596
|
+
a.findIndex((K) => K.config.prop === u.prop) === -1 && a.push({ config: u, slot: k });
|
|
1597
1597
|
},
|
|
1598
1598
|
unregisterColumn: (u) => {
|
|
1599
1599
|
const k = a.findIndex((S) => S.config.prop === u);
|
|
1600
1600
|
k !== -1 && a.splice(k, 1);
|
|
1601
1601
|
},
|
|
1602
1602
|
updateColumnSlot: (u, k) => {
|
|
1603
|
-
const S = a.find((
|
|
1603
|
+
const S = a.find((K) => K.config.prop === u);
|
|
1604
1604
|
S && (S.slot = k);
|
|
1605
1605
|
},
|
|
1606
1606
|
props: e
|
|
1607
1607
|
});
|
|
1608
1608
|
const $ = x(() => {
|
|
1609
|
-
const u = a.map((P) => P.config), k = u.filter((P) => P.fixed === "left" || P.fixed === !0), S = u.filter((P) => !P.fixed),
|
|
1610
|
-
return [...k, ...S, ...
|
|
1611
|
-
}), H = x(() => $.value.filter((u) => u.fixed === "left" || u.fixed === !0)),
|
|
1609
|
+
const u = a.map((P) => P.config), k = u.filter((P) => P.fixed === "left" || P.fixed === !0), S = u.filter((P) => !P.fixed), K = u.filter((P) => P.fixed === "right");
|
|
1610
|
+
return [...k, ...S, ...K];
|
|
1611
|
+
}), H = x(() => $.value.filter((u) => u.fixed === "left" || u.fixed === !0)), A = x(() => $.value.filter((u) => u.fixed === "right"));
|
|
1612
1612
|
x(() => $.value.filter((u) => !u.fixed)), x(() => H.value.reduce((u, k) => {
|
|
1613
1613
|
const S = k.width ? typeof k.width == "number" ? k.width : parseInt(k.width) : 100;
|
|
1614
1614
|
return u + S;
|
|
1615
|
-
}, 0)), x(() =>
|
|
1615
|
+
}, 0)), x(() => A.value.reduce((u, k) => {
|
|
1616
1616
|
const S = k.width ? typeof k.width == "number" ? k.width : parseInt(k.width) : 100;
|
|
1617
1617
|
return u + S;
|
|
1618
1618
|
}, 0));
|
|
@@ -1621,18 +1621,18 @@ const Rt = /* @__PURE__ */ F({
|
|
|
1621
1621
|
return a.forEach((k) => {
|
|
1622
1622
|
k.slot && (u[k.config.prop] = k.slot);
|
|
1623
1623
|
}), u;
|
|
1624
|
-
}),
|
|
1624
|
+
}), L = E({
|
|
1625
1625
|
prop: ((v = e.defaultSort) == null ? void 0 : v.prop) || "",
|
|
1626
1626
|
order: ((y = e.defaultSort) == null ? void 0 : y.order) || null
|
|
1627
1627
|
}), T = x(() => {
|
|
1628
|
-
if (!
|
|
1628
|
+
if (!L.value.prop || !L.value.order)
|
|
1629
1629
|
return e.data;
|
|
1630
|
-
const { prop: u, order: k } =
|
|
1631
|
-
return [...e.data].sort((S,
|
|
1632
|
-
const P = S[u], B =
|
|
1630
|
+
const { prop: u, order: k } = L.value;
|
|
1631
|
+
return [...e.data].sort((S, K) => {
|
|
1632
|
+
const P = S[u], B = K[u];
|
|
1633
1633
|
if (P === B) return 0;
|
|
1634
|
-
const
|
|
1635
|
-
return k === "ascending" ?
|
|
1634
|
+
const F = P > B ? 1 : -1;
|
|
1635
|
+
return k === "ascending" ? F : -F;
|
|
1636
1636
|
});
|
|
1637
1637
|
}), j = x(() => {
|
|
1638
1638
|
const u = {};
|
|
@@ -1642,46 +1642,46 @@ const Rt = /* @__PURE__ */ F({
|
|
|
1642
1642
|
l.is("border", e.border),
|
|
1643
1643
|
l.is("stripe", e.stripe),
|
|
1644
1644
|
l.is("loading", e.loading),
|
|
1645
|
-
l.is("has-fixed", H.value.length > 0 ||
|
|
1645
|
+
l.is("has-fixed", H.value.length > 0 || A.value.length > 0)
|
|
1646
1646
|
]), g = (u) => {
|
|
1647
|
-
u.sortable && (
|
|
1648
|
-
}, C = (u) => u.sortable ?
|
|
1647
|
+
u.sortable && (L.value.prop === u.prop ? L.value.order === "ascending" ? L.value.order = "descending" : L.value.order === "descending" && (L.value.order = null, L.value.prop = "") : (L.value.prop = u.prop, L.value.order = "ascending"), r("sort-change", { ...L.value }));
|
|
1648
|
+
}, C = (u) => u.sortable ? L.value.prop !== u.prop ? l.is("sortable") : [
|
|
1649
1649
|
l.is("sortable"),
|
|
1650
|
-
l.is(`sort-${
|
|
1650
|
+
l.is(`sort-${L.value.order}`)
|
|
1651
1651
|
] : "", z = (u, k, S) => {
|
|
1652
|
-
const
|
|
1653
|
-
return k.formatter ? k.formatter(u, k,
|
|
1652
|
+
const K = u[k.prop];
|
|
1653
|
+
return k.formatter ? k.formatter(u, k, K, S) : K ?? "";
|
|
1654
1654
|
}, R = (u, k) => {
|
|
1655
1655
|
r("row-click", u, $.value[0], k);
|
|
1656
1656
|
}, J = (u, k, S) => {
|
|
1657
|
-
const
|
|
1658
|
-
r("cell-click", u, k,
|
|
1657
|
+
const K = S.target;
|
|
1658
|
+
r("cell-click", u, k, K, S);
|
|
1659
1659
|
}, O = (u) => {
|
|
1660
1660
|
r("page-change", u);
|
|
1661
|
-
},
|
|
1661
|
+
}, Q = (u) => {
|
|
1662
1662
|
r("size-change", u);
|
|
1663
1663
|
}, te = (u, k, S) => {
|
|
1664
|
-
const
|
|
1665
|
-
if (u.width && (
|
|
1664
|
+
const K = {};
|
|
1665
|
+
if (u.width && (K.width = typeof u.width == "number" ? `${u.width}px` : u.width), u.minWidth && (K.minWidth = typeof u.minWidth == "number" ? `${u.minWidth}px` : u.minWidth), u.align && (K.textAlign = u.align), (u.fixed === "left" || u.fixed === !0) && (K.position = "sticky", K.left = "0px", K.zIndex = "2", k !== void 0 && k > 0)) {
|
|
1666
1666
|
let P = 0;
|
|
1667
1667
|
for (let B = 0; B < k; B++) {
|
|
1668
|
-
const
|
|
1668
|
+
const F = H.value[B], ve = F.width ? typeof F.width == "number" ? F.width : parseInt(F.width) : 100;
|
|
1669
1669
|
P += ve;
|
|
1670
1670
|
}
|
|
1671
|
-
|
|
1671
|
+
K.left = `${P}px`;
|
|
1672
1672
|
}
|
|
1673
|
-
if (u.fixed === "right" && (
|
|
1674
|
-
const P =
|
|
1673
|
+
if (u.fixed === "right" && (K.position = "sticky", K.right = "0px", K.zIndex = "2", k !== void 0)) {
|
|
1674
|
+
const P = A.value, B = P.length - 1 - k;
|
|
1675
1675
|
if (B > 0) {
|
|
1676
|
-
let
|
|
1676
|
+
let F = 0;
|
|
1677
1677
|
for (let ve = 0; ve < B; ve++) {
|
|
1678
1678
|
const fe = P[P.length - 1 - ve], ze = fe.width ? typeof fe.width == "number" ? fe.width : parseInt(fe.width) : 100;
|
|
1679
|
-
|
|
1679
|
+
F += ze;
|
|
1680
1680
|
}
|
|
1681
|
-
|
|
1681
|
+
K.right = `${F}px`;
|
|
1682
1682
|
}
|
|
1683
1683
|
}
|
|
1684
|
-
return
|
|
1684
|
+
return K;
|
|
1685
1685
|
}, se = (u) => {
|
|
1686
1686
|
const k = [];
|
|
1687
1687
|
return (u.fixed === "left" || u.fixed === !0) && k.push(l.is("fixed-left")), u.fixed === "right" && k.push(l.is("fixed-right")), k;
|
|
@@ -1692,10 +1692,10 @@ const Rt = /* @__PURE__ */ F({
|
|
|
1692
1692
|
},
|
|
1693
1693
|
getSelection: () => [..._.value],
|
|
1694
1694
|
toggleRowSelection: (u, k) => {
|
|
1695
|
-
const S = b(u),
|
|
1696
|
-
k === void 0 ?
|
|
1695
|
+
const S = b(u), K = _.value.findIndex((P) => b(P) === S);
|
|
1696
|
+
k === void 0 ? K > -1 ? _.value.splice(K, 1) : _.value.push(u) : k && K === -1 ? _.value.push(u) : !k && K > -1 && _.value.splice(K, 1), r("selection-change", [..._.value]);
|
|
1697
1697
|
},
|
|
1698
|
-
sortState:
|
|
1698
|
+
sortState: L,
|
|
1699
1699
|
columns: $
|
|
1700
1700
|
}), (u, k) => (h(), f("div", {
|
|
1701
1701
|
class: c(I.value)
|
|
@@ -1706,7 +1706,7 @@ const Rt = /* @__PURE__ */ F({
|
|
|
1706
1706
|
}, [...k[0] || (k[0] = [
|
|
1707
1707
|
p("span", { class: "loading-spinner" }, null, -1),
|
|
1708
1708
|
p("span", { class: "loading-text" }, "加载中...", -1)
|
|
1709
|
-
])], 2)) :
|
|
1709
|
+
])], 2)) : D("", !0),
|
|
1710
1710
|
p("div", {
|
|
1711
1711
|
class: c(s(l).e("wrapper")),
|
|
1712
1712
|
style: Y(j.value)
|
|
@@ -1714,10 +1714,10 @@ const Rt = /* @__PURE__ */ F({
|
|
|
1714
1714
|
p("table", null, [
|
|
1715
1715
|
n.showHeader ? (h(), f("thead", ut, [
|
|
1716
1716
|
p("tr", null, [
|
|
1717
|
-
(h(!0), f(Z, null, le($.value, (S,
|
|
1717
|
+
(h(!0), f(Z, null, le($.value, (S, K) => (h(), f("th", {
|
|
1718
1718
|
key: S.prop,
|
|
1719
1719
|
class: c([s(l).e("header-cell"), C(S), ...se(S)]),
|
|
1720
|
-
style: Y(te(S, S.fixed === "right" ?
|
|
1720
|
+
style: Y(te(S, S.fixed === "right" ? A.value.indexOf(S) : K)),
|
|
1721
1721
|
onClick: (P) => g(S)
|
|
1722
1722
|
}, [
|
|
1723
1723
|
p("span", null, W(S.label), 1),
|
|
@@ -1737,24 +1737,24 @@ const Rt = /* @__PURE__ */ F({
|
|
|
1737
1737
|
size: 12
|
|
1738
1738
|
})
|
|
1739
1739
|
])
|
|
1740
|
-
], 2)) :
|
|
1740
|
+
], 2)) : D("", !0)
|
|
1741
1741
|
], 14, ht))), 128))
|
|
1742
1742
|
])
|
|
1743
|
-
])) :
|
|
1743
|
+
])) : D("", !0),
|
|
1744
1744
|
p("tbody", null, [
|
|
1745
|
-
(h(!0), f(Z, null, le(T.value, (S,
|
|
1746
|
-
key: n.rowKey ? typeof n.rowKey == "function" ? n.rowKey(S) : S[n.rowKey] :
|
|
1745
|
+
(h(!0), f(Z, null, le(T.value, (S, K) => (h(), f("tr", {
|
|
1746
|
+
key: n.rowKey ? typeof n.rowKey == "function" ? n.rowKey(S) : S[n.rowKey] : K,
|
|
1747
1747
|
class: c([s(l).e("row")]),
|
|
1748
1748
|
onClick: (P) => R(S, P)
|
|
1749
1749
|
}, [
|
|
1750
1750
|
(h(!0), f(Z, null, le($.value, (P, B) => (h(), f("td", {
|
|
1751
1751
|
key: P.prop,
|
|
1752
1752
|
class: c([s(l).e("cell"), ...se(P)]),
|
|
1753
|
-
style: Y(te(P, P.fixed === "right" ?
|
|
1754
|
-
onClick: (
|
|
1753
|
+
style: Y(te(P, P.fixed === "right" ? A.value.indexOf(P) : B)),
|
|
1754
|
+
onClick: (F) => J(S, P, F)
|
|
1755
1755
|
}, [
|
|
1756
|
-
N.value[P.prop] ? (h(), oe(pe(() => N.value[P.prop]({ row: S, column: P, $index:
|
|
1757
|
-
ae(W(z(S, P,
|
|
1756
|
+
N.value[P.prop] ? (h(), oe(pe(() => N.value[P.prop]({ row: S, column: P, $index: K })), { key: 0 })) : (h(), f(Z, { key: 1 }, [
|
|
1757
|
+
ae(W(z(S, P, K)), 1)
|
|
1758
1758
|
], 64))
|
|
1759
1759
|
], 14, mt))), 128))
|
|
1760
1760
|
], 10, pt))), 128))
|
|
@@ -1770,7 +1770,7 @@ const Rt = /* @__PURE__ */ F({
|
|
|
1770
1770
|
])
|
|
1771
1771
|
], 10, yt)
|
|
1772
1772
|
])
|
|
1773
|
-
])) :
|
|
1773
|
+
])) : D("", !0)
|
|
1774
1774
|
])
|
|
1775
1775
|
], 6),
|
|
1776
1776
|
n.pagination ? (h(), f("div", {
|
|
@@ -1782,15 +1782,15 @@ const Rt = /* @__PURE__ */ F({
|
|
|
1782
1782
|
"current-page": n.pagination.current,
|
|
1783
1783
|
"page-size": n.pagination.pageSize,
|
|
1784
1784
|
onCurrentChange: O,
|
|
1785
|
-
onSizeChange:
|
|
1785
|
+
onSizeChange: Q
|
|
1786
1786
|
}, null, 8, ["total", "current-page", "page-size"])
|
|
1787
|
-
], 2)) :
|
|
1787
|
+
], 2)) : D("", !0),
|
|
1788
1788
|
p("div", Mt, [
|
|
1789
1789
|
X(u.$slots, "default")
|
|
1790
1790
|
])
|
|
1791
1791
|
], 2));
|
|
1792
1792
|
}
|
|
1793
|
-
}),
|
|
1793
|
+
}), Qt = /* @__PURE__ */ G({
|
|
1794
1794
|
name: "XTableColumn",
|
|
1795
1795
|
__name: "TableColumn",
|
|
1796
1796
|
props: {
|
|
@@ -1824,7 +1824,7 @@ const Rt = /* @__PURE__ */ F({
|
|
|
1824
1824
|
r != null && r.unregisterColumn && r.unregisterColumn(o.prop || e.value);
|
|
1825
1825
|
}), (a, m) => null;
|
|
1826
1826
|
}
|
|
1827
|
-
}), kt = { key: 0 }, wt = ["onClick"], xt = { class: "sort-arrow up" }, bt = { class: "sort-arrow down" }, Ct = ["onClick"], zt = { key: 0 }, It = ["colspan"], $t = { style: { display: "none" } },
|
|
1827
|
+
}), kt = { key: 0 }, wt = ["onClick"], xt = { class: "sort-arrow up" }, bt = { class: "sort-arrow down" }, Ct = ["onClick"], zt = { key: 0 }, It = ["colspan"], $t = { style: { display: "none" } }, Gt = /* @__PURE__ */ G({
|
|
1828
1828
|
name: "XTreeTable",
|
|
1829
1829
|
__name: "index",
|
|
1830
1830
|
props: {
|
|
@@ -1859,25 +1859,25 @@ const Rt = /* @__PURE__ */ F({
|
|
|
1859
1859
|
},
|
|
1860
1860
|
props: e
|
|
1861
1861
|
});
|
|
1862
|
-
const
|
|
1862
|
+
const A = (b) => typeof e.rowKey == "function" ? e.rowKey(b) : b[e.rowKey || "id"], N = (b) => {
|
|
1863
1863
|
var i;
|
|
1864
1864
|
const V = ((i = e.treeProps) == null ? void 0 : i.children) || "children";
|
|
1865
1865
|
return b[V] || [];
|
|
1866
|
-
},
|
|
1866
|
+
}, L = (b) => {
|
|
1867
1867
|
var d;
|
|
1868
1868
|
if (N(b).length > 0) return !0;
|
|
1869
1869
|
const i = ((d = e.treeProps) == null ? void 0 : d.hasChildren) || "hasChildren";
|
|
1870
1870
|
return b[i] === !0;
|
|
1871
1871
|
}, T = (b) => {
|
|
1872
|
-
const V =
|
|
1872
|
+
const V = A(b);
|
|
1873
1873
|
return a.value.has(V);
|
|
1874
1874
|
}, j = (b) => {
|
|
1875
|
-
const V =
|
|
1875
|
+
const V = A(b), i = !a.value.has(V);
|
|
1876
1876
|
i ? a.value.add(V) : a.value.delete(V), r("expand-change", b, i);
|
|
1877
1877
|
}, I = () => {
|
|
1878
1878
|
const b = (V) => {
|
|
1879
1879
|
V.forEach((i) => {
|
|
1880
|
-
|
|
1880
|
+
L(i) && (a.value.add(A(i)), b(N(i)));
|
|
1881
1881
|
});
|
|
1882
1882
|
};
|
|
1883
1883
|
b(e.data);
|
|
@@ -1886,10 +1886,10 @@ const Rt = /* @__PURE__ */ F({
|
|
|
1886
1886
|
}, C = x(() => {
|
|
1887
1887
|
const b = [], V = (i, d = 0, v = !0) => {
|
|
1888
1888
|
i.forEach((y) => {
|
|
1889
|
-
const u =
|
|
1889
|
+
const u = A(y), k = a.value.has(u), S = v;
|
|
1890
1890
|
b.push({ row: y, level: d, visible: S });
|
|
1891
|
-
const
|
|
1892
|
-
|
|
1891
|
+
const K = N(y);
|
|
1892
|
+
K.length > 0 && k && V(K, d + 1, S);
|
|
1893
1893
|
});
|
|
1894
1894
|
};
|
|
1895
1895
|
return V(e.data), b;
|
|
@@ -1911,7 +1911,7 @@ const Rt = /* @__PURE__ */ F({
|
|
|
1911
1911
|
}, O = (b) => b.sortable ? z.value.prop !== b.prop ? l.is("sortable") : [
|
|
1912
1912
|
l.is("sortable"),
|
|
1913
1913
|
l.is(`sort-${z.value.order}`)
|
|
1914
|
-
] : "",
|
|
1914
|
+
] : "", Q = (b, V, i) => {
|
|
1915
1915
|
const d = b[V.prop];
|
|
1916
1916
|
return V.formatter ? V.formatter(b, V, d, i) : d ?? "";
|
|
1917
1917
|
}, te = (b) => {
|
|
@@ -1949,7 +1949,7 @@ const Rt = /* @__PURE__ */ F({
|
|
|
1949
1949
|
}, [...V[0] || (V[0] = [
|
|
1950
1950
|
p("span", { class: "loading-spinner" }, null, -1),
|
|
1951
1951
|
p("span", { class: "loading-text" }, "加载中...", -1)
|
|
1952
|
-
])], 2)) :
|
|
1952
|
+
])], 2)) : D("", !0),
|
|
1953
1953
|
p("div", {
|
|
1954
1954
|
class: c(s(l).e("wrapper"))
|
|
1955
1955
|
}, [
|
|
@@ -1979,13 +1979,13 @@ const Rt = /* @__PURE__ */ F({
|
|
|
1979
1979
|
size: 12
|
|
1980
1980
|
})
|
|
1981
1981
|
])
|
|
1982
|
-
], 2)) :
|
|
1982
|
+
], 2)) : D("", !0)
|
|
1983
1983
|
], 14, wt))), 128))
|
|
1984
1984
|
])
|
|
1985
|
-
])) :
|
|
1985
|
+
])) : D("", !0),
|
|
1986
1986
|
p("tbody", null, [
|
|
1987
1987
|
(h(!0), f(Z, null, le(R.value, (i, d) => (h(), f(Z, {
|
|
1988
|
-
key:
|
|
1988
|
+
key: A(i.row)
|
|
1989
1989
|
}, [
|
|
1990
1990
|
i.visible ? (h(), f("tr", {
|
|
1991
1991
|
key: 0,
|
|
@@ -2004,7 +2004,7 @@ const Rt = /* @__PURE__ */ F({
|
|
|
2004
2004
|
class: c(s(l).e("indent")),
|
|
2005
2005
|
style: Y({ width: `${i.level * n.indent}px` })
|
|
2006
2006
|
}, null, 6),
|
|
2007
|
-
|
|
2007
|
+
L(i.row) ? (h(), f("span", {
|
|
2008
2008
|
key: 0,
|
|
2009
2009
|
class: c([s(l).e("expand-icon"), s(l).is("expanded", T(i.row))]),
|
|
2010
2010
|
onClick: ie((u) => j(i.row), ["stop"])
|
|
@@ -2024,14 +2024,14 @@ const Rt = /* @__PURE__ */ F({
|
|
|
2024
2024
|
}, null, 2)),
|
|
2025
2025
|
p("span", null, [
|
|
2026
2026
|
M.value[v.prop] ? (h(), oe(pe(() => M.value[v.prop]({ row: i.row, column: v, $index: d })), { key: 0 })) : (h(), f(Z, { key: 1 }, [
|
|
2027
|
-
ae(W(
|
|
2027
|
+
ae(W(Q(i.row, v, d)), 1)
|
|
2028
2028
|
], 64))
|
|
2029
2029
|
])
|
|
2030
2030
|
], 2)) : M.value[v.prop] ? (h(), oe(pe(() => M.value[v.prop]({ row: i.row, column: v, $index: d })), { key: 1 })) : (h(), f(Z, { key: 2 }, [
|
|
2031
|
-
ae(W(
|
|
2031
|
+
ae(W(Q(i.row, v, d)), 1)
|
|
2032
2032
|
], 64))
|
|
2033
2033
|
], 6))), 128))
|
|
2034
|
-
], 2)) :
|
|
2034
|
+
], 2)) : D("", !0)
|
|
2035
2035
|
], 64))), 128)),
|
|
2036
2036
|
R.value.length === 0 && !n.loading ? (h(), f("tr", zt, [
|
|
2037
2037
|
p("td", {
|
|
@@ -2042,7 +2042,7 @@ const Rt = /* @__PURE__ */ F({
|
|
|
2042
2042
|
ae(W(n.emptyText), 1)
|
|
2043
2043
|
])
|
|
2044
2044
|
], 10, It)
|
|
2045
|
-
])) :
|
|
2045
|
+
])) : D("", !0)
|
|
2046
2046
|
])
|
|
2047
2047
|
])
|
|
2048
2048
|
], 2),
|
|
@@ -2051,7 +2051,7 @@ const Rt = /* @__PURE__ */ F({
|
|
|
2051
2051
|
])
|
|
2052
2052
|
], 2));
|
|
2053
2053
|
}
|
|
2054
|
-
}), Ut = /* @__PURE__ */
|
|
2054
|
+
}), Ut = /* @__PURE__ */ G({
|
|
2055
2055
|
name: "XTreeTableColumn",
|
|
2056
2056
|
__name: "TreeTableColumn",
|
|
2057
2057
|
props: {
|
|
@@ -2085,7 +2085,7 @@ const Rt = /* @__PURE__ */ F({
|
|
|
2085
2085
|
e != null && e.unregisterColumn && e.unregisterColumn(o.prop);
|
|
2086
2086
|
}), (l, a) => null;
|
|
2087
2087
|
}
|
|
2088
|
-
}), St = ["src", "alt"], Zt = /* @__PURE__ */
|
|
2088
|
+
}), St = ["src", "alt"], Zt = /* @__PURE__ */ G({
|
|
2089
2089
|
name: "XAvatar",
|
|
2090
2090
|
__name: "index",
|
|
2091
2091
|
props: {
|
|
@@ -2129,7 +2129,7 @@ const Rt = /* @__PURE__ */ F({
|
|
|
2129
2129
|
], 2))
|
|
2130
2130
|
], 6));
|
|
2131
2131
|
}
|
|
2132
|
-
}), Jt = /* @__PURE__ */
|
|
2132
|
+
}), Jt = /* @__PURE__ */ G({
|
|
2133
2133
|
name: "XDescriptions",
|
|
2134
2134
|
__name: "index",
|
|
2135
2135
|
props: {
|
|
@@ -2159,7 +2159,7 @@ const Rt = /* @__PURE__ */ F({
|
|
|
2159
2159
|
n.title ? (h(), f("div", {
|
|
2160
2160
|
key: 0,
|
|
2161
2161
|
class: c(s(t).e("title"))
|
|
2162
|
-
}, W(n.title), 3)) :
|
|
2162
|
+
}, W(n.title), 3)) : D("", !0),
|
|
2163
2163
|
p("div", {
|
|
2164
2164
|
class: c(s(t).e("body"))
|
|
2165
2165
|
}, [
|
|
@@ -2171,7 +2171,7 @@ const Rt = /* @__PURE__ */ F({
|
|
|
2171
2171
|
], 2)
|
|
2172
2172
|
], 2));
|
|
2173
2173
|
}
|
|
2174
|
-
}),
|
|
2174
|
+
}), At = ["colspan"], Lt = ["colspan"], qt = /* @__PURE__ */ G({
|
|
2175
2175
|
name: "XDescriptionsItem",
|
|
2176
2176
|
__name: "DescriptionsItem",
|
|
2177
2177
|
props: {
|
|
@@ -2208,7 +2208,7 @@ const Rt = /* @__PURE__ */ F({
|
|
|
2208
2208
|
colspan: n.span * 2 - 1
|
|
2209
2209
|
}, [
|
|
2210
2210
|
X(w.$slots, "default")
|
|
2211
|
-
], 10,
|
|
2211
|
+
], 10, At)
|
|
2212
2212
|
], 64)) : (h(), f("tr", {
|
|
2213
2213
|
key: 1,
|
|
2214
2214
|
class: c(s(t).b())
|
|
@@ -2222,10 +2222,10 @@ const Rt = /* @__PURE__ */ F({
|
|
|
2222
2222
|
colspan: n.span * 2 - 1
|
|
2223
2223
|
}, [
|
|
2224
2224
|
X(w.$slots, "default")
|
|
2225
|
-
], 10,
|
|
2225
|
+
], 10, Lt)
|
|
2226
2226
|
], 2));
|
|
2227
2227
|
}
|
|
2228
|
-
}), _t = /* @__PURE__ */
|
|
2228
|
+
}), _t = /* @__PURE__ */ G({
|
|
2229
2229
|
name: "XScrollbar",
|
|
2230
2230
|
__name: "index",
|
|
2231
2231
|
props: {
|
|
@@ -2243,14 +2243,14 @@ const Rt = /* @__PURE__ */ F({
|
|
|
2243
2243
|
},
|
|
2244
2244
|
emits: ["scroll"],
|
|
2245
2245
|
setup(n, { expose: o, emit: t }) {
|
|
2246
|
-
const e = n, r = t, l = U("scrollbar"), a = E(), m = E(), M = E("0"), w = E("0"), $ = E(0), H = E(0),
|
|
2246
|
+
const e = n, r = t, l = U("scrollbar"), a = E(), m = E(), M = E("0"), w = E("0"), $ = E(0), H = E(0), A = x(() => {
|
|
2247
2247
|
const C = {};
|
|
2248
2248
|
return e.height && (C.height = typeof e.height == "number" ? `${e.height}px` : e.height), e.maxHeight && (C.maxHeight = typeof e.maxHeight == "number" ? `${e.maxHeight}px` : e.maxHeight), C;
|
|
2249
2249
|
}), N = () => {
|
|
2250
2250
|
if (!a.value) return;
|
|
2251
|
-
const C = a.value.offsetHeight - 4, z = a.value.offsetWidth - 4, R = a.value.scrollHeight, J = a.value.scrollWidth, O = C / R,
|
|
2252
|
-
w.value = O >= 1 ? "0" : `${C * O}px`, M.value =
|
|
2253
|
-
},
|
|
2251
|
+
const C = a.value.offsetHeight - 4, z = a.value.offsetWidth - 4, R = a.value.scrollHeight, J = a.value.scrollWidth, O = C / R, Q = z / J;
|
|
2252
|
+
w.value = O >= 1 ? "0" : `${C * O}px`, M.value = Q >= 1 ? "0" : `${z * Q}px`;
|
|
2253
|
+
}, L = (C) => {
|
|
2254
2254
|
if (!a.value) return;
|
|
2255
2255
|
const z = a.value.offsetHeight, R = a.value.offsetWidth;
|
|
2256
2256
|
H.value = a.value.scrollTop * 100 / z, $.value = a.value.scrollLeft * 100 / R, r("scroll", C);
|
|
@@ -2279,8 +2279,8 @@ const Rt = /* @__PURE__ */ F({
|
|
|
2279
2279
|
ref_key: "wrapRef",
|
|
2280
2280
|
ref: a,
|
|
2281
2281
|
class: c([s(l).e("wrap"), n.wrapClass, { [s(l).em("wrap", "hidden-default")]: !n.native }]),
|
|
2282
|
-
style: Y([
|
|
2283
|
-
onScroll:
|
|
2282
|
+
style: Y([A.value, { overflow: n.native ? "auto" : "hidden" }]),
|
|
2283
|
+
onScroll: L
|
|
2284
2284
|
}, [
|
|
2285
2285
|
(h(), oe(pe(n.tag), {
|
|
2286
2286
|
ref_key: "resizeRef",
|
|
@@ -2298,15 +2298,15 @@ const Rt = /* @__PURE__ */ F({
|
|
|
2298
2298
|
key: 0,
|
|
2299
2299
|
class: c([s(l).e("bar"), s(l).is("vertical")]),
|
|
2300
2300
|
style: Y({ height: w.value, top: `${H.value}%` })
|
|
2301
|
-
}, null, 6)) :
|
|
2301
|
+
}, null, 6)) : D("", !0),
|
|
2302
2302
|
!n.native && M.value ? (h(), f("div", {
|
|
2303
2303
|
key: 1,
|
|
2304
2304
|
class: c([s(l).e("bar"), s(l).is("horizontal")]),
|
|
2305
2305
|
style: Y({ width: M.value, left: `${$.value}%` })
|
|
2306
|
-
}, null, 6)) :
|
|
2306
|
+
}, null, 6)) : D("", !0)
|
|
2307
2307
|
], 2));
|
|
2308
2308
|
}
|
|
2309
|
-
}), ea = /* @__PURE__ */
|
|
2309
|
+
}), ea = /* @__PURE__ */ G({
|
|
2310
2310
|
name: "XCollapse",
|
|
2311
2311
|
__name: "index",
|
|
2312
2312
|
props: {
|
|
@@ -2335,7 +2335,7 @@ const Rt = /* @__PURE__ */ F({
|
|
|
2335
2335
|
X(m.$slots, "default")
|
|
2336
2336
|
], 2));
|
|
2337
2337
|
}
|
|
2338
|
-
}), ta = /* @__PURE__ */
|
|
2338
|
+
}), ta = /* @__PURE__ */ G({
|
|
2339
2339
|
name: "XCollapseItem",
|
|
2340
2340
|
__name: "CollapseItem",
|
|
2341
2341
|
props: {
|
|
@@ -2379,7 +2379,7 @@ const Rt = /* @__PURE__ */ F({
|
|
|
2379
2379
|
])
|
|
2380
2380
|
], 2));
|
|
2381
2381
|
}
|
|
2382
|
-
}),
|
|
2382
|
+
}), Kt = ["src", "loading"], Dt = ["src"], Me = 0.2, ke = 8, aa = /* @__PURE__ */ G({
|
|
2383
2383
|
name: "XImage",
|
|
2384
2384
|
__name: "index",
|
|
2385
2385
|
props: {
|
|
@@ -2396,19 +2396,19 @@ const Rt = /* @__PURE__ */ F({
|
|
|
2396
2396
|
},
|
|
2397
2397
|
emits: ["load", "error"],
|
|
2398
2398
|
setup(n, { emit: o }) {
|
|
2399
|
-
const t = n, e = o, r = U("image"), l = E(!0), a = E(!1), m = E(!1), M = E(0), w = E(1), $ = E(0), H = E(0),
|
|
2399
|
+
const t = n, e = o, r = U("image"), l = E(!0), a = E(!1), m = E(!1), M = E(0), w = E(1), $ = E(0), H = E(0), A = E(0), N = E(!1), L = E({ x: 0, y: 0 }), T = E({ x: 0, y: 0 }), j = E(null), I = x(() => ({
|
|
2400
2400
|
width: typeof t.width == "number" ? `${t.width}px` : t.width,
|
|
2401
2401
|
height: typeof t.height == "number" ? `${t.height}px` : t.height,
|
|
2402
2402
|
objectFit: t.fit
|
|
2403
2403
|
})), g = x(() => t.previewList.length > 0 ? t.previewList : [t.src]), C = x(() => g.value[M.value]), z = x(
|
|
2404
|
-
() => `translate(${H.value}px, ${
|
|
2404
|
+
() => `translate(${H.value}px, ${A.value}px) scale(${w.value}) rotate(${$.value}deg)`
|
|
2405
2405
|
), R = () => {
|
|
2406
|
-
w.value = 1, $.value = 0, H.value = 0,
|
|
2406
|
+
w.value = 1, $.value = 0, H.value = 0, A.value = 0, N.value = !1;
|
|
2407
2407
|
}, J = (B) => {
|
|
2408
2408
|
l.value = !1, e("load", B);
|
|
2409
2409
|
}, O = (B) => {
|
|
2410
2410
|
l.value = !1, a.value = !0, e("error", B);
|
|
2411
|
-
},
|
|
2411
|
+
}, Q = () => {
|
|
2412
2412
|
t.preview && (M.value = t.initialIndex, R(), m.value = !0);
|
|
2413
2413
|
}, te = () => {
|
|
2414
2414
|
m.value = !1, R();
|
|
@@ -2419,12 +2419,12 @@ const Rt = /* @__PURE__ */ F({
|
|
|
2419
2419
|
}, b = () => {
|
|
2420
2420
|
w.value = Math.min(ke, w.value * 1.25);
|
|
2421
2421
|
}, V = () => {
|
|
2422
|
-
w.value = Math.max(Me, w.value / 1.25), w.value <= 1 && (H.value = 0,
|
|
2422
|
+
w.value = Math.max(Me, w.value / 1.25), w.value <= 1 && (H.value = 0, A.value = 0);
|
|
2423
2423
|
}, i = () => R(), d = () => {
|
|
2424
2424
|
const B = j.value;
|
|
2425
2425
|
if (!B || !B.naturalWidth) return;
|
|
2426
|
-
const
|
|
2427
|
-
|
|
2426
|
+
const F = B.getBoundingClientRect();
|
|
2427
|
+
F.width <= 0 || (w.value = Math.min(ke, Math.max(Me, w.value * (B.naturalWidth / F.width))));
|
|
2428
2428
|
}, v = () => {
|
|
2429
2429
|
$.value = ($.value + 90) % 360;
|
|
2430
2430
|
}, y = () => {
|
|
@@ -2433,10 +2433,10 @@ const Rt = /* @__PURE__ */ F({
|
|
|
2433
2433
|
}, u = (B) => {
|
|
2434
2434
|
B.preventDefault(), B.deltaY < 0 ? b() : V();
|
|
2435
2435
|
}, k = (B) => {
|
|
2436
|
-
w.value <= 1 || (N.value = !0,
|
|
2436
|
+
w.value <= 1 || (N.value = !0, L.value = { x: B.clientX, y: B.clientY }, T.value = { x: H.value, y: A.value });
|
|
2437
2437
|
}, S = (B) => {
|
|
2438
|
-
N.value && (H.value = T.value.x + (B.clientX -
|
|
2439
|
-
},
|
|
2438
|
+
N.value && (H.value = T.value.x + (B.clientX - L.value.x), A.value = T.value.y + (B.clientY - L.value.y));
|
|
2439
|
+
}, K = () => {
|
|
2440
2440
|
N.value = !1;
|
|
2441
2441
|
}, P = (B) => {
|
|
2442
2442
|
if (m.value)
|
|
@@ -2468,7 +2468,7 @@ const Rt = /* @__PURE__ */ F({
|
|
|
2468
2468
|
};
|
|
2469
2469
|
return typeof window < "u" && window.addEventListener("keydown", P), he(() => {
|
|
2470
2470
|
typeof window < "u" && window.removeEventListener("keydown", P);
|
|
2471
|
-
}), ne(M, () => R()), (B,
|
|
2471
|
+
}), ne(M, () => R()), (B, F) => (h(), f("div", {
|
|
2472
2472
|
class: c(s(r).b()),
|
|
2473
2473
|
style: Y({ width: I.value.width, height: I.value.height })
|
|
2474
2474
|
}, [
|
|
@@ -2479,8 +2479,8 @@ const Rt = /* @__PURE__ */ F({
|
|
|
2479
2479
|
loading: n.lazy ? "lazy" : "eager",
|
|
2480
2480
|
onLoad: J,
|
|
2481
2481
|
onError: O,
|
|
2482
|
-
onClick:
|
|
2483
|
-
}, null, 46,
|
|
2482
|
+
onClick: Q
|
|
2483
|
+
}, null, 46, Kt),
|
|
2484
2484
|
l.value ? (h(), f("div", {
|
|
2485
2485
|
key: 0,
|
|
2486
2486
|
class: c(s(r).e("placeholder"))
|
|
@@ -2491,7 +2491,7 @@ const Rt = /* @__PURE__ */ F({
|
|
|
2491
2491
|
size: 24
|
|
2492
2492
|
})
|
|
2493
2493
|
])
|
|
2494
|
-
], 2)) :
|
|
2494
|
+
], 2)) : D("", !0),
|
|
2495
2495
|
a.value ? (h(), f("div", {
|
|
2496
2496
|
key: 1,
|
|
2497
2497
|
class: c(s(r).e("error"))
|
|
@@ -2501,10 +2501,10 @@ const Rt = /* @__PURE__ */ F({
|
|
|
2501
2501
|
name: "image",
|
|
2502
2502
|
size: 24
|
|
2503
2503
|
}),
|
|
2504
|
-
|
|
2504
|
+
F[2] || (F[2] = p("span", null, "加载失败", -1))
|
|
2505
2505
|
])
|
|
2506
|
-
], 2)) :
|
|
2507
|
-
(h(), oe(
|
|
2506
|
+
], 2)) : D("", !0),
|
|
2507
|
+
(h(), oe(Le, { to: "body" }, [
|
|
2508
2508
|
m.value ? (h(), f("div", {
|
|
2509
2509
|
key: 0,
|
|
2510
2510
|
class: c(s(r).e("preview")),
|
|
@@ -2512,14 +2512,14 @@ const Rt = /* @__PURE__ */ F({
|
|
|
2512
2512
|
}, [
|
|
2513
2513
|
p("div", {
|
|
2514
2514
|
class: c(s(r).e("preview-toolbar")),
|
|
2515
|
-
onClick:
|
|
2515
|
+
onClick: F[0] || (F[0] = ie(() => {
|
|
2516
2516
|
}, ["stop"]))
|
|
2517
2517
|
}, [
|
|
2518
2518
|
p("span", {
|
|
2519
2519
|
class: c(s(r).e("preview-tool")),
|
|
2520
2520
|
title: "放大",
|
|
2521
2521
|
onClick: b
|
|
2522
|
-
}, [...
|
|
2522
|
+
}, [...F[3] || (F[3] = [
|
|
2523
2523
|
p("svg", {
|
|
2524
2524
|
viewBox: "0 0 24 24",
|
|
2525
2525
|
fill: "none",
|
|
@@ -2544,7 +2544,7 @@ const Rt = /* @__PURE__ */ F({
|
|
|
2544
2544
|
class: c(s(r).e("preview-tool")),
|
|
2545
2545
|
title: "缩小",
|
|
2546
2546
|
onClick: V
|
|
2547
|
-
}, [...
|
|
2547
|
+
}, [...F[4] || (F[4] = [
|
|
2548
2548
|
p("svg", {
|
|
2549
2549
|
viewBox: "0 0 24 24",
|
|
2550
2550
|
fill: "none",
|
|
@@ -2569,7 +2569,7 @@ const Rt = /* @__PURE__ */ F({
|
|
|
2569
2569
|
class: c(s(r).e("preview-tool")),
|
|
2570
2570
|
title: "1:1 实际大小",
|
|
2571
2571
|
onClick: d
|
|
2572
|
-
}, [...
|
|
2572
|
+
}, [...F[5] || (F[5] = [
|
|
2573
2573
|
p("svg", {
|
|
2574
2574
|
viewBox: "0 0 24 24",
|
|
2575
2575
|
fill: "none",
|
|
@@ -2589,7 +2589,7 @@ const Rt = /* @__PURE__ */ F({
|
|
|
2589
2589
|
class: c(s(r).e("preview-tool")),
|
|
2590
2590
|
title: "适应窗口",
|
|
2591
2591
|
onClick: i
|
|
2592
|
-
}, [...
|
|
2592
|
+
}, [...F[6] || (F[6] = [
|
|
2593
2593
|
p("svg", {
|
|
2594
2594
|
viewBox: "0 0 24 24",
|
|
2595
2595
|
fill: "none",
|
|
@@ -2609,7 +2609,7 @@ const Rt = /* @__PURE__ */ F({
|
|
|
2609
2609
|
class: c(s(r).e("preview-tool")),
|
|
2610
2610
|
title: "旋转",
|
|
2611
2611
|
onClick: v
|
|
2612
|
-
}, [...
|
|
2612
|
+
}, [...F[7] || (F[7] = [
|
|
2613
2613
|
p("svg", {
|
|
2614
2614
|
viewBox: "0 0 24 24",
|
|
2615
2615
|
fill: "none",
|
|
@@ -2629,7 +2629,7 @@ const Rt = /* @__PURE__ */ F({
|
|
|
2629
2629
|
class: c(s(r).e("preview-tool")),
|
|
2630
2630
|
title: "下载",
|
|
2631
2631
|
onClick: y
|
|
2632
|
-
}, [...
|
|
2632
|
+
}, [...F[8] || (F[8] = [
|
|
2633
2633
|
p("svg", {
|
|
2634
2634
|
viewBox: "0 0 24 24",
|
|
2635
2635
|
fill: "none",
|
|
@@ -2649,7 +2649,7 @@ const Rt = /* @__PURE__ */ F({
|
|
|
2649
2649
|
class: c(s(r).e("preview-close")),
|
|
2650
2650
|
title: "关闭",
|
|
2651
2651
|
onClick: ie(te, ["stop"])
|
|
2652
|
-
}, [...
|
|
2652
|
+
}, [...F[9] || (F[9] = [
|
|
2653
2653
|
p("svg", {
|
|
2654
2654
|
viewBox: "0 0 24 24",
|
|
2655
2655
|
fill: "none",
|
|
@@ -2673,14 +2673,14 @@ const Rt = /* @__PURE__ */ F({
|
|
|
2673
2673
|
class: c([s(r).e("preview-image"), { "is-zoomable": w.value > 1 }]),
|
|
2674
2674
|
style: Y({ transform: z.value }),
|
|
2675
2675
|
draggable: !1,
|
|
2676
|
-
onClick:
|
|
2676
|
+
onClick: F[1] || (F[1] = ie(() => {
|
|
2677
2677
|
}, ["stop"])),
|
|
2678
2678
|
onWheel: ie(u, ["prevent"]),
|
|
2679
2679
|
onMousedown: k,
|
|
2680
2680
|
onMousemove: S,
|
|
2681
|
-
onMouseup:
|
|
2682
|
-
onMouseleave:
|
|
2683
|
-
}, null, 46,
|
|
2681
|
+
onMouseup: K,
|
|
2682
|
+
onMouseleave: K
|
|
2683
|
+
}, null, 46, Dt),
|
|
2684
2684
|
g.value.length > 1 ? (h(), f("span", {
|
|
2685
2685
|
key: 0,
|
|
2686
2686
|
class: c([s(r).e("preview-arrow"), s(r).em("preview-arrow", "left")]),
|
|
@@ -2690,7 +2690,7 @@ const Rt = /* @__PURE__ */ F({
|
|
|
2690
2690
|
name: "left",
|
|
2691
2691
|
size: 24
|
|
2692
2692
|
})
|
|
2693
|
-
], 2)) :
|
|
2693
|
+
], 2)) : D("", !0),
|
|
2694
2694
|
g.value.length > 1 ? (h(), f("span", {
|
|
2695
2695
|
key: 1,
|
|
2696
2696
|
class: c([s(r).e("preview-arrow"), s(r).em("preview-arrow", "right")]),
|
|
@@ -2700,16 +2700,16 @@ const Rt = /* @__PURE__ */ F({
|
|
|
2700
2700
|
name: "right",
|
|
2701
2701
|
size: 24
|
|
2702
2702
|
})
|
|
2703
|
-
], 2)) :
|
|
2703
|
+
], 2)) : D("", !0),
|
|
2704
2704
|
g.value.length > 1 ? (h(), f("div", {
|
|
2705
2705
|
key: 2,
|
|
2706
2706
|
class: c(s(r).e("preview-counter"))
|
|
2707
|
-
}, W(M.value + 1) + " / " + W(g.value.length), 3)) :
|
|
2708
|
-
], 2)) :
|
|
2707
|
+
}, W(M.value + 1) + " / " + W(g.value.length), 3)) : D("", !0)
|
|
2708
|
+
], 2)) : D("", !0)
|
|
2709
2709
|
]))
|
|
2710
2710
|
], 6));
|
|
2711
2711
|
}
|
|
2712
|
-
}), Ht = ["onClick"], la = /* @__PURE__ */
|
|
2712
|
+
}), Ht = ["onClick"], la = /* @__PURE__ */ G({
|
|
2713
2713
|
name: "XCalendar",
|
|
2714
2714
|
__name: "index",
|
|
2715
2715
|
props: {
|
|
@@ -2721,39 +2721,39 @@ const Rt = /* @__PURE__ */ F({
|
|
|
2721
2721
|
const t = n, e = o, r = U("calendar"), l = E(t.modelValue.getFullYear()), a = E(t.modelValue.getMonth()), m = ["日", "一", "二", "三", "四", "五", "六"], M = ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"], w = /* @__PURE__ */ new Date(), $ = x(() => {
|
|
2722
2722
|
const g = [], C = new Date(l.value, a.value, 1), z = new Date(l.value, a.value + 1, 0), R = C.getDay();
|
|
2723
2723
|
for (let O = R - 1; O >= 0; O--) {
|
|
2724
|
-
const
|
|
2724
|
+
const Q = new Date(l.value, a.value, -O);
|
|
2725
2725
|
g.push({
|
|
2726
|
-
date:
|
|
2726
|
+
date: Q,
|
|
2727
2727
|
isCurrentMonth: !1,
|
|
2728
|
-
isToday: H(
|
|
2729
|
-
isSelected: H(
|
|
2728
|
+
isToday: H(Q, w),
|
|
2729
|
+
isSelected: H(Q, t.modelValue)
|
|
2730
2730
|
});
|
|
2731
2731
|
}
|
|
2732
2732
|
for (let O = 1; O <= z.getDate(); O++) {
|
|
2733
|
-
const
|
|
2733
|
+
const Q = new Date(l.value, a.value, O);
|
|
2734
2734
|
g.push({
|
|
2735
|
-
date:
|
|
2735
|
+
date: Q,
|
|
2736
2736
|
isCurrentMonth: !0,
|
|
2737
|
-
isToday: H(
|
|
2738
|
-
isSelected: H(
|
|
2737
|
+
isToday: H(Q, w),
|
|
2738
|
+
isSelected: H(Q, t.modelValue)
|
|
2739
2739
|
});
|
|
2740
2740
|
}
|
|
2741
2741
|
const J = 42 - g.length;
|
|
2742
2742
|
for (let O = 1; O <= J; O++) {
|
|
2743
|
-
const
|
|
2743
|
+
const Q = new Date(l.value, a.value + 1, O);
|
|
2744
2744
|
g.push({
|
|
2745
|
-
date:
|
|
2745
|
+
date: Q,
|
|
2746
2746
|
isCurrentMonth: !1,
|
|
2747
|
-
isToday: H(
|
|
2748
|
-
isSelected: H(
|
|
2747
|
+
isToday: H(Q, w),
|
|
2748
|
+
isSelected: H(Q, t.modelValue)
|
|
2749
2749
|
});
|
|
2750
2750
|
}
|
|
2751
2751
|
return g;
|
|
2752
|
-
}), H = (g, C) => g.getFullYear() === C.getFullYear() && g.getMonth() === C.getMonth() && g.getDate() === C.getDate(),
|
|
2752
|
+
}), H = (g, C) => g.getFullYear() === C.getFullYear() && g.getMonth() === C.getMonth() && g.getDate() === C.getDate(), A = (g) => {
|
|
2753
2753
|
e("update:modelValue", g.date), e("select", g.date), e("change", g.date);
|
|
2754
2754
|
}, N = () => {
|
|
2755
2755
|
l.value--;
|
|
2756
|
-
},
|
|
2756
|
+
}, L = () => {
|
|
2757
2757
|
l.value++;
|
|
2758
2758
|
}, T = () => {
|
|
2759
2759
|
a.value === 0 ? (a.value = 11, l.value--) : a.value--;
|
|
@@ -2809,7 +2809,7 @@ const Rt = /* @__PURE__ */ F({
|
|
|
2809
2809
|
], 2),
|
|
2810
2810
|
p("button", {
|
|
2811
2811
|
class: c(s(r).e("btn")),
|
|
2812
|
-
onClick:
|
|
2812
|
+
onClick: L
|
|
2813
2813
|
}, [
|
|
2814
2814
|
ee(s(q), {
|
|
2815
2815
|
name: "d-arrow-right",
|
|
@@ -2837,7 +2837,7 @@ const Rt = /* @__PURE__ */ F({
|
|
|
2837
2837
|
s(r).is("today", z.isToday),
|
|
2838
2838
|
s(r).is("selected", z.isSelected)
|
|
2839
2839
|
]),
|
|
2840
|
-
onClick: (J) =>
|
|
2840
|
+
onClick: (J) => A(z)
|
|
2841
2841
|
}, [
|
|
2842
2842
|
X(g.$slots, "default", {
|
|
2843
2843
|
date: z.date,
|
|
@@ -2849,7 +2849,7 @@ const Rt = /* @__PURE__ */ F({
|
|
|
2849
2849
|
], 2)
|
|
2850
2850
|
], 2));
|
|
2851
2851
|
}
|
|
2852
|
-
}), na = /* @__PURE__ */
|
|
2852
|
+
}), na = /* @__PURE__ */ G({
|
|
2853
2853
|
name: "XQRCode",
|
|
2854
2854
|
__name: "index",
|
|
2855
2855
|
props: {
|
|
@@ -2865,19 +2865,19 @@ const Rt = /* @__PURE__ */ F({
|
|
|
2865
2865
|
const t = n, e = o, r = U("qrcode"), l = E(), a = async () => {
|
|
2866
2866
|
if (!(!l.value || !t.value))
|
|
2867
2867
|
try {
|
|
2868
|
-
const
|
|
2869
|
-
$(
|
|
2870
|
-
} catch (
|
|
2871
|
-
e("error",
|
|
2868
|
+
const A = await m(t.value, t.level);
|
|
2869
|
+
$(A), e("ready", l.value);
|
|
2870
|
+
} catch (A) {
|
|
2871
|
+
e("error", A);
|
|
2872
2872
|
}
|
|
2873
|
-
}, m = async (
|
|
2873
|
+
}, m = async (A, N) => {
|
|
2874
2874
|
const T = [];
|
|
2875
2875
|
for (let g = 0; g < 21; g++)
|
|
2876
2876
|
T.push(new Array(21).fill(0));
|
|
2877
2877
|
M(T, 0, 0), M(T, 14, 0), M(T, 0, 14);
|
|
2878
2878
|
for (let g = 8; g < 13; g++)
|
|
2879
2879
|
T[6][g] = g % 2 === 0 ? 1 : 0, T[g][6] = g % 2 === 0 ? 1 : 0;
|
|
2880
|
-
const j = new TextEncoder().encode(
|
|
2880
|
+
const j = new TextEncoder().encode(A);
|
|
2881
2881
|
let I = 0;
|
|
2882
2882
|
for (let g = 20; g > 0; g -= 2) {
|
|
2883
2883
|
g === 6 && g--;
|
|
@@ -2893,29 +2893,29 @@ const Rt = /* @__PURE__ */ F({
|
|
|
2893
2893
|
}
|
|
2894
2894
|
}
|
|
2895
2895
|
return T;
|
|
2896
|
-
}, M = (
|
|
2896
|
+
}, M = (A, N, L) => {
|
|
2897
2897
|
for (let T = 0; T < 7; T++)
|
|
2898
2898
|
for (let j = 0; j < 7; j++)
|
|
2899
|
-
(T === 0 || T === 6 || j === 0 || j === 6 || T >= 2 && T <= 4 && j >= 2 && j <= 4) && (
|
|
2900
|
-
}, w = (
|
|
2899
|
+
(T === 0 || T === 6 || j === 0 || j === 6 || T >= 2 && T <= 4 && j >= 2 && j <= 4) && (A[N + T][L + j] = 1);
|
|
2900
|
+
}, w = (A, N, L) => A < 8 && N < 8 || A < 8 && N >= L - 8 || A >= L - 8 && N < 8 || A === 6 || N === 6, $ = (A) => {
|
|
2901
2901
|
if (!l.value) return;
|
|
2902
2902
|
const N = l.value.getContext("2d");
|
|
2903
2903
|
if (!N) return;
|
|
2904
|
-
const
|
|
2904
|
+
const L = A.length, T = t.size / L;
|
|
2905
2905
|
l.value.width = t.size, l.value.height = t.size, N.fillStyle = t.bgColor, N.fillRect(0, 0, t.size, t.size), N.fillStyle = t.fgColor;
|
|
2906
|
-
for (let j = 0; j <
|
|
2907
|
-
for (let I = 0; I <
|
|
2908
|
-
|
|
2906
|
+
for (let j = 0; j < L; j++)
|
|
2907
|
+
for (let I = 0; I < L; I++)
|
|
2908
|
+
A[j][I] && N.fillRect(I * T, j * T, T, T);
|
|
2909
2909
|
}, H = () => {
|
|
2910
2910
|
if (!l.value) return;
|
|
2911
|
-
const
|
|
2912
|
-
|
|
2911
|
+
const A = document.createElement("a");
|
|
2912
|
+
A.download = "qrcode.png", A.href = l.value.toDataURL("image/png"), A.click();
|
|
2913
2913
|
};
|
|
2914
2914
|
return ne(() => [t.value, t.size, t.bgColor, t.fgColor, t.level], () => {
|
|
2915
2915
|
a();
|
|
2916
2916
|
}), ce(() => {
|
|
2917
2917
|
a();
|
|
2918
|
-
}), (
|
|
2918
|
+
}), (A, N) => (h(), f("div", {
|
|
2919
2919
|
class: c(s(r).b())
|
|
2920
2920
|
}, [
|
|
2921
2921
|
p("canvas", {
|
|
@@ -2931,10 +2931,10 @@ const Rt = /* @__PURE__ */ F({
|
|
|
2931
2931
|
class: c(s(r).e("download")),
|
|
2932
2932
|
onClick: H
|
|
2933
2933
|
}, " 下载二维码 ", 2)
|
|
2934
|
-
], 2)) :
|
|
2934
|
+
], 2)) : D("", !0)
|
|
2935
2935
|
], 2));
|
|
2936
2936
|
}
|
|
2937
|
-
}), sa = /* @__PURE__ */
|
|
2937
|
+
}), sa = /* @__PURE__ */ G({
|
|
2938
2938
|
name: "XVirtualScroll",
|
|
2939
2939
|
__name: "index",
|
|
2940
2940
|
props: {
|
|
@@ -2953,10 +2953,10 @@ const Rt = /* @__PURE__ */ F({
|
|
|
2953
2953
|
if (!e.virtual) return 0;
|
|
2954
2954
|
const g = Math.floor(m.value / e.itemSize) - e.buffer;
|
|
2955
2955
|
return Math.max(0, g);
|
|
2956
|
-
}),
|
|
2956
|
+
}), A = x(() => e.virtual ? Math.min(e.items.length, H.value + $.value) : e.items.length), N = x(() => e.virtual ? e.items.slice(H.value, A.value).map((g, C) => ({
|
|
2957
2957
|
...g,
|
|
2958
2958
|
index: H.value + C
|
|
2959
|
-
})) : e.items),
|
|
2959
|
+
})) : e.items), L = x(() => H.value * e.itemSize), T = (g) => {
|
|
2960
2960
|
const C = g.target;
|
|
2961
2961
|
m.value = C.scrollTop, r("scroll", m.value);
|
|
2962
2962
|
};
|
|
@@ -2980,7 +2980,7 @@ const Rt = /* @__PURE__ */ F({
|
|
|
2980
2980
|
}, [
|
|
2981
2981
|
p("div", {
|
|
2982
2982
|
class: c(s(l).e("content")),
|
|
2983
|
-
style: Y({ transform: `translateY(${
|
|
2983
|
+
style: Y({ transform: `translateY(${L.value}px)` })
|
|
2984
2984
|
}, [
|
|
2985
2985
|
(h(!0), f(Z, null, le(N.value, (z, R) => (h(), f("div", {
|
|
2986
2986
|
key: z.id ?? R,
|
|
@@ -2996,7 +2996,7 @@ const Rt = /* @__PURE__ */ F({
|
|
|
2996
2996
|
], 6)
|
|
2997
2997
|
], 38));
|
|
2998
2998
|
}
|
|
2999
|
-
}), oa = /* @__PURE__ */
|
|
2999
|
+
}), oa = /* @__PURE__ */ G({
|
|
3000
3000
|
name: "XInfiniteScroll",
|
|
3001
3001
|
__name: "index",
|
|
3002
3002
|
props: {
|
|
@@ -3023,7 +3023,7 @@ const Rt = /* @__PURE__ */ F({
|
|
|
3023
3023
|
};
|
|
3024
3024
|
return ce(() => {
|
|
3025
3025
|
M(), t.immediate && !t.finished && e("load");
|
|
3026
|
-
}),
|
|
3026
|
+
}), Ke(() => {
|
|
3027
3027
|
m && m.disconnect();
|
|
3028
3028
|
}), (w, $) => (h(), f("div", {
|
|
3029
3029
|
ref_key: "containerRef",
|
|
@@ -3048,7 +3048,7 @@ const Rt = /* @__PURE__ */ F({
|
|
|
3048
3048
|
], 2)) : n.finished ? (h(), f("span", {
|
|
3049
3049
|
key: 1,
|
|
3050
3050
|
class: c(s(r).e("finished"))
|
|
3051
|
-
}, W(n.finishedText), 3)) :
|
|
3051
|
+
}, W(n.finishedText), 3)) : D("", !0)
|
|
3052
3052
|
], 2)
|
|
3053
3053
|
], 2));
|
|
3054
3054
|
}
|
|
@@ -3071,14 +3071,14 @@ export {
|
|
|
3071
3071
|
Bt as Progress,
|
|
3072
3072
|
na as QRCode,
|
|
3073
3073
|
_t as Scrollbar,
|
|
3074
|
-
|
|
3075
|
-
|
|
3074
|
+
Ft as Table,
|
|
3075
|
+
Qt as TableColumn,
|
|
3076
3076
|
Tt as Tag,
|
|
3077
3077
|
Pt as Timeline,
|
|
3078
3078
|
Ot as TimelineItem,
|
|
3079
3079
|
Rt as Tree,
|
|
3080
3080
|
re as TreeNode,
|
|
3081
|
-
|
|
3081
|
+
Gt as TreeTable,
|
|
3082
3082
|
Ut as TreeTableColumn,
|
|
3083
3083
|
sa as VirtualScroll
|
|
3084
3084
|
};
|