@acorex/components 3.0.3 → 3.0.4
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/acorex-components.metadata.json +1 -1
- package/bundles/acorex-components.umd.js +35 -31
- package/bundles/acorex-components.umd.js.map +1 -1
- package/bundles/acorex-components.umd.min.js +1 -1
- package/bundles/acorex-components.umd.min.js.map +1 -1
- package/esm2015/lib/base/element.class.js +35 -31
- package/esm5/lib/base/element.class.js +35 -31
- package/fesm2015/acorex-components.js +35 -31
- package/fesm2015/acorex-components.js.map +1 -1
- package/fesm5/acorex-components.js +35 -31
- package/fesm5/acorex-components.js.map +1 -1
- package/package.json +1 -1
|
@@ -496,7 +496,7 @@
|
|
|
496
496
|
});
|
|
497
497
|
AXValidatableComponent.prototype.validate = function () {
|
|
498
498
|
var _this = this;
|
|
499
|
-
if (this.__validation !== undefined) {
|
|
499
|
+
if (this.__validation !== undefined && (this.__validation.rules || []).length > 0) {
|
|
500
500
|
var result = this.__validation.validate(this[this.__valueField]);
|
|
501
501
|
result.then(function (c) {
|
|
502
502
|
if (c.result) {
|
|
@@ -515,40 +515,44 @@
|
|
|
515
515
|
AXValidatableComponent.prototype.clearValidationStyle = function (element, clear) {
|
|
516
516
|
if (clear === void 0) { clear = false; }
|
|
517
517
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
(
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
518
|
+
if (this.__validation !== undefined && (this.__validation.rules || []).length > 0) {
|
|
519
|
+
var formGroup = element.closest('.form-group');
|
|
520
|
+
var formItem = ((_a = formGroup) === null || _a === void 0 ? void 0 : _a.querySelector('.form-item')) || element.closest('.form-item') || element.querySelector('.form-item');
|
|
521
|
+
;
|
|
522
|
+
var label = (_b = formGroup) === null || _b === void 0 ? void 0 : _b.querySelector('.form-group-label');
|
|
523
|
+
var parent_1 = ((_c = formItem) === null || _c === void 0 ? void 0 : _c.parentElement) || element.parentElement;
|
|
524
|
+
(_d = formItem) === null || _d === void 0 ? void 0 : _d.classList.remove('success-state');
|
|
525
|
+
(_e = formItem) === null || _e === void 0 ? void 0 : _e.classList.remove('error-state');
|
|
526
|
+
//formItem?.classList.remove('required-state');
|
|
527
|
+
if (!clear) {
|
|
528
|
+
(_f = formItem) === null || _f === void 0 ? void 0 : _f.classList.add('success-state');
|
|
529
|
+
}
|
|
530
|
+
(_g = label) === null || _g === void 0 ? void 0 : _g.classList.remove('error-text');
|
|
531
|
+
if (parent_1.querySelector('span.error-text')) {
|
|
532
|
+
parent_1.removeChild(parent_1.querySelector('span.error-text'));
|
|
533
|
+
}
|
|
532
534
|
}
|
|
533
535
|
};
|
|
534
536
|
AXValidatableComponent.prototype.applyValidationStyle = function (element, v) {
|
|
535
537
|
var _a, _b, _c, _d, _e, _f;
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
538
|
+
if (this.__validation !== undefined && (this.__validation.rules || []).length > 0) {
|
|
539
|
+
var formGroup = element.closest('.form-group');
|
|
540
|
+
var formItem = ((_a = formGroup) === null || _a === void 0 ? void 0 : _a.querySelector('.form-item')) || element.closest('.form-item') || element.querySelector('.form-item');
|
|
541
|
+
var label = (_b = formGroup) === null || _b === void 0 ? void 0 : _b.querySelector('.form-group-label');
|
|
542
|
+
var parent_2 = ((_c = formItem) === null || _c === void 0 ? void 0 : _c.parentElement) || element.parentElement;
|
|
543
|
+
(_d = formItem) === null || _d === void 0 ? void 0 : _d.classList.add('error-state');
|
|
544
|
+
(_e = formItem) === null || _e === void 0 ? void 0 : _e.classList.remove('success-state');
|
|
545
|
+
if (parent_2.querySelector('span.error-text')) {
|
|
546
|
+
parent_2.removeChild(parent_2.querySelector('span.error-text'));
|
|
547
|
+
}
|
|
548
|
+
if (this.__validation.showMessage) {
|
|
549
|
+
var span = document.createElement('span');
|
|
550
|
+
span.innerText = v.message;
|
|
551
|
+
span.classList.add('ax', 'error-text');
|
|
552
|
+
parent_2.appendChild(span);
|
|
553
|
+
}
|
|
554
|
+
(_f = label) === null || _f === void 0 ? void 0 : _f.classList.add('error-text');
|
|
555
|
+
}
|
|
552
556
|
};
|
|
553
557
|
__decorate([
|
|
554
558
|
core.Input(),
|