@smallwebco/tinypivot-react 1.0.11 → 1.0.13
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.cjs +5 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +5 -3
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -105,7 +105,6 @@ function useExcelGrid(options) {
|
|
|
105
105
|
const column = table.getColumn(columnId);
|
|
106
106
|
if (column) {
|
|
107
107
|
column.setFilterValue(values.length === 0 ? void 0 : values);
|
|
108
|
-
setColumnFilters(table.getState().columnFilters);
|
|
109
108
|
}
|
|
110
109
|
},
|
|
111
110
|
[table]
|
|
@@ -1827,7 +1826,7 @@ function DataGrid({
|
|
|
1827
1826
|
const filteredDataForPivot = useMemo8(() => {
|
|
1828
1827
|
const filteredRows = table.getFilteredRowModel().rows;
|
|
1829
1828
|
return filteredRows.map((row) => row.original);
|
|
1830
|
-
}, [table]);
|
|
1829
|
+
}, [table, columnFilters]);
|
|
1831
1830
|
const {
|
|
1832
1831
|
rowFields: pivotRowFields,
|
|
1833
1832
|
columnFields: pivotColumnFields,
|
|
@@ -1859,7 +1858,7 @@ function DataGrid({
|
|
|
1859
1858
|
values: f.values || []
|
|
1860
1859
|
}));
|
|
1861
1860
|
}, [activeFilters]);
|
|
1862
|
-
const rows = useMemo8(() => table.
|
|
1861
|
+
const rows = useMemo8(() => table.getFilteredRowModel().rows, [table, columnFilters]);
|
|
1863
1862
|
const searchFilteredData = useMemo8(() => {
|
|
1864
1863
|
if (!globalSearchTerm.trim() || !enableSearch) {
|
|
1865
1864
|
return rows;
|
|
@@ -1887,6 +1886,9 @@ function DataGrid({
|
|
|
1887
1886
|
const end = start + pageSize;
|
|
1888
1887
|
return searchFilteredData.slice(start, end);
|
|
1889
1888
|
}, [enablePagination, searchFilteredData, currentPage, pageSize]);
|
|
1889
|
+
useEffect3(() => {
|
|
1890
|
+
setCurrentPage(1);
|
|
1891
|
+
}, [columnFilters, globalSearchTerm]);
|
|
1890
1892
|
const selectionBounds = useMemo8(() => {
|
|
1891
1893
|
if (!selectionStart || !selectionEnd) return null;
|
|
1892
1894
|
return {
|