@unicef/material-ui 0.12.2 → 0.12.3

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/lib/prod.js CHANGED
@@ -6848,6 +6848,20 @@ function isPhoneNumberText(value) {
6848
6848
  return true;
6849
6849
  }
6850
6850
 
6851
+ /**
6852
+ *
6853
+ * @param {String} value Value text to be validated
6854
+ * @returns {Boolean} Whether the given value string contains safe text (no html tags)
6855
+ */
6856
+ function isRegexCaseInSensitive(value, regexRule) {
6857
+ var valueToTest = value || '';
6858
+ var regexStr = regexRule;
6859
+ if (!regexStr) return true; // if no regex, then accept any text
6860
+
6861
+ var regex = new RegExp(regexStr, 'i');
6862
+ return regex.test(valueToTest);
6863
+ }
6864
+
6851
6865
  /**
6852
6866
  *
6853
6867
  * @param {String} value Value text to be validated
@@ -41784,6 +41798,10 @@ function ForwardRefForm(props, ref) {
41784
41798
  return isAlphanumericText(value);
41785
41799
  });
41786
41800
 
41801
+ lib_2.addValidationRule('matchRegexpCaseInSensitive', function (value, regexStr) {
41802
+ return isRegexCaseInSensitive(value, regexStr);
41803
+ });
41804
+
41787
41805
  return React__default.createElement(lib_2, _extends$1({}, props, { ref: ref }));
41788
41806
  }
41789
41807