@valtimo/form-management 10.7.0 → 11.0.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.
Files changed (37) hide show
  1. package/{esm2020 → esm2022}/lib/form-management-create/form-management-create.component.mjs +4 -4
  2. package/esm2022/lib/form-management-duplicate/form-management-duplicate.component.mjs +87 -0
  3. package/esm2022/lib/form-management-edit/form-management-edit.component.mjs +165 -0
  4. package/esm2022/lib/form-management-list/form-management-list.component.mjs +69 -0
  5. package/{esm2020 → esm2022}/lib/form-management-routing.module.mjs +5 -5
  6. package/{esm2020 → esm2022}/lib/form-management-upload/form-management-upload.component.mjs +4 -4
  7. package/{esm2020 → esm2022}/lib/form-management.component.mjs +4 -4
  8. package/esm2022/lib/form-management.module.mjs +124 -0
  9. package/esm2022/lib/form-management.service.mjs +56 -0
  10. package/{fesm2020 → fesm2022}/valtimo-form-management.mjs +105 -99
  11. package/fesm2022/valtimo-form-management.mjs.map +1 -0
  12. package/lib/form-management-create/form-management-create.component.d.ts +1 -1
  13. package/lib/form-management-duplicate/form-management-duplicate.component.d.ts +2 -3
  14. package/lib/form-management-duplicate/form-management-duplicate.component.d.ts.map +1 -1
  15. package/lib/form-management-edit/form-management-edit.component.d.ts +1 -1
  16. package/lib/form-management-edit/form-management-edit.component.d.ts.map +1 -1
  17. package/lib/form-management-list/form-management-list.component.d.ts +1 -2
  18. package/lib/form-management-list/form-management-list.component.d.ts.map +1 -1
  19. package/lib/form-management-upload/form-management-upload.component.d.ts +1 -1
  20. package/lib/form-management.component.d.ts +1 -1
  21. package/lib/form-management.module.d.ts +1 -2
  22. package/lib/form-management.module.d.ts.map +1 -1
  23. package/lib/form-management.service.d.ts.map +1 -1
  24. package/package.json +8 -14
  25. package/esm2020/lib/form-management-duplicate/form-management-duplicate.component.mjs +0 -88
  26. package/esm2020/lib/form-management-edit/form-management-edit.component.mjs +0 -159
  27. package/esm2020/lib/form-management-list/form-management-list.component.mjs +0 -70
  28. package/esm2020/lib/form-management.module.mjs +0 -125
  29. package/esm2020/lib/form-management.service.mjs +0 -56
  30. package/fesm2015/valtimo-form-management.mjs +0 -850
  31. package/fesm2015/valtimo-form-management.mjs.map +0 -1
  32. package/fesm2020/valtimo-form-management.mjs.map +0 -1
  33. /package/{esm2020 → esm2022}/lib/models/form-definition.model.mjs +0 -0
  34. /package/{esm2020 → esm2022}/lib/models/index.mjs +0 -0
  35. /package/{esm2020 → esm2022}/lib/validators/no-duplicate-form.validator.mjs +0 -0
  36. /package/{esm2020 → esm2022}/public-api.mjs +0 -0
  37. /package/{esm2020 → esm2022}/valtimo-form-management.mjs +0 -0
