@thecb/components 9.2.4-beta.16 → 9.2.4-beta.18
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/index.cjs.js
CHANGED
|
@@ -23965,15 +23965,6 @@ var Dropdown = function Dropdown(_ref13) {
|
|
|
23965
23965
|
}
|
|
23966
23966
|
};
|
|
23967
23967
|
|
|
23968
|
-
var stringContains = function stringContains(regexp, str) {
|
|
23969
|
-
if (str && typeof str === "string" && regexp && _typeof(regexp) === _typeof(new RegExp(/[]/))) {
|
|
23970
|
-
return regexp.test(str);
|
|
23971
|
-
} else {
|
|
23972
|
-
// If element is not a string, return false
|
|
23973
|
-
return false;
|
|
23974
|
-
}
|
|
23975
|
-
};
|
|
23976
|
-
|
|
23977
23968
|
React.useEffect(function () {
|
|
23978
23969
|
var selectedRefExists = selectedRef !== undefined && selectedRef.current !== null;
|
|
23979
23970
|
|
|
@@ -24009,24 +24000,7 @@ var Dropdown = function Dropdown(_ref13) {
|
|
|
24009
24000
|
setFilteredOptions(options.filter(function (option) {
|
|
24010
24001
|
var _option$value, _option$value$toLower, _option$text, _option$text$toLowerC;
|
|
24011
24002
|
|
|
24012
|
-
|
|
24013
|
-
var inputStringContainsPlus = stringContains(/\+/, inputString);
|
|
24014
|
-
var inputStringContainsOpenParen = stringContains(/\(/, inputString);
|
|
24015
|
-
var inputStringContainsCloseParen = stringContains(/\)/, inputString);
|
|
24016
|
-
|
|
24017
|
-
if (inputStringContainsPlus) {
|
|
24018
|
-
inputString = inputString.replace(/\+/, "\\+");
|
|
24019
|
-
}
|
|
24020
|
-
|
|
24021
|
-
if (inputStringContainsOpenParen) {
|
|
24022
|
-
inputString = inputString.replace(/\(/, "\\(");
|
|
24023
|
-
}
|
|
24024
|
-
|
|
24025
|
-
if (inputStringContainsCloseParen) {
|
|
24026
|
-
inputString = inputString.replace(/\)/, "\\)");
|
|
24027
|
-
}
|
|
24028
|
-
|
|
24029
|
-
return (option === null || option === void 0 ? void 0 : (_option$value = option.value) === null || _option$value === void 0 ? void 0 : (_option$value$toLower = _option$value.toLowerCase()) === null || _option$value$toLower === void 0 ? void 0 : _option$value$toLower.match(inputString)) || ((_option$text = option.text) === null || _option$text === void 0 ? void 0 : (_option$text$toLowerC = _option$text.toLowerCase()) === null || _option$text$toLowerC === void 0 ? void 0 : _option$text$toLowerC.match(inputString));
|
|
24003
|
+
return (option === null || option === void 0 ? void 0 : (_option$value = option.value) === null || _option$value === void 0 ? void 0 : (_option$value$toLower = _option$value.toLowerCase()) === null || _option$value$toLower === void 0 ? void 0 : _option$value$toLower.indexOf(inputValue === null || inputValue === void 0 ? void 0 : inputValue.toLowerCase())) >= 0 || ((_option$text = option.text) === null || _option$text === void 0 ? void 0 : (_option$text$toLowerC = _option$text.toLowerCase()) === null || _option$text$toLowerC === void 0 ? void 0 : _option$text$toLowerC.indexOf(inputValue === null || inputValue === void 0 ? void 0 : inputValue.toLowerCase())) >= 0;
|
|
24030
24004
|
}));
|
|
24031
24005
|
}, [inputValue]);
|
|
24032
24006
|
React.useEffect(function () {
|