vlite3 1.4.35 → 1.4.39

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 (50) 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 +6 -5
  4. package/components/Chip/Chip.vue.js +21 -21
  5. package/components/Chip/Chip.vue3.js +5 -0
  6. package/components/Comment/CommentItem.vue2.js +3 -2
  7. package/components/DataTable/DataTable.vue.d.ts +4 -1
  8. package/components/DataTable/DataTable.vue.js +317 -203
  9. package/components/DataTable/DataTableRow.vue.d.ts +21 -0
  10. package/components/DataTable/DataTableRow.vue.js +140 -73
  11. package/components/DataTable/types.d.ts +30 -0
  12. package/components/DataTable/useDataTableTree.d.ts +25 -0
  13. package/components/DataTable/useDataTableTree.js +147 -0
  14. package/components/FileTree/FileTree.vue.d.ts +3 -1
  15. package/components/FileTree/FileTree.vue.js +1 -1
  16. package/components/FileTree/FileTree.vue2.js +148 -105
  17. package/components/FileTree/FileTreeNode.vue.d.ts +15 -5
  18. package/components/FileTree/FileTreeNode.vue.js +149 -182
  19. package/components/Form/{AccordionView.vue.js → AccordionView.vue2.js} +1 -1
  20. package/components/Form/Form.vue2.js +45 -43
  21. package/components/Form/index.vue2.js +1 -1
  22. package/components/ImportData/ImportData.vue.js +4 -2
  23. package/components/Invoice/InvoiceVariant1.vue.js +3 -2
  24. package/components/Invoice/InvoiceVariant2.vue.js +3 -2
  25. package/components/Invoice/InvoiceVariant3.vue.js +3 -2
  26. package/components/Invoice/InvoiceVariant4.vue.js +3 -2
  27. package/components/MultiSelect/MultiSelect.vue.js +3 -2
  28. package/components/PricingPlan/PricingPlanItem.vue.js +10 -9
  29. package/components/RichTextEditor/RichTextEditor.vue.js +4 -4
  30. package/components/RichTextEditor/RichTextLinkPopover.vue3.js +2 -2
  31. package/components/RichTextEditor/RichTextToolbar.vue3.js +2 -2
  32. package/components/Screen/ScreenFilter.vue.js +21 -20
  33. package/components/StatusChip/StatusChip.vue.js +8 -7
  34. package/components/StatusChip/StatusChip.vue3.js +5 -0
  35. package/components/Timeline/TimelineItem.vue.js +3 -2
  36. package/components/TreeConnectors/TreeConnectors.vue.d.ts +27 -0
  37. package/components/TreeConnectors/TreeConnectors.vue.js +53 -0
  38. package/components/TreeConnectors/TreeConnectors.vue2.js +4 -0
  39. package/components/TreeConnectors/geometry.d.ts +90 -0
  40. package/components/TreeConnectors/geometry.js +137 -0
  41. package/components/TreeConnectors/index.d.ts +3 -0
  42. package/components/index.d.ts +1 -0
  43. package/index.js +473 -470
  44. package/package.json +1 -1
  45. package/style.css +15 -1
  46. package/components/Badge.vue2.js +0 -4
  47. package/components/Chip/Chip.vue2.js +0 -4
  48. package/components/StatusChip/StatusChip.vue2.js +0 -4
  49. /package/components/RichTextEditor/{RichTextLinkPopover.vue.js → RichTextLinkPopover.vue2.js} +0 -0
  50. /package/components/RichTextEditor/{RichTextToolbar.vue.js → RichTextToolbar.vue2.js} +0 -0
