@bonprix-ds/react-pagination 1.0.0 → 1.1.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 +18 -9
- package/dist/index.js +769 -856
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/dist/index.d.ts
CHANGED
|
@@ -1,13 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ComponentProps } from 'react';
|
|
2
|
+
import { default as default_2 } from 'react';
|
|
3
|
+
import { ElementType } from 'react';
|
|
2
4
|
|
|
3
|
-
|
|
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 {
|
|
5
|
+
declare interface BaseProps {
|
|
11
6
|
/** The current active page number. */
|
|
12
7
|
currentPage: number;
|
|
13
8
|
/** The total number of pages. */
|
|
@@ -23,4 +18,18 @@ export declare interface PaginationProps {
|
|
|
23
18
|
srLabel?: string;
|
|
24
19
|
}
|
|
25
20
|
|
|
21
|
+
export declare const calculateItems: (currentPage: number, totalPages: number, pagesShown?: 5 | 7) => (number | "ellipsis")[];
|
|
22
|
+
|
|
23
|
+
declare const Pagination: <C extends ElementType>({ currentPage, totalPages, onPageChange, srLabel, constructPageHref, itemComponent, itemProps, }: PaginationProps<C>) => default_2.JSX.Element;
|
|
24
|
+
export default Pagination;
|
|
25
|
+
|
|
26
|
+
declare type PaginationEventOrigin = "page" | "prev" | "next";
|
|
27
|
+
|
|
28
|
+
export declare type PaginationProps<C extends ElementType> = BaseProps & {
|
|
29
|
+
/** The semantic component to render the Items. Preferrably `"a"`, `"button"` or something like `Link` from NextJS. Defaults to `"a"`. Native props will be passed to this component. */
|
|
30
|
+
itemComponent?: C;
|
|
31
|
+
/** Props that get passed to all items. Useful for setting props for NextJS `Link`s for example. */
|
|
32
|
+
itemProps?: Omit<ComponentProps<C>, "href">;
|
|
33
|
+
};
|
|
34
|
+
|
|
26
35
|
export { }
|