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.
Files changed (48) hide show
  1. package/components/Badge.vue.js +5 -5
  2. package/components/Badge.vue3.js +5 -0
  3. package/components/CategoryManager/CategoryManager.vue2.js +5 -4
  4. package/components/Chip/Chip.vue.js +21 -21
  5. package/components/Chip/Chip.vue3.js +5 -0
  6. package/components/ColorPicker/ColorIro.vue3.js +2 -2
  7. package/components/ColorPicker/ColorPicker.vue.js +2 -2
  8. package/components/CommandPalette/CommandPaletteContent.vue2.js +1 -1
  9. package/components/CommandPalette/{CommandPaletteItem.vue2.js → CommandPaletteItem.vue.js} +1 -1
  10. package/components/Comment/CommentItem.vue2.js +3 -2
  11. package/components/DataTable/DataTable.vue.d.ts +1 -0
  12. package/components/DataTable/DataTable.vue.js +204 -203
  13. package/components/DataTable/DataTableRow.vue.js +54 -51
  14. package/components/DataTable/types.d.ts +5 -0
  15. package/components/DataTable/useDataTableTree.d.ts +4 -3
  16. package/components/DataTable/useDataTableTree.js +102 -92
  17. package/components/FileTree/FileTree.vue.d.ts +3 -1
  18. package/components/FileTree/FileTree.vue.js +1 -1
  19. package/components/FileTree/FileTree.vue2.js +157 -116
  20. package/components/FileTree/FileTreeNode.vue.d.ts +9 -5
  21. package/components/FileTree/FileTreeNode.vue.js +147 -189
  22. package/components/Form/{AccordionView.vue2.js → AccordionView.vue.js} +1 -1
  23. package/components/Form/Form.vue2.js +45 -43
  24. package/components/Form/index.vue2.js +1 -1
  25. package/components/ImportData/ImportData.vue.js +4 -2
  26. package/components/Invoice/InvoiceVariant1.vue.js +3 -2
  27. package/components/Invoice/InvoiceVariant2.vue.js +3 -2
  28. package/components/Invoice/InvoiceVariant3.vue.js +3 -2
  29. package/components/Invoice/InvoiceVariant4.vue.js +3 -2
  30. package/components/MultiSelect/MultiSelect.vue.js +3 -2
  31. package/components/NavbarCommandPalette.vue.js +1 -1
  32. package/components/PricingPlan/PricingPlanItem.vue.js +10 -9
  33. package/components/Screen/ScreenFilter.vue.js +20 -19
  34. package/components/StatusChip/StatusChip.vue.js +8 -7
  35. package/components/StatusChip/StatusChip.vue3.js +5 -0
  36. package/components/Timeline/TimelineItem.vue.js +3 -2
  37. package/components/TreeConnectors/TreeConnectors.vue.d.ts +1 -1
  38. package/components/TreeConnectors/TreeConnectors.vue.js +26 -17
  39. package/components/TreeConnectors/geometry.d.ts +29 -3
  40. package/components/TreeConnectors/geometry.js +128 -46
  41. package/components/TreeConnectors/index.d.ts +1 -1
  42. package/index.js +473 -470
  43. package/package.json +1 -1
  44. package/style.css +15 -1
  45. package/components/Badge.vue2.js +0 -4
  46. package/components/Chip/Chip.vue2.js +0 -4
  47. package/components/StatusChip/StatusChip.vue2.js +0 -4
  48. /package/components/ColorPicker/{ColorIro.vue2.js → ColorIro.vue.js} +0 -0
