import { BooleanInput, NumberInput } from '@angular/cdk/coercion'; import * as i0 from '@angular/core'; import { InjectionToken, OnChanges, OnDestroy, AfterContentInit, TemplateRef, EmbeddedViewRef, SimpleChanges, OnInit, AfterViewInit, ViewContainerRef, ElementRef, ChangeDetectorRef, QueryList, Injector, EventEmitter, AfterContentChecked } from '@angular/core'; import { Subject } from 'rxjs'; import { FocusMonitor, FocusableOption } from '@angular/cdk/a11y'; import * as i3 from '@aposin/ng-aquila/accordion'; import { NxExpansionPanelComponent, NxAccordionDirective } from '@aposin/ng-aquila/accordion'; import { NxViewportService } from '@aposin/ng-aquila/utils'; import { Directionality, Direction } from '@angular/cdk/bidi'; import { Platform } from '@angular/cdk/platform'; import * as i2 from '@angular/cdk/portal'; import { CdkPortal } from '@angular/cdk/portal'; import * as i1 from '@angular/common'; import * as i4 from '@aposin/ng-aquila/icon'; import * as i5 from '@aposin/ng-aquila/button'; type NxTabsAppearance = 'expert' | 'default'; interface TabGroupDefaultOptions { /** Sets the default appearance. */ appearance?: NxTabsAppearance; } declare const TAB_GROUP_DEFAULT_OPTIONS: InjectionToken; interface TabNavBarDefaultOptions { /** Sets the default appearance. */ appearance?: NxTabsAppearance; } declare const TAB_NAV_BAR_DEFAULT_OPTIONS: InjectionToken; /** @docs-private */ declare class NxTabGroupBase { disabled: boolean; appearance: NxTabsAppearance; _appearanceChange: Subject; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } declare class NxTabComponent implements OnChanges, OnDestroy, AfterContentInit { private readonly _tabGroup; /** Emits whenever the internal state of the tab changes. */ readonly _stateChanges: Subject; /** * Content for the tab label given by ``. * @docs-private */ set templateLabel(value: TemplateRef); get templateLabel(): TemplateRef; private _templateLabel; /** Template inside the NxTab view that contains an ``. */ _implicitContent: TemplateRef; /** * Template provided in the tab content that will be used if present, used to enable lazy-loading. */ _explicitContent: TemplateRef; /** Sets the label of the tab shown in the tablist. */ set label(value: string); get label(): string; private _label; /** Sets the tab to disabled. */ set disabled(value: BooleanInput); get disabled(): boolean; private _disabled; private _headerViewRef; private _contentViewRef; /** @docs-private */ get headerViewRef(): EmbeddedViewRef; /** @docs-private */ get contentViewRef(): EmbeddedViewRef; /** * Whether the tab is currently active. */ isActive: boolean; constructor(_tabGroup: NxTabGroupBase | null); ngOnChanges(changes: SimpleChanges): void; ngAfterContentInit(): void; ngOnDestroy(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } /** @docs-private */ declare class NxTabBodyComponent implements OnInit, OnDestroy, OnChanges, AfterViewInit { private readonly _tabGroup; private readonly _focusMonitor; private readonly _elementRef; _outlet: ViewContainerRef; tab: NxTabComponent; set active(value: BooleanInput); get active(): boolean; private _active; private readonly _destroyed; constructor(_tabGroup: NxTabGroupBase, _focusMonitor: FocusMonitor, _elementRef: ElementRef); ngOnInit(): void; ngAfterViewInit(): void; ngOnChanges(changes: SimpleChanges): void; ngOnDestroy(): void; attach(): void; detach(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } /** Decorates the `ng-template` tags and reads out the template from it. */ declare class NxTabContentDirective { readonly template: TemplateRef; constructor(/** @docs-private */ template: TemplateRef); static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } /** @docs-private */ declare abstract class NxScrollableTabBar implements AfterContentInit, OnDestroy { protected readonly _cdr: ChangeDetectorRef; private readonly _dir; private readonly _element; private readonly viewportService; tabHeaderContainer: ElementRef; scrollableTabsList: ElementRef; tabButtons: QueryList; _isScrolledToStart: boolean; _isScrolledToEnd: boolean; private readonly _destroyed; protected readonly _platform: Platform; protected readonly _injector: Injector; constructor(_cdr: ChangeDetectorRef, _dir: Directionality | null, _element: ElementRef, viewportService: NxViewportService); ngAfterContentInit(): void; ngOnDestroy(): void; _scrollHandler: (event: Event) => void; get direction(): Direction; get scrollable(): boolean; scrollToStart(): void; scrollToEnd(): void; _updateScrollButtons(): void; private _scrollTabListTo; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } /** @docs-private */ declare class NxTabLabelWrapperDirective implements FocusableOption { readonly elementRef: ElementRef; /** Whether the tab group is disabled. Default: false. */ set disabled(value: BooleanInput); get disabled(): boolean; private _disabled; constructor(elementRef: ElementRef); focus(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } /** @docs-private */ declare class NxTabHeaderComponent extends NxScrollableTabBar implements AfterContentInit, AfterViewInit { readonly _tabGroup: NxTabGroupBase | null; private _keyManager; scrollableTabsList: ElementRef; tabButtons: QueryList; set selectedIndex(value: number); get selectedIndex(): number; private _selectedIndex; set focusIndex(value: number); get focusIndex(): number; set autoselect(value: boolean); get autoselect(): boolean; private _autoselect; readonly selectFocusedIndex: EventEmitter; readonly indexFocused: EventEmitter; labels: QueryList; constructor(_cdr: ChangeDetectorRef, _dir: Directionality | null, _tabGroup: NxTabGroupBase | null, _element: ElementRef, viewportService: NxViewportService); ngAfterContentInit(): void; ngAfterViewInit(): void; private _isValidIndex; scrollToButton(index: number): void; /** * Handles keyboard inputs on the labels * If autoselect is enabled the tab gets changed immediately * If autoselect is disabled only the focus changes but the user still has to select the item by himself. */ handleKeydown(event: KeyboardEvent): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare class NxTabChangeEvent { /** The index of the selected or focused tab. */ index: number; /** The component instance of the selected or focused tab. */ tab: NxTabComponent; } declare class NxTabGroupComponent implements NxTabGroupBase, OnDestroy, AfterViewInit, AfterContentInit, AfterContentChecked { readonly viewportService: NxViewportService; private readonly _cdr; private readonly _defaultOptions; private readonly _focusMonitor; private readonly _groupId; private _indexToSelect; _showAccordion: boolean; /** @docs-private */ tabs: QueryList; /** @docs-private */ tabBodyChildren: QueryList; /** @docs-private */ tabHeader: NxTabHeaderComponent; /** @docs-private */ panels: QueryList; /** @docs-private */ accordion: NxAccordionDirective; _tabButtons: QueryList; /** Preserves the current value of the _tabButtons ViewChildren in case it changes. */ private _tabButtonsPrevious; /** Sets the selected tab. */ set selectedIndex(value: NumberInput); get selectedIndex(): number; private _selectedIndex; /** Whether the negative set of styling should be used. */ set negative(value: BooleanInput); get negative(): boolean; private _negative; /** Whether the tab group is disabled. Default: false. */ set disabled(value: BooleanInput); get disabled(): boolean; private _disabled; /** Whether the tab should be immediately selected on focus. */ set autoselect(value: BooleanInput); get autoselect(): boolean; private _autoselect; /** Whether the tabs should to accordion on mobile viewports. */ set mobileAccordion(value: BooleanInput); get mobileAccordion(): boolean; private _mobileAccordion; /** * **Expert option** * * Sets the appearance of the tab group. Default: 'default'. */ set appearance(value: NxTabsAppearance); get appearance(): NxTabsAppearance; private _appearance; /** An event emitted when the selected tab has changed. */ readonly selectedIndexChange: EventEmitter; /** An event emitted when the selected tab has changed. */ readonly selectedTabChange: EventEmitter; /** * An event emitted when focus has changed within a tab group. * * **Note:** is not supported in mobile view. */ readonly focusChange: EventEmitter; /** Subscription to changes in the tab labels. */ private _tabLabelSubscription; private _disabledTabsCache; readonly _appearanceChange: Subject; private readonly _destroyed; constructor(viewportService: NxViewportService, _cdr: ChangeDetectorRef, _defaultOptions: TabGroupDefaultOptions | null, _focusMonitor: FocusMonitor); ngAfterContentInit(): void; /** * After the content is checked, this component knows what tabs have been defined * and what the selected index should be. */ ngAfterContentChecked(): void; ngAfterViewInit(): void; ngOnDestroy(): void; /** * Subscribes to changes in the tab labels. This is needed, because the @Input for the label is * on the NxTab component, whereas the data binding is inside the NxTabGroup. In order for the * binding to be updated, we need to subscribe to changes in it and trigger change detection * manually. */ private _subscribeToTabLabels; /** Clamps the given index to the bounds of 0 and the tabs length. */ private _clampTabIndex; /** @docs-private */ focusChanged(index: number): void; private _createChangeEvent; /** @docs-private */ handleClick(index: number): void; /** * Returns the tabindex for a tab label. * @docs-private */ getTabIndex(tab: NxTabComponent, idx: number): number | null; /** Returns a unique id for each tab label element */ _getTabLabelId(i: number): string; /** Returns a unique id for each tab content element */ _getTabContentId(i: number): string; private _switchAppearance; /** * Emulate the tab change event when an accordion panel is opened in * mobile viewports. */ _panelOpened(index: number): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } /** @docs-private */ declare class NxTabLabelDirective extends CdkPortal { static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } declare class NxTabNavBarComponent extends NxScrollableTabBar { private readonly _defaultOptions; scrollableTabsList: ElementRef; tabButtons: QueryList; /** Whether the tab nav bar has negative styling. */ set negative(value: BooleanInput); get negative(): boolean; private _negative; /** Whether the tab nav bar has disabled styling. */ set disabled(value: BooleanInput); get disabled(): boolean; private _disabled; /** * **Expert option** * * Sets the appearance of the tab nav bar. Default: 'default'. */ set appearance(value: NxTabsAppearance); get appearance(): NxTabsAppearance; private _appearance; constructor(_cdr: ChangeDetectorRef, _dir: Directionality | null, _defaultOptions: TabNavBarDefaultOptions | null, _element: ElementRef, viewportService: NxViewportService); static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare class NxTabLinkDirective implements OnDestroy, AfterViewInit { private readonly _tabNavBar; private readonly _elementRef; private readonly _focusMonitor; /** Whether the tab link is active and has the active styling. */ set active(value: BooleanInput); get active(): boolean; private _active; /** Whether the tab link is disabled. Default: false. */ set disabled(value: BooleanInput); get disabled(): boolean; private _disabled; constructor(_tabNavBar: NxTabNavBarComponent | null, _elementRef: ElementRef, _focusMonitor: FocusMonitor); ngAfterViewInit(): void; ngOnDestroy(): void; _getTabIndex(): string; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } /** @docs-private */ declare class NxTabHeaderOutletComponent implements OnInit, OnDestroy { private readonly _tabGroup; _outlet: ViewContainerRef; content: EmbeddedViewRef; private readonly _destroyed; constructor(_tabGroup: NxTabGroupBase); ngOnInit(): void; attach(): void; detach(): void; ngOnDestroy(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } type NxScrollDirection = 'start' | 'end'; declare class NxTabScrollIndicator implements OnDestroy { private readonly _cdr; private readonly _viewportService; private readonly _dir; _view: string; scrollDirection: NxScrollDirection; isScrolledToStart: boolean; isScrolledToEnd: boolean; readonly buttonClicked: EventEmitter; private readonly _destroyed; constructor(_cdr: ChangeDetectorRef, _viewportService: NxViewportService, _dir: Directionality | null); ngOnDestroy(): void; get direction(): Direction; getChevronName(): string; scroll(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare class NxTabsModule { static ɵfac: i0.ɵɵFactoryDeclaration; static ɵmod: i0.ɵɵNgModuleDeclaration; static ɵinj: i0.ɵɵInjectorDeclaration; } export { NxTabBodyComponent, NxTabChangeEvent, NxTabComponent, NxTabContentDirective, NxTabGroupComponent, NxTabHeaderComponent, NxTabLabelDirective, NxTabLabelWrapperDirective, NxTabLinkDirective, NxTabNavBarComponent, NxTabsModule, TAB_GROUP_DEFAULT_OPTIONS, TAB_NAV_BAR_DEFAULT_OPTIONS }; export type { NxTabsAppearance, TabGroupDefaultOptions, TabNavBarDefaultOptions };