@klippa/ngx-enhancy-forms 14.7.6 → 14.7.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/esm2020/lib/form/form-error/form-error.component.mjs +10 -3
- package/fesm2015/klippa-ngx-enhancy-forms.mjs +8 -2
- package/fesm2015/klippa-ngx-enhancy-forms.mjs.map +1 -1
- package/fesm2020/klippa-ngx-enhancy-forms.mjs +8 -2
- package/fesm2020/klippa-ngx-enhancy-forms.mjs.map +1 -1
- package/lib/form/form-error/form-error.component.d.ts +3 -1
- package/package.json +1 -1
|
@@ -2,9 +2,11 @@ import { Component, Host, Input, Optional, ViewChild } from '@angular/core';
|
|
|
2
2
|
import { isNullOrUndefined } from "../../util/values";
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
4
|
import * as i1 from "../form-element/form-element.component";
|
|
5
|
+
import * as i2 from "@angular/common";
|
|
5
6
|
export class FormErrorComponent {
|
|
6
7
|
constructor(parent) {
|
|
7
8
|
this.parent = parent;
|
|
9
|
+
this.showErrorValueAsMessage = false;
|
|
8
10
|
this.showError = false;
|
|
9
11
|
}
|
|
10
12
|
ngOnInit() {
|
|
@@ -20,20 +22,25 @@ export class FormErrorComponent {
|
|
|
20
22
|
}
|
|
21
23
|
});
|
|
22
24
|
}
|
|
25
|
+
getErrorValueMessage() {
|
|
26
|
+
return this.parent.getAttachedControl().errors[this.error];
|
|
27
|
+
}
|
|
23
28
|
}
|
|
24
29
|
FormErrorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: FormErrorComponent, deps: [{ token: i1.FormElementComponent, host: true, optional: true }], target: i0.ɵɵFactoryTarget.Component });
|
|
25
|
-
FormErrorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.8", type: FormErrorComponent, selector: "klp-form-error", inputs: { error: "error" }, viewQueries: [{ propertyName: "contentRef", first: true, predicate: ["contentRef"], descendants: true }], ngImport: i0, template: "<ng-template #contentRef>\n\t<ng-content></ng-content>\n</ng-template>\n", styles: [":host{display:block}\n"] });
|
|
30
|
+
FormErrorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.8", type: FormErrorComponent, selector: "klp-form-error", inputs: { error: "error", showErrorValueAsMessage: "showErrorValueAsMessage" }, viewQueries: [{ propertyName: "contentRef", first: true, predicate: ["contentRef"], descendants: true }], ngImport: i0, template: "<ng-template #contentRef>\n\t<ng-content *ngIf=\"!showErrorValueAsMessage\"></ng-content>\n\t<div *ngIf=\"showErrorValueAsMessage\">{{getErrorValueMessage()}}</div>\n</ng-template>\n", styles: [":host{display:block}\n"], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
26
31
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: FormErrorComponent, decorators: [{
|
|
27
32
|
type: Component,
|
|
28
|
-
args: [{ selector: 'klp-form-error', template: "<ng-template #contentRef>\n\t<ng-content></ng-content>\n</ng-template>\n", styles: [":host{display:block}\n"] }]
|
|
33
|
+
args: [{ selector: 'klp-form-error', template: "<ng-template #contentRef>\n\t<ng-content *ngIf=\"!showErrorValueAsMessage\"></ng-content>\n\t<div *ngIf=\"showErrorValueAsMessage\">{{getErrorValueMessage()}}</div>\n</ng-template>\n", styles: [":host{display:block}\n"] }]
|
|
29
34
|
}], ctorParameters: function () { return [{ type: i1.FormElementComponent, decorators: [{
|
|
30
35
|
type: Host
|
|
31
36
|
}, {
|
|
32
37
|
type: Optional
|
|
33
38
|
}] }]; }, propDecorators: { error: [{
|
|
34
39
|
type: Input
|
|
40
|
+
}], showErrorValueAsMessage: [{
|
|
41
|
+
type: Input
|
|
35
42
|
}], contentRef: [{
|
|
36
43
|
type: ViewChild,
|
|
37
44
|
args: ['contentRef']
|
|
38
45
|
}] } });
|
|
39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NoZWRDb250cm9sKCk7XG5cdFx0XHR0aGlzLnBhcmVudC5yZWdpc3RlckVycm9ySGFuZGxlcih0aGlzLmVycm9yLCB0aGlzLmNvbnRlbnRSZWYpO1xuXHRcdFx0aWYgKGlzTnVsbE9yVW5kZWZpbmVkKGF0dGFjaGVkQ29udHJvbCkpIHtcblx0XHRcdFx0dGhyb3cgbmV3IEVycm9yKCdZb3UgYWRkZWQgYSBGb3JtIEVycm9yIGNvbXBvbmVudCB3aXRob3V0IGFuIGF0dGFjaGVkIEZvcm0gQ29udHJvbCcpO1xuXHRcdFx0fVxuXHRcdH0pO1xuXHR9XG5cblx0cHVibGljIGdldEVycm9yVmFsdWVNZXNzYWdlKCk6IHN0cmluZyB7XG5cdFx0cmV0dXJuIHRoaXMucGFyZW50LmdldEF0dGFjaGVkQ29udHJvbCgpLmVycm9yc1t0aGlzLmVycm9yXTtcblx0fVxufVxuIiwiPG5nLXRlbXBsYXRlICNjb250ZW50UmVmPlxuXHQ8bmctY29udGVudCAqbmdJZj1cIiFzaG93RXJyb3JWYWx1ZUFzTWVzc2FnZVwiPjwvbmctY29udGVudD5cblx0PGRpdiAqbmdJZj1cInNob3dFcnJvclZhbHVlQXNNZXNzYWdlXCI+e3tnZXRFcnJvclZhbHVlTWVzc2FnZSgpfX08L2Rpdj5cbjwvbmctdGVtcGxhdGU+XG4iXX0=
|
|
@@ -1167,6 +1167,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.8", ngImpor
|
|
|
1167
1167
|
class FormErrorComponent {
|
|
1168
1168
|
constructor(parent) {
|
|
1169
1169
|
this.parent = parent;
|
|
1170
|
+
this.showErrorValueAsMessage = false;
|
|
1170
1171
|
this.showError = false;
|
|
1171
1172
|
}
|
|
1172
1173
|
ngOnInit() {
|
|
@@ -1182,12 +1183,15 @@ class FormErrorComponent {
|
|
|
1182
1183
|
}
|
|
1183
1184
|
});
|
|
1184
1185
|
}
|
|
1186
|
+
getErrorValueMessage() {
|
|
1187
|
+
return this.parent.getAttachedControl().errors[this.error];
|
|
1188
|
+
}
|
|
1185
1189
|
}
|
|
1186
1190
|
FormErrorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: FormErrorComponent, deps: [{ token: FormElementComponent, host: true, optional: true }], target: i0.ɵɵFactoryTarget.Component });
|
|
1187
|
-
FormErrorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.8", type: FormErrorComponent, selector: "klp-form-error", inputs: { error: "error" }, viewQueries: [{ propertyName: "contentRef", first: true, predicate: ["contentRef"], descendants: true }], ngImport: i0, template: "<ng-template #contentRef>\n\t<ng-content></ng-content>\n</ng-template>\n", styles: [":host{display:block}\n"] });
|
|
1191
|
+
FormErrorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.8", type: FormErrorComponent, selector: "klp-form-error", inputs: { error: "error", showErrorValueAsMessage: "showErrorValueAsMessage" }, viewQueries: [{ propertyName: "contentRef", first: true, predicate: ["contentRef"], descendants: true }], ngImport: i0, template: "<ng-template #contentRef>\n\t<ng-content *ngIf=\"!showErrorValueAsMessage\"></ng-content>\n\t<div *ngIf=\"showErrorValueAsMessage\">{{getErrorValueMessage()}}</div>\n</ng-template>\n", styles: [":host{display:block}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
1188
1192
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: FormErrorComponent, decorators: [{
|
|
1189
1193
|
type: Component,
|
|
1190
|
-
args: [{ selector: 'klp-form-error', template: "<ng-template #contentRef>\n\t<ng-content></ng-content>\n</ng-template>\n", styles: [":host{display:block}\n"] }]
|
|
1194
|
+
args: [{ selector: 'klp-form-error', template: "<ng-template #contentRef>\n\t<ng-content *ngIf=\"!showErrorValueAsMessage\"></ng-content>\n\t<div *ngIf=\"showErrorValueAsMessage\">{{getErrorValueMessage()}}</div>\n</ng-template>\n", styles: [":host{display:block}\n"] }]
|
|
1191
1195
|
}], ctorParameters: function () {
|
|
1192
1196
|
return [{ type: FormElementComponent, decorators: [{
|
|
1193
1197
|
type: Host
|
|
@@ -1196,6 +1200,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.8", ngImpor
|
|
|
1196
1200
|
}] }];
|
|
1197
1201
|
}, propDecorators: { error: [{
|
|
1198
1202
|
type: Input
|
|
1203
|
+
}], showErrorValueAsMessage: [{
|
|
1204
|
+
type: Input
|
|
1199
1205
|
}], contentRef: [{
|
|
1200
1206
|
type: ViewChild,
|
|
1201
1207
|
args: ['contentRef']
|