vlite3 1.4.3 → 1.4.5
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/AppShellLayoutStorefront.vue.js +2 -2
- package/components/AvatarUploader/AvatarUploader.vue.d.ts +2 -2
- package/components/Cart/Cart.vue.d.ts +27 -0
- package/components/Cart/Cart.vue.js +242 -0
- package/components/Cart/Cart.vue2.js +4 -0
- package/components/Cart/CartCouponInput.vue.d.ts +32 -0
- package/components/Cart/CartCouponInput.vue.js +176 -0
- package/components/Cart/CartCouponInput.vue2.js +4 -0
- package/components/Cart/CartEmptyState.vue.d.ts +17 -0
- package/components/Cart/CartEmptyState.vue.js +48 -0
- package/components/Cart/CartEmptyState.vue2.js +4 -0
- package/components/Cart/CartLineItem.vue.d.ts +29 -0
- package/components/Cart/CartLineItem.vue.js +341 -0
- package/components/Cart/CartLineItem.vue2.js +4 -0
- package/components/Cart/CartSummary.vue.d.ts +29 -0
- package/components/Cart/CartSummary.vue.js +157 -0
- package/components/Cart/CartSummary.vue2.js +4 -0
- package/components/Cart/CartVariant1.vue.d.ts +42 -0
- package/components/Cart/CartVariant1.vue.js +156 -0
- package/components/Cart/CartVariant1.vue2.js +4 -0
- package/components/Cart/CartVariant2.vue.d.ts +42 -0
- package/components/Cart/CartVariant2.vue.js +154 -0
- package/components/Cart/CartVariant2.vue2.js +4 -0
- package/components/Cart/CartVariant3.vue.d.ts +41 -0
- package/components/Cart/CartVariant3.vue.js +192 -0
- package/components/Cart/CartVariant3.vue2.js +4 -0
- package/components/Cart/CartVariant4.vue.d.ts +41 -0
- package/components/Cart/CartVariant4.vue.js +145 -0
- package/components/Cart/CartVariant4.vue2.js +4 -0
- package/components/Cart/composables/useCart.d.ts +46 -0
- package/components/Cart/composables/useCart.js +110 -0
- package/components/Cart/composables/useCartCalculation.d.ts +91 -0
- package/components/Cart/composables/useCartCalculation.js +145 -0
- package/components/Cart/index.d.ts +9 -0
- package/components/Cart/types.d.ts +391 -0
- package/components/CategoryManager/CategoryManager.vue.d.ts +2 -2
- package/components/CategoryManager/CategoryManager.vue.js +3 -3
- package/components/CategoryManager/CategoryManager.vue2.js +224 -248
- package/components/CategoryManager/utils.d.ts +3 -0
- package/components/CategoryManager/utils.js +31 -0
- package/components/CategoryMenu/CategoryMenu.vue.d.ts +2 -0
- package/components/CategoryMenu/CategoryMenu.vue.js +46 -40
- package/components/CategoryMenu/CategoryMenuVariant1.vue.d.ts +5 -1
- package/components/CategoryMenu/CategoryMenuVariant1.vue.js +5 -144
- package/components/CategoryMenu/CategoryMenuVariant1.vue2.js +220 -2
- package/components/CategoryMenu/CategoryMenuVariant2.vue.d.ts +5 -1
- package/components/CategoryMenu/CategoryMenuVariant2.vue.js +5 -160
- package/components/CategoryMenu/CategoryMenuVariant2.vue2.js +235 -2
- package/components/CategoryMenu/types.d.ts +5 -2
- package/components/Clipboard.vue.d.ts +2 -2
- package/components/Dropdown/Dropdown.vue.d.ts +1 -0
- package/components/Dropdown/Dropdown.vue.js +31 -29
- package/components/FilePicker/FilePicker.vue.d.ts +2 -2
- package/components/FilePicker/FilePicker.vue.js +278 -202
- package/components/Form/CustomFields.vue.d.ts +4 -0
- package/components/Form/CustomFields.vue.js +2 -2
- package/components/Form/CustomFields.vue2.js +349 -145
- package/components/Form/FormField.vue.d.ts +1 -1
- package/components/Form/FormField.vue.js +1 -1
- package/components/Form/types.d.ts +3 -0
- package/components/Modal.vue.d.ts +2 -0
- package/components/Modal.vue.js +1 -1
- package/components/Modal.vue2.js +30 -28
- package/components/OTPInput/OTPInput.vue.d.ts +1 -1
- package/components/Rating/Rating.vue.d.ts +1 -1
- package/components/Screen/ScreenFilter.vue.js +3 -2
- package/components/SidePanel.vue.d.ts +2 -0
- package/components/SidePanel.vue.js +1 -1
- package/components/SidePanel.vue2.js +25 -23
- package/components/SidebarMenu/SidebarMenu.vue.js +145 -128
- package/components/index.d.ts +1 -0
- package/core/config.d.ts +128 -0
- package/index.d.ts +1 -0
- package/index.js +327 -306
- package/package.json +1 -1
- package/style.css +1 -1
- package/types/config.type.d.ts +2 -0
|
@@ -1,162 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
import
|
|
4
|
-
|
|
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
|
-
});
|
|
1
|
+
import o from "./CategoryMenuVariant2.vue2.js";
|
|
2
|
+
/* empty css */
|
|
3
|
+
import t from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
+
const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-5a117002"]]);
|
|
160
5
|
export {
|
|
161
|
-
|
|
6
|
+
m as default
|
|
162
7
|
};
|
|
@@ -1,4 +1,237 @@
|
|
|
1
|
-
import f from "
|
|
1
|
+
import { defineComponent as H, computed as h, ref as d, watch as q, nextTick as L, onMounted as G, openBlock as l, createElementBlock as a, normalizeClass as T, createVNode as i, unref as J, withCtx as f, createCommentVNode as c, createElementVNode as s, toDisplayString as g, createTextVNode as K, Transition as z, withModifiers as F, Fragment as P, renderList as Q, createBlock as S, resolveDynamicComponent as U, mergeProps as X } from "vue";
|
|
2
|
+
import { useResizeObserver as V } from "@vueuse/core";
|
|
3
|
+
import Y from "../Dropdown/Dropdown.vue.js";
|
|
4
|
+
import x from "../Icon.vue.js";
|
|
5
|
+
import "../../core/config.js";
|
|
6
|
+
/* empty css */
|
|
7
|
+
/* empty css */
|
|
8
|
+
/* empty css */
|
|
9
|
+
import Z from "../Button.vue.js";
|
|
10
|
+
import { categoriesToDropdownOptions as ee, buildCategoryRoute as te } from "./utils.js";
|
|
11
|
+
const oe = { class: "relative w-full max-w-full min-w-0 overflow-hidden flex items-center group" }, ne = {
|
|
12
|
+
key: 0,
|
|
13
|
+
class: "absolute left-0 inset-y-0 z-10 flex items-center pointer-events-none"
|
|
14
|
+
}, le = ["onMouseenter", "onFocus", "onClick"], se = { class: "truncate max-w-[180px]" }, re = { class: "truncate max-w-[180px]" }, ae = {
|
|
15
|
+
key: 0,
|
|
16
|
+
class: "absolute right-0 inset-y-0 z-10 flex items-center justify-end pointer-events-none"
|
|
17
|
+
}, ie = {
|
|
18
|
+
key: 0,
|
|
19
|
+
class: "flex items-center gap-4 p-4 bg-muted/20 border-t border-border"
|
|
20
|
+
}, ce = ["src", "alt"], ue = { class: "flex-1 min-w-0" }, de = { class: "font-semibold text-foreground text-sm truncate" }, fe = {
|
|
21
|
+
key: 0,
|
|
22
|
+
class: "text-xs text-muted-foreground mt-1 line-clamp-2"
|
|
23
|
+
}, Ce = /* @__PURE__ */ H({
|
|
24
|
+
__name: "CategoryMenuVariant2",
|
|
25
|
+
props: {
|
|
26
|
+
items: {},
|
|
27
|
+
maxDepth: {},
|
|
28
|
+
showIcons: { type: Boolean },
|
|
29
|
+
showImages: { type: Boolean },
|
|
30
|
+
showDescriptions: { type: Boolean },
|
|
31
|
+
megaColumns: {},
|
|
32
|
+
activeId: {},
|
|
33
|
+
routePrefix: {},
|
|
34
|
+
class: {},
|
|
35
|
+
menuStyles: {}
|
|
36
|
+
},
|
|
37
|
+
emits: ["select"],
|
|
38
|
+
setup(u, { emit: A }) {
|
|
39
|
+
const r = u, b = A, w = h(() => r.items || []), m = d(null), C = d(!1), y = d(null), $ = d(null), I = d(!1), M = d(!1), n = h(
|
|
40
|
+
() => w.value.find((t) => t.id === m.value) || null
|
|
41
|
+
), B = h(
|
|
42
|
+
() => n.value?.children ? ee(n.value.children, r.routePrefix, [n.value]) : []
|
|
43
|
+
), O = h(() => B.value.length > 0), k = (t) => {
|
|
44
|
+
m.value = t.id;
|
|
45
|
+
}, R = (t) => te(r.routePrefix, t), N = (t) => t ? "router-link" : "button", W = (t) => t ? { to: t } : { type: "button" }, _ = (t) => r.activeId ? t.id === r.activeId ? !0 : (t.children || []).some((o) => _(o)) : !1, j = (t) => {
|
|
46
|
+
const o = t.option?.data;
|
|
47
|
+
b("select", o || t);
|
|
48
|
+
}, E = h(() => Math.max(1, Math.min(6, r.megaColumns || 4))), v = () => {
|
|
49
|
+
const t = y.value;
|
|
50
|
+
t && (I.value = t.scrollLeft > 2, M.value = t.scrollLeft + t.clientWidth < t.scrollWidth - 2);
|
|
51
|
+
}, D = (t) => {
|
|
52
|
+
const o = y.value;
|
|
53
|
+
if (!o) return;
|
|
54
|
+
const e = o.clientWidth * 0.6;
|
|
55
|
+
o.scrollBy({ left: t === "right" ? e : -e, behavior: "smooth" });
|
|
56
|
+
};
|
|
57
|
+
return V(y, v), V($, v), q(
|
|
58
|
+
() => w.value,
|
|
59
|
+
() => L(v),
|
|
60
|
+
{ deep: !0 }
|
|
61
|
+
), G(async () => {
|
|
62
|
+
if (m.value === null) {
|
|
63
|
+
const t = w.value.find((o) => o.children && o.children.length > 0);
|
|
64
|
+
t && (m.value = t.id);
|
|
65
|
+
}
|
|
66
|
+
await L(), v();
|
|
67
|
+
}), (t, o) => (l(), a("nav", {
|
|
68
|
+
class: T(["relative w-full max-w-full min-w-0 overflow-hidden flex", r.class]),
|
|
69
|
+
role: "navigation",
|
|
70
|
+
"aria-label": "Categories"
|
|
71
|
+
}, [
|
|
72
|
+
i(J(Y), {
|
|
73
|
+
class: "block w-full min-w-0 max-w-full",
|
|
74
|
+
options: B.value,
|
|
75
|
+
disabled: !O.value,
|
|
76
|
+
layout: "grouped",
|
|
77
|
+
columns: E.value,
|
|
78
|
+
"close-on-select": !0,
|
|
79
|
+
searchable: !1,
|
|
80
|
+
"show-selected-label": !1,
|
|
81
|
+
"show-selected-icon": !1,
|
|
82
|
+
selectable: !0,
|
|
83
|
+
trigger: "hover",
|
|
84
|
+
"keep-alive": !0,
|
|
85
|
+
placement: "bottom-start",
|
|
86
|
+
offset: [0, 4],
|
|
87
|
+
maxHeight: "500px",
|
|
88
|
+
menuStyles: u.menuStyles,
|
|
89
|
+
"menu-id": "cat-menu-mega",
|
|
90
|
+
"nested-position": "right-start",
|
|
91
|
+
"nested-offset": [0, -5],
|
|
92
|
+
width: "w-full max-w-5xl",
|
|
93
|
+
onOnSelect: j,
|
|
94
|
+
onOnOpen: o[3] || (o[3] = (e) => C.value = !0),
|
|
95
|
+
onOnClose: o[4] || (o[4] = (e) => C.value = !1)
|
|
96
|
+
}, {
|
|
97
|
+
trigger: f(() => [
|
|
98
|
+
s("div", oe, [
|
|
99
|
+
i(z, { name: "fade-x" }, {
|
|
100
|
+
default: f(() => [
|
|
101
|
+
I.value ? (l(), a("div", ne, [
|
|
102
|
+
o[5] || (o[5] = s("div", { class: "w-8 h-full bg-gradient-to-r from-background to-transparent" }, null, -1)),
|
|
103
|
+
s("button", {
|
|
104
|
+
type: "button",
|
|
105
|
+
class: "pointer-events-auto absolute left-0 bg-background h-full px-1 flex items-center text-muted-foreground hover:text-foreground transition-colors",
|
|
106
|
+
"aria-label": "Scroll left",
|
|
107
|
+
tabindex: "-1",
|
|
108
|
+
onClick: o[0] || (o[0] = F((e) => D("left"), ["stop", "prevent"]))
|
|
109
|
+
}, [
|
|
110
|
+
i(x, {
|
|
111
|
+
icon: "lucide:chevron-left",
|
|
112
|
+
class: "w-4 h-4"
|
|
113
|
+
})
|
|
114
|
+
])
|
|
115
|
+
])) : c("", !0)
|
|
116
|
+
]),
|
|
117
|
+
_: 1
|
|
118
|
+
}),
|
|
119
|
+
s("div", {
|
|
120
|
+
ref_key: "scrollRef",
|
|
121
|
+
ref: y,
|
|
122
|
+
class: "flex-1 min-w-0 max-w-full overflow-x-auto category-mega-no-scrollbar scroll-smooth",
|
|
123
|
+
style: { "will-change": "transform", contain: "layout style" },
|
|
124
|
+
onScroll: v
|
|
125
|
+
}, [
|
|
126
|
+
s("div", {
|
|
127
|
+
ref_key: "scrollContentRef",
|
|
128
|
+
ref: $,
|
|
129
|
+
class: "flex w-max min-w-full items-center gap-1 py-2 px-1"
|
|
130
|
+
}, [
|
|
131
|
+
(l(!0), a(P, null, Q(w.value, (e) => (l(), a(P, {
|
|
132
|
+
key: e.id
|
|
133
|
+
}, [
|
|
134
|
+
e.children && e.children.length > 0 ? (l(), a("button", {
|
|
135
|
+
key: 0,
|
|
136
|
+
type: "button",
|
|
137
|
+
tabindex: "0",
|
|
138
|
+
class: T([
|
|
139
|
+
"shrink-0 inline-flex items-center gap-1.5 px-3 py-1.5 text-sm font-medium rounded-md transition-colors",
|
|
140
|
+
_(e) || m.value === e.id && O.value && C.value ? "bg-primary/10 text-primary" : "text-muted-foreground hover:text-foreground hover:bg-accent"
|
|
141
|
+
]),
|
|
142
|
+
onMouseenter: (p) => k(e),
|
|
143
|
+
onFocus: (p) => k(e),
|
|
144
|
+
onClick: (p) => b("select", e)
|
|
145
|
+
}, [
|
|
146
|
+
r.showIcons && e.icon ? (l(), S(x, {
|
|
147
|
+
key: 0,
|
|
148
|
+
icon: e.icon,
|
|
149
|
+
class: "w-3.5 h-3.5 shrink-0"
|
|
150
|
+
}, null, 8, ["icon"])) : c("", !0),
|
|
151
|
+
s("span", se, g(e.title || e.name), 1),
|
|
152
|
+
i(x, {
|
|
153
|
+
icon: "lucide:chevron-down",
|
|
154
|
+
class: "w-3 h-3 opacity-60"
|
|
155
|
+
})
|
|
156
|
+
], 42, le)) : (l(), S(U(N(R(e))), X({
|
|
157
|
+
key: 1,
|
|
158
|
+
ref_for: !0
|
|
159
|
+
}, W(R(e)), {
|
|
160
|
+
tabindex: "0",
|
|
161
|
+
class: [
|
|
162
|
+
"shrink-0 inline-flex items-center gap-1.5 px-3 py-1.5 text-sm font-medium rounded-md transition-colors",
|
|
163
|
+
_(e) ? "bg-primary/10 text-primary" : "text-muted-foreground hover:text-foreground hover:bg-accent"
|
|
164
|
+
],
|
|
165
|
+
onMouseenter: (p) => k(e),
|
|
166
|
+
onFocus: (p) => k(e),
|
|
167
|
+
onClick: (p) => b("select", e)
|
|
168
|
+
}), {
|
|
169
|
+
default: f(() => [
|
|
170
|
+
r.showIcons && e.icon ? (l(), S(x, {
|
|
171
|
+
key: 0,
|
|
172
|
+
icon: e.icon,
|
|
173
|
+
class: "w-3.5 h-3.5 shrink-0"
|
|
174
|
+
}, null, 8, ["icon"])) : c("", !0),
|
|
175
|
+
s("span", re, g(e.title || e.name), 1)
|
|
176
|
+
]),
|
|
177
|
+
_: 2
|
|
178
|
+
}, 1040, ["class", "onMouseenter", "onFocus", "onClick"]))
|
|
179
|
+
], 64))), 128))
|
|
180
|
+
], 512)
|
|
181
|
+
], 544),
|
|
182
|
+
i(z, { name: "fade-x" }, {
|
|
183
|
+
default: f(() => [
|
|
184
|
+
M.value ? (l(), a("div", ae, [
|
|
185
|
+
o[6] || (o[6] = s("div", { class: "w-8 h-full bg-gradient-to-l from-background to-transparent" }, null, -1)),
|
|
186
|
+
s("button", {
|
|
187
|
+
type: "button",
|
|
188
|
+
class: "pointer-events-auto absolute right-0 h-full px-1 flex items-center text-muted-foreground hover:text-foreground transition-colors bg-background",
|
|
189
|
+
"aria-label": "Scroll right",
|
|
190
|
+
tabindex: "-1",
|
|
191
|
+
onClick: o[1] || (o[1] = F((e) => D("right"), ["stop", "prevent"]))
|
|
192
|
+
}, [
|
|
193
|
+
i(x, {
|
|
194
|
+
icon: "lucide:chevron-right",
|
|
195
|
+
class: "w-4 h-4"
|
|
196
|
+
})
|
|
197
|
+
])
|
|
198
|
+
])) : c("", !0)
|
|
199
|
+
]),
|
|
200
|
+
_: 1
|
|
201
|
+
})
|
|
202
|
+
])
|
|
203
|
+
]),
|
|
204
|
+
footer: f(() => [
|
|
205
|
+
n.value && (u.showImages && n.value.image || u.showDescriptions && n.value.description) ? (l(), a("div", ie, [
|
|
206
|
+
u.showImages && n.value.image ? (l(), a("img", {
|
|
207
|
+
key: 0,
|
|
208
|
+
src: n.value.image,
|
|
209
|
+
alt: n.value.title || "Category",
|
|
210
|
+
class: "w-24 h-16 object-cover rounded-md shadow-sm border border-border"
|
|
211
|
+
}, null, 8, ce)) : c("", !0),
|
|
212
|
+
s("div", ue, [
|
|
213
|
+
s("h4", de, g(n.value.title || n.value.name), 1),
|
|
214
|
+
u.showDescriptions && n.value.description ? (l(), a("p", fe, g(n.value.description), 1)) : c("", !0)
|
|
215
|
+
]),
|
|
216
|
+
i(Z, {
|
|
217
|
+
variant: "outline",
|
|
218
|
+
size: "sm",
|
|
219
|
+
class: "shrink-0",
|
|
220
|
+
"icon-right": "lucide:arrow-right",
|
|
221
|
+
onClick: o[2] || (o[2] = (e) => b("select", n.value))
|
|
222
|
+
}, {
|
|
223
|
+
default: f(() => [
|
|
224
|
+
K(" Shop All " + g(n.value.title || n.value.name), 1)
|
|
225
|
+
]),
|
|
226
|
+
_: 1
|
|
227
|
+
})
|
|
228
|
+
])) : c("", !0)
|
|
229
|
+
]),
|
|
230
|
+
_: 1
|
|
231
|
+
}, 8, ["options", "disabled", "columns", "menuStyles"])
|
|
232
|
+
], 2));
|
|
233
|
+
}
|
|
234
|
+
});
|
|
2
235
|
export {
|
|
3
|
-
|
|
236
|
+
Ce as default
|
|
4
237
|
};
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import { CategoryItem } from '../CategoryManager/types';
|
|
2
|
-
export type CategoryMenuVariant = 'tabs' | 'mega' | 'sidebar';
|
|
1
|
+
import { CategoryItem, RawCategoryItem } from '../CategoryManager/types';
|
|
2
|
+
export type CategoryMenuVariant = 'tabs' | 'mega' | 'sidebar' | 'inline';
|
|
3
3
|
export type CategoryMenuItem = CategoryItem;
|
|
4
4
|
export interface CategoryMenuProps {
|
|
5
5
|
/** Hierarchical category tree. Accepts the same shape as `CategoryManager`. */
|
|
6
6
|
items?: CategoryMenuItem[];
|
|
7
|
+
/** Flat array of category items to auto-build into a nested tree. Allows the Menu to be directly fed raw API results. */
|
|
8
|
+
rawData?: RawCategoryItem[];
|
|
7
9
|
/** Layout variant. See {@link CategoryMenuVariant}. */
|
|
8
10
|
variant?: CategoryMenuVariant;
|
|
9
11
|
/** Maximum depth to render. `1` = top-level only. Defaults to `2`. */
|
|
@@ -29,4 +31,5 @@ export interface CategoryMenuProps {
|
|
|
29
31
|
/** Whether to render the description in mega-menu columns. */
|
|
30
32
|
showDescriptions?: boolean;
|
|
31
33
|
class?: string;
|
|
34
|
+
menuStyles?: any;
|
|
32
35
|
}
|
|
@@ -27,11 +27,11 @@ declare function __VLS_template(): {
|
|
|
27
27
|
};
|
|
28
28
|
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
29
29
|
declare const __VLS_component: import('vue').DefineComponent<ClipboardProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
30
|
-
copy: (text: string) => any;
|
|
31
30
|
error: (err: Error) => any;
|
|
31
|
+
copy: (text: string) => any;
|
|
32
32
|
}, string, import('vue').PublicProps, Readonly<ClipboardProps> & Readonly<{
|
|
33
|
-
onCopy?: (text: string) => any;
|
|
34
33
|
onError?: (err: Error) => any;
|
|
34
|
+
onCopy?: (text: string) => any;
|
|
35
35
|
}>, {
|
|
36
36
|
variant: ButtonVariant;
|
|
37
37
|
size: ButtonSize;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { defineComponent as ae, ref as a, computed as f, inject as ie, onMounted as se, onUnmounted as re, watch as x, provide as L, reactive as de, toRefs as ue, openBlock as R, createElementBlock as ce, normalizeStyle as fe, createVNode as N, unref as u, withCtx as m, createBlock as me, normalizeClass as ve, createSlots as he, renderSlot as v, normalizeProps as z, guardReactiveProps as j, createCommentVNode as ye, createElementVNode as ge } from "vue";
|
|
2
2
|
import be from "v-tooltip-lite";
|
|
3
3
|
import "v-tooltip-lite/style.css";
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import { useDropdownIds as
|
|
8
|
-
import { useDropdownSelection as
|
|
4
|
+
import Ce from "./DropdownMenu.vue.js";
|
|
5
|
+
import pe from "./DropdownTrigger.vue.js";
|
|
6
|
+
import Se from "../ConfirmationModal.vue.js";
|
|
7
|
+
import { useDropdownIds as we } from "./composables/useDropdownIds.js";
|
|
8
|
+
import { useDropdownSelection as Oe } from "./composables/useDropdownSelection.js";
|
|
9
9
|
import { useDropdownHydration as $e } from "./composables/useDropdownHydration.js";
|
|
10
10
|
const He = /* @__PURE__ */ ae({
|
|
11
11
|
__name: "Dropdown",
|
|
@@ -30,6 +30,7 @@ const He = /* @__PURE__ */ ae({
|
|
|
30
30
|
minWidth: { default: "140px" },
|
|
31
31
|
ignoreClickOutside: {},
|
|
32
32
|
menuId: {},
|
|
33
|
+
menuStyles: {},
|
|
33
34
|
nestedPosition: {},
|
|
34
35
|
nestedOffset: {},
|
|
35
36
|
showSelectedLabel: { type: Boolean, default: !0 },
|
|
@@ -60,9 +61,9 @@ const He = /* @__PURE__ */ ae({
|
|
|
60
61
|
confirmText: "Confirm",
|
|
61
62
|
cancelText: "Cancel",
|
|
62
63
|
variant: "primary"
|
|
63
|
-
}), q = f(() => l.position ? l.position : l.direction === "rtl" ? "bottom-end" : "bottom-start"), F = f(() => l.nestedPosition ? l.nestedPosition : l.direction === "rtl" ? "left-start" : "right-start"),
|
|
64
|
-
|
|
65
|
-
|
|
64
|
+
}), q = f(() => l.position ? l.position : l.direction === "rtl" ? "bottom-end" : "bottom-start"), F = f(() => l.nestedPosition ? l.nestedPosition : l.direction === "rtl" ? "left-start" : "right-start"), C = a(l.isOpen || !1), p = a(0), G = a(null), O = a(null), $ = () => {
|
|
65
|
+
O.value && setTimeout(() => {
|
|
66
|
+
O.value?.focus({ preventScroll: !0 });
|
|
66
67
|
}, 10);
|
|
67
68
|
}, J = `dropdown-${Math.random().toString(36).substring(2, 9)}`, I = f(() => l.menuId || J), g = a([]), s = ie("dropdown-context", null), K = (e) => {
|
|
68
69
|
g.value.includes(e) || g.value.push(e), s?.registerChildId?.(e);
|
|
@@ -78,41 +79,41 @@ const He = /* @__PURE__ */ ae({
|
|
|
78
79
|
(e) => {
|
|
79
80
|
if (e !== void 0) {
|
|
80
81
|
if ((l.disabled || l.readonly) && e) return;
|
|
81
|
-
|
|
82
|
+
C.value = e;
|
|
82
83
|
}
|
|
83
84
|
}
|
|
84
85
|
);
|
|
85
86
|
const A = (e) => {
|
|
86
87
|
if (l.disabled || l.readonly) {
|
|
87
|
-
|
|
88
|
+
C.value = !1, h("update:isOpen", !1);
|
|
88
89
|
return;
|
|
89
90
|
}
|
|
90
|
-
|
|
91
|
-
},
|
|
91
|
+
C.value = e, h("update:isOpen", e), h(e ? "onOpen" : "onClose"), s?.onChildToggle?.(e);
|
|
92
|
+
}, S = () => {
|
|
92
93
|
A(!1);
|
|
93
94
|
}, X = (e) => {
|
|
94
|
-
e ?
|
|
95
|
+
e ? p.value++ : p.value = Math.max(0, p.value - 1);
|
|
95
96
|
};
|
|
96
97
|
L("dropdown-context", {
|
|
97
|
-
close:
|
|
98
|
+
close: S,
|
|
98
99
|
onChildToggle: (e) => {
|
|
99
100
|
X(e), s?.onChildToggle?.(e);
|
|
100
101
|
},
|
|
101
102
|
registerChildId: K,
|
|
102
103
|
unregisterChildId: Q
|
|
103
104
|
}), L("modal-context", null);
|
|
104
|
-
const k = f(() => l.options ? l.options.map((e) => typeof e == "string" || typeof e == "number" ? { label: String(e), value: String(e) } : e) : []),
|
|
105
|
+
const k = f(() => l.options ? l.options.map((e) => typeof e == "string" || typeof e == "number" ? { label: String(e), value: String(e) } : e) : []), w = a([]), E = a(!1), T = a(!1);
|
|
105
106
|
x(
|
|
106
107
|
k,
|
|
107
108
|
(e) => {
|
|
108
109
|
if (e) {
|
|
109
110
|
if (l.remote) {
|
|
110
|
-
const o = [...
|
|
111
|
+
const o = [...w.value];
|
|
111
112
|
e.forEach((n) => {
|
|
112
113
|
o.some((i) => i.value !== void 0 && n.value !== void 0 ? typeof i.value == "object" && i.key && n.key ? i.key === n.key && i.value[i.key] === n.value[n.key] : i.value === n.value : i.label === n.label) || o.push(n);
|
|
113
|
-
}),
|
|
114
|
+
}), w.value = o;
|
|
114
115
|
} else
|
|
115
|
-
|
|
116
|
+
w.value = e;
|
|
116
117
|
!E.value && e.length > 0 && (E.value = !0, setTimeout(() => {
|
|
117
118
|
T.value = !0, H(M.value);
|
|
118
119
|
}, 10));
|
|
@@ -121,7 +122,7 @@ const He = /* @__PURE__ */ ae({
|
|
|
121
122
|
{ immediate: !0 }
|
|
122
123
|
);
|
|
123
124
|
const c = f(() => {
|
|
124
|
-
const e = [...
|
|
125
|
+
const e = [...w.value], o = new Set(e.map((n) => n.value ?? n.label));
|
|
125
126
|
return B.value.forEach((n, d) => {
|
|
126
127
|
o.has(d) || (e.unshift(n), o.add(d));
|
|
127
128
|
}), e;
|
|
@@ -129,10 +130,10 @@ const He = /* @__PURE__ */ ae({
|
|
|
129
130
|
fetchSelected: l.fetchSelected,
|
|
130
131
|
getAvailableOptions: () => c.value,
|
|
131
132
|
isReady: () => T.value
|
|
132
|
-
}), { getAllRecursiveIds: Z } =
|
|
133
|
+
}), { getAllRecursiveIds: Z } = we(), _ = de({
|
|
133
134
|
...ue(l),
|
|
134
135
|
options: c
|
|
135
|
-
}), { currentValue: M, selectedLabel: V, selectedIcon: W, selectOption: ee } =
|
|
136
|
+
}), { currentValue: M, selectedLabel: V, selectedIcon: W, selectOption: ee } = Oe(
|
|
136
137
|
_,
|
|
137
138
|
h
|
|
138
139
|
), te = f(() => {
|
|
@@ -160,7 +161,7 @@ const He = /* @__PURE__ */ ae({
|
|
|
160
161
|
confirmText: "Confirm",
|
|
161
162
|
cancelText: "Cancel",
|
|
162
163
|
variant: "primary"
|
|
163
|
-
}, b.value = !0,
|
|
164
|
+
}, b.value = !0, S()) : (D(e), l.closeOnSelect && (S(), $()));
|
|
164
165
|
}, D = (e) => {
|
|
165
166
|
if (l.disabled || l.readonly || e.disabled) return;
|
|
166
167
|
const o = e.value ?? e.label;
|
|
@@ -196,8 +197,8 @@ const He = /* @__PURE__ */ ae({
|
|
|
196
197
|
teleport: t.teleport,
|
|
197
198
|
offset: t.offset,
|
|
198
199
|
placement: q.value,
|
|
199
|
-
isOpen:
|
|
200
|
-
keepAlive:
|
|
200
|
+
isOpen: C.value,
|
|
201
|
+
keepAlive: p.value > 0,
|
|
201
202
|
menuId: I.value,
|
|
202
203
|
ignoreClickOutside: te.value,
|
|
203
204
|
class: "w-full flex!",
|
|
@@ -207,6 +208,7 @@ const He = /* @__PURE__ */ ae({
|
|
|
207
208
|
"onUpdate:isOpen": A,
|
|
208
209
|
triggerClass: "w-full flex items-center",
|
|
209
210
|
styles: {
|
|
211
|
+
...t.menuStyles || {},
|
|
210
212
|
padding: "0",
|
|
211
213
|
...t.width ? { width: t.width, maxWidth: t.width } : {},
|
|
212
214
|
...t.minWidth ? { minWidth: t.minWidth } : {},
|
|
@@ -219,7 +221,7 @@ const He = /* @__PURE__ */ ae({
|
|
|
219
221
|
selectedIcon: t.showSelectedIcon ? u(W) : void 0,
|
|
220
222
|
isOpen: n
|
|
221
223
|
})), () => [
|
|
222
|
-
N(
|
|
224
|
+
N(pe, {
|
|
223
225
|
"selected-label": u(V),
|
|
224
226
|
"selected-icon": t.showSelectedIcon ? u(W) : void 0,
|
|
225
227
|
"is-open": n,
|
|
@@ -232,7 +234,7 @@ const He = /* @__PURE__ */ ae({
|
|
|
232
234
|
])
|
|
233
235
|
]),
|
|
234
236
|
default: m(() => [
|
|
235
|
-
!(t.disabled || t.readonly) && (k.value.length || c.value.length || e.$slots.menu || e.$slots.item || e.$slots.default || t.remote || t.searchable) ? (R(), me(
|
|
237
|
+
!(t.disabled || t.readonly) && (k.value.length || c.value.length || e.$slots.menu || e.$slots.item || e.$slots.default || t.remote || t.searchable) ? (R(), me(Ce, {
|
|
236
238
|
key: 0,
|
|
237
239
|
options: k.value,
|
|
238
240
|
cachedOptions: c.value,
|
|
@@ -256,7 +258,7 @@ const He = /* @__PURE__ */ ae({
|
|
|
256
258
|
debounceTime: t.debounceTime,
|
|
257
259
|
trigger: t.trigger,
|
|
258
260
|
onSelect: le,
|
|
259
|
-
onClose:
|
|
261
|
+
onClose: S,
|
|
260
262
|
onLoadMore: o[0] || (o[0] = (n) => e.$emit("load-more")),
|
|
261
263
|
onSearch: o[1] || (o[1] = (n) => e.$emit("search", n))
|
|
262
264
|
}, he({ _: 2 }, [
|
|
@@ -293,7 +295,7 @@ const He = /* @__PURE__ */ ae({
|
|
|
293
295
|
]),
|
|
294
296
|
_: 3
|
|
295
297
|
}, 8, ["trigger", "disabled", "teleport", "offset", "placement", "isOpen", "keepAlive", "menuId", "ignoreClickOutside", "className", "styles"]),
|
|
296
|
-
N(
|
|
298
|
+
N(Se, {
|
|
297
299
|
show: b.value,
|
|
298
300
|
title: r.value.title,
|
|
299
301
|
description: r.value.description,
|
|
@@ -305,7 +307,7 @@ const He = /* @__PURE__ */ ae({
|
|
|
305
307
|
}, null, 8, ["show", "title", "description", "confirm-text", "cancel-text", "variant"]),
|
|
306
308
|
ge("span", {
|
|
307
309
|
ref_key: "focusTrapAfter",
|
|
308
|
-
ref:
|
|
310
|
+
ref: O,
|
|
309
311
|
tabindex: "-1",
|
|
310
312
|
class: "outline-none pointer-events-none absolute opacity-0 w-0 h-0",
|
|
311
313
|
"aria-hidden": "true"
|
|
@@ -41,12 +41,12 @@ declare function __VLS_template(): {
|
|
|
41
41
|
};
|
|
42
42
|
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
43
43
|
declare const __VLS_component: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
44
|
-
change: (value: FilePickerValue | FilePickerValue[]) => any;
|
|
45
44
|
error: (error: string) => any;
|
|
45
|
+
change: (value: FilePickerValue | FilePickerValue[]) => any;
|
|
46
46
|
"update:modelValue": (value: FilePickerValue | FilePickerValue[]) => any;
|
|
47
47
|
}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{
|
|
48
|
-
onChange?: (value: FilePickerValue | FilePickerValue[]) => any;
|
|
49
48
|
onError?: (error: string) => any;
|
|
49
|
+
onChange?: (value: FilePickerValue | FilePickerValue[]) => any;
|
|
50
50
|
"onUpdate:modelValue"?: (value: FilePickerValue | FilePickerValue[]) => any;
|
|
51
51
|
}>, {
|
|
52
52
|
variant: "dropzone" | "input";
|