@megha-ui/react 1.2.115 → 1.2.116

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 options = [
1348
- ...new Set(data
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: fixedFilterValues[column.key]
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)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@megha-ui/react",
3
- "version": "1.2.115",
3
+ "version": "1.2.116",
4
4
  "description": "A collection of reusable UI components for React applications, built with TypeScript.",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",