@valtimo/form-management 12.19.0 → 13.0.1-next-minor.81

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 (77) hide show
  1. package/fesm2022/valtimo-form-management.mjs +846 -563
  2. package/fesm2022/valtimo-form-management.mjs.map +1 -1
  3. package/lib/components/form-management/form-management.component.d.ts +24 -0
  4. package/lib/components/form-management/form-management.component.d.ts.map +1 -0
  5. package/lib/components/form-management-create/form-management-create.component.d.ts +28 -0
  6. package/lib/components/form-management-create/form-management-create.component.d.ts.map +1 -0
  7. package/lib/components/form-management-create/index.d.ts +2 -0
  8. package/lib/components/form-management-create/index.d.ts.map +1 -0
  9. package/lib/components/form-management-duplicate/form-management-duplicate.component.d.ts +31 -0
  10. package/lib/components/form-management-duplicate/form-management-duplicate.component.d.ts.map +1 -0
  11. package/lib/components/form-management-duplicate/index.d.ts +2 -0
  12. package/lib/components/form-management-duplicate/index.d.ts.map +1 -0
  13. package/lib/components/form-management-edit/form-management-edit.component.d.ts +83 -0
  14. package/lib/components/form-management-edit/form-management-edit.component.d.ts.map +1 -0
  15. package/lib/components/form-management-edit/index.d.ts +2 -0
  16. package/lib/components/form-management-edit/index.d.ts.map +1 -0
  17. package/lib/components/form-management-list/form-management-list.component.d.ts +50 -0
  18. package/lib/components/form-management-list/form-management-list.component.d.ts.map +1 -0
  19. package/lib/components/form-management-list/index.d.ts +2 -0
  20. package/lib/components/form-management-list/index.d.ts.map +1 -0
  21. package/lib/components/form-management-upload/form-management-upload.component.d.ts +28 -0
  22. package/lib/components/form-management-upload/form-management-upload.component.d.ts.map +1 -0
  23. package/lib/components/form-management-upload/index.d.ts +2 -0
  24. package/lib/components/form-management-upload/index.d.ts.map +1 -0
  25. package/lib/components/index.d.ts +6 -0
  26. package/lib/components/index.d.ts.map +1 -0
  27. package/lib/form-management.module.d.ts +8 -13
  28. package/lib/form-management.module.d.ts.map +1 -1
  29. package/lib/models/form-definition.model.d.ts +14 -0
  30. package/lib/models/form-definition.model.d.ts.map +1 -1
  31. package/lib/models/form-management.model.d.ts +11 -0
  32. package/lib/models/form-management.model.d.ts.map +1 -0
  33. package/lib/models/index.d.ts +1 -0
  34. package/lib/models/index.d.ts.map +1 -1
  35. package/lib/services/form-management.service.d.ts +13 -8
  36. package/lib/services/form-management.service.d.ts.map +1 -1
  37. package/lib/services/index.d.ts +0 -1
  38. package/lib/services/index.d.ts.map +1 -1
  39. package/lib/utils/form-management.utils.d.ts +6 -0
  40. package/lib/utils/form-management.utils.d.ts.map +1 -0
  41. package/lib/utils/index.d.ts +2 -0
  42. package/lib/utils/index.d.ts.map +1 -0
  43. package/lib/validators/no-duplicate-form.validator.d.ts +3 -1
  44. package/lib/validators/no-duplicate-form.validator.d.ts.map +1 -1
  45. package/package.json +4 -6
  46. package/public-api.d.ts +3 -2
  47. package/public-api.d.ts.map +1 -1
  48. package/esm2022/lib/form-management-create/form-management-create.component.mjs +0 -86
  49. package/esm2022/lib/form-management-duplicate/form-management-duplicate.component.mjs +0 -87
  50. package/esm2022/lib/form-management-edit/form-management-edit.component.mjs +0 -233
  51. package/esm2022/lib/form-management-routing.module.mjs +0 -59
  52. package/esm2022/lib/form-management-upload/form-management-upload.component.mjs +0 -150
  53. package/esm2022/lib/form-management.component.mjs +0 -80
  54. package/esm2022/lib/form-management.module.mjs +0 -148
  55. package/esm2022/lib/models/form-definition.model.mjs +0 -25
  56. package/esm2022/lib/models/form-edit-tabs.enum.mjs +0 -22
  57. package/esm2022/lib/models/index.mjs +0 -18
  58. package/esm2022/lib/services/form-management-state.service.mjs +0 -59
  59. package/esm2022/lib/services/form-management.service.mjs +0 -56
  60. package/esm2022/lib/services/index.mjs +0 -18
  61. package/esm2022/lib/validators/no-duplicate-form.validator.mjs +0 -22
  62. package/esm2022/public-api.mjs +0 -23
  63. package/esm2022/valtimo-form-management.mjs +0 -5
  64. package/lib/form-management-create/form-management-create.component.d.ts +0 -24
  65. package/lib/form-management-create/form-management-create.component.d.ts.map +0 -1
  66. package/lib/form-management-duplicate/form-management-duplicate.component.d.ts +0 -24
  67. package/lib/form-management-duplicate/form-management-duplicate.component.d.ts.map +0 -1
  68. package/lib/form-management-edit/form-management-edit.component.d.ts +0 -61
  69. package/lib/form-management-edit/form-management-edit.component.d.ts.map +0 -1
  70. package/lib/form-management-routing.module.d.ts +0 -8
  71. package/lib/form-management-routing.module.d.ts.map +0 -1
  72. package/lib/form-management-upload/form-management-upload.component.d.ts +0 -41
  73. package/lib/form-management-upload/form-management-upload.component.d.ts.map +0 -1
  74. package/lib/form-management.component.d.ts +0 -23
  75. package/lib/form-management.component.d.ts.map +0 -1
  76. package/lib/services/form-management-state.service.d.ts +0 -19
  77. package/lib/services/form-management-state.service.d.ts.map +0 -1
@@ -1,30 +1,27 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Injectable, Component, Inject, EventEmitter, Output, Input, ViewChild, HostBinding, ViewEncapsulation, NgModule } from '@angular/core';
2
+ import { Injectable, EventEmitter, Output, Input, Component, Inject, ChangeDetectionStrategy, HostBinding, ViewEncapsulation, NgModule } from '@angular/core';
3
+ import { of, map as map$1, switchMap, tap, BehaviorSubject, startWith, Subscription, combineLatest, filter as filter$1, take as take$1 } from 'rxjs';
4
+ import * as i4 from '@valtimo/shared';
5
+ import { BaseApiService, getCaseManagementRouteParams, getCaseManagementRouteParamsAndContext, ROLE_ADMIN, RouterUtils } from '@valtimo/shared';
3
6
  import * as i1 from '@angular/common/http';
4
- import * as i2 from '@valtimo/config';
5
- import { ROLE_ADMIN, RouterUtils } from '@valtimo/config';
6
- import { Subject, BehaviorSubject, take, map, combineLatest, filter, distinctUntilChanged, tap, Subscription, switchMap } from 'rxjs';
7
- import { Upload16 } from '@carbon/icons';
8
- import * as i3 from 'carbon-components-angular';
9
- import { ModalModule, InputModule as InputModule$1, PlaceholderModule, ButtonModule as ButtonModule$1, DialogModule, TabsModule, IconModule, TagModule } from 'carbon-components-angular';
10
- import * as i3$1 from '@angular/router';
11
- import { RouterModule } from '@angular/router';
12
- import * as i1$1 from '@valtimo/components';
13
- import { PendingChangesComponent, pendingChangesGuard, FormIoModule, WidgetModule, ListModule, DropzoneModule, VModalModule, ModalModule as ModalModule$1, InputModule, TitleModule, ButtonModule, FormModule, ValtimoCdsModalDirectiveModule, CarbonListModule, RenderInPageHeaderDirectiveModule, EditorModule, SpinnerModule, ConfirmationModalModule } from '@valtimo/components';
14
- import * as i2$1 from '@ngx-translate/core';
7
+ import * as i7 from '@angular/common';
8
+ import { CommonModule } from '@angular/common';
9
+ import * as i3 from '@angular/router';
10
+ import { RouterOutlet, RouterModule } from '@angular/router';
11
+ import * as i2$1 from 'carbon-components-angular';
12
+ import { ButtonModule, InputModule, TilesModule, LayerModule, ModalModule, BaseModal, FileUploaderModule, TabsModule, DialogModule, TagModule, IconModule, LoadingModule } from 'carbon-components-angular';
13
+ import * as i2 from '@angular/forms';
14
+ import { FormControl, Validators, ReactiveFormsModule, FormGroup, FormsModule } from '@angular/forms';
15
+ import * as i5 from '@ngx-translate/core';
15
16
  import { TranslateModule } from '@ngx-translate/core';
17
+ import * as i3$1 from '@valtimo/components';
18
+ import { WidgetModule, ValtimoCdsModalDirective, CARBON_CONSTANTS, CarbonListModule, EditorModule, FormIoModule, RenderInPageHeaderDirective, ConfirmationModalModule, SpinnerModule, ViewType } from '@valtimo/components';
19
+ import { map, filter, take, switchMap as switchMap$1, distinctUntilChanged, tap as tap$1 } from 'rxjs/operators';
20
+ import { ArrowLeft16, Upload16 } from '@carbon/icons';
16
21
  import { AuthGuardService } from '@valtimo/security';
17
- import * as i2$2 from '@angular/forms';
18
- import { FormControl, Validators, FormGroup, ReactiveFormsModule, FormsModule } from '@angular/forms';
19
- import { take as take$1 } from 'rxjs/operators';
20
- import * as i5 from '@angular/common';
21
- import { CommonModule } from '@angular/common';
22
- import { BaseModal } from 'carbon-components-angular/modal';
23
- import * as i1$2 from '@valtimo/document';
24
- import { NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap';
25
22
 
26
23
  /*
27
- * Copyright 2015-2024 Ritense BV, the Netherlands.
24
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
28
25
  *
29
26
  * Licensed under EUPL, Version 1.2 (the "License");
30
27
  * you may not use this file except in compliance with the License.
@@ -38,101 +35,72 @@ import { NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap';
38
35
  * See the License for the specific language governing permissions and
39
36
  * limitations under the License.
40
37
  */
41
- class FormManagementService {
42
- constructor(http, configService) {
43
- this.http = http;
38
+ class FormManagementService extends BaseApiService {
39
+ constructor(httpClient, configService) {
40
+ super(httpClient, configService);
41
+ this.httpClient = httpClient;
44
42
  this.configService = configService;
45
- this.valtimoApiConfig = configService.config.valtimoApi;
46
43
  }
47
44
  getFormDefinition(formDefinitionId) {
48
- return this.http.get(`${this.valtimoApiConfig.endpointUri}v1/form-management/${formDefinitionId}`);
45
+ return this.httpClient.get(this.getApiUrl(`/management/v1/form/${formDefinitionId}`));
46
+ }
47
+ getFormDefinitionCase(caseDefinitionKey, caseDefinitionVersionTag, formDefinitionId) {
48
+ return this.httpClient.get(this.getApiUrl(`/management/v1/case-definition/${caseDefinitionKey}/version/${caseDefinitionVersionTag}/form/${formDefinitionId}`));
49
49
  }
50
50
  existsFormDefinition(formDefinitionName) {
51
- return this.http.get(`${this.valtimoApiConfig.endpointUri}v1/form-management/exists/${formDefinitionName}`);
51
+ if (!formDefinitionName)
52
+ return of(false);
53
+ return this.httpClient.get(this.getApiUrl(`/management/v1/form/exists/${formDefinitionName}`));
54
+ }
55
+ existsFormDefinitionCase(caseDefinitionKey, caseDefinitionVersionTag, formDefinitionName) {
56
+ if (!formDefinitionName || !caseDefinitionKey || !caseDefinitionVersionTag)
57
+ return of(false);
58
+ return this.httpClient.get(this.getApiUrl(`management/v1/case-definition/${caseDefinitionKey}/version/${caseDefinitionVersionTag}/form/${formDefinitionName}/exists`));
52
59
  }
53
60
  queryFormDefinitions(params) {
54
- return this.http.get(`${this.valtimoApiConfig.endpointUri}v1/form-management`, {
55
- observe: 'response',
61
+ return this.httpClient.get(this.getApiUrl(`/management/v1/form`), {
62
+ params,
63
+ });
64
+ }
65
+ queryFormDefinitionsCase(caseDefinitionKey, caseDefinitionVersionTag, params) {
66
+ return this.httpClient.get(this.getApiUrl(`/management/v1/case-definition/${caseDefinitionKey}/version/${caseDefinitionVersionTag}/form`), {
56
67
  params,
57
68
  });
58
69
  }
59
70
  createFormDefinition(request) {
60
- return this.http.post(`${this.valtimoApiConfig.endpointUri}v1/form-management`, request);
71
+ return this.httpClient.post(this.getApiUrl(`/management/v1/form`), request);
72
+ }
73
+ createFormDefinitionsCase(caseDefinitionKey, caseDefinitionVersionTag, request) {
74
+ return this.httpClient.post(this.getApiUrl(`/management/v1/case-definition/${caseDefinitionKey}/version/${caseDefinitionVersionTag}/form`), request);
61
75
  }
62
76
  modifyFormDefinition(request) {
63
- return this.http.put(`${this.valtimoApiConfig.endpointUri}v1/form-management`, request);
77
+ return this.httpClient.put(this.getApiUrl(`/management/v1/form`), request);
78
+ }
79
+ modifyFormDefinitionCase(caseDefinitionKey, caseDefinitionVersionTag, request) {
80
+ return this.httpClient.put(this.getApiUrl(`/management/v1/case-definition/${caseDefinitionKey}/version/${caseDefinitionVersionTag}/form`), request);
64
81
  }
65
82
  deleteFormDefinition(formDefinitionId) {
66
- return this.http.delete(`${this.valtimoApiConfig.endpointUri}v1/form-management/${formDefinitionId}`);
83
+ return this.httpClient.delete(this.getApiUrl(`/management/v1/form/${formDefinitionId}`));
84
+ }
85
+ deleteFormDefinitionCase(caseDefinitionKey, caseDefinitionVersionTag, formDefinitionId) {
86
+ return this.httpClient.delete(this.getApiUrl(`/management/v1/case-definition/${caseDefinitionKey}/version/${caseDefinitionVersionTag}/form/${formDefinitionId}`));
67
87
  }
68
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FormManagementService, deps: [{ token: i1.HttpClient }, { token: i2.ConfigService }], target: i0.ɵɵFactoryTarget.Injectable }); }
69
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FormManagementService, providedIn: 'root' }); }
88
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: FormManagementService, deps: [{ token: i1.HttpClient }, { token: i4.ConfigService }], target: i0.ɵɵFactoryTarget.Injectable }); }
89
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: FormManagementService, providedIn: 'root' }); }
70
90
  }
71
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FormManagementService, decorators: [{
91
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: FormManagementService, decorators: [{
72
92
  type: Injectable,
73
93
  args: [{
74
94
  providedIn: 'root',
75
95
  }]
76
- }], ctorParameters: () => [{ type: i1.HttpClient }, { type: i2.ConfigService }] });
96
+ }], ctorParameters: () => [{ type: i1.HttpClient }, { type: i4.ConfigService }] });
77
97
 
78
- /*
79
- * Copyright 2015-2024 Ritense BV, the Netherlands.
80
- *
81
- * Licensed under EUPL, Version 1.2 (the "License");
82
- * you may not use this file except in compliance with the License.
83
- * You may obtain a copy of the License at
84
- *
85
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
86
- *
87
- * Unless required by applicable law or agreed to in writing, software
88
- * distributed under the License is distributed on an "AS IS" basis,
89
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
90
- * See the License for the specific language governing permissions and
91
- * limitations under the License.
92
- */
93
- class FormManagementStateService {
94
- constructor() {
95
- this._showModal$ = new Subject();
96
- this._hideModal$ = new Subject();
97
- this._refresh$ = new BehaviorSubject(null);
98
- this._modalType$ = new BehaviorSubject('add');
99
- }
100
- get showModal$() {
101
- return this._showModal$.asObservable();
102
- }
103
- get hideModal$() {
104
- return this._hideModal$.asObservable();
105
- }
106
- get refresh$() {
107
- return this._refresh$.asObservable();
108
- }
109
- get modalType$() {
110
- return this._modalType$.asObservable();
111
- }
112
- showModal() {
113
- this._showModal$.next(null);
114
- }
115
- hideModal() {
116
- this._hideModal$.next(null);
117
- }
118
- refresh() {
119
- this._refresh$.next(null);
120
- }
121
- setModalType(type) {
122
- this._modalType$.next(type);
123
- }
124
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FormManagementStateService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
125
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FormManagementStateService, providedIn: 'root' }); }
98
+ function getContextObservable(route) {
99
+ return route.data.pipe(map(data => (data && data['context']) || ''));
126
100
  }
127
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FormManagementStateService, decorators: [{
128
- type: Injectable,
129
- args: [{
130
- providedIn: 'root',
131
- }]
132
- }] });
133
101
 
134
102
  /*
135
- * Copyright 2015-2024 Ritense BV, the Netherlands.
103
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
136
104
  *
137
105
  * Licensed under EUPL, Version 1.2 (the "License");
138
106
  * you may not use this file except in compliance with the License.
@@ -148,7 +116,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
148
116
  */
149
117
 
150
118
  /*
151
- * Copyright 2015-2024 Ritense BV, the Netherlands.
119
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
152
120
  *
153
121
  * Licensed under EUPL, Version 1.2 (the "License");
154
122
  * you may not use this file except in compliance with the License.
@@ -162,64 +130,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
162
130
  * See the License for the specific language governing permissions and
163
131
  * limitations under the License.
164
132
  */
