autoforma 1.0.66 → 1.0.68
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 +3 -2
- package/dist/components/AutoForm/AutoForm.types.d.ts +4 -3
- package/dist/index.cjs.js +26 -26
- package/dist/index.es.js +1221 -1215
- package/package.json +1 -1
|
@@ -3,9 +3,10 @@ export declare const AutoForm: import('react').ForwardRefExoticComponent<import(
|
|
|
3
3
|
schema: (import('../..').FieldSchema<Record<string, any>> & Record<string, any>)[];
|
|
4
4
|
initialValues?: (() => Partial<Record<string, any>> | Promise<Partial<Record<string, any>>>) | undefined;
|
|
5
5
|
currentValues?: (() => Partial<Record<string, any>> | Promise<Partial<Record<string, any>>>) | undefined;
|
|
6
|
-
|
|
6
|
+
preFill?: ((values: Record<string, any>) => Record<string, any> | Promise<Record<string, any>>) | undefined;
|
|
7
|
+
preSubmit?: ((values: Record<string, any>) => Record<string, any> | Promise<Record<string, any>>) | undefined;
|
|
7
8
|
onSubmit: (values: Record<string, any>) => void | Promise<void>;
|
|
8
|
-
|
|
9
|
+
postSubmit?: ((values: Record<string, any>) => void | Promise<void>) | undefined;
|
|
9
10
|
validate?: import('@mantine/form').FormValidateInput<Record<string, any>> | undefined;
|
|
10
11
|
readOnly?: boolean;
|
|
11
12
|
onFieldChange?: import('./AutoForm.types').OnFieldChangeMap<Record<string, any>> | undefined;
|
|
@@ -6,9 +6,10 @@ export type AutoFormProps<TValues extends Record<string, any> = Record<string, a
|
|
|
6
6
|
schema: (FieldSchema<TValues> & Record<string, any>)[];
|
|
7
7
|
initialValues?: ValueProvider<TValues>;
|
|
8
8
|
currentValues?: ValueProvider<TValues>;
|
|
9
|
-
|
|
9
|
+
preFill?: (values: TValues) => TValues | Promise<TValues>;
|
|
10
|
+
preSubmit?: (values: TValues) => TValues | Promise<TValues>;
|
|
10
11
|
onSubmit: (values: TValues) => void | Promise<void>;
|
|
11
|
-
|
|
12
|
+
postSubmit?: (values: TValues) => void | Promise<void>;
|
|
12
13
|
validate?: FormValidateInput<TValues>;
|
|
13
14
|
readOnly?: boolean;
|
|
14
15
|
onFieldChange?: OnFieldChangeMap<TValues>;
|
|
@@ -21,7 +22,7 @@ export type UpdateFieldSchemaMap<TValues extends Record<string, any> = Record<st
|
|
|
21
22
|
[K in keyof TValues]?: (schema: FieldSchema<TValues>, values: TValues) => FieldSchema<TValues>;
|
|
22
23
|
};
|
|
23
24
|
export type OnFieldChangeMap<TValues extends Record<string, any> = Record<string, any>> = {
|
|
24
|
-
[K in keyof TValues]?: (value: TValues[K], form: UseFormReturnType<TValues>) => void | Promise<void>;
|
|
25
|
+
[K in keyof TValues]?: (path: string, value: TValues[K], form: UseFormReturnType<TValues>) => void | Promise<void>;
|
|
25
26
|
};
|
|
26
27
|
export interface AutoFormRef<TValues extends Record<string, any> = Record<string, any>> {
|
|
27
28
|
submit: () => void;
|