@syncfusion/ej2-inputs 20.3.57 → 20.4.40

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 +8 -15
  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 +884 -63
  7. package/dist/es6/ej2-inputs.es2015.js.map +1 -1
  8. package/dist/es6/ej2-inputs.es5.js +908 -63
  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 +11 -10
  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 +3 -8
  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 +21 -9
  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 +10 -9
  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 +265 -0
  42. package/styles/bootstrap-dark.scss +1 -0
  43. package/styles/bootstrap.css +265 -0
  44. package/styles/bootstrap.scss +1 -0
  45. package/styles/bootstrap4.css +268 -2
  46. package/styles/bootstrap4.scss +1 -0
  47. package/styles/bootstrap5-dark.css +266 -0
  48. package/styles/bootstrap5-dark.scss +1 -0
  49. package/styles/bootstrap5.css +266 -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 +265 -0
  54. package/styles/fabric-dark.scss +1 -0
  55. package/styles/fabric.css +265 -0
  56. package/styles/fabric.scss +1 -0
  57. package/styles/fluent-dark.css +265 -0
  58. package/styles/fluent-dark.scss +1 -0
  59. package/styles/fluent.css +265 -0
  60. package/styles/fluent.scss +1 -0
  61. package/styles/highcontrast-light.css +265 -0
  62. package/styles/highcontrast-light.scss +1 -0
  63. package/styles/highcontrast.css +265 -0
  64. package/styles/highcontrast.scss +1 -0
  65. package/styles/material-dark.css +265 -0
  66. package/styles/material-dark.scss +1 -0
  67. package/styles/material.css +265 -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 +204 -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 +264 -0
  90. package/styles/rating/bootstrap-dark.scss +4 -0
  91. package/styles/rating/bootstrap.css +264 -0
  92. package/styles/rating/bootstrap.scss +4 -0
  93. package/styles/rating/bootstrap4.css +265 -0
  94. package/styles/rating/bootstrap4.scss +4 -0
  95. package/styles/rating/bootstrap5-dark.css +265 -0
  96. package/styles/rating/bootstrap5-dark.scss +4 -0
  97. package/styles/rating/bootstrap5.css +265 -0
  98. package/styles/rating/bootstrap5.scss +4 -0
  99. package/styles/rating/fabric-dark.css +264 -0
  100. package/styles/rating/fabric-dark.scss +4 -0
  101. package/styles/rating/fabric.css +264 -0
  102. package/styles/rating/fabric.scss +4 -0
  103. package/styles/rating/fluent-dark.css +264 -0
  104. package/styles/rating/fluent-dark.scss +4 -0
  105. package/styles/rating/fluent.css +264 -0
  106. package/styles/rating/fluent.scss +4 -0
  107. package/styles/rating/highcontrast-light.css +264 -0
  108. package/styles/rating/highcontrast-light.scss +4 -0
  109. package/styles/rating/highcontrast.css +264 -0
  110. package/styles/rating/highcontrast.scss +4 -0
  111. package/styles/rating/material-dark.css +265 -0
  112. package/styles/rating/material-dark.scss +4 -0
  113. package/styles/rating/material.css +265 -0
  114. package/styles/rating/material.scss +4 -0
  115. package/styles/rating/tailwind-dark.css +270 -0
  116. package/styles/rating/tailwind-dark.scss +4 -0
  117. package/styles/rating/tailwind.css +270 -0
  118. package/styles/rating/tailwind.scss +4 -0
  119. package/styles/tailwind-dark.css +271 -0
  120. package/styles/tailwind-dark.scss +1 -0
  121. package/styles/tailwind.css +271 -0
  122. package/styles/tailwind.scss +1 -0
@@ -326,6 +326,10 @@ var Input;
326
326
  });
327
327
  }
328
328
  Input.wireClearBtnEvents = wireClearBtnEvents;
