@stemy/ngx-dynamic-form 12.0.4 → 12.0.6
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/bundles/stemy-ngx-dynamic-form.umd.js +520 -337
- package/bundles/stemy-ngx-dynamic-form.umd.js.map +1 -1
- package/esm2015/ngx-dynamic-form/common-types.js +22 -15
- package/esm2015/ngx-dynamic-form/components/base/dynamic-form-base.component.js +67 -37
- package/esm2015/ngx-dynamic-form/components/dynamic-form/dynamic-form.component.js +47 -30
- package/esm2015/ngx-dynamic-form/components/dynamic-form-file/dynamic-form-file.component.js +13 -8
- package/esm2015/ngx-dynamic-form/components/dynamic-form-group/dynamic-form-group.component.js +22 -15
- package/esm2015/ngx-dynamic-form/components/dynamic-form-input/dynamic-form-input.component.js +19 -12
- package/esm2015/ngx-dynamic-form/components/dynamic-form-model/dynamic-form-model.component.js +18 -12
- package/esm2015/ngx-dynamic-form/components/dynamic-form-select/dynamic-form-select.component.js +16 -9
- package/esm2015/ngx-dynamic-form/components/dynamic-form-static/dynamic-form-static.component.js +15 -9
- package/esm2015/ngx-dynamic-form/components/dynamic-forms/dynamic-forms.component.js +53 -33
- package/esm2015/ngx-dynamic-form/directives/async-submit.directive.js +32 -22
- package/esm2015/ngx-dynamic-form/directives/dynamic-form-control.directive.js +14 -13
- package/esm2015/ngx-dynamic-form/directives/dynamic-form-group.directive.js +16 -14
- package/esm2015/ngx-dynamic-form/directives/dynamic-form-template.directive.js +32 -22
- package/esm2015/ngx-dynamic-form/ngx-dynamic-form.module.js +63 -26
- package/esm2015/ngx-dynamic-form/services/dynamic-form.service.js +13 -10
- package/esm2015/ngx-dynamic-form/services/form-utilities.js +14 -3
- package/esm2015/ngx-dynamic-form/services/open-api.service.js +10 -7
- package/esm2015/stemy-ngx-dynamic-form.js +1 -3
- package/fesm2015/stemy-ngx-dynamic-form.js +424 -272
- package/fesm2015/stemy-ngx-dynamic-form.js.map +1 -1
- package/ngx-dynamic-form/common-types.d.ts +3 -0
- package/ngx-dynamic-form/components/base/dynamic-form-base.component.d.ts +3 -0
- package/ngx-dynamic-form/components/dynamic-form/dynamic-form.component.d.ts +3 -0
- package/ngx-dynamic-form/components/dynamic-form-file/dynamic-form-file.component.d.ts +3 -0
- package/ngx-dynamic-form/components/dynamic-form-group/dynamic-form-group.component.d.ts +3 -0
- package/ngx-dynamic-form/components/dynamic-form-input/dynamic-form-input.component.d.ts +3 -0
- package/ngx-dynamic-form/components/dynamic-form-model/dynamic-form-model.component.d.ts +3 -0
- package/ngx-dynamic-form/components/dynamic-form-select/dynamic-form-select.component.d.ts +3 -0
- package/ngx-dynamic-form/components/dynamic-form-static/dynamic-form-static.component.d.ts +3 -0
- package/ngx-dynamic-form/components/dynamic-forms/dynamic-forms.component.d.ts +3 -0
- package/ngx-dynamic-form/directives/async-submit.directive.d.ts +3 -0
- package/ngx-dynamic-form/directives/dynamic-form-control.directive.d.ts +3 -0
- package/ngx-dynamic-form/directives/dynamic-form-group.directive.d.ts +3 -0
- package/ngx-dynamic-form/directives/dynamic-form-template.directive.d.ts +3 -0
- package/ngx-dynamic-form/ngx-dynamic-form.module.d.ts +19 -0
- package/ngx-dynamic-form/services/dynamic-form.service.d.ts +3 -0
- package/ngx-dynamic-form/services/open-api.service.d.ts +3 -0
- package/package.json +10 -11
- package/stemy-ngx-dynamic-form.d.ts +1 -2
- package/stemy-ngx-dynamic-form.metadata.json +0 -1
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { InjectionToken, Directive, Inject, HostBinding, Injectable, EventEmitter, Input, Output, HostListener, ContentChild, ContentChildren, Component, ViewEncapsulation, ViewChildren, ViewChild, NgModule } from '@angular/core';
|
|
3
|
+
import * as i2$1 from '@angular/forms';
|
|
2
4
|
import { FormGroup, FormControl, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
5
|
+
import * as i3 from '@stemy/ngx-utils';
|
|
3
6
|
import { API_SERVICE, LANGUAGE_SERVICE, TOASTER_SERVICE, ObjectUtils, ReflectUtils, UniqueUtils, TimerUtils, FileUtils, FactoryDependencies, StringUtils, ArrayUtils, NgxUtilsModule } from '@stemy/ngx-utils';
|
|
4
|
-
import
|
|
7
|
+
import * as i2 from '@angular/common';
|
|
5
8
|
import { DatePipe, CommonModule } from '@angular/common';
|
|
6
9
|
import { first } from 'rxjs/operators';
|
|
7
10
|
|
|
@@ -41,18 +44,26 @@ class FormControlComponent {
|
|
|
41
44
|
return true;
|
|
42
45
|
}
|
|
43
46
|
}
|
|
44
|
-
FormControlComponent
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
47
|
+
FormControlComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FormControlComponent, deps: [{ token: API_SERVICE }, { token: DYNAMIC_FORM }, { token: LANGUAGE_SERVICE }, { token: TOASTER_SERVICE }], target: i0.ɵɵFactoryTarget.Directive });
|
|
48
|
+
FormControlComponent.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: FormControlComponent, host: { properties: { "class.form-input": "this.inputClass" } }, ngImport: i0 });
|
|
49
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FormControlComponent, decorators: [{
|
|
50
|
+
type: Directive
|
|
51
|
+
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
52
|
+
type: Inject,
|
|
53
|
+
args: [API_SERVICE]
|
|
54
|
+
}] }, { type: undefined, decorators: [{
|
|
55
|
+
type: Inject,
|
|
56
|
+
args: [DYNAMIC_FORM]
|
|
57
|
+
}] }, { type: undefined, decorators: [{
|
|
58
|
+
type: Inject,
|
|
59
|
+
args: [LANGUAGE_SERVICE]
|
|
60
|
+
}] }, { type: undefined, decorators: [{
|
|
61
|
+
type: Inject,
|
|
62
|
+
args: [TOASTER_SERVICE]
|
|
63
|
+
}] }]; }, propDecorators: { inputClass: [{
|
|
64
|
+
type: HostBinding,
|
|
65
|
+
args: ["class.form-input"]
|
|
66
|
+
}] } });
|
|
56
67
|
function createValidator(control) {
|
|
57
68
|
const data = control.data || {};
|
|
58
69
|
const validators = [data.validator].concat(data.validators || []).filter(ObjectUtils.isDefined).map(v => {
|
|
@@ -468,7 +479,6 @@ const emptyArray = [];
|
|
|
468
479
|
const emptyTester = () => {
|
|
469
480
|
return Promise.resolve(false);
|
|
470
481
|
};
|
|
471
|
-
const ɵ0 = emptyTester;
|
|
472
482
|
function defaultSerializer(id, parent) {
|
|
473
483
|
const control = parent.getControl(id);
|
|
474
484
|
return !control ? Promise.resolve(parent.model[id]) : control.serialize();
|
|
@@ -647,16 +657,27 @@ class DynamicFormService {
|
|
|
647
657
|
return vcr.createComponent(factory).instance;
|
|
648
658
|
}
|
|
649
659
|
}
|
|
650
|
-
DynamicFormService
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
660
|
+
DynamicFormService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: DynamicFormService, deps: [{ token: FORM_CONTROL_PROVIDER }, { token: FORM_GROUP_TYPE }, { token: i0.ComponentFactoryResolver }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
661
|
+
DynamicFormService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: DynamicFormService });
|
|
662
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: DynamicFormService, decorators: [{
|
|
663
|
+
type: Injectable
|
|
664
|
+
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
665
|
+
type: Inject,
|
|
666
|
+
args: [FORM_CONTROL_PROVIDER]
|
|
667
|
+
}] }, { type: i0.Type, decorators: [{
|
|
668
|
+
type: Inject,
|
|
669
|
+
args: [FORM_GROUP_TYPE]
|
|
670
|
+
}] }, { type: i0.ComponentFactoryResolver }, { type: i0.Injector }]; } });
|
|
659
671
|
|
|
672
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
673
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
674
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
675
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
676
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
677
|
+
};
|
|
678
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
679
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
680
|
+
};
|
|
660
681
|
class FormUtilities {
|
|
661
682
|
static checkField(expression = `true`) {
|
|
662
683
|
// @dynamic
|
|
@@ -759,7 +780,10 @@ class FormUtilities {
|
|
|
759
780
|
}
|
|
760
781
|
}
|
|
761
782
|
__decorate([
|
|
762
|
-
FactoryDependencies(DatePipe)
|
|
783
|
+
FactoryDependencies(DatePipe),
|
|
784
|
+
__metadata("design:type", Function),
|
|
785
|
+
__metadata("design:paramtypes", [DatePipe, String, String]),
|
|
786
|
+
__metadata("design:returntype", Function)
|
|
763
787
|
], FormUtilities, "serializeDate", null);
|
|
764
788
|
|
|
765
789
|
class OpenApiService {
|
|
@@ -881,12 +905,14 @@ class OpenApiService {
|
|
|
881
905
|
return validators;
|
|
882
906
|
}
|
|
883
907
|
}
|
|
884
|
-
OpenApiService
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
908
|
+
OpenApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: OpenApiService, deps: [{ token: API_SERVICE }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
909
|
+
OpenApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: OpenApiService });
|
|
910
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: OpenApiService, decorators: [{
|
|
911
|
+
type: Injectable
|
|
912
|
+
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
913
|
+
type: Inject,
|
|
914
|
+
args: [API_SERVICE]
|
|
915
|
+
}] }]; } });
|
|
890
916
|
|
|
891
917
|
class AsyncSubmitDirective {
|
|
892
918
|
constructor(toaster, cdr, elem, renderer) {
|
|
@@ -953,27 +979,36 @@ class AsyncSubmitDirective {
|
|
|
953
979
|
});
|
|
954
980
|
}
|
|
955
981
|
}
|
|
956
|
-
AsyncSubmitDirective
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
]
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
];
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
}
|
|
982
|
+
AsyncSubmitDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: AsyncSubmitDirective, deps: [{ token: TOASTER_SERVICE }, { token: i0.ChangeDetectorRef }, { token: i0.ElementRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Directive });
|
|
983
|
+
AsyncSubmitDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: AsyncSubmitDirective, selector: "[async-submit]", inputs: { method: ["async-submit", "method"], form: "form" }, outputs: { onSuccess: "onSuccess", onError: "onError" }, host: { listeners: { "click": "click()" }, properties: { "class.disabled": "this.isDisabled", "class.loading": "this.isLoading" } }, exportAs: ["async-submit"], ngImport: i0 });
|
|
984
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: AsyncSubmitDirective, decorators: [{
|
|
985
|
+
type: Directive,
|
|
986
|
+
args: [{
|
|
987
|
+
selector: "[async-submit]",
|
|
988
|
+
exportAs: "async-submit"
|
|
989
|
+
}]
|
|
990
|
+
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
991
|
+
type: Inject,
|
|
992
|
+
args: [TOASTER_SERVICE]
|
|
993
|
+
}] }, { type: i0.ChangeDetectorRef }, { type: i0.ElementRef }, { type: i0.Renderer2 }]; }, propDecorators: { method: [{
|
|
994
|
+
type: Input,
|
|
995
|
+
args: ["async-submit"]
|
|
996
|
+
}], form: [{
|
|
997
|
+
type: Input
|
|
998
|
+
}], onSuccess: [{
|
|
999
|
+
type: Output
|
|
1000
|
+
}], onError: [{
|
|
1001
|
+
type: Output
|
|
1002
|
+
}], isDisabled: [{
|
|
1003
|
+
type: HostBinding,
|
|
1004
|
+
args: ["class.disabled"]
|
|
1005
|
+
}], isLoading: [{
|
|
1006
|
+
type: HostBinding,
|
|
1007
|
+
args: ["class.loading"]
|
|
1008
|
+
}], click: [{
|
|
1009
|
+
type: HostListener,
|
|
1010
|
+
args: ["click"]
|
|
1011
|
+
}] } });
|
|
977
1012
|
|
|
978
1013
|
class DynamicFormControlDirective {
|
|
979
1014
|
constructor(vcr, forms) {
|
|
@@ -992,27 +1027,29 @@ class DynamicFormControlDirective {
|
|
|
992
1027
|
this.comp.control = this.control;
|
|
993
1028
|
}
|
|
994
1029
|
}
|
|
995
|
-
DynamicFormControlDirective
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
};
|
|
1030
|
+
DynamicFormControlDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: DynamicFormControlDirective, deps: [{ token: i0.ViewContainerRef }, { token: DynamicFormService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
1031
|
+
DynamicFormControlDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: DynamicFormControlDirective, selector: "[form-control]", inputs: { control: ["form-control", "control"] }, usesOnChanges: true, ngImport: i0 });
|
|
1032
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: DynamicFormControlDirective, decorators: [{
|
|
1033
|
+
type: Directive,
|
|
1034
|
+
args: [{
|
|
1035
|
+
selector: "[form-control]",
|
|
1036
|
+
}]
|
|
1037
|
+
}], ctorParameters: function () { return [{ type: i0.ViewContainerRef }, { type: DynamicFormService }]; }, propDecorators: { control: [{
|
|
1038
|
+
type: Input,
|
|
1039
|
+
args: ["form-control"]
|
|
1040
|
+
}] } });
|
|
1007
1041
|
|
|
1008
1042
|
class DynamicFormTemplateDirective {
|
|
1009
1043
|
constructor(template) {
|
|
1010
1044
|
this.template = template;
|
|
1011
1045
|
}
|
|
1012
1046
|
}
|
|
1013
|
-
DynamicFormTemplateDirective
|
|
1014
|
-
|
|
1015
|
-
|
|
1047
|
+
DynamicFormTemplateDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: DynamicFormTemplateDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
1048
|
+
DynamicFormTemplateDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: DynamicFormTemplateDirective, selector: "ng-template[control],\n ng-template[label],\n ng-template[input],\n ng-template[prefix],\n ng-template[suffix],\n ng-template[setPrefix],\n ng-template[setSuffix],\n ng-template[formPrefix],\n ng-template[formSuffix],\n ng-template[innerFormPrefix],\n ng-template[innerFormSuffix]", inputs: { control: "control", label: "label", input: "input", prefix: "prefix", suffix: "suffix", setPrefix: "setPrefix", setSuffix: "setSuffix", formPrefix: "formPrefix", formSuffix: "formSuffix", innerFormPrefix: "innerFormPrefix", innerFormSuffix: "innerFormSuffix" }, ngImport: i0 });
|
|
1049
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: DynamicFormTemplateDirective, decorators: [{
|
|
1050
|
+
type: Directive,
|
|
1051
|
+
args: [{
|
|
1052
|
+
selector: `ng-template[control],
|
|
1016
1053
|
ng-template[label],
|
|
1017
1054
|
ng-template[input],
|
|
1018
1055
|
ng-template[prefix],
|
|
@@ -1023,24 +1060,30 @@ DynamicFormTemplateDirective.decorators = [
|
|
|
1023
1060
|
ng-template[formSuffix],
|
|
1024
1061
|
ng-template[innerFormPrefix],
|
|
1025
1062
|
ng-template[innerFormSuffix]`
|
|
1026
|
-
|
|
1027
|
-
];
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
}
|
|
1063
|
+
}]
|
|
1064
|
+
}], ctorParameters: function () { return [{ type: i0.TemplateRef }]; }, propDecorators: { control: [{
|
|
1065
|
+
type: Input
|
|
1066
|
+
}], label: [{
|
|
1067
|
+
type: Input
|
|
1068
|
+
}], input: [{
|
|
1069
|
+
type: Input
|
|
1070
|
+
}], prefix: [{
|
|
1071
|
+
type: Input
|
|
1072
|
+
}], suffix: [{
|
|
1073
|
+
type: Input
|
|
1074
|
+
}], setPrefix: [{
|
|
1075
|
+
type: Input
|
|
1076
|
+
}], setSuffix: [{
|
|
1077
|
+
type: Input
|
|
1078
|
+
}], formPrefix: [{
|
|
1079
|
+
type: Input
|
|
1080
|
+
}], formSuffix: [{
|
|
1081
|
+
type: Input
|
|
1082
|
+
}], innerFormPrefix: [{
|
|
1083
|
+
type: Input
|
|
1084
|
+
}], innerFormSuffix: [{
|
|
1085
|
+
type: Input
|
|
1086
|
+
}] } });
|
|
1044
1087
|
|
|
1045
1088
|
class DynamicFormGroupDirective {
|
|
1046
1089
|
constructor(vcr, forms) {
|
|
@@ -1064,19 +1107,19 @@ class DynamicFormGroupDirective {
|
|
|
1064
1107
|
this.comp.control = this.control;
|
|
1065
1108
|
}
|
|
1066
1109
|
}
|
|
1067
|
-
DynamicFormGroupDirective
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
};
|
|
1110
|
+
DynamicFormGroupDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: DynamicFormGroupDirective, deps: [{ token: i0.ViewContainerRef }, { token: DynamicFormService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
1111
|
+
DynamicFormGroupDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: DynamicFormGroupDirective, selector: "[form-group]", inputs: { control: ["form-group", "control"], visible: "visible" }, usesOnChanges: true, ngImport: i0 });
|
|
1112
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: DynamicFormGroupDirective, decorators: [{
|
|
1113
|
+
type: Directive,
|
|
1114
|
+
args: [{
|
|
1115
|
+
selector: "[form-group]",
|
|
1116
|
+
}]
|
|
1117
|
+
}], ctorParameters: function () { return [{ type: i0.ViewContainerRef }, { type: DynamicFormService }]; }, propDecorators: { control: [{
|
|
1118
|
+
type: Input,
|
|
1119
|
+
args: ["form-group"]
|
|
1120
|
+
}], visible: [{
|
|
1121
|
+
type: Input
|
|
1122
|
+
}] } });
|
|
1080
1123
|
|
|
1081
1124
|
class DynamicFormBaseComponent {
|
|
1082
1125
|
constructor(cdr, formService) {
|
|
@@ -1127,41 +1170,69 @@ class DynamicFormBaseComponent {
|
|
|
1127
1170
|
}, {});
|
|
1128
1171
|
}
|
|
1129
1172
|
}
|
|
1130
|
-
DynamicFormBaseComponent
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
]
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
}
|
|
1173
|
+
DynamicFormBaseComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: DynamicFormBaseComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: DynamicFormService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
1174
|
+
DynamicFormBaseComponent.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: DynamicFormBaseComponent, inputs: { name: "name", testId: "testId", readonly: "readonly", updateOn: "updateOn", classes: "classes", parent: "parent", wrapperTemplate: "wrapperTemplate", fieldSetTemplate: "fieldSetTemplate", controlTemplate: "controlTemplate", controlTemplates: "controlTemplates", labelTemplates: "labelTemplates", inputTemplates: "inputTemplates", prefixTemplates: "prefixTemplates", suffixTemplates: "suffixTemplates", setPrefixTemplates: "setPrefixTemplates", setSuffixTemplates: "setSuffixTemplates" }, outputs: { onChange: "onChange", onStatusChange: "onStatusChange", onInit: "onInit", onSubmit: "onSubmit" }, queries: [{ propertyName: "prefixTemplate", first: true, predicate: ["prefixTemplate"], descendants: true }, { propertyName: "suffixTemplate", first: true, predicate: ["suffixTemplate"], descendants: true }, { propertyName: "cWrapperTemplate", first: true, predicate: ["wrapperTemplate"], descendants: true }, { propertyName: "cFieldSetTemplate", first: true, predicate: ["fieldSetTemplate"], descendants: true }, { propertyName: "cControlTemplate", first: true, predicate: ["controlTemplate"], descendants: true }, { propertyName: "templates", predicate: DynamicFormTemplateDirective }], ngImport: i0 });
|
|
1175
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: DynamicFormBaseComponent, decorators: [{
|
|
1176
|
+
type: Directive
|
|
1177
|
+
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: DynamicFormService }]; }, propDecorators: { name: [{
|
|
1178
|
+
type: Input
|
|
1179
|
+
}], testId: [{
|
|
1180
|
+
type: Input
|
|
1181
|
+
}], readonly: [{
|
|
1182
|
+
type: Input
|
|
1183
|
+
}], updateOn: [{
|
|
1184
|
+
type: Input
|
|
1185
|
+
}], classes: [{
|
|
1186
|
+
type: Input
|
|
1187
|
+
}], parent: [{
|
|
1188
|
+
type: Input
|
|
1189
|
+
}], wrapperTemplate: [{
|
|
1190
|
+
type: Input
|
|
1191
|
+
}], fieldSetTemplate: [{
|
|
1192
|
+
type: Input
|
|
1193
|
+
}], controlTemplate: [{
|
|
1194
|
+
type: Input
|
|
1195
|
+
}], controlTemplates: [{
|
|
1196
|
+
type: Input
|
|
1197
|
+
}], labelTemplates: [{
|
|
1198
|
+
type: Input
|
|
1199
|
+
}], inputTemplates: [{
|
|
1200
|
+
type: Input
|
|
1201
|
+
}], prefixTemplates: [{
|
|
1202
|
+
type: Input
|
|
1203
|
+
}], suffixTemplates: [{
|
|
1204
|
+
type: Input
|
|
1205
|
+
}], setPrefixTemplates: [{
|
|
1206
|
+
type: Input
|
|
1207
|
+
}], setSuffixTemplates: [{
|
|
1208
|
+
type: Input
|
|
1209
|
+
}], onChange: [{
|
|
1210
|
+
type: Output
|
|
1211
|
+
}], onStatusChange: [{
|
|
1212
|
+
type: Output
|
|
1213
|
+
}], onInit: [{
|
|
1214
|
+
type: Output
|
|
1215
|
+
}], onSubmit: [{
|
|
1216
|
+
type: Output
|
|
1217
|
+
}], prefixTemplate: [{
|
|
1218
|
+
type: ContentChild,
|
|
1219
|
+
args: ["prefixTemplate"]
|
|
1220
|
+
}], suffixTemplate: [{
|
|
1221
|
+
type: ContentChild,
|
|
1222
|
+
args: ["suffixTemplate"]
|
|
1223
|
+
}], templates: [{
|
|
1224
|
+
type: ContentChildren,
|
|
1225
|
+
args: [DynamicFormTemplateDirective]
|
|
1226
|
+
}], cWrapperTemplate: [{
|
|
1227
|
+
type: ContentChild,
|
|
1228
|
+
args: ["wrapperTemplate"]
|
|
1229
|
+
}], cFieldSetTemplate: [{
|
|
1230
|
+
type: ContentChild,
|
|
1231
|
+
args: ["fieldSetTemplate"]
|
|
1232
|
+
}], cControlTemplate: [{
|
|
1233
|
+
type: ContentChild,
|
|
1234
|
+
args: ["controlTemplate"]
|
|
1235
|
+
}] } });
|
|
1165
1236
|
|
|
1166
1237
|
class DynamicFormComponent extends DynamicFormBaseComponent {
|
|
1167
1238
|
constructor(cdr, forms) {
|
|
@@ -1229,34 +1300,45 @@ class DynamicFormComponent extends DynamicFormBaseComponent {
|
|
|
1229
1300
|
return this.group.getControl(id);
|
|
1230
1301
|
}
|
|
1231
1302
|
}
|
|
1232
|
-
DynamicFormComponent
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
}
|
|
1303
|
+
DynamicFormComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: DynamicFormComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: DynamicFormService }], target: i0.ɵɵFactoryTarget.Component });
|
|
1304
|
+
DynamicFormComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: DynamicFormComponent, selector: "dynamic-form, [dynamic-form]", inputs: { group: "group", controls: "controls", serializers: "serializers", fieldSets: "fieldSets", data: "data" }, providers: [
|
|
1305
|
+
{
|
|
1306
|
+
provide: DynamicFormBaseComponent,
|
|
1307
|
+
useExisting: DynamicFormComponent
|
|
1308
|
+
},
|
|
1309
|
+
{
|
|
1310
|
+
provide: DYNAMIC_FORM,
|
|
1311
|
+
useExisting: DynamicFormComponent
|
|
1312
|
+
}
|
|
1313
|
+
], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<ng-template #defaultFieldSetTemplate let-id=\"id\" let-controls=\"controls\" let-fieldSet=\"fieldSet\">\r\n <div [ngClass]=\"['form-fields', 'form-fields-' + id, fieldSet.classes]\">\r\n <ng-container [ngxTemplateOutlet]=\"setPrefixTemplates[fieldSet.id]\" [context]=\"fieldSet\"></ng-container>\r\n <div *ngIf=\"fieldSet.title\" [ngClass]=\"['form-title', fieldSet.titleClasses || '']\">\r\n {{ group.prefix + fieldSet.title | translate }}\r\n </div>\r\n <ng-template #subControls>\r\n <ng-container *ngFor=\"let control of controls\" [form-group]=\"control\" [visible]=\"control.visible\">\r\n\r\n </ng-container>\r\n </ng-template>\r\n <div *ngIf=\"fieldSet.setClasses; else subControls\" [ngClass]=\"fieldSet.setClasses\">\r\n <div *ngIf=\"fieldSet.controlClasses; else subControls\" [ngClass]=\"fieldSet.controlClasses\">\r\n <ng-container [ngTemplateOutlet]=\"subControls\"></ng-container>\r\n </div>\r\n </div>\r\n <ng-container [ngxTemplateOutlet]=\"setSuffixTemplates[fieldSet.id]\" [context]=\"fieldSet\"></ng-container>\r\n </div>\r\n</ng-template>\r\n\r\n<ng-template #fieldSetsTemplate>\r\n <ng-container *ngFor=\"let fs of formControls | groupBy:'data.fieldSet'\"\r\n [ngxTemplateOutlet]=\"fieldSetTemplate || defaultFieldSetTemplate\"\r\n [context]=\"{form: this, id: fs.group, controls: fs.items, fieldSet: group.formFields[fs.group] || defaultFieldSet}\">\r\n </ng-container>\r\n</ng-template>\r\n<ng-template #defaultWrapperTemplate let-form=\"form\" let-fieldSetsTemplate=\"fieldSetsTemplate\">\r\n <ng-container [ngTemplateOutlet]=\"prefixTemplate\"\r\n [ngTemplateOutletContext]=\"{form: form, fieldSetsTemplate: fieldSetsTemplate}\"></ng-container>\r\n <form class=\"dynamic-form\" [ngClass]=\"form.classes || ''\" [formGroup]=\"group\" (submit)=\"onFormSubmit()\">\r\n <ng-container [ngTemplateOutlet]=\"fieldSetsTemplate\"></ng-container>\r\n <ng-content></ng-content>\r\n <div *ngIf=\"form.status == 'PENDING'\" class=\"dynamic-form-validator\">\r\n {{ group.prefix + 'message.pending' | translate }}\r\n </div>\r\n <button [ngStyle]=\"{display: 'none'}\">Submit</button>\r\n </form>\r\n <ng-container [ngTemplateOutlet]=\"suffixTemplate\"\r\n [ngTemplateOutletContext]=\"{form: form, fieldSetsTemplate: fieldSetsTemplate}\"></ng-container>\r\n</ng-template>\r\n<ng-template #loadingTemplate>\r\n <div *ngIf=\"status == 'LOADING'\" class=\"dynamic-form-loader\">\r\n {{ group.prefix + 'message.loading' | translate }}\r\n </div>\r\n</ng-template>\r\n<ng-container [ngTemplateOutlet]=\"wrapperTemplate || defaultWrapperTemplate\"\r\n [ngTemplateOutletContext]=\"{form: this, fieldSetsTemplate: fieldSetsTemplate}\"\r\n *ngIf=\"status !== 'LOADING'; else loadingTemplate\">\r\n</ng-container>\r\n", directives: [{ type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i3.NgxTemplateOutletDirective, selector: "[ngxTemplateOutlet]", inputs: ["context", "additionalContext", "ngxTemplateOutlet"] }, { type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: DynamicFormGroupDirective, selector: "[form-group]", inputs: ["form-group", "visible"] }, { type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i2$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i2$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i2$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }], pipes: { "translate": i3.TranslatePipe, "groupBy": i3.GroupByPipe }, encapsulation: i0.ViewEncapsulation.None });
|
|
1314
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: DynamicFormComponent, decorators: [{
|
|
1315
|
+
type: Component,
|
|
1316
|
+
args: [{
|
|
1317
|
+
encapsulation: ViewEncapsulation.None,
|
|
1318
|
+
selector: "dynamic-form, [dynamic-form]",
|
|
1319
|
+
templateUrl: "./dynamic-form.component.html",
|
|
1320
|
+
providers: [
|
|
1321
|
+
{
|
|
1322
|
+
provide: DynamicFormBaseComponent,
|
|
1323
|
+
useExisting: DynamicFormComponent
|
|
1324
|
+
},
|
|
1325
|
+
{
|
|
1326
|
+
provide: DYNAMIC_FORM,
|
|
1327
|
+
useExisting: DynamicFormComponent
|
|
1328
|
+
}
|
|
1329
|
+
]
|
|
1330
|
+
}]
|
|
1331
|
+
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: DynamicFormService }]; }, propDecorators: { group: [{
|
|
1332
|
+
type: Input
|
|
1333
|
+
}], controls: [{
|
|
1334
|
+
type: Input
|
|
1335
|
+
}], serializers: [{
|
|
1336
|
+
type: Input
|
|
1337
|
+
}], fieldSets: [{
|
|
1338
|
+
type: Input
|
|
1339
|
+
}], data: [{
|
|
1340
|
+
type: Input
|
|
1341
|
+
}] } });
|
|
1260
1342
|
|
|
1261
1343
|
const statusPriority = ["LOADING", "PENDING", "DISABLED", "INVALID"];
|
|
1262
1344
|
class DynamicFormsComponent extends DynamicFormBaseComponent {
|
|
@@ -1364,37 +1446,53 @@ class DynamicFormsComponent extends DynamicFormBaseComponent {
|
|
|
1364
1446
|
});
|
|
1365
1447
|
}
|
|
1366
1448
|
}
|
|
1367
|
-
DynamicFormsComponent
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
{
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
}
|
|
1449
|
+
DynamicFormsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: DynamicFormsComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: DynamicFormService }], target: i0.ɵɵFactoryTarget.Component });
|
|
1450
|
+
DynamicFormsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: DynamicFormsComponent, selector: "dynamic-forms, [dynamic-forms]", inputs: { data: "data", containerTemplate: "containerTemplate", formPrefixTemplates: "formPrefixTemplates", formSuffixTemplates: "formSuffixTemplates", innerFormPrefixTemplates: "innerFormPrefixTemplates", innerFormSuffixTemplates: "innerFormSuffixTemplates" }, providers: [
|
|
1451
|
+
{
|
|
1452
|
+
provide: DynamicFormBaseComponent,
|
|
1453
|
+
useExisting: DynamicFormsComponent
|
|
1454
|
+
},
|
|
1455
|
+
{
|
|
1456
|
+
provide: DYNAMIC_FORM,
|
|
1457
|
+
useExisting: DynamicFormsComponent
|
|
1458
|
+
}
|
|
1459
|
+
], queries: [{ propertyName: "cContainerTemplate", first: true, predicate: ["containerTemplate"], descendants: true }], viewQueries: [{ propertyName: "forms", predicate: DynamicFormBaseComponent, descendants: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<ng-template #configTemplate let-formTemplate=\"formTemplate\" let-form=\"form\" let-config=\"config\" let-configTemplate>\r\n <div [ngClass]=\"config.classes || ''\">\r\n <ng-container [ngTemplateOutlet]=\"formPrefixTemplates[config.id]\"\r\n [ngTemplateOutletContext]=\"{config: config, form: form}\"></ng-container>\r\n <ng-template #singleFormTemplate>\r\n <div dynamic-form\r\n [hidden]=\"!config.group?.visible\"\r\n [ngClass]=\"config.formClasses || ''\"\r\n [name]=\"config.name || form.name\"\r\n [testId]=\"testId + '-' + (config.testId || config.name || name)\"\r\n [readonly]=\"form.readonly\"\r\n [updateOn]=\"form.updateOn\"\r\n [classes]=\"config.innerFormClasses\"\r\n [parent]=\"form\"\r\n\r\n [wrapperTemplate]=\"form.wrapperTemplate\"\r\n [fieldSetTemplate]=\"form.fieldSetTemplate\"\r\n [controlTemplates]=\"form.controlTemplates\"\r\n\r\n [controlTemplate]=\"form.controlTemplate\"\r\n [labelTemplates]=\"form.labelTemplates\"\r\n [inputTemplates]=\"form.inputTemplates\"\r\n [prefixTemplates]=\"form.prefixTemplates\"\r\n [suffixTemplates]=\"form.suffixTemplates\"\r\n [setPrefixTemplates]=\"form.setPrefixTemplates\"\r\n [setSuffixTemplates]=\"form.setSuffixTemplates\"\r\n\r\n [group]=\"config.group\"\r\n [fieldSets]=\"config.fieldSets\">\r\n <ng-template #prefixTemplate let-subForm=\"form\">\r\n <ng-container [ngTemplateOutlet]=\"form.innerFormPrefixTemplates[config.id]\"\r\n [ngTemplateOutletContext]=\"{config: config, form: subForm}\"></ng-container>\r\n </ng-template>\r\n <ng-template #suffixTemplate let-subForm=\"form\">\r\n <ng-container [ngTemplateOutlet]=\"form.innerFormSuffixTemplates[config.id]\"\r\n [ngTemplateOutletContext]=\"{config: config, form: subForm}\"></ng-container>\r\n </ng-template>\r\n </div>\r\n </ng-template>\r\n <div dynamic-forms\r\n [ngClass]=\"config.formClasses || ''\"\r\n [name]=\"config.name || name\"\r\n [testId]=\"testId + '-' + (config.testId || config.name || name)\"\r\n [readonly]=\"form.readonly\"\r\n [updateOn]=\"form.updateOn\"\r\n [classes]=\"config.innerFormClasses\"\r\n [parent]=\"form\"\r\n\r\n [wrapperTemplate]=\"form.wrapperTemplate\"\r\n [fieldSetTemplate]=\"form.fieldSetTemplate\"\r\n [controlTemplates]=\"form.controlTemplates\"\r\n\r\n [controlTemplate]=\"form.controlTemplate\"\r\n [labelTemplates]=\"form.labelTemplates\"\r\n [inputTemplates]=\"form.inputTemplates\"\r\n [prefixTemplates]=\"form.prefixTemplates\"\r\n [suffixTemplates]=\"form.suffixTemplates\"\r\n [setPrefixTemplates]=\"form.setPrefixTemplates\"\r\n [setSuffixTemplates]=\"form.setSuffixTemplates\"\r\n\r\n [data]=\"config.data\"\r\n [containerTemplate]=\"form.containerTemplate\"\r\n [formPrefixTemplates]=\"form.formPrefixTemplates\"\r\n [formSuffixTemplates]=\"form.formSuffixTemplates\"\r\n [innerFormPrefixTemplates]=\"form.innerFormPrefixTemplates\"\r\n [innerFormSuffixTemplates]=\"form.innerFormSuffixTemplates\"\r\n\r\n *ngIf=\"config.multi; else singleFormTemplate\">\r\n <ng-template #prefixTemplate let-subForm=\"form\">\r\n <ng-container [ngTemplateOutlet]=\"form.innerFormPrefixTemplates[config.id]\"\r\n [ngTemplateOutletContext]=\"{config: config, form: subForm}\"></ng-container>\r\n </ng-template>\r\n <ng-template #suffixTemplate let-subForm=\"form\">\r\n <ng-container [ngTemplateOutlet]=\"form.innerFormSuffixTemplates[config.id]\"\r\n [ngTemplateOutletContext]=\"{config: config, form: subForm}\"></ng-container>\r\n </ng-template>\r\n </div>\r\n <ng-container [ngTemplateOutlet]=\"formSuffixTemplates[config.id]\"\r\n [ngTemplateOutletContext]=\"{config: config, form: form}\"></ng-container>\r\n </div>\r\n</ng-template>\r\n<ng-template let-form=\"form\" let-configTemplate=\"configTemplate\" #defaultContainerTemplate>\r\n <div class=\"dynamic-forms\" [ngClass]=\"classes || ''\">\r\n <ng-container *ngFor=\"let config of form.configs\"\r\n [ngTemplateOutlet]=\"configTemplate\"\r\n [ngTemplateOutletContext]=\"{form: form, config: config}\"></ng-container>\r\n <ng-content></ng-content>\r\n </div>\r\n</ng-template>\r\n<ng-container [ngTemplateOutlet]=\"prefixTemplate\"\r\n [ngTemplateOutletContext]=\"{form: this}\"></ng-container>\r\n<ng-container [ngTemplateOutlet]=\"containerTemplate || defaultContainerTemplate\"\r\n [ngTemplateOutletContext]=\"{form: this, configTemplate: configTemplate, defaultContainerTemplate: defaultContainerTemplate}\">\r\n</ng-container>\r\n<ng-container [ngTemplateOutlet]=\"suffixTemplate\"\r\n [ngTemplateOutletContext]=\"{form: this}\"></ng-container>\r\n", components: [{ type: DynamicFormComponent, selector: "dynamic-form, [dynamic-form]", inputs: ["group", "controls", "serializers", "fieldSets", "data"] }, { type: DynamicFormsComponent, selector: "dynamic-forms, [dynamic-forms]", inputs: ["data", "containerTemplate", "formPrefixTemplates", "formSuffixTemplates", "innerFormPrefixTemplates", "innerFormSuffixTemplates"] }], directives: [{ type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], encapsulation: i0.ViewEncapsulation.None });
|
|
1460
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: DynamicFormsComponent, decorators: [{
|
|
1461
|
+
type: Component,
|
|
1462
|
+
args: [{
|
|
1463
|
+
encapsulation: ViewEncapsulation.None,
|
|
1464
|
+
selector: "dynamic-forms, [dynamic-forms]",
|
|
1465
|
+
templateUrl: "./dynamic-forms.component.html",
|
|
1466
|
+
providers: [
|
|
1467
|
+
{
|
|
1468
|
+
provide: DynamicFormBaseComponent,
|
|
1469
|
+
useExisting: DynamicFormsComponent
|
|
1470
|
+
},
|
|
1471
|
+
{
|
|
1472
|
+
provide: DYNAMIC_FORM,
|
|
1473
|
+
useExisting: DynamicFormsComponent
|
|
1474
|
+
}
|
|
1475
|
+
]
|
|
1476
|
+
}]
|
|
1477
|
+
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: DynamicFormService }]; }, propDecorators: { data: [{
|
|
1478
|
+
type: Input
|
|
1479
|
+
}], containerTemplate: [{
|
|
1480
|
+
type: Input
|
|
1481
|
+
}], formPrefixTemplates: [{
|
|
1482
|
+
type: Input
|
|
1483
|
+
}], formSuffixTemplates: [{
|
|
1484
|
+
type: Input
|
|
1485
|
+
}], innerFormPrefixTemplates: [{
|
|
1486
|
+
type: Input
|
|
1487
|
+
}], innerFormSuffixTemplates: [{
|
|
1488
|
+
type: Input
|
|
1489
|
+
}], cContainerTemplate: [{
|
|
1490
|
+
type: ContentChild,
|
|
1491
|
+
args: ["containerTemplate"]
|
|
1492
|
+
}], forms: [{
|
|
1493
|
+
type: ViewChildren,
|
|
1494
|
+
args: [DynamicFormBaseComponent]
|
|
1495
|
+
}] } });
|
|
1398
1496
|
|
|
1399
1497
|
class DynamicFormGroupComponent {
|
|
1400
1498
|
constructor(form) {
|
|
@@ -1406,19 +1504,22 @@ class DynamicFormGroupComponent {
|
|
|
1406
1504
|
return ["form-group", "form-group-" + this.control.id, this.control.data.classes, this.control.errors && this.control.touched ? "form-group-invalid" : ""].join(" ");
|
|
1407
1505
|
}
|
|
1408
1506
|
}
|
|
1409
|
-
DynamicFormGroupComponent
|
|
1410
|
-
{ type:
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
]
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
]
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
};
|
|
1507
|
+
DynamicFormGroupComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: DynamicFormGroupComponent, deps: [{ token: DYNAMIC_FORM }], target: i0.ɵɵFactoryTarget.Component });
|
|
1508
|
+
DynamicFormGroupComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: DynamicFormGroupComponent, selector: "div[dynamic-form-group]", host: { properties: { "class": "this.classes" } }, ngImport: i0, template: "<ng-template #labelTemplate>\r\n <label [ngClass]=\"'control-label control-label-' + control.data.labelAlign\" [attr.for]=\"control.formId\">\r\n {{ control.label | translate: control.model }}\r\n </label>\r\n</ng-template>\r\n<ng-template #errorTemplate>\r\n <div class=\"error-message\" *ngIf=\"control.errors && control.touched\">\r\n <span class=\"help-block\" *ngFor=\"let error of control.errors | entries\">\r\n {{ error.key | translate: error.value }}\r\n </span>\r\n </div>\r\n</ng-template>\r\n<ng-template #inputTemplate let-control=\"control\">\r\n <ng-container [form-control]=\"control\"></ng-container>\r\n</ng-template>\r\n<ng-template #defaultControlTemplate\r\n let-context\r\n let-control=\"control\"\r\n let-data=\"control.data\"\r\n let-labelTemplate=\"labelTemplate\"\r\n let-inputTemplate=\"inputTemplate\"\r\n let-prefixTemplate=\"prefixTemplate\"\r\n let-suffixTemplate=\"suffixTemplate\"\r\n let-errorTemplate=\"errorTemplate\">\r\n <ng-container [ngTemplateOutlet]=\"prefixTemplate\"\r\n [ngTemplateOutletContext]=\"context\"></ng-container>\r\n <ng-container *ngIf=\"control.label && data.labelAlign == 'left'\"\r\n [ngTemplateOutlet]=\"labelTemplate\"\r\n [ngTemplateOutletContext]=\"context\">\r\n </ng-container>\r\n <ng-container [ngTemplateOutlet]=\"inputTemplate\"\r\n [ngTemplateOutletContext]=\"context\"></ng-container>\r\n <ng-container *ngIf=\"control.label && data.labelAlign == 'right'\"\r\n [ngTemplateOutlet]=\"labelTemplate\"\r\n [ngTemplateOutletContext]=\"context\">\r\n </ng-container>\r\n <ng-container [ngTemplateOutlet]=\"suffixTemplate\"\r\n [ngTemplateOutletContext]=\"context\"></ng-container>\r\n <ng-container [ngTemplateOutlet]=\"errorTemplate\"\r\n [ngTemplateOutletContext]=\"context\"></ng-container>\r\n</ng-template>\r\n\r\n<ng-container [ngxTemplateOutlet]=\"form.controlTemplates[control.id] || form.controlTemplate || defaultControlTemplate\"\r\n [context]=\"{\r\n control: control,\r\n labelTemplate: form.labelTemplates[control.id] || labelTemplate,\r\n inputTemplate: form.inputTemplates[control.id] || inputTemplate,\r\n prefixTemplate: form.prefixTemplates[control.id],\r\n suffixTemplate: form.suffixTemplates[control.id],\r\n errorTemplate: errorTemplate\r\n }\">\r\n</ng-container>\r\n", directives: [{ type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: DynamicFormControlDirective, selector: "[form-control]", inputs: ["form-control"] }, { type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i3.NgxTemplateOutletDirective, selector: "[ngxTemplateOutlet]", inputs: ["context", "additionalContext", "ngxTemplateOutlet"] }], pipes: { "translate": i3.TranslatePipe, "entries": i3.EntriesPipe }, encapsulation: i0.ViewEncapsulation.None });
|
|
1509
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: DynamicFormGroupComponent, decorators: [{
|
|
1510
|
+
type: Component,
|
|
1511
|
+
args: [{
|
|
1512
|
+
encapsulation: ViewEncapsulation.None,
|
|
1513
|
+
selector: "div[dynamic-form-group]",
|
|
1514
|
+
templateUrl: "./dynamic-form-group.component.html"
|
|
1515
|
+
}]
|
|
1516
|
+
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
1517
|
+
type: Inject,
|
|
1518
|
+
args: [DYNAMIC_FORM]
|
|
1519
|
+
}] }]; }, propDecorators: { classes: [{
|
|
1520
|
+
type: HostBinding,
|
|
1521
|
+
args: ["class"]
|
|
1522
|
+
}] } });
|
|
1422
1523
|
|
|
1423
1524
|
class DynamicFormFileComponent extends FormControlComponent {
|
|
1424
1525
|
// Acceptor for provider
|
|
@@ -1514,13 +1615,16 @@ class DynamicFormFileComponent extends FormControlComponent {
|
|
|
1514
1615
|
return this.api.url(`${this.data.baseUrl}${url}`);
|
|
1515
1616
|
}
|
|
1516
1617
|
}
|
|
1517
|
-
DynamicFormFileComponent
|
|
1518
|
-
{ type:
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
]
|
|
1618
|
+
DynamicFormFileComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: DynamicFormFileComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
1619
|
+
DynamicFormFileComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: DynamicFormFileComponent, selector: "dynamic-form-file", usesInheritance: true, ngImport: i0, template: "<div class=\"upload\">\r\n <input type=\"file\"\r\n multiple=\"multiple\"\r\n [attr.data-testid]=\"testId\"\r\n [attr.accept]=\"data.accept\"\r\n (change)=\"onSelect($event.target)\" />\r\n <ul class=\"images\" *ngIf=\"!data.multi\">\r\n <li class=\"image\" *ngIf=\"value\" [ngStyle]=\"{backgroundImage: getUrl(value)}\">\r\n <a class=\"btn btn-delete\" (click)=\"delete()\"></a>\r\n </li>\r\n </ul>\r\n <ul class=\"images\" *ngIf=\"data.multi\">\r\n <li class=\"image\" *ngFor=\"let image of value; let i = index\" [ngStyle]=\"{backgroundImage: getUrl(image)}\">\r\n <a class=\"btn btn-delete\" (click)=\"delete(i)\"></a>\r\n </li>\r\n </ul>\r\n</div>\r\n", styles: [".upload{display:inline-block}.upload ul{display:inline-flex;list-style:none;margin:10px 0 0;padding:0}.upload ul li{height:100px;width:100px;background:repeating-linear-gradient(45deg,gray,gray 10px,lightgray 10px,lightgray 20px) center center;background-size:cover;border:1px gray solid;margin-right:5px;position:relative}.upload .btn-delete{background:linear-gradient(to bottom,#c8607a,#a64d5a);border-color:#a64d5a;color:#fff;position:absolute;padding:0;right:5px;top:5px;width:20px;height:20px}.upload .btn-delete:before{color:#fff;display:block;position:absolute;top:0;right:6px;content:\"x\"}\n"], directives: [{ type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
|
|
1620
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: DynamicFormFileComponent, decorators: [{
|
|
1621
|
+
type: Component,
|
|
1622
|
+
args: [{
|
|
1623
|
+
selector: "dynamic-form-file",
|
|
1624
|
+
styleUrls: ["./dynamic-form-file.component.scss"],
|
|
1625
|
+
templateUrl: "./dynamic-form-file.component.html"
|
|
1626
|
+
}]
|
|
1627
|
+
}] });
|
|
1524
1628
|
|
|
1525
1629
|
class DynamicFormInputComponent extends FormControlComponent {
|
|
1526
1630
|
// Acceptor for provider
|
|
@@ -1570,16 +1674,19 @@ class DynamicFormInputComponent extends FormControlComponent {
|
|
|
1570
1674
|
this.control.onBlur();
|
|
1571
1675
|
}
|
|
1572
1676
|
}
|
|
1573
|
-
DynamicFormInputComponent
|
|
1574
|
-
{ type:
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
}
|
|
1677
|
+
DynamicFormInputComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: DynamicFormInputComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
1678
|
+
DynamicFormInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: DynamicFormInputComponent, selector: "dynamic-form-input", host: { properties: { "class.checked": "this.isChecked" } }, usesInheritance: true, ngImport: i0, template: "<ng-container [ngSwitch]=\"data.type\">\r\n <ng-container *ngSwitchCase=\"'textarea'\">\r\n <textarea class=\"form-control\"\r\n rows=\"5\"\r\n [attr.autocomplete]=\"data.autocomplete\"\r\n [attr.data-testid]=\"testId\"\r\n [id]=\"control.formId\"\r\n [name]=\"control.formId\"\r\n [ngClass]=\"{disabled: control.disabled}\"\r\n [disabled]=\"control.disabled\"\r\n [ngModel]=\"value\"\r\n (ngModelChange)=\"control.setValue($event)\"\r\n (blur)=\"control.onBlur()\"\r\n (focus)=\"control.onFocus()\">{{ data.placeholder | translate }}</textarea>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'date'\">\r\n <input class=\"form-control\"\r\n type=\"date\"\r\n [attr.autocomplete]=\"data.autocomplete\"\r\n [attr.data-testid]=\"testId\"\r\n [id]=\"control.formId\"\r\n [name]=\"control.formId\"\r\n [ngClass]=\"{disabled: control.disabled}\"\r\n [disabled]=\"control.disabled\"\r\n [ngModel]=\"value | date: 'y-MM-dd'\"\r\n (ngModelChange)=\"onDateChange($event)\"\r\n (blur)=\"control.onBlur()\"\r\n (focus)=\"control.onFocus()\"/>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'number'\">\r\n <input class=\"form-control\"\r\n type=\"number\"\r\n [attr.autocomplete]=\"data.autocomplete\"\r\n [attr.data-testid]=\"testId\"\r\n [min]=\"data.min\"\r\n [max]=\"data.max\"\r\n [step]=\"data.step\"\r\n [id]=\"control.formId\"\r\n [name]=\"control.formId\"\r\n [ngClass]=\"{disabled: control.disabled}\"\r\n [disabled]=\"control.disabled\"\r\n [ngModel]=\"value\"\r\n (ngModelChange)=\"control.setValue($event)\"\r\n (blur)=\"onNumberBlur()\"\r\n (focus)=\"control.onFocus()\"/>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'checkbox'\">\r\n <input class=\"form-control\"\r\n type=\"checkbox\"\r\n [attr.data-testid]=\"testId\"\r\n [id]=\"control.formId\"\r\n [name]=\"control.formId\"\r\n [ngClass]=\"{disabled: control.disabled}\"\r\n [disabled]=\"control.disabled\"\r\n [ngModel]=\"value\"\r\n (ngModelChange)=\"control.setValue($event)\"\r\n (blur)=\"control.onBlur()\"\r\n (focus)=\"control.onFocus()\"/>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'text'\">\r\n <input class=\"form-control\"\r\n type=\"text\"\r\n [attr.autocomplete]=\"data.autocomplete\"\r\n [attr.data-testid]=\"testId\"\r\n [minlength]=\"data.min\"\r\n [maxlength]=\"data.max\"\r\n [placeholder]=\"data.placeholder | translate\"\r\n [id]=\"control.formId\"\r\n [name]=\"control.formId\"\r\n [ngClass]=\"{disabled: control.disabled}\"\r\n [disabled]=\"control.disabled\"\r\n [ngModel]=\"data.useLanguage ? (value | translate) : value\"\r\n (ngModelChange)=\"onTextChange($event)\"\r\n (blur)=\"control.onBlur()\"\r\n (focus)=\"control.onFocus()\"/>\r\n </ng-container>\r\n <ng-container *ngSwitchDefault>\r\n <input class=\"form-control\"\r\n [attr.autocomplete]=\"data.autocomplete\"\r\n [attr.data-testid]=\"testId\"\r\n [minlength]=\"data.min\"\r\n [maxlength]=\"data.max\"\r\n [placeholder]=\"data.placeholder | translate\"\r\n [type]=\"data.type\"\r\n [id]=\"control.formId\"\r\n [name]=\"control.formId\"\r\n [ngClass]=\"{disabled: control.disabled}\"\r\n [disabled]=\"control.disabled\"\r\n [ngModel]=\"value\"\r\n (ngModelChange)=\"control.setValue($event)\"\r\n (blur)=\"control.onBlur()\"\r\n (focus)=\"control.onFocus()\"/>\r\n </ng-container>\r\n</ng-container>\r\n", directives: [{ type: i2.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i2.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i2$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i2$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i2$1.MinValidator, selector: "input[type=number][min][formControlName],input[type=number][min][formControl],input[type=number][min][ngModel]", inputs: ["min"] }, { type: i2$1.MaxValidator, selector: "input[type=number][max][formControlName],input[type=number][max][formControl],input[type=number][max][ngModel]", inputs: ["max"] }, { type: i2$1.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { type: i2$1.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { type: i2$1.MinLengthValidator, selector: "[minlength][formControlName],[minlength][formControl],[minlength][ngModel]", inputs: ["minlength"] }, { type: i2$1.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { type: i2.NgSwitchDefault, selector: "[ngSwitchDefault]" }], pipes: { "translate": i3.TranslatePipe, "date": i2.DatePipe }, encapsulation: i0.ViewEncapsulation.None });
|
|
1679
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: DynamicFormInputComponent, decorators: [{
|
|
1680
|
+
type: Component,
|
|
1681
|
+
args: [{
|
|
1682
|
+
encapsulation: ViewEncapsulation.None,
|
|
1683
|
+
selector: "dynamic-form-input",
|
|
1684
|
+
templateUrl: "./dynamic-form-input.component.html"
|
|
1685
|
+
}]
|
|
1686
|
+
}], propDecorators: { isChecked: [{
|
|
1687
|
+
type: HostBinding,
|
|
1688
|
+
args: ["class.checked"]
|
|
1689
|
+
}] } });
|
|
1583
1690
|
|
|
1584
1691
|
class DynamicFormSelectComponent extends FormControlComponent {
|
|
1585
1692
|
// Acceptor for provider
|
|
@@ -1643,13 +1750,16 @@ class DynamicFormSelectComponent extends FormControlComponent {
|
|
|
1643
1750
|
return option.id == id;
|
|
1644
1751
|
}
|
|
1645
1752
|
}
|
|
1646
|
-
DynamicFormSelectComponent
|
|
1647
|
-
{ type:
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1753
|
+
DynamicFormSelectComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: DynamicFormSelectComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
1754
|
+
DynamicFormSelectComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: DynamicFormSelectComponent, selector: "dynamic-form-select", usesInheritance: true, ngImport: i0, template: "<ng-template #selectTemplate let-selected=\"selected\">\r\n <select class=\"form-control\"\r\n [attr.data-testid]=\"testId\"\r\n [multiple]=\"data.multi\"\r\n [id]=\"control.formId\"\r\n [name]=\"control.formId\"\r\n [ngClass]=\"{disabled: control.disabled}\"\r\n [disabled]=\"control.disabled\"\r\n [ngModel]=\"data.multi ? value : [value]\"\r\n (ngModelChange)=\"onSelectChange($event)\"\r\n (blur)=\"control.onBlur()\"\r\n (focus)=\"control.onFocus()\">\r\n <option *ngFor=\"let option of meta.options\" [value]=\"option.id\" [disabled]=\"option.selectable == false\">\r\n {{ option.label | translate }}\r\n </option>\r\n </select>\r\n <label class=\"form-control-description\" [attr.for]=\"control.formId\" *ngIf=\"!data.multi && selected?.description\">\r\n {{ selected?.description | translate }}\r\n </label>\r\n</ng-template>\r\n<ng-container [ngSwitch]=\"data.type\">\r\n <ng-container *ngSwitchCase=\"'radio'\">\r\n <ul class=\"radio-group\">\r\n <li *ngFor=\"let option of meta.options\" class=\"radio\">\r\n <label [ngClass]=\"{checked: value == option.id}\">\r\n <input type=\"radio\"\r\n [attr.data-testid]=\"testId + '-' + option.id\"\r\n [id]=\"control.formId + '-' + option.id\"\r\n [name]=\"control.formId + '-' + option.id\"\r\n [ngClass]=\"{disabled: control.disabled}\"\r\n [disabled]=\"control.disabled || option.selectable == false\"\r\n [value]=\"option.id\"\r\n [ngModel]=\"value\"\r\n (ngModelChange)=\"onSelectChange(option.id)\"\r\n (blur)=\"control.onBlur()\"\r\n (focus)=\"control.onFocus()\">\r\n {{ option.label | translate }}\r\n </label>\r\n </li>\r\n </ul>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"'checkbox'\">\r\n <ul class=\"checkbox-group\">\r\n <li *ngFor=\"let option of meta.options\" class=\"checkbox\">\r\n <label [ngClass]=\"{checked: checkValue(option)}\">\r\n <input type=\"checkbox\"\r\n [attr.data-testid]=\"testId + '-' + option.id\"\r\n [id]=\"control.formId + '-' + option.id\"\r\n [name]=\"control.formId + '-' + option.id\"\r\n [ngClass]=\"{disabled: control.disabled}\"\r\n [disabled]=\"control.disabled || option.selectable == false\"\r\n [ngModel]=\"checkValue(option)\"\r\n (ngModelChange)=\"onSelectChange(option.id)\"\r\n (blur)=\"control.onBlur()\"\r\n (focus)=\"control.onFocus()\">\r\n {{ option.label | translate }}\r\n </label>\r\n </li>\r\n </ul>\r\n </ng-container>\r\n <ng-container *ngSwitchDefault [ngTemplateOutlet]=\"selectTemplate\" [ngTemplateOutletContext]=\"{selected: meta?.options | find:findOption:value}\">\r\n\r\n </ng-container>\r\n</ng-container>\r\n", directives: [{ type: i2$1.SelectMultipleControlValueAccessor, selector: "select[multiple][formControlName],select[multiple][formControl],select[multiple][ngModel]", inputs: ["compareWith"] }, { type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i2$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i2$1.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i2$1.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i2.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i2$1.RadioControlValueAccessor, selector: "input[type=radio][formControlName],input[type=radio][formControl],input[type=radio][ngModel]", inputs: ["name", "formControlName", "value"] }, { type: i2$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i2$1.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { type: i2.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }], pipes: { "translate": i3.TranslatePipe, "find": i3.FindPipe }, encapsulation: i0.ViewEncapsulation.None });
|
|
1755
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: DynamicFormSelectComponent, decorators: [{
|
|
1756
|
+
type: Component,
|
|
1757
|
+
args: [{
|
|
1758
|
+
encapsulation: ViewEncapsulation.None,
|
|
1759
|
+
selector: "dynamic-form-select",
|
|
1760
|
+
templateUrl: "./dynamic-form-select.component.html"
|
|
1761
|
+
}]
|
|
1762
|
+
}] });
|
|
1653
1763
|
|
|
1654
1764
|
class DynamicFormStaticComponent extends FormControlComponent {
|
|
1655
1765
|
// Acceptor for provider
|
|
@@ -1661,13 +1771,16 @@ class DynamicFormStaticComponent extends FormControlComponent {
|
|
|
1661
1771
|
return Promise.resolve();
|
|
1662
1772
|
}
|
|
1663
1773
|
}
|
|
1664
|
-
DynamicFormStaticComponent
|
|
1665
|
-
{ type:
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1774
|
+
DynamicFormStaticComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: DynamicFormStaticComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
1775
|
+
DynamicFormStaticComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: DynamicFormStaticComponent, selector: "dynamic-form-static", usesInheritance: true, ngImport: i0, template: "<unordered-list [listStyle]=\"data.style\" [ngClass]=\"{disabled: control.disabled}\"\r\n [data]=\"!data.properties ? {value: value} : data.properties | remap: value\">\r\n <ng-template [type]=\"!data.properties ? 'key' : null\" selector=\"level == 0\" let-item=\"item\"></ng-template>\r\n <ng-template type=\"value\" selector=\"valueType == 'date'\" let-item=\"item\">\r\n {{ item.value | date }}\r\n </ng-template>\r\n</unordered-list>\r\n", components: [{ type: i3.UnorderedListComponent, selector: "unordered-list", inputs: ["keyPrefix", "listStyle", "path", "level", "templates", "data"] }], directives: [{ type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i3.UnorderedListTemplateDirective, selector: "ng-template[type][selector]", inputs: ["type", "selector"] }], pipes: { "remap": i3.RemapPipe, "date": i2.DatePipe }, encapsulation: i0.ViewEncapsulation.None });
|
|
1776
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: DynamicFormStaticComponent, decorators: [{
|
|
1777
|
+
type: Component,
|
|
1778
|
+
args: [{
|
|
1779
|
+
encapsulation: ViewEncapsulation.None,
|
|
1780
|
+
selector: "dynamic-form-static",
|
|
1781
|
+
templateUrl: "./dynamic-form-static.component.html"
|
|
1782
|
+
}]
|
|
1783
|
+
}] });
|
|
1671
1784
|
|
|
1672
1785
|
class DynamicFormModelComponent extends FormControlComponent {
|
|
1673
1786
|
// Acceptor for provider
|
|
@@ -1679,16 +1792,19 @@ class DynamicFormModelComponent extends FormControlComponent {
|
|
|
1679
1792
|
return Promise.resolve();
|
|
1680
1793
|
}
|
|
1681
1794
|
}
|
|
1682
|
-
DynamicFormModelComponent
|
|
1683
|
-
{ type:
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
}
|
|
1795
|
+
DynamicFormModelComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: DynamicFormModelComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
1796
|
+
DynamicFormModelComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: DynamicFormModelComponent, selector: "dynamic-form-model", viewQueries: [{ propertyName: "subForm", first: true, predicate: ["subForm"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<dynamic-form [testId]=\"form.testId + '-' + control.id\"\r\n [name]=\"data.name || form.name\"\r\n [group]=\"control\"\r\n [data]=\"value\"\r\n [updateOn]=\"control.updateOn\"\r\n [parent]=\"form\"\r\n\r\n [fieldSetTemplate]=\"form.fieldSetTemplate\"\r\n [controlTemplates]=\"form.controlTemplates\"\r\n\r\n [controlTemplate]=\"form.controlTemplate\"\r\n [labelTemplates]=\"form.labelTemplates\"\r\n [inputTemplates]=\"form.inputTemplates\"\r\n [prefixTemplates]=\"form.prefixTemplates\"\r\n [suffixTemplates]=\"form.suffixTemplates\"\r\n [setPrefixTemplates]=\"form.setPrefixTemplates\"\r\n [setSuffixTemplates]=\"form.setSuffixTemplates\"\r\n\r\n #subForm>\r\n <ng-template #wrapperTemplate let-form=\"form\" let-fieldSetsTemplate=\"fieldSetsTemplate\">\r\n <ng-container [ngTemplateOutlet]=\"fieldSetsTemplate\"></ng-container>\r\n </ng-template>\r\n</dynamic-form>\r\n", components: [{ type: DynamicFormComponent, selector: "dynamic-form, [dynamic-form]", inputs: ["group", "controls", "serializers", "fieldSets", "data"] }], directives: [{ type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }], encapsulation: i0.ViewEncapsulation.None });
|
|
1797
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: DynamicFormModelComponent, decorators: [{
|
|
1798
|
+
type: Component,
|
|
1799
|
+
args: [{
|
|
1800
|
+
encapsulation: ViewEncapsulation.None,
|
|
1801
|
+
selector: "dynamic-form-model",
|
|
1802
|
+
templateUrl: "./dynamic-form-model.component.html"
|
|
1803
|
+
}]
|
|
1804
|
+
}], propDecorators: { subForm: [{
|
|
1805
|
+
type: ViewChild,
|
|
1806
|
+
args: ["subForm"]
|
|
1807
|
+
}] } });
|
|
1692
1808
|
|
|
1693
1809
|
// --- Components ---
|
|
1694
1810
|
const components = [
|
|
@@ -1728,35 +1844,71 @@ class NgxDynamicFormModule {
|
|
|
1728
1844
|
};
|
|
1729
1845
|
}
|
|
1730
1846
|
}
|
|
1731
|
-
NgxDynamicFormModule
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1847
|
+
NgxDynamicFormModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: NgxDynamicFormModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1848
|
+
NgxDynamicFormModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: NgxDynamicFormModule, declarations: [DynamicFormsComponent,
|
|
1849
|
+
DynamicFormComponent,
|
|
1850
|
+
DynamicFormGroupComponent,
|
|
1851
|
+
DynamicFormFileComponent,
|
|
1852
|
+
DynamicFormInputComponent,
|
|
1853
|
+
DynamicFormSelectComponent,
|
|
1854
|
+
DynamicFormStaticComponent,
|
|
1855
|
+
DynamicFormModelComponent, AsyncSubmitDirective,
|
|
1856
|
+
DynamicFormControlDirective,
|
|
1857
|
+
DynamicFormGroupDirective,
|
|
1858
|
+
DynamicFormTemplateDirective], imports: [CommonModule,
|
|
1859
|
+
FormsModule,
|
|
1860
|
+
ReactiveFormsModule,
|
|
1861
|
+
NgxUtilsModule], exports: [DynamicFormsComponent,
|
|
1862
|
+
DynamicFormComponent,
|
|
1863
|
+
DynamicFormGroupComponent,
|
|
1864
|
+
DynamicFormFileComponent,
|
|
1865
|
+
DynamicFormInputComponent,
|
|
1866
|
+
DynamicFormSelectComponent,
|
|
1867
|
+
DynamicFormStaticComponent,
|
|
1868
|
+
DynamicFormModelComponent, AsyncSubmitDirective,
|
|
1869
|
+
DynamicFormControlDirective,
|
|
1870
|
+
DynamicFormGroupDirective,
|
|
1871
|
+
DynamicFormTemplateDirective, FormsModule,
|
|
1872
|
+
ReactiveFormsModule,
|
|
1873
|
+
NgxUtilsModule] });
|
|
1874
|
+
NgxDynamicFormModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: NgxDynamicFormModule, providers: pipes, imports: [[
|
|
1875
|
+
CommonModule,
|
|
1876
|
+
FormsModule,
|
|
1877
|
+
ReactiveFormsModule,
|
|
1878
|
+
NgxUtilsModule
|
|
1879
|
+
], FormsModule,
|
|
1880
|
+
ReactiveFormsModule,
|
|
1881
|
+
NgxUtilsModule] });
|
|
1882
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: NgxDynamicFormModule, decorators: [{
|
|
1883
|
+
type: NgModule,
|
|
1884
|
+
args: [{
|
|
1885
|
+
declarations: [
|
|
1886
|
+
...components,
|
|
1887
|
+
...directives,
|
|
1888
|
+
...pipes
|
|
1889
|
+
],
|
|
1890
|
+
imports: [
|
|
1891
|
+
CommonModule,
|
|
1892
|
+
FormsModule,
|
|
1893
|
+
ReactiveFormsModule,
|
|
1894
|
+
NgxUtilsModule
|
|
1895
|
+
],
|
|
1896
|
+
exports: [
|
|
1897
|
+
...components,
|
|
1898
|
+
...directives,
|
|
1899
|
+
...pipes,
|
|
1900
|
+
FormsModule,
|
|
1901
|
+
ReactiveFormsModule,
|
|
1902
|
+
NgxUtilsModule
|
|
1903
|
+
],
|
|
1904
|
+
entryComponents: components,
|
|
1905
|
+
providers: pipes
|
|
1906
|
+
}]
|
|
1907
|
+
}] });
|
|
1756
1908
|
|
|
1757
1909
|
/**
|
|
1758
1910
|
* Generated bundle index. Do not edit.
|
|
1759
1911
|
*/
|
|
1760
1912
|
|
|
1761
|
-
export { AsyncSubmitDirective, DYNAMIC_FORM, DynamicFormBaseComponent, DynamicFormComponent, DynamicFormControl, DynamicFormControlDirective, DynamicFormFileComponent, DynamicFormGroup, DynamicFormGroupComponent, DynamicFormGroupDirective, DynamicFormInputComponent, DynamicFormModelComponent, DynamicFormSelectComponent, DynamicFormService, DynamicFormStaticComponent, DynamicFormTemplateDirective, DynamicFormsComponent, FORM_CONTROL_PROVIDER, FormControlComponent, FormFieldSet, FormFile, FormInput, FormModel, FormSelect, FormSerializable, FormStatic, FormUtilities, NgxDynamicFormModule, OpenApiService, createFormControl, createFormInput, createFormModel, createFormSelect, createFormStatic, defaultSerializer, defineFormControl, getFormControl, getFormFieldSets, getFormSerializer, provideFormControl, provideFormGroup
|
|
1913
|
+
export { AsyncSubmitDirective, DYNAMIC_FORM, DynamicFormBaseComponent, DynamicFormComponent, DynamicFormControl, DynamicFormControlDirective, DynamicFormFileComponent, DynamicFormGroup, DynamicFormGroupComponent, DynamicFormGroupDirective, DynamicFormInputComponent, DynamicFormModelComponent, DynamicFormSelectComponent, DynamicFormService, DynamicFormStaticComponent, DynamicFormTemplateDirective, DynamicFormsComponent, FORM_CONTROL_PROVIDER, FormControlComponent, FormFieldSet, FormFile, FormInput, FormModel, FormSelect, FormSerializable, FormStatic, FormUtilities, NgxDynamicFormModule, OpenApiService, createFormControl, createFormInput, createFormModel, createFormSelect, createFormStatic, defaultSerializer, defineFormControl, getFormControl, getFormFieldSets, getFormSerializer, provideFormControl, provideFormGroup };
|
|
1762
1914
|
//# sourceMappingURL=stemy-ngx-dynamic-form.js.map
|