/** * Copyright IBM Corp. 2016, 2026 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ import React from 'react'; type ExcludedAttributes = 'id' | 'onChange'; export interface PaginationPageSize { text: string; value: number; } export interface PaginationProps extends Omit, ExcludedAttributes> { /** * The description for the backward icon. */ backwardText?: string; /** * The tooltip position for the backward button. */ backwardTextTooltipPosition?: 'top' | 'right' | 'bottom' | 'left'; /** * The CSS class names. */ className?: string; /** * `true` if the backward/forward buttons, as well as the page select elements, should be disabled. */ disabled?: boolean; /** * The description for the forward icon. */ forwardText?: string; /** * The tooltip position for the forward button. */ forwardTextTooltipPosition?: 'top' | 'right' | 'bottom' | 'left'; /** * The unique ID of this component instance. */ id?: string | number; /** * `true` if the current page should be the last page. */ isLastPage?: boolean; /** * The function returning a translatable text showing where the current page is, * in a manner of the range of items. */ itemRangeText?: (min: number, max: number, total: number) => string; /** * A variant of `itemRangeText`, used if the total number of items is unknown. */ itemText?: (min: number, max: number) => string; /** * The translatable text indicating the number of items per page. */ itemsPerPageText?: string; /** * The callback function called when the current page changes. */ onChange?: (data: { page: number; pageSize: number; ref?: React.RefObject; }) => void; /** * The current page. */ page?: number; /** * `true` if the select box to change the page should be disabled. */ pageInputDisabled?: boolean; pageNumberText?: string; /** * A function returning PII showing where the current page is. */ pageRangeText?: (current: number, total: number) => string; /** * A function returning the label for the page select. */ pageSelectLabelText?: (total: number) => string; /** * Provide a custom render function for the page-selection control. * When provided, the default `