Merge pull request #1096 from ant-design/remove-validation

Remove rc-form-validation from deps completely
This commit is contained in:
Benjy Cui 2016-03-09 15:53:07 +08:00
commit 55b8d1445b
2 changed files with 7 additions and 18 deletions

View File

@ -1,25 +1,15 @@
import React from 'react';
import Validation from 'rc-form-validation';
import warning from 'warning';
export default class AntValidation extends React.Component {
validate(callback) {
this.refs.validation.validate(callback);
}
reset() {
this.refs.validation.reset();
}
forceValidate(fields, callback) {
this.refs.validation.forceValidate(fields, callback);
}
render() {
warning(false, '`Validation` is deprecated, please use `Form` which has supported validation after antd@0.12.0.');
return <Validation {...this.props} ref="validation" />;
warning(false, '`Validation` is removed, please use `Form` which has supported validation after antd@0.12.0,' +
' or you can just import Validation from \'rc-form-validation\' for compatibility');
return null;
}
}
AntValidation.Validator = Validation.Validator;
AntValidation.FieldMixin = Validation.FieldMixin;
AntValidation.Validator = () => {};
AntValidation.FieldMixin = {
setField() {},
};

View File

@ -46,7 +46,6 @@
"rc-dialog": "~5.4.0",
"rc-dropdown": "~1.4.3",
"rc-form": "~0.14.0",
"rc-form-validation": "~2.5.0",
"rc-input-number": "~2.5.0",
"rc-menu": "~4.10.2",
"rc-notification": "~1.3.1",