Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-form-validator-component

Package Overview
Dependencies
Maintainers
3
Versions
58
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-form-validator-component - npm Package Compare versions

Comparing version 1.7.8 to 1.7.9

6

package.json
{
"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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc