@tesouro/embedded-components-react 0.5.126 → 0.5.128
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.
|
@@ -11,96 +11,96 @@ import { AccountDetailsWidgetAnalyticsEvent as i } from "./index2.js";
|
|
|
11
11
|
import { formatDateParam as a, getDefaultExportDateRange as te, isExportRangeValid as o, startOfLocalDay as s, triggerCsvDownload as c, yesterdayLocal as l } from "./index3.js";
|
|
12
12
|
import { copyTextToClipboard as ne, formatAmountLabel as u, formatSignedTransactionAmountLabel as re, formatTransactionDateLabel as ie, maskAccountNumber as ae } from "./index4.js";
|
|
13
13
|
import { DEFAULT_FEATURE_LABELS as oe } from "./index5.js";
|
|
14
|
-
import { getBankAccountsPermissions as
|
|
15
|
-
import { interpolateLabel as
|
|
16
|
-
import { useBankAccountDetailsQuery as
|
|
17
|
-
import { useBankAccountTransactionsQuery as
|
|
18
|
-
import { useDownloadBankAccountTransactionsMutation as
|
|
19
|
-
import { useUpdateBankAccountMutation as
|
|
14
|
+
import { getBankAccountsPermissions as se } from "./index6.js";
|
|
15
|
+
import { interpolateLabel as d } from "./index7.js";
|
|
16
|
+
import { useBankAccountDetailsQuery as f } from "../../data-access/dist/index2.js";
|
|
17
|
+
import { useBankAccountTransactionsQuery as p } from "../../data-access/dist/index3.js";
|
|
18
|
+
import { useDownloadBankAccountTransactionsMutation as m } from "../../data-access/dist/index4.js";
|
|
19
|
+
import { useUpdateBankAccountMutation as h } from "../../data-access/dist/index5.js";
|
|
20
20
|
import "../../data-access/dist/index.js";
|
|
21
|
-
import { DEFAULT_LABELS as
|
|
22
|
-
import { AccountDetailsWidgetUi as
|
|
21
|
+
import { DEFAULT_LABELS as ce } from "../../ui/dist/index7.js";
|
|
22
|
+
import { AccountDetailsWidgetUi as le } from "../../ui/dist/index8.js";
|
|
23
23
|
import "../../ui/dist/index.js";
|
|
24
|
-
import { useCallback as
|
|
25
|
-
import { jsx as
|
|
24
|
+
import { useCallback as g, useEffect as ue, useMemo as _, useState as v } from "react";
|
|
25
|
+
import { jsx as de } from "react/jsx-runtime";
|
|
26
26
|
//#region ../../libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/feature/dist/index8.js
|
|
27
|
-
var
|
|
28
|
-
function
|
|
29
|
-
let
|
|
30
|
-
...
|
|
31
|
-
...he
|
|
32
|
-
}, S = {
|
|
33
|
-
...oe,
|
|
27
|
+
var fe = 3e3, pe = 5e3, me = { nickname: "" };
|
|
28
|
+
function y({ accountId: y, onBack: he, labels: ge, featureLabels: _e, isBankingTaglineVisible: ve = !0, bankLogoSrc: ye, bankLogoAlt: be, bankAddress: xe, supportTeamUrl: Se }) {
|
|
29
|
+
let b = {
|
|
30
|
+
...ce,
|
|
34
31
|
...ge
|
|
35
|
-
},
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}, [C]);
|
|
39
|
-
|
|
40
|
-
|
|
32
|
+
}, x = {
|
|
33
|
+
...oe,
|
|
34
|
+
..._e
|
|
35
|
+
}, S = t(), { organizationId: Ce, widgetToken: we, initResponse: C } = n(), w = ee(), T = !!r(), E = !!(Ce && we), D = _(() => se(C?.scopes), [C?.scopes]), O = D.canRead && !!C, k = E && O, [A, Te] = v("transactions"), [Ee, j] = v(!1), [M, N] = v(me), [De, Oe] = v(!1), [ke, P] = v(!1), [Ae, F] = v(!1), [je, Me] = v(!1), [Ne, I] = v(!1), [L, R] = v(), [z, B] = v();
|
|
36
|
+
ue(() => {
|
|
37
|
+
S(i.Mounted);
|
|
38
|
+
}, [S]);
|
|
39
|
+
let V = f({
|
|
40
|
+
id: y,
|
|
41
41
|
enabled: k
|
|
42
|
-
}), H =
|
|
43
|
-
id:
|
|
42
|
+
}), H = p({
|
|
43
|
+
id: y,
|
|
44
44
|
enabled: k && A === "transactions",
|
|
45
45
|
limit: 25,
|
|
46
46
|
sortBy: "DATE",
|
|
47
47
|
sortOrder: "DESC"
|
|
48
|
-
}),
|
|
48
|
+
}), Pe = h(), Fe = m(), { mutate: Ie, isPending: Le, isError: U, reset: W } = Pe, { mutateAsync: G, isPending: Re } = Fe, K = O ? V.data : void 0, q = C?.bankName?.trim() ?? "", J = xe?.trim() || void 0, Y = { bankName: q }, ze = _(() => d(b.domesticWireIntro, Y), [b.domesticWireIntro, q]), Be = _(() => d(b.domesticWireNote, Y), [b.domesticWireNote, q]), X = _(() => d(b.thingsToKnowBody, Y), [b.thingsToKnowBody, q]), Ve = K?.nickname?.trim() || x.accountFallback, He = u(K?.balance), Z = _(() => (H.data?.data ?? []).map((e, t) => ({
|
|
49
49
|
key: `${e.date}-${t}`,
|
|
50
50
|
descriptionLabel: e.description,
|
|
51
51
|
dateLabel: ie(e.date),
|
|
52
52
|
amountLabel: re(e.amount, e.direction),
|
|
53
53
|
amountVariant: e.direction === "CREDIT" ? "positive" : "default",
|
|
54
54
|
balanceLabel: u(e.runningBalance)
|
|
55
|
-
})), [H.data?.data]),
|
|
55
|
+
})), [H.data?.data]), Ue = D.canRead && Z.length > 0, We = !o(L, z), Ge = _(() => {
|
|
56
56
|
let e = [{ after: l() }];
|
|
57
57
|
return z && e.push({ after: s(z) }), e;
|
|
58
|
-
}, [z]),
|
|
58
|
+
}, [z]), Ke = _(() => {
|
|
59
59
|
let e = [{ after: l() }];
|
|
60
60
|
return L && e.push({ before: s(L) }), e;
|
|
61
|
-
}, [L]),
|
|
61
|
+
}, [L]), qe = g((e) => {
|
|
62
62
|
if (e) {
|
|
63
63
|
let { startDate: e, endDate: t } = te();
|
|
64
64
|
R(e), B(t);
|
|
65
65
|
}
|
|
66
66
|
I(e);
|
|
67
|
-
}, []),
|
|
68
|
-
if (!
|
|
67
|
+
}, []), Je = g(async () => {
|
|
68
|
+
if (!E || !D.canRead || !L || !z || !o(L, z)) return;
|
|
69
69
|
I(!1);
|
|
70
|
-
let t = e.loading(
|
|
70
|
+
let t = e.loading(x.exportLoadingToast);
|
|
71
71
|
try {
|
|
72
72
|
let n = await G({
|
|
73
|
-
id:
|
|
73
|
+
id: y,
|
|
74
74
|
startDate: a(L),
|
|
75
75
|
endDate: a(z)
|
|
76
76
|
});
|
|
77
|
-
c(n.csv, n.filename), e.success(
|
|
77
|
+
c(n.csv, n.filename), e.success(x.exportSuccessToast, {
|
|
78
78
|
id: t,
|
|
79
|
-
duration:
|
|
79
|
+
duration: fe
|
|
80
80
|
});
|
|
81
81
|
} catch {
|
|
82
|
-
e.error(
|
|
82
|
+
e.error(x.exportErrorToast, {
|
|
83
83
|
id: t,
|
|
84
|
-
duration:
|
|
84
|
+
duration: pe
|
|
85
85
|
});
|
|
86
86
|
}
|
|
87
87
|
}, [
|
|
88
|
-
|
|
88
|
+
y,
|
|
89
89
|
G,
|
|
90
90
|
z,
|
|
91
91
|
L,
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
]), Q =
|
|
92
|
+
x.exportErrorToast,
|
|
93
|
+
x.exportLoadingToast,
|
|
94
|
+
x.exportSuccessToast,
|
|
95
|
+
E,
|
|
96
|
+
D.canRead
|
|
97
|
+
]), Q = g(async (t, n) => {
|
|
98
98
|
if (!await ne(t)) return;
|
|
99
99
|
let r = {
|
|
100
|
-
account:
|
|
101
|
-
routing:
|
|
102
|
-
bankName:
|
|
103
|
-
bankAddress:
|
|
100
|
+
account: x.copyAccountNumberToast,
|
|
101
|
+
routing: x.copyRoutingNumberToast,
|
|
102
|
+
bankName: x.copyBankNameToast,
|
|
103
|
+
bankAddress: x.copyBankAddressToast
|
|
104
104
|
};
|
|
105
105
|
if (e.success(r[n]), n === "account") {
|
|
106
106
|
P(!0), window.setTimeout(() => P(!1), 2e3);
|
|
@@ -108,89 +108,89 @@ function b({ accountId: b, onBack: me, labels: he, featureLabels: ge, isBankingT
|
|
|
108
108
|
}
|
|
109
109
|
n === "routing" && (F(!0), window.setTimeout(() => F(!1), 2e3));
|
|
110
110
|
}, [
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
111
|
+
x.copyAccountNumberToast,
|
|
112
|
+
x.copyBankAddressToast,
|
|
113
|
+
x.copyBankNameToast,
|
|
114
|
+
x.copyRoutingNumberToast
|
|
115
115
|
]), $ = (e) => {
|
|
116
116
|
e && (N({ nickname: K?.nickname?.trim() ?? "" }), W()), j(e);
|
|
117
117
|
};
|
|
118
|
-
return /* @__PURE__ */
|
|
119
|
-
labels:
|
|
120
|
-
title:
|
|
118
|
+
return /* @__PURE__ */ de(le, {
|
|
119
|
+
labels: b,
|
|
120
|
+
title: Ve,
|
|
121
121
|
bankDisplayName: q,
|
|
122
|
-
bankLogoSrc:
|
|
123
|
-
bankLogoAlt:
|
|
124
|
-
balanceLabel:
|
|
122
|
+
bankLogoSrc: ye,
|
|
123
|
+
bankLogoAlt: be,
|
|
124
|
+
balanceLabel: He,
|
|
125
125
|
balanceTestId: "bank-accounts-widget-detail-balance",
|
|
126
|
-
isBankingTaglineVisible:
|
|
126
|
+
isBankingTaglineVisible: ve,
|
|
127
127
|
activeTab: A,
|
|
128
128
|
transactionRows: Z,
|
|
129
|
-
showExport:
|
|
130
|
-
isExportOpen:
|
|
129
|
+
showExport: Ue,
|
|
130
|
+
isExportOpen: Ne,
|
|
131
131
|
exportStartDate: L,
|
|
132
132
|
exportEndDate: z,
|
|
133
|
-
isExportDownloading:
|
|
134
|
-
isExportDownloadDisabled:
|
|
135
|
-
disabledExportStartDates:
|
|
136
|
-
disabledExportEndDates:
|
|
133
|
+
isExportDownloading: Re,
|
|
134
|
+
isExportDownloadDisabled: We,
|
|
135
|
+
disabledExportStartDates: Ge,
|
|
136
|
+
disabledExportEndDates: Ke,
|
|
137
137
|
accountNumberLabel: K?.accountNumber ?? "",
|
|
138
138
|
maskedAccountNumberLabel: ae(K?.accountNumber ?? ""),
|
|
139
139
|
accountNumberTestId: "bank-accounts-widget-detail-account-number",
|
|
140
140
|
wireAccountNumberLabel: K?.accountNumber ?? "",
|
|
141
141
|
routingNumberLabel: K?.routingNumber ?? "",
|
|
142
142
|
bankAddressLabel: J,
|
|
143
|
-
domesticWireIntroLabel:
|
|
144
|
-
domesticWireNoteLabel:
|
|
145
|
-
thingsToKnowBodyLabel:
|
|
146
|
-
supportTeamHref:
|
|
147
|
-
isAccountNumberVisible:
|
|
148
|
-
isAccountNumberCopied:
|
|
149
|
-
isRoutingNumberCopied:
|
|
150
|
-
isDomesticWireExpanded:
|
|
151
|
-
isLoading: !
|
|
152
|
-
isError:
|
|
153
|
-
isEditOpen:
|
|
154
|
-
isEditDisabled: !
|
|
143
|
+
domesticWireIntroLabel: ze,
|
|
144
|
+
domesticWireNoteLabel: Be,
|
|
145
|
+
thingsToKnowBodyLabel: X,
|
|
146
|
+
supportTeamHref: Se,
|
|
147
|
+
isAccountNumberVisible: De,
|
|
148
|
+
isAccountNumberCopied: ke,
|
|
149
|
+
isRoutingNumberCopied: Ae,
|
|
150
|
+
isDomesticWireExpanded: je,
|
|
151
|
+
isLoading: !T && (!E && !(C && K) || w && !C || k && (V.isLoading || A === "transactions" && H.isLoading)),
|
|
152
|
+
isError: T || k && (V.isError || A === "transactions" && H.isError),
|
|
153
|
+
isEditOpen: Ee,
|
|
154
|
+
isEditDisabled: !D.canWrite,
|
|
155
155
|
isEditError: U,
|
|
156
|
-
isSubmitting:
|
|
156
|
+
isSubmitting: Le,
|
|
157
157
|
editForm: M,
|
|
158
|
-
canEdit:
|
|
159
|
-
onBack:
|
|
160
|
-
onTabChange:
|
|
161
|
-
onToggleAccountNumberVisibility: () =>
|
|
158
|
+
canEdit: D.canWrite,
|
|
159
|
+
onBack: he,
|
|
160
|
+
onTabChange: Te,
|
|
161
|
+
onToggleAccountNumberVisibility: () => Oe((e) => !e),
|
|
162
162
|
onCopyAccountNumber: () => void Q(K?.accountNumber ?? "", "account"),
|
|
163
163
|
onCopyRoutingNumber: () => void Q(K?.routingNumber ?? "", "routing"),
|
|
164
164
|
onCopyBankName: () => void Q(q, "bankName"),
|
|
165
165
|
onCopyBankAddress: () => void Q(J ?? "", "bankAddress"),
|
|
166
|
-
onDomesticWireExpandedChange:
|
|
166
|
+
onDomesticWireExpandedChange: Me,
|
|
167
167
|
onEditOpenChange: $,
|
|
168
168
|
onEditFormChange: (e) => {
|
|
169
169
|
U && W(), N(e);
|
|
170
170
|
},
|
|
171
171
|
onEditSubmit: () => {
|
|
172
|
-
if (!
|
|
172
|
+
if (!E || !D.canWrite) return;
|
|
173
173
|
let t = M.nickname.trim();
|
|
174
|
-
t &&
|
|
175
|
-
path: { id:
|
|
174
|
+
t && Ie({
|
|
175
|
+
path: { id: y },
|
|
176
176
|
body: { nickname: t }
|
|
177
177
|
}, {
|
|
178
178
|
onSuccess: () => {
|
|
179
|
-
|
|
179
|
+
S(i.AccountUpdated, { accountId: y }), e.success(x.editSuccessToast), j(!1);
|
|
180
180
|
},
|
|
181
181
|
onError: () => {
|
|
182
|
-
e.error(
|
|
182
|
+
e.error(x.editErrorToast);
|
|
183
183
|
}
|
|
184
184
|
});
|
|
185
185
|
},
|
|
186
186
|
onEditNicknameClick: () => $(!0),
|
|
187
|
-
onExportOpenChange:
|
|
187
|
+
onExportOpenChange: qe,
|
|
188
188
|
onExportStartDateChange: R,
|
|
189
189
|
onExportEndDateChange: B,
|
|
190
190
|
onExportDownload: () => {
|
|
191
|
-
|
|
191
|
+
Je();
|
|
192
192
|
}
|
|
193
193
|
});
|
|
194
194
|
}
|
|
195
195
|
//#endregion
|
|
196
|
-
export {
|
|
196
|
+
export { y as AccountDetailsWidget };
|
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.128", n = "6c38915889a61343c6db7abd8a772c5eb25831fe", r = Object.freeze({
|
|
3
3
|
library_name: e,
|
|
4
4
|
library_version: t,
|
|
5
5
|
library_sha: n
|