@syncfusion/ej2-inputs 20.3.56 → 20.4.38

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.
Files changed (122) hide show
  1. package/.eslintrc.json +16 -1
  2. package/CHANGELOG.md +7 -4
  3. package/dist/ej2-inputs.min.js +2 -2
  4. package/dist/ej2-inputs.umd.min.js +2 -2
  5. package/dist/ej2-inputs.umd.min.js.map +1 -1
  6. package/dist/es6/ej2-inputs.es2015.js +889 -67
  7. package/dist/es6/ej2-inputs.es2015.js.map +1 -1
  8. package/dist/es6/ej2-inputs.es5.js +913 -67
  9. package/dist/es6/ej2-inputs.es5.js.map +1 -1
  10. package/dist/global/ej2-inputs.min.js +2 -2
  11. package/dist/global/ej2-inputs.min.js.map +1 -1
  12. package/dist/global/index.d.ts +1 -1
  13. package/package.json +9 -9
  14. package/rating.d.ts +4 -0
  15. package/rating.js +4 -0
  16. package/src/color-picker/color-picker-model.d.ts +4 -4
  17. package/src/color-picker/color-picker.d.ts +4 -4
  18. package/src/color-picker/color-picker.js +4 -2
  19. package/src/common/signature-base.d.ts +0 -1
  20. package/src/common/signature-base.js +4 -9
  21. package/src/index.d.ts +1 -0
  22. package/src/index.js +1 -0
  23. package/src/input/input.d.ts +1 -0
  24. package/src/input/input.js +5 -1
  25. package/src/maskedtextbox/base/mask-base.d.ts +1 -0
  26. package/src/maskedtextbox/base/mask-base.js +20 -13
  27. package/src/maskedtextbox/maskedtextbox/maskedtextbox-model.d.ts +1 -0
  28. package/src/maskedtextbox/maskedtextbox/maskedtextbox.d.ts +1 -0
  29. package/src/maskedtextbox/maskedtextbox/maskedtextbox.js +16 -7
  30. package/src/numerictextbox/numerictextbox.js +24 -11
  31. package/src/rating/index.d.ts +5 -0
  32. package/src/rating/index.js +4 -0
  33. package/src/rating/rating-model.d.ts +185 -0
  34. package/src/rating/rating.d.ts +344 -0
  35. package/src/rating/rating.js +783 -0
  36. package/src/slider/slider.js +4 -2
  37. package/src/textbox/textbox.js +11 -10
  38. package/src/uploader/uploader-model.d.ts +10 -1
  39. package/src/uploader/uploader.d.ts +8 -0
  40. package/src/uploader/uploader.js +41 -12
  41. package/styles/bootstrap-dark.css +264 -0
  42. package/styles/bootstrap-dark.scss +1 -0
  43. package/styles/bootstrap.css +264 -0
  44. package/styles/bootstrap.scss +1 -0
  45. package/styles/bootstrap4.css +267 -2
  46. package/styles/bootstrap4.scss +1 -0
  47. package/styles/bootstrap5-dark.css +265 -0
  48. package/styles/bootstrap5-dark.scss +1 -0
  49. package/styles/bootstrap5.css +265 -0
  50. package/styles/bootstrap5.scss +1 -0
  51. package/styles/color-picker/_theme.scss +2 -2
  52. package/styles/color-picker/bootstrap4.css +2 -2
  53. package/styles/fabric-dark.css +264 -0
  54. package/styles/fabric-dark.scss +1 -0
  55. package/styles/fabric.css +264 -0
  56. package/styles/fabric.scss +1 -0
  57. package/styles/fluent-dark.css +264 -0
  58. package/styles/fluent-dark.scss +1 -0
  59. package/styles/fluent.css +264 -0
  60. package/styles/fluent.scss +1 -0
  61. package/styles/highcontrast-light.css +264 -0
  62. package/styles/highcontrast-light.scss +1 -0
  63. package/styles/highcontrast.css +264 -0
  64. package/styles/highcontrast.scss +1 -0
  65. package/styles/material-dark.css +264 -0
  66. package/styles/material-dark.scss +1 -0
  67. package/styles/material.css +264 -0
  68. package/styles/material.scss +1 -0
  69. package/styles/rating/_all.scss +2 -0
  70. package/styles/rating/_bootstrap-dark-definition.scss +45 -0
  71. package/styles/rating/_bootstrap-definition.scss +45 -0
  72. package/styles/rating/_bootstrap4-definition.scss +45 -0
  73. package/styles/rating/_bootstrap5-dark-definition.scss +1 -0
  74. package/styles/rating/_bootstrap5-definition.scss +45 -0
  75. package/styles/rating/_fabric-dark-definition.scss +45 -0
  76. package/styles/rating/_fabric-definition.scss +45 -0
  77. package/styles/rating/_fluent-dark-definition.scss +1 -0
  78. package/styles/rating/_fluent-definition.scss +45 -0
  79. package/styles/rating/_fusionnew-definition.scss +45 -0
  80. package/styles/rating/_highcontrast-definition.scss +45 -0
  81. package/styles/rating/_highcontrast-light-definition.scss +45 -0
  82. package/styles/rating/_layout.scss +203 -0
  83. package/styles/rating/_material-dark-definition.scss +45 -0
  84. package/styles/rating/_material-definition.scss +45 -0
  85. package/styles/rating/_material3-definition.scss +45 -0
  86. package/styles/rating/_tailwind-dark-definition.scss +1 -0
  87. package/styles/rating/_tailwind-definition.scss +45 -0
  88. package/styles/rating/_theme.scss +158 -0
  89. package/styles/rating/bootstrap-dark.css +263 -0
  90. package/styles/rating/bootstrap-dark.scss +4 -0
  91. package/styles/rating/bootstrap.css +263 -0
  92. package/styles/rating/bootstrap.scss +4 -0
  93. package/styles/rating/bootstrap4.css +264 -0
  94. package/styles/rating/bootstrap4.scss +4 -0
  95. package/styles/rating/bootstrap5-dark.css +264 -0
  96. package/styles/rating/bootstrap5-dark.scss +4 -0
  97. package/styles/rating/bootstrap5.css +264 -0
  98. package/styles/rating/bootstrap5.scss +4 -0
  99. package/styles/rating/fabric-dark.css +263 -0
  100. package/styles/rating/fabric-dark.scss +4 -0
  101. package/styles/rating/fabric.css +263 -0
  102. package/styles/rating/fabric.scss +4 -0
  103. package/styles/rating/fluent-dark.css +263 -0
  104. package/styles/rating/fluent-dark.scss +4 -0
  105. package/styles/rating/fluent.css +263 -0
  106. package/styles/rating/fluent.scss +4 -0
  107. package/styles/rating/highcontrast-light.css +263 -0
  108. package/styles/rating/highcontrast-light.scss +4 -0
  109. package/styles/rating/highcontrast.css +263 -0
  110. package/styles/rating/highcontrast.scss +4 -0
  111. package/styles/rating/material-dark.css +264 -0
  112. package/styles/rating/material-dark.scss +4 -0
  113. package/styles/rating/material.css +264 -0
  114. package/styles/rating/material.scss +4 -0
  115. package/styles/rating/tailwind-dark.css +269 -0
  116. package/styles/rating/tailwind-dark.scss +4 -0
  117. package/styles/rating/tailwind.css +269 -0
  118. package/styles/rating/tailwind.scss +4 -0
  119. package/styles/tailwind-dark.css +270 -0
  120. package/styles/tailwind-dark.scss +1 -0
  121. package/styles/tailwind.css +270 -0
  122. package/styles/tailwind.scss +1 -0
@@ -324,6 +324,10 @@ var Input;
324
324
  });
325
325
  }
326
326
  Input.wireClearBtnEvents = wireClearBtnEvents;
