@megha-ui/react 1.2.357 → 1.2.359
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.
|
@@ -146,6 +146,8 @@ const Dropdown = ({ options, selectedValues, onChange, placeholder = "Select..."
|
|
|
146
146
|
.sort((a, b) => (a.label > b.label ? 1 : -1))
|
|
147
147
|
.filter((option) => option.label.toLowerCase().includes(searchTerm.toLowerCase()))
|
|
148
148
|
: options.filter((option) => option.label.toLowerCase().includes(searchTerm.toLowerCase()));
|
|
149
|
+
console.log(options);
|
|
150
|
+
setFilteredOptions(options);
|
|
149
151
|
const grouped = [];
|
|
150
152
|
if (isGrouping) {
|
|
151
153
|
const groups = [...new Set(options.map((opt) => opt.group))];
|
|
@@ -165,7 +167,6 @@ const Dropdown = ({ options, selectedValues, onChange, placeholder = "Select..."
|
|
|
165
167
|
}
|
|
166
168
|
setGroupedOptions(grouped);
|
|
167
169
|
}
|
|
168
|
-
setFilteredOptions(options);
|
|
169
170
|
}, [searchTerm, options, isSort, isGrouping]);
|
|
170
171
|
const handleSelect = (value, isDisabled) => {
|
|
171
172
|
if (isDisabled)
|
|
@@ -394,7 +395,7 @@ const Dropdown = ({ options, selectedValues, onChange, placeholder = "Select..."
|
|
|
394
395
|
width: "100%",
|
|
395
396
|
}, children: [option.icon &&
|
|
396
397
|
option.isDelete &&
|
|
397
|
-
!option.isDelete &&
|
|
398
|
+
!option.isDelete && _jsx("span", { children: option.icon }), _jsx("span", { style: { margin: "0 0.5rem" }, children: option.label })] }), option.icon && option.isDelete && option.icon] }, String(option.value)));
|
|
398
399
|
})] }, gIndex)))) : (filteredOptions.map((option, index) => (_jsxs("li", { ref: (el) => {
|
|
399
400
|
optionRefs.current[index] = el;
|
|
400
401
|
}, onClick: (e) => onSelectChange
|
|
@@ -375,7 +375,6 @@ const Grid = ({ columns, wrapperClass, updateGridColumns, data, height, sortable
|
|
|
375
375
|
: [];
|
|
376
376
|
const expandedValueTokens = filterTokens
|
|
377
377
|
.flatMap((tok) => tok.split("+").map((s) => s.trim()).filter(Boolean));
|
|
378
|
-
console.log({ filterTokens, expandedColumnTokens });
|
|
379
378
|
const filteredValues = filteredData
|
|
380
379
|
.filter((row) => {
|
|
381
380
|
var _a, _b, _c, _d;
|
|
@@ -386,7 +385,6 @@ const Grid = ({ columns, wrapperClass, updateGridColumns, data, height, sortable
|
|
|
386
385
|
const col = expandedColumnTokens[i];
|
|
387
386
|
const value = (_c = (_b = (_a = row[col]) === null || _a === void 0 ? void 0 : _a.value) === null || _b === void 0 ? void 0 : _b.toString()) !== null && _c !== void 0 ? _c : "";
|
|
388
387
|
const expected = (_d = expandedValueTokens[i]) !== null && _d !== void 0 ? _d : "";
|
|
389
|
-
console.log({ expected, value });
|
|
390
388
|
if (value !== expected)
|
|
391
389
|
return false;
|
|
392
390
|
}
|
package/package.json
CHANGED