@tesouro/embedded-components-react 0.5.203 → 0.5.204

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 (26) hide show
  1. package/dist/index.css +9 -0
  2. package/dist/index.d.ts +4 -0
  3. package/dist/index.js +1 -1
  4. package/dist/lib/ProductsWidget.d.ts +4 -0
  5. package/dist/lib/ProductsWidget.js +1 -1
  6. package/dist/lib/ReceivablesWidget.d.ts +2 -0
  7. package/dist/libs/tesouro-embedded-components-react/products-widget/feature/dist/index.js +1 -1
  8. package/dist/libs/tesouro-embedded-components-react/products-widget/feature/dist/index10.js +136 -0
  9. package/dist/libs/tesouro-embedded-components-react/products-widget/feature/dist/index4.js +5 -30
  10. package/dist/libs/tesouro-embedded-components-react/products-widget/feature/dist/index5.js +9 -19
  11. package/dist/libs/tesouro-embedded-components-react/products-widget/feature/dist/index6.js +22 -54
  12. package/dist/libs/tesouro-embedded-components-react/products-widget/feature/dist/index7.js +14 -40
  13. package/dist/libs/tesouro-embedded-components-react/products-widget/feature/dist/index8.js +57 -118
  14. package/dist/libs/tesouro-embedded-components-react/products-widget/feature/dist/index9.js +72 -0
  15. package/dist/libs/tesouro-embedded-components-react/products-widget/ui/dist/index2.js +2 -0
  16. package/dist/libs/tesouro-embedded-components-react/products-widget/ui/dist/index4.js +97 -93
  17. package/dist/libs/tesouro-embedded-components-react/products-widget/ui/dist/index5.js +35 -32
  18. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  19. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/data-access/dist/index10.js +8 -8
  20. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/data-access/dist/index4.js +8 -8
  21. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/data-access/dist/index9.js +8 -8
  22. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/feature/dist/lib/MeasureUnitsManagerContainer.js +79 -70
  23. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/feature/dist/lib/useMeasureUnits.js +4 -4
  24. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/ui/dist/index2.js +1 -0
  25. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/ui/dist/index4.js +109 -107
  26. package/package.json +1 -1
