romagny13-react-form-validation

0.11.2 • Public • Published

React Form Validation

Build Status

This Library allows validating React Forms easily with a collection of helpers and components.

Helpers: allow validating simple form (with no component or another component framework )

  • Validators:
    • required
    • minlength (by default 3 characters)
    • maxlength (by default 30 characters)
    • email
    • pattern (with a regular expression)
    • custom (with a function)
    • ( + isNullOrEmpty )
  • ValidationHelper allows validating a value, a property or a form model
    • validateValue
    • validateProperty
    • validateAll
    • ( + hasErrors, countErrors )
  • DOMFormHelper allows resolving element value
    • getElementValue: returns the value of a form element (input, select, radio, etc.)
  • Util:
    • omit
    • clone
    • extend

Components: allow to bind value and notify on value change (onValueChange) and on touch / blur (onTouch)

  • Input
  • Password (allows showing password)
  • Checkbox
  • CheckboxGroup
  • Radio
  • RadioGroup
  • Select (multiple supported)
  • TextArea
  • LightGroup (allows showing error)
  • FormGroup (allows showing error and success)
  • Form
  • Label (asterisk for required field)
  • FontIcon (Icon with Font Awesome) + EyeIcon
  • ErrorBlock
  • Submit (could be disabled with errors)
  • Reset (allows resetting to initial state)

Installation

npm i romagny13-react-form-validation -S

Requires Font Awesome. With a CDN:

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.css">

... Or with Webpack (+ css-loader):

npm i font-awesome -S

Documentation

Examples

To run examples npm i then npm run dev

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
0.11.20latest

Version History

VersionDownloads (Last 7 Days)Published
0.11.20
0.11.10
0.11.01
0.10.00
0.9.00
0.8.20
0.8.10
0.7.70
0.7.60
0.7.50
0.7.40
0.7.30
0.7.20
0.7.10
0.7.00
0.6.10
0.6.00
0.5.40
0.5.30
0.5.20
0.5.10
0.5.00
0.4.70
0.4.60
0.4.50
0.4.40
0.4.30
0.4.20
0.4.10
0.4.00
0.3.10
0.3.00
0.2.00
0.1.100
0.1.90
0.1.80
0.1.70
0.1.60
0.1.50
0.1.40
0.1.30
0.1.20
0.1.10
0.1.00
0.0.10

Package Sidebar

Install

npm i romagny13-react-form-validation

Weekly Downloads

1

Version

0.11.2

License

MIT

Last publish

Collaborators

  • romagny13