327
+ function destroy() {
328
+
329
+ }
330
+ Input.destroy = destroy;
327
331
  function validateLabel(element, floatLabelType) {
328
332
  const parent = getParentNode(element);
329
333
  if (parent.classList.contains(CLASSNAMES.FLOATINPUT) && floatLabelType === 'Auto') {
@@ -379,7 +383,7 @@ var Input;
379
383
  if (!isNullOrUndefined(parentElement)) {
380
384
  const button = parentElement.getElementsByClassName(CLASSNAMES.CLEARICON)[0];
381
385
  if (!isNullOrUndefined(button)) {
382
- if (element.value && parentElement.classList.contains('e-input-focus')) {
386
+ if (element.value && !isNullOrUndefined(parentElement) && parentElement.classList.contains('e-input-focus')) {
383
387
  removeClass([button], CLASSNAMES.CLEARICONHIDE);
384
388
  }
385
389
  else {
@@ -896,6 +900,7 @@ const CONTROL = 'e-control';
896
900
  const NUMERIC_FOCUS = 'e-input-focus';
897
901
  const HIDDENELEMENT = 'e-numeric-hidden';
898
902
  const wrapperAttributes = ['title', 'style', 'class'];
903
+ let selectionTimeOut = 0;
899
904
  /**
900
905
  * Represents the NumericTextBox component that allows the user to enter only numeric values.
901
906
  * ```html
@@ -956,7 +961,7 @@ let NumericTextBox = class NumericTextBox extends Component {
956
961
  this.element = input;
957
962
  setValue('ej2_instances', ejInstance, this.element);
958
963
  }
959
- attributes(this.element, { 'role': 'spinbutton', 'tabindex': '0', 'autocomplete': 'off', 'aria-live': 'assertive' });
964
+ attributes(this.element, { 'role': 'spinbutton', 'tabindex': '0', 'autocomplete': 'off' });
960
965
  const localeText = {
961
966
  incrementTitle: 'Increment value', decrementTitle: 'Decrement value', placeholder: this.placeholder
962
967
  };
@@ -1157,7 +1162,7 @@ let NumericTextBox = class NumericTextBox extends Component {
1157
1162
  }
1158
1163
  for (const key of Object.keys(attr)) {
1159
1164
  if (key.indexOf('data') === 0) {
1160
- this.hiddenInput.setAttribute(key, attr[key]);
1165
+ this.hiddenInput.setAttribute(key, attr[`${key}`]);
1161
1166
  }
1162
1167
  }
1163
1168
  }
@@ -1165,7 +1170,7 @@ let NumericTextBox = class NumericTextBox extends Component {
1165
1170
  if (!isNullOrUndefined(this.htmlAttributes)) {
1166
1171
  for (const pro of Object.keys(this.htmlAttributes)) {
1167
1172
  if (wrapperAttributes.indexOf(pro) < 0) {
1168
- this.element.setAttribute(pro, this.htmlAttributes[pro]);
1173
+ this.element.setAttribute(pro, this.htmlAttributes[`${pro}`]);
1169
1174
  }
1170
1175
  }
1171
1176
  }
@@ -1185,19 +1190,19 @@ let NumericTextBox = class NumericTextBox extends Component {
1185
1190
  for (const pro of Object.keys(this.htmlAttributes)) {
1186
1191
  if (wrapperAttributes.indexOf(pro) > -1) {
1187
1192
  if (pro === 'class') {
1188
- const updatedClassValue = this.getNumericValidClassList(this.htmlAttributes[pro]);
1193
+ const updatedClassValue = this.getNumericValidClassList(this.htmlAttributes[`${pro}`]);
1189
1194
  if (updatedClassValue !== '') {
1190
1195
  addClass([this.container], updatedClassValue.split(' '));
1191
1196
  }
1192
1197
  }
1193
1198
  else if (pro === 'style') {
1194
1199
  let numericStyle = this.container.getAttribute(pro);
1195
- numericStyle = !isNullOrUndefined(numericStyle) ? (numericStyle + this.htmlAttributes[pro]) :
1196
- this.htmlAttributes[pro];
1200
+ numericStyle = !isNullOrUndefined(numericStyle) ? (numericStyle + this.htmlAttributes[`${pro}`]) :
1201
+ this.htmlAttributes[`${pro}`];
1197
1202
  this.container.setAttribute(pro, numericStyle);
1198
1203
  }
1199
1204
  else {
1200
- this.container.setAttribute(pro, this.htmlAttributes[pro]);
1205
+ this.container.setAttribute(pro, this.htmlAttributes[`${pro}`]);
1201
1206
  }
1202
1207
  }
1203
1208
  }
@@ -1530,8 +1535,8 @@ let NumericTextBox = class NumericTextBox extends Component {
1530
1535
  let current = this.instance.getNumberParser({ format: 'n' })(this.element.value);
1531
1536
  const previous = this.instance.getNumberParser({ format: 'n' })(this.elementPrevValue);
1532
1537
  //EJ2-54963-if type "." or ".0" or "-.0" it converts to "0" automatically when binding v-model
1533
- const nonZeroRegex = new RegExp('[^1-9]+$');
1534
- if (nonZeroRegex.test(this.element.value)) {
1538
+ const nonZeroRegex = new RegExp('[^0-9]+$');
1539
+ if (nonZeroRegex.test(this.element.value) || ((this.elementPrevValue.indexOf('.') !== -1 || this.elementPrevValue.indexOf('-') !== -1) && this.element.value[this.element.value.length - 1] === '0')) {
1535
1540
  current = this.value;
1536
1541
  }
1537
1542
  const eventArgs = {
@@ -1742,6 +1747,7 @@ let NumericTextBox = class NumericTextBox extends Component {
1742
1747
  if (this.decimals && this.validateDecimalOnType) {
1743
1748
  fractionRule = '{0,' + this.decimals + '}';
1744
1749
  }
1750
+ // eslint-disable-next-line detect-non-literal-regexp
1745
1751
  return new RegExp('^(-)?(((\\d+(' + decimalSeparator + '\\d' + fractionRule +
1746
1752
  ')?)|(' + decimalSeparator + '\\d' + fractionRule + ')))?$');
1747
1753
  }
@@ -1765,6 +1771,7 @@ let NumericTextBox = class NumericTextBox extends Component {
1765
1771
  this.cancelEvent(event);
1766
1772
  }
1767
1773
  focusHandler(event) {
1774
+ clearTimeout(selectionTimeOut);
1768
1775
  this.focusEventArgs = { event: event, value: this.value, container: this.container };
1769
1776
  this.trigger('focus', this.focusEventArgs);
1770
1777
  if (!this.enabled || this.readonly) {
@@ -1782,7 +1789,7 @@ let NumericTextBox = class NumericTextBox extends Component {
1782
1789
  }
1783
1790
  else {
1784
1791
  const delay = (Browser.isDevice && Browser.isIos) ? 600 : 0;
1785
- setTimeout(() => {
1792
+ selectionTimeOut = setTimeout(() => {
1786
1793
  this.element.setSelectionRange(0, formatValue.length);
1787
1794
  }, delay);
1788
1795
  }
@@ -1954,13 +1961,22 @@ let NumericTextBox = class NumericTextBox extends Component {
1954
1961
  }
1955
1962
  const attrArray = ['aria-labelledby', 'role', 'autocomplete', 'aria-readonly',
1956
1963
  'aria-disabled', 'autocapitalize', 'spellcheck', 'aria-autocomplete', 'tabindex',
1957
- 'aria-valuemin', 'aria-valuemax', 'aria-live', 'aria-valuenow', 'aria-invalid'];
1964
+ 'aria-valuemin', 'aria-valuemax', 'aria-valuenow', 'aria-invalid'];
1958
1965
  for (let i = 0; i < attrArray.length; i++) {
1959
1966
  this.element.removeAttribute(attrArray[i]);
1960
1967
  }
1961
1968
  this.element.classList.remove('e-input');
1962
1969
  this.container.insertAdjacentElement('afterend', this.element);
1963
1970
  detach(this.container);
1971
+ this.spinUp = null;
1972
+ this.spinDown = null;
1973
+ this.container = null;
1974
+ this.hiddenInput = null;
1975
+ this.changeEventArgs = null;
1976
+ this.blurEventArgs = null;
1977
+ this.focusEventArgs = null;
1978
+ this.inputWrapper = null;
1979
+ Input.destroy();
1964
1980
  super.destroy();
1965
1981
  }
1966
1982
  /* eslint-disable valid-jsdoc, jsdoc/require-returns */
@@ -2025,6 +2041,7 @@ let NumericTextBox = class NumericTextBox extends Component {
2025
2041
  break;
2026
2042
  case 'enabled':
2027
2043
  Input.setEnabled(newProp.enabled, this.element);
2044
+ this.bindClearEvent();
2028
2045
  break;
2029
2046
  case 'enableRtl':
2030
2047
  Input.setEnableRtl(newProp.enableRtl, [this.container]);
@@ -2301,6 +2318,7 @@ function createMask() {
2301
2318
  if (!isNullOrUndefined(this.customCharacters)) {
2302
2319
  for (let i = 0; i < this.promptMask.length; i++) {
2303
2320
  if (!isNullOrUndefined(this.customCharacters[this.promptMask[i]])) {
2321
+ // eslint-disable-next-line detect-non-literal-regexp
2304
2322
  this.promptMask = this.promptMask.replace(new RegExp(this.promptMask[i], 'g'), this.promptChar);
2305
2323
  }
2306
2324
  }
@@ -2495,7 +2513,7 @@ function maskInputFocusHandler(event) {
2495
2513
  event: event,
2496
2514
  value: this.value,
2497
2515
  maskedValue: inputElement.value,
2498
- container: this.inputObj.container,
2516
+ container: !isNullOrUndefined(this.inputObj) ? this.inputObj.container : this.inputObj,
2499
2517
  selectionEnd: inputElement.selectionEnd
2500
2518
  };
2501
2519
  if (!this.isClicked) {
@@ -2562,21 +2580,21 @@ function maskInputFocusHandler(event) {
2562
2580
  event: event,
2563
2581
  value: this.value,
2564
2582
  maskedValue: inputElement.value,
2565
- container: this.inputObj.container,
2583
+ container: !isNullOrUndefined(this.inputObj) ? this.inputObj.container : this.inputObj,
2566
2584
  selectionEnd: inputElement.selectionEnd
2567
2585
  };
2568
2586
  triggerFocus.call(this, eventArgs, inputElement);
2569
- });
2587
+ }, 110);
2570
2588
  break;
2571
2589
  }
2572
2590
  }
2573
- if (isNullOrUndefined(inputElement.value.match(this.promptChar))) {
2591
+ if (isNullOrUndefined(inputElement.value.match(escapeRegExp(this.promptChar)))) {
2574
2592
  eventArgs = {
2575
2593
  selectionStart: inputElement.selectionStart,
2576
2594
  event: event,
2577
2595
  value: this.value,
2578
2596
  maskedValue: inputElement.value,
2579
- container: this.inputObj.container,
2597
+ container: !isNullOrUndefined(this.inputObj) ? this.inputObj.container : this.inputObj,
2580
2598
  selectionEnd: inputElement.selectionEnd
2581
2599
  };
2582
2600
  triggerFocus.call(this, eventArgs, inputElement);
@@ -2591,12 +2609,15 @@ function triggerFocus(eventArgs, inputElement) {
2591
2609
  inputElement.selectionEnd = eventArgs.selectionEnd;
2592
2610
  });
2593
2611
  }
2612
+ function escapeRegExp(text) {
2613
+ return !isNullOrUndefined(text) ? text.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&') : text;
2614
+ }
2594
2615
  function maskInputBlurHandler(event) {
2595
2616
  this.blurEventArgs = {
2596
2617
  event: event,
2597
2618
  value: this.value,
2598
2619
  maskedValue: this.element.value,
2599
- container: this.inputObj.container
2620
+ container: !isNullOrUndefined(this.inputObj) ? this.inputObj.container : this.inputObj,
2600
2621
  };
2601
2622
  this.trigger('blur', this.blurEventArgs);
2602
2623
  if (this.mask) {
@@ -2829,8 +2850,8 @@ function removeMaskInputValues(event) {
2829
2850
  ++startIndex;
2830
2851
  }
2831
2852
  let oldValue = this.element.value[sIndex];
2832
- if ((isNullOrUndefined(this.regExpCollec[curMask]) && (!isNullOrUndefined(this.customCharacters)
2833
- && isNullOrUndefined(this.customCharacters[curMask]))
2853
+ if ((isNullOrUndefined(this.regExpCollec[`${curMask}`]) && (!isNullOrUndefined(this.customCharacters)
2854
+ && isNullOrUndefined(this.customCharacters[`${curMask}`]))
2834
2855
  && ((this.hiddenMask[sIndex] !== this.promptChar && this.customRegExpCollec[sIndex][0] !== '['
2835
2856
  && this.customRegExpCollec[sIndex][this.customRegExpCollec[sIndex].length - 1] !== ']')))
2836
2857
  || (this.promptMask[sIndex] !== this.promptChar && isNullOrUndefined(this.customCharacters))) {
@@ -3042,8 +3063,8 @@ function validateValue(key, isCtrlKey, event) {
3042
3063
  if (this.hiddenMask[startIndex] === '\\' && this.hiddenMask[startIndex + 1] === key) {
3043
3064
  isEqualVal = true;
3044
3065
  }
3045
- if ((isNullOrUndefined(this.regExpCollec[curMask]) && (isNullOrUndefined(this.customCharacters)
3046
- || (!isNullOrUndefined(this.customCharacters) && isNullOrUndefined(this.customCharacters[curMask])))
3066
+ if ((isNullOrUndefined(this.regExpCollec[`${curMask}`]) && (isNullOrUndefined(this.customCharacters)
3067
+ || (!isNullOrUndefined(this.customCharacters) && isNullOrUndefined(this.customCharacters[`${curMask}`])))
3047
3068
  && ((this.hiddenMask[startIndex] !== this.promptChar && this.customRegExpCollec[startIndex][0] !== '['
3048
3069
  && this.customRegExpCollec[startIndex][this.customRegExpCollec[startIndex].length - 1] !== ']')))
3049
3070
  || ((this.promptMask[startIndex] !== this.promptChar) && isNullOrUndefined(this.customCharacters))
@@ -3053,22 +3074,25 @@ function validateValue(key, isCtrlKey, event) {
3053
3074
  curMask = this.hiddenMask[startIndex];
3054
3075
  }
3055
3076
  }
3056
- if (!isNullOrUndefined(this.customCharacters) && !isNullOrUndefined(this.customCharacters[curMask])) {
3057
- const customValStr = this.customCharacters[curMask];
3077
+ if (!isNullOrUndefined(this.customCharacters) && !isNullOrUndefined(this.customCharacters[`${curMask}`])) {
3078
+ const customValStr = this.customCharacters[`${curMask}`];
3058
3079
  const customValArr = customValStr.split(',');
3059
3080
  for (let i = 0; i < customValArr.length; i++) {
3081
+ // eslint-disable-next-line detect-non-literal-regexp
3060
3082
  if (keyValue.match(new RegExp('[' + customValArr[i] + ']'))) {
3061
3083
  allowText = true;
3062
3084
  break;
3063
3085
  }
3064
3086
  }
3087
+ // eslint-disable-next-line detect-non-literal-regexp
3065
3088
  }
3066
- else if (!isNullOrUndefined(this.regExpCollec[curMask]) && keyValue.match(new RegExp(this.regExpCollec[curMask]))
3089
+ else if (!isNullOrUndefined(this.regExpCollec[`${curMask}`]) && keyValue.match(new RegExp(this.regExpCollec[`${curMask}`]))
3067
3090
  && this.promptMask[startIndex] === this.promptChar) {
3068
3091
  allowText = true;
3069
3092
  }
3070
3093
  else if (this.promptMask[startIndex] === this.promptChar && this.customRegExpCollec[startIndex][0] === '['
3071
3094
  && this.customRegExpCollec[startIndex][this.customRegExpCollec[startIndex].length - 1] === ']'
3095
+ // eslint-disable-next-line detect-non-literal-regexp
3072
3096
  && keyValue.match(new RegExp(this.customRegExpCollec[startIndex]))) {
3073
3097
  allowText = true;
3074
3098
  }
@@ -3513,7 +3537,7 @@ let MaskedTextBox = class MaskedTextBox extends Component {
3513
3537
  if (!isNullOrUndefined(this.htmlAttributes)) {
3514
3538
  for (const key of Object.keys(this.htmlAttributes)) {
3515
3539
  if (wrapperAttr.indexOf(key) < 0) {
3516
- this.element.setAttribute(key, this.htmlAttributes[key]);
3540
+ this.element.setAttribute(key, this.htmlAttributes[`${key}`]);
3517
3541
  }
3518
3542
  }
3519
3543
  }
@@ -3533,19 +3557,19 @@ let MaskedTextBox = class MaskedTextBox extends Component {
3533
3557
  for (const key of Object.keys(this.htmlAttributes)) {
3534
3558
  if (wrapperAttr.indexOf(key) > -1) {
3535
3559
  if (key === 'class') {
3536
- const updatedClassValues = (this.htmlAttributes[key].replace(/\s+/g, ' ')).trim();
3560
+ const updatedClassValues = (this.htmlAttributes[`${key}`].replace(/\s+/g, ' ')).trim();
3537
3561
  if (updatedClassValues !== '') {
3538
3562
  addClass([this.inputObj.container], updatedClassValues.split(' '));
3539
3563
  }
3540
3564
  }
3541
3565
  else if (key === 'style') {
3542
3566
  let maskStyle = this.inputObj.container.getAttribute(key);
3543
- maskStyle = !isNullOrUndefined(maskStyle) ? (maskStyle + this.htmlAttributes[key]) :
3544
- this.htmlAttributes[key];
3567
+ maskStyle = !isNullOrUndefined(maskStyle) ? (maskStyle + this.htmlAttributes[`${key}`]) :
3568
+ this.htmlAttributes[`${key}`];
3545
3569
  this.inputObj.container.setAttribute(key, maskStyle);
3546
3570
  }
3547
3571
  else {
3548
- this.inputObj.container.setAttribute(key, this.htmlAttributes[key]);
3572
+ this.inputObj.container.setAttribute(key, this.htmlAttributes[`${key}`]);
3549
3573
  }
3550
3574
  }
3551
3575
  }
@@ -3720,10 +3744,13 @@ let MaskedTextBox = class MaskedTextBox extends Component {
3720
3744
  else {
3721
3745
  this.promptChar = '_';
3722
3746
  }
3747
+ // eslint-disable-next-line detect-non-literal-regexp
3723
3748
  let value = this.element.value.replace(new RegExp('[' + oldProp.promptChar + ']', 'g'), this.promptChar);
3724
3749
  if (this.promptMask === this.element.value) {
3750
+ // eslint-disable-next-line detect-non-literal-regexp
3725
3751
  value = this.promptMask.replace(new RegExp('[' + oldProp.promptChar + ']', 'g'), this.promptChar);
3726
3752
  }
3753
+ // eslint-disable-next-line detect-non-literal-regexp
3727
3754
  this.promptMask = this.promptMask.replace(new RegExp('[' + oldProp.promptChar + ']', 'g'), this.promptChar);
3728
3755
  this.undoCollec = this.redoCollec = [];
3729
3756
  setElementValue.call(this, value);
@@ -3785,8 +3812,14 @@ let MaskedTextBox = class MaskedTextBox extends Component {
3785
3812
  this.element.removeAttribute(attrArray[i]);
3786
3813
  }
3787
3814
  this.element.classList.remove('e-input');
3788
- this.inputObj.container.insertAdjacentElement('afterend', this.element);
3789
- detach(this.inputObj.container);
3815
+ if (this.inputObj) {
3816
+ this.inputObj.container.insertAdjacentElement('afterend', this.element);
3817
+ detach(this.inputObj.container);
3818
+ }
3819
+ this.blurEventArgs = null;
3820
+ Input.destroy();
3821
+ this.changeEventArgs = null;
3822
+ this.inputObj = null;
3790
3823
  super.destroy();
3791
3824
  }
3792
3825
  };
@@ -4338,7 +4371,7 @@ let Slider = class Slider extends Component {
4338
4371
  createSecondHandle() {
4339
4372
  this.secondHandle = this.createElement('div', {
4340
4373
  attrs: {
4341
- class: classNames.sliderHandle, 'role': 'slider', tabIndex: '0'
4374
+ class: classNames.sliderHandle, 'role': 'slider', tabIndex: '0', 'aria-label': 'slider'
4342
4375
  }
4343
4376
  });
4344
4377
  this.secondHandle.classList.add(classNames.sliderSecondHandle);
@@ -4347,7 +4380,7 @@ let Slider = class Slider extends Component {
4347
4380
  createFirstHandle() {
4348
4381
  this.firstHandle = this.createElement('div', {
4349
4382
  attrs: {
4350
- class: classNames.sliderHandle, 'role': 'slider', tabIndex: '0'
4383
+ class: classNames.sliderHandle, 'role': 'slider', tabIndex: '0', 'aria-label': 'slider'
4351
4384
  }
4352
4385
  });
4353
4386
  this.firstHandle.classList.add(classNames.sliderFirstHandle);
@@ -4774,6 +4807,7 @@ let Slider = class Slider extends Component {
4774
4807
  this.sliderContainer.classList.add(classNames.materialSlider);
4775
4808
  this.tooltipValue();
4776
4809
  this.tooltipObj.animation.close.effect = 'None';
4810
+ // eslint-disable-next-line security/detect-non-literal-fs-filename -- Safe as no value holds user input
4777
4811
  this.tooltipObj.open(this.firstHandle);
4778
4812
  }
4779
4813
  }
@@ -6097,6 +6131,7 @@ let Slider = class Slider extends Component {
6097
6131
  openTooltip(target) {
6098
6132
  if (this.tooltip.isVisible && this.tooltipObj && !this.isMaterialTooltip) {
6099
6133
  this.tooltipValue();
6134
+ // eslint-disable-next-line security/detect-non-literal-fs-filename -- Safe as no value holds user input
6100
6135
  this.tooltipObj.open(target);
6101
6136
  this.tooltipTarget = target;
6102
6137
  }
@@ -7796,7 +7831,7 @@ let Uploader = class Uploader extends Component {
7796
7831
  getKeyValue(val) {
7797
7832
  let keyValue;
7798
7833
  for (const key of Object.keys(this.preLocaleObj)) {
7799
- if (this.preLocaleObj[key] === val) {
7834
+ if (this.preLocaleObj[`${key}`] === val) {
7800
7835
  keyValue = key;
7801
7836
  }
7802
7837
  }
@@ -7847,7 +7882,7 @@ let Uploader = class Uploader extends Component {
7847
7882
  }
7848
7883
  }
7849
7884
  preRender() {
7850
- this.localeText = { Browse: 'Browse...', Clear: 'Clear', Upload: 'Upload',
7885
+ this.localeText = { Browse: 'Browse...', Clear: 'Clear', Upload: 'Upload', invalidFileName: 'File Name is not allowed',
7851
7886
  dropFilesHint: 'Or drop files here', invalidMaxFileSize: 'File size is too large',
7852
7887
  invalidMinFileSize: 'File size is too small', invalidFileType: 'File type is not allowed',
7853
7888
  uploadFailedMessage: 'File failed to upload', uploadSuccessMessage: 'File uploaded successfully',
@@ -8172,7 +8207,7 @@ let Uploader = class Uploader extends Component {
8172
8207
  if (!isNullOrUndefined(this.htmlAttributes)) {
8173
8208
  for (const pro of Object.keys(this.htmlAttributes)) {
8174
8209
  if (wrapperAttr$1.indexOf(pro) < 0) {
8175
- this.element.setAttribute(pro, this.htmlAttributes[pro]);
8210
+ this.element.setAttribute(pro, this.htmlAttributes[`${pro}`]);
8176
8211
  }
8177
8212
  }
8178
8213
  }
@@ -8182,19 +8217,19 @@ let Uploader = class Uploader extends Component {
8182
8217
  for (const pro of Object.keys(this.htmlAttributes)) {
8183
8218
  if (wrapperAttr$1.indexOf(pro) > -1) {
8184
8219
  if (pro === 'class') {
8185
- const updatedClassValues = (this.htmlAttributes[pro].replace(/\s+/g, ' ')).trim();
8220
+ const updatedClassValues = (this.htmlAttributes[`${pro}`].replace(/\s+/g, ' ')).trim();
8186
8221
  if (updatedClassValues !== '') {
8187
8222
  addClass([this.uploadWrapper], updatedClassValues.split(' '));
8188
8223
  }
8189
8224
  }
8190
8225
  else if (pro === 'style') {
8191
8226
  let uploadStyle = this.uploadWrapper.getAttribute(pro);
8192
- uploadStyle = !isNullOrUndefined(uploadStyle) ? (uploadStyle + this.htmlAttributes[pro]) :
8193
- this.htmlAttributes[pro];
8227
+ uploadStyle = !isNullOrUndefined(uploadStyle) ? (uploadStyle + this.htmlAttributes[`${pro}`]) :
8228
+ this.htmlAttributes[`${pro}`];
8194
8229
  this.uploadWrapper.setAttribute(pro, uploadStyle);
8195
8230
  }
8196
8231
  else {
8197
- this.uploadWrapper.setAttribute(pro, this.htmlAttributes[pro]);
8232
+ this.uploadWrapper.setAttribute(pro, this.htmlAttributes[`${pro}`]);
8198
8233
  }
8199
8234
  }
8200
8235
  }
@@ -8229,7 +8264,9 @@ let Uploader = class Uploader extends Component {
8229
8264
  sequenceUpload(fileData) {
8230
8265
  if (this.filesData.length - fileData.length === 0 ||
8231
8266
  this.filesData[(this.filesData.length - fileData.length - 1)].statusCode !== '1') {
8232
- ++this.count;
8267
+ if (this.multiple || this.count < 0) {
8268
+ ++this.count;
8269
+ }
8233
8270
  const isFileListCreated = this.showFileList ? false : true;
8234
8271
  if (typeof this.filesData[this.count] === 'object') {
8235
8272
  this.isFirstFileOnSelection = false;
@@ -8576,7 +8613,7 @@ let Uploader = class Uploader extends Component {
8576
8613
  const data = customData[i];
8577
8614
  // eslint-disable-next-line @typescript-eslint/tslint/config
8578
8615
  const value = Object.keys(data).map(function (e) {
8579
- return data[e];
8616
+ return data[`${e}`];
8580
8617
  });
8581
8618
  formData.append(Object.keys(data)[0], value);
8582
8619
  }
@@ -8589,7 +8626,7 @@ let Uploader = class Uploader extends Component {
8589
8626
  const data = currentRequest[i];
8590
8627
  // eslint-disable-next-line @typescript-eslint/tslint/config
8591
8628
  const value = Object.keys(data).map(function (e) {
8592
- return data[e];
8629
+ return data[`${e}`];
8593
8630
  });
8594
8631
  request.setRequestHeader(Object.keys(data)[0], value);
8595
8632
  }
@@ -8786,6 +8823,20 @@ let Uploader = class Uploader extends Component {
8786
8823
  if (this.allowedExtensions.indexOf('*') > -1) {
8787
8824
  this.allTypes = true;
8788
8825
  }
8826
+ if (this.enableHtmlSanitizer) {
8827
+ for (let i = 0; i < fileData.length; i++) {
8828
+ let sanitizeFile = SanitizeHtmlHelper.beforeSanitize();
8829
+ let sanitizeFileName = SanitizeHtmlHelper.serializeValue(sanitizeFile, fileData[i].name);
8830
+ if (sanitizeFileName != fileData[i].name) {
8831
+ let encodedFileName = targetFiles[i].name.replace(/[\u00A0-\u9999<>\&]/g, function (i) {
8832
+ return '&#' + i.charCodeAt(0) + ';';
8833
+ });
8834
+ fileData[i].name = encodedFileName;
8835
+ fileData[i].status = this.localizedTexts('invalidFileName');
8836
+ fileData[i].statusCode = '0';
8837
+ }
8838
+ }
8839
+ }
8789
8840
  if (!this.allTypes) {
8790
8841
  fileData = this.checkExtension(fileData);
8791
8842
  }
@@ -9549,7 +9600,9 @@ let Uploader = class Uploader extends Component {
9549
9600
  this.pauseButton = null;
9550
9601
  }
9551
9602
  /* istanbul ignore next */
9552
- liElement.classList.add(RESTRICT_RETRY);
9603
+ if (!isNullOrUndefined(liElement)) {
9604
+ liElement.classList.add(RESTRICT_RETRY);
9605
+ }
9553
9606
  this.upload([file]);
9554
9607
  }
9555
9608
  /* istanbul ignore next */
@@ -10365,6 +10418,14 @@ let Uploader = class Uploader extends Component {
10365
10418
  detach(this.uploadWrapper);
10366
10419
  }
10367
10420
  this.uploadWrapper = null;
10421
+ this.uploadWrapper = null;
10422
+ this.browseButton = null;
10423
+ this.dropAreaWrapper = null;
10424
+ this.dropZoneElement = null;
10425
+ this.dropArea = null;
10426
+ this.keyboardModule = null;
10427
+ this.clearButton = null;
10428
+ this.uploadButton = null;
10368
10429
  super.destroy();
10369
10430
  }
10370
10431
  /**
@@ -10853,6 +10914,9 @@ __decorate$4([
10853
10914
  __decorate$4([
10854
10915
  Property(true)
10855
10916
  ], Uploader.prototype, "autoUpload", void 0);
10917
+ __decorate$4([
10918
+ Property(true)
10919
+ ], Uploader.prototype, "enableHtmlSanitizer", void 0);
10856
10920
  __decorate$4([
10857
10921
  Complex({}, ButtonsProps)
10858
10922
  ], Uploader.prototype, "buttons", void 0);
@@ -11463,7 +11527,7 @@ let ColorPicker = class ColorPicker extends Component {
11463
11527
  if (!wrapper.classList.contains(HIDEHEX)) {
11464
11528
  const hexInput = this.createElement('input', {
11465
11529
  className: HEX,
11466
- attrs: { 'maxlength': '7', 'spellcheck': 'false' }
11530
+ attrs: { 'maxlength': '7', 'spellcheck': 'false', 'aria-label': 'HEX' }
11467
11531
  });
11468
11532
  container.appendChild(hexInput);
11469
11533
  Input.createInput({
@@ -11505,7 +11569,8 @@ let ColorPicker = class ColorPicker extends Component {
11505
11569
  }
11506
11570
  appendValueSwitchBtn(targetEle) {
11507
11571
  const valueSwitchBtn = this.createElement('button', {
11508
- className: 'e-icons e-css e-btn e-flat e-icon-btn ' + FORMATSWITCH
11572
+ className: 'e-icons e-css e-btn e-flat e-icon-btn ' + FORMATSWITCH,
11573
+ attrs: { 'title': 'Toggle format' }
11509
11574
  });
11510
11575
  targetEle.appendChild(valueSwitchBtn);
11511
11576
  if (this.isPicker() && !this.getWrapper().classList.contains(HIDERGBA)) {
@@ -11556,6 +11621,7 @@ let ColorPicker = class ColorPicker extends Component {
11556
11621
  });
11557
11622
  tooltip.createElement = this.createElement;
11558
11623
  tooltip.appendTo(this.container);
11624
+ // eslint-disable-next-line
11559
11625
  tooltip.open(this.container);
11560
11626
  this.tooltipEle.style.zIndex = getZindexPartial(this.tooltipEle).toString();
11561
11627
  select('.e-tip-content', this.tooltipEle).appendChild(this.createElement('div', { className: 'e-tip-transparent' }));
@@ -13071,7 +13137,7 @@ let TextBox = class TextBox extends Component {
13071
13137
  }
13072
13138
  break;
13073
13139
  case 'value':
13074
- if ((isNullOrUndefined(this.textboxOptions) || (this.textboxOptions['value'] === undefined)) || isDynamic) {
13140
+ if (((isNullOrUndefined(this.textboxOptions) || (this.textboxOptions['value'] === undefined)) || isDynamic) && this.element.value !== '') {
13075
13141
  this.setProperties({ value: this.element.value }, !isDynamic);
13076
13142
  }
13077
13143
  break;
@@ -13143,19 +13209,19 @@ let TextBox = class TextBox extends Component {
13143
13209
  for (const key of Object.keys(this.htmlAttributes)) {
13144
13210
  if (containerAttr.indexOf(key) > -1) {
13145
13211
  if (key === 'class') {
13146
- const updatedClassValues = this.getInputValidClassList(this.htmlAttributes[key]);
13212
+ const updatedClassValues = this.getInputValidClassList(this.htmlAttributes[`${key}`]);
13147
13213
  if (updatedClassValues !== '') {
13148
13214
  addClass([this.textboxWrapper.container], updatedClassValues.split(' '));
13149
13215
  }
13150
13216
  }
13151
13217
  else if (key === 'style') {
13152
13218
  let setStyle = this.textboxWrapper.container.getAttribute(key);
13153
- setStyle = !isNullOrUndefined(setStyle) ? (setStyle + this.htmlAttributes[key]) :
13154
- this.htmlAttributes[key];
13219
+ setStyle = !isNullOrUndefined(setStyle) ? (setStyle + this.htmlAttributes[`${key}`]) :
13220
+ this.htmlAttributes[`${key}`];
13155
13221
  this.textboxWrapper.container.setAttribute(key, setStyle);
13156
13222
  }
13157
13223
  else {
13158
- this.textboxWrapper.container.setAttribute(key, this.htmlAttributes[key]);
13224
+ this.textboxWrapper.container.setAttribute(key, this.htmlAttributes[`${key}`]);
13159
13225
  }
13160
13226
  }
13161
13227
  }
@@ -13165,7 +13231,7 @@ let TextBox = class TextBox extends Component {
13165
13231
  if (!isNullOrUndefined(this.htmlAttributes)) {
13166
13232
  for (const key of Object.keys(this.htmlAttributes)) {
13167
13233
  if (containerAttr.indexOf(key) < 0) {
13168
- this.element.setAttribute(key, this.htmlAttributes[key]);
13234
+ this.element.setAttribute(key, this.htmlAttributes[`${key}`]);
13169
13235
  }
13170
13236
  }
13171
13237
  }
@@ -13371,6 +13437,7 @@ let TextBox = class TextBox extends Component {
13371
13437
  detach(this.textboxWrapper.container);
13372
13438
  }
13373
13439
  this.textboxWrapper = null;
13440
+ Input.destroy();
13374
13441
  super.destroy();
13375
13442
  }
13376
13443
  /**
@@ -13411,17 +13478,17 @@ let TextBox = class TextBox extends Component {
13411
13478
  Input.setReadonly(this.readonly, this.respectiveElement);
13412
13479
  }
13413
13480
  else if (key === 'class') {
13414
- this.respectiveElement.classList.add(attributes$$1[key]);
13481
+ this.respectiveElement.classList.add(attributes$$1[`${key}`]);
13415
13482
  }
13416
13483
  else if (key === 'placeholder') {
13417
- this.setProperties({ placeholder: attributes$$1[key] }, true);
13484
+ this.setProperties({ placeholder: attributes$$1[`${key}`] }, true);
13418
13485
  Input.setPlaceholder(this.placeholder, this.respectiveElement);
13419
13486
  }
13420
13487
  else if (key === 'rows' && this.respectiveElement.tagName === 'TEXTAREA') {
13421
- this.respectiveElement.setAttribute(key, attributes$$1[key]);
13488
+ this.respectiveElement.setAttribute(key, attributes$$1[`${key}`]);
13422
13489
  }
13423
13490
  else {
13424
- this.respectiveElement.setAttribute(key, attributes$$1[key]);
13491
+ this.respectiveElement.setAttribute(key, attributes$$1[`${key}`]);
13425
13492
  }
13426
13493
  }
13427
13494
  }
@@ -13573,7 +13640,7 @@ class SignatureBase extends Component {
13573
13640
  initialize(element, dotnetRef) {
13574
13641
  this.element = element;
13575
13642
  this.canvasContext = this.element.getContext('2d');
13576
- this.canvasContext.canvas.tabIndex = 0;
13643
+ this.canvasContext.canvas.tabIndex = -1;
13577
13644
  if (dotnetRef) {
13578
13645
  this.dotnetRef = dotnetRef;
13579
13646
  this.isBlazor = true;
@@ -13630,6 +13697,7 @@ class SignatureBase extends Component {
13630
13697
  this.canvasContext.canvas.style.backgroundColor = this.backgroundColor;
13631
13698
  }
13632
13699
  }
13700
+ // eslint-disable-next-line
13633
13701
  mouseDownHandler(e, canvas, panStart, zoomState) {
13634
13702
  if (e.buttons === 1 || e.buttons === 2 || e.type === 'touchstart') {
13635
13703
  if (e.type === 'touchstart') {
@@ -13959,20 +14027,14 @@ class SignatureBase extends Component {
13959
14027
  enableOrDisable(isDisable) {
13960
14028
  this.disabled = isDisable;
13961
14029
  if (isDisable) {
13962
- this.reDraw('0.5');
14030
+ this.canvasContext.canvas.style.filter = "opacity(0.5)";
13963
14031
  this.isRead(true);
13964
14032
  }
13965
14033
  else {
13966
- this.reDraw('1');
14034
+ this.canvasContext.canvas.style.filter = "";
13967
14035
  this.isRead(false);
13968
14036
  }
13969
14037
  }
13970
- reDraw(opacity) {
13971
- const data = this.canvasContext.getImageData(0, 0, this.element.width, this.element.height);
13972
- this.canvasContext.clearRect(0, 0, this.element.width, this.element.height);
13973
- this.element.style.opacity = opacity;
13974
- this.canvasContext.putImageData(data, 0, 0);
13975
- }
13976
14038
  updateSnapCollection(isClear) {
13977
14039
  if (isNullOrUndefined(this.incStep)) {
13978
14040
  this.incStep = -1;
@@ -14649,6 +14711,766 @@ Signature = __decorate$7([
14649
14711
  * Signature modules
14650
14712
  */
14651
14713
 
14714
+ var __decorate$8 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
14715
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
14716
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
14717
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
14718
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
14719
+ };
14720
+ const ICONCSS = 'e-rating-icon e-icons e-star-filled';
14721
+ const ITEMLIST = 'e-rating-item-list';
14722
+ const ITEMCONTAINER = 'e-rating-item-container';
14723
+ const SELECTED = 'e-rating-selected';
14724
+ const INTERMEDIATE = 'e-rating-intermediate';
14725
+ const LABEL = 'e-rating-label';
14726
+ const RESET = 'e-icons e-reset';
14727
+ const HIDDEN = 'e-rating-hidden';
14728
+ const DISABLED$2 = 'e-disabled';
14729
+ const READONLY = 'e-rating-readonly';
14730
+ const RTL$2 = 'e-rtl';
14731
+ const ANIMATION = 'e-rating-animation';
14732
+ const FULLTEMPLATE = 'e-rating-full';
14733
+ const EMPTYTEMPLATE = 'e-rating-empty';
14734
+ const SELECTEDVALUE = 'e-selected-value';
14735
+ const RATINGVALUE = '--rating-value';
14736
+ /**
14737
+ * Defines the position of the label in the rating.
14738
+ */
14739
+ var LabelPosition;
14740
+ (function (LabelPosition) {
14741
+ /**
14742
+ * Shows the label above the rating.
14743
+ */
14744
+ LabelPosition["Top"] = "Top";
14745
+ /**
14746
+ * Shows the label below the rating.
14747
+ */
14748
+ LabelPosition["Bottom"] = "Bottom";
14749
+ /**
14750
+ * Shows the label to the left of rating.
14751
+ */
14752
+ LabelPosition["Left"] = "Left";
14753
+ /**
14754
+ * Shows the label to the right of rating.
14755
+ */
14756
+ LabelPosition["Right"] = "Right";
14757
+ })(LabelPosition || (LabelPosition = {}));
14758
+ /**
14759
+ * Defines the minimum increase in the value in Rating Control.
14760
+ */
14761
+ var PrecisionType;
14762
+ (function (PrecisionType) {
14763
+ /**
14764
+ * Process the value as whole numbers.
14765
+ */
14766
+ PrecisionType["Full"] = "Full";
14767
+ /**
14768
+ * Process the value in terms of 0.5 (half).
14769
+ */
14770
+ PrecisionType["Half"] = "Half";
14771
+ /**
14772
+ * Process the value in terms of 0.25 (quarter).
14773
+ */
14774
+ PrecisionType["Quarter"] = "Quarter";
14775
+ /**
14776
+ * Process the value in terms of 0.1.
14777
+ */
14778
+ PrecisionType["Exact"] = "Exact";
14779
+ })(PrecisionType || (PrecisionType = {}));
14780
+ let Rating = class Rating extends Component {
14781
+ /**
14782
+ * Constructor for creating the widget
14783
+ *
14784
+ * @param {RatingModel} options - Specifies the rating model
14785
+ * @param {string|HTMLButtonElement} element - Specifies the target element
14786
+ */
14787
+ constructor(options, element) {
14788
+ super(options, element);
14789
+ this.itemElements = [];
14790
+ this.tooltipOpen = false;
14791
+ }
14792
+ preRender() {
14793
+ if (!this.element.id) {
14794
+ this.element.id = getUniqueID('e-' + this.getModuleName());
14795
+ }
14796
+ this.keyConfigs = {
14797
+ downarrow: 'downarrow',
14798
+ leftarrow: 'leftarrow',
14799
+ rightarrow: 'rightarrow',
14800
+ uparrow: 'uparrow',
14801
+ space: 'space'
14802
+ };
14803
+ }
14804
+ render() {
14805
+ this.initialize();
14806
+ this.updateMinValue();
14807
+ this.updateTemplateFunction();
14808
+ this.renderItems();
14809
+ this.updatePrecision();
14810
+ this.displayLabel();
14811
+ }
14812
+ initialize() {
14813
+ this.wrapper = this.createElement('div', { className: 'e-' + this.getModuleName() + '-container ' });
14814
+ this.element.parentNode.insertBefore(this.wrapper, this.element);
14815
+ this.wrapper.appendChild(this.element);
14816
+ if ((this.element.getAttribute('name') == null)) {
14817
+ this.element.setAttribute('name', this.element.id);
14818
+ }
14819
+ attributes(this.element, { 'aria-label': 'rating' });
14820
+ this.renderItemList();
14821
+ this.updateReset();
14822
+ this.updateDisabled();
14823
+ this.wrapper.classList[this.readOnly ? 'add' : 'remove'](READONLY);
14824
+ this.wrapper.classList[!this.visible ? 'add' : 'remove'](HIDDEN);
14825
+ this.wrapper.classList[this.enableRtl ? 'add' : 'remove'](RTL$2);
14826
+ this.wrapper.classList[this.enableAnimation ? 'add' : 'remove'](ANIMATION);
14827
+ if (this.cssClass) {
14828
+ addClass([this.wrapper], this.cssClass.split(' '));
14829
+ }
14830
+ this.updateTooltip();
14831
+ this.wireKeyboardEvent();
14832
+ }
14833
+ updateDisabled() {
14834
+ this.wrapper.classList[this.disabled ? 'add' : 'remove'](DISABLED$2);
14835
+ attributes(this.ratingItemList, { 'tabindex': (this.disabled) ? '-1' : '0' });
14836
+ if (this.allowReset) {
14837
+ this.updateResetButton();
14838
+ }
14839
+ }
14840
+ updateResetButton() {
14841
+ const isDisabled = (this.value <= this.min) || this.disabled;
14842
+ this.resetElement.classList[isDisabled ? 'add' : 'remove'](DISABLED$2);
14843
+ attributes(this.resetElement, { 'aria-label': 'resetbutton', 'role': 'button',
14844
+ 'tabindex': (isDisabled ? '-1' : '0'), 'aria-hidden': isDisabled.toString() });
14845
+ }
14846
+ renderItemList() {
14847
+ this.ratingItemList = this.createElement('div', {
14848
+ className: ITEMLIST,
14849
+ id: this.element.id + '_item-list',
14850
+ attrs: { 'tabindex': '0' }
14851
+ });
14852
+ attributes(this.ratingItemList, { 'aria-label': 'rating', 'role': 'slider' });
14853
+ this.wrapper.appendChild(this.ratingItemList);
14854
+ EventHandler.add(this.ratingItemList, 'touchmove', (e) => this.touchMoveHandler(e), this);
14855
+ EventHandler.add(this.ratingItemList, 'touchend', this.touchEndHandler, this);
14856
+ }
14857
+ touchMoveHandler(e) {
14858
+ const rect = this.ratingItemList.getBoundingClientRect();
14859
+ const x = e.touches[0].clientX - rect.x;
14860
+ let currValue = (x / rect.width) * this.itemsCount;
14861
+ currValue = (this.enableRtl) ? (this.itemsCount - currValue) : currValue;
14862
+ currValue = currValue < this.min ? this.min : currValue > this.itemsCount ? this.itemsCount : currValue;
14863
+ currValue = this.validateValue(currValue);
14864
+ const element = currValue === 0 ? null : this.itemElements[parseInt((Math.ceil(currValue) - 1).toString(), 10)];
14865
+ if (currValue === this.currentValue) {
14866
+ if (this.showTooltip && element) {
14867
+ this.openRatingTooltip(element, false);
14868
+ }
14869
+ return;
14870
+ }
14871
+ const previousValue = this.currentValue;
14872
+ this.updateCurrentValue(currValue);
14873
+ this.triggerChange(e, currValue);
14874
+ if (this.showTooltip) {
14875
+ if (element) {
14876
+ if (Math.ceil(currValue) !== Math.ceil(previousValue)) {
14877
+ this.closeRatingTooltip();
14878
+ }
14879
+ this.openRatingTooltip(element, true);
14880
+ }
14881
+ else {
14882
+ this.closeRatingTooltip();
14883
+ }
14884
+ }
14885
+ }
14886
+ touchEndHandler() {
14887
+ this.closeRatingTooltip();
14888
+ }
14889
+ updateTemplateFunction() {
14890
+ this.emptyTemplateFunction = this.emptyTemplate ? this.getTemplateString(this.emptyTemplate) : null;
14891
+ this.fullTemplateFunction = this.fullTemplate ? this.getTemplateString(this.fullTemplate) : null;
14892
+ }
14893
+ renderItems() {
14894
+ for (let i = 0; i < this.itemsCount; i++) {
14895
+ const ratingItemContainer = this.createElement('span', { className: ITEMCONTAINER });
14896
+ const spanItem = this.createElement('span', { className: 'e-rating-item' });
14897
+ const ratingValue = this.getRatingValue(this.value, i);
14898
+ this.renderItemContent(spanItem, ratingValue, i);
14899
+ ratingItemContainer.appendChild(spanItem);
14900
+ this.wireItemsEvents(ratingItemContainer, i + 1);
14901
+ this.itemElements.push(ratingItemContainer);
14902
+ const eventArgs = { element: ratingItemContainer, value: i + 1 };
14903
+ this.trigger('beforeItemRender', eventArgs, (args) => {
14904
+ this.ratingItemList.appendChild(args.element);
14905
+ });
14906
+ }
14907
+ attributes(this.ratingItemList, { 'aria-valuemax': this.itemsCount.toString() });
14908
+ if (this.disabled) {
14909
+ attributes(this.ratingItemList, { 'tabindex': '-1' });
14910
+ }
14911
+ }
14912
+ renderItemContent(spanEle, val, index, isrerender = false) {
14913
+ if (isrerender) {
14914
+ this.removeItemContent(spanEle);
14915
+ }
14916
+ if (this.fullTemplate && val === 1) {
14917
+ spanEle.classList.add(FULLTEMPLATE);
14918
+ spanEle.append(this.fullTemplateFunction({ index: index, ratingValue: val }, this, 'ratingFullTemplate', (this.element.id + 'fullTemplate'), this.isStringTemplate)[0]);
14919
+ }
14920
+ else if (this.emptyTemplate) {
14921
+ spanEle.classList.add(EMPTYTEMPLATE);
14922
+ spanEle.append(this.emptyTemplateFunction({ index: index, ratingValue: val }, this, 'ratingEmptyTemplate', (this.element.id + 'emptyTemplate'), this.isStringTemplate)[0]);
14923
+ }
14924
+ else {
14925
+ addClass([spanEle], ICONCSS.split(' '));
14926
+ }
14927
+ }
14928
+ removeItemContent(spanEle) {
14929
+ spanEle.classList.remove(FULLTEMPLATE, EMPTYTEMPLATE);
14930
+ removeClass([spanEle], ICONCSS.split(' '));
14931
+ if (spanEle.firstChild) {
14932
+ spanEle.removeChild(spanEle.firstChild);
14933
+ }
14934
+ }
14935
+ updateTooltip() {
14936
+ if (this.showTooltip) {
14937
+ this.tooltipObj = new Tooltip({
14938
+ target: '.e-rating-item-container', windowCollision: true,
14939
+ opensOn: 'Custom', cssClass: 'e-rating-tooltip'
14940
+ });
14941
+ this.tooltipObj.appendTo('#' + this.ratingItemList.id);
14942
+ }
14943
+ else {
14944
+ if (!isNullOrUndefined(this.tooltipObj)) {
14945
+ this.tooltipObj.destroy();
14946
+ this.tooltipObj = null;
14947
+ }
14948
+ }
14949
+ }
14950
+ updateMinValue() {
14951
+ this.min = this.validateValue(this.min);
14952
+ if (this.min > 0 && this.value < this.min) {
14953
+ this.triggerChange(null, this.min, false);
14954
+ }
14955
+ attributes(this.ratingItemList, { 'aria-valuemin': this.min.toString() });
14956
+ }
14957
+ updatePrecision() {
14958
+ this.min = this.validateValue(this.min);
14959
+ this.triggerChange(null, this.validateValue(this.value), false);
14960
+ this.updateItemValue();
14961
+ }
14962
+ validateValue(currentValue) {
14963
+ if (currentValue > this.itemsCount) {
14964
+ currentValue = this.itemsCount;
14965
+ }
14966
+ else if (currentValue < 0) {
14967
+ currentValue = 0;
14968
+ }
14969
+ else {
14970
+ currentValue = (this.precision === PrecisionType.Full) ? Math.round(currentValue) :
14971
+ (this.precision === PrecisionType.Half) ? (Math.round(currentValue * 2) / 2) :
14972
+ (this.precision === PrecisionType.Quarter) ? (Math.round(currentValue * 4) / 4) : (Math.round(currentValue * 10) / 10);
14973
+ }
14974
+ return currentValue;
14975
+ }
14976
+ getRatingValue(value, i) {
14977
+ return (this.enableSingleSelection && this.precision === PrecisionType.Full) ? ((value === i + 1) ? 1 : 0) :
14978
+ (value >= i + 1) ? 1 : ((value < i) ? 0 : (value - i));
14979
+ }
14980
+ updateItemValue() {
14981
+ for (let i = 0; i < this.itemsCount; i++) {
14982
+ const itemElement = this.itemElements[parseInt(i.toString(), 10)];
14983
+ itemElement.classList.remove(SELECTED, INTERMEDIATE, SELECTEDVALUE);
14984
+ const ratingValue = this.getRatingValue(this.currentValue, i);
14985
+ if (ratingValue === 1) {
14986
+ itemElement.classList.add(SELECTED);
14987
+ }
14988
+ else if (ratingValue > 0) {
14989
+ itemElement.classList.add(INTERMEDIATE);
14990
+ }
14991
+ else if ((this.precision === PrecisionType.Full) && (i + 1 <= this.value) && (!this.enableSingleSelection)) {
14992
+ itemElement.classList.add(SELECTEDVALUE);
14993
+ }
14994
+ this.updateItemContent(ratingValue, i);
14995
+ itemElement.style.setProperty(RATINGVALUE, (ratingValue * 100) + '%');
14996
+ itemElement.classList[((this.value === 0) && (i === 0)) || (this.value === i + 1) || ((ratingValue > 0) && (ratingValue < 1)) ? 'add' : 'remove']('e-rating-focus');
14997
+ }
14998
+ if (this.allowReset) {
14999
+ this.updateResetButton();
15000
+ }
15001
+ attributes(this.ratingItemList, { 'aria-valuenow': this.currentValue.toString() });
15002
+ attributes(this.element, { 'value': this.value.toString() });
15003
+ }
15004
+ updateItemContent(ratingValue, index) {
15005
+ if (!this.fullTemplate && !this.emptyTemplate) {
15006
+ return;
15007
+ }
15008
+ const spanEle = this.itemElements[parseInt(index.toString(), 10)].querySelector('.e-rating-item');
15009
+ if (this.fullTemplate && ratingValue === 1) {
15010
+ if (spanEle.classList.contains(FULLTEMPLATE)) {
15011
+ return;
15012
+ }
15013
+ this.removeItemContent(spanEle);
15014
+ spanEle.classList.add(FULLTEMPLATE);
15015
+ spanEle.append(this.fullTemplateFunction({ ratingValue: ratingValue, index: index }, this, 'ratingFullTemplate', (this.element.id + 'fullTemplate'), this.isStringTemplate)[0]);
15016
+ }
15017
+ else if (this.emptyTemplate) {
15018
+ this.removeItemContent(spanEle);
15019
+ spanEle.classList.add(EMPTYTEMPLATE);
15020
+ spanEle.append(this.emptyTemplateFunction({ ratingValue: ratingValue, index: index }, this, 'ratingFullTemplate', (this.element.id + 'fullTemplate'), this.isStringTemplate)[0]);
15021
+ }
15022
+ else {
15023
+ this.removeItemContent(spanEle);
15024
+ addClass([spanEle], ICONCSS.split(' '));
15025
+ }
15026
+ this.renderReactTemplates();
15027
+ }
15028
+ updateTooltipContent(isChange) {
15029
+ if (this.showTooltip) {
15030
+ let content;
15031
+ if (this.tooltipTemplate) {
15032
+ const templateFunction = this.getTemplateString(this.tooltipTemplate);
15033
+ content = templateFunction({ value: this.currentValue }, this, 'ratingTooltipTemplate', (this.element.id + 'tooltipTemplate'), this.isStringTemplate)[0];
15034
+ }
15035
+ else {
15036
+ content = this.currentValue.toString();
15037
+ }
15038
+ this.tooltipObj.setProperties({ content: content }, isChange);
15039
+ this.renderReactTemplates();
15040
+ }
15041
+ }
15042
+ getTemplateString(template) {
15043
+ let stringContent = '';
15044
+ try {
15045
+ const tempEle = select(template);
15046
+ if (tempEle) {
15047
+ //Return innerHTML incase of jsrenderer script else outerHTML
15048
+ stringContent = tempEle.tagName === 'SCRIPT' ? tempEle.innerHTML : tempEle.outerHTML;
15049
+ }
15050
+ else {
15051
+ stringContent = template;
15052
+ }
15053
+ }
15054
+ catch (e) {
15055
+ stringContent = template;
15056
+ }
15057
+ return compile(stringContent);
15058
+ }
15059
+ displayLabel() {
15060
+ if (this.showLabel) {
15061
+ this.spanLabel = this.createElement('span', { className: LABEL });
15062
+ this.updateLabel();
15063
+ this.updateLabelPosition();
15064
+ }
15065
+ else {
15066
+ if (this.wrapper.contains(this.spanLabel)) {
15067
+ remove(this.spanLabel);
15068
+ this.spanLabel = null;
15069
+ }
15070
+ }
15071
+ }
15072
+ updateLabel() {
15073
+ if (this.showLabel) {
15074
+ if (this.labelTemplate) {
15075
+ if (this.spanLabel.firstChild) {
15076
+ this.spanLabel.removeChild(this.spanLabel.firstChild);
15077
+ }
15078
+ const templateFunction = this.getTemplateString(this.labelTemplate);
15079
+ this.spanLabel.append(templateFunction({ value: this.currentValue }, this, 'ratingLabelTemplate', (this.element.id + 'labelTemplate'), this.isStringTemplate)[0]);
15080
+ }
15081
+ else {
15082
+ this.spanLabel.textContent = this.currentValue + ' / ' + this.itemsCount;
15083
+ }
15084
+ this.renderReactTemplates();
15085
+ }
15086
+ }
15087
+ updateReset() {
15088
+ if (this.allowReset) {
15089
+ this.resetElement = this.createElement('span', { className: RESET });
15090
+ this.updateResetButton();
15091
+ EventHandler.add(this.resetElement, 'click', this.resetClicked, this);
15092
+ this.wrapper.insertBefore(this.resetElement, this.ratingItemList);
15093
+ }
15094
+ else {
15095
+ if (this.wrapper.contains(this.resetElement)) {
15096
+ remove(this.resetElement);
15097
+ this.resetElement = null;
15098
+ }
15099
+ }
15100
+ }
15101
+ updateLabelPosition() {
15102
+ this.clearLabelPosition();
15103
+ this.spanLabel.classList.add('e-label-' + this.labelPosition.toLowerCase());
15104
+ if (this.labelPosition === 'Left' || this.labelPosition === 'Top') {
15105
+ this.wrapper.firstChild.after(this.spanLabel);
15106
+ }
15107
+ else {
15108
+ this.wrapper.appendChild(this.spanLabel);
15109
+ }
15110
+ }
15111
+ clearLabelPosition() {
15112
+ const removeCss = this.spanLabel.classList.value.match(/(e-label-[top|bottom|right|left]+)/g);
15113
+ if (removeCss) {
15114
+ removeClass([this.spanLabel], removeCss);
15115
+ }
15116
+ }
15117
+ wireItemsEvents(itemElement, index) {
15118
+ EventHandler.add(itemElement, 'click', (e) => this.clickHandler(e), this);
15119
+ EventHandler.add(itemElement, 'mousemove', (e) => this.mouseMoveHandler(index, e), this);
15120
+ EventHandler.add(itemElement, 'mouseleave', this.mouseLeaveHandler, this);
15121
+ }
15122
+ clickHandler(e) {
15123
+ this.currentValue = (this.min > 0 && this.currentValue < this.min) ? this.min : this.currentValue;
15124
+ this.triggerChange(e, this.currentValue);
15125
+ this.updateItemValue();
15126
+ this.updateLabel();
15127
+ if (this.allowReset) {
15128
+ this.updateResetButton();
15129
+ }
15130
+ }
15131
+ triggerChange(e, val, isInteracted = true) {
15132
+ val = this.validateValue(val);
15133
+ this.currentValue = val;
15134
+ if (this.currentValue === this.value) {
15135
+ return;
15136
+ }
15137
+ const eventArgs = { event: e, isInteracted: isInteracted, value: val, previousValue: this.value };
15138
+ this.setProperties({ value: val }, true);
15139
+ this.trigger('valueChanged', eventArgs);
15140
+ }
15141
+ mouseMoveHandler(index, e) {
15142
+ let currValue = this.calculateCurrentValue(index, e);
15143
+ currValue = this.validateValue(currValue);
15144
+ const element = this.itemElements[parseInt((index - 1).toString(), 10)];
15145
+ if (currValue === this.currentValue) {
15146
+ this.openRatingTooltip(element, false);
15147
+ return;
15148
+ }
15149
+ this.updateCurrentValue(currValue);
15150
+ this.openRatingTooltip(element, true);
15151
+ const eventArgs = { element: element, event: e, value: currValue };
15152
+ this.trigger('onItemHover', eventArgs);
15153
+ }
15154
+ openRatingTooltip(element, isChange) {
15155
+ if (this.showTooltip) {
15156
+ if (!this.tooltipOpen) {
15157
+ this.updateTooltipContent(false);
15158
+ this.tooltipObj.open(element); //eslint-disable-line
15159
+ this.tooltipOpen = true;
15160
+ }
15161
+ else if (isChange) {
15162
+ this.updateTooltipContent(true);
15163
+ this.tooltipObj.refresh(element);
15164
+ }
15165
+ }
15166
+ }
15167
+ closeRatingTooltip() {
15168
+ if (this.tooltipOpen) {
15169
+ this.tooltipObj.close();
15170
+ this.tooltipOpen = false;
15171
+ }
15172
+ }
15173
+ updateCurrentValue(currValue) {
15174
+ this.currentValue = currValue;
15175
+ this.updateItemValue();
15176
+ this.updateLabel();
15177
+ }
15178
+ mouseLeaveHandler() {
15179
+ this.closeRatingTooltip();
15180
+ this.updateCurrentValue(this.value);
15181
+ }
15182
+ calculateCurrentValue(index, args) {
15183
+ let currentValue = index;
15184
+ if (this.precision !== PrecisionType.Full) {
15185
+ currentValue = args.offsetX / this.itemElements[index - 1].clientWidth;
15186
+ currentValue = (this.enableRtl) ? (1 - currentValue) : currentValue;
15187
+ if (this.precision === PrecisionType.Quarter) {
15188
+ currentValue = currentValue <= 0.25 ? 0.25 : currentValue <= 0.5 ? 0.5 : currentValue < 0.75 ? 0.75 : 1.0;
15189
+ }
15190
+ else if (this.precision === PrecisionType.Half) {
15191
+ currentValue = currentValue <= 0.5 ? 0.5 : 1;
15192
+ }
15193
+ currentValue = currentValue + index - 1;
15194
+ }
15195
+ return currentValue;
15196
+ }
15197
+ /**
15198
+ * Reset’s the value to minimum.
15199
+ *
15200
+ * @returns {void}
15201
+ */
15202
+ reset() {
15203
+ this.resetClicked(null, false);
15204
+ }
15205
+ resetClicked(e, isInteracted = true) {
15206
+ this.triggerChange(e, this.min, isInteracted);
15207
+ this.updateItemValue();
15208
+ this.updateLabel();
15209
+ this.updateResetButton();
15210
+ }
15211
+ wireKeyboardEvent() {
15212
+ this.keyboardModuleRating = new KeyboardEvents(this.wrapper, {
15213
+ keyAction: this.keyActionHandler.bind(this),
15214
+ keyConfigs: this.keyConfigs,
15215
+ eventName: 'keydown'
15216
+ });
15217
+ }
15218
+ keyActionHandler(e) {
15219
+ if (this.disabled || this.readOnly) {
15220
+ return;
15221
+ }
15222
+ if (e.target.classList.contains(ITEMLIST)) {
15223
+ switch (e.action) {
15224
+ case 'uparrow':
15225
+ this.handleNavigation(e, true);
15226
+ break;
15227
+ case 'downarrow':
15228
+ this.handleNavigation(e, false);
15229
+ break;
15230
+ case 'leftarrow':
15231
+ this.handleNavigation(e, this.enableRtl);
15232
+ break;
15233
+ case 'rightarrow':
15234
+ this.handleNavigation(e, !this.enableRtl);
15235
+ break;
15236
+ }
15237
+ }
15238
+ if (this.allowReset && e.target.classList.contains('e-reset')) {
15239
+ switch (e.action) {
15240
+ case 'space':
15241
+ this.resetClicked(e);
15242
+ break;
15243
+ }
15244
+ }
15245
+ }
15246
+ handleNavigation(e, isIncrease) {
15247
+ if ((!isIncrease && (this.value > this.min)) || (isIncrease && (this.value < this.itemsCount))) {
15248
+ let currentValue = (this.precision === PrecisionType.Full) ? 1 : (this.precision === PrecisionType.Half) ? 0.5 :
15249
+ (this.precision === PrecisionType.Quarter) ? 0.25 : Math.round(0.1 * 10) / 10;
15250
+ currentValue = isIncrease ? this.value + currentValue : this.value - currentValue;
15251
+ this.triggerChange(e, (currentValue));
15252
+ this.updateItemValue();
15253
+ this.updateLabel();
15254
+ if (this.allowReset) {
15255
+ this.updateResetButton();
15256
+ }
15257
+ }
15258
+ }
15259
+ updateContent() {
15260
+ for (let i = 0; i < this.itemsCount; i++) {
15261
+ const itemElement = this.itemElements[parseInt(i.toString(), 10)].firstElementChild;
15262
+ this.renderItemContent(itemElement, this.getRatingValue(this.value, i), i, true);
15263
+ }
15264
+ }
15265
+ /**
15266
+ * To get component name.
15267
+ *
15268
+ * @returns {string} - Module Name
15269
+ * @private
15270
+ */
15271
+ getModuleName() {
15272
+ return 'rating';
15273
+ }
15274
+ /**
15275
+ * To get the properties to be maintained in the persisted state.
15276
+ *
15277
+ * @returns {string} - Persist data
15278
+ */
15279
+ getPersistData() {
15280
+ return this.addOnPersist([]);
15281
+ }
15282
+ removeItemElements() {
15283
+ for (let i = 0; i < this.itemElements.length; i++) {
15284
+ remove(this.itemElements[parseInt(i.toString(), 10)]);
15285
+ }
15286
+ this.itemElements = [];
15287
+ }
15288
+ /**
15289
+ * Destroys the Rating instance.
15290
+ *
15291
+ * @returns {void}
15292
+ */
15293
+ destroy() {
15294
+ super.destroy();
15295
+ // unwires the events and detach the li elements
15296
+ this.removeItemElements();
15297
+ if (this.spanLabel) {
15298
+ remove(this.spanLabel);
15299
+ this.spanLabel = null;
15300
+ }
15301
+ if (this.resetElement) {
15302
+ remove(this.resetElement);
15303
+ this.resetElement = null;
15304
+ }
15305
+ if (this.showTooltip) {
15306
+ this.tooltipObj.destroy();
15307
+ this.tooltipObj = null;
15308
+ }
15309
+ remove(this.ratingItemList);
15310
+ this.ratingItemList = null;
15311
+ this.wrapper.parentNode.insertBefore(this.element, this.wrapper);
15312
+ remove(this.wrapper);
15313
+ this.wrapper = null;
15314
+ this.keyboardModuleRating.destroy();
15315
+ ['value', 'aria-label', 'name'].forEach((attr) => {
15316
+ this.element.removeAttribute(attr);
15317
+ });
15318
+ }
15319
+ /**
15320
+ * Called internally if any of the property value changed.
15321
+ *
15322
+ * @param {RatingModel} newProp - Specifies new properties
15323
+ * @param {RatingModel} oldProp - Specifies old properties
15324
+ * @returns {void}
15325
+ * @private
15326
+ */
15327
+ onPropertyChanged(newProp, oldProp) {
15328
+ for (const prop of Object.keys(newProp)) {
15329
+ switch (prop) {
15330
+ case 'value':
15331
+ this.triggerChange(null, (this.value > this.min) ? this.value : this.min, false);
15332
+ this.updateItemValue();
15333
+ this.updateLabel();
15334
+ break;
15335
+ case 'min':
15336
+ this.updateMinValue();
15337
+ this.updateItemValue();
15338
+ this.updateLabel();
15339
+ break;
15340
+ case 'showLabel':
15341
+ this.displayLabel();
15342
+ break;
15343
+ case 'visible':
15344
+ this.wrapper.classList[!this.visible ? 'add' : 'remove'](HIDDEN);
15345
+ break;
15346
+ case 'disabled':
15347
+ this.updateDisabled();
15348
+ break;
15349
+ case 'readOnly':
15350
+ this.wrapper.classList[this.readOnly ? 'add' : 'remove'](READONLY);
15351
+ break;
15352
+ case 'allowReset':
15353
+ this.updateReset();
15354
+ break;
15355
+ case 'enableRtl':
15356
+ this.wrapper.classList[this.enableRtl ? 'add' : 'remove'](RTL$2);
15357
+ break;
15358
+ case 'cssClass':
15359
+ if (oldProp.cssClass) {
15360
+ removeClass([this.wrapper], oldProp.cssClass.split(' '));
15361
+ }
15362
+ if (newProp.cssClass) {
15363
+ addClass([this.wrapper], newProp.cssClass.split(' '));
15364
+ }
15365
+ break;
15366
+ case 'labelPosition':
15367
+ this.updateLabelPosition();
15368
+ break;
15369
+ case 'showTooltip':
15370
+ this.updateTooltip();
15371
+ break;
15372
+ case 'precision':
15373
+ this.updatePrecision();
15374
+ this.updateLabel();
15375
+ break;
15376
+ case 'enableSingleSelection':
15377
+ this.updateItemValue();
15378
+ break;
15379
+ case 'enableAnimation':
15380
+ this.wrapper.classList[this.enableAnimation ? 'add' : 'remove'](ANIMATION);
15381
+ break;
15382
+ case 'emptyTemplate':
15383
+ case 'fullTemplate':
15384
+ this.updateTemplateFunction();
15385
+ this.updateContent();
15386
+ break;
15387
+ case 'labelTemplate':
15388
+ this.updateLabel();
15389
+ break;
15390
+ case 'itemsCount':
15391
+ this.removeItemElements();
15392
+ this.renderItems();
15393
+ this.updateItemValue();
15394
+ this.updateLabel();
15395
+ break;
15396
+ }
15397
+ }
15398
+ }
15399
+ };
15400
+ __decorate$8([
15401
+ Property(false)
15402
+ ], Rating.prototype, "allowReset", void 0);
15403
+ __decorate$8([
15404
+ Property('')
15405
+ ], Rating.prototype, "cssClass", void 0);
15406
+ __decorate$8([
15407
+ Property(false)
15408
+ ], Rating.prototype, "disabled", void 0);
15409
+ __decorate$8([
15410
+ Property(true)
15411
+ ], Rating.prototype, "enableAnimation", void 0);
15412
+ __decorate$8([
15413
+ Property('')
15414
+ ], Rating.prototype, "emptyTemplate", void 0);
15415
+ __decorate$8([
15416
+ Property(false)
15417
+ ], Rating.prototype, "enableSingleSelection", void 0);
15418
+ __decorate$8([
15419
+ Property('')
15420
+ ], Rating.prototype, "fullTemplate", void 0);
15421
+ __decorate$8([
15422
+ Property(5)
15423
+ ], Rating.prototype, "itemsCount", void 0);
15424
+ __decorate$8([
15425
+ Property(LabelPosition.Right)
15426
+ ], Rating.prototype, "labelPosition", void 0);
15427
+ __decorate$8([
15428
+ Property('')
15429
+ ], Rating.prototype, "labelTemplate", void 0);
15430
+ __decorate$8([
15431
+ Property(0.0)
15432
+ ], Rating.prototype, "min", void 0);
15433
+ __decorate$8([
15434
+ Property(PrecisionType.Full)
15435
+ ], Rating.prototype, "precision", void 0);
15436
+ __decorate$8([
15437
+ Property(false)
15438
+ ], Rating.prototype, "readOnly", void 0);
15439
+ __decorate$8([
15440
+ Property(false)
15441
+ ], Rating.prototype, "showLabel", void 0);
15442
+ __decorate$8([
15443
+ Property(true)
15444
+ ], Rating.prototype, "showTooltip", void 0);
15445
+ __decorate$8([
15446
+ Property('')
15447
+ ], Rating.prototype, "tooltipTemplate", void 0);
15448
+ __decorate$8([
15449
+ Property(0.0)
15450
+ ], Rating.prototype, "value", void 0);
15451
+ __decorate$8([
15452
+ Property(true)
15453
+ ], Rating.prototype, "visible", void 0);
15454
+ __decorate$8([
15455
+ Event()
15456
+ ], Rating.prototype, "beforeItemRender", void 0);
15457
+ __decorate$8([
15458
+ Event()
15459
+ ], Rating.prototype, "created", void 0);
15460
+ __decorate$8([
15461
+ Event()
15462
+ ], Rating.prototype, "onItemHover", void 0);
15463
+ __decorate$8([
15464
+ Event()
15465
+ ], Rating.prototype, "valueChanged", void 0);
15466
+ Rating = __decorate$8([
15467
+ NotifyPropertyChanges
15468
+ ], Rating);
15469
+
15470
+ /**
15471
+ * Rating modules
15472
+ */
15473
+
14652
15474
  /**
14653
15475
  * Signature base modules
14654
15476
  */
@@ -14657,5 +15479,5 @@ Signature = __decorate$7([
14657
15479
  * NumericTextBox all modules
14658
15480
  */
14659
15481
 
14660
- export { NumericTextBox, regularExpressions, createMask, applyMask, wireEvents, unwireEvents, bindClearEvent, unstrippedValue, strippedValue, maskInputMouseDownHandler, maskInputMouseUpHandler, maskInputFocusHandler, triggerFocus, maskInputBlurHandler, maskInputDropHandler, mobileRemoveFunction, setMaskValue, setElementValue, maskInput, getVal, getMaskedVal, MaskUndo, MaskedTextBox, Input, TicksData, ColorRangeData, LimitData, TooltipData, Slider, regex, ErrorOption, FormValidator, FilesProp, ButtonsProps, AsyncSettings, Uploader, ColorPicker, TextBox, Signature, SignatureBase };
15482
+ export { NumericTextBox, regularExpressions, createMask, applyMask, wireEvents, unwireEvents, bindClearEvent, unstrippedValue, strippedValue, maskInputMouseDownHandler, maskInputMouseUpHandler, maskInputFocusHandler, triggerFocus, escapeRegExp, maskInputBlurHandler, maskInputDropHandler, mobileRemoveFunction, setMaskValue, setElementValue, maskInput, getVal, getMaskedVal, MaskUndo, MaskedTextBox, Input, TicksData, ColorRangeData, LimitData, TooltipData, Slider, regex, ErrorOption, FormValidator, FilesProp, ButtonsProps, AsyncSettings, Uploader, ColorPicker, TextBox, Signature, LabelPosition, PrecisionType, Rating, SignatureBase };
14661
15483
  //# sourceMappingURL=ej2-inputs.es2015.js.map