@megha-ui/react 1.2.115 → 1.2.117
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.
|
@@ -1344,15 +1344,26 @@ const Grid = ({ columns, wrapperClass, updateGridColumns, data, height, sortable
|
|
|
1344
1344
|
gap: "0.5rem",
|
|
1345
1345
|
padding: "0.25rem 0.5rem",
|
|
1346
1346
|
}, children: fixedColumns.map((column) => {
|
|
1347
|
-
const
|
|
1348
|
-
|
|
1347
|
+
const selectedValues = fixedFilterValues[column.key]
|
|
1348
|
+
? fixedFilterValues[column.key].map((item) => item.toString())
|
|
1349
|
+
: [];
|
|
1350
|
+
let options = [
|
|
1351
|
+
...data
|
|
1349
1352
|
.filter((item) => item[column.key])
|
|
1350
1353
|
.map((data) => {
|
|
1351
1354
|
var _a;
|
|
1352
1355
|
return data[column.key] && data[column.key].value
|
|
1353
1356
|
? (_a = data[column.key].value) === null || _a === void 0 ? void 0 : _a.toString()
|
|
1354
1357
|
: "";
|
|
1355
|
-
})
|
|
1358
|
+
})
|
|
1359
|
+
];
|
|
1360
|
+
selectedValues.forEach(item => {
|
|
1361
|
+
if (!options.includes(item)) {
|
|
1362
|
+
options.push(item);
|
|
1363
|
+
}
|
|
1364
|
+
});
|
|
1365
|
+
options = [
|
|
1366
|
+
...new Set(options),
|
|
1356
1367
|
];
|
|
1357
1368
|
if (!column.hidden) {
|
|
1358
1369
|
return ((0, jsx_runtime_1.jsx)("div", { style: {
|
|
@@ -1361,9 +1372,7 @@ const Grid = ({ columns, wrapperClass, updateGridColumns, data, height, sortable
|
|
|
1361
1372
|
}, children: (0, jsx_runtime_1.jsx)(dropdown_1.default, { options: options.map((option) => ({
|
|
1362
1373
|
label: option,
|
|
1363
1374
|
value: option,
|
|
1364
|
-
})), label: column.label, placeholder: "Select", selectedValues:
|
|
1365
|
-
? fixedFilterValues[column.key].map((item) => item.toString())
|
|
1366
|
-
: [], onChange: (selected) => {
|
|
1375
|
+
})), label: column.label, placeholder: "Select", selectedValues: selectedValues, onChange: (selected) => {
|
|
1367
1376
|
if (column.fixedFilter !== "multi-select") {
|
|
1368
1377
|
const values = selected
|
|
1369
1378
|
.filter((item) => item)
|
|
@@ -40,9 +40,9 @@ const GridFilterDropdown = ({ headerDropdownIndex, searchOptions, position, colu
|
|
|
40
40
|
_uniqueSeach = Object.assign(Object.assign({}, uniqueSearch), { [columnKey]: [] });
|
|
41
41
|
}
|
|
42
42
|
else {
|
|
43
|
+
console.log(_uniqueSeach, columnKey, columnData);
|
|
43
44
|
_uniqueSeach = Object.assign(Object.assign({}, uniqueSearch), { [columnKey]: columnData });
|
|
44
45
|
}
|
|
45
|
-
console.log(_uniqueSeach, columnKey);
|
|
46
46
|
setUniqueSearch(_uniqueSeach);
|
|
47
47
|
}
|
|
48
48
|
else {
|
package/package.json
CHANGED