@plurix/ecom-components 1.14.2-commerce.8 → 1.14.2-shlo1445.1
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/ErrorIconV2.d.ts +1 -0
- package/dist/assets/svgs/ErrorIconV2.js +33 -0
- package/dist/assets/svgs/SuccessIconV2.d.ts +1 -0
- package/dist/assets/svgs/SuccessIconV2.js +30 -0
- package/dist/assets/svgs/WarningIconV2.d.ts +1 -0
- package/dist/assets/svgs/WarningIconV2.js +40 -0
- package/dist/hooks/useVerticalShelfCarouselProps.d.ts +4 -0
- package/dist/hooks/useVerticalShelfCarouselProps.js +14 -0
- package/dist/hooks/useWindowDimensions.d.ts +5 -0
- package/dist/hooks/useWindowDimensions.js +38 -0
- package/dist/main.d.ts +1 -0
- package/dist/main.js +19 -17
- package/dist/packages/AdaptiveCarousel/AdaptiveCarousel.d.ts +14 -0
- package/dist/packages/AdaptiveCarousel/AdaptiveCarousel.js +69 -0
- package/dist/packages/ChangeOrderModal/ChangeOrderModal.d.ts +12 -2
- package/dist/packages/ChangeOrderModal/ChangeOrderModal.js +79 -71
- package/dist/packages/ChangeOrderModal/api/getOrderForm.d.ts +1 -1
- package/dist/packages/ChangeOrderModal/api/getOrderForm.js +7 -9
- package/dist/packages/ChangeOrderModal/api/getProductsSimilars.d.ts +7 -5
- package/dist/packages/ChangeOrderModal/api/getProductsSimilars.js +18 -11
- package/dist/packages/ChangeOrderModal/api/postChangeOrder.d.ts +6 -1
- package/dist/packages/ChangeOrderModal/api/postChangeOrder.js +11 -11
- package/dist/packages/Coupons/Coupons.d.ts +4 -1
- package/dist/packages/Coupons/Coupons.js +67 -57
- package/dist/packages/Coupons/api/addCoupon.js +6 -6
- package/dist/packages/Coupons/api/getCoupons.js +5 -5
- package/dist/packages/Coupons/components/CouponCard.d.ts +3 -1
- package/dist/packages/Coupons/components/CouponCard.js +94 -83
- package/dist/packages/Coupons/views/CouponsView.d.ts +3 -1
- package/dist/packages/Coupons/views/CouponsView.js +87 -78
- package/dist/packages/ProductCard/ProductCardBadge/ProductCardBadgeKg.js +13 -10
- package/dist/packages/ProductCard/ProductCardBadge/ProductCardDiscountBadge.d.ts +3 -2
- package/dist/packages/ProductCard/ProductCardBadge/ProductCardDiscountBadge.js +15 -31
- package/dist/packages/ProductCard/ProductCardHorizontal/index.js +31 -30
- package/dist/packages/ProductCard/ProductCardPrice/index.d.ts +8 -1
- package/dist/packages/ProductCard/ProductCardPrice/index.js +27 -31
- package/dist/packages/ProductCard/ProductCardVertical/index.js +16 -15
- package/dist/packages/Regionalization/Regionalization.d.ts +1 -1
- package/dist/packages/Regionalization/Regionalization.js +15 -13
- package/dist/packages/Regionalization/context/RegionalizationContext.d.ts +1 -1
- package/dist/packages/Regionalization/context/RegionalizationContext.js +31 -29
- package/dist/packages/Regionalization/types/RegionalizationProps.d.ts +1 -0
- package/dist/packages/Regionalization/views/AllStoresScreen.js +21 -21
- package/dist/packages/VouchersRedeemed/VouchersRedeemed.d.ts +22 -0
- package/dist/packages/VouchersRedeemed/VouchersRedeemed.js +121 -0
- package/dist/packages/VouchersRedeemed/api/getCouponsCartonistByUser.d.ts +1 -0
- package/dist/packages/VouchersRedeemed/api/getCouponsCartonistByUser.js +20 -0
- package/dist/packages/VouchersRedeemed/components/StatusMessageTryApply/StatusMessageTryApply.d.ts +12 -0
- package/dist/packages/VouchersRedeemed/components/StatusMessageTryApply/StatusMessageTryApply.js +27 -0
- package/dist/packages/VouchersRedeemed/components/StatusMessageTryApply/index.d.ts +1 -0
- package/dist/packages/VouchersRedeemed/components/StatusMessageTryApply/index.js +4 -0
- package/dist/packages/VouchersRedeemed/components/VoucherRedeemedCard/VoucherRedeemedCard.d.ts +17 -0
- package/dist/packages/VouchersRedeemed/components/VoucherRedeemedCard/VoucherRedeemedCard.js +37 -0
- package/dist/packages/VouchersRedeemed/components/VoucherRedeemedCard/index.d.ts +1 -0
- package/dist/packages/VouchersRedeemed/components/VoucherRedeemedCard/index.js +4 -0
- package/dist/packages/VouchersRedeemed/components/VouchersRedeemedSkeleton/VouchersRedeemedSkeleton.d.ts +14 -0
- package/dist/packages/VouchersRedeemed/components/VouchersRedeemedSkeleton/VouchersRedeemedSkeleton.js +48 -0
- package/dist/packages/VouchersRedeemed/components/VouchersRedeemedSkeleton/index.d.ts +1 -0
- package/dist/packages/VouchersRedeemed/components/VouchersRedeemedSkeleton/index.js +4 -0
- package/dist/packages/VouchersRedeemed/data/validVouchers.d.ts +1 -0
- package/dist/packages/VouchersRedeemed/data/validVouchers.js +20 -0
- package/dist/packages/VouchersRedeemed/utils/getCouponPrice.d.ts +1 -0
- package/dist/packages/VouchersRedeemed/utils/getCouponPrice.js +8 -0
- package/dist/styles/adaptive-carousel.global.css +1 -0
- package/dist/styles/regionalization.global.css +1 -1
- package/dist/styles/vouchers-redeemed.global.css +1 -0
- package/dist/types/ProductCard.d.ts +13 -12
- package/dist/utils/carousel/carouselProps.d.ts +33 -0
- package/dist/utils/carousel/carouselProps.js +59 -0
- package/dist/utils/changerOrderModal.js +13 -16
- package/dist/utils/scroll/isScrollToEnd.d.ts +1 -0
- package/dist/utils/scroll/isScrollToEnd.js +4 -0
- package/dist/utils/setBoldTextParts.d.ts +1 -0
- package/dist/utils/setBoldTextParts.js +7 -0
- package/package.json +69 -69
|
@@ -1,122 +1,131 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import { jsxs as d, Fragment as _, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { useState as l, useEffect as Q } from "react";
|
|
3
|
+
import { ModalHeader as R } from "../components/ModalHeader.js";
|
|
4
|
+
import { ModalFooter as U } from "../components/ModalFooter.js";
|
|
5
|
+
import { CouponCard as V } from "../components/CouponCard.js";
|
|
6
|
+
import { NoCoupons as W } from "../components/NoCoupons.js";
|
|
7
|
+
import { Alert as X } from "../components/Alert.js";
|
|
8
|
+
import { InfoIcon as Y } from "../../../assets/svgs/InfoIcon.js";
|
|
9
|
+
import { addCoupon as Z } from "../api/addCoupon.js";
|
|
10
|
+
const to = ({
|
|
11
|
+
addCouponMutation: w,
|
|
12
|
+
removeCouponMutation: D,
|
|
13
|
+
account: x,
|
|
14
|
+
orderFormId: c,
|
|
13
15
|
hasItemsInCart: C,
|
|
14
16
|
isIO: p,
|
|
15
|
-
closeIOModal:
|
|
16
|
-
coupons:
|
|
17
|
+
closeIOModal: s,
|
|
18
|
+
coupons: n,
|
|
17
19
|
firstCouponName: i,
|
|
18
|
-
secondCouponName:
|
|
19
|
-
replaceCoupon:
|
|
20
|
-
setView:
|
|
21
|
-
setActiveRule:
|
|
22
|
-
setDataItem:
|
|
20
|
+
secondCouponName: L,
|
|
21
|
+
replaceCoupon: A,
|
|
22
|
+
setView: B,
|
|
23
|
+
setActiveRule: q,
|
|
24
|
+
setDataItem: H,
|
|
23
25
|
setFirstCouponName: m,
|
|
24
|
-
setSecondCouponName:
|
|
25
|
-
setReplaceCoupon:
|
|
26
|
-
setIsCloseModalEmpty:
|
|
27
|
-
genericTaggingEvent:
|
|
26
|
+
setSecondCouponName: f,
|
|
27
|
+
setReplaceCoupon: N,
|
|
28
|
+
setIsCloseModalEmpty: J,
|
|
29
|
+
genericTaggingEvent: t
|
|
28
30
|
}) => {
|
|
29
|
-
const [
|
|
30
|
-
|
|
31
|
-
},
|
|
32
|
-
|
|
31
|
+
const [r, P] = l(""), [k, j] = l(!1), [z, u] = l(""), [h, e] = l(!1), [G, y] = l(!1), K = (a) => {
|
|
32
|
+
a.preventDefault(), P(a.target.value);
|
|
33
|
+
}, M = async (a) => {
|
|
34
|
+
a.preventDefault();
|
|
33
35
|
try {
|
|
34
|
-
if (!i || i &&
|
|
36
|
+
if (!i || i && A) {
|
|
35
37
|
j(!0);
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
+
const b = p ? await Z(x, c, r) : await w({
|
|
39
|
+
input: {
|
|
40
|
+
orderFormId: c,
|
|
41
|
+
couponId: r
|
|
42
|
+
}
|
|
43
|
+
}), S = p ? b : JSON.parse(b.addCoupon.data);
|
|
44
|
+
N(!1), f(""), S.error.length <= 0 ? (t == null || t("discount_coupon", {
|
|
38
45
|
name: "Cupom aplicado do input",
|
|
39
|
-
couponName:
|
|
40
|
-
}),
|
|
46
|
+
couponName: r
|
|
47
|
+
}), u("success"), y(!0), m(r), p && window.location.reload()) : (t == null || t("discount_coupon", {
|
|
41
48
|
name: "Cupom do input expirado ou invalido",
|
|
42
|
-
couponName:
|
|
43
|
-
objectError:
|
|
44
|
-
}),
|
|
49
|
+
couponName: r,
|
|
50
|
+
objectError: S.error
|
|
51
|
+
}), u("error"), y(!1), m("")), e(!0);
|
|
45
52
|
} else
|
|
46
|
-
|
|
47
|
-
} catch (
|
|
48
|
-
|
|
53
|
+
f(r), B("overwrite-view");
|
|
54
|
+
} catch (b) {
|
|
55
|
+
t == null || t("discount_coupon", {
|
|
49
56
|
name: "Cupom do input - error na api",
|
|
50
|
-
couponName:
|
|
51
|
-
}),
|
|
57
|
+
couponName: r
|
|
58
|
+
}), u("error"), y(!1), e(!0);
|
|
52
59
|
} finally {
|
|
53
60
|
j(!1);
|
|
54
61
|
}
|
|
55
62
|
};
|
|
56
|
-
return
|
|
57
|
-
|
|
58
|
-
}, [
|
|
59
|
-
p &&
|
|
60
|
-
|
|
63
|
+
return Q(() => {
|
|
64
|
+
h && setTimeout(() => e(!1), 5e3);
|
|
65
|
+
}, [G, h]), /* @__PURE__ */ d(_, { children: [
|
|
66
|
+
p && s && /* @__PURE__ */ o(
|
|
67
|
+
R,
|
|
61
68
|
{
|
|
62
|
-
closeModal:
|
|
69
|
+
closeModal: s,
|
|
63
70
|
title: "Meus Cupons",
|
|
64
|
-
genericTaggingEvent:
|
|
71
|
+
genericTaggingEvent: t
|
|
65
72
|
}
|
|
66
73
|
),
|
|
67
|
-
C ? /* @__PURE__ */ o("div", { className: "form-coupons", children: /* @__PURE__ */
|
|
74
|
+
C ? /* @__PURE__ */ o("div", { className: "form-coupons", children: /* @__PURE__ */ d("form", { onSubmit: M, children: [
|
|
68
75
|
/* @__PURE__ */ o(
|
|
69
76
|
"input",
|
|
70
77
|
{
|
|
71
78
|
type: "text",
|
|
72
79
|
placeholder: "Insira o cupom",
|
|
73
|
-
value:
|
|
74
|
-
onChange:
|
|
80
|
+
value: r,
|
|
81
|
+
onChange: K
|
|
75
82
|
}
|
|
76
83
|
),
|
|
77
|
-
/* @__PURE__ */ o("button", { type: "submit", name: "adicionar", disabled:
|
|
78
|
-
] }) }) : /* @__PURE__ */ o("div", { className: "cart-empty-coupons-label", children: /* @__PURE__ */
|
|
79
|
-
/* @__PURE__ */ o("span", { children: /* @__PURE__ */ o(
|
|
84
|
+
/* @__PURE__ */ o("button", { type: "submit", name: "adicionar", disabled: k, children: "Adicionar" })
|
|
85
|
+
] }) }) : /* @__PURE__ */ o("div", { className: "cart-empty-coupons-label", children: /* @__PURE__ */ d("p", { children: [
|
|
86
|
+
/* @__PURE__ */ o("span", { children: /* @__PURE__ */ o(Y, {}) }),
|
|
80
87
|
"Para adicionar um cupom é necessário que você adicione pelo menos 1 produto no carrinho"
|
|
81
88
|
] }) }),
|
|
82
|
-
/* @__PURE__ */ o("div", { className: "container-title-coupons", children:
|
|
89
|
+
/* @__PURE__ */ o("div", { className: "container-title-coupons", children: n.length > 0 ? /* @__PURE__ */ d(_, { children: [
|
|
83
90
|
/* @__PURE__ */ o("h2", { children: "Cupons disponíveis" }),
|
|
84
|
-
/* @__PURE__ */ o("div", { className: "container-coupons", children:
|
|
85
|
-
|
|
91
|
+
/* @__PURE__ */ o("div", { className: "container-coupons", children: n.map((a) => /* @__PURE__ */ o(
|
|
92
|
+
V,
|
|
86
93
|
{
|
|
87
|
-
|
|
88
|
-
|
|
94
|
+
removeCouponMutation: D,
|
|
95
|
+
addCouponMutation: w,
|
|
96
|
+
account: x,
|
|
97
|
+
orderFormId: c,
|
|
89
98
|
hasItemsInCart: C,
|
|
90
99
|
isIO: p,
|
|
91
|
-
item:
|
|
100
|
+
item: a,
|
|
92
101
|
firstCouponName: i,
|
|
93
|
-
secondCouponName:
|
|
94
|
-
replaceCoupon:
|
|
95
|
-
setView:
|
|
102
|
+
secondCouponName: L,
|
|
103
|
+
replaceCoupon: A,
|
|
104
|
+
setView: B,
|
|
96
105
|
setFirstCouponName: m,
|
|
97
|
-
setSecondCouponName:
|
|
98
|
-
setActiveRule:
|
|
99
|
-
setDataItem:
|
|
100
|
-
setReplaceCoupon:
|
|
101
|
-
setAlert:
|
|
102
|
-
setType:
|
|
103
|
-
setIsCloseModalEmpty:
|
|
104
|
-
genericTaggingEvent:
|
|
106
|
+
setSecondCouponName: f,
|
|
107
|
+
setActiveRule: q,
|
|
108
|
+
setDataItem: H,
|
|
109
|
+
setReplaceCoupon: N,
|
|
110
|
+
setAlert: e,
|
|
111
|
+
setType: u,
|
|
112
|
+
setIsCloseModalEmpty: J,
|
|
113
|
+
genericTaggingEvent: t
|
|
105
114
|
},
|
|
106
|
-
|
|
115
|
+
a.couponName
|
|
107
116
|
)) })
|
|
108
|
-
] }) : /* @__PURE__ */ o(
|
|
109
|
-
|
|
110
|
-
p &&
|
|
111
|
-
|
|
117
|
+
] }) : /* @__PURE__ */ o(W, {}) }),
|
|
118
|
+
h && /* @__PURE__ */ o(X, { type: z }),
|
|
119
|
+
p && s && /* @__PURE__ */ o(
|
|
120
|
+
U,
|
|
112
121
|
{
|
|
113
|
-
isFloating:
|
|
114
|
-
cancelButtonAction:
|
|
122
|
+
isFloating: n.length > 0,
|
|
123
|
+
cancelButtonAction: s,
|
|
115
124
|
cancelButtonText: "Sair"
|
|
116
125
|
}
|
|
117
126
|
)
|
|
118
127
|
] });
|
|
119
128
|
};
|
|
120
129
|
export {
|
|
121
|
-
|
|
130
|
+
to as CouponsView
|
|
122
131
|
};
|
|
@@ -1,15 +1,18 @@
|
|
|
1
|
-
import { jsx as a, jsxs as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { jsx as a, jsxs as g } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect as o } from "react";
|
|
3
|
+
const f = ({
|
|
4
|
+
measurementUnit: c,
|
|
5
|
+
setIsShowProductBadge: r,
|
|
6
|
+
unitMultiplier: d
|
|
7
|
+
}) => (o(() => {
|
|
8
|
+
c !== "un" && (d < 1 || d >= 1) && r(!0);
|
|
9
|
+
}, [c, d, r]), c === "un" ? null : d < 1 ? /* @__PURE__ */ a("div", { className: "product-card-badge", children: /* @__PURE__ */ g("p", { className: "product-card-badge-kg", children: [
|
|
10
|
+
d * 1e3,
|
|
8
11
|
"g"
|
|
9
|
-
] }) })
|
|
10
|
-
|
|
12
|
+
] }) }) : /* @__PURE__ */ a("div", { className: "product-card-badge", children: /* @__PURE__ */ g("p", { className: "product-card-badge-kg", children: [
|
|
13
|
+
d,
|
|
11
14
|
"kg"
|
|
12
15
|
] }) }));
|
|
13
16
|
export {
|
|
14
|
-
|
|
17
|
+
f as ProductCardBadgeKg
|
|
15
18
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SkuSpecificationsProps, ProductCardProps } from '../../../types/ProductCard';
|
|
1
|
+
import { SkuSpecificationsProps, ProductCardProps, offers } from '../../../types/ProductCard';
|
|
2
2
|
|
|
3
3
|
interface ProductCardDiscountBadge {
|
|
4
4
|
skuSpecifications: SkuSpecificationsProps[];
|
|
@@ -8,6 +8,7 @@ interface ProductCardDiscountBadge {
|
|
|
8
8
|
hasPromotionalPrice: ProductCardProps['hasPromotionalPrice'];
|
|
9
9
|
defaultScListPrice?: number;
|
|
10
10
|
setIsShowProductBadge: React.Dispatch<React.SetStateAction<boolean>>;
|
|
11
|
+
offers: offers;
|
|
11
12
|
}
|
|
12
|
-
export declare const ProductCardDiscountBadge: ({
|
|
13
|
+
export declare const ProductCardDiscountBadge: ({ offers, setIsShowProductBadge }: ProductCardDiscountBadge) => import("react/jsx-runtime").JSX.Element | null;
|
|
13
14
|
export {};
|
|
@@ -1,42 +1,26 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import {
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
skuSpecifications: n,
|
|
7
|
-
unitMultiplier: a,
|
|
8
|
-
hasPromotionalPrice: i,
|
|
9
|
-
defaultScListPrice: P,
|
|
10
|
-
setIsShowProductBadge: d
|
|
1
|
+
import { jsx as d, jsxs as i } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect as a, useMemo as m } from "react";
|
|
3
|
+
const h = ({
|
|
4
|
+
offers: n,
|
|
5
|
+
setIsShowProductBadge: c
|
|
11
6
|
}) => {
|
|
12
|
-
const { listPrice: u,
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
spotPriceCustom: o
|
|
18
|
-
} : {
|
|
19
|
-
listPriceCustom: c,
|
|
20
|
-
spotPriceCustom: s
|
|
21
|
-
}, [
|
|
22
|
-
u,
|
|
23
|
-
o,
|
|
24
|
-
s,
|
|
25
|
-
c
|
|
26
|
-
]), C = "Venda por unidade", N = n == null ? void 0 : n.some((r) => r.field.originalName === C && r.values.some((e) => e.originalName === "true")), h = P || (N ? m : ((r) => Number(r.toString().match(/^\d+(?:\.\d{0,2})?/)))(m * a)), t = Math.round(
|
|
27
|
-
Number(f(h, p))
|
|
7
|
+
const { listPrice: u, price: o } = n == null ? void 0 : n.offers[0], t = Math.round(
|
|
8
|
+
Number(((r, e) => m(() => {
|
|
9
|
+
const s = (r - e) * 100 / r;
|
|
10
|
+
return Math.round(s);
|
|
11
|
+
}, [e, r]))(u, o))
|
|
28
12
|
);
|
|
29
|
-
return
|
|
13
|
+
return a(() => {
|
|
30
14
|
if (!t || t <= 0) {
|
|
31
|
-
|
|
15
|
+
c(!1);
|
|
32
16
|
return;
|
|
33
17
|
}
|
|
34
|
-
|
|
35
|
-
}, [t]), !t || t <= 0 ? null : /* @__PURE__ */
|
|
18
|
+
c(!0);
|
|
19
|
+
}, [t]), !t || t <= 0 ? null : /* @__PURE__ */ d("div", { className: "product-card-discount-badge", children: /* @__PURE__ */ i("p", { className: "product-card-discount-badge-value", children: [
|
|
36
20
|
t,
|
|
37
21
|
"%"
|
|
38
22
|
] }) });
|
|
39
23
|
};
|
|
40
24
|
export {
|
|
41
|
-
|
|
25
|
+
h as ProductCardDiscountBadge
|
|
42
26
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as r, jsxs as s } from "react/jsx-runtime";
|
|
2
2
|
import { useState as v } from "react";
|
|
3
3
|
import { ProductCardUnavailable as x } from "../ProducCardUnavailable/index.js";
|
|
4
4
|
import { ProductCardBadgeKg as y } from "../ProductCardBadge/ProductCardBadgeKg.js";
|
|
@@ -7,7 +7,7 @@ import { ProductCardButton as b } from "../ProductCardButton/index.js";
|
|
|
7
7
|
import { ProductCardImage as M } from "../ProductCardImage/index.js";
|
|
8
8
|
import { ProductCardName as N } from "../ProductCardName/index.js";
|
|
9
9
|
import { ProductCardPrice as O } from "../ProductCardPrice/index.js";
|
|
10
|
-
import { ProductCardPromotionFlag as
|
|
10
|
+
import { ProductCardPromotionFlag as B } from "../ProductCardPromotionFlag/index.js";
|
|
11
11
|
const G = ({
|
|
12
12
|
hasPlusFriendBadge: a,
|
|
13
13
|
promotion: i,
|
|
@@ -15,7 +15,7 @@ const G = ({
|
|
|
15
15
|
hasPromotionalPrice: c,
|
|
16
16
|
clubPrice: C,
|
|
17
17
|
outOfStock: o,
|
|
18
|
-
variant:
|
|
18
|
+
variant: t,
|
|
19
19
|
defaultScListPrice: l,
|
|
20
20
|
isClubClient: u,
|
|
21
21
|
addToCartAction: P,
|
|
@@ -23,19 +23,19 @@ const G = ({
|
|
|
23
23
|
productInCart: h,
|
|
24
24
|
openModal: S
|
|
25
25
|
}) => {
|
|
26
|
-
var
|
|
27
|
-
const [k,
|
|
26
|
+
var f, d;
|
|
27
|
+
const [k, n] = v(!1);
|
|
28
28
|
if (o)
|
|
29
|
-
return /* @__PURE__ */
|
|
29
|
+
return /* @__PURE__ */ r(
|
|
30
30
|
x,
|
|
31
31
|
{
|
|
32
|
-
image: (
|
|
32
|
+
image: (f = e.image) == null ? void 0 : f[0],
|
|
33
33
|
name: e.name,
|
|
34
34
|
variant: "horizontal"
|
|
35
35
|
}
|
|
36
36
|
);
|
|
37
|
-
const
|
|
38
|
-
return /* @__PURE__ */
|
|
37
|
+
const m = u && e.hasClubPrice;
|
|
38
|
+
return /* @__PURE__ */ s(
|
|
39
39
|
"div",
|
|
40
40
|
{
|
|
41
41
|
className: "product-card-horizontal",
|
|
@@ -43,67 +43,68 @@ const G = ({
|
|
|
43
43
|
backgroundColor: o ? "var(--color-grayScale-faded" : "#fff"
|
|
44
44
|
},
|
|
45
45
|
children: [
|
|
46
|
-
/* @__PURE__ */
|
|
46
|
+
/* @__PURE__ */ s(
|
|
47
47
|
"div",
|
|
48
48
|
{
|
|
49
49
|
onClick: S,
|
|
50
50
|
className: "product-card-section-product-horizontal",
|
|
51
51
|
children: [
|
|
52
|
-
/* @__PURE__ */
|
|
52
|
+
/* @__PURE__ */ r(
|
|
53
53
|
M,
|
|
54
54
|
{
|
|
55
|
-
isProductClubAndClient:
|
|
56
|
-
variant:
|
|
55
|
+
isProductClubAndClient: m,
|
|
56
|
+
variant: t,
|
|
57
57
|
hasPlusFriendBadge: a,
|
|
58
58
|
promotion: i,
|
|
59
|
-
image: (
|
|
59
|
+
image: (d = e.image) == null ? void 0 : d[0]
|
|
60
60
|
}
|
|
61
61
|
),
|
|
62
|
-
/* @__PURE__ */
|
|
62
|
+
/* @__PURE__ */ s(
|
|
63
63
|
"div",
|
|
64
64
|
{
|
|
65
65
|
className: "product-card-horizontal-description",
|
|
66
66
|
style: {
|
|
67
|
-
backgroundColor:
|
|
67
|
+
backgroundColor: m ? "#FDF3DE" : "var(--color-grayScale-faded)"
|
|
68
68
|
},
|
|
69
69
|
children: [
|
|
70
|
-
/* @__PURE__ */
|
|
71
|
-
/* @__PURE__ */
|
|
72
|
-
/* @__PURE__ */
|
|
70
|
+
/* @__PURE__ */ s("div", { className: "product-card-section-name", children: [
|
|
71
|
+
/* @__PURE__ */ r(N, { name: e.name }),
|
|
72
|
+
/* @__PURE__ */ s(
|
|
73
73
|
"div",
|
|
74
74
|
{
|
|
75
75
|
className: "product-card-section-badge-horizontal",
|
|
76
76
|
style: { display: k ? "" : "none" },
|
|
77
77
|
children: [
|
|
78
|
-
/* @__PURE__ */
|
|
78
|
+
/* @__PURE__ */ r(
|
|
79
79
|
y,
|
|
80
80
|
{
|
|
81
81
|
unitMultiplier: e.unitMultiplier,
|
|
82
82
|
skuSpecifications: e.skuSpecifications,
|
|
83
83
|
measurementUnit: e.measurementUnit,
|
|
84
|
-
setIsShowProductBadge:
|
|
84
|
+
setIsShowProductBadge: n
|
|
85
85
|
}
|
|
86
86
|
),
|
|
87
|
-
/* @__PURE__ */
|
|
87
|
+
/* @__PURE__ */ r(
|
|
88
88
|
z,
|
|
89
89
|
{
|
|
90
|
+
offers: e.offers,
|
|
90
91
|
defaultScListPrice: l,
|
|
91
92
|
nativeListPrice: e.customOffers.listPriceCustom,
|
|
92
93
|
nativeSpotPrice: e.customOffers.spotPriceCustom,
|
|
93
94
|
skuSpecifications: e.skuSpecifications,
|
|
94
95
|
unitMultiplier: e.unitMultiplier,
|
|
95
96
|
hasPromotionalPrice: c,
|
|
96
|
-
setIsShowProductBadge:
|
|
97
|
+
setIsShowProductBadge: n
|
|
97
98
|
}
|
|
98
99
|
)
|
|
99
100
|
]
|
|
100
101
|
}
|
|
101
102
|
)
|
|
102
103
|
] }),
|
|
103
|
-
|
|
104
|
-
|
|
104
|
+
t === "horizontal" && /* @__PURE__ */ r(
|
|
105
|
+
B,
|
|
105
106
|
{
|
|
106
|
-
variant:
|
|
107
|
+
variant: t,
|
|
107
108
|
productSectionBadge: {
|
|
108
109
|
text: i == null ? void 0 : i.flagText,
|
|
109
110
|
color: {
|
|
@@ -113,7 +114,7 @@ const G = ({
|
|
|
113
114
|
}
|
|
114
115
|
}
|
|
115
116
|
),
|
|
116
|
-
/* @__PURE__ */
|
|
117
|
+
/* @__PURE__ */ r(
|
|
117
118
|
O,
|
|
118
119
|
{
|
|
119
120
|
isClubClient: u,
|
|
@@ -125,7 +126,7 @@ const G = ({
|
|
|
125
126
|
listPriceCustom: e.customOffers.listPriceCustom,
|
|
126
127
|
hasDiscount: e.customOffers.hasDiscount,
|
|
127
128
|
spotPriceCustom: e.customOffers.spotPriceCustom,
|
|
128
|
-
spotPriceKg: e.customOffers.
|
|
129
|
+
spotPriceKg: e.customOffers.spotPriceKg
|
|
129
130
|
},
|
|
130
131
|
defaultScListPrice: l,
|
|
131
132
|
clubPrice: C,
|
|
@@ -138,13 +139,13 @@ const G = ({
|
|
|
138
139
|
]
|
|
139
140
|
}
|
|
140
141
|
),
|
|
141
|
-
/* @__PURE__ */
|
|
142
|
+
/* @__PURE__ */ r(
|
|
142
143
|
b,
|
|
143
144
|
{
|
|
144
145
|
addToCartAction: P,
|
|
145
146
|
quantitySelectorAction: g,
|
|
146
147
|
productInCart: h,
|
|
147
|
-
layout:
|
|
148
|
+
layout: t
|
|
148
149
|
}
|
|
149
150
|
)
|
|
150
151
|
]
|
|
@@ -20,5 +20,12 @@ interface ProductCardPricesProps {
|
|
|
20
20
|
unitMultiplier: number;
|
|
21
21
|
hasPlusFriendBadge?: boolean;
|
|
22
22
|
}
|
|
23
|
-
export declare const ProductCardPrice: ({
|
|
23
|
+
export declare const ProductCardPrice: ({ clubPrice, unitMultiplier, customOffers, measurementUnit, isClubClient, hasPlusFriendBadge }: ProductCardPricesProps) => import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
interface getPriceToShowParams {
|
|
25
|
+
spotPriceKg: number | undefined | null;
|
|
26
|
+
unitMultiplier: number;
|
|
27
|
+
measurementUnit?: string;
|
|
28
|
+
spotPriceCustom: number;
|
|
29
|
+
}
|
|
30
|
+
export declare const getPriceToShow: ({ spotPriceKg, unitMultiplier, measurementUnit, spotPriceCustom }: getPriceToShowParams) => number | null | undefined;
|
|
24
31
|
export {};
|
|
@@ -1,39 +1,35 @@
|
|
|
1
|
-
import { jsx as e, Fragment as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
hasPromotionalPrice: C,
|
|
6
|
-
clubPrice: i,
|
|
7
|
-
unitMultiplier: h,
|
|
8
|
-
defaultScListPrice: n,
|
|
1
|
+
import { jsx as e, Fragment as g, jsxs as a } from "react/jsx-runtime";
|
|
2
|
+
const m = ({
|
|
3
|
+
clubPrice: c,
|
|
4
|
+
unitMultiplier: t,
|
|
9
5
|
customOffers: r,
|
|
10
|
-
measurementUnit:
|
|
11
|
-
isClubClient:
|
|
12
|
-
hasPlusFriendBadge:
|
|
6
|
+
measurementUnit: n,
|
|
7
|
+
isClubClient: d,
|
|
8
|
+
hasPlusFriendBadge: p
|
|
13
9
|
}) => {
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
spotPriceCustom:
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
s,
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
r.listPriceCustom
|
|
25
|
-
]), b = !!(i && i !== r.spotPriceCustom), B = !!(n && n !== P), l = (o) => o.toLocaleString("pt-br", { style: "currency", currency: "BRL" }), w = "Venda por unidade", u = t == null ? void 0 : t.some((o) => o.field.originalName === w && o.values.some((F) => F.originalName === "true")), x = N !== "un", a = n || (u ? m : ((o) => Number(o.toString().match(/^\d+(?:\.\d{0,2})?/)))(m * h)), y = v ? "no + Amigo" : "no clube", d = x && r.spotPriceKg && u ? r.spotPriceKg : P, D = (a > d || B) && a && d;
|
|
26
|
-
return /* @__PURE__ */ e(j, { children: /* @__PURE__ */ p("div", { className: "product-card-price", children: [
|
|
27
|
-
!g && b && /* @__PURE__ */ e("div", { className: "product-card-club-price-container", children: /* @__PURE__ */ e("p", { className: "product-card-club-price", children: `${l(i || 0)} ${y}` }) }),
|
|
28
|
-
/* @__PURE__ */ p("div", { className: "product-card-price-container", children: [
|
|
29
|
-
D && /* @__PURE__ */ e("p", { className: "product-card-old-price", children: /* @__PURE__ */ p("span", { children: [
|
|
10
|
+
const l = !!(c && c !== r.spotPriceCustom), o = (u) => u.toLocaleString("pt-br", { style: "currency", currency: "BRL" }), i = h({
|
|
11
|
+
measurementUnit: n,
|
|
12
|
+
spotPriceCustom: r.spotPriceCustom,
|
|
13
|
+
spotPriceKg: r == null ? void 0 : r.spotPriceKg,
|
|
14
|
+
unitMultiplier: t
|
|
15
|
+
}), s = p ? "no + Amigo" : "no clube";
|
|
16
|
+
return /* @__PURE__ */ e(g, { children: /* @__PURE__ */ a("div", { className: "product-card-price", children: [
|
|
17
|
+
!d && l && c !== i && /* @__PURE__ */ e("div", { className: "product-card-club-price-container", children: /* @__PURE__ */ e("p", { className: "product-card-club-price", children: `${o(c || 0)} ${s}` }) }),
|
|
18
|
+
/* @__PURE__ */ a("div", { className: "product-card-price-container", children: [
|
|
19
|
+
r.listPriceCustom !== i && /* @__PURE__ */ e("p", { className: "product-card-old-price", children: /* @__PURE__ */ a("span", { children: [
|
|
30
20
|
" ",
|
|
31
|
-
|
|
21
|
+
o(r.listPriceCustom)
|
|
32
22
|
] }) }),
|
|
33
|
-
/* @__PURE__ */ e("p", { className: "product-card-new-price", children:
|
|
23
|
+
/* @__PURE__ */ e("p", { className: "product-card-new-price", children: o(i != null ? i : 0) })
|
|
34
24
|
] })
|
|
35
25
|
] }) });
|
|
36
|
-
}
|
|
26
|
+
}, h = ({
|
|
27
|
+
spotPriceKg: c,
|
|
28
|
+
unitMultiplier: t,
|
|
29
|
+
measurementUnit: r,
|
|
30
|
+
spotPriceCustom: n
|
|
31
|
+
}) => r === "kg" && t < 1 ? n : r === "kg" ? c : n;
|
|
37
32
|
export {
|
|
38
|
-
|
|
33
|
+
m as ProductCardPrice,
|
|
34
|
+
h as getPriceToShow
|
|
39
35
|
};
|