@tesouro/embedded-components-react 0.5.67 → 0.5.69
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/feature/dist/index49.js +4 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index53.js +185 -188
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index56.js +30 -20
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index61.js +356 -351
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index83.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/shared/bank-disclosures/feature/dist/lib/BankDisclosuresWidget/BankDisclosuresWidget.js +1 -2
- package/dist/libs/tesouro-embedded-components-react/shared/bank-disclosures/ui/dist/index2.js +0 -1
- package/dist/libs/tesouro-embedded-components-react/shared/bank-disclosures/ui/dist/index3.js +19 -22
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/labels.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/useCounterpartForm.js +71 -37
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index2.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/package.json +1 -1
|
@@ -93,7 +93,7 @@ function D({ labels: u, onEnqueueFiles: b, openPayableId: x, onOpenPayableHandle
|
|
|
93
93
|
k(e), j(!0);
|
|
94
94
|
return;
|
|
95
95
|
}
|
|
96
|
-
N(e),
|
|
96
|
+
N(e), L(!0);
|
|
97
97
|
}, [G]), se = t(B?.scopes, [n.CounterpartReadOrg]), q = f({
|
|
98
98
|
enabled: W,
|
|
99
99
|
canReadVendors: se,
|
|
@@ -107,7 +107,7 @@ function D({ labels: u, onEnqueueFiles: b, openPayableId: x, onOpenPayableHandle
|
|
|
107
107
|
label: D.queues[e],
|
|
108
108
|
icon: E[e]
|
|
109
109
|
})), [D.queues]), ue = (e) => {
|
|
110
|
-
z(!1), N(e),
|
|
110
|
+
z(!1), N(e), L(!0);
|
|
111
111
|
}, de = () => {
|
|
112
112
|
F(!1), L(!0);
|
|
113
113
|
}, fe = () => {
|
|
@@ -28,10 +28,9 @@ function p({ labels: n }) {
|
|
|
28
28
|
}), x = l(n), S = s(g).map((e) => ({
|
|
29
29
|
...e,
|
|
30
30
|
ariaLabel: x.viewButtonAriaLabel.replace("{title}", e.title)
|
|
31
|
-
}))
|
|
31
|
+
}));
|
|
32
32
|
return /* @__PURE__ */ f(u, {
|
|
33
33
|
documents: S,
|
|
34
|
-
versionLabel: C,
|
|
35
34
|
isLoading: !h || _ || v,
|
|
36
35
|
isError: y,
|
|
37
36
|
onRetry: () => {
|
package/dist/libs/tesouro-embedded-components-react/shared/bank-disclosures/ui/dist/index2.js
CHANGED
|
@@ -3,7 +3,6 @@ var e = {
|
|
|
3
3
|
fileTypeBadge: "PDF",
|
|
4
4
|
viewButton: "View",
|
|
5
5
|
viewButtonAriaLabel: "View {title}",
|
|
6
|
-
versionLabel: "Version {version}",
|
|
7
6
|
emptyTitle: "No disclosures available",
|
|
8
7
|
emptyDescription: "Your bank has not published any disclosures yet.",
|
|
9
8
|
errorTitle: "Unable to load disclosures",
|
package/dist/libs/tesouro-embedded-components-react/shared/bank-disclosures/ui/dist/index3.js
CHANGED
|
@@ -7,19 +7,19 @@ import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
|
7
7
|
import { ExternalLinkIcon as s, FileTextIcon as c } from "lucide-react";
|
|
8
8
|
//#region ../../libs/tesouro-embedded-components-react/shared/bank-disclosures/ui/dist/index3.js
|
|
9
9
|
var l = 3;
|
|
10
|
-
function u({ documents: u,
|
|
11
|
-
let
|
|
10
|
+
function u({ documents: u, isLoading: d = !1, isError: f = !1, onRetry: p, labels: m, testIds: h }) {
|
|
11
|
+
let g = i(m);
|
|
12
12
|
return /* @__PURE__ */ a("div", {
|
|
13
|
-
"data-testid":
|
|
13
|
+
"data-testid": h?.root,
|
|
14
14
|
className: "ttw:flex ttw:flex-col ttw:gap-4",
|
|
15
|
-
children:
|
|
16
|
-
testId:
|
|
17
|
-
title:
|
|
18
|
-
description:
|
|
19
|
-
retryLabel:
|
|
20
|
-
onRetry:
|
|
21
|
-
}) :
|
|
22
|
-
"data-testid":
|
|
15
|
+
children: f ? /* @__PURE__ */ a(r, {
|
|
16
|
+
testId: h?.error,
|
|
17
|
+
title: g.errorTitle,
|
|
18
|
+
description: g.errorDescription,
|
|
19
|
+
retryLabel: p ? g.errorRetry : void 0,
|
|
20
|
+
onRetry: p
|
|
21
|
+
}) : d ? /* @__PURE__ */ a("div", {
|
|
22
|
+
"data-testid": h?.loading,
|
|
23
23
|
className: "ttw:divide-y ttw:divide-border ttw:rounded-lg ttw:border ttw:border-border ttw:bg-background",
|
|
24
24
|
children: Array.from({ length: l }, (e, n) => /* @__PURE__ */ o("div", {
|
|
25
25
|
className: "ttw:flex ttw:items-center ttw:gap-4 ttw:p-4",
|
|
@@ -30,15 +30,12 @@ function u({ documents: u, versionLabel: d, isLoading: f = !1, isError: p = !1,
|
|
|
30
30
|
]
|
|
31
31
|
}, n))
|
|
32
32
|
}) : u.length === 0 ? /* @__PURE__ */ a(n, {
|
|
33
|
-
testId:
|
|
34
|
-
title:
|
|
35
|
-
description:
|
|
36
|
-
}) : /* @__PURE__ */
|
|
33
|
+
testId: h?.empty,
|
|
34
|
+
title: g.emptyTitle,
|
|
35
|
+
description: g.emptyDescription
|
|
36
|
+
}) : /* @__PURE__ */ a("div", {
|
|
37
37
|
className: "ttw:flex ttw:flex-col ttw:gap-2",
|
|
38
|
-
children:
|
|
39
|
-
className: "ttw:text-xs ttw:text-muted-foreground",
|
|
40
|
-
children: d
|
|
41
|
-
}) : null, /* @__PURE__ */ a("ul", {
|
|
38
|
+
children: /* @__PURE__ */ a("ul", {
|
|
42
39
|
className: "ttw:divide-y ttw:divide-border ttw:rounded-lg ttw:border ttw:border-border ttw:bg-background",
|
|
43
40
|
children: u.map((t) => /* @__PURE__ */ o("li", {
|
|
44
41
|
className: "ttw:flex ttw:items-center ttw:gap-4 ttw:p-4",
|
|
@@ -48,7 +45,7 @@ function u({ documents: u, versionLabel: d, isLoading: f = !1, isError: p = !1,
|
|
|
48
45
|
className: "ttw:flex ttw:h-12 ttw:w-10 ttw:shrink-0 ttw:flex-col ttw:items-center ttw:justify-center ttw:gap-0.5 ttw:rounded ttw:border ttw:border-border ttw:text-muted-foreground",
|
|
49
46
|
children: [/* @__PURE__ */ a(c, { className: "ttw:size-4" }), /* @__PURE__ */ a("span", {
|
|
50
47
|
className: "ttw:text-[9px] ttw:font-medium ttw:uppercase ttw:tracking-wide",
|
|
51
|
-
children:
|
|
48
|
+
children: g.fileTypeBadge
|
|
52
49
|
})]
|
|
53
50
|
}),
|
|
54
51
|
/* @__PURE__ */ a("span", {
|
|
@@ -67,12 +64,12 @@ function u({ documents: u, versionLabel: d, isLoading: f = !1, isError: p = !1,
|
|
|
67
64
|
children: [/* @__PURE__ */ a(s, {
|
|
68
65
|
"aria-hidden": !0,
|
|
69
66
|
className: "ttw:size-4"
|
|
70
|
-
}),
|
|
67
|
+
}), g.viewButton]
|
|
71
68
|
})
|
|
72
69
|
})
|
|
73
70
|
]
|
|
74
71
|
}, t.url))
|
|
75
|
-
})
|
|
72
|
+
})
|
|
76
73
|
})
|
|
77
74
|
});
|
|
78
75
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
//#region ../../libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/labels.js
|
|
2
2
|
var e = {
|
|
3
|
-
legalNameRequired: "
|
|
3
|
+
legalNameRequired: "Business name is required",
|
|
4
4
|
firstNameRequired: "First name is required",
|
|
5
5
|
lastNameRequired: "Last name is required",
|
|
6
6
|
emailRequired: "Email is required",
|
|
@@ -18,7 +18,7 @@ var e = {
|
|
|
18
18
|
genericError: "Something went wrong. Please try again.",
|
|
19
19
|
deleteTitle: "Delete “{name}”?",
|
|
20
20
|
deleteBankAccountTitle: "Delete bank account “{account}”?",
|
|
21
|
-
deleteCounterpartMessage: "This
|
|
21
|
+
deleteCounterpartMessage: "This record and its contacts, bank accounts, and tax ID will be permanently removed. You can't undo this action.",
|
|
22
22
|
deleteBankAccountMessage: "This removes these payment instructions from the vendor. The vendor will not be deleted. You can't undo this action."
|
|
23
23
|
};
|
|
24
24
|
//#endregion
|
|
@@ -7,48 +7,71 @@ import { useCreateCounterpartMutation as t, useUpdateCounterpartMutation as n }
|
|
|
7
7
|
import { useCreateCounterpartBankAccountMutation as r, useUpdateCounterpartBankAccountMutation as i } from "../../../data-access/dist/index5.js";
|
|
8
8
|
import { useCreateCounterpartAddressMutation as a, useUpdateCounterpartAddressMutation as o } from "../../../data-access/dist/index7.js";
|
|
9
9
|
import "../../../data-access/dist/index.js";
|
|
10
|
-
import { addressFormToCreatePayload as s, addressFormToUpdatePayload as c, addressResponseToFormValues as l, counterpartFormBankAccountToCreatePayload as u, counterpartFormBankAccountToUpdatePayload as
|
|
11
|
-
import { useCallback as
|
|
10
|
+
import { addressFormToCreatePayload as s, addressFormToUpdatePayload as c, addressResponseToFormValues as l, counterpartFormBankAccountToCreatePayload as u, counterpartFormBankAccountToUpdatePayload as ee, counterpartFormToCreatePayload as te, counterpartFormToUpdatePayload as d, counterpartToFormValues as f, emptyCounterpartFormValues as p, getAchInstructions as m, hasCounterpartFormAddressValues as h, hasCounterpartFormBankAccountValues as g, hasCounterpartFormErrors as _, resolveCounterpartBankAccountWrite as v, validateCounterpartForm as y } from "./helpers.js";
|
|
11
|
+
import { useCallback as b, useState as x } from "react";
|
|
12
12
|
//#region ../../libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/useCounterpartForm.js
|
|
13
|
-
function
|
|
14
|
-
if (!t) return
|
|
13
|
+
function S(e, t) {
|
|
14
|
+
if (!t) return h(e);
|
|
15
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
|
-
function
|
|
18
|
+
function C(e) {
|
|
19
19
|
return {
|
|
20
20
|
accountHolderName: e.account_holder_name ?? "",
|
|
21
21
|
routingNumber: e.routing_number ?? "",
|
|
22
22
|
accountNumber: e.account_number ?? ""
|
|
23
23
|
};
|
|
24
24
|
}
|
|
25
|
-
function
|
|
26
|
-
if (!t) return
|
|
27
|
-
let n =
|
|
25
|
+
function w(e, t) {
|
|
26
|
+
if (!t) return g(e);
|
|
27
|
+
let n = C(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 T(e, t) {
|
|
31
|
+
let n = { ...e };
|
|
32
|
+
if ([
|
|
33
|
+
"legalName",
|
|
34
|
+
"firstName",
|
|
35
|
+
"lastName",
|
|
36
|
+
"email"
|
|
37
|
+
].forEach((e) => {
|
|
38
|
+
n[e] && !t[e] && delete n[e];
|
|
39
|
+
}), e.address) {
|
|
40
|
+
let r = { ...e.address };
|
|
41
|
+
Object.keys(r).forEach((e) => {
|
|
42
|
+
r[e] && !t.address?.[e] && delete r[e];
|
|
43
|
+
}), n.address = Object.keys(r).length ? r : void 0;
|
|
44
|
+
}
|
|
45
|
+
if (e.bankAccount) {
|
|
46
|
+
let r = { ...e.bankAccount };
|
|
47
|
+
Object.keys(r).forEach((e) => {
|
|
48
|
+
r[e] && !t.bankAccount?.[e] && delete r[e];
|
|
49
|
+
}), n.bankAccount = Object.keys(r).length ? r : void 0;
|
|
50
|
+
}
|
|
51
|
+
return n;
|
|
52
|
+
}
|
|
30
53
|
function E({ view: l, setView: E, selectedId: D, setSelectedId: O, messages: k, counterpartType: A, counterpart: j, primaryAddress: M, bankAccounts: N, isBankAccountsLoading: P, isBankAccountsError: F, includeBankAccount: I = !0 }) {
|
|
31
|
-
let L = A === "vendor" && I, R = t(), z = a(), B = r(), V = n(), H = o(), U = i(), [W, G] =
|
|
54
|
+
let L = A === "vendor" && I, R = t(), z = a(), B = r(), V = n(), H = o(), U = i(), [W, G] = x(() => p()), [K, q] = x({}), [J, Y] = x({
|
|
32
55
|
address: !1,
|
|
33
56
|
bankAccount: !1
|
|
34
|
-
}), [X, Z] =
|
|
57
|
+
}), [X, Z] = x(), [Q, $] = x(), ne = R.isPending || z.isPending || B.isPending || U.isPending || V.isPending || H.isPending, re = b(() => {
|
|
35
58
|
O(void 0), $(void 0), Z(void 0), Y({
|
|
36
59
|
address: A === "vendor",
|
|
37
60
|
bankAccount: !1
|
|
38
|
-
}), G(
|
|
61
|
+
}), G(p("organization", A)), q({}), E("create");
|
|
39
62
|
}, [
|
|
40
63
|
A,
|
|
41
64
|
O,
|
|
42
65
|
E
|
|
43
|
-
]),
|
|
66
|
+
]), ie = b(() => {
|
|
44
67
|
if (!j || L && (P || F)) return;
|
|
45
|
-
let e = L ?
|
|
68
|
+
let e = L ? m(N) : void 0, t = f(j, M);
|
|
46
69
|
$(void 0), Z(e?.id), Y({
|
|
47
|
-
address:
|
|
70
|
+
address: h(t),
|
|
48
71
|
bankAccount: !1
|
|
49
72
|
}), G({
|
|
50
73
|
...t,
|
|
51
|
-
...e ? { bankAccount:
|
|
74
|
+
...e ? { bankAccount: C(e) } : {}
|
|
52
75
|
}), q({}), E("edit");
|
|
53
76
|
}, [
|
|
54
77
|
N,
|
|
@@ -58,27 +81,38 @@ function E({ view: l, setView: E, selectedId: D, setSelectedId: O, messages: k,
|
|
|
58
81
|
M,
|
|
59
82
|
E,
|
|
60
83
|
L
|
|
61
|
-
]),
|
|
84
|
+
]), ae = b(() => {
|
|
62
85
|
E("none");
|
|
63
|
-
}, [E])
|
|
86
|
+
}, [E]), oe = b(() => {
|
|
87
|
+
Y((e) => ({
|
|
88
|
+
...e,
|
|
89
|
+
address: !0
|
|
90
|
+
}));
|
|
91
|
+
}, []);
|
|
64
92
|
return {
|
|
65
93
|
values: W,
|
|
66
94
|
errors: K,
|
|
67
|
-
setValues:
|
|
68
|
-
|
|
95
|
+
setValues: b((e) => {
|
|
96
|
+
G((t) => {
|
|
97
|
+
let n = typeof e == "function" ? e(t) : e;
|
|
98
|
+
return q((e) => _(e) ? T(e, y(n, l === "edit" ? "edit" : "create", k, A, l === "edit" && L && !!X)) : e), n;
|
|
99
|
+
});
|
|
100
|
+
}, [
|
|
101
|
+
X,
|
|
102
|
+
A,
|
|
103
|
+
k,
|
|
104
|
+
l,
|
|
105
|
+
L
|
|
106
|
+
]),
|
|
107
|
+
isSubmitting: ne,
|
|
69
108
|
sectionsToExpand: J,
|
|
70
|
-
expandAddress:
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
openEdit: re,
|
|
78
|
-
close: ie,
|
|
79
|
-
submit: x(async () => {
|
|
80
|
-
let t = l === "edit" ? "edit" : "create", n = b(W, t, k, A, t === "edit" && L && !!X);
|
|
81
|
-
if (ee(n)) return q(n), Y((e) => ({
|
|
109
|
+
expandAddress: oe,
|
|
110
|
+
openCreate: re,
|
|
111
|
+
openEdit: ie,
|
|
112
|
+
close: ae,
|
|
113
|
+
submit: b(async () => {
|
|
114
|
+
let t = l === "edit" ? "edit" : "create", n = y(W, t, k, A, t === "edit" && L && !!X);
|
|
115
|
+
if (_(n)) return q(n), Y((e) => ({
|
|
82
116
|
address: e.address || !!n.address,
|
|
83
117
|
bankAccount: e.bankAccount || !!n.bankAccount
|
|
84
118
|
})), { ok: !1 };
|
|
@@ -91,23 +125,23 @@ function E({ view: l, setView: E, selectedId: D, setSelectedId: O, messages: k,
|
|
|
91
125
|
if (l === "edit" && D) {
|
|
92
126
|
$(void 0), await V.mutateAsync({
|
|
93
127
|
path: { counterpart_id: D },
|
|
94
|
-
body:
|
|
128
|
+
body: d(W, A)
|
|
95
129
|
});
|
|
96
|
-
let e = M ?
|
|
130
|
+
let e = M ? S(W, M) ? H.mutateAsync({
|
|
97
131
|
path: {
|
|
98
132
|
counterpart_id: D,
|
|
99
133
|
address_id: M.id
|
|
100
134
|
},
|
|
101
135
|
body: c(W.address)
|
|
102
|
-
}) : void 0 :
|
|
136
|
+
}) : void 0 : h(W) ? z.mutateAsync({
|
|
103
137
|
path: { counterpart_id: D },
|
|
104
138
|
body: s(W.address)
|
|
105
|
-
}) : void 0, t = L &&
|
|
139
|
+
}) : void 0, t = L && w(W, m(N)) ? v(N, X) : void 0, n = t?.kind === "update" ? U.mutateAsync({
|
|
106
140
|
path: {
|
|
107
141
|
counterpart_id: D,
|
|
108
142
|
bank_account_id: t.bankAccountId
|
|
109
143
|
},
|
|
110
|
-
body:
|
|
144
|
+
body: ee(W.bankAccount, { includeAchDefaults: t.includeAchDefaults })
|
|
111
145
|
}) : t?.kind === "create" ? B.mutateAsync({
|
|
112
146
|
path: { counterpart_id: D },
|
|
113
147
|
body: u(W.bankAccount, { isDefaultForCurrency: t.isDefaultForCurrency })
|
|
@@ -119,7 +153,7 @@ function E({ view: l, setView: E, selectedId: D, setSelectedId: O, messages: k,
|
|
|
119
153
|
counterpartId: D
|
|
120
154
|
};
|
|
121
155
|
}
|
|
122
|
-
return r ||= (await R.mutateAsync({ body:
|
|
156
|
+
return r ||= (await R.mutateAsync({ body: te(W, A) }))?.id, r && L && g(W) && ($(r), await B.mutateAsync({
|
|
123
157
|
path: { counterpart_id: r },
|
|
124
158
|
body: u(W.bankAccount)
|
|
125
159
|
})), $(void 0), E("none"), r && O(r), {
|
package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index2.js
CHANGED
|
@@ -57,7 +57,7 @@ var n = {
|
|
|
57
57
|
paymentRemindersLabel: "Payment reminders",
|
|
58
58
|
paymentRemindersDescription: "Send automatic reminders for unpaid customer invoices.",
|
|
59
59
|
paymentMethodsHeading: "Accepted payment methods",
|
|
60
|
-
paymentMethodsDescription: "
|
|
60
|
+
paymentMethodsDescription: "ACH bank transfer details for this vendor.",
|
|
61
61
|
accountHolderNameLabel: "Account holder name",
|
|
62
62
|
routingNumberLabel: "Routing number",
|
|
63
63
|
accountNumberLabel: "Account number",
|
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.5.
|
|
2
|
+
var e = "@tesouro/embedded-components-react", t = "0.5.69", n = "a4d77b036b5ea457e3c6507a73d1361a685d094a", r = Object.freeze({
|
|
3
3
|
library_name: e,
|
|
4
4
|
library_version: t,
|
|
5
5
|
library_sha: n
|