Releases: Albert-Gao/veasy
Update the onlyWhen rule
Now if a field contains onlyWhen, its validation will be triggered even not from its own event. This is to ensure the isFormOK always get the correct value.
Add `onlyWhen` rule
The onlyWhen has a same syntax as reliesOn, the only difference is, if the validation in onlyWhen not pass, this field will be ruled out from validation even its value is wrong.
New features
When you use reliesOn, you can even refer some field that is not controlled by veasy. As long as you included that field in the collectValues schema. Veasy could find it.
Thanks @JeremyColton for the idea!
Add `reliesOn` rule
Now support reliesOn rule.
- field A can
reliesOnfield B with different rules - field B, of course, can have its own validation rules
- no conflicts
- More in the documentation
Thanks @JeremyColton for the idea!
Fix
[Fix] Now the default value will trigger the validation when invoking createInitialState()
Thanks @JeremyColton For the help
Improve
- Add a new rule of:
beforeValidationwhich is a function where it will get executed before validation starts. It will allow you to modify the value. - Fix a bug where Veasy will throw an exception when the user wraps a non-form field component.
Thanks @JeremyColton For the help
Bug fix
Now the custom message will work when building production.
Now the checkIsFormOK will be invoked when generating the initial state
Bug fix
Now when you have a default in your schema, even the status is normal, as long as the field's value equals default. The isFormOK will set to OK.
Related to #17
Thanks @JeremyColton
Add a new parameter to validate()
Now it accepts an optional 5th parameter where you can use to specify targetName