vlite3 1.4.22 → 1.4.23
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/Cart/Cart.vue.js +53 -49
- package/components/Cart/CartCouponInput.vue.d.ts +1 -0
- package/components/Cart/CartCouponInput.vue.js +36 -33
- package/components/Cart/CartLineItem.vue.d.ts +1 -0
- package/components/Cart/CartLineItem.vue.js +121 -113
- package/components/Cart/CartSummary.vue.d.ts +1 -0
- package/components/Cart/CartSummary.vue.js +59 -51
- package/components/Cart/CartVariant1.vue.js +66 -63
- package/components/Cart/CartVariant2.vue.js +50 -47
- package/components/Cart/CartVariant3.vue.js +61 -58
- package/components/Cart/CartVariant4.vue.js +72 -68
- package/components/CategoryManager/CategoryManager.vue2.js +1 -1
- package/components/ColorPicker/ColorIro.vue3.js +2 -2
- package/components/ColorPicker/ColorPicker.vue.js +2 -2
- package/components/CommandPalette/CommandPaletteContent.vue2.js +1 -1
- package/components/CommandPalette/{CommandPaletteItem.vue.js → CommandPaletteItem.vue2.js} +1 -1
- package/components/NavbarCommandPalette.vue.js +1 -1
- package/components/Price/Price.vue.js +2 -2
- package/components/Screen/ScreenFilter.vue.js +1 -1
- package/package.json +1 -1
- /package/components/ColorPicker/{ColorIro.vue2.js → ColorIro.vue.js} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent as S, computed as
|
|
2
|
-
import
|
|
1
|
+
import { defineComponent as S, computed as c, openBlock as n, createElementBlock as u, normalizeClass as a, createElementVNode as r, toDisplayString as i, createVNode as l, unref as d, createCommentVNode as m, createTextVNode as g, createBlock as T } from "vue";
|
|
2
|
+
import y from "../Icon.vue.js";
|
|
3
3
|
import f from "../Price/Price.vue.js";
|
|
4
4
|
const C = { class: "text-muted-foreground font-medium" }, $ = { class: "text-success font-medium inline-flex items-center gap-1.5 min-w-0" }, j = { class: "truncate" }, B = { class: "text-muted-foreground font-medium" }, E = { class: "text-foreground font-semibold tabular-nums" }, N = {
|
|
5
5
|
key: 0,
|
|
@@ -12,18 +12,19 @@ const C = { class: "text-muted-foreground font-medium" }, $ = { class: "text-suc
|
|
|
12
12
|
labels: {},
|
|
13
13
|
compact: { type: Boolean, default: !1 },
|
|
14
14
|
variant: { default: "Variant1" },
|
|
15
|
-
coupon: {}
|
|
15
|
+
coupon: {},
|
|
16
|
+
currency: {}
|
|
16
17
|
},
|
|
17
18
|
setup(t) {
|
|
18
|
-
const e = t, s =
|
|
19
|
-
|
|
20
|
-
const
|
|
21
|
-
return
|
|
19
|
+
const e = t, s = c(() => e.labels || {}), h = c(() => s.value.estimatedTax ? s.value.estimatedTax : e.totals.taxRate !== void 0 ? `Estimated Tax (${e.totals.taxRate}%)` : "Estimated Tax");
|
|
20
|
+
c(() => {
|
|
21
|
+
const o = e.totals.itemCount ?? 0;
|
|
22
|
+
return o === 0 ? s.value.itemCount || "Items" : `${s.value.itemCount || "Items"} (${o})`;
|
|
22
23
|
});
|
|
23
|
-
const
|
|
24
|
-
const
|
|
25
|
-
return
|
|
26
|
-
}),
|
|
24
|
+
const b = c(() => {
|
|
25
|
+
const o = e.coupon?.definition;
|
|
26
|
+
return o && o.type === "percentage" ? `−${o.value}%` : null;
|
|
27
|
+
}), p = c(() => e.coupon?.code ? `${s.value.discount || "Discount"} · ${e.coupon.code}` : s.value.discount || "Discount"), k = c(() => {
|
|
27
28
|
switch (e.variant) {
|
|
28
29
|
case "Variant2":
|
|
29
30
|
return e.compact ? "space-y-1.5 text-xs" : "space-y-2 text-sm";
|
|
@@ -34,7 +35,7 @@ const C = { class: "text-muted-foreground font-medium" }, $ = { class: "text-suc
|
|
|
34
35
|
default:
|
|
35
36
|
return e.compact ? "space-y-1.5" : "space-y-2.5";
|
|
36
37
|
}
|
|
37
|
-
}), x =
|
|
38
|
+
}), x = c(() => (e.variant === "Variant2", e.compact ? "text-xs" : "text-sm")), w = c(() => {
|
|
38
39
|
switch (e.variant) {
|
|
39
40
|
case "Variant2":
|
|
40
41
|
return ["border-t border-dashed border-border pt-2 mt-1.5", e.compact ? "text-sm" : "text-base", "font-extrabold text-foreground"];
|
|
@@ -49,105 +50,112 @@ const C = { class: "text-muted-foreground font-medium" }, $ = { class: "text-suc
|
|
|
49
50
|
"font-black text-foreground"
|
|
50
51
|
];
|
|
51
52
|
}
|
|
52
|
-
}), V =
|
|
53
|
+
}), V = c(
|
|
53
54
|
() => e.features.shipping && e.totals.freeShippingProgress && e.totals.freeShippingProgress.remaining > 0
|
|
54
55
|
);
|
|
55
|
-
return (
|
|
56
|
+
return (o, v) => (n(), u("div", {
|
|
56
57
|
class: a(["v-cart-summary", k.value])
|
|
57
58
|
}, [
|
|
58
|
-
t.features.subtotal ? (n(),
|
|
59
|
+
t.features.subtotal ? (n(), u("div", {
|
|
59
60
|
key: 0,
|
|
60
61
|
class: a(["flex items-center justify-between gap-3", x.value])
|
|
61
62
|
}, [
|
|
62
|
-
|
|
63
|
-
|
|
63
|
+
r("span", C, i(s.value.subtotal || "Subtotal"), 1),
|
|
64
|
+
l(d(f), {
|
|
64
65
|
value: t.totals.subtotal,
|
|
66
|
+
currency: t.currency || t.totals.currency,
|
|
65
67
|
class: "text-foreground font-semibold tabular-nums"
|
|
66
|
-
}, null, 8, ["value"])
|
|
68
|
+
}, null, 8, ["value", "currency"])
|
|
67
69
|
], 2)) : m("", !0),
|
|
68
|
-
t.features.discount && t.totals.discount && t.totals.discount > 0 ? (n(),
|
|
70
|
+
t.features.discount && t.totals.discount && t.totals.discount > 0 ? (n(), u("div", {
|
|
69
71
|
key: 1,
|
|
70
72
|
class: a(["flex items-center justify-between gap-3", x.value])
|
|
71
73
|
}, [
|
|
72
|
-
|
|
73
|
-
|
|
74
|
+
r("span", $, [
|
|
75
|
+
l(y, {
|
|
74
76
|
icon: "lucide:tag",
|
|
75
77
|
class: "w-3.5 h-3.5 shrink-0"
|
|
76
78
|
}),
|
|
77
|
-
|
|
78
|
-
|
|
79
|
+
r("span", j, i(p.value), 1),
|
|
80
|
+
b.value ? (n(), u("span", {
|
|
79
81
|
key: 0,
|
|
80
82
|
class: a(["inline-flex items-center px-1.5 py-0.5 rounded bg-success/10 text-success font-bold tabular-nums shrink-0", t.compact ? "text-[9px]" : "text-[10px]"])
|
|
81
|
-
},
|
|
83
|
+
}, i(b.value), 3)) : m("", !0)
|
|
82
84
|
]),
|
|
83
|
-
|
|
85
|
+
l(d(f), {
|
|
84
86
|
value: -t.totals.discount,
|
|
87
|
+
currency: t.currency || t.totals.currency,
|
|
85
88
|
class: "text-success font-semibold tabular-nums"
|
|
86
|
-
}, null, 8, ["value"])
|
|
89
|
+
}, null, 8, ["value", "currency"])
|
|
87
90
|
], 2)) : m("", !0),
|
|
88
|
-
V.value ? (n(),
|
|
91
|
+
V.value ? (n(), u("div", {
|
|
89
92
|
key: 2,
|
|
90
93
|
class: a(["flex items-center gap-1.5 text-muted-foreground", t.compact ? "text-[10px]" : "text-xs"])
|
|
91
94
|
}, [
|
|
92
|
-
|
|
95
|
+
l(y, {
|
|
93
96
|
icon: "lucide:truck",
|
|
94
97
|
class: a(t.compact ? "w-3 h-3" : "w-3.5 h-3.5")
|
|
95
98
|
}, null, 8, ["class"]),
|
|
96
|
-
|
|
99
|
+
r("span", null, [
|
|
97
100
|
v[0] || (v[0] = g(" Add ", -1)),
|
|
98
|
-
|
|
101
|
+
l(d(f), {
|
|
99
102
|
value: t.totals.freeShippingProgress.remaining,
|
|
103
|
+
currency: t.currency || t.totals.currency,
|
|
100
104
|
class: "font-semibold text-foreground"
|
|
101
|
-
}, null, 8, ["value"]),
|
|
105
|
+
}, null, 8, ["value", "currency"]),
|
|
102
106
|
v[1] || (v[1] = g(" more for free shipping ", -1))
|
|
103
107
|
])
|
|
104
108
|
], 2)) : m("", !0),
|
|
105
|
-
t.features.shipping && t.totals.shipping !== void 0 ? (n(),
|
|
109
|
+
t.features.shipping && t.totals.shipping !== void 0 ? (n(), u("div", {
|
|
106
110
|
key: 3,
|
|
107
111
|
class: a(["flex items-center justify-between gap-3", x.value])
|
|
108
112
|
}, [
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
t.totals.shipping === 0 ? (n(),
|
|
113
|
+
r("span", B, i(s.value.shipping || "Shipping"), 1),
|
|
114
|
+
r("span", E, [
|
|
115
|
+
t.totals.shipping === 0 ? (n(), u("span", N, "Free")) : (n(), T(d(f), {
|
|
112
116
|
key: 1,
|
|
113
|
-
value: t.totals.shipping
|
|
114
|
-
|
|
117
|
+
value: t.totals.shipping,
|
|
118
|
+
currency: t.currency || t.totals.currency
|
|
119
|
+
}, null, 8, ["value", "currency"]))
|
|
115
120
|
])
|
|
116
121
|
], 2)) : m("", !0),
|
|
117
|
-
t.features.estimatedTax && t.totals.estimatedTax !== void 0 ? (n(),
|
|
122
|
+
t.features.estimatedTax && t.totals.estimatedTax !== void 0 ? (n(), u("div", {
|
|
118
123
|
key: 4,
|
|
119
124
|
class: a(["flex items-center justify-between gap-3", x.value])
|
|
120
125
|
}, [
|
|
121
|
-
|
|
122
|
-
|
|
126
|
+
r("span", D, i(h.value), 1),
|
|
127
|
+
l(d(f), {
|
|
123
128
|
value: t.totals.estimatedTax,
|
|
129
|
+
currency: t.currency || t.totals.currency,
|
|
124
130
|
class: "text-foreground font-semibold tabular-nums"
|
|
125
|
-
}, null, 8, ["value"])
|
|
131
|
+
}, null, 8, ["value", "currency"])
|
|
126
132
|
], 2)) : m("", !0),
|
|
127
|
-
|
|
133
|
+
r("div", {
|
|
128
134
|
class: a(["flex items-center justify-between gap-3", w.value])
|
|
129
135
|
}, [
|
|
130
|
-
|
|
131
|
-
|
|
136
|
+
r("span", P, i(s.value.grandTotal || "Grand Total"), 1),
|
|
137
|
+
l(d(f), {
|
|
132
138
|
value: t.totals.grandTotal,
|
|
139
|
+
currency: t.currency || t.totals.currency,
|
|
133
140
|
class: a(["font-black text-foreground tabular-nums", e.compact ? "text-base" : "text-lg"])
|
|
134
|
-
}, null, 8, ["value", "class"])
|
|
141
|
+
}, null, 8, ["value", "currency", "class"])
|
|
135
142
|
], 2),
|
|
136
|
-
t.features.totalSavings && t.totals.totalSavings && t.totals.totalSavings > 0 ? (n(),
|
|
143
|
+
t.features.totalSavings && t.totals.totalSavings && t.totals.totalSavings > 0 ? (n(), u("div", {
|
|
137
144
|
key: 5,
|
|
138
145
|
class: a(["flex items-center justify-between gap-3 pt-1", t.compact ? "text-[10px]" : "text-xs"])
|
|
139
146
|
}, [
|
|
140
|
-
|
|
141
|
-
|
|
147
|
+
r("span", F, [
|
|
148
|
+
l(y, {
|
|
142
149
|
icon: "lucide:circle-dollar-sign",
|
|
143
150
|
class: a(t.compact ? "w-3 h-3" : "w-3.5 h-3.5")
|
|
144
151
|
}, null, 8, ["class"]),
|
|
145
|
-
g(" " +
|
|
152
|
+
g(" " + i(s.value.totalSavings || "Total Savings"), 1)
|
|
146
153
|
]),
|
|
147
|
-
|
|
154
|
+
l(d(f), {
|
|
148
155
|
value: t.totals.totalSavings,
|
|
156
|
+
currency: t.currency || t.totals.currency,
|
|
149
157
|
class: "text-success font-bold tabular-nums"
|
|
150
|
-
}, null, 8, ["value"])
|
|
158
|
+
}, null, 8, ["value", "currency"])
|
|
151
159
|
], 2)) : m("", !0)
|
|
152
160
|
], 2));
|
|
153
161
|
}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
const
|
|
1
|
+
import { defineComponent as B, computed as r, openBlock as a, createElementBlock as c, normalizeStyle as D, normalizeClass as d, createElementVNode as b, createVNode as x, toDisplayString as v, createCommentVNode as i, createBlock as f, Fragment as L, renderList as N, withCtx as w, createTextVNode as S } from "vue";
|
|
2
|
+
import E from "../Icon.vue.js";
|
|
3
|
+
import C from "../Button.vue.js";
|
|
4
|
+
import I from "./CartLineItem.vue.js";
|
|
5
|
+
import j from "./CartSummary.vue.js";
|
|
6
|
+
import R from "./CartCouponInput.vue.js";
|
|
7
|
+
import A from "./CartEmptyState.vue.js";
|
|
8
|
+
const F = { class: "min-w-0 flex-1" }, T = { class: "flex items-center gap-2" }, U = {
|
|
9
9
|
key: 0,
|
|
10
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
|
-
},
|
|
11
|
+
}, Y = {
|
|
12
12
|
key: 0,
|
|
13
13
|
class: "text-muted-foreground text-xs mt-0.5 truncate"
|
|
14
|
-
},
|
|
14
|
+
}, G = { class: "flex-1 min-h-0 overflow-y-auto" }, H = {
|
|
15
15
|
key: 1,
|
|
16
16
|
class: "space-y-2 pt-1"
|
|
17
|
-
},
|
|
17
|
+
}, X = /* @__PURE__ */ B({
|
|
18
18
|
__name: "CartVariant1",
|
|
19
19
|
props: {
|
|
20
20
|
data: {},
|
|
@@ -26,112 +26,115 @@ const A = { class: "min-w-0 flex-1" }, F = { class: "flex items-center gap-2" },
|
|
|
26
26
|
containerClass: {}
|
|
27
27
|
},
|
|
28
28
|
emits: ["update:quantity", "remove", "clear", "apply-coupon", "remove-coupon", "coupon-change", "continue", "continue-shopping"],
|
|
29
|
-
setup(e, { emit:
|
|
30
|
-
const p = e,
|
|
31
|
-
() =>
|
|
32
|
-
),
|
|
33
|
-
() => n.value.showContinue &&
|
|
29
|
+
setup(e, { emit: $ }) {
|
|
30
|
+
const p = e, u = $, o = r(() => p.data), m = r(() => p.labels || {}), n = r(() => p.actions || {}), y = r(() => p.features || {}), s = r(() => o.value.empty || !o.value.items || o.value.items.length === 0), z = r(
|
|
31
|
+
() => o.value.totals.itemCount ?? o.value.items?.reduce((k, t) => k + (t.quantity || 0), 0) ?? 0
|
|
32
|
+
), g = r(() => o.value.currency || o.value.totals.currency), V = r(
|
|
33
|
+
() => n.value.showContinue && y.value.continue && !n.value.continueDisabled && !s.value
|
|
34
34
|
);
|
|
35
|
-
return (k, t) => (a(),
|
|
35
|
+
return (k, t) => (a(), c("div", {
|
|
36
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:
|
|
37
|
+
style: D({
|
|
38
38
|
"--cart-cell-px": e.compact ? "0.875rem" : "1.25rem",
|
|
39
39
|
"--cart-cell-py": e.compact ? "0.75rem" : "1rem"
|
|
40
40
|
})
|
|
41
41
|
}, [
|
|
42
|
-
|
|
42
|
+
o.value.title || o.value.subtitle ? (a(), c("div", {
|
|
43
43
|
key: 0,
|
|
44
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
45
|
}, [
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
46
|
+
b("div", F, [
|
|
47
|
+
b("div", T, [
|
|
48
|
+
x(E, {
|
|
49
49
|
icon: "lucide:shopping-bag",
|
|
50
50
|
class: d(e.compact ? "w-4 h-4" : "w-5 h-5")
|
|
51
51
|
}, null, 8, ["class"]),
|
|
52
|
-
|
|
52
|
+
b("h2", {
|
|
53
53
|
class: d(["font-bold text-foreground leading-tight truncate", e.compact ? "text-sm" : "text-base"])
|
|
54
|
-
}, v(
|
|
55
|
-
|
|
54
|
+
}, v(o.value.title || m.value.cart || "Your Cart"), 3),
|
|
55
|
+
s.value ? i("", !0) : (a(), c("span", U, v(z.value), 1))
|
|
56
56
|
]),
|
|
57
|
-
|
|
57
|
+
o.value.subtitle && !e.compact ? (a(), c("p", Y, v(o.value.subtitle), 1)) : i("", !0)
|
|
58
58
|
]),
|
|
59
|
-
e.features.clearable && !
|
|
59
|
+
e.features.clearable && !s.value && !e.data.readonly ? (a(), f(C, {
|
|
60
60
|
key: 0,
|
|
61
61
|
variant: "ghost",
|
|
62
62
|
size: e.compact ? "xs" : "sm",
|
|
63
63
|
icon: "lucide:trash-2",
|
|
64
64
|
text: m.value.clearCart,
|
|
65
65
|
"as-icon": !m.value.clearCart,
|
|
66
|
-
onClick: t[0] || (t[0] = (
|
|
67
|
-
}, null, 8, ["size", "text", "as-icon"])) :
|
|
68
|
-
], 2)) :
|
|
69
|
-
|
|
70
|
-
|
|
66
|
+
onClick: t[0] || (t[0] = (l) => u("clear"))
|
|
67
|
+
}, null, 8, ["size", "text", "as-icon"])) : i("", !0)
|
|
68
|
+
], 2)) : i("", !0),
|
|
69
|
+
b("div", G, [
|
|
70
|
+
s.value ? (a(), f(A, {
|
|
71
71
|
key: 0,
|
|
72
72
|
labels: e.labels,
|
|
73
73
|
compact: e.compact,
|
|
74
|
-
onContinueShopping: t[1] || (t[1] = (
|
|
75
|
-
}, null, 8, ["labels", "compact"])) : (a(),
|
|
74
|
+
onContinueShopping: t[1] || (t[1] = (l) => u("continue-shopping"))
|
|
75
|
+
}, null, 8, ["labels", "compact"])) : (a(), c("ul", {
|
|
76
76
|
key: 1,
|
|
77
77
|
class: d(["divide-y divide-border", e.compact ? "px-4" : "px-5"])
|
|
78
78
|
}, [
|
|
79
|
-
(a(!0),
|
|
80
|
-
key:
|
|
79
|
+
(a(!0), c(L, null, N(e.data.items, (l) => (a(), c("li", {
|
|
80
|
+
key: l.id
|
|
81
81
|
}, [
|
|
82
|
-
|
|
83
|
-
item:
|
|
82
|
+
x(I, {
|
|
83
|
+
item: l,
|
|
84
84
|
features: e.features,
|
|
85
85
|
labels: e.labels,
|
|
86
86
|
compact: e.compact,
|
|
87
87
|
readonly: e.data.readonly,
|
|
88
|
+
currency: g.value,
|
|
88
89
|
layout: "drawer",
|
|
89
|
-
"onUpdate:quantity": t[2] || (t[2] = (
|
|
90
|
-
onRemove: t[3] || (t[3] = (
|
|
91
|
-
}, null, 8, ["item", "features", "labels", "compact", "readonly"])
|
|
90
|
+
"onUpdate:quantity": t[2] || (t[2] = (h, q) => u("update:quantity", h, q)),
|
|
91
|
+
onRemove: t[3] || (t[3] = (h) => u("remove", h))
|
|
92
|
+
}, null, 8, ["item", "features", "labels", "compact", "readonly", "currency"])
|
|
92
93
|
]))), 128))
|
|
93
94
|
], 2))
|
|
94
95
|
]),
|
|
95
|
-
|
|
96
|
+
s.value ? i("", !0) : (a(), c("div", {
|
|
96
97
|
key: 1,
|
|
97
98
|
class: d(["border-t border-border bg-card-light/40 shrink-0 space-y-3", e.compact ? "p-4" : "p-5"])
|
|
98
99
|
}, [
|
|
99
|
-
e.features.coupon ? (a(), f(
|
|
100
|
+
e.features.coupon ? (a(), f(R, {
|
|
100
101
|
key: 0,
|
|
101
102
|
coupon: e.data.coupon,
|
|
102
103
|
labels: e.labels,
|
|
103
104
|
compact: e.compact,
|
|
104
105
|
readonly: e.data.readonly,
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
106
|
+
currency: g.value,
|
|
107
|
+
onApply: t[4] || (t[4] = (l) => u("apply-coupon", l)),
|
|
108
|
+
onRemove: t[5] || (t[5] = (l) => u("remove-coupon")),
|
|
109
|
+
onChange: t[6] || (t[6] = (l) => u("coupon-change", l))
|
|
110
|
+
}, null, 8, ["coupon", "labels", "compact", "readonly", "currency"])) : i("", !0),
|
|
111
|
+
x(j, {
|
|
110
112
|
totals: e.data.totals,
|
|
111
113
|
features: e.features,
|
|
112
114
|
labels: e.labels,
|
|
113
115
|
compact: e.compact,
|
|
114
116
|
coupon: e.data.coupon,
|
|
117
|
+
currency: g.value,
|
|
115
118
|
variant: "Variant1"
|
|
116
|
-
}, null, 8, ["totals", "features", "labels", "compact", "coupon"]),
|
|
117
|
-
|
|
118
|
-
n.value.showContinue &&
|
|
119
|
+
}, null, 8, ["totals", "features", "labels", "compact", "coupon", "currency"]),
|
|
120
|
+
V.value && n.value.continueLabel || n.value.showContinueShopping && y.value.continueShopping ? (a(), c("div", H, [
|
|
121
|
+
n.value.showContinue && y.value.continue ? (a(), f(C, {
|
|
119
122
|
key: 0,
|
|
120
123
|
variant: "primary",
|
|
121
124
|
size: e.compact ? "md" : "lg",
|
|
122
125
|
block: !0,
|
|
123
126
|
icon: n.value.continueIcon || "lucide:arrow-right",
|
|
124
127
|
"icon-right": (n.value.continueIcon, void 0),
|
|
125
|
-
disabled: n.value.continueDisabled ||
|
|
128
|
+
disabled: n.value.continueDisabled || s.value,
|
|
126
129
|
class: "w-full",
|
|
127
|
-
onClick: t[7] || (t[7] = (
|
|
130
|
+
onClick: t[7] || (t[7] = (l) => u("continue"))
|
|
128
131
|
}, {
|
|
129
|
-
default:
|
|
130
|
-
|
|
132
|
+
default: w(() => [
|
|
133
|
+
S(v(n.value.continueLabel || m.value.continue || "Continue to checkout"), 1)
|
|
131
134
|
]),
|
|
132
135
|
_: 1
|
|
133
|
-
}, 8, ["size", "icon", "icon-right", "disabled"])) :
|
|
134
|
-
n.value.showContinueShopping &&
|
|
136
|
+
}, 8, ["size", "icon", "icon-right", "disabled"])) : i("", !0),
|
|
137
|
+
n.value.showContinueShopping && y.value.continueShopping ? (a(), f(C, {
|
|
135
138
|
key: 1,
|
|
136
139
|
variant: "ghost",
|
|
137
140
|
size: e.compact ? "sm" : "md",
|
|
@@ -139,18 +142,18 @@ const A = { class: "min-w-0 flex-1" }, F = { class: "flex items-center gap-2" },
|
|
|
139
142
|
icon: n.value.continueShoppingIcon || "lucide:arrow-left",
|
|
140
143
|
disabled: n.value.continueShoppingDisabled,
|
|
141
144
|
class: "w-full",
|
|
142
|
-
onClick: t[8] || (t[8] = (
|
|
145
|
+
onClick: t[8] || (t[8] = (l) => u("continue-shopping"))
|
|
143
146
|
}, {
|
|
144
|
-
default:
|
|
145
|
-
|
|
147
|
+
default: w(() => [
|
|
148
|
+
S(v(n.value.continueShoppingLabel || m.value.continueShopping || "Continue shopping"), 1)
|
|
146
149
|
]),
|
|
147
150
|
_: 1
|
|
148
|
-
}, 8, ["size", "icon", "disabled"])) :
|
|
149
|
-
])) :
|
|
151
|
+
}, 8, ["size", "icon", "disabled"])) : i("", !0)
|
|
152
|
+
])) : i("", !0)
|
|
150
153
|
], 2))
|
|
151
154
|
], 6));
|
|
152
155
|
}
|
|
153
156
|
});
|
|
154
157
|
export {
|
|
155
|
-
|
|
158
|
+
X as default
|
|
156
159
|
};
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
const
|
|
1
|
+
import { defineComponent as L, computed as r, openBlock as a, createElementBlock as s, normalizeClass as o, createElementVNode as n, createBlock as v, createCommentVNode as d, toDisplayString as p, Fragment as N, renderList as q, createVNode as C, withCtx as w, createTextVNode as S } from "vue";
|
|
2
|
+
import B from "../Icon.vue.js";
|
|
3
|
+
import $ from "../Button.vue.js";
|
|
4
|
+
import A from "./CartLineItem.vue.js";
|
|
5
|
+
import D from "./CartSummary.vue.js";
|
|
6
|
+
import E from "./CartCouponInput.vue.js";
|
|
7
|
+
import I from "./CartEmptyState.vue.js";
|
|
8
|
+
const R = { class: "flex items-center justify-center gap-1.5" }, j = { class: "flex-1 min-h-0 overflow-y-auto" }, F = { class: "divide-y divide-dashed divide-border" }, T = {
|
|
9
9
|
key: 0,
|
|
10
10
|
class: "shrink-0"
|
|
11
|
-
},
|
|
11
|
+
}, U = {
|
|
12
12
|
key: 1,
|
|
13
13
|
class: "grid grid-cols-2 gap-2"
|
|
14
|
-
},
|
|
14
|
+
}, Q = /* @__PURE__ */ L({
|
|
15
15
|
__name: "CartVariant2",
|
|
16
16
|
props: {
|
|
17
17
|
data: {},
|
|
@@ -23,33 +23,33 @@ const I = { class: "flex items-center justify-center gap-1.5" }, R = { class: "f
|
|
|
23
23
|
containerClass: {}
|
|
24
24
|
},
|
|
25
25
|
emits: ["update:quantity", "remove", "clear", "apply-coupon", "remove-coupon", "coupon-change", "continue", "continue-shopping"],
|
|
26
|
-
setup(e, { emit:
|
|
27
|
-
const b = e, u =
|
|
28
|
-
() =>
|
|
29
|
-
);
|
|
30
|
-
return (
|
|
26
|
+
setup(e, { emit: V }) {
|
|
27
|
+
const b = e, u = V, l = r(() => b.data), f = r(() => b.labels || {}), c = r(() => b.actions || {}), m = r(() => b.features || {}), y = r(() => l.value.empty || !l.value.items || l.value.items.length === 0), h = r(
|
|
28
|
+
() => l.value.totals.itemCount ?? l.value.items?.reduce((k, t) => k + (t.quantity || 0), 0) ?? 0
|
|
29
|
+
), g = r(() => l.value.currency || l.value.totals.currency);
|
|
30
|
+
return (k, t) => (a(), s("div", {
|
|
31
31
|
class: o(["v-cart v-cart-v2 flex flex-col bg-background text-foreground border border-border overflow-hidden h-full", [e.containerClass, e.compact ? "rounded-sm" : "rounded-md"]])
|
|
32
32
|
}, [
|
|
33
33
|
n("div", {
|
|
34
34
|
class: o(["text-center border-b border-dashed border-border shrink-0", e.compact ? "p-3" : "p-4"])
|
|
35
35
|
}, [
|
|
36
|
-
n("div",
|
|
37
|
-
|
|
36
|
+
n("div", R, [
|
|
37
|
+
l.value.brandLogo ? (a(), v(B, {
|
|
38
38
|
key: 0,
|
|
39
|
-
icon:
|
|
39
|
+
icon: l.value.brandLogo,
|
|
40
40
|
class: o(e.compact ? "w-5 h-5" : "w-6 h-6")
|
|
41
41
|
}, null, 8, ["icon", "class"])) : d("", !0),
|
|
42
42
|
n("p", {
|
|
43
43
|
class: o(["font-bold text-foreground tracking-wide", e.compact ? "text-sm" : "text-base"])
|
|
44
|
-
},
|
|
44
|
+
}, p(l.value.brandName || l.value.title || f.value.cart || "Cart"), 3)
|
|
45
45
|
]),
|
|
46
|
-
|
|
46
|
+
y.value ? d("", !0) : (a(), s("p", {
|
|
47
47
|
key: 0,
|
|
48
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
|
-
},
|
|
49
|
+
}, p(h.value) + " " + p(h.value === 1 ? "item" : "items"), 3))
|
|
50
50
|
], 2),
|
|
51
|
-
n("div",
|
|
52
|
-
|
|
51
|
+
n("div", j, [
|
|
52
|
+
y.value ? (a(), v(I, {
|
|
53
53
|
key: 0,
|
|
54
54
|
labels: e.labels,
|
|
55
55
|
compact: e.compact,
|
|
@@ -64,39 +64,41 @@ const I = { class: "flex items-center justify-center gap-1.5" }, R = { class: "f
|
|
|
64
64
|
n("span", { class: "flex-1" }, "Item", -1),
|
|
65
65
|
n("span", { class: "w-20 text-right" }, "Amount", -1)
|
|
66
66
|
])], 2),
|
|
67
|
-
n("ul",
|
|
68
|
-
(a(!0), s(
|
|
67
|
+
n("ul", F, [
|
|
68
|
+
(a(!0), s(N, null, q(e.data.items, (i) => (a(), s("li", {
|
|
69
69
|
key: i.id
|
|
70
70
|
}, [
|
|
71
|
-
|
|
71
|
+
C(A, {
|
|
72
72
|
item: i,
|
|
73
73
|
features: e.features,
|
|
74
74
|
labels: e.labels,
|
|
75
75
|
compact: e.compact,
|
|
76
76
|
readonly: e.data.readonly,
|
|
77
|
+
currency: g.value,
|
|
77
78
|
layout: "compact",
|
|
78
|
-
"onUpdate:quantity": t[1] || (t[1] = (
|
|
79
|
-
onRemove: t[2] || (t[2] = (
|
|
80
|
-
}, null, 8, ["item", "features", "labels", "compact", "readonly"])
|
|
79
|
+
"onUpdate:quantity": t[1] || (t[1] = (x, z) => u("update:quantity", x, z)),
|
|
80
|
+
onRemove: t[2] || (t[2] = (x) => u("remove", x))
|
|
81
|
+
}, null, 8, ["item", "features", "labels", "compact", "readonly", "currency"])
|
|
81
82
|
]))), 128))
|
|
82
83
|
])
|
|
83
84
|
], 2))
|
|
84
85
|
]),
|
|
85
|
-
|
|
86
|
+
y.value ? d("", !0) : (a(), s("div", T, [
|
|
86
87
|
n("div", {
|
|
87
88
|
class: o(["border-t border-dashed border-border", e.compact ? "mx-3" : "mx-4"])
|
|
88
89
|
}, null, 2),
|
|
89
90
|
n("div", {
|
|
90
91
|
class: o(e.compact ? "px-3 py-2" : "px-4 py-3")
|
|
91
92
|
}, [
|
|
92
|
-
|
|
93
|
+
C(D, {
|
|
93
94
|
totals: e.data.totals,
|
|
94
95
|
features: e.features,
|
|
95
96
|
labels: e.labels,
|
|
96
97
|
compact: e.compact,
|
|
97
98
|
coupon: e.data.coupon,
|
|
99
|
+
currency: g.value,
|
|
98
100
|
variant: "Variant2"
|
|
99
|
-
}, null, 8, ["totals", "features", "labels", "compact", "coupon"])
|
|
101
|
+
}, null, 8, ["totals", "features", "labels", "compact", "coupon", "currency"])
|
|
100
102
|
], 2),
|
|
101
103
|
n("div", {
|
|
102
104
|
class: o(["border-t border-dashed border-border", e.compact ? "mx-3" : "mx-4"])
|
|
@@ -104,42 +106,43 @@ const I = { class: "flex items-center justify-center gap-1.5" }, R = { class: "f
|
|
|
104
106
|
n("div", {
|
|
105
107
|
class: o(e.compact ? "px-3 py-2.5 space-y-2.5" : "px-4 py-3 space-y-3")
|
|
106
108
|
}, [
|
|
107
|
-
e.features.coupon ? (a(),
|
|
109
|
+
e.features.coupon ? (a(), v(E, {
|
|
108
110
|
key: 0,
|
|
109
111
|
coupon: e.data.coupon,
|
|
110
112
|
labels: e.labels,
|
|
111
113
|
compact: e.compact,
|
|
112
114
|
readonly: e.data.readonly,
|
|
115
|
+
currency: g.value,
|
|
113
116
|
onApply: t[3] || (t[3] = (i) => u("apply-coupon", i)),
|
|
114
117
|
onRemove: t[4] || (t[4] = (i) => u("remove-coupon")),
|
|
115
118
|
onChange: t[5] || (t[5] = (i) => u("coupon-change", i))
|
|
116
|
-
}, null, 8, ["coupon", "labels", "compact", "readonly"])) : d("", !0),
|
|
117
|
-
|
|
118
|
-
|
|
119
|
+
}, null, 8, ["coupon", "labels", "compact", "readonly", "currency"])) : d("", !0),
|
|
120
|
+
c.value.showContinue && m.value.continue || c.value.showContinueShopping && m.value.continueShopping ? (a(), s("div", U, [
|
|
121
|
+
c.value.showContinueShopping && m.value.continueShopping ? (a(), v($, {
|
|
119
122
|
key: 0,
|
|
120
123
|
variant: "outline",
|
|
121
124
|
size: e.compact ? "sm" : "md",
|
|
122
|
-
icon:
|
|
123
|
-
disabled:
|
|
125
|
+
icon: c.value.continueShoppingIcon || "lucide:plus",
|
|
126
|
+
disabled: c.value.continueShoppingDisabled,
|
|
124
127
|
onClick: t[6] || (t[6] = (i) => u("continue-shopping"))
|
|
125
128
|
}, {
|
|
126
|
-
default:
|
|
127
|
-
|
|
129
|
+
default: w(() => [
|
|
130
|
+
S(p(c.value.continueShoppingLabel || f.value.continueShopping || "Add more"), 1)
|
|
128
131
|
]),
|
|
129
132
|
_: 1
|
|
130
133
|
}, 8, ["size", "icon", "disabled"])) : d("", !0),
|
|
131
|
-
|
|
134
|
+
c.value.showContinue && m.value.continue ? (a(), v($, {
|
|
132
135
|
key: 1,
|
|
133
136
|
variant: "primary",
|
|
134
137
|
size: e.compact ? "sm" : "md",
|
|
135
|
-
icon:
|
|
138
|
+
icon: c.value.continueIcon || "lucide:credit-card",
|
|
136
139
|
"icon-right": void 0,
|
|
137
|
-
disabled:
|
|
138
|
-
class: o(
|
|
140
|
+
disabled: c.value.continueDisabled || y.value,
|
|
141
|
+
class: o(c.value.showContinueShopping && m.value.continueShopping ? "" : "col-span-2"),
|
|
139
142
|
onClick: t[7] || (t[7] = (i) => u("continue"))
|
|
140
143
|
}, {
|
|
141
|
-
default:
|
|
142
|
-
|
|
144
|
+
default: w(() => [
|
|
145
|
+
S(p(c.value.continueLabel || f.value.continue || "Checkout"), 1)
|
|
143
146
|
]),
|
|
144
147
|
_: 1
|
|
145
148
|
}, 8, ["size", "icon", "disabled", "class"])) : d("", !0)
|
|
@@ -150,5 +153,5 @@ const I = { class: "flex items-center justify-center gap-1.5" }, R = { class: "f
|
|
|
150
153
|
}
|
|
151
154
|
});
|
|
152
155
|
export {
|
|
153
|
-
|
|
156
|
+
Q as default
|
|
154
157
|
};
|