react-form-validator-component
Advanced tools
Comparing version 1.7.8 to 1.7.9
{ | ||
"name": "react-form-validator-component", | ||
"version": "1.7.8", | ||
"version": "1.7.9", | ||
"main": "build/lib/index.js", | ||
@@ -45,3 +45,5 @@ "repository": "git@github.com:JDLT-Ltd/react-form-validator-component.git", | ||
}, | ||
"dependencies": {}, | ||
"dependencies": { | ||
"babel-polyfill": "^6.26.0" | ||
}, | ||
"keywords": [ | ||
@@ -48,0 +50,0 @@ "react", |
@@ -37,3 +37,2 @@ import React from 'react' | ||
required: 'test', | ||
defaultValue: 'notanemail, testing array', | ||
label: 'Email addresses' | ||
@@ -40,0 +39,0 @@ }, |
@@ -0,1 +1,3 @@ | ||
import 'babel-polyfill' | ||
import React from 'react' | ||
@@ -149,2 +151,5 @@ import PropTypes from 'prop-types' | ||
}) | ||
console.log('newValidation: ', newValidation) | ||
const newValidState = Object.values(newValidation).every(field => field === true) | ||
console.log('new ValidState', newValidState) | ||
this.setState( | ||
@@ -157,3 +162,3 @@ { | ||
validation: newValidation, | ||
isFormValid: Object.values(newValidation).every(field => field === true) | ||
isFormValid: newValidState | ||
}) | ||
@@ -171,2 +176,14 @@ ) | ||
const newValidation = Object.assign(this.state.validation, { | ||
[groupName]: | ||
Object.values( | ||
Object.assign({}, this.state.groupValidation[groupName], { invalidValuePresent: false }) // "filter" out invalidValuesPresent | ||
).some(member => member === true) && !this.state.groupValidation[groupName].invalidValuePresent | ||
}) | ||
console.log('new Validation is: ', newValidation) | ||
const newFormValid = Object.values(newValidation).every(field => field === true) | ||
console.log('new formValid', newFormValid) | ||
this.setState( | ||
@@ -176,11 +193,8 @@ { | ||
}, | ||
() => | ||
() => { | ||
this.setState({ | ||
validation: Object.assign(this.state.validation, { | ||
[groupName]: | ||
Object.values( | ||
Object.assign({}, this.state.groupValidation[groupName], { invalidValuePresent: false }) // "filter" out invalidValuesPresent | ||
).some(member => member === true) && !this.state.groupValidation[groupName].invalidValuePresent | ||
}) | ||
validation: newValidation, | ||
isFormValid: newFormValid | ||
}) | ||
} | ||
) | ||
@@ -217,5 +231,11 @@ return isFieldValid | ||
onValidate(fieldName, fieldValue) | ||
this.setState({ | ||
isFormValid: Object.values(this.state.validation).every(field => field === true) | ||
}) | ||
} else { | ||
if (this.state.validation[fieldName] === null) return null | ||
onValidate(fieldName, null) | ||
this.setState({ | ||
isFormValid: Object.values(this.state.validation).every(field => field === true) | ||
}) | ||
} | ||
@@ -222,0 +242,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
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
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 2 instances 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
422118
790
2
6
+ Addedbabel-polyfill@^6.26.0
+ Addedbabel-polyfill@6.26.0(transitive)
+ Addedbabel-runtime@6.26.0(transitive)
+ Addedcore-js@2.6.12(transitive)
+ Addedregenerator-runtime@0.10.50.11.1(transitive)