/** * @license *------------------------------------------------------------------------------------------- * Copyright © 2026 Progress Software Corporation. All rights reserved. * Licensed under commercial license. See LICENSE.md in the package root for more information *------------------------------------------------------------------------------------------- */ /** * A Pager target event. */ export interface PagerTargetEvent { [key: string]: any; /** * An event target. */ target?: any; /** * An event value. */ value?: any; } export interface PagerHandle { /** * Represents the element of the Pager component. */ element: HTMLDivElement | null; /** * Represents the props of the Pager component. */ props: Readonly; } /** * Represents the object of the `onPageChange` event. */ export interface PageChangeEvent extends BasePageChangeEvent { /** * An event target. */ target: PagerHandle; /** * A React Synthetic Event. */ syntheticEvent: React.SyntheticEvent; /** * A native DOM event. */ nativeEvent: any; /** * A target change event. */ targetEvent: PagerTargetEvent; } /** * Represents the base object of the `onPageChange` event. It is usually used * in custom pager scenarios in cases when we don't need any of the events or the target. */ export interface BasePageChangeEvent { /** * The number of records that will be skipped. */ skip: number; /** * The number of records that will be taken. */ take: number; /** * A React Synthetic Event. */ syntheticEvent?: React.SyntheticEvent; /** * A native DOM event. */ nativeEvent?: any; /** * A target change event. */ targetEvent?: PagerTargetEvent; } export interface PagerProps { /** * The total number of records. */ total: number; /** * The number of records that will be skipped. */ skip: number; /** * The number of records that will be taken. */ take: number; /** * Sets additional classes to the Pager. */ className?: string; /** * The styles that are applied to the Pager. */ style?: React.CSSProperties; /** * Sets the maximum numeric buttons count before the buttons are collapsed. */ buttonCount?: number; /** * Toggles the information about the current page and the total number of records. */ info?: boolean; /** * Defines the type of the pager. * * (Default) `numeric` — Renders buttons with numbers. * * `input` — Renders an input field for typing the page number. */ type?: 'numeric' | 'input'; /** * Displays a menu for selecting the page size. */ pageSizes?: Array | Array; /** * Sets the selected value of the page size Dropdownlist. * It is useful when the selected value could also be a string not only a number. */ pageSizeValue?: string | number; /** * Toggles the **Previous** and **Next** buttons. */ previousNext?: boolean; /** * Defines if the pager will be responsive. * If true, hides the tools that do not fit to the available space. * * @default `true` */ responsive?: boolean; /** * Configures the `size` of the Pager. * * The available options are: * - small * - medium * - large * - null—Does not set a size `className`. * * @default `medium` */ size?: 'small' | 'medium' | 'large'; /** * Fires when the page of the Pager is changed. You have to handle the event yourself and page the data. */ onPageChange?: ((event: PageChangeEvent) => void) | ((event: BasePageChangeEvent) => void); /** * Useful for modifying the Pager messages. */ messagesMap?: (messageKey: string) => { messageKey: string; defaultMessage: string; }; /** * Sets the direction of the component. */ dir?: string; /** * If set to `true`, the user can use dedicated shortcuts to interact with the Pager. * By default, navigation is disabled and the Pager content is accessible in the normal tab sequence. */ navigatable?: boolean; /** * Controls the disabled state of the Pager. Defaults to `false`. */ disabled?: boolean; /** * Providing different rendering of the page sizes select element based on the screen dimensions. */ adaptive?: boolean; /** * Specifies the text that is rendered as title in the adaptive page sizes select element. */ adaptiveTitle?: string; }