@canlooks/can-ui 0.0.175 → 0.0.176
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.
|
@@ -19,7 +19,7 @@ interface FormOwnProps<V extends FormValue = FormValue> extends FormSharedProps,
|
|
|
19
19
|
wrapperRef?: Ref<HTMLFormElement>;
|
|
20
20
|
initialValue?: V;
|
|
21
21
|
onChange?(field: FieldPath, value: any, formValue: V): void;
|
|
22
|
-
onFinish?(value: V):
|
|
22
|
+
onFinish?(value: V): any;
|
|
23
23
|
items?: (FormItemProps & Obj)[];
|
|
24
24
|
descriptionsProps?: DescriptionsProps;
|
|
25
25
|
}
|
|
@@ -39,8 +39,7 @@ declare const FormValueContext: React.Context<FormValueContext<any>>;
|
|
|
39
39
|
export declare function useFormValueContext<V extends FormValue>(): FormValueContext<V>;
|
|
40
40
|
export declare function useFormStyleContext(): FormSharedProps;
|
|
41
41
|
export type FormRef<V extends FormValue = FormValue> = {
|
|
42
|
-
|
|
43
|
-
submit(): Promise<V | null>;
|
|
42
|
+
submit(): Promise<V>;
|
|
44
43
|
getFieldValue<T = any>(field: FieldPath): T;
|
|
45
44
|
getFormValue(): V;
|
|
46
45
|
getFieldError(field: FieldPath): FieldError | undefined;
|
|
@@ -81,7 +81,7 @@ inline, columnCount = 1, gap, columnGap, rowGap, ...props }) => {
|
|
|
81
81
|
await Promise.all([...itemsContainer.current].map(async ([field, item]) => {
|
|
82
82
|
return await item.validate() || Promise.reject(new TypeError(`Invalid field: "${field}"`));
|
|
83
83
|
}));
|
|
84
|
-
onFinish?.(formValue.current);
|
|
84
|
+
await onFinish?.(formValue.current);
|
|
85
85
|
return formValue.current;
|
|
86
86
|
};
|
|
87
87
|
const formRef = (0, react_1.useRef)(null);
|
|
@@ -19,7 +19,7 @@ interface FormOwnProps<V extends FormValue = FormValue> extends FormSharedProps,
|
|
|
19
19
|
wrapperRef?: Ref<HTMLFormElement>;
|
|
20
20
|
initialValue?: V;
|
|
21
21
|
onChange?(field: FieldPath, value: any, formValue: V): void;
|
|
22
|
-
onFinish?(value: V):
|
|
22
|
+
onFinish?(value: V): any;
|
|
23
23
|
items?: (FormItemProps & Obj)[];
|
|
24
24
|
descriptionsProps?: DescriptionsProps;
|
|
25
25
|
}
|
|
@@ -39,8 +39,7 @@ declare const FormValueContext: React.Context<FormValueContext<any>>;
|
|
|
39
39
|
export declare function useFormValueContext<V extends FormValue>(): FormValueContext<V>;
|
|
40
40
|
export declare function useFormStyleContext(): FormSharedProps;
|
|
41
41
|
export type FormRef<V extends FormValue = FormValue> = {
|
|
42
|
-
|
|
43
|
-
submit(): Promise<V | null>;
|
|
42
|
+
submit(): Promise<V>;
|
|
44
43
|
getFieldValue<T = any>(field: FieldPath): T;
|
|
45
44
|
getFormValue(): V;
|
|
46
45
|
getFieldError(field: FieldPath): FieldError | undefined;
|
|
@@ -75,7 +75,7 @@ inline, columnCount = 1, gap, columnGap, rowGap, ...props }) => {
|
|
|
75
75
|
await Promise.all([...itemsContainer.current].map(async ([field, item]) => {
|
|
76
76
|
return await item.validate() || Promise.reject(new TypeError(`Invalid field: "${field}"`));
|
|
77
77
|
}));
|
|
78
|
-
onFinish?.(formValue.current);
|
|
78
|
+
await onFinish?.(formValue.current);
|
|
79
79
|
return formValue.current;
|
|
80
80
|
};
|
|
81
81
|
const formRef = useRef(null);
|