New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

react-input-validator

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-input-validator

react-input-validator is input super class validator

npmnpm
Version
1.1.6
Version published
Weekly downloads
1
-90%
Maintainers
1
Weekly downloads
 
Created
Source

react-input-validator

Light input SUPER class validator



Intro

react-input-validator is a light input SUPER class validator, a clever container for pattern matches, which is so light without any special dependencies at all, The main file is InputValidator.js which is included inside InputValidator folder, and that class is an instance of React.component class which is responsible for appending classes for the current state of the input.

Usage

You need to extends this small class and just write your own pattern logic, and the SUPER class will handle the validation status, and will verify from the entered value for every "change" by depending on the passed REQUIRED function from the outside world through the prop onInputChange, and to pass the REQUIRED params which is (nodeElement, PatternValidatorFn) .

States

There are 4 basic states for the input (can be grapped by super.getValidationClass Fn):

  • sn-valid: which indicates that the input is valid
  • sn-not-valid: which indicates that the input is not valid
  • sn-dirty: which indicates that the input is dirty
  • sn-loading: which indicates that the input is loading (checking pattern)

Validation timer

The validation is checked when the user has stopped writing for one complete second to follow the UI principles (In the meanwhile the sn-loading will be revealed into super.getValidationClass() method)


Install

npm install react-input-validator

Running Examples

npm run build

Then go to:

file:///{Your Path}/react-input-validator/Client/index.html

Live Example (See Examples folder for more implementations examples)

FAQs

Package last updated on 08 Sep 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts