@tesouro/embedded-components-react 0.4.15 → 0.4.16
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/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index.js +5 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index14.js +47 -21
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index15.js +20 -77
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index16.js +75 -24
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index17.js +36 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index11.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index14.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index23.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index25.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index39.js +64 -48
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index43.js +10 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index44.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index46.js +141 -118
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index47.js +93 -93
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index48.js +83 -67
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index56.js +235 -218
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index58.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index59.js +5 -5
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index6.js +9 -6
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index66.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index68.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index72.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index76.js +17 -17
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index77.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index78.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index81.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index9.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index.js +39 -39
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index100.js +2 -10
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index101.js +8 -50
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index102.js +52 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index103.js +2 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index25.js +26 -49
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index26.js +19 -306
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index27.js +154 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index28.js +2 -9
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index29.js +60 -45
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index30.js +251 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index31.js +2 -18
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index32.js +7 -48
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index33.js +49 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index34.js +2 -23
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index35.js +15 -337
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index36.js +50 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index37.js +2 -16
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index38.js +21 -118
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index39.js +340 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index40.js +2 -12
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index41.js +10 -97
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index42.js +99 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index43.js +1 -12
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index44.js +11 -57
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index45.js +58 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index46.js +1 -54
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index47.js +52 -10
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index48.js +10 -179
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index49.js +181 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index50.js +2 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index51.js +2 -39
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index52.js +41 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index53.js +2 -7
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index54.js +5 -90
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index55.js +92 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index56.js +2 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index57.js +2 -14
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index58.js +16 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index59.js +1 -87
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index60.js +83 -291
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index61.js +292 -9
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index62.js +13 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index63.js +1 -8
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index64.js +6 -37
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index65.js +39 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index66.js +2 -39
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index67.js +36 -9
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index68.js +10 -199
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index69.js +201 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index70.js +3 -17
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index71.js +15 -345
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index72.js +345 -8
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index73.js +6 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index74.js +6 -91
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index75.js +93 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index77.js +2 -127
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index78.js +124 -25
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index79.js +26 -87
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index80.js +89 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index81.js +2 -7
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index82.js +5 -28
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index83.js +30 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index84.js +2 -7
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index85.js +5 -32
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index86.js +34 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index87.js +2 -12
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index88.js +10 -104
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index89.js +105 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index90.js +2 -17
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index91.js +15 -123
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index92.js +125 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index93.js +2 -18
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index94.js +14 -6
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index95.js +7 -167
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index96.js +170 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index97.js +2 -14
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index98.js +11 -105
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index99.js +108 -2
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/index4.js +8 -8
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index9.js +4 -4
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/data-access/dist/index.js +5 -5
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/index.js +19 -19
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/helpers.js +39 -33
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/subEntityForms.js +15 -15
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/useAddressForm.js +9 -9
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/useCounterpartDetails.js +7 -7
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/useCounterpartForm.js +37 -37
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/useCounterpartSelector.js +15 -15
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/usePayableAchInstructions.js +7 -7
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/package.json +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index76.js +0 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import "./index2.js";
|
|
2
|
-
import { useCounterpartQuery as
|
|
1
|
+
import { counterpartBankAccountsInvalidationKey as e } from "./index2.js";
|
|
2
|
+
import { useCounterpartQuery as t, useCounterpartsQuery as n, useCreateCounterpartMutation as r, useDeleteCounterpartMutation as i, useUpdateCounterpartMutation as a } from "./index3.js";
|
|
3
3
|
import "./index4.js";
|
|
4
|
-
import { useCounterpartBankAccountsQuery as
|
|
4
|
+
import { useCounterpartBankAccountsQuery as o, useCreateCounterpartBankAccountMutation as s, useDeleteCounterpartBankAccountMutation as c, useMakeCounterpartBankAccountDefaultMutation as l, useUpdateCounterpartBankAccountMutation as u } from "./index5.js";
|
|
5
5
|
import "./index6.js";
|
|
6
|
-
import { useCounterpartAddressesForRowsQuery as
|
|
7
|
-
export {
|
|
6
|
+
import { useCounterpartAddressesForRowsQuery as d, useCounterpartAddressesQuery as f, useCreateCounterpartAddressMutation as p, useUpdateCounterpartAddressMutation as m } from "./index7.js";
|
|
7
|
+
export { e as counterpartBankAccountsInvalidationKey, d as useCounterpartAddressesForRowsQuery, f as useCounterpartAddressesQuery, o as useCounterpartBankAccountsQuery, t as useCounterpartQuery, n as useCounterpartsQuery, p as useCreateCounterpartAddressMutation, s as useCreateCounterpartBankAccountMutation, r as useCreateCounterpartMutation, c as useDeleteCounterpartBankAccountMutation, i as useDeleteCounterpartMutation, l as useMakeCounterpartBankAccountDefaultMutation, m as useUpdateCounterpartAddressMutation, u as useUpdateCounterpartBankAccountMutation, a as useUpdateCounterpartMutation };
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import "../../../util/dist/lib/apiErrors.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { AddressFormSheet as a } from "../../ui/dist/index13.js";
|
|
6
|
-
import { ConfirmDeleteDialog as o } from "../../ui/dist/index14.js";
|
|
7
|
-
import "../../ui/dist/index.js";
|
|
8
|
-
import { COUNTERPART_MESSAGE_LABELS_EN as s } from "./lib/labels.js";
|
|
9
|
-
import { buildAnalyticsMap as c, buildCounterpartRows as l, counterpartFormBankAccountToCreatePayload as u, counterpartFormBankAccountToUpdatePayload as d, formatCounterpartDate as f, formatMoney as p, getAchInstructions as m, getCounterpartEmail as h, getCounterpartName as g, getPayableAchInstructions as _, hasAchFormValues as v, hasSelectedText as y, resolveCounterpartBankAccountWrite as b, validateAchFormValues as x } from "./lib/helpers.js";
|
|
10
|
-
import { useCounterpartsQuery as S } from "../../data-access/dist/index3.js";
|
|
11
|
-
import { useCounterpartBankAccountsQuery as C, useCreateCounterpartBankAccountMutation as w, useUpdateCounterpartBankAccountMutation as T } from "../../data-access/dist/index5.js";
|
|
12
|
-
import { useCounterpartAddressesForRowsQuery as E, useCounterpartAddressesQuery as D } from "../../data-access/dist/index7.js";
|
|
2
|
+
import { useCounterpartsQuery as e } from "../../data-access/dist/index3.js";
|
|
3
|
+
import { useCounterpartBankAccountsQuery as t, useCreateCounterpartBankAccountMutation as n, useUpdateCounterpartBankAccountMutation as r } from "../../data-access/dist/index5.js";
|
|
4
|
+
import { useCounterpartAddressesForRowsQuery as i, useCounterpartAddressesQuery as a } from "../../data-access/dist/index7.js";
|
|
13
5
|
import "../../data-access/dist/index.js";
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
6
|
+
import { AchFieldGroup as o } from "../../ui/dist/index5.js";
|
|
7
|
+
import { CounterpartFormFields as s, CounterpartFormSheet as c, useFocusFirstInvalidField as l } from "../../ui/dist/index9.js";
|
|
8
|
+
import { BankAccountFormSheet as u } from "../../ui/dist/index11.js";
|
|
9
|
+
import { AddressFormSheet as d } from "../../ui/dist/index13.js";
|
|
10
|
+
import { ConfirmDeleteDialog as f } from "../../ui/dist/index14.js";
|
|
11
|
+
import "../../ui/dist/index.js";
|
|
12
|
+
import { COUNTERPART_MESSAGE_LABELS_EN as p } from "./lib/labels.js";
|
|
13
|
+
import { buildAnalyticsMap as m, buildCounterpartRows as h, counterpartFormBankAccountToCreatePayload as g, counterpartFormBankAccountToUpdatePayload as _, formatCounterpartDate as v, formatMoney as y, getAchInstructions as b, getCounterpartEmail as x, getCounterpartName as S, getPayableAchInstructions as C, hasAchFormValues as w, hasSelectedText as T, isAchCompatibleBankAccount as E, resolveCounterpartBankAccountWrite as D, validateAchFormValues as O } from "./lib/helpers.js";
|
|
14
|
+
import { useAddressForm as k } from "./lib/useAddressForm.js";
|
|
15
|
+
import { useCounterpartDetails as A } from "./lib/useCounterpartDetails.js";
|
|
16
|
+
import { usePayableAchInstructions as j } from "./lib/usePayableAchInstructions.js";
|
|
17
|
+
import { useCounterpartForm as M } from "./lib/useCounterpartForm.js";
|
|
18
18
|
import "./lib/useCounterpartSelector.js";
|
|
19
|
-
import { CounterpartSelector as
|
|
20
|
-
import { useDeleteController as
|
|
19
|
+
import { CounterpartSelector as N } from "./lib/CounterpartSelector.js";
|
|
20
|
+
import { useDeleteController as P } from "./lib/useDeleteController.js";
|
|
21
21
|
import "./lib/useSubEntityForm.js";
|
|
22
|
-
import { useBankAccountForm as
|
|
23
|
-
export {
|
|
22
|
+
import { useBankAccountForm as F } from "./lib/subEntityForms.js";
|
|
23
|
+
export { o as AchFieldGroup, d as AddressFormSheet, u as BankAccountFormSheet, p as COUNTERPART_MESSAGE_LABELS_EN, f as ConfirmDeleteDialog, s as CounterpartFormFields, c as CounterpartFormSheet, N as CounterpartSelector, m as buildAnalyticsMap, h as buildCounterpartRows, g as counterpartFormBankAccountToCreatePayload, _ as counterpartFormBankAccountToUpdatePayload, v as formatCounterpartDate, y as formatMoney, b as getAchInstructions, x as getCounterpartEmail, S as getCounterpartName, C as getPayableAchInstructions, w as hasAchFormValues, T as hasSelectedText, E as isAchCompatibleBankAccount, D as resolveCounterpartBankAccountWrite, k as useAddressForm, F as useBankAccountForm, i as useCounterpartAddressesForRowsQuery, a as useCounterpartAddressesQuery, t as useCounterpartBankAccountsQuery, A as useCounterpartDetails, M as useCounterpartForm, e as useCounterpartsQuery, n as useCreateCounterpartBankAccountMutation, P as useDeleteController, l as useFocusFirstInvalidField, j as usePayableAchInstructions, r as useUpdateCounterpartBankAccountMutation, O as validateAchFormValues };
|
|
@@ -129,8 +129,8 @@ function b(e) {
|
|
|
129
129
|
let t = (e ?? []).filter((e) => e.currency === "USD" && (!!e.routing_number || !!e.account_number));
|
|
130
130
|
return t.find((e) => e.is_default_for_currency) ?? t[0];
|
|
131
131
|
}
|
|
132
|
-
function x(e, t = "USD") {
|
|
133
|
-
return (e ?? []).find((e) => e.currency === t && e.is_default_for_currency && !!e.account_holder_name && !!e.routing_number && !!e.account_number);
|
|
132
|
+
function x(e, t = "USD", n) {
|
|
133
|
+
return n && (e ?? []).find((e) => e.id === n && R(e)) || (e ?? []).find((e) => e.currency === t && e.is_default_for_currency && !!e.account_holder_name && !!e.routing_number && !!e.account_number);
|
|
134
134
|
}
|
|
135
135
|
function S(e, t = {}) {
|
|
136
136
|
let n = e.line2.trim();
|
|
@@ -297,12 +297,18 @@ function L(e) {
|
|
|
297
297
|
e.bic
|
|
298
298
|
].every((e) => !e);
|
|
299
299
|
}
|
|
300
|
-
function R(e
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
300
|
+
function R(e) {
|
|
301
|
+
return !!(L(e) || e.currency === "USD" && (e.routing_number || e.account_number));
|
|
302
|
+
}
|
|
303
|
+
function z(e, t) {
|
|
304
|
+
if (t) {
|
|
305
|
+
let n = e?.find((e) => e.id === t);
|
|
306
|
+
return {
|
|
307
|
+
kind: "update",
|
|
308
|
+
bankAccountId: t,
|
|
309
|
+
includeAchDefaults: n ? L(n) : !1
|
|
310
|
+
};
|
|
311
|
+
}
|
|
306
312
|
let n = e?.find(L);
|
|
307
313
|
return n ? {
|
|
308
314
|
kind: "update",
|
|
@@ -313,7 +319,7 @@ function R(e, t) {
|
|
|
313
319
|
isDefaultForCurrency: !(e ?? []).some((e) => e.currency === "USD" && e.is_default_for_currency)
|
|
314
320
|
};
|
|
315
321
|
}
|
|
316
|
-
function
|
|
322
|
+
function B() {
|
|
317
323
|
return {
|
|
318
324
|
name: "",
|
|
319
325
|
accountHolderName: "",
|
|
@@ -326,7 +332,7 @@ function z() {
|
|
|
326
332
|
isDefault: !1
|
|
327
333
|
};
|
|
328
334
|
}
|
|
329
|
-
function
|
|
335
|
+
function V(e) {
|
|
330
336
|
return {
|
|
331
337
|
name: e.name ?? "",
|
|
332
338
|
accountHolderName: e.account_holder_name ?? "",
|
|
@@ -339,7 +345,7 @@ function B(e) {
|
|
|
339
345
|
isDefault: e.is_default_for_currency ?? !1
|
|
340
346
|
};
|
|
341
347
|
}
|
|
342
|
-
function
|
|
348
|
+
function H(e) {
|
|
343
349
|
return {
|
|
344
350
|
name: e.name.trim() || void 0,
|
|
345
351
|
account_holder_name: e.accountHolderName.trim() || void 0,
|
|
@@ -353,7 +359,7 @@ function V(e) {
|
|
|
353
359
|
is_default_for_currency: e.isDefault
|
|
354
360
|
};
|
|
355
361
|
}
|
|
356
|
-
function
|
|
362
|
+
function U(e) {
|
|
357
363
|
return {
|
|
358
364
|
name: e.name.trim(),
|
|
359
365
|
account_holder_name: e.accountHolderName.trim(),
|
|
@@ -366,54 +372,54 @@ function H(e) {
|
|
|
366
372
|
country: "US"
|
|
367
373
|
};
|
|
368
374
|
}
|
|
369
|
-
function
|
|
375
|
+
function W(e) {
|
|
370
376
|
return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e);
|
|
371
377
|
}
|
|
372
|
-
function
|
|
378
|
+
function G(e, t) {
|
|
373
379
|
let n = {};
|
|
374
380
|
return e.line1.trim().length === 0 && (n.line1 = t.addressLine1Required), e.city.trim().length === 0 && (n.city = t.cityRequired), e.state.trim().length === 0 && (n.state = t.stateRequired), e.postalCode.trim().length === 0 && (n.postalCode = t.postalCodeRequired), n;
|
|
375
381
|
}
|
|
376
|
-
function
|
|
382
|
+
function K(e) {
|
|
377
383
|
return Object.values(e).some(Boolean);
|
|
378
384
|
}
|
|
379
|
-
function
|
|
385
|
+
function q(e) {
|
|
380
386
|
if (!/^\d{9}$/.test(e)) return !1;
|
|
381
387
|
let t = [...e].map(Number);
|
|
382
388
|
return (3 * (t[0] + t[3] + t[6]) + 7 * (t[1] + t[4] + t[7]) + (t[2] + t[5] + t[8])) % 10 == 0;
|
|
383
389
|
}
|
|
384
|
-
function
|
|
390
|
+
function J(e, t = n) {
|
|
385
391
|
let r = {}, i = e.accountHolderName.trim(), a = e.routingNumber.trim(), o = e.accountNumber.trim();
|
|
386
|
-
return i.length === 0 && (r.accountHolderName = t.accountHolderNameRequired), (a.length === 0 || !
|
|
392
|
+
return i.length === 0 && (r.accountHolderName = t.accountHolderNameRequired), (a.length === 0 || !q(a)) && (r.routingNumber = t.routingNumberInvalid), (o.length === 0 || !/^\d{9,12}$/.test(o)) && (r.accountNumber = t.accountNumberInvalid), r;
|
|
387
393
|
}
|
|
388
|
-
function
|
|
394
|
+
function Y(e, t, r = n, i = "customer", a = !1) {
|
|
389
395
|
let o = {};
|
|
390
|
-
if (e.entityType === "organization" ? e.legalName.trim().length === 0 && (o.legalName = r.legalNameRequired) : (e.firstName.trim().length === 0 && (o.firstName = r.firstNameRequired), e.lastName.trim().length === 0 && (o.lastName = r.lastNameRequired)), e.email.trim().length === 0 ? o.email = r.emailRequired :
|
|
391
|
-
let t =
|
|
392
|
-
|
|
396
|
+
if (e.entityType === "organization" ? e.legalName.trim().length === 0 && (o.legalName = r.legalNameRequired) : (e.firstName.trim().length === 0 && (o.firstName = r.firstNameRequired), e.lastName.trim().length === 0 && (o.lastName = r.lastNameRequired)), e.email.trim().length === 0 ? o.email = r.emailRequired : W(e.email.trim()) || (o.email = r.emailInvalid), t === "create" && i === "vendor" || O(e.address)) {
|
|
397
|
+
let t = G(e.address, r);
|
|
398
|
+
K(t) && (o.address = t);
|
|
393
399
|
}
|
|
394
400
|
if (i === "vendor" && (a || P(e))) {
|
|
395
|
-
let t =
|
|
396
|
-
|
|
401
|
+
let t = J(e.bankAccount, r);
|
|
402
|
+
K(t) && (o.bankAccount = t);
|
|
397
403
|
}
|
|
398
404
|
return o;
|
|
399
405
|
}
|
|
400
|
-
function
|
|
406
|
+
function X(e) {
|
|
401
407
|
let { address: t, bankAccount: n, ...r } = e;
|
|
402
|
-
return
|
|
408
|
+
return K(r) || (t ? K(t) : !1) || (n ? K(n) : !1);
|
|
403
409
|
}
|
|
404
|
-
function
|
|
410
|
+
function Z(e, t = n) {
|
|
405
411
|
let r = {};
|
|
406
412
|
return e.name.trim().length === 0 && (r.name = t.bankAccountNameRequired), e.accountNumber.trim().length === 0 && e.iban.trim().length === 0 && (r.accountNumber = t.bankAccountIdentifierRequired), e.currency.trim().length === 0 && (r.currency = t.bankAccountCurrencyRequired), r;
|
|
407
413
|
}
|
|
408
|
-
function
|
|
409
|
-
return
|
|
414
|
+
function Q(e) {
|
|
415
|
+
return K(e);
|
|
410
416
|
}
|
|
411
|
-
function
|
|
412
|
-
return
|
|
417
|
+
function $(e, t = n) {
|
|
418
|
+
return G(e, t);
|
|
413
419
|
}
|
|
414
|
-
function
|
|
420
|
+
function ee() {
|
|
415
421
|
let e = globalThis.getSelection?.();
|
|
416
422
|
return !!(e && e.toString().length > 0);
|
|
417
423
|
}
|
|
418
424
|
//#endregion
|
|
419
|
-
export { w as addressFormToCreatePayload, T as addressFormToUpdatePayload, C as addressResponseToFormValues,
|
|
425
|
+
export { w as addressFormToCreatePayload, T as addressFormToUpdatePayload, C as addressResponseToFormValues, H as bankAccountFormToCreatePayload, U as bankAccountFormToUpdatePayload, V as bankAccountToFormValues, p as buildAnalyticsMap, y as buildBankAccountItems, _ as buildCounterpartDetailsView, m as buildCounterpartRows, F as counterpartFormBankAccountToCreatePayload, I as counterpartFormBankAccountToUpdatePayload, A as counterpartFormToCreatePayload, j as counterpartFormToUpdatePayload, D as counterpartToFormValues, B as emptyBankAccountFormValues, E as emptyCounterpartFormValues, l as formatCounterpartDate, s as formatMoney, o as fromMinorUnits, b as getAchInstructions, d as getCounterpartEmail, u as getCounterpartName, i as getCurrencyOptions, x as getPayableAchInstructions, N as hasAchFormValues, Q as hasBankAccountFormErrors, M as hasCounterpartFormAddressValues, P as hasCounterpartFormBankAccountValues, X as hasCounterpartFormErrors, ee as hasSelectedText, R as isAchCompatibleBankAccount, z as resolveCounterpartBankAccountWrite, J as validateAchFormValues, $ as validateAddressForm, Z as validateBankAccountForm, Y as validateCounterpartForm };
|
|
@@ -2,38 +2,38 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
|
-
import {
|
|
6
|
-
import { useCreateCounterpartBankAccountMutation as s, useMakeCounterpartBankAccountDefaultMutation as c, useUpdateCounterpartBankAccountMutation as l } from "../../../data-access/dist/index5.js";
|
|
5
|
+
import { useCreateCounterpartBankAccountMutation as e, useMakeCounterpartBankAccountDefaultMutation as t, useUpdateCounterpartBankAccountMutation as n } from "../../../data-access/dist/index5.js";
|
|
7
6
|
import "../../../data-access/dist/index.js";
|
|
7
|
+
import { bankAccountFormToCreatePayload as r, bankAccountFormToUpdatePayload as i, bankAccountToFormValues as a, emptyBankAccountFormValues as o, getCurrencyOptions as s, hasBankAccountFormErrors as c, validateBankAccountForm as l } from "./helpers.js";
|
|
8
8
|
import { useSubEntityForm as u } from "./useSubEntityForm.js";
|
|
9
9
|
import { useMemo as d } from "react";
|
|
10
10
|
//#region ../../libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/subEntityForms.js
|
|
11
11
|
function f({ items: f, selectedId: p, messages: m }) {
|
|
12
|
-
let h =
|
|
12
|
+
let h = e(), g = n(), _ = t(), v = u({
|
|
13
13
|
items: f,
|
|
14
|
-
empty:
|
|
15
|
-
toFormValues:
|
|
16
|
-
validate: (e) =>
|
|
17
|
-
hasErrors:
|
|
14
|
+
empty: o,
|
|
15
|
+
toFormValues: a,
|
|
16
|
+
validate: (e) => l(e, m),
|
|
17
|
+
hasErrors: c,
|
|
18
18
|
genericError: m.genericError,
|
|
19
|
-
onSubmit: async ({ mode:
|
|
19
|
+
onSubmit: async ({ mode: e, id: t, values: n, existing: a }) => {
|
|
20
20
|
if (!p) return;
|
|
21
|
-
let o =
|
|
22
|
-
|
|
21
|
+
let o = t;
|
|
22
|
+
e === "edit" && t ? await g.mutateAsync({
|
|
23
23
|
path: {
|
|
24
24
|
counterpart_id: p,
|
|
25
|
-
bank_account_id:
|
|
25
|
+
bank_account_id: t
|
|
26
26
|
},
|
|
27
|
-
body:
|
|
27
|
+
body: i(n)
|
|
28
28
|
}) : o = (await h.mutateAsync({
|
|
29
29
|
path: { counterpart_id: p },
|
|
30
|
-
body:
|
|
31
|
-
}))?.id,
|
|
30
|
+
body: r(n)
|
|
31
|
+
}))?.id, n.isDefault && !a?.is_default_for_currency && o && await _.mutateAsync({ path: {
|
|
32
32
|
counterpart_id: p,
|
|
33
33
|
bank_account_id: o
|
|
34
34
|
} });
|
|
35
35
|
}
|
|
36
|
-
}), y = d(() =>
|
|
36
|
+
}), y = d(() => s(v.values.currency), [v.values.currency]);
|
|
37
37
|
return {
|
|
38
38
|
form: v,
|
|
39
39
|
inProgress: h.isPending || g.isPending || _.isPending,
|
|
@@ -3,20 +3,20 @@
|
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
5
|
import { extractApiErrorMessage as e } from "../../../../util/dist/lib/apiErrors.js";
|
|
6
|
-
import {
|
|
7
|
-
import { useCreateCounterpartAddressMutation as a, useUpdateCounterpartAddressMutation as o } from "../../../data-access/dist/index7.js";
|
|
6
|
+
import { useCreateCounterpartAddressMutation as t, useUpdateCounterpartAddressMutation as n } from "../../../data-access/dist/index7.js";
|
|
8
7
|
import "../../../data-access/dist/index.js";
|
|
8
|
+
import { addressFormToCreatePayload as r, addressFormToUpdatePayload as i, addressResponseToFormValues as a, validateAddressForm as o } from "./helpers.js";
|
|
9
9
|
import { useCallback as s, useState as c } from "react";
|
|
10
10
|
//#region ../../libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/useAddressForm.js
|
|
11
11
|
function l({ selectedId: l, primaryAddress: u, messages: d }) {
|
|
12
|
-
let f =
|
|
12
|
+
let f = t(), p = n(), [m, h] = c(!1), [g, _] = c(() => ({
|
|
13
13
|
line1: "",
|
|
14
14
|
line2: "",
|
|
15
15
|
city: "",
|
|
16
16
|
state: "",
|
|
17
17
|
postalCode: ""
|
|
18
18
|
})), [v, y] = c({}), [b, x] = c(), S = s(() => {
|
|
19
|
-
u && (_(
|
|
19
|
+
u && (_(a(u)), y({}), x(void 0), h(!0));
|
|
20
20
|
}, [u]), C = s(() => {
|
|
21
21
|
_({
|
|
22
22
|
line1: "",
|
|
@@ -27,9 +27,9 @@ function l({ selectedId: l, primaryAddress: u, messages: d }) {
|
|
|
27
27
|
}), y({}), x(void 0), h(!0);
|
|
28
28
|
}, []), w = s(() => h(!1), []), T = s(async () => {
|
|
29
29
|
if (!l) return;
|
|
30
|
-
let
|
|
31
|
-
if (Object.values(
|
|
32
|
-
y(
|
|
30
|
+
let t = o(g, d);
|
|
31
|
+
if (Object.values(t).some(Boolean)) {
|
|
32
|
+
y(t);
|
|
33
33
|
return;
|
|
34
34
|
}
|
|
35
35
|
y({});
|
|
@@ -39,10 +39,10 @@ function l({ selectedId: l, primaryAddress: u, messages: d }) {
|
|
|
39
39
|
counterpart_id: l,
|
|
40
40
|
address_id: u.id
|
|
41
41
|
},
|
|
42
|
-
body:
|
|
42
|
+
body: i(g)
|
|
43
43
|
}) : await f.mutateAsync({
|
|
44
44
|
path: { counterpart_id: l },
|
|
45
|
-
body:
|
|
45
|
+
body: r(g)
|
|
46
46
|
}), h(!1);
|
|
47
47
|
} catch (t) {
|
|
48
48
|
x(e(t) ?? d.genericError);
|
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { useCounterpartAddressesQuery as i } from "../../../data-access/dist/index7.js";
|
|
5
|
+
import { useCounterpartQuery as e } from "../../../data-access/dist/index3.js";
|
|
6
|
+
import { useCounterpartBankAccountsQuery as t } from "../../../data-access/dist/index5.js";
|
|
7
|
+
import { useCounterpartAddressesQuery as n } from "../../../data-access/dist/index7.js";
|
|
9
8
|
import "../../../data-access/dist/index.js";
|
|
9
|
+
import { buildBankAccountItems as r, buildCounterpartDetailsView as i } from "./helpers.js";
|
|
10
10
|
import { useMemo as a } from "react";
|
|
11
11
|
//#region ../../libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/useCounterpartDetails.js
|
|
12
12
|
function o({ selectedId: o, enabled: s = !0 }) {
|
|
13
|
-
let c = s ? o : void 0, l =
|
|
13
|
+
let c = s ? o : void 0, l = e(c), u = l.data, d = u?.type === "organization", f = c ?? null, p = n(f), m = t(f), h = p.data?.data, g = a(() => {
|
|
14
14
|
if (!(!h || h.length === 0)) {
|
|
15
15
|
if (u?.default_billing_address_id) {
|
|
16
16
|
let e = h.find((e) => e.id === u.default_billing_address_id);
|
|
@@ -18,10 +18,10 @@ function o({ selectedId: o, enabled: s = !0 }) {
|
|
|
18
18
|
}
|
|
19
19
|
return h[0];
|
|
20
20
|
}
|
|
21
|
-
}, [h, u?.default_billing_address_id]), _ = a(() => u ?
|
|
21
|
+
}, [h, u?.default_billing_address_id]), _ = a(() => u ? i({
|
|
22
22
|
counterpart: u,
|
|
23
23
|
primaryAddress: g
|
|
24
|
-
}) : void 0, [u, g]), v = a(() =>
|
|
24
|
+
}) : void 0, [u, g]), v = a(() => r(m.data?.data), [m.data]);
|
|
25
25
|
return {
|
|
26
26
|
counterpart: u,
|
|
27
27
|
isOrganization: d,
|
|
@@ -3,16 +3,16 @@
|
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
5
|
import { extractApiErrorMessage as e } from "../../../../util/dist/lib/apiErrors.js";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { useCreateCounterpartAddressMutation as b, useUpdateCounterpartAddressMutation as x } from "../../../data-access/dist/index7.js";
|
|
6
|
+
import { useCreateCounterpartMutation as t, useUpdateCounterpartMutation as n } from "../../../data-access/dist/index3.js";
|
|
7
|
+
import { useCreateCounterpartBankAccountMutation as r, useUpdateCounterpartBankAccountMutation as i } from "../../../data-access/dist/index5.js";
|
|
8
|
+
import { useCreateCounterpartAddressMutation as a, useUpdateCounterpartAddressMutation as o } from "../../../data-access/dist/index7.js";
|
|
10
9
|
import "../../../data-access/dist/index.js";
|
|
10
|
+
import { addressFormToCreatePayload as s, addressFormToUpdatePayload as c, addressResponseToFormValues as l, counterpartFormBankAccountToCreatePayload as u, counterpartFormBankAccountToUpdatePayload as d, counterpartFormToCreatePayload as f, counterpartFormToUpdatePayload as p, counterpartToFormValues as m, emptyCounterpartFormValues as h, getAchInstructions as g, hasCounterpartFormAddressValues as _, hasCounterpartFormBankAccountValues as v, hasCounterpartFormErrors as y, resolveCounterpartBankAccountWrite as b, validateCounterpartForm as x } from "./helpers.js";
|
|
11
11
|
import { useCallback as S, useState as C } from "react";
|
|
12
12
|
//#region ../../libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/useCounterpartForm.js
|
|
13
13
|
function w(e, t) {
|
|
14
|
-
if (!t) return
|
|
15
|
-
let n =
|
|
14
|
+
if (!t) return _(e);
|
|
15
|
+
let n = l(t);
|
|
16
16
|
return e.address.line1.trim() !== n.line1.trim() || e.address.line2.trim() !== n.line2.trim() || e.address.city.trim() !== n.city.trim() || e.address.state.trim() !== n.state.trim() || e.address.postalCode.trim() !== n.postalCode.trim();
|
|
17
17
|
}
|
|
18
18
|
function T(e) {
|
|
@@ -23,28 +23,28 @@ function T(e) {
|
|
|
23
23
|
};
|
|
24
24
|
}
|
|
25
25
|
function E(e, t) {
|
|
26
|
-
if (!t) return
|
|
26
|
+
if (!t) return v(e);
|
|
27
27
|
let n = T(t);
|
|
28
28
|
return e.bankAccount.accountHolderName.trim() !== n.accountHolderName.trim() || e.bankAccount.routingNumber.trim() !== n.routingNumber.trim() || e.bankAccount.accountNumber.trim() !== n.accountNumber.trim();
|
|
29
29
|
}
|
|
30
|
-
function D({ view:
|
|
31
|
-
let L =
|
|
30
|
+
function D({ view: l, setView: D, selectedId: O, setSelectedId: k, messages: A, counterpartType: j, counterpart: M, primaryAddress: N, bankAccounts: P, isBankAccountsLoading: F, isBankAccountsError: I }) {
|
|
31
|
+
let L = t(), R = a(), z = r(), B = n(), V = o(), H = i(), [U, W] = C(() => h()), [G, K] = C({}), [q, J] = C({
|
|
32
32
|
address: !1,
|
|
33
33
|
bankAccount: !1
|
|
34
34
|
}), [Y, X] = C(), [Z, Q] = C(), $ = L.isPending || R.isPending || z.isPending || H.isPending || B.isPending || V.isPending, ee = S(() => {
|
|
35
35
|
k(void 0), Q(void 0), X(void 0), J({
|
|
36
36
|
address: j === "vendor",
|
|
37
37
|
bankAccount: !1
|
|
38
|
-
}), W(
|
|
38
|
+
}), W(h("organization", j)), K({}), D("create");
|
|
39
39
|
}, [
|
|
40
40
|
j,
|
|
41
41
|
k,
|
|
42
42
|
D
|
|
43
43
|
]), te = S(() => {
|
|
44
44
|
if (!M || j === "vendor" && (F || I)) return;
|
|
45
|
-
let e =
|
|
45
|
+
let e = g(P), t = m(M, N);
|
|
46
46
|
Q(void 0), X(e?.id), J({
|
|
47
|
-
address:
|
|
47
|
+
address: _(t),
|
|
48
48
|
bankAccount: !1
|
|
49
49
|
}), W({
|
|
50
50
|
...t,
|
|
@@ -77,11 +77,11 @@ function D({ view: r, setView: D, selectedId: O, setSelectedId: k, messages: A,
|
|
|
77
77
|
openEdit: te,
|
|
78
78
|
close: ne,
|
|
79
79
|
submit: S(async () => {
|
|
80
|
-
let
|
|
81
|
-
if (
|
|
82
|
-
K(
|
|
83
|
-
address: e.address || !!
|
|
84
|
-
bankAccount: e.bankAccount || !!
|
|
80
|
+
let t = l === "edit" ? "edit" : "create", n = x(U, t, A, j, t === "edit" && j === "vendor" && !!Y);
|
|
81
|
+
if (y(n)) {
|
|
82
|
+
K(n), J((e) => ({
|
|
83
|
+
address: e.address || !!n.address,
|
|
84
|
+
bankAccount: e.bankAccount || !!n.bankAccount
|
|
85
85
|
}));
|
|
86
86
|
return;
|
|
87
87
|
}
|
|
@@ -89,44 +89,44 @@ function D({ view: r, setView: D, selectedId: O, setSelectedId: k, messages: A,
|
|
|
89
89
|
address: !1,
|
|
90
90
|
bankAccount: !1
|
|
91
91
|
});
|
|
92
|
-
let
|
|
92
|
+
let r = Z;
|
|
93
93
|
try {
|
|
94
|
-
if (
|
|
94
|
+
if (l === "edit" && O) {
|
|
95
95
|
Q(void 0), await B.mutateAsync({
|
|
96
96
|
path: { counterpart_id: O },
|
|
97
|
-
body:
|
|
97
|
+
body: p(U, j)
|
|
98
98
|
});
|
|
99
99
|
let e = N ? w(U, N) ? V.mutateAsync({
|
|
100
100
|
path: {
|
|
101
101
|
counterpart_id: O,
|
|
102
102
|
address_id: N.id
|
|
103
103
|
},
|
|
104
|
-
body:
|
|
105
|
-
}) : void 0 :
|
|
104
|
+
body: c(U.address)
|
|
105
|
+
}) : void 0 : _(U) ? R.mutateAsync({
|
|
106
106
|
path: { counterpart_id: O },
|
|
107
|
-
body:
|
|
108
|
-
}) : void 0,
|
|
107
|
+
body: s(U.address)
|
|
108
|
+
}) : void 0, t = j === "vendor" && E(U, g(P)) ? b(P, Y) : void 0, n = t?.kind === "update" ? H.mutateAsync({
|
|
109
109
|
path: {
|
|
110
110
|
counterpart_id: O,
|
|
111
|
-
bank_account_id:
|
|
111
|
+
bank_account_id: t.bankAccountId
|
|
112
112
|
},
|
|
113
|
-
body:
|
|
114
|
-
}) :
|
|
113
|
+
body: d(U.bankAccount, { includeAchDefaults: t.includeAchDefaults })
|
|
114
|
+
}) : t?.kind === "create" ? z.mutateAsync({
|
|
115
115
|
path: { counterpart_id: O },
|
|
116
|
-
body:
|
|
117
|
-
}) : void 0, [
|
|
118
|
-
if (
|
|
119
|
-
if (
|
|
116
|
+
body: u(U.bankAccount, { isDefaultForCurrency: t.isDefaultForCurrency })
|
|
117
|
+
}) : void 0, [r, i] = await Promise.allSettled([e, n]);
|
|
118
|
+
if (t?.kind === "create" && i.status === "fulfilled" && X(i.value?.id), r.status === "rejected") throw r.reason;
|
|
119
|
+
if (i.status === "rejected") throw i.reason;
|
|
120
120
|
D("none");
|
|
121
|
-
} else
|
|
122
|
-
path: { counterpart_id:
|
|
123
|
-
body:
|
|
124
|
-
})), Q(void 0), D("none"),
|
|
121
|
+
} else r ||= (await L.mutateAsync({ body: f(U, j) }))?.id, r && j === "vendor" && v(U) && (Q(r), await z.mutateAsync({
|
|
122
|
+
path: { counterpart_id: r },
|
|
123
|
+
body: u(U.bankAccount)
|
|
124
|
+
})), Q(void 0), D("none"), r && k(r);
|
|
125
125
|
} catch (t) {
|
|
126
|
-
|
|
126
|
+
r && (Q(r), k(r)), K({ form: e(t) ?? A.genericError });
|
|
127
127
|
}
|
|
128
128
|
}, [
|
|
129
|
-
|
|
129
|
+
l,
|
|
130
130
|
U,
|
|
131
131
|
O,
|
|
132
132
|
Z,
|
|
@@ -2,44 +2,44 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
|
-
import {
|
|
6
|
-
import "../../../ui/dist/index.js";
|
|
7
|
-
import { getCounterpartName as t } from "./helpers.js";
|
|
8
|
-
import { useCounterpartsQuery as n } from "../../../data-access/dist/index3.js";
|
|
5
|
+
import { useCounterpartsQuery as e } from "../../../data-access/dist/index3.js";
|
|
9
6
|
import "../../../data-access/dist/index.js";
|
|
7
|
+
import { COUNTERPART_TYPE_BADGE_LABELS_EN as t } from "../../../ui/dist/index2.js";
|
|
8
|
+
import "../../../ui/dist/index.js";
|
|
9
|
+
import { getCounterpartName as n } from "./helpers.js";
|
|
10
10
|
import { useCallback as r, useEffect as i, useMemo as a, useState as o } from "react";
|
|
11
11
|
//#region ../../libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/useCounterpartSelector.js
|
|
12
12
|
var s = 25, c = 300;
|
|
13
|
-
function l(
|
|
13
|
+
function l(e, r) {
|
|
14
14
|
let i = {
|
|
15
|
-
...
|
|
15
|
+
...t,
|
|
16
16
|
...r
|
|
17
17
|
};
|
|
18
|
-
return (
|
|
18
|
+
return (e ?? []).map((e) => ({
|
|
19
19
|
value: e.id,
|
|
20
|
-
label:
|
|
20
|
+
label: n(e),
|
|
21
21
|
supportingLabel: e.type === "organization" ? i.organization : i.individual
|
|
22
22
|
}));
|
|
23
23
|
}
|
|
24
|
-
function u({ value:
|
|
25
|
-
let [m, h] = o(
|
|
24
|
+
function u({ value: t, onValueChange: n, mode: u = "customer", limit: d = s, debounceMs: f = c, typeLabels: p } = {}) {
|
|
25
|
+
let [m, h] = o(t ?? ""), [g, _] = o(""), [v, y] = o("");
|
|
26
26
|
i(() => {
|
|
27
|
-
h(
|
|
28
|
-
}, [
|
|
27
|
+
h(t ?? "");
|
|
28
|
+
}, [t]), i(() => {
|
|
29
29
|
let e = setTimeout(() => {
|
|
30
30
|
y(g.trim());
|
|
31
31
|
}, f);
|
|
32
32
|
return () => clearTimeout(e);
|
|
33
33
|
}, [f, g]);
|
|
34
|
-
let b =
|
|
34
|
+
let b = e({
|
|
35
35
|
sort: "counterpart_name",
|
|
36
36
|
order: "asc",
|
|
37
37
|
limit: d,
|
|
38
38
|
counterpart_name__icontains: v || void 0,
|
|
39
39
|
...u === "customer" ? { is_customer: !0 } : { is_vendor: !0 }
|
|
40
40
|
}), x = a(() => l(b.data?.data, p), [b.data, p]), S = r((e) => {
|
|
41
|
-
h(e),
|
|
42
|
-
}, [
|
|
41
|
+
h(e), n?.(e);
|
|
42
|
+
}, [n]), C = r(() => {
|
|
43
43
|
b.refetch();
|
|
44
44
|
}, [b]);
|
|
45
45
|
return {
|
|
@@ -2,16 +2,16 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
|
-
import {
|
|
6
|
-
import { useCounterpartBankAccountsQuery as t } from "../../../data-access/dist/index5.js";
|
|
5
|
+
import { useCounterpartBankAccountsQuery as e } from "../../../data-access/dist/index5.js";
|
|
7
6
|
import "../../../data-access/dist/index.js";
|
|
7
|
+
import { getPayableAchInstructions as t } from "./helpers.js";
|
|
8
8
|
//#region ../../libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/usePayableAchInstructions.js
|
|
9
|
-
function n({ counterpartId: n, currency: r,
|
|
10
|
-
let
|
|
9
|
+
function n({ counterpartId: n, currency: r, currentBankAccountId: i, enabled: a = !0 } = {}) {
|
|
10
|
+
let o = e(n, { enabled: a });
|
|
11
11
|
return {
|
|
12
|
-
achInstructions:
|
|
13
|
-
isLoading:
|
|
14
|
-
isError:
|
|
12
|
+
achInstructions: t(o.data?.data, r ?? void 0, i ?? void 0),
|
|
13
|
+
isLoading: o.isLoading,
|
|
14
|
+
isError: o.isError
|
|
15
15
|
};
|
|
16
16
|
}
|
|
17
17
|
//#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.4.
|
|
2
|
+
var e = "@tesouro/embedded-components-react", t = "0.4.16", n = "5e5e363c58ea4925cb54e59e4954ff26bdead369", r = Object.freeze({
|
|
3
3
|
library_name: e,
|
|
4
4
|
library_version: t,
|
|
5
5
|
library_sha: n
|
package/package.json
CHANGED