@alfresco/adf-core
Version:
75 lines (74 loc) • 3.67 kB
TypeScript
/*!
* @license
* Copyright © 2005-2025 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { ChangeDetectorRef, ElementRef, EventEmitter, OnInit, Renderer2 } from '@angular/core';
import { PaginatedComponent } from './paginated-component.interface';
import { PaginationComponentInterface } from './pagination-component.interface';
import { PaginationModel } from '../models/pagination.model';
import { UserPreferencesService } from '../common/services/user-preferences.service';
import { TranslateService } from '@ngx-translate/core';
import * as i0 from "@angular/core";
export type PaginationAction = 'NEXT_PAGE' | 'PREV_PAGE' | 'CHANGE_PAGE_SIZE' | 'CHANGE_PAGE_NUMBER';
export declare const DEFAULT_PAGINATION: PaginationModel;
export declare class PaginationComponent implements OnInit, PaginationComponentInterface {
private elementRef;
private renderer;
private cdr;
private userPreferencesService;
private translate;
private _pagination;
private _isEmpty;
private _hasItems;
/** Component that provides custom pagination support. */
target: PaginatedComponent;
/** An array of page sizes. */
supportedPageSizes: number[];
get pagination(): PaginationModel;
/** Pagination object. */
set pagination(value: PaginationModel);
/** Emitted when pagination changes in any way. */
change: EventEmitter<PaginationModel>;
/** Emitted when the page number changes. */
changePageNumber: EventEmitter<PaginationModel>;
/** Emitted when the page size changes. */
changePageSize: EventEmitter<PaginationModel>;
/** Emitted when the next page is requested. */
nextPage: EventEmitter<PaginationModel>;
/** Emitted when the previous page is requested. */
prevPage: EventEmitter<PaginationModel>;
private readonly destroyRef;
constructor(elementRef: ElementRef, renderer: Renderer2, cdr: ChangeDetectorRef, userPreferencesService: UserPreferencesService, translate: TranslateService);
ngOnInit(): void;
get lastPage(): number;
get current(): number;
get isLastPage(): boolean;
get isFirstPage(): boolean;
get next(): number;
get previous(): number;
get hasItems(): boolean;
get isEmpty(): boolean;
get range(): number[];
get pages(): number[];
get limitedPages(): number[];
get itemRangeText(): string;
goNext(): void;
goPrevious(): void;
onChangePageNumber(pageNumber: number): void;
onChangePageSize(maxItems: number): void;
handlePaginationEvent(action: PaginationAction): void;
static ɵfac: i0.ɵɵFactoryDeclaration<PaginationComponent, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<PaginationComponent, "adf-pagination", never, { "target": { "alias": "target"; "required": false; }; "supportedPageSizes": { "alias": "supportedPageSizes"; "required": false; }; "pagination": { "alias": "pagination"; "required": false; }; }, { "change": "change"; "changePageNumber": "changePageNumber"; "changePageSize": "changePageSize"; "nextPage": "nextPage"; "prevPage": "prevPage"; }, never, never, true, never>;
}