@tesouro/embedded-components-react 0.7.16 → 0.7.18
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 +14 -14
- package/dist/index.css +9 -12
- package/dist/index.d.ts +70 -19
- package/dist/lib/CounterpartsWidget.d.ts +49 -6
- package/dist/lib/CounterpartsWidgetPublic.d.ts +49 -6
- package/dist/lib/CustomersWidget.d.ts +49 -6
- package/dist/lib/LinkedAccountsWidget.d.ts +20 -12
- package/dist/lib/WidgetSuite.d.ts +20 -12
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/data-access/dist/index3.js +2 -1
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/CounterpartDetailsContainer.js +18 -13
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/CounterpartsWidget.js +146 -137
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/useCounterpartDetailsSheetView.js +56 -55
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/useCounterpartsWidget.js +108 -77
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/viewModels.js +181 -25
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index2.js +50 -7
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index4.js +127 -596
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index5.js +66 -0
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index6.js +210 -0
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index7.js +520 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/ReceivablesWidget.js +2 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useInvoicesFilter.js +10 -7
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableActionsModal.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivablesTable.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivablesWidget.js +141 -125
- package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/feature/dist/lib/forms.js +2 -1
- package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/feature/dist/lib/labels.js +11 -1
- package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/feature/dist/lib/summary.js +22 -0
- package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/feature/dist/lib/useLinkedAccountsWidget.js +182 -162
- package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/feature/dist/mocks/linkedAccounts.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/ui/dist/index10.js +36 -86
- package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/ui/dist/index11.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/ui/dist/index12.js +17 -23
- package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/ui/dist/index14.js +6 -6
- package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/ui/dist/index15.js +14 -17
- package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/ui/dist/index16.js +3 -6
- package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/ui/dist/index5.js +168 -35
- package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/ui/dist/index6.js +70 -83
- package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/ui/dist/index7.js +11 -112
- package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/ui/dist/index8.js +6 -12
- package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/ui/dist/index9.js +82 -7
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/index.js +11 -11
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index.js +7 -7
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index2.js +1 -8
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/package.json +1 -1
|
@@ -3,12 +3,11 @@
|
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
5
|
import { toast as e } from "../../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
6
|
-
import {
|
|
7
|
-
import { TESOURO_NEW_EXTERNAL_BANK_ACCOUNT_LINKED_SUCCESS_EVENT as n, emitWidgetDomEvent as r } from "../../../../shared/util/dist/lib/widgetDomEvents.js";
|
|
6
|
+
import { TESOURO_NEW_EXTERNAL_BANK_ACCOUNT_LINKED_SUCCESS_EVENT as t, emitWidgetDomEvent as n } from "../../../../shared/util/dist/lib/widgetDomEvents.js";
|
|
8
7
|
import { extractApiErrorMessage as ee } from "../../../../shared/util/dist/lib/apiErrors.js";
|
|
9
8
|
import { OrganizationStatus as te, isOrganizationOnItsWay as ne } from "../../../../shared/data-access/dist/lib/organizationStatus.js";
|
|
10
9
|
import { useEmbedApi as re } from "../../../../shared/data-access/dist/lib/EmbedApiContext.js";
|
|
11
|
-
import { Scope as
|
|
10
|
+
import { Scope as r } from "../../../../shared/data-access/dist/lib/scopes.js";
|
|
12
11
|
import { useAllOrganizationRolesQuery as ie } from "../../../../shared/data-access/dist/lib/role/useAllOrganizationRolesQuery.js";
|
|
13
12
|
import { useAllOrganizationUsersQuery as ae } from "../../../../shared/data-access/dist/lib/user/useAllOrganizationUsersQuery.js";
|
|
14
13
|
import "../../../../shared/data-access/dist/index.js";
|
|
@@ -19,30 +18,31 @@ import "../../../../shared/feature/dist/index.js";
|
|
|
19
18
|
import { filterRolesForOrganization as ue } from "../../../../../shared/util-validation/dist/index6.js";
|
|
20
19
|
import { filterUsersForOrganization as de } from "../../../../../shared/util-validation/dist/index7.js";
|
|
21
20
|
import { DEFAULT_FEATURE_LABELS as fe } from "./labels.js";
|
|
22
|
-
import { LinkedAccountsWidgetAnalyticsEvent as
|
|
23
|
-
import { EMPTY_CONNECT_FORM as
|
|
21
|
+
import { LinkedAccountsWidgetAnalyticsEvent as i } from "./analytics/events.js";
|
|
22
|
+
import { EMPTY_CONNECT_FORM as pe, EMPTY_EDIT_FORM as me, EMPTY_VERIFY_FORM as he, isConnectStep1Valid as ge, isRoutingNumberValid as _e, isVerifyAmountInRange as ve, isVerifyFormValid as ye, parseVerifyAmountToMinorUnits as a, sanitizeRoutingNumberInput as be, toEditForm as xe, toUpdateBody as Se } from "./forms.js";
|
|
24
23
|
import { getLinkedAccountsPermissions as Ce } from "./permissions.js";
|
|
25
24
|
import { toAccountRows as we } from "./rows.js";
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
25
|
+
import { fromApiAccountHolderType as Te, toApiAccountHolderType as Ee, toSummaryTypeLabel as De, toTextParts as o } from "./summary.js";
|
|
26
|
+
import { useConnectExternalBankAccountMutation as Oe } from "../../../data-access/dist/index3.js";
|
|
27
|
+
import { useExternalBankAccountsQuery as ke } from "../../../data-access/dist/index4.js";
|
|
28
|
+
import { useGrantExternalBankAccountAccessMutation as Ae } from "../../../data-access/dist/index5.js";
|
|
29
|
+
import { useLinkExternalBankAccountMutation as je } from "../../../data-access/dist/index6.js";
|
|
30
|
+
import { useUnlinkExternalBankAccountMutation as Me } from "../../../data-access/dist/index9.js";
|
|
31
|
+
import { useUpdateExternalBankAccountMutation as Ne } from "../../../data-access/dist/index10.js";
|
|
32
|
+
import { useValidateExternalBankAccountMutation as Pe } from "../../../data-access/dist/index11.js";
|
|
33
33
|
import "../../../data-access/dist/index.js";
|
|
34
|
-
import { useAdminEligibleUserIds as
|
|
35
|
-
import { toAccessRows as
|
|
36
|
-
import { DEFAULT_LABELS as
|
|
34
|
+
import { useAdminEligibleUserIds as Fe } from "./useAdminEligibleUserIds.js";
|
|
35
|
+
import { toAccessRows as Ie, toOrganizationRoleOptions as Le, toTeamMembers as Re } from "./teamMembers.js";
|
|
36
|
+
import { DEFAULT_LABELS as ze } from "../../../ui/dist/index15.js";
|
|
37
37
|
import "../../../ui/dist/index.js";
|
|
38
|
-
import { useCallback as
|
|
38
|
+
import { useCallback as Be, useEffect as Ve, useMemo as s, useState as c } from "react";
|
|
39
39
|
//#region ../../libs/tesouro-embedded-components-react/linked-accounts-widget/feature/dist/lib/useLinkedAccountsWidget.js
|
|
40
|
-
function
|
|
40
|
+
function He(e) {
|
|
41
41
|
let t = e;
|
|
42
42
|
return typeof e == "object" && !!e && "verificationStatus" in e && t.verificationStatus === "VERIFIED";
|
|
43
43
|
}
|
|
44
44
|
var l = "tesouro.linkedAccounts.locallySentMicroDepositAccountIds.v1";
|
|
45
|
-
function
|
|
45
|
+
function Ue() {
|
|
46
46
|
if (typeof window > "u") return /* @__PURE__ */ new Set();
|
|
47
47
|
try {
|
|
48
48
|
let e = window.sessionStorage.getItem(l), t = e ? JSON.parse(e) : [];
|
|
@@ -63,42 +63,42 @@ function f(e, t) {
|
|
|
63
63
|
let n = new Set(e).add(t);
|
|
64
64
|
return d(n), n;
|
|
65
65
|
}
|
|
66
|
-
var
|
|
67
|
-
function p({ labels:
|
|
66
|
+
var We = r.ExternalBankAccountWriteOrg;
|
|
67
|
+
function p({ labels: r, featureLabels: l }) {
|
|
68
68
|
let u = {
|
|
69
|
-
...
|
|
70
|
-
...
|
|
69
|
+
...ze,
|
|
70
|
+
...r
|
|
71
71
|
}, d = {
|
|
72
72
|
...fe,
|
|
73
73
|
...l
|
|
74
|
-
}, p = oe(), { organizationId: m, widgetToken:
|
|
75
|
-
|
|
76
|
-
p(
|
|
74
|
+
}, p = oe(), { organizationId: m, widgetToken: Ge, initResponse: h } = se(), Ke = le(), { organizationStatus: qe } = re(), Je = ne(qe), Ye = !!ce(), g = !!(m && Ge), Xe = g || !!Ge && qe === te.Rotating, _ = s(() => Ce(h?.scopes), [h?.scopes]), v = Xe && _.canRead && !!h, [y, b] = c(), [x, Ze] = c(!1), [S, C] = c(1), [w, Qe] = c([]), [T, $e] = c(), [et, E] = c(), [D, tt] = c(Ue), [nt, O] = c(!1), [rt, it] = c(!1), [at, k] = c(!1), [ot, A] = c(!1), [j, M] = c(), [N, P] = c(pe), [F, I] = c(me), [L, R] = c(he);
|
|
75
|
+
Ve(() => {
|
|
76
|
+
p(i.Mounted);
|
|
77
77
|
}, [p]);
|
|
78
|
-
let z =
|
|
78
|
+
let z = ke({
|
|
79
79
|
limit: 100,
|
|
80
|
-
enabled:
|
|
81
|
-
}), B =
|
|
80
|
+
enabled: v
|
|
81
|
+
}), B = Oe(), V = Ae(), H = Ne(), U = Me(), W = je(), G = Pe(), K = x && S >= 2, q = ae({ enabled: K }), J = ie({ enabled: K }), { userIds: st, isResolving: ct, isError: lt } = Fe({
|
|
82
82
|
enabled: K,
|
|
83
|
-
permissionKey:
|
|
83
|
+
permissionKey: We,
|
|
84
84
|
organizationId: m
|
|
85
85
|
}), Y = s(() => {
|
|
86
86
|
let e = J.data?.data ?? [], t = m ? ue(e, {
|
|
87
87
|
organizationId: m,
|
|
88
|
-
organizationTypes:
|
|
88
|
+
organizationTypes: h?.organizationTypes ?? []
|
|
89
89
|
}) : e, n = de(q.data?.data ?? [], m);
|
|
90
|
-
return
|
|
90
|
+
return Re(n, Le(t), st);
|
|
91
91
|
}, [
|
|
92
|
-
|
|
92
|
+
st,
|
|
93
93
|
J.data?.data,
|
|
94
94
|
q.data?.data,
|
|
95
95
|
m,
|
|
96
|
-
|
|
97
|
-
]),
|
|
96
|
+
h?.organizationTypes
|
|
97
|
+
]), ut = q.isLoading || q.isFetchingNextPage || !!q.hasNextPage || J.isResolving || ct, dt = !ut && !q.isError && !lt, X = v ? z.data?.data ?? [] : [], Z = s(() => X.map((e) => e.verificationStatus === "UNVERIFIED" && D.has(e.id) ? {
|
|
98
98
|
...e,
|
|
99
99
|
verificationStatus: "VERIFICATION_SENT"
|
|
100
|
-
} : e), [X,
|
|
101
|
-
B.reset(), V.reset(), W.reset(),
|
|
100
|
+
} : e), [X, D]), ft = [.../* @__PURE__ */ new Set([...Y.filter((e) => e.locked).map((e) => e.id), ...w])], pt = Be((e) => {
|
|
101
|
+
B.reset(), V.reset(), W.reset(), P({
|
|
102
102
|
...e,
|
|
103
103
|
routingNumber: be(e.routingNumber)
|
|
104
104
|
});
|
|
@@ -106,122 +106,142 @@ function p({ labels: i, featureLabels: l }) {
|
|
|
106
106
|
B,
|
|
107
107
|
V,
|
|
108
108
|
W
|
|
109
|
-
]),
|
|
110
|
-
|
|
111
|
-
},
|
|
112
|
-
if (!
|
|
113
|
-
|
|
109
|
+
]), mt = () => {
|
|
110
|
+
C(3), n(t);
|
|
111
|
+
}, ht = (e) => {
|
|
112
|
+
if (!_.canMicroDeposit) {
|
|
113
|
+
mt();
|
|
114
114
|
return;
|
|
115
115
|
}
|
|
116
|
-
|
|
117
|
-
|
|
116
|
+
E("connect"), W.mutate({ path: { id: e } }, { onSuccess: () => {
|
|
117
|
+
E(void 0), tt((t) => f(t, e)), p(i.AccountLinked, { accountId: e }), mt();
|
|
118
118
|
} });
|
|
119
|
-
},
|
|
119
|
+
}, Q = (e) => {
|
|
120
120
|
V.mutate({
|
|
121
121
|
path: { id: e },
|
|
122
|
-
body: { userIds:
|
|
123
|
-
}, { onSuccess: () =>
|
|
124
|
-
},
|
|
125
|
-
if (
|
|
126
|
-
if (
|
|
127
|
-
if (!
|
|
128
|
-
|
|
122
|
+
body: { userIds: ft }
|
|
123
|
+
}, { onSuccess: () => ht(e) });
|
|
124
|
+
}, gt = () => {
|
|
125
|
+
if (g && _.canWrite) {
|
|
126
|
+
if (S === 1) {
|
|
127
|
+
if (!ge(N)) return;
|
|
128
|
+
C(2);
|
|
129
129
|
return;
|
|
130
130
|
}
|
|
131
|
-
if (
|
|
132
|
-
if (
|
|
133
|
-
|
|
131
|
+
if (S === 2 && dt) {
|
|
132
|
+
if (T) {
|
|
133
|
+
Q(T.id);
|
|
134
134
|
return;
|
|
135
135
|
}
|
|
136
136
|
B.mutate({ body: {
|
|
137
|
-
nickname:
|
|
138
|
-
accountNumber:
|
|
139
|
-
routingNumber:
|
|
140
|
-
nameOnAccount:
|
|
141
|
-
type:
|
|
137
|
+
nickname: N.nickname.trim(),
|
|
138
|
+
accountNumber: N.accountNumber.trim(),
|
|
139
|
+
routingNumber: N.routingNumber.trim(),
|
|
140
|
+
nameOnAccount: N.nickname.trim(),
|
|
141
|
+
type: N.type,
|
|
142
|
+
accountHolderType: Ee(N.accountHolderType)
|
|
142
143
|
} }, { onSuccess: (e) => {
|
|
143
|
-
p(
|
|
144
|
+
p(i.AccountConnected, { accountId: e?.id }), $e(e), e?.id && Q(e.id);
|
|
144
145
|
} });
|
|
145
146
|
}
|
|
146
147
|
}
|
|
147
|
-
},
|
|
148
|
-
|
|
149
|
-
},
|
|
150
|
-
Y.find((t) => t.id === e)?.locked ||
|
|
151
|
-
}, _t = (e) => {
|
|
152
|
-
(!e || y) && (!e || b.canWrite) && (e && (E(1), et(o), O([]), A(void 0), j(void 0), B.reset(), V.reset(), W.reset()), Ge(e));
|
|
153
|
-
}, vt = (e) => {
|
|
154
|
-
if (!y || !b.canWrite) return;
|
|
155
|
-
let t = X.find((t) => t.id === e);
|
|
156
|
-
C(e), nt(xe(t)), M(!0);
|
|
148
|
+
}, _t = () => {
|
|
149
|
+
S === 2 && C(1);
|
|
150
|
+
}, vt = (e, t) => {
|
|
151
|
+
Y.find((t) => t.id === e)?.locked || Qe((n) => t ? [.../* @__PURE__ */ new Set([...n, e])] : n.filter((t) => t !== e));
|
|
157
152
|
}, yt = (e) => {
|
|
158
|
-
(!e ||
|
|
159
|
-
}, bt = () => {
|
|
160
|
-
if (!
|
|
161
|
-
let t = X.find((
|
|
153
|
+
(!e || g) && (!e || _.canWrite) && (e && (C(1), P(pe), Qe([]), $e(void 0), E(void 0), B.reset(), V.reset(), W.reset()), Ze(e));
|
|
154
|
+
}, bt = (e) => {
|
|
155
|
+
if (!g || !_.canWrite) return;
|
|
156
|
+
let t = X.find((t) => t.id === e);
|
|
157
|
+
b(e), I(xe(t)), O(!0);
|
|
158
|
+
}, xt = (e) => {
|
|
159
|
+
(!e || g) && (!e || _.canWrite) && O(e);
|
|
160
|
+
}, St = () => {
|
|
161
|
+
if (!g || !_.canWrite || !y) return;
|
|
162
|
+
let t = X.find((e) => e.id === y), n = Se(F, t);
|
|
162
163
|
Object.keys(n).length !== 0 && H.mutate({
|
|
163
|
-
path: { id:
|
|
164
|
+
path: { id: y },
|
|
164
165
|
body: n
|
|
165
166
|
}, { onSuccess: () => {
|
|
166
|
-
p(
|
|
167
|
+
p(i.AccountUpdated, { accountId: y }), e.success(d.editSuccessToast), O(!1);
|
|
167
168
|
} });
|
|
168
|
-
}, xt = (e) => {
|
|
169
|
-
y && b.canWrite && (C(e), rt(me), P(!1), N(!1), Ze(!0));
|
|
170
|
-
}, St = (e) => {
|
|
171
|
-
(!e || y) && (!e || b.canWrite) && (e || (P(!1), N(!1)), Ze(e));
|
|
172
169
|
}, Ct = (e) => {
|
|
173
|
-
|
|
174
|
-
}, wt = () => {
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
170
|
+
g && _.canWrite && (b(e), R(he), A(!1), k(!1), it(!0));
|
|
171
|
+
}, wt = (e) => {
|
|
172
|
+
(!e || g) && (!e || _.canWrite) && (e || (A(!1), k(!1)), it(e));
|
|
173
|
+
}, Tt = (e) => {
|
|
174
|
+
G.reset(), A(!1), R(e);
|
|
175
|
+
}, Et = () => {
|
|
176
|
+
if (!g || !_.canWrite || !y || !ye(L)) return;
|
|
177
|
+
let e = a(L.firstAmount), t = a(L.secondAmount);
|
|
178
|
+
e !== null && t !== null && (A(!1), G.mutate({
|
|
179
|
+
path: { id: y },
|
|
179
180
|
body: {
|
|
180
181
|
firstAmount: e,
|
|
181
182
|
secondAmount: t
|
|
182
183
|
}
|
|
183
184
|
}, { onSuccess: (e) => {
|
|
184
|
-
if (!
|
|
185
|
-
|
|
185
|
+
if (!He(e)) {
|
|
186
|
+
A(!0);
|
|
186
187
|
return;
|
|
187
188
|
}
|
|
188
|
-
p(
|
|
189
|
+
p(i.AccountVerified, { accountId: y }), n("tesouro-new-external-bank-account-linked-success"), k(!0);
|
|
189
190
|
} }));
|
|
190
|
-
}, Tt = (e) => {
|
|
191
|
-
y && b.canMicroDeposit && (j("row"), W.mutate({ path: { id: e } }, { onSuccess: () => {
|
|
192
|
-
j(void 0), Je((t) => f(t, e)), p(a.AccountLinked, { accountId: e });
|
|
193
|
-
} }));
|
|
194
|
-
}, Et = (e) => {
|
|
195
|
-
y && b.canWrite && I(e);
|
|
196
191
|
}, Dt = (e) => {
|
|
197
|
-
e
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
192
|
+
g && _.canMicroDeposit && (E("row"), W.mutate({ path: { id: e } }, { onSuccess: () => {
|
|
193
|
+
E(void 0), tt((t) => f(t, e)), p(i.AccountLinked, { accountId: e });
|
|
194
|
+
} }));
|
|
195
|
+
}, Ot = (e) => {
|
|
196
|
+
g && _.canWrite && M(e);
|
|
197
|
+
}, kt = (e) => {
|
|
198
|
+
e || M(void 0);
|
|
199
|
+
}, At = () => {
|
|
200
|
+
if (!g || !_.canWrite || !j) return;
|
|
201
|
+
let t = j;
|
|
201
202
|
U.mutate({ path: { id: t } }, { onSuccess: () => {
|
|
202
|
-
p(
|
|
203
|
+
p(i.AccountUnlinked, { accountId: t }), e.success(d.unlinkSuccessToast), M(void 0);
|
|
203
204
|
} });
|
|
204
|
-
},
|
|
205
|
-
selectedUserIds:
|
|
206
|
-
disabled:
|
|
205
|
+
}, jt = B.isPending || V.isPending || H.isPending || G.isPending || U.isPending || W.isPending, Mt = _.canWrite, Nt = !g || jt, $ = W.isError && et === "connect", Pt = Ie(Y, {
|
|
206
|
+
selectedUserIds: w,
|
|
207
|
+
disabled: Nt || !Mt,
|
|
207
208
|
fallbackTooltip: u.teamMemberAccessTooltip,
|
|
208
|
-
onUserToggle:
|
|
209
|
-
}),
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
209
|
+
onUserToggle: vt
|
|
210
|
+
}), Ft = Y.filter((e) => e.locked).length + w.length, It = T ? ((e) => {
|
|
211
|
+
let t = e.accountNumber.slice(-4), n = {
|
|
212
|
+
type: {
|
|
213
|
+
text: De(e.accountHolderType ? Te(e.accountHolderType) : N.accountHolderType, e.type ?? N.type, d),
|
|
214
|
+
emphasized: !1
|
|
215
|
+
},
|
|
216
|
+
last4: {
|
|
217
|
+
text: t,
|
|
218
|
+
emphasized: !0
|
|
219
|
+
}
|
|
220
|
+
};
|
|
221
|
+
return D.has(e.id) ? {
|
|
222
|
+
variant: "deposits-sent",
|
|
223
|
+
description: o(d.summaryDescription, n),
|
|
224
|
+
nextSteps: [{
|
|
225
|
+
key: "check-bank",
|
|
226
|
+
title: d.summaryCheckBankTitle.replaceAll("{last4}", t),
|
|
227
|
+
description: o(d.summaryCheckBankDescription, n)
|
|
228
|
+
}, {
|
|
229
|
+
key: "verify",
|
|
230
|
+
title: d.summaryVerifyTitle,
|
|
231
|
+
description: o(d.summaryVerifyDescription, n)
|
|
232
|
+
}]
|
|
233
|
+
} : {
|
|
234
|
+
variant: "account-added",
|
|
235
|
+
description: o(d.summaryAccountAddedDescription, n),
|
|
236
|
+
nextSteps: []
|
|
237
|
+
};
|
|
238
|
+
})(T) : void 0, Lt = we(Z, d, _, {
|
|
219
239
|
labels: u,
|
|
220
|
-
onEditSelect:
|
|
221
|
-
onVerifySelect:
|
|
222
|
-
onLinkSelect:
|
|
223
|
-
onUnlinkSelect:
|
|
224
|
-
}),
|
|
240
|
+
onEditSelect: bt,
|
|
241
|
+
onVerifySelect: Ct,
|
|
242
|
+
onLinkSelect: Dt,
|
|
243
|
+
onUnlinkSelect: Ot
|
|
244
|
+
}), Rt = s(() => {
|
|
225
245
|
if (!B.isError && !V.isError && !$) return;
|
|
226
246
|
let e = B.error ?? V.error ?? ($ ? W.error : void 0);
|
|
227
247
|
return ee(e) ?? u.actionErrorTitle;
|
|
@@ -235,51 +255,51 @@ function p({ labels: i, featureLabels: l }) {
|
|
|
235
255
|
u.actionErrorTitle
|
|
236
256
|
]);
|
|
237
257
|
return {
|
|
238
|
-
rows:
|
|
239
|
-
isLoading: !
|
|
240
|
-
isError:
|
|
241
|
-
isConnectOpen:
|
|
242
|
-
isEditOpen:
|
|
243
|
-
isVerifyOpen:
|
|
244
|
-
isVerifySuccess:
|
|
245
|
-
verifyAccountName: Z.find((e) => e.id ===
|
|
246
|
-
verifyAccountNumber: Z.find((e) => e.id ===
|
|
247
|
-
isUnlinkOpen: !!
|
|
248
|
-
unlinkAccountNumber: Z.find((e) => e.id ===
|
|
249
|
-
connectStep:
|
|
250
|
-
accessRows:
|
|
251
|
-
accessGrantedCount:
|
|
252
|
-
connectSummary:
|
|
253
|
-
isTeamMembersLoading:
|
|
254
|
-
isTeamMembersError: q.isError ||
|
|
255
|
-
isConnectNextDisabled:
|
|
256
|
-
isConnectRoutingNumberInvalid:
|
|
257
|
-
connectErrorMessage:
|
|
258
|
-
isVerifyFirstAmountInvalid:
|
|
259
|
-
isVerifySecondAmountInvalid:
|
|
260
|
-
isVerifySubmitDisabled: !
|
|
261
|
-
isActionDisabled:
|
|
262
|
-
canConnect:
|
|
263
|
-
isSubmitting:
|
|
264
|
-
isActionError: W.isError || U.isError || B.isError || V.isError || H.isError || G.isError ||
|
|
258
|
+
rows: Lt,
|
|
259
|
+
isLoading: !Ye && (Je && !z.data || Ke && !h || v && z.isLoading),
|
|
260
|
+
isError: Ye || v && z.isError,
|
|
261
|
+
isConnectOpen: x,
|
|
262
|
+
isEditOpen: nt,
|
|
263
|
+
isVerifyOpen: rt,
|
|
264
|
+
isVerifySuccess: at,
|
|
265
|
+
verifyAccountName: Z.find((e) => e.id === y)?.nickname,
|
|
266
|
+
verifyAccountNumber: Z.find((e) => e.id === y)?.accountNumber,
|
|
267
|
+
isUnlinkOpen: !!j,
|
|
268
|
+
unlinkAccountNumber: Z.find((e) => e.id === j)?.accountNumber,
|
|
269
|
+
connectStep: S,
|
|
270
|
+
accessRows: Pt,
|
|
271
|
+
accessGrantedCount: Ft,
|
|
272
|
+
connectSummary: It,
|
|
273
|
+
isTeamMembersLoading: ut,
|
|
274
|
+
isTeamMembersError: q.isError || lt,
|
|
275
|
+
isConnectNextDisabled: S === 1 ? !ge(N) : S === 2 && !dt,
|
|
276
|
+
isConnectRoutingNumberInvalid: N.routingNumber.trim() !== "" && !_e(N.routingNumber),
|
|
277
|
+
connectErrorMessage: Rt,
|
|
278
|
+
isVerifyFirstAmountInvalid: L.firstAmount.trim() !== "" && !ve(L.firstAmount),
|
|
279
|
+
isVerifySecondAmountInvalid: L.secondAmount.trim() !== "" && !ve(L.secondAmount),
|
|
280
|
+
isVerifySubmitDisabled: !ye(L),
|
|
281
|
+
isActionDisabled: Nt,
|
|
282
|
+
canConnect: Mt,
|
|
283
|
+
isSubmitting: jt,
|
|
284
|
+
isActionError: W.isError || U.isError || B.isError || V.isError || H.isError || G.isError || ot,
|
|
265
285
|
isConnectError: B.isError || V.isError || $,
|
|
266
286
|
isEditError: H.isError,
|
|
267
|
-
isVerifyError: G.isError ||
|
|
268
|
-
connectForm:
|
|
269
|
-
editForm:
|
|
270
|
-
verifyForm:
|
|
271
|
-
onConnectOpenChange:
|
|
272
|
-
onEditOpenChange:
|
|
273
|
-
onVerifyOpenChange:
|
|
274
|
-
onUnlinkOpenChange:
|
|
275
|
-
onConnectFormChange:
|
|
276
|
-
onEditFormChange:
|
|
277
|
-
onVerifyFormChange:
|
|
278
|
-
onConnectNext:
|
|
279
|
-
onConnectBack:
|
|
280
|
-
onEditSubmit:
|
|
281
|
-
onVerifySubmit:
|
|
282
|
-
onUnlinkConfirm:
|
|
287
|
+
isVerifyError: G.isError || ot,
|
|
288
|
+
connectForm: N,
|
|
289
|
+
editForm: F,
|
|
290
|
+
verifyForm: L,
|
|
291
|
+
onConnectOpenChange: yt,
|
|
292
|
+
onEditOpenChange: xt,
|
|
293
|
+
onVerifyOpenChange: wt,
|
|
294
|
+
onUnlinkOpenChange: kt,
|
|
295
|
+
onConnectFormChange: pt,
|
|
296
|
+
onEditFormChange: I,
|
|
297
|
+
onVerifyFormChange: Tt,
|
|
298
|
+
onConnectNext: gt,
|
|
299
|
+
onConnectBack: _t,
|
|
300
|
+
onEditSubmit: St,
|
|
301
|
+
onVerifySubmit: Et,
|
|
302
|
+
onUnlinkConfirm: At
|
|
283
303
|
};
|
|
284
304
|
}
|
|
285
305
|
//#endregion
|
|
@@ -82,6 +82,7 @@ var y = [e.ExternalBankAccountReadOrg], b = [...y, e.ExternalBankAccountWriteOrg
|
|
|
82
82
|
accountNumber: C(a(i.accountNumber, "0000")),
|
|
83
83
|
routingNumber: a(i.routingNumber, "123456780"),
|
|
84
84
|
type: i.type === "SAVINGS" ? "SAVINGS" : "CHECKING",
|
|
85
|
+
accountHolderType: i.accountHolderType === "BUSINESS" ? "BUSINESS" : "INDIVIDUAL",
|
|
85
86
|
verificationStatus: "UNVERIFIED"
|
|
86
87
|
};
|
|
87
88
|
return n.push(o), f(o, 201);
|
package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/ui/dist/index10.js
CHANGED
|
@@ -1,90 +1,40 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import "../../../shared/ui/dist/index.js";
|
|
4
|
-
import { linkedAccountsWidgetUiTestIds as s } from "./index9.js";
|
|
5
|
-
import { ConnectStepAccess as c } from "./index4.js";
|
|
6
|
-
import { ConnectStepDetails as l } from "./index6.js";
|
|
7
|
-
import { ConnectStepSummary as u } from "./index7.js";
|
|
8
|
-
import { DialogFeaturedIcon as d } from "./index8.js";
|
|
9
|
-
import { jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
10
|
-
import { ArrowLeftIcon as m, ArrowRightIcon as h, LinkIcon as g } from "lucide-react";
|
|
1
|
+
import { Input as e, Label as t } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
2
|
+
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
11
3
|
//#region ../../libs/tesouro-embedded-components-react/linked-accounts-widget/ui/dist/index10.js
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
isError: E
|
|
46
|
-
}),
|
|
47
|
-
z && w && /* @__PURE__ */ f(u, {
|
|
48
|
-
labels: y,
|
|
49
|
-
summary: w
|
|
50
|
-
}),
|
|
51
|
-
A && !z && /* @__PURE__ */ f(o, { children: N ?? y.actionErrorTitle })
|
|
52
|
-
]
|
|
53
|
-
}),
|
|
54
|
-
/* @__PURE__ */ f(r, {
|
|
55
|
-
className: "ttw:px-6 ttw:pb-6 ttw:pt-4",
|
|
56
|
-
children: z ? /* @__PURE__ */ p(e, {
|
|
57
|
-
type: "button",
|
|
58
|
-
variant: "outline",
|
|
59
|
-
className: "ttw:w-full",
|
|
60
|
-
onClick: () => P(!1),
|
|
61
|
-
children: [/* @__PURE__ */ f(m, {}), y.backToTransfersButton]
|
|
62
|
-
}) : /* @__PURE__ */ p("div", {
|
|
63
|
-
className: "ttw:flex ttw:w-full ttw:items-center ttw:justify-between ttw:gap-3",
|
|
64
|
-
children: [/* @__PURE__ */ f("span", {
|
|
65
|
-
className: "ttw:text-sm ttw:font-medium ttw:text-muted-foreground",
|
|
66
|
-
children: B
|
|
67
|
-
}), /* @__PURE__ */ p("div", {
|
|
68
|
-
className: "ttw:flex ttw:gap-2",
|
|
69
|
-
children: [/* @__PURE__ */ f(e, {
|
|
70
|
-
type: "button",
|
|
71
|
-
variant: "outline",
|
|
72
|
-
disabled: D,
|
|
73
|
-
onClick: b === 1 ? () => P(!1) : L,
|
|
74
|
-
children: b === 1 ? y.cancelButton : y.backButton
|
|
75
|
-
}), /* @__PURE__ */ p(e, {
|
|
76
|
-
type: "button",
|
|
77
|
-
loading: D,
|
|
78
|
-
disabled: R || j,
|
|
79
|
-
onClick: I,
|
|
80
|
-
children: [y.nextButton, /* @__PURE__ */ f(h, {})]
|
|
81
|
-
})]
|
|
82
|
-
})]
|
|
83
|
-
})
|
|
84
|
-
})
|
|
85
|
-
]
|
|
86
|
-
})
|
|
4
|
+
function i({ id: i, label: a, value: o, disabled: s = !1, readOnly: c = !1, required: l = !1, error: u = !1, errorMessage: d, maxLength: f, inputMode: p, onChange: m }) {
|
|
5
|
+
let h = d ? `${i}-error` : void 0;
|
|
6
|
+
return /* @__PURE__ */ r("div", {
|
|
7
|
+
className: "ttw:space-y-1",
|
|
8
|
+
children: [/* @__PURE__ */ r("div", {
|
|
9
|
+
className: "ttw:relative",
|
|
10
|
+
children: [/* @__PURE__ */ n(e, {
|
|
11
|
+
id: i,
|
|
12
|
+
placeholder: " ",
|
|
13
|
+
disabled: s,
|
|
14
|
+
readOnly: c,
|
|
15
|
+
required: l,
|
|
16
|
+
"aria-invalid": u || void 0,
|
|
17
|
+
"aria-describedby": u ? h : void 0,
|
|
18
|
+
value: o,
|
|
19
|
+
maxLength: f,
|
|
20
|
+
inputMode: p,
|
|
21
|
+
onChange: (e) => m?.(e.target.value),
|
|
22
|
+
className: "ttw:peer ttw:h-auto ttw:min-h-12 ttw:rounded-xl ttw:px-3 ttw:pt-5 ttw:pb-1 ttw:text-base ttw:leading-6 ttw:placeholder:text-transparent"
|
|
23
|
+
}), /* @__PURE__ */ r(t, {
|
|
24
|
+
htmlFor: i,
|
|
25
|
+
className: `ttw:pointer-events-none ttw:absolute ttw:top-1.5 ttw:left-3 ttw:gap-0.5 ttw:font-normal ttw:text-xs ttw:transition-all ttw:peer-placeholder-shown:top-1/2 ttw:peer-placeholder-shown:-translate-y-1/2 ttw:peer-placeholder-shown:text-base ttw:peer-focus:top-1.5 ttw:peer-focus:translate-y-0 ttw:peer-focus:text-xs ${u ? "ttw:text-destructive" : "ttw:text-muted-foreground"}`,
|
|
26
|
+
children: [a, l && /* @__PURE__ */ n("span", {
|
|
27
|
+
className: "ttw:text-destructive",
|
|
28
|
+
"aria-hidden": "true",
|
|
29
|
+
children: "*"
|
|
30
|
+
})]
|
|
31
|
+
})]
|
|
32
|
+
}), u && d && /* @__PURE__ */ n("p", {
|
|
33
|
+
id: h,
|
|
34
|
+
className: "ttw:text-xs ttw:text-destructive",
|
|
35
|
+
children: d
|
|
36
|
+
})]
|
|
87
37
|
});
|
|
88
38
|
}
|
|
89
39
|
//#endregion
|
|
90
|
-
export {
|
|
40
|
+
export { i as TextInput };
|
package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/ui/dist/index11.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Button as e, Dialog as t, DialogContent as n, DialogFooter as r, DialogHeader as i, DialogTitle as a } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
2
2
|
import { InlineErrorAlert as o } from "../../../shared/ui/dist/lib/InlineErrorAlert/InlineErrorAlert.js";
|
|
3
3
|
import "../../../shared/ui/dist/index.js";
|
|
4
|
-
import { TextInput as s } from "./
|
|
4
|
+
import { TextInput as s } from "./index10.js";
|
|
5
5
|
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
6
6
|
//#region ../../libs/tesouro-embedded-components-react/linked-accounts-widget/ui/dist/index11.js
|
|
7
7
|
function u({ open: u, labels: d, editForm: f, isSubmitting: p, isActionDisabled: m, isEditError: h, onOpenChange: g, onEditFormChange: _, onEditSubmit: v }) {
|