@plurix/ecom-components 1.14.1-bugfix.0 → 1.14.1-bugfix.2
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/constants/index.js +1 -1
- package/dist/main.d.ts +9 -2
- package/dist/main.js +18 -12
- package/dist/node_modules/@faststore/components/dist/esm/atoms/Button/Button.js +45 -0
- package/dist/node_modules/@faststore/components/dist/esm/atoms/Loader/Loader.js +34 -0
- package/dist/node_modules/@faststore/components/dist/esm/molecules/IconButton/IconButton.js +29 -0
- package/dist/packages/Carousel/Carousel.js +96 -92
- package/dist/packages/CartClubAlert/CartClubAlert.js +1 -1
- package/dist/packages/ChangeOrderModal/ChangeOrderModal.js +1 -1
- package/dist/packages/ChangeOrderModal/assets/icons.js +30 -19
- package/dist/packages/ContactCard/ContactCard.d.ts +22 -0
- package/dist/packages/ContactCard/ContactCard.js +40 -0
- package/dist/packages/Coupons/Coupons.js +31 -31
- package/dist/packages/Coupons/components/CouponCard.js +28 -28
- package/dist/packages/Coupons/components/Modal.js +60 -32
- package/dist/packages/Coupons/views/CouponsView.js +22 -22
- package/dist/packages/Modal/Modal.js +1 -1
- package/dist/packages/Onboarding/Onboarding.js +1 -1
- package/dist/packages/ProductCard/ProducCardUnavailable/index.d.ts +3 -0
- package/dist/packages/ProductCard/ProducCardUnavailable/index.js +67 -0
- package/dist/packages/ProductCard/ProductCardBadge/ProductCardBadgeClube.d.ts +5 -0
- package/dist/packages/ProductCard/ProductCardBadge/ProductCardBadgeClube.js +5 -0
- package/dist/packages/ProductCard/ProductCardBadge/ProductCardBadgeKg.d.ts +10 -0
- package/dist/packages/ProductCard/ProductCardBadge/ProductCardBadgeKg.js +15 -0
- package/dist/packages/ProductCard/ProductCardBadge/ProductCardDiscountBadge.d.ts +13 -0
- package/dist/packages/ProductCard/ProductCardBadge/ProductCardDiscountBadge.js +42 -0
- package/dist/packages/ProductCard/ProductCardButton/AddToCartButton.d.ts +5 -0
- package/dist/packages/ProductCard/ProductCardButton/AddToCartButton.js +16 -0
- package/dist/packages/ProductCard/ProductCardButton/CustomQuantitySelector/index.d.ts +12 -0
- package/dist/packages/ProductCard/ProductCardButton/CustomQuantitySelector/index.js +73 -0
- package/dist/packages/ProductCard/ProductCardButton/QuantitySelector.d.ts +12 -0
- package/dist/packages/ProductCard/ProductCardButton/QuantitySelector.js +74 -0
- package/dist/packages/ProductCard/ProductCardButton/index.d.ts +10 -0
- package/dist/packages/ProductCard/ProductCardButton/index.js +24 -0
- package/dist/packages/ProductCard/ProductCardHorizontal/index.d.ts +3 -0
- package/dist/packages/ProductCard/ProductCardHorizontal/index.js +156 -0
- package/dist/packages/ProductCard/ProductCardImage/index.d.ts +14 -0
- package/dist/packages/ProductCard/ProductCardImage/index.js +36 -0
- package/dist/packages/{ProductCardUi/ProductCardUiName/ProductCardUiName.d.ts → ProductCard/ProductCardName/index.d.ts} +0 -1
- package/dist/packages/ProductCard/ProductCardName/index.js +5 -0
- package/dist/packages/{ProductCardUi/ProductCardUiPrice/ProductCardUiPrice.d.ts → ProductCard/ProductCardPrice/index.d.ts} +3 -4
- package/dist/packages/ProductCard/ProductCardPrice/index.js +39 -0
- package/dist/packages/ProductCard/ProductCardPromotionFlag/index.d.ts +12 -0
- package/dist/packages/ProductCard/ProductCardPromotionFlag/index.js +21 -0
- package/dist/packages/ProductCard/ProductCardVertical/index.d.ts +3 -0
- package/dist/packages/ProductCard/ProductCardVertical/index.js +128 -0
- package/dist/packages/ProductCard/index.d.ts +3 -0
- package/dist/packages/ProductCard/index.js +61 -0
- package/dist/packages/{ProductCardUiSeeMore/ProductCardUiSeeMore.js → ProductCardSeeMore/ProductCardSeeMore.js} +4 -4
- package/dist/packages/ProductCardSeeMore/ProductCardSeeMoreHorizontal.d.ts +3 -0
- package/dist/packages/{ProductCardUiSeeMore/ProductCardUiSeeMoreHorizontal.js → ProductCardSeeMore/ProductCardSeeMoreHorizontal.js} +2 -2
- package/dist/packages/Regionalization/Regionalization.js +1 -1
- package/dist/packages/SearchSugestions/components/Button/index.d.ts +13 -0
- package/dist/packages/SearchSugestions/components/Button/index.js +53 -0
- package/dist/packages/SearchSugestions/components/Button/showMoreOrLess.d.ts +1 -0
- package/dist/packages/SearchSugestions/components/Button/showMoreOrLess.js +6 -0
- package/dist/packages/SearchSugestions/components/Link/index.d.ts +10 -0
- package/dist/packages/SearchSugestions/components/Link/index.js +39 -0
- package/dist/packages/SearchSugestions/components/Link/navigation.d.ts +1 -0
- package/dist/packages/SearchSugestions/components/Link/navigation.js +8 -0
- package/dist/packages/SearchSugestions/components/SearchSuggestions/index.d.ts +4 -0
- package/dist/packages/SearchSugestions/components/SearchSuggestions/index.js +91 -0
- package/dist/packages/SearchSugestions/components/SearchText/Index.d.ts +10 -0
- package/dist/packages/SearchSugestions/components/SearchText/Index.js +48 -0
- package/dist/packages/SearchSugestions/index.d.ts +3 -0
- package/dist/packages/SearchSugestions/index.js +4 -0
- package/dist/packages/SearchSugestions/mocks.d.ts +4 -0
- package/dist/packages/SearchSugestions/mocks.js +16 -0
- package/dist/packages/SearchSugestions/styles/baseAllSuggestionsContainerStyle.d.ts +3 -0
- package/dist/packages/SearchSugestions/styles/baseAllSuggestionsContainerStyle.js +10 -0
- package/dist/packages/SearchSugestions/styles/baseButtonHoveredStyle.d.ts +3 -0
- package/dist/packages/SearchSugestions/styles/baseButtonHoveredStyle.js +7 -0
- package/dist/packages/SearchSugestions/styles/baseButtonStyle.d.ts +3 -0
- package/dist/packages/SearchSugestions/styles/baseButtonStyle.js +13 -0
- package/dist/packages/SearchSugestions/styles/baseSearchForStyle.d.ts +3 -0
- package/dist/packages/SearchSugestions/styles/baseSearchForStyle.js +9 -0
- package/dist/packages/SearchSugestions/styles/baseSearchForTermStyle.d.ts +3 -0
- package/dist/packages/SearchSugestions/styles/baseSearchForTermStyle.js +8 -0
- package/dist/packages/SearchSugestions/styles/baseSuggestionLinkHoveredStyle.d.ts +3 -0
- package/dist/packages/SearchSugestions/styles/baseSuggestionLinkHoveredStyle.js +7 -0
- package/dist/packages/SearchSugestions/styles/baseSuggestionLinkStyle.d.ts +3 -0
- package/dist/packages/SearchSugestions/styles/baseSuggestionLinkStyle.js +14 -0
- package/dist/packages/SearchSugestions/styles/baseTitleStyle.d.ts +3 -0
- package/dist/packages/SearchSugestions/styles/baseTitleStyle.js +9 -0
- package/dist/packages/SearchSugestions/types/ResponseApi.d.ts +10 -0
- package/dist/packages/SearchSugestions/types/SearchSuggestionsProps.d.ts +24 -0
- package/dist/packages/Skeleton/components/SkeletonAnimation/SkeletonAnimation.d.ts +9 -0
- package/dist/packages/Skeleton/components/SkeletonAnimation/SkeletonAnimation.js +14 -0
- package/dist/packages/Skeleton/components/SkeletonContainer/SkeletonContainer.d.ts +15 -0
- package/dist/packages/Skeleton/components/SkeletonContainer/SkeletonContainer.js +22 -0
- package/dist/packages/Skeleton/components/SkeletonRender/SkeletonRender.d.ts +21 -0
- package/dist/packages/Skeleton/components/SkeletonRender/SkeletonRender.js +57 -0
- package/dist/packages/Skeleton/components/SkeletonTable/SkeletonTable.d.ts +12 -0
- package/dist/packages/Skeleton/components/SkeletonTable/SkeletonTable.js +18 -0
- package/dist/packages/Skeleton/components/SkeletonWrapper/SkeletonWrapper.d.ts +10 -0
- package/dist/packages/Skeleton/components/SkeletonWrapper/SkeletonWrapper.js +20 -0
- package/dist/packages/Skeleton/hooks/useResponsiveImages.d.ts +9 -0
- package/dist/packages/Skeleton/hooks/useResponsiveImages.js +34 -0
- package/dist/packages/Skeleton/index.d.ts +32 -0
- package/dist/packages/Skeleton/index.js +91 -0
- package/dist/packages/Skeleton/types/types.d.ts +42 -0
- package/dist/packages/Skeleton/types/types.js +1 -0
- package/dist/packages/Skeleton/utils/createStyleAnimation.d.ts +7 -0
- package/dist/packages/Skeleton/utils/createStyleAnimation.js +7 -0
- package/dist/packages/Skeleton/utils/createStyleCell.d.ts +18 -0
- package/dist/packages/Skeleton/utils/createStyleCell.js +19 -0
- package/dist/packages/Skeleton/utils/createStyleContainers.d.ts +33 -0
- package/dist/packages/Skeleton/utils/createStyleContainers.js +45 -0
- package/dist/packages/Skeleton/utils/createStyleTable.d.ts +12 -0
- package/dist/packages/Skeleton/utils/createStyleTable.js +9 -0
- package/dist/packages/Tour/Tour.js +1 -1
- package/dist/styles/change-order-modal.global.css +1 -1
- package/dist/styles/modal.global.css +1 -1
- package/dist/styles/onboarding.global.css +1 -1
- package/dist/styles/product-card-see-more-horizontal.global.css +1 -0
- package/dist/styles/product-card.global.css +1 -0
- package/dist/types/ProductCard.d.js +1 -0
- package/dist/types/{ProductCardUi.d.ts → ProductCard.d.ts} +21 -5
- package/dist/types/ProductCard.js +1 -0
- package/package.json +1 -1
- package/dist/packages/ProductCardUi/ProducCardUIUnavailable/ProductCardUnavailable.d.ts +0 -13
- package/dist/packages/ProductCardUi/ProducCardUIUnavailable/ProductCardUnavailable.js +0 -43
- package/dist/packages/ProductCardUi/ProducCardUIUnavailable/ProductCardUnavailableHorizontal.d.ts +0 -12
- package/dist/packages/ProductCardUi/ProducCardUIUnavailable/ProductCardUnavailableHorizontal.js +0 -36
- package/dist/packages/ProductCardUi/ProductCardUi.d.ts +0 -3
- package/dist/packages/ProductCardUi/ProductCardUi.js +0 -58
- package/dist/packages/ProductCardUi/ProductCardUiBadge/ProductCardUiBadgeClube.d.ts +0 -5
- package/dist/packages/ProductCardUi/ProductCardUiBadge/ProductCardUiBadgeClube.js +0 -7
- package/dist/packages/ProductCardUi/ProductCardUiBadge/ProductCardUiBadgeKg.d.ts +0 -9
- package/dist/packages/ProductCardUi/ProductCardUiBadge/ProductCardUiBadgeKg.js +0 -17
- package/dist/packages/ProductCardUi/ProductCardUiBadge/ProductCardUiDiscountBadge.d.ts +0 -12
- package/dist/packages/ProductCardUi/ProductCardUiBadge/ProductCardUiDiscountBadge.js +0 -35
- package/dist/packages/ProductCardUi/ProductCardUiButton/ProductCardUiButton.d.ts +0 -7
- package/dist/packages/ProductCardUi/ProductCardUiButton/ProductCardUiButton.js +0 -5
- package/dist/packages/ProductCardUi/ProductCardUiHorizontal/ProductCardUiHorizontal.d.ts +0 -3
- package/dist/packages/ProductCardUi/ProductCardUiHorizontal/ProductCardUiHorizontal.js +0 -132
- package/dist/packages/ProductCardUi/ProductCardUiImage/ProductCardUiImage.d.ts +0 -14
- package/dist/packages/ProductCardUi/ProductCardUiImage/ProductCardUiImage.js +0 -36
- package/dist/packages/ProductCardUi/ProductCardUiName/ProductCardUiName.js +0 -5
- package/dist/packages/ProductCardUi/ProductCardUiPrice/ProductCardUiPrice.js +0 -43
- package/dist/packages/ProductCardUi/ProductCardUiPromotionFlag/ProductCardUiPromotionFlag.d.ts +0 -12
- package/dist/packages/ProductCardUi/ProductCardUiPromotionFlag/ProductCardUiPromotionFlag.js +0 -18
- package/dist/packages/ProductCardUi/ProductCardUiVertical/ProductCardUiVertical.d.ts +0 -3
- package/dist/packages/ProductCardUi/ProductCardUiVertical/ProductCardUiVertical.js +0 -104
- package/dist/packages/ProductCardUiSeeMore/ProductCardUiSeeMoreHorizontal.d.ts +0 -3
- package/dist/styles/productCardUi.global.css +0 -1
- package/dist/styles/productCardUiSeeMoreHorizontal.global.css +0 -1
- package/dist/styles/styles.css +0 -1
- package/dist/styles/styles2.css +0 -1
- package/dist/styles/styles3.css +0 -1
- package/dist/styles/styles4.css +0 -1
- package/dist/styles/styles5.css +0 -1
- /package/dist/packages/{ProductCardUiSeeMore/ProductCardUiSeeMore.d.ts → ProductCardSeeMore/ProductCardSeeMore.d.ts} +0 -0
- /package/dist/{types/ProductCardUi.d.js → packages/SearchSugestions/types/ResponseApi.js} +0 -0
- /package/dist/{types/ProductCardUi.js → packages/SearchSugestions/types/SearchSuggestionsProps.js} +0 -0
|
@@ -6,43 +6,43 @@ import { CouponsView as H } from "./views/CouponsView.js";
|
|
|
6
6
|
import { RulesView as K } from "./views/RulesView.js";
|
|
7
7
|
import { OverwriteView as P } from "./views/OverwriteView.js";
|
|
8
8
|
import { EmptyCartView as Q } from "./views/EmptyCartView.js";
|
|
9
|
-
/* empty css
|
|
9
|
+
/* empty css */const I = ({
|
|
10
10
|
orderFormId: h,
|
|
11
|
-
hasItemsInCart:
|
|
11
|
+
hasItemsInCart: a,
|
|
12
12
|
builder: j,
|
|
13
|
-
account:
|
|
13
|
+
account: f,
|
|
14
14
|
isIO: o = !1,
|
|
15
15
|
closeIOModal: r,
|
|
16
16
|
activeOrderFormCoupon: n,
|
|
17
17
|
genericTaggingEvent: s,
|
|
18
18
|
disableFirstEmptyModal: A,
|
|
19
|
-
couponsList:
|
|
20
|
-
qtdCouponsView:
|
|
19
|
+
couponsList: l,
|
|
20
|
+
qtdCouponsView: w
|
|
21
21
|
}) => {
|
|
22
|
-
const [L,
|
|
22
|
+
const [L, C] = e(!0), [q, p] = e([]), [u, c] = e("coupons-view"), [D, y] = e(!1), [N, d] = e(!1), [v, R] = e(""), [m, V] = e(""), [J, x] = e(
|
|
23
23
|
!A
|
|
24
24
|
), [b, k] = e();
|
|
25
25
|
return S(() => {
|
|
26
|
-
n &&
|
|
26
|
+
n && R(n);
|
|
27
27
|
}, [n]), S(() => {
|
|
28
28
|
(async () => {
|
|
29
|
-
|
|
29
|
+
C(!0);
|
|
30
30
|
try {
|
|
31
|
-
const
|
|
32
|
-
if (
|
|
33
|
-
const z =
|
|
31
|
+
const i = await E(f, j, l);
|
|
32
|
+
if (w) {
|
|
33
|
+
const z = i.slice(0, w);
|
|
34
34
|
p(z);
|
|
35
35
|
return;
|
|
36
36
|
}
|
|
37
|
-
p(
|
|
37
|
+
p(i);
|
|
38
38
|
return;
|
|
39
|
-
} catch {
|
|
39
|
+
} catch (i) {
|
|
40
40
|
p([]);
|
|
41
41
|
} finally {
|
|
42
|
-
|
|
42
|
+
C(!1);
|
|
43
43
|
}
|
|
44
44
|
})();
|
|
45
|
-
}, [JSON.stringify(
|
|
45
|
+
}, [JSON.stringify(l)]), L ? /* @__PURE__ */ t("div", { className: "coupons-container", children: /* @__PURE__ */ t(
|
|
46
46
|
G,
|
|
47
47
|
{
|
|
48
48
|
isIO: o,
|
|
@@ -54,21 +54,21 @@ import { EmptyCartView as Q } from "./views/EmptyCartView.js";
|
|
|
54
54
|
H,
|
|
55
55
|
{
|
|
56
56
|
orderFormId: h,
|
|
57
|
-
hasItemsInCart:
|
|
58
|
-
account:
|
|
57
|
+
hasItemsInCart: a,
|
|
58
|
+
account: f,
|
|
59
59
|
isIO: o,
|
|
60
60
|
closeIOModal: r,
|
|
61
61
|
coupons: q,
|
|
62
|
-
firstCouponName:
|
|
62
|
+
firstCouponName: v,
|
|
63
63
|
secondCouponName: m,
|
|
64
|
-
replaceCoupon:
|
|
64
|
+
replaceCoupon: N,
|
|
65
65
|
setView: c,
|
|
66
|
-
setFirstCouponName:
|
|
67
|
-
setSecondCouponName:
|
|
68
|
-
setActiveRule:
|
|
66
|
+
setFirstCouponName: R,
|
|
67
|
+
setSecondCouponName: V,
|
|
68
|
+
setActiveRule: y,
|
|
69
69
|
setDataItem: k,
|
|
70
|
-
setReplaceCoupon:
|
|
71
|
-
setIsCloseModalEmpty:
|
|
70
|
+
setReplaceCoupon: d,
|
|
71
|
+
setIsCloseModalEmpty: x,
|
|
72
72
|
genericTaggingEvent: s
|
|
73
73
|
}
|
|
74
74
|
),
|
|
@@ -76,30 +76,30 @@ import { EmptyCartView as Q } from "./views/EmptyCartView.js";
|
|
|
76
76
|
K,
|
|
77
77
|
{
|
|
78
78
|
dataItem: b,
|
|
79
|
-
setActiveRule:
|
|
79
|
+
setActiveRule: y,
|
|
80
80
|
setView: c,
|
|
81
81
|
isIO: o,
|
|
82
82
|
closeIOModal: r,
|
|
83
83
|
genericTaggingEvent: s
|
|
84
84
|
}
|
|
85
85
|
),
|
|
86
|
-
(!o || o && u === "overwrite-view") && m && !
|
|
86
|
+
(!o || o && u === "overwrite-view") && m && !N && /* @__PURE__ */ t(
|
|
87
87
|
P,
|
|
88
88
|
{
|
|
89
|
-
firstCouponName:
|
|
89
|
+
firstCouponName: v,
|
|
90
90
|
secondCouponName: m,
|
|
91
91
|
setView: c,
|
|
92
|
-
setReplaceCoupon:
|
|
93
|
-
setSecondCouponName:
|
|
92
|
+
setReplaceCoupon: d,
|
|
93
|
+
setSecondCouponName: V,
|
|
94
94
|
isIO: o,
|
|
95
95
|
closeIOModal: r,
|
|
96
96
|
genericTaggingEvent: s
|
|
97
97
|
}
|
|
98
98
|
),
|
|
99
|
-
!
|
|
99
|
+
!a && J && /* @__PURE__ */ t(
|
|
100
100
|
Q,
|
|
101
101
|
{
|
|
102
|
-
setIsCloseModalEmpty:
|
|
102
|
+
setIsCloseModalEmpty: x,
|
|
103
103
|
genericTaggingEvent: s
|
|
104
104
|
}
|
|
105
105
|
)
|
|
@@ -5,46 +5,46 @@ import { removeCoupon as G } from "../api/removeCoupon.js";
|
|
|
5
5
|
import { CouponIcon as H } from "../../../assets/svgs/CouponIcon.js";
|
|
6
6
|
import { SuccessIcon as J } from "../../../assets/svgs/SuccessIcon.js";
|
|
7
7
|
const X = ({
|
|
8
|
-
account:
|
|
9
|
-
orderFormId:
|
|
10
|
-
hasItemsInCart:
|
|
11
|
-
isIO:
|
|
8
|
+
account: _,
|
|
9
|
+
orderFormId: x,
|
|
10
|
+
hasItemsInCart: D,
|
|
11
|
+
isIO: j = !1,
|
|
12
12
|
item: l,
|
|
13
13
|
firstCouponName: c,
|
|
14
14
|
secondCouponName: d,
|
|
15
15
|
replaceCoupon: f,
|
|
16
|
-
setView:
|
|
16
|
+
setView: y,
|
|
17
17
|
setActiveRule: N,
|
|
18
18
|
setDataItem: i,
|
|
19
19
|
setFirstCouponName: t,
|
|
20
20
|
setSecondCouponName: w,
|
|
21
|
-
setReplaceCoupon:
|
|
21
|
+
setReplaceCoupon: k,
|
|
22
22
|
setAlert: m,
|
|
23
23
|
setType: p,
|
|
24
|
-
setIsCloseModalEmpty:
|
|
24
|
+
setIsCloseModalEmpty: A,
|
|
25
25
|
genericTaggingEvent: o
|
|
26
26
|
}) => {
|
|
27
|
-
const [b, r] = z(!1), [
|
|
27
|
+
const [b, r] = z(!1), [R, h] = z(!1);
|
|
28
28
|
q(() => {
|
|
29
|
-
d.toLowerCase() !== l.couponName.toLowerCase() && r(!1), c && !d && c.toLowerCase() === l.couponName.toLowerCase() && r(!0), c && d && f && d.toLowerCase() === l.couponName.toLowerCase() &&
|
|
29
|
+
d.toLowerCase() !== l.couponName.toLowerCase() && r(!1), c && !d && c.toLowerCase() === l.couponName.toLowerCase() && r(!0), c && d && f && d.toLowerCase() === l.couponName.toLowerCase() && V(d);
|
|
30
30
|
}, [c, d, f]);
|
|
31
|
-
const
|
|
32
|
-
if (
|
|
31
|
+
const V = async (a) => {
|
|
32
|
+
if (D)
|
|
33
33
|
try {
|
|
34
34
|
if (!c || c && f) {
|
|
35
35
|
h(!0);
|
|
36
|
-
const
|
|
37
|
-
|
|
36
|
+
const L = await B(_, x, a);
|
|
37
|
+
k(!1), t(a), w(""), L.error.length <= 0 ? (o == null || o("discount_coupon", {
|
|
38
38
|
name: "cupom aplicado",
|
|
39
39
|
cupomName: a
|
|
40
|
-
}), p("success"), r(!0),
|
|
40
|
+
}), p("success"), r(!0), j && window.location.reload()) : (o == null || o("discount_coupon", {
|
|
41
41
|
name: "cupom aplicando - cupom incorreto ou expirado",
|
|
42
42
|
cupomName: a,
|
|
43
|
-
objectError:
|
|
43
|
+
objectError: L.error
|
|
44
44
|
}), p("error"), r(!1), t("")), m(!0);
|
|
45
45
|
} else
|
|
46
|
-
w(a),
|
|
47
|
-
} catch {
|
|
46
|
+
w(a), y("overwrite-view");
|
|
47
|
+
} catch (L) {
|
|
48
48
|
o == null || o("discount_coupon", {
|
|
49
49
|
name: "problema na api",
|
|
50
50
|
cupomName: a
|
|
@@ -55,21 +55,21 @@ const X = ({
|
|
|
55
55
|
else
|
|
56
56
|
o == null || o("discount_coupon", {
|
|
57
57
|
name: "Modal de cart vazio acionado"
|
|
58
|
-
}),
|
|
58
|
+
}), A(!0);
|
|
59
59
|
}, M = async () => {
|
|
60
|
-
if (
|
|
60
|
+
if (D)
|
|
61
61
|
try {
|
|
62
|
-
h(!0),
|
|
63
|
-
const a = await G(
|
|
62
|
+
h(!0), k(!1);
|
|
63
|
+
const a = await G(_, x);
|
|
64
64
|
a.error.length <= 0 ? (o == null || o("discount_coupon", {
|
|
65
65
|
name: "cupom removido com sucesso",
|
|
66
66
|
cupomName: c
|
|
67
|
-
}), p("removed"), r(!1), t(""), w(""),
|
|
67
|
+
}), p("removed"), r(!1), t(""), w(""), j && window.location.reload()) : (o == null || o("discount_coupon", {
|
|
68
68
|
name: "algum problema na remoção do cupom",
|
|
69
69
|
cupomName: c,
|
|
70
70
|
objectError: a.error
|
|
71
71
|
}), p("error"), r(!0)), m(!0);
|
|
72
|
-
} catch {
|
|
72
|
+
} catch (a) {
|
|
73
73
|
o == null || o("discount_coupon", {
|
|
74
74
|
name: "problema na api - na remoção do cupom",
|
|
75
75
|
cupomName: c
|
|
@@ -80,9 +80,9 @@ const X = ({
|
|
|
80
80
|
else
|
|
81
81
|
o == null || o("discount_coupon", {
|
|
82
82
|
name: "Modal de cart vazio acionado"
|
|
83
|
-
}),
|
|
83
|
+
}), A(!0);
|
|
84
84
|
}, $ = () => {
|
|
85
|
-
N(!0), i(l),
|
|
85
|
+
N(!0), i(l), y("rules-view");
|
|
86
86
|
};
|
|
87
87
|
return /* @__PURE__ */ u("div", { className: `container-card-coupon ${b ? "active" : ""}`, children: [
|
|
88
88
|
/* @__PURE__ */ u("div", { className: "text-container", children: [
|
|
@@ -111,15 +111,15 @@ const X = ({
|
|
|
111
111
|
{
|
|
112
112
|
onClick: M,
|
|
113
113
|
className: "remove-coupon",
|
|
114
|
-
disabled:
|
|
114
|
+
disabled: R,
|
|
115
115
|
children: "Remover"
|
|
116
116
|
}
|
|
117
117
|
) : /* @__PURE__ */ s(
|
|
118
118
|
"button",
|
|
119
119
|
{
|
|
120
|
-
onClick: () =>
|
|
120
|
+
onClick: () => V(l.couponName),
|
|
121
121
|
className: "apply-coupon",
|
|
122
|
-
disabled:
|
|
122
|
+
disabled: R,
|
|
123
123
|
children: "Aplicar"
|
|
124
124
|
}
|
|
125
125
|
),
|
|
@@ -1,34 +1,62 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
c,
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
1
|
+
var x = Object.defineProperty;
|
|
2
|
+
var m = Object.getOwnPropertySymbols;
|
|
3
|
+
var c = Object.prototype.hasOwnProperty, n = Object.prototype.propertyIsEnumerable;
|
|
4
|
+
var i = (r, e, o) => e in r ? x(r, e, { enumerable: !0, configurable: !0, writable: !0, value: o }) : r[e] = o, p = (r, e) => {
|
|
5
|
+
for (var o in e || (e = {}))
|
|
6
|
+
c.call(e, o) && i(r, o, e[o]);
|
|
7
|
+
if (m)
|
|
8
|
+
for (var o of m(e))
|
|
9
|
+
n.call(e, o) && i(r, o, e[o]);
|
|
10
|
+
return r;
|
|
11
|
+
};
|
|
12
|
+
var u = (r, e) => {
|
|
13
|
+
var o = {};
|
|
14
|
+
for (var a in r)
|
|
15
|
+
c.call(r, a) && e.indexOf(a) < 0 && (o[a] = r[a]);
|
|
16
|
+
if (r != null && m)
|
|
17
|
+
for (var a of m(r))
|
|
18
|
+
e.indexOf(a) < 0 && n.call(r, a) && (o[a] = r[a]);
|
|
19
|
+
return o;
|
|
20
|
+
};
|
|
21
|
+
import { jsx as l, jsxs as h } from "react/jsx-runtime";
|
|
22
|
+
import { ModalHeader as v } from "./ModalHeader.js";
|
|
23
|
+
import { Breadcrumb as M } from "./Breadcrumb.js";
|
|
24
|
+
import { ModalFooter as N } from "./ModalFooter.js";
|
|
25
|
+
const q = (j) => {
|
|
26
|
+
var s = j, {
|
|
27
|
+
children: r,
|
|
28
|
+
isIO: e = !1,
|
|
29
|
+
closeModal: o,
|
|
30
|
+
title: a,
|
|
31
|
+
genericTaggingEvent: f,
|
|
32
|
+
cancelButtonAction: d
|
|
33
|
+
} = s, t = u(s, [
|
|
34
|
+
"children",
|
|
35
|
+
"isIO",
|
|
36
|
+
"closeModal",
|
|
37
|
+
"title",
|
|
38
|
+
"genericTaggingEvent",
|
|
39
|
+
"cancelButtonAction"
|
|
40
|
+
]);
|
|
41
|
+
return /* @__PURE__ */ l("div", { className: "modal-rule-coupon-external", children: /* @__PURE__ */ h("div", { className: "modal-rule-coupon-internal", children: [
|
|
42
|
+
/* @__PURE__ */ l(
|
|
43
|
+
v,
|
|
44
|
+
{
|
|
45
|
+
closeModal: o,
|
|
46
|
+
title: a,
|
|
47
|
+
genericTaggingEvent: f
|
|
48
|
+
}
|
|
49
|
+
),
|
|
50
|
+
e && /* @__PURE__ */ l(M, { title: a, cancelButtonAction: d }),
|
|
51
|
+
/* @__PURE__ */ l("div", { className: "modal-rule-coupon-children", children: r }),
|
|
52
|
+
/* @__PURE__ */ l(
|
|
53
|
+
N,
|
|
54
|
+
p({
|
|
55
|
+
cancelButtonAction: d
|
|
56
|
+
}, t)
|
|
57
|
+
)
|
|
58
|
+
] }) });
|
|
59
|
+
};
|
|
32
60
|
export {
|
|
33
|
-
|
|
61
|
+
q as Modal
|
|
34
62
|
};
|
|
@@ -8,49 +8,49 @@ import { NoCoupons as U } from "../components/NoCoupons.js";
|
|
|
8
8
|
import { Alert as V } from "../components/Alert.js";
|
|
9
9
|
import { InfoIcon as W } from "../../../assets/svgs/InfoIcon.js";
|
|
10
10
|
const E = ({
|
|
11
|
-
account:
|
|
12
|
-
orderFormId:
|
|
13
|
-
hasItemsInCart:
|
|
11
|
+
account: b,
|
|
12
|
+
orderFormId: x,
|
|
13
|
+
hasItemsInCart: C,
|
|
14
14
|
isIO: p,
|
|
15
15
|
closeIOModal: u,
|
|
16
16
|
coupons: c,
|
|
17
17
|
firstCouponName: i,
|
|
18
18
|
secondCouponName: _,
|
|
19
|
-
replaceCoupon:
|
|
20
|
-
setView:
|
|
19
|
+
replaceCoupon: w,
|
|
20
|
+
setView: A,
|
|
21
21
|
setActiveRule: D,
|
|
22
22
|
setDataItem: L,
|
|
23
23
|
setFirstCouponName: m,
|
|
24
24
|
setSecondCouponName: n,
|
|
25
|
-
setReplaceCoupon:
|
|
25
|
+
setReplaceCoupon: B,
|
|
26
26
|
setIsCloseModalEmpty: S,
|
|
27
27
|
genericTaggingEvent: r
|
|
28
28
|
}) => {
|
|
29
|
-
const [t, q] = a(""), [H,
|
|
29
|
+
const [t, q] = a(""), [H, j] = a(!1), [M, s] = a(""), [f, d] = a(!1), [P, h] = a(!1), k = (l) => {
|
|
30
30
|
l.preventDefault(), q(l.target.value);
|
|
31
31
|
}, z = async (l) => {
|
|
32
32
|
l.preventDefault();
|
|
33
33
|
try {
|
|
34
|
-
if (!i || i &&
|
|
35
|
-
|
|
36
|
-
const
|
|
37
|
-
|
|
34
|
+
if (!i || i && w) {
|
|
35
|
+
j(!0);
|
|
36
|
+
const y = await G(b, x, t);
|
|
37
|
+
B(!1), n(""), y.error.length <= 0 ? (r == null || r("discount_coupon", {
|
|
38
38
|
name: "Cupom aplicado do input",
|
|
39
39
|
couponName: t
|
|
40
40
|
}), s("success"), h(!0), m(t), p && window.location.reload()) : (r == null || r("discount_coupon", {
|
|
41
41
|
name: "Cupom do input expirado ou invalido",
|
|
42
42
|
couponName: t,
|
|
43
|
-
objectError:
|
|
43
|
+
objectError: y.error
|
|
44
44
|
}), s("error"), h(!1), m("")), d(!0);
|
|
45
45
|
} else
|
|
46
|
-
n(t),
|
|
47
|
-
} catch {
|
|
46
|
+
n(t), A("overwrite-view");
|
|
47
|
+
} catch (y) {
|
|
48
48
|
r == null || r("discount_coupon", {
|
|
49
49
|
name: "Cupom do input - error na api",
|
|
50
50
|
couponName: t
|
|
51
51
|
}), s("error"), h(!1), d(!0);
|
|
52
52
|
} finally {
|
|
53
|
-
|
|
53
|
+
j(!1);
|
|
54
54
|
}
|
|
55
55
|
};
|
|
56
56
|
return F(() => {
|
|
@@ -64,7 +64,7 @@ const E = ({
|
|
|
64
64
|
genericTaggingEvent: r
|
|
65
65
|
}
|
|
66
66
|
),
|
|
67
|
-
|
|
67
|
+
C ? /* @__PURE__ */ o("div", { className: "form-coupons", children: /* @__PURE__ */ e("form", { onSubmit: z, children: [
|
|
68
68
|
/* @__PURE__ */ o(
|
|
69
69
|
"input",
|
|
70
70
|
{
|
|
@@ -84,20 +84,20 @@ const E = ({
|
|
|
84
84
|
/* @__PURE__ */ o("div", { className: "container-coupons", children: c.map((l) => /* @__PURE__ */ o(
|
|
85
85
|
Q,
|
|
86
86
|
{
|
|
87
|
-
account:
|
|
88
|
-
orderFormId:
|
|
89
|
-
hasItemsInCart:
|
|
87
|
+
account: b,
|
|
88
|
+
orderFormId: x,
|
|
89
|
+
hasItemsInCart: C,
|
|
90
90
|
isIO: p,
|
|
91
91
|
item: l,
|
|
92
92
|
firstCouponName: i,
|
|
93
93
|
secondCouponName: _,
|
|
94
|
-
replaceCoupon:
|
|
95
|
-
setView:
|
|
94
|
+
replaceCoupon: w,
|
|
95
|
+
setView: A,
|
|
96
96
|
setFirstCouponName: m,
|
|
97
97
|
setSecondCouponName: n,
|
|
98
98
|
setActiveRule: D,
|
|
99
99
|
setDataItem: L,
|
|
100
|
-
setReplaceCoupon:
|
|
100
|
+
setReplaceCoupon: B,
|
|
101
101
|
setAlert: d,
|
|
102
102
|
setType: s,
|
|
103
103
|
setIsCloseModalEmpty: S,
|
|
@@ -3,7 +3,7 @@ import { useRef as s, useEffect as p } from "react";
|
|
|
3
3
|
import { ArrowIcon as g } from "../../assets/svgs/ArrowIcon.js";
|
|
4
4
|
import { CloseIcon as k } from "../../assets/svgs/CloseIcon.js";
|
|
5
5
|
import { HAS_WINDOW as v } from "../../constants/index.js";
|
|
6
|
-
/* empty css
|
|
6
|
+
/* empty css */const R = (w) => {
|
|
7
7
|
const {
|
|
8
8
|
isOpen: r,
|
|
9
9
|
setIsOpen: C,
|
|
@@ -4,7 +4,7 @@ import { Header as x } from "./components/Header.js";
|
|
|
4
4
|
import { Content as S } from "./components/Content.js";
|
|
5
5
|
import { Footer as c } from "./components/Footer.js";
|
|
6
6
|
import { TIPS_LENGTH as h } from "./constants/tips.js";
|
|
7
|
-
/* empty css
|
|
7
|
+
/* empty css */const w = ({
|
|
8
8
|
socialMediaLinks: a,
|
|
9
9
|
handleCloseAction: r,
|
|
10
10
|
handleFinishAction: n,
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { jsxs as r, jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { ProductCardImage as d } from "../ProductCardImage/index.js";
|
|
3
|
+
import { ProductCardName as l } from "../ProductCardName/index.js";
|
|
4
|
+
const s = ({
|
|
5
|
+
image: o,
|
|
6
|
+
name: c,
|
|
7
|
+
variant: t
|
|
8
|
+
}) => t === "horizontal" ? /* @__PURE__ */ r(
|
|
9
|
+
"div",
|
|
10
|
+
{
|
|
11
|
+
id: "product-card-unavailable",
|
|
12
|
+
className: "product-card-horizontal-unavailable",
|
|
13
|
+
children: [
|
|
14
|
+
/* @__PURE__ */ a(
|
|
15
|
+
"div",
|
|
16
|
+
{
|
|
17
|
+
className: "product-card-horizontal",
|
|
18
|
+
style: {
|
|
19
|
+
backgroundColor: "var(--color-grayScale-faded)"
|
|
20
|
+
},
|
|
21
|
+
children: /* @__PURE__ */ r("div", { className: "product-card-section-product-horizontal out-of-stock", children: [
|
|
22
|
+
/* @__PURE__ */ a(d, { image: o }),
|
|
23
|
+
/* @__PURE__ */ a(
|
|
24
|
+
"div",
|
|
25
|
+
{
|
|
26
|
+
className: "product-card-horizontal-description out-of-stock",
|
|
27
|
+
style: {
|
|
28
|
+
backgroundColor: "var(--color-grayScale-lightest)"
|
|
29
|
+
},
|
|
30
|
+
children: /* @__PURE__ */ a(l, { name: c })
|
|
31
|
+
}
|
|
32
|
+
)
|
|
33
|
+
] })
|
|
34
|
+
}
|
|
35
|
+
),
|
|
36
|
+
/* @__PURE__ */ a("div", { className: "product-card-unavailable-text", children: /* @__PURE__ */ a("p", { children: "Indisponível" }) })
|
|
37
|
+
]
|
|
38
|
+
}
|
|
39
|
+
) : /* @__PURE__ */ r("div", { id: "product-card-unavailable", className: "out-of-stock", children: [
|
|
40
|
+
/* @__PURE__ */ r("div", { className: "product-card out-of-stock", children: [
|
|
41
|
+
/* @__PURE__ */ a(
|
|
42
|
+
d,
|
|
43
|
+
{
|
|
44
|
+
image: {
|
|
45
|
+
url: o.url,
|
|
46
|
+
alternateName: o.alternateName
|
|
47
|
+
},
|
|
48
|
+
variant: "vertical"
|
|
49
|
+
}
|
|
50
|
+
),
|
|
51
|
+
/* @__PURE__ */ a("div", { className: "out-of-stock-description-content", children: /* @__PURE__ */ a(
|
|
52
|
+
"div",
|
|
53
|
+
{
|
|
54
|
+
className: "product-card-description",
|
|
55
|
+
style: {
|
|
56
|
+
backgroundColor: "var(--color-grayScale-faded)",
|
|
57
|
+
height: "160px"
|
|
58
|
+
},
|
|
59
|
+
children: /* @__PURE__ */ a(l, { name: c })
|
|
60
|
+
}
|
|
61
|
+
) })
|
|
62
|
+
] }),
|
|
63
|
+
/* @__PURE__ */ a("div", { className: "product-card-unavailable-text", children: /* @__PURE__ */ a("p", { children: "Indisponível" }) })
|
|
64
|
+
] });
|
|
65
|
+
export {
|
|
66
|
+
s as ProductCardUnavailable
|
|
67
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
const a = ({ text: c }) => /* @__PURE__ */ r("div", { className: "product-card-badge-club", children: /* @__PURE__ */ r("p", { className: "product-card-badge-club-text", children: c }) });
|
|
3
|
+
export {
|
|
4
|
+
a as ProductCardBadgeClub
|
|
5
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { SkuSpecificationsProps } from '../../../types/ProductCard';
|
|
2
|
+
|
|
3
|
+
interface ProductCardBadgeProps {
|
|
4
|
+
unitMultiplier: number;
|
|
5
|
+
skuSpecifications?: SkuSpecificationsProps[];
|
|
6
|
+
measurementUnit?: string;
|
|
7
|
+
setIsShowProductBadge: React.Dispatch<React.SetStateAction<boolean>>;
|
|
8
|
+
}
|
|
9
|
+
export declare const ProductCardBadgeKg: ({ measurementUnit, setIsShowProductBadge, unitMultiplier }: ProductCardBadgeProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as a, jsxs as c } from "react/jsx-runtime";
|
|
2
|
+
const g = ({
|
|
3
|
+
measurementUnit: e,
|
|
4
|
+
setIsShowProductBadge: d,
|
|
5
|
+
unitMultiplier: r
|
|
6
|
+
}) => e === "un" ? null : r < 1 ? (d(!0), /* @__PURE__ */ a("div", { className: "product-card-badge", children: /* @__PURE__ */ c("p", { className: "product-card-badge-kg", children: [
|
|
7
|
+
r * 1e3,
|
|
8
|
+
"g"
|
|
9
|
+
] }) })) : (r > 1 && d(!0), /* @__PURE__ */ a("div", { className: "product-card-badge", children: /* @__PURE__ */ c("p", { className: "product-card-badge-kg", children: [
|
|
10
|
+
r,
|
|
11
|
+
"kg"
|
|
12
|
+
] }) }));
|
|
13
|
+
export {
|
|
14
|
+
g as ProductCardBadgeKg
|
|
15
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { SkuSpecificationsProps, ProductCardProps } from '../../../types/ProductCard';
|
|
2
|
+
|
|
3
|
+
interface ProductCardDiscountBadge {
|
|
4
|
+
skuSpecifications: SkuSpecificationsProps[];
|
|
5
|
+
unitMultiplier: number;
|
|
6
|
+
nativeListPrice: number;
|
|
7
|
+
nativeSpotPrice: number;
|
|
8
|
+
hasPromotionalPrice: ProductCardProps['hasPromotionalPrice'];
|
|
9
|
+
defaultScListPrice?: number;
|
|
10
|
+
setIsShowProductBadge: React.Dispatch<React.SetStateAction<boolean>>;
|
|
11
|
+
}
|
|
12
|
+
export declare const ProductCardDiscountBadge: ({ nativeListPrice, nativeSpotPrice, skuSpecifications, unitMultiplier, hasPromotionalPrice, defaultScListPrice, setIsShowProductBadge }: ProductCardDiscountBadge) => import("react/jsx-runtime").JSX.Element | null;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { jsx as b, jsxs as x } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as l, useEffect as D } from "react";
|
|
3
|
+
const E = ({
|
|
4
|
+
nativeListPrice: c,
|
|
5
|
+
nativeSpotPrice: s,
|
|
6
|
+
skuSpecifications: n,
|
|
7
|
+
unitMultiplier: a,
|
|
8
|
+
hasPromotionalPrice: i,
|
|
9
|
+
defaultScListPrice: P,
|
|
10
|
+
setIsShowProductBadge: d
|
|
11
|
+
}) => {
|
|
12
|
+
const { listPrice: u, spotPrice: o } = i || {}, f = (r, e) => l(() => {
|
|
13
|
+
const g = (r - e) * 100 / r;
|
|
14
|
+
return Math.round(g);
|
|
15
|
+
}, [e, r]), { listPriceCustom: m, spotPriceCustom: p } = l(() => u && o && o !== s ? {
|
|
16
|
+
listPriceCustom: u,
|
|
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))
|
|
28
|
+
);
|
|
29
|
+
return D(() => {
|
|
30
|
+
if (!t || t <= 0) {
|
|
31
|
+
d(!1);
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
d(!0);
|
|
35
|
+
}, [t]), !t || t <= 0 ? null : /* @__PURE__ */ b("div", { className: "product-card-discount-badge", children: /* @__PURE__ */ x("p", { className: "product-card-discount-badge-value", children: [
|
|
36
|
+
t,
|
|
37
|
+
"%"
|
|
38
|
+
] }) });
|
|
39
|
+
};
|
|
40
|
+
export {
|
|
41
|
+
E as ProductCardDiscountBadge
|
|
42
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import o from "../../../node_modules/@faststore/components/dist/esm/atoms/Button/Button.js";
|
|
3
|
+
const n = ({ handleAddToCart: t }) => /* @__PURE__ */ a(
|
|
4
|
+
o,
|
|
5
|
+
{
|
|
6
|
+
onClick: t,
|
|
7
|
+
"data-button-variant": "primary",
|
|
8
|
+
"aria-label": "adicionado ao carrinho",
|
|
9
|
+
title: "Add to cart Sales",
|
|
10
|
+
className: "product-card-button",
|
|
11
|
+
children: "Adicionar"
|
|
12
|
+
}
|
|
13
|
+
);
|
|
14
|
+
export {
|
|
15
|
+
n as AddToCartButton
|
|
16
|
+
};
|