Skip to content

Commit

Permalink
feat: introduced class/classes props to handle Field extension …
Browse files Browse the repository at this point in the history
…in Fields Definitions
  • Loading branch information
foxhound87 committed Jan 4, 2024
1 parent 903e88a commit ffb8f87
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# 6.7.0 (master)
- Feat: introduced `class`/`classes` props to handle `Field` extension in Fields Definitions.

# 6.6.1 (master)
- Feat: class used to instantiate a field is now configurable
- Fix: added missing bind method to field interface

# 6.6.0 (master)
- Introduced ZOD validation driver
Expand Down
2 changes: 1 addition & 1 deletion src/Field.ts
Original file line number Diff line number Diff line change
Expand Up @@ -739,7 +739,7 @@ export default class Field extends Base implements FieldInterface {
}

resetValidation(deep: boolean = false): void {
this.showError = true;
this.showError = false;
this.errorSync = null;
this.errorAsync = null;
this.validationAsyncData = {};
Expand Down
8 changes: 4 additions & 4 deletions src/Form.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,17 +173,17 @@ export default class Form extends Base implements FormInterface {

invalidate(message: string | null = null): void {
this.debouncedValidation.cancel();
this.each((field) => field.debouncedValidation.cancel());
this.each((field: FieldInterface) => field.debouncedValidation.cancel());
this.validator.error = message || this.state.options.get(OptionsEnum.defaultGenericError) || true;
}

showErrors(show: boolean = true): void {
this.each((field: any) => field.showErrors(show));
this.each((field: FieldInterface) => field.showErrors(show));
}

resetValidation(deep: boolean): void {
resetValidation(deep: boolean = true): void {
this.validator.error = null;
this.each((field: any) => field.resetValidation(deep));
this.each((field: FieldInterface) => field.resetValidation(deep));
}

/**
Expand Down

0 comments on commit ffb8f87

Please sign in to comment.