@plurix/ecom-components 1.4.0-commerce.SCS-2154.0 → 1.4.0-commerce.SCS-2157.0
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,77 +1,77 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useMemo as
|
|
3
|
-
import { formatEspecifications as
|
|
4
|
-
import { Icons as
|
|
5
|
-
import { isMobile as
|
|
6
|
-
const
|
|
1
|
+
import { jsxs as s, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as c } from "react";
|
|
3
|
+
import { formatEspecifications as w, formatBrazilianPrice as u, formatedMultiply as z } from "../../../utils/changerOrderModal.js";
|
|
4
|
+
import { Icons as S } from "../assets/icons.js";
|
|
5
|
+
import { isMobile as U } from "../../../constants/index.js";
|
|
6
|
+
const H = ({
|
|
7
7
|
similarProduct: a,
|
|
8
|
-
similarProductSelect:
|
|
9
|
-
setSimilarProductSelect:
|
|
10
|
-
isClubClient:
|
|
8
|
+
similarProductSelect: r,
|
|
9
|
+
setSimilarProductSelect: f,
|
|
10
|
+
isClubClient: v
|
|
11
11
|
}) => {
|
|
12
12
|
const {
|
|
13
|
-
images:
|
|
14
|
-
name:
|
|
15
|
-
productId:
|
|
16
|
-
sellingPrice:
|
|
13
|
+
images: N,
|
|
14
|
+
name: d,
|
|
15
|
+
productId: m,
|
|
16
|
+
sellingPrice: o,
|
|
17
17
|
measurementUnit: y,
|
|
18
|
-
unitMultiplier:
|
|
19
|
-
hasDiscount:
|
|
20
|
-
listPrice:
|
|
21
|
-
isClub:
|
|
22
|
-
skuSpecifications:
|
|
23
|
-
} = a, [{ imageUrl: M }] =
|
|
24
|
-
() =>
|
|
25
|
-
[
|
|
26
|
-
), i =
|
|
27
|
-
discountPorcent:
|
|
28
|
-
frontLstPrice:
|
|
29
|
-
frontSellingPrice:
|
|
18
|
+
unitMultiplier: b,
|
|
19
|
+
hasDiscount: C,
|
|
20
|
+
listPrice: n,
|
|
21
|
+
isClub: I,
|
|
22
|
+
skuSpecifications: h
|
|
23
|
+
} = a, [{ imageUrl: M }] = N, l = c(() => U ? 48 : 80, []), p = c(
|
|
24
|
+
() => m === (r == null ? void 0 : r.productId),
|
|
25
|
+
[r]
|
|
26
|
+
), i = c(() => w(h || []), [h]), {
|
|
27
|
+
discountPorcent: k,
|
|
28
|
+
frontLstPrice: L,
|
|
29
|
+
frontSellingPrice: P,
|
|
30
30
|
frontPriceMultiply: j
|
|
31
|
-
} =
|
|
32
|
-
discountPorcent: Math.round((
|
|
33
|
-
frontLstPrice:
|
|
34
|
-
frontSellingPrice:
|
|
35
|
-
frontPriceMultiply:
|
|
36
|
-
}, [
|
|
31
|
+
} = c(() => !o || !n ? {} : {
|
|
32
|
+
discountPorcent: Math.round((n - o) / n * 100) * -1,
|
|
33
|
+
frontLstPrice: u(n || 0),
|
|
34
|
+
frontSellingPrice: u(o || 0),
|
|
35
|
+
frontPriceMultiply: z(y, b)
|
|
36
|
+
}, [o, n]), x = {
|
|
37
37
|
Vegano: "var(--color-seals-veg)",
|
|
38
38
|
Orgânico: "var(--color-seals-org)",
|
|
39
39
|
"Sem Glúten": "var(--color-seals-gluten-free)",
|
|
40
40
|
"Sem Lactose": "var(--color-seals-lactose-free)",
|
|
41
41
|
"Sem Açúcar": "var(--color-seals-sugar-free)"
|
|
42
|
-
},
|
|
43
|
-
|
|
44
|
-
};
|
|
45
|
-
return console.log("sellingPrice", n), console.log("listPrice", r), console.log("isClub", p), console.log("isClubClient", d), /* @__PURE__ */ o(
|
|
42
|
+
}, g = p ? "var(--color-main)" : "var(--color-grayScale-lightest)";
|
|
43
|
+
return /* @__PURE__ */ s(
|
|
46
44
|
"div",
|
|
47
45
|
{
|
|
48
46
|
className: "similar-product-list-item",
|
|
49
|
-
onClick:
|
|
47
|
+
onClick: () => {
|
|
48
|
+
m !== (r == null ? void 0 : r.productId) && f(a);
|
|
49
|
+
},
|
|
50
50
|
style: {
|
|
51
|
-
borderColor:
|
|
51
|
+
borderColor: g
|
|
52
52
|
},
|
|
53
53
|
children: [
|
|
54
|
-
/* @__PURE__ */ e("div", { style: { width:
|
|
54
|
+
/* @__PURE__ */ e("div", { style: { width: l }, children: /* @__PURE__ */ e(
|
|
55
55
|
"img",
|
|
56
56
|
{
|
|
57
|
-
height:
|
|
58
|
-
width:
|
|
57
|
+
height: l,
|
|
58
|
+
width: l,
|
|
59
59
|
src: M,
|
|
60
|
-
alt:
|
|
60
|
+
alt: d,
|
|
61
61
|
style: { objectFit: "contain" }
|
|
62
62
|
}
|
|
63
63
|
) }),
|
|
64
|
-
/* @__PURE__ */
|
|
65
|
-
/* @__PURE__ */
|
|
66
|
-
/* @__PURE__ */ e("h4", { className: "product-name", children:
|
|
64
|
+
/* @__PURE__ */ s("div", { className: "infos", children: [
|
|
65
|
+
/* @__PURE__ */ s("div", { className: "description", children: [
|
|
66
|
+
/* @__PURE__ */ e("h4", { className: "product-name", children: d }),
|
|
67
67
|
/* @__PURE__ */ e(
|
|
68
68
|
"span",
|
|
69
69
|
{
|
|
70
70
|
className: "choose-icon",
|
|
71
71
|
style: {
|
|
72
|
-
backgroundColor:
|
|
72
|
+
backgroundColor: g
|
|
73
73
|
},
|
|
74
|
-
children:
|
|
74
|
+
children: p && /* @__PURE__ */ e(S, { iconId: "Check" })
|
|
75
75
|
}
|
|
76
76
|
)
|
|
77
77
|
] }),
|
|
@@ -83,18 +83,18 @@ const O = ({
|
|
|
83
83
|
children: t
|
|
84
84
|
}
|
|
85
85
|
)) }),
|
|
86
|
-
/* @__PURE__ */
|
|
87
|
-
|
|
88
|
-
/* @__PURE__ */ e("p", { className: "list-price", children:
|
|
89
|
-
/* @__PURE__ */
|
|
90
|
-
|
|
86
|
+
/* @__PURE__ */ s("div", { className: "prices", children: [
|
|
87
|
+
C && /* @__PURE__ */ s("div", { className: "discount", children: [
|
|
88
|
+
/* @__PURE__ */ e("p", { className: "list-price", children: L }),
|
|
89
|
+
/* @__PURE__ */ s("span", { className: "badge", children: [
|
|
90
|
+
k,
|
|
91
91
|
"%"
|
|
92
92
|
] })
|
|
93
93
|
] }),
|
|
94
|
-
/* @__PURE__ */
|
|
95
|
-
|
|
94
|
+
/* @__PURE__ */ s("p", { className: "sellingPrice", children: [
|
|
95
|
+
P,
|
|
96
96
|
/* @__PURE__ */ e("span", { className: "sellingPrice-multiply", children: j }),
|
|
97
|
-
|
|
97
|
+
I && v && /* @__PURE__ */ e("span", { className: "badge", children: "Clube" })
|
|
98
98
|
] })
|
|
99
99
|
] })
|
|
100
100
|
] })
|
|
@@ -103,5 +103,5 @@ const O = ({
|
|
|
103
103
|
);
|
|
104
104
|
};
|
|
105
105
|
export {
|
|
106
|
-
|
|
106
|
+
H as SimilarProductItem
|
|
107
107
|
};
|