UNPKG

2.87 kBTypeScriptView Raw
1import * as React from 'react';
2import { ToggleTemplateProps } from './ToggleTemplate';
3import { PerPageOptions, OnPerPageSelect } from './Pagination';
4export interface PaginationOptionsMenuProps extends React.HTMLProps<HTMLDivElement> {
5 /** Custom class name added to the pagination options menu */
6 className?: string;
7 /** Id added to the title of the Pagination options menu */
8 widgetId?: string;
9 /** Flag indicating if pagination options menu is disabled */
10 isDisabled?: boolean;
11 /** Menu will open up or open down from the options menu toggle */
12 dropDirection?: 'up' | 'down';
13 /** Array of titles and values which will be the options on the options menu dropdown */
14 perPageOptions?: PerPageOptions[];
15 /** The title of the pagination options menu */
16 itemsPerPageTitle?: string;
17 /** Current page number */
18 page?: number;
19 /** The suffix to be displayed after each option on the options menu dropdown */
20 perPageSuffix?: string;
21 /** The type or title of the items being paginated */
22 itemsTitle?: string;
23 /** Accessible label for the options toggle */
24 optionsToggle?: string;
25 /** The total number of items being paginated */
26 itemCount?: number;
27 /** The first index of the items being paginated */
28 firstIndex?: number;
29 /** The last index of the items being paginated */
30 lastIndex?: number;
31 /** Flag to show last full page of results if perPage selected > remaining rows */
32 defaultToFullPage?: boolean;
33 /** The number of items to be displayed per page */
34 perPage?: number;
35 /** The number of the last page */
36 lastPage?: number;
37 /** This will be shown in pagination toggle span. You can use firstIndex, lastIndex, itemCount, itemsTitle props. */
38 toggleTemplate: ((props: ToggleTemplateProps) => React.ReactElement) | string;
39 /** Function called when user selects number of items per page. */
40 onPerPageSelect?: OnPerPageSelect;
41 /** Label for the English word "of" */
42 ofWord?: string;
43 /** Component to be used for wrapping the toggle contents. Use 'button' when you want
44 * all of the toggle text to be clickable.
45 */
46 perPageComponent?: 'div' | 'button';
47}
48interface PaginationOptionsMenuState {
49 isOpen: boolean;
50}
51export declare class PaginationOptionsMenu extends React.Component<PaginationOptionsMenuProps, PaginationOptionsMenuState> {
52 static displayName: string;
53 private parentRef;
54 static defaultProps: PaginationOptionsMenuProps;
55 constructor(props: PaginationOptionsMenuProps);
56 onToggle: (isOpen: boolean) => void;
57 onSelect: () => void;
58 handleNewPerPage: (_evt: React.MouseEvent | React.KeyboardEvent | MouseEvent, newPerPage: number) => void;
59 renderItems: () => JSX.Element[];
60 render(): JSX.Element;
61}
62export {};
63//# sourceMappingURL=PaginationOptionsMenu.d.ts.map
\No newline at end of file