@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,26 +1,26 @@
|
|
|
1
|
-
import
|
|
2
|
-
const
|
|
1
|
+
import s from "axios";
|
|
2
|
+
const p = async (o, e, n, c, t) => {
|
|
3
3
|
try {
|
|
4
4
|
const r = {
|
|
5
|
-
orderFormId:
|
|
6
|
-
skuId:
|
|
5
|
+
orderFormId: o,
|
|
6
|
+
skuId: n,
|
|
7
7
|
substitutionId: c
|
|
8
8
|
};
|
|
9
|
-
if (
|
|
10
|
-
const { data:
|
|
9
|
+
if (e) {
|
|
10
|
+
const { data: d } = await s.post(
|
|
11
11
|
"/_v/commerce/orderform/changeOrder",
|
|
12
12
|
r
|
|
13
13
|
);
|
|
14
|
-
return
|
|
14
|
+
return d;
|
|
15
15
|
}
|
|
16
|
-
const
|
|
17
|
-
|
|
16
|
+
const a = t && await t({
|
|
17
|
+
input: r
|
|
18
18
|
});
|
|
19
|
-
return
|
|
19
|
+
return a ? JSON.parse(a == null ? void 0 : a.postChangeOrder.data) : void 0;
|
|
20
20
|
} catch (r) {
|
|
21
21
|
console.error("Error in Change Order Modal", r);
|
|
22
22
|
}
|
|
23
23
|
};
|
|
24
24
|
export {
|
|
25
|
-
|
|
25
|
+
p as postChangeOrder
|
|
26
26
|
};
|
|
@@ -12,6 +12,9 @@ interface CouponsProps {
|
|
|
12
12
|
disableFirstEmptyModal?: boolean;
|
|
13
13
|
couponsList?: CouponType[];
|
|
14
14
|
qtdCouponsView?: number;
|
|
15
|
+
getCouponsMutation?: any;
|
|
16
|
+
addCouponMutation?: any;
|
|
17
|
+
removeCouponMutation?: any;
|
|
15
18
|
}
|
|
16
|
-
export declare const Coupons: ({ orderFormId, hasItemsInCart, builder, account, isIO, closeIOModal, activeOrderFormCoupon, genericTaggingEvent, disableFirstEmptyModal, couponsList, qtdCouponsView }: CouponsProps) => import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export declare const Coupons: ({ orderFormId, hasItemsInCart, builder, account, isIO, closeIOModal, activeOrderFormCoupon, genericTaggingEvent, disableFirstEmptyModal, couponsList, qtdCouponsView, getCouponsMutation, addCouponMutation, removeCouponMutation }: CouponsProps) => import("react/jsx-runtime").JSX.Element;
|
|
17
20
|
export {};
|
|
@@ -1,103 +1,113 @@
|
|
|
1
|
-
import { jsx as t, jsxs as
|
|
2
|
-
import { useState as e, useEffect as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
/* empty css */const
|
|
10
|
-
orderFormId:
|
|
11
|
-
hasItemsInCart:
|
|
12
|
-
builder:
|
|
13
|
-
account:
|
|
1
|
+
import { jsx as t, jsxs as P } from "react/jsx-runtime";
|
|
2
|
+
import { useState as e, useEffect as j } from "react";
|
|
3
|
+
import { LoadingView as Q } from "./views/LoadingView.js";
|
|
4
|
+
import { CouponsView as U } from "./views/CouponsView.js";
|
|
5
|
+
import { RulesView as W } from "./views/RulesView.js";
|
|
6
|
+
import { OverwriteView as X } from "./views/OverwriteView.js";
|
|
7
|
+
import { EmptyCartView as Y } from "./views/EmptyCartView.js";
|
|
8
|
+
import { getCoupons as Z } from "./api/getCoupons.js";
|
|
9
|
+
/* empty css */const eo = ({
|
|
10
|
+
orderFormId: A,
|
|
11
|
+
hasItemsInCart: f,
|
|
12
|
+
builder: l,
|
|
13
|
+
account: w,
|
|
14
14
|
isIO: o = !1,
|
|
15
15
|
closeIOModal: r,
|
|
16
16
|
activeOrderFormCoupon: n,
|
|
17
17
|
genericTaggingEvent: s,
|
|
18
|
-
disableFirstEmptyModal:
|
|
19
|
-
couponsList:
|
|
20
|
-
qtdCouponsView:
|
|
18
|
+
disableFirstEmptyModal: J,
|
|
19
|
+
couponsList: p,
|
|
20
|
+
qtdCouponsView: C,
|
|
21
|
+
getCouponsMutation: q,
|
|
22
|
+
addCouponMutation: D,
|
|
23
|
+
removeCouponMutation: L
|
|
21
24
|
}) => {
|
|
22
|
-
const [
|
|
23
|
-
!
|
|
24
|
-
), [
|
|
25
|
-
return
|
|
26
|
-
n &&
|
|
27
|
-
}, [n]),
|
|
25
|
+
const [k, N] = e(!0), [z, a] = e([]), [u, c] = e("coupons-view"), [B, d] = e(!1), [y, v] = e(!1), [R, V] = e(""), [m, S] = e(""), [E, x] = e(
|
|
26
|
+
!J
|
|
27
|
+
), [G, H] = e();
|
|
28
|
+
return j(() => {
|
|
29
|
+
n && V(n);
|
|
30
|
+
}, [n]), j(() => {
|
|
28
31
|
(async () => {
|
|
29
|
-
|
|
32
|
+
N(!0);
|
|
30
33
|
try {
|
|
31
|
-
const i = await
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
34
|
+
const i = o ? await Z(w, l, p) : await q({
|
|
35
|
+
input: {
|
|
36
|
+
builder: l,
|
|
37
|
+
couponsList: p
|
|
38
|
+
}
|
|
39
|
+
}), h = o ? i : JSON.parse(i.getCoupons.data).coupons;
|
|
40
|
+
if (C) {
|
|
41
|
+
const K = h.slice(0, C);
|
|
42
|
+
a(K);
|
|
35
43
|
return;
|
|
36
44
|
}
|
|
37
|
-
|
|
45
|
+
a(h);
|
|
38
46
|
return;
|
|
39
47
|
} catch (i) {
|
|
40
|
-
|
|
48
|
+
a([]);
|
|
41
49
|
} finally {
|
|
42
|
-
|
|
50
|
+
N(!1);
|
|
43
51
|
}
|
|
44
52
|
})();
|
|
45
|
-
}, [JSON.stringify(
|
|
46
|
-
|
|
53
|
+
}, [JSON.stringify(p)]), k ? /* @__PURE__ */ t("div", { className: "coupons-container", children: /* @__PURE__ */ t(
|
|
54
|
+
Q,
|
|
47
55
|
{
|
|
48
56
|
isIO: o,
|
|
49
57
|
closeIOModal: r,
|
|
50
58
|
genericTaggingEvent: s
|
|
51
59
|
}
|
|
52
|
-
) }) : /* @__PURE__ */
|
|
60
|
+
) }) : /* @__PURE__ */ P("div", { className: "coupons-container", children: [
|
|
53
61
|
(!o || o && u === "coupons-view") && /* @__PURE__ */ t(
|
|
54
|
-
|
|
62
|
+
U,
|
|
55
63
|
{
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
64
|
+
removeCouponMutation: L,
|
|
65
|
+
addCouponMutation: D,
|
|
66
|
+
orderFormId: A,
|
|
67
|
+
hasItemsInCart: f,
|
|
68
|
+
account: w,
|
|
59
69
|
isIO: o,
|
|
60
70
|
closeIOModal: r,
|
|
61
|
-
coupons:
|
|
62
|
-
firstCouponName:
|
|
71
|
+
coupons: z,
|
|
72
|
+
firstCouponName: R,
|
|
63
73
|
secondCouponName: m,
|
|
64
|
-
replaceCoupon:
|
|
74
|
+
replaceCoupon: y,
|
|
65
75
|
setView: c,
|
|
66
|
-
setFirstCouponName:
|
|
67
|
-
setSecondCouponName:
|
|
68
|
-
setActiveRule:
|
|
69
|
-
setDataItem:
|
|
70
|
-
setReplaceCoupon:
|
|
76
|
+
setFirstCouponName: V,
|
|
77
|
+
setSecondCouponName: S,
|
|
78
|
+
setActiveRule: d,
|
|
79
|
+
setDataItem: H,
|
|
80
|
+
setReplaceCoupon: v,
|
|
71
81
|
setIsCloseModalEmpty: x,
|
|
72
82
|
genericTaggingEvent: s
|
|
73
83
|
}
|
|
74
84
|
),
|
|
75
|
-
(!o || o && u === "rules-view") &&
|
|
76
|
-
|
|
85
|
+
(!o || o && u === "rules-view") && B && /* @__PURE__ */ t(
|
|
86
|
+
W,
|
|
77
87
|
{
|
|
78
|
-
dataItem:
|
|
79
|
-
setActiveRule:
|
|
88
|
+
dataItem: G,
|
|
89
|
+
setActiveRule: d,
|
|
80
90
|
setView: c,
|
|
81
91
|
isIO: o,
|
|
82
92
|
closeIOModal: r,
|
|
83
93
|
genericTaggingEvent: s
|
|
84
94
|
}
|
|
85
95
|
),
|
|
86
|
-
(!o || o && u === "overwrite-view") && m && !
|
|
87
|
-
|
|
96
|
+
(!o || o && u === "overwrite-view") && m && !y && /* @__PURE__ */ t(
|
|
97
|
+
X,
|
|
88
98
|
{
|
|
89
|
-
firstCouponName:
|
|
99
|
+
firstCouponName: R,
|
|
90
100
|
secondCouponName: m,
|
|
91
101
|
setView: c,
|
|
92
|
-
setReplaceCoupon:
|
|
93
|
-
setSecondCouponName:
|
|
102
|
+
setReplaceCoupon: v,
|
|
103
|
+
setSecondCouponName: S,
|
|
94
104
|
isIO: o,
|
|
95
105
|
closeIOModal: r,
|
|
96
106
|
genericTaggingEvent: s
|
|
97
107
|
}
|
|
98
108
|
),
|
|
99
|
-
!
|
|
100
|
-
|
|
109
|
+
!f && E && /* @__PURE__ */ t(
|
|
110
|
+
Y,
|
|
101
111
|
{
|
|
102
112
|
setIsCloseModalEmpty: x,
|
|
103
113
|
genericTaggingEvent: s
|
|
@@ -106,5 +116,5 @@ import { EmptyCartView as Q } from "./views/EmptyCartView.js";
|
|
|
106
116
|
] });
|
|
107
117
|
};
|
|
108
118
|
export {
|
|
109
|
-
|
|
119
|
+
eo as Coupons
|
|
110
120
|
};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import
|
|
2
|
-
const
|
|
3
|
-
const { data:
|
|
4
|
-
`https://${o}.
|
|
1
|
+
import r from "axios";
|
|
2
|
+
const s = async (o, t, a) => {
|
|
3
|
+
const { data: p } = await r.post(
|
|
4
|
+
`https://${o}.vtex.app/api/coupon/order`,
|
|
5
5
|
{
|
|
6
6
|
orderFormId: t,
|
|
7
7
|
couponId: a
|
|
8
8
|
}
|
|
9
9
|
);
|
|
10
|
-
return
|
|
10
|
+
return p;
|
|
11
11
|
};
|
|
12
12
|
export {
|
|
13
|
-
|
|
13
|
+
s as addCoupon
|
|
14
14
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
const
|
|
3
|
-
const
|
|
4
|
-
return
|
|
1
|
+
import o from "axios";
|
|
2
|
+
const e = async (n, p, t) => {
|
|
3
|
+
const a = `https://${n}.vtex.app/api/coupon/list`, s = Math.random(), { data: r } = t ? await o.post(a, { couponsList: t }) : await o.get(a, { params: { builder: p, random: s } });
|
|
4
|
+
return r.coupons;
|
|
5
5
|
};
|
|
6
6
|
export {
|
|
7
|
-
|
|
7
|
+
e as getCoupons
|
|
8
8
|
};
|
|
@@ -21,5 +21,7 @@ export interface CouponCardProps {
|
|
|
21
21
|
setType: (type: AlertType) => void;
|
|
22
22
|
setIsCloseModalEmpty: (isCloseModalEmpty: boolean) => void;
|
|
23
23
|
genericTaggingEvent?: (name: string, params: object) => void;
|
|
24
|
+
addCouponMutation?: any;
|
|
25
|
+
removeCouponMutation?: any;
|
|
24
26
|
}
|
|
25
|
-
export declare const CouponCard: ({ account, orderFormId, hasItemsInCart, isIO, item, firstCouponName, secondCouponName, replaceCoupon, setView, setActiveRule, setDataItem, setFirstCouponName, setSecondCouponName, setReplaceCoupon, setAlert, setType, setIsCloseModalEmpty, genericTaggingEvent }: CouponCardProps) => import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
export declare const CouponCard: ({ account, orderFormId, hasItemsInCart, isIO, item, firstCouponName, secondCouponName, replaceCoupon, setView, setActiveRule, setDataItem, setFirstCouponName, setSecondCouponName, setReplaceCoupon, setAlert, setType, setIsCloseModalEmpty, genericTaggingEvent, addCouponMutation, removeCouponMutation }: CouponCardProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,132 +1,143 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as z, useEffect as
|
|
3
|
-
import { addCoupon as
|
|
4
|
-
import { removeCoupon as G } from "../api/removeCoupon.js";
|
|
1
|
+
import { jsxs as p, jsx as c } from "react/jsx-runtime";
|
|
2
|
+
import { useState as z, useEffect as B } from "react";
|
|
3
|
+
import { addCoupon as G } from "../api/addCoupon.js";
|
|
5
4
|
import { CouponIcon as H } from "../../../assets/svgs/CouponIcon.js";
|
|
6
|
-
import { SuccessIcon as
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
5
|
+
import { SuccessIcon as K } from "../../../assets/svgs/SuccessIcon.js";
|
|
6
|
+
import { removeCoupon as P } from "../api/removeCoupon.js";
|
|
7
|
+
const C = ({
|
|
8
|
+
account: D,
|
|
9
|
+
orderFormId: t,
|
|
10
|
+
hasItemsInCart: R,
|
|
11
|
+
isIO: r = !1,
|
|
12
|
+
item: a,
|
|
13
|
+
firstCouponName: s,
|
|
14
14
|
secondCouponName: d,
|
|
15
|
-
replaceCoupon:
|
|
16
|
-
setView:
|
|
17
|
-
setActiveRule:
|
|
18
|
-
setDataItem:
|
|
19
|
-
setFirstCouponName:
|
|
20
|
-
setSecondCouponName:
|
|
21
|
-
setReplaceCoupon:
|
|
22
|
-
setAlert:
|
|
23
|
-
setType:
|
|
24
|
-
setIsCloseModalEmpty:
|
|
25
|
-
genericTaggingEvent: o
|
|
15
|
+
replaceCoupon: b,
|
|
16
|
+
setView: j,
|
|
17
|
+
setActiveRule: J,
|
|
18
|
+
setDataItem: S,
|
|
19
|
+
setFirstCouponName: L,
|
|
20
|
+
setSecondCouponName: _,
|
|
21
|
+
setReplaceCoupon: y,
|
|
22
|
+
setAlert: f,
|
|
23
|
+
setType: m,
|
|
24
|
+
setIsCloseModalEmpty: k,
|
|
25
|
+
genericTaggingEvent: o,
|
|
26
|
+
addCouponMutation: i,
|
|
27
|
+
removeCouponMutation: M
|
|
26
28
|
}) => {
|
|
27
|
-
const [
|
|
28
|
-
|
|
29
|
-
d.toLowerCase() !==
|
|
30
|
-
}, [
|
|
31
|
-
const
|
|
32
|
-
if (
|
|
29
|
+
const [x, u] = z(!1), [A, w] = z(!1);
|
|
30
|
+
B(() => {
|
|
31
|
+
d.toLowerCase() !== a.couponName.toLowerCase() && u(!1), s && !d && s.toLowerCase() === a.couponName.toLowerCase() && u(!0), s && d && b && d.toLowerCase() === a.couponName.toLowerCase() && N(d);
|
|
32
|
+
}, [s, d, b]);
|
|
33
|
+
const N = async (l) => {
|
|
34
|
+
if (R)
|
|
33
35
|
try {
|
|
34
|
-
if (!
|
|
35
|
-
|
|
36
|
-
const
|
|
37
|
-
|
|
36
|
+
if (!s || s && b) {
|
|
37
|
+
w(!0);
|
|
38
|
+
const h = r ? await G(D, t, l) : await i({
|
|
39
|
+
input: {
|
|
40
|
+
orderFormId: t,
|
|
41
|
+
couponId: l
|
|
42
|
+
}
|
|
43
|
+
}), V = r ? h : JSON.parse(h.addCoupon.data);
|
|
44
|
+
y(!1), L(l), _(""), V.error.length <= 0 ? (o == null || o("discount_coupon", {
|
|
38
45
|
name: "cupom aplicado",
|
|
39
|
-
cupomName:
|
|
40
|
-
}),
|
|
46
|
+
cupomName: l
|
|
47
|
+
}), m("success"), u(!0), r && window.location.reload()) : (o == null || o("discount_coupon", {
|
|
41
48
|
name: "cupom aplicando - cupom incorreto ou expirado",
|
|
42
|
-
cupomName:
|
|
43
|
-
objectError:
|
|
44
|
-
}),
|
|
49
|
+
cupomName: l,
|
|
50
|
+
objectError: V.error
|
|
51
|
+
}), m("error"), u(!1), L("")), f(!0);
|
|
45
52
|
} else
|
|
46
|
-
|
|
47
|
-
} catch (
|
|
53
|
+
_(l), j("overwrite-view");
|
|
54
|
+
} catch (h) {
|
|
48
55
|
o == null || o("discount_coupon", {
|
|
49
56
|
name: "problema na api",
|
|
50
|
-
cupomName:
|
|
51
|
-
}),
|
|
57
|
+
cupomName: l
|
|
58
|
+
}), u(!1), m("error"), f(!0);
|
|
52
59
|
} finally {
|
|
53
|
-
|
|
60
|
+
w(!1);
|
|
54
61
|
}
|
|
55
62
|
else
|
|
56
63
|
o == null || o("discount_coupon", {
|
|
57
64
|
name: "Modal de cart vazio acionado"
|
|
58
|
-
}),
|
|
59
|
-
},
|
|
60
|
-
if (
|
|
65
|
+
}), k(!0);
|
|
66
|
+
}, $ = async () => {
|
|
67
|
+
if (R)
|
|
61
68
|
try {
|
|
62
|
-
|
|
63
|
-
const
|
|
64
|
-
|
|
69
|
+
w(!0), y(!1);
|
|
70
|
+
const l = r ? await P(D, t) : await M({
|
|
71
|
+
input: {
|
|
72
|
+
orderFormId: t
|
|
73
|
+
}
|
|
74
|
+
}), h = r ? l : JSON.parse(l.removeCoupon.data);
|
|
75
|
+
h.error.length <= 0 ? (o == null || o("discount_coupon", {
|
|
65
76
|
name: "cupom removido com sucesso",
|
|
66
|
-
cupomName:
|
|
67
|
-
}),
|
|
77
|
+
cupomName: s
|
|
78
|
+
}), m("removed"), u(!1), L(""), _(""), r && window.location.reload()) : (o == null || o("discount_coupon", {
|
|
68
79
|
name: "algum problema na remoção do cupom",
|
|
69
|
-
cupomName:
|
|
70
|
-
objectError:
|
|
71
|
-
}),
|
|
72
|
-
} catch (
|
|
80
|
+
cupomName: s,
|
|
81
|
+
objectError: h.error
|
|
82
|
+
}), m("error"), u(!0)), f(!0);
|
|
83
|
+
} catch (l) {
|
|
73
84
|
o == null || o("discount_coupon", {
|
|
74
85
|
name: "problema na api - na remoção do cupom",
|
|
75
|
-
cupomName:
|
|
76
|
-
}),
|
|
86
|
+
cupomName: s
|
|
87
|
+
}), m("error"), u(!0), f(!0);
|
|
77
88
|
} finally {
|
|
78
|
-
|
|
89
|
+
w(!1);
|
|
79
90
|
}
|
|
80
91
|
else
|
|
81
92
|
o == null || o("discount_coupon", {
|
|
82
93
|
name: "Modal de cart vazio acionado"
|
|
83
|
-
}),
|
|
84
|
-
},
|
|
85
|
-
|
|
94
|
+
}), k(!0);
|
|
95
|
+
}, q = () => {
|
|
96
|
+
J(!0), S(a), j("rules-view");
|
|
86
97
|
};
|
|
87
|
-
return /* @__PURE__ */
|
|
88
|
-
/* @__PURE__ */
|
|
89
|
-
/* @__PURE__ */
|
|
90
|
-
/* @__PURE__ */
|
|
91
|
-
/* @__PURE__ */
|
|
98
|
+
return /* @__PURE__ */ p("div", { className: `container-card-coupon ${x ? "active" : ""}`, children: [
|
|
99
|
+
/* @__PURE__ */ p("div", { className: "text-container", children: [
|
|
100
|
+
/* @__PURE__ */ p("div", { className: "container-title", children: [
|
|
101
|
+
/* @__PURE__ */ c(H, { width: 20, height: 16 }),
|
|
102
|
+
/* @__PURE__ */ c("h3", { className: "title", children: a.couponName })
|
|
92
103
|
] }),
|
|
93
|
-
|
|
104
|
+
a.couponValue && /* @__PURE__ */ p("p", { className: "price-badge", children: [
|
|
94
105
|
"- ",
|
|
95
|
-
|
|
106
|
+
a.couponValue
|
|
96
107
|
] }),
|
|
97
|
-
|
|
98
|
-
|
|
108
|
+
a.couponDescription && /* @__PURE__ */ c("h4", { className: "subtitle", children: a.couponDescription }),
|
|
109
|
+
a.couponExpirationDate && /* @__PURE__ */ p("h4", { className: "subtitle", children: [
|
|
99
110
|
"Válido até ",
|
|
100
|
-
|
|
111
|
+
a.couponExpirationDate
|
|
101
112
|
] })
|
|
102
113
|
] }),
|
|
103
|
-
/* @__PURE__ */
|
|
104
|
-
/* @__PURE__ */
|
|
105
|
-
|
|
106
|
-
/* @__PURE__ */
|
|
114
|
+
/* @__PURE__ */ c("div", { className: "vertical-line" }),
|
|
115
|
+
/* @__PURE__ */ p("div", { className: "buttons-container", children: [
|
|
116
|
+
x && /* @__PURE__ */ p("button", { className: "applied-coupon", children: [
|
|
117
|
+
/* @__PURE__ */ c("span", { className: "applied-coupon-span", children: /* @__PURE__ */ c(K, {}) }),
|
|
107
118
|
"Aplicado"
|
|
108
119
|
] }),
|
|
109
|
-
|
|
120
|
+
x ? /* @__PURE__ */ c(
|
|
110
121
|
"button",
|
|
111
122
|
{
|
|
112
|
-
onClick:
|
|
123
|
+
onClick: $,
|
|
113
124
|
className: "remove-coupon",
|
|
114
|
-
disabled:
|
|
125
|
+
disabled: A,
|
|
115
126
|
children: "Remover"
|
|
116
127
|
}
|
|
117
|
-
) : /* @__PURE__ */
|
|
128
|
+
) : /* @__PURE__ */ c(
|
|
118
129
|
"button",
|
|
119
130
|
{
|
|
120
|
-
onClick: () =>
|
|
131
|
+
onClick: () => N(a.couponName),
|
|
121
132
|
className: "apply-coupon",
|
|
122
|
-
disabled:
|
|
133
|
+
disabled: A,
|
|
123
134
|
children: "Aplicar"
|
|
124
135
|
}
|
|
125
136
|
),
|
|
126
|
-
|
|
137
|
+
a.couponDescription && /* @__PURE__ */ c("a", { onClick: q, children: "Ver Regras" })
|
|
127
138
|
] })
|
|
128
139
|
] });
|
|
129
140
|
};
|
|
130
141
|
export {
|
|
131
|
-
|
|
142
|
+
C as CouponCard
|
|
132
143
|
};
|
|
@@ -8,6 +8,8 @@ interface CouponsViewProps extends Omit<CouponCardProps, OmittedProps> {
|
|
|
8
8
|
hasItemsInCart: boolean;
|
|
9
9
|
closeIOModal?: () => void;
|
|
10
10
|
coupons: CouponType[];
|
|
11
|
+
addCouponMutation?: any;
|
|
12
|
+
removeCouponMutation?: any;
|
|
11
13
|
}
|
|
12
|
-
export declare const CouponsView: ({ account, orderFormId, hasItemsInCart, isIO, closeIOModal, coupons, firstCouponName, secondCouponName, replaceCoupon, setView, setActiveRule, setDataItem, setFirstCouponName, setSecondCouponName, setReplaceCoupon, setIsCloseModalEmpty, genericTaggingEvent }: CouponsViewProps) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export declare const CouponsView: ({ addCouponMutation, removeCouponMutation, account, orderFormId, hasItemsInCart, isIO, closeIOModal, coupons, firstCouponName, secondCouponName, replaceCoupon, setView, setActiveRule, setDataItem, setFirstCouponName, setSecondCouponName, setReplaceCoupon, setIsCloseModalEmpty, genericTaggingEvent }: CouponsViewProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
15
|
export {};
|