@@ -1,850 +0,0 @@
1
- import * as i0 from '@angular/core';
2
- import { Injectable, Component, Inject, EventEmitter, ViewChild, Input, Output, ViewEncapsulation, NgModule } from '@angular/core';
3
- import * as i1 from '@angular/common/http';
4
- import * as i2 from '@valtimo/config';
5
- import { ROLE_ADMIN } from '@valtimo/config';
6
- import * as i3 from '@angular/router';
7
- import { RouterModule } from '@angular/router';
8
- import * as i2$1 from '@valtimo/components';
9
- import { FormIoModule, WidgetModule, ListModule, DropzoneModule, ModalModule as ModalModule$2, ValtimoCdsModalDirectiveModule } from '@valtimo/components';
10
- import * as i2$2 from '@ngx-translate/core';
11
- import { TranslateModule } from '@ngx-translate/core';
12
- import { AuthGuardService } from '@valtimo/security';
13
- import * as i2$3 from '@angular/forms';
14
- import { FormControl, Validators, FormGroup, ReactiveFormsModule, FormsModule } from '@angular/forms';
15
- import { map, combineLatest, Subject, BehaviorSubject, Subscription } from 'rxjs';
16
- import { take, first } from 'rxjs/operators';
17
- import * as i5 from '@angular/common';
18
- import { CommonModule } from '@angular/common';
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';
25
- import { NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap';
26
-
27
- /*
28
- * Copyright 2015-2023 Ritense BV, the Netherlands.
29
- *
30
- * Licensed under EUPL, Version 1.2 (the "License");
31
- * you may not use this file except in compliance with the License.
32
- * You may obtain a copy of the License at
33
- *
34
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
35
- *
36
- * Unless required by applicable law or agreed to in writing, software
37
- * distributed under the License is distributed on an "AS IS" basis,
38
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
39
- * See the License for the specific language governing permissions and
40
- * limitations under the License.
41
- */
42
- class FormManagementService {
43
- constructor(http, configService) {
44
- this.http = http;
45
- this.configService = configService;
46
- this.valtimoApiConfig = configService.config.valtimoApi;
47
- }
48
- getFormDefinition(formDefinitionId) {
49
- return this.http.get(`${this.valtimoApiConfig.endpointUri}v1/form-management/${formDefinitionId}`);
50
- }
51
- existsFormDefinition(formDefinitionName) {
52
- return this.http.get(`${this.valtimoApiConfig.endpointUri}v1/form-management/exists/${formDefinitionName}`);
53
- }
54
- queryFormDefinitions(params) {
55
- return this.http.get(`${this.valtimoApiConfig.endpointUri}v1/form-management`, {
56
- observe: 'response',
57
- params,
58
- });
59
- }
60
- createFormDefinition(request) {
61
- return this.http.post(`${this.valtimoApiConfig.endpointUri}v1/form-management`, request);
62
- }
63
- modifyFormDefinition(request) {
64
- return this.http.put(`${this.valtimoApiConfig.endpointUri}v1/form-management`, request);
65
- }
66
- deleteFormDefinition(formDefinitionId) {
67
- return this.http.delete(`${this.valtimoApiConfig.endpointUri}v1/form-management/${formDefinitionId}`);
68
- }
69
- }
70
- FormManagementService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: FormManagementService, deps: [{ token: i1.HttpClient }, { token: i2.ConfigService }], target: i0.ɵɵFactoryTarget.Injectable });
71
- FormManagementService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: FormManagementService, providedIn: 'root' });
72
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: FormManagementService, decorators: [{
73
- type: Injectable,
74
- args: [{
75
- providedIn: 'root',
76
- }]
77
- }], ctorParameters: function () { return [{ type: i1.HttpClient }, { type: i2.ConfigService }]; } });
78
-
79
- /*
80
- * Copyright 2015-2023 Ritense BV, the Netherlands.
81
- *
82
- * Licensed under EUPL, Version 1.2 (the "License");
83
- * you may not use this file except in compliance with the License.
84
- * You may obtain a copy of the License at
85
- *
86
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
87
- *
88
- * Unless required by applicable law or agreed to in writing, software
89
- * distributed under the License is distributed on an "AS IS" basis,
90
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
91
- * See the License for the specific language governing permissions and
92
- * limitations under the License.
93
- */
94
- class FormManagementListComponent {
95
- constructor(formManagementService, router) {
96
- this.formManagementService = formManagementService;
97
- this.router = router;
98
- this.formDefinitions = [];
99
- this.formDefinitionFields = [
100
- { key: 'name', label: 'Name' },
101
- { key: 'readOnly', label: 'Read-only' },
102
- ];
103
- this.pagination = {
104
- collectionSize: 0,
105
- page: 1,
106
- size: 10,
107
- maxPaginationItemSize: 5,
108
- };
109
- this.pageParam = 0;
110
- }
111
- paginationClicked(page) {
112
- this.pageParam = page - 1;
113
- this.loadFormDefinitions();
114
- }
115
- ngOnInit() { }
116
- paginationSet() {
117
- this.loadFormDefinitions();
118
- }
119
- loadFormDefinitions(searchTerm) {
120
- const params = { page: this.pageParam, size: this.pagination.size };
121
- if (searchTerm) {
122
- params['searchTerm'] = searchTerm;
123
- }
124
- this.formManagementService.queryFormDefinitions(params).subscribe(results => {
125
- this.pagination.collectionSize = results.body.totalElements;
126
- this.formDefinitions = results.body.content;
127
- });
128
- }
129
- editFormDefinition(formDefinition) {
130
- this.router.navigate(['/form-management/edit', formDefinition.id]);
131
- }
132
- searchTermEntered(searchTerm) {
133
- this.loadFormDefinitions(searchTerm);
134
- }
135
- }
136
- FormManagementListComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: FormManagementListComponent, deps: [{ token: FormManagementService }, { token: i3.Router }], target: i0.ɵɵFactoryTarget.Component });
137
- FormManagementListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: FormManagementListComponent, selector: "valtimo-form-management-list", ngImport: i0, template: "<!--\n ~ Copyright 2015-2023 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-list\n [items]=\"formDefinitions\"\n [fields]=\"formDefinitionFields\"\n [viewMode]=\"true\"\n [isSearchable]=\"true\"\n [pagination]=\"pagination\"\n paginationIdentifier=\"formManagementList\"\n (paginationClicked)=\"paginationClicked($event)\"\n (paginationSet)=\"paginationSet()\"\n (rowClicked)=\"editFormDefinition($event)\"\n [header]=\"true\"\n (search)=\"searchTermEntered($event)\"\n>\n <div header>\n <h3 class=\"list-header-title\">{{ 'Forms' | translate }}</h3>\n <h5 class=\"list-header-description\">{{ 'Overview of all Forms' | translate }}</h5>\n </div>\n</valtimo-list>\n", styles: ["/*!\n * Copyright 2015-2023 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: "component", type: i2$1.ListComponent, selector: "valtimo-list", inputs: ["items", "fields", "pagination", "viewMode", "isSearchable", "header", "actions", "paginationIdentifier", "initialSortState", "lastColumnTemplate"], outputs: ["rowClicked", "paginationClicked", "paginationSet", "search", "sortChanged"] }, { kind: "pipe", type: i2$2.TranslatePipe, name: "translate" }] });
138
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: FormManagementListComponent, decorators: [{
139
- type: Component,
140
- args: [{ selector: 'valtimo-form-management-list', template: "<!--\n ~ Copyright 2015-2023 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-list\n [items]=\"formDefinitions\"\n [fields]=\"formDefinitionFields\"\n [viewMode]=\"true\"\n [isSearchable]=\"true\"\n [pagination]=\"pagination\"\n paginationIdentifier=\"formManagementList\"\n (paginationClicked)=\"paginationClicked($event)\"\n (paginationSet)=\"paginationSet()\"\n (rowClicked)=\"editFormDefinition($event)\"\n [header]=\"true\"\n (search)=\"searchTermEntered($event)\"\n>\n <div header>\n <h3 class=\"list-header-title\">{{ 'Forms' | translate }}</h3>\n <h5 class=\"list-header-description\">{{ 'Overview of all Forms' | translate }}</h5>\n </div>\n</valtimo-list>\n", styles: ["/*!\n * Copyright 2015-2023 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"] }]
141
- }], ctorParameters: function () { return [{ type: FormManagementService }, { type: i3.Router }]; } });
142
-
143
- /*
144
- * Copyright 2015-2023 Ritense BV, the Netherlands.
145
- *
146
- * Licensed under EUPL, Version 1.2 (the "License");
147
- * you may not use this file except in compliance with the License.
148
- * You may obtain a copy of the License at
149
- *
150
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
151
- *
152
- * Unless required by applicable law or agreed to in writing, software
153
- * distributed under the License is distributed on an "AS IS" basis,
154
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
155
- * See the License for the specific language governing permissions and
156
- * limitations under the License.
157
- */
158
- class FormManagementComponent {
159
- constructor() { }
160
- ngOnInit() { }
161
- }
162
- FormManagementComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: FormManagementComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
163
- FormManagementComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: FormManagementComponent, selector: "valtimo-form-management", ngImport: i0, template: "<!--\n ~ Copyright 2015-2023 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-2023 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.RouterLink, selector: ":not(a):not(area)[routerLink]", inputs: ["queryParams", "fragment", "queryParamsHandling", "state", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "component", type: i2$1.WidgetComponent, selector: "valtimo-widget", inputs: ["type", "name", "icon", "contrast", "divider", "title", "subtitle", "collapseAble", "collapse", "additionalClasses"] }, { kind: "component", type: FormManagementListComponent, selector: "valtimo-form-management-list" }, { kind: "pipe", type: i2$2.TranslatePipe, name: "translate" }] });
164
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: FormManagementComponent, decorators: [{
165
- type: Component,
166
- args: [{ selector: 'valtimo-form-management', template: "<!--\n ~ Copyright 2015-2023 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-2023 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"] }]
167
- }], ctorParameters: function () { return []; } });
168
-
169
- /*
170
- * Copyright 2015-2023 Ritense BV, the Netherlands.
171
- *
172
- * Licensed under EUPL, Version 1.2 (the "License");
173
- * you may not use this file except in compliance with the License.
174
- * You may obtain a copy of the License at
175
- *
176
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
177
- *
178
- * Unless required by applicable law or agreed to in writing, software
179
- * distributed under the License is distributed on an "AS IS" basis,
180
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
181
- * See the License for the specific language governing permissions and
182
- * limitations under the License.
183
- */
184
- function noDuplicateFormValidator(formManagementService) {
185
- return (control) => formManagementService
186
- .existsFormDefinition(control.value.toString())
187
- .pipe(map((result) => (result ? { duplicate: true } : null)));
188
- }
189
-
190
- /*
191
- * Copyright 2015-2023 Ritense BV, the Netherlands.
192
- *
193
- * Licensed under EUPL, Version 1.2 (the "License");
194
- * you may not use this file except in compliance with the License.
195
- * You may obtain a copy of the License at
196
- *
197
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
198
- *
199
- * Unless required by applicable law or agreed to in writing, software
200
- * distributed under the License is distributed on an "AS IS" basis,
201
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
202
- * See the License for the specific language governing permissions and
203
- * limitations under the License.
204
- */
205
- class FormManagementCreateComponent {
206
- constructor(formManagementService, formBuilder, router, alertService, route) {
207
- this.formManagementService = formManagementService;
208
- this.formBuilder = formBuilder;
209
- this.router = router;
210
- this.alertService = alertService;
211
- this.route = route;
212
- }
213
- get formControls() {
214
- return this.form.controls;
215
- }
216
- ngOnInit() {
217
- this.form = this.formBuilder.group({
218
- name: new FormControl('', Validators.required, [
219
- noDuplicateFormValidator(this.formManagementService),
220
- ]),
221
- });
222
- }
223
- reset() {
224
- this.form.setValue({
225
- name: '',
226
- });
227
- }
228
- createFormDefinition() {
229
- const emptyForm = {
230
- display: 'form',
231
- components: [],
232
- };
233
- const request = {
234
- name: this.form.value.name,
235
- formDefinition: JSON.stringify(emptyForm),
236
- };
237
- combineLatest([
238
- this.formManagementService.createFormDefinition(request),
239
- this.route.queryParams,
240
- ])
241
- .pipe(take(1))
242
- .subscribe(([formDefinition, params]) => {
243
- this.alertService.success('Created new Form');
244
- if ((params === null || params === void 0 ? void 0 : params.upload) === 'true') {
245
- this.router.navigate(['/form-management/edit', formDefinition.id], {
246
- queryParams: { upload: 'true' },
247
- });
248
- }
249
- else {
250
- this.router.navigate(['/form-management/edit', formDefinition.id]);
251
- }
252
- }, err => {
253
- this.alertService.error('Error creating new Form');
254
- });
255
- }
256
- }
257
- FormManagementCreateComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: FormManagementCreateComponent, deps: [{ token: FormManagementService }, { token: i2$3.FormBuilder }, { token: i3.Router }, { token: i2$1.AlertService }, { token: i3.ActivatedRoute }], target: i0.ɵɵFactoryTarget.Component });
258
- FormManagementCreateComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: FormManagementCreateComponent, selector: "valtimo-form-management-create", ngImport: i0, template: "<!--\n ~ Copyright 2015-2023 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-2023 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$3.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2$3.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$3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2$3.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i2$3.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2$3.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i2$1.WidgetComponent, selector: "valtimo-widget", inputs: ["type", "name", "icon", "contrast", "divider", "title", "subtitle", "collapseAble", "collapse", "additionalClasses"] }, { kind: "pipe", type: i2$2.TranslatePipe, name: "translate" }] });
259
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: FormManagementCreateComponent, decorators: [{
260
- type: Component,
261
- args: [{ selector: 'valtimo-form-management-create', template: "<!--\n ~ Copyright 2015-2023 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-2023 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"] }]
262
- }], ctorParameters: function () { return [{ type: FormManagementService }, { type: i2$3.FormBuilder }, { type: i3.Router }, { type: i2$1.AlertService }, { type: i3.ActivatedRoute }]; } });
263
-
264
- /*
265
- * Copyright 2015-2023 Ritense BV, the Netherlands.
266
- *
267
- * Licensed under EUPL, Version 1.2 (the "License");
268
- * you may not use this file except in compliance with the License.
269
- * You may obtain a copy of the License at
270
- *
271
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
272
- *
273
- * Unless required by applicable law or agreed to in writing, software
274
- * distributed under the License is distributed on an "AS IS" basis,
275
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
276
- * See the License for the specific language governing permissions and
277
- * limitations under the License.
278
- */
279
- class FormManagementDuplicateComponent extends BaseModal {
280
- constructor(formToDuplicate, modalService, formManagementService, alertService, route, router) {
281
- super();
282
- this.formToDuplicate = formToDuplicate;
283
- this.modalService = modalService;
284
- this.formManagementService = formManagementService;
285
- this.alertService = alertService;
286
- this.route = route;
287
- this.router = router;
288
- this.duplicateForm = new FormGroup({
289
- duplicateFormName: new FormControl(this.getDefaultName(), Validators.compose([Validators.required]), [noDuplicateFormValidator(this.formManagementService)]),
290
- });
291
- this.duplicateForm.markAllAsTouched();
292
- }
293
- duplicate() {
294
- const control = this.duplicateFormName;
295
- const request = {
296
- name: control.value.toString(),
297
- formDefinition: JSON.stringify(this.formToDuplicate.formDefinition),
298
- };
299
- combineLatest([
300
- this.formManagementService.createFormDefinition(request),
301
- this.route.queryParams,
302
- ])
303
- .pipe(take(1))
304
- .subscribe(([formDefinition, params]) => {
305
- this.alertService.success('Created new Form');
306
- this.router
307
- .navigateByUrl(`/form-management/edit/${formDefinition.id}`)
308
- .then(function (result) {
309
- window.location.reload();
310
- });
311
- }, err => {
312
- if (err.toString().includes('Duplicate name')) {
313
- control.setErrors({ duplicate: true });
314
- }
315
- else {
316
- control.setErrors({ incorrect: true });
317
- }
318
- });
319
- }
320
- get duplicateFormName() {
321
- return this.duplicateForm.controls['duplicateFormName'];
322
- }
323
- getDefaultName() {
324
- return this.formToDuplicate.name + '-duplicate';
325
- }
326
- }
327
- FormManagementDuplicateComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: FormManagementDuplicateComponent, deps: [{ token: 'formToDuplicate' }, { token: i1$1.ModalService }, { token: FormManagementService }, { token: i2$1.AlertService }, { token: i3.ActivatedRoute }, { token: i3.Router }], target: i0.ɵɵFactoryTarget.Component });
328
- FormManagementDuplicateComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: FormManagementDuplicateComponent, selector: "valtimo-form-management-duplicate-modal", usesInheritance: true, ngImport: i0, template: "<!--\n ~ Copyright 2015-2023 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<cds-modal\n valtimoCdsModal\n [open]=\"open\"\n (overlaySelected)=\"closeModal()\"\n [formGroup]=\"duplicateForm\"\n>\n <cds-modal-header (closeSelect)=\"closeModal()\">{{\n 'formManagement.duplicate' | translate\n }}</cds-modal-header>\n <section class=\"bx--modal-content p-2\">\n <cds-label labelState=\"error\">\n {{ 'formManagement.name' | translate }}\n <input cdsText formControlName=\"duplicateFormName\" [invalid]=\"duplicateFormName.invalid\" />\n </cds-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 <cds-modal-footer>\n <button cdsButton=\"secondary\" (click)=\"closeModal()\">\n {{ 'interface.cancel' | translate }}\n </button>\n <button\n cdsButton=\"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 </cds-modal-footer>\n</cds-modal>\n", styles: ["/*!\n * Copyright 2015-2023 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$3.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$3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2$3.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2$3.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i7.Modal, selector: "cds-modal, ibm-modal", inputs: ["size", "theme", "ariaLabel", "open", "trigger", "hasScrollingContent"], outputs: ["overlaySelected", "close"] }, { kind: "component", type: i7.ModalHeader, selector: "cds-modal-header, ibm-modal-header", inputs: ["theme", "closeLabel", "showCloseButton"], outputs: ["closeSelect"] }, { kind: "component", type: i7.ModalFooter, selector: "cds-modal-footer, ibm-modal-footer" }, { kind: "component", type: i7.Label, selector: "cds-label, ibm-label", inputs: ["labelInputID", "disabled", "skeleton", "helperText", "invalidText", "invalid", "warn", "warnText", "ariaLabel"] }, { kind: "directive", type: i7.TextInput, selector: "[cdsText], [ibmText]", inputs: ["theme", "size", "invalid", "warn", "skeleton"] }, { kind: "directive", type: i7.Button, selector: "[cdsButton], [ibmButton]", inputs: ["ibmButton", "cdsButton", "size", "skeleton", "iconOnly", "isExpressive"] }, { kind: "directive", type: i2$1.ValtimoCdsModalDirective, selector: "[valtimoCdsModal]" }, { kind: "pipe", type: i2$2.TranslatePipe, name: "translate" }] });
329
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: FormManagementDuplicateComponent, decorators: [{
330
- type: Component,
331
- args: [{ selector: 'valtimo-form-management-duplicate-modal', template: "<!--\n ~ Copyright 2015-2023 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<cds-modal\n valtimoCdsModal\n [open]=\"open\"\n (overlaySelected)=\"closeModal()\"\n [formGroup]=\"duplicateForm\"\n>\n <cds-modal-header (closeSelect)=\"closeModal()\">{{\n 'formManagement.duplicate' | translate\n }}</cds-modal-header>\n <section class=\"bx--modal-content p-2\">\n <cds-label labelState=\"error\">\n {{ 'formManagement.name' | translate }}\n <input cdsText formControlName=\"duplicateFormName\" [invalid]=\"duplicateFormName.invalid\" />\n </cds-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 <cds-modal-footer>\n <button cdsButton=\"secondary\" (click)=\"closeModal()\">\n {{ 'interface.cancel' | translate }}\n </button>\n <button\n cdsButton=\"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 </cds-modal-footer>\n</cds-modal>\n", styles: ["/*!\n * Copyright 2015-2023 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"] }]
332
- }], ctorParameters: function () {
333
- return [{ type: undefined, decorators: [{
334
- type: Inject,
335
- args: ['formToDuplicate']
336
- }] }, { type: i1$1.ModalService }, { type: FormManagementService }, { type: i2$1.AlertService }, { type: i3.ActivatedRoute }, { type: i3.Router }];
337
- } });
338
-
339
- /*
340
- * Copyright 2015-2023 Ritense BV, the Netherlands.
341
- *
342
- * Licensed under EUPL, Version 1.2 (the "License");
343
- * you may not use this file except in compliance with the License.
344
- * You may obtain a copy of the License at
345
- *
346
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
347
- *
348
- * Unless required by applicable law or agreed to in writing, software
349
- * distributed under the License is distributed on an "AS IS" basis,
350
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
351
- * See the License for the specific language governing permissions and
352
- * limitations under the License.
353
- */
354
- class FormManagementUploadComponent {
355
- constructor(documentService, translateService) {
356
- this.documentService = documentService;
357
- this.translateService = translateService;
358
- this.definitionUploaded = new EventEmitter();
359
- this.clear$ = new Subject();
360
- this.jsonString$ = new BehaviorSubject('');
361
- this.error$ = new BehaviorSubject('');
362
- this.disabled$ = new BehaviorSubject(false);
363
- this.file$ = new BehaviorSubject(undefined);
364
- }
365
- ngAfterViewInit() {
366
- this.openShowSubscription();
367
- this.openFileSubscription();
368
- }
369
- ngOnDestroy() {
370
- this.showSubscription.unsubscribe();
371
- this.fileSubscription.unsubscribe();
372
- this.closeErrorSubscription();
373
- }
374
- setFile(file) {
375
- this.clearError();
376
- this.file$.next(file);
377
- }
378
- uploadDefinition() {
379
- this.disable();
380
- this.jsonString$.pipe(take(1)).subscribe(definition => {
381
- this.closeErrorSubscription();
382
- this.clearError();
383
- this.enable();
384
- this.hideModal();
385
- this.definitionUploaded.emit(definition);
386
- });
387
- }
388
- openErrorSubscription(errorCode) {
389
- this.closeErrorSubscription();
390
- this.errorSubscription = this.translateService.stream(errorCode).subscribe(error => {
391
- this.error$.next(error);
392
- });
393
- }
394
- closeErrorSubscription() {
395
- if (this.errorSubscription) {
396
- this.errorSubscription.unsubscribe();
397
- }
398
- }
399
- clearError() {
400
- this.error$.next('');
401
- }
402
- openFileSubscription() {
403
- this.fileSubscription = this.file$.subscribe(file => {
404
- if (file) {
405
- const reader = new FileReader();
406
- reader.onloadend = () => {
407
- const result = reader.result.toString();
408
- if (this.stringIsValidJson(result)) {
409
- this.jsonString$.next(result);
410
- }
411
- else {
412
- this.clearJsonString();
413
- this.error$.next(this.translateService.instant('dropzone.error.invalidJson'));
414
- }
415
- };
416
- reader.readAsText(file);
417
- }
418
- else {
419
- this.clearJsonString();
420
- }
421
- });
422
- }
423
- openShowSubscription() {
424
- this.showSubscription = this.show$.subscribe(show => {
425
- if (show) {
426
- this.showModal();
427
- }
428
- else {
429
- this.hideModal();
430
- }
431
- this.clearJsonString();
432
- this.clearError();
433
- this.clearDropzone();
434
- });
435
- }
436
- clearJsonString() {
437
- this.jsonString$.next('');
438
- }
439
- clearDropzone() {
440
- this.clear$.next(null);
441
- }
442
- showModal() {
443
- this.modal.show();
444
- }
445
- hideModal() {
446
- this.modal.hide();
447
- }
448
- stringIsValidJson(string) {
449
- var _a, _b;
450
- try {
451
- // eslint-disable-next-line @typescript-eslint/no-unused-expressions
452
- (_b = (_a = JSON.parse(string)) === null || _a === void 0 ? void 0 : _a.formDefinition) === null || _b === void 0 ? void 0 : _b.components;
453
- }
454
- catch (e) {
455
- this.clearDropzone();
456
- this.openErrorSubscription('dropzone.error.invalidFormDef');
457
- return false;
458
- }
459
- return true;
460
- }
461
- disable() {
462
- this.disabled$.next(true);
463
- }
464
- enable() {
465
- this.disabled$.next(false);
466
- }
467
- }
468
- FormManagementUploadComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: FormManagementUploadComponent, deps: [{ token: i1$2.DocumentService }, { token: i2$2.TranslateService }], target: i0.ɵɵFactoryTarget.Component });
469
- FormManagementUploadComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", 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-2023 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-2023 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: i2$1.DropzoneComponent, selector: "valtimo-dropzone", inputs: ["title", "hideTitle", "subtitle", "externalError$", "maxFileSize", "showMaxFileSize", "acceptedFiles", "clear$", "disabled", "hideFilePreview", "uploading", "camera", "maxFiles"], outputs: ["fileSelected"] }, { kind: "component", type: i2$1.ModalComponent, selector: "valtimo-modal", inputs: ["elementId", "title", "subtitle", "templateBelowSubtitle", "showFooter"] }, { kind: "pipe", type: i5.AsyncPipe, name: "async" }, { kind: "pipe", type: i2$2.TranslatePipe, name: "translate" }] });
470
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: FormManagementUploadComponent, decorators: [{
471
- type: Component,
472
- args: [{ selector: 'valtimo-form-management-upload', template: "<!--\n ~ Copyright 2015-2023 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-2023 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"] }]
473
- }], ctorParameters: function () { return [{ type: i1$2.DocumentService }, { type: i2$2.TranslateService }]; }, propDecorators: { modal: [{
474
- type: ViewChild,
475
- args: ['uploadFormDefinitionModal']
476
- }], show$: [{
477
- type: Input
478
- }], definitionUploaded: [{
479
- type: Output
480
- }] } });
481
-
482
- /*
483
- * Copyright 2015-2023 Ritense BV, the Netherlands.
484
- *
485
- * Licensed under EUPL, Version 1.2 (the "License");
486
- * you may not use this file except in compliance with the License.
487
- * You may obtain a copy of the License at
488
- *
489
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
490
- *
491
- * Unless required by applicable law or agreed to in writing, software
492
- * distributed under the License is distributed on an "AS IS" basis,
493
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
494
- * See the License for the specific language governing permissions and
495
- * limitations under the License.
496
- */
497
- class FormManagementEditComponent {
498
- constructor(formManagementService, alertService, route, router, modalService, pageTitleService) {
499
- this.formManagementService = formManagementService;
500
- this.alertService = alertService;
501
- this.route = route;
502
- this.router = router;
503
- this.modalService = modalService;
504
- this.pageTitleService = pageTitleService;
505
- this.showModal$ = new BehaviorSubject(false);
506
- this.reloading$ = new BehaviorSubject(false);
507
- this.modifiedFormDefinition = null;
508
- this.formDefinition = null;
509
- this.alertSub = Subscription.EMPTY;
510
- this.formDefinitionId = null;
511
- }
512
- ngOnInit() {
513
- this.loadFormDefinition();
514
- this.checkToOpenUploadModal();
515
- }
516
- ngOnDestroy() {
517
- this.alertSub.unsubscribe();
518
- }
519
- loadFormDefinition() {
520
- this.formDefinitionId = this.route.snapshot.paramMap.get('id');
521
- this.formManagementService.getFormDefinition(this.formDefinitionId).subscribe(formDefinition => {
522
- this.formDefinition = formDefinition;
523
- this.pageTitleService.setCustomPageTitle(formDefinition.name);
524
- }, () => {
525
- this.alertService.error('Error retrieving Form Definition');
526
- });
527
- }
528
- modifyFormDefinition() {
529
- const form = JSON.stringify(this.modifiedFormDefinition != null
530
- ? this.modifiedFormDefinition
531
- : this.formDefinition.formDefinition);
532
- const request = {
533
- id: this.formDefinition.id,
534
- name: this.formDefinition.name,
535
- formDefinition: form,
536
- };
537
- this.formManagementService.modifyFormDefinition(request).subscribe(() => {
538
- this.router.navigate(['/form-management']);
539
- this.alertService.success('Form deployed');
540
- }, err => {
541
- this.alertService.error('Error deploying Form');
542
- });
543
- }
544
- formBuilderChanged(event) {
545
- this.modifiedFormDefinition = event.form;
546
- }
547
- delete() {
548
- if (!this.alertSub.closed) {
549
- return;
550
- }
551
- const mssg = 'Delete Form?';
552
- const confirmations = [
553
- {
554
- label: 'Cancel',
555
- class: 'btn btn-default',
556
- value: false,
557
- },
558
- {
559
- label: 'Delete',
560
- class: 'btn btn-primary',
561
- value: true,
562
- },
563
- ];
564
- this.alertService.notification(mssg, confirmations);
565
- this.alertSub = this.alertService
566
- .getAlertConfirmChangeEmitter()
567
- .pipe(first())
568
- .subscribe(alert => {
569
- if (alert.confirm === true) {
570
- this.deleteFormDefinition();
571
- }
572
- });
573
- }
574
- deleteFormDefinition() {
575
- this.formManagementService.deleteFormDefinition(this.formDefinition.id).subscribe(() => {
576
- this.router.navigate(['/form-management']);
577
- this.alertService.success('Form deleted');
578
- }, err => {
579
- this.alertService.error('Error deleting Form');
580
- });
581
- }
582
- downloadFormDefinition() {
583
- const file = new Blob([JSON.stringify(this.formDefinition.formDefinition)], {
584
- type: 'text/json',
585
- });
586
- const link = document.createElement('a');
587
- link.download = `form_${this.formDefinition.name}.json`;
588
- link.href = window.URL.createObjectURL(file);
589
- link.click();
590
- window.URL.revokeObjectURL(link.href);
591
- link.remove();
592
- }
593
- showUploadModal() {
594
- this.showModal$.next(true);
595
- }
596
- showDuplicateModal() {
597
- this.modalService.create({
598
- component: FormManagementDuplicateComponent,
599
- inputs: {
600
- formToDuplicate: this.formDefinition,
601
- },
602
- });
603
- }
604
- setFormDefinition(formDefinition) {
605
- var _a;
606
- this.reloading$.next(true);
607
- const definition = JSON.parse(formDefinition);
608
- const components = (_a = definition === null || definition === void 0 ? void 0 : definition.formDefinition) === null || _a === void 0 ? void 0 : _a.components;
609
- const currentDefinition = this.modifiedFormDefinition || this.formDefinition.formDefinition;
610
- const newDefinition = Object.assign(Object.assign({}, currentDefinition), (components && { components }));
611
- this.modifiedFormDefinition = newDefinition;
612
- this.formDefinition.formDefinition = newDefinition;
613
- this.reloading$.next(false);
614
- }
615
- checkToOpenUploadModal() {
616
- this.route.queryParams.pipe(take(1)).subscribe(params => {
617
- if ((params === null || params === void 0 ? void 0 : params.upload) === 'true') {
618
- this.showUploadModal();
619
- }
620
- });
621
- }
622
- }
623
- FormManagementEditComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: FormManagementEditComponent, deps: [{ token: FormManagementService }, { token: i2$1.AlertService }, { token: i3.ActivatedRoute }, { token: i3.Router }, { token: i7.ModalService }, { token: i2$1.PageTitleService }], target: i0.ɵɵFactoryTarget.Component });
624
- FormManagementEditComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: FormManagementEditComponent, selector: "valtimo-form-management-edit", ngImport: i0, template: "<!--\n ~ Copyright 2015-2023 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 <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<cds-placeholder></cds-placeholder>\n", styles: ["/*!\n * Copyright 2015-2023 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: i2$1.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: "cds-placeholder, 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$2.TranslatePipe, name: "translate" }], encapsulation: i0.ViewEncapsulation.None });
625
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: FormManagementEditComponent, decorators: [{
626
- type: Component,
627
- args: [{ selector: 'valtimo-form-management-edit', encapsulation: ViewEncapsulation.None, template: "<!--\n ~ Copyright 2015-2023 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 <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<cds-placeholder></cds-placeholder>\n", styles: ["/*!\n * Copyright 2015-2023 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"] }]
628
- }], ctorParameters: function () { return [{ type: FormManagementService }, { type: i2$1.AlertService }, { type: i3.ActivatedRoute }, { type: i3.Router }, { type: i7.ModalService }, { type: i2$1.PageTitleService }]; } });
629
-
630
- /*
631
- * Copyright 2015-2023 Ritense BV, the Netherlands.
632
- *
633
- * Licensed under EUPL, Version 1.2 (the "License");
634
- * you may not use this file except in compliance with the License.
635
- * You may obtain a copy of the License at
636
- *
637
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
638
- *
639
- * Unless required by applicable law or agreed to in writing, software
640
- * distributed under the License is distributed on an "AS IS" basis,
641
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
642
- * See the License for the specific language governing permissions and
643
- * limitations under the License.
644
- */
645
- const routes = [
646
- {
647
- path: 'form-management',
648
- component: FormManagementComponent,
649
- canActivate: [AuthGuardService],
650
- data: { title: 'Forms', roles: [ROLE_ADMIN] },
651
- },
652
- {
653
- path: 'form-management/create',
654
- component: FormManagementCreateComponent,
655
- canActivate: [AuthGuardService],
656
- data: { title: 'Create new Form', roles: [ROLE_ADMIN] },
657
- },
658
- {
659
- path: 'form-management/edit/:id',
660
- component: FormManagementEditComponent,
661
- canActivate: [AuthGuardService],
662
- data: { title: 'Form Builder', roles: [ROLE_ADMIN], customPageTitle: true },
663
- },
664
- ];
665
- class FormManagementRoutingModule {
666
- }
667
- FormManagementRoutingModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: FormManagementRoutingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
668
- FormManagementRoutingModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: FormManagementRoutingModule, imports: [i3.RouterModule], exports: [RouterModule] });
669
- FormManagementRoutingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: FormManagementRoutingModule, imports: [RouterModule.forChild(routes), RouterModule] });
670
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: FormManagementRoutingModule, decorators: [{
671
- type: NgModule,
672
- args: [{
673
- imports: [RouterModule.forChild(routes)],
674
- exports: [RouterModule],
675
- declarations: [],
676
- }]
677
- }] });
678
-
679
- /*
680
- * Copyright 2015-2023 Ritense BV, the Netherlands.
681
- *
682
- * Licensed under EUPL, Version 1.2 (the "License");
683
- * you may not use this file except in compliance with the License.
684
- * You may obtain a copy of the License at
685
- *
686
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
687
- *
688
- * Unless required by applicable law or agreed to in writing, software
689
- * distributed under the License is distributed on an "AS IS" basis,
690
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
691
- * See the License for the specific language governing permissions and
692
- * limitations under the License.
693
- */
694
- class FormManagementModule {
695
- }
696
- FormManagementModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: FormManagementModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
697
- FormManagementModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: FormManagementModule, declarations: [FormManagementComponent,
698
- FormManagementCreateComponent,
699
- FormManagementListComponent,
700
- FormManagementEditComponent,
701
- FormManagementUploadComponent,
702
- FormManagementDuplicateComponent], imports: [FormManagementRoutingModule,
703
- FormIoModule,
704
- CommonModule,
705
- ReactiveFormsModule,
706
- FormsModule,
707
- WidgetModule,
708
- ListModule,
709
- TranslateModule,
710
- NgbTooltipModule,
711
- DropzoneModule,
712
- ModalModule,
713
- ModalModule$1,
714
- ModalModule$2,
715
- InputModule,
716
- TitleModule,
717
- ButtonModule,
718
- InputModule$1,
719
- FormModule,
720
- ModalModule,
721
- InputModule$1,
722
- PlaceholderModule,
723
- ButtonModule$1,
724
- ValtimoCdsModalDirectiveModule], exports: [FormManagementComponent] });
725
- FormManagementModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: FormManagementModule, imports: [FormManagementRoutingModule,
726
- FormIoModule,
727
- CommonModule,
728
- ReactiveFormsModule,
729
- FormsModule,
730
- WidgetModule,
731
- ListModule,
732
- TranslateModule,
733
- NgbTooltipModule,
734
- DropzoneModule,
735
- ModalModule,
736
- ModalModule$1,
737
- ModalModule$2,
738
- InputModule,
739
- TitleModule,
740
- ButtonModule,
741
- InputModule$1,
742
- FormModule,
743
- ModalModule,
744
- InputModule$1,
745
- PlaceholderModule,
746
- ButtonModule$1,
747
- ValtimoCdsModalDirectiveModule] });
748
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: FormManagementModule, decorators: [{
749
- type: NgModule,
750
- args: [{
751
- declarations: [
752
- FormManagementComponent,
753
- FormManagementCreateComponent,
754
- FormManagementListComponent,
755
- FormManagementEditComponent,
756
- FormManagementUploadComponent,
757
- FormManagementDuplicateComponent,
758
- ],
759
- imports: [
760
- FormManagementRoutingModule,
761
- FormIoModule,
762
- CommonModule,
763
- ReactiveFormsModule,
764
- FormsModule,
765
- WidgetModule,
766
- ListModule,
767
- TranslateModule,
768
- NgbTooltipModule,
769
- DropzoneModule,
770
- ModalModule,
771
- ModalModule$1,
772
- ModalModule$2,
773
- InputModule,
774
- TitleModule,
775
- ButtonModule,
776
- InputModule$1,
777
- FormModule,
778
- ModalModule,
779
- InputModule$1,
780
- PlaceholderModule,
781
- ButtonModule$1,
782
- ValtimoCdsModalDirectiveModule,
783
- ],
784
- exports: [FormManagementComponent],
785
- }]
786
- }] });
787
-
788
- /*
789
- * Copyright 2015-2023 Ritense BV, the Netherlands.
790
- *
791
- * Licensed under EUPL, Version 1.2 (the "License");
792
- * you may not use this file except in compliance with the License.
793
- * You may obtain a copy of the License at
794
- *
795
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
796
- *
797
- * Unless required by applicable law or agreed to in writing, software
798
- * distributed under the License is distributed on an "AS IS" basis,
799
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
800
- * See the License for the specific language governing permissions and
801
- * limitations under the License.
802
- */
803
- function compareFormDefinitions(fd1, fd2) {
804
- if (fd1 === null && fd2 === null) {
805
- return true;
806
- }
807
- if (fd1 === null || fd2 === null) {
808
- return false;
809
- }
810
- return fd1.id === fd2.id;
811
- }
812
-
813
- /*
814
- * Copyright 2015-2023 Ritense BV, the Netherlands.
815
- *
816
- * Licensed under EUPL, Version 1.2 (the "License");
817
- * you may not use this file except in compliance with the License.
818
- * You may obtain a copy of the License at
819
- *
820
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
821
- *
822
- * Unless required by applicable law or agreed to in writing, software
823
- * distributed under the License is distributed on an "AS IS" basis,
824
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
825
- * See the License for the specific language governing permissions and
826
- * limitations under the License.
827
- */
828
-
829
- /*
830
- * Copyright 2015-2023 Ritense BV, the Netherlands.
831
- *
832
- * Licensed under EUPL, Version 1.2 (the "License");
833
- * you may not use this file except in compliance with the License.
834
- * You may obtain a copy of the License at
835
- *
836
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
837
- *
838
- * Unless required by applicable law or agreed to in writing, software
839
- * distributed under the License is distributed on an "AS IS" basis,
840
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
841
- * See the License for the specific language governing permissions and
842
- * limitations under the License.
843
- */
844
-
845
- /**
846
- * Generated bundle index. Do not edit.
847
- */
848
-
849
- export { FormManagementComponent, FormManagementModule, FormManagementService, compareFormDefinitions };
850
- //# sourceMappingURL=valtimo-form-management.mjs.map