@plurix/ecom-components 0.0.2-beta.6 → 0.0.2-beta.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.
- package/dist/packages/Carousel/Carousel.js +3 -3
- package/dist/packages/Onboarding/Onboarding.js +1 -1
- package/dist/packages/Regionalization/components/Delivery.js +2 -2
- package/dist/packages/Regionalization/components/Title.js +1 -1
- package/dist/packages/Regionalization/context/RegionalizationContext.js +2 -2
- package/dist/packages/Regionalization/utils/deliverySetData.js +1 -1
- package/dist/packages/Regionalization/utils/localStorage.js +3 -3
- package/dist/packages/Regionalization/utils/postalCode.d.ts +2 -1
- package/dist/packages/Regionalization/views/AllStoresScreen.js +1 -1
- package/dist/packages/Regionalization/views/ConfirmScreen.js +2 -2
- package/dist/packages/Regionalization/views/InitialView.js +1 -1
- package/dist/packages/Regionalization/views/PostalCodeInputScreen.js +1 -1
- package/dist/packages/Tour/components/TourTooltip.d.ts +1 -1
- package/dist/packages/Tour/test/Tour.test.js +20 -24
- package/package.json +1 -1
|
@@ -67,7 +67,7 @@ import { DefaultProps as L } from "./utils/defaultProps.js";
|
|
|
67
67
|
{
|
|
68
68
|
position: "prev",
|
|
69
69
|
style: f.arrows,
|
|
70
|
-
iconColor: r.iconColor
|
|
70
|
+
iconColor: r.iconColor || "#ccc",
|
|
71
71
|
onClick: () => W("prev")
|
|
72
72
|
}
|
|
73
73
|
) }),
|
|
@@ -98,7 +98,7 @@ import { DefaultProps as L } from "./utils/defaultProps.js";
|
|
|
98
98
|
{
|
|
99
99
|
position: "next",
|
|
100
100
|
style: f.arrows,
|
|
101
|
-
iconColor: r.iconColor
|
|
101
|
+
iconColor: r.iconColor || "#ccc",
|
|
102
102
|
onClick: () => W("next")
|
|
103
103
|
}
|
|
104
104
|
) : "" })
|
|
@@ -115,7 +115,7 @@ import { DefaultProps as L } from "./utils/defaultProps.js";
|
|
|
115
115
|
style: {
|
|
116
116
|
...f.bullets,
|
|
117
117
|
transition: "all 0.8s ease-out",
|
|
118
|
-
backgroundColor: `${M === e ? (c == null ? void 0 : c.bulletEnableColor)
|
|
118
|
+
backgroundColor: `${M === e ? (c == null ? void 0 : c.bulletEnableColor) || "#ff0000" : (c == null ? void 0 : c.bulletDisableColor) || "#ccc"}`
|
|
119
119
|
}
|
|
120
120
|
},
|
|
121
121
|
e
|
|
@@ -4,14 +4,14 @@ import { DeliveryExpress as S } from "./DeliveryExpress.js";
|
|
|
4
4
|
import { useRegionalizationContext as f } from "../context/RegionalizationContext.js";
|
|
5
5
|
const C = ({ containerClassName: g, delivery: e }) => {
|
|
6
6
|
var o, i, p, c, m;
|
|
7
|
-
const { customShippingData: l } = f(), { shippingList: s, isExpressEligible: D, expressShippingCmsQuantity: a } = l
|
|
7
|
+
const { customShippingData: l } = f(), { shippingList: s, isExpressEligible: D, expressShippingCmsQuantity: a } = l || {}, n = {
|
|
8
8
|
normalDeliveryPrice: (o = s == null ? void 0 : s.find(
|
|
9
9
|
(r) => r.id === "Entrega Padrão"
|
|
10
10
|
)) == null ? void 0 : o.listPrice,
|
|
11
11
|
expressDeliveryPrice: (i = s == null ? void 0 : s.find(
|
|
12
12
|
(r) => r.id === "Entrega Express"
|
|
13
13
|
)) == null ? void 0 : i.listPrice,
|
|
14
|
-
shippingEstimate: ((p = s == null ? void 0 : s.find((r) => r.id === "Entrega Express")) == null ? void 0 : p.shippingEstimate)
|
|
14
|
+
shippingEstimate: ((p = s == null ? void 0 : s.find((r) => r.id === "Entrega Express")) == null ? void 0 : p.shippingEstimate) || "",
|
|
15
15
|
expressShippingQuantity: a || ""
|
|
16
16
|
}, E = (c = e == null ? void 0 : e.expressMessage) == null ? void 0 : c.replace(
|
|
17
17
|
"$Q",
|
|
@@ -30,8 +30,8 @@ const v = _(null), ae = ({
|
|
|
30
30
|
children: j
|
|
31
31
|
}) => {
|
|
32
32
|
const [B, u] = e(), [F, g] = e("InitialView"), [L, m] = e(""), [Q, $] = e(), [s, A] = e(), [G, f] = e(), [J, K] = e(), [N, O] = e(!1), U = {
|
|
33
|
-
openingTime: (s == null ? void 0 : s.businessHours.businessHoursWeek.openingTime.slice(0, 2))
|
|
34
|
-
closingTime: (s == null ? void 0 : s.businessHours.businessHoursWeek.closingTime.slice(0, 2))
|
|
33
|
+
openingTime: (s == null ? void 0 : s.businessHours.businessHoursWeek.openingTime.slice(0, 2)) || "",
|
|
34
|
+
closingTime: (s == null ? void 0 : s.businessHours.businessHoursWeek.closingTime.slice(0, 2)) || ""
|
|
35
35
|
}, X = async () => {
|
|
36
36
|
i({ loading: !0, message: "Carregando..." });
|
|
37
37
|
const {
|
|
@@ -6,7 +6,7 @@ const c = (i, t, m) => {
|
|
|
6
6
|
deliveryName: String(t == null ? void 0 : t.deliveryName),
|
|
7
7
|
shippingEstimate: String(t == null ? void 0 : t.shippingEstimate)
|
|
8
8
|
});
|
|
9
|
-
g("postalCode", m
|
|
9
|
+
g("postalCode", m || ""), g("method", "delivery"), g("deliveryInfos", p);
|
|
10
10
|
};
|
|
11
11
|
export {
|
|
12
12
|
c as deliverySetData
|
|
@@ -5,11 +5,11 @@ const n = (t, e) => {
|
|
|
5
5
|
if (a)
|
|
6
6
|
return localStorage.getItem(t);
|
|
7
7
|
}, d = () => {
|
|
8
|
-
const t = s("postalCode"), e = s("method"), o = JSON.parse(s("deliveryInfos")
|
|
9
|
-
postalCode: t
|
|
8
|
+
const t = s("postalCode"), e = s("method"), o = JSON.parse(s("deliveryInfos") || "{}"), c = {
|
|
9
|
+
postalCode: t || "00000-000",
|
|
10
10
|
city: o == null ? void 0 : o.city,
|
|
11
11
|
uf: o == null ? void 0 : o.uf
|
|
12
|
-
}, r = e
|
|
12
|
+
}, r = e || void 0;
|
|
13
13
|
return {
|
|
14
14
|
regionalized: r,
|
|
15
15
|
deliveryInfos: r ? o : void 0,
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const postalCodeMask: (e: React.KeyboardEvent<HTMLInputElement>) => import('react').KeyboardEvent<HTMLInputElement>;
|
|
2
3
|
export declare const removeSpecialCharacter: (value: string) => string;
|
|
@@ -16,7 +16,7 @@ const E = () => {
|
|
|
16
16
|
l == null ? void 0 : l.filter(
|
|
17
17
|
({ name: t }) => {
|
|
18
18
|
var c;
|
|
19
|
-
return t.toLowerCase().includes(((c = a.current) == null ? void 0 : c.value.toLowerCase())
|
|
19
|
+
return t.toLowerCase().includes(((c = a.current) == null ? void 0 : c.value.toLowerCase()) || "");
|
|
20
20
|
}
|
|
21
21
|
)
|
|
22
22
|
);
|
|
@@ -15,7 +15,7 @@ const I = () => {
|
|
|
15
15
|
internalMethod: l,
|
|
16
16
|
pickupTimes: a,
|
|
17
17
|
pickupConfirmScreenText: c
|
|
18
|
-
} = v(), d = `Retiradas entre ${(a == null ? void 0 : a.openingTime)
|
|
18
|
+
} = v(), d = `Retiradas entre ${(a == null ? void 0 : a.openingTime) || "08"}h e ${(a == null ? void 0 : a.closingTime) || "20"}h, ou agendada`, h = c && c !== "" ? c : d;
|
|
19
19
|
return /* @__PURE__ */ o(m, { children: [
|
|
20
20
|
/* @__PURE__ */ n(
|
|
21
21
|
f,
|
|
@@ -30,7 +30,7 @@ const I = () => {
|
|
|
30
30
|
] }),
|
|
31
31
|
l === "delivery" ? /* @__PURE__ */ o(m, { children: [
|
|
32
32
|
/* @__PURE__ */ n("span", { children: t == null ? void 0 : t.cep }),
|
|
33
|
-
/* @__PURE__ */ n("span", { className: "address-delivery", children: (t == null ? void 0 : t.logradouro)
|
|
33
|
+
/* @__PURE__ */ n("span", { className: "address-delivery", children: (t == null ? void 0 : t.logradouro) || (t == null ? void 0 : t.localidade) })
|
|
34
34
|
] }) : /* @__PURE__ */ o(m, { children: [
|
|
35
35
|
/* @__PURE__ */ n("span", { children: r == null ? void 0 : r.name }),
|
|
36
36
|
/* @__PURE__ */ o("p", { className: "address-pickup", children: [
|
|
@@ -33,7 +33,7 @@ const R = () => {
|
|
|
33
33
|
/* @__PURE__ */ e("h4", { children: "Receber em casa" }),
|
|
34
34
|
/* @__PURE__ */ i("p", { children: [
|
|
35
35
|
" A partir de ",
|
|
36
|
-
u(m
|
|
36
|
+
u(m || 0)
|
|
37
37
|
] })
|
|
38
38
|
] }),
|
|
39
39
|
/* @__PURE__ */ i(n, { view: "PickupPointInfoScreen", className: "option", children: [
|
|
@@ -1,49 +1,45 @@
|
|
|
1
1
|
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
import { render as
|
|
2
|
+
import l from "react";
|
|
3
|
+
import { render as i, fireEvent as a } from "@testing-library/react";
|
|
4
4
|
import "@testing-library/jest-dom";
|
|
5
|
-
import { Tour as
|
|
6
|
-
jest.mock("../components/TourTooltip", () => ({ TourTooltip:
|
|
7
|
-
(
|
|
5
|
+
import { Tour as s } from "../Tour.js";
|
|
6
|
+
jest.mock("../components/TourTooltip", () => ({ TourTooltip: l.forwardRef(
|
|
7
|
+
(e, o) => /* @__PURE__ */ r("div", { ref: o, "data-testid": "tour-tooltip" })
|
|
8
8
|
) }));
|
|
9
9
|
jest.mock("../components/TourOverlay", () => ({
|
|
10
|
-
TourOverlay: ({
|
|
11
|
-
stepNumber: n,
|
|
12
|
-
onClick: e,
|
|
13
|
-
...t
|
|
14
|
-
}) => /* @__PURE__ */ r("div", { ...t, onClick: e, "data-testid": "tour-overlay" })
|
|
10
|
+
TourOverlay: ({ onClick: t }) => /* @__PURE__ */ r("div", { onClick: t, "data-testid": "tour-overlay" })
|
|
15
11
|
}));
|
|
16
12
|
describe("Tour", () => {
|
|
17
|
-
const
|
|
13
|
+
const t = [
|
|
18
14
|
{ selector: ".step-1", content: "Step 1 Content" },
|
|
19
15
|
{ selector: ".step-2", content: "Step 2 Content" },
|
|
20
16
|
{ selector: ".step-3", content: "Step 3 Content" }
|
|
21
|
-
], e = jest.fn(),
|
|
17
|
+
], e = jest.fn(), o = jest.fn(), c = jest.fn();
|
|
22
18
|
it("should render correctly with initial step", () => {
|
|
23
|
-
const { getByTestId:
|
|
19
|
+
const { getByTestId: n } = i(
|
|
24
20
|
/* @__PURE__ */ r(
|
|
25
|
-
|
|
21
|
+
s,
|
|
26
22
|
{
|
|
27
|
-
steps:
|
|
23
|
+
steps: t,
|
|
28
24
|
handleCloseAction: e,
|
|
29
|
-
handleFinishAction:
|
|
30
|
-
genericTaggingEvent:
|
|
25
|
+
handleFinishAction: o,
|
|
26
|
+
genericTaggingEvent: c
|
|
31
27
|
}
|
|
32
28
|
)
|
|
33
29
|
);
|
|
34
|
-
expect(
|
|
30
|
+
expect(n("tour-tooltip")).toBeInTheDocument(), expect(n("tour-overlay")).toBeInTheDocument();
|
|
35
31
|
}), it("should call handleCloseAction when TourOverlay is clicked", () => {
|
|
36
|
-
const { getByTestId:
|
|
32
|
+
const { getByTestId: n } = i(
|
|
37
33
|
/* @__PURE__ */ r(
|
|
38
|
-
|
|
34
|
+
s,
|
|
39
35
|
{
|
|
40
|
-
steps:
|
|
36
|
+
steps: t,
|
|
41
37
|
handleCloseAction: e,
|
|
42
|
-
handleFinishAction:
|
|
43
|
-
genericTaggingEvent:
|
|
38
|
+
handleFinishAction: o,
|
|
39
|
+
genericTaggingEvent: c
|
|
44
40
|
}
|
|
45
41
|
)
|
|
46
42
|
);
|
|
47
|
-
|
|
43
|
+
a.click(n("tour-overlay")), expect(e).toHaveBeenCalled();
|
|
48
44
|
});
|
|
49
45
|
});
|