@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 E, Fragment as J } from "react/jsx-runtime";
2
- import { useState as f, useEffect as M } from "react";
3
- import { Modal as _ } from "../Modal/Modal.js";
4
- import { ProductSelected as v } from "./components/ProductSelected.js";
5
- import { SimilarProducts as L } from "./components/SimilarProducts.js";
6
- import { ModalFooter as T } from "./components/ModalFooter.js";
7
- /* empty css */import { getProductsSimilars as $ } from "./api/getProductsSimilars.js";
8
- import z from "../../hooks/useAnalitcsEvents.js";
9
- import { NoSimilarProduct as B } from "./components/NoSimilarProduct.js";
10
- import { getOrderForm as G } from "./api/getOrderForm.js";
11
- import { postChangeOrder as H } from "./api/postChangeOrder.js";
12
- import { Skeleton as K } from "../Skeleton/index.js";
13
- const ao = ({
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: S,
15
+ postalCode: O,
16
16
  orderFormId: d,
17
- isClubClient: O,
18
- isOpen: y,
19
- environment: b,
17
+ isClubClient: y,
18
+ isOpen: b,
19
+ environment: C,
20
20
  setIsOpen: p,
21
21
  saveSelectedSimilarProduct: c,
22
22
  getOrderFormMutation: l,
23
- getProductsSimilarsMutation: C,
24
- postChangeOrderMutation: F
23
+ getProductsSimilarsMutation: F,
24
+ postChangeOrderMutation: P
25
25
  }) => {
26
- const [s, P] = f(), [x, m] = f(!1), r = b === "io", { genericTaggingEvent: N } = z(), [t, g] = f({ itemId: "" });
27
- M(() => {
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: S,
31
+ const i = await z({
32
+ postalCode: O,
33
33
  selectedItem: o,
34
34
  isIO: r,
35
- getProductsSimilarsMutation: C
35
+ getProductsSimilarsMutation: F
36
36
  }), u = (i == null ? void 0 : i.products) || [];
37
- P(u);
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 q = r && G(d, r), w = l && await l({
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 ? q : JSON.parse(w.getOrderForm.data), n = ((u = (i = e == null ? void 0 : e.customData) == null ? void 0 : i.customApps) == null ? void 0 : u.find(
50
- (A) => A.id === "janis"
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 h = {};
53
- n != null && n.fields.idSubstitutionCriterias && (h = JSON.parse(
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 k = o == null ? void 0 : o.productOriginId;
56
+ const A = o == null ? void 0 : o.productOriginId;
57
57
  g({
58
- itemId: `${h[k]}`
58
+ itemId: `${S[A]}`
59
59
  });
60
60
  } finally {
61
61
  m(!1);
62
62
  }
63
63
  })();
64
64
  }, []);
65
- const j = () => {
66
- H(
65
+ const q = () => {
66
+ K(
67
67
  d,
68
68
  r,
69
69
  o.productOriginId,
70
70
  t.itemId,
71
- F
72
- ), t && (c == null || c(t), N("salvar_substituto", {
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: y,
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
- T,
85
+ $,
86
86
  {
87
- saveSelectedSimilarProduct: j
87
+ saveSelectedSimilarProduct: q
88
88
  }
89
89
  ),
90
- children: x ? /* @__PURE__ */ a(
91
- K,
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__ */ E(J, { children: [
100
- o && /* @__PURE__ */ a(v, { selectedItem: o }),
99
+ ) : /* @__PURE__ */ J(M, { children: [
100
+ o && /* @__PURE__ */ a(L, { selectedItem: o }),
101
101
  s && s.length > 0 ? /* @__PURE__ */ a(
102
- L,
102
+ T,
103
103
  {
104
- isClubClient: O,
104
+ isClubClient: y,
105
105
  similarProductSelect: t,
106
106
  setSimilarProductSelect: g,
107
107
  products: s
108
108
  }
109
- ) : /* @__PURE__ */ a(B, {})
109
+ ) : /* @__PURE__ */ a(G, {})
110
110
  ] })
111
111
  }
112
112
  );
113
113
  };
114
114
  export {
115
- ao as ChangeOrderModal
115
+ so as ChangeOrderModal
116
116
  };
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.21",
5
+ "version": "1.14.1-eng-task-1249.22",
6
6
  "type": "module",
7
7
  "main": "dist/main.js",
8
8
  "types": "dist/main.d.ts",