@megha-ui/react 1.2.164 → 1.2.165
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.
|
@@ -43,7 +43,7 @@ const file_saver_1 = require("file-saver");
|
|
|
43
43
|
const pagination_1 = __importDefault(require("./utils/pagination"));
|
|
44
44
|
const gridRow_1 = __importDefault(require("./utils/gridRow"));
|
|
45
45
|
const pagination_2 = require("./utils/pagination");
|
|
46
|
-
const gridHeader_1 =
|
|
46
|
+
const gridHeader_1 = __importStar(require("./utils/gridHeader"));
|
|
47
47
|
const useSort_1 = require("./hooks/useSort");
|
|
48
48
|
const usePagination_1 = require("./hooks/usePagination");
|
|
49
49
|
const useBulkSelect_1 = require("./hooks/useBulkSelect");
|
|
@@ -359,6 +359,19 @@ const Grid = ({ columns, wrapperClass, updateGridColumns, data, height, sortable
|
|
|
359
359
|
inputValue,
|
|
360
360
|
fixedFilterValues,
|
|
361
361
|
]);
|
|
362
|
+
// Reset uniqueSearch to reflect the current filteredData
|
|
363
|
+
// Ensures unique filters default to the latest visible values
|
|
364
|
+
(0, react_1.useEffect)(() => {
|
|
365
|
+
const updatedUniqueSearch = {};
|
|
366
|
+
gridColumns.forEach((column) => {
|
|
367
|
+
var _a;
|
|
368
|
+
if (column.uniqueDrop) {
|
|
369
|
+
const columnData = (0, gridHeader_1.getColumnData)(column.key, filteredData, (_a = column.dataType) !== null && _a !== void 0 ? _a : "string");
|
|
370
|
+
updatedUniqueSearch[column.key] = columnData;
|
|
371
|
+
}
|
|
372
|
+
});
|
|
373
|
+
setUniqueSearch(updatedUniqueSearch);
|
|
374
|
+
}, [filteredData, gridColumns]);
|
|
362
375
|
const recalculate = (_summariseKeys) => {
|
|
363
376
|
const filteredData = paginate ? paginatedData : sortedData;
|
|
364
377
|
let newSummariseDetails = summariseDetails;
|
package/package.json
CHANGED