@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/prod.js CHANGED
@@ -32458,13 +32458,13 @@ var useStyles$6 = makeStyles$1(function (theme) {
32458
32458
  display: 'inline-flex',
32459
32459
  marginRight: theme.spacing(1),
32460
32460
  '& .MuiAvatar-root': {
32461
- height: 24,
32462
- width: 24
32461
+ height: 32,
32462
+ width: 32
32463
32463
  }
32464
32464
  },
32465
32465
  avatar: {
32466
- height: 24,
32467
- width: 24,
32466
+ height: 32,
32467
+ width: 32,
32468
32468
  marginRight: theme.spacing(1)
32469
32469
  },
32470
32470
  optionLabel: {
@@ -33936,7 +33936,8 @@ function PositiveNumberFormat(_ref) {
33936
33936
  isNumericString = _ref.isNumericString,
33937
33937
  allowNegative = _ref.allowNegative,
33938
33938
  decimalScale = _ref.decimalScale,
33939
- other = objectWithoutProperties(_ref, ['inputRef', 'name', 'onChange', 'thousandSeparator', 'isNumericString', 'allowNegative', 'decimalScale']);
33939
+ fixedDecimalScale = _ref.fixedDecimalScale,
33940
+ other = objectWithoutProperties(_ref, ['inputRef', 'name', 'onChange', 'thousandSeparator', 'isNumericString', 'allowNegative', 'decimalScale', 'fixedDecimalScale']);
33940
33941
 
33941
33942
  return React__default.createElement(NumberFormat, _extends$1({}, other, {
33942
33943
  getInputRef: inputRef,
@@ -33951,7 +33952,8 @@ function PositiveNumberFormat(_ref) {
33951
33952
  thousandSeparator: thousandSeparator,
33952
33953
  isNumericString: isNumericString,
33953
33954
  allowNegative: allowNegative,
33954
- decimalScale: decimalScale
33955
+ decimalScale: decimalScale,
33956
+ fixedDecimalScale: fixedDecimalScale
33955
33957
  }));
33956
33958
  }
33957
33959
 
@@ -33967,14 +33969,17 @@ PositiveNumberFormat.propTypes = {
33967
33969
  // Is allow negative numbers
33968
33970
  allowNegative: PropTypes__default.bool,
33969
33971
  // No of decimal digits
33970
- decimalScale: PropTypes__default.number
33972
+ decimalScale: PropTypes__default.number,
33973
+ //If true it add 0s to match given decimalScale.
33974
+ fixedDecimalScale: PropTypes__default.bool
33971
33975
  };
33972
33976
 
33973
33977
  PositiveNumberFormat.defaultProps = {
33974
33978
  thousandSeparator: true,
33975
33979
  isNumericString: false,
33976
33980
  allowNegative: false,
33977
- decimalScale: 0
33981
+ decimalScale: 0,
33982
+ fixedDecimalScale: false
33978
33983
  };
33979
33984
 
33980
33985
  var HelpOutline = createCommonjsModule(function (module, exports) {
@@ -34663,6 +34668,85 @@ UPeoplePicker.defaultProps = {
34663
34668
  InputLabelHelpProps: {}
34664
34669
  };
34665
34670
 
34671
+ /**
34672
+ * UIconPicker is a control for selecting icon from a list. Has the features below:
34673
+ *
34674
+ * * Select a single icon from a list.
34675
+ * * Select multiple icon from a list.
34676
+ * * Autocomplete.
34677
+ * * Clear current selection.
34678
+ *
34679
+ */
34680
+ function UIconPicker(props) {
34681
+ return React__default.createElement(USelectPicker, _extends$1({}, props, { hideAvatar: false }));
34682
+ }
34683
+
34684
+ UIconPicker.propTypes = {
34685
+ /** Text to display when nothing is selected. */
34686
+ placeholder: PropTypes__default.string,
34687
+ /** Enables the multiple select. Default is false. */
34688
+ isMulti: PropTypes__default.bool,
34689
+ /** Label of the picker. */
34690
+ label: PropTypes__default.string,
34691
+ /** Variant of TextField to use. Default is outlined.*/
34692
+ variant: PropTypes__default.oneOf(['outlined', 'standard', 'filled']),
34693
+ /** Id to assign to the input element */
34694
+ inputId: PropTypes__default.string,
34695
+ /** Callback fired when the value is changed.
34696
+ *
34697
+ * `event`:
34698
+ * The event source of the callback. You can pull out the new value by accessing "event.target.value".
34699
+ */
34700
+ onChange: PropTypes__default.func,
34701
+ /** Array of to display select on the dropdown.
34702
+ * Each option is an object with the following attributes:
34703
+ *
34704
+ * ```
34705
+ * {
34706
+ * value: 1,
34707
+ * label: 'Sample 1', //First line, typically the name
34708
+ * image: 'svg', // image svg string
34709
+ * avatar: ( //Avatar object to display.
34710
+ * <Avatar
34711
+ * src={'blob:http://...'} // SVG Icon
34712
+ * />
34713
+ * ),
34714
+ * }
34715
+ *```
34716
+ *
34717
+ */
34718
+ options: PropTypes__default.array,
34719
+ /** Props passed to the TextField used in the picker. Use any value of Material UI TextField API.
34720
+ *
34721
+ * `TextFieldProps={{helperText:"text", onChange: {textFieldTargetValue}, inputProps:{className: classes.textField}}}`
34722
+ *
34723
+ */
34724
+ TextFieldProps: PropTypes__default.object,
34725
+ /**
34726
+ * To show or hide the no options message on empty texfield value
34727
+ */
34728
+ showNoOptionsWithEmptyTextField: PropTypes__default.bool,
34729
+ /**
34730
+ * To display error message on loading options
34731
+ */
34732
+ errorLoadingOptions: PropTypes__default.string,
34733
+ /** To customize the components of select */
34734
+ components: PropTypes__default.object,
34735
+ /** Show label help */
34736
+ showLabelHelp: PropTypes__default.bool,
34737
+ /** 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}} */
34738
+ InputLabelHelpProps: PropTypes__default.object
34739
+ };
34740
+
34741
+ UIconPicker.defaultProps = {
34742
+ isMulti: false,
34743
+ placeholder: 'Select...',
34744
+ variant: 'outlined',
34745
+ showNoOptionsWithEmptyTextField: true,
34746
+ showLabelHelp: false,
34747
+ InputLabelHelpProps: {}
34748
+ };
34749
+
34666
34750
  function toInteger(dirtyNumber) {
34667
34751
  if (dirtyNumber === null || dirtyNumber === true || dirtyNumber === false) {
34668
34752
  return NaN;
@@ -46974,32 +47058,22 @@ UPositiveInteger.propTypes = {
46974
47058
  withRequiredValidator: PropTypes__default.bool
46975
47059
  };
46976
47060
 
46977
- var useStyles$n = makeStyles$1(function (theme) {
46978
- return {
46979
- startAdornmentContainer: {
46980
- marginRight: theme.spacing(0.5)
46981
- }
46982
- };
46983
- });
46984
-
46985
47061
  function UCurrencyField(_ref) {
46986
47062
  var inputPrefix = _ref.inputPrefix,
46987
47063
  decimalScale = _ref.decimalScale,
46988
- InputProps = _ref.InputProps,
47064
+ fixedDecimalScale = _ref.fixedDecimalScale,
47065
+ textAlign = _ref.textAlign,
46989
47066
  inputProps = _ref.inputProps,
46990
- props = objectWithoutProperties(_ref, ['inputPrefix', 'decimalScale', 'InputProps', 'inputProps']);
47067
+ props = objectWithoutProperties(_ref, ['inputPrefix', 'decimalScale', 'fixedDecimalScale', 'textAlign', 'inputProps']);
46991
47068
 
46992
- var classes = useStyles$n(props);
46993
47069
  return React__default.createElement(UPositiveInteger, _extends$1({
46994
47070
  variant: 'outlined',
46995
- InputProps: _extends$1({
46996
- startAdornment: React__default.createElement(
46997
- 'span',
46998
- { className: classes.startAdornmentContainer },
46999
- inputPrefix
47000
- )
47001
- }, InputProps),
47002
- inputProps: _extends$1({ decimalScale: decimalScale }, inputProps)
47071
+ inputProps: _extends$1({
47072
+ decimalScale: decimalScale,
47073
+ fixedDecimalScale: fixedDecimalScale,
47074
+ prefix: inputPrefix,
47075
+ style: { textAlign: textAlign }
47076
+ }, inputProps)
47003
47077
  }, props));
47004
47078
  }
47005
47079
 
@@ -47031,12 +47105,18 @@ UCurrencyField.propTypes = {
47031
47105
  /** To make the content readOnly */
47032
47106
  readOnly: PropTypes__default.bool,
47033
47107
  /** Name of input. */
47034
- name: PropTypes__default.string
47108
+ name: PropTypes__default.string,
47109
+ /** Input text align */
47110
+ textAlign: PropTypes__default.string,
47111
+ // If true it add 0s to match given decimalScale.
47112
+ fixedDecimalScale: PropTypes__default.bool
47035
47113
  };
47036
47114
 
47037
47115
  UCurrencyField.defaultProps = {
47038
- inputPrefix: '$',
47039
- decimalScale: 2
47116
+ inputPrefix: '$ ',
47117
+ decimalScale: 2,
47118
+ fixedDecimalScale: true,
47119
+ textAlign: 'right'
47040
47120
  };
47041
47121
 
47042
47122
  function ActiveFormPositiveInteger(_ref) {
@@ -47087,32 +47167,22 @@ ActiveFormPositiveInteger.propTypes = {
47087
47167
  withRequiredValidator: PropTypes__default.bool
47088
47168
  };
47089
47169
 
47090
- var useStyles$o = makeStyles$1(function (theme) {
47091
- return {
47092
- startAdornmentContainer: {
47093
- marginRight: theme.spacing(0.5)
47094
- }
47095
- };
47096
- });
47097
-
47098
47170
  function ActiveCurrencyField(_ref) {
47099
47171
  var inputPrefix = _ref.inputPrefix,
47100
47172
  decimalScale = _ref.decimalScale,
47101
- InputProps = _ref.InputProps,
47173
+ fixedDecimalScale = _ref.fixedDecimalScale,
47174
+ textAlign = _ref.textAlign,
47102
47175
  inputProps = _ref.inputProps,
47103
- props = objectWithoutProperties(_ref, ['inputPrefix', 'decimalScale', 'InputProps', 'inputProps']);
47176
+ props = objectWithoutProperties(_ref, ['inputPrefix', 'decimalScale', 'fixedDecimalScale', 'textAlign', 'inputProps']);
47104
47177
 
47105
- var classes = useStyles$o(props);
47106
47178
  return React__default.createElement(ActiveFormPositiveInteger, _extends$1({
47107
47179
  variant: 'outlined',
47108
- InputProps: _extends$1({
47109
- startAdornment: React__default.createElement(
47110
- 'span',
47111
- { className: classes.startAdornmentContainer },
47112
- inputPrefix
47113
- )
47114
- }, InputProps),
47115
- inputProps: _extends$1({ decimalScale: decimalScale }, inputProps)
47180
+ inputProps: _extends$1({
47181
+ decimalScale: decimalScale,
47182
+ fixedDecimalScale: fixedDecimalScale,
47183
+ prefix: inputPrefix,
47184
+ style: { textAlign: textAlign }
47185
+ }, inputProps)
47116
47186
  }, props));
47117
47187
  }
47118
47188
 
@@ -47154,12 +47224,16 @@ ActiveCurrencyField.propTypes = {
47154
47224
  /** It triggers after each validation.It will return true or false. */
47155
47225
  validatorListener: PropTypes__default.func,
47156
47226
  /** Allow to use required validator in any validation trigger, not only form submit. */
47157
- withRequiredValidator: PropTypes__default.bool
47227
+ withRequiredValidator: PropTypes__default.bool,
47228
+ /** Input text align */
47229
+ textAlign: PropTypes__default.string
47158
47230
  };
47159
47231
 
47160
47232
  ActiveCurrencyField.defaultProps = {
47161
- inputPrefix: '$',
47162
- decimalScale: 2
47233
+ inputPrefix: '$ ',
47234
+ decimalScale: 2,
47235
+ fixedDecimalScale: true,
47236
+ textAlign: 'right'
47163
47237
  };
47164
47238
 
47165
47239
  var DeleteOutlined = createCommonjsModule(function (module, exports) {
@@ -47186,7 +47260,7 @@ exports.default = _default;
47186
47260
 
47187
47261
  var DeleteOutlinedIcon = unwrapExports(DeleteOutlined);
47188
47262
 
47189
- var useStyles$p = makeStyles$1(function (theme) {
47263
+ var useStyles$n = makeStyles$1(function (theme) {
47190
47264
  return {
47191
47265
  menuDelete: {
47192
47266
  width: '500px'
@@ -47206,7 +47280,7 @@ var useStyles$p = makeStyles$1(function (theme) {
47206
47280
  * It has two varint icon/menu item
47207
47281
  */
47208
47282
  function UConfirmationButton(props) {
47209
- var classes = useStyles$p();
47283
+ var classes = useStyles$n();
47210
47284
  var onConfirm = props.onConfirm,
47211
47285
  id = props.id,
47212
47286
  buttonText = props.buttonText,
@@ -47321,7 +47395,7 @@ UConfirmationButton.defaultProps = {
47321
47395
  /**
47322
47396
  * displays radio buttons
47323
47397
  */
47324
- var useStyles$q = makeStyles$1(function (theme) {
47398
+ var useStyles$o = makeStyles$1(function (theme) {
47325
47399
  return {
47326
47400
  padding: {
47327
47401
  paddingLeft: theme.spacing(3)
@@ -47342,7 +47416,7 @@ function URadioButtons(_ref) {
47342
47416
  optionLabels = _ref.optionLabels,
47343
47417
  optionValues = _ref.optionValues;
47344
47418
 
47345
- var classes = useStyles$q();
47419
+ var classes = useStyles$o();
47346
47420
  var handleOnChange = function handleOnChange(event) {
47347
47421
  onChange && onChange(event);
47348
47422
  };
@@ -47446,7 +47520,7 @@ exports.default = _default;
47446
47520
 
47447
47521
  var DoneIcon = unwrapExports(Done);
47448
47522
 
47449
- var useStyles$r = makeStyles$1(function (theme) {
47523
+ var useStyles$p = makeStyles$1(function (theme) {
47450
47524
  return {
47451
47525
  root: {
47452
47526
  position: 'fixed',
@@ -47478,7 +47552,7 @@ function UAsyncBadge(_ref) {
47478
47552
  visible = _ref.visible,
47479
47553
  onReset = _ref.onReset;
47480
47554
 
47481
- var classes = useStyles$r();
47555
+ var classes = useStyles$p();
47482
47556
 
47483
47557
  /** If variant is success or error, after few seconds, it will set asyncResponse visible to false */
47484
47558
  React.useEffect(function () {
@@ -47517,7 +47591,7 @@ UAsyncBadge.propTypes = {
47517
47591
  onReset: PropTypes__default.func
47518
47592
  };
47519
47593
 
47520
- var useStyles$s = makeStyles$1(function () {
47594
+ var useStyles$q = makeStyles$1(function () {
47521
47595
  return {
47522
47596
  pageLoadingProgress: {
47523
47597
  height: '50vh',
@@ -47532,7 +47606,7 @@ var useStyles$s = makeStyles$1(function () {
47532
47606
  * 2. Display text message
47533
47607
  */
47534
47608
  function UPageLoadingProgress(props) {
47535
- var classes = useStyles$s();
47609
+ var classes = useStyles$q();
47536
47610
  var text = props.text;
47537
47611
 
47538
47612
  return React__default.createElement(
@@ -49385,7 +49459,7 @@ UErrorAlert.defaultProps = {
49385
49459
 
49386
49460
  var filter = createFilterOptions();
49387
49461
 
49388
- var useStyles$t = makeStyles$1(function (theme) {
49462
+ var useStyles$r = makeStyles$1(function (theme) {
49389
49463
  return {
49390
49464
  controlStyle: {
49391
49465
  marginTop: theme.spacing(2),
@@ -49411,9 +49485,12 @@ function UAutoComplete(_ref) {
49411
49485
  maxLength = _ref.maxLength,
49412
49486
  usedItemIds = _ref.usedItemIds,
49413
49487
  allowContextSpecific = _ref.allowContextSpecific,
49488
+ counter = _ref.counter,
49489
+ placeholder = _ref.placeholder,
49490
+ InputLabelProps = _ref.InputLabelProps,
49414
49491
  props = _ref.props;
49415
49492
 
49416
- var classes = useStyles$t();
49493
+ var classes = useStyles$r();
49417
49494
  //const dispatch = useDispatch()
49418
49495
 
49419
49496
  var _useState = React.useState(value || null),
@@ -49471,16 +49548,19 @@ function UAutoComplete(_ref) {
49471
49548
  var controlOptions = options && options.length > 0 ? options.filter(function (opt) {
49472
49549
  return !usedItemIds.includes(opt.id);
49473
49550
  }) : [];
49474
-
49475
49551
  return React__default.createElement(
49476
49552
  React__default.Fragment,
49477
49553
  null,
49478
49554
  readOnly ? React__default.createElement(ActiveFormTextField, {
49479
49555
  multiline: true,
49480
- label: label + '*',
49556
+ label: label,
49557
+ InputLabelProps: _extends$1({}, InputLabelProps, {
49558
+ required: isRequired
49559
+ }),
49481
49560
  variant: 'outlined',
49482
49561
  fullWidth: true,
49483
49562
  readOnly: readOnly,
49563
+ placeholder: placeholder,
49484
49564
  value: selectedValue && selectedValue.text
49485
49565
  }) : React__default.createElement(Autocomplete$1, {
49486
49566
  value: selectedValue,
@@ -49511,7 +49591,7 @@ function UAutoComplete(_ref) {
49511
49591
  renderInput: function renderInput(params) {
49512
49592
  return React__default.createElement(ActiveFormTextField, _extends$1({}, params, {
49513
49593
  multiline: true,
49514
- label: '' + label + (isRequired ? '*' : ''),
49594
+ label: label,
49515
49595
  variant: 'outlined',
49516
49596
  value: selectedValue && selectedValue.text || '',
49517
49597
  validators: isRequired ? ['required', 'trim'] : ['trim'],
@@ -49520,8 +49600,13 @@ function UAutoComplete(_ref) {
49520
49600
  minLength: minLength,
49521
49601
  maxLength: maxLength
49522
49602
  }),
49603
+ InputLabelProps: _extends$1({}, InputLabelProps, {
49604
+ required: isRequired
49605
+ }),
49523
49606
  maxLength: maxLength,
49524
- counter: true
49607
+ counter: counter,
49608
+ placeholder: placeholder,
49609
+ readOnly: readOnly
49525
49610
  }));
49526
49611
  }
49527
49612
  })
@@ -49552,17 +49637,24 @@ UAutoComplete.propTypes = {
49552
49637
  /** can create context specific item or not */
49553
49638
  allowContextSpecific: PropTypes__default.bool,
49554
49639
  /** used item id's from the options */
49555
- usedItemIds: PropTypes__default.array
49640
+ usedItemIds: PropTypes__default.array,
49641
+ /** To enable character counter */
49642
+ counter: PropTypes__default.bool,
49643
+ /** placeholder text*/
49644
+ placeholder: PropTypes__default.string,
49645
+ /** Label props applied to input field*/
49646
+ InputLabelProps: PropTypes__default.object
49556
49647
  };
49557
49648
 
49558
49649
  UAutoComplete.defaultProps = {
49559
49650
  allowContextSpecific: false,
49651
+ counter: false,
49560
49652
  usedItemIds: []
49561
49653
  };
49562
49654
 
49563
49655
  /* eslint-disable no-nested-ternary */
49564
49656
 
49565
- var useStyles$u = makeStyles$1(function (theme) {
49657
+ var useStyles$s = makeStyles$1(function (theme) {
49566
49658
  var _ref;
49567
49659
 
49568
49660
  return _ref = {
@@ -49594,7 +49686,7 @@ var useStyles$u = makeStyles$1(function (theme) {
49594
49686
  * Breadcrumbs is a component to implement current user path of the application
49595
49687
  */
49596
49688
  function UBreadcrumbs(props) {
49597
- var classes = useStyles$u();
49689
+ var classes = useStyles$s();
49598
49690
  var breadcrumbLinks = props.breadcrumbLinks;
49599
49691
 
49600
49692
 
@@ -49671,7 +49763,7 @@ UInfiniteScroll.propTypes = {
49671
49763
  onEndOfScroll: PropTypes__default.func
49672
49764
  };
49673
49765
 
49674
- var useStyles$v = makeStyles$1(function (theme) {
49766
+ var useStyles$t = makeStyles$1(function (theme) {
49675
49767
  return {
49676
49768
  small: {
49677
49769
  width: theme.spacing(4),
@@ -49716,7 +49808,7 @@ function UAvatarImage(_ref) {
49716
49808
  zIndexValue = _ref.zIndexValue,
49717
49809
  loadPhoto = _ref.loadPhoto;
49718
49810
 
49719
- var classes = useStyles$v();
49811
+ var classes = useStyles$t();
49720
49812
 
49721
49813
  var _useState = React.useState(''),
49722
49814
  _useState2 = slicedToArray(_useState, 2),
@@ -50148,7 +50240,7 @@ exports.default = _default;
50148
50240
 
50149
50241
  var CloseIcon$1 = unwrapExports(Close);
50150
50242
 
50151
- var useStyles$w = makeStyles$1(function (theme) {
50243
+ var useStyles$u = makeStyles$1(function (theme) {
50152
50244
  return {
50153
50245
  root: {
50154
50246
  width: '100%',
@@ -50188,7 +50280,7 @@ function USearchBox(_ref) {
50188
50280
  searchValue = _useState2[0],
50189
50281
  setSearch = _useState2[1];
50190
50282
 
50191
- var classes = useStyles$w();
50283
+ var classes = useStyles$u();
50192
50284
 
50193
50285
  var handleChange = function handleChange(event) {
50194
50286
  setSearch(event.target.value);
@@ -50289,7 +50381,7 @@ var styles$16 = {
50289
50381
  }
50290
50382
  };
50291
50383
 
50292
- var useStyles$x = makeStyles$1(function (theme) {
50384
+ var useStyles$v = makeStyles$1(function (theme) {
50293
50385
  return {
50294
50386
  textField: {
50295
50387
  marginTop: theme.spacing(0.25),
@@ -50332,7 +50424,7 @@ var useStyles$x = makeStyles$1(function (theme) {
50332
50424
  * ActiveKeyboardDatePicker is a customized [Material Ui KeyboardDatePicker]('https://material-ui-pickers.dev/api/KeyboardDatePicker') for more details
50333
50425
  */
50334
50426
  function ActiveKeyboardDatePicker(props) {
50335
- var classes = useStyles$x(props);
50427
+ var classes = useStyles$v(props);
50336
50428
  var autoOk = props.autoOk,
50337
50429
  variant = props.variant,
50338
50430
  inputVariant = props.inputVariant,
@@ -50451,7 +50543,7 @@ var styles$17 = {
50451
50543
  }
50452
50544
  };
50453
50545
 
50454
- var useStyles$y = makeStyles$1(function (theme) {
50546
+ var useStyles$w = makeStyles$1(function (theme) {
50455
50547
  return {
50456
50548
  textField: {
50457
50549
  marginTop: theme.spacing(0.25),
@@ -50490,7 +50582,7 @@ var useStyles$y = makeStyles$1(function (theme) {
50490
50582
  * Please have look at [Material Ui Date Picker]('https://material-ui-pickers.dev/api/DatePicker') for more details
50491
50583
  */
50492
50584
  function ActiveDatePicker(props) {
50493
- var classes = useStyles$y(props);
50585
+ var classes = useStyles$w(props);
50494
50586
  var autoOk = props.autoOk,
50495
50587
  variant = props.variant,
50496
50588
  inputVariant = props.inputVariant,
@@ -50584,7 +50676,7 @@ var styles$18 = {
50584
50676
  }
50585
50677
  };
50586
50678
 
50587
- var useStyles$z = makeStyles$1(function (theme) {
50679
+ var useStyles$x = makeStyles$1(function (theme) {
50588
50680
  return {
50589
50681
  textField: {
50590
50682
  marginTop: theme.spacing(0.25),
@@ -50623,7 +50715,7 @@ var useStyles$z = makeStyles$1(function (theme) {
50623
50715
  * Please have look at [Material Ui TimePicker]('https://material-ui-pickers.dev/api/TimePicker') for more details
50624
50716
  */
50625
50717
  function ActiveTimePicker(props) {
50626
- var classes = useStyles$z(props);
50718
+ var classes = useStyles$x(props);
50627
50719
  var inputVariant = props.inputVariant,
50628
50720
  readOnly = props.readOnly,
50629
50721
  interactiveMode = props.interactiveMode,
@@ -50708,7 +50800,7 @@ var styles$19 = {
50708
50800
  }
50709
50801
  };
50710
50802
 
50711
- var useStyles$A = makeStyles$1(function (theme) {
50803
+ var useStyles$y = makeStyles$1(function (theme) {
50712
50804
  return {
50713
50805
  textField: {
50714
50806
  marginTop: theme.spacing(0.25),
@@ -50751,7 +50843,7 @@ var useStyles$A = makeStyles$1(function (theme) {
50751
50843
  * ActiveKeyboardTimePicker is customized [ Material Ui KeyboardTimePicker](https://material-ui-pickers.dev/api/KeyboardTimePicker)
50752
50844
  */
50753
50845
  function ActiveKeyboardTimePicker(props) {
50754
- var classes = useStyles$A(props);
50846
+ var classes = useStyles$y(props);
50755
50847
  var inputVariant = props.inputVariant,
50756
50848
  readOnly = props.readOnly,
50757
50849
  interactiveMode = props.interactiveMode,
@@ -50853,6 +50945,224 @@ ActiveKeyboardTimePicker.defaultProps = {
50853
50945
  variant: 'inline'
50854
50946
  };
50855
50947
 
50948
+ var filter$1 = createFilterOptions();
50949
+
50950
+ var useStyles$z = makeStyles$1(function (theme) {
50951
+ return {
50952
+ root: {
50953
+ marginTop: theme.spacing(2),
50954
+ width: '100%',
50955
+ '& .UPopupIndicator': {
50956
+ visibility: 'hidden'
50957
+ },
50958
+ '&:hover': {
50959
+ '& .UPopupIndicator': {
50960
+ visibility: 'visible'
50961
+ }
50962
+ }
50963
+ },
50964
+ focused: {
50965
+ '& .UPopupIndicator': {
50966
+ visibility: 'visible'
50967
+ }
50968
+ }
50969
+ };
50970
+ });
50971
+ /**
50972
+ * ActiveAutoComplete is an editable dropdown component with interactive.
50973
+ * User can enter the text in order to find the value from the list of values
50974
+ * User can also add new value to the list as well.
50975
+ */
50976
+ function ActiveAutoComplete(_ref) {
50977
+ var value = _ref.value,
50978
+ label = _ref.label,
50979
+ onChange = _ref.onChange,
50980
+ isRequired = _ref.isRequired,
50981
+ onBlur = _ref.onBlur,
50982
+ name = _ref.name,
50983
+ options = _ref.options,
50984
+ readOnly = _ref.readOnly,
50985
+ minLength = _ref.minLength,
50986
+ maxLength = _ref.maxLength,
50987
+ usedItemIds = _ref.usedItemIds,
50988
+ allowContextSpecific = _ref.allowContextSpecific,
50989
+ interactiveMode = _ref.interactiveMode,
50990
+ counter = _ref.counter,
50991
+ placeholder = _ref.placeholder,
50992
+ InputLabelProps = _ref.InputLabelProps,
50993
+ props = _ref.props;
50994
+
50995
+ var classes = useStyles$z();
50996
+ //const dispatch = useDispatch()
50997
+
50998
+ var _useState = React.useState(value || null),
50999
+ _useState2 = slicedToArray(_useState, 2),
51000
+ selectedValue = _useState2[0],
51001
+ setSelectedValue = _useState2[1]; // for initialization: avoid the control to be a uncontrolled component with 'undefined'
51002
+
51003
+ var handleChange = function handleChange(event, newValue) {
51004
+ // Create a new value from the user input
51005
+ if (newValue && newValue.inputValue) {
51006
+ setSelectedValue({
51007
+ text: newValue.inputValue
51008
+ });
51009
+ onChange({
51010
+ text: newValue.inputValue
51011
+ });
51012
+ return;
51013
+ }
51014
+ setSelectedValue(newValue);
51015
+ onChange && onChange(newValue, name);
51016
+ };
51017
+
51018
+ var handleFilter = function handleFilter(options, params) {
51019
+ var filtered = filter$1(options, params);
51020
+ var labelForMessage = label && label.toLowerCase();
51021
+ // Suggest the creation of a new value
51022
+ if (params.inputValue !== '' && allowContextSpecific) {
51023
+ filtered.push({
51024
+ inputValue: params.inputValue,
51025
+ text: 'Use context-specific ' + (labelForMessage ? labelForMessage : '') + ' "' + params.inputValue + '"'
51026
+ });
51027
+ }
51028
+ return filtered;
51029
+ };
51030
+
51031
+ var handleGetOption = function handleGetOption(option) {
51032
+ // Value selected with enter, right from the input
51033
+ if (typeof option === 'string') {
51034
+ return option;
51035
+ }
51036
+ // Add "new" option created dynamically
51037
+ if (option.inputValue) {
51038
+ return option.inputValue;
51039
+ }
51040
+ // Regular option
51041
+ return option.text || '';
51042
+ };
51043
+
51044
+ var handleOnBlur = function handleOnBlur(e) {
51045
+ if (selectedValue && selectedValue.text && selectedValue.text.trim() !== '') {
51046
+ onBlur && onBlur(e, name);
51047
+ }
51048
+ };
51049
+
51050
+ var controlOptions = options && options.length > 0 ? options.filter(function (opt) {
51051
+ return !usedItemIds.includes(opt.id);
51052
+ }) : [];
51053
+ return React__default.createElement(
51054
+ React__default.Fragment,
51055
+ null,
51056
+ !interactiveMode && readOnly ? React__default.createElement(ActiveFormTextField, {
51057
+ multiline: true,
51058
+ label: label,
51059
+ InputLabelProps: _extends$1({}, InputLabelProps, {
51060
+ required: isRequired
51061
+ }),
51062
+ variant: 'outlined',
51063
+ fullWidth: true,
51064
+ readOnly: readOnly,
51065
+ placeholder: placeholder,
51066
+ value: selectedValue && selectedValue.text
51067
+ }) : React__default.createElement(Autocomplete$1, {
51068
+ value: selectedValue,
51069
+ getOptionSelected: function getOptionSelected(option) {
51070
+ return option.id === selectedValue.id;
51071
+ },
51072
+ onChange: function onChange(event, newValue) {
51073
+ return handleChange(event, newValue);
51074
+ },
51075
+ filterOptions: function filterOptions(options, params) {
51076
+ return handleFilter(options, params);
51077
+ },
51078
+ id: 'target-input',
51079
+ name: name,
51080
+ selectOnFocus: true,
51081
+ clearOnBlur: true,
51082
+ handleHomeEndKeys: true,
51083
+ options: controlOptions,
51084
+ getOptionLabel: function getOptionLabel(option) {
51085
+ return handleGetOption(option);
51086
+ },
51087
+ renderOption: function renderOption(option) {
51088
+ return option.text;
51089
+ },
51090
+ onBlur: handleOnBlur,
51091
+ classes: {
51092
+ root: classes.root,
51093
+ focused: classes.focused,
51094
+ popupIndicator: 'UPopupIndicator'
51095
+ },
51096
+ freeSolo: allowContextSpecific,
51097
+ renderInput: function renderInput(params) {
51098
+ return React__default.createElement(ActiveFormTextField, _extends$1({}, params, {
51099
+ multiline: true,
51100
+ label: label,
51101
+ variant: 'outlined',
51102
+ value: selectedValue && selectedValue.text || '',
51103
+ validators: isRequired ? ['required', 'trim'] : ['trim'],
51104
+ fullWidth: true,
51105
+ inputProps: _extends$1({}, params.inputProps, {
51106
+ minLength: minLength,
51107
+ maxLength: maxLength
51108
+ }),
51109
+ InputLabelProps: _extends$1({}, InputLabelProps, {
51110
+ required: isRequired
51111
+ }),
51112
+ maxLength: maxLength,
51113
+ counter: counter,
51114
+ interactiveMode: interactiveMode,
51115
+ placeholder: placeholder,
51116
+ readOnly: readOnly
51117
+ }));
51118
+ }
51119
+ })
51120
+ );
51121
+ }
51122
+
51123
+ ActiveAutoComplete.propTypes = {
51124
+ /** selected value of the dropdown */
51125
+ value: PropTypes__default.object,
51126
+ /** label */
51127
+ label: PropTypes__default.string,
51128
+ /** options to display */
51129
+ options: PropTypes__default.array,
51130
+ /** dropdown on change event */
51131
+ onChange: PropTypes__default.func,
51132
+ /** enable required validator */
51133
+ isRequired: PropTypes__default.bool,
51134
+ /** enable required error in dropdown */
51135
+ hasError: PropTypes__default.bool,
51136
+ /** onBlur event for dropdown */
51137
+ onBlur: PropTypes__default.func,
51138
+ /** name of the dropdown */
51139
+ name: PropTypes__default.string,
51140
+ /** max length text */
51141
+ maxLength: PropTypes__default.number,
51142
+ /** min length text */
51143
+ minLength: PropTypes__default.number,
51144
+ /** can create context specific item or not */
51145
+ allowContextSpecific: PropTypes__default.bool,
51146
+ /** used item id's from the options */
51147
+ usedItemIds: PropTypes__default.array,
51148
+ /** Change to write mode by hiding text field border and displays border on hover*/
51149
+ interactiveMode: PropTypes__default.bool,
51150
+ /** To enable character counter */
51151
+ counter: PropTypes__default.bool,
51152
+ /** placeholder text*/
51153
+ placeholder: PropTypes__default.string,
51154
+ /** Label props applied to input field*/
51155
+ InputLabelProps: PropTypes__default.object
51156
+ };
51157
+
51158
+ ActiveAutoComplete.defaultProps = {
51159
+ allowContextSpecific: false,
51160
+ interactiveMode: false,
51161
+ counter: false,
51162
+ usedItemIds: []
51163
+ };
51164
+
51165
+ exports.ActiveAutoComplete = ActiveAutoComplete;
50856
51166
  exports.ActiveCurrencyField = ActiveCurrencyField;
50857
51167
  exports.ActiveDatePicker = ActiveDatePicker;
50858
51168
  exports.ActiveFormCoordinateField = ActiveFormCoordinateField;
@@ -50879,6 +51189,7 @@ exports.UHeader = UHeader;
50879
51189
  exports.UHeaderLeftMenu = UHeaderLeftMenu;
50880
51190
  exports.UHeaderMainMenu = UHeaderMainMenu;
50881
51191
  exports.UHeaderRightButtons = UHeaderRightButtons;
51192
+ exports.UIconPicker = UIconPicker;
50882
51193
  exports.UInfiniteScroll = UInfiniteScroll;
50883
51194
  exports.UKeyboardDatePicker = UKeyboardDatePicker;
50884
51195
  exports.UKeyboardDateTimePicker = UKeyboardDateTimePicker;