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.6.4 to 1.6.5

2

package.json
{
"name": "react-form-validator-component",
"version": "1.6.4",
"version": "1.6.5",
"main": "build/lib/index.js",

@@ -5,0 +5,0 @@ "repository": "git@github.com:JDLT-Ltd/react-form-validator-component.git",

@@ -33,14 +33,14 @@ import React from 'react'

fields = {
// emailAddresses: {
// name: 'emailAddresses',
// rules: ['isEmailArray'],
// required: true,
// label: 'Email addresses'
// },
// something: {
// name: 'something',
// rules: ['isPhoneNumber'],
// required: 'test',
// label: 'Something'
// },
emailAddresses: {
name: 'emailAddresses',
rules: ['isEmailArray'],
required: 'test',
label: 'Email addresses'
},
something: {
name: 'something',
rules: ['isPhoneNumber'],
required: 'test',
label: 'Something'
}
// number: {

@@ -57,10 +57,10 @@ // name: 'number',

// label: 'name'
// },
sources: {
rules: [],
name: 'sources',
required: true,
label: 'sources',
defaultValue: [options[0].value]
}
// // },
// sources: {
// rules: [],
// name: 'sources',
// required: true,
// label: 'sources',
// defaultValue: [options[0].value]
// }
}

@@ -84,17 +84,21 @@

<Validator fields={this.fields} parent={this} validateOnLoad>
{({ isFormValid, onChange }) => {
{({ isFormValid, isFieldValid, onChange, errors }) => {
return (
<Form>
<Form.Field
name="sources"
label="Source / Source Group"
options={options}
defaultValue={[1]}
fluid
multiple
selection
search
onChange={onChange}
control={Dropdown}
/>
<Form.Field>
<label>Your Emails</label>
<input name="emailAddresses" onChange={onChange} />
{this.renderErrors(errors.emailAddresses)}
</Form.Field>
<Button onClick={() => alert('sure is')} disabled={!isFieldValid.emailAddresses}>
Thats an Email!
</Button>
<Form.Field>
<label>Something</label>
<input name="something" onChange={onChange} />
{this.renderErrors(errors.something)}
</Form.Field>
<Button onClick={() => alert('is it?')} disabled={!isFieldValid.something}>
Its not nothing
</Button>
{<span>Form is {isFormValid ? 'valid' : 'not valid'}</span>}

@@ -101,0 +105,0 @@ <hr />

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