/** * @license * Copyright Datorama. All Rights Reserved. * * Use of this source code is governed by an Apache License 2.0 license that can be * found in the LICENSE file at https://github.com/datorama/client-core/blob/master/LICENSE */ import { ChangeDetectorRef, ElementRef, EventEmitter, OnInit } from '@angular/core'; import { AgGridEvent, ColumnApi, GridApi } from '@ag-grid-community/core'; import { Subject } from 'rxjs'; import { DatoTableAlignment } from '../grid.types'; import { DatoTranslateService } from '../../services/translate.service'; export declare class DatoGridPaginationComponent implements OnInit { private cdr; private translate; /** The ag-grid api */ agGridApi: GridApi; /** The ag-grid column api */ set agGridColumnApi(columnApi: ColumnApi); /** update the expand collapse item according to the table state */ isCollapsed: boolean; /** Whether to show the Fit-To-Content button */ showFitToContent: boolean; /** Whether it's a server side pagination */ infinitePagination: boolean; /** Event emitter for data changes */ rowDataChanged: Subject; /** bubble alignment events */ alignTable: EventEmitter; /** bubble grouped row expand collapse */ toggleRowGroup: EventEmitter; /** * This setter is used to assign the navigation element ref and to set * the pagination size when the component starts * @param {ElementRef} content */ set content(content: ElementRef); private rowCount; private rowsPerPage; private translations; private _pagesInView; private pagesOnSides; private pagesFitView; private navigationElement; private readonly MINI_DISPLAY_LENGTH; private readonly DISPLAY_LENGTH; private readonly XS_DISPLAY_SIZE; private readonly SMALL_DISPLAY_SIZE; get prevPageDisabled(): boolean; get nextPageDisabled(): boolean; ngOnInit(): void; /** * Recalculate the row count and page lengths */ calculateRowsCount(): void; initPagination(pageNumber?: number): void; /** * Set the number of page numbers showing at the same time in the navigation * panel & update the number of pages displayed on each side of the selected page. * @param {number} newNumbersLength - The new length of the displaying numbers */ set pagesInView(newNumbersLength: number); disableButtons: boolean; smallVersion: boolean | null; totalPages: number; showCollapseExpand: boolean; rowsRange: string; pageNumbersDisplay: { currentPage: number; pages: any[]; showFirstEllipsis: boolean; showLastPage: boolean; }; constructor(cdr: ChangeDetectorRef, translate: DatoTranslateService); /** TODO This is not listening to size changes */ calculateNavigationSize(): void; /** * Navigates to a given page. * updates the displaying page numbers and the current number. * @param pageNumber - The page number to navigate to */ navigatePage(pageNumber: any): void; navigateFirstPage(): void; navigateNextPage(): void; navigatePrevPage(): void; /** * updates the displaying page numbers to show the next numbers set */ showNextBatch(): void; /** * updates the displaying page numbers to show the previous numbers set */ showPreviousBatch(): void; /** * resize the columns width to fit their content if the columns width is smaller * than the container the grid will fir the container. */ fitToContainer(): void; /** * resize the columns width to fit their content if the columns width is smaller * than the container the grid will fir the container. */ fitToContent(): void; /** * Expand/Collapse the grouped rows */ toggleExpand(): void; /** * The trackBy function for the ngFor * @param index - current item index * @param page - the current item's page number * @return {number} */ trackByFunc(index: number, page: number): number; ngOnDestroy(): void; /** * Sets the rows display string * @param displayNumber - The current page number (starting index 1) * @private */ private setRowsDisplayRange; /** * Gets a number and returns an array of the displaying numbers. * @param anchor - The number to use as an anchor for the calculations. * @return {number[]} - An array of the new numbers to display * @private */ private getPages; /** * Returns the first number to be displayed in the pagination navigation view * @param {number} anchor - The anchor for the calculations * @return {number} - The first number to be displayed * @private */ private getFirstPageNumber; }