vlite3 1.4.4 → 1.4.6
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.d.ts +4 -17
- package/components/AppShell/AppShellLayoutStorefront.vue.js +116 -152
- package/components/AvatarUploader/AvatarUploader.vue.d.ts +1 -1
- package/components/AvatarUploader/AvatarUploader.vue.js +1 -1
- package/components/Cart/Cart.vue.js +242 -0
- package/components/Cart/Cart.vue2.js +4 -0
- package/components/Cart/CartCouponInput.vue.js +176 -0
- package/components/Cart/CartCouponInput.vue2.js +4 -0
- package/components/Cart/CartEmptyState.vue.js +48 -0
- package/components/Cart/CartEmptyState.vue2.js +4 -0
- package/components/Cart/CartLineItem.vue.js +341 -0
- package/components/Cart/CartLineItem.vue2.js +4 -0
- package/components/Cart/CartSummary.vue.js +157 -0
- package/components/Cart/CartSummary.vue2.js +4 -0
- package/components/Cart/CartVariant1.vue.js +156 -0
- package/components/Cart/CartVariant1.vue2.js +4 -0
- package/components/Cart/CartVariant2.vue.js +154 -0
- package/components/Cart/CartVariant2.vue2.js +4 -0
- package/components/Cart/CartVariant3.vue.js +192 -0
- package/components/Cart/CartVariant3.vue2.js +4 -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.js +145 -0
- package/components/Cart/index.d.ts +2 -0
- package/components/CategoryManager/CategoryManager.vue.js +3 -3
- package/components/CategoryManager/CategoryManager.vue2.js +225 -249
- 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/Chat/ChatInterface.vue.js +1 -1
- package/components/Comment/CommentEditor.vue.js +1 -1
- package/components/Dropdown/Dropdown.vue.d.ts +1 -0
- package/components/Dropdown/Dropdown.vue.js +31 -29
- package/components/FilePicker/FilePickerDropzone.vue.d.ts +27 -0
- package/components/FilePicker/FilePickerDropzone.vue.js +117 -0
- package/components/FilePicker/FilePickerDropzone.vue2.js +4 -0
- package/components/FilePicker/FilePickerInput.vue.d.ts +22 -0
- package/components/FilePicker/FilePickerInput.vue.js +147 -0
- package/components/FilePicker/FilePickerInput.vue2.js +4 -0
- package/components/FilePicker/FilePreview.vue.d.ts +21 -0
- package/components/FilePicker/FilePreview.vue.js +95 -0
- package/components/FilePicker/FilePreview.vue2.js +4 -0
- package/components/FilePicker/composables/useFileProcessing.d.ts +65 -0
- package/components/FilePicker/composables/useFileProcessing.js +141 -0
- package/components/FilePicker/index.d.ts +2 -2
- package/components/FilePicker/{FilePicker.vue.d.ts → index.vue.d.ts} +11 -18
- package/components/FilePicker/index.vue.js +131 -0
- package/components/FilePicker/index.vue2.js +4 -0
- package/components/FilePicker/types.d.ts +17 -0
- package/components/FilePicker/utils.d.ts +23 -0
- package/components/FilePicker/utils.js +37 -0
- package/components/Form/AccordionView.vue.d.ts +26 -0
- package/components/Form/AccordionView.vue.js +219 -0
- package/components/Form/AccordionView.vue2.js +4 -0
- package/components/Form/FormField.vue.js +3 -3
- package/components/Form/FormFields.vue.js +2 -2
- package/components/Form/TableRow.vue.d.ts +18 -0
- package/components/Form/TableRow.vue.js +88 -0
- package/components/Form/TableRow.vue2.js +4 -0
- package/components/Form/TableView.vue.d.ts +23 -0
- package/components/Form/TableView.vue.js +88 -0
- package/components/Form/TableView.vue2.js +4 -0
- package/components/Form/composables/useCustomFieldRows.d.ts +52 -0
- package/components/Form/composables/useCustomFieldRows.js +77 -0
- package/components/Form/index.d.ts +1 -1
- package/components/Form/{CustomFields.vue.d.ts → index.vue.d.ts} +8 -5
- package/components/Form/index.vue.js +7 -0
- package/components/Form/index.vue2.js +141 -0
- package/components/Form/rowHelpers.d.ts +45 -0
- package/components/Form/rowHelpers.js +40 -0
- package/components/Form/types.d.ts +3 -0
- package/components/IconPicker.vue.d.ts +2 -2
- package/components/Modal.vue.d.ts +2 -0
- package/components/Modal.vue.js +1 -1
- package/components/Modal.vue2.js +30 -28
- package/components/Screen/ScreenFilter.vue.js +4 -3
- 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/ThumbnailSelector/ThumbnailSelector.vue.js +1 -1
- package/components/ThumbnailSelector/ThumbnailSelector.vue2.js +1 -1
- package/components/index.d.ts +2 -1
- package/core/config.d.ts +6 -6
- package/index.d.ts +1 -0
- package/index.js +328 -307
- package/package.json +1 -1
- package/style.css +1 -1
- package/components/FilePicker/FilePicker.vue.js +0 -361
- package/components/FilePicker/FilePicker.vue2.js +0 -4
- package/components/Form/CustomFields.vue.js +0 -7
- package/components/Form/CustomFields.vue2.js +0 -261
|
@@ -7,31 +7,18 @@ declare function __VLS_template(): {
|
|
|
7
7
|
toggle: () => boolean;
|
|
8
8
|
}): any;
|
|
9
9
|
left?(_: {}): any;
|
|
10
|
-
left?(_: {}): any;
|
|
11
|
-
nav?(_: {}): any;
|
|
12
|
-
nav?(_: {}): any;
|
|
13
|
-
logo?(_: {}): any;
|
|
14
|
-
logo?(_: {}): any;
|
|
15
|
-
center?(_: {}): any;
|
|
16
10
|
center?(_: {}): any;
|
|
17
|
-
search?(_: {}): any;
|
|
18
|
-
search?(_: {}): any;
|
|
19
|
-
actions?(_: {}): any;
|
|
20
|
-
actions?(_: {}): any;
|
|
21
11
|
right?(_: {}): any;
|
|
22
|
-
|
|
23
|
-
'mobile-search'?(_: {}): any;
|
|
24
|
-
categories?(_: {
|
|
25
|
-
categoryRoutePrefix: string;
|
|
26
|
-
}): any;
|
|
12
|
+
'mobile-bottom'?(_: {}): any;
|
|
27
13
|
categories?(_: {
|
|
28
14
|
categoryRoutePrefix: string;
|
|
29
15
|
}): any;
|
|
30
16
|
main?(_: {}): any;
|
|
31
17
|
footer?(_: {}): any;
|
|
32
18
|
'mobile-sidebar-header'?(_: {}): any;
|
|
33
|
-
'mobile-sidebar'?(_: {
|
|
34
|
-
|
|
19
|
+
'mobile-sidebar'?(_: {
|
|
20
|
+
categoryRoutePrefix: string;
|
|
21
|
+
}): any;
|
|
35
22
|
'mobile-sidebar-footer'?(_: {}): any;
|
|
36
23
|
};
|
|
37
24
|
refs: {
|
|
@@ -1,215 +1,179 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
1
|
+
import { defineComponent as z, inject as T, computed as v, openBlock as t, createElementBlock as i, renderSlot as l, createCommentVNode as d, createElementVNode as a, normalizeClass as n, unref as e, createVNode as f, isRef as y, createSlots as _, withCtx as w } from "vue";
|
|
2
|
+
import R from "../Icon.vue.js";
|
|
3
|
+
import P from "../SidePanel.vue.js";
|
|
4
|
+
import V from "../Navbar/NavbarTabs.vue.js";
|
|
5
5
|
/* empty css */
|
|
6
|
-
import
|
|
6
|
+
import j from "../Breadcrumb/Breadcrumb.vue.js";
|
|
7
7
|
/* empty css */
|
|
8
|
-
import { APPSHELL_LAYOUT_KEY as
|
|
9
|
-
import { normalizeRoutePrefix as
|
|
10
|
-
const
|
|
8
|
+
import { APPSHELL_LAYOUT_KEY as N } from "./useAppShell.js";
|
|
9
|
+
import { normalizeRoutePrefix as B } from "../CategoryMenu/utils.js";
|
|
10
|
+
const E = { class: "vlite-app-layout flex flex-col w-full h-full min-h-0 bg-body text-foreground overflow-hidden" }, L = {
|
|
11
11
|
key: 0,
|
|
12
12
|
class: "shrink-0 w-full"
|
|
13
|
-
},
|
|
13
|
+
}, M = { class: "w-full mx-auto max-w-7xl px-3 sm:px-4 md:px-6 lg:px-8" }, O = ["aria-label"], A = {
|
|
14
|
+
key: 0,
|
|
15
|
+
class: "flex items-center justify-center min-w-0 flex-1 px-2"
|
|
16
|
+
}, U = { class: "w-full min-w-0 max-w-7xl mx-auto overflow-hidden px-3 sm:px-4 md:px-6 lg:px-8" }, Y = {
|
|
14
17
|
key: 0,
|
|
15
18
|
class: "shrink-0 w-full"
|
|
16
|
-
},
|
|
19
|
+
}, D = {
|
|
17
20
|
key: 2,
|
|
18
21
|
class: "shrink-0 w-full border-t border-border bg-background"
|
|
19
|
-
},
|
|
22
|
+
}, H = { class: "flex flex-col h-full" }, I = {
|
|
20
23
|
class: "flex-1 overflow-y-auto px-3.5 py-4 space-y-4 scrollbar-thin scrollbar-stable",
|
|
21
24
|
style: { "will-change": "transform", contain: "layout style" }
|
|
22
|
-
},
|
|
25
|
+
}, K = {
|
|
23
26
|
key: 0,
|
|
24
27
|
class: "mt-auto border-t border-border px-3.5 py-3"
|
|
25
|
-
}, te = /* @__PURE__ */
|
|
28
|
+
}, te = /* @__PURE__ */ z({
|
|
26
29
|
__name: "AppShellLayoutStorefront",
|
|
27
|
-
setup(
|
|
28
|
-
const
|
|
29
|
-
props:
|
|
30
|
-
isMobileMenuOpen:
|
|
31
|
-
isSidebarVisible:
|
|
32
|
-
toggleSidebar:
|
|
33
|
-
pageTitle:
|
|
34
|
-
breadcrumbData:
|
|
35
|
-
breakpointClasses:
|
|
36
|
-
nestedTabsItems:
|
|
30
|
+
setup(q) {
|
|
31
|
+
const k = T(N), {
|
|
32
|
+
props: s,
|
|
33
|
+
isMobileMenuOpen: r,
|
|
34
|
+
isSidebarVisible: F,
|
|
35
|
+
toggleSidebar: G,
|
|
36
|
+
pageTitle: J,
|
|
37
|
+
breadcrumbData: p,
|
|
38
|
+
breakpointClasses: u,
|
|
39
|
+
nestedTabsItems: g,
|
|
37
40
|
activeNestedTab: c,
|
|
38
|
-
handleNestedTabClick:
|
|
39
|
-
mainScrollRef:
|
|
40
|
-
layoutMainRef:
|
|
41
|
-
} =
|
|
41
|
+
handleNestedTabClick: x,
|
|
42
|
+
mainScrollRef: $,
|
|
43
|
+
layoutMainRef: C
|
|
44
|
+
} = k, S = v(() => [
|
|
42
45
|
"w-full shrink-0 bg-background transition-shadow duration-200",
|
|
43
46
|
{
|
|
44
47
|
fixed: "fixed top-0 left-0 z-50",
|
|
45
48
|
sticky: "sticky top-0 z-50",
|
|
46
49
|
relative: "relative z-20",
|
|
47
50
|
absolute: "absolute top-0 left-0 w-full z-50"
|
|
48
|
-
}[
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
].filter(Boolean).join(" ")), h = v(() =>
|
|
54
|
-
return (
|
|
55
|
-
|
|
56
|
-
o
|
|
57
|
-
])) :
|
|
58
|
-
|
|
59
|
-
class:
|
|
51
|
+
}[s.position || "sticky"],
|
|
52
|
+
s.border ? "border-b border-border" : "",
|
|
53
|
+
s.glass ? "bg-background/90 backdrop-blur-md" : "",
|
|
54
|
+
s.floating ? "m-3 rounded-lg border border-border shadow-sm overflow-hidden" : "",
|
|
55
|
+
s.class
|
|
56
|
+
].filter(Boolean).join(" ")), h = v(() => B(s.categoryRoutePrefix));
|
|
57
|
+
return (o, m) => (t(), i("div", E, [
|
|
58
|
+
o.$slots.announcement ? (t(), i("div", L, [
|
|
59
|
+
l(o.$slots, "announcement")
|
|
60
|
+
])) : d("", !0),
|
|
61
|
+
a("header", {
|
|
62
|
+
class: n(S.value)
|
|
60
63
|
}, [
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
class:
|
|
64
|
+
a("div", M, [
|
|
65
|
+
a("div", {
|
|
66
|
+
class: n(["flex w-full items-center justify-between gap-3 md:gap-6", e(s).height])
|
|
64
67
|
}, [
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
68
|
+
a("div", {
|
|
69
|
+
class: n(["flex items-center gap-2 sm:gap-4 min-w-0 shrink-0", { "flex-1": !o.$slots.center }])
|
|
70
|
+
}, [
|
|
71
|
+
l(o.$slots, "mobile-trigger", {
|
|
72
|
+
isOpen: e(r),
|
|
73
|
+
toggle: () => r.value = !e(r)
|
|
69
74
|
}, () => [
|
|
70
|
-
|
|
75
|
+
a("button", {
|
|
71
76
|
type: "button",
|
|
72
|
-
class:
|
|
73
|
-
"aria-label":
|
|
74
|
-
onClick:
|
|
77
|
+
class: n(["inline-flex items-center justify-center w-9 h-9 rounded-md text-muted-foreground hover:text-foreground hover:bg-accent", [e(u).mobileTrigger, e(s).mobileTriggerClass]]),
|
|
78
|
+
"aria-label": e(r) ? "Close menu" : "Open menu",
|
|
79
|
+
onClick: m[0] || (m[0] = (b) => r.value = !e(r))
|
|
75
80
|
}, [
|
|
76
|
-
|
|
77
|
-
icon:
|
|
81
|
+
f(R, {
|
|
82
|
+
icon: e(r) ? "lucide:x" : "lucide:menu",
|
|
78
83
|
class: "w-5 h-5"
|
|
79
84
|
}, null, 8, ["icon"])
|
|
80
|
-
], 10,
|
|
85
|
+
], 10, O)
|
|
81
86
|
]),
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
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])
|
|
87
|
+
l(o.$slots, "left")
|
|
88
|
+
], 2),
|
|
89
|
+
o.$slots.center ? (t(), i("div", A, [
|
|
90
|
+
l(o.$slots, "center")
|
|
91
|
+
])) : d("", !0),
|
|
92
|
+
a("div", {
|
|
93
|
+
class: n(["flex items-center justify-end gap-2 sm:gap-4 min-w-0 shrink-0", [e(s).rightClass, { "flex-1": !o.$slots.center }]])
|
|
106
94
|
}, [
|
|
107
|
-
|
|
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
|
-
])
|
|
95
|
+
l(o.$slots, "right")
|
|
116
96
|
], 2)
|
|
117
97
|
], 2),
|
|
118
|
-
|
|
98
|
+
o.$slots["mobile-bottom"] ? (t(), i("div", {
|
|
119
99
|
key: 0,
|
|
120
|
-
class:
|
|
100
|
+
class: n(["pb-3 w-full", e(u).mobileTrigger])
|
|
121
101
|
}, [
|
|
122
|
-
o
|
|
123
|
-
|
|
124
|
-
])
|
|
125
|
-
], 2)) : i("", !0)
|
|
102
|
+
l(o.$slots, "mobile-bottom")
|
|
103
|
+
], 2)) : d("", !0)
|
|
126
104
|
]),
|
|
127
|
-
|
|
105
|
+
o.$slots.categories ? (t(), i("div", {
|
|
128
106
|
key: 0,
|
|
129
|
-
class:
|
|
107
|
+
class: n(["w-full min-w-0 overflow-hidden border-t border-border bg-background", [e(u).desktopContent, e(s).menuClass]])
|
|
130
108
|
}, [
|
|
131
|
-
|
|
132
|
-
o
|
|
109
|
+
a("div", U, [
|
|
110
|
+
l(o.$slots, "categories", { categoryRoutePrefix: h.value })
|
|
133
111
|
])
|
|
134
|
-
], 2)) :
|
|
112
|
+
], 2)) : d("", !0)
|
|
135
113
|
], 2),
|
|
136
|
-
|
|
114
|
+
o.$slots.main ? (t(), i("main", {
|
|
137
115
|
key: 1,
|
|
138
116
|
ref_key: "layoutMainRef",
|
|
139
|
-
ref:
|
|
117
|
+
ref: C,
|
|
140
118
|
class: "flex-1 overflow-hidden w-full relative flex flex-col min-h-0"
|
|
141
119
|
}, [
|
|
142
|
-
s
|
|
143
|
-
|
|
144
|
-
modelValue:
|
|
145
|
-
"onUpdate:modelValue":
|
|
146
|
-
onChange:
|
|
147
|
-
items:
|
|
120
|
+
e(s).renderNestedTabs && e(g).length > 0 ? (t(), i("div", Y, [
|
|
121
|
+
f(V, {
|
|
122
|
+
modelValue: e(c),
|
|
123
|
+
"onUpdate:modelValue": m[1] || (m[1] = (b) => y(c) ? c.value = b : null),
|
|
124
|
+
onChange: e(x),
|
|
125
|
+
items: e(g)
|
|
148
126
|
}, null, 8, ["modelValue", "onChange", "items"])
|
|
149
|
-
])) :
|
|
150
|
-
s
|
|
127
|
+
])) : d("", !0),
|
|
128
|
+
e(s).breadcrumb && e(s).breadcrumbPosition === "main" && e(p).items.value.length > 1 ? (t(), i("div", {
|
|
151
129
|
key: 1,
|
|
152
|
-
class:
|
|
130
|
+
class: n(["shrink-0 w-full border-b border-border px-6 py-2", e(s).breadcrumbClass])
|
|
153
131
|
}, [
|
|
154
|
-
|
|
155
|
-
items:
|
|
156
|
-
variant: s
|
|
157
|
-
separator: s
|
|
158
|
-
size: s
|
|
132
|
+
f(e(j), {
|
|
133
|
+
items: e(p).items.value,
|
|
134
|
+
variant: e(s).breadcrumbVariant,
|
|
135
|
+
separator: e(s).breadcrumbSeparator,
|
|
136
|
+
size: e(s).breadcrumbSize
|
|
159
137
|
}, null, 8, ["items", "variant", "separator", "size"])
|
|
160
|
-
], 2)) :
|
|
161
|
-
|
|
138
|
+
], 2)) : d("", !0),
|
|
139
|
+
a("div", {
|
|
162
140
|
ref_key: "mainScrollRef",
|
|
163
|
-
ref:
|
|
141
|
+
ref: $,
|
|
164
142
|
style: { "will-change": "transform", contain: "layout style" },
|
|
165
|
-
class:
|
|
143
|
+
class: n(["flex-1 overflow-y-auto w-full relative h-full scrollbar-thin scrollbar-stable", e(s).contentClass])
|
|
166
144
|
}, [
|
|
167
|
-
o
|
|
145
|
+
l(o.$slots, "main")
|
|
168
146
|
], 2)
|
|
169
|
-
], 512)) :
|
|
170
|
-
|
|
171
|
-
o
|
|
172
|
-
])) :
|
|
173
|
-
|
|
174
|
-
show:
|
|
175
|
-
"onUpdate:show":
|
|
147
|
+
], 512)) : d("", !0),
|
|
148
|
+
o.$slots.footer ? (t(), i("footer", D, [
|
|
149
|
+
l(o.$slots, "footer")
|
|
150
|
+
])) : d("", !0),
|
|
151
|
+
f(P, {
|
|
152
|
+
show: e(r),
|
|
153
|
+
"onUpdate:show": m[2] || (m[2] = (b) => y(r) ? r.value = b : null),
|
|
176
154
|
position: "left",
|
|
177
155
|
size: "sm",
|
|
178
|
-
triggerClass:
|
|
179
|
-
class:
|
|
156
|
+
triggerClass: e(u).mobileTrigger,
|
|
157
|
+
class: n(["z-60", e(u).mobileTrigger]),
|
|
180
158
|
headerClass: "pl-3! pr-4.5! py-3!",
|
|
181
159
|
bodyClass: "p-0!"
|
|
182
|
-
},
|
|
183
|
-
default:
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
o
|
|
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
|
-
])
|
|
160
|
+
}, _({
|
|
161
|
+
default: w(() => [
|
|
162
|
+
a("div", H, [
|
|
163
|
+
a("div", I, [
|
|
164
|
+
l(o.$slots, "mobile-sidebar", { categoryRoutePrefix: h.value })
|
|
193
165
|
]),
|
|
194
|
-
|
|
195
|
-
o
|
|
196
|
-
|
|
197
|
-
o(e.$slots, "right")
|
|
198
|
-
])
|
|
199
|
-
])
|
|
200
|
-
])) : i("", !0)
|
|
166
|
+
o.$slots["mobile-sidebar-footer"] ? (t(), i("div", K, [
|
|
167
|
+
l(o.$slots, "mobile-sidebar-footer")
|
|
168
|
+
])) : d("", !0)
|
|
201
169
|
])
|
|
202
170
|
]),
|
|
203
171
|
_: 2
|
|
204
172
|
}, [
|
|
205
|
-
|
|
173
|
+
o.$slots["mobile-sidebar-header"] ? {
|
|
206
174
|
name: "header",
|
|
207
|
-
fn:
|
|
208
|
-
o
|
|
209
|
-
o(e.$slots, "logo", {}, () => [
|
|
210
|
-
o(e.$slots, "center")
|
|
211
|
-
])
|
|
212
|
-
])
|
|
175
|
+
fn: w(() => [
|
|
176
|
+
l(o.$slots, "mobile-sidebar-header")
|
|
213
177
|
]),
|
|
214
178
|
key: "0"
|
|
215
179
|
} : void 0
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent as x, ref as w, computed as z, openBlock as i, createElementBlock as n, createElementVNode as b, normalizeClass as r, createVNode as o, withCtx as V, createCommentVNode as g, withModifiers as C } from "vue";
|
|
2
2
|
import c from "../Icon.vue.js";
|
|
3
|
-
import U from "../FilePicker/
|
|
3
|
+
import U from "../FilePicker/index.vue.js";
|
|
4
4
|
import $ from "../Avatar.vue.js";
|
|
5
5
|
const A = ["data-testid"], R = ["onClick"], F = /* @__PURE__ */ x({
|
|
6
6
|
name: "AvatarUploader",
|
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
import { defineComponent as N, computed as s, ref as R, watch as f, openBlock as Q, createBlock as U, resolveDynamicComponent as F } from "vue";
|
|
2
|
+
import { getComponentConfig as P } from "../../utils/configUtils.js";
|
|
3
|
+
import { calculateCartTotals as z } from "./composables/useCartCalculation.js";
|
|
4
|
+
import H from "./CartVariant1.vue.js";
|
|
5
|
+
import L from "./CartVariant2.vue.js";
|
|
6
|
+
import j from "./CartVariant3.vue.js";
|
|
7
|
+
import E from "./CartVariant4.vue.js";
|
|
8
|
+
const Y = /* @__PURE__ */ N({
|
|
9
|
+
__name: "Cart",
|
|
10
|
+
props: {
|
|
11
|
+
data: {},
|
|
12
|
+
variant: { default: "Variant1" },
|
|
13
|
+
actions: {},
|
|
14
|
+
features: {},
|
|
15
|
+
labels: {},
|
|
16
|
+
containerClass: {},
|
|
17
|
+
validateCoupon: {}
|
|
18
|
+
},
|
|
19
|
+
emits: ["update:quantity", "remove", "clear", "apply-coupon", "remove-coupon", "coupon-change", "continue", "continue-shopping", "update:coupon", "update:totals"],
|
|
20
|
+
setup(v, { emit: C }) {
|
|
21
|
+
const t = v, o = C, c = P("cart") || {}, g = s(() => {
|
|
22
|
+
switch (t.variant ?? c.variant ?? "Variant1") {
|
|
23
|
+
case "Variant2":
|
|
24
|
+
return L;
|
|
25
|
+
case "Variant3":
|
|
26
|
+
return j;
|
|
27
|
+
case "Variant4":
|
|
28
|
+
return E;
|
|
29
|
+
default:
|
|
30
|
+
return H;
|
|
31
|
+
}
|
|
32
|
+
}), h = s(() => {
|
|
33
|
+
const e = {
|
|
34
|
+
editableQuantity: !0,
|
|
35
|
+
removable: !0,
|
|
36
|
+
clearable: !0,
|
|
37
|
+
coupon: !0,
|
|
38
|
+
subtotal: !0,
|
|
39
|
+
discount: !0,
|
|
40
|
+
estimatedTax: !0,
|
|
41
|
+
shipping: !0,
|
|
42
|
+
totalSavings: !0,
|
|
43
|
+
continue: !0,
|
|
44
|
+
continueShopping: !0,
|
|
45
|
+
thumbnails: !0,
|
|
46
|
+
description: !0,
|
|
47
|
+
sku: !0,
|
|
48
|
+
itemVariant: !0,
|
|
49
|
+
emptyState: !0,
|
|
50
|
+
trustSignals: !0
|
|
51
|
+
}, n = c.features ?? {}, u = t.features ?? {}, i = t.data?.readonly ? { editableQuantity: !1, removable: !1, clearable: !1, coupon: !1 } : {};
|
|
52
|
+
return { ...e, ...n, ...u, ...i };
|
|
53
|
+
}), y = s(() => ({
|
|
54
|
+
showContinue: !0,
|
|
55
|
+
showContinueShopping: !0,
|
|
56
|
+
continueDisabled: !1,
|
|
57
|
+
continueShoppingDisabled: !1,
|
|
58
|
+
...c.actions ?? {},
|
|
59
|
+
...t.actions ?? {}
|
|
60
|
+
})), r = R(null), p = s(() => r.value ?? t.data.coupon), d = s(() => z({
|
|
61
|
+
items: t.data.items || [],
|
|
62
|
+
tax: t.data.tax,
|
|
63
|
+
shipping: t.data.shipping,
|
|
64
|
+
coupon: p.value,
|
|
65
|
+
currency: t.data.currency
|
|
66
|
+
}).totals);
|
|
67
|
+
s(() => t.data.totals === void 0);
|
|
68
|
+
const m = s(() => t.data.totals ? t.data.totals : d.value);
|
|
69
|
+
f(
|
|
70
|
+
m,
|
|
71
|
+
(e) => o("update:totals", e),
|
|
72
|
+
{ deep: !0 }
|
|
73
|
+
);
|
|
74
|
+
const b = s(
|
|
75
|
+
() => !!t.validateCoupon || !!t.data.coupons?.length
|
|
76
|
+
);
|
|
77
|
+
f(
|
|
78
|
+
() => t.data.coupon,
|
|
79
|
+
(e) => {
|
|
80
|
+
e && r.value && e.code === r.value.code ? r.value = null : e || (r.value = null);
|
|
81
|
+
},
|
|
82
|
+
{ deep: !0 }
|
|
83
|
+
);
|
|
84
|
+
async function k(e) {
|
|
85
|
+
const n = e.trim().toUpperCase(), u = d.value.subtotal, i = t.data.currency;
|
|
86
|
+
if (t.data.coupons?.length) {
|
|
87
|
+
const a = t.data.coupons.find(
|
|
88
|
+
(l) => l.code.trim().toUpperCase() === n
|
|
89
|
+
);
|
|
90
|
+
if (!a)
|
|
91
|
+
return {
|
|
92
|
+
ok: !1,
|
|
93
|
+
coupon: {
|
|
94
|
+
code: e,
|
|
95
|
+
state: "invalid",
|
|
96
|
+
message: `Coupon code "${e}" is not recognised.`
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
if (a.expiresAt) {
|
|
100
|
+
const l = a.expiresAt instanceof Date ? a.expiresAt : new Date(a.expiresAt);
|
|
101
|
+
if (!Number.isNaN(l.getTime()) && l.getTime() < Date.now())
|
|
102
|
+
return {
|
|
103
|
+
ok: !1,
|
|
104
|
+
coupon: {
|
|
105
|
+
code: e,
|
|
106
|
+
state: "expired",
|
|
107
|
+
message: `Coupon "${e}" expired on ${l.toLocaleDateString()}.`
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
return a.minSubtotal !== void 0 && u < a.minSubtotal ? {
|
|
112
|
+
ok: !1,
|
|
113
|
+
coupon: {
|
|
114
|
+
code: e,
|
|
115
|
+
state: "error",
|
|
116
|
+
message: `Add ${(a.minSubtotal - u).toFixed(2)} more to use "${e}".`
|
|
117
|
+
}
|
|
118
|
+
} : a.minItems !== void 0 && (t.data.items || []).reduce(
|
|
119
|
+
(B, I) => B + (I.quantity || 0),
|
|
120
|
+
0
|
|
121
|
+
) < a.minItems ? {
|
|
122
|
+
ok: !1,
|
|
123
|
+
coupon: {
|
|
124
|
+
code: e,
|
|
125
|
+
state: "error",
|
|
126
|
+
message: `"${e}" requires at least ${a.minItems} items.`
|
|
127
|
+
}
|
|
128
|
+
} : a.currency && i && a.currency !== i ? {
|
|
129
|
+
ok: !1,
|
|
130
|
+
coupon: {
|
|
131
|
+
code: e,
|
|
132
|
+
state: "error",
|
|
133
|
+
message: `"${e}" is only valid for ${a.currency} orders.`
|
|
134
|
+
}
|
|
135
|
+
} : { ok: !0, definition: a };
|
|
136
|
+
}
|
|
137
|
+
if (t.validateCoupon)
|
|
138
|
+
try {
|
|
139
|
+
const a = await t.validateCoupon(e, {
|
|
140
|
+
subtotal: u,
|
|
141
|
+
currency: i,
|
|
142
|
+
items: t.data.items || []
|
|
143
|
+
});
|
|
144
|
+
return a ? "type" in a ? { ok: !0, definition: a } : {
|
|
145
|
+
ok: !1,
|
|
146
|
+
coupon: {
|
|
147
|
+
code: e,
|
|
148
|
+
state: a.state || "error",
|
|
149
|
+
message: a.message
|
|
150
|
+
}
|
|
151
|
+
} : {
|
|
152
|
+
ok: !1,
|
|
153
|
+
coupon: {
|
|
154
|
+
code: e,
|
|
155
|
+
state: "invalid",
|
|
156
|
+
message: `Coupon code "${e}" is not recognised.`
|
|
157
|
+
}
|
|
158
|
+
};
|
|
159
|
+
} catch (a) {
|
|
160
|
+
return {
|
|
161
|
+
ok: !1,
|
|
162
|
+
coupon: {
|
|
163
|
+
code: e,
|
|
164
|
+
state: "error",
|
|
165
|
+
message: a?.message || `Could not validate "${e}". Please try again.`
|
|
166
|
+
}
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
return {
|
|
170
|
+
ok: !1,
|
|
171
|
+
coupon: { code: e, state: "error", message: "No coupon validator configured." }
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
function x(e, n) {
|
|
175
|
+
return {
|
|
176
|
+
code: n.code,
|
|
177
|
+
description: n.description,
|
|
178
|
+
state: "applied",
|
|
179
|
+
definition: n,
|
|
180
|
+
expiresAt: n.expiresAt
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
function $(e, n) {
|
|
184
|
+
o("update:quantity", e, n);
|
|
185
|
+
}
|
|
186
|
+
function _(e) {
|
|
187
|
+
o("remove", e);
|
|
188
|
+
}
|
|
189
|
+
function S() {
|
|
190
|
+
o("clear");
|
|
191
|
+
}
|
|
192
|
+
async function A(e) {
|
|
193
|
+
if (o("apply-coupon", e), !b.value)
|
|
194
|
+
return;
|
|
195
|
+
const n = e.trim();
|
|
196
|
+
r.value = { code: n, state: "applying" }, t.validateCoupon || await new Promise((i) => setTimeout(i, 120));
|
|
197
|
+
const u = await k(n);
|
|
198
|
+
if (u.ok === !0) {
|
|
199
|
+
const i = x(n, u.definition);
|
|
200
|
+
r.value = null, o("update:coupon", i);
|
|
201
|
+
} else
|
|
202
|
+
r.value = null, o("update:coupon", u.coupon);
|
|
203
|
+
}
|
|
204
|
+
function w() {
|
|
205
|
+
r.value = null, o("update:coupon", null), o("remove-coupon");
|
|
206
|
+
}
|
|
207
|
+
function V(e) {
|
|
208
|
+
o("coupon-change", e);
|
|
209
|
+
}
|
|
210
|
+
function D() {
|
|
211
|
+
o("continue");
|
|
212
|
+
}
|
|
213
|
+
function T() {
|
|
214
|
+
o("continue-shopping");
|
|
215
|
+
}
|
|
216
|
+
const q = s(() => ({
|
|
217
|
+
...t.data,
|
|
218
|
+
items: t.data.items || [],
|
|
219
|
+
totals: m.value,
|
|
220
|
+
coupon: p.value
|
|
221
|
+
}));
|
|
222
|
+
return (e, n) => (Q(), U(F(g.value), {
|
|
223
|
+
data: q.value,
|
|
224
|
+
variant: t.variant,
|
|
225
|
+
actions: y.value,
|
|
226
|
+
features: h.value,
|
|
227
|
+
labels: t.labels,
|
|
228
|
+
"container-class": t.containerClass,
|
|
229
|
+
"onUpdate:quantity": $,
|
|
230
|
+
onRemove: _,
|
|
231
|
+
onClear: S,
|
|
232
|
+
onApplyCoupon: A,
|
|
233
|
+
onRemoveCoupon: w,
|
|
234
|
+
onCouponChange: V,
|
|
235
|
+
onContinue: D,
|
|
236
|
+
onContinueShopping: T
|
|
237
|
+
}, null, 40, ["data", "variant", "actions", "features", "labels", "container-class"]));
|
|
238
|
+
}
|
|
239
|
+
});
|
|
240
|
+
export {
|
|
241
|
+
Y as default
|
|
242
|
+
};
|