autoforma 2.9.91 → 2.9.93
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/autoform/context/AutoFormRenderContext.d.ts +5 -5
- package/dist/autoform/context/useAutoFormRenderContext.d.ts +1 -1
- package/dist/autoform/core/AutoForm.d.ts +1 -1
- package/dist/autoform/fields/DefaultInput.d.ts +1 -1
- package/dist/autoform/fields/DefaultSelect.d.ts +1 -1
- package/dist/autoform/layouts/FieldLayout.d.ts +1 -1
- package/dist/autoform/render/FieldRenderer.d.ts +1 -1
- package/dist/autoform/render/SchemaRenderer.d.ts +3 -3
- package/dist/autoform/render/UnWatchedField.d.ts +1 -1
- package/dist/autoform/render/WatchedField.d.ts +1 -1
- package/dist/autoform/render/Watcher.d.ts +1 -1
- package/dist/autoform/types.d.ts +53 -36
- package/dist/autoform/utils/generateInitialValues.d.ts +1 -1
- package/dist/autoform/utils/getDefaultValueForField.d.ts +2 -2
- package/dist/autoform/utils/makeSchemaReadOnly.d.ts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.es.js +108 -112
- package/package.json +1 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { PropsWithChildren } from 'react';
|
|
2
2
|
import { Layout, UiConfig, UpdateFieldSchema } from '../types';
|
|
3
|
-
export interface AutoFormRenderContextProps
|
|
3
|
+
export interface AutoFormRenderContextProps {
|
|
4
4
|
layout?: Layout;
|
|
5
|
-
uiConfig?: UiConfig
|
|
6
|
-
updateFieldSchema?: UpdateFieldSchema
|
|
5
|
+
uiConfig?: UiConfig;
|
|
6
|
+
updateFieldSchema?: UpdateFieldSchema;
|
|
7
7
|
}
|
|
8
|
-
export declare const AutoFormRenderContext: import('react').Context<AutoFormRenderContextProps
|
|
9
|
-
export declare const AutoFormRenderContextProvider:
|
|
8
|
+
export declare const AutoFormRenderContext: import('react').Context<AutoFormRenderContextProps | null>;
|
|
9
|
+
export declare const AutoFormRenderContextProvider: ({ children, layout, uiConfig, updateFieldSchema, }: PropsWithChildren<AutoFormRenderContextProps>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { AutoFormRenderContextProps } from './AutoFormRenderContext';
|
|
2
|
-
export declare const useAutoFormRenderContext:
|
|
2
|
+
export declare const useAutoFormRenderContext: () => AutoFormRenderContextProps;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { FormProps, FormRef } from '../types';
|
|
3
|
-
type AutoFormComponent =
|
|
3
|
+
type AutoFormComponent = (props: FormProps & React.RefAttributes<FormRef>) => React.ReactElement;
|
|
4
4
|
declare const AutoForm: AutoFormComponent;
|
|
5
5
|
export default AutoForm;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { FieldProps } from '../types';
|
|
2
|
-
declare const DefaultInput:
|
|
2
|
+
declare const DefaultInput: (props: FieldProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default DefaultInput;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { FieldProps } from '../types';
|
|
2
|
-
declare const DefaultSelect: <TCustom extends string = never>(props: FieldProps
|
|
2
|
+
declare const DefaultSelect: <TCustom extends string = never>(props: FieldProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default DefaultSelect;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { FieldProps } from '../types';
|
|
2
|
-
declare const FieldLayout:
|
|
2
|
+
declare const FieldLayout: (props: FieldProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default FieldLayout;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { FieldProps } from '../types';
|
|
2
|
-
declare const FieldRenderer: <TCustom extends string = never>({ fieldSchema }: FieldProps
|
|
2
|
+
declare const FieldRenderer: <TCustom extends string = never>({ fieldSchema }: FieldProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
3
3
|
export default FieldRenderer;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { Schema } from '../types';
|
|
3
|
-
interface SchemaRendererProps
|
|
4
|
-
schema: Schema
|
|
3
|
+
interface SchemaRendererProps {
|
|
4
|
+
schema: Schema;
|
|
5
5
|
}
|
|
6
|
-
declare const SchemaRenderer: React.MemoExoticComponent<(
|
|
6
|
+
declare const SchemaRenderer: React.MemoExoticComponent<(props: SchemaRendererProps) => import("react/jsx-runtime").JSX.Element[]>;
|
|
7
7
|
export default SchemaRenderer;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { FieldProps } from '../types';
|
|
2
|
-
declare const UnWatchedField:
|
|
2
|
+
declare const UnWatchedField: ({ fieldSchema }: FieldProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default UnWatchedField;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { FieldProps } from '../types';
|
|
2
|
-
declare const WatchedField:
|
|
2
|
+
declare const WatchedField: ({ fieldSchema }: FieldProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default WatchedField;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { FieldProps } from '../types';
|
|
2
|
-
declare const Watcher:
|
|
2
|
+
declare const Watcher: (props: FieldProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default Watcher;
|
package/dist/autoform/types.d.ts
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { Control, Resolver, UseFormRegisterReturn } from 'react-hook-form';
|
|
3
3
|
export type FormValues = Record<string, any>;
|
|
4
|
-
export
|
|
5
|
-
|
|
6
|
-
export interface BaseFieldSchema<TCustom extends string = never> {
|
|
7
|
-
type: FieldType<TCustom>;
|
|
4
|
+
export interface BaseFieldSchema {
|
|
5
|
+
type: string;
|
|
8
6
|
name: string;
|
|
9
7
|
label: string;
|
|
10
8
|
dependsOn?: string[];
|
|
@@ -13,53 +11,73 @@ export interface BaseFieldSchema<TCustom extends string = never> {
|
|
|
13
11
|
readonly?: boolean;
|
|
14
12
|
meta?: Record<string, any>;
|
|
15
13
|
}
|
|
16
|
-
export
|
|
17
|
-
|
|
14
|
+
export type BuiltInFieldType = 'text' | 'number' | 'checkbox' | 'select' | 'date' | 'datetime-local' | 'time' | 'array' | 'object';
|
|
15
|
+
export interface TextFieldSchema extends BaseFieldSchema {
|
|
16
|
+
type: 'text';
|
|
18
17
|
}
|
|
19
|
-
export interface
|
|
20
|
-
type: '
|
|
18
|
+
export interface NumberFieldSchema extends BaseFieldSchema {
|
|
19
|
+
type: 'number';
|
|
21
20
|
}
|
|
22
|
-
export interface
|
|
23
|
-
type: '
|
|
21
|
+
export interface CheckboxFieldSchema extends BaseFieldSchema {
|
|
22
|
+
type: 'checkbox';
|
|
23
|
+
}
|
|
24
|
+
export interface DateFieldSchema extends BaseFieldSchema {
|
|
25
|
+
type: 'date';
|
|
26
|
+
}
|
|
27
|
+
export interface DateTimeLocalFieldSchema extends BaseFieldSchema {
|
|
28
|
+
type: 'datetime-local';
|
|
24
29
|
}
|
|
25
|
-
export interface
|
|
30
|
+
export interface TimeFieldSchema extends BaseFieldSchema {
|
|
31
|
+
type: 'time';
|
|
32
|
+
}
|
|
33
|
+
export interface SelectFieldSchema extends BaseFieldSchema {
|
|
26
34
|
type: 'select';
|
|
27
35
|
options: {
|
|
28
36
|
label: string;
|
|
29
37
|
value: string;
|
|
30
38
|
}[];
|
|
31
39
|
}
|
|
32
|
-
export interface
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
40
|
+
export interface ArrayFieldSchema extends BaseFieldSchema {
|
|
41
|
+
type: 'array';
|
|
42
|
+
fields: FieldSchema[];
|
|
43
|
+
}
|
|
44
|
+
export interface ObjectFieldSchema extends BaseFieldSchema {
|
|
45
|
+
type: 'object';
|
|
46
|
+
fields: FieldSchema[];
|
|
47
|
+
}
|
|
48
|
+
export interface FieldSchemaRegistry {
|
|
49
|
+
text: TextFieldSchema;
|
|
50
|
+
number: NumberFieldSchema;
|
|
51
|
+
checkbox: CheckboxFieldSchema;
|
|
52
|
+
select: SelectFieldSchema;
|
|
53
|
+
date: DateFieldSchema;
|
|
54
|
+
'datetime-local': DateTimeLocalFieldSchema;
|
|
55
|
+
time: TimeFieldSchema;
|
|
56
|
+
array: ArrayFieldSchema;
|
|
57
|
+
object: ObjectFieldSchema;
|
|
38
58
|
}
|
|
39
|
-
type
|
|
40
|
-
type
|
|
41
|
-
export type
|
|
42
|
-
|
|
43
|
-
export type UpdateFieldSchema<TCustom extends string = never> = {
|
|
44
|
-
[key: string]: (path: string, fieldSchema: FieldSchema<TCustom>, values: FormValues) => FieldSchema<TCustom> | Promise<FieldSchema<TCustom>>;
|
|
59
|
+
export type FieldSchema = FieldSchemaRegistry[keyof FieldSchemaRegistry];
|
|
60
|
+
export type Schema = FieldSchema[];
|
|
61
|
+
export type UpdateFieldSchema = {
|
|
62
|
+
[key: string]: (path: string, fieldSchema: FieldSchema, values: FormValues) => FieldSchema | Promise<FieldSchema>;
|
|
45
63
|
};
|
|
46
|
-
export type CustomFieldRendererProps
|
|
47
|
-
fieldSchema: FieldSchema
|
|
64
|
+
export type CustomFieldRendererProps = {
|
|
65
|
+
fieldSchema: FieldSchema;
|
|
48
66
|
register: UseFormRegisterReturn<string>;
|
|
49
67
|
control: Control<FormValues>;
|
|
50
68
|
};
|
|
51
|
-
export type CustomRender
|
|
52
|
-
export type UiConfig
|
|
53
|
-
renderersByName?: CustomRender
|
|
54
|
-
renderersByType?: CustomRender
|
|
69
|
+
export type CustomRender = Record<string, React.ComponentType<CustomFieldRendererProps>>;
|
|
70
|
+
export type UiConfig = {
|
|
71
|
+
renderersByName?: CustomRender;
|
|
72
|
+
renderersByType?: CustomRender;
|
|
55
73
|
};
|
|
56
74
|
export type Layout = 'vertical' | 'horizontal' | 'custom';
|
|
57
|
-
export interface FormProps
|
|
58
|
-
schema: Schema
|
|
75
|
+
export interface FormProps {
|
|
76
|
+
schema: Schema;
|
|
59
77
|
onSubmit: (values: FormValues) => void;
|
|
60
78
|
layout?: Layout;
|
|
61
|
-
uiConfig?: UiConfig
|
|
62
|
-
updateFieldSchema?: UpdateFieldSchema
|
|
79
|
+
uiConfig?: UiConfig;
|
|
80
|
+
updateFieldSchema?: UpdateFieldSchema;
|
|
63
81
|
values?: () => FormValues | Promise<FormValues>;
|
|
64
82
|
hideSubmit?: boolean;
|
|
65
83
|
onDirtyChange?: (isDirty: boolean) => void;
|
|
@@ -75,7 +93,6 @@ export interface FormRef {
|
|
|
75
93
|
getValues: () => FormValues;
|
|
76
94
|
reset: (values: FormValues) => void;
|
|
77
95
|
}
|
|
78
|
-
export interface FieldProps
|
|
79
|
-
fieldSchema: FieldSchema
|
|
96
|
+
export interface FieldProps {
|
|
97
|
+
fieldSchema: FieldSchema;
|
|
80
98
|
}
|
|
81
|
-
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { FormValues, Schema } from '../types';
|
|
2
|
-
export declare function generateInitialValues<TValues extends FormValues = Record<string, any>, TCustom extends string = never>(schema: Schema
|
|
2
|
+
export declare function generateInitialValues<TValues extends FormValues = Record<string, any>, TCustom extends string = never>(schema: Schema, initialValues?: Partial<TValues>): TValues;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare function getDefaultValueForField<TCustom extends string = never>(type:
|
|
1
|
+
import { BuiltInFieldType } from '../types';
|
|
2
|
+
export declare function getDefaultValueForField<TCustom extends string = never>(type: BuiltInFieldType): any;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { Schema } from '../types';
|
|
2
|
-
export declare function makeSchemaReadOnly<TCustom extends string = never>(schema: Schema
|
|
2
|
+
export declare function makeSchemaReadOnly<TCustom extends string = never>(schema: Schema): Schema;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { default as AutoForm } from './autoform/core/AutoForm';
|
|
2
|
-
export type { FieldSchema, Schema,
|
|
2
|
+
export type { FieldSchema, Schema, Layout, FormProps, FormRef, UiConfig, UpdateFieldSchema, CustomRender, CustomFieldRendererProps, BaseFieldSchema, } from './autoform/types';
|
|
3
3
|
export * from './autoform/utils';
|
|
4
4
|
export { default as SchemaRenderer } from './autoform/render/SchemaRenderer';
|
package/dist/index.es.js
CHANGED
|
@@ -1513,12 +1513,10 @@ const Vr = R.memo((e) => {
|
|
|
1513
1513
|
}, Sr = (e) => {
|
|
1514
1514
|
const { fieldSchema: r } = e;
|
|
1515
1515
|
return /* @__PURE__ */ V.jsx(kr, { fieldSchema: r });
|
|
1516
|
-
}, Le = R.memo(
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
}
|
|
1521
|
-
);
|
|
1516
|
+
}, Le = R.memo((e) => {
|
|
1517
|
+
const { schema: r } = e;
|
|
1518
|
+
return r.map((t) => /* @__PURE__ */ V.jsx(Sr, { fieldSchema: t }, t.name));
|
|
1519
|
+
});
|
|
1522
1520
|
function Tr(e, r) {
|
|
1523
1521
|
const t = (i) => /^\d+$/.test(i), n = e.split(".");
|
|
1524
1522
|
let o = r;
|
|
@@ -1554,115 +1552,113 @@ const Or = (e) => {
|
|
|
1554
1552
|
onDirtyChange: r,
|
|
1555
1553
|
onValuesChange: e,
|
|
1556
1554
|
onFieldChange: t
|
|
1557
|
-
}), null), Pr = R.forwardRef(
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
reset
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
setValue
|
|
1610
|
-
|
|
1555
|
+
}), null), Pr = R.forwardRef((e, r) => {
|
|
1556
|
+
const {
|
|
1557
|
+
schema: t,
|
|
1558
|
+
onSubmit: n,
|
|
1559
|
+
uiConfig: o = {
|
|
1560
|
+
renderersByName: {},
|
|
1561
|
+
renderersByType: {}
|
|
1562
|
+
},
|
|
1563
|
+
updateFieldSchema: i = {},
|
|
1564
|
+
layout: u = "vertical",
|
|
1565
|
+
values: f = () => ({}),
|
|
1566
|
+
hideSubmit: F = !1,
|
|
1567
|
+
onDirtyChange: A = () => {
|
|
1568
|
+
},
|
|
1569
|
+
onValuesChange: T = () => {
|
|
1570
|
+
},
|
|
1571
|
+
resolver: x,
|
|
1572
|
+
readonly: p,
|
|
1573
|
+
onFieldChange: b = {},
|
|
1574
|
+
loadingComponent: B
|
|
1575
|
+
} = e, O = hr({
|
|
1576
|
+
reValidateMode: "onSubmit",
|
|
1577
|
+
criteriaMode: "all",
|
|
1578
|
+
resolver: x
|
|
1579
|
+
}), W = Et(!1), [$, E] = xt(!1), G = O.handleSubmit(n), C = ve(() => {
|
|
1580
|
+
let N = t;
|
|
1581
|
+
return p && (N = Ct(N)), N;
|
|
1582
|
+
}, [p, t]);
|
|
1583
|
+
Ce(() => {
|
|
1584
|
+
if (!f) return;
|
|
1585
|
+
let N = !1;
|
|
1586
|
+
return (async () => {
|
|
1587
|
+
if (W.current) return;
|
|
1588
|
+
E(!1);
|
|
1589
|
+
const fe = await f();
|
|
1590
|
+
N || (O.reset(Ne(t, fe), {
|
|
1591
|
+
keepErrors: !0,
|
|
1592
|
+
keepDirty: !1,
|
|
1593
|
+
keepTouched: !1
|
|
1594
|
+
}), W.current = !0, E(!0));
|
|
1595
|
+
})(), () => {
|
|
1596
|
+
N = !0;
|
|
1597
|
+
};
|
|
1598
|
+
}, [t, f]), Yt(r, () => ({
|
|
1599
|
+
submit: async () => {
|
|
1600
|
+
await O.handleSubmit(n)();
|
|
1601
|
+
},
|
|
1602
|
+
reset: (N) => {
|
|
1603
|
+
O.reset(N ? Ne(t, N) : void 0);
|
|
1604
|
+
},
|
|
1605
|
+
getValues: () => O.getValues(),
|
|
1606
|
+
setValue: (N, J) => {
|
|
1607
|
+
O.setValue(N, J);
|
|
1608
|
+
}
|
|
1609
|
+
}));
|
|
1610
|
+
const k = F || p, ee = ve(() => o, [o]), ce = ve(() => i, [i]), se = ve(
|
|
1611
|
+
() => ({
|
|
1612
|
+
layout: u,
|
|
1613
|
+
uiConfig: o,
|
|
1614
|
+
updateFieldSchema: i
|
|
1615
|
+
}),
|
|
1616
|
+
[u, o, i]
|
|
1617
|
+
);
|
|
1618
|
+
return $ ? /* @__PURE__ */ V.jsxs(Qt, { ...O, children: [
|
|
1619
|
+
/* @__PURE__ */ V.jsx(
|
|
1620
|
+
Dr,
|
|
1621
|
+
{
|
|
1622
|
+
onDirtyChange: A,
|
|
1623
|
+
onValuesChange: T,
|
|
1624
|
+
onFieldChange: b
|
|
1611
1625
|
}
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
layout: u,
|
|
1616
|
-
uiConfig: o,
|
|
1617
|
-
updateFieldSchema: i
|
|
1618
|
-
}),
|
|
1619
|
-
[u, o, i]
|
|
1620
|
-
);
|
|
1621
|
-
return $ ? /* @__PURE__ */ V.jsxs(Qt, { ...O, children: [
|
|
1622
|
-
/* @__PURE__ */ V.jsx(
|
|
1623
|
-
Dr,
|
|
1624
|
-
{
|
|
1625
|
-
onDirtyChange: A,
|
|
1626
|
-
onValuesChange: T,
|
|
1627
|
-
onFieldChange: b
|
|
1628
|
-
}
|
|
1629
|
-
),
|
|
1630
|
-
/* @__PURE__ */ V.jsxs(
|
|
1631
|
-
vr,
|
|
1632
|
-
{
|
|
1633
|
-
layout: se.layout,
|
|
1634
|
-
uiConfig: ee,
|
|
1635
|
-
updateFieldSchema: ce,
|
|
1636
|
-
children: [
|
|
1637
|
-
["vertical", "horizontal"].includes(u) && /* @__PURE__ */ V.jsx(
|
|
1638
|
-
"div",
|
|
1639
|
-
{
|
|
1640
|
-
style: {
|
|
1641
|
-
display: "flex",
|
|
1642
|
-
flexDirection: u === "vertical" ? "column" : "row"
|
|
1643
|
-
},
|
|
1644
|
-
children: /* @__PURE__ */ V.jsx(Le, { schema: C })
|
|
1645
|
-
}
|
|
1646
|
-
),
|
|
1647
|
-
u === "custom" && /* @__PURE__ */ V.jsx(Le, { schema: C }),
|
|
1648
|
-
!k && /* @__PURE__ */ V.jsx("button", { style: { marginTop: "1rem" }, onClick: G, children: "Submit" })
|
|
1649
|
-
]
|
|
1650
|
-
}
|
|
1651
|
-
)
|
|
1652
|
-
] }) : /* @__PURE__ */ V.jsx(V.Fragment, { children: B ?? /* @__PURE__ */ V.jsx(
|
|
1653
|
-
"div",
|
|
1626
|
+
),
|
|
1627
|
+
/* @__PURE__ */ V.jsxs(
|
|
1628
|
+
vr,
|
|
1654
1629
|
{
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1630
|
+
layout: se.layout,
|
|
1631
|
+
uiConfig: ee,
|
|
1632
|
+
updateFieldSchema: ce,
|
|
1633
|
+
children: [
|
|
1634
|
+
["vertical", "horizontal"].includes(u) && /* @__PURE__ */ V.jsx(
|
|
1635
|
+
"div",
|
|
1636
|
+
{
|
|
1637
|
+
style: {
|
|
1638
|
+
display: "flex",
|
|
1639
|
+
flexDirection: u === "vertical" ? "column" : "row"
|
|
1640
|
+
},
|
|
1641
|
+
children: /* @__PURE__ */ V.jsx(Le, { schema: C })
|
|
1642
|
+
}
|
|
1643
|
+
),
|
|
1644
|
+
u === "custom" && /* @__PURE__ */ V.jsx(Le, { schema: C }),
|
|
1645
|
+
!k && /* @__PURE__ */ V.jsx("button", { style: { marginTop: "1rem" }, onClick: G, children: "Submit" })
|
|
1646
|
+
]
|
|
1662
1647
|
}
|
|
1663
|
-
)
|
|
1664
|
-
}
|
|
1665
|
-
|
|
1648
|
+
)
|
|
1649
|
+
] }) : /* @__PURE__ */ V.jsx(V.Fragment, { children: B ?? /* @__PURE__ */ V.jsx(
|
|
1650
|
+
"div",
|
|
1651
|
+
{
|
|
1652
|
+
style: {
|
|
1653
|
+
padding: "2rem",
|
|
1654
|
+
textAlign: "center",
|
|
1655
|
+
color: "#666",
|
|
1656
|
+
fontSize: "0.9rem"
|
|
1657
|
+
},
|
|
1658
|
+
children: "Loading form..."
|
|
1659
|
+
}
|
|
1660
|
+
) });
|
|
1661
|
+
});
|
|
1666
1662
|
export {
|
|
1667
1663
|
Pr as AutoForm,
|
|
1668
1664
|
Le as SchemaRenderer,
|