import * as _angular_cdk_bidi from '@angular/cdk/bidi'; import { Direction } from '@angular/cdk/bidi'; import * as _angular_core from '@angular/core'; import { OnDestroy, ElementRef, AfterContentInit, AfterContentChecked, AfterViewInit, Signal, ChangeDetectorRef } from '@angular/core'; import * as _spartan_ng_brain_tabs from '@spartan-ng/brain/tabs'; import { BooleanInput } from '@angular/cdk/coercion'; import { FocusableOption } from '@angular/cdk/a11y'; import { Observable, Subject } from 'rxjs'; declare class BrnTabsContent implements OnDestroy { private readonly _root; private readonly _elementRef; readonly contentFor: _angular_core.InputSignal; protected readonly _isSelected: _angular_core.Signal; protected readonly _contentId: _angular_core.Signal; protected readonly _labelId: _angular_core.Signal; constructor(); focus(): void; ngOnDestroy(): void; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } declare class BrnTabsTrigger implements OnDestroy { readonly elementRef: ElementRef; private readonly _root; protected readonly _orientation: _angular_core.InputSignal<_spartan_ng_brain_tabs.BrnTabsOrientation>; readonly triggerFor: _angular_core.InputSignal; readonly selected: _angular_core.Signal; protected readonly _contentId: _angular_core.Signal; protected readonly _labelId: _angular_core.Signal; readonly _disabled: _angular_core.InputSignalWithTransform; get disabled(): boolean; constructor(); focus(): void; activate(): void; get key(): string | undefined; ngOnDestroy(): void; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } type BrnTabsOrientation = 'horizontal' | 'vertical'; type BrnTabsDirection = 'ltr' | 'rtl'; type BrnActivationMode = 'automatic' | 'manual'; type TabEntry = { trigger: BrnTabsTrigger; content: BrnTabsContent; }; declare class BrnTabs { private readonly _dir; readonly orientation: _angular_core.InputSignal; /** internal **/ $orientation: _angular_core.InputSignal; /** internal **/ readonly direction: _angular_core.WritableSignal<_angular_cdk_bidi.Direction>; readonly activeTab: _angular_core.ModelSignal; /** internal **/ $activeTab: _angular_core.Signal; readonly activationMode: _angular_core.InputSignal; /** internal **/ $activationMode: _angular_core.InputSignal; readonly tabActivated: _angular_core.OutputEmitterRef; private readonly _tabs; readonly $tabs: _angular_core.Signal<{ [key: string]: TabEntry; }>; registerTrigger(key: string, trigger: BrnTabsTrigger): void; registerContent(key: string, content: BrnTabsContent): void; unregisterTrigger(key: string): void; unregisterContent(key: string): void; private updateEntry; emitTabActivated(key: string): void; setActiveTab(key: string): void; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } declare class BrnTabsContentLazy { private readonly _root; private readonly _content; private readonly _templateRef; private readonly _viewContainerRef; private readonly _destroyRef; private _hasBeenActivated; constructor(); static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } declare class BrnTabsList implements AfterContentInit { private readonly _root; protected readonly _orientation: _angular_core.InputSignal<_spartan_ng_brain_tabs.BrnTabsOrientation>; private readonly _direction; private readonly _injector; private _keyManager?; readonly triggers: _angular_core.Signal; ngAfterContentInit(): void; protected _onFocusIn(event: FocusEvent): void; protected _onKeydown(event: KeyboardEvent): void; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } /** * The directions that scrolling can go in when the header's tabs exceed the header width. 'After' * will scroll the header towards the end of the tabs list and 'before' will scroll towards the * beginning of the list. */ type ScrollDirection = 'after' | 'before'; /** Item inside a paginated tab header. */ type BrnPaginatedTabHeaderItem = FocusableOption & { elementRef: ElementRef; }; /** * Base class for a tab header that supported pagination. * @docs-private */ declare abstract class BrnTabsPaginatedList implements AfterContentChecked, AfterContentInit, AfterViewInit, OnDestroy { abstract items: Signal>; abstract itemsChanges: Observable>; abstract tabListContainer: Signal>; abstract tabList: Signal>; abstract tabListInner: Signal>; abstract nextPaginator: Signal>; abstract previousPaginator: Signal>; /** The distance in pixels that the tab labels should be translated to the left. */ private _scrollDistance; /** Whether the header should scroll to the selected index after the view has been checked. */ private _selectedIndexChanged; private readonly _root; private readonly _activeTab; private readonly _tabs; /** Emits when the component is destroyed. */ protected readonly _destroyed: Subject; /** Whether the controls for pagination should be displayed */ readonly showPaginationControls: _angular_core.WritableSignal; /** Whether the tab list can be scrolled more towards the end of the tab label list. */ disableScrollAfter: boolean; /** Whether the tab list can be scrolled more towards the beginning of the tab label list. */ disableScrollBefore: boolean; /** * The number of tab labels that are displayed on the header. When this changes, the header * should re-evaluate the scroll position. */ private _tabLabelCount; /** Whether the scroll distance has changed and should be applied after the view is checked. */ private _scrollDistanceChanged; /** Used to manage focus between the tabs. */ private _keyManager; /** Cached text content of the header. */ private _currentTextContent; /** Stream that will stop the automated scrolling. */ private readonly _stopScrolling; /** * Whether pagination should be disabled. This can be used to avoid unnecessary * layout recalculations if it's known that pagination won't be required. */ readonly disablePagination: _angular_core.InputSignalWithTransform; /** Index of the active tab among this list's items, or undefined when there isn't one. */ private readonly _selectedItemIndex; /** The index of the active tab, falling back to the first tab. */ private readonly _selectedIndex; /** Event emitted when the option is selected. */ readonly selectFocusedIndex: _angular_core.OutputEmitterRef; /** Event emitted when a label is focused. */ readonly indexFocused: _angular_core.OutputEmitterRef; private readonly _sharedResizeObserver; private readonly _injector; protected _elementRef: ElementRef; protected _changeDetectorRef: ChangeDetectorRef; private readonly _viewportRuler; private readonly _dir; private readonly _ngZone; private readonly _platform; readonly animationMode: "NoopAnimations" | "BrowserAnimations" | null; constructor(); /** Called when the user has selected an item via the keyboard. */ protected abstract _itemSelected(event: KeyboardEvent): void; ngAfterViewInit(): void; ngAfterContentInit(): void; /** Sends any changes that could affect the layout of the items. */ private _itemsResized; ngAfterContentChecked(): void; ngOnDestroy(): void; /** Handles keyboard events on the header. */ _handleKeydown(event: KeyboardEvent): void; /** * Callback for when the MutationObserver detects that the content has changed. */ _onContentChanges(): void; /** * Updates the view whether pagination should be enabled or not. * * WARNING: Calling this method can be very costly in terms of performance. It should be called * as infrequently as possible from outside of the Tabs component as it causes a reflow of the * page. */ updatePagination(): void; /** Tracks which element has focus; used for keyboard navigation */ get focusIndex(): number; /** When the focus index is set, we must manually send focus to the correct label */ set focusIndex(value: number); /** * Determines if an index is valid. If the tabs are not ready yet, we assume that the user is * providing a valid index and return true. */ _isValidIndex(index: number): boolean; /** * Sets focus on the HTML element for the label wrapper and scrolls it into the view if * scrolling is enabled. */ _setTabFocus(tabIndex: number): void; /** The layout direction of the containing app. */ _getLayoutDirection(): Direction; /** Performs the CSS transformation on the tab list that will cause the list to scroll. */ _updateTabScrollPosition(): void; /** Sets the distance in pixels that the tab header should be transformed in the X-axis. */ get scrollDistance(): number; set scrollDistance(value: number); /** * Moves the tab list in the 'before' or 'after' direction (towards the beginning of the list or * the end of the list, respectively). The distance to scroll is computed to be a third of the * length of the tab list view window. * * This is an expensive call that forces a layout reflow to compute box and scroll metrics and * should be called sparingly. */ _scrollHeader(direction: ScrollDirection): { maxScrollDistance: number; distance: number; }; /** Handles click events on the pagination arrows. */ _handlePaginatorClick(direction: ScrollDirection): void; /** * Moves the tab list such that the desired tab label (marked by index) is moved into view. * * This is an expensive call that forces a layout reflow to compute box and scroll metrics and * should be called sparingly. */ _scrollToLabel(labelIndex: number): void; /** * Evaluate whether the pagination controls should be displayed. If the scroll width of the * tab list is wider than the size of the header container, then the pagination controls should * be shown. * * This is an expensive call that forces a layout reflow to compute box and scroll metrics and * should be called sparingly. */ _checkPaginationEnabled(): void; /** * Evaluate whether the before and after controls should be enabled or disabled. * If the header is at the beginning of the list (scroll distance is equal to 0) then disable the * before button. If the header is at the end of the list (scroll distance is equal to the * maximum distance we can scroll), then disable the after button. * * This is an expensive call that forces a layout reflow to compute box and scroll metrics and * should be called sparingly. */ _checkScrollingControls(): void; /** * Determines what is the maximum length in pixels that can be set for the scroll distance. This * is equal to the difference in width between the tab list container and tab header container. * * This is an expensive call that forces a layout reflow to compute box and scroll metrics and * should be called sparingly. */ _getMaxScrollDistance(): number; /** Stops the currently-running paginator interval. */ _stopInterval(): void; /** * Handles the user pressing down on one of the paginators. * Starts scrolling the header after a certain amount of time. * @param direction In which direction the paginator should be scrolled. */ _handlePaginatorPress(direction: ScrollDirection, mouseEvent?: MouseEvent): void; /** * Scrolls the header to a given position. * @param position Position to which to scroll. * @returns Information on the current scroll distance and the maximum. */ private _scrollTo; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } declare const BrnTabsImports: readonly [typeof BrnTabs, typeof BrnTabsList, typeof BrnTabsTrigger, typeof BrnTabsContent, typeof BrnTabsContentLazy]; export { BrnTabs, BrnTabsContent, BrnTabsContentLazy, BrnTabsImports, BrnTabsList, BrnTabsPaginatedList, BrnTabsTrigger }; export type { BrnActivationMode, BrnPaginatedTabHeaderItem, BrnTabsDirection, BrnTabsOrientation, ScrollDirection, TabEntry };