@3kles/kles-material-dynamicforms 14.0.2 → 14.0.3
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/README.md +24 -24
- package/esm2020/3kles-kles-material-dynamicforms.mjs +4 -4
- package/esm2020/lib/decorators/component.decorator.mjs +7 -7
- package/esm2020/lib/directive/dynamic-component.directive.mjs +44 -44
- package/esm2020/lib/directive/dynamic-field.directive.mjs +50 -50
- package/esm2020/lib/dynamic-form.component.mjs +251 -247
- package/esm2020/lib/enums/type.enum.mjs +19 -19
- package/esm2020/lib/fields/array.component.mjs +57 -53
- package/esm2020/lib/fields/badge.component.mjs +40 -40
- package/esm2020/lib/fields/button-form.component.mjs +44 -44
- package/esm2020/lib/fields/button-submit.component.mjs +38 -38
- package/esm2020/lib/fields/button-toogle-group.component.mjs +51 -51
- package/esm2020/lib/fields/buttonchecker-form.component.mjs +44 -44
- package/esm2020/lib/fields/buttonfile-form.component.mjs +42 -42
- package/esm2020/lib/fields/checkbox.component.mjs +50 -50
- package/esm2020/lib/fields/chip.component.mjs +41 -41
- package/esm2020/lib/fields/color.component.mjs +84 -84
- package/esm2020/lib/fields/date.component.mjs +52 -52
- package/esm2020/lib/fields/field.abstract.mjs +66 -66
- package/esm2020/lib/fields/group.component.mjs +48 -44
- package/esm2020/lib/fields/icon.component.mjs +28 -28
- package/esm2020/lib/fields/input.clearable.component.mjs +112 -112
- package/esm2020/lib/fields/input.component.mjs +158 -158
- package/esm2020/lib/fields/label.component.mjs +40 -40
- package/esm2020/lib/fields/line-break.component.mjs +23 -23
- package/esm2020/lib/fields/link.component.mjs +32 -32
- package/esm2020/lib/fields/list-field.component.mjs +114 -114
- package/esm2020/lib/fields/radio.component.mjs +49 -49
- package/esm2020/lib/fields/select.component.mjs +211 -211
- package/esm2020/lib/fields/select.search.component.mjs +307 -307
- package/esm2020/lib/fields/selection-list.component.mjs +63 -63
- package/esm2020/lib/fields/slide-toggle.component.mjs +43 -43
- package/esm2020/lib/fields/text.component.mjs +40 -40
- package/esm2020/lib/fields/textarea.component.mjs +56 -56
- package/esm2020/lib/forms/button-control.component.mjs +115 -115
- package/esm2020/lib/forms/buttonchecker-control.component.mjs +85 -85
- package/esm2020/lib/forms/buttonfile-control.component.mjs +118 -118
- package/esm2020/lib/interfaces/component.interface.mjs +2 -2
- package/esm2020/lib/interfaces/directive.interface.mjs +2 -2
- package/esm2020/lib/interfaces/field.config.interface.mjs +2 -2
- package/esm2020/lib/interfaces/field.interface.mjs +2 -2
- package/esm2020/lib/interfaces/validator.interface.mjs +2 -2
- package/esm2020/lib/kles-material-dynamicforms.module.mjs +191 -191
- package/esm2020/lib/matcher/form-error.matcher.mjs +16 -16
- package/esm2020/lib/modules/material.module.mjs +278 -278
- package/esm2020/lib/pipe/array.pipe.mjs +22 -22
- package/esm2020/lib/pipe/transform.pipe.mjs +27 -27
- package/esm2020/lib/validators/autocomplete.validator.mjs +23 -23
- package/esm2020/public-api.mjs +59 -59
- package/fesm2015/3kles-kles-material-dynamicforms.mjs +2691 -2679
- package/fesm2015/3kles-kles-material-dynamicforms.mjs.map +1 -1
- package/fesm2020/3kles-kles-material-dynamicforms.mjs +2687 -2675
- package/fesm2020/3kles-kles-material-dynamicforms.mjs.map +1 -1
- package/index.d.ts +5 -5
- package/lib/decorators/component.decorator.d.ts +8 -8
- package/lib/directive/dynamic-component.directive.d.ts +16 -16
- package/lib/directive/dynamic-field.directive.d.ts +18 -18
- package/lib/dynamic-form.component.d.ts +31 -31
- package/lib/enums/type.enum.d.ts +17 -17
- package/lib/fields/array.component.d.ts +11 -11
- package/lib/fields/badge.component.d.ts +9 -9
- package/lib/fields/button-form.component.d.ts +9 -9
- package/lib/fields/button-submit.component.d.ts +9 -9
- package/lib/fields/button-toogle-group.component.d.ts +11 -11
- package/lib/fields/buttonchecker-form.component.d.ts +9 -9
- package/lib/fields/buttonfile-form.component.d.ts +9 -9
- package/lib/fields/checkbox.component.d.ts +9 -9
- package/lib/fields/chip.component.d.ts +9 -9
- package/lib/fields/color.component.d.ts +10 -10
- package/lib/fields/date.component.d.ts +9 -9
- package/lib/fields/field.abstract.d.ts +21 -21
- package/lib/fields/group.component.d.ts +11 -11
- package/lib/fields/icon.component.d.ts +9 -9
- package/lib/fields/input.clearable.component.d.ts +8 -8
- package/lib/fields/input.component.d.ts +15 -15
- package/lib/fields/label.component.d.ts +9 -9
- package/lib/fields/line-break.component.d.ts +9 -9
- package/lib/fields/link.component.d.ts +9 -9
- package/lib/fields/list-field.component.d.ts +19 -19
- package/lib/fields/radio.component.d.ts +9 -9
- package/lib/fields/select.component.d.ts +19 -19
- package/lib/fields/select.search.component.d.ts +22 -22
- package/lib/fields/selection-list.component.d.ts +11 -11
- package/lib/fields/slide-toggle.component.d.ts +9 -9
- package/lib/fields/text.component.d.ts +9 -9
- package/lib/fields/textarea.component.d.ts +9 -9
- package/lib/forms/button-control.component.d.ts +36 -36
- package/lib/forms/buttonchecker-control.component.d.ts +14 -14
- package/lib/forms/buttonfile-control.component.d.ts +20 -20
- package/lib/interfaces/component.interface.d.ts +5 -5
- package/lib/interfaces/directive.interface.d.ts +3 -3
- package/lib/interfaces/field.config.interface.d.ts +58 -57
- package/lib/interfaces/field.interface.d.ts +7 -7
- package/lib/interfaces/validator.interface.d.ts +5 -5
- package/lib/kles-material-dynamicforms.module.d.ts +47 -47
- package/lib/matcher/form-error.matcher.d.ts +9 -9
- package/lib/modules/material.module.d.ts +42 -42
- package/lib/pipe/array.pipe.d.ts +7 -7
- package/lib/pipe/transform.pipe.d.ts +10 -10
- package/lib/validators/autocomplete.validator.d.ts +3 -3
- package/package.json +1 -1
- package/public-api.d.ts +54 -54
package/README.md
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
# KlesMaterialDynamicforms
|
|
2
|
-
|
|
3
|
-
This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 9.1.0.
|
|
4
|
-
|
|
5
|
-
## Code scaffolding
|
|
6
|
-
|
|
7
|
-
Run `ng generate component component-name --project kles-material-dynamicforms` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module --project kles-material-dynamicforms`.
|
|
8
|
-
> Note: Don't forget to add `--project kles-material-dynamicforms` or else it will be added to the default project in your `angular.json` file.
|
|
9
|
-
|
|
10
|
-
## Build
|
|
11
|
-
|
|
12
|
-
Run `ng build kles-material-dynamicforms` to build the project. The build artifacts will be stored in the `dist/` directory.
|
|
13
|
-
|
|
14
|
-
## Publishing
|
|
15
|
-
|
|
16
|
-
After building your library with `ng build kles-material-dynamicforms`, go to the dist folder `cd dist/kles-material-dynamicforms` and run `npm publish`.
|
|
17
|
-
|
|
18
|
-
## Running unit tests
|
|
19
|
-
|
|
20
|
-
Run `ng test kles-material-dynamicforms` to execute the unit tests via [Karma](https://karma-runner.github.io).
|
|
21
|
-
|
|
22
|
-
## Further help
|
|
23
|
-
|
|
24
|
-
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).
|
|
1
|
+
# KlesMaterialDynamicforms
|
|
2
|
+
|
|
3
|
+
This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 9.1.0.
|
|
4
|
+
|
|
5
|
+
## Code scaffolding
|
|
6
|
+
|
|
7
|
+
Run `ng generate component component-name --project kles-material-dynamicforms` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module --project kles-material-dynamicforms`.
|
|
8
|
+
> Note: Don't forget to add `--project kles-material-dynamicforms` or else it will be added to the default project in your `angular.json` file.
|
|
9
|
+
|
|
10
|
+
## Build
|
|
11
|
+
|
|
12
|
+
Run `ng build kles-material-dynamicforms` to build the project. The build artifacts will be stored in the `dist/` directory.
|
|
13
|
+
|
|
14
|
+
## Publishing
|
|
15
|
+
|
|
16
|
+
After building your library with `ng build kles-material-dynamicforms`, go to the dist folder `cd dist/kles-material-dynamicforms` and run `npm publish`.
|
|
17
|
+
|
|
18
|
+
## Running unit tests
|
|
19
|
+
|
|
20
|
+
Run `ng test kles-material-dynamicforms` to execute the unit tests via [Karma](https://karma-runner.github.io).
|
|
21
|
+
|
|
22
|
+
## Further help
|
|
23
|
+
|
|
24
|
+
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Generated bundle index. Do not edit.
|
|
3
|
-
*/
|
|
4
|
-
export * from './public-api';
|
|
1
|
+
/**
|
|
2
|
+
* Generated bundle index. Do not edit.
|
|
3
|
+
*/
|
|
4
|
+
export * from './public-api';
|
|
5
5
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiM2tsZXMta2xlcy1tYXRlcmlhbC1keW5hbWljZm9ybXMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9wcm9qZWN0cy9rbGVzLW1hdGVyaWFsLWR5bmFtaWNmb3Jtcy9zcmMvM2tsZXMta2xlcy1tYXRlcmlhbC1keW5hbWljZm9ybXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7O0dBRUc7QUFFSCxjQUFjLGNBQWMsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogR2VuZXJhdGVkIGJ1bmRsZSBpbmRleC4gRG8gbm90IGVkaXQuXG4gKi9cblxuZXhwb3J0ICogZnJvbSAnLi9wdWJsaWMtYXBpJztcbiJdfQ==
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export const componentMapper = [];
|
|
2
|
-
export function FieldMapper(config) {
|
|
3
|
-
return (target) => {
|
|
4
|
-
componentMapper.push({ component: target, type: config.type });
|
|
5
|
-
};
|
|
6
|
-
}
|
|
7
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
1
|
+
export const componentMapper = [];
|
|
2
|
+
export function FieldMapper(config) {
|
|
3
|
+
return (target) => {
|
|
4
|
+
componentMapper.push({ component: target, type: config.type });
|
|
5
|
+
};
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29tcG9uZW50LmRlY29yYXRvci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL2tsZXMtbWF0ZXJpYWwtZHluYW1pY2Zvcm1zL3NyYy9saWIvZGVjb3JhdG9ycy9jb21wb25lbnQuZGVjb3JhdG9yLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUVBLE1BQU0sQ0FBQyxNQUFNLGVBQWUsR0FBNkMsRUFBRSxDQUFDO0FBRTVFLE1BQU0sVUFBVSxXQUFXLENBQUMsTUFBc0I7SUFDOUMsT0FBTyxDQUFDLE1BQWlCLEVBQUUsRUFBRTtRQUN6QixlQUFlLENBQUMsSUFBSSxDQUFDLEVBQUUsU0FBUyxFQUFFLE1BQU0sRUFBRSxJQUFJLEVBQUUsTUFBTSxDQUFDLElBQUksRUFBRSxDQUFDLENBQUM7SUFDbkUsQ0FBQyxDQUFDO0FBQ04sQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IFR5cGUgfSBmcm9tICdAYW5ndWxhci9jb3JlJztcclxuXHJcbmV4cG9ydCBjb25zdCBjb21wb25lbnRNYXBwZXI6IHsgY29tcG9uZW50OiBUeXBlPGFueT47IHR5cGU6IHN0cmluZyB9W10gPSBbXTtcclxuXHJcbmV4cG9ydCBmdW5jdGlvbiBGaWVsZE1hcHBlcihjb25maWc6IHt0eXBlOiBzdHJpbmd9KXtcclxuICAgIHJldHVybiAodGFyZ2V0OiBUeXBlPGFueT4pID0+IHtcclxuICAgICAgICBjb21wb25lbnRNYXBwZXIucHVzaCh7IGNvbXBvbmVudDogdGFyZ2V0LCB0eXBlOiBjb25maWcudHlwZSB9KTtcclxuICAgIH07XHJcbn1cclxuIl19
|
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
import { Directive, Input } from '@angular/core';
|
|
2
|
-
import * as i0 from "@angular/core";
|
|
3
|
-
export class KlesComponentDirective {
|
|
4
|
-
constructor(container) {
|
|
5
|
-
this.container = container;
|
|
6
|
-
}
|
|
7
|
-
ngOnInit() {
|
|
8
|
-
this.buildComponent();
|
|
9
|
-
}
|
|
10
|
-
ngOnChanges(changes) {
|
|
11
|
-
if (changes.component && !changes.component.isFirstChange()) {
|
|
12
|
-
this.component = changes.component.currentValue;
|
|
13
|
-
this.buildComponent();
|
|
14
|
-
}
|
|
15
|
-
if (changes.value && !changes.value.isFirstChange()) {
|
|
16
|
-
this.value = changes.value.currentValue;
|
|
17
|
-
this.componentRef.instance.value = this.value;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
buildComponent() {
|
|
21
|
-
if (this.componentRef) {
|
|
22
|
-
this.componentRef.destroy();
|
|
23
|
-
}
|
|
24
|
-
this.componentRef = this.container.createComponent(this.component);
|
|
25
|
-
this.componentRef.instance.component = this.component;
|
|
26
|
-
this.componentRef.instance.value = this.value;
|
|
27
|
-
this.componentRef.instance.field = this.field;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
KlesComponentDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.
|
|
31
|
-
KlesComponentDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.
|
|
32
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.
|
|
33
|
-
type: Directive,
|
|
34
|
-
args: [{
|
|
35
|
-
selector: '[klesComponent]'
|
|
36
|
-
}]
|
|
37
|
-
}], ctorParameters: function () { return [{ type: i0.ViewContainerRef }]; }, propDecorators: { component: [{
|
|
38
|
-
type: Input
|
|
39
|
-
}], value: [{
|
|
40
|
-
type: Input
|
|
41
|
-
}], field: [{
|
|
42
|
-
type: Input
|
|
43
|
-
}] } });
|
|
44
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
1
|
+
import { Directive, Input } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export class KlesComponentDirective {
|
|
4
|
+
constructor(container) {
|
|
5
|
+
this.container = container;
|
|
6
|
+
}
|
|
7
|
+
ngOnInit() {
|
|
8
|
+
this.buildComponent();
|
|
9
|
+
}
|
|
10
|
+
ngOnChanges(changes) {
|
|
11
|
+
if (changes.component && !changes.component.isFirstChange()) {
|
|
12
|
+
this.component = changes.component.currentValue;
|
|
13
|
+
this.buildComponent();
|
|
14
|
+
}
|
|
15
|
+
if (changes.value && !changes.value.isFirstChange()) {
|
|
16
|
+
this.value = changes.value.currentValue;
|
|
17
|
+
this.componentRef.instance.value = this.value;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
buildComponent() {
|
|
21
|
+
if (this.componentRef) {
|
|
22
|
+
this.componentRef.destroy();
|
|
23
|
+
}
|
|
24
|
+
this.componentRef = this.container.createComponent(this.component);
|
|
25
|
+
this.componentRef.instance.component = this.component;
|
|
26
|
+
this.componentRef.instance.value = this.value;
|
|
27
|
+
this.componentRef.instance.field = this.field;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
KlesComponentDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.1", ngImport: i0, type: KlesComponentDirective, deps: [{ token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
31
|
+
KlesComponentDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.1", type: KlesComponentDirective, selector: "[klesComponent]", inputs: { component: "component", value: "value", field: "field" }, usesOnChanges: true, ngImport: i0 });
|
|
32
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.1", ngImport: i0, type: KlesComponentDirective, decorators: [{
|
|
33
|
+
type: Directive,
|
|
34
|
+
args: [{
|
|
35
|
+
selector: '[klesComponent]'
|
|
36
|
+
}]
|
|
37
|
+
}], ctorParameters: function () { return [{ type: i0.ViewContainerRef }]; }, propDecorators: { component: [{
|
|
38
|
+
type: Input
|
|
39
|
+
}], value: [{
|
|
40
|
+
type: Input
|
|
41
|
+
}], field: [{
|
|
42
|
+
type: Input
|
|
43
|
+
}] } });
|
|
44
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZHluYW1pYy1jb21wb25lbnQuZGlyZWN0aXZlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMva2xlcy1tYXRlcmlhbC1keW5hbWljZm9ybXMvc3JjL2xpYi9kaXJlY3RpdmUvZHluYW1pYy1jb21wb25lbnQuZGlyZWN0aXZlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxTQUFTLEVBQUUsS0FBSyxFQUEwRSxNQUFNLGVBQWUsQ0FBQzs7QUFPekgsTUFBTSxPQUFPLHNCQUFzQjtJQU8vQixZQUFvQixTQUEyQjtRQUEzQixjQUFTLEdBQVQsU0FBUyxDQUFrQjtJQUFJLENBQUM7SUFFcEQsUUFBUTtRQUNKLElBQUksQ0FBQyxjQUFjLEVBQUUsQ0FBQztJQUMxQixDQUFDO0lBRUQsV0FBVyxDQUFDLE9BQXNCO1FBQzlCLElBQUksT0FBTyxDQUFDLFNBQVMsSUFBSSxDQUFDLE9BQU8sQ0FBQyxTQUFTLENBQUMsYUFBYSxFQUFFLEVBQUU7WUFDekQsSUFBSSxDQUFDLFNBQVMsR0FBRyxPQUFPLENBQUMsU0FBUyxDQUFDLFlBQVksQ0FBQztZQUNoRCxJQUFJLENBQUMsY0FBYyxFQUFFLENBQUM7U0FDekI7UUFDRCxJQUFJLE9BQU8sQ0FBQyxLQUFLLElBQUksQ0FBQyxPQUFPLENBQUMsS0FBSyxDQUFDLGFBQWEsRUFBRSxFQUFFO1lBQ2pELElBQUksQ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gICAgICAgICB0aGlzLnZhbHVlID0gY2hhbmdlcy52YWx1ZS5jdXJyZW50VmFsdWU7XHJcbiAgICAgICAgICAgIHRoaXMuY29tcG9uZW50UmVmLmluc3RhbmNlLnZhbHVlID0gdGhpcy52YWx1ZTtcclxuICAgICAgICB9XHJcbiAgICB9XHJcblxyXG4gICAgYnVpbGRDb21wb25lbnQoKSB7XHJcbiAgICAgICAgaWYgKHRoaXMuY29tcG9uZW50UmVmKSB7XHJcbiAgICAgICAgICAgIHRoaXMuY29tcG9uZW50UmVmLmRlc3Ryb3koKTtcclxuICAgICAgICB9XHJcbiAgICAgICAgdGhpcy5jb21wb25lbnRSZWYgPSB0aGlzLmNvbnRhaW5lci5jcmVhdGVDb21wb25lbnQodGhpcy5jb21wb25lbnQpO1xyXG4gICAgICAgIHRoaXMuY29tcG9uZW50UmVmLmluc3RhbmNlLmNvbXBvbmVudCA9IHRoaXMuY29tcG9uZW50O1xyXG4gICAgICAgIHRoaXMuY29tcG9uZW50UmVmLmluc3RhbmNlLnZhbHVlID0gdGhpcy52YWx1ZTtcclxuICAgICAgICB0aGlzLmNvbXBvbmVudFJlZi5pbnN0YW5jZS5maWVsZCA9IHRoaXMuZmllbGQ7XHJcbiAgICB9XHJcbn1cclxuIl19
|
|
@@ -1,50 +1,50 @@
|
|
|
1
|
-
import { Directive, Input } from '@angular/core';
|
|
2
|
-
import { componentMapper } from '../decorators/component.decorator';
|
|
3
|
-
import * as i0 from "@angular/core";
|
|
4
|
-
export class KlesDynamicFieldDirective {
|
|
5
|
-
constructor(container) {
|
|
6
|
-
this.container = container;
|
|
7
|
-
}
|
|
8
|
-
ngOnDestroy() {
|
|
9
|
-
if (this.componentRef) {
|
|
10
|
-
this.componentRef.destroy();
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
ngOnInit() {
|
|
14
|
-
this.buildComponent();
|
|
15
|
-
}
|
|
16
|
-
ngOnChanges(changes) {
|
|
17
|
-
if (changes.group) {
|
|
18
|
-
this.group = changes.group.currentValue;
|
|
19
|
-
}
|
|
20
|
-
if (changes.field) {
|
|
21
|
-
this.field = changes.field.currentValue;
|
|
22
|
-
this.buildComponent();
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
buildComponent() {
|
|
26
|
-
if (this.componentRef) {
|
|
27
|
-
this.componentRef.destroy();
|
|
28
|
-
}
|
|
29
|
-
this.componentRef = this.container.createComponent(this.field.component
|
|
30
|
-
|| componentMapper.find(element => element.type === this.field.type)?.component);
|
|
31
|
-
this.componentRef.instance.field = this.field;
|
|
32
|
-
this.componentRef.instance.group = this.group;
|
|
33
|
-
this.componentRef.instance.siblingFields = this.siblingFields;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
KlesDynamicFieldDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.
|
|
37
|
-
KlesDynamicFieldDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.
|
|
38
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.
|
|
39
|
-
type: Directive,
|
|
40
|
-
args: [{
|
|
41
|
-
selector: '[klesDynamicField]'
|
|
42
|
-
}]
|
|
43
|
-
}], ctorParameters: function () { return [{ type: i0.ViewContainerRef }]; }, propDecorators: { field: [{
|
|
44
|
-
type: Input
|
|
45
|
-
}], group: [{
|
|
46
|
-
type: Input
|
|
47
|
-
}], siblingFields: [{
|
|
48
|
-
type: Input
|
|
49
|
-
}] } });
|
|
50
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
1
|
+
import { Directive, Input } from '@angular/core';
|
|
2
|
+
import { componentMapper } from '../decorators/component.decorator';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export class KlesDynamicFieldDirective {
|
|
5
|
+
constructor(container) {
|
|
6
|
+
this.container = container;
|
|
7
|
+
}
|
|
8
|
+
ngOnDestroy() {
|
|
9
|
+
if (this.componentRef) {
|
|
10
|
+
this.componentRef.destroy();
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
ngOnInit() {
|
|
14
|
+
this.buildComponent();
|
|
15
|
+
}
|
|
16
|
+
ngOnChanges(changes) {
|
|
17
|
+
if (changes.group) {
|
|
18
|
+
this.group = changes.group.currentValue;
|
|
19
|
+
}
|
|
20
|
+
if (changes.field) {
|
|
21
|
+
this.field = changes.field.currentValue;
|
|
22
|
+
this.buildComponent();
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
buildComponent() {
|
|
26
|
+
if (this.componentRef) {
|
|
27
|
+
this.componentRef.destroy();
|
|
28
|
+
}
|
|
29
|
+
this.componentRef = this.container.createComponent(this.field.component
|
|
30
|
+
|| componentMapper.find(element => element.type === this.field.type)?.component);
|
|
31
|
+
this.componentRef.instance.field = this.field;
|
|
32
|
+
this.componentRef.instance.group = this.group;
|
|
33
|
+
this.componentRef.instance.siblingFields = this.siblingFields;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
KlesDynamicFieldDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.1", ngImport: i0, type: KlesDynamicFieldDirective, deps: [{ token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
37
|
+
KlesDynamicFieldDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.1", type: KlesDynamicFieldDirective, selector: "[klesDynamicField]", inputs: { field: "field", group: "group", siblingFields: "siblingFields" }, usesOnChanges: true, ngImport: i0 });
|
|
38
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.1", ngImport: i0, type: KlesDynamicFieldDirective, decorators: [{
|
|
39
|
+
type: Directive,
|
|
40
|
+
args: [{
|
|
41
|
+
selector: '[klesDynamicField]'
|
|
42
|
+
}]
|
|
43
|
+
}], ctorParameters: function () { return [{ type: i0.ViewContainerRef }]; }, propDecorators: { field: [{
|
|
44
|
+
type: Input
|
|
45
|
+
}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