@plurix/ecom-components 1.14.2-COM-1647.7 → 1.14.2-COM-2082.0
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/dist/packages/Coupons/api/addCoupon.js +10 -7
- package/dist/packages/Coupons/api/getCoupons.js +5 -4
- package/dist/packages/Coupons/api/removeCoupon.js +7 -6
- package/dist/packages/Regionalization/context/RegionalizationContext.js +17 -17
- package/dist/packages/Regionalization/views/PostalCodeInputScreen.js +9 -11
- package/dist/utils/changeAccount.d.ts +1 -0
- package/dist/utils/changeAccount.js +12 -0
- package/package.json +1 -1
|
@@ -1,14 +1,17 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import p from "axios";
|
|
2
|
+
import { changeAccount as r } from "../../../utils/changeAccount.js";
|
|
3
|
+
const u = async (t, n, c) => {
|
|
4
|
+
const o = r(t);
|
|
5
|
+
console.log("newAccount", o);
|
|
6
|
+
const { data: a } = await p.post(
|
|
4
7
|
`https://${o}.vtex.app/api/coupon/order`,
|
|
5
8
|
{
|
|
6
|
-
orderFormId:
|
|
7
|
-
couponId:
|
|
9
|
+
orderFormId: n,
|
|
10
|
+
couponId: c
|
|
8
11
|
}
|
|
9
12
|
);
|
|
10
|
-
return
|
|
13
|
+
return a;
|
|
11
14
|
};
|
|
12
15
|
export {
|
|
13
|
-
|
|
16
|
+
u as addCoupon
|
|
14
17
|
};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import n from "axios";
|
|
2
|
+
import { changeAccount as s } from "../../../utils/changeAccount.js";
|
|
3
|
+
const i = async (a, c, t) => {
|
|
4
|
+
const o = `https://${s(a)}.vtex.app/api/coupon/list`, p = Math.random(), { data: r } = t ? await n.post(o, { couponsList: t }) : await n.get(o, { params: { builder: c, random: p } });
|
|
4
5
|
return r.coupons;
|
|
5
6
|
};
|
|
6
7
|
export {
|
|
7
|
-
|
|
8
|
+
i as getCoupons
|
|
8
9
|
};
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import n from "axios";
|
|
2
|
+
import { changeAccount as c } from "../../../utils/changeAccount.js";
|
|
3
|
+
const s = async (o, t) => {
|
|
4
|
+
const a = c(o), { data: e } = await n.delete(
|
|
5
|
+
`https://${a}.vtex.app/api/coupon/order`,
|
|
5
6
|
{
|
|
6
7
|
data: { orderFormId: t }
|
|
7
8
|
}
|
|
8
9
|
);
|
|
9
|
-
return
|
|
10
|
+
return e;
|
|
10
11
|
};
|
|
11
12
|
export {
|
|
12
|
-
|
|
13
|
+
s as removeCoupon
|
|
13
14
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
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
|
-
import { removeSpecialCharacter as
|
|
3
|
+
import { removeSpecialCharacter as se } from "../utils/postalCode.js";
|
|
4
4
|
import { getFullLocalStorage as c } from "../utils/localStorage.js";
|
|
5
5
|
const v = M(null), re = ({
|
|
6
6
|
setMethod: o,
|
|
@@ -14,15 +14,15 @@ const v = M(null), re = ({
|
|
|
14
14
|
setInputPostalCode: D,
|
|
15
15
|
sendPostalCode: d,
|
|
16
16
|
status: I,
|
|
17
|
-
setStatus:
|
|
17
|
+
setStatus: i,
|
|
18
18
|
priceStockInformation: T = "",
|
|
19
19
|
pickupPoints: b,
|
|
20
20
|
titleText: z,
|
|
21
21
|
moreInfosText: P,
|
|
22
22
|
textBackButton: S,
|
|
23
|
-
confirmButton:
|
|
24
|
-
editAddress:
|
|
25
|
-
delivery:
|
|
23
|
+
confirmButton: h,
|
|
24
|
+
editAddress: H,
|
|
25
|
+
delivery: V,
|
|
26
26
|
deliveryPrice: k,
|
|
27
27
|
pickup: q,
|
|
28
28
|
regionalizeCatalog: E,
|
|
@@ -30,22 +30,22 @@ 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(), [
|
|
34
|
-
openingTime: (
|
|
35
|
-
closingTime: (
|
|
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 = {
|
|
34
|
+
openingTime: (s == null ? void 0 : s.businessHours.businessHoursWeek.openingTime.slice(0, 2)) || "",
|
|
35
|
+
closingTime: (s == null ? void 0 : s.businessHours.businessHoursWeek.closingTime.slice(0, 2)) || ""
|
|
36
36
|
}, Y = async () => {
|
|
37
|
-
|
|
37
|
+
i({ loading: !0, message: "Carregando..." });
|
|
38
38
|
const {
|
|
39
39
|
isValid: n,
|
|
40
40
|
address: t,
|
|
41
41
|
deliveryInfos: a,
|
|
42
42
|
customShipping: r
|
|
43
43
|
} = await d();
|
|
44
|
-
n && (
|
|
44
|
+
n && (i({ loading: !1 }), u("delivery"), A(t), i({}), m(l), f(a), g("ConfirmScreen"), N(r));
|
|
45
45
|
}, Z = () => {
|
|
46
46
|
/\d{8}$/.test(
|
|
47
|
-
|
|
48
|
-
) ? Y() :
|
|
47
|
+
se(l)
|
|
48
|
+
) ? Y() : i({
|
|
49
49
|
status: "failed",
|
|
50
50
|
loading: !1,
|
|
51
51
|
message: "Que Pena, ainda não entregamos na sua região."
|
|
@@ -74,21 +74,21 @@ const v = M(null), re = ({
|
|
|
74
74
|
setInputPostalCode: D,
|
|
75
75
|
sendPostalCode: d,
|
|
76
76
|
status: I,
|
|
77
|
-
setStatus:
|
|
77
|
+
setStatus: i,
|
|
78
78
|
pickupPoints: b,
|
|
79
79
|
titleText: z,
|
|
80
80
|
moreInfosText: P,
|
|
81
81
|
customShippingData: K,
|
|
82
82
|
textBackButton: S,
|
|
83
|
-
confirmButton:
|
|
84
|
-
editAddress:
|
|
85
|
-
delivery:
|
|
83
|
+
confirmButton: h,
|
|
84
|
+
editAddress: H,
|
|
85
|
+
delivery: V,
|
|
86
86
|
pickup: q,
|
|
87
87
|
view: L,
|
|
88
88
|
setView: g,
|
|
89
89
|
postalCodeValidation: Z,
|
|
90
90
|
address: $,
|
|
91
|
-
pickupAddress:
|
|
91
|
+
pickupAddress: s,
|
|
92
92
|
setPickupAddress: G,
|
|
93
93
|
deliveryRequestInfos: J,
|
|
94
94
|
postalCode: Q,
|
|
@@ -10,20 +10,20 @@ import { postalCodeMask as P } from "../utils/postalCode.js";
|
|
|
10
10
|
const T = () => {
|
|
11
11
|
const {
|
|
12
12
|
delivery: e,
|
|
13
|
-
status:
|
|
14
|
-
postalCodeValidation:
|
|
13
|
+
status: r,
|
|
14
|
+
postalCodeValidation: o,
|
|
15
15
|
setInputPostalCode: m,
|
|
16
16
|
postalCode: p,
|
|
17
17
|
deliveryPrice: h,
|
|
18
18
|
textBackButton: d,
|
|
19
19
|
pickup: t,
|
|
20
20
|
setBackToDelivery: a
|
|
21
|
-
} = x(), l = (
|
|
21
|
+
} = x(), l = (r == null ? void 0 : r.status) === "failed";
|
|
22
22
|
return /* @__PURE__ */ n(f, { children: /* @__PURE__ */ n("div", { className: "delivery-pickup-container", children: /* @__PURE__ */ c("div", { className: "content-container", children: [
|
|
23
23
|
/* @__PURE__ */ n(g, { title: l ? "Tente outro CEP" : e == null ? void 0 : e.title }),
|
|
24
24
|
l ? /* @__PURE__ */ c("div", { className: "warning-container", children: [
|
|
25
25
|
/* @__PURE__ */ n(u, {}),
|
|
26
|
-
/* @__PURE__ */ n("span", { className: "warning-text", children:
|
|
26
|
+
/* @__PURE__ */ n("span", { className: "warning-text", children: r == null ? void 0 : r.message })
|
|
27
27
|
] }) : /* @__PURE__ */ n(
|
|
28
28
|
k,
|
|
29
29
|
{
|
|
@@ -38,9 +38,7 @@ const T = () => {
|
|
|
38
38
|
/* @__PURE__ */ n(
|
|
39
39
|
"input",
|
|
40
40
|
{
|
|
41
|
-
onKeyDown: (i) =>
|
|
42
|
-
console.log("event", i.key), i.key === "Enter" && (r == null || r());
|
|
43
|
-
},
|
|
41
|
+
onKeyDown: (i) => i.key === "Enter" && (o == null ? void 0 : o()),
|
|
44
42
|
type: "text",
|
|
45
43
|
onChange: (i) => m(i.target.value),
|
|
46
44
|
maxLength: 9,
|
|
@@ -51,10 +49,10 @@ const T = () => {
|
|
|
51
49
|
/* @__PURE__ */ n(
|
|
52
50
|
"button",
|
|
53
51
|
{
|
|
54
|
-
onKeyDown: (i) => i.key === "Enter" && (
|
|
55
|
-
onClick: () =>
|
|
56
|
-
disabled:
|
|
57
|
-
children:
|
|
52
|
+
onKeyDown: (i) => i.key === "Enter" && (o == null ? void 0 : o()),
|
|
53
|
+
onClick: () => o == null ? void 0 : o(),
|
|
54
|
+
disabled: r == null ? void 0 : r.loading,
|
|
55
|
+
children: r != null && r.loading ? r.message : e == null ? void 0 : e.searchButton
|
|
58
56
|
}
|
|
59
57
|
)
|
|
60
58
|
] }),
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const changeAccount: (account: string) => string;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
const a = {
|
|
2
|
+
smrholdingv2: "smrholding",
|
|
3
|
+
amigaov3: "amigao",
|
|
4
|
+
avenidab2cv2: "avenidab2c",
|
|
5
|
+
boav3: "boa",
|
|
6
|
+
superpaov3: "superpao",
|
|
7
|
+
compremaisv3: "compremais",
|
|
8
|
+
domoliviov3: "domolivio"
|
|
9
|
+
}, i = (o) => a[o] || o;
|
|
10
|
+
export {
|
|
11
|
+
i as changeAccount
|
|
12
|
+
};
|