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
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import { defineComponent as q, computed as s, openBlock as a, createElementBlock as u, normalizeStyle as B, normalizeClass as d, createElementVNode as y, createVNode as h, toDisplayString as v, createCommentVNode as c, createBlock as f, Fragment as D, renderList as L, withCtx as C, createTextVNode as w } from "vue";
|
|
2
|
+
import N from "../Icon.vue.js";
|
|
3
|
+
import x from "../Button.vue.js";
|
|
4
|
+
import E from "./CartLineItem.vue.js";
|
|
5
|
+
import I from "./CartSummary.vue.js";
|
|
6
|
+
import j from "./CartCouponInput.vue.js";
|
|
7
|
+
import R from "./CartEmptyState.vue.js";
|
|
8
|
+
const A = { class: "min-w-0 flex-1" }, F = { class: "flex items-center gap-2" }, T = {
|
|
9
|
+
key: 0,
|
|
10
|
+
class: "inline-flex items-center justify-center px-1.5 h-5 rounded-full bg-muted text-muted-foreground text-[10px] font-bold tabular-nums"
|
|
11
|
+
}, U = {
|
|
12
|
+
key: 0,
|
|
13
|
+
class: "text-muted-foreground text-xs mt-0.5 truncate"
|
|
14
|
+
}, Y = { class: "flex-1 min-h-0 overflow-y-auto" }, G = {
|
|
15
|
+
key: 1,
|
|
16
|
+
class: "space-y-2 pt-1"
|
|
17
|
+
}, W = /* @__PURE__ */ q({
|
|
18
|
+
__name: "CartVariant1",
|
|
19
|
+
props: {
|
|
20
|
+
data: {},
|
|
21
|
+
actions: {},
|
|
22
|
+
features: {},
|
|
23
|
+
labels: {},
|
|
24
|
+
compact: { type: Boolean, default: !1 },
|
|
25
|
+
variant: { default: "Variant1" },
|
|
26
|
+
containerClass: {}
|
|
27
|
+
},
|
|
28
|
+
emits: ["update:quantity", "remove", "clear", "apply-coupon", "remove-coupon", "coupon-change", "continue", "continue-shopping"],
|
|
29
|
+
setup(e, { emit: S }) {
|
|
30
|
+
const p = e, i = S, l = s(() => p.data), m = s(() => p.labels || {}), n = s(() => p.actions || {}), b = s(() => p.features || {}), r = s(() => l.value.empty || !l.value.items || l.value.items.length === 0), $ = s(
|
|
31
|
+
() => l.value.totals.itemCount ?? l.value.items?.reduce((k, t) => k + (t.quantity || 0), 0) ?? 0
|
|
32
|
+
), z = s(
|
|
33
|
+
() => n.value.showContinue && b.value.continue && !n.value.continueDisabled && !r.value
|
|
34
|
+
);
|
|
35
|
+
return (k, t) => (a(), u("div", {
|
|
36
|
+
class: d(["v-cart v-cart-v1 flex flex-col bg-background text-foreground border border-border rounded-lg overflow-hidden h-full", [e.containerClass]]),
|
|
37
|
+
style: B({
|
|
38
|
+
"--cart-cell-px": e.compact ? "0.875rem" : "1.25rem",
|
|
39
|
+
"--cart-cell-py": e.compact ? "0.75rem" : "1rem"
|
|
40
|
+
})
|
|
41
|
+
}, [
|
|
42
|
+
l.value.title || l.value.subtitle ? (a(), u("div", {
|
|
43
|
+
key: 0,
|
|
44
|
+
class: d(["flex items-center justify-between gap-3 border-b border-border shrink-0", e.compact ? "px-4 py-2.5" : "px-5 py-3.5"])
|
|
45
|
+
}, [
|
|
46
|
+
y("div", A, [
|
|
47
|
+
y("div", F, [
|
|
48
|
+
h(N, {
|
|
49
|
+
icon: "lucide:shopping-bag",
|
|
50
|
+
class: d(e.compact ? "w-4 h-4" : "w-5 h-5")
|
|
51
|
+
}, null, 8, ["class"]),
|
|
52
|
+
y("h2", {
|
|
53
|
+
class: d(["font-bold text-foreground leading-tight truncate", e.compact ? "text-sm" : "text-base"])
|
|
54
|
+
}, v(l.value.title || m.value.cart || "Your Cart"), 3),
|
|
55
|
+
r.value ? c("", !0) : (a(), u("span", T, v($.value), 1))
|
|
56
|
+
]),
|
|
57
|
+
l.value.subtitle && !e.compact ? (a(), u("p", U, v(l.value.subtitle), 1)) : c("", !0)
|
|
58
|
+
]),
|
|
59
|
+
e.features.clearable && !r.value && !e.data.readonly ? (a(), f(x, {
|
|
60
|
+
key: 0,
|
|
61
|
+
variant: "ghost",
|
|
62
|
+
size: e.compact ? "xs" : "sm",
|
|
63
|
+
icon: "lucide:trash-2",
|
|
64
|
+
text: m.value.clearCart,
|
|
65
|
+
"as-icon": !m.value.clearCart,
|
|
66
|
+
onClick: t[0] || (t[0] = (o) => i("clear"))
|
|
67
|
+
}, null, 8, ["size", "text", "as-icon"])) : c("", !0)
|
|
68
|
+
], 2)) : c("", !0),
|
|
69
|
+
y("div", Y, [
|
|
70
|
+
r.value ? (a(), f(R, {
|
|
71
|
+
key: 0,
|
|
72
|
+
labels: e.labels,
|
|
73
|
+
compact: e.compact,
|
|
74
|
+
onContinueShopping: t[1] || (t[1] = (o) => i("continue-shopping"))
|
|
75
|
+
}, null, 8, ["labels", "compact"])) : (a(), u("ul", {
|
|
76
|
+
key: 1,
|
|
77
|
+
class: d(["divide-y divide-border", e.compact ? "px-4" : "px-5"])
|
|
78
|
+
}, [
|
|
79
|
+
(a(!0), u(D, null, L(e.data.items, (o) => (a(), u("li", {
|
|
80
|
+
key: o.id
|
|
81
|
+
}, [
|
|
82
|
+
h(E, {
|
|
83
|
+
item: o,
|
|
84
|
+
features: e.features,
|
|
85
|
+
labels: e.labels,
|
|
86
|
+
compact: e.compact,
|
|
87
|
+
readonly: e.data.readonly,
|
|
88
|
+
layout: "drawer",
|
|
89
|
+
"onUpdate:quantity": t[2] || (t[2] = (g, V) => i("update:quantity", g, V)),
|
|
90
|
+
onRemove: t[3] || (t[3] = (g) => i("remove", g))
|
|
91
|
+
}, null, 8, ["item", "features", "labels", "compact", "readonly"])
|
|
92
|
+
]))), 128))
|
|
93
|
+
], 2))
|
|
94
|
+
]),
|
|
95
|
+
r.value ? c("", !0) : (a(), u("div", {
|
|
96
|
+
key: 1,
|
|
97
|
+
class: d(["border-t border-border bg-card-light/40 shrink-0 space-y-3", e.compact ? "p-4" : "p-5"])
|
|
98
|
+
}, [
|
|
99
|
+
e.features.coupon ? (a(), f(j, {
|
|
100
|
+
key: 0,
|
|
101
|
+
coupon: e.data.coupon,
|
|
102
|
+
labels: e.labels,
|
|
103
|
+
compact: e.compact,
|
|
104
|
+
readonly: e.data.readonly,
|
|
105
|
+
onApply: t[4] || (t[4] = (o) => i("apply-coupon", o)),
|
|
106
|
+
onRemove: t[5] || (t[5] = (o) => i("remove-coupon")),
|
|
107
|
+
onChange: t[6] || (t[6] = (o) => i("coupon-change", o))
|
|
108
|
+
}, null, 8, ["coupon", "labels", "compact", "readonly"])) : c("", !0),
|
|
109
|
+
h(I, {
|
|
110
|
+
totals: e.data.totals,
|
|
111
|
+
features: e.features,
|
|
112
|
+
labels: e.labels,
|
|
113
|
+
compact: e.compact,
|
|
114
|
+
coupon: e.data.coupon,
|
|
115
|
+
variant: "Variant1"
|
|
116
|
+
}, null, 8, ["totals", "features", "labels", "compact", "coupon"]),
|
|
117
|
+
z.value && n.value.continueLabel || n.value.showContinueShopping && b.value.continueShopping ? (a(), u("div", G, [
|
|
118
|
+
n.value.showContinue && b.value.continue ? (a(), f(x, {
|
|
119
|
+
key: 0,
|
|
120
|
+
variant: "primary",
|
|
121
|
+
size: e.compact ? "md" : "lg",
|
|
122
|
+
block: !0,
|
|
123
|
+
icon: n.value.continueIcon || "lucide:arrow-right",
|
|
124
|
+
"icon-right": (n.value.continueIcon, void 0),
|
|
125
|
+
disabled: n.value.continueDisabled || r.value,
|
|
126
|
+
class: "w-full",
|
|
127
|
+
onClick: t[7] || (t[7] = (o) => i("continue"))
|
|
128
|
+
}, {
|
|
129
|
+
default: C(() => [
|
|
130
|
+
w(v(n.value.continueLabel || m.value.continue || "Continue to checkout"), 1)
|
|
131
|
+
]),
|
|
132
|
+
_: 1
|
|
133
|
+
}, 8, ["size", "icon", "icon-right", "disabled"])) : c("", !0),
|
|
134
|
+
n.value.showContinueShopping && b.value.continueShopping ? (a(), f(x, {
|
|
135
|
+
key: 1,
|
|
136
|
+
variant: "ghost",
|
|
137
|
+
size: e.compact ? "sm" : "md",
|
|
138
|
+
block: !0,
|
|
139
|
+
icon: n.value.continueShoppingIcon || "lucide:arrow-left",
|
|
140
|
+
disabled: n.value.continueShoppingDisabled,
|
|
141
|
+
class: "w-full",
|
|
142
|
+
onClick: t[8] || (t[8] = (o) => i("continue-shopping"))
|
|
143
|
+
}, {
|
|
144
|
+
default: C(() => [
|
|
145
|
+
w(v(n.value.continueShoppingLabel || m.value.continueShopping || "Continue shopping"), 1)
|
|
146
|
+
]),
|
|
147
|
+
_: 1
|
|
148
|
+
}, 8, ["size", "icon", "disabled"])) : c("", !0)
|
|
149
|
+
])) : c("", !0)
|
|
150
|
+
], 2))
|
|
151
|
+
], 6));
|
|
152
|
+
}
|
|
153
|
+
});
|
|
154
|
+
export {
|
|
155
|
+
W as default
|
|
156
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { CartData, CartActions, CartFeatures, CartLabels, CartVariant } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Variant 2 — POS / Register Cart
|
|
4
|
+
*
|
|
5
|
+
* - Dense, register-friendly layout
|
|
6
|
+
* - No thumbnails (faster scanning at the till)
|
|
7
|
+
* - Receipt-style dashed dividers
|
|
8
|
+
* - Inline coupon + summary, two compact side-by-side actions
|
|
9
|
+
* - Best for: in-store POS, kitchen tickets, fast-checkout flows
|
|
10
|
+
*/
|
|
11
|
+
type __VLS_Props = {
|
|
12
|
+
data: CartData;
|
|
13
|
+
actions: CartActions;
|
|
14
|
+
features: CartFeatures;
|
|
15
|
+
labels: CartLabels;
|
|
16
|
+
compact?: boolean;
|
|
17
|
+
variant?: CartVariant;
|
|
18
|
+
containerClass?: string | any[] | Record<string, boolean>;
|
|
19
|
+
};
|
|
20
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
21
|
+
clear: () => any;
|
|
22
|
+
remove: (itemId: string | number) => any;
|
|
23
|
+
continue: () => any;
|
|
24
|
+
"update:quantity": (itemId: string | number, quantity: number) => any;
|
|
25
|
+
"continue-shopping": () => any;
|
|
26
|
+
"apply-coupon": (code: string) => any;
|
|
27
|
+
"remove-coupon": () => any;
|
|
28
|
+
"coupon-change": (code: string) => any;
|
|
29
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
30
|
+
onClear?: () => any;
|
|
31
|
+
onRemove?: (itemId: string | number) => any;
|
|
32
|
+
onContinue?: () => any;
|
|
33
|
+
"onUpdate:quantity"?: (itemId: string | number, quantity: number) => any;
|
|
34
|
+
"onContinue-shopping"?: () => any;
|
|
35
|
+
"onApply-coupon"?: (code: string) => any;
|
|
36
|
+
"onRemove-coupon"?: () => any;
|
|
37
|
+
"onCoupon-change"?: (code: string) => any;
|
|
38
|
+
}>, {
|
|
39
|
+
variant: CartVariant;
|
|
40
|
+
compact: boolean;
|
|
41
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
42
|
+
export default _default;
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import { defineComponent as z, computed as r, openBlock as a, createElementBlock as s, normalizeClass as o, createElementVNode as n, createBlock as p, createCommentVNode as d, toDisplayString as v, Fragment as L, renderList as N, createVNode as k, withCtx as C, createTextVNode as w } from "vue";
|
|
2
|
+
import q from "../Icon.vue.js";
|
|
3
|
+
import S from "../Button.vue.js";
|
|
4
|
+
import B from "./CartLineItem.vue.js";
|
|
5
|
+
import A from "./CartSummary.vue.js";
|
|
6
|
+
import D from "./CartCouponInput.vue.js";
|
|
7
|
+
import E from "./CartEmptyState.vue.js";
|
|
8
|
+
const I = { class: "flex items-center justify-center gap-1.5" }, R = { class: "flex-1 min-h-0 overflow-y-auto" }, j = { class: "divide-y divide-dashed divide-border" }, F = {
|
|
9
|
+
key: 0,
|
|
10
|
+
class: "shrink-0"
|
|
11
|
+
}, T = {
|
|
12
|
+
key: 1,
|
|
13
|
+
class: "grid grid-cols-2 gap-2"
|
|
14
|
+
}, P = /* @__PURE__ */ z({
|
|
15
|
+
__name: "CartVariant2",
|
|
16
|
+
props: {
|
|
17
|
+
data: {},
|
|
18
|
+
actions: {},
|
|
19
|
+
features: {},
|
|
20
|
+
labels: {},
|
|
21
|
+
compact: { type: Boolean, default: !1 },
|
|
22
|
+
variant: { default: "Variant2" },
|
|
23
|
+
containerClass: {}
|
|
24
|
+
},
|
|
25
|
+
emits: ["update:quantity", "remove", "clear", "apply-coupon", "remove-coupon", "coupon-change", "continue", "continue-shopping"],
|
|
26
|
+
setup(e, { emit: $ }) {
|
|
27
|
+
const b = e, u = $, c = r(() => b.data), y = r(() => b.labels || {}), l = r(() => b.actions || {}), m = r(() => b.features || {}), f = r(() => c.value.empty || !c.value.items || c.value.items.length === 0), x = r(
|
|
28
|
+
() => c.value.totals.itemCount ?? c.value.items?.reduce((h, t) => h + (t.quantity || 0), 0) ?? 0
|
|
29
|
+
);
|
|
30
|
+
return (h, t) => (a(), s("div", {
|
|
31
|
+
class: o(["v-cart v-cart-v2 flex flex-col bg-background text-foreground border border-border max-w-md mx-auto overflow-hidden h-full", [e.containerClass, e.compact ? "rounded-sm" : "rounded-md"]])
|
|
32
|
+
}, [
|
|
33
|
+
n("div", {
|
|
34
|
+
class: o(["text-center border-b border-dashed border-border shrink-0", e.compact ? "p-3" : "p-4"])
|
|
35
|
+
}, [
|
|
36
|
+
n("div", I, [
|
|
37
|
+
c.value.brandLogo ? (a(), p(q, {
|
|
38
|
+
key: 0,
|
|
39
|
+
icon: c.value.brandLogo,
|
|
40
|
+
class: o(e.compact ? "w-5 h-5" : "w-6 h-6")
|
|
41
|
+
}, null, 8, ["icon", "class"])) : d("", !0),
|
|
42
|
+
n("p", {
|
|
43
|
+
class: o(["font-bold text-foreground tracking-wide", e.compact ? "text-sm" : "text-base"])
|
|
44
|
+
}, v(c.value.brandName || c.value.title || y.value.cart || "Cart"), 3)
|
|
45
|
+
]),
|
|
46
|
+
f.value ? d("", !0) : (a(), s("p", {
|
|
47
|
+
key: 0,
|
|
48
|
+
class: o(["text-muted-foreground tabular-nums font-semibold uppercase tracking-wider", e.compact ? "text-[10px] mt-0.5" : "text-xs mt-1"])
|
|
49
|
+
}, v(x.value) + " " + v(x.value === 1 ? "item" : "items"), 3))
|
|
50
|
+
], 2),
|
|
51
|
+
n("div", R, [
|
|
52
|
+
f.value ? (a(), p(E, {
|
|
53
|
+
key: 0,
|
|
54
|
+
labels: e.labels,
|
|
55
|
+
compact: e.compact,
|
|
56
|
+
onContinueShopping: t[0] || (t[0] = (i) => u("continue-shopping"))
|
|
57
|
+
}, null, 8, ["labels", "compact"])) : (a(), s("div", {
|
|
58
|
+
key: 1,
|
|
59
|
+
class: o(e.compact ? "px-3 py-2" : "px-4 py-3")
|
|
60
|
+
}, [
|
|
61
|
+
n("div", {
|
|
62
|
+
class: o(["flex items-center text-muted-foreground font-semibold uppercase tracking-wider pb-1 border-b border-dashed border-border", e.compact ? "text-[9px] gap-1" : "text-[10px] gap-2"])
|
|
63
|
+
}, [...t[8] || (t[8] = [
|
|
64
|
+
n("span", { class: "flex-1" }, "Item", -1),
|
|
65
|
+
n("span", { class: "w-20 text-right" }, "Amount", -1)
|
|
66
|
+
])], 2),
|
|
67
|
+
n("ul", j, [
|
|
68
|
+
(a(!0), s(L, null, N(e.data.items, (i) => (a(), s("li", {
|
|
69
|
+
key: i.id
|
|
70
|
+
}, [
|
|
71
|
+
k(B, {
|
|
72
|
+
item: i,
|
|
73
|
+
features: e.features,
|
|
74
|
+
labels: e.labels,
|
|
75
|
+
compact: e.compact,
|
|
76
|
+
readonly: e.data.readonly,
|
|
77
|
+
layout: "compact",
|
|
78
|
+
"onUpdate:quantity": t[1] || (t[1] = (g, V) => u("update:quantity", g, V)),
|
|
79
|
+
onRemove: t[2] || (t[2] = (g) => u("remove", g))
|
|
80
|
+
}, null, 8, ["item", "features", "labels", "compact", "readonly"])
|
|
81
|
+
]))), 128))
|
|
82
|
+
])
|
|
83
|
+
], 2))
|
|
84
|
+
]),
|
|
85
|
+
f.value ? d("", !0) : (a(), s("div", F, [
|
|
86
|
+
n("div", {
|
|
87
|
+
class: o(["border-t border-dashed border-border", e.compact ? "mx-3" : "mx-4"])
|
|
88
|
+
}, null, 2),
|
|
89
|
+
n("div", {
|
|
90
|
+
class: o(e.compact ? "px-3 py-2" : "px-4 py-3")
|
|
91
|
+
}, [
|
|
92
|
+
k(A, {
|
|
93
|
+
totals: e.data.totals,
|
|
94
|
+
features: e.features,
|
|
95
|
+
labels: e.labels,
|
|
96
|
+
compact: e.compact,
|
|
97
|
+
coupon: e.data.coupon,
|
|
98
|
+
variant: "Variant2"
|
|
99
|
+
}, null, 8, ["totals", "features", "labels", "compact", "coupon"])
|
|
100
|
+
], 2),
|
|
101
|
+
n("div", {
|
|
102
|
+
class: o(["border-t border-dashed border-border", e.compact ? "mx-3" : "mx-4"])
|
|
103
|
+
}, null, 2),
|
|
104
|
+
n("div", {
|
|
105
|
+
class: o(e.compact ? "px-3 py-2.5 space-y-2.5" : "px-4 py-3 space-y-3")
|
|
106
|
+
}, [
|
|
107
|
+
e.features.coupon ? (a(), p(D, {
|
|
108
|
+
key: 0,
|
|
109
|
+
coupon: e.data.coupon,
|
|
110
|
+
labels: e.labels,
|
|
111
|
+
compact: e.compact,
|
|
112
|
+
readonly: e.data.readonly,
|
|
113
|
+
onApply: t[3] || (t[3] = (i) => u("apply-coupon", i)),
|
|
114
|
+
onRemove: t[4] || (t[4] = (i) => u("remove-coupon")),
|
|
115
|
+
onChange: t[5] || (t[5] = (i) => u("coupon-change", i))
|
|
116
|
+
}, null, 8, ["coupon", "labels", "compact", "readonly"])) : d("", !0),
|
|
117
|
+
l.value.showContinue && m.value.continue || l.value.showContinueShopping && m.value.continueShopping ? (a(), s("div", T, [
|
|
118
|
+
l.value.showContinueShopping && m.value.continueShopping ? (a(), p(S, {
|
|
119
|
+
key: 0,
|
|
120
|
+
variant: "outline",
|
|
121
|
+
size: e.compact ? "sm" : "md",
|
|
122
|
+
icon: l.value.continueShoppingIcon || "lucide:plus",
|
|
123
|
+
disabled: l.value.continueShoppingDisabled,
|
|
124
|
+
onClick: t[6] || (t[6] = (i) => u("continue-shopping"))
|
|
125
|
+
}, {
|
|
126
|
+
default: C(() => [
|
|
127
|
+
w(v(l.value.continueShoppingLabel || y.value.continueShopping || "Add more"), 1)
|
|
128
|
+
]),
|
|
129
|
+
_: 1
|
|
130
|
+
}, 8, ["size", "icon", "disabled"])) : d("", !0),
|
|
131
|
+
l.value.showContinue && m.value.continue ? (a(), p(S, {
|
|
132
|
+
key: 1,
|
|
133
|
+
variant: "primary",
|
|
134
|
+
size: e.compact ? "sm" : "md",
|
|
135
|
+
icon: l.value.continueIcon || "lucide:credit-card",
|
|
136
|
+
"icon-right": void 0,
|
|
137
|
+
disabled: l.value.continueDisabled || f.value,
|
|
138
|
+
class: o(l.value.showContinueShopping && m.value.continueShopping ? "" : "col-span-2"),
|
|
139
|
+
onClick: t[7] || (t[7] = (i) => u("continue"))
|
|
140
|
+
}, {
|
|
141
|
+
default: C(() => [
|
|
142
|
+
w(v(l.value.continueLabel || y.value.continue || "Checkout"), 1)
|
|
143
|
+
]),
|
|
144
|
+
_: 1
|
|
145
|
+
}, 8, ["size", "icon", "disabled", "class"])) : d("", !0)
|
|
146
|
+
])) : d("", !0)
|
|
147
|
+
], 2)
|
|
148
|
+
]))
|
|
149
|
+
], 2));
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
export {
|
|
153
|
+
P as default
|
|
154
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { CartData, CartActions, CartFeatures, CartLabels, CartVariant } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Variant 3 — Full Page Cart
|
|
4
|
+
*
|
|
5
|
+
* - Header (title + item count + clear)
|
|
6
|
+
* - Two-column body on lg+: items list (left) + sticky summary card (right)
|
|
7
|
+
* - Stacks on mobile
|
|
8
|
+
* - Best for: /cart route, e-commerce site, mobile-first responsive checkout
|
|
9
|
+
*/
|
|
10
|
+
type __VLS_Props = {
|
|
11
|
+
data: CartData;
|
|
12
|
+
actions: CartActions;
|
|
13
|
+
features: CartFeatures;
|
|
14
|
+
labels: CartLabels;
|
|
15
|
+
compact?: boolean;
|
|
16
|
+
variant?: CartVariant;
|
|
17
|
+
containerClass?: string | any[] | Record<string, boolean>;
|
|
18
|
+
};
|
|
19
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
20
|
+
clear: () => any;
|
|
21
|
+
remove: (itemId: string | number) => any;
|
|
22
|
+
continue: () => any;
|
|
23
|
+
"update:quantity": (itemId: string | number, quantity: number) => any;
|
|
24
|
+
"continue-shopping": () => any;
|
|
25
|
+
"apply-coupon": (code: string) => any;
|
|
26
|
+
"remove-coupon": () => any;
|
|
27
|
+
"coupon-change": (code: string) => any;
|
|
28
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
29
|
+
onClear?: () => any;
|
|
30
|
+
onRemove?: (itemId: string | number) => any;
|
|
31
|
+
onContinue?: () => any;
|
|
32
|
+
"onUpdate:quantity"?: (itemId: string | number, quantity: number) => any;
|
|
33
|
+
"onContinue-shopping"?: () => any;
|
|
34
|
+
"onApply-coupon"?: (code: string) => any;
|
|
35
|
+
"onRemove-coupon"?: () => any;
|
|
36
|
+
"onCoupon-change"?: (code: string) => any;
|
|
37
|
+
}>, {
|
|
38
|
+
variant: CartVariant;
|
|
39
|
+
compact: boolean;
|
|
40
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
41
|
+
export default _default;
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
import { defineComponent as B, computed as v, openBlock as a, createElementBlock as i, normalizeClass as o, createElementVNode as n, toDisplayString as d, createCommentVNode as s, createBlock as g, withCtx as y, createTextVNode as k, Fragment as $, renderList as V, createVNode as h } from "vue";
|
|
2
|
+
import N from "../Icon.vue.js";
|
|
3
|
+
import C from "../Button.vue.js";
|
|
4
|
+
import D from "./CartLineItem.vue.js";
|
|
5
|
+
import E from "./CartSummary.vue.js";
|
|
6
|
+
import L from "./CartCouponInput.vue.js";
|
|
7
|
+
import I from "./CartEmptyState.vue.js";
|
|
8
|
+
const P = {
|
|
9
|
+
key: 1,
|
|
10
|
+
class: "rounded-lg border border-border overflow-hidden"
|
|
11
|
+
}, R = { class: "divide-y divide-border" }, T = {
|
|
12
|
+
key: 0,
|
|
13
|
+
class: "space-y-2 mt-4"
|
|
14
|
+
}, j = { class: "font-medium text-foreground" }, J = /* @__PURE__ */ B({
|
|
15
|
+
__name: "CartVariant3",
|
|
16
|
+
props: {
|
|
17
|
+
data: {},
|
|
18
|
+
actions: {},
|
|
19
|
+
features: {},
|
|
20
|
+
labels: {},
|
|
21
|
+
compact: { type: Boolean, default: !1 },
|
|
22
|
+
variant: { default: "Variant3" },
|
|
23
|
+
containerClass: {}
|
|
24
|
+
},
|
|
25
|
+
emits: ["update:quantity", "remove", "clear", "apply-coupon", "remove-coupon", "coupon-change", "continue", "continue-shopping"],
|
|
26
|
+
setup(e, { emit: z }) {
|
|
27
|
+
const b = e, u = z, r = v(() => b.data), x = v(() => b.labels || {}), c = v(() => b.actions || {}), p = v(() => b.features || {}), m = v(() => r.value.empty || !r.value.items || r.value.items.length === 0), w = v(
|
|
28
|
+
() => r.value.totals.itemCount ?? r.value.items?.reduce((S, t) => S + (t.quantity || 0), 0) ?? 0
|
|
29
|
+
);
|
|
30
|
+
return (S, t) => (a(), i("div", {
|
|
31
|
+
class: o(["v-cart v-cart-v3 w-full bg-background text-foreground", e.containerClass])
|
|
32
|
+
}, [
|
|
33
|
+
n("div", {
|
|
34
|
+
class: o(["flex flex-col sm:flex-row sm:items-end sm:justify-between gap-3 border-b border-border", e.compact ? "pb-3 mb-4" : "pb-4 mb-6"])
|
|
35
|
+
}, [
|
|
36
|
+
n("div", null, [
|
|
37
|
+
n("h1", {
|
|
38
|
+
class: o(["font-extrabold tracking-tight text-foreground", e.compact ? "text-xl" : "text-3xl"])
|
|
39
|
+
}, d(r.value.title || x.value.cart || "Shopping Cart"), 3),
|
|
40
|
+
m.value ? s("", !0) : (a(), i("p", {
|
|
41
|
+
key: 0,
|
|
42
|
+
class: o(["text-muted-foreground mt-0.5", e.compact ? "text-xs" : "text-sm"])
|
|
43
|
+
}, d(w.value) + " " + d(w.value === 1 ? "item" : "items") + " in your cart ", 3))
|
|
44
|
+
]),
|
|
45
|
+
e.features.clearable && !m.value && !e.data.readonly ? (a(), g(C, {
|
|
46
|
+
key: 0,
|
|
47
|
+
variant: "ghost",
|
|
48
|
+
size: "sm",
|
|
49
|
+
icon: "lucide:trash-2",
|
|
50
|
+
class: "self-start",
|
|
51
|
+
onClick: t[0] || (t[0] = (l) => u("clear"))
|
|
52
|
+
}, {
|
|
53
|
+
default: y(() => [
|
|
54
|
+
k(d(x.value.clearCart || "Clear cart"), 1)
|
|
55
|
+
]),
|
|
56
|
+
_: 1
|
|
57
|
+
})) : s("", !0)
|
|
58
|
+
], 2),
|
|
59
|
+
n("div", {
|
|
60
|
+
class: o(["grid gap-6", [
|
|
61
|
+
m.value ? "grid-cols-1" : "grid-cols-1 lg:grid-cols-[1fr_360px] xl:grid-cols-[1fr_400px]",
|
|
62
|
+
e.compact ? "gap-4" : "gap-6"
|
|
63
|
+
]])
|
|
64
|
+
}, [
|
|
65
|
+
n("div", null, [
|
|
66
|
+
m.value ? (a(), g(I, {
|
|
67
|
+
key: 0,
|
|
68
|
+
labels: e.labels,
|
|
69
|
+
compact: e.compact,
|
|
70
|
+
onContinueShopping: t[1] || (t[1] = (l) => u("continue-shopping"))
|
|
71
|
+
}, null, 8, ["labels", "compact"])) : (a(), i("div", P, [
|
|
72
|
+
n("div", {
|
|
73
|
+
class: o(["bg-muted/40 border-b border-border text-muted-foreground uppercase tracking-wider font-bold flex items-center", [e.compact ? "px-3 py-2 text-[10px]" : "px-4 py-2.5 text-xs"]])
|
|
74
|
+
}, [
|
|
75
|
+
t[9] || (t[9] = n("span", { class: "flex-1" }, "Product", -1)),
|
|
76
|
+
n("span", {
|
|
77
|
+
class: o(e.compact ? "w-14 text-right" : "w-20 text-right")
|
|
78
|
+
}, "Qty", 2),
|
|
79
|
+
n("span", {
|
|
80
|
+
class: o(e.compact ? "w-20 text-right" : "w-28 text-right")
|
|
81
|
+
}, "Total", 2)
|
|
82
|
+
], 2),
|
|
83
|
+
n("ul", R, [
|
|
84
|
+
(a(!0), i($, null, V(e.data.items, (l) => (a(), i("li", {
|
|
85
|
+
key: l.id
|
|
86
|
+
}, [
|
|
87
|
+
h(D, {
|
|
88
|
+
item: l,
|
|
89
|
+
features: e.features,
|
|
90
|
+
labels: e.labels,
|
|
91
|
+
compact: e.compact,
|
|
92
|
+
readonly: e.data.readonly,
|
|
93
|
+
layout: "card",
|
|
94
|
+
"onUpdate:quantity": t[2] || (t[2] = (f, q) => u("update:quantity", f, q)),
|
|
95
|
+
onRemove: t[3] || (t[3] = (f) => u("remove", f))
|
|
96
|
+
}, null, 8, ["item", "features", "labels", "compact", "readonly"])
|
|
97
|
+
]))), 128))
|
|
98
|
+
])
|
|
99
|
+
]))
|
|
100
|
+
]),
|
|
101
|
+
m.value ? s("", !0) : (a(), i("aside", {
|
|
102
|
+
key: 0,
|
|
103
|
+
class: o(["lg:sticky lg:top-4 self-start", e.compact ? "space-y-3" : "space-y-4"])
|
|
104
|
+
}, [
|
|
105
|
+
n("div", {
|
|
106
|
+
class: o(["rounded-lg border border-border overflow-hidden", e.compact ? "p-4" : "p-5"])
|
|
107
|
+
}, [
|
|
108
|
+
n("h3", {
|
|
109
|
+
class: o(["font-bold text-foreground uppercase tracking-widest text-muted-foreground", e.compact ? "text-[10px] mb-2" : "text-xs mb-3"])
|
|
110
|
+
}, " Order Summary ", 2),
|
|
111
|
+
n("div", {
|
|
112
|
+
class: o(e.compact ? "space-y-3" : "space-y-4")
|
|
113
|
+
}, [
|
|
114
|
+
e.features.coupon ? (a(), g(L, {
|
|
115
|
+
key: 0,
|
|
116
|
+
coupon: e.data.coupon,
|
|
117
|
+
labels: e.labels,
|
|
118
|
+
compact: e.compact,
|
|
119
|
+
readonly: e.data.readonly,
|
|
120
|
+
onApply: t[4] || (t[4] = (l) => u("apply-coupon", l)),
|
|
121
|
+
onRemove: t[5] || (t[5] = (l) => u("remove-coupon")),
|
|
122
|
+
onChange: t[6] || (t[6] = (l) => u("coupon-change", l))
|
|
123
|
+
}, null, 8, ["coupon", "labels", "compact", "readonly"])) : s("", !0),
|
|
124
|
+
n("div", {
|
|
125
|
+
class: o(["border-t border-border", e.compact ? "pt-2" : "pt-3"])
|
|
126
|
+
}, [
|
|
127
|
+
h(E, {
|
|
128
|
+
totals: e.data.totals,
|
|
129
|
+
features: e.features,
|
|
130
|
+
labels: e.labels,
|
|
131
|
+
compact: e.compact,
|
|
132
|
+
coupon: e.data.coupon,
|
|
133
|
+
variant: "Variant3"
|
|
134
|
+
}, null, 8, ["totals", "features", "labels", "compact", "coupon"])
|
|
135
|
+
], 2)
|
|
136
|
+
], 2),
|
|
137
|
+
c.value.showContinue && p.value.continue || c.value.showContinueShopping && p.value.continueShopping ? (a(), i("div", T, [
|
|
138
|
+
c.value.showContinue && p.value.continue ? (a(), g(C, {
|
|
139
|
+
key: 0,
|
|
140
|
+
variant: "primary",
|
|
141
|
+
size: e.compact ? "md" : "lg",
|
|
142
|
+
block: !0,
|
|
143
|
+
icon: c.value.continueIcon || "lucide:lock",
|
|
144
|
+
disabled: c.value.continueDisabled || m.value,
|
|
145
|
+
class: "w-full",
|
|
146
|
+
onClick: t[7] || (t[7] = (l) => u("continue"))
|
|
147
|
+
}, {
|
|
148
|
+
default: y(() => [
|
|
149
|
+
k(d(c.value.continueLabel || x.value.continue || "Proceed to checkout"), 1)
|
|
150
|
+
]),
|
|
151
|
+
_: 1
|
|
152
|
+
}, 8, ["size", "icon", "disabled"])) : s("", !0),
|
|
153
|
+
c.value.showContinueShopping && p.value.continueShopping ? (a(), g(C, {
|
|
154
|
+
key: 1,
|
|
155
|
+
variant: "ghost",
|
|
156
|
+
size: e.compact ? "sm" : "md",
|
|
157
|
+
block: !0,
|
|
158
|
+
icon: c.value.continueShoppingIcon || "lucide:arrow-left",
|
|
159
|
+
disabled: c.value.continueShoppingDisabled,
|
|
160
|
+
class: "w-full",
|
|
161
|
+
onClick: t[8] || (t[8] = (l) => u("continue-shopping"))
|
|
162
|
+
}, {
|
|
163
|
+
default: y(() => [
|
|
164
|
+
k(d(c.value.continueShoppingLabel || x.value.continueShopping || "Continue shopping"), 1)
|
|
165
|
+
]),
|
|
166
|
+
_: 1
|
|
167
|
+
}, 8, ["size", "icon", "disabled"])) : s("", !0)
|
|
168
|
+
])) : s("", !0)
|
|
169
|
+
], 2),
|
|
170
|
+
p.value.trustSignals && r.value.trustSignals?.length ? (a(), i("div", {
|
|
171
|
+
key: 0,
|
|
172
|
+
class: o(["rounded-lg border border-border bg-muted/30", e.compact ? "p-3 space-y-2" : "p-4 space-y-2.5"])
|
|
173
|
+
}, [
|
|
174
|
+
(a(!0), i($, null, V(r.value.trustSignals, (l, f) => (a(), i("div", {
|
|
175
|
+
key: f,
|
|
176
|
+
class: o(["flex items-center gap-2", e.compact ? "text-xs" : "text-sm"])
|
|
177
|
+
}, [
|
|
178
|
+
h(N, {
|
|
179
|
+
icon: l.icon,
|
|
180
|
+
class: "w-4 h-4 text-muted-foreground"
|
|
181
|
+
}, null, 8, ["icon"]),
|
|
182
|
+
n("span", j, d(l.text), 1)
|
|
183
|
+
], 2))), 128))
|
|
184
|
+
], 2)) : s("", !0)
|
|
185
|
+
], 2))
|
|
186
|
+
], 2)
|
|
187
|
+
], 2));
|
|
188
|
+
}
|
|
189
|
+
});
|
|
190
|
+
export {
|
|
191
|
+
J as default
|
|
192
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { CartData, CartActions, CartFeatures, CartLabels, CartVariant } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Variant 4 — Mini Cart / Summary
|
|
4
|
+
*
|
|
5
|
+
* - Compact, single-column "summary-first" layout
|
|
6
|
+
* - Tiny line items (no images, no qty stepper — name + qty + price)
|
|
7
|
+
* - Inline summary, single primary CTA
|
|
8
|
+
* - Best for: navbar dropdown, header mini-cart, side panel pre-checkout
|
|
9
|
+
*/
|
|
10
|
+
type __VLS_Props = {
|
|
11
|
+
data: CartData;
|
|
12
|
+
actions: CartActions;
|
|
13
|
+
features: CartFeatures;
|
|
14
|
+
labels: CartLabels;
|
|
15
|
+
compact?: boolean;
|
|
16
|
+
variant?: CartVariant;
|
|
17
|
+
containerClass?: string | any[] | Record<string, boolean>;
|
|
18
|
+
};
|
|
19
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
20
|
+
clear: () => any;
|
|
21
|
+
remove: (itemId: string | number) => any;
|
|
22
|
+
continue: () => any;
|
|
23
|
+
"update:quantity": (itemId: string | number, quantity: number) => any;
|
|
24
|
+
"continue-shopping": () => any;
|
|
25
|
+
"apply-coupon": (code: string) => any;
|
|
26
|
+
"remove-coupon": () => any;
|
|
27
|
+
"coupon-change": (code: string) => any;
|
|
28
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
29
|
+
onClear?: () => any;
|
|
30
|
+
onRemove?: (itemId: string | number) => any;
|
|
31
|
+
onContinue?: () => any;
|
|
32
|
+
"onUpdate:quantity"?: (itemId: string | number, quantity: number) => any;
|
|
33
|
+
"onContinue-shopping"?: () => any;
|
|
34
|
+
"onApply-coupon"?: (code: string) => any;
|
|
35
|
+
"onRemove-coupon"?: () => any;
|
|
36
|
+
"onCoupon-change"?: (code: string) => any;
|
|
37
|
+
}>, {
|
|
38
|
+
variant: CartVariant;
|
|
39
|
+
compact: boolean;
|
|
40
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
41
|
+
export default _default;
|