import { Observable, Subject } from 'rxjs'; import { NzSafeAny, NzSizeLDSType } from 'ng-zorro-antd/core/types'; import * as i0 from '@angular/core'; import { TemplateRef, ElementRef, OnChanges, OnDestroy, EventEmitter, SimpleChanges, InjectionToken, AfterViewInit, AfterContentChecked, QueryList, OnInit, AfterContentInit } from '@angular/core'; import { RouterLink } from '@angular/router'; import { FocusableOption } from '@angular/cdk/a11y'; import { Direction } from '@angular/cdk/bidi'; import { NzConfigKey, NzConfigService } from 'ng-zorro-antd/core/config'; /** * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE */ type NzTabPosition = 'top' | 'bottom' | 'left' | 'right'; type NzTabType = 'line' | 'card' | 'editable-card'; type NzTabsCanDeactivateFn = (fromIndex: number, toIndex: number) => Observable | Promise | boolean; type NzTabPositionMode = 'horizontal' | 'vertical'; interface NzAnimatedInterface { inkBar: boolean; tabPane: boolean; } declare class NzTabChangeEvent { index?: number; tab: NzSafeAny; } interface NzTabScrollListOffset { x: number; y: number; } type NzTabScrollListOffsetEvent = NzTabScrollListOffset & { event: Event; }; interface NzTabWheelScrollEvent { type: 'wheel'; event: WheelEvent; } interface NzTabTouchScrollEvent { type: 'touchstart' | 'touchmove' | 'touchend'; event: TouchEvent; } type NzTabScrollEvent = NzTabTouchScrollEvent | NzTabWheelScrollEvent; type NzTabScrollEventHandlerFun = (event: T) => void; interface TabTemplateContext { visible: boolean; } /** * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE */ declare class NzTabAddButtonComponent { addIcon: string | TemplateRef; private readonly element; getElementWidth(): number; getElementHeight(): number; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare class NzTabBarExtraContentDirective { readonly position: i0.InputSignal<"start" | "end">; readonly templateRef: TemplateRef; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } declare class NzTabBodyComponent { content: TemplateRef | null; active: boolean; animated: boolean; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } /** * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE */ declare class NzTabCloseButtonComponent { closeIcon: string | TemplateRef; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } /** * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE */ /** * Fix https://github.com/angular/angular/issues/8563 */ declare class NzTabLinkTemplateDirective { templateRef: TemplateRef; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } /** * This component is for catching `routerLink` directive. */ declare class NzTabLinkDirective { elementRef: ElementRef; routerLink: RouterLink | null; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } /** * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE */ /** * Used to provide a tab set to a tab without causing a circular dependency. */ declare const NZ_TAB_SET: InjectionToken; declare class NzTabComponent implements OnChanges, OnDestroy { nzTitle: string | TemplateRef; nzClosable: boolean; nzCloseIcon: string | TemplateRef; nzDisabled: boolean; nzForceRender: boolean; readonly nzSelect: EventEmitter; readonly nzDeselect: EventEmitter; readonly nzClick: EventEmitter; readonly nzContextmenu: EventEmitter; nzTabLinkTemplateDirective: NzTabLinkTemplateDirective; template: TemplateRef | null; linkDirective: NzTabLinkDirective; contentTemplate: TemplateRef; isActive: boolean; hasBeenActive: boolean; position: number | null; origin: number | null; closestTabSet: any; readonly stateChanges: Subject; get content(): TemplateRef; get label(): string | TemplateRef; ngOnChanges(changes: SimpleChanges): void; ngOnDestroy(): void; setActive(active: boolean): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; static ngAcceptInputType_nzClosable: unknown; static ngAcceptInputType_nzDisabled: unknown; static ngAcceptInputType_nzForceRender: unknown; } /** * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE */ declare class NzTabNavItemDirective implements FocusableOption { disabled: boolean; tab: NzTabComponent; active: boolean; elementRef: ElementRef; private el; private parentElement; focus(): void; get width(): number; get height(): number; get left(): number; get top(): number; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; static ngAcceptInputType_disabled: unknown; static ngAcceptInputType_active: unknown; } /** * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE */ declare class NzTabNavOperationComponent implements OnDestroy { items: NzTabNavItemDirective[]; addable: boolean; addIcon: string | TemplateRef; readonly addClicked: EventEmitter; readonly selected: EventEmitter; closeAnimationWaitTimeoutId?: ReturnType; menuOpened: boolean; private cdr; private readonly element; onSelect(item: NzTabNavItemDirective): void; onContextmenu(item: NzTabNavItemDirective, e: MouseEvent): void; showItems(): void; menuVisChange(visible: boolean): void; getElementWidth(): number; getElementHeight(): number; ngOnDestroy(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; static ngAcceptInputType_addable: unknown; } declare class NzTabsInkBarDirective { private ngZone; private el; position: NzTabPositionMode; animated: boolean; animationMode: "NoopAnimations" | "BrowserAnimations" | null; get _animated(): boolean; alignToElement(element: HTMLElement): void; setStyles(element: HTMLElement): void; getLeftPosition(element: HTMLElement): string; getElementWidth(element: HTMLElement): string; getTopPosition(element: HTMLElement): string; getElementHeight(element: HTMLElement): string; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } declare class NzTabNavBarComponent implements AfterViewInit, AfterContentChecked, OnChanges { private cdr; private ngZone; private viewportRuler; private nzResizeObserver; private dir; private destroyRef; readonly indexFocused: EventEmitter; readonly selectFocusedIndex: EventEmitter; readonly addClicked: EventEmitter; readonly tabScroll: EventEmitter; position: NzTabPositionMode; addable: boolean; hideBar: boolean; addIcon: string | TemplateRef; inkBarAnimated: boolean; extraTemplate?: TemplateRef; readonly extraContents: i0.InputSignal; readonly startExtraContent: i0.Signal; readonly endExtraContent: i0.Signal; get selectedIndex(): number; set selectedIndex(value: number); navWrapRef: ElementRef; navListRef: ElementRef; operationRef: NzTabNavOperationComponent; addBtnRef: NzTabAddButtonComponent; inkBar: NzTabsInkBarDirective; items: QueryList; /** 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); get showAddButton(): boolean; translate: null | string; transformX: number; transformY: number; pingLeft: boolean; pingRight: boolean; pingTop: boolean; pingBottom: boolean; hiddenItems: NzTabNavItemDirective[]; private keyManager; private _selectedIndex; private wrapperWidth; private wrapperHeight; private scrollListWidth; private scrollListHeight; private operationWidth; private operationHeight; private addButtonWidth; private addButtonHeight; private selectedIndexChanged; private lockAnimationTimeoutId?; private cssTransformTimeWaitingId?; constructor(); ngAfterViewInit(): void; ngAfterContentChecked(): void; onSelectedFromMenu(tab: NzTabNavItemDirective): void; onOffsetChange(e: NzTabScrollListOffsetEvent): void; handleKeydown(event: KeyboardEvent): void; private isValidIndex; private scrollToTab; private lockAnimation; private setTransform; private clampTransformX; private clampTransformY; private updateScrollListPosition; private resetSizes; private alignInkBarToSelectedTab; private setPingStatus; private setVisibleRange; private getLayoutDirection; ngOnChanges(changes: SimpleChanges): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; static ngAcceptInputType_addable: unknown; static ngAcceptInputType_hideBar: unknown; } /** * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE */ declare class NzTabScrollListDirective implements OnInit { private ngZone; private destroyRef; private el; lastWheelDirection: 'x' | 'y' | null; lastWheelTimestamp: number; lastTimestamp: number; lastTimeDiff: number; lastMixedWheel: number; lastWheelPrevent: boolean; touchPosition: NzTabScrollListOffset | null; lastOffset: NzTabScrollListOffset | null; motion: number; readonly offsetChange: EventEmitter; readonly tabScroll: EventEmitter; ngOnInit(): void; private subscribeWrap; onTouchEnd: (e: TouchEvent) => void; onTouchMove: (e: TouchEvent) => void; onTouchStart: (e: TouchEvent) => void; onWheel: (e: WheelEvent) => void; onOffset(x: number, y: number, event: Event): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } /** Decorates the `ng-template` tags and reads out the template from it. */ declare class NzTabDirective { static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } declare class NzTabsComponent implements OnInit, AfterContentChecked, AfterContentInit { readonly _nzModuleName: NzConfigKey; nzConfigService: NzConfigService; private ngZone; private cdr; private directionality; private destroyRef; get nzSelectedIndex(): number | null; set nzSelectedIndex(value: null | number); nzTabPosition: NzTabPosition; nzTabBarExtraContent?: TemplateRef; nzCanDeactivate: NzTabsCanDeactivateFn | null; nzAddIcon: string | TemplateRef; nzTabBarStyle: Record | null; nzType: NzTabType; nzSize: NzSizeLDSType; nzAnimated: NzAnimatedInterface | boolean; nzTabBarGutter?: number; nzHideAdd: boolean; nzCentered: boolean; nzHideAll: boolean; nzLinkRouter: boolean; nzLinkExact: boolean; nzDestroyInactiveTabPane: boolean; readonly nzSelectChange: EventEmitter; readonly nzSelectedIndexChange: EventEmitter; readonly nzTabListScroll: EventEmitter; readonly nzClose: EventEmitter<{ index: number; }>; readonly nzAdd: EventEmitter; get position(): NzTabPositionMode; get addable(): boolean; get closable(): boolean; get line(): boolean; get inkBarAnimated(): boolean; get tabPaneAnimated(): boolean; allTabs: QueryList; tabLinks: QueryList; tabNavBarRef: NzTabNavBarComponent; tabs: QueryList; readonly extraContents: i0.Signal; dir: Direction; private readonly tabSetId; private indexToSelect; private selectedIndex; private tabLabelSubscription; private canDeactivateSubscription; private router; constructor(); ngOnInit(): void; ngAfterContentInit(): void; ngAfterContentChecked(): void; onClose(index: number, e: MouseEvent): void; onAdd(): void; private clampTabIndex; private createChangeEvent; private subscribeToTabLabels; private subscribeToAllTabChanges; canDeactivateFun(pre: number, next: number): Observable; clickNavItem(tab: NzTabComponent, index: number, e: MouseEvent): void; private isRouterLinkClickEvent; contextmenuNavItem(tab: NzTabComponent, e: MouseEvent): void; setSelectedIndex(index: number): void; getTabIndex(tab: NzTabComponent, index: number): number | null; getTabContentId(i: number): string; private setUpRouter; private updateRouterActive; private findShouldActiveTabIndex; private isLinkActive; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; static ngAcceptInputType_nzHideAdd: unknown; static ngAcceptInputType_nzCentered: unknown; static ngAcceptInputType_nzHideAll: unknown; static ngAcceptInputType_nzLinkRouter: unknown; static ngAcceptInputType_nzLinkExact: unknown; static ngAcceptInputType_nzDestroyInactiveTabPane: unknown; } /** * @deprecated Use `NzTabsComponent` instead. This will be removed in 21.0.0. */ declare const NzTabSetComponent: typeof NzTabsComponent; declare class NzTabsModule { static ɵfac: i0.ɵɵFactoryDeclaration; static ɵmod: i0.ɵɵNgModuleDeclaration; static ɵinj: i0.ɵɵInjectorDeclaration; } export { NZ_TAB_SET, NzTabBarExtraContentDirective, NzTabChangeEvent, NzTabComponent, NzTabDirective, NzTabLinkDirective, NzTabLinkTemplateDirective, NzTabSetComponent, NzTabsComponent, NzTabsModule, NzTabAddButtonComponent as ɵNzTabAddButtonComponent, NzTabBodyComponent as ɵNzTabBodyComponent, NzTabCloseButtonComponent as ɵNzTabCloseButtonComponent, NzTabNavBarComponent as ɵNzTabNavBarComponent, NzTabNavItemDirective as ɵNzTabNavItemDirective, NzTabNavOperationComponent as ɵNzTabNavOperationComponent, NzTabScrollListDirective as ɵNzTabScrollListDirective, NzTabsInkBarDirective as ɵNzTabsInkBarDirective }; export type { NzAnimatedInterface, NzTabPosition, NzTabPositionMode, NzTabScrollEvent, NzTabScrollEventHandlerFun, NzTabScrollListOffset, NzTabScrollListOffsetEvent, NzTabType, NzTabsCanDeactivateFn, TabTemplateContext };