@tesouro/embedded-components-react 0.7.22 → 0.7.24
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 +9 -1
- package/dist/lib/CounterpartsWidget.d.ts +9 -1
- package/dist/lib/CounterpartsWidgetPublic.d.ts +9 -1
- package/dist/lib/CustomersWidget.d.ts +9 -1
- package/dist/lib/ReceivablesWidget.d.ts +9 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index32.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/CounterpartDetailsContainer.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/CounterpartsWidget.js +50 -51
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/viewModels.js +4 -2
- 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 +1 -1
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index4.js +72 -128
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index5.js +183 -38
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index6.js +503 -193
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/ReceivablesWidget.js +57 -55
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/index.js +14 -14
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/helpers.js +114 -102
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index.js +12 -11
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index10.js +534 -7
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index11.js +7 -179
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index12.js +179 -6
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index13.js +3 -1
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index14.js +4 -28
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index15.js +28 -4
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index16.js +4 -0
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index2.js +10 -2
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index7.js +140 -55
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index8.js +53 -47
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index9.js +51 -539
- 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/index7.js +0 -520
|
@@ -1,66 +1,211 @@
|
|
|
1
|
-
import { Button as e,
|
|
2
|
-
import { CounterpartAddressFields as
|
|
3
|
-
import
|
|
1
|
+
import { Button as e, Checkbox as t, Field as n, FieldContent as r, FieldDescription as i, FieldError as a, FieldLabel as o, Input as s, LABEL_LABELS_EN as c, Label as l, RequiredFieldsLegend as u, Spinner as d, Typography as f, cn as p, mergeRequiredFieldsLegendLabels as m } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
2
|
+
import { CounterpartAddressFields as h } from "../../../shared/counterpart-management/ui/dist/index7.js";
|
|
3
|
+
import "../../../shared/counterpart-management/ui/dist/index.js";
|
|
4
|
+
import { addressFieldLabels as g } from "./index4.js";
|
|
5
|
+
import { jsx as _, jsxs as v } from "react/jsx-runtime";
|
|
4
6
|
//#region ../../libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index5.js
|
|
5
|
-
function
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
function y(e) {
|
|
8
|
+
return e ? [{ message: e }] : void 0;
|
|
9
|
+
}
|
|
10
|
+
function b({ form: b, labels: x }) {
|
|
11
|
+
let { name: S, email: C, phone: w, taxId: T, reminders: E, address: D, inProgress: O } = b, k = {
|
|
12
|
+
...x,
|
|
13
|
+
...b.labels
|
|
14
|
+
}, A = {
|
|
15
|
+
...c,
|
|
16
|
+
...b.fieldMarkers
|
|
9
17
|
};
|
|
10
|
-
return /* @__PURE__ */
|
|
18
|
+
return /* @__PURE__ */ v("form", {
|
|
11
19
|
className: "ttw:flex ttw:flex-col ttw:gap-4 ttw:rounded-[10px] ttw:border ttw:border-border ttw:bg-muted ttw:p-4",
|
|
12
20
|
onSubmit: (e) => {
|
|
13
|
-
e.preventDefault(),
|
|
21
|
+
e.preventDefault(), b.onSubmit();
|
|
14
22
|
},
|
|
15
|
-
children: [/* @__PURE__ */
|
|
23
|
+
children: [/* @__PURE__ */ v("div", {
|
|
16
24
|
className: "ttw:flex ttw:flex-col ttw:gap-4",
|
|
17
25
|
children: [
|
|
18
|
-
/* @__PURE__ */
|
|
19
|
-
className: "ttw:flex ttw:
|
|
20
|
-
children: /* @__PURE__ */
|
|
26
|
+
/* @__PURE__ */ _("div", {
|
|
27
|
+
className: "ttw:flex ttw:flex-col ttw:gap-1.5 ttw:border-b ttw:border-border ttw:pt-6 ttw:pb-7",
|
|
28
|
+
children: /* @__PURE__ */ _(f, {
|
|
21
29
|
variant: "body1",
|
|
22
30
|
className: "ttw:font-medium",
|
|
23
|
-
children:
|
|
31
|
+
children: b.heading
|
|
24
32
|
})
|
|
25
33
|
}),
|
|
26
|
-
/* @__PURE__ */
|
|
27
|
-
|
|
34
|
+
/* @__PURE__ */ _(u, { labels: m(A, b.requiredFieldsLegend) }),
|
|
35
|
+
b.formError && /* @__PURE__ */ _(f, {
|
|
28
36
|
variant: "body2",
|
|
29
37
|
color: "destructive",
|
|
30
38
|
role: "alert",
|
|
31
|
-
children:
|
|
39
|
+
children: b.formError
|
|
40
|
+
}),
|
|
41
|
+
S.kind === "person" ? /* @__PURE__ */ v("div", {
|
|
42
|
+
className: "ttw:flex ttw:gap-4",
|
|
43
|
+
children: [/* @__PURE__ */ _(n, { children: /* @__PURE__ */ v(r, { children: [
|
|
44
|
+
/* @__PURE__ */ _(o, {
|
|
45
|
+
htmlFor: "counterpart-edit-first-name",
|
|
46
|
+
requirement: "required",
|
|
47
|
+
labels: A,
|
|
48
|
+
children: k.firstNameLabel
|
|
49
|
+
}),
|
|
50
|
+
/* @__PURE__ */ _(s, {
|
|
51
|
+
id: "counterpart-edit-first-name",
|
|
52
|
+
"aria-required": !0,
|
|
53
|
+
className: "ttw:bg-background",
|
|
54
|
+
value: S.firstName.value,
|
|
55
|
+
disabled: O,
|
|
56
|
+
"aria-invalid": !!S.firstName.error || void 0,
|
|
57
|
+
onChange: (e) => b.onFieldChange("firstName", e.target.value)
|
|
58
|
+
}),
|
|
59
|
+
/* @__PURE__ */ _(a, { errors: y(S.firstName.error) })
|
|
60
|
+
] }) }), /* @__PURE__ */ _(n, { children: /* @__PURE__ */ v(r, { children: [
|
|
61
|
+
/* @__PURE__ */ _(o, {
|
|
62
|
+
htmlFor: "counterpart-edit-last-name",
|
|
63
|
+
requirement: "required",
|
|
64
|
+
labels: A,
|
|
65
|
+
children: k.lastNameLabel
|
|
66
|
+
}),
|
|
67
|
+
/* @__PURE__ */ _(s, {
|
|
68
|
+
id: "counterpart-edit-last-name",
|
|
69
|
+
"aria-required": !0,
|
|
70
|
+
className: "ttw:bg-background",
|
|
71
|
+
value: S.lastName.value,
|
|
72
|
+
disabled: O,
|
|
73
|
+
"aria-invalid": !!S.lastName.error || void 0,
|
|
74
|
+
onChange: (e) => b.onFieldChange("lastName", e.target.value)
|
|
75
|
+
}),
|
|
76
|
+
/* @__PURE__ */ _(a, { errors: y(S.lastName.error) })
|
|
77
|
+
] }) })]
|
|
78
|
+
}) : /* @__PURE__ */ _(n, { children: /* @__PURE__ */ v(r, { children: [
|
|
79
|
+
/* @__PURE__ */ _(o, {
|
|
80
|
+
htmlFor: "counterpart-edit-business-name",
|
|
81
|
+
requirement: "required",
|
|
82
|
+
labels: A,
|
|
83
|
+
children: k.businessNameLabel
|
|
84
|
+
}),
|
|
85
|
+
/* @__PURE__ */ _(s, {
|
|
86
|
+
id: "counterpart-edit-business-name",
|
|
87
|
+
"aria-required": !0,
|
|
88
|
+
className: "ttw:bg-background",
|
|
89
|
+
value: S.businessName.value,
|
|
90
|
+
disabled: O,
|
|
91
|
+
"aria-invalid": !!S.businessName.error || void 0,
|
|
92
|
+
onChange: (e) => b.onFieldChange("businessName", e.target.value)
|
|
93
|
+
}),
|
|
94
|
+
/* @__PURE__ */ _(a, { errors: y(S.businessName.error) })
|
|
95
|
+
] }) }),
|
|
96
|
+
/* @__PURE__ */ v("div", {
|
|
97
|
+
className: p("ttw:flex ttw:gap-4", b.contactLayout === "inline" ? "ttw:flex-row" : "ttw:flex-col"),
|
|
98
|
+
children: [
|
|
99
|
+
/* @__PURE__ */ _(n, { children: /* @__PURE__ */ v(r, { children: [
|
|
100
|
+
/* @__PURE__ */ _(o, {
|
|
101
|
+
htmlFor: "counterpart-edit-email",
|
|
102
|
+
requirement: "required",
|
|
103
|
+
labels: A,
|
|
104
|
+
children: k.rowEmail
|
|
105
|
+
}),
|
|
106
|
+
/* @__PURE__ */ _(s, {
|
|
107
|
+
id: "counterpart-edit-email",
|
|
108
|
+
"aria-required": !0,
|
|
109
|
+
type: "email",
|
|
110
|
+
className: "ttw:bg-background",
|
|
111
|
+
value: C.value,
|
|
112
|
+
disabled: O,
|
|
113
|
+
"aria-invalid": !!C.error || void 0,
|
|
114
|
+
onChange: (e) => b.onFieldChange("email", e.target.value)
|
|
115
|
+
}),
|
|
116
|
+
/* @__PURE__ */ _(a, { errors: y(C.error) })
|
|
117
|
+
] }) }),
|
|
118
|
+
E && /* @__PURE__ */ v(l, {
|
|
119
|
+
htmlFor: "counterpart-edit-reminders",
|
|
120
|
+
className: "ttw:flex ttw:items-start ttw:gap-3 ttw:rounded-md ttw:border ttw:border-border ttw:bg-background ttw:p-3",
|
|
121
|
+
children: [/* @__PURE__ */ _(t, {
|
|
122
|
+
id: "counterpart-edit-reminders",
|
|
123
|
+
checked: E.checked,
|
|
124
|
+
disabled: O,
|
|
125
|
+
onCheckedChange: (e) => b.onRemindersChange(e === !0)
|
|
126
|
+
}), /* @__PURE__ */ v("span", {
|
|
127
|
+
className: "ttw:flex ttw:flex-col ttw:gap-0.5",
|
|
128
|
+
children: [/* @__PURE__ */ _("span", {
|
|
129
|
+
className: "ttw:text-sm ttw:font-medium",
|
|
130
|
+
children: k.remindersCheckboxLabel
|
|
131
|
+
}), /* @__PURE__ */ _("span", {
|
|
132
|
+
className: "ttw:text-sm ttw:text-muted-foreground",
|
|
133
|
+
children: k.remindersCheckboxDescription
|
|
134
|
+
})]
|
|
135
|
+
})]
|
|
136
|
+
}),
|
|
137
|
+
/* @__PURE__ */ _(n, { children: /* @__PURE__ */ v(r, { children: [
|
|
138
|
+
/* @__PURE__ */ _(o, {
|
|
139
|
+
htmlFor: "counterpart-edit-phone",
|
|
140
|
+
requirement: "optional",
|
|
141
|
+
labels: A,
|
|
142
|
+
children: k.rowPhone
|
|
143
|
+
}),
|
|
144
|
+
/* @__PURE__ */ _(s, {
|
|
145
|
+
id: "counterpart-edit-phone",
|
|
146
|
+
type: "tel",
|
|
147
|
+
className: "ttw:bg-background",
|
|
148
|
+
value: w.value,
|
|
149
|
+
disabled: O,
|
|
150
|
+
"aria-invalid": !!w.error || void 0,
|
|
151
|
+
onChange: (e) => b.onFieldChange("phone", e.target.value)
|
|
152
|
+
}),
|
|
153
|
+
/* @__PURE__ */ _(a, { errors: y(w.error) })
|
|
154
|
+
] }) })
|
|
155
|
+
]
|
|
32
156
|
}),
|
|
33
|
-
/* @__PURE__ */
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
157
|
+
/* @__PURE__ */ _(n, { children: /* @__PURE__ */ v(r, { children: [
|
|
158
|
+
/* @__PURE__ */ _(o, {
|
|
159
|
+
htmlFor: "counterpart-edit-tax-id",
|
|
160
|
+
requirement: "optional",
|
|
161
|
+
labels: A,
|
|
162
|
+
children: T.label
|
|
163
|
+
}),
|
|
164
|
+
/* @__PURE__ */ _(s, {
|
|
165
|
+
id: "counterpart-edit-tax-id",
|
|
166
|
+
className: "ttw:bg-background",
|
|
167
|
+
placeholder: T.placeholder,
|
|
168
|
+
value: T.value,
|
|
169
|
+
disabled: O,
|
|
170
|
+
"aria-invalid": !!T.error || void 0,
|
|
171
|
+
onChange: (e) => b.onFieldChange("taxId", e.target.value)
|
|
172
|
+
}),
|
|
173
|
+
/* @__PURE__ */ _(i, { children: T.description }),
|
|
174
|
+
/* @__PURE__ */ _(a, { errors: y(T.error) })
|
|
175
|
+
] }) }),
|
|
176
|
+
D && /* @__PURE__ */ _("div", {
|
|
177
|
+
className: "ttw:flex ttw:flex-col ttw:gap-4",
|
|
178
|
+
children: /* @__PURE__ */ _(h, {
|
|
179
|
+
idPrefix: "counterpart-edit-address",
|
|
180
|
+
values: D.values,
|
|
181
|
+
errors: D.errors,
|
|
182
|
+
stateOptions: b.stateOptions,
|
|
183
|
+
disabled: O,
|
|
184
|
+
onChange: b.onAddressChange,
|
|
185
|
+
labels: g(k, {
|
|
186
|
+
...A,
|
|
187
|
+
...b.addressFieldMarkers
|
|
188
|
+
})
|
|
189
|
+
})
|
|
45
190
|
})
|
|
46
191
|
]
|
|
47
|
-
}), /* @__PURE__ */
|
|
192
|
+
}), /* @__PURE__ */ v("div", {
|
|
48
193
|
className: "ttw:flex ttw:justify-end ttw:gap-4 ttw:pt-6",
|
|
49
|
-
children: [/* @__PURE__ */
|
|
194
|
+
children: [/* @__PURE__ */ _(e, {
|
|
50
195
|
type: "button",
|
|
51
196
|
variant: "outline",
|
|
52
197
|
className: "ttw:w-fit ttw:border-border",
|
|
53
|
-
disabled:
|
|
54
|
-
onClick:
|
|
55
|
-
children:
|
|
56
|
-
}), /* @__PURE__ */
|
|
198
|
+
disabled: O,
|
|
199
|
+
onClick: b.onCancel,
|
|
200
|
+
children: k.cancelButton
|
|
201
|
+
}), /* @__PURE__ */ v(e, {
|
|
57
202
|
type: "submit",
|
|
58
203
|
className: "ttw:w-fit",
|
|
59
|
-
disabled:
|
|
60
|
-
children: [
|
|
204
|
+
disabled: O || b.submitDisabled,
|
|
205
|
+
children: [O && /* @__PURE__ */ _(d, {}), k.saveButton]
|
|
61
206
|
})]
|
|
62
207
|
})]
|
|
63
208
|
});
|
|
64
209
|
}
|
|
65
210
|
//#endregion
|
|
66
|
-
export {
|
|
211
|
+
export { b as CounterpartEditForm };
|