@vtex/faststore-plugin-buyer-portal 2.0.42 → 2.0.44
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/package.json
CHANGED
|
@@ -53,7 +53,6 @@ export type AddressFormValues = Pick<
|
|
|
53
53
|
export type ClearableAddressField = "state" | "streetNumber" | "neighborhood";
|
|
54
54
|
|
|
55
55
|
const NEIGHBORHOOD_LABEL = "addresses.forms.neighborhood";
|
|
56
|
-
const COLONIA_LABEL = "addresses.forms.colonia";
|
|
57
56
|
|
|
58
57
|
const FALLBACK_RULE: CountryRule = {
|
|
59
58
|
zip: { required: true, pattern: null, renderFirst: false },
|
|
@@ -148,7 +147,7 @@ const COUNTRY_RULES: Record<SupportedCountryCode, CountryRule> = {
|
|
|
148
147
|
neighborhood: {
|
|
149
148
|
visible: true,
|
|
150
149
|
required: true,
|
|
151
|
-
labelKey:
|
|
150
|
+
labelKey: NEIGHBORHOOD_LABEL,
|
|
152
151
|
},
|
|
153
152
|
state: { visible: true, required: true },
|
|
154
153
|
streetAddress: { separated: true },
|
|
@@ -376,12 +375,7 @@ export function collectAddressIssues(
|
|
|
376
375
|
rule.neighborhood.required &&
|
|
377
376
|
isBlank(values.neighborhood)
|
|
378
377
|
) {
|
|
379
|
-
pushRequired(
|
|
380
|
-
"neighborhood",
|
|
381
|
-
rule.neighborhood.labelKey === COLONIA_LABEL
|
|
382
|
-
? "addresses.validation.coloniaRequired"
|
|
383
|
-
: "addresses.validation.neighborhoodRequired"
|
|
384
|
-
);
|
|
378
|
+
pushRequired("neighborhood", "addresses.validation.neighborhoodRequired");
|
|
385
379
|
}
|
|
386
380
|
|
|
387
381
|
return issues;
|
|
@@ -17,6 +17,8 @@ const MASK_MAP: Record<CountryCodes, MaskType> = {
|
|
|
17
17
|
MEX: { mask: "(999) 999-9999", length: 14, ddi: "52" },
|
|
18
18
|
BRA: { mask: "(99) 99999-9999", length: 15, ddi: "55" },
|
|
19
19
|
CAN: { mask: "(999) 999-9999", length: 14, ddi: "1" },
|
|
20
|
+
FRA: { mask: "9 99 99 99 99", length: 13, ddi: "33" },
|
|
21
|
+
COL: { mask: "(999) 999-9999", length: 14, ddi: "57" },
|
|
20
22
|
};
|
|
21
23
|
|
|
22
24
|
export function maskPhoneNumber(phoneNumber: string, country?: CountryCodes) {
|