@tesouro/embedded-components-react 0.7.70 → 0.7.73
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 +15 -12
- package/dist/index.css +24 -6
- package/dist/index.d.ts +76 -8
- package/dist/lib/LinkedAccountsWidget.d.ts +9 -0
- package/dist/lib/ProductsWidget.d.ts +12 -6
- package/dist/lib/ReceivablesWidget.d.ts +1 -5
- package/dist/lib/TransfersWidget.d.ts +55 -2
- package/dist/lib/WidgetSuite.d.ts +63 -1
- package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/feature/dist/lib/LinkedAccountsWidget.js +6 -4
- package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/feature/dist/lib/useLinkedAccountsWidget.js +199 -182
- package/dist/libs/tesouro-embedded-components-react/products-widget/feature/dist/lib/ProductsWidget/ProductsWidget.js +23 -24
- package/dist/libs/tesouro-embedded-components-react/products-widget/feature/dist/lib/ProductsWidget/constants.js +6 -2
- package/dist/libs/tesouro-embedded-components-react/products-widget/feature/dist/lib/ProductsWidget/useProductsTable.js +112 -51
- package/dist/libs/tesouro-embedded-components-react/products-widget/feature/dist/lib/ProductsWidget/useProductsWidget.js +80 -56
- package/dist/libs/tesouro-embedded-components-react/products-widget/ui/dist/index.js +6 -5
- package/dist/libs/tesouro-embedded-components-react/products-widget/ui/dist/index2.js +15 -6
- package/dist/libs/tesouro-embedded-components-react/products-widget/ui/dist/index4.js +170 -135
- package/dist/libs/tesouro-embedded-components-react/products-widget/ui/dist/index5.js +49 -150
- package/dist/libs/tesouro-embedded-components-react/products-widget/ui/dist/index6.js +152 -24
- package/dist/libs/tesouro-embedded-components-react/products-widget/ui/dist/index7.js +28 -0
- 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/product-catalog/feature/dist/index.js +13 -12
- package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/feature/dist/lib/MeasureUnitsManagerContainer.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/feature/dist/lib/ProductSelector.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/feature/dist/lib/helpers.js +41 -27
- package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/feature/dist/lib/useProductForm.js +70 -52
- package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/ui/dist/index.js +7 -6
- package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/ui/dist/index2.js +19 -8
- package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/ui/dist/index3.js +171 -218
- package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/ui/dist/index4.js +52 -180
- package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/ui/dist/index5.js +188 -46
- package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/ui/dist/index6.js +47 -124
- package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/ui/dist/index7.js +128 -0
- package/dist/libs/tesouro-embedded-components-react/transfers-widget/feature/dist/lib/TransfersWidget/TransfersWidgetFeature.js +4 -3
- package/dist/libs/tesouro-embedded-components-react/transfers-widget/feature/dist/lib/TransfersWidget/TransfersWidgetInner.js +99 -108
- package/dist/libs/tesouro-embedded-components-react/transfers-widget/feature/dist/lib/TransfersWidget/testIds.js +2 -0
- package/dist/libs/tesouro-embedded-components-react/transfers-widget/feature/dist/lib/TransfersWidget/transferViews.js +135 -0
- package/dist/libs/tesouro-embedded-components-react/transfers-widget/feature/dist/lib/TransfersWidget/useTransferMoneyModalController.js +140 -153
- package/dist/libs/tesouro-embedded-components-react/transfers-widget/ui/dist/lib/TransfersWidget/TransferAccountTile.js +15 -0
- package/dist/libs/tesouro-embedded-components-react/transfers-widget/ui/dist/lib/TransfersWidget/TransferDetailSheet.js +111 -0
- package/dist/libs/tesouro-embedded-components-react/transfers-widget/ui/dist/lib/TransfersWidget/TransferStatusBadge.js +18 -0
- package/dist/libs/tesouro-embedded-components-react/transfers-widget/ui/dist/lib/TransfersWidget/TransfersWidget.js +181 -126
- package/dist/libs/tesouro-embedded-components-react/transfers-widget/ui/dist/lib/TransfersWidget/labels.js +33 -0
- package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/lib/WidgetSuite/sections/TransfersSection.js +16 -8
- package/dist/packages/shared-ui-shadcn/dist/index.js +328 -327
- package/package.json +1 -1
|
@@ -7,43 +7,44 @@ import { TESOURO_NEW_EXTERNAL_BANK_ACCOUNT_LINKED_SUCCESS_EVENT as t, emitWidget
|
|
|
7
7
|
import { extractApiErrorMessage as ee } from "../../../../shared/util/dist/lib/apiErrors.js";
|
|
8
8
|
import { OrganizationStatus as te, isOrganizationOnItsWay as ne } from "../../../../shared/data-access/dist/lib/organizationStatus.js";
|
|
9
9
|
import { useEmbedApi as re } from "../../../../shared/data-access/dist/lib/EmbedApiContext.js";
|
|
10
|
-
import { Scope as
|
|
11
|
-
import { useOrganizationQuery as
|
|
12
|
-
import { useAllOrganizationRolesQuery as
|
|
13
|
-
import { useAllOrganizationUsersQuery as
|
|
10
|
+
import { Scope as r } from "../../../../shared/data-access/dist/lib/scopes.js";
|
|
11
|
+
import { useOrganizationQuery as ie } from "../../../../shared/data-access/dist/lib/organization/useOrganizationQuery.js";
|
|
12
|
+
import { useAllOrganizationRolesQuery as ae } from "../../../../shared/data-access/dist/lib/role/useAllOrganizationRolesQuery.js";
|
|
13
|
+
import { useAllOrganizationUsersQuery as oe } from "../../../../shared/data-access/dist/lib/user/useAllOrganizationUsersQuery.js";
|
|
14
14
|
import "../../../../shared/data-access/dist/index.js";
|
|
15
15
|
import "../../../../shared/ui/dist/index.js";
|
|
16
|
-
import { useAnalyticsTrack as
|
|
17
|
-
import { useWidgetConfig as
|
|
16
|
+
import { useAnalyticsTrack as se } from "../../../../shared/feature/dist/lib/analytics/hooks.js";
|
|
17
|
+
import { useWidgetConfig as ce, useWidgetError as le, useWidgetLoading as ue } from "../../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
|
|
18
18
|
import "../../../../shared/feature/dist/index.js";
|
|
19
|
-
import { filterRolesForOrganization as
|
|
20
|
-
import { filterUsersForOrganization as
|
|
21
|
-
import { DEFAULT_FEATURE_LABELS as
|
|
22
|
-
import { LinkedAccountsWidgetAnalyticsEvent as
|
|
23
|
-
import { EMPTY_CONNECT_FORM as
|
|
24
|
-
import { getLinkedAccountsPermissions as
|
|
25
|
-
import { toAccountRows as
|
|
26
|
-
import { fromApiAccountHolderType as
|
|
27
|
-
import { useConnectExternalBankAccountMutation as
|
|
28
|
-
import { useExternalBankAccountsQuery as
|
|
29
|
-
import { useGrantExternalBankAccountAccessMutation as
|
|
30
|
-
import { useLinkExternalBankAccountMutation as
|
|
31
|
-
import { useUnlinkExternalBankAccountMutation as
|
|
32
|
-
import { useUpdateExternalBankAccountMutation as
|
|
33
|
-
import { useValidateExternalBankAccountMutation as
|
|
19
|
+
import { filterRolesForOrganization as de } from "../../../../../shared/util-validation/dist/index6.js";
|
|
20
|
+
import { filterUsersForOrganization as fe } from "../../../../../shared/util-validation/dist/index7.js";
|
|
21
|
+
import { DEFAULT_FEATURE_LABELS as pe } from "./labels.js";
|
|
22
|
+
import { LinkedAccountsWidgetAnalyticsEvent as i } from "./analytics/events.js";
|
|
23
|
+
import { EMPTY_CONNECT_FORM as me, EMPTY_EDIT_FORM as he, EMPTY_VERIFY_FORM as ge, isConnectStep1Valid as _e, isRoutingNumberValid as ve, isVerifyAmountInRange as ye, isVerifyFormValid as be, parseVerifyAmountToMinorUnits as xe, sanitizeRoutingNumberInput as Se, toEditForm as Ce, toUpdateBody as we } from "./forms.js";
|
|
24
|
+
import { getLinkedAccountsPermissions as Te } from "./permissions.js";
|
|
25
|
+
import { toAccountRows as Ee } from "./rows.js";
|
|
26
|
+
import { fromApiAccountHolderType as De, toApiAccountHolderType as Oe, toSummaryTypeLabel as ke, toTextParts as a } from "./summary.js";
|
|
27
|
+
import { useConnectExternalBankAccountMutation as Ae } from "../../../data-access/dist/index3.js";
|
|
28
|
+
import { useExternalBankAccountsQuery as je } from "../../../data-access/dist/index4.js";
|
|
29
|
+
import { useGrantExternalBankAccountAccessMutation as Me } from "../../../data-access/dist/index5.js";
|
|
30
|
+
import { useLinkExternalBankAccountMutation as Ne } from "../../../data-access/dist/index6.js";
|
|
31
|
+
import { useUnlinkExternalBankAccountMutation as Pe } from "../../../data-access/dist/index9.js";
|
|
32
|
+
import { useUpdateExternalBankAccountMutation as Fe } from "../../../data-access/dist/index10.js";
|
|
33
|
+
import { useValidateExternalBankAccountMutation as Ie } from "../../../data-access/dist/index11.js";
|
|
34
34
|
import "../../../data-access/dist/index.js";
|
|
35
|
-
import { useAdminEligibleUserIds as
|
|
36
|
-
import { toAccessRows as
|
|
37
|
-
import { DEFAULT_LABELS as
|
|
35
|
+
import { useAdminEligibleUserIds as Le } from "./useAdminEligibleUserIds.js";
|
|
36
|
+
import { toAccessRows as Re, toOrganizationRoleOptions as ze, toTeamMembers as Be } from "./teamMembers.js";
|
|
37
|
+
import { DEFAULT_LABELS as Ve } from "../../../ui/dist/index15.js";
|
|
38
38
|
import "../../../ui/dist/index.js";
|
|
39
|
-
import { useCallback as
|
|
39
|
+
import { useCallback as He, useEffect as o, useMemo as s, useState as c } from "react";
|
|
40
|
+
import { useControllableState as Ue } from "@radix-ui/react-use-controllable-state";
|
|
40
41
|
//#region ../../libs/tesouro-embedded-components-react/linked-accounts-widget/feature/dist/lib/useLinkedAccountsWidget.js
|
|
41
|
-
function
|
|
42
|
+
function We(e) {
|
|
42
43
|
let t = e;
|
|
43
44
|
return typeof e == "object" && !!e && "verificationStatus" in e && t.verificationStatus === "VERIFIED";
|
|
44
45
|
}
|
|
45
46
|
var l = "tesouro.linkedAccounts.locallySentMicroDepositAccountIds.v1";
|
|
46
|
-
function
|
|
47
|
+
function Ge() {
|
|
47
48
|
if (typeof window > "u") return /* @__PURE__ */ new Set();
|
|
48
49
|
try {
|
|
49
50
|
let e = window.sessionStorage.getItem(l), t = e ? JSON.parse(e) : [];
|
|
@@ -60,86 +61,91 @@ function d(e) {
|
|
|
60
61
|
window.sessionStorage.setItem(l, JSON.stringify([...e]));
|
|
61
62
|
} catch {}
|
|
62
63
|
}
|
|
63
|
-
function
|
|
64
|
+
function f(e, t) {
|
|
64
65
|
let n = new Set(e).add(t);
|
|
65
66
|
return d(n), n;
|
|
66
67
|
}
|
|
67
|
-
var Ke =
|
|
68
|
-
function
|
|
69
|
-
let
|
|
70
|
-
...
|
|
71
|
-
...
|
|
72
|
-
},
|
|
73
|
-
...
|
|
68
|
+
var Ke = r.ExternalBankAccountWriteOrg;
|
|
69
|
+
function p({ labels: r, featureLabels: l, isLinkAccountOpen: u, onLinkAccountOpenChange: d }) {
|
|
70
|
+
let p = {
|
|
71
|
+
...Ve,
|
|
72
|
+
...r
|
|
73
|
+
}, m = {
|
|
74
|
+
...pe,
|
|
74
75
|
...l
|
|
75
|
-
},
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
76
|
+
}, h = se(), { organizationId: g, widgetToken: _, initResponse: v } = ce(), qe = ue(), { organizationStatus: y } = re(), Je = ne(y), Ye = !!le(), b = !!(g && _), Xe = b || !!_ && y === te.Rotating, x = s(() => Te(v?.scopes), [v?.scopes]), S = Xe && x.canRead && !!v, [C, Ze] = c(), [Qe, $e] = Ue({
|
|
77
|
+
prop: u,
|
|
78
|
+
defaultProp: !1,
|
|
79
|
+
onChange: d,
|
|
80
|
+
caller: "LinkedAccountsWidget"
|
|
81
|
+
}), et = b && x.canWrite, w = Qe && et, [T, E] = c(1), [D, tt] = c([]), [O, nt] = c(), [rt, k] = c(), [A, it] = c(Ge), [at, j] = c(!1), [ot, st] = c(!1), [ct, M] = c(!1), [lt, N] = c(!1), [P, F] = c(), [I, ut] = c(me), [dt, ft] = c(!1), [pt, mt] = c(he), [L, ht] = c(ge);
|
|
82
|
+
o(() => {
|
|
83
|
+
h(i.Mounted);
|
|
84
|
+
}, [h]);
|
|
85
|
+
let R = je({
|
|
80
86
|
limit: 100,
|
|
81
|
-
enabled:
|
|
82
|
-
}), z =
|
|
83
|
-
...
|
|
84
|
-
nameOnAccount:
|
|
87
|
+
enabled: S
|
|
88
|
+
}), z = Ae(), B = Me(), V = Fe(), H = Pe(), U = Ne(), W = Ie(), G = w && T >= 2, K = oe({ enabled: G }), q = ae({ enabled: G }), gt = ie({ enabled: w && x.canReadOrganization }).data?.legalName ?? "", J = s(() => dt ? I : {
|
|
89
|
+
...I,
|
|
90
|
+
nameOnAccount: gt
|
|
85
91
|
}, [
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
]), { userIds:
|
|
92
|
+
dt,
|
|
93
|
+
I,
|
|
94
|
+
gt
|
|
95
|
+
]), { userIds: _t, isResolving: vt, isError: yt } = Le({
|
|
90
96
|
enabled: G,
|
|
91
97
|
permissionKey: Ke,
|
|
92
|
-
organizationId:
|
|
98
|
+
organizationId: g
|
|
93
99
|
}), Y = s(() => {
|
|
94
|
-
let e = q.data?.data ?? [], t =
|
|
95
|
-
organizationId:
|
|
96
|
-
organizationTypes:
|
|
97
|
-
}) : e, n =
|
|
98
|
-
return
|
|
100
|
+
let e = q.data?.data ?? [], t = g ? de(e, {
|
|
101
|
+
organizationId: g,
|
|
102
|
+
organizationTypes: v?.organizationTypes ?? []
|
|
103
|
+
}) : e, n = fe(K.data?.data ?? [], g);
|
|
104
|
+
return Be(n, ze(t), _t);
|
|
99
105
|
}, [
|
|
100
|
-
|
|
106
|
+
_t,
|
|
101
107
|
q.data?.data,
|
|
102
108
|
K.data?.data,
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
]),
|
|
109
|
+
g,
|
|
110
|
+
v?.organizationTypes
|
|
111
|
+
]), bt = K.isLoading || K.isFetchingNextPage || !!K.hasNextPage || q.isResolving || vt, xt = !bt && !K.isError && !yt, X = S ? R.data?.data ?? [] : [], Z = s(() => X.map((e) => e.verificationStatus === "UNVERIFIED" && A.has(e.id) ? {
|
|
106
112
|
...e,
|
|
107
113
|
verificationStatus: "VERIFICATION_SENT"
|
|
108
|
-
} : e), [X,
|
|
109
|
-
z.reset(), B.reset(), U.reset(), e.nameOnAccount !== J.nameOnAccount &&
|
|
114
|
+
} : e), [X, A]), St = [.../* @__PURE__ */ new Set([...Y.filter((e) => e.locked).map((e) => e.id), ...D])], Ct = He((e) => {
|
|
115
|
+
z.reset(), B.reset(), U.reset(), e.nameOnAccount !== J.nameOnAccount && ft(!0), ut({
|
|
110
116
|
...e,
|
|
111
|
-
routingNumber:
|
|
117
|
+
routingNumber: Se(e.routingNumber)
|
|
112
118
|
});
|
|
113
119
|
}, [
|
|
114
120
|
J.nameOnAccount,
|
|
115
121
|
z,
|
|
116
122
|
B,
|
|
117
123
|
U
|
|
118
|
-
]),
|
|
119
|
-
|
|
120
|
-
},
|
|
121
|
-
if (!
|
|
122
|
-
|
|
124
|
+
]), wt = () => {
|
|
125
|
+
E(3), n(t);
|
|
126
|
+
}, Tt = (e) => {
|
|
127
|
+
if (!x.canMicroDeposit) {
|
|
128
|
+
wt();
|
|
123
129
|
return;
|
|
124
130
|
}
|
|
125
|
-
|
|
126
|
-
|
|
131
|
+
k("connect"), U.mutate({ path: { id: e } }, { onSuccess: () => {
|
|
132
|
+
k(void 0), it((t) => f(t, e)), h(i.AccountLinked, { accountId: e }), wt();
|
|
127
133
|
} });
|
|
128
|
-
},
|
|
134
|
+
}, Et = (e) => {
|
|
129
135
|
B.mutate({
|
|
130
136
|
path: { id: e },
|
|
131
|
-
body: { userIds:
|
|
132
|
-
}, { onSuccess: () =>
|
|
133
|
-
},
|
|
134
|
-
if (
|
|
135
|
-
if (
|
|
136
|
-
if (!
|
|
137
|
-
|
|
137
|
+
body: { userIds: St }
|
|
138
|
+
}, { onSuccess: () => Tt(e) });
|
|
139
|
+
}, Dt = () => {
|
|
140
|
+
if (b && x.canWrite) {
|
|
141
|
+
if (T === 1) {
|
|
142
|
+
if (!_e(J)) return;
|
|
143
|
+
E(2);
|
|
138
144
|
return;
|
|
139
145
|
}
|
|
140
|
-
if (
|
|
141
|
-
if (
|
|
142
|
-
|
|
146
|
+
if (T === 2 && xt) {
|
|
147
|
+
if (O) {
|
|
148
|
+
Et(O.id);
|
|
143
149
|
return;
|
|
144
150
|
}
|
|
145
151
|
z.mutate({ body: {
|
|
@@ -148,78 +154,89 @@ function f({ labels: ie, featureLabels: l }) {
|
|
|
148
154
|
routingNumber: J.routingNumber.trim(),
|
|
149
155
|
nameOnAccount: J.nameOnAccount.trim(),
|
|
150
156
|
type: J.type,
|
|
151
|
-
accountHolderType:
|
|
157
|
+
accountHolderType: Oe(J.accountHolderType)
|
|
152
158
|
} }, { onSuccess: (e) => {
|
|
153
|
-
|
|
159
|
+
h(i.AccountConnected, { accountId: e?.id }), nt(e), e?.id && Et(e.id);
|
|
154
160
|
} });
|
|
155
161
|
}
|
|
156
162
|
}
|
|
157
|
-
},
|
|
158
|
-
|
|
159
|
-
},
|
|
163
|
+
}, Ot = () => {
|
|
164
|
+
T === 2 && E(1);
|
|
165
|
+
}, kt = (e, t) => {
|
|
160
166
|
Y.find((t) => t.id === e)?.locked || tt((n) => t ? [.../* @__PURE__ */ new Set([...n, e])] : n.filter((t) => t !== e));
|
|
161
|
-
},
|
|
162
|
-
|
|
163
|
-
},
|
|
164
|
-
|
|
167
|
+
}, [At, jt] = c(w);
|
|
168
|
+
w !== At && (jt(w), w && (E(1), ut(me), ft(!1), tt([]), nt(void 0), k(void 0)));
|
|
169
|
+
let { reset: Mt } = z, { reset: Nt } = B, { reset: Q } = U;
|
|
170
|
+
o(() => {
|
|
171
|
+
w && (Mt(), Nt(), Q());
|
|
172
|
+
}, [
|
|
173
|
+
w,
|
|
174
|
+
Mt,
|
|
175
|
+
Nt,
|
|
176
|
+
Q
|
|
177
|
+
]);
|
|
178
|
+
let Pt = (e) => {
|
|
179
|
+
(!e || et) && $e(e);
|
|
180
|
+
}, Ft = (e) => {
|
|
181
|
+
if (!b || !x.canWrite) return;
|
|
165
182
|
let t = X.find((t) => t.id === e);
|
|
166
|
-
|
|
167
|
-
},
|
|
168
|
-
(!e ||
|
|
169
|
-
},
|
|
170
|
-
if (!
|
|
171
|
-
let t = X.find((e) => e.id ===
|
|
183
|
+
Ze(e), mt(Ce(t)), j(!0);
|
|
184
|
+
}, It = (e) => {
|
|
185
|
+
(!e || b) && (!e || x.canWrite) && j(e);
|
|
186
|
+
}, Lt = () => {
|
|
187
|
+
if (!b || !x.canWrite || !C) return;
|
|
188
|
+
let t = X.find((e) => e.id === C), n = we(pt, t);
|
|
172
189
|
Object.keys(n).length !== 0 && V.mutate({
|
|
173
|
-
path: { id:
|
|
190
|
+
path: { id: C },
|
|
174
191
|
body: n
|
|
175
192
|
}, { onSuccess: () => {
|
|
176
|
-
|
|
193
|
+
h(i.AccountUpdated, { accountId: C }), e.success(m.editSuccessToast), j(!1);
|
|
177
194
|
} });
|
|
178
|
-
},
|
|
179
|
-
|
|
180
|
-
},
|
|
181
|
-
(!e ||
|
|
182
|
-
},
|
|
183
|
-
W.reset(),
|
|
184
|
-
},
|
|
185
|
-
if (!
|
|
186
|
-
let e =
|
|
187
|
-
e !== null && t !== null && (
|
|
188
|
-
path: { id:
|
|
195
|
+
}, Rt = (e) => {
|
|
196
|
+
b && x.canWrite && (Ze(e), ht(ge), N(!1), M(!1), st(!0));
|
|
197
|
+
}, zt = (e) => {
|
|
198
|
+
(!e || b) && (!e || x.canWrite) && (e || (N(!1), M(!1)), st(e));
|
|
199
|
+
}, Bt = (e) => {
|
|
200
|
+
W.reset(), N(!1), ht(e);
|
|
201
|
+
}, Vt = () => {
|
|
202
|
+
if (!b || !x.canWrite || !C || !be(L)) return;
|
|
203
|
+
let e = xe(L.firstAmount), t = xe(L.secondAmount);
|
|
204
|
+
e !== null && t !== null && (N(!1), W.mutate({
|
|
205
|
+
path: { id: C },
|
|
189
206
|
body: {
|
|
190
207
|
firstAmount: e,
|
|
191
208
|
secondAmount: t
|
|
192
209
|
}
|
|
193
210
|
}, { onSuccess: (e) => {
|
|
194
|
-
if (!
|
|
195
|
-
|
|
211
|
+
if (!We(e)) {
|
|
212
|
+
N(!0);
|
|
196
213
|
return;
|
|
197
214
|
}
|
|
198
|
-
|
|
215
|
+
h(i.AccountVerified, { accountId: C }), n("tesouro-new-external-bank-account-linked-success"), M(!0);
|
|
199
216
|
} }));
|
|
200
|
-
},
|
|
201
|
-
|
|
202
|
-
|
|
217
|
+
}, Ht = (e) => {
|
|
218
|
+
b && x.canMicroDeposit && (k("row"), U.mutate({ path: { id: e } }, { onSuccess: () => {
|
|
219
|
+
k(void 0), it((t) => f(t, e)), h(i.AccountLinked, { accountId: e });
|
|
203
220
|
} }));
|
|
204
|
-
},
|
|
205
|
-
|
|
206
|
-
},
|
|
207
|
-
e ||
|
|
208
|
-
},
|
|
209
|
-
if (!
|
|
210
|
-
let t =
|
|
221
|
+
}, Ut = (e) => {
|
|
222
|
+
b && x.canWrite && F(e);
|
|
223
|
+
}, Wt = (e) => {
|
|
224
|
+
e || F(void 0);
|
|
225
|
+
}, Gt = () => {
|
|
226
|
+
if (!b || !x.canWrite || !P) return;
|
|
227
|
+
let t = P;
|
|
211
228
|
H.mutate({ path: { id: t } }, { onSuccess: () => {
|
|
212
|
-
|
|
229
|
+
h(i.AccountUnlinked, { accountId: t }), e.success(m.unlinkSuccessToast), F(void 0);
|
|
213
230
|
} });
|
|
214
|
-
},
|
|
215
|
-
selectedUserIds:
|
|
216
|
-
disabled:
|
|
217
|
-
fallbackTooltip:
|
|
218
|
-
onUserToggle:
|
|
219
|
-
}),
|
|
231
|
+
}, Kt = z.isPending || B.isPending || V.isPending || W.isPending || H.isPending || U.isPending, qt = x.canWrite, Jt = !b || Kt, $ = U.isError && rt === "connect", Yt = Re(Y, {
|
|
232
|
+
selectedUserIds: D,
|
|
233
|
+
disabled: Jt || !qt,
|
|
234
|
+
fallbackTooltip: p.teamMemberAccessTooltip,
|
|
235
|
+
onUserToggle: kt
|
|
236
|
+
}), Xt = Y.filter((e) => e.locked).length + D.length, Zt = O ? ((e) => {
|
|
220
237
|
let t = e.accountNumber.slice(-4), n = {
|
|
221
238
|
type: {
|
|
222
|
-
text:
|
|
239
|
+
text: ke(e.accountHolderType ? De(e.accountHolderType) : J.accountHolderType, e.type ?? J.type, m),
|
|
223
240
|
emphasized: !1
|
|
224
241
|
},
|
|
225
242
|
last4: {
|
|
@@ -227,33 +244,33 @@ function f({ labels: ie, featureLabels: l }) {
|
|
|
227
244
|
emphasized: !0
|
|
228
245
|
}
|
|
229
246
|
};
|
|
230
|
-
return
|
|
247
|
+
return A.has(e.id) ? {
|
|
231
248
|
variant: "deposits-sent",
|
|
232
|
-
description:
|
|
249
|
+
description: a(m.summaryDescription, n),
|
|
233
250
|
nextSteps: [{
|
|
234
251
|
key: "check-bank",
|
|
235
|
-
title:
|
|
236
|
-
description:
|
|
252
|
+
title: m.summaryCheckBankTitle.replaceAll("{last4}", t),
|
|
253
|
+
description: a(m.summaryCheckBankDescription, n)
|
|
237
254
|
}, {
|
|
238
255
|
key: "verify",
|
|
239
|
-
title:
|
|
240
|
-
description:
|
|
256
|
+
title: m.summaryVerifyTitle,
|
|
257
|
+
description: a(m.summaryVerifyDescription, n)
|
|
241
258
|
}]
|
|
242
259
|
} : {
|
|
243
260
|
variant: "account-added",
|
|
244
|
-
description:
|
|
261
|
+
description: a(m.summaryAccountAddedDescription, n),
|
|
245
262
|
nextSteps: []
|
|
246
263
|
};
|
|
247
|
-
})(
|
|
248
|
-
labels:
|
|
249
|
-
onEditSelect:
|
|
250
|
-
onVerifySelect:
|
|
251
|
-
onLinkSelect:
|
|
252
|
-
onUnlinkSelect:
|
|
253
|
-
}),
|
|
264
|
+
})(O) : void 0, Qt = Ee(Z, m, x, {
|
|
265
|
+
labels: p,
|
|
266
|
+
onEditSelect: Ft,
|
|
267
|
+
onVerifySelect: Rt,
|
|
268
|
+
onLinkSelect: Ht,
|
|
269
|
+
onUnlinkSelect: Ut
|
|
270
|
+
}), $t = s(() => {
|
|
254
271
|
if (!z.isError && !B.isError && !$) return;
|
|
255
272
|
let e = z.error ?? B.error ?? ($ ? U.error : void 0);
|
|
256
|
-
return ee(e) ??
|
|
273
|
+
return ee(e) ?? p.actionErrorTitle;
|
|
257
274
|
}, [
|
|
258
275
|
z.error,
|
|
259
276
|
z.isError,
|
|
@@ -261,55 +278,55 @@ function f({ labels: ie, featureLabels: l }) {
|
|
|
261
278
|
B.isError,
|
|
262
279
|
$,
|
|
263
280
|
U.error,
|
|
264
|
-
|
|
281
|
+
p.actionErrorTitle
|
|
265
282
|
]);
|
|
266
283
|
return {
|
|
267
|
-
rows:
|
|
268
|
-
isLoading: !
|
|
269
|
-
isError:
|
|
270
|
-
isConnectOpen:
|
|
284
|
+
rows: Qt,
|
|
285
|
+
isLoading: !Ye && (Je && !R.data || qe && !v || S && R.isLoading),
|
|
286
|
+
isError: Ye || S && R.isError,
|
|
287
|
+
isConnectOpen: w,
|
|
271
288
|
isEditOpen: at,
|
|
272
289
|
isVerifyOpen: ot,
|
|
273
290
|
isVerifySuccess: ct,
|
|
274
|
-
verifyAccountName: Z.find((e) => e.id ===
|
|
275
|
-
verifyAccountNumber: Z.find((e) => e.id ===
|
|
276
|
-
isUnlinkOpen: !!
|
|
277
|
-
unlinkAccountNumber: Z.find((e) => e.id ===
|
|
278
|
-
connectStep:
|
|
279
|
-
accessRows:
|
|
280
|
-
accessGrantedCount:
|
|
281
|
-
connectSummary:
|
|
282
|
-
isTeamMembersLoading:
|
|
283
|
-
isTeamMembersError: K.isError ||
|
|
284
|
-
isConnectNextDisabled:
|
|
285
|
-
isConnectRoutingNumberInvalid: J.routingNumber.trim() !== "" && !
|
|
286
|
-
connectErrorMessage:
|
|
287
|
-
isVerifyFirstAmountInvalid:
|
|
288
|
-
isVerifySecondAmountInvalid:
|
|
289
|
-
isVerifySubmitDisabled: !
|
|
290
|
-
isActionDisabled:
|
|
291
|
-
canConnect:
|
|
292
|
-
isSubmitting:
|
|
291
|
+
verifyAccountName: Z.find((e) => e.id === C)?.nickname,
|
|
292
|
+
verifyAccountNumber: Z.find((e) => e.id === C)?.accountNumber,
|
|
293
|
+
isUnlinkOpen: !!P,
|
|
294
|
+
unlinkAccountNumber: Z.find((e) => e.id === P)?.accountNumber,
|
|
295
|
+
connectStep: T,
|
|
296
|
+
accessRows: Yt,
|
|
297
|
+
accessGrantedCount: Xt,
|
|
298
|
+
connectSummary: Zt,
|
|
299
|
+
isTeamMembersLoading: bt,
|
|
300
|
+
isTeamMembersError: K.isError || yt,
|
|
301
|
+
isConnectNextDisabled: T === 1 ? !_e(J) : T === 2 && !xt,
|
|
302
|
+
isConnectRoutingNumberInvalid: J.routingNumber.trim() !== "" && !ve(J.routingNumber),
|
|
303
|
+
connectErrorMessage: $t,
|
|
304
|
+
isVerifyFirstAmountInvalid: L.firstAmount.trim() !== "" && !ye(L.firstAmount),
|
|
305
|
+
isVerifySecondAmountInvalid: L.secondAmount.trim() !== "" && !ye(L.secondAmount),
|
|
306
|
+
isVerifySubmitDisabled: !be(L),
|
|
307
|
+
isActionDisabled: Jt,
|
|
308
|
+
canConnect: qt,
|
|
309
|
+
isSubmitting: Kt,
|
|
293
310
|
isActionError: U.isError || H.isError || z.isError || B.isError || V.isError || W.isError || lt,
|
|
294
311
|
isConnectError: z.isError || B.isError || $,
|
|
295
312
|
isEditError: V.isError,
|
|
296
313
|
isVerifyError: W.isError || lt,
|
|
297
314
|
connectForm: J,
|
|
298
|
-
editForm:
|
|
299
|
-
verifyForm:
|
|
300
|
-
onConnectOpenChange:
|
|
301
|
-
onEditOpenChange:
|
|
302
|
-
onVerifyOpenChange:
|
|
303
|
-
onUnlinkOpenChange:
|
|
304
|
-
onConnectFormChange:
|
|
305
|
-
onEditFormChange:
|
|
306
|
-
onVerifyFormChange:
|
|
307
|
-
onConnectNext:
|
|
308
|
-
onConnectBack:
|
|
309
|
-
onEditSubmit:
|
|
310
|
-
onVerifySubmit:
|
|
311
|
-
onUnlinkConfirm:
|
|
315
|
+
editForm: pt,
|
|
316
|
+
verifyForm: L,
|
|
317
|
+
onConnectOpenChange: Pt,
|
|
318
|
+
onEditOpenChange: It,
|
|
319
|
+
onVerifyOpenChange: zt,
|
|
320
|
+
onUnlinkOpenChange: Wt,
|
|
321
|
+
onConnectFormChange: Ct,
|
|
322
|
+
onEditFormChange: mt,
|
|
323
|
+
onVerifyFormChange: Bt,
|
|
324
|
+
onConnectNext: Dt,
|
|
325
|
+
onConnectBack: Ot,
|
|
326
|
+
onEditSubmit: Lt,
|
|
327
|
+
onVerifySubmit: Vt,
|
|
328
|
+
onUnlinkConfirm: Gt
|
|
312
329
|
};
|
|
313
330
|
}
|
|
314
331
|
//#endregion
|
|
315
|
-
export { l as LOCALLY_SENT_MICRO_DEPOSIT_ACCOUNT_IDS_STORAGE_KEY,
|
|
332
|
+
export { l as LOCALLY_SENT_MICRO_DEPOSIT_ACCOUNT_IDS_STORAGE_KEY, p as useLinkedAccountsWidget };
|
|
@@ -7,17 +7,17 @@ import "../../../../../shared/ui/dist/index.js";
|
|
|
7
7
|
import { useAnalyticsTrack as t } from "../../../../../shared/feature/dist/lib/analytics/hooks.js";
|
|
8
8
|
import { WidgetProvider as n } from "../../../../../shared/feature/dist/lib/WidgetProvider/WidgetProvider.js";
|
|
9
9
|
import "../../../../../shared/feature/dist/index.js";
|
|
10
|
-
import { ProductFormSheet as r } from "../../../../../shared/product-catalog/ui/dist/
|
|
10
|
+
import { ProductFormSheet as r } from "../../../../../shared/product-catalog/ui/dist/index4.js";
|
|
11
11
|
import { MeasureUnitsManagerContainer as i } from "../../../../../shared/product-catalog/feature/dist/lib/MeasureUnitsManagerContainer.js";
|
|
12
12
|
import "../../../../../shared/product-catalog/feature/dist/index.js";
|
|
13
13
|
import { ProductsWidgetAnalyticsEvent as a, WIDGET_NAME as o } from "../analytics/events.js";
|
|
14
14
|
import { PAGE_SIZE_OPTIONS as s } from "./constants.js";
|
|
15
15
|
import { productsWidgetTestIds as c } from "./testIds.js";
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import { ProductDeleteDialog as f } from "../../../../ui/dist/index6.js";
|
|
16
|
+
import { ProductsScreen as l } from "../../../../ui/dist/index4.js";
|
|
17
|
+
import { ProductDetailsSheet as u } from "../../../../ui/dist/index6.js";
|
|
18
|
+
import { ProductDeleteDialog as d } from "../../../../ui/dist/index7.js";
|
|
20
19
|
import "../../../../ui/dist/index.js";
|
|
20
|
+
import { useProductsWidget as f } from "./useProductsWidget.js";
|
|
21
21
|
import { useEffect as p } from "react";
|
|
22
22
|
import { Fragment as m, jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
23
23
|
//#region ../../libs/tesouro-embedded-components-react/products-widget/feature/dist/lib/ProductsWidget/ProductsWidget.js
|
|
@@ -26,10 +26,14 @@ function _({ pageSizeOptions: n = s, screenLabels: o, formLabels: _, detailsLabe
|
|
|
26
26
|
p(() => {
|
|
27
27
|
C(a.Mounted);
|
|
28
28
|
}, [C]);
|
|
29
|
-
let { view: w, units: T, table: E, details: D, form: O, del: k, permissions: A, isPermissionLoading: j, isTableLoading: M, hasInitError: N, refetchWidgetInit: P, measureUnitsOpen: F, actionsSuspended: I,
|
|
29
|
+
let { view: w, units: T, table: E, details: D, form: O, del: k, permissions: A, isPermissionLoading: j, isTableLoading: M, hasInitError: N, refetchWidgetInit: P, measureUnitsOpen: F, actionsSuspended: I, editForm: L, handleRowClick: R, openMeasureUnits: z, closeMeasureUnits: B, submitForm: V, confirmDelete: H } = f({
|
|
30
|
+
messageLabels: S,
|
|
31
|
+
screenLabels: o,
|
|
32
|
+
formLabels: _
|
|
33
|
+
});
|
|
30
34
|
return /* @__PURE__ */ g(m, { children: [
|
|
31
35
|
/* @__PURE__ */ h(e, {}),
|
|
32
|
-
/* @__PURE__ */ h(
|
|
36
|
+
/* @__PURE__ */ h(l, {
|
|
33
37
|
products: E.rows,
|
|
34
38
|
isLoading: M,
|
|
35
39
|
isError: N || E.isError,
|
|
@@ -42,20 +46,14 @@ function _({ pageSizeOptions: n = s, screenLabels: o, formLabels: _, detailsLabe
|
|
|
42
46
|
hasPrevPage: E.hasPrevPage,
|
|
43
47
|
onNextPage: E.onNextPage,
|
|
44
48
|
onPrevPage: E.onPrevPage,
|
|
45
|
-
|
|
46
|
-
onSearchChange: E.onSearchChange,
|
|
47
|
-
typeFilter: E.typeFilter,
|
|
48
|
-
onTypeFilterChange: E.onTypeFilterChange,
|
|
49
|
-
unitFilter: E.unitFilter,
|
|
50
|
-
onUnitFilterChange: E.onUnitFilterChange,
|
|
51
|
-
unitOptions: T.unitOptions,
|
|
49
|
+
filters: E.filters,
|
|
52
50
|
isFiltering: E.isFiltering,
|
|
53
51
|
canCreate: A.canCreate,
|
|
54
52
|
canManageUnits: A.canCreate,
|
|
55
53
|
isAccessRestricted: !j && !N && !A.canRead,
|
|
56
54
|
onCreateClick: O.openCreate,
|
|
57
|
-
onManageUnitsClick:
|
|
58
|
-
onRowClick:
|
|
55
|
+
onManageUnitsClick: z,
|
|
56
|
+
onRowClick: R,
|
|
59
57
|
onRetry: N ? P : E.onRetry,
|
|
60
58
|
labels: o,
|
|
61
59
|
testIds: {
|
|
@@ -64,25 +62,25 @@ function _({ pageSizeOptions: n = s, screenLabels: o, formLabels: _, detailsLabe
|
|
|
64
62
|
}
|
|
65
63
|
}),
|
|
66
64
|
/* @__PURE__ */ h(r, {
|
|
67
|
-
open: w === "create"
|
|
65
|
+
open: w === "create",
|
|
68
66
|
onOpenChange: (e) => {
|
|
69
67
|
e || O.close();
|
|
70
68
|
},
|
|
71
|
-
mode: w === "edit" ? "edit" : "create",
|
|
72
69
|
values: O.values,
|
|
73
70
|
errors: O.errors,
|
|
74
71
|
unitOptions: T.unitOptions,
|
|
72
|
+
pricePrefix: O.pricePrefix,
|
|
75
73
|
inProgress: O.isSubmitting || I,
|
|
76
74
|
onChange: (e) => O.setValues((t) => ({
|
|
77
75
|
...t,
|
|
78
76
|
...e
|
|
79
77
|
})),
|
|
80
|
-
onSubmit:
|
|
78
|
+
onSubmit: V,
|
|
81
79
|
onCancel: O.close,
|
|
82
80
|
labels: _
|
|
83
81
|
}),
|
|
84
|
-
/* @__PURE__ */ h(
|
|
85
|
-
open: w === "details",
|
|
82
|
+
/* @__PURE__ */ h(u, {
|
|
83
|
+
open: w === "details" || w === "edit",
|
|
86
84
|
onOpenChange: (e) => {
|
|
87
85
|
e || O.close();
|
|
88
86
|
},
|
|
@@ -93,20 +91,21 @@ function _({ pageSizeOptions: n = s, screenLabels: o, formLabels: _, detailsLabe
|
|
|
93
91
|
onDelete: k.requestDelete,
|
|
94
92
|
canEdit: A.canUpdate,
|
|
95
93
|
canDelete: A.canDelete,
|
|
94
|
+
editForm: L,
|
|
96
95
|
labels: v
|
|
97
96
|
}),
|
|
98
|
-
/* @__PURE__ */ h(
|
|
97
|
+
/* @__PURE__ */ h(d, {
|
|
99
98
|
open: k.open,
|
|
100
99
|
onOpenChange: k.onOpenChange,
|
|
101
100
|
productName: D.productName,
|
|
102
101
|
isDeleting: k.isDeleting || I,
|
|
103
|
-
onConfirm:
|
|
102
|
+
onConfirm: H,
|
|
104
103
|
onCancel: k.cancel,
|
|
105
104
|
labels: y
|
|
106
105
|
}),
|
|
107
106
|
/* @__PURE__ */ h(i, {
|
|
108
107
|
open: F,
|
|
109
|
-
onClose:
|
|
108
|
+
onClose: B,
|
|
110
109
|
suspended: I,
|
|
111
110
|
managerLabels: b,
|
|
112
111
|
deleteLabels: x,
|
|
@@ -4,6 +4,10 @@ var e = [
|
|
|
4
4
|
25,
|
|
5
5
|
50,
|
|
6
6
|
100
|
|
7
|
-
]
|
|
7
|
+
], t = ["product", "service"], n = {
|
|
8
|
+
Type: "type",
|
|
9
|
+
Unit: "unit",
|
|
10
|
+
Search: "search"
|
|
11
|
+
};
|
|
8
12
|
//#endregion
|
|
9
|
-
export { e as PAGE_SIZE_OPTIONS };
|
|
13
|
+
export { e as PAGE_SIZE_OPTIONS, n as ProductsFilterKey, t as TYPE_FILTER_OPTIONS };
|