@plurix/ecom-components 1.14.1-eng-task-1249.7 → 1.14.1-eng-task-1249.9

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,41 +1,50 @@
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 }) => {
1
+ import { jsxs as c, jsx as e } from "react/jsx-runtime";
2
+ import { useMemo as p } from "react";
3
+ import { isMobile as u } from "../../../constants/index.js";
4
+ import { formatBrazilianPrice as n, formatedQty as h } from "../../../utils/changerOrderModal.js";
5
+ const M = ({ selectedItem: o }) => {
6
+ console.log("selectedItem", o);
6
7
  const {
7
8
  imageUrl: t,
8
- name: i,
9
- quantity: a,
10
- sellingPrice: o,
11
- measurementUnit: s,
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: [
9
+ name: s,
10
+ quantity: i,
11
+ sellingPrice: m,
12
+ measurementUnit: a,
13
+ unitMultiplier: r
14
+ } = o || {};
15
+ console.log({
16
+ measurementUnit: a,
17
+ unitMultiplier: r,
18
+ quantity: i,
19
+ testeunitMultiplier: n(r || 0),
20
+ testeuquantity: n(i || 0)
21
+ });
22
+ const l = p(() => u ? 48 : 80, []), d = t == null ? void 0 : t.replace("-55-55", "-80-80");
23
+ return /* @__PURE__ */ c("section", { className: "change-order-pre-content", children: [
15
24
  /* @__PURE__ */ e(
16
25
  "img",
17
26
  {
18
- height: c,
19
- width: c,
27
+ height: l,
28
+ width: l,
20
29
  style: { objectFit: "contain", width: "20%" },
21
- src: m,
22
- alt: i,
30
+ src: d,
31
+ alt: s,
23
32
  className: "change-order-pre-content-img"
24
33
  }
25
34
  ),
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: [
35
+ /* @__PURE__ */ c("div", { className: "change-order-pre-content-infos", children: [
36
+ /* @__PURE__ */ e("h3", { className: "product-name", children: s }),
37
+ /* @__PURE__ */ c("div", { className: "product-details", children: [
29
38
  /* @__PURE__ */ e("p", { className: "quantity", children: h(
30
- s || "",
31
- l || 0,
32
- a || 0
39
+ a || "",
40
+ r || 0,
41
+ i || 0
33
42
  ) }),
34
- /* @__PURE__ */ e("p", { className: "sellingPrice", children: u(o || 0) })
43
+ /* @__PURE__ */ e("p", { className: "sellingPrice", children: n(m || 0) })
35
44
  ] })
36
45
  ] })
37
46
  ] });
38
47
  };
39
48
  export {
40
- P as ProductSelected
49
+ M as ProductSelected
41
50
  };
@@ -1,20 +1,17 @@
1
- const s = (t, r, e = "") => {
2
- if (e === "un")
1
+ const i = (t, e, r = "") => {
2
+ if (r === "un")
3
3
  return t;
4
- const o = (t * r).toString().match(/^\d+(?:\.\d{0,2})?/);
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})?/)), d = (t, r, e) => {
7
- const n = r * 1e3 * e;
8
- return t === "un" ? `${e} ${e > 1 ? "unidades" : "unidade"} ` : n >= 1e3 ? `${n / 1e3}kg` : `${n}g`;
9
- }, a = (t, r) => {
10
- const e = r * 1e3;
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}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 (e == null ? void 0 : e.map((n) => n.field.originalName)) || [];
17
- }, f = (t) => i([
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
- s as formatListPrice,
28
- a as formatedMultiply,
29
- d as formatedQty,
24
+ i as formatListPrice,
25
+ d as formatedMultiply,
26
+ a as formatedQty,
30
27
  m as truncPrice
31
28
  };
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@plurix/ecom-components",
3
3
  "author": "Plurix",
4
4
  "private": false,
5
- "version": "1.14.1-eng-task-1249.7",
5
+ "version": "1.14.1-eng-task-1249.9",
6
6
  "type": "module",
7
7
  "main": "dist/main.js",
8
8
  "types": "dist/main.d.ts",