@plurix/ecom-components 1.2.1-commerce.2 → 1.3.0-loyalty.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.
Files changed (34) hide show
  1. package/dist/constants/index.d.ts +0 -1
  2. package/dist/constants/index.js +2 -3
  3. package/dist/main.d.ts +0 -2
  4. package/dist/main.js +8 -10
  5. package/dist/packages/Carousel/Carousel.js +47 -46
  6. package/dist/packages/Carousel/components/Bullets.d.ts +2 -1
  7. package/dist/packages/Carousel/components/Bullets.js +10 -2
  8. package/dist/packages/Modal/Modal.d.ts +0 -1
  9. package/dist/packages/Modal/Modal.js +17 -19
  10. package/package.json +2 -2
  11. package/dist/hooks/useAnalitcsEvents.d.ts +0 -4
  12. package/dist/hooks/useAnalitcsEvents.js +0 -11
  13. package/dist/packages/ChangeOrderModal/ChangeOrderModal.d.ts +0 -14
  14. package/dist/packages/ChangeOrderModal/ChangeOrderModal.js +0 -78
  15. package/dist/packages/ChangeOrderModal/api/getProductsSimilars.d.ts +0 -12
  16. package/dist/packages/ChangeOrderModal/api/getProductsSimilars.js +0 -33
  17. package/dist/packages/ChangeOrderModal/assets/icons.d.ts +0 -9
  18. package/dist/packages/ChangeOrderModal/assets/icons.js +0 -72
  19. package/dist/packages/ChangeOrderModal/components/ModalFooter.d.ts +0 -3
  20. package/dist/packages/ChangeOrderModal/components/ModalFooter.js +0 -14
  21. package/dist/packages/ChangeOrderModal/components/ProductSelected.d.ts +0 -14
  22. package/dist/packages/ChangeOrderModal/components/ProductSelected.js +0 -44
  23. package/dist/packages/ChangeOrderModal/components/SimilarProductList.d.ts +0 -9
  24. package/dist/packages/ChangeOrderModal/components/SimilarProductList.js +0 -109
  25. package/dist/packages/ChangeOrderModal/components/SimilarProducts.d.ts +0 -11
  26. package/dist/packages/ChangeOrderModal/components/SimilarProducts.js +0 -35
  27. package/dist/packages/ChangeOrderModal/mocks.d.ts +0 -115
  28. package/dist/packages/ChangeOrderModal/mocks.js +0 -285
  29. package/dist/styles/change-order-modal.global.css +0 -1
  30. package/dist/types/ChangeOrderModal.d.ts +0 -47
  31. package/dist/types/ChangeOrderModal.js +0 -1
  32. package/dist/types/global.d.js +0 -1
  33. package/dist/utils/changerOrderModal.d.ts +0 -8
  34. package/dist/utils/changerOrderModal.js +0 -31
@@ -1,2 +1 @@
1
1
  export declare const HAS_WINDOW: boolean;
2
- export declare const isMobile: boolean;
@@ -1,5 +1,4 @@
1
- const e = typeof window < "u", n = e && window.screen.width <= 768;
1
+ const e = typeof window < "u";
2
2
  export {
3
- e as HAS_WINDOW,
4
- n as isMobile
3
+ e as HAS_WINDOW
5
4
  };
package/dist/main.d.ts CHANGED
@@ -6,5 +6,3 @@ export { Tour } from './packages/Tour/Tour';
6
6
  export { Regionalization } from './packages/Regionalization/Regionalization';
7
7
  export * from './packages/Regionalization/types';
8
8
  export { Modal } from './packages/Modal/Modal';
9
- export * from './types/ChangeOrderModal';
10
- export { ChangeOrderModal } from './packages/ChangeOrderModal/ChangeOrderModal';
package/dist/main.js CHANGED
@@ -1,18 +1,16 @@
1
1
  import { CartClubAlert as e } from "./packages/CartClubAlert/CartClubAlert.js";
2
2
  import { Carousel as p } from "./packages/Carousel/Carousel.js";
3
- import { Coupons as f } from "./packages/Coupons/Coupons.js";
4
- import { Onboarding as x } from "./packages/Onboarding/Onboarding.js";
3
+ import { Coupons as m } from "./packages/Coupons/Coupons.js";
4
+ import { Onboarding as a } from "./packages/Onboarding/Onboarding.js";
5
5
  import { Tour as n } from "./packages/Tour/Tour.js";
