@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.
- package/dist/index.css +9 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +1 -1
- package/dist/lib/ProductsWidget.d.ts +4 -0
- package/dist/lib/ProductsWidget.js +1 -1
- package/dist/lib/ReceivablesWidget.d.ts +2 -0
- package/dist/libs/tesouro-embedded-components-react/products-widget/feature/dist/index.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/products-widget/feature/dist/index10.js +136 -0
- package/dist/libs/tesouro-embedded-components-react/products-widget/feature/dist/index4.js +5 -30
- package/dist/libs/tesouro-embedded-components-react/products-widget/feature/dist/index5.js +9 -19
- package/dist/libs/tesouro-embedded-components-react/products-widget/feature/dist/index6.js +22 -54
- package/dist/libs/tesouro-embedded-components-react/products-widget/feature/dist/index7.js +14 -40
- package/dist/libs/tesouro-embedded-components-react/products-widget/feature/dist/index8.js +57 -118
- package/dist/libs/tesouro-embedded-components-react/products-widget/feature/dist/index9.js +72 -0
- package/dist/libs/tesouro-embedded-components-react/products-widget/ui/dist/index2.js +2 -0
- package/dist/libs/tesouro-embedded-components-react/products-widget/ui/dist/index4.js +97 -93
- package/dist/libs/tesouro-embedded-components-react/products-widget/ui/dist/index5.js +35 -32
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/data-access/dist/index10.js +8 -8
- package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/data-access/dist/index4.js +8 -8
- package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/data-access/dist/index9.js +8 -8
- package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/feature/dist/lib/MeasureUnitsManagerContainer.js +79 -70
- package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/feature/dist/lib/useMeasureUnits.js +4 -4
- package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/ui/dist/index2.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/ui/dist/index4.js +109 -107
- 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 {
|
|
8
|
-
import { ArrowDownIcon as
|
|
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
|
|
10
|
+
var S = [
|
|
11
11
|
10,
|
|
12
12
|
25,
|
|
13
13
|
50,
|
|
14
14
|
100
|
|
15
|
-
],
|
|
16
|
-
function
|
|
17
|
-
return /* @__PURE__ */
|
|
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__ */
|
|
20
|
+
/* @__PURE__ */ g(n, {
|
|
21
21
|
className: "ttw:w-80",
|
|
22
|
-
children: [/* @__PURE__ */
|
|
22
|
+
children: [/* @__PURE__ */ h(r, {
|
|
23
23
|
align: "inline-start",
|
|
24
|
-
children: /* @__PURE__ */
|
|
25
|
-
}), /* @__PURE__ */
|
|
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__ */
|
|
32
|
+
/* @__PURE__ */ g(a, {
|
|
33
33
|
value: d,
|
|
34
34
|
onValueChange: f,
|
|
35
|
-
children: [/* @__PURE__ */
|
|
35
|
+
children: [/* @__PURE__ */ h(c, {
|
|
36
36
|
className: "ttw:w-44",
|
|
37
|
-
children: /* @__PURE__ */
|
|
38
|
-
}), /* @__PURE__ */
|
|
39
|
-
/* @__PURE__ */
|
|
40
|
-
value:
|
|
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__ */
|
|
43
|
+
/* @__PURE__ */ h(s, {
|
|
44
44
|
value: "product",
|
|
45
45
|
children: e.typeFilterProduct
|
|
46
46
|
}),
|
|
47
|
-
/* @__PURE__ */
|
|
47
|
+
/* @__PURE__ */ h(s, {
|
|
48
48
|
value: "service",
|
|
49
49
|
children: e.typeFilterService
|
|
50
50
|
})
|
|
51
51
|
] })]
|
|
52
52
|
}),
|
|
53
|
-
/* @__PURE__ */
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
children: /* @__PURE__ */
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
children:
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
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
|
|
71
|
-
let
|
|
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
|
-
...
|
|
74
|
-
},
|
|
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__ */
|
|
83
|
+
return /* @__PURE__ */ g("div", {
|
|
81
84
|
className: "ttw:flex ttw:items-center ttw:gap-2 ttw:text-inherit",
|
|
82
|
-
children: [
|
|
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:
|
|
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:
|
|
94
|
-
cell: ({ row: e }) => e.original.type ? /* @__PURE__ */
|
|
96
|
+
header: W.columnType,
|
|
97
|
+
cell: ({ row: e }) => e.original.type ? /* @__PURE__ */ h(p, {
|
|
95
98
|
type: e.original.type,
|
|
96
|
-
labels:
|
|
99
|
+
labels: W.typeBadge
|
|
97
100
|
}) : null
|
|
98
101
|
},
|
|
99
102
|
{
|
|
100
103
|
accessorKey: "description",
|
|
101
|
-
header:
|
|
102
|
-
cell: ({ row: e }) => /* @__PURE__ */
|
|
104
|
+
header: W.columnDescription,
|
|
105
|
+
cell: ({ row: e }) => /* @__PURE__ */ h("div", {
|
|
103
106
|
className: "ttw:w-120",
|
|
104
|
-
children: /* @__PURE__ */
|
|
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__ */
|
|
115
|
+
header: () => /* @__PURE__ */ h("div", {
|
|
113
116
|
className: "ttw:text-right",
|
|
114
|
-
children:
|
|
117
|
+
children: W.columnPrice
|
|
115
118
|
}),
|
|
116
|
-
cell: ({ row: e }) => /* @__PURE__ */
|
|
119
|
+
cell: ({ row: e }) => /* @__PURE__ */ g("div", {
|
|
117
120
|
className: "ttw:flex ttw:justify-end ttw:items-center ttw:gap-1",
|
|
118
|
-
children: [/* @__PURE__ */
|
|
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:
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
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:
|
|
156
|
-
hasPrevPage:
|
|
157
|
-
onNextPage:
|
|
158
|
-
onPrevPage:
|
|
159
|
-
onRowClick:
|
|
160
|
-
rowAriaLabel: (e) =>
|
|
161
|
-
filterComponent: /* @__PURE__ */
|
|
162
|
-
labels:
|
|
163
|
-
searchValue:
|
|
164
|
-
onSearchChange:
|
|
165
|
-
typeFilter:
|
|
166
|
-
onTypeFilterChange:
|
|
167
|
-
unitFilter:
|
|
168
|
-
onUnitFilterChange:
|
|
169
|
-
unitOptions:
|
|
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__ */
|
|
172
|
-
testId:
|
|
173
|
-
title:
|
|
174
|
-
description:
|
|
175
|
-
actionLabel:
|
|
176
|
-
onAction:
|
|
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 {
|
|
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,
|
|
26
|
-
let
|
|
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
|
-
...
|
|
29
|
-
},
|
|
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 ??
|
|
43
|
-
}), /* @__PURE__ */ _(c, {
|
|
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" }),
|
|
64
|
+
children: [/* @__PURE__ */ _(b, { className: "ttw:size-4" }), N.deleteProductOption.replace("{type}", F)]
|
|
62
65
|
})
|
|
63
66
|
})] }), /* @__PURE__ */ _(o, {
|
|
64
|
-
"aria-label":
|
|
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:
|
|
71
|
-
description:
|
|
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:
|
|
89
|
+
children: N.sectionHeading.replace("{type}", F)
|
|
87
90
|
}), /* @__PURE__ */ _(p, {
|
|
88
91
|
variant: "body2",
|
|
89
92
|
color: "muted",
|
|
90
|
-
children:
|
|
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:
|
|
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:
|
|
106
|
+
label: N.rowName.replace("{type}", F),
|
|
104
107
|
value: T.name,
|
|
105
|
-
emptyValue:
|
|
108
|
+
emptyValue: N.rowEmptyValue
|
|
106
109
|
}),
|
|
107
110
|
/* @__PURE__ */ _(C, {
|
|
108
|
-
label:
|
|
111
|
+
label: N.rowPrice,
|
|
109
112
|
value: T.priceLabel,
|
|
110
|
-
emptyValue:
|
|
113
|
+
emptyValue: N.rowEmptyValue
|
|
111
114
|
}),
|
|
112
115
|
/* @__PURE__ */ _(C, {
|
|
113
|
-
label:
|
|
116
|
+
label: N.rowDescription,
|
|
114
117
|
value: T.description,
|
|
115
|
-
emptyValue:
|
|
118
|
+
emptyValue: N.rowEmptyValue
|
|
116
119
|
}),
|
|
117
120
|
/* @__PURE__ */ _(C, {
|
|
118
|
-
label:
|
|
121
|
+
label: N.rowType,
|
|
119
122
|
value: T.type ? /* @__PURE__ */ _(g, {
|
|
120
123
|
type: T.type,
|
|
121
|
-
labels:
|
|
122
|
-
}) :
|
|
124
|
+
labels: N.typeBadge
|
|
125
|
+
}) : N.rowEmptyValue
|
|
123
126
|
}),
|
|
124
127
|
/* @__PURE__ */ _(C, {
|
|
125
|
-
label:
|
|
128
|
+
label: N.rowUnit,
|
|
126
129
|
value: T.unitLabel,
|
|
127
|
-
emptyValue:
|
|
130
|
+
emptyValue: N.rowEmptyValue
|
|
128
131
|
}),
|
|
129
132
|
/* @__PURE__ */ _(C, {
|
|
130
|
-
label:
|
|
133
|
+
label: N.rowCreatedOn,
|
|
131
134
|
value: T.createdAtLabel,
|
|
132
|
-
emptyValue:
|
|
135
|
+
emptyValue: N.rowEmptyValue
|
|
133
136
|
}),
|
|
134
137
|
/* @__PURE__ */ _(C, {
|
|
135
|
-
label:
|
|
138
|
+
label: N.rowLastUpdate,
|
|
136
139
|
value: T.updatedAtLabel,
|
|
137
|
-
emptyValue:
|
|
140
|
+
emptyValue: N.rowEmptyValue,
|
|
138
141
|
isLast: !0
|
|
139
142
|
})
|
|
140
143
|
]
|
package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js
CHANGED
|
@@ -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.
|
|
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:
|
|
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:
|
|
16
|
-
headers: r(
|
|
15
|
+
client: s,
|
|
16
|
+
headers: r(c)
|
|
17
17
|
});
|
|
18
18
|
return i({
|
|
19
|
-
...t(
|
|
20
|
-
authEpoch:
|
|
21
|
-
organizationPending:
|
|
19
|
+
...t(p, {
|
|
20
|
+
authEpoch: u,
|
|
21
|
+
organizationPending: d
|
|
22
22
|
}),
|
|
23
|
-
enabled:
|
|
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:
|
|
14
|
-
client:
|
|
15
|
-
headers: r(
|
|
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(
|
|
20
|
-
authEpoch:
|
|
21
|
-
organizationPending:
|
|
19
|
+
...t(p, {
|
|
20
|
+
authEpoch: u,
|
|
21
|
+
organizationPending: d
|
|
22
22
|
}),
|
|
23
|
-
enabled:
|
|
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:
|
|
14
|
-
client:
|
|
15
|
-
headers: r(
|
|
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(
|
|
19
|
-
authEpoch:
|
|
20
|
-
organizationPending:
|
|
18
|
+
...t(f, {
|
|
19
|
+
authEpoch: l,
|
|
20
|
+
organizationPending: u
|
|
21
21
|
}),
|
|
22
|
-
enabled:
|
|
22
|
+
enabled: d
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
25
|
//#endregion
|