@plurix/ecom-components 1.14.2-shlo1555.0 → 1.14.3-com2034
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/packages/Carousel/Carousel.js +1 -1
- package/dist/packages/CartClubAlert/CartClubAlert.js +1 -1
- package/dist/packages/ChangeOrderModal/ChangeOrderModal.d.ts +12 -1
- package/dist/packages/ChangeOrderModal/ChangeOrderModal.js +93 -84
- package/dist/packages/ChangeOrderModal/api/getOrderForm.js +6 -15
- package/dist/packages/ChangeOrderModal/api/getProductsSimilars.d.ts +7 -4
- package/dist/packages/ChangeOrderModal/api/getProductsSimilars.js +22 -21
- package/dist/packages/ChangeOrderModal/api/postChangeOrder.d.ts +6 -1
- package/dist/packages/ChangeOrderModal/api/postChangeOrder.js +11 -17
- package/dist/packages/ChangeOrderModal/components/ModalFooter.d.ts +4 -1
- package/dist/packages/ChangeOrderModal/components/ModalFooter.js +3 -1
- package/dist/packages/ChangeOrderModal/components/SimilarProductList.d.ts +2 -3
- package/dist/packages/ChangeOrderModal/components/SimilarProducts.d.ts +4 -5
- package/dist/packages/ChangeOrderModal/components/SimilarProducts.js +21 -21
- package/dist/packages/ChangeOrderModal/mocks.d.ts +1 -0
- package/dist/packages/ChangeOrderModal/mocks.js +1 -0
- package/dist/packages/Coupons/Coupons.d.ts +4 -1
- package/dist/packages/Coupons/Coupons.js +61 -51
- package/dist/packages/Coupons/api/addCoupon.d.ts +1 -1
- package/dist/packages/Coupons/api/addCoupon.js +7 -7
- package/dist/packages/Coupons/api/getCoupons.d.ts +1 -1
- package/dist/packages/Coupons/api/getCoupons.js +4 -4
- package/dist/packages/Coupons/api/removeCoupon.d.ts +1 -1
- package/dist/packages/Coupons/api/removeCoupon.js +6 -6
- package/dist/packages/Coupons/components/CouponCard.d.ts +3 -1
- package/dist/packages/Coupons/components/CouponCard.js +86 -76
- package/dist/packages/Coupons/views/CouponsView.d.ts +3 -1
- package/dist/packages/Coupons/views/CouponsView.js +87 -78
- package/dist/packages/Coupons/views/LoadingView.js +6 -6
- package/dist/packages/Modal/Modal.js +1 -1
- package/dist/packages/Onboarding/Onboarding.js +1 -1
- package/dist/packages/ProductCard/ProductCardBadge/ProductCardBadgeKg.d.ts +1 -1
- package/dist/packages/ProductCard/ProductCardBadge/ProductCardBadgeKg.js +16 -22
- package/dist/packages/ProductCard/ProductCardBadge/ProductCardDiscountBadge.d.ts +3 -2
- package/dist/packages/ProductCard/ProductCardBadge/ProductCardDiscountBadge.js +15 -31
- package/dist/packages/ProductCard/ProductCardButton/AddToCartButton.js +1 -1
- package/dist/packages/ProductCard/ProductCardButton/CustomQuantitySelector/Button.d.ts +18 -0
- package/dist/packages/ProductCard/ProductCardButton/CustomQuantitySelector/Button.js +80 -0
- package/dist/packages/ProductCard/ProductCardButton/CustomQuantitySelector/IconButton.d.ts +10 -0
- package/dist/packages/ProductCard/ProductCardButton/CustomQuantitySelector/IconButton.js +61 -0
- package/dist/packages/ProductCard/ProductCardButton/CustomQuantitySelector/Loader.d.ts +8 -0
- package/dist/packages/ProductCard/ProductCardButton/CustomQuantitySelector/Loader.js +44 -0
- package/dist/packages/ProductCard/ProductCardButton/CustomQuantitySelector/index.d.ts +17 -2
- package/dist/packages/ProductCard/ProductCardButton/CustomQuantitySelector/index.js +1 -1
- package/dist/packages/ProductCard/ProductCardButton/QuantitySelector.js +6 -6
- 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/ProductCard/index.js +1 -1
- package/dist/packages/ProductCardSeeMore/ProductCardSeeMore.js +1 -1
- 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/Tour/Tour.js +1 -1
- package/dist/styles/change-order-modal.global.css +1 -1
- package/dist/styles/product-card.global.css +1 -1
- package/dist/styles/regionalization.global.css +1 -1
- package/dist/types/ProductCard.d.ts +13 -12
- package/dist/utils/changerOrderModal.js +13 -16
- package/package.json +69 -69
- package/dist/node_modules/@faststore/components/dist/esm/atoms/Button/Button.js +0 -45
- package/dist/node_modules/@faststore/components/dist/esm/atoms/Loader/Loader.js +0 -34
- package/dist/node_modules/@faststore/components/dist/esm/molecules/IconButton/IconButton.js +0 -29
|
@@ -1,110 +1,120 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useState as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
/* empty css
|
|
10
|
-
orderFormId:
|
|
11
|
-
hasItemsInCart:
|
|
12
|
-
builder:
|
|
13
|
-
account:
|
|
1
|
+
import { jsx as e, jsxs as P } from "react/jsx-runtime";
|
|
2
|
+
import { useState as t, useEffect as h } 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 to = ({
|
|
10
|
+
orderFormId: j,
|
|
11
|
+
hasItemsInCart: f,
|
|
12
|
+
builder: l,
|
|
13
|
+
account: A,
|
|
14
14
|
isIO: o = !1,
|
|
15
15
|
closeIOModal: r,
|
|
16
16
|
activeOrderFormCoupon: n,
|
|
17
17
|
genericTaggingEvent: s,
|
|
18
|
-
disableFirstEmptyModal:
|
|
19
|
-
couponsList:
|
|
20
|
-
qtdCouponsView: w
|
|
18
|
+
disableFirstEmptyModal: J,
|
|
19
|
+
couponsList: p,
|
|
20
|
+
qtdCouponsView: w,
|
|
21
|
+
getCouponsMutation: q,
|
|
22
|
+
addCouponMutation: D,
|
|
23
|
+
removeCouponMutation: L
|
|
21
24
|
}) => {
|
|
22
|
-
const [
|
|
23
|
-
!
|
|
24
|
-
), [
|
|
25
|
-
return
|
|
25
|
+
const [k, C] = t(!0), [z, a] = t([]), [u, c] = t("coupons-view"), [B, N] = t(!1), [d, y] = t(!1), [v, R] = t(""), [m, V] = t(""), [E, S] = t(
|
|
26
|
+
!J
|
|
27
|
+
), [G, H] = t();
|
|
28
|
+
return h(() => {
|
|
26
29
|
n && R(n);
|
|
27
|
-
}, [n]),
|
|
30
|
+
}, [n]), h(() => {
|
|
28
31
|
(async () => {
|
|
29
32
|
C(!0);
|
|
30
33
|
try {
|
|
31
|
-
const i = await
|
|
34
|
+
const i = o ? await Z(l, p) : await q({
|
|
35
|
+
input: {
|
|
36
|
+
builder: l,
|
|
37
|
+
couponsList: p
|
|
38
|
+
}
|
|
39
|
+
}), x = o ? i : JSON.parse(i.getCoupons.data).coupons;
|
|
32
40
|
if (w) {
|
|
33
|
-
const
|
|
34
|
-
|
|
41
|
+
const K = x.slice(0, w);
|
|
42
|
+
a(K);
|
|
35
43
|
return;
|
|
36
44
|
}
|
|
37
|
-
|
|
45
|
+
a(x);
|
|
38
46
|
return;
|
|
39
47
|
} catch (i) {
|
|
40
|
-
|
|
48
|
+
a([]);
|
|
41
49
|
} finally {
|
|
42
50
|
C(!1);
|
|
43
51
|
}
|
|
44
52
|
})();
|
|
45
|
-
}, [JSON.stringify(
|
|
46
|
-
|
|
53
|
+
}, [JSON.stringify(p)]), k ? /* @__PURE__ */ e("div", { className: "coupons-container", children: /* @__PURE__ */ e(
|
|
54
|
+
Q,
|
|
47
55
|
{
|
|
48
56
|
isIO: o,
|
|
49
57
|
closeIOModal: r,
|
|
50
58
|
genericTaggingEvent: s
|
|
51
59
|
}
|
|
52
|
-
) }) : /* @__PURE__ */
|
|
53
|
-
(!o || o && u === "coupons-view") && /* @__PURE__ */
|
|
54
|
-
|
|
60
|
+
) }) : /* @__PURE__ */ P("div", { className: "coupons-container", children: [
|
|
61
|
+
(!o || o && u === "coupons-view") && /* @__PURE__ */ e(
|
|
62
|
+
U,
|
|
55
63
|
{
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
64
|
+
removeCouponMutation: L,
|
|
65
|
+
addCouponMutation: D,
|
|
66
|
+
orderFormId: j,
|
|
67
|
+
hasItemsInCart: f,
|
|
68
|
+
account: A,
|
|
59
69
|
isIO: o,
|
|
60
70
|
closeIOModal: r,
|
|
61
|
-
coupons:
|
|
71
|
+
coupons: z,
|
|
62
72
|
firstCouponName: v,
|
|
63
73
|
secondCouponName: m,
|
|
64
|
-
replaceCoupon:
|
|
74
|
+
replaceCoupon: d,
|
|
65
75
|
setView: c,
|
|
66
76
|
setFirstCouponName: R,
|
|
67
77
|
setSecondCouponName: V,
|
|
68
|
-
setActiveRule:
|
|
69
|
-
setDataItem:
|
|
70
|
-
setReplaceCoupon:
|
|
71
|
-
setIsCloseModalEmpty:
|
|
78
|
+
setActiveRule: N,
|
|
79
|
+
setDataItem: H,
|
|
80
|
+
setReplaceCoupon: y,
|
|
81
|
+
setIsCloseModalEmpty: S,
|
|
72
82
|
genericTaggingEvent: s
|
|
73
83
|
}
|
|
74
84
|
),
|
|
75
|
-
(!o || o && u === "rules-view") &&
|
|
76
|
-
|
|
85
|
+
(!o || o && u === "rules-view") && B && /* @__PURE__ */ e(
|
|
86
|
+
W,
|
|
77
87
|
{
|
|
78
|
-
dataItem:
|
|
79
|
-
setActiveRule:
|
|
88
|
+
dataItem: G,
|
|
89
|
+
setActiveRule: N,
|
|
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 && !d && /* @__PURE__ */ e(
|
|
97
|
+
X,
|
|
88
98
|
{
|
|
89
99
|
firstCouponName: v,
|
|
90
100
|
secondCouponName: m,
|
|
91
101
|
setView: c,
|
|
92
|
-
setReplaceCoupon:
|
|
102
|
+
setReplaceCoupon: y,
|
|
93
103
|
setSecondCouponName: V,
|
|
94
104
|
isIO: o,
|
|
95
105
|
closeIOModal: r,
|
|
96
106
|
genericTaggingEvent: s
|
|
97
107
|
}
|
|
98
108
|
),
|
|
99
|
-
!
|
|
100
|
-
|
|
109
|
+
!f && E && /* @__PURE__ */ e(
|
|
110
|
+
Y,
|
|
101
111
|
{
|
|
102
|
-
setIsCloseModalEmpty:
|
|
112
|
+
setIsCloseModalEmpty: S,
|
|
103
113
|
genericTaggingEvent: s
|
|
104
114
|
}
|
|
105
115
|
)
|
|
106
116
|
] });
|
|
107
117
|
};
|
|
108
118
|
export {
|
|
109
|
-
|
|
119
|
+
to as Coupons
|
|
110
120
|
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { SetOrderFormCouponResponse } from '../types/SetOrderFormCouponResponse';
|
|
2
2
|
|
|
3
|
-
export declare const addCoupon: (
|
|
3
|
+
export declare const addCoupon: (orderFormId: string, couponId: string) => Promise<SetOrderFormCouponResponse>;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import r from "axios";
|
|
2
|
-
const
|
|
3
|
-
const { data:
|
|
4
|
-
|
|
2
|
+
const n = async (o, t) => {
|
|
3
|
+
const { data: a } = await r.post(
|
|
4
|
+
"/_v/faststoreapi/coupon/order",
|
|
5
5
|
{
|
|
6
|
-
orderFormId:
|
|
7
|
-
couponId:
|
|
6
|
+
orderFormId: o,
|
|
7
|
+
couponId: t
|
|
8
8
|
}
|
|
9
9
|
);
|
|
10
|
-
return
|
|
10
|
+
return a;
|
|
11
11
|
};
|
|
12
12
|
export {
|
|
13
|
-
|
|
13
|
+
n as addCoupon
|
|
14
14
|
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { CouponType } from '../types/CouponType';
|
|
2
2
|
|
|
3
|
-
export declare const getCoupons: (
|
|
3
|
+
export declare const getCoupons: (builder: 'app' | 'faststore', couponsList?: CouponType[]) => Promise<CouponType[]>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
const
|
|
3
|
-
const
|
|
1
|
+
import a from "axios";
|
|
2
|
+
const c = async (s, o) => {
|
|
3
|
+
const t = "/_v/faststoreapi/coupon/list", n = Math.random(), { data: r } = o ? await a.post(t, { couponsList: o }) : await a.get(t, { params: { builder: s, random: n } });
|
|
4
4
|
return r.coupons;
|
|
5
5
|
};
|
|
6
6
|
export {
|
|
7
|
-
|
|
7
|
+
c as getCoupons
|
|
8
8
|
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { SetOrderFormCouponResponse } from '../types/SetOrderFormCouponResponse';
|
|
2
2
|
|
|
3
|
-
export declare const removeCoupon: (
|
|
3
|
+
export declare const removeCoupon: (orderFormId: string) => Promise<SetOrderFormCouponResponse>;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import
|
|
2
|
-
const r = async (o
|
|
3
|
-
const { data:
|
|
4
|
-
|
|
1
|
+
import a from "axios";
|
|
2
|
+
const r = async (o) => {
|
|
3
|
+
const { data: t } = await a.delete(
|
|
4
|
+
"/_v/faststoreapi/coupon/order",
|
|
5
5
|
{
|
|
6
|
-
data: { orderFormId:
|
|
6
|
+
data: { orderFormId: o }
|
|
7
7
|
}
|
|
8
8
|
);
|
|
9
|
-
return
|
|
9
|
+
return t;
|
|
10
10
|
};
|
|
11
11
|
export {
|
|
12
12
|
r as removeCoupon
|
|
@@ -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: ({
|
|
27
|
+
export declare const CouponCard: ({ 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,142 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as
|
|
1
|
+
import { jsxs as p, jsx as c } from "react/jsx-runtime";
|
|
2
|
+
import { useState as V, useEffect as q } from "react";
|
|
3
3
|
import { addCoupon as B } from "../api/addCoupon.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
orderFormId: x,
|
|
4
|
+
import { CouponIcon as G } from "../../../assets/svgs/CouponIcon.js";
|
|
5
|
+
import { SuccessIcon as H } from "../../../assets/svgs/SuccessIcon.js";
|
|
6
|
+
import { removeCoupon as K } from "../api/removeCoupon.js";
|
|
7
|
+
const Z = ({
|
|
8
|
+
orderFormId: t,
|
|
10
9
|
hasItemsInCart: D,
|
|
11
|
-
isIO:
|
|
12
|
-
item:
|
|
13
|
-
firstCouponName:
|
|
10
|
+
isIO: r = !1,
|
|
11
|
+
item: a,
|
|
12
|
+
firstCouponName: s,
|
|
14
13
|
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
|
|
14
|
+
replaceCoupon: b,
|
|
15
|
+
setView: R,
|
|
16
|
+
setActiveRule: z,
|
|
17
|
+
setDataItem: J,
|
|
18
|
+
setFirstCouponName: L,
|
|
19
|
+
setSecondCouponName: _,
|
|
20
|
+
setReplaceCoupon: j,
|
|
21
|
+
setAlert: f,
|
|
22
|
+
setType: m,
|
|
23
|
+
setIsCloseModalEmpty: y,
|
|
24
|
+
genericTaggingEvent: o,
|
|
25
|
+
addCouponMutation: S,
|
|
26
|
+
removeCouponMutation: i
|
|
26
27
|
}) => {
|
|
27
|
-
const [
|
|
28
|
+
const [x, u] = V(!1), [k, w] = V(!1);
|
|
28
29
|
q(() => {
|
|
29
|
-
d.toLowerCase() !==
|
|
30
|
-
}, [
|
|
31
|
-
const
|
|
30
|
+
d.toLowerCase() !== a.couponName.toLowerCase() && u(!1), s && !d && s.toLowerCase() === a.couponName.toLowerCase() && u(!0), s && d && b && d.toLowerCase() === a.couponName.toLowerCase() && A(d);
|
|
31
|
+
}, [s, d, b]);
|
|
32
|
+
const A = async (l) => {
|
|
32
33
|
if (D)
|
|
33
34
|
try {
|
|
34
|
-
if (!
|
|
35
|
-
|
|
36
|
-
const
|
|
37
|
-
|
|
35
|
+
if (!s || s && b) {
|
|
36
|
+
w(!0);
|
|
37
|
+
const h = r ? await B(t, l) : await S({
|
|
38
|
+
input: {
|
|
39
|
+
orderFormId: t,
|
|
40
|
+
couponId: l
|
|
41
|
+
}
|
|
42
|
+
}), N = r ? h : JSON.parse(h.addCoupon.data);
|
|
43
|
+
j(!1), L(l), _(""), N.error.length <= 0 ? (o == null || o("discount_coupon", {
|
|
38
44
|
name: "cupom aplicado",
|
|
39
|
-
cupomName:
|
|
40
|
-
}),
|
|
45
|
+
cupomName: l
|
|
46
|
+
}), m("success"), u(!0), r && window.location.reload()) : (o == null || o("discount_coupon", {
|
|
41
47
|
name: "cupom aplicando - cupom incorreto ou expirado",
|
|
42
|
-
cupomName:
|
|
43
|
-
objectError:
|
|
44
|
-
}),
|
|
48
|
+
cupomName: l,
|
|
49
|
+
objectError: N.error
|
|
50
|
+
}), m("error"), u(!1), L("")), f(!0);
|
|
45
51
|
} else
|
|
46
|
-
|
|
47
|
-
} catch (
|
|
52
|
+
_(l), R("overwrite-view");
|
|
53
|
+
} catch (h) {
|
|
48
54
|
o == null || o("discount_coupon", {
|
|
49
55
|
name: "problema na api",
|
|
50
|
-
cupomName:
|
|
51
|
-
}),
|
|
56
|
+
cupomName: l
|
|
57
|
+
}), u(!1), m("error"), f(!0);
|
|
52
58
|
} finally {
|
|
53
|
-
|
|
59
|
+
w(!1);
|
|
54
60
|
}
|
|
55
61
|
else
|
|
56
62
|
o == null || o("discount_coupon", {
|
|
57
63
|
name: "Modal de cart vazio acionado"
|
|
58
|
-
}),
|
|
64
|
+
}), y(!0);
|
|
59
65
|
}, M = async () => {
|
|
60
66
|
if (D)
|
|
61
67
|
try {
|
|
62
|
-
|
|
63
|
-
const
|
|
64
|
-
|
|
68
|
+
w(!0), j(!1);
|
|
69
|
+
const l = r ? await K(t) : await i({
|
|
70
|
+
input: {
|
|
71
|
+
orderFormId: t
|
|
72
|
+
}
|
|
73
|
+
}), h = r ? l : JSON.parse(l.removeCoupon.data);
|
|
74
|
+
h.error.length <= 0 ? (o == null || o("discount_coupon", {
|
|
65
75
|
name: "cupom removido com sucesso",
|
|
66
|
-
cupomName:
|
|
67
|
-
}),
|
|
76
|
+
cupomName: s
|
|
77
|
+
}), m("removed"), u(!1), L(""), _(""), r && window.location.reload()) : (o == null || o("discount_coupon", {
|
|
68
78
|
name: "algum problema na remoção do cupom",
|
|
69
|
-
cupomName:
|
|
70
|
-
objectError:
|
|
71
|
-
}),
|
|
72
|
-
} catch (
|
|
79
|
+
cupomName: s,
|
|
80
|
+
objectError: h.error
|
|
81
|
+
}), m("error"), u(!0)), f(!0);
|
|
82
|
+
} catch (l) {
|
|
73
83
|
o == null || o("discount_coupon", {
|
|
74
84
|
name: "problema na api - na remoção do cupom",
|
|
75
|
-
cupomName:
|
|
76
|
-
}),
|
|
85
|
+
cupomName: s
|
|
86
|
+
}), m("error"), u(!0), f(!0);
|
|
77
87
|
} finally {
|
|
78
|
-
|
|
88
|
+
w(!1);
|
|
79
89
|
}
|
|
80
90
|
else
|
|
81
91
|
o == null || o("discount_coupon", {
|
|
82
92
|
name: "Modal de cart vazio acionado"
|
|
83
|
-
}),
|
|
93
|
+
}), y(!0);
|
|
84
94
|
}, $ = () => {
|
|
85
|
-
|
|
95
|
+
z(!0), J(a), R("rules-view");
|
|
86
96
|
};
|
|
87
|
-
return /* @__PURE__ */
|
|
88
|
-
/* @__PURE__ */
|
|
89
|
-
/* @__PURE__ */
|
|
90
|
-
/* @__PURE__ */
|
|
91
|
-
/* @__PURE__ */
|
|
97
|
+
return /* @__PURE__ */ p("div", { className: `container-card-coupon ${x ? "active" : ""}`, children: [
|
|
98
|
+
/* @__PURE__ */ p("div", { className: "text-container", children: [
|
|
99
|
+
/* @__PURE__ */ p("div", { className: "container-title", children: [
|
|
100
|
+
/* @__PURE__ */ c(G, { width: 20, height: 16 }),
|
|
101
|
+
/* @__PURE__ */ c("h3", { className: "title", children: a.couponName })
|
|
92
102
|
] }),
|
|
93
|
-
|
|
103
|
+
a.couponValue && /* @__PURE__ */ p("p", { className: "price-badge", children: [
|
|
94
104
|
"- ",
|
|
95
|
-
|
|
105
|
+
a.couponValue
|
|
96
106
|
] }),
|
|
97
|
-
|
|
98
|
-
|
|
107
|
+
a.couponDescription && /* @__PURE__ */ c("h4", { className: "subtitle", children: a.couponDescription }),
|
|
108
|
+
a.couponExpirationDate && /* @__PURE__ */ p("h4", { className: "subtitle", children: [
|
|
99
109
|
"Válido até ",
|
|
100
|
-
|
|
110
|
+
a.couponExpirationDate
|
|
101
111
|
] })
|
|
102
112
|
] }),
|
|
103
|
-
/* @__PURE__ */
|
|
104
|
-
/* @__PURE__ */
|
|
105
|
-
|
|
106
|
-
/* @__PURE__ */
|
|
113
|
+
/* @__PURE__ */ c("div", { className: "vertical-line" }),
|
|
114
|
+
/* @__PURE__ */ p("div", { className: "buttons-container", children: [
|
|
115
|
+
x && /* @__PURE__ */ p("button", { className: "applied-coupon", children: [
|
|
116
|
+
/* @__PURE__ */ c("span", { className: "applied-coupon-span", children: /* @__PURE__ */ c(H, {}) }),
|
|
107
117
|
"Aplicado"
|
|
108
118
|
] }),
|
|
109
|
-
|
|
119
|
+
x ? /* @__PURE__ */ c(
|
|
110
120
|
"button",
|
|
111
121
|
{
|
|
112
122
|
onClick: M,
|
|
113
123
|
className: "remove-coupon",
|
|
114
|
-
disabled:
|
|
124
|
+
disabled: k,
|
|
115
125
|
children: "Remover"
|
|
116
126
|
}
|
|
117
|
-
) : /* @__PURE__ */
|
|
127
|
+
) : /* @__PURE__ */ c(
|
|
118
128
|
"button",
|
|
119
129
|
{
|
|
120
|
-
onClick: () =>
|
|
130
|
+
onClick: () => A(a.couponName),
|
|
121
131
|
className: "apply-coupon",
|
|
122
|
-
disabled:
|
|
132
|
+
disabled: k,
|
|
123
133
|
children: "Aplicar"
|
|
124
134
|
}
|
|
125
135
|
),
|
|
126
|
-
|
|
136
|
+
a.couponDescription && /* @__PURE__ */ c("a", { onClick: $, children: "Ver Regras" })
|
|
127
137
|
] })
|
|
128
138
|
] });
|
|
129
139
|
};
|
|
130
140
|
export {
|
|
131
|
-
|
|
141
|
+
Z as CouponCard
|
|
132
142
|
};
|
|
@@ -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 {};
|