Skip to content

Commit

Permalink
feat(dynamic-form): adiciona mensagem de erro nos componentes
Browse files Browse the repository at this point in the history
Repassa propriedade fieldErrorMessage para exibir mensagem de erro

fixes DTHFUI-10231
  • Loading branch information
CSimoesJr authored and pedrodominguesp committed Nov 29, 2024
1 parent 43d1111 commit 7e74ff6
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -265,10 +265,17 @@ export interface PoDynamicFormField extends PoDynamicField {
* - pattern;
* - minValue;
* - maxValue;
* - required;
*
* > Esta mensagem não é apresentada quando o campo estiver vazio, mesmo que ele seja requerido.
* > Esta mensagem pode ser exibida quando o campo estiver vazio, caso seja requerido. Em casos de componentes como
* `po-datepicker`, `po-input`, `po-number`, `po-decimal`, `po-password`, é necessário que a propriedade
* `requiredFieldErrorMessage` esteja como `true` para que a mensagem seja exibida com o campo vazio. Componentes
* como `po-datepicker-range`, `po-select`, `po-checkbox-group`, `po-radio-group`, `po-multiselect`, `po-combo`,
* `po-lookup` e `po-textarea` não é necessário passar a propriedade `requiredFieldErrorMessage`.
*
* **Componentes compatíveis:** `po-datepicker`, `po-input`, `po-number`, `po-decimal`, `po-password`.
*
* **Componentes compatíveis:** `po-datepicker`, `po-input`, `po-number`, `po-decimal`, `po-password`, `po-datepicker-range`,
* `po-select`, `po-checkbox-group`, `po-radio-group`, `po-multiselect`, `po-combo`, `po-lookup`, `po-textarea`.
*/
errorMessage?: string;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
[p-optional]="field.optional"
[p-readonly]="field.readonly"
[p-required]="field.required"
[p-field-error-message]="field.errorMessage"
[p-show-required]="field.showRequired"
(p-change)="onChangeField(field)"
>
Expand Down Expand Up @@ -172,6 +173,7 @@
[p-optional]="field.optional"
[p-options]="field.options"
[p-required]="field.required"
[p-field-error-message]="field.errorMessage"
[p-show-required]="field.showRequired"
(p-change)="onChangeField(field)"
[p-placeholder]="field.placeholder"
Expand All @@ -193,6 +195,7 @@
[p-optional]="field.optional"
[p-options]="field.options"
[p-required]="field.required"
[p-field-error-message]="field.errorMessage"
[p-show-required]="field.showRequired"
(p-change)="onChangeField(field)"
>
Expand Down Expand Up @@ -253,6 +256,7 @@
[p-optional]="field.optional"
[p-sort]="field.sort"
[p-required]="field.required"
[p-field-error-message]="field.errorMessage"
[p-show-required]="field.showRequired"
(p-change)="onChangeField(field, $event)"
[p-icon]="field.icon"
Expand Down Expand Up @@ -292,6 +296,7 @@
[p-no-autocomplete]="field.noAutocomplete"
[p-optional]="field.optional"
[p-required]="field.required"
[p-field-error-message]="field.errorMessage"
[p-show-required]="field.showRequired"
(p-change)="onChangeField(field)"
[p-placeholder]="field.placeholder"
Expand All @@ -316,6 +321,7 @@
[p-options]="field.options"
[p-required]="field.required"
[p-show-required]="field.showRequired"
[p-field-error-message]="field.errorMessage"
(p-change)="onChangeField(field)"
>
</po-checkbox-group>
Expand All @@ -335,6 +341,7 @@
[p-optional]="field.optional"
[p-options]="field.options"
[p-required]="field.required"
[p-field-error-message]="field.errorMessage"
[p-show-required]="field.showRequired"
(p-change)="onChangeField(field)"
[p-placeholder]="field.placeholder"
Expand Down Expand Up @@ -365,6 +372,7 @@
[p-optional]="field.optional"
[p-readonly]="field.readonly"
[p-required]="field.required"
[p-field-error-message]="field.errorMessage"
[p-show-required]="field.showRequired"
[p-rows]="field.rows"
(p-change)="onChangeField(field)"
Expand Down

0 comments on commit 7e74ff6

Please sign in to comment.