@btst/components 0.0.0-stage → 1.0.0
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/LICENSE.md +17 -0
- package/dist/_private/ui/styles/markdown-editor.css +31 -0
- package/dist/auto-form/index.cjs +8 -0
- package/dist/auto-form/index.d.cts +26 -0
- package/dist/auto-form/index.d.mts +26 -0
- package/dist/auto-form/index.d.ts +26 -0
- package/dist/auto-form/index.mjs +1 -0
- package/dist/empty/index.cjs +12 -0
- package/dist/empty/index.d.cts +15 -0
- package/dist/empty/index.d.mts +15 -0
- package/dist/empty/index.d.ts +15 -0
- package/dist/empty/index.mjs +1 -0
- package/dist/form-builder/index.cjs +16 -0
- package/dist/form-builder/index.d.cts +395 -0
- package/dist/form-builder/index.d.mts +395 -0
- package/dist/form-builder/index.d.ts +395 -0
- package/dist/form-builder/index.mjs +4 -0
- package/dist/markdown/index.cjs +9 -0
- package/dist/markdown/index.d.cts +46 -0
- package/dist/markdown/index.d.mts +46 -0
- package/dist/markdown/index.d.ts +46 -0
- package/dist/markdown/index.mjs +2 -0
- package/dist/multi-select/index.cjs +7 -0
- package/dist/multi-select/index.d.cts +78 -0
- package/dist/multi-select/index.d.mts +78 -0
- package/dist/multi-select/index.d.ts +78 -0
- package/dist/multi-select/index.mjs +1 -0
- package/dist/search-select/index.cjs +7 -0
- package/dist/search-select/index.d.cts +16 -0
- package/dist/search-select/index.d.mts +16 -0
- package/dist/search-select/index.d.ts +16 -0
- package/dist/search-select/index.mjs +1 -0
- package/dist/shared/components.BdvBiegH.d.cts +291 -0
- package/dist/shared/components.BdvBiegH.d.mts +291 -0
- package/dist/shared/components.BdvBiegH.d.ts +291 -0
- package/dist/shared/components.CZMWR72v.d.cts +10 -0
- package/dist/shared/components.CZMWR72v.d.mts +10 -0
- package/dist/shared/components.CZMWR72v.d.ts +10 -0
- package/dist/stepped-auto-form/index.cjs +7 -0
- package/dist/stepped-auto-form/index.d.cts +37 -0
- package/dist/stepped-auto-form/index.d.mts +37 -0
- package/dist/stepped-auto-form/index.d.ts +37 -0
- package/dist/stepped-auto-form/index.mjs +1 -0
- package/dist/style.css +440 -0
- package/dist/ui/src/components/accordion.cjs +81 -0
- package/dist/ui/src/components/accordion.mjs +62 -0
- package/dist/ui/src/components/auto-form/common/label.cjs +18 -0
- package/dist/ui/src/components/auto-form/common/label.mjs +16 -0
- package/dist/ui/src/components/auto-form/common/tooltip.cjs +9 -0
- package/dist/ui/src/components/auto-form/common/tooltip.mjs +7 -0
- package/dist/ui/src/components/auto-form/config.cjs +40 -0
- package/dist/ui/src/components/auto-form/config.mjs +37 -0
- package/dist/ui/src/components/auto-form/dependencies.cjs +48 -0
- package/dist/ui/src/components/auto-form/dependencies.mjs +46 -0
- package/dist/ui/src/components/auto-form/fields/array.cjs +266 -0
- package/dist/ui/src/components/auto-form/fields/array.mjs +264 -0
- package/dist/ui/src/components/auto-form/fields/checkbox.cjs +38 -0
- package/dist/ui/src/components/auto-form/fields/checkbox.mjs +36 -0
- package/dist/ui/src/components/auto-form/fields/date.cjs +67 -0
- package/dist/ui/src/components/auto-form/fields/date.mjs +65 -0
- package/dist/ui/src/components/auto-form/fields/enum.cjs +73 -0
- package/dist/ui/src/components/auto-form/fields/enum.mjs +71 -0
- package/dist/ui/src/components/auto-form/fields/input.cjs +32 -0
- package/dist/ui/src/components/auto-form/fields/input.mjs +30 -0
- package/dist/ui/src/components/auto-form/fields/number.cjs +31 -0
- package/dist/ui/src/components/auto-form/fields/number.mjs +29 -0
- package/dist/ui/src/components/auto-form/fields/object.cjs +233 -0
- package/dist/ui/src/components/auto-form/fields/object.mjs +217 -0
- package/dist/ui/src/components/auto-form/fields/radio-group.cjs +67 -0
- package/dist/ui/src/components/auto-form/fields/radio-group.mjs +65 -0
- package/dist/ui/src/components/auto-form/fields/switch.cjs +38 -0
- package/dist/ui/src/components/auto-form/fields/switch.mjs +36 -0
- package/dist/ui/src/components/auto-form/fields/textarea.cjs +31 -0
- package/dist/ui/src/components/auto-form/fields/textarea.mjs +29 -0
- package/dist/ui/src/components/auto-form/helpers.cjs +270 -0
- package/dist/ui/src/components/auto-form/helpers.mjs +259 -0
- package/dist/ui/src/components/auto-form/index.cjs +102 -0
- package/dist/ui/src/components/auto-form/index.mjs +93 -0
- package/dist/ui/src/components/auto-form/stepped-auto-form.cjs +374 -0
- package/dist/ui/src/components/auto-form/stepped-auto-form.mjs +368 -0
- package/dist/ui/src/components/auto-form/types.cjs +11 -0
- package/dist/ui/src/components/auto-form/types.mjs +9 -0
- package/dist/ui/src/components/badge.cjs +42 -0
- package/dist/ui/src/components/badge.mjs +39 -0
- package/dist/ui/src/components/button.cjs +56 -0
- package/dist/ui/src/components/button.mjs +53 -0
- package/dist/ui/src/components/calendar.cjs +207 -0
- package/dist/ui/src/components/calendar.mjs +190 -0
- package/dist/ui/src/components/checkbox.cjs +48 -0
- package/dist/ui/src/components/checkbox.mjs +32 -0
- package/dist/ui/src/components/command.cjs +118 -0
- package/dist/ui/src/components/command.mjs +111 -0
- package/dist/ui/src/components/date-picker.cjs +41 -0
- package/dist/ui/src/components/date-picker.mjs +39 -0
- package/dist/ui/src/components/dialog.cjs +141 -0
- package/dist/ui/src/components/dialog.mjs +118 -0
- package/dist/ui/src/components/empty.cjs +104 -0
- package/dist/ui/src/components/empty.mjs +97 -0
- package/dist/ui/src/components/form-builder/canvas.cjs +111 -0
- package/dist/ui/src/components/form-builder/canvas.mjs +109 -0
- package/dist/ui/src/components/form-builder/components/index.cjs +571 -0
- package/dist/ui/src/components/form-builder/components/index.mjs +554 -0
- package/dist/ui/src/components/form-builder/edit-field-dialog.cjs +131 -0
- package/dist/ui/src/components/form-builder/edit-field-dialog.mjs +129 -0
- package/dist/ui/src/components/form-builder/form-preview.cjs +73 -0
- package/dist/ui/src/components/form-builder/form-preview.mjs +71 -0
- package/dist/ui/src/components/form-builder/index.cjs +350 -0
- package/dist/ui/src/components/form-builder/index.mjs +344 -0
- package/dist/ui/src/components/form-builder/nested-field-editor-dialog.cjs +263 -0
- package/dist/ui/src/components/form-builder/nested-field-editor-dialog.mjs +261 -0
- package/dist/ui/src/components/form-builder/palette.cjs +52 -0
- package/dist/ui/src/components/form-builder/palette.mjs +49 -0
- package/dist/ui/src/components/form-builder/schema-utils.cjs +128 -0
- package/dist/ui/src/components/form-builder/schema-utils.mjs +122 -0
- package/dist/ui/src/components/form-builder/sortable-field.cjs +151 -0
- package/dist/ui/src/components/form-builder/sortable-field.mjs +148 -0
- package/dist/ui/src/components/form-builder/step-tabs.cjs +180 -0
- package/dist/ui/src/components/form-builder/step-tabs.mjs +178 -0
- package/dist/ui/src/components/form-builder/types.cjs +7 -0
- package/dist/ui/src/components/form-builder/types.mjs +5 -0
- package/dist/ui/src/components/form-builder/validation-schemas.cjs +67 -0
- package/dist/ui/src/components/form-builder/validation-schemas.mjs +56 -0
- package/dist/ui/src/components/form.cjs +120 -0
- package/dist/ui/src/components/form.mjs +98 -0
- package/dist/ui/src/components/input.cjs +23 -0
- package/dist/ui/src/components/input.mjs +21 -0
- package/dist/ui/src/components/label.cjs +39 -0
- package/dist/ui/src/components/label.mjs +23 -0
- package/dist/ui/src/components/markdown-content.cjs +334 -0
- package/dist/ui/src/components/markdown-content.mjs +325 -0
- package/dist/ui/src/components/markdown-editor.cjs +180 -0
- package/dist/ui/src/components/markdown-editor.mjs +178 -0
- package/dist/ui/src/components/multi-select.cjs +555 -0
- package/dist/ui/src/components/multi-select.mjs +540 -0
- package/dist/ui/src/components/popover.cjs +60 -0
- package/dist/ui/src/components/popover.mjs +42 -0
- package/dist/ui/src/components/radio-group.cjs +62 -0
- package/dist/ui/src/components/radio-group.mjs +45 -0
- package/dist/ui/src/components/search-select.cjs +99 -0
- package/dist/ui/src/components/search-select.mjs +83 -0
- package/dist/ui/src/components/select.cjs +161 -0
- package/dist/ui/src/components/select.mjs +139 -0
- package/dist/ui/src/components/separator.cjs +43 -0
- package/dist/ui/src/components/separator.mjs +27 -0
- package/dist/ui/src/components/switch.cjs +48 -0
- package/dist/ui/src/components/switch.mjs +32 -0
- package/dist/ui/src/components/tabs.cjs +84 -0
- package/dist/ui/src/components/tabs.mjs +65 -0
- package/dist/ui/src/components/textarea.cjs +20 -0
- package/dist/ui/src/components/textarea.mjs +18 -0
- package/dist/ui/src/hooks/use-debounce.cjs +16 -0
- package/dist/ui/src/hooks/use-debounce.mjs +14 -0
- package/dist/ui/src/lib/schema-converter.cjs +94 -0
- package/dist/ui/src/lib/schema-converter.mjs +92 -0
- package/dist/ui/src/lib/throttle.cjs +56 -0
- package/dist/ui/src/lib/throttle.mjs +54 -0
- package/dist/ui/src/lib/utils.cjs +10 -0
- package/dist/ui/src/lib/utils.mjs +8 -0
- package/dist/ui.css +131 -0
- package/package.json +176 -3
- package/README.md +0 -3
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import { AccordionItem, AccordionTrigger, AccordionContent } from '../../accordion.mjs';
|
|
3
|
+
import { Button } from '../../button.mjs';
|
|
4
|
+
import { FormField, FormItem, FormControl, FormLabel, FormMessage } from '../../form.mjs';
|
|
5
|
+
import { Input } from '../../input.mjs';
|
|
6
|
+
import { Separator } from '../../separator.mjs';
|
|
7
|
+
import { Trash, Plus } from 'lucide-react';
|
|
8
|
+
import { useFieldArray, useWatch } from 'react-hook-form';
|
|
9
|
+
import { getBaseSchema, getBaseType, beautifyObjectName } from '../helpers.mjs';
|
|
10
|
+
import AutoFormObject from './object.mjs';
|
|
11
|
+
|
|
12
|
+
function getDefType(schema) {
|
|
13
|
+
return schema._zod?.def?.type || "";
|
|
14
|
+
}
|
|
15
|
+
function getArrayElementType(item) {
|
|
16
|
+
const def = item._zod?.def;
|
|
17
|
+
const defType = getDefType(item);
|
|
18
|
+
if (defType === "array") {
|
|
19
|
+
return def?.element || null;
|
|
20
|
+
}
|
|
21
|
+
if (["default", "optional", "nullable"].includes(defType)) {
|
|
22
|
+
const innerType = def?.innerType;
|
|
23
|
+
if (innerType) {
|
|
24
|
+
return getArrayElementType(innerType);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
function getPrimitiveDefault(itemSchema) {
|
|
30
|
+
const base = getBaseSchema(itemSchema);
|
|
31
|
+
if (!base) return "";
|
|
32
|
+
switch (getBaseType(base)) {
|
|
33
|
+
case "ZodBoolean":
|
|
34
|
+
return false;
|
|
35
|
+
case "ZodNumber":
|
|
36
|
+
return 0;
|
|
37
|
+
default:
|
|
38
|
+
return "";
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
function AutoFormArray({
|
|
42
|
+
name,
|
|
43
|
+
item,
|
|
44
|
+
form,
|
|
45
|
+
path = [],
|
|
46
|
+
fieldConfig
|
|
47
|
+
}) {
|
|
48
|
+
const itemDefType = getArrayElementType(item);
|
|
49
|
+
const elementBaseSchema = itemDefType ? getBaseSchema(itemDefType) : null;
|
|
50
|
+
const elementPrimitiveType = elementBaseSchema ? getBaseType(elementBaseSchema) : "";
|
|
51
|
+
const isObjectArray = !!itemDefType && elementPrimitiveType === "ZodObject";
|
|
52
|
+
const title = fieldConfig?.label ?? beautifyObjectName(name);
|
|
53
|
+
if (isObjectArray) {
|
|
54
|
+
return /* @__PURE__ */ jsx(
|
|
55
|
+
ObjectAutoFormArray,
|
|
56
|
+
{
|
|
57
|
+
name,
|
|
58
|
+
item,
|
|
59
|
+
form,
|
|
60
|
+
path,
|
|
61
|
+
fieldConfig,
|
|
62
|
+
itemDefType,
|
|
63
|
+
title
|
|
64
|
+
}
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
return /* @__PURE__ */ jsx(
|
|
68
|
+
PrimitiveAutoFormArray,
|
|
69
|
+
{
|
|
70
|
+
name,
|
|
71
|
+
item,
|
|
72
|
+
form,
|
|
73
|
+
path,
|
|
74
|
+
fieldConfig,
|
|
75
|
+
itemDefType,
|
|
76
|
+
title
|
|
77
|
+
}
|
|
78
|
+
);
|
|
79
|
+
}
|
|
80
|
+
function ObjectAutoFormArray({
|
|
81
|
+
name,
|
|
82
|
+
form,
|
|
83
|
+
path = [],
|
|
84
|
+
fieldConfig,
|
|
85
|
+
itemDefType,
|
|
86
|
+
title
|
|
87
|
+
}) {
|
|
88
|
+
const fieldPath = path.join(".");
|
|
89
|
+
const { fields, append, remove } = useFieldArray({
|
|
90
|
+
control: form.control,
|
|
91
|
+
name: fieldPath
|
|
92
|
+
});
|
|
93
|
+
return /* @__PURE__ */ jsxs(AccordionItem, { value: name, className: "border-none", children: [
|
|
94
|
+
/* @__PURE__ */ jsx(AccordionTrigger, { children: title }),
|
|
95
|
+
/* @__PURE__ */ jsxs(AccordionContent, { children: [
|
|
96
|
+
fields.map((_field, index) => {
|
|
97
|
+
const key = _field.id;
|
|
98
|
+
return /* @__PURE__ */ jsxs("div", { className: "mt-4 flex flex-col", children: [
|
|
99
|
+
/* @__PURE__ */ jsx(
|
|
100
|
+
AutoFormObject,
|
|
101
|
+
{
|
|
102
|
+
schema: itemDefType,
|
|
103
|
+
form,
|
|
104
|
+
fieldConfig,
|
|
105
|
+
path: [...path, index.toString()]
|
|
106
|
+
}
|
|
107
|
+
),
|
|
108
|
+
/* @__PURE__ */ jsx("div", { className: "my-4 flex justify-end", children: /* @__PURE__ */ jsx(
|
|
109
|
+
Button,
|
|
110
|
+
{
|
|
111
|
+
variant: "secondary",
|
|
112
|
+
size: "icon",
|
|
113
|
+
type: "button",
|
|
114
|
+
className: "hover:bg-zinc-300 hover:text-black focus:ring-0 focus:ring-offset-0 focus-visible:ring-0 focus-visible:ring-offset-0 dark:bg-white dark:text-black dark:hover:bg-zinc-300 dark:hover:text-black dark:hover:ring-0 dark:hover:ring-offset-0 dark:focus-visible:ring-0 dark:focus-visible:ring-offset-0",
|
|
115
|
+
onClick: () => remove(index),
|
|
116
|
+
children: /* @__PURE__ */ jsx(Trash, { className: "size-4" })
|
|
117
|
+
}
|
|
118
|
+
) }),
|
|
119
|
+
/* @__PURE__ */ jsx(Separator, {})
|
|
120
|
+
] }, key);
|
|
121
|
+
}),
|
|
122
|
+
/* @__PURE__ */ jsxs(
|
|
123
|
+
Button,
|
|
124
|
+
{
|
|
125
|
+
type: "button",
|
|
126
|
+
variant: "secondary",
|
|
127
|
+
onClick: () => append({}),
|
|
128
|
+
className: "mt-4 flex items-center",
|
|
129
|
+
children: [
|
|
130
|
+
/* @__PURE__ */ jsx(Plus, { className: "mr-2", size: 16 }),
|
|
131
|
+
"Add"
|
|
132
|
+
]
|
|
133
|
+
}
|
|
134
|
+
)
|
|
135
|
+
] })
|
|
136
|
+
] });
|
|
137
|
+
}
|
|
138
|
+
function PrimitiveAutoFormArray({
|
|
139
|
+
name,
|
|
140
|
+
item,
|
|
141
|
+
form,
|
|
142
|
+
path = [],
|
|
143
|
+
fieldConfig,
|
|
144
|
+
itemDefType,
|
|
145
|
+
title
|
|
146
|
+
}) {
|
|
147
|
+
const fieldPath = path.join(".");
|
|
148
|
+
const rawValues = useWatch({ control: form.control, name: fieldPath }) ?? [];
|
|
149
|
+
const values = Array.isArray(rawValues) ? rawValues : [];
|
|
150
|
+
const appendItem = () => {
|
|
151
|
+
const def = itemDefType ? getPrimitiveDefault(itemDefType) : "";
|
|
152
|
+
form.setValue(fieldPath, [...values, def], {
|
|
153
|
+
shouldDirty: true,
|
|
154
|
+
shouldValidate: false
|
|
155
|
+
});
|
|
156
|
+
};
|
|
157
|
+
const removeItem = (index) => {
|
|
158
|
+
const next = values.filter((_, i) => i !== index);
|
|
159
|
+
form.setValue(fieldPath, next, {
|
|
160
|
+
shouldDirty: true,
|
|
161
|
+
shouldValidate: false
|
|
162
|
+
});
|
|
163
|
+
};
|
|
164
|
+
return /* @__PURE__ */ jsxs(AccordionItem, { value: name, className: "border-none", children: [
|
|
165
|
+
/* @__PURE__ */ jsx(AccordionTrigger, { children: title }),
|
|
166
|
+
/* @__PURE__ */ jsxs(AccordionContent, { children: [
|
|
167
|
+
values.map((_, index) => {
|
|
168
|
+
const cellPath = `${fieldPath}.${index}`;
|
|
169
|
+
return /* @__PURE__ */ jsxs("div", { className: "mt-4 flex flex-col", children: [
|
|
170
|
+
itemDefType ? /* @__PURE__ */ jsx(
|
|
171
|
+
PrimitiveArrayRow,
|
|
172
|
+
{
|
|
173
|
+
form,
|
|
174
|
+
itemSchema: itemDefType,
|
|
175
|
+
cellPath
|
|
176
|
+
}
|
|
177
|
+
) : null,
|
|
178
|
+
/* @__PURE__ */ jsx("div", { className: "my-4 flex justify-end", children: /* @__PURE__ */ jsx(
|
|
179
|
+
Button,
|
|
180
|
+
{
|
|
181
|
+
variant: "secondary",
|
|
182
|
+
size: "icon",
|
|
183
|
+
type: "button",
|
|
184
|
+
className: "hover:bg-zinc-300 hover:text-black focus:ring-0 focus:ring-offset-0 focus-visible:ring-0 focus-visible:ring-offset-0 dark:bg-white dark:text-black dark:hover:bg-zinc-300 dark:hover:text-black dark:hover:ring-0 dark:hover:ring-offset-0 dark:focus-visible:ring-0 dark:focus-visible:ring-offset-0",
|
|
185
|
+
onClick: () => removeItem(index),
|
|
186
|
+
children: /* @__PURE__ */ jsx(Trash, { className: "size-4" })
|
|
187
|
+
}
|
|
188
|
+
) }),
|
|
189
|
+
/* @__PURE__ */ jsx(Separator, {})
|
|
190
|
+
] }, `${fieldPath}-${index}`);
|
|
191
|
+
}),
|
|
192
|
+
/* @__PURE__ */ jsxs(
|
|
193
|
+
Button,
|
|
194
|
+
{
|
|
195
|
+
type: "button",
|
|
196
|
+
variant: "secondary",
|
|
197
|
+
onClick: appendItem,
|
|
198
|
+
className: "mt-4 flex items-center",
|
|
199
|
+
children: [
|
|
200
|
+
/* @__PURE__ */ jsx(Plus, { className: "mr-2", size: 16 }),
|
|
201
|
+
"Add"
|
|
202
|
+
]
|
|
203
|
+
}
|
|
204
|
+
)
|
|
205
|
+
] })
|
|
206
|
+
] });
|
|
207
|
+
}
|
|
208
|
+
function PrimitiveArrayRow({
|
|
209
|
+
form,
|
|
210
|
+
itemSchema,
|
|
211
|
+
cellPath
|
|
212
|
+
}) {
|
|
213
|
+
const baseSchema = getBaseSchema(itemSchema);
|
|
214
|
+
const t = baseSchema ? getBaseType(baseSchema) : "";
|
|
215
|
+
if (t === "ZodBoolean") {
|
|
216
|
+
return /* @__PURE__ */ jsx(
|
|
217
|
+
FormField,
|
|
218
|
+
{
|
|
219
|
+
control: form.control,
|
|
220
|
+
name: cellPath,
|
|
221
|
+
render: ({ field }) => /* @__PURE__ */ jsxs(FormItem, { className: "flex flex-row items-center gap-2 space-y-0", children: [
|
|
222
|
+
/* @__PURE__ */ jsx(FormControl, { children: /* @__PURE__ */ jsx(
|
|
223
|
+
"input",
|
|
224
|
+
{
|
|
225
|
+
type: "checkbox",
|
|
226
|
+
"aria-label": "Toggle",
|
|
227
|
+
checked: Boolean(field.value),
|
|
228
|
+
onChange: (e) => field.onChange(e.target.checked)
|
|
229
|
+
}
|
|
230
|
+
) }),
|
|
231
|
+
/* @__PURE__ */ jsx(FormLabel, { className: "font-normal cursor-pointer", children: field.value ? "Selected" : "Not selected" }),
|
|
232
|
+
/* @__PURE__ */ jsx(FormMessage, {})
|
|
233
|
+
] })
|
|
234
|
+
}
|
|
235
|
+
);
|
|
236
|
+
}
|
|
237
|
+
const inputType = t === "ZodNumber" ? "number" : "text";
|
|
238
|
+
return /* @__PURE__ */ jsx(
|
|
239
|
+
FormField,
|
|
240
|
+
{
|
|
241
|
+
control: form.control,
|
|
242
|
+
name: cellPath,
|
|
243
|
+
render: ({ field }) => /* @__PURE__ */ jsxs(FormItem, { className: "space-y-2", children: [
|
|
244
|
+
/* @__PURE__ */ jsx(FormLabel, { className: "sr-only", children: "Row value" }),
|
|
245
|
+
/* @__PURE__ */ jsx(FormControl, { children: /* @__PURE__ */ jsx(
|
|
246
|
+
Input,
|
|
247
|
+
{
|
|
248
|
+
type: inputType,
|
|
249
|
+
name: field.name,
|
|
250
|
+
ref: field.ref,
|
|
251
|
+
onBlur: field.onBlur,
|
|
252
|
+
value: field.value === void 0 || field.value === null ? "" : String(field.value),
|
|
253
|
+
onChange: (ev) => field.onChange(
|
|
254
|
+
inputType === "number" ? Number.isNaN(ev.target.valueAsNumber) ? void 0 : ev.target.valueAsNumber : ev.target.value
|
|
255
|
+
)
|
|
256
|
+
}
|
|
257
|
+
) }),
|
|
258
|
+
/* @__PURE__ */ jsx(FormMessage, {})
|
|
259
|
+
] })
|
|
260
|
+
}
|
|
261
|
+
);
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
export { AutoFormArray as default };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
const checkbox = require('../../checkbox.cjs');
|
|
5
|
+
const form = require('../../form.cjs');
|
|
6
|
+
const tooltip = require('../common/tooltip.cjs');
|
|
7
|
+
const label = require('../common/label.cjs');
|
|
8
|
+
|
|
9
|
+
function AutoFormCheckbox({
|
|
10
|
+
label: label$1,
|
|
11
|
+
isRequired,
|
|
12
|
+
field,
|
|
13
|
+
fieldConfigItem,
|
|
14
|
+
fieldProps
|
|
15
|
+
}) {
|
|
16
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
17
|
+
/* @__PURE__ */ jsxRuntime.jsx(form.FormItem, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mb-3 flex items-center gap-3", children: [
|
|
18
|
+
/* @__PURE__ */ jsxRuntime.jsx(form.FormControl, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
19
|
+
checkbox.Checkbox,
|
|
20
|
+
{
|
|
21
|
+
checked: field.value,
|
|
22
|
+
onCheckedChange: field.onChange,
|
|
23
|
+
...fieldProps
|
|
24
|
+
}
|
|
25
|
+
) }),
|
|
26
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
27
|
+
label,
|
|
28
|
+
{
|
|
29
|
+
label: fieldConfigItem?.label || label$1,
|
|
30
|
+
isRequired
|
|
31
|
+
}
|
|
32
|
+
)
|
|
33
|
+
] }) }),
|
|
34
|
+
/* @__PURE__ */ jsxRuntime.jsx(tooltip, { fieldConfigItem })
|
|
35
|
+
] });
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
module.exports = AutoFormCheckbox;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { Checkbox } from '../../checkbox.mjs';
|
|
3
|
+
import { FormItem, FormControl } from '../../form.mjs';
|
|
4
|
+
import AutoFormTooltip from '../common/tooltip.mjs';
|
|
5
|
+
import AutoFormLabel from '../common/label.mjs';
|
|
6
|
+
|
|
7
|
+
function AutoFormCheckbox({
|
|
8
|
+
label,
|
|
9
|
+
isRequired,
|
|
10
|
+
field,
|
|
11
|
+
fieldConfigItem,
|
|
12
|
+
fieldProps
|
|
13
|
+
}) {
|
|
14
|
+
return /* @__PURE__ */ jsxs("div", { children: [
|
|
15
|
+
/* @__PURE__ */ jsx(FormItem, { children: /* @__PURE__ */ jsxs("div", { className: "mb-3 flex items-center gap-3", children: [
|
|
16
|
+
/* @__PURE__ */ jsx(FormControl, { children: /* @__PURE__ */ jsx(
|
|
17
|
+
Checkbox,
|
|
18
|
+
{
|
|
19
|
+
checked: field.value,
|
|
20
|
+
onCheckedChange: field.onChange,
|
|
21
|
+
...fieldProps
|
|
22
|
+
}
|
|
23
|
+
) }),
|
|
24
|
+
/* @__PURE__ */ jsx(
|
|
25
|
+
AutoFormLabel,
|
|
26
|
+
{
|
|
27
|
+
label: fieldConfigItem?.label || label,
|
|
28
|
+
isRequired
|
|
29
|
+
}
|
|
30
|
+
)
|
|
31
|
+
] }) }),
|
|
32
|
+
/* @__PURE__ */ jsx(AutoFormTooltip, { fieldConfigItem })
|
|
33
|
+
] });
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export { AutoFormCheckbox as default };
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
const datePicker = require('../../date-picker.cjs');
|
|
5
|
+
const form = require('../../form.cjs');
|
|
6
|
+
const z = require('zod');
|
|
7
|
+
const label = require('../common/label.cjs');
|
|
8
|
+
const tooltip = require('../common/tooltip.cjs');
|
|
9
|
+
const helpers = require('../helpers.cjs');
|
|
10
|
+
|
|
11
|
+
function toDate(value, dateOnly) {
|
|
12
|
+
if (!value) return void 0;
|
|
13
|
+
if (value instanceof Date) return value;
|
|
14
|
+
if (typeof value === "string") {
|
|
15
|
+
const date = new Date(dateOnly && /^\d{4}-\d{2}-\d{2}$/.test(value) ? `${value}T00:00:00` : value);
|
|
16
|
+
return isNaN(date.getTime()) ? void 0 : date;
|
|
17
|
+
}
|
|
18
|
+
return void 0;
|
|
19
|
+
}
|
|
20
|
+
function AutoFormDate({
|
|
21
|
+
label: label$1,
|
|
22
|
+
isRequired,
|
|
23
|
+
field,
|
|
24
|
+
fieldConfigItem,
|
|
25
|
+
fieldProps,
|
|
26
|
+
zodItem
|
|
27
|
+
}) {
|
|
28
|
+
const baseType = helpers.getBaseType(zodItem);
|
|
29
|
+
const expectsDateObject = baseType === "ZodDate";
|
|
30
|
+
const baseSchema = helpers.getBaseSchema(zodItem);
|
|
31
|
+
const dateSchema = baseSchema instanceof z.z.ZodUnion && baseSchema.options.length === 2 && baseSchema.options.some((option) => option instanceof z.z.ZodNull) ? baseSchema.options.find((option) => !(option instanceof z.z.ZodNull)) : baseSchema;
|
|
32
|
+
const expectsDateOnly = !!dateSchema && ("format" in dateSchema && dateSchema.format === "date" || dateSchema instanceof z.z.ZodString && !!dateSchema._zod.def.checks?.some((check) => "format" in check._zod.def && check._zod.def.format === "date"));
|
|
33
|
+
const handleChange = (date) => {
|
|
34
|
+
if (!date) {
|
|
35
|
+
field.onChange(expectsDateOnly && zodItem.isNullable() ? null : void 0);
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
if (expectsDateObject) {
|
|
39
|
+
field.onChange(date);
|
|
40
|
+
} else if (expectsDateOnly) {
|
|
41
|
+
field.onChange(`${String(date.getFullYear()).padStart(4, "0")}-${String(date.getMonth() + 1).padStart(2, "0")}-${String(date.getDate()).padStart(2, "0")}`);
|
|
42
|
+
} else {
|
|
43
|
+
field.onChange(date.toISOString());
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(form.FormItem, { children: [
|
|
47
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
48
|
+
label,
|
|
49
|
+
{
|
|
50
|
+
label: fieldConfigItem?.label || label$1,
|
|
51
|
+
isRequired
|
|
52
|
+
}
|
|
53
|
+
),
|
|
54
|
+
/* @__PURE__ */ jsxRuntime.jsx(form.FormControl, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
55
|
+
datePicker.DatePicker,
|
|
56
|
+
{
|
|
57
|
+
date: toDate(field.value, expectsDateOnly),
|
|
58
|
+
setDate: handleChange,
|
|
59
|
+
...fieldProps
|
|
60
|
+
}
|
|
61
|
+
) }),
|
|
62
|
+
/* @__PURE__ */ jsxRuntime.jsx(tooltip, { fieldConfigItem }),
|
|
63
|
+
/* @__PURE__ */ jsxRuntime.jsx(form.FormMessage, {})
|
|
64
|
+
] });
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
module.exports = AutoFormDate;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { DatePicker } from '../../date-picker.mjs';
|
|
3
|
+
import { FormItem, FormControl, FormMessage } from '../../form.mjs';
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
import AutoFormLabel from '../common/label.mjs';
|
|
6
|
+
import AutoFormTooltip from '../common/tooltip.mjs';
|
|
7
|
+
import { getBaseType, getBaseSchema } from '../helpers.mjs';
|
|
8
|
+
|
|
9
|
+
function toDate(value, dateOnly) {
|
|
10
|
+
if (!value) return void 0;
|
|
11
|
+
if (value instanceof Date) return value;
|
|
12
|
+
if (typeof value === "string") {
|
|
13
|
+
const date = new Date(dateOnly && /^\d{4}-\d{2}-\d{2}$/.test(value) ? `${value}T00:00:00` : value);
|
|
14
|
+
return isNaN(date.getTime()) ? void 0 : date;
|
|
15
|
+
}
|
|
16
|
+
return void 0;
|
|
17
|
+
}
|
|
18
|
+
function AutoFormDate({
|
|
19
|
+
label,
|
|
20
|
+
isRequired,
|
|
21
|
+
field,
|
|
22
|
+
fieldConfigItem,
|
|
23
|
+
fieldProps,
|
|
24
|
+
zodItem
|
|
25
|
+
}) {
|
|
26
|
+
const baseType = getBaseType(zodItem);
|
|
27
|
+
const expectsDateObject = baseType === "ZodDate";
|
|
28
|
+
const baseSchema = getBaseSchema(zodItem);
|
|
29
|
+
const dateSchema = baseSchema instanceof z.ZodUnion && baseSchema.options.length === 2 && baseSchema.options.some((option) => option instanceof z.ZodNull) ? baseSchema.options.find((option) => !(option instanceof z.ZodNull)) : baseSchema;
|
|
30
|
+
const expectsDateOnly = !!dateSchema && ("format" in dateSchema && dateSchema.format === "date" || dateSchema instanceof z.ZodString && !!dateSchema._zod.def.checks?.some((check) => "format" in check._zod.def && check._zod.def.format === "date"));
|
|
31
|
+
const handleChange = (date) => {
|
|
32
|
+
if (!date) {
|
|
33
|
+
field.onChange(expectsDateOnly && zodItem.isNullable() ? null : void 0);
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
if (expectsDateObject) {
|
|
37
|
+
field.onChange(date);
|
|
38
|
+
} else if (expectsDateOnly) {
|
|
39
|
+
field.onChange(`${String(date.getFullYear()).padStart(4, "0")}-${String(date.getMonth() + 1).padStart(2, "0")}-${String(date.getDate()).padStart(2, "0")}`);
|
|
40
|
+
} else {
|
|
41
|
+
field.onChange(date.toISOString());
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
return /* @__PURE__ */ jsxs(FormItem, { children: [
|
|
45
|
+
/* @__PURE__ */ jsx(
|
|
46
|
+
AutoFormLabel,
|
|
47
|
+
{
|
|
48
|
+
label: fieldConfigItem?.label || label,
|
|
49
|
+
isRequired
|
|
50
|
+
}
|
|
51
|
+
),
|
|
52
|
+
/* @__PURE__ */ jsx(FormControl, { children: /* @__PURE__ */ jsx(
|
|
53
|
+
DatePicker,
|
|
54
|
+
{
|
|
55
|
+
date: toDate(field.value, expectsDateOnly),
|
|
56
|
+
setDate: handleChange,
|
|
57
|
+
...fieldProps
|
|
58
|
+
}
|
|
59
|
+
) }),
|
|
60
|
+
/* @__PURE__ */ jsx(AutoFormTooltip, { fieldConfigItem }),
|
|
61
|
+
/* @__PURE__ */ jsx(FormMessage, {})
|
|
62
|
+
] });
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export { AutoFormDate as default };
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
const form = require('../../form.cjs');
|
|
5
|
+
const select = require('../../select.cjs');
|
|
6
|
+
const label = require('../common/label.cjs');
|
|
7
|
+
const tooltip = require('../common/tooltip.cjs');
|
|
8
|
+
const helpers = require('../helpers.cjs');
|
|
9
|
+
|
|
10
|
+
function getEnumValues(schema) {
|
|
11
|
+
if (Array.isArray(schema.options)) {
|
|
12
|
+
return schema.options;
|
|
13
|
+
}
|
|
14
|
+
if (schema.enum) {
|
|
15
|
+
return Object.values(schema.enum);
|
|
16
|
+
}
|
|
17
|
+
const def = schema._zod?.def;
|
|
18
|
+
if (def?.entries) {
|
|
19
|
+
return Object.values(def.entries);
|
|
20
|
+
}
|
|
21
|
+
return [];
|
|
22
|
+
}
|
|
23
|
+
function AutoFormEnum({
|
|
24
|
+
label: label$1,
|
|
25
|
+
isRequired,
|
|
26
|
+
field,
|
|
27
|
+
fieldConfigItem,
|
|
28
|
+
zodItem,
|
|
29
|
+
fieldProps
|
|
30
|
+
}) {
|
|
31
|
+
const baseSchema = helpers.getBaseSchema(zodItem);
|
|
32
|
+
const baseValues = getEnumValues(baseSchema);
|
|
33
|
+
let values = [];
|
|
34
|
+
if (!baseValues || baseValues.length === 0) {
|
|
35
|
+
values = [];
|
|
36
|
+
} else {
|
|
37
|
+
values = baseValues.map((value) => [value, value]);
|
|
38
|
+
}
|
|
39
|
+
function findItem(value) {
|
|
40
|
+
return values.find((item) => item[0] === value);
|
|
41
|
+
}
|
|
42
|
+
const handleValueChange = (val) => {
|
|
43
|
+
if (val === "" && field.value && field.value !== "") {
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
field.onChange(val);
|
|
47
|
+
};
|
|
48
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(form.FormItem, { children: [
|
|
49
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
50
|
+
label,
|
|
51
|
+
{
|
|
52
|
+
label: fieldConfigItem?.label || label$1,
|
|
53
|
+
isRequired
|
|
54
|
+
}
|
|
55
|
+
),
|
|
56
|
+
/* @__PURE__ */ jsxRuntime.jsx(form.FormControl, { children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
57
|
+
select.Select,
|
|
58
|
+
{
|
|
59
|
+
onValueChange: handleValueChange,
|
|
60
|
+
value: field.value ?? "",
|
|
61
|
+
...fieldProps,
|
|
62
|
+
children: [
|
|
63
|
+
/* @__PURE__ */ jsxRuntime.jsx(select.SelectTrigger, { className: fieldProps.className, children: /* @__PURE__ */ jsxRuntime.jsx(select.SelectValue, { placeholder: fieldConfigItem.inputProps?.placeholder, children: field.value ? findItem(field.value)?.[1] : "Select an option" }) }),
|
|
64
|
+
/* @__PURE__ */ jsxRuntime.jsx(select.SelectContent, { children: values.map(([value, label2]) => /* @__PURE__ */ jsxRuntime.jsx(select.SelectItem, { value: label2, children: label2 }, value)) })
|
|
65
|
+
]
|
|
66
|
+
}
|
|
67
|
+
) }),
|
|
68
|
+
/* @__PURE__ */ jsxRuntime.jsx(tooltip, { fieldConfigItem }),
|
|
69
|
+
/* @__PURE__ */ jsxRuntime.jsx(form.FormMessage, {})
|
|
70
|
+
] });
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
module.exports = AutoFormEnum;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { FormItem, FormControl, FormMessage } from '../../form.mjs';
|
|
3
|
+
import { Select, SelectTrigger, SelectValue, SelectContent, SelectItem } from '../../select.mjs';
|
|
4
|
+
import AutoFormLabel from '../common/label.mjs';
|
|
5
|
+
import AutoFormTooltip from '../common/tooltip.mjs';
|
|
6
|
+
import { getBaseSchema } from '../helpers.mjs';
|
|
7
|
+
|
|
8
|
+
function getEnumValues(schema) {
|
|
9
|
+
if (Array.isArray(schema.options)) {
|
|
10
|
+
return schema.options;
|
|
11
|
+
}
|
|
12
|
+
if (schema.enum) {
|
|
13
|
+
return Object.values(schema.enum);
|
|
14
|
+
}
|
|
15
|
+
const def = schema._zod?.def;
|
|
16
|
+
if (def?.entries) {
|
|
17
|
+
return Object.values(def.entries);
|
|
18
|
+
}
|
|
19
|
+
return [];
|
|
20
|
+
}
|
|
21
|
+
function AutoFormEnum({
|
|
22
|
+
label,
|
|
23
|
+
isRequired,
|
|
24
|
+
field,
|
|
25
|
+
fieldConfigItem,
|
|
26
|
+
zodItem,
|
|
27
|
+
fieldProps
|
|
28
|
+
}) {
|
|
29
|
+
const baseSchema = getBaseSchema(zodItem);
|
|
30
|
+
const baseValues = getEnumValues(baseSchema);
|
|
31
|
+
let values = [];
|
|
32
|
+
if (!baseValues || baseValues.length === 0) {
|
|
33
|
+
values = [];
|
|
34
|
+
} else {
|
|
35
|
+
values = baseValues.map((value) => [value, value]);
|
|
36
|
+
}
|
|
37
|
+
function findItem(value) {
|
|
38
|
+
return values.find((item) => item[0] === value);
|
|
39
|
+
}
|
|
40
|
+
const handleValueChange = (val) => {
|
|
41
|
+
if (val === "" && field.value && field.value !== "") {
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
field.onChange(val);
|
|
45
|
+
};
|
|
46
|
+
return /* @__PURE__ */ jsxs(FormItem, { children: [
|
|
47
|
+
/* @__PURE__ */ jsx(
|
|
48
|
+
AutoFormLabel,
|
|
49
|
+
{
|
|
50
|
+
label: fieldConfigItem?.label || label,
|
|
51
|
+
isRequired
|
|
52
|
+
}
|
|
53
|
+
),
|
|
54
|
+
/* @__PURE__ */ jsx(FormControl, { children: /* @__PURE__ */ jsxs(
|
|
55
|
+
Select,
|
|
56
|
+
{
|
|
57
|
+
onValueChange: handleValueChange,
|
|
58
|
+
value: field.value ?? "",
|
|
59
|
+
...fieldProps,
|
|
60
|
+
children: [
|
|
61
|
+
/* @__PURE__ */ jsx(SelectTrigger, { className: fieldProps.className, children: /* @__PURE__ */ jsx(SelectValue, { placeholder: fieldConfigItem.inputProps?.placeholder, children: field.value ? findItem(field.value)?.[1] : "Select an option" }) }),
|
|
62
|
+
/* @__PURE__ */ jsx(SelectContent, { children: values.map(([value, label2]) => /* @__PURE__ */ jsx(SelectItem, { value: label2, children: label2 }, value)) })
|
|
63
|
+
]
|
|
64
|
+
}
|
|
65
|
+
) }),
|
|
66
|
+
/* @__PURE__ */ jsx(AutoFormTooltip, { fieldConfigItem }),
|
|
67
|
+
/* @__PURE__ */ jsx(FormMessage, {})
|
|
68
|
+
] });
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export { AutoFormEnum as default };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
const form = require('../../form.cjs');
|
|
5
|
+
const input = require('../../input.cjs');
|
|
6
|
+
const label = require('../common/label.cjs');
|
|
7
|
+
const tooltip = require('../common/tooltip.cjs');
|
|
8
|
+
|
|
9
|
+
function AutoFormInput({
|
|
10
|
+
label: label$1,
|
|
11
|
+
isRequired,
|
|
12
|
+
fieldConfigItem,
|
|
13
|
+
fieldProps
|
|
14
|
+
}) {
|
|
15
|
+
const { showLabel: _showLabel, ...fieldPropsWithoutShowLabel } = fieldProps;
|
|
16
|
+
const showLabel = _showLabel === void 0 ? true : _showLabel;
|
|
17
|
+
const type = fieldProps.type || "text";
|
|
18
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-row items-center space-x-2", children: /* @__PURE__ */ jsxRuntime.jsxs(form.FormItem, { className: "flex w-full flex-col justify-start", children: [
|
|
19
|
+
showLabel && /* @__PURE__ */ jsxRuntime.jsx(
|
|
20
|
+
label,
|
|
21
|
+
{
|
|
22
|
+
label: fieldConfigItem?.label || label$1,
|
|
23
|
+
isRequired
|
|
24
|
+
}
|
|
25
|
+
),
|
|
26
|
+
/* @__PURE__ */ jsxRuntime.jsx(form.FormControl, { children: /* @__PURE__ */ jsxRuntime.jsx(input.Input, { type, ...fieldPropsWithoutShowLabel }) }),
|
|
27
|
+
/* @__PURE__ */ jsxRuntime.jsx(tooltip, { fieldConfigItem }),
|
|
28
|
+
/* @__PURE__ */ jsxRuntime.jsx(form.FormMessage, {})
|
|
29
|
+
] }) });
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
module.exports = AutoFormInput;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import { FormItem, FormControl, FormMessage } from '../../form.mjs';
|
|
3
|
+
import { Input } from '../../input.mjs';
|
|
4
|
+
import AutoFormLabel from '../common/label.mjs';
|
|
5
|
+
import AutoFormTooltip from '../common/tooltip.mjs';
|
|
6
|
+
|
|
7
|
+
function AutoFormInput({
|
|
8
|
+
label,
|
|
9
|
+
isRequired,
|
|
10
|
+
fieldConfigItem,
|
|
11
|
+
fieldProps
|
|
12
|
+
}) {
|
|
13
|
+
const { showLabel: _showLabel, ...fieldPropsWithoutShowLabel } = fieldProps;
|
|
14
|
+
const showLabel = _showLabel === void 0 ? true : _showLabel;
|
|
15
|
+
const type = fieldProps.type || "text";
|
|
16
|
+
return /* @__PURE__ */ jsx("div", { className: "flex flex-row items-center space-x-2", children: /* @__PURE__ */ jsxs(FormItem, { className: "flex w-full flex-col justify-start", children: [
|
|
17
|
+
showLabel && /* @__PURE__ */ jsx(
|
|
18
|
+
AutoFormLabel,
|
|
19
|
+
{
|
|
20
|
+
label: fieldConfigItem?.label || label,
|
|
21
|
+
isRequired
|
|
22
|
+
}
|
|
23
|
+
),
|
|
24
|
+
/* @__PURE__ */ jsx(FormControl, { children: /* @__PURE__ */ jsx(Input, { type, ...fieldPropsWithoutShowLabel }) }),
|
|
25
|
+
/* @__PURE__ */ jsx(AutoFormTooltip, { fieldConfigItem }),
|
|
26
|
+
/* @__PURE__ */ jsx(FormMessage, {})
|
|
27
|
+
] }) });
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export { AutoFormInput as default };
|