@unicef/material-ui 0.11.3 → 0.11.5

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
@@ -41901,6 +41901,18 @@ var UTextField = function (_ValidatorComponent) {
41901
41901
  }
41902
41902
  };
41903
41903
 
41904
+ _this.handleSelectOpen = function () {
41905
+ _this.setState({
41906
+ isSelectOpen: true
41907
+ });
41908
+ };
41909
+
41910
+ _this.handleSelectClose = function () {
41911
+ _this.setState({
41912
+ isSelectOpen: false
41913
+ });
41914
+ };
41915
+
41904
41916
  return _this;
41905
41917
  }
41906
41918
 
@@ -41929,8 +41941,13 @@ var UTextField = function (_ValidatorComponent) {
41929
41941
  InputLabelProps = _props.InputLabelProps,
41930
41942
  showLabelHelp = _props.showLabelHelp,
41931
41943
  InputLabelHelpProps = _props.InputLabelHelpProps,
41932
- rest = objectWithoutProperties(_props, ['variant', 'error', 'customErrorMessages', 'validators', 'requiredError', 'helperText', 'validatorListener', 'withRequiredValidator', 'onBlur', 'maxLength', 'counter', 'counterClassName', 'readOnly', 'label', 'InputProps', 'InputLabelProps', 'showLabelHelp', 'InputLabelHelpProps']);
41933
- var isValid = this.state.isValid;
41944
+ select = _props.select,
41945
+ id = _props.id,
41946
+ SelectProps = _props.SelectProps,
41947
+ rest = objectWithoutProperties(_props, ['variant', 'error', 'customErrorMessages', 'validators', 'requiredError', 'helperText', 'validatorListener', 'withRequiredValidator', 'onBlur', 'maxLength', 'counter', 'counterClassName', 'readOnly', 'label', 'InputProps', 'InputLabelProps', 'showLabelHelp', 'InputLabelHelpProps', 'select', 'id', 'SelectProps']);
41948
+ var _state = this.state,
41949
+ isValid = _state.isValid,
41950
+ isSelectOpen = _state.isSelectOpen;
41934
41951
 
41935
41952
  var length = this.props.value ? this.props.value.length : 0;
41936
41953
  var counterError = maxLength && maxLength < length;
@@ -41952,8 +41969,32 @@ var UTextField = function (_ValidatorComponent) {
41952
41969
  InputLabelProps: _extends$1({}, InputLabelProps, {
41953
41970
  style: _extends$1({}, styles$13.labelRoot)
41954
41971
  }),
41955
- label: showLabelHelp ? React__default.createElement(InputLabelHelp, _extends$1({ inputLabel: label }, InputLabelHelpProps)) : label
41956
- })),
41972
+ label: showLabelHelp ? React__default.createElement(InputLabelHelp, _extends$1({ inputLabel: label }, InputLabelHelpProps)) : label,
41973
+ select: select,
41974
+ id: id
41975
+ /** Accessibility fixes for select field */
41976
+ }, select ? {
41977
+ inputProps: _extends$1({}, this.props.inputProps ? this.props.inputProps : {}, {
41978
+ 'aria-describedby': null
41979
+ }),
41980
+ SelectProps: _extends$1({}, SelectProps ? SelectProps : {}, {
41981
+ open: isSelectOpen ? true : false,
41982
+ onClose: this.handleSelectClose,
41983
+ onOpen: this.handleSelectOpen,
41984
+ MenuProps: {
41985
+ MenuListProps: {
41986
+ id: id + '-select-menu',
41987
+ 'aria-labelledby': null
41988
+ }
41989
+ },
41990
+ SelectDisplayProps: {
41991
+ role: 'combobox',
41992
+ 'aria-controls': id + '-select-menu',
41993
+ 'aria-expanded': isSelectOpen ? true : false,
41994
+ 'aria-describedby': id + '-helper-text'
41995
+ }
41996
+ })
41997
+ } : {})),
41957
41998
  counter && React__default.createElement(
41958
41999
  Box,
41959
42000
  { display: 'block' },
@@ -42006,7 +42047,11 @@ UTextField.propTypes = {
42006
42047
  /** Show label help */
42007
42048
  showLabelHelp: PropTypes__default.bool,
42008
42049
  /** 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}} */
42009
- InputLabelHelpProps: PropTypes__default.object
42050
+ InputLabelHelpProps: PropTypes__default.object,
42051
+ /** Id of the field */
42052
+ id: PropTypes__default.string,
42053
+ /** Props applied to the Select element. */
42054
+ SelectProps: PropTypes__default.object
42010
42055
  };
42011
42056
 
42012
42057
  UTextField.defaultProps = {
@@ -42014,7 +42059,9 @@ UTextField.defaultProps = {
42014
42059
  readOnly: false,
42015
42060
  validatorListener: function validatorListener() {},
42016
42061
  showLabelHelp: false,
42017
- InputLabelHelpProps: {}
42062
+ InputLabelHelpProps: {},
42063
+ select: false,
42064
+ SelectProps: {}
42018
42065
  };
42019
42066
 
42020
42067
  //Extending the ValidatorComponent using class component, so taking an exclusion from our rule: functional components only.
@@ -42976,7 +43023,8 @@ var useStyles$p = makeStyles$1(function (theme) {
42976
43023
  root: {
42977
43024
  position: 'fixed',
42978
43025
  top: 16,
42979
- left: '40%',
43026
+ left: '50%',
43027
+ transform: 'translate(-50%, 0)',
42980
43028
  zIndex: 5000
42981
43029
  },
42982
43030
  chip: {
@@ -45740,6 +45788,10 @@ function USearchBox(_ref) {
45740
45788
 
45741
45789
  var classes = useStyles$u();
45742
45790
 
45791
+ React.useEffect(function () {
45792
+ setSearch(value);
45793
+ }, [value]);
45794
+
45743
45795
  var handleChange = function handleChange(event) {
45744
45796
  setSearch(event.target.value);
45745
45797
  };