Isomorphic javascript form validation library.
npm install isomorphic-validation
The core module of the library exports two entities: Validation and Predicate.
Validation
Predicate
- Validation().started()- Validation().valid()- Validation().invalid()- Validation().changed()- Validation().validated()- Validation().error()- Validation().constraint()- Validation().bind()- Validation().dataMapper()- Validation().validate()
Validation().started()
Validation().valid()
Validation().invalid()
Validation().changed()
Validation().validated()
Validation().error()
Validation().constraint()
Validation().bind()
Validation().dataMapper()
Validation().validate()
- Predicate().started()- Predicate().valid()- Predicate().invalid()- Predicate().changed()- Predicate().validated()- Predicate().error()- Predicate().restored()
Predicate().started()
Predicate().valid()
Predicate().invalid()
Predicate().changed()
Predicate().validated()
Predicate().error()
Predicate().restored()
- Validation().client- Validation().server- Validation().isomorphic- Validation().isValid- Validation().constraints- Validation().validations
Validation().client
Validation().server
Validation().isomorphic
Validation().isValid
Validation().constraints
Validation().validations
- Predicate().client- Predicate().server- Predicate().isomorphic
Predicate().client
Predicate().server
Predicate().isomorphic
- Validation.group()- Validation.glue()- Validation.clone()- Validation.profile()
Validation.group()
Validation.glue()
Validation.clone()
Validation.profile()
A Validation object can be created several ways:
- a single Validation is created by the constructor function.- a grouping Validation is created by the static methods Validation.group() and Validation.glue()- also a grouping Validation with nested (grouped), bound to form fields Validation objects is created by the Validation.profile() static method.- and lastly, a single Validation is created by the Validation.clone() method from another Validation.
Nested (grouped) Validation objects are accessed through:
- the Validation().validations property.- by form field names when created using the Validation.profile() method.
A Predicate object can be created:
- by the constructor function.- cloned from another Predicate object when passed into the constructor function.
Predicate objects added to validations can be accessed:
- through the Validation().constraints property.- in state callbacks through the ValidationResult object passed in.
ValidationResult
The UI module exports the following set of helper, renderer and effect functions for performing UI side effects:
- firstInvalid()- allInvalid()- toEventHandler()- createApplyEffect()
firstInvalid()
allInvalid()
toEventHandler()
createApplyEffect()
- renderFirstError()- renderAllErrors()- renderProperty()
renderFirstError()
renderAllErrors()
renderProperty()
- applyClass()- applyOutline()- applyBackground()- applyAccess()- applyBox()
applyClass()
applyOutline()
applyBackground()
applyAccess()
applyBox()