@ackplus/react-tanstack-data-table 1.1.10 → 1.1.11
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-table.d.ts","sourceRoot":"","sources":["../../src/lib/data-table.tsx"],"names":[],"mappings":"AA8EA;;GAEG;AACH,eAAO,MAAM,SAAS,
|
|
1
|
+
{"version":3,"file":"data-table.d.ts","sourceRoot":"","sources":["../../src/lib/data-table.tsx"],"names":[],"mappings":"AA8EA;;GAEG;AACH,eAAO,MAAM,SAAS,KAszDpB,CAAC"}
|
package/dist/lib/data-table.js
CHANGED
|
@@ -603,7 +603,8 @@ logging, }, ref) {
|
|
|
603
603
|
getCoreRowModel: (0, react_table_1.getCoreRowModel)(),
|
|
604
604
|
...(enableSorting ? { getSortedRowModel: (0, react_table_1.getSortedRowModel)() } : {}),
|
|
605
605
|
...(enableColumnFilter || enableGlobalFilter ? { getFilteredRowModel: (0, column_filter_feature_1.getCombinedFilteredRowModel)() } : {}),
|
|
606
|
-
|
|
606
|
+
// Only use getPaginationRowModel for client-side pagination
|
|
607
|
+
...(enablePagination && !isServerPagination ? { getPaginationRowModel: (0, react_table_1.getPaginationRowModel)() } : {}),
|
|
607
608
|
// Sorting
|
|
608
609
|
enableSorting: enableSorting,
|
|
609
610
|
manualSorting: isServerSorting,
|
|
@@ -647,11 +648,7 @@ logging, }, ref) {
|
|
|
647
648
|
// -------------------------------
|
|
648
649
|
// Note: globalFilter is needed in dependencies to trigger recalculation when filter changes
|
|
649
650
|
// The table object is stable, so we need to depend on the filter state directly
|
|
650
|
-
const rows =
|
|
651
|
-
const rowModel = table.getRowModel();
|
|
652
|
-
return (rowModel === null || rowModel === void 0 ? void 0 : rowModel.rows) || [];
|
|
653
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
654
|
-
}, [table, tableData, globalFilter, enableGlobalFilter, enableColumnFilter, enablePagination]);
|
|
651
|
+
const rows = table.getRowModel().rows;
|
|
655
652
|
const rowVirtualizer = (0, react_virtual_1.useVirtualizer)({
|
|
656
653
|
count: rows.length,
|
|
657
654
|
getScrollElement: () => tableContainerRef.current,
|
package/package.json
CHANGED
package/src/lib/data-table.tsx
CHANGED
|
@@ -713,7 +713,8 @@ export const DataTable = forwardRef<DataTableApi<any>, DataTableProps<any>>(func
|
|
|
713
713
|
getCoreRowModel: getCoreRowModel(),
|
|
714
714
|
...(enableSorting ? { getSortedRowModel: getSortedRowModel() } : {}),
|
|
715
715
|
...(enableColumnFilter || enableGlobalFilter ? { getFilteredRowModel: getCombinedFilteredRowModel<T>() } : {}),
|
|
716
|
-
|
|
716
|
+
// Only use getPaginationRowModel for client-side pagination
|
|
717
|
+
...(enablePagination && !isServerPagination ? { getPaginationRowModel: getPaginationRowModel() } : {}),
|
|
717
718
|
// Sorting
|
|
718
719
|
enableSorting: enableSorting,
|
|
719
720
|
manualSorting: isServerSorting,
|
|
@@ -760,11 +761,7 @@ export const DataTable = forwardRef<DataTableApi<any>, DataTableProps<any>>(func
|
|
|
760
761
|
// -------------------------------
|
|
761
762
|
// Note: globalFilter is needed in dependencies to trigger recalculation when filter changes
|
|
762
763
|
// The table object is stable, so we need to depend on the filter state directly
|
|
763
|
-
const rows =
|
|
764
|
-
const rowModel = table.getRowModel();
|
|
765
|
-
return rowModel?.rows || [];
|
|
766
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
767
|
-
}, [table, tableData, globalFilter, enableGlobalFilter, enableColumnFilter, enablePagination]);
|
|
764
|
+
const rows = table.getRowModel().rows;
|
|
768
765
|
const rowVirtualizer = useVirtualizer({
|
|
769
766
|
count: rows.length,
|
|
770
767
|
getScrollElement: () => tableContainerRef.current,
|