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,10 +1,11 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
|
|
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
|
-
},
|
|
8
|
+
}, ne = /* @__PURE__ */ q({
|
|
8
9
|
__name: "FileTree",
|
|
9
10
|
props: {
|
|
10
11
|
modelValue: { default: () => [] },
|
|
@@ -22,159 +23,199 @@ const H = {
|
|
|
22
23
|
maxLabelLength: { default: 35 }
|
|
23
24
|
},
|
|
24
25
|
emits: ["update:modelValue", "select", "expand", "node-click"],
|
|
25
|
-
setup(o, { emit:
|
|
26
|
-
const
|
|
27
|
-
const
|
|
28
|
-
for (const
|
|
29
|
-
|
|
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
|
|
32
|
+
a(t), y.value = l, b.value = e;
|
|
32
33
|
};
|
|
33
|
-
|
|
34
|
-
() =>
|
|
34
|
+
F(
|
|
35
|
+
() => s.data,
|
|
35
36
|
(t) => {
|
|
36
|
-
|
|
37
|
+
E(t);
|
|
37
38
|
},
|
|
38
|
-
{ immediate: !0
|
|
39
|
+
{ immediate: !0 }
|
|
39
40
|
);
|
|
40
|
-
const
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
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
|
-
},
|
|
50
|
+
}, w = g(() => new Set(s.modelValue)), T = g(() => {
|
|
47
51
|
const t = /* @__PURE__ */ new Set();
|
|
48
|
-
if (
|
|
52
|
+
if (s.selectionMode !== "multiple") return t;
|
|
49
53
|
const l = (e) => {
|
|
50
54
|
if (!e.children || e.children.length === 0)
|
|
51
|
-
return
|
|
52
|
-
let
|
|
53
|
-
for (const
|
|
54
|
-
const r = l(
|
|
55
|
-
r
|
|
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
|
|
61
|
+
return d || a && n ? (t.add(e.id), "indeterminate") : a ? "checked" : "unchecked";
|
|
58
62
|
};
|
|
59
|
-
return
|
|
60
|
-
}),
|
|
63
|
+
return s.data.forEach(l), t;
|
|
64
|
+
}), A = async (t) => {
|
|
61
65
|
if (t.disabled) return;
|
|
62
|
-
if (
|
|
63
|
-
const
|
|
64
|
-
|
|
65
|
-
const n =
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
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 {
|
|
70
80
|
const n = new Set(f.value);
|
|
71
|
-
n.
|
|
72
|
-
try {
|
|
73
|
-
await i.loadData(t);
|
|
74
|
-
} finally {
|
|
75
|
-
const a = new Set(f.value);
|
|
76
|
-
a.delete(t.id), f.value = a;
|
|
77
|
-
}
|
|
81
|
+
n.delete(t.id), f.value = n;
|
|
78
82
|
}
|
|
79
83
|
}
|
|
80
|
-
},
|
|
84
|
+
}, B = (t) => {
|
|
81
85
|
if (t.disabled) return;
|
|
82
|
-
const l =
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
if (
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
const a = k(l), s = !n, c = (d, h) => {
|
|
89
|
-
h ? e.add(d) : e.delete(d);
|
|
86
|
+
const l = y.value.get(t.id) || t, e = new Set(w.value), a = e.has(t.id);
|
|
87
|
+
if (s.selectionMode === "single")
|
|
88
|
+
e.clear(), a || e.add(t.id);
|
|
89
|
+
else if (s.selectionMode === "multiple") {
|
|
90
|
+
const n = M(l), d = !a, i = (c, u) => {
|
|
91
|
+
u ? e.add(c) : e.delete(c);
|
|
90
92
|
};
|
|
91
|
-
|
|
93
|
+
i(t.id, d), n.forEach((c) => i(c, d));
|
|
92
94
|
let r = l;
|
|
93
95
|
for (; ; ) {
|
|
94
|
-
const
|
|
95
|
-
if (!
|
|
96
|
-
const
|
|
97
|
-
if (!
|
|
98
|
-
|
|
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
|
-
|
|
102
|
-
},
|
|
103
|
-
if (!
|
|
104
|
-
const t =
|
|
105
|
-
const
|
|
106
|
-
let
|
|
107
|
-
return e.children && (
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
103
|
+
p("update:modelValue", Array.from(e)), p("select", l, !a);
|
|
104
|
+
}, Q = g(() => {
|
|
105
|
+
if (!s.searchQuery) return s.data;
|
|
106
|
+
const t = s.searchQuery.toLowerCase(), l = (e) => {
|
|
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;
|
|
110
|
+
};
|
|
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
|
+
}
|
|
111
135
|
};
|
|
112
|
-
return
|
|
136
|
+
return l(Q.value, 0, X), t;
|
|
113
137
|
});
|
|
114
|
-
|
|
115
|
-
() => [
|
|
138
|
+
F(
|
|
139
|
+
() => [s.searchQuery, s.data],
|
|
116
140
|
([t]) => {
|
|
117
|
-
if (t)
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
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
|
|
135
|
-
if (
|
|
136
|
-
if (
|
|
137
|
-
const t =
|
|
156
|
+
const V = g(() => {
|
|
157
|
+
if (s.emptyTextI18n) return k(s.emptyTextI18n);
|
|
158
|
+
if (s.emptyText) return s.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) => (
|
|
141
|
-
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
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
key:
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
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,
|
|
151
193
|
"selection-mode": o.selectionMode,
|
|
152
|
-
"selected
|
|
153
|
-
"
|
|
154
|
-
"
|
|
155
|
-
"loading
|
|
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),
|
|
156
198
|
"show-checkboxes": o.showCheckboxes,
|
|
157
199
|
"highlight-search": o.highlightSearch,
|
|
158
200
|
"search-query": o.searchQuery,
|
|
159
201
|
variant: o.variant,
|
|
160
202
|
"max-label-length": o.maxLabelLength,
|
|
161
|
-
onToggleExpand:
|
|
162
|
-
onToggleSelect:
|
|
163
|
-
onClickNode: l[
|
|
164
|
-
},
|
|
203
|
+
onToggleExpand: A,
|
|
204
|
+
onToggleSelect: B,
|
|
205
|
+
onClickNode: l[1] || (l[1] = (a) => p("node-click", a))
|
|
206
|
+
}, U({ _: 2 }, [
|
|
165
207
|
t.$slots.actions ? {
|
|
166
208
|
name: "actions",
|
|
167
|
-
fn:
|
|
168
|
-
|
|
209
|
+
fn: Y((a) => [
|
|
210
|
+
j(t.$slots, "actions", H({ ref_for: !0 }, a), void 0, !0)
|
|
169
211
|
]),
|
|
170
212
|
key: "0"
|
|
171
213
|
} : void 0
|
|
172
|
-
]), 1032, ["node", "is-last", "selection-mode", "selected
|
|
173
|
-
|
|
174
|
-
}, l, 1), 128)) : (w(), b("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))
|
|
175
216
|
], 2));
|
|
176
217
|
}
|
|
177
218
|
});
|
|
178
219
|
export {
|
|
179
|
-
|
|
220
|
+
ne as default
|
|
180
221
|
};
|
|
@@ -3,10 +3,11 @@ interface Props {
|
|
|
3
3
|
node: FileNode;
|
|
4
4
|
depth?: number;
|
|
5
5
|
selectionMode?: FileTreeSelectionMode;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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;
|
|
@@ -23,7 +24,6 @@ declare function __VLS_template(): {
|
|
|
23
24
|
actions?(_: {
|
|
24
25
|
node: FileNode;
|
|
25
26
|
}): any;
|
|
26
|
-
actions?(_: any): any;
|
|
27
27
|
};
|
|
28
28
|
refs: {};
|
|
29
29
|
rootEl: HTMLDivElement;
|
|
@@ -39,10 +39,14 @@ declare const __VLS_component: import('vue').DefineComponent<Props, {}, {}, {},
|
|
|
39
39
|
"onClick-node"?: (node: FileNode) => any;
|
|
40
40
|
}>, {
|
|
41
41
|
variant: FileTreeVariant;
|
|
42
|
+
isLoading: boolean;
|
|
43
|
+
isSelected: boolean;
|
|
42
44
|
isLast: boolean;
|
|
43
45
|
depth: number;
|
|
44
46
|
ancestorLastFlags: boolean[];
|
|
45
47
|
selectionMode: FileTreeSelectionMode;
|
|
48
|
+
isIndeterminate: boolean;
|
|
49
|
+
isExpanded: boolean;
|
|
46
50
|
showCheckboxes: boolean;
|
|
47
51
|
highlightSearch: boolean;
|
|
48
52
|
maxLabelLength: number;
|