@unicef/material-ui 0.12.1 → 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
@@ -28334,7 +28348,12 @@ function InputComponent(_ref) {
28334
28348
  var inputRef = _ref.inputRef,
28335
28349
  props = objectWithoutProperties(_ref, ['inputRef']);
28336
28350
 
28337
- return React__default.createElement('div', _extends$1({ ref: inputRef }, props));
28351
+ return React__default.createElement('div', _extends$1({
28352
+ ref: inputRef
28353
+ }, props, {
28354
+ required: undefined // Remove required from div element
28355
+ , 'aria-invalid': undefined // Remove aria-invalid from div element
28356
+ }));
28338
28357
  }
28339
28358
 
28340
28359
  InputComponent.propTypes = {
@@ -30159,7 +30178,10 @@ function Input$3(props) {
30159
30178
  describedBy = describedBy || customDescribedBy ? '' + (describedBy ? describedBy : '') + (customDescribedBy ? ' ' + customDescribedBy : '') : undefined;
30160
30179
  }
30161
30180
 
30162
- return React__default.createElement(components.Input, _extends$1({}, props, { 'aria-describedby': describedBy }));
30181
+ return React__default.createElement(components.Input, _extends$1({}, props, {
30182
+ 'aria-describedby': describedBy,
30183
+ required: props && props.selectProps && props.selectProps.required || undefined
30184
+ }));
30163
30185
  }
30164
30186
 
30165
30187
  Input$3.propTypes = {
@@ -41776,6 +41798,10 @@ function ForwardRefForm(props, ref) {
41776
41798
  return isAlphanumericText(value);
41777
41799
  });
41778
41800
 
41801
+ lib_2.addValidationRule('matchRegexpCaseInSensitive', function (value, regexStr) {
41802
+ return isRegexCaseInSensitive(value, regexStr);
41803
+ });
41804
+
41779
41805
  return React__default.createElement(lib_2, _extends$1({}, props, { ref: ref }));
41780
41806
  }
41781
41807
 
@@ -45566,7 +45592,8 @@ function ActiveKeyboardDatePicker(props) {
45566
45592
  showLabelHelp = props.showLabelHelp,
45567
45593
  InputLabelHelpProps = props.InputLabelHelpProps,
45568
45594
  label = props.label,
45569
- others = objectWithoutProperties(props, ['autoOk', 'variant', 'inputVariant', 'readOnly', 'interactiveMode', 'InputLabelProps', 'className', 'inputProps', 'InputProps', 'placeholder', 'showLabelHelp', 'InputLabelHelpProps', 'label']);
45595
+ KeyboardButtonProps = props.KeyboardButtonProps,
45596
+ others = objectWithoutProperties(props, ['autoOk', 'variant', 'inputVariant', 'readOnly', 'interactiveMode', 'InputLabelProps', 'className', 'inputProps', 'InputProps', 'placeholder', 'showLabelHelp', 'InputLabelHelpProps', 'label', 'KeyboardButtonProps']);
45570
45597
 
45571
45598
  var _React$useState = React__default.useState(classes.icon),
45572
45599
  _React$useState2 = slicedToArray(_React$useState, 2),
@@ -45607,11 +45634,11 @@ function ActiveKeyboardDatePicker(props) {
45607
45634
  disabled: Boolean(readOnly)
45608
45635
  }, inputProps),
45609
45636
  readOnly: readOnly,
