@tesouro/embedded-components-react 0.11.188 → 0.11.190
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 +12 -8
- package/dist/fixtures/index.d.ts +13 -46
- package/dist/index.css +3 -0
- package/dist/index.d.ts +18 -1
- package/dist/index.js +40 -39
- package/dist/lib/BankAccountsWidget.d.ts +2 -0
- package/dist/lib/BillPayWidget.d.ts +16 -1
- package/dist/lib/BillPayWidget.js +3 -1
- package/dist/lib/WidgetSuite.d.ts +2 -0
- package/dist/libs/tesouro-embedded-components-react/balance-history-widget/feature/dist/lib/BalanceHistoryWidget/BalanceHistoryWidgetFeature.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/balances-widget/feature/dist/lib/BalancesWidget/BalancesWidgetContext.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/ui/dist/index2.js +17 -14
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/feature/dist/lib/formatters.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/feature/dist/lib/labels.js +2 -0
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/feature/dist/lib/useBankAccountsWidget.js +9 -3
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/ui/dist/lib/AccountCard.js +76 -58
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index27.js +4 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index32.js +8 -8
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index35.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index36.js +180 -180
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index45.js +62 -62
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index48.js +32 -32
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index14.js +7 -7
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index15.js +20 -20
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index33.js +5 -5
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index34.js +16 -16
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index37.js +7 -7
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index.js +3 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index10.js +101 -58
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index11.js +19 -17
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index14.js +2 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index15.js +169 -138
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index17.js +227 -204
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index18.js +208 -204
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index19.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index21.js +10 -10
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index23.js +212 -212
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index9.js +9 -5
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index.js +3 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/lib/BillPayWidget/BillPayWidget.js +43 -39
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/lib/BillPayWidget/BillsTab.js +66 -64
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/lib/BillPayWidget/index.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/pay-bill/feature/dist/index8.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/viewModels.js +9 -9
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/index.js +5 -5
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/helpers.js +21 -21
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js +20 -20
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/sdk.gen.js +17 -17
- package/dist/libs/tesouro-embedded-components-react/shared/document-status/ui/dist/index7.js +4 -4
- 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/feature/dist/lib/TransfersWidget/TransfersWidgetInner.js +77 -77
- package/dist/libs/tesouro-embedded-components-react/transfers-widget/feature/dist/lib/TransfersWidget/transferViews.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/transfers-widget/feature/dist/lib/TransfersWidget/useTransferMoneyModalController.js +129 -122
- package/dist/packages/shared-ui-shadcn/dist/index.js +1 -1
- package/package.json +1 -1
|
@@ -12,15 +12,15 @@ import "../../../../../shared/util/dist/index.js";
|
|
|
12
12
|
import "../../../../../shared/ui/dist/index.js";
|
|
13
13
|
import { TRANSFERS_ANALYTICS_EVENTS as c } from "../analytics/events.js";
|
|
14
14
|
import { useCreateBookTransferMutation as ee } from "../../../../data-access/dist/index7.js";
|
|
15
|
-
import { useCreateAchMoneyMovementMutation as
|
|
15
|
+
import { useCreateAchMoneyMovementMutation as te } from "../../../../data-access/dist/index8.js";
|
|
16
16
|
import "../../../../data-access/dist/index.js";
|
|
17
|
-
import { useCallback as
|
|
18
|
-
import { useControllableState as
|
|
17
|
+
import { useCallback as l, useEffect as ne, useMemo as u, useState as d } from "react";
|
|
18
|
+
import { useControllableState as f } from "@radix-ui/react-use-controllable-state";
|
|
19
19
|
// ../../libs/tesouro-embedded-components-react/transfers-widget/feature/dist/lib/TransfersWidget/useTransferMoneyModalController.js
|
|
20
|
-
function
|
|
20
|
+
function p(e) {
|
|
21
21
|
return e.slice(-4);
|
|
22
22
|
}
|
|
23
|
-
function
|
|
23
|
+
function m(e, t) {
|
|
24
24
|
let n = e.balance;
|
|
25
25
|
if (!n || n.value === void 0 || n.value === null) return;
|
|
26
26
|
let i = n.currencyCode ?? t, a = r({
|
|
@@ -32,135 +32,140 @@ function h(e, t) {
|
|
|
32
32
|
includeSpaceAfterCurrencySymbol: !1
|
|
33
33
|
});
|
|
34
34
|
}
|
|
35
|
-
function
|
|
35
|
+
function h(e, t, n, r) {
|
|
36
36
|
let i = n.find((t) => t.id === e);
|
|
37
37
|
if (i?.balance?.currencyCode) return i.balance.currencyCode;
|
|
38
38
|
let a = n.find((e) => e.id === t);
|
|
39
39
|
return a?.balance?.currencyCode ? a.balance.currencyCode : r;
|
|
40
40
|
}
|
|
41
|
-
function
|
|
42
|
-
let r = e.nickname?.trim() || t.accountFallbackName, i =
|
|
41
|
+
function g(e, t, n) {
|
|
42
|
+
let r = e.nickname?.trim() || t.accountFallbackName, i = m(e, n.defaultCurrencyCode);
|
|
43
43
|
return {
|
|
44
44
|
optionValue: e.id,
|
|
45
45
|
primaryLabel: r,
|
|
46
|
-
number: { last4:
|
|
46
|
+
...e.accountNumber && { number: { last4: p(e.accountNumber) } },
|
|
47
47
|
balanceLabel: i
|
|
48
48
|
};
|
|
49
49
|
}
|
|
50
|
-
function
|
|
50
|
+
function _(e) {
|
|
51
51
|
let t = e.nickname?.trim() || e.nameOnAccount;
|
|
52
52
|
return {
|
|
53
53
|
optionValue: e.id,
|
|
54
54
|
primaryLabel: t,
|
|
55
|
-
number: { last4:
|
|
55
|
+
number: { last4: p(e.accountNumber) }
|
|
56
56
|
};
|
|
57
57
|
}
|
|
58
|
-
function
|
|
58
|
+
function v(e, t) {
|
|
59
59
|
return {
|
|
60
60
|
name: e?.primaryLabel ?? "",
|
|
61
61
|
...t && { number: {
|
|
62
|
-
last4:
|
|
62
|
+
last4: p(t),
|
|
63
63
|
fullNumber: t
|
|
64
64
|
} }
|
|
65
65
|
};
|
|
66
66
|
}
|
|
67
|
-
var
|
|
68
|
-
function
|
|
69
|
-
let
|
|
70
|
-
|
|
71
|
-
|
|
67
|
+
var re = 2;
|
|
68
|
+
function y({ labels: r, featureLabels: p, embeddedBankAccounts: m, verifiedExternalBankAccounts: y, track: b, isTransferMoneyOpen: ie, defaultIsTransferMoneyOpen: x, onTransferMoneyOpenChange: S }) {
|
|
69
|
+
let C = ee(), w = te(), T = u(() => m.filter((e) => e.status === "ACTIVE" && !!e.accountNumber), [m]), E = u(() => new Set(T.map((e) => e.id)), [T]), D = u(() => T.map((e) => g(e, r, p)), [
|
|
70
|
+
T,
|
|
71
|
+
p,
|
|
72
72
|
r.accountFallbackName
|
|
73
|
-
]),
|
|
74
|
-
prop:
|
|
75
|
-
defaultProp:
|
|
76
|
-
onChange:
|
|
73
|
+
]), O = u(() => y.map((e) => _(e)), [y]), k = u(() => [...D, ...O], [D, O]), [A, j] = f({
|
|
74
|
+
prop: ie,
|
|
75
|
+
defaultProp: x ?? !1,
|
|
76
|
+
onChange: S,
|
|
77
77
|
caller: "TransfersWidget"
|
|
78
|
-
}), [
|
|
79
|
-
|
|
80
|
-
}, []),
|
|
81
|
-
|
|
82
|
-
}, [q]), [
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
}, [
|
|
86
|
-
let
|
|
87
|
-
|
|
88
|
-
}, [
|
|
89
|
-
|
|
90
|
-
}, [
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
]), Z =
|
|
96
|
-
let a = s(e,
|
|
78
|
+
}), [M, N] = d("accounts"), [P, F] = d(""), [I, L] = d(""), [R, z] = d(""), [ae, B] = d(null), [oe, V] = d(null), [H, U] = d(null), [W, G] = d(!1), [K, se] = d(0), q = l(() => {
|
|
79
|
+
F(""), L(""), z(""), B(null), V(null), U(null), G(!1);
|
|
80
|
+
}, []), ce = l(() => {
|
|
81
|
+
N("accounts"), q();
|
|
82
|
+
}, [q]), [le, ue] = d(A);
|
|
83
|
+
A !== le && (ue(A), A && ce()), ne(() => {
|
|
84
|
+
A && b(c.TransferMoneyOpened);
|
|
85
|
+
}, [A, b]);
|
|
86
|
+
let de = l((e) => {
|
|
87
|
+
j(e);
|
|
88
|
+
}, [j]), fe = l(() => {
|
|
89
|
+
j(!0);
|
|
90
|
+
}, [j]), J = E.has(P), Y = E.has(I), X = u(() => h(P, I, T, p.defaultCurrencyCode), [
|
|
91
|
+
T,
|
|
92
|
+
p.defaultCurrencyCode,
|
|
93
|
+
P,
|
|
94
|
+
I
|
|
95
|
+
]), Z = l((e, t, i) => {
|
|
96
|
+
let a = s(e, h(t, i, T, p.defaultCurrencyCode));
|
|
97
97
|
if (a === null) return r.modalAmountInvalidError;
|
|
98
|
-
let o =
|
|
98
|
+
let o = T.find((e) => e.id === t);
|
|
99
99
|
return o && a > n(o.balance?.value) ? r.modalInsufficientFundsError : null;
|
|
100
100
|
}, [
|
|
101
|
-
|
|
102
|
-
|
|
101
|
+
T,
|
|
102
|
+
p.defaultCurrencyCode,
|
|
103
103
|
r.modalAmountInvalidError,
|
|
104
104
|
r.modalInsufficientFundsError
|
|
105
|
-
]),
|
|
105
|
+
]), pe = u(() => a(X), [X]), me = u(() => I ? Y ? k.filter((e) => e.optionValue !== I) : D.filter((e) => e.optionValue !== I) : k, [
|
|
106
|
+
k,
|
|
106
107
|
D,
|
|
107
|
-
|
|
108
|
-
P,
|
|
108
|
+
I,
|
|
109
109
|
Y
|
|
110
|
-
]),
|
|
110
|
+
]), he = u(() => P ? J ? k.filter((e) => e.optionValue !== P) : D.filter((e) => e.optionValue !== P) : k, [
|
|
111
|
+
k,
|
|
111
112
|
D,
|
|
112
|
-
|
|
113
|
-
M,
|
|
113
|
+
P,
|
|
114
114
|
J
|
|
115
|
-
]),
|
|
116
|
-
|
|
115
|
+
]), ge = l((e) => {
|
|
116
|
+
F(e), B(null), U(W ? Z(R, e, I) : null);
|
|
117
117
|
}, [
|
|
118
|
+
R,
|
|
118
119
|
I,
|
|
119
|
-
P,
|
|
120
120
|
Z,
|
|
121
|
-
|
|
122
|
-
]),
|
|
123
|
-
|
|
121
|
+
W
|
|
122
|
+
]), _e = l((e) => {
|
|
123
|
+
L(e), V(null), U(W ? Z(R, P, e) : null);
|
|
124
124
|
}, [
|
|
125
|
-
|
|
126
|
-
|
|
125
|
+
R,
|
|
126
|
+
P,
|
|
127
127
|
Z,
|
|
128
|
-
|
|
129
|
-
]),
|
|
130
|
-
|
|
128
|
+
W
|
|
129
|
+
]), ve = l((e) => {
|
|
130
|
+
z(e), U(W ? Z(e, P, I) : null);
|
|
131
131
|
}, [
|
|
132
|
-
M,
|
|
133
132
|
P,
|
|
133
|
+
I,
|
|
134
134
|
Z,
|
|
135
|
-
|
|
136
|
-
]),
|
|
137
|
-
let e = s(
|
|
135
|
+
W
|
|
136
|
+
]), ye = u(() => {
|
|
137
|
+
let e = s(R, X);
|
|
138
138
|
if (e === null) return "";
|
|
139
139
|
let t = i(X);
|
|
140
140
|
return o(e / 10 ** t, {
|
|
141
141
|
currencyCode: X,
|
|
142
142
|
includeSpaceAfterCurrencySymbol: !1
|
|
143
143
|
});
|
|
144
|
-
}, [
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
]),
|
|
149
|
-
let e =
|
|
150
|
-
|
|
144
|
+
}, [R, X]), Q = l((e) => v(k.find((t) => t.optionValue === e), T.find((t) => t.id === e)?.accountNumber ?? y.find((t) => t.id === e)?.accountNumber), [
|
|
145
|
+
k,
|
|
146
|
+
T,
|
|
147
|
+
y
|
|
148
|
+
]), $ = l(() => {
|
|
149
|
+
let e = k.some((e) => e.optionValue === P) ? null : r.modalFromRequiredError, t = k.some((e) => e.optionValue === I) ? null : r.modalToRequiredError, n = Z(R, P, I);
|
|
150
|
+
G(!0), B(e), V(t), U(n), e || t || n ? se((e) => e + 1) : N("review");
|
|
151
151
|
}, [
|
|
152
|
-
|
|
153
|
-
|
|
152
|
+
k,
|
|
153
|
+
R,
|
|
154
|
+
P,
|
|
154
155
|
r.modalFromRequiredError,
|
|
155
156
|
r.modalToRequiredError,
|
|
156
|
-
|
|
157
|
+
I,
|
|
157
158
|
Z
|
|
158
|
-
]),
|
|
159
|
-
|
|
160
|
-
}, []),
|
|
161
|
-
|
|
159
|
+
]), be = l(() => {
|
|
160
|
+
N("accounts");
|
|
161
|
+
}, []), xe = l(async () => {
|
|
162
|
+
if (!k.some((e) => e.optionValue === P) || !k.some((e) => e.optionValue === I)) {
|
|
163
|
+
$(), N("accounts");
|
|
164
|
+
return;
|
|
165
|
+
}
|
|
166
|
+
let t = s(R, X);
|
|
162
167
|
if (t === null) {
|
|
163
|
-
|
|
168
|
+
U(r.modalAmountInvalidError);
|
|
164
169
|
return;
|
|
165
170
|
}
|
|
166
171
|
if (!J && !Y) {
|
|
@@ -170,69 +175,71 @@ function b({ labels: r, featureLabels: m, embeddedBankAccounts: h, verifiedExter
|
|
|
170
175
|
let n;
|
|
171
176
|
n = J && Y ? "INTERNAL_TO_INTERNAL" : J && !Y ? "INTERNAL_TO_EXTERNAL" : "EXTERNAL_TO_INTERNAL";
|
|
172
177
|
try {
|
|
173
|
-
n === "INTERNAL_TO_INTERNAL" ? await
|
|
174
|
-
fromBankAccountId:
|
|
175
|
-
toBankAccountId:
|
|
178
|
+
n === "INTERNAL_TO_INTERNAL" ? await C.mutateAsync({ body: {
|
|
179
|
+
fromBankAccountId: P,
|
|
180
|
+
toBankAccountId: I,
|
|
176
181
|
amount: t,
|
|
177
182
|
currencyCode: X
|
|
178
|
-
} }) : await
|
|
179
|
-
fromBankAccountId:
|
|
180
|
-
toBankAccountId:
|
|
183
|
+
} }) : await w.mutateAsync({ body: {
|
|
184
|
+
fromBankAccountId: P,
|
|
185
|
+
toBankAccountId: I,
|
|
181
186
|
amount: t,
|
|
182
187
|
currencyCode: X,
|
|
183
188
|
type: n,
|
|
184
|
-
secCode:
|
|
185
|
-
} }),
|
|
189
|
+
secCode: p.defaultSecCode
|
|
190
|
+
} }), N("result"), b(c.TransferSubmitted, { transferType: n });
|
|
186
191
|
} catch {
|
|
187
192
|
e.error(r.modalSubmitFailedError);
|
|
188
193
|
}
|
|
189
194
|
}, [
|
|
190
|
-
|
|
195
|
+
R,
|
|
196
|
+
w,
|
|
197
|
+
k,
|
|
191
198
|
C,
|
|
192
|
-
|
|
199
|
+
$,
|
|
193
200
|
J,
|
|
194
|
-
|
|
201
|
+
P,
|
|
195
202
|
r.modalSubmitFailedError,
|
|
196
203
|
r.modalUnsupportedPairError,
|
|
197
204
|
r.modalAmountInvalidError,
|
|
198
205
|
Y,
|
|
199
|
-
|
|
200
|
-
|
|
206
|
+
I,
|
|
207
|
+
b,
|
|
201
208
|
X,
|
|
202
|
-
|
|
209
|
+
p.defaultSecCode
|
|
203
210
|
]);
|
|
204
211
|
return {
|
|
205
212
|
modalProps: {
|
|
206
|
-
open:
|
|
207
|
-
onOpenChange:
|
|
208
|
-
step:
|
|
209
|
-
stepLabel:
|
|
210
|
-
current: String(
|
|
211
|
-
total: String(
|
|
213
|
+
open: A,
|
|
214
|
+
onOpenChange: de,
|
|
215
|
+
step: M,
|
|
216
|
+
stepLabel: M === "result" ? void 0 : t(r.modalStepLabel, {
|
|
217
|
+
current: String(M === "review" ? 2 : 1),
|
|
218
|
+
total: String(re)
|
|
212
219
|
}),
|
|
213
|
-
fromOptions:
|
|
214
|
-
toOptions:
|
|
215
|
-
fromValue:
|
|
216
|
-
toValue:
|
|
217
|
-
onFromValueChange:
|
|
218
|
-
onToValueChange:
|
|
219
|
-
fromError:
|
|
220
|
-
toError:
|
|
221
|
-
amountValue:
|
|
222
|
-
onAmountValueChange:
|
|
223
|
-
amountError:
|
|
224
|
-
amountInputPrefix:
|
|
225
|
-
reviewFromAccount:
|
|
226
|
-
reviewToAccount:
|
|
227
|
-
reviewAmountLabel:
|
|
228
|
-
isSubmitting:
|
|
229
|
-
onContinueFromAccounts:
|
|
230
|
-
onBack:
|
|
231
|
-
onSubmit: () => void
|
|
220
|
+
fromOptions: me,
|
|
221
|
+
toOptions: he,
|
|
222
|
+
fromValue: P,
|
|
223
|
+
toValue: I,
|
|
224
|
+
onFromValueChange: ge,
|
|
225
|
+
onToValueChange: _e,
|
|
226
|
+
fromError: ae,
|
|
227
|
+
toError: oe,
|
|
228
|
+
amountValue: R,
|
|
229
|
+
onAmountValueChange: ve,
|
|
230
|
+
amountError: H,
|
|
231
|
+
amountInputPrefix: pe,
|
|
232
|
+
reviewFromAccount: Q(P),
|
|
233
|
+
reviewToAccount: Q(I),
|
|
234
|
+
reviewAmountLabel: ye,
|
|
235
|
+
isSubmitting: C.isPending || w.isPending,
|
|
236
|
+
onContinueFromAccounts: $,
|
|
237
|
+
onBack: be,
|
|
238
|
+
onSubmit: () => void xe(),
|
|
232
239
|
onClearSelections: q,
|
|
233
|
-
scrollToErrorToken:
|
|
240
|
+
scrollToErrorToken: K
|
|
234
241
|
},
|
|
235
|
-
openModal:
|
|
242
|
+
openModal: fe
|
|
236
243
|
};
|
|
237
244
|
}
|
|
238
|
-
export {
|
|
245
|
+
export { y as useTransferMoneyModalController };
|
|
@@ -13335,7 +13335,7 @@ function dw({ label: e, labelTone: t = "default", amount: r, caption: i, descrip
|
|
|
13335
13335
|
m(!h.current), h.current = !1, r?.(e);
|
|
13336
13336
|
},
|
|
13337
13337
|
onBlur: (e) => {
|
|
13338
|
-
m(!1), i?.(e);
|
|
13338
|
+
h.current = !1, m(!1), i?.(e);
|
|
13339
13339
|
},
|
|
13340
13340
|
onKeyDown: (e) => {
|
|
13341
13341
|
e.key === "Escape" && m(!1), s?.(e);
|