hys-ui 0.3.0 → 0.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/CHANGELOG.md +27 -0
- package/README.md +68 -73
- package/dist/components/HysAnimatedNumber/HysAnimatedNumber.vue.js +5 -41
- package/dist/components/HysAnimatedNumber/HysAnimatedNumber2.vue.js +467 -2
- package/dist/components/HysAnimatedNumber/NumberAnimationCanvas/NumberAnimationCanvas.vue.js +7 -0
- package/dist/components/HysAnimatedNumber/NumberAnimationCanvas/NumberAnimationCanvas2.vue.js +166 -0
- package/dist/components/HysAnimatedNumber/NumberDigits/NumberDigits.vue.js +7 -0
- package/dist/components/HysAnimatedNumber/NumberDigits/NumberDigits2.vue.js +105 -0
- package/dist/components/HysAnimatedNumber/animation/digital.js +186 -0
- package/dist/components/HysAnimatedNumber/animation/morph.js +110 -0
- package/dist/components/HysAnimatedNumber/animation/paint.js +34 -0
- package/dist/components/HysAnimatedNumber/animation/particles.js +51 -0
- package/dist/components/HysAnimatedNumber/animation/paths.js +165 -0
- package/dist/components/HysAnimatedNumber/animation/physics.js +66 -0
- package/dist/components/HysAnimatedNumber/animation/render.js +89 -0
- package/dist/components/HysAnimatedNumber/animation/reveal.js +125 -0
- package/dist/components/HysAnimatedNumber/animation/rolling.js +66 -0
- package/dist/components/HysAnimatedNumber/animation/scenarios.js +217 -0
- package/dist/components/HysAnimatedNumber/animation/spatial.js +112 -0
- package/dist/components/HysAnimatedNumber/useNumberCountdown.js +58 -0
- package/dist/components/HysAnimatedNumber/useNumberVisuals.js +60 -0
- package/dist/components/HysButton/HysButton.vue.js +2 -2
- package/dist/components/HysButton/HysButton2.vue.js +227 -60
- package/dist/components/HysButtonGroup/HysButtonGroup.vue.js +7 -0
- package/dist/components/HysButtonGroup/HysButtonGroup2.vue.js +51 -0
- package/dist/components/HysFormItem/HysFormItem.vue.js +1 -1
- package/dist/components/HysFormItem/HysFormItem2.vue.js +231 -229
- package/dist/components/HysInput/HysInput.vue.js +2 -2
- package/dist/components/HysInput/HysInput2.vue.js +327 -274
- package/dist/components/HysMention/HysMention.vue.js +1 -1
- package/dist/components/HysMention/HysMention2.vue.js +1092 -154
- package/dist/components/HysModal/HysModal.vue.js +3 -3
- package/dist/components/HysModal/HysModal2.vue.js +81 -80
- package/dist/components/HysPagination/HysPagination.vue.js +2 -2
- package/dist/components/HysPagination/HysPagination2.vue.js +243 -180
- package/dist/components/HysSearch/HysSearch.vue.js +5 -82
- package/dist/components/HysSearch/HysSearch2.vue.js +176 -2
- package/dist/components/HysSelect/HysSelect.vue.js +2 -2
- package/dist/components/HysSelect/HysSelect2.vue.js +472 -443
- package/dist/components/HysSplitPane/HysSplitPane.vue.js +315 -58
- package/dist/components/HysSplitPane/HysSplitPane3.vue.js +5 -0
- package/dist/components/HysTable/HysTable.vue.js +2 -2
- package/dist/components/HysTable/HysTable2.vue.js +1418 -1150
- package/dist/components/HysTextarea/HysTextarea.vue.js +56 -32
- package/dist/components/HysTour/HysTour.vue.js +291 -67
- package/dist/components/HysTour/HysTour3.vue.js +5 -0
- package/dist/composables/animatedNumberDigits.js +106 -0
- package/dist/composables/animatedNumberFormat.js +222 -0
- package/dist/composables/animatedNumberTiming.js +66 -0
- package/dist/composables/buttonGroup.js +12 -0
- package/dist/composables/floatingPosition.js +18 -0
- package/dist/composables/mentionDocument.js +79 -0
- package/dist/composables/mentionEditor.js +58 -0
- package/dist/composables/numberAnimation.js +72 -0
- package/dist/composables/numberAnimationCatalog.js +301 -0
- package/dist/composables/numberAnimationSequence.js +45 -0
- package/dist/composables/selectOptions.js +44 -38
- package/dist/composables/splitPaneSizes.js +58 -0
- package/dist/composables/table.js +128 -105
- package/dist/composables/textInput.js +23 -14
- package/dist/composables/useDialog.js +50 -50
- package/dist/composables/useFloating.js +107 -103
- package/dist/composables/useHysAnimatedNumber.js +264 -0
- package/dist/composables/useHysNumberAnimationGroup.js +23 -0
- package/dist/composables/useMentionCaret.js +81 -0
- package/dist/composables/useMentionList.js +81 -0
- package/dist/composables/useMentionModel.js +90 -0
- package/dist/composables/useMentionOptions.js +421 -0
- package/dist/composables/useSplitPaneDrag.js +52 -0
- package/dist/composables/useSplitPaneStorage.js +38 -0
- package/dist/composables/useTable.js +344 -312
- package/dist/composables/useTableSticky.js +79 -0
- package/dist/composables/useTextareaSize.js +62 -46
- package/dist/composables/useTourLayout.js +129 -0
- package/dist/config.js +11 -11
- package/dist/index.js +183 -152
- package/dist/internal/MultiSplitPane.vue.js +305 -0
- package/dist/internal/MultiSplitPane2.vue.js +4 -0
- package/dist/style.css +1 -1
- package/dist/types/components/HysAnimatedNumber/HysAnimatedNumber.vue.d.ts +99 -6
- package/dist/types/components/HysAnimatedNumber/NumberAnimationCanvas/NumberAnimationCanvas.vue.d.ts +19 -0
- package/dist/types/components/HysAnimatedNumber/NumberDigits/NumberDigits.vue.d.ts +31 -0
- package/dist/types/components/HysAnimatedNumber/animation/digital.d.ts +3 -0
- package/dist/types/components/HysAnimatedNumber/animation/morph.d.ts +2 -0
- package/dist/types/components/HysAnimatedNumber/animation/paint.d.ts +44 -0
- package/dist/types/components/HysAnimatedNumber/animation/particles.d.ts +5 -0
- package/dist/types/components/HysAnimatedNumber/animation/paths.d.ts +12 -0
- package/dist/types/components/HysAnimatedNumber/animation/physics.d.ts +2 -0
- package/dist/types/components/HysAnimatedNumber/animation/render.d.ts +2 -0
- package/dist/types/components/HysAnimatedNumber/animation/reveal.d.ts +2 -0
- package/dist/types/components/HysAnimatedNumber/animation/rolling.d.ts +2 -0
- package/dist/types/components/HysAnimatedNumber/animation/scenarios.d.ts +4 -0
- package/dist/types/components/HysAnimatedNumber/animation/spatial.d.ts +2 -0
- package/dist/types/components/HysAnimatedNumber/useNumberCountdown.d.ts +8 -0
- package/dist/types/components/HysAnimatedNumber/useNumberVisuals.d.ts +12 -0
- package/dist/types/components/HysAutocomplete/HysAutocomplete.vue.d.ts +12 -3
- package/dist/types/components/HysAvatarGroup/HysAvatarGroup.vue.d.ts +2 -2
- package/dist/types/components/HysButton/HysButton.vue.d.ts +82 -22
- package/dist/types/components/HysButtonGroup/HysButtonGroup.vue.d.ts +30 -0
- package/dist/types/components/HysCard/HysCard.vue.d.ts +1 -1
- package/dist/types/components/HysCascader/HysCascader.vue.d.ts +3 -3
- package/dist/types/components/HysCascader/HysCascaderColumn.vue.d.ts +3 -3
- package/dist/types/components/HysColorPicker/HysColorPicker.vue.d.ts +3 -3
- package/dist/types/components/HysContextMenu/HysMenuPanel.vue.d.ts +2 -2
- package/dist/types/components/HysDatePicker/HysDatePicker.vue.d.ts +3 -3
- package/dist/types/components/HysDatePicker/HysDatePickerControl.vue.d.ts +6 -6
- package/dist/types/components/HysDateRangePicker/HysDateRangePicker.vue.d.ts +3 -3
- package/dist/types/components/HysDrawer/HysDrawer.vue.d.ts +2 -2
- package/dist/types/components/HysFormItem/HysFormItem.vue.d.ts +1 -1
- package/dist/types/components/HysInput/HysInput.vue.d.ts +13 -1
- package/dist/types/components/HysMention/HysMention.vue.d.ts +91 -40
- package/dist/types/components/HysModal/HysModal.vue.d.ts +1 -1
- package/dist/types/components/HysNumberInput/HysNumberInput.vue.d.ts +2 -2
- package/dist/types/components/HysPagination/HysPagination.vue.d.ts +55 -4
- package/dist/types/components/HysPopover/HysPopover.vue.d.ts +1 -1
- package/dist/types/components/HysRating/HysRating.vue.d.ts +1 -1
- package/dist/types/components/HysSearch/HysSearch.vue.d.ts +46 -8
- package/dist/types/components/HysSelect/HysSelect.vue.d.ts +6 -1
- package/dist/types/components/HysSkeleton/HysSkeleton.vue.d.ts +2 -2
- package/dist/types/components/HysSplitPane/HysSplitPane.vue.d.ts +125 -14
- package/dist/types/components/HysSteps/HysSteps.vue.d.ts +1 -1
- package/dist/types/components/HysTable/HysTable.vue.d.ts +1740 -3
- package/dist/types/components/HysTabs/HysTabs.vue.d.ts +1 -1
- package/dist/types/components/HysTagInput/HysTagInput.vue.d.ts +1 -1
- package/dist/types/components/HysTextarea/HysTextarea.vue.d.ts +13 -2
- package/dist/types/components/HysToast/HysToast.vue.d.ts +1 -1
- package/dist/types/components/HysTooltip/HysTooltip.vue.d.ts +1 -1
- package/dist/types/components/HysTour/HysTour.vue.d.ts +46 -9
- package/dist/types/components/HysTreeSelect/HysTreeSelect.vue.d.ts +3 -3
- package/dist/types/components/HysUpload/HysUpload.vue.d.ts +2 -2
- package/dist/types/composables/animatedNumber.d.ts +220 -0
- package/dist/types/composables/animatedNumberDigits.d.ts +32 -0
- package/dist/types/composables/animatedNumberFormat.d.ts +16 -0
- package/dist/types/composables/animatedNumberTiming.d.ts +21 -0
- package/dist/types/composables/buttonGroup.d.ts +9 -0
- package/dist/types/composables/drawer.d.ts +1 -1
- package/dist/types/composables/floatingPosition.d.ts +14 -0
- package/dist/types/composables/mention.d.ts +284 -0
- package/dist/types/composables/mentionDocument.d.ts +15 -0
- package/dist/types/composables/mentionEditor.d.ts +7 -0
- package/dist/types/composables/modal.d.ts +2 -0
- package/dist/types/composables/numberAnimation.d.ts +29 -0
- package/dist/types/composables/numberAnimationCatalog.d.ts +58 -0
- package/dist/types/composables/numberAnimationSequence.d.ts +13 -0
- package/dist/types/composables/selectOptions.d.ts +5 -0
- package/dist/types/composables/splitPaneSizes.d.ts +11 -0
- package/dist/types/composables/table.d.ts +116 -6
- package/dist/types/composables/textInput.d.ts +39 -4
- package/dist/types/composables/tour.d.ts +68 -0
- package/dist/types/composables/useFloating.d.ts +1 -1
- package/dist/types/composables/useHysAnimatedNumber.d.ts +37 -0
- package/dist/types/composables/useHysNumberAnimationGroup.d.ts +4 -0
- package/dist/types/composables/useMentionCaret.d.ts +6 -0
- package/dist/types/composables/useMentionList.d.ts +23 -0
- package/dist/types/composables/useMentionModel.d.ts +14 -0
- package/dist/types/composables/useMentionOptions.d.ts +26 -0
- package/dist/types/composables/useSplitPaneDrag.d.ts +14 -0
- package/dist/types/composables/useSplitPaneStorage.d.ts +4 -0
- package/dist/types/composables/useTable.d.ts +7 -3
- package/dist/types/composables/useTableSticky.d.ts +22 -0
- package/dist/types/composables/useTextareaSize.d.ts +5 -2
- package/dist/types/composables/useTourLayout.d.ts +33 -0
- package/dist/types/config.d.ts +1 -0
- package/dist/types/index.d.ts +46 -1
- package/dist/types/internal/MultiSplitPane.vue.d.ts +54 -0
- package/package.json +3 -2
- package/dist/components/HysSplitPane/HysSplitPane2.vue.js +0 -4
- package/dist/components/HysTour/HysTour2.vue.js +0 -4
|
@@ -1,375 +1,403 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
import { tableValue as
|
|
3
|
-
function
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
),
|
|
1
|
+
import { ref as R, computed as s, shallowRef as ce, watch as p, nextTick as ee, onActivated as Be, onDeactivated as He, onBeforeUnmount as Ue } from "vue";
|
|
2
|
+
import { tableValue as se, tableToken as b, tableFilterPredicate as Je, tableCompare as Le } from "./table.js";
|
|
3
|
+
function Ze(l, m, fe, i) {
|
|
4
|
+
const f = R(!0), g = s(() => !!l.loading || !!l.disabled), z = s(
|
|
5
|
+
() => typeof l.pagination == "object" ? l.pagination : {}
|
|
6
|
+
), de = R(
|
|
7
|
+
Array.isArray(l.defaultSort) ? [...l.defaultSort] : l.defaultSort ? [l.defaultSort] : l.defaultSort === void 0 ? m().filter((e) => e.defaultSortOrder).map((e) => ({ key: e.key, direction: e.defaultSortOrder })) : []
|
|
8
|
+
), te = R({
|
|
7
9
|
...Object.fromEntries(
|
|
8
|
-
|
|
10
|
+
m().filter((e) => e.defaultFilterValue).map((e) => [e.key, [...e.defaultFilterValue]])
|
|
9
11
|
),
|
|
10
|
-
...
|
|
11
|
-
}),
|
|
12
|
-
...
|
|
13
|
-
]),
|
|
14
|
-
|
|
15
|
-
), x =
|
|
12
|
+
...l.defaultFilters
|
|
13
|
+
}), q = R(z.value.defaultPage ?? 1), _ = R(z.value.defaultPageSize ?? 10), ve = R([
|
|
14
|
+
...l.defaultSelectedRowKeys ?? []
|
|
15
|
+
]), he = R([...l.defaultExpandedRowKeys ?? []]), ae = R(
|
|
16
|
+
l.defaultCurrentRowKey ?? null
|
|
17
|
+
), x = ce(
|
|
16
18
|
/* @__PURE__ */ new Map()
|
|
17
|
-
), h =
|
|
19
|
+
), h = ce(
|
|
18
20
|
/* @__PURE__ */ new Map()
|
|
19
|
-
),
|
|
21
|
+
), A = ce(/* @__PURE__ */ new Map());
|
|
20
22
|
let W = /* @__PURE__ */ new WeakSet();
|
|
21
|
-
const
|
|
22
|
-
let
|
|
23
|
-
function
|
|
24
|
-
const a = typeof
|
|
25
|
-
return typeof a == "string" || typeof a == "number" && Number.isFinite(a) ? a : (
|
|
23
|
+
const ne = /* @__PURE__ */ new WeakMap();
|
|
24
|
+
let Oe = 0;
|
|
25
|
+
function le(e) {
|
|
26
|
+
const a = typeof l.rowKey == "function" ? l.rowKey(e) : se(e, l.rowKey ?? "id");
|
|
27
|
+
return typeof a == "string" || typeof a == "number" && Number.isFinite(a) ? a : (ne.has(e) || ne.set(e, "@hys-table-row:" + ++Oe), ne.get(e));
|
|
26
28
|
}
|
|
27
|
-
const
|
|
28
|
-
const e = [], a = [], t = /* @__PURE__ */ new Map(),
|
|
29
|
+
const d = s(() => {
|
|
30
|
+
const e = [], a = [], t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new WeakSet(), o = [...l.rows].reverse().map((r) => ({
|
|
29
31
|
row: r,
|
|
30
32
|
parent: void 0,
|
|
31
33
|
depth: 0
|
|
32
34
|
}));
|
|
33
35
|
for (; o.length; ) {
|
|
34
36
|
const { row: r, parent: u, depth: c } = o.pop();
|
|
35
|
-
if (!r || typeof r != "object" ||
|
|
36
|
-
|
|
37
|
-
const
|
|
38
|
-
if (t.has(
|
|
39
|
-
const
|
|
37
|
+
if (!r || typeof r != "object" || n.has(r)) continue;
|
|
38
|
+
n.add(r);
|
|
39
|
+
const y = le(r), M = b(y);
|
|
40
|
+
if (t.has(M)) continue;
|
|
41
|
+
const F = l.treeMode ? se(r, l.childrenKey ?? "children") : void 0, w = x.value.get(M), D = (w == null ? void 0 : w.row) === r && w.override ? w.rows : Array.isArray(F) ? F : (w == null ? void 0 : w.row) === r ? w.rows : [], T = {
|
|
40
42
|
row: r,
|
|
41
|
-
key:
|
|
42
|
-
token:
|
|
43
|
+
key: y,
|
|
44
|
+
token: M,
|
|
43
45
|
index: a.length,
|
|
44
46
|
depth: c,
|
|
45
|
-
rootToken: (u == null ? void 0 : u.rootToken) ??
|
|
47
|
+
rootToken: (u == null ? void 0 : u.rootToken) ?? M,
|
|
46
48
|
parent: u,
|
|
47
49
|
children: [],
|
|
48
|
-
lazy: !!
|
|
50
|
+
lazy: !!l.treeMode && !!l.loadChildren && !Array.isArray(F) && (w == null ? void 0 : w.row) !== r && !!se(r, l.hasChildrenKey ?? "hasChildren")
|
|
49
51
|
};
|
|
50
|
-
if (t.set(
|
|
51
|
-
for (let
|
|
52
|
-
o.push({ row:
|
|
52
|
+
if (t.set(M, T), a.push(T), ((u == null ? void 0 : u.children) ?? e).push(T), l.treeMode)
|
|
53
|
+
for (let v = D.length - 1; v >= 0; v--)
|
|
54
|
+
o.push({ row: D[v], parent: T, depth: c + 1 });
|
|
53
55
|
}
|
|
54
56
|
return { roots: e, all: a, map: t };
|
|
55
|
-
}),
|
|
56
|
-
...new Set(
|
|
57
|
-
]),
|
|
58
|
-
() => new Set(
|
|
59
|
-
),
|
|
57
|
+
}), S = s(() => [
|
|
58
|
+
...new Set(l.selectedRowKeys ?? ve.value)
|
|
59
|
+
]), k = s(
|
|
60
|
+
() => new Set(S.value.map(b))
|
|
61
|
+
), G = s(() => [
|
|
60
62
|
...new Set(
|
|
61
|
-
|
|
63
|
+
l.expandedRowKeys ?? (l.defaultExpandAll && !ge.value ? d.value.all.filter((e) => e.children.length || e.lazy || fe()).map((e) => e.key) : he.value)
|
|
62
64
|
)
|
|
63
|
-
]),
|
|
64
|
-
|
|
65
|
-
[
|
|
65
|
+
]), ge = R(!1), V = s(() => new Set(G.value.map(b))), B = /* @__PURE__ */ new Map();
|
|
66
|
+
p(
|
|
67
|
+
[S, () => d.value.all, () => l.reserveSelection],
|
|
66
68
|
() => {
|
|
67
69
|
var a, t;
|
|
68
|
-
for (const
|
|
69
|
-
|
|
70
|
-
for (const
|
|
71
|
-
const o =
|
|
72
|
-
o &&
|
|
70
|
+
for (const n of B.keys())
|
|
71
|
+
k.value.has(n) || B.delete(n);
|
|
72
|
+
for (const n of S.value) {
|
|
73
|
+
const o = d.value.map.get(b(n));
|
|
74
|
+
o && B.set(o.token, o.row);
|
|
73
75
|
}
|
|
74
|
-
if (!
|
|
75
|
-
const
|
|
76
|
-
(o) =>
|
|
76
|
+
if (!l.reserveSelection) {
|
|
77
|
+
const n = S.value.filter(
|
|
78
|
+
(o) => d.value.map.has(b(o))
|
|
77
79
|
);
|
|
78
|
-
|
|
80
|
+
n.length !== S.value.length && Z(n);
|
|
79
81
|
}
|
|
80
82
|
let e;
|
|
81
|
-
for (const [
|
|
82
|
-
((a =
|
|
83
|
+
for (const [n, o] of x.value)
|
|
84
|
+
((a = d.value.map.get(n)) == null ? void 0 : a.row) !== o.row && (e ?? (e = new Map(x.value)), e.delete(n));
|
|
83
85
|
e && (x.value = e);
|
|
84
|
-
for (const [
|
|
85
|
-
((t =
|
|
86
|
+
for (const [n, o] of h.value)
|
|
87
|
+
((t = d.value.map.get(n)) == null ? void 0 : t.row) !== o.row && I(n);
|
|
86
88
|
},
|
|
87
89
|
{ immediate: !0 }
|
|
88
90
|
);
|
|
89
|
-
|
|
90
|
-
const
|
|
91
|
+
function H(e) {
|
|
92
|
+
const a = new Map(m().filter((n) => n.sortable).map((n) => [n.key, n])), t = /* @__PURE__ */ new Set();
|
|
91
93
|
return e.filter(
|
|
92
|
-
(
|
|
93
|
-
).slice(0,
|
|
94
|
-
(
|
|
95
|
-
var
|
|
96
|
-
return (((
|
|
94
|
+
(n) => ["asc", "desc"].includes(n.direction) && a.has(n.key) && !t.has(n.key) && (t.add(n.key), !0)
|
|
95
|
+
).slice(0, l.multiSort ? void 0 : 1).sort(
|
|
96
|
+
(n, o) => {
|
|
97
|
+
var r, u;
|
|
98
|
+
return (((r = a.get(o.key)) == null ? void 0 : r.sortPriority) ?? 0) - (((u = a.get(n.key)) == null ? void 0 : u.sortPriority) ?? 0);
|
|
97
99
|
}
|
|
98
100
|
);
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
if (
|
|
101
|
+
}
|
|
102
|
+
const oe = s(() => new Map(
|
|
103
|
+
m().filter((e) => e.sortable && e.sortOrder !== void 0).map((e) => [e.key, e.sortOrder])
|
|
104
|
+
)), N = s(() => {
|
|
105
|
+
if (l.sorts !== void 0) return H(l.sorts);
|
|
106
|
+
if (l.sort !== void 0) return H(l.sort ? [l.sort] : []);
|
|
107
|
+
const e = de.value.filter((t) => !oe.value.has(t.key)), a = m().flatMap(({ key: t }) => {
|
|
108
|
+
const n = oe.value.get(t);
|
|
109
|
+
return n ? [{ key: t, direction: n }] : [];
|
|
110
|
+
});
|
|
111
|
+
return H([...a, ...e]);
|
|
112
|
+
}), j = s(() => {
|
|
113
|
+
if (l.filters !== void 0) return l.filters;
|
|
114
|
+
const e = m().flatMap(
|
|
115
|
+
({ key: a, filteredValue: t }) => t === void 0 ? [] : [[a, t]]
|
|
116
|
+
);
|
|
117
|
+
return e.length ? { ...te.value, ...Object.fromEntries(e) } : te.value;
|
|
118
|
+
}), E = s(() => {
|
|
119
|
+
const e = d.value, a = /* @__PURE__ */ new Set(), t = /* @__PURE__ */ new Map(), n = Je(j.value, m());
|
|
120
|
+
if (!l.serverMode)
|
|
104
121
|
for (let u = e.all.length - 1; u >= 0; u--) {
|
|
105
122
|
const c = e.all[u];
|
|
106
|
-
(
|
|
123
|
+
(n(c.row) || c.children.some((y) => a.has(y.token))) && a.add(c.token);
|
|
107
124
|
}
|
|
108
|
-
const o =
|
|
125
|
+
const o = Le(N.value, m());
|
|
109
126
|
function r(u) {
|
|
110
|
-
const c =
|
|
111
|
-
return
|
|
127
|
+
const c = l.serverMode ? [...u] : u.filter((y) => a.has(y.token));
|
|
128
|
+
return l.serverMode || !N.value.length ? c : c.sort((y, M) => o(y.row, M.row) || y.index - M.index);
|
|
112
129
|
}
|
|
113
130
|
for (const u of e.all)
|
|
114
131
|
u.children.length && t.set(u.token, r(u.children));
|
|
115
132
|
return { roots: r(e.roots), children: t };
|
|
116
|
-
}),
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
133
|
+
}), X = s(() => {
|
|
134
|
+
const e = l.pageSize ?? z.value.pageSize ?? _.value;
|
|
135
|
+
return Number.isFinite(e) && e > 0 ? Math.min(Number.MAX_SAFE_INTEGER, Math.max(1, Math.floor(e))) : 10;
|
|
136
|
+
}), we = s(() => {
|
|
137
|
+
const e = z.value.pageCount;
|
|
138
|
+
return l.serverMode && e !== void 0 && Number.isFinite(e) && e > 0 ? Math.min(Number.MAX_SAFE_INTEGER, Math.max(1, Math.floor(e))) : void 0;
|
|
139
|
+
}), ke = s(() => {
|
|
140
|
+
if (!l.serverMode) return E.value.roots.length;
|
|
141
|
+
const e = l.total ?? z.value.total;
|
|
142
|
+
return e === void 0 ? we.value === void 0 ? l.rows.length : void 0 : Number.isFinite(e) ? Math.min(Number.MAX_SAFE_INTEGER, Math.max(0, Math.floor(e))) : 0;
|
|
143
|
+
}), re = s(
|
|
144
|
+
() => we.value ?? Math.max(1, Math.ceil((ke.value ?? 0) / X.value))
|
|
145
|
+
), U = s(() => {
|
|
146
|
+
const e = l.page ?? z.value.page ?? q.value;
|
|
127
147
|
return Math.min(
|
|
128
|
-
|
|
148
|
+
re.value,
|
|
129
149
|
Math.max(1, Number.isFinite(e) ? Math.floor(e) : 1)
|
|
130
150
|
);
|
|
131
|
-
}),
|
|
132
|
-
() => !
|
|
133
|
-
(
|
|
134
|
-
|
|
151
|
+
}), ye = s(
|
|
152
|
+
() => !l.pagination || l.serverMode ? E.value.roots : E.value.roots.slice(
|
|
153
|
+
(U.value - 1) * X.value,
|
|
154
|
+
U.value * X.value
|
|
135
155
|
)
|
|
136
|
-
),
|
|
137
|
-
const e = [], a = [...
|
|
156
|
+
), J = s(() => {
|
|
157
|
+
const e = [], a = [...ye.value].reverse();
|
|
138
158
|
for (; a.length; ) {
|
|
139
159
|
const t = a.pop();
|
|
140
|
-
if (e.push(t),
|
|
141
|
-
const
|
|
142
|
-
for (let o =
|
|
160
|
+
if (e.push(t), V.value.has(t.token) || !l.serverMode && Object.values(j.value).some((n) => n.length)) {
|
|
161
|
+
const n = E.value.children.get(t.token) ?? [];
|
|
162
|
+
for (let o = n.length - 1; o >= 0; o--) a.push(n[o]);
|
|
143
163
|
}
|
|
144
164
|
}
|
|
145
165
|
return e;
|
|
146
|
-
}),
|
|
147
|
-
const e = [], a = [...
|
|
166
|
+
}), Se = s(() => {
|
|
167
|
+
const e = [], a = [...E.value.roots].reverse();
|
|
148
168
|
for (; a.length; ) {
|
|
149
169
|
const t = a.pop();
|
|
150
170
|
e.push(t.row);
|
|
151
|
-
const
|
|
152
|
-
for (let o =
|
|
171
|
+
const n = E.value.children.get(t.token) ?? [];
|
|
172
|
+
for (let o = n.length - 1; o >= 0; o--) a.push(n[o]);
|
|
153
173
|
}
|
|
154
174
|
return e;
|
|
155
|
-
}),
|
|
156
|
-
() =>
|
|
157
|
-
),
|
|
175
|
+
}), L = s(
|
|
176
|
+
() => l.currentRowKey !== void 0 ? l.currentRowKey : ae.value
|
|
177
|
+
), Q = s(
|
|
158
178
|
() => {
|
|
159
179
|
var e;
|
|
160
|
-
return
|
|
180
|
+
return L.value == null || (e = d.value.map.get(b(L.value))) == null ? void 0 : e.row;
|
|
161
181
|
}
|
|
162
|
-
),
|
|
182
|
+
), ue = s(() => {
|
|
163
183
|
const e = /* @__PURE__ */ new Set();
|
|
164
|
-
if (
|
|
165
|
-
for (let a =
|
|
166
|
-
const t =
|
|
184
|
+
if (l.checkStrictly !== !1) return e;
|
|
185
|
+
for (let a = d.value.all.length - 1; a >= 0; a--) {
|
|
186
|
+
const t = d.value.all[a];
|
|
167
187
|
t.children.some(
|
|
168
|
-
(
|
|
169
|
-
) && !t.children.filter(
|
|
188
|
+
(n) => e.has(n.token) || k.value.has(n.token)
|
|
189
|
+
) && !t.children.filter(C).every((n) => k.value.has(n.token)) && e.add(t.token);
|
|
170
190
|
}
|
|
171
191
|
return e;
|
|
172
192
|
});
|
|
173
|
-
function
|
|
193
|
+
function C(e) {
|
|
174
194
|
var a;
|
|
175
|
-
return
|
|
195
|
+
return l.selectable !== !1 && ((a = l.getSelectionProps) == null ? void 0 : a.call(l, e.row, e.index).disabled) !== !0 && (typeof l.selectable != "function" || l.selectable(e.row, e.index));
|
|
176
196
|
}
|
|
177
|
-
const
|
|
178
|
-
const e = [], a = [...
|
|
197
|
+
const O = s(() => {
|
|
198
|
+
const e = [], a = [...ye.value].reverse();
|
|
179
199
|
for (; a.length; ) {
|
|
180
200
|
const t = a.pop();
|
|
181
|
-
|
|
182
|
-
const
|
|
183
|
-
for (let o =
|
|
201
|
+
C(t) && e.push(t);
|
|
202
|
+
const n = E.value.children.get(t.token) ?? [];
|
|
203
|
+
for (let o = n.length - 1; o >= 0; o--) a.push(n[o]);
|
|
184
204
|
}
|
|
185
205
|
return e;
|
|
186
|
-
}),
|
|
187
|
-
() => !!
|
|
188
|
-
),
|
|
189
|
-
() => !
|
|
190
|
-
(e) =>
|
|
206
|
+
}), ie = s(
|
|
207
|
+
() => !!O.value.length && O.value.every((e) => k.value.has(e.token))
|
|
208
|
+
), Me = s(
|
|
209
|
+
() => !ie.value && O.value.some(
|
|
210
|
+
(e) => k.value.has(e.token) || ue.value.has(e.token)
|
|
191
211
|
)
|
|
192
|
-
),
|
|
212
|
+
), be = s(() => ({
|
|
193
213
|
action: "page",
|
|
194
|
-
page:
|
|
195
|
-
pageSize:
|
|
196
|
-
sorts:
|
|
214
|
+
page: U.value,
|
|
215
|
+
pageSize: X.value,
|
|
216
|
+
sorts: N.value.map((e) => ({ ...e })),
|
|
197
217
|
filters: Object.fromEntries(
|
|
198
|
-
Object.entries(
|
|
218
|
+
Object.entries(j.value).map(([e, a]) => [e, [...a]])
|
|
199
219
|
),
|
|
200
|
-
currentData:
|
|
220
|
+
currentData: Se.value
|
|
201
221
|
}));
|
|
202
|
-
function
|
|
203
|
-
const t = { ...
|
|
204
|
-
|
|
222
|
+
function Y(e, a = {}) {
|
|
223
|
+
const t = { ...be.value, ...a, action: e };
|
|
224
|
+
i("queryChange", t), i("change", t);
|
|
205
225
|
}
|
|
206
|
-
function
|
|
207
|
-
if (g.value || !
|
|
208
|
-
const t = Math.max(1, Math.min(
|
|
209
|
-
|
|
226
|
+
function Ke(e, a = "page") {
|
|
227
|
+
if (g.value || !f.value) return;
|
|
228
|
+
const t = Math.max(1, Math.min(re.value, Math.floor(e) || 1));
|
|
229
|
+
q.value = t, i("update:page", t), i("pageChange", t), Y(a, { page: t });
|
|
210
230
|
}
|
|
211
|
-
function
|
|
212
|
-
g.value || !
|
|
231
|
+
function Fe(e) {
|
|
232
|
+
g.value || !f.value || !Number.isFinite(e) || e < 1 || (_.value = Math.floor(e), q.value = 1, i("update:pageSize", _.value), i("pageSizeChange", _.value), i("update:page", 1), i("pageChange", 1), Y("pageSize", { page: 1, pageSize: _.value }));
|
|
213
233
|
}
|
|
214
|
-
function
|
|
215
|
-
if (g.value || !
|
|
216
|
-
const a = (
|
|
217
|
-
|
|
234
|
+
function xe(e) {
|
|
235
|
+
if (g.value || !f.value) return;
|
|
236
|
+
const a = H(
|
|
237
|
+
Array.isArray(e) ? [...e] : e ? [e] : []
|
|
218
238
|
);
|
|
219
|
-
|
|
220
|
-
(t, l) => {
|
|
221
|
-
var o, r;
|
|
222
|
-
return (((o = b().find((u) => u.key === l.key)) == null ? void 0 : o.sortPriority) ?? 0) - (((r = b().find((u) => u.key === t.key)) == null ? void 0 : r.sortPriority) ?? 0);
|
|
223
|
-
}
|
|
224
|
-
), I.value = 1, s("update:sort", K.value[0] ?? null), s("update:sorts", K.value), s("sortChange", K.value[0] ?? null, K.value), s("update:page", 1), Z("sort", { sorts: K.value, page: 1 });
|
|
239
|
+
de.value = l.sorts !== void 0 || l.sort !== void 0 ? a : a.filter((t) => !oe.value.has(t.key)), q.value = 1, i("update:sort", a[0] ?? null), i("update:sorts", a), i("sortChange", a[0] ?? null, a), i("update:page", 1), Y("sort", { sorts: a, page: 1 });
|
|
225
240
|
}
|
|
226
|
-
function
|
|
227
|
-
var
|
|
241
|
+
function me(e, a) {
|
|
242
|
+
var o, r, u;
|
|
243
|
+
const t = (o = N.value.find((c) => c.key === e.key)) == null ? void 0 : o.direction, n = (r = e.sortOrders) != null && r.length ? e.sortOrders : (u = l.sortOrders) != null && u.length ? l.sortOrders : ["asc", "desc", null];
|
|
244
|
+
return a ? t === a ? null : a : n[(n.indexOf(t ?? null) + 1) % n.length];
|
|
245
|
+
}
|
|
246
|
+
function Te(e, a) {
|
|
228
247
|
if (!e.sortable) return;
|
|
229
|
-
const t = (
|
|
230
|
-
|
|
248
|
+
const t = me(e, a), n = l.multiSort ? N.value.filter((o) => o.key !== e.key) : [];
|
|
249
|
+
t && n.push({ key: e.key, direction: t }), xe(n);
|
|
231
250
|
}
|
|
232
|
-
function
|
|
233
|
-
g.value || !
|
|
251
|
+
function Ce(e) {
|
|
252
|
+
if (g.value || !f.value) return;
|
|
253
|
+
const a = new Set(m().filter((t) => t.filteredValue !== void 0).map((t) => t.key));
|
|
254
|
+
te.value = l.filters !== void 0 || !a.size ? e : Object.fromEntries(Object.entries(e).filter(([t]) => !a.has(t))), q.value = 1, i("update:filters", e), i("filterChange", e), i("update:page", 1), Y("filter", { filters: e, page: 1 });
|
|
234
255
|
}
|
|
235
|
-
function
|
|
236
|
-
|
|
256
|
+
function Ne(e, a) {
|
|
257
|
+
m().some((t) => t.key === e) && Ce({ ...j.value, [e]: [...a] });
|
|
237
258
|
}
|
|
238
|
-
function
|
|
239
|
-
|
|
259
|
+
function je(e) {
|
|
260
|
+
Ce(
|
|
240
261
|
e ? Object.fromEntries(
|
|
241
|
-
Object.entries(
|
|
262
|
+
Object.entries(j.value).filter(
|
|
242
263
|
([a]) => !e.includes(a)
|
|
243
264
|
)
|
|
244
265
|
) : {}
|
|
245
266
|
);
|
|
246
267
|
}
|
|
247
|
-
function
|
|
248
|
-
return
|
|
249
|
-
|
|
268
|
+
function P(e) {
|
|
269
|
+
return d.value.map.get(
|
|
270
|
+
b(typeof e == "object" ? le(e) : e)
|
|
250
271
|
);
|
|
251
272
|
}
|
|
252
|
-
function
|
|
253
|
-
return
|
|
254
|
-
var
|
|
255
|
-
const a =
|
|
273
|
+
function K() {
|
|
274
|
+
return S.value.flatMap((e) => {
|
|
275
|
+
var n;
|
|
276
|
+
const a = b(e), t = ((n = d.value.map.get(a)) == null ? void 0 : n.row) ?? (l.reserveSelection ? B.get(a) : void 0);
|
|
256
277
|
return t ? [t] : [];
|
|
257
278
|
});
|
|
258
279
|
}
|
|
259
|
-
async function
|
|
260
|
-
if (g.value || !
|
|
280
|
+
async function Z(e) {
|
|
281
|
+
if (g.value || !f.value) return !1;
|
|
261
282
|
const a = [...new Set(e)];
|
|
262
|
-
|
|
263
|
-
const t =
|
|
264
|
-
return t &&
|
|
283
|
+
ve.value = a, i("update:selectedRowKeys", a), await ee();
|
|
284
|
+
const t = f.value && a.length === S.value.length && a.every((n) => k.value.has(b(n)));
|
|
285
|
+
return t && i("selectionChange", K(), S.value), t;
|
|
265
286
|
}
|
|
266
|
-
function
|
|
267
|
-
if (!(
|
|
268
|
-
for (let a =
|
|
269
|
-
const t =
|
|
270
|
-
!
|
|
287
|
+
function Pe(e) {
|
|
288
|
+
if (!(l.checkStrictly !== !1 || l.selectionType === "radio"))
|
|
289
|
+
for (let a = d.value.all.length - 1; a >= 0; a--) {
|
|
290
|
+
const t = d.value.all[a], n = t.children.filter(C);
|
|
291
|
+
!n.length || !C(t) || (n.every((o) => e.has(o.token)) ? e.add(t.token) : e.delete(t.token));
|
|
271
292
|
}
|
|
272
293
|
}
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
const
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
294
|
+
function $(e) {
|
|
295
|
+
Pe(e);
|
|
296
|
+
const a = S.value.filter((t) => e.has(b(t)));
|
|
297
|
+
for (const t of d.value.all)
|
|
298
|
+
e.has(t.token) && !k.value.has(t.token) && a.push(t.key);
|
|
299
|
+
return Z(a);
|
|
300
|
+
}
|
|
301
|
+
let Ae;
|
|
302
|
+
async function Ie(e, a, t = !1) {
|
|
303
|
+
const n = P(e), o = typeof t == "boolean" ? t : t.range, r = typeof t == "object" && t.ignoreSelectable;
|
|
304
|
+
if (!n || !r && !C(n) || g.value || !f.value)
|
|
305
|
+
return !1;
|
|
306
|
+
const u = a ?? !k.value.has(n.token);
|
|
307
|
+
if (l.selectionType === "radio") {
|
|
308
|
+
const v = await Z(u ? [n.key] : []);
|
|
309
|
+
return v && i("select", K(), n.row, u), v;
|
|
281
310
|
}
|
|
282
|
-
const
|
|
283
|
-
for (;
|
|
284
|
-
const
|
|
285
|
-
|
|
311
|
+
const c = o && l.rangeSelection ? J.value.findIndex((v) => v.token === Ae) : -1, y = J.value.findIndex((v) => v.token === n.token), M = c >= 0 && y >= 0 ? J.value.slice(Math.min(c, y), Math.max(c, y) + 1) : [n], F = new Set(k.value), w = [...M], D = /* @__PURE__ */ new Set();
|
|
312
|
+
for (; w.length; ) {
|
|
313
|
+
const v = w.pop();
|
|
314
|
+
D.has(v.token) || (D.add(v.token), (r && v === n || C(v)) && (u ? F.add(v.token) : F.delete(v.token)), l.checkStrictly === !1 && w.push(...v.children));
|
|
286
315
|
}
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
...new Map([
|
|
290
|
-
...M.value.filter((i) => w.has(y(i))).map((i) => [y(i), i]),
|
|
291
|
-
...f.value.all.filter((i) => w.has(i.token)).map((i) => [i.token, i.key])
|
|
292
|
-
]).values()
|
|
293
|
-
], U = await j(S);
|
|
294
|
-
return U && (be = l.token, s("select", O(), l.row, o), c.length > 1 && s(
|
|
316
|
+
const T = await $(F);
|
|
317
|
+
return T && (Ae = n.token, i("select", K(), n.row, u), M.length > 1 && i(
|
|
295
318
|
"selectRange",
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
)),
|
|
319
|
+
K(),
|
|
320
|
+
M.filter(C).map((v) => v.row),
|
|
321
|
+
u
|
|
322
|
+
)), T;
|
|
300
323
|
}
|
|
301
|
-
async function
|
|
302
|
-
if (
|
|
303
|
-
const a = e ?? (
|
|
304
|
-
for (const
|
|
305
|
-
a ?
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
], o = await j(l);
|
|
313
|
-
return o && s("selectAll", O(), a), o;
|
|
324
|
+
async function qe(e) {
|
|
325
|
+
if (l.selectionType === "radio") return !1;
|
|
326
|
+
const a = e ?? (Me.value && l.selectOnIndeterminate === !1 ? !1 : !ie.value), t = k.value, n = new Set(t), o = O.value;
|
|
327
|
+
for (const u of o)
|
|
328
|
+
a ? n.add(u.token) : n.delete(u.token);
|
|
329
|
+
const r = await $(n);
|
|
330
|
+
if (r) {
|
|
331
|
+
const u = o.filter(({ token: c }) => t.has(c) !== n.has(c));
|
|
332
|
+
i("selectAll", K(), a, u.map(({ row: c }) => c));
|
|
333
|
+
}
|
|
334
|
+
return r;
|
|
314
335
|
}
|
|
315
|
-
async function
|
|
316
|
-
if (
|
|
336
|
+
async function _e() {
|
|
337
|
+
if (l.selectionType === "radio" || g.value || !f.value)
|
|
317
338
|
return !1;
|
|
318
|
-
const e = new Set(
|
|
319
|
-
for (const
|
|
320
|
-
(
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
339
|
+
const e = new Set(k.value);
|
|
340
|
+
for (const t of O.value)
|
|
341
|
+
(l.checkStrictly !== !1 || !t.children.some(C)) && (e.has(t.token) ? e.delete(t.token) : e.add(t.token));
|
|
342
|
+
const a = await $(e);
|
|
343
|
+
return a && i("selectInvert", K(), S.value), a;
|
|
344
|
+
}
|
|
345
|
+
async function We(e, a = O.value) {
|
|
346
|
+
if (l.selectionType === "radio" || g.value || !f.value) return !1;
|
|
347
|
+
const t = new Set(e.map(b)), n = new Set(k.value);
|
|
348
|
+
for (const o of a) {
|
|
349
|
+
const r = d.value.map.get(o.token);
|
|
350
|
+
(r == null ? void 0 : r.row) !== o.row || !C(r) || (t.has(o.token) ? n.add(o.token) : n.delete(o.token));
|
|
351
|
+
}
|
|
352
|
+
return $(n);
|
|
329
353
|
}
|
|
330
|
-
async function
|
|
331
|
-
|
|
332
|
-
|
|
354
|
+
async function Ge() {
|
|
355
|
+
const e = S.value.length > 0, a = await Z([]);
|
|
356
|
+
return e && a && i("selectNone"), a;
|
|
357
|
+
}
|
|
358
|
+
async function Ve(e) {
|
|
359
|
+
if (g.value || !f.value) return !1;
|
|
360
|
+
const a = e == null ? void 0 : P(e);
|
|
333
361
|
if (e != null && !a) return !1;
|
|
334
|
-
const t =
|
|
335
|
-
|
|
336
|
-
const
|
|
337
|
-
return
|
|
362
|
+
const t = Q.value;
|
|
363
|
+
ae.value = (a == null ? void 0 : a.key) ?? null, i("update:currentRowKey", ae.value), await ee();
|
|
364
|
+
const n = f.value && L.value === ((a == null ? void 0 : a.key) ?? null);
|
|
365
|
+
return n && Q.value !== t && i("currentChange", Q.value, t), n;
|
|
338
366
|
}
|
|
339
|
-
function
|
|
367
|
+
function I(e) {
|
|
340
368
|
const a = h.value.get(e);
|
|
341
369
|
if (!a) return;
|
|
342
370
|
a.controller.abort(), W.delete(a.row);
|
|
343
371
|
const t = new Map(h.value);
|
|
344
372
|
t.delete(e), h.value = t;
|
|
345
373
|
}
|
|
346
|
-
async function
|
|
374
|
+
async function Re(e, a = !1) {
|
|
347
375
|
var u;
|
|
348
|
-
const t =
|
|
349
|
-
if (!t || !
|
|
376
|
+
const t = P(e), n = l.loadChildren;
|
|
377
|
+
if (!t || !n || !l.treeMode || g.value || !f.value || h.value.has(t.token))
|
|
350
378
|
return !1;
|
|
351
379
|
if (!a && !t.lazy && x.value.has(t.token)) return !0;
|
|
352
380
|
W.add(t.row);
|
|
353
381
|
const o = { row: t.row, controller: new AbortController() };
|
|
354
382
|
h.value = new Map(h.value).set(t.token, o);
|
|
355
|
-
const r = new Map(
|
|
356
|
-
r.delete(t.token),
|
|
383
|
+
const r = new Map(A.value);
|
|
384
|
+
r.delete(t.token), A.value = r;
|
|
357
385
|
try {
|
|
358
|
-
const c = await
|
|
386
|
+
const c = await n(t.row, {
|
|
359
387
|
signal: o.controller.signal,
|
|
360
388
|
key: t.key,
|
|
361
389
|
depth: t.depth
|
|
362
390
|
});
|
|
363
|
-
if (!
|
|
391
|
+
if (!f.value || o.controller.signal.aborted || h.value.get(t.token) !== o || ((u = d.value.map.get(t.token)) == null ? void 0 : u.row) !== t.row || l.loadChildren !== n)
|
|
364
392
|
return !1;
|
|
365
393
|
if (!Array.isArray(c))
|
|
366
394
|
throw new TypeError("loadChildren must return an array");
|
|
367
395
|
return x.value = new Map(x.value).set(t.token, {
|
|
368
396
|
row: t.row,
|
|
369
397
|
rows: c
|
|
370
|
-
}),
|
|
398
|
+
}), i("load", t.row, c), !0;
|
|
371
399
|
} catch (c) {
|
|
372
|
-
return
|
|
400
|
+
return f.value && !o.controller.signal.aborted && h.value.get(t.token) === o && (A.value = new Map(A.value).set(t.token, c), i("loadError", t.row, c)), !1;
|
|
373
401
|
} finally {
|
|
374
402
|
if (h.value.get(t.token) === o) {
|
|
375
403
|
const c = new Map(h.value);
|
|
@@ -377,98 +405,102 @@ function Ge(n, b, ie, s) {
|
|
|
377
405
|
}
|
|
378
406
|
}
|
|
379
407
|
}
|
|
380
|
-
function
|
|
408
|
+
function Ee(e) {
|
|
381
409
|
var a;
|
|
382
|
-
return ((a =
|
|
410
|
+
return ((a = l.rowExpandable) == null ? void 0 : a.call(l, e.row)) !== !1 && (e.children.length > 0 || e.lazy || !!l.expandable || fe());
|
|
383
411
|
}
|
|
384
|
-
async function
|
|
412
|
+
async function Xe(e, a) {
|
|
385
413
|
var r;
|
|
386
|
-
const t =
|
|
387
|
-
if (!t || !
|
|
414
|
+
const t = P(e);
|
|
415
|
+
if (!t || !l.treeMode || g.value || !f.value || !Array.isArray(a))
|
|
388
416
|
return !1;
|
|
389
|
-
|
|
390
|
-
const
|
|
391
|
-
x.value = new Map(x.value).set(t.token,
|
|
392
|
-
const o = new Map(
|
|
393
|
-
return o.delete(t.token),
|
|
417
|
+
I(t.token), W.add(t.row);
|
|
418
|
+
const n = { row: t.row, rows: [...a], override: !0 };
|
|
419
|
+
x.value = new Map(x.value).set(t.token, n);
|
|
420
|
+
const o = new Map(A.value);
|
|
421
|
+
return o.delete(t.token), A.value = o, await ee(), !f.value || x.value.get(t.token) !== n || ((r = d.value.map.get(t.token)) == null ? void 0 : r.row) !== t.row ? !1 : (i("childrenChange", t.row, n.rows), !0);
|
|
394
422
|
}
|
|
395
|
-
async function
|
|
396
|
-
const t =
|
|
397
|
-
if (!t || !
|
|
398
|
-
const
|
|
399
|
-
return
|
|
423
|
+
async function De(e, a) {
|
|
424
|
+
const t = P(e);
|
|
425
|
+
if (!t || !Ee(t) || g.value || !f.value) return !1;
|
|
426
|
+
const n = a ?? !V.value.has(t.token), o = G.value.filter((u) => b(u) !== t.token);
|
|
427
|
+
return n && o.push(t.key), ge.value = !0, he.value = o, i("update:expandedRowKeys", o), await ee(), f.value && V.value.has(t.token) === n ? (i("expandChange", t.row, n, G.value), n || I(t.token), !0) : !1;
|
|
400
428
|
}
|
|
401
|
-
function
|
|
402
|
-
|
|
403
|
-
for (const e of [...h.value.keys()])
|
|
429
|
+
function ze() {
|
|
430
|
+
f.value = !1;
|
|
431
|
+
for (const e of [...h.value.keys()]) I(e);
|
|
404
432
|
}
|
|
405
|
-
return
|
|
406
|
-
() =>
|
|
433
|
+
return p(
|
|
434
|
+
() => l.loadChildren,
|
|
407
435
|
() => {
|
|
408
|
-
for (const e of [...h.value.keys()])
|
|
409
|
-
x.value = /* @__PURE__ */ new Map(),
|
|
436
|
+
for (const e of [...h.value.keys()]) I(e);
|
|
437
|
+
x.value = /* @__PURE__ */ new Map(), A.value = /* @__PURE__ */ new Map(), W = /* @__PURE__ */ new WeakSet();
|
|
410
438
|
}
|
|
411
|
-
),
|
|
412
|
-
if (e) for (const a of [...h.value.keys()])
|
|
413
|
-
}),
|
|
414
|
-
[
|
|
439
|
+
), p(g, (e) => {
|
|
440
|
+
if (e) for (const a of [...h.value.keys()]) I(a);
|
|
441
|
+
}), p(
|
|
442
|
+
[G, () => d.value.all, () => h.value.size, f, g],
|
|
415
443
|
() => {
|
|
416
444
|
var a;
|
|
417
|
-
if (!
|
|
445
|
+
if (!f.value || g.value) return;
|
|
418
446
|
let e = Math.max(0, 4 - h.value.size);
|
|
419
|
-
for (const t of
|
|
447
|
+
for (const t of d.value.all) {
|
|
420
448
|
if (!e) break;
|
|
421
|
-
t.lazy &&
|
|
449
|
+
t.lazy && V.value.has(t.token) && !W.has(t.row) && !A.value.has(t.token) && ((a = l.rowExpandable) == null ? void 0 : a.call(l, t.row)) !== !1 && (e--, Re(t.key));
|
|
422
450
|
}
|
|
423
451
|
},
|
|
424
452
|
{ immediate: !0, flush: "post" }
|
|
425
|
-
),
|
|
426
|
-
live:
|
|
453
|
+
), Be(() => f.value = !0), He(ze), Ue(ze), {
|
|
454
|
+
live: f,
|
|
427
455
|
busy: g,
|
|
428
|
-
graph:
|
|
429
|
-
rowId:
|
|
430
|
-
selectedKeys:
|
|
431
|
-
selectedSet:
|
|
432
|
-
expandedKeys:
|
|
433
|
-
expandedSet:
|
|
434
|
-
halfSet:
|
|
435
|
-
eligible:
|
|
436
|
-
allSelected:
|
|
437
|
-
someSelected:
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
456
|
+
graph: d,
|
|
457
|
+
rowId: le,
|
|
458
|
+
selectedKeys: S,
|
|
459
|
+
selectedSet: k,
|
|
460
|
+
expandedKeys: G,
|
|
461
|
+
expandedSet: V,
|
|
462
|
+
halfSet: ue,
|
|
463
|
+
eligible: C,
|
|
464
|
+
allSelected: ie,
|
|
465
|
+
someSelected: Me,
|
|
466
|
+
selectionPage: O,
|
|
467
|
+
sorts: N,
|
|
468
|
+
filters: j,
|
|
469
|
+
processed: E,
|
|
470
|
+
filteredRows: Se,
|
|
471
|
+
display: J,
|
|
472
|
+
page: U,
|
|
473
|
+
pageSize: X,
|
|
474
|
+
pageCount: re,
|
|
475
|
+
paginationTotal: ke,
|
|
476
|
+
pagination: z,
|
|
477
|
+
currentKey: L,
|
|
478
|
+
currentRow: Q,
|
|
479
|
+
query: be,
|
|
450
480
|
pending: h,
|
|
451
|
-
loadErrors:
|
|
452
|
-
canExpand:
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
481
|
+
loadErrors: A,
|
|
482
|
+
canExpand: Ee,
|
|
483
|
+
nextSortOrder: me,
|
|
484
|
+
toggleSort: Te,
|
|
485
|
+
setSort: xe,
|
|
486
|
+
setFilter: Ne,
|
|
487
|
+
clearFilter: je,
|
|
488
|
+
requestPage: Ke,
|
|
489
|
+
changeSize: Fe,
|
|
490
|
+
toggleRowSelection: Ie,
|
|
491
|
+
toggleAllSelection: qe,
|
|
492
|
+
invertSelection: _e,
|
|
493
|
+
clearSelection: Ge,
|
|
494
|
+
selectPage: We,
|
|
495
|
+
getSelectionRows: K,
|
|
496
|
+
getHalfSelectionRows: () => d.value.all.filter((e) => ue.value.has(e.token)).map((e) => e.row),
|
|
497
|
+
setCurrentRow: Ve,
|
|
498
|
+
toggleRowExpansion: De,
|
|
499
|
+
loadRow: Re,
|
|
500
|
+
updateKeyChildren: Xe,
|
|
501
|
+
find: P
|
|
470
502
|
};
|
|
471
503
|
}
|
|
472
504
|
export {
|
|
473
|
-
|
|
505
|
+
Ze as useTable
|
|
474
506
|
};
|