45610
- KeyboardButtonProps: {
45637
+ KeyboardButtonProps: _extends$1({}, KeyboardButtonProps, {
45611
45638
  classes: {
45612
45639
  root: '' + (!interactiveMode && !readOnly ? '' : hideIcon)
45613
45640
  }
45614
- },
45641
+ }),
45615
45642
  InputProps: _extends$1({
45616
45643
  classes: {
45617
45644
  root: classes.input + ' ' + (readOnly && classes.inputHover),
@@ -45653,14 +45680,17 @@ ActiveKeyboardDatePicker.propTypes = {
45653
45680
  /** Show label help */
45654
45681
  showLabelHelp: PropTypes__default.bool,
45655
45682
  /** Props applied to the input label help element. E.g InputLabelHelpProps={{type:'link', label:'Help', link:'unicef.github.io', icon, tooltipTitle: 'Tooltip title', tooltipPlacement: 'bottom}} */
45656
- InputLabelHelpProps: PropTypes__default.object
45683
+ InputLabelHelpProps: PropTypes__default.object,
45684
+ /** Keyboard button props */
45685
+ KeyboardButtonProps: PropTypes__default.object
45657
45686
  };
45658
45687
 
45659
45688
  ActiveKeyboardDatePicker.defaultProps = {
45660
45689
  inputVariant: 'outlined',
45661
45690
  autoOk: true,
45662
45691
  variant: 'inline',
45663
- format: 'dd/MM/yyyy'
45692
+ format: 'dd/MM/yyyy',
45693
+ KeyboardButtonProps: {}
45664
45694
  };
45665
45695
 
45666
45696
  var styles$17 = {
@@ -45983,7 +46013,8 @@ function ActiveKeyboardTimePicker(props) {
45983
46013
  showLabelHelp = props.showLabelHelp,
45984
46014
  InputLabelHelpProps = props.InputLabelHelpProps,
45985
46015
  label = props.label,
45986
- others = objectWithoutProperties(props, ['inputVariant', 'readOnly', 'interactiveMode', 'InputLabelProps', 'className', 'inputProps', 'InputProps', 'placeholder', 'showLabelHelp', 'InputLabelHelpProps', 'label']);
46016
+ KeyboardButtonProps = props.KeyboardButtonProps,
46017
+ others = objectWithoutProperties(props, ['inputVariant', 'readOnly', 'interactiveMode', 'InputLabelProps', 'className', 'inputProps', 'InputProps', 'placeholder', 'showLabelHelp', 'InputLabelHelpProps', 'label', 'KeyboardButtonProps']);
45987
46018
 
45988
46019
  var _React$useState = React__default.useState(classes.icon),
45989
46020
  _React$useState2 = slicedToArray(_React$useState, 2),
@@ -46022,11 +46053,11 @@ function ActiveKeyboardTimePicker(props) {
46022
46053
  disabled: Boolean(readOnly)
46023
46054
  }, inputProps),
46024
46055
  readOnly: readOnly,
46025
- KeyboardButtonProps: {
46056
+ KeyboardButtonProps: _extends$1({}, KeyboardButtonProps, {
46026
46057
  classes: {
46027
46058
  root: '' + (!interactiveMode && !readOnly ? '' : hideIcon)
46028
46059
  }
46029
- },
46060
+ }),
46030
46061
  InputProps: _extends$1({
46031
46062
  classes: {
46032
46063
  root: classes.input + ' ' + (readOnly && classes.inputHover),
@@ -46064,13 +46095,16 @@ ActiveKeyboardTimePicker.propTypes = {
46064
46095
  /** Show label help */
46065
46096
  showLabelHelp: PropTypes__default.bool,
46066
46097
  /** Props applied to the input label help element. E.g InputLabelHelpProps={{type:'link', label:'Help', link:'unicef.github.io', icon, tooltipTitle: 'Tooltip title', tooltipPlacement: 'bottom}} */
46067
- InputLabelHelpProps: PropTypes__default.object
46098
+ InputLabelHelpProps: PropTypes__default.object,
46099
+ /** Keyboard button props */
46100
+ KeyboardButtonProps: PropTypes__default.object
46068
46101
  };
46069
46102
 
46070
46103
  ActiveKeyboardTimePicker.defaultProps = {
46071
46104
  inputVariant: 'outlined',
46072
46105
  autoOk: true,
46073
- variant: 'inline'
46106
+ variant: 'inline',
46107
+ KeyboardButtonProps: {}
46074
46108
  };
46075
46109
 
46076
46110
  var filter$1 = createFilterOptions();
@@ -46356,7 +46390,8 @@ function ActiveKeyboardDateTimePicker(props) {
46356
46390
  showLabelHelp = props.showLabelHelp,
46357
46391
  InputLabelHelpProps = props.InputLabelHelpProps,
46358
46392
  label = props.label,
46359
- others = objectWithoutProperties(props, ['autoOk', 'variant', 'inputVariant', 'readOnly', 'interactiveMode', 'InputLabelProps', 'className', 'inputProps', 'InputProps', 'placeholder', 'showLabelHelp', 'InputLabelHelpProps', 'label']);
46393
+ KeyboardButtonProps = props.KeyboardButtonProps,
46394
+ others = objectWithoutProperties(props, ['autoOk', 'variant', 'inputVariant', 'readOnly', 'interactiveMode', 'InputLabelProps', 'className', 'inputProps', 'InputProps', 'placeholder', 'showLabelHelp', 'InputLabelHelpProps', 'label', 'KeyboardButtonProps']);
46360
46395
 
46361
46396
  var _React$useState = React__default.useState(classes.icon),
46362
46397
  _React$useState2 = slicedToArray(_React$useState, 2),
@@ -46397,11 +46432,11 @@ function ActiveKeyboardDateTimePicker(props) {
46397
46432
  disabled: Boolean(readOnly)
46398
46433
  }, inputProps),
46399
46434
  readOnly: readOnly,
46400
- KeyboardButtonProps: {
46435
+ KeyboardButtonProps: _extends$1({}, KeyboardButtonProps, {
46401
46436
  classes: {
46402
46437
  root: '' + (!interactiveMode && !readOnly ? '' : hideIcon)
46403
46438
  }
46404
- },
46439
+ }),
46405
46440
  InputProps: _extends$1({
46406
46441
  classes: {
46407
46442
  root: classes.input + ' ' + (readOnly && classes.inputHover),
@@ -46443,14 +46478,17 @@ ActiveKeyboardDateTimePicker.propTypes = {
46443
46478
  /** Show label help */
46444
46479
  showLabelHelp: PropTypes__default.bool,
46445
46480
  /** Props applied to the input label help element. E.g InputLabelHelpProps={{type:'link', label:'Help', link:'unicef.github.io', icon, tooltipTitle: 'Tooltip title', tooltipPlacement: 'bottom}} */
46446
- InputLabelHelpProps: PropTypes__default.object
46481
+ InputLabelHelpProps: PropTypes__default.object,
46482
+ /** Keyboard button props */
46483
+ KeyboardButtonProps: PropTypes__default.object
46447
46484
  };
46448
46485
 
46449
46486
  ActiveKeyboardDateTimePicker.defaultProps = {
46450
46487
  inputVariant: 'outlined',
46451
46488
  autoOk: true,
46452
46489
  variant: 'inline',
46453
- format: 'dd/MM/yyyy hh:mm a'
46490
+ format: 'dd/MM/yyyy hh:mm a',
46491
+ KeyboardButtonProps: {}
46454
46492
  };
46455
46493
 
46456
46494
  exports.ActiveAutoComplete = ActiveAutoComplete;