vlite3 1.5.25 → 1.5.28

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 (99) hide show
  1. package/components/Accordion/Accordion.vue.d.ts +8 -1
  2. package/components/Accordion/AccordionContent.vue.d.ts +8 -2
  3. package/components/Accordion/AccordionContent.vue.js +2 -2
  4. package/components/Accordion/AccordionContent2.vue.js +28 -40
  5. package/components/Accordion/AccordionItem.vue.d.ts +8 -1
  6. package/components/Accordion/AccordionItem.vue.js +86 -70
  7. package/components/Accordion/AccordionTrigger.vue.js +13 -12
  8. package/components/Badge.vue.d.ts +1 -1
  9. package/components/Beacon.vue.d.ts +1 -1
  10. package/components/Breadcrumb/Breadcrumb.vue.d.ts +1 -1
  11. package/components/Breadcrumb/BreadcrumbItem.vue.d.ts +1 -1
  12. package/components/Button.vue.d.ts +1 -1
  13. package/components/Button.vue.js +2 -2
  14. package/components/Button2.vue.js +1 -1
  15. package/components/Carousel/Carousel.vue.d.ts +4 -4
  16. package/components/CategoryManager/CategoryManager2.vue.js +1 -1
  17. package/components/Chart/CircleChart.vue.d.ts +1 -1
  18. package/components/Chart/GaugeChart.vue.d.ts +1 -1
  19. package/components/Chart/SpeedometerChart.vue.d.ts +1 -1
  20. package/components/Chip/Chip.vue.d.ts +1 -1
  21. package/components/ChoiceBox/ChoiceBox.vue.d.ts +1 -1
  22. package/components/Clipboard.vue.d.ts +1 -1
  23. package/components/ColorPicker/ColorPicker.vue.d.ts +1 -1
  24. package/components/CommandPalette/CommandPaletteContent2.vue.js +1 -1
  25. package/components/CommandPalette/{CommandPaletteItem2.vue.js → CommandPaletteItem.vue.js} +1 -1
  26. package/components/DataList/DataList.vue.d.ts +1 -1
  27. package/components/DataTable/DataTable.vue.d.ts +1 -1
  28. package/components/DataTable/DataTable.vue.js +2 -2
  29. package/components/DataTable/DataTable2.vue.js +48 -50
  30. package/components/EditableTitle/EditableTitle.vue.d.ts +11 -11
  31. package/components/Empty/Empty.vue.d.ts +11 -2
  32. package/components/Empty/Empty.vue.js +57 -49
  33. package/components/Empty/index.d.ts +1 -1
  34. package/components/Empty/types.d.ts +13 -0
  35. package/components/Empty/types.js +8 -0
  36. package/components/Empty/variants/Variant1.vue.d.ts +4 -6
  37. package/components/Empty/variants/Variant1.vue.js +56 -20
  38. package/components/Empty/variants/Variant10.vue.d.ts +4 -6
  39. package/components/Empty/variants/Variant10.vue.js +68 -26
  40. package/components/Empty/variants/Variant11.vue.d.ts +4 -6
  41. package/components/Empty/variants/Variant11.vue.js +66 -18
  42. package/components/Empty/variants/Variant12.vue.d.ts +4 -6
  43. package/components/Empty/variants/Variant12.vue.js +67 -25
  44. package/components/Empty/variants/Variant2.vue.d.ts +4 -6
  45. package/components/Empty/variants/Variant2.vue.js +56 -20
  46. package/components/Empty/variants/Variant3.vue.d.ts +4 -6
  47. package/components/Empty/variants/Variant3.vue.js +41 -13
  48. package/components/Empty/variants/Variant4.vue.d.ts +4 -6
  49. package/components/Empty/variants/Variant4.vue.js +65 -21
  50. package/components/Empty/variants/Variant5.vue.d.ts +4 -6
  51. package/components/Empty/variants/Variant5.vue.js +55 -17
  52. package/components/Empty/variants/Variant6.vue.d.ts +4 -6
  53. package/components/Empty/variants/Variant6.vue.js +67 -23
  54. package/components/Empty/variants/Variant7.vue.d.ts +4 -6
  55. package/components/Empty/variants/Variant7.vue.js +81 -25
  56. package/components/Empty/variants/Variant8.vue.d.ts +4 -6
  57. package/components/Empty/variants/Variant8.vue.js +59 -23
  58. package/components/Empty/variants/Variant9.vue.d.ts +4 -6
  59. package/components/Empty/variants/Variant9.vue.js +64 -20
  60. package/components/FilePicker/index.vue.d.ts +1 -1
  61. package/components/FileTree/FileTree.vue.d.ts +2 -0
  62. package/components/FileTree/FileTree.vue.js +4 -4
  63. package/components/FileTree/FileTree2.vue.js +72 -66
  64. package/components/FileTree/FileTreeNode.vue.d.ts +9 -0
  65. package/components/FileTree/FileTreeNode.vue.js +100 -92
  66. package/components/FileTree/types.d.ts +12 -0
  67. package/components/Form/{AccordionView.vue.js → AccordionView2.vue.js} +1 -1
  68. package/components/Form/Form.vue.d.ts +1 -1
  69. package/components/Form/FormField.vue.d.ts +1 -1
  70. package/components/Form/FormFields.vue.d.ts +1 -1
  71. package/components/Form/TableView.vue.d.ts +1 -1
  72. package/components/Form/index.vue.d.ts +1 -1
  73. package/components/Form/index2.vue.js +1 -1
  74. package/components/GoogleLogin.vue.d.ts +1 -1
  75. package/components/Input.vue.d.ts +1 -1
  76. package/components/Input.vue.js +2 -4
  77. package/components/MultiSelect/MultiSelect.vue.d.ts +1 -1
  78. package/components/Navbar/NavbarTabs.vue.d.ts +1 -1
  79. package/components/NavbarCommandPalette.vue.js +1 -1
  80. package/components/NumberInput.vue.d.ts +1 -1
  81. package/components/OTPInput/OTPInput.vue.d.ts +1 -1
  82. package/components/ProgressBar/ProgressBar.vue.d.ts +1 -1
  83. package/components/Screen/ScreenFilter.vue.js +1 -1
  84. package/components/Screen/components/ScreenEmptyState.vue.js +12 -12
  85. package/components/Slider.vue.d.ts +1 -1
  86. package/components/Spinner/Spinner.vue.d.ts +1 -1
  87. package/components/Splitter/Splitter.vue.d.ts +9 -16
  88. package/components/Splitter/Splitter.vue.js +72 -41
  89. package/components/Switch.vue.d.ts +1 -1
  90. package/components/Tabes/Tabes.vue.d.ts +1 -1
  91. package/components/TagInput/TagInput.vue.d.ts +6 -6
  92. package/components/Tooltip.vue.d.ts +1 -1
  93. package/core/config.d.ts +2 -2
  94. package/docs/components/accordion.md +35 -0
  95. package/docs/components/empty.md +38 -4
  96. package/docs/components/file-tree.md +67 -16
  97. package/docs-manifest.json +5 -5
  98. package/package.json +1 -1
  99. package/style.css +1 -1
