@facter/ds-core 1.25.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.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,