vlite3 1.4.1 → 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.
Files changed (57) hide show
  1. package/components/AppShell/AppShell.vue.d.ts +1 -0
  2. package/components/AppShell/AppShell.vue.js +33 -26
  3. package/components/AppShell/AppShellLayoutStorefront.vue.d.ts +54 -0
  4. package/components/AppShell/AppShellLayoutStorefront.vue.js +222 -0
  5. package/components/AppShell/AppShellLayoutStorefront.vue2.js +4 -0
  6. package/components/AsyncSelect/createAsyncSelect.js +3 -2
  7. package/components/CategoryManager/CategoryManager.vue2.js +4 -3
  8. package/components/CategoryMenu/CategoryMenu.vue.d.ts +22 -0
  9. package/components/CategoryMenu/CategoryMenu.vue.js +106 -0
  10. package/components/CategoryMenu/CategoryMenu.vue2.js +4 -0
  11. package/components/CategoryMenu/CategoryMenuVariant1.vue.d.ts +17 -0
  12. package/components/CategoryMenu/CategoryMenuVariant1.vue.js +146 -0
  13. package/components/CategoryMenu/CategoryMenuVariant1.vue2.js +4 -0
  14. package/components/CategoryMenu/CategoryMenuVariant2.vue.d.ts +18 -0
  15. package/components/CategoryMenu/CategoryMenuVariant2.vue.js +162 -0
  16. package/components/CategoryMenu/CategoryMenuVariant2.vue2.js +4 -0
  17. package/components/CategoryMenu/index.d.ts +2 -0
  18. package/components/CategoryMenu/types.d.ts +32 -0
  19. package/components/CategoryMenu/utils.d.ts +16 -0
  20. package/components/CategoryMenu/utils.js +45 -0
  21. package/components/ColorPicker/ColorIro.vue3.js +2 -2
  22. package/components/ColorPicker/ColorPicker.vue.d.ts +7 -3
  23. package/components/ColorPicker/ColorPicker.vue.js +60 -46
  24. package/components/CommandPalette/CommandPaletteContent.vue2.js +1 -1
  25. package/components/CommandPalette/{CommandPaletteItem.vue2.js → CommandPaletteItem.vue.js} +1 -1
  26. package/components/DatePicker.vue.js +5 -4
  27. package/components/DateRangePicker.vue.js +3 -2
  28. package/components/Dropdown/Dropdown.vue.d.ts +4 -1
  29. package/components/Dropdown/Dropdown.vue.js +8 -7
  30. package/components/Dropdown/DropdownGroupedLayout.vue2.js +5 -2
  31. package/components/Dropdown/DropdownGroupedLayout.vue3.js +111 -0
  32. package/components/Dropdown/DropdownItem.vue.d.ts +2 -2
  33. package/components/Dropdown/DropdownItem.vue.js +66 -49
  34. package/components/Dropdown/DropdownMenu.vue.js +1 -1
  35. package/components/Dropdown/{DropdownMenu.vue2.js → DropdownMenu.vue3.js} +40 -40
  36. package/components/Dropdown/composables/useDropdownHydration.d.ts +4 -0
  37. package/components/Dropdown/composables/useDropdownNavigation.js +30 -18
  38. package/components/Form/FormField.vue.js +14 -11
  39. package/components/IconPicker.vue.js +3 -2
  40. package/components/ImportData/ImportStep2.vue.js +3 -2
  41. package/components/MultiSelect/composables/useMultiSelectHydration.d.ts +4 -0
  42. package/components/NavbarCommandPalette.vue.js +1 -1
  43. package/components/PermissionMatrix/PermissionTopBar.vue.js +3 -2
  44. package/components/Screen/ScreenFilter.vue.js +20 -19
  45. package/components/SidebarMenu/SidebarMenuItem.vue.js +3 -2
  46. package/components/Switch.vue.js +8 -8
  47. package/components/Tooltip.vue.js +1 -0
  48. package/components/Workbook/Sheet.vue.js +14 -13
  49. package/components/index.d.ts +1 -0
  50. package/index.d.ts +1 -0
  51. package/index.js +153 -151
  52. package/package.json +2 -2
  53. package/style.css +1 -1
  54. package/types/appshell.type.d.ts +2 -1
  55. package/types/styles.d.ts +2 -0
  56. package/components/Dropdown/DropdownGroupedLayout.vue.js +0 -75
  57. /package/components/ColorPicker/{ColorIro.vue2.js → ColorIro.vue.js} +0 -0