6
- import { Regionalization as d } from "./packages/Regionalization/Regionalization.js";
7
- import { Modal as u } from "./packages/Modal/Modal.js";
8
- import { ChangeOrderModal as b } from "./packages/ChangeOrderModal/ChangeOrderModal.js";
6
+ import { Regionalization as u } from "./packages/Regionalization/Regionalization.js";
7
+ import { Modal as b } from "./packages/Modal/Modal.js";
9
8
  export {
10
9
  p as Carousel,
11
10
  e as CartClubAlert,
12
- b as ChangeOrderModal,
13
- f as Coupons,
14
- u as Modal,
15
- x as Onboarding,
16
- d as Regionalization,
11
+ m as Coupons,
12
+ b as Modal,
13
+ a as Onboarding,
14
+ u as Regionalization,
17
15
  n as Tour
18
16
  };
@@ -1,76 +1,76 @@
1
- import { jsx as s, Fragment as w, jsxs as B } from "react/jsx-runtime";
2
- import { Children as _, useState as u, useRef as x, useEffect as z } from "react";
1
+ import { jsx as s, Fragment as w, jsxs as L } from "react/jsx-runtime";
2
+ import { Children as _, useState as u, useRef as $, useEffect as z } from "react";
3
3
  import G from "./components/Bullets.js";