@@ -1,10 +1,11 @@
1
- import { defineComponent as Q, ref as L, shallowRef as E, watch as T, computed as v, openBlock as p, createElementBlock as k, normalizeClass as $, Fragment as q, renderList as V, isMemoSame as z, createBlock as F, createSlots as P, withCtx as A, renderSlot as R, mergeProps as U, toDisplayString as j } from "vue";
2
- import G from "./FileTreeNode.vue.js";
3
- import { $t as x } from "../../utils/i18n.js";
4
- const H = {
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";
2
+ import W from "./FileTreeNode.vue.js";
3
+ import { appendAncestorLastFlag as D, EMPTY_ANCESTOR_LAST_FLAGS as X } from "../TreeConnectors/geometry.js";
4
+ import { $t as k } from "../../utils/i18n.js";
5
+ const Z = {
5
6
  key: 1,
6
7
  class: "text-sm text-muted-foreground p-4 text-center"
7
- }, Y = /* @__PURE__ */ Q({
8
+ }, ne = /* @__PURE__ */ q({
8
9
  __name: "FileTree",
9
10
  props: {
10
11
  modelValue: { default: () => [] },
@@ -22,157 +23,199 @@ const H = {
22
23
  maxLabelLength: { default: 35 }
23
24
  },
24
25
  emits: ["update:modelValue", "select", "expand", "node-click"],
25
- setup(o, { emit: C }) {
26
- const s = o, m = C, u = L(new Set(s.defaultExpandedKeys)), f = L(/* @__PURE__ */ new Set()), g = E(/* @__PURE__ */ new Map()), b = E(/* @__PURE__ */ new Map()), I = (t, l) => {
27
- const e = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), a = (n, c) => {
28
- for (const r of n)
29
- e.set(r.id, r), c && i.set(r.id, c), r.children && a(r.children, r.id);
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()), b = x(/* @__PURE__ */ new Map()), P = (t) => !!(t.isFolder || t.children && t.children.length > 0), E = (t) => {
28
+ const l = /* @__PURE__ */ new Map(), e = /* @__PURE__ */ new Map(), a = (n, d) => {
29
+ for (const i of n)
30
+ l.set(i.id, i), d && e.set(i.id, d), i.children && a(i.children, i.id);
30
31
  };
31
- a(t, l), g.value = e, b.value = i;
32
+ a(t), y.value = l, b.value = e;
32
33
  };
33
- T(
34
+ F(
34
35
  () => s.data,
35
36
  (t) => {
36
- I(t);
37
+ E(t);
37
38
  },
38
- { immediate: !0, deep: !0 }
39
+ { immediate: !0 }
39
40
  );
40
- const w = (t) => {
41
- let l = [];
42
- if (t.children)
43
- for (const e of t.children)
44
- l.push(e.id), l = l.concat(w(e));
41
+ const M = (t) => {
42
+ const l = [], e = t.children ? [...t.children] : [];
43
+ for (; e.length; ) {
44
+ const a = e.pop();
45
+ if (l.push(a.id), a.children?.length)
46
+ for (let n = 0; n < a.children.length; n++)
47
+ e.push(a.children[n]);
48
+ }
45
49
  return l;
46
- }, y = v(() => new Set(s.modelValue)), S = v(() => {
50
+ }, w = g(() => new Set(s.modelValue)), T = g(() => {
47
51
  const t = /* @__PURE__ */ new Set();
48
52
  if (s.selectionMode !== "multiple") return t;
49
53
  const l = (e) => {
50
54
  if (!e.children || e.children.length === 0)
51
- return y.value.has(e.id) ? { status: "checked" } : { status: "unchecked" };
52
- let i = !1, a = !1, n = !1;
53
- for (const c of e.children) {
54
- const r = l(c);
55
- r.status === "checked" && (i = !0), r.status === "unchecked" && (a = !0), r.status === "indeterminate" && (n = !0);
55
+ return w.value.has(e.id) ? "checked" : "unchecked";
56
+ let a = !1, n = !1, d = !1;
57
+ for (const i of e.children) {
58
+ const r = l(i);
59
+ r === "checked" ? a = !0 : r === "unchecked" ? n = !0 : d = !0;
56
60
  }
57
- return n || i && a ? (t.add(e.id), { status: "indeterminate" }) : i ? { status: "checked" } : { status: "unchecked" };
61
+ return d || a && n ? (t.add(e.id), "indeterminate") : a ? "checked" : "unchecked";
58
62
  };
59
63
  return s.data.forEach(l), t;
60
- }), D = async (t) => {
64
+ }), A = async (t) => {
61
65
  if (t.disabled) return;
62
- if (u.value.has(t.id)) {
63
- const e = new Set(u.value);
64
- e.delete(t.id);
65
- const i = g.value.get(t.id) || t;
66
- w(i).forEach((n) => e.delete(n)), u.value = e, m("expand", t, !1);
67
- } else {
68
- const e = new Set(u.value);
69
- if (e.add(t.id), u.value = e, m("expand", t, !0), s.loadData && !t.isLoaded && (!t.children || t.children.length === 0)) {
70
- const i = new Set(f.value);
71
- i.add(t.id), f.value = i;
72
- try {
73
- await s.loadData(t);
74
- } finally {
75
- const a = new Set(f.value);
76
- a.delete(t.id), f.value = a;
77
- }
66
+ if (h.value.has(t.id)) {
67
+ const a = new Set(h.value);
68
+ 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
+ return;
72
+ }
73
+ 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)) {
75
+ const a = new Set(f.value);
76
+ a.add(t.id), f.value = a;
77
+ try {
78
+ await s.loadData(t), E(s.data);
79
+ } finally {
80
+ const n = new Set(f.value);
81
+ n.delete(t.id), f.value = n;
78
82
  }
79
83
  }
80
- }, K = (t) => {
84
+ }, B = (t) => {
81
85
  if (t.disabled) return;
82
- const l = g.value.get(t.id) || t;
83
- let e = new Set(y.value);
84
- const i = e.has(t.id);
86
+ const l = y.value.get(t.id) || t, e = new Set(w.value), a = e.has(t.id);
85
87
  if (s.selectionMode === "single")
86
- e.clear(), i || e.add(t.id);
88
+ e.clear(), a || e.add(t.id);
87
89
  else if (s.selectionMode === "multiple") {
88
- const a = w(l), n = !i, c = (d, h) => {
89
- h ? e.add(d) : e.delete(d);
90
+ const n = M(l), d = !a, i = (c, u) => {
91
+ u ? e.add(c) : e.delete(c);
90
92
  };
91
- c(t.id, n), a.forEach((d) => c(d, n));
93
+ i(t.id, d), n.forEach((c) => i(c, d));
92
94
  let r = l;
93
95
  for (; ; ) {
94
- const d = b.value.get(r.id);
95
- if (!d) break;
96
- const h = g.value.get(d);
97
- if (!h || !h.children) break;
98
- h.children.every((N) => e.has(N.id)) ? e.add(h.id) : e.delete(h.id), r = h;
96
+ const c = b.value.get(r.id);
97
+ if (!c) break;
98
+ const u = y.value.get(c);
99
+ if (!u?.children) break;
100
+ u.children.every((L) => e.has(L.id)) ? e.add(u.id) : e.delete(u.id), r = u;
99
101
  }
100
102
  }
101
- m("update:modelValue", Array.from(e)), m("select", l, !i);
102
- }, M = v(() => {
103
+ p("update:modelValue", Array.from(e)), p("select", l, !a);
104
+ }, Q = g(() => {
103
105
  if (!s.searchQuery) return s.data;
104
106
  const t = s.searchQuery.toLowerCase(), l = (e) => {
105
- const a = (e.labelI18n ? x(e.labelI18n) : e.label).toLowerCase().includes(t), n = !!e.searchMatch;
106
- let c = [];
107
- return e.children && (c = e.children.map(l).filter((r) => r !== null)), a || n || c.length > 0 ? {
108
- ...e,
109
- children: c
110
- } : null;
107
+ const n = (e.labelI18n ? k(e.labelI18n) : e.label).toLowerCase().includes(t), d = !!e.searchMatch;
108
+ 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
110
  };
112
111
  return s.data.map(l).filter((e) => e !== null);
112
+ }), C = g(() => {
113
+ const t = [], l = (e, a, n) => {
114
+ const d = e.length - 1;
115
+ for (let i = 0; i < e.length; i++) {
116
+ const r = e[i], c = i === d, u = P(r), L = h.value.has(r.id), $ = f.value.has(r.id);
117
+ if (t.push({
118
+ node: r,
119
+ depth: a,
120
+ isLast: c,
121
+ ancestorLastFlags: n,
122
+ isFolder: u
123
+ }), L && u && !$) {
124
+ const S = r.children;
125
+ S && S.length > 0 ? l(S, a + 1, D(n, c)) : t.push({
126
+ node: r,
127
+ depth: a + 1,
128
+ isLast: !0,
129
+ ancestorLastFlags: D(n, c),
130
+ isFolder: !1,
131
+ showEmptyPlaceholder: !0
132
+ });
133
+ }
134
+ }
135
+ };
136
+ return l(Q.value, 0, X), t;
113
137
  });
114
- T(
138
+ F(
115
139
  () => [s.searchQuery, s.data],
116
140
  ([t]) => {
117
- if (t) {
118
- const l = t.toLowerCase(), e = /* @__PURE__ */ new Set(), i = (a) => {
119
- let n = !1;
120
- if (a.children)
121
- for (const d of a.children)
122
- i(d) && (n = !0);
123
- const r = (a.labelI18n ? x(a.labelI18n) : a.label).toLowerCase().includes(l) || !!a.searchMatch;
124
- return n && e.add(a.id), r || n;
125
- };
126
- if (s.data.forEach(i), e.size > 0) {
127
- const a = new Set(u.value);
128
- e.forEach((n) => a.add(n)), u.value = a;
129
- }
141
+ if (!t) return;
142
+ const l = t.toLowerCase(), e = /* @__PURE__ */ new Set(), a = (n) => {
143
+ let d = !1;
144
+ 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;
149
+ };
150
+ if (s.data.forEach(a), e.size > 0) {
151
+ const n = new Set(h.value);
152
+ e.forEach((d) => n.add(d)), h.value = n;
130
153
  }
131
- },
132
- { deep: !0 }
154
+ }
133
155
  );
134
- const B = v(() => {
135
- if (s.emptyTextI18n) return x(s.emptyTextI18n);
156
+ const V = g(() => {
157
+ if (s.emptyTextI18n) return k(s.emptyTextI18n);
136
158
  if (s.emptyText) return s.emptyText;
137
- const t = x("vlite.fileTree.emptyText");
159
+ const t = k("vlite.fileTree.emptyText");
138
160
  return t !== "vlite.fileTree.emptyText" ? t : "No results found.";
139
161
  });
140
- return (t, l) => (p(), k("div", {
141
- class: $(["w-full h-full overflow-y-auto file-tree-container", s.class])
162
+ return (t, l) => (m(), v("div", {
163
+ class: z(["w-full h-full overflow-y-auto file-tree-container", s.class])
142
164
  }, [
143
- M.value.length > 0 ? (p(!0), k(q, { key: 0 }, V(M.value, (e, i, a, n) => {
144
- const c = [e, y.value, u.value, S.value, f.value, o.highlightSearch, o.searchQuery, o.showCheckboxes, o.variant, o.maxLabelLength, !!t.$slots.actions];
145
- if (n && n.key === e.id && z(n, c)) return n;
146
- const r = (p(), F(G, {
147
- key: e.id,
148
- node: e,
165
+ C.value.length > 0 ? (m(!0), v(I, { key: 0 }, R(C.value, (e) => (m(), v(I, {
166
+ key: e.showEmptyPlaceholder ? e.node.id + "-empty" : e.node.id
167
+ }, [
168
+ e.showEmptyPlaceholder ? N([e.depth, e.node.id], () => (m(), v("div", {
169
+ key: 0,
170
+ class: "py-0.5 text-xs text-muted-foreground italic",
171
+ style: G({ paddingLeft: e.depth * 20 + 26 + "px" })
172
+ }, null, 4)), l, 0) : N([
173
+ e.node,
174
+ w.value.has(e.node.id),
175
+ T.value.has(e.node.id),
176
+ h.value.has(e.node.id),
177
+ f.value.has(e.node.id),
178
+ o.highlightSearch,
179
+ o.searchQuery,
180
+ o.showCheckboxes,
181
+ o.variant,
182
+ o.maxLabelLength,
183
+ e.depth,
184
+ e.isLast,
185
+ e.ancestorLastFlags,
186
+ !!t.$slots.actions
187
+ ], () => (m(), O(W, {
188
+ key: 1,
189
+ node: e.node,
190
+ depth: e.depth,
191
+ "is-last": e.isLast,
192
+ "ancestor-last-flags": e.ancestorLastFlags,
149
193
  "selection-mode": o.selectionMode,
150
- "selected-keys": y.value,
151
- "expanded-keys": u.value,
152
- "indeterminate-keys": S.value,
153
- "loading-keys": f.value,
194
+ "is-selected": w.value.has(e.node.id),
195
+ "is-indeterminate": T.value.has(e.node.id),
196
+ "is-expanded": h.value.has(e.node.id),
197
+ "is-loading": f.value.has(e.node.id),
154
198
  "show-checkboxes": o.showCheckboxes,
155
199
  "highlight-search": o.highlightSearch,
156
200
  "search-query": o.searchQuery,
157
201
  variant: o.variant,
158
202
  "max-label-length": o.maxLabelLength,
159
- onToggleExpand: D,
160
- onToggleSelect: K,
161
- onClickNode: l[0] || (l[0] = (d) => m("node-click", d))
162
- }, P({ _: 2 }, [
203
+ onToggleExpand: A,
204
+ onToggleSelect: B,
205
+ onClickNode: l[1] || (l[1] = (a) => p("node-click", a))
206
+ }, U({ _: 2 }, [
163
207
  t.$slots.actions ? {
164
208
  name: "actions",
165
- fn: A((d) => [
166
- R(t.$slots, "actions", U({ ref_for: !0 }, d), void 0, !0)
209
+ fn: Y((a) => [
210
+ j(t.$slots, "actions", H({ ref_for: !0 }, a), void 0, !0)
167
211
  ]),
168
212
  key: "0"
169
213
  } : void 0
170
- ]), 1032, ["node", "selection-mode", "selected-keys", "expanded-keys", "indeterminate-keys", "loading-keys", "show-checkboxes", "highlight-search", "search-query", "variant", "max-label-length"]));
171
- return r.memo = c, r;
172
- }, l, 1), 128)) : (p(), k("div", H, j(B.value), 1))
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))
173
216
  ], 2));
174
217
  }
175
218
  });
176
219
  export {
177
- Y as default
220
+ ne as default
178
221
  };
@@ -3,15 +3,20 @@ interface Props {
3
3
  node: FileNode;
4
4
  depth?: number;
5
5
  selectionMode?: FileTreeSelectionMode;
6
- selectedKeys: Set<string>;
7
- indeterminateKeys: Set<string>;
8
- expandedKeys: Set<string>;
9
- loadingKeys: Set<string>;
6
+ /** Precomputed row state — avoids each node re-deriving from whole Sets. */
7
+ isSelected?: boolean;
8
+ isIndeterminate?: boolean;
9
+ isExpanded?: boolean;
10
+ isLoading?: boolean;
10
11
  showCheckboxes?: boolean;
11
12
  highlightSearch?: boolean;
12
13
  searchQuery?: string;
13
14
  variant?: FileTreeVariant;
14
15
  maxLabelLength?: number;
16
+ /** Whether this node is the last child of its parent. */
17
+ isLast?: boolean;
18
+ /** `isLast` of every ancestor, ordered root → immediate parent. */
19
+ ancestorLastFlags?: boolean[];
15
20
  }
16
21
  declare function __VLS_template(): {
17
22
  attrs: Partial<{}>;
@@ -19,7 +24,6 @@ declare function __VLS_template(): {
19
24
  actions?(_: {
20
25
  node: FileNode;
21
26
  }): any;
22
- actions?(_: any): any;
23
27
  };
24
28
  refs: {};
25
29
  rootEl: HTMLDivElement;
@@ -35,8 +39,14 @@ declare const __VLS_component: import('vue').DefineComponent<Props, {}, {}, {},
35
39
  "onClick-node"?: (node: FileNode) => any;
36
40
  }>, {
37
41
  variant: FileTreeVariant;
42
+ isLoading: boolean;
43
+ isSelected: boolean;
44
+ isLast: boolean;
38
45
  depth: number;
46
+ ancestorLastFlags: boolean[];
39
47
  selectionMode: FileTreeSelectionMode;
48
+ isIndeterminate: boolean;
49
+ isExpanded: boolean;
40
50
  showCheckboxes: boolean;
41
51
  highlightSearch: boolean;
42
52
  maxLabelLength: number;