@syncfusion/ej2-inputs 22.2.5 → 22.2.9

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.
@@ -5949,7 +5949,9 @@ let Slider = class Slider extends Component {
5949
5949
  if (this.isMaterialTooltip) {
5950
5950
  this.initialTooltip = false;
5951
5951
  }
5952
- this.changeEvent('changed', evt);
5952
+ if (evt.target != handle) {
5953
+ this.changeEvent('changed', evt);
5954
+ }
5953
5955
  if (this.type !== 'Default') {
5954
5956
  this.setRangeBar();
5955
5957
  }
@@ -7148,13 +7150,31 @@ let FormValidator = FormValidator_1 = class FormValidator extends Base {
7148
7150
  for (const element of elements) {
7149
7151
  const input = element;
7150
7152
  input.removeAttribute('aria-invalid');
7151
- input.classList.remove(this.errorClass);
7153
+ const inputParent = input.parentElement;
7154
+ const grandParent = inputParent.parentElement;
7155
+ if (inputParent.classList.contains('e-control-wrapper') || inputParent.classList.contains('e-wrapper')) {
7156
+ inputParent.classList.remove(this.errorClass);
7157
+ }
7158
+ else if ((grandParent != null) && (grandParent.classList.contains('e-control-wrapper') || grandParent.classList.contains('e-wrapper'))) {
7159
+ grandParent.classList.remove(this.errorClass);
7160
+ }
7161
+ else {
7162
+ input.classList.remove(this.errorClass);
7163
+ }
7152
7164
  if (input.name.length > 0) {
7153
7165
  this.getInputElement(input.name);
7154
7166
  this.getErrorElement(input.name);
7155
7167
  this.hideMessage(input.name);
7156
7168
  }
7157
- input.classList.remove(this.validClass);
7169
+ if (inputParent.classList.contains('e-control-wrapper') || inputParent.classList.contains('e-wrapper')) {
7170
+ inputParent.classList.remove(this.validClass);
7171
+ }
7172
+ else if ((grandParent != null) && (grandParent.classList.contains('e-control-wrapper') || grandParent.classList.contains('e-wrapper'))) {
7173
+ grandParent.classList.remove(this.validClass);
7174
+ }
7175
+ else {
7176
+ input.classList.remove(this.validClass);
7177
+ }
7158
7178
  }
7159
7179
  }
7160
7180
  createHTML5Rules() {
@@ -7397,8 +7417,20 @@ let FormValidator = FormValidator_1 = class FormValidator extends Base {
7397
7417
  // Set aria attributes to invalid elements
7398
7418
  this.inputElement.setAttribute('aria-invalid', 'true');
7399
7419
  this.inputElement.setAttribute('aria-describedby', this.inputElement.id + '-info');
7400
- this.inputElement.classList.add(this.errorClass);
7401
- this.inputElement.classList.remove(this.validClass);
7420
+ const inputParent = this.inputElement.parentElement;
7421
+ const grandParent = inputParent.parentElement;
7422
+ if (inputParent.classList.contains('e-control-wrapper') || inputParent.classList.contains('e-wrapper')) {
7423
+ inputParent.classList.add(this.errorClass);
7424
+ inputParent.classList.remove(this.validClass);
7425
+ }
7426
+ else if ((grandParent != null) && (grandParent.classList.contains('e-control-wrapper') || grandParent.classList.contains('e-wrapper'))) {
7427
+ grandParent.classList.add(this.errorClass);
7428
+ grandParent.classList.remove(this.validClass);
7429
+ }
7430
+ else {
7431
+ this.inputElement.classList.add(this.errorClass);
7432
+ this.inputElement.classList.remove(this.validClass);
7433
+ }
7402
7434
  if (!this.infoElement) {
7403
7435
  this.createErrorElement(name, errorRule.message, this.inputElement);
7404
7436
  }
@@ -7407,8 +7439,18 @@ let FormValidator = FormValidator_1 = class FormValidator extends Base {
7407
7439
  }
7408
7440
  eventArgs.errorElement = this.infoElement;
7409
7441
  eventArgs.status = 'failure';
7410
- this.inputElement.classList.add(this.errorClass);
7411
- this.inputElement.classList.remove(this.validClass);
7442
+ if (inputParent.classList.contains('e-control-wrapper') || inputParent.classList.contains('e-wrapper')) {
7443
+ inputParent.classList.add(this.errorClass);
7444
+ inputParent.classList.remove(this.validClass);
7445
+ }
7446
+ else if ((grandParent != null) && (grandParent.classList.contains('e-control-wrapper') || grandParent.classList.contains('e-wrapper'))) {
7447
+ grandParent.classList.add(this.errorClass);
7448
+ grandParent.classList.remove(this.validClass);
7449
+ }
7450
+ else {
7451
+ this.inputElement.classList.add(this.errorClass);
7452
+ this.inputElement.classList.remove(this.validClass);
7453
+ }
7412
7454
  this.optionalValidationStatus(name, eventArgs);
7413
7455
  this.trigger('validationComplete', eventArgs);
7414
7456
  // Set aria-required to required rule elements
@@ -7550,8 +7592,20 @@ let FormValidator = FormValidator_1 = class FormValidator extends Base {
7550
7592
  if (this.infoElement) {
7551
7593
  this.infoElement.style.display = 'none';
7552
7594
  this.removeErrorRules(name);
7553
- this.inputElement.classList.add(this.validClass);
7554
- this.inputElement.classList.remove(this.errorClass);
7595
+ const inputParent = this.inputElement.parentElement;
7596
+ const grandParent = inputParent.parentElement;
7597
+ if (inputParent.classList.contains('e-control-wrapper') || inputParent.classList.contains('e-wrapper')) {
7598
+ inputParent.classList.add(this.validClass);
7599
+ inputParent.classList.remove(this.errorClass);
7600
+ }
7601
+ else if ((grandParent != null) && (grandParent.classList.contains('e-control-wrapper') || grandParent.classList.contains('e-wrapper'))) {
7602
+ grandParent.classList.add(this.validClass);
7603
+ grandParent.classList.remove(this.errorClass);
7604
+ }
7605
+ else {
7606
+ this.inputElement.classList.add(this.validClass);
7607
+ this.inputElement.classList.remove(this.errorClass);
7608
+ }
7555
7609
  this.inputElement.setAttribute('aria-invalid', 'false');
7556
7610
  }
7557
7611
  }
@@ -13401,6 +13455,7 @@ let TextBox = class TextBox extends Component {
13401
13455
  wireEvents() {
13402
13456
  EventHandler.add(this.respectiveElement, 'focus', this.focusHandler, this);
13403
13457
  EventHandler.add(this.respectiveElement, 'blur', this.focusOutHandler, this);
13458
+ EventHandler.add(this.respectiveElement, 'keydown', this.keydownHandler, this);
13404
13459
  EventHandler.add(this.respectiveElement, 'input', this.inputHandler, this);
13405
13460
  EventHandler.add(this.respectiveElement, 'change', this.changeHandler, this);
13406
13461
  if (this.isForm) {
@@ -13470,6 +13525,11 @@ let TextBox = class TextBox extends Component {
13470
13525
  };
13471
13526
  this.trigger('blur', eventArgs);
13472
13527
  }
13528
+ keydownHandler(args) {
13529
+ if ((args.keyCode === 13 || args.keyCode === 9) && !((this.previousValue === null || this.previousValue === "") && (this.value === null || this.value === "") && this.respectiveElement.value === "")) {
13530
+ this.setProperties({ value: this.respectiveElement.value }, true);
13531
+ }
13532
+ }
13473
13533
  inputHandler(args) {
13474
13534
  // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-this-alias
13475
13535
  const textboxObj = this;
@@ -13553,6 +13613,7 @@ let TextBox = class TextBox extends Component {
13553
13613
  unWireEvents() {
13554
13614
  EventHandler.remove(this.respectiveElement, 'focus', this.focusHandler);
13555
13615
  EventHandler.remove(this.respectiveElement, 'blur', this.focusOutHandler);
13616
+ EventHandler.remove(this.respectiveElement, 'keydown', this.keydownHandler);
13556
13617
  EventHandler.remove(this.respectiveElement, 'input', this.inputHandler);
13557
13618
  EventHandler.remove(this.respectiveElement, 'change', this.changeHandler);
13558
13619
  if (this.isForm) {