@@ -0,0 +1,72 @@
1
+ "use client";
2
+ "use client";
3
+ "use client";
4
+ "use client";
5
+ import { useRefetchWidget as e, useWidgetConfig as t, useWidgetError as n, useWidgetInitStaleForToken as r, useWidgetLoading as i } from "../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
6
+ import "../../../shared/feature/dist/index.js";
7
+ import { PRODUCT_MESSAGE_LABELS_EN as a } from "../../../shared/product-catalog/feature/dist/lib/labels.js";
8
+ import { hasSelectedText as o } from "../../../shared/product-catalog/feature/dist/lib/helpers.js";
9
+ import { useMeasureUnits as s } from "../../../shared/product-catalog/feature/dist/lib/useMeasureUnits.js";
10
+ import { useProductForm as c } from "../../../shared/product-catalog/feature/dist/lib/useProductForm.js";
11
+ import "../../../shared/product-catalog/feature/dist/index.js";
12
+ import { getProductPermissions as l } from "./index5.js";
13
+ import { useProductDelete as u } from "./index6.js";
14
+ import { useProductDetails as d } from "./index7.js";
15
+ import { useProductsTable as f } from "./index8.js";
16
+ import { useCallback as p, useMemo as m, useState as h } from "react";
17
+ //#region ../../libs/tesouro-embedded-components-react/products-widget/feature/dist/index9.js
18
+ function g({ messageLabels: g }) {
19
+ let _ = m(() => ({
20
+ ...a,
21
+ ...g
22
+ }), [g]), { initResponse: v, widgetToken: y } = t(), b = i(), x = n(), S = r(), C = e(), w = m(() => l(S ? void 0 : v?.scopes), [S, v?.scopes]), T = !(!y || v || x) || b && !v || S, E = !!x && (!v || S), [D, O] = h("none"), [k, A] = h(), [j, M] = h(!1), N = s({ enabled: w.canRead }), P = f({
23
+ unitNamesById: N.unitNamesById,
24
+ enabled: w.canRead
25
+ }), F = d({
26
+ selectedProductId: k,
27
+ unitNamesById: N.unitNamesById,
28
+ enabled: w.canRead
29
+ }), I = c({
30
+ view: D,
31
+ setView: O,
32
+ selectedProductId: k,
33
+ setSelectedProductId: A,
34
+ product: F.product,
35
+ messages: _
36
+ }), L = u({
37
+ selectedProductId: k,
38
+ setSelectedProductId: A,
39
+ setView: O
40
+ });
41
+ if (!S) {
42
+ let { canRead: e, canCreate: t, canUpdate: n, canDelete: r } = w;
43
+ (!e && (D !== "none" || k) || D === "create" && !t || D === "edit" && !n) && (O("none"), A(void 0)), L.open && !(e && r) && L.cancel(), j && !(e && t) && M(!1);
44
+ }
45
+ let R = p((e) => {
46
+ w.canRead && !o() && (A(e.id), O("details"));
47
+ }, [w.canRead]), z = p(() => {
48
+ w.canCreate && M(!0);
49
+ }, [w.canCreate]), B = p(() => M(!1), []), V = p(() => S ? void 0 : I.submit(), [S, I.submit]), H = p(() => S ? void 0 : L.confirm(), [S, L.confirm]);
50
+ return {
51
+ view: D,
52
+ units: N,
53
+ table: P,
54
+ details: F,
55
+ form: I,
56
+ del: L,
57
+ permissions: w,
58
+ isPermissionLoading: T,
59
+ isTableLoading: P.isLoading || T && P.rows.length === 0,
60
+ hasInitError: E,
61
+ refetchWidgetInit: C,
62
+ measureUnitsOpen: j,
63
+ actionsSuspended: S,
64
+ handleRowClick: R,
65
+ openMeasureUnits: z,
66
+ closeMeasureUnits: B,
67
+ submitForm: V,
68
+ confirmDelete: H
69
+ };
70
+ }
71
+ //#endregion
72
+ export { g as useProductsWidget };
@@ -23,6 +23,8 @@ var e = {
23
23
  errorTitle: "Failed to load products",
24
24
  errorDescription: "Something went wrong while fetching your products. Please try again.",
25
25
  errorRetry: "Try again",
26
+ accessRestrictedTitle: "Access restricted",
27
+ accessRestrictedDescription: "You don't have permission to view products.",
26
28
  openRow: (e) => `View product — ${e}`,
27
29
  typeBadge: {
28
30
  product: "Product",
@@ -4,104 +4,107 @@ import { ErrorState as d } from "../../../shared/ui/dist/lib/ErrorState/ErrorSta
4
4
  import "../../../shared/ui/dist/index.js";
5
5
  import { PRODUCTS_SCREEN_LABELS_EN as f } from "./index2.js";
6
6
  import { ProductTypeBadge as p } from "./index3.js";
7
- import { jsx as m, jsxs as h } from "react/jsx-runtime";
8
- import { ArrowDownIcon as g, ArrowUpDownIcon as _, ArrowUpIcon as v, Plus as y, Search as b } from "lucide-react";
7
+ import { Fragment as m, jsx as h, jsxs as g } from "react/jsx-runtime";
8
+ import { ArrowDownIcon as _, ArrowUpDownIcon as v, ArrowUpIcon as y, Plus as b, Search as x } from "lucide-react";
9
9
  //#region ../../libs/tesouro-embedded-components-react/products-widget/ui/dist/index4.js
10
- var x = [
10
+ var S = [
11
11
  10,
12
12
  25,
13
13
  50,
14
14
  100
15
- ], S = "all";
16
- function C({ labels: e, searchValue: t, onSearchChange: u, typeFilter: d, onTypeFilterChange: f, unitFilter: p, onUnitFilterChange: g, unitOptions: _ }) {
17
- return /* @__PURE__ */ h("div", {
15
+ ], C = "all";
16
+ function w({ labels: e, searchValue: t, onSearchChange: u, typeFilter: d, onTypeFilterChange: f, unitFilter: p, onUnitFilterChange: m, unitOptions: _, headerActions: v }) {
17
+ return /* @__PURE__ */ g("div", {
18
18
  className: "ttw:flex ttw:flex-wrap ttw:items-center ttw:gap-2 ttw:px-4",
19
19
  children: [
20
- /* @__PURE__ */ h(n, {
20
+ /* @__PURE__ */ g(n, {
21
21
  className: "ttw:w-80",
22
- children: [/* @__PURE__ */ m(r, {
22
+ children: [/* @__PURE__ */ h(r, {
23
23
  align: "inline-start",
24
- children: /* @__PURE__ */ m(b, { className: "ttw:size-4" })
25
- }), /* @__PURE__ */ m(i, {
24
+ children: /* @__PURE__ */ h(x, { className: "ttw:size-4" })
25
+ }), /* @__PURE__ */ h(i, {
26
26
  "data-has-start-addon": !0,
27
27
  placeholder: e.searchPlaceholder,
28
28
  value: t,
29
29
  onChange: (e) => u(e.target.value)
30
30
  })]
31
31
  }),
32
- /* @__PURE__ */ h(a, {
32
+ /* @__PURE__ */ g(a, {
33
33
  value: d,
34
34
  onValueChange: f,
35
- children: [/* @__PURE__ */ m(c, {
35
+ children: [/* @__PURE__ */ h(c, {
36
36
  className: "ttw:w-44",
37
- children: /* @__PURE__ */ m(l, {})
38
- }), /* @__PURE__ */ h(o, { children: [
39
- /* @__PURE__ */ m(s, {
40
- value: S,
37
+ children: /* @__PURE__ */ h(l, {})
38
+ }), /* @__PURE__ */ g(o, { children: [
39
+ /* @__PURE__ */ h(s, {
40
+ value: C,
41
41
  children: e.typeFilterAll
42
42
  }),
43
- /* @__PURE__ */ m(s, {
43
+ /* @__PURE__ */ h(s, {
44
44
  value: "product",
45
45
  children: e.typeFilterProduct
46
46
  }),
47
- /* @__PURE__ */ m(s, {
47
+ /* @__PURE__ */ h(s, {
48
48
  value: "service",
49
49
  children: e.typeFilterService
50
50
  })
51
51
  ] })]
52
52
  }),
53
- /* @__PURE__ */ h(a, {
54
- value: p,
55
- onValueChange: g,
56
- children: [/* @__PURE__ */ m(c, {
57
- className: "ttw:w-44",
58
- children: /* @__PURE__ */ m(l, {})
59
- }), /* @__PURE__ */ h(o, { children: [/* @__PURE__ */ m(s, {
60
- value: S,
61
- children: e.unitFilterAll
62
- }), _.map((e) => /* @__PURE__ */ m(s, {
63
- value: e.value,
64
- children: e.label
65
- }, e.value))] })]
53
+ /* @__PURE__ */ g("div", {
54
+ className: "ttw:ml-auto ttw:flex ttw:items-center ttw:gap-2",
55
+ children: [/* @__PURE__ */ g(a, {
56
+ value: p,
57
+ onValueChange: m,
58
+ children: [/* @__PURE__ */ h(c, {
59
+ className: "ttw:w-44",
60
+ children: /* @__PURE__ */ h(l, {})
61
+ }), /* @__PURE__ */ g(o, { children: [/* @__PURE__ */ h(s, {
62
+ value: C,
63
+ children: e.unitFilterAll
64
+ }), _.map((e) => /* @__PURE__ */ h(s, {
65
+ value: e.value,
66
+ children: e.label
67
+ }, e.value))] })]
68
+ }), v]
66
69
  })
67
70
  ]
68
71
  });
69
72
  }
70
- function w({ products: n, isLoading: r, isError: i, sorting: a, onSortingChange: o, pageSize: s, onPageSizeChange: c, pageSizeOptions: l = x, hasNextPage: b, hasPrevPage: S, onNextPage: w, onPrevPage: T, searchValue: E, onSearchChange: D, typeFilter: O, onTypeFilterChange: k, unitFilter: A, onUnitFilterChange: j, unitOptions: M, isFiltering: N, onCreateClick: P, onManageUnitsClick: F, onRowClick: I, onRetry: L, labels: R, emptyStateTestId: z }) {
71
- let B = {
73
+ function T({ products: n, isLoading: r, isError: i, sorting: a, onSortingChange: o, pageSize: s, onPageSizeChange: c, pageSizeOptions: l = S, hasNextPage: x, hasPrevPage: C, onNextPage: T, onPrevPage: E, searchValue: D, onSearchChange: O, typeFilter: k, onTypeFilterChange: A, unitFilter: j, onUnitFilterChange: M, unitOptions: N, isFiltering: P, onCreateClick: F, onManageUnitsClick: I, onRowClick: L, onRetry: R, canCreate: z = !0, canManageUnits: B = !0, isAccessRestricted: V, labels: H, testIds: U }) {
74
+ let W = {
72
75
  ...f,
73
- ...R
74
- }, V = [
76
+ ...H
77
+ }, G = [
75
78
  {
76
79
  accessorKey: "name",
77
80
  enableSorting: !0,
78
81
  header: ({ column: t }) => {
79
82
  let n = t.getIsSorted();
80
- return /* @__PURE__ */ h("div", {
83
+ return /* @__PURE__ */ g("div", {
81
84
  className: "ttw:flex ttw:items-center ttw:gap-2 ttw:text-inherit",
82
- children: [B.columnName, /* @__PURE__ */ m(e, {
85
+ children: [W.columnName, /* @__PURE__ */ h(e, {
83
86
  variant: "ghost",
84
87
  size: "icon-sm",
85
88
  onClick: () => t.toggleSorting(n === "asc"),
86
- children: m(n === "asc" ? v : n === "desc" ? g : _, { className: "ttw:size-4" })
89
+ children: h(n === "asc" ? y : n === "desc" ? _ : v, { className: "ttw:size-4" })
87
90
  })]
88
91
  });
89
92
  }
90
93
  },
91
94
  {
92
95
  accessorKey: "type",
93
- header: B.columnType,
94
- cell: ({ row: e }) => e.original.type ? /* @__PURE__ */ m(p, {
96
+ header: W.columnType,
97
+ cell: ({ row: e }) => e.original.type ? /* @__PURE__ */ h(p, {
95
98
  type: e.original.type,
96
- labels: B.typeBadge
99
+ labels: W.typeBadge
97
100
  }) : null
98
101
  },
99
102
  {
100
103
  accessorKey: "description",
101
- header: B.columnDescription,
102
- cell: ({ row: e }) => /* @__PURE__ */ m("div", {
104
+ header: W.columnDescription,
105
+ cell: ({ row: e }) => /* @__PURE__ */ h("div", {
103
106
  className: "ttw:w-120",
104
- children: /* @__PURE__ */ m("span", {
107
+ children: /* @__PURE__ */ h("span", {
105
108
  className: "ttw:w-full ttw:inline-block ttw:truncate",
106
109
  children: e.original.description
107
110
  })
@@ -109,42 +112,42 @@ function w({ products: n, isLoading: r, isError: i, sorting: a, onSortingChange:
109
112
  },
110
113
  {
111
114
  accessorKey: "priceLabel",
112
- header: () => /* @__PURE__ */ m("div", {
115
+ header: () => /* @__PURE__ */ h("div", {
113
116
  className: "ttw:text-right",
114
- children: B.columnPrice
117
+ children: W.columnPrice
115
118
  }),
116
- cell: ({ row: e }) => /* @__PURE__ */ h("div", {
119
+ cell: ({ row: e }) => /* @__PURE__ */ g("div", {
117
120
  className: "ttw:flex ttw:justify-end ttw:items-center ttw:gap-1",
118
- children: [/* @__PURE__ */ m("span", { children: e.original.priceLabel }), e.original.unitLabel && /* @__PURE__ */ m("span", {
121
+ children: [/* @__PURE__ */ h("span", { children: e.original.priceLabel }), e.original.unitLabel && /* @__PURE__ */ h("span", {
119
122
  className: "ttw:text-muted-foreground ttw:text-xs",
120
123
  children: e.original.unitLabel
121
124
  })]
122
125
  })
123
126
  }
124
- ];
127
+ ], K = /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h(e, {
128
+ variant: "ghost",
129
+ className: "ttw:text-primary ttw:hover:text-primary",
130
+ onClick: I,
131
+ disabled: !B,
132
+ children: W.manageUnitsButton
133
+ }), /* @__PURE__ */ g(e, {
134
+ onClick: F,
135
+ disabled: !z,
136
+ children: [/* @__PURE__ */ h(b, { className: "ttw:size-4" }), W.createButton]
137
+ })] });
125
138
  return /* @__PURE__ */ h("div", {
126
139
  className: "ttw:flex ttw:flex-col ttw:gap-4",
127
- children: [/* @__PURE__ */ m("div", {
128
- className: "ttw:flex ttw:items-center ttw:justify-end",
129
- children: /* @__PURE__ */ h("div", {
130
- className: "ttw:flex ttw:gap-2",
131
- children: [/* @__PURE__ */ m(e, {
132
- variant: "ghost",
133
- className: "ttw:text-primary ttw:hover:text-primary",
134
- onClick: F,
135
- children: B.manageUnitsButton
136
- }), /* @__PURE__ */ h(e, {
137
- onClick: P,
138
- children: [/* @__PURE__ */ m(y, { className: "ttw:size-4" }), B.createButton]
139
- })]
140
- })
141
- }), i ? /* @__PURE__ */ m(d, {
142
- title: B.errorTitle,
143
- description: B.errorDescription,
144
- retryLabel: L ? B.errorRetry : void 0,
145
- onRetry: L
146
- }) : /* @__PURE__ */ m(t, {
147
- columns: V,
140
+ children: V ? /* @__PURE__ */ h(d, {
141
+ testId: U?.accessRestricted,
142
+ title: W.accessRestrictedTitle,
143
+ description: W.accessRestrictedDescription
144
+ }) : i ? /* @__PURE__ */ h(d, {
145
+ title: W.errorTitle,
146
+ description: W.errorDescription,
147
+ retryLabel: R ? W.errorRetry : void 0,
148
+ onRetry: R
149
+ }) : /* @__PURE__ */ h(t, {
150
+ columns: G,
148
151
  data: n,
149
152
  isLoading: r,
150
153
  sorting: a,
@@ -152,31 +155,32 @@ function w({ products: n, isLoading: r, isError: i, sorting: a, onSortingChange:
152
155
  pageSize: s,
153
156
  onPageSizeChange: c,
154
157
  pageSizeOptions: l,
155
- hasNextPage: b,
156
- hasPrevPage: S,
157
- onNextPage: w,
158
- onPrevPage: T,
159
- onRowClick: I,
160
- rowAriaLabel: (e) => B.openRow(e.name),
161
- filterComponent: /* @__PURE__ */ m(C, {
162
- labels: B,
163
- searchValue: E,
164
- onSearchChange: D,
165
- typeFilter: O,
166
- onTypeFilterChange: k,
167
- unitFilter: A,
168
- onUnitFilterChange: j,
169
- unitOptions: M
158
+ hasNextPage: x,
159
+ hasPrevPage: C,
160
+ onNextPage: T,
161
+ onPrevPage: E,
162
+ onRowClick: L,
163
+ rowAriaLabel: (e) => W.openRow(e.name),
164
+ filterComponent: /* @__PURE__ */ h(w, {
165
+ labels: W,
166
+ searchValue: D,
167
+ onSearchChange: O,
168
+ typeFilter: k,
169
+ onTypeFilterChange: A,
170
+ unitFilter: j,
171
+ onUnitFilterChange: M,
172
+ unitOptions: N,
173
+ headerActions: K
170
174
  }),
171
- children: /* @__PURE__ */ m(u, {
172
- testId: z,
173
- title: N ? B.filterEmptyTitle : B.emptyTitle,
174
- description: N ? B.filterEmptyDescription : B.emptyDescription,
175
- actionLabel: N ? void 0 : B.emptyAction,
176
- onAction: N ? void 0 : P
175
+ children: /* @__PURE__ */ h(u, {
176
+ testId: U?.empty,
177
+ title: P ? W.filterEmptyTitle : W.emptyTitle,
178
+ description: P ? W.filterEmptyDescription : W.emptyDescription,
179
+ actionLabel: P || !z ? void 0 : W.emptyAction,
180
+ onAction: P || !z ? void 0 : F
177
181
  })
178
- })]
182
+ })
179
183
  });
180
184
  }
181
185
  //#endregion
182
- export { w as ProductsScreen, w as default };
186
+ export { T as ProductsScreen, T as default };
@@ -22,11 +22,11 @@ function C({ label: e, value: t, isLast: n, emptyValue: r = "—" }) {
22
22
  }) : t]
23
23
  });
24
24
  }
25
- function w({ open: S, onOpenChange: w, product: T, isLoading: E, isError: D, onEdit: O, onDelete: k, labels: A }) {
26
- let j = {
25
+ function w({ open: S, onOpenChange: w, product: T, isLoading: E, isError: D, onEdit: O, onDelete: k, canEdit: A = !0, canDelete: j = !0, labels: M }) {
26
+ let N = {
27
27
  ...h,
28
- ...A
29
- }, M = T?.type !== "service", N = M ? j.typeBadge.product : j.typeBadge.service, P = T ? j.subtitle.replace("{type}", N).replace("{createdAt}", T.createdAtLabel) : j.hiddenDescription;
28
+ ...M
29
+ }, P = T?.type !== "service", F = P ? N.typeBadge.product : N.typeBadge.service, I = T ? N.subtitle.replace("{type}", F).replace("{createdAt}", T.createdAtLabel) : N.hiddenDescription;
30
30
  return /* @__PURE__ */ _(a, {
31
31
  open: S,
32
32
  onOpenChange: w,
@@ -39,18 +39,21 @@ function w({ open: S, onOpenChange: w, product: T, isLoading: E, isError: D, onE
39
39
  className: "ttw:flex ttw:flex-col ttw:gap-1.5 ttw:flex-1 ttw:min-w-0",
40
40
  children: [/* @__PURE__ */ _(u, {
41
41
  className: "ttw:text-2xl",
42
- children: E ? /* @__PURE__ */ _(d, { className: "ttw:h-7 ttw:w-40" }) : T?.name ?? j.loadingTitle
43
- }), /* @__PURE__ */ _(c, { children: E ? /* @__PURE__ */ _(d, { className: "ttw:h-4 ttw:w-60" }) : P })]
42
+ children: E ? /* @__PURE__ */ _(d, { className: "ttw:h-7 ttw:w-40" }) : T?.name ?? N.loadingTitle
43
+ }), /* @__PURE__ */ _(c, {
44
+ asChild: !0,
45
+ children: /* @__PURE__ */ _("div", { children: E ? /* @__PURE__ */ _(d, { className: "ttw:h-4 ttw:w-60" }) : I })
46
+ })]
44
47
  }), /* @__PURE__ */ v("div", {
45
48
  className: "ttw:flex ttw:gap-2 ttw:shrink-0",
46
- children: [/* @__PURE__ */ v(t, { children: [/* @__PURE__ */ _(i, {
49
+ children: [j && /* @__PURE__ */ v(t, { children: [/* @__PURE__ */ _(i, {
47
50
  asChild: !0,
48
51
  children: /* @__PURE__ */ _(e, {
49
52
  type: "button",
50
53
  variant: "outline",
51
- "aria-label": j.moreActionsLabel,
52
- className: "ttw:p-2 ttw:size-9 ttw:border-none ttw:bg-muted",
53
54
  disabled: !T,
55
+ "aria-label": N.moreActionsLabel,
56
+ className: "ttw:p-2 ttw:size-9 ttw:border-none ttw:bg-muted",
54
57
  children: /* @__PURE__ */ _(y, { className: "ttw:size-4" })
55
58
  })
56
59
  }), /* @__PURE__ */ _(n, {
@@ -58,17 +61,17 @@ function w({ open: S, onOpenChange: w, product: T, isLoading: E, isError: D, onE
58
61
  children: /* @__PURE__ */ v(r, {
59
62
  onClick: k,
60
63
  variant: "destructive",
61
- children: [/* @__PURE__ */ _(b, { className: "ttw:size-4" }), j.deleteProductOption.replace("{type}", N)]
64
+ children: [/* @__PURE__ */ _(b, { className: "ttw:size-4" }), N.deleteProductOption.replace("{type}", F)]
62
65
  })
63
66
  })] }), /* @__PURE__ */ _(o, {
64
- "aria-label": j.closeLabel,
67
+ "aria-label": N.closeLabel,
65
68
  className: "ttw:size-9 ttw:bg-muted ttw:p-2 ttw:flex ttw:items-center ttw:justify-center ttw:rounded-md ttw:cursor-pointer",
66
69
  children: /* @__PURE__ */ _(x, { className: "ttw:size-4" })
67
70
  })]
68
71
  })]
69
72
  }), D ? /* @__PURE__ */ _(m, {
70
- title: j.errorTitle,
71
- description: j.errorDescription
73
+ title: N.errorTitle,
74
+ description: N.errorDescription
72
75
  }) : E || !T ? /* @__PURE__ */ _("div", {
73
76
  className: "ttw:flex ttw:w-full ttw:h-full ttw:items-center ttw:justify-center",
74
77
  children: /* @__PURE__ */ _(f, {})
@@ -83,58 +86,58 @@ function w({ open: S, onOpenChange: w, product: T, isLoading: E, isError: D, onE
83
86
  children: [/* @__PURE__ */ _(p, {
84
87
  variant: "body1",
85
88
  className: "ttw:font-medium",
86
- children: j.sectionHeading.replace("{type}", N)
89
+ children: N.sectionHeading.replace("{type}", F)
87
90
  }), /* @__PURE__ */ _(p, {
88
91
  variant: "body2",
89
92
  color: "muted",
90
- children: M ? j.typeProductDescription : j.typeServiceDescription
93
+ children: P ? N.typeProductDescription : N.typeServiceDescription
91
94
  })]
92
- }), /* @__PURE__ */ _(e, {
95
+ }), A && /* @__PURE__ */ _(e, {
93
96
  type: "button",
94
97
  variant: "ghost",
95
98
  className: "ttw:text-primary ttw:hover:text-primary",
96
99
  onClick: O,
97
- children: j.editButton
100
+ children: N.editButton
98
101
  })]
99
102
  }), /* @__PURE__ */ v("ul", {
100
103
  className: "ttw:list-none ttw:p-0 ttw:m-0",
101
104
  children: [
102
105
  /* @__PURE__ */ _(C, {
103
- label: j.rowName.replace("{type}", N),
106
+ label: N.rowName.replace("{type}", F),
104
107
  value: T.name,
105
- emptyValue: j.rowEmptyValue
108
+ emptyValue: N.rowEmptyValue
106
109
  }),
107
110
  /* @__PURE__ */ _(C, {
108
- label: j.rowPrice,
111
+ label: N.rowPrice,
109
112
  value: T.priceLabel,
110
- emptyValue: j.rowEmptyValue
113
+ emptyValue: N.rowEmptyValue
111
114
  }),
112
115
  /* @__PURE__ */ _(C, {
113
- label: j.rowDescription,
116
+ label: N.rowDescription,
114
117
  value: T.description,
115
- emptyValue: j.rowEmptyValue
118
+ emptyValue: N.rowEmptyValue
116
119
  }),
117
120
  /* @__PURE__ */ _(C, {
118
- label: j.rowType,
121
+ label: N.rowType,
119
122
  value: T.type ? /* @__PURE__ */ _(g, {
120
123
  type: T.type,
121
- labels: j.typeBadge
122
- }) : j.rowEmptyValue
124
+ labels: N.typeBadge
125
+ }) : N.rowEmptyValue
123
126
  }),
124
127
  /* @__PURE__ */ _(C, {
125
- label: j.rowUnit,
128
+ label: N.rowUnit,
126
129
  value: T.unitLabel,
127
- emptyValue: j.rowEmptyValue
130
+ emptyValue: N.rowEmptyValue
128
131
  }),
129
132
  /* @__PURE__ */ _(C, {
130
- label: j.rowCreatedOn,
133
+ label: N.rowCreatedOn,
131
134
  value: T.createdAtLabel,
132
- emptyValue: j.rowEmptyValue
135
+ emptyValue: N.rowEmptyValue
133
136
  }),
134
137
  /* @__PURE__ */ _(C, {
135
- label: j.rowLastUpdate,
138
+ label: N.rowLastUpdate,
136
139
  value: T.updatedAtLabel,
137
- emptyValue: j.rowEmptyValue,
140
+ emptyValue: N.rowEmptyValue,
138
141
  isLast: !0
139
142
  })
140
143
  ]
@@ -1,5 +1,5 @@
1
1
  //#region ../../libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js
2
- var e = "@tesouro/embedded-components-react", t = "0.5.203", n = "7cc1039fb78f2b28e512c642c10fad2272d186ff", r = Object.freeze({
2
+ var e = "@tesouro/embedded-components-react", t = "0.5.204", n = "71e96e8a1a9f3efb3d4ee3b3e18ad44635e67bbf", r = Object.freeze({
3
3
  library_name: e,
4
4
  library_version: t,
5
5
  library_sha: n
@@ -9,18 +9,18 @@ import { organizationHeaders as r } from "../../../data-access/dist/lib/organiza
9
9
  import "../../../data-access/dist/index.js";
10
10
  import { useQuery as i } from "@tanstack/react-query";
11
11
  //#region ../../libs/tesouro-embedded-components-react/shared/product-catalog/data-access/dist/index10.js
12
- function a(a) {
13
- let { client: o, organizationId: s, widgetToken: c, authEpoch: l, organizationPending: u } = n(), d = !!(s && c && a), f = e({
12
+ function a(a, { enabled: o = !0 } = {}) {
13
+ let { client: s, organizationId: c, widgetToken: l, authEpoch: u, organizationPending: d } = n(), f = !!(c && l && a) && o, p = e({
14
14
  query: { measure_unit_id: a ?? "" },
15
- client: o,
16
- headers: r(s)
15
+ client: s,
16
+ headers: r(c)
17
17
  });
18
18
  return i({
19
- ...t(f, {
20
- authEpoch: l,
21
- organizationPending: u
19
+ ...t(p, {
20
+ authEpoch: u,
21
+ organizationPending: d
22
22
  }),
23
- enabled: d
23
+ enabled: f
24
24
  });
25
25
  }
26
26
  //#endregion
@@ -9,18 +9,18 @@ import { organizationHeaders as r } from "../../../data-access/dist/lib/organiza
9
9
  import "../../../data-access/dist/index.js";
10
10
  import { useQuery as i } from "@tanstack/react-query";
11
11
  //#region ../../libs/tesouro-embedded-components-react/shared/product-catalog/data-access/dist/index4.js
12
- function a(a) {
13
- let { client: o, organizationId: s, widgetToken: c, authEpoch: l, organizationPending: u } = n(), d = !!(s && c && a), f = e({
14
- client: o,
15
- headers: r(s),
12
+ function a(a, { enabled: o = !0 } = {}) {
13
+ let { client: s, organizationId: c, widgetToken: l, authEpoch: u, organizationPending: d } = n(), f = !!(c && l && a) && o, p = e({
14
+ client: s,
15
+ headers: r(c),
16
16
  path: { product_id: a ?? "" }
17
17
  });
18
18
  return i({
19
- ...t(f, {
20
- authEpoch: l,
21
- organizationPending: u
19
+ ...t(p, {
20
+ authEpoch: u,
21
+ organizationPending: d
22
22
  }),
23
- enabled: d
23
+ enabled: f
24
24
  });
25
25
  }
26
26
  //#endregion
@@ -9,17 +9,17 @@ import { organizationHeaders as r } from "../../../data-access/dist/lib/organiza
9
9
  import "../../../data-access/dist/index.js";
10
10
  import { useQuery as i } from "@tanstack/react-query";
11
11
  //#region ../../libs/tesouro-embedded-components-react/shared/product-catalog/data-access/dist/index9.js
12
- function a() {
13
- let { client: a, organizationId: o, widgetToken: s, authEpoch: c, organizationPending: l } = n(), u = !!(o && s), d = e({
14
- client: a,
15
- headers: r(o)
12
+ function a({ enabled: a = !0 } = {}) {
13
+ let { client: o, organizationId: s, widgetToken: c, authEpoch: l, organizationPending: u } = n(), d = !!(s && c) && a, f = e({
14
+ client: o,
15
+ headers: r(s)
16
16
  });
17
17
  return i({
18
- ...t(d, {
19
- authEpoch: c,
20
- organizationPending: l
18
+ ...t(f, {
19
+ authEpoch: l,
20
+ organizationPending: u
21
21
  }),
22
- enabled: u
22
+ enabled: d
23
23
  });
24
24
  }
25
25
  //#endregion