tabler-react-2 0.1.115 → 0.1.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.
package/dist/input/dropdown.js
CHANGED
|
@@ -106,13 +106,15 @@ var DropdownInput = exports.DropdownInput = function DropdownInput(_ref) {
|
|
|
106
106
|
setSelectedValue(matchedValue);
|
|
107
107
|
}, [value, values]);
|
|
108
108
|
var normalize = function normalize(str) {
|
|
109
|
-
|
|
109
|
+
var _str$toLowerCase;
|
|
110
|
+
return str === null || str === void 0 || (_str$toLowerCase = str.toLowerCase()) === null || _str$toLowerCase === void 0 ? void 0 : _str$toLowerCase.replace(/[\s_\-+]+/g, "");
|
|
110
111
|
};
|
|
111
112
|
|
|
112
113
|
// Filter values based on the search query using getLabelText
|
|
113
114
|
(0, _react.useEffect)(function () {
|
|
114
115
|
setFilteredValues(values.filter(function (val) {
|
|
115
|
-
|
|
116
|
+
var _normalize, _val$searchIndex;
|
|
117
|
+
return getLabelText(val).toLowerCase().includes(searchQuery.toLowerCase()) || ((_normalize = normalize((_val$searchIndex = val.searchIndex) === null || _val$searchIndex === void 0 ? void 0 : _val$searchIndex.toLowerCase())) === null || _normalize === void 0 ? void 0 : _normalize.includes(normalize(searchQuery).toLowerCase()));
|
|
116
118
|
}));
|
|
117
119
|
}, [searchQuery, values]);
|
|
118
120
|
var handleSelection = function handleSelection(val) {
|