@valtimo/form-management 10.2.1 → 10.4.0
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-management-create/form-management-create.component.mjs +7 -4
- package/esm2020/lib/form-management-duplicate/form-management-duplicate.component.mjs +88 -0
- package/esm2020/lib/form-management-edit/form-management-edit.component.mjs +22 -11
- package/esm2020/lib/form-management.module.mjs +43 -5
- package/esm2020/lib/form-management.service.mjs +4 -1
- package/esm2020/lib/validators/no-duplicate-form.validator.mjs +7 -0
- package/fesm2015/valtimo-form-management.mjs +155 -20
- package/fesm2015/valtimo-form-management.mjs.map +1 -1
- package/fesm2020/valtimo-form-management.mjs +153 -20
- package/fesm2020/valtimo-form-management.mjs.map +1 -1
- package/lib/form-management-create/form-management-create.component.d.ts.map +1 -1
- package/lib/form-management-duplicate/form-management-duplicate.component.d.ts +25 -0
- package/lib/form-management-duplicate/form-management-duplicate.component.d.ts.map +1 -0
- package/lib/form-management-edit/form-management-edit.component.d.ts +5 -2
- package/lib/form-management-edit/form-management-edit.component.d.ts.map +1 -1
- package/lib/form-management.module.d.ts +10 -7
- package/lib/form-management.module.d.ts.map +1 -1
- package/lib/form-management.service.d.ts +1 -0
- package/lib/form-management.service.d.ts.map +1 -1
- package/lib/validators/no-duplicate-form.validator.d.ts +4 -0
- package/lib/validators/no-duplicate-form.validator.d.ts.map +1 -0
- package/package.json +1 -1
|
@@ -26,6 +26,9 @@ export class FormManagementService {
|
|
|
26
26
|
getFormDefinition(formDefinitionId) {
|
|
27
27
|
return this.http.get(`${this.valtimoApiConfig.endpointUri}v1/form-management/${formDefinitionId}`);
|
|
28
28
|
}
|
|
29
|
+
existsFormDefinition(formDefinitionName) {
|
|
30
|
+
return this.http.get(`${this.valtimoApiConfig.endpointUri}v1/form-management/exists/${formDefinitionName}`);
|
|
31
|
+
}
|
|
29
32
|
queryFormDefinitions(params) {
|
|
30
33
|
return this.http.get(`${this.valtimoApiConfig.endpointUri}v1/form-management`, {
|
|
31
34
|
observe: 'response',
|
|
@@ -50,4 +53,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
|
|
|
50
53
|
providedIn: 'root',
|
|
51
54
|
}]
|
|
52
55
|
}], ctorParameters: function () { return [{ type: i1.HttpClient }, { type: i2.ConfigService }]; } });
|
|
53
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
56
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZm9ybS1tYW5hZ2VtZW50LnNlcnZpY2UuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy92YWx0aW1vL2Zvcm0tbWFuYWdlbWVudC9zcmMvbGliL2Zvcm0tbWFuYWdlbWVudC5zZXJ2aWNlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOzs7Ozs7Ozs7Ozs7OztHQWNHO0FBRUgsT0FBTyxFQUFDLFVBQVUsRUFBQyxNQUFNLGVBQWUsQ0FBQzs7OztBQVN6QyxNQUFNLE9BQU8scUJBQXFCO0lBR2hDLFlBQW9CLElBQWdCLEVBQVUsYUFBNEI7UUFBdEQsU0FBSSxHQUFKLElBQUksQ0FBWTtRQUFVLGtCQUFhLEdBQWIsYUFBYSxDQUFlO1FBQ3hFLElBQUksQ0FBQyxnQkFBZ0IsR0FBRyxhQUFhLENBQUMsTUFBTSxDQUFDLFVBQVUsQ0FBQztJQUMxRCxDQUFDO0lBRUQsaUJBQWlCLENBQUMsZ0JBQXdCO1FBQ3hDLE9BQU8sSUFBSSxDQUFDLElBQUksQ0FBQyxHQUFHLENBQ2xCLEdBQUcsSUFBSSxDQUFDLGdCQUFnQixDQUFDLFdBQVcsc0JBQXNCLGdCQUFnQixFQUFFLENBQzdFLENBQUM7SUFDSixDQUFDO0lBRUQsb0JBQW9CLENBQUMsa0JBQTBCO1FBQz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pQ29uZmlnLmVuZHBvaW50VXJpfXYxL2Zvcm0tbWFuYWdlbWVudC8ke2Zvcm1EZWZpbml0aW9uSWR9YFxuICAgICk7XG4gIH1cbn1cbiJdfQ==
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { map } from 'rxjs';
|
|
2
|
+
export function noDuplicateFormValidator(formManagementService) {
|
|
3
|
+
return (control) => formManagementService
|
|
4
|
+
.existsFormDefinition(control.value.toString())
|
|
5
|
+
.pipe(map((result) => (result ? { duplicate: true } : null)));
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibm8tZHVwbGljYXRlLWZvcm0udmFsaWRhdG9yLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvdmFsdGltby9mb3JtLW1hbmFnZW1lbnQvc3JjL2xpYi92YWxpZGF0b3JzL25vLWR1cGxpY2F0ZS1mb3JtLnZhbGlkYXRvci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFFQSxPQUFPLEVBQUMsR0FBRyxFQUFhLE1BQU0sTUFBTSxDQUFDO0FBRXJDLE1BQU0sVUFBVSx3QkFBd0IsQ0FDdEMscUJBQTRDO0lBRTVDLE9BQU8sQ0FBQyxPQUF3QixFQUFnQyxFQUFFLENBQ2hFLHFCQUFxQjtTQUNsQixvQkFBb0IsQ0FBQyxPQUFPLENBQUMsS0FBSyxDQUFDLFFBQVEsRUFBRSxDQUFDO1NBQzlDLElBQUksQ0FBQyxHQUFHLENBQUMsQ0FBQyxNQUFlLEVBQUUsRUFBRSxDQUFDLENBQUMsTUFBTSxDQUFDLENBQUMsQ0FBQyxFQUFDLFNBQVMsRUFBRSxJQUFJLEVBQUMsQ0FBQyxDQUFDLENBQUMsSUFBSSxDQUFDLENBQUMsQ0FBQyxDQUFDO0FBQzNFLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQge0Zvcm1NYW5hZ2VtZW50U2VydmljZX0gZnJvbSAnLi4vZm9ybS1tYW5hZ2VtZW50LnNlcnZpY2UnO1xuaW1wb3J0IHtBYnN0cmFjdENvbnRyb2wsIEFzeW5jVmFsaWRhdG9yRm4sIFZhbGlkYXRpb25FcnJvcnN9IGZyb20gJ0Bhbmd1bGFyL2Zvcm1zJztcbmltcG9ydCB7bWFwLCBPYnNlcnZhYmxlfSBmcm9tICdyeGpzJztcblxuZXhwb3J0IGZ1bmN0aW9uIG5vRHVwbGljYXRlRm9ybVZhbGlkYXRvcihcbiAgZm9ybU1hbmFnZW1lbnRTZXJ2aWNlOiBGb3JtTWFuYWdlbWVudFNlcnZpY2Vcbik6IEFzeW5jVmFsaWRhdG9yRm4ge1xuICByZXR1cm4gKGNvbnRyb2w6IEFic3RyYWN0Q29udHJvbCk6IE9ic2VydmFibGU8VmFsaWRhdGlvbkVycm9ycz4gPT5cbiAgICBmb3JtTWFuYWdlbWVudFNlcnZpY2VcbiAgICAgIC5leGlzdHNGb3JtRGVmaW5pdGlvbihjb250cm9sLnZhbHVlLnRvU3RyaW5nKCkpXG4gICAgICAucGlwZShtYXAoKHJlc3VsdDogYm9vbGVhbikgPT4gKHJlc3VsdCA/IHtkdXBsaWNhdGU6IHRydWV9IDogbnVsbCkpKTtcbn1cbiJdfQ==
|
|
@@ -1,22 +1,27 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Injectable, Component, EventEmitter, ViewChild, Input, Output, ViewEncapsulation, NgModule } from '@angular/core';
|
|
2
|
+
import { Injectable, Component, Inject, EventEmitter, ViewChild, Input, Output, ViewEncapsulation, NgModule } from '@angular/core';
|
|
3
3
|
import * as i1 from '@angular/common/http';
|
|
4
4
|
import * as i2 from '@valtimo/config';
|
|
5
5
|
import { ROLE_ADMIN } from '@valtimo/config';
|
|
6
6
|
import * as i3 from '@angular/router';
|
|
7
7
|
import { RouterModule } from '@angular/router';
|
|
8
8
|
import * as i4 from '@valtimo/components';
|
|
9
|
-
import { FormIoModule, WidgetModule, ListModule, DropzoneModule, ModalModule } from '@valtimo/components';
|
|
9
|
+
import { FormIoModule, WidgetModule, ListModule, DropzoneModule, ModalModule as ModalModule$2 } from '@valtimo/components';
|
|
10
10
|
import * as i2$1 from '@ngx-translate/core';
|
|
11
11
|
import { TranslateModule } from '@ngx-translate/core';
|
|
12
12
|
import { AuthGuardService } from '@valtimo/security';
|
|
13
13
|
import * as i2$2 from '@angular/forms';
|
|
14
|
-
import { FormControl, Validators, ReactiveFormsModule, FormsModule } from '@angular/forms';
|
|
15
|
-
import { combineLatest, Subject, BehaviorSubject, Subscription } from 'rxjs';
|
|
14
|
+
import { FormControl, Validators, FormGroup, ReactiveFormsModule, FormsModule } from '@angular/forms';
|
|
15
|
+
import { map, combineLatest, Subject, BehaviorSubject, Subscription } from 'rxjs';
|
|
16
16
|
import { take, first } from 'rxjs/operators';
|
|
17
17
|
import * as i5 from '@angular/common';
|
|
18
18
|
import { CommonModule } from '@angular/common';
|
|
19
|
-
import
|
|
19
|
+
import { BaseModal } from 'carbon-components-angular/modal';
|
|
20
|
+
import * as i1$1 from '@valtimo/user-interface';
|
|
21
|
+
import { ModalModule as ModalModule$1, InputModule, TitleModule, ButtonModule, FormModule } from '@valtimo/user-interface';
|
|
22
|
+
import * as i7 from 'carbon-components-angular';
|
|
23
|
+
import { ModalModule, InputModule as InputModule$1, PlaceholderModule, ButtonModule as ButtonModule$1 } from 'carbon-components-angular';
|
|
24
|
+
import * as i1$2 from '@valtimo/document';
|
|
20
25
|
import { NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap';
|
|
21
26
|
|
|
22
27
|
/*
|
|
@@ -43,6 +48,9 @@ class FormManagementService {
|
|
|
43
48
|
getFormDefinition(formDefinitionId) {
|
|
44
49
|
return this.http.get(`${this.valtimoApiConfig.endpointUri}v1/form-management/${formDefinitionId}`);
|
|
45
50
|
}
|
|
51
|
+
existsFormDefinition(formDefinitionName) {
|
|
52
|
+
return this.http.get(`${this.valtimoApiConfig.endpointUri}v1/form-management/exists/${formDefinitionName}`);
|
|
53
|
+
}
|
|
46
54
|
queryFormDefinitions(params) {
|
|
47
55
|
return this.http.get(`${this.valtimoApiConfig.endpointUri}v1/form-management`, {
|
|
48
56
|
observe: 'response',
|
|
@@ -158,6 +166,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
|
|
|
158
166
|
args: [{ selector: 'valtimo-form-management', template: "<!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div class=\"main-content pt-0\">\n <div class=\"container-fluid\">\n <div class=\"text-right\">\n <div class=\"btn-group mt-m3px mb-3\">\n <button\n [routerLink]=\"'create'\"\n [queryParams]=\"{upload: 'true'}\"\n class=\"btn btn-secondary btn-space\"\n >\n <i class=\"icon mdi mdi-upload mr-1\"></i>\n {{ 'Upload' | translate }}\n </button>\n <button [routerLink]=\"'create'\" class=\"btn btn-primary btn-space mr-0\">\n <i class=\"icon mdi mdi-plus mr-1\"></i>\n <span>{{ 'Create new Form' | translate }}</span>\n </button>\n </div>\n </div>\n <valtimo-widget>\n <valtimo-form-management-list></valtimo-form-management-list>\n </valtimo-widget>\n </div>\n</div>\n", styles: ["/*!\n * Copyright 2015-2020 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n"] }]
|
|
159
167
|
}], ctorParameters: function () { return []; } });
|
|
160
168
|
|
|
169
|
+
function noDuplicateFormValidator(formManagementService) {
|
|
170
|
+
return (control) => formManagementService
|
|
171
|
+
.existsFormDefinition(control.value.toString())
|
|
172
|
+
.pipe(map((result) => (result ? { duplicate: true } : null)));
|
|
173
|
+
}
|
|
174
|
+
|
|
161
175
|
/*
|
|
162
176
|
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
163
177
|
*
|
|
@@ -186,7 +200,9 @@ class FormManagementCreateComponent {
|
|
|
186
200
|
}
|
|
187
201
|
ngOnInit() {
|
|
188
202
|
this.form = this.formBuilder.group({
|
|
189
|
-
name: new FormControl('', Validators.required
|
|
203
|
+
name: new FormControl('', Validators.required, [
|
|
204
|
+
noDuplicateFormValidator(this.formManagementService),
|
|
205
|
+
]),
|
|
190
206
|
});
|
|
191
207
|
}
|
|
192
208
|
reset() {
|
|
@@ -224,12 +240,87 @@ class FormManagementCreateComponent {
|
|
|
224
240
|
}
|
|
225
241
|
}
|
|
226
242
|
FormManagementCreateComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: FormManagementCreateComponent, deps: [{ token: FormManagementService }, { token: i2$2.FormBuilder }, { token: i3.Router }, { token: i4.AlertService }, { token: i3.ActivatedRoute }], target: i0.ɵɵFactoryTarget.Component });
|
|
227
|
-
FormManagementCreateComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: FormManagementCreateComponent, selector: "valtimo-form-management-create", ngImport: i0, template: "<!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div class=\"main-content\">\n <div class=\"container-fluid\">\n <div class=\"col-12 px-0 mb-5\">\n <valtimo-widget>\n <div class=\"bg-white p-5\">\n <form [formGroup]=\"form\" (ngSubmit)=\"createFormDefinition()\">\n <div class=\"form-group row\">\n <label class=\"col-12 col-sm-3 col-form-label text-sm-right\" for=\"name\">{{\n 'formManagement.name' | translate\n }}</label>\n <div class=\"col-12 col-sm-8 col-lg-6\">\n <input\n type=\"text\"\n id=\"name\"\n formControlName=\"name\"\n class=\"form-control\"\n placeholder=\"Form definition name\"\n [ngClass]=\"{\n 'is-valid': formControls.name.touched && formControls.name.valid,\n 'is-invalid': formControls.name.touched && formControls.name.errors\n }\"\n required\n />\n <div\n *ngIf=\"formControls.name.touched && formControls.name.errors\"\n class=\"invalid-feedback\"\n >\n <div *ngIf=\"formControls.name.errors.required\">\n {{ 'formManagement.nameIsRequired' | translate }}\n </div>\n </div>\n </div>\n </div>\n <div class=\"row pt-3 mt-1\">\n <div class=\"col-12 col-sm-6 text-left\">\n <a [routerLink]=\"'/
|
|
243
|
+
FormManagementCreateComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: FormManagementCreateComponent, selector: "valtimo-form-management-create", ngImport: i0, template: "<!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div class=\"main-content\">\n <div class=\"container-fluid\">\n <div class=\"col-12 px-0 mb-5\">\n <valtimo-widget>\n <div class=\"bg-white p-5\">\n <form [formGroup]=\"form\" (ngSubmit)=\"createFormDefinition()\">\n <div class=\"form-group row\">\n <label class=\"col-12 col-sm-3 col-form-label text-sm-right\" for=\"name\">{{\n 'formManagement.name' | translate\n }}</label>\n <div class=\"col-12 col-sm-8 col-lg-6\">\n <input\n type=\"text\"\n id=\"name\"\n formControlName=\"name\"\n class=\"form-control\"\n placeholder=\"Form definition name\"\n [ngClass]=\"{\n 'is-valid': formControls.name.touched && formControls.name.valid,\n 'is-invalid': formControls.name.touched && formControls.name.errors\n }\"\n required\n />\n <div\n *ngIf=\"formControls.name.touched && formControls.name.errors\"\n class=\"invalid-feedback\"\n >\n <div *ngIf=\"formControls.name.errors.required\">\n {{ 'formManagement.nameIsRequired' | translate }}\n </div>\n <div *ngIf=\"formControls.name.errors.duplicate\">\n {{ 'formManagement.nameIsInUse' | translate }}\n </div>\n </div>\n </div>\n </div>\n <div class=\"row pt-3 mt-1\">\n <div class=\"col-12 col-sm-6 text-left\">\n <a [routerLink]=\"'/form-management'\" class=\"btn btn-space btn-default\">{{\n 'formManagement.back' | translate\n }}</a>\n </div>\n <div class=\"col-12 col-sm-6 text-right\">\n <button class=\"btn btn-space btn-secondary\" type=\"button\" (click)=\"reset()\">\n {{ 'formManagement.reset' | translate }}\n </button>\n <button class=\"btn btn-space btn-primary\" type=\"submit\" [disabled]=\"form.invalid\">\n {{ 'formManagement.submit' | translate }}\n </button>\n </div>\n </div>\n </form>\n </div>\n </valtimo-widget>\n </div>\n </div>\n</div>\n", styles: ["/*!\n * Copyright 2015-2020 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n"], dependencies: [{ kind: "directive", type: i3.RouterLinkWithHref, selector: "a[routerLink],area[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "directive", type: i5.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2$2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2$2.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i2$2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2$2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i4.WidgetComponent, selector: "valtimo-widget", inputs: ["type", "name", "icon", "contrast", "divider", "title", "subtitle", "collapseAble", "collapse", "additionalClasses"] }, { kind: "pipe", type: i2$1.TranslatePipe, name: "translate" }] });
|
|
228
244
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: FormManagementCreateComponent, decorators: [{
|
|
229
245
|
type: Component,
|
|
230
|
-
args: [{ selector: 'valtimo-form-management-create', template: "<!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div class=\"main-content\">\n <div class=\"container-fluid\">\n <div class=\"col-12 px-0 mb-5\">\n <valtimo-widget>\n <div class=\"bg-white p-5\">\n <form [formGroup]=\"form\" (ngSubmit)=\"createFormDefinition()\">\n <div class=\"form-group row\">\n <label class=\"col-12 col-sm-3 col-form-label text-sm-right\" for=\"name\">{{\n 'formManagement.name' | translate\n }}</label>\n <div class=\"col-12 col-sm-8 col-lg-6\">\n <input\n type=\"text\"\n id=\"name\"\n formControlName=\"name\"\n class=\"form-control\"\n placeholder=\"Form definition name\"\n [ngClass]=\"{\n 'is-valid': formControls.name.touched && formControls.name.valid,\n 'is-invalid': formControls.name.touched && formControls.name.errors\n }\"\n required\n />\n <div\n *ngIf=\"formControls.name.touched && formControls.name.errors\"\n class=\"invalid-feedback\"\n >\n <div *ngIf=\"formControls.name.errors.required\">\n {{ 'formManagement.nameIsRequired' | translate }}\n </div>\n </div>\n </div>\n </div>\n <div class=\"row pt-3 mt-1\">\n <div class=\"col-12 col-sm-6 text-left\">\n <a [routerLink]=\"'/
|
|
246
|
+
args: [{ selector: 'valtimo-form-management-create', template: "<!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div class=\"main-content\">\n <div class=\"container-fluid\">\n <div class=\"col-12 px-0 mb-5\">\n <valtimo-widget>\n <div class=\"bg-white p-5\">\n <form [formGroup]=\"form\" (ngSubmit)=\"createFormDefinition()\">\n <div class=\"form-group row\">\n <label class=\"col-12 col-sm-3 col-form-label text-sm-right\" for=\"name\">{{\n 'formManagement.name' | translate\n }}</label>\n <div class=\"col-12 col-sm-8 col-lg-6\">\n <input\n type=\"text\"\n id=\"name\"\n formControlName=\"name\"\n class=\"form-control\"\n placeholder=\"Form definition name\"\n [ngClass]=\"{\n 'is-valid': formControls.name.touched && formControls.name.valid,\n 'is-invalid': formControls.name.touched && formControls.name.errors\n }\"\n required\n />\n <div\n *ngIf=\"formControls.name.touched && formControls.name.errors\"\n class=\"invalid-feedback\"\n >\n <div *ngIf=\"formControls.name.errors.required\">\n {{ 'formManagement.nameIsRequired' | translate }}\n </div>\n <div *ngIf=\"formControls.name.errors.duplicate\">\n {{ 'formManagement.nameIsInUse' | translate }}\n </div>\n </div>\n </div>\n </div>\n <div class=\"row pt-3 mt-1\">\n <div class=\"col-12 col-sm-6 text-left\">\n <a [routerLink]=\"'/form-management'\" class=\"btn btn-space btn-default\">{{\n 'formManagement.back' | translate\n }}</a>\n </div>\n <div class=\"col-12 col-sm-6 text-right\">\n <button class=\"btn btn-space btn-secondary\" type=\"button\" (click)=\"reset()\">\n {{ 'formManagement.reset' | translate }}\n </button>\n <button class=\"btn btn-space btn-primary\" type=\"submit\" [disabled]=\"form.invalid\">\n {{ 'formManagement.submit' | translate }}\n </button>\n </div>\n </div>\n </form>\n </div>\n </valtimo-widget>\n </div>\n </div>\n</div>\n", styles: ["/*!\n * Copyright 2015-2020 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n"] }]
|
|
231
247
|
}], ctorParameters: function () { return [{ type: FormManagementService }, { type: i2$2.FormBuilder }, { type: i3.Router }, { type: i4.AlertService }, { type: i3.ActivatedRoute }]; } });
|
|
232
248
|
|
|
249
|
+
/*
|
|
250
|
+
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
251
|
+
*
|
|
252
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
253
|
+
* you may not use this file except in compliance with the License.
|
|
254
|
+
* You may obtain a copy of the License at
|
|
255
|
+
*
|
|
256
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
257
|
+
*
|
|
258
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
259
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
260
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
261
|
+
* See the License for the specific language governing permissions and
|
|
262
|
+
* limitations under the License.
|
|
263
|
+
*/
|
|
264
|
+
class FormManagementDuplicateComponent extends BaseModal {
|
|
265
|
+
constructor(formToDuplicate, modalService, formManagementService, alertService, route, router) {
|
|
266
|
+
super();
|
|
267
|
+
this.formToDuplicate = formToDuplicate;
|
|
268
|
+
this.modalService = modalService;
|
|
269
|
+
this.formManagementService = formManagementService;
|
|
270
|
+
this.alertService = alertService;
|
|
271
|
+
this.route = route;
|
|
272
|
+
this.router = router;
|
|
273
|
+
this.duplicateForm = new FormGroup({
|
|
274
|
+
duplicateFormName: new FormControl(this.getDefaultName(), Validators.compose([Validators.required]), [noDuplicateFormValidator(this.formManagementService)]),
|
|
275
|
+
});
|
|
276
|
+
this.duplicateForm.markAllAsTouched();
|
|
277
|
+
}
|
|
278
|
+
duplicate() {
|
|
279
|
+
const control = this.duplicateFormName;
|
|
280
|
+
const request = {
|
|
281
|
+
name: control.value.toString(),
|
|
282
|
+
formDefinition: JSON.stringify(this.formToDuplicate.formDefinition),
|
|
283
|
+
};
|
|
284
|
+
combineLatest([
|
|
285
|
+
this.formManagementService.createFormDefinition(request),
|
|
286
|
+
this.route.queryParams,
|
|
287
|
+
])
|
|
288
|
+
.pipe(take(1))
|
|
289
|
+
.subscribe(([formDefinition, params]) => {
|
|
290
|
+
this.alertService.success('Created new Form');
|
|
291
|
+
this.router
|
|
292
|
+
.navigateByUrl(`/form-management/edit/${formDefinition.id}`)
|
|
293
|
+
.then(function (result) {
|
|
294
|
+
window.location.reload();
|
|
295
|
+
});
|
|
296
|
+
}, err => {
|
|
297
|
+
if (err.toString().includes('Duplicate name')) {
|
|
298
|
+
control.setErrors({ duplicate: true });
|
|
299
|
+
}
|
|
300
|
+
else {
|
|
301
|
+
control.setErrors({ incorrect: true });
|
|
302
|
+
}
|
|
303
|
+
});
|
|
304
|
+
}
|
|
305
|
+
get duplicateFormName() {
|
|
306
|
+
return this.duplicateForm.controls['duplicateFormName'];
|
|
307
|
+
}
|
|
308
|
+
getDefaultName() {
|
|
309
|
+
return this.formToDuplicate.name + '-duplicate';
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
FormManagementDuplicateComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: FormManagementDuplicateComponent, deps: [{ token: 'formToDuplicate' }, { token: i1$1.ModalService }, { token: FormManagementService }, { token: i4.AlertService }, { token: i3.ActivatedRoute }, { token: i3.Router }], target: i0.ɵɵFactoryTarget.Component });
|
|
313
|
+
FormManagementDuplicateComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: FormManagementDuplicateComponent, selector: "valtimo-form-management-duplicate-modal", usesInheritance: true, ngImport: i0, template: "<!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n<ibm-modal [open]=\"open\" (overlaySelected)=\"closeModal()\" [formGroup]=\"duplicateForm\">\n <ibm-modal-header (closeSelect)=\"closeModal()\">{{\n 'formManagement.duplicate' | translate\n }}</ibm-modal-header>\n <section class=\"bx--modal-content p-2\">\n <ibm-label labelState=\"error\">\n {{ 'formManagement.name' | translate }}\n <input ibmText formControlName=\"duplicateFormName\" [invalid]=\"duplicateFormName.invalid\" />\n </ibm-label>\n <div\n *ngIf=\"duplicateFormName.invalid && (duplicateFormName.dirty || duplicateFormName.touched)\"\n class=\"bg-warning text-black mb-0 p-2 pl-3 pr-3\"\n role=\"alert\"\n >\n <div *ngIf=\"duplicateFormName.errors.required\">\n {{ 'formManagement.nameIsRequired' | translate }}\n </div>\n <div *ngIf=\"duplicateFormName.errors.duplicate\">\n {{ 'formManagement.nameIsInUse' | translate }}\n </div>\n </div>\n </section>\n <ibm-modal-footer>\n <button ibmButton=\"secondary\" (click)=\"closeModal()\">\n {{ 'interface.cancel' | translate }}\n </button>\n <button\n ibmButton=\"primary\"\n [attr.modal-primary-focus]=\"true\"\n modal-primary-focus\n (click)=\"duplicate()\"\n [disabled]=\"duplicateForm.invalid\"\n >\n {{ 'formManagement.submit' | translate }}\n </button>\n </ibm-modal-footer>\n</ibm-modal>\n", styles: ["/*!\n * Copyright 2015-2020 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n"], dependencies: [{ kind: "directive", type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2$2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2$2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i7.Modal, selector: "ibm-modal", inputs: ["size", "theme", "ariaLabel", "open", "trigger", "hasScrollingContent"], outputs: ["overlaySelected", "close"] }, { kind: "component", type: i7.ModalHeader, selector: "ibm-modal-header", inputs: ["theme", "closeLabel", "showCloseButton"], outputs: ["closeSelect"] }, { kind: "component", type: i7.ModalFooter, selector: "ibm-modal-footer" }, { kind: "component", type: i7.Label, selector: "ibm-label", inputs: ["labelInputID", "disabled", "labelState", "skeleton", "helperText", "invalidText", "invalid", "warn", "warnText", "ariaLabel"] }, { kind: "directive", type: i7.TextInput, selector: "[ibmText]", inputs: ["theme", "size", "invalid", "warn", "skeleton"] }, { kind: "directive", type: i7.Button, selector: "[ibmButton]", inputs: ["ibmButton", "size", "skeleton", "iconOnly", "isExpressive"] }, { kind: "pipe", type: i2$1.TranslatePipe, name: "translate" }] });
|
|
314
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: FormManagementDuplicateComponent, decorators: [{
|
|
315
|
+
type: Component,
|
|
316
|
+
args: [{ selector: 'valtimo-form-management-duplicate-modal', template: "<!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n<ibm-modal [open]=\"open\" (overlaySelected)=\"closeModal()\" [formGroup]=\"duplicateForm\">\n <ibm-modal-header (closeSelect)=\"closeModal()\">{{\n 'formManagement.duplicate' | translate\n }}</ibm-modal-header>\n <section class=\"bx--modal-content p-2\">\n <ibm-label labelState=\"error\">\n {{ 'formManagement.name' | translate }}\n <input ibmText formControlName=\"duplicateFormName\" [invalid]=\"duplicateFormName.invalid\" />\n </ibm-label>\n <div\n *ngIf=\"duplicateFormName.invalid && (duplicateFormName.dirty || duplicateFormName.touched)\"\n class=\"bg-warning text-black mb-0 p-2 pl-3 pr-3\"\n role=\"alert\"\n >\n <div *ngIf=\"duplicateFormName.errors.required\">\n {{ 'formManagement.nameIsRequired' | translate }}\n </div>\n <div *ngIf=\"duplicateFormName.errors.duplicate\">\n {{ 'formManagement.nameIsInUse' | translate }}\n </div>\n </div>\n </section>\n <ibm-modal-footer>\n <button ibmButton=\"secondary\" (click)=\"closeModal()\">\n {{ 'interface.cancel' | translate }}\n </button>\n <button\n ibmButton=\"primary\"\n [attr.modal-primary-focus]=\"true\"\n modal-primary-focus\n (click)=\"duplicate()\"\n [disabled]=\"duplicateForm.invalid\"\n >\n {{ 'formManagement.submit' | translate }}\n </button>\n </ibm-modal-footer>\n</ibm-modal>\n", styles: ["/*!\n * Copyright 2015-2020 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n"] }]
|
|
317
|
+
}], ctorParameters: function () {
|
|
318
|
+
return [{ type: undefined, decorators: [{
|
|
319
|
+
type: Inject,
|
|
320
|
+
args: ['formToDuplicate']
|
|
321
|
+
}] }, { type: i1$1.ModalService }, { type: FormManagementService }, { type: i4.AlertService }, { type: i3.ActivatedRoute }, { type: i3.Router }];
|
|
322
|
+
} });
|
|
323
|
+
|
|
233
324
|
/*
|
|
234
325
|
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
235
326
|
*
|
|
@@ -359,12 +450,12 @@ class FormManagementUploadComponent {
|
|
|
359
450
|
this.disabled$.next(false);
|
|
360
451
|
}
|
|
361
452
|
}
|
|
362
|
-
FormManagementUploadComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: FormManagementUploadComponent, deps: [{ token: i1$
|
|
453
|
+
FormManagementUploadComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: FormManagementUploadComponent, deps: [{ token: i1$2.DocumentService }, { token: i2$1.TranslateService }], target: i0.ɵɵFactoryTarget.Component });
|
|
363
454
|
FormManagementUploadComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: FormManagementUploadComponent, selector: "valtimo-form-management-upload", inputs: { show$: "show$" }, outputs: { definitionUploaded: "definitionUploaded" }, viewQueries: [{ propertyName: "modal", first: true, predicate: ["uploadFormDefinitionModal"], descendants: true }], ngImport: i0, template: "<!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<valtimo-modal\n #uploadFormDefinitionModal\n [title]=\"'uploadFormDefinition' | translate\"\n showFooter=\"true\"\n>\n <div class=\"mt-2\" body>\n <valtimo-dropzone\n [clear$]=\"clear$\"\n (fileSelected)=\"setFile($event)\"\n [disabled]=\"disabled$ | async\"\n [subtitle]=\"'dropzone.formJsonDocDef' | translate\"\n [externalError$]=\"error$\"\n [maxFiles]=\"1\"\n ></valtimo-dropzone>\n </div>\n <div footer>\n <ng-container *ngIf=\"(jsonString$ | async) && (error$ | async) === ''; else disabledUpload\">\n <button [disabled]=\"disabled$ | async\" class=\"btn btn-primary\" (click)=\"uploadDefinition()\">\n {{ 'Upload' | translate }}\n </button>\n </ng-container>\n </div>\n</valtimo-modal>\n\n<ng-template #disabledUpload>\n <button [disabled]=\"true\" class=\"btn btn-primary\">\n <i class=\"icon mdi mdi-upload mr-1\"></i>\n {{ 'Upload' | translate }}\n </button>\n</ng-template>\n", styles: ["/*!\n * Copyright 2015-2020 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n"], dependencies: [{ kind: "directive", type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i4.DropzoneComponent, selector: "valtimo-dropzone", inputs: ["title", "hideTitle", "subtitle", "externalError$", "maxFileSize", "showMaxFileSize", "acceptedFiles", "clear$", "disabled", "hideFilePreview", "uploading", "camera", "maxFiles"], outputs: ["fileSelected"] }, { kind: "component", type: i4.ModalComponent, selector: "valtimo-modal", inputs: ["elementId", "title", "subtitle", "templateBelowSubtitle", "showFooter"] }, { kind: "pipe", type: i5.AsyncPipe, name: "async" }, { kind: "pipe", type: i2$1.TranslatePipe, name: "translate" }] });
|
|
364
455
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: FormManagementUploadComponent, decorators: [{
|
|
365
456
|
type: Component,
|
|
366
457
|
args: [{ selector: 'valtimo-form-management-upload', template: "<!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<valtimo-modal\n #uploadFormDefinitionModal\n [title]=\"'uploadFormDefinition' | translate\"\n showFooter=\"true\"\n>\n <div class=\"mt-2\" body>\n <valtimo-dropzone\n [clear$]=\"clear$\"\n (fileSelected)=\"setFile($event)\"\n [disabled]=\"disabled$ | async\"\n [subtitle]=\"'dropzone.formJsonDocDef' | translate\"\n [externalError$]=\"error$\"\n [maxFiles]=\"1\"\n ></valtimo-dropzone>\n </div>\n <div footer>\n <ng-container *ngIf=\"(jsonString$ | async) && (error$ | async) === ''; else disabledUpload\">\n <button [disabled]=\"disabled$ | async\" class=\"btn btn-primary\" (click)=\"uploadDefinition()\">\n {{ 'Upload' | translate }}\n </button>\n </ng-container>\n </div>\n</valtimo-modal>\n\n<ng-template #disabledUpload>\n <button [disabled]=\"true\" class=\"btn btn-primary\">\n <i class=\"icon mdi mdi-upload mr-1\"></i>\n {{ 'Upload' | translate }}\n </button>\n</ng-template>\n", styles: ["/*!\n * Copyright 2015-2020 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n"] }]
|
|
367
|
-
}], ctorParameters: function () { return [{ type: i1$
|
|
458
|
+
}], ctorParameters: function () { return [{ type: i1$2.DocumentService }, { type: i2$1.TranslateService }]; }, propDecorators: { modal: [{
|
|
368
459
|
type: ViewChild,
|
|
369
460
|
args: ['uploadFormDefinitionModal']
|
|
370
461
|
}], show$: [{
|
|
@@ -389,11 +480,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
|
|
|
389
480
|
* limitations under the License.
|
|
390
481
|
*/
|
|
391
482
|
class FormManagementEditComponent {
|
|
392
|
-
constructor(formManagementService, alertService, route, router) {
|
|
483
|
+
constructor(formManagementService, alertService, route, router, modalService) {
|
|
393
484
|
this.formManagementService = formManagementService;
|
|
394
485
|
this.alertService = alertService;
|
|
395
486
|
this.route = route;
|
|
396
487
|
this.router = router;
|
|
488
|
+
this.modalService = modalService;
|
|
397
489
|
this.showModal$ = new BehaviorSubject(false);
|
|
398
490
|
this.reloading$ = new BehaviorSubject(false);
|
|
399
491
|
this.modifiedFormDefinition = null;
|
|
@@ -481,9 +573,17 @@ class FormManagementEditComponent {
|
|
|
481
573
|
window.URL.revokeObjectURL(link.href);
|
|
482
574
|
link.remove();
|
|
483
575
|
}
|
|
484
|
-
|
|
576
|
+
showUploadModal() {
|
|
485
577
|
this.showModal$.next(true);
|
|
486
578
|
}
|
|
579
|
+
showDuplicateModal() {
|
|
580
|
+
this.modalService.create({
|
|
581
|
+
component: FormManagementDuplicateComponent,
|
|
582
|
+
inputs: {
|
|
583
|
+
formToDuplicate: this.formDefinition,
|
|
584
|
+
},
|
|
585
|
+
});
|
|
586
|
+
}
|
|
487
587
|
setFormDefinition(formDefinition) {
|
|
488
588
|
var _a;
|
|
489
589
|
this.reloading$.next(true);
|
|
@@ -498,17 +598,17 @@ class FormManagementEditComponent {
|
|
|
498
598
|
checkToOpenUploadModal() {
|
|
499
599
|
this.route.queryParams.pipe(take(1)).subscribe(params => {
|
|
500
600
|
if ((params === null || params === void 0 ? void 0 : params.upload) === 'true') {
|
|
501
|
-
this.
|
|
601
|
+
this.showUploadModal();
|
|
502
602
|
}
|
|
503
603
|
});
|
|
504
604
|
}
|
|
505
605
|
}
|
|
506
|
-
FormManagementEditComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: FormManagementEditComponent, deps: [{ token: FormManagementService }, { token: i4.AlertService }, { token: i3.ActivatedRoute }, { token: i3.Router }], target: i0.ɵɵFactoryTarget.Component });
|
|
507
|
-
FormManagementEditComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: FormManagementEditComponent, selector: "valtimo-form-management-edit", ngImport: i0, template: "<!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div class=\"main-content pt-0\">\n <div class=\"container-fluid\" *ngIf=\"formDefinition\">\n <div class=\"btn-group mt-m3px mb-3 float-right\">\n <button class=\"btn btn-primary btn-space\" (click)=\"downloadFormDefinition()\">\n <i class=\"icon mdi mdi-download mr-1\"></i>\n {{ 'Download' | translate }}\n </button>\n <button\n class=\"btn btn-secondary btn-space\"\n (click)=\"
|
|
606
|
+
FormManagementEditComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: FormManagementEditComponent, deps: [{ token: FormManagementService }, { token: i4.AlertService }, { token: i3.ActivatedRoute }, { token: i3.Router }, { token: i7.ModalService }], target: i0.ɵɵFactoryTarget.Component });
|
|
607
|
+
FormManagementEditComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: FormManagementEditComponent, selector: "valtimo-form-management-edit", ngImport: i0, template: "<!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div class=\"main-content pt-0\">\n <div class=\"container-fluid\" *ngIf=\"formDefinition\">\n <div class=\"btn-group mt-m3px mb-3 float-right\">\n <button class=\"btn btn-primary btn-space\" (click)=\"downloadFormDefinition()\">\n <i class=\"icon mdi mdi-download mr-1\"></i>\n {{ 'Download' | translate }}\n </button>\n <button\n class=\"btn btn-secondary btn-space\"\n (click)=\"showUploadModal()\"\n [disabled]=\"formDefinition.readOnly\"\n >\n <i class=\"icon mdi mdi-upload mr-1\"></i>\n {{ 'Upload' | translate }}\n </button>\n <button\n class=\"btn btn-danger btn-space\"\n (click)=\"delete()\"\n [disabled]=\"formDefinition.readOnly\"\n >\n <i class=\"icon mdi mdi-delete mr-1\"></i>{{ 'formManagement.delete' | translate }}\n </button>\n <button\n class=\"btn btn-success btn-space\"\n (click)=\"modifyFormDefinition()\"\n [disabled]=\"formDefinition.readOnly\"\n >\n <i class=\"icon mdi mdi-upload mr-1\"></i>{{ 'formManagement.deploy' | translate }}\n </button>\n <button class=\"btn btn-secondary btn-space\" (click)=\"showDuplicateModal()\">\n <i class=\"icon mdi mdi-content-duplicate mr-1\"></i\n >{{ 'formManagement.duplicate' | translate }}\n </button>\n </div>\n <div class=\"clearfix\"></div>\n <div class=\"bg-light formbuilder-header overflow-auto\">\n <h3 class=\"formbuilder-title\">\n {{ formDefinition.name }}\n <div *ngIf=\"formDefinition.readOnly\" class=\"pull-right\">\n <span class=\"badge badge-pill badge-info increase-size\">{{\n 'formManagement.readOnly' | translate\n }}</span>\n </div>\n </h3>\n </div>\n <ng-container *ngIf=\"(reloading$ | async) === false\">\n <valtimo-form-io-builder\n [form]=\"formDefinition.formDefinition\"\n (change)=\"formBuilderChanged($event)\"\n ></valtimo-form-io-builder>\n </ng-container>\n </div>\n</div>\n\n<valtimo-form-management-upload\n [show$]=\"showModal$\"\n (definitionUploaded)=\"setFormDefinition($event)\"\n></valtimo-form-management-upload>\n\n<ibm-placeholder></ibm-placeholder>\n", styles: ["/*!\n * Copyright 2015-2020 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */.formbuilder .btn.formcomponent.drag-copy,.btn.formcomponent.gu-mirror{font-weight:400;background-color:silver;border-color:silver;color:#fff}.formbuilder .btn.formcomponent.drag-copy:hover,.formbuilder .btn.formcomponent.drag-copy:active,.btn.formcomponent.gu-mirror:hover,.btn.formcomponent.gu-mirror:active{box-shadow:none}.formbuilder .btn.formcomponent.drag-copy:active,.btn.formcomponent.gu-mirror:active{background-color:silver;border-color:silver}.formbuilder-header{padding-left:18px;padding-right:18px;font-size:18px;height:80px;border:1px solid #dee2e6;border-bottom:0}.formbuilder-header .formbuilder-title{margin-top:21px;margin-bottom:7px}.formbuilder-header .formbuilder-subtitle{margin-top:0;margin-bottom:12px}.formbuilder{background:white;padding:1rem;border:1px solid #dee2e6;margin-right:0!important;margin-left:0!important}.formbuilder .form-builder-panel .builder-group-button[aria-expanded=false],.formbuilder .form-builder-panel .builder-group-button[aria-expanded=\"\"]{color:#a9a9a9}.formbuilder .form-builder-panel .builder-group-button[aria-expanded=true]{color:#000}.formbuilder .drag-and-drop-alert{display:none}.formbuilder .formarea{padding:10px;border:solid 1px silver;background-color:#fff}.increase-size{font-size:1rem}\n"], dependencies: [{ kind: "component", type: i4.FormioBuilderComponent, selector: "valtimo-form-io-builder", inputs: ["form"], outputs: ["change"] }, { kind: "directive", type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i7.Placeholder, selector: "ibm-placeholder", inputs: ["id"] }, { kind: "component", type: FormManagementUploadComponent, selector: "valtimo-form-management-upload", inputs: ["show$"], outputs: ["definitionUploaded"] }, { kind: "pipe", type: i5.AsyncPipe, name: "async" }, { kind: "pipe", type: i2$1.TranslatePipe, name: "translate" }], encapsulation: i0.ViewEncapsulation.None });
|
|
508
608
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: FormManagementEditComponent, decorators: [{
|
|
509
609
|
type: Component,
|
|
510
|
-
args: [{ selector: 'valtimo-form-management-edit', encapsulation: ViewEncapsulation.None, template: "<!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div class=\"main-content pt-0\">\n <div class=\"container-fluid\" *ngIf=\"formDefinition\">\n <div class=\"btn-group mt-m3px mb-3 float-right\">\n <button class=\"btn btn-primary btn-space\" (click)=\"downloadFormDefinition()\">\n <i class=\"icon mdi mdi-download mr-1\"></i>\n {{ 'Download' | translate }}\n </button>\n <button\n class=\"btn btn-secondary btn-space\"\n (click)=\"
|
|
511
|
-
}], ctorParameters: function () { return [{ type: FormManagementService }, { type: i4.AlertService }, { type: i3.ActivatedRoute }, { type: i3.Router }]; } });
|
|
610
|
+
args: [{ selector: 'valtimo-form-management-edit', encapsulation: ViewEncapsulation.None, template: "<!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div class=\"main-content pt-0\">\n <div class=\"container-fluid\" *ngIf=\"formDefinition\">\n <div class=\"btn-group mt-m3px mb-3 float-right\">\n <button class=\"btn btn-primary btn-space\" (click)=\"downloadFormDefinition()\">\n <i class=\"icon mdi mdi-download mr-1\"></i>\n {{ 'Download' | translate }}\n </button>\n <button\n class=\"btn btn-secondary btn-space\"\n (click)=\"showUploadModal()\"\n [disabled]=\"formDefinition.readOnly\"\n >\n <i class=\"icon mdi mdi-upload mr-1\"></i>\n {{ 'Upload' | translate }}\n </button>\n <button\n class=\"btn btn-danger btn-space\"\n (click)=\"delete()\"\n [disabled]=\"formDefinition.readOnly\"\n >\n <i class=\"icon mdi mdi-delete mr-1\"></i>{{ 'formManagement.delete' | translate }}\n </button>\n <button\n class=\"btn btn-success btn-space\"\n (click)=\"modifyFormDefinition()\"\n [disabled]=\"formDefinition.readOnly\"\n >\n <i class=\"icon mdi mdi-upload mr-1\"></i>{{ 'formManagement.deploy' | translate }}\n </button>\n <button class=\"btn btn-secondary btn-space\" (click)=\"showDuplicateModal()\">\n <i class=\"icon mdi mdi-content-duplicate mr-1\"></i\n >{{ 'formManagement.duplicate' | translate }}\n </button>\n </div>\n <div class=\"clearfix\"></div>\n <div class=\"bg-light formbuilder-header overflow-auto\">\n <h3 class=\"formbuilder-title\">\n {{ formDefinition.name }}\n <div *ngIf=\"formDefinition.readOnly\" class=\"pull-right\">\n <span class=\"badge badge-pill badge-info increase-size\">{{\n 'formManagement.readOnly' | translate\n }}</span>\n </div>\n </h3>\n </div>\n <ng-container *ngIf=\"(reloading$ | async) === false\">\n <valtimo-form-io-builder\n [form]=\"formDefinition.formDefinition\"\n (change)=\"formBuilderChanged($event)\"\n ></valtimo-form-io-builder>\n </ng-container>\n </div>\n</div>\n\n<valtimo-form-management-upload\n [show$]=\"showModal$\"\n (definitionUploaded)=\"setFormDefinition($event)\"\n></valtimo-form-management-upload>\n\n<ibm-placeholder></ibm-placeholder>\n", styles: ["/*!\n * Copyright 2015-2020 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */.formbuilder .btn.formcomponent.drag-copy,.btn.formcomponent.gu-mirror{font-weight:400;background-color:silver;border-color:silver;color:#fff}.formbuilder .btn.formcomponent.drag-copy:hover,.formbuilder .btn.formcomponent.drag-copy:active,.btn.formcomponent.gu-mirror:hover,.btn.formcomponent.gu-mirror:active{box-shadow:none}.formbuilder .btn.formcomponent.drag-copy:active,.btn.formcomponent.gu-mirror:active{background-color:silver;border-color:silver}.formbuilder-header{padding-left:18px;padding-right:18px;font-size:18px;height:80px;border:1px solid #dee2e6;border-bottom:0}.formbuilder-header .formbuilder-title{margin-top:21px;margin-bottom:7px}.formbuilder-header .formbuilder-subtitle{margin-top:0;margin-bottom:12px}.formbuilder{background:white;padding:1rem;border:1px solid #dee2e6;margin-right:0!important;margin-left:0!important}.formbuilder .form-builder-panel .builder-group-button[aria-expanded=false],.formbuilder .form-builder-panel .builder-group-button[aria-expanded=\"\"]{color:#a9a9a9}.formbuilder .form-builder-panel .builder-group-button[aria-expanded=true]{color:#000}.formbuilder .drag-and-drop-alert{display:none}.formbuilder .formarea{padding:10px;border:solid 1px silver;background-color:#fff}.increase-size{font-size:1rem}\n"] }]
|
|
611
|
+
}], ctorParameters: function () { return [{ type: FormManagementService }, { type: i4.AlertService }, { type: i3.ActivatedRoute }, { type: i3.Router }, { type: i7.ModalService }]; } });
|
|
512
612
|
|
|
513
613
|
/*
|
|
514
614
|
* Copyright 2015-2020 Ritense BV, the Netherlands.
|
|
@@ -581,7 +681,8 @@ FormManagementModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", ve
|
|
|
581
681
|
FormManagementCreateComponent,
|
|
582
682
|
FormManagementListComponent,
|
|
583
683
|
FormManagementEditComponent,
|
|
584
|
-
FormManagementUploadComponent
|
|
684
|
+
FormManagementUploadComponent,
|
|
685
|
+
FormManagementDuplicateComponent], imports: [FormManagementRoutingModule,
|
|
585
686
|
FormIoModule,
|
|
586
687
|
CommonModule,
|
|
587
688
|
ReactiveFormsModule,
|
|
@@ -591,7 +692,18 @@ FormManagementModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", ve
|
|
|
591
692
|
TranslateModule,
|
|
592
693
|
NgbTooltipModule,
|
|
593
694
|
DropzoneModule,
|
|
594
|
-
ModalModule
|
|
695
|
+
ModalModule,
|
|
696
|
+
ModalModule$1,
|
|
697
|
+
ModalModule$2,
|
|
698
|
+
InputModule,
|
|
699
|
+
TitleModule,
|
|
700
|
+
ButtonModule,
|
|
701
|
+
InputModule$1,
|
|
702
|
+
FormModule,
|
|
703
|
+
ModalModule,
|
|
704
|
+
InputModule$1,
|
|
705
|
+
PlaceholderModule,
|
|
706
|
+
ButtonModule$1], exports: [FormManagementComponent] });
|
|
595
707
|
FormManagementModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: FormManagementModule, imports: [FormManagementRoutingModule,
|
|
596
708
|
FormIoModule,
|
|
597
709
|
CommonModule,
|
|
@@ -602,7 +714,18 @@ FormManagementModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", ve
|
|
|
602
714
|
TranslateModule,
|
|
603
715
|
NgbTooltipModule,
|
|
604
716
|
DropzoneModule,
|
|
605
|
-
ModalModule
|
|
717
|
+
ModalModule,
|
|
718
|
+
ModalModule$1,
|
|
719
|
+
ModalModule$2,
|
|
720
|
+
InputModule,
|
|
721
|
+
TitleModule,
|
|
722
|
+
ButtonModule,
|
|
723
|
+
InputModule$1,
|
|
724
|
+
FormModule,
|
|
725
|
+
ModalModule,
|
|
726
|
+
InputModule$1,
|
|
727
|
+
PlaceholderModule,
|
|
728
|
+
ButtonModule$1] });
|
|
606
729
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: FormManagementModule, decorators: [{
|
|
607
730
|
type: NgModule,
|
|
608
731
|
args: [{
|
|
@@ -612,6 +735,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
|
|
|
612
735
|
FormManagementListComponent,
|
|
613
736
|
FormManagementEditComponent,
|
|
614
737
|
FormManagementUploadComponent,
|
|
738
|
+
FormManagementDuplicateComponent,
|
|
615
739
|
],
|
|
616
740
|
imports: [
|
|
617
741
|
FormManagementRoutingModule,
|
|
@@ -625,6 +749,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
|
|
|
625
749
|
NgbTooltipModule,
|
|
626
750
|
DropzoneModule,
|
|
627
751
|
ModalModule,
|
|
752
|
+
ModalModule$1,
|
|
753
|
+
ModalModule$2,
|
|
754
|
+
InputModule,
|
|
755
|
+
TitleModule,
|
|
756
|
+
ButtonModule,
|
|
757
|
+
InputModule$1,
|
|
758
|
+
FormModule,
|
|
759
|
+
ModalModule,
|
|
760
|
+
InputModule$1,
|
|
761
|
+
PlaceholderModule,
|
|
762
|
+
ButtonModule$1,
|
|
628
763
|
],
|
|
629
764
|
exports: [FormManagementComponent],
|
|
630
765
|
}]
|