tabler-react-2 0.1.102 → 0.1.103
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 +4 -1
- package/package.json +1 -1
package/dist/input/dropdown.js
CHANGED
|
@@ -104,11 +104,14 @@ var DropdownInput = exports.DropdownInput = function DropdownInput(_ref) {
|
|
|
104
104
|
}) || null;
|
|
105
105
|
setSelectedValue(matchedValue);
|
|
106
106
|
}, [value, values]);
|
|
107
|
+
var normalize = function normalize(str) {
|
|
108
|
+
return str.toLowerCase().replace(/[\s_\-+]+/g, "");
|
|
109
|
+
};
|
|
107
110
|
|
|
108
111
|
// Filter values based on the search query using getLabelText
|
|
109
112
|
(0, _react.useEffect)(function () {
|
|
110
113
|
setFilteredValues(values.filter(function (val) {
|
|
111
|
-
return getLabelText(val).toLowerCase().includes(searchQuery.toLowerCase());
|
|
114
|
+
return getLabelText(val).toLowerCase().includes(searchQuery.toLowerCase()) || normalize(val.searchIndex.toLowerCase()).includes(normalize(searchQuery).toLowerCase());
|
|
112
115
|
}));
|
|
113
116
|
}, [searchQuery, values]);
|
|
114
117
|
var handleSelection = function handleSelection(val) {
|