@unicef/material-ui 0.8.2 → 0.10.1

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
@@ -11503,6 +11503,65 @@ var debounce = function debounce(func, wait, immediate) {
11503
11503
  return debounced;
11504
11504
  };
11505
11505
 
11506
+ /**
11507
+ *
11508
+ * @param {String} value Value text to be validated
11509
+ * @returns {Boolean} Whether the given value string is a phone number
11510
+ */
11511
+ function isPhoneNumberText(value) {
11512
+ var valueToTest = value || '';
11513
+ var phoneRegexp = new RegExp(/^[0-9.,+-;()\/\extEXT+# ]*$/i);
11514
+ if (!phoneRegexp.test(valueToTest)) {
11515
+ return false;
11516
+ }
11517
+ return true;
11518
+ }
11519
+
11520
+ /**
11521
+ *
11522
+ * @param {String} value Value text to be validated
11523
+ * @returns {Boolean} Whether the given value string contains safe text (no html tags)
11524
+ */
11525
+ function isSafeText(value) {
11526
+ var valueToTest = value || '';
11527
+ var htmlRegexp = new RegExp(/<\/?[a-z][\s\S]*>/i);
11528
+ if (htmlRegexp.test(valueToTest)) {
11529
+ return false;
11530
+ }
11531
+ return true;
11532
+ }
11533
+
11534
+ /**
11535
+ *
11536
+ * @param {String} value Value text to be validated
11537
+ * @returns {Boolean} Whether the given value string is an acceptable alphanumeric text in any language (also spaces are accepted)
11538
+ */
11539
+ function isAlphanumericText(value) {
11540
+ var valueToTest = value || '';
11541
+ // With Unicode Property Escapes, we can match a letter from any language with the following simple regular expression (https://javascript.info/regexp-unicode) => /\p{Letter}/u
11542
+ // Unicode Property Escapes can be transpiled down to ES5 with a tool called regexpu. OR it can be taken from the lib Steve Levithan's XRegExp package with Unicode add-on (https://xregexp.com/plugins/)
11543
+ // The following is transpiled code for all language char with space and numbers
11544
+ // ( taken from https://stackoverflow.com/a/15861883/1874080 with some modifications) :
11545
+
11546
+ var wordsInAllLanguages = /^[\u0041-\u005A\u0061-\u007A\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC\ \0|0-9\0|1-9]*$/;
11547
+
11548
+ return wordsInAllLanguages.test(valueToTest);
11549
+ }
11550
+
11551
+ /**
11552
+ *
11553
+ * @param {String} value Value text to be validated
11554
+ * @returns {Boolean} Whether the given value string is an acceptable url
11555
+ */
11556
+ function isUrlText(value) {
11557
+ var valueToTest = value || '';
11558
+ var urlRegexp = new RegExp('^http(s?)://[0-9a-zA-Z]([-.w]*[0-9a-zA-Z])*?[a-z0-9][-a-z0-9]{0,61}[a-z0-9]\\.[a-z]{2,6}(/[\\w\\s-\\w@\\+\\.~#\\?&/=%]*)?$');
11559
+ if (valueToTest && !urlRegexp.test(valueToTest)) {
11560
+ return false;
11561
+ }
11562
+ return true;
11563
+ }
11564
+
11506
11565
  // It should to be noted that this function isn't equivalent to `text-transform: capitalize`.
11507
11566
  //
11508
11567
  // A strict capitalization should uppercase the first letter of each word a the sentence.
@@ -40029,7 +40088,8 @@ function PositiveNumberFormat(_ref) {
40029
40088
  isNumericString = _ref.isNumericString,
40030
40089
  allowNegative = _ref.allowNegative,
40031
40090
  decimalScale = _ref.decimalScale,
40032
- 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']);
40033
40093
 
40034
40094
  return React__default.createElement(NumberFormat, _extends$1({}, other, {
40035
40095
  getInputRef: inputRef,
@@ -40044,7 +40104,8 @@ function PositiveNumberFormat(_ref) {
40044
40104
  thousandSeparator: thousandSeparator,
40045
40105
  isNumericString: isNumericString,
40046
40106
  allowNegative: allowNegative,
40047
- decimalScale: decimalScale
40107
+ decimalScale: decimalScale,
40108
+ fixedDecimalScale: fixedDecimalScale
40048
40109
  }));
40049
40110
  }
40050
40111
 
@@ -40060,14 +40121,17 @@ PositiveNumberFormat.propTypes = {
40060
40121
  // Is allow negative numbers
40061
40122
  allowNegative: PropTypes__default.bool,
40062
40123
  // No of decimal digits
40063
- decimalScale: PropTypes__default.number
40124
+ decimalScale: PropTypes__default.number,
40125
+ //If true it add 0s to match given decimalScale.
40126
+ fixedDecimalScale: PropTypes__default.bool
40064
40127
  };
40065
40128
 
40066
40129
  PositiveNumberFormat.defaultProps = {
40067
40130
  thousandSeparator: true,
40068
40131
  isNumericString: false,
40069
40132
  allowNegative: false,
40070
- decimalScale: 0
40133
+ decimalScale: 0,
40134
+ fixedDecimalScale: false
40071
40135
  };
40072
40136
 
40073
40137
  var HelpOutline = createCommonjsModule(function (module, exports) {
@@ -52907,7 +52971,10 @@ var defaultErrorMessages = {
52907
52971
  allowedExtensions: 'File type not allowed',
52908
52972
  isUrl: 'It should start with http:// or https://',
52909
52973
  isLatitude: 'It should be between -90 and 90',
52910
- isLongitude: 'It should be between -180 and 180'
52974
+ isLongitude: 'It should be between -180 and 180',
52975
+ isPhone: 'Only numbers,(,),-,.,# and (ext) are allowed',
52976
+ isSafeText: 'HTML not allowed',
52977
+ isAlphanumeric: 'Only letters and numbers are allowed'
52911
52978
  };
52912
52979
 
52913
52980
  /* eslint-disable */
@@ -52951,6 +53018,9 @@ var styles$13 = {
52951
53018
  * * isString
52952
53019
  * * maxFileSize
52953
53020
  * * allowedExtensions
53021
+ * * isPhone
53022
+ * * isAlphanumeric
53023
+ * * isSafeText
52954
53024
  *
52955
53025
  * It accepts all the props of Material-ui [TextField](https://material-ui.com/api/text-field/#textfield-api)
52956
53026
  */
@@ -53180,11 +53250,7 @@ function ForwardRefForm(props, ref) {
53180
53250
  };
53181
53251
 
53182
53252
  lib_2.addValidationRule('isUrl', function (value) {
53183
- var urlRegexp = new RegExp('^http(s?)://[0-9a-zA-Z]([-.w]*[0-9a-zA-Z])*?[a-z0-9][-a-z0-9]{0,61}[a-z0-9]\\.[a-z]{2,6}(/[\\w\\s-\\w@\\+\\.~#\\?&/=%]*)?$');
53184
- if (value != '' && !urlRegexp.test(value)) {
53185
- return false;
53186
- }
53187
- return true;
53253
+ return isUrlText(value);
53188
53254
  });
53189
53255
 
53190
53256
  lib_2.addValidationRule('isLatitude', function (value) {
@@ -53200,6 +53266,18 @@ function ForwardRefForm(props, ref) {
53200
53266
  return true;
53201
53267
  });
53202
53268
 
53269
+ lib_2.addValidationRule('isPhone', function (value) {
53270
+ return isPhoneNumberText(value);
53271
+ });
53272
+
53273
+ lib_2.addValidationRule('isSafeText', function (value) {
53274
+ return isSafeText(value);
53275
+ });
53276
+
53277
+ lib_2.addValidationRule('isAlphanumeric', function (value) {
53278
+ return isAlphanumericText(value);
53279
+ });
53280
+
53203
53281
  return React__default.createElement(lib_2, _extends$1({}, props, { ref: ref }));
53204
53282
  }
53205
53283
 
@@ -53512,32 +53590,22 @@ UPositiveInteger.propTypes = {
53512
53590
  withRequiredValidator: PropTypes__default.bool
53513
53591
  };
53514
53592
 
53515
- var useStyles$n = makeStyles$1(function (theme) {
53516
- return {
53517
- startAdornmentContainer: {
53518
- marginRight: theme.spacing(0.5)
53519
- }
53520
- };
53521
- });
53522
-
53523
53593
  function UCurrencyField(_ref) {
53524
53594
  var inputPrefix = _ref.inputPrefix,
53525
53595
  decimalScale = _ref.decimalScale,
53526
- InputProps = _ref.InputProps,
53596
+ fixedDecimalScale = _ref.fixedDecimalScale,
53597
+ textAlign = _ref.textAlign,
53527
53598
  inputProps = _ref.inputProps,
53528
- props = objectWithoutProperties(_ref, ['inputPrefix', 'decimalScale', 'InputProps', 'inputProps']);
53599
+ props = objectWithoutProperties(_ref, ['inputPrefix', 'decimalScale', 'fixedDecimalScale', 'textAlign', 'inputProps']);
53529
53600
 
53530
- var classes = useStyles$n(props);
53531
53601
  return React__default.createElement(UPositiveInteger, _extends$1({
53532
53602
  variant: 'outlined',
53533
- InputProps: _extends$1({
53534
- startAdornment: React__default.createElement(
53535
- 'span',
53536
- { className: classes.startAdornmentContainer },
53537
- inputPrefix
53538
- )
53539
- }, InputProps),
53540
- inputProps: _extends$1({ decimalScale: decimalScale }, inputProps)
53603
+ inputProps: _extends$1({
53604
+ decimalScale: decimalScale,
53605
+ fixedDecimalScale: fixedDecimalScale,
53606
+ prefix: inputPrefix,
53607
+ style: { textAlign: textAlign }
53608
+ }, inputProps)
53541
53609
  }, props));
53542
53610
  }
53543
53611
 
@@ -53569,12 +53637,18 @@ UCurrencyField.propTypes = {
53569
53637
  /** To make the content readOnly */
53570
53638
  readOnly: PropTypes__default.bool,
53571
53639
  /** Name of input. */
53572
- name: PropTypes__default.string
53640
+ name: PropTypes__default.string,
53641
+ /** Input text align */
53642
+ textAlign: PropTypes__default.string,
53643
+ // If true it add 0s to match given decimalScale.
53644
+ fixedDecimalScale: PropTypes__default.bool
53573
53645
  };
53574
53646
 
53575
53647
  UCurrencyField.defaultProps = {
53576
- inputPrefix: '$',
53577
- decimalScale: 2
53648
+ inputPrefix: '$ ',
53649
+ decimalScale: 2,
53650
+ fixedDecimalScale: true,
53651
+ textAlign: 'right'
53578
53652
  };
53579
53653
 
53580
53654
  function ActiveFormPositiveInteger(_ref) {
@@ -53625,32 +53699,22 @@ ActiveFormPositiveInteger.propTypes = {
53625
53699
  withRequiredValidator: PropTypes__default.bool
53626
53700
  };
53627
53701
 
53628
- var useStyles$o = makeStyles$1(function (theme) {
53629
- return {
53630
- startAdornmentContainer: {
53631
- marginRight: theme.spacing(0.5)
53632
- }
53633
- };
53634
- });
53635
-
53636
53702
  function ActiveCurrencyField(_ref) {
53637
53703
  var inputPrefix = _ref.inputPrefix,
53638
53704
  decimalScale = _ref.decimalScale,
53639
- InputProps = _ref.InputProps,
53705
+ fixedDecimalScale = _ref.fixedDecimalScale,
53706
+ textAlign = _ref.textAlign,
53640
53707
  inputProps = _ref.inputProps,
53641
- props = objectWithoutProperties(_ref, ['inputPrefix', 'decimalScale', 'InputProps', 'inputProps']);
53708
+ props = objectWithoutProperties(_ref, ['inputPrefix', 'decimalScale', 'fixedDecimalScale', 'textAlign', 'inputProps']);
53642
53709
 
53643
- var classes = useStyles$o(props);
53644
53710
  return React__default.createElement(ActiveFormPositiveInteger, _extends$1({
53645
53711
  variant: 'outlined',
53646
- InputProps: _extends$1({
53647
- startAdornment: React__default.createElement(
53648
- 'span',
53649
- { className: classes.startAdornmentContainer },
53650
- inputPrefix
53651
- )
53652
- }, InputProps),
53653
- inputProps: _extends$1({ decimalScale: decimalScale }, inputProps)
53712
+ inputProps: _extends$1({
53713
+ decimalScale: decimalScale,
53714
+ fixedDecimalScale: fixedDecimalScale,
53715
+ prefix: inputPrefix,
53716
+ style: { textAlign: textAlign }
53717
+ }, inputProps)
53654
53718
  }, props));
53655
53719
  }
53656
53720
 
@@ -53692,12 +53756,16 @@ ActiveCurrencyField.propTypes = {
53692
53756
  /** It triggers after each validation.It will return true or false. */
53693
53757
  validatorListener: PropTypes__default.func,
53694
53758
  /** Allow to use required validator in any validation trigger, not only form submit. */
53695
- withRequiredValidator: PropTypes__default.bool
53759
+ withRequiredValidator: PropTypes__default.bool,
53760
+ /** Input text align */
53761
+ textAlign: PropTypes__default.string
53696
53762
  };
53697
53763
 
53698
53764
  ActiveCurrencyField.defaultProps = {
53699
- inputPrefix: '$',
53700
- decimalScale: 2
53765
+ inputPrefix: '$ ',
53766
+ decimalScale: 2,
53767
+ fixedDecimalScale: true,
53768
+ textAlign: 'right'
53701
53769
  };
53702
53770
 
53703
53771
  var DeleteOutlined = createCommonjsModule(function (module, exports) {
@@ -53724,7 +53792,7 @@ exports.default = _default;
53724
53792
 
53725
53793
  var DeleteOutlinedIcon = unwrapExports(DeleteOutlined);
53726
53794
 
53727
- var useStyles$p = makeStyles$1(function (theme) {
53795
+ var useStyles$n = makeStyles$1(function (theme) {
53728
53796
  return {
53729
53797
  menuDelete: {
53730
53798
  width: '500px'
@@ -53744,7 +53812,7 @@ var useStyles$p = makeStyles$1(function (theme) {
53744
53812
  * It has two varint icon/menu item
53745
53813
  */
53746
53814
  function UConfirmationButton(props) {
53747
- var classes = useStyles$p();
53815
+ var classes = useStyles$n();
53748
53816
  var onConfirm = props.onConfirm,
53749
53817
  id = props.id,
53750
53818
  buttonText = props.buttonText,
@@ -53859,7 +53927,7 @@ UConfirmationButton.defaultProps = {
53859
53927
  /**
53860
53928
  * displays radio buttons
53861
53929
  */
53862
- var useStyles$q = makeStyles$1(function (theme) {
53930
+ var useStyles$o = makeStyles$1(function (theme) {
53863
53931
  return {
53864
53932
  padding: {
53865
53933
  paddingLeft: theme.spacing(3)
@@ -53880,7 +53948,7 @@ function URadioButtons(_ref) {
53880
53948
  optionLabels = _ref.optionLabels,
53881
53949
  optionValues = _ref.optionValues;
53882
53950
 
53883
- var classes = useStyles$q();
53951
+ var classes = useStyles$o();
53884
53952
  var handleOnChange = function handleOnChange(event) {
53885
53953
  onChange && onChange(event);
53886
53954
  };
@@ -53984,7 +54052,7 @@ exports.default = _default;
53984
54052
 
53985
54053
  var DoneIcon = unwrapExports(Done);
53986
54054
 
53987
- var useStyles$r = makeStyles$1(function (theme) {
54055
+ var useStyles$p = makeStyles$1(function (theme) {
53988
54056
  return {
53989
54057
  root: {
53990
54058
  position: 'fixed',
@@ -54016,7 +54084,7 @@ function UAsyncBadge(_ref) {
54016
54084
  visible = _ref.visible,
54017
54085
  onReset = _ref.onReset;
54018
54086
 
54019
- var classes = useStyles$r();
54087
+ var classes = useStyles$p();
54020
54088
 
54021
54089
  /** If variant is success or error, after few seconds, it will set asyncResponse visible to false */
54022
54090
  React.useEffect(function () {
@@ -54055,7 +54123,7 @@ UAsyncBadge.propTypes = {
54055
54123
  onReset: PropTypes__default.func
54056
54124
  };
54057
54125
 
54058
- var useStyles$s = makeStyles$1(function () {
54126
+ var useStyles$q = makeStyles$1(function () {
54059
54127
  return {
54060
54128
  pageLoadingProgress: {
54061
54129
  height: '50vh',
@@ -54070,7 +54138,7 @@ var useStyles$s = makeStyles$1(function () {
54070
54138
  * 2. Display text message
54071
54139
  */
54072
54140
  function UPageLoadingProgress(props) {
54073
- var classes = useStyles$s();
54141
+ var classes = useStyles$q();
54074
54142
  var text = props.text;
54075
54143
 
54076
54144
  return React__default.createElement(
@@ -56453,7 +56521,7 @@ UErrorAlert.defaultProps = {
56453
56521
 
56454
56522
  var filter = createFilterOptions();
56455
56523
 
56456
- var useStyles$t = makeStyles$1(function (theme) {
56524
+ var useStyles$r = makeStyles$1(function (theme) {
56457
56525
  return {
56458
56526
  controlStyle: {
56459
56527
  marginTop: theme.spacing(2),
@@ -56479,9 +56547,12 @@ function UAutoComplete(_ref) {
56479
56547
  maxLength = _ref.maxLength,
56480
56548
  usedItemIds = _ref.usedItemIds,
56481
56549
  allowContextSpecific = _ref.allowContextSpecific,
56550
+ counter = _ref.counter,
56551
+ placeholder = _ref.placeholder,
56552
+ InputLabelProps = _ref.InputLabelProps,
56482
56553
  props = _ref.props;
56483
56554
 
56484
- var classes = useStyles$t();
56555
+ var classes = useStyles$r();
56485
56556
  //const dispatch = useDispatch()
56486
56557
 
56487
56558
  var _useState = React.useState(value || null),
@@ -56539,16 +56610,19 @@ function UAutoComplete(_ref) {
56539
56610
  var controlOptions = options && options.length > 0 ? options.filter(function (opt) {
56540
56611
  return !usedItemIds.includes(opt.id);
56541
56612
  }) : [];
56542
-
56543
56613
  return React__default.createElement(
56544
56614
  React__default.Fragment,
56545
56615
  null,
56546
56616
  readOnly ? React__default.createElement(ActiveFormTextField, {
56547
56617
  multiline: true,
56548
- label: label + '*',
56618
+ label: label,
56619
+ InputLabelProps: _extends$1({}, InputLabelProps, {
56620
+ required: isRequired
56621
+ }),
56549
56622
  variant: 'outlined',
56550
56623
  fullWidth: true,
56551
56624
  readOnly: readOnly,
56625
+ placeholder: placeholder,
56552
56626
  value: selectedValue && selectedValue.text
56553
56627
  }) : React__default.createElement(Autocomplete$1, {
56554
56628
  value: selectedValue,
@@ -56579,7 +56653,7 @@ function UAutoComplete(_ref) {
56579
56653
  renderInput: function renderInput(params) {
56580
56654
  return React__default.createElement(ActiveFormTextField, _extends$1({}, params, {
56581
56655
  multiline: true,
56582
- label: '' + label + (isRequired ? '*' : ''),
56656
+ label: label,
56583
56657
  variant: 'outlined',
56584
56658
  value: selectedValue && selectedValue.text || '',
56585
56659
  validators: isRequired ? ['required', 'trim'] : ['trim'],
@@ -56588,8 +56662,13 @@ function UAutoComplete(_ref) {
56588
56662
  minLength: minLength,
56589
56663
  maxLength: maxLength
56590
56664
  }),
56665
+ InputLabelProps: _extends$1({}, InputLabelProps, {
56666
+ required: isRequired
56667
+ }),
56591
56668
  maxLength: maxLength,
56592
- counter: true
56669
+ counter: counter,
56670
+ placeholder: placeholder,
56671
+ readOnly: readOnly
56593
56672
  }));
56594
56673
  }
56595
56674
  })
@@ -56620,17 +56699,24 @@ UAutoComplete.propTypes = {
56620
56699
  /** can create context specific item or not */
56621
56700
  allowContextSpecific: PropTypes__default.bool,
56622
56701
  /** used item id's from the options */
56623
- usedItemIds: PropTypes__default.array
56702
+ usedItemIds: PropTypes__default.array,
56703
+ /** To enable character counter */
56704
+ counter: PropTypes__default.bool,
56705
+ /** placeholder text*/
56706
+ placeholder: PropTypes__default.string,
56707
+ /** Label props applied to input field*/
56708
+ InputLabelProps: PropTypes__default.object
56624
56709
  };
56625
56710
 
56626
56711
  UAutoComplete.defaultProps = {
56627
56712
  allowContextSpecific: false,
56713
+ counter: false,
56628
56714
  usedItemIds: []
56629
56715
  };
56630
56716
 
56631
56717
  /* eslint-disable no-nested-ternary */
56632
56718
 
56633
- var useStyles$u = makeStyles$1(function (theme) {
56719
+ var useStyles$s = makeStyles$1(function (theme) {
56634
56720
  var _ref;
56635
56721
 
56636
56722
  return _ref = {
@@ -56662,7 +56748,7 @@ var useStyles$u = makeStyles$1(function (theme) {
56662
56748
  * Breadcrumbs is a component to implement current user path of the application
56663
56749
  */
56664
56750
  function UBreadcrumbs(props) {
56665
- var classes = useStyles$u();
56751
+ var classes = useStyles$s();
56666
56752
  var breadcrumbLinks = props.breadcrumbLinks;
56667
56753
 
56668
56754
 
@@ -56739,7 +56825,7 @@ UInfiniteScroll.propTypes = {
56739
56825
  onEndOfScroll: PropTypes__default.func
56740
56826
  };
56741
56827
 
56742
- var useStyles$v = makeStyles$1(function (theme) {
56828
+ var useStyles$t = makeStyles$1(function (theme) {
56743
56829
  return {
56744
56830
  small: {
56745
56831
  width: theme.spacing(4),
@@ -56784,7 +56870,7 @@ function UAvatarImage(_ref) {
56784
56870
  zIndexValue = _ref.zIndexValue,
56785
56871
  loadPhoto = _ref.loadPhoto;
56786
56872
 
56787
- var classes = useStyles$v();
56873
+ var classes = useStyles$t();
56788
56874
 
56789
56875
  var _useState = React.useState(''),
56790
56876
  _useState2 = slicedToArray(_useState, 2),
@@ -57216,7 +57302,7 @@ exports.default = _default;
57216
57302
 
57217
57303
  var CloseIcon$1 = unwrapExports(Close);
57218
57304
 
57219
- var useStyles$w = makeStyles$1(function (theme) {
57305
+ var useStyles$u = makeStyles$1(function (theme) {
57220
57306
  return {
57221
57307
  root: {
57222
57308
  width: '100%',
@@ -57256,7 +57342,7 @@ function USearchBox(_ref) {
57256
57342
  searchValue = _useState2[0],
57257
57343
  setSearch = _useState2[1];
57258
57344
 
57259
- var classes = useStyles$w();
57345
+ var classes = useStyles$u();
57260
57346
 
57261
57347
  var handleChange = function handleChange(event) {
57262
57348
  setSearch(event.target.value);
@@ -57357,7 +57443,7 @@ var styles$16 = {
57357
57443
  }
57358
57444
  };
57359
57445
 
57360
- var useStyles$x = makeStyles$1(function (theme) {
57446
+ var useStyles$v = makeStyles$1(function (theme) {
57361
57447
  return {
57362
57448
  textField: {
57363
57449
  marginTop: theme.spacing(0.25),
@@ -57400,7 +57486,7 @@ var useStyles$x = makeStyles$1(function (theme) {
57400
57486
  * ActiveKeyboardDatePicker is a customized [Material Ui KeyboardDatePicker]('https://material-ui-pickers.dev/api/KeyboardDatePicker') for more details
57401
57487
  */
57402
57488
  function ActiveKeyboardDatePicker(props) {
57403
- var classes = useStyles$x(props);
57489
+ var classes = useStyles$v(props);
57404
57490
  var autoOk = props.autoOk,
57405
57491
  variant = props.variant,
57406
57492
  inputVariant = props.inputVariant,
@@ -57519,7 +57605,7 @@ var styles$17 = {
57519
57605
  }
57520
57606
  };
57521
57607
 
57522
- var useStyles$y = makeStyles$1(function (theme) {
57608
+ var useStyles$w = makeStyles$1(function (theme) {
57523
57609
  return {
57524
57610
  textField: {
57525
57611
  marginTop: theme.spacing(0.25),
@@ -57558,7 +57644,7 @@ var useStyles$y = makeStyles$1(function (theme) {
57558
57644
  * Please have look at [Material Ui Date Picker]('https://material-ui-pickers.dev/api/DatePicker') for more details
57559
57645
  */
57560
57646
  function ActiveDatePicker(props) {
57561
- var classes = useStyles$y(props);
57647
+ var classes = useStyles$w(props);
57562
57648
  var autoOk = props.autoOk,
57563
57649
  variant = props.variant,
57564
57650
  inputVariant = props.inputVariant,
@@ -57652,7 +57738,7 @@ var styles$18 = {
57652
57738
  }
57653
57739
  };
57654
57740
 
57655
- var useStyles$z = makeStyles$1(function (theme) {
57741
+ var useStyles$x = makeStyles$1(function (theme) {
57656
57742
  return {
57657
57743
  textField: {
57658
57744
  marginTop: theme.spacing(0.25),
@@ -57691,7 +57777,7 @@ var useStyles$z = makeStyles$1(function (theme) {
57691
57777
  * Please have look at [Material Ui TimePicker]('https://material-ui-pickers.dev/api/TimePicker') for more details
57692
57778
  */
57693
57779
  function ActiveTimePicker(props) {
57694
- var classes = useStyles$z(props);
57780
+ var classes = useStyles$x(props);
57695
57781
  var inputVariant = props.inputVariant,
57696
57782
  readOnly = props.readOnly,
57697
57783
  interactiveMode = props.interactiveMode,
@@ -57776,7 +57862,7 @@ var styles$19 = {
57776
57862
  }
57777
57863
  };
57778
57864
 
57779
- var useStyles$A = makeStyles$1(function (theme) {
57865
+ var useStyles$y = makeStyles$1(function (theme) {
57780
57866
  return {
57781
57867
  textField: {
57782
57868
  marginTop: theme.spacing(0.25),
@@ -57819,7 +57905,7 @@ var useStyles$A = makeStyles$1(function (theme) {
57819
57905
  * ActiveKeyboardTimePicker is customized [ Material Ui KeyboardTimePicker](https://material-ui-pickers.dev/api/KeyboardTimePicker)
57820
57906
  */
57821
57907
  function ActiveKeyboardTimePicker(props) {
57822
- var classes = useStyles$A(props);
57908
+ var classes = useStyles$y(props);
57823
57909
  var inputVariant = props.inputVariant,
57824
57910
  readOnly = props.readOnly,
57825
57911
  interactiveMode = props.interactiveMode,
@@ -57921,6 +58007,224 @@ ActiveKeyboardTimePicker.defaultProps = {
57921
58007
  variant: 'inline'
57922
58008
  };
57923
58009
 
58010
+ var filter$1 = createFilterOptions();
58011
+
58012
+ var useStyles$z = makeStyles$1(function (theme) {
58013
+ return {
58014
+ root: {
58015
+ marginTop: theme.spacing(2),
58016
+ width: '100%',
58017
+ '& .UPopupIndicator': {
58018
+ visibility: 'hidden'
58019
+ },
58020
+ '&:hover': {
58021
+ '& .UPopupIndicator': {
58022
+ visibility: 'visible'
58023
+ }
58024
+ }
58025
+ },
58026
+ focused: {
58027
+ '& .UPopupIndicator': {
58028
+ visibility: 'visible'
58029
+ }
58030
+ }
58031
+ };
58032
+ });
58033
+ /**
58034
+ * ActiveAutoComplete is an editable dropdown component with interactive.
58035
+ * User can enter the text in order to find the value from the list of values
58036
+ * User can also add new value to the list as well.
58037
+ */
58038
+ function ActiveAutoComplete(_ref) {
58039
+ var value = _ref.value,
58040
+ label = _ref.label,
58041
+ onChange = _ref.onChange,
58042
+ isRequired = _ref.isRequired,
58043
+ onBlur = _ref.onBlur,
58044
+ name = _ref.name,
58045
+ options = _ref.options,
58046
+ readOnly = _ref.readOnly,
58047
+ minLength = _ref.minLength,
58048
+ maxLength = _ref.maxLength,
58049
+ usedItemIds = _ref.usedItemIds,
58050
+ allowContextSpecific = _ref.allowContextSpecific,
58051
+ interactiveMode = _ref.interactiveMode,
58052
+ counter = _ref.counter,
58053
+ placeholder = _ref.placeholder,
58054
+ InputLabelProps = _ref.InputLabelProps,
58055
+ props = _ref.props;
58056
+
58057
+ var classes = useStyles$z();
58058
+ //const dispatch = useDispatch()
58059
+
58060
+ var _useState = React.useState(value || null),
58061
+ _useState2 = slicedToArray(_useState, 2),
58062
+ selectedValue = _useState2[0],
58063
+ setSelectedValue = _useState2[1]; // for initialization: avoid the control to be a uncontrolled component with 'undefined'
58064
+
58065
+ var handleChange = function handleChange(event, newValue) {
58066
+ // Create a new value from the user input
58067
+ if (newValue && newValue.inputValue) {
58068
+ setSelectedValue({
58069
+ text: newValue.inputValue
58070
+ });
58071
+ onChange({
58072
+ text: newValue.inputValue
58073
+ });
58074
+ return;
58075
+ }
58076
+ setSelectedValue(newValue);
58077
+ onChange && onChange(newValue, name);
58078
+ };
58079
+
58080
+ var handleFilter = function handleFilter(options, params) {
58081
+ var filtered = filter$1(options, params);
58082
+ var labelForMessage = label && label.toLowerCase();
58083
+ // Suggest the creation of a new value
58084
+ if (params.inputValue !== '' && allowContextSpecific) {
58085
+ filtered.push({
58086
+ inputValue: params.inputValue,
58087
+ text: 'Use context-specific ' + (labelForMessage ? labelForMessage : '') + ' "' + params.inputValue + '"'
58088
+ });
58089
+ }
58090
+ return filtered;
58091
+ };
58092
+
58093
+ var handleGetOption = function handleGetOption(option) {
58094
+ // Value selected with enter, right from the input
58095
+ if (typeof option === 'string') {
58096
+ return option;
58097
+ }
58098
+ // Add "new" option created dynamically
58099
+ if (option.inputValue) {
58100
+ return option.inputValue;
58101
+ }
58102
+ // Regular option
58103
+ return option.text || '';
58104
+ };
58105
+
58106
+ var handleOnBlur = function handleOnBlur(e) {
58107
+ if (selectedValue && selectedValue.text && selectedValue.text.trim() !== '') {
58108
+ onBlur && onBlur(e, name);
58109
+ }
58110
+ };
58111
+
58112
+ var controlOptions = options && options.length > 0 ? options.filter(function (opt) {
58113
+ return !usedItemIds.includes(opt.id);
58114
+ }) : [];
58115
+ return React__default.createElement(
58116
+ React__default.Fragment,
58117
+ null,
58118
+ !interactiveMode && readOnly ? React__default.createElement(ActiveFormTextField, {
58119
+ multiline: true,
58120
+ label: label,
58121
+ InputLabelProps: _extends$1({}, InputLabelProps, {
58122
+ required: isRequired
58123
+ }),
58124
+ variant: 'outlined',
58125
+ fullWidth: true,
58126
+ readOnly: readOnly,
58127
+ placeholder: placeholder,
58128
+ value: selectedValue && selectedValue.text
58129
+ }) : React__default.createElement(Autocomplete$1, {
58130
+ value: selectedValue,
58131
+ getOptionSelected: function getOptionSelected(option) {
58132
+ return option.id === selectedValue.id;
58133
+ },
58134
+ onChange: function onChange(event, newValue) {
58135
+ return handleChange(event, newValue);
58136
+ },
58137
+ filterOptions: function filterOptions(options, params) {
58138
+ return handleFilter(options, params);
58139
+ },
58140
+ id: 'target-input',
58141
+ name: name,
58142
+ selectOnFocus: true,
58143
+ clearOnBlur: true,
58144
+ handleHomeEndKeys: true,
58145
+ options: controlOptions,
58146
+ getOptionLabel: function getOptionLabel(option) {
58147
+ return handleGetOption(option);
58148
+ },
58149
+ renderOption: function renderOption(option) {
58150
+ return option.text;
58151
+ },
58152
+ onBlur: handleOnBlur,
58153
+ classes: {
58154
+ root: classes.root,
58155
+ focused: classes.focused,
58156
+ popupIndicator: 'UPopupIndicator'
58157
+ },
58158
+ freeSolo: allowContextSpecific,
58159
+ renderInput: function renderInput(params) {
58160
+ return React__default.createElement(ActiveFormTextField, _extends$1({}, params, {
58161
+ multiline: true,
58162
+ label: label,
58163
+ variant: 'outlined',
58164
+ value: selectedValue && selectedValue.text || '',
58165
+ validators: isRequired ? ['required', 'trim'] : ['trim'],
58166
+ fullWidth: true,
58167
+ inputProps: _extends$1({}, params.inputProps, {
58168
+ minLength: minLength,
58169
+ maxLength: maxLength
58170
+ }),
58171
+ InputLabelProps: _extends$1({}, InputLabelProps, {
58172
+ required: isRequired
58173
+ }),
58174
+ maxLength: maxLength,
58175
+ counter: counter,
58176
+ interactiveMode: interactiveMode,
58177
+ placeholder: placeholder,
58178
+ readOnly: readOnly
58179
+ }));
58180
+ }
58181
+ })
58182
+ );
58183
+ }
58184
+
58185
+ ActiveAutoComplete.propTypes = {
58186
+ /** selected value of the dropdown */
58187
+ value: PropTypes__default.object,
58188
+ /** label */
58189
+ label: PropTypes__default.string,
58190
+ /** options to display */
58191
+ options: PropTypes__default.array,
58192
+ /** dropdown on change event */
58193
+ onChange: PropTypes__default.func,
58194
+ /** enable required validator */
58195
+ isRequired: PropTypes__default.bool,
58196
+ /** enable required error in dropdown */
58197
+ hasError: PropTypes__default.bool,
58198
+ /** onBlur event for dropdown */
58199
+ onBlur: PropTypes__default.func,
58200
+ /** name of the dropdown */
58201
+ name: PropTypes__default.string,
58202
+ /** max length text */
58203
+ maxLength: PropTypes__default.number,
58204
+ /** min length text */
58205
+ minLength: PropTypes__default.number,
58206
+ /** can create context specific item or not */
58207
+ allowContextSpecific: PropTypes__default.bool,
58208
+ /** used item id's from the options */
58209
+ usedItemIds: PropTypes__default.array,
58210
+ /** Change to write mode by hiding text field border and displays border on hover*/
58211
+ interactiveMode: PropTypes__default.bool,
58212
+ /** To enable character counter */
58213
+ counter: PropTypes__default.bool,
58214
+ /** placeholder text*/
58215
+ placeholder: PropTypes__default.string,
58216
+ /** Label props applied to input field*/
58217
+ InputLabelProps: PropTypes__default.object
58218
+ };
58219
+
58220
+ ActiveAutoComplete.defaultProps = {
58221
+ allowContextSpecific: false,
58222
+ interactiveMode: false,
58223
+ counter: false,
58224
+ usedItemIds: []
58225
+ };
58226
+
58227
+ exports.ActiveAutoComplete = ActiveAutoComplete;
57924
58228
  exports.ActiveCurrencyField = ActiveCurrencyField;
57925
58229
  exports.ActiveDatePicker = ActiveDatePicker;
57926
58230
  exports.ActiveFormCoordinateField = ActiveFormCoordinateField;