4
- import L from "./components/Arrows.js";
5
- import { DefaultProps as $ } from "./utils/defaultProps.js";
4
+ import x from "./components/Arrows.js";
5
+ import { DefaultProps as k } from "./utils/defaultProps.js";
6
6
  /* empty css */const X = ({
7
- children: k,
7
+ children: S,
8
8
  id: m,
9
9
  bullet: c,
10
10
  arrow: r,
11
11
  qtyItems: l,
12
12
  gapItems: v = 4,
13
- itemWidthProp: d = 0,
13
+ itemWidthProp: a = 0,
14
14
  isMobile: p
15
15
  }) => {
16
- const C = _.toArray(k), [S, W] = u(0), [D, E] = u(0), [M, A] = u(d), [F, I] = u(null), n = x(null), i = x(null), f = {
16
+ const C = _.toArray(S), [A, W] = u(0), [g, D] = u(0), [E, M] = u(a), [F, I] = u(null), n = $(null), i = $(null), f = {
17
17
  bullets: {
18
- ...$.styles.bullets,
18
+ ...k.styles.bullets,
19
19
  ...c == null ? void 0 : c.style
20
20
  },
21
21
  arrows: {
22
- ...$.styles.arrows,
22
+ ...k.styles.arrows,
23
23
  ...r == null ? void 0 : r.style
24
24
  }
25
25
  }, h = () => {
26
26
  if (n.current) {
27
- const t = n.current.scrollWidth, e = n.current.scrollLeft, o = n.current.offsetWidth, a = Math.ceil(t / o), j = Math.round(e / (t / a) - 0.3) + 1;
28
- I(`${j}/${a}`);
27
+ const e = n.current.scrollWidth, t = n.current.scrollLeft, o = n.current.offsetWidth, d = Math.ceil(e / o), j = Math.round(t / (e / d) - 0.3) + 1;
28
+ I(`${j}/${d}`);
29
29
  }
30
30
  }, Q = () => {
31
31
  if (n.current && i.current) {
32
- const t = i.current.clientWidth, e = n.current.scrollLeft, o = Math.round(e / t);
33
- E(o);
32
+ const e = i.current.clientWidth, t = n.current.scrollLeft, o = Math.round(t / e);
33
+ D(o);
34
34
  }
35
- }, g = (t) => {
35
+ }, y = (e) => {
36
36
  if (n.current && i.current) {
37
- const e = i.current.clientWidth;
38
- t === "prev" && (n.current.scrollLeft -= e), t === "next" && (n.current.scrollLeft += e);
37
+ const t = i.current.clientWidth;
38
+ e === "prev" && (n.current.scrollLeft -= t), e === "next" && (n.current.scrollLeft += t);
39
39
  }
40
- }, y = () => {
40
+ }, N = () => {
41
41
  if (n.current && i.current) {
42
- const t = i.current.clientWidth, e = n.current.offsetWidth, o = n.current.scrollWidth, a = Math.round((o - e) / t);
43
- W(l ? Math.ceil(C.length - l) : a);
42
+ const e = i.current.clientWidth, t = n.current.offsetWidth, o = n.current.scrollWidth, d = Math.round((o - t) / e);
43
+ W(l ? Math.ceil(C.length - l) : d);
44
44
  }
45
- }, R = (t) => {
45
+ }, R = (e) => {
46
46
  if (n.current && i.current) {
47
- const e = i.current.clientWidth;
48
- n.current.scrollLeft = e * t;
47
+ const t = i.current.clientWidth;
48
+ n.current.scrollLeft = t * e;
49
49
  }
50
- }, N = (t) => {
51
- if (n.current && d === 0) {
52
- const o = n.current.offsetWidth / t;
53
- A(o);
50
+ }, B = (e) => {
51
+ if (n.current && a === 0) {
52
+ const o = n.current.offsetWidth / e;
53
+ M(o);
54
54
  }
55
55
  }, V = {
56
- width: `${d || (M < 150 ? 150 : 226)}px`
56
+ width: `${a || (E < 150 ? 150 : 226)}px`
57
57
  };
58
58
  return typeof window < "u" && window.addEventListener("resize", () => {
59
- h(), y(), l && N(l);
59
+ h(), N(), l && B(l);
60
60
  }), z(() => {
61
- var t;
62
- l && N(l), y(), h(), (t = n.current) == null || t.addEventListener("scroll", () => {
61
+ var e;
62
+ l && B(l), N(), h(), (e = n.current) == null || e.addEventListener("scroll", () => {
63
63
  h(), Q();
64
64
  });
65
- }, [n]), /* @__PURE__ */ s(w, { children: /* @__PURE__ */ B("div", { id: "carousel", "data-testid": "Carousel", children: [
66
- /* @__PURE__ */ B("div", { className: "carousel-content", children: [
65
+ }, [n]), /* @__PURE__ */ s(w, { children: /* @__PURE__ */ L("div", { id: "carousel", "data-testid": "Carousel", children: [
66
+ /* @__PURE__ */ L("div", { className: "carousel-content", children: [
67
67
  (r == null ? void 0 : r.isVisible) && /* @__PURE__ */ s("div", { className: "carousel-arrow-button-prev", children: /* @__PURE__ */ s(
68
- L,
68
+ x,
69
69
  {
70
70
  position: "prev",
71
71
  style: f.arrows,
72
72
  iconColor: r.iconColor || "#ccc",
73
- onClick: () => g("prev")
73
+ onClick: () => y("prev")
74
74
  }
75
75
  ) }),
76
76
  /* @__PURE__ */ s(
@@ -79,7 +79,7 @@ import { DefaultProps as $ } from "./utils/defaultProps.js";
79
79
  ref: n,
80
80
  className: "carousel-container",
81
81
  id: `carousel-container-tracking${m ? "-" + m : ""}`,
82
- children: C.map((t, e) => /* @__PURE__ */ s(
82
+ children: C.map((e, t) => /* @__PURE__ */ s(
83
83
  "div",
84
84
  {
85
85
  className: "container-item",
@@ -90,38 +90,39 @@ import { DefaultProps as $ } from "./utils/defaultProps.js";
90
90
  marginBottom: `${p ? v : 0}px`
91
91
  },
92
92
  ref: i,
93
- children: t
93
+ children: e
94
94
  },
95
- e
95
+ t
96
96
  ))
97
97
  }
98
98
  ),
99
99
  r != null && r.isVisible ? /* @__PURE__ */ s("div", { className: "carousel-arrow-button-next", children: /* @__PURE__ */ s(
100
- L,
100
+ x,
101
101
  {
102
102
  position: "next",
103
103
  style: f.arrows,
104
104
  iconColor: r.iconColor || "#ccc",
105
- onClick: () => g("next")
105
+ onClick: () => y("next")
106
106
  }
107
107
  ) }) : ""
108
108
  ] }),
109
109
  (c == null ? void 0 : c.numeric) && /* @__PURE__ */ s("div", { className: "numeric-bullets", children: F }),
110
- c != null && c.isVisible ? /* @__PURE__ */ s("div", { className: "bullets-container", children: Array.from({ length: S + 1 }, (t, e) => e + 1).map(
111
- (t, e) => /* @__PURE__ */ s(
110
+ c != null && c.isVisible ? /* @__PURE__ */ s("div", { className: "bullets-container", children: Array.from({ length: A + 1 }, (e, t) => t + 1).map(
111
+ (e, t) => /* @__PURE__ */ s(
112
112
  G,
113
113
  {
114
114
  onClick: () => {
115
- R(e);
115
+ R(t);
116
116
  },
117
- index: e,
117
+ index: t,
118
118
  style: {
119
119
  ...f.bullets,
120
120
  transition: "all 0.8s ease-out",
121
- backgroundColor: `${D === e ? (c == null ? void 0 : c.bulletEnableColor) || "#ff0000" : (c == null ? void 0 : c.bulletDisableColor) || "#ccc"}`
122
- }
121
+ backgroundColor: `${g === t ? (c == null ? void 0 : c.bulletEnableColor) || "#ff0000" : (c == null ? void 0 : c.bulletDisableColor) || "#ccc"}`
122
+ },
123
+ isActive: g === t
123
124
  },
124
- e
125
+ t
125
126
  )
126
127
  ) }) : ""
127
128
  ] }) });
@@ -2,6 +2,7 @@ interface Props {
2
2
  index: number;
3
3
  onClick: () => void;
4
4
  style: object;
5
+ isActive: boolean;
5
6
  }
6
- declare const Bullets: ({ index, onClick, style }: Props) => import("react/jsx-runtime").JSX.Element;
7
+ declare const Bullets: ({ index, onClick, style, isActive }: Props) => import("react/jsx-runtime").JSX.Element;
7
8
  export default Bullets;
@@ -1,5 +1,13 @@
1
- import { jsx as e } from "react/jsx-runtime";
2
- const u = ({ index: t, onClick: o, style: r }) => /* @__PURE__ */ e("button", { style: r, onClick: o }, t);
1
+ import { jsx as r } from "react/jsx-runtime";
2
+ const u = ({ index: t, onClick: a, style: e, isActive: o }) => /* @__PURE__ */ r(
3
+ "button",
4
+ {
5
+ style: e,
6
+ onClick: a,
7
+ "data-active": o
8
+ },
9
+ t
10
+ );
3
11
  export {
4
12
  u as default
5
13
  };
@@ -10,7 +10,6 @@ interface ModalProps {
10
10
  hasTitleArrow?: boolean;
11
11
  Footer?: ReactNode;
12
12
  hideHeader?: boolean;
13
- PreContent?: ReactNode;
14
13
  }
15
14
  export declare const Modal: (props: ModalProps) => import("react/jsx-runtime").JSX.Element | null;
16
15
  export {};
@@ -1,31 +1,30 @@
1
1
  import { jsx as o, jsxs as i } from "react/jsx-runtime";
2
- import { useRef as s, useEffect as p } from "react";
3
- import { ArrowIcon as g } from "../../assets/svgs/ArrowIcon.js";
4
- import { CloseIcon as k } from "../../assets/svgs/CloseIcon.js";
5
- import { HAS_WINDOW as v } from "../../constants/index.js";
6
- /* empty css */const R = (w) => {
2
+ import { useRef as s, useEffect as h } from "react";
3
+ import { ArrowIcon as b } from "../../assets/svgs/ArrowIcon.js";
4
+ import { CloseIcon as g } from "../../assets/svgs/CloseIcon.js";
5
+ import { HAS_WINDOW as k } from "../../constants/index.js";
6
+ /* empty css */const O = (p) => {
7
7
  const {
8
8
  isOpen: r,
9
- setIsOpen: C,
9
+ setIsOpen: w,
10
10
  children: L,
11
11
  className: N,
12
12
  title: d,
13
13
  titleAction: a,
14
14
  hasTitleArrow: x,
15
15
  Footer: m,
16
- hideHeader: b,
17
- PreContent: u
18
- } = w, t = s(null), n = s(null), l = s(null), f = () => C(!1);
19
- return p(() => {
20
- if (v)
16
+ hideHeader: C
17
+ } = p, t = s(null), n = s(null), l = s(null), u = () => w(!1);
18
+ return h(() => {
19
+ if (k)
21
20
  return r ? window.document.body.classList.add("no-scroll") : window.document.body.classList.remove("no-scroll"), () => {
22
21
  window.document.body.classList.remove("no-scroll");
23
22
  };
24
- }, [r]), p(() => {
23
+ }, [r]), h(() => {
25
24
  n.current && t.current && (t.current.style.maxHeight = `calc(100% - 56px - ${n.current.offsetHeight}px)`);
26
25
  const c = (e) => {
27
- var h;
28
- l.current && (e == null ? void 0 : e.target) instanceof Node && !((h = l.current) != null && h.contains(e == null ? void 0 : e.target)) && f();
26
+ var f;
27
+ l.current && (e == null ? void 0 : e.target) instanceof Node && !((f = l.current) != null && f.contains(e == null ? void 0 : e.target)) && u();
29
28
  };
30
29
  return r ? document.addEventListener("mousedown", c) : document.removeEventListener("mousedown", c), () => {
31
30
  document.removeEventListener("mousedown", c);
@@ -37,10 +36,10 @@ import { HAS_WINDOW as v } from "../../constants/index.js";
37
36
  "data-testid": "modal-container",
38
37
  className: N,
39
38
  children: /* @__PURE__ */ o("div", { id: "modal-content-container", children: /* @__PURE__ */ i("div", { id: "modal-content", ref: l, children: [
40
- !b && /* @__PURE__ */ i("header", { children: [
39
+ !C && /* @__PURE__ */ i("header", { children: [
41
40
  a ? /* @__PURE__ */ i("button", { onClick: a, className: "modal-title", children: [
42
41
  x && /* @__PURE__ */ o(
43
- g,
42
+ b,
44
43
  {
45
44
  rotate: "Left",
46
45
  color: "var(--color-support-links)"
@@ -48,9 +47,8 @@ import { HAS_WINDOW as v } from "../../constants/index.js";
48
47
  ),
49
48
  d
50
49
  ] }) : /* @__PURE__ */ o("h2", { className: "modal-title", children: d }),
51
- /* @__PURE__ */ o("button", { onClick: f, className: "modal-close", children: /* @__PURE__ */ o(k, { color: "var(--color-main)" }) })
50
+ /* @__PURE__ */ o("button", { onClick: u, className: "modal-close", children: /* @__PURE__ */ o(g, { color: "var(--color-main)" }) })
52
51
  ] }),
53
- !!u && u,
54
52
  /* @__PURE__ */ o("div", { id: "modal-scroll", ref: t, children: L }),
55
53
  m && /* @__PURE__ */ o("footer", { className: "modal-footer", ref: n, children: m })
56
54
  ] }) })
@@ -58,5 +56,5 @@ import { HAS_WINDOW as v } from "../../constants/index.js";
58
56
  ) : null;
59
57
  };
60
58
  export {
61
- R as Modal
59
+ O as Modal
62
60
  };
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.2.1-commerce.2",
5
+ "version": "1.3.0-loyalty.0",
6
6
  "type": "module",
7
7
  "main": "dist/main.js",
8
8
  "types": "dist/main.d.ts",
@@ -65,6 +65,6 @@
65
65
  },
66
66
  "dependencies": {
67
67
  "@acctglobal/skeleton": "^1.0.0",
68
- "axios": "^1.7.4"
68
+ "axios": "^1.5.1"
69
69
  }
70
70
  }
@@ -1,4 +0,0 @@
1
- declare const useAnalytics: () => {
2
- genericTaggingEvent: (name: string, params?: object) => void;
3
- };
4
- export default useAnalytics;
@@ -1,11 +0,0 @@
1
- const a = () => ({
2
- genericTaggingEvent: (e, n) => {
3
- window.dataLayer.push({
4
- event: e,
5
- params: n
6
- });
7
- }
8
- });
9
- export {
10
- a as default
11
- };
@@ -1,14 +0,0 @@
1
- import { Dispatch, SetStateAction } from 'react';
2
- import { SelectedItemProps } from './components/ProductSelected';
3
- import { SimilarProducts as SimilarProductsProps } from '../../types/ChangeOrderModal';
4
-
5
- export interface ChangeOrderModalProps {
6
- postalCode: string;
7
- selectedItem: SelectedItemProps;
8
- isOpen: boolean;
9
- setIsOpen: Dispatch<SetStateAction<boolean>>;
10
- environment: 'io' | 'faststore';
11
- isClubClient?: boolean;
12
- saveSelectedSimilarProduct?: (similarProduct: SimilarProductsProps | undefined) => void;
13
- }
14
- export declare const ChangeOrderModal: ({ selectedItem, postalCode, isClubClient, isOpen, environment, setIsOpen, saveSelectedSimilarProduct }: ChangeOrderModalProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,78 +0,0 @@
1
- import { jsx as r, jsxs as y, Fragment as P } from "react/jsx-runtime";
2
- import { useState as n, useEffect as x } from "react";
3
- import { Modal as b } from "../Modal/Modal.js";
4
- import { ProductSelected as q } from "./components/ProductSelected.js";
5
- import { SimilarProducts as F } from "./components/SimilarProducts.js";
6
- import { ModalFooter as M } from "./components/ModalFooter.js";
7
- /* empty css */import { Skeleton as j } from "@acctglobal/skeleton";
8
- import { getProductsSimilars as k } from "./api/getProductsSimilars.js";
9
- import v from "../../hooks/useAnalitcsEvents.js";
10
- const G = ({
11
- selectedItem: t,
12
- postalCode: c,
13
- isClubClient: l,
14
- isOpen: d,
15
- environment: u,
16
- setIsOpen: s,
17
- saveSelectedSimilarProduct: a
18
- }) => {
19
- const [o, f] = n(), [g, p] = n(), [h, m] = n(!1), e = u === "io", { genericTaggingEvent: S } = v();
20
- return x(() => {
21
- (async () => {
22
- m(!0);
23
- try {
24
- const i = await k({
25
- postalCode: c,
26
- selectedItem: t,
27
- isIO: e
28
- });
29
- p(i == null ? void 0 : i.products);
30
- } finally {
31
- m(!1);
32
- }
33
- })();
34
- }, []), /* @__PURE__ */ r(
35
- b,
36
- {
37
- isOpen: d,
38
- setIsOpen: s,
39
- className: "change-order-modal",
40
- title: "Produto com estoque baixo",
41
- Footer: /* @__PURE__ */ r(
42
- M,
43
- {
44
- saveSelectedSimilarProduct: () => {
45
- o && (a == null || a(o), S("salvar_substituto", {
46
- name: t.name,
47
- replacement_item: o == null ? void 0 : o.name
48
- })), s(!1);
49
- }
50
- }
51
- ),
52
- children: h ? /* @__PURE__ */ r(
53
- j,
54
- {
55
- width: e ? "100%" : "90%",
56
- height: e ? 600 : 425,
57
- backgroundColor: "var(--color-grayScale-faded)",
58
- margin: "auto",
59
- animation: !0
60
- }
61
- ) : /* @__PURE__ */ y(P, { children: [
62
- t && /* @__PURE__ */ r(q, { selectedItem: t }),
63
- /* @__PURE__ */ r(
64
- F,
65
- {
66
- isClubClient: l,
67
- similarProductSelect: o,
68
- setSimilarProductSelect: f,
69
- products: g
70
- }
71
- )
72
- ] })
73
- }
74
- );
75
- };
76
- export {
77
- G as ChangeOrderModal
78
- };
@@ -1,12 +0,0 @@
1
- import { SelectedItemProps } from '../components/ProductSelected';
2
-
3
- interface GetProductsSimilarsProps {
4
- postalCode: string;
5
- isIO: boolean;
6
- selectedItem: SelectedItemProps;
7
- }
8
- export declare const getProductsSimilars: ({ postalCode, isIO, selectedItem }: GetProductsSimilarsProps) => Promise<{
9
- productOrigin: string;
10
- products: import('../../../main').SimilarProducts[];
11
- } | undefined>;
12
- export {};
@@ -1,33 +0,0 @@
1
- import n from "axios";
2
- const O = async ({
3
- postalCode: a,
4
- isIO: p,
5
- selectedItem: r
6
- }) => {
7
- try {
8
- if (p) {
9
- const { data: o } = await n.get(
10
- `/_v/commerce/products/productsSimilar?postalCode=${a}&skus=${r == null ? void 0 : r.productOriginId}&field=sku`
11
- ), { similarProducts: u } = o;
12
- return u.find(
13
- (c) => c.productOrigin === (r == null ? void 0 : r.productOriginId)
14
- );
15
- }
16
- const { data: i } = await n.post("/api/proxy", {
17
- targetUrl: `/_v/commerce/products/productsSimilar?postalCode=${a}&skus=${r == null ? void 0 : r.productOriginId}&field=sku`,
18
- method: "GET",
19
- headers: {
20
- "Content-Type": "application/json",
21
- Accept: "application/json"
22
- }
23
- }), { similarProducts: s } = i;
24
- return s.find(
25
- (o) => o.productOrigin === r.productOriginId
26
- );
27
- } catch (i) {
28
- console.error("Error in Change Order Modal", i);
29
- }
30
- };
31
- export {
32
- O as getProductsSimilars
33
- };
@@ -1,9 +0,0 @@
1
- export type IconsId = 'Check' | 'Trash';
2
- export interface EditableProps {
3
- iconId: IconsId;
4
- size?: string;
5
- width?: string;
6
- heigth?: string;
7
- color?: string;
8
- }
9
- export declare const Icons: (props: EditableProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,72 +0,0 @@
1
- import { jsx as C, jsxs as n } from "react/jsx-runtime";
2
- const a = ({
3
- iconId: e,
4
- color: r,
5
- heigth: t,
6
- size: o,
7
- width: l
8
- }) => ({
9
- Check: /* @__PURE__ */ C(
10
- "svg",
11
- {
12
- width: o || l || "10",
13
- height: o || t || "8",
14
- viewBox: "0 0 10 8",
15
- fill: "none",
16
- xmlns: "http://www.w3.org/2000/svg",
17
- children: /* @__PURE__ */ C(
18
- "path",
19
- {
20
- d: "M1 4.00016L3.66667 6.66683L9 1.3335",
21
- stroke: r || "var(--color-grayScale-white)",
22
- strokeWidth: "1.2",
23
- strokeLinecap: "round",
24
- strokeLinejoin: "round"
25
- }
26
- )
27
- }
28
- ),
29
- Trash: /* @__PURE__ */ n(
30
- "svg",
31
- {
32
- width: "24",
33
- height: "24",
34
- viewBox: "0 0 24 24",
35
- fill: "none",
36
- xmlns: "http://www.w3.org/2000/svg",
37
- children: [
38
- /* @__PURE__ */ C(
39
- "path",
40
- {
41
- d: "M8.54916 5.63072C8.52824 5.27321 8.52824 4.91488 8.54916 4.55737C8.59731 4.13015 8.81097 3.73515 9.14856 3.44917C9.48614 3.16319 9.92354 3.00662 10.3759 3.00988C11.4504 2.99671 12.5249 2.99671 13.5994 3.00988C13.8457 3.00761 14.0899 3.05241 14.3176 3.14158C14.5452 3.23075 14.7517 3.36248 14.9247 3.52895C15.0977 3.69542 15.2337 3.89325 15.3246 4.11064C15.4155 4.32803 15.4595 4.56056 15.4539 4.79442C15.4539 5.0644 15.4539 5.33769 15.4539 5.63072H15.7069H20.1644C20.2716 5.6272 20.3789 5.63715 20.4834 5.66034C20.6376 5.70026 20.7726 5.78958 20.8654 5.91319C20.9583 6.03679 21.0033 6.18705 20.9929 6.33857C20.9788 6.49301 20.9078 6.63779 20.7924 6.7474C20.677 6.85701 20.5246 6.92445 20.362 6.93783C20.0154 6.93783 19.6688 6.93783 19.3013 6.93783C19.1627 6.93783 19.1003 6.96418 19.0899 7.11563C18.949 9.36989 18.8022 11.6252 18.6497 13.8817C18.5527 15.4061 18.4556 16.9305 18.3481 18.4549C18.3083 19.1365 17.995 19.7778 17.4729 20.2469C16.9507 20.7159 16.2593 20.9772 15.5406 20.977C13.1801 20.977 10.823 20.977 8.46598 20.977C7.7366 20.9697 7.03841 20.695 6.51717 20.2103C5.99593 19.7256 5.69201 19.0684 5.66881 18.3759C5.56482 16.6013 5.42616 14.8233 5.30137 13.0487C5.19277 11.4946 5.0865 9.94278 4.98251 8.39312C4.95478 7.9618 4.92012 7.53377 4.89932 7.10245C4.89932 6.97404 4.84039 6.93783 4.7156 6.94112C4.38978 6.94112 4.0674 6.94112 3.74158 6.94112C3.55772 6.94112 3.38136 6.87174 3.25135 6.74824C3.12135 6.62475 3.04834 6.45727 3.04834 6.28263C3.04834 6.10798 3.12135 5.9405 3.25135 5.81701C3.38136 5.69352 3.55772 5.62413 3.74158 5.62413H8.24765L8.54916 5.63072ZM6.33083 6.99381C6.33083 7.05966 6.33083 7.12551 6.33083 7.19465C6.42095 8.68944 6.51224 10.1864 6.60467 11.6856C6.74332 13.8883 6.88541 16.0876 7.01713 18.2903C7.01546 18.4778 7.05417 18.6637 7.13086 18.8365C7.20755 19.0093 7.3206 19.1654 7.4631 19.2952C7.60559 19.425 7.77452 19.5258 7.9595 19.5914C8.14448 19.6569 8.34166 19.6858 8.53884 19.6764H15.4712C15.6686 19.6863 15.8659 19.6577 16.0511 19.5923C16.2363 19.527 16.4054 19.4262 16.548 19.2963C16.6906 19.1664 16.8036 19.0101 16.8802 18.8371C16.9567 18.6641 16.995 18.478 16.9929 18.2903C16.9929 18.0104 17.0275 17.7306 17.0483 17.4507C17.1569 15.7825 17.2725 14.1143 17.3949 12.4461C17.4897 11.004 17.5844 9.56192 17.6792 8.11982C17.7034 7.75435 17.7242 7.38562 17.7485 6.99381H6.33083ZM14.0535 5.62413C14.0625 5.6062 14.0695 5.58743 14.0744 5.56814C14.0744 5.33767 14.0744 5.1039 14.0744 4.87014C14.0744 4.50796 13.9322 4.36967 13.5544 4.36638H10.4348C10.1714 4.36638 9.9738 4.47175 9.95993 4.66601C9.9322 4.99525 9.95993 5.30147 9.95993 5.62413H14.0535Z",
42
- fill: "var(--color-negativeFeedback)"
43
- }
44
- ),
45
- /* @__PURE__ */ C(
46
- "path",
47
- {
48
- d: "M9.92547 13.2957C9.92547 14.4612 9.92547 15.6235 9.92547 16.7891C9.93338 16.9518 9.87749 17.1115 9.76866 17.2374C9.65983 17.3632 9.50572 17.4463 9.33615 17.4706C9.16629 17.4933 8.99364 17.4553 8.85151 17.3641C8.70938 17.2729 8.60787 17.1349 8.56666 16.9767C8.54797 16.8968 8.53988 16.8149 8.54246 16.7331V9.88799C8.54246 9.71334 8.61546 9.54586 8.74547 9.42237C8.87548 9.29888 9.05184 9.22949 9.2357 9.22949C9.41956 9.22949 9.59583 9.29888 9.72584 9.42237C9.85585 9.54586 9.92894 9.71334 9.92894 9.88799C9.92547 11.0206 9.92547 12.1598 9.92547 13.2957Z",
49
- fill: "var(--color-negativeFeedback)"
50
- }
51
- ),
52
- /* @__PURE__ */ C(
53
- "path",
54
- {
55
- d: "M11.3084 13.2955C11.3084 12.1366 11.3084 10.9908 11.3084 9.82199C11.3089 9.66148 11.3711 9.50667 11.4833 9.38667C11.5956 9.26668 11.7501 9.18977 11.9178 9.17036C12.0855 9.15095 12.255 9.1904 12.3942 9.28129C12.5335 9.37218 12.633 9.50826 12.6741 9.66395C12.6845 9.75918 12.6845 9.85517 12.6741 9.9504C12.6741 12.1893 12.6741 14.4292 12.6741 16.6703C12.6741 16.7197 12.6741 16.7691 12.6741 16.8152C12.6741 16.9899 12.601 17.1573 12.471 17.2808C12.341 17.4043 12.1647 17.4737 11.9808 17.4737C11.797 17.4737 11.6206 17.4043 11.4906 17.2808C11.3606 17.1573 11.2876 16.9899 11.2876 16.8152C11.3049 15.6398 11.3084 14.4644 11.3084 13.2955Z",
56
- fill: "var(--color-negativeFeedback)"
57
- }
58
- ),
59
- /* @__PURE__ */ C(
60
- "path",
61
- {
62
- d: "M14.0782 13.2955C14.0782 12.1366 14.0782 10.9908 14.0782 9.82199C14.0787 9.66148 14.1409 9.50667 14.2531 9.38667C14.3653 9.26668 14.5198 9.18977 14.6876 9.17036C14.8553 9.15095 15.0247 9.1904 15.164 9.28129C15.3033 9.37218 15.4028 9.50826 15.4438 9.66395C15.4601 9.75861 15.4659 9.8546 15.4612 9.9504C15.4612 12.1893 15.4612 14.4292 15.4612 16.6703C15.4612 16.7197 15.4612 16.7691 15.4612 16.8152C15.4612 16.9899 15.3881 17.1573 15.2581 17.2808C15.1281 17.4043 14.9518 17.4737 14.7679 17.4737C14.5841 17.4737 14.4077 17.4043 14.2777 17.2808C14.1477 17.1573 14.0747 16.9899 14.0747 16.8152C14.0747 15.6398 14.0782 14.4644 14.0782 13.2955Z",
63
- fill: "var(--color-negativeFeedback)"
64
- }
65
- )
66
- ]
67
- }
68
- )
69
- })[e], s = (e) => /* @__PURE__ */ C(a, { ...e });
70
- export {
71
- s as Icons
72
- };
@@ -1,3 +0,0 @@
1
- export declare const ModalFooter: ({ saveSelectedSimilarProduct }: {
2
- saveSelectedSimilarProduct?: () => void;
3
- }) => import("react/jsx-runtime").JSX.Element;
@@ -1,14 +0,0 @@
1
- import { jsx as n } from "react/jsx-runtime";
2
- const t = ({
3
- saveSelectedSimilarProduct: o
4
- }) => /* @__PURE__ */ n("div", { className: "change-order-moda-footer", children: /* @__PURE__ */ n(
5
- "button",
6
- {
7
- onClick: () => o == null ? void 0 : o(),
8
- className: "change-order-save-buttom",
9
- children: "Salvar Substituto"
10
- }
11
- ) });
12
- export {
13
- t as ModalFooter
14
- };
@@ -1,14 +0,0 @@
1
- export interface SelectedItemProps {
2
- imageUrl: string;
3
- name: string;
4
- quantity: number;
5
- sellingPrice: number;
6
- measurementUnit: string;
7
- unitMultiplier: number;
8
- productOriginId: string;
9
- }
10
- interface SeletetedProductProps {
11
- selectedItem?: SelectedItemProps;
12
- }
13
- export declare const ProductSelected: ({ selectedItem }: SeletetedProductProps) => import("react/jsx-runtime").JSX.Element;
14
- export {};