vlite3 1.4.1 → 1.4.3
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/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 +3 -2
- 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/CommandPalette/CommandPaletteContent.vue2.js +1 -1
- package/components/CommandPalette/{CommandPaletteItem.vue2.js → CommandPaletteItem.vue.js} +1 -1
- 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 +10 -8
- 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.d.ts +2 -0
- package/components/Dropdown/DropdownMenu.vue.js +1 -1
- package/components/Dropdown/DropdownMenu.vue2.js +44 -42
- package/components/Dropdown/composables/useDropdownHydration.d.ts +4 -0
- package/components/Dropdown/composables/useDropdownNavigation.js +30 -18
- package/components/Form/FormField.vue.js +14 -11
- 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.js +1 -1
- package/components/PermissionMatrix/PermissionTopBar.vue.js +3 -2
- package/components/Screen/ScreenFilter.vue.js +19 -18
- 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.js +14 -13
- package/components/index.d.ts +1 -0
- package/index.d.ts +1 -0
- package/index.js +153 -151
- package/package.json +2 -2
- package/style.css +1 -1
- package/types/appshell.type.d.ts +2 -1
- package/types/styles.d.ts +2 -0
- package/components/Dropdown/DropdownGroupedLayout.vue.js +0 -75
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import { defineComponent as R, computed as L, ref as V, openBlock as t, createElementBlock as s, normalizeClass as P, createElementVNode as a, createBlock as l, resolveDynamicComponent as v, mergeProps as k, withCtx as p, createTextVNode as E, toDisplayString as m, createCommentVNode as i, Fragment as d, renderList as _, unref as $ } from "vue";
|
|
2
|
+
import N from "../Dropdown/Dropdown.vue.js";
|
|
3
|
+
import h from "../Icon.vue.js";
|
|
4
|
+
import "../../core/config.js";
|
|
5
|
+
/* empty css */
|
|
6
|
+
/* empty css */
|
|
7
|
+
/* empty css */
|
|
8
|
+
import { normalizeRoutePrefix as S, categoriesToDropdownOptions as z, buildCategoryRoute as O } from "./utils.js";
|
|
9
|
+
const T = {
|
|
10
|
+
class: "flex items-center gap-1 overflow-x-auto py-2 -mx-1 px-1 scrollbar-thin",
|
|
11
|
+
style: { "will-change": "transform", contain: "layout style" }
|
|
12
|
+
}, F = { class: "truncate max-w-[180px]" }, H = { class: "truncate max-w-[180px]" }, M = { class: "sm:hidden border-t border-border" }, j = {
|
|
13
|
+
key: 0,
|
|
14
|
+
class: "px-2 py-2 bg-muted/30"
|
|
15
|
+
}, q = { class: "flex-1 truncate" }, ee = /* @__PURE__ */ R({
|
|
16
|
+
__name: "CategoryMenuVariant1",
|
|
17
|
+
props: {
|
|
18
|
+
items: {},
|
|
19
|
+
maxDepth: {},
|
|
20
|
+
showIcons: { type: Boolean },
|
|
21
|
+
showAllItem: { type: Boolean },
|
|
22
|
+
allItemLabel: {},
|
|
23
|
+
activeId: {},
|
|
24
|
+
routePrefix: {},
|
|
25
|
+
class: {}
|
|
26
|
+
},
|
|
27
|
+
emits: ["select"],
|
|
28
|
+
setup(B, { emit: A }) {
|
|
29
|
+
const o = B, f = A, w = L(() => o.items || []), b = V(null), C = L(() => S(o.routePrefix)), I = (n) => {
|
|
30
|
+
const c = n.option?.data;
|
|
31
|
+
f("select", c || n);
|
|
32
|
+
}, D = () => {
|
|
33
|
+
f("select", { id: "all", title: o.allItemLabel });
|
|
34
|
+
}, u = (n, c = []) => O(o.routePrefix, n, c), x = (n) => n ? "router-link" : "button", g = (n) => n ? { to: n } : { type: "button" }, y = (n) => o.activeId ? n.id === o.activeId || (n.children || []).some((c) => y(c)) : !1;
|
|
35
|
+
return (n, c) => (t(), s("nav", {
|
|
36
|
+
class: P(["relative w-full", o.class]),
|
|
37
|
+
role: "navigation",
|
|
38
|
+
"aria-label": "Categories"
|
|
39
|
+
}, [
|
|
40
|
+
a("div", T, [
|
|
41
|
+
o.showAllItem ? (t(), l(v(x(C.value)), k({ key: 0 }, g(C.value), {
|
|
42
|
+
class: "shrink-0 px-3 py-1.5 text-sm font-medium rounded-md text-muted-foreground hover:text-foreground hover:bg-accent transition-colors",
|
|
43
|
+
onClick: D
|
|
44
|
+
}), {
|
|
45
|
+
default: p(() => [
|
|
46
|
+
E(m(o.allItemLabel), 1)
|
|
47
|
+
]),
|
|
48
|
+
_: 1
|
|
49
|
+
}, 16)) : i("", !0),
|
|
50
|
+
(t(!0), s(d, null, _(w.value, (e) => (t(), s(d, {
|
|
51
|
+
key: e.id
|
|
52
|
+
}, [
|
|
53
|
+
e.children && e.children.length > 0 ? (t(), l($(N), {
|
|
54
|
+
key: 0,
|
|
55
|
+
options: $(z)(e.children, o.routePrefix, [e]),
|
|
56
|
+
maxHeight: "500px",
|
|
57
|
+
"close-on-select": !0,
|
|
58
|
+
searchable: !1,
|
|
59
|
+
"show-selected-label": !1,
|
|
60
|
+
"show-selected-icon": !1,
|
|
61
|
+
selectable: !0,
|
|
62
|
+
placement: "bottom-start",
|
|
63
|
+
offset: [0, 6],
|
|
64
|
+
"menu-id": `cat-menu-tabs-${e.id}`,
|
|
65
|
+
"nested-position": "right-start",
|
|
66
|
+
"nested-offset": [0, -5],
|
|
67
|
+
trigger: "hover",
|
|
68
|
+
class: "shrink-0",
|
|
69
|
+
onOnSelect: I
|
|
70
|
+
}, {
|
|
71
|
+
trigger: p(({ isOpen: r }) => [
|
|
72
|
+
a("button", {
|
|
73
|
+
type: "button",
|
|
74
|
+
class: P([
|
|
75
|
+
"inline-flex items-center gap-1.5 px-3 py-1.5 text-sm font-medium rounded-md transition-colors",
|
|
76
|
+
y(e) || r ? "bg-primary/10 text-primary" : "text-muted-foreground hover:text-foreground hover:bg-accent"
|
|
77
|
+
])
|
|
78
|
+
}, [
|
|
79
|
+
o.showIcons && e.icon ? (t(), l(h, {
|
|
80
|
+
key: 0,
|
|
81
|
+
icon: e.icon,
|
|
82
|
+
class: "w-3.5 h-3.5 shrink-0"
|
|
83
|
+
}, null, 8, ["icon"])) : i("", !0),
|
|
84
|
+
a("span", F, m(e.title || e.name), 1),
|
|
85
|
+
e.children && e.children.length > 0 ? (t(), l(h, {
|
|
86
|
+
key: 1,
|
|
87
|
+
icon: "lucide:chevron-down",
|
|
88
|
+
class: "w-3 h-3 opacity-70 shrink-0"
|
|
89
|
+
})) : i("", !0)
|
|
90
|
+
], 2)
|
|
91
|
+
]),
|
|
92
|
+
_: 2
|
|
93
|
+
}, 1032, ["options", "menu-id"])) : (t(), l(v(x(u(e))), k({
|
|
94
|
+
key: 1,
|
|
95
|
+
ref_for: !0
|
|
96
|
+
}, g(u(e)), {
|
|
97
|
+
class: [
|
|
98
|
+
"shrink-0 inline-flex items-center gap-1.5 px-3 py-1.5 text-sm font-medium rounded-md transition-colors",
|
|
99
|
+
y(e) ? "bg-primary/10 text-primary" : "text-muted-foreground hover:text-foreground hover:bg-accent"
|
|
100
|
+
],
|
|
101
|
+
onClick: (r) => f("select", e)
|
|
102
|
+
}), {
|
|
103
|
+
default: p(() => [
|
|
104
|
+
o.showIcons && e.icon ? (t(), l(h, {
|
|
105
|
+
key: 0,
|
|
106
|
+
icon: e.icon,
|
|
107
|
+
class: "w-3.5 h-3.5 shrink-0"
|
|
108
|
+
}, null, 8, ["icon"])) : i("", !0),
|
|
109
|
+
a("span", H, m(e.title || e.name), 1)
|
|
110
|
+
]),
|
|
111
|
+
_: 2
|
|
112
|
+
}, 1040, ["class", "onClick"]))
|
|
113
|
+
], 64))), 128))
|
|
114
|
+
]),
|
|
115
|
+
a("div", M, [
|
|
116
|
+
(t(!0), s(d, null, _(w.value, (e) => (t(), s(d, {
|
|
117
|
+
key: `m-${e.id}`
|
|
118
|
+
}, [
|
|
119
|
+
b.value === e.id && e.children ? (t(), s("div", j, [
|
|
120
|
+
(t(!0), s(d, null, _(e.children, (r) => (t(), l(v(x(u(r, [e]))), k({
|
|
121
|
+
key: r.id
|
|
122
|
+
}, { ref_for: !0 }, g(u(r, [e])), {
|
|
123
|
+
class: "w-full flex items-center gap-2 px-3 py-2 text-sm rounded-md text-foreground/90 hover:bg-accent text-left",
|
|
124
|
+
onClick: (G) => {
|
|
125
|
+
I({ value: r.id, option: { data: r } }), b.value = null;
|
|
126
|
+
}
|
|
127
|
+
}), {
|
|
128
|
+
default: p(() => [
|
|
129
|
+
o.showIcons && r.icon ? (t(), l(h, {
|
|
130
|
+
key: 0,
|
|
131
|
+
icon: r.icon,
|
|
132
|
+
class: "w-4 h-4 shrink-0 opacity-80"
|
|
133
|
+
}, null, 8, ["icon"])) : i("", !0),
|
|
134
|
+
a("span", q, m(r.title || r.name), 1)
|
|
135
|
+
]),
|
|
136
|
+
_: 2
|
|
137
|
+
}, 1040, ["onClick"]))), 128))
|
|
138
|
+
])) : i("", !0)
|
|
139
|
+
], 64))), 128))
|
|
140
|
+
])
|
|
141
|
+
], 2));
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
export {
|
|
145
|
+
ee as default
|
|
146
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { CategoryMenuItem } from './types';
|
|
2
|
+
interface Props {
|
|
3
|
+
items: CategoryMenuItem[];
|
|
4
|
+
maxDepth: number;
|
|
5
|
+
showIcons: boolean;
|
|
6
|
+
showImages: boolean;
|
|
7
|
+
showDescriptions: boolean;
|
|
8
|
+
megaColumns: number;
|
|
9
|
+
activeId: string | number | null | undefined;
|
|
10
|
+
routePrefix?: string;
|
|
11
|
+
class?: string;
|
|
12
|
+
}
|
|
13
|
+
declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
14
|
+
select: (item: import('../CategoryManager').CategoryItem) => any;
|
|
15
|
+
}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{
|
|
16
|
+
onSelect?: (item: import('../CategoryManager').CategoryItem) => any;
|
|
17
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLElement>;
|
|
18
|
+
export default _default;
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import { defineComponent as V, computed as u, ref as I, onMounted as A, openBlock as s, createElementBlock as l, normalizeClass as M, createVNode as y, unref as L, withCtx as f, createCommentVNode as d, createElementVNode as m, toDisplayString as v, createTextVNode as N, Fragment as D, renderList as S, createBlock as b, resolveDynamicComponent as z, mergeProps as E } from "vue";
|
|
2
|
+
import R from "../Dropdown/Dropdown.vue.js";
|
|
3
|
+
import k from "../Icon.vue.js";
|
|
4
|
+
import "../../core/config.js";
|
|
5
|
+
/* empty css */
|
|
6
|
+
/* empty css */
|
|
7
|
+
/* empty css */
|
|
8
|
+
import j from "../Button.vue.js";
|
|
9
|
+
import { categoriesToDropdownOptions as H, buildCategoryRoute as q } from "./utils.js";
|
|
10
|
+
const G = {
|
|
11
|
+
class: "flex items-center gap-1 overflow-x-auto -mx-1 px-1 scrollbar-thin",
|
|
12
|
+
style: { "will-change": "transform", contain: "layout style" }
|
|
13
|
+
}, J = ["onMouseenter", "onFocus", "onClick"], K = { class: "truncate max-w-[180px]" }, Q = { class: "truncate max-w-[180px]" }, U = {
|
|
14
|
+
key: 0,
|
|
15
|
+
class: "flex items-center gap-4 p-4 bg-muted/20 border-t border-border"
|
|
16
|
+
}, W = ["src", "alt"], X = { class: "flex-1 min-w-0" }, Y = { class: "font-semibold text-foreground text-sm truncate" }, Z = {
|
|
17
|
+
key: 0,
|
|
18
|
+
class: "text-xs text-muted-foreground mt-1 line-clamp-2"
|
|
19
|
+
}, ce = /* @__PURE__ */ V({
|
|
20
|
+
__name: "CategoryMenuVariant2",
|
|
21
|
+
props: {
|
|
22
|
+
items: {},
|
|
23
|
+
maxDepth: {},
|
|
24
|
+
showIcons: { type: Boolean },
|
|
25
|
+
showImages: { type: Boolean },
|
|
26
|
+
showDescriptions: { type: Boolean },
|
|
27
|
+
megaColumns: {},
|
|
28
|
+
activeId: {},
|
|
29
|
+
routePrefix: {},
|
|
30
|
+
class: {}
|
|
31
|
+
},
|
|
32
|
+
emits: ["select"],
|
|
33
|
+
setup(a, { emit: O }) {
|
|
34
|
+
const r = a, p = O, g = u(() => r.items || []), i = I(null), x = I(!1), o = u(
|
|
35
|
+
() => g.value.find((t) => t.id === i.value) || null
|
|
36
|
+
), C = u(
|
|
37
|
+
() => o.value?.children ? H(o.value.children, r.routePrefix, [o.value]) : []
|
|
38
|
+
), _ = u(() => C.value.length > 0), h = (t) => {
|
|
39
|
+
i.value = t.id;
|
|
40
|
+
}, $ = (t) => q(r.routePrefix, t), B = (t) => t ? "router-link" : "button", F = (t) => t ? { to: t } : { type: "button" }, w = (t) => r.activeId ? t.id === r.activeId ? !0 : (t.children || []).some((n) => w(n)) : !1, P = (t) => {
|
|
41
|
+
const n = t.option?.data;
|
|
42
|
+
p("select", n || t);
|
|
43
|
+
}, T = u(() => Math.max(1, Math.min(6, r.megaColumns || 4)));
|
|
44
|
+
return A(() => {
|
|
45
|
+
if (i.value !== null) return;
|
|
46
|
+
const t = g.value.find((n) => n.children && n.children.length > 0);
|
|
47
|
+
t && (i.value = t.id);
|
|
48
|
+
}), (t, n) => (s(), l("nav", {
|
|
49
|
+
class: M(["relative w-full flex", r.class]),
|
|
50
|
+
role: "navigation",
|
|
51
|
+
"aria-label": "Categories"
|
|
52
|
+
}, [
|
|
53
|
+
y(L(R), {
|
|
54
|
+
options: C.value,
|
|
55
|
+
disabled: !_.value,
|
|
56
|
+
layout: "grouped",
|
|
57
|
+
columns: T.value,
|
|
58
|
+
"close-on-select": !0,
|
|
59
|
+
searchable: !1,
|
|
60
|
+
"show-selected-label": !1,
|
|
61
|
+
"show-selected-icon": !1,
|
|
62
|
+
selectable: !0,
|
|
63
|
+
trigger: "hover",
|
|
64
|
+
"keep-alive": !0,
|
|
65
|
+
placement: "bottom-start",
|
|
66
|
+
offset: [0, 4],
|
|
67
|
+
maxHeight: "500px",
|
|
68
|
+
"menu-id": "cat-menu-mega",
|
|
69
|
+
"nested-position": "right-start",
|
|
70
|
+
"nested-offset": [0, -5],
|
|
71
|
+
width: "w-full max-w-5xl",
|
|
72
|
+
onOnSelect: P,
|
|
73
|
+
onOnOpen: n[1] || (n[1] = (e) => x.value = !0),
|
|
74
|
+
onOnClose: n[2] || (n[2] = (e) => x.value = !1)
|
|
75
|
+
}, {
|
|
76
|
+
trigger: f(() => [
|
|
77
|
+
m("div", G, [
|
|
78
|
+
(s(!0), l(D, null, S(g.value, (e) => (s(), l(D, {
|
|
79
|
+
key: e.id
|
|
80
|
+
}, [
|
|
81
|
+
e.children && e.children.length > 0 ? (s(), l("button", {
|
|
82
|
+
key: 0,
|
|
83
|
+
type: "button",
|
|
84
|
+
tabindex: "0",
|
|
85
|
+
class: M([
|
|
86
|
+
"shrink-0 inline-flex items-center gap-1.5 px-3 py-1.5 text-sm font-medium rounded-md transition-colors",
|
|
87
|
+
w(e) || i.value === e.id && _.value && x.value ? "bg-primary/10 text-primary" : "text-muted-foreground hover:text-foreground hover:bg-accent"
|
|
88
|
+
]),
|
|
89
|
+
onMouseenter: (c) => h(e),
|
|
90
|
+
onFocus: (c) => h(e),
|
|
91
|
+
onClick: (c) => p("select", e)
|
|
92
|
+
}, [
|
|
93
|
+
r.showIcons && e.icon ? (s(), b(k, {
|
|
94
|
+
key: 0,
|
|
95
|
+
icon: e.icon,
|
|
96
|
+
class: "w-3.5 h-3.5 shrink-0"
|
|
97
|
+
}, null, 8, ["icon"])) : d("", !0),
|
|
98
|
+
m("span", K, v(e.title || e.name), 1),
|
|
99
|
+
y(k, {
|
|
100
|
+
icon: "lucide:chevron-down",
|
|
101
|
+
class: "w-3 h-3 opacity-60"
|
|
102
|
+
})
|
|
103
|
+
], 42, J)) : (s(), b(z(B($(e))), E({
|
|
104
|
+
key: 1,
|
|
105
|
+
ref_for: !0
|
|
106
|
+
}, F($(e)), {
|
|
107
|
+
tabindex: "0",
|
|
108
|
+
class: [
|
|
109
|
+
"shrink-0 inline-flex items-center gap-1.5 px-3 py-1.5 text-sm font-medium rounded-md transition-colors",
|
|
110
|
+
w(e) ? "bg-primary/10 text-primary" : "text-muted-foreground hover:text-foreground hover:bg-accent"
|
|
111
|
+
],
|
|
112
|
+
onMouseenter: (c) => h(e),
|
|
113
|
+
onFocus: (c) => h(e),
|
|
114
|
+
onClick: (c) => p("select", e)
|
|
115
|
+
}), {
|
|
116
|
+
default: f(() => [
|
|
117
|
+
r.showIcons && e.icon ? (s(), b(k, {
|
|
118
|
+
key: 0,
|
|
119
|
+
icon: e.icon,
|
|
120
|
+
class: "w-3.5 h-3.5 shrink-0"
|
|
121
|
+
}, null, 8, ["icon"])) : d("", !0),
|
|
122
|
+
m("span", Q, v(e.title || e.name), 1)
|
|
123
|
+
]),
|
|
124
|
+
_: 2
|
|
125
|
+
}, 1040, ["class", "onMouseenter", "onFocus", "onClick"]))
|
|
126
|
+
], 64))), 128))
|
|
127
|
+
])
|
|
128
|
+
]),
|
|
129
|
+
footer: f(() => [
|
|
130
|
+
o.value && (a.showImages && o.value.image || a.showDescriptions && o.value.description) ? (s(), l("div", U, [
|
|
131
|
+
a.showImages && o.value.image ? (s(), l("img", {
|
|
132
|
+
key: 0,
|
|
133
|
+
src: o.value.image,
|
|
134
|
+
alt: o.value.title || "Category",
|
|
135
|
+
class: "w-24 h-16 object-cover rounded-md shadow-sm border border-border"
|
|
136
|
+
}, null, 8, W)) : d("", !0),
|
|
137
|
+
m("div", X, [
|
|
138
|
+
m("h4", Y, v(o.value.title || o.value.name), 1),
|
|
139
|
+
a.showDescriptions && o.value.description ? (s(), l("p", Z, v(o.value.description), 1)) : d("", !0)
|
|
140
|
+
]),
|
|
141
|
+
y(j, {
|
|
142
|
+
variant: "outline",
|
|
143
|
+
size: "sm",
|
|
144
|
+
class: "shrink-0",
|
|
145
|
+
"icon-right": "lucide:arrow-right",
|
|
146
|
+
onClick: n[0] || (n[0] = (e) => p("select", o.value))
|
|
147
|
+
}, {
|
|
148
|
+
default: f(() => [
|
|
149
|
+
N(" Shop All " + v(o.value.title || o.value.name), 1)
|
|
150
|
+
]),
|
|
151
|
+
_: 1
|
|
152
|
+
})
|
|
153
|
+
])) : d("", !0)
|
|
154
|
+
]),
|
|
155
|
+
_: 1
|
|
156
|
+
}, 8, ["options", "disabled", "columns"])
|
|
157
|
+
], 2));
|
|
158
|
+
}
|
|
159
|
+
});
|
|
160
|
+
export {
|
|
161
|
+
ce as default
|
|
162
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { CategoryItem } from '../CategoryManager/types';
|
|
2
|
+
export type CategoryMenuVariant = 'tabs' | 'mega' | 'sidebar';
|
|
3
|
+
export type CategoryMenuItem = CategoryItem;
|
|
4
|
+
export interface CategoryMenuProps {
|
|
5
|
+
/** Hierarchical category tree. Accepts the same shape as `CategoryManager`. */
|
|
6
|
+
items?: CategoryMenuItem[];
|
|
7
|
+
/** Layout variant. See {@link CategoryMenuVariant}. */
|
|
8
|
+
variant?: CategoryMenuVariant;
|
|
9
|
+
/** Maximum depth to render. `1` = top-level only. Defaults to `2`. */
|
|
10
|
+
maxDepth?: number;
|
|
11
|
+
/** Whether to render the icon prefix on each item. Defaults to `true`. */
|
|
12
|
+
showIcons?: boolean;
|
|
13
|
+
/** Show an "All" / "Shop all" pseudo-item at the start. */
|
|
14
|
+
showAllItem?: boolean;
|
|
15
|
+
/** Label for the "All" item (only used when `showAllItem` is true). */
|
|
16
|
+
allItemLabel?: string;
|
|
17
|
+
/** When `true`, multiple parent categories can be open at once (sidebar/accordion). */
|
|
18
|
+
multiExpand?: boolean;
|
|
19
|
+
/** Active category id (highlights the matching node). */
|
|
20
|
+
activeId?: string | number | null;
|
|
21
|
+
/** Route prefix used to auto-generate Vue Router links for every category. */
|
|
22
|
+
routePrefix?: string;
|
|
23
|
+
/** Tailwind breakpoint where the desktop mega menu collapses to mobile. */
|
|
24
|
+
mobileBreakpoint?: 'sm' | 'md' | 'lg' | 'xl';
|
|
25
|
+
/** Number of columns in the mega menu. Defaults to `4`. */
|
|
26
|
+
megaColumns?: number;
|
|
27
|
+
/** Whether to render the category image in mega-menu columns. */
|
|
28
|
+
showImages?: boolean;
|
|
29
|
+
/** Whether to render the description in mega-menu columns. */
|
|
30
|
+
showDescriptions?: boolean;
|
|
31
|
+
class?: string;
|
|
32
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { IDropdownOption } from '../../types';
|
|
2
|
+
import { CategoryMenuItem } from './types';
|
|
3
|
+
export declare const CATEGORY_MENU_ROUTE_PREFIX_KEY: unique symbol;
|
|
4
|
+
export declare function slugifyCategorySegment(value: unknown): string;
|
|
5
|
+
export declare function normalizeRoutePrefix(prefix?: string | null): string;
|
|
6
|
+
export declare function buildCategoryRoute(routePrefix: string | undefined | null, item: CategoryMenuItem, ancestors?: CategoryMenuItem[]): string | undefined;
|
|
7
|
+
/**
|
|
8
|
+
* Convert a single CategoryMenuItem into an IDropdownOption.
|
|
9
|
+
* Preserves the original item on `option.data` so consumers can recover
|
|
10
|
+
* it from `@on-select` payloads.
|
|
11
|
+
*/
|
|
12
|
+
export declare function categoryToDropdownOption(item: CategoryMenuItem, routePrefix?: string, ancestors?: CategoryMenuItem[]): IDropdownOption;
|
|
13
|
+
/**
|
|
14
|
+
* Convert a CategoryMenuItem[] tree to an IDropdownOption[] list.
|
|
15
|
+
*/
|
|
16
|
+
export declare function categoriesToDropdownOptions(items: CategoryMenuItem[], routePrefix?: string, ancestors?: CategoryMenuItem[]): IDropdownOption[];
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
const d = /* @__PURE__ */ Symbol("category-menu-route-prefix"), i = (n) => String(n.slug || n.title || n.name || n.label || n.id || "category");
|
|
2
|
+
function c(n) {
|
|
3
|
+
return String(n ?? "").normalize("NFKD").replace(/[\u0300-\u036f]/g, "").replace(/&/g, " and ").toLowerCase().trim().replace(/['"]/g, "").replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "");
|
|
4
|
+
}
|
|
5
|
+
function g(n) {
|
|
6
|
+
if (!n) return "";
|
|
7
|
+
const r = n.trim();
|
|
8
|
+
return r ? (r.startsWith("/") ? r : `/${r}`).replace(/\/+$/g, "") : "";
|
|
9
|
+
}
|
|
10
|
+
function u(n, r, e = []) {
|
|
11
|
+
const o = g(n);
|
|
12
|
+
if (!o) return;
|
|
13
|
+
const t = [...e, r].map((l) => c(i(l))).filter(Boolean).join("-");
|
|
14
|
+
return t ? `${o}/${t}` : o;
|
|
15
|
+
}
|
|
16
|
+
function a(n, r, e = []) {
|
|
17
|
+
return {
|
|
18
|
+
label: n.title || n.name || "Untitled",
|
|
19
|
+
to: u(r, n, e),
|
|
20
|
+
value: n.id,
|
|
21
|
+
icon: n.icon,
|
|
22
|
+
description: n.description,
|
|
23
|
+
badge: n.badge,
|
|
24
|
+
// Preserve any consumer-specific fields by attaching the original item.
|
|
25
|
+
// The Dropdown passes `option` through `@on-select`, so the consumer
|
|
26
|
+
// can do `option.data` to recover the original CategoryMenuItem.
|
|
27
|
+
data: n,
|
|
28
|
+
// Recursively convert children — Dropdown's nested-Dropdown machinery
|
|
29
|
+
// picks these up automatically and renders them in a side popover.
|
|
30
|
+
children: n.children && n.children.length > 0 ? n.children.map(
|
|
31
|
+
(o) => a(o, r, [...e, n])
|
|
32
|
+
) : void 0
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
function p(n, r, e = []) {
|
|
36
|
+
return (n || []).map((o) => a(o, r, e));
|
|
37
|
+
}
|
|
38
|
+
export {
|
|
39
|
+
d as CATEGORY_MENU_ROUTE_PREFIX_KEY,
|
|
40
|
+
u as buildCategoryRoute,
|
|
41
|
+
p as categoriesToDropdownOptions,
|
|
42
|
+
a as categoryToDropdownOption,
|
|
43
|
+
g as normalizeRoutePrefix,
|
|
44
|
+
c as slugifyCategorySegment
|
|
45
|
+
};
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { TooltTipPlacement } from 'v-tooltip-lite/types';
|
|
2
|
-
import { ButtonProps } from '../../types';
|
|
2
|
+
import { ButtonProps, InputSize, InputVariant, InputRounded } from '../../types';
|
|
3
3
|
interface Props {
|
|
4
4
|
modelValue?: string;
|
|
5
5
|
disabled?: boolean;
|
|
6
|
-
size?:
|
|
6
|
+
size?: InputSize;
|
|
7
|
+
variant?: InputVariant;
|
|
8
|
+
rounded?: InputRounded;
|
|
7
9
|
position?: TooltTipPlacement;
|
|
8
10
|
btnProps?: ButtonProps;
|
|
9
11
|
showInput?: boolean;
|
|
@@ -15,7 +17,9 @@ declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, imp
|
|
|
15
17
|
onChange?: (value: string) => any;
|
|
16
18
|
"onUpdate:modelValue"?: (value: string) => any;
|
|
17
19
|
}>, {
|
|
18
|
-
|
|
20
|
+
variant: InputVariant;
|
|
21
|
+
size: InputSize;
|
|
22
|
+
rounded: InputRounded;
|
|
19
23
|
disabled: boolean;
|
|
20
24
|
modelValue: string;
|
|
21
25
|
position: TooltTipPlacement;
|
|
@@ -1,97 +1,111 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
1
|
+
import { defineComponent as C, ref as p, watch as d, openBlock as s, createBlock as v, unref as b, withCtx as u, createElementBlock as h, createVNode as c, createCommentVNode as m, createElementVNode as n, normalizeClass as $, normalizeStyle as B } from "vue";
|
|
2
|
+
import O from "../Dropdown/Dropdown.vue.js";
|
|
3
3
|
import "@iconify/vue";
|
|
4
|
-
import
|
|
4
|
+
import y from "../Input.vue.js";
|
|
5
5
|
/* empty css */
|
|
6
6
|
import "../../core/config.js";
|
|
7
|
+
/* empty css */
|
|
7
8
|
/* empty css */
|
|
8
|
-
import
|
|
9
|
-
import
|
|
9
|
+
import E from "../Button.vue.js";
|
|
10
|
+
import _ from "./ColorIro.vue2.js";
|
|
10
11
|
/* empty css */
|
|
11
|
-
import { useEyeDropper as
|
|
12
|
-
const
|
|
12
|
+
import { useEyeDropper as I } from "@vueuse/core";
|
|
13
|
+
const N = { class: "absolute left-2.5 top-1/2 -translate-y-1/2 flex items-center justify-center z-20 pointer-events-none" }, j = {
|
|
13
14
|
key: 0,
|
|
14
15
|
class: "p-1 w-max flex flex-col justify-center"
|
|
15
|
-
},
|
|
16
|
+
}, D = {
|
|
16
17
|
key: 0,
|
|
17
18
|
class: "flex items-center gap-1.5 w-full"
|
|
18
|
-
},
|
|
19
|
+
}, P = { class: "w-32" }, T = /* @__PURE__ */ C({
|
|
19
20
|
__name: "ColorPicker",
|
|
20
21
|
props: {
|
|
21
22
|
modelValue: { default: "#000000" },
|
|
22
23
|
disabled: { type: Boolean, default: !1 },
|
|
23
24
|
size: { default: "md" },
|
|
25
|
+
variant: { default: "outline" },
|
|
26
|
+
rounded: { default: "md" },
|
|
24
27
|
position: { default: "bottom" },
|
|
25
28
|
btnProps: {},
|
|
26
29
|
showInput: { type: Boolean, default: !0 }
|
|
27
30
|
},
|
|
28
31
|
emits: ["update:modelValue", "change"],
|
|
29
|
-
setup(o, { emit:
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
+
setup(o, { emit: x }) {
|
|
33
|
+
const i = o, f = x, r = p(!1), t = p(i.modelValue || "#000000"), { isSupported: V, open: g, sRGBHex: k } = I();
|
|
34
|
+
d(k, (e) => {
|
|
32
35
|
e && (t.value = e);
|
|
33
36
|
});
|
|
34
|
-
const
|
|
37
|
+
const z = async () => {
|
|
35
38
|
try {
|
|
36
39
|
await g();
|
|
37
40
|
} catch (e) {
|
|
38
41
|
console.error("Error opening eyedropper:", e);
|
|
39
42
|
}
|
|
40
43
|
};
|
|
41
|
-
|
|
42
|
-
() =>
|
|
44
|
+
d(
|
|
45
|
+
() => i.modelValue,
|
|
43
46
|
(e) => {
|
|
44
47
|
e && e !== t.value && (t.value = e);
|
|
45
48
|
}
|
|
46
|
-
),
|
|
47
|
-
/^#([0-9A-F]{3,8})$/i.test(e) && e !==
|
|
49
|
+
), d(t, (e) => {
|
|
50
|
+
/^#([0-9A-F]{3,8})$/i.test(e) && e !== i.modelValue && (f("update:modelValue", e), f("change", e));
|
|
48
51
|
});
|
|
49
|
-
const
|
|
52
|
+
const w = (e) => {
|
|
50
53
|
t.value = e;
|
|
51
54
|
};
|
|
52
|
-
return (e, l) => (
|
|
55
|
+
return (e, l) => (s(), v(b(O), {
|
|
53
56
|
disabled: o.disabled,
|
|
54
|
-
class: "w-
|
|
57
|
+
class: "w-full",
|
|
55
58
|
position: o.position,
|
|
56
59
|
offset: [0, 8],
|
|
57
60
|
searchable: !1,
|
|
58
61
|
"close-on-select": !1,
|
|
59
|
-
onOnOpen: l[1] || (l[1] = (
|
|
60
|
-
onOnClose: l[2] || (l[2] = (
|
|
62
|
+
onOnOpen: l[1] || (l[1] = (a) => r.value = !0),
|
|
63
|
+
onOnClose: l[2] || (l[2] = (a) => r.value = !1)
|
|
61
64
|
}, {
|
|
62
|
-
trigger: u(({ isOpen:
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
},
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
65
|
+
trigger: u(({ isOpen: a }) => [
|
|
66
|
+
n("div", {
|
|
67
|
+
class: $(["w-full relative cursor-pointer", [o.disabled ? "opacity-50 pointer-events-none" : ""]])
|
|
68
|
+
}, [
|
|
69
|
+
c(y, {
|
|
70
|
+
"model-value": o.modelValue,
|
|
71
|
+
readonly: "",
|
|
72
|
+
disabled: o.disabled,
|
|
73
|
+
size: o.size,
|
|
74
|
+
variant: o.variant,
|
|
75
|
+
rounded: o.rounded,
|
|
76
|
+
class: "pointer-events-none",
|
|
77
|
+
"input-class": "pl-9 font-mono uppercase cursor-pointer"
|
|
78
|
+
}, null, 8, ["model-value", "disabled", "size", "variant", "rounded"]),
|
|
79
|
+
n("div", N, [
|
|
80
|
+
n("div", {
|
|
81
|
+
class: "w-4 h-4 rounded-full shadow-[inset_0_0_0_1px_rgba(0,0,0,0.1)] dark:shadow-[inset_0_0_0_1px_rgba(255,255,255,0.1)]",
|
|
82
|
+
style: B({ backgroundColor: o.modelValue })
|
|
83
|
+
}, null, 4)
|
|
84
|
+
])
|
|
85
|
+
], 2)
|
|
72
86
|
]),
|
|
73
87
|
default: u(() => [
|
|
74
|
-
|
|
75
|
-
|
|
88
|
+
r.value ? (s(), h("div", j, [
|
|
89
|
+
c(_, {
|
|
76
90
|
color: o.modelValue,
|
|
77
91
|
"show-header": !1,
|
|
78
92
|
size: o.size,
|
|
79
|
-
"onUpdate:color":
|
|
93
|
+
"onUpdate:color": w
|
|
80
94
|
}, {
|
|
81
95
|
bottom: u(() => [
|
|
82
|
-
o.showInput ? (
|
|
83
|
-
|
|
96
|
+
o.showInput ? (s(), h("div", D, [
|
|
97
|
+
b(V) ? (s(), v(E, {
|
|
84
98
|
key: 0,
|
|
85
|
-
onClick:
|
|
99
|
+
onClick: z,
|
|
86
100
|
icon: "pepicons-pop:color-picker",
|
|
87
101
|
variant: "outline",
|
|
88
102
|
size: "sm",
|
|
89
103
|
class: "px-2 shrink-0"
|
|
90
|
-
})) :
|
|
91
|
-
|
|
92
|
-
|
|
104
|
+
})) : m("", !0),
|
|
105
|
+
n("div", P, [
|
|
106
|
+
c(y, {
|
|
93
107
|
modelValue: t.value,
|
|
94
|
-
"onUpdate:modelValue": l[0] || (l[0] = (
|
|
108
|
+
"onUpdate:modelValue": l[0] || (l[0] = (a) => t.value = a),
|
|
95
109
|
size: "sm",
|
|
96
110
|
"show-clear-button": !1,
|
|
97
111
|
placeholder: "#000000",
|
|
@@ -99,16 +113,16 @@ const I = {
|
|
|
99
113
|
"input-class": "font-mono text-xs uppercase "
|
|
100
114
|
}, null, 8, ["modelValue"])
|
|
101
115
|
])
|
|
102
|
-
])) :
|
|
116
|
+
])) : m("", !0)
|
|
103
117
|
]),
|
|
104
118
|
_: 1
|
|
105
119
|
}, 8, ["color", "size"])
|
|
106
|
-
])) :
|
|
120
|
+
])) : m("", !0)
|
|
107
121
|
]),
|
|
108
122
|
_: 1
|
|
109
123
|
}, 8, ["disabled", "position"]));
|
|
110
124
|
}
|
|
111
125
|
});
|
|
112
126
|
export {
|
|
113
|
-
|
|
127
|
+
T as default
|
|
114
128
|
};
|
|
@@ -4,7 +4,7 @@ import k from "../Icon.vue.js";
|
|
|
4
4
|
import { $t as E } from "../../utils/i18n.js";
|
|
5
5
|
import { useCommandPaletteItems as Y } from "./useCommandPaletteItems.js";
|
|
6
6
|
import { useCommandPaletteNav as Z } from "./useCommandPaletteNav.js";
|
|
7
|
-
import ee from "./CommandPaletteItem.
|
|
7
|
+
import ee from "./CommandPaletteItem.vue.js";
|
|
8
8
|
const te = { class: "command-palette-content flex flex-col w-full h-full max-h-[70vh]" }, oe = { class: "flex items-center gap-3 px-4 py-3 border-b border-border/80 shrink-0" }, se = ["placeholder"], ne = ["aria-label"], re = {
|
|
9
9
|
key: 0,
|
|
10
10
|
class: "flex flex-col items-center justify-center py-14 px-6 text-center select-none",
|