@acorex/components 3.0.3 → 3.0.8
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 +41 -32
- 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/esm2015/lib/selectbox/selectbox.component.js +2 -2
- package/esm2015/lib/textarea/textarea.component.js +7 -2
- package/esm5/lib/base/element.class.js +35 -31
- package/esm5/lib/selectbox/selectbox.component.js +2 -2
- package/esm5/lib/textarea/textarea.component.js +7 -2
- package/fesm2015/acorex-components.js +42 -33
- package/fesm2015/acorex-components.js.map +1 -1
- package/fesm5/acorex-components.js +41 -32
- package/fesm5/acorex-components.js.map +1 -1
- package/lib/textarea/textarea.component.d.ts +1 -0
- 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
|
-
|
|
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');
|
|
344
349
|
}
|
|
345
|
-
(_f = label) === null || _f === void 0 ? void 0 : _f.classList.add('error-text');
|
|
346
350
|
};
|
|
347
351
|
__decorate([
|
|
348
352
|
Input(),
|
|
@@ -8237,7 +8241,7 @@ var AXSelectBoxComponent = /** @class */ (function (_super) {
|
|
|
8237
8241
|
_this.size = 'md';
|
|
8238
8242
|
_this.allowNull = true;
|
|
8239
8243
|
_this.textAlign = null;
|
|
8240
|
-
_this.bufferSize =
|
|
8244
|
+
_this.bufferSize = 20;
|
|
8241
8245
|
_this.remoteOperation = false;
|
|
8242
8246
|
// this input is Private and only use in LOV
|
|
8243
8247
|
_this.currentfocusedIndex = -1;
|
|
@@ -11490,6 +11494,7 @@ var AXTextAreaComponent = /** @class */ (function (_super) {
|
|
|
11490
11494
|
_this.cdr = cdr;
|
|
11491
11495
|
_this.rows = 0;
|
|
11492
11496
|
_this.cols = 0;
|
|
11497
|
+
_this.maxLength = null;
|
|
11493
11498
|
return _this;
|
|
11494
11499
|
}
|
|
11495
11500
|
AXTextAreaComponent_1 = AXTextAreaComponent;
|
|
@@ -11506,10 +11511,14 @@ var AXTextAreaComponent = /** @class */ (function (_super) {
|
|
|
11506
11511
|
Input(),
|
|
11507
11512
|
__metadata("design:type", Number)
|
|
11508
11513
|
], AXTextAreaComponent.prototype, "cols", void 0);
|
|
11514
|
+
__decorate([
|
|
11515
|
+
Input(),
|
|
11516
|
+
__metadata("design:type", Number)
|
|
11517
|
+
], AXTextAreaComponent.prototype, "maxLength", void 0);
|
|
11509
11518
|
AXTextAreaComponent = AXTextAreaComponent_1 = __decorate([
|
|
11510
11519
|
Component({
|
|
11511
11520
|
selector: 'ax-text-area',
|
|
11512
|
-
template: "<div class=\"ax form-item {{size}}\" [class.disabled]=\"disabled\" [attr.id]=\"uid\">\r\n <div class=\"content\">\r\n <div class=\"ax input {{size}}\" [class.disabled]=\"disabled\" [class.readonly]=\"readonly\">\r\n <textarea rows=\"{{rows}}\" cols=\"{{cols}}\" #input type=\"text\"
|
|
11521
|
+
template: "<div class=\"ax form-item {{size}}\" [class.disabled]=\"disabled\" [attr.id]=\"uid\">\r\n <div class=\"content\">\r\n <div class=\"ax input {{size}}\" [class.disabled]=\"disabled\" [class.readonly]=\"readonly\">\r\n <textarea [attr.maxlength]=\"maxLength\" rows=\"{{rows}}\" cols=\"{{cols}}\" #input type=\"text\"\r\n class=\"ax icon {{size}}\" [ngClass]=\"setTextAlign()\" placeholder=\"{{placeholder}}\" [readonly]=\"readonly\"\r\n [disabled]=\"disabled\" value=\"{{value}}\"></textarea>\r\n </div>\r\n </div>\r\n <div class=\"ax buttons\">\r\n <ng-content select=\"ax-button\">\r\n </ng-content>\r\n </div>\r\n</div>",
|
|
11513
11522
|
encapsulation: ViewEncapsulation.None,
|
|
11514
11523
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
11515
11524
|
host: { style: 'display: contents;' },
|