165
- class FormManagementComponent {
166
- constructor(formManagementService, iconService, router) {
167
- this.formManagementService = formManagementService;
168
- this.iconService = iconService;
169
- this.router = router;
170
- this.formDefinitions = [];
171
- this.formDefinitionFields = [
172
- { key: 'name', label: 'Form name' },
173
- { key: 'readOnly', label: 'Read-only' },
174
- ];
175
- this.pagination = {
176
- collectionSize: 0,
177
- page: 1,
178
- size: 10,
179
- };
180
- this.iconService.registerAll([Upload16]);
181
- }
182
- paginationClicked(page) {
183
- this.pagination.page = page;
184
- this.loadFormDefinitions();
185
- }
186
- paginationSet(size) {
187
- this.pagination.size = size;
188
- this.pagination.page = 1;
189
- this.loadFormDefinitions();
190
- }
191
- loadFormDefinitions(searchTerm) {
192
- const params = { page: this.pagination.page - 1, size: this.pagination.size };
193
- if (searchTerm) {
194
- params['searchTerm'] = searchTerm;
195
- }
196
- this.formManagementService
197
- .queryFormDefinitions(params)
198
- .pipe(take(1))
199
- .subscribe(results => {
200
- this.pagination = {
201
- ...this.pagination,
202
- collectionSize: results.body.totalElements,
203
- };
204
- this.formDefinitions = results.body.content;
205
- });
206
- }
207
- editFormDefinition(formDefinition) {
208
- this.router.navigate(['/form-management/edit', formDefinition.id]);
209
- }
210
- searchTermEntered(searchTerm) {
211
- this.loadFormDefinitions(searchTerm);
212
- }
213
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FormManagementComponent, deps: [{ token: FormManagementService }, { token: i3.IconService }, { token: i3$1.Router }], target: i0.ɵɵFactoryTarget.Component }); }
214
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: FormManagementComponent, selector: "valtimo-form-management", ngImport: i0, template: "<!--\n ~ Copyright 2015-2024 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-carbon-list\n [fields]=\"formDefinitionFields\"\n [header]=\"false\"\n [isSearchable]=\"true\"\n [items]=\"formDefinitions\"\n [pagination]=\"pagination\"\n paginationIdentifier=\"formManagementList\"\n (paginationClicked)=\"paginationClicked($event)\"\n (paginationSet)=\"paginationSet($event)\"\n (rowClicked)=\"editFormDefinition($event)\"\n (search)=\"searchTermEntered($event)\"\n>\n <ng-container carbonToolbarContent>\n <button\n cdsButton=\"ghost\"\n [iconOnly]=\"true\"\n [routerLink]=\"'create'\"\n [queryParams]=\"{upload: 'true'}\"\n >\n <svg class=\"cds--btn__icon\" cdsIcon=\"upload\" size=\"16\"></svg>\n </button>\n\n <button cdsButton=\"primary\" [routerLink]=\"'create'\">\n {{ 'Create new Form' | translate }}\n\n <svg class=\"cds--btn__icon\" cdsIcon=\"add\" size=\"16\"></svg>\n </button>\n </ng-container>\n</valtimo-carbon-list>\n", styles: ["/*!\n * Copyright 2015-2024 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$1.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "directive", type: i3.Button, selector: "[cdsButton], [ibmButton]", inputs: ["ibmButton", "cdsButton", "size", "skeleton", "iconOnly", "isExpressive"] }, { kind: "component", type: i1$1.CarbonListComponent, selector: "valtimo-carbon-list", inputs: ["items", "fields", "tableTranslations", "paginatorConfig", "pagination", "loading", "actions", "actionItems", "header", "hideColumnHeader", "initialSortState", "sortState", "isSearchable", "enableSingleSelection", "lastColumnTemplate", "paginationIdentifier", "showSelectionColumn", "striped", "hideToolbar", "lockedTooltipTranslationKey", "movingRowsEnabled", "dragAndDrop", "dragAndDropDisabled"], outputs: ["rowClicked", "paginationClicked", "paginationSet", "search", "sortChanged", "moveRow", "itemsReordered"] }, { kind: "directive", type: i3.IconDirective, selector: "[cdsIcon], [ibmIcon]", inputs: ["ibmIcon", "cdsIcon", "size", "title", "ariaLabel", "ariaLabelledBy", "ariaHidden", "isFocusable"] }, { kind: "pipe", type: i2$1.TranslatePipe, name: "translate" }] }); }
133
+ function noDuplicateFormValidator(context, params, formManagementService) {
134
+ return (control) => (context === 'case'
135
+ ? formManagementService.existsFormDefinitionCase(params.caseDefinitionKey, params.caseDefinitionVersionTag, control.value.toString())
136
+ : formManagementService.existsFormDefinition(control.value.toString())).pipe(map$1((result) => (result ? { duplicate: true } : null)));
215
137
  }
216
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FormManagementComponent, decorators: [{
217
- type: Component,
218
- args: [{ selector: 'valtimo-form-management', template: "<!--\n ~ Copyright 2015-2024 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-carbon-list\n [fields]=\"formDefinitionFields\"\n [header]=\"false\"\n [isSearchable]=\"true\"\n [items]=\"formDefinitions\"\n [pagination]=\"pagination\"\n paginationIdentifier=\"formManagementList\"\n (paginationClicked)=\"paginationClicked($event)\"\n (paginationSet)=\"paginationSet($event)\"\n (rowClicked)=\"editFormDefinition($event)\"\n (search)=\"searchTermEntered($event)\"\n>\n <ng-container carbonToolbarContent>\n <button\n cdsButton=\"ghost\"\n [iconOnly]=\"true\"\n [routerLink]=\"'create'\"\n [queryParams]=\"{upload: 'true'}\"\n >\n <svg class=\"cds--btn__icon\" cdsIcon=\"upload\" size=\"16\"></svg>\n </button>\n\n <button cdsButton=\"primary\" [routerLink]=\"'create'\">\n {{ 'Create new Form' | translate }}\n\n <svg class=\"cds--btn__icon\" cdsIcon=\"add\" size=\"16\"></svg>\n </button>\n </ng-container>\n</valtimo-carbon-list>\n", styles: ["/*!\n * Copyright 2015-2024 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"] }]
219
- }], ctorParameters: () => [{ type: FormManagementService }, { type: i3.IconService }, { type: i3$1.Router }] });
220
138
 
221
139
  /*
222
- * Copyright 2015-2024 Ritense BV, the Netherlands.
140
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
223
141
  *
224
142
  * Licensed under EUPL, Version 1.2 (the "License");
225
143
  * you may not use this file except in compliance with the License.
@@ -233,14 +151,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
233
151
  * See the License for the specific language governing permissions and
234
152
  * limitations under the License.
235
153
  */
236
- function noDuplicateFormValidator(formManagementService) {
237
- return (control) => formManagementService
238
- .existsFormDefinition(control.value.toString())
239
- .pipe(map((result) => (result ? { duplicate: true } : null)));
240
- }
241
154
 
242
155
  /*
243
- * Copyright 2015-2024 Ritense BV, the Netherlands.
156
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
244
157
  *
245
158
  * Licensed under EUPL, Version 1.2 (the "License");
246
159
  * you may not use this file except in compliance with the License.
@@ -255,66 +168,93 @@ function noDuplicateFormValidator(formManagementService) {
255
168
  * limitations under the License.
256
169
  */
257
170
  class FormManagementCreateComponent {
258
- constructor(formManagementService, formBuilder, router, alertService, route) {
171
+ constructor(formManagementService, formBuilder, route) {
259
172
  this.formManagementService = formManagementService;
260
173
  this.formBuilder = formBuilder;
261
- this.router = router;
262
- this.alertService = alertService;
263
174
  this.route = route;
175
+ this.upload = false;
176
+ this.goBackEvent = new EventEmitter();
177
+ this.afterCreateEvent = new EventEmitter();
178
+ this.afterUploadEvent = new EventEmitter();
179
+ this.context$ = getContextObservable(this.route);
180
+ this.caseManagementRouteParams$ = this.context$.pipe(filter(context => context === 'case'), switchMap(() => getCaseManagementRouteParams(this.route)));
181
+ }
182
+ ngOnInit() {
183
+ this.initForm();
184
+ }
185
+ initForm() {
186
+ getCaseManagementRouteParamsAndContext(this.route)
187
+ .pipe(take(1), tap(([context, caseManagementParams]) => {
188
+ this.form = this.formBuilder.group({
189
+ name: new FormControl('', Validators.required, [
190
+ noDuplicateFormValidator(context, caseManagementParams, this.formManagementService),
191
+ ]),
192
+ });
193
+ }))
194
+ .subscribe();
264
195
  }
265
196
  get formControls() {
266
- return this.form.controls;
197
+ return this.form?.controls;
267
198
  }
268
- ngOnInit() {
269
- this.form = this.formBuilder.group({
270
- name: new FormControl('', Validators.required, [
271
- noDuplicateFormValidator(this.formManagementService),
272
- ]),
273
- });
199
+ onBackButtonClick() {
200
+ this.goBackEvent.emit();
274
201
  }
275
202
  reset() {
276
- this.form.setValue({
277
- name: '',
278
- });
203
+ this.form.setValue({ name: '' });
204
+ }
205
+ onCloseEvent() {
206
+ this.goBackEvent.emit();
279
207
  }
280
208
  createFormDefinition() {
281
- const emptyForm = {
282
- display: 'form',
283
- components: [],
284
- };
209
+ const emptyForm = { display: 'form', components: [] };
285
210
  const request = {
286
211
  name: this.form.value.name,
287
212
  formDefinition: JSON.stringify(emptyForm),
288
213
  };
289
- combineLatest([
290
- this.formManagementService.createFormDefinition(request),
291
- this.route.queryParams,
292
- ])
293
- .pipe(take$1(1))
294
- .subscribe(([formDefinition, params]) => {
295
- this.alertService.success('Created new Form');
296
- if (params?.upload === 'true') {
297
- this.router.navigate(['/form-management/edit', formDefinition.id], {
298
- queryParams: { upload: 'true' },
299
- });
214
+ getCaseManagementRouteParamsAndContext(this.route)
215
+ .pipe(take(1), switchMap(([context, caseManagementParams]) => context === 'case'
216
+ ? this.formManagementService.createFormDefinitionsCase(caseManagementParams.caseDefinitionKey, caseManagementParams.caseDefinitionVersionTag, request)
217
+ : this.formManagementService.createFormDefinition(request)), tap(formDefinition => {
218
+ if (this.upload) {
219
+ this.afterUploadEvent.emit(formDefinition.id);
300
220
  }
301
221
  else {
302
- this.router.navigate(['/form-management/edit', formDefinition.id]);
222
+ this.afterCreateEvent.emit(formDefinition.id);
303
223
  }
304
- }, err => {
305
- this.alertService.error('Error creating new Form');
306
- });
224
+ }))
225
+ .subscribe();
307
226
  }
308
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FormManagementCreateComponent, deps: [{ token: FormManagementService }, { token: i2$2.FormBuilder }, { token: i3$1.Router }, { token: i1$1.AlertService }, { token: i3$1.ActivatedRoute }], target: i0.ɵɵFactoryTarget.Component }); }
309
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: FormManagementCreateComponent, selector: "valtimo-form-management-create", ngImport: i0, template: "<!--\n ~ Copyright 2015-2024 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-2024 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$1.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "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: i1$1.WidgetComponent, selector: "valtimo-widget", inputs: ["type", "name", "icon", "contrast", "divider", "title", "subtitle", "collapseAble", "collapse", "additionalClasses"] }, { kind: "pipe", type: i2$1.TranslatePipe, name: "translate" }] }); }
227
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: FormManagementCreateComponent, deps: [{ token: FormManagementService }, { token: i2.FormBuilder }, { token: i3.ActivatedRoute }], target: i0.ɵɵFactoryTarget.Component }); }
228
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.15", type: FormManagementCreateComponent, isStandalone: true, selector: "valtimo-form-management-create", inputs: { upload: "upload" }, outputs: { goBackEvent: "goBackEvent", afterCreateEvent: "afterCreateEvent", afterUploadEvent: "afterUploadEvent" }, ngImport: i0, template: "<!--\n ~ Copyright 2015-2025 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<cds-modal\n valtimoCdsModal\n class=\"form-management-create\"\n size=\"sm\"\n [cdsLayer]=\"0\"\n [open]=\"true\"\n (close)=\"onCloseEvent()\"\n>\n <cds-modal-header [showCloseButton]=\"true\" (closeSelect)=\"onCloseEvent()\">\n <h3 cdsModalHeaderHeading>\n {{ 'formManagement.add' | translate }}\n </h3>\n </cds-modal-header>\n\n <form *ngIf=\"form\" [formGroup]=\"form\" (ngSubmit)=\"createFormDefinition()\">\n <section cdsModalContent [cdsLayer]=\"1\">\n <cds-label\n [invalid]=\"formControls?.name?.touched && formControls?.name?.errors\"\n [invalidText]=\"\n (formControls?.name?.errors?.required && ('formManagement.nameIsRequired' | translate)) ||\n (formControls?.name?.errors?.duplicate && ('formManagement.nameIsInUse' | translate)) ||\n 'test'\n \"\n >\n {{ 'formManagement.name' | translate }}\n\n <input\n cdsText\n type=\"text\"\n id=\"name\"\n formControlName=\"name\"\n [invalid]=\"formControls?.name?.touched && formControls?.name?.errors\"\n required\n />\n </cds-label>\n </section>\n\n <cds-modal-footer [cdsLayer]=\"1\">\n <cds-modal-footer>\n <button cdsButton=\"ghost\" (click)=\"$event.preventDefault(); onBackButtonClick()\">\n {{ 'formManagement.back' | translate }}\n </button>\n\n <button cdsButton=\"ghost\" (click)=\"$event.preventDefault(); reset()\">\n {{ 'formManagement.reset' | translate | translate }}\n </button>\n\n <button [disabled]=\"form?.invalid\" type=\"submit\" cdsButton=\"primary\">\n {{ 'formManagement.submit' | translate }}\n </button>\n </cds-modal-footer>\n </cds-modal-footer>\n </form>\n</cds-modal>\n", styles: [".form-management-create{max-width:512px;margin:0 auto}cds-modal-footer{width:100%}\n/*!\n * Copyright 2015-2025 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: "ngmodule", type: CommonModule }, { kind: "directive", type: i7.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2.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.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i5.TranslatePipe, name: "translate" }, { kind: "ngmodule", type: ButtonModule }, { kind: "directive", type: i2$1.Button, selector: "[cdsButton], [ibmButton]", inputs: ["ibmButton", "cdsButton", "size", "skeleton", "iconOnly", "isExpressive"] }, { kind: "ngmodule", type: InputModule }, { kind: "component", type: i2$1.Label, selector: "cds-label, ibm-label", inputs: ["labelInputID", "disabled", "skeleton", "helperText", "invalidText", "invalid", "warn", "warnText", "ariaLabel"] }, { kind: "directive", type: i2$1.TextInput, selector: "[cdsText], [ibmText]", inputs: ["theme", "size", "invalid", "warn", "skeleton"] }, { kind: "ngmodule", type: WidgetModule }, { kind: "ngmodule", type: TilesModule }, { kind: "ngmodule", type: LayerModule }, { kind: "directive", type: i2$1.LayerDirective, selector: "[cdsLayer], [ibmLayer]", inputs: ["ibmLayer", "cdsLayer"], exportAs: ["layer"] }, { kind: "ngmodule", type: ModalModule }, { kind: "component", type: i2$1.Modal, selector: "cds-modal, ibm-modal", inputs: ["size", "theme", "ariaLabel", "open", "trigger", "hasScrollingContent"], outputs: ["overlaySelected", "close"] }, { kind: "component", type: i2$1.ModalHeader, selector: "cds-modal-header, ibm-modal-header", inputs: ["theme", "closeLabel", "showCloseButton"], outputs: ["closeSelect"] }, { kind: "component", type: i2$1.ModalFooter, selector: "cds-modal-footer, ibm-modal-footer" }, { kind: "directive", type: i2$1.ModalContent, selector: "[cdsModalContent], [ibmModalContent]", inputs: ["hasForm"] }, { kind: "directive", type: i2$1.ModalHeaderHeading, selector: "[cdsModalHeaderHeading], [ibmModalHeaderHeading]" }, { kind: "directive", type: ValtimoCdsModalDirective, selector: "[valtimoCdsModal]", inputs: ["minContentHeight"] }] }); }
310
229
  }
311
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FormManagementCreateComponent, decorators: [{
230
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: FormManagementCreateComponent, decorators: [{
312
231
  type: Component,
313
- args: [{ selector: 'valtimo-form-management-create', template: "<!--\n ~ Copyright 2015-2024 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-2024 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"] }]
314
- }], ctorParameters: () => [{ type: FormManagementService }, { type: i2$2.FormBuilder }, { type: i3$1.Router }, { type: i1$1.AlertService }, { type: i3$1.ActivatedRoute }] });
232
+ args: [{ selector: 'valtimo-form-management-create', standalone: true, imports: [
233
+ CommonModule,
234
+ ReactiveFormsModule,
235
+ TranslateModule,
236
+ ButtonModule,
237
+ InputModule,
238
+ WidgetModule,
239
+ InputModule,
240
+ TilesModule,
241
+ LayerModule,
242
+ ModalModule,
243
+ ValtimoCdsModalDirective,
244
+ ButtonModule,
245
+ ], template: "<!--\n ~ Copyright 2015-2025 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<cds-modal\n valtimoCdsModal\n class=\"form-management-create\"\n size=\"sm\"\n [cdsLayer]=\"0\"\n [open]=\"true\"\n (close)=\"onCloseEvent()\"\n>\n <cds-modal-header [showCloseButton]=\"true\" (closeSelect)=\"onCloseEvent()\">\n <h3 cdsModalHeaderHeading>\n {{ 'formManagement.add' | translate }}\n </h3>\n </cds-modal-header>\n\n <form *ngIf=\"form\" [formGroup]=\"form\" (ngSubmit)=\"createFormDefinition()\">\n <section cdsModalContent [cdsLayer]=\"1\">\n <cds-label\n [invalid]=\"formControls?.name?.touched && formControls?.name?.errors\"\n [invalidText]=\"\n (formControls?.name?.errors?.required && ('formManagement.nameIsRequired' | translate)) ||\n (formControls?.name?.errors?.duplicate && ('formManagement.nameIsInUse' | translate)) ||\n 'test'\n \"\n >\n {{ 'formManagement.name' | translate }}\n\n <input\n cdsText\n type=\"text\"\n id=\"name\"\n formControlName=\"name\"\n [invalid]=\"formControls?.name?.touched && formControls?.name?.errors\"\n required\n />\n </cds-label>\n </section>\n\n <cds-modal-footer [cdsLayer]=\"1\">\n <cds-modal-footer>\n <button cdsButton=\"ghost\" (click)=\"$event.preventDefault(); onBackButtonClick()\">\n {{ 'formManagement.back' | translate }}\n </button>\n\n <button cdsButton=\"ghost\" (click)=\"$event.preventDefault(); reset()\">\n {{ 'formManagement.reset' | translate | translate }}\n </button>\n\n <button [disabled]=\"form?.invalid\" type=\"submit\" cdsButton=\"primary\">\n {{ 'formManagement.submit' | translate }}\n </button>\n </cds-modal-footer>\n </cds-modal-footer>\n </form>\n</cds-modal>\n", styles: [".form-management-create{max-width:512px;margin:0 auto}cds-modal-footer{width:100%}\n/*!\n * Copyright 2015-2025 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"] }]
246
+ }], ctorParameters: () => [{ type: FormManagementService }, { type: i2.FormBuilder }, { type: i3.ActivatedRoute }], propDecorators: { upload: [{
247
+ type: Input
248
+ }], goBackEvent: [{
249
+ type: Output
250
+ }], afterCreateEvent: [{
251
+ type: Output
252
+ }], afterUploadEvent: [{
253
+ type: Output
254
+ }] } });
315
255
 
316
256
  /*
317
- * Copyright 2015-2024 Ritense BV, the Netherlands.
257
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
318
258
  *
319
259
  * Licensed under EUPL, Version 1.2 (the "License");
320
260
  * you may not use this file except in compliance with the License.
@@ -328,66 +268,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
328
268
  * See the License for the specific language governing permissions and
329
269
  * limitations under the License.
330
270
  */
