vlite3 1.5.27 → 1.5.29
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/Accordion/Accordion.vue.d.ts +8 -1
- package/components/Accordion/AccordionContent.vue.d.ts +8 -2
- package/components/Accordion/AccordionContent.vue.js +2 -2
- package/components/Accordion/AccordionContent2.vue.js +28 -40
- package/components/Accordion/AccordionItem.vue.d.ts +8 -1
- package/components/Accordion/AccordionItem.vue.js +86 -70
- package/components/Accordion/AccordionTrigger.vue.js +13 -12
- package/components/Badge.vue.d.ts +1 -1
- package/components/Beacon.vue.d.ts +1 -1
- package/components/Breadcrumb/Breadcrumb.vue.d.ts +1 -1
- package/components/Breadcrumb/BreadcrumbItem.vue.d.ts +1 -1
- package/components/Button.vue.d.ts +1 -1
- package/components/Button.vue.js +2 -2
- package/components/Button2.vue.js +1 -1
- package/components/Carousel/Carousel.vue.d.ts +4 -4
- package/components/Chart/CircleChart.vue.d.ts +1 -1
- package/components/Chart/GaugeChart.vue.d.ts +1 -1
- package/components/Chart/SpeedometerChart.vue.d.ts +1 -1
- package/components/Chip/Chip.vue.d.ts +1 -1
- package/components/ChoiceBox/ChoiceBox.vue.d.ts +1 -1
- package/components/Clipboard.vue.d.ts +1 -1
- package/components/ColorPicker/ColorPicker.vue.d.ts +1 -1
- package/components/DataList/DataList.vue.d.ts +1 -1
- package/components/DataTable/DataTable.vue.d.ts +1 -1
- package/components/DataTable/DataTable.vue.js +2 -2
- package/components/DataTable/DataTable2.vue.js +48 -50
- package/components/EditableTitle/EditableTitle.vue.d.ts +11 -11
- package/components/Empty/Empty.vue.d.ts +11 -2
- package/components/Empty/Empty.vue.js +57 -49
- package/components/Empty/index.d.ts +1 -1
- package/components/Empty/types.d.ts +13 -0
- package/components/Empty/types.js +8 -0
- package/components/Empty/variants/Variant1.vue.d.ts +4 -6
- package/components/Empty/variants/Variant1.vue.js +56 -20
- package/components/Empty/variants/Variant10.vue.d.ts +4 -6
- package/components/Empty/variants/Variant10.vue.js +68 -26
- package/components/Empty/variants/Variant11.vue.d.ts +4 -6
- package/components/Empty/variants/Variant11.vue.js +66 -18
- package/components/Empty/variants/Variant12.vue.d.ts +4 -6
- package/components/Empty/variants/Variant12.vue.js +67 -25
- package/components/Empty/variants/Variant2.vue.d.ts +4 -6
- package/components/Empty/variants/Variant2.vue.js +56 -20
- package/components/Empty/variants/Variant3.vue.d.ts +4 -6
- package/components/Empty/variants/Variant3.vue.js +41 -13
- package/components/Empty/variants/Variant4.vue.d.ts +4 -6
- package/components/Empty/variants/Variant4.vue.js +65 -21
- package/components/Empty/variants/Variant5.vue.d.ts +4 -6
- package/components/Empty/variants/Variant5.vue.js +55 -17
- package/components/Empty/variants/Variant6.vue.d.ts +4 -6
- package/components/Empty/variants/Variant6.vue.js +67 -23
- package/components/Empty/variants/Variant7.vue.d.ts +4 -6
- package/components/Empty/variants/Variant7.vue.js +81 -25
- package/components/Empty/variants/Variant8.vue.d.ts +4 -6
- package/components/Empty/variants/Variant8.vue.js +59 -23
- package/components/Empty/variants/Variant9.vue.d.ts +4 -6
- package/components/Empty/variants/Variant9.vue.js +64 -20
- package/components/FilePicker/index.vue.d.ts +1 -1
- package/components/FileTree/FileTree.vue.d.ts +2 -0
- package/components/FileTree/FileTree.vue.js +4 -4
- package/components/FileTree/FileTree2.vue.js +72 -66
- package/components/FileTree/FileTreeNode.vue.d.ts +9 -0
- package/components/FileTree/FileTreeNode.vue.js +100 -92
- package/components/FileTree/types.d.ts +12 -0
- package/components/Form/Form.vue.d.ts +1 -1
- package/components/Form/FormField.vue.d.ts +1 -1
- package/components/Form/FormFields.vue.d.ts +1 -1
- package/components/Form/TableView.vue.d.ts +1 -1
- package/components/Form/index.vue.d.ts +1 -1
- package/components/GoogleLogin.vue.d.ts +1 -1
- package/components/Input.vue.d.ts +1 -1
- package/components/Input.vue.js +2 -4
- package/components/MultiSelect/MultiSelect.vue.d.ts +1 -1
- package/components/Navbar/NavbarTabs.vue.d.ts +1 -1
- package/components/NumberInput.vue.d.ts +1 -1
- package/components/OTPInput/OTPInput.vue.d.ts +1 -1
- package/components/ProgressBar/ProgressBar.vue.d.ts +1 -1
- package/components/Screen/components/ScreenEmptyState.vue.js +12 -12
- package/components/Slider.vue.d.ts +1 -1
- package/components/Spinner/Spinner.vue.d.ts +1 -1
- package/components/Switch.vue.d.ts +1 -1
- package/components/Tabes/Tabes.vue.d.ts +1 -1
- package/components/TagInput/TagInput.vue.d.ts +6 -6
- package/components/Tooltip.vue.d.ts +1 -1
- package/core/config.d.ts +2 -2
- package/docs/components/accordion.md +35 -0
- package/docs/components/empty.md +38 -4
- package/docs/components/file-tree.md +67 -16
- package/docs-manifest.json +5 -5
- package/package.json +2 -2
- package/style.css +1 -1
|
@@ -1,33 +1,69 @@
|
|
|
1
|
-
import { defineComponent as r, openBlock as
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
class: "mt-6"
|
|
6
|
-
}, w = /* @__PURE__ */ r({
|
|
1
|
+
import { defineComponent as r, openBlock as c, createElementBlock as m, normalizeClass as i, unref as n, createVNode as l, createElementVNode as a, toDisplayString as d, renderSlot as x, createCommentVNode as u } from "vue";
|
|
2
|
+
import f from "../../Icon.vue.js";
|
|
3
|
+
import { EMPTY_SIZE_DEFAULT as e } from "../types.js";
|
|
4
|
+
const b = ["innerHTML"], k = /* @__PURE__ */ r({
|
|
7
5
|
__name: "Variant8",
|
|
8
6
|
props: {
|
|
9
7
|
title: {},
|
|
10
8
|
description: {},
|
|
11
|
-
icon: {}
|
|
9
|
+
icon: {},
|
|
10
|
+
size: { default: e }
|
|
12
11
|
},
|
|
13
|
-
setup(
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
12
|
+
setup(t) {
|
|
13
|
+
const o = {
|
|
14
|
+
xs: {
|
|
15
|
+
root: "p-4",
|
|
16
|
+
icon: "h-4 w-4 mb-2",
|
|
17
|
+
title: "mb-1 text-xs",
|
|
18
|
+
desc: "text-xs",
|
|
19
|
+
action: "mt-3"
|
|
20
|
+
},
|
|
21
|
+
sm: {
|
|
22
|
+
root: "p-6",
|
|
23
|
+
icon: "h-5 w-5 mb-3",
|
|
24
|
+
title: "mb-1 text-xs",
|
|
25
|
+
desc: "text-xs",
|
|
26
|
+
action: "mt-4"
|
|
27
|
+
},
|
|
28
|
+
md: {
|
|
29
|
+
root: "p-8",
|
|
30
|
+
icon: "h-6 w-6 mb-4",
|
|
31
|
+
title: "mb-1.5 text-sm",
|
|
32
|
+
desc: "text-sm",
|
|
33
|
+
action: "mt-6"
|
|
34
|
+
},
|
|
35
|
+
lg: {
|
|
36
|
+
root: "p-10",
|
|
37
|
+
icon: "h-8 w-8 mb-5",
|
|
38
|
+
title: "mb-2 text-base",
|
|
39
|
+
desc: "text-base",
|
|
40
|
+
action: "mt-7"
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
return (s, h) => (c(), m("div", {
|
|
44
|
+
class: i(["flex w-full flex-col items-center justify-center rounded-xl bg-background border shadow-xs max-w-md mx-auto text-center", o[t.size ?? n(e)].root])
|
|
45
|
+
}, [
|
|
46
|
+
l(f, {
|
|
47
|
+
icon: t.icon,
|
|
48
|
+
class: i(["text-foreground", o[t.size ?? n(e)].icon]),
|
|
18
49
|
"stroke-width": "1.5"
|
|
19
|
-
}, null, 8, ["icon"]),
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
50
|
+
}, null, 8, ["icon", "class"]),
|
|
51
|
+
a("h3", {
|
|
52
|
+
class: i(["font-medium text-foreground", o[t.size ?? n(e)].title])
|
|
53
|
+
}, d(t.title), 3),
|
|
54
|
+
a("p", {
|
|
55
|
+
class: i(["text-muted max-w-xs", o[t.size ?? n(e)].desc]),
|
|
56
|
+
innerHTML: t.description
|
|
57
|
+
}, null, 10, b),
|
|
58
|
+
s.$slots.action ? (c(), m("div", {
|
|
59
|
+
key: 0,
|
|
60
|
+
class: i(o[t.size ?? n(e)].action)
|
|
61
|
+
}, [
|
|
62
|
+
x(s.$slots, "action")
|
|
63
|
+
], 2)) : u("", !0)
|
|
64
|
+
], 2));
|
|
29
65
|
}
|
|
30
66
|
});
|
|
31
67
|
export {
|
|
32
|
-
|
|
68
|
+
k as default
|
|
33
69
|
};
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
title: string;
|
|
3
|
-
description: string;
|
|
4
|
-
icon: string;
|
|
5
|
-
};
|
|
1
|
+
import { EmptySize, EmptyVariantProps } from '../types';
|
|
6
2
|
declare function __VLS_template(): {
|
|
7
3
|
attrs: Partial<{}>;
|
|
8
4
|
slots: {
|
|
@@ -12,7 +8,9 @@ declare function __VLS_template(): {
|
|
|
12
8
|
rootEl: HTMLDivElement;
|
|
13
9
|
};
|
|
14
10
|
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
15
|
-
declare const __VLS_component: import('vue').DefineComponent<
|
|
11
|
+
declare const __VLS_component: import('vue').DefineComponent<EmptyVariantProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<EmptyVariantProps> & Readonly<{}>, {
|
|
12
|
+
size: EmptySize;
|
|
13
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
16
14
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
17
15
|
export default _default;
|
|
18
16
|
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
@@ -1,33 +1,77 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
|
|
1
|
+
import { defineComponent as o, openBlock as n, createElementBlock as d, normalizeClass as i, unref as s, createElementVNode as c, createVNode as r, toDisplayString as m, renderSlot as x } from "vue";
|
|
2
|
+
import p from "../../Icon.vue.js";
|
|
3
|
+
import { EMPTY_SIZE_DEFAULT as e } from "../types.js";
|
|
4
|
+
const g = { class: "flex flex-col items-start" }, f = ["innerHTML"], y = /* @__PURE__ */ o({
|
|
4
5
|
__name: "Variant9",
|
|
5
6
|
props: {
|
|
6
7
|
title: {},
|
|
7
8
|
description: {},
|
|
8
|
-
icon: {}
|
|
9
|
+
icon: {},
|
|
10
|
+
size: { default: e }
|
|
9
11
|
},
|
|
10
12
|
setup(t) {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
const l = {
|
|
14
|
+
xs: {
|
|
15
|
+
root: "gap-5 py-2 pl-4 md:gap-8 md:pl-8",
|
|
16
|
+
iconWrap: "h-8 w-8",
|
|
17
|
+
icon: "h-4 w-4",
|
|
18
|
+
title: "text-2xl md:text-3xl",
|
|
19
|
+
stack: "space-y-3",
|
|
20
|
+
desc: "mb-4 text-sm md:text-base"
|
|
21
|
+
},
|
|
22
|
+
sm: {
|
|
23
|
+
root: "gap-8 py-3 pl-6 md:gap-12 md:pl-12",
|
|
24
|
+
iconWrap: "h-10 w-10",
|
|
25
|
+
title: "text-3xl md:text-4xl",
|
|
26
|
+
icon: "h-4 w-4",
|
|
27
|
+
stack: "space-y-4",
|
|
28
|
+
desc: "mb-6 text-sm md:text-base"
|
|
29
|
+
},
|
|
30
|
+
md: {
|
|
31
|
+
root: "gap-10 py-4 pl-8 md:gap-16 md:pl-16",
|
|
32
|
+
iconWrap: "h-12 w-12",
|
|
33
|
+
icon: "h-5 w-5",
|
|
34
|
+
title: "text-4xl md:text-5xl",
|
|
35
|
+
stack: "space-y-6",
|
|
36
|
+
desc: "mb-8 text-base md:text-lg"
|
|
37
|
+
},
|
|
38
|
+
lg: {
|
|
39
|
+
root: "gap-12 py-6 pl-10 md:gap-20 md:pl-20",
|
|
40
|
+
iconWrap: "h-16 w-16",
|
|
41
|
+
icon: "h-6 w-6",
|
|
42
|
+
title: "text-5xl md:text-6xl",
|
|
43
|
+
stack: "space-y-8",
|
|
44
|
+
desc: "mb-10 text-lg md:text-xl"
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
return (a, u) => (n(), d("div", {
|
|
48
|
+
class: i(["grid w-full max-w-4xl grid-cols-1 items-center border-l-[3px] border-border md:grid-cols-2", l[t.size ?? s(e)].root])
|
|
49
|
+
}, [
|
|
50
|
+
c("div", {
|
|
51
|
+
class: i(l[t.size ?? s(e)].stack)
|
|
52
|
+
}, [
|
|
53
|
+
c("div", {
|
|
54
|
+
class: i(["flex items-center justify-center rounded-xl bg-muted/50", l[t.size ?? s(e)].iconWrap])
|
|
55
|
+
}, [
|
|
56
|
+
r(p, {
|
|
15
57
|
icon: t.icon,
|
|
16
|
-
class: "
|
|
17
|
-
}, null, 8, ["icon"])
|
|
18
|
-
]),
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
58
|
+
class: i(["text-foreground", l[t.size ?? s(e)].icon])
|
|
59
|
+
}, null, 8, ["icon", "class"])
|
|
60
|
+
], 2),
|
|
61
|
+
c("h3", {
|
|
62
|
+
class: i(["font-black uppercase italic leading-[0.9] tracking-tighter text-foreground", l[t.size ?? s(e)].title])
|
|
63
|
+
}, m(t.title), 3)
|
|
64
|
+
], 2),
|
|
65
|
+
c("div", g, [
|
|
66
|
+
c("p", {
|
|
67
|
+
class: i(["font-light leading-relaxed text-muted", l[t.size ?? s(e)].desc]),
|
|
24
68
|
innerHTML: t.description
|
|
25
|
-
}, null,
|
|
26
|
-
|
|
69
|
+
}, null, 10, f),
|
|
70
|
+
x(a.$slots, "action")
|
|
27
71
|
])
|
|
28
|
-
]));
|
|
72
|
+
], 2));
|
|
29
73
|
}
|
|
30
74
|
});
|
|
31
75
|
export {
|
|
32
|
-
|
|
76
|
+
y as default
|
|
33
77
|
};
|
|
@@ -42,8 +42,8 @@ declare const __VLS_component: import('vue').DefineComponent<Props, {}, {}, {},
|
|
|
42
42
|
onChange?: (value: FilePickerModelValue) => any;
|
|
43
43
|
"onUpdate:modelValue"?: (value: FilePickerModelValue) => any;
|
|
44
44
|
}>, {
|
|
45
|
-
variant: "dropzone" | "input";
|
|
46
45
|
size: InputSize;
|
|
46
|
+
variant: "dropzone" | "input";
|
|
47
47
|
rounded: InputRounded;
|
|
48
48
|
loading: boolean;
|
|
49
49
|
disabled: boolean;
|
|
@@ -28,6 +28,8 @@ declare const __VLS_component: import('vue').DefineComponent<FileTreeProps, {},
|
|
|
28
28
|
showCheckboxes: boolean;
|
|
29
29
|
highlightSearch: boolean;
|
|
30
30
|
maxLabelLength: number;
|
|
31
|
+
showTreeLines: boolean;
|
|
32
|
+
selectOnRowClick: boolean;
|
|
31
33
|
defaultExpandedKeys: string[];
|
|
32
34
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
|
|
33
35
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import o from "./FileTree2.vue.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-7abd8d67"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
m as default
|
|
7
7
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { defineComponent as
|
|
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
|
|
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__ */
|
|
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(
|
|
27
|
-
const s =
|
|
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),
|
|
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
|
-
},
|
|
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
|
|
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
|
|
59
|
-
|
|
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
|
-
}),
|
|
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 =
|
|
70
|
-
M(n).forEach((d) => a.delete(d)), h.value = a,
|
|
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,
|
|
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
|
-
},
|
|
86
|
+
}, A = (t) => {
|
|
85
87
|
if (t.disabled) return;
|
|
86
|
-
const l =
|
|
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 = (
|
|
91
|
-
u ? e.add(
|
|
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((
|
|
94
|
-
let
|
|
95
|
+
i(t.id, d), n.forEach((o) => i(o, d));
|
|
96
|
+
let c = l;
|
|
95
97
|
for (; ; ) {
|
|
96
|
-
const
|
|
97
|
-
if (!
|
|
98
|
-
const u =
|
|
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((
|
|
102
|
+
u.children.every((L) => e.has(L.id)) ? e.add(u.id) : e.delete(u.id), c = u;
|
|
101
103
|
}
|
|
102
104
|
}
|
|
103
|
-
|
|
104
|
-
}, Q =
|
|
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((
|
|
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 =
|
|
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
|
|
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:
|
|
120
|
+
node: c,
|
|
119
121
|
depth: a,
|
|
120
|
-
isLast:
|
|
122
|
+
isLast: o,
|
|
121
123
|
ancestorLastFlags: n,
|
|
122
124
|
isFolder: u
|
|
123
|
-
}),
|
|
124
|
-
const
|
|
125
|
-
|
|
126
|
-
node:
|
|
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:
|
|
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
|
|
146
|
-
a(
|
|
147
|
-
const
|
|
148
|
-
return d && e.add(n.id),
|
|
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
|
|
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(),
|
|
163
|
-
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),
|
|
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(),
|
|
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:
|
|
173
|
+
style: z({ paddingInlineStart: e.depth * 20 + 26 + "px" })
|
|
172
174
|
}, null, 4)), l, 0) : N([
|
|
173
175
|
e.node,
|
|
174
|
-
|
|
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
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
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(),
|
|
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":
|
|
194
|
-
"is-selected":
|
|
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":
|
|
199
|
-
"
|
|
200
|
-
"
|
|
201
|
-
|
|
202
|
-
"
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
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(),
|
|
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;
|