@plurix/ecom-components 1.14.2-COM-1647.1 → 1.14.2-COM-1647.3
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.
|
@@ -2,27 +2,27 @@ import { jsx as _ } from "react/jsx-runtime";
|
|
|
2
2
|
import { createContext as M, useState as e, useEffect as ee, useContext as oe } from "react";
|
|
3
3
|
import { removeSpecialCharacter as se } from "../utils/postalCode.js";
|
|
4
4
|
import { getFullLocalStorage as c } from "../utils/localStorage.js";
|
|
5
|
-
const v = M(null),
|
|
5
|
+
const v = M(null), le = ({
|
|
6
6
|
setMethod: o,
|
|
7
7
|
setPickupName: C,
|
|
8
8
|
setCity: p,
|
|
9
|
-
setUf:
|
|
10
|
-
setPickupTimes:
|
|
11
|
-
pricesAndHours:
|
|
12
|
-
setModalOpen:
|
|
13
|
-
inputPostalCode:
|
|
14
|
-
setInputPostalCode:
|
|
9
|
+
setUf: y,
|
|
10
|
+
setPickupTimes: x,
|
|
11
|
+
pricesAndHours: I,
|
|
12
|
+
setModalOpen: P,
|
|
13
|
+
inputPostalCode: r,
|
|
14
|
+
setInputPostalCode: R,
|
|
15
15
|
sendPostalCode: d,
|
|
16
|
-
status:
|
|
17
|
-
setStatus:
|
|
18
|
-
priceStockInformation:
|
|
19
|
-
pickupPoints:
|
|
20
|
-
titleText:
|
|
21
|
-
moreInfosText:
|
|
16
|
+
status: w,
|
|
17
|
+
setStatus: n,
|
|
18
|
+
priceStockInformation: D = "",
|
|
19
|
+
pickupPoints: T,
|
|
20
|
+
titleText: b,
|
|
21
|
+
moreInfosText: z,
|
|
22
22
|
textBackButton: S,
|
|
23
23
|
confirmButton: h,
|
|
24
|
-
editAddress:
|
|
25
|
-
delivery:
|
|
24
|
+
editAddress: V,
|
|
25
|
+
delivery: H,
|
|
26
26
|
deliveryPrice: k,
|
|
27
27
|
pickup: q,
|
|
28
28
|
regionalizeCatalog: E,
|
|
@@ -30,30 +30,35 @@ const v = M(null), re = ({
|
|
|
30
30
|
disabledSearch: j,
|
|
31
31
|
children: B
|
|
32
32
|
}) => {
|
|
33
|
-
const [F,
|
|
33
|
+
const [F, g] = e(), [L, u] = e("InitialView"), [Q, m] = e(""), [$, A] = e(), [s, G] = e(), [J, f] = e(), [K, N] = e(), [O, U] = e(!1), X = {
|
|
34
34
|
openingTime: (s == null ? void 0 : s.businessHours.businessHoursWeek.openingTime.slice(0, 2)) || "",
|
|
35
35
|
closingTime: (s == null ? void 0 : s.businessHours.businessHoursWeek.closingTime.slice(0, 2)) || ""
|
|
36
36
|
}, Y = async () => {
|
|
37
|
-
|
|
37
|
+
n({ loading: !0, message: "Carregando..." });
|
|
38
38
|
const {
|
|
39
|
-
isValid:
|
|
40
|
-
address:
|
|
41
|
-
deliveryInfos:
|
|
42
|
-
customShipping:
|
|
39
|
+
isValid: i,
|
|
40
|
+
address: a,
|
|
41
|
+
deliveryInfos: t,
|
|
42
|
+
customShipping: l
|
|
43
43
|
} = await d();
|
|
44
|
-
|
|
44
|
+
console.log({
|
|
45
|
+
isValid: i,
|
|
46
|
+
address: a,
|
|
47
|
+
deliveryInfos: t,
|
|
48
|
+
customShipping: l
|
|
49
|
+
}), i && (console.log("entrou no if `isValid`"), n({ loading: !1 }), g("delivery"), A(a), n({}), m(r), f(t), u("ConfirmScreen"), N(l));
|
|
45
50
|
}, Z = () => {
|
|
46
51
|
/\d{8}$/.test(
|
|
47
|
-
se(
|
|
48
|
-
) ? Y() :
|
|
52
|
+
se(r)
|
|
53
|
+
) ? (console.log("caiu no if validatePostalCode"), Y()) : (console.log("caiu no else validatePostalCode"), n({
|
|
49
54
|
status: "failed",
|
|
50
55
|
loading: !1,
|
|
51
56
|
message: "Que Pena, ainda não entregamos na sua região."
|
|
52
|
-
});
|
|
57
|
+
}));
|
|
53
58
|
};
|
|
54
59
|
return ee(() => {
|
|
55
|
-
var
|
|
56
|
-
m((
|
|
60
|
+
var i, a, t, l;
|
|
61
|
+
m((a = (i = c()) == null ? void 0 : i.userAddressInfos) == null ? void 0 : a.postalCode), o == null || o((t = c()) == null ? void 0 : t.regionalized), f((l = c()) == null ? void 0 : l.deliveryInfos);
|
|
57
62
|
}, []), /* @__PURE__ */ _(
|
|
58
63
|
v.Provider,
|
|
59
64
|
{
|
|
@@ -61,31 +66,31 @@ const v = M(null), re = ({
|
|
|
61
66
|
backToDelivery: O,
|
|
62
67
|
setBackToDelivery: U,
|
|
63
68
|
setMethod: o,
|
|
64
|
-
priceStockInformation:
|
|
69
|
+
priceStockInformation: D,
|
|
65
70
|
setPickupName: C,
|
|
66
71
|
setCity: p,
|
|
67
|
-
setUf:
|
|
68
|
-
setPickupTimes:
|
|
72
|
+
setUf: y,
|
|
73
|
+
setPickupTimes: x,
|
|
69
74
|
pickupTimes: X,
|
|
70
75
|
pickupConfirmScreenText: W,
|
|
71
|
-
pricesAndHours:
|
|
72
|
-
setModalOpen:
|
|
73
|
-
inputPostalCode:
|
|
74
|
-
setInputPostalCode:
|
|
76
|
+
pricesAndHours: I,
|
|
77
|
+
setModalOpen: P,
|
|
78
|
+
inputPostalCode: r,
|
|
79
|
+
setInputPostalCode: R,
|
|
75
80
|
sendPostalCode: d,
|
|
76
|
-
status:
|
|
77
|
-
setStatus:
|
|
78
|
-
pickupPoints:
|
|
79
|
-
titleText:
|
|
80
|
-
moreInfosText:
|
|
81
|
+
status: w,
|
|
82
|
+
setStatus: n,
|
|
83
|
+
pickupPoints: T,
|
|
84
|
+
titleText: b,
|
|
85
|
+
moreInfosText: z,
|
|
81
86
|
customShippingData: K,
|
|
82
87
|
textBackButton: S,
|
|
83
88
|
confirmButton: h,
|
|
84
|
-
editAddress:
|
|
85
|
-
delivery:
|
|
89
|
+
editAddress: V,
|
|
90
|
+
delivery: H,
|
|
86
91
|
pickup: q,
|
|
87
92
|
view: L,
|
|
88
|
-
setView:
|
|
93
|
+
setView: u,
|
|
89
94
|
postalCodeValidation: Z,
|
|
90
95
|
address: $,
|
|
91
96
|
pickupAddress: s,
|
|
@@ -93,7 +98,7 @@ const v = M(null), re = ({
|
|
|
93
98
|
deliveryRequestInfos: J,
|
|
94
99
|
postalCode: Q,
|
|
95
100
|
internalMethod: F,
|
|
96
|
-
setInternalMethod:
|
|
101
|
+
setInternalMethod: g,
|
|
97
102
|
regionalizeCatalog: E,
|
|
98
103
|
disabledSearch: j,
|
|
99
104
|
deliveryPrice: k
|
|
@@ -101,7 +106,7 @@ const v = M(null), re = ({
|
|
|
101
106
|
children: B
|
|
102
107
|
}
|
|
103
108
|
);
|
|
104
|
-
},
|
|
109
|
+
}, re = () => {
|
|
105
110
|
const o = oe(v);
|
|
106
111
|
if (!o)
|
|
107
112
|
throw new Error(
|
|
@@ -110,6 +115,6 @@ const v = M(null), re = ({
|
|
|
110
115
|
return o;
|
|
111
116
|
};
|
|
112
117
|
export {
|
|
113
|
-
|
|
114
|
-
|
|
118
|
+
le as RegionalizationContextProvider,
|
|
119
|
+
re as useRegionalizationContext
|
|
115
120
|
};
|