@@ -1,11 +1,11 @@
1
- import { defineComponent as V, computed as f, openBlock as o, createElementBlock as d, normalizeClass as g, withModifiers as A, createElementVNode as b, createVNode as v, createCommentVNode as x, Fragment as p, renderList as D, normalizeStyle as w, unref as y, createBlock as c, renderSlot as I } from "vue";
2
- import U from "../CheckBox.vue.js";
3
- import k from "../Icon.vue.js";
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 R from "../TreeConnectors/TreeConnectors.vue.js";
7
- import { DEFAULT_TOGGLE_SIZE as O, DEFAULT_TREE_CONTENT_GAP as h, DEFAULT_TREE_LEADING as H } from "../TreeConnectors/geometry.js";
8
- const j = ["data-state"], Z = { class: "flex items-center justify-center" }, q = ["aria-expanded"], J = ["title", "innerHTML"], ne = /* @__PURE__ */ V({
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, u = C, a = (n, l) => {
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), B = (n, l, t) => {
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 = L(l);
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
- }, L = (n) => {
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
- }, E = (n) => ({
65
+ }, T = (n) => ({
66
66
  left: "text-left",
67
67
  center: "text-center",
68
68
  right: "text-right"
69
- })[n.align || "left"], M = f(() => a(s.row, s.keyField)), T = () => {
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 = H, z = f(
72
+ }, m = j, z = g(
73
73
  () => s.treeMode ? m + s.depth * s.treeIndent : 0
74
- ), $ = f(
75
- () => m + s.depth * s.treeIndent + O + h
76
- ), F = () => {
77
- u("rowClick", { row: s.row, index: s.index });
78
- }, N = () => {
79
- u("select", M.value);
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(), u("toggleExpand");
82
+ n.stopPropagation(), f("toggleExpand");
82
83
  };
83
84
  return (n, l) => (o(), d("tr", {
84
- class: g(["border-b data-[state=selected]:bg-muted h-full", [
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: F
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] = A(() => {
97
+ onClick: l[0] || (l[0] = I(() => {
97
98
  }, ["stop"]))
98
99
  }, [
99
- b("div", Z, [
100
- v(U, {
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": N
105
+ "onUpdate:modelValue": A
105
106
  }, null, 8, ["model-value", "indeterminate"])
106
107
  ])
107
- ])) : x("", !0),
108
- (o(!0), d(p, null, D(e.headers, (t, i) => (o(), d("td", {
108
+ ])) : w("", !0),
109
+ (o(!0), d(p, null, U(e.headers, (t, i) => (o(), d("td", {
109
110
  key: t.field,
110
- class: g(["align-middle whitespace-normal wrap-break-word", [
111
- T(),
112
- E(t),
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
- B(t, a(e.row, t.field), e.row)
122
+ L(t, a(e.row, t.field), e.row)
122
123
  ]]),
123
- style: w(
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(y(R), {
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": y(m),
138
- "content-gap": y(h),
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: w({ left: z.value + "px" }),
148
+ style: y({ left: z.value + "px" }),
146
149
  "aria-expanded": e.expanded,
147
150
  onClick: W
148
151
  }, [
149
- e.treeLoading ? (o(), c(k, {
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(), c(k, {
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, q)) : x("", !0)
159
- ], 64)) : x("", !0),
161
+ ], 12, J)) : w("", !0)
162
+ ], 64)) : w("", !0),
160
163
  b("div", {
161
- class: g([
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: w(e.treeMode && i === 0 ? { paddingLeft: $.value + "px" } : void 0)
168
+ style: y(e.treeMode && i === 0 ? { paddingLeft: N.value + "px" } : void 0)
166
169
  }, [
167
- I(n.$slots, t.field, {
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(), c(G, {
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(), c(P, {
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, J))
191
+ }, null, 8, K))
189
192
  ])
190
193
  ], 6)
191
194
  ], 6))), 128))
192
- ], 10, j));
195
+ ], 10, Z));
193
196
  }
194
197
  });
