vlite3 1.4.37 → 1.4.40
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/components/Badge.vue.js +5 -5
- package/components/Badge.vue3.js +5 -0
- package/components/CategoryManager/CategoryManager.vue2.js +5 -4
- package/components/Chip/Chip.vue.js +21 -21
- package/components/Chip/Chip.vue3.js +5 -0
- package/components/ColorPicker/ColorIro.vue3.js +2 -2
- package/components/ColorPicker/ColorPicker.vue.js +2 -2
- package/components/CommandPalette/CommandPaletteContent.vue2.js +1 -1
- package/components/CommandPalette/{CommandPaletteItem.vue2.js → CommandPaletteItem.vue.js} +1 -1
- package/components/Comment/CommentItem.vue2.js +3 -2
- package/components/DataTable/DataTable.vue.d.ts +1 -0
- package/components/DataTable/DataTable.vue.js +204 -203
- package/components/DataTable/DataTableRow.vue.js +54 -51
- package/components/DataTable/types.d.ts +5 -0
- package/components/DataTable/useDataTableTree.d.ts +4 -3
- package/components/DataTable/useDataTableTree.js +102 -92
- package/components/FileTree/FileTree.vue.d.ts +3 -1
- package/components/FileTree/FileTree.vue.js +1 -1
- package/components/FileTree/FileTree.vue2.js +157 -116
- package/components/FileTree/FileTreeNode.vue.d.ts +9 -5
- package/components/FileTree/FileTreeNode.vue.js +147 -189
- package/components/Form/{AccordionView.vue2.js → AccordionView.vue.js} +1 -1
- package/components/Form/Form.vue2.js +45 -43
- package/components/Form/index.vue2.js +1 -1
- package/components/ImportData/ImportData.vue.js +4 -2
- package/components/Invoice/InvoiceVariant1.vue.js +3 -2
- package/components/Invoice/InvoiceVariant2.vue.js +3 -2
- package/components/Invoice/InvoiceVariant3.vue.js +3 -2
- package/components/Invoice/InvoiceVariant4.vue.js +3 -2
- package/components/MultiSelect/MultiSelect.vue.js +3 -2
- package/components/NavbarCommandPalette.vue.js +1 -1
- package/components/PricingPlan/PricingPlanItem.vue.js +10 -9
- package/components/Screen/ScreenFilter.vue.js +20 -19
- package/components/StatusChip/StatusChip.vue.js +8 -7
- package/components/StatusChip/StatusChip.vue3.js +5 -0
- package/components/Timeline/TimelineItem.vue.js +3 -2
- package/components/TreeConnectors/TreeConnectors.vue.d.ts +1 -1
- package/components/TreeConnectors/TreeConnectors.vue.js +26 -17
- package/components/TreeConnectors/geometry.d.ts +29 -3
- package/components/TreeConnectors/geometry.js +128 -46
- package/components/TreeConnectors/index.d.ts +1 -1
- package/index.js +473 -470
- package/package.json +1 -1
- package/style.css +15 -1
- package/components/Badge.vue2.js +0 -4
- package/components/Chip/Chip.vue2.js +0 -4
- package/components/StatusChip/StatusChip.vue2.js +0 -4
- /package/components/ColorPicker/{ColorIro.vue2.js → ColorIro.vue.js} +0 -0
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import { defineComponent as D, computed as g, openBlock as o, createElementBlock as d, normalizeClass as x, withModifiers as I, createElementVNode as b, createVNode as v, createCommentVNode as w, Fragment as p, renderList as U, normalizeStyle as y, unref as c, createBlock as u, renderSlot as V } from "vue";
|
|
2
|
+
import R from "../CheckBox.vue.js";
|
|
3
|
+
import h from "../Icon.vue.js";
|
|
4
4
|
import G from "../Price/Price.vue.js";
|
|
5
5
|
import P from "../DateTime/DateTime.vue.js";
|
|
6
|
-
import
|
|
7
|
-
import { DEFAULT_TOGGLE_SIZE as
|
|
8
|
-
const
|
|
6
|
+
import O from "../TreeConnectors/TreeConnectors.vue.js";
|
|
7
|
+
import { DEFAULT_TOGGLE_SIZE as H, DEFAULT_TREE_CONTENT_GAP as k, DEFAULT_TREE_LEAF_INSET as E, DEFAULT_TREE_LEADING as j } from "../TreeConnectors/geometry.js";
|
|
8
|
+
const Z = ["data-state"], q = { class: "flex items-center justify-center" }, J = ["aria-expanded"], K = ["title", "innerHTML"], le = /* @__PURE__ */ D({
|
|
9
9
|
__name: "DataTableRow",
|
|
10
10
|
props: {
|
|
11
11
|
row: {},
|
|
@@ -31,13 +31,13 @@ const j = ["data-state"], Z = { class: "flex items-center justify-center" }, q =
|
|
|
31
31
|
},
|
|
32
32
|
emits: ["select", "rowClick", "toggleExpand"],
|
|
33
33
|
setup(e, { emit: C }) {
|
|
34
|
-
const s = e,
|
|
34
|
+
const s = e, f = C, a = (n, l) => {
|
|
35
35
|
if (!(!n || !l))
|
|
36
36
|
return l.includes(".") ? l.split(".").reduce((t, i) => t?.[i], n) : n[l];
|
|
37
|
-
}, S = (n, l, t) => n.format ? n.format(l, t) : l == null ? "-" : n.type === "number" ? new Intl.NumberFormat("en-US").format(Number(l)) : String(l),
|
|
37
|
+
}, S = (n, l, t) => n.format ? n.format(l, t) : l == null ? "-" : n.type === "number" ? new Intl.NumberFormat("en-US").format(Number(l)) : String(l), L = (n, l, t) => {
|
|
38
38
|
const i = [];
|
|
39
39
|
if (n.width && /(?:^|\s|:)w-/.test(n.width) && i.push(n.width), n.minWidth && /(?:^|\s|:)min-w-/.test(n.minWidth) && i.push(n.minWidth), n.capitalize && i.push("capitalize"), n.addStatusColor) {
|
|
40
|
-
const r =
|
|
40
|
+
const r = B(l);
|
|
41
41
|
r && i.push(r);
|
|
42
42
|
}
|
|
43
43
|
if (typeof n.class == "function") {
|
|
@@ -45,7 +45,7 @@ const j = ["data-state"], Z = { class: "flex items-center justify-center" }, q =
|
|
|
45
45
|
r && i.push(r);
|
|
46
46
|
} else n.class && i.push(n.class);
|
|
47
47
|
return i.join(" ");
|
|
48
|
-
},
|
|
48
|
+
}, B = (n) => {
|
|
49
49
|
const l = {
|
|
50
50
|
active: "text-success font-medium",
|
|
51
51
|
inactive: "text-muted-foreground",
|
|
@@ -62,54 +62,55 @@ const j = ["data-state"], Z = { class: "flex items-center justify-center" }, q =
|
|
|
62
62
|
low: "text-muted-foreground"
|
|
63
63
|
}, t = String(n).toLowerCase().replace(/[-_\s]/g, "");
|
|
64
64
|
return l[t] || "";
|
|
65
|
-
},
|
|
65
|
+
}, T = (n) => ({
|
|
66
66
|
left: "text-left",
|
|
67
67
|
center: "text-center",
|
|
68
68
|
right: "text-right"
|
|
69
|
-
})[n.align || "left"], M =
|
|
69
|
+
})[n.align || "left"], M = g(() => a(s.row, s.keyField)), F = () => {
|
|
70
70
|
const { size: n, compact: l, cellBordered: t } = s;
|
|
71
71
|
return n === "xs" || l ? `py-1.5! -text-fs-1.5! ${t ? "px-3!" : "pr-4 max-sm:pr-10!"}` : n === "sm" ? `py-2! -text-fs-1.5! ${t ? "px-3!" : "pr-5 max-sm:pr-10!"}` : n === "lg" ? `py-4! text-base ${t ? "px-4!" : "pr-7 max-sm:pr-12!"}` : `py-3! -text-fs-1.5! ${t ? "px-3.5!" : "pr-6! max-sm:pr-10!"}`;
|
|
72
|
-
}, m =
|
|
72
|
+
}, m = j, z = g(
|
|
73
73
|
() => s.treeMode ? m + s.depth * s.treeIndent : 0
|
|
74
|
-
),
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
74
|
+
), N = g(() => {
|
|
75
|
+
const n = m + s.depth * s.treeIndent;
|
|
76
|
+
return s.expandable ? n + H + k : n + E;
|
|
77
|
+
}), $ = () => {
|
|
78
|
+
f("rowClick", { row: s.row, index: s.index });
|
|
79
|
+
}, A = () => {
|
|
80
|
+
f("select", M.value);
|
|
80
81
|
}, W = (n) => {
|
|
81
|
-
n.stopPropagation(),
|
|
82
|
+
n.stopPropagation(), f("toggleExpand");
|
|
82
83
|
};
|
|
83
84
|
return (n, l) => (o(), d("tr", {
|
|
84
|
-
class:
|
|
85
|
+
class: x(["border-b data-[state=selected]:bg-muted h-full", [
|
|
85
86
|
e.hoverable ? "hover:bg-muted/20" : "",
|
|
86
87
|
e.striped && e.index % 2 === 1 ? "bg-muted/20" : "bg-background",
|
|
87
88
|
e.isSelected ? "bg-muted! hover:bg-muted/30" : "",
|
|
88
89
|
"group"
|
|
89
90
|
]]),
|
|
90
91
|
"data-state": e.isSelected ? "selected" : void 0,
|
|
91
|
-
onClick:
|
|
92
|
+
onClick: $
|
|
92
93
|
}, [
|
|
93
94
|
e.selectable ? (o(), d("td", {
|
|
94
95
|
key: 0,
|
|
95
96
|
class: "px-0! py-1! align-middle text-center",
|
|
96
|
-
onClick: l[0] || (l[0] =
|
|
97
|
+
onClick: l[0] || (l[0] = I(() => {
|
|
97
98
|
}, ["stop"]))
|
|
98
99
|
}, [
|
|
99
|
-
b("div",
|
|
100
|
-
v(
|
|
100
|
+
b("div", q, [
|
|
101
|
+
v(R, {
|
|
101
102
|
"model-value": e.isSelected,
|
|
102
103
|
indeterminate: e.isIndeterminate,
|
|
103
104
|
size: "xs",
|
|
104
|
-
"onUpdate:modelValue":
|
|
105
|
+
"onUpdate:modelValue": A
|
|
105
106
|
}, null, 8, ["model-value", "indeterminate"])
|
|
106
107
|
])
|
|
107
|
-
])) :
|
|
108
|
-
(o(!0), d(p, null,
|
|
108
|
+
])) : w("", !0),
|
|
109
|
+
(o(!0), d(p, null, U(e.headers, (t, i) => (o(), d("td", {
|
|
109
110
|
key: t.field,
|
|
110
|
-
class:
|
|
111
|
-
|
|
112
|
-
|
|
111
|
+
class: x(["align-middle whitespace-normal wrap-break-word", [
|
|
112
|
+
F(),
|
|
113
|
+
T(t),
|
|
113
114
|
t.hideOnMobile ? "hidden md:table-cell" : "",
|
|
114
115
|
e.treeMode ? "max-w-none min-w-0" : "max-w-[400px]",
|
|
115
116
|
// Keep overflow clip on data cells; last column (actions) must stay visible
|
|
@@ -118,9 +119,9 @@ const j = ["data-state"], Z = { class: "flex items-center justify-center" }, q =
|
|
|
118
119
|
// lines join seamlessly across rows. overflow-visible lets the connector
|
|
119
120
|
// overlay bleed across the collapsed row border for continuous trunks.
|
|
120
121
|
e.treeMode && i === 0 ? "relative pl-0! overflow-visible!" : "",
|
|
121
|
-
|
|
122
|
+
L(t, a(e.row, t.field), e.row)
|
|
122
123
|
]]),
|
|
123
|
-
style:
|
|
124
|
+
style: y(
|
|
124
125
|
e.treeMode ? void 0 : {
|
|
125
126
|
...t.width && !/(?:^|\s|:)w-/.test(t.width) ? { width: t.width } : {},
|
|
126
127
|
...t.minWidth && !/(?:^|\s|:)min-w-/.test(t.minWidth) ? { minWidth: t.minWidth } : {}
|
|
@@ -128,54 +129,56 @@ const j = ["data-state"], Z = { class: "flex items-center justify-center" }, q =
|
|
|
128
129
|
)
|
|
129
130
|
}, [
|
|
130
131
|
e.treeMode && i === 0 ? (o(), d(p, { key: 0 }, [
|
|
131
|
-
v(
|
|
132
|
+
v(c(O), {
|
|
132
133
|
depth: e.depth,
|
|
133
134
|
"is-last-sibling": e.isLastSibling,
|
|
134
135
|
"ancestor-last-flags": e.ancestorLastFlags,
|
|
135
136
|
"has-toggle": e.expandable,
|
|
136
137
|
indent: e.treeIndent,
|
|
137
|
-
"base-inset":
|
|
138
|
-
"content-gap":
|
|
138
|
+
"base-inset": c(m),
|
|
139
|
+
"content-gap": c(k),
|
|
140
|
+
"leaf-has-spacer": !1,
|
|
141
|
+
"leaf-inset": c(E),
|
|
139
142
|
"bleed-y": ""
|
|
140
|
-
}, null, 8, ["depth", "is-last-sibling", "ancestor-last-flags", "has-toggle", "indent", "base-inset", "content-gap"]),
|
|
143
|
+
}, null, 8, ["depth", "is-last-sibling", "ancestor-last-flags", "has-toggle", "indent", "base-inset", "content-gap", "leaf-inset"]),
|
|
141
144
|
e.expandable ? (o(), d("button", {
|
|
142
145
|
key: 0,
|
|
143
146
|
type: "button",
|
|
144
147
|
class: "absolute z-10 top-1/2 -translate-y-1/2 flex h-6 w-6 items-center justify-center rounded-sm text-muted-foreground hover:bg-muted hover:text-foreground transition-colors focus:outline-none",
|
|
145
|
-
style:
|
|
148
|
+
style: y({ left: z.value + "px" }),
|
|
146
149
|
"aria-expanded": e.expanded,
|
|
147
150
|
onClick: W
|
|
148
151
|
}, [
|
|
149
|
-
e.treeLoading ? (o(),
|
|
152
|
+
e.treeLoading ? (o(), u(h, {
|
|
150
153
|
key: 0,
|
|
151
154
|
icon: "lucide:loader-2",
|
|
152
155
|
class: "h-4 w-4 animate-spin"
|
|
153
|
-
})) : (o(),
|
|
156
|
+
})) : (o(), u(h, {
|
|
154
157
|
key: 1,
|
|
155
158
|
icon: e.expanded ? "lucide:chevron-down" : "lucide:chevron-right",
|
|
156
159
|
class: "h-4 w-4"
|
|
157
160
|
}, null, 8, ["icon"]))
|
|
158
|
-
], 12,
|
|
159
|
-
], 64)) :
|
|
161
|
+
], 12, J)) : w("", !0)
|
|
162
|
+
], 64)) : w("", !0),
|
|
160
163
|
b("div", {
|
|
161
|
-
class:
|
|
164
|
+
class: x([
|
|
162
165
|
"w-full min-w-0",
|
|
163
|
-
e.treeMode && i === 0 ? "relative flex items-center min-h-[28px] max-h-[80px] overflow-y-auto" : i === e.headers.length - 1 ? "overflow-visible" : "max-h-[80px] overflow-y-auto"
|
|
166
|
+
e.treeMode && i === 0 ? "relative flex items-center min-h-[28px] max-h-[80px] overflow-y-auto scrollbar-hide" : i === e.headers.length - 1 ? "overflow-visible" : "max-h-[80px] overflow-y-auto scrollbar-hide"
|
|
164
167
|
]),
|
|
165
|
-
style:
|
|
168
|
+
style: y(e.treeMode && i === 0 ? { paddingLeft: N.value + "px" } : void 0)
|
|
166
169
|
}, [
|
|
167
|
-
|
|
170
|
+
V(n.$slots, t.field, {
|
|
168
171
|
value: a(e.row, t.field),
|
|
169
172
|
row: e.row,
|
|
170
173
|
index: e.index,
|
|
171
174
|
field: t.field
|
|
172
175
|
}, () => [
|
|
173
|
-
t.type === "price" ? (o(),
|
|
176
|
+
t.type === "price" ? (o(), u(G, {
|
|
174
177
|
key: 0,
|
|
175
178
|
value: a(e.row, t.field),
|
|
176
179
|
class: "block",
|
|
177
180
|
title: String(a(e.row, t.field))
|
|
178
|
-
}, null, 8, ["value", "title"])) : t.type === "date" ? (o(),
|
|
181
|
+
}, null, 8, ["value", "title"])) : t.type === "date" ? (o(), u(P, {
|
|
179
182
|
key: 1,
|
|
180
183
|
value: a(e.row, t.field),
|
|
181
184
|
class: "block",
|
|
@@ -185,13 +188,13 @@ const j = ["data-state"], Z = { class: "flex items-center justify-center" }, q =
|
|
|
185
188
|
class: "block",
|
|
186
189
|
title: String(a(e.row, t.field)),
|
|
187
190
|
innerHTML: S(t, a(e.row, t.field), e.row)
|
|
188
|
-
}, null, 8,
|
|
191
|
+
}, null, 8, K))
|
|
189
192
|
])
|
|
190
193
|
], 6)
|
|
191
194
|
], 6))), 128))
|
|
192
|
-
], 10,
|
|
195
|
+
], 10, Z));
|
|
193
196
|
}
|
|
194
197
|
});
|
|
195
198
|
export {
|
|
196
|
-
|
|
199
|
+
le as default
|
|
197
200
|
};
|
|
@@ -67,6 +67,11 @@ export interface DataTableProps {
|
|
|
67
67
|
bordered?: boolean;
|
|
68
68
|
cellBordered?: boolean;
|
|
69
69
|
compact?: boolean;
|
|
70
|
+
/**
|
|
71
|
+
* When `true` (default), the table container uses rounded corners.
|
|
72
|
+
* Set to `false` for sharp/square edges.
|
|
73
|
+
*/
|
|
74
|
+
rounded?: boolean;
|
|
70
75
|
tableClass?: string;
|
|
71
76
|
class?: string;
|
|
72
77
|
sortable?: boolean;
|
|
@@ -9,11 +9,12 @@ export interface UseDataTableTreeOptions {
|
|
|
9
9
|
}
|
|
10
10
|
export declare function useDataTableTree({ rows, keyField, loadChildren, getRowId, onExpand, }: UseDataTableTreeOptions): {
|
|
11
11
|
isTreeMode: ComputedRef<boolean>;
|
|
12
|
-
expandedKeys:
|
|
13
|
-
loadingKeys:
|
|
14
|
-
childrenCache:
|
|
12
|
+
expandedKeys: import('vue').ShallowRef<Set<any>, Set<any>>;
|
|
13
|
+
loadingKeys: import('vue').ShallowRef<Set<any>, Set<any>>;
|
|
14
|
+
childrenCache: import('vue').ShallowRef<Map<any, any[]>, Map<any, any[]>>;
|
|
15
15
|
flattenVisibleRows: ComputedRef<DataTableFlatRow[]>;
|
|
16
16
|
allLoadedRows: ComputedRef<Map<any, any>>;
|
|
17
|
+
findParentId: (id: any) => any | null;
|
|
17
18
|
getChildren: (row: any) => any[];
|
|
18
19
|
isExpandable: (row: any) => boolean;
|
|
19
20
|
isExpanded: (id: any) => boolean;
|
|
@@ -1,137 +1,147 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { shallowRef as E, computed as g } from "vue";
|
|
2
|
+
import { EMPTY_ANCESTOR_LAST_FLAGS as D, appendAncestorLastFlag as P } from "../TreeConnectors/geometry.js";
|
|
3
|
+
const L = "children", G = "hasChildren";
|
|
4
|
+
function H(d) {
|
|
5
|
+
const c = d?.[L];
|
|
6
|
+
return Array.isArray(c) && c.length > 0;
|
|
6
7
|
}
|
|
7
|
-
function
|
|
8
|
-
return
|
|
8
|
+
function A(d) {
|
|
9
|
+
return d?.[G] === !0;
|
|
9
10
|
}
|
|
10
|
-
function
|
|
11
|
-
rows:
|
|
12
|
-
keyField:
|
|
13
|
-
loadChildren:
|
|
11
|
+
function q({
|
|
12
|
+
rows: d,
|
|
13
|
+
keyField: c,
|
|
14
|
+
loadChildren: S,
|
|
14
15
|
getRowId: f,
|
|
15
|
-
onExpand:
|
|
16
|
+
onExpand: T
|
|
16
17
|
}) {
|
|
17
|
-
const
|
|
18
|
-
if (
|
|
18
|
+
const o = E(/* @__PURE__ */ new Set()), v = E(/* @__PURE__ */ new Set()), i = E(/* @__PURE__ */ new Map()), b = g(() => {
|
|
19
|
+
if (S?.value) return !0;
|
|
19
20
|
const e = (t) => {
|
|
20
21
|
for (const n of t) {
|
|
21
|
-
if (H(n) ||
|
|
22
|
-
const a = n?.[
|
|
22
|
+
if (H(n) || A(n)) return !0;
|
|
23
|
+
const a = n?.[L];
|
|
23
24
|
if (Array.isArray(a) && e(a)) return !0;
|
|
24
25
|
}
|
|
25
26
|
return !1;
|
|
26
27
|
};
|
|
27
|
-
return e(
|
|
28
|
-
}),
|
|
29
|
-
const t = f(e,
|
|
30
|
-
if (
|
|
31
|
-
return
|
|
32
|
-
const n = e?.[
|
|
28
|
+
return e(d.value || []);
|
|
29
|
+
}), p = (e) => {
|
|
30
|
+
const t = f(e, c.value);
|
|
31
|
+
if (i.value.has(t))
|
|
32
|
+
return i.value.get(t) || [];
|
|
33
|
+
const n = e?.[L];
|
|
33
34
|
return Array.isArray(n) ? n : [];
|
|
34
|
-
},
|
|
35
|
-
const t = f(e,
|
|
36
|
-
return
|
|
37
|
-
}, K = (e) =>
|
|
35
|
+
}, C = (e) => {
|
|
36
|
+
const t = f(e, c.value);
|
|
37
|
+
return i.value.has(t) ? (i.value.get(t) || []).length > 0 : H(e) ? !0 : A(e);
|
|
38
|
+
}, K = (e) => o.value.has(e), N = (e) => v.value.has(e), I = (e) => {
|
|
38
39
|
const t = [], n = (a) => {
|
|
39
|
-
for (const
|
|
40
|
-
t.push(f(
|
|
40
|
+
for (const l of p(a))
|
|
41
|
+
t.push(f(l, c.value)), n(l);
|
|
41
42
|
};
|
|
42
43
|
return n(e), t;
|
|
43
|
-
},
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
44
|
+
}, M = g(() => {
|
|
45
|
+
const e = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Map(), n = (a, l) => {
|
|
46
|
+
for (const s of a) {
|
|
47
|
+
const h = f(s, c.value);
|
|
48
|
+
e.set(h, s), t.set(h, l);
|
|
49
|
+
const u = p(s);
|
|
50
|
+
u.length && n(u, h);
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
return n(d.value || [], null), { byId: e, parentById: t };
|
|
54
|
+
}), m = g(() => M.value.byId), Y = (e) => M.value.parentById.get(e) ?? null, B = g(() => {
|
|
55
|
+
if (!b.value) {
|
|
56
|
+
const a = d.value || [];
|
|
57
|
+
return a.map((l, s) => ({
|
|
58
|
+
row: l,
|
|
59
|
+
id: f(l, c.value),
|
|
48
60
|
depth: 0,
|
|
49
61
|
parentId: null,
|
|
50
|
-
isLastSibling: s ===
|
|
51
|
-
ancestorLastFlags:
|
|
62
|
+
isLastSibling: s === a.length - 1,
|
|
63
|
+
ancestorLastFlags: D,
|
|
52
64
|
index: s
|
|
53
65
|
}));
|
|
66
|
+
}
|
|
54
67
|
const e = [];
|
|
55
68
|
let t = 0;
|
|
56
|
-
const n = (a,
|
|
57
|
-
a.
|
|
58
|
-
|
|
69
|
+
const n = (a, l, s, h) => {
|
|
70
|
+
const u = a.length - 1;
|
|
71
|
+
for (let r = 0; r < a.length; r++) {
|
|
72
|
+
const x = a[r], y = f(x, c.value), _ = r === u;
|
|
59
73
|
if (e.push({
|
|
60
|
-
row:
|
|
61
|
-
id:
|
|
62
|
-
depth:
|
|
63
|
-
parentId:
|
|
64
|
-
isLastSibling:
|
|
65
|
-
ancestorLastFlags:
|
|
74
|
+
row: x,
|
|
75
|
+
id: y,
|
|
76
|
+
depth: l,
|
|
77
|
+
parentId: s,
|
|
78
|
+
isLastSibling: _,
|
|
79
|
+
ancestorLastFlags: h,
|
|
66
80
|
index: t++
|
|
67
|
-
}),
|
|
68
|
-
const
|
|
69
|
-
|
|
81
|
+
}), o.value.has(y)) {
|
|
82
|
+
const w = p(x);
|
|
83
|
+
w.length > 0 && n(
|
|
84
|
+
w,
|
|
85
|
+
l + 1,
|
|
86
|
+
y,
|
|
87
|
+
P(h, _)
|
|
88
|
+
);
|
|
70
89
|
}
|
|
71
|
-
});
|
|
72
|
-
};
|
|
73
|
-
return n(o.value || [], 0, null, []), e;
|
|
74
|
-
}), M = E(() => {
|
|
75
|
-
const e = /* @__PURE__ */ new Map(), t = (n) => {
|
|
76
|
-
for (const a of n) {
|
|
77
|
-
const s = f(a, l.value);
|
|
78
|
-
e.set(s, a);
|
|
79
|
-
for (const d of h(a))
|
|
80
|
-
t([d]);
|
|
81
90
|
}
|
|
82
91
|
};
|
|
83
|
-
return
|
|
92
|
+
return n(d.value || [], 0, null, D), e;
|
|
84
93
|
});
|
|
85
94
|
return {
|
|
86
|
-
isTreeMode:
|
|
87
|
-
expandedKeys:
|
|
95
|
+
isTreeMode: b,
|
|
96
|
+
expandedKeys: o,
|
|
88
97
|
loadingKeys: v,
|
|
89
|
-
childrenCache:
|
|
90
|
-
flattenVisibleRows:
|
|
91
|
-
allLoadedRows:
|
|
92
|
-
|
|
93
|
-
|
|
98
|
+
childrenCache: i,
|
|
99
|
+
flattenVisibleRows: B,
|
|
100
|
+
allLoadedRows: m,
|
|
101
|
+
findParentId: Y,
|
|
102
|
+
getChildren: p,
|
|
103
|
+
isExpandable: C,
|
|
94
104
|
isExpanded: K,
|
|
95
|
-
isLoading:
|
|
96
|
-
collectDescendantIds:
|
|
105
|
+
isLoading: N,
|
|
106
|
+
collectDescendantIds: I,
|
|
97
107
|
toggleExpand: async (e, t) => {
|
|
98
|
-
if (!
|
|
99
|
-
const n = f(e,
|
|
100
|
-
if (
|
|
101
|
-
const
|
|
102
|
-
|
|
103
|
-
for (const
|
|
104
|
-
|
|
105
|
-
|
|
108
|
+
if (!C(e)) return;
|
|
109
|
+
const n = f(e, c.value);
|
|
110
|
+
if (o.value.has(n)) {
|
|
111
|
+
const u = new Set(o.value);
|
|
112
|
+
u.delete(n);
|
|
113
|
+
for (const r of I(e))
|
|
114
|
+
u.delete(r);
|
|
115
|
+
o.value = u, T({ row: e, expanded: !1, children: p(e), depth: t });
|
|
106
116
|
return;
|
|
107
117
|
}
|
|
108
|
-
const
|
|
109
|
-
|
|
110
|
-
let
|
|
111
|
-
if (!!
|
|
112
|
-
const
|
|
113
|
-
|
|
118
|
+
const l = new Set(o.value);
|
|
119
|
+
l.add(n), o.value = l;
|
|
120
|
+
let s = p(e);
|
|
121
|
+
if (!!S?.value && s.length === 0 && A(e) && !i.value.has(n) && S?.value) {
|
|
122
|
+
const u = new Set(v.value);
|
|
123
|
+
u.add(n), v.value = u;
|
|
114
124
|
try {
|
|
115
|
-
|
|
116
|
-
const
|
|
117
|
-
|
|
125
|
+
s = await S.value(e) || [];
|
|
126
|
+
const r = new Map(i.value);
|
|
127
|
+
r.set(n, s), i.value = r;
|
|
118
128
|
} finally {
|
|
119
|
-
const
|
|
120
|
-
|
|
129
|
+
const r = new Set(v.value);
|
|
130
|
+
r.delete(n), v.value = r;
|
|
121
131
|
}
|
|
122
132
|
}
|
|
123
|
-
|
|
133
|
+
T({ row: e, expanded: !0, children: s, depth: t });
|
|
124
134
|
},
|
|
125
135
|
pruneStaleTreeState: () => {
|
|
126
|
-
const e = new Set(
|
|
127
|
-
|
|
136
|
+
const e = new Set(m.value.keys());
|
|
137
|
+
o.value = new Set([...o.value].filter((n) => e.has(n))), v.value = new Set([...v.value].filter((n) => e.has(n)));
|
|
128
138
|
const t = /* @__PURE__ */ new Map();
|
|
129
|
-
|
|
139
|
+
i.value.forEach((n, a) => {
|
|
130
140
|
e.has(a) && t.set(a, n);
|
|
131
|
-
}),
|
|
141
|
+
}), i.value = t;
|
|
132
142
|
}
|
|
133
143
|
};
|
|
134
144
|
}
|
|
135
145
|
export {
|
|
136
|
-
|
|
146
|
+
q as useDataTableTree
|
|
137
147
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./FileTree.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import r from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const m = /* @__PURE__ */ r(o, [["__scopeId", "data-v-
|
|
4
|
+
const m = /* @__PURE__ */ r(o, [["__scopeId", "data-v-fb5185c6"]]);
|
|
5
5
|
export {
|
|
6
6
|
m as default
|
|
7
7
|
};
|