@syncfusion/ej2-inputs 27.2.2 → 28.1.33

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 (195) hide show
  1. package/README.md +2 -2
  2. package/dist/ej2-inputs.min.js +3 -3
  3. package/dist/ej2-inputs.umd.min.js +3 -3
  4. package/dist/ej2-inputs.umd.min.js.map +1 -1
  5. package/dist/es6/ej2-inputs.es2015.js +70 -66
  6. package/dist/es6/ej2-inputs.es2015.js.map +1 -1
  7. package/dist/es6/ej2-inputs.es5.js +71 -67
  8. package/dist/es6/ej2-inputs.es5.js.map +1 -1
  9. package/dist/global/ej2-inputs.min.js +3 -3
  10. package/dist/global/ej2-inputs.min.js.map +1 -1
  11. package/dist/global/index.d.ts +2 -2
  12. package/package.json +10 -10
  13. package/src/common/signature-base.js +21 -11
  14. package/src/numerictextbox/numerictextbox.js +5 -3
  15. package/src/otp-input/otp-input.js +35 -49
  16. package/src/slider/slider.d.ts +1 -0
  17. package/src/slider/slider.js +5 -4
  18. package/src/uploader/uploader.js +5 -0
  19. package/styles/bds-lite.css +5293 -0
  20. package/styles/bds-lite.scss +37 -0
  21. package/styles/bds.css +8139 -0
  22. package/styles/bds.scss +46 -0
  23. package/styles/bootstrap-dark-lite.css +4 -0
  24. package/styles/bootstrap-dark.css +4 -0
  25. package/styles/bootstrap-lite.css +4 -0
  26. package/styles/bootstrap.css +4 -0
  27. package/styles/bootstrap4-lite.css +4 -1
  28. package/styles/bootstrap4.css +4 -1
  29. package/styles/bootstrap5-dark-lite.css +7 -4
  30. package/styles/bootstrap5-dark.css +7 -4
  31. package/styles/bootstrap5-lite.css +5 -2
  32. package/styles/bootstrap5.3-lite.css +4 -1
  33. package/styles/bootstrap5.3.css +4 -1
  34. package/styles/bootstrap5.css +5 -2
  35. package/styles/color-picker/_bigger.scss +46 -7
  36. package/styles/color-picker/_layout.scss +41 -3
  37. package/styles/color-picker/_tailwind3-definition.scss +152 -0
  38. package/styles/color-picker/_theme.scss +13 -2
  39. package/styles/color-picker/bds.css +1080 -0
  40. package/styles/color-picker/bds.scss +12 -0
  41. package/styles/color-picker/bootstrap-dark.css +3 -0
  42. package/styles/color-picker/bootstrap.css +3 -0
  43. package/styles/color-picker/bootstrap4.css +3 -0
  44. package/styles/color-picker/bootstrap5-dark.css +3 -0
  45. package/styles/color-picker/bootstrap5.3.css +3 -0
  46. package/styles/color-picker/bootstrap5.css +3 -0
  47. package/styles/color-picker/fabric-dark.css +3 -0
  48. package/styles/color-picker/fabric.css +3 -0
  49. package/styles/color-picker/fluent-dark.css +3 -0
  50. package/styles/color-picker/fluent.css +3 -0
  51. package/styles/color-picker/fluent2.css +3 -0
  52. package/styles/color-picker/highcontrast-light.css +3 -0
  53. package/styles/color-picker/highcontrast.css +3 -0
  54. package/styles/color-picker/icons/_tailwind3.scss +9 -0
  55. package/styles/color-picker/material-dark.css +3 -0
  56. package/styles/color-picker/material.css +3 -0
  57. package/styles/color-picker/material3-dark.css +3 -0
  58. package/styles/color-picker/material3.css +3 -0
  59. package/styles/color-picker/tailwind-dark.css +3 -0
  60. package/styles/color-picker/tailwind.css +3 -0
  61. package/styles/color-picker/tailwind3.css +880 -0
  62. package/styles/color-picker/tailwind3.scss +12 -0
  63. package/styles/data-form/_tailwind3-definition.scss +41 -0
  64. package/styles/data-form/bds.css +236 -0
  65. package/styles/data-form/bds.scss +3 -0
  66. package/styles/data-form/tailwind3.css +236 -0
  67. package/styles/data-form/tailwind3.scss +3 -0
  68. package/styles/fabric-dark-lite.css +4 -0
  69. package/styles/fabric-dark.css +4 -0
  70. package/styles/fabric-lite.css +4 -0
  71. package/styles/fabric.css +4 -0
  72. package/styles/fluent-dark-lite.css +8 -5
  73. package/styles/fluent-dark.css +8 -5
  74. package/styles/fluent-lite.css +6 -3
  75. package/styles/fluent.css +6 -3
  76. package/styles/fluent2-lite.css +10 -6
  77. package/styles/fluent2.css +11 -7
  78. package/styles/highcontrast-light-lite.css +3 -0
  79. package/styles/highcontrast-light.css +3 -0
  80. package/styles/highcontrast-lite.css +3 -0
  81. package/styles/highcontrast.css +3 -0
  82. package/styles/input/_bigger.scss +127 -120
  83. package/styles/input/_layout.scss +143 -121
  84. package/styles/input/_tailwind3-definition.scss +511 -0
  85. package/styles/input/_theme.scss +67 -40
  86. package/styles/input/bds.css +4537 -0
  87. package/styles/input/bds.scss +5 -0
  88. package/styles/input/fluent2.css +2 -2
  89. package/styles/input/icons/_tailwind3.scss +17 -0
  90. package/styles/input/tailwind-dark.css +2 -0
  91. package/styles/input/tailwind.css +2 -0
  92. package/styles/input/tailwind3.css +8925 -0
  93. package/styles/input/tailwind3.scss +5 -0
  94. package/styles/maskedtextbox/_tailwind3-definition.scss +7 -0
  95. package/styles/maskedtextbox/bds.css +180 -0
  96. package/styles/maskedtextbox/bds.scss +5 -0
  97. package/styles/maskedtextbox/fluent2.css +1 -1
  98. package/styles/maskedtextbox/tailwind3.css +47 -0
  99. package/styles/maskedtextbox/tailwind3.scss +5 -0
  100. package/styles/material-dark-lite.css +4 -0
  101. package/styles/material-dark.css +4 -0
  102. package/styles/material-lite.css +4 -0
  103. package/styles/material.css +4 -0
  104. package/styles/material3-dark-lite.css +8 -4
  105. package/styles/material3-dark.css +8 -4
  106. package/styles/material3-lite.css +8 -4
  107. package/styles/material3.css +8 -4
  108. package/styles/numerictextbox/_tailwind3-definition.scss +3 -0
  109. package/styles/numerictextbox/bds.css +197 -0
  110. package/styles/numerictextbox/bds.scss +6 -0
  111. package/styles/numerictextbox/icons/_tailwind3.scss +11 -0
  112. package/styles/numerictextbox/tailwind3.css +64 -0
  113. package/styles/numerictextbox/tailwind3.scss +6 -0
  114. package/styles/otp-input/_tailwind3-definition.scss +59 -0
  115. package/styles/otp-input/bds.css +230 -0
  116. package/styles/otp-input/bds.scss +4 -0
  117. package/styles/otp-input/tailwind3.css +230 -0
  118. package/styles/otp-input/tailwind3.scss +4 -0
  119. package/styles/rating/_tailwind3-definition.scss +47 -0
  120. package/styles/rating/bds.css +323 -0
  121. package/styles/rating/bds.scss +5 -0
  122. package/styles/rating/tailwind3.css +319 -0
  123. package/styles/rating/tailwind3.scss +5 -0
  124. package/styles/signature/_layout.scss +4 -0
  125. package/styles/signature/_tailwind3-definition.scss +3 -0
  126. package/styles/signature/bds.css +13 -0
  127. package/styles/signature/bds.scss +3 -0
  128. package/styles/signature/tailwind3.css +16 -0
  129. package/styles/signature/tailwind3.scss +3 -0
  130. package/styles/slider/_layout.scss +29 -15
  131. package/styles/slider/_tailwind3-definition.scss +92 -0
  132. package/styles/slider/_theme.scss +4 -2
  133. package/styles/slider/bds.css +620 -0
  134. package/styles/slider/bds.scss +6 -0
  135. package/styles/slider/bootstrap-dark.css +1 -0
  136. package/styles/slider/bootstrap.css +1 -0
  137. package/styles/slider/bootstrap4.css +1 -1
  138. package/styles/slider/bootstrap5.3.css +1 -1
  139. package/styles/slider/fabric-dark.css +1 -0
  140. package/styles/slider/fabric.css +1 -0
  141. package/styles/slider/fluent-dark.css +1 -1
  142. package/styles/slider/fluent.css +1 -1
  143. package/styles/slider/fluent2.css +3 -2
  144. package/styles/slider/material-dark.css +1 -0
  145. package/styles/slider/material.css +1 -0
  146. package/styles/slider/material3-dark.css +1 -0
  147. package/styles/slider/material3.css +1 -0
  148. package/styles/slider/tailwind3.css +442 -0
  149. package/styles/slider/tailwind3.scss +6 -0
  150. package/styles/smart-textarea/_bootstrap5-definition.scss +3 -3
  151. package/styles/smart-textarea/_fluent-definition.scss +3 -3
  152. package/styles/smart-textarea/_material3-definition.scss +3 -3
  153. package/styles/smart-textarea/_tailwind-definition.scss +3 -3
  154. package/styles/smart-textarea/_tailwind3-definition.scss +3 -0
  155. package/styles/smart-textarea/_theme.scss +2 -29
  156. package/styles/smart-textarea/bds.css +67 -0
  157. package/styles/smart-textarea/bds.scss +4 -0
  158. package/styles/smart-textarea/bootstrap5-dark.css +4 -4
  159. package/styles/smart-textarea/bootstrap5.css +2 -2
  160. package/styles/smart-textarea/fluent-dark.css +4 -4
  161. package/styles/smart-textarea/fluent.css +2 -2
  162. package/styles/smart-textarea/material3-dark.css +4 -4
  163. package/styles/smart-textarea/material3.css +4 -4
  164. package/styles/smart-textarea/tailwind-dark.css +4 -4
  165. package/styles/smart-textarea/tailwind.css +2 -2
  166. package/styles/smart-textarea/tailwind3.css +67 -0
  167. package/styles/smart-textarea/tailwind3.scss +4 -0
  168. package/styles/tailwind-dark-lite.css +9 -4
  169. package/styles/tailwind-dark.css +9 -4
  170. package/styles/tailwind-lite.css +7 -2
  171. package/styles/tailwind.css +7 -2
  172. package/styles/tailwind3-lite.css +7247 -0
  173. package/styles/tailwind3-lite.scss +37 -0
  174. package/styles/tailwind3.css +12253 -0
  175. package/styles/tailwind3.scss +46 -0
  176. package/styles/textarea/_tailwind3-definition.scss +1 -0
  177. package/styles/textarea/bds.css +183 -0
  178. package/styles/textarea/bds.scss +5 -0
  179. package/styles/textarea/tailwind3.css +50 -0
  180. package/styles/textarea/tailwind3.scss +5 -0
  181. package/styles/textbox/_tailwind3-definition.scss +4 -0
  182. package/styles/textbox/bds.css +177 -0
  183. package/styles/textbox/bds.scss +5 -0
  184. package/styles/textbox/tailwind3.css +44 -0
  185. package/styles/textbox/tailwind3.scss +5 -0
  186. package/styles/uploader/_bigger.scss +3 -0
  187. package/styles/uploader/_layout.scss +4 -0
  188. package/styles/uploader/_tailwind3-definition.scss +211 -0
  189. package/styles/uploader/_theme.scss +21 -0
  190. package/styles/uploader/bds.css +1124 -0
  191. package/styles/uploader/bds.scss +7 -0
  192. package/styles/uploader/fluent2.css +2 -2
  193. package/styles/uploader/icons/_tailwind3.scss +34 -0
  194. package/styles/uploader/tailwind3.css +1037 -0
  195. package/styles/uploader/tailwind3.scss +7 -0
