import * as _angular_core from '@angular/core'; import { OnInit, ElementRef } from '@angular/core'; import { Highlightable, ActiveDescendantKeyManager } from '@angular/cdk/a11y'; import * as i3 from '@odx/angular'; /** * Represents an individual tab item in a tab bar interface, providing functionalities * for activation, deactivation, and optional closing of the tab. This component is designed * to be used within a `TabBarComponent` to create a complete tabbed interface. * * It supports disabled state management through `DisabledController`, allowing the tab to be * disabled based on parent component states or its own `disabled` input property. * * The component integrates with Angular's `RouterLinkActive` to automatically set active * styles based on the current router state, enhancing SPA navigation experiences. */ declare class TabBarItemComponent implements Highlightable, OnInit { private readonly disabledController; private readonly tabBar; private readonly routerLinkActive; private readonly takeUntilDestroyed; protected isActive: boolean; readonly element: ElementRef; get disabled(): boolean; /** * Indicates if the tab can be closed. This controls the visibility of the close button * and enables the emission of the `tabClose` event when the tab is closed. * * @type {boolean} * @default false */ closable: _angular_core.InputSignalWithTransform; /** * Event emitter that fires when the tab is closed. It emits the instance of the tab item component. * * @emits {TabBarItemComponent} */ tabClose: _angular_core.OutputEmitterRef; ngOnInit(): void; /** * Sets the tab as active and applies corresponding styles. This method is part of the * `Highlightable` interface, allowing the tab bar to manage active states. */ setActiveStyles(): void; /** * Sets the tab as inactive and removes corresponding active styles. This method is part of the * `Highlightable` interface. */ setInactiveStyles(): void; protected onClick(): void; protected handleClose(event: Event): void; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵcmp: _angular_core.ɵɵComponentDeclaration; } interface TabChangeEvent { selectedIndex: number | null; selectedTab: TabBarItemComponent | null; } /** * `TabBarComponent` creates a dynamic and accessible tab bar interface, * facilitating the management and interaction with a collection of tabs. * It supports keyboard navigation, dynamic tab management, and responsive overflow actions. * * The component integrates with Angular's ContentChildren to dynamically manage the tabs based on their content. * It uses ActiveDescendantKeyManager from Angular CDK for managing focus and keyboard navigation, * making it accessible and user-friendly. Additionally, it handles overflow with navigational arrows, * allowing for a smooth user experience even with a large number of tabs. */ declare class TabBarComponent { private readonly takeUntilDestroyed; private readonly scrollableService; protected readonly nextTab: _angular_core.WritableSignal; protected readonly prevTab: _angular_core.WritableSignal; protected readonly tabs: _angular_core.Signal; protected readonly activeItem: _angular_core.Signal; protected readonly keyManager: ActiveDescendantKeyManager; protected readonly scrollContainerElement: _angular_core.Signal>; readonly element: ElementRef; /** * Index of the currently selected tab. Use this property to programmatically * change the active tab. It responds to changes by updating the active state of the corresponding * tab item and adjusting the view if necessary. Set it to `null` to deselect all tabs. * * @type {number | null} * @example * Programmatically select the second tab (index starts from 0): * ```html * * ``` */ selectedIndex: _angular_core.ModelSignal; /** * An EventEmitter that emits whenever a new tab is selected. It provides the `TabChangeEvent` * which contains the index of the newly selected tab and the instance of the corresponding * `TabBarItemComponent`. Subscribe to this output to perform actions when the active tab changes. * * @emits {TabChangeEvent} * @example * ```html * * ``` * * ```ts * onTabChange(event: TabChangeEvent): void { * console.log(`New active tab index: ${event.selectedIndex}`); * } * ``` */ selectedTabChanged: _angular_core.OutputEmitterRef; constructor(); /** * Activates the specified tab item, making it the currently selected tab. * If the item is already active, no action is taken. * * @param {TabBarItemComponent | null} item - The tab item to activate. */ activateItem(item?: TabBarItemComponent | null): void; /** * Fires when the specified tab item is removed from the tab bar. * If the item is currently active, the previous tab is activated. * * @param {TabBarItemComponent} item - The tab item to remove. */ removeItem(item: TabBarItemComponent): void; protected onKeydown(event: KeyboardEvent): void; protected onFocused(): void; protected scrollTabs(direction?: 1 | -1): void; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵcmp: _angular_core.ɵɵComponentDeclaration; } declare class TabBarModule { static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵmod: _angular_core.ɵɵNgModuleDeclaration; static ɵinj: _angular_core.ɵɵInjectorDeclaration; } export { TabBarComponent, TabBarItemComponent, TabBarModule }; export type { TabChangeEvent };