@btst/components 0.0.0-stage → 1.0.0-beta.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,31 @@
|
|
|
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 AutoFormNumber({
|
|
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
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(form.FormItem, { children: [
|
|
18
|
+
showLabel && /* @__PURE__ */ jsxRuntime.jsx(
|
|
19
|
+
label,
|
|
20
|
+
{
|
|
21
|
+
label: fieldConfigItem?.label || label$1,
|
|
22
|
+
isRequired
|
|
23
|
+
}
|
|
24
|
+
),
|
|
25
|
+
/* @__PURE__ */ jsxRuntime.jsx(form.FormControl, { children: /* @__PURE__ */ jsxRuntime.jsx(input.Input, { type: "number", ...fieldPropsWithoutShowLabel }) }),
|
|
26
|
+
/* @__PURE__ */ jsxRuntime.jsx(tooltip, { fieldConfigItem }),
|
|
27
|
+
/* @__PURE__ */ jsxRuntime.jsx(form.FormMessage, {})
|
|
28
|
+
] });
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
module.exports = AutoFormNumber;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { jsxs, jsx } 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 AutoFormNumber({
|
|
8
|
+
label,
|
|
9
|
+
isRequired,
|
|
10
|
+
fieldConfigItem,
|
|
11
|
+
fieldProps
|
|
12
|
+
}) {
|
|
13
|
+
const { showLabel: _showLabel, ...fieldPropsWithoutShowLabel } = fieldProps;
|
|
14
|
+
const showLabel = _showLabel === void 0 ? true : _showLabel;
|
|
15
|
+
return /* @__PURE__ */ jsxs(FormItem, { children: [
|
|
16
|
+
showLabel && /* @__PURE__ */ jsx(
|
|
17
|
+
AutoFormLabel,
|
|
18
|
+
{
|
|
19
|
+
label: fieldConfigItem?.label || label,
|
|
20
|
+
isRequired
|
|
21
|
+
}
|
|
22
|
+
),
|
|
23
|
+
/* @__PURE__ */ jsx(FormControl, { children: /* @__PURE__ */ jsx(Input, { type: "number", ...fieldPropsWithoutShowLabel }) }),
|
|
24
|
+
/* @__PURE__ */ jsx(AutoFormTooltip, { fieldConfigItem }),
|
|
25
|
+
/* @__PURE__ */ jsx(FormMessage, {})
|
|
26
|
+
] });
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export { AutoFormNumber as default };
|
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
const accordion = require('../../accordion.cjs');
|
|
5
|
+
const form = require('../../form.cjs');
|
|
6
|
+
const reactHookForm = require('react-hook-form');
|
|
7
|
+
const z = require('zod');
|
|
8
|
+
const config = require('../config.cjs');
|
|
9
|
+
const helpers = require('../helpers.cjs');
|
|
10
|
+
const array = require('./array.cjs');
|
|
11
|
+
const dependencies = require('../dependencies.cjs');
|
|
12
|
+
|
|
13
|
+
function _interopNamespaceCompat(e) {
|
|
14
|
+
if (e && typeof e === 'object' && 'default' in e) return e;
|
|
15
|
+
const n = Object.create(null);
|
|
16
|
+
if (e) {
|
|
17
|
+
for (const k in e) {
|
|
18
|
+
n[k] = e[k];
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
n.default = e;
|
|
22
|
+
return n;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const z__namespace = /*#__PURE__*/_interopNamespaceCompat(z);
|
|
26
|
+
|
|
27
|
+
function DefaultParent({ children }) {
|
|
28
|
+
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children });
|
|
29
|
+
}
|
|
30
|
+
function AutoFormObject({
|
|
31
|
+
schema,
|
|
32
|
+
form: form$1,
|
|
33
|
+
fieldConfig,
|
|
34
|
+
path = [],
|
|
35
|
+
dependencies: dependencies$1 = []
|
|
36
|
+
}) {
|
|
37
|
+
const { watch } = reactHookForm.useFormContext();
|
|
38
|
+
if (!schema) {
|
|
39
|
+
return null;
|
|
40
|
+
}
|
|
41
|
+
const { shape } = helpers.getBaseSchema(schema) || {};
|
|
42
|
+
if (!shape) {
|
|
43
|
+
return null;
|
|
44
|
+
}
|
|
45
|
+
const handleIfZodNumber = (item) => {
|
|
46
|
+
const def = item._zod?.def;
|
|
47
|
+
const defType = def?.type;
|
|
48
|
+
const innerDefType = def?.innerType?._zod?.def?.type;
|
|
49
|
+
const isZodNumber = defType === "number" || defType === "int" || defType === "float";
|
|
50
|
+
const isInnerZodNumber = innerDefType === "number" || innerDefType === "int" || innerDefType === "float";
|
|
51
|
+
if (isZodNumber && def) {
|
|
52
|
+
def.coerce = true;
|
|
53
|
+
} else if (isInnerZodNumber && def?.innerType?._zod?.def) {
|
|
54
|
+
def.innerType._zod.def.coerce = true;
|
|
55
|
+
}
|
|
56
|
+
return item;
|
|
57
|
+
};
|
|
58
|
+
const sortedFieldKeys = helpers.sortFieldsByOrder(fieldConfig, Object.keys(shape));
|
|
59
|
+
return /* @__PURE__ */ jsxRuntime.jsx(accordion.Accordion, { type: "multiple", className: "space-y-5 border-none", children: sortedFieldKeys.map((name) => {
|
|
60
|
+
let item = shape[name];
|
|
61
|
+
item = handleIfZodNumber(item);
|
|
62
|
+
const zodBaseType = helpers.getBaseType(item);
|
|
63
|
+
const itemName = helpers.beautifyObjectName(name);
|
|
64
|
+
const key = [...path, name].join(".");
|
|
65
|
+
const {
|
|
66
|
+
isHidden,
|
|
67
|
+
isDisabled,
|
|
68
|
+
isRequired: isRequiredByDependency,
|
|
69
|
+
overrideOptions
|
|
70
|
+
} = dependencies(dependencies$1, name, watch);
|
|
71
|
+
if (isHidden) {
|
|
72
|
+
return null;
|
|
73
|
+
}
|
|
74
|
+
if (zodBaseType === "ZodObject") {
|
|
75
|
+
const objectFieldConfig = fieldConfig?.[name] ?? {};
|
|
76
|
+
if (typeof objectFieldConfig.fieldType === "function") {
|
|
77
|
+
const zodInputProps2 = helpers.zodToHtmlInputProps(item);
|
|
78
|
+
let isRequired2 = isRequiredByDependency || zodInputProps2.required || false;
|
|
79
|
+
if (objectFieldConfig.inputProps?.required !== void 0) {
|
|
80
|
+
isRequired2 = objectFieldConfig.inputProps.required;
|
|
81
|
+
}
|
|
82
|
+
const CustomComponent = objectFieldConfig.fieldType;
|
|
83
|
+
const ParentElement = objectFieldConfig.renderParent ?? DefaultParent;
|
|
84
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
85
|
+
form.FormField,
|
|
86
|
+
{
|
|
87
|
+
control: form$1.control,
|
|
88
|
+
name: key,
|
|
89
|
+
render: ({ field }) => {
|
|
90
|
+
const fieldProps = {
|
|
91
|
+
...zodInputProps2,
|
|
92
|
+
...field,
|
|
93
|
+
...objectFieldConfig.inputProps,
|
|
94
|
+
disabled: objectFieldConfig.inputProps?.disabled || isDisabled,
|
|
95
|
+
ref: void 0,
|
|
96
|
+
value: field.value
|
|
97
|
+
};
|
|
98
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ParentElement, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
99
|
+
CustomComponent,
|
|
100
|
+
{
|
|
101
|
+
zodInputProps: zodInputProps2,
|
|
102
|
+
field,
|
|
103
|
+
fieldConfigItem: objectFieldConfig,
|
|
104
|
+
label: objectFieldConfig.label || itemName,
|
|
105
|
+
isRequired: isRequired2,
|
|
106
|
+
zodItem: item,
|
|
107
|
+
fieldProps
|
|
108
|
+
}
|
|
109
|
+
) }, `${key}.parent`);
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
key
|
|
113
|
+
);
|
|
114
|
+
}
|
|
115
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(accordion.AccordionItem, { value: name, className: "border-none", children: [
|
|
116
|
+
/* @__PURE__ */ jsxRuntime.jsx(accordion.AccordionTrigger, { children: itemName }),
|
|
117
|
+
/* @__PURE__ */ jsxRuntime.jsx(accordion.AccordionContent, { className: "p-2", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
118
|
+
AutoFormObject,
|
|
119
|
+
{
|
|
120
|
+
schema: item,
|
|
121
|
+
form: form$1,
|
|
122
|
+
fieldConfig: fieldConfig?.[name] ?? {},
|
|
123
|
+
path: [...path, name]
|
|
124
|
+
}
|
|
125
|
+
) })
|
|
126
|
+
] }, key);
|
|
127
|
+
}
|
|
128
|
+
if (zodBaseType === "ZodArray") {
|
|
129
|
+
const arrayFieldConfig = fieldConfig?.[name] ?? {};
|
|
130
|
+
if (typeof arrayFieldConfig.fieldType === "function") {
|
|
131
|
+
const zodInputProps2 = helpers.zodToHtmlInputProps(item);
|
|
132
|
+
let isRequired2 = isRequiredByDependency || zodInputProps2.required || false;
|
|
133
|
+
if (arrayFieldConfig.inputProps?.required !== void 0) {
|
|
134
|
+
isRequired2 = arrayFieldConfig.inputProps.required;
|
|
135
|
+
}
|
|
136
|
+
const CustomComponent = arrayFieldConfig.fieldType;
|
|
137
|
+
const ParentElement = arrayFieldConfig.renderParent ?? DefaultParent;
|
|
138
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
139
|
+
form.FormField,
|
|
140
|
+
{
|
|
141
|
+
control: form$1.control,
|
|
142
|
+
name: key,
|
|
143
|
+
render: ({ field }) => {
|
|
144
|
+
const fieldProps = {
|
|
145
|
+
...zodInputProps2,
|
|
146
|
+
...field,
|
|
147
|
+
...arrayFieldConfig.inputProps,
|
|
148
|
+
disabled: arrayFieldConfig.inputProps?.disabled || isDisabled,
|
|
149
|
+
ref: void 0,
|
|
150
|
+
value: field.value
|
|
151
|
+
};
|
|
152
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ParentElement, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
153
|
+
CustomComponent,
|
|
154
|
+
{
|
|
155
|
+
zodInputProps: zodInputProps2,
|
|
156
|
+
field,
|
|
157
|
+
fieldConfigItem: arrayFieldConfig,
|
|
158
|
+
label: arrayFieldConfig.label || itemName,
|
|
159
|
+
isRequired: isRequired2,
|
|
160
|
+
zodItem: item,
|
|
161
|
+
fieldProps
|
|
162
|
+
}
|
|
163
|
+
) }, `${key}.parent`);
|
|
164
|
+
}
|
|
165
|
+
},
|
|
166
|
+
key
|
|
167
|
+
);
|
|
168
|
+
}
|
|
169
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
170
|
+
array,
|
|
171
|
+
{
|
|
172
|
+
name,
|
|
173
|
+
item,
|
|
174
|
+
form: form$1,
|
|
175
|
+
fieldConfig: arrayFieldConfig,
|
|
176
|
+
path: [...path, name]
|
|
177
|
+
},
|
|
178
|
+
key
|
|
179
|
+
);
|
|
180
|
+
}
|
|
181
|
+
const fieldConfigItem = fieldConfig?.[name] ?? {};
|
|
182
|
+
const zodInputProps = helpers.zodToHtmlInputProps(item);
|
|
183
|
+
let isRequired = isRequiredByDependency || zodInputProps.required || false;
|
|
184
|
+
if (fieldConfigItem.inputProps?.required !== void 0) {
|
|
185
|
+
isRequired = fieldConfigItem.inputProps.required;
|
|
186
|
+
}
|
|
187
|
+
if (overrideOptions) {
|
|
188
|
+
item = z__namespace.enum(overrideOptions);
|
|
189
|
+
}
|
|
190
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
191
|
+
form.FormField,
|
|
192
|
+
{
|
|
193
|
+
control: form$1.control,
|
|
194
|
+
name: key,
|
|
195
|
+
render: ({ field }) => {
|
|
196
|
+
const inputType = fieldConfigItem.fieldType ?? config.DEFAULT_ZOD_HANDLERS[zodBaseType] ?? "fallback";
|
|
197
|
+
const InputComponent = typeof inputType === "function" ? inputType : config.INPUT_COMPONENTS[inputType];
|
|
198
|
+
const ParentElement = fieldConfigItem.renderParent ?? DefaultParent;
|
|
199
|
+
const defaultValue = fieldConfigItem.inputProps?.defaultValue;
|
|
200
|
+
const value = field.value ?? defaultValue ?? "";
|
|
201
|
+
const { defaultValue: _omitDV, ...safeInputProps } = fieldConfigItem.inputProps ?? {};
|
|
202
|
+
const fieldProps = {
|
|
203
|
+
...helpers.zodToHtmlInputProps(item),
|
|
204
|
+
...field,
|
|
205
|
+
...safeInputProps,
|
|
206
|
+
disabled: safeInputProps.disabled || isDisabled,
|
|
207
|
+
ref: void 0,
|
|
208
|
+
value
|
|
209
|
+
};
|
|
210
|
+
if (InputComponent === void 0) {
|
|
211
|
+
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, {});
|
|
212
|
+
}
|
|
213
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ParentElement, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
214
|
+
InputComponent,
|
|
215
|
+
{
|
|
216
|
+
zodInputProps,
|
|
217
|
+
field,
|
|
218
|
+
fieldConfigItem,
|
|
219
|
+
label: itemName,
|
|
220
|
+
isRequired,
|
|
221
|
+
zodItem: item,
|
|
222
|
+
fieldProps,
|
|
223
|
+
className: fieldProps.className
|
|
224
|
+
}
|
|
225
|
+
) }, `${key}.parent`);
|
|
226
|
+
}
|
|
227
|
+
},
|
|
228
|
+
key
|
|
229
|
+
);
|
|
230
|
+
}) });
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
module.exports = AutoFormObject;
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
|
+
import { Accordion, AccordionItem, AccordionTrigger, AccordionContent } from '../../accordion.mjs';
|
|
3
|
+
import { FormField } from '../../form.mjs';
|
|
4
|
+
import { useFormContext } from 'react-hook-form';
|
|
5
|
+
import * as z from 'zod';
|
|
6
|
+
import { DEFAULT_ZOD_HANDLERS, INPUT_COMPONENTS } from '../config.mjs';
|
|
7
|
+
import { getBaseSchema, sortFieldsByOrder, getBaseType, beautifyObjectName, zodToHtmlInputProps } from '../helpers.mjs';
|
|
8
|
+
import AutoFormArray from './array.mjs';
|
|
9
|
+
import resolveDependencies from '../dependencies.mjs';
|
|
10
|
+
|
|
11
|
+
function DefaultParent({ children }) {
|
|
12
|
+
return /* @__PURE__ */ jsx(Fragment, { children });
|
|
13
|
+
}
|
|
14
|
+
function AutoFormObject({
|
|
15
|
+
schema,
|
|
16
|
+
form,
|
|
17
|
+
fieldConfig,
|
|
18
|
+
path = [],
|
|
19
|
+
dependencies = []
|
|
20
|
+
}) {
|
|
21
|
+
const { watch } = useFormContext();
|
|
22
|
+
if (!schema) {
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
const { shape } = getBaseSchema(schema) || {};
|
|
26
|
+
if (!shape) {
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
const handleIfZodNumber = (item) => {
|
|
30
|
+
const def = item._zod?.def;
|
|
31
|
+
const defType = def?.type;
|
|
32
|
+
const innerDefType = def?.innerType?._zod?.def?.type;
|
|
33
|
+
const isZodNumber = defType === "number" || defType === "int" || defType === "float";
|
|
34
|
+
const isInnerZodNumber = innerDefType === "number" || innerDefType === "int" || innerDefType === "float";
|
|
35
|
+
if (isZodNumber && def) {
|
|
36
|
+
def.coerce = true;
|
|
37
|
+
} else if (isInnerZodNumber && def?.innerType?._zod?.def) {
|
|
38
|
+
def.innerType._zod.def.coerce = true;
|
|
39
|
+
}
|
|
40
|
+
return item;
|
|
41
|
+
};
|
|
42
|
+
const sortedFieldKeys = sortFieldsByOrder(fieldConfig, Object.keys(shape));
|
|
43
|
+
return /* @__PURE__ */ jsx(Accordion, { type: "multiple", className: "space-y-5 border-none", children: sortedFieldKeys.map((name) => {
|
|
44
|
+
let item = shape[name];
|
|
45
|
+
item = handleIfZodNumber(item);
|
|
46
|
+
const zodBaseType = getBaseType(item);
|
|
47
|
+
const itemName = beautifyObjectName(name);
|
|
48
|
+
const key = [...path, name].join(".");
|
|
49
|
+
const {
|
|
50
|
+
isHidden,
|
|
51
|
+
isDisabled,
|
|
52
|
+
isRequired: isRequiredByDependency,
|
|
53
|
+
overrideOptions
|
|
54
|
+
} = resolveDependencies(dependencies, name, watch);
|
|
55
|
+
if (isHidden) {
|
|
56
|
+
return null;
|
|
57
|
+
}
|
|
58
|
+
if (zodBaseType === "ZodObject") {
|
|
59
|
+
const objectFieldConfig = fieldConfig?.[name] ?? {};
|
|
60
|
+
if (typeof objectFieldConfig.fieldType === "function") {
|
|
61
|
+
const zodInputProps2 = zodToHtmlInputProps(item);
|
|
62
|
+
let isRequired2 = isRequiredByDependency || zodInputProps2.required || false;
|
|
63
|
+
if (objectFieldConfig.inputProps?.required !== void 0) {
|
|
64
|
+
isRequired2 = objectFieldConfig.inputProps.required;
|
|
65
|
+
}
|
|
66
|
+
const CustomComponent = objectFieldConfig.fieldType;
|
|
67
|
+
const ParentElement = objectFieldConfig.renderParent ?? DefaultParent;
|
|
68
|
+
return /* @__PURE__ */ jsx(
|
|
69
|
+
FormField,
|
|
70
|
+
{
|
|
71
|
+
control: form.control,
|
|
72
|
+
name: key,
|
|
73
|
+
render: ({ field }) => {
|
|
74
|
+
const fieldProps = {
|
|
75
|
+
...zodInputProps2,
|
|
76
|
+
...field,
|
|
77
|
+
...objectFieldConfig.inputProps,
|
|
78
|
+
disabled: objectFieldConfig.inputProps?.disabled || isDisabled,
|
|
79
|
+
ref: void 0,
|
|
80
|
+
value: field.value
|
|
81
|
+
};
|
|
82
|
+
return /* @__PURE__ */ jsx(ParentElement, { children: /* @__PURE__ */ jsx(
|
|
83
|
+
CustomComponent,
|
|
84
|
+
{
|
|
85
|
+
zodInputProps: zodInputProps2,
|
|
86
|
+
field,
|
|
87
|
+
fieldConfigItem: objectFieldConfig,
|
|
88
|
+
label: objectFieldConfig.label || itemName,
|
|
89
|
+
isRequired: isRequired2,
|
|
90
|
+
zodItem: item,
|
|
91
|
+
fieldProps
|
|
92
|
+
}
|
|
93
|
+
) }, `${key}.parent`);
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
key
|
|
97
|
+
);
|
|
98
|
+
}
|
|
99
|
+
return /* @__PURE__ */ jsxs(AccordionItem, { value: name, className: "border-none", children: [
|
|
100
|
+
/* @__PURE__ */ jsx(AccordionTrigger, { children: itemName }),
|
|
101
|
+
/* @__PURE__ */ jsx(AccordionContent, { className: "p-2", children: /* @__PURE__ */ jsx(
|
|
102
|
+
AutoFormObject,
|
|
103
|
+
{
|
|
104
|
+
schema: item,
|
|
105
|
+
form,
|
|
106
|
+
fieldConfig: fieldConfig?.[name] ?? {},
|
|
107
|
+
path: [...path, name]
|
|
108
|
+
}
|
|
109
|
+
) })
|
|
110
|
+
] }, key);
|
|
111
|
+
}
|
|
112
|
+
if (zodBaseType === "ZodArray") {
|
|
113
|
+
const arrayFieldConfig = fieldConfig?.[name] ?? {};
|
|
114
|
+
if (typeof arrayFieldConfig.fieldType === "function") {
|
|
115
|
+
const zodInputProps2 = zodToHtmlInputProps(item);
|
|
116
|
+
let isRequired2 = isRequiredByDependency || zodInputProps2.required || false;
|
|
117
|
+
if (arrayFieldConfig.inputProps?.required !== void 0) {
|
|
118
|
+
isRequired2 = arrayFieldConfig.inputProps.required;
|
|
119
|
+
}
|
|
120
|
+
const CustomComponent = arrayFieldConfig.fieldType;
|
|
121
|
+
const ParentElement = arrayFieldConfig.renderParent ?? DefaultParent;
|
|
122
|
+
return /* @__PURE__ */ jsx(
|
|
123
|
+
FormField,
|
|
124
|
+
{
|
|
125
|
+
control: form.control,
|
|
126
|
+
name: key,
|
|
127
|
+
render: ({ field }) => {
|
|
128
|
+
const fieldProps = {
|
|
129
|
+
...zodInputProps2,
|
|
130
|
+
...field,
|
|
131
|
+
...arrayFieldConfig.inputProps,
|
|
132
|
+
disabled: arrayFieldConfig.inputProps?.disabled || isDisabled,
|
|
133
|
+
ref: void 0,
|
|
134
|
+
value: field.value
|
|
135
|
+
};
|
|
136
|
+
return /* @__PURE__ */ jsx(ParentElement, { children: /* @__PURE__ */ jsx(
|
|
137
|
+
CustomComponent,
|
|
138
|
+
{
|
|
139
|
+
zodInputProps: zodInputProps2,
|
|
140
|
+
field,
|
|
141
|
+
fieldConfigItem: arrayFieldConfig,
|
|
142
|
+
label: arrayFieldConfig.label || itemName,
|
|
143
|
+
isRequired: isRequired2,
|
|
144
|
+
zodItem: item,
|
|
145
|
+
fieldProps
|
|
146
|
+
}
|
|
147
|
+
) }, `${key}.parent`);
|
|
148
|
+
}
|
|
149
|
+
},
|
|
150
|
+
key
|
|
151
|
+
);
|
|
152
|
+
}
|
|
153
|
+
return /* @__PURE__ */ jsx(
|
|
154
|
+
AutoFormArray,
|
|
155
|
+
{
|
|
156
|
+
name,
|
|
157
|
+
item,
|
|
158
|
+
form,
|
|
159
|
+
fieldConfig: arrayFieldConfig,
|
|
160
|
+
path: [...path, name]
|
|
161
|
+
},
|
|
162
|
+
key
|
|
163
|
+
);
|
|
164
|
+
}
|
|
165
|
+
const fieldConfigItem = fieldConfig?.[name] ?? {};
|
|
166
|
+
const zodInputProps = zodToHtmlInputProps(item);
|
|
167
|
+
let isRequired = isRequiredByDependency || zodInputProps.required || false;
|
|
168
|
+
if (fieldConfigItem.inputProps?.required !== void 0) {
|
|
169
|
+
isRequired = fieldConfigItem.inputProps.required;
|
|
170
|
+
}
|
|
171
|
+
if (overrideOptions) {
|
|
172
|
+
item = z.enum(overrideOptions);
|
|
173
|
+
}
|
|
174
|
+
return /* @__PURE__ */ jsx(
|
|
175
|
+
FormField,
|
|
176
|
+
{
|
|
177
|
+
control: form.control,
|
|
178
|
+
name: key,
|
|
179
|
+
render: ({ field }) => {
|
|
180
|
+
const inputType = fieldConfigItem.fieldType ?? DEFAULT_ZOD_HANDLERS[zodBaseType] ?? "fallback";
|
|
181
|
+
const InputComponent = typeof inputType === "function" ? inputType : INPUT_COMPONENTS[inputType];
|
|
182
|
+
const ParentElement = fieldConfigItem.renderParent ?? DefaultParent;
|
|
183
|
+
const defaultValue = fieldConfigItem.inputProps?.defaultValue;
|
|
184
|
+
const value = field.value ?? defaultValue ?? "";
|
|
185
|
+
const { defaultValue: _omitDV, ...safeInputProps } = fieldConfigItem.inputProps ?? {};
|
|
186
|
+
const fieldProps = {
|
|
187
|
+
...zodToHtmlInputProps(item),
|
|
188
|
+
...field,
|
|
189
|
+
...safeInputProps,
|
|
190
|
+
disabled: safeInputProps.disabled || isDisabled,
|
|
191
|
+
ref: void 0,
|
|
192
|
+
value
|
|
193
|
+
};
|
|
194
|
+
if (InputComponent === void 0) {
|
|
195
|
+
return /* @__PURE__ */ jsx(Fragment, {});
|
|
196
|
+
}
|
|
197
|
+
return /* @__PURE__ */ jsx(ParentElement, { children: /* @__PURE__ */ jsx(
|
|
198
|
+
InputComponent,
|
|
199
|
+
{
|
|
200
|
+
zodInputProps,
|
|
201
|
+
field,
|
|
202
|
+
fieldConfigItem,
|
|
203
|
+
label: itemName,
|
|
204
|
+
isRequired,
|
|
205
|
+
zodItem: item,
|
|
206
|
+
fieldProps,
|
|
207
|
+
className: fieldProps.className
|
|
208
|
+
}
|
|
209
|
+
) }, `${key}.parent`);
|
|
210
|
+
}
|
|
211
|
+
},
|
|
212
|
+
key
|
|
213
|
+
);
|
|
214
|
+
}) });
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
export { AutoFormObject as default };
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
const form = require('../../form.cjs');
|
|
5
|
+
const radioGroup = require('../../radio-group.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 AutoFormRadioGroup({
|
|
24
|
+
label: label$1,
|
|
25
|
+
isRequired,
|
|
26
|
+
field,
|
|
27
|
+
zodItem,
|
|
28
|
+
fieldProps,
|
|
29
|
+
fieldConfigItem
|
|
30
|
+
}) {
|
|
31
|
+
const baseSchema = helpers.getBaseSchema(zodItem);
|
|
32
|
+
const values = getEnumValues(baseSchema);
|
|
33
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
34
|
+
/* @__PURE__ */ jsxRuntime.jsxs(form.FormItem, { children: [
|
|
35
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
36
|
+
label,
|
|
37
|
+
{
|
|
38
|
+
label: fieldConfigItem?.label || label$1,
|
|
39
|
+
isRequired
|
|
40
|
+
}
|
|
41
|
+
),
|
|
42
|
+
/* @__PURE__ */ jsxRuntime.jsx(form.FormControl, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
43
|
+
radioGroup.RadioGroup,
|
|
44
|
+
{
|
|
45
|
+
onValueChange: field.onChange,
|
|
46
|
+
defaultValue: field.value,
|
|
47
|
+
...fieldProps,
|
|
48
|
+
children: values?.map((value) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
49
|
+
form.FormItem,
|
|
50
|
+
{
|
|
51
|
+
className: "mb-2 flex items-center gap-3 space-y-0",
|
|
52
|
+
children: [
|
|
53
|
+
/* @__PURE__ */ jsxRuntime.jsx(form.FormControl, { children: /* @__PURE__ */ jsxRuntime.jsx(radioGroup.RadioGroupItem, { value }) }),
|
|
54
|
+
/* @__PURE__ */ jsxRuntime.jsx(form.FormLabel, { className: "font-normal", children: value })
|
|
55
|
+
]
|
|
56
|
+
},
|
|
57
|
+
value
|
|
58
|
+
))
|
|
59
|
+
}
|
|
60
|
+
) }),
|
|
61
|
+
/* @__PURE__ */ jsxRuntime.jsx(form.FormMessage, {})
|
|
62
|
+
] }),
|
|
63
|
+
/* @__PURE__ */ jsxRuntime.jsx(tooltip, { fieldConfigItem })
|
|
64
|
+
] });
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
module.exports = AutoFormRadioGroup;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { FormItem, FormControl, FormLabel, FormMessage } from '../../form.mjs';
|
|
3
|
+
import { RadioGroup, RadioGroupItem } from '../../radio-group.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 AutoFormRadioGroup({
|
|
22
|
+
label,
|
|
23
|
+
isRequired,
|
|
24
|
+
field,
|
|
25
|
+
zodItem,
|
|
26
|
+
fieldProps,
|
|
27
|
+
fieldConfigItem
|
|
28
|
+
}) {
|
|
29
|
+
const baseSchema = getBaseSchema(zodItem);
|
|
30
|
+
const values = getEnumValues(baseSchema);
|
|
31
|
+
return /* @__PURE__ */ jsxs("div", { children: [
|
|
32
|
+
/* @__PURE__ */ jsxs(FormItem, { children: [
|
|
33
|
+
/* @__PURE__ */ jsx(
|
|
34
|
+
AutoFormLabel,
|
|
35
|
+
{
|
|
36
|
+
label: fieldConfigItem?.label || label,
|
|
37
|
+
isRequired
|
|
38
|
+
}
|
|
39
|
+
),
|
|
40
|
+
/* @__PURE__ */ jsx(FormControl, { children: /* @__PURE__ */ jsx(
|
|
41
|
+
RadioGroup,
|
|
42
|
+
{
|
|
43
|
+
onValueChange: field.onChange,
|
|
44
|
+
defaultValue: field.value,
|
|
45
|
+
...fieldProps,
|
|
46
|
+
children: values?.map((value) => /* @__PURE__ */ jsxs(
|
|
47
|
+
FormItem,
|
|
48
|
+
{
|
|
49
|
+
className: "mb-2 flex items-center gap-3 space-y-0",
|
|
50
|
+
children: [
|
|
51
|
+
/* @__PURE__ */ jsx(FormControl, { children: /* @__PURE__ */ jsx(RadioGroupItem, { value }) }),
|
|
52
|
+
/* @__PURE__ */ jsx(FormLabel, { className: "font-normal", children: value })
|
|
53
|
+
]
|
|
54
|
+
},
|
|
55
|
+
value
|
|
56
|
+
))
|
|
57
|
+
}
|
|
58
|
+
) }),
|
|
59
|
+
/* @__PURE__ */ jsx(FormMessage, {})
|
|
60
|
+
] }),
|
|
61
|
+
/* @__PURE__ */ jsx(AutoFormTooltip, { fieldConfigItem })
|
|
62
|
+
] });
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export { AutoFormRadioGroup as default };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
const form = require('../../form.cjs');
|
|
5
|
+
const _switch = require('../../switch.cjs');
|
|
6
|
+
const label = require('../common/label.cjs');
|
|
7
|
+
const tooltip = require('../common/tooltip.cjs');
|
|
8
|
+
|
|
9
|
+
function AutoFormSwitch({
|
|
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: "flex items-center gap-3", children: [
|
|
18
|
+
/* @__PURE__ */ jsxRuntime.jsx(form.FormControl, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
19
|
+
_switch.Switch,
|
|
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 = AutoFormSwitch;
|