@plurix/ecom-components 0.0.2-beta.2 → 0.0.2-beta.4
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/assets/svgs/ArrowIcon.d.ts +9 -0
- package/dist/assets/svgs/ArrowIcon.js +37 -0
- package/dist/assets/svgs/CartEmptyCoupon.d.ts +1 -0
- package/dist/assets/svgs/CartEmptyCoupon.js +937 -0
- package/dist/assets/svgs/CloseIcon.d.ts +7 -1
- package/dist/assets/svgs/CloseIcon.js +13 -9
- package/dist/assets/svgs/CouponIcon.d.ts +4 -0
- package/dist/assets/svgs/CouponIcon.js +22 -0
- package/dist/assets/svgs/DeliveryExpressIcon.d.ts +1 -0
- package/dist/assets/svgs/DeliveryExpressIcon.js +21 -0
- package/dist/assets/svgs/DeliveryIcon.d.ts +1 -0
- package/dist/assets/svgs/DeliveryIcon.js +21 -0
- package/dist/assets/svgs/ErrorIcon.d.ts +5 -0
- package/dist/assets/svgs/ErrorIcon.js +29 -0
- package/dist/assets/svgs/GlassIcon.d.ts +1 -0
- package/dist/assets/svgs/GlassIcon.js +23 -0
- package/dist/assets/svgs/InfoIcon.d.ts +6 -0
- package/dist/assets/svgs/InfoIcon.js +47 -0
- package/dist/assets/svgs/NoCouponIcon.d.ts +1 -0
- package/dist/assets/svgs/NoCouponIcon.js +107 -0
- package/dist/assets/svgs/ShoppingBagsIcon.d.ts +1 -0
- package/dist/assets/svgs/ShoppingBagsIcon.js +30 -0
- package/dist/assets/svgs/ShoppingIcon.d.ts +1 -0
- package/dist/assets/svgs/ShoppingIcon.js +21 -0
- package/dist/assets/svgs/SuccessIcon.d.ts +6 -0
- package/dist/assets/svgs/SuccessIcon.js +38 -0
- package/dist/assets/svgs/WarningIcon.d.ts +1 -0
- package/dist/assets/svgs/WarningIcon.js +25 -0
- package/dist/main.d.ts +5 -0
- package/dist/main.js +11 -3
- package/dist/packages/Carousel/Carousel.d.ts +24 -0
- package/dist/packages/Carousel/Carousel.js +128 -0
- package/dist/packages/Carousel/components/Arrows.d.ts +8 -0
- package/dist/packages/Carousel/components/Arrows.js +43 -0
- package/dist/packages/Carousel/components/Bullets.d.ts +7 -0
- package/dist/packages/Carousel/components/Bullets.js +5 -0
- package/dist/packages/Carousel/test/Carrousel.test.js +80 -0
- package/dist/packages/Carousel/utils/defaultProps.d.ts +19 -0
- package/dist/packages/Carousel/utils/defaultProps.js +22 -0
- package/dist/packages/Coupons/Coupons.d.ts +14 -0
- package/dist/packages/Coupons/Coupons.js +100 -0
- package/dist/packages/Coupons/api/addCoupon.d.ts +3 -0
- package/dist/packages/Coupons/api/addCoupon.js +14 -0
- package/dist/packages/Coupons/api/getCoupons.d.ts +3 -0
- package/dist/packages/Coupons/api/getCoupons.js +15 -0
- package/dist/packages/Coupons/api/removeCoupon.d.ts +3 -0
- package/dist/packages/Coupons/api/removeCoupon.js +13 -0
- package/dist/packages/Coupons/components/Alert.d.ts +6 -0
- package/dist/packages/Coupons/components/Alert.js +13 -0
- package/dist/packages/Coupons/components/Breadcrumb.d.ts +6 -0
- package/dist/packages/Coupons/components/Breadcrumb.js +33 -0
- package/dist/packages/Coupons/components/CouponCard.d.ts +25 -0
- package/dist/packages/Coupons/components/CouponCard.js +132 -0
- package/dist/packages/Coupons/components/Modal.d.ts +8 -0
- package/dist/packages/Coupons/components/Modal.js +34 -0
- package/dist/packages/Coupons/components/ModalFooter.d.ts +8 -0
- package/dist/packages/Coupons/components/ModalFooter.js +14 -0
- package/dist/packages/Coupons/components/ModalHeader.d.ts +6 -0
- package/dist/packages/Coupons/components/ModalHeader.js +25 -0
- package/dist/packages/Coupons/components/NoCoupons.d.ts +1 -0
- package/dist/packages/Coupons/components/NoCoupons.js +10 -0
- package/dist/packages/Coupons/test/Alert.test.js +18 -0
- package/dist/packages/Coupons/test/Breadcrumb.test.js +41 -0
- package/dist/packages/Coupons/test/ModalFooter.test.js +32 -0
- package/dist/packages/Coupons/test/ModalHeader.test.js +23 -0
- package/dist/packages/Coupons/test/NoCoupons.test.js +17 -0
- package/dist/packages/Coupons/types/CouponType.d.ts +8 -0
- package/dist/packages/Coupons/types/CouponType.js +1 -0
- package/dist/packages/Coupons/types/SetOrderFormCouponResponse.d.ts +10 -0
- package/dist/packages/Coupons/types/SetOrderFormCouponResponse.js +1 -0
- package/dist/packages/Coupons/types/Views.d.ts +1 -0
- package/dist/packages/Coupons/types/Views.js +1 -0
- package/dist/packages/Coupons/views/CouponsView.d.ts +13 -0
- package/dist/packages/Coupons/views/CouponsView.js +122 -0
- package/dist/packages/Coupons/views/EmptyCartView.d.ts +6 -0
- package/dist/packages/Coupons/views/EmptyCartView.js +37 -0
- package/dist/packages/Coupons/views/LoadingView.d.ts +7 -0
- package/dist/packages/Coupons/views/LoadingView.js +39 -0
- package/dist/packages/Coupons/views/OverwriteView.d.ts +14 -0
- package/dist/packages/Coupons/views/OverwriteView.js +58 -0
- package/dist/packages/Coupons/views/RulesView.d.ts +13 -0
- package/dist/packages/Coupons/views/RulesView.js +49 -0
- package/dist/packages/Coupons/views/index.d.ts +5 -0
- package/dist/packages/Coupons/views/index.js +12 -0
- package/dist/packages/Regionalization/Regionalization.d.ts +3 -0
- package/dist/packages/Regionalization/Regionalization.js +93 -0
- package/dist/packages/Regionalization/components/Delivery.d.ts +24 -0
- package/dist/packages/Regionalization/components/Delivery.js +48 -0
- package/dist/packages/Regionalization/components/DeliveryExpress.d.ts +9 -0
- package/dist/packages/Regionalization/components/DeliveryExpress.js +25 -0
- package/dist/packages/Regionalization/components/InfoPrices.d.ts +9 -0
- package/dist/packages/Regionalization/components/InfoPrices.js +15 -0
- package/dist/packages/Regionalization/components/Navigation.d.ts +6 -0
- package/dist/packages/Regionalization/components/Navigation.js +59 -0
- package/dist/packages/Regionalization/components/NormalDelivery.d.ts +7 -0
- package/dist/packages/Regionalization/components/NormalDelivery.js +23 -0
- package/dist/packages/Regionalization/components/PickupPoint.d.ts +7 -0
- package/dist/packages/Regionalization/components/PickupPoint.js +32 -0
- package/dist/packages/Regionalization/components/Price.d.ts +7 -0
- package/dist/packages/Regionalization/components/Price.js +10 -0
- package/dist/packages/Regionalization/components/SetViewButton.d.ts +11 -0
- package/dist/packages/Regionalization/components/SetViewButton.js +24 -0
- package/dist/packages/Regionalization/components/Title.d.ts +8 -0
- package/dist/packages/Regionalization/components/Title.js +21 -0
- package/dist/packages/Regionalization/context/RegionalizationContext.d.ts +4 -0
- package/dist/packages/Regionalization/context/RegionalizationContext.js +113 -0
- package/dist/packages/Regionalization/types/Address.d.ts +13 -0
- package/dist/packages/Regionalization/types/Address.js +1 -0
- package/dist/packages/Regionalization/types/ContextProps.d.ts +29 -0
- package/dist/packages/Regionalization/types/ContextProps.js +1 -0
- package/dist/packages/Regionalization/types/PikcupPointType.d.ts +22 -0
- package/dist/packages/Regionalization/types/PikcupPointType.js +1 -0
- package/dist/packages/Regionalization/types/PricesAndHours.d.ts +13 -0
- package/dist/packages/Regionalization/types/PricesAndHours.js +1 -0
- package/dist/packages/Regionalization/types/RegionalizationProps.d.ts +87 -0
- package/dist/packages/Regionalization/types/RegionalizationProps.js +1 -0
- package/dist/packages/Regionalization/types/index.d.ts +5 -0
- package/dist/packages/Regionalization/types/index.js +1 -0
- package/dist/packages/Regionalization/utils/constants.d.ts +1 -0
- package/dist/packages/Regionalization/utils/constants.js +4 -0
- package/dist/packages/Regionalization/utils/deliverySetData.d.ts +3 -0
- package/dist/packages/Regionalization/utils/deliverySetData.js +13 -0
- package/dist/packages/Regionalization/utils/formatPrice.d.ts +1 -0
- package/dist/packages/Regionalization/utils/formatPrice.js +8 -0
- package/dist/packages/Regionalization/utils/localStorage.d.ts +9 -0
- package/dist/packages/Regionalization/utils/localStorage.js +23 -0
- package/dist/packages/Regionalization/utils/pickupSetData.d.ts +3 -0
- package/dist/packages/Regionalization/utils/pickupSetData.js +11 -0
- package/dist/packages/Regionalization/utils/postalCode.d.ts +2 -0
- package/dist/packages/Regionalization/utils/postalCode.js +9 -0
- package/dist/packages/Regionalization/views/AllStoresScreen.d.ts +1 -0
- package/dist/packages/Regionalization/views/AllStoresScreen.js +73 -0
- package/dist/packages/Regionalization/views/ConfirmScreen.d.ts +1 -0
- package/dist/packages/Regionalization/views/ConfirmScreen.js +60 -0
- package/dist/packages/Regionalization/views/InitialView.d.ts +1 -0
- package/dist/packages/Regionalization/views/InitialView.js +49 -0
- package/dist/packages/Regionalization/views/MoreInfosScreen.d.ts +1 -0
- package/dist/packages/Regionalization/views/MoreInfosScreen.js +42 -0
- package/dist/packages/Regionalization/views/PickupPointInfoScreen.d.ts +1 -0
- package/dist/packages/Regionalization/views/PickupPointInfoScreen.js +42 -0
- package/dist/packages/Regionalization/views/PostalCodeInputScreen.d.ts +1 -0
- package/dist/packages/Regionalization/views/PostalCodeInputScreen.js +87 -0
- package/dist/packages/Regionalization/views/ViewsContainer.d.ts +1 -0
- package/dist/packages/Regionalization/views/ViewsContainer.js +22 -0
- package/dist/packages/Tour/Tour.d.ts +10 -0
- package/dist/packages/Tour/Tour.js +68 -0
- package/dist/packages/Tour/components/TooltipFooter.d.ts +11 -0
- package/dist/packages/Tour/components/TooltipFooter.js +14 -0
- package/dist/packages/Tour/components/TooltipHeader.d.ts +8 -0
- package/dist/packages/Tour/components/TooltipHeader.js +13 -0
- package/dist/packages/Tour/components/TourOverlay.d.ts +7 -0
- package/dist/packages/Tour/components/TourOverlay.js +12 -0
- package/dist/packages/Tour/components/TourTooltip.d.ts +17 -0
- package/dist/packages/Tour/components/TourTooltip.js +42 -0
- package/dist/packages/Tour/test/TooltipFooter.test.js +68 -0
- package/dist/packages/Tour/test/TooltipHeader.test.js +18 -0
- package/dist/packages/Tour/test/Tour.test.js +49 -0
- package/dist/packages/Tour/test/TourOverlay.test.js +18 -0
- package/dist/packages/Tour/test/TourTooltip.test.js +40 -0
- package/dist/packages/Tour/types/TourStep.d.ts +4 -0
- package/dist/packages/Tour/types/TourStep.js +1 -0
- package/dist/styles/carousel.global.css +1 -0
- package/dist/styles/coupons.global.css +1 -0
- package/dist/styles/regionalization.global.css +1 -0
- package/dist/styles/tour.global.css +1 -0
- package/package.json +5 -1
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { jsx as Z } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as _, useState as e, useEffect as M, useContext as ee } from "react";
|
|
3
|
+
import { removeSpecialCharacter as oe } from "../utils/postalCode.js";
|
|
4
|
+
import { getFullLocalStorage as c } from "../utils/localStorage.js";
|
|
5
|
+
const v = _(null), ae = ({
|
|
6
|
+
setMethod: o,
|
|
7
|
+
setPickupName: C,
|
|
8
|
+
setCity: p,
|
|
9
|
+
setUf: x,
|
|
10
|
+
setPickupTimes: y,
|
|
11
|
+
pricesAndHours: R,
|
|
12
|
+
setModalOpen: w,
|
|
13
|
+
inputPostalCode: l,
|
|
14
|
+
setInputPostalCode: D,
|
|
15
|
+
sendPostalCode: d,
|
|
16
|
+
status: I,
|
|
17
|
+
setStatus: i,
|
|
18
|
+
priceStockInformation: T = "",
|
|
19
|
+
pickupPoints: b,
|
|
20
|
+
titleText: z,
|
|
21
|
+
moreInfosText: P,
|
|
22
|
+
textBackButton: S,
|
|
23
|
+
confirmButton: h,
|
|
24
|
+
editAddress: H,
|
|
25
|
+
delivery: V,
|
|
26
|
+
deliveryPrice: k,
|
|
27
|
+
pickup: q,
|
|
28
|
+
regionalizeCatalog: E,
|
|
29
|
+
pickupConfirmScreenText: W,
|
|
30
|
+
children: j
|
|
31
|
+
}) => {
|
|
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)) ?? ""
|
|
35
|
+
}, X = async () => {
|
|
36
|
+
i({ loading: !0, message: "Carregando..." });
|
|
37
|
+
const {
|
|
38
|
+
isValid: n,
|
|
39
|
+
address: t,
|
|
40
|
+
deliveryInfos: a,
|
|
41
|
+
customShipping: r
|
|
42
|
+
} = await d();
|
|
43
|
+
n && (i({ loading: !1 }), u("delivery"), $(t), i({}), m(l), f(a), g("ConfirmScreen"), K(r));
|
|
44
|
+
}, Y = () => {
|
|
45
|
+
/\d{8}$/.test(
|
|
46
|
+
oe(l)
|
|
47
|
+
) ? X() : i({
|
|
48
|
+
status: "failed",
|
|
49
|
+
loading: !1,
|
|
50
|
+
message: "Que Pena, ainda não entregamos na sua região."
|
|
51
|
+
});
|
|
52
|
+
};
|
|
53
|
+
return M(() => {
|
|
54
|
+
var n, t, a, r;
|
|
55
|
+
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);
|
|
56
|
+
}, []), /* @__PURE__ */ Z(
|
|
57
|
+
v.Provider,
|
|
58
|
+
{
|
|
59
|
+
value: {
|
|
60
|
+
backToDelivery: N,
|
|
61
|
+
setBackToDelivery: O,
|
|
62
|
+
setMethod: o,
|
|
63
|
+
priceStockInformation: T,
|
|
64
|
+
setPickupName: C,
|
|
65
|
+
setCity: p,
|
|
66
|
+
setUf: x,
|
|
67
|
+
setPickupTimes: y,
|
|
68
|
+
pickupTimes: U,
|
|
69
|
+
pickupConfirmScreenText: W,
|
|
70
|
+
pricesAndHours: R,
|
|
71
|
+
setModalOpen: w,
|
|
72
|
+
inputPostalCode: l,
|
|
73
|
+
setInputPostalCode: D,
|
|
74
|
+
sendPostalCode: d,
|
|
75
|
+
status: I,
|
|
76
|
+
setStatus: i,
|
|
77
|
+
pickupPoints: b,
|
|
78
|
+
titleText: z,
|
|
79
|
+
moreInfosText: P,
|
|
80
|
+
customShippingData: J,
|
|
81
|
+
textBackButton: S,
|
|
82
|
+
confirmButton: h,
|
|
83
|
+
editAddress: H,
|
|
84
|
+
delivery: V,
|
|
85
|
+
pickup: q,
|
|
86
|
+
view: F,
|
|
87
|
+
setView: g,
|
|
88
|
+
postalCodeValidation: Y,
|
|
89
|
+
address: Q,
|
|
90
|
+
pickupAddress: s,
|
|
91
|
+
setPickupAddress: A,
|
|
92
|
+
deliveryRequestInfos: G,
|
|
93
|
+
postalCode: L,
|
|
94
|
+
internalMethod: B,
|
|
95
|
+
setInternalMethod: u,
|
|
96
|
+
regionalizeCatalog: E,
|
|
97
|
+
deliveryPrice: k
|
|
98
|
+
},
|
|
99
|
+
children: j
|
|
100
|
+
}
|
|
101
|
+
);
|
|
102
|
+
}, re = () => {
|
|
103
|
+
const o = ee(v);
|
|
104
|
+
if (!o)
|
|
105
|
+
throw new Error(
|
|
106
|
+
"useRegionalizationContext must be used within a RegionalizationContextProvider"
|
|
107
|
+
);
|
|
108
|
+
return o;
|
|
109
|
+
};
|
|
110
|
+
export {
|
|
111
|
+
ae as RegionalizationContextProvider,
|
|
112
|
+
re as useRegionalizationContext
|
|
113
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Address } from './Address';
|
|
2
|
+
import { BusinessHours, PikcupPointType } from './PikcupPointType';
|
|
3
|
+
import { CustomShippingProps } from './RegionalizationProps';
|
|
4
|
+
|
|
5
|
+
export interface ContextProps {
|
|
6
|
+
view?: View;
|
|
7
|
+
setView?: (view: View) => void;
|
|
8
|
+
postalCodeValidation?: () => void;
|
|
9
|
+
address?: Address;
|
|
10
|
+
pickupAddress?: PikcupPointType;
|
|
11
|
+
setPickupAddress?: (pickupAddress: PikcupPointType) => void;
|
|
12
|
+
deliveryRequestInfos?: DeliveryProps;
|
|
13
|
+
postalCode?: string;
|
|
14
|
+
internalMethod?: string;
|
|
15
|
+
setInternalMethod?: (method?: string) => void;
|
|
16
|
+
pickupTimes?: BusinessHours;
|
|
17
|
+
customShippingData?: CustomShippingProps;
|
|
18
|
+
}
|
|
19
|
+
export interface DeliveryProps {
|
|
20
|
+
deliveryChannel?: string;
|
|
21
|
+
deliveryName?: string;
|
|
22
|
+
shippingEstimate?: string;
|
|
23
|
+
}
|
|
24
|
+
export type View = 'PickupPointInfoScreen' | 'InitialView' | 'PostalCodeInputScreen' | 'MoreInfosScreen' | 'ConfirmScreen' | 'AllStoresScreen';
|
|
25
|
+
export interface UserAddressProps {
|
|
26
|
+
postalCode?: string;
|
|
27
|
+
city?: string;
|
|
28
|
+
uf?: string;
|
|
29
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export interface PikcupPointType {
|
|
2
|
+
id: string;
|
|
3
|
+
name: string;
|
|
4
|
+
address: {
|
|
5
|
+
postalCode: string;
|
|
6
|
+
city: string;
|
|
7
|
+
state: string;
|
|
8
|
+
neighborhood: string;
|
|
9
|
+
street: string;
|
|
10
|
+
number: string;
|
|
11
|
+
};
|
|
12
|
+
isActive: boolean;
|
|
13
|
+
businessHours: {
|
|
14
|
+
businessHoursWeek: BusinessHours;
|
|
15
|
+
businessHoursWeekend: BusinessHours;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
export interface BusinessHours {
|
|
19
|
+
dayOfWeek?: number;
|
|
20
|
+
openingTime: string;
|
|
21
|
+
closingTime: string;
|
|
22
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface PricesAndHours {
|
|
2
|
+
deliveryStartPrice: number;
|
|
3
|
+
pickupStartPrice: number;
|
|
4
|
+
pickupScheduling: number;
|
|
5
|
+
deliveryTimeWeekday: {
|
|
6
|
+
start: number;
|
|
7
|
+
end: number;
|
|
8
|
+
};
|
|
9
|
+
deliveryTimeWeekEndAndHolidays: {
|
|
10
|
+
start: number;
|
|
11
|
+
end: number;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { Address } from './Address';
|
|
3
|
+
import { PricesAndHours } from './PricesAndHours';
|
|
4
|
+
import { DeliveryProps } from './ContextProps';
|
|
5
|
+
import { BusinessHours, PikcupPointType } from './PikcupPointType';
|
|
6
|
+
|
|
7
|
+
export interface CustomShippingProps {
|
|
8
|
+
shippingList?: {
|
|
9
|
+
id: string;
|
|
10
|
+
name: string;
|
|
11
|
+
shippingEstimate: string;
|
|
12
|
+
listPrice: number;
|
|
13
|
+
}[];
|
|
14
|
+
isExpressEligible?: boolean;
|
|
15
|
+
expressShippingCmsQuantity?: string;
|
|
16
|
+
}
|
|
17
|
+
export interface RegionalizationProps {
|
|
18
|
+
backToDelivery?: boolean;
|
|
19
|
+
setBackToDelivery?: (backToDelivery: boolean) => void;
|
|
20
|
+
pickupConfirmScreenText?: string;
|
|
21
|
+
deliveryPrice?: number;
|
|
22
|
+
setMethod?: (method?: string) => void;
|
|
23
|
+
setPickupName?: (pickupName?: string) => void;
|
|
24
|
+
setCity?: (city?: string) => void;
|
|
25
|
+
setUf?: (uf?: string) => void;
|
|
26
|
+
setPickupTimes?: (pickupTimes?: BusinessHours) => void;
|
|
27
|
+
pricesAndHours: PricesAndHours;
|
|
28
|
+
setModalOpen: (modalOpen: boolean) => void;
|
|
29
|
+
inputPostalCode: string;
|
|
30
|
+
setInputPostalCode: (value: string) => void;
|
|
31
|
+
sendPostalCode: () => Promise<{
|
|
32
|
+
isValid?: boolean;
|
|
33
|
+
address?: Address;
|
|
34
|
+
deliveryInfos?: DeliveryProps;
|
|
35
|
+
customShipping?: CustomShippingProps;
|
|
36
|
+
}>;
|
|
37
|
+
status: Status;
|
|
38
|
+
setStatus: (status: Status) => void;
|
|
39
|
+
pickupPoints: PikcupPointType[];
|
|
40
|
+
titleText?: string;
|
|
41
|
+
priceStockInformation?: string;
|
|
42
|
+
moreInfosText?: string;
|
|
43
|
+
textBackButton?: string;
|
|
44
|
+
confirmButton?: string;
|
|
45
|
+
editAddress?: string;
|
|
46
|
+
delivery?: {
|
|
47
|
+
title?: string;
|
|
48
|
+
normalDelivery?: string;
|
|
49
|
+
expressDelivery?: string;
|
|
50
|
+
labelPrice?: string;
|
|
51
|
+
price?: number;
|
|
52
|
+
expressPrice?: number;
|
|
53
|
+
labelScheduling?: string;
|
|
54
|
+
scheduling?: string;
|
|
55
|
+
normalScheduling?: string;
|
|
56
|
+
expressScheduling?: string;
|
|
57
|
+
expressMessage?: string;
|
|
58
|
+
searchButton?: string;
|
|
59
|
+
linkHref?: string;
|
|
60
|
+
linkText?: string;
|
|
61
|
+
titleOk?: string;
|
|
62
|
+
labelAddress?: string;
|
|
63
|
+
confirmButton?: string;
|
|
64
|
+
};
|
|
65
|
+
pickup?: {
|
|
66
|
+
title?: string;
|
|
67
|
+
labelPrice?: string;
|
|
68
|
+
price?: number;
|
|
69
|
+
labelScheduling?: string;
|
|
70
|
+
scheduling?: string;
|
|
71
|
+
buttonOpenStores?: string;
|
|
72
|
+
labelFilter?: string;
|
|
73
|
+
labelStores?: string;
|
|
74
|
+
divider?: string;
|
|
75
|
+
chooseStore?: string;
|
|
76
|
+
titleOk?: string;
|
|
77
|
+
labelAddress?: string;
|
|
78
|
+
confirmButton?: string;
|
|
79
|
+
};
|
|
80
|
+
regionalizeCatalog?: (postalCodeChoiced?: string) => void;
|
|
81
|
+
children?: ReactNode;
|
|
82
|
+
}
|
|
83
|
+
export interface Status {
|
|
84
|
+
status?: 'failed';
|
|
85
|
+
message?: string;
|
|
86
|
+
loading?: boolean;
|
|
87
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const HAS_WINDOW: boolean;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { setLocalStorage as g } from "./localStorage.js";
|
|
2
|
+
const c = (i, t, m) => {
|
|
3
|
+
const p = JSON.stringify({
|
|
4
|
+
city: String(i == null ? void 0 : i.localidade),
|
|
5
|
+
uf: String(i == null ? void 0 : i.uf),
|
|
6
|
+
deliveryName: String(t == null ? void 0 : t.deliveryName),
|
|
7
|
+
shippingEstimate: String(t == null ? void 0 : t.shippingEstimate)
|
|
8
|
+
});
|
|
9
|
+
g("postalCode", m ?? ""), g("method", "delivery"), g("deliveryInfos", p);
|
|
10
|
+
};
|
|
11
|
+
export {
|
|
12
|
+
c as deliverySetData
|
|
13
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const formatPrice: (price: number) => string;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { UserAddressProps } from '../types';
|
|
2
|
+
|
|
3
|
+
export declare const setLocalStorage: (name: string, value: string) => void;
|
|
4
|
+
export declare const getLocalStorage: (name: string) => string | null | undefined;
|
|
5
|
+
export declare const getFullLocalStorage: () => {
|
|
6
|
+
regionalized: string | undefined;
|
|
7
|
+
deliveryInfos: any;
|
|
8
|
+
userAddressInfos: UserAddressProps;
|
|
9
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { HAS_WINDOW as a } from "./constants.js";
|
|
2
|
+
const n = (t, e) => {
|
|
3
|
+
a && localStorage.setItem(t, e);
|
|
4
|
+
}, s = (t) => {
|
|
5
|
+
if (a)
|
|
6
|
+
return localStorage.getItem(t);
|
|
7
|
+
}, d = () => {
|
|
8
|
+
const t = s("postalCode"), e = s("method"), o = JSON.parse(s("deliveryInfos") ?? "{}"), c = {
|
|
9
|
+
postalCode: t ?? "00000-000",
|
|
10
|
+
city: o == null ? void 0 : o.city,
|
|
11
|
+
uf: o == null ? void 0 : o.uf
|
|
12
|
+
}, r = e ?? void 0;
|
|
13
|
+
return {
|
|
14
|
+
regionalized: r,
|
|
15
|
+
deliveryInfos: r ? o : void 0,
|
|
16
|
+
userAddressInfos: c
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
export {
|
|
20
|
+
d as getFullLocalStorage,
|
|
21
|
+
s as getLocalStorage,
|
|
22
|
+
n as setLocalStorage
|
|
23
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { setLocalStorage as t } from "./localStorage.js";
|
|
2
|
+
const S = (o, n) => {
|
|
3
|
+
const a = JSON.stringify({
|
|
4
|
+
pickupTimes: n,
|
|
5
|
+
pickupPointName: String(o == null ? void 0 : o.name)
|
|
6
|
+
});
|
|
7
|
+
t("postalCode", String(o == null ? void 0 : o.address.postalCode)), t("method", "pickup-in-point"), t("pickupInfos", a);
|
|
8
|
+
};
|
|
9
|
+
export {
|
|
10
|
+
S as pickupSetData
|
|
11
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
const t = (e) => {
|
|
2
|
+
e.currentTarget.maxLength = 9;
|
|
3
|
+
let r = e.currentTarget.value;
|
|
4
|
+
return r = r.replace(/^(\d{5})(\d)/, "$1-$2"), e.currentTarget.value = r, e;
|
|
5
|
+
}, a = (e) => e.replace(/\D/g, "");
|
|
6
|
+
export {
|
|
7
|
+
t as postalCodeMask,
|
|
8
|
+
a as removeSpecialCharacter
|
|
9
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const AllStoresScreen: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { jsxs as o, Fragment as h, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as f, useState as v, useEffect as b } from "react";
|
|
3
|
+
import { Title as S } from "../components/Title.js";
|
|
4
|
+
import { PickupPoint as w } from "../components/PickupPoint.js";
|
|
5
|
+
import { GlassIcon as x } from "../../../assets/svgs/GlassIcon.js";
|
|
6
|
+
import { SetViewButton as N } from "../components/SetViewButton.js";
|
|
7
|
+
import { ArrowIcon as u } from "../../../assets/svgs/ArrowIcon.js";
|
|
8
|
+
import { useRegionalizationContext as C } from "../context/RegionalizationContext.js";
|
|
9
|
+
const E = () => {
|
|
10
|
+
const { pickup: t, pickupPoints: l, textBackButton: d } = C(), s = f(null), [n, a] = v(l), m = l.length > 0 ? l : [];
|
|
11
|
+
b(() => {
|
|
12
|
+
a(m);
|
|
13
|
+
}, [l]);
|
|
14
|
+
const i = () => {
|
|
15
|
+
a(
|
|
16
|
+
l == null ? void 0 : l.filter(
|
|
17
|
+
({ name: r }) => {
|
|
18
|
+
var c;
|
|
19
|
+
return r.toLowerCase().includes(((c = s.current) == null ? void 0 : c.value.toLowerCase()) ?? "");
|
|
20
|
+
}
|
|
21
|
+
)
|
|
22
|
+
);
|
|
23
|
+
};
|
|
24
|
+
return /* @__PURE__ */ o(h, { children: [
|
|
25
|
+
/* @__PURE__ */ e(S, { title: t == null ? void 0 : t.title }),
|
|
26
|
+
/* @__PURE__ */ o("div", { className: "stores-filter", children: [
|
|
27
|
+
/* @__PURE__ */ e("p", { children: t == null ? void 0 : t.labelFilter }),
|
|
28
|
+
/* @__PURE__ */ o("div", { children: [
|
|
29
|
+
/* @__PURE__ */ e(
|
|
30
|
+
"input",
|
|
31
|
+
{
|
|
32
|
+
type: "text",
|
|
33
|
+
placeholder: "Loja",
|
|
34
|
+
ref: s,
|
|
35
|
+
onKeyDown: (r) => r.key === "Enter" && i()
|
|
36
|
+
}
|
|
37
|
+
),
|
|
38
|
+
/* @__PURE__ */ e(
|
|
39
|
+
"button",
|
|
40
|
+
{
|
|
41
|
+
className: "filter-ico-container",
|
|
42
|
+
onClick: () => i(),
|
|
43
|
+
children: /* @__PURE__ */ e(x, {})
|
|
44
|
+
}
|
|
45
|
+
)
|
|
46
|
+
] }),
|
|
47
|
+
/* @__PURE__ */ e("div", { className: "divider", children: /* @__PURE__ */ e("span", { children: t == null ? void 0 : t.divider }) })
|
|
48
|
+
] }),
|
|
49
|
+
/* @__PURE__ */ e("p", { className: "stores-label", children: t == null ? void 0 : t.labelStores }),
|
|
50
|
+
/* @__PURE__ */ e("div", { className: "stores-container", children: n == null ? void 0 : n.map((r) => /* @__PURE__ */ e(
|
|
51
|
+
w,
|
|
52
|
+
{
|
|
53
|
+
pickupPointInfos: r
|
|
54
|
+
},
|
|
55
|
+
r == null ? void 0 : r.id
|
|
56
|
+
)) }),
|
|
57
|
+
/* @__PURE__ */ e("br", {}),
|
|
58
|
+
/* @__PURE__ */ o(
|
|
59
|
+
N,
|
|
60
|
+
{
|
|
61
|
+
view: "PickupPointInfoScreen",
|
|
62
|
+
className: "back-button-all-store",
|
|
63
|
+
children: [
|
|
64
|
+
/* @__PURE__ */ e("span", { children: /* @__PURE__ */ e(u, {}) }),
|
|
65
|
+
d
|
|
66
|
+
]
|
|
67
|
+
}
|
|
68
|
+
)
|
|
69
|
+
] });
|
|
70
|
+
};
|
|
71
|
+
export {
|
|
72
|
+
E as AllStoresScreen
|
|
73
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ConfirmScreen: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { jsxs as o, Fragment as m, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { Title as f } from "../components/Title.js";
|
|
3
|
+
import { SetViewButton as g } from "../components/SetViewButton.js";
|
|
4
|
+
import { InfoPrices as C } from "../components/InfoPrices.js";
|
|
5
|
+
import { Navigation as N } from "../components/Navigation.js";
|
|
6
|
+
import { Delivery as b } from "../components/Delivery.js";
|
|
7
|
+
import { useRegionalizationContext as v } from "../context/RegionalizationContext.js";
|
|
8
|
+
const I = () => {
|
|
9
|
+
const {
|
|
10
|
+
editAddress: s,
|
|
11
|
+
delivery: i,
|
|
12
|
+
pickup: e,
|
|
13
|
+
address: t,
|
|
14
|
+
pickupAddress: r,
|
|
15
|
+
internalMethod: l,
|
|
16
|
+
pickupTimes: a,
|
|
17
|
+
pickupConfirmScreenText: c
|
|
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
|
+
return /* @__PURE__ */ o(m, { children: [
|
|
20
|
+
/* @__PURE__ */ n(
|
|
21
|
+
f,
|
|
22
|
+
{
|
|
23
|
+
title: l === "delivery" ? i == null ? void 0 : i.titleOk : e == null ? void 0 : e.titleOk
|
|
24
|
+
}
|
|
25
|
+
),
|
|
26
|
+
/* @__PURE__ */ o("div", { className: "address-container", children: [
|
|
27
|
+
/* @__PURE__ */ o("p", { className: "address-title", children: [
|
|
28
|
+
/* @__PURE__ */ n("span", { children: l === "delivery" ? i == null ? void 0 : i.labelAddress : e == null ? void 0 : e.labelAddress }),
|
|
29
|
+
/* @__PURE__ */ n(g, { view: "PostalCodeInputScreen", className: "edit-button", children: s })
|
|
30
|
+
] }),
|
|
31
|
+
l === "delivery" ? /* @__PURE__ */ o(m, { children: [
|
|
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) ?? (t == null ? void 0 : t.localidade) })
|
|
34
|
+
] }) : /* @__PURE__ */ o(m, { children: [
|
|
35
|
+
/* @__PURE__ */ n("span", { children: r == null ? void 0 : r.name }),
|
|
36
|
+
/* @__PURE__ */ o("p", { className: "address-pickup", children: [
|
|
37
|
+
r == null ? void 0 : r.address.street,
|
|
38
|
+
", ",
|
|
39
|
+
r == null ? void 0 : r.address.number,
|
|
40
|
+
/* @__PURE__ */ n("br", {}),
|
|
41
|
+
r == null ? void 0 : r.address.neighborhood
|
|
42
|
+
] })
|
|
43
|
+
] })
|
|
44
|
+
] }),
|
|
45
|
+
l === "delivery" ? /* @__PURE__ */ n(b, { delivery: i, containerClassName: "delivery-container" }) : /* @__PURE__ */ n(
|
|
46
|
+
C,
|
|
47
|
+
{
|
|
48
|
+
containerClassName: "pickup-container",
|
|
49
|
+
priceClassName: "pickup-price",
|
|
50
|
+
labelPrice: e == null ? void 0 : e.labelPrice,
|
|
51
|
+
price: e == null ? void 0 : e.price,
|
|
52
|
+
scheduling: h
|
|
53
|
+
}
|
|
54
|
+
),
|
|
55
|
+
/* @__PURE__ */ n(N, { pickuConfirmScreem: l !== "delivery" })
|
|
56
|
+
] });
|
|
57
|
+
};
|
|
58
|
+
export {
|
|
59
|
+
I as ConfirmScreen
|
|
60
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const InitialView: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { jsxs as i, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect as p } from "react";
|
|
3
|
+
import { Title as f } from "../components/Title.js";
|
|
4
|
+
import { SetViewButton as t } from "../components/SetViewButton.js";
|
|
5
|
+
import { ArrowIcon as d } from "../../../assets/svgs/ArrowIcon.js";
|
|
6
|
+
import { ShoppingBagsIcon as h } from "../../../assets/svgs/ShoppingBagsIcon.js";
|
|
7
|
+
import { ShoppingIcon as I } from "../../../assets/svgs/ShoppingIcon.js";
|
|
8
|
+
import { useRegionalizationContext as u } from "../context/RegionalizationContext.js";
|
|
9
|
+
import { formatPrice as v } from "../utils/formatPrice.js";
|
|
10
|
+
const R = () => {
|
|
11
|
+
const {
|
|
12
|
+
titleText: c,
|
|
13
|
+
moreInfosText: a,
|
|
14
|
+
deliveryPrice: m,
|
|
15
|
+
priceStockInformation: s,
|
|
16
|
+
backToDelivery: n,
|
|
17
|
+
setBackToDelivery: r,
|
|
18
|
+
status: o,
|
|
19
|
+
setStatus: l
|
|
20
|
+
} = u();
|
|
21
|
+
return p(() => {
|
|
22
|
+
n && (r == null || r(!1)), (o == null ? void 0 : o.status) === "failed" && l({});
|
|
23
|
+
}, [n, o]), /* @__PURE__ */ i("div", { className: "inital-view-container", children: [
|
|
24
|
+
/* @__PURE__ */ e(f, { title: c }),
|
|
25
|
+
/* @__PURE__ */ e("p", { className: "price-stock-information", children: s }),
|
|
26
|
+
/* @__PURE__ */ i(t, { view: "MoreInfosScreen", className: "more-infos-button", children: [
|
|
27
|
+
a,
|
|
28
|
+
/* @__PURE__ */ e("span", { children: /* @__PURE__ */ e(d, {}) })
|
|
29
|
+
] }),
|
|
30
|
+
/* @__PURE__ */ i("div", { className: "delivery-option-container", children: [
|
|
31
|
+
/* @__PURE__ */ i(t, { view: "PostalCodeInputScreen", className: "option", children: [
|
|
32
|
+
/* @__PURE__ */ e(h, {}),
|
|
33
|
+
/* @__PURE__ */ e("h4", { children: "Receber em casa" }),
|
|
34
|
+
/* @__PURE__ */ i("p", { children: [
|
|
35
|
+
" A partir de ",
|
|
36
|
+
v(m ?? 0)
|
|
37
|
+
] })
|
|
38
|
+
] }),
|
|
39
|
+
/* @__PURE__ */ i(t, { view: "PickupPointInfoScreen", className: "option", children: [
|
|
40
|
+
/* @__PURE__ */ e(I, {}),
|
|
41
|
+
/* @__PURE__ */ e("h4", { children: "Retirar na Loja" }),
|
|
42
|
+
/* @__PURE__ */ e("p", { children: " Grátis" })
|
|
43
|
+
] })
|
|
44
|
+
] })
|
|
45
|
+
] });
|
|
46
|
+
};
|
|
47
|
+
export {
|
|
48
|
+
R as InitialView
|
|
49
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const MoreInfosScreen: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { jsxs as o, Fragment as s, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { Title as a } from "../components/Title.js";
|
|
3
|
+
import { Navigation as d } from "../components/Navigation.js";
|
|
4
|
+
import { useRegionalizationContext as m } from "../context/RegionalizationContext.js";
|
|
5
|
+
const i = ({ text: t, startHour: r, endHour: n }) => /* @__PURE__ */ o("div", { className: "opening-hours-container", children: [
|
|
6
|
+
/* @__PURE__ */ e("p", { children: t }),
|
|
7
|
+
/* @__PURE__ */ o("span", { children: [
|
|
8
|
+
"Das ",
|
|
9
|
+
r,
|
|
10
|
+
"h até às ",
|
|
11
|
+
n,
|
|
12
|
+
"h"
|
|
13
|
+
] })
|
|
14
|
+
] }), x = () => {
|
|
15
|
+
const {
|
|
16
|
+
moreInfosText: t,
|
|
17
|
+
pricesAndHours: { deliveryTimeWeekday: r, deliveryTimeWeekEndAndHolidays: n }
|
|
18
|
+
} = m();
|
|
19
|
+
return /* @__PURE__ */ o(s, { children: [
|
|
20
|
+
/* @__PURE__ */ e(a, { title: t, view: "InitialView" }),
|
|
21
|
+
/* @__PURE__ */ e(
|
|
22
|
+
i,
|
|
23
|
+
{
|
|
24
|
+
text: "Segunda a Sexta:",
|
|
25
|
+
startHour: r.start,
|
|
26
|
+
endHour: r.end
|
|
27
|
+
}
|
|
28
|
+
),
|
|
29
|
+
/* @__PURE__ */ e(
|
|
30
|
+
i,
|
|
31
|
+
{
|
|
32
|
+
text: "Fins de Semana e Feriados:",
|
|
33
|
+
startHour: n.start,
|
|
34
|
+
endHour: n.end
|
|
35
|
+
}
|
|
36
|
+
),
|
|
37
|
+
/* @__PURE__ */ e(d, { moreInfosScreen: !0 })
|
|
38
|
+
] });
|
|
39
|
+
};
|
|
40
|
+
export {
|
|
41
|
+
x as MoreInfosScreen
|
|
42
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const PickupPointInfoScreen: () => import("react/jsx-runtime").JSX.Element;
|