@tesouro/embedded-components-react 0.7.28 → 0.7.29
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/index.d.ts +1 -12
- package/dist/lib/CounterpartsWidget.d.ts +1 -12
- package/dist/lib/CounterpartsWidgetPublic.d.ts +1 -12
- package/dist/lib/CustomersWidget.d.ts +0 -2
- package/dist/lib/ReceivablesWidget.d.ts +0 -2
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/CounterpartDetailsContainer.js +59 -38
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/CounterpartDetailsPanel.js +137 -0
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/CounterpartsWidget.js +86 -182
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/useCounterpartDetailsActions.js +116 -0
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/useCounterpartDetailsSheetView.js +16 -16
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/useCounterpartsWidget.js +51 -108
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/useRebaseOnRefresh.js +33 -0
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/viewModels.js +40 -39
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index4.js +2 -65
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index5.js +37 -181
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index6.js +193 -502
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index7.js +520 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/ReceivablesWidget.js +2 -0
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/data-access/dist/index.js +3 -3
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/data-access/dist/index5.js +31 -55
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/index.js +11 -11
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/helpers.js +98 -163
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/labels.js +1 -3
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/subEntityForms.js +37 -32
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/useCounterpartForm.js +86 -93
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index10.js +2 -0
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index12.js +42 -173
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index2.js +3 -12
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index5.js +16 -16
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/index.js +42 -42
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/sdk.gen.js +117 -125
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/package.json +1 -1
|
@@ -3,31 +3,24 @@
|
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
5
|
import { extractApiErrorMessage as e } from "../../../../util/dist/lib/apiErrors.js";
|
|
6
|
-
import { addressFormToCreatePayload as t, addressFormToUpdatePayload as n, addressResponseToFormValues as r,
|
|
7
|
-
import { useCreateCounterpartMutation as
|
|
6
|
+
import { addressFormToCreatePayload as t, addressFormToUpdatePayload as n, addressResponseToFormValues as r, bankAccountToAchFormValues as i, counterpartFormBankAccountToCreatePayload as a, counterpartFormBankAccountToUpdatePayload as o, counterpartFormToCreatePayload as s, counterpartFormToUpdatePayload as ee, counterpartToFormValues as c, emptyCounterpartFormValues as l, getAchInstructions as u, hasCounterpartFormAddressValues as d, hasCounterpartFormBankAccountValues as f, hasCounterpartFormErrors as p, resolveCounterpartBankAccountWrite as m, validateCounterpartForm as h, withoutUnchangedContactErrors as g } from "./helpers.js";
|
|
7
|
+
import { useCreateCounterpartMutation as _, useUpdateCounterpartMutation as te } from "../../../data-access/dist/index3.js";
|
|
8
8
|
import { useCreateCounterpartBankAccountMutation as v, useUpdateCounterpartBankAccountMutation as y } from "../../../data-access/dist/index5.js";
|
|
9
|
-
import { useCreateCounterpartAddressMutation as
|
|
9
|
+
import { useCreateCounterpartAddressMutation as ne, useUpdateCounterpartAddressMutation as re } from "../../../data-access/dist/index7.js";
|
|
10
10
|
import "../../../data-access/dist/index.js";
|
|
11
|
-
import { useCallback as
|
|
11
|
+
import { useCallback as b, useLayoutEffect as ie, useState as x } from "react";
|
|
12
12
|
//#region ../../libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/useCounterpartForm.js
|
|
13
|
-
function
|
|
13
|
+
function ae(e, t) {
|
|
14
14
|
if (!t) return d(e);
|
|
15
15
|
let n = r(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
|
|
19
|
-
return {
|
|
20
|
-
accountHolderName: e.account_holder_name ?? "",
|
|
21
|
-
routingNumber: e.routing_number ?? "",
|
|
22
|
-
accountNumber: e.account_number ?? ""
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
function ne(e, t) {
|
|
18
|
+
function S(e, t) {
|
|
26
19
|
if (!t) return f(e);
|
|
27
|
-
let n =
|
|
20
|
+
let n = i(t);
|
|
28
21
|
return e.bankAccount.accountHolderName.trim() !== n.accountHolderName.trim() || e.bankAccount.routingNumber.trim() !== n.routingNumber.trim() || e.bankAccount.accountNumber.trim() !== n.accountNumber.trim();
|
|
29
22
|
}
|
|
30
|
-
function
|
|
23
|
+
function C(e, t) {
|
|
31
24
|
let n = { ...e };
|
|
32
25
|
if ([
|
|
33
26
|
"legalName",
|
|
@@ -52,146 +45,146 @@ function re(e, t) {
|
|
|
52
45
|
}
|
|
53
46
|
return JSON.stringify(n) === JSON.stringify(e) ? e : n;
|
|
54
47
|
}
|
|
55
|
-
function
|
|
56
|
-
let
|
|
48
|
+
function w({ view: r, setView: w, selectedId: T, setSelectedId: E, messages: D, counterpartType: O, counterpart: k, primaryAddress: A, bankAccounts: j, isBankAccountsLoading: M, isBankAccountsError: N, includeBankAccount: P = !0 }) {
|
|
49
|
+
let F = O === "vendor" && P, I = _(), L = ne(), R = v(), z = te(), B = re(), V = y(), [H, U] = x(() => l()), [W, G] = x({}), [K, q] = x({
|
|
57
50
|
address: !1,
|
|
58
51
|
bankAccount: !1
|
|
59
|
-
}), [J, Y] =
|
|
60
|
-
|
|
61
|
-
address:
|
|
52
|
+
}), [J, Y] = x(), [X, Z] = x(), oe = I.isPending || L.isPending || R.isPending || V.isPending || z.isPending || B.isPending, se = b(() => {
|
|
53
|
+
E(void 0), Z(void 0), Y(void 0), q({
|
|
54
|
+
address: O === "vendor",
|
|
62
55
|
bankAccount: !1
|
|
63
|
-
}),
|
|
56
|
+
}), U(l("organization", O)), G({}), w("create");
|
|
64
57
|
}, [
|
|
65
|
-
A,
|
|
66
58
|
O,
|
|
67
|
-
E
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
59
|
+
E,
|
|
60
|
+
w
|
|
61
|
+
]), ce = b(() => {
|
|
62
|
+
if (!k || F && (M || N)) return;
|
|
63
|
+
let e = F ? u(j) : void 0, t = c(k, A);
|
|
71
64
|
Z(void 0), Y(e?.id), q({
|
|
72
65
|
address: d(t),
|
|
73
66
|
bankAccount: !1
|
|
74
|
-
}),
|
|
67
|
+
}), U({
|
|
75
68
|
...t,
|
|
76
|
-
...e ? { bankAccount:
|
|
77
|
-
}),
|
|
69
|
+
...e ? { bankAccount: i(e) } : {}
|
|
70
|
+
}), G({}), w("edit");
|
|
78
71
|
}, [
|
|
79
|
-
N,
|
|
80
72
|
j,
|
|
81
|
-
|
|
82
|
-
|
|
73
|
+
k,
|
|
74
|
+
N,
|
|
83
75
|
M,
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
76
|
+
A,
|
|
77
|
+
w,
|
|
78
|
+
F
|
|
79
|
+
]), le = b(() => {
|
|
80
|
+
w("none");
|
|
81
|
+
}, [w]), ue = b(() => {
|
|
89
82
|
q((e) => ({
|
|
90
83
|
...e,
|
|
91
84
|
address: !0
|
|
92
85
|
}));
|
|
93
|
-
}, []), [Q, $] =
|
|
94
|
-
return
|
|
95
|
-
let e = r === "edit" ? "edit" : "create", t =
|
|
86
|
+
}, []), [Q, $] = x(!1), de = b(() => $(!0), []);
|
|
87
|
+
return ie(() => {
|
|
88
|
+
let e = r === "edit" ? "edit" : "create", t = h(H, e, D, O, e === "edit" && F && !!J);
|
|
96
89
|
if (Q) {
|
|
97
|
-
$(!1),
|
|
90
|
+
$(!1), G(t);
|
|
98
91
|
return;
|
|
99
92
|
}
|
|
100
|
-
|
|
93
|
+
G((e) => p(e) ? C(e, t) : e);
|
|
101
94
|
}, [
|
|
102
95
|
J,
|
|
103
|
-
|
|
96
|
+
O,
|
|
104
97
|
Q,
|
|
105
|
-
|
|
106
|
-
|
|
98
|
+
D,
|
|
99
|
+
H,
|
|
107
100
|
r,
|
|
108
|
-
|
|
101
|
+
F
|
|
109
102
|
]), {
|
|
110
|
-
values:
|
|
111
|
-
errors:
|
|
112
|
-
setValues:
|
|
103
|
+
values: H,
|
|
104
|
+
errors: W,
|
|
105
|
+
setValues: U,
|
|
113
106
|
isSubmitting: oe,
|
|
114
|
-
sectionsToExpand:
|
|
107
|
+
sectionsToExpand: K,
|
|
115
108
|
expandAddress: ue,
|
|
116
109
|
openCreate: se,
|
|
117
110
|
openEdit: ce,
|
|
118
111
|
close: le,
|
|
119
|
-
submit:
|
|
120
|
-
let
|
|
121
|
-
if (p(
|
|
122
|
-
address: e.address || !!
|
|
123
|
-
bankAccount: e.bankAccount || !!
|
|
112
|
+
submit: b(async () => {
|
|
113
|
+
let i = r === "edit" ? "edit" : "create", l = g(h(H, i, D, O, i === "edit" && F && !!J), H, i === "edit" && k ? c(k, A) : void 0);
|
|
114
|
+
if (p(l)) return G(l), q((e) => ({
|
|
115
|
+
address: e.address || !!l.address,
|
|
116
|
+
bankAccount: e.bankAccount || !!l.bankAccount
|
|
124
117
|
})), { ok: !1 };
|
|
125
|
-
|
|
118
|
+
G({}), q({
|
|
126
119
|
address: !1,
|
|
127
120
|
bankAccount: !1
|
|
128
121
|
});
|
|
129
122
|
let _ = X;
|
|
130
123
|
try {
|
|
131
|
-
if (r === "edit" &&
|
|
132
|
-
Z(void 0), await
|
|
133
|
-
path: { counterpart_id:
|
|
134
|
-
body:
|
|
124
|
+
if (r === "edit" && T) {
|
|
125
|
+
Z(void 0), await z.mutateAsync({
|
|
126
|
+
path: { counterpart_id: T },
|
|
127
|
+
body: ee(H, O)
|
|
135
128
|
});
|
|
136
|
-
let e =
|
|
129
|
+
let e = A ? ae(H, A) ? B.mutateAsync({
|
|
137
130
|
path: {
|
|
138
|
-
counterpart_id:
|
|
139
|
-
address_id:
|
|
131
|
+
counterpart_id: T,
|
|
132
|
+
address_id: A.id
|
|
140
133
|
},
|
|
141
|
-
body: n(
|
|
142
|
-
}) : void 0 : d(
|
|
143
|
-
path: { counterpart_id:
|
|
144
|
-
body: t(
|
|
145
|
-
}) : void 0, r =
|
|
134
|
+
body: n(H.address)
|
|
135
|
+
}) : void 0 : d(H) ? L.mutateAsync({
|
|
136
|
+
path: { counterpart_id: T },
|
|
137
|
+
body: t(H.address)
|
|
138
|
+
}) : void 0, r = F && S(H, u(j)) ? m(j, J) : void 0, i = r?.kind === "update" ? V.mutateAsync({
|
|
146
139
|
path: {
|
|
147
|
-
counterpart_id:
|
|
140
|
+
counterpart_id: T,
|
|
148
141
|
bank_account_id: r.bankAccountId
|
|
149
142
|
},
|
|
150
|
-
body:
|
|
151
|
-
}) : r?.kind === "create" ?
|
|
152
|
-
path: { counterpart_id:
|
|
153
|
-
body:
|
|
154
|
-
}) : void 0, [
|
|
155
|
-
if (r?.kind === "create" &&
|
|
156
|
-
if (
|
|
157
|
-
return
|
|
143
|
+
body: o(H.bankAccount, { includeAchDefaults: r.includeAchDefaults })
|
|
144
|
+
}) : r?.kind === "create" ? R.mutateAsync({
|
|
145
|
+
path: { counterpart_id: T },
|
|
146
|
+
body: a(H.bankAccount, { isDefaultForCurrency: r.isDefaultForCurrency })
|
|
147
|
+
}) : void 0, [s, c] = await Promise.allSettled([e, i]);
|
|
148
|
+
if (r?.kind === "create" && c.status === "fulfilled" && Y(c.value?.id), s.status === "rejected") throw s.reason;
|
|
149
|
+
if (c.status === "rejected") throw c.reason;
|
|
150
|
+
return w("none"), {
|
|
158
151
|
ok: !0,
|
|
159
|
-
counterpartId:
|
|
152
|
+
counterpartId: T
|
|
160
153
|
};
|
|
161
154
|
}
|
|
162
|
-
return _ ||= (await
|
|
155
|
+
return _ ||= (await I.mutateAsync({ body: s(H, O) }))?.id, _ && F && f(H) && (Z(_), await R.mutateAsync({
|
|
163
156
|
path: { counterpart_id: _ },
|
|
164
|
-
body:
|
|
165
|
-
})), Z(void 0),
|
|
157
|
+
body: a(H.bankAccount)
|
|
158
|
+
})), Z(void 0), w("none"), _ && E(_), {
|
|
166
159
|
ok: !0,
|
|
167
160
|
counterpartId: _
|
|
168
161
|
};
|
|
169
162
|
} catch (t) {
|
|
170
|
-
return _ && (Z(_),
|
|
163
|
+
return _ && (Z(_), E(_)), G({ form: e(t) ?? D.genericError }), { ok: !1 };
|
|
171
164
|
}
|
|
172
165
|
}, [
|
|
173
166
|
r,
|
|
174
|
-
|
|
175
|
-
|
|
167
|
+
H,
|
|
168
|
+
T,
|
|
176
169
|
X,
|
|
170
|
+
D,
|
|
171
|
+
O,
|
|
177
172
|
k,
|
|
178
173
|
A,
|
|
179
174
|
j,
|
|
180
|
-
M,
|
|
181
|
-
N,
|
|
182
175
|
J,
|
|
183
|
-
|
|
184
|
-
B,
|
|
176
|
+
L,
|
|
185
177
|
R,
|
|
186
|
-
|
|
187
|
-
|
|
178
|
+
I,
|
|
179
|
+
B,
|
|
188
180
|
V,
|
|
181
|
+
z,
|
|
182
|
+
w,
|
|
189
183
|
E,
|
|
190
|
-
|
|
191
|
-
L
|
|
184
|
+
F
|
|
192
185
|
]),
|
|
193
186
|
revealErrors: de
|
|
194
187
|
};
|
|
195
188
|
}
|
|
196
189
|
//#endregion
|
|
197
|
-
export {
|
|
190
|
+
export { w as useCounterpartForm };
|
package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index10.js
CHANGED
|
@@ -339,6 +339,7 @@ function A({ mode: a, counterpartMode: c = "customer", values: u, errors: m, sta
|
|
|
339
339
|
}),
|
|
340
340
|
/* @__PURE__ */ x(r, {
|
|
341
341
|
id: `${F}-legal-name`,
|
|
342
|
+
autoFocus: !0,
|
|
342
343
|
value: u.legalName,
|
|
343
344
|
"aria-required": !0,
|
|
344
345
|
"aria-invalid": !!m?.legalName,
|
|
@@ -359,6 +360,7 @@ function A({ mode: a, counterpartMode: c = "customer", values: u, errors: m, sta
|
|
|
359
360
|
}),
|
|
360
361
|
/* @__PURE__ */ x(r, {
|
|
361
362
|
id: `${F}-first-name`,
|
|
363
|
+
autoFocus: !0,
|
|
362
364
|
value: u.firstName,
|
|
363
365
|
"aria-required": !0,
|
|
364
366
|
"aria-invalid": !!m?.firstName,
|
package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index12.js
CHANGED
|
@@ -1,179 +1,48 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { BANK_ACCOUNT_FORM_SHEET_LABELS_EN as
|
|
3
|
-
import {
|
|
4
|
-
import { FormSheet as
|
|
5
|
-
import { useId as
|
|
6
|
-
import { jsx as
|
|
1
|
+
import { Typography as e } from "../../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
2
|
+
import { BANK_ACCOUNT_FORM_SHEET_LABELS_EN as t } from "./index2.js";
|
|
3
|
+
import { AchFieldGroup as n } from "./index5.js";
|
|
4
|
+
import { FormSheet as r } from "./index9.js";
|
|
5
|
+
import { useId as i } from "react";
|
|
6
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
7
7
|
//#region ../../libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index12.js
|
|
8
|
-
function
|
|
9
|
-
let
|
|
10
|
-
...
|
|
11
|
-
...
|
|
8
|
+
function s({ open: s, onOpenChange: c, mode: l, values: u, errors: d, highlightedFields: f, inProgress: p, submitDisabled: m, onChange: h, onSubmit: g, onCancel: _, labels: v }) {
|
|
9
|
+
let y = {
|
|
10
|
+
...t,
|
|
11
|
+
...v,
|
|
12
12
|
fieldMarkers: {
|
|
13
|
-
...
|
|
14
|
-
...
|
|
13
|
+
...t.fieldMarkers,
|
|
14
|
+
...v?.fieldMarkers
|
|
15
15
|
}
|
|
16
|
-
},
|
|
17
|
-
return /* @__PURE__ */
|
|
18
|
-
open:
|
|
19
|
-
onOpenChange:
|
|
20
|
-
title:
|
|
21
|
-
formError:
|
|
22
|
-
inProgress:
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
]
|
|
46
|
-
}),
|
|
47
|
-
/* @__PURE__ */ m("div", {
|
|
48
|
-
className: "ttw:flex ttw:flex-col ttw:gap-1.5",
|
|
49
|
-
children: [/* @__PURE__ */ p(r, {
|
|
50
|
-
htmlFor: `${D}-holder`,
|
|
51
|
-
children: E.accountHolderNameLabel
|
|
52
|
-
}), /* @__PURE__ */ p(n, {
|
|
53
|
-
id: `${D}-holder`,
|
|
54
|
-
value: v.accountHolderName,
|
|
55
|
-
onChange: (e) => S({ accountHolderName: e.target.value })
|
|
56
|
-
})]
|
|
57
|
-
}),
|
|
58
|
-
/* @__PURE__ */ m("div", {
|
|
59
|
-
className: "ttw:grid ttw:grid-cols-2 ttw:gap-4",
|
|
60
|
-
children: [/* @__PURE__ */ m("div", {
|
|
61
|
-
className: "ttw:flex ttw:flex-col ttw:gap-1.5",
|
|
62
|
-
children: [
|
|
63
|
-
/* @__PURE__ */ p(r, {
|
|
64
|
-
htmlFor: `${D}-account-number`,
|
|
65
|
-
children: E.accountNumberLabel
|
|
66
|
-
}),
|
|
67
|
-
/* @__PURE__ */ p(n, {
|
|
68
|
-
id: `${D}-account-number`,
|
|
69
|
-
value: v.accountNumber,
|
|
70
|
-
"aria-invalid": !!y?.accountNumber,
|
|
71
|
-
onChange: (e) => S({ accountNumber: e.target.value })
|
|
72
|
-
}),
|
|
73
|
-
/* @__PURE__ */ p(u, { message: y?.accountNumber })
|
|
74
|
-
]
|
|
75
|
-
}), /* @__PURE__ */ m("div", {
|
|
76
|
-
className: "ttw:flex ttw:flex-col ttw:gap-1.5",
|
|
77
|
-
children: [
|
|
78
|
-
/* @__PURE__ */ p(r, {
|
|
79
|
-
htmlFor: `${D}-routing`,
|
|
80
|
-
children: E.routingNumberLabel
|
|
81
|
-
}),
|
|
82
|
-
/* @__PURE__ */ p(n, {
|
|
83
|
-
id: `${D}-routing`,
|
|
84
|
-
value: v.routingNumber,
|
|
85
|
-
"aria-invalid": !!y?.routingNumber,
|
|
86
|
-
onChange: (e) => S({ routingNumber: e.target.value })
|
|
87
|
-
}),
|
|
88
|
-
/* @__PURE__ */ p(u, { message: y?.routingNumber })
|
|
89
|
-
]
|
|
90
|
-
})]
|
|
91
|
-
}),
|
|
92
|
-
/* @__PURE__ */ m("div", {
|
|
93
|
-
className: "ttw:grid ttw:grid-cols-2 ttw:gap-4",
|
|
94
|
-
children: [/* @__PURE__ */ m("div", {
|
|
95
|
-
className: "ttw:flex ttw:flex-col ttw:gap-1.5",
|
|
96
|
-
children: [/* @__PURE__ */ p(r, {
|
|
97
|
-
htmlFor: `${D}-iban`,
|
|
98
|
-
children: E.ibanLabel
|
|
99
|
-
}), /* @__PURE__ */ p(n, {
|
|
100
|
-
id: `${D}-iban`,
|
|
101
|
-
value: v.iban,
|
|
102
|
-
onChange: (e) => S({ iban: e.target.value })
|
|
103
|
-
})]
|
|
104
|
-
}), /* @__PURE__ */ m("div", {
|
|
105
|
-
className: "ttw:flex ttw:flex-col ttw:gap-1.5",
|
|
106
|
-
children: [/* @__PURE__ */ p(r, {
|
|
107
|
-
htmlFor: `${D}-bic`,
|
|
108
|
-
children: E.bicLabel
|
|
109
|
-
}), /* @__PURE__ */ p(n, {
|
|
110
|
-
id: `${D}-bic`,
|
|
111
|
-
value: v.bic,
|
|
112
|
-
onChange: (e) => S({ bic: e.target.value })
|
|
113
|
-
})]
|
|
114
|
-
})]
|
|
115
|
-
}),
|
|
116
|
-
/* @__PURE__ */ m("div", {
|
|
117
|
-
className: "ttw:grid ttw:grid-cols-2 ttw:gap-4",
|
|
118
|
-
children: [/* @__PURE__ */ m("div", {
|
|
119
|
-
className: "ttw:flex ttw:flex-col ttw:gap-1.5",
|
|
120
|
-
children: [/* @__PURE__ */ p(r, {
|
|
121
|
-
htmlFor: `${D}-sort-code`,
|
|
122
|
-
children: E.sortCodeLabel
|
|
123
|
-
}), /* @__PURE__ */ p(n, {
|
|
124
|
-
id: `${D}-sort-code`,
|
|
125
|
-
value: v.sortCode,
|
|
126
|
-
onChange: (e) => S({ sortCode: e.target.value })
|
|
127
|
-
})]
|
|
128
|
-
}), /* @__PURE__ */ m("div", {
|
|
129
|
-
className: "ttw:flex ttw:flex-col ttw:gap-1.5",
|
|
130
|
-
children: [
|
|
131
|
-
/* @__PURE__ */ p(r, {
|
|
132
|
-
htmlFor: `${D}-currency`,
|
|
133
|
-
children: E.currencyLabel
|
|
134
|
-
}),
|
|
135
|
-
/* @__PURE__ */ m(i, {
|
|
136
|
-
value: v.currency === "" ? void 0 : v.currency,
|
|
137
|
-
onValueChange: (e) => S({ currency: e }),
|
|
138
|
-
children: [/* @__PURE__ */ p(s, {
|
|
139
|
-
id: `${D}-currency`,
|
|
140
|
-
className: "ttw:w-full",
|
|
141
|
-
"aria-invalid": !!y?.currency,
|
|
142
|
-
children: /* @__PURE__ */ p(c, { placeholder: E.currencyPlaceholder })
|
|
143
|
-
}), /* @__PURE__ */ p(a, { children: b.map((e) => /* @__PURE__ */ p(o, {
|
|
144
|
-
value: e.value,
|
|
145
|
-
children: e.label
|
|
146
|
-
}, e.value)) })]
|
|
147
|
-
}),
|
|
148
|
-
/* @__PURE__ */ p(u, { message: y?.currency })
|
|
149
|
-
]
|
|
150
|
-
})]
|
|
151
|
-
}),
|
|
152
|
-
/* @__PURE__ */ m("div", {
|
|
153
|
-
className: "ttw:flex ttw:flex-col ttw:gap-1.5",
|
|
154
|
-
children: [/* @__PURE__ */ p(r, {
|
|
155
|
-
htmlFor: `${D}-country`,
|
|
156
|
-
children: E.countryLabel
|
|
157
|
-
}), /* @__PURE__ */ p(n, {
|
|
158
|
-
id: `${D}-country`,
|
|
159
|
-
value: E.countryValue,
|
|
160
|
-
disabled: !0,
|
|
161
|
-
readOnly: !0
|
|
162
|
-
})]
|
|
163
|
-
}),
|
|
164
|
-
/* @__PURE__ */ m("div", {
|
|
165
|
-
className: "ttw:flex ttw:items-center ttw:gap-2",
|
|
166
|
-
children: [/* @__PURE__ */ p(e, {
|
|
167
|
-
id: `${D}-default`,
|
|
168
|
-
checked: v.isDefault,
|
|
169
|
-
onCheckedChange: (e) => S({ isDefault: e === !0 })
|
|
170
|
-
}), /* @__PURE__ */ p(r, {
|
|
171
|
-
htmlFor: `${D}-default`,
|
|
172
|
-
children: E.isDefaultLabel
|
|
173
|
-
})]
|
|
174
|
-
})
|
|
175
|
-
]
|
|
16
|
+
}, b = i();
|
|
17
|
+
return /* @__PURE__ */ o(r, {
|
|
18
|
+
open: s,
|
|
19
|
+
onOpenChange: c,
|
|
20
|
+
title: l === "edit" ? y.editTitle : y.createTitle,
|
|
21
|
+
formError: d?.form,
|
|
22
|
+
inProgress: p,
|
|
23
|
+
submitDisabled: m,
|
|
24
|
+
submitLabel: y.saveButton,
|
|
25
|
+
cancelLabel: y.cancelButton,
|
|
26
|
+
onSubmit: g,
|
|
27
|
+
onCancel: _,
|
|
28
|
+
children: [/* @__PURE__ */ a(n, {
|
|
29
|
+
idPrefix: b,
|
|
30
|
+
values: u,
|
|
31
|
+
errors: d,
|
|
32
|
+
highlighted: f,
|
|
33
|
+
onChange: h,
|
|
34
|
+
labels: {
|
|
35
|
+
accountHolderName: y.accountHolderNameLabel,
|
|
36
|
+
routingNumber: y.routingNumberLabel,
|
|
37
|
+
accountNumber: y.accountNumberLabel,
|
|
38
|
+
fieldMarkers: y.fieldMarkers
|
|
39
|
+
}
|
|
40
|
+
}), /* @__PURE__ */ a(e, {
|
|
41
|
+
variant: "body2",
|
|
42
|
+
color: "muted",
|
|
43
|
+
children: y.helperText
|
|
44
|
+
})]
|
|
176
45
|
});
|
|
177
46
|
}
|
|
178
47
|
//#endregion
|
|
179
|
-
export {
|
|
48
|
+
export { s as BankAccountFormSheet, s as default };
|
package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index2.js
CHANGED
|
@@ -75,22 +75,13 @@ var n = {
|
|
|
75
75
|
fieldMarkers: e,
|
|
76
76
|
requiredFieldsLegend: t
|
|
77
77
|
}, o = {
|
|
78
|
-
createTitle: "
|
|
79
|
-
editTitle: "
|
|
80
|
-
nameLabel: "Account name",
|
|
78
|
+
createTitle: "Adding ACH bank transfer",
|
|
79
|
+
editTitle: "Editing ACH bank transfer",
|
|
81
80
|
accountHolderNameLabel: "Account holder name",
|
|
82
81
|
accountNumberLabel: "Account number",
|
|
83
82
|
routingNumberLabel: "Routing number",
|
|
84
|
-
|
|
85
|
-
bicLabel: "BIC / SWIFT",
|
|
86
|
-
sortCodeLabel: "Sort code",
|
|
87
|
-
currencyLabel: "Currency",
|
|
88
|
-
currencyPlaceholder: "Select a currency",
|
|
89
|
-
countryLabel: "Country",
|
|
90
|
-
countryValue: "United States",
|
|
91
|
-
isDefaultLabel: "Set as default for this currency",
|
|
83
|
+
helperText: "Ask your vendor for this — it's usually on their invoice, W-9, or a payment instructions email they send you.",
|
|
92
84
|
cancelButton: "Cancel",
|
|
93
|
-
createButton: "Add",
|
|
94
85
|
saveButton: "Save",
|
|
95
86
|
fieldMarkers: e
|
|
96
87
|
}, s = {
|
package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index5.js
CHANGED
|
@@ -3,13 +3,13 @@ import { ACH_FIELD_GROUP_LABELS_EN as r } from "./index2.js";
|
|
|
3
3
|
import { FieldError as i } from "./index4.js";
|
|
4
4
|
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
5
5
|
//#region ../../libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index5.js
|
|
6
|
-
function s({ idPrefix: s, values: c, errors: l,
|
|
7
|
-
let
|
|
6
|
+
function s({ idPrefix: s, values: c, errors: l, highlighted: u, onChange: d, labels: f }) {
|
|
7
|
+
let p = {
|
|
8
8
|
...r,
|
|
9
|
-
...
|
|
9
|
+
...f,
|
|
10
10
|
fieldMarkers: {
|
|
11
11
|
...r.fieldMarkers,
|
|
12
|
-
...
|
|
12
|
+
...f?.fieldMarkers
|
|
13
13
|
}
|
|
14
14
|
};
|
|
15
15
|
return /* @__PURE__ */ o("div", {
|
|
@@ -20,15 +20,15 @@ function s({ idPrefix: s, values: c, errors: l, onChange: u, labels: d }) {
|
|
|
20
20
|
/* @__PURE__ */ a(n, {
|
|
21
21
|
htmlFor: `${s}-account-holder`,
|
|
22
22
|
requirement: e.Required,
|
|
23
|
-
labels:
|
|
24
|
-
children:
|
|
23
|
+
labels: p.fieldMarkers,
|
|
24
|
+
children: p.accountHolderName
|
|
25
25
|
}),
|
|
26
26
|
/* @__PURE__ */ a(t, {
|
|
27
27
|
id: `${s}-account-holder`,
|
|
28
28
|
value: c.accountHolderName,
|
|
29
29
|
"aria-required": !0,
|
|
30
|
-
"aria-invalid": !!l?.accountHolderName,
|
|
31
|
-
onChange: (e) =>
|
|
30
|
+
"aria-invalid": !!(l?.accountHolderName || u?.accountHolderName),
|
|
31
|
+
onChange: (e) => d({ accountHolderName: e.target.value })
|
|
32
32
|
}),
|
|
33
33
|
/* @__PURE__ */ a(i, { message: l?.accountHolderName })
|
|
34
34
|
]
|
|
@@ -40,15 +40,15 @@ function s({ idPrefix: s, values: c, errors: l, onChange: u, labels: d }) {
|
|
|
40
40
|
/* @__PURE__ */ a(n, {
|
|
41
41
|
htmlFor: `${s}-routing-number`,
|
|
42
42
|
requirement: e.Required,
|
|
43
|
-
labels:
|
|
44
|
-
children:
|
|
43
|
+
labels: p.fieldMarkers,
|
|
44
|
+
children: p.routingNumber
|
|
45
45
|
}),
|
|
46
46
|
/* @__PURE__ */ a(t, {
|
|
47
47
|
id: `${s}-routing-number`,
|
|
48
48
|
value: c.routingNumber,
|
|
49
49
|
"aria-required": !0,
|
|
50
|
-
"aria-invalid": !!l?.routingNumber,
|
|
51
|
-
onChange: (e) =>
|
|
50
|
+
"aria-invalid": !!(l?.routingNumber || u?.routingNumber),
|
|
51
|
+
onChange: (e) => d({ routingNumber: e.target.value })
|
|
52
52
|
}),
|
|
53
53
|
/* @__PURE__ */ a(i, { message: l?.routingNumber })
|
|
54
54
|
]
|
|
@@ -58,15 +58,15 @@ function s({ idPrefix: s, values: c, errors: l, onChange: u, labels: d }) {
|
|
|
58
58
|
/* @__PURE__ */ a(n, {
|
|
59
59
|
htmlFor: `${s}-account-number`,
|
|
60
60
|
requirement: e.Required,
|
|
61
|
-
labels:
|
|
62
|
-
children:
|
|
61
|
+
labels: p.fieldMarkers,
|
|
62
|
+
children: p.accountNumber
|
|
63
63
|
}),
|
|
64
64
|
/* @__PURE__ */ a(t, {
|
|
65
65
|
id: `${s}-account-number`,
|
|
66
66
|
value: c.accountNumber,
|
|
67
67
|
"aria-required": !0,
|
|
68
|
-
"aria-invalid": !!l?.accountNumber,
|
|
69
|
-
onChange: (e) =>
|
|
68
|
+
"aria-invalid": !!(l?.accountNumber || u?.accountNumber),
|
|
69
|
+
onChange: (e) => d({ accountNumber: e.target.value })
|
|
70
70
|
}),
|
|
71
71
|
/* @__PURE__ */ a(i, { message: l?.accountNumber })
|
|
72
72
|
]
|