diff --git a/package-lock.json b/package-lock.json index e256c39a..7f0c7e44 100644 --- a/package-lock.json +++ b/package-lock.json @@ -31547,7 +31547,7 @@ }, "packages/react-front-kit": { "name": "@smile/react-front-kit", - "version": "0.0.3", + "version": "0.4.0", "license": "MIT", "dependencies": { "@mantine/dropzone": "^6.0.21", @@ -31586,7 +31586,7 @@ }, "packages/react-front-kit-dropzone": { "name": "@smile/react-front-kit-dropzone", - "version": "0.0.3", + "version": "0.4.0", "license": "MIT", "dependencies": { "@smile/react-front-kit": "*", @@ -32563,7 +32563,7 @@ }, "packages/react-front-kit-shared": { "name": "@smile/react-front-kit-shared", - "version": "0.0.3", + "version": "0.4.0", "license": "MIT", "devDependencies": { "@babel/preset-env": "^7.22.20", @@ -33534,7 +33534,7 @@ }, "packages/react-front-kit-table": { "name": "@smile/react-front-kit-table", - "version": "0.0.3", + "version": "0.4.0", "license": "MIT", "dependencies": { "@smile/react-front-kit": "*", diff --git a/packages/react-front-kit-table/src/Components/Table/Table.tsx b/packages/react-front-kit-table/src/Components/Table/Table.tsx index ea04ec1d..6b5d3c0c 100644 --- a/packages/react-front-kit-table/src/Components/Table/Table.tsx +++ b/packages/react-front-kit-table/src/Components/Table/Table.tsx @@ -91,7 +91,7 @@ export function Table>( rowActionNumber = 0, ...mantineTableProps } = props; - const { enablePagination = true, data, manualPagination } = mantineTableProps; + const { enablePagination = true, manualPagination } = mantineTableProps; const { classes } = useStyles(); const [confirmAction, setConfirmAction] = useState | null>(null); @@ -319,7 +319,7 @@ export function Table>( }, ...mantineTableProps, }); - const { getState, setPageIndex, setPageSize } = table; + const { getPageCount, getState, setPageIndex, setPageSize } = table; const { pagination } = getState(); const { pageIndex, pageSize } = pagination; @@ -344,7 +344,7 @@ export function Table>( onItemsPerPageChange={handleItemsPerPageChange} onPageChange={handlePageChange} page={pageIndex + 1} - totalPages={Math.ceil(data.length / pageSize)} + totalPages={getPageCount()} /> ) : ( paginationProps !== undefined && ( diff --git a/packages/react-front-kit-table/tsconfig.json b/packages/react-front-kit-table/tsconfig.json index 66e5a44f..07d7a8d5 100644 --- a/packages/react-front-kit-table/tsconfig.json +++ b/packages/react-front-kit-table/tsconfig.json @@ -1,3 +1,4 @@ { - "extends": "tsconfig/react-library.json" + "extends": "tsconfig/react-library.json", + "include": [".", "../../global.d.ts"] }