@syncfusion/ej2-inputs 22.2.5 → 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.
- package/CHANGELOG.md +8 -0
- package/dist/ej2-inputs.min.js +2 -2
- package/dist/ej2-inputs.umd.min.js +2 -2
- package/dist/ej2-inputs.umd.min.js.map +1 -1
- package/dist/es6/ej2-inputs.es2015.js +67 -8
- package/dist/es6/ej2-inputs.es2015.js.map +1 -1
- package/dist/es6/ej2-inputs.es5.js +67 -8
- package/dist/es6/ej2-inputs.es5.js.map +1 -1
- package/dist/global/ej2-inputs.min.js +2 -2
- package/dist/global/ej2-inputs.min.js.map +1 -1
- package/dist/global/index.d.ts +1 -1
- package/package.json +6 -6
- package/src/form-validator/form-validator.js +60 -8
- package/src/textbox/textbox.d.ts +1 -0
- package/src/textbox/textbox.js +7 -0
|
@@ -7279,13 +7279,31 @@ var FormValidator = /** @__PURE__ @class */ (function (_super) {
|
|
|
7279
7279
|
var element = elements_2[_i];
|
|
7280
7280
|
var input = element;
|
|
7281
7281
|
input.removeAttribute('aria-invalid');
|
|
7282
|
-
input.
|
|
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
|
+
}
|
|
7283
7293
|
if (input.name.length > 0) {
|
|
7284
7294
|
this.getInputElement(input.name);
|
|
7285
7295
|
this.getErrorElement(input.name);
|
|
7286
7296
|
this.hideMessage(input.name);
|
|
7287
7297
|
}
|
|
7288
|
-
|
|
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
|
+
}
|
|
7289
7307
|
}
|
|
7290
7308
|
};
|
|
7291
7309
|
FormValidator.prototype.createHTML5Rules = function () {
|
|
@@ -7533,8 +7551,20 @@ var FormValidator = /** @__PURE__ @class */ (function (_super) {
|
|
|
7533
7551
|
// Set aria attributes to invalid elements
|
|
7534
7552
|
this.inputElement.setAttribute('aria-invalid', 'true');
|
|
7535
7553
|
this.inputElement.setAttribute('aria-describedby', this.inputElement.id + '-info');
|
|
7536
|
-
this.inputElement.
|
|
7537
|
-
|
|
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
|
+
}
|
|
7538
7568
|
if (!this.infoElement) {
|
|
7539
7569
|
this.createErrorElement(name, errorRule.message, this.inputElement);
|
|
7540
7570
|
}
|
|
@@ -7543,8 +7573,18 @@ var FormValidator = /** @__PURE__ @class */ (function (_super) {
|
|
|
7543
7573
|
}
|
|
7544
7574
|
eventArgs.errorElement = this.infoElement;
|
|
7545
7575
|
eventArgs.status = 'failure';
|
|
7546
|
-
|
|
7547
|
-
|
|
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
|
+
}
|
|
7548
7588
|
this.optionalValidationStatus(name, eventArgs);
|
|
7549
7589
|
this.trigger('validationComplete', eventArgs);
|
|
7550
7590
|
// Set aria-required to required rule elements
|
|
@@ -7686,8 +7726,20 @@ var FormValidator = /** @__PURE__ @class */ (function (_super) {
|
|
|
7686
7726
|
if (this.infoElement) {
|
|
7687
7727
|
this.infoElement.style.display = 'none';
|
|
7688
7728
|
this.removeErrorRules(name);
|
|
7689
|
-
this.inputElement.
|
|
7690
|
-
|
|
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
|
+
}
|
|
7691
7743
|
this.inputElement.setAttribute('aria-invalid', 'false');
|
|
7692
7744
|
}
|
|
7693
7745
|
};
|
|
@@ -13677,6 +13729,7 @@ var TextBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
13677
13729
|
TextBox.prototype.wireEvents = function () {
|
|
13678
13730
|
EventHandler.add(this.respectiveElement, 'focus', this.focusHandler, this);
|
|
13679
13731
|
EventHandler.add(this.respectiveElement, 'blur', this.focusOutHandler, this);
|
|
13732
|
+
EventHandler.add(this.respectiveElement, 'keydown', this.keydownHandler, this);
|
|
13680
13733
|
EventHandler.add(this.respectiveElement, 'input', this.inputHandler, this);
|
|
13681
13734
|
EventHandler.add(this.respectiveElement, 'change', this.changeHandler, this);
|
|
13682
13735
|
if (this.isForm) {
|
|
@@ -13746,6 +13799,11 @@ var TextBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
13746
13799
|
};
|
|
13747
13800
|
this.trigger('blur', eventArgs);
|
|
13748
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
|
+
};
|
|
13749
13807
|
TextBox.prototype.inputHandler = function (args) {
|
|
13750
13808
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-this-alias
|
|
13751
13809
|
var textboxObj = this;
|
|
@@ -13829,6 +13887,7 @@ var TextBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
13829
13887
|
TextBox.prototype.unWireEvents = function () {
|
|
13830
13888
|
EventHandler.remove(this.respectiveElement, 'focus', this.focusHandler);
|
|
13831
13889
|
EventHandler.remove(this.respectiveElement, 'blur', this.focusOutHandler);
|
|
13890
|
+
EventHandler.remove(this.respectiveElement, 'keydown', this.keydownHandler);
|
|
13832
13891
|
EventHandler.remove(this.respectiveElement, 'input', this.inputHandler);
|
|
13833
13892
|
EventHandler.remove(this.respectiveElement, 'change', this.changeHandler);
|
|
13834
13893
|
if (this.isForm) {
|