@afosto/checkout-ui 0.0.14 → 0.0.16
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/README.md +333 -1
- package/dist/CheckoutAddressFields/CheckoutAddressFields.d.ts.map +1 -1
- package/dist/CheckoutAddressFields/CheckoutAddressFields.js +59 -57
- package/dist/CheckoutAgreementOptionCondition/CheckoutAgreementOptionCondition.d.ts +1 -1
- package/dist/CheckoutAgreementOptionCondition/CheckoutAgreementOptionCondition.js +23 -23
- package/dist/CheckoutAgreementsTimeline/CheckoutAgreementsTimeline.js +10 -10
- package/dist/CheckoutShippingMethodSection/CheckoutShippingMethodSection.d.ts +1 -1
- package/dist/CheckoutShippingMethodSection/CheckoutShippingMethodSection.d.ts.map +1 -1
- package/dist/CheckoutShippingMethodsField/CheckoutShippingMethodsField.d.ts +1 -1
- package/dist/CheckoutShippingMethodsField/CheckoutShippingMethodsField.d.ts.map +1 -1
- package/dist/CheckoutShippingMethodsField/CheckoutShippingMethodsField.js +78 -77
- package/dist/constants/paymentMethodIconMapping.d.ts +9 -0
- package/dist/constants/paymentMethodIconMapping.d.ts.map +1 -1
- package/dist/constants/paymentMethodIconMapping.js +76 -58
- package/dist/hooks/useCheckoutShippingMethods.d.ts +2 -1
- package/dist/hooks/useCheckoutShippingMethods.d.ts.map +1 -1
- package/dist/hooks/useCheckoutShippingMethods.js +110 -67
- package/dist/icons/index.js +178 -160
- package/dist/icons/paymentMethods/Alma.d.ts +3 -0
- package/dist/icons/paymentMethods/Alma.d.ts.map +1 -0
- package/dist/icons/paymentMethods/Alma.js +15 -0
- package/dist/icons/paymentMethods/Bancomat.d.ts +3 -0
- package/dist/icons/paymentMethods/Bancomat.d.ts.map +1 -0
- package/dist/icons/paymentMethods/Bancomat.js +15 -0
- package/dist/icons/paymentMethods/Bizum.d.ts +3 -0
- package/dist/icons/paymentMethods/Bizum.d.ts.map +1 -0
- package/dist/icons/paymentMethods/Bizum.js +28 -0
- package/dist/icons/paymentMethods/Blik.d.ts +3 -0
- package/dist/icons/paymentMethods/Blik.d.ts.map +1 -0
- package/dist/icons/paymentMethods/Blik.js +59 -0
- package/dist/icons/paymentMethods/ClickToPay.d.ts +3 -0
- package/dist/icons/paymentMethods/ClickToPay.d.ts.map +1 -0
- package/dist/icons/paymentMethods/ClickToPay.js +35 -0
- package/dist/icons/paymentMethods/MBWay.d.ts +3 -0
- package/dist/icons/paymentMethods/MBWay.d.ts.map +1 -0
- package/dist/icons/paymentMethods/MBWay.js +65 -0
- package/dist/icons/paymentMethods/MobilePay.d.ts +3 -0
- package/dist/icons/paymentMethods/MobilePay.d.ts.map +1 -0
- package/dist/icons/paymentMethods/MobilePay.js +103 -0
- package/dist/icons/paymentMethods/Satispay.d.ts +3 -0
- package/dist/icons/paymentMethods/Satispay.d.ts.map +1 -0
- package/dist/icons/paymentMethods/Satispay.js +15 -0
- package/dist/icons/paymentMethods/Vipps.d.ts +3 -0
- package/dist/icons/paymentMethods/Vipps.d.ts.map +1 -0
- package/dist/icons/paymentMethods/Vipps.js +15 -0
- package/dist/icons/paymentMethods/index.d.ts +9 -0
- package/dist/icons/paymentMethods/index.d.ts.map +1 -1
- package/dist/icons/paymentMethods/index.js +124 -106
- package/dist/index.js +356 -338
- package/dist/operations/cartOperations.d.ts.map +1 -1
- package/dist/operations/cartOperations.js +4 -6
- package/dist/operations/orderOperations.d.ts.map +1 -1
- package/dist/operations/orderOperations.js +4 -6
- package/dist/queries/getCartShippingMethodsQuery.d.ts +0 -1
- package/dist/queries/getCartShippingMethodsQuery.d.ts.map +1 -1
- package/dist/queries/getCartShippingMethodsQuery.js +6 -29
- package/dist/queries/getOrderShippingMethodsQuery.d.ts +0 -1
- package/dist/queries/getOrderShippingMethodsQuery.d.ts.map +1 -1
- package/dist/queries/getOrderShippingMethodsQuery.js +4 -27
- package/dist/types.d.ts +1 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import { jsxs as s, jsx as
|
|
2
|
-
import { Box as
|
|
1
|
+
import { jsxs as s, jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { Box as m, Typography as c } from "@afosto/components";
|
|
3
3
|
import { TurnDownRightSolid as g } from "../icons/TurnDownRightSolid.js";
|
|
4
4
|
import { CheckoutCurrency as C } from "../CheckoutCurrency/CheckoutCurrency.js";
|
|
5
|
-
import { camelize as
|
|
6
|
-
import { useCheckout as
|
|
7
|
-
import { formatCurrency as
|
|
5
|
+
import { camelize as D } from "@afosto/utils";
|
|
6
|
+
import { useCheckout as x } from "../CheckoutStateProvider/CheckoutStateProvider.js";
|
|
7
|
+
import { formatCurrency as v } from "../utils/formatCurrency.js";
|
|
8
8
|
const w = {
|
|
9
9
|
payImmediately: "Pay immediately",
|
|
10
|
-
|
|
10
|
+
remainingAmountDueBeforeDelivery: "Remaining amount due before delivery",
|
|
11
11
|
withinDaysOfTheInvoiceDate: "Within {days} days of the invoice date"
|
|
12
|
-
},
|
|
12
|
+
}, b = (l) => {
|
|
13
13
|
const {
|
|
14
14
|
condition: e,
|
|
15
|
-
currency:
|
|
15
|
+
currency: a,
|
|
16
16
|
locale: r,
|
|
17
|
-
translations:
|
|
18
|
-
} =
|
|
17
|
+
translations: y = {}
|
|
18
|
+
} = l, { settings: u, translations: p } = x(), { currency: d } = u || {}, n = {
|
|
19
19
|
...w,
|
|
20
|
-
...
|
|
21
|
-
...
|
|
22
|
-
}, o =
|
|
20
|
+
...p.agreementOptionConditions || {},
|
|
21
|
+
...y || {}
|
|
22
|
+
}, o = D(e.type?.toLowerCase() || ""), f = e.outcome?.amount || 0;
|
|
23
23
|
let t = e.type;
|
|
24
|
-
return o === "downPayment" && e.isPercentage && (t = `${n.payImmediately}${e.amount > 0 && e.amount < 100 ? ` (${e.amount}%)` : ""}`), o === "downPayment" && !e.isPercentage && (t = `${n.payImmediately}${e.amount > 0 ? ` (${
|
|
25
|
-
currency:
|
|
24
|
+
return o === "downPayment" && e.isPercentage && (t = `${n.payImmediately}${e.amount > 0 && e.amount < 100 ? ` (${e.amount}%)` : ""}`), o === "downPayment" && !e.isPercentage && (t = `${n.payImmediately}${e.amount > 0 ? ` (${v(e.amount / 100, r, {
|
|
25
|
+
currency: a || d
|
|
26
26
|
})})` : ""}`), o === "postPaid" && (t = n.withinDaysOfTheInvoiceDate.replace(
|
|
27
27
|
"{days}",
|
|
28
28
|
e.pastDueAfter.toString()
|
|
29
|
-
)), o === "cod" && (t = n.
|
|
30
|
-
|
|
29
|
+
)), o === "cod" && (t = n.remainingAmountDueBeforeDelivery), /* @__PURE__ */ s(
|
|
30
|
+
m,
|
|
31
31
|
{
|
|
32
32
|
sx: {
|
|
33
33
|
display: "flex",
|
|
@@ -36,19 +36,19 @@ const w = {
|
|
|
36
36
|
justifyContent: "space-between"
|
|
37
37
|
},
|
|
38
38
|
children: [
|
|
39
|
-
/* @__PURE__ */ s(
|
|
40
|
-
/* @__PURE__ */
|
|
39
|
+
/* @__PURE__ */ s(m, { sx: { display: "flex", alignItems: "center", gap: 2.5 }, children: [
|
|
40
|
+
/* @__PURE__ */ i(
|
|
41
41
|
g,
|
|
42
42
|
{
|
|
43
43
|
sx: { color: (h) => h.palette.gray[400], fontSize: 16 }
|
|
44
44
|
}
|
|
45
45
|
),
|
|
46
|
-
/* @__PURE__ */
|
|
46
|
+
/* @__PURE__ */ i(c, { children: t })
|
|
47
47
|
] }),
|
|
48
|
-
/* @__PURE__ */
|
|
48
|
+
/* @__PURE__ */ i(c, { fontWeight: 500, children: /* @__PURE__ */ i(
|
|
49
49
|
C,
|
|
50
50
|
{
|
|
51
|
-
currency:
|
|
51
|
+
currency: a,
|
|
52
52
|
locale: r,
|
|
53
53
|
value: f / 100
|
|
54
54
|
}
|
|
@@ -58,5 +58,5 @@ const w = {
|
|
|
58
58
|
);
|
|
59
59
|
};
|
|
60
60
|
export {
|
|
61
|
-
|
|
61
|
+
b as CheckoutAgreementOptionCondition
|
|
62
62
|
};
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
2
|
-
import { Card as j, Timeline as A, TimelineItem as p, TimelineSeparator as m, TimelineDot as
|
|
2
|
+
import { Card as j, Timeline as A, TimelineItem as p, TimelineSeparator as m, TimelineDot as u, TimelineConnector as P, TimelineContent as h, Box as y, Typography as i } from "@afosto/components";
|
|
3
3
|
import { camelize as g } from "@afosto/utils";
|
|
4
4
|
import { CheckoutCurrency as f } from "../CheckoutCurrency/CheckoutCurrency.js";
|
|
5
5
|
import { useCheckout as L } from "../CheckoutStateProvider/CheckoutStateProvider.js";
|
|
6
6
|
import { CheckSolid as x } from "../icons/CheckSolid.js";
|
|
7
7
|
const S = {
|
|
8
8
|
alreadyPaid: "Already paid",
|
|
9
|
-
cod: "
|
|
9
|
+
cod: "Remaining amount due before delivery",
|
|
10
10
|
downPayment: "Down payment",
|
|
11
11
|
dueLater: "Due later",
|
|
12
12
|
payImmediately: "Pay immediately",
|
|
13
13
|
postPaid: "Pay afterwards"
|
|
14
|
-
},
|
|
14
|
+
}, _ = (T) => {
|
|
15
15
|
const {
|
|
16
16
|
agreements: C = [],
|
|
17
17
|
currency: c,
|
|
@@ -34,7 +34,7 @@ const S = {
|
|
|
34
34
|
r > 0 && r < l && /* @__PURE__ */ n(p, { sx: { minHeight: 40 }, children: [
|
|
35
35
|
/* @__PURE__ */ n(m, { children: [
|
|
36
36
|
/* @__PURE__ */ t(
|
|
37
|
-
|
|
37
|
+
u,
|
|
38
38
|
{
|
|
39
39
|
sx: {
|
|
40
40
|
width: 16,
|
|
@@ -59,7 +59,7 @@ const S = {
|
|
|
59
59
|
}
|
|
60
60
|
)
|
|
61
61
|
] }),
|
|
62
|
-
/* @__PURE__ */ t(
|
|
62
|
+
/* @__PURE__ */ t(h, { sx: { pt: 0, pl: 1.5, pr: 0, pb: 0 }, children: /* @__PURE__ */ n(
|
|
63
63
|
y,
|
|
64
64
|
{
|
|
65
65
|
sx: {
|
|
@@ -89,7 +89,7 @@ const S = {
|
|
|
89
89
|
children: [
|
|
90
90
|
/* @__PURE__ */ n(m, { children: [
|
|
91
91
|
/* @__PURE__ */ t(
|
|
92
|
-
|
|
92
|
+
u,
|
|
93
93
|
{
|
|
94
94
|
sx: {
|
|
95
95
|
width: 16,
|
|
@@ -130,7 +130,7 @@ const S = {
|
|
|
130
130
|
}
|
|
131
131
|
)
|
|
132
132
|
] }),
|
|
133
|
-
/* @__PURE__ */ t(
|
|
133
|
+
/* @__PURE__ */ t(h, { sx: { pt: 0, pl: 1.5, pr: 0, pb: 0 }, children: /* @__PURE__ */ n(
|
|
134
134
|
y,
|
|
135
135
|
{
|
|
136
136
|
sx: {
|
|
@@ -169,7 +169,7 @@ const S = {
|
|
|
169
169
|
sx: { minHeight: b.length - 1 === o ? 48 : 64 },
|
|
170
170
|
children: [
|
|
171
171
|
/* @__PURE__ */ t(m, { children: /* @__PURE__ */ t(
|
|
172
|
-
|
|
172
|
+
u,
|
|
173
173
|
{
|
|
174
174
|
sx: {
|
|
175
175
|
...r >= l && r < l + (e.outcome?.amount || 0) ? {
|
|
@@ -211,7 +211,7 @@ const S = {
|
|
|
211
211
|
children: r >= l + (e.outcome?.amount || 0) && /* @__PURE__ */ t(x, {})
|
|
212
212
|
}
|
|
213
213
|
) }),
|
|
214
|
-
/* @__PURE__ */ t(
|
|
214
|
+
/* @__PURE__ */ t(h, { sx: { pt: 0, pl: 1.5, pr: 0, pb: 0 }, children: /* @__PURE__ */ n(
|
|
215
215
|
y,
|
|
216
216
|
{
|
|
217
217
|
sx: {
|
|
@@ -244,5 +244,5 @@ const S = {
|
|
|
244
244
|
] }) });
|
|
245
245
|
};
|
|
246
246
|
export {
|
|
247
|
-
|
|
247
|
+
_ as CheckoutAgreementsTimeline
|
|
248
248
|
};
|
|
@@ -6,7 +6,7 @@ declare const defaultTranslations: {
|
|
|
6
6
|
};
|
|
7
7
|
export interface CheckoutShippingMethodSectionProps extends Omit<CheckoutSectionProps, 'children'> {
|
|
8
8
|
countryCode: string;
|
|
9
|
-
postalCode
|
|
9
|
+
postalCode?: string;
|
|
10
10
|
translations?: DeepPartial<typeof defaultTranslations>;
|
|
11
11
|
}
|
|
12
12
|
export declare const CheckoutShippingMethodSection: (props: CheckoutShippingMethodSectionProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CheckoutShippingMethodSection.d.ts","sourceRoot":"","sources":["../../src/CheckoutShippingMethodSection/CheckoutShippingMethodSection.tsx"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,oBAAoB,EAC1B,MAAM,oCAAoC,CAAC;AAI5C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAE5C,QAAA,MAAM,mBAAmB;;;CAGxB,CAAC;AAEF,MAAM,WAAW,kCACf,SAAQ,IAAI,CAAC,oBAAoB,EAAE,UAAU,CAAC;IAC9C,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"CheckoutShippingMethodSection.d.ts","sourceRoot":"","sources":["../../src/CheckoutShippingMethodSection/CheckoutShippingMethodSection.tsx"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,oBAAoB,EAC1B,MAAM,oCAAoC,CAAC;AAI5C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAE5C,QAAA,MAAM,mBAAmB;;;CAGxB,CAAC;AAEF,MAAM,WAAW,kCACf,SAAQ,IAAI,CAAC,oBAAoB,EAAE,UAAU,CAAC;IAC9C,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,WAAW,CAAC,OAAO,mBAAmB,CAAC,CAAC;CACxD;AAED,eAAO,MAAM,6BAA6B,GACxC,OAAO,kCAAkC,qDA6B1C,CAAC"}
|
|
@@ -9,7 +9,7 @@ export interface CheckoutShippingMethodsFieldProps {
|
|
|
9
9
|
countryCode: string;
|
|
10
10
|
currency?: string;
|
|
11
11
|
locale?: string;
|
|
12
|
-
postalCode
|
|
12
|
+
postalCode?: string;
|
|
13
13
|
translations?: DeepPartial<typeof defaultTranslations>;
|
|
14
14
|
}
|
|
15
15
|
export declare const CheckoutShippingMethodsField: (props: CheckoutShippingMethodsFieldProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CheckoutShippingMethodsField.d.ts","sourceRoot":"","sources":["../../src/CheckoutShippingMethodsField/CheckoutShippingMethodsField.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,WAAW,EAAiB,MAAM,UAAU,CAAC;AAE3D,QAAA,MAAM,mBAAmB;;;;CAKxB,CAAC;AAEF,MAAM,WAAW,iCAAiC;IAChD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"CheckoutShippingMethodsField.d.ts","sourceRoot":"","sources":["../../src/CheckoutShippingMethodsField/CheckoutShippingMethodsField.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,WAAW,EAAiB,MAAM,UAAU,CAAC;AAE3D,QAAA,MAAM,mBAAmB;;;;CAKxB,CAAC;AAEF,MAAM,WAAW,iCAAiC;IAChD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,WAAW,CAAC,OAAO,mBAAmB,CAAC,CAAC;CACxD;AAED,eAAO,MAAM,4BAA4B,GACvC,OAAO,iCAAiC,qDAwIzC,CAAC"}
|
|
@@ -1,103 +1,104 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useFormContext as
|
|
3
|
-
import { CheckoutCardRadioField as
|
|
4
|
-
import { CheckoutShippingMethodOption as
|
|
5
|
-
import { useCheckoutShippingMethods as
|
|
6
|
-
import { useCheckout as
|
|
7
|
-
import { getErrorMessage as
|
|
8
|
-
import { capitalize as
|
|
9
|
-
import { CheckoutMethodRadioSkeleton as
|
|
10
|
-
const
|
|
1
|
+
import { jsx as j } from "react/jsx-runtime";
|
|
2
|
+
import { useFormContext as D } from "@afosto/components";
|
|
3
|
+
import { CheckoutCardRadioField as L } from "../CheckoutCardRadioField/CheckoutCardRadioField.js";
|
|
4
|
+
import { CheckoutShippingMethodOption as q } from "../CheckoutShippingMethodOption/CheckoutShippingMethodOption.js";
|
|
5
|
+
import { useCheckoutShippingMethods as A } from "../hooks/useCheckoutShippingMethods.js";
|
|
6
|
+
import { useCheckout as B } from "../CheckoutStateProvider/CheckoutStateProvider.js";
|
|
7
|
+
import { getErrorMessage as G } from "../utils/getErrorMessage.js";
|
|
8
|
+
import { capitalize as H } from "@afosto/utils";
|
|
9
|
+
import { CheckoutMethodRadioSkeleton as J } from "../CheckoutMethodRadioSkeleton/CheckoutMethodRadioSkeleton.js";
|
|
10
|
+
const K = {
|
|
11
11
|
failedToSearchPickupPoints: "Pickup points search failed. Please try again.",
|
|
12
12
|
failedToSelectShippingMethodTitle: "Shipping method not selected",
|
|
13
13
|
failedToSelectShippingMethodDescription: "Something went wrong while selecting the shipping method. Choose another shipping method or try again."
|
|
14
|
-
},
|
|
14
|
+
}, oi = (S) => {
|
|
15
15
|
const {
|
|
16
|
-
countryCode:
|
|
17
|
-
currency:
|
|
16
|
+
countryCode: f,
|
|
17
|
+
currency: k,
|
|
18
18
|
locale: M,
|
|
19
|
-
name:
|
|
20
|
-
postalCode:
|
|
21
|
-
translations:
|
|
22
|
-
} =
|
|
23
|
-
activeStep:
|
|
24
|
-
addShippingMethod:
|
|
25
|
-
isProcessing:
|
|
26
|
-
setErrorMessage:
|
|
19
|
+
name: p = "methodId",
|
|
20
|
+
postalCode: r,
|
|
21
|
+
translations: C = {}
|
|
22
|
+
} = S || {}, {
|
|
23
|
+
activeStep: a,
|
|
24
|
+
addShippingMethod: T,
|
|
25
|
+
isProcessing: w,
|
|
26
|
+
setErrorMessage: c,
|
|
27
27
|
setIsProcessing: n,
|
|
28
|
-
translations:
|
|
29
|
-
} =
|
|
30
|
-
hasSearchPickupPointsError:
|
|
31
|
-
isInitializingShippingMethods:
|
|
32
|
-
isSearchingPickupPoints:
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
...
|
|
43
|
-
...
|
|
44
|
-
...
|
|
28
|
+
translations: d
|
|
29
|
+
} = B(), {
|
|
30
|
+
hasSearchPickupPointsError: y,
|
|
31
|
+
isInitializingShippingMethods: I,
|
|
32
|
+
isSearchingPickupPoints: v,
|
|
33
|
+
loadPickupPointsForShippingMethod: E,
|
|
34
|
+
pickupPoints: h,
|
|
35
|
+
searchPickupPoints: F,
|
|
36
|
+
setPickupPoints: V,
|
|
37
|
+
shippingMethods: l
|
|
38
|
+
} = A({
|
|
39
|
+
countryCode: f,
|
|
40
|
+
postalCode: r
|
|
41
|
+
}), { formProps: x, getValues: O, reset: u, watch: z } = D(), { setData: R } = x || {}, [g] = z([p]), s = {
|
|
42
|
+
...K,
|
|
43
|
+
...d?.shippingMethodsField || {},
|
|
44
|
+
...d?.feedback || {},
|
|
45
|
+
...C || {}
|
|
45
46
|
};
|
|
46
|
-
return /* @__PURE__ */
|
|
47
|
-
|
|
47
|
+
return /* @__PURE__ */ j(
|
|
48
|
+
L,
|
|
48
49
|
{
|
|
49
50
|
id: "field-radio-shipping-method",
|
|
50
|
-
name:
|
|
51
|
-
isLoading:
|
|
52
|
-
onChange: async (
|
|
53
|
-
const
|
|
51
|
+
name: p,
|
|
52
|
+
isLoading: I,
|
|
53
|
+
onChange: async (i) => {
|
|
54
|
+
const P = O(), b = [...h];
|
|
54
55
|
try {
|
|
55
|
-
|
|
56
|
-
const { value:
|
|
57
|
-
(t) => t.id ===
|
|
56
|
+
c(null), n(!0);
|
|
57
|
+
const { value: o } = i.target, e = l.find(
|
|
58
|
+
(t) => t.id === o
|
|
58
59
|
);
|
|
59
|
-
await
|
|
60
|
-
const
|
|
61
|
-
methodId:
|
|
62
|
-
isPickupPoint:
|
|
60
|
+
await T({ methodId: o }), E(e);
|
|
61
|
+
const m = {
|
|
62
|
+
methodId: o,
|
|
63
|
+
isPickupPoint: e?.isPickupPoint,
|
|
63
64
|
pickupPointId: ""
|
|
64
65
|
};
|
|
65
|
-
|
|
66
|
-
...
|
|
67
|
-
...
|
|
68
|
-
}),
|
|
69
|
-
...t[
|
|
70
|
-
...
|
|
66
|
+
u({
|
|
67
|
+
...P,
|
|
68
|
+
...m
|
|
69
|
+
}), R((t) => (t?.splice(a, 1, {
|
|
70
|
+
...t[a],
|
|
71
|
+
...m
|
|
71
72
|
}), t)), n(!1);
|
|
72
|
-
} catch (
|
|
73
|
-
const
|
|
74
|
-
|
|
75
|
-
title:
|
|
76
|
-
description:
|
|
77
|
-
}),
|
|
73
|
+
} catch (o) {
|
|
74
|
+
const e = G(o);
|
|
75
|
+
c({
|
|
76
|
+
title: s.failedToSelectShippingMethodTitle,
|
|
77
|
+
description: e ? H(e) : s.failedToSelectShippingMethodDescription
|
|
78
|
+
}), u(P), V(b), n(!1), window && typeof window < "u" && window.scrollTo(0, 0);
|
|
78
79
|
}
|
|
79
80
|
},
|
|
80
|
-
OptionComponent:
|
|
81
|
-
OptionSkeletonComponent:
|
|
82
|
-
options:
|
|
83
|
-
...
|
|
84
|
-
value:
|
|
85
|
-
...
|
|
86
|
-
pickupPoints:
|
|
81
|
+
OptionComponent: q,
|
|
82
|
+
OptionSkeletonComponent: J,
|
|
83
|
+
options: l.map((i) => ({
|
|
84
|
+
...i,
|
|
85
|
+
value: i.id,
|
|
86
|
+
...g === i.id ? {
|
|
87
|
+
pickupPoints: h
|
|
87
88
|
} : {}
|
|
88
89
|
})),
|
|
89
90
|
optionProps: {
|
|
90
|
-
currency:
|
|
91
|
-
defaultPickupPointSearchValue:
|
|
92
|
-
isSearchingPickupPoints:
|
|
91
|
+
currency: k,
|
|
92
|
+
defaultPickupPointSearchValue: r,
|
|
93
|
+
isSearchingPickupPoints: w || v,
|
|
93
94
|
locale: M,
|
|
94
|
-
onSearchPickupPoint:
|
|
95
|
-
searchPickupPointsErrorMessage:
|
|
95
|
+
onSearchPickupPoint: F,
|
|
96
|
+
searchPickupPointsErrorMessage: y ? s.failedToSearchPickupPoints : void 0
|
|
96
97
|
},
|
|
97
|
-
value:
|
|
98
|
+
value: g
|
|
98
99
|
}
|
|
99
100
|
);
|
|
100
101
|
};
|
|
101
102
|
export {
|
|
102
|
-
|
|
103
|
+
oi as CheckoutShippingMethodsField
|
|
103
104
|
};
|
|
@@ -47,5 +47,14 @@ export declare const CHECKOUT_PAYMENT_METHOD_ICON_MAPPING: {
|
|
|
47
47
|
twint: (props: import('@afosto/components').SvgIconProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
48
48
|
walley: (props: import('@afosto/components').SvgIconProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
49
49
|
zip: (props: import('@afosto/components').SvgIconProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
50
|
+
alma: (props: import('@afosto/components').SvgIconProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
51
|
+
bancomatPay: (props: import('@afosto/components').SvgIconProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
52
|
+
bizum: (props: import('@afosto/components').SvgIconProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
53
|
+
blik: (props: import('@afosto/components').SvgIconProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
54
|
+
clickToPay: (props: import('@afosto/components').SvgIconProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
55
|
+
mbWay: (props: import('@afosto/components').SvgIconProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
56
|
+
mobilepay: (props: import('@afosto/components').SvgIconProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
57
|
+
satispay: (props: import('@afosto/components').SvgIconProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
58
|
+
vipps: (props: import('@afosto/components').SvgIconProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
50
59
|
};
|
|
51
60
|
//# sourceMappingURL=paymentMethodIconMapping.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paymentMethodIconMapping.d.ts","sourceRoot":"","sources":["../../src/constants/paymentMethodIconMapping.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"paymentMethodIconMapping.d.ts","sourceRoot":"","sources":["../../src/constants/paymentMethodIconMapping.ts"],"names":[],"mappings":"AAsDA,eAAO,MAAM,oCAAoC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0DhD,CAAC"}
|
|
@@ -7,91 +7,109 @@ import { CashOnDelivery as f } from "../icons/paymentMethods/CashOnDelivery.js";
|
|
|
7
7
|
import { Spraypay as e } from "../icons/paymentMethods/Spraypay.js";
|
|
8
8
|
import { Klarna as r } from "../icons/paymentMethods/Klarna.js";
|
|
9
9
|
import { PayPal as o } from "../icons/paymentMethods/PayPal.js";
|
|
10
|
-
import { Bancontact as
|
|
11
|
-
import { Paysafe as
|
|
12
|
-
import { Giropay as
|
|
13
|
-
import { Postepay as
|
|
10
|
+
import { Bancontact as l } from "../icons/paymentMethods/Bancontact.js";
|
|
11
|
+
import { Paysafe as n } from "../icons/paymentMethods/Paysafe.js";
|
|
12
|
+
import { Giropay as y } from "../icons/paymentMethods/Giropay.js";
|
|
13
|
+
import { Postepay as c } from "../icons/paymentMethods/Postepay.js";
|
|
14
14
|
import { CarteBleue as s } from "../icons/paymentMethods/CarteBleue.js";
|
|
15
15
|
import { Afterpay as u } from "../icons/paymentMethods/Afterpay.js";
|
|
16
16
|
import { WebshopGiftcard as d } from "../icons/paymentMethods/WebshopGiftcard.js";
|
|
17
|
-
import { Fashioncheque as
|
|
18
|
-
import { PodiumCadeaukaart as
|
|
19
|
-
import { YourGift as
|
|
20
|
-
import { Giftcard as
|
|
21
|
-
import { GivaCard as
|
|
22
|
-
import { VVVCadeaukaart as
|
|
17
|
+
import { Fashioncheque as P } from "../icons/paymentMethods/Fashioncheque.js";
|
|
18
|
+
import { PodiumCadeaukaart as b } from "../icons/paymentMethods/PodiumCadeaukaart.js";
|
|
19
|
+
import { YourGift as C } from "../icons/paymentMethods/YourGift.js";
|
|
20
|
+
import { Giftcard as k } from "../icons/paymentMethods/Giftcard.js";
|
|
21
|
+
import { GivaCard as B } from "../icons/paymentMethods/GivaCard.js";
|
|
22
|
+
import { VVVCadeaukaart as h } from "../icons/paymentMethods/VVVCadeaukaart.js";
|
|
23
23
|
import { WeChat as g } from "../icons/paymentMethods/WeChat.js";
|
|
24
|
-
import { Alipay as
|
|
25
|
-
import { Payconiq as
|
|
24
|
+
import { Alipay as v } from "../icons/paymentMethods/Alipay.js";
|
|
25
|
+
import { Payconiq as w } from "../icons/paymentMethods/Payconiq.js";
|
|
26
26
|
import { Multibanco as G } from "../icons/paymentMethods/Multibanco.js";
|
|
27
|
-
import { EPSUberweisung as
|
|
28
|
-
import { Przelewy24 as
|
|
27
|
+
import { EPSUberweisung as T } from "../icons/paymentMethods/EPSUberweisung.js";
|
|
28
|
+
import { Przelewy24 as A } from "../icons/paymentMethods/Przelewy24.js";
|
|
29
29
|
import { Billink as M } from "../icons/paymentMethods/Billink.js";
|
|
30
30
|
import { In3 as O } from "../icons/paymentMethods/In3.js";
|
|
31
|
-
import { Interac as
|
|
32
|
-
import { Cash as
|
|
33
|
-
import { ManualGiftCard as
|
|
34
|
-
import { ManualCard as
|
|
35
|
-
import { Pin as
|
|
36
|
-
import { ApplePay as
|
|
37
|
-
import { GooglePay as
|
|
38
|
-
import { Bank as
|
|
39
|
-
import { Riverty as
|
|
40
|
-
import { Twint as
|
|
41
|
-
import { Walley as
|
|
42
|
-
import { Zip as
|
|
43
|
-
import { Belfius as
|
|
44
|
-
import { Kbc as
|
|
45
|
-
|
|
31
|
+
import { Interac as W } from "../icons/paymentMethods/Interac.js";
|
|
32
|
+
import { Cash as z } from "../icons/paymentMethods/Cash.js";
|
|
33
|
+
import { ManualGiftCard as E } from "../icons/paymentMethods/ManualGiftCard.js";
|
|
34
|
+
import { ManualCard as I } from "../icons/paymentMethods/ManualCard.js";
|
|
35
|
+
import { Pin as q } from "../icons/paymentMethods/Pin.js";
|
|
36
|
+
import { ApplePay as D } from "../icons/paymentMethods/ApplePay.js";
|
|
37
|
+
import { GooglePay as N } from "../icons/paymentMethods/GooglePay.js";
|
|
38
|
+
import { Bank as V } from "../icons/paymentMethods/Bank.js";
|
|
39
|
+
import { Riverty as _ } from "../icons/paymentMethods/Riverty.js";
|
|
40
|
+
import { Twint as K } from "../icons/paymentMethods/Twint.js";
|
|
41
|
+
import { Walley as S } from "../icons/paymentMethods/Walley.js";
|
|
42
|
+
import { Zip as U } from "../icons/paymentMethods/Zip.js";
|
|
43
|
+
import { Belfius as x } from "../icons/paymentMethods/Belfius.js";
|
|
44
|
+
import { Kbc as H } from "../icons/paymentMethods/Kbc.js";
|
|
45
|
+
import { Alma as Y } from "../icons/paymentMethods/Alma.js";
|
|
46
|
+
import { Bancomat as F } from "../icons/paymentMethods/Bancomat.js";
|
|
47
|
+
import { Bizum as R } from "../icons/paymentMethods/Bizum.js";
|
|
48
|
+
import { Blik as Z } from "../icons/paymentMethods/Blik.js";
|
|
49
|
+
import { ClickToPay as j } from "../icons/paymentMethods/ClickToPay.js";
|
|
50
|
+
import { MBWay as J } from "../icons/paymentMethods/MBWay.js";
|
|
51
|
+
import { MobilePay as L } from "../icons/paymentMethods/MobilePay.js";
|
|
52
|
+
import { Satispay as Q } from "../icons/paymentMethods/Satispay.js";
|
|
53
|
+
import { Vipps as X } from "../icons/paymentMethods/Vipps.js";
|
|
54
|
+
const Xr = {
|
|
46
55
|
ideal: m,
|
|
47
56
|
card: i,
|
|
48
57
|
bacsDirectDebit: a,
|
|
49
58
|
bankTransfer: t,
|
|
50
|
-
belfius:
|
|
51
|
-
kbc:
|
|
59
|
+
belfius: x,
|
|
60
|
+
kbc: H,
|
|
52
61
|
onAccount: p,
|
|
53
62
|
cod: f,
|
|
54
63
|
spraypay: e,
|
|
55
64
|
sofort: r,
|
|
56
65
|
paypalExpress: o,
|
|
57
66
|
paypal: o,
|
|
58
|
-
mistercashBancontact:
|
|
59
|
-
paysafecard:
|
|
60
|
-
giftCard:
|
|
61
|
-
giropay:
|
|
62
|
-
postepay:
|
|
67
|
+
mistercashBancontact: l,
|
|
68
|
+
paysafecard: n,
|
|
69
|
+
giftCard: k,
|
|
70
|
+
giropay: y,
|
|
71
|
+
postepay: c,
|
|
63
72
|
carteBleue: s,
|
|
64
73
|
afterpay: u,
|
|
65
74
|
webshopgiftcard: d,
|
|
66
|
-
fashioncheque:
|
|
67
|
-
podiumcadeaukaart:
|
|
68
|
-
yourgift:
|
|
69
|
-
givacard:
|
|
70
|
-
vvvCadeaukaart:
|
|
75
|
+
fashioncheque: P,
|
|
76
|
+
podiumcadeaukaart: b,
|
|
77
|
+
yourgift: C,
|
|
78
|
+
givacard: B,
|
|
79
|
+
vvvCadeaukaart: h,
|
|
71
80
|
wechatPay: g,
|
|
72
|
-
alipay:
|
|
73
|
-
payconiq:
|
|
81
|
+
alipay: v,
|
|
82
|
+
payconiq: w,
|
|
74
83
|
multibanco: G,
|
|
75
|
-
epsUberweisung:
|
|
76
|
-
przelewy24:
|
|
84
|
+
epsUberweisung: T,
|
|
85
|
+
przelewy24: A,
|
|
77
86
|
billink: M,
|
|
78
87
|
klarna: r,
|
|
79
88
|
klarnaNow: r,
|
|
80
89
|
klarnaOverTime: r,
|
|
81
90
|
in3: O,
|
|
82
|
-
interac:
|
|
83
|
-
cash:
|
|
84
|
-
manualGiftCard:
|
|
85
|
-
manualCard:
|
|
86
|
-
pin:
|
|
87
|
-
applePay:
|
|
88
|
-
googleWallet:
|
|
89
|
-
payByBank:
|
|
90
|
-
riverty:
|
|
91
|
-
twint:
|
|
92
|
-
walley:
|
|
93
|
-
zip:
|
|
91
|
+
interac: W,
|
|
92
|
+
cash: z,
|
|
93
|
+
manualGiftCard: E,
|
|
94
|
+
manualCard: I,
|
|
95
|
+
pin: q,
|
|
96
|
+
applePay: D,
|
|
97
|
+
googleWallet: N,
|
|
98
|
+
payByBank: V,
|
|
99
|
+
riverty: _,
|
|
100
|
+
twint: K,
|
|
101
|
+
walley: S,
|
|
102
|
+
zip: U,
|
|
103
|
+
alma: Y,
|
|
104
|
+
bancomatPay: F,
|
|
105
|
+
bizum: R,
|
|
106
|
+
blik: Z,
|
|
107
|
+
clickToPay: j,
|
|
108
|
+
mbWay: J,
|
|
109
|
+
mobilepay: L,
|
|
110
|
+
satispay: Q,
|
|
111
|
+
vipps: X
|
|
94
112
|
};
|
|
95
113
|
export {
|
|
96
|
-
|
|
114
|
+
Xr as CHECKOUT_PAYMENT_METHOD_ICON_MAPPING
|
|
97
115
|
};
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { CheckoutShippingMethodOptionType, CheckoutShippingMethodPickupPoint } from '../types';
|
|
2
2
|
export declare const useCheckoutShippingMethods: ({ countryCode, postalCode }: {
|
|
3
3
|
countryCode: string;
|
|
4
|
-
postalCode
|
|
4
|
+
postalCode?: string;
|
|
5
5
|
}) => {
|
|
6
6
|
hasSearchPickupPointsError: boolean;
|
|
7
7
|
isInitializingShippingMethods: boolean;
|
|
8
8
|
isSearchingPickupPoints: boolean;
|
|
9
|
+
loadPickupPointsForShippingMethod: (shippingMethod?: CheckoutShippingMethodOptionType) => void;
|
|
9
10
|
pickupPoints: CheckoutShippingMethodPickupPoint[];
|
|
10
11
|
searchPickupPoints: (...args: unknown[]) => Promise<void>;
|
|
11
12
|
setPickupPoints: import('react').Dispatch<import('react').SetStateAction<CheckoutShippingMethodPickupPoint[]>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCheckoutShippingMethods.d.ts","sourceRoot":"","sources":["../../src/hooks/useCheckoutShippingMethods.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useCheckoutShippingMethods.d.ts","sourceRoot":"","sources":["../../src/hooks/useCheckoutShippingMethods.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EACV,gCAAgC,EAChC,iCAAiC,EAClC,MAAM,UAAU,CAAC;AAGlB,eAAO,MAAM,0BAA0B,GAAI,6BAGxC;IACD,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;;;;yDA0FqB,gCAAgC;;;;;CAkIrD,CAAC"}
|