331
- class FormManagementDuplicateComponent extends BaseModal {
332
- constructor(formToDuplicate, modalService, formManagementService, alertService, route, router) {
333
- super();
334
- this.formToDuplicate = formToDuplicate;
335
- this.modalService = modalService;
336
- this.formManagementService = formManagementService;
337
- this.alertService = alertService;
338
- this.route = route;
339
- this.router = router;
340
- this.duplicateForm = new FormGroup({
341
- duplicateFormName: new FormControl(this.getDefaultName(), Validators.compose([Validators.required]), [noDuplicateFormValidator(this.formManagementService)]),
342
- });
343
- this.duplicateForm.markAllAsTouched();
344
- }
345
- duplicate() {
346
- const control = this.duplicateFormName;
347
- const request = {
348
- name: control.value.toString(),
349
- formDefinition: JSON.stringify(this.formToDuplicate.formDefinition),
350
- };
351
- combineLatest([
352
- this.formManagementService.createFormDefinition(request),
353
- this.route.queryParams,
354
- ])
355
- .pipe(take$1(1))
356
- .subscribe(([formDefinition, params]) => {
357
- this.alertService.success('Created new Form');
358
- this.router
359
- .navigateByUrl(`/form-management/edit/${formDefinition.id}`)
360
- .then(function (result) {
361
- window.location.reload();
362
- });
363
- }, err => {
364
- if (err.toString().includes('Duplicate name')) {
365
- control.setErrors({ duplicate: true });
366
- }
367
- else {
368
- control.setErrors({ incorrect: true });
369
- }
370
- });
371
- }
372
- get duplicateFormName() {
373
- return this.duplicateForm.controls['duplicateFormName'];
374
- }
375
- getDefaultName() {
376
- return this.formToDuplicate.name + '-duplicate';
377
- }
378
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FormManagementDuplicateComponent, deps: [{ token: 'formToDuplicate' }, { token: i1$1.ModalService }, { token: FormManagementService }, { token: i1$1.AlertService }, { token: i3$1.ActivatedRoute }, { token: i3$1.Router }], target: i0.ɵɵFactoryTarget.Component }); }
379
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: FormManagementDuplicateComponent, selector: "valtimo-form-management-duplicate-modal", usesInheritance: true, ngImport: i0, template: "<!--\n ~ Copyright 2015-2024 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-2024 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: i3.Modal, selector: "cds-modal, ibm-modal", inputs: ["size", "theme", "ariaLabel", "open", "trigger", "hasScrollingContent"], outputs: ["overlaySelected", "close"] }, { kind: "component", type: i3.ModalHeader, selector: "cds-modal-header, ibm-modal-header", inputs: ["theme", "closeLabel", "showCloseButton"], outputs: ["closeSelect"] }, { kind: "component", type: i3.ModalFooter, selector: "cds-modal-footer, ibm-modal-footer" }, { kind: "component", type: i3.Label, selector: "cds-label, ibm-label", inputs: ["labelInputID", "disabled", "skeleton", "helperText", "invalidText", "invalid", "warn", "warnText", "ariaLabel"] }, { kind: "directive", type: i3.TextInput, selector: "[cdsText], [ibmText]", inputs: ["theme", "size", "invalid", "warn", "skeleton"] }, { kind: "directive", type: i3.Button, selector: "[cdsButton], [ibmButton]", inputs: ["ibmButton", "cdsButton", "size", "skeleton", "iconOnly", "isExpressive"] }, { kind: "directive", type: i1$1.ValtimoCdsModalDirective, selector: "[valtimoCdsModal]", inputs: ["enableOverflow"] }, { kind: "pipe", type: i2$1.TranslatePipe, name: "translate" }] }); }
380
- }
381
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FormManagementDuplicateComponent, decorators: [{
382
- type: Component,
383
- args: [{ selector: 'valtimo-form-management-duplicate-modal', template: "<!--\n ~ Copyright 2015-2024 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-2024 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"] }]
384
- }], ctorParameters: () => [{ type: undefined, decorators: [{
385
- type: Inject,
386
- args: ['formToDuplicate']
387
- }] }, { type: i1$1.ModalService }, { type: FormManagementService }, { type: i1$1.AlertService }, { type: i3$1.ActivatedRoute }, { type: i3$1.Router }] });
388
271
 
389
272
  /*
390
- * Copyright 2015-2024 Ritense BV, the Netherlands.
273
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
391
274
  *
392
275
  * Licensed under EUPL, Version 1.2 (the "License");
393
276
  * you may not use this file except in compliance with the License.
@@ -412,7 +295,7 @@ function compareFormDefinitions(fd1, fd2) {
412
295
  }
413
296
 
414
297
  /*
415
- * Copyright 2015-2024 Ritense BV, the Netherlands.
298
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
416
299
  *
417
300
  * Licensed under EUPL, Version 1.2 (the "License");
418
301
  * you may not use this file except in compliance with the License.
@@ -434,7 +317,7 @@ var EDIT_TABS;
434
317
  })(EDIT_TABS || (EDIT_TABS = {}));
435
318
 
436
319
  /*
437
- * Copyright 2015-2024 Ritense BV, the Netherlands.
320
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
438
321
  *
439
322
  * Licensed under EUPL, Version 1.2 (the "License");
440
323
  * you may not use this file except in compliance with the License.
@@ -450,7 +333,7 @@ var EDIT_TABS;
450
333
  */
451
334
 
452
335
  /*
453
- * Copyright 2015-2024 Ritense BV, the Netherlands.
336
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
454
337
  *
455
338
  * Licensed under EUPL, Version 1.2 (the "License");
456
339
  * you may not use this file except in compliance with the License.
@@ -464,135 +347,217 @@ var EDIT_TABS;
464
347
  * See the License for the specific language governing permissions and
465
348
  * limitations under the License.
466
349
  */
