feat(form-core): Change from touched error message and error message to error map and array of errors (#442)

* feature(FieldAPI): Change from touched error message and  error message to error map and array of errors

BREAKING CHANGE: The touched Error and error field has been removed will be replaced with touched errors array and errors map.

* feat: update documentation for updated fields

* chore: update Vue adapter as well

* fix: update getErrorMapKey to return onChange when change is the validation cause

* chore: remove console.log

---------

Co-authored-by: Corbin Crutchley <git@crutchcorn.dev>
This commit is contained in:
Ray Liu
2023-09-08 14:14:54 -04:00
committed by GitHub
parent 05aedcea20
commit c2f9957046
10 changed files with 289 additions and 68 deletions

View File

@@ -79,7 +79,7 @@ describe('useField', () => {
field.setValue((e.target as HTMLInputElement).value)
}
/>
<p>{field.getMeta().error}</p>
<p>{field.getMeta().errors}</p>
</div>
)}
</form.Field>
@@ -122,7 +122,7 @@ describe('useField', () => {
field.handleChange((e.target as HTMLInputElement).value)
}
/>
<p>{field.getMeta().error}</p>
<p>{field.getMeta().errors}</p>
</div>
)}
</form.Field>
@@ -170,7 +170,7 @@ describe('useField', () => {
field.handleChange((e.target as HTMLInputElement).value)
}
/>
<p>{field.getMeta().error}</p>
<p>{field.getMeta().errors}</p>
</div>
)}
</form.Field>
@@ -222,7 +222,7 @@ describe('useField', () => {
field.handleChange((e.target as HTMLInputElement).value)
}
/>
<p>{field.getMeta().error}</p>
<p>{field.getMeta().errors}</p>
</div>
)}
</form.Field>