@syncfusion/ej2-inputs 27.2.4 → 28.1.37

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 +63 -65
  6. package/dist/es6/ej2-inputs.es2015.js.map +1 -1
  7. package/dist/es6/ej2-inputs.es5.js +64 -66
  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 -14
  13. package/src/common/signature-base.js +22 -11
  14. package/src/numerictextbox/numerictextbox.js +1 -1
  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 +1 -1
  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 +124 -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 +8926 -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 +3 -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 +15 -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 +12252 -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 +3 -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 +1036 -0
  195. package/styles/uploader/tailwind3.scss +7 -0
@@ -1842,8 +1842,8 @@ 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
1845
  if (!isNullOrUndefined(this.hiddenInput)) {
1846
+ this.hiddenInput.value = this.value.toString();
1847
1847
  if (this.value !== null && this.serverDecimalSeparator) {
1848
1848
  this.hiddenInput.value = this.hiddenInput.value.replace('.', this.serverDecimalSeparator);
1849
1849
  }
@@ -4514,6 +4514,7 @@ let Slider = class Slider extends Component {
4514
4514
  || this.getTheme(this.sliderContainer) === 'bootstrap-dark';
4515
4515
  this.isBootstrap4 = this.getTheme(this.sliderContainer) === 'bootstrap4';
4516
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';
4517
4518
  this.isBootstrap5 = this.getTheme(this.sliderContainer) === 'bootstrap5';
4518
4519
  this.isFluent = this.getTheme(this.sliderContainer) === 'FluentUI';
4519
4520
  this.isFluent2 = this.getTheme(this.sliderContainer) === 'fluent2';
@@ -5029,8 +5030,8 @@ let Slider = class Slider extends Component {
5029
5030
  }
5030
5031
  renderTooltip() {
5031
5032
  this.tooltipObj = new Tooltip({
5032
- showTipPointer: this.isBootstrap || this.isMaterial || this.isMaterial3 ||
5033
- 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,
5034
5035
  cssClass: classNames.sliderTooltip,
5035
5036
  height: (this.isMaterial || this.isMaterial3) ? 30 : 'auto',
5036
5037
  animation: { open: { effect: 'None' }, close: { effect: 'FadeOut', duration: 500 } },
@@ -5067,13 +5068,13 @@ let Slider = class Slider extends Component {
5067
5068
  setButtons() {
5068
5069
  this.firstBtn = this.createElement('div', { className: classNames.sliderButton + ' ' + classNames.firstButton });
5069
5070
  this.firstBtn.appendChild(this.createElement('span', { className: classNames.sliderButtonIcon }));
5070
- if (this.isTailwind) {
5071
+ if (this.isTailwind || this.isTailwind3) {
5071
5072
  this.firstBtn.querySelector('span').classList.add('e-icons');
5072
5073
  }
5073
5074
  this.firstBtn.tabIndex = -1;
5074
5075
  this.secondBtn = this.createElement('div', { className: classNames.sliderButton + ' ' + classNames.secondButton });
5075
5076
  this.secondBtn.appendChild(this.createElement('span', { className: classNames.sliderButtonIcon }));
5076
- if (this.isTailwind) {
5077
+ if (this.isTailwind || this.isTailwind3) {
5077
5078
  this.secondBtn.querySelector('span').classList.add('e-icons');
5078
5079
  }
5079
5080
  this.secondBtn.tabIndex = -1;
@@ -8954,7 +8955,7 @@ let Uploader = class Uploader extends Component {
8954
8955
  }
8955
8956
  for (let file = 0; file < item.length; file++) {
8956
8957
  const pasteFile = [].slice.call(item)[file];
8957
- if ((pasteFile.kind === 'file') || pasteFile.type.match('^image/')) {
8958
+ if (!isNullOrUndefined(pasteFile.getAsFile()) && ((pasteFile.kind === 'file') || pasteFile.type.match('^image/'))) {
8958
8959
  this.renderSelectedFiles(event, [pasteFile.getAsFile()], false, true);
8959
8960
  }
8960
8961
  }
@@ -15476,13 +15477,17 @@ class SignatureBase extends Component {
15476
15477
  }
15477
15478
  unwireEvents(type) {
15478
15479
  if (type === 'mouseup' || type === 'touchend') {
15479
- EventHandler.remove(this.canvasContext.canvas, 'mousemove touchmove', this.mouseMoveHandler);
15480
- 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
+ }
15481
15484
  EventHandler.remove(document, 'mouseup', this.mouseUpHandler);
15482
15485
  }
15483
15486
  else {
15484
- EventHandler.remove(this.canvasContext.canvas, 'mousedown touchstart', this.mouseDownHandler);
15485
- 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
+ }
15486
15491
  window.removeEventListener('resize', this.resizeHandler);
15487
15492
  }
15488
15493
  }
@@ -15591,10 +15596,11 @@ class SignatureBase extends Component {
15591
15596
  resizeHandler() {
15592
15597
  // eslint-disable-next-line @typescript-eslint/no-this-alias
15593
15598
  const proxy = this;
15594
- if (this.isResponsive && this.canRedraw) {
15599
+ if (this.isResponsive && this.canRedraw && this.canvasContext && this.element) {
15595
15600
  this.canvasContext.canvas.width = this.element.offsetWidth;
15596
15601
  this.canvasContext.canvas.height = this.element.offsetHeight;
15597
15602
  this.canvasContext.scale(1, 1);
15603
+ this.canvasContext.fillStyle = this.strokeColor;
15598
15604
  const pointSize = (this.minStrokeWidth + this.maxStrokeWidth) / 2;
15599
15605
  for (let i = 0; i < this.signRatioPointsColl.length; i++) {
15600
15606
  this.arcDraw((this.signRatioPointsColl[i].x * this.canvasContext.canvas.width), (this.signRatioPointsColl[i].y * this.canvasContext.canvas.height), pointSize);
@@ -15603,7 +15609,7 @@ class SignatureBase extends Component {
15603
15609
  this.canvasContext.closePath();
15604
15610
  this.canvasContext.fill();
15605
15611
  }
15606
- else {
15612
+ else if (this.canvasContext && this.element) {
15607
15613
  const restoreImg = new Image();
15608
15614
  restoreImg.src = this.snapColl[this.incStep];
15609
15615
  restoreImg.onload = () => {
@@ -15855,10 +15861,12 @@ class SignatureBase extends Component {
15855
15861
  if (this.incStep > 0) {
15856
15862
  const canvasNew = this.createElement('canvas', { className: 'e-' + this.getModuleName() + '-wrapper' });
15857
15863
  const canvasContextNew = canvasNew.getContext('2d');
15858
- canvasNew.width = this.canvasContext.canvas.width;
15859
- canvasNew.height = this.canvasContext.canvas.height;
15860
- canvasContextNew.drawImage(this.canvasContext.canvas, 0, 0, canvasNew.width, canvasNew.height);
15861
- this.snapColl.push(canvasNew.toDataURL());
15864
+ if (this.canvasContext) {
15865
+ canvasNew.width = this.canvasContext.canvas.width;
15866
+ canvasNew.height = this.canvasContext.canvas.height;
15867
+ canvasContextNew.drawImage(this.canvasContext.canvas, 0, 0, canvasNew.width, canvasNew.height);
15868
+ this.snapColl.push(canvasNew.toDataURL());
15869
+ }
15862
15870
  }
15863
15871
  else {
15864
15872
  this.snapColl.push(this.canvasContext.canvas.toDataURL());
@@ -16189,7 +16197,7 @@ class SignatureBase extends Component {
16189
16197
  }
16190
16198
  else if (type === 'Svg') {
16191
16199
  fileName = fileName || 'Signature';
16192
- this.toSVG(fileName, this.canvasContext.canvas.toDataURL('image/png'));
16200
+ this.toSVG(fileName);
16193
16201
  }
16194
16202
  else if (type === 'Jpeg') {
16195
16203
  fileName = fileName || 'Signature';
@@ -16336,8 +16344,12 @@ class SignatureBase extends Component {
16336
16344
  removeClass([this.element], 'e-' + this.getModuleName());
16337
16345
  this.element.removeAttribute('tabindex');
16338
16346
  this.pointColl = null;
16347
+ this.tempContext = null;
16348
+ this.tempCanvas = null;
16349
+ this.canvasContext = null;
16339
16350
  }
16340
16351
  super.destroy();
16352
+ this.element = null;
16341
16353
  }
16342
16354
  /**
16343
16355
  * Modified onPropertyChanged method for both blazor and EJ2 signature component.
@@ -17512,14 +17524,14 @@ let OtpInput = class OtpInput extends Component {
17512
17524
  const valueContainer = this.getDefaultValue();
17513
17525
  let inputValue = '';
17514
17526
  if (valueContainer) {
17527
+ const valueAtIndex = valueContainer[parseInt(index.toString(), 10)];
17515
17528
  if (this.type === 'number') {
17516
- const valueAtIndex = valueContainer[parseInt(index.toString(), 10)];
17517
17529
  if (!isNaN(Number(valueAtIndex))) {
17518
17530
  inputValue = valueAtIndex;
17519
17531
  }
17520
17532
  }
17521
17533
  else {
17522
- inputValue = valueContainer[parseInt(index.toString(), 10)] || '';
17534
+ inputValue = valueAtIndex || '';
17523
17535
  }
17524
17536
  }
17525
17537
  const inputEle = this.createElement('input', {
@@ -17528,7 +17540,7 @@ let OtpInput = class OtpInput extends Component {
17528
17540
  attrs: {
17529
17541
  maxlength: '1',
17530
17542
  type: this.type,
17531
- inputmode: 'inputmode' in this.htmlAttributes ? this.htmlAttributes['inputmode'] : (this.type === 'number' ? 'numeric' : 'text')
17543
+ inputmode: this.htmlAttributes['inputmode'] || (this.type === 'number' ? 'numeric' : 'text')
17532
17544
  }
17533
17545
  });
17534
17546
  if (this.disabled) {
@@ -17555,25 +17567,26 @@ let OtpInput = class OtpInput extends Component {
17555
17567
  }
17556
17568
  updateSeparatorValue() {
17557
17569
  if (this.separator === '') {
17558
- for (let i = 0; i < this.separatorElements.length; i++) {
17559
- remove(this.separatorElements[parseInt(i.toString(), 10)]);
17560
- }
17570
+ this.separatorElements.forEach((element) => remove(element));
17561
17571
  this.separatorElements = [];
17562
- return;
17563
17572
  }
17564
- for (let i = 0; i < this.separatorElements.length; i++) {
17565
- this.separatorElements[parseInt(i.toString(), 10)].textContent = this.separator;
17573
+ else {
17574
+ this.separatorElements.forEach((element) => {
17575
+ element.textContent = this.separator;
17576
+ });
17566
17577
  }
17567
17578
  }
17568
17579
  addPlaceHolder() {
17569
17580
  for (let i = 0; i < this.inputs.length; i++) {
17570
- this.setElementAttributes({ 'placeholder': this.placeholder.length === 1 || this.placeholder.length === 0 ? this.placeholder : this.placeholder.charAt(i) }, this.inputs[parseInt(i.toString(), 10)]);
17581
+ const placeholderValue = this.placeholder.length <= 1 ? this.placeholder : this.placeholder.charAt(i);
17582
+ this.setElementAttributes({ 'placeholder': placeholderValue }, this.inputs[parseInt(i.toString(), 10)]);
17571
17583
  }
17572
17584
  }
17573
17585
  updateInputType(inputType) {
17586
+ const inputMode = this.htmlAttributes['inputmode'] || (inputType === 'number' ? 'numeric' : 'text');
17574
17587
  this.inputs.forEach((input) => {
17575
17588
  input.type = inputType;
17576
- input.setAttribute('inputmode', 'inputmode' in this.htmlAttributes ? this.htmlAttributes['inputmode'] : (inputType === 'number' ? 'numeric' : 'text'));
17589
+ input.setAttribute('inputmode', inputMode);
17577
17590
  });
17578
17591
  }
17579
17592
  getDefaultValue() {
@@ -17583,10 +17596,7 @@ let OtpInput = class OtpInput extends Component {
17583
17596
  }
17584
17597
  // To remove the white space if present.
17585
17598
  const value = extractedValue.replace(/\s/g, '');
17586
- if (value.length > 0) {
17587
- return value.split('');
17588
- }
17589
- return undefined;
17599
+ return value.length > 0 ? value.split('') : undefined;
17590
17600
  }
17591
17601
  getTransformedText(transformingText) {
17592
17602
  const transformedText = this.textTransform.toLowerCase() === TextTransform.Lowercase ? transformingText.toLowerCase() :
@@ -17627,12 +17637,10 @@ let OtpInput = class OtpInput extends Component {
17627
17637
  value = currentInputElement.value;
17628
17638
  currentInputElement.value = '';
17629
17639
  }
17630
- else {
17631
- if (index !== this.inputs.length - 1) {
17632
- value = nextInputElement.value;
17633
- nextInputElement.value = '';
17634
- nextInputElement.focus();
17635
- }
17640
+ else if (index !== this.inputs.length - 1) {
17641
+ value = nextInputElement.value;
17642
+ nextInputElement.value = '';
17643
+ nextInputElement.focus();
17636
17644
  }
17637
17645
  if (value.length > 0) {
17638
17646
  this.triggerInputEvent(index, event);
@@ -17649,28 +17657,22 @@ let OtpInput = class OtpInput extends Component {
17649
17657
  }
17650
17658
  }
17651
17659
  else if (event.key === 'ArrowLeft' || event.key === 'ArrowRight') {
17652
- if (event.key === 'ArrowLeft') {
17653
- if (index > 0) {
17654
- previousInputElement.focus();
17655
- previousInputElement.select();
17656
- }
17660
+ if (event.key === 'ArrowLeft' && index > 0) {
17661
+ previousInputElement.focus();
17662
+ previousInputElement.select();
17657
17663
  }
17658
- else {
17659
- if (index < this.inputs.length - 1) {
17660
- nextInputElement.focus();
17661
- nextInputElement.select();
17662
- }
17664
+ else if (event.key === 'ArrowRight' && index < this.inputs.length - 1) {
17665
+ nextInputElement.focus();
17666
+ nextInputElement.select();
17663
17667
  }
17664
17668
  event.preventDefault();
17665
17669
  }
17666
17670
  else if (event.key === 'ArrowUp' || event.key === 'ArrowDown') {
17667
17671
  event.preventDefault();
17668
17672
  }
17669
- else {
17670
- if (event.key !== 'Tab' && !event.shiftKey && !event.ctrlKey) {
17671
- if (this.type === 'number' && (/\D/.test(event.key.toLocaleLowerCase()))) {
17672
- event.preventDefault();
17673
- }
17673
+ else if (event.key !== 'Tab' && !event.shiftKey && !event.ctrlKey) {
17674
+ if (this.type === 'number' && (/\D/.test(event.key.toLocaleLowerCase()))) {
17675
+ event.preventDefault();
17674
17676
  }
17675
17677
  }
17676
17678
  }
@@ -17789,9 +17791,9 @@ let OtpInput = class OtpInput extends Component {
17789
17791
  if (this.textTransform) {
17790
17792
  stringifiedValue = this.getTransformedText(stringifiedValue);
17791
17793
  }
17794
+ const previousStringValue = previousValue.toString();
17792
17795
  for (let i = 0; i < this.inputs.length; i++) {
17793
- const isValueChanged = previousValue.toString().charAt(i) !== stringifiedValue.charAt(i);
17794
- if (isValueChanged) {
17796
+ if (previousStringValue.charAt(i) !== stringifiedValue.charAt(i)) {
17795
17797
  this.inputs[parseInt(i.toString(), 10)].value = stringifiedValue.charAt(i);
17796
17798
  this.hiddenInputEle.value = stringifiedValue;
17797
17799
  }
@@ -17810,10 +17812,10 @@ let OtpInput = class OtpInput extends Component {
17810
17812
  }
17811
17813
  }
17812
17814
  updateVariantClass() {
17813
- let variantClass = this.stylingMode.toLocaleLowerCase();
17814
- variantClass = variantClass === 'outlined' ? 'outline' : variantClass;
17815
- if (variantClass === 'underlined' || variantClass === 'filled' || variantClass === 'outline') {
17816
- removeClass([this.element], ['e-underlined', 'e-filled', 'e-outline']);
17815
+ const variantClass = this.stylingMode.toLocaleLowerCase() === 'outlined' ? 'outline' : this.stylingMode.toLocaleLowerCase();
17816
+ const validClasses = ['underlined', 'filled', 'outline'];
17817
+ if (validClasses.indexOf(variantClass) !== -1) {
17818
+ removeClass([this.element], validClasses.map((cls) => `e-${cls}`));
17817
17819
  addClass([this.element], `e-${variantClass}`);
17818
17820
  }
17819
17821
  }
@@ -17914,12 +17916,8 @@ let OtpInput = class OtpInput extends Component {
17914
17916
  destroy() {
17915
17917
  super.destroy();
17916
17918
  this.unWireEvents();
17917
- for (let i = 0; i < this.inputs.length; i++) {
17918
- remove(this.inputs[parseInt(i.toString(), 10)]);
17919
- }
17920
- for (let i = 0; i < this.separatorElements.length; i++) {
17921
- remove(this.separatorElements[parseInt(i.toString(), 10)]);
17922
- }
17919
+ this.inputs.forEach((input) => { remove(input); });
17920
+ this.separatorElements.forEach((separatorElement) => { remove(separatorElement); });
17923
17921
  remove(this.hiddenInputEle);
17924
17922
  removeClass([this.element], ['e-underlined', 'e-filled', 'e-outline', 'e-rtl']);
17925
17923
  if (this.cssClass) {