@plurix/ecom-components 1.14.1-eng-task-1249.21 → 1.14.1-eng-task-1249.22
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.
|
@@ -1,94 +1,94 @@
|
|
|
1
|
-
import { jsx as a, jsxs as
|
|
2
|
-
import { useState as f, useEffect as
|
|
3
|
-
import { Modal as
|
|
4
|
-
import { ProductSelected as
|
|
5
|
-
import { SimilarProducts as
|
|
6
|
-
import { ModalFooter as
|
|
7
|
-
/* empty css */import { getProductsSimilars as
|
|
8
|
-
import
|
|
9
|
-
import { NoSimilarProduct as
|
|
10
|
-
import { getOrderForm as
|
|
11
|
-
import { postChangeOrder as
|
|
12
|
-
import { Skeleton as
|
|
13
|
-
const
|
|
1
|
+
import { jsx as a, jsxs as J, Fragment as M } from "react/jsx-runtime";
|
|
2
|
+
import { useState as f, useEffect as _ } from "react";
|
|
3
|
+
import { Modal as v } from "../Modal/Modal.js";
|
|
4
|
+
import { ProductSelected as L } from "./components/ProductSelected.js";
|
|
5
|
+
import { SimilarProducts as T } from "./components/SimilarProducts.js";
|
|
6
|
+
import { ModalFooter as $ } from "./components/ModalFooter.js";
|
|
7
|
+
/* empty css */import { getProductsSimilars as z } from "./api/getProductsSimilars.js";
|
|
8
|
+
import B from "../../hooks/useAnalitcsEvents.js";
|
|
9
|
+
import { NoSimilarProduct as G } from "./components/NoSimilarProduct.js";
|
|
10
|
+
import { getOrderForm as H } from "./api/getOrderForm.js";
|
|
11
|
+
import { postChangeOrder as K } from "./api/postChangeOrder.js";
|
|
12
|
+
import { Skeleton as Q } from "../Skeleton/index.js";
|
|
13
|
+
const so = ({
|
|
14
14
|
selectedItem: o,
|
|
15
|
-
postalCode:
|
|
15
|
+
postalCode: O,
|
|
16
16
|
orderFormId: d,
|
|
17
|
-
isClubClient:
|
|
18
|
-
isOpen:
|
|
19
|
-
environment:
|
|
17
|
+
isClubClient: y,
|
|
18
|
+
isOpen: b,
|
|
19
|
+
environment: C,
|
|
20
20
|
setIsOpen: p,
|
|
21
21
|
saveSelectedSimilarProduct: c,
|
|
22
22
|
getOrderFormMutation: l,
|
|
23
|
-
getProductsSimilarsMutation:
|
|
24
|
-
postChangeOrderMutation:
|
|
23
|
+
getProductsSimilarsMutation: F,
|
|
24
|
+
postChangeOrderMutation: P
|
|
25
25
|
}) => {
|
|
26
|
-
const [s,
|
|
27
|
-
|
|
26
|
+
const [s, x] = f(), [N, m] = f(!1), r = C === "io", { genericTaggingEvent: j } = B(), [t, g] = f({ itemId: "" });
|
|
27
|
+
_(() => {
|
|
28
28
|
(async () => {
|
|
29
29
|
m(!0);
|
|
30
30
|
try {
|
|
31
|
-
const i = await
|
|
32
|
-
postalCode:
|
|
31
|
+
const i = await z({
|
|
32
|
+
postalCode: O,
|
|
33
33
|
selectedItem: o,
|
|
34
34
|
isIO: r,
|
|
35
|
-
getProductsSimilarsMutation:
|
|
35
|
+
getProductsSimilarsMutation: F
|
|
36
36
|
}), u = (i == null ? void 0 : i.products) || [];
|
|
37
|
-
|
|
37
|
+
x(u);
|
|
38
38
|
} finally {
|
|
39
39
|
m(!1);
|
|
40
40
|
}
|
|
41
41
|
})(), (async () => {
|
|
42
|
-
var i, u;
|
|
42
|
+
var i, u, h;
|
|
43
43
|
m(!0);
|
|
44
44
|
try {
|
|
45
|
-
const
|
|
45
|
+
const w = r && H(d, r), k = l && await l({
|
|
46
46
|
input: {
|
|
47
47
|
orderFormId: d
|
|
48
48
|
}
|
|
49
|
-
}) || { getOrderForm: { data: "" } }, e = r ?
|
|
50
|
-
(
|
|
49
|
+
}) || { getOrderForm: { data: "" } }, e = r ? w : JSON.parse((i = k.getOrderForm.data) != null ? i : "{}"), n = ((h = (u = e == null ? void 0 : e.customData) == null ? void 0 : u.customApps) == null ? void 0 : h.find(
|
|
50
|
+
(E) => E.id === "janis"
|
|
51
51
|
)) || null;
|
|
52
|
-
let
|
|
53
|
-
n != null && n.fields.idSubstitutionCriterias && (
|
|
52
|
+
let S = {};
|
|
53
|
+
n != null && n.fields.idSubstitutionCriterias && (S = JSON.parse(
|
|
54
54
|
n == null ? void 0 : n.fields.idSubstitutionCriterias
|
|
55
55
|
));
|
|
56
|
-
const
|
|
56
|
+
const A = o == null ? void 0 : o.productOriginId;
|
|
57
57
|
g({
|
|
58
|
-
itemId: `${
|
|
58
|
+
itemId: `${S[A]}`
|
|
59
59
|
});
|
|
60
60
|
} finally {
|
|
61
61
|
m(!1);
|
|
62
62
|
}
|
|
63
63
|
})();
|
|
64
64
|
}, []);
|
|
65
|
-
const
|
|
66
|
-
|
|
65
|
+
const q = () => {
|
|
66
|
+
K(
|
|
67
67
|
d,
|
|
68
68
|
r,
|
|
69
69
|
o.productOriginId,
|
|
70
70
|
t.itemId,
|
|
71
|
-
|
|
72
|
-
), t && (c == null || c(t),
|
|
71
|
+
P
|
|
72
|
+
), t && (c == null || c(t), j("salvar_substituto", {
|
|
73
73
|
name: o.name,
|
|
74
74
|
replacement_item: t == null ? void 0 : t.name
|
|
75
75
|
})), p(!1);
|
|
76
76
|
};
|
|
77
77
|
return /* @__PURE__ */ a(
|
|
78
|
-
|
|
78
|
+
v,
|
|
79
79
|
{
|
|
80
|
-
isOpen:
|
|
80
|
+
isOpen: b,
|
|
81
81
|
setIsOpen: p,
|
|
82
82
|
className: "change-order-modal",
|
|
83
83
|
title: "Produto com estoque baixo",
|
|
84
84
|
Footer: s && s.length > 0 && /* @__PURE__ */ a(
|
|
85
|
-
|
|
85
|
+
$,
|
|
86
86
|
{
|
|
87
|
-
saveSelectedSimilarProduct:
|
|
87
|
+
saveSelectedSimilarProduct: q
|
|
88
88
|
}
|
|
89
89
|
),
|
|
90
|
-
children:
|
|
91
|
-
|
|
90
|
+
children: N ? /* @__PURE__ */ a(
|
|
91
|
+
Q,
|
|
92
92
|
{
|
|
93
93
|
width: r ? "100%" : "90%",
|
|
94
94
|
height: r ? 600 : 425,
|
|
@@ -96,21 +96,21 @@ const ao = ({
|
|
|
96
96
|
margin: "auto",
|
|
97
97
|
animation: !0
|
|
98
98
|
}
|
|
99
|
-
) : /* @__PURE__ */
|
|
100
|
-
o && /* @__PURE__ */ a(
|
|
99
|
+
) : /* @__PURE__ */ J(M, { children: [
|
|
100
|
+
o && /* @__PURE__ */ a(L, { selectedItem: o }),
|
|
101
101
|
s && s.length > 0 ? /* @__PURE__ */ a(
|
|
102
|
-
|
|
102
|
+
T,
|
|
103
103
|
{
|
|
104
|
-
isClubClient:
|
|
104
|
+
isClubClient: y,
|
|
105
105
|
similarProductSelect: t,
|
|
106
106
|
setSimilarProductSelect: g,
|
|
107
107
|
products: s
|
|
108
108
|
}
|
|
109
|
-
) : /* @__PURE__ */ a(
|
|
109
|
+
) : /* @__PURE__ */ a(G, {})
|
|
110
110
|
] })
|
|
111
111
|
}
|
|
112
112
|
);
|
|
113
113
|
};
|
|
114
114
|
export {
|
|
115
|
-
|
|
115
|
+
so as ChangeOrderModal
|
|
116
116
|
};
|