diff --git a/projects/ui/src/lib/components/po-dynamic/po-dynamic-form/po-dynamic-form-field.interface.ts b/projects/ui/src/lib/components/po-dynamic/po-dynamic-form/po-dynamic-form-field.interface.ts index 6f61b69a5d..f945067b9c 100644 --- a/projects/ui/src/lib/components/po-dynamic/po-dynamic-form/po-dynamic-form-field.interface.ts +++ b/projects/ui/src/lib/components/po-dynamic/po-dynamic-form/po-dynamic-form-field.interface.ts @@ -279,6 +279,25 @@ export interface PoDynamicFormField extends PoDynamicField { */ errorMessage?: string; + /** + * @optional + * + * @description + * + * Limita a exibição da mensagem de erro a duas linhas e exibe um tooltip com o texto completo. + * + * > Caso essa propriedade seja definida como `true`, a mensagem de erro será limitada a duas linhas + * e um tooltip será exibido ao passar o mouse sobre a mensagem para mostrar o conteúdo completo. + * + * **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`. + * + * @default `false` + */ + errorLimit?: boolean; + + errorAppendBox?: boolean; + /** * Função executada para realizar a validação assíncrona personalizada. * Executada ao disparar o output `change` ou `change-model`, dependendo do valor da propriedade `triggerMode`. diff --git a/projects/ui/src/lib/components/po-dynamic/po-dynamic-form/po-dynamic-form-fields/po-dynamic-form-fields.component.html b/projects/ui/src/lib/components/po-dynamic/po-dynamic-form/po-dynamic-form-fields/po-dynamic-form-fields.component.html index c3514045a0..b22d70ee89 100644 --- a/projects/ui/src/lib/components/po-dynamic/po-dynamic-form/po-dynamic-form-fields/po-dynamic-form-fields.component.html +++ b/projects/ui/src/lib/components/po-dynamic/po-dynamic-form/po-dynamic-form-fields/po-dynamic-form-fields.component.html @@ -20,6 +20,7 @@ [p-clean]="field.clean" [p-disabled]="isDisabled(field)" [p-error-pattern]="field.errorMessage" + [p-error-limit]="field.errorLimit" [p-error-async]="field.errorAsyncFunction" [p-auto-focus]="field.focus" [p-format]="field.format" @@ -59,6 +60,7 @@ [p-readonly]="field.readonly" [p-required]="field.required" [p-field-error-message]="field.errorMessage" + [p-error-limit]="field.errorLimit" [p-show-required]="field.showRequired" (p-change)="onChangeField(field)" > @@ -73,6 +75,7 @@ [p-clean]="field.clean" [p-disabled]="isDisabled(field)" [p-error-pattern]="field.errorMessage" + [p-error-limit]="field.errorLimit" [p-error-async-properties]="field.errorAsyncProperties" [p-auto-focus]="field.focus" [p-help]="field.help" @@ -104,6 +107,7 @@ [p-clean]="field.clean" [p-disabled]="isDisabled(field)" [p-error-pattern]="field.errorMessage" + [p-error-limit]="field.errorLimit" [p-error-async-properties]="field.errorAsyncProperties" [p-auto-focus]="field.focus" [p-help]="field.help" @@ -134,6 +138,7 @@ [ngClass]="field.componentClass" [p-clean]="field.clean" [p-error-pattern]="field.errorMessage" + [p-error-limit]="field.errorLimit" [p-error-async-properties]="field.errorAsyncProperties" [p-disabled]="isDisabled(field)" [p-decimals-length]="field.decimalsLength" @@ -174,6 +179,7 @@ [p-options]="field.options" [p-required]="field.required" [p-field-error-message]="field.errorMessage" + [p-error-limit]="field.errorLimit" [p-show-required]="field.showRequired" (p-change)="onChangeField(field)" [p-placeholder]="field.placeholder" @@ -196,6 +202,7 @@ [p-options]="field.options" [p-required]="field.required" [p-field-error-message]="field.errorMessage" + [p-error-limit]="field.errorLimit" [p-show-required]="field.showRequired" (p-change)="onChangeField(field)" > @@ -257,6 +264,7 @@ [p-sort]="field.sort" [p-required]="field.required" [p-field-error-message]="field.errorMessage" + [p-error-limit]="field.errorLimit" [p-show-required]="field.showRequired" (p-change)="onChangeField(field, $event)" [p-icon]="field.icon" @@ -297,6 +305,7 @@ [p-optional]="field.optional" [p-required]="field.required" [p-field-error-message]="field.errorMessage" + [p-error-limit]="field.errorLimit" [p-show-required]="field.showRequired" (p-change)="onChangeField(field)" [p-placeholder]="field.placeholder" @@ -322,6 +331,7 @@ [p-required]="field.required" [p-show-required]="field.showRequired" [p-field-error-message]="field.errorMessage" + [p-error-limit]="field.errorLimit" (p-change)="onChangeField(field)" > @@ -342,6 +352,7 @@ [p-options]="field.options" [p-required]="field.required" [p-field-error-message]="field.errorMessage" + [p-error-limit]="field.errorLimit" [p-show-required]="field.showRequired" (p-change)="onChangeField(field)" [p-placeholder]="field.placeholder" @@ -373,6 +384,7 @@ [p-readonly]="field.readonly" [p-required]="field.required" [p-field-error-message]="field.errorMessage" + [p-error-limit]="field.errorLimit" [p-show-required]="field.showRequired" [p-rows]="field.rows" (p-change)="onChangeField(field)" @@ -390,6 +402,7 @@ [p-clean]="field.clean" [p-disabled]="isDisabled(field)" [p-error-pattern]="field.errorMessage" + [p-error-limit]="field.errorLimit" [p-error-async-properties]="field.errorAsyncProperties" [p-auto-focus]="field.focus" [p-help]="field.help" diff --git a/projects/ui/src/lib/components/po-field/po-checkbox-group/po-checkbox-group-base.component.ts b/projects/ui/src/lib/components/po-field/po-checkbox-group/po-checkbox-group-base.component.ts index c174401e2a..7d76f6e768 100644 --- a/projects/ui/src/lib/components/po-field/po-checkbox-group/po-checkbox-group-base.component.ts +++ b/projects/ui/src/lib/components/po-field/po-checkbox-group/po-checkbox-group-base.component.ts @@ -90,6 +90,20 @@ export class PoCheckboxGroupBaseComponent implements ControlValueAccessor, Valid */ @Input('p-field-error-message') fieldErrorMessage: string; + /** + * @optional + * + * @description + * + * Limita a exibição da mensagem de erro a duas linhas e exibe um tooltip com o texto completo. + * + * > Caso essa propriedade seja definida como `true`, a mensagem de erro será limitada a duas linhas + * e um tooltip será exibido ao passar o mouse sobre a mensagem para mostrar o conteúdo completo. + * + * @default `false` + */ + @Input('p-error-limit') errorLimit: boolean = false; + /** * @optional * diff --git a/projects/ui/src/lib/components/po-field/po-checkbox-group/po-checkbox-group.component.html b/projects/ui/src/lib/components/po-field/po-checkbox-group/po-checkbox-group.component.html index e428d27794..5ed223bedc 100644 --- a/projects/ui/src/lib/components/po-field/po-checkbox-group/po-checkbox-group.component.html +++ b/projects/ui/src/lib/components/po-field/po-checkbox-group/po-checkbox-group.component.html @@ -27,5 +27,8 @@ - + diff --git a/projects/ui/src/lib/components/po-field/po-checkbox-group/samples/sample-po-checkbox-group-labs/sample-po-checkbox-group-labs.component.html b/projects/ui/src/lib/components/po-field/po-checkbox-group/samples/sample-po-checkbox-group-labs/sample-po-checkbox-group-labs.component.html index 7bfb218d05..3520c7bfb9 100644 --- a/projects/ui/src/lib/components/po-field/po-checkbox-group/samples/sample-po-checkbox-group-labs/sample-po-checkbox-group-labs.component.html +++ b/projects/ui/src/lib/components/po-field/po-checkbox-group/samples/sample-po-checkbox-group-labs/sample-po-checkbox-group-labs.component.html @@ -10,6 +10,7 @@ [p-options]="options" [p-required]="properties.includes('required')" [p-field-error-message]="fieldErrorMessage" + [p-error-limit]="properties?.includes('errorLimit')" [p-show-required]="properties.includes('showRequired')" (p-change)="changeEvent('p-change')" > diff --git a/projects/ui/src/lib/components/po-field/po-checkbox-group/samples/sample-po-checkbox-group-labs/sample-po-checkbox-group-labs.component.ts b/projects/ui/src/lib/components/po-field/po-checkbox-group/samples/sample-po-checkbox-group-labs/sample-po-checkbox-group-labs.component.ts index d04ffd3eb6..1816600d15 100644 --- a/projects/ui/src/lib/components/po-field/po-checkbox-group/samples/sample-po-checkbox-group-labs/sample-po-checkbox-group-labs.component.ts +++ b/projects/ui/src/lib/components/po-field/po-checkbox-group/samples/sample-po-checkbox-group-labs/sample-po-checkbox-group-labs.component.ts @@ -31,7 +31,8 @@ export class SamplePoCheckboxGroupLabsComponent implements OnInit { { value: 'indeterminate', label: 'Indeterminate' }, { value: 'optional', label: 'Optional' }, { value: 'required', label: 'Required' }, - { value: 'showRequired', label: 'Show Required' } + { value: 'showRequired', label: 'Show Required' }, + { value: 'errorLimit', label: 'Limit Error Message' } ]; ngOnInit() { diff --git a/projects/ui/src/lib/components/po-field/po-combo/po-combo-base.component.ts b/projects/ui/src/lib/components/po-field/po-combo/po-combo-base.component.ts index df2fe1f28a..b9401e2bb4 100644 --- a/projects/ui/src/lib/components/po-field/po-combo/po-combo-base.component.ts +++ b/projects/ui/src/lib/components/po-field/po-combo/po-combo-base.component.ts @@ -251,6 +251,22 @@ export abstract class PoComboBaseComponent implements ControlValueAccessor, OnIn */ @Input('p-field-error-message') fieldErrorMessage: string; + /** + * @optional + * + * @description + * + * Limita a exibição da mensagem de erro a duas linhas e exibe um tooltip com o texto completo. + * + * > Caso essa propriedade seja definida como `true`, a mensagem de erro será limitada a duas linhas + * e um tooltip será exibido ao passar o mouse sobre a mensagem para mostrar o conteúdo completo. + * + * @default `false` + */ + @Input('p-error-limit') errorLimit: boolean = false; + + @Input({ alias: 'p-error-append-in-body', transform: convertToBoolean }) errorAppendBox?: boolean = false; + /** * @optional * diff --git a/projects/ui/src/lib/components/po-field/po-combo/po-combo.component.html b/projects/ui/src/lib/components/po-field/po-combo/po-combo.component.html index 1fa45ca3e9..4d0ae58a30 100644 --- a/projects/ui/src/lib/components/po-field/po-combo/po-combo.component.html +++ b/projects/ui/src/lib/components/po-field/po-combo/po-combo.component.html @@ -88,6 +88,8 @@ [p-help]="help" [p-disabled]="disabled" [p-error-pattern]="getErrorPattern()" + [p-error-limit]="errorLimit" + [p-append-in-body]="errorAppendBox" > diff --git a/projects/ui/src/lib/components/po-field/po-combo/samples/sample-po-combo-labs/sample-po-combo-labs.component.html b/projects/ui/src/lib/components/po-field/po-combo/samples/sample-po-combo-labs/sample-po-combo-labs.component.html index 1743ab1d75..626a916c8d 100644 --- a/projects/ui/src/lib/components/po-field/po-combo/samples/sample-po-combo-labs/sample-po-combo-labs.component.html +++ b/projects/ui/src/lib/components/po-field/po-combo/samples/sample-po-combo-labs/sample-po-combo-labs.component.html @@ -25,6 +25,7 @@ [p-show-required]="properties.includes('showRequired')" [p-sort]="properties.includes('sort')" (p-change)="changeEvent('p-change')" + [p-error-limit]="properties?.includes('errorLimit')" > diff --git a/projects/ui/src/lib/components/po-field/po-combo/samples/sample-po-combo-labs/sample-po-combo-labs.component.ts b/projects/ui/src/lib/components/po-field/po-combo/samples/sample-po-combo-labs/sample-po-combo-labs.component.ts index 7692ae3209..340ce5b713 100644 --- a/projects/ui/src/lib/components/po-field/po-combo/samples/sample-po-combo-labs/sample-po-combo-labs.component.ts +++ b/projects/ui/src/lib/components/po-field/po-combo/samples/sample-po-combo-labs/sample-po-combo-labs.component.ts @@ -61,7 +61,8 @@ export class SamplePoComboLabsComponent implements OnInit { { value: 'showRequired', label: 'Show Required' }, { value: 'sort', label: 'Sort' }, { value: 'clean', label: 'Clean' }, - { value: 'disabledTabFilter', label: 'Disabled Tab Filter' } + { value: 'disabledTabFilter', label: 'Disabled Tab Filter' }, + { value: 'errorLimit', label: 'Limit Error Message' } ]; ngOnInit() { diff --git a/projects/ui/src/lib/components/po-field/po-datepicker-range/po-datepicker-range-base.component.ts b/projects/ui/src/lib/components/po-field/po-datepicker-range/po-datepicker-range-base.component.ts index 1f81a369be..0b04425ac4 100644 --- a/projects/ui/src/lib/components/po-field/po-datepicker-range/po-datepicker-range-base.component.ts +++ b/projects/ui/src/lib/components/po-field/po-datepicker-range/po-datepicker-range-base.component.ts @@ -118,6 +118,20 @@ export abstract class PoDatepickerRangeBaseComponent implements ControlValueAcce */ @Input('p-field-error-message') fieldErrorMessage: string; + /** + * @optional + * + * @description + * + * Limita a exibição da mensagem de erro a duas linhas e exibe um tooltip com o texto completo. + * + * > Caso essa propriedade seja definida como `true`, a mensagem de erro será limitada a duas linhas + * e um tooltip será exibido ao passar o mouse sobre a mensagem para mostrar o conteúdo completo. + * + * @default `false` + */ + @Input('p-error-limit') errorLimit: boolean = false; + /** * @optional * diff --git a/projects/ui/src/lib/components/po-field/po-datepicker-range/po-datepicker-range.component.html b/projects/ui/src/lib/components/po-field/po-datepicker-range/po-datepicker-range.component.html index 4ddcc174c8..d23fdb9cc7 100644 --- a/projects/ui/src/lib/components/po-field/po-datepicker-range/po-datepicker-range.component.html +++ b/projects/ui/src/lib/components/po-field/po-datepicker-range/po-datepicker-range.component.html @@ -75,6 +75,7 @@ [p-help]="help" [p-disabled]="disabled" [p-error-pattern]="getErrorMessage" + [p-error-limit]="errorLimit" > diff --git a/projects/ui/src/lib/components/po-field/po-datepicker-range/samples/sample-po-datepicker-range-labs/sample-po-datepicker-range-labs.component.html b/projects/ui/src/lib/components/po-field/po-datepicker-range/samples/sample-po-datepicker-range-labs/sample-po-datepicker-range-labs.component.html index e1681dda9e..4224584d21 100644 --- a/projects/ui/src/lib/components/po-field/po-datepicker-range/samples/sample-po-datepicker-range-labs/sample-po-datepicker-range-labs.component.html +++ b/projects/ui/src/lib/components/po-field/po-datepicker-range/samples/sample-po-datepicker-range-labs/sample-po-datepicker-range-labs.component.html @@ -19,6 +19,7 @@ [p-start-date]="startDate" [p-locale]="locale" (p-change)="changeEvent('p-change')" + [p-error-limit]="properties?.includes('errorLimit')" > diff --git a/projects/ui/src/lib/components/po-field/po-datepicker-range/samples/sample-po-datepicker-range-labs/sample-po-datepicker-range-labs.component.ts b/projects/ui/src/lib/components/po-field/po-datepicker-range/samples/sample-po-datepicker-range-labs/sample-po-datepicker-range-labs.component.ts index 1160a3e918..bb69eecddf 100644 --- a/projects/ui/src/lib/components/po-field/po-datepicker-range/samples/sample-po-datepicker-range-labs/sample-po-datepicker-range-labs.component.ts +++ b/projects/ui/src/lib/components/po-field/po-datepicker-range/samples/sample-po-datepicker-range-labs/sample-po-datepicker-range-labs.component.ts @@ -34,7 +34,8 @@ export class SamplePoDatepickerRangeLabsComponent implements OnInit { { value: 'optional', label: 'Optional' }, { value: 'readonly', label: 'Read Only' }, { value: 'required', label: 'Required' }, - { value: 'showRequired', label: 'Show Required' } + { value: 'showRequired', label: 'Show Required' }, + { value: 'errorLimit', label: 'Limit Error Message' } ]; public readonly localeOptions: Array = [ diff --git a/projects/ui/src/lib/components/po-field/po-datepicker/po-datepicker-base.component.ts b/projects/ui/src/lib/components/po-field/po-datepicker/po-datepicker-base.component.ts index a5bd18c850..b2629c06d5 100644 --- a/projects/ui/src/lib/components/po-field/po-datepicker/po-datepicker-base.component.ts +++ b/projects/ui/src/lib/components/po-field/po-datepicker/po-datepicker-base.component.ts @@ -148,6 +148,22 @@ export abstract class PoDatepickerBaseComponent implements ControlValueAccessor, */ @Input('p-error-pattern') errorPattern?: string = ''; + /** + * @optional + * + * @description + * + * Limita a exibição da mensagem de erro a duas linhas e exibe um tooltip com o texto completo. + * + * > Caso essa propriedade seja definida como `true`, a mensagem de erro será limitada a duas linhas + * e um tooltip será exibido ao passar o mouse sobre a mensagem para mostrar o conteúdo completo. + * + * @default `false` + */ + @Input('p-error-limit') errorLimit: boolean = false; + + @Input({ alias: 'p-error-append-in-body', transform: convertToBoolean }) errorAppendBox?: boolean = false; + /** * @optional * diff --git a/projects/ui/src/lib/components/po-field/po-datepicker/po-datepicker.component.html b/projects/ui/src/lib/components/po-field/po-datepicker/po-datepicker.component.html index 1b2cc39825..574d6c970c 100644 --- a/projects/ui/src/lib/components/po-field/po-datepicker/po-datepicker.component.html +++ b/projects/ui/src/lib/components/po-field/po-datepicker/po-datepicker.component.html @@ -82,5 +82,7 @@ [p-help]="help" [p-disabled]="disabled" [p-error-pattern]="getErrorPattern()" + [p-error-limit]="errorLimit" + [p-append-in-body]="errorAppendBox" > diff --git a/projects/ui/src/lib/components/po-field/po-datepicker/samples/sample-po-datepicker-labs/sample-po-datepicker-labs.component.html b/projects/ui/src/lib/components/po-field/po-datepicker/samples/sample-po-datepicker-labs/sample-po-datepicker-labs.component.html index ac6c43ff5a..31ebfaad9f 100644 --- a/projects/ui/src/lib/components/po-field/po-datepicker/samples/sample-po-datepicker-labs/sample-po-datepicker-labs.component.html +++ b/projects/ui/src/lib/components/po-field/po-datepicker/samples/sample-po-datepicker-labs/sample-po-datepicker-labs.component.html @@ -21,6 +21,7 @@ [p-show-required]="properties.includes('showRequired')" (p-blur)="changeEvent('p-blur')" (p-change)="changeEvent('p-change')" + [p-error-limit]="properties?.includes('errorLimit')" > diff --git a/projects/ui/src/lib/components/po-field/po-datepicker/samples/sample-po-datepicker-labs/sample-po-datepicker-labs.component.ts b/projects/ui/src/lib/components/po-field/po-datepicker/samples/sample-po-datepicker-labs/sample-po-datepicker-labs.component.ts index 449854eb28..1f4eaf575d 100644 --- a/projects/ui/src/lib/components/po-field/po-datepicker/samples/sample-po-datepicker-labs/sample-po-datepicker-labs.component.ts +++ b/projects/ui/src/lib/components/po-field/po-datepicker/samples/sample-po-datepicker-labs/sample-po-datepicker-labs.component.ts @@ -33,7 +33,8 @@ export class SamplePoDatepickerLabsComponent implements OnInit { { value: 'readonly', label: 'Read Only' }, { value: 'required', label: 'Required' }, { value: 'requiredFieldErrorMessage', label: 'Required Field Error Message' }, - { value: 'showRequired', label: 'Show Required' } + { value: 'showRequired', label: 'Show Required' }, + { value: 'errorLimit', label: 'Limit Error Message' } ]; public readonly formatOptions: Array = [ diff --git a/projects/ui/src/lib/components/po-field/po-decimal/po-decimal.component.html b/projects/ui/src/lib/components/po-field/po-decimal/po-decimal.component.html index 9d3b6dc4f0..31a61ecfb4 100644 --- a/projects/ui/src/lib/components/po-field/po-decimal/po-decimal.component.html +++ b/projects/ui/src/lib/components/po-field/po-decimal/po-decimal.component.html @@ -44,6 +44,12 @@ - + diff --git a/projects/ui/src/lib/components/po-field/po-decimal/samples/sample-po-decimal-labs/sample-po-decimal-labs.component.html b/projects/ui/src/lib/components/po-field/po-decimal/samples/sample-po-decimal-labs/sample-po-decimal-labs.component.html index 1810c60b3a..8f16451722 100644 --- a/projects/ui/src/lib/components/po-field/po-decimal/samples/sample-po-decimal-labs/sample-po-decimal-labs.component.html +++ b/projects/ui/src/lib/components/po-field/po-decimal/samples/sample-po-decimal-labs/sample-po-decimal-labs.component.html @@ -23,6 +23,7 @@ (p-blur)="changeEvent('p-blur')" (p-change)="changeEvent('p-change')" (p-change-model)="changeEvent('p-change-model')" + [p-error-limit]="properties?.includes('errorLimit')" > diff --git a/projects/ui/src/lib/components/po-field/po-decimal/samples/sample-po-decimal-labs/sample-po-decimal-labs.component.ts b/projects/ui/src/lib/components/po-field/po-decimal/samples/sample-po-decimal-labs/sample-po-decimal-labs.component.ts index d0f7146529..46a8274ce7 100644 --- a/projects/ui/src/lib/components/po-field/po-decimal/samples/sample-po-decimal-labs/sample-po-decimal-labs.component.ts +++ b/projects/ui/src/lib/components/po-field/po-decimal/samples/sample-po-decimal-labs/sample-po-decimal-labs.component.ts @@ -42,7 +42,8 @@ export class SamplePoDecimalLabsComponent implements OnInit { { value: 'readonly', label: 'Read Only' }, { value: 'required', label: 'Required' }, { value: 'requiredFieldErrorMessage', label: 'Required Field Error Message' }, - { value: 'showRequired', label: 'Show Required' } + { value: 'showRequired', label: 'Show Required' }, + { value: 'errorLimit', label: 'Limit Error Message' } ]; get maxDecimalsLength() { diff --git a/projects/ui/src/lib/components/po-field/po-email/samples/sample-po-email-labs/sample-po-email-labs.component.html b/projects/ui/src/lib/components/po-field/po-email/samples/sample-po-email-labs/sample-po-email-labs.component.html index 73f1bdbb72..f199e1534c 100644 --- a/projects/ui/src/lib/components/po-field/po-email/samples/sample-po-email-labs/sample-po-email-labs.component.html +++ b/projects/ui/src/lib/components/po-field/po-email/samples/sample-po-email-labs/sample-po-email-labs.component.html @@ -19,6 +19,7 @@ (p-change)="changeEvent('p-change')" (p-change-model)="changeEvent('p-change-model')" (p-enter)="changeEvent('p-enter')" + [p-error-limit]="properties?.includes('errorLimit')" > diff --git a/projects/ui/src/lib/components/po-field/po-email/samples/sample-po-email-labs/sample-po-email-labs.component.ts b/projects/ui/src/lib/components/po-field/po-email/samples/sample-po-email-labs/sample-po-email-labs.component.ts index b6856b8501..4739f03c9f 100644 --- a/projects/ui/src/lib/components/po-field/po-email/samples/sample-po-email-labs/sample-po-email-labs.component.ts +++ b/projects/ui/src/lib/components/po-field/po-email/samples/sample-po-email-labs/sample-po-email-labs.component.ts @@ -24,7 +24,8 @@ export class SamplePoEmailLabsComponent implements OnInit { { value: 'optional', label: 'Optional' }, { value: 'readonly', label: 'Read Only' }, { value: 'required', label: 'Required' }, - { value: 'requiredFieldErrorMessage', label: 'Required Field Error Message' } + { value: 'requiredFieldErrorMessage', label: 'Required Field Error Message' }, + { value: 'errorLimit', label: 'Limit Error Message' } ]; ngOnInit() { diff --git a/projects/ui/src/lib/components/po-field/po-field-container/po-field-container-bottom/po-field-container-bottom.component.html b/projects/ui/src/lib/components/po-field/po-field-container/po-field-container-bottom/po-field-container-bottom.component.html index d38d071882..4334667fd9 100644 --- a/projects/ui/src/lib/components/po-field/po-field-container/po-field-container-bottom/po-field-container-bottom.component.html +++ b/projects/ui/src/lib/components/po-field/po-field-container/po-field-container-bottom/po-field-container-bottom.component.html @@ -1,8 +1,24 @@ -
+
- + diff --git a/projects/ui/src/lib/components/po-field/po-login/samples/sample-po-login-labs/sample-po-login-labs.component.html b/projects/ui/src/lib/components/po-field/po-login/samples/sample-po-login-labs/sample-po-login-labs.component.html index 763ee8af7c..cff20055fc 100644 --- a/projects/ui/src/lib/components/po-field/po-login/samples/sample-po-login-labs/sample-po-login-labs.component.html +++ b/projects/ui/src/lib/components/po-field/po-login/samples/sample-po-login-labs/sample-po-login-labs.component.html @@ -20,6 +20,8 @@ (p-change)="changeEvent('p-change')" (p-change-model)="changeEvent('p-change-model')" (p-enter)="changeEvent('p-enter')" + , + [p-error-limit]="properties?.includes('errorLimit')" > diff --git a/projects/ui/src/lib/components/po-field/po-login/samples/sample-po-login-labs/sample-po-login-labs.component.ts b/projects/ui/src/lib/components/po-field/po-login/samples/sample-po-login-labs/sample-po-login-labs.component.ts index 22733b6401..8e92dfe8bd 100644 --- a/projects/ui/src/lib/components/po-field/po-login/samples/sample-po-login-labs/sample-po-login-labs.component.ts +++ b/projects/ui/src/lib/components/po-field/po-login/samples/sample-po-login-labs/sample-po-login-labs.component.ts @@ -26,7 +26,8 @@ export class SamplePoLoginLabsComponent implements OnInit { { value: 'readonly', label: 'Read Only' }, { value: 'required', label: 'Required' }, { value: 'requiredFieldErrorMessage', label: 'Required Field Error Message' }, - { value: 'showRequired', label: 'Show Required' } + { value: 'showRequired', label: 'Show Required' }, + { value: 'errorLimit', label: 'Limit Error Message' } ]; ngOnInit() { diff --git a/projects/ui/src/lib/components/po-field/po-lookup/po-lookup-base.component.ts b/projects/ui/src/lib/components/po-field/po-lookup/po-lookup-base.component.ts index a4d4710ec2..850643900d 100644 --- a/projects/ui/src/lib/components/po-field/po-lookup/po-lookup-base.component.ts +++ b/projects/ui/src/lib/components/po-field/po-lookup/po-lookup-base.component.ts @@ -342,6 +342,22 @@ export abstract class PoLookupBaseComponent */ @Input('p-field-error-message') fieldErrorMessage: string; + /** + * @optional + * + * @description + * + * Limita a exibição da mensagem de erro a duas linhas e exibe um tooltip com o texto completo. + * + * > Caso essa propriedade seja definida como `true`, a mensagem de erro será limitada a duas linhas + * e um tooltip será exibido ao passar o mouse sobre a mensagem para mostrar o conteúdo completo. + * + * @default `false` + */ + @Input('p-error-limit') errorLimit: boolean = false; + + @Input({ alias: 'p-error-append-in-body', transform: convertToBoolean }) errorAppendBox?: boolean = false; + /** * @optional * diff --git a/projects/ui/src/lib/components/po-field/po-lookup/po-lookup.component.html b/projects/ui/src/lib/components/po-field/po-lookup/po-lookup.component.html index c3cbb28940..a0664a50c3 100644 --- a/projects/ui/src/lib/components/po-field/po-lookup/po-lookup.component.html +++ b/projects/ui/src/lib/components/po-field/po-lookup/po-lookup.component.html @@ -59,6 +59,8 @@ [p-help]="help" [p-disabled]="disabled" [p-error-pattern]="getErrorPattern()" + [p-error-limit]="errorLimit" + [p-append-in-body]="errorAppendBox" > diff --git a/projects/ui/src/lib/components/po-field/po-lookup/samples/sample-po-lookup-labs/sample-po-lookup-labs.component.html b/projects/ui/src/lib/components/po-field/po-lookup/samples/sample-po-lookup-labs/sample-po-lookup-labs.component.html index d6cc63807f..10fa622aab 100644 --- a/projects/ui/src/lib/components/po-field/po-lookup/samples/sample-po-lookup-labs/sample-po-lookup-labs.component.html +++ b/projects/ui/src/lib/components/po-field/po-lookup/samples/sample-po-lookup-labs/sample-po-lookup-labs.component.html @@ -28,6 +28,7 @@ (p-change)="changeEvent('p-change')" (p-error)="changeEvent('p-error')" (p-selected)="changeEvent('p-selected')" + [p-error-limit]="properties?.includes('errorLimit')" > diff --git a/projects/ui/src/lib/components/po-field/po-lookup/samples/sample-po-lookup-labs/sample-po-lookup-labs.component.ts b/projects/ui/src/lib/components/po-field/po-lookup/samples/sample-po-lookup-labs/sample-po-lookup-labs.component.ts index aefa1ae75a..25e73a66bc 100644 --- a/projects/ui/src/lib/components/po-field/po-lookup/samples/sample-po-lookup-labs/sample-po-lookup-labs.component.ts +++ b/projects/ui/src/lib/components/po-field/po-lookup/samples/sample-po-lookup-labs/sample-po-lookup-labs.component.ts @@ -67,7 +67,8 @@ export class SamplePoLookupLabsComponent implements OnInit { { value: 'autoHeight', label: 'Auto Height' }, { value: 'hideColumnsManager', label: 'Hide Columns Manager' }, { value: 'textWrap', label: 'Text Wrap' }, - { value: 'virtualScroll', label: 'Virtual Sroll' } + { value: 'virtualScroll', label: 'Virtual Sroll' }, + { value: 'errorLimit', label: 'Limit Error Message' } ]; private readonly columnsDefinition = { diff --git a/projects/ui/src/lib/components/po-field/po-multiselect/po-multiselect-base.component.ts b/projects/ui/src/lib/components/po-field/po-multiselect/po-multiselect-base.component.ts index faf180cb1a..fec39b0c60 100644 --- a/projects/ui/src/lib/components/po-field/po-multiselect/po-multiselect-base.component.ts +++ b/projects/ui/src/lib/components/po-field/po-multiselect/po-multiselect-base.component.ts @@ -186,6 +186,20 @@ export abstract class PoMultiselectBaseComponent implements ControlValueAccessor */ @Input('p-field-error-message') fieldErrorMessage: string; + /** + * @optional + * + * @description + * + * Limita a exibição da mensagem de erro a duas linhas e exibe um tooltip com o texto completo. + * + * > Caso essa propriedade seja definida como `true`, a mensagem de erro será limitada a duas linhas + * e um tooltip será exibido ao passar o mouse sobre a mensagem para mostrar o conteúdo completo. + * + * @default `false` + */ + @Input('p-error-limit') errorLimit: boolean = false; + /** * @optional * @@ -209,6 +223,8 @@ export abstract class PoMultiselectBaseComponent implements ControlValueAccessor */ @Input({ alias: 'p-append-in-body', transform: convertToBoolean }) appendBox?: boolean = false; + @Input({ alias: 'p-error-append-in-body', transform: convertToBoolean }) errorAppendBox?: boolean = false; + selectedOptions: Array = []; visibleOptionsDropdown: Array = []; visibleTags = []; diff --git a/projects/ui/src/lib/components/po-field/po-multiselect/po-multiselect.component.html b/projects/ui/src/lib/components/po-field/po-multiselect/po-multiselect.component.html index 2993eb62b8..71ad74c4b6 100644 --- a/projects/ui/src/lib/components/po-field/po-multiselect/po-multiselect.component.html +++ b/projects/ui/src/lib/components/po-field/po-multiselect/po-multiselect.component.html @@ -68,6 +68,8 @@ [p-help]="help" [p-disabled]="disabled" [p-error-pattern]="getErrorPattern()" + [p-error-limit]="errorLimit" + [p-append-in-body]="errorAppendBox" >
diff --git a/projects/ui/src/lib/components/po-field/po-multiselect/samples/sample-po-multiselect-labs/sample-po-multiselect-labs.component.html b/projects/ui/src/lib/components/po-field/po-multiselect/samples/sample-po-multiselect-labs/sample-po-multiselect-labs.component.html index 5b829660ec..6600bfafc6 100644 --- a/projects/ui/src/lib/components/po-field/po-multiselect/samples/sample-po-multiselect-labs/sample-po-multiselect-labs.component.html +++ b/projects/ui/src/lib/components/po-field/po-multiselect/samples/sample-po-multiselect-labs/sample-po-multiselect-labs.component.html @@ -23,6 +23,7 @@ [p-show-required]="properties.includes('showRequired')" [p-sort]="properties.includes('sort')" (p-change)="changeEvent('p-change')" + [p-error-limit]="properties?.includes('errorLimit')" > diff --git a/projects/ui/src/lib/components/po-field/po-multiselect/samples/sample-po-multiselect-labs/sample-po-multiselect-labs.component.ts b/projects/ui/src/lib/components/po-field/po-multiselect/samples/sample-po-multiselect-labs/sample-po-multiselect-labs.component.ts index 46b6e9db00..8851932f7e 100644 --- a/projects/ui/src/lib/components/po-field/po-multiselect/samples/sample-po-multiselect-labs/sample-po-multiselect-labs.component.ts +++ b/projects/ui/src/lib/components/po-field/po-multiselect/samples/sample-po-multiselect-labs/sample-po-multiselect-labs.component.ts @@ -43,7 +43,8 @@ export class SamplePoMultiselectLabsComponent implements OnInit { { value: 'hideSearch', label: 'Hide Search' }, { value: 'autoHeight', label: 'Auto Height' }, { value: 'sort', label: 'Sort' }, - { value: 'hideSelectAll', label: 'Hide Select All' } + { value: 'hideSelectAll', label: 'Hide Select All' }, + { value: 'errorLimit', label: 'Limit Error Message' } ]; ngOnInit() { diff --git a/projects/ui/src/lib/components/po-field/po-number/po-number.component.html b/projects/ui/src/lib/components/po-field/po-number/po-number.component.html index 07666f9e01..8f280a9317 100644 --- a/projects/ui/src/lib/components/po-field/po-number/po-number.component.html +++ b/projects/ui/src/lib/components/po-field/po-number/po-number.component.html @@ -45,6 +45,12 @@ - + diff --git a/projects/ui/src/lib/components/po-field/po-number/samples/sample-po-number-labs/sample-po-number-labs.component.html b/projects/ui/src/lib/components/po-field/po-number/samples/sample-po-number-labs/sample-po-number-labs.component.html index 5a233fc39b..58b9532137 100644 --- a/projects/ui/src/lib/components/po-field/po-number/samples/sample-po-number-labs/sample-po-number-labs.component.html +++ b/projects/ui/src/lib/components/po-field/po-number/samples/sample-po-number-labs/sample-po-number-labs.component.html @@ -23,6 +23,7 @@ (p-blur)="changeEvent('p-blur')" (p-change)="changeEvent('p-change')" (p-change-model)="changeEvent('p-change-model')" + [p-error-limit]="properties?.includes('errorLimit')" > diff --git a/projects/ui/src/lib/components/po-field/po-number/samples/sample-po-number-labs/sample-po-number-labs.component.ts b/projects/ui/src/lib/components/po-field/po-number/samples/sample-po-number-labs/sample-po-number-labs.component.ts index 9c8f4bfdc1..3cd92c4340 100644 --- a/projects/ui/src/lib/components/po-field/po-number/samples/sample-po-number-labs/sample-po-number-labs.component.ts +++ b/projects/ui/src/lib/components/po-field/po-number/samples/sample-po-number-labs/sample-po-number-labs.component.ts @@ -35,7 +35,8 @@ export class SamplePoNumberLabsComponent implements OnInit { { value: 'readonly', label: 'Read Only' }, { value: 'required', label: 'Required' }, { value: 'requiredFieldErrorMessage', label: 'Required Field Error Message' }, - { value: 'showRequired', label: 'Show Required' } + { value: 'showRequired', label: 'Show Required' }, + { value: 'errorLimit', label: 'Limit Error Message' } ]; ngOnInit() { diff --git a/projects/ui/src/lib/components/po-field/po-password/po-password.component.html b/projects/ui/src/lib/components/po-field/po-password/po-password.component.html index 2f64582ceb..f81dc1633d 100644 --- a/projects/ui/src/lib/components/po-field/po-password/po-password.component.html +++ b/projects/ui/src/lib/components/po-field/po-password/po-password.component.html @@ -55,6 +55,11 @@ - + diff --git a/projects/ui/src/lib/components/po-field/po-password/samples/sample-po-password-labs/sample-po-password-labs.component.html b/projects/ui/src/lib/components/po-field/po-password/samples/sample-po-password-labs/sample-po-password-labs.component.html index 653c629968..be5c621ae4 100644 --- a/projects/ui/src/lib/components/po-field/po-password/samples/sample-po-password-labs/sample-po-password-labs.component.html +++ b/projects/ui/src/lib/components/po-field/po-password/samples/sample-po-password-labs/sample-po-password-labs.component.html @@ -21,6 +21,7 @@ (p-change)="changeEvent('p-change')" (p-change-model)="changeEvent('p-change-model')" (p-enter)="changeEvent('p-enter')" + [p-error-limit]="properties?.includes('errorLimit')" > diff --git a/projects/ui/src/lib/components/po-field/po-password/samples/sample-po-password-labs/sample-po-password-labs.component.ts b/projects/ui/src/lib/components/po-field/po-password/samples/sample-po-password-labs/sample-po-password-labs.component.ts index 4b951fc631..c9b583744a 100644 --- a/projects/ui/src/lib/components/po-field/po-password/samples/sample-po-password-labs/sample-po-password-labs.component.ts +++ b/projects/ui/src/lib/components/po-field/po-password/samples/sample-po-password-labs/sample-po-password-labs.component.ts @@ -28,7 +28,8 @@ export class SamplePoPasswordLabsComponent implements OnInit { { value: 'readonly', label: 'Read Only' }, { value: 'required', label: 'Required' }, { value: 'requiredFieldErrorMessage', label: 'Required Field Error Message' }, - { value: 'showRequired', label: 'Show Required' } + { value: 'showRequired', label: 'Show Required' }, + { value: 'errorLimit', label: 'Limit Error Message' } ]; ngOnInit() { diff --git a/projects/ui/src/lib/components/po-field/po-radio-group/po-radio-group-base.component.ts b/projects/ui/src/lib/components/po-field/po-radio-group/po-radio-group-base.component.ts index c0afd3ef3c..b607507d12 100644 --- a/projects/ui/src/lib/components/po-field/po-radio-group/po-radio-group-base.component.ts +++ b/projects/ui/src/lib/components/po-field/po-radio-group/po-radio-group-base.component.ts @@ -103,6 +103,20 @@ export abstract class PoRadioGroupBaseComponent implements ControlValueAccessor, */ @Input('p-field-error-message') fieldErrorMessage: string; + /** + * @optional + * + * @description + * + * Limita a exibição da mensagem de erro a duas linhas e exibe um tooltip com o texto completo. + * + * > Caso essa propriedade seja definida como `true`, a mensagem de erro será limitada a duas linhas + * e um tooltip será exibido ao passar o mouse sobre a mensagem para mostrar o conteúdo completo. + * + * @default `false` + */ + @Input('p-error-limit') errorLimit: boolean = false; + /** * @optional * diff --git a/projects/ui/src/lib/components/po-field/po-radio-group/po-radio-group.component.html b/projects/ui/src/lib/components/po-field/po-radio-group/po-radio-group.component.html index bda12c9ab3..66656896ba 100644 --- a/projects/ui/src/lib/components/po-field/po-radio-group/po-radio-group.component.html +++ b/projects/ui/src/lib/components/po-field/po-radio-group/po-radio-group.component.html @@ -25,5 +25,8 @@ - + diff --git a/projects/ui/src/lib/components/po-field/po-radio-group/samples/sample-po-radio-group-labs/sample-po-radio-group-labs.component.html b/projects/ui/src/lib/components/po-field/po-radio-group/samples/sample-po-radio-group-labs/sample-po-radio-group-labs.component.html index d2905e0e97..df57336226 100644 --- a/projects/ui/src/lib/components/po-field/po-radio-group/samples/sample-po-radio-group-labs/sample-po-radio-group-labs.component.html +++ b/projects/ui/src/lib/components/po-field/po-radio-group/samples/sample-po-radio-group-labs/sample-po-radio-group-labs.component.html @@ -12,6 +12,7 @@ [p-show-required]="properties.includes('showRequired')" [p-size]="size" (p-change)="changeEvent('p-change')" + [p-error-limit]="properties?.includes('errorLimit')" > diff --git a/projects/ui/src/lib/components/po-field/po-radio-group/samples/sample-po-radio-group-labs/sample-po-radio-group-labs.component.ts b/projects/ui/src/lib/components/po-field/po-radio-group/samples/sample-po-radio-group-labs/sample-po-radio-group-labs.component.ts index 113d48a52f..b65c9fc273 100644 --- a/projects/ui/src/lib/components/po-field/po-radio-group/samples/sample-po-radio-group-labs/sample-po-radio-group-labs.component.ts +++ b/projects/ui/src/lib/components/po-field/po-radio-group/samples/sample-po-radio-group-labs/sample-po-radio-group-labs.component.ts @@ -29,7 +29,8 @@ export class SamplePoRadioGroupLabsComponent implements OnInit { { value: 'disabled', label: 'Disabled' }, { value: 'optional', label: 'Optional' }, { value: 'required', label: 'Required' }, - { value: 'showRequired', label: 'Show Required' } + { value: 'showRequired', label: 'Show Required' }, + { value: 'errorLimit', label: 'Limit Error Message' } ]; readonly sizesOptions: Array = [ diff --git a/projects/ui/src/lib/components/po-field/po-rich-text/po-rich-text-base.component.ts b/projects/ui/src/lib/components/po-field/po-rich-text/po-rich-text-base.component.ts index 890ffff1b5..8c2a03432a 100644 --- a/projects/ui/src/lib/components/po-field/po-rich-text/po-rich-text-base.component.ts +++ b/projects/ui/src/lib/components/po-field/po-rich-text/po-rich-text-base.component.ts @@ -48,6 +48,20 @@ export abstract class PoRichTextBaseComponent implements ControlValueAccessor, V */ @Input('p-error-message') errorMessage?: string = ''; + /** + * @optional + * + * @description + * + * Limita a exibição da mensagem de erro a duas linhas e exibe um tooltip com o texto completo. + * + * > Caso essa propriedade seja definida como `true`, a mensagem de erro será limitada a duas linhas + * e um tooltip será exibido ao passar o mouse sobre a mensagem para mostrar o conteúdo completo. + * + * @default `false` + */ + @Input('p-error-limit') errorLimit: boolean = false; + /** * @optional * diff --git a/projects/ui/src/lib/components/po-field/po-rich-text/po-rich-text.component.html b/projects/ui/src/lib/components/po-field/po-rich-text/po-rich-text.component.html index 0a71051808..1e7229c480 100644 --- a/projects/ui/src/lib/components/po-field/po-rich-text/po-rich-text.component.html +++ b/projects/ui/src/lib/components/po-field/po-rich-text/po-rich-text.component.html @@ -27,5 +27,9 @@ - + diff --git a/projects/ui/src/lib/components/po-field/po-rich-text/samples/sample-po-rich-text-labs/sample-po-rich-text-labs.component.html b/projects/ui/src/lib/components/po-field/po-rich-text/samples/sample-po-rich-text-labs/sample-po-rich-text-labs.component.html index 767c7f3150..6fc045bece 100644 --- a/projects/ui/src/lib/components/po-field/po-rich-text/samples/sample-po-rich-text-labs/sample-po-rich-text-labs.component.html +++ b/projects/ui/src/lib/components/po-field/po-rich-text/samples/sample-po-rich-text-labs/sample-po-rich-text-labs.component.html @@ -13,6 +13,7 @@ [p-show-required]="properties.includes('showRequired')" (p-change)="changeEvent('p-change')" (p-change-model)="changeEvent('p-change-model')" + [p-error-limit]="properties?.includes('errorLimit')" > diff --git a/projects/ui/src/lib/components/po-field/po-rich-text/samples/sample-po-rich-text-labs/sample-po-rich-text-labs.component.ts b/projects/ui/src/lib/components/po-field/po-rich-text/samples/sample-po-rich-text-labs/sample-po-rich-text-labs.component.ts index 4c70142c6a..e8b1cb03f2 100644 --- a/projects/ui/src/lib/components/po-field/po-rich-text/samples/sample-po-rich-text-labs/sample-po-rich-text-labs.component.ts +++ b/projects/ui/src/lib/components/po-field/po-rich-text/samples/sample-po-rich-text-labs/sample-po-rich-text-labs.component.ts @@ -31,7 +31,8 @@ export class SamplePoRichTextLabsComponent implements OnInit { { value: 'optional', label: 'Optional' }, { value: 'readonly', label: 'Read Only' }, { value: 'required', label: 'Required' }, - { value: 'showRequired', label: 'Show Required' } + { value: 'showRequired', label: 'Show Required' }, + { value: 'errorLimit', label: 'Limit Error Message' } ]; ngOnInit() { diff --git a/projects/ui/src/lib/components/po-field/po-select/po-select.component.html b/projects/ui/src/lib/components/po-field/po-select/po-select.component.html index 647096897c..7171f36cdc 100644 --- a/projects/ui/src/lib/components/po-field/po-select/po-select.component.html +++ b/projects/ui/src/lib/components/po-field/po-select/po-select.component.html @@ -56,5 +56,7 @@ [p-help]="help" [p-disabled]="disabled" [p-error-pattern]="getErrorPattern()" + [p-error-limit]="errorLimit" + [p-append-in-body]="errorAppendBox" > diff --git a/projects/ui/src/lib/components/po-field/po-select/samples/sample-po-select-labs/sample-po-select-labs.component.html b/projects/ui/src/lib/components/po-field/po-select/samples/sample-po-select-labs/sample-po-select-labs.component.html index 3c80b93701..fd75783492 100644 --- a/projects/ui/src/lib/components/po-field/po-select/samples/sample-po-select-labs/sample-po-select-labs.component.html +++ b/projects/ui/src/lib/components/po-field/po-select/samples/sample-po-select-labs/sample-po-select-labs.component.html @@ -16,6 +16,7 @@ (p-change)="changeEvent('p-change')" (p-change-model)="changeEvent('p-change-model')" (p-enter)="changeEvent('p-enter')" + [p-error-limit]="properties?.includes('errorLimit')" > diff --git a/projects/ui/src/lib/components/po-field/po-select/samples/sample-po-select-labs/sample-po-select-labs.component.ts b/projects/ui/src/lib/components/po-field/po-select/samples/sample-po-select-labs/sample-po-select-labs.component.ts index 03d80f82a5..3e846cdfc6 100644 --- a/projects/ui/src/lib/components/po-field/po-select/samples/sample-po-select-labs/sample-po-select-labs.component.ts +++ b/projects/ui/src/lib/components/po-field/po-select/samples/sample-po-select-labs/sample-po-select-labs.component.ts @@ -26,7 +26,8 @@ export class SamplePoSelectLabsComponent implements OnInit { { value: 'optional', label: 'Optional' }, { value: 'required', label: 'Required' }, { value: 'showRequired', label: 'Show Required' }, - { value: 'readonly', label: 'Read Only' } + { value: 'readonly', label: 'Read Only' }, + { value: 'errorLimit', label: 'Limit Error Message' } ]; constructor(private readonly cdr: ChangeDetectorRef) {} diff --git a/projects/ui/src/lib/components/po-field/po-textarea/po-textarea-base.component.ts b/projects/ui/src/lib/components/po-field/po-textarea/po-textarea-base.component.ts index 8986847447..cf5d46e589 100644 --- a/projects/ui/src/lib/components/po-field/po-textarea/po-textarea-base.component.ts +++ b/projects/ui/src/lib/components/po-field/po-textarea/po-textarea-base.component.ts @@ -83,6 +83,20 @@ export abstract class PoTextareaBaseComponent implements ControlValueAccessor, V */ @Input('p-field-error-message') fieldErrorMessage: string; + /** + * @optional + * + * @description + * + * Limita a exibição da mensagem de erro a duas linhas e exibe um tooltip com o texto completo. + * + * > Caso essa propriedade seja definida como `true`, a mensagem de erro será limitada a duas linhas + * e um tooltip será exibido ao passar o mouse sobre a mensagem para mostrar o conteúdo completo. + * + * @default `false` + */ + @Input('p-error-limit') errorLimit: boolean = false; + /** * @optional * diff --git a/projects/ui/src/lib/components/po-field/po-textarea/po-textarea.component.html b/projects/ui/src/lib/components/po-field/po-textarea/po-textarea.component.html index ecee5ba24f..49630ac619 100644 --- a/projects/ui/src/lib/components/po-field/po-textarea/po-textarea.component.html +++ b/projects/ui/src/lib/components/po-field/po-textarea/po-textarea.component.html @@ -27,5 +27,6 @@ [p-help]="help" [p-disabled]="disabled" [p-error-pattern]="getErrorPattern()" + [p-error-limit]="errorLimit" > diff --git a/projects/ui/src/lib/components/po-field/po-textarea/samples/sample-po-textarea-labs/sample-po-textarea-labs.component.html b/projects/ui/src/lib/components/po-field/po-textarea/samples/sample-po-textarea-labs/sample-po-textarea-labs.component.html index 6dbd4f0b39..0bc3f6140f 100644 --- a/projects/ui/src/lib/components/po-field/po-textarea/samples/sample-po-textarea-labs/sample-po-textarea-labs.component.html +++ b/projects/ui/src/lib/components/po-field/po-textarea/samples/sample-po-textarea-labs/sample-po-textarea-labs.component.html @@ -17,6 +17,7 @@ (p-change)="changeEvent('p-change')" (p-change-model)="changeEvent('p-change-model')" (p-enter)="changeEvent('p-enter')" + [p-error-limit]="properties?.includes('errorLimit')" > diff --git a/projects/ui/src/lib/components/po-field/po-textarea/samples/sample-po-textarea-labs/sample-po-textarea-labs.component.ts b/projects/ui/src/lib/components/po-field/po-textarea/samples/sample-po-textarea-labs/sample-po-textarea-labs.component.ts index 8a32b83cc1..1fd67fcac8 100644 --- a/projects/ui/src/lib/components/po-field/po-textarea/samples/sample-po-textarea-labs/sample-po-textarea-labs.component.ts +++ b/projects/ui/src/lib/components/po-field/po-textarea/samples/sample-po-textarea-labs/sample-po-textarea-labs.component.ts @@ -23,7 +23,8 @@ export class SamplePoTextareaLabsComponent implements OnInit { { value: 'optional', label: 'Optional' }, { value: 'readonly', label: 'Read Only' }, { value: 'required', label: 'Required' }, - { value: 'showRequired', label: 'Show Required' } + { value: 'showRequired', label: 'Show Required' }, + { value: 'errorLimit', label: 'Limit Error Message' } ]; ngOnInit() { diff --git a/projects/ui/src/lib/components/po-field/po-url/samples/sample-po-url-labs/sample-po-url-labs.component.html b/projects/ui/src/lib/components/po-field/po-url/samples/sample-po-url-labs/sample-po-url-labs.component.html index 5103d7b77f..604d7ea07b 100644 --- a/projects/ui/src/lib/components/po-field/po-url/samples/sample-po-url-labs/sample-po-url-labs.component.html +++ b/projects/ui/src/lib/components/po-field/po-url/samples/sample-po-url-labs/sample-po-url-labs.component.html @@ -19,6 +19,7 @@ (p-change)="changeEvent('p-change')" (p-change-model)="changeEvent('p-change-model')" (p-enter)="changeEvent('p-enter')" + [p-error-limit]="properties?.includes('errorLimit')" > diff --git a/projects/ui/src/lib/components/po-field/po-url/samples/sample-po-url-labs/sample-po-url-labs.component.ts b/projects/ui/src/lib/components/po-field/po-url/samples/sample-po-url-labs/sample-po-url-labs.component.ts index 3852fa9ccc..e26b6b4143 100644 --- a/projects/ui/src/lib/components/po-field/po-url/samples/sample-po-url-labs/sample-po-url-labs.component.ts +++ b/projects/ui/src/lib/components/po-field/po-url/samples/sample-po-url-labs/sample-po-url-labs.component.ts @@ -25,7 +25,8 @@ export class SamplePoUrlLabsComponent implements OnInit { { value: 'readonly', label: 'Read Only' }, { value: 'showRequired', label: 'Show Required' }, { value: 'requiredFieldErrorMessage', label: 'Required Field Error Message' }, - { value: 'required', label: 'Required' } + { value: 'required', label: 'Required' }, + { value: 'errorLimit', label: 'Limit Error Message' } ]; ngOnInit() {