autoforma 1.0.54 → 1.0.56
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/AutoForm/AutoForm.d.ts +16 -2
- package/dist/components/AutoForm/AutoForm.types.d.ts +11 -0
- package/dist/index.cjs.js +21 -21
- package/dist/index.d.ts +1 -1
- package/dist/index.es.js +2103 -2088
- package/package.json +1 -1
|
@@ -1,3 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare
|
|
1
|
+
import { AutoFormRef } from './AutoForm.types';
|
|
2
|
+
export declare const AutoForm: import('react').ForwardRefExoticComponent<import('../../fields/renderer.types').CustomRenderersConfig<Record<string, any>> & {
|
|
3
|
+
schema: import('../..').FieldSchema<Record<string, any>>[];
|
|
4
|
+
values?: Partial<Record<string, any>> | undefined;
|
|
5
|
+
getInitialValues?: (() => Partial<Record<string, any>> | Promise<Partial<Record<string, any>>>) | undefined;
|
|
6
|
+
onSubmit: (values: Record<string, any>) => void | Promise<void>;
|
|
7
|
+
transformBeforeSubmit?: ((values: Record<string, any>) => Record<string, any> | Promise<Record<string, any>>) | undefined;
|
|
8
|
+
transformAfterSubmit?: ((values: Record<string, any>) => void | Promise<void>) | undefined;
|
|
9
|
+
validate?: import('@mantine/form').FormValidateInput<Record<string, any>> | undefined;
|
|
10
|
+
readOnly?: boolean;
|
|
11
|
+
onFieldChange?: import('./AutoForm.types').OnFieldChangeMap<Record<string, any>> | undefined;
|
|
12
|
+
layout?: "vertical" | "horizontal" | "grid";
|
|
13
|
+
updateFieldSchema?: import('./AutoForm.types').UpdateFieldSchemaMap<Record<string, any>> | undefined;
|
|
14
|
+
submitButton?: boolean | React.ReactNode;
|
|
15
|
+
loading?: boolean;
|
|
16
|
+
} & import('react').RefAttributes<AutoFormRef<Record<string, any>>>>;
|
|
3
17
|
export default AutoForm;
|
|
@@ -22,3 +22,14 @@ export type UpdateFieldSchemaMap<TValues extends Record<string, any> = Record<st
|
|
|
22
22
|
export type OnFieldChangeMap<TValues extends Record<string, any> = Record<string, any>> = {
|
|
23
23
|
[K in keyof TValues]?: (value: TValues[K], form: UseFormReturnType<TValues>) => void | Promise<void>;
|
|
24
24
|
};
|
|
25
|
+
export interface AutoFormRef<TValues extends Record<string, any> = Record<string, any>> {
|
|
26
|
+
submit: () => void;
|
|
27
|
+
reset: (values?: Partial<TValues>) => void;
|
|
28
|
+
validate: () => boolean;
|
|
29
|
+
getValues: () => TValues;
|
|
30
|
+
setValues: (values: Partial<TValues>) => void;
|
|
31
|
+
getFieldValue: (path: string) => any;
|
|
32
|
+
setFieldValue: (path: string, value: any) => void;
|
|
33
|
+
isValid: () => boolean;
|
|
34
|
+
isDirty: () => boolean;
|
|
35
|
+
}
|