329
+ function destroy() {
330
+
331
+ }
332
+ Input.destroy = destroy;
329
333
  function validateLabel(element, floatLabelType) {
330
334
  var parent = getParentNode(element);
331
335
  if (parent.classList.contains(CLASSNAMES.FLOATINPUT) && floatLabelType === 'Auto') {
@@ -381,7 +385,7 @@ var Input;
381
385
  if (!isNullOrUndefined(parentElement)) {
382
386
  var button = parentElement.getElementsByClassName(CLASSNAMES.CLEARICON)[0];
383
387
  if (!isNullOrUndefined(button)) {
384
- if (element.value && parentElement.classList.contains('e-input-focus')) {
388
+ if (element.value && !isNullOrUndefined(parentElement) && parentElement.classList.contains('e-input-focus')) {
385
389
  removeClass([button], CLASSNAMES.CLEARICONHIDE);
386
390
  }
387
391
  else {
@@ -915,6 +919,7 @@ var CONTROL = 'e-control';
915
919
  var NUMERIC_FOCUS = 'e-input-focus';
916
920
  var HIDDENELEMENT = 'e-numeric-hidden';
917
921
  var wrapperAttributes = ['title', 'style', 'class'];
922
+ var selectionTimeOut = 0;
918
923
  /**
919
924
  * Represents the NumericTextBox component that allows the user to enter only numeric values.
920
925
  * ```html
@@ -977,7 +982,7 @@ var NumericTextBox = /** @__PURE__ @class */ (function (_super) {
977
982
  this.element = input;
978
983
  setValue('ej2_instances', ejInstance, this.element);
979
984
  }
980
- attributes(this.element, { 'role': 'spinbutton', 'tabindex': '0', 'autocomplete': 'off', 'aria-live': 'assertive' });
985
+ attributes(this.element, { 'role': 'spinbutton', 'tabindex': '0', 'autocomplete': 'off' });
981
986
  var localeText = {
982
987
  incrementTitle: 'Increment value', decrementTitle: 'Decrement value', placeholder: this.placeholder
983
988
  };
@@ -1180,7 +1185,7 @@ var NumericTextBox = /** @__PURE__ @class */ (function (_super) {
1180
1185
  for (var _i = 0, _a = Object.keys(attr); _i < _a.length; _i++) {
1181
1186
  var key = _a[_i];
1182
1187
  if (key.indexOf('data') === 0) {
1183
- this.hiddenInput.setAttribute(key, attr[key]);
1188
+ this.hiddenInput.setAttribute(key, attr["" + key]);
1184
1189
  }
1185
1190
  }
1186
1191
  };
@@ -1189,7 +1194,7 @@ var NumericTextBox = /** @__PURE__ @class */ (function (_super) {
1189
1194
  for (var _i = 0, _a = Object.keys(this.htmlAttributes); _i < _a.length; _i++) {
1190
1195
  var pro = _a[_i];
1191
1196
  if (wrapperAttributes.indexOf(pro) < 0) {
1192
- this.element.setAttribute(pro, this.htmlAttributes[pro]);
1197
+ this.element.setAttribute(pro, this.htmlAttributes["" + pro]);
1193
1198
  }
1194
1199
  }
1195
1200
  }
@@ -1210,19 +1215,19 @@ var NumericTextBox = /** @__PURE__ @class */ (function (_super) {
1210
1215
  var pro = _a[_i];
1211
1216
  if (wrapperAttributes.indexOf(pro) > -1) {
1212
1217
  if (pro === 'class') {
1213
- var updatedClassValue = this.getNumericValidClassList(this.htmlAttributes[pro]);
1218
+ var updatedClassValue = this.getNumericValidClassList(this.htmlAttributes["" + pro]);
1214
1219
  if (updatedClassValue !== '') {
1215
1220
  addClass([this.container], updatedClassValue.split(' '));
1216
1221
  }
1217
1222
  }
1218
1223
  else if (pro === 'style') {
1219
1224
  var numericStyle = this.container.getAttribute(pro);
1220
- numericStyle = !isNullOrUndefined(numericStyle) ? (numericStyle + this.htmlAttributes[pro]) :
1221
- this.htmlAttributes[pro];
1225
+ numericStyle = !isNullOrUndefined(numericStyle) ? (numericStyle + this.htmlAttributes["" + pro]) :
1226
+ this.htmlAttributes["" + pro];
1222
1227
  this.container.setAttribute(pro, numericStyle);
1223
1228
  }
1224
1229
  else {
1225
- this.container.setAttribute(pro, this.htmlAttributes[pro]);
1230
+ this.container.setAttribute(pro, this.htmlAttributes["" + pro]);
1226
1231
  }
1227
1232
  }
1228
1233
  }
@@ -1769,6 +1774,7 @@ var NumericTextBox = /** @__PURE__ @class */ (function (_super) {
1769
1774
  if (this.decimals && this.validateDecimalOnType) {
1770
1775
  fractionRule = '{0,' + this.decimals + '}';
1771
1776
  }
1777
+ // eslint-disable-next-line detect-non-literal-regexp
1772
1778
  return new RegExp('^(-)?(((\\d+(' + decimalSeparator + '\\d' + fractionRule +
1773
1779
  ')?)|(' + decimalSeparator + '\\d' + fractionRule + ')))?$');
1774
1780
  };
@@ -1793,6 +1799,7 @@ var NumericTextBox = /** @__PURE__ @class */ (function (_super) {
1793
1799
  };
1794
1800
  NumericTextBox.prototype.focusHandler = function (event) {
1795
1801
  var _this = this;
1802
+ clearTimeout(selectionTimeOut);
1796
1803
  this.focusEventArgs = { event: event, value: this.value, container: this.container };
1797
1804
  this.trigger('focus', this.focusEventArgs);
1798
1805
  if (!this.enabled || this.readonly) {
@@ -1810,7 +1817,7 @@ var NumericTextBox = /** @__PURE__ @class */ (function (_super) {
1810
1817
  }
1811
1818
  else {
1812
1819
  var delay = (Browser.isDevice && Browser.isIos) ? 600 : 0;
1813
- setTimeout(function () {
1820
+ selectionTimeOut = setTimeout(function () {
1814
1821
  _this.element.setSelectionRange(0, formatValue_1.length);
1815
1822
  }, delay);
1816
1823
  }
@@ -1986,13 +1993,22 @@ var NumericTextBox = /** @__PURE__ @class */ (function (_super) {
1986
1993
  }
1987
1994
  var attrArray = ['aria-labelledby', 'role', 'autocomplete', 'aria-readonly',
1988
1995
  'aria-disabled', 'autocapitalize', 'spellcheck', 'aria-autocomplete', 'tabindex',
1989
- 'aria-valuemin', 'aria-valuemax', 'aria-live', 'aria-valuenow', 'aria-invalid'];
1996
+ 'aria-valuemin', 'aria-valuemax', 'aria-valuenow', 'aria-invalid'];
1990
1997
  for (var i = 0; i < attrArray.length; i++) {
1991
1998
  this.element.removeAttribute(attrArray[i]);
1992
1999
  }
1993
2000
  this.element.classList.remove('e-input');
1994
2001
  this.container.insertAdjacentElement('afterend', this.element);
1995
2002
  detach(this.container);
2003
+ this.spinUp = null;
2004
+ this.spinDown = null;
2005
+ this.container = null;
2006
+ this.hiddenInput = null;
2007
+ this.changeEventArgs = null;
2008
+ this.blurEventArgs = null;
2009
+ this.focusEventArgs = null;
2010
+ this.inputWrapper = null;
2011
+ Input.destroy();
1996
2012
  _super.prototype.destroy.call(this);
1997
2013
  };
1998
2014
  /* eslint-disable valid-jsdoc, jsdoc/require-returns */
@@ -2336,6 +2352,7 @@ function createMask() {
2336
2352
  if (!isNullOrUndefined(this.customCharacters)) {
2337
2353
  for (var i = 0; i < this.promptMask.length; i++) {
2338
2354
  if (!isNullOrUndefined(this.customCharacters[this.promptMask[i]])) {
2355
+ // eslint-disable-next-line detect-non-literal-regexp
2339
2356
  this.promptMask = this.promptMask.replace(new RegExp(this.promptMask[i], 'g'), this.promptChar);
2340
2357
  }
2341
2358
  }
@@ -2531,7 +2548,7 @@ function maskInputFocusHandler(event) {
2531
2548
  event: event,
2532
2549
  value: this.value,
2533
2550
  maskedValue: inputElement.value,
2534
- container: this.inputObj.container,
2551
+ container: !isNullOrUndefined(this.inputObj) ? this.inputObj.container : this.inputObj,
2535
2552
  selectionEnd: inputElement.selectionEnd
2536
2553
  };
2537
2554
  if (!this.isClicked) {
@@ -2598,21 +2615,21 @@ function maskInputFocusHandler(event) {
2598
2615
  event: event,
2599
2616
  value: _this.value,
2600
2617
  maskedValue: inputElement.value,
2601
- container: _this.inputObj.container,
2618
+ container: !isNullOrUndefined(_this.inputObj) ? _this.inputObj.container : _this.inputObj,
2602
2619
  selectionEnd: inputElement.selectionEnd
2603
2620
  };
2604
2621
  triggerFocus.call(_this, eventArgs, inputElement);
2605
- });
2622
+ }, 110);
2606
2623
  break;
2607
2624
  }
2608
2625
  }
2609
- if (isNullOrUndefined(inputElement.value.match(this.promptChar))) {
2626
+ if (isNullOrUndefined(inputElement.value.match(escapeRegExp(this.promptChar)))) {
2610
2627
  eventArgs = {
2611
2628
  selectionStart: inputElement.selectionStart,
2612
2629
  event: event,
2613
2630
  value: this.value,
2614
2631
  maskedValue: inputElement.value,
2615
- container: this.inputObj.container,
2632
+ container: !isNullOrUndefined(this.inputObj) ? this.inputObj.container : this.inputObj,
2616
2633
  selectionEnd: inputElement.selectionEnd
2617
2634
  };
2618
2635
  triggerFocus.call(this, eventArgs, inputElement);
@@ -2627,12 +2644,15 @@ function triggerFocus(eventArgs, inputElement) {
2627
2644
  inputElement.selectionEnd = eventArgs.selectionEnd;
2628
2645
  });
2629
2646
  }
2647
+ function escapeRegExp(text) {
2648
+ return !isNullOrUndefined(text) ? text.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&') : text;
2649
+ }
2630
2650
  function maskInputBlurHandler(event) {
2631
2651
  this.blurEventArgs = {
2632
2652
  event: event,
2633
2653
  value: this.value,
2634
2654
  maskedValue: this.element.value,
2635
- container: this.inputObj.container
2655
+ container: !isNullOrUndefined(this.inputObj) ? this.inputObj.container : this.inputObj,
2636
2656
  };
2637
2657
  this.trigger('blur', this.blurEventArgs);
2638
2658
  if (this.mask) {
@@ -2867,8 +2887,8 @@ function removeMaskInputValues(event) {
2867
2887
  ++startIndex;
2868
2888
  }
2869
2889
  var oldValue = this.element.value[sIndex];
2870
- if ((isNullOrUndefined(this.regExpCollec[curMask]) && (!isNullOrUndefined(this.customCharacters)
2871
- && isNullOrUndefined(this.customCharacters[curMask]))
2890
+ if ((isNullOrUndefined(this.regExpCollec["" + curMask]) && (!isNullOrUndefined(this.customCharacters)
2891
+ && isNullOrUndefined(this.customCharacters["" + curMask]))
2872
2892
  && ((this.hiddenMask[sIndex] !== this.promptChar && this.customRegExpCollec[sIndex][0] !== '['
2873
2893
  && this.customRegExpCollec[sIndex][this.customRegExpCollec[sIndex].length - 1] !== ']')))
2874
2894
  || (this.promptMask[sIndex] !== this.promptChar && isNullOrUndefined(this.customCharacters))) {
@@ -3080,8 +3100,8 @@ function validateValue(key, isCtrlKey, event) {
3080
3100
  if (this.hiddenMask[startIndex] === '\\' && this.hiddenMask[startIndex + 1] === key) {
3081
3101
  isEqualVal = true;
3082
3102
  }
3083
- if ((isNullOrUndefined(this.regExpCollec[curMask]) && (isNullOrUndefined(this.customCharacters)
3084
- || (!isNullOrUndefined(this.customCharacters) && isNullOrUndefined(this.customCharacters[curMask])))
3103
+ if ((isNullOrUndefined(this.regExpCollec["" + curMask]) && (isNullOrUndefined(this.customCharacters)
3104
+ || (!isNullOrUndefined(this.customCharacters) && isNullOrUndefined(this.customCharacters["" + curMask])))
3085
3105
  && ((this.hiddenMask[startIndex] !== this.promptChar && this.customRegExpCollec[startIndex][0] !== '['
3086
3106
  && this.customRegExpCollec[startIndex][this.customRegExpCollec[startIndex].length - 1] !== ']')))
3087
3107
  || ((this.promptMask[startIndex] !== this.promptChar) && isNullOrUndefined(this.customCharacters))
@@ -3091,22 +3111,25 @@ function validateValue(key, isCtrlKey, event) {
3091
3111
  curMask = this.hiddenMask[startIndex];
3092
3112
  }
3093
3113
  }
3094
- if (!isNullOrUndefined(this.customCharacters) && !isNullOrUndefined(this.customCharacters[curMask])) {
3095
- var customValStr = this.customCharacters[curMask];
3114
+ if (!isNullOrUndefined(this.customCharacters) && !isNullOrUndefined(this.customCharacters["" + curMask])) {
3115
+ var customValStr = this.customCharacters["" + curMask];
3096
3116
  var customValArr = customValStr.split(',');
3097
3117
  for (var i = 0; i < customValArr.length; i++) {
3118
+ // eslint-disable-next-line detect-non-literal-regexp
3098
3119
  if (keyValue.match(new RegExp('[' + customValArr[i] + ']'))) {
3099
3120
  allowText = true;
3100
3121
  break;
3101
3122
  }
3102
3123
  }
3124
+ // eslint-disable-next-line detect-non-literal-regexp
3103
3125
  }
3104
- else if (!isNullOrUndefined(this.regExpCollec[curMask]) && keyValue.match(new RegExp(this.regExpCollec[curMask]))
3126
+ else if (!isNullOrUndefined(this.regExpCollec["" + curMask]) && keyValue.match(new RegExp(this.regExpCollec["" + curMask]))
3105
3127
  && this.promptMask[startIndex] === this.promptChar) {
3106
3128
  allowText = true;
3107
3129
  }
3108
3130
  else if (this.promptMask[startIndex] === this.promptChar && this.customRegExpCollec[startIndex][0] === '['
3109
3131
  && this.customRegExpCollec[startIndex][this.customRegExpCollec[startIndex].length - 1] === ']'
3132
+ // eslint-disable-next-line detect-non-literal-regexp
3110
3133
  && keyValue.match(new RegExp(this.customRegExpCollec[startIndex]))) {
3111
3134
  allowText = true;
3112
3135
  }
@@ -3571,7 +3594,7 @@ var MaskedTextBox = /** @__PURE__ @class */ (function (_super) {
3571
3594
  for (var _i = 0, _a = Object.keys(this.htmlAttributes); _i < _a.length; _i++) {
3572
3595
  var key = _a[_i];
3573
3596
  if (wrapperAttr.indexOf(key) < 0) {
3574
- this.element.setAttribute(key, this.htmlAttributes[key]);
3597
+ this.element.setAttribute(key, this.htmlAttributes["" + key]);
3575
3598
  }
3576
3599
  }
3577
3600
  }
@@ -3592,19 +3615,19 @@ var MaskedTextBox = /** @__PURE__ @class */ (function (_super) {
3592
3615
  var key = _a[_i];
3593
3616
  if (wrapperAttr.indexOf(key) > -1) {
3594
3617
  if (key === 'class') {
3595
- var updatedClassValues = (this.htmlAttributes[key].replace(/\s+/g, ' ')).trim();
3618
+ var updatedClassValues = (this.htmlAttributes["" + key].replace(/\s+/g, ' ')).trim();
3596
3619
  if (updatedClassValues !== '') {
3597
3620
  addClass([this.inputObj.container], updatedClassValues.split(' '));
3598
3621
  }
3599
3622
  }
3600
3623
  else if (key === 'style') {
3601
3624
  var maskStyle = this.inputObj.container.getAttribute(key);
3602
- maskStyle = !isNullOrUndefined(maskStyle) ? (maskStyle + this.htmlAttributes[key]) :
3603
- this.htmlAttributes[key];
3625
+ maskStyle = !isNullOrUndefined(maskStyle) ? (maskStyle + this.htmlAttributes["" + key]) :
3626
+ this.htmlAttributes["" + key];
3604
3627
  this.inputObj.container.setAttribute(key, maskStyle);
3605
3628
  }
3606
3629
  else {
3607
- this.inputObj.container.setAttribute(key, this.htmlAttributes[key]);
3630
+ this.inputObj.container.setAttribute(key, this.htmlAttributes["" + key]);
3608
3631
  }
3609
3632
  }
3610
3633
  }
@@ -3781,10 +3804,13 @@ var MaskedTextBox = /** @__PURE__ @class */ (function (_super) {
3781
3804
  else {
3782
3805
  this.promptChar = '_';
3783
3806
  }
3807
+ // eslint-disable-next-line detect-non-literal-regexp
3784
3808
  var value = this.element.value.replace(new RegExp('[' + oldProp.promptChar + ']', 'g'), this.promptChar);
3785
3809
  if (this.promptMask === this.element.value) {
3810
+ // eslint-disable-next-line detect-non-literal-regexp
3786
3811
  value = this.promptMask.replace(new RegExp('[' + oldProp.promptChar + ']', 'g'), this.promptChar);
3787
3812
  }
3813
+ // eslint-disable-next-line detect-non-literal-regexp
3788
3814
  this.promptMask = this.promptMask.replace(new RegExp('[' + oldProp.promptChar + ']', 'g'), this.promptChar);
3789
3815
  this.undoCollec = this.redoCollec = [];
3790
3816
  setElementValue.call(this, value);
@@ -3846,8 +3872,14 @@ var MaskedTextBox = /** @__PURE__ @class */ (function (_super) {
3846
3872
  this.element.removeAttribute(attrArray[i]);
3847
3873
  }
3848
3874
  this.element.classList.remove('e-input');
3849
- this.inputObj.container.insertAdjacentElement('afterend', this.element);
3850
- detach(this.inputObj.container);
3875
+ if (this.inputObj) {
3876
+ this.inputObj.container.insertAdjacentElement('afterend', this.element);
3877
+ detach(this.inputObj.container);
3878
+ }
3879
+ this.blurEventArgs = null;
3880
+ Input.destroy();
3881
+ this.changeEventArgs = null;
3882
+ this.inputObj = null;
3851
3883
  _super.prototype.destroy.call(this);
3852
3884
  };
3853
3885
  __decorate$1([
@@ -4437,7 +4469,7 @@ var Slider = /** @__PURE__ @class */ (function (_super) {
4437
4469
  Slider.prototype.createSecondHandle = function () {
4438
4470
  this.secondHandle = this.createElement('div', {
4439
4471
  attrs: {
4440
- class: classNames.sliderHandle, 'role': 'slider', tabIndex: '0'
4472
+ class: classNames.sliderHandle, 'role': 'slider', tabIndex: '0', 'aria-label': 'slider'
4441
4473
  }
4442
4474
  });
4443
4475
  this.secondHandle.classList.add(classNames.sliderSecondHandle);
@@ -4446,7 +4478,7 @@ var Slider = /** @__PURE__ @class */ (function (_super) {
4446
4478
  Slider.prototype.createFirstHandle = function () {
4447
4479
  this.firstHandle = this.createElement('div', {
4448
4480
  attrs: {
4449
- class: classNames.sliderHandle, 'role': 'slider', tabIndex: '0'
4481
+ class: classNames.sliderHandle, 'role': 'slider', tabIndex: '0', 'aria-label': 'slider'
4450
4482
  }
4451
4483
  });
4452
4484
  this.firstHandle.classList.add(classNames.sliderFirstHandle);
@@ -4876,6 +4908,7 @@ var Slider = /** @__PURE__ @class */ (function (_super) {
4876
4908
  this.sliderContainer.classList.add(classNames.materialSlider);
4877
4909
  this.tooltipValue();
4878
4910
  this.tooltipObj.animation.close.effect = 'None';
4911
+ // eslint-disable-next-line security/detect-non-literal-fs-filename -- Safe as no value holds user input
4879
4912
  this.tooltipObj.open(this.firstHandle);
4880
4913
  }
4881
4914
  };
@@ -6204,6 +6237,7 @@ var Slider = /** @__PURE__ @class */ (function (_super) {
6204
6237
  Slider.prototype.openTooltip = function (target) {
6205
6238
  if (this.tooltip.isVisible && this.tooltipObj && !this.isMaterialTooltip) {
6206
6239
  this.tooltipValue();
6240
+ // eslint-disable-next-line security/detect-non-literal-fs-filename -- Safe as no value holds user input
6207
6241
  this.tooltipObj.open(target);
6208
6242
  this.tooltipTarget = target;
6209
6243
  }
@@ -7967,7 +8001,7 @@ var Uploader = /** @__PURE__ @class */ (function (_super) {
7967
8001
  var keyValue;
7968
8002
  for (var _i = 0, _a = Object.keys(this.preLocaleObj); _i < _a.length; _i++) {
7969
8003
  var key = _a[_i];
7970
- if (this.preLocaleObj[key] === val) {
8004
+ if (this.preLocaleObj["" + key] === val) {
7971
8005
  keyValue = key;
7972
8006
  }
7973
8007
  }
@@ -8018,7 +8052,7 @@ var Uploader = /** @__PURE__ @class */ (function (_super) {
8018
8052
  }
8019
8053
  };
8020
8054
  Uploader.prototype.preRender = function () {
8021
- this.localeText = { Browse: 'Browse...', Clear: 'Clear', Upload: 'Upload',
8055
+ this.localeText = { Browse: 'Browse...', Clear: 'Clear', Upload: 'Upload', invalidFileName: 'File Name is not allowed',
8022
8056
  dropFilesHint: 'Or drop files here', invalidMaxFileSize: 'File size is too large',
8023
8057
  invalidMinFileSize: 'File size is too small', invalidFileType: 'File type is not allowed',
8024
8058
  uploadFailedMessage: 'File failed to upload', uploadSuccessMessage: 'File uploaded successfully',
@@ -8345,7 +8379,7 @@ var Uploader = /** @__PURE__ @class */ (function (_super) {
8345
8379
  for (var _i = 0, _a = Object.keys(this.htmlAttributes); _i < _a.length; _i++) {
8346
8380
  var pro = _a[_i];
8347
8381
  if (wrapperAttr$1.indexOf(pro) < 0) {
8348
- this.element.setAttribute(pro, this.htmlAttributes[pro]);
8382
+ this.element.setAttribute(pro, this.htmlAttributes["" + pro]);
8349
8383
  }
8350
8384
  }
8351
8385
  }
@@ -8356,19 +8390,19 @@ var Uploader = /** @__PURE__ @class */ (function (_super) {
8356
8390
  var pro = _a[_i];
8357
8391
  if (wrapperAttr$1.indexOf(pro) > -1) {
8358
8392
  if (pro === 'class') {
8359
- var updatedClassValues = (this.htmlAttributes[pro].replace(/\s+/g, ' ')).trim();
8393
+ var updatedClassValues = (this.htmlAttributes["" + pro].replace(/\s+/g, ' ')).trim();
8360
8394
  if (updatedClassValues !== '') {
8361
8395
  addClass([this.uploadWrapper], updatedClassValues.split(' '));
8362
8396
  }
8363
8397
  }
8364
8398
  else if (pro === 'style') {
8365
8399
  var uploadStyle = this.uploadWrapper.getAttribute(pro);
8366
- uploadStyle = !isNullOrUndefined(uploadStyle) ? (uploadStyle + this.htmlAttributes[pro]) :
8367
- this.htmlAttributes[pro];
8400
+ uploadStyle = !isNullOrUndefined(uploadStyle) ? (uploadStyle + this.htmlAttributes["" + pro]) :
8401
+ this.htmlAttributes["" + pro];
8368
8402
  this.uploadWrapper.setAttribute(pro, uploadStyle);
8369
8403
  }
8370
8404
  else {
8371
- this.uploadWrapper.setAttribute(pro, this.htmlAttributes[pro]);
8405
+ this.uploadWrapper.setAttribute(pro, this.htmlAttributes["" + pro]);
8372
8406
  }
8373
8407
  }
8374
8408
  }
@@ -8403,7 +8437,9 @@ var Uploader = /** @__PURE__ @class */ (function (_super) {
8403
8437
  Uploader.prototype.sequenceUpload = function (fileData) {
8404
8438
  if (this.filesData.length - fileData.length === 0 ||
8405
8439
  this.filesData[(this.filesData.length - fileData.length - 1)].statusCode !== '1') {
8406
- ++this.count;
8440
+ if (this.multiple || this.count < 0) {
8441
+ ++this.count;
8442
+ }
8407
8443
  var isFileListCreated = this.showFileList ? false : true;
8408
8444
  if (typeof this.filesData[this.count] === 'object') {
8409
8445
  this.isFirstFileOnSelection = false;
@@ -8751,7 +8787,7 @@ var Uploader = /** @__PURE__ @class */ (function (_super) {
8751
8787
  var data = customData[i];
8752
8788
  // eslint-disable-next-line @typescript-eslint/tslint/config
8753
8789
  var value = Object.keys(data).map(function (e) {
8754
- return data[e];
8790
+ return data["" + e];
8755
8791
  });
8756
8792
  formData.append(Object.keys(data)[0], value);
8757
8793
  };
@@ -8767,7 +8803,7 @@ var Uploader = /** @__PURE__ @class */ (function (_super) {
8767
8803
  var data = currentRequest[i];
8768
8804
  // eslint-disable-next-line @typescript-eslint/tslint/config
8769
8805
  var value = Object.keys(data).map(function (e) {
8770
- return data[e];
8806
+ return data["" + e];
8771
8807
  });
8772
8808
  request.setRequestHeader(Object.keys(data)[0], value);
8773
8809
  };
@@ -8978,6 +9014,20 @@ var Uploader = /** @__PURE__ @class */ (function (_super) {
8978
9014
  if (this.allowedExtensions.indexOf('*') > -1) {
8979
9015
  this.allTypes = true;
8980
9016
  }
9017
+ if (this.enableHtmlSanitizer) {
9018
+ for (var i = 0; i < fileData.length; i++) {
9019
+ var sanitizeFile = SanitizeHtmlHelper.beforeSanitize();
9020
+ var sanitizeFileName = SanitizeHtmlHelper.serializeValue(sanitizeFile, fileData[i].name);
9021
+ if (sanitizeFileName != fileData[i].name) {
9022
+ var encodedFileName = targetFiles[i].name.replace(/[\u00A0-\u9999<>\&]/g, function (i) {
9023
+ return '&#' + i.charCodeAt(0) + ';';
9024
+ });
9025
+ fileData[i].name = encodedFileName;
9026
+ fileData[i].status = this.localizedTexts('invalidFileName');
9027
+ fileData[i].statusCode = '0';
9028
+ }
9029
+ }
9030
+ }
8981
9031
  if (!this.allTypes) {
8982
9032
  fileData = this.checkExtension(fileData);
8983
9033
  }
@@ -9754,7 +9804,9 @@ var Uploader = /** @__PURE__ @class */ (function (_super) {
9754
9804
  this.pauseButton = null;
9755
9805
  }
9756
9806
  /* istanbul ignore next */
9757
- liElement.classList.add(RESTRICT_RETRY);
9807
+ if (!isNullOrUndefined(liElement)) {
9808
+ liElement.classList.add(RESTRICT_RETRY);
9809
+ }
9758
9810
  this.upload([file]);
9759
9811
  };
9760
9812
  /* istanbul ignore next */
@@ -10581,6 +10633,14 @@ var Uploader = /** @__PURE__ @class */ (function (_super) {
10581
10633
  detach(this.uploadWrapper);
10582
10634
  }
10583
10635
  this.uploadWrapper = null;
10636
+ this.uploadWrapper = null;
10637
+ this.browseButton = null;
10638
+ this.dropAreaWrapper = null;
10639
+ this.dropZoneElement = null;
10640
+ this.dropArea = null;
10641
+ this.keyboardModule = null;
10642
+ this.clearButton = null;
10643
+ this.uploadButton = null;
10584
10644
  _super.prototype.destroy.call(this);
10585
10645
  };
10586
10646
  /**
@@ -11078,6 +11138,9 @@ var Uploader = /** @__PURE__ @class */ (function (_super) {
11078
11138
  __decorate$4([
11079
11139
  Property(true)
11080
11140
  ], Uploader.prototype, "autoUpload", void 0);
11141
+ __decorate$4([
11142
+ Property(true)
11143
+ ], Uploader.prototype, "enableHtmlSanitizer", void 0);
11081
11144
  __decorate$4([
11082
11145
  Complex({}, ButtonsProps)
11083
11146
  ], Uploader.prototype, "buttons", void 0);
@@ -11709,7 +11772,7 @@ var ColorPicker = /** @__PURE__ @class */ (function (_super) {
11709
11772
  if (!wrapper.classList.contains(HIDEHEX)) {
11710
11773
  var hexInput = this.createElement('input', {
11711
11774
  className: HEX,
11712
- attrs: { 'maxlength': '7', 'spellcheck': 'false' }
11775
+ attrs: { 'maxlength': '7', 'spellcheck': 'false', 'aria-label': 'HEX' }
11713
11776
  });
11714
11777
  container.appendChild(hexInput);
11715
11778
  Input.createInput({
@@ -11751,7 +11814,8 @@ var ColorPicker = /** @__PURE__ @class */ (function (_super) {
11751
11814
  };
11752
11815
  ColorPicker.prototype.appendValueSwitchBtn = function (targetEle) {
11753
11816
  var valueSwitchBtn = this.createElement('button', {
11754
- className: 'e-icons e-css e-btn e-flat e-icon-btn ' + FORMATSWITCH
11817
+ className: 'e-icons e-css e-btn e-flat e-icon-btn ' + FORMATSWITCH,
11818
+ attrs: { 'title': 'Toggle format' }
11755
11819
  });
11756
11820
  targetEle.appendChild(valueSwitchBtn);
11757
11821
  if (this.isPicker() && !this.getWrapper().classList.contains(HIDERGBA)) {
@@ -11803,6 +11867,7 @@ var ColorPicker = /** @__PURE__ @class */ (function (_super) {
11803
11867
  });
11804
11868
  tooltip.createElement = this.createElement;
11805
11869
  tooltip.appendTo(this.container);
11870
+ // eslint-disable-next-line
11806
11871
  tooltip.open(this.container);
11807
11872
  this.tooltipEle.style.zIndex = getZindexPartial(this.tooltipEle).toString();
11808
11873
  select('.e-tip-content', this.tooltipEle).appendChild(this.createElement('div', { className: 'e-tip-transparent' }));
@@ -13420,19 +13485,19 @@ var TextBox = /** @__PURE__ @class */ (function (_super) {
13420
13485
  var key = _a[_i];
13421
13486
  if (containerAttr.indexOf(key) > -1) {
13422
13487
  if (key === 'class') {
13423
- var updatedClassValues = this.getInputValidClassList(this.htmlAttributes[key]);
13488
+ var updatedClassValues = this.getInputValidClassList(this.htmlAttributes["" + key]);
13424
13489
  if (updatedClassValues !== '') {
13425
13490
  addClass([this.textboxWrapper.container], updatedClassValues.split(' '));
13426
13491
  }
13427
13492
  }
13428
13493
  else if (key === 'style') {
13429
13494
  var setStyle = this.textboxWrapper.container.getAttribute(key);
13430
- setStyle = !isNullOrUndefined(setStyle) ? (setStyle + this.htmlAttributes[key]) :
13431
- this.htmlAttributes[key];
13495
+ setStyle = !isNullOrUndefined(setStyle) ? (setStyle + this.htmlAttributes["" + key]) :
13496
+ this.htmlAttributes["" + key];
13432
13497
  this.textboxWrapper.container.setAttribute(key, setStyle);
13433
13498
  }
13434
13499
  else {
13435
- this.textboxWrapper.container.setAttribute(key, this.htmlAttributes[key]);
13500
+ this.textboxWrapper.container.setAttribute(key, this.htmlAttributes["" + key]);
13436
13501
  }
13437
13502
  }
13438
13503
  }
@@ -13443,7 +13508,7 @@ var TextBox = /** @__PURE__ @class */ (function (_super) {
13443
13508
  for (var _i = 0, _a = Object.keys(this.htmlAttributes); _i < _a.length; _i++) {
13444
13509
  var key = _a[_i];
13445
13510
  if (containerAttr.indexOf(key) < 0) {
13446
- this.element.setAttribute(key, this.htmlAttributes[key]);
13511
+ this.element.setAttribute(key, this.htmlAttributes["" + key]);
13447
13512
  }
13448
13513
  }
13449
13514
  }
@@ -13649,6 +13714,7 @@ var TextBox = /** @__PURE__ @class */ (function (_super) {
13649
13714
  detach(this.textboxWrapper.container);
13650
13715
  }
13651
13716
  this.textboxWrapper = null;
13717
+ Input.destroy();
13652
13718
  _super.prototype.destroy.call(this);
13653
13719
  };
13654
13720
  /**
@@ -13690,17 +13756,17 @@ var TextBox = /** @__PURE__ @class */ (function (_super) {
13690
13756
  Input.setReadonly(this.readonly, this.respectiveElement);
13691
13757
  }
13692
13758
  else if (key === 'class') {
13693
- this.respectiveElement.classList.add(attributes$$1[key]);
13759
+ this.respectiveElement.classList.add(attributes$$1["" + key]);
13694
13760
  }
13695
13761
  else if (key === 'placeholder') {
13696
- this.setProperties({ placeholder: attributes$$1[key] }, true);
13762
+ this.setProperties({ placeholder: attributes$$1["" + key] }, true);
13697
13763
  Input.setPlaceholder(this.placeholder, this.respectiveElement);
13698
13764
  }
13699
13765
  else if (key === 'rows' && this.respectiveElement.tagName === 'TEXTAREA') {
13700
- this.respectiveElement.setAttribute(key, attributes$$1[key]);
13766
+ this.respectiveElement.setAttribute(key, attributes$$1["" + key]);
13701
13767
  }
13702
13768
  else {
13703
- this.respectiveElement.setAttribute(key, attributes$$1[key]);
13769
+ this.respectiveElement.setAttribute(key, attributes$$1["" + key]);
13704
13770
  }
13705
13771
  }
13706
13772
  };
@@ -13926,6 +13992,7 @@ var SignatureBase = /** @__PURE__ @class */ (function (_super) {
13926
13992
  this.canvasContext.canvas.style.backgroundColor = this.backgroundColor;
13927
13993
  }
13928
13994
  };
13995
+ // eslint-disable-next-line
13929
13996
  SignatureBase.prototype.mouseDownHandler = function (e, canvas, panStart, zoomState) {
13930
13997
  if (e.buttons === 1 || e.buttons === 2 || e.type === 'touchstart') {
13931
13998
  if (e.type === 'touchstart') {
@@ -14256,20 +14323,14 @@ var SignatureBase = /** @__PURE__ @class */ (function (_super) {
14256
14323
  SignatureBase.prototype.enableOrDisable = function (isDisable) {
14257
14324
  this.disabled = isDisable;
14258
14325
  if (isDisable) {
14259
- this.reDraw('0.5');
14326
+ this.canvasContext.canvas.style.filter = "opacity(0.5)";
14260
14327
  this.isRead(true);
14261
14328
  }
14262
14329
  else {
14263
- this.reDraw('1');
14330
+ this.canvasContext.canvas.style.filter = "";
14264
14331
  this.isRead(false);
14265
14332
  }
14266
14333
  };
14267
- SignatureBase.prototype.reDraw = function (opacity) {
14268
- var data = this.canvasContext.getImageData(0, 0, this.element.width, this.element.height);
14269
- this.canvasContext.clearRect(0, 0, this.element.width, this.element.height);
14270
- this.element.style.opacity = opacity;
14271
- this.canvasContext.putImageData(data, 0, 0);
14272
- };
14273
14334
  SignatureBase.prototype.updateSnapCollection = function (isClear) {
14274
14335
  if (isNullOrUndefined(this.incStep)) {
14275
14336
  this.incStep = -1;
@@ -14964,6 +15025,790 @@ var Signature = /** @__PURE__ @class */ (function (_super) {
14964
15025
  * Signature modules
14965
15026
  */
14966
15027
 
15028
+ var __extends$9 = (undefined && undefined.__extends) || (function () {
15029
+ var extendStatics = function (d, b) {
15030
+ extendStatics = Object.setPrototypeOf ||
15031
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
15032
+ function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
15033
+ return extendStatics(d, b);
15034
+ };
15035
+ return function (d, b) {
15036
+ extendStatics(d, b);
15037
+ function __() { this.constructor = d; }
15038
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15039
+ };
15040
+ })();
15041
+ var __decorate$8 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
15042
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
15043
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
15044
+ 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;
15045
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
15046
+ };
15047
+ var ICONCSS = 'e-rating-icon e-icons e-star-filled';
15048
+ var ITEMLIST = 'e-rating-item-list';
15049
+ var ITEMCONTAINER = 'e-rating-item-container';
15050
+ var SELECTED = 'e-rating-selected';
15051
+ var INTERMEDIATE = 'e-rating-intermediate';
15052
+ var LABEL = 'e-rating-label';
15053
+ var RESET = 'e-icons e-reset';
15054
+ var HIDDEN = 'e-rating-hidden';
15055
+ var DISABLED$2 = 'e-disabled';
15056
+ var READONLY = 'e-rating-readonly';
15057
+ var RTL$2 = 'e-rtl';
15058
+ var ANIMATION = 'e-rating-animation';
15059
+ var FULLTEMPLATE = 'e-rating-full';
15060
+ var EMPTYTEMPLATE = 'e-rating-empty';
15061
+ var SELECTEDVALUE = 'e-selected-value';
15062
+ var RATINGVALUE = '--rating-value';
15063
+ /**
15064
+ * Defines the position of the label in the rating.
15065
+ */
15066
+ var LabelPosition;
15067
+ (function (LabelPosition) {
15068
+ /**
15069
+ * Shows the label above the rating.
15070
+ */
15071
+ LabelPosition["Top"] = "Top";
15072
+ /**
15073
+ * Shows the label below the rating.
15074
+ */
15075
+ LabelPosition["Bottom"] = "Bottom";
15076
+ /**
15077
+ * Shows the label to the left of rating.
15078
+ */
15079
+ LabelPosition["Left"] = "Left";
15080
+ /**
15081
+ * Shows the label to the right of rating.
15082
+ */
15083
+ LabelPosition["Right"] = "Right";
15084
+ })(LabelPosition || (LabelPosition = {}));
15085
+ /**
15086
+ * Defines the minimum increase in the value in Rating Control.
15087
+ */
15088
+ var PrecisionType;
15089
+ (function (PrecisionType) {
15090
+ /**
15091
+ * Process the value as whole numbers.
15092
+ */
15093
+ PrecisionType["Full"] = "Full";
15094
+ /**
15095
+ * Process the value in terms of 0.5 (half).
15096
+ */
15097
+ PrecisionType["Half"] = "Half";
15098
+ /**
15099
+ * Process the value in terms of 0.25 (quarter).
15100
+ */
15101
+ PrecisionType["Quarter"] = "Quarter";
15102
+ /**
15103
+ * Process the value in terms of 0.1.
15104
+ */
15105
+ PrecisionType["Exact"] = "Exact";
15106
+ })(PrecisionType || (PrecisionType = {}));
15107
+ var Rating = /** @__PURE__ @class */ (function (_super) {
15108
+ __extends$9(Rating, _super);
15109
+ /**
15110
+ * Constructor for creating the widget
15111
+ *
15112
+ * @param {RatingModel} options - Specifies the rating model
15113
+ * @param {string|HTMLButtonElement} element - Specifies the target element
15114
+ */
15115
+ function Rating(options, element) {
15116
+ var _this = _super.call(this, options, element) || this;
15117
+ _this.itemElements = [];
15118
+ _this.tooltipOpen = false;
15119
+ return _this;
15120
+ }
15121
+ Rating.prototype.preRender = function () {
15122
+ if (!this.element.id) {
15123
+ this.element.id = getUniqueID('e-' + this.getModuleName());
15124
+ }
15125
+ this.keyConfigs = {
15126
+ downarrow: 'downarrow',
15127
+ leftarrow: 'leftarrow',
15128
+ rightarrow: 'rightarrow',
15129
+ uparrow: 'uparrow',
15130
+ space: 'space'
15131
+ };
15132
+ };
15133
+ Rating.prototype.render = function () {
15134
+ this.initialize();
15135
+ this.updateMinValue();
15136
+ this.updateTemplateFunction();
15137
+ this.renderItems();
15138
+ this.updatePrecision();
15139
+ this.displayLabel();
15140
+ };
15141
+ Rating.prototype.initialize = function () {
15142
+ this.wrapper = this.createElement('div', { className: 'e-' + this.getModuleName() + '-container ' });
15143
+ this.element.parentNode.insertBefore(this.wrapper, this.element);
15144
+ this.wrapper.appendChild(this.element);
15145
+ if ((this.element.getAttribute('name') == null)) {
15146
+ this.element.setAttribute('name', this.element.id);
15147
+ }
15148
+ attributes(this.element, { 'aria-label': 'rating' });
15149
+ this.renderItemList();
15150
+ this.updateReset();
15151
+ this.updateDisabled();
15152
+ this.wrapper.classList[this.readOnly ? 'add' : 'remove'](READONLY);
15153
+ this.wrapper.classList[!this.visible ? 'add' : 'remove'](HIDDEN);
15154
+ this.wrapper.classList[this.enableRtl ? 'add' : 'remove'](RTL$2);
15155
+ this.wrapper.classList[this.enableAnimation ? 'add' : 'remove'](ANIMATION);
15156
+ if (this.cssClass) {
15157
+ addClass([this.wrapper], this.cssClass.split(' '));
15158
+ }
15159
+ this.updateTooltip();
15160
+ this.wireKeyboardEvent();
15161
+ };
15162
+ Rating.prototype.updateDisabled = function () {
15163
+ this.wrapper.classList[this.disabled ? 'add' : 'remove'](DISABLED$2);
15164
+ attributes(this.ratingItemList, { 'tabindex': (this.disabled) ? '-1' : '0' });
15165
+ if (this.allowReset) {
15166
+ this.updateResetButton();
15167
+ }
15168
+ };
15169
+ Rating.prototype.updateResetButton = function () {
15170
+ var isDisabled = (this.value <= this.min) || this.disabled;
15171
+ this.resetElement.classList[isDisabled ? 'add' : 'remove'](DISABLED$2);
15172
+ attributes(this.resetElement, { 'aria-label': 'resetbutton', 'role': 'button',
15173
+ 'tabindex': (isDisabled ? '-1' : '0'), 'aria-hidden': isDisabled.toString() });
15174
+ };
15175
+ Rating.prototype.renderItemList = function () {
15176
+ var _this = this;
15177
+ this.ratingItemList = this.createElement('div', {
15178
+ className: ITEMLIST,
15179
+ id: this.element.id + '_item-list',
15180
+ attrs: { 'tabindex': '0' }
15181
+ });
15182
+ attributes(this.ratingItemList, { 'aria-label': 'rating', 'role': 'slider' });
15183
+ this.wrapper.appendChild(this.ratingItemList);
15184
+ EventHandler.add(this.ratingItemList, 'touchmove', function (e) { return _this.touchMoveHandler(e); }, this);
15185
+ EventHandler.add(this.ratingItemList, 'touchend', this.touchEndHandler, this);
15186
+ };
15187
+ Rating.prototype.touchMoveHandler = function (e) {
15188
+ var rect = this.ratingItemList.getBoundingClientRect();
15189
+ var x = e.touches[0].clientX - rect.x;
15190
+ var currValue = (x / rect.width) * this.itemsCount;
15191
+ currValue = (this.enableRtl) ? (this.itemsCount - currValue) : currValue;
15192
+ currValue = currValue < this.min ? this.min : currValue > this.itemsCount ? this.itemsCount : currValue;
15193
+ currValue = this.validateValue(currValue);
15194
+ var element = currValue === 0 ? null : this.itemElements[parseInt((Math.ceil(currValue) - 1).toString(), 10)];
15195
+ if (currValue === this.currentValue) {
15196
+ if (this.showTooltip && element) {
15197
+ this.openRatingTooltip(element, false);
15198
+ }
15199
+ return;
15200
+ }
15201
+ var previousValue = this.currentValue;
15202
+ this.updateCurrentValue(currValue);
15203
+ this.triggerChange(e, currValue);
15204
+ if (this.showTooltip) {
15205
+ if (element) {
15206
+ if (Math.ceil(currValue) !== Math.ceil(previousValue)) {
15207
+ this.closeRatingTooltip();
15208
+ }
15209
+ this.openRatingTooltip(element, true);
15210
+ }
15211
+ else {
15212
+ this.closeRatingTooltip();
15213
+ }
15214
+ }
15215
+ };
15216
+ Rating.prototype.touchEndHandler = function () {
15217
+ this.closeRatingTooltip();
15218
+ };
15219
+ Rating.prototype.updateTemplateFunction = function () {
15220
+ this.emptyTemplateFunction = this.emptyTemplate ? this.getTemplateString(this.emptyTemplate) : null;
15221
+ this.fullTemplateFunction = this.fullTemplate ? this.getTemplateString(this.fullTemplate) : null;
15222
+ };
15223
+ Rating.prototype.renderItems = function () {
15224
+ var _this = this;
15225
+ for (var i = 0; i < this.itemsCount; i++) {
15226
+ var ratingItemContainer = this.createElement('span', { className: ITEMCONTAINER });
15227
+ var spanItem = this.createElement('span', { className: 'e-rating-item' });
15228
+ var ratingValue = this.getRatingValue(this.value, i);
15229
+ this.renderItemContent(spanItem, ratingValue, i);
15230
+ ratingItemContainer.appendChild(spanItem);
15231
+ this.wireItemsEvents(ratingItemContainer, i + 1);
15232
+ this.itemElements.push(ratingItemContainer);
15233
+ var eventArgs = { element: ratingItemContainer, value: i + 1 };
15234
+ this.trigger('beforeItemRender', eventArgs, function (args) {
15235
+ _this.ratingItemList.appendChild(args.element);
15236
+ });
15237
+ }
15238
+ attributes(this.ratingItemList, { 'aria-valuemax': this.itemsCount.toString() });
15239
+ if (this.disabled) {
15240
+ attributes(this.ratingItemList, { 'tabindex': '-1' });
15241
+ }
15242
+ };
15243
+ Rating.prototype.renderItemContent = function (spanEle, val, index, isrerender) {
15244
+ if (isrerender === void 0) { isrerender = false; }
15245
+ if (isrerender) {
15246
+ this.removeItemContent(spanEle);
15247
+ }
15248
+ if (this.fullTemplate && val === 1) {
15249
+ spanEle.classList.add(FULLTEMPLATE);
15250
+ spanEle.append(this.fullTemplateFunction({ index: index, ratingValue: val }, this, 'ratingFullTemplate', (this.element.id + 'fullTemplate'), this.isStringTemplate)[0]);
15251
+ }
15252
+ else if (this.emptyTemplate) {
15253
+ spanEle.classList.add(EMPTYTEMPLATE);
15254
+ spanEle.append(this.emptyTemplateFunction({ index: index, ratingValue: val }, this, 'ratingEmptyTemplate', (this.element.id + 'emptyTemplate'), this.isStringTemplate)[0]);
15255
+ }
15256
+ else {
15257
+ addClass([spanEle], ICONCSS.split(' '));
15258
+ }
15259
+ };
15260
+ Rating.prototype.removeItemContent = function (spanEle) {
15261
+ spanEle.classList.remove(FULLTEMPLATE, EMPTYTEMPLATE);
15262
+ removeClass([spanEle], ICONCSS.split(' '));
15263
+ if (spanEle.firstChild) {
15264
+ spanEle.removeChild(spanEle.firstChild);
15265
+ }
15266
+ };
15267
+ Rating.prototype.updateTooltip = function () {
15268
+ if (this.showTooltip) {
15269
+ this.tooltipObj = new Tooltip({
15270
+ target: '.e-rating-item-container', windowCollision: true,
15271
+ opensOn: 'Custom', cssClass: 'e-rating-tooltip'
15272
+ });
15273
+ this.tooltipObj.appendTo('#' + this.ratingItemList.id);
15274
+ }
15275
+ else {
15276
+ if (!isNullOrUndefined(this.tooltipObj)) {
15277
+ this.tooltipObj.destroy();
15278
+ this.tooltipObj = null;
15279
+ }
15280
+ }
15281
+ };
15282
+ Rating.prototype.updateMinValue = function () {
15283
+ this.min = this.validateValue(this.min);
15284
+ if (this.min > 0 && this.value < this.min) {
15285
+ this.triggerChange(null, this.min, false);
15286
+ }
15287
+ attributes(this.ratingItemList, { 'aria-valuemin': this.min.toString() });
15288
+ };
15289
+ Rating.prototype.updatePrecision = function () {
15290
+ this.min = this.validateValue(this.min);
15291
+ this.triggerChange(null, this.validateValue(this.value), false);
15292
+ this.updateItemValue();
15293
+ };
15294
+ Rating.prototype.validateValue = function (currentValue) {
15295
+ if (currentValue > this.itemsCount) {
15296
+ currentValue = this.itemsCount;
15297
+ }
15298
+ else if (currentValue < 0) {
15299
+ currentValue = 0;
15300
+ }
15301
+ else {
15302
+ currentValue = (this.precision === PrecisionType.Full) ? Math.round(currentValue) :
15303
+ (this.precision === PrecisionType.Half) ? (Math.round(currentValue * 2) / 2) :
15304
+ (this.precision === PrecisionType.Quarter) ? (Math.round(currentValue * 4) / 4) : (Math.round(currentValue * 10) / 10);
15305
+ }
15306
+ return currentValue;
15307
+ };
15308
+ Rating.prototype.getRatingValue = function (value, i) {
15309
+ return (this.enableSingleSelection && this.precision === PrecisionType.Full) ? ((value === i + 1) ? 1 : 0) :
15310
+ (value >= i + 1) ? 1 : ((value < i) ? 0 : (value - i));
15311
+ };
15312
+ Rating.prototype.updateItemValue = function () {
15313
+ for (var i = 0; i < this.itemsCount; i++) {
15314
+ var itemElement = this.itemElements[parseInt(i.toString(), 10)];
15315
+ itemElement.classList.remove(SELECTED, INTERMEDIATE, SELECTEDVALUE);
15316
+ var ratingValue = this.getRatingValue(this.currentValue, i);
15317
+ if (ratingValue === 1) {
15318
+ itemElement.classList.add(SELECTED);
15319
+ }
15320
+ else if (ratingValue > 0) {
15321
+ itemElement.classList.add(INTERMEDIATE);
15322
+ }
15323
+ else if ((this.precision === PrecisionType.Full) && (i + 1 <= this.value) && (!this.enableSingleSelection)) {
15324
+ itemElement.classList.add(SELECTEDVALUE);
15325
+ }
15326
+ this.updateItemContent(ratingValue, i);
15327
+ itemElement.style.setProperty(RATINGVALUE, (ratingValue * 100) + '%');
15328
+ itemElement.classList[((this.value === 0) && (i === 0)) || (this.value === i + 1) || ((ratingValue > 0) && (ratingValue < 1)) ? 'add' : 'remove']('e-rating-focus');
15329
+ }
15330
+ if (this.allowReset) {
15331
+ this.updateResetButton();
15332
+ }
15333
+ attributes(this.ratingItemList, { 'aria-valuenow': this.currentValue.toString() });
15334
+ attributes(this.element, { 'value': this.value.toString() });
15335
+ };
15336
+ Rating.prototype.updateItemContent = function (ratingValue, index) {
15337
+ if (!this.fullTemplate && !this.emptyTemplate) {
15338
+ return;
15339
+ }
15340
+ var spanEle = this.itemElements[parseInt(index.toString(), 10)].querySelector('.e-rating-item');
15341
+ if (this.fullTemplate && ratingValue === 1) {
15342
+ if (spanEle.classList.contains(FULLTEMPLATE)) {
15343
+ return;
15344
+ }
15345
+ this.removeItemContent(spanEle);
15346
+ spanEle.classList.add(FULLTEMPLATE);
15347
+ spanEle.append(this.fullTemplateFunction({ ratingValue: ratingValue, index: index }, this, 'ratingFullTemplate', (this.element.id + 'fullTemplate'), this.isStringTemplate)[0]);
15348
+ }
15349
+ else if (this.emptyTemplate) {
15350
+ this.removeItemContent(spanEle);
15351
+ spanEle.classList.add(EMPTYTEMPLATE);
15352
+ spanEle.append(this.emptyTemplateFunction({ ratingValue: ratingValue, index: index }, this, 'ratingFullTemplate', (this.element.id + 'fullTemplate'), this.isStringTemplate)[0]);
15353
+ }
15354
+ else {
15355
+ this.removeItemContent(spanEle);
15356
+ addClass([spanEle], ICONCSS.split(' '));
15357
+ }
15358
+ this.renderReactTemplates();
15359
+ };
15360
+ Rating.prototype.updateTooltipContent = function (isChange) {
15361
+ if (this.showTooltip) {
15362
+ var content = void 0;
15363
+ if (this.tooltipTemplate) {
15364
+ var templateFunction = this.getTemplateString(this.tooltipTemplate);
15365
+ content = templateFunction({ value: this.currentValue }, this, 'ratingTooltipTemplate', (this.element.id + 'tooltipTemplate'), this.isStringTemplate)[0];
15366
+ }
15367
+ else {
15368
+ content = this.currentValue.toString();
15369
+ }
15370
+ this.tooltipObj.setProperties({ content: content }, isChange);
15371
+ this.renderReactTemplates();
15372
+ }
15373
+ };
15374
+ Rating.prototype.getTemplateString = function (template) {
15375
+ var stringContent = '';
15376
+ try {
15377
+ var tempEle = select(template);
15378
+ if (tempEle) {
15379
+ //Return innerHTML incase of jsrenderer script else outerHTML
15380
+ stringContent = tempEle.tagName === 'SCRIPT' ? tempEle.innerHTML : tempEle.outerHTML;
15381
+ }
15382
+ else {
15383
+ stringContent = template;
15384
+ }
15385
+ }
15386
+ catch (e) {
15387
+ stringContent = template;
15388
+ }
15389
+ return compile(stringContent);
15390
+ };
15391
+ Rating.prototype.displayLabel = function () {
15392
+ if (this.showLabel) {
15393
+ this.spanLabel = this.createElement('span', { className: LABEL });
15394
+ this.updateLabel();
15395
+ this.updateLabelPosition();
15396
+ }
15397
+ else {
15398
+ if (this.wrapper.contains(this.spanLabel)) {
15399
+ remove(this.spanLabel);
15400
+ this.spanLabel = null;
15401
+ }
15402
+ }
15403
+ };
15404
+ Rating.prototype.updateLabel = function () {
15405
+ if (this.showLabel) {
15406
+ if (this.labelTemplate) {
15407
+ if (this.spanLabel.firstChild) {
15408
+ this.spanLabel.removeChild(this.spanLabel.firstChild);
15409
+ }
15410
+ var templateFunction = this.getTemplateString(this.labelTemplate);
15411
+ this.spanLabel.append(templateFunction({ value: this.currentValue }, this, 'ratingLabelTemplate', (this.element.id + 'labelTemplate'), this.isStringTemplate)[0]);
15412
+ }
15413
+ else {
15414
+ this.spanLabel.textContent = this.currentValue + ' / ' + this.itemsCount;
15415
+ }
15416
+ this.renderReactTemplates();
15417
+ }
15418
+ };
15419
+ Rating.prototype.updateReset = function () {
15420
+ if (this.allowReset) {
15421
+ this.resetElement = this.createElement('span', { className: RESET });
15422
+ this.updateResetButton();
15423
+ EventHandler.add(this.resetElement, 'click', this.resetClicked, this);
15424
+ this.wrapper.insertBefore(this.resetElement, this.ratingItemList);
15425
+ }
15426
+ else {
15427
+ if (this.wrapper.contains(this.resetElement)) {
15428
+ remove(this.resetElement);
15429
+ this.resetElement = null;
15430
+ }
15431
+ }
15432
+ };
15433
+ Rating.prototype.updateLabelPosition = function () {
15434
+ this.clearLabelPosition();
15435
+ this.spanLabel.classList.add('e-label-' + this.labelPosition.toLowerCase());
15436
+ if (this.labelPosition === 'Left' || this.labelPosition === 'Top') {
15437
+ this.wrapper.firstChild.after(this.spanLabel);
15438
+ }
15439
+ else {
15440
+ this.wrapper.appendChild(this.spanLabel);
15441
+ }
15442
+ };
15443
+ Rating.prototype.clearLabelPosition = function () {
15444
+ var removeCss = this.spanLabel.classList.value.match(/(e-label-[top|bottom|right|left]+)/g);
15445
+ if (removeCss) {
15446
+ removeClass([this.spanLabel], removeCss);
15447
+ }
15448
+ };
15449
+ Rating.prototype.wireItemsEvents = function (itemElement, index) {
15450
+ var _this = this;
15451
+ EventHandler.add(itemElement, 'click', function (e) { return _this.clickHandler(e); }, this);
15452
+ EventHandler.add(itemElement, 'mousemove', function (e) { return _this.mouseMoveHandler(index, e); }, this);
15453
+ EventHandler.add(itemElement, 'mouseleave', this.mouseLeaveHandler, this);
15454
+ };
15455
+ Rating.prototype.clickHandler = function (e) {
15456
+ this.currentValue = (this.min > 0 && this.currentValue < this.min) ? this.min : this.currentValue;
15457
+ this.triggerChange(e, this.currentValue);
15458
+ this.updateItemValue();
15459
+ this.updateLabel();
15460
+ if (this.allowReset) {
15461
+ this.updateResetButton();
15462
+ }
15463
+ };
15464
+ Rating.prototype.triggerChange = function (e, val, isInteracted) {
15465
+ if (isInteracted === void 0) { isInteracted = true; }
15466
+ val = this.validateValue(val);
15467
+ this.currentValue = val;
15468
+ if (this.currentValue === this.value) {
15469
+ return;
15470
+ }
15471
+ var eventArgs = { event: e, isInteracted: isInteracted, value: val, previousValue: this.value };
15472
+ this.setProperties({ value: val }, true);
15473
+ this.trigger('valueChanged', eventArgs);
15474
+ };
15475
+ Rating.prototype.mouseMoveHandler = function (index, e) {
15476
+ var currValue = this.calculateCurrentValue(index, e);
15477
+ currValue = this.validateValue(currValue);
15478
+ var element = this.itemElements[parseInt((index - 1).toString(), 10)];
15479
+ if (currValue === this.currentValue) {
15480
+ this.openRatingTooltip(element, false);
15481
+ return;
15482
+ }
15483
+ this.updateCurrentValue(currValue);
15484
+ this.openRatingTooltip(element, true);
15485
+ var eventArgs = { element: element, event: e, value: currValue };
15486
+ this.trigger('onItemHover', eventArgs);
15487
+ };
15488
+ Rating.prototype.openRatingTooltip = function (element, isChange) {
15489
+ if (this.showTooltip) {
15490
+ if (!this.tooltipOpen) {
15491
+ this.updateTooltipContent(false);
15492
+ this.tooltipObj.open(element); //eslint-disable-line
15493
+ this.tooltipOpen = true;
15494
+ }
15495
+ else if (isChange) {
15496
+ this.updateTooltipContent(true);
15497
+ this.tooltipObj.refresh(element);
15498
+ }
15499
+ }
15500
+ };
15501
+ Rating.prototype.closeRatingTooltip = function () {
15502
+ if (this.tooltipOpen) {
15503
+ this.tooltipObj.close();
15504
+ this.tooltipOpen = false;
15505
+ }
15506
+ };
15507
+ Rating.prototype.updateCurrentValue = function (currValue) {
15508
+ this.currentValue = currValue;
15509
+ this.updateItemValue();
15510
+ this.updateLabel();
15511
+ };
15512
+ Rating.prototype.mouseLeaveHandler = function () {
15513
+ this.closeRatingTooltip();
15514
+ this.updateCurrentValue(this.value);
15515
+ };
15516
+ Rating.prototype.calculateCurrentValue = function (index, args) {
15517
+ var currentValue = index;
15518
+ if (this.precision !== PrecisionType.Full) {
15519
+ currentValue = args.offsetX / this.itemElements[index - 1].clientWidth;
15520
+ currentValue = (this.enableRtl) ? (1 - currentValue) : currentValue;
15521
+ if (this.precision === PrecisionType.Quarter) {
15522
+ currentValue = currentValue <= 0.25 ? 0.25 : currentValue <= 0.5 ? 0.5 : currentValue < 0.75 ? 0.75 : 1.0;
15523
+ }
15524
+ else if (this.precision === PrecisionType.Half) {
15525
+ currentValue = currentValue <= 0.5 ? 0.5 : 1;
15526
+ }
15527
+ currentValue = currentValue + index - 1;
15528
+ }
15529
+ return currentValue;
15530
+ };
15531
+ /**
15532
+ * Reset’s the value to minimum.
15533
+ *
15534
+ * @returns {void}
15535
+ */
15536
+ Rating.prototype.reset = function () {
15537
+ this.resetClicked(null, false);
15538
+ };
15539
+ Rating.prototype.resetClicked = function (e, isInteracted) {
15540
+ if (isInteracted === void 0) { isInteracted = true; }
15541
+ this.triggerChange(e, this.min, isInteracted);
15542
+ this.updateItemValue();
15543
+ this.updateLabel();
15544
+ this.updateResetButton();
15545
+ };
15546
+ Rating.prototype.wireKeyboardEvent = function () {
15547
+ this.keyboardModuleRating = new KeyboardEvents(this.wrapper, {
15548
+ keyAction: this.keyActionHandler.bind(this),
15549
+ keyConfigs: this.keyConfigs,
15550
+ eventName: 'keydown'
15551
+ });
15552
+ };
15553
+ Rating.prototype.keyActionHandler = function (e) {
15554
+ if (this.disabled || this.readOnly) {
15555
+ return;
15556
+ }
15557
+ if (e.target.classList.contains(ITEMLIST)) {
15558
+ switch (e.action) {
15559
+ case 'uparrow':
15560
+ this.handleNavigation(e, true);
15561
+ break;
15562
+ case 'downarrow':
15563
+ this.handleNavigation(e, false);
15564
+ break;
15565
+ case 'leftarrow':
15566
+ this.handleNavigation(e, this.enableRtl);
15567
+ break;
15568
+ case 'rightarrow':
15569
+ this.handleNavigation(e, !this.enableRtl);
15570
+ break;
15571
+ }
15572
+ }
15573
+ if (this.allowReset && e.target.classList.contains('e-reset')) {
15574
+ switch (e.action) {
15575
+ case 'space':
15576
+ this.resetClicked(e);
15577
+ break;
15578
+ }
15579
+ }
15580
+ };
15581
+ Rating.prototype.handleNavigation = function (e, isIncrease) {
15582
+ if ((!isIncrease && (this.value > this.min)) || (isIncrease && (this.value < this.itemsCount))) {
15583
+ var currentValue = (this.precision === PrecisionType.Full) ? 1 : (this.precision === PrecisionType.Half) ? 0.5 :
15584
+ (this.precision === PrecisionType.Quarter) ? 0.25 : Math.round(0.1 * 10) / 10;
15585
+ currentValue = isIncrease ? this.value + currentValue : this.value - currentValue;
15586
+ this.triggerChange(e, (currentValue));
15587
+ this.updateItemValue();
15588
+ this.updateLabel();
15589
+ if (this.allowReset) {
15590
+ this.updateResetButton();
15591
+ }
15592
+ }
15593
+ };
15594
+ Rating.prototype.updateContent = function () {
15595
+ for (var i = 0; i < this.itemsCount; i++) {
15596
+ var itemElement = this.itemElements[parseInt(i.toString(), 10)].firstElementChild;
15597
+ this.renderItemContent(itemElement, this.getRatingValue(this.value, i), i, true);
15598
+ }
15599
+ };
15600
+ /**
15601
+ * To get component name.
15602
+ *
15603
+ * @returns {string} - Module Name
15604
+ * @private
15605
+ */
15606
+ Rating.prototype.getModuleName = function () {
15607
+ return 'rating';
15608
+ };
15609
+ /**
15610
+ * To get the properties to be maintained in the persisted state.
15611
+ *
15612
+ * @returns {string} - Persist data
15613
+ */
15614
+ Rating.prototype.getPersistData = function () {
15615
+ return this.addOnPersist([]);
15616
+ };
15617
+ Rating.prototype.removeItemElements = function () {
15618
+ for (var i = 0; i < this.itemElements.length; i++) {
15619
+ remove(this.itemElements[parseInt(i.toString(), 10)]);
15620
+ }
15621
+ this.itemElements = [];
15622
+ };
15623
+ /**
15624
+ * Destroys the Rating instance.
15625
+ *
15626
+ * @returns {void}
15627
+ */
15628
+ Rating.prototype.destroy = function () {
15629
+ var _this = this;
15630
+ _super.prototype.destroy.call(this);
15631
+ // unwires the events and detach the li elements
15632
+ this.removeItemElements();
15633
+ if (this.spanLabel) {
15634
+ remove(this.spanLabel);
15635
+ this.spanLabel = null;
15636
+ }
15637
+ if (this.resetElement) {
15638
+ remove(this.resetElement);
15639
+ this.resetElement = null;
15640
+ }
15641
+ if (this.showTooltip) {
15642
+ this.tooltipObj.destroy();
15643
+ this.tooltipObj = null;
15644
+ }
15645
+ remove(this.ratingItemList);
15646
+ this.ratingItemList = null;
15647
+ this.wrapper.parentNode.insertBefore(this.element, this.wrapper);
15648
+ remove(this.wrapper);
15649
+ this.wrapper = null;
15650
+ this.keyboardModuleRating.destroy();
15651
+ ['value', 'aria-label', 'name'].forEach(function (attr) {
15652
+ _this.element.removeAttribute(attr);
15653
+ });
15654
+ };
15655
+ /**
15656
+ * Called internally if any of the property value changed.
15657
+ *
15658
+ * @param {RatingModel} newProp - Specifies new properties
15659
+ * @param {RatingModel} oldProp - Specifies old properties
15660
+ * @returns {void}
15661
+ * @private
15662
+ */
15663
+ Rating.prototype.onPropertyChanged = function (newProp, oldProp) {
15664
+ for (var _i = 0, _a = Object.keys(newProp); _i < _a.length; _i++) {
15665
+ var prop = _a[_i];
15666
+ switch (prop) {
15667
+ case 'value':
15668
+ this.triggerChange(null, (this.value > this.min) ? this.value : this.min, false);
15669
+ this.updateItemValue();
15670
+ this.updateLabel();
15671
+ break;
15672
+ case 'min':
15673
+ this.updateMinValue();
15674
+ this.updateItemValue();
15675
+ this.updateLabel();
15676
+ break;
15677
+ case 'showLabel':
15678
+ this.displayLabel();
15679
+ break;
15680
+ case 'visible':
15681
+ this.wrapper.classList[!this.visible ? 'add' : 'remove'](HIDDEN);
15682
+ break;
15683
+ case 'disabled':
15684
+ this.updateDisabled();
15685
+ break;
15686
+ case 'readOnly':
15687
+ this.wrapper.classList[this.readOnly ? 'add' : 'remove'](READONLY);
15688
+ break;
15689
+ case 'allowReset':
15690
+ this.updateReset();
15691
+ break;
15692
+ case 'enableRtl':
15693
+ this.wrapper.classList[this.enableRtl ? 'add' : 'remove'](RTL$2);
15694
+ break;
15695
+ case 'cssClass':
15696
+ if (oldProp.cssClass) {
15697
+ removeClass([this.wrapper], oldProp.cssClass.split(' '));
15698
+ }
15699
+ if (newProp.cssClass) {
15700
+ addClass([this.wrapper], newProp.cssClass.split(' '));
15701
+ }
15702
+ break;
15703
+ case 'labelPosition':
15704
+ this.updateLabelPosition();
15705
+ break;
15706
+ case 'showTooltip':
15707
+ this.updateTooltip();
15708
+ break;
15709
+ case 'precision':
15710
+ this.updatePrecision();
15711
+ this.updateLabel();
15712
+ break;
15713
+ case 'enableSingleSelection':
15714
+ this.updateItemValue();
15715
+ break;
15716
+ case 'enableAnimation':
15717
+ this.wrapper.classList[this.enableAnimation ? 'add' : 'remove'](ANIMATION);
15718
+ break;
15719
+ case 'emptyTemplate':
15720
+ case 'fullTemplate':
15721
+ this.updateTemplateFunction();
15722
+ this.updateContent();
15723
+ break;
15724
+ case 'labelTemplate':
15725
+ this.updateLabel();
15726
+ break;
15727
+ case 'itemsCount':
15728
+ this.removeItemElements();
15729
+ this.renderItems();
15730
+ this.updateItemValue();
15731
+ this.updateLabel();
15732
+ break;
15733
+ }
15734
+ }
15735
+ };
15736
+ __decorate$8([
15737
+ Property(false)
15738
+ ], Rating.prototype, "allowReset", void 0);
15739
+ __decorate$8([
15740
+ Property('')
15741
+ ], Rating.prototype, "cssClass", void 0);
15742
+ __decorate$8([
15743
+ Property(false)
15744
+ ], Rating.prototype, "disabled", void 0);
15745
+ __decorate$8([
15746
+ Property(true)
15747
+ ], Rating.prototype, "enableAnimation", void 0);
15748
+ __decorate$8([
15749
+ Property('')
15750
+ ], Rating.prototype, "emptyTemplate", void 0);
15751
+ __decorate$8([
15752
+ Property(false)
15753
+ ], Rating.prototype, "enableSingleSelection", void 0);
15754
+ __decorate$8([
15755
+ Property('')
15756
+ ], Rating.prototype, "fullTemplate", void 0);
15757
+ __decorate$8([
15758
+ Property(5)
15759
+ ], Rating.prototype, "itemsCount", void 0);
15760
+ __decorate$8([
15761
+ Property(LabelPosition.Right)
15762
+ ], Rating.prototype, "labelPosition", void 0);
15763
+ __decorate$8([
15764
+ Property('')
15765
+ ], Rating.prototype, "labelTemplate", void 0);
15766
+ __decorate$8([
15767
+ Property(0.0)
15768
+ ], Rating.prototype, "min", void 0);
15769
+ __decorate$8([
15770
+ Property(PrecisionType.Full)
15771
+ ], Rating.prototype, "precision", void 0);
15772
+ __decorate$8([
15773
+ Property(false)
15774
+ ], Rating.prototype, "readOnly", void 0);
15775
+ __decorate$8([
15776
+ Property(false)
15777
+ ], Rating.prototype, "showLabel", void 0);
15778
+ __decorate$8([
15779
+ Property(true)
15780
+ ], Rating.prototype, "showTooltip", void 0);
15781
+ __decorate$8([
15782
+ Property('')
15783
+ ], Rating.prototype, "tooltipTemplate", void 0);
15784
+ __decorate$8([
15785
+ Property(0.0)
15786
+ ], Rating.prototype, "value", void 0);
15787
+ __decorate$8([
15788
+ Property(true)
15789
+ ], Rating.prototype, "visible", void 0);
15790
+ __decorate$8([
15791
+ Event()
15792
+ ], Rating.prototype, "beforeItemRender", void 0);
15793
+ __decorate$8([
15794
+ Event()
15795
+ ], Rating.prototype, "created", void 0);
15796
+ __decorate$8([
15797
+ Event()
15798
+ ], Rating.prototype, "onItemHover", void 0);
15799
+ __decorate$8([
15800
+ Event()
15801
+ ], Rating.prototype, "valueChanged", void 0);
15802
+ Rating = __decorate$8([
15803
+ NotifyPropertyChanges
15804
+ ], Rating);
15805
+ return Rating;
15806
+ }(Component));
15807
+
15808
+ /**
15809
+ * Rating modules
15810
+ */
15811
+
14967
15812
  /**
14968
15813
  * Signature base modules
14969
15814
  */
@@ -14972,5 +15817,5 @@ var Signature = /** @__PURE__ @class */ (function (_super) {
14972
15817
  * NumericTextBox all modules
14973
15818
  */
14974
15819
 
14975
- 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 };
15820
+ 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 };
14976
15821
  //# sourceMappingURL=ej2-inputs.es5.js.map