@tesouro/embedded-components-react 0.5.132 → 0.5.134
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 +8 -0
- package/dist/index.d.ts +31 -0
- package/dist/lib/BankAccountsWidget.d.ts +13 -0
- package/dist/lib/CounterpartsWidget.d.ts +6 -0
- package/dist/lib/ProductsWidget.d.ts +6 -0
- package/dist/lib/ReceivablesWidget.d.ts +6 -0
- package/dist/lib/WidgetSuite.d.ts +13 -0
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/data-access/dist/index.js +6 -4
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/data-access/dist/index3.js +13 -12
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/data-access/dist/index4.js +17 -35
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/data-access/dist/index5.js +35 -24
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/data-access/dist/index6.js +28 -0
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/data-access/dist/index7.js +32 -0
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/feature/dist/index4.js +17 -5
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/feature/dist/index5.js +2 -1
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/feature/dist/index8.js +226 -139
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/ui/dist/index5.js +100 -5
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/ui/dist/index7.js +11 -0
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/ui/dist/index8.js +110 -95
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/feature/dist/index4.js +2 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index36.js +0 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index82.js +219 -241
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index2.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index3.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index16.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index2.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/products-widget/ui/dist/index2.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/products-widget/ui/dist/index4.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/settings-widget/tags/ui/dist/index2.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/settings-widget/tags/ui/dist/index3.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/index.js +34 -34
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js +203 -192
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/sdk.gen.js +168 -144
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/dist/packages/shared-ui-shadcn/dist/index.js +3270 -3265
- package/package.json +1 -1
|
@@ -7,190 +7,277 @@ import "../../../../shared/ui/dist/index.js";
|
|
|
7
7
|
import { useAnalyticsTrack as t } from "../../../../shared/feature/dist/lib/analytics/hooks.js";
|
|
8
8
|
import { useWidgetConfig as n, useWidgetError as r, useWidgetLoading as ee } from "../../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
|
|
9
9
|
import "../../../../shared/feature/dist/index.js";
|
|
10
|
-
import { AccountDetailsWidgetAnalyticsEvent as
|
|
11
|
-
import { formatDateParam as
|
|
12
|
-
import { copyTextToClipboard as
|
|
13
|
-
import { DEFAULT_FEATURE_LABELS as
|
|
14
|
-
import { getBankAccountsPermissions as
|
|
15
|
-
import { interpolateLabel as
|
|
16
|
-
import { useBankAccountDetailsQuery as
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
10
|
+
import { AccountDetailsWidgetAnalyticsEvent as te } from "./index2.js";
|
|
11
|
+
import { formatDateParam as i, getDefaultExportDateRange as ne, isExportRangeValid as a, startOfLocalDay as o, triggerCsvDownload as re, yesterdayLocal as s } from "./index3.js";
|
|
12
|
+
import { copyTextToClipboard as ie, formatAmountLabel as c, formatSignedTransactionAmountLabel as ae, formatStatementPeriodLabel as oe, formatTransactionDateLabel as se, maskAccountNumber as ce } from "./index4.js";
|
|
13
|
+
import { DEFAULT_FEATURE_LABELS as le } from "./index5.js";
|
|
14
|
+
import { getBankAccountsPermissions as ue } from "./index6.js";
|
|
15
|
+
import { interpolateLabel as l } from "./index7.js";
|
|
16
|
+
import { useBankAccountDetailsQuery as de } from "../../data-access/dist/index2.js";
|
|
17
|
+
import { useBankAccountStatementsQuery as fe } from "../../data-access/dist/index3.js";
|
|
18
|
+
import { useBankAccountTransactionsQuery as pe } from "../../data-access/dist/index4.js";
|
|
19
|
+
import { useDownloadBankAccountTransactionsMutation as me } from "../../data-access/dist/index5.js";
|
|
20
|
+
import { useRetrieveBankAccountStatementMutation as he } from "../../data-access/dist/index6.js";
|
|
21
|
+
import { useUpdateBankAccountMutation as ge } from "../../data-access/dist/index7.js";
|
|
20
22
|
import "../../data-access/dist/index.js";
|
|
21
|
-
import { DEFAULT_LABELS as
|
|
22
|
-
import { AccountDetailsWidgetUi as
|
|
23
|
+
import { DEFAULT_LABELS as _e } from "../../ui/dist/index7.js";
|
|
24
|
+
import { AccountDetailsWidgetUi as ve } from "../../ui/dist/index8.js";
|
|
23
25
|
import "../../ui/dist/index.js";
|
|
24
|
-
import { useCallback as
|
|
25
|
-
import { jsx as
|
|
26
|
+
import { useCallback as u, useEffect as ye, useMemo as d, useState as f } from "react";
|
|
27
|
+
import { jsx as be } from "react/jsx-runtime";
|
|
26
28
|
//#region ../../libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/feature/dist/index8.js
|
|
27
|
-
var
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
..._e
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
})
|
|
43
|
-
|
|
44
|
-
|
|
29
|
+
var xe = 3e3, Se = 5e3, Ce = [
|
|
30
|
+
10,
|
|
31
|
+
25,
|
|
32
|
+
50
|
|
33
|
+
], we = 10, Te = 6e5, Ee = { nickname: "" };
|
|
34
|
+
function p({ accountId: p, onBack: De, labels: Oe, featureLabels: ke, isBankingTaglineVisible: Ae = !0, bankLogoSrc: je, bankLogoAlt: Me, bankAddress: Ne, supportTeamUrl: Pe }) {
|
|
35
|
+
let m = {
|
|
36
|
+
..._e,
|
|
37
|
+
...Oe
|
|
38
|
+
}, h = {
|
|
39
|
+
...le,
|
|
40
|
+
...ke
|
|
41
|
+
}, g = t(), { organizationId: Fe, widgetToken: Ie, initResponse: _ } = n(), Le = ee(), v = !!r(), y = !!(Fe && Ie), b = d(() => ue(_?.scopes), [_?.scopes]), x = b.canRead && !!_, S = y && x, [C, Re] = f("transactions"), [ze, w] = f(!1), [T, E] = f(Ee), [Be, Ve] = f(!1), [He, D] = f(!1), [Ue, O] = f(!1), [We, Ge] = f(!1), [Ke, k] = f(!1), [A, j] = f(), [M, N] = f(), [P, qe] = f(we), [F, I] = f(() => ({
|
|
42
|
+
accountId: p,
|
|
43
|
+
token: void 0
|
|
44
|
+
}));
|
|
45
|
+
F.accountId !== p && I({
|
|
46
|
+
accountId: p,
|
|
47
|
+
token: void 0
|
|
48
|
+
});
|
|
49
|
+
let Je = F.accountId === p ? F.token : void 0, L = u((e) => {
|
|
50
|
+
I((t) => ({
|
|
51
|
+
...t,
|
|
52
|
+
token: e
|
|
53
|
+
}));
|
|
54
|
+
}, []), [R, z] = f(() => /* @__PURE__ */ new Set());
|
|
55
|
+
ye(() => {
|
|
56
|
+
g(te.Mounted);
|
|
57
|
+
}, [g]);
|
|
58
|
+
let B = de({
|
|
59
|
+
id: p,
|
|
60
|
+
enabled: S
|
|
61
|
+
}), V = pe({
|
|
62
|
+
id: p,
|
|
63
|
+
enabled: S && C === "transactions",
|
|
45
64
|
limit: 25,
|
|
46
65
|
sortBy: "DATE",
|
|
47
66
|
sortOrder: "DESC"
|
|
48
|
-
}),
|
|
67
|
+
}), H = fe({
|
|
68
|
+
id: p,
|
|
69
|
+
enabled: S && C === "statements",
|
|
70
|
+
limit: P,
|
|
71
|
+
pagination_token: Je,
|
|
72
|
+
category: "STATEMENTS"
|
|
73
|
+
}), Ye = ge(), Xe = me(), Ze = he(), { mutate: Qe, isPending: $e, isError: U, reset: W } = Ye, { mutateAsync: G, isPending: et } = Xe, { mutateAsync: K } = Ze, q = x ? B.data : void 0, J = _?.bankName?.trim() ?? "", Y = Ne?.trim() || void 0, X = { bankName: J }, tt = d(() => l(m.domesticWireIntro, X), [m.domesticWireIntro, J]), nt = d(() => l(m.domesticWireNote, X), [m.domesticWireNote, J]), rt = d(() => l(m.thingsToKnowBody, X), [m.thingsToKnowBody, J]), it = q?.nickname?.trim() || h.accountFallback, at = c(q?.balance), ot = d(() => (V.data?.data ?? []).map((e, t) => ({
|
|
49
74
|
key: `${e.date}-${t}`,
|
|
50
75
|
descriptionLabel: e.description,
|
|
51
|
-
dateLabel:
|
|
52
|
-
amountLabel:
|
|
76
|
+
dateLabel: se(e.date),
|
|
77
|
+
amountLabel: ae(e.amount, e.direction),
|
|
53
78
|
amountVariant: e.direction === "CREDIT" ? "positive" : "default",
|
|
54
|
-
balanceLabel:
|
|
55
|
-
})), [
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
79
|
+
balanceLabel: c(e.runningBalance)
|
|
80
|
+
})), [V.data?.data]), st = b.canRead && ot.length > 0, ct = u((t) => {
|
|
81
|
+
if (!y || !b.canRead) return;
|
|
82
|
+
let n = window.open("", "_blank");
|
|
83
|
+
if (!n) {
|
|
84
|
+
e.error(h.viewStatementErrorToast);
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
n.opener = null, z((e) => new Set(e).add(t)), K({
|
|
88
|
+
id: p,
|
|
89
|
+
statementId: t
|
|
90
|
+
}).then((e) => {
|
|
91
|
+
let t = URL.createObjectURL(e);
|
|
92
|
+
n.location.href = t, window.setTimeout(() => URL.revokeObjectURL(t), Te);
|
|
93
|
+
}).catch(() => {
|
|
94
|
+
n.close(), e.error(h.viewStatementErrorToast);
|
|
95
|
+
}).finally(() => {
|
|
96
|
+
z((e) => {
|
|
97
|
+
if (!e.has(t)) return e;
|
|
98
|
+
let n = new Set(e);
|
|
99
|
+
return n.delete(t), n;
|
|
100
|
+
});
|
|
101
|
+
});
|
|
102
|
+
}, [
|
|
103
|
+
p,
|
|
104
|
+
h.viewStatementErrorToast,
|
|
105
|
+
y,
|
|
106
|
+
b.canRead,
|
|
107
|
+
K
|
|
108
|
+
]), lt = d(() => (H.data?.data ?? []).map((e) => {
|
|
109
|
+
let t = oe(e.statementDate);
|
|
110
|
+
return {
|
|
111
|
+
key: e.statementId,
|
|
112
|
+
label: t,
|
|
113
|
+
viewButtonAriaLabel: l(m.viewStatementButtonAriaLabel, { date: t }),
|
|
114
|
+
isViewDisabled: R.has(e.statementId),
|
|
115
|
+
onView: () => ct(e.statementId)
|
|
116
|
+
};
|
|
117
|
+
}), [
|
|
118
|
+
H.data?.data,
|
|
119
|
+
m.viewStatementButtonAriaLabel,
|
|
120
|
+
R,
|
|
121
|
+
ct
|
|
122
|
+
]), Z = H.data?.nextPaginationToken ?? void 0, Q = H.data?.prevPaginationToken ?? void 0, ut = S && C === "statements" && !!H.data && !H.isError, dt = S && C === "statements" && H.isLoading, ft = S && C === "statements" && H.isError, pt = u(() => {
|
|
123
|
+
H.refetch();
|
|
124
|
+
}, [H.refetch]), mt = u((e) => {
|
|
125
|
+
qe(e), L(void 0);
|
|
126
|
+
}, []), ht = u(() => {
|
|
127
|
+
L(Q);
|
|
128
|
+
}, [Q]), gt = u(() => {
|
|
129
|
+
L(Z);
|
|
130
|
+
}, [Z]), _t = !a(A, M), vt = d(() => {
|
|
131
|
+
let e = [{ after: s() }];
|
|
132
|
+
return M && e.push({ after: o(M) }), e;
|
|
133
|
+
}, [M]), yt = d(() => {
|
|
134
|
+
let e = [{ after: s() }];
|
|
135
|
+
return A && e.push({ before: o(A) }), e;
|
|
136
|
+
}, [A]), bt = u((e) => {
|
|
62
137
|
if (e) {
|
|
63
|
-
let { startDate: e, endDate: t } =
|
|
64
|
-
|
|
138
|
+
let { startDate: e, endDate: t } = ne();
|
|
139
|
+
j(e), N(t);
|
|
65
140
|
}
|
|
66
|
-
|
|
67
|
-
}, []),
|
|
68
|
-
if (!
|
|
69
|
-
|
|
70
|
-
let t = e.loading(
|
|
141
|
+
k(e);
|
|
142
|
+
}, []), xt = u(async () => {
|
|
143
|
+
if (!y || !b.canRead || !A || !M || !a(A, M)) return;
|
|
144
|
+
k(!1);
|
|
145
|
+
let t = e.loading(h.exportLoadingToast);
|
|
71
146
|
try {
|
|
72
147
|
let n = await G({
|
|
73
|
-
id:
|
|
74
|
-
startDate:
|
|
75
|
-
endDate:
|
|
148
|
+
id: p,
|
|
149
|
+
startDate: i(A),
|
|
150
|
+
endDate: i(M)
|
|
76
151
|
});
|
|
77
|
-
|
|
152
|
+
re(n.csv, n.filename), e.success(h.exportSuccessToast, {
|
|
78
153
|
id: t,
|
|
79
|
-
duration:
|
|
154
|
+
duration: xe
|
|
80
155
|
});
|
|
81
156
|
} catch {
|
|
82
|
-
e.error(
|
|
157
|
+
e.error(h.exportErrorToast, {
|
|
83
158
|
id: t,
|
|
84
|
-
duration:
|
|
159
|
+
duration: Se
|
|
85
160
|
});
|
|
86
161
|
}
|
|
87
162
|
}, [
|
|
88
|
-
|
|
163
|
+
p,
|
|
89
164
|
G,
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
]),
|
|
98
|
-
if (!await
|
|
165
|
+
M,
|
|
166
|
+
A,
|
|
167
|
+
h.exportErrorToast,
|
|
168
|
+
h.exportLoadingToast,
|
|
169
|
+
h.exportSuccessToast,
|
|
170
|
+
y,
|
|
171
|
+
b.canRead
|
|
172
|
+
]), $ = u(async (t, n) => {
|
|
173
|
+
if (!await ie(t)) return;
|
|
99
174
|
let r = {
|
|
100
|
-
account:
|
|
101
|
-
routing:
|
|
102
|
-
bankName:
|
|
103
|
-
bankAddress:
|
|
175
|
+
account: h.copyAccountNumberToast,
|
|
176
|
+
routing: h.copyRoutingNumberToast,
|
|
177
|
+
bankName: h.copyBankNameToast,
|
|
178
|
+
bankAddress: h.copyBankAddressToast
|
|
104
179
|
};
|
|
105
180
|
if (e.success(r[n]), n === "account") {
|
|
106
|
-
|
|
181
|
+
D(!0), window.setTimeout(() => D(!1), 2e3);
|
|
107
182
|
return;
|
|
108
183
|
}
|
|
109
|
-
n === "routing" && (
|
|
184
|
+
n === "routing" && (O(!0), window.setTimeout(() => O(!1), 2e3));
|
|
110
185
|
}, [
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
]),
|
|
116
|
-
e && (
|
|
186
|
+
h.copyAccountNumberToast,
|
|
187
|
+
h.copyBankAddressToast,
|
|
188
|
+
h.copyBankNameToast,
|
|
189
|
+
h.copyRoutingNumberToast
|
|
190
|
+
]), St = (e) => {
|
|
191
|
+
e && (E({ nickname: q?.nickname?.trim() ?? "" }), W()), w(e);
|
|
117
192
|
};
|
|
118
|
-
return /* @__PURE__ */
|
|
119
|
-
labels:
|
|
120
|
-
title:
|
|
121
|
-
bankDisplayName:
|
|
122
|
-
bankLogoSrc:
|
|
123
|
-
bankLogoAlt:
|
|
124
|
-
balanceLabel:
|
|
193
|
+
return /* @__PURE__ */ be(ve, {
|
|
194
|
+
labels: m,
|
|
195
|
+
title: it,
|
|
196
|
+
bankDisplayName: J,
|
|
197
|
+
bankLogoSrc: je,
|
|
198
|
+
bankLogoAlt: Me,
|
|
199
|
+
balanceLabel: at,
|
|
125
200
|
balanceTestId: "bank-accounts-widget-detail-balance",
|
|
126
|
-
isBankingTaglineVisible:
|
|
127
|
-
activeTab:
|
|
128
|
-
transactionRows:
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
201
|
+
isBankingTaglineVisible: Ae,
|
|
202
|
+
activeTab: C,
|
|
203
|
+
transactionRows: ot,
|
|
204
|
+
statementRows: lt,
|
|
205
|
+
isStatementsLoading: dt,
|
|
206
|
+
isStatementsError: ft,
|
|
207
|
+
onStatementsRetry: pt,
|
|
208
|
+
isStatementsPaginationVisible: ut,
|
|
209
|
+
statementsPageSize: P,
|
|
210
|
+
statementsPageSizeOptions: Ce,
|
|
211
|
+
isStatementsPreviousPageDisabled: !Q,
|
|
212
|
+
isStatementsNextPageDisabled: !Z,
|
|
213
|
+
onStatementsPageSizeChange: mt,
|
|
214
|
+
onStatementsPreviousPageClick: ht,
|
|
215
|
+
onStatementsNextPageClick: gt,
|
|
216
|
+
showExport: st,
|
|
217
|
+
isExportOpen: Ke,
|
|
218
|
+
exportStartDate: A,
|
|
219
|
+
exportEndDate: M,
|
|
220
|
+
isExportDownloading: et,
|
|
221
|
+
isExportDownloadDisabled: _t,
|
|
222
|
+
disabledExportStartDates: vt,
|
|
223
|
+
disabledExportEndDates: yt,
|
|
224
|
+
accountNumberLabel: q?.accountNumber ?? "",
|
|
225
|
+
maskedAccountNumberLabel: ce(q?.accountNumber ?? ""),
|
|
139
226
|
accountNumberTestId: "bank-accounts-widget-detail-account-number",
|
|
140
|
-
wireAccountNumberLabel:
|
|
141
|
-
routingNumberLabel:
|
|
142
|
-
bankAddressLabel:
|
|
143
|
-
domesticWireIntroLabel:
|
|
144
|
-
domesticWireNoteLabel:
|
|
145
|
-
thingsToKnowBodyLabel:
|
|
146
|
-
supportTeamHref:
|
|
147
|
-
isAccountNumberVisible:
|
|
148
|
-
isAccountNumberCopied:
|
|
149
|
-
isRoutingNumberCopied:
|
|
150
|
-
isDomesticWireExpanded:
|
|
151
|
-
isLoading: !
|
|
152
|
-
isError:
|
|
153
|
-
isEditOpen:
|
|
154
|
-
isEditDisabled: !
|
|
227
|
+
wireAccountNumberLabel: q?.accountNumber ?? "",
|
|
228
|
+
routingNumberLabel: q?.routingNumber ?? "",
|
|
229
|
+
bankAddressLabel: Y,
|
|
230
|
+
domesticWireIntroLabel: tt,
|
|
231
|
+
domesticWireNoteLabel: nt,
|
|
232
|
+
thingsToKnowBodyLabel: rt,
|
|
233
|
+
supportTeamHref: Pe,
|
|
234
|
+
isAccountNumberVisible: Be,
|
|
235
|
+
isAccountNumberCopied: He,
|
|
236
|
+
isRoutingNumberCopied: Ue,
|
|
237
|
+
isDomesticWireExpanded: We,
|
|
238
|
+
isLoading: !v && (!y && !(_ && q) || Le && !_ || S && (B.isLoading || C === "transactions" && V.isLoading)),
|
|
239
|
+
isError: v || S && (B.isError || C === "transactions" && V.isError),
|
|
240
|
+
isEditOpen: ze,
|
|
241
|
+
isEditDisabled: !b.canWrite,
|
|
155
242
|
isEditError: U,
|
|
156
|
-
isSubmitting:
|
|
157
|
-
editForm:
|
|
158
|
-
canEdit:
|
|
159
|
-
onBack:
|
|
160
|
-
onTabChange:
|
|
161
|
-
onToggleAccountNumberVisibility: () =>
|
|
162
|
-
onCopyAccountNumber: () => void
|
|
163
|
-
onCopyRoutingNumber: () => void
|
|
164
|
-
onCopyBankName: () => void
|
|
165
|
-
onCopyBankAddress: () => void
|
|
166
|
-
onDomesticWireExpandedChange:
|
|
167
|
-
onEditOpenChange:
|
|
243
|
+
isSubmitting: $e,
|
|
244
|
+
editForm: T,
|
|
245
|
+
canEdit: b.canWrite,
|
|
246
|
+
onBack: De,
|
|
247
|
+
onTabChange: Re,
|
|
248
|
+
onToggleAccountNumberVisibility: () => Ve((e) => !e),
|
|
249
|
+
onCopyAccountNumber: () => void $(q?.accountNumber ?? "", "account"),
|
|
250
|
+
onCopyRoutingNumber: () => void $(q?.routingNumber ?? "", "routing"),
|
|
251
|
+
onCopyBankName: () => void $(J, "bankName"),
|
|
252
|
+
onCopyBankAddress: () => void $(Y ?? "", "bankAddress"),
|
|
253
|
+
onDomesticWireExpandedChange: Ge,
|
|
254
|
+
onEditOpenChange: St,
|
|
168
255
|
onEditFormChange: (e) => {
|
|
169
|
-
U && W(),
|
|
256
|
+
U && W(), E(e);
|
|
170
257
|
},
|
|
171
258
|
onEditSubmit: () => {
|
|
172
|
-
if (!
|
|
173
|
-
let t =
|
|
174
|
-
t &&
|
|
175
|
-
path: { id:
|
|
259
|
+
if (!y || !b.canWrite) return;
|
|
260
|
+
let t = T.nickname.trim();
|
|
261
|
+
t && Qe({
|
|
262
|
+
path: { id: p },
|
|
176
263
|
body: { nickname: t }
|
|
177
264
|
}, {
|
|
178
265
|
onSuccess: () => {
|
|
179
|
-
|
|
266
|
+
g(te.AccountUpdated, { accountId: p }), e.success(h.editSuccessToast), w(!1);
|
|
180
267
|
},
|
|
181
268
|
onError: () => {
|
|
182
|
-
e.error(
|
|
269
|
+
e.error(h.editErrorToast);
|
|
183
270
|
}
|
|
184
271
|
});
|
|
185
272
|
},
|
|
186
|
-
onEditNicknameClick: () =>
|
|
187
|
-
onExportOpenChange:
|
|
188
|
-
onExportStartDateChange:
|
|
189
|
-
onExportEndDateChange:
|
|
273
|
+
onEditNicknameClick: () => St(!0),
|
|
274
|
+
onExportOpenChange: bt,
|
|
275
|
+
onExportStartDateChange: j,
|
|
276
|
+
onExportEndDateChange: N,
|
|
190
277
|
onExportDownload: () => {
|
|
191
|
-
|
|
278
|
+
xt();
|
|
192
279
|
}
|
|
193
280
|
});
|
|
194
281
|
}
|
|
195
282
|
//#endregion
|
|
196
|
-
export {
|
|
283
|
+
export { p as AccountDetailsWidget };
|
|
@@ -2,16 +2,111 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
|
-
import {
|
|
5
|
+
import { Button as e, Skeleton as t, Table as n, TableBody as r, TableCell as i, TableHead as a, TableHeader as o, TableRow as s } from "../../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
6
|
+
import { ErrorState as c } from "../../../../shared/ui/dist/lib/ErrorState/ErrorState.js";
|
|
7
|
+
import { PaginationFooter as l } from "../../../../shared/ui/dist/lib/PaginationFooter/PaginationFooter.js";
|
|
8
|
+
import "../../../../shared/ui/dist/index.js";
|
|
9
|
+
import { Fragment as u, jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
10
|
+
import { ExternalLinkIcon as p } from "lucide-react";
|
|
6
11
|
//#region ../../libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/ui/dist/index5.js
|
|
7
|
-
|
|
8
|
-
|
|
12
|
+
var m = 3, h = 2;
|
|
13
|
+
function g() {
|
|
14
|
+
return /* @__PURE__ */ d(u, { children: Array.from({ length: m }).map((e, n) => /* @__PURE__ */ d(s, {
|
|
15
|
+
className: "ttw:bg-card ttw:hover:bg-card",
|
|
16
|
+
children: Array.from({ length: h }).map((e, n) => /* @__PURE__ */ d(i, {
|
|
17
|
+
className: "ttw:px-4 ttw:py-3",
|
|
18
|
+
children: /* @__PURE__ */ d(t, { className: "ttw:h-4 ttw:w-24" })
|
|
19
|
+
}, n))
|
|
20
|
+
}, n)) });
|
|
21
|
+
}
|
|
22
|
+
function _({ labels: t, rows: u, isLoading: m = !1, isError: h = !1, onRetry: _, isPaginationVisible: v = !1, pageSize: y = 10, pageSizeOptions: b = [
|
|
23
|
+
10,
|
|
24
|
+
25,
|
|
25
|
+
50
|
|
26
|
+
], rangeLabel: x = "", isPreviousPageDisabled: S = !1, isNextPageDisabled: C = !1, onPageSizeChange: w, onPreviousPageClick: T, onNextPageClick: E }) {
|
|
27
|
+
if (h) return /* @__PURE__ */ d("div", {
|
|
28
|
+
className: "ttw:rounded-xl ttw:border ttw:border-border ttw:bg-card",
|
|
29
|
+
children: /* @__PURE__ */ d(c, {
|
|
30
|
+
title: t.statementsErrorTitle,
|
|
31
|
+
description: t.statementsErrorDescription,
|
|
32
|
+
retryLabel: _ ? t.statementsErrorRetry : void 0,
|
|
33
|
+
onRetry: _
|
|
34
|
+
})
|
|
35
|
+
});
|
|
36
|
+
if (!m && u.length === 0) return /* @__PURE__ */ d("div", {
|
|
9
37
|
className: "ttw:rounded-xl ttw:border ttw:border-border ttw:bg-card ttw:p-6",
|
|
10
|
-
children: /* @__PURE__ */
|
|
38
|
+
children: /* @__PURE__ */ d("p", {
|
|
11
39
|
className: "ttw:text-muted-foreground",
|
|
12
40
|
children: t.noStatementsLabel
|
|
13
41
|
})
|
|
14
42
|
});
|
|
43
|
+
let D = w && T && E ? {
|
|
44
|
+
onPageSizeChange: w,
|
|
45
|
+
onPreviousPageClick: T,
|
|
46
|
+
onNextPageClick: E
|
|
47
|
+
} : void 0;
|
|
48
|
+
return /* @__PURE__ */ f("div", {
|
|
49
|
+
className: "ttw:overflow-hidden ttw:rounded-xl ttw:border ttw:border-border ttw:bg-card",
|
|
50
|
+
children: [
|
|
51
|
+
m && /* @__PURE__ */ d("span", {
|
|
52
|
+
role: "status",
|
|
53
|
+
className: "ttw:sr-only",
|
|
54
|
+
children: t.statementsLoadingLabel
|
|
55
|
+
}),
|
|
56
|
+
/* @__PURE__ */ f(n, { children: [/* @__PURE__ */ d(o, { children: /* @__PURE__ */ f(s, {
|
|
57
|
+
className: "ttw:border-border ttw:bg-muted ttw:hover:bg-muted",
|
|
58
|
+
children: [/* @__PURE__ */ d(a, {
|
|
59
|
+
className: "ttw:h-auto ttw:px-4 ttw:py-3 ttw:font-semibold",
|
|
60
|
+
children: t.statementColumn
|
|
61
|
+
}), /* @__PURE__ */ d(a, {
|
|
62
|
+
className: "ttw:h-auto ttw:px-4 ttw:py-3 ttw:text-right ttw:font-semibold",
|
|
63
|
+
children: /* @__PURE__ */ d("span", {
|
|
64
|
+
className: "ttw:sr-only",
|
|
65
|
+
children: t.statementsActionsColumn
|
|
66
|
+
})
|
|
67
|
+
})]
|
|
68
|
+
}) }), /* @__PURE__ */ d(r, {
|
|
69
|
+
className: "ttw:bg-card",
|
|
70
|
+
children: m ? /* @__PURE__ */ d(g, {}) : u.map((n) => /* @__PURE__ */ f(s, {
|
|
71
|
+
className: "ttw:bg-card ttw:hover:bg-transparent",
|
|
72
|
+
children: [/* @__PURE__ */ d(i, {
|
|
73
|
+
className: "ttw:px-4 ttw:py-3 ttw:align-middle ttw:font-medium ttw:text-foreground",
|
|
74
|
+
children: n.label
|
|
75
|
+
}), /* @__PURE__ */ d(i, {
|
|
76
|
+
className: "ttw:px-4 ttw:py-3 ttw:text-right ttw:align-middle",
|
|
77
|
+
children: /* @__PURE__ */ f(e, {
|
|
78
|
+
type: "button",
|
|
79
|
+
variant: "outline",
|
|
80
|
+
size: "sm",
|
|
81
|
+
"aria-label": n.viewButtonAriaLabel,
|
|
82
|
+
disabled: n.isViewDisabled,
|
|
83
|
+
onClick: n.onView,
|
|
84
|
+
children: [/* @__PURE__ */ d(p, {
|
|
85
|
+
"aria-hidden": !0,
|
|
86
|
+
className: "ttw:size-4"
|
|
87
|
+
}), t.viewStatementButton]
|
|
88
|
+
})
|
|
89
|
+
})]
|
|
90
|
+
}, n.key))
|
|
91
|
+
})] }),
|
|
92
|
+
v && D && /* @__PURE__ */ d(l, {
|
|
93
|
+
pageSize: y,
|
|
94
|
+
pageSizeOptions: b,
|
|
95
|
+
rangeLabel: x,
|
|
96
|
+
isPreviousDisabled: S,
|
|
97
|
+
isNextDisabled: C,
|
|
98
|
+
isDisabled: m,
|
|
99
|
+
onPageSizeChange: D.onPageSizeChange,
|
|
100
|
+
onPreviousPageClick: D.onPreviousPageClick,
|
|
101
|
+
onNextPageClick: D.onNextPageClick,
|
|
102
|
+
labels: {
|
|
103
|
+
rowsPerPageLabel: t.statementsRowsPerPageLabel,
|
|
104
|
+
previousPageButton: t.statementsPreviousPageButton,
|
|
105
|
+
nextPageButton: t.statementsNextPageButton
|
|
106
|
+
}
|
|
107
|
+
})
|
|
108
|
+
]
|
|
109
|
+
});
|
|
15
110
|
}
|
|
16
111
|
//#endregion
|
|
17
|
-
export {
|
|
112
|
+
export { _ as StatementsPanel };
|
|
@@ -23,6 +23,17 @@ var e = {
|
|
|
23
23
|
exportCancelButton: "Cancel",
|
|
24
24
|
exportDownloadButton: "Download file",
|
|
25
25
|
noStatementsLabel: "No statements available",
|
|
26
|
+
statementColumn: "Statement",
|
|
27
|
+
statementsActionsColumn: "Actions",
|
|
28
|
+
viewStatementButton: "View",
|
|
29
|
+
viewStatementButtonAriaLabel: "Open {date} statement",
|
|
30
|
+
statementsRowsPerPageLabel: "Rows per page",
|
|
31
|
+
statementsPreviousPageButton: "Previous page",
|
|
32
|
+
statementsNextPageButton: "Next page",
|
|
33
|
+
statementsLoadingLabel: "Loading statements",
|
|
34
|
+
statementsErrorTitle: "Unable to load statements.",
|
|
35
|
+
statementsErrorDescription: "Something went wrong. Please try again.",
|
|
36
|
+
statementsErrorRetry: "Retry",
|
|
26
37
|
editAccountMenuItem: "Edit account nickname",
|
|
27
38
|
editDialogTitle: "Edit account settings",
|
|
28
39
|
editNicknameLabel: "Account nickname",
|