@plurix/ecom-components 1.14.1-eng-task-1249.8 → 1.14.1-eng-task-1249.10
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,5 +1,5 @@
|
|
|
1
1
|
import { jsx as a, jsxs as k, Fragment as A } from "react/jsx-runtime";
|
|
2
|
-
import { useState as
|
|
2
|
+
import { useState as p, useEffect as E } from "react";
|
|
3
3
|
import { Modal as J } from "../Modal/Modal.js";
|
|
4
4
|
import { ProductSelected as _ } from "./components/ProductSelected.js";
|
|
5
5
|
import { SimilarProducts as v } from "./components/SimilarProducts.js";
|
|
@@ -13,17 +13,17 @@ import { Skeleton as H } from "../Skeleton/index.js";
|
|
|
13
13
|
const no = ({
|
|
14
14
|
selectedItem: o,
|
|
15
15
|
postalCode: S,
|
|
16
|
-
orderFormId:
|
|
16
|
+
orderFormId: c,
|
|
17
17
|
isClubClient: O,
|
|
18
18
|
isOpen: y,
|
|
19
19
|
environment: b,
|
|
20
|
-
setIsOpen:
|
|
21
|
-
saveSelectedSimilarProduct:
|
|
20
|
+
setIsOpen: f,
|
|
21
|
+
saveSelectedSimilarProduct: e,
|
|
22
22
|
getOrderFormMutation: C,
|
|
23
23
|
getProductsSimilarsMutation: F,
|
|
24
24
|
postChangeOrderMutation: P
|
|
25
25
|
}) => {
|
|
26
|
-
const [s, x] =
|
|
26
|
+
const [s, x] = p(), [N, m] = p(!1), r = b === "io", { genericTaggingEvent: j } = $(), [t, l] = p({ itemId: "" });
|
|
27
27
|
E(() => {
|
|
28
28
|
(async () => {
|
|
29
29
|
m(!0);
|
|
@@ -42,13 +42,13 @@ const no = ({
|
|
|
42
42
|
var i, u;
|
|
43
43
|
m(!0);
|
|
44
44
|
try {
|
|
45
|
-
const
|
|
45
|
+
const g = r ? B(c, r) : await C({
|
|
46
46
|
input: {
|
|
47
|
-
orderFormId:
|
|
47
|
+
orderFormId: c
|
|
48
48
|
}
|
|
49
|
-
});
|
|
50
|
-
console.log("
|
|
51
|
-
const
|
|
49
|
+
}), d = r ? g : JSON.parse(g.getOrderForm.data);
|
|
50
|
+
console.log("parsedResponse", d);
|
|
51
|
+
const n = ((u = (i = d == null ? void 0 : d.customData) == null ? void 0 : i.customApps) == null ? void 0 : u.find(
|
|
52
52
|
(M) => M.id === "janis"
|
|
53
53
|
)) || null;
|
|
54
54
|
let h = {};
|
|
@@ -56,7 +56,7 @@ const no = ({
|
|
|
56
56
|
n == null ? void 0 : n.fields.idSubstitutionCriterias
|
|
57
57
|
));
|
|
58
58
|
const w = o == null ? void 0 : o.productOriginId;
|
|
59
|
-
|
|
59
|
+
l({
|
|
60
60
|
itemId: `${h[w]}`
|
|
61
61
|
});
|
|
62
62
|
} finally {
|
|
@@ -66,21 +66,21 @@ const no = ({
|
|
|
66
66
|
}, []);
|
|
67
67
|
const q = () => {
|
|
68
68
|
G(
|
|
69
|
-
|
|
69
|
+
c,
|
|
70
70
|
r,
|
|
71
71
|
o.productOriginId,
|
|
72
72
|
t.itemId,
|
|
73
73
|
P
|
|
74
|
-
), t && (
|
|
74
|
+
), t && (e == null || e(t), j("salvar_substituto", {
|
|
75
75
|
name: o.name,
|
|
76
76
|
replacement_item: t == null ? void 0 : t.name
|
|
77
|
-
})),
|
|
77
|
+
})), f(!1);
|
|
78
78
|
};
|
|
79
79
|
return /* @__PURE__ */ a(
|
|
80
80
|
J,
|
|
81
81
|
{
|
|
82
82
|
isOpen: y,
|
|
83
|
-
setIsOpen:
|
|
83
|
+
setIsOpen: f,
|
|
84
84
|
className: "change-order-modal",
|
|
85
85
|
title: "Produto com estoque baixo",
|
|
86
86
|
Footer: s && s.length > 0 && /* @__PURE__ */ a(
|
|
@@ -105,7 +105,7 @@ const no = ({
|
|
|
105
105
|
{
|
|
106
106
|
isClubClient: O,
|
|
107
107
|
similarProductSelect: t,
|
|
108
|
-
setSimilarProductSelect:
|
|
108
|
+
setSimilarProductSelect: l,
|
|
109
109
|
products: s
|
|
110
110
|
}
|
|
111
111
|
) : /* @__PURE__ */ a(z, {})
|
|
@@ -1,49 +1,41 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useMemo as
|
|
3
|
-
import { isMobile as
|
|
4
|
-
import {
|
|
5
|
-
const
|
|
1
|
+
import { jsxs as r, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as d } from "react";
|
|
3
|
+
import { isMobile as p } from "../../../constants/index.js";
|
|
4
|
+
import { formatedQty as h, formatBrazilianPrice as u } from "../../../utils/changerOrderModal.js";
|
|
5
|
+
const P = ({ selectedItem: n }) => {
|
|
6
6
|
const {
|
|
7
7
|
imageUrl: t,
|
|
8
|
-
name:
|
|
9
|
-
quantity:
|
|
10
|
-
sellingPrice:
|
|
8
|
+
name: i,
|
|
9
|
+
quantity: a,
|
|
10
|
+
sellingPrice: o,
|
|
11
11
|
measurementUnit: s,
|
|
12
|
-
unitMultiplier:
|
|
13
|
-
} =
|
|
14
|
-
|
|
15
|
-
measurementUnit: s,
|
|
16
|
-
unitMultiplier: r,
|
|
17
|
-
quantity: i,
|
|
18
|
-
testeunitMultiplier: n(r || 0),
|
|
19
|
-
testeuquantity: n(i || 0)
|
|
20
|
-
});
|
|
21
|
-
const a = p(() => u ? 48 : 80, []), d = t == null ? void 0 : t.replace("-55-55", "-80-80");
|
|
22
|
-
return /* @__PURE__ */ c("section", { className: "change-order-pre-content", children: [
|
|
12
|
+
unitMultiplier: l
|
|
13
|
+
} = n || {}, c = d(() => p ? 48 : 80, []), m = t == null ? void 0 : t.replace("-55-55", "-80-80");
|
|
14
|
+
return /* @__PURE__ */ r("section", { className: "change-order-pre-content", children: [
|
|
23
15
|
/* @__PURE__ */ e(
|
|
24
16
|
"img",
|
|
25
17
|
{
|
|
26
|
-
height:
|
|
27
|
-
width:
|
|
18
|
+
height: c,
|
|
19
|
+
width: c,
|
|
28
20
|
style: { objectFit: "contain", width: "20%" },
|
|
29
|
-
src:
|
|
30
|
-
alt:
|
|
21
|
+
src: m,
|
|
22
|
+
alt: i,
|
|
31
23
|
className: "change-order-pre-content-img"
|
|
32
24
|
}
|
|
33
25
|
),
|
|
34
|
-
/* @__PURE__ */
|
|
35
|
-
/* @__PURE__ */ e("h3", { className: "product-name", children:
|
|
36
|
-
/* @__PURE__ */
|
|
26
|
+
/* @__PURE__ */ r("div", { className: "change-order-pre-content-infos", children: [
|
|
27
|
+
/* @__PURE__ */ e("h3", { className: "product-name", children: i }),
|
|
28
|
+
/* @__PURE__ */ r("div", { className: "product-details", children: [
|
|
37
29
|
/* @__PURE__ */ e("p", { className: "quantity", children: h(
|
|
38
30
|
s || "",
|
|
39
|
-
|
|
40
|
-
|
|
31
|
+
l || 0,
|
|
32
|
+
a || 0
|
|
41
33
|
) }),
|
|
42
|
-
/* @__PURE__ */ e("p", { className: "sellingPrice", children:
|
|
34
|
+
/* @__PURE__ */ e("p", { className: "sellingPrice", children: u(o || 0) })
|
|
43
35
|
] })
|
|
44
36
|
] })
|
|
45
37
|
] });
|
|
46
38
|
};
|
|
47
39
|
export {
|
|
48
|
-
|
|
40
|
+
P as ProductSelected
|
|
49
41
|
};
|
|
@@ -1,20 +1,17 @@
|
|
|
1
|
-
const
|
|
2
|
-
if (
|
|
1
|
+
const i = (t, e, r = "") => {
|
|
2
|
+
if (r === "un")
|
|
3
3
|
return t;
|
|
4
|
-
const o = (t *
|
|
4
|
+
const o = (t * e).toString().match(/^\d+(?:\.\d{0,2})?/);
|
|
5
5
|
return Number(o);
|
|
6
|
-
}, u = (t) => t.toLocaleString("pt-br", { style: "currency", currency: "BRL" }), m = (t) => Number(t.toString().match(/^\d+(?:\.\d{0,2})?/)),
|
|
7
|
-
const
|
|
8
|
-
return t === "un" ?
|
|
9
|
-
},
|
|
10
|
-
const
|
|
11
|
-
return t === "un" ? "" : e >= 1e3 ? `/${e / 1e3}kg` : `/${e}g`;
|
|
12
|
-
}, i = (t, r) => {
|
|
13
|
-
const e = r == null ? void 0 : r.filter(
|
|
6
|
+
}, u = (t) => t.toLocaleString("pt-br", { style: "currency", currency: "BRL" }), m = (t) => Number(t.toString().match(/^\d+(?:\.\d{0,2})?/)), a = (t, e, r) => t === "un" ? `${r} ${r > 1 ? "unidades" : "unidade"} ` : e >= 1 ? `${e}kg` : `${e * 1e3}g`, d = (t, e) => {
|
|
7
|
+
const r = e * 1e3;
|
|
8
|
+
return t === "un" ? "" : r >= 1e3 ? `/${r / 1e3}kg` : `/${r}g`;
|
|
9
|
+
}, s = (t, e) => {
|
|
10
|
+
const r = e == null ? void 0 : e.filter(
|
|
14
11
|
(n) => t.includes(n.field.originalName) && n.values.some((c) => c.originalName.toLowerCase() === "true")
|
|
15
12
|
);
|
|
16
|
-
return (
|
|
17
|
-
}, f = (t) =>
|
|
13
|
+
return (r == null ? void 0 : r.map((n) => n.field.originalName)) || [];
|
|
14
|
+
}, f = (t) => s([
|
|
18
15
|
"Vegano",
|
|
19
16
|
"Orgânico",
|
|
20
17
|
"Sem Glúten",
|
|
@@ -24,8 +21,8 @@ const s = (t, r, e = "") => {
|
|
|
24
21
|
export {
|
|
25
22
|
u as formatBrazilianPrice,
|
|
26
23
|
f as formatEspecifications,
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
24
|
+
i as formatListPrice,
|
|
25
|
+
d as formatedMultiply,
|
|
26
|
+
a as formatedQty,
|
|
30
27
|
m as truncPrice
|
|
31
28
|
};
|