@tesouro/embedded-components-react 0.11.102 → 0.11.105
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.d.ts +5 -1
- package/dist/lib/ProductsWidget.d.ts +5 -1
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/CounterpartsWidget.js +56 -52
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index3.js +68 -63
- package/dist/libs/tesouro-embedded-components-react/products-widget/feature/dist/lib/ProductsWidget/ProductsWidget.js +60 -59
- package/dist/libs/tesouro-embedded-components-react/products-widget/ui/dist/index4.js +79 -78
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -5731,6 +5731,10 @@ interface ProductsWidgetOwnProps {
|
|
|
5731
5731
|
/** Public props for {@link ProductsWidget}. */
|
|
5732
5732
|
type ProductsWidgetProps = WidgetProviderProps & ProductsWidgetOwnProps;
|
|
5733
5733
|
|
|
5734
|
+
/** Kept off the exported {@link ProductsWidgetProps}: only Invoicing's tab row passes the slot. */
|
|
5735
|
+
interface ProductsWidgetInternalProps extends ProductsWidgetProps {
|
|
5736
|
+
headerActionContainer?: HTMLElement | null;
|
|
5737
|
+
}
|
|
5734
5738
|
/**
|
|
5735
5739
|
* Self-contained products/services widget: lists, filters, creates, edits,
|
|
5736
5740
|
* views, and deletes products, and manages measure units. The provider/inner
|
|
@@ -5741,7 +5745,7 @@ type ProductsWidgetProps = WidgetProviderProps & ProductsWidgetOwnProps;
|
|
|
5741
5745
|
* <ProductsWidget baseUrl="https://api.tesouro.com" widgetToken="wt_..." organizationId="org_..." />
|
|
5742
5746
|
* ```
|
|
5743
5747
|
*/
|
|
5744
|
-
declare function ProductsWidget({ baseUrl, widgetToken, organizationId, configClient, gatewayRouting, linkComponent, uiFramework, errorFallback, onError, analytics, disclosuresAcceptance, providerLabels, ...innerProps }:
|
|
5748
|
+
declare function ProductsWidget({ baseUrl, widgetToken, organizationId, configClient, gatewayRouting, linkComponent, uiFramework, errorFallback, onError, analytics, disclosuresAcceptance, providerLabels, ...innerProps }: ProductsWidgetInternalProps): React.JSX.Element;
|
|
5745
5749
|
|
|
5746
5750
|
declare const InvoicesFilterField: {
|
|
5747
5751
|
readonly DueDate: "dueDate";
|
|
@@ -873,6 +873,10 @@ interface ProductsWidgetOwnProps {
|
|
|
873
873
|
/** Public props for {@link ProductsWidget}. */
|
|
874
874
|
type ProductsWidgetProps = WidgetProviderProps & ProductsWidgetOwnProps;
|
|
875
875
|
|
|
876
|
+
/** Kept off the exported {@link ProductsWidgetProps}: only Invoicing's tab row passes the slot. */
|
|
877
|
+
interface ProductsWidgetInternalProps extends ProductsWidgetProps {
|
|
878
|
+
headerActionContainer?: HTMLElement | null;
|
|
879
|
+
}
|
|
876
880
|
/**
|
|
877
881
|
* Self-contained products/services widget: lists, filters, creates, edits,
|
|
878
882
|
* views, and deletes products, and manages measure units. The provider/inner
|
|
@@ -883,7 +887,7 @@ type ProductsWidgetProps = WidgetProviderProps & ProductsWidgetOwnProps;
|
|
|
883
887
|
* <ProductsWidget baseUrl="https://api.tesouro.com" widgetToken="wt_..." organizationId="org_..." />
|
|
884
888
|
* ```
|
|
885
889
|
*/
|
|
886
|
-
declare function ProductsWidget({ baseUrl, widgetToken, organizationId, configClient, gatewayRouting, linkComponent, uiFramework, errorFallback, onError, analytics, disclosuresAcceptance, providerLabels, ...innerProps }:
|
|
890
|
+
declare function ProductsWidget({ baseUrl, widgetToken, organizationId, configClient, gatewayRouting, linkComponent, uiFramework, errorFallback, onError, analytics, disclosuresAcceptance, providerLabels, ...innerProps }: ProductsWidgetInternalProps): React.JSX.Element;
|
|
887
891
|
|
|
888
892
|
export { ProductsWidget };
|
|
889
893
|
export type { MeasureUnitDeleteDialogLabels, MeasureUnitsManagerLabels, ProductDeleteDialogLabels, ProductDetailsSheetLabels, ProductFormSheetLabels, ProductMessageLabels, ProductsScreenLabels, ProductsWidgetProps };
|
|
@@ -19,95 +19,96 @@ import { useCounterpartsWidget as u } from "./useCounterpartsWidget.js";
|
|
|
19
19
|
import { useEffect as d } from "react";
|
|
20
20
|
import { Fragment as f, jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
21
21
|
// ../../libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/CounterpartsWidget.js
|
|
22
|
-
function h({ counterpartType: n, pageSizeOptions: o = l, onViewAllDocuments: h, onCreateDocument: g, screenLabels: _, formLabels: v, detailsLabels: y, bankAccountLabels: b, deleteLabels: x, messageLabels: S }) {
|
|
23
|
-
let
|
|
22
|
+
function h({ counterpartType: n, pageSizeOptions: o = l, onViewAllDocuments: h, onCreateDocument: g, screenLabels: _, formLabels: v, detailsLabels: y, bankAccountLabels: b, deleteLabels: x, messageLabels: S, headerActionContainer: C }) {
|
|
23
|
+
let w = t();
|
|
24
24
|
d(() => {
|
|
25
|
-
|
|
26
|
-
}, [
|
|
27
|
-
let { stateOptions:
|
|
25
|
+
w(a.Mounted);
|
|
26
|
+
}, [w]);
|
|
27
|
+
let { stateOptions: T, selectedId: E, view: D, table: O, listError: k, details: A, detailsSheetView: j, permissions: M, isPermissionLoading: N, actions: P, handleRowClick: F, closeDetails: I } = u({
|
|
28
28
|
counterpartType: n,
|
|
29
29
|
pageSizeOptions: o,
|
|
30
30
|
detailsLabels: y,
|
|
31
31
|
messageLabels: S,
|
|
32
32
|
screenLabels: _
|
|
33
|
-
}), { form:
|
|
33
|
+
}), { form: L } = P;
|
|
34
34
|
return /* @__PURE__ */ m(f, { children: [
|
|
35
35
|
/* @__PURE__ */ p(e, {}),
|
|
36
36
|
/* @__PURE__ */ p(s, {
|
|
37
37
|
mode: n,
|
|
38
|
-
counterparts:
|
|
39
|
-
isLoading:
|
|
40
|
-
isError:
|
|
41
|
-
errorTitle:
|
|
42
|
-
errorDescription:
|
|
43
|
-
sorting:
|
|
44
|
-
onSortingChange:
|
|
45
|
-
pageSize:
|
|
46
|
-
onPageSizeChange:
|
|
38
|
+
counterparts: O.rows,
|
|
39
|
+
isLoading: N || O.isLoading,
|
|
40
|
+
isError: O.isError,
|
|
41
|
+
errorTitle: k.title,
|
|
42
|
+
errorDescription: k.description,
|
|
43
|
+
sorting: O.sorting,
|
|
44
|
+
onSortingChange: O.onSortingChange,
|
|
45
|
+
pageSize: O.pageSize,
|
|
46
|
+
onPageSizeChange: O.onPageSizeChange,
|
|
47
47
|
pageSizeOptions: o,
|
|
48
|
-
hasNextPage:
|
|
49
|
-
hasPrevPage:
|
|
50
|
-
onNextPage:
|
|
51
|
-
onPrevPage:
|
|
52
|
-
filters:
|
|
53
|
-
isFiltering:
|
|
54
|
-
isAmountsError:
|
|
55
|
-
onRetryAmounts:
|
|
56
|
-
canCreate:
|
|
57
|
-
isAccessRestricted: !
|
|
58
|
-
onCreateClick:
|
|
59
|
-
onRowClick:
|
|
60
|
-
onRetry:
|
|
48
|
+
hasNextPage: O.hasNextPage,
|
|
49
|
+
hasPrevPage: O.hasPrevPage,
|
|
50
|
+
onNextPage: O.onNextPage,
|
|
51
|
+
onPrevPage: O.onPrevPage,
|
|
52
|
+
filters: O.filters,
|
|
53
|
+
isFiltering: O.isFiltering,
|
|
54
|
+
isAmountsError: O.isAmountsError,
|
|
55
|
+
onRetryAmounts: O.onRetryAmounts,
|
|
56
|
+
canCreate: M.canCreate,
|
|
57
|
+
isAccessRestricted: !N && !M.canRead,
|
|
58
|
+
onCreateClick: M.canCreate ? L.openCreate : () => void 0,
|
|
59
|
+
onRowClick: F,
|
|
60
|
+
onRetry: O.onRetry,
|
|
61
|
+
headerActionContainer: C,
|
|
61
62
|
labels: _,
|
|
62
63
|
emptyStateTestId: "counterparts-widget-empty-state",
|
|
63
64
|
accessRestrictedTestId: "counterparts-widget-access-restricted"
|
|
64
65
|
}),
|
|
65
66
|
/* @__PURE__ */ p(r, {
|
|
66
|
-
open:
|
|
67
|
+
open: D === "create",
|
|
67
68
|
onOpenChange: (e) => {
|
|
68
|
-
e ||
|
|
69
|
+
e || L.close();
|
|
69
70
|
},
|
|
70
71
|
mode: "create",
|
|
71
72
|
counterpartMode: n,
|
|
72
|
-
values:
|
|
73
|
-
errors:
|
|
74
|
-
stateOptions:
|
|
75
|
-
taxIdField: i(
|
|
76
|
-
inProgress:
|
|
77
|
-
onChange: (e) =>
|
|
73
|
+
values: L.values,
|
|
74
|
+
errors: L.errors,
|
|
75
|
+
stateOptions: T,
|
|
76
|
+
taxIdField: i(L.values.entityType, n, v),
|
|
77
|
+
inProgress: L.isSubmitting,
|
|
78
|
+
onChange: (e) => L.setValues((t) => ({
|
|
78
79
|
...t,
|
|
79
80
|
...e
|
|
80
81
|
})),
|
|
81
|
-
onAddressChange: (e) =>
|
|
82
|
+
onAddressChange: (e) => L.setValues((t) => ({
|
|
82
83
|
...t,
|
|
83
84
|
address: {
|
|
84
85
|
...t.address,
|
|
85
86
|
...e
|
|
86
87
|
}
|
|
87
88
|
})),
|
|
88
|
-
onBankAccountChange: (e) =>
|
|
89
|
+
onBankAccountChange: (e) => L.setValues((t) => ({
|
|
89
90
|
...t,
|
|
90
91
|
bankAccount: {
|
|
91
92
|
...t.bankAccount,
|
|
92
93
|
...e
|
|
93
94
|
}
|
|
94
95
|
})),
|
|
95
|
-
onSubmit:
|
|
96
|
-
onCancel:
|
|
96
|
+
onSubmit: L.submit,
|
|
97
|
+
onCancel: L.close,
|
|
97
98
|
labels: v
|
|
98
99
|
}),
|
|
99
100
|
/* @__PURE__ */ p(c, {
|
|
100
101
|
counterpartType: n,
|
|
101
|
-
open:
|
|
102
|
-
selectedId:
|
|
103
|
-
view:
|
|
104
|
-
details:
|
|
105
|
-
detailsSheetView:
|
|
106
|
-
actions:
|
|
107
|
-
stateOptions:
|
|
108
|
-
canEdit:
|
|
109
|
-
canDelete:
|
|
110
|
-
onClose:
|
|
102
|
+
open: E !== void 0 && D !== "create",
|
|
103
|
+
selectedId: E,
|
|
104
|
+
view: D,
|
|
105
|
+
details: A,
|
|
106
|
+
detailsSheetView: j,
|
|
107
|
+
actions: P,
|
|
108
|
+
stateOptions: T,
|
|
109
|
+
canEdit: M.canUpdate,
|
|
110
|
+
canDelete: M.canDelete,
|
|
111
|
+
onClose: I,
|
|
111
112
|
onViewAllDocuments: h,
|
|
112
113
|
onCreateDocument: g,
|
|
113
114
|
formLabels: v,
|
|
@@ -117,7 +118,7 @@ function h({ counterpartType: n, pageSizeOptions: o = l, onViewAllDocuments: h,
|
|
|
117
118
|
})
|
|
118
119
|
] });
|
|
119
120
|
}
|
|
120
|
-
function g({ baseUrl: e, widgetToken: t, organizationId: r, configClient: i, gatewayRouting: a, linkComponent: s, uiFramework: c, errorFallback: l, onError: u, analytics: d, disclosuresAcceptance: f, providerLabels: m, passThrough: g,
|
|
121
|
+
function g({ baseUrl: e, widgetToken: t, organizationId: r, configClient: i, gatewayRouting: a, linkComponent: s, uiFramework: c, errorFallback: l, onError: u, analytics: d, disclosuresAcceptance: f, providerLabels: m, passThrough: g, headerActionContainer: _, ...v }) {
|
|
121
122
|
return /* @__PURE__ */ p(n, {
|
|
122
123
|
widgetName: g === !0 && e === void 0 && t === void 0 ? void 0 : o,
|
|
123
124
|
baseUrl: e,
|
|
@@ -132,7 +133,10 @@ function g({ baseUrl: e, widgetToken: t, organizationId: r, configClient: i, gat
|
|
|
132
133
|
analytics: d,
|
|
133
134
|
disclosuresAcceptance: f,
|
|
134
135
|
providerLabels: m,
|
|
135
|
-
children: /* @__PURE__ */ p(h, {
|
|
136
|
+
children: /* @__PURE__ */ p(h, {
|
|
137
|
+
...v,
|
|
138
|
+
headerActionContainer: _
|
|
139
|
+
}, v.counterpartType)
|
|
136
140
|
});
|
|
137
141
|
}
|
|
138
142
|
export { g as CounterpartsWidget, g as default };
|
|
@@ -4,6 +4,7 @@ import { ErrorState as h } from "../../../shared/ui/dist/lib/ErrorState/ErrorSta
|
|
|
4
4
|
import { NoAccessState as g } from "../../../shared/ui/dist/lib/StatePanel/NoAccessState.js";
|
|
5
5
|
import "../../../shared/ui/dist/index.js";
|
|
6
6
|
import { COUNTERPARTS_SCREEN_LABELS_EN as _ } from "./index2.js";
|
|
7
|
+
import { createPortal as ee } from "react-dom";
|
|
7
8
|
import { Fragment as v, jsx as y, jsxs as b } from "react/jsx-runtime";
|
|
8
9
|
import { TriangleAlertIcon as x } from "lucide-react";
|
|
9
10
|
// ../../libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index3.js
|
|
@@ -13,7 +14,7 @@ var S = [
|
|
|
13
14
|
50,
|
|
14
15
|
100
|
|
15
16
|
], C = "all";
|
|
16
|
-
function
|
|
17
|
+
function te({ labels: e, filters: t, disabled: r, action: i }) {
|
|
17
18
|
return /* @__PURE__ */ y(p, {
|
|
18
19
|
className: "ttw:px-4",
|
|
19
20
|
search: /* @__PURE__ */ y(o, {
|
|
@@ -53,13 +54,13 @@ function w({ labels: e, filters: t, disabled: r, action: i }) {
|
|
|
53
54
|
})] }) : void 0
|
|
54
55
|
});
|
|
55
56
|
}
|
|
56
|
-
function
|
|
57
|
+
function w({ value: e, isLoading: t }) {
|
|
57
58
|
return /* @__PURE__ */ y("div", {
|
|
58
59
|
className: "ttw:flex ttw:justify-end ttw:tabular-nums",
|
|
59
60
|
children: t ? /* @__PURE__ */ y(f, { className: "ttw:h-4 ttw:w-20" }) : e
|
|
60
61
|
});
|
|
61
62
|
}
|
|
62
|
-
function
|
|
63
|
+
function T({ labels: r, onRetry: i }) {
|
|
63
64
|
return /* @__PURE__ */ b(e, {
|
|
64
65
|
variant: "warning",
|
|
65
66
|
children: [/* @__PURE__ */ y(x, {}), /* @__PURE__ */ y(t, { children: /* @__PURE__ */ b("div", {
|
|
@@ -74,17 +75,17 @@ function E({ labels: r, onRetry: i }) {
|
|
|
74
75
|
}) })]
|
|
75
76
|
});
|
|
76
77
|
}
|
|
77
|
-
function
|
|
78
|
-
let
|
|
78
|
+
function E({ mode: e, counterparts: t, isLoading: a, isError: o, errorTitle: s, errorDescription: c, sorting: l, onSortingChange: u, pageSize: d, onPageSizeChange: f, pageSizeOptions: p = S, hasNextPage: v, hasPrevPage: x, onNextPage: C, onPrevPage: E, filters: D, isFiltering: O, isAmountsError: k, onRetryAmounts: A, canCreate: j = !0, isAccessRestricted: M, onCreateClick: N, onRowClick: ne, onRetry: P, headerActionContainer: F, labels: I, emptyStateTestId: L, accessRestrictedTestId: R }) {
|
|
79
|
+
let z = {
|
|
79
80
|
..._,
|
|
80
|
-
...
|
|
81
|
-
},
|
|
81
|
+
...I
|
|
82
|
+
}, B = e === "customer", V = B ? z.columnInvoicedAmount : z.columnBilledAmount, H = B ? z.columnReceivedAmount : z.columnTotalPaidToDate, U = B ? z.columnAmountDue : z.columnBalanceDue, W = [
|
|
82
83
|
{
|
|
83
84
|
accessorKey: "name",
|
|
84
85
|
enableSorting: !0,
|
|
85
86
|
header: ({ column: e }) => /* @__PURE__ */ y(i, {
|
|
86
87
|
column: e,
|
|
87
|
-
title:
|
|
88
|
+
title: z.columnName
|
|
88
89
|
}),
|
|
89
90
|
cell: ({ row: e }) => /* @__PURE__ */ b("div", {
|
|
90
91
|
className: "ttw:flex ttw:flex-col ttw:gap-1",
|
|
@@ -101,9 +102,9 @@ function D({ mode: e, counterparts: t, isLoading: a, isError: o, errorTitle: s,
|
|
|
101
102
|
accessorKey: "billedAmountLabel",
|
|
102
103
|
header: () => /* @__PURE__ */ y("div", {
|
|
103
104
|
className: "ttw:text-right",
|
|
104
|
-
children:
|
|
105
|
+
children: V
|
|
105
106
|
}),
|
|
106
|
-
cell: ({ row: e }) => /* @__PURE__ */ y(
|
|
107
|
+
cell: ({ row: e }) => /* @__PURE__ */ y(w, {
|
|
107
108
|
value: e.original.billedAmountLabel,
|
|
108
109
|
isLoading: e.original.isBilledAmountLoading
|
|
109
110
|
})
|
|
@@ -112,9 +113,9 @@ function D({ mode: e, counterparts: t, isLoading: a, isError: o, errorTitle: s,
|
|
|
112
113
|
accessorKey: "receivedOrPaidAmountLabel",
|
|
113
114
|
header: () => /* @__PURE__ */ y("div", {
|
|
114
115
|
className: "ttw:text-right",
|
|
115
|
-
children:
|
|
116
|
+
children: H
|
|
116
117
|
}),
|
|
117
|
-
cell: ({ row: e }) => /* @__PURE__ */ y(
|
|
118
|
+
cell: ({ row: e }) => /* @__PURE__ */ y(w, {
|
|
118
119
|
value: e.original.receivedOrPaidAmountLabel,
|
|
119
120
|
isLoading: e.original.isReceivedOrPaidAmountLoading
|
|
120
121
|
})
|
|
@@ -123,14 +124,14 @@ function D({ mode: e, counterparts: t, isLoading: a, isError: o, errorTitle: s,
|
|
|
123
124
|
accessorKey: "dueOrOwedAmountLabel",
|
|
124
125
|
header: () => /* @__PURE__ */ y("div", {
|
|
125
126
|
className: "ttw:text-right",
|
|
126
|
-
children:
|
|
127
|
+
children: U
|
|
127
128
|
}),
|
|
128
|
-
cell: ({ row: e }) => /* @__PURE__ */ y(
|
|
129
|
+
cell: ({ row: e }) => /* @__PURE__ */ y(w, {
|
|
129
130
|
value: e.original.dueOrOwedAmountLabel,
|
|
130
131
|
isLoading: e.original.isDueOrOwedAmountLoading
|
|
131
132
|
})
|
|
132
133
|
}
|
|
133
|
-
],
|
|
134
|
+
], G = (e) => /* @__PURE__ */ b("div", {
|
|
134
135
|
className: "ttw:flex ttw:flex-col ttw:gap-2",
|
|
135
136
|
children: [/* @__PURE__ */ b("div", {
|
|
136
137
|
className: "ttw:flex ttw:flex-col ttw:gap-1",
|
|
@@ -143,17 +144,17 @@ function D({ mode: e, counterparts: t, isLoading: a, isError: o, errorTitle: s,
|
|
|
143
144
|
})]
|
|
144
145
|
}), [
|
|
145
146
|
{
|
|
146
|
-
label:
|
|
147
|
+
label: V,
|
|
147
148
|
value: e.billedAmountLabel,
|
|
148
149
|
isLoading: e.isBilledAmountLoading
|
|
149
150
|
},
|
|
150
151
|
{
|
|
151
|
-
label:
|
|
152
|
+
label: H,
|
|
152
153
|
value: e.receivedOrPaidAmountLabel,
|
|
153
154
|
isLoading: e.isReceivedOrPaidAmountLoading
|
|
154
155
|
},
|
|
155
156
|
{
|
|
156
|
-
label:
|
|
157
|
+
label: U,
|
|
157
158
|
value: e.dueOrOwedAmountLabel,
|
|
158
159
|
isLoading: e.isDueOrOwedAmountLoading
|
|
159
160
|
}
|
|
@@ -162,60 +163,64 @@ function D({ mode: e, counterparts: t, isLoading: a, isError: o, errorTitle: s,
|
|
|
162
163
|
children: [/* @__PURE__ */ y("span", {
|
|
163
164
|
className: "ttw:text-muted-foreground",
|
|
164
165
|
children: e.label
|
|
165
|
-
}), /* @__PURE__ */ y(
|
|
166
|
+
}), /* @__PURE__ */ y(w, {
|
|
166
167
|
value: e.value,
|
|
167
168
|
isLoading: e.isLoading
|
|
168
169
|
})]
|
|
169
170
|
}, e.label))]
|
|
170
|
-
}),
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
171
|
+
}), K = B ? z.customersEmptyTitle : z.vendorsEmptyTitle, q = B ? z.customersEmptyDescription : z.vendorsEmptyDescription, J = B ? z.customersEmptyAction : z.vendorsEmptyAction, Y = B ? z.customersFilterEmptyTitle : z.vendorsFilterEmptyTitle, X = !O && !D.searchValue && !t.length && !a, Z = !(!j || M), Q = !(O || !Z), re = !O && !a && !o && !t.length, ie = Z && !re, ae = B ? z.createButton : z.vendorsCreateButton, $ = ie ? /* @__PURE__ */ y(n, {
|
|
172
|
+
onClick: N,
|
|
173
|
+
children: ae
|
|
174
|
+
}) : void 0;
|
|
175
|
+
return M ? /* @__PURE__ */ y(g, {
|
|
176
|
+
testId: R,
|
|
177
|
+
title: z.accessRestrictedTitle,
|
|
178
|
+
description: z.accessRestrictedDescription
|
|
175
179
|
}) : o ? /* @__PURE__ */ y(h, {
|
|
176
180
|
title: s,
|
|
177
181
|
description: c,
|
|
178
|
-
retryLabel:
|
|
179
|
-
onRetry:
|
|
182
|
+
retryLabel: P ? z.errorRetry : void 0,
|
|
183
|
+
onRetry: P
|
|
180
184
|
}) : /* @__PURE__ */ b("div", {
|
|
181
185
|
className: "ttw:flex ttw:flex-col ttw:gap-4",
|
|
182
|
-
children: [
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
columns: G,
|
|
187
|
-
data: t,
|
|
188
|
-
isLoading: a,
|
|
189
|
-
sorting: l,
|
|
190
|
-
onSortingChange: u,
|
|
191
|
-
pageSize: d,
|
|
192
|
-
onPageSizeChange: f,
|
|
193
|
-
pageSizeOptions: p,
|
|
194
|
-
hasNextPage: v,
|
|
195
|
-
hasPrevPage: x,
|
|
196
|
-
onNextPage: C,
|
|
197
|
-
onPrevPage: D,
|
|
198
|
-
showPagination: !!(a || t.length > 0 || x),
|
|
199
|
-
onRowClick: F,
|
|
200
|
-
rowAriaLabel: (e) => B.openRow(e.name),
|
|
201
|
-
renderCard: K,
|
|
202
|
-
filterComponent: /* @__PURE__ */ y(w, {
|
|
203
|
-
labels: B,
|
|
204
|
-
filters: O,
|
|
205
|
-
disabled: Z,
|
|
206
|
-
action: te ? /* @__PURE__ */ y(n, {
|
|
207
|
-
onClick: P,
|
|
208
|
-
children: ne
|
|
209
|
-
}) : void 0
|
|
186
|
+
children: [
|
|
187
|
+
k && /* @__PURE__ */ y(T, {
|
|
188
|
+
labels: z,
|
|
189
|
+
onRetry: A
|
|
210
190
|
}),
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
191
|
+
/* @__PURE__ */ y(r, {
|
|
192
|
+
columns: W,
|
|
193
|
+
data: t,
|
|
194
|
+
isLoading: a,
|
|
195
|
+
sorting: l,
|
|
196
|
+
onSortingChange: u,
|
|
197
|
+
pageSize: d,
|
|
198
|
+
onPageSizeChange: f,
|
|
199
|
+
pageSizeOptions: p,
|
|
200
|
+
hasNextPage: v,
|
|
201
|
+
hasPrevPage: x,
|
|
202
|
+
onNextPage: C,
|
|
203
|
+
onPrevPage: E,
|
|
204
|
+
showPagination: !!(a || t.length > 0 || x),
|
|
205
|
+
onRowClick: ne,
|
|
206
|
+
rowAriaLabel: (e) => z.openRow(e.name),
|
|
207
|
+
renderCard: G,
|
|
208
|
+
filterComponent: /* @__PURE__ */ y(te, {
|
|
209
|
+
labels: z,
|
|
210
|
+
filters: D,
|
|
211
|
+
disabled: X,
|
|
212
|
+
action: F === void 0 ? $ : void 0
|
|
213
|
+
}),
|
|
214
|
+
children: /* @__PURE__ */ y(m, {
|
|
215
|
+
testId: L,
|
|
216
|
+
title: O ? Y : K,
|
|
217
|
+
description: O ? z.filterEmptyDescription : q,
|
|
218
|
+
actionLabel: O ? z.filterEmptyAction : Q ? J : void 0,
|
|
219
|
+
onAction: O ? D.onClearAll : Q ? N : void 0
|
|
220
|
+
})
|
|
221
|
+
}),
|
|
222
|
+
F && $ && ee($, F)
|
|
223
|
+
]
|
|
219
224
|
});
|
|
220
225
|
}
|
|
221
|
-
export {
|
|
226
|
+
export { E as CounterpartsScreen, E as default };
|
|
@@ -22,12 +22,12 @@ import { useProductsWidget as p } from "./useProductsWidget.js";
|
|
|
22
22
|
import { useEffect as m } from "react";
|
|
23
23
|
import { Fragment as h, jsx as g, jsxs as _ } from "react/jsx-runtime";
|
|
24
24
|
// ../../libs/tesouro-embedded-components-react/products-widget/feature/dist/lib/ProductsWidget/ProductsWidget.js
|
|
25
|
-
function v({ pageSizeOptions: n = c, screenLabels: s, formLabels: v, detailsLabels: y, deleteLabels: b, measureUnitsLabels: x, measureUnitDeleteLabels: S, messageLabels: C }) {
|
|
26
|
-
let
|
|
25
|
+
function v({ pageSizeOptions: n = c, screenLabels: s, formLabels: v, detailsLabels: y, deleteLabels: b, measureUnitsLabels: x, measureUnitDeleteLabels: S, messageLabels: C, headerActionContainer: w }) {
|
|
26
|
+
let T = t();
|
|
27
27
|
m(() => {
|
|
28
|
-
|
|
29
|
-
}, [
|
|
30
|
-
let { view:
|
|
28
|
+
T(o.Mounted);
|
|
29
|
+
}, [T]);
|
|
30
|
+
let { view: E, units: D, table: O, details: k, form: A, del: j, permissions: M, isPermissionLoading: N, isTableLoading: P, hasInitError: F, refetchWidgetInit: I, measureUnitsOpen: L, actionsSuspended: R, editForm: z, handleRowClick: B, openMeasureUnits: V, closeMeasureUnits: H, addUnitOpen: U, openAddUnit: W, closeAddUnit: G, selectAddedUnit: K, submitForm: q, confirmDelete: J } = p({
|
|
31
31
|
messageLabels: C,
|
|
32
32
|
screenLabels: s,
|
|
33
33
|
formLabels: v
|
|
@@ -35,27 +35,28 @@ function v({ pageSizeOptions: n = c, screenLabels: s, formLabels: v, detailsLabe
|
|
|
35
35
|
return /* @__PURE__ */ _(h, { children: [
|
|
36
36
|
/* @__PURE__ */ g(e, {}),
|
|
37
37
|
/* @__PURE__ */ g(u, {
|
|
38
|
-
products:
|
|
39
|
-
isLoading:
|
|
40
|
-
isError:
|
|
41
|
-
sorting:
|
|
42
|
-
onSortingChange:
|
|
43
|
-
pageSize:
|
|
44
|
-
onPageSizeChange:
|
|
38
|
+
products: O.rows,
|
|
39
|
+
isLoading: P,
|
|
40
|
+
isError: F || O.isError,
|
|
41
|
+
sorting: O.sorting,
|
|
42
|
+
onSortingChange: O.onSortingChange,
|
|
43
|
+
pageSize: O.pageSize,
|
|
44
|
+
onPageSizeChange: O.onPageSizeChange,
|
|
45
45
|
pageSizeOptions: n,
|
|
46
|
-
hasNextPage:
|
|
47
|
-
hasPrevPage:
|
|
48
|
-
onNextPage:
|
|
49
|
-
onPrevPage:
|
|
50
|
-
filters:
|
|
51
|
-
isFiltering:
|
|
52
|
-
canCreate:
|
|
53
|
-
canManageUnits:
|
|
54
|
-
isAccessRestricted: !
|
|
55
|
-
onCreateClick:
|
|
56
|
-
onManageUnitsClick:
|
|
57
|
-
onRowClick:
|
|
58
|
-
onRetry:
|
|
46
|
+
hasNextPage: O.hasNextPage,
|
|
47
|
+
hasPrevPage: O.hasPrevPage,
|
|
48
|
+
onNextPage: O.onNextPage,
|
|
49
|
+
onPrevPage: O.onPrevPage,
|
|
50
|
+
filters: O.filters,
|
|
51
|
+
isFiltering: O.isFiltering,
|
|
52
|
+
canCreate: M.canCreate,
|
|
53
|
+
canManageUnits: M.canCreate,
|
|
54
|
+
isAccessRestricted: !N && !F && !M.canRead,
|
|
55
|
+
onCreateClick: A.openCreate,
|
|
56
|
+
onManageUnitsClick: V,
|
|
57
|
+
onRowClick: B,
|
|
58
|
+
onRetry: F ? I : O.onRetry,
|
|
59
|
+
headerActionContainer: w,
|
|
59
60
|
labels: s,
|
|
60
61
|
testIds: {
|
|
61
62
|
empty: l.empty,
|
|
@@ -63,57 +64,57 @@ function v({ pageSizeOptions: n = c, screenLabels: s, formLabels: v, detailsLabe
|
|
|
63
64
|
}
|
|
64
65
|
}),
|
|
65
66
|
/* @__PURE__ */ g(r, {
|
|
66
|
-
open:
|
|
67
|
+
open: E === "create",
|
|
67
68
|
onOpenChange: (e) => {
|
|
68
|
-
e ||
|
|
69
|
+
e || A.close();
|
|
69
70
|
},
|
|
70
|
-
values:
|
|
71
|
-
errors:
|
|
72
|
-
unitOptions:
|
|
73
|
-
pricePrefix:
|
|
74
|
-
inProgress:
|
|
75
|
-
onChange:
|
|
76
|
-
onSubmit:
|
|
77
|
-
onCancel:
|
|
78
|
-
onAddUnit:
|
|
71
|
+
values: A.values,
|
|
72
|
+
errors: A.errors,
|
|
73
|
+
unitOptions: D.unitOptions,
|
|
74
|
+
pricePrefix: A.pricePrefix,
|
|
75
|
+
inProgress: A.isSubmitting || R,
|
|
76
|
+
onChange: A.change,
|
|
77
|
+
onSubmit: q,
|
|
78
|
+
onCancel: A.close,
|
|
79
|
+
onAddUnit: M.canCreate ? W : void 0,
|
|
79
80
|
labels: v
|
|
80
81
|
}),
|
|
81
82
|
/* @__PURE__ */ g(d, {
|
|
82
|
-
open:
|
|
83
|
+
open: E === "details" || E === "edit",
|
|
83
84
|
onOpenChange: (e) => {
|
|
84
|
-
e ||
|
|
85
|
+
e || A.close();
|
|
85
86
|
},
|
|
86
|
-
product:
|
|
87
|
-
isLoading:
|
|
88
|
-
isError:
|
|
89
|
-
onEdit:
|
|
90
|
-
onDelete:
|
|
91
|
-
canEdit:
|
|
92
|
-
canDelete:
|
|
93
|
-
editForm:
|
|
87
|
+
product: k.detailsView,
|
|
88
|
+
isLoading: k.isLoading,
|
|
89
|
+
isError: k.isError,
|
|
90
|
+
onEdit: A.openEdit,
|
|
91
|
+
onDelete: j.requestDelete,
|
|
92
|
+
canEdit: M.canUpdate,
|
|
93
|
+
canDelete: M.canDelete,
|
|
94
|
+
editForm: z,
|
|
94
95
|
labels: y
|
|
95
96
|
}),
|
|
96
97
|
/* @__PURE__ */ g(f, {
|
|
97
|
-
open:
|
|
98
|
-
onOpenChange:
|
|
99
|
-
productName:
|
|
100
|
-
isDeleting:
|
|
101
|
-
onConfirm:
|
|
102
|
-
onCancel:
|
|
98
|
+
open: j.open,
|
|
99
|
+
onOpenChange: j.onOpenChange,
|
|
100
|
+
productName: k.productName,
|
|
101
|
+
isDeleting: j.isDeleting || R,
|
|
102
|
+
onConfirm: J,
|
|
103
|
+
onCancel: j.cancel,
|
|
103
104
|
labels: b
|
|
104
105
|
}),
|
|
105
106
|
/* @__PURE__ */ g(a, {
|
|
106
|
-
open:
|
|
107
|
-
onClose:
|
|
108
|
-
onCreated:
|
|
109
|
-
suspended:
|
|
107
|
+
open: U,
|
|
108
|
+
onClose: G,
|
|
109
|
+
onCreated: K,
|
|
110
|
+
suspended: R,
|
|
110
111
|
labels: x,
|
|
111
112
|
messageLabels: C
|
|
112
113
|
}),
|
|
113
114
|
/* @__PURE__ */ g(i, {
|
|
114
|
-
open:
|
|
115
|
-
onClose:
|
|
116
|
-
suspended:
|
|
115
|
+
open: L,
|
|
116
|
+
onClose: H,
|
|
117
|
+
suspended: R,
|
|
117
118
|
managerLabels: x,
|
|
118
119
|
deleteLabels: S,
|
|
119
120
|
messageLabels: C
|
|
@@ -5,78 +5,79 @@ import { NoAccessState as h } from "../../../shared/ui/dist/lib/StatePanel/NoAcc
|
|
|
5
5
|
import "../../../shared/ui/dist/index.js";
|
|
6
6
|
import { PRODUCTS_SCREEN_LABELS_EN as g } from "./index2.js";
|
|
7
7
|
import { ProductTypeBadge as _ } from "./index3.js";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
8
|
+
import { createPortal as v } from "react-dom";
|
|
9
|
+
import { Fragment as y, jsx as b, jsxs as x } from "react/jsx-runtime";
|
|
10
|
+
import { ListFilter as S } from "lucide-react";
|
|
10
11
|
// ../../libs/tesouro-embedded-components-react/products-widget/ui/dist/index4.js
|
|
11
|
-
var
|
|
12
|
+
var C = [
|
|
12
13
|
10,
|
|
13
14
|
25,
|
|
14
15
|
50,
|
|
15
16
|
100
|
|
16
|
-
],
|
|
17
|
-
function
|
|
18
|
-
return /* @__PURE__ */
|
|
17
|
+
], w = "ttw:flex ttw:w-full ttw:cursor-pointer ttw:items-center ttw:gap-2 ttw:rounded-md ttw:px-2 ttw:py-1.5 ttw:text-xs ttw:font-medium ttw:transition-colors ttw:hover:bg-accent";
|
|
18
|
+
function T({ labels: e, filters: t, action: n }) {
|
|
19
|
+
return /* @__PURE__ */ b(f, {
|
|
19
20
|
className: "ttw:px-4",
|
|
20
|
-
search: /* @__PURE__ */
|
|
21
|
+
search: /* @__PURE__ */ b(d, {
|
|
21
22
|
value: t.searchValue,
|
|
22
23
|
onChange: (e) => t.onSearchChange(e.target.value),
|
|
23
24
|
placeholder: e.searchPlaceholder,
|
|
24
25
|
"aria-label": e.searchLabel,
|
|
25
26
|
className: "ttw:min-w-64"
|
|
26
27
|
}),
|
|
27
|
-
filterButton: /* @__PURE__ */
|
|
28
|
+
filterButton: /* @__PURE__ */ x(o, {
|
|
28
29
|
open: t.isPopoverOpen,
|
|
29
30
|
onOpenChange: (e) => {
|
|
30
31
|
e || t.onPopoverClose();
|
|
31
32
|
},
|
|
32
|
-
children: [/* @__PURE__ */
|
|
33
|
+
children: [/* @__PURE__ */ b(c, {
|
|
33
34
|
asChild: !0,
|
|
34
|
-
children: /* @__PURE__ */
|
|
35
|
+
children: /* @__PURE__ */ b(r, {
|
|
35
36
|
activeCount: t.activeFilterCount,
|
|
36
37
|
onClick: (e) => {
|
|
37
38
|
t.isPanelOpen && e.preventDefault(), t.onMenuToggle();
|
|
38
39
|
},
|
|
39
40
|
labels: { filters: e.filtersButton }
|
|
40
41
|
})
|
|
41
|
-
}), /* @__PURE__ */
|
|
42
|
+
}), /* @__PURE__ */ x(s, {
|
|
42
43
|
align: "start",
|
|
43
44
|
className: "ttw:w-56 ttw:p-0",
|
|
44
45
|
children: [
|
|
45
|
-
t.isMenuOpen && /* @__PURE__ */
|
|
46
|
+
t.isMenuOpen && /* @__PURE__ */ x("div", {
|
|
46
47
|
className: "ttw:p-1",
|
|
47
|
-
children: [/* @__PURE__ */
|
|
48
|
+
children: [/* @__PURE__ */ x("button", {
|
|
48
49
|
type: "button",
|
|
49
|
-
className:
|
|
50
|
+
className: w,
|
|
50
51
|
onClick: t.onTypeFieldSelect,
|
|
51
|
-
children: [/* @__PURE__ */
|
|
52
|
+
children: [/* @__PURE__ */ b(S, {
|
|
52
53
|
className: "ttw:size-4 ttw:shrink-0 ttw:text-muted-foreground",
|
|
53
54
|
"aria-hidden": !0
|
|
54
55
|
}), e.filterFieldType]
|
|
55
|
-
}), /* @__PURE__ */
|
|
56
|
+
}), /* @__PURE__ */ x("button", {
|
|
56
57
|
type: "button",
|
|
57
|
-
className:
|
|
58
|
+
className: w,
|
|
58
59
|
onClick: t.onUnitFieldSelect,
|
|
59
|
-
children: [/* @__PURE__ */
|
|
60
|
+
children: [/* @__PURE__ */ b(S, {
|
|
60
61
|
className: "ttw:size-4 ttw:shrink-0 ttw:text-muted-foreground",
|
|
61
62
|
"aria-hidden": !0
|
|
62
63
|
}), e.filterFieldUnit]
|
|
63
64
|
})]
|
|
64
65
|
}),
|
|
65
|
-
t.isTypePanelOpen && /* @__PURE__ */
|
|
66
|
+
t.isTypePanelOpen && /* @__PURE__ */ b(a, {
|
|
66
67
|
options: [...t.typeOptions],
|
|
67
68
|
selectedValues: [...t.selectedTypes],
|
|
68
69
|
onSelectionChange: t.onTypeChange
|
|
69
70
|
}),
|
|
70
|
-
t.isUnitPanelOpen && /* @__PURE__ */
|
|
71
|
+
t.isUnitPanelOpen && /* @__PURE__ */ b("div", {
|
|
71
72
|
className: "ttw:max-h-64 ttw:overflow-auto ttw:p-3",
|
|
72
|
-
children: /* @__PURE__ */
|
|
73
|
+
children: /* @__PURE__ */ b(l, {
|
|
73
74
|
value: t.selectedUnit,
|
|
74
75
|
onValueChange: t.onUnitChange,
|
|
75
76
|
"aria-label": e.filterFieldUnit,
|
|
76
77
|
className: "ttw:flex ttw:flex-col ttw:gap-1",
|
|
77
|
-
children: t.unitOptions.map((e) => /* @__PURE__ */
|
|
78
|
+
children: t.unitOptions.map((e) => /* @__PURE__ */ x("label", {
|
|
78
79
|
className: "ttw:flex ttw:cursor-pointer ttw:items-center ttw:gap-2",
|
|
79
|
-
children: [/* @__PURE__ */
|
|
80
|
+
children: [/* @__PURE__ */ b(u, { value: e.value }), /* @__PURE__ */ b("span", {
|
|
80
81
|
className: "ttw:text-xs ttw:font-medium",
|
|
81
82
|
children: e.label
|
|
82
83
|
})]
|
|
@@ -87,12 +88,12 @@ function w({ labels: e, filters: t, action: n }) {
|
|
|
87
88
|
})]
|
|
88
89
|
}),
|
|
89
90
|
action: n,
|
|
90
|
-
tags: /* @__PURE__ */
|
|
91
|
+
tags: /* @__PURE__ */ x(y, { children: [t.chips.map((n) => /* @__PURE__ */ b(i, {
|
|
91
92
|
label: n.label,
|
|
92
93
|
variant: "default",
|
|
93
94
|
labels: { remove: e.filterChipRemove },
|
|
94
95
|
onDismiss: () => t.onRemoveChip(n.key)
|
|
95
|
-
}, n.key)), t.chips.length > 0 && /* @__PURE__ */
|
|
96
|
+
}, n.key)), t.chips.length > 0 && /* @__PURE__ */ b("button", {
|
|
96
97
|
type: "button",
|
|
97
98
|
className: "ttw:cursor-pointer ttw:whitespace-nowrap ttw:text-xs ttw:text-muted-foreground ttw:transition-colors ttw:hover:text-foreground",
|
|
98
99
|
onClick: t.onClearAll,
|
|
@@ -100,24 +101,28 @@ function w({ labels: e, filters: t, action: n }) {
|
|
|
100
101
|
})] })
|
|
101
102
|
});
|
|
102
103
|
}
|
|
103
|
-
function
|
|
104
|
-
let
|
|
104
|
+
function E({ products: r, isLoading: i, isError: a, sorting: o, onSortingChange: s, pageSize: c, onPageSizeChange: l, pageSizeOptions: u = C, hasNextPage: d, hasPrevPage: f, onNextPage: S, onPrevPage: w, filters: E, isFiltering: D, onCreateClick: O, onManageUnitsClick: k, onRowClick: A, onRetry: j, headerActionContainer: M, canCreate: N = !0, canManageUnits: P = !0, isAccessRestricted: F, labels: I, testIds: L }) {
|
|
105
|
+
let R = {
|
|
105
106
|
...g,
|
|
106
|
-
...
|
|
107
|
+
...I,
|
|
107
108
|
typeBadge: {
|
|
108
109
|
...g.typeBadge,
|
|
109
|
-
...
|
|
110
|
+
...I?.typeBadge
|
|
110
111
|
}
|
|
111
|
-
},
|
|
112
|
+
}, z = !D && N, B = !i && r.length === 0 && z ? void 0 : /* @__PURE__ */ b(e, {
|
|
113
|
+
onClick: O,
|
|
114
|
+
disabled: !N,
|
|
115
|
+
children: R.createButton
|
|
116
|
+
}), V = [
|
|
112
117
|
{
|
|
113
118
|
accessorKey: "name",
|
|
114
119
|
enableSorting: !0,
|
|
115
|
-
header: ({ column: e }) => /* @__PURE__ */
|
|
120
|
+
header: ({ column: e }) => /* @__PURE__ */ b(n, {
|
|
116
121
|
column: e,
|
|
117
|
-
title:
|
|
122
|
+
title: R.columnName
|
|
118
123
|
}),
|
|
119
124
|
size: 320,
|
|
120
|
-
cell: ({ row: e }) => /* @__PURE__ */
|
|
125
|
+
cell: ({ row: e }) => /* @__PURE__ */ b("span", {
|
|
121
126
|
className: "ttw:block ttw:w-74 ttw:truncate",
|
|
122
127
|
children: e.original.name
|
|
123
128
|
})
|
|
@@ -125,19 +130,19 @@ function T({ products: r, isLoading: i, isError: a, sorting: o, onSortingChange:
|
|
|
125
130
|
{
|
|
126
131
|
accessorKey: "type",
|
|
127
132
|
size: 112,
|
|
128
|
-
header:
|
|
129
|
-
cell: ({ row: e }) => e.original.type ? /* @__PURE__ */
|
|
133
|
+
header: R.columnType,
|
|
134
|
+
cell: ({ row: e }) => e.original.type ? /* @__PURE__ */ b(_, {
|
|
130
135
|
type: e.original.type,
|
|
131
|
-
labels:
|
|
136
|
+
labels: R.typeBadge
|
|
132
137
|
}) : null
|
|
133
138
|
},
|
|
134
139
|
{
|
|
135
140
|
accessorKey: "description",
|
|
136
|
-
header:
|
|
141
|
+
header: R.columnDescription,
|
|
137
142
|
size: 1e4,
|
|
138
|
-
cell: ({ row: e }) => /* @__PURE__ */
|
|
143
|
+
cell: ({ row: e }) => /* @__PURE__ */ b("div", {
|
|
139
144
|
className: "ttw:relative ttw:h-5 ttw:min-w-40",
|
|
140
|
-
children: /* @__PURE__ */
|
|
145
|
+
children: /* @__PURE__ */ b("span", {
|
|
141
146
|
className: "ttw:absolute ttw:inset-0 ttw:truncate",
|
|
142
147
|
children: e.original.description
|
|
143
148
|
})
|
|
@@ -146,30 +151,30 @@ function T({ products: r, isLoading: i, isError: a, sorting: o, onSortingChange:
|
|
|
146
151
|
{
|
|
147
152
|
accessorKey: "priceLabel",
|
|
148
153
|
size: 180,
|
|
149
|
-
header: () => /* @__PURE__ */
|
|
154
|
+
header: () => /* @__PURE__ */ b("div", {
|
|
150
155
|
className: "ttw:text-right",
|
|
151
|
-
children:
|
|
156
|
+
children: R.columnPrice
|
|
152
157
|
}),
|
|
153
|
-
cell: ({ row: e }) => /* @__PURE__ */
|
|
158
|
+
cell: ({ row: e }) => /* @__PURE__ */ x("div", {
|
|
154
159
|
className: "ttw:flex ttw:w-39 ttw:items-center ttw:justify-end ttw:gap-1 ttw:tabular-nums",
|
|
155
|
-
children: [/* @__PURE__ */
|
|
160
|
+
children: [/* @__PURE__ */ b("span", { children: e.original.priceLabel }), e.original.unitLabel && /* @__PURE__ */ b("span", {
|
|
156
161
|
className: "ttw:text-muted-foreground",
|
|
157
162
|
children: e.original.unitLabel
|
|
158
163
|
})]
|
|
159
164
|
})
|
|
160
165
|
}
|
|
161
166
|
];
|
|
162
|
-
return
|
|
163
|
-
testId:
|
|
164
|
-
title:
|
|
165
|
-
description:
|
|
166
|
-
}) : a ? /* @__PURE__ */
|
|
167
|
-
title:
|
|
168
|
-
description:
|
|
169
|
-
retryLabel:
|
|
170
|
-
onRetry:
|
|
171
|
-
}) : /* @__PURE__ */ y(t, {
|
|
172
|
-
columns:
|
|
167
|
+
return F ? /* @__PURE__ */ b(h, {
|
|
168
|
+
testId: L?.accessRestricted,
|
|
169
|
+
title: R.accessRestrictedTitle,
|
|
170
|
+
description: R.accessRestrictedDescription
|
|
171
|
+
}) : a ? /* @__PURE__ */ b(m, {
|
|
172
|
+
title: R.errorTitle,
|
|
173
|
+
description: R.errorDescription,
|
|
174
|
+
retryLabel: j ? R.errorRetry : void 0,
|
|
175
|
+
onRetry: j
|
|
176
|
+
}) : /* @__PURE__ */ x(y, { children: [/* @__PURE__ */ b(t, {
|
|
177
|
+
columns: V,
|
|
173
178
|
data: r,
|
|
174
179
|
isLoading: i,
|
|
175
180
|
sorting: o,
|
|
@@ -179,31 +184,27 @@ function T({ products: r, isLoading: i, isError: a, sorting: o, onSortingChange:
|
|
|
179
184
|
pageSizeOptions: u,
|
|
180
185
|
hasNextPage: d,
|
|
181
186
|
hasPrevPage: f,
|
|
182
|
-
onNextPage:
|
|
183
|
-
onPrevPage:
|
|
184
|
-
onRowClick:
|
|
185
|
-
rowAriaLabel: (e) =>
|
|
186
|
-
filterComponent: /* @__PURE__ */
|
|
187
|
-
labels:
|
|
188
|
-
filters:
|
|
189
|
-
action: /* @__PURE__ */
|
|
187
|
+
onNextPage: S,
|
|
188
|
+
onPrevPage: w,
|
|
189
|
+
onRowClick: A,
|
|
190
|
+
rowAriaLabel: (e) => R.openRow(e.name),
|
|
191
|
+
filterComponent: /* @__PURE__ */ b(T, {
|
|
192
|
+
labels: R,
|
|
193
|
+
filters: E,
|
|
194
|
+
action: /* @__PURE__ */ x(y, { children: [/* @__PURE__ */ b(e, {
|
|
190
195
|
variant: "outline",
|
|
191
|
-
onClick:
|
|
192
|
-
disabled: !
|
|
193
|
-
children:
|
|
194
|
-
}),
|
|
195
|
-
onClick: D,
|
|
196
|
-
disabled: !j,
|
|
197
|
-
children: I.createButton
|
|
198
|
-
})] })
|
|
196
|
+
onClick: k,
|
|
197
|
+
disabled: !P,
|
|
198
|
+
children: R.manageUnitsButton
|
|
199
|
+
}), M === void 0 && B] })
|
|
199
200
|
}),
|
|
200
|
-
children: /* @__PURE__ */
|
|
201
|
-
testId:
|
|
202
|
-
title:
|
|
203
|
-
description:
|
|
204
|
-
actionLabel:
|
|
205
|
-
onAction:
|
|
201
|
+
children: /* @__PURE__ */ b(p, {
|
|
202
|
+
testId: L?.empty,
|
|
203
|
+
title: D ? R.filterEmptyTitle : R.emptyTitle,
|
|
204
|
+
description: D ? R.filterEmptyDescription : R.emptyDescription,
|
|
205
|
+
actionLabel: z ? R.emptyAction : void 0,
|
|
206
|
+
onAction: z ? O : void 0
|
|
206
207
|
})
|
|
207
|
-
});
|
|
208
|
+
}), M && B && v(B, M)] });
|
|
208
209
|
}
|
|
209
|
-
export {
|
|
210
|
+
export { E as ProductsScreen, E as default };
|
package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// ../../libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js
|
|
2
|
-
var e = "@tesouro/embedded-components-react", t = "0.11.
|
|
2
|
+
var e = "@tesouro/embedded-components-react", t = "0.11.105", n = "20076f918051af1eaa31384fecd8fdbbc3a68b9d", r = Object.freeze({
|
|
3
3
|
library_name: e,
|
|
4
4
|
library_version: t,
|
|
5
5
|
library_sha: n
|