@afosto/checkout-ui 0.0.5 → 0.0.7
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CheckoutPaymentMethodOption.d.ts","sourceRoot":"","sources":["../../src/CheckoutPaymentMethodOption/CheckoutPaymentMethodOption.tsx"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,6BAA6B,EACnC,MAAM,sDAAsD,CAAC;AAG9D,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"CheckoutPaymentMethodOption.d.ts","sourceRoot":"","sources":["../../src/CheckoutPaymentMethodOption/CheckoutPaymentMethodOption.tsx"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,6BAA6B,EACnC,MAAM,sDAAsD,CAAC;AAG9D,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,UAAU,CAAC;AAKhE,MAAM,WAAW,gCAAgC;IAC/C,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,6BAA6B,CAAC,UAAU,CAAC,CAAC;IACpD,MAAM,EAAE,+BAA+B,CAAC;CACzC;AAED,eAAO,MAAM,2BAA2B,GACtC,OAAO,gCAAgC,qDAwCxC,CAAC"}
|
|
@@ -4,8 +4,11 @@ import { Collapse as r, Box as t } from "@afosto/components";
|
|
|
4
4
|
import { CHECKOUT_PAYMENT_METHOD_ICON_MAPPING as h } from "../constants/paymentMethodIconMapping.js";
|
|
5
5
|
import { CheckoutIssuersField as a } from "../CheckoutIssuersField/CheckoutIssuersField.js";
|
|
6
6
|
import { CheckoutTerminalsField as u } from "../CheckoutTerminalsField/CheckoutTerminalsField.js";
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
import { camelize as C } from "@afosto/utils";
|
|
8
|
+
const P = (n) => {
|
|
9
|
+
const { active: o, currency: s, locale: c, onChange: l, option: e } = n || {}, m = h[C(
|
|
10
|
+
e.code?.toLowerCase() || ""
|
|
11
|
+
)];
|
|
9
12
|
return /* @__PURE__ */ p(
|
|
10
13
|
d,
|
|
11
14
|
{
|
|
@@ -27,5 +30,5 @@ const I = (n) => {
|
|
|
27
30
|
);
|
|
28
31
|
};
|
|
29
32
|
export {
|
|
30
|
-
|
|
33
|
+
P as CheckoutPaymentMethodOption
|
|
31
34
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"informationStep.d.ts","sourceRoot":"","sources":["../../src/steps/informationStep.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,KAAK,EACV,aAAa,EACb,YAAY,IAAI,gBAAgB,EAEjC,MAAM,UAAU,CAAC;AAClB,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,4CAA4C,CAAC;AAMjG,MAAM,WAAW,6BAA6B;IAC5C,IAAI,EAAE,UAAU,GAAG,SAAS,CAAC;IAC7B,OAAO,EAAE,8BAA8B,GAAG,IAAI,CAAC;IAC/C,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,OAAO,CAAC;IACpB,YAAY,EAAE;QACZ,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAAE,MAAM,CAAC;QACb,SAAS,EAAE,MAAM,CAAC;QAClB,IAAI,EAAE,MAAM,CAAC;QACb,SAAS,EAAE,MAAM,CAAC;QAClB,gBAAgB,EAAE,aAAa,GAAG,IAAI,CAAC;KACxC,CAAC;IACF,QAAQ,EAAE,MAAM,CAAC;IACjB,eAAe,EAAE,MAAM,CAAC;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,kBAAkB,EAAE,aAAa,GAAG,IAAI,CAAC;IACzC,aAAa,EAAE,MAAM,CAAC;IACtB,kBAAkB,EAAE,OAAO,CAAC;IAC5B,4BAA4B,EAAE,OAAO,CAAC;IACtC,QAAQ,EAAE,aAAa,CAAC;IACxB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,OAAO,EAAE,aAAa,CAAC;IACvB,gBAAgB,EAAE,MAAM,CAAC;IACzB,mBAAmB,EAAE,OAAO,CAAC;CAC9B;AAYD,eAAO,MAAM,eAAe,EAAE,gBAAgB,CAAC,6BAA6B,
|
|
1
|
+
{"version":3,"file":"informationStep.d.ts","sourceRoot":"","sources":["../../src/steps/informationStep.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,KAAK,EACV,aAAa,EACb,YAAY,IAAI,gBAAgB,EAEjC,MAAM,UAAU,CAAC;AAClB,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,4CAA4C,CAAC;AAMjG,MAAM,WAAW,6BAA6B;IAC5C,IAAI,EAAE,UAAU,GAAG,SAAS,CAAC;IAC7B,OAAO,EAAE,8BAA8B,GAAG,IAAI,CAAC;IAC/C,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,OAAO,CAAC;IACpB,YAAY,EAAE;QACZ,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAAE,MAAM,CAAC;QACb,SAAS,EAAE,MAAM,CAAC;QAClB,IAAI,EAAE,MAAM,CAAC;QACb,SAAS,EAAE,MAAM,CAAC;QAClB,gBAAgB,EAAE,aAAa,GAAG,IAAI,CAAC;KACxC,CAAC;IACF,QAAQ,EAAE,MAAM,CAAC;IACjB,eAAe,EAAE,MAAM,CAAC;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,kBAAkB,EAAE,aAAa,GAAG,IAAI,CAAC;IACzC,aAAa,EAAE,MAAM,CAAC;IACtB,kBAAkB,EAAE,OAAO,CAAC;IAC5B,4BAA4B,EAAE,OAAO,CAAC;IACtC,QAAQ,EAAE,aAAa,CAAC;IACxB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,OAAO,EAAE,aAAa,CAAC;IACvB,gBAAgB,EAAE,MAAM,CAAC;IACzB,mBAAmB,EAAE,OAAO,CAAC;CAC9B;AAYD,eAAO,MAAM,eAAe,EAAE,gBAAgB,CAAC,6BAA6B,CAqjCzE,CAAC"}
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { CheckoutInformationStep as
|
|
1
|
+
import { CheckoutInformationStep as ni } from "../CheckoutInformationStep/CheckoutInformationStep.js";
|
|
2
2
|
import { addressDefaultValues as q } from "../constants/addressDefaultValues.js";
|
|
3
3
|
import { formatAddressResponse as j } from "../utils/formatAddressResponse.js";
|
|
4
|
-
import { getErrorMessage as
|
|
5
|
-
import { capitalize as
|
|
4
|
+
import { getErrorMessage as W } from "../utils/getErrorMessage.js";
|
|
5
|
+
import { capitalize as X, isDefined as D } from "@afosto/utils";
|
|
6
6
|
import * as u from "yup";
|
|
7
|
-
import { formatUpdateAccountInformationPayload as
|
|
8
|
-
import { formatUpdateOrganisationOnAccountPayload as
|
|
9
|
-
import { setupCustomValidationRules as
|
|
10
|
-
import { formatInformationStepPayload as
|
|
11
|
-
|
|
12
|
-
const
|
|
7
|
+
import { formatUpdateAccountInformationPayload as si } from "../utils/formatUpdateAccountInformationPayload.js";
|
|
8
|
+
import { formatUpdateOrganisationOnAccountPayload as ri } from "../utils/formatUpdateOrganisationOnAccountPayload.js";
|
|
9
|
+
import { setupCustomValidationRules as ti } from "../utils/setupCustomValidationRules.js";
|
|
10
|
+
import { formatInformationStepPayload as oi } from "../utils/formatInformationStepPayload.js";
|
|
11
|
+
ti();
|
|
12
|
+
const ai = {
|
|
13
13
|
signUpFailedTitle: "Sign up failed",
|
|
14
14
|
signUpFailedDescription: "Failed to create an account. Try again or continue as guest.",
|
|
15
15
|
signUpFailedActionLabel: "Continue as guest",
|
|
16
16
|
informationStepErrorTitle: "Could not process information",
|
|
17
17
|
informationStepErrorDescription: "Something went wrong while processing the contact and address information. Please check your input and try again."
|
|
18
|
-
},
|
|
18
|
+
}, yi = {
|
|
19
19
|
key: "information",
|
|
20
20
|
label: "Information",
|
|
21
|
-
component:
|
|
21
|
+
component: ni,
|
|
22
22
|
reviewTargets: [
|
|
23
23
|
"contactDetails",
|
|
24
24
|
"businessDetails",
|
|
@@ -26,7 +26,7 @@ const si = {
|
|
|
26
26
|
"billingAddress"
|
|
27
27
|
],
|
|
28
28
|
defaultValues: (S) => {
|
|
29
|
-
const { defaultCountry: a, formatCountryAsOption: v, settings:
|
|
29
|
+
const { defaultCountry: a, formatCountryAsOption: v, settings: O } = S || {}, { isB2cExcluded: y, isSharedOrganisationRequired: s } = O || {};
|
|
30
30
|
return {
|
|
31
31
|
type: y ? "business" : "private",
|
|
32
32
|
contact: null,
|
|
@@ -64,13 +64,13 @@ const si = {
|
|
|
64
64
|
},
|
|
65
65
|
initialize: (S, a, v) => {
|
|
66
66
|
const {
|
|
67
|
-
defaultCountry:
|
|
67
|
+
defaultCountry: O,
|
|
68
68
|
formatCountryAsOption: y,
|
|
69
69
|
getCountryByCode: s,
|
|
70
70
|
settings: f,
|
|
71
71
|
step: g
|
|
72
72
|
} = v || {}, { defaultValues: C } = g || {}, { addressOptions: B } = a || {}, { countryCode: N } = B || {}, { isB2bExcluded: U, isB2cExcluded: $ } = f || {}, n = typeof C == "function" ? C(v) : C, {
|
|
73
|
-
billing:
|
|
73
|
+
billing: M,
|
|
74
74
|
customer: e,
|
|
75
75
|
delivery: m,
|
|
76
76
|
expressPayment: b,
|
|
@@ -80,23 +80,31 @@ const si = {
|
|
|
80
80
|
contact: t,
|
|
81
81
|
countryCode: d,
|
|
82
82
|
organisation: r
|
|
83
|
-
} = e || {}, { address: A } =
|
|
83
|
+
} = e || {}, { address: A } = M || {}, { address: P } = m || {}, { address: E, customer: p } = b?.details?.express || {}, { shipping: x } = i || {}, { countries: V } = x || {}, I = s(N) || O, R = s(d), c = !!r?.id && !U || $, _ = c ? r?.phoneNumbers?.primary : t?.phoneNumbers?.primary, w = s(
|
|
84
84
|
o?.countryCode || _?.countryCode
|
|
85
|
-
) || R || I || null, [L] = w?.callingCodes || [], k = (
|
|
85
|
+
) || R || I || null, [L] = w?.callingCodes || [], k = (D(o?.number) ? o.number : _?.number || n.phoneNumber).replace(`+${L}`, ""), T = c ? r?.addressing?.shipping?.primary : t?.addressing?.shipping?.primary, l = j(
|
|
86
86
|
P?.addressLine1 ? P : E || T || {}
|
|
87
87
|
);
|
|
88
|
-
let
|
|
88
|
+
let G = null;
|
|
89
89
|
if (R && V?.includes(R?.alpha2Code))
|
|
90
|
-
|
|
90
|
+
G = R;
|
|
91
91
|
else if (I && V?.includes(I?.alpha2Code))
|
|
92
|
-
|
|
92
|
+
G = I;
|
|
93
93
|
else {
|
|
94
|
-
const [
|
|
95
|
-
|
|
94
|
+
const [ei] = V || [];
|
|
95
|
+
G = s(ei);
|
|
96
96
|
}
|
|
97
|
-
const
|
|
98
|
-
|
|
99
|
-
|
|
97
|
+
const J = s(l?.countryCode) || G, F = D(J) ? y(J) : n.shipping.country, z = l?.administrativeArea || n.shipping.administrativeArea, Y = z && typeof z == "string" ? {
|
|
98
|
+
code: z,
|
|
99
|
+
label: z,
|
|
100
|
+
value: z
|
|
101
|
+
} : z, Z = c ? r?.addressing?.billing?.primary : t?.addressing?.billing?.primary, h = j(
|
|
102
|
+
A?.addressLine1 ? A : Z || {}
|
|
103
|
+
), K = s(h?.countryCode) || I, Q = D(K) ? y(K) : n.billing.country, H = h?.administrativeArea || n.billing.administrativeArea, ii = H && typeof H == "string" ? {
|
|
104
|
+
code: H,
|
|
105
|
+
label: H,
|
|
106
|
+
value: H
|
|
107
|
+
} : H;
|
|
100
108
|
return {
|
|
101
109
|
...n,
|
|
102
110
|
defaultCountry: y(I),
|
|
@@ -119,7 +127,7 @@ const si = {
|
|
|
119
127
|
}
|
|
120
128
|
},
|
|
121
129
|
phoneNumber: k,
|
|
122
|
-
phoneNumberCountry:
|
|
130
|
+
phoneNumberCountry: D(w) ? y(w) : n.phoneNumberCountry,
|
|
123
131
|
phoneNumberId: o?.id || _?.id || n.phoneNumberId,
|
|
124
132
|
shipping: {
|
|
125
133
|
...n.shipping,
|
|
@@ -138,7 +146,7 @@ const si = {
|
|
|
138
146
|
premiseNumberSuffix: l?.premiseNumberSuffix || n.shipping.premiseNumberSuffix,
|
|
139
147
|
thoroughfare: l?.thoroughfare || n.shipping.thoroughfare,
|
|
140
148
|
locality: l?.locality || n.shipping.locality,
|
|
141
|
-
administrativeArea:
|
|
149
|
+
administrativeArea: Y
|
|
142
150
|
},
|
|
143
151
|
shippingAddressId: l?.id || n.shippingAddressId,
|
|
144
152
|
billing: {
|
|
@@ -150,25 +158,25 @@ const si = {
|
|
|
150
158
|
address_line_2: h?.address_line_2 || n.billing.address_line_2,
|
|
151
159
|
addressLine1: h?.addressLine1 || n.billing.addressLine1,
|
|
152
160
|
addressLine2: h?.addressLine2 || n.billing.addressLine2,
|
|
153
|
-
country:
|
|
154
|
-
countryCode:
|
|
161
|
+
country: Q,
|
|
162
|
+
countryCode: Q?.value || n.billing.countryCode,
|
|
155
163
|
organisation: h?.organisation || n.billing.organisation,
|
|
156
164
|
postalCode: h?.postalCode || n.billing.postalCode,
|
|
157
165
|
premiseNumber: h?.premiseNumber || n.billing.premiseNumber,
|
|
158
166
|
premiseNumberSuffix: h?.premiseNumberSuffix || n.billing.premiseNumberSuffix,
|
|
159
167
|
thoroughfare: h?.thoroughfare || n.billing.thoroughfare,
|
|
160
168
|
locality: h?.locality || n.billing.locality,
|
|
161
|
-
administrativeArea:
|
|
169
|
+
administrativeArea: ii
|
|
162
170
|
},
|
|
163
171
|
billingAddressId: h?.id || n.billingAddressId,
|
|
164
|
-
sameBillingAsShippingAddress:
|
|
172
|
+
sameBillingAsShippingAddress: D(h?.id) && D(l?.id) ? h?.id === l?.id : n.sameBillingAsShippingAddress
|
|
165
173
|
};
|
|
166
174
|
},
|
|
167
175
|
isComplete: (S, a) => {
|
|
168
176
|
const { step: v } = a || {};
|
|
169
177
|
return v.validationSchema(a).isValidSync(S);
|
|
170
178
|
},
|
|
171
|
-
onEvent: async (S, a, v,
|
|
179
|
+
onEvent: async (S, a, v, O) => {
|
|
172
180
|
const { step: y, stepIndex: s } = v || {}, {
|
|
173
181
|
activeStep: f,
|
|
174
182
|
addCustomer: g,
|
|
@@ -176,7 +184,7 @@ const si = {
|
|
|
176
184
|
formatCountryAsOption: B,
|
|
177
185
|
getCountryByCode: N,
|
|
178
186
|
settings: U
|
|
179
|
-
} =
|
|
187
|
+
} = O || {}, { isB2bExcluded: $, isB2cExcluded: n } = U || {}, M = C.current?.formProps?.data || [], e = f === s ? C.current?.getValues() : M[s] ?? {}, m = typeof y.defaultValues == "function" ? y.defaultValues(O) : y.defaultValues;
|
|
180
188
|
if (S === "signedIn") {
|
|
181
189
|
const { user: b, account: i } = a || {};
|
|
182
190
|
let o = e?.contact;
|
|
@@ -193,7 +201,7 @@ const si = {
|
|
|
193
201
|
id: _,
|
|
194
202
|
isValid: w,
|
|
195
203
|
...L
|
|
196
|
-
} = c || {}, k = L?.countryCode ? B(N(L.countryCode)) : e?.defaultCountry, T = !$ && r?.id || n, l = T && r?.administration?.email || i?.email,
|
|
204
|
+
} = c || {}, k = L?.countryCode ? B(N(L.countryCode)) : e?.defaultCountry, T = !$ && r?.id || n, l = T && r?.administration?.email || i?.email, J = {
|
|
197
205
|
...e,
|
|
198
206
|
...m || {},
|
|
199
207
|
contact: o,
|
|
@@ -253,14 +261,14 @@ const si = {
|
|
|
253
261
|
country: e.defaultCountry
|
|
254
262
|
},
|
|
255
263
|
shippingAddressId: x || "",
|
|
256
|
-
sameBillingAsShippingAddress:
|
|
264
|
+
sameBillingAsShippingAddress: D(_) || D(_) && _ === x
|
|
257
265
|
};
|
|
258
266
|
i && (f === s && C.current?.reset({
|
|
259
267
|
...e,
|
|
260
|
-
...
|
|
268
|
+
...J
|
|
261
269
|
}), C.current?.formProps?.setData((F) => (F.splice(s, 1, {
|
|
262
270
|
...F[s],
|
|
263
|
-
...
|
|
271
|
+
...J
|
|
264
272
|
}), F)));
|
|
265
273
|
}
|
|
266
274
|
if (S === "clearSession") {
|
|
@@ -353,7 +361,7 @@ const si = {
|
|
|
353
361
|
country: e.defaultCountry
|
|
354
362
|
},
|
|
355
363
|
shippingAddressId: p || "",
|
|
356
|
-
sameBillingAsShippingAddress: !
|
|
364
|
+
sameBillingAsShippingAddress: !D(c) || D(c) && c === p
|
|
357
365
|
};
|
|
358
366
|
f === s && C.current?.reset({
|
|
359
367
|
...e,
|
|
@@ -445,7 +453,7 @@ const si = {
|
|
|
445
453
|
country: e.defaultCountry
|
|
446
454
|
},
|
|
447
455
|
shippingAddressId: p || "",
|
|
448
|
-
sameBillingAsShippingAddress: !
|
|
456
|
+
sameBillingAsShippingAddress: !D(d) || D(d) && d === p
|
|
449
457
|
}), C.current?.formProps?.setData((L) => (L.splice(s, 1, {
|
|
450
458
|
...L[s],
|
|
451
459
|
...w
|
|
@@ -454,7 +462,7 @@ const si = {
|
|
|
454
462
|
},
|
|
455
463
|
submit: async (S, a, v) => {
|
|
456
464
|
const {
|
|
457
|
-
activeStep:
|
|
465
|
+
activeStep: O,
|
|
458
466
|
addInformation: y,
|
|
459
467
|
currentOrganisation: s,
|
|
460
468
|
formRef: f,
|
|
@@ -465,15 +473,15 @@ const si = {
|
|
|
465
473
|
setErrorMessage: U,
|
|
466
474
|
signUp: $,
|
|
467
475
|
translations: n = {},
|
|
468
|
-
updateAccountInformation:
|
|
476
|
+
updateAccountInformation: M,
|
|
469
477
|
updateOrganisationOnAccount: e
|
|
470
478
|
} = v || {}, m = {
|
|
471
|
-
...
|
|
479
|
+
...ai,
|
|
472
480
|
...n.feedback || {}
|
|
473
481
|
}, { shouldCreateAccount: b } = S || {};
|
|
474
482
|
try {
|
|
475
483
|
U(null);
|
|
476
|
-
const i =
|
|
484
|
+
const i = oi(S, {
|
|
477
485
|
currentOrganisation: s,
|
|
478
486
|
isSignedIn: B
|
|
479
487
|
}), o = C();
|
|
@@ -490,10 +498,10 @@ const si = {
|
|
|
490
498
|
},
|
|
491
499
|
...i?.phoneNumber ? { phoneNumber: i?.phoneNumber } : {}
|
|
492
500
|
}).catch((x) => {
|
|
493
|
-
const V =
|
|
501
|
+
const V = W(x);
|
|
494
502
|
return U({
|
|
495
503
|
title: m.feedback?.signUpFailedTitle,
|
|
496
|
-
description: V ?
|
|
504
|
+
description: V ? X(V) : m.feedback?.signUpFailedDescription,
|
|
497
505
|
action: {
|
|
498
506
|
label: m.feedback?.signUpFailedActionLabel,
|
|
499
507
|
onClick: () => {
|
|
@@ -510,7 +518,7 @@ const si = {
|
|
|
510
518
|
delete i.customer.contact, i.customer.contactId = p.id, f.current?.setValue("shouldCreateAccount", !1);
|
|
511
519
|
}
|
|
512
520
|
if (o && !o?.organisation?.id) {
|
|
513
|
-
const p =
|
|
521
|
+
const p = si(
|
|
514
522
|
{
|
|
515
523
|
billingAddress: i.billingAddress,
|
|
516
524
|
billingAddressId: i.billingAddressId,
|
|
@@ -530,11 +538,11 @@ const si = {
|
|
|
530
538
|
getCountryByCode: g
|
|
531
539
|
}
|
|
532
540
|
);
|
|
533
|
-
p && await
|
|
541
|
+
p && await M(p).catch(() => {
|
|
534
542
|
});
|
|
535
543
|
}
|
|
536
544
|
if (o?.organisation?.id && o?.organisation?.role?.toLowerCase() === "admin") {
|
|
537
|
-
const p =
|
|
545
|
+
const p = ri(
|
|
538
546
|
{
|
|
539
547
|
billingAddress: i.billingAddress,
|
|
540
548
|
billingAddressId: i.billingAddressId,
|
|
@@ -565,8 +573,8 @@ const si = {
|
|
|
565
573
|
phoneNumber: i.phoneNumber,
|
|
566
574
|
shippingAddress: i.shippingAddress
|
|
567
575
|
}), { customer: d, billing: r, delivery: A, phoneNumber: P } = t || {}, { organisation: E } = d || {};
|
|
568
|
-
return f.current?.formProps?.setData((p) => (p.splice(
|
|
569
|
-
...p[
|
|
576
|
+
return f.current?.formProps?.setData((p) => (p.splice(O, 1, {
|
|
577
|
+
...p[O],
|
|
570
578
|
contact: d?.contact,
|
|
571
579
|
billingAddressId: r?.address?.id,
|
|
572
580
|
shippingAddressId: A?.address?.id,
|
|
@@ -574,10 +582,10 @@ const si = {
|
|
|
574
582
|
phoneNumberIsDirty: !1
|
|
575
583
|
}), p)), N(E), t;
|
|
576
584
|
} catch (i) {
|
|
577
|
-
const o =
|
|
585
|
+
const o = W(i);
|
|
578
586
|
return U({
|
|
579
587
|
title: m.feedback?.informationStepErrorTitle,
|
|
580
|
-
description: o ?
|
|
588
|
+
description: o ? X(o) : m.feedback?.informationStepErrorDescription
|
|
581
589
|
}), Promise.reject(i);
|
|
582
590
|
}
|
|
583
591
|
},
|
|
@@ -585,12 +593,12 @@ const si = {
|
|
|
585
593
|
const {
|
|
586
594
|
billingAddressValidationSchema: a,
|
|
587
595
|
shippingAddressValidationSchema: v,
|
|
588
|
-
settings:
|
|
596
|
+
settings: O
|
|
589
597
|
} = S || {}, {
|
|
590
598
|
isCocNumberRequired: y,
|
|
591
599
|
isPhoneNumberRequired: s,
|
|
592
600
|
isVatNumberRequired: f
|
|
593
|
-
} =
|
|
601
|
+
} = O || {};
|
|
594
602
|
return u.object().shape({
|
|
595
603
|
type: u.string().oneOf(["business", "private"]).required(),
|
|
596
604
|
contact: u.object().nullable(),
|
|
@@ -627,5 +635,5 @@ const si = {
|
|
|
627
635
|
}
|
|
628
636
|
};
|
|
629
637
|
export {
|
|
630
|
-
|
|
638
|
+
yi as informationStep
|
|
631
639
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@afosto/checkout-ui",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.7",
|
|
4
4
|
"description": "Afosto react checkout ui components",
|
|
5
5
|
"author": "Afosto",
|
|
6
6
|
"license": "MIT",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"access": "public"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@afosto/components": "^2.0.0-alpha.
|
|
32
|
+
"@afosto/components": "^2.0.0-alpha.32",
|
|
33
33
|
"@afosto/graphql-client": "^3.0.0-alpha.7",
|
|
34
34
|
"@afosto/hooks": "^3.0.0",
|
|
35
35
|
"@afosto/storefront": "^3.2.0-beta.11",
|