467
- class FormManagementUploadComponent {
468
- constructor(documentService, translateService) {
469
- this.documentService = documentService;
470
- this.translateService = translateService;
471
- this.definitionUploaded = new EventEmitter();
472
- this.clear$ = new Subject();
473
- this.jsonString$ = new BehaviorSubject('');
474
- this.error$ = new BehaviorSubject('');
475
- this.disabled$ = new BehaviorSubject(false);
476
- this.file$ = new BehaviorSubject(undefined);
477
- }
478
- ngAfterViewInit() {
479
- this.openShowSubscription();
480
- this.openFileSubscription();
350
+
351
+ /*
352
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
353
+ *
354
+ * Licensed under EUPL, Version 1.2 (the "License");
355
+ * you may not use this file except in compliance with the License.
356
+ * You may obtain a copy of the License at
357
+ *
358
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
359
+ *
360
+ * Unless required by applicable law or agreed to in writing, software
361
+ * distributed under the License is distributed on an "AS IS" basis,
362
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
363
+ * See the License for the specific language governing permissions and
364
+ * limitations under the License.
365
+ */
366
+ class FormManagementDuplicateComponent extends BaseModal {
367
+ get duplicateFormName() {
368
+ return this.duplicateForm.controls['duplicateFormName'];
481
369
  }
482
- ngOnDestroy() {
483
- this.showSubscription.unsubscribe();
484
- this.fileSubscription.unsubscribe();
485
- this.closeErrorSubscription();
486
- }
487
- setFile(file) {
488
- this.clearError();
489
- this.file$.next(file);
490
- }
491
- uploadDefinition() {
492
- this.disable();
493
- this.jsonString$.pipe(take$1(1)).subscribe(definition => {
494
- this.closeErrorSubscription();
495
- this.clearError();
496
- this.enable();
497
- this.hideModal();
498
- this.definitionUploaded.emit(definition);
499
- });
370
+ getDefaultName() {
371
+ return this.formToDuplicate.name + '-duplicate';
500
372
  }
501
- openErrorSubscription(errorCode) {
502
- this.closeErrorSubscription();
503
- this.errorSubscription = this.translateService.stream(errorCode).subscribe(error => {
504
- this.error$.next(error);
505
- });
373
+ constructor(formToDuplicate, context, params, modalService, formManagementService, route, router, notificationService, translateService) {
374
+ super();
375
+ this.formToDuplicate = formToDuplicate;
376
+ this.context = context;
377
+ this.params = params;
378
+ this.modalService = modalService;
379
+ this.formManagementService = formManagementService;
380
+ this.route = route;
381
+ this.router = router;
382
+ this.notificationService = notificationService;
383
+ this.translateService = translateService;
506
384
  }
507
- closeErrorSubscription() {
508
- if (this.errorSubscription) {
509
- this.errorSubscription.unsubscribe();
510
- }
385
+ ngOnInit() {
386
+ this.initForm();
511
387
  }
512
- clearError() {
513
- this.error$.next('');
514
- }
515
- openFileSubscription() {
516
- this.fileSubscription = this.file$.subscribe(file => {
517
- if (file) {
518
- const reader = new FileReader();
519
- reader.onloadend = () => {
520
- const result = reader.result.toString();
521
- if (this.stringIsValidJson(result)) {
522
- this.jsonString$.next(result);
523
- }
524
- else {
525
- this.clearJsonString();
526
- this.error$.next(this.translateService.instant('dropzone.error.invalidJson'));
527
- }
528
- };
529
- reader.readAsText(file);
530
- }
531
- else {
532
- this.clearJsonString();
533
- }
388
+ initForm() {
389
+ this.duplicateForm = new FormGroup({
390
+ duplicateFormName: new FormControl(this.getDefaultName(), Validators.compose([Validators.required]), [noDuplicateFormValidator(this.context, this.params, this.formManagementService)]),
534
391
  });
392
+ this.duplicateForm.markAllAsTouched();
535
393
  }
536
- openShowSubscription() {
537
- this.showSubscription = this.show$.subscribe(show => {
538
- if (show) {
539
- this.showModal();
540
- }
541
- else {
542
- this.hideModal();
543
- }
544
- this.clearJsonString();
545
- this.clearError();
546
- this.clearDropzone();
394
+ duplicate() {
395
+ const control = this.duplicateFormName;
396
+ this.formToDuplicate.name = this.duplicateForm.controls['duplicateFormName'].value;
397
+ const request = {
398
+ name: control.value.toString(),
399
+ formDefinition: JSON.stringify(this.formToDuplicate.formDefinition),
400
+ };
401
+ (this.context === 'case'
402
+ ? this.formManagementService.createFormDefinitionsCase(this.params.caseDefinitionKey, this.params.caseDefinitionVersionTag, request)
403
+ : this.formManagementService.createFormDefinition(request))
404
+ .pipe(take(1))
405
+ .subscribe({
406
+ next: formDefinition => {
407
+ this.navigateWithNewId(formDefinition.id).then(() => {
408
+ this.closeModal();
409
+ this.notificationService.showToast({
410
+ type: 'success',
411
+ title: this.translateService.instant('formManagement.notifications.duplicated'),
412
+ });
413
+ });
414
+ },
415
+ error: err => {
416
+ if (err.toString().includes('Duplicate name')) {
417
+ control.setErrors({ duplicate: true });
418
+ }
419
+ else {
420
+ control.setErrors({ incorrect: true });
421
+ }
422
+ },
547
423
  });
548
424
  }
549
- clearJsonString() {
550
- this.jsonString$.next('');
551
- }
552
- clearDropzone() {
553
- this.clear$.next(null);
554
- }
555
- showModal() {
556
- this.modal.show();
557
- }
558
- hideModal() {
559
- this.modal.hide();
560
- }
561
- stringIsValidJson(string) {
425
+ async navigateWithNewId(newId) {
426
+ const currentUrl = this.router.url.split('?')[0];
427
+ const segments = currentUrl.split('/');
428
+ const formIdIndex = segments.findIndex(segment => segment.match(/^[a-f0-9-]{36}$/));
429
+ if (formIdIndex !== -1) {
430
+ segments[formIdIndex] = newId;
431
+ }
432
+ const updatedUrl = segments.join('/');
433
+ const queryParams = { ...this.route.snapshot.queryParams };
562
434
  try {
563
- // eslint-disable-next-line
564
- JSON.parse(string)?.formDefinition?.components;
435
+ return await this.router.navigate([updatedUrl], { queryParams });
565
436
  }
566
- catch (e) {
567
- this.clearDropzone();
568
- this.openErrorSubscription('dropzone.error.invalidFormDef');
437
+ catch (error) {
569
438
  return false;
570
439
  }
571
- return true;
572
440
  }
573
- disable() {
574
- this.disabled$.next(true);
441
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: FormManagementDuplicateComponent, deps: [{ token: 'formToDuplicate' }, { token: 'context' }, { token: 'params' }, { token: i2$1.ModalService }, { token: FormManagementService }, { token: i3.ActivatedRoute }, { token: i3.Router }, { token: i4.GlobalNotificationService }, { token: i5.TranslateService }], target: i0.ɵɵFactoryTarget.Component }); }
442
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.15", type: FormManagementDuplicateComponent, isStandalone: true, selector: "valtimo-form-management-duplicate-modal", usesInheritance: true, ngImport: i0, template: "<!--\n ~ Copyright 2015-2025 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<cds-modal\n valtimoCdsModal\n class=\"form-management-create\"\n size=\"sm\"\n [cdsLayer]=\"0\"\n [open]=\"true\"\n (close)=\"closeModal()\"\n>\n <cds-modal-header [showCloseButton]=\"true\" (closeSelect)=\"closeModal()\">\n <h3 cdsModalHeaderHeading>\n {{ 'formManagement.duplicate' | translate }}\n </h3>\n </cds-modal-header>\n\n <form [formGroup]=\"duplicateForm\">\n <section cdsModalContent [cdsLayer]=\"1\">\n <cds-label\n [invalid]=\"duplicateFormName?.touched && duplicateFormName?.errors\"\n [invalidText]=\"\n (duplicateFormName?.errors?.required && ('formManagement.nameIsRequired' | translate)) ||\n (duplicateFormName?.errors?.duplicate && ('formManagement.nameIsInUse' | translate)) ||\n 'Error'\n \"\n >\n {{ 'formManagement.name' | translate }}\n\n <input\n cdsText\n type=\"text\"\n id=\"duplicateFormName\"\n formControlName=\"duplicateFormName\"\n [invalid]=\"duplicateFormName?.touched && duplicateFormName?.errors\"\n required\n />\n </cds-label>\n </section>\n\n <cds-modal-footer [cdsLayer]=\"1\">\n <cds-modal-footer>\n <button cdsButton=\"secondary\" (click)=\"closeModal()\">\n {{ 'interface.cancel' | translate }}\n </button>\n\n <button [disabled]=\"duplicateForm.invalid\" cdsButton=\"primary\" (click)=\"duplicate()\">\n {{ 'formManagement.submit' | translate }}\n </button>\n </cds-modal-footer>\n </cds-modal-footer>\n </form>\n</cds-modal>\n", styles: ["/*!\n * Copyright 2015-2025 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: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i5.TranslatePipe, name: "translate" }, { kind: "ngmodule", type: ModalModule }, { kind: "component", type: i2$1.Modal, selector: "cds-modal, ibm-modal", inputs: ["size", "theme", "ariaLabel", "open", "trigger", "hasScrollingContent"], outputs: ["overlaySelected", "close"] }, { kind: "component", type: i2$1.ModalHeader, selector: "cds-modal-header, ibm-modal-header", inputs: ["theme", "closeLabel", "showCloseButton"], outputs: ["closeSelect"] }, { kind: "component", type: i2$1.ModalFooter, selector: "cds-modal-footer, ibm-modal-footer" }, { kind: "directive", type: i2$1.ModalContent, selector: "[cdsModalContent], [ibmModalContent]", inputs: ["hasForm"] }, { kind: "directive", type: i2$1.ModalHeaderHeading, selector: "[cdsModalHeaderHeading], [ibmModalHeaderHeading]" }, { kind: "ngmodule", type: ButtonModule }, { kind: "directive", type: i2$1.Button, selector: "[cdsButton], [ibmButton]", inputs: ["ibmButton", "cdsButton", "size", "skeleton", "iconOnly", "isExpressive"] }, { kind: "ngmodule", type: InputModule }, { kind: "component", type: i2$1.Label, selector: "cds-label, ibm-label", inputs: ["labelInputID", "disabled", "skeleton", "helperText", "invalidText", "invalid", "warn", "warnText", "ariaLabel"] }, { kind: "directive", type: i2$1.TextInput, selector: "[cdsText], [ibmText]", inputs: ["theme", "size", "invalid", "warn", "skeleton"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2.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.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: FormsModule }, { kind: "ngmodule", type: LayerModule }, { kind: "directive", type: i2$1.LayerDirective, selector: "[cdsLayer], [ibmLayer]", inputs: ["ibmLayer", "cdsLayer"], exportAs: ["layer"] }, { kind: "directive", type: ValtimoCdsModalDirective, selector: "[valtimoCdsModal]", inputs: ["minContentHeight"] }] }); }
443
+ }
444
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: FormManagementDuplicateComponent, decorators: [{
445
+ type: Component,
446
+ args: [{ selector: 'valtimo-form-management-duplicate-modal', standalone: true, imports: [
447
+ CommonModule,
448
+ TranslateModule,
449
+ ModalModule,
450
+ ButtonModule,
451
+ InputModule,
452
+ ReactiveFormsModule,
453
+ FormsModule,
454
+ LayerModule,
455
+ ValtimoCdsModalDirective,
456
+ ], template: "<!--\n ~ Copyright 2015-2025 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<cds-modal\n valtimoCdsModal\n class=\"form-management-create\"\n size=\"sm\"\n [cdsLayer]=\"0\"\n [open]=\"true\"\n (close)=\"closeModal()\"\n>\n <cds-modal-header [showCloseButton]=\"true\" (closeSelect)=\"closeModal()\">\n <h3 cdsModalHeaderHeading>\n {{ 'formManagement.duplicate' | translate }}\n </h3>\n </cds-modal-header>\n\n <form [formGroup]=\"duplicateForm\">\n <section cdsModalContent [cdsLayer]=\"1\">\n <cds-label\n [invalid]=\"duplicateFormName?.touched && duplicateFormName?.errors\"\n [invalidText]=\"\n (duplicateFormName?.errors?.required && ('formManagement.nameIsRequired' | translate)) ||\n (duplicateFormName?.errors?.duplicate && ('formManagement.nameIsInUse' | translate)) ||\n 'Error'\n \"\n >\n {{ 'formManagement.name' | translate }}\n\n <input\n cdsText\n type=\"text\"\n id=\"duplicateFormName\"\n formControlName=\"duplicateFormName\"\n [invalid]=\"duplicateFormName?.touched && duplicateFormName?.errors\"\n required\n />\n </cds-label>\n </section>\n\n <cds-modal-footer [cdsLayer]=\"1\">\n <cds-modal-footer>\n <button cdsButton=\"secondary\" (click)=\"closeModal()\">\n {{ 'interface.cancel' | translate }}\n </button>\n\n <button [disabled]=\"duplicateForm.invalid\" cdsButton=\"primary\" (click)=\"duplicate()\">\n {{ 'formManagement.submit' | translate }}\n </button>\n </cds-modal-footer>\n </cds-modal-footer>\n </form>\n</cds-modal>\n", styles: ["/*!\n * Copyright 2015-2025 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"] }]
457
+ }], ctorParameters: () => [{ type: undefined, decorators: [{
458
+ type: Inject,
459
+ args: ['formToDuplicate']
460
+ }] }, { type: undefined, decorators: [{
461
+ type: Inject,
462
+ args: ['context']
463
+ }] }, { type: undefined, decorators: [{
464
+ type: Inject,
465
+ args: ['params']
466
+ }] }, { type: i2$1.ModalService }, { type: FormManagementService }, { type: i3.ActivatedRoute }, { type: i3.Router }, { type: i4.GlobalNotificationService }, { type: i5.TranslateService }] });
467
+
468
+ /*
469
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
470
+ *
471
+ * Licensed under EUPL, Version 1.2 (the "License");
472
+ * you may not use this file except in compliance with the License.
473
+ * You may obtain a copy of the License at
474
+ *
475
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
476
+ *
477
+ * Unless required by applicable law or agreed to in writing, software
478
+ * distributed under the License is distributed on an "AS IS" basis,
479
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
480
+ * See the License for the specific language governing permissions and
481
+ * limitations under the License.
482
+ */
483
+
484
+ /*
485
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
486
+ *
487
+ * Licensed under EUPL, Version 1.2 (the "License");
488
+ * you may not use this file except in compliance with the License.
489
+ * You may obtain a copy of the License at
490
+ *
491
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
492
+ *
493
+ * Unless required by applicable law or agreed to in writing, software
494
+ * distributed under the License is distributed on an "AS IS" basis,
495
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
496
+ * See the License for the specific language governing permissions and
497
+ * limitations under the License.
498
+ */
499
+ class FormManagementUploadComponent {
500
+ constructor(formBuilder, notificationService, translateService) {
501
+ this.formBuilder = formBuilder;
502
+ this.notificationService = notificationService;
503
+ this.translateService = translateService;
504
+ this.definitionUploaded = new EventEmitter();
505
+ this.modalOpen$ = new BehaviorSubject(false);
506
+ this.ACCEPTED_FILES = ['json'];
507
+ this.form = this.formBuilder.group({
508
+ file: this.formBuilder.control(new Set(), [Validators.required]),
509
+ });
510
+ this.fileSelected$ = this.form.get('file')?.valueChanges.pipe(startWith(null), map$1(value => !!(value instanceof Set && value.size > 0)));
511
+ this._subscriptions = new Subscription();
512
+ }
513
+ ngOnInit() {
514
+ this._subscriptions.add(this.show$.subscribe(show => {
515
+ this.modalOpen$.next(show);
516
+ }));
517
+ }
518
+ ngOnDestroy() {
519
+ this._subscriptions.unsubscribe();
520
+ }
521
+ closeModal() {
522
+ this.modalOpen$.next(false);
523
+ setTimeout(() => {
524
+ this.form.reset();
525
+ }, CARBON_CONSTANTS.modalAnimationMs);
575
526
  }
576
- enable() {
577
- this.disabled$.next(false);
527
+ async uploadFormDefinition() {
528
+ const formioDefinition = this.form.value?.file?.values()?.next()?.value?.file;
529
+ const formioDefinitionString = await formioDefinition.text();
530
+ if (!formioDefinitionString)
531
+ return;
532
+ this.notificationService.showNotification({
533
+ type: 'success',
534
+ title: this.translateService.instant('formManagement.upload.success'),
535
+ });
536
+ this.definitionUploaded.emit(formioDefinitionString);
537
+ this.modalOpen$.next(false);
578
538
  }
579
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FormManagementUploadComponent, deps: [{ token: i1$2.DocumentService }, { token: i2$1.TranslateService }], target: i0.ɵɵFactoryTarget.Component }); }
580
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.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-2024 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-2024 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: i1$1.DropzoneComponent, selector: "valtimo-dropzone", inputs: ["title", "hideTitle", "subtitle", "externalError$", "maxFileSize", "showMaxFileSize", "acceptedFiles", "clear$", "disabled", "hideFilePreview", "uploading", "camera", "maxFiles"], outputs: ["fileSelected"] }, { kind: "component", type: i1$1.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" }] }); }
539
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: FormManagementUploadComponent, deps: [{ token: i2.FormBuilder }, { token: i4.GlobalNotificationService }, { token: i5.TranslateService }], target: i0.ɵɵFactoryTarget.Component }); }
540
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.15", type: FormManagementUploadComponent, isStandalone: true, selector: "valtimo-form-management-upload", inputs: { show$: "show$" }, outputs: { definitionUploaded: "definitionUploaded" }, ngImport: i0, template: "<!--\n ~ Copyright 2015-2025 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<cds-modal valtimoCdsModal [open]=\"modalOpen$ | async\" size=\"sm\" (close)=\"closeModal()\">\n <cds-modal-header showCloseButton=\"true\" (closeSelect)=\"closeModal()\">\n <h3 cdsModalHeaderHeading>{{ 'formManagement.upload.modalTitle' | translate }}</h3>\n </cds-modal-header>\n\n <section cdsModalContent [cdsLayer]=\"1\" [formGroup]=\"form\">\n <cds-file-uploader\n [accept]=\"ACCEPTED_FILES\"\n [buttonText]=\"'formManagement.upload.buttonText' | translate\"\n [description]=\"'formManagement.upload.description' | translate\"\n [multiple]=\"false\"\n [title]=\"'formManagement.upload.title' | translate\"\n buttonType=\"primary\"\n formControlName=\"file\"\n >\n </cds-file-uploader>\n </section>\n\n <cds-modal-footer>\n <button cdsButton=\"ghost\" (click)=\"closeModal()\">\n {{ 'interface.cancel' | translate }}\n </button>\n\n <button\n cdsButton=\"primary\"\n [disabled]=\"(fileSelected$ | async) === false\"\n (click)=\"uploadFormDefinition()\"\n >\n {{ 'interface.upload' | translate }}\n </button>\n </cds-modal-footer>\n</cds-modal>\n", styles: ["/*!\n * Copyright 2015-2025 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: "ngmodule", type: CommonModule }, { kind: "pipe", type: i7.AsyncPipe, name: "async" }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i5.TranslatePipe, name: "translate" }, { kind: "ngmodule", type: FileUploaderModule }, { kind: "component", type: i2$1.FileUploader, selector: "cds-file-uploader, ibm-file-uploader", inputs: ["buttonText", "buttonType", "title", "description", "accept", "multiple", "skeleton", "size", "fileItemSize", "drop", "dropText", "fileUploaderId", "files", "disabled"], outputs: ["filesChange"] }, { kind: "ngmodule", type: ModalModule }, { kind: "component", type: i2$1.Modal, selector: "cds-modal, ibm-modal", inputs: ["size", "theme", "ariaLabel", "open", "trigger", "hasScrollingContent"], outputs: ["overlaySelected", "close"] }, { kind: "component", type: i2$1.ModalHeader, selector: "cds-modal-header, ibm-modal-header", inputs: ["theme", "closeLabel", "showCloseButton"], outputs: ["closeSelect"] }, { kind: "component", type: i2$1.ModalFooter, selector: "cds-modal-footer, ibm-modal-footer" }, { kind: "directive", type: i2$1.ModalContent, selector: "[cdsModalContent], [ibmModalContent]", inputs: ["hasForm"] }, { kind: "directive", type: i2$1.ModalHeaderHeading, selector: "[cdsModalHeaderHeading], [ibmModalHeaderHeading]" }, { kind: "ngmodule", type: LayerModule }, { kind: "directive", type: i2$1.LayerDirective, selector: "[cdsLayer], [ibmLayer]", inputs: ["ibmLayer", "cdsLayer"], exportAs: ["layer"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: ButtonModule }, { kind: "directive", type: i2$1.Button, selector: "[cdsButton], [ibmButton]", inputs: ["ibmButton", "cdsButton", "size", "skeleton", "iconOnly", "isExpressive"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
581
541
  }
582
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FormManagementUploadComponent, decorators: [{
542
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: FormManagementUploadComponent, decorators: [{
583
543
  type: Component,
584
- args: [{ selector: 'valtimo-form-management-upload', template: "<!--\n ~ Copyright 2015-2024 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-2024 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"] }]
585
- }], ctorParameters: () => [{ type: i1$2.DocumentService }, { type: i2$1.TranslateService }], propDecorators: { modal: [{
586
- type: ViewChild,
587
- args: ['uploadFormDefinitionModal']
588
- }], show$: [{
544
+ args: [{ selector: 'valtimo-form-management-upload', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [
545
+ CommonModule,
546
+ TranslateModule,
547
+ FileUploaderModule,
548
+ ModalModule,
549
+ LayerModule,
550
+ ReactiveFormsModule,
551
+ ButtonModule,
552
+ ], template: "<!--\n ~ Copyright 2015-2025 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<cds-modal valtimoCdsModal [open]=\"modalOpen$ | async\" size=\"sm\" (close)=\"closeModal()\">\n <cds-modal-header showCloseButton=\"true\" (closeSelect)=\"closeModal()\">\n <h3 cdsModalHeaderHeading>{{ 'formManagement.upload.modalTitle' | translate }}</h3>\n </cds-modal-header>\n\n <section cdsModalContent [cdsLayer]=\"1\" [formGroup]=\"form\">\n <cds-file-uploader\n [accept]=\"ACCEPTED_FILES\"\n [buttonText]=\"'formManagement.upload.buttonText' | translate\"\n [description]=\"'formManagement.upload.description' | translate\"\n [multiple]=\"false\"\n [title]=\"'formManagement.upload.title' | translate\"\n buttonType=\"primary\"\n formControlName=\"file\"\n >\n </cds-file-uploader>\n </section>\n\n <cds-modal-footer>\n <button cdsButton=\"ghost\" (click)=\"closeModal()\">\n {{ 'interface.cancel' | translate }}\n </button>\n\n <button\n cdsButton=\"primary\"\n [disabled]=\"(fileSelected$ | async) === false\"\n (click)=\"uploadFormDefinition()\"\n >\n {{ 'interface.upload' | translate }}\n </button>\n </cds-modal-footer>\n</cds-modal>\n", styles: ["/*!\n * Copyright 2015-2025 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"] }]
553
+ }], ctorParameters: () => [{ type: i2.FormBuilder }, { type: i4.GlobalNotificationService }, { type: i5.TranslateService }], propDecorators: { show$: [{
589
554
  type: Input
590
555
  }], definitionUploaded: [{
591
556
  type: Output
592
557
  }] } });
593
558
 
594
559
  /*
595
- * Copyright 2015-2024 Ritense BV, the Netherlands.
560
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
596
561
  *
597
562
  * Licensed under EUPL, Version 1.2 (the "License");
598
563
  * you may not use this file except in compliance with the License.
@@ -606,34 +571,65 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
606
571
  * See the License for the specific language governing permissions and
607
572
  * limitations under the License.
608
573
  */
609
- class FormManagementEditComponent extends PendingChangesComponent {
610
- get _formDefinition() {
611
- return this._formDefinition$.getValue();
612
- }
613
- constructor(alertService, formManagementService, modalService, pageTitleService, route, router, shellService, pageHeaderService) {
614
- super();
615
- this.alertService = alertService;
616
- this.formManagementService = formManagementService;
617
- this.modalService = modalService;
618
- this.pageTitleService = pageTitleService;
619
- this.route = route;
620
- this.router = router;
574
+
575
+ /*
576
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
577
+ *
578
+ * Licensed under EUPL, Version 1.2 (the "License");
579
+ * you may not use this file except in compliance with the License.
580
+ * You may obtain a copy of the License at
581
+ *
582
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
583
+ *
584
+ * Unless required by applicable law or agreed to in writing, software
585
+ * distributed under the License is distributed on an "AS IS" basis,
586
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
587
+ * See the License for the specific language governing permissions and
588
+ * limitations under the License.
589
+ */
590
+ class FormManagementEditComponent {
591
+ get _formDefinition() {
592
+ return this._formDefinition$.getValue();
593
+ }
594
+ constructor(formManagementService, modalService, pageTitleService, route, shellService, pageHeaderService, iconService, router, translateService, notificationService, breadcrumbService, environmentService, draftVersionService, formIoTagsService, injector) {
595
+ this.formManagementService = formManagementService;
596
+ this.modalService = modalService;
597
+ this.pageTitleService = pageTitleService;
598
+ this.route = route;
621
599
  this.shellService = shellService;
622
600
  this.pageHeaderService = pageHeaderService;
601
+ this.iconService = iconService;
602
+ this.router = router;
603
+ this.translateService = translateService;
604
+ this.notificationService = notificationService;
605
+ this.breadcrumbService = breadcrumbService;
606
+ this.environmentService = environmentService;
607
+ this.draftVersionService = draftVersionService;
608
+ this.formIoTagsService = formIoTagsService;
609
+ this.injector = injector;
623
610
  this.class = 'valtimo-form-management-edit';
611
+ this.deleteEvent = new EventEmitter();
612
+ this.goBackEvent = new EventEmitter();
613
+ this.formModifiedEvent = new EventEmitter();
614
+ this.formDeletedEvent = new EventEmitter();
615
+ this.deleteErrorEvent = new EventEmitter();
616
+ this.deployErrorEvent = new EventEmitter();
624
617
  this.modifiedFormDefinition = null;
625
618
  this.validJsonChange = null;
626
- this.CARBON_THEME = 'g10';
627
619
  this.TABS = EDIT_TABS;
628
620
  this.activeTab = EDIT_TABS.BUILDER;
621
+ this.editParam$ = this.route.paramMap.pipe(map$1(params => (params.has('formDefinitionId') ? params.get('formDefinitionId') : null)));
622
+ this.context$ = getContextObservable(this.route);
623
+ this.caseManagementRouteParams$ = this.context$.pipe(filter(context => context === 'case'), switchMap$1(() => getCaseManagementRouteParams(this.route)));
629
624
  this._formDefinition$ = new BehaviorSubject(null);
625
+ this.canUpdateGlobalConfiguration$ = this.environmentService.canUpdateGlobalConfiguration();
626
+ this.isDraftVersion$ = getCaseManagementRouteParams(this.route).pipe(switchMap$1(params => this.draftVersionService.isDraftVersion(params?.caseDefinitionKey, params?.caseDefinitionVersionTag)));
630
627
  this.formDefinition$ = this._formDefinition$.pipe(filter((definition) => !!definition), distinctUntilChanged((prevFormDefinition, currFormDefinition) => JSON.stringify(prevFormDefinition?.formDefinition?.components) ===
631
- JSON.stringify(currFormDefinition?.formDefinition?.components)), tap(() => {
628
+ JSON.stringify(currFormDefinition?.formDefinition?.components)), tap$1(() => {
632
629
  if (!this._editorInitialized) {
633
630
  this._editorInitialized = true;
634
631
  return;
635
632
  }
636
- this.pendingChanges = true;
637
633
  }));
638
634
  this.jsonFormDefinition$ = new BehaviorSubject(null);
639
635
  this.jsonOutput$ = new BehaviorSubject(null);
@@ -644,15 +640,21 @@ class FormManagementEditComponent extends PendingChangesComponent {
644
640
  this._alertSub = Subscription.EMPTY;
645
641
  this._changeActive = false;
646
642
  this._editorInitialized = false;
643
+ this.iconService.registerAll([ArrowLeft16]);
644
+ this.formIoTagsService.reregisterTags(this.injector);
647
645
  }
648
646
  ngOnInit() {
649
- this.pageTitleService.disableReset();
650
- this.loadFormDefinition();
647
+ this.loadFormDefinition().subscribe();
651
648
  this.checkToOpenUploadModal();
649
+ this.pageTitleService.disableReset();
650
+ this.initBreadcrumbs();
652
651
  }
653
652
  ngOnDestroy() {
654
653
  this._alertSub.unsubscribe();
655
654
  this.pageTitleService.enableReset();
655
+ this.pageTitleService.clearPageActionsViewContainerRef();
656
+ this.breadcrumbService.clearThirdBreadcrumb();
657
+ this.breadcrumbService.clearFourthBreadcrumb();
656
658
  }
657
659
  formBuilderChanged(event, definition) {
658
660
  if (event.type === 'updateComponent') {
@@ -668,17 +670,100 @@ class FormManagementEditComponent extends PendingChangesComponent {
668
670
  this.showDeleteModal$.next(true);
669
671
  }
670
672
  deleteFormDefinition(definition) {
671
- this.pendingChanges = false;
672
- this.formManagementService.deleteFormDefinition(definition.id).subscribe({
673
+ getCaseManagementRouteParamsAndContext(this.route)
674
+ .pipe(switchMap$1(([context, caseManagementRouteParams]) => {
675
+ switch (context) {
676
+ case 'case':
677
+ return this.formManagementService.deleteFormDefinitionCase(caseManagementRouteParams?.caseDefinitionKey, caseManagementRouteParams?.caseDefinitionVersionTag, definition.id);
678
+ case 'independent':
679
+ default:
680
+ return this.formManagementService.deleteFormDefinition(definition.id);
681
+ }
682
+ }))
683
+ .subscribe({
673
684
  next: () => {
674
- this.router.navigate(['/form-management']);
675
- this.alertService.success('Form deleted');
685
+ this.notificationService.showToast({
686
+ type: 'success',
687
+ title: this.translateService.instant('formManagement.notifications.deleted'),
688
+ });
689
+ this.navigateBack();
676
690
  },
677
691
  error: () => {
678
- this.alertService.error('Error deleting Form');
692
+ this.notificationService.showToast({
693
+ type: 'error',
694
+ title: this.translateService.instant('formManagement.notifications.deletionError'),
695
+ });
679
696
  },
680
697
  });
681
698
  }
699
+ onGoBackButtonClick() {
700
+ this.navigateBack();
701
+ }
702
+ modifyFormDefinition(definition) {
703
+ combineLatest([this.pageTitleService.customPageTitle$, this.editParam$])
704
+ .pipe(take(1))
705
+ .subscribe(([customPageTitle, formDefinitionId]) => {
706
+ if (!customPageTitle || !formDefinitionId)
707
+ return;
708
+ const form = JSON.stringify(this.modifiedFormDefinition !== null
709
+ ? this.modifiedFormDefinition
710
+ : definition.formDefinition);
711
+ const request = {
712
+ id: formDefinitionId,
713
+ name: customPageTitle,
714
+ formDefinition: form,
715
+ };
716
+ getCaseManagementRouteParamsAndContext(this.route)
717
+ .pipe(switchMap$1(([context, caseManagementRouteParams]) => {
718
+ switch (context) {
719
+ case 'case':
720
+ return this.formManagementService.modifyFormDefinitionCase(caseManagementRouteParams.caseDefinitionKey, caseManagementRouteParams.caseDefinitionVersionTag, request);
721
+ case 'independent':
722
+ default:
723
+ return this.formManagementService.modifyFormDefinition(request);
724
+ }
725
+ }))
726
+ .subscribe({
727
+ next: () => {
728
+ this.notificationService.showToast({
729
+ type: 'success',
730
+ title: this.translateService.instant('formManagement.notifications.deployed'),
731
+ });
732
+ this.navigateBack();
733
+ },
734
+ error: () => {
735
+ this.notificationService.showToast({
736
+ type: 'error',
737
+ title: this.translateService.instant('formManagement.notifications.deploymentError'),
738
+ });
739
+ },
740
+ });
741
+ });
742
+ }
743
+ loadFormDefinition(setDefinition = true) {
744
+ return getCaseManagementRouteParamsAndContext(this.route).pipe(switchMap$1(([context, params]) => combineLatest([of(context), of(params), this.editParam$])), switchMap$1(([context, caseManagementRouteParams, formDefinitionId]) => {
745
+ if (!formDefinitionId)
746
+ return of(null);
747
+ switch (context) {
748
+ case 'case':
749
+ return this.formManagementService.getFormDefinitionCase(caseManagementRouteParams.caseDefinitionKey, caseManagementRouteParams.caseDefinitionVersionTag, formDefinitionId);
750
+ case 'independent':
751
+ default:
752
+ return this.formManagementService.getFormDefinition(formDefinitionId);
753
+ }
754
+ }), tap$1((definition) => {
755
+ if (!definition)
756
+ return;
757
+ if (setDefinition)
758
+ this._formDefinition$.next(definition);
759
+ if (setDefinition)
760
+ this.jsonFormDefinition$.next({
761
+ value: JSON.stringify(definition.formDefinition),
762
+ language: 'json',
763
+ });
764
+ this.pageTitleService.setCustomPageTitle(definition.name);
765
+ }));
766
+ }
682
767
  downloadFormDefinition(definition) {
683
768
  const file = new Blob([JSON.stringify(definition.formDefinition)], {
684
769
  type: 'text/json',
@@ -690,26 +775,9 @@ class FormManagementEditComponent extends PendingChangesComponent {
690
775
  window.URL.revokeObjectURL(link.href);
691
776
  link.remove();
692
777
  }
693
- modifyFormDefinition(definition) {
694
- this.pendingChanges = false;
695
- const form = JSON.stringify(this.modifiedFormDefinition !== null ? this.modifiedFormDefinition : definition.formDefinition);
696
- const request = {
697
- id: definition.id,
698
- name: definition.name,
699
- formDefinition: form,
700
- };
701
- this.formManagementService.modifyFormDefinition(request).subscribe({
702
- next: () => {
703
- this.router.navigate(['/form-management']);
704
- this.alertService.success('Form deployed');
705
- },
706
- error: () => {
707
- this.alertService.error('Error deploying Form');
708
- },
709
- });
710
- }
711
778
  onSelectedTab(tab) {
712
779
  this.activeTab = tab;
780
+ this.formIoTagsService.reregisterTags(this.injector);
713
781
  if (tab === EDIT_TABS.BUILDER) {
714
782
  return;
715
783
  }
@@ -749,11 +817,17 @@ class FormManagementEditComponent extends PendingChangesComponent {
749
817
  this.showModal$.next(true);
750
818
  }
751
819
  showDuplicateModal(definition) {
752
- this.modalService.create({
753
- component: FormManagementDuplicateComponent,
754
- inputs: {
755
- formToDuplicate: definition,
756
- },
820
+ getCaseManagementRouteParamsAndContext(this.route)
821
+ .pipe(take(1))
822
+ .subscribe(([context, params]) => {
823
+ this.modalService.create({
824
+ component: FormManagementDuplicateComponent,
825
+ inputs: {
826
+ formToDuplicate: definition,
827
+ context,
828
+ params,
829
+ },
830
+ });
757
831
  });
758
832
  }
759
833
  setFormDefinition(formDefinition) {
@@ -761,7 +835,6 @@ class FormManagementEditComponent extends PendingChangesComponent {
761
835
  const definition = JSON.parse(formDefinition);
762
836
  if (!definition?.components) {
763
837
  this.reloading$.next(false);
764
- this.alertService.error('Invalid form.io. Missing JSON field "components".');
765
838
  return;
766
839
  }
767
840
  const components = definition.components;
@@ -769,10 +842,12 @@ class FormManagementEditComponent extends PendingChangesComponent {
769
842
  const newDefinition = { ...currentDefinition, ...(components && { components }) };
770
843
  this.modifiedFormDefinition = newDefinition;
771
844
  definition.formDefinition = newDefinition;
845
+ this._formDefinition$.next(definition);
772
846
  this.jsonFormDefinition$.next({
773
847
  value: JSON.stringify(newDefinition),
774
848
  language: 'json',
775
849
  });
850
+ this.loadFormDefinition(false).subscribe(() => this.reloading$.next(false));
776
851
  }
777
852
  onConfirmRedirect() {
778
853
  const cancelButton = document.querySelector('button[ref="cancelButton"]');
@@ -788,31 +863,364 @@ class FormManagementEditComponent extends PendingChangesComponent {
788
863
  }
789
864
  });
790
865
  }
791
- loadFormDefinition() {
792
- this.route.paramMap
793
- .pipe(take(1), switchMap((paramMap) => this.formManagementService.getFormDefinition(paramMap.get('id') ?? '')))
794
- .subscribe((definition) => {
795
- this._formDefinition$.next(definition);
796
- this.pageTitleService.setCustomPageTitle(definition.name);
797
- this.jsonFormDefinition$.next({
798
- value: JSON.stringify(definition.formDefinition),
799
- language: 'json',
866
+ navigateBack() {
867
+ this.router.navigate(['../'], { relativeTo: this.route });
868
+ }
869
+ initBreadcrumbs() {
870
+ getCaseManagementRouteParamsAndContext(this.route)
871
+ .pipe(take(1))
872
+ .subscribe(([context, params]) => {
873
+ if (context === 'independent')
874
+ return;
875
+ const route = `/case-management/case/${params.caseDefinitionKey}/version/${params.caseDefinitionVersionTag}`;
876
+ this.breadcrumbService.setThirdBreadcrumb({
877
+ route: [route],
878
+ content: `${params.caseDefinitionKey} (${params.caseDefinitionVersionTag})`,
879
+ href: route,
880
+ });
881
+ const routeWithForms = `${route}/forms`;
882
+ this.breadcrumbService.setFourthBreadcrumb({
883
+ route: [routeWithForms],
884
+ content: this.translateService.instant('caseManagement.tabs.forms'),
885
+ href: routeWithForms,
800
886
  });
801
887
  });
802
888
  }
803
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FormManagementEditComponent, deps: [{ token: i1$1.AlertService }, { token: FormManagementService }, { token: i3.ModalService }, { token: i1$1.PageTitleService }, { token: i3$1.ActivatedRoute }, { token: i3$1.Router }, { token: i1$1.ShellService }, { token: i1$1.PageHeaderService }], target: i0.ɵɵFactoryTarget.Component }); }
804
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.12", type: FormManagementEditComponent, selector: "valtimo-form-management-edit", host: { properties: { "class": "this.class" } }, usesInheritance: true, ngImport: i0, template: "<!--\n ~ Copyright 2015-2024 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<ng-container\n *ngIf=\"{\n formDefinition: formDefinition$ | async,\n jsonFormDefinition: jsonFormDefinition$ | async,\n jsonOutput: jsonOutput$ | async,\n compactMode: compactMode$ | async,\n } as obs\"\n>\n @if (obs.formDefinition) {\n <ng-container renderInPageHeader [fullWidth]=\"true\">\n <ng-template>\n <div\n class=\"valtimo-form-management-edit__header-container\"\n [ngClass]=\"{'--compact': obs.compactMode}\"\n >\n @if (obs.formDefinition.readOnly) {\n <cds-tag size=\"sm\" type=\"blue\">{{ 'formManagement.readOnly' | translate }}</cds-tag>\n }\n\n <div class=\"valtimo-form-management-edit__header\">\n <cds-overflow-menu>\n <cds-overflow-menu-option (selected)=\"downloadFormDefinition(obs.formDefinition)\">\n {{ 'Download' | translate }}\n </cds-overflow-menu-option>\n\n <cds-overflow-menu-option\n [disabled]=\"obs.formDefinition.readOnly\"\n (selected)=\"showUploadModal()\"\n >\n {{ 'Upload' | translate }}\n </cds-overflow-menu-option>\n\n <cds-overflow-menu-option\n [disabled]=\"obs.formDefinition.readOnly\"\n (selected)=\"delete(obs.formDefinition)\"\n >\n {{ 'interface.delete' | translate }}\n </cds-overflow-menu-option>\n\n <cds-overflow-menu-option (selected)=\"showDuplicateModal(obs.formDefinition)\">\n {{ 'formManagement.duplicate' | translate }}\n </cds-overflow-menu-option>\n </cds-overflow-menu>\n\n <button\n cdsButton=\"primary\"\n [disabled]=\"obs.formDefinition.readOnly || !validJsonChange\"\n [size]=\"obs.compactMode ? 'sm' : 'md'\"\n (click)=\"modifyFormDefinition(obs.formDefinition)\"\n >\n {{ 'interface.save' | translate }}\n\n <svg class=\"cds--btn__icon\" cdsIcon=\"save\" size=\"16\"></svg>\n </button>\n </div>\n </div>\n </ng-template>\n </ng-container>\n\n <cds-tabs type=\"contained\">\n <cds-tab [heading]=\"TABS.BUILDER | translate\" (selected)=\"onSelectedTab(TABS.BUILDER)\">\n <valtimo-form-io-builder\n *ngIf=\"(reloading$ | async) === false && activeTab === TABS.BUILDER\"\n [form]=\"obs.formDefinition.formDefinition\"\n (change)=\"formBuilderChanged($event, obs.jsonFormDefinition)\"\n ></valtimo-form-io-builder>\n </cds-tab>\n\n <cds-tab [heading]=\"TABS.EDITOR | translate\" (selected)=\"onSelectedTab(TABS.EDITOR)\">\n <ng-container\n *ngTemplateOutlet=\"\n jsonEditor;\n context: {\n data: {\n disabled: obs.formDefinition.readOnly,\n formDefinition: obs.formDefinition,\n model: obs.jsonFormDefinition,\n },\n }\n \"\n ></ng-container>\n </cds-tab>\n\n <cds-tab\n [heading]=\"TABS.OUTPUT | translate\"\n (selected)=\"onSelectedTab(TABS.OUTPUT)\"\n class=\"valtimo-form-management-edit__output\"\n >\n <valtimo-form-io\n [form]=\"obs.formDefinition.formDefinition\"\n (change)=\"onOutputChange($event)\"\n ></valtimo-form-io>\n\n <ng-container\n *ngTemplateOutlet=\"\n jsonEditor;\n context: {\n data: {disabled: true, formDefinition: obs.formDefinition, model: obs.jsonOutput},\n }\n \"\n ></ng-container>\n </cds-tab>\n </cds-tabs>\n } @else {\n <valtimo-spinner></valtimo-spinner>\n }\n\n <valtimo-confirmation-modal\n confirmButtonTextTranslationKey=\"interface.delete\"\n confirmButtonType=\"danger\"\n contentTranslationKey=\"interface.deleteConfirmation\"\n cancelButtonTextTranslationKey=\"interface.cancel\"\n [outputOnConfirm]=\"obs.formDefinition\"\n [showModalSubject$]=\"showDeleteModal$\"\n titleTranslationKey=\"dashboardManagement.delete\"\n (confirmEvent)=\"deleteFormDefinition($event)\"\n ></valtimo-confirmation-modal>\n\n <valtimo-form-management-upload\n [show$]=\"showModal$\"\n (definitionUploaded)=\"setFormDefinition($event)\"\n ></valtimo-form-management-upload>\n\n <ng-template #jsonEditor let-data=\"data\">\n <valtimo-editor\n [model]=\"data.model\"\n [disabled]=\"data.disabled\"\n (validEvent)=\"onValidEvent($event, data.disabled)\"\n (valueChangeEvent)=\"onValueChangeEvent($event, data.formDefinition, data.disabled)\"\n [fitPage]=\"true\"\n [fitPageExtraSpace]=\"80\"\n ></valtimo-editor>\n </ng-template>\n</ng-container>\n", styles: [".valtimo-form-management-edit__header{display:flex;align-items:center;justify-content:flex-end;gap:16px;margin-left:auto}.valtimo-form-management-edit__header-container{width:100%;display:flex;justify-content:space-between;align-items:flex-end;padding-bottom:4px}.valtimo-form-management-edit__header-container .cds--tag{margin:0;height:var(--cds-layout-size-height-md)}.valtimo-form-management-edit__header-container.--compact{align-items:flex-start;padding-bottom:0}.valtimo-form-management-edit__output .cds--tab-content{display:grid;grid-template-columns:1fr 1fr}.valtimo-form-management-edit__output .cds--tab-content>*{min-width:100%!important}.valtimo-form-management-edit .formbuilder .btn.formcomponent.drag-copy,.valtimo-form-management-edit .btn.formcomponent.gu-mirror{font-weight:400;background-color:silver;border-color:silver;color:#fff}.valtimo-form-management-edit .formbuilder .btn.formcomponent.drag-copy:hover,.valtimo-form-management-edit .formbuilder .btn.formcomponent.drag-copy:active,.valtimo-form-management-edit .btn.formcomponent.gu-mirror:hover,.valtimo-form-management-edit .btn.formcomponent.gu-mirror:active{box-shadow:none}.valtimo-form-management-edit .formbuilder .btn.formcomponent.drag-copy:active,.valtimo-form-management-edit .btn.formcomponent.gu-mirror:active{background-color:silver;border-color:silver}.valtimo-form-management-edit .formbuilder-header{padding-left:18px;padding-right:18px;font-size:18px;height:80px;border:1px solid #dee2e6;border-bottom:0}.valtimo-form-management-edit .formbuilder-header .formbuilder-title{margin-top:21px;margin-bottom:7px}.valtimo-form-management-edit .formbuilder-header .formbuilder-subtitle{margin-top:0;margin-bottom:12px}.valtimo-form-management-edit .formbuilder{background:#fff;padding:1rem;border:1px solid #dee2e6;margin-right:0!important;margin-left:0!important}.valtimo-form-management-edit .formbuilder .form-builder-panel .builder-group-button[aria-expanded=false],.valtimo-form-management-edit .formbuilder .form-builder-panel .builder-group-button[aria-expanded=\"\"]{color:#a9a9a9}.valtimo-form-management-edit .formbuilder .form-builder-panel .builder-group-button[aria-expanded=true]{color:#000}.valtimo-form-management-edit .formbuilder .drag-and-drop-alert{display:none}.valtimo-form-management-edit .formbuilder .formarea{padding:10px;border:solid 1px silver;background-color:#fff}.valtimo-form-management-edit .increase-size{font-size:1rem}.valtimo-form-management-edit .cds--tab-content{background:#fff!important}\n/*!\n * Copyright 2015-2024 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: i1$1.FormioComponent, selector: "valtimo-form-io", inputs: ["options", "submission", "form", "readOnly", "formRefresh$"], outputs: ["submit", "change", "event"] }, { kind: "component", type: i1$1.FormioBuilderComponent, selector: "valtimo-form-io-builder", inputs: ["form"], outputs: ["change"] }, { kind: "directive", type: i5.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i5.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i3.Button, selector: "[cdsButton], [ibmButton]", inputs: ["ibmButton", "cdsButton", "size", "skeleton", "iconOnly", "isExpressive"] }, { kind: "component", type: i3.OverflowMenu, selector: "cds-overflow-menu, ibm-overflow-menu", inputs: ["buttonLabel", "flip", "placement", "open", "customTrigger", "offset", "wrapperClass", "triggerClass"], outputs: ["openChange"] }, { kind: "component", type: i3.OverflowMenuOption, selector: "cds-overflow-menu-option, ibm-overflow-menu-option", inputs: ["divider", "type", "disabled", "href", "target", "innerClass"], outputs: ["selected"] }, { kind: "directive", type: i1$1.RenderInPageHeaderDirective, selector: "[renderInPageHeader]", inputs: ["fullWidth"] }, { kind: "component", type: i3.Tabs, selector: "cds-tabs, ibm-tabs", inputs: ["position", "cacheActive", "followFocus", "isNavigation", "ariaLabel", "ariaLabelledby", "type", "theme", "skeleton"] }, { kind: "component", type: i3.Tab, selector: "cds-tab, ibm-tab", inputs: ["heading", "title", "context", "active", "disabled", "tabIndex", "id", "cacheActive", "tabContent", "templateContext"], outputs: ["selected"] }, { kind: "component", type: i1$1.EditorComponent, selector: "valtimo-editor", inputs: ["editorOptions", "model", "disabled", "formatOnLoad", "widthPx", "heightPx", "heightStyle", "jsonSchema", "fitPage", "fitPageExtraSpace"], outputs: ["validEvent", "valueChangeEvent"] }, { kind: "component", type: i1$1.SpinnerComponent, selector: "valtimo-spinner", inputs: ["useBootstrapSpinner", "name", "type", "size", "color", "bdColor", "fullScreen", "noMarginTop"] }, { kind: "directive", type: i3.IconDirective, selector: "[cdsIcon], [ibmIcon]", inputs: ["ibmIcon", "cdsIcon", "size", "title", "ariaLabel", "ariaLabelledBy", "ariaHidden", "isFocusable"] }, { kind: "component", type: i1$1.ConfirmationModalComponent, selector: "valtimo-confirmation-modal", inputs: ["titleTranslationKey", "title", "content", "contentTranslationKey", "confirmButtonText", "confirmButtonTextTranslationKey", "confirmButtonType", "showOptionalButton", "optionalButtonText", "optionalButtonTextTranslationKey", "optionalButtonType", "cancelButtonText", "cancelButtonTextTranslationKey", "cancelButtonType", "showModalSubject$", "outputOnConfirm", "outputOnOptional", "spacerAfterCancelButton"], outputs: ["confirmEvent", "optionalEvent", "cancelEvent"] }, { kind: "component", type: i3.Tag, selector: "cds-tag, ibm-tag", inputs: ["type", "size", "class"] }, { 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 }); }
889
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: FormManagementEditComponent, deps: [{ token: FormManagementService }, { token: i2$1.ModalService }, { token: i3$1.PageTitleService }, { token: i3.ActivatedRoute }, { token: i3$1.ShellService }, { token: i3$1.PageHeaderService }, { token: i2$1.IconService }, { token: i3.Router }, { token: i5.TranslateService }, { token: i4.GlobalNotificationService }, { token: i3$1.BreadcrumbService }, { token: i4.EnvironmentService }, { token: i4.DraftVersionService }, { token: i3$1.FormIoTagsService }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component }); }
890
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.15", type: FormManagementEditComponent, isStandalone: true, selector: "valtimo-form-management-edit", outputs: { deleteEvent: "deleteEvent", goBackEvent: "goBackEvent", formModifiedEvent: "formModifiedEvent", formDeletedEvent: "formDeletedEvent", deleteErrorEvent: "deleteErrorEvent", deployErrorEvent: "deployErrorEvent" }, host: { properties: { "class": "this.class" } }, ngImport: i0, template: "<!--\n ~ Copyright 2015-2025 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<ng-container\n *ngIf=\"{\n formDefinition: formDefinition$ | async,\n jsonFormDefinition: jsonFormDefinition$ | async,\n jsonOutput: jsonOutput$ | async,\n compactMode: compactMode$ | async,\n context: context$ | async,\n canUpdateGlobalConfiguration: canUpdateGlobalConfiguration$ | async,\n isDraftVersion: isDraftVersion$ | async,\n } as obs\"\n>\n @if (obs.formDefinition) {\n <ng-container renderInPageHeader [fullWidth]=\"true\">\n <ng-template>\n <ng-container *ngTemplateOutlet=\"actions; context: {obs: obs}\"></ng-container>\n </ng-template>\n </ng-container>\n\n <cds-tabs type=\"contained\">\n <cds-tab [heading]=\"TABS.BUILDER | translate\" (selected)=\"onSelectedTab(TABS.BUILDER)\">\n <valtimo-form-io-builder\n *ngIf=\"(reloading$ | async) === false && activeTab === TABS.BUILDER\"\n [form]=\"obs.formDefinition.formDefinition\"\n (change)=\"formBuilderChanged($event, obs.jsonFormDefinition)\"\n ></valtimo-form-io-builder>\n </cds-tab>\n\n <cds-tab [heading]=\"TABS.EDITOR | translate\" (selected)=\"onSelectedTab(TABS.EDITOR)\">\n @if (activeTab === TABS.EDITOR) {\n <ng-container\n *ngTemplateOutlet=\"\n jsonEditor;\n context: {\n data: {\n disabled: obs.formDefinition.readOnly || !obs.canUpdateGlobalConfiguration,\n formDefinition: obs.formDefinition,\n model: obs.jsonFormDefinition,\n },\n }\n \"\n ></ng-container>\n }\n </cds-tab>\n\n <cds-tab\n [heading]=\"TABS.OUTPUT | translate\"\n (selected)=\"onSelectedTab(TABS.OUTPUT)\"\n class=\"valtimo-form-management-edit__output\"\n >\n <valtimo-form-io\n *ngIf=\"activeTab === TABS.OUTPUT\"\n [form]=\"obs.formDefinition.formDefinition\"\n (change)=\"onOutputChange($event)\"\n ></valtimo-form-io>\n\n @if (activeTab === TABS.OUTPUT) {\n <ng-container\n *ngTemplateOutlet=\"\n jsonEditor;\n context: {\n data: {disabled: true, formDefinition: obs.formDefinition, model: obs.jsonOutput},\n }\n \"\n ></ng-container>\n }\n </cds-tab>\n </cds-tabs>\n } @else {\n <cds-loading></cds-loading>\n }\n\n <valtimo-confirmation-modal\n confirmButtonTextTranslationKey=\"interface.delete\"\n confirmButtonType=\"danger\"\n contentTranslationKey=\"interface.deleteConfirmation\"\n cancelButtonTextTranslationKey=\"interface.cancel\"\n [outputOnConfirm]=\"obs.formDefinition\"\n [showModalSubject$]=\"showDeleteModal$\"\n titleTranslationKey=\"dashboardManagement.delete\"\n (confirmEvent)=\"deleteFormDefinition($event)\"\n ></valtimo-confirmation-modal>\n\n <valtimo-form-management-upload\n [show$]=\"showModal$\"\n (definitionUploaded)=\"setFormDefinition($event)\"\n ></valtimo-form-management-upload>\n\n <ng-template #jsonEditor let-data=\"data\">\n <valtimo-editor\n [model]=\"data.model\"\n [disabled]=\"data.disabled\"\n (validEvent)=\"onValidEvent($event, data.disabled)\"\n (valueChangeEvent)=\"onValueChangeEvent($event, data.formDefinition, data.disabled)\"\n [fitPage]=\"true\"\n [fitPageExtraSpace]=\"80\"\n ></valtimo-editor>\n </ng-template>\n</ng-container>\n\n<ng-template #actions let-obs=\"obs\">\n <div\n class=\"valtimo-form-management-edit__header-container\"\n [ngClass]=\"{\n '--compact': obs.compactMode,\n 'valtimo-form-management-edit__header-container-case': obs?.context === 'case',\n }\"\n >\n @if (obs.formDefinition.readOnly || !obs.canUpdateGlobalConfiguration) {\n <cds-tag size=\"sm\" type=\"blue\">{{ 'formManagement.readOnly' | translate }}</cds-tag>\n }\n\n <div class=\"valtimo-form-management-edit__header\">\n <cds-overflow-menu>\n <cds-overflow-menu-option (selected)=\"downloadFormDefinition(obs.formDefinition)\">\n {{ 'Download' | translate }}\n </cds-overflow-menu-option>\n\n <cds-overflow-menu-option\n [disabled]=\"obs.formDefinition.readOnly || !obs.canUpdateGlobalConfiguration\"\n (selected)=\"showUploadModal()\"\n >\n {{ 'Upload' | translate }}\n </cds-overflow-menu-option>\n\n <cds-overflow-menu-option\n *ngIf=\"(obs.context === 'case' && obs.isDraftVersion) || obs.context === 'independent'\"\n (selected)=\"showDuplicateModal(obs.formDefinition)\"\n >\n {{ 'formManagement.duplicate' | translate }}\n </cds-overflow-menu-option>\n\n <cds-overflow-menu-option\n [disabled]=\"obs.formDefinition.readOnly || !obs.canUpdateGlobalConfiguration\"\n type=\"danger\"\n (selected)=\"delete()\"\n >\n {{ 'interface.delete' | translate }}\n </cds-overflow-menu-option>\n </cds-overflow-menu>\n\n @if (obs.context === 'case') {\n <button\n cdsButton=\"secondary\"\n [size]=\"obs.compactMode ? 'sm' : 'md'\"\n (click)=\"onGoBackButtonClick()\"\n >\n <svg class=\"cds--btn__icon\" cdsIcon=\"arrow--left\" size=\"16\"></svg>\n\n <span>{{ 'interface.back' | translate }}</span>\n </button>\n }\n\n <button\n *ngIf=\"\n (obs?.canUpdateGlobalConfiguration && obs?.isDraftVersion) ||\n obs.context === 'independent'\n \"\n cdsButton=\"primary\"\n [disabled]=\"obs.formDefinition.readOnly\"\n [size]=\"obs.compactMode ? 'sm' : 'md'\"\n (click)=\"modifyFormDefinition(obs.formDefinition)\"\n >\n {{ 'interface.save' | translate }}\n\n <svg class=\"cds--btn__icon\" cdsIcon=\"save\" size=\"16\"></svg>\n </button>\n </div>\n </div>\n</ng-template>\n", styles: [".valtimo-form-management-edit__header{display:flex;align-items:center;justify-content:flex-end;gap:16px;margin-left:auto}.valtimo-form-management-edit__case-header{display:flex;width:100%;justify-content:flex-end}.valtimo-form-management-edit__header-container{width:100%;display:flex;justify-content:space-between;align-items:flex-end;padding-bottom:4px}.valtimo-form-management-edit__header-container .cds--tag{margin:0;height:var(--cds-layout-size-height-md)}.valtimo-form-management-edit__header-container.--compact{align-items:flex-start;padding-bottom:0}.valtimo-form-management-edit__header-container-case{padding-bottom:24px}.valtimo-form-management-edit__output .cds--tab-content{display:grid;grid-template-columns:1fr 1fr}.valtimo-form-management-edit__output .cds--tab-content>*{min-width:100%!important}.valtimo-form-management-edit .formbuilder .btn.formcomponent.drag-copy,.valtimo-form-management-edit .btn.formcomponent.gu-mirror{font-weight:400;background-color:silver;border-color:silver;color:#fff}.valtimo-form-management-edit .formbuilder .btn.formcomponent.drag-copy:hover,.valtimo-form-management-edit .formbuilder .btn.formcomponent.drag-copy:active,.valtimo-form-management-edit .btn.formcomponent.gu-mirror:hover,.valtimo-form-management-edit .btn.formcomponent.gu-mirror:active{box-shadow:none}.valtimo-form-management-edit .formbuilder .btn.formcomponent.drag-copy:active,.valtimo-form-management-edit .btn.formcomponent.gu-mirror:active{background-color:silver;border-color:silver}.valtimo-form-management-edit .formbuilder-header{padding-left:18px;padding-right:18px;font-size:18px;height:80px;border:1px solid #dee2e6;border-bottom:0}.valtimo-form-management-edit .formbuilder-header .formbuilder-title{margin-top:21px;margin-bottom:7px}.valtimo-form-management-edit .formbuilder-header .formbuilder-subtitle{margin-top:0;margin-bottom:12px}.valtimo-form-management-edit .formbuilder{background:#fff;padding:1rem;border:1px solid #dee2e6;margin-right:0!important;margin-left:0!important}.valtimo-form-management-edit .formbuilder .form-builder-panel .builder-group-button[aria-expanded=false],.valtimo-form-management-edit .formbuilder .form-builder-panel .builder-group-button[aria-expanded=\"\"]{color:#a9a9a9}.valtimo-form-management-edit .formbuilder .form-builder-panel .builder-group-button[aria-expanded=true]{color:#000}.valtimo-form-management-edit .formbuilder .drag-and-drop-alert{display:none}.valtimo-form-management-edit .formbuilder .formarea{padding:10px;border:solid 1px silver;background-color:#fff}.valtimo-form-management-edit .increase-size{font-size:1rem}.valtimo-form-management-edit .cds--tab-content{background:#fff!important}\n/*!\n * Copyright 2015-2025 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: "ngmodule", type: CommonModule }, { kind: "directive", type: i7.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i7.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i7.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "pipe", type: i7.AsyncPipe, name: "async" }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i5.TranslatePipe, name: "translate" }, { kind: "ngmodule", type: ModalModule }, { kind: "ngmodule", type: ButtonModule }, { kind: "directive", type: i2$1.Button, selector: "[cdsButton], [ibmButton]", inputs: ["ibmButton", "cdsButton", "size", "skeleton", "iconOnly", "isExpressive"] }, { kind: "ngmodule", type: InputModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "ngmodule", type: FormsModule }, { kind: "ngmodule", type: WidgetModule }, { kind: "ngmodule", type: CarbonListModule }, { kind: "ngmodule", type: TabsModule }, { kind: "component", type: i2$1.Tabs, selector: "cds-tabs, ibm-tabs", inputs: ["position", "cacheActive", "followFocus", "isNavigation", "ariaLabel", "ariaLabelledby", "type", "theme", "skeleton"] }, { kind: "component", type: i2$1.Tab, selector: "cds-tab, ibm-tab", inputs: ["heading", "title", "context", "active", "disabled", "tabIndex", "id", "cacheActive", "tabContent", "templateContext"], outputs: ["selected"] }, { kind: "ngmodule", type: EditorModule }, { kind: "component", type: i3$1.EditorComponent, selector: "valtimo-editor", inputs: ["editorOptions", "model", "disabled", "formatOnLoad", "widthPx", "heightPx", "heightStyle", "jsonSchema", "fitPage", "fitPageExtraSpace"], outputs: ["validEvent", "valueChangeEvent"] }, { kind: "ngmodule", type: FormIoModule }, { kind: "component", type: i3$1.FormioComponent, selector: "valtimo-form-io", inputs: ["options", "submission", "form", "readOnly", "formRefresh$"], outputs: ["submit", "change", "event"] }, { kind: "component", type: i3$1.FormioBuilderComponent, selector: "valtimo-form-io-builder", inputs: ["form"], outputs: ["change"] }, { kind: "directive", type: RenderInPageHeaderDirective, selector: "[renderInPageHeader]", inputs: ["fullWidth"] }, { kind: "ngmodule", type: DialogModule }, { kind: "component", type: i2$1.OverflowMenu, selector: "cds-overflow-menu, ibm-overflow-menu", inputs: ["buttonLabel", "description", "flip", "placement", "open", "customTrigger", "offset", "wrapperClass", "triggerClass"], outputs: ["openChange"] }, { kind: "component", type: i2$1.OverflowMenuOption, selector: "cds-overflow-menu-option, ibm-overflow-menu-option", inputs: ["divider", "type", "disabled", "href", "target", "innerClass"], outputs: ["selected"] }, { kind: "ngmodule", type: TagModule }, { kind: "component", type: i2$1.Tag, selector: "cds-tag, ibm-tag", inputs: ["type", "size", "class", "skeleton"] }, { kind: "ngmodule", type: ConfirmationModalModule }, { kind: "component", type: i3$1.ConfirmationModalComponent, selector: "valtimo-confirmation-modal", inputs: ["titleTranslationKey", "title", "content", "contentTranslationKey", "confirmButtonText", "confirmButtonTextTranslationKey", "confirmButtonType", "showOptionalButton", "optionalButtonText", "optionalButtonTextTranslationKey", "optionalButtonType", "cancelButtonText", "cancelButtonTextTranslationKey", "cancelButtonType", "showModalSubject$", "outputOnConfirm", "outputOnOptional", "spacerAfterCancelButton"], outputs: ["confirmEvent", "optionalEvent", "cancelEvent"] }, { kind: "ngmodule", type: SpinnerModule }, { kind: "component", type: FormManagementUploadComponent, selector: "valtimo-form-management-upload", inputs: ["show$"], outputs: ["definitionUploaded"] }, { kind: "ngmodule", type: IconModule }, { kind: "directive", type: i2$1.IconDirective, selector: "[cdsIcon], [ibmIcon]", inputs: ["ibmIcon", "cdsIcon", "size", "title", "ariaLabel", "ariaLabelledBy", "ariaHidden", "isFocusable"] }, { kind: "ngmodule", type: LoadingModule }, { kind: "component", type: i2$1.Loading, selector: "cds-loading, ibm-loading", inputs: ["title", "isActive", "size", "overlay"] }], encapsulation: i0.ViewEncapsulation.None }); }
805
891
  }
806
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FormManagementEditComponent, decorators: [{
892
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: FormManagementEditComponent, decorators: [{
807
893
  type: Component,
808
- args: [{ selector: 'valtimo-form-management-edit', encapsulation: ViewEncapsulation.None, template: "<!--\n ~ Copyright 2015-2024 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<ng-container\n *ngIf=\"{\n formDefinition: formDefinition$ | async,\n jsonFormDefinition: jsonFormDefinition$ | async,\n jsonOutput: jsonOutput$ | async,\n compactMode: compactMode$ | async,\n } as obs\"\n>\n @if (obs.formDefinition) {\n <ng-container renderInPageHeader [fullWidth]=\"true\">\n <ng-template>\n <div\n class=\"valtimo-form-management-edit__header-container\"\n [ngClass]=\"{'--compact': obs.compactMode}\"\n >\n @if (obs.formDefinition.readOnly) {\n <cds-tag size=\"sm\" type=\"blue\">{{ 'formManagement.readOnly' | translate }}</cds-tag>\n }\n\n <div class=\"valtimo-form-management-edit__header\">\n <cds-overflow-menu>\n <cds-overflow-menu-option (selected)=\"downloadFormDefinition(obs.formDefinition)\">\n {{ 'Download' | translate }}\n </cds-overflow-menu-option>\n\n <cds-overflow-menu-option\n [disabled]=\"obs.formDefinition.readOnly\"\n (selected)=\"showUploadModal()\"\n >\n {{ 'Upload' | translate }}\n </cds-overflow-menu-option>\n\n <cds-overflow-menu-option\n [disabled]=\"obs.formDefinition.readOnly\"\n (selected)=\"delete(obs.formDefinition)\"\n >\n {{ 'interface.delete' | translate }}\n </cds-overflow-menu-option>\n\n <cds-overflow-menu-option (selected)=\"showDuplicateModal(obs.formDefinition)\">\n {{ 'formManagement.duplicate' | translate }}\n </cds-overflow-menu-option>\n </cds-overflow-menu>\n\n <button\n cdsButton=\"primary\"\n [disabled]=\"obs.formDefinition.readOnly || !validJsonChange\"\n [size]=\"obs.compactMode ? 'sm' : 'md'\"\n (click)=\"modifyFormDefinition(obs.formDefinition)\"\n >\n {{ 'interface.save' | translate }}\n\n <svg class=\"cds--btn__icon\" cdsIcon=\"save\" size=\"16\"></svg>\n </button>\n </div>\n </div>\n </ng-template>\n </ng-container>\n\n <cds-tabs type=\"contained\">\n <cds-tab [heading]=\"TABS.BUILDER | translate\" (selected)=\"onSelectedTab(TABS.BUILDER)\">\n <valtimo-form-io-builder\n *ngIf=\"(reloading$ | async) === false && activeTab === TABS.BUILDER\"\n [form]=\"obs.formDefinition.formDefinition\"\n (change)=\"formBuilderChanged($event, obs.jsonFormDefinition)\"\n ></valtimo-form-io-builder>\n </cds-tab>\n\n <cds-tab [heading]=\"TABS.EDITOR | translate\" (selected)=\"onSelectedTab(TABS.EDITOR)\">\n <ng-container\n *ngTemplateOutlet=\"\n jsonEditor;\n context: {\n data: {\n disabled: obs.formDefinition.readOnly,\n formDefinition: obs.formDefinition,\n model: obs.jsonFormDefinition,\n },\n }\n \"\n ></ng-container>\n </cds-tab>\n\n <cds-tab\n [heading]=\"TABS.OUTPUT | translate\"\n (selected)=\"onSelectedTab(TABS.OUTPUT)\"\n class=\"valtimo-form-management-edit__output\"\n >\n <valtimo-form-io\n [form]=\"obs.formDefinition.formDefinition\"\n (change)=\"onOutputChange($event)\"\n ></valtimo-form-io>\n\n <ng-container\n *ngTemplateOutlet=\"\n jsonEditor;\n context: {\n data: {disabled: true, formDefinition: obs.formDefinition, model: obs.jsonOutput},\n }\n \"\n ></ng-container>\n </cds-tab>\n </cds-tabs>\n } @else {\n <valtimo-spinner></valtimo-spinner>\n }\n\n <valtimo-confirmation-modal\n confirmButtonTextTranslationKey=\"interface.delete\"\n confirmButtonType=\"danger\"\n contentTranslationKey=\"interface.deleteConfirmation\"\n cancelButtonTextTranslationKey=\"interface.cancel\"\n [outputOnConfirm]=\"obs.formDefinition\"\n [showModalSubject$]=\"showDeleteModal$\"\n titleTranslationKey=\"dashboardManagement.delete\"\n (confirmEvent)=\"deleteFormDefinition($event)\"\n ></valtimo-confirmation-modal>\n\n <valtimo-form-management-upload\n [show$]=\"showModal$\"\n (definitionUploaded)=\"setFormDefinition($event)\"\n ></valtimo-form-management-upload>\n\n <ng-template #jsonEditor let-data=\"data\">\n <valtimo-editor\n [model]=\"data.model\"\n [disabled]=\"data.disabled\"\n (validEvent)=\"onValidEvent($event, data.disabled)\"\n (valueChangeEvent)=\"onValueChangeEvent($event, data.formDefinition, data.disabled)\"\n [fitPage]=\"true\"\n [fitPageExtraSpace]=\"80\"\n ></valtimo-editor>\n </ng-template>\n</ng-container>\n", styles: [".valtimo-form-management-edit__header{display:flex;align-items:center;justify-content:flex-end;gap:16px;margin-left:auto}.valtimo-form-management-edit__header-container{width:100%;display:flex;justify-content:space-between;align-items:flex-end;padding-bottom:4px}.valtimo-form-management-edit__header-container .cds--tag{margin:0;height:var(--cds-layout-size-height-md)}.valtimo-form-management-edit__header-container.--compact{align-items:flex-start;padding-bottom:0}.valtimo-form-management-edit__output .cds--tab-content{display:grid;grid-template-columns:1fr 1fr}.valtimo-form-management-edit__output .cds--tab-content>*{min-width:100%!important}.valtimo-form-management-edit .formbuilder .btn.formcomponent.drag-copy,.valtimo-form-management-edit .btn.formcomponent.gu-mirror{font-weight:400;background-color:silver;border-color:silver;color:#fff}.valtimo-form-management-edit .formbuilder .btn.formcomponent.drag-copy:hover,.valtimo-form-management-edit .formbuilder .btn.formcomponent.drag-copy:active,.valtimo-form-management-edit .btn.formcomponent.gu-mirror:hover,.valtimo-form-management-edit .btn.formcomponent.gu-mirror:active{box-shadow:none}.valtimo-form-management-edit .formbuilder .btn.formcomponent.drag-copy:active,.valtimo-form-management-edit .btn.formcomponent.gu-mirror:active{background-color:silver;border-color:silver}.valtimo-form-management-edit .formbuilder-header{padding-left:18px;padding-right:18px;font-size:18px;height:80px;border:1px solid #dee2e6;border-bottom:0}.valtimo-form-management-edit .formbuilder-header .formbuilder-title{margin-top:21px;margin-bottom:7px}.valtimo-form-management-edit .formbuilder-header .formbuilder-subtitle{margin-top:0;margin-bottom:12px}.valtimo-form-management-edit .formbuilder{background:#fff;padding:1rem;border:1px solid #dee2e6;margin-right:0!important;margin-left:0!important}.valtimo-form-management-edit .formbuilder .form-builder-panel .builder-group-button[aria-expanded=false],.valtimo-form-management-edit .formbuilder .form-builder-panel .builder-group-button[aria-expanded=\"\"]{color:#a9a9a9}.valtimo-form-management-edit .formbuilder .form-builder-panel .builder-group-button[aria-expanded=true]{color:#000}.valtimo-form-management-edit .formbuilder .drag-and-drop-alert{display:none}.valtimo-form-management-edit .formbuilder .formarea{padding:10px;border:solid 1px silver;background-color:#fff}.valtimo-form-management-edit .increase-size{font-size:1rem}.valtimo-form-management-edit .cds--tab-content{background:#fff!important}\n/*!\n * Copyright 2015-2024 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"] }]
809
- }], ctorParameters: () => [{ type: i1$1.AlertService }, { type: FormManagementService }, { type: i3.ModalService }, { type: i1$1.PageTitleService }, { type: i3$1.ActivatedRoute }, { type: i3$1.Router }, { type: i1$1.ShellService }, { type: i1$1.PageHeaderService }], propDecorators: { class: [{
894
+ args: [{ selector: 'valtimo-form-management-edit', encapsulation: ViewEncapsulation.None, standalone: true, imports: [
895
+ CommonModule,
896
+ TranslateModule,
897
+ ModalModule,
898
+ ButtonModule,
899
+ InputModule,
900
+ ReactiveFormsModule,
901
+ FormsModule,
902
+ WidgetModule,
903
+ CarbonListModule,
904
+ ValtimoCdsModalDirective,
905
+ TabsModule,
906
+ EditorModule,
907
+ FormIoModule,
908
+ RenderInPageHeaderDirective,
909
+ DialogModule,
910
+ TagModule,
911
+ ConfirmationModalModule,
912
+ SpinnerModule,
913
+ FormManagementUploadComponent,
914
+ IconModule,
915
+ SpinnerModule,
916
+ LoadingModule,
917
+ ], template: "<!--\n ~ Copyright 2015-2025 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<ng-container\n *ngIf=\"{\n formDefinition: formDefinition$ | async,\n jsonFormDefinition: jsonFormDefinition$ | async,\n jsonOutput: jsonOutput$ | async,\n compactMode: compactMode$ | async,\n context: context$ | async,\n canUpdateGlobalConfiguration: canUpdateGlobalConfiguration$ | async,\n isDraftVersion: isDraftVersion$ | async,\n } as obs\"\n>\n @if (obs.formDefinition) {\n <ng-container renderInPageHeader [fullWidth]=\"true\">\n <ng-template>\n <ng-container *ngTemplateOutlet=\"actions; context: {obs: obs}\"></ng-container>\n </ng-template>\n </ng-container>\n\n <cds-tabs type=\"contained\">\n <cds-tab [heading]=\"TABS.BUILDER | translate\" (selected)=\"onSelectedTab(TABS.BUILDER)\">\n <valtimo-form-io-builder\n *ngIf=\"(reloading$ | async) === false && activeTab === TABS.BUILDER\"\n [form]=\"obs.formDefinition.formDefinition\"\n (change)=\"formBuilderChanged($event, obs.jsonFormDefinition)\"\n ></valtimo-form-io-builder>\n </cds-tab>\n\n <cds-tab [heading]=\"TABS.EDITOR | translate\" (selected)=\"onSelectedTab(TABS.EDITOR)\">\n @if (activeTab === TABS.EDITOR) {\n <ng-container\n *ngTemplateOutlet=\"\n jsonEditor;\n context: {\n data: {\n disabled: obs.formDefinition.readOnly || !obs.canUpdateGlobalConfiguration,\n formDefinition: obs.formDefinition,\n model: obs.jsonFormDefinition,\n },\n }\n \"\n ></ng-container>\n }\n </cds-tab>\n\n <cds-tab\n [heading]=\"TABS.OUTPUT | translate\"\n (selected)=\"onSelectedTab(TABS.OUTPUT)\"\n class=\"valtimo-form-management-edit__output\"\n >\n <valtimo-form-io\n *ngIf=\"activeTab === TABS.OUTPUT\"\n [form]=\"obs.formDefinition.formDefinition\"\n (change)=\"onOutputChange($event)\"\n ></valtimo-form-io>\n\n @if (activeTab === TABS.OUTPUT) {\n <ng-container\n *ngTemplateOutlet=\"\n jsonEditor;\n context: {\n data: {disabled: true, formDefinition: obs.formDefinition, model: obs.jsonOutput},\n }\n \"\n ></ng-container>\n }\n </cds-tab>\n </cds-tabs>\n } @else {\n <cds-loading></cds-loading>\n }\n\n <valtimo-confirmation-modal\n confirmButtonTextTranslationKey=\"interface.delete\"\n confirmButtonType=\"danger\"\n contentTranslationKey=\"interface.deleteConfirmation\"\n cancelButtonTextTranslationKey=\"interface.cancel\"\n [outputOnConfirm]=\"obs.formDefinition\"\n [showModalSubject$]=\"showDeleteModal$\"\n titleTranslationKey=\"dashboardManagement.delete\"\n (confirmEvent)=\"deleteFormDefinition($event)\"\n ></valtimo-confirmation-modal>\n\n <valtimo-form-management-upload\n [show$]=\"showModal$\"\n (definitionUploaded)=\"setFormDefinition($event)\"\n ></valtimo-form-management-upload>\n\n <ng-template #jsonEditor let-data=\"data\">\n <valtimo-editor\n [model]=\"data.model\"\n [disabled]=\"data.disabled\"\n (validEvent)=\"onValidEvent($event, data.disabled)\"\n (valueChangeEvent)=\"onValueChangeEvent($event, data.formDefinition, data.disabled)\"\n [fitPage]=\"true\"\n [fitPageExtraSpace]=\"80\"\n ></valtimo-editor>\n </ng-template>\n</ng-container>\n\n<ng-template #actions let-obs=\"obs\">\n <div\n class=\"valtimo-form-management-edit__header-container\"\n [ngClass]=\"{\n '--compact': obs.compactMode,\n 'valtimo-form-management-edit__header-container-case': obs?.context === 'case',\n }\"\n >\n @if (obs.formDefinition.readOnly || !obs.canUpdateGlobalConfiguration) {\n <cds-tag size=\"sm\" type=\"blue\">{{ 'formManagement.readOnly' | translate }}</cds-tag>\n }\n\n <div class=\"valtimo-form-management-edit__header\">\n <cds-overflow-menu>\n <cds-overflow-menu-option (selected)=\"downloadFormDefinition(obs.formDefinition)\">\n {{ 'Download' | translate }}\n </cds-overflow-menu-option>\n\n <cds-overflow-menu-option\n [disabled]=\"obs.formDefinition.readOnly || !obs.canUpdateGlobalConfiguration\"\n (selected)=\"showUploadModal()\"\n >\n {{ 'Upload' | translate }}\n </cds-overflow-menu-option>\n\n <cds-overflow-menu-option\n *ngIf=\"(obs.context === 'case' && obs.isDraftVersion) || obs.context === 'independent'\"\n (selected)=\"showDuplicateModal(obs.formDefinition)\"\n >\n {{ 'formManagement.duplicate' | translate }}\n </cds-overflow-menu-option>\n\n <cds-overflow-menu-option\n [disabled]=\"obs.formDefinition.readOnly || !obs.canUpdateGlobalConfiguration\"\n type=\"danger\"\n (selected)=\"delete()\"\n >\n {{ 'interface.delete' | translate }}\n </cds-overflow-menu-option>\n </cds-overflow-menu>\n\n @if (obs.context === 'case') {\n <button\n cdsButton=\"secondary\"\n [size]=\"obs.compactMode ? 'sm' : 'md'\"\n (click)=\"onGoBackButtonClick()\"\n >\n <svg class=\"cds--btn__icon\" cdsIcon=\"arrow--left\" size=\"16\"></svg>\n\n <span>{{ 'interface.back' | translate }}</span>\n </button>\n }\n\n <button\n *ngIf=\"\n (obs?.canUpdateGlobalConfiguration && obs?.isDraftVersion) ||\n obs.context === 'independent'\n \"\n cdsButton=\"primary\"\n [disabled]=\"obs.formDefinition.readOnly\"\n [size]=\"obs.compactMode ? 'sm' : 'md'\"\n (click)=\"modifyFormDefinition(obs.formDefinition)\"\n >\n {{ 'interface.save' | translate }}\n\n <svg class=\"cds--btn__icon\" cdsIcon=\"save\" size=\"16\"></svg>\n </button>\n </div>\n </div>\n</ng-template>\n", styles: [".valtimo-form-management-edit__header{display:flex;align-items:center;justify-content:flex-end;gap:16px;margin-left:auto}.valtimo-form-management-edit__case-header{display:flex;width:100%;justify-content:flex-end}.valtimo-form-management-edit__header-container{width:100%;display:flex;justify-content:space-between;align-items:flex-end;padding-bottom:4px}.valtimo-form-management-edit__header-container .cds--tag{margin:0;height:var(--cds-layout-size-height-md)}.valtimo-form-management-edit__header-container.--compact{align-items:flex-start;padding-bottom:0}.valtimo-form-management-edit__header-container-case{padding-bottom:24px}.valtimo-form-management-edit__output .cds--tab-content{display:grid;grid-template-columns:1fr 1fr}.valtimo-form-management-edit__output .cds--tab-content>*{min-width:100%!important}.valtimo-form-management-edit .formbuilder .btn.formcomponent.drag-copy,.valtimo-form-management-edit .btn.formcomponent.gu-mirror{font-weight:400;background-color:silver;border-color:silver;color:#fff}.valtimo-form-management-edit .formbuilder .btn.formcomponent.drag-copy:hover,.valtimo-form-management-edit .formbuilder .btn.formcomponent.drag-copy:active,.valtimo-form-management-edit .btn.formcomponent.gu-mirror:hover,.valtimo-form-management-edit .btn.formcomponent.gu-mirror:active{box-shadow:none}.valtimo-form-management-edit .formbuilder .btn.formcomponent.drag-copy:active,.valtimo-form-management-edit .btn.formcomponent.gu-mirror:active{background-color:silver;border-color:silver}.valtimo-form-management-edit .formbuilder-header{padding-left:18px;padding-right:18px;font-size:18px;height:80px;border:1px solid #dee2e6;border-bottom:0}.valtimo-form-management-edit .formbuilder-header .formbuilder-title{margin-top:21px;margin-bottom:7px}.valtimo-form-management-edit .formbuilder-header .formbuilder-subtitle{margin-top:0;margin-bottom:12px}.valtimo-form-management-edit .formbuilder{background:#fff;padding:1rem;border:1px solid #dee2e6;margin-right:0!important;margin-left:0!important}.valtimo-form-management-edit .formbuilder .form-builder-panel .builder-group-button[aria-expanded=false],.valtimo-form-management-edit .formbuilder .form-builder-panel .builder-group-button[aria-expanded=\"\"]{color:#a9a9a9}.valtimo-form-management-edit .formbuilder .form-builder-panel .builder-group-button[aria-expanded=true]{color:#000}.valtimo-form-management-edit .formbuilder .drag-and-drop-alert{display:none}.valtimo-form-management-edit .formbuilder .formarea{padding:10px;border:solid 1px silver;background-color:#fff}.valtimo-form-management-edit .increase-size{font-size:1rem}.valtimo-form-management-edit .cds--tab-content{background:#fff!important}\n/*!\n * Copyright 2015-2025 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"] }]
918
+ }], ctorParameters: () => [{ type: FormManagementService }, { type: i2$1.ModalService }, { type: i3$1.PageTitleService }, { type: i3.ActivatedRoute }, { type: i3$1.ShellService }, { type: i3$1.PageHeaderService }, { type: i2$1.IconService }, { type: i3.Router }, { type: i5.TranslateService }, { type: i4.GlobalNotificationService }, { type: i3$1.BreadcrumbService }, { type: i4.EnvironmentService }, { type: i4.DraftVersionService }, { type: i3$1.FormIoTagsService }, { type: i0.Injector }], propDecorators: { class: [{
810
919
  type: HostBinding,
811
920
  args: ['class']
921
+ }], deleteEvent: [{
922
+ type: Output
923
+ }], goBackEvent: [{
924
+ type: Output
925
+ }], formModifiedEvent: [{
926
+ type: Output
927
+ }], formDeletedEvent: [{
928
+ type: Output
929
+ }], deleteErrorEvent: [{
930
+ type: Output
931
+ }], deployErrorEvent: [{
932
+ type: Output
933
+ }] } });
934
+
935
+ /*
936
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
937
+ *
938
+ * Licensed under EUPL, Version 1.2 (the "License");
939
+ * you may not use this file except in compliance with the License.
940
+ * You may obtain a copy of the License at
941
+ *
942
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
943
+ *
944
+ * Unless required by applicable law or agreed to in writing, software
945
+ * distributed under the License is distributed on an "AS IS" basis,
946
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
947
+ * See the License for the specific language governing permissions and
948
+ * limitations under the License.
949
+ */
950
+
951
+ /*
952
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
953
+ *
954
+ * Licensed under EUPL, Version 1.2 (the "License");
955
+ * you may not use this file except in compliance with the License.
956
+ * You may obtain a copy of the License at
957
+ *
958
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
959
+ *
960
+ * Unless required by applicable law or agreed to in writing, software
961
+ * distributed under the License is distributed on an "AS IS" basis,
962
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
963
+ * See the License for the specific language governing permissions and
964
+ * limitations under the License.
965
+ */
966
+ class FormManagementListComponent {
967
+ get _partialPagination() {
968
+ return this._partialPagination$.getValue();
969
+ }
970
+ constructor(formManagementService, iconService, route, environmentService, draftVersionService, notificationService, translateService, editPermissionsService) {
971
+ this.formManagementService = formManagementService;
972
+ this.iconService = iconService;
973
+ this.route = route;
974
+ this.environmentService = environmentService;
975
+ this.draftVersionService = draftVersionService;
976
+ this.notificationService = notificationService;
977
+ this.translateService = translateService;
978
+ this.editPermissionsService = editPermissionsService;
979
+ this.navigateToCreateEvent = new EventEmitter();
980
+ this.navigateToUploadEvent = new EventEmitter();
981
+ this.navigateToEditEvent = new EventEmitter();
982
+ this.ACTION_ITEMS = [
983
+ {
984
+ callback: this.editFormDefinition.bind(this),
985
+ label: 'interface.edit',
986
+ },
987
+ { callback: this.showDeleteModal.bind(this), label: 'interface.delete', type: 'danger' },
988
+ ];
989
+ this.showDeleteModal$ = new BehaviorSubject(false);
990
+ this.formDefinitionToDelete$ = new BehaviorSubject(null);
991
+ this.loading$ = new BehaviorSubject(true);
992
+ this.searchTerm$ = new BehaviorSubject('');
993
+ this.context$ = getContextObservable(this.route);
994
+ this.caseManagementRouteParams$ = this.context$.pipe(filter$1(context => context === 'case'), switchMap(() => getCaseManagementRouteParams(this.route)));
995
+ this.hasEditPermissions$ = combineLatest([
996
+ getCaseManagementRouteParams(this.route),
997
+ this.context$,
998
+ ]).pipe(switchMap(([params, context]) => this.editPermissionsService.hasPermissionsToEditBasedOnContext(params?.caseDefinitionKey, params?.caseDefinitionVersionTag, context)));
999
+ this._collectionSize$ = new BehaviorSubject(0);
1000
+ this._partialPagination$ = new BehaviorSubject({
1001
+ page: 1,
1002
+ size: 10,
1003
+ });
1004
+ this.pagination$ = combineLatest([
1005
+ this._collectionSize$,
1006
+ this._partialPagination$,
1007
+ ]).pipe(map$1(([collectionSize, partialPagination]) => ({ ...partialPagination, collectionSize })));
1008
+ this.formDefinitions$ = combineLatest([
1009
+ this.context$,
1010
+ this.caseManagementRouteParams$.pipe(startWith(null)),
1011
+ this._partialPagination$,
1012
+ this.searchTerm$,
1013
+ ]).pipe(filter$1(([context, params]) => context === 'case' ? !!(params?.caseDefinitionVersionTag && params?.caseDefinitionKey) : true), switchMap(([context, routeParams, pagination, searchTerm]) => {
1014
+ const params = {
1015
+ ...pagination,
1016
+ page: (pagination?.page ?? 1) - 1,
1017
+ ...(searchTerm && { searchTerm }),
1018
+ };
1019
+ switch (context) {
1020
+ case 'case':
1021
+ return this.formManagementService.queryFormDefinitionsCase(routeParams?.caseDefinitionKey ?? '', routeParams?.caseDefinitionVersionTag ?? '', params);
1022
+ default:
1023
+ case 'independent':
1024
+ return this.formManagementService.queryFormDefinitions(params);
1025
+ }
1026
+ }), map$1((res) => {
1027
+ this._collectionSize$.next(res?.totalElements);
1028
+ return res?.content
1029
+ ? [...res.content].sort((firstForm, secondForm) => (firstForm.name ?? '').localeCompare(secondForm.name ?? ''))
1030
+ : [];
1031
+ }), tap(() => this.loading$.next(false)));
1032
+ this.FIELDS = [
1033
+ { key: 'name', label: 'Form name' },
1034
+ { key: 'readOnly', label: 'Read-only', viewType: ViewType.BOOLEAN },
1035
+ ];
1036
+ this.iconService.registerAll([Upload16]);
1037
+ }
1038
+ navigateToCreateRoute() {
1039
+ this.navigateToCreateEvent.emit();
1040
+ }
1041
+ navigateToUploadRoute() {
1042
+ this.navigateToUploadEvent.emit();
1043
+ }
1044
+ paginationClicked(page) {
1045
+ this.updatePagination({ page });
1046
+ }
1047
+ paginationSet(size) {
1048
+ this.updatePagination({ size, page: 1 });
1049
+ }
1050
+ editFormDefinition(formDefinition) {
1051
+ this.navigateToEditEvent.emit(formDefinition.id);
1052
+ }
1053
+ searchTermEntered(searchTerm) {
1054
+ this.searchTerm$.next(searchTerm);
1055
+ }
1056
+ showDeleteModal(definition) {
1057
+ this.formDefinitionToDelete$.next(definition);
1058
+ this.showDeleteModal$.next(true);
1059
+ }
1060
+ deleteFormDefinition(definition) {
1061
+ getCaseManagementRouteParamsAndContext(this.route)
1062
+ .pipe(take$1(1), switchMap(([context, caseManagementRouteParams]) => {
1063
+ switch (context) {
1064
+ case 'case':
1065
+ return this.formManagementService.deleteFormDefinitionCase(caseManagementRouteParams?.caseDefinitionKey, caseManagementRouteParams?.caseDefinitionVersionTag, definition.id);
1066
+ case 'independent':
1067
+ default:
1068
+ return this.formManagementService.deleteFormDefinition(definition.id);
1069
+ }
1070
+ }))
1071
+ .subscribe({
1072
+ next: () => {
1073
+ this.notificationService.showToast({
1074
+ type: 'success',
1075
+ title: this.translateService.instant('formManagement.notifications.deleted'),
1076
+ });
1077
+ this._partialPagination$.next({ ...this._partialPagination });
1078
+ },
1079
+ error: () => {
1080
+ this.notificationService.showToast({
1081
+ type: 'error',
1082
+ title: this.translateService.instant('formManagement.notifications.deletionError'),
1083
+ });
1084
+ },
1085
+ });
1086
+ }
1087
+ updatePagination(update) {
1088
+ this._partialPagination$.next({ ...this._partialPagination, ...update });
1089
+ }
1090
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: FormManagementListComponent, deps: [{ token: FormManagementService }, { token: i2$1.IconService }, { token: i3.ActivatedRoute }, { token: i4.EnvironmentService }, { token: i4.DraftVersionService }, { token: i4.GlobalNotificationService }, { token: i5.TranslateService }, { token: i4.EditPermissionsService }], target: i0.ɵɵFactoryTarget.Component }); }
1091
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.15", type: FormManagementListComponent, isStandalone: true, selector: "valtimo-form-management-list", outputs: { navigateToCreateEvent: "navigateToCreateEvent", navigateToUploadEvent: "navigateToUploadEvent", navigateToEditEvent: "navigateToEditEvent" }, ngImport: i0, template: "<!--\n ~ Copyright 2015-2025 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<valtimo-carbon-list\n *ngIf=\"{\n formDefinitions: formDefinitions$ | async,\n pagination: pagination$ | async,\n loading: loading$ | async,\n context: context$ | async,\n hasEditPermissions: hasEditPermissions$ | async,\n } as obs\"\n [showActionItems]=\"obs.hasEditPermissions\"\n [actionItems]=\"ACTION_ITEMS\"\n [fields]=\"FIELDS\"\n [header]=\"false\"\n [isSearchable]=\"true\"\n [items]=\"obs?.formDefinitions || []\"\n [pagination]=\"obs.pagination\"\n [loading]=\"obs.loading\"\n paginationIdentifier=\"formManagementList\"\n (paginationClicked)=\"paginationClicked($event)\"\n (paginationSet)=\"paginationSet($event)\"\n (rowClicked)=\"editFormDefinition($event)\"\n (search)=\"searchTermEntered($event)\"\n>\n <ng-container *ngIf=\"obs.hasEditPermissions\" carbonToolbarContent>\n <button cdsButton=\"ghost\" [iconOnly]=\"true\" (click)=\"navigateToUploadRoute()\">\n <svg cdsIcon=\"upload\" size=\"16\"></svg>\n </button>\n\n <ng-container [ngTemplateOutlet]=\"createFormButton\"></ng-container>\n </ng-container>\n\n <valtimo-no-results\n [action]=\"createFormButton\"\n [description]=\"'formManagement.noResults.' + obs.context + 'Description' | translate\"\n [title]=\"'formManagement.noResults.title' | translate\"\n ></valtimo-no-results>\n</valtimo-carbon-list>\n\n<valtimo-confirmation-modal\n confirmButtonTextTranslationKey=\"interface.delete\"\n confirmButtonType=\"danger\"\n contentTranslationKey=\"interface.deleteConfirmation\"\n cancelButtonTextTranslationKey=\"interface.cancel\"\n [outputOnConfirm]=\"formDefinitionToDelete$ | async\"\n [showModalSubject$]=\"showDeleteModal$\"\n titleTranslationKey=\"dashboardManagement.delete\"\n (confirmEvent)=\"deleteFormDefinition($event)\"\n></valtimo-confirmation-modal>\n\n<ng-template #createFormButton>\n <button *ngIf=\"hasEditPermissions$ | async\" cdsButton=\"primary\" (click)=\"navigateToCreateRoute()\">\n {{ 'Create Form' | translate }}\n\n <svg class=\"cds--btn__icon\" cdsIcon=\"add\" size=\"16\"></svg>\n </button>\n</ng-template>\n", styles: ["/*!\n * Copyright 2015-2025 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: "ngmodule", type: CommonModule }, { kind: "directive", type: i7.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i7.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "pipe", type: i7.AsyncPipe, name: "async" }, { kind: "ngmodule", type: FormsModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i5.TranslatePipe, name: "translate" }, { kind: "ngmodule", type: CarbonListModule }, { kind: "component", type: i3$1.CarbonListComponent, selector: "valtimo-carbon-list", inputs: ["items", "fields", "tableTranslations", "paginatorConfig", "pagination", "loading", "actions", "actionItems", "showActionItems", "header", "hideColumnHeader", "initialSortState", "sortState", "isSearchable", "enableSingleSelection", "lastColumnTemplate", "paginationIdentifier", "showSelectionColumn", "striped", "hideToolbar", "lockedTooltipTranslationKey", "movingRowsEnabled", "dragAndDrop", "dragAndDropDisabled"], outputs: ["rowClicked", "paginationClicked", "paginationSet", "search", "sortChanged", "moveRow", "itemsReordered"] }, { kind: "component", type: i3$1.CarbonNoResultsComponent, selector: "valtimo-no-results", inputs: ["action", "description", "illustration", "title", "smallPadding", "collapseVertically", "alwaysRenderVertically"] }, { kind: "ngmodule", type: IconModule }, { kind: "directive", type: i2$1.IconDirective, selector: "[cdsIcon], [ibmIcon]", inputs: ["ibmIcon", "cdsIcon", "size", "title", "ariaLabel", "ariaLabelledBy", "ariaHidden", "isFocusable"] }, { kind: "ngmodule", type: ButtonModule }, { kind: "directive", type: i2$1.Button, selector: "[cdsButton], [ibmButton]", inputs: ["ibmButton", "cdsButton", "size", "skeleton", "iconOnly", "isExpressive"] }, { kind: "ngmodule", type: ConfirmationModalModule }, { kind: "component", type: i3$1.ConfirmationModalComponent, selector: "valtimo-confirmation-modal", inputs: ["titleTranslationKey", "title", "content", "contentTranslationKey", "confirmButtonText", "confirmButtonTextTranslationKey", "confirmButtonType", "showOptionalButton", "optionalButtonText", "optionalButtonTextTranslationKey", "optionalButtonType", "cancelButtonText", "cancelButtonTextTranslationKey", "cancelButtonType", "showModalSubject$", "outputOnConfirm", "outputOnOptional", "spacerAfterCancelButton"], outputs: ["confirmEvent", "optionalEvent", "cancelEvent"] }] }); }
1092
+ }
1093
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: FormManagementListComponent, decorators: [{
1094
+ type: Component,
1095
+ args: [{ selector: 'valtimo-form-management-list', standalone: true, imports: [
1096
+ CommonModule,
1097
+ FormsModule,
1098
+ ReactiveFormsModule,
1099
+ TranslateModule,
1100
+ CarbonListModule,
1101
+ IconModule,
1102
+ ButtonModule,
1103
+ ConfirmationModalModule,
1104
+ ], template: "<!--\n ~ Copyright 2015-2025 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<valtimo-carbon-list\n *ngIf=\"{\n formDefinitions: formDefinitions$ | async,\n pagination: pagination$ | async,\n loading: loading$ | async,\n context: context$ | async,\n hasEditPermissions: hasEditPermissions$ | async,\n } as obs\"\n [showActionItems]=\"obs.hasEditPermissions\"\n [actionItems]=\"ACTION_ITEMS\"\n [fields]=\"FIELDS\"\n [header]=\"false\"\n [isSearchable]=\"true\"\n [items]=\"obs?.formDefinitions || []\"\n [pagination]=\"obs.pagination\"\n [loading]=\"obs.loading\"\n paginationIdentifier=\"formManagementList\"\n (paginationClicked)=\"paginationClicked($event)\"\n (paginationSet)=\"paginationSet($event)\"\n (rowClicked)=\"editFormDefinition($event)\"\n (search)=\"searchTermEntered($event)\"\n>\n <ng-container *ngIf=\"obs.hasEditPermissions\" carbonToolbarContent>\n <button cdsButton=\"ghost\" [iconOnly]=\"true\" (click)=\"navigateToUploadRoute()\">\n <svg cdsIcon=\"upload\" size=\"16\"></svg>\n </button>\n\n <ng-container [ngTemplateOutlet]=\"createFormButton\"></ng-container>\n </ng-container>\n\n <valtimo-no-results\n [action]=\"createFormButton\"\n [description]=\"'formManagement.noResults.' + obs.context + 'Description' | translate\"\n [title]=\"'formManagement.noResults.title' | translate\"\n ></valtimo-no-results>\n</valtimo-carbon-list>\n\n<valtimo-confirmation-modal\n confirmButtonTextTranslationKey=\"interface.delete\"\n confirmButtonType=\"danger\"\n contentTranslationKey=\"interface.deleteConfirmation\"\n cancelButtonTextTranslationKey=\"interface.cancel\"\n [outputOnConfirm]=\"formDefinitionToDelete$ | async\"\n [showModalSubject$]=\"showDeleteModal$\"\n titleTranslationKey=\"dashboardManagement.delete\"\n (confirmEvent)=\"deleteFormDefinition($event)\"\n></valtimo-confirmation-modal>\n\n<ng-template #createFormButton>\n <button *ngIf=\"hasEditPermissions$ | async\" cdsButton=\"primary\" (click)=\"navigateToCreateRoute()\">\n {{ 'Create Form' | translate }}\n\n <svg class=\"cds--btn__icon\" cdsIcon=\"add\" size=\"16\"></svg>\n </button>\n</ng-template>\n", styles: ["/*!\n * Copyright 2015-2025 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"] }]
1105
+ }], ctorParameters: () => [{ type: FormManagementService }, { type: i2$1.IconService }, { type: i3.ActivatedRoute }, { type: i4.EnvironmentService }, { type: i4.DraftVersionService }, { type: i4.GlobalNotificationService }, { type: i5.TranslateService }, { type: i4.EditPermissionsService }], propDecorators: { navigateToCreateEvent: [{
1106
+ type: Output
1107
+ }], navigateToUploadEvent: [{
1108
+ type: Output
1109
+ }], navigateToEditEvent: [{
1110
+ type: Output
812
1111
  }] } });
813
1112
 
814
1113
  /*
815
- * Copyright 2015-2024 Ritense BV, the Netherlands.
1114
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
1115
+ *
1116
+ * Licensed under EUPL, Version 1.2 (the "License");
1117
+ * you may not use this file except in compliance with the License.
1118
+ * You may obtain a copy of the License at
1119
+ *
1120
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1121
+ *
1122
+ * Unless required by applicable law or agreed to in writing, software
1123
+ * distributed under the License is distributed on an "AS IS" basis,
1124
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1125
+ * See the License for the specific language governing permissions and
1126
+ * limitations under the License.
1127
+ */
1128
+
1129
+ /*
1130
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
1131
+ *
1132
+ * Licensed under EUPL, Version 1.2 (the "License");
1133
+ * you may not use this file except in compliance with the License.
1134
+ * You may obtain a copy of the License at
1135
+ *
1136
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1137
+ *
1138
+ * Unless required by applicable law or agreed to in writing, software
1139
+ * distributed under the License is distributed on an "AS IS" basis,
1140
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1141
+ * See the License for the specific language governing permissions and
1142
+ * limitations under the License.
1143
+ */
1144
+ class FormManagementComponent {
1145
+ constructor(route, router, notificationService, translateService) {
1146
+ this.route = route;
1147
+ this.router = router;
1148
+ this.notificationService = notificationService;
1149
+ this.translateService = translateService;
1150
+ this.create$ = new BehaviorSubject(false);
1151
+ this.upload$ = new BehaviorSubject(false);
1152
+ }
1153
+ onNavigateToCreateEvent() {
1154
+ this.create$.next(true);
1155
+ }
1156
+ onGoBackFromCreateEvent() {
1157
+ this.create$.next(false);
1158
+ this.upload$.next(false);
1159
+ }
1160
+ onFormDefinitionEditEvent(formDefinitionId, upload = false) {
1161
+ this.router.navigate([formDefinitionId], {
1162
+ relativeTo: this.route,
1163
+ queryParams: { ...(upload && { upload: true }) },
1164
+ });
1165
+ }
1166
+ onFormDefinitionCreateEvent(formDefinitionId) {
1167
+ this.resetNotifications();
1168
+ this.notificationService.showToast({
1169
+ type: 'success',
1170
+ title: this.translateService.instant('formManagement.notifications.created'),
1171
+ });
1172
+ this.onFormDefinitionEditEvent(formDefinitionId);
1173
+ }
1174
+ onFormDefinitionUploadEvent(formDefinitionId) {
1175
+ this.resetNotifications();
1176
+ this.notificationService.showToast({
1177
+ type: 'success',
1178
+ title: this.translateService.instant('formManagement.notifications.created'),
1179
+ });
1180
+ this.onFormDefinitionEditEvent(formDefinitionId, true);
1181
+ }
1182
+ onNavigateToUploadEvent() {
1183
+ this.create$.next(true);
1184
+ this.upload$.next(true);
1185
+ }
1186
+ resetNotifications() {
1187
+ this.notificationService
1188
+ ?.getNotificationRefs()
1189
+ .forEach(ref => this.notificationService.close(ref));
1190
+ }
1191
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: FormManagementComponent, deps: [{ token: i3.ActivatedRoute }, { token: i3.Router }, { token: i4.GlobalNotificationService }, { token: i5.TranslateService }], target: i0.ɵɵFactoryTarget.Component }); }
1192
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.15", type: FormManagementComponent, isStandalone: true, selector: "ng-component", ngImport: i0, template: "<!--\n ~ Copyright 2015-2025 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<ng-container\n *ngIf=\"{\n create: create$ | async,\n upload: upload$ | async,\n } as obs\"\n>\n <valtimo-form-management-list\n (navigateToCreateEvent)=\"onNavigateToCreateEvent()\"\n (navigateToUploadEvent)=\"onNavigateToUploadEvent()\"\n (navigateToEditEvent)=\"onFormDefinitionEditEvent($event)\"\n ></valtimo-form-management-list>\n\n <valtimo-form-management-create\n *ngIf=\"obs.create\"\n [upload]=\"obs.upload\"\n (goBackEvent)=\"onGoBackFromCreateEvent()\"\n (afterCreateEvent)=\"onFormDefinitionCreateEvent($event)\"\n (afterUploadEvent)=\"onFormDefinitionUploadEvent($event)\"\n ></valtimo-form-management-create>\n</ng-container>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i7.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i7.AsyncPipe, name: "async" }, { kind: "ngmodule", type: ButtonModule }, { kind: "component", type: FormManagementListComponent, selector: "valtimo-form-management-list", outputs: ["navigateToCreateEvent", "navigateToUploadEvent", "navigateToEditEvent"] }, { kind: "component", type: FormManagementCreateComponent, selector: "valtimo-form-management-create", inputs: ["upload"], outputs: ["goBackEvent", "afterCreateEvent", "afterUploadEvent"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1193
+ }
1194
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: FormManagementComponent, decorators: [{
1195
+ type: Component,
1196
+ args: [{ changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [
1197
+ CommonModule,
1198
+ ButtonModule,
1199
+ FormManagementListComponent,
1200
+ FormManagementCreateComponent,
1201
+ FormManagementEditComponent,
1202
+ RouterOutlet,
1203
+ ], template: "<!--\n ~ Copyright 2015-2025 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<ng-container\n *ngIf=\"{\n create: create$ | async,\n upload: upload$ | async,\n } as obs\"\n>\n <valtimo-form-management-list\n (navigateToCreateEvent)=\"onNavigateToCreateEvent()\"\n (navigateToUploadEvent)=\"onNavigateToUploadEvent()\"\n (navigateToEditEvent)=\"onFormDefinitionEditEvent($event)\"\n ></valtimo-form-management-list>\n\n <valtimo-form-management-create\n *ngIf=\"obs.create\"\n [upload]=\"obs.upload\"\n (goBackEvent)=\"onGoBackFromCreateEvent()\"\n (afterCreateEvent)=\"onFormDefinitionCreateEvent($event)\"\n (afterUploadEvent)=\"onFormDefinitionUploadEvent($event)\"\n ></valtimo-form-management-create>\n</ng-container>\n" }]
1204
+ }], ctorParameters: () => [{ type: i3.ActivatedRoute }, { type: i3.Router }, { type: i4.GlobalNotificationService }, { type: i5.TranslateService }] });
1205
+
1206
+ /*
1207
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
1208
+ *
1209
+ * Licensed under EUPL, Version 1.2 (the "License");
1210
+ * you may not use this file except in compliance with the License.
1211
+ * You may obtain a copy of the License at
1212
+ *
1213
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1214
+ *
1215
+ * Unless required by applicable law or agreed to in writing, software
1216
+ * distributed under the License is distributed on an "AS IS" basis,
1217
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1218
+ * See the License for the specific language governing permissions and
1219
+ * limitations under the License.
1220
+ */
1221
+
1222
+ /*
1223
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
816
1224
  *
817
1225
  * Licensed under EUPL, Version 1.2 (the "License");
818
1226
  * you may not use this file except in compliance with the License.
@@ -831,171 +1239,46 @@ const routes = [
831
1239
  path: 'form-management',
832
1240
  component: FormManagementComponent,
833
1241
  canActivate: [AuthGuardService],
834
- data: { title: 'Forms', roles: [ROLE_ADMIN] },
835
- },
836
- {
837
- path: 'form-management/create',
838
- component: FormManagementCreateComponent,
839
- canActivate: [AuthGuardService],
840
- data: { title: 'Create new Form', roles: [ROLE_ADMIN] },
1242
+ data: { title: 'Forms', roles: [ROLE_ADMIN], context: 'independent' },
841
1243
  },
842
1244
  {
843
- path: 'form-management/edit/:id',
1245
+ path: 'form-management/:formDefinitionId',
844
1246
  component: FormManagementEditComponent,
845
1247
  canActivate: [AuthGuardService],
846
- canDeactivate: [pendingChangesGuard],
847
- data: { title: 'Form Builder', roles: [ROLE_ADMIN], customPageTitle: true },
1248
+ data: {
1249
+ title: 'Forms',
1250
+ roles: [ROLE_ADMIN],
1251
+ context: 'independent',
1252
+ customPageTitle: true,
1253
+ },
848
1254
  },
849
1255
  ];
850
1256
  class FormManagementRoutingModule {
851
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FormManagementRoutingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
852
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.12", ngImport: i0, type: FormManagementRoutingModule, imports: [i3$1.RouterModule], exports: [RouterModule] }); }
853
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FormManagementRoutingModule, imports: [RouterModule.forRoot(routes, RouterUtils.getRouterExtraOptions()), RouterModule] }); }
1257
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: FormManagementRoutingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
1258
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.15", ngImport: i0, type: FormManagementRoutingModule, imports: [i3.RouterModule], exports: [RouterModule] }); }
1259
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: FormManagementRoutingModule, imports: [RouterModule.forRoot(routes, RouterUtils.getRouterExtraOptions()), RouterModule] }); }
854
1260
  }
855
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FormManagementRoutingModule, decorators: [{
1261
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: FormManagementRoutingModule, decorators: [{
856
1262
  type: NgModule,
857
1263
  args: [{
858
1264
  imports: [RouterModule.forRoot(routes, RouterUtils.getRouterExtraOptions())],
859
1265
  exports: [RouterModule],
860
1266
  }]
861
1267
  }] });
862
-
863
- /*
864
- * Copyright 2015-2024 Ritense BV, the Netherlands.
865
- *
866
- * Licensed under EUPL, Version 1.2 (the "License");
867
- * you may not use this file except in compliance with the License.
868
- * You may obtain a copy of the License at
869
- *
870
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
871
- *
872
- * Unless required by applicable law or agreed to in writing, software
873
- * distributed under the License is distributed on an "AS IS" basis,
874
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
875
- * See the License for the specific language governing permissions and
876
- * limitations under the License.
877
- */
878
1268
  class FormManagementModule {
879
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FormManagementModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
880
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.12", ngImport: i0, type: FormManagementModule, declarations: [FormManagementComponent,
881
- FormManagementCreateComponent,
882
- FormManagementEditComponent,
883
- FormManagementUploadComponent,
884
- FormManagementDuplicateComponent], imports: [FormManagementRoutingModule,
885
- FormIoModule,
886
- CommonModule,
887
- ReactiveFormsModule,
888
- FormsModule,
889
- WidgetModule,
890
- ListModule,
891
- TranslateModule,
892
- NgbTooltipModule,
893
- DropzoneModule,
894
- ModalModule,
895
- VModalModule,
896
- ModalModule$1,
897
- InputModule,
898
- TitleModule,
899
- ButtonModule,
900
- InputModule$1,
901
- FormModule,
902
- ModalModule,
903
- InputModule$1,
904
- PlaceholderModule,
905
- ButtonModule$1,
906
- ValtimoCdsModalDirectiveModule,
907
- CarbonListModule,
908
- DialogModule,
909
- RenderInPageHeaderDirectiveModule,
910
- TabsModule,
911
- EditorModule,
912
- SpinnerModule,
913
- IconModule,
914
- ConfirmationModalModule,
915
- TagModule], exports: [FormManagementComponent] }); }
916
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FormManagementModule, imports: [FormManagementRoutingModule,
917
- FormIoModule,
918
- CommonModule,
919
- ReactiveFormsModule,
920
- FormsModule,
921
- WidgetModule,
922
- ListModule,
923
- TranslateModule,
924
- NgbTooltipModule,
925
- DropzoneModule,
926
- ModalModule,
927
- VModalModule,
928
- ModalModule$1,
929
- InputModule,
930
- TitleModule,
931
- ButtonModule,
932
- InputModule$1,
933
- FormModule,
934
- ModalModule,
935
- InputModule$1,
936
- PlaceholderModule,
937
- ButtonModule$1,
938
- ValtimoCdsModalDirectiveModule,
939
- CarbonListModule,
940
- DialogModule,
941
- RenderInPageHeaderDirectiveModule,
942
- TabsModule,
943
- EditorModule,
944
- SpinnerModule,
945
- IconModule,
946
- ConfirmationModalModule,
947
- TagModule] }); }
1269
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: FormManagementModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
1270
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.15", ngImport: i0, type: FormManagementModule, imports: [FormManagementComponent, FormManagementRoutingModule] }); }
1271
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: FormManagementModule, imports: [FormManagementComponent, FormManagementRoutingModule] }); }
948
1272
  }
949
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FormManagementModule, decorators: [{
1273
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: FormManagementModule, decorators: [{
950
1274
  type: NgModule,
951
1275
  args: [{
952
- declarations: [
953
- FormManagementComponent,
954
- FormManagementCreateComponent,
955
- FormManagementEditComponent,
956
- FormManagementUploadComponent,
957
- FormManagementDuplicateComponent,
958
- ],
959
- imports: [
960
- FormManagementRoutingModule,
961
- FormIoModule,
962
- CommonModule,
963
- ReactiveFormsModule,
964
- FormsModule,
965
- WidgetModule,
966
- ListModule,
967
- TranslateModule,
968
- NgbTooltipModule,
969
- DropzoneModule,
970
- ModalModule,
971
- VModalModule,
972
- ModalModule$1,
973
- InputModule,
974
- TitleModule,
975
- ButtonModule,
976
- InputModule$1,
977
- FormModule,
978
- ModalModule,
979
- InputModule$1,
980
- PlaceholderModule,
981
- ButtonModule$1,
982
- ValtimoCdsModalDirectiveModule,
983
- CarbonListModule,
984
- DialogModule,
985
- RenderInPageHeaderDirectiveModule,
986
- TabsModule,
987
- EditorModule,
988
- SpinnerModule,
989
- IconModule,
990
- ConfirmationModalModule,
991
- TagModule,
992
- ],
993
- exports: [FormManagementComponent],
1276
+ imports: [FormManagementComponent, FormManagementRoutingModule],
994
1277
  }]
995
1278
  }] });
996
1279
 
997
1280
  /*
998
- * Copyright 2015-2024 Ritense BV, the Netherlands.
1281
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
999
1282
  *
1000
1283
  * Licensed under EUPL, Version 1.2 (the "License");
1001
1284
  * you may not use this file except in compliance with the License.
@@ -1017,5 +1300,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
1017
1300
  * Generated bundle index. Do not edit.
1018
1301
  */
1019
1302
 
1020
- export { EDIT_TABS, FormManagementComponent, FormManagementModule, FormManagementService, compareFormDefinitions };
1303
+ export { EDIT_TABS, FormManagementComponent, FormManagementEditComponent, FormManagementModule, FormManagementRoutingModule, FormManagementService, compareFormDefinitions };
1021
1304
  //# sourceMappingURL=valtimo-form-management.mjs.map