@rowsncolumns/grid
Advanced tools
Comparing version 9.0.0 to 9.0.1
@@ -8,5 +8,5 @@ import React from "react"; | ||
/** | ||
* Initial current page index. Start from 1 | ||
* Initial page index. Start from 1 | ||
*/ | ||
initialCurrentPage?: number; | ||
initialPage?: number; | ||
/** | ||
@@ -13,0 +13,0 @@ * Total number of rows |
@@ -32,4 +32,4 @@ "use strict"; | ||
const usePagination = (props) => { | ||
const { initialCurrentPage = 1, pageSize = 10, total = 0, onChange, component = PaginationComponent, } = props; | ||
const [currentPage, setCurrentPage] = (0, react_1.useState)(initialCurrentPage); | ||
const { initialPage = 1, pageSize = 10, total = 0, onChange, component = PaginationComponent, } = props; | ||
const [currentPage, setCurrentPage] = (0, react_1.useState)(initialPage); | ||
const totalPages = Math.ceil(total / pageSize); | ||
@@ -36,0 +36,0 @@ const nextPage = () => setCurrentPage((prev) => Math.min(prev + 1, totalPages)); |
{ | ||
"name": "@rowsncolumns/grid", | ||
"description": "Declarative React Canvas Grid primitive for Data table, Pivot table, Excel Worksheets", | ||
"version": "9.0.0", | ||
"version": "9.0.1", | ||
"main": "dist/index.tsx", | ||
@@ -46,3 +46,3 @@ "license": "MIT", | ||
}, | ||
"gitHead": "272c80dcd474a9346b6927b356d37917cfcd7c84" | ||
"gitHead": "48ddc53ff8b698acf38609bb12db45c2cab49bbe" | ||
} |
@@ -14,7 +14,7 @@ // @ts-nocheck | ||
expect(result.error.message).toBe( | ||
"Cannot read properties of undefined (reading 'initialCurrentPage')" | ||
"Cannot read properties of undefined (reading 'initialPage')" | ||
); | ||
}); | ||
it("sets initialCurrentpage to 1", () => { | ||
it("sets initialPage to 1", () => { | ||
const { result } = renderHook(() => usePagination(options)); | ||
@@ -21,0 +21,0 @@ expect(result.current.currentPage).toBe(1); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
710817