@loczer/storefront-sdk 0.153.0 → 0.154.0
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/dist/components/Footer/businessHoursUtils.d.ts.map +1 -1
- package/dist/components/Footer/businessHoursUtils.js +16 -16
- package/dist/components/StorefrontCartPanel/index.d.ts +2 -1
- package/dist/components/StorefrontCartPanel/index.d.ts.map +1 -1
- package/dist/components/StorefrontCartPanel/index.js +68 -63
- package/dist/i18n/en.d.ts +1 -0
- package/dist/i18n/en.d.ts.map +1 -1
- package/dist/i18n/en.js +1 -0
- package/dist/i18n/fr.d.ts +1 -0
- package/dist/i18n/fr.d.ts.map +1 -1
- package/dist/i18n/fr.js +1 -0
- package/dist/index.d.ts +48 -32
- package/dist/index.js +103 -100
- package/dist/lib/checkoutVerifyCoupon.d.ts +1 -0
- package/dist/lib/checkoutVerifyCoupon.d.ts.map +1 -1
- package/dist/lib/checkoutVerifyCoupon.js +1 -0
- package/dist/pages/CheckoutPage.d.ts.map +1 -1
- package/dist/pages/CheckoutPage.js +56 -51
- package/dist/pages/checkout/components/CheckoutSummaryColumn.d.ts +2 -2
- package/dist/pages/checkout/components/CheckoutSummaryColumn.d.ts.map +1 -1
- package/dist/pages/checkout/components/CheckoutSummaryColumn.js +16 -14
- package/dist/storefront.css +1 -1
- package/dist/ui/button.d.ts +1 -1
- package/dist/ui/button.js +17 -17
- package/dist/ui/card.d.ts.map +1 -1
- package/dist/ui/card.js +8 -11
- package/dist/ui/form.d.ts +1 -1
- package/dist/ui/form.d.ts.map +1 -1
- package/dist/ui/form.js +52 -86
- package/dist/ui/radio-group.d.ts +10 -7
- package/dist/ui/radio-group.d.ts.map +1 -1
- package/dist/ui/radio-group.js +63 -45
- package/dist/ui/select.d.ts +29 -15
- package/dist/ui/select.d.ts.map +1 -1
- package/dist/ui/select.js +158 -232
- package/dist/ui/slot.d.ts +3 -7
- package/dist/ui/slot.d.ts.map +1 -1
- package/dist/ui/slot.js +47 -27
- package/dist/ui/theme.d.ts +9 -0
- package/dist/ui/theme.d.ts.map +1 -0
- package/dist/ui/theme.js +24 -0
- package/dist/ui/tooltip.d.ts +30 -13
- package/dist/ui/tooltip.d.ts.map +1 -1
- package/dist/ui/tooltip.js +89 -60
- package/package.json +1 -1
|
@@ -2,27 +2,27 @@ import { jsx as n, jsxs as y } from "react/jsx-runtime";
|
|
|
2
2
|
import { useState as c, useMemo as u, useEffect as E } from "react";
|
|
3
3
|
import { toast as Z } from "@rpcbase/client";
|
|
4
4
|
import { useForm as Ye, zodResolver as et } from "@rpcbase/form";
|
|
5
|
-
import { useParams as tt, useSearchParams as ot, useNavigate as nt, Link as
|
|
6
|
-
import { ArrowLeft as
|
|
5
|
+
import { useParams as tt, useSearchParams as ot, useNavigate as nt, Link as ke } from "@rpcbase/router";
|
|
6
|
+
import { ArrowLeft as Ce } from "lucide-react";
|
|
7
7
|
import { useTranslation as at } from "react-i18next";
|
|
8
8
|
import { apiPost as F } from "../lib/apiCall.js";
|
|
9
9
|
import { ROUTE as rt, responseSchema as st } from "../lib/checkoutPaymentDecision.js";
|
|
10
10
|
import { ROUTE as it, responseSchema as lt } from "../lib/checkoutVerifyCoupon.js";
|
|
11
11
|
import { ROUTE as ct, responseSchema as ut } from "../lib/checkoutSubmit.js";
|
|
12
|
-
import { ROUTE as dt, responseSchema as mt, buildStorefrontAvailabilityKey as
|
|
13
|
-
import { resolveBookingSearchParamsFromSessionStorage as ht, getBookingParamsFromSearch as ft, getBookingDurationLabel as gt, getBookingDurationMinutes as yt, applyBookingParamsToSearch as
|
|
12
|
+
import { ROUTE as dt, responseSchema as mt, buildStorefrontAvailabilityKey as ve, getStorefrontAvailabilityIssue as pt } from "../lib/storefrontAvailability.js";
|
|
13
|
+
import { resolveBookingSearchParamsFromSessionStorage as ht, getBookingParamsFromSearch as ft, getBookingDurationLabel as gt, getBookingDurationMinutes as yt, applyBookingParamsToSearch as Se, writeBookingSearchParamsToSessionStorage as Me } from "../lib/booking.js";
|
|
14
14
|
import { buildStorefrontCartSummary as _t } from "../lib/cartSummary.js";
|
|
15
15
|
import { useStorefrontCart as bt } from "../lib/cart.js";
|
|
16
16
|
import { useStorefront as kt, useStorefrontProducts as Ct } from "../StorefrontProvider.js";
|
|
17
17
|
import { BookingFlowSteps as vt } from "../components/BookingFlowSteps/index.js";
|
|
18
|
-
import { Button as
|
|
18
|
+
import { Button as xe } from "../ui/button.js";
|
|
19
19
|
import { CheckoutDetailsCard as St } from "./checkout/components/CheckoutDetailsCard.js";
|
|
20
20
|
import { CheckoutCouponCard as Mt } from "./checkout/components/CheckoutCouponCard.js";
|
|
21
21
|
import { CheckoutPaymentSummaryCard as xt } from "./checkout/components/CheckoutPaymentSummaryCard.js";
|
|
22
22
|
import { CheckoutSummaryColumn as Pt } from "./checkout/components/CheckoutSummaryColumn.js";
|
|
23
23
|
import { FulfillmentSection as Tt } from "../components/FulfillmentSection/index.js";
|
|
24
24
|
import { checkoutFormSchema as At } from "./checkout/types.js";
|
|
25
|
-
const
|
|
25
|
+
const Pe = 0.2, Dt = (o) => o <= 0 ? 1 : Math.max(1, Math.ceil(o / 1440)), _ = (o, r, p) => {
|
|
26
26
|
try {
|
|
27
27
|
return new Intl.NumberFormat(p, {
|
|
28
28
|
style: "currency",
|
|
@@ -31,7 +31,7 @@ const xe = 0.2, Dt = (o) => o <= 0 ? 1 : Math.max(1, Math.ceil(o / 1440)), _ = (
|
|
|
31
31
|
} catch {
|
|
32
32
|
return `${(o / 100).toFixed(2)} ${r.toUpperCase()}`;
|
|
33
33
|
}
|
|
34
|
-
},
|
|
34
|
+
}, Te = (o, r) => {
|
|
35
35
|
try {
|
|
36
36
|
return new Intl.NumberFormat(r, {
|
|
37
37
|
style: "percent",
|
|
@@ -54,21 +54,21 @@ const xe = 0.2, Dt = (o) => o <= 0 ? 1 : Math.max(1, Math.ceil(o / 1440)), _ = (
|
|
|
54
54
|
return new Intl.DateTimeFormat(r, S).format(o);
|
|
55
55
|
};
|
|
56
56
|
function to() {
|
|
57
|
-
const { t: o, i18n: r } = at(), { storefrontConfiguration: p } = kt(), S = p.workspace?.workspaceLanguage, { bikes: G, accessories: J } = Ct(), { storeSlug: s } = tt(), [M,
|
|
57
|
+
const { t: o, i18n: r } = at(), { storefrontConfiguration: p } = kt(), S = p.workspace?.workspaceLanguage, { bikes: G, accessories: J } = Ct(), { storeSlug: s } = tt(), [M, Ae] = ot(), De = nt(), { items: X, itemCount: we, setQuantity: Ie, removeItem: Le, clear: Re } = bt(), [U, Y] = c(!1), [l, T] = c(null), [ee, $] = c(!1), [te, A] = c(null), oe = M.get("coupon") ?? M.get("code") ?? "", [ne, B] = c(oe), [ae, re] = c(oe.trim()), [f, x] = c(null), [se, D] = c(null), [ie, O] = c(!1), [Ne, b] = c(null), [le, k] = c(null), [V, ce] = c(!1), ue = u(
|
|
58
58
|
() => ht(M, s),
|
|
59
59
|
[M, s]
|
|
60
|
-
), w = p.settings.fulfillmentModes.includes("delivery"),
|
|
61
|
-
const e = ft(
|
|
60
|
+
), w = p.settings.fulfillmentModes.includes("delivery"), de = p.settings.deliveryDisabledReason.trim(), Ee = w || de.length > 0, Fe = p.shop.address?.trim() ?? "", t = u(() => {
|
|
61
|
+
const e = ft(ue);
|
|
62
62
|
return e.fulfillment === "delivery" && !w ? { ...e, fulfillment: "pickup" } : e;
|
|
63
|
-
}, [
|
|
63
|
+
}, [ue, w]), Ue = u(() => gt(t), [t]), me = u(() => yt(t), [t]), pe = u(() => Dt(me), [me]), d = u(
|
|
64
64
|
() => _t({
|
|
65
65
|
items: X,
|
|
66
66
|
language: r.language,
|
|
67
67
|
fallbackLanguage: S,
|
|
68
68
|
products: { bikes: G, accessories: J },
|
|
69
|
-
estimatedDays:
|
|
69
|
+
estimatedDays: pe
|
|
70
70
|
}),
|
|
71
|
-
[J, G,
|
|
71
|
+
[J, G, pe, r.language, X, S]
|
|
72
72
|
), q = u(
|
|
73
73
|
() => d.lines.map((e) => ({
|
|
74
74
|
productId: e.checkoutProductId,
|
|
@@ -76,7 +76,7 @@ function to() {
|
|
|
76
76
|
quantity: e.quantity
|
|
77
77
|
})),
|
|
78
78
|
[d.lines]
|
|
79
|
-
), [
|
|
79
|
+
), [he, I] = c([]), [K, z] = c(!1);
|
|
80
80
|
E(() => {
|
|
81
81
|
if (!s || q.length === 0) {
|
|
82
82
|
I([]), z(!1);
|
|
@@ -117,16 +117,16 @@ function to() {
|
|
|
117
117
|
q,
|
|
118
118
|
s
|
|
119
119
|
]);
|
|
120
|
-
const
|
|
121
|
-
|
|
122
|
-
|
|
120
|
+
const fe = u(() => new Map(
|
|
121
|
+
he.map((e) => [
|
|
122
|
+
ve(e.productId, e.productVariantId),
|
|
123
123
|
e
|
|
124
124
|
])
|
|
125
|
-
), [
|
|
125
|
+
), [he]), L = u(
|
|
126
126
|
() => ({
|
|
127
127
|
...d,
|
|
128
128
|
lines: d.lines.map((e) => {
|
|
129
|
-
const i =
|
|
129
|
+
const i = fe.get(ve(e.checkoutProductId, e.productVariantId)), a = i ? pt(i) : e.availabilityStatus === "OUT_OF_STOCK" ? "unavailable" : void 0;
|
|
130
130
|
return {
|
|
131
131
|
...e,
|
|
132
132
|
insufficientCapacity: !K && a !== void 0,
|
|
@@ -134,7 +134,7 @@ function to() {
|
|
|
134
134
|
};
|
|
135
135
|
})
|
|
136
136
|
}),
|
|
137
|
-
[
|
|
137
|
+
[fe, K, d]
|
|
138
138
|
), C = u(
|
|
139
139
|
() => d.lines.map((e) => ({
|
|
140
140
|
kind: e.kind,
|
|
@@ -143,16 +143,16 @@ function to() {
|
|
|
143
143
|
quantity: e.quantity
|
|
144
144
|
})),
|
|
145
145
|
[d.lines]
|
|
146
|
-
), $e = d.estimatedTotalMinor ?? d.totalPerDayMinor, v =
|
|
146
|
+
), $e = d.estimatedTotalMinor ?? d.totalPerDayMinor, v = se?.totalMinor ?? $e, P = f?.discountAmountMinor ?? 0, R = Se(new URLSearchParams(), t).toString(), j = `/${s ?? ""}/booking${R ? `?${R}` : ""}`, Be = `/${s ?? ""}/checkout${R ? `?${R}` : ""}`, ge = Ye({
|
|
147
147
|
resolver: et(At),
|
|
148
148
|
defaultValues: { full_name: "", email: "", phone: "", notes: "" }
|
|
149
149
|
});
|
|
150
150
|
E(() => {
|
|
151
|
-
|
|
151
|
+
Me(s, t);
|
|
152
152
|
}, [t, s]);
|
|
153
153
|
const H = (e) => {
|
|
154
|
-
const i = { ...t, ...e }, a =
|
|
155
|
-
|
|
154
|
+
const i = { ...t, ...e }, a = Se(M, i);
|
|
155
|
+
Ae(a, { replace: !0 }), Me(s, a);
|
|
156
156
|
};
|
|
157
157
|
E(() => {
|
|
158
158
|
if (!s || C.length === 0) {
|
|
@@ -180,7 +180,11 @@ function to() {
|
|
|
180
180
|
), m = lt.parse(W);
|
|
181
181
|
if (a) return;
|
|
182
182
|
if (D(
|
|
183
|
-
typeof m.subtotalMinor == "number" && typeof m.totalMinor == "number" ? {
|
|
183
|
+
typeof m.subtotalMinor == "number" && typeof m.totalMinor == "number" ? {
|
|
184
|
+
subtotalMinor: m.subtotalMinor,
|
|
185
|
+
totalMinor: m.totalMinor,
|
|
186
|
+
lateReturnSurchargeMinor: m.lateReturnSurchargeMinor
|
|
187
|
+
} : null
|
|
184
188
|
), !m.success) {
|
|
185
189
|
x(null), k(m.message || o("checkout_coupon_invalid"));
|
|
186
190
|
return;
|
|
@@ -251,26 +255,26 @@ function to() {
|
|
|
251
255
|
s,
|
|
252
256
|
o
|
|
253
257
|
]);
|
|
254
|
-
const g = l?.currency ?? "EUR", Oe = _(v, g, r.language), Ve = P > 0 ? `-${_(P, g, r.language)}` : null,
|
|
258
|
+
const g = l?.currency ?? "EUR", Oe = _(v, g, r.language), Ve = P > 0 ? `-${_(P, g, r.language)}` : null, ye = Math.round(v / (1 + Pe)), qe = Math.max(0, v - ye), Ke = _(ye, g, r.language), ze = _(qe, g, r.language), je = Te(Pe, r.language), h = l?.amountToCollectMinor ?? 0, He = _(h, g, r.language), Qe = l?.paymentMode === "deposit" && h > 0 ? _(h, g, r.language) : null, We = l?.shouldCollectOnlinePayment === !0 && h > 0, _e = p.shop.timeZone?.trim() || void 0, N = u(() => {
|
|
255
259
|
if (!l) return null;
|
|
256
260
|
const e = Math.max(0, Math.min(1, l.bookingDepositPercentage));
|
|
257
|
-
return
|
|
261
|
+
return Te(e, r.language);
|
|
258
262
|
}, [r.language, l]), Q = u(() => {
|
|
259
263
|
if (!l?.depositRefundableUntilIso) return null;
|
|
260
264
|
const e = new Date(l.depositRefundableUntilIso);
|
|
261
|
-
return Number.isNaN(e.getTime()) ? null : wt(e, r.language,
|
|
262
|
-
}, [r.language, l?.depositRefundableUntilIso,
|
|
263
|
-
percent:
|
|
265
|
+
return Number.isNaN(e.getTime()) ? null : wt(e, r.language, _e);
|
|
266
|
+
}, [r.language, l?.depositRefundableUntilIso, _e]), Ze = u(() => l ? l.paymentMode === "deposit" && h > 0 && N ? Q ? o("checkout_payment_due_now_helper_deposit_refundable_until", {
|
|
267
|
+
percent: N,
|
|
264
268
|
date: Q
|
|
265
269
|
}) : o("checkout_payment_due_now_helper_deposit", {
|
|
266
|
-
percent:
|
|
270
|
+
percent: N
|
|
267
271
|
}) : l.paymentMode === "full" && h > 0 ? null : l.paymentMode === "none" || h <= 0 ? o("checkout_payment_due_now_helper_none") : null : null, [
|
|
268
272
|
h,
|
|
269
|
-
|
|
273
|
+
N,
|
|
270
274
|
Q,
|
|
271
275
|
l,
|
|
272
276
|
o
|
|
273
|
-
]), Ge =
|
|
277
|
+
]), Ge = ge.handleSubmit(async (e) => {
|
|
274
278
|
if (!(!s || C.length === 0)) {
|
|
275
279
|
Y(!0);
|
|
276
280
|
try {
|
|
@@ -302,25 +306,25 @@ function to() {
|
|
|
302
306
|
Z.error(a.message || o("checkout_payment_error"));
|
|
303
307
|
return;
|
|
304
308
|
}
|
|
305
|
-
a.checkout.requiresPayment || Z.success(o("checkout_success_toast")), await
|
|
309
|
+
a.checkout.requiresPayment || Z.success(o("checkout_success_toast")), await De(a.checkout.nextPath), Re();
|
|
306
310
|
} catch (i) {
|
|
307
311
|
console.error("Failed to submit storefront checkout", i), Z.error(o("checkout_payment_error"));
|
|
308
312
|
} finally {
|
|
309
313
|
Y(!1);
|
|
310
314
|
}
|
|
311
315
|
}
|
|
312
|
-
}), Je = o(We ? "checkout_continue_to_payment" : "checkout_submit"),
|
|
316
|
+
}), Je = o(We ? "checkout_continue_to_payment" : "checkout_submit"), be = t.fulfillment === "delivery" && t.start_address.trim().length === 0, Xe = !U && !ee && !te && !ie && !le && !!l && !be && C.length > 0;
|
|
313
317
|
return d.lines.length === 0 ? /* @__PURE__ */ n("div", { className: "mx-auto max-w-3xl px-4 py-10 sm:px-6", children: /* @__PURE__ */ y("div", { className: "rounded-2xl border border-slate-200 bg-white p-6 shadow-sm", children: [
|
|
314
318
|
/* @__PURE__ */ n("h1", { className: "text-xl font-semibold tracking-tight text-slate-950", children: /* @__PURE__ */ n("span", { children: o("cart_empty_title") }) }),
|
|
315
319
|
/* @__PURE__ */ n("p", { className: "mt-2 text-sm text-slate-600", children: /* @__PURE__ */ n("span", { children: o("cart_empty_description") }) }),
|
|
316
|
-
/* @__PURE__ */ n("div", { className: "mt-6", children: /* @__PURE__ */ n(
|
|
317
|
-
/* @__PURE__ */ n(
|
|
320
|
+
/* @__PURE__ */ n("div", { className: "mt-6", children: /* @__PURE__ */ n(ke, { to: j, children: /* @__PURE__ */ y(xe, { className: "gap-2", children: [
|
|
321
|
+
/* @__PURE__ */ n(Ce, { className: "h-4 w-4", "aria-hidden": "true" }),
|
|
318
322
|
/* @__PURE__ */ n("span", { children: o("back_to_booking") })
|
|
319
323
|
] }) }) })
|
|
320
324
|
] }) }) : /* @__PURE__ */ n("div", { className: "mx-auto max-w-7xl px-4 py-8 sm:px-6", children: /* @__PURE__ */ y("div", { className: "flex flex-col gap-6", children: [
|
|
321
325
|
/* @__PURE__ */ n(vt, { currentStep: "checkout", bookingPath: j, checkoutPath: Be }),
|
|
322
|
-
/* @__PURE__ */ y(
|
|
323
|
-
/* @__PURE__ */ n(
|
|
326
|
+
/* @__PURE__ */ y(ke, { to: j, className: "inline-flex items-center gap-2 text-sm font-medium text-slate-700 hover:text-slate-950", children: [
|
|
327
|
+
/* @__PURE__ */ n(Ce, { className: "h-4 w-4", "aria-hidden": "true" }),
|
|
324
328
|
/* @__PURE__ */ n("span", { children: o("back_to_booking") })
|
|
325
329
|
] }),
|
|
326
330
|
/* @__PURE__ */ y("div", { className: "grid gap-6 lg:grid-cols-12", children: [
|
|
@@ -334,7 +338,7 @@ function to() {
|
|
|
334
338
|
onValueChange: (e) => H({ fulfillment: e }),
|
|
335
339
|
pickupAddress: Fe,
|
|
336
340
|
deliveryEnabled: w,
|
|
337
|
-
deliveryDisabledReason:
|
|
341
|
+
deliveryDisabledReason: de,
|
|
338
342
|
startAddress: t.start_address,
|
|
339
343
|
onStartAddressChange: (e) => H({ start_address: e }),
|
|
340
344
|
endAddress: t.end_address,
|
|
@@ -343,25 +347,25 @@ function to() {
|
|
|
343
347
|
testIdPrefix: "storefront-checkout-fulfillment"
|
|
344
348
|
}
|
|
345
349
|
) }) : null,
|
|
346
|
-
/* @__PURE__ */ n(St, { form:
|
|
350
|
+
/* @__PURE__ */ n(St, { form: ge }),
|
|
347
351
|
/* @__PURE__ */ n(
|
|
348
352
|
Mt,
|
|
349
353
|
{
|
|
350
354
|
code: ne,
|
|
351
355
|
appliedCode: f?.code,
|
|
352
356
|
discountLabel: f && P > 0 ? _(P, g, r.language) : null,
|
|
353
|
-
message:
|
|
354
|
-
error:
|
|
355
|
-
loading:
|
|
357
|
+
message: Ne,
|
|
358
|
+
error: le,
|
|
359
|
+
loading: ie,
|
|
356
360
|
disabled: U,
|
|
357
361
|
onCodeChange: (e) => {
|
|
358
362
|
B(e), k(null), b(null);
|
|
359
363
|
},
|
|
360
364
|
onApply: () => {
|
|
361
|
-
|
|
365
|
+
ce(!1), re(ne.trim());
|
|
362
366
|
},
|
|
363
367
|
onRemove: () => {
|
|
364
|
-
B(""), re(""), x(null), D(null), k(null), b(null),
|
|
368
|
+
B(""), re(""), x(null), D(null), k(null), b(null), ce(!0);
|
|
365
369
|
}
|
|
366
370
|
}
|
|
367
371
|
),
|
|
@@ -389,7 +393,7 @@ function to() {
|
|
|
389
393
|
}
|
|
390
394
|
),
|
|
391
395
|
/* @__PURE__ */ n(
|
|
392
|
-
|
|
396
|
+
xe,
|
|
393
397
|
{
|
|
394
398
|
type: "button",
|
|
395
399
|
size: "lg",
|
|
@@ -401,23 +405,24 @@ function to() {
|
|
|
401
405
|
children: /* @__PURE__ */ n("span", { children: Je })
|
|
402
406
|
}
|
|
403
407
|
),
|
|
404
|
-
|
|
408
|
+
be ? /* @__PURE__ */ n("p", { className: "text-sm text-slate-600", children: /* @__PURE__ */ n("span", { children: o("checkout_delivery_address_required") }) }) : null
|
|
405
409
|
] })
|
|
406
410
|
] }),
|
|
407
411
|
/* @__PURE__ */ n(
|
|
408
412
|
Pt,
|
|
409
413
|
{
|
|
410
414
|
lines: L.lines,
|
|
411
|
-
itemCount:
|
|
415
|
+
itemCount: we,
|
|
412
416
|
totalPerDayMinor: L.totalPerDayMinor,
|
|
413
417
|
estimatedDays: L.estimatedDays,
|
|
414
418
|
estimatedTotalMinor: L.estimatedTotalMinor,
|
|
415
419
|
discountedEstimatedTotalMinor: v,
|
|
416
420
|
discountAmountMinor: P,
|
|
421
|
+
lateReturnSurchargeMinor: se?.lateReturnSurchargeMinor,
|
|
417
422
|
couponCode: f?.code,
|
|
418
423
|
durationLabel: Ue.label,
|
|
419
|
-
onQuantityChange:
|
|
420
|
-
onRemove:
|
|
424
|
+
onQuantityChange: Ie,
|
|
425
|
+
onRemove: Le
|
|
421
426
|
}
|
|
422
427
|
)
|
|
423
428
|
] })
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ComponentProps } from 'react';
|
|
2
2
|
import { StorefrontCartPanel } from '../../../components/StorefrontCartPanel';
|
|
3
3
|
type StorefrontCartPanelProps = ComponentProps<typeof StorefrontCartPanel>;
|
|
4
|
-
type CheckoutSummaryColumnProps = Pick<StorefrontCartPanelProps, "lines" | "itemCount" | "totalPerDayMinor" | "estimatedDays" | "estimatedTotalMinor" | "discountedEstimatedTotalMinor" | "discountAmountMinor" | "couponCode" | "durationLabel" | "onQuantityChange" | "onRemove">;
|
|
5
|
-
export declare function CheckoutSummaryColumn({ lines, itemCount, totalPerDayMinor, estimatedDays, estimatedTotalMinor, discountedEstimatedTotalMinor, discountAmountMinor, couponCode, durationLabel, onQuantityChange, onRemove, }: CheckoutSummaryColumnProps): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
type CheckoutSummaryColumnProps = Pick<StorefrontCartPanelProps, "lines" | "itemCount" | "totalPerDayMinor" | "estimatedDays" | "estimatedTotalMinor" | "discountedEstimatedTotalMinor" | "discountAmountMinor" | "lateReturnSurchargeMinor" | "couponCode" | "durationLabel" | "onQuantityChange" | "onRemove">;
|
|
5
|
+
export declare function CheckoutSummaryColumn({ lines, itemCount, totalPerDayMinor, estimatedDays, estimatedTotalMinor, discountedEstimatedTotalMinor, discountAmountMinor, lateReturnSurchargeMinor, couponCode, durationLabel, onQuantityChange, onRemove, }: CheckoutSummaryColumnProps): import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
export {};
|
|
7
7
|
//# sourceMappingURL=CheckoutSummaryColumn.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CheckoutSummaryColumn.d.ts","sourceRoot":"","sources":["../../../../src/pages/checkout/components/CheckoutSummaryColumn.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AAG3C,OAAO,EAAE,mBAAmB,EAAE,MAAM,yCAAyC,CAAA;AAG7E,KAAK,wBAAwB,GAAG,cAAc,CAAC,OAAO,mBAAmB,CAAC,CAAA;AAE1E,KAAK,0BAA0B,GAAG,IAAI,CACpC,wBAAwB,EACtB,OAAO,GACP,WAAW,GACX,kBAAkB,GAClB,eAAe,GACf,qBAAqB,GACrB,+BAA+B,GAC/B,qBAAqB,GACrB,YAAY,GACZ,eAAe,GACf,kBAAkB,GAClB,UAAU,CACb,CAAA;AAED,wBAAgB,qBAAqB,CAAC,EACpC,KAAK,EACL,SAAS,EACT,gBAAgB,EAChB,aAAa,EACb,mBAAmB,EACnB,6BAA6B,EAC7B,mBAAmB,EACnB,UAAU,EACV,aAAa,EACb,gBAAgB,EAChB,QAAQ,GACT,EAAE,0BAA0B,
|
|
1
|
+
{"version":3,"file":"CheckoutSummaryColumn.d.ts","sourceRoot":"","sources":["../../../../src/pages/checkout/components/CheckoutSummaryColumn.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AAG3C,OAAO,EAAE,mBAAmB,EAAE,MAAM,yCAAyC,CAAA;AAG7E,KAAK,wBAAwB,GAAG,cAAc,CAAC,OAAO,mBAAmB,CAAC,CAAA;AAE1E,KAAK,0BAA0B,GAAG,IAAI,CACpC,wBAAwB,EACtB,OAAO,GACP,WAAW,GACX,kBAAkB,GAClB,eAAe,GACf,qBAAqB,GACrB,+BAA+B,GAC/B,qBAAqB,GACrB,0BAA0B,GAC1B,YAAY,GACZ,eAAe,GACf,kBAAkB,GAClB,UAAU,CACb,CAAA;AAED,wBAAgB,qBAAqB,CAAC,EACpC,KAAK,EACL,SAAS,EACT,gBAAgB,EAChB,aAAa,EACb,mBAAmB,EACnB,6BAA6B,EAC7B,mBAAmB,EACnB,wBAAwB,EACxB,UAAU,EACV,aAAa,EACb,gBAAgB,EAChB,QAAQ,GACT,EAAE,0BAA0B,2CAyB5B"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
-
import { useTranslation as
|
|
3
|
-
import { StorefrontCartPanel as
|
|
4
|
-
function
|
|
2
|
+
import { useTranslation as f } from "react-i18next";
|
|
3
|
+
import { StorefrontCartPanel as h } from "../../../components/StorefrontCartPanel/index.js";
|
|
4
|
+
function _({
|
|
5
5
|
lines: r,
|
|
6
6
|
itemCount: e,
|
|
7
7
|
totalPerDayMinor: i,
|
|
@@ -9,14 +9,15 @@ function C({
|
|
|
9
9
|
estimatedTotalMinor: s,
|
|
10
10
|
discountedEstimatedTotalMinor: a,
|
|
11
11
|
discountAmountMinor: c,
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
lateReturnSurchargeMinor: n,
|
|
13
|
+
couponCode: l,
|
|
14
|
+
durationLabel: u,
|
|
15
|
+
onQuantityChange: p,
|
|
16
|
+
onRemove: d
|
|
16
17
|
}) {
|
|
17
|
-
const { t } =
|
|
18
|
+
const { t } = f();
|
|
18
19
|
return /* @__PURE__ */ o("div", { className: "lg:col-span-5", children: /* @__PURE__ */ o(
|
|
19
|
-
|
|
20
|
+
h,
|
|
20
21
|
{
|
|
21
22
|
lines: r,
|
|
22
23
|
itemCount: e,
|
|
@@ -25,17 +26,18 @@ function C({
|
|
|
25
26
|
estimatedTotalMinor: s,
|
|
26
27
|
discountedEstimatedTotalMinor: a,
|
|
27
28
|
discountAmountMinor: c,
|
|
28
|
-
|
|
29
|
-
|
|
29
|
+
lateReturnSurchargeMinor: n,
|
|
30
|
+
couponCode: l,
|
|
31
|
+
durationLabel: u,
|
|
30
32
|
title: t("checkout_summary_title"),
|
|
31
33
|
description: t("checkout_summary_description"),
|
|
32
34
|
editable: !0,
|
|
33
35
|
stickyTopClassName: "top-32",
|
|
34
|
-
onQuantityChange:
|
|
35
|
-
onRemove:
|
|
36
|
+
onQuantityChange: p,
|
|
37
|
+
onRemove: d
|
|
36
38
|
}
|
|
37
39
|
) });
|
|
38
40
|
}
|
|
39
41
|
export {
|
|
40
|
-
|
|
42
|
+
_ as CheckoutSummaryColumn
|
|
41
43
|
};
|