@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
|
@@ -5,104 +5,120 @@
|
|
|
5
5
|
import { toast as e } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
6
6
|
import "../../../shared/ui/dist/index.js";
|
|
7
7
|
import { useUpdatePayableMutation as t } from "../../data-access/dist/index13.js";
|
|
8
|
+
import { useCounterpartBankAccountsQuery as n, useCreateCounterpartBankAccountMutation as r } from "../../../shared/counterpart-management/data-access/dist/index5.js";
|
|
9
|
+
import { useUpdatePayableCounterpartBankAccountMutation as i } from "../../data-access/dist/index14.js";
|
|
8
10
|
import "../../data-access/dist/index.js";
|
|
9
|
-
import { counterpartFormBankAccountToCreatePayload as
|
|
10
|
-
import { useCounterpartBankAccountsQuery as s, useCreateCounterpartBankAccountMutation as c, useUpdateCounterpartBankAccountMutation as l } from "../../../shared/counterpart-management/data-access/dist/index5.js";
|
|
11
|
+
import { counterpartFormBankAccountToCreatePayload as a, counterpartFormBankAccountToUpdatePayload as o, getAchInstructions as s, isAchCompatibleBankAccount as c, resolveCounterpartBankAccountWrite as l, validateAchFormValues as u } from "../../../shared/counterpart-management/feature/dist/lib/helpers.js";
|
|
11
12
|
import "../../../shared/counterpart-management/feature/dist/index.js";
|
|
12
|
-
import { useCallback as
|
|
13
|
+
import { useCallback as d, useEffect as f, useRef as p, useState as m } from "react";
|
|
13
14
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index48.js
|
|
14
|
-
var
|
|
15
|
+
var h = {
|
|
15
16
|
accountHolderName: "",
|
|
16
17
|
routingNumber: "",
|
|
17
18
|
accountNumber: ""
|
|
18
19
|
};
|
|
19
|
-
function
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
20
|
+
function g(e, t) {
|
|
21
|
+
return e?.find((e) => e.id === t && c(e)) ?? s(e);
|
|
22
|
+
}
|
|
23
|
+
function _({ payableId: c, counterpartId: _, currentBankAccountId: v, canReadCounterpartBankAccounts: y = !0, saveErrorMessage: b, linkErrorMessage: x }) {
|
|
24
|
+
let [S, C] = m(!1), [w, T] = m(h), [E, D] = m(), O = n(_, { enabled: y }), k = O.data?.data, A = r(), j = i(), M = t(), N = p(void 0), P = p(!1);
|
|
25
|
+
f(() => {
|
|
26
|
+
N.current = void 0;
|
|
27
|
+
}, [_, c]);
|
|
28
|
+
let F = d(() => {
|
|
29
|
+
if (S) return;
|
|
30
|
+
let e = O.isFetching ? void 0 : g(k, v);
|
|
31
|
+
T(e ? {
|
|
27
32
|
accountHolderName: e.account_holder_name ?? "",
|
|
28
33
|
routingNumber: e.routing_number ?? "",
|
|
29
34
|
accountNumber: e.account_number ?? ""
|
|
30
|
-
} :
|
|
31
|
-
}, [
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
} : h), N.current = e?.id ?? N.current, P.current = !O.isFetching, D(void 0), C(!0);
|
|
36
|
+
}, [
|
|
37
|
+
k,
|
|
38
|
+
O.isFetching,
|
|
39
|
+
v,
|
|
40
|
+
S
|
|
41
|
+
]);
|
|
42
|
+
f(() => {
|
|
43
|
+
if (!S || P.current || O.isFetching) return;
|
|
44
|
+
P.current = !0;
|
|
45
|
+
let e = g(k, v);
|
|
46
|
+
e && (T((t) => t.accountHolderName === "" && t.routingNumber === "" && t.accountNumber === "" ? {
|
|
37
47
|
accountHolderName: e.account_holder_name ?? "",
|
|
38
48
|
routingNumber: e.routing_number ?? "",
|
|
39
49
|
accountNumber: e.account_number ?? ""
|
|
40
|
-
} : t),
|
|
50
|
+
} : t), N.current = e.id);
|
|
41
51
|
}, [
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
52
|
+
S,
|
|
53
|
+
O.isFetching,
|
|
54
|
+
k,
|
|
55
|
+
v,
|
|
56
|
+
y
|
|
45
57
|
]);
|
|
46
|
-
let
|
|
47
|
-
|
|
48
|
-
}, []),
|
|
49
|
-
|
|
58
|
+
let I = d(() => {
|
|
59
|
+
C(!1);
|
|
60
|
+
}, []), L = d((e) => {
|
|
61
|
+
T((t) => ({
|
|
50
62
|
...t,
|
|
51
63
|
...e
|
|
52
64
|
}));
|
|
53
|
-
}, []),
|
|
54
|
-
if (!
|
|
55
|
-
let t =
|
|
56
|
-
if (Object.keys(t).length > 0) return
|
|
57
|
-
if (
|
|
58
|
-
let
|
|
65
|
+
}, []), R = d(async () => {
|
|
66
|
+
if (!c || !_) return !1;
|
|
67
|
+
let t = u(w);
|
|
68
|
+
if (Object.keys(t).length > 0) return D(t), !1;
|
|
69
|
+
if (D(void 0), !y || O.isFetching || O.isError) return e.error(b), !1;
|
|
70
|
+
let n = N.current;
|
|
59
71
|
try {
|
|
60
|
-
let e =
|
|
61
|
-
e.kind === "update" ? (await
|
|
72
|
+
let e = l(k, n ?? s(k)?.id);
|
|
73
|
+
e.kind === "update" ? (await j.mutateAsync({
|
|
62
74
|
path: {
|
|
63
|
-
counterpart_id:
|
|
75
|
+
counterpart_id: _,
|
|
64
76
|
bank_account_id: e.bankAccountId
|
|
65
77
|
},
|
|
66
|
-
body:
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
78
|
+
body: o(w, { includeAchDefaults: e.includeAchDefaults }),
|
|
79
|
+
payableId: c,
|
|
80
|
+
makeDefault: e.includeAchDefaults || !k?.find((t) => t.id === e.bankAccountId)?.is_default_for_currency
|
|
81
|
+
}), n = e.bankAccountId) : n = (await A.mutateAsync({
|
|
82
|
+
path: { counterpart_id: _ },
|
|
83
|
+
body: a(w, { isDefaultForCurrency: e.isDefaultForCurrency })
|
|
84
|
+
}))?.id, N.current = n;
|
|
71
85
|
} catch {
|
|
72
|
-
return e.error(
|
|
86
|
+
return e.error(b), !1;
|
|
73
87
|
}
|
|
74
|
-
try {
|
|
75
|
-
await
|
|
76
|
-
path: { payable_id:
|
|
77
|
-
body: { counterpart_bank_account_id:
|
|
88
|
+
if (n !== v) try {
|
|
89
|
+
await M.mutateAsync({
|
|
90
|
+
path: { payable_id: c },
|
|
91
|
+
body: { counterpart_bank_account_id: n }
|
|
78
92
|
});
|
|
79
93
|
} catch {
|
|
80
|
-
return e.error(
|
|
94
|
+
return e.error(x), !1;
|
|
81
95
|
}
|
|
82
|
-
return
|
|
96
|
+
return C(!1), !0;
|
|
83
97
|
}, [
|
|
84
|
-
E,
|
|
85
|
-
T.isError,
|
|
86
|
-
T.isFetching,
|
|
87
|
-
g,
|
|
88
|
-
D,
|
|
89
|
-
v,
|
|
90
|
-
h,
|
|
91
|
-
_,
|
|
92
|
-
O,
|
|
93
98
|
k,
|
|
94
|
-
|
|
99
|
+
O.isError,
|
|
100
|
+
O.isFetching,
|
|
101
|
+
y,
|
|
102
|
+
_,
|
|
103
|
+
A,
|
|
104
|
+
v,
|
|
105
|
+
x,
|
|
106
|
+
c,
|
|
107
|
+
b,
|
|
108
|
+
j,
|
|
109
|
+
M,
|
|
110
|
+
w
|
|
95
111
|
]);
|
|
96
112
|
return {
|
|
97
|
-
isOpen:
|
|
98
|
-
values:
|
|
99
|
-
errors:
|
|
100
|
-
isSaving:
|
|
101
|
-
open:
|
|
102
|
-
close:
|
|
103
|
-
onChange:
|
|
104
|
-
save:
|
|
113
|
+
isOpen: S,
|
|
114
|
+
values: w,
|
|
115
|
+
errors: E,
|
|
116
|
+
isSaving: A.isPending || j.isPending || M.isPending,
|
|
117
|
+
open: F,
|
|
118
|
+
close: I,
|
|
119
|
+
onChange: L,
|
|
120
|
+
save: R
|
|
105
121
|
};
|
|
106
122
|
}
|
|
107
123
|
//#endregion
|
|
108
|
-
export {
|
|
124
|
+
export { _ as usePaymentInstructionsForm };
|