@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), re = ({
5
+ const v = M(null), le = ({
6
6
  setMethod: o,
7
7
  setPickupName: C,
8
8
  setCity: p,
9
- setUf: x,
10
- setPickupTimes: y,
11
- pricesAndHours: R,
12
- setModalOpen: w,
13
- inputPostalCode: l,
14
- setInputPostalCode: D,
9
+ setUf: y,
10
+ setPickupTimes: x,
11
+ pricesAndHours: I,
12
+ setModalOpen: P,
13
+ inputPostalCode: r,
14
+ setInputPostalCode: R,
15
15
  sendPostalCode: d,
16
- status: I,
17
- setStatus: i,
18
- priceStockInformation: T = "",
19
- pickupPoints: b,
20
- titleText: z,
21
- moreInfosText: P,
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: H,
25
- delivery: V,
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, u] = e(), [L, g] = e("InitialView"), [Q, m] = e(""), [$, A] = e(), [s, G] = e(), [J, f] = e(), [K, N] = e(), [O, U] = e(!1), X = {
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
- i({ loading: !0, message: "Carregando..." });
37
+ n({ loading: !0, message: "Carregando..." });
38
38
  const {
39
- isValid: n,
40
- address: t,
41
- deliveryInfos: a,
42
- customShipping: r
39
+ isValid: i,
40
+ address: a,
41
+ deliveryInfos: t,
42
+ customShipping: l
43
43
  } = await d();
44
- n && (i({ loading: !1 }), u("delivery"), A(t), i({}), m(l), f(a), g("ConfirmScreen"), N(r));
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(l)
48
- ) ? Y() : i({
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 n, t, a, r;
56
- m((t = (n = c()) == null ? void 0 : n.userAddressInfos) == null ? void 0 : t.postalCode), o == null || o((a = c()) == null ? void 0 : a.regionalized), f((r = c()) == null ? void 0 : r.deliveryInfos);
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: T,
69
+ priceStockInformation: D,
65
70
  setPickupName: C,
66
71
  setCity: p,
67
- setUf: x,
68
- setPickupTimes: y,
72
+ setUf: y,
73
+ setPickupTimes: x,
69
74
  pickupTimes: X,
70
75
  pickupConfirmScreenText: W,
71
- pricesAndHours: R,
72
- setModalOpen: w,
73
- inputPostalCode: l,
74
- setInputPostalCode: D,
76
+ pricesAndHours: I,
77
+ setModalOpen: P,
78
+ inputPostalCode: r,
79
+ setInputPostalCode: R,
75
80
  sendPostalCode: d,
76
- status: I,
77
- setStatus: i,
78
- pickupPoints: b,
79
- titleText: z,
80
- moreInfosText: P,
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: H,
85
- delivery: V,
89
+ editAddress: V,
90
+ delivery: H,
86
91
  pickup: q,
87
92
  view: L,
88
- setView: g,
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: u,
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
- }, le = () => {
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
- re as RegionalizationContextProvider,
114
- le as useRegionalizationContext
118
+ le as RegionalizationContextProvider,
119
+ re as useRegionalizationContext
115
120
  };
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@plurix/ecom-components",
3
3
  "author": "Plurix",
4
4
  "private": false,
5
- "version": "1.14.2-COM-1647.1",
5
+ "version": "1.14.2-COM-1647.3",
6
6
  "type": "module",
7
7
  "main": "dist/main.js",
8
8
  "types": "dist/main.d.ts",