@@ -1842,9 +1842,11 @@ let NumericTextBox = class NumericTextBox extends Component {
1842
1842
  const elementValue = this.isFocused ? value : this.instance.getNumberFormat(this.cultureInfo)(this.value);
1843
1843
  this.setElementValue(elementValue);
1844
1844
  attributes(this.element, { 'aria-valuenow': value });
1845
- this.hiddenInput.value = this.value.toString();
1846
- if (this.value !== null && this.serverDecimalSeparator) {
1847
- this.hiddenInput.value = this.hiddenInput.value.replace('.', this.serverDecimalSeparator);
1845
+ if (!isNullOrUndefined(this.hiddenInput)) {
1846
+ this.hiddenInput.value = this.value.toString();
1847
+ if (this.value !== null && this.serverDecimalSeparator) {
1848
+ this.hiddenInput.value = this.hiddenInput.value.replace('.', this.serverDecimalSeparator);
1849
+ }
1848
1850
  }
1849
1851
  }
1850
1852
  else {
@@ -4512,6 +4514,7 @@ let Slider = class Slider extends Component {
4512
4514
  || this.getTheme(this.sliderContainer) === 'bootstrap-dark';
4513
4515
  this.isBootstrap4 = this.getTheme(this.sliderContainer) === 'bootstrap4';
4514
4516
  this.isTailwind = this.getTheme(this.sliderContainer) === 'tailwind' || this.getTheme(this.sliderContainer) === 'tailwind-dark';
4517
+ this.isTailwind3 = this.getTheme(this.sliderContainer) === 'tailwind3' || this.getTheme(this.sliderContainer) === 'tailwind3-dark';
4515
4518
  this.isBootstrap5 = this.getTheme(this.sliderContainer) === 'bootstrap5';
4516
4519
  this.isFluent = this.getTheme(this.sliderContainer) === 'FluentUI';
4517
4520
  this.isFluent2 = this.getTheme(this.sliderContainer) === 'fluent2';
@@ -5027,8 +5030,8 @@ let Slider = class Slider extends Component {
5027
5030
  }
5028
5031
  renderTooltip() {
5029
5032
  this.tooltipObj = new Tooltip({
5030
- showTipPointer: this.isBootstrap || this.isMaterial || this.isMaterial3 ||
5031
- this.isBootstrap4 || this.isTailwind || this.isBootstrap5 || this.isFluent || this.isFluent2 || this.isBootstrap5Dot3,
5033
+ showTipPointer: this.isBootstrap || this.isMaterial || this.isMaterial3 || this.isBootstrap4 || this.isTailwind
5034
+ || this.isTailwind3 || this.isBootstrap5 || this.isFluent || this.isFluent2 || this.isBootstrap5Dot3,
5032
5035
  cssClass: classNames.sliderTooltip,
5033
5036
  height: (this.isMaterial || this.isMaterial3) ? 30 : 'auto',
5034
5037
  animation: { open: { effect: 'None' }, close: { effect: 'FadeOut', duration: 500 } },
@@ -5065,13 +5068,13 @@ let Slider = class Slider extends Component {
5065
5068
  setButtons() {
5066
5069
  this.firstBtn = this.createElement('div', { className: classNames.sliderButton + ' ' + classNames.firstButton });
5067
5070
  this.firstBtn.appendChild(this.createElement('span', { className: classNames.sliderButtonIcon }));
5068
- if (this.isTailwind) {
5071
+ if (this.isTailwind || this.isTailwind3) {
5069
5072
  this.firstBtn.querySelector('span').classList.add('e-icons');
5070
5073
  }
5071
5074
  this.firstBtn.tabIndex = -1;
5072
5075
  this.secondBtn = this.createElement('div', { className: classNames.sliderButton + ' ' + classNames.secondButton });
5073
5076
  this.secondBtn.appendChild(this.createElement('span', { className: classNames.sliderButtonIcon }));
5074
- if (this.isTailwind) {
5077
+ if (this.isTailwind || this.isTailwind3) {
5075
5078
  this.secondBtn.querySelector('span').classList.add('e-icons');
5076
5079
  }
5077
5080
  this.secondBtn.tabIndex = -1;
@@ -10971,6 +10974,8 @@ let Uploader = class Uploader extends Component {
10971
10974
  };
10972
10975
  this.trigger('beforeUpload', eventArgs, (eventArgs) => {
10973
10976
  if (!eventArgs.cancel) {
10977
+ this.customFormDatas = (eventArgs.customFormData && eventArgs.customFormData.length > 0) ?
10978
+ eventArgs.customFormData : this.customFormDatas;
10974
10979
  this.uploadFiles(uploadFiles, custom);
10975
10980
  }
10976
10981
  });
@@ -11074,6 +11079,9 @@ let Uploader = class Uploader extends Component {
11074
11079
  if (eventArgs.cancel) {
11075
11080
  this.eventCancelByArgs(e, eventArgs, selectedFiles[i]);
11076
11081
  }
11082
+ if (this.customFormDatas && this.customFormDatas.length > 0) {
11083
+ this.updateFormData(formData, this.customFormDatas);
11084
+ }
11077
11085
  this.updateFormData(formData, eventArgs.customFormData);
11078
11086
  });
11079
11087
  };
@@ -15469,13 +15477,17 @@ class SignatureBase extends Component {
15469
15477
  }
15470
15478
  unwireEvents(type) {
15471
15479
  if (type === 'mouseup' || type === 'touchend') {
15472
- EventHandler.remove(this.canvasContext.canvas, 'mousemove touchmove', this.mouseMoveHandler);
15473
- EventHandler.remove(this.canvasContext.canvas, 'mouseup touchend', this.mouseUpHandler);
15480
+ if (this.canvasContext) {
15481
+ EventHandler.remove(this.canvasContext.canvas, 'mousemove touchmove', this.mouseMoveHandler);
15482
+ EventHandler.remove(this.canvasContext.canvas, 'mouseup touchend', this.mouseUpHandler);
15483
+ }
15474
15484
  EventHandler.remove(document, 'mouseup', this.mouseUpHandler);
15475
15485
  }
15476
15486
  else {
15477
- EventHandler.remove(this.canvasContext.canvas, 'mousedown touchstart', this.mouseDownHandler);
15478
- EventHandler.remove(this.canvasContext.canvas, 'keydown', this.keyboardHandler);
15487
+ if (this.canvasContext) {
15488
+ EventHandler.remove(this.canvasContext.canvas, 'mousedown touchstart', this.mouseDownHandler);
15489
+ EventHandler.remove(this.canvasContext.canvas, 'keydown', this.keyboardHandler);
15490
+ }
15479
15491
  window.removeEventListener('resize', this.resizeHandler);
15480
15492
  }
15481
15493
  }
@@ -15584,7 +15596,7 @@ class SignatureBase extends Component {
15584
15596
  resizeHandler() {
15585
15597
  // eslint-disable-next-line @typescript-eslint/no-this-alias
15586
15598
  const proxy = this;
15587
- if (this.isResponsive && this.canRedraw) {
15599
+ if (this.isResponsive && this.canRedraw && this.canvasContext && this.element) {
15588
15600
  this.canvasContext.canvas.width = this.element.offsetWidth;
15589
15601
  this.canvasContext.canvas.height = this.element.offsetHeight;
15590
15602
  this.canvasContext.scale(1, 1);
@@ -15596,7 +15608,7 @@ class SignatureBase extends Component {
15596
15608
  this.canvasContext.closePath();
15597
15609
  this.canvasContext.fill();
15598
15610
  }
15599
- else {
15611
+ else if (this.canvasContext && this.element) {
15600
15612
  const restoreImg = new Image();
15601
15613
  restoreImg.src = this.snapColl[this.incStep];
15602
15614
  restoreImg.onload = () => {
@@ -15848,10 +15860,12 @@ class SignatureBase extends Component {
15848
15860
  if (this.incStep > 0) {
15849
15861
  const canvasNew = this.createElement('canvas', { className: 'e-' + this.getModuleName() + '-wrapper' });
15850
15862
  const canvasContextNew = canvasNew.getContext('2d');
15851
- canvasNew.width = this.canvasContext.canvas.width;
15852
- canvasNew.height = this.canvasContext.canvas.height;
15853
- canvasContextNew.drawImage(this.canvasContext.canvas, 0, 0, canvasNew.width, canvasNew.height);
15854
- this.snapColl.push(canvasNew.toDataURL());
15863
+ if (this.canvasContext) {
15864
+ canvasNew.width = this.canvasContext.canvas.width;
15865
+ canvasNew.height = this.canvasContext.canvas.height;
15866
+ canvasContextNew.drawImage(this.canvasContext.canvas, 0, 0, canvasNew.width, canvasNew.height);
15867
+ this.snapColl.push(canvasNew.toDataURL());
15868
+ }
15855
15869
  }
15856
15870
  else {
15857
15871
  this.snapColl.push(this.canvasContext.canvas.toDataURL());
@@ -16182,7 +16196,7 @@ class SignatureBase extends Component {
16182
16196
  }
16183
16197
  else if (type === 'Svg') {
16184
16198
  fileName = fileName || 'Signature';
16185
- this.toSVG(fileName, this.canvasContext.canvas.toDataURL('image/png'));
16199
+ this.toSVG(fileName);
16186
16200
  }
16187
16201
  else if (type === 'Jpeg') {
16188
16202
  fileName = fileName || 'Signature';
@@ -16329,8 +16343,12 @@ class SignatureBase extends Component {
16329
16343
  removeClass([this.element], 'e-' + this.getModuleName());
16330
16344
  this.element.removeAttribute('tabindex');
16331
16345
  this.pointColl = null;
16346
+ this.tempContext = null;
16347
+ this.tempCanvas = null;
16348
+ this.canvasContext = null;
16332
16349
  }
16333
16350
  super.destroy();
16351
+ this.element = null;
16334
16352
  }
16335
16353
  /**
16336
16354
  * Modified onPropertyChanged method for both blazor and EJ2 signature component.
@@ -17505,14 +17523,14 @@ let OtpInput = class OtpInput extends Component {
17505
17523
  const valueContainer = this.getDefaultValue();
17506
17524
  let inputValue = '';
17507
17525
  if (valueContainer) {
17526
+ const valueAtIndex = valueContainer[parseInt(index.toString(), 10)];
17508
17527
  if (this.type === 'number') {
17509
- const valueAtIndex = valueContainer[parseInt(index.toString(), 10)];
17510
17528
  if (!isNaN(Number(valueAtIndex))) {
17511
17529
  inputValue = valueAtIndex;
17512
17530
  }
17513
17531
  }
17514
17532
  else {
17515
- inputValue = valueContainer[parseInt(index.toString(), 10)] || '';
17533
+ inputValue = valueAtIndex || '';
17516
17534
  }
17517
17535
  }
17518
17536
  const inputEle = this.createElement('input', {
@@ -17521,7 +17539,7 @@ let OtpInput = class OtpInput extends Component {
17521
17539
  attrs: {
17522
17540
  maxlength: '1',
17523
17541
  type: this.type,
17524
- inputmode: 'inputmode' in this.htmlAttributes ? this.htmlAttributes['inputmode'] : (this.type === 'number' ? 'numeric' : 'text')
17542
+ inputmode: this.htmlAttributes['inputmode'] || (this.type === 'number' ? 'numeric' : 'text')
17525
17543
  }
17526
17544
  });
17527
17545
  if (this.disabled) {
@@ -17548,25 +17566,26 @@ let OtpInput = class OtpInput extends Component {
17548
17566
  }
17549
17567
  updateSeparatorValue() {
17550
17568
  if (this.separator === '') {
17551
- for (let i = 0; i < this.separatorElements.length; i++) {
17552
- remove(this.separatorElements[parseInt(i.toString(), 10)]);
17553
- }
17569
+ this.separatorElements.forEach((element) => remove(element));
17554
17570
  this.separatorElements = [];
17555
- return;
17556
17571
  }
17557
- for (let i = 0; i < this.separatorElements.length; i++) {
17558
- this.separatorElements[parseInt(i.toString(), 10)].textContent = this.separator;
17572
+ else {
17573
+ this.separatorElements.forEach((element) => {
17574
+ element.textContent = this.separator;
17575
+ });
17559
17576
  }
17560
17577
  }
17561
17578
  addPlaceHolder() {
17562
17579
  for (let i = 0; i < this.inputs.length; i++) {
17563
- this.setElementAttributes({ 'placeholder': this.placeholder.length === 1 || this.placeholder.length === 0 ? this.placeholder : this.placeholder.charAt(i) }, this.inputs[parseInt(i.toString(), 10)]);
17580
+ const placeholderValue = this.placeholder.length <= 1 ? this.placeholder : this.placeholder.charAt(i);
17581
+ this.setElementAttributes({ 'placeholder': placeholderValue }, this.inputs[parseInt(i.toString(), 10)]);
17564
17582
  }
17565
17583
  }
17566
17584
  updateInputType(inputType) {
17585
+ const inputMode = this.htmlAttributes['inputmode'] || (inputType === 'number' ? 'numeric' : 'text');
17567
17586
  this.inputs.forEach((input) => {
17568
17587
  input.type = inputType;
17569
- input.setAttribute('inputmode', 'inputmode' in this.htmlAttributes ? this.htmlAttributes['inputmode'] : (inputType === 'number' ? 'numeric' : 'text'));
17588
+ input.setAttribute('inputmode', inputMode);
17570
17589
  });
17571
17590
  }
17572
17591
  getDefaultValue() {
@@ -17576,10 +17595,7 @@ let OtpInput = class OtpInput extends Component {
17576
17595
  }
17577
17596
  // To remove the white space if present.
17578
17597
  const value = extractedValue.replace(/\s/g, '');
17579
- if (value.length > 0) {
17580
- return value.split('');
17581
- }
17582
- return undefined;
17598
+ return value.length > 0 ? value.split('') : undefined;
17583
17599
  }
17584
17600
  getTransformedText(transformingText) {
17585
17601
  const transformedText = this.textTransform.toLowerCase() === TextTransform.Lowercase ? transformingText.toLowerCase() :
@@ -17620,12 +17636,10 @@ let OtpInput = class OtpInput extends Component {
17620
17636
  value = currentInputElement.value;
17621
17637
  currentInputElement.value = '';
17622
17638
  }
17623
- else {
17624
- if (index !== this.inputs.length - 1) {
17625
- value = nextInputElement.value;
17626
- nextInputElement.value = '';
17627
- nextInputElement.focus();
17628
- }
17639
+ else if (index !== this.inputs.length - 1) {
17640
+ value = nextInputElement.value;
17641
+ nextInputElement.value = '';
17642
+ nextInputElement.focus();
17629
17643
  }
17630
17644
  if (value.length > 0) {
17631
17645
  this.triggerInputEvent(index, event);
@@ -17642,28 +17656,22 @@ let OtpInput = class OtpInput extends Component {
17642
17656
  }
17643
17657
  }
17644
17658
  else if (event.key === 'ArrowLeft' || event.key === 'ArrowRight') {
17645
- if (event.key === 'ArrowLeft') {
17646
- if (index > 0) {
17647
- previousInputElement.focus();
17648
- previousInputElement.select();
17649
- }
17659
+ if (event.key === 'ArrowLeft' && index > 0) {
17660
+ previousInputElement.focus();
17661
+ previousInputElement.select();
17650
17662
  }
17651
- else {
17652
- if (index < this.inputs.length - 1) {
17653
- nextInputElement.focus();
17654
- nextInputElement.select();
17655
- }
17663
+ else if (event.key === 'ArrowRight' && index < this.inputs.length - 1) {
17664
+ nextInputElement.focus();
17665
+ nextInputElement.select();
17656
17666
  }
17657
17667
  event.preventDefault();
17658
17668
  }
17659
17669
  else if (event.key === 'ArrowUp' || event.key === 'ArrowDown') {
17660
17670
  event.preventDefault();
17661
17671
  }
17662
- else {
17663
- if (event.key !== 'Tab' && !event.shiftKey && !event.ctrlKey) {
17664
- if (this.type === 'number' && (/\D/.test(event.key.toLocaleLowerCase()))) {
17665
- event.preventDefault();
17666
- }
17672
+ else if (event.key !== 'Tab' && !event.shiftKey && !event.ctrlKey) {
17673
+ if (this.type === 'number' && (/\D/.test(event.key.toLocaleLowerCase()))) {
17674
+ event.preventDefault();
17667
17675
  }
17668
17676
  }
17669
17677
  }
@@ -17782,9 +17790,9 @@ let OtpInput = class OtpInput extends Component {
17782
17790
  if (this.textTransform) {
17783
17791
  stringifiedValue = this.getTransformedText(stringifiedValue);
17784
17792
  }
17793
+ const previousStringValue = previousValue.toString();
17785
17794
  for (let i = 0; i < this.inputs.length; i++) {
17786
- const isValueChanged = previousValue.toString().charAt(i) !== stringifiedValue.charAt(i);
17787
- if (isValueChanged) {
17795
+ if (previousStringValue.charAt(i) !== stringifiedValue.charAt(i)) {
17788
17796
  this.inputs[parseInt(i.toString(), 10)].value = stringifiedValue.charAt(i);
17789
17797
  this.hiddenInputEle.value = stringifiedValue;
17790
17798
  }
@@ -17803,10 +17811,10 @@ let OtpInput = class OtpInput extends Component {
17803
17811
  }
17804
17812
  }
17805
17813
  updateVariantClass() {
17806
- let variantClass = this.stylingMode.toLocaleLowerCase();
17807
- variantClass = variantClass === 'outlined' ? 'outline' : variantClass;
17808
- if (variantClass === 'underlined' || variantClass === 'filled' || variantClass === 'outline') {
17809
- removeClass([this.element], ['e-underlined', 'e-filled', 'e-outline']);
17814
+ const variantClass = this.stylingMode.toLocaleLowerCase() === 'outlined' ? 'outline' : this.stylingMode.toLocaleLowerCase();
17815
+ const validClasses = ['underlined', 'filled', 'outline'];
17816
+ if (validClasses.indexOf(variantClass) !== -1) {
17817
+ removeClass([this.element], validClasses.map((cls) => `e-${cls}`));
17810
17818
  addClass([this.element], `e-${variantClass}`);
17811
17819
  }
17812
17820
  }
@@ -17907,12 +17915,8 @@ let OtpInput = class OtpInput extends Component {
17907
17915
  destroy() {
17908
17916
  super.destroy();
17909
17917
  this.unWireEvents();
17910
- for (let i = 0; i < this.inputs.length; i++) {
17911
- remove(this.inputs[parseInt(i.toString(), 10)]);
17912
- }
17913
- for (let i = 0; i < this.separatorElements.length; i++) {
17914
- remove(this.separatorElements[parseInt(i.toString(), 10)]);
17915
- }
17918
+ this.inputs.forEach((input) => { remove(input); });
17919
+ this.separatorElements.forEach((separatorElement) => { remove(separatorElement); });
17916
17920
  remove(this.hiddenInputEle);
17917
17921
  removeClass([this.element], ['e-underlined', 'e-filled', 'e-outline', 'e-rtl']);
17918
17922
  if (this.cssClass) {