@ux-aspects/ux-aspects
Version:
Open source user interface framework for building modern, responsive, mobile big data applications
68 lines (67 loc) • 3.54 kB
TypeScript
import { EventEmitter, OnInit, TemplateRef } from '@angular/core';
import { ControlValueAccessor } from '@angular/forms';
import * as i0 from "@angular/core";
export declare const PAGINATION_CONTROL_VALUE_ACCESSOR: {
provide: import("@angular/core").InjectionToken<readonly ControlValueAccessor[]>;
useExisting: import("@angular/core").Type<any>;
multi: boolean;
};
export declare class PaginationComponent implements OnInit, ControlValueAccessor {
private readonly _changeDetector;
/** Specify if we should show the next and previous buttons */
directionButtons: boolean;
/** Limit the number of pages shown at any given time */
maxSize: number;
/** Specify if the component should be disabled */
disabled: boolean;
/** Apply classes to the bootstrap pagination element */
classes: string;
/** Allow custom class to be added to page buttons */
pageBtnClass: string;
/** Aria Label for the component navigation */
ariaLabel: string;
/** Aria label for the previous button */
previousAriaLabel: string;
/** Aria label for the next button */
nextAriaLabel: string;
/** Specify the index of the active page */
set page(page: number);
get page(): number;
/** Define a custom template for the previous button */
previousBtnTemplate: TemplateRef<void>;
/** Define a custom template for the next button */
nextBtnTemplate: TemplateRef<void>;
/** Specify the page size */
set itemsPerPage(pagesize: number);
/** Specify how many items there are in total */
set totalItems(total: number);
/** Emit the current page number */
pageChange: EventEmitter<number>;
/** Emit the total number of pages */
numPages: EventEmitter<number>;
/** Store a list of pages to display in the UI */
pages: ReadonlyArray<Page>;
/** ControlValueAccessor functions */
onTouched: Function;
onChange: Function;
isKeyboardEvent: boolean;
private _page;
private _total;
private _pagesize;
get pageCount(): number;
ngOnInit(): void;
select(index: number): void;
trackByFn(_index: number, item: Page): number;
registerOnChange(fn: () => void): void;
registerOnTouched(fn: () => void): void;
setDisabledState(isDisabled: boolean): void;
writeValue(page: number): void;
private getPages;
private isPageVisible;
static ɵfac: i0.ɵɵFactoryDeclaration<PaginationComponent, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<PaginationComponent, "ux-pagination", never, { "directionButtons": { "alias": "directionButtons"; "required": false; }; "maxSize": { "alias": "maxSize"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "classes": { "alias": "class"; "required": false; }; "pageBtnClass": { "alias": "pageBtnClass"; "required": false; }; "ariaLabel": { "alias": "aria-label"; "required": false; }; "previousAriaLabel": { "alias": "previousAriaLabel"; "required": false; }; "nextAriaLabel": { "alias": "nextAriaLabel"; "required": false; }; "page": { "alias": "page"; "required": false; }; "previousBtnTemplate": { "alias": "previousBtnTemplate"; "required": false; }; "nextBtnTemplate": { "alias": "nextBtnTemplate"; "required": false; }; "itemsPerPage": { "alias": "itemsPerPage"; "required": false; }; "totalItems": { "alias": "totalItems"; "required": false; }; }, { "pageChange": "pageChange"; "numPages": "numPages"; }, never, never, false, never>;
}
export interface Page {
index: number;
visible: boolean;
}