@syncfusion/ej2-inputs 20.4.52 → 21.1.35

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 (102) hide show
  1. package/CHANGELOG.md +0 -27
  2. package/README.md +196 -119
  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 +168 -120
  7. package/dist/es6/ej2-inputs.es2015.js.map +1 -1
  8. package/dist/es6/ej2-inputs.es5.js +162 -114
  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 +10 -10
  14. package/src/color-picker/color-picker.d.ts +6 -1
  15. package/src/color-picker/color-picker.js +21 -4
  16. package/src/common/signature-base.js +6 -3
  17. package/src/form-validator/form-validator.js +23 -21
  18. package/src/input/input.js +10 -10
  19. package/src/maskedtextbox/base/mask-base.js +5 -5
  20. package/src/maskedtextbox/maskedtextbox/maskedtextbox.js +3 -3
  21. package/src/numerictextbox/numerictextbox.js +4 -4
  22. package/src/rating/rating-model.d.ts +33 -11
  23. package/src/rating/rating.d.ts +25 -1
  24. package/src/rating/rating.js +64 -45
  25. package/src/slider/slider-model.d.ts +41 -6
  26. package/src/slider/slider.d.ts +113 -8
  27. package/src/slider/slider.js +8 -3
  28. package/src/textbox/textbox.js +4 -2
  29. package/src/uploader/uploader-model.d.ts +1 -1
  30. package/src/uploader/uploader.js +14 -14
  31. package/styles/bootstrap-dark.css +6 -0
  32. package/styles/bootstrap.css +6 -0
  33. package/styles/bootstrap4.css +6 -0
  34. package/styles/bootstrap5-dark.css +10 -4
  35. package/styles/bootstrap5.css +10 -4
  36. package/styles/color-picker/_layout.scss +78 -6
  37. package/styles/color-picker/_theme.scss +3 -0
  38. package/styles/color-picker/bootstrap-dark.css +6 -0
  39. package/styles/color-picker/bootstrap.css +6 -0
  40. package/styles/color-picker/bootstrap4.css +6 -0
  41. package/styles/color-picker/bootstrap5-dark.css +6 -0
  42. package/styles/color-picker/bootstrap5.css +6 -0
  43. package/styles/color-picker/fabric-dark.css +6 -0
  44. package/styles/color-picker/fabric.css +6 -0
  45. package/styles/color-picker/fluent-dark.css +6 -0
  46. package/styles/color-picker/fluent.css +6 -0
  47. package/styles/color-picker/highcontrast-light.css +6 -0
  48. package/styles/color-picker/highcontrast.css +6 -0
  49. package/styles/color-picker/material-dark.css +6 -0
  50. package/styles/color-picker/material.css +6 -0
  51. package/styles/color-picker/tailwind-dark.css +6 -0
  52. package/styles/color-picker/tailwind.css +6 -0
  53. package/styles/fabric-dark.css +6 -0
  54. package/styles/fabric.css +6 -0
  55. package/styles/fluent-dark.css +6 -0
  56. package/styles/fluent.css +6 -0
  57. package/styles/highcontrast-light.css +6 -0
  58. package/styles/highcontrast.css +6 -0
  59. package/styles/input/_bootstrap5-definition.scss +2 -2
  60. package/styles/input/_fluent-definition.scss +5 -5
  61. package/styles/input/_layout.scss +445 -445
  62. package/styles/input/_tailwind-definition.scss +14 -14
  63. package/styles/input/_theme.scss +218 -199
  64. package/styles/input/material-dark.css +1 -1
  65. package/styles/input/material.css +1 -1
  66. package/styles/maskedtextbox/_bootstrap5-definition.scss +2 -2
  67. package/styles/maskedtextbox/_fluent-definition.scss +2 -2
  68. package/styles/material-dark.css +7 -5
  69. package/styles/material.css +7 -1
  70. package/styles/numerictextbox/icons/_material3.scss +3 -3
  71. package/styles/rating/_bootstrap5-definition.scss +12 -15
  72. package/styles/rating/_fluent-definition.scss +12 -15
  73. package/styles/rating/_tailwind-definition.scss +12 -15
  74. package/styles/rating/_theme.scss +14 -2
  75. package/styles/rating/tailwind-dark.css +1 -1
  76. package/styles/rating/tailwind.css +1 -1
  77. package/styles/slider/_layout.scss +44 -25
  78. package/styles/slider/_theme.scss +6 -1
  79. package/styles/tailwind-dark.css +8 -2
  80. package/styles/tailwind.css +8 -2
  81. package/styles/uploader/_bootstrap5-definition.scss +12 -12
  82. package/styles/uploader/_fluent-definition.scss +10 -10
  83. package/styles/uploader/_layout.scss +7 -2
  84. package/styles/uploader/_tailwind-definition.scss +10 -10
  85. package/styles/uploader/_theme.scss +13 -3
  86. package/styles/uploader/bootstrap5-dark.css +4 -4
  87. package/styles/uploader/bootstrap5.css +4 -4
  88. package/styles/uploader/material-dark.css +0 -4
  89. package/styles/uploader/tailwind-dark.css +1 -1
  90. package/styles/uploader/tailwind.css +1 -1
  91. package/GitLeaksReport.json +0 -42
  92. package/gitleaks-ci/gitleaks +0 -0
  93. package/gitleaks-ci.tar.gz +0 -0
  94. package/styles/color-picker/_material3-definition.scss +0 -133
  95. package/styles/input/_material3-definition.scss +0 -336
  96. package/styles/maskedtextbox/_material3-definition.scss +0 -7
  97. package/styles/numerictextbox/_material3-definition.scss +0 -3
  98. package/styles/rating/_material3-definition.scss +0 -46
  99. package/styles/signature/_material3-definition.scss +0 -3
  100. package/styles/slider/_material3-definition.scss +0 -90
  101. package/styles/textbox/_material3-definition.scss +0 -1
  102. package/styles/uploader/_material3-definition.scss +0 -216
@@ -296,7 +296,7 @@ var Input;
296
296
  }
