vlite3 1.3.2 → 1.3.4
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/Button.vue.js +36 -36
- package/components/CategoryManager/CategoryManager.vue2.js +1 -1
- package/components/ColorPicker/ColorIro.vue3.js +2 -2
- package/components/ColorPicker/ColorPicker.vue.js +2 -2
- package/components/DataTable/DataTable.vue.d.ts +1 -1
- package/components/Dropdown/DropdownMenu.vue.js +2 -2
- package/components/Dropdown/DropdownMenu.vue2.js +18 -18
- package/components/FileTree/FileTree.vue.d.ts +17 -1
- package/components/FileTree/FileTree.vue.js +1 -1
- package/components/FileTree/FileTree.vue2.js +54 -44
- package/components/FileTree/FileTreeNode.vue.d.ts +22 -2
- package/components/FileTree/FileTreeNode.vue.js +119 -94
- package/components/FileTree/types.d.ts +2 -0
- package/components/Form/FormField.vue.js +5 -4
- package/components/Form/FormFields.vue.js +2 -2
- package/components/Form/FormFields.vue2.js +46 -46
- package/components/Pagination/Pagination.vue.d.ts +1 -0
- package/components/Pagination/Pagination.vue.js +121 -119
- package/components/Pagination/index.d.ts +1 -0
- package/components/Persona.vue.js +134 -0
- package/components/Persona.vue2.js +4 -0
- package/components/Screen/Screen.vue.js +3 -2
- package/components/Screen/ScreenFilter.vue.js +1 -1
- package/components/Stats/Stats.vue3.js +5 -0
- package/components/Switch.vue.d.ts +3 -0
- package/components/Switch.vue.js +13 -9
- package/components/Tabes/Tabes.vue.js +2 -2
- package/index.d.ts +1 -0
- package/index.js +382 -379
- package/package.json +1 -1
- package/style.css +30 -12
- package/components/Stats/Stats.vue2.js +0 -4
- /package/components/ColorPicker/{ColorIro.vue.js → ColorIro.vue2.js} +0 -0
package/components/Button.vue.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent as L, useAttrs as N, computed as
|
|
2
|
-
import
|
|
1
|
+
import { defineComponent as L, useAttrs as N, computed as r, useSlots as G, Comment as F, Fragment as b, Text as H, withDirectives as M, openBlock as i, createElementBlock as c, normalizeClass as a, createElementVNode as I, createBlock as x, createCommentVNode as u, renderSlot as w, createTextVNode as k, toDisplayString as h, unref as O } from "vue";
|
|
2
|
+
import v from "./Icon.vue.js";
|
|
3
3
|
import { vRipple as Z } from "../directives/vRipple.js";
|
|
4
4
|
import { $t as q } from "../utils/i18n.js";
|
|
5
5
|
const J = ["type", "disabled", "data-testid"], K = {
|
|
@@ -52,23 +52,23 @@ const J = ["type", "disabled", "data-testid"], K = {
|
|
|
52
52
|
"outline-warning": "bg-warning/10 text-warning",
|
|
53
53
|
"outline-info": "bg-info/10 text-info",
|
|
54
54
|
"outline-success": "bg-success/10 text-success",
|
|
55
|
-
ghost: "bg-
|
|
55
|
+
ghost: "bg-secondary text-foreground",
|
|
56
56
|
link: "bg-primary/10 text-primary",
|
|
57
57
|
transparent: "bg-muted text-foreground"
|
|
58
|
-
}, e = t, B = N(), o =
|
|
58
|
+
}, e = t, B = N(), o = r(() => {
|
|
59
59
|
const n = e.layout || B.layout;
|
|
60
60
|
return n === "tile" ? "tile" : n === "vertical" ? "vertical" : "horizontal";
|
|
61
|
-
}),
|
|
61
|
+
}), f = r(() => o.value === "tile"), R = r(() => $[e.variant] ?? $.primary), C = r(() => ({
|
|
62
62
|
xs: "w-9 h-9",
|
|
63
63
|
sm: "w-10 h-10",
|
|
64
64
|
sm2: "w-11 h-11",
|
|
65
65
|
md: "w-12 h-12",
|
|
66
66
|
lg: "w-14 h-14",
|
|
67
67
|
xl: "w-16 h-16"
|
|
68
|
-
})[e.size]), l =
|
|
69
|
-
() => e?.asIcon || e.icon && !l.value && !
|
|
70
|
-
), g =
|
|
71
|
-
const s = `inline-flex items-center justify-center whitespace-nowrap text-sm font-medium disabled:pointer-events-none disabled:opacity-50 active:scale-[0.98] cursor-pointer ${o.value === "tile" ? "flex-col gap-1.5 items-center" : o.value === "vertical" ? "flex-col gap-2" : e.description ? "gap-3" : "gap-2"} ${y.value ? "icon-only shrink-0" : ""}`, z = {
|
|
68
|
+
})[e.size]), l = r(() => e.textI18n ? q(e.textI18n) : e.text), j = G(), p = r(() => j.default ? j.default().some((s) => !(s.type === F || s.type === b && Array.isArray(s.children) && s.children.length === 0 || s.type === H && typeof s.children == "string" && s.children.trim() === "")) : !1), y = r(
|
|
69
|
+
() => e?.asIcon || e.icon && !l.value && !p.value
|
|
70
|
+
), g = r(() => e.icon ? e.icon.startsWith("http://") || e.icon.startsWith("https://") || e.icon.startsWith("data:image/") ? !0 : [".png", ".jpg", ".jpeg", ".gif", ".svg", ".webp", ".ico", ".avif"].some((s) => e.icon.toLowerCase().endsWith(s)) : !1), A = r(() => {
|
|
71
|
+
const s = `inline-flex items-center justify-center whitespace-nowrap text-sm font-medium disabled:pointer-events-none disabled:opacity-50 active:scale-[0.98] cursor-pointer focus:outline-none focus-visible:outline-none ${o.value === "tile" ? "flex-col gap-1.5 items-center" : o.value === "vertical" ? "flex-col gap-2" : e.description ? "gap-3" : "gap-2"} ${y.value ? "icon-only shrink-0" : ""}`, z = {
|
|
72
72
|
primary: "bg-primary text-primary-foreground hover:bg-primary/90",
|
|
73
73
|
"primary-light": "bg-primary-light text-primary-fg-light hover:bg-primary/15",
|
|
74
74
|
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
@@ -87,7 +87,7 @@ const J = ["type", "disabled", "data-testid"], K = {
|
|
|
87
87
|
"outline-warning": "border border-warning text-warning hover:bg-warning/10",
|
|
88
88
|
"outline-info": "border border-info text-info hover:bg-info/10",
|
|
89
89
|
"outline-success": "border border-success text-success hover:bg-success/10",
|
|
90
|
-
ghost: "hover:bg-
|
|
90
|
+
ghost: "hover:bg-secondary hover:text-foreground text-foreground",
|
|
91
91
|
link: "text-primary underline-offset-4 hover:underline",
|
|
92
92
|
transparent: ""
|
|
93
93
|
}, d = {
|
|
@@ -130,12 +130,12 @@ const J = ["type", "disabled", "data-testid"], K = {
|
|
|
130
130
|
lg: "h-auto py-3 px-4 min-w-28",
|
|
131
131
|
xl: "h-auto py-4 px-10 min-w-32"
|
|
132
132
|
}[e.size]);
|
|
133
|
-
const W =
|
|
133
|
+
const W = f.value ? "group text-foreground focus:outline-none focus-visible:outline-none active:scale-100!" : z[e.variant];
|
|
134
134
|
return [s, W, V[e.rounded], S, e.class].join(
|
|
135
135
|
" "
|
|
136
136
|
);
|
|
137
|
-
}),
|
|
138
|
-
if (
|
|
137
|
+
}), m = r(() => {
|
|
138
|
+
if (f.value && g.value)
|
|
139
139
|
return `${C.value} object-cover`;
|
|
140
140
|
const n = e.description && o.value === "horizontal", s = {
|
|
141
141
|
xs: n ? "w-3.5 h-3.5" : "w-3 h-3",
|
|
@@ -153,37 +153,37 @@ const J = ["type", "disabled", "data-testid"], K = {
|
|
|
153
153
|
xl: "w-4 h-4"
|
|
154
154
|
};
|
|
155
155
|
let d = y.value ? z[e.size] : s[e.size];
|
|
156
|
-
return g.value && (d += " object-cover"),
|
|
157
|
-
}), E =
|
|
156
|
+
return g.value && (d += " object-cover"), f.value ? d += " scale-[1.45]!" : o.value === "vertical" && (d += " scale-[1.35]! mt-1"), d;
|
|
157
|
+
}), E = r(() => o.value === "vertical" ? "scale-[0.9]" : "");
|
|
158
158
|
return (n, s) => M((i(), c("button", {
|
|
159
159
|
type: t.type,
|
|
160
|
-
class:
|
|
160
|
+
class: a([A.value, "cursor-pointer"]),
|
|
161
161
|
disabled: t.disabled || t.loading,
|
|
162
162
|
"data-testid": n.$attrs["data-testid"] || (l.value ? `btn-${l.value.toString().toLowerCase().replace(/[^a-z0-9]+/g, "-")}` : t.icon ? `btn-${t.icon.replace(/[^a-zA-Z0-9]+/g, "-")}` : "button")
|
|
163
163
|
}, [
|
|
164
|
-
|
|
164
|
+
f.value ? (i(), c(b, { key: 0 }, [
|
|
165
165
|
I("span", {
|
|
166
|
-
class:
|
|
166
|
+
class: a(["inline-flex items-center justify-center shrink-0 transition-transform duration-150 ease-out group-active:scale-[0.92]", [
|
|
167
167
|
g.value ? "" : "rounded-full",
|
|
168
168
|
g.value ? "" : R.value,
|
|
169
169
|
g.value ? "" : C.value
|
|
170
170
|
]])
|
|
171
171
|
}, [
|
|
172
|
-
t.loading ? (i(), x(
|
|
172
|
+
t.loading ? (i(), x(v, {
|
|
173
173
|
key: 0,
|
|
174
174
|
icon: "lucide:loader-2",
|
|
175
|
-
class:
|
|
176
|
-
}, null, 8, ["class"])) : t.icon ? (i(), x(
|
|
175
|
+
class: a(["animate-spin pointer-events-none", [m.value, g.value ? C.value : ""]])
|
|
176
|
+
}, null, 8, ["class"])) : t.icon ? (i(), x(v, {
|
|
177
177
|
key: 1,
|
|
178
178
|
icon: t.icon,
|
|
179
|
-
class:
|
|
179
|
+
class: a(["pointer-events-none", [t.iconClass, m.value]])
|
|
180
180
|
}, null, 8, ["icon", "class"])) : u("", !0)
|
|
181
181
|
], 2),
|
|
182
|
-
l.value ||
|
|
182
|
+
l.value || p.value || e.description ? (i(), c("span", {
|
|
183
183
|
key: 0,
|
|
184
|
-
class:
|
|
184
|
+
class: a(["flex flex-col items-center max-w-full", t.textClass])
|
|
185
185
|
}, [
|
|
186
|
-
l.value ||
|
|
186
|
+
l.value || p.value ? (i(), c("span", K, [
|
|
187
187
|
w(n.$slots, "default", {}, () => [
|
|
188
188
|
k(h(l.value), 1)
|
|
189
189
|
])
|
|
@@ -191,19 +191,19 @@ const J = ["type", "disabled", "data-testid"], K = {
|
|
|
191
191
|
e.description ? (i(), c("span", P, h(e.description), 1)) : u("", !0)
|
|
192
192
|
], 2)) : u("", !0)
|
|
193
193
|
], 64)) : (i(), c(b, { key: 1 }, [
|
|
194
|
-
t.loading ? (i(), x(
|
|
194
|
+
t.loading ? (i(), x(v, {
|
|
195
195
|
key: 0,
|
|
196
196
|
icon: "lucide:loader-2",
|
|
197
|
-
class:
|
|
198
|
-
}, null, 8, ["class"])) : t.icon ? (i(), x(
|
|
197
|
+
class: a(["animate-spin pointer-events-none shrink-0", m.value])
|
|
198
|
+
}, null, 8, ["class"])) : t.icon ? (i(), x(v, {
|
|
199
199
|
key: 1,
|
|
200
200
|
icon: t.icon,
|
|
201
|
-
class:
|
|
201
|
+
class: a(["pointer-events-none shrink-0", [t.iconClass, m.value, y.value ? "mx-auto" : ""]])
|
|
202
202
|
}, null, 8, ["icon", "class"])) : u("", !0),
|
|
203
203
|
!e.description && o.value === "horizontal" ? (i(), c(b, { key: 2 }, [
|
|
204
204
|
t.textClass ? (i(), c("div", {
|
|
205
205
|
key: 0,
|
|
206
|
-
class:
|
|
206
|
+
class: a([t.textClass, "leading-tight truncate inline-flex items-center justify-center gap-1.5"])
|
|
207
207
|
}, [
|
|
208
208
|
w(n.$slots, "default", {}, () => [
|
|
209
209
|
k(h(l.value), 1)
|
|
@@ -211,15 +211,15 @@ const J = ["type", "disabled", "data-testid"], K = {
|
|
|
211
211
|
], 2)) : w(n.$slots, "default", { key: 1 }, () => [
|
|
212
212
|
k(h(l.value), 1)
|
|
213
213
|
])
|
|
214
|
-
], 64)) : l.value ||
|
|
214
|
+
], 64)) : l.value || p.value || e.description ? (i(), c("div", {
|
|
215
215
|
key: 3,
|
|
216
|
-
class:
|
|
216
|
+
class: a(["flex flex-col justify-center", [
|
|
217
217
|
o.value === "vertical" ? "items-center text-center" : e.description ? "items-start text-left" : "items-center text-center",
|
|
218
218
|
!t.icon && !t.iconRight && !t.loading ? "flex-1 w-full" : ""
|
|
219
219
|
]])
|
|
220
220
|
}, [
|
|
221
221
|
I("div", {
|
|
222
|
-
class:
|
|
222
|
+
class: a([[t.textClass, E.value], "inline-flex items-center gap-1.5 w-full leading-tight [&>:where(svg)]:mx-auto [&>:where(img)]:mx-auto"])
|
|
223
223
|
}, [
|
|
224
224
|
w(n.$slots, "default", {}, () => [
|
|
225
225
|
k(h(l.value), 1)
|
|
@@ -227,14 +227,14 @@ const J = ["type", "disabled", "data-testid"], K = {
|
|
|
227
227
|
], 2),
|
|
228
228
|
e.description ? (i(), c("span", Q, h(e.description), 1)) : u("", !0)
|
|
229
229
|
], 2)) : u("", !0),
|
|
230
|
-
t.iconRight && !t.loading ? (i(), x(
|
|
230
|
+
t.iconRight && !t.loading ? (i(), x(v, {
|
|
231
231
|
key: 4,
|
|
232
232
|
icon: t.iconRight,
|
|
233
|
-
class:
|
|
233
|
+
class: a([[t.iconRightClass, m.value], "h-4 w-4 pointer-events-none shrink-0"])
|
|
234
234
|
}, null, 8, ["icon", "class"])) : u("", !0)
|
|
235
235
|
], 64))
|
|
236
236
|
], 10, J)), [
|
|
237
|
-
[O(Z), !
|
|
237
|
+
[O(Z), !f.value]
|
|
238
238
|
]);
|
|
239
239
|
}
|
|
240
240
|
});
|
|
@@ -6,8 +6,8 @@ import O from "../Input.vue.js";
|
|
|
6
6
|
import "../../core/config.js";
|
|
7
7
|
/* empty css */
|
|
8
8
|
import y from "../Button.vue.js";
|
|
9
|
-
import E from "./ColorIro.
|
|
10
|
-
/* empty css
|
|
9
|
+
import E from "./ColorIro.vue2.js";
|
|
10
|
+
/* empty css */
|
|
11
11
|
import { useEyeDropper as P } from "@vueuse/core";
|
|
12
12
|
const I = {
|
|
13
13
|
key: 0,
|
|
@@ -40,11 +40,11 @@ declare const __VLS_component: import('vue').DefineComponent<DataTableProps, {},
|
|
|
40
40
|
selectedRows: any[];
|
|
41
41
|
hideSelectable: boolean;
|
|
42
42
|
paginationProps: import('./types').DataTablePaginationProps;
|
|
43
|
+
bordered: boolean;
|
|
43
44
|
showPagination: boolean;
|
|
44
45
|
cellBordered: boolean;
|
|
45
46
|
keyField: string;
|
|
46
47
|
hoverable: boolean;
|
|
47
|
-
bordered: boolean;
|
|
48
48
|
sortable: boolean;
|
|
49
49
|
headerVariant: "default" | "minimal";
|
|
50
50
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
@@ -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 _ = /* @__PURE__ */ r(o, [["__scopeId", "data-v-d7105497"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
_ as default
|
|
7
7
|
};
|
|
@@ -53,18 +53,18 @@ 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), c = j(""), { getMenuId: z, getAllRecursiveIds: H } = me(), L = y(() => {
|
|
57
|
+
if (c.value && c.value.trim() !== "")
|
|
58
58
|
return t.searchEmptyMessage ? t.searchEmptyMessage : `No results found for
|
|
59
|
-
"${
|
|
59
|
+
"${c.value}"`;
|
|
60
60
|
const e = $("vlite.dropdown.empty");
|
|
61
61
|
return e !== "vlite.dropdown.empty" ? e : t.emptyMessage;
|
|
62
62
|
}), R = y(() => {
|
|
63
63
|
const e = $("vlite.dropdown.search");
|
|
64
64
|
return e !== "vlite.dropdown.search" ? e : "Search...";
|
|
65
|
-
}), f = y(() => t.options ? t.options.map((e) => typeof e == "string" || typeof e == "number" ? { label: String(e), value: String(e) } : e) : []), B = y(() => t.searchable
|
|
65
|
+
}), f = y(() => t.options ? t.options.map((e) => typeof e == "string" || typeof e == "number" ? { label: String(e), value: String(e) } : e) : []), B = y(() => t.searchable ? t.remote || (f.value.length || 0) > 5 || c.value.length > 0 : !1);
|
|
66
66
|
let p = null;
|
|
67
|
-
E(
|
|
67
|
+
E(c, (e) => {
|
|
68
68
|
t.remote && (p && clearTimeout(p), p = setTimeout(() => {
|
|
69
69
|
e !== void 0 && m("search", e);
|
|
70
70
|
}, t.debounceTime));
|
|
@@ -84,11 +84,11 @@ const ve = ["dir"], ye = {
|
|
|
84
84
|
scrollToIndex: K
|
|
85
85
|
} = fe({
|
|
86
86
|
options: f,
|
|
87
|
-
searchQuery:
|
|
87
|
+
searchQuery: c,
|
|
88
88
|
containerRef: _,
|
|
89
89
|
emit: (e, ...s) => m(e, ...s),
|
|
90
90
|
handleSelect: (e, s) => x(e)
|
|
91
|
-
}), v = y(() => t.remote ?
|
|
91
|
+
}), v = y(() => t.remote ? c.value ? f.value : t.cachedOptions.length ? t.cachedOptions : f.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) => {
|
|
@@ -105,13 +105,13 @@ const ve = ["dir"], ye = {
|
|
|
105
105
|
}, Q = (e, s) => {
|
|
106
106
|
let l = s.value;
|
|
107
107
|
e.key && (l = { [e.key]: l });
|
|
108
|
-
const n = s.option,
|
|
108
|
+
const n = s.option, d = n?._path || [n?._originalOption || n].filter(Boolean), Z = {
|
|
109
109
|
label: e.label,
|
|
110
110
|
value: l,
|
|
111
111
|
data: s.data,
|
|
112
112
|
key: e.key,
|
|
113
113
|
_originalOption: n?._originalOption || n,
|
|
114
|
-
_path: [e, ...
|
|
114
|
+
_path: [e, ...d]
|
|
115
115
|
};
|
|
116
116
|
m("select", Z);
|
|
117
117
|
}, W = async () => {
|
|
@@ -136,8 +136,8 @@ const ve = ["dir"], ye = {
|
|
|
136
136
|
}, [
|
|
137
137
|
B.value ? (o(), i("div", ye, [
|
|
138
138
|
O(ie, {
|
|
139
|
-
modelValue:
|
|
140
|
-
"onUpdate:modelValue": s[0] || (s[0] = (l) =>
|
|
139
|
+
modelValue: c.value,
|
|
140
|
+
"onUpdate:modelValue": s[0] || (s[0] = (l) => c.value = l),
|
|
141
141
|
placeholder: R.value,
|
|
142
142
|
icon: "lucide:search",
|
|
143
143
|
size: "sm",
|
|
@@ -189,7 +189,7 @@ const ve = ["dir"], ye = {
|
|
|
189
189
|
value: G(l),
|
|
190
190
|
focused: r(M) && r(g) === n,
|
|
191
191
|
onChange: J,
|
|
192
|
-
onMouseenter: (
|
|
192
|
+
onMouseenter: (d) => r(S)(n)
|
|
193
193
|
}, null, 8, ["option", "value", "focused", "onMouseenter"])) : l.children && l.children.length > 0 ? (o(), h(he, {
|
|
194
194
|
key: 2,
|
|
195
195
|
"is-nested": !0,
|
|
@@ -204,7 +204,7 @@ const ve = ["dir"], ye = {
|
|
|
204
204
|
selectable: t.selectable,
|
|
205
205
|
ignoreClickOutside: r(H)(l.children),
|
|
206
206
|
direction: a.direction,
|
|
207
|
-
onOnSelect: (
|
|
207
|
+
onOnSelect: (d) => Q(l, d)
|
|
208
208
|
}, {
|
|
209
209
|
trigger: V(() => [
|
|
210
210
|
k("div", {
|
|
@@ -215,7 +215,7 @@ const ve = ["dir"], ye = {
|
|
|
215
215
|
l.disabled ? "opacity-50 cursor-not-allowed" : "",
|
|
216
216
|
l.triggerClass || l.class || ""
|
|
217
217
|
]]),
|
|
218
|
-
onMouseenter: (
|
|
218
|
+
onMouseenter: (d) => r(S)(n)
|
|
219
219
|
}, [
|
|
220
220
|
k("div", xe, [
|
|
221
221
|
l.icon || l.emoji ? (o(), h(w, {
|
|
@@ -241,13 +241,13 @@ const ve = ["dir"], ye = {
|
|
|
241
241
|
selected: q(l),
|
|
242
242
|
focused: r(M) && r(g) === n,
|
|
243
243
|
selectable: a.selectable,
|
|
244
|
-
onClick: (
|
|
245
|
-
onMouseenter: (
|
|
244
|
+
onClick: (d) => x(l),
|
|
245
|
+
onMouseenter: (d) => r(S)(n)
|
|
246
246
|
}, ne({ _: 2 }, [
|
|
247
247
|
e.$slots.item ? {
|
|
248
248
|
name: "default",
|
|
249
|
-
fn: V((
|
|
250
|
-
b(e.$slots, "item", re({ ref_for: !0 },
|
|
249
|
+
fn: V((d) => [
|
|
250
|
+
b(e.$slots, "item", re({ ref_for: !0 }, d), void 0, !0)
|
|
251
251
|
]),
|
|
252
252
|
key: "0"
|
|
253
253
|
} : void 0
|
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
import { FileNode, FileTreeProps } from './types';
|
|
2
|
-
declare
|
|
2
|
+
declare function __VLS_template(): {
|
|
3
|
+
attrs: Partial<{}>;
|
|
4
|
+
slots: {
|
|
5
|
+
actions?(_: any): any;
|
|
6
|
+
};
|
|
7
|
+
refs: {};
|
|
8
|
+
rootEl: HTMLDivElement;
|
|
9
|
+
};
|
|
10
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
11
|
+
declare const __VLS_component: import('vue').DefineComponent<FileTreeProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
3
12
|
select: (node: FileNode, selected: boolean) => any;
|
|
4
13
|
"update:modelValue": (keys: string[]) => any;
|
|
5
14
|
expand: (node: FileNode, expanded: boolean) => any;
|
|
@@ -11,10 +20,17 @@ declare const _default: import('vue').DefineComponent<FileTreeProps, {}, {}, {},
|
|
|
11
20
|
"onNode-click"?: (node: FileNode) => any;
|
|
12
21
|
}>, {
|
|
13
22
|
data: FileNode[];
|
|
23
|
+
variant: import('./types').FileTreeVariant;
|
|
14
24
|
modelValue: string[];
|
|
15
25
|
selectionMode: import('./types').FileTreeSelectionMode;
|
|
16
26
|
showCheckboxes: boolean;
|
|
17
27
|
highlightSearch: boolean;
|
|
18
28
|
defaultExpandedKeys: string[];
|
|
19
29
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
|
|
30
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
20
31
|
export default _default;
|
|
32
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
33
|
+
new (): {
|
|
34
|
+
$slots: S;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./FileTree.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import e from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const p = /* @__PURE__ */ e(o, [["__scopeId", "data-v-
|
|
4
|
+
const p = /* @__PURE__ */ e(o, [["__scopeId", "data-v-ed4297b9"]]);
|
|
5
5
|
export {
|
|
6
6
|
p as default
|
|
7
7
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { defineComponent as Q, ref as E, shallowRef as T, watch as C, computed as
|
|
2
|
-
import
|
|
1
|
+
import { defineComponent as Q, ref as E, shallowRef as T, watch as C, computed as v, openBlock as g, createElementBlock as x, 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
3
|
import { $t as w } from "../../utils/i18n.js";
|
|
4
|
-
const
|
|
4
|
+
const H = {
|
|
5
5
|
key: 1,
|
|
6
6
|
class: "text-sm text-muted-foreground p-4 text-center"
|
|
7
|
-
},
|
|
7
|
+
}, Y = /* @__PURE__ */ Q({
|
|
8
8
|
__name: "FileTree",
|
|
9
9
|
props: {
|
|
10
10
|
modelValue: { default: () => [] },
|
|
@@ -17,16 +17,17 @@ const R = {
|
|
|
17
17
|
searchQuery: {},
|
|
18
18
|
class: {},
|
|
19
19
|
emptyText: {},
|
|
20
|
-
emptyTextI18n: {}
|
|
20
|
+
emptyTextI18n: {},
|
|
21
|
+
variant: { default: "default" }
|
|
21
22
|
},
|
|
22
23
|
emits: ["update:modelValue", "select", "expand", "node-click"],
|
|
23
|
-
setup(
|
|
24
|
-
const s =
|
|
24
|
+
setup(o, { emit: L }) {
|
|
25
|
+
const s = o, m = L, u = E(new Set(s.defaultExpandedKeys)), f = E(/* @__PURE__ */ new Set()), y = T(/* @__PURE__ */ new Map()), S = T(/* @__PURE__ */ new Map()), I = (t, l) => {
|
|
25
26
|
const e = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), a = (n, c) => {
|
|
26
27
|
for (const r of n)
|
|
27
28
|
e.set(r.id, r), c && i.set(r.id, c), r.children && a(r.children, r.id);
|
|
28
29
|
};
|
|
29
|
-
a(t, l),
|
|
30
|
+
a(t, l), y.value = e, S.value = i;
|
|
30
31
|
};
|
|
31
32
|
C(
|
|
32
33
|
() => s.data,
|
|
@@ -35,18 +36,18 @@ const R = {
|
|
|
35
36
|
},
|
|
36
37
|
{ immediate: !0, deep: !0 }
|
|
37
38
|
);
|
|
38
|
-
const
|
|
39
|
+
const k = (t) => {
|
|
39
40
|
let l = [];
|
|
40
41
|
if (t.children)
|
|
41
42
|
for (const e of t.children)
|
|
42
|
-
l.push(e.id), l = l.concat(
|
|
43
|
+
l.push(e.id), l = l.concat(k(e));
|
|
43
44
|
return l;
|
|
44
|
-
},
|
|
45
|
+
}, p = v(() => new Set(s.modelValue)), b = v(() => {
|
|
45
46
|
const t = /* @__PURE__ */ new Set();
|
|
46
47
|
if (s.selectionMode !== "multiple") return t;
|
|
47
48
|
const l = (e) => {
|
|
48
49
|
if (!e.children || e.children.length === 0)
|
|
49
|
-
return
|
|
50
|
+
return p.value.has(e.id) ? { status: "checked" } : { status: "unchecked" };
|
|
50
51
|
let i = !1, a = !1, n = !1;
|
|
51
52
|
for (const c of e.children) {
|
|
52
53
|
const r = l(c);
|
|
@@ -57,14 +58,14 @@ const R = {
|
|
|
57
58
|
return s.data.forEach(l), t;
|
|
58
59
|
}), D = async (t) => {
|
|
59
60
|
if (t.disabled) return;
|
|
60
|
-
if (
|
|
61
|
-
const e = new Set(
|
|
61
|
+
if (u.value.has(t.id)) {
|
|
62
|
+
const e = new Set(u.value);
|
|
62
63
|
e.delete(t.id);
|
|
63
|
-
const i =
|
|
64
|
-
|
|
64
|
+
const i = y.value.get(t.id) || t;
|
|
65
|
+
k(i).forEach((n) => e.delete(n)), u.value = e, m("expand", t, !1);
|
|
65
66
|
} else {
|
|
66
|
-
const e = new Set(
|
|
67
|
-
if (e.add(t.id),
|
|
67
|
+
const e = new Set(u.value);
|
|
68
|
+
if (e.add(t.id), u.value = e, m("expand", t, !0), s.loadData && !t.isLoaded && (!t.children || t.children.length === 0)) {
|
|
68
69
|
const i = new Set(f.value);
|
|
69
70
|
i.add(t.id), f.value = i;
|
|
70
71
|
try {
|
|
@@ -77,27 +78,27 @@ const R = {
|
|
|
77
78
|
}
|
|
78
79
|
}, K = (t) => {
|
|
79
80
|
if (t.disabled) return;
|
|
80
|
-
const l =
|
|
81
|
-
let e = new Set(
|
|
81
|
+
const l = y.value.get(t.id) || t;
|
|
82
|
+
let e = new Set(p.value);
|
|
82
83
|
const i = e.has(t.id);
|
|
83
84
|
if (s.selectionMode === "single")
|
|
84
85
|
e.clear(), i || e.add(t.id);
|
|
85
86
|
else if (s.selectionMode === "multiple") {
|
|
86
|
-
const a =
|
|
87
|
-
|
|
87
|
+
const a = k(l), n = !i, c = (d, h) => {
|
|
88
|
+
h ? e.add(d) : e.delete(d);
|
|
88
89
|
};
|
|
89
90
|
c(t.id, n), a.forEach((d) => c(d, n));
|
|
90
91
|
let r = l;
|
|
91
92
|
for (; ; ) {
|
|
92
93
|
const d = S.value.get(r.id);
|
|
93
94
|
if (!d) break;
|
|
94
|
-
const
|
|
95
|
-
if (!
|
|
96
|
-
|
|
95
|
+
const h = y.value.get(d);
|
|
96
|
+
if (!h || !h.children) break;
|
|
97
|
+
h.children.every((N) => e.has(N.id)) ? e.add(h.id) : e.delete(h.id), r = h;
|
|
97
98
|
}
|
|
98
99
|
}
|
|
99
100
|
m("update:modelValue", Array.from(e)), m("select", l, !i);
|
|
100
|
-
}, M =
|
|
101
|
+
}, M = v(() => {
|
|
101
102
|
if (!s.searchQuery) return s.data;
|
|
102
103
|
const t = s.searchQuery.toLowerCase(), l = (e) => {
|
|
103
104
|
const a = (e.labelI18n ? w(e.labelI18n) : e.label).toLowerCase().includes(t), n = !!e.searchMatch;
|
|
@@ -122,45 +123,54 @@ const R = {
|
|
|
122
123
|
return n && e.add(a.id), r || n;
|
|
123
124
|
};
|
|
124
125
|
if (s.data.forEach(i), e.size > 0) {
|
|
125
|
-
const a = new Set(
|
|
126
|
-
e.forEach((n) => a.add(n)),
|
|
126
|
+
const a = new Set(u.value);
|
|
127
|
+
e.forEach((n) => a.add(n)), u.value = a;
|
|
127
128
|
}
|
|
128
129
|
}
|
|
129
130
|
},
|
|
130
131
|
{ deep: !0 }
|
|
131
132
|
);
|
|
132
|
-
const B =
|
|
133
|
+
const B = v(() => {
|
|
133
134
|
if (s.emptyTextI18n) return w(s.emptyTextI18n);
|
|
134
135
|
if (s.emptyText) return s.emptyText;
|
|
135
136
|
const t = w("vlite.fileTree.emptyText");
|
|
136
137
|
return t !== "vlite.fileTree.emptyText" ? t : "No results found.";
|
|
137
138
|
});
|
|
138
|
-
return (t, l) => (
|
|
139
|
-
class:
|
|
139
|
+
return (t, l) => (g(), x("div", {
|
|
140
|
+
class: $(["w-full h-full overflow-y-auto file-tree-container", s.class])
|
|
140
141
|
}, [
|
|
141
|
-
M.value.length > 0 ? (
|
|
142
|
-
const c = [e,
|
|
143
|
-
if (n && n.key === e.id &&
|
|
144
|
-
const r = (
|
|
142
|
+
M.value.length > 0 ? (g(!0), x(q, { key: 0 }, V(M.value, (e, i, a, n) => {
|
|
143
|
+
const c = [e, p.value, u.value, b.value, f.value, o.highlightSearch, o.searchQuery, o.showCheckboxes, o.variant, !!t.$slots.actions];
|
|
144
|
+
if (n && n.key === e.id && z(n, c)) return n;
|
|
145
|
+
const r = (g(), F(G, {
|
|
145
146
|
key: e.id,
|
|
146
147
|
node: e,
|
|
147
|
-
"selection-mode":
|
|
148
|
-
"selected-keys":
|
|
149
|
-
"expanded-keys":
|
|
148
|
+
"selection-mode": o.selectionMode,
|
|
149
|
+
"selected-keys": p.value,
|
|
150
|
+
"expanded-keys": u.value,
|
|
150
151
|
"indeterminate-keys": b.value,
|
|
151
152
|
"loading-keys": f.value,
|
|
152
|
-
"show-checkboxes":
|
|
153
|
-
"highlight-search":
|
|
154
|
-
"search-query":
|
|
153
|
+
"show-checkboxes": o.showCheckboxes,
|
|
154
|
+
"highlight-search": o.highlightSearch,
|
|
155
|
+
"search-query": o.searchQuery,
|
|
156
|
+
variant: o.variant,
|
|
155
157
|
onToggleExpand: D,
|
|
156
158
|
onToggleSelect: K,
|
|
157
159
|
onClickNode: l[0] || (l[0] = (d) => m("node-click", d))
|
|
158
|
-
},
|
|
160
|
+
}, P({ _: 2 }, [
|
|
161
|
+
t.$slots.actions ? {
|
|
162
|
+
name: "actions",
|
|
163
|
+
fn: A((d) => [
|
|
164
|
+
R(t.$slots, "actions", U({ ref_for: !0 }, d), void 0, !0)
|
|
165
|
+
]),
|
|
166
|
+
key: "0"
|
|
167
|
+
} : void 0
|
|
168
|
+
]), 1032, ["node", "selection-mode", "selected-keys", "expanded-keys", "indeterminate-keys", "loading-keys", "show-checkboxes", "highlight-search", "search-query", "variant"]));
|
|
159
169
|
return r.memo = c, r;
|
|
160
|
-
}, l, 1), 128)) : (
|
|
170
|
+
}, l, 1), 128)) : (g(), x("div", H, j(B.value), 1))
|
|
161
171
|
], 2));
|
|
162
172
|
}
|
|
163
173
|
});
|
|
164
174
|
export {
|
|
165
|
-
|
|
175
|
+
Y as default
|
|
166
176
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FileNode, FileTreeSelectionMode } from './types';
|
|
1
|
+
import { FileNode, FileTreeSelectionMode, FileTreeVariant } from './types';
|
|
2
2
|
interface Props {
|
|
3
3
|
node: FileNode;
|
|
4
4
|
depth?: number;
|
|
@@ -10,8 +10,21 @@ interface Props {
|
|
|
10
10
|
showCheckboxes?: boolean;
|
|
11
11
|
highlightSearch?: boolean;
|
|
12
12
|
searchQuery?: string;
|
|
13
|
+
variant?: FileTreeVariant;
|
|
13
14
|
}
|
|
14
|
-
declare
|
|
15
|
+
declare function __VLS_template(): {
|
|
16
|
+
attrs: Partial<{}>;
|
|
17
|
+
slots: {
|
|
18
|
+
actions?(_: {
|
|
19
|
+
node: FileNode;
|
|
20
|
+
}): any;
|
|
21
|
+
actions?(_: any): any;
|
|
22
|
+
};
|
|
23
|
+
refs: {};
|
|
24
|
+
rootEl: HTMLDivElement;
|
|
25
|
+
};
|
|
26
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
27
|
+
declare const __VLS_component: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
15
28
|
"toggle-expand": (node: FileNode) => any;
|
|
16
29
|
"toggle-select": (node: FileNode) => any;
|
|
17
30
|
"click-node": (node: FileNode) => any;
|
|
@@ -20,9 +33,16 @@ declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, imp
|
|
|
20
33
|
"onToggle-select"?: (node: FileNode) => any;
|
|
21
34
|
"onClick-node"?: (node: FileNode) => any;
|
|
22
35
|
}>, {
|
|
36
|
+
variant: FileTreeVariant;
|
|
23
37
|
depth: number;
|
|
24
38
|
selectionMode: FileTreeSelectionMode;
|
|
25
39
|
showCheckboxes: boolean;
|
|
26
40
|
highlightSearch: boolean;
|
|
27
41
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
42
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
28
43
|
export default _default;
|
|
44
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
45
|
+
new (): {
|
|
46
|
+
$slots: S;
|
|
47
|
+
};
|
|
48
|
+
};
|