@facter/ds-core 1.24.0 → 1.26.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.mts +9 -1
- package/dist/index.d.ts +9 -1
- package/dist/index.js +14 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +14 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1111,7 +1111,8 @@ function useDataTableInternal({
|
|
|
1111
1111
|
getRowId,
|
|
1112
1112
|
manualPagination = false,
|
|
1113
1113
|
pageCount: externalPageCount,
|
|
1114
|
-
initialPageSize = 10
|
|
1114
|
+
initialPageSize = 10,
|
|
1115
|
+
onPaginationChange: onPaginationChangeProp
|
|
1115
1116
|
}) {
|
|
1116
1117
|
const [rowSelection, setRowSelection] = React10.useState({});
|
|
1117
1118
|
const [columnVisibility, setColumnVisibility] = React10.useState({});
|
|
@@ -1156,6 +1157,14 @@ function useDataTableInternal({
|
|
|
1156
1157
|
getPaginationRowModel: getPaginationRowModel(),
|
|
1157
1158
|
getSortedRowModel: getSortedRowModel()
|
|
1158
1159
|
});
|
|
1160
|
+
React10.useEffect(() => {
|
|
1161
|
+
if (onPaginationChangeProp) {
|
|
1162
|
+
onPaginationChangeProp({
|
|
1163
|
+
pageIndex: pagination.pageIndex,
|
|
1164
|
+
pageSize: pagination.pageSize
|
|
1165
|
+
});
|
|
1166
|
+
}
|
|
1167
|
+
}, [pagination.pageIndex, pagination.pageSize, onPaginationChangeProp]);
|
|
1159
1168
|
const meta = React10.useMemo(
|
|
1160
1169
|
() => ({
|
|
1161
1170
|
isLoading: false,
|
|
@@ -1345,6 +1354,7 @@ function DataTableRoot({
|
|
|
1345
1354
|
manualPagination,
|
|
1346
1355
|
pageCount,
|
|
1347
1356
|
initialPageSize,
|
|
1357
|
+
onPaginationChange,
|
|
1348
1358
|
className
|
|
1349
1359
|
}) {
|
|
1350
1360
|
const { table, meta, density, setDensity, pageIndex, pageSize } = useDataTableInternal({
|
|
@@ -1353,7 +1363,8 @@ function DataTableRoot({
|
|
|
1353
1363
|
getRowId,
|
|
1354
1364
|
manualPagination,
|
|
1355
1365
|
pageCount,
|
|
1356
|
-
initialPageSize
|
|
1366
|
+
initialPageSize,
|
|
1367
|
+
onPaginationChange
|
|
1357
1368
|
});
|
|
1358
1369
|
return /* @__PURE__ */ jsx(
|
|
1359
1370
|
DataTableProvider,
|
|
@@ -1839,7 +1850,7 @@ var DataTablePagination = React10.memo(function DataTablePagination2({
|
|
|
1839
1850
|
value: `${pageSize}`,
|
|
1840
1851
|
onValueChange: handlePageSizeChange,
|
|
1841
1852
|
selectSize: "sm",
|
|
1842
|
-
children: pageSizes.map((size) => /* @__PURE__ */ jsx(SelectItem, { value: `${size}`, children: size }, size))
|
|
1853
|
+
children: [.../* @__PURE__ */ new Set([pageSize, ...pageSizes])].sort((a, b) => a - b).map((size) => /* @__PURE__ */ jsx(SelectItem, { value: `${size}`, children: size }, size))
|
|
1843
1854
|
}
|
|
1844
1855
|
)
|
|
1845
1856
|
] }),
|