calidation
Advanced tools
Comparing version 1.2.0 to 1.2.1
@@ -75,3 +75,3 @@ 'use strict'; | ||
var fields = _extends({}, _this.state.fields, _defineProperty({}, e.target.name, e.target.value)); | ||
var errors = _this.validate(fields); | ||
var errors = _this.validate(fields, _this.state.config); | ||
_this.setState({ errors: errors, fields: fields }); | ||
@@ -96,4 +96,4 @@ }, _this.onSubmit = function (e) { | ||
_this.setState({ errors: errors, fields: fields }); | ||
}, _this.validate = function (fields) { | ||
return Object.entries(_this.state.config).reduce(function (all, _ref6) { | ||
}, _this.validate = function (fields, config) { | ||
return Object.entries(config).reduce(function (all, _ref6) { | ||
var _ref7 = _slicedToArray(_ref6, 2), | ||
@@ -125,6 +125,5 @@ name = _ref7[0], | ||
var fields = _extends({}, _this.state.fields, initialValues); | ||
var errors = _this.validate(fields, config); | ||
_this.setState({ config: config, fields: fields }, function (nextState) { | ||
return _this.setState({ errors: _this.validate(fields) }); | ||
}); | ||
_this.setState({ config: config, fields: fields, errors: errors }); | ||
}, _this.unregisterSubComponent = function (fieldsToRemove) { | ||
@@ -131,0 +130,0 @@ var keys = Object.keys(fieldsToRemove); |
{ | ||
"name": "calidation", | ||
"version": "1.2.0", | ||
"version": "1.2.1", | ||
"description": "A red hot validation library for React", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
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
31868
379