govbr-ds-angular
Version:
Implementação em Angular do Design System GovBR.
50 lines (49 loc) • 2.11 kB
TypeScript
import { EventEmitter } from '@angular/core';
import { ControlValueAccessor } from '@angular/forms';
import { RadioOptions } from '../../models';
import * as i0 from "@angular/core";
/**
* Componente RadioComponent é responsável por exibir um grupo de opções de rádio.
* Implementa a interface ControlValueAccessor para integração com formulários Angular.
* @example
* <app-radio [options]="[{ label: 'Opção 1', value: 1 }, { label: 'Opção 2', value: 2 }]" [(ngModel)]="selectedOption"></app-radio>
*
* @public
* {@link https://www.gov.br/ds/components/radio?tab=desenvolvedor|Documentação oficial}
*/
export declare class RadioComponent implements ControlValueAccessor {
/**
* Opções de rádio.
* @type {RadioOptions}
*/
options: RadioOptions;
/**
* Rótulo do grupo de rádio.
* @type {string}
*/
label: string;
/**
* Dica de uso para o grupo de rádio.
* @type {string}
*/
hint: string;
/**
* Indica se o grupo de rádio deve ser exibido horizontalmente.
* @type {boolean}
* @default false
*/
horizontal: boolean;
get value(): string | number;
set value(val: string | number);
private _value;
valueChange: EventEmitter<string | number>;
protected _touched: () => void;
protected _change: (value: string | number) => void;
onChange(value: string | number): void;
writeValue(obj: string | number): void;
registerOnChange(fn: (value: string | number) => void): void;
registerOnTouched(fn: () => void): void;
static ɵfac: i0.ɵɵFactoryDeclaration<RadioComponent, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<RadioComponent, "app-radio", never, { "options": { "alias": "options"; "required": false; }; "label": { "alias": "label"; "required": false; }; "hint": { "alias": "hint"; "required": false; }; "horizontal": { "alias": "horizontal"; "required": false; }; "value": { "alias": "value"; "required": false; }; }, { "valueChange": "valueChange"; }, never, never, true, never>;
static ngAcceptInputType_horizontal: unknown;
}