@megha-ui/react 1.2.51 → 1.2.52
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.
|
@@ -993,20 +993,35 @@ const Grid = ({ columns, wrapperClass, updateGridColumns, data, height, sortable
|
|
|
993
993
|
const filterDetails = (0, react_1.useMemo)(() => {
|
|
994
994
|
const filterColumn = gridColumns.reduce((acc, column) => {
|
|
995
995
|
const query = searchQueries[column.key];
|
|
996
|
+
const uniqeValues = [
|
|
997
|
+
...new Set(filteredData.map((data) => { var _a; return data[column.key] && ((_a = data[column.key].value) === null || _a === void 0 ? void 0 : _a.toString()); })),
|
|
998
|
+
].sort();
|
|
996
999
|
if (query &&
|
|
997
1000
|
(query.text !== "" || query.type !== defaultSearchOperation)) {
|
|
998
1001
|
acc[column.key] = query.text;
|
|
999
1002
|
}
|
|
1003
|
+
else if (uniqueSearch[column.key] &&
|
|
1004
|
+
uniqeValues.toString() !== uniqueSearch[column.key].sort().toString()) {
|
|
1005
|
+
acc[column.key] = uniqueSearch[column.key].join(",");
|
|
1006
|
+
}
|
|
1000
1007
|
return acc;
|
|
1001
1008
|
}, {});
|
|
1002
1009
|
const propFilterColumn = gridColumns.reduce((acc, column) => {
|
|
1003
1010
|
if (filterData) {
|
|
1004
|
-
const { searchQueries } = filterData;
|
|
1011
|
+
const { searchQueries, uniqueSearch } = filterData;
|
|
1005
1012
|
const query = searchQueries[column.key];
|
|
1013
|
+
const uniqeValues = [
|
|
1014
|
+
...new Set(filteredData.map((data) => { var _a; return data[column.key] && ((_a = data[column.key].value) === null || _a === void 0 ? void 0 : _a.toString()); })),
|
|
1015
|
+
].sort();
|
|
1006
1016
|
if (query &&
|
|
1007
1017
|
(query.text !== "" || query.type !== defaultSearchOperation)) {
|
|
1008
1018
|
acc[column.key] = query.text;
|
|
1009
1019
|
}
|
|
1020
|
+
else if (uniqueSearch[column.key] &&
|
|
1021
|
+
uniqeValues.toString() !==
|
|
1022
|
+
uniqueSearch[column.key].sort().toString()) {
|
|
1023
|
+
acc[column.key] = uniqueSearch[column.key].join(",");
|
|
1024
|
+
}
|
|
1010
1025
|
}
|
|
1011
1026
|
return acc;
|
|
1012
1027
|
}, {});
|
package/package.json
CHANGED