@unicef/material-ui 0.9.1 → 0.11.0

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/dev.js CHANGED
@@ -38610,13 +38610,13 @@ var useStyles$6 = makeStyles$1(function (theme) {
38610
38610
  display: 'inline-flex',
38611
38611
  marginRight: theme.spacing(1),
38612
38612
  '& .MuiAvatar-root': {
38613
- height: 24,
38614
- width: 24
38613
+ height: 32,
38614
+ width: 32
38615
38615
  }
38616
38616
  },
38617
38617
  avatar: {
38618
- height: 24,
38619
- width: 24,
38618
+ height: 32,
38619
+ width: 32,
38620
38620
  marginRight: theme.spacing(1)
38621
38621
  },
38622
38622
  optionLabel: {
@@ -40088,7 +40088,8 @@ function PositiveNumberFormat(_ref) {
40088
40088
  isNumericString = _ref.isNumericString,
40089
40089
  allowNegative = _ref.allowNegative,
40090
40090
  decimalScale = _ref.decimalScale,
40091
- other = objectWithoutProperties(_ref, ['inputRef', 'name', 'onChange', 'thousandSeparator', 'isNumericString', 'allowNegative', 'decimalScale']);
40091
+ fixedDecimalScale = _ref.fixedDecimalScale,
40092
+ other = objectWithoutProperties(_ref, ['inputRef', 'name', 'onChange', 'thousandSeparator', 'isNumericString', 'allowNegative', 'decimalScale', 'fixedDecimalScale']);
40092
40093
 
40093
40094
  return React__default.createElement(NumberFormat, _extends$1({}, other, {
40094
40095
  getInputRef: inputRef,
@@ -40103,7 +40104,8 @@ function PositiveNumberFormat(_ref) {
40103
40104
  thousandSeparator: thousandSeparator,
40104
40105
  isNumericString: isNumericString,
40105
40106
  allowNegative: allowNegative,
40106
- decimalScale: decimalScale
40107
+ decimalScale: decimalScale,
40108
+ fixedDecimalScale: fixedDecimalScale
40107
40109
  }));
40108
40110
  }
40109
40111
 
@@ -40119,14 +40121,17 @@ PositiveNumberFormat.propTypes = {
40119
40121
  // Is allow negative numbers
40120
40122
  allowNegative: PropTypes__default.bool,
40121
40123
  // No of decimal digits
40122
- decimalScale: PropTypes__default.number
40124
+ decimalScale: PropTypes__default.number,
40125
+ //If true it add 0s to match given decimalScale.
40126
+ fixedDecimalScale: PropTypes__default.bool
40123
40127
  };
40124
40128
 
40125
40129
  PositiveNumberFormat.defaultProps = {
40126
40130
  thousandSeparator: true,
40127
40131
  isNumericString: false,
40128
40132
  allowNegative: false,
40129
- decimalScale: 0
40133
+ decimalScale: 0,
40134
+ fixedDecimalScale: false
40130
40135
  };
40131
40136
 
40132
40137
  var HelpOutline = createCommonjsModule(function (module, exports) {
@@ -40815,6 +40820,85 @@ UPeoplePicker.defaultProps = {
40815
40820
  InputLabelHelpProps: {}
40816
40821
  };
40817
40822
 
40823
+ /**
40824
+ * UIconPicker is a control for selecting icon from a list. Has the features below:
40825
+ *
40826
+ * * Select a single icon from a list.
40827
+ * * Select multiple icon from a list.
40828
+ * * Autocomplete.
40829
+ * * Clear current selection.
40830
+ *
40831
+ */
40832
+ function UIconPicker(props) {
40833
+ return React__default.createElement(USelectPicker, _extends$1({}, props, { hideAvatar: false }));
40834
+ }
40835
+
40836
+ UIconPicker.propTypes = {
40837
+ /** Text to display when nothing is selected. */
40838
+ placeholder: PropTypes__default.string,
40839
+ /** Enables the multiple select. Default is false. */
40840
+ isMulti: PropTypes__default.bool,
40841
+ /** Label of the picker. */
40842
+ label: PropTypes__default.string,
40843
+ /** Variant of TextField to use. Default is outlined.*/
40844
+ variant: PropTypes__default.oneOf(['outlined', 'standard', 'filled']),
40845
+ /** Id to assign to the input element */
40846
+ inputId: PropTypes__default.string,
40847
+ /** Callback fired when the value is changed.
40848
+ *
40849
+ * `event`:
40850
+ * The event source of the callback. You can pull out the new value by accessing "event.target.value".
40851
+ */
40852
+ onChange: PropTypes__default.func,
40853
+ /** Array of to display select on the dropdown.
40854
+ * Each option is an object with the following attributes:
40855
+ *
40856
+ * ```
40857
+ * {
40858
+ * value: 1,
40859
+ * label: 'Sample 1', //First line, typically the name
40860
+ * image: 'svg', // image svg string
40861
+ * avatar: ( //Avatar object to display.
40862
+ * <Avatar
40863
+ * src={'blob:http://...'} // SVG Icon
40864
+ * />
40865
+ * ),
40866
+ * }
40867
+ *```
40868
+ *
40869
+ */
40870
+ options: PropTypes__default.array,
40871
+ /** Props passed to the TextField used in the picker. Use any value of Material UI TextField API.
40872
+ *
40873
+ * `TextFieldProps={{helperText:"text", onChange: {textFieldTargetValue}, inputProps:{className: classes.textField}}}`
40874
+ *
40875
+ */
40876
+ TextFieldProps: PropTypes__default.object,
40877
+ /**
40878
+ * To show or hide the no options message on empty texfield value
40879
+ */
40880
+ showNoOptionsWithEmptyTextField: PropTypes__default.bool,
40881
+ /**
40882
+ * To display error message on loading options
40883
+ */
40884
+ errorLoadingOptions: PropTypes__default.string,
40885
+ /** To customize the components of select */
40886
+ components: PropTypes__default.object,
40887
+ /** Show label help */
40888
+ showLabelHelp: PropTypes__default.bool,
40889
+ /** 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}} */
40890
+ InputLabelHelpProps: PropTypes__default.object
40891
+ };
40892
+
40893
+ UIconPicker.defaultProps = {
40894
+ isMulti: false,
40895
+ placeholder: 'Select...',
40896
+ variant: 'outlined',
40897
+ showNoOptionsWithEmptyTextField: true,
40898
+ showLabelHelp: false,
40899
+ InputLabelHelpProps: {}
40900
+ };
40901
+
40818
40902
  function toInteger(dirtyNumber) {
40819
40903
  if (dirtyNumber === null || dirtyNumber === true || dirtyNumber === false) {
40820
40904
  return NaN;
@@ -53585,32 +53669,22 @@ UPositiveInteger.propTypes = {
53585
53669
  withRequiredValidator: PropTypes__default.bool
53586
53670
  };
53587
53671
 
53588
- var useStyles$n = makeStyles$1(function (theme) {
53589
- return {
53590
- startAdornmentContainer: {
53591
- marginRight: theme.spacing(0.5)
53592
- }
53593
- };
53594
- });
53595
-
53596
53672
  function UCurrencyField(_ref) {
53597
53673
  var inputPrefix = _ref.inputPrefix,
53598
53674
  decimalScale = _ref.decimalScale,
53599
- InputProps = _ref.InputProps,
53675
+ fixedDecimalScale = _ref.fixedDecimalScale,
53676
+ textAlign = _ref.textAlign,
53600
53677
  inputProps = _ref.inputProps,
53601
- props = objectWithoutProperties(_ref, ['inputPrefix', 'decimalScale', 'InputProps', 'inputProps']);
53678
+ props = objectWithoutProperties(_ref, ['inputPrefix', 'decimalScale', 'fixedDecimalScale', 'textAlign', 'inputProps']);
53602
53679
 
53603
- var classes = useStyles$n(props);
53604
53680
  return React__default.createElement(UPositiveInteger, _extends$1({
53605
53681
  variant: 'outlined',
53606
- InputProps: _extends$1({
53607
- startAdornment: React__default.createElement(
53608
- 'span',
53609
- { className: classes.startAdornmentContainer },
53610
- inputPrefix
53611
- )
53612
- }, InputProps),
53613
- inputProps: _extends$1({ decimalScale: decimalScale }, inputProps)
53682
+ inputProps: _extends$1({
53683
+ decimalScale: decimalScale,
53684
+ fixedDecimalScale: fixedDecimalScale,
53685
+ prefix: inputPrefix,
53686
+ style: { textAlign: textAlign }
53687
+ }, inputProps)
53614
53688
  }, props));
53615
53689
  }
53616
53690
 
@@ -53642,12 +53716,18 @@ UCurrencyField.propTypes = {
53642
53716
  /** To make the content readOnly */
53643
53717
  readOnly: PropTypes__default.bool,
53644
53718
  /** Name of input. */
53645
- name: PropTypes__default.string
53719
+ name: PropTypes__default.string,
53720
+ /** Input text align */
53721
+ textAlign: PropTypes__default.string,
53722
+ // If true it add 0s to match given decimalScale.
53723
+ fixedDecimalScale: PropTypes__default.bool
53646
53724
  };
53647
53725
 
53648
53726
  UCurrencyField.defaultProps = {
53649
- inputPrefix: '$',
53650
- decimalScale: 2
53727
+ inputPrefix: '$ ',
53728
+ decimalScale: 2,
53729
+ fixedDecimalScale: true,
53730
+ textAlign: 'right'
53651
53731
  };
53652
53732
 
53653
53733
  function ActiveFormPositiveInteger(_ref) {
@@ -53698,32 +53778,22 @@ ActiveFormPositiveInteger.propTypes = {
53698
53778
  withRequiredValidator: PropTypes__default.bool
53699
53779
  };
53700
53780
 
53701
- var useStyles$o = makeStyles$1(function (theme) {
53702
- return {
53703
- startAdornmentContainer: {
53704
- marginRight: theme.spacing(0.5)
53705
- }
53706
- };
53707
- });
53708
-
53709
53781
  function ActiveCurrencyField(_ref) {
53710
53782
  var inputPrefix = _ref.inputPrefix,
53711
53783
  decimalScale = _ref.decimalScale,
53712
- InputProps = _ref.InputProps,
53784
+ fixedDecimalScale = _ref.fixedDecimalScale,
53785
+ textAlign = _ref.textAlign,
53713
53786
  inputProps = _ref.inputProps,
53714
- props = objectWithoutProperties(_ref, ['inputPrefix', 'decimalScale', 'InputProps', 'inputProps']);
53787
+ props = objectWithoutProperties(_ref, ['inputPrefix', 'decimalScale', 'fixedDecimalScale', 'textAlign', 'inputProps']);
53715
53788
 
53716
- var classes = useStyles$o(props);
53717
53789
  return React__default.createElement(ActiveFormPositiveInteger, _extends$1({
53718
53790
  variant: 'outlined',
53719
- InputProps: _extends$1({
53720
- startAdornment: React__default.createElement(
53721
- 'span',
53722
- { className: classes.startAdornmentContainer },
53723
- inputPrefix
53724
- )
53725
- }, InputProps),
53726
- inputProps: _extends$1({ decimalScale: decimalScale }, inputProps)
53791
+ inputProps: _extends$1({
53792
+ decimalScale: decimalScale,
53793
+ fixedDecimalScale: fixedDecimalScale,
53794
+ prefix: inputPrefix,
53795
+ style: { textAlign: textAlign }
53796
+ }, inputProps)
53727
53797
  }, props));
53728
53798
  }
53729
53799
 
@@ -53765,12 +53835,16 @@ ActiveCurrencyField.propTypes = {
53765
53835
  /** It triggers after each validation.It will return true or false. */
53766
53836
  validatorListener: PropTypes__default.func,
53767
53837
  /** Allow to use required validator in any validation trigger, not only form submit. */
53768
- withRequiredValidator: PropTypes__default.bool
53838
+ withRequiredValidator: PropTypes__default.bool,
53839
+ /** Input text align */
53840
+ textAlign: PropTypes__default.string
53769
53841
  };
53770
53842
 
53771
53843
  ActiveCurrencyField.defaultProps = {
53772
- inputPrefix: '$',
53773
- decimalScale: 2
53844
+ inputPrefix: '$ ',
53845
+ decimalScale: 2,
53846
+ fixedDecimalScale: true,
53847
+ textAlign: 'right'
53774
53848
  };
53775
53849
 
53776
53850
  var DeleteOutlined = createCommonjsModule(function (module, exports) {
@@ -53797,7 +53871,7 @@ exports.default = _default;
53797
53871
 
53798
53872
  var DeleteOutlinedIcon = unwrapExports(DeleteOutlined);
53799
53873
 
53800
- var useStyles$p = makeStyles$1(function (theme) {
53874
+ var useStyles$n = makeStyles$1(function (theme) {
53801
53875
  return {
53802
53876
  menuDelete: {
53803
53877
  width: '500px'
@@ -53817,7 +53891,7 @@ var useStyles$p = makeStyles$1(function (theme) {
53817
53891
  * It has two varint icon/menu item
53818
53892
  */
53819
53893
  function UConfirmationButton(props) {
53820
- var classes = useStyles$p();
53894
+ var classes = useStyles$n();
53821
53895
  var onConfirm = props.onConfirm,
53822
53896
  id = props.id,
53823
53897
  buttonText = props.buttonText,
@@ -53932,7 +54006,7 @@ UConfirmationButton.defaultProps = {
53932
54006
  /**
53933
54007
  * displays radio buttons
53934
54008
  */
53935
- var useStyles$q = makeStyles$1(function (theme) {
54009
+ var useStyles$o = makeStyles$1(function (theme) {
53936
54010
  return {
53937
54011
  padding: {
53938
54012
  paddingLeft: theme.spacing(3)
@@ -53953,7 +54027,7 @@ function URadioButtons(_ref) {
53953
54027
  optionLabels = _ref.optionLabels,
53954
54028
  optionValues = _ref.optionValues;
53955
54029
 
53956
- var classes = useStyles$q();
54030
+ var classes = useStyles$o();
53957
54031
  var handleOnChange = function handleOnChange(event) {
53958
54032
  onChange && onChange(event);
53959
54033
  };
@@ -54057,7 +54131,7 @@ exports.default = _default;
54057
54131
 
54058
54132
  var DoneIcon = unwrapExports(Done);
54059
54133
 
54060
- var useStyles$r = makeStyles$1(function (theme) {
54134
+ var useStyles$p = makeStyles$1(function (theme) {
54061
54135
  return {
54062
54136
  root: {
54063
54137
  position: 'fixed',
@@ -54089,7 +54163,7 @@ function UAsyncBadge(_ref) {
54089
54163
  visible = _ref.visible,
54090
54164
  onReset = _ref.onReset;
54091
54165
 
54092
- var classes = useStyles$r();
54166
+ var classes = useStyles$p();
54093
54167
 
54094
54168
  /** If variant is success or error, after few seconds, it will set asyncResponse visible to false */
54095
54169
  React.useEffect(function () {
@@ -54128,7 +54202,7 @@ UAsyncBadge.propTypes = {
54128
54202
  onReset: PropTypes__default.func
54129
54203
  };
54130
54204
 
54131
- var useStyles$s = makeStyles$1(function () {
54205
+ var useStyles$q = makeStyles$1(function () {
54132
54206
  return {
54133
54207
  pageLoadingProgress: {
54134
54208
  height: '50vh',
@@ -54143,7 +54217,7 @@ var useStyles$s = makeStyles$1(function () {
54143
54217
  * 2. Display text message
54144
54218
  */
54145
54219
  function UPageLoadingProgress(props) {
54146
- var classes = useStyles$s();
54220
+ var classes = useStyles$q();
54147
54221
  var text = props.text;
54148
54222
 
54149
54223
  return React__default.createElement(
@@ -56526,7 +56600,7 @@ UErrorAlert.defaultProps = {
56526
56600
 
56527
56601
  var filter = createFilterOptions();
56528
56602
 
56529
- var useStyles$t = makeStyles$1(function (theme) {
56603
+ var useStyles$r = makeStyles$1(function (theme) {
56530
56604
  return {
56531
56605
  controlStyle: {
56532
56606
  marginTop: theme.spacing(2),
@@ -56552,9 +56626,12 @@ function UAutoComplete(_ref) {
56552
56626
  maxLength = _ref.maxLength,
56553
56627
  usedItemIds = _ref.usedItemIds,
56554
56628
  allowContextSpecific = _ref.allowContextSpecific,
56629
+ counter = _ref.counter,
56630
+ placeholder = _ref.placeholder,
56631
+ InputLabelProps = _ref.InputLabelProps,
56555
56632
  props = _ref.props;
56556
56633
 
56557
- var classes = useStyles$t();
56634
+ var classes = useStyles$r();
56558
56635
  //const dispatch = useDispatch()
56559
56636
 
56560
56637
  var _useState = React.useState(value || null),
@@ -56612,16 +56689,19 @@ function UAutoComplete(_ref) {
56612
56689
  var controlOptions = options && options.length > 0 ? options.filter(function (opt) {
56613
56690
  return !usedItemIds.includes(opt.id);
56614
56691
  }) : [];
56615
-
56616
56692
  return React__default.createElement(
56617
56693
  React__default.Fragment,
56618
56694
  null,
56619
56695
  readOnly ? React__default.createElement(ActiveFormTextField, {
56620
56696
  multiline: true,
56621
- label: label + '*',
56697
+ label: label,
56698
+ InputLabelProps: _extends$1({}, InputLabelProps, {
56699
+ required: isRequired
56700
+ }),
56622
56701
  variant: 'outlined',
56623
56702
  fullWidth: true,
56624
56703
  readOnly: readOnly,
56704
+ placeholder: placeholder,
56625
56705
  value: selectedValue && selectedValue.text
56626
56706
  }) : React__default.createElement(Autocomplete$1, {
56627
56707
  value: selectedValue,
@@ -56652,7 +56732,7 @@ function UAutoComplete(_ref) {
56652
56732
  renderInput: function renderInput(params) {
56653
56733
  return React__default.createElement(ActiveFormTextField, _extends$1({}, params, {
56654
56734
  multiline: true,
56655
- label: '' + label + (isRequired ? '*' : ''),
56735
+ label: label,
56656
56736
  variant: 'outlined',
56657
56737
  value: selectedValue && selectedValue.text || '',
56658
56738
  validators: isRequired ? ['required', 'trim'] : ['trim'],
@@ -56661,8 +56741,13 @@ function UAutoComplete(_ref) {
56661
56741
  minLength: minLength,
56662
56742
  maxLength: maxLength
56663
56743
  }),
56744
+ InputLabelProps: _extends$1({}, InputLabelProps, {
56745
+ required: isRequired
56746
+ }),
56664
56747
  maxLength: maxLength,
56665
- counter: true
56748
+ counter: counter,
56749
+ placeholder: placeholder,
56750
+ readOnly: readOnly
56666
56751
  }));
56667
56752
  }
56668
56753
  })
@@ -56693,17 +56778,24 @@ UAutoComplete.propTypes = {
56693
56778
  /** can create context specific item or not */
56694
56779
  allowContextSpecific: PropTypes__default.bool,
56695
56780
  /** used item id's from the options */
56696
- usedItemIds: PropTypes__default.array
56781
+ usedItemIds: PropTypes__default.array,
56782
+ /** To enable character counter */
56783
+ counter: PropTypes__default.bool,
56784
+ /** placeholder text*/
56785
+ placeholder: PropTypes__default.string,
56786
+ /** Label props applied to input field*/
56787
+ InputLabelProps: PropTypes__default.object
56697
56788
  };
56698
56789
 
56699
56790
  UAutoComplete.defaultProps = {
56700
56791
  allowContextSpecific: false,
56792
+ counter: false,
56701
56793
  usedItemIds: []
56702
56794
  };
56703
56795
 
56704
56796
  /* eslint-disable no-nested-ternary */
56705
56797
 
56706
- var useStyles$u = makeStyles$1(function (theme) {
56798
+ var useStyles$s = makeStyles$1(function (theme) {
56707
56799
  var _ref;
56708
56800
 
56709
56801
  return _ref = {
@@ -56735,7 +56827,7 @@ var useStyles$u = makeStyles$1(function (theme) {
56735
56827
  * Breadcrumbs is a component to implement current user path of the application
56736
56828
  */
56737
56829
  function UBreadcrumbs(props) {
56738
- var classes = useStyles$u();
56830
+ var classes = useStyles$s();
56739
56831
  var breadcrumbLinks = props.breadcrumbLinks;
56740
56832
 
56741
56833
 
@@ -56812,7 +56904,7 @@ UInfiniteScroll.propTypes = {
56812
56904
  onEndOfScroll: PropTypes__default.func
56813
56905
  };
56814
56906
 
56815
- var useStyles$v = makeStyles$1(function (theme) {
56907
+ var useStyles$t = makeStyles$1(function (theme) {
56816
56908
  return {
56817
56909
  small: {
56818
56910
  width: theme.spacing(4),
@@ -56857,7 +56949,7 @@ function UAvatarImage(_ref) {
56857
56949
  zIndexValue = _ref.zIndexValue,
56858
56950
  loadPhoto = _ref.loadPhoto;
56859
56951
 
56860
- var classes = useStyles$v();
56952
+ var classes = useStyles$t();
56861
56953
 
56862
56954
  var _useState = React.useState(''),
56863
56955
  _useState2 = slicedToArray(_useState, 2),
@@ -57289,7 +57381,7 @@ exports.default = _default;
57289
57381
 
57290
57382
  var CloseIcon$1 = unwrapExports(Close);
57291
57383
 
57292
- var useStyles$w = makeStyles$1(function (theme) {
57384
+ var useStyles$u = makeStyles$1(function (theme) {
57293
57385
  return {
57294
57386
  root: {
57295
57387
  width: '100%',
@@ -57329,7 +57421,7 @@ function USearchBox(_ref) {
57329
57421
  searchValue = _useState2[0],
57330
57422
  setSearch = _useState2[1];
57331
57423
 
57332
- var classes = useStyles$w();
57424
+ var classes = useStyles$u();
57333
57425
 
57334
57426
  var handleChange = function handleChange(event) {
57335
57427
  setSearch(event.target.value);
@@ -57430,7 +57522,7 @@ var styles$16 = {
57430
57522
  }
57431
57523
  };
57432
57524
 
57433
- var useStyles$x = makeStyles$1(function (theme) {
57525
+ var useStyles$v = makeStyles$1(function (theme) {
57434
57526
  return {
57435
57527
  textField: {
57436
57528
  marginTop: theme.spacing(0.25),
@@ -57473,7 +57565,7 @@ var useStyles$x = makeStyles$1(function (theme) {
57473
57565
  * ActiveKeyboardDatePicker is a customized [Material Ui KeyboardDatePicker]('https://material-ui-pickers.dev/api/KeyboardDatePicker') for more details
57474
57566
  */
57475
57567
  function ActiveKeyboardDatePicker(props) {
57476
- var classes = useStyles$x(props);
57568
+ var classes = useStyles$v(props);
57477
57569
  var autoOk = props.autoOk,
57478
57570
  variant = props.variant,
57479
57571
  inputVariant = props.inputVariant,
@@ -57592,7 +57684,7 @@ var styles$17 = {
57592
57684
  }
57593
57685
  };
57594
57686
 
57595
- var useStyles$y = makeStyles$1(function (theme) {
57687
+ var useStyles$w = makeStyles$1(function (theme) {
57596
57688
  return {
57597
57689
  textField: {
57598
57690
  marginTop: theme.spacing(0.25),
@@ -57631,7 +57723,7 @@ var useStyles$y = makeStyles$1(function (theme) {
57631
57723
  * Please have look at [Material Ui Date Picker]('https://material-ui-pickers.dev/api/DatePicker') for more details
57632
57724
  */
57633
57725
  function ActiveDatePicker(props) {
57634
- var classes = useStyles$y(props);
57726
+ var classes = useStyles$w(props);
57635
57727
  var autoOk = props.autoOk,
57636
57728
  variant = props.variant,
57637
57729
  inputVariant = props.inputVariant,
@@ -57725,7 +57817,7 @@ var styles$18 = {
57725
57817
  }
57726
57818
  };
57727
57819
 
57728
- var useStyles$z = makeStyles$1(function (theme) {
57820
+ var useStyles$x = makeStyles$1(function (theme) {
57729
57821
  return {
57730
57822
  textField: {
57731
57823
  marginTop: theme.spacing(0.25),
@@ -57764,7 +57856,7 @@ var useStyles$z = makeStyles$1(function (theme) {
57764
57856
  * Please have look at [Material Ui TimePicker]('https://material-ui-pickers.dev/api/TimePicker') for more details
57765
57857
  */
57766
57858
  function ActiveTimePicker(props) {
57767
- var classes = useStyles$z(props);
57859
+ var classes = useStyles$x(props);
57768
57860
  var inputVariant = props.inputVariant,
57769
57861
  readOnly = props.readOnly,
57770
57862
  interactiveMode = props.interactiveMode,
@@ -57849,7 +57941,7 @@ var styles$19 = {
57849
57941
  }
57850
57942
  };
57851
57943
 
57852
- var useStyles$A = makeStyles$1(function (theme) {
57944
+ var useStyles$y = makeStyles$1(function (theme) {
57853
57945
  return {
57854
57946
  textField: {
57855
57947
  marginTop: theme.spacing(0.25),
@@ -57892,7 +57984,7 @@ var useStyles$A = makeStyles$1(function (theme) {
57892
57984
  * ActiveKeyboardTimePicker is customized [ Material Ui KeyboardTimePicker](https://material-ui-pickers.dev/api/KeyboardTimePicker)
57893
57985
  */
57894
57986
  function ActiveKeyboardTimePicker(props) {
57895
- var classes = useStyles$A(props);
57987
+ var classes = useStyles$y(props);
57896
57988
  var inputVariant = props.inputVariant,
57897
57989
  readOnly = props.readOnly,
57898
57990
  interactiveMode = props.interactiveMode,
@@ -57994,6 +58086,224 @@ ActiveKeyboardTimePicker.defaultProps = {
57994
58086
  variant: 'inline'
57995
58087
  };
57996
58088
 
58089
+ var filter$1 = createFilterOptions();
58090
+
58091
+ var useStyles$z = makeStyles$1(function (theme) {
58092
+ return {
58093
+ root: {
58094
+ marginTop: theme.spacing(2),
58095
+ width: '100%',
58096
+ '& .UPopupIndicator': {
58097
+ visibility: 'hidden'
58098
+ },
58099
+ '&:hover': {
58100
+ '& .UPopupIndicator': {
58101
+ visibility: 'visible'
58102
+ }
58103
+ }
58104
+ },
58105
+ focused: {
58106
+ '& .UPopupIndicator': {
58107
+ visibility: 'visible'
58108
+ }
58109
+ }
58110
+ };
58111
+ });
58112
+ /**
58113
+ * ActiveAutoComplete is an editable dropdown component with interactive.
58114
+ * User can enter the text in order to find the value from the list of values
58115
+ * User can also add new value to the list as well.
58116
+ */
58117
+ function ActiveAutoComplete(_ref) {
58118
+ var value = _ref.value,
58119
+ label = _ref.label,
58120
+ onChange = _ref.onChange,
58121
+ isRequired = _ref.isRequired,
58122
+ onBlur = _ref.onBlur,
58123
+ name = _ref.name,
58124
+ options = _ref.options,
58125
+ readOnly = _ref.readOnly,
58126
+ minLength = _ref.minLength,
58127
+ maxLength = _ref.maxLength,
58128
+ usedItemIds = _ref.usedItemIds,
58129
+ allowContextSpecific = _ref.allowContextSpecific,
58130
+ interactiveMode = _ref.interactiveMode,
58131
+ counter = _ref.counter,
58132
+ placeholder = _ref.placeholder,
58133
+ InputLabelProps = _ref.InputLabelProps,
58134
+ props = _ref.props;
58135
+
58136
+ var classes = useStyles$z();
58137
+ //const dispatch = useDispatch()
58138
+
58139
+ var _useState = React.useState(value || null),
58140
+ _useState2 = slicedToArray(_useState, 2),
58141
+ selectedValue = _useState2[0],
58142
+ setSelectedValue = _useState2[1]; // for initialization: avoid the control to be a uncontrolled component with 'undefined'
58143
+
58144
+ var handleChange = function handleChange(event, newValue) {
58145
+ // Create a new value from the user input
58146
+ if (newValue && newValue.inputValue) {
58147
+ setSelectedValue({
58148
+ text: newValue.inputValue
58149
+ });
58150
+ onChange({
58151
+ text: newValue.inputValue
58152
+ });
58153
+ return;
58154
+ }
58155
+ setSelectedValue(newValue);
58156
+ onChange && onChange(newValue, name);
58157
+ };
58158
+
58159
+ var handleFilter = function handleFilter(options, params) {
58160
+ var filtered = filter$1(options, params);
58161
+ var labelForMessage = label && label.toLowerCase();
58162
+ // Suggest the creation of a new value
58163
+ if (params.inputValue !== '' && allowContextSpecific) {
58164
+ filtered.push({
58165
+ inputValue: params.inputValue,
58166
+ text: 'Use context-specific ' + (labelForMessage ? labelForMessage : '') + ' "' + params.inputValue + '"'
58167
+ });
58168
+ }
58169
+ return filtered;
58170
+ };
58171
+
58172
+ var handleGetOption = function handleGetOption(option) {
58173
+ // Value selected with enter, right from the input
58174
+ if (typeof option === 'string') {
58175
+ return option;
58176
+ }
58177
+ // Add "new" option created dynamically
58178
+ if (option.inputValue) {
58179
+ return option.inputValue;
58180
+ }
58181
+ // Regular option
58182
+ return option.text || '';
58183
+ };
58184
+
58185
+ var handleOnBlur = function handleOnBlur(e) {
58186
+ if (selectedValue && selectedValue.text && selectedValue.text.trim() !== '') {
58187
+ onBlur && onBlur(e, name);
58188
+ }
58189
+ };
58190
+
58191
+ var controlOptions = options && options.length > 0 ? options.filter(function (opt) {
58192
+ return !usedItemIds.includes(opt.id);
58193
+ }) : [];
58194
+ return React__default.createElement(
58195
+ React__default.Fragment,
58196
+ null,
58197
+ !interactiveMode && readOnly ? React__default.createElement(ActiveFormTextField, {
58198
+ multiline: true,
58199
+ label: label,
58200
+ InputLabelProps: _extends$1({}, InputLabelProps, {
58201
+ required: isRequired
58202
+ }),
58203
+ variant: 'outlined',
58204
+ fullWidth: true,
58205
+ readOnly: readOnly,
58206
+ placeholder: placeholder,
58207
+ value: selectedValue && selectedValue.text
58208
+ }) : React__default.createElement(Autocomplete$1, {
58209
+ value: selectedValue,
58210
+ getOptionSelected: function getOptionSelected(option) {
58211
+ return option.id === selectedValue.id;
58212
+ },
58213
+ onChange: function onChange(event, newValue) {
58214
+ return handleChange(event, newValue);
58215
+ },
58216
+ filterOptions: function filterOptions(options, params) {
58217
+ return handleFilter(options, params);
58218
+ },
58219
+ id: 'target-input',
58220
+ name: name,
58221
+ selectOnFocus: true,
58222
+ clearOnBlur: true,
58223
+ handleHomeEndKeys: true,
58224
+ options: controlOptions,
58225
+ getOptionLabel: function getOptionLabel(option) {
58226
+ return handleGetOption(option);
58227
+ },
58228
+ renderOption: function renderOption(option) {
58229
+ return option.text;
58230
+ },
58231
+ onBlur: handleOnBlur,
58232
+ classes: {
58233
+ root: classes.root,
58234
+ focused: classes.focused,
58235
+ popupIndicator: 'UPopupIndicator'
58236
+ },
58237
+ freeSolo: allowContextSpecific,
58238
+ renderInput: function renderInput(params) {
58239
+ return React__default.createElement(ActiveFormTextField, _extends$1({}, params, {
58240
+ multiline: true,
58241
+ label: label,
58242
+ variant: 'outlined',
58243
+ value: selectedValue && selectedValue.text || '',
58244
+ validators: isRequired ? ['required', 'trim'] : ['trim'],
58245
+ fullWidth: true,
58246
+ inputProps: _extends$1({}, params.inputProps, {
58247
+ minLength: minLength,
58248
+ maxLength: maxLength
58249
+ }),
58250
+ InputLabelProps: _extends$1({}, InputLabelProps, {
58251
+ required: isRequired
58252
+ }),
58253
+ maxLength: maxLength,
58254
+ counter: counter,
58255
+ interactiveMode: interactiveMode,
58256
+ placeholder: placeholder,
58257
+ readOnly: readOnly
58258
+ }));
58259
+ }
58260
+ })
58261
+ );
58262
+ }
58263
+
58264
+ ActiveAutoComplete.propTypes = {
58265
+ /** selected value of the dropdown */
58266
+ value: PropTypes__default.object,
58267
+ /** label */
58268
+ label: PropTypes__default.string,
58269
+ /** options to display */
58270
+ options: PropTypes__default.array,
58271
+ /** dropdown on change event */
58272
+ onChange: PropTypes__default.func,
58273
+ /** enable required validator */
58274
+ isRequired: PropTypes__default.bool,
58275
+ /** enable required error in dropdown */
58276
+ hasError: PropTypes__default.bool,
58277
+ /** onBlur event for dropdown */
58278
+ onBlur: PropTypes__default.func,
58279
+ /** name of the dropdown */
58280
+ name: PropTypes__default.string,
58281
+ /** max length text */
58282
+ maxLength: PropTypes__default.number,
58283
+ /** min length text */
58284
+ minLength: PropTypes__default.number,
58285
+ /** can create context specific item or not */
58286
+ allowContextSpecific: PropTypes__default.bool,
58287
+ /** used item id's from the options */
58288
+ usedItemIds: PropTypes__default.array,
58289
+ /** Change to write mode by hiding text field border and displays border on hover*/
58290
+ interactiveMode: PropTypes__default.bool,
58291
+ /** To enable character counter */
58292
+ counter: PropTypes__default.bool,
58293
+ /** placeholder text*/
58294
+ placeholder: PropTypes__default.string,
58295
+ /** Label props applied to input field*/
58296
+ InputLabelProps: PropTypes__default.object
58297
+ };
58298
+
58299
+ ActiveAutoComplete.defaultProps = {
58300
+ allowContextSpecific: false,
58301
+ interactiveMode: false,
58302
+ counter: false,
58303
+ usedItemIds: []
58304
+ };
58305
+
58306
+ exports.ActiveAutoComplete = ActiveAutoComplete;
57997
58307
  exports.ActiveCurrencyField = ActiveCurrencyField;
57998
58308
  exports.ActiveDatePicker = ActiveDatePicker;
57999
58309
  exports.ActiveFormCoordinateField = ActiveFormCoordinateField;
@@ -58020,6 +58330,7 @@ exports.UHeader = UHeader;
58020
58330
  exports.UHeaderLeftMenu = UHeaderLeftMenu;
58021
58331
  exports.UHeaderMainMenu = UHeaderMainMenu;
58022
58332
  exports.UHeaderRightButtons = UHeaderRightButtons;
58333
+ exports.UIconPicker = UIconPicker;
58023
58334
  exports.UInfiniteScroll = UInfiniteScroll;
58024
58335
  exports.UKeyboardDatePicker = UKeyboardDatePicker;
58025
58336
  exports.UKeyboardDateTimePicker = UKeyboardDateTimePicker;