@tesouro/embedded-components-react 0.9.41 → 0.9.44
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/experimental/ApprovalRequests.d.ts +15 -1
- package/dist/experimental/index.d.ts +15 -1
- package/dist/libs/tesouro-embedded-components-react/approval-requests-widget/data-access/dist/index.js +5 -5
- package/dist/libs/tesouro-embedded-components-react/approval-requests-widget/data-access/dist/index2.js +9 -0
- package/dist/libs/tesouro-embedded-components-react/approval-requests-widget/data-access/dist/index4.js +29 -2
- package/dist/libs/tesouro-embedded-components-react/approval-requests-widget/data-access/dist/index5.js +30 -2
- package/dist/libs/tesouro-embedded-components-react/approval-requests-widget/feature/dist/lib/ApprovalRequestsWidget/ApprovalRequestsWidget.js +45 -35
- package/dist/libs/tesouro-embedded-components-react/approval-requests-widget/feature/dist/lib/ApprovalRequestsWidget/buildApprovalRequestRows.js +17 -14
- package/dist/libs/tesouro-embedded-components-react/approval-requests-widget/feature/dist/lib/ApprovalRequestsWidget/canDecideApprovalRequest.js +8 -0
- package/dist/libs/tesouro-embedded-components-react/approval-requests-widget/feature/dist/lib/ApprovalRequestsWidget/useApprovalRequestDecisions.js +76 -0
- package/dist/libs/tesouro-embedded-components-react/approval-requests-widget/feature/dist/lib/ApprovalRequestsWidget/useApprovalRequestsFilters.js +4 -4
- package/dist/libs/tesouro-embedded-components-react/approval-requests-widget/feature/dist/lib/ApprovalRequestsWidget/useApprovalRequestsTable.js +53 -44
- package/dist/libs/tesouro-embedded-components-react/approval-requests-widget/ui/dist/index.js +2 -1
- package/dist/libs/tesouro-embedded-components-react/approval-requests-widget/ui/dist/index2.js +13 -1
- package/dist/libs/tesouro-embedded-components-react/approval-requests-widget/ui/dist/index4.js +91 -58
- package/dist/libs/tesouro-embedded-components-react/approval-requests-widget/ui/dist/index5.js +44 -0
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/feature/dist/index9.js +159 -158
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-upload/feature/dist/index3.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-upload/feature/dist/index4.js +57 -52
- 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/feature/dist/lib/analytics/expectedApiUnprocessable.js +7 -0
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/interceptor.js +41 -38
- package/dist/packages/shared-ui-shadcn/dist/index.js +3432 -3332
- package/package.json +1 -1
|
@@ -5,18 +5,19 @@
|
|
|
5
5
|
import { toast as e } from "../../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
6
6
|
import { isOrganizationOnItsWay as t } from "../../../../shared/data-access/dist/lib/organizationStatus.js";
|
|
7
7
|
import { useEmbedApi as n } from "../../../../shared/data-access/dist/lib/EmbedApiContext.js";
|
|
8
|
+
import { isApiUnprocessableError as r } from "../../../../shared/data-access/dist/lib/isApiUnprocessableError.js";
|
|
8
9
|
import "../../../../shared/data-access/dist/index.js";
|
|
9
10
|
import "../../../../shared/ui/dist/index.js";
|
|
10
|
-
import { useAnalyticsTrack as
|
|
11
|
-
import { useWidgetConfig as
|
|
11
|
+
import { useAnalyticsTrack as ee } from "../../../../shared/feature/dist/lib/analytics/hooks.js";
|
|
12
|
+
import { useWidgetConfig as te, useWidgetError as ne, useWidgetLoading as re } from "../../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
|
|
12
13
|
import "../../../../shared/feature/dist/index.js";
|
|
13
14
|
import { AccountDetailsWidgetAnalyticsEvent as i } from "./index2.js";
|
|
14
|
-
import { formatDateParam as
|
|
15
|
-
import { copyTextToClipboard as oe, formatAmountLabel as
|
|
15
|
+
import { formatDateParam as a, getDefaultExportDateRange as ie, isExportRangeValid as o, startOfLocalDay as s, triggerCsvDownload as ae, yesterdayLocal as c } from "./index3.js";
|
|
16
|
+
import { copyTextToClipboard as oe, formatAmountLabel as l, formatSignedTransactionAmountLabel as se, formatStatementPeriodLabel as ce, formatTransactionDateLabel as le, maskAccountNumber as ue } from "./index4.js";
|
|
16
17
|
import { DEFAULT_FEATURE_LABELS as de } from "./index5.js";
|
|
17
18
|
import { getBankAccountsPermissions as fe } from "./index6.js";
|
|
18
19
|
import { getStatementsStartDate as pe } from "./index7.js";
|
|
19
|
-
import { interpolateLabel as
|
|
20
|
+
import { interpolateLabel as u } from "./index8.js";
|
|
20
21
|
import { useBankAccountDetailsQuery as me } from "../../data-access/dist/index2.js";
|
|
21
22
|
import { useBankAccountStatementsQuery as he } from "../../data-access/dist/index3.js";
|
|
22
23
|
import { useBankAccountTransactionsQuery as ge } from "../../data-access/dist/index4.js";
|
|
@@ -27,7 +28,7 @@ import "../../data-access/dist/index.js";
|
|
|
27
28
|
import { DEFAULT_LABELS as be } from "../../ui/dist/index7.js";
|
|
28
29
|
import { AccountDetailsWidgetUi as xe } from "../../ui/dist/index8.js";
|
|
29
30
|
import "../../ui/dist/index.js";
|
|
30
|
-
import { useCallback as
|
|
31
|
+
import { useCallback as d, useEffect as Se, useMemo as f, useState as p } from "react";
|
|
31
32
|
import { jsx as Ce } from "react/jsx-runtime";
|
|
32
33
|
//#region ../../libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/feature/dist/index9.js
|
|
33
34
|
var we = 3e3, Te = 5e3, Ee = [
|
|
@@ -35,255 +36,255 @@ var we = 3e3, Te = 5e3, Ee = [
|
|
|
35
36
|
25,
|
|
36
37
|
50
|
|
37
38
|
], De = 10, Oe = 6e5, ke = { nickname: "" };
|
|
38
|
-
function
|
|
39
|
-
let
|
|
39
|
+
function m({ accountId: m, onBack: Ae, labels: je, featureLabels: Me, isBankingTaglineVisible: Ne = !0, bankLogoSrc: Pe, bankLogoAlt: Fe, bankAddress: Ie, supportTeamUrl: Le }) {
|
|
40
|
+
let h = {
|
|
40
41
|
...be,
|
|
41
42
|
...je
|
|
42
|
-
},
|
|
43
|
+
}, g = {
|
|
43
44
|
...de,
|
|
44
45
|
...Me
|
|
45
|
-
},
|
|
46
|
-
accountId:
|
|
46
|
+
}, _ = ee(), { organizationId: Re, widgetToken: ze, initResponse: v } = te(), Be = re(), Ve = t(n().organizationStatus), y = !!ne(), b = !!(Re && ze), x = f(() => fe(v?.scopes), [v?.scopes]), S = x.canRead && !!v, C = b && S, w = S && !b, [T, He] = p("transactions"), [Ue, E] = p(!1), [D, O] = p(ke), [We, Ge] = p(!1), [Ke, k] = p(!1), [qe, A] = p(!1), [Je, Ye] = p(!1), [Xe, j] = p(!1), [M, N] = p(), [P, F] = p(), [I, Ze] = p(De), [L, R] = p(() => ({
|
|
47
|
+
accountId: m,
|
|
47
48
|
token: void 0
|
|
48
49
|
}));
|
|
49
|
-
|
|
50
|
-
accountId:
|
|
50
|
+
L.accountId !== m && R({
|
|
51
|
+
accountId: m,
|
|
51
52
|
token: void 0
|
|
52
53
|
});
|
|
53
|
-
let
|
|
54
|
-
|
|
54
|
+
let Qe = L.accountId === m ? L.token : void 0, z = d((e) => {
|
|
55
|
+
R((t) => ({
|
|
55
56
|
...t,
|
|
56
57
|
token: e
|
|
57
58
|
}));
|
|
58
|
-
}, []), [
|
|
59
|
+
}, []), [B, V] = p(() => /* @__PURE__ */ new Set());
|
|
59
60
|
Se(() => {
|
|
60
|
-
|
|
61
|
-
}, [
|
|
62
|
-
let
|
|
63
|
-
id:
|
|
64
|
-
enabled:
|
|
65
|
-
}),
|
|
66
|
-
id:
|
|
67
|
-
enabled:
|
|
61
|
+
_(i.Mounted);
|
|
62
|
+
}, [_]);
|
|
63
|
+
let H = me({
|
|
64
|
+
id: m,
|
|
65
|
+
enabled: C
|
|
66
|
+
}), U = ge({
|
|
67
|
+
id: m,
|
|
68
|
+
enabled: C && T === "transactions",
|
|
68
69
|
limit: 25,
|
|
69
70
|
sortBy: "DATE",
|
|
70
71
|
sortOrder: "DESC"
|
|
71
|
-
}), [
|
|
72
|
-
id:
|
|
73
|
-
startDate:
|
|
74
|
-
enabled:
|
|
75
|
-
limit:
|
|
76
|
-
pagination_token:
|
|
72
|
+
}), [$e] = p(pe), W = he({
|
|
73
|
+
id: m,
|
|
74
|
+
startDate: $e,
|
|
75
|
+
enabled: C && T === "statements",
|
|
76
|
+
limit: I,
|
|
77
|
+
pagination_token: Qe,
|
|
77
78
|
category: "STATEMENTS"
|
|
78
|
-
}),
|
|
79
|
+
}), et = ye(), tt = _e(), nt = ve(), { mutate: rt, isPending: it, isError: G, reset: K } = et, { mutateAsync: at, isPending: ot } = tt, { mutateAsync: st } = nt, q = S ? H.data : void 0, J = v?.bankName?.trim() ?? "", ct = Ie?.trim() || void 0, Y = { bankName: J }, lt = f(() => u(h.domesticWireIntro, Y), [h.domesticWireIntro, J]), ut = f(() => u(h.domesticWireNote, Y), [h.domesticWireNote, J]), dt = f(() => u(h.thingsToKnowBody, Y), [h.thingsToKnowBody, J]), ft = q?.nickname?.trim() || g.accountFallback, pt = l(q?.balance), mt = f(() => (U.data?.data ?? []).map((e, t) => ({
|
|
79
80
|
key: `${e.date}-${t}`,
|
|
80
81
|
descriptionLabel: e.description,
|
|
81
82
|
dateLabel: le(e.date),
|
|
82
83
|
amountLabel: se(e.amount, e.direction),
|
|
83
84
|
amountVariant: e.direction === "CREDIT" ? "positive" : "default",
|
|
84
|
-
balanceLabel:
|
|
85
|
-
})), [
|
|
86
|
-
if (!
|
|
85
|
+
balanceLabel: l(e.runningBalance)
|
|
86
|
+
})), [U.data?.data]), ht = x.canRead && mt.length > 0, gt = d((t) => {
|
|
87
|
+
if (!b || !x.canRead) return;
|
|
87
88
|
let n = window.open("", "_blank");
|
|
88
89
|
if (!n) {
|
|
89
|
-
e.error(
|
|
90
|
+
e.error(g.viewStatementErrorToast);
|
|
90
91
|
return;
|
|
91
92
|
}
|
|
92
|
-
n.opener = null,
|
|
93
|
-
id:
|
|
93
|
+
n.opener = null, V((e) => new Set(e).add(t)), st({
|
|
94
|
+
id: m,
|
|
94
95
|
statementId: t
|
|
95
96
|
}).then((e) => {
|
|
96
97
|
let t = URL.createObjectURL(e);
|
|
97
98
|
n.location.href = t, window.setTimeout(() => URL.revokeObjectURL(t), Oe);
|
|
98
99
|
}).catch(() => {
|
|
99
|
-
n.close(), e.error(
|
|
100
|
+
n.close(), e.error(g.viewStatementErrorToast);
|
|
100
101
|
}).finally(() => {
|
|
101
|
-
|
|
102
|
+
V((e) => {
|
|
102
103
|
if (!e.has(t)) return e;
|
|
103
104
|
let n = new Set(e);
|
|
104
105
|
return n.delete(t), n;
|
|
105
106
|
});
|
|
106
107
|
});
|
|
107
108
|
}, [
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
]),
|
|
109
|
+
m,
|
|
110
|
+
g.viewStatementErrorToast,
|
|
111
|
+
b,
|
|
112
|
+
x.canRead,
|
|
113
|
+
st
|
|
114
|
+
]), _t = f(() => (W.data?.data ?? []).map((e) => {
|
|
114
115
|
let t = ce(e.statementDate);
|
|
115
116
|
return {
|
|
116
117
|
key: e.statementId,
|
|
117
118
|
label: t,
|
|
118
|
-
viewButtonAriaLabel:
|
|
119
|
-
isViewDisabled:
|
|
120
|
-
onView: () =>
|
|
119
|
+
viewButtonAriaLabel: u(h.viewStatementButtonAriaLabel, { date: t }),
|
|
120
|
+
isViewDisabled: B.has(e.statementId),
|
|
121
|
+
onView: () => gt(e.statementId)
|
|
121
122
|
};
|
|
122
123
|
}), [
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
]),
|
|
128
|
-
|
|
129
|
-
}, [
|
|
130
|
-
|
|
131
|
-
}, []),
|
|
132
|
-
|
|
133
|
-
}, [
|
|
134
|
-
|
|
135
|
-
}, [
|
|
136
|
-
let e = [{ after:
|
|
137
|
-
return
|
|
138
|
-
}, [
|
|
139
|
-
let e = [{ after:
|
|
140
|
-
return
|
|
141
|
-
}, [
|
|
124
|
+
W.data?.data,
|
|
125
|
+
h.viewStatementButtonAriaLabel,
|
|
126
|
+
B,
|
|
127
|
+
gt
|
|
128
|
+
]), X = W.data?.nextPaginationToken ?? void 0, Z = W.data?.prevPaginationToken ?? void 0, vt = C && T === "statements" && !!W.data && !W.isError, yt = C && T === "statements" && W.isLoading, bt = C && T === "statements" && W.isError && !r(W.error), xt = d(() => {
|
|
129
|
+
W.refetch();
|
|
130
|
+
}, [W.refetch]), St = d((e) => {
|
|
131
|
+
Ze(e), z(void 0);
|
|
132
|
+
}, []), Ct = d(() => {
|
|
133
|
+
z(Z);
|
|
134
|
+
}, [Z]), wt = d(() => {
|
|
135
|
+
z(X);
|
|
136
|
+
}, [X]), Tt = w || !o(M, P), Et = f(() => {
|
|
137
|
+
let e = [{ after: c() }];
|
|
138
|
+
return P && e.push({ after: s(P) }), e;
|
|
139
|
+
}, [P]), Dt = f(() => {
|
|
140
|
+
let e = [{ after: c() }];
|
|
141
|
+
return M && e.push({ before: s(M) }), e;
|
|
142
|
+
}, [M]), Ot = d((e) => {
|
|
142
143
|
if (e) {
|
|
143
144
|
let { startDate: e, endDate: t } = ie();
|
|
144
|
-
|
|
145
|
+
N(e), F(t);
|
|
145
146
|
}
|
|
146
|
-
|
|
147
|
-
}, []),
|
|
148
|
-
if (!
|
|
149
|
-
|
|
150
|
-
let t = e.loading(
|
|
147
|
+
j(e);
|
|
148
|
+
}, []), kt = d(async () => {
|
|
149
|
+
if (!b || !x.canRead || !M || !P || !o(M, P)) return;
|
|
150
|
+
j(!1);
|
|
151
|
+
let t = e.loading(g.exportLoadingToast);
|
|
151
152
|
try {
|
|
152
|
-
let n = await
|
|
153
|
-
id:
|
|
154
|
-
startDate:
|
|
155
|
-
endDate:
|
|
153
|
+
let n = await at({
|
|
154
|
+
id: m,
|
|
155
|
+
startDate: a(M),
|
|
156
|
+
endDate: a(P)
|
|
156
157
|
});
|
|
157
|
-
ae(n.csv, n.filename), e.success(
|
|
158
|
+
ae(n.csv, n.filename), e.success(g.exportSuccessToast, {
|
|
158
159
|
id: t,
|
|
159
160
|
duration: we
|
|
160
161
|
});
|
|
161
162
|
} catch {
|
|
162
|
-
e.error(
|
|
163
|
+
e.error(g.exportErrorToast, {
|
|
163
164
|
id: t,
|
|
164
165
|
duration: Te
|
|
165
166
|
});
|
|
166
167
|
}
|
|
167
168
|
}, [
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
]),
|
|
169
|
+
m,
|
|
170
|
+
at,
|
|
171
|
+
P,
|
|
172
|
+
M,
|
|
173
|
+
g.exportErrorToast,
|
|
174
|
+
g.exportLoadingToast,
|
|
175
|
+
g.exportSuccessToast,
|
|
176
|
+
b,
|
|
177
|
+
x.canRead
|
|
178
|
+
]), Q = d(async (t, n) => {
|
|
178
179
|
if (!await oe(t)) return;
|
|
179
180
|
let r = {
|
|
180
|
-
account:
|
|
181
|
-
routing:
|
|
182
|
-
bankName:
|
|
183
|
-
bankAddress:
|
|
181
|
+
account: g.copyAccountNumberToast,
|
|
182
|
+
routing: g.copyRoutingNumberToast,
|
|
183
|
+
bankName: g.copyBankNameToast,
|
|
184
|
+
bankAddress: g.copyBankAddressToast
|
|
184
185
|
};
|
|
185
186
|
if (e.success(r[n]), n === "account") {
|
|
186
|
-
|
|
187
|
+
k(!0), window.setTimeout(() => k(!1), 2e3);
|
|
187
188
|
return;
|
|
188
189
|
}
|
|
189
|
-
n === "routing" && (
|
|
190
|
+
n === "routing" && (A(!0), window.setTimeout(() => A(!1), 2e3));
|
|
190
191
|
}, [
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
]),
|
|
196
|
-
e && (
|
|
192
|
+
g.copyAccountNumberToast,
|
|
193
|
+
g.copyBankAddressToast,
|
|
194
|
+
g.copyBankNameToast,
|
|
195
|
+
g.copyRoutingNumberToast
|
|
196
|
+
]), $ = (e) => {
|
|
197
|
+
e && (O({ nickname: q?.nickname?.trim() ?? "" }), K()), E(e);
|
|
197
198
|
};
|
|
198
199
|
return /* @__PURE__ */ Ce(xe, {
|
|
199
|
-
labels:
|
|
200
|
+
labels: h,
|
|
200
201
|
title: ft,
|
|
201
|
-
bankDisplayName:
|
|
202
|
+
bankDisplayName: J,
|
|
202
203
|
bankLogoSrc: Pe,
|
|
203
204
|
bankLogoAlt: Fe,
|
|
204
205
|
balanceLabel: pt,
|
|
205
206
|
balanceTestId: "bank-accounts-widget-detail-balance",
|
|
206
207
|
isBankingTaglineVisible: Ne,
|
|
207
|
-
activeTab:
|
|
208
|
-
transactionRows:
|
|
209
|
-
statementRows:
|
|
210
|
-
isStatementsLoading:
|
|
211
|
-
isStatementsError:
|
|
212
|
-
onStatementsRetry:
|
|
213
|
-
isStatementsPaginationVisible:
|
|
214
|
-
statementsPageSize:
|
|
208
|
+
activeTab: T,
|
|
209
|
+
transactionRows: mt,
|
|
210
|
+
statementRows: _t,
|
|
211
|
+
isStatementsLoading: yt,
|
|
212
|
+
isStatementsError: bt,
|
|
213
|
+
onStatementsRetry: xt,
|
|
214
|
+
isStatementsPaginationVisible: vt,
|
|
215
|
+
statementsPageSize: I,
|
|
215
216
|
statementsPageSizeOptions: Ee,
|
|
216
|
-
isStatementsPreviousPageDisabled: !
|
|
217
|
-
isStatementsNextPageDisabled: !
|
|
218
|
-
onStatementsPageSizeChange:
|
|
219
|
-
onStatementsPreviousPageClick:
|
|
220
|
-
onStatementsNextPageClick:
|
|
221
|
-
showExport:
|
|
222
|
-
isExportOpen:
|
|
223
|
-
exportStartDate:
|
|
224
|
-
exportEndDate:
|
|
225
|
-
isExportDownloading:
|
|
226
|
-
isExportDownloadDisabled:
|
|
227
|
-
disabledExportStartDates:
|
|
228
|
-
disabledExportEndDates:
|
|
229
|
-
accountNumberLabel:
|
|
230
|
-
maskedAccountNumberLabel: ue(
|
|
217
|
+
isStatementsPreviousPageDisabled: !Z,
|
|
218
|
+
isStatementsNextPageDisabled: !X,
|
|
219
|
+
onStatementsPageSizeChange: St,
|
|
220
|
+
onStatementsPreviousPageClick: Ct,
|
|
221
|
+
onStatementsNextPageClick: wt,
|
|
222
|
+
showExport: ht,
|
|
223
|
+
isExportOpen: Xe,
|
|
224
|
+
exportStartDate: M,
|
|
225
|
+
exportEndDate: P,
|
|
226
|
+
isExportDownloading: ot,
|
|
227
|
+
isExportDownloadDisabled: Tt,
|
|
228
|
+
disabledExportStartDates: Et,
|
|
229
|
+
disabledExportEndDates: Dt,
|
|
230
|
+
accountNumberLabel: q?.accountNumber ?? "",
|
|
231
|
+
maskedAccountNumberLabel: ue(q?.accountNumber ?? ""),
|
|
231
232
|
accountNumberTestId: "bank-accounts-widget-detail-account-number",
|
|
232
|
-
wireAccountNumberLabel:
|
|
233
|
-
routingNumberLabel:
|
|
234
|
-
bankAddressLabel:
|
|
233
|
+
wireAccountNumberLabel: q?.accountNumber ?? "",
|
|
234
|
+
routingNumberLabel: q?.routingNumber ?? "",
|
|
235
|
+
bankAddressLabel: ct,
|
|
235
236
|
domesticWireIntroLabel: lt,
|
|
236
237
|
domesticWireNoteLabel: ut,
|
|
237
238
|
thingsToKnowBodyLabel: dt,
|
|
238
239
|
supportTeamHref: Le,
|
|
239
240
|
isAccountNumberVisible: We,
|
|
240
241
|
isAccountNumberCopied: Ke,
|
|
241
|
-
isRoutingNumberCopied:
|
|
242
|
-
isDomesticWireExpanded:
|
|
243
|
-
isLoading: !
|
|
244
|
-
isError:
|
|
242
|
+
isRoutingNumberCopied: qe,
|
|
243
|
+
isDomesticWireExpanded: Je,
|
|
244
|
+
isLoading: !y && (Ve && !q || Be && !v || C && (H.isLoading || T === "transactions" && U.isLoading)),
|
|
245
|
+
isError: y || C && (H.isError || T === "transactions" && U.isError),
|
|
245
246
|
isEditOpen: Ue,
|
|
246
|
-
isEditDisabled: !
|
|
247
|
-
isEditError:
|
|
248
|
-
isSubmitting:
|
|
249
|
-
isEditSaveDisabled:
|
|
250
|
-
editForm:
|
|
251
|
-
canEdit:
|
|
247
|
+
isEditDisabled: !x.canWrite,
|
|
248
|
+
isEditError: G,
|
|
249
|
+
isSubmitting: it,
|
|
250
|
+
isEditSaveDisabled: w,
|
|
251
|
+
editForm: D,
|
|
252
|
+
canEdit: x.canWrite,
|
|
252
253
|
onBack: Ae,
|
|
253
254
|
onTabChange: He,
|
|
254
255
|
onToggleAccountNumberVisibility: () => Ge((e) => !e),
|
|
255
|
-
onCopyAccountNumber: () => void
|
|
256
|
-
onCopyRoutingNumber: () => void
|
|
257
|
-
onCopyBankName: () => void
|
|
258
|
-
onCopyBankAddress: () => void
|
|
259
|
-
onDomesticWireExpandedChange:
|
|
260
|
-
onEditOpenChange:
|
|
256
|
+
onCopyAccountNumber: () => void Q(q?.accountNumber ?? "", "account"),
|
|
257
|
+
onCopyRoutingNumber: () => void Q(q?.routingNumber ?? "", "routing"),
|
|
258
|
+
onCopyBankName: () => void Q(J, "bankName"),
|
|
259
|
+
onCopyBankAddress: () => void Q(ct ?? "", "bankAddress"),
|
|
260
|
+
onDomesticWireExpandedChange: Ye,
|
|
261
|
+
onEditOpenChange: $,
|
|
261
262
|
onEditFormChange: (e) => {
|
|
262
|
-
|
|
263
|
+
G && K(), O(e);
|
|
263
264
|
},
|
|
264
265
|
onEditSubmit: () => {
|
|
265
|
-
if (!
|
|
266
|
-
let t =
|
|
267
|
-
t &&
|
|
268
|
-
path: { id:
|
|
266
|
+
if (!b || !x.canWrite) return;
|
|
267
|
+
let t = D.nickname.trim();
|
|
268
|
+
t && rt({
|
|
269
|
+
path: { id: m },
|
|
269
270
|
body: { nickname: t }
|
|
270
271
|
}, {
|
|
271
272
|
onSuccess: () => {
|
|
272
|
-
|
|
273
|
+
_(i.AccountUpdated, { accountId: m }), e.success(g.editSuccessToast), E(!1);
|
|
273
274
|
},
|
|
274
275
|
onError: () => {
|
|
275
|
-
e.error(
|
|
276
|
+
e.error(g.editErrorToast);
|
|
276
277
|
}
|
|
277
278
|
});
|
|
278
279
|
},
|
|
279
|
-
onEditNicknameClick: () =>
|
|
280
|
-
onExportOpenChange:
|
|
281
|
-
onExportStartDateChange:
|
|
282
|
-
onExportEndDateChange:
|
|
280
|
+
onEditNicknameClick: () => $(!0),
|
|
281
|
+
onExportOpenChange: Ot,
|
|
282
|
+
onExportStartDateChange: N,
|
|
283
|
+
onExportEndDateChange: F,
|
|
283
284
|
onExportDownload: () => {
|
|
284
|
-
|
|
285
|
+
kt();
|
|
285
286
|
}
|
|
286
287
|
});
|
|
287
288
|
}
|
|
288
289
|
//#endregion
|
|
289
|
-
export {
|
|
290
|
+
export { m as AccountDetailsWidget };
|
|
@@ -7,6 +7,7 @@ var e = {
|
|
|
7
7
|
failedCaption: (e) => `${e} failed to upload`,
|
|
8
8
|
tooManyFilesError: (e) => `You can only upload up to ${e} files at a time`,
|
|
9
9
|
remainingCapacityError: (e) => e === 0 ? "Wait for the current uploads to finish before adding more files" : `You can upload ${e} more ${e === 1 ? "file" : "files"} right now`,
|
|
10
|
+
fileTooLargeError: (e) => `Each file must be ${e} MB or smaller`,
|
|
10
11
|
billDeletedError: "This bill was already deleted"
|
|
11
12
|
};
|
|
12
13
|
//#endregion
|
|
@@ -23,110 +23,115 @@ function g({ onOpenBill: g, labels: _ } = {}) {
|
|
|
23
23
|
let v = {
|
|
24
24
|
...s,
|
|
25
25
|
..._
|
|
26
|
-
}, y = _?.tooManyFilesError ?? s.tooManyFilesError, b = _?.remainingCapacityError ?? s.remainingCapacityError, { client:
|
|
27
|
-
queryKey:
|
|
28
|
-
queryFn: () =>
|
|
26
|
+
}, y = _?.tooManyFilesError ?? s.tooManyFilesError, b = _?.remainingCapacityError ?? s.remainingCapacityError, x = _?.fileTooLargeError ?? s.fileTooLargeError, { client: S, organizationId: C, authEpoch: w, organizationStatus: T } = r(), E = h(), D = f(() => o(C), [C]), O = l(), [k, A] = p(!1), { data: j = [] } = m({
|
|
27
|
+
queryKey: D,
|
|
28
|
+
queryFn: () => E.getQueryData(D) ?? [],
|
|
29
29
|
staleTime: Infinity,
|
|
30
30
|
gcTime: Infinity,
|
|
31
31
|
initialData: []
|
|
32
|
-
}),
|
|
33
|
-
|
|
32
|
+
}), M = u((e, t) => {
|
|
33
|
+
E.setQueryData(D, (n) => (n ?? []).map((n) => n.localId === e ? {
|
|
34
34
|
...n,
|
|
35
35
|
...t
|
|
36
36
|
} : n));
|
|
37
|
-
}, [
|
|
38
|
-
|
|
39
|
-
}, [
|
|
40
|
-
let n = (
|
|
37
|
+
}, [E, D]), N = u((e) => {
|
|
38
|
+
E.setQueryData(D, (t) => (t ?? []).filter((t) => t.localId !== e));
|
|
39
|
+
}, [E, D]), P = u((t) => {
|
|
40
|
+
let n = (E.getQueryData(D) ?? []).filter((e) => e.status === "uploading").length;
|
|
41
41
|
if (t.length + n > 10) {
|
|
42
42
|
e.error(n > 0 ? b(10 - n) : y(10));
|
|
43
43
|
return;
|
|
44
44
|
}
|
|
45
|
-
|
|
45
|
+
if (t.some((e) => e.size > 20971520)) {
|
|
46
|
+
e.error(x(20));
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
A(!1);
|
|
46
50
|
for (let e of t) {
|
|
47
51
|
let t = crypto.randomUUID();
|
|
48
|
-
|
|
52
|
+
E.setQueryData(D, (n) => [...n ?? [], {
|
|
49
53
|
localId: t,
|
|
50
54
|
fileName: e.name,
|
|
51
55
|
status: "uploading"
|
|
52
|
-
}]),
|
|
56
|
+
}]), O.mutateAsync({ file: e }).then((e) => M(t, { payableId: e?.id })).catch(() => M(t, { status: "failed" }));
|
|
53
57
|
}
|
|
54
58
|
}, [
|
|
55
|
-
|
|
56
|
-
|
|
59
|
+
x,
|
|
60
|
+
M,
|
|
57
61
|
E,
|
|
62
|
+
D,
|
|
58
63
|
b,
|
|
59
64
|
y,
|
|
60
|
-
|
|
61
|
-
]),
|
|
65
|
+
O
|
|
66
|
+
]), F = c({ payableIds: j.filter((e) => e.status === "uploading" && e.payableId).map((e) => e.payableId) });
|
|
62
67
|
d(() => {
|
|
63
68
|
let e = /* @__PURE__ */ new Set();
|
|
64
|
-
for (let t of
|
|
69
|
+
for (let t of F) if (t.suspectedDuplicateOf.length !== 0) {
|
|
65
70
|
e.add(t.payableId);
|
|
66
71
|
for (let n of t.suspectedDuplicateOf) e.add(n);
|
|
67
72
|
}
|
|
68
|
-
for (let { payableId: t, ocrStatus: n, isError: r } of
|
|
69
|
-
let i =
|
|
70
|
-
i && (n === "success" ?
|
|
73
|
+
for (let { payableId: t, ocrStatus: n, isError: r } of F) {
|
|
74
|
+
let i = j.find((e) => e.payableId === t && e.status === "uploading");
|
|
75
|
+
i && (n === "success" ? M(i.localId, { status: e.has(t) ? "duplicate" : "ready" }) : (r || n === "error" || n === "canceled") && M(i.localId, { status: "failed" }));
|
|
71
76
|
}
|
|
72
|
-
for (let t of
|
|
77
|
+
for (let t of j) t.status === "ready" && t.payableId && e.has(t.payableId) && M(t.localId, { status: "duplicate" });
|
|
73
78
|
}, [
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
79
|
+
j,
|
|
80
|
+
F,
|
|
81
|
+
M
|
|
77
82
|
]);
|
|
78
|
-
let
|
|
83
|
+
let I = j.filter((e) => e.status === "uploading"), L = j.filter((e) => e.status === "ready"), R = j.filter((e) => e.status === "duplicate"), z = j.filter((e) => e.status === "failed"), B = (r) => ({
|
|
79
84
|
id: r.localId,
|
|
80
85
|
fileName: r.fileName,
|
|
81
86
|
status: r.status,
|
|
82
87
|
onOpen: (r.status === "ready" || r.status === "duplicate") && r.payableId && g ? () => {
|
|
83
88
|
let o = r.payableId;
|
|
84
|
-
|
|
89
|
+
E.fetchQuery({
|
|
85
90
|
...n(t({
|
|
86
|
-
client:
|
|
87
|
-
headers: i(
|
|
91
|
+
client: S,
|
|
92
|
+
headers: i(C),
|
|
88
93
|
path: { payable_id: o }
|
|
89
94
|
}), {
|
|
90
|
-
authEpoch:
|
|
91
|
-
organizationStatus:
|
|
95
|
+
authEpoch: w,
|
|
96
|
+
organizationStatus: T
|
|
92
97
|
}),
|
|
93
98
|
retry: !1
|
|
94
99
|
}).catch((e) => {
|
|
95
100
|
if (a(e)) return "deleted";
|
|
96
101
|
}).then((t) => {
|
|
97
|
-
t === "deleted" ? e.error(v.billDeletedError) : g(o),
|
|
102
|
+
t === "deleted" ? e.error(v.billDeletedError) : g(o), N(r.localId);
|
|
98
103
|
});
|
|
99
104
|
} : void 0
|
|
100
|
-
}),
|
|
105
|
+
}), V = I.length ? [{
|
|
101
106
|
id: "in-progress",
|
|
102
|
-
items:
|
|
107
|
+
items: j.map(B)
|
|
103
108
|
}] : [
|
|
104
|
-
...
|
|
109
|
+
...L.length ? [{
|
|
105
110
|
id: "ready",
|
|
106
|
-
caption: v.readyCaption(
|
|
107
|
-
items:
|
|
111
|
+
caption: v.readyCaption(L.length),
|
|
112
|
+
items: L.map(B)
|
|
108
113
|
}] : [],
|
|
109
|
-
...
|
|
114
|
+
...R.length ? [{
|
|
110
115
|
id: "duplicate",
|
|
111
|
-
caption: v.duplicateCaption(
|
|
112
|
-
items:
|
|
116
|
+
caption: v.duplicateCaption(R.length),
|
|
117
|
+
items: R.map(B)
|
|
113
118
|
}] : [],
|
|
114
|
-
...
|
|
119
|
+
...z.length ? [{
|
|
115
120
|
id: "failed",
|
|
116
|
-
caption: v.failedCaption(
|
|
117
|
-
items:
|
|
121
|
+
caption: v.failedCaption(z.length),
|
|
122
|
+
items: z.map(B)
|
|
118
123
|
}] : []
|
|
119
|
-
],
|
|
120
|
-
|
|
121
|
-
}, [
|
|
124
|
+
], H = L.length + R.length, U = I.length ? v.uploadingSummary(j.length) : H ? v.completeSummary(H) : v.failedCaption(z.length), W = u(() => {
|
|
125
|
+
E.setQueryData(D, []);
|
|
126
|
+
}, [E, D]);
|
|
122
127
|
return {
|
|
123
|
-
enqueue:
|
|
124
|
-
sections:
|
|
125
|
-
summaryLabel:
|
|
126
|
-
collapsed:
|
|
127
|
-
onToggleCollapsed: u(() =>
|
|
128
|
-
onClose:
|
|
129
|
-
isVisible:
|
|
128
|
+
enqueue: P,
|
|
129
|
+
sections: V,
|
|
130
|
+
summaryLabel: U,
|
|
131
|
+
collapsed: k,
|
|
132
|
+
onToggleCollapsed: u(() => A((e) => !e), []),
|
|
133
|
+
onClose: W,
|
|
134
|
+
isVisible: j.length > 0
|
|
130
135
|
};
|
|
131
136
|
}
|
|
132
137
|
//#endregion
|
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.9.
|
|
2
|
+
var e = "@tesouro/embedded-components-react", t = "0.9.44", n = "0566ca36c3657385b52cd990c71145af70b75966", r = Object.freeze({
|
|
3
3
|
library_name: e,
|
|
4
4
|
library_version: t,
|
|
5
5
|
library_sha: n
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
//#region ../../libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/expectedApiUnprocessable.js
|
|
2
|
+
var e = /* @__PURE__ */ new Set(["GET /embedded-banking/v1/bank-accounts/{id}/statements"]);
|
|
3
|
+
function t(t, n, r) {
|
|
4
|
+
return t === 422 && n !== void 0 && r !== void 0 && e.has(`${n.toUpperCase()} ${r}`);
|
|
5
|
+
}
|
|
6
|
+
//#endregion
|
|
7
|
+
export { t as isExpectedApiUnprocessable };
|