govbr-ds-angular
Version:
Implementação em Angular do Design System GovBR.
66 lines (65 loc) • 2.16 kB
TypeScript
import { EventEmitter, OnInit } from '@angular/core';
import { SizeOptions } from '../../types/size.type';
import * as i0 from "@angular/core";
export type Tabs = Array<TabItem>;
export interface TabItem {
label: string;
id: string | number;
icon?: string;
count?: number;
active?: boolean;
}
/**
* Componente TabsComponent é responsável por exibir abas com várias opções de configuração.
* @example
* <app-tabs [tabs]="[{ label: 'Tab 1', id: 1 }, { label: 'Tab 2', id: 2 }]" [(activeTab)]="activeTab"></app-tabs>
*
* @public
* {@link https://www.gov.br/ds/components/tab?tab=desenvolvedor|Documentação oficial}
*/
export declare class TabsComponent implements OnInit {
/**
* Armazena o ID da aba ativa.
* @type {string | number}
* @private
*/
private _activeTab;
/**
* Define o tamanho das abas.
* @type {SizeOptions}
* @default 'medium'
*/
size: SizeOptions;
/**
* Indica se as abas devem exibir apenas ícones.
* @type {boolean}
* @default false
*/
onlyIcon: boolean;
/**
* Lista de abas.
* @type {Tabs}
* @required
*/
tabs: Tabs;
/**
* Obtém o ID da aba ativa.
* @type {string | number}
*/
get activeTab(): string | number;
/**
* Define o ID da aba ativa e emite um evento de mudança.
* @type {string | number}
*/
set activeTab(value: string | number);
/**
* Evento emitido quando a aba ativa muda.
* @type {EventEmitter<string | number>}
*/
activeTabChange: EventEmitter<string | number>;
ngOnInit(): void;
selectedTab(tab: TabItem): void;
static ɵfac: i0.ɵɵFactoryDeclaration<TabsComponent, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<TabsComponent, "app-tabs", never, { "size": { "alias": "size"; "required": false; }; "onlyIcon": { "alias": "onlyIcon"; "required": false; }; "tabs": { "alias": "tabs"; "required": true; }; "activeTab": { "alias": "activeTab"; "required": false; }; }, { "activeTabChange": "activeTabChange"; }, never, never, true, never>;
static ngAcceptInputType_onlyIcon: unknown;
}