Skip to content
This repository has been archived by the owner on May 4, 2020. It is now read-only.

Releases: jurassix/react-validation-mixin

Babel upgrade to 6, now exposing lib using CommonJS

15 Jun 14:01
Compare
Choose a tag to compare

Exposing Validation mixin using CommonJS module.exports instead of ES6 Modules export default

Ensure `getValidationMessages` always returns an array

24 Oct 17:01
Compare
Choose a tag to compare

This release fixes the inconsistency of the getValidationMessages between 4.x and 5.x. Now calls to this method always returns an array.

Ensure you update the joi-validation-strategy to v0.3.0 to pick up the dependent changes.

Nested Object validation now supported

24 Sep 00:40
Compare
Choose a tag to compare

With this release there was a major overhaul to the underlying validation framework to support nested object validation.

This release is dependent on joi-validation-strategy v0.2.1

Nested object validation support

  validatorTypes:  {
    auth: {
      firstName: Joi.string().required().label('First Name'),
    },
  }
...
render: function() {
    return (
      <section className='row'>
        <h3>Signup</h3>
        <form onSubmit={this.handleSubmit} className='form-horizontal'>
          <fieldset>
            <div className={this.getClasses('auth.firstName')}>
              <label htmlFor='firstName'>First Name</label>
              <input type='text' 
                id='firstName' 
                ref='firstName' 
                value={this.state.auth.firstName} 
                onChange={this.onChange('auth.firstName')} 
                onBlur={this.props.handleValidation('auth.firstName')} 
                className='form-control' placeholder='First Name' />
              {this.renderHelpText(this.props.getValidationMessages('auth.firstName'))}
            </div>
...

Breaking Changes

A breaking change has been introduced with the this.props.getValidationMessages() api. It now no longer always returns an array, but instead depends on the datatype you are validating and the strategy implementation. Documentation is currently being updated to reflect these changes.

Async Validation

13 Sep 16:06
Compare
Choose a tag to compare

Validation is now expected to be async; if using the joi-validation-strategy make sure > v0.1.0 to account for this breaking change to strategies.

Major release breaking changes

31 Aug 23:47
Compare
Choose a tag to compare

Sample component and testing harness

17 Feb 03:44
Compare
Choose a tag to compare

This patch increases this libraries stability by adding Karma and example component tests.

Updates to readme

17 Feb 01:28
Compare
Choose a tag to compare

Updated README getValidatorData examples to match changes in 4.x

v4.0.1

17 Feb 01:22
Compare
Choose a tag to compare

Removed handleSubmit and handleReset; they were accidentally left in from a merge.

4.0.0 (Major release with breaking API changes):

17 Feb 01:02
Compare
Choose a tag to compare

4.0.0 (Major release with breaking API changes):

  • validatorData is now getValidatorData to be more idiomatic of React
  • validate now takes an error-first callback, which allows for a simpler API when validating on Submit. validate also takes an optional key as a first param that can be used to validate a single form field.
  • isValid is now a simple wrapper around this.state.errors see example for handling form submission in 4.x.x
  • clearValidations has been added to reset all current errors.
  • handleValidations now takes a second parameter error-first callback that can be used for custom handling of errors.