vlite3 1.3.4 → 1.3.6
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/Dropdown/Dropdown.vue.js +17 -16
- package/components/Dropdown/DropdownMenu.vue.js +2 -2
- package/components/Dropdown/DropdownMenu.vue2.js +56 -56
- package/components/FileTree/FileTree.vue.d.ts +1 -0
- package/components/FileTree/FileTree.vue.js +3 -3
- package/components/FileTree/FileTree.vue2.js +33 -31
- package/components/FileTree/FileTreeNode.vue.d.ts +2 -0
- package/components/FileTree/FileTreeNode.vue.js +72 -70
- package/components/FileTree/types.d.ts +1 -0
- package/components/Form/Form.vue.d.ts +2 -0
- package/components/Form/Form.vue.js +1 -1
- package/components/Form/Form.vue2.js +258 -229
- package/components/Form/FormFields.vue.d.ts +18 -1
- package/components/Form/FormFields.vue.js +1 -1
- package/components/Form/FormFields.vue2.js +108 -96
- package/components/Form/types.d.ts +2 -0
- package/components/ImportData/ImportData.vue.js +3 -2
- package/components/Input.vue.js +1 -1
- package/components/Modal.vue.js +1 -1
- package/components/Modal.vue2.js +1 -1
- package/components/NavbarCommandPalette.vue.d.ts +1 -1
- package/components/Screen/Screen.vue.d.ts +2 -0
- package/components/Screen/Screen.vue.js +180 -176
- package/components/Stats/Stats.vue.d.ts +1 -1
- package/components/Stats/Stats.vue.js +50 -22
- package/components/StatusChip/status-map.js +1 -0
- package/components/ThemeToggle.vue.d.ts +1 -1
- package/components/ThemeToggle.vue.js +2 -2
- package/components/Timeline/TimelineItem.vue.js +74 -91
- package/composables/useTheme.d.ts +1 -1
- package/composables/useTheme.js +15 -15
- package/package.json +2 -2
- package/style.css +12 -3
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as le, ref as i, computed as f, inject as ne, onMounted as oe, onUnmounted as ae, watch as M, provide as L, reactive as ie, toRefs as se, openBlock as V, createElementBlock as
|
|
1
|
+
import { defineComponent as le, ref as i, computed as f, inject as ne, onMounted as oe, onUnmounted as ae, watch as M, provide as L, reactive as ie, toRefs as se, openBlock as V, createElementBlock as de, normalizeStyle as re, createVNode as P, unref as u, withCtx as m, createBlock as ue, normalizeClass as ce, createSlots as fe, renderSlot as v, normalizeProps as R, guardReactiveProps as W, createCommentVNode as me } from "vue";
|
|
2
2
|
import ve from "v-tooltip-lite";
|
|
3
3
|
import "v-tooltip-lite/style.css";
|
|
4
4
|
import he from "./DropdownMenu.vue.js";
|
|
@@ -53,7 +53,7 @@ const xe = /* @__PURE__ */ le({
|
|
|
53
53
|
},
|
|
54
54
|
emits: ["onSelect", "update:modelValue", "onOpen", "onClose", "update:isOpen", "load-more", "search"],
|
|
55
55
|
setup(t, { emit: z }) {
|
|
56
|
-
const l = t, h = z, b = i(!1), y = i(null),
|
|
56
|
+
const l = t, h = z, b = i(!1), y = i(null), d = i({
|
|
57
57
|
title: "Confirm Selection",
|
|
58
58
|
description: "Are you sure you want to select this option?",
|
|
59
59
|
confirmText: "Confirm",
|
|
@@ -117,8 +117,8 @@ const xe = /* @__PURE__ */ le({
|
|
|
117
117
|
);
|
|
118
118
|
const c = f(() => {
|
|
119
119
|
const e = [...S.value], o = new Set(e.map((n) => n.value ?? n.label));
|
|
120
|
-
return k.value.forEach((n,
|
|
121
|
-
o.has(
|
|
120
|
+
return k.value.forEach((n, r) => {
|
|
121
|
+
o.has(r) || (e.unshift(n), o.add(r));
|
|
122
122
|
}), e;
|
|
123
123
|
}), { selectedBuffer: k, isHydrating: K, hydrateSelected: E } = pe({
|
|
124
124
|
fetchSelected: l.fetchSelected,
|
|
@@ -143,13 +143,13 @@ const xe = /* @__PURE__ */ le({
|
|
|
143
143
|
);
|
|
144
144
|
const _ = (e) => {
|
|
145
145
|
if (l.disabled || l.readonly || e.disabled) return;
|
|
146
|
-
l.doubleConfirmation || !!e.confirmation ? (y.value = e, typeof e.confirmation == "object" ?
|
|
146
|
+
l.doubleConfirmation || !!e.confirmation ? (y.value = e, typeof e.confirmation == "object" ? d.value = {
|
|
147
147
|
title: e.confirmation.title || "Confirm Selection",
|
|
148
148
|
description: e.confirmation.description || "Are you sure you want to select this option?",
|
|
149
149
|
confirmText: e.confirmation.confirmText || "Confirm",
|
|
150
150
|
cancelText: e.confirmation.cancelText || "Cancel",
|
|
151
151
|
variant: e.confirmation.variant || "primary"
|
|
152
|
-
} :
|
|
152
|
+
} : d.value = {
|
|
153
153
|
title: "Confirm Selection",
|
|
154
154
|
description: `Are you sure you want to select "${e.label}"?`,
|
|
155
155
|
confirmText: "Confirm",
|
|
@@ -162,8 +162,8 @@ const xe = /* @__PURE__ */ le({
|
|
|
162
162
|
k.value.has(o) || k.value.set(o, e);
|
|
163
163
|
const n = Y(e);
|
|
164
164
|
if (!l.isNested) {
|
|
165
|
-
const
|
|
166
|
-
(e._path || [
|
|
165
|
+
const r = e._originalOption || e, a = r.value ?? r.label;
|
|
166
|
+
(e._path || [r]).forEach((T) => {
|
|
167
167
|
typeof T.onSelect == "function" && T.onSelect({
|
|
168
168
|
value: a,
|
|
169
169
|
option: T,
|
|
@@ -177,14 +177,15 @@ const xe = /* @__PURE__ */ le({
|
|
|
177
177
|
}, te = () => {
|
|
178
178
|
y.value = null, b.value = !1;
|
|
179
179
|
};
|
|
180
|
-
return (e, o) => (V(),
|
|
180
|
+
return (e, o) => (V(), de("div", {
|
|
181
181
|
class: "relative inline-block text-left",
|
|
182
|
-
style:
|
|
182
|
+
style: re({ direction: t.direction })
|
|
183
183
|
}, [
|
|
184
184
|
P(u(ve), {
|
|
185
185
|
content: "",
|
|
186
186
|
trigger: "click",
|
|
187
187
|
arrow: !1,
|
|
188
|
+
disabled: t.disabled || t.readonly,
|
|
188
189
|
teleport: t.teleport,
|
|
189
190
|
offset: t.offset,
|
|
190
191
|
placement: j.value,
|
|
@@ -283,14 +284,14 @@ const xe = /* @__PURE__ */ le({
|
|
|
283
284
|
]), 1032, ["options", "cachedOptions", "class", "emptyMessage", "searchEmptyMessage", "selected", "selectedIndex", "maxHeight", "nestedPosition", "nestedOffset", "selectable", "direction", "isCustomSlotMenu", "layout", "columns", "loading", "hasMore", "searchable", "remote", "debounceTime"])) : me("", !0)
|
|
284
285
|
]),
|
|
285
286
|
_: 3
|
|
286
|
-
}, 8, ["teleport", "offset", "placement", "isOpen", "keepAlive", "menuId", "ignoreClickOutside", "className", "styles"]),
|
|
287
|
+
}, 8, ["disabled", "teleport", "offset", "placement", "isOpen", "keepAlive", "menuId", "ignoreClickOutside", "className", "styles"]),
|
|
287
288
|
P(ge, {
|
|
288
289
|
show: b.value,
|
|
289
|
-
title:
|
|
290
|
-
description:
|
|
291
|
-
"confirm-text":
|
|
292
|
-
"cancel-text":
|
|
293
|
-
variant:
|
|
290
|
+
title: d.value.title,
|
|
291
|
+
description: d.value.description,
|
|
292
|
+
"confirm-text": d.value.confirmText,
|
|
293
|
+
"cancel-text": d.value.cancelText,
|
|
294
|
+
variant: d.value.variant,
|
|
294
295
|
onConfirm: ee,
|
|
295
296
|
onCancel: te
|
|
296
297
|
}, null, 8, ["show", "title", "description", "confirm-text", "cancel-text", "variant"])
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./DropdownMenu.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import r from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const m = /* @__PURE__ */ r(o, [["__scopeId", "data-v-1742cff5"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
m as default
|
|
7
7
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent as ee, ref as j, computed as
|
|
2
|
-
import
|
|
1
|
+
import { defineComponent as ee, ref as j, computed as g, watch as T, onMounted as te, onBeforeUnmount as le, openBlock as o, createElementBlock as c, createVNode as O, createCommentVNode as f, renderSlot as k, unref as r, normalizeStyle as se, normalizeClass as E, createElementVNode as w, toDisplayString as N, createBlock as h, Fragment as P, renderList as oe, withCtx as V, createSlots as ne, mergeProps as re, nextTick as ae } from "vue";
|
|
2
|
+
import p from "../Icon.vue.js";
|
|
3
3
|
import ie from "../Input.vue.js";
|
|
4
4
|
/* empty css */
|
|
5
5
|
import ce from "./DropdownItem.vue.js";
|
|
@@ -53,19 +53,19 @@ const ve = ["dir"], ye = {
|
|
|
53
53
|
},
|
|
54
54
|
emits: ["select", "close", "load-more", "search"],
|
|
55
55
|
setup(a, { emit: D }) {
|
|
56
|
-
const t = a, m = D, _ = j(null),
|
|
57
|
-
if (
|
|
56
|
+
const t = a, m = D, _ = j(null), i = j(""), { getMenuId: z, getAllRecursiveIds: H } = me(), L = g(() => {
|
|
57
|
+
if (i.value && i.value.trim() !== "")
|
|
58
58
|
return t.searchEmptyMessage ? t.searchEmptyMessage : `No results found for
|
|
59
|
-
"${
|
|
59
|
+
"${i.value}"`;
|
|
60
60
|
const e = $("vlite.dropdown.empty");
|
|
61
61
|
return e !== "vlite.dropdown.empty" ? e : t.emptyMessage;
|
|
62
|
-
}), R =
|
|
62
|
+
}), R = g(() => {
|
|
63
63
|
const e = $("vlite.dropdown.search");
|
|
64
64
|
return e !== "vlite.dropdown.search" ? e : "Search...";
|
|
65
|
-
}),
|
|
66
|
-
let
|
|
67
|
-
|
|
68
|
-
t.remote && (
|
|
65
|
+
}), u = g(() => t.options ? t.options.map((e) => typeof e == "string" || typeof e == "number" ? { label: String(e), value: String(e) } : e) : []), B = g(() => t.searchable ? i.value && i.value.trim() !== "" ? !0 : t.remote ? t.loading ? !0 : t.hasMore || (u.value.length || 0) > 5 : (u.value.length || 0) > 5 : !1);
|
|
66
|
+
let v = null;
|
|
67
|
+
T(i, (e) => {
|
|
68
|
+
t.remote && (v && clearTimeout(v), v = setTimeout(() => {
|
|
69
69
|
e !== void 0 && m("search", e);
|
|
70
70
|
}, t.debounceTime));
|
|
71
71
|
});
|
|
@@ -75,7 +75,7 @@ const ve = ["dir"], ye = {
|
|
|
75
75
|
}, x = (e, s) => {
|
|
76
76
|
e.disabled || m("select", e);
|
|
77
77
|
}, {
|
|
78
|
-
focusedIndex:
|
|
78
|
+
focusedIndex: b,
|
|
79
79
|
isKeyboardMode: M,
|
|
80
80
|
filteredOptions: F,
|
|
81
81
|
handleKeyDown: C,
|
|
@@ -83,12 +83,12 @@ const ve = ["dir"], ye = {
|
|
|
83
83
|
onMouseEnterItem: S,
|
|
84
84
|
scrollToIndex: K
|
|
85
85
|
} = fe({
|
|
86
|
-
options:
|
|
87
|
-
searchQuery:
|
|
86
|
+
options: u,
|
|
87
|
+
searchQuery: i,
|
|
88
88
|
containerRef: _,
|
|
89
89
|
emit: (e, ...s) => m(e, ...s),
|
|
90
90
|
handleSelect: (e, s) => x(e)
|
|
91
|
-
}),
|
|
91
|
+
}), y = g(() => t.remote ? i.value ? u.value : t.cachedOptions.length ? t.cachedOptions : u.value : F.value), U = (e) => {
|
|
92
92
|
if (!(!t.selected || typeof t.selected != "object") && e.key && e.key in t.selected)
|
|
93
93
|
return t.selected[e.key];
|
|
94
94
|
}, q = (e) => e.disabled ? !1 : Array.isArray(t.selected) ? t.selected.includes(e.value) : t.selected && typeof t.selected == "object" && e.key ? t.selected[e.key] === e.value : t.selected === e.value, G = (e) => !e.key || !t.selected || typeof t.selected != "object" ? !1 : !!t.selected[e.key], J = (e, s) => {
|
|
@@ -117,27 +117,27 @@ const ve = ["dir"], ye = {
|
|
|
117
117
|
}, W = async () => {
|
|
118
118
|
await ae();
|
|
119
119
|
let e = -1;
|
|
120
|
-
t.layout !== "grouped" && (t.selectedIndex !== null && t.selectedIndex >= 0 ? e = t.selectedIndex : t.selected !== void 0 && typeof t.selected != "object" && (e =
|
|
120
|
+
t.layout !== "grouped" && (t.selectedIndex !== null && t.selectedIndex >= 0 ? e = t.selectedIndex : t.selected !== void 0 && typeof t.selected != "object" && (e = u.value.findIndex((s) => s.value === t.selected)), e !== -1 && K(e));
|
|
121
121
|
};
|
|
122
|
-
|
|
123
|
-
() =>
|
|
122
|
+
T(
|
|
123
|
+
() => y.value,
|
|
124
124
|
() => {
|
|
125
|
-
|
|
125
|
+
b.value = -1;
|
|
126
126
|
}
|
|
127
127
|
), te(() => {
|
|
128
128
|
W(), window.addEventListener("keydown", C);
|
|
129
129
|
}), le(() => {
|
|
130
|
-
window.removeEventListener("keydown", C);
|
|
130
|
+
window.removeEventListener("keydown", C), v && clearTimeout(v), i.value && t.remote && m("search", "");
|
|
131
131
|
});
|
|
132
132
|
const X = (e) => e.labelI18n ? $(e.labelI18n) : e.label, Y = (e) => e.showChevron !== !1;
|
|
133
|
-
return (e, s) => (o(),
|
|
133
|
+
return (e, s) => (o(), c("div", {
|
|
134
134
|
class: "dropdown-menu w-full flex flex-col",
|
|
135
135
|
dir: a.direction
|
|
136
136
|
}, [
|
|
137
|
-
B.value ? (o(),
|
|
137
|
+
B.value ? (o(), c("div", ye, [
|
|
138
138
|
O(ie, {
|
|
139
|
-
modelValue:
|
|
140
|
-
"onUpdate:modelValue": s[0] || (s[0] = (l) =>
|
|
139
|
+
modelValue: i.value,
|
|
140
|
+
"onUpdate:modelValue": s[0] || (s[0] = (l) => i.value = l),
|
|
141
141
|
placeholder: R.value,
|
|
142
142
|
icon: "lucide:search",
|
|
143
143
|
size: "sm",
|
|
@@ -149,17 +149,17 @@ const ve = ["dir"], ye = {
|
|
|
149
149
|
"show-clear-button": !1,
|
|
150
150
|
"data-testid": "dropdown-search-input"
|
|
151
151
|
}, null, 8, ["modelValue", "placeholder"])
|
|
152
|
-
])) :
|
|
153
|
-
e.$slots.header ? (o(),
|
|
154
|
-
|
|
155
|
-
])) :
|
|
156
|
-
|
|
152
|
+
])) : f("", !0),
|
|
153
|
+
e.$slots.header ? (o(), c("div", ge, [
|
|
154
|
+
k(e.$slots, "header", {}, void 0, !0)
|
|
155
|
+
])) : f("", !0),
|
|
156
|
+
u.value.length > 0 || y.value.length === 0 ? (o(), c("div", {
|
|
157
157
|
key: 2,
|
|
158
158
|
ref_key: "containerRef",
|
|
159
159
|
ref: _,
|
|
160
160
|
tabindex: B.value ? -1 : 0,
|
|
161
161
|
role: "menu",
|
|
162
|
-
class:
|
|
162
|
+
class: E([
|
|
163
163
|
"w-full p-1 space-y-0.5 overflow-y-auto overflow-x-hidden focus:outline-none flex-1 scrollbar-thin",
|
|
164
164
|
t.class
|
|
165
165
|
]),
|
|
@@ -168,26 +168,26 @@ const ve = ["dir"], ye = {
|
|
|
168
168
|
(...l) => r(I) && r(I)(...l)),
|
|
169
169
|
onScroll: A
|
|
170
170
|
}, [
|
|
171
|
-
!a.isCustomSlotMenu &&
|
|
172
|
-
O(
|
|
171
|
+
!a.isCustomSlotMenu && y.value.length === 0 && !a.loading && !(u.value.length === 0 && e.$slots.menu) ? (o(), c("div", ke, [
|
|
172
|
+
O(p, {
|
|
173
173
|
icon: "lucide:inbox",
|
|
174
174
|
class: "w-8 h-8 mb-2 opacity-70"
|
|
175
175
|
}),
|
|
176
|
-
|
|
177
|
-
])) :
|
|
176
|
+
w("span", null, N(L.value), 1)
|
|
177
|
+
])) : f("", !0),
|
|
178
178
|
a.layout === "grouped" ? (o(), h(ue, {
|
|
179
179
|
key: 1,
|
|
180
|
-
options:
|
|
180
|
+
options: y.value,
|
|
181
181
|
selected: a.selected,
|
|
182
182
|
selectable: a.selectable,
|
|
183
183
|
columns: a.columns,
|
|
184
184
|
onSelect: x
|
|
185
|
-
}, null, 8, ["options", "selected", "selectable", "columns"])) : (o(!0),
|
|
186
|
-
l.label === "---" ? (o(),
|
|
185
|
+
}, null, 8, ["options", "selected", "selectable", "columns"])) : (o(!0), c(P, { key: 2 }, oe(y.value, (l, n) => (o(), c(P, { key: n }, [
|
|
186
|
+
l.label === "---" ? (o(), c("div", we)) : l.data?.isBoolean ? (o(), h(de, {
|
|
187
187
|
key: 1,
|
|
188
188
|
option: l,
|
|
189
189
|
value: G(l),
|
|
190
|
-
focused: r(M) && r(
|
|
190
|
+
focused: r(M) && r(b) === n,
|
|
191
191
|
onChange: J,
|
|
192
192
|
onMouseenter: (d) => r(S)(n)
|
|
193
193
|
}, null, 8, ["option", "value", "focused", "onMouseenter"])) : l.children && l.children.length > 0 ? (o(), h(he, {
|
|
@@ -207,30 +207,30 @@ const ve = ["dir"], ye = {
|
|
|
207
207
|
onOnSelect: (d) => Q(l, d)
|
|
208
208
|
}, {
|
|
209
209
|
trigger: V(() => [
|
|
210
|
-
|
|
210
|
+
w("div", {
|
|
211
211
|
tabindex: 0,
|
|
212
212
|
"data-dropdown-item": "",
|
|
213
|
-
class:
|
|
214
|
-
r(M) && r(
|
|
213
|
+
class: E(["relative flex cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm font-medium outline-none transition-colors justify-between w-full focus-visible:bg-accent focus-visible:text-accent-foreground focus-visible:ring-1 focus-visible:ring-primary focus-visible:ring-offset-1", [
|
|
214
|
+
r(M) && r(b) === n ? "bg-accent text-accent-foreground" : "hover:bg-accent hover:text-accent-foreground",
|
|
215
215
|
l.disabled ? "opacity-50 cursor-not-allowed" : "",
|
|
216
216
|
l.triggerClass || l.class || ""
|
|
217
217
|
]]),
|
|
218
218
|
onMouseenter: (d) => r(S)(n)
|
|
219
219
|
}, [
|
|
220
|
-
|
|
221
|
-
l.icon || l.emoji ? (o(), h(
|
|
220
|
+
w("div", xe, [
|
|
221
|
+
l.icon || l.emoji ? (o(), h(p, {
|
|
222
222
|
key: 0,
|
|
223
223
|
icon: l.icon,
|
|
224
224
|
emoji: l.emoji,
|
|
225
225
|
class: "mr-2 h-4 w-4 shrink-0 mt-0.5"
|
|
226
|
-
}, null, 8, ["icon", "emoji"])) :
|
|
227
|
-
|
|
226
|
+
}, null, 8, ["icon", "emoji"])) : f("", !0),
|
|
227
|
+
w("span", Me, N(X(l)), 1)
|
|
228
228
|
]),
|
|
229
|
-
Y(l) ? (o(), h(
|
|
229
|
+
Y(l) ? (o(), h(p, {
|
|
230
230
|
key: 0,
|
|
231
231
|
icon: a.direction === "rtl" ? "lucide:chevron-left" : "lucide:chevron-right",
|
|
232
232
|
class: "h-4 w-4 text-muted-foreground shrink-0 ml-2"
|
|
233
|
-
}, null, 8, ["icon"])) :
|
|
233
|
+
}, null, 8, ["icon"])) : f("", !0)
|
|
234
234
|
], 42, pe)
|
|
235
235
|
]),
|
|
236
236
|
_: 2
|
|
@@ -239,7 +239,7 @@ const ve = ["dir"], ye = {
|
|
|
239
239
|
option: l,
|
|
240
240
|
index: n,
|
|
241
241
|
selected: q(l),
|
|
242
|
-
focused: r(M) && r(
|
|
242
|
+
focused: r(M) && r(b) === n,
|
|
243
243
|
selectable: a.selectable,
|
|
244
244
|
onClick: (d) => x(l),
|
|
245
245
|
onMouseenter: (d) => r(S)(n)
|
|
@@ -247,23 +247,23 @@ const ve = ["dir"], ye = {
|
|
|
247
247
|
e.$slots.item ? {
|
|
248
248
|
name: "default",
|
|
249
249
|
fn: V((d) => [
|
|
250
|
-
|
|
250
|
+
k(e.$slots, "item", re({ ref_for: !0 }, d), void 0, !0)
|
|
251
251
|
]),
|
|
252
252
|
key: "0"
|
|
253
253
|
} : void 0
|
|
254
254
|
]), 1032, ["option", "index", "selected", "focused", "selectable", "onClick", "onMouseenter"]))
|
|
255
255
|
], 64))), 128)),
|
|
256
|
-
a.loading ? (o(),
|
|
257
|
-
O(
|
|
256
|
+
a.loading ? (o(), c("div", Se, [
|
|
257
|
+
O(p, {
|
|
258
258
|
icon: "lucide:loader-2",
|
|
259
259
|
class: "w-4 h-4 animate-spin text-muted-foreground"
|
|
260
260
|
})
|
|
261
|
-
])) :
|
|
262
|
-
|
|
263
|
-
], 46, be)) :
|
|
264
|
-
e.$slots.footer ? (o(),
|
|
265
|
-
|
|
266
|
-
])) :
|
|
261
|
+
])) : f("", !0),
|
|
262
|
+
k(e.$slots, "menu", {}, void 0, !0)
|
|
263
|
+
], 46, be)) : f("", !0),
|
|
264
|
+
e.$slots.footer ? (o(), c("div", Oe, [
|
|
265
|
+
k(e.$slots, "footer", {}, void 0, !0)
|
|
266
|
+
])) : f("", !0)
|
|
267
267
|
], 8, ve));
|
|
268
268
|
}
|
|
269
269
|
});
|
|
@@ -25,6 +25,7 @@ declare const __VLS_component: import('vue').DefineComponent<FileTreeProps, {},
|
|
|
25
25
|
selectionMode: import('./types').FileTreeSelectionMode;
|
|
26
26
|
showCheckboxes: boolean;
|
|
27
27
|
highlightSearch: boolean;
|
|
28
|
+
maxLabelLength: number;
|
|
28
29
|
defaultExpandedKeys: string[];
|
|
29
30
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
|
|
30
31
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./FileTree.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
|
-
import
|
|
4
|
-
const
|
|
3
|
+
import r from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
+
const m = /* @__PURE__ */ r(o, [["__scopeId", "data-v-62b1cddc"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
m as default
|
|
7
7
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { defineComponent as Q, ref as
|
|
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
2
|
import G from "./FileTreeNode.vue.js";
|
|
3
|
-
import { $t as
|
|
3
|
+
import { $t as x } from "../../utils/i18n.js";
|
|
4
4
|
const H = {
|
|
5
5
|
key: 1,
|
|
6
6
|
class: "text-sm text-muted-foreground p-4 text-center"
|
|
@@ -18,36 +18,37 @@ const H = {
|
|
|
18
18
|
class: {},
|
|
19
19
|
emptyText: {},
|
|
20
20
|
emptyTextI18n: {},
|
|
21
|
-
variant: { default: "default" }
|
|
21
|
+
variant: { default: "default" },
|
|
22
|
+
maxLabelLength: { default: 35 }
|
|
22
23
|
},
|
|
23
24
|
emits: ["update:modelValue", "select", "expand", "node-click"],
|
|
24
|
-
setup(o, { emit:
|
|
25
|
-
const s = o, m =
|
|
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) => {
|
|
26
27
|
const e = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), a = (n, c) => {
|
|
27
28
|
for (const r of n)
|
|
28
29
|
e.set(r.id, r), c && i.set(r.id, c), r.children && a(r.children, r.id);
|
|
29
30
|
};
|
|
30
|
-
a(t, l),
|
|
31
|
+
a(t, l), g.value = e, b.value = i;
|
|
31
32
|
};
|
|
32
|
-
|
|
33
|
+
T(
|
|
33
34
|
() => s.data,
|
|
34
35
|
(t) => {
|
|
35
36
|
I(t);
|
|
36
37
|
},
|
|
37
38
|
{ immediate: !0, deep: !0 }
|
|
38
39
|
);
|
|
39
|
-
const
|
|
40
|
+
const w = (t) => {
|
|
40
41
|
let l = [];
|
|
41
42
|
if (t.children)
|
|
42
43
|
for (const e of t.children)
|
|
43
|
-
l.push(e.id), l = l.concat(
|
|
44
|
+
l.push(e.id), l = l.concat(w(e));
|
|
44
45
|
return l;
|
|
45
|
-
},
|
|
46
|
+
}, y = v(() => new Set(s.modelValue)), S = v(() => {
|
|
46
47
|
const t = /* @__PURE__ */ new Set();
|
|
47
48
|
if (s.selectionMode !== "multiple") return t;
|
|
48
49
|
const l = (e) => {
|
|
49
50
|
if (!e.children || e.children.length === 0)
|
|
50
|
-
return
|
|
51
|
+
return y.value.has(e.id) ? { status: "checked" } : { status: "unchecked" };
|
|
51
52
|
let i = !1, a = !1, n = !1;
|
|
52
53
|
for (const c of e.children) {
|
|
53
54
|
const r = l(c);
|
|
@@ -61,8 +62,8 @@ const H = {
|
|
|
61
62
|
if (u.value.has(t.id)) {
|
|
62
63
|
const e = new Set(u.value);
|
|
63
64
|
e.delete(t.id);
|
|
64
|
-
const i =
|
|
65
|
-
|
|
65
|
+
const i = g.value.get(t.id) || t;
|
|
66
|
+
w(i).forEach((n) => e.delete(n)), u.value = e, m("expand", t, !1);
|
|
66
67
|
} else {
|
|
67
68
|
const e = new Set(u.value);
|
|
68
69
|
if (e.add(t.id), u.value = e, m("expand", t, !0), s.loadData && !t.isLoaded && (!t.children || t.children.length === 0)) {
|
|
@@ -78,21 +79,21 @@ const H = {
|
|
|
78
79
|
}
|
|
79
80
|
}, K = (t) => {
|
|
80
81
|
if (t.disabled) return;
|
|
81
|
-
const l =
|
|
82
|
-
let e = new Set(
|
|
82
|
+
const l = g.value.get(t.id) || t;
|
|
83
|
+
let e = new Set(y.value);
|
|
83
84
|
const i = e.has(t.id);
|
|
84
85
|
if (s.selectionMode === "single")
|
|
85
86
|
e.clear(), i || e.add(t.id);
|
|
86
87
|
else if (s.selectionMode === "multiple") {
|
|
87
|
-
const a =
|
|
88
|
+
const a = w(l), n = !i, c = (d, h) => {
|
|
88
89
|
h ? e.add(d) : e.delete(d);
|
|
89
90
|
};
|
|
90
91
|
c(t.id, n), a.forEach((d) => c(d, n));
|
|
91
92
|
let r = l;
|
|
92
93
|
for (; ; ) {
|
|
93
|
-
const d =
|
|
94
|
+
const d = b.value.get(r.id);
|
|
94
95
|
if (!d) break;
|
|
95
|
-
const h =
|
|
96
|
+
const h = g.value.get(d);
|
|
96
97
|
if (!h || !h.children) break;
|
|
97
98
|
h.children.every((N) => e.has(N.id)) ? e.add(h.id) : e.delete(h.id), r = h;
|
|
98
99
|
}
|
|
@@ -101,7 +102,7 @@ const H = {
|
|
|
101
102
|
}, M = v(() => {
|
|
102
103
|
if (!s.searchQuery) return s.data;
|
|
103
104
|
const t = s.searchQuery.toLowerCase(), l = (e) => {
|
|
104
|
-
const a = (e.labelI18n ?
|
|
105
|
+
const a = (e.labelI18n ? x(e.labelI18n) : e.label).toLowerCase().includes(t), n = !!e.searchMatch;
|
|
105
106
|
let c = [];
|
|
106
107
|
return e.children && (c = e.children.map(l).filter((r) => r !== null)), a || n || c.length > 0 ? {
|
|
107
108
|
...e,
|
|
@@ -110,7 +111,7 @@ const H = {
|
|
|
110
111
|
};
|
|
111
112
|
return s.data.map(l).filter((e) => e !== null);
|
|
112
113
|
});
|
|
113
|
-
|
|
114
|
+
T(
|
|
114
115
|
() => [s.searchQuery, s.data],
|
|
115
116
|
([t]) => {
|
|
116
117
|
if (t) {
|
|
@@ -119,7 +120,7 @@ const H = {
|
|
|
119
120
|
if (a.children)
|
|
120
121
|
for (const d of a.children)
|
|
121
122
|
i(d) && (n = !0);
|
|
122
|
-
const r = (a.labelI18n ?
|
|
123
|
+
const r = (a.labelI18n ? x(a.labelI18n) : a.label).toLowerCase().includes(l) || !!a.searchMatch;
|
|
123
124
|
return n && e.add(a.id), r || n;
|
|
124
125
|
};
|
|
125
126
|
if (s.data.forEach(i), e.size > 0) {
|
|
@@ -131,29 +132,30 @@ const H = {
|
|
|
131
132
|
{ deep: !0 }
|
|
132
133
|
);
|
|
133
134
|
const B = v(() => {
|
|
134
|
-
if (s.emptyTextI18n) return
|
|
135
|
+
if (s.emptyTextI18n) return x(s.emptyTextI18n);
|
|
135
136
|
if (s.emptyText) return s.emptyText;
|
|
136
|
-
const t =
|
|
137
|
+
const t = x("vlite.fileTree.emptyText");
|
|
137
138
|
return t !== "vlite.fileTree.emptyText" ? t : "No results found.";
|
|
138
139
|
});
|
|
139
|
-
return (t, l) => (
|
|
140
|
+
return (t, l) => (p(), k("div", {
|
|
140
141
|
class: $(["w-full h-full overflow-y-auto file-tree-container", s.class])
|
|
141
142
|
}, [
|
|
142
|
-
M.value.length > 0 ? (
|
|
143
|
-
const c = [e,
|
|
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];
|
|
144
145
|
if (n && n.key === e.id && z(n, c)) return n;
|
|
145
|
-
const r = (
|
|
146
|
+
const r = (p(), F(G, {
|
|
146
147
|
key: e.id,
|
|
147
148
|
node: e,
|
|
148
149
|
"selection-mode": o.selectionMode,
|
|
149
|
-
"selected-keys":
|
|
150
|
+
"selected-keys": y.value,
|
|
150
151
|
"expanded-keys": u.value,
|
|
151
|
-
"indeterminate-keys":
|
|
152
|
+
"indeterminate-keys": S.value,
|
|
152
153
|
"loading-keys": f.value,
|
|
153
154
|
"show-checkboxes": o.showCheckboxes,
|
|
154
155
|
"highlight-search": o.highlightSearch,
|
|
155
156
|
"search-query": o.searchQuery,
|
|
156
157
|
variant: o.variant,
|
|
158
|
+
"max-label-length": o.maxLabelLength,
|
|
157
159
|
onToggleExpand: D,
|
|
158
160
|
onToggleSelect: K,
|
|
159
161
|
onClickNode: l[0] || (l[0] = (d) => m("node-click", d))
|
|
@@ -165,9 +167,9 @@ const H = {
|
|
|
165
167
|
]),
|
|
166
168
|
key: "0"
|
|
167
169
|
} : void 0
|
|
168
|
-
]), 1032, ["node", "selection-mode", "selected-keys", "expanded-keys", "indeterminate-keys", "loading-keys", "show-checkboxes", "highlight-search", "search-query", "variant"]));
|
|
170
|
+
]), 1032, ["node", "selection-mode", "selected-keys", "expanded-keys", "indeterminate-keys", "loading-keys", "show-checkboxes", "highlight-search", "search-query", "variant", "max-label-length"]));
|
|
169
171
|
return r.memo = c, r;
|
|
170
|
-
}, l, 1), 128)) : (
|
|
172
|
+
}, l, 1), 128)) : (p(), k("div", H, j(B.value), 1))
|
|
171
173
|
], 2));
|
|
172
174
|
}
|
|
173
175
|
});
|
|
@@ -11,6 +11,7 @@ interface Props {
|
|
|
11
11
|
highlightSearch?: boolean;
|
|
12
12
|
searchQuery?: string;
|
|
13
13
|
variant?: FileTreeVariant;
|
|
14
|
+
maxLabelLength?: number;
|
|
14
15
|
}
|
|
15
16
|
declare function __VLS_template(): {
|
|
16
17
|
attrs: Partial<{}>;
|
|
@@ -38,6 +39,7 @@ declare const __VLS_component: import('vue').DefineComponent<Props, {}, {}, {},
|
|
|
38
39
|
selectionMode: FileTreeSelectionMode;
|
|
39
40
|
showCheckboxes: boolean;
|
|
40
41
|
highlightSearch: boolean;
|
|
42
|
+
maxLabelLength: number;
|
|
41
43
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
42
44
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
43
45
|
export default _default;
|