@rubenpazch/pagination 1.0.1
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/README.md +3 -0
- package/dist/Pagination.d.ts +46 -0
- package/dist/Pagination.d.ts.map +1 -0
- package/dist/PaginationItem.d.ts +19 -0
- package/dist/PaginationItem.d.ts.map +1 -0
- package/dist/index.cjs.js +692 -0
- package/dist/index.d.ts +64 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.esm.js +671 -0
- package/package.json +63 -0
package/README.md
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export type PaginationShape = "rounded" | "circular";
|
|
3
|
+
export type PaginationSize = "small" | "medium" | "large";
|
|
4
|
+
export type PaginationVariant = "text" | "outlined";
|
|
5
|
+
export interface PaginationProps extends Omit<React.HTMLAttributes<HTMLElement>, "onChange"> {
|
|
6
|
+
/** Total number of pages */
|
|
7
|
+
count?: number;
|
|
8
|
+
/** The current page (1-based) */
|
|
9
|
+
page?: number;
|
|
10
|
+
/** Default page if uncontrolled */
|
|
11
|
+
defaultPage?: number;
|
|
12
|
+
/** Callback when page changes */
|
|
13
|
+
onChange?: (event: React.ChangeEvent<unknown>, page: number) => void;
|
|
14
|
+
/** If true, the component is disabled */
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
/** If true, hide the next-page button */
|
|
17
|
+
hideNextButton?: boolean;
|
|
18
|
+
/** If true, hide the previous-page button */
|
|
19
|
+
hidePrevButton?: boolean;
|
|
20
|
+
/** If true, show the first-page button */
|
|
21
|
+
showFirstButton?: boolean;
|
|
22
|
+
/** If true, show the last-page button */
|
|
23
|
+
showLastButton?: boolean;
|
|
24
|
+
/** Number of always visible pages at the beginning and end */
|
|
25
|
+
boundaryCount?: number;
|
|
26
|
+
/** Number of always visible pages before and after the current page */
|
|
27
|
+
siblingCount?: number;
|
|
28
|
+
/** The shape of the pagination items */
|
|
29
|
+
shape?: PaginationShape;
|
|
30
|
+
/** The size of the pagination component */
|
|
31
|
+
size?: PaginationSize;
|
|
32
|
+
/** The variant to use */
|
|
33
|
+
variant?: PaginationVariant;
|
|
34
|
+
/** Custom render function for items */
|
|
35
|
+
renderItem?: (item: PaginationItemType) => React.ReactNode;
|
|
36
|
+
}
|
|
37
|
+
export interface PaginationItemType {
|
|
38
|
+
page: number;
|
|
39
|
+
type: "page" | "first" | "last" | "next" | "previous" | "start-ellipsis" | "end-ellipsis";
|
|
40
|
+
selected: boolean;
|
|
41
|
+
disabled: boolean;
|
|
42
|
+
onClick: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
43
|
+
}
|
|
44
|
+
declare const Pagination: React.ForwardRefExoticComponent<PaginationProps & React.RefAttributes<HTMLElement>>;
|
|
45
|
+
export default Pagination;
|
|
46
|
+
//# sourceMappingURL=Pagination.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Pagination.d.ts","sourceRoot":"","sources":["../src/Pagination.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,MAAM,MAAM,eAAe,GAAG,SAAS,GAAG,UAAU,CAAC;AACrD,MAAM,MAAM,cAAc,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;AAC1D,MAAM,MAAM,iBAAiB,GAAG,MAAM,GAAG,UAAU,CAAC;AAEpD,MAAM,WAAW,eAAgB,SAAQ,IAAI,CAC3C,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC,EACjC,UAAU,CACX;IACC,4BAA4B;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,iCAAiC;IACjC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,mCAAmC;IACnC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iCAAiC;IACjC,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,WAAW,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACrE,yCAAyC;IACzC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,yCAAyC;IACzC,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,6CAA6C;IAC7C,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,0CAA0C;IAC1C,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,yCAAyC;IACzC,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,8DAA8D;IAC9D,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,uEAAuE;IACvE,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,wCAAwC;IACxC,KAAK,CAAC,EAAE,eAAe,CAAC;IACxB,2CAA2C;IAC3C,IAAI,CAAC,EAAE,cAAc,CAAC;IACtB,yBAAyB;IACzB,OAAO,CAAC,EAAE,iBAAiB,CAAC;IAC5B,uCAAuC;IACvC,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,kBAAkB,KAAK,KAAK,CAAC,SAAS,CAAC;CAC5D;AAED,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EACA,MAAM,GACN,OAAO,GACP,MAAM,GACN,MAAM,GACN,UAAU,GACV,gBAAgB,GAChB,cAAc,CAAC;IACnB,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,OAAO,CAAC;IAClB,OAAO,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC;CAC/D;AAgID,QAAA,MAAM,UAAU,qFA8Gf,CAAC;AAIF,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { PaginationShape, PaginationSize, PaginationVariant } from "./Pagination";
|
|
3
|
+
export interface PaginationItemProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "type"> {
|
|
4
|
+
/** The page number */
|
|
5
|
+
page: number;
|
|
6
|
+
/** The type of pagination item */
|
|
7
|
+
type: "page" | "first" | "last" | "next" | "previous" | "start-ellipsis" | "end-ellipsis";
|
|
8
|
+
/** If true, the item is selected/active */
|
|
9
|
+
selected?: boolean;
|
|
10
|
+
/** The shape of the pagination items */
|
|
11
|
+
shape?: PaginationShape;
|
|
12
|
+
/** The size of the component */
|
|
13
|
+
size?: PaginationSize;
|
|
14
|
+
/** The variant to use */
|
|
15
|
+
variant?: PaginationVariant;
|
|
16
|
+
}
|
|
17
|
+
declare const PaginationItem: React.ForwardRefExoticComponent<PaginationItemProps & React.RefAttributes<HTMLButtonElement>>;
|
|
18
|
+
export default PaginationItem;
|
|
19
|
+
//# sourceMappingURL=PaginationItem.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PaginationItem.d.ts","sourceRoot":"","sources":["../src/PaginationItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,KAAK,EACV,eAAe,EACf,cAAc,EACd,iBAAiB,EAClB,MAAM,cAAc,CAAC;AAEtB,MAAM,WAAW,mBAAoB,SAAQ,IAAI,CAC/C,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAC7C,MAAM,CACP;IACC,sBAAsB;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,kCAAkC;IAClC,IAAI,EACA,MAAM,GACN,OAAO,GACP,MAAM,GACN,MAAM,GACN,UAAU,GACV,gBAAgB,GAChB,cAAc,CAAC;IACnB,2CAA2C;IAC3C,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,wCAAwC;IACxC,KAAK,CAAC,EAAE,eAAe,CAAC;IACxB,gCAAgC;IAChC,IAAI,CAAC,EAAE,cAAc,CAAC;IACtB,yBAAyB;IACzB,OAAO,CAAC,EAAE,iBAAiB,CAAC;CAC7B;AAWD,QAAA,MAAM,cAAc,+FAuInB,CAAC;AAIF,eAAe,cAAc,CAAC"}
|