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