@plurix/ecom-components 1.7.0-loyalty.0 → 1.8.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.
|
@@ -11,6 +11,7 @@ interface CouponsProps {
|
|
|
11
11
|
genericTaggingEvent?: (name: string, params: object) => void;
|
|
12
12
|
disableFirstEmptyModal?: boolean;
|
|
13
13
|
couponsList?: CouponType[];
|
|
14
|
+
qtdCouponsView?: number;
|
|
14
15
|
}
|
|
15
|
-
export declare const Coupons: ({ orderFormId, hasItemsInCart, builder, account, isIO, closeIOModal, activeOrderFormCoupon, genericTaggingEvent, disableFirstEmptyModal, couponsList }: CouponsProps) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export declare const Coupons: ({ orderFormId, hasItemsInCart, builder, account, isIO, closeIOModal, activeOrderFormCoupon, genericTaggingEvent, disableFirstEmptyModal, couponsList, qtdCouponsView }: CouponsProps) => import("react/jsx-runtime").JSX.Element;
|
|
16
17
|
export {};
|
|
@@ -1,103 +1,110 @@
|
|
|
1
|
-
import { jsx as t, jsxs as
|
|
2
|
-
import { useState as e, useEffect as
|
|
3
|
-
import { getCoupons as
|
|
4
|
-
import { LoadingView as
|
|
5
|
-
import { CouponsView as
|
|
6
|
-
import { RulesView as
|
|
7
|
-
import { OverwriteView as
|
|
8
|
-
import { EmptyCartView as
|
|
9
|
-
/* empty css */const
|
|
10
|
-
orderFormId:
|
|
1
|
+
import { jsx as t, jsxs as B } from "react/jsx-runtime";
|
|
2
|
+
import { useState as e, useEffect as S } from "react";
|
|
3
|
+
import { getCoupons as E } from "./api/getCoupons.js";
|
|
4
|
+
import { LoadingView as G } from "./views/LoadingView.js";
|
|
5
|
+
import { CouponsView as H } from "./views/CouponsView.js";
|
|
6
|
+
import { RulesView as K } from "./views/RulesView.js";
|
|
7
|
+
import { OverwriteView as P } from "./views/OverwriteView.js";
|
|
8
|
+
import { EmptyCartView as Q } from "./views/EmptyCartView.js";
|
|
9
|
+
/* empty css */const I = ({
|
|
10
|
+
orderFormId: h,
|
|
11
11
|
hasItemsInCart: i,
|
|
12
|
-
builder:
|
|
12
|
+
builder: j,
|
|
13
13
|
account: a,
|
|
14
14
|
isIO: o = !1,
|
|
15
15
|
closeIOModal: r,
|
|
16
|
-
activeOrderFormCoupon:
|
|
16
|
+
activeOrderFormCoupon: n,
|
|
17
17
|
genericTaggingEvent: s,
|
|
18
|
-
disableFirstEmptyModal:
|
|
19
|
-
couponsList:
|
|
18
|
+
disableFirstEmptyModal: A,
|
|
19
|
+
couponsList: f,
|
|
20
|
+
qtdCouponsView: l
|
|
20
21
|
}) => {
|
|
21
|
-
const [
|
|
22
|
-
!
|
|
23
|
-
), [
|
|
24
|
-
return
|
|
25
|
-
|
|
26
|
-
}, [
|
|
22
|
+
const [L, w] = e(!0), [q, p] = e([]), [u, c] = e("coupons-view"), [D, C] = e(!1), [y, N] = e(!1), [d, v] = e(""), [m, R] = e(""), [J, V] = e(
|
|
23
|
+
!A
|
|
24
|
+
), [b, k] = e();
|
|
25
|
+
return S(() => {
|
|
26
|
+
n && v(n);
|
|
27
|
+
}, [n]), S(() => {
|
|
27
28
|
(async () => {
|
|
28
|
-
|
|
29
|
+
w(!0);
|
|
29
30
|
try {
|
|
30
|
-
const
|
|
31
|
-
l
|
|
31
|
+
const x = await E(a, j, f);
|
|
32
|
+
if (l) {
|
|
33
|
+
const z = x.slice(0, l);
|
|
34
|
+
p(z);
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
p(x);
|
|
38
|
+
return;
|
|
32
39
|
} catch {
|
|
33
|
-
|
|
40
|
+
p([]);
|
|
34
41
|
} finally {
|
|
35
|
-
|
|
42
|
+
w(!1);
|
|
36
43
|
}
|
|
37
44
|
})();
|
|
38
|
-
}, [JSON.stringify(
|
|
39
|
-
|
|
45
|
+
}, [JSON.stringify(f)]), L ? /* @__PURE__ */ t("div", { className: "coupons-container", children: /* @__PURE__ */ t(
|
|
46
|
+
G,
|
|
40
47
|
{
|
|
41
48
|
isIO: o,
|
|
42
49
|
closeIOModal: r,
|
|
43
50
|
genericTaggingEvent: s
|
|
44
51
|
}
|
|
45
|
-
) }) : /* @__PURE__ */
|
|
46
|
-
(!o || o &&
|
|
47
|
-
|
|
52
|
+
) }) : /* @__PURE__ */ B("div", { className: "coupons-container", children: [
|
|
53
|
+
(!o || o && u === "coupons-view") && /* @__PURE__ */ t(
|
|
54
|
+
H,
|
|
48
55
|
{
|
|
49
|
-
orderFormId:
|
|
56
|
+
orderFormId: h,
|
|
50
57
|
hasItemsInCart: i,
|
|
51
58
|
account: a,
|
|
52
59
|
isIO: o,
|
|
53
60
|
closeIOModal: r,
|
|
54
61
|
coupons: q,
|
|
55
|
-
firstCouponName:
|
|
56
|
-
secondCouponName:
|
|
57
|
-
replaceCoupon:
|
|
58
|
-
setView:
|
|
59
|
-
setFirstCouponName:
|
|
60
|
-
setSecondCouponName:
|
|
61
|
-
setActiveRule:
|
|
62
|
-
setDataItem:
|
|
63
|
-
setReplaceCoupon:
|
|
64
|
-
setIsCloseModalEmpty:
|
|
62
|
+
firstCouponName: d,
|
|
63
|
+
secondCouponName: m,
|
|
64
|
+
replaceCoupon: y,
|
|
65
|
+
setView: c,
|
|
66
|
+
setFirstCouponName: v,
|
|
67
|
+
setSecondCouponName: R,
|
|
68
|
+
setActiveRule: C,
|
|
69
|
+
setDataItem: k,
|
|
70
|
+
setReplaceCoupon: N,
|
|
71
|
+
setIsCloseModalEmpty: V,
|
|
65
72
|
genericTaggingEvent: s
|
|
66
73
|
}
|
|
67
74
|
),
|
|
68
|
-
(!o || o &&
|
|
69
|
-
|
|
75
|
+
(!o || o && u === "rules-view") && D && /* @__PURE__ */ t(
|
|
76
|
+
K,
|
|
70
77
|
{
|
|
71
|
-
dataItem:
|
|
72
|
-
setActiveRule:
|
|
73
|
-
setView:
|
|
78
|
+
dataItem: b,
|
|
79
|
+
setActiveRule: C,
|
|
80
|
+
setView: c,
|
|
74
81
|
isIO: o,
|
|
75
82
|
closeIOModal: r,
|
|
76
83
|
genericTaggingEvent: s
|
|
77
84
|
}
|
|
78
85
|
),
|
|
79
|
-
(!o || o &&
|
|
80
|
-
|
|
86
|
+
(!o || o && u === "overwrite-view") && m && !y && /* @__PURE__ */ t(
|
|
87
|
+
P,
|
|
81
88
|
{
|
|
82
|
-
firstCouponName:
|
|
83
|
-
secondCouponName:
|
|
84
|
-
setView:
|
|
85
|
-
setReplaceCoupon:
|
|
86
|
-
setSecondCouponName:
|
|
89
|
+
firstCouponName: d,
|
|
90
|
+
secondCouponName: m,
|
|
91
|
+
setView: c,
|
|
92
|
+
setReplaceCoupon: N,
|
|
93
|
+
setSecondCouponName: R,
|
|
87
94
|
isIO: o,
|
|
88
95
|
closeIOModal: r,
|
|
89
96
|
genericTaggingEvent: s
|
|
90
97
|
}
|
|
91
98
|
),
|
|
92
|
-
!i &&
|
|
93
|
-
|
|
99
|
+
!i && J && /* @__PURE__ */ t(
|
|
100
|
+
Q,
|
|
94
101
|
{
|
|
95
|
-
setIsCloseModalEmpty:
|
|
102
|
+
setIsCloseModalEmpty: V,
|
|
96
103
|
genericTaggingEvent: s
|
|
97
104
|
}
|
|
98
105
|
)
|
|
99
106
|
] });
|
|
100
107
|
};
|
|
101
108
|
export {
|
|
102
|
-
|
|
109
|
+
I as Coupons
|
|
103
110
|
};
|