import * as _angular_core from '@angular/core';
import { OnInit, OnChanges, OnDestroy, EventEmitter, SimpleChanges } from '@angular/core';
import { TLocale } from '@talenra/ngx-base/shared';
/**
* Determines the different attributes of the paginator state.
*
* ### Import
*
* ```typescript
* import { PaginatorState } from '@talenra/ngx-base/paginator';
* ```
*
* @see {@link PaginatorComponent}
*/
interface PaginatorState {
/** The current page number. */
currentPage: number;
/** The number of items per page, that are to be displayed. */
itemsPerPage: number;
/** The total number of items. Used to calculate the last page number. */
totalItems: number;
/** The possible options for the items per page selection. Used to override the default options. */
itemsPerPageOptions?: number[];
}
/**
* Alignment of the paginator. If Paginator is used with `useResponsiveMode` on, it will take the full width of the
* container element. In this setup, use Paginator's `align` property to control its alignment.
*
* ```html
*
* ```
*
* ```typescript
* import { PaginatorAlign } from '@otalenra/ngx-base/paginator';
* ```
*
* @see {@link PaginatorComponent}
*/
declare const PaginatorAlignment: {
readonly Left: "left";
readonly Center: "center";
readonly Right: "right";
};
/**
* Type of values accepted by Paginator's `align` property.
*
* ### Import
*
* ```typescript
* import { TPaginatorAlignment } from '@talenra/ngx-base/paginator';
* ```
*
* @see {@link PaginatorComponent}
*/
type TPaginatorAlignment = (typeof PaginatorAlignment)[keyof typeof PaginatorAlignment];
/**
* Interface describing the collection of HTML elements required by responsive mode.
*
* @internal
*/
interface IPaginatorResponsiveModeElements {
/** Host element of the Paginator component */
host?: HTMLElement;
/** Label of the selector ("items per page") */
selectorLabel?: HTMLElement;
/** Select in the "items per page" chooser */
selector?: HTMLElement;
/** Label "21 – 30 of 102" */
report?: HTMLElement;
/** Container holding the buttons to jump to the first, last, next and previous page. */
buttons?: HTMLElement;
}
/**
* PaginatorResponsiveMode is responsible for managing the visibility of paginator elements in responsive mode. It
* calculates the available space and toggles the visibility of paginator elements accordingly.
*
* @internal
*/
declare class PaginatorResponsiveMode {
/** Reference to the Paginator component instance. */
private paginator;
/** References to the relevant Paginator HTML elements. */
private elements;
/**
* State of the Paginator elements. Elements marked with `isPermanent` are never hidden.
*
* Important: Elements marked `isPermanent` must be _before_ any other elements in the array.
*/
private states;
/** @internal */
constructor(paginator: PaginatorComponent);
/** (Re-)initializes responsive mode. */
init(elements: IPaginatorResponsiveModeElements): void;
/** Updates visibility of paginator elements. */
update(): void;
/** Template helper to determine whether a given Paginator element is hidden. */
isHidden(elementKey: string): boolean;
}
/**
* Paginator component provides pagination control to navigate through a list of items.
*
* ```html
*
*
*
*
*
* ```
*/
declare class PaginatorComponent implements OnInit, OnChanges, OnDestroy {
/**
* The state of the paginator. Provides information about the current page, the number of items per page etc. Supports
* two-way binding.
*
* ```html
*
*```
*/
state: PaginatorState;
/**
* Locale to dynamically overwrite the app's locale. Allowed values, see: Locale
*
* ```html
*
* ```
*
* @see {@link Locale}
* @see {@link TLocale}
*/
dynamicLocale: TLocale | null;
/**
* Determines whether the buttons to move to first/last page are shown.
*
* ```html
*
* ```
*/
showFirstLastButtons: _angular_core.InputSignalWithTransform;
/**
* Determines whether the selection of items per page is hidden.
*
* ```html
*
* ```
*/
hideItemsPerPage: _angular_core.InputSignalWithTransform;
/**
* Activates responsive mode. In responsive mode, Paginator takes the whole horizontal space available and does its
* best to fit the content. Features are hidden if there is not enough space.
*
* ```html
*
* ```
*/
get useResponsiveMode(): boolean;
/** Set the instance's useResponsiveMode state. @deprecated */
set useResponsiveMode(value: boolean);
/**
* Alignment of the paginator. If Paginator is used with `useResponsiveMode` on, it will take the full width of the
* container element. In this setup, use Paginator's `align` property to control its alignment.
*
* ```html
*
* ```
*/
align: _angular_core.InputSignal;
private get alignClass();
/**
* Emits changes in the paginator state. This is where you implement your logic to handle the changes in the
* paginator.
*
* ```typescript
* // Component class
* protected onPaginatorStateChange(state: PaginatorState) {
* // Your app's logic
* }
* ```
*
* ```html
*
*
* ```
*/
stateChange: EventEmitter;
/** The last page number. */
protected lastPage: number;
/** The state of the paginator pageReport string. Indicates the current page and the total number of pages. */
protected pageReport: string;
/** The label to be shown in front of the items per page selection. */
protected itemsPerPageLabelString: string;
/** Retrieve the app's locale */
private appLocale;
/** Change detector reference */
private changeDetector;
/** Destroy reference */
private destroyRef;
/** Returns the locale actually used by the component (dynamic or app locale). */
private get locale();
/** Handler for responsive mode */
protected responsiveMode: PaginatorResponsiveMode;
/** Resize observer instance reference */
private resizeObserver?;
/** Element references required for responsive mode */
private hostRef;
private selectorLabelRef;
private selectorRef;
private reportRef;
private buttonsRef;
/** @internal */
constructor();
/** @internal */
ngOnInit(): void;
/** @internal */
ngOnChanges(changes: SimpleChanges): void;
/** @internal */
ngOnDestroy(): void;
/**
* Handler for change in the items per page selection.
*
* @internal
*/
itemPerPageSelection(itemsPerPage: number): void;
/**
* Handler for the change in the current page.
*
* @internal
*/
changeCurrentPage(changeTo: number): void;
/**
* Sets the paginator attributes to update the pageReport string.
*/
private setPaginatorAttributes;
private initResponsiveMode;
private updateResponsiveMode;
static ɵfac: _angular_core.ɵɵFactoryDeclaration;
static ɵcmp: _angular_core.ɵɵComponentDeclaration;
static ngAcceptInputType_useResponsiveMode: unknown;
}
export { PaginatorAlignment, PaginatorComponent };
export type { PaginatorState, TPaginatorAlignment };