revdev-components 0.141.0 → 0.142.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/build/form/index.d.ts +2 -1
- package/build/index.js +3 -2
- package/package.json +1 -1
package/build/form/index.d.ts
CHANGED
|
@@ -11,10 +11,11 @@ export interface AppFormProps<T = any> {
|
|
|
11
11
|
onFinish?: (values: T) => void;
|
|
12
12
|
onValuesChange?: onValuesChangeType<T>;
|
|
13
13
|
onFieldsChange?: (changedFields: FieldData[], allFields: FieldData[]) => void;
|
|
14
|
+
onChange?: (values: T) => void;
|
|
14
15
|
form?: FormInstance;
|
|
15
16
|
onValid?: (valid: boolean) => void;
|
|
16
17
|
initialValues?: Partial<T>;
|
|
17
18
|
debug?: boolean;
|
|
18
19
|
}
|
|
19
|
-
export declare function AppForm<T extends object = any>({ form: propForm, children, className, onFinish, onValuesChange, onFieldsChange, onValid, initialValues, debug, }: AppFormProps<T>): React.ReactElement<AppFormProps<T>>;
|
|
20
|
+
export declare function AppForm<T extends object = any>({ form: propForm, children, className, onFinish, onValuesChange, onFieldsChange, onChange, onValid, initialValues, debug, }: AppFormProps<T>): React.ReactElement<AppFormProps<T>>;
|
|
20
21
|
export {};
|
package/build/index.js
CHANGED
|
@@ -4857,7 +4857,7 @@ function useForm(form) {
|
|
|
4857
4857
|
return form ? form : newForm;
|
|
4858
4858
|
}
|
|
4859
4859
|
function AppForm(_a) {
|
|
4860
|
-
var propForm = _a.form, children = _a.children, className = _a.className, onFinish = _a.onFinish, onValuesChange = _a.onValuesChange, onFieldsChange = _a.onFieldsChange, onValid = _a.onValid, initialValues = _a.initialValues, debug = _a.debug;
|
|
4860
|
+
var propForm = _a.form, children = _a.children, className = _a.className, onFinish = _a.onFinish, onValuesChange = _a.onValuesChange, onFieldsChange = _a.onFieldsChange, onChange = _a.onChange, onValid = _a.onValid, initialValues = _a.initialValues, debug = _a.debug;
|
|
4861
4861
|
var form = useForm(propForm);
|
|
4862
4862
|
var _b = React.useState(false), valid = _b[0], setValid = _b[1];
|
|
4863
4863
|
var _c = useFormValues(), values = _c[0], setValues = _c[1];
|
|
@@ -4894,7 +4894,8 @@ function AppForm(_a) {
|
|
|
4894
4894
|
var handleValuesChange = React.useCallback(function (changedValues, values) {
|
|
4895
4895
|
setValues(changedValues, values);
|
|
4896
4896
|
onValuesChange === null || onValuesChange === void 0 ? void 0 : onValuesChange(changedValues, values);
|
|
4897
|
-
|
|
4897
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(values);
|
|
4898
|
+
}, [setValues, onValuesChange, onChange]);
|
|
4898
4899
|
return (React.createElement(antd.Form, { form: form, onFinish: onFinish, className: classNames(s$r.root, className), layout: "vertical", onValuesChange: handleValuesChange, onFieldsChange: onFieldsChange, initialValues: initialValues }, typeof children === "function" ? children({ valid: valid }) : children));
|
|
4899
4900
|
}
|
|
4900
4901
|
|