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
|
@@ -11,6 +11,7 @@ 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";
|
|
@@ -19,8 +20,12 @@ import "@vueuse/core";
|
|
|
19
20
|
/* empty css */
|
|
20
21
|
import Ue from "../IconPicker.vue.js";
|
|
21
22
|
/* empty css */
|
|
22
|
-
/* empty css
|
|
23
|
+
/* empty css */
|
|
24
|
+
/* empty css */
|
|
25
|
+
/* empty css */
|
|
23
26
|
import "../../core/config.js";
|
|
27
|
+
/* empty css */
|
|
28
|
+
/* empty css */
|
|
24
29
|
import { getUniqueId as _ } from "../../utils/functions.js";
|
|
25
30
|
const ze = { class: "flex items-center justify-between mb-6" }, Oe = { class: "text-lg font-bold text-foreground" }, $e = { class: "text-sm text-muted-foreground mt-0.5" }, Fe = {
|
|
26
31
|
key: 0,
|
|
@@ -38,7 +43,7 @@ const ze = { class: "flex items-center justify-between mb-6" }, Oe = { class: "t
|
|
|
38
43
|
}, Le = {
|
|
39
44
|
key: 0,
|
|
40
45
|
class: "absolute inset-0 z-10 flex items-center justify-center rounded-xl bg-background/60 backdrop-blur-[1px] transition-opacity"
|
|
41
|
-
}, We = { class: "flex items-center gap-2 text-sm text-muted-foreground" },
|
|
46
|
+
}, We = { class: "flex items-center gap-2 text-sm text-muted-foreground" }, Ct = /* @__PURE__ */ Ce({
|
|
42
47
|
__name: "CategoryManager",
|
|
43
48
|
props: {
|
|
44
49
|
modelValue: { default: () => [] },
|
|
@@ -87,7 +92,7 @@ const ze = { class: "flex items-center justify-between mb-6" }, Oe = { class: "t
|
|
|
87
92
|
},
|
|
88
93
|
emits: ["update:modelValue", "onAdd", "onEdit", "onDelete", "onReorder"],
|
|
89
94
|
setup(S, { expose: L, emit: W }) {
|
|
90
|
-
const e = S, f = W, d = I([]),
|
|
95
|
+
const e = S, f = W, d = I([]), p = I(/* @__PURE__ */ new Set()), v = (o) => JSON.parse(JSON.stringify(o)), T = (o, t = null) => {
|
|
91
96
|
o.forEach((a, i) => {
|
|
92
97
|
a.parentId = t, a.position = i, a.children || (a.children = []), T(a.children, a.id);
|
|
93
98
|
});
|
|
@@ -125,7 +130,7 @@ const ze = { class: "flex items-center justify-between mb-6" }, Oe = { class: "t
|
|
|
125
130
|
(o) => {
|
|
126
131
|
if (o) {
|
|
127
132
|
if (o.length === 0) {
|
|
128
|
-
d.value = [],
|
|
133
|
+
d.value = [], p.value = /* @__PURE__ */ new Set(), f("update:modelValue", []);
|
|
129
134
|
return;
|
|
130
135
|
}
|
|
131
136
|
const t = X(o);
|
|
@@ -133,9 +138,9 @@ const ze = { class: "flex items-center justify-between mb-6" }, Oe = { class: "t
|
|
|
133
138
|
const a = JSON.stringify(t), i = JSON.stringify(d.value);
|
|
134
139
|
if (a !== i) {
|
|
135
140
|
const r = z(t), n = new Set(
|
|
136
|
-
[...
|
|
141
|
+
[...p.value].filter((g) => r.has(g))
|
|
137
142
|
);
|
|
138
|
-
|
|
143
|
+
p.value = n;
|
|
139
144
|
const u = v(t);
|
|
140
145
|
d.value = u, f("update:modelValue", u);
|
|
141
146
|
}
|
|
@@ -158,8 +163,8 @@ const ze = { class: "flex items-center justify-between mb-6" }, Oe = { class: "t
|
|
|
158
163
|
const o = v(d.value);
|
|
159
164
|
f("update:modelValue", o);
|
|
160
165
|
}, Y = (o) => {
|
|
161
|
-
const t = new Set(
|
|
162
|
-
t.has(o) ? t.delete(o) : t.add(o),
|
|
166
|
+
const t = new Set(p.value);
|
|
167
|
+
t.has(o) ? t.delete(o) : t.add(o), p.value = t;
|
|
163
168
|
}, y = I({
|
|
164
169
|
mode: null,
|
|
165
170
|
targetId: null,
|
|
@@ -171,7 +176,7 @@ const ze = { class: "flex items-center justify-between mb-6" }, Oe = { class: "t
|
|
|
171
176
|
targetId: o === "add-child" && t || null,
|
|
172
177
|
title: "",
|
|
173
178
|
icon: "lucide:folder"
|
|
174
|
-
}, o === "add-child" && t &&
|
|
179
|
+
}, o === "add-child" && t && p.value.add(t);
|
|
175
180
|
}, D = () => {
|
|
176
181
|
y.value = { mode: null, targetId: null, title: "", icon: "lucide:folder" };
|
|
177
182
|
}, V = () => {
|
|
@@ -183,8 +188,8 @@ const ze = { class: "flex items-center justify-between mb-6" }, Oe = { class: "t
|
|
|
183
188
|
n = { id: _(), title: a, icon: i, children: [] }, r.push(n);
|
|
184
189
|
else if (o === "add-child") {
|
|
185
190
|
n = { id: _(), title: a, icon: i, children: [] };
|
|
186
|
-
const u = (
|
|
187
|
-
for (const c of
|
|
191
|
+
const u = (g) => {
|
|
192
|
+
for (const c of g) {
|
|
188
193
|
if (c.id === t)
|
|
189
194
|
return c.children || (c.children = []), c.children.push(n), !0;
|
|
190
195
|
if (c.children && u(c.children)) return !0;
|
|
@@ -207,21 +212,21 @@ const ze = { class: "flex items-center justify-between mb-6" }, Oe = { class: "t
|
|
|
207
212
|
const n = { id: _(), children: [], ...t };
|
|
208
213
|
a.push(n), i = n, r = "onAdd";
|
|
209
214
|
} else if (x.value === "add-child") {
|
|
210
|
-
const n = { id: _(), children: [], ...t }, u = (
|
|
211
|
-
for (const c of
|
|
215
|
+
const n = { id: _(), children: [], ...t }, u = (g) => {
|
|
216
|
+
for (const c of g) {
|
|
212
217
|
if (c.id === O.value)
|
|
213
|
-
return c.children || (c.children = []), c.children.push(n),
|
|
218
|
+
return c.children || (c.children = []), c.children.push(n), p.value.add(c.id), !0;
|
|
214
219
|
if (c.children && u(c.children)) return !0;
|
|
215
220
|
}
|
|
216
221
|
return !1;
|
|
217
222
|
};
|
|
218
223
|
u(a), i = n, r = "onAdd";
|
|
219
224
|
} else if (x.value === "edit" && q.value) {
|
|
220
|
-
const n = q.value.id, u = (
|
|
221
|
-
const c =
|
|
225
|
+
const n = q.value.id, u = (g) => {
|
|
226
|
+
const c = g.findIndex((k) => k.id === n);
|
|
222
227
|
if (c > -1)
|
|
223
|
-
return
|
|
224
|
-
for (const k of
|
|
228
|
+
return g[c] = { ...g[c], ...t }, i = g[c], !0;
|
|
229
|
+
for (const k of g)
|
|
225
230
|
if (k.children && u(k.children)) return !0;
|
|
226
231
|
return !1;
|
|
227
232
|
};
|
|
@@ -286,7 +291,7 @@ const ze = { class: "flex items-center justify-between mb-6" }, Oe = { class: "t
|
|
|
286
291
|
if (e.headerTitle) return e.headerTitle;
|
|
287
292
|
const o = l("vlite.categoryManager.headerTitle");
|
|
288
293
|
return o !== "vlite.categoryManager.headerTitle" ? o : "Categories";
|
|
289
|
-
}),
|
|
294
|
+
}), pe = s(() => {
|
|
290
295
|
if (e.headerDescriptionI18n) {
|
|
291
296
|
const t = l(e.headerDescriptionI18n);
|
|
292
297
|
if (t !== e.headerDescriptionI18n) return t;
|
|
@@ -294,7 +299,7 @@ const ze = { class: "flex items-center justify-between mb-6" }, Oe = { class: "t
|
|
|
294
299
|
if (e.headerDescription) return e.headerDescription;
|
|
295
300
|
const o = l("vlite.categoryManager.headerDescription");
|
|
296
301
|
return o !== "vlite.categoryManager.headerDescription" ? o : "Manage your hierarchical structure.";
|
|
297
|
-
}),
|
|
302
|
+
}), ge = s(() => {
|
|
298
303
|
if (e.addCategoryTextI18n) {
|
|
299
304
|
const t = l(e.addCategoryTextI18n);
|
|
300
305
|
if (t !== e.addCategoryTextI18n) return t;
|
|
@@ -344,7 +349,7 @@ const ze = { class: "flex items-center justify-between mb-6" }, Oe = { class: "t
|
|
|
344
349
|
return o !== "vlite.categoryManager.categoryTitlePlaceholder" ? o : "Category title...";
|
|
345
350
|
}), Te = s(() => e.quickAddTooltipI18n ? l(e.quickAddTooltipI18n) : e.quickAddTooltip ? e.quickAddTooltip : l("vlite.categoryManager.quickAddTooltip") !== "vlite.categoryManager.quickAddTooltip" ? l("vlite.categoryManager.quickAddTooltip") : "Quick Add Subcategory"), Ie = s(() => e.advancedDetailsTooltipI18n ? l(e.advancedDetailsTooltipI18n) : e.advancedDetailsTooltip ? e.advancedDetailsTooltip : l("vlite.categoryManager.advancedDetailsTooltip") !== "vlite.categoryManager.advancedDetailsTooltip" ? l("vlite.categoryManager.advancedDetailsTooltip") : "Advanced Details"), xe = s(() => e.deleteTooltipI18n ? l(e.deleteTooltipI18n) : e.deleteTooltip ? e.deleteTooltip : l("vlite.categoryManager.deleteTooltip") !== "vlite.categoryManager.deleteTooltip" ? l("vlite.categoryManager.deleteTooltip") : "Delete"), F = s(() => e.saveTooltipI18n ? l(e.saveTooltipI18n) : e.saveTooltip ? e.saveTooltip : l("vlite.categoryManager.saveTooltip") !== "vlite.categoryManager.saveTooltip" ? l("vlite.categoryManager.saveTooltip") : "Save"), J = s(() => e.cancelTooltipI18n ? l(e.cancelTooltipI18n) : e.cancelTooltip ? e.cancelTooltip : l("vlite.categoryManager.cancelTooltip") !== "vlite.categoryManager.cancelTooltip" ? l("vlite.categoryManager.cancelTooltip") : "Cancel");
|
|
346
351
|
De("categoryManager", {
|
|
347
|
-
expandedIds:
|
|
352
|
+
expandedIds: p,
|
|
348
353
|
inlineState: y,
|
|
349
354
|
toggleExpand: Y,
|
|
350
355
|
startInline: N,
|
|
@@ -369,20 +374,20 @@ const ze = { class: "flex items-center justify-between mb-6" }, Oe = { class: "t
|
|
|
369
374
|
}
|
|
370
375
|
}, we = () => {
|
|
371
376
|
const o = z(d.value);
|
|
372
|
-
|
|
377
|
+
p.value = o;
|
|
373
378
|
}, Me = () => {
|
|
374
|
-
|
|
379
|
+
p.value = /* @__PURE__ */ new Set();
|
|
375
380
|
}, B = (...o) => {
|
|
376
|
-
const t = new Set(
|
|
377
|
-
o.forEach((a) => t.add(a)),
|
|
381
|
+
const t = new Set(p.value);
|
|
382
|
+
o.forEach((a) => t.add(a)), p.value = t;
|
|
378
383
|
}, Se = (...o) => {
|
|
379
|
-
const t = new Set(
|
|
380
|
-
o.forEach((a) => t.delete(a)),
|
|
384
|
+
const t = new Set(p.value);
|
|
385
|
+
o.forEach((a) => t.delete(a)), p.value = t;
|
|
381
386
|
};
|
|
382
387
|
return Ae(() => {
|
|
383
388
|
e.defaultExpanded && e.defaultExpanded.length > 0 && B(...e.defaultExpanded);
|
|
384
389
|
}), L({
|
|
385
|
-
expandedIds:
|
|
390
|
+
expandedIds: p,
|
|
386
391
|
expandAll: we,
|
|
387
392
|
collapseAll: Me,
|
|
388
393
|
expand: B,
|
|
@@ -394,7 +399,7 @@ const ze = { class: "flex items-center justify-between mb-6" }, Oe = { class: "t
|
|
|
394
399
|
Pe(o.$slots, "header", {}, () => [
|
|
395
400
|
m("div", null, [
|
|
396
401
|
m("h3", Oe, w(ue.value), 1),
|
|
397
|
-
m("p", $e, w(
|
|
402
|
+
m("p", $e, w(pe.value), 1)
|
|
398
403
|
]),
|
|
399
404
|
S.readonly ? E("", !0) : (b(), G(R, {
|
|
400
405
|
key: 0,
|
|
@@ -404,7 +409,7 @@ const ze = { class: "flex items-center justify-between mb-6" }, Oe = { class: "t
|
|
|
404
409
|
onClick: t[0] || (t[0] = (a) => N("add-root"))
|
|
405
410
|
}, {
|
|
406
411
|
default: P(() => [
|
|
407
|
-
H(w(
|
|
412
|
+
H(w(ge.value), 1)
|
|
408
413
|
]),
|
|
409
414
|
_: 1
|
|
410
415
|
}))
|
|
@@ -513,5 +518,5 @@ const ze = { class: "flex items-center justify-between mb-6" }, Oe = { class: "t
|
|
|
513
518
|
}
|
|
514
519
|
});
|
|
515
520
|
export {
|
|
516
|
-
|
|
521
|
+
Ct as default
|
|
517
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,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;
|
|
@@ -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 bg-card", 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;
|