vlite3 1.3.11 → 1.4.2
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 +2 -2
- package/components/Accordion/AccordionItem.vue.d.ts +1 -1
- package/components/Accordion/AccordionItem.vue.js +11 -7
- package/components/Accordion/AccordionTrigger.vue.d.ts +1 -1
- package/components/AppShell/AppShell.vue.d.ts +1 -0
- package/components/AppShell/AppShell.vue.js +33 -26
- package/components/AppShell/AppShellLayoutStorefront.vue.d.ts +54 -0
- package/components/AppShell/AppShellLayoutStorefront.vue.js +222 -0
- package/components/AppShell/AppShellLayoutStorefront.vue2.js +4 -0
- package/components/AsyncSelect/createAsyncSelect.js +3 -2
- package/components/CategoryManager/CategoryManager.vue2.js +36 -31
- package/components/CategoryMenu/CategoryMenu.vue.d.ts +22 -0
- package/components/CategoryMenu/CategoryMenu.vue.js +106 -0
- package/components/CategoryMenu/CategoryMenu.vue2.js +4 -0
- package/components/CategoryMenu/CategoryMenuVariant1.vue.d.ts +17 -0
- package/components/CategoryMenu/CategoryMenuVariant1.vue.js +146 -0
- package/components/CategoryMenu/CategoryMenuVariant1.vue2.js +4 -0
- package/components/CategoryMenu/CategoryMenuVariant2.vue.d.ts +18 -0
- package/components/CategoryMenu/CategoryMenuVariant2.vue.js +162 -0
- package/components/CategoryMenu/CategoryMenuVariant2.vue2.js +4 -0
- package/components/CategoryMenu/index.d.ts +2 -0
- package/components/CategoryMenu/types.d.ts +32 -0
- package/components/CategoryMenu/utils.d.ts +16 -0
- package/components/CategoryMenu/utils.js +45 -0
- package/components/ColorPicker/ColorPicker.vue.d.ts +7 -3
- package/components/ColorPicker/ColorPicker.vue.js +59 -45
- package/components/DatePicker.vue.js +5 -4
- package/components/DateRangePicker.vue.js +3 -2
- package/components/Dropdown/Dropdown.vue.d.ts +4 -1
- package/components/Dropdown/Dropdown.vue.js +8 -7
- package/components/Dropdown/DropdownGroupedLayout.vue2.js +5 -2
- package/components/Dropdown/DropdownGroupedLayout.vue3.js +111 -0
- package/components/Dropdown/DropdownItem.vue.d.ts +2 -2
- package/components/Dropdown/DropdownItem.vue.js +66 -49
- package/components/Dropdown/DropdownMenu.vue.js +1 -1
- package/components/Dropdown/{DropdownMenu.vue2.js → DropdownMenu.vue3.js} +40 -40
- package/components/Dropdown/composables/useDropdownHydration.d.ts +4 -0
- package/components/Dropdown/composables/useDropdownNavigation.js +30 -18
- package/components/Form/Form.vue.d.ts +13 -1
- package/components/Form/Form.vue.js +2 -2
- package/components/Form/Form.vue2.js +313 -275
- package/components/Form/FormField.vue.js +103 -74
- package/components/Form/FormFields.vue.js +2 -2
- package/components/Form/FormFields.vue2.js +7 -6
- package/components/Form/composables/useForm.js +71 -67
- package/components/Form/types.d.ts +21 -1
- package/components/IconPicker.vue.js +3 -2
- package/components/ImportData/ImportStep2.vue.js +3 -2
- package/components/MultiSelect/composables/useMultiSelectHydration.d.ts +4 -0
- package/components/NavbarCommandPalette.vue.d.ts +1 -1
- package/components/PermissionMatrix/PermissionTopBar.vue.js +3 -2
- package/components/RichTextEditor/RichTextEditor.vue.js +43 -48
- package/components/RichTextEditor/RichTextLinkPopover.vue3.js +2 -2
- package/components/RichTextEditor/RichTextToolbar.vue.d.ts +12 -3
- package/components/RichTextEditor/{RichTextToolbar.vue.js → RichTextToolbar.vue2.js} +157 -121
- package/components/RichTextEditor/RichTextToolbar.vue3.js +2 -2
- package/components/RichTextEditor/index.d.ts +2 -0
- package/components/RichTextEditor/types.d.ts +38 -0
- package/components/RichTextEditor/types.js +52 -0
- package/components/Screen/ScreenFilter.vue.js +26 -21
- package/components/SidebarMenu/SidebarMenu.vue.d.ts +2 -2
- package/components/SidebarMenu/SidebarMenuItem.vue.js +3 -2
- package/components/Switch.vue.js +8 -8
- package/components/Tooltip.vue.js +1 -0
- package/components/Workbook/Sheet.vue.d.ts +1 -1
- package/components/Workbook/Sheet.vue.js +14 -13
- package/components/index.d.ts +1 -0
- package/index.d.ts +1 -0
- package/index.js +306 -301
- package/package.json +2 -2
- package/style.css +2 -2
- package/types/appshell.type.d.ts +2 -1
- package/types/styles.d.ts +2 -0
- package/components/Dropdown/DropdownGroupedLayout.vue.js +0 -75
- /package/components/RichTextEditor/{RichTextLinkPopover.vue.js → RichTextLinkPopover.vue2.js} +0 -0
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { defineComponent as B, computed as S, openBlock as l, createElementBlock as n, normalizeStyle as D, Fragment as i, renderList as u, createBlock as m, resolveDynamicComponent as E, mergeProps as L, withCtx as N, createElementVNode as y, normalizeClass as x, createCommentVNode as d, toDisplayString as k, createVNode as V } from "vue";
|
|
2
|
+
import h from "../Icon.vue.js";
|
|
3
|
+
import v from "./DropdownItem.vue.js";
|
|
4
|
+
import { $t as z } from "../../utils/i18n.js";
|
|
5
|
+
const A = { class: "flex items-center gap-2" }, G = { class: "font-semibold text-sm text-foreground" }, I = {
|
|
6
|
+
key: 2,
|
|
7
|
+
class: "flex flex-col space-y-0.5"
|
|
8
|
+
}, P = {
|
|
9
|
+
key: 0,
|
|
10
|
+
class: "flex flex-col space-y-0.5 ml-3 pl-3 border-l border-border mt-0.5 mb-1.5"
|
|
11
|
+
}, J = /* @__PURE__ */ B({
|
|
12
|
+
__name: "DropdownGroupedLayout",
|
|
13
|
+
props: {
|
|
14
|
+
options: { default: () => [] },
|
|
15
|
+
selected: {},
|
|
16
|
+
selectable: { type: Boolean, default: !0 },
|
|
17
|
+
columns: { default: 3 },
|
|
18
|
+
itemsClass: {},
|
|
19
|
+
headerClass: {}
|
|
20
|
+
},
|
|
21
|
+
emits: ["select", "mouseenter"],
|
|
22
|
+
setup(o, { emit: T }) {
|
|
23
|
+
const s = o, C = S(() => {
|
|
24
|
+
const e = s.columns;
|
|
25
|
+
return typeof e == "number" ? { "--mega-cols": e } : { gridTemplateColumns: e };
|
|
26
|
+
}), a = (e) => s.selected ? Array.isArray(s.selected) ? s.selected.includes(e.value) : typeof s.selected == "object" && s.selected !== null && e.key && e.key in s.selected ? s.selected[e.key] === e.value : s.selected === e.value : !1, b = (e) => e.labelI18n ? z(e.labelI18n) : e.label, p = (e) => e.to ? "router-link" : e.href ? "a" : "button", j = (e) => {
|
|
27
|
+
if (e.to) return { to: e.to };
|
|
28
|
+
if (e.href) {
|
|
29
|
+
const f = e.href.startsWith("http") || e.href.startsWith("//");
|
|
30
|
+
return {
|
|
31
|
+
href: e.href,
|
|
32
|
+
target: f ? "_blank" : void 0,
|
|
33
|
+
rel: f ? "noopener noreferrer" : void 0
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
return { type: "button" };
|
|
37
|
+
};
|
|
38
|
+
return (e, f) => (l(), n("div", {
|
|
39
|
+
class: "mega-menu-grid p-2 gap-6",
|
|
40
|
+
style: D(C.value)
|
|
41
|
+
}, [
|
|
42
|
+
(l(!0), n(i, null, u(o.options, (t, $) => (l(), n("div", {
|
|
43
|
+
key: t.key || t.value || $,
|
|
44
|
+
class: "flex flex-col space-y-1"
|
|
45
|
+
}, [
|
|
46
|
+
o.selectable !== !1 && t.disabled !== !0 ? (l(), m(E(p(t)), L({
|
|
47
|
+
key: 0,
|
|
48
|
+
ref_for: !0
|
|
49
|
+
}, j(t), {
|
|
50
|
+
class: ["flex items-center px-2 py-1.5 mb-1 w-full text-left transition-colors group/header", [
|
|
51
|
+
o.headerClass,
|
|
52
|
+
a(t) ? "text-primary" : ""
|
|
53
|
+
]],
|
|
54
|
+
onClick: (r) => e.$emit("select", t)
|
|
55
|
+
}), {
|
|
56
|
+
default: N(() => [
|
|
57
|
+
y("div", A, [
|
|
58
|
+
t.icon || t.emoji ? (l(), m(h, {
|
|
59
|
+
key: 0,
|
|
60
|
+
icon: t.icon,
|
|
61
|
+
emoji: t.emoji,
|
|
62
|
+
class: x(["w-4 h-4 opacity-80", a(t) ? "text-primary" : "text-muted-foreground group-hover/header:text-primary"])
|
|
63
|
+
}, null, 8, ["icon", "emoji", "class"])) : d("", !0),
|
|
64
|
+
y("span", {
|
|
65
|
+
class: x(["font-semibold text-sm transition-colors", a(t) ? "text-primary" : "text-foreground group-hover/header:text-primary"])
|
|
66
|
+
}, k(b(t)), 3)
|
|
67
|
+
])
|
|
68
|
+
]),
|
|
69
|
+
_: 2
|
|
70
|
+
}, 1040, ["class", "onClick"])) : (l(), n("div", {
|
|
71
|
+
key: 1,
|
|
72
|
+
class: x(["flex items-center gap-2 px-2 py-1.5 mb-1", o.headerClass])
|
|
73
|
+
}, [
|
|
74
|
+
t.icon || t.emoji ? (l(), m(h, {
|
|
75
|
+
key: 0,
|
|
76
|
+
icon: t.icon,
|
|
77
|
+
emoji: t.emoji,
|
|
78
|
+
class: "w-4 h-4 text-muted-foreground"
|
|
79
|
+
}, null, 8, ["icon", "emoji"])) : d("", !0),
|
|
80
|
+
y("span", G, k(b(t)), 1)
|
|
81
|
+
], 2)),
|
|
82
|
+
t.children && t.children.length ? (l(), n("div", I, [
|
|
83
|
+
(l(!0), n(i, null, u(t.children, (r, _) => (l(), n(i, {
|
|
84
|
+
key: r.key || r.value || _
|
|
85
|
+
}, [
|
|
86
|
+
V(v, {
|
|
87
|
+
option: r,
|
|
88
|
+
selected: a(r),
|
|
89
|
+
selectable: o.selectable,
|
|
90
|
+
class: "w-full text-sm text-muted-foreground hover:text-foreground font-medium",
|
|
91
|
+
onClick: (c) => e.$emit("select", r)
|
|
92
|
+
}, null, 8, ["option", "selected", "selectable", "onClick"]),
|
|
93
|
+
r.children && r.children.length ? (l(), n("div", P, [
|
|
94
|
+
(l(!0), n(i, null, u(r.children, (c, w) => (l(), m(v, {
|
|
95
|
+
key: c.key || c.value || w,
|
|
96
|
+
option: c,
|
|
97
|
+
selected: a(c),
|
|
98
|
+
selectable: o.selectable,
|
|
99
|
+
class: "w-full text-xs text-muted-foreground hover:text-foreground",
|
|
100
|
+
onClick: (W) => e.$emit("select", c)
|
|
101
|
+
}, null, 8, ["option", "selected", "selectable", "onClick"]))), 128))
|
|
102
|
+
])) : d("", !0)
|
|
103
|
+
], 64))), 128))
|
|
104
|
+
])) : d("", !0)
|
|
105
|
+
]))), 128))
|
|
106
|
+
], 4));
|
|
107
|
+
}
|
|
108
|
+
});
|
|
109
|
+
export {
|
|
110
|
+
J as default
|
|
111
|
+
};
|
|
@@ -16,7 +16,7 @@ declare function __VLS_template(): {
|
|
|
16
16
|
}): any;
|
|
17
17
|
};
|
|
18
18
|
refs: {};
|
|
19
|
-
rootEl:
|
|
19
|
+
rootEl: any;
|
|
20
20
|
};
|
|
21
21
|
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
22
22
|
declare const __VLS_component: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
@@ -25,7 +25,7 @@ declare const __VLS_component: import('vue').DefineComponent<Props, {}, {}, {},
|
|
|
25
25
|
}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{
|
|
26
26
|
onClick?: (option: IDropdownOption) => any;
|
|
27
27
|
onMouseenter?: (index: number) => any;
|
|
28
|
-
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {},
|
|
28
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
29
29
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
30
30
|
export default _default;
|
|
31
31
|
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import { $t as
|
|
4
|
-
const
|
|
1
|
+
import { defineComponent as $, computed as n, openBlock as i, createBlock as l, resolveDynamicComponent as C, mergeProps as I, withKeys as B, withCtx as D, renderSlot as j, normalizeProps as E, guardReactiveProps as P, createCommentVNode as a, createElementVNode as r, toDisplayString as s, createElementBlock as b } from "vue";
|
|
2
|
+
import h from "../Icon.vue.js";
|
|
3
|
+
import { $t as c } from "../../utils/i18n.js";
|
|
4
|
+
const S = { class: "flex flex-col flex-1 min-w-0" }, z = { class: "flex items-center justify-between gap-2" }, K = { class: "truncate font-medium" }, L = {
|
|
5
5
|
key: 0,
|
|
6
6
|
class: "text-xs text-muted-foreground whitespace-nowrap opacity-90"
|
|
7
|
-
},
|
|
7
|
+
}, N = {
|
|
8
8
|
key: 0,
|
|
9
9
|
class: "text-[10px] text-muted-foreground truncate opacity-70"
|
|
10
|
-
},
|
|
10
|
+
}, T = /* @__PURE__ */ $({
|
|
11
11
|
__name: "DropdownItem",
|
|
12
12
|
props: {
|
|
13
13
|
option: {},
|
|
@@ -17,52 +17,69 @@ const j = ["tabindex", "data-disabled", "data-testid"], C = { class: "flex flex-
|
|
|
17
17
|
index: {}
|
|
18
18
|
},
|
|
19
19
|
emits: ["click", "mouseenter"],
|
|
20
|
-
setup(
|
|
21
|
-
const
|
|
22
|
-
() =>
|
|
23
|
-
),
|
|
24
|
-
() =>
|
|
25
|
-
),
|
|
26
|
-
() =>
|
|
27
|
-
)
|
|
28
|
-
|
|
29
|
-
|
|
20
|
+
setup(t, { emit: v }) {
|
|
21
|
+
const e = t, d = v, x = n(
|
|
22
|
+
() => e.option.labelI18n ? c(e.option.labelI18n) : e.option.label
|
|
23
|
+
), u = n(
|
|
24
|
+
() => e.option.subtitleI18n ? c(e.option.subtitleI18n) : e.option.subtitle
|
|
25
|
+
), p = n(
|
|
26
|
+
() => e.option.descriptionI18n ? c(e.option.descriptionI18n) : e.option.description
|
|
27
|
+
), m = n(
|
|
28
|
+
() => e.option.href && (e.option.href.startsWith("http") || e.option.href.startsWith("//"))
|
|
29
|
+
), y = n(() => e.option.to ? "router-link" : e.option.href ? "a" : "div"), k = n(() => e.option.to ? { to: e.option.to } : e.option.href ? {
|
|
30
|
+
href: e.option.href,
|
|
31
|
+
target: m.value ? "_blank" : void 0,
|
|
32
|
+
rel: m.value ? "noopener noreferrer" : void 0
|
|
33
|
+
} : {}), g = (o) => {
|
|
34
|
+
if (e.option.disabled) {
|
|
35
|
+
o.preventDefault();
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
d("click", e.option);
|
|
39
|
+
}, w = (o) => {
|
|
40
|
+
e.option.to || e.option.href || (o.preventDefault(), d("click", e.option));
|
|
41
|
+
};
|
|
42
|
+
return (o, f) => (i(), l(C(y.value), I(k.value, {
|
|
43
|
+
tabindex: t.option.disabled ? -1 : 0,
|
|
30
44
|
"data-dropdown-item": "",
|
|
31
|
-
class:
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
]]
|
|
37
|
-
"data-disabled":
|
|
38
|
-
"data-testid":
|
|
39
|
-
onClick:
|
|
40
|
-
onKeydown:
|
|
41
|
-
onMouseenter:
|
|
42
|
-
},
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
45
|
+
class: ["relative w-full flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus-visible:bg-accent focus-visible:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50", [
|
|
46
|
+
t.selectable && t.selected && !t.option.children ? "bg-accent" : "",
|
|
47
|
+
t.focused ? "bg-accent text-accent-foreground" : "hover:bg-accent hover:text-accent-foreground",
|
|
48
|
+
t.option.disabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer",
|
|
49
|
+
t.option.class || ""
|
|
50
|
+
]],
|
|
51
|
+
"data-disabled": t.option.disabled ? !0 : void 0,
|
|
52
|
+
"data-testid": o.$attrs["data-testid"] || (t.option.value ? `dropdown-item-${t.option.value}` : `dropdown-item-${t.option.label}`).toString().toLowerCase().replace(/[^a-z0-9]+/g, "-"),
|
|
53
|
+
onClick: g,
|
|
54
|
+
onKeydown: B(w, ["enter"]),
|
|
55
|
+
onMouseenter: f[0] || (f[0] = (V) => o.$emit("mouseenter", t.index ?? -1))
|
|
56
|
+
}), {
|
|
57
|
+
default: D(() => [
|
|
58
|
+
j(o.$slots, "default", E(P({ option: t.option, index: t.index, selected: t.selected })), () => [
|
|
59
|
+
t.option.icon || t.option.emoji ? (i(), l(h, {
|
|
60
|
+
key: 0,
|
|
61
|
+
icon: t.option.icon,
|
|
62
|
+
emoji: t.option.emoji,
|
|
63
|
+
class: "mr-2.5 h-4 w-4 shrink-0 mt-0.5"
|
|
64
|
+
}, null, 8, ["icon", "emoji"])) : a("", !0),
|
|
65
|
+
r("div", S, [
|
|
66
|
+
r("div", z, [
|
|
67
|
+
r("span", K, s(x.value), 1),
|
|
68
|
+
u.value ? (i(), b("span", L, s(u.value), 1)) : a("", !0)
|
|
69
|
+
]),
|
|
70
|
+
p.value ? (i(), b("span", N, s(p.value), 1)) : a("", !0)
|
|
54
71
|
]),
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
72
|
+
t.selectable && t.selected ? (i(), l(h, {
|
|
73
|
+
key: 1,
|
|
74
|
+
icon: "lucide:check",
|
|
75
|
+
class: "ml-2 h-4 w-4 shrink-0 text-primary"
|
|
76
|
+
})) : a("", !0)
|
|
77
|
+
])
|
|
78
|
+
]),
|
|
79
|
+
_: 3
|
|
80
|
+
}, 16, ["tabindex", "class", "data-disabled", "data-testid"]));
|
|
64
81
|
}
|
|
65
82
|
});
|
|
66
83
|
export {
|
|
67
|
-
|
|
84
|
+
T as default
|
|
68
85
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
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
|
|
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 i, 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 D, renderList as oe, withCtx as P, createSlots as ne, mergeProps as re, nextTick as ae } from "vue";
|
|
2
2
|
import p from "../Icon.vue.js";
|
|
3
|
-
import
|
|
3
|
+
import de from "../Input.vue.js";
|
|
4
4
|
/* empty css */
|
|
5
|
-
import
|
|
5
|
+
import ie from "./DropdownItem.vue.js";
|
|
6
6
|
import ce from "./DropdownBooleanItem.vue.js";
|
|
7
|
-
import ue from "./DropdownGroupedLayout.
|
|
7
|
+
import ue from "./DropdownGroupedLayout.vue2.js";
|
|
8
8
|
import { useDropdownNavigation as fe } from "./composables/useDropdownNavigation.js";
|
|
9
9
|
import { useDropdownIds as me } from "./composables/useDropdownIds.js";
|
|
10
10
|
import { $t as $ } from "../../utils/i18n.js";
|
|
@@ -27,7 +27,7 @@ const ve = ["dir"], ye = {
|
|
|
27
27
|
}, Oe = {
|
|
28
28
|
key: 3,
|
|
29
29
|
class: "shrink-0 rounded-b-md overflow-hidden"
|
|
30
|
-
},
|
|
30
|
+
}, Ve = /* @__PURE__ */ ee({
|
|
31
31
|
__name: "DropdownMenu",
|
|
32
32
|
props: {
|
|
33
33
|
options: { default: () => [] },
|
|
@@ -52,19 +52,19 @@ const ve = ["dir"], ye = {
|
|
|
52
52
|
searchEmptyMessage: {}
|
|
53
53
|
},
|
|
54
54
|
emits: ["select", "close", "load-more", "search"],
|
|
55
|
-
setup(a, { emit:
|
|
56
|
-
const t = a, m =
|
|
57
|
-
if (
|
|
55
|
+
setup(a, { emit: V }) {
|
|
56
|
+
const t = a, m = V, B = j(null), d = j(""), { getMenuId: z, getAllRecursiveIds: H } = me(), L = g(() => {
|
|
57
|
+
if (d.value && d.value.trim() !== "")
|
|
58
58
|
return t.searchEmptyMessage ? t.searchEmptyMessage : `No results found for
|
|
59
|
-
"${
|
|
59
|
+
"${d.value}"`;
|
|
60
60
|
const e = $("vlite.dropdown.empty");
|
|
61
61
|
return e !== "vlite.dropdown.empty" ? e : t.emptyMessage;
|
|
62
62
|
}), R = g(() => {
|
|
63
63
|
const e = $("vlite.dropdown.search");
|
|
64
64
|
return e !== "vlite.dropdown.search" ? e : "Search...";
|
|
65
|
-
}), u = g(() => t.options ? t.options.map((e) => typeof e == "string" || typeof e == "number" ? { label: String(e), value: String(e) } : e) : []),
|
|
65
|
+
}), u = g(() => t.options ? t.options.map((e) => typeof e == "string" || typeof e == "number" ? { label: String(e), value: String(e) } : e) : []), C = g(() => t.searchable ? d.value && d.value.trim() !== "" ? !0 : t.remote ? t.loading ? !0 : t.hasMore || (u.value.length || 0) > 5 : (u.value.length || 0) > 5 : !1);
|
|
66
66
|
let v = null;
|
|
67
|
-
T(
|
|
67
|
+
T(d, (e) => {
|
|
68
68
|
t.remote && (v && clearTimeout(v), v = setTimeout(() => {
|
|
69
69
|
e !== void 0 && m("search", e);
|
|
70
70
|
}, t.debounceTime));
|
|
@@ -78,20 +78,20 @@ const ve = ["dir"], ye = {
|
|
|
78
78
|
focusedIndex: b,
|
|
79
79
|
isKeyboardMode: M,
|
|
80
80
|
filteredOptions: F,
|
|
81
|
-
handleKeyDown:
|
|
82
|
-
handleMouseMove:
|
|
81
|
+
handleKeyDown: I,
|
|
82
|
+
handleMouseMove: _,
|
|
83
83
|
onMouseEnterItem: S,
|
|
84
84
|
scrollToIndex: K
|
|
85
85
|
} = fe({
|
|
86
86
|
options: u,
|
|
87
|
-
searchQuery:
|
|
88
|
-
containerRef:
|
|
87
|
+
searchQuery: d,
|
|
88
|
+
containerRef: B,
|
|
89
89
|
emit: (e, ...s) => m(e, ...s),
|
|
90
90
|
handleSelect: (e, s) => x(e)
|
|
91
|
-
}), y = g(() => t.remote ?
|
|
91
|
+
}), y = g(() => t.remote ? d.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
|
+
}, G = (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, q = (e) => !e.key || !t.selected || typeof t.selected != "object" ? !1 : !!t.selected[e.key], J = (e, s) => {
|
|
95
95
|
if (!s.key) return;
|
|
96
96
|
const l = {
|
|
97
97
|
label: s.label,
|
|
@@ -125,19 +125,19 @@ const ve = ["dir"], ye = {
|
|
|
125
125
|
b.value = -1;
|
|
126
126
|
}
|
|
127
127
|
), te(() => {
|
|
128
|
-
W(), window.addEventListener("keydown",
|
|
128
|
+
W(), window.addEventListener("keydown", I);
|
|
129
129
|
}), le(() => {
|
|
130
|
-
window.removeEventListener("keydown",
|
|
130
|
+
window.removeEventListener("keydown", I), v && clearTimeout(v), d.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(), i("div", {
|
|
134
134
|
class: "dropdown-menu w-full flex flex-col",
|
|
135
135
|
dir: a.direction
|
|
136
136
|
}, [
|
|
137
|
-
|
|
138
|
-
O(
|
|
139
|
-
modelValue:
|
|
140
|
-
"onUpdate:modelValue": s[0] || (s[0] = (l) =>
|
|
137
|
+
C.value ? (o(), i("div", ye, [
|
|
138
|
+
O(de, {
|
|
139
|
+
modelValue: d.value,
|
|
140
|
+
"onUpdate:modelValue": s[0] || (s[0] = (l) => d.value = l),
|
|
141
141
|
placeholder: R.value,
|
|
142
142
|
icon: "lucide:search",
|
|
143
143
|
size: "sm",
|
|
@@ -150,14 +150,14 @@ const ve = ["dir"], ye = {
|
|
|
150
150
|
"data-testid": "dropdown-search-input"
|
|
151
151
|
}, null, 8, ["modelValue", "placeholder"])
|
|
152
152
|
])) : f("", !0),
|
|
153
|
-
e.$slots.header ? (o(),
|
|
153
|
+
e.$slots.header ? (o(), i("div", ge, [
|
|
154
154
|
k(e.$slots, "header", {}, void 0, !0)
|
|
155
155
|
])) : f("", !0),
|
|
156
|
-
u.value.length > 0 || y.value.length === 0 ? (o(),
|
|
156
|
+
u.value.length > 0 || y.value.length === 0 ? (o(), i("div", {
|
|
157
157
|
key: 2,
|
|
158
158
|
ref_key: "containerRef",
|
|
159
|
-
ref:
|
|
160
|
-
tabindex:
|
|
159
|
+
ref: B,
|
|
160
|
+
tabindex: C.value ? -1 : 0,
|
|
161
161
|
role: "menu",
|
|
162
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",
|
|
@@ -165,10 +165,10 @@ const ve = ["dir"], ye = {
|
|
|
165
165
|
]),
|
|
166
166
|
style: se({ maxHeight: t.maxHeight }),
|
|
167
167
|
onMousemove: s[1] || (s[1] = //@ts-ignore
|
|
168
|
-
(...l) => r(
|
|
168
|
+
(...l) => r(_) && r(_)(...l)),
|
|
169
169
|
onScroll: A
|
|
170
170
|
}, [
|
|
171
|
-
!a.isCustomSlotMenu && y.value.length === 0 && !a.loading && !(u.value.length === 0 && e.$slots.menu) ? (o(),
|
|
171
|
+
!a.isCustomSlotMenu && y.value.length === 0 && !a.loading && !(u.value.length === 0 && e.$slots.menu) ? (o(), i("div", ke, [
|
|
172
172
|
O(p, {
|
|
173
173
|
icon: "lucide:inbox",
|
|
174
174
|
class: "w-8 h-8 mb-2 opacity-70"
|
|
@@ -182,11 +182,11 @@ const ve = ["dir"], ye = {
|
|
|
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), i(D, { key: 2 }, oe(y.value, (l, n) => (o(), i(D, { key: n }, [
|
|
186
|
+
l.label === "---" ? (o(), i("div", we)) : l.data?.isBoolean ? (o(), h(ce, {
|
|
187
187
|
key: 1,
|
|
188
188
|
option: l,
|
|
189
|
-
value:
|
|
189
|
+
value: q(l),
|
|
190
190
|
focused: r(M) && r(b) === n,
|
|
191
191
|
onChange: J,
|
|
192
192
|
onMouseenter: (c) => r(S)(n)
|
|
@@ -206,7 +206,7 @@ const ve = ["dir"], ye = {
|
|
|
206
206
|
direction: a.direction,
|
|
207
207
|
onOnSelect: (c) => Q(l, c)
|
|
208
208
|
}, {
|
|
209
|
-
trigger:
|
|
209
|
+
trigger: P(() => [
|
|
210
210
|
w("div", {
|
|
211
211
|
tabindex: 0,
|
|
212
212
|
"data-dropdown-item": "",
|
|
@@ -234,11 +234,11 @@ const ve = ["dir"], ye = {
|
|
|
234
234
|
], 42, pe)
|
|
235
235
|
]),
|
|
236
236
|
_: 2
|
|
237
|
-
}, 1032, ["position", "offset", "options", "selected", "menuId", "nestedPosition", "nestedOffset", "selectable", "ignoreClickOutside", "direction", "onOnSelect"])) : (o(), h(
|
|
237
|
+
}, 1032, ["position", "offset", "options", "selected", "menuId", "nestedPosition", "nestedOffset", "selectable", "ignoreClickOutside", "direction", "onOnSelect"])) : (o(), h(ie, {
|
|
238
238
|
key: 3,
|
|
239
239
|
option: l,
|
|
240
240
|
index: n,
|
|
241
|
-
selected:
|
|
241
|
+
selected: G(l),
|
|
242
242
|
focused: r(M) && r(b) === n,
|
|
243
243
|
selectable: a.selectable,
|
|
244
244
|
onClick: (c) => x(l),
|
|
@@ -246,14 +246,14 @@ const ve = ["dir"], ye = {
|
|
|
246
246
|
}, ne({ _: 2 }, [
|
|
247
247
|
e.$slots.item ? {
|
|
248
248
|
name: "default",
|
|
249
|
-
fn:
|
|
249
|
+
fn: P((c) => [
|
|
250
250
|
k(e.$slots, "item", re({ ref_for: !0 }, c), 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(),
|
|
256
|
+
a.loading ? (o(), i("div", Se, [
|
|
257
257
|
O(p, {
|
|
258
258
|
icon: "lucide:loader-2",
|
|
259
259
|
class: "w-4 h-4 animate-spin text-muted-foreground"
|
|
@@ -261,12 +261,12 @@ const ve = ["dir"], ye = {
|
|
|
261
261
|
])) : f("", !0),
|
|
262
262
|
k(e.$slots, "menu", {}, void 0, !0)
|
|
263
263
|
], 46, be)) : f("", !0),
|
|
264
|
-
e.$slots.footer ? (o(),
|
|
264
|
+
e.$slots.footer ? (o(), i("div", Oe, [
|
|
265
265
|
k(e.$slots, "footer", {}, void 0, !0)
|
|
266
266
|
])) : f("", !0)
|
|
267
267
|
], 8, ve));
|
|
268
268
|
}
|
|
269
269
|
});
|
|
270
270
|
export {
|
|
271
|
-
|
|
271
|
+
Ve as default
|
|
272
272
|
};
|
|
@@ -21,6 +21,8 @@ export declare function useDropdownHydration(opts: UseDropdownHydrationOptions):
|
|
|
21
21
|
selectedBuffer: import('vue').Ref<Map<any, {
|
|
22
22
|
label: string;
|
|
23
23
|
labelI18n?: string;
|
|
24
|
+
to?: string;
|
|
25
|
+
href?: string;
|
|
24
26
|
value?: any;
|
|
25
27
|
subtitle?: string;
|
|
26
28
|
subtitleI18n?: string;
|
|
@@ -62,6 +64,8 @@ export declare function useDropdownHydration(opts: UseDropdownHydrationOptions):
|
|
|
62
64
|
}> & Omit<Map<any, IDropdownOption>, keyof Map<any, any>>, Map<any, IDropdownOption> | (Map<any, {
|
|
63
65
|
label: string;
|
|
64
66
|
labelI18n?: string;
|
|
67
|
+
to?: string;
|
|
68
|
+
href?: string;
|
|
65
69
|
value?: any;
|
|
66
70
|
subtitle?: string;
|
|
67
71
|
subtitleI18n?: string;
|
|
@@ -1,24 +1,36 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
import { $t as
|
|
3
|
-
function
|
|
4
|
-
const t =
|
|
5
|
-
const e =
|
|
6
|
-
if (!
|
|
7
|
-
const a =
|
|
8
|
-
return e.filter((
|
|
1
|
+
import { ref as i, computed as d } from "vue";
|
|
2
|
+
import { $t as f } from "../../../utils/i18n.js";
|
|
3
|
+
function g(o) {
|
|
4
|
+
const t = i(-1), l = i(!1), s = d(() => {
|
|
5
|
+
const e = o.options.value;
|
|
6
|
+
if (!o.searchQuery.value) return e;
|
|
7
|
+
const a = o.searchQuery.value.toLowerCase();
|
|
8
|
+
return e.filter((n) => (n.labelI18n ? f(n.labelI18n) : n.label).toLowerCase().includes(a));
|
|
9
9
|
}), r = (e) => {
|
|
10
|
-
if (!
|
|
11
|
-
const
|
|
12
|
-
|
|
10
|
+
if (!o.containerRef.value || e < 0) return;
|
|
11
|
+
const n = o.containerRef.value.querySelectorAll("[data-dropdown-item]")[e];
|
|
12
|
+
n && n.scrollIntoView({ block: "nearest" });
|
|
13
13
|
};
|
|
14
14
|
return {
|
|
15
15
|
focusedIndex: t,
|
|
16
|
-
isKeyboardMode:
|
|
16
|
+
isKeyboardMode: l,
|
|
17
17
|
filteredOptions: s,
|
|
18
18
|
handleKeyDown: (e) => {
|
|
19
|
+
if (e.key.length === 1 && !e.ctrlKey && !e.metaKey && !e.altKey && !e.defaultPrevented) {
|
|
20
|
+
const n = document.activeElement;
|
|
21
|
+
if (!(n?.tagName === "INPUT" || n?.tagName === "TEXTAREA" || n?.isContentEditable)) {
|
|
22
|
+
const c = o.containerRef.value?.closest(".dropdown-menu");
|
|
23
|
+
if (c) {
|
|
24
|
+
const u = c.querySelector(
|
|
25
|
+
'input[data-testid="dropdown-search-input"]'
|
|
26
|
+
);
|
|
27
|
+
u && document.activeElement !== u && u.focus();
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
19
31
|
const a = s.value;
|
|
20
32
|
if (a.length !== 0)
|
|
21
|
-
switch (["ArrowDown", "ArrowUp", "Enter"].includes(e.key) && (
|
|
33
|
+
switch (["ArrowDown", "ArrowUp", "Enter"].includes(e.key) && (l.value = !0), e.key) {
|
|
22
34
|
case "ArrowDown":
|
|
23
35
|
e.preventDefault(), e.stopPropagation(), t.value < a.length - 1 ? t.value++ : t.value = 0, r(t.value);
|
|
24
36
|
break;
|
|
@@ -27,17 +39,17 @@ function b(n) {
|
|
|
27
39
|
break;
|
|
28
40
|
case "Enter":
|
|
29
41
|
if (e.preventDefault(), e.stopPropagation(), t.value >= 0 && t.value < a.length) {
|
|
30
|
-
const
|
|
31
|
-
|
|
42
|
+
const n = a[t.value];
|
|
43
|
+
n.children || o.handleSelect(n, t.value);
|
|
32
44
|
}
|
|
33
45
|
break;
|
|
34
46
|
case "Escape":
|
|
35
|
-
e.preventDefault(), e.stopPropagation(),
|
|
47
|
+
e.preventDefault(), e.stopPropagation(), o.emit("close");
|
|
36
48
|
break;
|
|
37
49
|
}
|
|
38
50
|
},
|
|
39
51
|
handleMouseMove: () => {
|
|
40
|
-
|
|
52
|
+
l.value && (l.value = !1);
|
|
41
53
|
},
|
|
42
54
|
onMouseEnterItem: (e) => {
|
|
43
55
|
t.value = e;
|
|
@@ -46,5 +58,5 @@ function b(n) {
|
|
|
46
58
|
};
|
|
47
59
|
}
|
|
48
60
|
export {
|
|
49
|
-
|
|
61
|
+
g as useDropdownNavigation
|
|
50
62
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IForm, IFormStep, IFormSubmitPayload, IFormGroupsHeadings } from './types';
|
|
1
|
+
import { IForm, IFormStep, IFormSubmitPayload, IFormGroupsHeadings, IFormGroupLayout } from './types';
|
|
2
2
|
import { InputVariant, InputSize, InputRounded, TimelineTextPosition, ButtonProps } from '../../types';
|
|
3
3
|
interface Props {
|
|
4
4
|
schema: IForm[] | IForm[][];
|
|
@@ -11,6 +11,14 @@ interface Props {
|
|
|
11
11
|
footer?: boolean;
|
|
12
12
|
groupsHeadings?: IFormGroupsHeadings;
|
|
13
13
|
groupHeadingsDescription?: IFormGroupsHeadings;
|
|
14
|
+
/**
|
|
15
|
+
* Visual layout for grouped schemas (`schema: IForm[][]`).
|
|
16
|
+
* - `'basic'` (default) — each group is a card with a header and a body
|
|
17
|
+
* - `'accordion'` — each group is an `AccordionItem` with the heading as the trigger
|
|
18
|
+
*
|
|
19
|
+
* Has no effect on flat schemas. Backward compatible.
|
|
20
|
+
*/
|
|
21
|
+
groupLayout?: IFormGroupLayout;
|
|
14
22
|
tabs?: IFormStep[];
|
|
15
23
|
submitText?: string;
|
|
16
24
|
submitProps?: ButtonProps;
|
|
@@ -72,12 +80,14 @@ declare const __VLS_component: import('vue').DefineComponent<Props, {
|
|
|
72
80
|
clearErrors: () => void;
|
|
73
81
|
setFieldValue: (name: string, value: any, data?: any) => Promise<void>;
|
|
74
82
|
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
83
|
+
onChange: (values: Record<string, any>) => any;
|
|
75
84
|
onSubmit: (payload: IFormSubmitPayload, close: () => void) => any;
|
|
76
85
|
onCancel: () => any;
|
|
77
86
|
onAddonAction: (action: string) => any;
|
|
78
87
|
onStepChange: (step: number) => any;
|
|
79
88
|
onBack: () => any;
|
|
80
89
|
}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{
|
|
90
|
+
onOnChange?: (values: Record<string, any>) => any;
|
|
81
91
|
onOnSubmit?: (payload: IFormSubmitPayload, close: () => void) => any;
|
|
82
92
|
onOnCancel?: () => any;
|
|
83
93
|
onOnAddonAction?: (action: string) => any;
|
|
@@ -98,6 +108,8 @@ declare const __VLS_component: import('vue').DefineComponent<Props, {
|
|
|
98
108
|
schemaLoading: boolean;
|
|
99
109
|
groupsHeadings: IFormGroupsHeadings;
|
|
100
110
|
groupHeadingsDescription: IFormGroupsHeadings;
|
|
111
|
+
groupLayout: IFormGroupLayout;
|
|
112
|
+
tabs: IFormStep[];
|
|
101
113
|
submitText: string;
|
|
102
114
|
showCancel: boolean;
|
|
103
115
|
groupClass: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./Form.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import r from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const p = /* @__PURE__ */ r(o, [["__scopeId", "data-v-db13df10"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
p as default
|
|
7
7
|
};
|