@syncfusion/ej2-inputs 22.1.39 → 22.2.7

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.
@@ -4289,7 +4289,7 @@ var Slider = /** @__PURE__ @class */ (function (_super) {
4289
4289
  this.setCSSClass();
4290
4290
  };
4291
4291
  Slider.prototype.setElementWidth = function (width) {
4292
- if (!isNullOrUndefined(width)) {
4292
+ if (!isNullOrUndefined(width) && !isNullOrUndefined(this.sliderContainer)) {
4293
4293
  if (typeof width === 'number') {
4294
4294
  this.sliderContainer.style.width = formatUnit(width);
4295
4295
  }
@@ -4852,10 +4852,12 @@ var Slider = /** @__PURE__ @class */ (function (_super) {
4852
4852
  this.tooltipElement.style.transform = this.getTooltipTransformProperties(this.previousTooltipClass).rotate;
4853
4853
  }
4854
4854
  if (this.type === 'Default') {
4855
- setTimeout(function () { _this.tooltipElement.style.transition = _this.transition.handle; }, 2500);
4855
+ setTimeout(function () { if (_this.tooltipElement)
4856
+ _this.tooltipElement.style.transition = _this.transition.handle; }, 2500);
4856
4857
  }
4857
4858
  else {
4858
- setTimeout(function () { _this.tooltipElement.style.transition = 'none'; }, 2500);
4859
+ setTimeout(function () { if (_this.tooltipElement)
4860
+ _this.tooltipElement.style.transition = 'none'; }, 2500);
4859
4861
  }
4860
4862
  }
4861
4863
  };
@@ -4874,7 +4876,8 @@ var Slider = /** @__PURE__ @class */ (function (_super) {
4874
4876
  this.tooltipElement.classList.remove(classNames.materialTooltipOpen);
4875
4877
  this.setTooltipTransform();
4876
4878
  this.tooltipTarget = undefined;
4877
- setTimeout(function () { _this.tooltipElement.style.transition = 'none'; }, 2500);
4879
+ setTimeout(function () { if (_this.tooltipElement)
4880
+ _this.tooltipElement.style.transition = 'none'; }, 2500);
4878
4881
  }
4879
4882
  };
4880
4883
  Slider.prototype.checkTooltipPosition = function (args) {
@@ -4900,6 +4903,8 @@ var Slider = /** @__PURE__ @class */ (function (_super) {
4900
4903
  };
4901
4904
  Slider.prototype.setTooltipTransform = function () {
4902
4905
  var transformProperties = this.getTooltipTransformProperties(this.previousTooltipClass);
4906
+ if (isNullOrUndefined(this.tooltipElement))
4907
+ return;
4903
4908
  if (this.tooltipElement.firstElementChild.innerText.length > 4) {
4904
4909
  this.tooltipElement.style.transform = transformProperties.translate + " scale(0.01)";
4905
4910
  }
@@ -5439,7 +5444,7 @@ var Slider = /** @__PURE__ @class */ (function (_super) {
5439
5444
  }
5440
5445
  };
5441
5446
  Slider.prototype.setRangeBar = function () {
5442
- if (this.orientation === 'Horizontal') {
5447
+ if (this.orientation === 'Horizontal' && !isNullOrUndefined(this.rangeBar)) {
5443
5448
  if (this.type === 'MinRange') {
5444
5449
  // eslint-disable-next-line
5445
5450
  this.enableRtl ? (this.rangeBar.style.right = '0px') : (this.rangeBar.style.left = '0px');
@@ -5452,7 +5457,7 @@ var Slider = /** @__PURE__ @class */ (function (_super) {
5452
5457
  setStyleAttribute(this.rangeBar, { 'width': this.handlePos2 - this.handlePos1 + 'px' });
5453
5458
  }
5454
5459
  }
5455
- else {
5460
+ else if (!isNullOrUndefined(this.rangeBar)) {
5456
5461
  if (this.type === 'MinRange') {
5457
5462
  this.rangeBar.style.bottom = this.min > this.max ? this.handlePos1 + 'px' : '0px';
5458
5463
  setStyleAttribute(this.rangeBar, { 'height': isNullOrUndefined(this.handlePos1) ? 0 : this.min > this.max ? this.element.clientHeight - this.handlePos1 + 'px' : this.handlePos1 + 'px' });
@@ -5589,7 +5594,7 @@ var Slider = /** @__PURE__ @class */ (function (_super) {
5589
5594
  this.setRangeValue();
5590
5595
  };
5591
5596
  Slider.prototype.modifyZindex = function () {
5592
- if (this.type === 'Range') {
5597
+ if (this.type === 'Range' && !isNullOrUndefined(this.firstHandle) && !isNullOrUndefined(this.secondHandle)) {
5593
5598
  if (this.activeHandle === 1) {
5594
5599
  this.firstHandle.style.zIndex = (this.zIndex + 4) + '';
5595
5600
  this.secondHandle.style.zIndex = (this.zIndex + 3) + '';
@@ -5774,11 +5779,12 @@ var Slider = /** @__PURE__ @class */ (function (_super) {
5774
5779
  */
5775
5780
  Slider.prototype.reposition = function () {
5776
5781
  var _this = this;
5777
- this.firstHandle.style.transition = 'none';
5778
- if (this.type !== 'Default') {
5782
+ if (!isNullOrUndefined(this.firstHandle))
5783
+ this.firstHandle.style.transition = 'none';
5784
+ if (this.type !== 'Default' && !isNullOrUndefined(this.rangeBar)) {
5779
5785
  this.rangeBar.style.transition = 'none';
5780
5786
  }
5781
- if (this.type === 'Range') {
5787
+ if (this.type === 'Range' && !isNullOrUndefined(this.secondHandle)) {
5782
5788
  this.secondHandle.style.transition = 'none';
5783
5789
  }
5784
5790
  this.handlePos1 = this.checkHandlePosition(this.handleVal1);
@@ -5789,17 +5795,17 @@ var Slider = /** @__PURE__ @class */ (function (_super) {
5789
5795
  // eslint-disable-next-line
5790
5796
  this.enableRtl ? this.firstHandle.style.right =
5791
5797
  this.handlePos1 + "px" : this.firstHandle.style.left = this.handlePos1 + "px";
5792
- if (this.isMaterialTooltip) {
5798
+ if (this.isMaterialTooltip && !isNullOrUndefined(this.materialHandle)) {
5793
5799
  // eslint-disable-next-line
5794
5800
  this.enableRtl ? this.materialHandle.style.right =
5795
5801
  this.handlePos1 + "px" : this.materialHandle.style.left = this.handlePos1 + "px";
5796
5802
  }
5797
- if (this.type === 'MinRange') {
5803
+ if (this.type === 'MinRange' && !isNullOrUndefined(this.rangeBar)) {
5798
5804
  // eslint-disable-next-line
5799
5805
  this.enableRtl ? (this.rangeBar.style.right = '0px') : (this.rangeBar.style.left = '0px');
5800
5806
  setStyleAttribute(this.rangeBar, { 'width': isNullOrUndefined(this.handlePos1) ? 0 : this.handlePos1 + 'px' });
5801
5807
  }
5802
- else if (this.type === 'Range') {
5808
+ else if (this.type === 'Range' && !isNullOrUndefined(this.secondHandle) && !isNullOrUndefined(this.rangeBar)) {
5803
5809
  // eslint-disable-next-line
5804
5810
  this.enableRtl ? this.secondHandle.style.right =
5805
5811
  this.handlePos2 + "px" : this.secondHandle.style.left = this.handlePos2 + "px";
@@ -5835,8 +5841,9 @@ var Slider = /** @__PURE__ @class */ (function (_super) {
5835
5841
  this.handleStart();
5836
5842
  if (!this.tooltip.isVisible) {
5837
5843
  setTimeout(function () {
5838
- _this.firstHandle.style.transition = _this.scaleTransform;
5839
- if (_this.type === 'Range') {
5844
+ if (!isNullOrUndefined(_this.firstHandle))
5845
+ _this.firstHandle.style.transition = _this.scaleTransform;
5846
+ if (_this.type === 'Range' && !isNullOrUndefined(_this.secondHandle)) {
5840
5847
  _this.secondHandle.style.transition = _this.scaleTransform;
5841
5848
  }
5842
5849
  });
@@ -6636,6 +6643,24 @@ var Slider = /** @__PURE__ @class */ (function (_super) {
6636
6643
  this.tooltipObj.destroy();
6637
6644
  }
6638
6645
  this.element.innerHTML = '';
6646
+ this.hiddenInput = null;
6647
+ this.sliderContainer = null;
6648
+ this.sliderTrack = null;
6649
+ this.rangeBar = null;
6650
+ this.firstHandle = null;
6651
+ this.secondHandle = null;
6652
+ this.tickElementCollection = null;
6653
+ this.ul = null;
6654
+ this.firstBtn = null;
6655
+ this.secondBtn = null;
6656
+ this.materialHandle = null;
6657
+ this.tooltipObj = null;
6658
+ this.tooltipTarget = null;
6659
+ this.limitBarFirst = null;
6660
+ this.limitBarSecond = null;
6661
+ this.firstChild = null;
6662
+ this.lastChild = null;
6663
+ this.tooltipElement = null;
6639
6664
  };
6640
6665
  /**
6641
6666
  * Calls internally if any of the property value is changed.
@@ -6794,15 +6819,16 @@ var Slider = /** @__PURE__ @class */ (function (_super) {
6794
6819
  };
6795
6820
  Slider.prototype.setZindex = function () {
6796
6821
  this.zIndex = 6;
6797
- if (!isNullOrUndefined(this.ticks) && this.ticks.placement !== 'None') {
6822
+ if (!isNullOrUndefined(this.ticks) && this.ticks.placement !== 'None' && !isNullOrUndefined(this.ul) && !isNullOrUndefined(this.element)) {
6798
6823
  this.ul.style.zIndex = (this.zIndex + -7) + '';
6799
6824
  this.element.style.zIndex = (this.zIndex + 2) + '';
6800
6825
  }
6801
6826
  if (!this.isMaterial && !this.isMaterial3 && !isNullOrUndefined(this.ticks) && this.ticks.placement === 'Both') {
6802
6827
  this.element.style.zIndex = (this.zIndex + 2) + '';
6803
6828
  }
6804
- this.firstHandle.style.zIndex = (this.zIndex + 3) + '';
6805
- if (this.type === 'Range') {
6829
+ if (!isNullOrUndefined(this.firstHandle))
6830
+ this.firstHandle.style.zIndex = (this.zIndex + 3) + '';
6831
+ if (this.type === 'Range' && !isNullOrUndefined(this.secondHandle)) {
6806
6832
  this.secondHandle.style.zIndex = (this.zIndex + 4) + '';
6807
6833
  }
6808
6834
  };
@@ -7253,13 +7279,31 @@ var FormValidator = /** @__PURE__ @class */ (function (_super) {
7253
7279
  var element = elements_2[_i];
7254
7280
  var input = element;
7255
7281
  input.removeAttribute('aria-invalid');
7256
- input.classList.remove(this.errorClass);
7282
+ var inputParent = input.parentElement;
7283
+ var grandParent = inputParent.parentElement;
7284
+ if (inputParent.classList.contains('e-control-wrapper') || inputParent.classList.contains('e-wrapper')) {
7285
+ inputParent.classList.remove(this.errorClass);
7286
+ }
7287
+ else if ((grandParent != null) && (grandParent.classList.contains('e-control-wrapper') || grandParent.classList.contains('e-wrapper'))) {
7288
+ grandParent.classList.remove(this.errorClass);
7289
+ }
7290
+ else {
7291
+ input.classList.remove(this.errorClass);
7292
+ }
7257
7293
  if (input.name.length > 0) {
7258
7294
  this.getInputElement(input.name);
7259
7295
  this.getErrorElement(input.name);
7260
7296
  this.hideMessage(input.name);
7261
7297
  }
7262
- input.classList.remove(this.validClass);
7298
+ if (inputParent.classList.contains('e-control-wrapper') || inputParent.classList.contains('e-wrapper')) {
7299
+ inputParent.classList.remove(this.validClass);
7300
+ }
7301
+ else if ((grandParent != null) && (grandParent.classList.contains('e-control-wrapper') || grandParent.classList.contains('e-wrapper'))) {
7302
+ grandParent.classList.remove(this.validClass);
7303
+ }
7304
+ else {
7305
+ input.classList.remove(this.validClass);
7306
+ }
7263
7307
  }
7264
7308
  };
7265
7309
  FormValidator.prototype.createHTML5Rules = function () {
@@ -7507,8 +7551,20 @@ var FormValidator = /** @__PURE__ @class */ (function (_super) {
7507
7551
  // Set aria attributes to invalid elements
7508
7552
  this.inputElement.setAttribute('aria-invalid', 'true');
7509
7553
  this.inputElement.setAttribute('aria-describedby', this.inputElement.id + '-info');
7510
- this.inputElement.classList.add(this.errorClass);
7511
- this.inputElement.classList.remove(this.validClass);
7554
+ var inputParent = this.inputElement.parentElement;
7555
+ var grandParent = inputParent.parentElement;
7556
+ if (inputParent.classList.contains('e-control-wrapper') || inputParent.classList.contains('e-wrapper')) {
7557
+ inputParent.classList.add(this.errorClass);
7558
+ inputParent.classList.remove(this.validClass);
7559
+ }
7560
+ else if ((grandParent != null) && (grandParent.classList.contains('e-control-wrapper') || grandParent.classList.contains('e-wrapper'))) {
7561
+ grandParent.classList.add(this.errorClass);
7562
+ grandParent.classList.remove(this.validClass);
7563
+ }
7564
+ else {
7565
+ this.inputElement.classList.add(this.errorClass);
7566
+ this.inputElement.classList.remove(this.validClass);
7567
+ }
7512
7568
  if (!this.infoElement) {
7513
7569
  this.createErrorElement(name, errorRule.message, this.inputElement);
7514
7570
  }
@@ -7517,8 +7573,18 @@ var FormValidator = /** @__PURE__ @class */ (function (_super) {
7517
7573
  }
7518
7574
  eventArgs.errorElement = this.infoElement;
7519
7575
  eventArgs.status = 'failure';
7520
- this.inputElement.classList.add(this.errorClass);
7521
- this.inputElement.classList.remove(this.validClass);
7576
+ if (inputParent.classList.contains('e-control-wrapper') || inputParent.classList.contains('e-wrapper')) {
7577
+ inputParent.classList.add(this.errorClass);
7578
+ inputParent.classList.remove(this.validClass);
7579
+ }
7580
+ else if ((grandParent != null) && (grandParent.classList.contains('e-control-wrapper') || grandParent.classList.contains('e-wrapper'))) {
7581
+ grandParent.classList.add(this.errorClass);
7582
+ grandParent.classList.remove(this.validClass);
7583
+ }
7584
+ else {
7585
+ this.inputElement.classList.add(this.errorClass);
7586
+ this.inputElement.classList.remove(this.validClass);
7587
+ }
7522
7588
  this.optionalValidationStatus(name, eventArgs);
7523
7589
  this.trigger('validationComplete', eventArgs);
7524
7590
  // Set aria-required to required rule elements
@@ -7660,8 +7726,20 @@ var FormValidator = /** @__PURE__ @class */ (function (_super) {
7660
7726
  if (this.infoElement) {
7661
7727
  this.infoElement.style.display = 'none';
7662
7728
  this.removeErrorRules(name);
7663
- this.inputElement.classList.add(this.validClass);
7664
- this.inputElement.classList.remove(this.errorClass);
7729
+ var inputParent = this.inputElement.parentElement;
7730
+ var grandParent = inputParent.parentElement;
7731
+ if (inputParent.classList.contains('e-control-wrapper') || inputParent.classList.contains('e-wrapper')) {
7732
+ inputParent.classList.add(this.validClass);
7733
+ inputParent.classList.remove(this.errorClass);
7734
+ }
7735
+ else if ((grandParent != null) && (grandParent.classList.contains('e-control-wrapper') || grandParent.classList.contains('e-wrapper'))) {
7736
+ grandParent.classList.add(this.validClass);
7737
+ grandParent.classList.remove(this.errorClass);
7738
+ }
7739
+ else {
7740
+ this.inputElement.classList.add(this.validClass);
7741
+ this.inputElement.classList.remove(this.errorClass);
7742
+ }
7665
7743
  this.inputElement.setAttribute('aria-invalid', 'false');
7666
7744
  }
7667
7745
  };
@@ -13651,6 +13729,7 @@ var TextBox = /** @__PURE__ @class */ (function (_super) {
13651
13729
  TextBox.prototype.wireEvents = function () {
13652
13730
  EventHandler.add(this.respectiveElement, 'focus', this.focusHandler, this);
13653
13731
  EventHandler.add(this.respectiveElement, 'blur', this.focusOutHandler, this);
13732
+ EventHandler.add(this.respectiveElement, 'keydown', this.keydownHandler, this);
13654
13733
  EventHandler.add(this.respectiveElement, 'input', this.inputHandler, this);
13655
13734
  EventHandler.add(this.respectiveElement, 'change', this.changeHandler, this);
13656
13735
  if (this.isForm) {
@@ -13720,6 +13799,11 @@ var TextBox = /** @__PURE__ @class */ (function (_super) {
13720
13799
  };
13721
13800
  this.trigger('blur', eventArgs);
13722
13801
  };
13802
+ TextBox.prototype.keydownHandler = function (args) {
13803
+ if ((args.keyCode === 13 || args.keyCode === 9) && !((this.previousValue === null || this.previousValue === "") && (this.value === null || this.value === "") && this.respectiveElement.value === "")) {
13804
+ this.setProperties({ value: this.respectiveElement.value }, true);
13805
+ }
13806
+ };
13723
13807
  TextBox.prototype.inputHandler = function (args) {
13724
13808
  // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-this-alias
13725
13809
  var textboxObj = this;
@@ -13803,6 +13887,7 @@ var TextBox = /** @__PURE__ @class */ (function (_super) {
13803
13887
  TextBox.prototype.unWireEvents = function () {
13804
13888
  EventHandler.remove(this.respectiveElement, 'focus', this.focusHandler);
13805
13889
  EventHandler.remove(this.respectiveElement, 'blur', this.focusOutHandler);
13890
+ EventHandler.remove(this.respectiveElement, 'keydown', this.keydownHandler);
13806
13891
  EventHandler.remove(this.respectiveElement, 'input', this.inputHandler);
13807
13892
  EventHandler.remove(this.respectiveElement, 'change', this.changeHandler);
13808
13893
  if (this.isForm) {
@@ -14665,18 +14750,28 @@ var SignatureBase = /** @__PURE__ @class */ (function (_super) {
14665
14750
  * @param {string} text - specify text to be drawn as signature.
14666
14751
  * @param {string} fontFamily - specify font family of a signature.
14667
14752
  * @param {number} fontSize - specify font size of a signature.
14753
+ * @param {number} x- Specifies the x-coordinate to start the text of a signature. Default to the center point of the image if it not specified.
14754
+ * @param {number} y - Specifies the y-coordinate to start the text of a signature. Default to the center point of the image if it not specified.
14668
14755
  *
14669
14756
  * @returns {void}.
14670
14757
  */
14671
- SignatureBase.prototype.draw = function (text, fontFamily, fontSize) {
14758
+ SignatureBase.prototype.draw = function (text, fontFamily, fontSize, x, y) {
14672
14759
  var args = { actionName: 'draw-text' };
14673
14760
  this.canvasContext.clearRect(0, 0, this.canvasContext.canvas.width, this.canvasContext.canvas.height);
14674
14761
  fontFamily = fontFamily || 'Arial';
14675
14762
  fontSize = fontSize || 30;
14676
14763
  this.canvasContext.font = fontSize + 'px ' + fontFamily;
14677
- this.canvasContext.textAlign = 'center';
14678
- this.canvasContext.textBaseline = 'middle';
14679
- this.canvasContext.fillText(text, this.element.width / 2, this.element.height / 2);
14764
+ var startX = this.element.width / 2;
14765
+ var startY = this.element.height / 2;
14766
+ if (isNullOrUndefined(x) && isNullOrUndefined(y)) {
14767
+ this.canvasContext.textAlign = 'center';
14768
+ this.canvasContext.textBaseline = 'middle';
14769
+ }
14770
+ else {
14771
+ startX = isNullOrUndefined(x) ? startX : x;
14772
+ startY = isNullOrUndefined(y) ? startY + fontSize / 2 : (y + fontSize / 2);
14773
+ }
14774
+ this.canvasContext.fillText(text, startX, startY);
14680
14775
  this.updateSnapCollection();
14681
14776
  this.isSignatureEmpty = false;
14682
14777
  this.trigger('change', args);