195
198
  export {
196
- ne as default
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: Ref<Set<any> & Omit<Set<any>, keyof Set<any>>, Set<any> | (Set<any> & Omit<Set<any>, keyof Set<any>>)>;
13
- loadingKeys: Ref<Set<any> & Omit<Set<any>, keyof Set<any>>, Set<any> | (Set<any> & Omit<Set<any>, keyof Set<any>>)>;
14
- childrenCache: Ref<Map<any, any[]> & Omit<Map<any, any[]>, keyof Map<any, any>>, Map<any, any[]> | (Map<any, any[]> & Omit<Map<any, any[]>, keyof Map<any, any>>)>;
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 { ref as x, computed as E } from "vue";
2
- const y = "children", Y = "hasChildren";
3
- function H(o) {
4
- const l = o?.[y];
5
- return Array.isArray(l) && l.length > 0;
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 L(o) {
8
- return o?.[Y] === !0;
8
+ function A(d) {
9
+ return d?.[G] === !0;
9
10
  }
10
- function k({
11
- rows: o,
12
- keyField: l,
13
- loadChildren: p,
11
+ function q({
12
+ rows: d,
13
+ keyField: c,
14
+ loadChildren: S,
14
15
  getRowId: f,
15
- onExpand: A
16
+ onExpand: T
16
17
  }) {
17
- const u = x(/* @__PURE__ */ new Set()), v = x(/* @__PURE__ */ new Set()), r = x(/* @__PURE__ */ new Map()), C = E(() => {
18
- if (p?.value) return !0;
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) || L(n)) return !0;
22
- const a = n?.[y];
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(o.value || []);
28
- }), h = (e) => {
29
- const t = f(e, l.value);
30
- if (r.value.has(t))
31
- return r.value.get(t) || [];
32
- const n = e?.[y];
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
- }, b = (e) => {
35
- const t = f(e, l.value);
36
- return r.value.has(t) ? (r.value.get(t) || []).length > 0 : H(e) ? !0 : L(e);
37
- }, K = (e) => u.value.has(e), _ = (e) => v.value.has(e), m = (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 s of h(a))
40
- t.push(f(s, l.value)), n(s);
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
- }, N = E(() => {
44
- if (!C.value)
45
- return (o.value || []).map((a, s) => ({
46
- row: a,
47
- id: f(a, l.value),
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 === (o.value || []).length - 1,
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, s, d, S) => {
57
- a.forEach((c, i) => {
58
- const g = f(c, l.value), T = i === a.length - 1;
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: c,
61
- id: g,
62
- depth: s,
63
- parentId: d,
64
- isLastSibling: T,
65
- ancestorLastFlags: [...S],
74
+ row: x,
75
+ id: y,
76
+ depth: l,
77
+ parentId: s,
78
+ isLastSibling: _,
79
+ ancestorLastFlags: h,
66
80
  index: t++
67
- }), u.value.has(g)) {
68
- const D = h(c);
69
- D.length > 0 && n(D, s + 1, g, [...S, T]);
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 t(o.value || []), e;
92
+ return n(d.value || [], 0, null, D), e;
84
93
  });
85
94
  return {
86
- isTreeMode: C,
87
- expandedKeys: u,
95
+ isTreeMode: b,
96
+ expandedKeys: o,
88
97
  loadingKeys: v,
89
- childrenCache: r,
90
- flattenVisibleRows: N,
91
- allLoadedRows: M,
92
- getChildren: h,
93
- isExpandable: b,
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: m,
105
+ isLoading: N,
106
+ collectDescendantIds: I,
97
107
  toggleExpand: async (e, t) => {
98
- if (!b(e)) return;
99
- const n = f(e, l.value);
100
- if (u.value.has(n)) {
101
- const c = new Set(u.value);
102
- c.delete(n);
103
- for (const i of m(e))
104
- c.delete(i);
105
- u.value = c, A({ row: e, expanded: !1, children: h(e), depth: t });
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 s = new Set(u.value);
109
- s.add(n), u.value = s;
110
- let d = h(e);
111
- if (!!p?.value && d.length === 0 && L(e) && !r.value.has(n) && p?.value) {
112
- const c = new Set(v.value);
113
- c.add(n), v.value = c;
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
- d = await p.value(e) || [];
116
- const i = new Map(r.value);
117
- i.set(n, d), r.value = i;
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 i = new Set(v.value);
120
- i.delete(n), v.value = i;
129
+ const r = new Set(v.value);
130
+ r.delete(n), v.value = r;
121
131
  }
122
132
  }
123
- A({ row: e, expanded: !0, children: d, depth: t });
133
+ T({ row: e, expanded: !0, children: s, depth: t });
124
134
  },
125
135
  pruneStaleTreeState: () => {
126
- const e = new Set(M.value.keys());
127
- u.value = new Set([...u.value].filter((n) => e.has(n))), v.value = new Set([...v.value].filter((n) => e.has(n)));
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
- r.value.forEach((n, a) => {
139
+ i.value.forEach((n, a) => {
130
140
  e.has(a) && t.set(a, n);
131
- }), r.value = t;
141
+ }), i.value = t;
132
142
  }
133
143
  };
134
144
  }
135
145
  export {
136
- k as useDataTableTree
146
+ q as useDataTableTree
137
147
  };
@@ -2,7 +2,9 @@ import { FileNode, FileTreeProps } from './types';
2
2
  declare function __VLS_template(): {
3
3
  attrs: Partial<{}>;
4
4
  slots: {
5
- actions?(_: any): any;
5
+ actions?(_: {
6
+ node: FileNode;
7
+ }): any;
6
8
  };
7
9
  refs: {};
8
10
  rootEl: HTMLDivElement;
@@ -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-773b0a78"]]);
4
+ const m = /* @__PURE__ */ r(o, [["__scopeId", "data-v-fb5185c6"]]);
5
5
  export {
6
6
  m as default
7
7
  };