UNPKG

@doku-dev/doku-fragment

Version:

A new Angular UI library that moving away from Bootstrap and built from scratch.

69 lines (68 loc) 2.12 kB
import { ChangeDetectorRef, EventEmitter, OnChanges, SimpleChanges } from '@angular/core'; import { DokuPageChangeProps } from './pagination.interface'; import * as i0 from "@angular/core"; export declare class DokuPagination implements OnChanges { private cdr; /** * Total data items. * @default 0 */ totalData: number; /** * Active page of the pagination. * * The value will be normalized to first or last page if out of total pages range. * * @default 0 */ activePage: number; /** * Total items displayed per page. * @default 5 */ itemsPerPage: number; /** * Listen for page change. */ pageChange: EventEmitter<DokuPageChangeProps>; /** * Use internally to inform other component for changes. * @internal */ protected triggerChange: EventEmitter<any>; protected pages: (number | string)[]; protected firstPage: number; protected lastPage: number; private totalPages; private readonly totalPagesToShow; constructor(cdr: ChangeDetectorRef); ngOnChanges(changes: SimpleChanges): void; /** * Navigate to the specific page. * * If page value is out of total pages range, the action will be ignored. */ navigateToPage(page: number): void; /** * Go to previous page. * * The action will be ignored if already on the first page. */ goToPreviousPage(): void; /** * Go to next page. * * The action will be ignored if already on the last page. */ goToNextPage(): void; /** * @internal */ protected changeItemsPerPage(value: number): void; private calculateAll; private calculateValues; private calculatePages; private emitPageChange; static ɵfac: i0.ɵɵFactoryDeclaration<DokuPagination, never>; static ɵcmp: i0.ɵɵComponentDeclaration<DokuPagination, "doku-pagination", ["dokuPagination"], { "totalData": "totalData"; "activePage": "activePage"; "itemsPerPage": "itemsPerPage"; }, { "pageChange": "pageChange"; }, never, never, true>; }