@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
|
@@ -290,7 +290,7 @@ var AXValidatableComponent = /** @class */ (function (_super) {
|
|
|
290
290
|
});
|
|
291
291
|
AXValidatableComponent.prototype.validate = function () {
|
|
292
292
|
var _this = this;
|
|
293
|
-
if (this.__validation !== undefined) {
|
|
293
|
+
if (this.__validation !== undefined && (this.__validation.rules || []).length > 0) {
|
|
294
294
|
var result = this.__validation.validate(this[this.__valueField]);
|
|
295
295
|
result.then(function (c) {
|
|
296
296
|
if (c.result) {
|
|
@@ -309,40 +309,44 @@ var AXValidatableComponent = /** @class */ (function (_super) {
|
|
|
309
309
|
AXValidatableComponent.prototype.clearValidationStyle = function (element, clear) {
|
|
310
310
|
if (clear === void 0) { clear = false; }
|
|
311
311
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
(
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
312
|
+
if (this.__validation !== undefined && (this.__validation.rules || []).length > 0) {
|
|
313
|
+
var formGroup = element.closest('.form-group');
|
|
314
|
+
var formItem = ((_a = formGroup) === null || _a === void 0 ? void 0 : _a.querySelector('.form-item')) || element.closest('.form-item') || element.querySelector('.form-item');
|
|
315
|
+
;
|
|
316
|
+
var label = (_b = formGroup) === null || _b === void 0 ? void 0 : _b.querySelector('.form-group-label');
|
|
317
|
+
var parent_1 = ((_c = formItem) === null || _c === void 0 ? void 0 : _c.parentElement) || element.parentElement;
|
|
318
|
+
(_d = formItem) === null || _d === void 0 ? void 0 : _d.classList.remove('success-state');
|
|
319
|
+
(_e = formItem) === null || _e === void 0 ? void 0 : _e.classList.remove('error-state');
|
|
320
|
+
//formItem?.classList.remove('required-state');
|
|
321
|
+
if (!clear) {
|
|
322
|
+
(_f = formItem) === null || _f === void 0 ? void 0 : _f.classList.add('success-state');
|
|
323
|
+
}
|
|
324
|
+
(_g = label) === null || _g === void 0 ? void 0 : _g.classList.remove('error-text');
|
|
325
|
+
if (parent_1.querySelector('span.error-text')) {
|
|
326
|
+
parent_1.removeChild(parent_1.querySelector('span.error-text'));
|
|
327
|
+
}
|
|
326
328
|
}
|
|
327
329
|
};
|
|
328
330
|
AXValidatableComponent.prototype.applyValidationStyle = function (element, v) {
|
|
329
331
|
var _a, _b, _c, _d, _e, _f;
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
332
|
+
if (this.__validation !== undefined && (this.__validation.rules || []).length > 0) {
|
|
333
|
+
var formGroup = element.closest('.form-group');
|
|
334
|
+
var formItem = ((_a = formGroup) === null || _a === void 0 ? void 0 : _a.querySelector('.form-item')) || element.closest('.form-item') || element.querySelector('.form-item');
|
|
335
|
+
var label = (_b = formGroup) === null || _b === void 0 ? void 0 : _b.querySelector('.form-group-label');
|
|
336
|
+
var parent_2 = ((_c = formItem) === null || _c === void 0 ? void 0 : _c.parentElement) || element.parentElement;
|
|
337
|
+
(_d = formItem) === null || _d === void 0 ? void 0 : _d.classList.add('error-state');
|
|
338
|
+
(_e = formItem) === null || _e === void 0 ? void 0 : _e.classList.remove('success-state');
|
|
339
|
+
if (parent_2.querySelector('span.error-text')) {
|
|
340
|
+
parent_2.removeChild(parent_2.querySelector('span.error-text'));
|
|
341
|
+
}
|
|
342
|
+
if (this.__validation.showMessage) {
|
|
343
|
+
var span = document.createElement('span');
|
|
344
|
+
span.innerText = v.message;
|
|
345
|
+
span.classList.add('ax', 'error-text');
|
|
346
|
+
parent_2.appendChild(span);
|
|
347
|
+
}
|
|
348
|
+
(_f = label) === null || _f === void 0 ? void 0 : _f.classList.add('error-text');
|
|
349
|
+
}
|
|
346
350
|
};
|
|
347
351
|
__decorate([
|
|
348
352
|
Input(),
|