@bonprix-ds/react-pagination 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +26 -0
- package/dist/index.js +6178 -0
- package/dist/index.js.map +1 -0
- package/package.json +51 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
|
|
3
|
+
export declare const calculateItems: (currentPage: number, totalPages: number, pagesShown?: 5 | 7) => (number | "ellipsis")[];
|
|
4
|
+
|
|
5
|
+
declare const Pagination: FC<PaginationProps>;
|
|
6
|
+
export default Pagination;
|
|
7
|
+
|
|
8
|
+
declare type PaginationEventOrigin = "page" | "prev" | "next";
|
|
9
|
+
|
|
10
|
+
export declare interface PaginationProps {
|
|
11
|
+
/** The current active page number. */
|
|
12
|
+
currentPage: number;
|
|
13
|
+
/** The total number of pages. */
|
|
14
|
+
totalPages: number;
|
|
15
|
+
/** Callback function that is called when the page changes. The first parameter is the new page number, and the second parameter is the origin of the event ( `page`, `prev` or `next`) */
|
|
16
|
+
onPageChange: (newPage: number, origin: PaginationEventOrigin) => void;
|
|
17
|
+
/** Creates the individual page's `href` attributes taking into account the page's number.
|
|
18
|
+
* @param {number} pageNumber - the page number
|
|
19
|
+
* @returns {string} The `href` for the given page.
|
|
20
|
+
*/
|
|
21
|
+
constructPageHref: (pageNumber: number) => string;
|
|
22
|
+
/** Accessible label for screen readers. */
|
|
23
|
+
srLabel?: string;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export { }
|