tembro 2.0.5 → 2.0.6
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/components/data-table/data-table-pagination.cjs +1 -1
- package/dist/components/data-table/data-table-pagination.js +4 -4
- package/dist/components/data-table/data-table.cjs +1 -1
- package/dist/components/data-table/data-table.d.ts +2 -2
- package/dist/components/data-table/data-table.js +2 -1
- package/dist/components/display/carousel.cjs +1 -1
- package/dist/components/display/carousel.d.ts +7 -1
- package/dist/components/display/carousel.js +44 -44
- package/dist/components/display/smart-card.d.ts +1 -1
- package/dist/components/display/status-legend.d.ts +1 -1
- package/dist/components/form/form-input.cjs +1 -1
- package/dist/components/form/form-input.d.ts +3 -4
- package/dist/components/form/form-input.js +257 -257
- package/dist/components/form/form-select.cjs +1 -1
- package/dist/components/form/form-select.d.ts +2 -2
- package/dist/components/form/form-select.js +6 -6
- package/dist/components/inputs/async-select.d.ts +3 -0
- package/dist/components/inputs/search-input.d.ts +3 -0
- package/dist/components/inputs/simple-select.cjs +1 -1
- package/dist/components/inputs/simple-select.d.ts +10 -32
- package/dist/components/inputs/simple-select.js +5 -101
- package/dist/components/ui/card/index.cjs +1 -1
- package/dist/components/ui/card/index.d.ts +13 -2
- package/dist/components/ui/card/index.js +74 -49
- package/dist/components/ui/input/index.cjs +1 -1
- package/dist/components/ui/input/index.d.ts +8 -0
- package/dist/components/ui/input/index.js +63 -30
- package/dist/components/ui/select/index.cjs +1 -1
- package/dist/components/ui/select/index.d.ts +33 -1
- package/dist/components/ui/select/index.js +154 -48
- package/dist/showcase/create-demo.cjs +5 -4
- package/dist/showcase/create-demo.js +2 -2
- package/dist/showcase/premium/data-table/showcase.cjs +1 -1
- package/dist/showcase/premium/data-table/showcase.js +1 -1
- package/dist/showcase/premium/data-table-parts/showcase.cjs +1 -1
- package/dist/showcase/premium/data-table-parts/showcase.js +3 -1
- package/dist/showcase/premium/select/mock.cjs +8 -9
- package/dist/showcase/premium/select/mock.js +1 -1
- package/dist/showcase/premium/select/showcase.cjs +1 -1
- package/dist/showcase/premium/select/showcase.js +76 -86
- package/dist/showcase/registry-specific.cjs +1 -1
- package/dist/showcase/registry-specific.js +78 -74
- package/dist/showcase/render-registry-preview.cjs +1 -1
- package/dist/showcase/render-registry-preview.js +91 -87
- package/dist/showcase/tembro-registry.json.cjs +1 -1
- package/dist/showcase/tembro-registry.json.js +1 -1
- package/package.json +1 -1
- package/packages/cli/dist/index.cjs +1 -1
- package/packages/cli/vendor/src/components/data-table/data-table-pagination.tsx +7 -7
- package/packages/cli/vendor/src/components/data-table/data-table.tsx +21 -20
- package/packages/cli/vendor/src/components/display/carousel.tsx +18 -6
- package/packages/cli/vendor/src/components/display/smart-card.tsx +1 -1
- package/packages/cli/vendor/src/components/display/status-legend.tsx +1 -1
- package/packages/cli/vendor/src/components/form/form-input.tsx +9 -12
- package/packages/cli/vendor/src/components/form/form-select.tsx +4 -4
- package/packages/cli/vendor/src/components/inputs/async-select.tsx +11 -8
- package/packages/cli/vendor/src/components/inputs/search-input.tsx +5 -2
- package/packages/cli/vendor/src/components/inputs/simple-select.tsx +20 -190
- package/packages/cli/vendor/src/components/ui/card/index.tsx +95 -25
- package/packages/cli/vendor/src/components/ui/input/index.tsx +98 -0
- package/packages/cli/vendor/src/components/ui/select/index.tsx +227 -34
- package/packages/cli/vendor/src/showcase/create-demo.tsx +16 -15
- package/packages/cli/vendor/src/showcase/premium/data-table/showcase.tsx +3 -3
- package/packages/cli/vendor/src/showcase/premium/data-table-parts/showcase.tsx +3 -3
- package/packages/cli/vendor/src/showcase/premium/select/mock.ts +1 -1
- package/packages/cli/vendor/src/showcase/premium/select/showcase.tsx +13 -21
- package/packages/cli/vendor/src/showcase/registry-specific.tsx +7 -8
- package/packages/cli/vendor/src/showcase/render-registry-preview.tsx +5 -6
- package/packages/cli/vendor/src/showcase/tembro-registry.json +1 -1
- package/registry.json +1 -1
|
@@ -1,19 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { Input as u } from "../ui/input/index.js";
|
|
11
|
-
import { FormFieldShell as d, resolveFormFieldIds as f } from "./form-field-shell.js";
|
|
1
|
+
import { DateInput as e } from "../inputs/date-input.js";
|
|
2
|
+
import { DateRangeInput as t } from "../inputs/date-range-input.js";
|
|
3
|
+
import { MoneyInput as n } from "../inputs/money-input.js";
|
|
4
|
+
import { MaskedInput as r } from "../inputs/masked-input.js";
|
|
5
|
+
import { NumberInput as i } from "../inputs/number-input.js";
|
|
6
|
+
import { PhoneInput as a, formatPhoneDigits as o } from "../inputs/phone-input.js";
|
|
7
|
+
import { QuantityInput as s } from "../inputs/quantity-input.js";
|
|
8
|
+
import { Input as c } from "../ui/input/index.js";
|
|
9
|
+
import { FormFieldShell as l, resolveFormFieldIds as u } from "./form-field-shell.js";
|
|
12
10
|
import "react";
|
|
13
|
-
import { jsx as
|
|
14
|
-
import { Controller as
|
|
11
|
+
import { jsx as d } from "react/jsx-runtime";
|
|
12
|
+
import { Controller as f } from "react-hook-form";
|
|
15
13
|
//#region src/components/form/form-input.tsx
|
|
16
|
-
function
|
|
14
|
+
function p(e) {
|
|
17
15
|
return {
|
|
18
16
|
label: e.label,
|
|
19
17
|
description: e.description,
|
|
@@ -35,305 +33,307 @@ function h(e) {
|
|
|
35
33
|
contentClassName: e.contentClassName
|
|
36
34
|
};
|
|
37
35
|
}
|
|
38
|
-
function
|
|
39
|
-
let
|
|
40
|
-
return /* @__PURE__ */
|
|
41
|
-
control:
|
|
42
|
-
name:
|
|
43
|
-
rules:
|
|
44
|
-
render: ({ field:
|
|
45
|
-
let
|
|
46
|
-
description:
|
|
47
|
-
error:
|
|
36
|
+
function m(m) {
|
|
37
|
+
let h = m.id ?? m.name, g = p(m), _ = m.kind ?? "text", v = m.fieldClassName ?? "w-full";
|
|
38
|
+
return /* @__PURE__ */ d(f, {
|
|
39
|
+
control: m.control,
|
|
40
|
+
name: m.name,
|
|
41
|
+
rules: m.rules,
|
|
42
|
+
render: ({ field: f, fieldState: p }) => {
|
|
43
|
+
let y = p.error?.message, b = u(h, {
|
|
44
|
+
description: m.description,
|
|
45
|
+
error: y
|
|
48
46
|
});
|
|
49
|
-
if (
|
|
50
|
-
let { control: e, name: t, label: n, description: r, required: i, className: a, layout: o, descriptionPosition: s, labelAction:
|
|
51
|
-
return /* @__PURE__ */
|
|
52
|
-
...
|
|
53
|
-
labelId:
|
|
54
|
-
descriptionId:
|
|
55
|
-
errorId:
|
|
56
|
-
error:
|
|
57
|
-
htmlFor: j ??
|
|
58
|
-
children: /* @__PURE__ */
|
|
47
|
+
if (_ === "search") {
|
|
48
|
+
let { control: e, name: t, label: n, description: r, required: i, className: a, layout: o, descriptionPosition: s, labelAction: u, requiredIndicator: _, errorIcon: x, showErrorIcon: S, disabled: C, readOnly: w, labelClassName: T, labelRowClassName: E, descriptionClassName: D, errorClassName: O, contentClassName: k, fieldClassName: A, id: j, kind: M, onValueChange: N, onBlur: P, ...F } = m;
|
|
49
|
+
return /* @__PURE__ */ d(l, {
|
|
50
|
+
...g,
|
|
51
|
+
labelId: b.labelId,
|
|
52
|
+
descriptionId: b.descriptionId,
|
|
53
|
+
errorId: b.errorId,
|
|
54
|
+
error: y,
|
|
55
|
+
htmlFor: j ?? h,
|
|
56
|
+
children: /* @__PURE__ */ d(c, {
|
|
59
57
|
...F,
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
58
|
+
type: "search",
|
|
59
|
+
id: j ?? h,
|
|
60
|
+
name: f.name,
|
|
61
|
+
ref: f.ref,
|
|
62
|
+
value: f.value ?? "",
|
|
64
63
|
disabled: C,
|
|
65
|
-
readOnly:
|
|
66
|
-
inputClassName: A ??
|
|
67
|
-
"aria-invalid":
|
|
68
|
-
"aria-describedby":
|
|
69
|
-
"aria-errormessage":
|
|
64
|
+
readOnly: m.readOnly,
|
|
65
|
+
inputClassName: A ?? v,
|
|
66
|
+
"aria-invalid": p.invalid || void 0,
|
|
67
|
+
"aria-describedby": b.describedBy,
|
|
68
|
+
"aria-errormessage": y ? b.errorId : void 0,
|
|
70
69
|
onBlur: (e) => {
|
|
71
|
-
|
|
70
|
+
f.onBlur(), P?.(e);
|
|
72
71
|
},
|
|
73
72
|
onValueChange: (e) => {
|
|
74
|
-
|
|
73
|
+
f.onChange(e), N?.(e);
|
|
75
74
|
}
|
|
76
75
|
})
|
|
77
76
|
});
|
|
78
77
|
}
|
|
79
|
-
if (
|
|
80
|
-
let { control: e, name: t, label: n, description: r, required: i, className: a, layout: o, descriptionPosition: s, labelAction:
|
|
81
|
-
return /* @__PURE__ */
|
|
82
|
-
...
|
|
83
|
-
labelId:
|
|
84
|
-
descriptionId:
|
|
85
|
-
errorId:
|
|
86
|
-
error:
|
|
87
|
-
htmlFor: j ??
|
|
88
|
-
children: /* @__PURE__ */
|
|
78
|
+
if (_ === "password") {
|
|
79
|
+
let { control: e, name: t, label: n, description: r, required: i, className: a, layout: o, descriptionPosition: s, labelAction: u, requiredIndicator: _, errorIcon: x, showErrorIcon: S, disabled: C, readOnly: w, labelClassName: T, labelRowClassName: E, descriptionClassName: D, errorClassName: O, contentClassName: k, fieldClassName: A, id: j, kind: M, onValueChange: N, onBlur: P, ...F } = m;
|
|
80
|
+
return /* @__PURE__ */ d(l, {
|
|
81
|
+
...g,
|
|
82
|
+
labelId: b.labelId,
|
|
83
|
+
descriptionId: b.descriptionId,
|
|
84
|
+
errorId: b.errorId,
|
|
85
|
+
error: y,
|
|
86
|
+
htmlFor: j ?? h,
|
|
87
|
+
children: /* @__PURE__ */ d(c, {
|
|
89
88
|
...F,
|
|
90
89
|
type: "password",
|
|
91
|
-
id: j ??
|
|
92
|
-
ref:
|
|
93
|
-
name:
|
|
94
|
-
value:
|
|
90
|
+
id: j ?? h,
|
|
91
|
+
ref: f.ref,
|
|
92
|
+
name: f.name,
|
|
93
|
+
value: f.value ?? "",
|
|
95
94
|
disabled: C,
|
|
96
|
-
readOnly:
|
|
97
|
-
inputClassName: A ??
|
|
98
|
-
"aria-describedby":
|
|
99
|
-
"aria-errormessage":
|
|
95
|
+
readOnly: m.readOnly,
|
|
96
|
+
inputClassName: A ?? v,
|
|
97
|
+
"aria-describedby": b.describedBy,
|
|
98
|
+
"aria-errormessage": y ? b.errorId : void 0,
|
|
100
99
|
onBlur: (e) => {
|
|
101
|
-
|
|
100
|
+
f.onBlur(), P?.(e);
|
|
102
101
|
},
|
|
103
102
|
onChange: (e) => {
|
|
104
103
|
let t = e.currentTarget.value;
|
|
105
|
-
|
|
104
|
+
f.onChange(t), N?.(t);
|
|
106
105
|
},
|
|
107
|
-
"aria-invalid":
|
|
106
|
+
"aria-invalid": p.invalid || void 0
|
|
108
107
|
})
|
|
109
108
|
});
|
|
110
109
|
}
|
|
111
|
-
if (
|
|
112
|
-
let { control: e, name: t, label: n, description: r, required:
|
|
113
|
-
return /* @__PURE__ */
|
|
114
|
-
...
|
|
115
|
-
labelId:
|
|
116
|
-
descriptionId:
|
|
117
|
-
errorId:
|
|
118
|
-
error:
|
|
119
|
-
htmlFor: j ??
|
|
120
|
-
children: /* @__PURE__ */
|
|
110
|
+
if (_ === "number") {
|
|
111
|
+
let { control: e, name: t, label: n, description: r, required: a, className: o, layout: s, descriptionPosition: c, labelAction: u, requiredIndicator: _, errorIcon: x, showErrorIcon: S, disabled: C, readOnly: w, labelClassName: T, labelRowClassName: E, descriptionClassName: D, errorClassName: O, contentClassName: k, fieldClassName: A, id: j, kind: M, emptyValue: N = null, onNumberChange: P, onBlur: F, ...I } = m;
|
|
112
|
+
return /* @__PURE__ */ d(l, {
|
|
113
|
+
...g,
|
|
114
|
+
labelId: b.labelId,
|
|
115
|
+
descriptionId: b.descriptionId,
|
|
116
|
+
errorId: b.errorId,
|
|
117
|
+
error: y,
|
|
118
|
+
htmlFor: j ?? h,
|
|
119
|
+
children: /* @__PURE__ */ d(i, {
|
|
121
120
|
...I,
|
|
122
|
-
id: j ??
|
|
123
|
-
name:
|
|
124
|
-
ref:
|
|
125
|
-
value:
|
|
121
|
+
id: j ?? h,
|
|
122
|
+
name: f.name,
|
|
123
|
+
ref: f.ref,
|
|
124
|
+
value: f.value ?? "",
|
|
126
125
|
disabled: C,
|
|
127
|
-
readOnly:
|
|
128
|
-
className: A ??
|
|
129
|
-
"aria-invalid":
|
|
130
|
-
"aria-describedby":
|
|
131
|
-
"aria-errormessage":
|
|
126
|
+
readOnly: m.readOnly,
|
|
127
|
+
className: A ?? v,
|
|
128
|
+
"aria-invalid": p.invalid || void 0,
|
|
129
|
+
"aria-describedby": b.describedBy,
|
|
130
|
+
"aria-errormessage": y ? b.errorId : void 0,
|
|
132
131
|
onBlur: (e) => {
|
|
133
|
-
|
|
132
|
+
f.onBlur(), F?.(e);
|
|
134
133
|
},
|
|
135
134
|
onNumberChange: (e) => {
|
|
136
|
-
|
|
135
|
+
f.onChange(e ?? N), P?.(e);
|
|
137
136
|
}
|
|
138
137
|
})
|
|
139
138
|
});
|
|
140
139
|
}
|
|
141
|
-
if (
|
|
142
|
-
let { control: e, name: t, label: n, description: r, required: i, className:
|
|
143
|
-
return /* @__PURE__ */
|
|
144
|
-
...
|
|
145
|
-
labelId:
|
|
146
|
-
descriptionId:
|
|
147
|
-
errorId:
|
|
148
|
-
error:
|
|
149
|
-
htmlFor: M ??
|
|
150
|
-
children: /* @__PURE__ */
|
|
140
|
+
if (_ === "phone") {
|
|
141
|
+
let { control: e, name: t, label: n, description: r, required: i, className: s, layout: c, descriptionPosition: u, labelAction: _, requiredIndicator: x, errorIcon: S, showErrorIcon: C, disabled: w, readOnly: T, labelClassName: E, labelRowClassName: D, descriptionClassName: O, errorClassName: k, contentClassName: A, fieldClassName: j, id: M, kind: N, valueMode: P = "raw", countryCode: F = "+998", maxDigits: I = 12, onValueChange: L, onBlur: R, ...z } = m, B = f.value == null ? "" : String(f.value), V = P === "raw" ? o(B, F, I) : B;
|
|
142
|
+
return /* @__PURE__ */ d(l, {
|
|
143
|
+
...g,
|
|
144
|
+
labelId: b.labelId,
|
|
145
|
+
descriptionId: b.descriptionId,
|
|
146
|
+
errorId: b.errorId,
|
|
147
|
+
error: y,
|
|
148
|
+
htmlFor: M ?? h,
|
|
149
|
+
children: /* @__PURE__ */ d(a, {
|
|
151
150
|
...z,
|
|
152
|
-
id: M ??
|
|
153
|
-
name:
|
|
154
|
-
ref:
|
|
151
|
+
id: M ?? h,
|
|
152
|
+
name: f.name,
|
|
153
|
+
ref: f.ref,
|
|
155
154
|
value: V,
|
|
156
155
|
disabled: w,
|
|
157
|
-
readOnly:
|
|
156
|
+
readOnly: m.readOnly,
|
|
158
157
|
countryCode: F,
|
|
159
158
|
maxDigits: I,
|
|
160
|
-
className: j ??
|
|
161
|
-
"aria-invalid":
|
|
162
|
-
"aria-describedby":
|
|
163
|
-
"aria-errormessage":
|
|
159
|
+
className: j ?? v,
|
|
160
|
+
"aria-invalid": p.invalid || void 0,
|
|
161
|
+
"aria-describedby": b.describedBy,
|
|
162
|
+
"aria-errormessage": y ? b.errorId : void 0,
|
|
164
163
|
onBlur: (e) => {
|
|
165
|
-
|
|
164
|
+
f.onBlur(), R?.(e);
|
|
166
165
|
},
|
|
167
166
|
onValueChange: (e, t) => {
|
|
168
167
|
let n = P === "raw" ? t : e;
|
|
169
|
-
|
|
168
|
+
f.onChange(n), L?.(n, t, e);
|
|
170
169
|
}
|
|
171
170
|
})
|
|
172
171
|
});
|
|
173
172
|
}
|
|
174
|
-
if (
|
|
175
|
-
let { control:
|
|
176
|
-
return /* @__PURE__ */
|
|
177
|
-
...
|
|
178
|
-
labelId:
|
|
179
|
-
descriptionId:
|
|
180
|
-
errorId:
|
|
181
|
-
error:
|
|
182
|
-
htmlFor: j ??
|
|
183
|
-
children: /* @__PURE__ */
|
|
173
|
+
if (_ === "date") {
|
|
174
|
+
let { control: t, name: n, label: r, description: i, required: a, className: o, layout: s, descriptionPosition: c, labelAction: u, requiredIndicator: _, errorIcon: x, showErrorIcon: S, disabled: C, readOnly: w, labelClassName: T, labelRowClassName: E, descriptionClassName: D, errorClassName: O, contentClassName: k, fieldClassName: A, id: j, kind: M, emptyValue: N = "", onValueChange: P, onBlur: F, ...I } = m;
|
|
175
|
+
return /* @__PURE__ */ d(l, {
|
|
176
|
+
...g,
|
|
177
|
+
labelId: b.labelId,
|
|
178
|
+
descriptionId: b.descriptionId,
|
|
179
|
+
errorId: b.errorId,
|
|
180
|
+
error: y,
|
|
181
|
+
htmlFor: j ?? h,
|
|
182
|
+
children: /* @__PURE__ */ d(e, {
|
|
184
183
|
...I,
|
|
185
|
-
id: j ??
|
|
186
|
-
name:
|
|
187
|
-
ref:
|
|
188
|
-
value:
|
|
184
|
+
id: j ?? h,
|
|
185
|
+
name: f.name,
|
|
186
|
+
ref: f.ref,
|
|
187
|
+
value: f.value ?? "",
|
|
189
188
|
disabled: C,
|
|
190
|
-
readOnly:
|
|
191
|
-
className: A ??
|
|
192
|
-
"aria-invalid":
|
|
193
|
-
"aria-describedby":
|
|
194
|
-
"aria-errormessage":
|
|
189
|
+
readOnly: m.readOnly,
|
|
190
|
+
className: A ?? v,
|
|
191
|
+
"aria-invalid": p.invalid || void 0,
|
|
192
|
+
"aria-describedby": b.describedBy,
|
|
193
|
+
"aria-errormessage": y ? b.errorId : void 0,
|
|
195
194
|
onBlur: (e) => {
|
|
196
|
-
|
|
195
|
+
f.onBlur(), F?.(e);
|
|
197
196
|
},
|
|
198
197
|
onValueChange: (e) => {
|
|
199
|
-
|
|
198
|
+
f.onChange(e || N), P?.(e);
|
|
200
199
|
}
|
|
201
200
|
})
|
|
202
201
|
});
|
|
203
202
|
}
|
|
204
|
-
if (
|
|
205
|
-
let { control:
|
|
206
|
-
return /* @__PURE__ */
|
|
207
|
-
...
|
|
208
|
-
labelId:
|
|
209
|
-
descriptionId:
|
|
210
|
-
errorId:
|
|
211
|
-
error:
|
|
212
|
-
htmlFor: j ??
|
|
213
|
-
children: /* @__PURE__ */
|
|
203
|
+
if (_ === "clearable") {
|
|
204
|
+
let { control: e, name: t, label: n, description: r, required: i, className: a, layout: o, descriptionPosition: s, labelAction: u, requiredIndicator: _, errorIcon: x, showErrorIcon: S, disabled: C, readOnly: w, labelClassName: T, labelRowClassName: E, descriptionClassName: D, errorClassName: O, contentClassName: k, fieldClassName: A, id: j, kind: M, emptyValue: N = "", onValueChange: P, onBlur: F, ...I } = m;
|
|
205
|
+
return /* @__PURE__ */ d(l, {
|
|
206
|
+
...g,
|
|
207
|
+
labelId: b.labelId,
|
|
208
|
+
descriptionId: b.descriptionId,
|
|
209
|
+
errorId: b.errorId,
|
|
210
|
+
error: y,
|
|
211
|
+
htmlFor: j ?? h,
|
|
212
|
+
children: /* @__PURE__ */ d(c, {
|
|
214
213
|
...I,
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
214
|
+
clearable: !0,
|
|
215
|
+
id: j ?? h,
|
|
216
|
+
name: f.name,
|
|
217
|
+
ref: f.ref,
|
|
218
|
+
value: f.value ?? "",
|
|
219
219
|
disabled: C,
|
|
220
|
-
readOnly:
|
|
221
|
-
className: A ??
|
|
222
|
-
"aria-invalid":
|
|
223
|
-
"aria-describedby":
|
|
224
|
-
"aria-errormessage":
|
|
220
|
+
readOnly: m.readOnly,
|
|
221
|
+
className: A ?? v,
|
|
222
|
+
"aria-invalid": p.invalid || void 0,
|
|
223
|
+
"aria-describedby": b.describedBy,
|
|
224
|
+
"aria-errormessage": y ? b.errorId : void 0,
|
|
225
225
|
onBlur: (e) => {
|
|
226
|
-
|
|
226
|
+
f.onBlur(), F?.(e);
|
|
227
227
|
},
|
|
228
228
|
onValueChange: (e) => {
|
|
229
|
-
|
|
229
|
+
f.onChange(e || N), P?.(e);
|
|
230
230
|
}
|
|
231
231
|
})
|
|
232
232
|
});
|
|
233
233
|
}
|
|
234
|
-
if (
|
|
235
|
-
let { control: e, name: t, label: n, description:
|
|
236
|
-
return /* @__PURE__ */
|
|
237
|
-
...
|
|
238
|
-
labelId:
|
|
239
|
-
descriptionId:
|
|
240
|
-
errorId:
|
|
241
|
-
error:
|
|
242
|
-
htmlFor: j ??
|
|
243
|
-
children: /* @__PURE__ */
|
|
234
|
+
if (_ === "masked") {
|
|
235
|
+
let { control: e, name: t, label: n, description: i, required: a, className: o, layout: s, descriptionPosition: c, labelAction: u, requiredIndicator: _, errorIcon: x, showErrorIcon: S, disabled: C, readOnly: w, labelClassName: T, labelRowClassName: E, descriptionClassName: D, errorClassName: O, contentClassName: k, fieldClassName: A, id: j, kind: M, valueMode: N = "raw", onValueChange: P, onBlur: F, ...I } = m;
|
|
236
|
+
return /* @__PURE__ */ d(l, {
|
|
237
|
+
...g,
|
|
238
|
+
labelId: b.labelId,
|
|
239
|
+
descriptionId: b.descriptionId,
|
|
240
|
+
errorId: b.errorId,
|
|
241
|
+
error: y,
|
|
242
|
+
htmlFor: j ?? h,
|
|
243
|
+
children: /* @__PURE__ */ d(r, {
|
|
244
244
|
...I,
|
|
245
|
-
id: j ??
|
|
246
|
-
name:
|
|
247
|
-
ref:
|
|
248
|
-
value: String(
|
|
245
|
+
id: j ?? h,
|
|
246
|
+
name: f.name,
|
|
247
|
+
ref: f.ref,
|
|
248
|
+
value: String(f.value ?? ""),
|
|
249
249
|
disabled: C,
|
|
250
|
-
readOnly:
|
|
251
|
-
className: A ??
|
|
252
|
-
"aria-invalid":
|
|
253
|
-
"aria-describedby":
|
|
254
|
-
"aria-errormessage":
|
|
250
|
+
readOnly: m.readOnly,
|
|
251
|
+
className: A ?? v,
|
|
252
|
+
"aria-invalid": p.invalid || void 0,
|
|
253
|
+
"aria-describedby": b.describedBy,
|
|
254
|
+
"aria-errormessage": y ? b.errorId : void 0,
|
|
255
255
|
onBlur: (e) => {
|
|
256
|
-
|
|
256
|
+
f.onBlur(), F?.(e);
|
|
257
257
|
},
|
|
258
258
|
onValueChange: (e, t) => {
|
|
259
259
|
let n = N === "raw" ? t : e;
|
|
260
|
-
|
|
260
|
+
f.onChange(n), P?.(e, t);
|
|
261
261
|
}
|
|
262
262
|
})
|
|
263
263
|
});
|
|
264
264
|
}
|
|
265
|
-
if (
|
|
266
|
-
let { control: e, name: t, label:
|
|
267
|
-
return /* @__PURE__ */
|
|
268
|
-
...
|
|
269
|
-
labelId:
|
|
270
|
-
descriptionId:
|
|
271
|
-
errorId:
|
|
272
|
-
error:
|
|
273
|
-
htmlFor: j ??
|
|
274
|
-
children: /* @__PURE__ */
|
|
265
|
+
if (_ === "money") {
|
|
266
|
+
let { control: e, name: t, label: r, description: i, required: a, className: o, layout: s, descriptionPosition: c, labelAction: u, requiredIndicator: _, errorIcon: x, showErrorIcon: S, disabled: C, readOnly: w, labelClassName: T, labelRowClassName: E, descriptionClassName: D, errorClassName: O, contentClassName: k, fieldClassName: A, id: j, kind: M, emptyValue: N = null, onValueChange: P, onBlur: F, ...I } = m;
|
|
267
|
+
return /* @__PURE__ */ d(l, {
|
|
268
|
+
...g,
|
|
269
|
+
labelId: b.labelId,
|
|
270
|
+
descriptionId: b.descriptionId,
|
|
271
|
+
errorId: b.errorId,
|
|
272
|
+
error: y,
|
|
273
|
+
htmlFor: j ?? h,
|
|
274
|
+
children: /* @__PURE__ */ d(n, {
|
|
275
275
|
...I,
|
|
276
|
-
id: j ??
|
|
277
|
-
name:
|
|
278
|
-
ref:
|
|
279
|
-
value:
|
|
276
|
+
id: j ?? h,
|
|
277
|
+
name: f.name,
|
|
278
|
+
ref: f.ref,
|
|
279
|
+
value: f.value ?? null,
|
|
280
280
|
disabled: C,
|
|
281
|
-
readOnly:
|
|
282
|
-
className: A ??
|
|
283
|
-
"aria-invalid":
|
|
284
|
-
"aria-describedby":
|
|
285
|
-
"aria-errormessage":
|
|
281
|
+
readOnly: m.readOnly,
|
|
282
|
+
className: A ?? v,
|
|
283
|
+
"aria-invalid": p.invalid || void 0,
|
|
284
|
+
"aria-describedby": b.describedBy,
|
|
285
|
+
"aria-errormessage": y ? b.errorId : void 0,
|
|
286
286
|
onBlur: (e) => {
|
|
287
|
-
|
|
287
|
+
f.onBlur(), F?.(e);
|
|
288
288
|
},
|
|
289
289
|
onValueChange: (e, t) => {
|
|
290
|
-
|
|
290
|
+
f.onChange(e ?? N), P?.(e, t);
|
|
291
291
|
}
|
|
292
292
|
})
|
|
293
293
|
});
|
|
294
294
|
}
|
|
295
|
-
if (
|
|
296
|
-
let { control: e, name: t, label: n, description: r, required: i, className: a, layout: o, descriptionPosition:
|
|
297
|
-
return /* @__PURE__ */
|
|
298
|
-
...
|
|
299
|
-
labelId:
|
|
300
|
-
descriptionId:
|
|
301
|
-
errorId:
|
|
302
|
-
error:
|
|
303
|
-
htmlFor: j ??
|
|
304
|
-
children: /* @__PURE__ */
|
|
295
|
+
if (_ === "quantity") {
|
|
296
|
+
let { control: e, name: t, label: n, description: r, required: i, className: a, layout: o, descriptionPosition: c, labelAction: u, requiredIndicator: _, errorIcon: x, showErrorIcon: S, disabled: C, readOnly: w, labelClassName: T, labelRowClassName: E, descriptionClassName: D, errorClassName: O, contentClassName: k, fieldClassName: A, id: j, kind: M, emptyValue: N = null, onValueChange: P, onBlur: F, ...I } = m;
|
|
297
|
+
return /* @__PURE__ */ d(l, {
|
|
298
|
+
...g,
|
|
299
|
+
labelId: b.labelId,
|
|
300
|
+
descriptionId: b.descriptionId,
|
|
301
|
+
errorId: b.errorId,
|
|
302
|
+
error: y,
|
|
303
|
+
htmlFor: j ?? h,
|
|
304
|
+
children: /* @__PURE__ */ d(s, {
|
|
305
305
|
...I,
|
|
306
|
-
id: j ??
|
|
307
|
-
name:
|
|
308
|
-
ref:
|
|
309
|
-
value:
|
|
306
|
+
id: j ?? h,
|
|
307
|
+
name: f.name,
|
|
308
|
+
ref: f.ref,
|
|
309
|
+
value: f.value,
|
|
310
310
|
disabled: C,
|
|
311
|
-
readOnly:
|
|
312
|
-
className: A ??
|
|
313
|
-
"aria-invalid":
|
|
314
|
-
"aria-describedby":
|
|
315
|
-
"aria-errormessage":
|
|
311
|
+
readOnly: m.readOnly,
|
|
312
|
+
className: A ?? v,
|
|
313
|
+
"aria-invalid": p.invalid || void 0,
|
|
314
|
+
"aria-describedby": b.describedBy,
|
|
315
|
+
"aria-errormessage": y ? b.errorId : void 0,
|
|
316
316
|
onBlur: (e) => {
|
|
317
|
-
|
|
317
|
+
f.onBlur(), F?.(e);
|
|
318
318
|
},
|
|
319
319
|
onValueChange: (e) => {
|
|
320
|
-
|
|
320
|
+
f.onChange(e ?? N), P?.(e);
|
|
321
321
|
}
|
|
322
322
|
})
|
|
323
323
|
});
|
|
324
324
|
}
|
|
325
|
-
if (
|
|
326
|
-
let { control: e, name:
|
|
327
|
-
return /* @__PURE__ */
|
|
328
|
-
...
|
|
329
|
-
labelId:
|
|
330
|
-
descriptionId:
|
|
331
|
-
errorId:
|
|
332
|
-
error:
|
|
333
|
-
htmlFor: k ??
|
|
334
|
-
children: /* @__PURE__ */
|
|
325
|
+
if (_ === "date-range") {
|
|
326
|
+
let { control: e, name: n, label: r, description: i, required: a, className: o, layout: s, descriptionPosition: c, labelAction: u, requiredIndicator: _, errorIcon: v, showErrorIcon: x, disabled: S, labelClassName: C, labelRowClassName: w, descriptionClassName: T, errorClassName: E, contentClassName: D, fieldClassName: O, id: k, kind: A, onValueChange: j, onBlur: M, ...N } = m, P = f.value;
|
|
327
|
+
return /* @__PURE__ */ d(l, {
|
|
328
|
+
...g,
|
|
329
|
+
labelId: b.labelId,
|
|
330
|
+
descriptionId: b.descriptionId,
|
|
331
|
+
errorId: b.errorId,
|
|
332
|
+
error: y,
|
|
333
|
+
htmlFor: k ?? h,
|
|
334
|
+
children: /* @__PURE__ */ d(t, {
|
|
335
335
|
...N,
|
|
336
|
-
id: k ??
|
|
336
|
+
id: k ?? h,
|
|
337
337
|
value: P && typeof P == "object" ? {
|
|
338
338
|
from: P.from,
|
|
339
339
|
to: P.to
|
|
@@ -343,58 +343,58 @@ function g(g) {
|
|
|
343
343
|
},
|
|
344
344
|
fromInputProps: {
|
|
345
345
|
...N.fromInputProps ?? {},
|
|
346
|
-
disabled:
|
|
347
|
-
readOnly:
|
|
348
|
-
"aria-describedby":
|
|
349
|
-
"aria-errormessage":
|
|
346
|
+
disabled: S,
|
|
347
|
+
readOnly: m.readOnly,
|
|
348
|
+
"aria-describedby": b.describedBy,
|
|
349
|
+
"aria-errormessage": y ? b.errorId : void 0
|
|
350
350
|
},
|
|
351
351
|
toInputProps: {
|
|
352
352
|
...N.toInputProps ?? {},
|
|
353
|
-
disabled:
|
|
354
|
-
readOnly:
|
|
355
|
-
"aria-describedby":
|
|
356
|
-
"aria-errormessage":
|
|
353
|
+
disabled: S,
|
|
354
|
+
readOnly: m.readOnly,
|
|
355
|
+
"aria-describedby": b.describedBy,
|
|
356
|
+
"aria-errormessage": y ? b.errorId : void 0
|
|
357
357
|
},
|
|
358
358
|
onValueChange: (e) => {
|
|
359
|
-
|
|
359
|
+
f.onChange(e), j?.(e);
|
|
360
360
|
},
|
|
361
|
-
"aria-invalid":
|
|
361
|
+
"aria-invalid": p.invalid || void 0,
|
|
362
362
|
onBlur: (e) => {
|
|
363
|
-
|
|
363
|
+
f.onBlur(), M?.(e);
|
|
364
364
|
}
|
|
365
365
|
})
|
|
366
366
|
});
|
|
367
367
|
}
|
|
368
|
-
let { control:
|
|
369
|
-
return /* @__PURE__ */
|
|
370
|
-
...
|
|
371
|
-
labelId:
|
|
372
|
-
descriptionId:
|
|
373
|
-
errorId:
|
|
374
|
-
error:
|
|
375
|
-
htmlFor:
|
|
376
|
-
children: /* @__PURE__ */
|
|
377
|
-
...
|
|
378
|
-
id:
|
|
379
|
-
ref:
|
|
380
|
-
name:
|
|
381
|
-
value:
|
|
382
|
-
disabled:
|
|
383
|
-
readOnly:
|
|
368
|
+
let { control: x, name: S, label: C, description: w, required: T, className: E, layout: D, descriptionPosition: O, labelAction: k, requiredIndicator: A, errorIcon: j, showErrorIcon: M, disabled: N, readOnly: P, labelClassName: F, labelRowClassName: I, descriptionClassName: L, errorClassName: R, contentClassName: z, fieldClassName: B, transformIn: V, transformOut: H, id: U, kind: W, onChange: G, onBlur: K, ...q } = m;
|
|
369
|
+
return /* @__PURE__ */ d(l, {
|
|
370
|
+
...g,
|
|
371
|
+
labelId: b.labelId,
|
|
372
|
+
descriptionId: b.descriptionId,
|
|
373
|
+
errorId: b.errorId,
|
|
374
|
+
error: y,
|
|
375
|
+
htmlFor: U ?? h,
|
|
376
|
+
children: /* @__PURE__ */ d(c, {
|
|
377
|
+
...q,
|
|
378
|
+
id: U ?? h,
|
|
379
|
+
ref: f.ref,
|
|
380
|
+
name: f.name,
|
|
381
|
+
value: V ? V(f.value) : f.value ?? "",
|
|
382
|
+
disabled: N,
|
|
383
|
+
readOnly: P,
|
|
384
384
|
onBlur: (e) => {
|
|
385
|
-
|
|
385
|
+
f.onBlur(), K?.(e);
|
|
386
386
|
},
|
|
387
387
|
onChange: (e) => {
|
|
388
|
-
|
|
388
|
+
f.onChange(H ? H(e) : e.target.value), G?.(e);
|
|
389
389
|
},
|
|
390
|
-
"aria-invalid":
|
|
391
|
-
"aria-describedby":
|
|
392
|
-
"aria-errormessage":
|
|
393
|
-
className:
|
|
390
|
+
"aria-invalid": p.invalid || void 0,
|
|
391
|
+
"aria-describedby": b.describedBy,
|
|
392
|
+
"aria-errormessage": y ? b.errorId : void 0,
|
|
393
|
+
className: B ?? v
|
|
394
394
|
})
|
|
395
395
|
});
|
|
396
396
|
}
|
|
397
397
|
});
|
|
398
398
|
}
|
|
399
399
|
//#endregion
|
|
400
|
-
export {
|
|
400
|
+
export { m as FormInput };
|