@tesouro/embedded-components-react 0.4.14 → 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/cards-widget/feature/dist/index3.js +15 -3
- package/dist/libs/tesouro-embedded-components-react/cards-widget/feature/dist/index9.js +63 -65
- package/dist/libs/tesouro-embedded-components-react/cards-widget/ui/dist/lib/CardsList/CardsList.js +4 -2
- package/dist/libs/tesouro-embedded-components-react/cards-widget/ui/dist/lib/CardsList/CardsListDetailsSheet.js +6 -5
- package/dist/libs/tesouro-embedded-components-react/cards-widget/ui/dist/lib/CardsList/CardsListRow.js +1 -1
- 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
|
@@ -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