UNPKG

@taiga-ui/kit

Version:
86 lines (85 loc) 3.08 kB
import { ElementRef, EventEmitter } from '@angular/core'; import { AbstractTuiInteractive, TuiContextWithImplicit, TuiFocusableElementAccessor, TuiNativeFocusableElement } from '@taiga-ui/cdk'; import { TuiAppearance, TuiBrightness, TuiButtonComponent, TuiHorizontalDirection, TuiModeDirective, TuiSizeS } from '@taiga-ui/core'; import { PolymorpheusContent } from '@tinkoff/ng-polymorpheus'; import { Observable } from 'rxjs'; export declare function nonNegativeInteger(length: number): boolean; export declare class TuiPaginationComponent extends AbstractTuiInteractive implements TuiFocusableElementAccessor { private readonly elementRef; private readonly modeDirective; readonly texts$: Observable<[string, string]>; length: number; size: TuiSizeS; readonly disabled = false; /** * Amount of visible pages around active page */ activePadding: number; /** * Amount of visible pages at the edges */ sidePadding: number; /** * Customization for page number display. */ content: PolymorpheusContent<TuiContextWithImplicit<number>> | null; /** * Active page index */ index: number; readonly indexChange: EventEmitter<number>; private readonly elements; constructor(elementRef: ElementRef<HTMLElement>, modeDirective: TuiModeDirective | null, texts$: Observable<[string, string]>); get nativeFocusableElement(): TuiNativeFocusableElement | null; get focused(): boolean; /** * Number of items in a container. */ get elementsLength(): number; get sizeM(): boolean; get mode(): TuiBrightness | null; get arrowIsDisabledLeft(): boolean; get arrowIsDisabledRight(): boolean; elementIsFocusable(index: number): boolean; getItemContext(index: number): TuiContextWithImplicit<number>; /** * Get index by element index * @param elementIndex * @returns index or null (for '…') */ getItemIndexByElementIndex(elementIndex: number): number | null; getElementMode(index: number): TuiAppearance; getSmallElementMode(index: number, mode: TuiBrightness | null): TuiAppearance; onElementClick(index: number): void; onElementKeyDownArrowLeft(element: TuiButtonComponent): void; onElementKeyDownArrowRight(element: TuiButtonComponent): void; onArrowClick(direction: TuiHorizontalDirection): void; onActiveZone(focused: boolean): void; /** * Active index from the end */ private get reverseIndex(); /** * Max number of elements in half (not counting the middle one). */ private get maxHalfLength(); /** * Is there '...' anywhere */ private get itemsFit(); /** * Max number of elements */ private get maxElementsLength(); private get lastIndex(); private get lastElementIndex(); /** * Are there collapsed items at that index * @param index * @returns there are collapsed items */ private hasCollapsedItems; private tryChangeTo; private focusActive; private updateIndex; }