@thecb/components 9.2.4-beta.14 → 9.2.4-beta.16
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 +39 -5
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +39 -5
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/atoms/dropdown/Dropdown.js +37 -5
- package/src/components/molecules/email-form/EmailForm.js +3 -1
- package/src/components/molecules/phone-form/PhoneForm.js +3 -1
package/dist/index.cjs.js
CHANGED
|
@@ -23965,6 +23965,15 @@ 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
|
+
|
|
23968
23977
|
React.useEffect(function () {
|
|
23969
23978
|
var selectedRefExists = selectedRef !== undefined && selectedRef.current !== null;
|
|
23970
23979
|
|
|
@@ -23998,7 +24007,26 @@ var Dropdown = function Dropdown(_ref13) {
|
|
|
23998
24007
|
}
|
|
23999
24008
|
|
|
24000
24009
|
setFilteredOptions(options.filter(function (option) {
|
|
24001
|
-
|
|
24010
|
+
var _option$value, _option$value$toLower, _option$text, _option$text$toLowerC;
|
|
24011
|
+
|
|
24012
|
+
var inputString = inputValue === null || inputValue === void 0 ? void 0 : inputValue.toLowerCase();
|
|
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));
|
|
24002
24030
|
}));
|
|
24003
24031
|
}, [inputValue]);
|
|
24004
24032
|
React.useEffect(function () {
|
|
@@ -40446,7 +40474,9 @@ var EmailForm = function EmailForm(_ref) {
|
|
|
40446
40474
|
handleSubmit = _ref$handleSubmit === void 0 ? noop : _ref$handleSubmit,
|
|
40447
40475
|
showWalletCheckbox = _ref.showWalletCheckbox,
|
|
40448
40476
|
saveToWallet = _ref.saveToWallet,
|
|
40449
|
-
walletCheckboxMarked = _ref.walletCheckboxMarked
|
|
40477
|
+
walletCheckboxMarked = _ref.walletCheckboxMarked,
|
|
40478
|
+
_ref$isRequired = _ref.isRequired,
|
|
40479
|
+
isRequired = _ref$isRequired === void 0 ? false : _ref$isRequired;
|
|
40450
40480
|
|
|
40451
40481
|
if (clearOnDismount) {
|
|
40452
40482
|
React.useEffect(function () {
|
|
@@ -40475,7 +40505,8 @@ var EmailForm = function EmailForm(_ref) {
|
|
|
40475
40505
|
},
|
|
40476
40506
|
isEmail: true,
|
|
40477
40507
|
autocompleteValue: "email",
|
|
40478
|
-
dataQa: "Email address"
|
|
40508
|
+
dataQa: "Email address",
|
|
40509
|
+
isRequired: isRequired
|
|
40479
40510
|
}), showWalletCheckbox && /*#__PURE__*/React__default.createElement(Checkbox$1, {
|
|
40480
40511
|
name: "email checkbox",
|
|
40481
40512
|
title: "Save email address to wallet",
|
|
@@ -48495,7 +48526,9 @@ var PhoneForm = function PhoneForm(_ref) {
|
|
|
48495
48526
|
handleSubmit = _ref$handleSubmit === void 0 ? noop : _ref$handleSubmit,
|
|
48496
48527
|
showWalletCheckbox = _ref.showWalletCheckbox,
|
|
48497
48528
|
saveToWallet = _ref.saveToWallet,
|
|
48498
|
-
walletCheckboxMarked = _ref.walletCheckboxMarked
|
|
48529
|
+
walletCheckboxMarked = _ref.walletCheckboxMarked,
|
|
48530
|
+
_ref$isRequired = _ref.isRequired,
|
|
48531
|
+
isRequired = _ref$isRequired === void 0 ? false : _ref$isRequired;
|
|
48499
48532
|
|
|
48500
48533
|
if (clearOnDismount) {
|
|
48501
48534
|
React.useEffect(function () {
|
|
@@ -48522,7 +48555,8 @@ var PhoneForm = function PhoneForm(_ref) {
|
|
|
48522
48555
|
},
|
|
48523
48556
|
autocompleteValue: "tel-national",
|
|
48524
48557
|
dataQa: "Phone number",
|
|
48525
|
-
isNum: true
|
|
48558
|
+
isNum: true,
|
|
48559
|
+
isRequired: isRequired
|
|
48526
48560
|
}), showWalletCheckbox && /*#__PURE__*/React__default.createElement(Checkbox$1, {
|
|
48527
48561
|
name: "phone checkbox",
|
|
48528
48562
|
title: "Save phone number to wallet",
|