@@ -1,11 +1,11 @@
1
- import { defineComponent as q, shallowRef as x, watch as F, computed as g, openBlock as m, createElementBlock as v, normalizeClass as z, Fragment as I, renderList as R, withMemo as N, normalizeStyle as G, createBlock as O, createSlots as U, withCtx as Y, renderSlot as j, mergeProps as H, toDisplayString as J } from "vue";
1
+ import { defineComponent as $, shallowRef as x, watch as F, computed as p, openBlock as m, createElementBlock as w, normalizeClass as q, Fragment as I, renderList as O, withMemo as N, normalizeStyle as z, createBlock as G, createSlots as U, withCtx as Y, renderSlot as j, mergeProps as H, toDisplayString as J } from "vue";
2
2
  import W from "./FileTreeNode.vue.js";
3
- import { appendAncestorLastFlag as D, EMPTY_ANCESTOR_LAST_FLAGS as X } from "../TreeConnectors/geometry.js";
3
+ import { appendAncestorLastFlag as B, EMPTY_ANCESTOR_LAST_FLAGS as X } from "../TreeConnectors/geometry.js";
4
4
  import { $t as k } from "../../utils/i18n.js";
5
5
  const Z = {
6
6
  key: 1,
7
7
  class: "text-sm text-muted-foreground p-4 text-center"
8
- }, ne = /* @__PURE__ */ q({
8
+ }, ne = /* @__PURE__ */ $({
9
9
  __name: "FileTree",
10
10
  props: {
11
11
  modelValue: { default: () => [] },
@@ -20,16 +20,18 @@ const Z = {
20
20
  emptyText: {},
21
21
  emptyTextI18n: {},
22
22
  variant: { default: "default" },
23
- maxLabelLength: { default: 35 }
23
+ maxLabelLength: { default: 35 },
24
+ showTreeLines: { type: Boolean, default: !0 },
25
+ selectOnRowClick: { type: Boolean, default: !0 }
24
26
  },
25
27
  emits: ["update:modelValue", "select", "expand", "node-click"],
26
- setup(o, { emit: K }) {
27
- const s = o, p = K, h = x(new Set(s.defaultExpandedKeys)), f = x(/* @__PURE__ */ new Set()), y = x(/* @__PURE__ */ new Map()), L = x(/* @__PURE__ */ new Map()), P = (t) => !!(t.isFolder || t.children && t.children.length > 0), E = (t) => {
28
+ setup(r, { emit: D }) {
29
+ const s = r, g = D, h = x(new Set(s.defaultExpandedKeys)), f = x(/* @__PURE__ */ new Set()), v = x(/* @__PURE__ */ new Map()), b = x(/* @__PURE__ */ new Map()), K = (t) => !!(t.isFolder || t.children && t.children.length > 0), E = (t) => {
28
30
  const l = /* @__PURE__ */ new Map(), e = /* @__PURE__ */ new Map(), a = (n, d) => {
29
31
  for (const i of n)
30
32
  l.set(i.id, i), d && e.set(i.id, d), i.children && a(i.children, i.id);
31
33
  };
32
- a(t), y.value = l, L.value = e;
34
+ a(t), v.value = l, b.value = e;
33
35
  };
34
36
  F(
35
37
  () => s.data,
@@ -47,31 +49,31 @@ const Z = {
47
49
  e.push(a.children[n]);
48
50
  }
49
51
  return l;
50
- }, w = g(() => new Set(s.modelValue)), T = g(() => {
52
+ }, y = p(() => new Set(s.modelValue)), T = p(() => {
51
53
  const t = /* @__PURE__ */ new Set();
52
54
  if (s.selectionMode !== "multiple") return t;
53
55
  const l = (e) => {
54
56
  if (!e.children || e.children.length === 0)
55
- return w.value.has(e.id) ? "checked" : "unchecked";
57
+ return y.value.has(e.id) ? "checked" : "unchecked";
56
58
  let a = !1, n = !1, d = !1;
57
59
  for (const i of e.children) {
58
- const r = l(i);
59
- r === "checked" ? a = !0 : r === "unchecked" ? n = !0 : d = !0;
60
+ const c = l(i);
61
+ c === "checked" ? a = !0 : c === "unchecked" ? n = !0 : d = !0;
60
62
  }
61
63
  return d || a && n ? (t.add(e.id), "indeterminate") : a ? "checked" : "unchecked";
62
64
  };
63
65
  return s.data.forEach(l), t;
64
- }), A = async (t) => {
66
+ }), P = async (t) => {
65
67
  if (t.disabled) return;
66
68
  if (h.value.has(t.id)) {
67
69
  const a = new Set(h.value);
68
70
  a.delete(t.id);
69
- const n = y.value.get(t.id) || t;
70
- M(n).forEach((d) => a.delete(d)), h.value = a, p("expand", t, !1);
71
+ const n = v.value.get(t.id) || t;
72
+ M(n).forEach((d) => a.delete(d)), h.value = a, g("expand", t, !1);
71
73
  return;
72
74
  }
73
75
  const e = new Set(h.value);
74
- if (e.add(t.id), h.value = e, p("expand", t, !0), s.loadData && !t.isLoaded && (!t.children || t.children.length === 0)) {
76
+ if (e.add(t.id), h.value = e, g("expand", t, !0), s.loadData && !t.isLoaded && (!t.children || t.children.length === 0)) {
75
77
  const a = new Set(f.value);
76
78
  a.add(t.id), f.value = a;
77
79
  try {
@@ -81,52 +83,52 @@ const Z = {
81
83
  n.delete(t.id), f.value = n;
82
84
  }
83
85
  }
84
- }, B = (t) => {
86
+ }, A = (t) => {
85
87
  if (t.disabled) return;
86
- const l = y.value.get(t.id) || t, e = new Set(w.value), a = e.has(t.id);
88
+ const l = v.value.get(t.id) || t, e = new Set(y.value), a = e.has(t.id);
87
89
  if (s.selectionMode === "single")
88
90
  e.clear(), a || e.add(t.id);
89
91
  else if (s.selectionMode === "multiple") {
90
- const n = M(l), d = !a, i = (c, u) => {
91
- u ? e.add(c) : e.delete(c);
92
+ const n = M(l), d = !a, i = (o, u) => {
93
+ u ? e.add(o) : e.delete(o);
92
94
  };
93
- i(t.id, d), n.forEach((c) => i(c, d));
94
- let r = l;
95
+ i(t.id, d), n.forEach((o) => i(o, d));
96
+ let c = l;
95
97
  for (; ; ) {
96
- const c = L.value.get(r.id);
97
- if (!c) break;
98
- const u = y.value.get(c);
98
+ const o = b.value.get(c.id);
99
+ if (!o) break;
100
+ const u = v.value.get(o);
99
101
  if (!u?.children) break;
100
- u.children.every((S) => e.has(S.id)) ? e.add(u.id) : e.delete(u.id), r = u;
102
+ u.children.every((L) => e.has(L.id)) ? e.add(u.id) : e.delete(u.id), c = u;
101
103
  }
102
104
  }
103
- p("update:modelValue", Array.from(e)), p("select", l, !a);
104
- }, Q = g(() => {
105
+ g("update:modelValue", Array.from(e)), g("select", l, !a);
106
+ }, Q = p(() => {
105
107
  if (!s.searchQuery) return s.data;
106
108
  const t = s.searchQuery.toLowerCase(), l = (e) => {
107
109
  const n = (e.labelI18n ? k(e.labelI18n) : e.label).toLowerCase().includes(t), d = !!e.searchMatch;
108
110
  let i = [];
109
- return e.children && (i = e.children.map(l).filter((r) => r !== null)), n || d || i.length > 0 ? { ...e, children: i } : null;
111
+ return e.children && (i = e.children.map(l).filter((c) => c !== null)), n || d || i.length > 0 ? { ...e, children: i } : null;
110
112
  };
111
113
  return s.data.map(l).filter((e) => e !== null);
112
- }), C = g(() => {
114
+ }), C = p(() => {
113
115
  const t = [], l = (e, a, n) => {
114
116
  const d = e.length - 1;
115
117
  for (let i = 0; i < e.length; i++) {
116
- const r = e[i], c = i === d, u = P(r), S = h.value.has(r.id), $ = f.value.has(r.id);
118
+ const c = e[i], o = i === d, u = K(c), L = h.value.has(c.id), V = f.value.has(c.id);
117
119
  if (t.push({
118
- node: r,
120
+ node: c,
119
121
  depth: a,
120
- isLast: c,
122
+ isLast: o,
121
123
  ancestorLastFlags: n,
122
124
  isFolder: u
123
- }), S && u && !$) {
124
- const b = r.children;
125
- b && b.length > 0 ? l(b, a + 1, D(n, c)) : t.push({
126
- node: r,
125
+ }), L && u && !V) {
126
+ const S = c.children;
127
+ S && S.length > 0 ? l(S, a + 1, B(n, o)) : t.push({
128
+ node: c,
127
129
  depth: a + 1,
128
130
  isLast: !0,
129
- ancestorLastFlags: D(n, c),
131
+ ancestorLastFlags: B(n, o),
130
132
  isFolder: !1,
131
133
  showEmptyPlaceholder: !0
132
134
  });
@@ -142,10 +144,10 @@ const Z = {
142
144
  const l = t.toLowerCase(), e = /* @__PURE__ */ new Set(), a = (n) => {
143
145
  let d = !1;
144
146
  if (n.children)
145
- for (const c of n.children)
146
- a(c) && (d = !0);
147
- const r = (n.labelI18n ? k(n.labelI18n) : n.label).toLowerCase().includes(l) || !!n.searchMatch;
148
- return d && e.add(n.id), r || d;
147
+ for (const o of n.children)
148
+ a(o) && (d = !0);
149
+ const c = (n.labelI18n ? k(n.labelI18n) : n.label).toLowerCase().includes(l) || !!n.searchMatch;
150
+ return d && e.add(n.id), c || d;
149
151
  };
150
152
  if (s.data.forEach(a), e.size > 0) {
151
153
  const n = new Set(h.value);
@@ -153,56 +155,60 @@ const Z = {
153
155
  }
154
156
  }
155
157
  );
156
- const V = g(() => {
158
+ const R = p(() => {
157
159
  if (s.emptyTextI18n) return k(s.emptyTextI18n);
158
160
  if (s.emptyText) return s.emptyText;
159
161
  const t = k("vlite.fileTree.emptyText");
160
162
  return t !== "vlite.fileTree.emptyText" ? t : "No results found.";
161
163
  });
162
- return (t, l) => (m(), v("div", {
163
- class: z(["w-full h-full overflow-y-auto file-tree-container", s.class])
164
+ return (t, l) => (m(), w("div", {
165
+ class: q(["w-full h-full overflow-y-auto file-tree-container", s.class])
164
166
  }, [
165
- C.value.length > 0 ? (m(!0), v(I, { key: 0 }, R(C.value, (e) => (m(), v(I, {
167
+ C.value.length > 0 ? (m(!0), w(I, { key: 0 }, O(C.value, (e) => (m(), w(I, {
166
168
  key: e.showEmptyPlaceholder ? e.node.id + "-empty" : e.node.id
167
169
  }, [
168
- e.showEmptyPlaceholder ? N([e.depth, e.node.id], () => (m(), v("div", {
170
+ e.showEmptyPlaceholder ? N([e.depth, e.node.id], () => (m(), w("div", {
169
171
  key: 0,
170
172
  class: "py-0.5 text-xs text-muted-foreground italic",
171
- style: G({ paddingInlineStart: e.depth * 20 + 26 + "px" })
173
+ style: z({ paddingInlineStart: e.depth * 20 + 26 + "px" })
172
174
  }, null, 4)), l, 0) : N([
173
175
  e.node,
174
- w.value.has(e.node.id),
176
+ y.value.has(e.node.id),
175
177
  T.value.has(e.node.id),
176
178
  h.value.has(e.node.id),
177
179
  f.value.has(e.node.id),
178
- o.highlightSearch,
179
- o.searchQuery,
180
- o.showCheckboxes,
181
- o.variant,
182
- o.maxLabelLength,
180
+ r.highlightSearch,
181
+ r.searchQuery,
182
+ r.showCheckboxes,
183
+ r.variant,
184
+ r.maxLabelLength,
185
+ r.showTreeLines,
186
+ r.selectOnRowClick,
183
187
  e.depth,
184
188
  e.isLast,
185
189
  e.ancestorLastFlags,
186
190
  !!t.$slots.actions
187
- ], () => (m(), O(W, {
191
+ ], () => (m(), G(W, {
188
192
  key: 1,
189
193
  node: e.node,
190
194
  depth: e.depth,
191
195
  "is-last": e.isLast,
192
196
  "ancestor-last-flags": e.ancestorLastFlags,
193
- "selection-mode": o.selectionMode,
194
- "is-selected": w.value.has(e.node.id),
197
+ "selection-mode": r.selectionMode,
198
+ "is-selected": y.value.has(e.node.id),
195
199
  "is-indeterminate": T.value.has(e.node.id),
196
200
  "is-expanded": h.value.has(e.node.id),
197
201
  "is-loading": f.value.has(e.node.id),
198
- "show-checkboxes": o.showCheckboxes,
199
- "highlight-search": o.highlightSearch,
200
- "search-query": o.searchQuery,
201
- variant: o.variant,
202
- "max-label-length": o.maxLabelLength,
203
- onToggleExpand: A,
204
- onToggleSelect: B,
205
- onClickNode: l[1] || (l[1] = (a) => p("node-click", a))
202
+ "show-checkboxes": r.showCheckboxes,
203
+ "show-tree-lines": r.showTreeLines,
204
+ "select-on-row-click": r.selectOnRowClick,
205
+ "highlight-search": r.highlightSearch,
206
+ "search-query": r.searchQuery,
207
+ variant: r.variant,
208
+ "max-label-length": r.maxLabelLength,
209
+ onToggleExpand: P,
210
+ onToggleSelect: A,
211
+ onClickNode: l[1] || (l[1] = (a) => g("node-click", a))
206
212
  }, U({ _: 2 }, [
207
213
  t.$slots.actions ? {
208
214
  name: "actions",
@@ -211,8 +217,8 @@ const Z = {
211
217
  ]),
212
218
  key: "0"
213
219
  } : void 0
214
- ]), 1032, ["node", "depth", "is-last", "ancestor-last-flags", "selection-mode", "is-selected", "is-indeterminate", "is-expanded", "is-loading", "show-checkboxes", "highlight-search", "search-query", "variant", "max-label-length"])), l, 2)
215
- ], 64))), 128)) : (m(), v("div", Z, J(V.value), 1))
220
+ ]), 1032, ["node", "depth", "is-last", "ancestor-last-flags", "selection-mode", "is-selected", "is-indeterminate", "is-expanded", "is-loading", "show-checkboxes", "show-tree-lines", "select-on-row-click", "highlight-search", "search-query", "variant", "max-label-length"])), l, 2)
221
+ ], 64))), 128)) : (m(), w("div", Z, J(R.value), 1))
216
222
  ], 2));
217
223
  }
218
224
  });
@@ -17,6 +17,13 @@ interface Props {
17
17
  isLast?: boolean;
18
18
  /** `isLast` of every ancestor, ordered root → immediate parent. */
19
19
  ancestorLastFlags?: boolean[];
20
+ /** Whether to render tree connector (indent guide) lines. */
21
+ showTreeLines?: boolean;
22
+ /**
23
+ * When `false`, parent/folder row clicks only expand/collapse.
24
+ * Leaf/file rows remain selectable via the row. Checkboxes always select.
25
+ */
26
+ selectOnRowClick?: boolean;
20
27
  }
21
28
  declare function __VLS_template(): {
22
29
  attrs: Partial<{}>;
@@ -50,6 +57,8 @@ declare const __VLS_component: import('vue').DefineComponent<Props, {}, {}, {},
50
57
  showCheckboxes: boolean;
51
58
  highlightSearch: boolean;
52
59
  maxLabelLength: number;
60
+ showTreeLines: boolean;
61
+ selectOnRowClick: boolean;
53
62
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
54
63
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
55
64
  export default _default;
@@ -1,14 +1,14 @@
1
- import { defineComponent as D, computed as d, openBlock as i, createElementBlock as a, createElementVNode as c, normalizeClass as g, normalizeStyle as b, createCommentVNode as f, createVNode as v, unref as R, withModifiers as y, createBlock as m, Fragment as L, renderList as S, toDisplayString as k, renderSlot as A } from "vue";
2
- import r from "../Icon.vue.js";
3
- import O from "../CheckBox.vue.js";
4
- import Q from "../TreeConnectors/TreeConnectors.vue.js";
5
- import { EMPTY_ANCESTOR_LAST_FLAGS as V } from "../TreeConnectors/geometry.js";
6
- import { $t as j } from "../../utils/i18n.js";
7
- import { useRtl as q } from "../../composables/useRtl.js";
8
- const G = { class: "flex flex-col select-none" }, U = ["title"], Y = ["aria-expanded"], H = {
9
- key: 1,
1
+ import { defineComponent as R, computed as d, openBlock as s, createElementBlock as i, createElementVNode as c, normalizeClass as m, normalizeStyle as v, createCommentVNode as r, createBlock as h, unref as A, withModifiers as x, createVNode as w, Fragment as C, renderList as L, toDisplayString as y, renderSlot as D } from "vue";
2
+ import u from "../Icon.vue.js";
3
+ import G from "../CheckBox.vue.js";
4
+ import H from "../TreeConnectors/TreeConnectors.vue.js";
5
+ import { EMPTY_ANCESTOR_LAST_FLAGS as Q } from "../TreeConnectors/geometry.js";
6
+ import { $t as V } from "../../utils/i18n.js";
7
+ import { useRtl as K } from "../../composables/useRtl.js";
8
+ const W = { class: "flex flex-col select-none" }, X = ["title"], j = ["aria-expanded"], q = {
9
+ key: 2,
10
10
  class: "relative z-20 w-6 me-1 shrink-0"
11
- }, J = { class: "relative z-20 me-2 text-muted-foreground shrink-0" }, K = { class: "relative z-20 flex-1 truncate text-sm font-medium min-w-0" }, W = { class: "me-2 text-gray-400 select-none shrink-0" }, X = { class: "truncate" }, x = 20, ie = /* @__PURE__ */ D({
11
+ }, U = { class: "relative z-20 me-2 text-muted-foreground shrink-0" }, Y = { class: "relative z-20 flex-1 truncate text-sm font-medium min-w-0" }, Z = { class: "me-2 text-gray-400 select-none shrink-0" }, J = { class: "truncate" }, b = 20, _ = 28, ee = 16, te = 11, ce = /* @__PURE__ */ R({
12
12
  name: "FileTreeNode",
13
13
  __name: "FileTreeNode",
14
14
  props: {
@@ -25,164 +25,172 @@ const G = { class: "flex flex-col select-none" }, U = ["title"], Y = ["aria-expa
25
25
  variant: { default: "default" },
26
26
  maxLabelLength: { default: 35 },
27
27
  isLast: { type: Boolean, default: !0 },
28
- ancestorLastFlags: { default: () => V }
28
+ ancestorLastFlags: { default: () => Q },
29
+ showTreeLines: { type: Boolean, default: !0 },
30
+ selectOnRowClick: { type: Boolean, default: !0 }
29
31
  },
30
32
  emits: ["toggle-expand", "toggle-select", "click-node"],
31
- setup(e, { emit: C }) {
32
- const E = q(), s = e, h = C, u = d(
33
- () => !!(s.node.isFolder || s.node.children && s.node.children.length > 0)
34
- ), I = d(() => `${s.depth * x}px`), p = d(
35
- () => s.node.labelI18n ? j(s.node.labelI18n) : s.node.label
33
+ setup(e, { emit: S }) {
34
+ const E = K(), l = e, g = S, f = d(
35
+ () => !!(l.node.isFolder || l.node.children && l.node.children.length > 0)
36
+ ), I = d(() => `${l.depth * b}px`), B = d(() => {
37
+ const t = l.showCheckboxes && l.selectionMode !== "none" ? ee + te : 0;
38
+ return `${l.depth * b + _ + t}px`;
39
+ }), k = d(
40
+ () => l.node.labelI18n ? V(l.node.labelI18n) : l.node.label
36
41
  ), M = d(() => {
37
- const t = p.value, l = s.maxLabelLength;
38
- if (t.length <= l) return t;
42
+ const t = k.value, o = l.maxLabelLength;
43
+ if (t.length <= o) return t;
39
44
  const n = t.lastIndexOf(".");
40
45
  if (n === -1 || t.length - n > 10)
41
- return t.substring(0, l) + "...";
42
- const o = t.substring(n), $ = t.substring(0, n), P = Math.max(0, l - o.length - 3);
43
- return $.substring(0, P) + "..." + o;
44
- }), z = d(() => {
46
+ return t.substring(0, o) + "...";
47
+ const a = t.substring(n), $ = t.substring(0, n), P = Math.max(0, o - a.length - 3);
48
+ return $.substring(0, P) + "..." + a;
49
+ }), T = d(() => {
45
50
  const t = M.value;
46
- if (!s.highlightSearch || !s.searchQuery)
51
+ if (!l.highlightSearch || !l.searchQuery)
47
52
  return [{ text: t, highlight: !1 }];
48
- const l = s.searchQuery.toLowerCase(), n = t.toLowerCase().indexOf(l);
53
+ const o = l.searchQuery.toLowerCase(), n = t.toLowerCase().indexOf(o);
49
54
  return n === -1 ? [{ text: t, highlight: !1 }] : [
50
55
  { text: t.slice(0, n), highlight: !1 },
51
56
  {
52
- text: t.slice(n, n + l.length),
57
+ text: t.slice(n, n + o.length),
53
58
  highlight: !0
54
59
  },
55
- { text: t.slice(n + l.length), highlight: !1 }
60
+ { text: t.slice(n + o.length), highlight: !1 }
56
61
  ];
57
- }), B = d(() => {
58
- const t = s.node.searchMatch;
62
+ }), z = d(() => {
63
+ const t = l.node.searchMatch;
59
64
  if (!t) return [];
60
- const l = t.line_content, n = t.match_start, o = t.match_length;
61
- return n < 0 || n >= l.length ? [{ text: l, highlight: !1 }] : [
62
- { text: l.substring(0, n), highlight: !1 },
63
- { text: l.substring(n, n + o), highlight: !0 },
64
- { text: l.substring(n + o), highlight: !1 }
65
+ const o = t.line_content, n = t.match_start, a = t.match_length;
66
+ return n < 0 || n >= o.length ? [{ text: o, highlight: !1 }] : [
67
+ { text: o.substring(0, n), highlight: !1 },
68
+ { text: o.substring(n, n + a), highlight: !0 },
69
+ { text: o.substring(n + a), highlight: !1 }
65
70
  ];
66
- }), w = (t) => {
67
- t?.stopPropagation(), t?.preventDefault(), h("toggle-expand", s.node);
68
- }, F = d(
71
+ }), p = (t) => {
72
+ t?.stopPropagation(), t?.preventDefault(), g("toggle-expand", l.node);
73
+ }, N = d(
69
74
  () => E.value ? "lucide:chevron-left" : "lucide:chevron-right"
70
- ), N = () => {
71
- h("toggle-select", s.node);
72
- }, T = (t) => {
73
- t.stopPropagation(), u.value ? w() : s.selectionMode !== "none" && h("toggle-select", s.node), h("click-node", s.node);
75
+ ), F = () => {
76
+ g("toggle-select", l.node);
77
+ }, O = (t) => {
78
+ t.stopPropagation(), f.value ? p() : l.selectionMode !== "none" && g("toggle-select", l.node), g("click-node", l.node);
74
79
  };
75
- return (t, l) => (i(), a("div", G, [
80
+ return (t, o) => (s(), i("div", W, [
76
81
  c("div", {
77
- class: g(["group flex flex-col transition-colors cursor-pointer relative", {
82
+ class: m(["group flex flex-col transition-colors cursor-pointer relative", {
78
83
  "bg-accent/50 text-accent-foreground": e.isSelected && e.selectionMode === "single" && !e.showCheckboxes,
79
84
  "hover:bg-accent/50": !e.isSelected || e.selectionMode !== "single",
80
85
  "opacity-50 pointer-events-none": e.node.disabled,
81
86
  "rounded-none": e.variant === "bordered",
82
87
  "rounded-md": e.variant === "default"
83
88
  }]),
84
- title: p.value,
85
- onClick: T
89
+ title: k.value,
90
+ onClick: O
86
91
  }, [
87
- e.variant === "bordered" ? (i(), a("div", {
92
+ e.variant === "bordered" ? (s(), i("div", {
88
93
  key: 0,
89
94
  class: "absolute bottom-0 h-[1px] bg-border pointer-events-none",
90
- style: b({ insetInlineStart: e.depth * x + "px", insetInlineEnd: "0" })
91
- }, null, 4)) : f("", !0),
95
+ style: v({ insetInlineStart: e.depth * b + "px", insetInlineEnd: "0" })
96
+ }, null, 4)) : r("", !0),
92
97
  c("div", {
93
- class: g(["tree-row-content relative z-10 flex items-center pe-2", e.variant === "bordered" ? "py-2 min-h-[40px]" : "py-1 min-h-[32px]"]),
94
- style: b({ paddingInlineStart: I.value })
98
+ class: m(["tree-row-content relative z-10 flex items-center pe-2", e.variant === "bordered" ? "py-2 min-h-[40px]" : "py-1 min-h-[32px]"]),
99
+ style: v({ paddingInlineStart: I.value })
95
100
  }, [
96
- v(R(Q), {
101
+ e.showTreeLines ? (s(), h(A(H), {
102
+ key: 0,
97
103
  depth: e.depth,
98
104
  "is-last-sibling": e.isLast,
99
105
  "ancestor-last-flags": e.ancestorLastFlags,
100
- "has-toggle": u.value,
101
- indent: x,
106
+ "has-toggle": f.value,
107
+ indent: b,
102
108
  "line-class": "bg-border"
103
- }, null, 8, ["depth", "is-last-sibling", "ancestor-last-flags", "has-toggle"]),
104
- u.value ? (i(), a("button", {
105
- key: 0,
109
+ }, null, 8, ["depth", "is-last-sibling", "ancestor-last-flags", "has-toggle"])) : r("", !0),
110
+ f.value ? (s(), i("button", {
111
+ key: 1,
106
112
  type: "button",
107
113
  class: "tree-expand-toggle relative z-20 p-1 me-1 rounded-sm hover:bg-muted text-muted-foreground transition-colors focus:outline-none shrink-0",
108
114
  "aria-expanded": e.isExpanded,
109
- onClick: y(w, ["stop"])
115
+ onClick: x(p, ["stop"])
110
116
  }, [
111
- v(r, {
112
- icon: e.isExpanded ? "lucide:chevron-down" : F.value,
117
+ w(u, {
118
+ icon: e.isExpanded ? "lucide:chevron-down" : N.value,
113
119
  class: "w-4 h-4"
114
120
  }, null, 8, ["icon"])
115
- ], 8, Y)) : (i(), a("div", H)),
116
- e.showCheckboxes && e.selectionMode !== "none" ? (i(), a("div", {
117
- key: 2,
118
- class: "relative z-20 me-2 flex items-center justify-center bg-transparent shrink-0",
119
- onClick: l[0] || (l[0] = y(() => {
121
+ ], 8, j)) : (s(), i("div", q)),
122
+ e.showCheckboxes && e.selectionMode !== "none" ? (s(), i("div", {
123
+ key: 3,
124
+ class: "relative z-20 me-3 flex items-center justify-center bg-transparent shrink-0",
125
+ onClick: o[1] || (o[1] = x(() => {
120
126
  }, ["stop"]))
121
127
  }, [
122
- v(O, {
128
+ w(G, {
123
129
  checked: e.isSelected,
124
130
  indeterminate: e.isIndeterminate,
125
131
  disabled: e.node.disabled,
126
132
  rounded: "sm",
127
133
  size: "sm",
128
- "onUpdate:checked": N
134
+ onClick: o[0] || (o[0] = x(() => {
135
+ }, ["stop"])),
136
+ "onUpdate:checked": F
129
137
  }, null, 8, ["checked", "indeterminate", "disabled"])
130
- ])) : f("", !0),
131
- c("div", J, [
132
- e.isLoading ? (i(), m(r, {
138
+ ])) : r("", !0),
139
+ c("div", U, [
140
+ e.isLoading ? (s(), h(u, {
133
141
  key: 0,
134
142
  icon: "lucide:loader-2",
135
143
  class: "w-4 h-4 animate-spin"
136
- })) : e.node.icon ? (i(), m(r, {
144
+ })) : e.node.icon ? (s(), h(u, {
137
145
  key: 1,
138
146
  icon: e.node.icon,
139
147
  class: "w-4 h-4"
140
- }, null, 8, ["icon"])) : u.value ? (i(), m(r, {
148
+ }, null, 8, ["icon"])) : f.value ? (s(), h(u, {
141
149
  key: 2,
142
150
  icon: e.isExpanded ? "lucide:folder-open" : "lucide:folder",
143
151
  class: "w-4 h-4"
144
- }, null, 8, ["icon"])) : (i(), m(r, {
152
+ }, null, 8, ["icon"])) : (s(), h(u, {
145
153
  key: 3,
146
154
  icon: "lucide:file",
147
155
  class: "w-4 h-4"
148
156
  }))
149
157
  ]),
150
- c("div", K, [
151
- (i(!0), a(L, null, S(z.value, (n, o) => (i(), a("span", {
152
- key: o,
153
- class: g({
158
+ c("div", Y, [
159
+ (s(!0), i(C, null, L(T.value, (n, a) => (s(), i("span", {
160
+ key: a,
161
+ class: m({
154
162
  "bg-yellow-100 text-yellow-900 rounded-sm px-0.5": n.highlight
155
163
  })
156
- }, k(n.text), 3))), 128))
164
+ }, y(n.text), 3))), 128))
157
165
  ]),
158
- t.$slots.actions ? (i(), a("div", {
159
- key: 3,
166
+ t.$slots.actions ? (s(), i("div", {
167
+ key: 4,
160
168
  class: "relative z-20 ms-2 flex items-center shrink-0",
161
- onClick: l[1] || (l[1] = y(() => {
169
+ onClick: o[2] || (o[2] = x(() => {
162
170
  }, ["stop"]))
163
171
  }, [
164
- A(t.$slots, "actions", { node: e.node })
165
- ])) : f("", !0)
172
+ D(t.$slots, "actions", { node: e.node })
173
+ ])) : r("", !0)
166
174
  ], 6),
167
- e.node.searchMatch ? (i(), a("div", {
175
+ e.node.searchMatch ? (s(), i("div", {
168
176
  key: 1,
169
177
  class: "flex items-center text-[11px] text-gray-500 font-mono pe-2 pb-1.5 truncate",
170
- style: b({ paddingInlineStart: e.depth * x + 28 + "px" })
178
+ style: v({ paddingInlineStart: B.value })
171
179
  }, [
172
- c("span", W, "L" + k(e.node.searchMatch.line_number), 1),
173
- c("div", X, [
174
- (i(!0), a(L, null, S(B.value, (n, o) => (i(), a("span", {
175
- key: o,
176
- class: g({
180
+ c("span", Z, "L" + y(e.node.searchMatch.line_number), 1),
181
+ c("div", J, [
182
+ (s(!0), i(C, null, L(z.value, (n, a) => (s(), i("span", {
183
+ key: a,
184
+ class: m({
177
185
  "bg-yellow-500/20 text-gray-900 px-0.5 rounded-[1px] font-medium border border-yellow-600/30": n.highlight
178
186
  })
179
- }, k(n.text), 3))), 128))
187
+ }, y(n.text), 3))), 128))
180
188
  ])
181
- ], 4)) : f("", !0)
182
- ], 10, U)
189
+ ], 4)) : r("", !0)
190
+ ], 10, X)
183
191
  ]));
184
192
  }
185
193
  });
186
194
  export {
187
- ie as default
195
+ ce as default
188
196
  };
@@ -33,6 +33,18 @@ export interface FileTreeProps {
33
33
  emptyTextI18n?: string;
34
34
  variant?: FileTreeVariant;
35
35
  maxLabelLength?: number;
36
+ /**
37
+ * Whether to render parent-to-child tree connector (indent guide) lines.
38
+ * @default true
39
+ */
40
+ showTreeLines?: boolean;
41
+ /**
42
+ * When `false`, parent/folder row clicks only expand/collapse and never
43
+ * change selection. Leaf/file rows remain selectable by clicking the row.
44
+ * Checkboxes continue to select both folders and files.
45
+ * @default true
46
+ */
47
+ selectOnRowClick?: boolean;
36
48
  }
37
49
  export interface FileTreeEvents {
38
50
  (e: 'update:modelValue', keys: string[]): void;
@@ -1,5 +1,5 @@
1
1
  import o from "./AccordionView3.vue.js";
2
- /* empty css */
2
+ /* empty css */
3
3
  import r from "../../_virtual/_plugin-vue_export-helper.js";
4
4
  const i = /* @__PURE__ */ r(o, [["__scopeId", "data-v-543c2aba"]]);
5
5
  export {
@@ -96,11 +96,11 @@ declare const __VLS_component: import('vue').DefineComponent<Props, {
96
96
  values: Record<string, any>;
97
97
  footer: boolean;
98
98
  class: string;
99
+ className: string;
99
100
  loading: boolean;
100
101
  layout: "vertical" | "inline";
101
102
  isUpdate: boolean;
102
103
  folderId: string;
103
- className: string;
104
104
  headerClass: string;
105
105
  footerClass: string;
106
106
  cancelText: string;
@@ -27,8 +27,8 @@ declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, imp
27
27
  onAddonAction?: (action: string) => any;
28
28
  onAddonChange?: (name: string, payload: IFormFieldChangePayload) => any;
29
29
  }>, {
30
- variant: InputVariant;
31
30
  size: InputSize;
31
+ variant: InputVariant;
32
32
  rounded: InputRounded;
33
33
  loading: boolean;
34
34
  error: string;
@@ -42,8 +42,8 @@ declare const __VLS_component: import('vue').DefineComponent<Props, {}, {}, {},
42
42
  onChange?: (name: string, payload: IFormFieldChangePayload) => any;
43
43
  onAddonAction?: (action: string) => any;
44
44
  }>, {
45
- variant: InputVariant;
46
45
  size: InputSize;
46
+ variant: InputVariant;
47
47
  rounded: InputRounded;
48
48
  showRequiredAsterisk: boolean;
49
49
  layout: "vertical" | "inline";