@@ -21,6 +21,7 @@ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<Ap
21
21
  mobileMenuVariant: "sidepanel" | "dropdown";
22
22
  breadcrumb: boolean;
23
23
  renderNestedTabs: boolean;
24
+ categoryRoutePrefix: string;
24
25
  logoClass: string;
25
26
  sidebarToggle: boolean;
26
27
  breadcrumbVariant: import('../Breadcrumb').BreadcrumbVariant;
@@ -1,14 +1,16 @@
1
- import { defineComponent as u, computed as d, markRaw as e, openBlock as f, createBlock as i, resolveDynamicComponent as m, createSlots as c, renderList as p, withCtx as b, renderSlot as _, normalizeProps as g, guardReactiveProps as h } from "vue";
2
- import { useAppShell as y } from "./useAppShell.js";
3
- import o from "./AppShellLayoutSidebarFirst.vue.js";
4
- import v from "./AppShellLayoutDashboard.vue.js";
5
- import B from "./AppShellLayoutDock.vue.js";
6
- import C from "./AppShellLayoutClassic.vue.js";
7
- import $ from "./AppShellLayoutHeaderShell.vue.js";
8
- const S = {
1
+ import { defineComponent as f, computed as o, provide as d, markRaw as e, openBlock as m, createBlock as c, resolveDynamicComponent as p, createSlots as _, renderList as b, withCtx as g, renderSlot as y, normalizeProps as h, guardReactiveProps as v } from "vue";
2
+ import { useAppShell as C } from "./useAppShell.js";
3
+ import { normalizeRoutePrefix as B, CATEGORY_MENU_ROUTE_PREFIX_KEY as P } from "../CategoryMenu/utils.js";
4
+ import l from "./AppShellLayoutSidebarFirst.vue.js";
5
+ import R from "./AppShellLayoutDashboard.vue.js";
6
+ import $ from "./AppShellLayoutDock.vue.js";
7
+ import S from "./AppShellLayoutClassic.vue.js";
8
+ import k from "./AppShellLayoutHeaderShell.vue.js";
9
+ import x from "./AppShellLayoutStorefront.vue.js";
10
+ const A = {
9
11
  inheritAttrs: !1
10
- }, V = /* @__PURE__ */ u({
11
- ...S,
12
+ }, Y = /* @__PURE__ */ f({
13
+ ...A,
12
14
  __name: "AppShell",
13
15
  props: {
14
16
  variant: { default: "sidebar" },
@@ -39,38 +41,43 @@ const S = {
39
41
  breadcrumbLabels: {},
40
42
  breadcrumbHomeIcon: { default: "lucide:home" },
41
43
  breadcrumbClass: { default: "" },
42
- layoutMode: { default: "variant1" }
44
+ layoutMode: { default: "variant1" },
45
+ categoryRoutePrefix: { default: "" }
43
46
  },
44
47
  emits: ["toggle-mobile"],
45
- setup(l) {
46
- const a = l;
47
- y(a, !0);
48
- const s = d(() => {
48
+ setup(n) {
49
+ const a = n;
50
+ C(a, !0);
51
+ const s = o(() => B(a.categoryRoutePrefix));
52
+ d(P, s);
53
+ const u = o(() => {
49
54
  switch (a.layoutMode) {
50
55
  case "variant1":
51
- return e(o);
56
+ return e(l);
52
57
  case "variant2":
53
- return e(v);
58
+ return e(R);
54
59
  case "variant3":
55
- return e(B);
60
+ return e($);
56
61
  case "variant4":
57
- return e(C);
62
+ return e(S);
58
63
  case "variant5":
59
- return e($);
64
+ return e(k);
65
+ case "variant6":
66
+ return e(x);
60
67
  default:
61
- return e(o);
68
+ return e(l);
62
69
  }
63
70
  });
64
- return (t, k) => (f(), i(m(s.value), null, c({ _: 2 }, [
65
- p(t.$slots, (A, r) => ({
71
+ return (t, E) => (m(), c(p(u.value), null, _({ _: 2 }, [
72
+ b(t.$slots, (T, r) => ({
66
73
  name: r,
67
- fn: b((n) => [
68
- _(t.$slots, r, g(h(n ?? {})))
74
+ fn: g((i) => [
75
+ y(t.$slots, r, h(v(i ?? {})))
69
76
  ])
70
77
  }))
71
78
  ]), 1024));
72
79
  }
73
80
  });
74
81
  export {
75
- V as default
82
+ Y as default
76
83
  };
@@ -0,0 +1,54 @@
1
+ declare function __VLS_template(): {
2
+ attrs: Partial<{}>;
3
+ slots: {
4
+ announcement?(_: {}): any;
5
+ 'mobile-trigger'?(_: {
6
+ isOpen: boolean;
7
+ toggle: () => boolean;
8
+ }): any;
9
+ left?(_: {}): any;
10
+ left?(_: {}): any;
11
+ nav?(_: {}): any;
12
+ nav?(_: {}): any;
13
+ logo?(_: {}): any;
14
+ logo?(_: {}): any;
15
+ center?(_: {}): any;
16
+ center?(_: {}): any;
17
+ search?(_: {}): any;
18
+ search?(_: {}): any;
19
+ actions?(_: {}): any;
20
+ actions?(_: {}): any;
21
+ right?(_: {}): any;
22
+ right?(_: {}): any;
23
+ 'mobile-search'?(_: {}): any;
24
+ categories?(_: {
25
+ categoryRoutePrefix: string;
26
+ }): any;
27
+ categories?(_: {
28
+ categoryRoutePrefix: string;
29
+ }): any;
30
+ main?(_: {}): any;
31
+ footer?(_: {}): any;
32
+ 'mobile-sidebar-header'?(_: {}): any;
33
+ 'mobile-sidebar'?(_: {}): any;
34
+ 'mobile-nav'?(_: {}): any;
35
+ 'mobile-sidebar-footer'?(_: {}): any;
36
+ };
37
+ refs: {
38
+ layoutMainRef: HTMLElement;
39
+ mainScrollRef: HTMLDivElement;
40
+ };
41
+ rootEl: HTMLDivElement;
42
+ };
43
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
44
+ declare const __VLS_component: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {
45
+ layoutMainRef: HTMLElement;
46
+ mainScrollRef: HTMLDivElement;
47
+ }, HTMLDivElement>;
48
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
49
+ export default _default;
50
+ type __VLS_WithTemplateSlots<T, S> = T & {
51
+ new (): {
52
+ $slots: S;
53
+ };
54
+ };
@@ -0,0 +1,222 @@
1
+ import { defineComponent as T, inject as P, computed as v, openBlock as r, createElementBlock as t, renderSlot as o, createCommentVNode as i, createElementVNode as d, normalizeClass as a, unref as s, createVNode as b, isRef as y, createSlots as R, withCtx as $ } from "vue";
2
+ import V from "../Icon.vue.js";
3
+ import j from "../SidePanel.vue.js";
4
+ import x from "../Navbar/NavbarTabs.vue.js";
5
+ /* empty css */
6
+ import N from "../Breadcrumb/Breadcrumb.vue.js";
7
+ /* empty css */
8
+ import { APPSHELL_LAYOUT_KEY as B } from "./useAppShell.js";
9
+ import { normalizeRoutePrefix as E } from "../CategoryMenu/utils.js";
10
+ const L = { class: "vlite-app-layout flex flex-col w-full h-full min-h-0 bg-body text-foreground overflow-hidden" }, M = {
11
+ key: 0,
12
+ class: "shrink-0 w-full"
13
+ }, O = { class: "w-full mx-auto max-w-7xl px-3 sm:px-4 md:px-6 lg:px-8" }, A = { class: "flex items-center gap-2 min-w-0" }, U = ["aria-label"], Y = { class: "w-full mx-auto max-w-7xl px-3 sm:px-4 md:px-6 lg:px-8" }, D = {
14
+ key: 0,
15
+ class: "shrink-0 w-full"
16
+ }, H = {
17
+ key: 2,
18
+ class: "shrink-0 w-full border-t border-border bg-background"
19
+ }, I = { class: "flex flex-col h-full" }, K = {
20
+ class: "flex-1 overflow-y-auto px-3.5 py-4 space-y-4 scrollbar-thin scrollbar-stable",
21
+ style: { "will-change": "transform", contain: "layout style" }
22
+ }, q = {
23
+ key: 0,
24
+ class: "mt-auto border-t border-border px-3.5 py-3"
25
+ }, te = /* @__PURE__ */ T({
26
+ __name: "AppShellLayoutStorefront",
27
+ setup(F) {
28
+ const w = P(B), {
29
+ props: l,
30
+ isMobileMenuOpen: n,
31
+ isSidebarVisible: G,
32
+ toggleSidebar: J,
33
+ pageTitle: Q,
34
+ breadcrumbData: g,
35
+ breakpointClasses: m,
36
+ nestedTabsItems: p,
37
+ activeNestedTab: c,
38
+ handleNestedTabClick: k,
39
+ mainScrollRef: C,
40
+ layoutMainRef: S
41
+ } = w, z = v(() => [
42
+ "w-full shrink-0 bg-background transition-shadow duration-200",
43
+ {
44
+ fixed: "fixed top-0 left-0 z-50",
45
+ sticky: "sticky top-0 z-50",
46
+ relative: "relative z-20",
47
+ absolute: "absolute top-0 left-0 w-full z-50"
48
+ }[l.position || "sticky"],
49
+ l.border ? "border-b border-border" : "",
50
+ l.glass ? "bg-background/90 backdrop-blur-md" : "",
51
+ l.floating ? "m-3 rounded-lg border border-border shadow-sm overflow-hidden" : "",
52
+ l.class
53
+ ].filter(Boolean).join(" ")), h = v(() => E(l.categoryRoutePrefix));
54
+ return (e, u) => (r(), t("div", L, [
55
+ e.$slots.announcement ? (r(), t("div", M, [
56
+ o(e.$slots, "announcement")
57
+ ])) : i("", !0),
58
+ d("header", {
59
+ class: a(z.value)
60
+ }, [
61
+ d("div", O, [
62
+ d("div", {
63
+ class: a(["grid w-full grid-cols-[auto_minmax(0,1fr)_auto] md:grid-cols-[minmax(0,1fr)_auto_minmax(0,1fr)] items-center gap-3", s(l).height])
64
+ }, [
65
+ d("div", A, [
66
+ o(e.$slots, "mobile-trigger", {
67
+ isOpen: s(n),
68
+ toggle: () => n.value = !s(n)
69
+ }, () => [
70
+ d("button", {
71
+ type: "button",
72
+ class: a(["inline-flex items-center justify-center w-9 h-9 rounded-md text-muted-foreground hover:text-foreground hover:bg-accent", [s(m).mobileTrigger, s(l).mobileTriggerClass]]),
73
+ "aria-label": s(n) ? "Close menu" : "Open menu",
74
+ onClick: u[0] || (u[0] = (f) => n.value = !s(n))
75
+ }, [
76
+ b(V, {
77
+ icon: s(n) ? "lucide:x" : "lucide:menu",
78
+ class: "w-5 h-5"
79
+ }, null, 8, ["icon"])
80
+ ], 10, U)
81
+ ]),
82
+ e.$slots.left ? (r(), t("div", {
83
+ key: 0,
84
+ class: a(["items-center gap-2 min-w-0", s(m).desktopContent])
85
+ }, [
86
+ o(e.$slots, "left")
87
+ ], 2)) : i("", !0),
88
+ e.$slots.nav ? (r(), t("nav", {
89
+ key: 1,
90
+ class: a(["items-center gap-1 min-w-0", s(m).desktopContent]),
91
+ "aria-label": "Primary navigation"
92
+ }, [
93
+ o(e.$slots, "nav")
94
+ ], 2)) : i("", !0)
95
+ ]),
96
+ e.$slots.logo || e.$slots.center ? (r(), t("div", {
97
+ key: 0,
98
+ class: a(["min-w-0 justify-self-center flex items-center justify-center", s(l).logoClass])
99
+ }, [
100
+ o(e.$slots, "logo", {}, () => [
101
+ o(e.$slots, "center")
102
+ ])
103
+ ], 2)) : i("", !0),
104
+ d("div", {
105
+ class: a(["flex items-center justify-end gap-2 min-w-0 justify-self-end", s(l).rightClass])
106
+ }, [
107
+ e.$slots.search ? (r(), t("div", {
108
+ key: 0,
109
+ class: a(["items-center min-w-0 w-full max-w-sm", s(m).desktopContent])
110
+ }, [
111
+ o(e.$slots, "search")
112
+ ], 2)) : i("", !0),
113
+ o(e.$slots, "actions", {}, () => [
114
+ o(e.$slots, "right")
115
+ ])
116
+ ], 2)
117
+ ], 2),
118
+ e.$slots["mobile-search"] || e.$slots.search ? (r(), t("div", {
119
+ key: 0,
120
+ class: a(["pb-3", s(m).mobileTrigger])
121
+ }, [
122
+ o(e.$slots, "mobile-search", {}, () => [
123
+ o(e.$slots, "search")
124
+ ])
125
+ ], 2)) : i("", !0)
126
+ ]),
127
+ e.$slots.categories ? (r(), t("div", {
128
+ key: 0,
129
+ class: a(["w-full border-t border-border bg-background", [s(m).desktopContent, s(l).menuClass]])
130
+ }, [
131
+ d("div", Y, [
132
+ o(e.$slots, "categories", { categoryRoutePrefix: h.value })
133
+ ])
134
+ ], 2)) : i("", !0)
135
+ ], 2),
136
+ e.$slots.main ? (r(), t("main", {
137
+ key: 1,
138
+ ref_key: "layoutMainRef",
139
+ ref: S,
140
+ class: "flex-1 overflow-hidden w-full relative flex flex-col min-h-0"
141
+ }, [
142
+ s(l).renderNestedTabs && s(p).length > 0 ? (r(), t("div", D, [
143
+ b(x, {
144
+ modelValue: s(c),
145
+ "onUpdate:modelValue": u[1] || (u[1] = (f) => y(c) ? c.value = f : null),
146
+ onChange: s(k),
147
+ items: s(p)
148
+ }, null, 8, ["modelValue", "onChange", "items"])
149
+ ])) : i("", !0),
150
+ s(l).breadcrumb && s(l).breadcrumbPosition === "main" && s(g).items.value.length > 1 ? (r(), t("div", {
151
+ key: 1,
152
+ class: a(["shrink-0 w-full border-b border-border px-6 py-2", s(l).breadcrumbClass])
153
+ }, [
154
+ b(s(N), {
155
+ items: s(g).items.value,
156
+ variant: s(l).breadcrumbVariant,
157
+ separator: s(l).breadcrumbSeparator,
158
+ size: s(l).breadcrumbSize
159
+ }, null, 8, ["items", "variant", "separator", "size"])
160
+ ], 2)) : i("", !0),
161
+ d("div", {
162
+ ref_key: "mainScrollRef",
163
+ ref: C,
164
+ style: { "will-change": "transform", contain: "layout style" },
165
+ class: a(["flex-1 overflow-y-auto w-full relative h-full scrollbar-thin scrollbar-stable", s(l).contentClass])
166
+ }, [
167
+ o(e.$slots, "main")
168
+ ], 2)
169
+ ], 512)) : i("", !0),
170
+ e.$slots.footer ? (r(), t("footer", H, [
171
+ o(e.$slots, "footer")
172
+ ])) : i("", !0),
173
+ b(j, {
174
+ show: s(n),
175
+ "onUpdate:show": u[2] || (u[2] = (f) => y(n) ? n.value = f : null),
176
+ position: "left",
177
+ size: "sm",
178
+ triggerClass: s(m).mobileTrigger,
179
+ class: a(["z-60", s(m).mobileTrigger]),
180
+ headerClass: "pl-3! pr-4.5! py-3!",
181
+ bodyClass: "p-0!"
182
+ }, R({
183
+ default: $(() => [
184
+ d("div", I, [
185
+ d("div", K, [
186
+ o(e.$slots, "mobile-sidebar", {}, () => [
187
+ o(e.$slots, "mobile-nav", {}, () => [
188
+ o(e.$slots, "nav")
189
+ ]),
190
+ o(e.$slots, "categories", { categoryRoutePrefix: h.value }),
191
+ o(e.$slots, "left")
192
+ ])
193
+ ]),
194
+ e.$slots["mobile-sidebar-footer"] || e.$slots.actions || e.$slots.right ? (r(), t("div", q, [
195
+ o(e.$slots, "mobile-sidebar-footer", {}, () => [
196
+ o(e.$slots, "actions", {}, () => [
197
+ o(e.$slots, "right")
198
+ ])
199
+ ])
200
+ ])) : i("", !0)
201
+ ])
202
+ ]),
203
+ _: 2
204
+ }, [
205
+ e.$slots["mobile-sidebar-header"] || e.$slots.logo || e.$slots.center ? {
206
+ name: "header",
207
+ fn: $(() => [
208
+ o(e.$slots, "mobile-sidebar-header", {}, () => [
209
+ o(e.$slots, "logo", {}, () => [
210
+ o(e.$slots, "center")
211
+ ])
212
+ ])
213
+ ]),
214
+ key: "0"
215
+ } : void 0
216
+ ]), 1032, ["show", "triggerClass", "class"])
217
+ ]));
218
+ }
219
+ });
220
+ export {
221
+ te as default
222
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./AppShellLayoutStorefront.vue.js";
2
+ export {
3
+ f as default
4
+ };
@@ -3,6 +3,7 @@ import Q from "../Dropdown/Dropdown.vue.js";
3
3
  import "@iconify/vue";
4
4
  import "../../core/config.js";
5
5
  /* empty css */
6
+ /* empty css */
6
7
  /* empty css */
7
8
  import R from "../Button.vue.js";
8
9
  import T from "../MultiSelect/MultiSelect.vue.js";
@@ -10,7 +11,7 @@ import U from "../Modal.vue.js";
10
11
  function j(t) {
11
12
  return typeof t == "function" || Object.prototype.toString.call(t) === "[object Object]" && !L(t);
12
13
  }
13
- const ne = (t) => /* @__PURE__ */ E({
14
+ const re = (t) => /* @__PURE__ */ E({
14
15
  name: t.name,
15
16
  inheritAttrs: !1,
16
17
  props: {
@@ -213,5 +214,5 @@ const ne = (t) => /* @__PURE__ */ E({
213
214
  }
214
215
  });
215
216
  export {
216
- ne as createAsyncSelect
217
+ re as createAsyncSelect
217
218
  };
@@ -11,12 +11,13 @@ import "vue-draggable-plus";
11
11
  /* empty css */
12
12
  import "v-tooltip-lite";
13
13
  import "v-tooltip-lite/style.css";
14
+ /* empty css */
14
15
  /* empty css */
15
16
  import "v-datepicker-lite";
16
17
  import "v-datepicker-lite/style.css";
17
18
  import "@jaames/iro";
18
19
  import "@vueuse/core";
19
- /* empty css */
20
+ /* empty css */
20
21
  import Ue from "../IconPicker.vue.js";
21
22
  /* empty css */
22
23
  /* empty css */
@@ -42,7 +43,7 @@ const ze = { class: "flex items-center justify-between mb-6" }, Oe = { class: "t
42
43
  }, Le = {
43
44
  key: 0,
44
45
  class: "absolute inset-0 z-10 flex items-center justify-center rounded-xl bg-background/60 backdrop-blur-[1px] transition-opacity"
45
- }, We = { class: "flex items-center gap-2 text-sm text-muted-foreground" }, St = /* @__PURE__ */ Ce({
46
+ }, We = { class: "flex items-center gap-2 text-sm text-muted-foreground" }, Ct = /* @__PURE__ */ Ce({
46
47
  __name: "CategoryManager",
47
48
  props: {
48
49
  modelValue: { default: () => [] },
@@ -517,5 +518,5 @@ const ze = { class: "flex items-center justify-between mb-6" }, Oe = { class: "t
517
518
  }
518
519
  });
519
520
  export {
520
- St as default
521
+ Ct as default
521
522
  };
@@ -0,0 +1,22 @@
1
+ import { CategoryMenuProps, CategoryMenuItem } from './types';
2
+ declare const _default: import('vue').DefineComponent<CategoryMenuProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
3
+ select: (item: any) => any;
4
+ }, string, import('vue').PublicProps, Readonly<CategoryMenuProps> & Readonly<{
5
+ onSelect?: (item: any) => any;
6
+ }>, {
7
+ class: string;
8
+ variant: import('./types').CategoryMenuVariant;
9
+ items: CategoryMenuItem[];
10
+ mobileBreakpoint: "sm" | "md" | "lg" | "xl";
11
+ maxDepth: number;
12
+ showIcons: boolean;
13
+ showAllItem: boolean;
14
+ allItemLabel: string;
15
+ activeId: string | number | null;
16
+ routePrefix: string;
17
+ showImages: boolean;
18
+ showDescriptions: boolean;
19
+ megaColumns: number;
20
+ multiExpand: boolean;
21
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
22
+ export default _default;
@@ -0,0 +1,106 @@
1
+ import { defineComponent as y, computed as i, markRaw as r, inject as C, openBlock as m, createElementBlock as B, createBlock as p, unref as E, normalizeClass as f, resolveDynamicComponent as k } from "vue";
2
+ import h from "./CategoryMenuVariant1.vue.js";
3
+ import R from "./CategoryMenuVariant2.vue.js";
4
+ import { CATEGORY_MENU_ROUTE_PREFIX_KEY as A, buildCategoryRoute as D } from "./utils.js";
5
+ import P from "../SidebarMenu/SidebarMenu.vue.js";
6
+ /* empty css */
7
+ import "vue-router";
8
+ import "@iconify/vue";
9
+ import "v-tooltip-lite/style.css";
10
+ import "v-tooltip-lite";
11
+ import "../../core/config.js";
12
+ /* empty css */
13
+ /* empty css */
14
+ /* empty css */
15
+ /* empty css */
16
+ /* empty css */
17
+ const S = {
18
+ key: 0,
19
+ class: "w-full text-center text-xs text-muted-foreground py-3"
20
+ }, j = {
21
+ name: "CategoryMenu"
22
+ }, Q = /* @__PURE__ */ y({
23
+ ...j,
24
+ props: {
25
+ items: { default: () => [] },
26
+ variant: { default: "tabs" },
27
+ maxDepth: { default: 2 },
28
+ showIcons: { type: Boolean, default: !0 },
29
+ showAllItem: { type: Boolean, default: !1 },
30
+ allItemLabel: { default: "All" },
31
+ multiExpand: { type: Boolean, default: !1 },
32
+ activeId: { default: null },
33
+ routePrefix: { default: "" },
34
+ mobileBreakpoint: { default: "md" },
35
+ megaColumns: { default: 4 },
36
+ showImages: { type: Boolean, default: !0 },
37
+ showDescriptions: { type: Boolean, default: !0 },
38
+ class: { default: "" }
39
+ },
40
+ emits: ["select"],
41
+ setup(v, { emit: w }) {
42
+ const e = v, s = w, x = i(() => {
43
+ switch (e.variant) {
44
+ case "tabs":
45
+ return r(h);
46
+ case "mega":
47
+ return r(R);
48
+ default:
49
+ return r(h);
50
+ }
51
+ }), a = C(
52
+ A,
53
+ void 0
54
+ ), o = i(() => {
55
+ const l = typeof a == "object" && a && "value" in a ? a.value : a;
56
+ return String(e.routePrefix || l || "");
57
+ }), g = i(() => {
58
+ if (e.variant !== "sidebar") return [];
59
+ const l = (t, c = []) => {
60
+ const d = t.children && t.children.length > 0 ? t.children.map((b) => l(b, [...c, t])) : void 0, u = !!d?.length;
61
+ return {
62
+ id: t.id !== void 0 ? String(t.id) : void 0,
63
+ label: t.title || t.name || "Untitled",
64
+ to: u ? void 0 : D(o.value, t, c),
65
+ icon: e.showIcons ? t.icon : void 0,
66
+ badge: t.badge,
67
+ children: d,
68
+ // Parent nodes are expanders in tree/sidebar mode; leaves select/navigate.
69
+ action: u ? void 0 : () => s("select", t)
70
+ };
71
+ }, n = e.items.map((t) => l(t));
72
+ return e.showAllItem && n.unshift({
73
+ id: "all",
74
+ label: e.allItemLabel,
75
+ to: o.value ? o.value : void 0,
76
+ icon: e.showIcons ? "lucide:layout-grid" : void 0,
77
+ action: () => s("select", { id: "all", title: e.allItemLabel })
78
+ }), n;
79
+ }), I = (l) => s("select", l), _ = i(() => !e.items || e.items.length === 0);
80
+ return (l, n) => _.value ? (m(), B("div", S, " No categories to display. ")) : e.variant === "sidebar" ? (m(), p(E(P), {
81
+ key: 1,
82
+ items: g.value,
83
+ "allow-multiple": e.multiExpand,
84
+ "default-expanded": e.activeId ? [String(e.activeId)] : [],
85
+ class: f(e.class)
86
+ }, null, 8, ["items", "allow-multiple", "default-expanded", "class"])) : (m(), p(k(x.value), {
87
+ key: 2,
88
+ items: e.items,
89
+ "max-depth": e.maxDepth,
90
+ "show-icons": e.showIcons,
91
+ "show-all-item": e.showAllItem,
92
+ "all-item-label": e.allItemLabel,
93
+ "multi-expand": e.multiExpand,
94
+ "active-id": e.activeId,
95
+ "route-prefix": o.value,
96
+ "mega-columns": e.megaColumns,
97
+ "show-images": e.showImages,
98
+ "show-descriptions": e.showDescriptions,
99
+ class: f(e.class),
100
+ onSelect: I
101
+ }, null, 40, ["items", "max-depth", "show-icons", "show-all-item", "all-item-label", "multi-expand", "active-id", "route-prefix", "mega-columns", "show-images", "show-descriptions", "class"]));
102
+ }
103
+ });
104
+ export {
105
+ Q as default
106
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./CategoryMenu.vue.js";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,17 @@
1
+ import { CategoryMenuItem } from './types';
2
+ interface Props {
3
+ items: CategoryMenuItem[];
4
+ maxDepth: number;
5
+ showIcons: boolean;
6
+ showAllItem: boolean;
7
+ allItemLabel: string;
8
+ activeId: string | number | null | undefined;
9
+ routePrefix?: string;
10
+ class?: string;
11
+ }
12
+ declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
13
+ select: (item: import('../CategoryManager').CategoryItem) => any;
14
+ }, string, import('vue').PublicProps, Readonly<Props> & Readonly<{
15
+ onSelect?: (item: import('../CategoryManager').CategoryItem) => any;
16
+ }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLElement>;
17
+ export default _default;