rc-field-form
Advanced tools
Comparing version 0.0.0-alpha.16 to 0.0.0-alpha.17
@@ -16,4 +16,5 @@ import * as React from 'react'; | ||
onFinish?: Callbacks['onFinish']; | ||
onFinishFailed?: Callbacks['onFinishFailed']; | ||
} | ||
declare const Form: React.FunctionComponent<FormProps>; | ||
export default Form; |
@@ -35,3 +35,4 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; } | ||
_onFinish = _ref.onFinish, | ||
restProps = _objectWithoutProperties(_ref, ["name", "initialValues", "fields", "form", "children", "component", "validateMessages", "onValuesChange", "onFieldsChange", "onFinish"]); | ||
onFinishFailed = _ref.onFinishFailed, | ||
restProps = _objectWithoutProperties(_ref, ["name", "initialValues", "fields", "form", "children", "component", "validateMessages", "onValuesChange", "onFieldsChange", "onFinish", "onFinishFailed"]); | ||
@@ -83,3 +84,4 @@ var formContext = React.useContext(FormContext); // We customize handle event since Context will makes all the consumer re-render: | ||
} | ||
} | ||
}, | ||
onFinishFailed: onFinishFailed | ||
}); // Set initial value, init store value when first mount | ||
@@ -86,0 +88,0 @@ |
@@ -101,2 +101,3 @@ import { ReactElement } from 'react'; | ||
onFinish?: (values: Store) => void; | ||
onFinishFailed?: (errorInfo: ValidateErrorEntity) => void; | ||
} | ||
@@ -103,0 +104,0 @@ export interface InternalHooks { |
@@ -544,5 +544,8 @@ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); } | ||
} | ||
}) // Do nothing about submit catch | ||
.catch(function (e) { | ||
return e; | ||
}).catch(function (e) { | ||
var onFinishFailed = _this.callbacks.onFinishFailed; | ||
if (onFinishFailed) { | ||
onFinishFailed(e); | ||
} | ||
}); | ||
@@ -549,0 +552,0 @@ }; |
@@ -16,4 +16,5 @@ import * as React from 'react'; | ||
onFinish?: Callbacks['onFinish']; | ||
onFinishFailed?: Callbacks['onFinishFailed']; | ||
} | ||
declare const Form: React.FunctionComponent<FormProps>; | ||
export default Form; |
@@ -50,3 +50,4 @@ "use strict"; | ||
_onFinish = _ref.onFinish, | ||
restProps = _objectWithoutProperties(_ref, ["name", "initialValues", "fields", "form", "children", "component", "validateMessages", "onValuesChange", "onFieldsChange", "onFinish"]); | ||
onFinishFailed = _ref.onFinishFailed, | ||
restProps = _objectWithoutProperties(_ref, ["name", "initialValues", "fields", "form", "children", "component", "validateMessages", "onValuesChange", "onFieldsChange", "onFinish", "onFinishFailed"]); | ||
@@ -98,3 +99,4 @@ var formContext = React.useContext(_FormContext.default); // We customize handle event since Context will makes all the consumer re-render: | ||
} | ||
} | ||
}, | ||
onFinishFailed: onFinishFailed | ||
}); // Set initial value, init store value when first mount | ||
@@ -101,0 +103,0 @@ |
@@ -101,2 +101,3 @@ import { ReactElement } from 'react'; | ||
onFinish?: (values: Store) => void; | ||
onFinishFailed?: (errorInfo: ValidateErrorEntity) => void; | ||
} | ||
@@ -103,0 +104,0 @@ export interface InternalHooks { |
@@ -562,5 +562,8 @@ "use strict"; | ||
} | ||
}) // Do nothing about submit catch | ||
.catch(function (e) { | ||
return e; | ||
}).catch(function (e) { | ||
var onFinishFailed = _this.callbacks.onFinishFailed; | ||
if (onFinishFailed) { | ||
onFinishFailed(e); | ||
} | ||
}); | ||
@@ -567,0 +570,0 @@ }; |
{ | ||
"name": "rc-field-form", | ||
"version": "0.0.0-alpha.16", | ||
"version": "0.0.0-alpha.17", | ||
"description": "React Form Component", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -64,12 +64,14 @@ # rc-field-form | ||
| Prop | Description | Type | Default | | ||
| ---------------- | -------------------------------------------------- | ------------------------------------- | ---------------- | | ||
| component | Customize Form render component | string \| Component \| false | form | | ||
| fields | Control Form fields status. Only use when in Redux | [FieldData](#fielddata)[] | - | | ||
| form | Set form instance created by `useForm` | [FormInstance](#useform) | `Form.useForm()` | | ||
| initialValues | Initial value of Form | Object | - | | ||
| name | Config name with [FormProvider](#formprovider) | string | - | | ||
| validateMessages | Set validate message template | [ValidateMessages](#validatemessages) | - | | ||
| onFieldsChange | Trigger when any value of Field changed | (changedFields, allFields): void | - | | ||
| onValuesChange | Trigger when any value of Field changed | (changedValues, values): void | - | | ||
| Prop | Description | Type | Default | | ||
| ---------------- | -------------------------------------------------- | ------------------------------------------ | ---------------- | | ||
| component | Customize Form render component | string \| Component \| false | form | | ||
| fields | Control Form fields status. Only use when in Redux | [FieldData](#fielddata)[] | - | | ||
| form | Set form instance created by `useForm` | [FormInstance](#useform) | `Form.useForm()` | | ||
| initialValues | Initial value of Form | Object | - | | ||
| name | Config name with [FormProvider](#formprovider) | string | - | | ||
| validateMessages | Set validate message template | [ValidateMessages](#validatemessages) | - | | ||
| onFieldsChange | Trigger when any value of Field changed | (changedFields, allFields): void | - | | ||
| onFinish | Trigger when form submit and success | (values): void | - | | ||
| onFinishFailed | Trigger when form submit and failed | ({ values, errorFields, outOfDate }): void | - | | ||
| onValuesChange | Trigger when any value of Field changed | (changedValues, values): void | - | | ||
@@ -76,0 +78,0 @@ ## Field |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
196940
4236
279