UNPKG

govbr-ds-angular

Version:

Implementação em Angular do Design System GovBR.

129 lines (128 loc) 4.49 kB
import { EventEmitter } from '@angular/core'; import { AbstractControl, ControlValueAccessor, ValidationErrors, Validator } from '@angular/forms'; import { SizeOptions } from '../../types/size.type'; import * as i0 from "@angular/core"; /** * Componente TextareaComponent é responsável por exibir um campo de texto multilinha. * Implementa a interface ControlValueAccessor para integração com formulários Angular. * @example * <app-textarea [label]="'Digite algo'" [id]="'textarea1'" [(ngModel)]="text"></app-textarea> * * @public * {@link https://www.gov.br/ds/components/textarea?tab=desenvolvedor|Documentação oficial} */ export declare class TextareaComponent implements ControlValueAccessor, Validator { /** * Rótulo do campo de texto. * @type {string} * @required */ label: string; /** * ID do campo de texto. * @type {string} * @required */ id: string; /** * Nome do campo de texto. * @type {string} */ name: string; /** * Tamanho do campo de texto. * @type {SizeOptions} * @default 'medium' */ size: SizeOptions; /** * Placeholder do campo de texto. * @type {string} */ placeholder: string; /** * Dica de uso para o campo de texto. * @type {string} */ hint: string; /** * Indica se o campo de texto está desabilitado. * @type {boolean} * @default false */ disabled: boolean; /** * Indica se o campo de texto é somente leitura. * @type {boolean} * @default false */ readonly: boolean; /** * Indica se o limite de caracteres deve ser exibido. * @type {boolean} * @default true */ showLimit: boolean; /** * Indica se o contador de caracteres deve ser exibido. * @type {boolean} * @default true */ showCounter: boolean; /** * Comprimento máximo do campo de texto. * @type {number} */ maxLength: number; /** * Obtém se o campo de texto é obrigatório. * @type {boolean} */ get required(): boolean; /** * Define se o campo de texto é obrigatório. * @type {boolean} */ set required(value: boolean); /** * Evento emitido quando o valor do campo de texto muda. * @type {EventEmitter<string>} */ textChange: EventEmitter<string>; /** * Controle do formulário associado ao campo de texto. * @type {AbstractControl} */ control?: AbstractControl; protected _required: boolean | undefined; protected _value: string; /** * Obtém o valor do campo de texto. * @type {string} */ get value(): string; /** * Define o valor do campo de texto. * @type {string} */ set value(val: string); protected _touched: () => void; protected _validate: () => void; protected _change: (value: string) => void; validate(control: AbstractControl): ValidationErrors | null; writeValue(value: string): void; setDisabledState(disabled: boolean): void; registerOnChange(fn: (value: string) => void): void; registerOnTouched(fn: () => void): void; registerOnValidatorChange?(fn: () => void): void; onChange(event: Event): void; onBlur(): void; static ɵfac: i0.ɵɵFactoryDeclaration<TextareaComponent, never>; static ɵcmp: i0.ɵɵComponentDeclaration<TextareaComponent, "app-textarea", never, { "label": { "alias": "label"; "required": true; }; "id": { "alias": "id"; "required": true; }; "name": { "alias": "name"; "required": false; }; "size": { "alias": "size"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "hint": { "alias": "hint"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "readonly": { "alias": "readonly"; "required": false; }; "showLimit": { "alias": "showLimit"; "required": false; }; "showCounter": { "alias": "showCounter"; "required": false; }; "maxLength": { "alias": "maxLength"; "required": false; }; "required": { "alias": "required"; "required": false; }; }, { "textChange": "textChange"; }, never, ["*"], true, never>; static ngAcceptInputType_disabled: unknown; static ngAcceptInputType_readonly: unknown; static ngAcceptInputType_showLimit: unknown; static ngAcceptInputType_showCounter: unknown; static ngAcceptInputType_maxLength: unknown; static ngAcceptInputType_required: unknown; }