@plurix/ecom-components 1.14.1-eng-task-1249.20 → 1.14.1-eng-task-1249.21

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