@tesouro/embedded-components-react 0.5.51 → 0.5.53
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 +42 -1
- package/dist/lib/CounterpartsWidget.d.ts +41 -0
- package/dist/lib/ReceivablesWidget.d.ts +40 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index15.js +6 -9
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index25.js +9 -12
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index46.js +1 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index.js +8 -8
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index101.js +18 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index102.js +91 -88
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index104.js +18 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index106.js +113 -102
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index28.js +5 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index30.js +28 -20
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index31.js +148 -147
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index33.js +15 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index34.js +39 -34
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index39.js +16 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index40.js +203 -174
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index42.js +15 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index43.js +52 -52
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index45.js +22 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index46.js +2 -17
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index48.js +31 -31
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index50.js +97 -96
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index55.js +15 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index56.js +57 -61
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index4.js +189 -188
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index10.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index12.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index13.js +54 -37
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index2.js +23 -16
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index3.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index5.js +54 -41
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index6.js +88 -70
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index9.js +333 -282
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/dist/packages/shared-ui-shadcn/dist/index.js +3757 -3705
- package/package.json +1 -1
package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index9.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { Button as e, Checkbox as t,
|
|
2
|
-
import { COUNTERPART_FORM_SHEET_LABELS_EN as
|
|
3
|
-
import { FieldError as
|
|
4
|
-
import { AchFieldGroup as
|
|
5
|
-
import { AddressFieldGroup as
|
|
6
|
-
import { CounterpartTypeChooser as
|
|
7
|
-
import { FormSheet as
|
|
8
|
-
import { useEffect as
|
|
9
|
-
import { Fragment as
|
|
10
|
-
import { Plus as
|
|
1
|
+
import { Button as e, Checkbox as t, FieldRequirement as n, Input as r, Label as i, RequiredFieldsLegend as a, Separator as o, Typography as s, mergeRequiredFieldsLegendLabels as c } from "../../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
2
|
+
import { COUNTERPART_FORM_SHEET_LABELS_EN as l } from "./index2.js";
|
|
3
|
+
import { FieldError as u } from "./index4.js";
|
|
4
|
+
import { AchFieldGroup as d } from "./index5.js";
|
|
5
|
+
import { AddressFieldGroup as f } from "./index6.js";
|
|
6
|
+
import { CounterpartTypeChooser as p } from "./index7.js";
|
|
7
|
+
import { FormSheet as m } from "./index8.js";
|
|
8
|
+
import { useEffect as h, useId as g, useRef as _ } from "react";
|
|
9
|
+
import { Fragment as v, jsx as y, jsxs as b } from "react/jsx-runtime";
|
|
10
|
+
import { Plus as x } from "lucide-react";
|
|
11
11
|
//#region ../../libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index9.js
|
|
12
|
-
var
|
|
12
|
+
var S = {
|
|
13
13
|
entityType: !0,
|
|
14
14
|
title: !0,
|
|
15
15
|
profileHeading: !0,
|
|
@@ -18,463 +18,514 @@ var y = {
|
|
|
18
18
|
address: !0,
|
|
19
19
|
bankAccount: !0
|
|
20
20
|
};
|
|
21
|
-
function
|
|
21
|
+
function C({ show: e, sectionsToExpand: t }) {
|
|
22
22
|
return {
|
|
23
23
|
isAddressShown: e.address === !0 || e.address === "collapsible",
|
|
24
24
|
isAddressExpanded: e.address === !0 || t?.address === !0
|
|
25
25
|
};
|
|
26
26
|
}
|
|
27
|
-
function
|
|
28
|
-
let t =
|
|
29
|
-
return
|
|
27
|
+
function w(e) {
|
|
28
|
+
let t = _(null), n = _(e);
|
|
29
|
+
return h(() => {
|
|
30
30
|
e !== n.current && (n.current = e, (t.current?.querySelector("[aria-invalid=\"true\"]"))?.focus());
|
|
31
31
|
}, [e]), t;
|
|
32
32
|
}
|
|
33
|
-
function
|
|
33
|
+
function T(e) {
|
|
34
|
+
let t = {
|
|
35
|
+
...l.fieldMarkers,
|
|
36
|
+
...e?.fieldMarkers
|
|
37
|
+
};
|
|
34
38
|
return {
|
|
35
|
-
...
|
|
39
|
+
...l,
|
|
36
40
|
...e,
|
|
41
|
+
fieldMarkers: t,
|
|
37
42
|
address: {
|
|
38
|
-
...
|
|
39
|
-
...e?.address
|
|
43
|
+
...l.address,
|
|
44
|
+
...e?.address,
|
|
45
|
+
fieldMarkers: {
|
|
46
|
+
...t,
|
|
47
|
+
...e?.address?.fieldMarkers
|
|
48
|
+
}
|
|
40
49
|
},
|
|
50
|
+
requiredFieldsLegend: c(t, e?.requiredFieldsLegend),
|
|
41
51
|
ach: {
|
|
42
|
-
...
|
|
52
|
+
...l.ach,
|
|
43
53
|
...e?.accountHolderNameLabel !== void 0 && { accountHolderName: e.accountHolderNameLabel },
|
|
44
54
|
...e?.routingNumberLabel !== void 0 && { routingNumber: e.routingNumberLabel },
|
|
45
55
|
...e?.accountNumberLabel !== void 0 && { accountNumber: e.accountNumberLabel },
|
|
46
|
-
...e?.ach
|
|
56
|
+
...e?.ach,
|
|
57
|
+
fieldMarkers: {
|
|
58
|
+
...t,
|
|
59
|
+
...e?.ach?.fieldMarkers
|
|
60
|
+
}
|
|
47
61
|
}
|
|
48
62
|
};
|
|
49
63
|
}
|
|
50
|
-
function
|
|
51
|
-
let
|
|
52
|
-
...
|
|
53
|
-
...
|
|
54
|
-
},
|
|
55
|
-
show:
|
|
56
|
-
sectionsToExpand:
|
|
57
|
-
}),
|
|
58
|
-
return /* @__PURE__ */
|
|
59
|
-
open:
|
|
60
|
-
onOpenChange:
|
|
61
|
-
title:
|
|
62
|
-
description:
|
|
63
|
-
formError:
|
|
64
|
-
inProgress:
|
|
65
|
-
submitDisabled:
|
|
66
|
-
submitLabel:
|
|
67
|
-
cancelLabel:
|
|
68
|
-
onSubmit:
|
|
69
|
-
onCancel:
|
|
70
|
-
children: /* @__PURE__ */
|
|
71
|
-
ref:
|
|
64
|
+
function E({ open: c, onOpenChange: l, mode: h, counterpartMode: _ = "customer", values: E, errors: D, stateOptions: O, inProgress: k, submitDisabled: A, onChange: j, onAddressChange: M, onBankAccountChange: N, onSubmit: P, onCancel: F, sections: I, sectionsToExpand: L, onAddressExpand: R, labels: z }) {
|
|
65
|
+
let B = T(z), V = {
|
|
66
|
+
...S,
|
|
67
|
+
...I
|
|
68
|
+
}, H = g(), U = E.entityType === "organization", W = _ === "customer", G = _ === "vendor", { isAddressShown: K, isAddressExpanded: q } = C({
|
|
69
|
+
show: V,
|
|
70
|
+
sectionsToExpand: L
|
|
71
|
+
}), J = w(D), Y = h === "edit" ? W ? B.editTitleCustomer : B.editTitleVendor : W ? B.createTitleCustomer : B.createTitleVendor, X = h === "create" ? W ? B.createDescriptionCustomer : B.createDescriptionVendor : void 0, Z = W ? B.customerTypeHeading : B.vendorTypeHeading, Q = W ? B.customerTaxIdHelp : B.vendorTaxIdHelp;
|
|
72
|
+
return /* @__PURE__ */ y(m, {
|
|
73
|
+
open: c,
|
|
74
|
+
onOpenChange: l,
|
|
75
|
+
title: Y,
|
|
76
|
+
description: X,
|
|
77
|
+
formError: D?.form,
|
|
78
|
+
inProgress: k,
|
|
79
|
+
submitDisabled: A,
|
|
80
|
+
submitLabel: h === "edit" ? B.saveButton : B.createButton,
|
|
81
|
+
cancelLabel: B.cancelButton,
|
|
82
|
+
onSubmit: P,
|
|
83
|
+
onCancel: F,
|
|
84
|
+
children: /* @__PURE__ */ b("div", {
|
|
85
|
+
ref: J,
|
|
72
86
|
style: { display: "contents" },
|
|
73
87
|
children: [
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
88
|
+
/* @__PURE__ */ y(a, { labels: B.requiredFieldsLegend }),
|
|
89
|
+
h === "create" && /* @__PURE__ */ y(p, {
|
|
90
|
+
value: E.entityType,
|
|
91
|
+
onChange: (e) => j({ entityType: e }),
|
|
77
92
|
variant: "pills",
|
|
78
93
|
labels: {
|
|
79
|
-
heading:
|
|
80
|
-
organization:
|
|
81
|
-
organizationHint:
|
|
82
|
-
individual:
|
|
83
|
-
individualHint:
|
|
94
|
+
heading: Z,
|
|
95
|
+
organization: B.businessTypeOption,
|
|
96
|
+
organizationHint: B.businessTypeHint,
|
|
97
|
+
individual: B.personTypeOption,
|
|
98
|
+
individualHint: B.personTypeHint
|
|
84
99
|
}
|
|
85
100
|
}),
|
|
86
|
-
|
|
101
|
+
V.profileHeading && /* @__PURE__ */ y(s, {
|
|
87
102
|
variant: "body2",
|
|
88
103
|
className: "ttw:font-semibold",
|
|
89
|
-
children:
|
|
104
|
+
children: B.profileHeading
|
|
90
105
|
}),
|
|
91
|
-
|
|
106
|
+
U ? /* @__PURE__ */ b("div", {
|
|
92
107
|
className: "ttw:flex ttw:flex-col ttw:gap-1.5",
|
|
93
108
|
children: [
|
|
94
|
-
/* @__PURE__ */
|
|
95
|
-
htmlFor: `${
|
|
96
|
-
|
|
109
|
+
/* @__PURE__ */ y(i, {
|
|
110
|
+
htmlFor: `${H}-legal-name`,
|
|
111
|
+
requirement: n.Required,
|
|
112
|
+
labels: B.fieldMarkers,
|
|
113
|
+
children: B.businessNameLabel
|
|
97
114
|
}),
|
|
98
|
-
/* @__PURE__ */
|
|
99
|
-
id: `${
|
|
115
|
+
/* @__PURE__ */ y(r, {
|
|
116
|
+
id: `${H}-legal-name`,
|
|
100
117
|
autoFocus: !0,
|
|
101
|
-
value:
|
|
102
|
-
"aria-
|
|
103
|
-
|
|
118
|
+
value: E.legalName,
|
|
119
|
+
"aria-required": !0,
|
|
120
|
+
"aria-invalid": !!D?.legalName,
|
|
121
|
+
onChange: (e) => j({ legalName: e.target.value })
|
|
104
122
|
}),
|
|
105
|
-
/* @__PURE__ */
|
|
123
|
+
/* @__PURE__ */ y(u, { message: D?.legalName })
|
|
106
124
|
]
|
|
107
|
-
}) : /* @__PURE__ */
|
|
125
|
+
}) : /* @__PURE__ */ b("div", {
|
|
108
126
|
className: "ttw:grid ttw:grid-cols-2 ttw:gap-4",
|
|
109
|
-
children: [/* @__PURE__ */
|
|
127
|
+
children: [/* @__PURE__ */ b("div", {
|
|
110
128
|
className: "ttw:flex ttw:flex-col ttw:gap-1.5",
|
|
111
129
|
children: [
|
|
112
|
-
/* @__PURE__ */
|
|
113
|
-
htmlFor: `${
|
|
114
|
-
|
|
130
|
+
/* @__PURE__ */ y(i, {
|
|
131
|
+
htmlFor: `${H}-first-name`,
|
|
132
|
+
requirement: n.Required,
|
|
133
|
+
labels: B.fieldMarkers,
|
|
134
|
+
children: B.firstNameLabel
|
|
115
135
|
}),
|
|
116
|
-
/* @__PURE__ */
|
|
117
|
-
id: `${
|
|
136
|
+
/* @__PURE__ */ y(r, {
|
|
137
|
+
id: `${H}-first-name`,
|
|
118
138
|
autoFocus: !0,
|
|
119
|
-
value:
|
|
120
|
-
"aria-
|
|
121
|
-
|
|
139
|
+
value: E.firstName,
|
|
140
|
+
"aria-required": !0,
|
|
141
|
+
"aria-invalid": !!D?.firstName,
|
|
142
|
+
onChange: (e) => j({ firstName: e.target.value })
|
|
122
143
|
}),
|
|
123
|
-
/* @__PURE__ */
|
|
144
|
+
/* @__PURE__ */ y(u, { message: D?.firstName })
|
|
124
145
|
]
|
|
125
|
-
}), /* @__PURE__ */
|
|
146
|
+
}), /* @__PURE__ */ b("div", {
|
|
126
147
|
className: "ttw:flex ttw:flex-col ttw:gap-1.5",
|
|
127
148
|
children: [
|
|
128
|
-
/* @__PURE__ */
|
|
129
|
-
htmlFor: `${
|
|
130
|
-
|
|
149
|
+
/* @__PURE__ */ y(i, {
|
|
150
|
+
htmlFor: `${H}-last-name`,
|
|
151
|
+
requirement: n.Required,
|
|
152
|
+
labels: B.fieldMarkers,
|
|
153
|
+
children: B.lastNameLabel
|
|
131
154
|
}),
|
|
132
|
-
/* @__PURE__ */
|
|
133
|
-
id: `${
|
|
134
|
-
value:
|
|
135
|
-
"aria-
|
|
136
|
-
|
|
155
|
+
/* @__PURE__ */ y(r, {
|
|
156
|
+
id: `${H}-last-name`,
|
|
157
|
+
value: E.lastName,
|
|
158
|
+
"aria-required": !0,
|
|
159
|
+
"aria-invalid": !!D?.lastName,
|
|
160
|
+
onChange: (e) => j({ lastName: e.target.value })
|
|
137
161
|
}),
|
|
138
|
-
/* @__PURE__ */
|
|
162
|
+
/* @__PURE__ */ y(u, { message: D?.lastName })
|
|
139
163
|
]
|
|
140
164
|
})]
|
|
141
165
|
}),
|
|
142
|
-
!
|
|
166
|
+
!U && V.title && /* @__PURE__ */ b("div", {
|
|
143
167
|
className: "ttw:flex ttw:flex-col ttw:gap-1.5",
|
|
144
|
-
children: [/* @__PURE__ */
|
|
145
|
-
htmlFor: `${
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
168
|
+
children: [/* @__PURE__ */ y(i, {
|
|
169
|
+
htmlFor: `${H}-title`,
|
|
170
|
+
requirement: n.Optional,
|
|
171
|
+
labels: B.fieldMarkers,
|
|
172
|
+
children: B.titleLabel
|
|
173
|
+
}), /* @__PURE__ */ y(r, {
|
|
174
|
+
id: `${H}-title`,
|
|
175
|
+
value: E.title,
|
|
176
|
+
onChange: (e) => j({ title: e.target.value })
|
|
151
177
|
})]
|
|
152
178
|
}),
|
|
153
|
-
/* @__PURE__ */
|
|
179
|
+
/* @__PURE__ */ b("div", {
|
|
154
180
|
className: "ttw:grid ttw:grid-cols-2 ttw:gap-4",
|
|
155
|
-
children: [/* @__PURE__ */
|
|
181
|
+
children: [/* @__PURE__ */ b("div", {
|
|
156
182
|
className: "ttw:flex ttw:flex-col ttw:gap-1.5",
|
|
157
183
|
children: [
|
|
158
|
-
/* @__PURE__ */
|
|
159
|
-
htmlFor: `${
|
|
160
|
-
|
|
184
|
+
/* @__PURE__ */ y(i, {
|
|
185
|
+
htmlFor: `${H}-email`,
|
|
186
|
+
requirement: n.Required,
|
|
187
|
+
labels: B.fieldMarkers,
|
|
188
|
+
children: B.emailLabel
|
|
161
189
|
}),
|
|
162
|
-
/* @__PURE__ */
|
|
163
|
-
id: `${
|
|
190
|
+
/* @__PURE__ */ y(r, {
|
|
191
|
+
id: `${H}-email`,
|
|
164
192
|
type: "email",
|
|
165
|
-
value:
|
|
166
|
-
"aria-
|
|
167
|
-
|
|
193
|
+
value: E.email,
|
|
194
|
+
"aria-required": !0,
|
|
195
|
+
"aria-invalid": !!D?.email,
|
|
196
|
+
onChange: (e) => j({ email: e.target.value })
|
|
168
197
|
}),
|
|
169
|
-
/* @__PURE__ */
|
|
198
|
+
/* @__PURE__ */ y(u, { message: D?.email })
|
|
170
199
|
]
|
|
171
|
-
}), /* @__PURE__ */
|
|
200
|
+
}), /* @__PURE__ */ b("div", {
|
|
172
201
|
className: "ttw:flex ttw:flex-col ttw:gap-1.5",
|
|
173
|
-
children: [/* @__PURE__ */
|
|
174
|
-
htmlFor: `${
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
202
|
+
children: [/* @__PURE__ */ y(i, {
|
|
203
|
+
htmlFor: `${H}-phone`,
|
|
204
|
+
requirement: n.Optional,
|
|
205
|
+
labels: B.fieldMarkers,
|
|
206
|
+
children: B.phoneLabel
|
|
207
|
+
}), /* @__PURE__ */ y(r, {
|
|
208
|
+
id: `${H}-phone`,
|
|
209
|
+
value: E.phone,
|
|
210
|
+
onChange: (e) => j({ phone: e.target.value })
|
|
180
211
|
})]
|
|
181
212
|
})]
|
|
182
213
|
}),
|
|
183
|
-
|
|
214
|
+
V.taxId && /* @__PURE__ */ b("div", {
|
|
184
215
|
className: "ttw:flex ttw:flex-col ttw:gap-1.5",
|
|
185
216
|
children: [
|
|
186
|
-
/* @__PURE__ */
|
|
187
|
-
htmlFor: `${
|
|
188
|
-
|
|
217
|
+
/* @__PURE__ */ y(i, {
|
|
218
|
+
htmlFor: `${H}-tax-id`,
|
|
219
|
+
requirement: n.Optional,
|
|
220
|
+
labels: B.fieldMarkers,
|
|
221
|
+
children: B.taxIdLabel
|
|
189
222
|
}),
|
|
190
|
-
/* @__PURE__ */
|
|
191
|
-
id: `${
|
|
192
|
-
value:
|
|
193
|
-
onChange: (e) =>
|
|
223
|
+
/* @__PURE__ */ y(r, {
|
|
224
|
+
id: `${H}-tax-id`,
|
|
225
|
+
value: E.taxId,
|
|
226
|
+
onChange: (e) => j({ taxId: e.target.value })
|
|
194
227
|
}),
|
|
195
|
-
/* @__PURE__ */
|
|
228
|
+
/* @__PURE__ */ y(s, {
|
|
196
229
|
variant: "caption",
|
|
197
230
|
className: "ttw:text-muted-foreground",
|
|
198
|
-
children:
|
|
231
|
+
children: Q
|
|
199
232
|
})
|
|
200
233
|
]
|
|
201
234
|
}),
|
|
202
|
-
|
|
203
|
-
htmlFor: `${
|
|
235
|
+
W && /* @__PURE__ */ b(i, {
|
|
236
|
+
htmlFor: `${H}-reminders`,
|
|
204
237
|
className: "ttw:flex ttw:items-start ttw:gap-3 ttw:rounded-md ttw:border ttw:p-3",
|
|
205
|
-
children: [/* @__PURE__ */
|
|
206
|
-
id: `${
|
|
207
|
-
checked:
|
|
208
|
-
onCheckedChange: (e) =>
|
|
209
|
-
}), /* @__PURE__ */
|
|
238
|
+
children: [/* @__PURE__ */ y(t, {
|
|
239
|
+
id: `${H}-reminders`,
|
|
240
|
+
checked: E.remindersEnabled,
|
|
241
|
+
onCheckedChange: (e) => j({ remindersEnabled: e === !0 })
|
|
242
|
+
}), /* @__PURE__ */ b("span", {
|
|
210
243
|
className: "ttw:flex ttw:flex-col ttw:gap-0.5",
|
|
211
|
-
children: [/* @__PURE__ */
|
|
244
|
+
children: [/* @__PURE__ */ y("span", {
|
|
212
245
|
className: "ttw:text-sm ttw:font-medium",
|
|
213
|
-
children:
|
|
214
|
-
}), /* @__PURE__ */
|
|
246
|
+
children: B.paymentRemindersLabel
|
|
247
|
+
}), /* @__PURE__ */ y("span", {
|
|
215
248
|
className: "ttw:text-sm ttw:text-muted-foreground",
|
|
216
|
-
children:
|
|
249
|
+
children: B.paymentRemindersDescription
|
|
217
250
|
})]
|
|
218
251
|
})]
|
|
219
252
|
}),
|
|
220
|
-
|
|
253
|
+
K && /* @__PURE__ */ b(v, { children: [V.addressHeading && /* @__PURE__ */ b(v, { children: [/* @__PURE__ */ y(o, { className: "ttw:my-1" }), /* @__PURE__ */ b("div", {
|
|
221
254
|
className: "ttw:flex ttw:flex-col ttw:gap-1",
|
|
222
|
-
children: [/* @__PURE__ */
|
|
255
|
+
children: [/* @__PURE__ */ y(s, {
|
|
223
256
|
variant: "body2",
|
|
224
257
|
className: "ttw:font-semibold",
|
|
225
|
-
children:
|
|
226
|
-
}),
|
|
258
|
+
children: B.addressHeading
|
|
259
|
+
}), W && /* @__PURE__ */ y(s, {
|
|
227
260
|
variant: "body2",
|
|
228
261
|
className: "ttw:text-muted-foreground",
|
|
229
|
-
children:
|
|
262
|
+
children: B.customerAddressDescription
|
|
230
263
|
})]
|
|
231
|
-
})] }),
|
|
232
|
-
idPrefix: `${
|
|
233
|
-
values:
|
|
234
|
-
errors:
|
|
235
|
-
stateOptions:
|
|
236
|
-
onChange:
|
|
237
|
-
labels:
|
|
238
|
-
}) : /* @__PURE__ */
|
|
264
|
+
})] }), q ? /* @__PURE__ */ y(f, {
|
|
265
|
+
idPrefix: `${H}-address`,
|
|
266
|
+
values: E.address,
|
|
267
|
+
errors: D?.address,
|
|
268
|
+
stateOptions: O,
|
|
269
|
+
onChange: M,
|
|
270
|
+
labels: B.address
|
|
271
|
+
}) : /* @__PURE__ */ b(e, {
|
|
239
272
|
type: "button",
|
|
240
273
|
variant: "link",
|
|
241
274
|
className: "ttw:w-fit ttw:px-0",
|
|
242
|
-
onClick:
|
|
243
|
-
children: [/* @__PURE__ */
|
|
275
|
+
onClick: R,
|
|
276
|
+
children: [/* @__PURE__ */ y(x, { className: "ttw:size-4" }), B.addAddress]
|
|
244
277
|
})] }),
|
|
245
|
-
|
|
246
|
-
/* @__PURE__ */
|
|
247
|
-
/* @__PURE__ */
|
|
278
|
+
G && V.bankAccount && /* @__PURE__ */ b(v, { children: [
|
|
279
|
+
/* @__PURE__ */ y(o, { className: "ttw:my-1" }),
|
|
280
|
+
/* @__PURE__ */ b("div", {
|
|
248
281
|
className: "ttw:flex ttw:flex-col ttw:gap-1",
|
|
249
|
-
children: [/* @__PURE__ */
|
|
282
|
+
children: [/* @__PURE__ */ y(s, {
|
|
250
283
|
variant: "body2",
|
|
251
284
|
className: "ttw:font-semibold",
|
|
252
|
-
children:
|
|
253
|
-
}), /* @__PURE__ */
|
|
285
|
+
children: B.paymentMethodsHeading
|
|
286
|
+
}), /* @__PURE__ */ y(s, {
|
|
254
287
|
variant: "body2",
|
|
255
288
|
className: "ttw:text-muted-foreground",
|
|
256
|
-
children:
|
|
289
|
+
children: B.paymentMethodsDescription
|
|
257
290
|
})]
|
|
258
291
|
}),
|
|
259
|
-
/* @__PURE__ */
|
|
260
|
-
idPrefix: `${
|
|
261
|
-
values:
|
|
262
|
-
errors:
|
|
263
|
-
onChange: (e) =>
|
|
264
|
-
labels:
|
|
292
|
+
/* @__PURE__ */ y(d, {
|
|
293
|
+
idPrefix: `${H}-ach`,
|
|
294
|
+
values: E.bankAccount,
|
|
295
|
+
errors: D?.bankAccount,
|
|
296
|
+
onChange: (e) => N?.(e),
|
|
297
|
+
labels: B.ach
|
|
265
298
|
})
|
|
266
299
|
] })
|
|
267
300
|
]
|
|
268
301
|
})
|
|
269
302
|
});
|
|
270
303
|
}
|
|
271
|
-
function
|
|
272
|
-
let
|
|
273
|
-
...
|
|
274
|
-
...
|
|
275
|
-
},
|
|
276
|
-
show:
|
|
277
|
-
sectionsToExpand:
|
|
278
|
-
}),
|
|
279
|
-
return /* @__PURE__ */
|
|
280
|
-
ref:
|
|
304
|
+
function D({ mode: a, counterpartMode: c = "customer", values: l, errors: m, stateOptions: h, onChange: _, onAddressChange: E, onBankAccountChange: D, sections: O, sectionsToExpand: k, onAddressExpand: A, labels: j }) {
|
|
305
|
+
let M = T(j), N = {
|
|
306
|
+
...S,
|
|
307
|
+
...O
|
|
308
|
+
}, P = g(), F = l.entityType === "organization", I = c === "customer", L = c === "vendor", { isAddressShown: R, isAddressExpanded: z } = C({
|
|
309
|
+
show: N,
|
|
310
|
+
sectionsToExpand: k
|
|
311
|
+
}), B = w(m), V = I ? M.customerTypeHeading : M.vendorTypeHeading, H = I ? M.customerTaxIdHelp : M.vendorTaxIdHelp;
|
|
312
|
+
return /* @__PURE__ */ b("div", {
|
|
313
|
+
ref: B,
|
|
281
314
|
style: { display: "contents" },
|
|
282
315
|
children: [
|
|
283
|
-
|
|
284
|
-
value:
|
|
285
|
-
onChange: (e) =>
|
|
316
|
+
a === "create" && N.entityType && /* @__PURE__ */ y(p, {
|
|
317
|
+
value: l.entityType,
|
|
318
|
+
onChange: (e) => _({ entityType: e }),
|
|
286
319
|
variant: "pills",
|
|
287
320
|
labels: {
|
|
288
|
-
heading:
|
|
289
|
-
organization:
|
|
290
|
-
organizationHint:
|
|
291
|
-
individual:
|
|
292
|
-
individualHint:
|
|
321
|
+
heading: V,
|
|
322
|
+
organization: M.businessTypeOption,
|
|
323
|
+
organizationHint: M.businessTypeHint,
|
|
324
|
+
individual: M.personTypeOption,
|
|
325
|
+
individualHint: M.personTypeHint
|
|
293
326
|
}
|
|
294
327
|
}),
|
|
295
|
-
|
|
328
|
+
N.profileHeading && /* @__PURE__ */ y(s, {
|
|
296
329
|
variant: "body2",
|
|
297
330
|
className: "ttw:font-semibold",
|
|
298
|
-
children:
|
|
331
|
+
children: M.profileHeading
|
|
299
332
|
}),
|
|
300
|
-
|
|
333
|
+
F ? /* @__PURE__ */ b("div", {
|
|
301
334
|
className: "ttw:flex ttw:flex-col ttw:gap-1.5",
|
|
302
335
|
children: [
|
|
303
|
-
/* @__PURE__ */
|
|
304
|
-
htmlFor: `${
|
|
305
|
-
|
|
336
|
+
/* @__PURE__ */ y(i, {
|
|
337
|
+
htmlFor: `${P}-legal-name`,
|
|
338
|
+
requirement: n.Required,
|
|
339
|
+
labels: M.fieldMarkers,
|
|
340
|
+
children: M.businessNameLabel
|
|
306
341
|
}),
|
|
307
|
-
/* @__PURE__ */
|
|
308
|
-
id: `${
|
|
342
|
+
/* @__PURE__ */ y(r, {
|
|
343
|
+
id: `${P}-legal-name`,
|
|
309
344
|
autoFocus: !0,
|
|
310
|
-
value:
|
|
345
|
+
value: l.legalName,
|
|
346
|
+
"aria-required": !0,
|
|
311
347
|
"aria-invalid": !!m?.legalName,
|
|
312
|
-
onChange: (e) =>
|
|
348
|
+
onChange: (e) => _({ legalName: e.target.value })
|
|
313
349
|
}),
|
|
314
|
-
/* @__PURE__ */
|
|
350
|
+
/* @__PURE__ */ y(u, { message: m?.legalName })
|
|
315
351
|
]
|
|
316
|
-
}) : /* @__PURE__ */
|
|
352
|
+
}) : /* @__PURE__ */ b("div", {
|
|
317
353
|
className: "ttw:grid ttw:grid-cols-2 ttw:gap-4",
|
|
318
|
-
children: [/* @__PURE__ */
|
|
354
|
+
children: [/* @__PURE__ */ b("div", {
|
|
319
355
|
className: "ttw:flex ttw:flex-col ttw:gap-1.5",
|
|
320
356
|
children: [
|
|
321
|
-
/* @__PURE__ */
|
|
322
|
-
htmlFor: `${
|
|
323
|
-
|
|
357
|
+
/* @__PURE__ */ y(i, {
|
|
358
|
+
htmlFor: `${P}-first-name`,
|
|
359
|
+
requirement: n.Required,
|
|
360
|
+
labels: M.fieldMarkers,
|
|
361
|
+
children: M.firstNameLabel
|
|
324
362
|
}),
|
|
325
|
-
/* @__PURE__ */
|
|
326
|
-
id: `${
|
|
363
|
+
/* @__PURE__ */ y(r, {
|
|
364
|
+
id: `${P}-first-name`,
|
|
327
365
|
autoFocus: !0,
|
|
328
|
-
value:
|
|
366
|
+
value: l.firstName,
|
|
367
|
+
"aria-required": !0,
|
|
329
368
|
"aria-invalid": !!m?.firstName,
|
|
330
|
-
onChange: (e) =>
|
|
369
|
+
onChange: (e) => _({ firstName: e.target.value })
|
|
331
370
|
}),
|
|
332
|
-
/* @__PURE__ */
|
|
371
|
+
/* @__PURE__ */ y(u, { message: m?.firstName })
|
|
333
372
|
]
|
|
334
|
-
}), /* @__PURE__ */
|
|
373
|
+
}), /* @__PURE__ */ b("div", {
|
|
335
374
|
className: "ttw:flex ttw:flex-col ttw:gap-1.5",
|
|
336
375
|
children: [
|
|
337
|
-
/* @__PURE__ */
|
|
338
|
-
htmlFor: `${
|
|
339
|
-
|
|
376
|
+
/* @__PURE__ */ y(i, {
|
|
377
|
+
htmlFor: `${P}-last-name`,
|
|
378
|
+
requirement: n.Required,
|
|
379
|
+
labels: M.fieldMarkers,
|
|
380
|
+
children: M.lastNameLabel
|
|
340
381
|
}),
|
|
341
|
-
/* @__PURE__ */
|
|
342
|
-
id: `${
|
|
343
|
-
value:
|
|
382
|
+
/* @__PURE__ */ y(r, {
|
|
383
|
+
id: `${P}-last-name`,
|
|
384
|
+
value: l.lastName,
|
|
385
|
+
"aria-required": !0,
|
|
344
386
|
"aria-invalid": !!m?.lastName,
|
|
345
|
-
onChange: (e) =>
|
|
387
|
+
onChange: (e) => _({ lastName: e.target.value })
|
|
346
388
|
}),
|
|
347
|
-
/* @__PURE__ */
|
|
389
|
+
/* @__PURE__ */ y(u, { message: m?.lastName })
|
|
348
390
|
]
|
|
349
391
|
})]
|
|
350
392
|
}),
|
|
351
|
-
!
|
|
393
|
+
!F && N.title && /* @__PURE__ */ b("div", {
|
|
352
394
|
className: "ttw:flex ttw:flex-col ttw:gap-1.5",
|
|
353
|
-
children: [/* @__PURE__ */
|
|
354
|
-
htmlFor: `${
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
395
|
+
children: [/* @__PURE__ */ y(i, {
|
|
396
|
+
htmlFor: `${P}-title`,
|
|
397
|
+
requirement: n.Optional,
|
|
398
|
+
labels: M.fieldMarkers,
|
|
399
|
+
children: M.titleLabel
|
|
400
|
+
}), /* @__PURE__ */ y(r, {
|
|
401
|
+
id: `${P}-title`,
|
|
402
|
+
value: l.title,
|
|
403
|
+
onChange: (e) => _({ title: e.target.value })
|
|
360
404
|
})]
|
|
361
405
|
}),
|
|
362
|
-
/* @__PURE__ */
|
|
406
|
+
/* @__PURE__ */ b("div", {
|
|
363
407
|
className: "ttw:grid ttw:grid-cols-2 ttw:gap-4",
|
|
364
|
-
children: [/* @__PURE__ */
|
|
408
|
+
children: [/* @__PURE__ */ b("div", {
|
|
365
409
|
className: "ttw:flex ttw:flex-col ttw:gap-1.5",
|
|
366
410
|
children: [
|
|
367
|
-
/* @__PURE__ */
|
|
368
|
-
htmlFor: `${
|
|
369
|
-
|
|
411
|
+
/* @__PURE__ */ y(i, {
|
|
412
|
+
htmlFor: `${P}-email`,
|
|
413
|
+
requirement: n.Required,
|
|
414
|
+
labels: M.fieldMarkers,
|
|
415
|
+
children: M.emailLabel
|
|
370
416
|
}),
|
|
371
|
-
/* @__PURE__ */
|
|
372
|
-
id: `${
|
|
417
|
+
/* @__PURE__ */ y(r, {
|
|
418
|
+
id: `${P}-email`,
|
|
373
419
|
type: "email",
|
|
374
|
-
value:
|
|
420
|
+
value: l.email,
|
|
421
|
+
"aria-required": !0,
|
|
375
422
|
"aria-invalid": !!m?.email,
|
|
376
|
-
onChange: (e) =>
|
|
423
|
+
onChange: (e) => _({ email: e.target.value })
|
|
377
424
|
}),
|
|
378
|
-
/* @__PURE__ */
|
|
425
|
+
/* @__PURE__ */ y(u, { message: m?.email })
|
|
379
426
|
]
|
|
380
|
-
}), /* @__PURE__ */
|
|
427
|
+
}), /* @__PURE__ */ b("div", {
|
|
381
428
|
className: "ttw:flex ttw:flex-col ttw:gap-1.5",
|
|
382
|
-
children: [/* @__PURE__ */
|
|
383
|
-
htmlFor: `${
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
429
|
+
children: [/* @__PURE__ */ y(i, {
|
|
430
|
+
htmlFor: `${P}-phone`,
|
|
431
|
+
requirement: n.Optional,
|
|
432
|
+
labels: M.fieldMarkers,
|
|
433
|
+
children: M.phoneLabel
|
|
434
|
+
}), /* @__PURE__ */ y(r, {
|
|
435
|
+
id: `${P}-phone`,
|
|
436
|
+
value: l.phone,
|
|
437
|
+
onChange: (e) => _({ phone: e.target.value })
|
|
389
438
|
})]
|
|
390
439
|
})]
|
|
391
440
|
}),
|
|
392
|
-
|
|
441
|
+
N.taxId && /* @__PURE__ */ b("div", {
|
|
393
442
|
className: "ttw:flex ttw:flex-col ttw:gap-1.5",
|
|
394
443
|
children: [
|
|
395
|
-
/* @__PURE__ */
|
|
396
|
-
htmlFor: `${
|
|
397
|
-
|
|
444
|
+
/* @__PURE__ */ y(i, {
|
|
445
|
+
htmlFor: `${P}-tax-id`,
|
|
446
|
+
requirement: n.Optional,
|
|
447
|
+
labels: M.fieldMarkers,
|
|
448
|
+
children: M.taxIdLabel
|
|
398
449
|
}),
|
|
399
|
-
/* @__PURE__ */
|
|
400
|
-
id: `${
|
|
401
|
-
value:
|
|
402
|
-
onChange: (e) =>
|
|
450
|
+
/* @__PURE__ */ y(r, {
|
|
451
|
+
id: `${P}-tax-id`,
|
|
452
|
+
value: l.taxId,
|
|
453
|
+
onChange: (e) => _({ taxId: e.target.value })
|
|
403
454
|
}),
|
|
404
|
-
/* @__PURE__ */
|
|
455
|
+
/* @__PURE__ */ y(s, {
|
|
405
456
|
variant: "caption",
|
|
406
457
|
className: "ttw:text-muted-foreground",
|
|
407
|
-
children:
|
|
458
|
+
children: H
|
|
408
459
|
})
|
|
409
460
|
]
|
|
410
461
|
}),
|
|
411
|
-
|
|
412
|
-
htmlFor: `${
|
|
462
|
+
I && /* @__PURE__ */ b(i, {
|
|
463
|
+
htmlFor: `${P}-reminders`,
|
|
413
464
|
className: "ttw:flex ttw:items-start ttw:gap-3 ttw:rounded-md ttw:border ttw:p-3",
|
|
414
|
-
children: [/* @__PURE__ */
|
|
415
|
-
id: `${
|
|
416
|
-
checked:
|
|
417
|
-
onCheckedChange: (e) =>
|
|
418
|
-
}), /* @__PURE__ */
|
|
465
|
+
children: [/* @__PURE__ */ y(t, {
|
|
466
|
+
id: `${P}-reminders`,
|
|
467
|
+
checked: l.remindersEnabled,
|
|
468
|
+
onCheckedChange: (e) => _({ remindersEnabled: e === !0 })
|
|
469
|
+
}), /* @__PURE__ */ b("span", {
|
|
419
470
|
className: "ttw:flex ttw:flex-col ttw:gap-0.5",
|
|
420
|
-
children: [/* @__PURE__ */
|
|
471
|
+
children: [/* @__PURE__ */ y("span", {
|
|
421
472
|
className: "ttw:text-sm ttw:font-medium",
|
|
422
|
-
children:
|
|
423
|
-
}), /* @__PURE__ */
|
|
473
|
+
children: M.paymentRemindersLabel
|
|
474
|
+
}), /* @__PURE__ */ y("span", {
|
|
424
475
|
className: "ttw:text-sm ttw:text-muted-foreground",
|
|
425
|
-
children:
|
|
476
|
+
children: M.paymentRemindersDescription
|
|
426
477
|
})]
|
|
427
478
|
})]
|
|
428
479
|
}),
|
|
429
|
-
|
|
480
|
+
R && /* @__PURE__ */ b(v, { children: [N.addressHeading && /* @__PURE__ */ b(v, { children: [/* @__PURE__ */ y(o, { className: "ttw:my-1" }), /* @__PURE__ */ b("div", {
|
|
430
481
|
className: "ttw:flex ttw:flex-col ttw:gap-1",
|
|
431
|
-
children: [/* @__PURE__ */
|
|
482
|
+
children: [/* @__PURE__ */ y(s, {
|
|
432
483
|
variant: "body2",
|
|
433
484
|
className: "ttw:font-semibold",
|
|
434
|
-
children:
|
|
435
|
-
}),
|
|
485
|
+
children: M.addressHeading
|
|
486
|
+
}), I && /* @__PURE__ */ y(s, {
|
|
436
487
|
variant: "body2",
|
|
437
488
|
className: "ttw:text-muted-foreground",
|
|
438
|
-
children:
|
|
489
|
+
children: M.customerAddressDescription
|
|
439
490
|
})]
|
|
440
|
-
})] }),
|
|
441
|
-
idPrefix: `${
|
|
442
|
-
values:
|
|
491
|
+
})] }), z ? /* @__PURE__ */ y(f, {
|
|
492
|
+
idPrefix: `${P}-address`,
|
|
493
|
+
values: l.address,
|
|
443
494
|
errors: m?.address,
|
|
444
|
-
stateOptions:
|
|
445
|
-
onChange:
|
|
446
|
-
labels:
|
|
447
|
-
}) : /* @__PURE__ */
|
|
495
|
+
stateOptions: h,
|
|
496
|
+
onChange: E,
|
|
497
|
+
labels: M.address
|
|
498
|
+
}) : /* @__PURE__ */ b(e, {
|
|
448
499
|
type: "button",
|
|
449
500
|
variant: "link",
|
|
450
501
|
className: "ttw:w-fit ttw:px-0",
|
|
451
|
-
onClick:
|
|
452
|
-
children: [/* @__PURE__ */
|
|
502
|
+
onClick: A,
|
|
503
|
+
children: [/* @__PURE__ */ y(x, { className: "ttw:size-4" }), M.addAddress]
|
|
453
504
|
})] }),
|
|
454
|
-
|
|
455
|
-
/* @__PURE__ */
|
|
456
|
-
/* @__PURE__ */
|
|
505
|
+
L && N.bankAccount && /* @__PURE__ */ b(v, { children: [
|
|
506
|
+
/* @__PURE__ */ y(o, { className: "ttw:my-1" }),
|
|
507
|
+
/* @__PURE__ */ b("div", {
|
|
457
508
|
className: "ttw:flex ttw:flex-col ttw:gap-1",
|
|
458
|
-
children: [/* @__PURE__ */
|
|
509
|
+
children: [/* @__PURE__ */ y(s, {
|
|
459
510
|
variant: "body2",
|
|
460
511
|
className: "ttw:font-semibold",
|
|
461
|
-
children:
|
|
462
|
-
}), /* @__PURE__ */
|
|
512
|
+
children: M.paymentMethodsHeading
|
|
513
|
+
}), /* @__PURE__ */ y(s, {
|
|
463
514
|
variant: "body2",
|
|
464
515
|
className: "ttw:text-muted-foreground",
|
|
465
|
-
children:
|
|
516
|
+
children: M.paymentMethodsDescription
|
|
466
517
|
})]
|
|
467
518
|
}),
|
|
468
|
-
/* @__PURE__ */
|
|
469
|
-
idPrefix: `${
|
|
470
|
-
values:
|
|
519
|
+
/* @__PURE__ */ y(d, {
|
|
520
|
+
idPrefix: `${P}-ach`,
|
|
521
|
+
values: l.bankAccount,
|
|
471
522
|
errors: m?.bankAccount,
|
|
472
|
-
onChange: (e) =>
|
|
473
|
-
labels:
|
|
523
|
+
onChange: (e) => D?.(e),
|
|
524
|
+
labels: M.ach
|
|
474
525
|
})
|
|
475
526
|
] })
|
|
476
527
|
]
|
|
477
528
|
});
|
|
478
529
|
}
|
|
479
530
|
//#endregion
|
|
480
|
-
export {
|
|
531
|
+
export { D as CounterpartFormFields, E as CounterpartFormSheet, E as default, w as useFocusFirstInvalidField };
|