297
297
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
298
298
  function wireClearBtnEvents(element, button, container) {
299
- if (isBindClearAction == undefined || isBindClearAction) {
299
+ if (isBindClearAction === undefined || isBindClearAction) {
300
300
  button.addEventListener('click', (event) => {
301
301
  if (!(element.classList.contains(CLASSNAMES.DISABLE) || element.readOnly)) {
302
302
  event.preventDefault();
@@ -425,7 +425,7 @@ var Input;
425
425
  * @param {HTMLElement} container - The parent element which is need to get the label span to calculate width
426
426
  */
427
427
  function calculateWidth(element, container, moduleName) {
428
- let elementWidth = moduleName === 'multiselect' ? element : element.clientWidth - parseInt(getComputedStyle(element, null).getPropertyValue('padding-left'));
428
+ const elementWidth = moduleName === 'multiselect' ? element : element.clientWidth - parseInt(getComputedStyle(element, null).getPropertyValue('padding-left'), 10);
429
429
  if (!isNullOrUndefined(container.getElementsByClassName('e-float-text-content')[0])) {
430
430
  if (container.getElementsByClassName('e-float-text-content')[0].classList.contains('e-float-text-overflow')) {
431
431
  container.getElementsByClassName('e-float-text-content')[0].classList.remove('e-float-text-overflow');
@@ -625,10 +625,10 @@ var Input;
625
625
  parentElement.classList.add(CLASSNAMES.DISABLE);
626
626
  }
627
627
  if (key === 'placeholder' && parentElement.classList.contains(CLASSNAMES.FLOATINPUT)) {
628
- parentElement.getElementsByClassName(CLASSNAMES.FLOATTEXT)[0].textContent = attrs[key];
628
+ parentElement.getElementsByClassName(CLASSNAMES.FLOATTEXT)[0].textContent = attrs[`${key}`];
629
629
  }
630
630
  else {
631
- element.setAttribute(key, attrs[key]);
631
+ element.setAttribute(key, attrs[`${key}`]);
632
632
  }
633
633
  }
634
634
  }
@@ -730,7 +730,7 @@ var Input;
730
730
  */
731
731
  function setRipple(isRipple, inputObj) {
732
732
  for (let i = 0; i < inputObj.length; i++) {
733
- _internalRipple(isRipple, inputObj[i].container);
733
+ _internalRipple(isRipple, inputObj[parseInt(i.toString())].container);
734
734
  }
735
735
  }
736
736
  Input.setRipple = setRipple;
@@ -741,14 +741,14 @@ var Input;
741
741
  container.querySelectorAll('.e-input-group-icon') : argsButton;
742
742
  if (isRipple && buttons.length > 0) {
743
743
  for (let index = 0; index < buttons.length; index++) {
744
- buttons[index].addEventListener('mousedown', _onMouseDownRipple, false);
745
- buttons[index].addEventListener('mouseup', _onMouseUpRipple, false);
744
+ buttons[parseInt(index.toString())].addEventListener('mousedown', _onMouseDownRipple, false);
745
+ buttons[parseInt(index.toString())].addEventListener('mouseup', _onMouseUpRipple, false);
746
746
  }
747
747
  }
748
748
  else if (buttons.length > 0) {
749
749
  for (let index = 0; index < buttons.length; index++) {
750
- buttons[index].removeEventListener('mousedown', _onMouseDownRipple, this);
751
- buttons[index].removeEventListener('mouseup', _onMouseUpRipple, this);
750
+ buttons[parseInt(index.toString())].removeEventListener('mousedown', _onMouseDownRipple, this);
751
+ buttons[parseInt(index.toString())].removeEventListener('mouseup', _onMouseUpRipple, this);
752
752
  }
753
753
  }
754
754
  }
@@ -834,7 +834,7 @@ var Input;
834
834
  const result = container.querySelectorAll(inputElement.tagName + ' ~ *');
835
835
  innerWrapper.appendChild(inputElement);
836
836
  for (let i = 0; i < result.length; i++) {
837
- innerWrapper.appendChild(result[i]);
837
+ innerWrapper.appendChild(result[parseInt(i.toString())]);
838
838
  }
839
839
  }
840
840
  innerWrapper.parentNode.insertBefore(button, innerWrapper);
@@ -1022,7 +1022,7 @@ let NumericTextBox = class NumericTextBox extends Component {
1022
1022
  if (this.element.hasAttribute('data-val')) {
1023
1023
  this.element.setAttribute('data-val', 'false');
1024
1024
  }
1025
- if (!isNullOrUndefined(closest(this.element, "fieldset")) && closest(this.element, "fieldset").disabled) {
1025
+ if (!isNullOrUndefined(closest(this.element, 'fieldset')) && closest(this.element, 'fieldset').disabled) {
1026
1026
  this.enabled = false;
1027
1027
  }
1028
1028
  this.renderComplete();
@@ -1709,8 +1709,8 @@ let NumericTextBox = class NumericTextBox extends Component {
1709
1709
  return true;
1710
1710
  }
1711
1711
  let currentChar = String.fromCharCode(event.which);
1712
- let decimalSeparator = getValue('decimal', getNumericObject(this.locale));
1713
- let isAlterNumPadDecimalChar = event.code === "NumpadDecimal" && currentChar !== decimalSeparator;
1712
+ const decimalSeparator = getValue('decimal', getNumericObject(this.locale));
1713
+ const isAlterNumPadDecimalChar = event.code === 'NumpadDecimal' && currentChar !== decimalSeparator;
1714
1714
  //EJ2-59813-replace the culture decimal separator value with numberpad decimal separator value when culture decimal separator and numberpad decimal separator are different
1715
1715
  if (isAlterNumPadDecimalChar) {
1716
1716
  currentChar = decimalSeparator;
@@ -1747,7 +1747,7 @@ let NumericTextBox = class NumericTextBox extends Component {
1747
1747
  if (this.decimals && this.validateDecimalOnType) {
1748
1748
  fractionRule = '{0,' + this.decimals + '}';
1749
1749
  }
1750
- // eslint-disable-next-line detect-non-literal-regexp
1750
+ /* eslint-disable-next-line security/detect-non-literal-regexp */
1751
1751
  return new RegExp('^(-)?(((\\d+(' + decimalSeparator + '\\d' + fractionRule +
1752
1752
  ')?)|(' + decimalSeparator + '\\d' + fractionRule + ')))?$');
1753
1753
  }
@@ -1857,8 +1857,8 @@ let NumericTextBox = class NumericTextBox extends Component {
1857
1857
  }
1858
1858
  touchMoveOnSpinner(event) {
1859
1859
  let target;
1860
- if (event.type === "touchmove") {
1861
- let touchEvent = event.touches;
1860
+ if (event.type === 'touchmove') {
1861
+ const touchEvent = event.touches;
1862
1862
  target = touchEvent.length && document.elementFromPoint(touchEvent[0].pageX, touchEvent[0].pageY);
1863
1863
  }
1864
1864
  else {
@@ -2318,7 +2318,7 @@ function createMask() {
2318
2318
  if (!isNullOrUndefined(this.customCharacters)) {
2319
2319
  for (let i = 0; i < this.promptMask.length; i++) {
2320
2320
  if (!isNullOrUndefined(this.customCharacters[this.promptMask[i]])) {
2321
- // eslint-disable-next-line detect-non-literal-regexp
2321
+ /* eslint-disable-next-line security/detect-non-literal-regexp */
2322
2322
  this.promptMask = this.promptMask.replace(new RegExp(this.promptMask[i], 'g'), this.promptChar);
2323
2323
  }
2324
2324
  }
@@ -2617,7 +2617,7 @@ function maskInputBlurHandler(event) {
2617
2617
  event: event,
2618
2618
  value: this.value,
2619
2619
  maskedValue: this.element.value,
2620
- container: !isNullOrUndefined(this.inputObj) ? this.inputObj.container : this.inputObj,
2620
+ container: !isNullOrUndefined(this.inputObj) ? this.inputObj.container : this.inputObj
2621
2621
  };
2622
2622
  this.trigger('blur', this.blurEventArgs);
2623
2623
  if (this.mask) {
@@ -3078,13 +3078,13 @@ function validateValue(key, isCtrlKey, event) {
3078
3078
  const customValStr = this.customCharacters[`${curMask}`];
3079
3079
  const customValArr = customValStr.split(',');
3080
3080
  for (let i = 0; i < customValArr.length; i++) {
3081
- // eslint-disable-next-line detect-non-literal-regexp
3081
+ /* eslint-disable-next-line security/detect-non-literal-regexp */
3082
3082
  if (keyValue.match(new RegExp('[' + customValArr[i] + ']'))) {
3083
3083
  allowText = true;
3084
3084
  break;
3085
3085
  }
3086
3086
  }
3087
- // eslint-disable-next-line detect-non-literal-regexp
3087
+ /* eslint-disable-next-line security/detect-non-literal-regexp */
3088
3088
  }
3089
3089
  else if (!isNullOrUndefined(this.regExpCollec[`${curMask}`]) && keyValue.match(new RegExp(this.regExpCollec[`${curMask}`]))
3090
3090
  && this.promptMask[startIndex] === this.promptChar) {
@@ -3092,7 +3092,7 @@ function validateValue(key, isCtrlKey, event) {
3092
3092
  }
3093
3093
  else if (this.promptMask[startIndex] === this.promptChar && this.customRegExpCollec[startIndex][0] === '['
3094
3094
  && this.customRegExpCollec[startIndex][this.customRegExpCollec[startIndex].length - 1] === ']'
3095
- // eslint-disable-next-line detect-non-literal-regexp
3095
+ /* eslint-disable-next-line security/detect-non-literal-regexp */
3096
3096
  && keyValue.match(new RegExp(this.customRegExpCollec[startIndex]))) {
3097
3097
  allowText = true;
3098
3098
  }
@@ -3744,13 +3744,13 @@ let MaskedTextBox = class MaskedTextBox extends Component {
3744
3744
  else {
3745
3745
  this.promptChar = '_';
3746
3746
  }
3747
- // eslint-disable-next-line detect-non-literal-regexp
3747
+ /* eslint-disable-next-line security/detect-non-literal-regexp */
3748
3748
  let value = this.element.value.replace(new RegExp('[' + oldProp.promptChar + ']', 'g'), this.promptChar);
3749
3749
  if (this.promptMask === this.element.value) {
3750
- // eslint-disable-next-line detect-non-literal-regexp
3750
+ /* eslint-disable-next-line security/detect-non-literal-regexp */
3751
3751
  value = this.promptMask.replace(new RegExp('[' + oldProp.promptChar + ']', 'g'), this.promptChar);
3752
3752
  }
3753
- // eslint-disable-next-line detect-non-literal-regexp
3753
+ /* eslint-disable-next-line security/detect-non-literal-regexp */
3754
3754
  this.promptMask = this.promptMask.replace(new RegExp('[' + oldProp.promptChar + ']', 'g'), this.promptChar);
3755
3755
  this.undoCollec = this.redoCollec = [];
3756
3756
  setElementValue.call(this, value);
@@ -4155,6 +4155,7 @@ let Slider = class Slider extends Component {
4155
4155
  }
4156
4156
  /**
4157
4157
  * To Initialize the control rendering
4158
+ *
4158
4159
  * @private
4159
4160
  */
4160
4161
  render() {
@@ -4164,7 +4165,7 @@ let Slider = class Slider extends Component {
4164
4165
  this.setZindex();
4165
4166
  this.renderComplete();
4166
4167
  if (this.element.tagName === 'EJS-SLIDER') {
4167
- if (this.getTheme(this.sliderContainer) == "none") {
4168
+ if (this.getTheme(this.sliderContainer) == 'none') {
4168
4169
  setTimeout(() => {
4169
4170
  this.refresh();
4170
4171
  }, 0);
@@ -4215,6 +4216,7 @@ let Slider = class Slider extends Component {
4215
4216
  }
4216
4217
  /**
4217
4218
  * Initialize the rendering
4219
+ *
4218
4220
  * @private
4219
4221
  */
4220
4222
  initRender() {
@@ -4807,7 +4809,6 @@ let Slider = class Slider extends Component {
4807
4809
  this.sliderContainer.classList.add(classNames.materialSlider);
4808
4810
  this.tooltipValue();
4809
4811
  this.tooltipObj.animation.close.effect = 'None';
4810
- // eslint-disable-next-line security/detect-non-literal-fs-filename -- Safe as no value holds user input
4811
4812
  this.tooltipObj.open(this.firstHandle);
4812
4813
  }
4813
4814
  }
@@ -5632,6 +5633,7 @@ let Slider = class Slider extends Component {
5632
5633
  }
5633
5634
  /**
5634
5635
  * It is used to reposition slider.
5636
+ *
5635
5637
  * @returns void
5636
5638
  */
5637
5639
  reposition() {
@@ -6131,7 +6133,6 @@ let Slider = class Slider extends Component {
6131
6133
  openTooltip(target) {
6132
6134
  if (this.tooltip.isVisible && this.tooltipObj && !this.isMaterialTooltip) {
6133
6135
  this.tooltipValue();
6134
- // eslint-disable-next-line security/detect-non-literal-fs-filename -- Safe as no value holds user input
6135
6136
  this.tooltipObj.open(target);
6136
6137
  this.tooltipTarget = target;
6137
6138
  }
@@ -6450,6 +6451,7 @@ let Slider = class Slider extends Component {
6450
6451
  }
6451
6452
  /**
6452
6453
  * Get the properties to be maintained in the persisted state.
6454
+ *
6453
6455
  * @private
6454
6456
  */
6455
6457
  getPersistData() {
@@ -6459,6 +6461,7 @@ let Slider = class Slider extends Component {
6459
6461
  /**
6460
6462
  * Removes the component from the DOM and detaches all its related event handlers.
6461
6463
  * Also it removes the attributes and classes.
6464
+ *
6462
6465
  * @method destroy
6463
6466
  * @return {void}
6464
6467
  */
@@ -6480,6 +6483,7 @@ let Slider = class Slider extends Component {
6480
6483
  }
6481
6484
  /**
6482
6485
  * Calls internally if any of the property value is changed.
6486
+ *
6483
6487
  * @private
6484
6488
  */
6485
6489
  // tslint:disable-next-line
@@ -6695,6 +6699,7 @@ let Slider = class Slider extends Component {
6695
6699
  }
6696
6700
  /**
6697
6701
  * Gets the component name
6702
+ *
6698
6703
  * @private
6699
6704
  */
6700
6705
  getModuleName() {
@@ -6796,6 +6801,7 @@ const regex = {
6796
6801
  /* eslint-disable no-useless-escape */
6797
6802
  EMAIL: new RegExp('^[A-Za-z0-9._%+-]{1,}@[A-Za-z0-9._%+-]{1,}([.]{1}[a-zA-Z0-9]{2,}' +
6798
6803
  '|[.]{1}[a-zA-Z0-9]{2,4}[.]{1}[a-zA-Z0-9]{2,4})$'),
6804
+ /* eslint-disable-next-line security/detect-unsafe-regex */
6799
6805
  URL: /^(?:http(s)?:\/\/)?[\w.-]+(?:\.[\w\.-]+)+[\w\-\._~:/?#[\]@!\$&'\(\)\*\+,;=.]+$/m,
6800
6806
  DATE_ISO: new RegExp('^([0-9]{4})-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])$'),
6801
6807
  DIGITS: new RegExp('^[0-9]*$'),
@@ -6910,10 +6916,10 @@ let FormValidator = FormValidator_1 = class FormValidator extends Base {
6910
6916
  if (name) {
6911
6917
  // eslint-disable-next-line no-prototype-builtins
6912
6918
  if (this.rules.hasOwnProperty(name)) {
6913
- extend(this.rules[name], rules, {});
6919
+ extend(this.rules[`${name}`], rules, {});
6914
6920
  }
6915
6921
  else {
6916
- this.rules[name] = rules;
6922
+ this.rules[`${name}`] = rules;
6917
6923
  }
6918
6924
  }
6919
6925
  }
@@ -6929,12 +6935,12 @@ let FormValidator = FormValidator_1 = class FormValidator extends Base {
6929
6935
  if (!name && !rules) {
6930
6936
  this.rules = {};
6931
6937
  }
6932
- else if (this.rules[name] && !rules) {
6933
- delete this.rules[name];
6938
+ else if (this.rules[`${name}`] && !rules) {
6939
+ delete this.rules[`${name}`];
6934
6940
  }
6935
- else if (!isNullOrUndefined(this.rules[name] && rules)) {
6941
+ else if (!isNullOrUndefined(this.rules[`${name}`] && rules)) {
6936
6942
  for (let i = 0; i < rules.length; i++) {
6937
- delete this.rules[name][rules[i]];
6943
+ delete this.rules[`${name}`][rules[parseInt(i.toString())]];
6938
6944
  }
6939
6945
  }
6940
6946
  else {
@@ -7028,7 +7034,7 @@ let FormValidator = FormValidator_1 = class FormValidator extends Base {
7028
7034
  for (const key of Object.keys(this.defaultMessages)) {
7029
7035
  this.l10n.setLocale(this.locale);
7030
7036
  const value = this.l10n.getConstant(key);
7031
- this.localyMessage[key] = value;
7037
+ this.localyMessage[`${key}`] = value;
7032
7038
  }
7033
7039
  }
7034
7040
  /**
@@ -7174,7 +7180,7 @@ let FormValidator = FormValidator_1 = class FormValidator extends Base {
7174
7180
  let customMessage;
7175
7181
  if (this.rules[input.name] && ruleName !== 'validateHidden' && ruleName !== 'hidden') {
7176
7182
  this.getInputElement(input.name);
7177
- customMessage = this.getErrorMessage(this.rules[input.name][ruleName], ruleName);
7183
+ customMessage = this.getErrorMessage(this.rules[input.name][`${ruleName}`], ruleName);
7178
7184
  }
7179
7185
  if (message) {
7180
7186
  value = [value, message];
@@ -7185,7 +7191,7 @@ let FormValidator = FormValidator_1 = class FormValidator extends Base {
7185
7191
  else if (customMessage) {
7186
7192
  value = [value, customMessage];
7187
7193
  }
7188
- ruleCon[ruleName] = value;
7194
+ ruleCon[`${ruleName}`] = value;
7189
7195
  }
7190
7196
  // Wire events to the form elements
7191
7197
  wireEvents() {
@@ -7276,10 +7282,10 @@ let FormValidator = FormValidator_1 = class FormValidator extends Base {
7276
7282
  }
7277
7283
  // Validate each rule based on input element name
7278
7284
  validateRules(name) {
7279
- if (!this.rules[name]) {
7285
+ if (!this.rules[`${name}`]) {
7280
7286
  return;
7281
7287
  }
7282
- const rules = Object.keys(this.rules[name]);
7288
+ const rules = Object.keys(this.rules[`${name}`]);
7283
7289
  let hiddenType = false;
7284
7290
  let validateHiddenType = false;
7285
7291
  const vhPos = rules.indexOf('validateHidden');
@@ -7300,7 +7306,7 @@ let FormValidator = FormValidator_1 = class FormValidator extends Base {
7300
7306
  }
7301
7307
  this.getErrorElement(name);
7302
7308
  for (const rule of rules) {
7303
- const errorMessage = this.getErrorMessage(this.rules[name][rule], rule);
7309
+ const errorMessage = this.getErrorMessage(this.rules[`${name}`][`${rule}`], rule);
7304
7310
  const errorRule = { name: name, message: errorMessage };
7305
7311
  const eventArgs = {
7306
7312
  inputName: name,
@@ -7346,7 +7352,7 @@ let FormValidator = FormValidator_1 = class FormValidator extends Base {
7346
7352
  }
7347
7353
  // Update the optional validation status
7348
7354
  optionalValidationStatus(name, refer) {
7349
- if (!this.rules[name][this.required] && !this.inputElement.value.length && !isNullOrUndefined(this.infoElement)) {
7355
+ if (!this.rules[`${name}`][this.required] && !this.inputElement.value.length && !isNullOrUndefined(this.infoElement)) {
7350
7356
  this.infoElement.innerHTML = this.inputElement.value;
7351
7357
  this.infoElement.setAttribute('aria-invalid', 'false');
7352
7358
  refer.status = '';
@@ -7355,9 +7361,9 @@ let FormValidator = FormValidator_1 = class FormValidator extends Base {
7355
7361
  }
7356
7362
  // Check the input element whether it's value satisfy the validation rule or not
7357
7363
  isValid(name, rule) {
7358
- const params = this.rules[name][rule];
7364
+ const params = this.rules[`${name}`][`${rule}`];
7359
7365
  const param = (params instanceof Array && typeof params[1] === 'string') ? params[0] : params;
7360
- const currentRule = this.rules[name][rule];
7366
+ const currentRule = this.rules[`${name}`][`${rule}`];
7361
7367
  const args = { value: this.inputElement.value, param: param, element: this.inputElement, formElement: this.element };
7362
7368
  this.trigger('validationBegin', args);
7363
7369
  if (!args.param && rule === 'required') {
@@ -7374,7 +7380,7 @@ let FormValidator = FormValidator_1 = class FormValidator extends Base {
7374
7380
  return selectAll('input[name="' + name + '"]:checked', this.element).length > 0;
7375
7381
  }
7376
7382
  else {
7377
- return FormValidator_1.checkValidator[rule](args);
7383
+ return FormValidator_1.checkValidator[`${rule}`](args);
7378
7384
  }
7379
7385
  }
7380
7386
  // Return default error message or custom error message
@@ -7382,12 +7388,12 @@ let FormValidator = FormValidator_1 = class FormValidator extends Base {
7382
7388
  let message = this.inputElement.getAttribute('data-' + rule + '-message') ?
7383
7389
  this.inputElement.getAttribute('data-' + rule + '-message') :
7384
7390
  (ruleValue instanceof Array && typeof ruleValue[1] === 'string') ? ruleValue[1] :
7385
- (Object.keys(this.localyMessage).length !== 0) ? this.localyMessage[rule] : this.defaultMessages[rule];
7391
+ (Object.keys(this.localyMessage).length !== 0) ? this.localyMessage[`${rule}`] : this.defaultMessages[`${rule}`];
7386
7392
  const formats = message.match(/{(\d)}/g);
7387
7393
  if (!isNullOrUndefined(formats)) {
7388
7394
  for (let i = 0; i < formats.length; i++) {
7389
- const value = ruleValue instanceof Array ? ruleValue[i] : ruleValue;
7390
- message = message.replace(formats[i], value);
7395
+ const value = ruleValue instanceof Array ? ruleValue[parseInt(i.toString())] : ruleValue;
7396
+ message = message.replace(formats[parseInt(i.toString())], value);
7391
7397
  }
7392
7398
  }
7393
7399
  return message;
@@ -7439,7 +7445,7 @@ let FormValidator = FormValidator_1 = class FormValidator extends Base {
7439
7445
  // Remove existing rule from errorRules object
7440
7446
  removeErrorRules(name) {
7441
7447
  for (let i = 0; i < this.errorRules.length; i++) {
7442
- const rule = this.errorRules[i];
7448
+ const rule = this.errorRules[parseInt(i.toString())];
7443
7449
  if (rule.name === name) {
7444
7450
  this.errorRules.splice(i, 1);
7445
7451
  }
@@ -7463,7 +7469,7 @@ let FormValidator = FormValidator_1 = class FormValidator extends Base {
7463
7469
  }
7464
7470
  // Check whether the input element have required rule and its value is not empty
7465
7471
  checkRequired(name) {
7466
- if (!this.rules[name][this.required] && !this.inputElement.value.length && !isNullOrUndefined(this.infoElement)) {
7472
+ if (!this.rules[`${name}`][this.required] && !this.inputElement.value.length && !isNullOrUndefined(this.infoElement)) {
7467
7473
  this.infoElement.innerHTML = this.inputElement.value;
7468
7474
  this.infoElement.setAttribute('aria-invalid', 'false');
7469
7475
  this.hideMessage(name);
@@ -7541,6 +7547,7 @@ FormValidator.checkValidator = {
7541
7547
  }
7542
7548
  },
7543
7549
  regex: (option) => {
7550
+ /* eslint-disable-next-line security/detect-non-literal-regexp */
7544
7551
  return new RegExp(option.param).test(option.value);
7545
7552
  },
7546
7553
  equalTo: (option) => {
@@ -8472,7 +8479,7 @@ let Uploader = class Uploader extends Component {
8472
8479
  /* istanbul ignore next */
8473
8480
  onPasteFile(event) {
8474
8481
  const item = event.clipboardData.items;
8475
- if (event.type == 'paste' && this.browserName !== 'msie' && this.browserName !== 'edge' && this.browserName !== 'safari') {
8482
+ if (event.type === 'paste' && this.browserName !== 'msie' && this.browserName !== 'edge' && this.browserName !== 'safari') {
8476
8483
  this.element.files = event.clipboardData.files;
8477
8484
  }
8478
8485
  if (item.length !== 1) {
@@ -8527,7 +8534,6 @@ let Uploader = class Uploader extends Component {
8527
8534
  else if (!closest(args.target, '.' + SPINNER_PANE)) {
8528
8535
  this.remove(fileData, false, false, true, args);
8529
8536
  }
8530
- this.element.value = '';
8531
8537
  this.checkActionButtonStatus();
8532
8538
  }
8533
8539
  removeFilesData(file, customTemplate) {
@@ -8543,6 +8549,7 @@ let Uploader = class Uploader extends Component {
8543
8549
  if (isNullOrUndefined(selectedElement)) {
8544
8550
  return;
8545
8551
  }
8552
+ this.element.value = '';
8546
8553
  detach(selectedElement);
8547
8554
  index = this.fileList.indexOf(selectedElement);
8548
8555
  this.fileList.splice(index, 1);
@@ -8830,15 +8837,15 @@ let Uploader = class Uploader extends Component {
8830
8837
  }
8831
8838
  if (this.enableHtmlSanitizer) {
8832
8839
  for (let i = 0; i < fileData.length; i++) {
8833
- let sanitizeFile = SanitizeHtmlHelper.beforeSanitize();
8834
- let sanitizeFileName = SanitizeHtmlHelper.serializeValue(sanitizeFile, fileData[i].name);
8835
- if (sanitizeFileName != fileData[i].name) {
8836
- let encodedFileName = targetFiles[i].name.replace(/[\u00A0-\u9999<>\&]/g, function (i) {
8840
+ const sanitizeFile = SanitizeHtmlHelper.beforeSanitize();
8841
+ const sanitizeFileName = SanitizeHtmlHelper.serializeValue(sanitizeFile, fileData[parseInt(i.toString())].name);
8842
+ if (sanitizeFileName !== fileData[parseInt(i.toString())].name) {
8843
+ const encodedFileName = targetFiles[parseInt(i.toString())].name.replace(/[\u00A0-\u9999<>\&]/g, function (i) {
8837
8844
  return '&#' + i.charCodeAt(0) + ';';
8838
8845
  });
8839
- fileData[i].name = encodedFileName;
8840
- fileData[i].status = this.localizedTexts('invalidFileName');
8841
- fileData[i].statusCode = '0';
8846
+ fileData[parseInt(i.toString())].name = encodedFileName;
8847
+ fileData[parseInt(i.toString())].status = this.localizedTexts('invalidFileName');
8848
+ fileData[parseInt(i.toString())].statusCode = '0';
8842
8849
  }
8843
8850
  }
8844
8851
  }
@@ -10058,13 +10065,13 @@ let Uploader = class Uploader extends Component {
10058
10065
  this.updateStatus(metaData.file, this.localizedTexts('fileUploadCancel'), '5');
10059
10066
  this.updateProgressBarClasses(liElement, UPLOAD_FAILED);
10060
10067
  this.removeProgressbar(liElement, 'failure');
10061
- deleteIcon && deleteIcon.classList.remove(ABORT_ICON);
10062
- deleteIcon && deleteIcon.classList.add(REMOVE_ICON);
10063
- deleteIcon && deleteIcon.setAttribute('title', this.localizedTexts('remove'));
10068
+ (deleteIcon && deleteIcon.classList.remove(ABORT_ICON));
10069
+ (deleteIcon && deleteIcon.classList.add(REMOVE_ICON));
10070
+ (deleteIcon && deleteIcon.setAttribute('title', this.localizedTexts('remove')));
10064
10071
  const pauseIcon = liElement.querySelector('.' + PAUSE_UPLOAD);
10065
- pauseIcon && pauseIcon.classList.add(RETRY_ICON);
10066
- pauseIcon && pauseIcon.classList.remove(PAUSE_UPLOAD);
10067
- pauseIcon && pauseIcon.setAttribute('title', this.localizedTexts('retry'));
10072
+ (pauseIcon && pauseIcon.classList.add(RETRY_ICON));
10073
+ (pauseIcon && pauseIcon.classList.remove(PAUSE_UPLOAD));
10074
+ (pauseIcon && pauseIcon.setAttribute('title', this.localizedTexts('retry')));
10068
10075
  if (!isNullOrUndefined(liElement) && !isNullOrUndefined(deleteIcon)
10069
10076
  && !isNullOrUndefined(liElement.querySelector('.e-spinner-pane'))) {
10070
10077
  hideSpinner(spinnerTarget);
@@ -10321,7 +10328,7 @@ let Uploader = class Uploader extends Component {
10321
10328
  }
10322
10329
  if (!isNaN(Math.round((e.loaded / e.total) * 100)) && isNullOrUndefined(this.template) && metaData.file.statusCode !== '4') {
10323
10330
  let progressVal;
10324
- let totalChunks = Math.ceil(metaData.file.size / this.asyncSettings.chunkSize) - 1;
10331
+ const totalChunks = Math.ceil(metaData.file.size / this.asyncSettings.chunkSize) - 1;
10325
10332
  if (this.asyncSettings.chunkSize && totalChunks) {
10326
10333
  progressVal = Math.round(metaData.chunkIndex / totalChunks * 100);
10327
10334
  this.changeProgressValue(liElement, progressVal.toString() + '%');
@@ -11142,7 +11149,7 @@ let ColorPicker = class ColorPicker extends Component {
11142
11149
  wrapper.classList.add(RTL$1);
11143
11150
  }
11144
11151
  if (this.cssClass) {
11145
- addClass([wrapper], this.cssClass.split(' '));
11152
+ addClass([wrapper], this.cssClass.replace(/\s+/g, ' ').trim().split(' '));
11146
11153
  }
11147
11154
  this.tileRipple = rippleEffect(this.container, { selector: '.' + TILE });
11148
11155
  this.ctrlBtnRipple = rippleEffect(this.container, { selector: '.e-btn' });
@@ -11201,7 +11208,7 @@ let ColorPicker = class ColorPicker extends Component {
11201
11208
  const popupEle = this.getPopupEle();
11202
11209
  addClass([popupEle], 'e-colorpicker-popup');
11203
11210
  if (this.cssClass) {
11204
- addClass([popupEle], this.cssClass.split(' '));
11211
+ addClass([popupEle], this.cssClass.replace(/\s+/g, ' ').trim().split(' '));
11205
11212
  }
11206
11213
  if (Browser.isDevice) {
11207
11214
  const popupInst = this.getPopupInst();
@@ -11834,6 +11841,10 @@ let ColorPicker = class ColorPicker extends Component {
11834
11841
  if (this.isPicker()) {
11835
11842
  const dragHandler = this.getDragHandler();
11836
11843
  EventHandler.add(dragHandler, 'keydown', this.pickerKeyDown, this);
11844
+ const ctrlBtn = select('.' + CTRLBTN, this.container);
11845
+ if (ctrlBtn) {
11846
+ EventHandler.add(ctrlBtn, 'keydown', this.ctrlBtnKeyDown, this);
11847
+ }
11837
11848
  EventHandler.add(this.getHsvContainer(), 'mousedown touchstart', this.handlerDown, this);
11838
11849
  if (this.modeSwitcher || this.showButtons) {
11839
11850
  this.addCtrlSwitchEvent();
@@ -11855,6 +11866,16 @@ let ColorPicker = class ColorPicker extends Component {
11855
11866
  EventHandler.add(ctrlSwitchBtn, 'click', this.btnClickHandler, this);
11856
11867
  }
11857
11868
  }
11869
+ ctrlBtnKeyDown(e) {
11870
+ if (e.keyCode === 13) {
11871
+ const applyBtn = select('.' + APPLY, this.container);
11872
+ if (applyBtn) {
11873
+ const cValue = this.rgbToHex(this.rgb);
11874
+ this.triggerChangeEvent(cValue);
11875
+ }
11876
+ this.splitBtn.element.focus();
11877
+ }
11878
+ }
11858
11879
  pickerKeyDown(e) {
11859
11880
  switch (e.keyCode) {
11860
11881
  case 39:
@@ -11879,7 +11900,6 @@ let ColorPicker = class ColorPicker extends Component {
11879
11900
  enterKeyHandler(value, e) {
11880
11901
  this.triggerChangeEvent(value);
11881
11902
  if (!this.inline) {
11882
- this.closePopup(e);
11883
11903
  this.splitBtn.element.focus();
11884
11904
  }
11885
11905
  }
@@ -12403,6 +12423,10 @@ let ColorPicker = class ColorPicker extends Component {
12403
12423
  if (this.isPicker()) {
12404
12424
  const dragHandler = this.getDragHandler();
12405
12425
  EventHandler.remove(dragHandler, 'keydown', this.pickerKeyDown);
12426
+ const ctrlBtn = select('.' + CTRLBTN, this.container);
12427
+ if (ctrlBtn) {
12428
+ EventHandler.remove(ctrlBtn, 'keydown', this.ctrlBtnKeyDown);
12429
+ }
12406
12430
  EventHandler.remove(this.getHsvContainer(), 'mousedown touchstart', this.handlerDown);
12407
12431
  if (this.modeSwitcher || this.showButtons) {
12408
12432
  EventHandler.remove(select('.' + CTRLSWITCH, this.container), 'click', this.btnClickHandler);
@@ -12644,7 +12668,7 @@ let ColorPicker = class ColorPicker extends Component {
12644
12668
  removeClass([wrapper, popupWrapper], oldProp.split(' '));
12645
12669
  }
12646
12670
  if (newProp) {
12647
- addClass([wrapper, popupWrapper], newProp.split(' '));
12671
+ addClass([wrapper, popupWrapper], newProp.replace(/\s+/g, ' ').trim().split(' '));
12648
12672
  }
12649
12673
  }
12650
12674
  changeRtlProps(newProp) {
@@ -13072,7 +13096,9 @@ let TextBox = class TextBox extends Component {
13072
13096
  if (this.element.tagName !== 'TEXTAREA') {
13073
13097
  this.element.setAttribute('type', this.type);
13074
13098
  }
13075
- this.element.setAttribute('role', 'textbox');
13099
+ if (this.type === 'text') {
13100
+ this.element.setAttribute('role', 'textbox');
13101
+ }
13076
13102
  this.globalize = new Internationalization(this.locale);
13077
13103
  const localeText = { placeholder: this.placeholder };
13078
13104
  this.l10n = new L10n('textbox', localeText, this.locale);
@@ -13204,7 +13230,7 @@ let TextBox = class TextBox extends Component {
13204
13230
  this.inputPreviousValue = this.value;
13205
13231
  this.respectiveElement.defaultValue = this.respectiveElement.value;
13206
13232
  Input.setWidth(this.width, this.textboxWrapper.container);
13207
- if (!isNullOrUndefined(closest(this.element, "fieldset")) && closest(this.element, "fieldset").disabled) {
13233
+ if (!isNullOrUndefined(closest(this.element, 'fieldset')) && closest(this.element, 'fieldset').disabled) {
13208
13234
  this.enabled = false;
13209
13235
  }
13210
13236
  this.renderComplete();
@@ -13399,8 +13425,8 @@ let TextBox = class TextBox extends Component {
13399
13425
  this.inputPreviousValue = this.respectiveElement.value;
13400
13426
  this.raiseChangeEvent(event, true);
13401
13427
  if (closest(this.element, 'form')) {
13402
- let element = this.element;
13403
- let keyupEvent = document.createEvent('KeyboardEvent');
13428
+ const element = this.element;
13429
+ const keyupEvent = document.createEvent('KeyboardEvent');
13404
13430
  keyupEvent.initEvent('keyup', false, true);
13405
13431
  element.dispatchEvent(keyupEvent);
13406
13432
  }
@@ -13693,6 +13719,10 @@ class SignatureBase extends Component {
13693
13719
  this.element.width = this.element.offsetWidth;
13694
13720
  this.isResponsive = true;
13695
13721
  }
13722
+ else if (this.element.height !== this.element.offsetHeight - 1 || this.element.width !== this.element.offsetWidth - 1) {
13723
+ this.element.height = this.element.offsetHeight;
13724
+ this.element.width = this.element.offsetWidth;
13725
+ }
13696
13726
  this.canvasContext.scale(1, 1);
13697
13727
  this.canvasContext.fillStyle = this.strokeColor;
13698
13728
  if (this.backgroundImage) {
@@ -13785,7 +13815,6 @@ class SignatureBase extends Component {
13785
13815
  this.canvasContext.canvas.width = this.element.offsetWidth;
13786
13816
  this.canvasContext.canvas.height = this.element.offsetHeight;
13787
13817
  this.canvasContext.scale(1, 1);
13788
- this.canvasContext.clearRect(0, 0, this.canvasContext.canvas.width, this.canvasContext.canvas.height);
13789
13818
  const pointSize = (this.minStrokeWidth + this.maxStrokeWidth) / 2;
13790
13819
  for (let i = 0; i < this.signRatioPointsColl.length; i++) {
13791
13820
  this.arcDraw((this.signRatioPointsColl[i].x * this.canvasContext.canvas.width), (this.signRatioPointsColl[i].y * this.canvasContext.canvas.height), pointSize);
@@ -14019,11 +14048,11 @@ class SignatureBase extends Component {
14019
14048
  enableOrDisable(isDisable) {
14020
14049
  this.disabled = isDisable;
14021
14050
  if (isDisable) {
14022
- this.canvasContext.canvas.style.filter = "opacity(0.5)";
14051
+ this.canvasContext.canvas.style.filter = 'opacity(0.5)';
14023
14052
  this.isRead(true);
14024
14053
  }
14025
14054
  else {
14026
- this.canvasContext.canvas.style.filter = "";
14055
+ this.canvasContext.canvas.style.filter = '';
14027
14056
  this.isRead(false);
14028
14057
  }
14029
14058
  }
@@ -14797,7 +14826,6 @@ let Rating = class Rating extends Component {
14797
14826
  constructor(options, element) {
14798
14827
  super(options, element);
14799
14828
  this.itemElements = [];
14800
- this.tooltipOpen = false;
14801
14829
  }
14802
14830
  preRender() {
14803
14831
  if (!this.element.id) {
@@ -14810,13 +14838,14 @@ let Rating = class Rating extends Component {
14810
14838
  uparrow: 'uparrow',
14811
14839
  space: 'space'
14812
14840
  };
14841
+ this.tooltipOpen = false;
14813
14842
  }
14814
14843
  render() {
14815
14844
  this.initialize();
14816
14845
  this.updateMinValue();
14817
14846
  this.updateTemplateFunction();
14847
+ this.triggerChange(null, this.value, false);
14818
14848
  this.renderItems();
14819
- this.updatePrecision();
14820
14849
  this.displayLabel();
14821
14850
  }
14822
14851
  initialize() {
@@ -14829,35 +14858,41 @@ let Rating = class Rating extends Component {
14829
14858
  attributes(this.element, { 'aria-label': 'rating' });
14830
14859
  this.renderItemList();
14831
14860
  this.updateReset();
14832
- this.updateDisabled();
14833
- this.wrapper.classList[this.readOnly ? 'add' : 'remove'](READONLY);
14834
- this.wrapper.classList[!this.visible ? 'add' : 'remove'](HIDDEN);
14835
- this.wrapper.classList[this.enableRtl ? 'add' : 'remove'](RTL$2);
14836
- this.wrapper.classList[this.enableAnimation ? 'add' : 'remove'](ANIMATION);
14861
+ if (this.readOnly) {
14862
+ this.wrapper.classList.add(READONLY);
14863
+ }
14864
+ if (!this.visible) {
14865
+ this.wrapper.classList.add(HIDDEN);
14866
+ }
14867
+ if (this.enableRtl) {
14868
+ this.wrapper.classList.add(RTL$2);
14869
+ }
14870
+ if (this.enableAnimation) {
14871
+ this.wrapper.classList.add(ANIMATION);
14872
+ }
14837
14873
  if (this.cssClass) {
14838
14874
  addClass([this.wrapper], this.cssClass.split(' '));
14839
14875
  }
14840
14876
  this.updateTooltip();
14841
14877
  this.wireKeyboardEvent();
14878
+ this.updateDisabled();
14842
14879
  }
14843
14880
  updateDisabled() {
14844
14881
  this.wrapper.classList[this.disabled ? 'add' : 'remove'](DISABLED$2);
14845
14882
  attributes(this.ratingItemList, { 'tabindex': (this.disabled) ? '-1' : '0' });
14846
- if (this.allowReset) {
14847
- this.updateResetButton();
14848
- }
14883
+ this.updateResetButton();
14849
14884
  }
14850
14885
  updateResetButton() {
14851
- const isDisabled = (this.value <= this.min) || this.disabled;
14852
- this.resetElement.classList[isDisabled ? 'add' : 'remove'](DISABLED$2);
14853
- attributes(this.resetElement, { 'aria-label': 'resetbutton', 'role': 'button',
14854
- 'tabindex': (isDisabled ? '-1' : '0'), 'aria-hidden': isDisabled.toString() });
14886
+ if (this.allowReset) {
14887
+ const isDisabled = (this.value <= this.min) || this.disabled;
14888
+ this.resetElement.classList[isDisabled ? 'add' : 'remove'](DISABLED$2);
14889
+ attributes(this.resetElement, { 'tabindex': (isDisabled ? '-1' : '0'), 'aria-hidden': isDisabled.toString() });
14890
+ }
14855
14891
  }
14856
14892
  renderItemList() {
14857
14893
  this.ratingItemList = this.createElement('div', {
14858
14894
  className: ITEMLIST,
14859
- id: this.element.id + '_item-list',
14860
- attrs: { 'tabindex': '0' }
14895
+ id: this.element.id + '_item-list'
14861
14896
  });
14862
14897
  attributes(this.ratingItemList, { 'aria-label': 'rating', 'role': 'slider' });
14863
14898
  this.wrapper.appendChild(this.ratingItemList);
@@ -14905,7 +14940,7 @@ let Rating = class Rating extends Component {
14905
14940
  const ratingItemContainer = this.createElement('span', { className: ITEMCONTAINER });
14906
14941
  const spanItem = this.createElement('span', { className: 'e-rating-item' });
14907
14942
  const ratingValue = this.getRatingValue(this.value, i);
14908
- this.renderItemContent(spanItem, ratingValue, i);
14943
+ this.renderItemContent(spanItem, ratingValue, i, false);
14909
14944
  ratingItemContainer.appendChild(spanItem);
14910
14945
  this.wireItemsEvents(ratingItemContainer, i + 1);
14911
14946
  this.itemElements.push(ratingItemContainer);
@@ -14915,11 +14950,9 @@ let Rating = class Rating extends Component {
14915
14950
  });
14916
14951
  }
14917
14952
  attributes(this.ratingItemList, { 'aria-valuemax': this.itemsCount.toString() });
14918
- if (this.disabled) {
14919
- attributes(this.ratingItemList, { 'tabindex': '-1' });
14920
- }
14953
+ this.updateItemValue(false);
14921
14954
  }
14922
- renderItemContent(spanEle, val, index, isrerender = false) {
14955
+ renderItemContent(spanEle, val, index, isrerender) {
14923
14956
  if (isrerender) {
14924
14957
  this.removeItemContent(spanEle);
14925
14958
  }
@@ -14958,17 +14991,12 @@ let Rating = class Rating extends Component {
14958
14991
  }
14959
14992
  }
14960
14993
  updateMinValue() {
14961
- this.min = this.validateValue(this.min);
14994
+ this.setProperties({ min: this.validateValue(this.min) }, true);
14962
14995
  if (this.min > 0 && this.value < this.min) {
14963
14996
  this.triggerChange(null, this.min, false);
14964
14997
  }
14965
14998
  attributes(this.ratingItemList, { 'aria-valuemin': this.min.toString() });
14966
14999
  }
14967
- updatePrecision() {
14968
- this.min = this.validateValue(this.min);
14969
- this.triggerChange(null, this.validateValue(this.value), false);
14970
- this.updateItemValue();
14971
- }
14972
15000
  validateValue(currentValue) {
14973
15001
  if (currentValue > this.itemsCount) {
14974
15002
  currentValue = this.itemsCount;
@@ -14987,7 +15015,10 @@ let Rating = class Rating extends Component {
14987
15015
  return (this.enableSingleSelection) ? (((value > i) && (value <= i + 1)) ? 1 : 0) :
14988
15016
  (value >= i + 1) ? 1 : ((value < i) ? 0 : (value - i));
14989
15017
  }
14990
- updateItemValue() {
15018
+ updateItemValue(isUpdate = true) {
15019
+ if (isUpdate && this.isReact) {
15020
+ this.clearTemplate(['ratingEmptyTemplate', 'ratingFullTemplate']);
15021
+ }
14991
15022
  for (let i = 0; i < this.itemsCount; i++) {
14992
15023
  const itemElement = this.itemElements[parseInt(i.toString(), 10)];
14993
15024
  itemElement.classList.remove(SELECTED, INTERMEDIATE, SELECTEDVALUE);
@@ -15001,13 +15032,16 @@ let Rating = class Rating extends Component {
15001
15032
  else if ((this.precision === PrecisionType.Full) && (i + 1 <= this.value) && (!this.enableSingleSelection)) {
15002
15033
  itemElement.classList.add(SELECTEDVALUE);
15003
15034
  }
15004
- this.updateItemContent(ratingValue, i);
15035
+ if (isUpdate) {
15036
+ this.updateItemContent(ratingValue, i);
15037
+ }
15005
15038
  itemElement.style.setProperty(RATINGVALUE, (ratingValue * 100) + '%');
15006
15039
  itemElement.classList[((this.value === 0) && (i === 0)) || (this.value === i + 1) || ((ratingValue > 0) && (ratingValue < 1)) ? 'add' : 'remove']('e-rating-focus');
15007
15040
  }
15008
- if (this.allowReset) {
15009
- this.updateResetButton();
15041
+ if (isUpdate) {
15042
+ this.renderReactTemplates();
15010
15043
  }
15044
+ this.updateResetButton();
15011
15045
  attributes(this.ratingItemList, { 'aria-valuenow': this.currentValue.toString() });
15012
15046
  attributes(this.element, { 'value': this.value.toString() });
15013
15047
  }
@@ -15017,26 +15051,31 @@ let Rating = class Rating extends Component {
15017
15051
  }
15018
15052
  const spanEle = this.itemElements[parseInt(index.toString(), 10)].querySelector('.e-rating-item');
15019
15053
  if (this.fullTemplate && ratingValue === 1) {
15020
- if (spanEle.classList.contains(FULLTEMPLATE)) {
15054
+ if (!this.isReact && spanEle.classList.contains(FULLTEMPLATE)) {
15021
15055
  return;
15022
15056
  }
15023
15057
  this.removeItemContent(spanEle);
15024
15058
  spanEle.classList.add(FULLTEMPLATE);
15025
- spanEle.append(this.fullTemplateFunction({ ratingValue: ratingValue, index: index }, this, 'ratingFullTemplate', (this.element.id + 'fullTemplate'), this.isStringTemplate)[0]);
15059
+ spanEle.append(this.fullTemplateFunction({ ratingValue: ratingValue, index: index }, this, 'ratingFullTemplate', (this.element.id + 'fullTemplate' + index), this.isStringTemplate)[0]);
15026
15060
  }
15027
15061
  else if (this.emptyTemplate) {
15062
+ if (!this.isReact && spanEle.classList.contains(EMPTYTEMPLATE)) {
15063
+ return;
15064
+ }
15028
15065
  this.removeItemContent(spanEle);
15029
15066
  spanEle.classList.add(EMPTYTEMPLATE);
15030
- spanEle.append(this.emptyTemplateFunction({ ratingValue: ratingValue, index: index }, this, 'ratingFullTemplate', (this.element.id + 'fullTemplate'), this.isStringTemplate)[0]);
15067
+ spanEle.append(this.emptyTemplateFunction({ ratingValue: ratingValue, index: index }, this, 'ratingEmptyTemplate', (this.element.id + 'emptyTemplate' + index), this.isStringTemplate)[0]);
15031
15068
  }
15032
15069
  else {
15033
15070
  this.removeItemContent(spanEle);
15034
15071
  addClass([spanEle], ICONCSS.split(' '));
15035
15072
  }
15036
- this.renderReactTemplates();
15037
15073
  }
15038
15074
  updateTooltipContent(isChange) {
15039
15075
  if (this.showTooltip) {
15076
+ if (this.isReact) {
15077
+ this.clearTemplate(['ratingTooltipTemplate']);
15078
+ }
15040
15079
  let content;
15041
15080
  if (this.tooltipTemplate) {
15042
15081
  const templateFunction = this.getTemplateString(this.tooltipTemplate);
@@ -15082,21 +15121,27 @@ let Rating = class Rating extends Component {
15082
15121
  updateLabel() {
15083
15122
  if (this.showLabel) {
15084
15123
  if (this.labelTemplate) {
15124
+ if (this.isReact) {
15125
+ this.clearTemplate(['ratingLabelTemplate']);
15126
+ }
15085
15127
  if (this.spanLabel.firstChild) {
15086
15128
  this.spanLabel.removeChild(this.spanLabel.firstChild);
15087
15129
  }
15088
15130
  const templateFunction = this.getTemplateString(this.labelTemplate);
15089
15131
  this.spanLabel.append(templateFunction({ value: this.currentValue }, this, 'ratingLabelTemplate', (this.element.id + 'labelTemplate'), this.isStringTemplate)[0]);
15132
+ this.renderReactTemplates();
15090
15133
  }
15091
15134
  else {
15092
15135
  this.spanLabel.textContent = this.currentValue + ' / ' + this.itemsCount;
15093
15136
  }
15094
- this.renderReactTemplates();
15095
15137
  }
15096
15138
  }
15097
15139
  updateReset() {
15098
15140
  if (this.allowReset) {
15099
- this.resetElement = this.createElement('span', { className: RESET });
15141
+ this.resetElement = this.createElement('span', {
15142
+ className: RESET,
15143
+ attrs: { 'aria-label': 'resetbutton', 'role': 'button' }
15144
+ });
15100
15145
  this.updateResetButton();
15101
15146
  EventHandler.add(this.resetElement, 'click', this.resetClicked, this);
15102
15147
  this.wrapper.insertBefore(this.resetElement, this.ratingItemList);
@@ -15134,9 +15179,7 @@ let Rating = class Rating extends Component {
15134
15179
  this.triggerChange(e, this.currentValue);
15135
15180
  this.updateItemValue();
15136
15181
  this.updateLabel();
15137
- if (this.allowReset) {
15138
- this.updateResetButton();
15139
- }
15182
+ this.updateResetButton();
15140
15183
  }
15141
15184
  updateValueChange(e, val, isInteracted = true) {
15142
15185
  this.triggerChange(e, val, isInteracted);
@@ -15212,6 +15255,8 @@ let Rating = class Rating extends Component {
15212
15255
  /**
15213
15256
  * Reset’s the value to minimum.
15214
15257
  *
15258
+ * {% codeBlock src='rating/reset/index.md' %}{% endcodeBlock %}
15259
+ *
15215
15260
  * @returns {void}
15216
15261
  */
15217
15262
  reset() {
@@ -15263,12 +15308,13 @@ let Rating = class Rating extends Component {
15263
15308
  Math.round(0.1 * 10) / 10;
15264
15309
  currentValue = isIncrease ? this.value + currentValue : this.value - currentValue;
15265
15310
  this.updateValueChange(e, (currentValue));
15266
- if (this.allowReset) {
15267
- this.updateResetButton();
15268
- }
15311
+ this.updateResetButton();
15269
15312
  }
15270
15313
  }
15271
15314
  updateContent() {
15315
+ if (this.isReact) {
15316
+ this.clearTemplate(['ratingEmptyTemplate', 'ratingFullTemplate']);
15317
+ }
15272
15318
  for (let i = 0; i < this.itemsCount; i++) {
15273
15319
  const itemElement = this.itemElements[parseInt(i.toString(), 10)].firstElementChild;
15274
15320
  this.renderItemContent(itemElement, this.getRatingValue(this.value, i), i, true);
@@ -15306,6 +15352,7 @@ let Rating = class Rating extends Component {
15306
15352
  super.destroy();
15307
15353
  // unwires the events and detach the li elements
15308
15354
  this.removeItemElements();
15355
+ this.clearTemplate();
15309
15356
  if (this.spanLabel) {
15310
15357
  remove(this.spanLabel);
15311
15358
  this.spanLabel = null;
@@ -15383,7 +15430,9 @@ let Rating = class Rating extends Component {
15383
15430
  this.updateTooltip();
15384
15431
  break;
15385
15432
  case 'precision':
15386
- this.updatePrecision();
15433
+ this.updateMinValue();
15434
+ this.triggerChange(null, this.value, false);
15435
+ this.updateItemValue();
15387
15436
  this.updateLabel();
15388
15437
  break;
15389
15438
  case 'enableSingleSelection':
@@ -15404,7 +15453,6 @@ let Rating = class Rating extends Component {
15404
15453
  case 'itemsCount':
15405
15454
  this.removeItemElements();
15406
15455
  this.renderItems();
15407
- this.updateItemValue();
15408
15456
  this.updateLabel();
15409
15457
  break;
15410
15458
  }