@tesouro/embedded-components-react 0.7.37 → 0.7.41
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/README.md +2 -2
- package/dist/fixtures/index.d.ts +1 -1
- package/dist/index.d.ts +21 -14
- package/dist/lib/CounterpartsWidget.d.ts +16 -14
- package/dist/lib/CounterpartsWidgetPublic.d.ts +16 -14
- package/dist/lib/CustomersWidget.d.ts +16 -14
- package/dist/lib/TransfersWidget.d.ts +5 -0
- package/dist/lib/WidgetSuite.d.ts +5 -0
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/lib/BankAccountOnboardingWidget/fieldInput/formatPhoneNumberInput.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/feature/dist/mocks/bankAccounts.js +5 -5
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/CounterpartsWidget.js +30 -29
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/constants.js +6 -6
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/useCounterpartsTable.js +143 -95
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/useCounterpartsWidget.js +60 -48
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/mocks/labels.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index.js +4 -4
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index2.js +22 -15
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index3.js +137 -135
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/helpers.js +106 -108
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/index.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js +50 -50
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/sdk.gen.js +22 -22
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/transfers-widget/data-access/dist/index.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/transfers-widget/data-access/dist/index3.js +6 -7
- package/dist/libs/tesouro-embedded-components-react/transfers-widget/data-access/dist/index6.js +14 -34
- package/dist/libs/tesouro-embedded-components-react/transfers-widget/data-access/dist/index7.js +16 -13
- package/dist/libs/tesouro-embedded-components-react/transfers-widget/data-access/dist/index8.js +4 -10
- package/dist/libs/tesouro-embedded-components-react/transfers-widget/feature/dist/lib/TransfersWidget/TransfersWidgetInner.js +99 -75
- package/dist/libs/tesouro-embedded-components-react/transfers-widget/feature/dist/lib/TransfersWidget/featureLabels.js +2 -1
- package/dist/libs/tesouro-embedded-components-react/transfers-widget/feature/dist/lib/TransfersWidget/useTransfersPageState.js +49 -0
- package/dist/libs/tesouro-embedded-components-react/transfers-widget/feature/dist/mocks/labels.js +2 -1
- package/dist/libs/tesouro-embedded-components-react/transfers-widget/feature/dist/mocks/transfers.js +103 -85
- package/dist/libs/tesouro-embedded-components-react/transfers-widget/ui/dist/lib/TransfersWidget/TransfersWidget.js +73 -61
- package/dist/libs/tesouro-embedded-components-react/transfers-widget/ui/dist/lib/TransfersWidget/labels.js +3 -0
- package/package.json +1 -1
|
@@ -1,133 +1,136 @@
|
|
|
1
|
-
import { Button as e, DataTable as t,
|
|
2
|
-
import { EmptyState as
|
|
3
|
-
import { ErrorState as
|
|
1
|
+
import { Button as e, DataTable as t, FilterBar as n, FilterMenuButton as r, FilterTag as i, MultiSelectFilter as a, Popover as o, PopoverContent as s, PopoverTrigger as c, SearchInput as l, Skeleton as u } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
2
|
+
import { EmptyState as d } from "../../../shared/ui/dist/lib/EmptyState/EmptyState.js";
|
|
3
|
+
import { ErrorState as f } from "../../../shared/ui/dist/lib/ErrorState/ErrorState.js";
|
|
4
4
|
import "../../../shared/ui/dist/index.js";
|
|
5
|
-
import { COUNTERPARTS_SCREEN_LABELS_EN as
|
|
6
|
-
import { jsx as
|
|
7
|
-
import { ArrowDownIcon as
|
|
5
|
+
import { COUNTERPARTS_SCREEN_LABELS_EN as p } from "./index2.js";
|
|
6
|
+
import { Fragment as m, jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
7
|
+
import { ArrowDownIcon as _, ArrowUpDownIcon as v, ArrowUpIcon as y, ListFilter as b, PlusIcon as x } from "lucide-react";
|
|
8
8
|
//#region ../../libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index3.js
|
|
9
|
-
var
|
|
9
|
+
var S = [
|
|
10
10
|
10,
|
|
11
11
|
25,
|
|
12
12
|
50,
|
|
13
13
|
100
|
|
14
|
-
], y = [
|
|
15
|
-
"rgba(0,0,255,0.05)",
|
|
16
|
-
"rgba(255,0,32,0.05)",
|
|
17
|
-
"rgba(0,255,220,0.05)",
|
|
18
|
-
"rgba(225,1,251,0.05)",
|
|
19
|
-
"rgba(255,123,0,0.05)"
|
|
20
14
|
];
|
|
21
|
-
function
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
className: "ttw:w-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
})
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
15
|
+
function C({ labels: e, filters: t, disabled: u }) {
|
|
16
|
+
return /* @__PURE__ */ h(n, {
|
|
17
|
+
className: "ttw:flex-wrap ttw:px-4",
|
|
18
|
+
searchSlot: /* @__PURE__ */ h(l, {
|
|
19
|
+
value: t.searchValue,
|
|
20
|
+
onChange: (e) => t.onSearchChange(e.target.value),
|
|
21
|
+
placeholder: e.searchPlaceholder,
|
|
22
|
+
"aria-label": e.searchLabel,
|
|
23
|
+
disabled: u,
|
|
24
|
+
className: "ttw:min-w-64"
|
|
25
|
+
}),
|
|
26
|
+
menuSlot: /* @__PURE__ */ g(o, {
|
|
27
|
+
open: t.isPopoverOpen,
|
|
28
|
+
onOpenChange: (e) => {
|
|
29
|
+
e || t.onPopoverClose();
|
|
30
|
+
},
|
|
31
|
+
children: [/* @__PURE__ */ h(c, {
|
|
32
|
+
asChild: !0,
|
|
33
|
+
children: /* @__PURE__ */ h(r, {
|
|
34
|
+
activeCount: t.activeFilterCount,
|
|
35
|
+
onClick: (e) => {
|
|
36
|
+
t.isTypePanelOpen && e.preventDefault(), t.onMenuToggle();
|
|
37
|
+
},
|
|
38
|
+
disabled: u,
|
|
39
|
+
labels: { filters: e.filtersButton }
|
|
40
|
+
})
|
|
41
|
+
}), /* @__PURE__ */ g(s, {
|
|
42
|
+
align: "start",
|
|
43
|
+
className: t.isTypePanelOpen ? "ttw:w-56 ttw:p-0" : "ttw:w-52 ttw:p-0",
|
|
44
|
+
children: [t.isMenuOpen && /* @__PURE__ */ h("div", {
|
|
45
|
+
className: "ttw:p-1",
|
|
46
|
+
children: /* @__PURE__ */ g("button", {
|
|
47
|
+
type: "button",
|
|
48
|
+
className: "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",
|
|
49
|
+
onClick: t.onTypeFieldSelect,
|
|
50
|
+
children: [/* @__PURE__ */ h(b, {
|
|
51
|
+
className: "ttw:size-4 ttw:shrink-0 ttw:text-muted-foreground",
|
|
52
|
+
"aria-hidden": !0
|
|
53
|
+
}), e.filterFieldType]
|
|
58
54
|
})
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
55
|
+
}), t.isTypePanelOpen && /* @__PURE__ */ h(a, {
|
|
56
|
+
options: [...t.typeOptions],
|
|
57
|
+
selectedValues: [...t.selectedTypes],
|
|
58
|
+
onSelectionChange: t.onTypeChange
|
|
59
|
+
})]
|
|
60
|
+
})]
|
|
61
|
+
}),
|
|
62
|
+
activeChipsSlot: /* @__PURE__ */ g(m, { children: [t.chips.map((n) => /* @__PURE__ */ h(i, {
|
|
63
|
+
label: n.label,
|
|
64
|
+
variant: "default",
|
|
65
|
+
labels: { remove: e.filterChipRemove },
|
|
66
|
+
onDismiss: () => t.onRemoveChip(n.key)
|
|
67
|
+
}, n.key)), t.chips.length > 0 && /* @__PURE__ */ h("button", {
|
|
68
|
+
type: "button",
|
|
69
|
+
className: "ttw:cursor-pointer ttw:whitespace-nowrap ttw:text-xs ttw:text-muted-foreground ttw:transition-colors ttw:hover:text-foreground",
|
|
70
|
+
onClick: t.onClearAll,
|
|
71
|
+
children: e.clearAllFilters
|
|
72
|
+
})] })
|
|
62
73
|
});
|
|
63
74
|
}
|
|
64
|
-
function
|
|
65
|
-
return /* @__PURE__ */
|
|
75
|
+
function w({ value: e, isLoading: t, colorClass: n }) {
|
|
76
|
+
return /* @__PURE__ */ h("div", {
|
|
66
77
|
className: "ttw:flex ttw:justify-end",
|
|
67
|
-
children: t ? /* @__PURE__ */
|
|
78
|
+
children: t ? /* @__PURE__ */ h(u, { className: "ttw:h-4 ttw:w-20" }) : /* @__PURE__ */ h("span", {
|
|
68
79
|
className: n,
|
|
69
80
|
children: e
|
|
70
81
|
})
|
|
71
82
|
});
|
|
72
83
|
}
|
|
73
|
-
function
|
|
74
|
-
let
|
|
75
|
-
...
|
|
76
|
-
...
|
|
77
|
-
},
|
|
84
|
+
function T({ mode: n, counterparts: r, isLoading: i, isError: a, errorTitle: o, errorDescription: s, sorting: c, onSortingChange: l, pageSize: u, onPageSizeChange: m, pageSizeOptions: b = S, hasNextPage: T, hasPrevPage: E, onNextPage: D, onPrevPage: O, filters: k, isFiltering: A, canCreate: j = !0, isAccessRestricted: M, onCreateClick: N, onRowClick: P, onRetry: F, labels: I, emptyStateTestId: L, accessRestrictedTestId: R }) {
|
|
85
|
+
let z = {
|
|
86
|
+
...p,
|
|
87
|
+
...I
|
|
88
|
+
}, B = n === "customer", V = B ? z.columnReceivedAmount : z.columnTotalPaidToDate, H = B ? z.columnAmountDue : z.columnBalanceDue, U = [
|
|
78
89
|
{
|
|
79
90
|
accessorKey: "name",
|
|
80
91
|
enableSorting: !0,
|
|
81
92
|
header: ({ column: t }) => {
|
|
82
93
|
let n = t.getIsSorted();
|
|
83
|
-
return /* @__PURE__ */
|
|
94
|
+
return /* @__PURE__ */ g("div", {
|
|
84
95
|
className: "ttw:flex ttw:items-center ttw:gap-2 ttw:text-inherit",
|
|
85
|
-
children: [
|
|
96
|
+
children: [z.columnName, /* @__PURE__ */ h(e, {
|
|
86
97
|
variant: "ghost",
|
|
87
98
|
size: "icon-sm",
|
|
88
|
-
"aria-label":
|
|
99
|
+
"aria-label": z.sortByName,
|
|
89
100
|
onClick: () => t.toggleSorting(n === "asc"),
|
|
90
|
-
children:
|
|
101
|
+
children: h(n === "asc" ? y : n === "desc" ? _ : v, { className: "ttw:size-4" })
|
|
91
102
|
})]
|
|
92
103
|
});
|
|
93
104
|
},
|
|
94
|
-
cell: ({ row: e }) => /* @__PURE__ */
|
|
95
|
-
className: "ttw:flex ttw:
|
|
96
|
-
children: [
|
|
97
|
-
"
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
className: "ttw:flex ttw:flex-col ttw:gap-1",
|
|
103
|
-
children: [/* @__PURE__ */ f("span", {
|
|
104
|
-
className: "ttw:font-semibold",
|
|
105
|
-
children: e.original.name
|
|
106
|
-
}), e.original.locationLabel && /* @__PURE__ */ f("span", {
|
|
107
|
-
className: "ttw:text-sm ttw:text-muted-foreground",
|
|
108
|
-
children: e.original.locationLabel
|
|
109
|
-
})]
|
|
105
|
+
cell: ({ row: e }) => /* @__PURE__ */ g("div", {
|
|
106
|
+
className: "ttw:flex ttw:flex-col ttw:gap-1",
|
|
107
|
+
children: [/* @__PURE__ */ h("span", {
|
|
108
|
+
className: "ttw:font-semibold",
|
|
109
|
+
children: e.original.name
|
|
110
|
+
}), e.original.locationLabel && /* @__PURE__ */ h("span", {
|
|
111
|
+
className: "ttw:text-sm ttw:text-muted-foreground",
|
|
112
|
+
children: e.original.locationLabel
|
|
110
113
|
})]
|
|
111
114
|
})
|
|
112
115
|
},
|
|
113
|
-
|
|
116
|
+
{
|
|
114
117
|
accessorKey: "billedAmountLabel",
|
|
115
|
-
header: () => /* @__PURE__ */
|
|
118
|
+
header: () => /* @__PURE__ */ h("div", {
|
|
116
119
|
className: "ttw:text-right",
|
|
117
|
-
children:
|
|
120
|
+
children: z.columnBilledAmount
|
|
118
121
|
}),
|
|
119
|
-
cell: ({ row: e }) => /* @__PURE__ */
|
|
122
|
+
cell: ({ row: e }) => /* @__PURE__ */ h(w, {
|
|
120
123
|
value: e.original.billedAmountLabel,
|
|
121
124
|
isLoading: e.original.isBilledAmountLoading
|
|
122
125
|
})
|
|
123
|
-
}
|
|
126
|
+
},
|
|
124
127
|
{
|
|
125
128
|
accessorKey: "receivedOrPaidAmountLabel",
|
|
126
|
-
header: () => /* @__PURE__ */
|
|
129
|
+
header: () => /* @__PURE__ */ h("div", {
|
|
127
130
|
className: "ttw:text-right",
|
|
128
|
-
children:
|
|
131
|
+
children: V
|
|
129
132
|
}),
|
|
130
|
-
cell: ({ row: e }) => /* @__PURE__ */
|
|
133
|
+
cell: ({ row: e }) => /* @__PURE__ */ h(w, {
|
|
131
134
|
value: e.original.receivedOrPaidAmountLabel,
|
|
132
135
|
isLoading: e.original.isReceivedOrPaidAmountLoading,
|
|
133
136
|
colorClass: e.original.isReceivedOrPaidPositive ? "ttw:text-green-700" : void 0
|
|
@@ -135,63 +138,62 @@ function C({ mode: n, counterparts: r, isLoading: i, isError: a, sorting: o, onS
|
|
|
135
138
|
},
|
|
136
139
|
{
|
|
137
140
|
accessorKey: "dueOrOwedAmountLabel",
|
|
138
|
-
header: () => /* @__PURE__ */
|
|
141
|
+
header: () => /* @__PURE__ */ h("div", {
|
|
139
142
|
className: "ttw:text-right",
|
|
140
|
-
children:
|
|
143
|
+
children: H
|
|
141
144
|
}),
|
|
142
|
-
cell: ({ row: e }) => /* @__PURE__ */
|
|
145
|
+
cell: ({ row: e }) => /* @__PURE__ */ h(w, {
|
|
143
146
|
value: e.original.dueOrOwedAmountLabel,
|
|
144
147
|
isLoading: e.original.isDueOrOwedAmountLoading
|
|
145
148
|
})
|
|
146
149
|
}
|
|
147
|
-
],
|
|
148
|
-
return /* @__PURE__ */
|
|
150
|
+
], W = B ? z.customersEmptyTitle : z.vendorsEmptyTitle, G = B ? z.customersEmptyDescription : z.vendorsEmptyDescription, K = B ? z.customersEmptyAction : z.vendorsEmptyAction, q = B ? z.customersFilterEmptyTitle : z.vendorsFilterEmptyTitle, J = !A && !k.searchValue && !r.length && !i, Y = !(!j || M), X = !(A || !Y), Z = !A && !i && !a && !r.length, Q = Y && !Z, $ = B ? z.createButton : z.vendorsCreateButton;
|
|
151
|
+
return /* @__PURE__ */ g("div", {
|
|
149
152
|
className: "ttw:flex ttw:flex-col ttw:gap-4",
|
|
150
|
-
children:
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
153
|
+
children: [Q && /* @__PURE__ */ h("div", {
|
|
154
|
+
className: "ttw:flex ttw:items-center ttw:justify-end ttw:gap-2",
|
|
155
|
+
children: /* @__PURE__ */ g(e, {
|
|
156
|
+
onClick: N,
|
|
157
|
+
children: [/* @__PURE__ */ h(x, { className: "ttw:size-4" }), $]
|
|
158
|
+
})
|
|
159
|
+
}), M ? /* @__PURE__ */ h(f, {
|
|
160
|
+
testId: R,
|
|
161
|
+
title: z.accessRestrictedTitle,
|
|
162
|
+
description: z.accessRestrictedDescription
|
|
163
|
+
}) : a ? /* @__PURE__ */ h(f, {
|
|
164
|
+
title: o,
|
|
165
|
+
description: s,
|
|
166
|
+
retryLabel: F ? z.errorRetry : void 0,
|
|
167
|
+
onRetry: F
|
|
168
|
+
}) : /* @__PURE__ */ h(t, {
|
|
169
|
+
columns: U,
|
|
161
170
|
data: r,
|
|
162
171
|
isLoading: i,
|
|
163
|
-
sorting:
|
|
164
|
-
onSortingChange:
|
|
165
|
-
pageSize:
|
|
166
|
-
onPageSizeChange:
|
|
167
|
-
pageSizeOptions:
|
|
168
|
-
hasNextPage:
|
|
169
|
-
hasPrevPage:
|
|
170
|
-
onNextPage:
|
|
171
|
-
onPrevPage:
|
|
172
|
-
onRowClick:
|
|
173
|
-
rowAriaLabel: (e) =>
|
|
174
|
-
filterComponent: /* @__PURE__ */
|
|
175
|
-
labels:
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
entityFilter: k,
|
|
179
|
-
onEntityFilterChange: A,
|
|
180
|
-
disabled: Y,
|
|
181
|
-
createAction: X ? /* @__PURE__ */ f(e, {
|
|
182
|
-
onClick: P,
|
|
183
|
-
children: Q
|
|
184
|
-
}) : void 0
|
|
172
|
+
sorting: c,
|
|
173
|
+
onSortingChange: l,
|
|
174
|
+
pageSize: u,
|
|
175
|
+
onPageSizeChange: m,
|
|
176
|
+
pageSizeOptions: b,
|
|
177
|
+
hasNextPage: T,
|
|
178
|
+
hasPrevPage: E,
|
|
179
|
+
onNextPage: D,
|
|
180
|
+
onPrevPage: O,
|
|
181
|
+
onRowClick: P,
|
|
182
|
+
rowAriaLabel: (e) => z.openRow(e.name),
|
|
183
|
+
filterComponent: /* @__PURE__ */ h(C, {
|
|
184
|
+
labels: z,
|
|
185
|
+
filters: k,
|
|
186
|
+
disabled: J
|
|
185
187
|
}),
|
|
186
|
-
children: /* @__PURE__ */
|
|
187
|
-
testId:
|
|
188
|
-
title:
|
|
189
|
-
description:
|
|
190
|
-
actionLabel:
|
|
191
|
-
onAction:
|
|
188
|
+
children: /* @__PURE__ */ h(d, {
|
|
189
|
+
testId: L,
|
|
190
|
+
title: A ? q : W,
|
|
191
|
+
description: A ? z.filterEmptyDescription : G,
|
|
192
|
+
actionLabel: A ? z.filterEmptyAction : X ? K : void 0,
|
|
193
|
+
onAction: A ? k.onClearAll : X ? N : void 0
|
|
192
194
|
})
|
|
193
|
-
})
|
|
195
|
+
})]
|
|
194
196
|
});
|
|
195
197
|
}
|
|
196
198
|
//#endregion
|
|
197
|
-
export {
|
|
199
|
+
export { T as CounterpartsScreen, T as default };
|