@valtimo/building-block-management 0.0.0-test

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 (64) hide show
  1. package/README.md +31 -0
  2. package/fesm2022/valtimo-building-block-management.mjs +2379 -0
  3. package/fesm2022/valtimo-building-block-management.mjs.map +1 -0
  4. package/index.d.ts +6 -0
  5. package/lib/building-block-management-routing.d.ts +9 -0
  6. package/lib/building-block-management-routing.d.ts.map +1 -0
  7. package/lib/building-block-management.module.d.ts +9 -0
  8. package/lib/building-block-management.module.d.ts.map +1 -0
  9. package/lib/components/building-block-management-artwork/building-block-management-artwork.component.d.ts +32 -0
  10. package/lib/components/building-block-management-artwork/building-block-management-artwork.component.d.ts.map +1 -0
  11. package/lib/components/building-block-management-create-modal/building-block-management-create-modal.component.d.ts +24 -0
  12. package/lib/components/building-block-management-create-modal/building-block-management-create-modal.component.d.ts.map +1 -0
  13. package/lib/components/building-block-management-decisions/building-block-management-decisions.component.d.ts +40 -0
  14. package/lib/components/building-block-management-decisions/building-block-management-decisions.component.d.ts.map +1 -0
  15. package/lib/components/building-block-management-detail/building-block-management-detail.component.d.ts +31 -0
  16. package/lib/components/building-block-management-detail/building-block-management-detail.component.d.ts.map +1 -0
  17. package/lib/components/building-block-management-detail-actions/building-block-management-detail-actions.component.d.ts +38 -0
  18. package/lib/components/building-block-management-detail-actions/building-block-management-detail-actions.component.d.ts.map +1 -0
  19. package/lib/components/building-block-management-document/building-block-management-document.component.d.ts +27 -0
  20. package/lib/components/building-block-management-document/building-block-management-document.component.d.ts.map +1 -0
  21. package/lib/components/building-block-management-form-flows/building-block-management-form-flows.component.d.ts +46 -0
  22. package/lib/components/building-block-management-form-flows/building-block-management-form-flows.component.d.ts.map +1 -0
  23. package/lib/components/building-block-management-forms/building-block-management-forms.component.d.ts +58 -0
  24. package/lib/components/building-block-management-forms/building-block-management-forms.component.d.ts.map +1 -0
  25. package/lib/components/building-block-management-general/building-block-management-general.component.d.ts +9 -0
  26. package/lib/components/building-block-management-general/building-block-management-general.component.d.ts.map +1 -0
  27. package/lib/components/building-block-management-list/building-block-management-list.component.d.ts +22 -0
  28. package/lib/components/building-block-management-list/building-block-management-list.component.d.ts.map +1 -0
  29. package/lib/components/building-block-management-metadata/building-block-management-metadata.component.d.ts +23 -0
  30. package/lib/components/building-block-management-metadata/building-block-management-metadata.component.d.ts.map +1 -0
  31. package/lib/components/building-block-management-plugins/building-block-management-plugins.component.d.ts +15 -0
  32. package/lib/components/building-block-management-plugins/building-block-management-plugins.component.d.ts.map +1 -0
  33. package/lib/components/building-block-management-process-upload/building-block-management-process-upload.component.d.ts +32 -0
  34. package/lib/components/building-block-management-process-upload/building-block-management-process-upload.component.d.ts.map +1 -0
  35. package/lib/components/building-block-management-processes/building-block-management-processes.component.d.ts +40 -0
  36. package/lib/components/building-block-management-processes/building-block-management-processes.component.d.ts.map +1 -0
  37. package/lib/components/building-block-management-upload-modal/building-block-management-upload-modal.component.d.ts +45 -0
  38. package/lib/components/building-block-management-upload-modal/building-block-management-upload-modal.component.d.ts.map +1 -0
  39. package/lib/components/building-block-management-upload-modal/step/building-block-management-upload-step.component.d.ts +9 -0
  40. package/lib/components/building-block-management-upload-modal/step/building-block-management-upload-step.component.d.ts.map +1 -0
  41. package/lib/components/building-block-management-version-selector/building-block-management-version-selector.component.d.ts +19 -0
  42. package/lib/components/building-block-management-version-selector/building-block-management-version-selector.component.d.ts.map +1 -0
  43. package/lib/constants/building-block-management-upload.constants.d.ts +13 -0
  44. package/lib/constants/building-block-management-upload.constants.d.ts.map +1 -0
  45. package/lib/constants/building-block-management.constants.d.ts +10 -0
  46. package/lib/constants/building-block-management.constants.d.ts.map +1 -0
  47. package/lib/constants/index.d.ts +3 -0
  48. package/lib/constants/index.d.ts.map +1 -0
  49. package/lib/models/building-block-management.model.d.ts +15 -0
  50. package/lib/models/building-block-management.model.d.ts.map +1 -0
  51. package/lib/models/index.d.ts +2 -0
  52. package/lib/models/index.d.ts.map +1 -0
  53. package/lib/services/building-block-management-api.service.d.ts +48 -0
  54. package/lib/services/building-block-management-api.service.d.ts.map +1 -0
  55. package/lib/services/building-block-management-detail.service.d.ts +54 -0
  56. package/lib/services/building-block-management-detail.service.d.ts.map +1 -0
  57. package/lib/services/building-block-management.service.d.ts +20 -0
  58. package/lib/services/building-block-management.service.d.ts.map +1 -0
  59. package/lib/services/index.d.ts +4 -0
  60. package/lib/services/index.d.ts.map +1 -0
  61. package/package.json +26 -0
  62. package/public-api.d.ts +3 -0
  63. package/public-api.d.ts.map +1 -0
  64. package/valtimo-building-block-management.d.ts.map +1 -0
@@ -0,0 +1,2379 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Injectable, Component, Input, signal, ChangeDetectionStrategy, ViewChild, Inject, Optional, NgModule } from '@angular/core';
3
+ import * as i4 from '@angular/common';
4
+ import { CommonModule, DOCUMENT } from '@angular/common';
5
+ import * as i7 from '@valtimo/components';
6
+ import { runAfterCarbonModalClosed, ValtimoCdsModalDirective, AutoKeyInputComponent, TooltipIconModule, CARBON_CONSTANTS, ViewType, CarbonListModule, ReadOnlyDirective, ConfirmationModalModule, RenderInBodyComponent, MuuriDirectiveModule, SchemaEditorComponent, FitPageDirective, OverflowMenuComponent, OverflowMenuOptionComponent, RenderInPageHeaderDirective } from '@valtimo/components';
7
+ import * as i2 from '@angular/common/http';
8
+ import { HttpHeaders, HttpErrorResponse } from '@angular/common/http';
9
+ import * as i5 from '@valtimo/shared';
10
+ import { BaseApiService, InterceptorSkip, BUILDING_BLOCK_MANAGEMENT_TAB_TOKEN, ROLE_ADMIN } from '@valtimo/shared';
11
+ import { catchError, of, filter, switchMap, map, tap, distinctUntilChanged, BehaviorSubject, Subscription, combineLatest, take, startWith, from, finalize } from 'rxjs';
12
+ import { isEqual } from 'lodash';
13
+ import * as i3 from '@angular/router';
14
+ import { RouterModule } from '@angular/router';
15
+ import * as i3$1 from 'carbon-components-angular';
16
+ import { ModalModule, ButtonModule, IconModule, InputModule, TooltipModule, LayerModule, FileUploaderModule, ProgressBarModule, NotificationModule, CheckboxModule, LoadingModule, TagModule, DropdownModule, DialogModule, TabsModule } from 'carbon-components-angular';
17
+ import * as i2$2 from '@ngx-translate/core';
18
+ import { TranslatePipe, TranslateModule } from '@ngx-translate/core';
19
+ import * as i2$1 from '@angular/forms';
20
+ import { Validators, FormsModule, ReactiveFormsModule } from '@angular/forms';
21
+ import { WarningFilled16, Upload16, TrashCan16, Download16, Add16 } from '@carbon/icons';
22
+ import { toObservable } from '@angular/core/rxjs-interop';
23
+ import { AuthGuardService } from '@valtimo/security';
24
+ import * as i2$3 from '@valtimo/plugin';
25
+ import { take as take$1 } from 'rxjs/operators';
26
+ import * as i3$2 from '@valtimo/process-link';
27
+ import { FormManagementCreateComponent, FormManagementEditComponent } from '@valtimo/form-management';
28
+ import { NewFormFlowModalComponent, FormFlowEditorComponent } from '@valtimo/form-flow-management';
29
+ import * as i2$4 from '@valtimo/decision';
30
+ import { DecisionDeployComponent, DecisionModelerComponent } from '@valtimo/decision';
31
+ import { ProcessManagementBuilderComponent } from '@valtimo/process-management';
32
+
33
+ /*
34
+ * Copyright 2015-2026 Ritense BV, the Netherlands.
35
+ *
36
+ * Licensed under EUPL, Version 1.2 (the "License");
37
+ * you may not use this file except in compliance with the License.
38
+ * You may obtain a copy of the License at
39
+ *
40
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
41
+ *
42
+ * Unless required by applicable law or agreed to in writing, software
43
+ * distributed under the License is distributed on an "AS IS" basis,
44
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
45
+ * See the License for the specific language governing permissions and
46
+ * limitations under the License.
47
+ */
48
+ class BuildingBlockManagementApiService extends BaseApiService {
49
+ constructor(configService, httpClient) {
50
+ super(httpClient, configService);
51
+ this.configService = configService;
52
+ this.httpClient = httpClient;
53
+ }
54
+ getBuildingBlockDefinitions(options) {
55
+ return this.httpClient
56
+ .get(this.getApiUrl('management/v1/building-block'), {
57
+ params: options,
58
+ headers: new HttpHeaders().set(InterceptorSkip, '404'),
59
+ })
60
+ .pipe(catchError((error) => {
61
+ if (error.status === 404)
62
+ return of([]);
63
+ throw error;
64
+ }));
65
+ }
66
+ createBuildingBlockDefinition(dto) {
67
+ return this.httpClient.post(this.getApiUrl('management/v1/building-block'), dto);
68
+ }
69
+ getBuildingBlockDefinition(key, versionTag) {
70
+ return this.httpClient.get(this.getApiUrl(`management/v1/building-block/${key}/version/${versionTag}`));
71
+ }
72
+ updateBuildingBlockDefinition(key, versionTag, dto) {
73
+ return this.httpClient.put(this.getApiUrl(`management/v1/building-block/${key}/version/${versionTag}`), dto);
74
+ }
75
+ getBuildingBlockDocumentDefinition(key, versionTag) {
76
+ return this.httpClient.get(this.getApiUrl(`management/v1/building-block/${key}/version/${versionTag}/document`));
77
+ }
78
+ updateBuildingBlockDocumentDefinition(key, versionTag, schema) {
79
+ return this.httpClient.put(this.getApiUrl(`management/v1/building-block/${key}/version/${versionTag}/document`), schema);
80
+ }
81
+ getBuildingBlockProcessDefinitions(key, versionTag) {
82
+ return this.httpClient.get(this.getApiUrl(`management/v1/building-block/${key}/version/${versionTag}/process-definition`));
83
+ }
84
+ importBuildingBlockDefinition(file) {
85
+ return this.httpClient.post(this.getApiUrl(`management/v1/building-block/import`), file);
86
+ }
87
+ getBuildingBlockArtwork(key, versionTag) {
88
+ return this.httpClient
89
+ .get(this.getApiUrl(`management/v1/building-block/${key}/version/${versionTag}/artwork`), {
90
+ headers: new HttpHeaders().set(InterceptorSkip, '404'),
91
+ })
92
+ .pipe(catchError((error) => {
93
+ if (error.status === 404)
94
+ return of(null);
95
+ throw error;
96
+ }));
97
+ }
98
+ createBuildingBlockArtwork(key, versionTag, dto) {
99
+ return this.httpClient.post(this.getApiUrl(`management/v1/building-block/${key}/version/${versionTag}/artwork`), dto);
100
+ }
101
+ deleteBuildingBlockArtwork(key, versionTag) {
102
+ return this.httpClient.delete(this.getApiUrl(`management/v1/building-block/${key}/version/${versionTag}/artwork`));
103
+ }
104
+ getPluginDefinitionsForBuildingBlock(key, versionTag) {
105
+ return this.httpClient.get(this.getApiUrl(`management/v1/building-block/${key}/version/${versionTag}/plugin`));
106
+ }
107
+ getVersionsForBuildingBlock(key, page = 0, size = 5, all = false) {
108
+ return this.httpClient.get(this.getApiUrl(`management/v1/building-block/${key}/version`), {
109
+ params: {
110
+ page,
111
+ size,
112
+ all,
113
+ },
114
+ });
115
+ }
116
+ finalizeBuildingBlockDefinition(key, versionTag) {
117
+ return this.httpClient.post(this.getApiUrl(`management/v1/building-block/${key}/version/${versionTag}/finalize`), {});
118
+ }
119
+ createDraftBuildingBlockDefinition(key, basedOnVersionTag, versionTag) {
120
+ return this.httpClient.post(this.getApiUrl(`management/v1/building-block/${key}/version/${basedOnVersionTag}/draft`), { versionTag });
121
+ }
122
+ setMainBuildingBlockProcessDefinition(key, versionTag, processDefinitionId) {
123
+ return this.httpClient.post(this.getApiUrl(`management/v1/building-block/${key}/version/${versionTag}/process-definition/${processDefinitionId}/main`), {});
124
+ }
125
+ deleteBuildingBlockProcessDefinition(key, versionTag, processDefinitionId) {
126
+ return this.httpClient.delete(this.getApiUrl(`management/v1/building-block/${key}/version/${versionTag}/process-definition/${processDefinitionId}`));
127
+ }
128
+ exportBuildingBlock(key, versionTag) {
129
+ return this.httpClient.get(this.getApiUrl(`management/v1/building-block/${key}/version/${versionTag}/export`), {
130
+ responseType: 'blob',
131
+ observe: 'response',
132
+ });
133
+ }
134
+ getBuildingBlockFormDefinitions(key, versionTag, params) {
135
+ return this.httpClient.get(this.getApiUrl(`management/v1/building-block/${key}/version/${versionTag}/form`), { params: params });
136
+ }
137
+ deleteBuildingBlockFormDefinition(key, versionTag, formDefinitionId) {
138
+ return this.httpClient.delete(this.getApiUrl(`management/v1/building-block/${key}/version/${versionTag}/form/${formDefinitionId}`));
139
+ }
140
+ getBuildingBlockFormFlowDefinitions(key, versionTag) {
141
+ return this.httpClient.get(this.getApiUrl(`management/v1/building-block/${key}/version/${versionTag}/form-flow-definition`));
142
+ }
143
+ getBuildingBlockFormFlowDefinitionByKey(key, versionTag, formFlowDefinitionKey) {
144
+ return this.httpClient.get(this.getApiUrl(`management/v1/building-block/${key}/version/${versionTag}/form-flow-definition/${formFlowDefinitionKey}`));
145
+ }
146
+ createBuildingBlockFormFlowDefinition(key, versionTag, definition) {
147
+ return this.httpClient.post(this.getApiUrl(`management/v1/building-block/${key}/version/${versionTag}/form-flow-definition`), definition);
148
+ }
149
+ updateBuildingBlockFormFlowDefinition(key, versionTag, definitionKey, updatedDefinition) {
150
+ return this.httpClient.put(this.getApiUrl(`management/v1/building-block/${key}/version/${versionTag}/form-flow-definition/${definitionKey}`), updatedDefinition);
151
+ }
152
+ deleteBuildingBlockFormFlowDefinition(key, versionTag, definitionKey) {
153
+ return this.httpClient.delete(this.getApiUrl(`management/v1/building-block/${key}/version/${versionTag}/form-flow-definition/${definitionKey}`));
154
+ }
155
+ getBuildingBlockDecisionDefinitions(key, versionTag) {
156
+ return this.httpClient.get(this.getApiUrl(`management/v1/building-block/${key}/version/${versionTag}/decision-definition`));
157
+ }
158
+ deleteBuildingBlockDecisionDefinition(key, versionTag, decisionDefinitionKey) {
159
+ return this.httpClient.delete(this.getApiUrl(`management/v1/building-block/${key}/version/${versionTag}/decision-definition/${decisionDefinitionKey}`));
160
+ }
161
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: BuildingBlockManagementApiService, deps: [{ token: i5.ConfigService }, { token: i2.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable }); }
162
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: BuildingBlockManagementApiService, providedIn: 'root' }); }
163
+ }
164
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: BuildingBlockManagementApiService, decorators: [{
165
+ type: Injectable,
166
+ args: [{
167
+ providedIn: 'root',
168
+ }]
169
+ }], ctorParameters: () => [{ type: i5.ConfigService }, { type: i2.HttpClient }] });
170
+
171
+ /*
172
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
173
+ *
174
+ * Licensed under EUPL, Version 1.2 (the "License");
175
+ * you may not use this file except in compliance with the License.
176
+ * You may obtain a copy of the License at
177
+ *
178
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
179
+ *
180
+ * Unless required by applicable law or agreed to in writing, software
181
+ * distributed under the License is distributed on an "AS IS" basis,
182
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
183
+ * See the License for the specific language governing permissions and
184
+ * limitations under the License.
185
+ */
186
+ class BuildingBlockManagementDetailService {
187
+ get loadingDefinition$() {
188
+ return this._loadingDefinition$.asObservable();
189
+ }
190
+ get _route$() {
191
+ return this._routeSubject$.pipe(filter(route => route !== null));
192
+ }
193
+ get buildingBlockDefinitionKey() {
194
+ return this._buildingBlockDefinitionKey;
195
+ }
196
+ get buildingBlockDefinitionKey$() {
197
+ return this._route$.pipe(switchMap(route => route.paramMap.pipe(map(params => params.get('buildingBlockDefinitionKey')), filter(key => !!key), tap(key => (this._buildingBlockDefinitionKey = key)))));
198
+ }
199
+ get buildingBlockDefinitionVersionTag() {
200
+ return this._buildingBlockDefinitionVersionTag;
201
+ }
202
+ get buildingBlockDefinitionVersionTag$() {
203
+ return this._route$.pipe(switchMap(route => route.paramMap.pipe(map(params => params.get('buildingBlockDefinitionVersionTag')), filter(version => !!version), tap(version => (this._buildingBlockDefinitionVersionTag = version)))));
204
+ }
205
+ get activeTabKey$() {
206
+ return this._route$.pipe(switchMap(route => route.paramMap.pipe(map(params => params.get('tabKey')), filter(key => !!key))));
207
+ }
208
+ get buildingBlockDefinition$() {
209
+ return this._buildingBlockDefinition$.pipe(filter(definition => definition !== null), distinctUntilChanged((a, b) => isEqual(a, b)));
210
+ }
211
+ get isFinal$() {
212
+ return this.buildingBlockDefinition$.pipe(map(definition => definition.final));
213
+ }
214
+ get reloadVersions$() {
215
+ return this._reloadVersions$.asObservable();
216
+ }
217
+ get reloadProcessDefinitions$() {
218
+ return this._reloadProcessDefinitions$.asObservable();
219
+ }
220
+ get reloadFormDefinitions$() {
221
+ return this._reloadFormDefinitions$.asObservable();
222
+ }
223
+ get reloadFormFlowDefinitions$() {
224
+ return this._reloadFormFlowDefinitions$.asObservable();
225
+ }
226
+ constructor(buildingBlockManagementApiService, pageTitleService, router) {
227
+ this.buildingBlockManagementApiService = buildingBlockManagementApiService;
228
+ this.pageTitleService = pageTitleService;
229
+ this.router = router;
230
+ this._loadingDefinition$ = new BehaviorSubject(true);
231
+ this._routeSubject$ = new BehaviorSubject(null);
232
+ this._buildingBlockDefinition$ = new BehaviorSubject(null);
233
+ this._showProcessDefinitionUploadModal$ = new BehaviorSubject(false);
234
+ this.showProcessDefinitionUploadModal$ = this._showProcessDefinitionUploadModal$.asObservable();
235
+ this._reload$ = new BehaviorSubject(null);
236
+ this._reloadVersions$ = new BehaviorSubject(null);
237
+ this._reloadProcessDefinitions$ = new BehaviorSubject(null);
238
+ this._reloadFormDefinitions$ = new BehaviorSubject(null);
239
+ this._reloadFormFlowDefinitions$ = new BehaviorSubject(null);
240
+ this._subscriptions = new Subscription();
241
+ this._subscriptions.add(combineLatest([
242
+ this.buildingBlockDefinitionKey$,
243
+ this.buildingBlockDefinitionVersionTag$,
244
+ this._reload$,
245
+ ])
246
+ .pipe(tap(() => this._loadingDefinition$.next(true)), switchMap(([key, version]) => this.buildingBlockManagementApiService.getBuildingBlockDefinition(key, version)), tap(res => {
247
+ this._buildingBlockDefinition$.next(res);
248
+ this.pageTitleService.setCustomPageTitle(res.name);
249
+ this._loadingDefinition$.next(false);
250
+ }))
251
+ .subscribe());
252
+ }
253
+ setRoute(route) {
254
+ this._routeSubject$.next(route);
255
+ }
256
+ ngOnDestroy() {
257
+ this._subscriptions.unsubscribe();
258
+ }
259
+ navigateToTab(tabKey) {
260
+ this.buildingBlockDefinition$.subscribe(definition => {
261
+ this.router.navigate([
262
+ '/building-block-management',
263
+ 'building-block',
264
+ definition.key,
265
+ 'version',
266
+ definition.versionTag,
267
+ tabKey,
268
+ ]);
269
+ });
270
+ }
271
+ navigateToVersionTag(versionTag) {
272
+ const currentUrl = this.router.url.split('?')[0];
273
+ const parts = currentUrl.split('/');
274
+ const versionIndex = parts.findIndex(segment => segment === 'version');
275
+ if (versionIndex === -1 || versionIndex + 1 >= parts.length) {
276
+ return;
277
+ }
278
+ parts[versionIndex + 1] = versionTag;
279
+ const newUrl = parts.join('/');
280
+ this.router.navigateByUrl(newUrl);
281
+ }
282
+ reload() {
283
+ this._reload$.next(null);
284
+ }
285
+ reloadVersions() {
286
+ this._reloadVersions$.next(null);
287
+ }
288
+ showProcessDefinitionUploadModal() {
289
+ this._showProcessDefinitionUploadModal$.next(true);
290
+ }
291
+ hideProcessDefinitionUploadModal() {
292
+ this._showProcessDefinitionUploadModal$.next(false);
293
+ }
294
+ reloadProcessDefinitions() {
295
+ this._reloadProcessDefinitions$.next(null);
296
+ }
297
+ reloadFormDefinitions() {
298
+ this._reloadFormDefinitions$.next(null);
299
+ }
300
+ reloadFormFlowDefinitions() {
301
+ this._reloadFormFlowDefinitions$.next(null);
302
+ }
303
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: BuildingBlockManagementDetailService, deps: [{ token: BuildingBlockManagementApiService }, { token: i7.PageTitleService }, { token: i3.Router }], target: i0.ɵɵFactoryTarget.Injectable }); }
304
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: BuildingBlockManagementDetailService }); }
305
+ }
306
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: BuildingBlockManagementDetailService, decorators: [{
307
+ type: Injectable
308
+ }], ctorParameters: () => [{ type: BuildingBlockManagementApiService }, { type: i7.PageTitleService }, { type: i3.Router }] });
309
+
310
+ /*
311
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
312
+ *
313
+ * Licensed under EUPL, Version 1.2 (the "License");
314
+ * you may not use this file except in compliance with the License.
315
+ * You may obtain a copy of the License at
316
+ *
317
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
318
+ *
319
+ * Unless required by applicable law or agreed to in writing, software
320
+ * distributed under the License is distributed on an "AS IS" basis,
321
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
322
+ * See the License for the specific language governing permissions and
323
+ * limitations under the License.
324
+ */
325
+ class BuildingBlockManagementService {
326
+ constructor() {
327
+ this._showCreateModal$ = new BehaviorSubject(false);
328
+ this.showCreateModal$ = this._showCreateModal$.asObservable();
329
+ this._showUploadModal$ = new BehaviorSubject(false);
330
+ this.showUploadModal$ = this._showUploadModal$.asObservable();
331
+ this._usedKeys$ = new BehaviorSubject([]);
332
+ this.usedKeys$ = this._usedKeys$.asObservable();
333
+ this._reload$ = new BehaviorSubject(null);
334
+ this.reload$ = this._reload$.asObservable();
335
+ }
336
+ showCreateModal() {
337
+ this._showCreateModal$.next(true);
338
+ }
339
+ hideCreateModal() {
340
+ this._showCreateModal$.next(false);
341
+ }
342
+ showUploadModal() {
343
+ this._showUploadModal$.next(true);
344
+ }
345
+ hideUploadModal() {
346
+ this._showUploadModal$.next(false);
347
+ }
348
+ setUsedKeys(keys) {
349
+ this._usedKeys$.next(keys);
350
+ }
351
+ reload() {
352
+ this._reload$.next(null);
353
+ }
354
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: BuildingBlockManagementService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
355
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: BuildingBlockManagementService }); }
356
+ }
357
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: BuildingBlockManagementService, decorators: [{
358
+ type: Injectable
359
+ }] });
360
+
361
+ /*
362
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
363
+ *
364
+ * Licensed under EUPL, Version 1.2 (the "License");
365
+ * you may not use this file except in compliance with the License.
366
+ * You may obtain a copy of the License at
367
+ *
368
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
369
+ *
370
+ * Unless required by applicable law or agreed to in writing, software
371
+ * distributed under the License is distributed on an "AS IS" basis,
372
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
373
+ * See the License for the specific language governing permissions and
374
+ * limitations under the License.
375
+ */
376
+
377
+ /*
378
+ * Copyright 2015-2026 Ritense BV, the Netherlands.
379
+ *
380
+ * Licensed under EUPL, Version 1.2 (the "License");
381
+ * you may not use this file except in compliance with the License.
382
+ * You may obtain a copy of the License at
383
+ *
384
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
385
+ *
386
+ * Unless required by applicable law or agreed to in writing, software
387
+ * distributed under the License is distributed on an "AS IS" basis,
388
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
389
+ * See the License for the specific language governing permissions and
390
+ * limitations under the License.
391
+ */
392
+ const BUILDING_BLOCK_MANAGEMENT_TABS = {
393
+ GENERAL: 'general',
394
+ PROCESSES: 'process-definition',
395
+ DOCUMENT: 'document',
396
+ FORMS: 'forms',
397
+ FORM_FLOWS: 'form-flows',
398
+ DECISIONS: 'decisions',
399
+ };
400
+
401
+ /*
402
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
403
+ *
404
+ * Licensed under EUPL, Version 1.2 (the "License");
405
+ * you may not use this file except in compliance with the License.
406
+ * You may obtain a copy of the License at
407
+ *
408
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
409
+ *
410
+ * Unless required by applicable law or agreed to in writing, software
411
+ * distributed under the License is distributed on an "AS IS" basis,
412
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
413
+ * See the License for the specific language governing permissions and
414
+ * limitations under the License.
415
+ */
416
+ var UPLOAD_STATUS;
417
+ (function (UPLOAD_STATUS) {
418
+ UPLOAD_STATUS["ACTIVE"] = "active";
419
+ UPLOAD_STATUS["ERROR"] = "error";
420
+ UPLOAD_STATUS["FINISHED"] = "finished";
421
+ })(UPLOAD_STATUS || (UPLOAD_STATUS = {}));
422
+ var UPLOAD_STEP;
423
+ (function (UPLOAD_STEP) {
424
+ UPLOAD_STEP["FILE_SELECT"] = "fileSelect";
425
+ UPLOAD_STEP["FILE_UPLOAD"] = "fileUpload";
426
+ UPLOAD_STEP["PLUGINS"] = "plugins";
427
+ })(UPLOAD_STEP || (UPLOAD_STEP = {}));
428
+ const STEPS = [UPLOAD_STEP.PLUGINS, UPLOAD_STEP.FILE_SELECT, UPLOAD_STEP.FILE_UPLOAD];
429
+
430
+ /*
431
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
432
+ *
433
+ * Licensed under EUPL, Version 1.2 (the "License");
434
+ * you may not use this file except in compliance with the License.
435
+ * You may obtain a copy of the License at
436
+ *
437
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
438
+ *
439
+ * Unless required by applicable law or agreed to in writing, software
440
+ * distributed under the License is distributed on an "AS IS" basis,
441
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
442
+ * See the License for the specific language governing permissions and
443
+ * limitations under the License.
444
+ */
445
+
446
+ /*
447
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
448
+ *
449
+ * Licensed under EUPL, Version 1.2 (the "License");
450
+ * you may not use this file except in compliance with the License.
451
+ * You may obtain a copy of the License at
452
+ *
453
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
454
+ *
455
+ * Unless required by applicable law or agreed to in writing, software
456
+ * distributed under the License is distributed on an "AS IS" basis,
457
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
458
+ * See the License for the specific language governing permissions and
459
+ * limitations under the License.
460
+ */
461
+ class BuildingBlockManagementCreateModalComponent {
462
+ get name() {
463
+ return this.formGroup.get('name');
464
+ }
465
+ get key() {
466
+ return this.formGroup.get('key');
467
+ }
468
+ get versionTag() {
469
+ return this.formGroup.get('versionTag');
470
+ }
471
+ get description() {
472
+ return this.formGroup.get('description');
473
+ }
474
+ constructor(buildingBlockManagementApiService, buildingBlockManagementService, fb, router) {
475
+ this.buildingBlockManagementApiService = buildingBlockManagementApiService;
476
+ this.buildingBlockManagementService = buildingBlockManagementService;
477
+ this.fb = fb;
478
+ this.router = router;
479
+ this.showModal$ = this.buildingBlockManagementService.showCreateModal$;
480
+ this.usedKeys$ = this.buildingBlockManagementService.usedKeys$;
481
+ this.formGroup = this.fb.group({
482
+ name: this.fb.control('', Validators.required),
483
+ key: this.fb.control('', [Validators.required, Validators.pattern('[A-Za-z0-9-]*')]),
484
+ versionTag: this.fb.control('', Validators.required),
485
+ description: this.fb.control(''),
486
+ });
487
+ }
488
+ onCloseModal() {
489
+ this.buildingBlockManagementService.hideCreateModal();
490
+ this.resetForm();
491
+ }
492
+ onSave() {
493
+ this.formGroup.disable();
494
+ this.buildingBlockManagementApiService
495
+ .createBuildingBlockDefinition(this.formGroup.value)
496
+ .pipe(catchError(() => {
497
+ this.formGroup.enable();
498
+ return of(null);
499
+ }))
500
+ .subscribe(createdBuildingBlock => {
501
+ this.router.navigate([
502
+ '/building-block-management',
503
+ 'building-block',
504
+ createdBuildingBlock.key,
505
+ 'version',
506
+ createdBuildingBlock.versionTag,
507
+ BUILDING_BLOCK_MANAGEMENT_TABS.GENERAL,
508
+ ]);
509
+ });
510
+ }
511
+ resetForm() {
512
+ runAfterCarbonModalClosed(() => {
513
+ this.formGroup.reset();
514
+ this.formGroup.enable();
515
+ });
516
+ }
517
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: BuildingBlockManagementCreateModalComponent, deps: [{ token: BuildingBlockManagementApiService }, { token: BuildingBlockManagementService }, { token: i2$1.FormBuilder }, { token: i3.Router }], target: i0.ɵɵFactoryTarget.Component }); }
518
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.20", type: BuildingBlockManagementCreateModalComponent, isStandalone: true, selector: "valtimo-building-block-management-create-modal", 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 *ngIf=\"{\n showModal: showModal$ | async,\n } as obs\"\n [open]=\"obs.showModal\"\n showFooter=\"true\"\n valtimoCdsModal\n (close)=\"onCloseModal()\"\n>\n <cds-modal-header showCloseButton=\"true\" (closeSelect)=\"onCloseModal()\">\n <h3 cdsModalHeaderHeading>\n {{ 'buildingBlockManagement.createDefinition.modalTitle' | translate }}\n </h3>\n </cds-modal-header>\n\n <form\n [formGroup]=\"formGroup\"\n cdsModalContent\n class=\"valtimo-definition-create__content\"\n [cdsLayer]=\"1\"\n >\n <div class=\"cds--text-input__field-wrapper\">\n <cds-label [disabled]=\"formGroup.disabled\" [invalid]=\"name.touched && name.invalid\">\n <span class=\"label-with-tooltip select-label\">\n {{ 'buildingBlockManagement.createDefinition.name' | translate }}\n\n <v-tooltip-icon\n [tooltip]=\"'buildingBlockManagement.createDefinition.nameTooltip' | translate\"\n [disabled]=\"obs.disabled\"\n ></v-tooltip-icon>\n </span>\n\n <input\n formControlName=\"name\"\n cdsText\n placeholder=\"{{ 'buildingBlockManagement.createDefinition.namePlaceholder' | translate }}\"\n />\n </cds-label>\n </div>\n\n <valtimo-auto-key-input\n [cdsLayer]=\"1\"\n formControlName=\"key\"\n labelTranslationKey=\"buildingBlockManagement.createDefinition.keyTitle\"\n placeholderTranslationKey=\"buildingBlockManagement.createDefinition.keyPlaceHolder\"\n mode=\"add\"\n [usedKeys]=\"usedKeys$ | async\"\n [sourceText]=\"name.value\"\n >\n </valtimo-auto-key-input>\n\n <div class=\"cds--text-input__field-wrapper\">\n <cds-label\n [disabled]=\"formGroup.disabled\"\n [invalid]=\"versionTag.touched && versionTag.invalid\"\n >\n <span class=\"label-with-tooltip select-label\">\n {{ 'buildingBlockManagement.createDefinition.version' | translate }}\n\n <v-tooltip-icon\n [tooltip]=\"'buildingBlockManagement.createDefinition.versionTooltip' | translate\"\n [disabled]=\"obs.disabled\"\n ></v-tooltip-icon>\n </span>\n\n <input\n formControlName=\"versionTag\"\n cdsText\n placeholder=\"{{\n 'buildingBlockManagement.createDefinition.versionPlaceholder' | translate\n }}\"\n />\n </cds-label>\n </div>\n\n <div class=\"cds--text-input__field-wrapper\">\n <cds-label\n [disabled]=\"formGroup.disabled\"\n [invalid]=\"description.touched && description.invalid\"\n >\n <span class=\"label-with-tooltip select-label\">\n {{ 'buildingBlockManagement.createDefinition.description' | translate }}\n\n <v-tooltip-icon\n [tooltip]=\"'buildingBlockManagement.createDefinition.descriptionTooltip' | translate\"\n [disabled]=\"obs.disabled\"\n ></v-tooltip-icon>\n </span>\n\n <textarea\n cdsTextArea\n formControlName=\"description\"\n placeholder=\"{{\n 'buildingBlockManagement.createDefinition.descriptionPlaceholder' | translate\n }}\"\n [rows]=\"3\"\n [cols]=\"150\"\n ></textarea>\n </cds-label>\n </div>\n </form>\n\n <cds-modal-footer>\n <button cdsButton=\"secondary\" (click)=\"onCloseModal()\">\n {{ 'interface.cancel' | translate }}\n </button>\n\n <button cdsButton=\"primary\" [disabled]=\"formGroup.invalid\" (click)=\"onSave()\">\n {{ 'interface.save' | translate }}\n </button>\n </cds-modal-footer>\n</cds-modal>\n", styles: [".valtimo-definition-create__content{display:flex;flex-direction:column;gap:16px}.cds--text-input__field-wrapper cds-label{width:100%}.cds--text-input__field-wrapper ::ng-deep .cds--label{width:100%}.cds--text-input__field-wrapper:not(:last-child){margin-bottom:16px}.label-with-tooltip{display:flex;align-items:center}.select-label{padding-bottom:8px}\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: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }, { kind: "ngmodule", type: ModalModule }, { kind: "component", type: i3$1.Modal, selector: "cds-modal, ibm-modal", inputs: ["size", "theme", "ariaLabel", "open", "trigger", "hasScrollingContent"], outputs: ["overlaySelected", "close"] }, { kind: "component", type: i3$1.ModalHeader, selector: "cds-modal-header, ibm-modal-header", inputs: ["theme", "closeLabel", "showCloseButton"], outputs: ["closeSelect"] }, { kind: "component", type: i3$1.ModalFooter, selector: "cds-modal-footer, ibm-modal-footer" }, { kind: "directive", type: i3$1.ModalContent, selector: "[cdsModalContent], [ibmModalContent]", inputs: ["hasForm"] }, { kind: "directive", type: i3$1.ModalHeaderHeading, selector: "[cdsModalHeaderHeading], [ibmModalHeaderHeading]" }, { kind: "ngmodule", type: ButtonModule }, { kind: "directive", type: i3$1.Button, selector: "[cdsButton], [ibmButton]", inputs: ["ibmButton", "cdsButton", "size", "skeleton", "iconOnly", "isExpressive"] }, { kind: "ngmodule", type: IconModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "ngmodule", type: InputModule }, { kind: "component", type: i3$1.Label, selector: "cds-label, ibm-label", inputs: ["labelInputID", "disabled", "skeleton", "helperText", "invalidText", "invalid", "warn", "warnText", "ariaLabel"] }, { kind: "directive", type: i3$1.TextInput, selector: "[cdsText], [ibmText]", inputs: ["theme", "size", "invalid", "warn", "skeleton"] }, { kind: "directive", type: i3$1.TextArea, selector: "[cdsTextArea], [ibmTextArea]", inputs: ["theme", "invalid", "skeleton"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: TooltipModule }, { kind: "pipe", type: TranslatePipe, name: "translate" }, { kind: "directive", type: ValtimoCdsModalDirective, selector: "[valtimoCdsModal]", inputs: ["minContentHeight"] }, { kind: "component", type: AutoKeyInputComponent, selector: "valtimo-auto-key-input", inputs: ["labelTranslationKey", "placeholderTranslationKey", "mode", "usedKeys", "sourceText"] }, { kind: "ngmodule", type: LayerModule }, { kind: "directive", type: i3$1.LayerDirective, selector: "[cdsLayer], [ibmLayer]", inputs: ["ibmLayer", "cdsLayer"], exportAs: ["layer"] }, { kind: "ngmodule", type: TooltipIconModule }, { kind: "component", type: i7.TooltipIconComponent, selector: "v-tooltip-icon", inputs: ["tooltip", "disabled"] }] }); }
519
+ }
520
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: BuildingBlockManagementCreateModalComponent, decorators: [{
521
+ type: Component,
522
+ args: [{ standalone: true, selector: 'valtimo-building-block-management-create-modal', imports: [
523
+ CommonModule,
524
+ ModalModule,
525
+ ButtonModule,
526
+ IconModule,
527
+ FormsModule,
528
+ InputModule,
529
+ ReactiveFormsModule,
530
+ TooltipModule,
531
+ TranslatePipe,
532
+ ValtimoCdsModalDirective,
533
+ AutoKeyInputComponent,
534
+ LayerModule,
535
+ TooltipIconModule,
536
+ ], 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 *ngIf=\"{\n showModal: showModal$ | async,\n } as obs\"\n [open]=\"obs.showModal\"\n showFooter=\"true\"\n valtimoCdsModal\n (close)=\"onCloseModal()\"\n>\n <cds-modal-header showCloseButton=\"true\" (closeSelect)=\"onCloseModal()\">\n <h3 cdsModalHeaderHeading>\n {{ 'buildingBlockManagement.createDefinition.modalTitle' | translate }}\n </h3>\n </cds-modal-header>\n\n <form\n [formGroup]=\"formGroup\"\n cdsModalContent\n class=\"valtimo-definition-create__content\"\n [cdsLayer]=\"1\"\n >\n <div class=\"cds--text-input__field-wrapper\">\n <cds-label [disabled]=\"formGroup.disabled\" [invalid]=\"name.touched && name.invalid\">\n <span class=\"label-with-tooltip select-label\">\n {{ 'buildingBlockManagement.createDefinition.name' | translate }}\n\n <v-tooltip-icon\n [tooltip]=\"'buildingBlockManagement.createDefinition.nameTooltip' | translate\"\n [disabled]=\"obs.disabled\"\n ></v-tooltip-icon>\n </span>\n\n <input\n formControlName=\"name\"\n cdsText\n placeholder=\"{{ 'buildingBlockManagement.createDefinition.namePlaceholder' | translate }}\"\n />\n </cds-label>\n </div>\n\n <valtimo-auto-key-input\n [cdsLayer]=\"1\"\n formControlName=\"key\"\n labelTranslationKey=\"buildingBlockManagement.createDefinition.keyTitle\"\n placeholderTranslationKey=\"buildingBlockManagement.createDefinition.keyPlaceHolder\"\n mode=\"add\"\n [usedKeys]=\"usedKeys$ | async\"\n [sourceText]=\"name.value\"\n >\n </valtimo-auto-key-input>\n\n <div class=\"cds--text-input__field-wrapper\">\n <cds-label\n [disabled]=\"formGroup.disabled\"\n [invalid]=\"versionTag.touched && versionTag.invalid\"\n >\n <span class=\"label-with-tooltip select-label\">\n {{ 'buildingBlockManagement.createDefinition.version' | translate }}\n\n <v-tooltip-icon\n [tooltip]=\"'buildingBlockManagement.createDefinition.versionTooltip' | translate\"\n [disabled]=\"obs.disabled\"\n ></v-tooltip-icon>\n </span>\n\n <input\n formControlName=\"versionTag\"\n cdsText\n placeholder=\"{{\n 'buildingBlockManagement.createDefinition.versionPlaceholder' | translate\n }}\"\n />\n </cds-label>\n </div>\n\n <div class=\"cds--text-input__field-wrapper\">\n <cds-label\n [disabled]=\"formGroup.disabled\"\n [invalid]=\"description.touched && description.invalid\"\n >\n <span class=\"label-with-tooltip select-label\">\n {{ 'buildingBlockManagement.createDefinition.description' | translate }}\n\n <v-tooltip-icon\n [tooltip]=\"'buildingBlockManagement.createDefinition.descriptionTooltip' | translate\"\n [disabled]=\"obs.disabled\"\n ></v-tooltip-icon>\n </span>\n\n <textarea\n cdsTextArea\n formControlName=\"description\"\n placeholder=\"{{\n 'buildingBlockManagement.createDefinition.descriptionPlaceholder' | translate\n }}\"\n [rows]=\"3\"\n [cols]=\"150\"\n ></textarea>\n </cds-label>\n </div>\n </form>\n\n <cds-modal-footer>\n <button cdsButton=\"secondary\" (click)=\"onCloseModal()\">\n {{ 'interface.cancel' | translate }}\n </button>\n\n <button cdsButton=\"primary\" [disabled]=\"formGroup.invalid\" (click)=\"onSave()\">\n {{ 'interface.save' | translate }}\n </button>\n </cds-modal-footer>\n</cds-modal>\n", styles: [".valtimo-definition-create__content{display:flex;flex-direction:column;gap:16px}.cds--text-input__field-wrapper cds-label{width:100%}.cds--text-input__field-wrapper ::ng-deep .cds--label{width:100%}.cds--text-input__field-wrapper:not(:last-child){margin-bottom:16px}.label-with-tooltip{display:flex;align-items:center}.select-label{padding-bottom:8px}\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"] }]
537
+ }], ctorParameters: () => [{ type: BuildingBlockManagementApiService }, { type: BuildingBlockManagementService }, { type: i2$1.FormBuilder }, { type: i3.Router }] });
538
+
539
+ /*
540
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
541
+ *
542
+ * Licensed under EUPL, Version 1.2 (the "License");
543
+ * you may not use this file except in compliance with the License.
544
+ * You may obtain a copy of the License at
545
+ *
546
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
547
+ *
548
+ * Unless required by applicable law or agreed to in writing, software
549
+ * distributed under the License is distributed on an "AS IS" basis,
550
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
551
+ * See the License for the specific language governing permissions and
552
+ * limitations under the License.
553
+ */
554
+ class BuildingBlockManagementUploadStepComponent {
555
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: BuildingBlockManagementUploadStepComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
556
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.20", type: BuildingBlockManagementUploadStepComponent, isStandalone: true, selector: "valtimo-building-block-management-upload-step", inputs: { illustration: "illustration", message: "message", title: "title" }, 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<div class=\"valtimo-upload-step__content\">\n <div class=\"valtimo-upload-step__title\">{{ title }}</div>\n\n <div class=\"valtimo-upload-step__message\">{{ message }}</div>\n</div>\n\n<img [src]=\"illustration\" alt=\"{{ illustration }}\" class=\"valtimo-upload-step__illustration\" />\n", styles: [":host{display:flex;justify-content:space-around;align-items:center;gap:32px;height:100%}:host label{color:unset}.valtimo-upload-step__content{display:flex;flex-direction:column;gap:16px}.valtimo-upload-step__title{font-weight:600;font-size:16px}.valtimo-upload-step__message{font-size:16px;line-height:28px}.valtimo-upload-step__illustration{max-width:200px}\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 }] }); }
557
+ }
558
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: BuildingBlockManagementUploadStepComponent, decorators: [{
559
+ type: Component,
560
+ args: [{ standalone: true, selector: 'valtimo-building-block-management-upload-step', imports: [CommonModule], 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<div class=\"valtimo-upload-step__content\">\n <div class=\"valtimo-upload-step__title\">{{ title }}</div>\n\n <div class=\"valtimo-upload-step__message\">{{ message }}</div>\n</div>\n\n<img [src]=\"illustration\" alt=\"{{ illustration }}\" class=\"valtimo-upload-step__illustration\" />\n", styles: [":host{display:flex;justify-content:space-around;align-items:center;gap:32px;height:100%}:host label{color:unset}.valtimo-upload-step__content{display:flex;flex-direction:column;gap:16px}.valtimo-upload-step__title{font-weight:600;font-size:16px}.valtimo-upload-step__message{font-size:16px;line-height:28px}.valtimo-upload-step__illustration{max-width:200px}\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"] }]
561
+ }], propDecorators: { illustration: [{
562
+ type: Input
563
+ }], message: [{
564
+ type: Input
565
+ }], title: [{
566
+ type: Input
567
+ }] } });
568
+
569
+ /*
570
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
571
+ *
572
+ * Licensed under EUPL, Version 1.2 (the "License");
573
+ * you may not use this file except in compliance with the License.
574
+ * You may obtain a copy of the License at
575
+ *
576
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
577
+ *
578
+ * Unless required by applicable law or agreed to in writing, software
579
+ * distributed under the License is distributed on an "AS IS" basis,
580
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
581
+ * See the License for the specific language governing permissions and
582
+ * limitations under the License.
583
+ */
584
+ class BuildingBlockManagementUploadModalComponent {
585
+ constructor(buildingBlockManagementApiService, buildingBlockManagementService, fb, iconService, translateService) {
586
+ this.buildingBlockManagementApiService = buildingBlockManagementApiService;
587
+ this.buildingBlockManagementService = buildingBlockManagementService;
588
+ this.fb = fb;
589
+ this.iconService = iconService;
590
+ this.translateService = translateService;
591
+ this.acceptedFiles = ['.zip'];
592
+ this.showUploadModal$ = this.buildingBlockManagementService.showUploadModal$;
593
+ this._disabled$ = new BehaviorSubject(true);
594
+ this.UPLOAD_STEP = UPLOAD_STEP;
595
+ this.UPLOAD_STATUS = UPLOAD_STATUS;
596
+ this.activeStep$ = new BehaviorSubject(UPLOAD_STEP.PLUGINS);
597
+ this.backButtonEnabled$ = this.activeStep$.pipe(map((activeStep) => [UPLOAD_STEP.FILE_SELECT].includes(activeStep)));
598
+ this.isStepAfterUpload$ = this.activeStep$.pipe(map((activeStep) => ![UPLOAD_STEP.PLUGINS, UPLOAD_STEP.FILE_SELECT].includes(activeStep)));
599
+ this.showCloseButton$ = this.activeStep$.pipe(map((activeStep) => [UPLOAD_STEP.PLUGINS, UPLOAD_STEP.FILE_SELECT, UPLOAD_STEP.FILE_UPLOAD].includes(activeStep)));
600
+ this.$warningChecked = signal(false);
601
+ this.nextButtonDisabled$ = combineLatest([
602
+ this.activeStep$,
603
+ this._disabled$,
604
+ toObservable(this.$warningChecked),
605
+ ]).pipe(map(([activeStep, disabled, warningChecked]) => {
606
+ const warningNotChecked = activeStep === UPLOAD_STEP.FILE_SELECT && !warningChecked;
607
+ return warningNotChecked || (activeStep !== UPLOAD_STEP.PLUGINS && disabled);
608
+ }));
609
+ this.notificationObj$ = combineLatest([
610
+ this.translateService.stream('interface.warning'),
611
+ this.translateService.stream('buildingBlockManagement.importDefinition.overwriteWarning'),
612
+ ]).pipe(map(([title, message]) => ({
613
+ type: 'warning',
614
+ title,
615
+ message,
616
+ showClose: false,
617
+ lowContrast: true,
618
+ })));
619
+ this.showCheckboxError$ = new BehaviorSubject(false);
620
+ this.uploadStatus$ = new BehaviorSubject(UPLOAD_STATUS.ACTIVE);
621
+ this.form = this.fb.group({
622
+ file: this.fb.control(new Set(), [Validators.required]),
623
+ });
624
+ this._importFile$ = new BehaviorSubject('');
625
+ this._subscriptions = new Subscription();
626
+ this.iconService.register(WarningFilled16);
627
+ }
628
+ ngOnInit() {
629
+ const control = this.form.get('file');
630
+ if (!control) {
631
+ return;
632
+ }
633
+ this._subscriptions.add(this.form.get('file').valueChanges.subscribe((fileSet) => {
634
+ // @ts-ignore
635
+ const [fileItem] = fileSet;
636
+ if (!fileItem) {
637
+ this._disabled$.next(true);
638
+ this.showCheckboxError$.next(false);
639
+ this.$warningChecked.set(false);
640
+ return;
641
+ }
642
+ this.setZipFile(fileItem);
643
+ }));
644
+ }
645
+ ngOnDestroy() {
646
+ this._subscriptions.unsubscribe();
647
+ this.resetModal();
648
+ }
649
+ onCloseModal(definitionUploaded) {
650
+ if (definitionUploaded) {
651
+ this.buildingBlockManagementService.reload();
652
+ }
653
+ this.buildingBlockManagementService.hideUploadModal();
654
+ runAfterCarbonModalClosed(() => {
655
+ this.resetModal();
656
+ });
657
+ }
658
+ onBackClick(activeStep) {
659
+ const prevIndex = STEPS.findIndex((step) => step === activeStep) - 1;
660
+ if (prevIndex === -1) {
661
+ return;
662
+ }
663
+ this.activeStep$.next(STEPS[prevIndex]);
664
+ }
665
+ onNextClick(activeStep) {
666
+ const nextIndex = STEPS.findIndex((step) => step === activeStep) + 1;
667
+ if (nextIndex === STEPS.length) {
668
+ return;
669
+ }
670
+ if (activeStep === UPLOAD_STEP.FILE_SELECT && !this.$warningChecked()) {
671
+ this.showCheckboxError$.next(true);
672
+ return;
673
+ }
674
+ this.activeStep$.next(STEPS[nextIndex]);
675
+ if (STEPS[nextIndex] !== UPLOAD_STEP.FILE_UPLOAD) {
676
+ return;
677
+ }
678
+ this.uploadDefinition();
679
+ }
680
+ onCheckedChange(checked) {
681
+ this.$warningChecked.set(checked);
682
+ if (!checked) {
683
+ return;
684
+ }
685
+ this.showCheckboxError$.next(false);
686
+ }
687
+ setZipFile(fileItem) {
688
+ const file = fileItem?.file;
689
+ if (!file) {
690
+ this._importFile$.next('');
691
+ return;
692
+ }
693
+ const blob = new Blob([fileItem.file], { type: fileItem.file.type });
694
+ const fd = new FormData();
695
+ fd.append('file', blob, fileItem.file.name);
696
+ this._importFile$.next(fd);
697
+ this._disabled$.next(false);
698
+ }
699
+ uploadDefinition() {
700
+ this._disabled$.next(true);
701
+ this._importFile$
702
+ .pipe(switchMap((file) => this.buildingBlockManagementApiService.importBuildingBlockDefinition(file)), take(1))
703
+ .subscribe({
704
+ next: () => {
705
+ this._disabled$.next(false);
706
+ this.uploadStatus$.next(UPLOAD_STATUS.FINISHED);
707
+ },
708
+ error: () => {
709
+ this.uploadStatus$.next(UPLOAD_STATUS.ERROR);
710
+ this._disabled$.next(false);
711
+ },
712
+ });
713
+ }
714
+ resetModal() {
715
+ setTimeout(() => {
716
+ this.activeStep$.next(UPLOAD_STEP.PLUGINS);
717
+ this.uploadStatus$.next(UPLOAD_STATUS.ACTIVE);
718
+ this.showCheckboxError$.next(false);
719
+ }, CARBON_CONSTANTS.modalAnimationMs);
720
+ }
721
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: BuildingBlockManagementUploadModalComponent, deps: [{ token: BuildingBlockManagementApiService }, { token: BuildingBlockManagementService }, { token: i2$1.FormBuilder }, { token: i3$1.IconService }, { token: i2$2.TranslateService }], target: i0.ɵɵFactoryTarget.Component }); }
722
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.20", type: BuildingBlockManagementUploadModalComponent, isStandalone: true, selector: "valtimo-building-block-management-upload-modal", 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 *ngIf=\"{\n activeStep: activeStep$ | async,\n backButtonEnabled: backButtonEnabled$ | async,\n isStepAfterUpload: isStepAfterUpload$ | async,\n nextButtonDisabled: nextButtonDisabled$ | async,\n notificationObj: notificationObj$ | async,\n showCheckboxError: showCheckboxError$ | async,\n showCloseButton: showCloseButton$ | async,\n uploadStatus: uploadStatus$ | async,\n showUploadModal: showUploadModal$ | async,\n } as obs\"\n valtimoCdsModal\n [open]=\"obs.showUploadModal\"\n showFooter=\"true\"\n class=\"valtimo-definition-uploader\"\n (close)=\"onCloseModal()\"\n>\n <cds-modal-header\n [showCloseButton]=\"obs.showCloseButton\"\n (closeSelect)=\"onCloseModal(obs.isStepAfterUpload && obs.uploadStatus !== UPLOAD_STATUS.ERROR)\"\n >\n <h3 cdsModalHeaderHeading>\n {{ 'buildingBlockManagement.importDefinition.title' | translate }}\n </h3>\n </cds-modal-header>\n\n <section [ngSwitch]=\"obs.activeStep\" cdsModalContent class=\"valtimo-definition-uploader__content\">\n <ng-template ngSwitchDefault>\n <valtimo-building-block-management-upload-step\n [message]=\"\n 'buildingBlockManagement.importDefinition.steps.' + obs.activeStep + '.message'\n | translate\n \"\n [title]=\"\n 'buildingBlockManagement.importDefinition.steps.' + obs.activeStep + '.title' | translate\n \"\n [illustration]=\"'valtimo-layout/img/' + obs.activeStep + '.svg'\"\n >\n </valtimo-building-block-management-upload-step>\n </ng-template>\n\n <form *ngSwitchCase=\"UPLOAD_STEP.FILE_SELECT\" [formGroup]=\"form\">\n <cds-file-uploader\n [accept]=\"acceptedFiles\"\n [buttonText]=\"'buildingBlockManagement.importDefinition.upload.buttonText' | translate\"\n [description]=\"'buildingBlockManagement.importDefinition.upload.description' | translate\"\n [multiple]=\"false\"\n [title]=\"'buildingBlockManagement.importDefinition.upload.title' | translate\"\n buttonType=\"primary\"\n formControlName=\"file\"\n class=\"valtimo-definition-uploader__file-uploader\"\n >\n </cds-file-uploader>\n\n <ng-container *ngIf=\"obs.activeStep === UPLOAD_STEP.FILE_SELECT\">\n <cds-inline-notification [notificationObj]=\"obs.notificationObj\"></cds-inline-notification>\n\n <div class=\"valtimo-uploader__checkbox\">\n <cds-checkbox\n [class.valtimo-definition-uploader__checkbox--invalid]=\"obs.showCheckboxError\"\n (checkedChange)=\"onCheckedChange($event)\"\n >\n {{ 'buildingBlockManagement.importDefinition.checkbox.message' | translate }}\n </cds-checkbox>\n\n <div *ngIf=\"obs.showCheckboxError\" class=\"valtimo-definition-uploader__error\">\n <svg cdsIcon=\"warning--filled\" size=\"16\"></svg>\n {{ 'buildingBlockManagement.importDefinition.checkbox.error' | translate }}\n </div>\n </div>\n </ng-container>\n </form>\n\n <cds-progress-bar\n *ngSwitchCase=\"UPLOAD_STEP.FILE_UPLOAD\"\n class=\"valtimo-definition-uploader__progress-bar\"\n [label]=\"'buildingBlockManagement.importDefinition.progressBar.label' | translate\"\n [status]=\"obs.uploadStatus\"\n [helperText]=\"\n 'buildingBlockManagement.importDefinition.progressBar.' + obs.uploadStatus | translate\n \"\n ></cds-progress-bar>\n </section>\n\n <cds-modal-footer\n class=\"valtimo-definition-uploader__footer\"\n [class.valtimo-definition-uploader__footer--double]=\"obs.activeStep === UPLOAD_STEP.PLUGINS\"\n >\n <button\n *ngIf=\"obs.uploadStatus !== UPLOAD_STATUS.ERROR && obs.activeStep !== UPLOAD_STEP.FILE_UPLOAD\"\n class=\"valtimo-definition-uploader__cancel\"\n cdsButton=\"ghost\"\n (click)=\"onCloseModal(obs.isStepAfterUpload)\"\n >\n {{ (obs.isStepAfterUpload ? 'interface.skip' : 'interface.cancel') | translate }}\n </button>\n\n <div class=\"valtimo-definition-uploader__actions\">\n <button\n *ngIf=\"obs.backButtonEnabled\"\n cdsButton=\"secondary\"\n (click)=\"onBackClick(obs.activeStep)\"\n >\n {{ 'interface.back' | translate }}\n </button>\n\n <button\n *ngIf=\"\n obs.uploadStatus !== UPLOAD_STATUS.ERROR && obs.activeStep !== UPLOAD_STEP.FILE_UPLOAD\n \"\n cdsButton=\"primary\"\n [disabled]=\"obs.nextButtonDisabled\"\n (click)=\"onNextClick(obs.activeStep)\"\n >\n {{\n (obs.activeStep === UPLOAD_STEP.FILE_SELECT\n ? 'buildingBlockManagement.importDefinition.startUpload'\n : 'interface.next'\n ) | translate\n }}\n </button>\n\n <button\n *ngIf=\"\n obs.uploadStatus === UPLOAD_STATUS.ERROR || obs.activeStep === UPLOAD_STEP.FILE_UPLOAD\n \"\n class=\"valtimo-definition-uploader__cancel\"\n cdsButton=\"primary\"\n (click)=\"onCloseModal(true)\"\n >\n {{ 'interface.finish' | translate }}\n </button>\n </div>\n </cds-modal-footer>\n</cds-modal>\n", styles: [".valtimo-definition-uploader__content,.valtimo-definition-uploader__content form{display:flex;flex-direction:column;gap:16px}.valtimo-definition-uploader__footer ::ng-deep .cds--modal-footer{justify-content:unset!important;display:grid!important;grid-template-columns:1fr 1fr 2fr!important;grid-template-areas:\"cancel . actions\"!important}.valtimo-definition-uploader__footer--double ::ng-deep .cds--modal-footer{grid-template-columns:1fr 1fr!important;grid-template-areas:\"cancel actions\"!important}.valtimo-definition-uploader__progress-bar{height:100%;display:flex;flex-direction:column;justify-content:center}.valtimo-definition-uploader__error{display:flex;align-items:center;gap:10px;color:#da1e28;fill:#da1e28;font-size:12px}.valtimo-definition-uploader__cancel{grid-area:cancel;width:100%}.valtimo-definition-uploader__actions{grid-area:actions;display:flex}.valtimo-definition-uploader__actions button{flex:unset;width:100%}.valtimo-definition-uploader__file-uploader ::ng-deep cds-file{max-width:unset}.valtimo-definition-uploader__checkbox{display:flex;flex-direction:column;gap:8px}.valtimo-definition-uploader__checkbox--invalid ::ng-deep label:before{border-color:#da1e28;margin-inline:0}.valtimo-definition-uploader ::ng-deep .cds--modal-container{height:550px}.valtimo-definition-uploader ::ng-deep .cds--checkbox-label-text{color:#000}\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: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i4.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i4.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "directive", type: i4.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }, { kind: "ngmodule", type: FileUploaderModule }, { kind: "component", type: i3$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: i3$1.Modal, selector: "cds-modal, ibm-modal", inputs: ["size", "theme", "ariaLabel", "open", "trigger", "hasScrollingContent"], outputs: ["overlaySelected", "close"] }, { kind: "component", type: i3$1.ModalHeader, selector: "cds-modal-header, ibm-modal-header", inputs: ["theme", "closeLabel", "showCloseButton"], outputs: ["closeSelect"] }, { kind: "component", type: i3$1.ModalFooter, selector: "cds-modal-footer, ibm-modal-footer" }, { kind: "directive", type: i3$1.ModalContent, selector: "[cdsModalContent], [ibmModalContent]", inputs: ["hasForm"] }, { kind: "directive", type: i3$1.ModalHeaderHeading, selector: "[cdsModalHeaderHeading], [ibmModalHeaderHeading]" }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i2$2.TranslatePipe, name: "translate" }, { kind: "ngmodule", type: ButtonModule }, { kind: "directive", type: i3$1.Button, selector: "[cdsButton], [ibmButton]", inputs: ["ibmButton", "cdsButton", "size", "skeleton", "iconOnly", "isExpressive"] }, { kind: "ngmodule", type: ProgressBarModule }, { kind: "component", type: i3$1.ProgressBar, selector: "cds-progress-bar, ibm-progress-bar", inputs: ["value", "id", "label", "helperText", "max", "type", "status", "size"] }, { kind: "ngmodule", type: NotificationModule }, { kind: "component", type: i3$1.Notification, selector: "cds-notification, cds-inline-notification, ibm-notification, ibm-inline-notification", inputs: ["notificationObj"] }, { kind: "ngmodule", type: CheckboxModule }, { kind: "component", type: i3$1.Checkbox, selector: "cds-checkbox, ibm-checkbox", inputs: ["disabled", "skeleton", "hideLabel", "name", "id", "required", "value", "ariaLabel", "ariaLabelledby", "indeterminate", "checked"], outputs: ["click", "checkedChange", "indeterminateChange"] }, { kind: "component", type: BuildingBlockManagementUploadStepComponent, selector: "valtimo-building-block-management-upload-step", inputs: ["illustration", "message", "title"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
723
+ }
724
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: BuildingBlockManagementUploadModalComponent, decorators: [{
725
+ type: Component,
726
+ args: [{ standalone: true, selector: 'valtimo-building-block-management-upload-modal', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
727
+ CommonModule,
728
+ FileUploaderModule,
729
+ ModalModule,
730
+ TranslateModule,
731
+ ButtonModule,
732
+ ProgressBarModule,
733
+ NotificationModule,
734
+ CheckboxModule,
735
+ BuildingBlockManagementUploadStepComponent,
736
+ ReactiveFormsModule,
737
+ ], 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 *ngIf=\"{\n activeStep: activeStep$ | async,\n backButtonEnabled: backButtonEnabled$ | async,\n isStepAfterUpload: isStepAfterUpload$ | async,\n nextButtonDisabled: nextButtonDisabled$ | async,\n notificationObj: notificationObj$ | async,\n showCheckboxError: showCheckboxError$ | async,\n showCloseButton: showCloseButton$ | async,\n uploadStatus: uploadStatus$ | async,\n showUploadModal: showUploadModal$ | async,\n } as obs\"\n valtimoCdsModal\n [open]=\"obs.showUploadModal\"\n showFooter=\"true\"\n class=\"valtimo-definition-uploader\"\n (close)=\"onCloseModal()\"\n>\n <cds-modal-header\n [showCloseButton]=\"obs.showCloseButton\"\n (closeSelect)=\"onCloseModal(obs.isStepAfterUpload && obs.uploadStatus !== UPLOAD_STATUS.ERROR)\"\n >\n <h3 cdsModalHeaderHeading>\n {{ 'buildingBlockManagement.importDefinition.title' | translate }}\n </h3>\n </cds-modal-header>\n\n <section [ngSwitch]=\"obs.activeStep\" cdsModalContent class=\"valtimo-definition-uploader__content\">\n <ng-template ngSwitchDefault>\n <valtimo-building-block-management-upload-step\n [message]=\"\n 'buildingBlockManagement.importDefinition.steps.' + obs.activeStep + '.message'\n | translate\n \"\n [title]=\"\n 'buildingBlockManagement.importDefinition.steps.' + obs.activeStep + '.title' | translate\n \"\n [illustration]=\"'valtimo-layout/img/' + obs.activeStep + '.svg'\"\n >\n </valtimo-building-block-management-upload-step>\n </ng-template>\n\n <form *ngSwitchCase=\"UPLOAD_STEP.FILE_SELECT\" [formGroup]=\"form\">\n <cds-file-uploader\n [accept]=\"acceptedFiles\"\n [buttonText]=\"'buildingBlockManagement.importDefinition.upload.buttonText' | translate\"\n [description]=\"'buildingBlockManagement.importDefinition.upload.description' | translate\"\n [multiple]=\"false\"\n [title]=\"'buildingBlockManagement.importDefinition.upload.title' | translate\"\n buttonType=\"primary\"\n formControlName=\"file\"\n class=\"valtimo-definition-uploader__file-uploader\"\n >\n </cds-file-uploader>\n\n <ng-container *ngIf=\"obs.activeStep === UPLOAD_STEP.FILE_SELECT\">\n <cds-inline-notification [notificationObj]=\"obs.notificationObj\"></cds-inline-notification>\n\n <div class=\"valtimo-uploader__checkbox\">\n <cds-checkbox\n [class.valtimo-definition-uploader__checkbox--invalid]=\"obs.showCheckboxError\"\n (checkedChange)=\"onCheckedChange($event)\"\n >\n {{ 'buildingBlockManagement.importDefinition.checkbox.message' | translate }}\n </cds-checkbox>\n\n <div *ngIf=\"obs.showCheckboxError\" class=\"valtimo-definition-uploader__error\">\n <svg cdsIcon=\"warning--filled\" size=\"16\"></svg>\n {{ 'buildingBlockManagement.importDefinition.checkbox.error' | translate }}\n </div>\n </div>\n </ng-container>\n </form>\n\n <cds-progress-bar\n *ngSwitchCase=\"UPLOAD_STEP.FILE_UPLOAD\"\n class=\"valtimo-definition-uploader__progress-bar\"\n [label]=\"'buildingBlockManagement.importDefinition.progressBar.label' | translate\"\n [status]=\"obs.uploadStatus\"\n [helperText]=\"\n 'buildingBlockManagement.importDefinition.progressBar.' + obs.uploadStatus | translate\n \"\n ></cds-progress-bar>\n </section>\n\n <cds-modal-footer\n class=\"valtimo-definition-uploader__footer\"\n [class.valtimo-definition-uploader__footer--double]=\"obs.activeStep === UPLOAD_STEP.PLUGINS\"\n >\n <button\n *ngIf=\"obs.uploadStatus !== UPLOAD_STATUS.ERROR && obs.activeStep !== UPLOAD_STEP.FILE_UPLOAD\"\n class=\"valtimo-definition-uploader__cancel\"\n cdsButton=\"ghost\"\n (click)=\"onCloseModal(obs.isStepAfterUpload)\"\n >\n {{ (obs.isStepAfterUpload ? 'interface.skip' : 'interface.cancel') | translate }}\n </button>\n\n <div class=\"valtimo-definition-uploader__actions\">\n <button\n *ngIf=\"obs.backButtonEnabled\"\n cdsButton=\"secondary\"\n (click)=\"onBackClick(obs.activeStep)\"\n >\n {{ 'interface.back' | translate }}\n </button>\n\n <button\n *ngIf=\"\n obs.uploadStatus !== UPLOAD_STATUS.ERROR && obs.activeStep !== UPLOAD_STEP.FILE_UPLOAD\n \"\n cdsButton=\"primary\"\n [disabled]=\"obs.nextButtonDisabled\"\n (click)=\"onNextClick(obs.activeStep)\"\n >\n {{\n (obs.activeStep === UPLOAD_STEP.FILE_SELECT\n ? 'buildingBlockManagement.importDefinition.startUpload'\n : 'interface.next'\n ) | translate\n }}\n </button>\n\n <button\n *ngIf=\"\n obs.uploadStatus === UPLOAD_STATUS.ERROR || obs.activeStep === UPLOAD_STEP.FILE_UPLOAD\n \"\n class=\"valtimo-definition-uploader__cancel\"\n cdsButton=\"primary\"\n (click)=\"onCloseModal(true)\"\n >\n {{ 'interface.finish' | translate }}\n </button>\n </div>\n </cds-modal-footer>\n</cds-modal>\n", styles: [".valtimo-definition-uploader__content,.valtimo-definition-uploader__content form{display:flex;flex-direction:column;gap:16px}.valtimo-definition-uploader__footer ::ng-deep .cds--modal-footer{justify-content:unset!important;display:grid!important;grid-template-columns:1fr 1fr 2fr!important;grid-template-areas:\"cancel . actions\"!important}.valtimo-definition-uploader__footer--double ::ng-deep .cds--modal-footer{grid-template-columns:1fr 1fr!important;grid-template-areas:\"cancel actions\"!important}.valtimo-definition-uploader__progress-bar{height:100%;display:flex;flex-direction:column;justify-content:center}.valtimo-definition-uploader__error{display:flex;align-items:center;gap:10px;color:#da1e28;fill:#da1e28;font-size:12px}.valtimo-definition-uploader__cancel{grid-area:cancel;width:100%}.valtimo-definition-uploader__actions{grid-area:actions;display:flex}.valtimo-definition-uploader__actions button{flex:unset;width:100%}.valtimo-definition-uploader__file-uploader ::ng-deep cds-file{max-width:unset}.valtimo-definition-uploader__checkbox{display:flex;flex-direction:column;gap:8px}.valtimo-definition-uploader__checkbox--invalid ::ng-deep label:before{border-color:#da1e28;margin-inline:0}.valtimo-definition-uploader ::ng-deep .cds--modal-container{height:550px}.valtimo-definition-uploader ::ng-deep .cds--checkbox-label-text{color:#000}\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"] }]
738
+ }], ctorParameters: () => [{ type: BuildingBlockManagementApiService }, { type: BuildingBlockManagementService }, { type: i2$1.FormBuilder }, { type: i3$1.IconService }, { type: i2$2.TranslateService }] });
739
+
740
+ /*
741
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
742
+ *
743
+ * Licensed under EUPL, Version 1.2 (the "License");
744
+ * you may not use this file except in compliance with the License.
745
+ * You may obtain a copy of the License at
746
+ *
747
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
748
+ *
749
+ * Unless required by applicable law or agreed to in writing, software
750
+ * distributed under the License is distributed on an "AS IS" basis,
751
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
752
+ * See the License for the specific language governing permissions and
753
+ * limitations under the License.
754
+ */
755
+ class BuildingBlockManagementListComponent {
756
+ constructor(buildingBlockManagementApiService, buildingBlockManagementService, iconService, router) {
757
+ this.buildingBlockManagementApiService = buildingBlockManagementApiService;
758
+ this.buildingBlockManagementService = buildingBlockManagementService;
759
+ this.iconService = iconService;
760
+ this.router = router;
761
+ this.$loading = signal(true);
762
+ this.buildingBlockDefinitions$ = this.buildingBlockManagementService.reload$.pipe(switchMap(() => this.buildingBlockManagementApiService.getBuildingBlockDefinitions()), tap(res => {
763
+ this.buildingBlockManagementService.setUsedKeys(res.map(item => item.key));
764
+ this.$loading.set(false);
765
+ }));
766
+ this.FIELDS = [
767
+ { key: 'name', label: 'buildingBlockManagement.listColumns.name' },
768
+ { key: 'key', label: 'buildingBlockManagement.listColumns.key' },
769
+ {
770
+ key: 'versionTag',
771
+ label: 'buildingBlockManagement.listColumns.versionTag',
772
+ viewType: ViewType.TAGS,
773
+ },
774
+ ];
775
+ this.iconService.registerAll([Upload16]);
776
+ }
777
+ showCreateModal() {
778
+ this.buildingBlockManagementService.showCreateModal();
779
+ }
780
+ showUploadModal() {
781
+ this.buildingBlockManagementService.showUploadModal();
782
+ }
783
+ onRowClick(buildingBlockDefinition) {
784
+ this.router.navigate([
785
+ '/building-block-management',
786
+ 'building-block',
787
+ buildingBlockDefinition.key,
788
+ 'version',
789
+ buildingBlockDefinition.versionTag,
790
+ BUILDING_BLOCK_MANAGEMENT_TABS.GENERAL,
791
+ ]);
792
+ }
793
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: BuildingBlockManagementListComponent, deps: [{ token: BuildingBlockManagementApiService }, { token: BuildingBlockManagementService }, { token: i3$1.IconService }, { token: i3.Router }], target: i0.ɵɵFactoryTarget.Component }); }
794
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.20", type: BuildingBlockManagementListComponent, isStandalone: true, selector: "valtimo-building-block-management-list", providers: [BuildingBlockManagementService], 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 *ngIf=\"{buildingBlockDefinitions: buildingBlockDefinitions$ | async} as obs\">\n <valtimo-carbon-list\n [fields]=\"FIELDS\"\n [items]=\"obs.buildingBlockDefinitions\"\n [loading]=\"$loading()\"\n (rowClicked)=\"onRowClick($event)\"\n >\n <ng-container\n carbonToolbarContent\n [ngTemplateOutlet]=\"buildingBlockDefinitionActions\"\n ></ng-container>\n\n <valtimo-no-results\n [action]=\"buildingBlockDefinitionActions\"\n [description]=\"'buildingBlockManagement.noResults.description' | translate\"\n [title]=\"'buildingBlockManagement.noResults.title' | translate\"\n ></valtimo-no-results>\n </valtimo-carbon-list>\n</ng-container>\n\n<ng-template #buildingBlockDefinitionActions>\n <div class=\"valtimo-building-block-management-list__actions\">\n <button cdsButton=\"ghost\" (click)=\"showUploadModal()\">\n {{ 'Upload' | translate }}\n\n <svg cdsIcon=\"upload\" size=\"16\" class=\"cds--btn__icon\"></svg>\n </button>\n\n <button cdsButton=\"primary\" (click)=\"showCreateModal()\">\n {{ 'interface.create' | translate }}\n\n <svg cdsIcon=\"add\" size=\"16\" class=\"cds--btn__icon\"></svg>\n </button>\n </div>\n</ng-template>\n\n<valtimo-building-block-management-create-modal></valtimo-building-block-management-create-modal>\n\n<valtimo-building-block-management-upload-modal></valtimo-building-block-management-upload-modal>\n", styles: [".valtimo-building-block-management-list__actions{display:flex}\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: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i4.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }, { kind: "ngmodule", type: CarbonListModule }, { kind: "component", type: i7.CarbonListComponent, selector: "valtimo-carbon-list", inputs: ["items", "fields", "tableTranslations", "paginatorConfig", "pagination", "loading", "skeletonRowCount", "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: i7.CarbonNoResultsComponent, selector: "valtimo-no-results", inputs: ["action", "description", "illustration", "title", "smallPadding", "collapseVertically", "alwaysRenderVertically"] }, { kind: "ngmodule", type: ButtonModule }, { kind: "directive", type: i3$1.Button, selector: "[cdsButton], [ibmButton]", inputs: ["ibmButton", "cdsButton", "size", "skeleton", "iconOnly", "isExpressive"] }, { kind: "ngmodule", type: IconModule }, { kind: "directive", type: i3$1.IconDirective, selector: "[cdsIcon], [ibmIcon]", inputs: ["ibmIcon", "cdsIcon", "size", "title", "ariaLabel", "ariaLabelledBy", "ariaHidden", "isFocusable"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }, { kind: "component", type: BuildingBlockManagementCreateModalComponent, selector: "valtimo-building-block-management-create-modal" }, { kind: "component", type: BuildingBlockManagementUploadModalComponent, selector: "valtimo-building-block-management-upload-modal" }] }); }
795
+ }
796
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: BuildingBlockManagementListComponent, decorators: [{
797
+ type: Component,
798
+ args: [{ standalone: true, selector: 'valtimo-building-block-management-list', imports: [
799
+ CommonModule,
800
+ CarbonListModule,
801
+ ButtonModule,
802
+ IconModule,
803
+ TranslatePipe,
804
+ BuildingBlockManagementCreateModalComponent,
805
+ BuildingBlockManagementUploadModalComponent,
806
+ ], providers: [BuildingBlockManagementService], 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 *ngIf=\"{buildingBlockDefinitions: buildingBlockDefinitions$ | async} as obs\">\n <valtimo-carbon-list\n [fields]=\"FIELDS\"\n [items]=\"obs.buildingBlockDefinitions\"\n [loading]=\"$loading()\"\n (rowClicked)=\"onRowClick($event)\"\n >\n <ng-container\n carbonToolbarContent\n [ngTemplateOutlet]=\"buildingBlockDefinitionActions\"\n ></ng-container>\n\n <valtimo-no-results\n [action]=\"buildingBlockDefinitionActions\"\n [description]=\"'buildingBlockManagement.noResults.description' | translate\"\n [title]=\"'buildingBlockManagement.noResults.title' | translate\"\n ></valtimo-no-results>\n </valtimo-carbon-list>\n</ng-container>\n\n<ng-template #buildingBlockDefinitionActions>\n <div class=\"valtimo-building-block-management-list__actions\">\n <button cdsButton=\"ghost\" (click)=\"showUploadModal()\">\n {{ 'Upload' | translate }}\n\n <svg cdsIcon=\"upload\" size=\"16\" class=\"cds--btn__icon\"></svg>\n </button>\n\n <button cdsButton=\"primary\" (click)=\"showCreateModal()\">\n {{ 'interface.create' | translate }}\n\n <svg cdsIcon=\"add\" size=\"16\" class=\"cds--btn__icon\"></svg>\n </button>\n </div>\n</ng-template>\n\n<valtimo-building-block-management-create-modal></valtimo-building-block-management-create-modal>\n\n<valtimo-building-block-management-upload-modal></valtimo-building-block-management-upload-modal>\n", styles: [".valtimo-building-block-management-list__actions{display:flex}\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"] }]
807
+ }], ctorParameters: () => [{ type: BuildingBlockManagementApiService }, { type: BuildingBlockManagementService }, { type: i3$1.IconService }, { type: i3.Router }] });
808
+
809
+ /*
810
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
811
+ *
812
+ * Licensed under EUPL, Version 1.2 (the "License");
813
+ * you may not use this file except in compliance with the License.
814
+ * You may obtain a copy of the License at
815
+ *
816
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
817
+ *
818
+ * Unless required by applicable law or agreed to in writing, software
819
+ * distributed under the License is distributed on an "AS IS" basis,
820
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
821
+ * See the License for the specific language governing permissions and
822
+ * limitations under the License.
823
+ */
824
+ class BuildingBlockManagementMetadataComponent {
825
+ get name() {
826
+ return this.formGroup.get('name');
827
+ }
828
+ get key() {
829
+ return this.formGroup.get('key');
830
+ }
831
+ get description() {
832
+ return this.formGroup.get('description');
833
+ }
834
+ constructor(buildingBlockManagementDetailService, buildingBlockManagementApiService, fb) {
835
+ this.buildingBlockManagementDetailService = buildingBlockManagementDetailService;
836
+ this.buildingBlockManagementApiService = buildingBlockManagementApiService;
837
+ this.fb = fb;
838
+ this.formGroup = this.fb.group({
839
+ name: this.fb.control('', Validators.required),
840
+ key: this.fb.control('', Validators.required),
841
+ description: this.fb.control(''),
842
+ });
843
+ this._subscriptions = new Subscription();
844
+ }
845
+ ngOnInit() {
846
+ this.openBuildingBlockDefinitionSubscription();
847
+ this.openLoadingAndFinalSubscription();
848
+ }
849
+ ngOnDestroy() {
850
+ this._subscriptions.unsubscribe();
851
+ }
852
+ onSave() {
853
+ this.formGroup.disable();
854
+ this.buildingBlockManagementApiService
855
+ .updateBuildingBlockDefinition(this.buildingBlockManagementDetailService.buildingBlockDefinitionKey, this.buildingBlockManagementDetailService.buildingBlockDefinitionVersionTag, this.formGroup.value)
856
+ .subscribe(() => {
857
+ this.buildingBlockManagementDetailService.reload();
858
+ });
859
+ }
860
+ openBuildingBlockDefinitionSubscription() {
861
+ this._subscriptions.add(this.buildingBlockManagementDetailService.buildingBlockDefinition$.subscribe(buildingBlockDefinition => {
862
+ this.formGroup.setValue({
863
+ name: buildingBlockDefinition.name,
864
+ key: buildingBlockDefinition.key,
865
+ description: buildingBlockDefinition.description,
866
+ });
867
+ }));
868
+ }
869
+ openLoadingAndFinalSubscription() {
870
+ this._subscriptions.add(combineLatest([
871
+ this.buildingBlockManagementDetailService.loadingDefinition$,
872
+ this.buildingBlockManagementDetailService.isFinal$,
873
+ ]).subscribe(([loadingDefinition, isFinal]) => {
874
+ if (loadingDefinition) {
875
+ this.formGroup.disable();
876
+ }
877
+ else if (!isFinal) {
878
+ this.name.enable();
879
+ this.description.enable();
880
+ this.formGroup.markAsPristine();
881
+ }
882
+ }));
883
+ }
884
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: BuildingBlockManagementMetadataComponent, deps: [{ token: BuildingBlockManagementDetailService }, { token: BuildingBlockManagementApiService }, { token: i2$1.FormBuilder }], target: i0.ɵɵFactoryTarget.Component }); }
885
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.20", type: BuildingBlockManagementMetadataComponent, isStandalone: true, selector: "valtimo-building-block-management-metadata", 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<form class=\"building-block-management-metadata\" [formGroup]=\"formGroup\" [cdsLayer]=\"1\">\n <h4 class=\"building-block-management-metadata__title\">\n {{ 'buildingBlockManagement.metadata.title' | translate }}\n </h4>\n\n <div class=\"cds--text-input__field-wrapper\">\n <cds-label [disabled]=\"formGroup.disabled\" [invalid]=\"name.touched && name.invalid\">\n <span class=\"label-with-tooltip select-label\">\n {{ 'buildingBlockManagement.createDefinition.name' | translate }}\n\n <v-tooltip-icon\n [tooltip]=\"'buildingBlockManagement.createDefinition.nameTooltip' | translate\"\n [disabled]=\"formGroup.disabled\"\n ></v-tooltip-icon>\n </span>\n\n <input\n formControlName=\"name\"\n cdsText\n placeholder=\"{{ 'buildingBlockManagement.createDefinition.namePlaceholder' | translate }}\"\n />\n </cds-label>\n </div>\n\n <div class=\"cds--text-input__field-wrapper\">\n <cds-label [disabled]=\"formGroup.disabled\">\n <span class=\"label-with-tooltip select-label\">\n {{ 'buildingBlockManagement.createDefinition.keyTitle' | translate }}\n </span>\n\n <input formControlName=\"key\" cdsText valtimoReadOnly [isReadOnly]=\"true\" />\n </cds-label>\n </div>\n\n <div class=\"cds--text-input__field-wrapper\">\n <cds-label\n [disabled]=\"formGroup.disabled\"\n [invalid]=\"description.touched && description.invalid\"\n >\n <span class=\"label-with-tooltip select-label\">\n {{ 'buildingBlockManagement.createDefinition.description' | translate }}\n\n <v-tooltip-icon\n [tooltip]=\"'buildingBlockManagement.createDefinition.descriptionTooltip' | translate\"\n [disabled]=\"formGroup.disabled\"\n ></v-tooltip-icon>\n </span>\n\n <textarea\n cdsTextArea\n formControlName=\"description\"\n placeholder=\"{{\n 'buildingBlockManagement.createDefinition.descriptionPlaceholder' | translate\n }}\"\n [rows]=\"3\"\n [cols]=\"150\"\n ></textarea>\n </cds-label>\n </div>\n\n <div class=\"building-block-management-metadata__buttons\">\n <button\n cdsButton=\"primary\"\n [disabled]=\"formGroup.disabled || formGroup.invalid || formGroup.pristine\"\n (click)=\"onSave()\"\n >\n {{ 'interface.save' | translate }}\n </button>\n </div>\n</form>\n", styles: [".building-block-management-metadata{display:flex;flex-direction:column;gap:16px;padding:16px;background-color:var(--cds-layer-01);max-width:625px}.building-block-management-metadata__title{font-size:16px;line-height:24px;font-weight:600}.building-block-management-metadata__buttons{display:flex;justify-content:flex-end;width:100%}.cds--text-input__field-wrapper cds-label{width:100%}.cds--text-input__field-wrapper ::ng-deep .cds--label{width:100%}.cds--text-input__field-wrapper:not(:last-child){margin-bottom:16px}.label-with-tooltip{display:flex;align-items:center}.select-label{padding-bottom:8px}\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: "pipe", type: TranslatePipe, name: "translate" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: InputModule }, { kind: "component", type: i3$1.Label, selector: "cds-label, ibm-label", inputs: ["labelInputID", "disabled", "skeleton", "helperText", "invalidText", "invalid", "warn", "warnText", "ariaLabel"] }, { kind: "directive", type: i3$1.TextInput, selector: "[cdsText], [ibmText]", inputs: ["theme", "size", "invalid", "warn", "skeleton"] }, { kind: "directive", type: i3$1.TextArea, selector: "[cdsTextArea], [ibmTextArea]", inputs: ["theme", "invalid", "skeleton"] }, { kind: "ngmodule", type: TooltipIconModule }, { kind: "component", type: i7.TooltipIconComponent, selector: "v-tooltip-icon", inputs: ["tooltip", "disabled"] }, { kind: "ngmodule", type: LayerModule }, { kind: "directive", type: i3$1.LayerDirective, selector: "[cdsLayer], [ibmLayer]", inputs: ["ibmLayer", "cdsLayer"], exportAs: ["layer"] }, { kind: "directive", type: ReadOnlyDirective, selector: "[valtimoReadOnly]", inputs: ["isReadOnly"] }, { kind: "ngmodule", type: ButtonModule }, { kind: "directive", type: i3$1.Button, selector: "[cdsButton], [ibmButton]", inputs: ["ibmButton", "cdsButton", "size", "skeleton", "iconOnly", "isExpressive"] }] }); }
886
+ }
887
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: BuildingBlockManagementMetadataComponent, decorators: [{
888
+ type: Component,
889
+ args: [{ standalone: true, selector: 'valtimo-building-block-management-metadata', imports: [
890
+ CommonModule,
891
+ TranslatePipe,
892
+ ReactiveFormsModule,
893
+ InputModule,
894
+ TooltipIconModule,
895
+ LayerModule,
896
+ ReadOnlyDirective,
897
+ ButtonModule,
898
+ ], 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<form class=\"building-block-management-metadata\" [formGroup]=\"formGroup\" [cdsLayer]=\"1\">\n <h4 class=\"building-block-management-metadata__title\">\n {{ 'buildingBlockManagement.metadata.title' | translate }}\n </h4>\n\n <div class=\"cds--text-input__field-wrapper\">\n <cds-label [disabled]=\"formGroup.disabled\" [invalid]=\"name.touched && name.invalid\">\n <span class=\"label-with-tooltip select-label\">\n {{ 'buildingBlockManagement.createDefinition.name' | translate }}\n\n <v-tooltip-icon\n [tooltip]=\"'buildingBlockManagement.createDefinition.nameTooltip' | translate\"\n [disabled]=\"formGroup.disabled\"\n ></v-tooltip-icon>\n </span>\n\n <input\n formControlName=\"name\"\n cdsText\n placeholder=\"{{ 'buildingBlockManagement.createDefinition.namePlaceholder' | translate }}\"\n />\n </cds-label>\n </div>\n\n <div class=\"cds--text-input__field-wrapper\">\n <cds-label [disabled]=\"formGroup.disabled\">\n <span class=\"label-with-tooltip select-label\">\n {{ 'buildingBlockManagement.createDefinition.keyTitle' | translate }}\n </span>\n\n <input formControlName=\"key\" cdsText valtimoReadOnly [isReadOnly]=\"true\" />\n </cds-label>\n </div>\n\n <div class=\"cds--text-input__field-wrapper\">\n <cds-label\n [disabled]=\"formGroup.disabled\"\n [invalid]=\"description.touched && description.invalid\"\n >\n <span class=\"label-with-tooltip select-label\">\n {{ 'buildingBlockManagement.createDefinition.description' | translate }}\n\n <v-tooltip-icon\n [tooltip]=\"'buildingBlockManagement.createDefinition.descriptionTooltip' | translate\"\n [disabled]=\"formGroup.disabled\"\n ></v-tooltip-icon>\n </span>\n\n <textarea\n cdsTextArea\n formControlName=\"description\"\n placeholder=\"{{\n 'buildingBlockManagement.createDefinition.descriptionPlaceholder' | translate\n }}\"\n [rows]=\"3\"\n [cols]=\"150\"\n ></textarea>\n </cds-label>\n </div>\n\n <div class=\"building-block-management-metadata__buttons\">\n <button\n cdsButton=\"primary\"\n [disabled]=\"formGroup.disabled || formGroup.invalid || formGroup.pristine\"\n (click)=\"onSave()\"\n >\n {{ 'interface.save' | translate }}\n </button>\n </div>\n</form>\n", styles: [".building-block-management-metadata{display:flex;flex-direction:column;gap:16px;padding:16px;background-color:var(--cds-layer-01);max-width:625px}.building-block-management-metadata__title{font-size:16px;line-height:24px;font-weight:600}.building-block-management-metadata__buttons{display:flex;justify-content:flex-end;width:100%}.cds--text-input__field-wrapper cds-label{width:100%}.cds--text-input__field-wrapper ::ng-deep .cds--label{width:100%}.cds--text-input__field-wrapper:not(:last-child){margin-bottom:16px}.label-with-tooltip{display:flex;align-items:center}.select-label{padding-bottom:8px}\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"] }]
899
+ }], ctorParameters: () => [{ type: BuildingBlockManagementDetailService }, { type: BuildingBlockManagementApiService }, { type: i2$1.FormBuilder }] });
900
+
901
+ /*
902
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
903
+ *
904
+ * Licensed under EUPL, Version 1.2 (the "License");
905
+ * you may not use this file except in compliance with the License.
906
+ * You may obtain a copy of the License at
907
+ *
908
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
909
+ *
910
+ * Unless required by applicable law or agreed to in writing, software
911
+ * distributed under the License is distributed on an "AS IS" basis,
912
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
913
+ * See the License for the specific language governing permissions and
914
+ * limitations under the License.
915
+ */
916
+ class BuildingBlockManagementArtworkComponent {
917
+ get file() {
918
+ return this.formGroup.get('file');
919
+ }
920
+ constructor(buildingBlockManagementDetailService, buildingBlockManagementApiService, formBuilder, iconService) {
921
+ this.buildingBlockManagementDetailService = buildingBlockManagementDetailService;
922
+ this.buildingBlockManagementApiService = buildingBlockManagementApiService;
923
+ this.formBuilder = formBuilder;
924
+ this.iconService = iconService;
925
+ this.ACCEPTED_FILES = ['png'];
926
+ this.formGroup = this.formBuilder.group({
927
+ file: this.formBuilder.control(new Set(), [Validators.required]),
928
+ });
929
+ this.loadingArtwork$ = new BehaviorSubject(true);
930
+ this._refresh$ = new BehaviorSubject(null);
931
+ this.artwork$ = this._refresh$.pipe(switchMap(() => this.buildingBlockManagementApiService.getBuildingBlockArtwork(this.buildingBlockManagementDetailService.buildingBlockDefinitionKey, this.buildingBlockManagementDetailService.buildingBlockDefinitionVersionTag)), tap(() => this.loadingArtwork$.next(false)));
932
+ this.showDeleteConfirmationModal$ = new BehaviorSubject(false);
933
+ this._subscriptions = new Subscription();
934
+ this.iconService.registerAll([Upload16, TrashCan16]);
935
+ }
936
+ ngOnInit() {
937
+ this._subscriptions.add(this.buildingBlockManagementDetailService.isFinal$.subscribe(isFinal => {
938
+ if (isFinal) {
939
+ this.formGroup.disable();
940
+ }
941
+ else {
942
+ this.formGroup.enable();
943
+ }
944
+ }));
945
+ }
946
+ ngOnDestroy() {
947
+ this._subscriptions.unsubscribe();
948
+ }
949
+ async onSave() {
950
+ const file = Array.from(this.file.value)[0]?.file;
951
+ const imageBase64 = await this.fileToBase64(file);
952
+ this.formGroup.disable();
953
+ this.buildingBlockManagementApiService
954
+ .createBuildingBlockArtwork(this.buildingBlockManagementDetailService.buildingBlockDefinitionKey, this.buildingBlockManagementDetailService.buildingBlockDefinitionVersionTag, {
955
+ imageBase64,
956
+ })
957
+ .subscribe({
958
+ next: () => {
959
+ this._refresh$.next(null);
960
+ this.formGroup.enable();
961
+ },
962
+ error: () => {
963
+ this.formGroup.enable();
964
+ },
965
+ });
966
+ }
967
+ onDeleteButtonClick() {
968
+ this.showDeleteConfirmationModal$.next(true);
969
+ }
970
+ onDelete() {
971
+ this.buildingBlockManagementApiService
972
+ .deleteBuildingBlockArtwork(this.buildingBlockManagementDetailService.buildingBlockDefinitionKey, this.buildingBlockManagementDetailService.buildingBlockDefinitionVersionTag)
973
+ .subscribe(() => {
974
+ this._refresh$.next(null);
975
+ });
976
+ }
977
+ async fileToBase64(file) {
978
+ return new Promise((resolve, reject) => {
979
+ const reader = new FileReader();
980
+ reader.readAsDataURL(file);
981
+ reader.onload = () => {
982
+ const result = reader.result;
983
+ const pureBase64 = result.split(',')[1];
984
+ resolve(pureBase64);
985
+ };
986
+ reader.onerror = error => reject(error);
987
+ });
988
+ }
989
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: BuildingBlockManagementArtworkComponent, deps: [{ token: BuildingBlockManagementDetailService }, { token: BuildingBlockManagementApiService }, { token: i2$1.FormBuilder }, { token: i3$1.IconService }], target: i0.ɵɵFactoryTarget.Component }); }
990
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.20", type: BuildingBlockManagementArtworkComponent, isStandalone: true, selector: "valtimo-building-block-management-artwork", 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<form\n *ngIf=\"{\n artwork: artwork$ | async,\n loadingArtwork: loadingArtwork$ | async,\n } as obs\"\n class=\"building-block-management-artwork\"\n [formGroup]=\"formGroup\"\n [cdsLayer]=\"1\"\n>\n <h4 class=\"building-block-management-artwork__title\">\n {{ 'buildingBlockManagement.artwork.title' | translate }}\n </h4>\n\n @if (obs.loadingArtwork) {\n <div class=\"loading-container\"><cds-loading></cds-loading></div>\n }\n\n @if (!obs.loadingArtwork && obs.artwork) {\n <div class=\"building-block-management-artwork__preview\">\n <img\n class=\"building-block-management-artwork__image\"\n [src]=\"'data:image/png;base64,' + obs.artwork.imageBase64\"\n />\n </div>\n\n <div class=\"building-block-management-artwork__buttons\">\n <button cdsButton=\"danger\" (click)=\"onDeleteButtonClick()\" [disabled]=\"formGroup.disabled\">\n {{ 'interface.delete' | translate }}\n\n <svg class=\"cds--btn__icon\" cdsIcon=\"trash-can\" size=\"16\"></svg>\n </button>\n </div>\n }\n\n @if (!obs.loadingArtwork && !obs.artwork) {\n <cds-file-uploader\n *ngIf=\"!obs.loadingArtwork && !obs.artwork\"\n [accept]=\"ACCEPTED_FILES\"\n [multiple]=\"false\"\n buttonType=\"primary\"\n [title]=\"'buildingBlockManagement.artwork.fileUploaderTitle' | translate\"\n [description]=\"'buildingBlockManagement.artwork.fileUploaderDescription' | translate\"\n [buttonText]=\"'buildingBlockManagement.artwork.fileUploaderButton' | translate\"\n formControlName=\"file\"\n >\n </cds-file-uploader>\n\n <div class=\"building-block-management-artwork__buttons\">\n <button\n cdsButton=\"primary\"\n [disabled]=\"formGroup.disabled || formGroup.invalid || formGroup.pristine\"\n (click)=\"onSave()\"\n >\n {{ 'interface.upload' | translate }}\n\n <svg class=\"cds--btn__icon\" cdsIcon=\"upload\" size=\"16\"></svg>\n </button>\n </div>\n }\n</form>\n\n<valtimo-render-in-body>\n <valtimo-confirmation-modal\n confirmButtonTextTranslationKey=\"interface.delete\"\n confirmButtonType=\"danger\"\n contentTranslationKey=\"buildingBlockManagement.artwork.deleteConfirmationModalText\"\n [showModalSubject$]=\"showDeleteConfirmationModal$\"\n titleTranslationKey=\"interface.delete\"\n (confirmEvent)=\"onDelete()\"\n ></valtimo-confirmation-modal>\n</valtimo-render-in-body>\n", styles: [".building-block-management-artwork{display:flex;flex-direction:column;gap:16px;padding:16px;background-color:var(--cds-layer-01);max-width:625px}.building-block-management-artwork__title{font-size:16px;line-height:24px;font-weight:600;margin-bottom:8px}.building-block-management-artwork__preview{display:flex;justify-content:center;align-items:center;background-color:var(--cds-layer-02);padding:12px;min-height:180px}.building-block-management-artwork__image{max-width:100%;max-height:300px;object-fit:contain}.building-block-management-artwork__buttons{display:flex;justify-content:flex-end;width:100%;margin-top:12px}.building-block-management-artwork__buttons button[cdsButton]{min-width:100px}.label-with-tooltip{display:flex;align-items:center}.loading-container{display:flex;width:100%;justify-content:center;align-items:center;min-height:180px}\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: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }, { kind: "pipe", type: TranslatePipe, name: "translate" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: InputModule }, { kind: "ngmodule", type: TooltipIconModule }, { kind: "ngmodule", type: LayerModule }, { kind: "directive", type: i3$1.LayerDirective, selector: "[cdsLayer], [ibmLayer]", inputs: ["ibmLayer", "cdsLayer"], exportAs: ["layer"] }, { kind: "ngmodule", type: ButtonModule }, { kind: "directive", type: i3$1.Button, selector: "[cdsButton], [ibmButton]", inputs: ["ibmButton", "cdsButton", "size", "skeleton", "iconOnly", "isExpressive"] }, { kind: "ngmodule", type: FileUploaderModule }, { kind: "component", type: i3$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: LoadingModule }, { kind: "component", type: i3$1.Loading, selector: "cds-loading, ibm-loading", inputs: ["title", "isActive", "size", "overlay"] }, { kind: "ngmodule", type: IconModule }, { kind: "directive", type: i3$1.IconDirective, selector: "[cdsIcon], [ibmIcon]", inputs: ["ibmIcon", "cdsIcon", "size", "title", "ariaLabel", "ariaLabelledBy", "ariaHidden", "isFocusable"] }, { kind: "ngmodule", type: ConfirmationModalModule }, { kind: "component", type: i7.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: RenderInBodyComponent, selector: "valtimo-render-in-body" }] }); }
991
+ }
992
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: BuildingBlockManagementArtworkComponent, decorators: [{
993
+ type: Component,
994
+ args: [{ standalone: true, selector: 'valtimo-building-block-management-artwork', imports: [
995
+ CommonModule,
996
+ TranslatePipe,
997
+ ReactiveFormsModule,
998
+ InputModule,
999
+ TooltipIconModule,
1000
+ LayerModule,
1001
+ ButtonModule,
1002
+ FileUploaderModule,
1003
+ LoadingModule,
1004
+ IconModule,
1005
+ ConfirmationModalModule,
1006
+ RenderInBodyComponent,
1007
+ ], 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<form\n *ngIf=\"{\n artwork: artwork$ | async,\n loadingArtwork: loadingArtwork$ | async,\n } as obs\"\n class=\"building-block-management-artwork\"\n [formGroup]=\"formGroup\"\n [cdsLayer]=\"1\"\n>\n <h4 class=\"building-block-management-artwork__title\">\n {{ 'buildingBlockManagement.artwork.title' | translate }}\n </h4>\n\n @if (obs.loadingArtwork) {\n <div class=\"loading-container\"><cds-loading></cds-loading></div>\n }\n\n @if (!obs.loadingArtwork && obs.artwork) {\n <div class=\"building-block-management-artwork__preview\">\n <img\n class=\"building-block-management-artwork__image\"\n [src]=\"'data:image/png;base64,' + obs.artwork.imageBase64\"\n />\n </div>\n\n <div class=\"building-block-management-artwork__buttons\">\n <button cdsButton=\"danger\" (click)=\"onDeleteButtonClick()\" [disabled]=\"formGroup.disabled\">\n {{ 'interface.delete' | translate }}\n\n <svg class=\"cds--btn__icon\" cdsIcon=\"trash-can\" size=\"16\"></svg>\n </button>\n </div>\n }\n\n @if (!obs.loadingArtwork && !obs.artwork) {\n <cds-file-uploader\n *ngIf=\"!obs.loadingArtwork && !obs.artwork\"\n [accept]=\"ACCEPTED_FILES\"\n [multiple]=\"false\"\n buttonType=\"primary\"\n [title]=\"'buildingBlockManagement.artwork.fileUploaderTitle' | translate\"\n [description]=\"'buildingBlockManagement.artwork.fileUploaderDescription' | translate\"\n [buttonText]=\"'buildingBlockManagement.artwork.fileUploaderButton' | translate\"\n formControlName=\"file\"\n >\n </cds-file-uploader>\n\n <div class=\"building-block-management-artwork__buttons\">\n <button\n cdsButton=\"primary\"\n [disabled]=\"formGroup.disabled || formGroup.invalid || formGroup.pristine\"\n (click)=\"onSave()\"\n >\n {{ 'interface.upload' | translate }}\n\n <svg class=\"cds--btn__icon\" cdsIcon=\"upload\" size=\"16\"></svg>\n </button>\n </div>\n }\n</form>\n\n<valtimo-render-in-body>\n <valtimo-confirmation-modal\n confirmButtonTextTranslationKey=\"interface.delete\"\n confirmButtonType=\"danger\"\n contentTranslationKey=\"buildingBlockManagement.artwork.deleteConfirmationModalText\"\n [showModalSubject$]=\"showDeleteConfirmationModal$\"\n titleTranslationKey=\"interface.delete\"\n (confirmEvent)=\"onDelete()\"\n ></valtimo-confirmation-modal>\n</valtimo-render-in-body>\n", styles: [".building-block-management-artwork{display:flex;flex-direction:column;gap:16px;padding:16px;background-color:var(--cds-layer-01);max-width:625px}.building-block-management-artwork__title{font-size:16px;line-height:24px;font-weight:600;margin-bottom:8px}.building-block-management-artwork__preview{display:flex;justify-content:center;align-items:center;background-color:var(--cds-layer-02);padding:12px;min-height:180px}.building-block-management-artwork__image{max-width:100%;max-height:300px;object-fit:contain}.building-block-management-artwork__buttons{display:flex;justify-content:flex-end;width:100%;margin-top:12px}.building-block-management-artwork__buttons button[cdsButton]{min-width:100px}.label-with-tooltip{display:flex;align-items:center}.loading-container{display:flex;width:100%;justify-content:center;align-items:center;min-height:180px}\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"] }]
1008
+ }], ctorParameters: () => [{ type: BuildingBlockManagementDetailService }, { type: BuildingBlockManagementApiService }, { type: i2$1.FormBuilder }, { type: i3$1.IconService }] });
1009
+
1010
+ /*
1011
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
1012
+ *
1013
+ * Licensed under EUPL, Version 1.2 (the "License");
1014
+ * you may not use this file except in compliance with the License.
1015
+ * You may obtain a copy of the License at
1016
+ *
1017
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1018
+ *
1019
+ * Unless required by applicable law or agreed to in writing, software
1020
+ * distributed under the License is distributed on an "AS IS" basis,
1021
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1022
+ * See the License for the specific language governing permissions and
1023
+ * limitations under the License.
1024
+ */
1025
+ class BuildingBlockManagementPluginsComponent {
1026
+ constructor(buildingBlockManagementApiService, pluginManagementService, buildingBlockManagementDetailService) {
1027
+ this.buildingBlockManagementApiService = buildingBlockManagementApiService;
1028
+ this.pluginManagementService = pluginManagementService;
1029
+ this.buildingBlockManagementDetailService = buildingBlockManagementDetailService;
1030
+ this.loading$ = new BehaviorSubject(true);
1031
+ this.usedPluginTitles$ = combineLatest([
1032
+ this.pluginManagementService.getPluginDefinitions(),
1033
+ this.buildingBlockManagementApiService.getPluginDefinitionsForBuildingBlock(this.buildingBlockManagementDetailService.buildingBlockDefinitionKey, this.buildingBlockManagementDetailService.buildingBlockDefinitionVersionTag),
1034
+ ]).pipe(map(([pluginDefinitions, pluginsForBuildingBlock]) => {
1035
+ const plugins = pluginsForBuildingBlock?.plugins ?? [];
1036
+ const pluginKeys = plugins.map(plugin => plugin.pluginDefinitionKey).filter(Boolean);
1037
+ return pluginKeys.map(pluginDefinitionForBuildingBlock => pluginDefinitions.find(pluginDefinition => pluginDefinition.key === pluginDefinitionForBuildingBlock)?.title ?? pluginDefinitionForBuildingBlock);
1038
+ }), tap(() => this.loading$.next(false)));
1039
+ }
1040
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: BuildingBlockManagementPluginsComponent, deps: [{ token: BuildingBlockManagementApiService }, { token: i2$3.PluginManagementService }, { token: BuildingBlockManagementDetailService }], target: i0.ɵɵFactoryTarget.Component }); }
1041
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.20", type: BuildingBlockManagementPluginsComponent, isStandalone: true, selector: "valtimo-building-block-management-plugins", 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<div\n class=\"building-block-management-plugins\"\n *ngIf=\"{usedPluginTitles: usedPluginTitles$ | async, loading: loading$ | async} as obs\"\n>\n <h4 class=\"building-block-management-plugins__title\">\n {{ 'buildingBlockManagement.plugins.title' | translate }}\n </h4>\n\n @if (obs.loading) {\n <div class=\"loading-container\"><cds-loading size=\"sm\"></cds-loading></div>\n }\n\n @if (!obs.loading && obs.usedPluginTitles.length > 0) {\n <div class=\"building-block-management-plugins__tags\">\n @for (pluginTitle of obs.usedPluginTitles; track pluginTitle) {\n <cds-tag type=\"blue\">{{ pluginTitle }}</cds-tag>\n }\n </div>\n }\n\n @if (!obs.loading && obs.usedPluginTitles.length === 0) {\n <p class=\"building-block-management-plugins__description cds--label-description\">\n {{ 'buildingBlockManagement.plugins.noPluginsUsed' | translate }}\n </p>\n }\n</div>\n", styles: [".building-block-management-plugins{display:flex;padding:16px 24px;width:100%;background-color:var(--cds-layer-01);align-items:center;gap:16px}.building-block-management-plugins__title{font-size:16px;line-height:24px;font-weight:600;flex-shrink:0}.building-block-management-plugins__tags{display:flex;flex-flow:row wrap;height:100%;gap:8px}.building-block-management-plugins__description{padding:0;margin:0}.loading-container{display:flex;width:100%;justify-content:center}\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: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }, { kind: "ngmodule", type: LoadingModule }, { kind: "component", type: i3$1.Loading, selector: "cds-loading, ibm-loading", inputs: ["title", "isActive", "size", "overlay"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }, { kind: "ngmodule", type: TagModule }, { kind: "component", type: i3$1.Tag, selector: "cds-tag, ibm-tag", inputs: ["type", "size", "class", "skeleton"] }] }); }
1042
+ }
1043
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: BuildingBlockManagementPluginsComponent, decorators: [{
1044
+ type: Component,
1045
+ args: [{ standalone: true, selector: 'valtimo-building-block-management-plugins', imports: [CommonModule, LoadingModule, TranslatePipe, TagModule], 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<div\n class=\"building-block-management-plugins\"\n *ngIf=\"{usedPluginTitles: usedPluginTitles$ | async, loading: loading$ | async} as obs\"\n>\n <h4 class=\"building-block-management-plugins__title\">\n {{ 'buildingBlockManagement.plugins.title' | translate }}\n </h4>\n\n @if (obs.loading) {\n <div class=\"loading-container\"><cds-loading size=\"sm\"></cds-loading></div>\n }\n\n @if (!obs.loading && obs.usedPluginTitles.length > 0) {\n <div class=\"building-block-management-plugins__tags\">\n @for (pluginTitle of obs.usedPluginTitles; track pluginTitle) {\n <cds-tag type=\"blue\">{{ pluginTitle }}</cds-tag>\n }\n </div>\n }\n\n @if (!obs.loading && obs.usedPluginTitles.length === 0) {\n <p class=\"building-block-management-plugins__description cds--label-description\">\n {{ 'buildingBlockManagement.plugins.noPluginsUsed' | translate }}\n </p>\n }\n</div>\n", styles: [".building-block-management-plugins{display:flex;padding:16px 24px;width:100%;background-color:var(--cds-layer-01);align-items:center;gap:16px}.building-block-management-plugins__title{font-size:16px;line-height:24px;font-weight:600;flex-shrink:0}.building-block-management-plugins__tags{display:flex;flex-flow:row wrap;height:100%;gap:8px}.building-block-management-plugins__description{padding:0;margin:0}.loading-container{display:flex;width:100%;justify-content:center}\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"] }]
1046
+ }], ctorParameters: () => [{ type: BuildingBlockManagementApiService }, { type: i2$3.PluginManagementService }, { type: BuildingBlockManagementDetailService }] });
1047
+
1048
+ /*
1049
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
1050
+ *
1051
+ * Licensed under EUPL, Version 1.2 (the "License");
1052
+ * you may not use this file except in compliance with the License.
1053
+ * You may obtain a copy of the License at
1054
+ *
1055
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1056
+ *
1057
+ * Unless required by applicable law or agreed to in writing, software
1058
+ * distributed under the License is distributed on an "AS IS" basis,
1059
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1060
+ * See the License for the specific language governing permissions and
1061
+ * limitations under the License.
1062
+ */
1063
+ class BuildingBlockManagementGeneralComponent {
1064
+ constructor(buildingBlockManagementDetailService) {
1065
+ this.buildingBlockManagementDetailService = buildingBlockManagementDetailService;
1066
+ }
1067
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: BuildingBlockManagementGeneralComponent, deps: [{ token: BuildingBlockManagementDetailService }], target: i0.ɵɵFactoryTarget.Component }); }
1068
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.20", type: BuildingBlockManagementGeneralComponent, isStandalone: true, selector: "valtimo-building-block-management-general", 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<div class=\"building-block-management-general\">\n <valtimo-building-block-management-plugins></valtimo-building-block-management-plugins>\n\n <div class=\"muuri-container\">\n <div muuri [columnMinWidth]=\"450\">\n <valtimo-muuri-item>\n <valtimo-building-block-management-metadata></valtimo-building-block-management-metadata>\n </valtimo-muuri-item>\n\n <valtimo-muuri-item>\n <valtimo-building-block-management-artwork></valtimo-building-block-management-artwork>\n </valtimo-muuri-item>\n </div>\n </div>\n</div>\n", styles: [".muuri-container{display:block;width:100%}.building-block-management-general{width:100%;display:flex;flex-direction:column;gap:16px}\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: "ngmodule", type: MuuriDirectiveModule }, { kind: "directive", type: i7.MuuriDirective, selector: "[muuri]", inputs: ["columnMinWidth"] }, { kind: "component", type: i7.MuuriItemComponent, selector: "valtimo-muuri-item" }, { kind: "component", type: BuildingBlockManagementMetadataComponent, selector: "valtimo-building-block-management-metadata" }, { kind: "component", type: BuildingBlockManagementArtworkComponent, selector: "valtimo-building-block-management-artwork" }, { kind: "component", type: BuildingBlockManagementPluginsComponent, selector: "valtimo-building-block-management-plugins" }] }); }
1069
+ }
1070
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: BuildingBlockManagementGeneralComponent, decorators: [{
1071
+ type: Component,
1072
+ args: [{ standalone: true, selector: 'valtimo-building-block-management-general', imports: [
1073
+ CommonModule,
1074
+ MuuriDirectiveModule,
1075
+ BuildingBlockManagementMetadataComponent,
1076
+ BuildingBlockManagementArtworkComponent,
1077
+ BuildingBlockManagementPluginsComponent,
1078
+ ], 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<div class=\"building-block-management-general\">\n <valtimo-building-block-management-plugins></valtimo-building-block-management-plugins>\n\n <div class=\"muuri-container\">\n <div muuri [columnMinWidth]=\"450\">\n <valtimo-muuri-item>\n <valtimo-building-block-management-metadata></valtimo-building-block-management-metadata>\n </valtimo-muuri-item>\n\n <valtimo-muuri-item>\n <valtimo-building-block-management-artwork></valtimo-building-block-management-artwork>\n </valtimo-muuri-item>\n </div>\n </div>\n</div>\n", styles: [".muuri-container{display:block;width:100%}.building-block-management-general{width:100%;display:flex;flex-direction:column;gap:16px}\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"] }]
1079
+ }], ctorParameters: () => [{ type: BuildingBlockManagementDetailService }] });
1080
+
1081
+ /*
1082
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
1083
+ *
1084
+ * Licensed under EUPL, Version 1.2 (the "License");
1085
+ * you may not use this file except in compliance with the License.
1086
+ * You may obtain a copy of the License at
1087
+ *
1088
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1089
+ *
1090
+ * Unless required by applicable law or agreed to in writing, software
1091
+ * distributed under the License is distributed on an "AS IS" basis,
1092
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1093
+ * See the License for the specific language governing permissions and
1094
+ * limitations under the License.
1095
+ */
1096
+ class BuildingBlockManagementDocumentComponent {
1097
+ constructor(buildingBlockManagementDetailService, buildingBlockManagementApiService, iconService) {
1098
+ this.buildingBlockManagementDetailService = buildingBlockManagementDetailService;
1099
+ this.buildingBlockManagementApiService = buildingBlockManagementApiService;
1100
+ this.iconService = iconService;
1101
+ this._subscriptions = new Subscription();
1102
+ this._loadingDocumentDefinition$ = new BehaviorSubject(true);
1103
+ this.loading$ = combineLatest([
1104
+ this.buildingBlockManagementDetailService.loadingDefinition$,
1105
+ this._loadingDocumentDefinition$,
1106
+ ]).pipe(map(([loadingDefinition, loadingDocumentDefinition]) => loadingDefinition || loadingDocumentDefinition));
1107
+ this._documentDefinition$ = new BehaviorSubject('');
1108
+ this.documentDefinition$ = this._documentDefinition$.pipe(filter(model => model !== null));
1109
+ this.isFinal$ = this.buildingBlockManagementDetailService.isFinal$;
1110
+ this._modifiedDefinition = null;
1111
+ this.iconService.registerAll([Download16]);
1112
+ }
1113
+ ngOnInit() {
1114
+ this.openBuildingBlockDefinitionSubscription();
1115
+ }
1116
+ ngOnDestroy() {
1117
+ this._subscriptions.unsubscribe();
1118
+ }
1119
+ downloadDefinition() {
1120
+ this.documentDefinition$.pipe(take$1(1)).subscribe(definition => {
1121
+ const dataString = 'data:text/json;charset=utf-8,' + encodeURIComponent(definition);
1122
+ const downloadAnchorElement = document.getElementById('downloadAnchorElement');
1123
+ if (!downloadAnchorElement)
1124
+ return;
1125
+ downloadAnchorElement.setAttribute('href', dataString);
1126
+ downloadAnchorElement.setAttribute('download', `${this.buildingBlockManagementDetailService.buildingBlockDefinitionKey}-v${this.buildingBlockManagementDetailService.buildingBlockDefinitionVersionTag}.json`);
1127
+ downloadAnchorElement.click();
1128
+ });
1129
+ }
1130
+ onSaveEvent() {
1131
+ if (!this._modifiedDefinition)
1132
+ return;
1133
+ this._loadingDocumentDefinition$.next(true);
1134
+ this.buildingBlockManagementApiService
1135
+ .updateBuildingBlockDocumentDefinition(this.buildingBlockManagementDetailService.buildingBlockDefinitionKey, this.buildingBlockManagementDetailService.buildingBlockDefinitionVersionTag, JSON.parse(this._modifiedDefinition))
1136
+ .subscribe(res => {
1137
+ this.setDocumentDefinitionModel(res);
1138
+ this._modifiedDefinition = null;
1139
+ this._loadingDocumentDefinition$.next(false);
1140
+ });
1141
+ }
1142
+ onChangeEvent(event) {
1143
+ this._modifiedDefinition = event;
1144
+ }
1145
+ openBuildingBlockDefinitionSubscription() {
1146
+ this._subscriptions.add(this.buildingBlockManagementDetailService.buildingBlockDefinition$
1147
+ .pipe(tap(() => this._loadingDocumentDefinition$.next(true)), switchMap(definition => this.buildingBlockManagementApiService.getBuildingBlockDocumentDefinition(definition.key, definition.versionTag)), tap(() => this._loadingDocumentDefinition$.next(false)))
1148
+ .subscribe(buildingBlockDocumentDefinition => this.setDocumentDefinitionModel(buildingBlockDocumentDefinition)));
1149
+ }
1150
+ setDocumentDefinitionModel(definition) {
1151
+ this._documentDefinition$.next(JSON.stringify(definition, null, 2));
1152
+ }
1153
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: BuildingBlockManagementDocumentComponent, deps: [{ token: BuildingBlockManagementDetailService }, { token: BuildingBlockManagementApiService }, { token: i3$1.IconService }], target: i0.ɵɵFactoryTarget.Component }); }
1154
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.20", type: BuildingBlockManagementDocumentComponent, isStandalone: true, selector: "valtimo-building-block-management-document", 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 loading: loading$ | async,\n documentDefinition: documentDefinition$ | async,\n isFinal: isFinal$ | async,\n } as obs\"\n>\n @if (!obs.loading) {\n <valtimo-schema-editor\n [fitPage]=\"true\"\n [spaceAdjustment]=\"64\"\n [disableOverflow]=\"true\"\n [schemaJson]=\"obs.documentDefinition\"\n [disabled]=\"obs.isFinal\"\n (changeEvent)=\"onChangeEvent($event)\"\n (saveEvent)=\"onSaveEvent()\"\n >\n <button\n cdsButton=\"ghost\"\n [disabled]=\"obs.loading || !obs.documentDefinition\"\n (click)=\"downloadDefinition()\"\n >\n {{ 'interface.download' | translate }}\n\n <svg cdsIcon=\"download\" size=\"16\" class=\"cds--btn__icon\"></svg>\n </button>\n </valtimo-schema-editor>\n } @else {\n <div class=\"loading-container\">\n <cds-loading></cds-loading>\n </div>\n }\n</ng-container>\n\n<a id=\"downloadAnchorElement\" style=\"display: none\"></a>\n", styles: [".loading-container{display:flex;width:100%;justify-content:center}\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: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }, { kind: "ngmodule", type: ButtonModule }, { kind: "directive", type: i3$1.Button, selector: "[cdsButton], [ibmButton]", inputs: ["ibmButton", "cdsButton", "size", "skeleton", "iconOnly", "isExpressive"] }, { kind: "ngmodule", type: IconModule }, { kind: "directive", type: i3$1.IconDirective, selector: "[cdsIcon], [ibmIcon]", inputs: ["ibmIcon", "cdsIcon", "size", "title", "ariaLabel", "ariaLabelledBy", "ariaHidden", "isFocusable"] }, { kind: "ngmodule", type: LoadingModule }, { kind: "component", type: i3$1.Loading, selector: "cds-loading, ibm-loading", inputs: ["title", "isActive", "size", "overlay"] }, { kind: "component", type: SchemaEditorComponent, selector: "valtimo-schema-editor", inputs: ["schemaJson", "disabled"], outputs: ["changeEvent", "saveEvent", "validEvent"] }, { kind: "directive", type: FitPageDirective, selector: "[fitPage]", inputs: ["spaceAdjustment", "fitPageDisabled", "disableOverflow"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }] }); }
1155
+ }
1156
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: BuildingBlockManagementDocumentComponent, decorators: [{
1157
+ type: Component,
1158
+ args: [{ standalone: true, selector: 'valtimo-building-block-management-document', imports: [
1159
+ CommonModule,
1160
+ ButtonModule,
1161
+ IconModule,
1162
+ LoadingModule,
1163
+ SchemaEditorComponent,
1164
+ FitPageDirective,
1165
+ TranslatePipe,
1166
+ ], 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 loading: loading$ | async,\n documentDefinition: documentDefinition$ | async,\n isFinal: isFinal$ | async,\n } as obs\"\n>\n @if (!obs.loading) {\n <valtimo-schema-editor\n [fitPage]=\"true\"\n [spaceAdjustment]=\"64\"\n [disableOverflow]=\"true\"\n [schemaJson]=\"obs.documentDefinition\"\n [disabled]=\"obs.isFinal\"\n (changeEvent)=\"onChangeEvent($event)\"\n (saveEvent)=\"onSaveEvent()\"\n >\n <button\n cdsButton=\"ghost\"\n [disabled]=\"obs.loading || !obs.documentDefinition\"\n (click)=\"downloadDefinition()\"\n >\n {{ 'interface.download' | translate }}\n\n <svg cdsIcon=\"download\" size=\"16\" class=\"cds--btn__icon\"></svg>\n </button>\n </valtimo-schema-editor>\n } @else {\n <div class=\"loading-container\">\n <cds-loading></cds-loading>\n </div>\n }\n</ng-container>\n\n<a id=\"downloadAnchorElement\" style=\"display: none\"></a>\n", styles: [".loading-container{display:flex;width:100%;justify-content:center}\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"] }]
1167
+ }], ctorParameters: () => [{ type: BuildingBlockManagementDetailService }, { type: BuildingBlockManagementApiService }, { type: i3$1.IconService }] });
1168
+
1169
+ /*
1170
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
1171
+ *
1172
+ * Licensed under EUPL, Version 1.2 (the "License");
1173
+ * you may not use this file except in compliance with the License.
1174
+ * You may obtain a copy of the License at
1175
+ *
1176
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1177
+ *
1178
+ * Unless required by applicable law or agreed to in writing, software
1179
+ * distributed under the License is distributed on an "AS IS" basis,
1180
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1181
+ * See the License for the specific language governing permissions and
1182
+ * limitations under the License.
1183
+ */
1184
+ class BuildingBlockManagementProcessUploadComponent {
1185
+ constructor(formBuilder, notificationService, processLinkService, buildingBlockManagementDetailService, translateService) {
1186
+ this.formBuilder = formBuilder;
1187
+ this.notificationService = notificationService;
1188
+ this.processLinkService = processLinkService;
1189
+ this.buildingBlockManagementDetailService = buildingBlockManagementDetailService;
1190
+ this.translateService = translateService;
1191
+ this.modalOpen$ = this.buildingBlockManagementDetailService.showProcessDefinitionUploadModal$;
1192
+ this.showReplaceConfirmationModal$ = new BehaviorSubject(false);
1193
+ this.replaceModalContent = '';
1194
+ this.ACCEPTED_FILES = ['bpmn'];
1195
+ this.form = this.formBuilder.group({
1196
+ file: this.formBuilder.control(new Set(), [Validators.required]),
1197
+ });
1198
+ this.fileSelected$ = this.form.get('file')?.valueChanges.pipe(startWith(null), map(value => !!(value instanceof Set && value.size > 0)));
1199
+ }
1200
+ closeModal() {
1201
+ this.buildingBlockManagementDetailService.hideProcessDefinitionUploadModal();
1202
+ setTimeout(() => {
1203
+ this.form.reset();
1204
+ }, CARBON_CONSTANTS.modalAnimationMs);
1205
+ }
1206
+ uploadProcessBpmn(replace = false) {
1207
+ const bpmnFile = this.form.value?.file?.values()?.next()?.value?.file;
1208
+ if (!bpmnFile)
1209
+ return;
1210
+ from(bpmnFile.text())
1211
+ .pipe(switchMap(bpmnXml => this.processLinkService.deployProcessWithProcessLinksForBuildingBlock([], null, `${bpmnXml}`, this.buildingBlockManagementDetailService.buildingBlockDefinitionKey, this.buildingBlockManagementDetailService.buildingBlockDefinitionVersionTag, replace)))
1212
+ .subscribe({
1213
+ next: () => {
1214
+ this.notificationService.showNotification({
1215
+ type: 'success',
1216
+ title: this.translateService.instant('processManagement.upload.success'),
1217
+ });
1218
+ this.closeModal();
1219
+ this.buildingBlockManagementDetailService.reloadProcessDefinitions();
1220
+ },
1221
+ error: (error) => {
1222
+ const duplicateKey = error instanceof HttpErrorResponse && error.status === 409;
1223
+ if (duplicateKey) {
1224
+ this.replaceModalContent = this.buildReplaceModalContent(error);
1225
+ this.showReplaceConfirmationModal$.next(true);
1226
+ return;
1227
+ }
1228
+ this.notificationService.showNotification({
1229
+ type: 'error',
1230
+ title: this.translateService.instant('processManagement.upload.failure'),
1231
+ });
1232
+ },
1233
+ });
1234
+ }
1235
+ confirmReplace() {
1236
+ this.replaceModalContent = '';
1237
+ this.uploadProcessBpmn(true);
1238
+ }
1239
+ clearReplaceModal() {
1240
+ this.replaceModalContent = '';
1241
+ }
1242
+ getDuplicateKeyMessage(error) {
1243
+ const response = error.error;
1244
+ const duplicates = response?.duplicateProcessDefinitions || response?.parameters?.duplicateProcessDefinitions;
1245
+ if (Array.isArray(duplicates) && duplicates.length > 0) {
1246
+ const duplicateList = duplicates
1247
+ .map(item => {
1248
+ if (!item?.key)
1249
+ return null;
1250
+ return item.name ? `${item.key} (${item.name})` : item.key;
1251
+ })
1252
+ .filter(Boolean)
1253
+ .join(', ');
1254
+ if (duplicateList) {
1255
+ return this.translateService.instant('processManagement.upload.replaceContentWithDuplicates', {
1256
+ duplicates: duplicateList,
1257
+ });
1258
+ }
1259
+ }
1260
+ return null;
1261
+ }
1262
+ buildReplaceModalContent(error) {
1263
+ return (this.getDuplicateKeyMessage(error) ||
1264
+ this.translateService.instant('processManagement.upload.replaceContent'));
1265
+ }
1266
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: BuildingBlockManagementProcessUploadComponent, deps: [{ token: i2$1.FormBuilder }, { token: i5.GlobalNotificationService }, { token: i3$2.ProcessLinkService }, { token: BuildingBlockManagementDetailService }, { token: i2$2.TranslateService }], target: i0.ɵɵFactoryTarget.Component }); }
1267
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.20", type: BuildingBlockManagementProcessUploadComponent, isStandalone: true, selector: "valtimo-building-block-management-process-upload", 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>{{ 'processManagement.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]=\"'processManagement.upload.buttonText' | translate\"\n [description]=\"'processManagement.upload.description' | translate\"\n [multiple]=\"false\"\n [title]=\"'processManagement.upload.title' | translate\"\n buttonType=\"primary\"\n formControlName=\"file\"\n >\n </cds-file-uploader>\n </section>\n\n <cds-modal-footer>\n <button cdsButton=\"secondary\" (click)=\"closeModal()\">\n {{ 'interface.cancel' | translate }}\n </button>\n\n <button\n cdsButton=\"primary\"\n [disabled]=\"(fileSelected$ | async) === false\"\n (click)=\"uploadProcessBpmn()\"\n >\n {{ 'interface.upload' | translate }}\n </button>\n </cds-modal-footer>\n</cds-modal>\n\n<valtimo-render-in-body>\n <valtimo-confirmation-modal\n confirmButtonTextTranslationKey=\"processManagement.upload.replaceConfirm\"\n confirmButtonType=\"danger\"\n cancelButtonTextTranslationKey=\"interface.cancel\"\n [content]=\"replaceModalContent\"\n [showModalSubject$]=\"showReplaceConfirmationModal$\"\n titleTranslationKey=\"processManagement.upload.replaceTitle\"\n (confirmEvent)=\"confirmReplace()\"\n (cancelEvent)=\"clearReplaceModal()\"\n ></valtimo-confirmation-modal>\n</valtimo-render-in-body>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i2$2.TranslatePipe, name: "translate" }, { kind: "ngmodule", type: FileUploaderModule }, { kind: "component", type: i3$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: i3$1.Modal, selector: "cds-modal, ibm-modal", inputs: ["size", "theme", "ariaLabel", "open", "trigger", "hasScrollingContent"], outputs: ["overlaySelected", "close"] }, { kind: "component", type: i3$1.ModalHeader, selector: "cds-modal-header, ibm-modal-header", inputs: ["theme", "closeLabel", "showCloseButton"], outputs: ["closeSelect"] }, { kind: "component", type: i3$1.ModalFooter, selector: "cds-modal-footer, ibm-modal-footer" }, { kind: "directive", type: i3$1.ModalContent, selector: "[cdsModalContent], [ibmModalContent]", inputs: ["hasForm"] }, { kind: "directive", type: i3$1.ModalHeaderHeading, selector: "[cdsModalHeaderHeading], [ibmModalHeaderHeading]" }, { kind: "ngmodule", type: LayerModule }, { kind: "directive", type: i3$1.LayerDirective, selector: "[cdsLayer], [ibmLayer]", inputs: ["ibmLayer", "cdsLayer"], exportAs: ["layer"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: ButtonModule }, { kind: "directive", type: i3$1.Button, selector: "[cdsButton], [ibmButton]", inputs: ["ibmButton", "cdsButton", "size", "skeleton", "iconOnly", "isExpressive"] }, { kind: "ngmodule", type: ConfirmationModalModule }, { kind: "component", type: i7.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: RenderInBodyComponent, selector: "valtimo-render-in-body" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1268
+ }
1269
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: BuildingBlockManagementProcessUploadComponent, decorators: [{
1270
+ type: Component,
1271
+ args: [{ selector: 'valtimo-building-block-management-process-upload', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [
1272
+ CommonModule,
1273
+ TranslateModule,
1274
+ FileUploaderModule,
1275
+ ModalModule,
1276
+ LayerModule,
1277
+ ReactiveFormsModule,
1278
+ ButtonModule,
1279
+ ConfirmationModalModule,
1280
+ RenderInBodyComponent,
1281
+ ], 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>{{ 'processManagement.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]=\"'processManagement.upload.buttonText' | translate\"\n [description]=\"'processManagement.upload.description' | translate\"\n [multiple]=\"false\"\n [title]=\"'processManagement.upload.title' | translate\"\n buttonType=\"primary\"\n formControlName=\"file\"\n >\n </cds-file-uploader>\n </section>\n\n <cds-modal-footer>\n <button cdsButton=\"secondary\" (click)=\"closeModal()\">\n {{ 'interface.cancel' | translate }}\n </button>\n\n <button\n cdsButton=\"primary\"\n [disabled]=\"(fileSelected$ | async) === false\"\n (click)=\"uploadProcessBpmn()\"\n >\n {{ 'interface.upload' | translate }}\n </button>\n </cds-modal-footer>\n</cds-modal>\n\n<valtimo-render-in-body>\n <valtimo-confirmation-modal\n confirmButtonTextTranslationKey=\"processManagement.upload.replaceConfirm\"\n confirmButtonType=\"danger\"\n cancelButtonTextTranslationKey=\"interface.cancel\"\n [content]=\"replaceModalContent\"\n [showModalSubject$]=\"showReplaceConfirmationModal$\"\n titleTranslationKey=\"processManagement.upload.replaceTitle\"\n (confirmEvent)=\"confirmReplace()\"\n (cancelEvent)=\"clearReplaceModal()\"\n ></valtimo-confirmation-modal>\n</valtimo-render-in-body>\n" }]
1282
+ }], ctorParameters: () => [{ type: i2$1.FormBuilder }, { type: i5.GlobalNotificationService }, { type: i3$2.ProcessLinkService }, { type: BuildingBlockManagementDetailService }, { type: i2$2.TranslateService }] });
1283
+
1284
+ /*
1285
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
1286
+ *
1287
+ * Licensed under EUPL, Version 1.2 (the "License");
1288
+ * you may not use this file except in compliance with the License.
1289
+ * You may obtain a copy of the License at
1290
+ *
1291
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1292
+ *
1293
+ * Unless required by applicable law or agreed to in writing, software
1294
+ * distributed under the License is distributed on an "AS IS" basis,
1295
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1296
+ * See the License for the specific language governing permissions and
1297
+ * limitations under the License.
1298
+ */
1299
+ class BuildingBlockManagementProcessesComponent {
1300
+ constructor(buildingBlockManagementDetailService, buildingBlockManagementApiService, translateService, iconService, router) {
1301
+ this.buildingBlockManagementDetailService = buildingBlockManagementDetailService;
1302
+ this.buildingBlockManagementApiService = buildingBlockManagementApiService;
1303
+ this.translateService = translateService;
1304
+ this.iconService = iconService;
1305
+ this.router = router;
1306
+ this.$loading = signal(true);
1307
+ this._buildingBlockProcessDefinitions$ = new BehaviorSubject([]);
1308
+ this._buildingBlockProcessDefinitionItems = [];
1309
+ this.buildingBlockProcessDefinitionItems$ = combineLatest([
1310
+ this._buildingBlockProcessDefinitions$,
1311
+ this.translateService.stream('key'),
1312
+ ]).pipe(map(([processDefinitions]) => processDefinitions.map(definition => ({
1313
+ ...definition,
1314
+ mainText: definition.main &&
1315
+ this.translateService.instant('buildingBlockManagement.processDefinition.mainText'),
1316
+ }))), tap(buildingBlockProcessDefinitionItems => (this._buildingBlockProcessDefinitionItems = buildingBlockProcessDefinitionItems)));
1317
+ this.FIELDS = [
1318
+ { key: 'name', label: 'buildingBlockManagement.processDefinition.name' },
1319
+ { key: 'key', label: 'buildingBlockManagement.processDefinition.key' },
1320
+ {
1321
+ key: 'mainText',
1322
+ label: '',
1323
+ viewType: ViewType.TAGS,
1324
+ },
1325
+ ];
1326
+ this.onDeleteClick = (process) => {
1327
+ this._processToDelete = process;
1328
+ this.showDeleteModal$.next(true);
1329
+ };
1330
+ this.ACTION_ITEMS = [
1331
+ {
1332
+ label: 'buildingBlockManagement.processDefinition.markAsMain',
1333
+ callback: this.onMarkAsMain.bind(this),
1334
+ type: 'normal',
1335
+ disabledCallback: this.markAsMainDisabled.bind(this),
1336
+ },
1337
+ {
1338
+ label: 'interface.delete',
1339
+ callback: this.onDeleteClick,
1340
+ type: 'danger',
1341
+ disabledCallback: this.deleteDisabled.bind(this),
1342
+ },
1343
+ ];
1344
+ this.isFinal$ = this.buildingBlockManagementDetailService.isFinal$;
1345
+ this.showDeleteModal$ = new BehaviorSubject(false);
1346
+ this._subscriptions = new Subscription();
1347
+ this.iconService.registerAll([Upload16]);
1348
+ }
1349
+ ngOnInit() {
1350
+ this._subscriptions.add(combineLatest([
1351
+ this.buildingBlockManagementDetailService.buildingBlockDefinitionKey$,
1352
+ this.buildingBlockManagementDetailService.buildingBlockDefinitionVersionTag$,
1353
+ ])
1354
+ .pipe(distinctUntilChanged((a, b) => isEqual(a, b)), tap(() => this.$loading.set(true)), switchMap(([key, versionTag]) => this.buildingBlockManagementDetailService.reloadProcessDefinitions$.pipe(tap(() => this.$loading.set(true)), switchMap(() => this.buildingBlockManagementApiService.getBuildingBlockProcessDefinitions(key, versionTag)))), tap(processDefinitions => {
1355
+ this._buildingBlockProcessDefinitions$.next(processDefinitions);
1356
+ this.$loading.set(false);
1357
+ }))
1358
+ .subscribe());
1359
+ }
1360
+ ngOnDestroy() {
1361
+ this._subscriptions.unsubscribe();
1362
+ }
1363
+ onRowClick(processDefinition) {
1364
+ this.router.navigate([
1365
+ '/building-block-management',
1366
+ 'building-block',
1367
+ this.buildingBlockManagementDetailService.buildingBlockDefinitionKey,
1368
+ 'version',
1369
+ this.buildingBlockManagementDetailService.buildingBlockDefinitionVersionTag,
1370
+ BUILDING_BLOCK_MANAGEMENT_TABS.PROCESSES,
1371
+ processDefinition.id,
1372
+ ]);
1373
+ }
1374
+ showUploadModal() {
1375
+ this.buildingBlockManagementDetailService.showProcessDefinitionUploadModal();
1376
+ }
1377
+ onCreateClick() {
1378
+ this.router.navigate([
1379
+ '/building-block-management',
1380
+ 'building-block',
1381
+ this.buildingBlockManagementDetailService.buildingBlockDefinitionKey,
1382
+ 'version',
1383
+ this.buildingBlockManagementDetailService.buildingBlockDefinitionVersionTag,
1384
+ BUILDING_BLOCK_MANAGEMENT_TABS.PROCESSES,
1385
+ 'create',
1386
+ ]);
1387
+ }
1388
+ onDeleteConfirm() {
1389
+ if (!this._processToDelete)
1390
+ return;
1391
+ this.$loading.set(true);
1392
+ this.buildingBlockManagementApiService
1393
+ .deleteBuildingBlockProcessDefinition(this.buildingBlockManagementDetailService.buildingBlockDefinitionKey, this.buildingBlockManagementDetailService.buildingBlockDefinitionVersionTag, this._processToDelete.id)
1394
+ .subscribe({
1395
+ next: () => {
1396
+ this.buildingBlockManagementDetailService.reloadProcessDefinitions();
1397
+ },
1398
+ error: () => {
1399
+ this.$loading.set(false);
1400
+ },
1401
+ });
1402
+ }
1403
+ onMarkAsMain(process) {
1404
+ this.$loading.set(true);
1405
+ this.buildingBlockManagementApiService
1406
+ .setMainBuildingBlockProcessDefinition(this.buildingBlockManagementDetailService.buildingBlockDefinitionKey, this.buildingBlockManagementDetailService.buildingBlockDefinitionVersionTag, process.id)
1407
+ .subscribe({
1408
+ next: () => {
1409
+ this.buildingBlockManagementDetailService.reloadProcessDefinitions();
1410
+ },
1411
+ error: () => {
1412
+ this.$loading.set(false);
1413
+ },
1414
+ });
1415
+ }
1416
+ markAsMainDisabled(process) {
1417
+ return process.main || this._buildingBlockProcessDefinitionItems.length === 1;
1418
+ }
1419
+ deleteDisabled(process) {
1420
+ return process.main || this._buildingBlockProcessDefinitionItems.length === 1;
1421
+ }
1422
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: BuildingBlockManagementProcessesComponent, deps: [{ token: BuildingBlockManagementDetailService }, { token: BuildingBlockManagementApiService }, { token: i2$2.TranslateService }, { token: i3$1.IconService }, { token: i3.Router }], target: i0.ɵɵFactoryTarget.Component }); }
1423
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.20", type: BuildingBlockManagementProcessesComponent, isStandalone: true, selector: "valtimo-building-block-management-processes", 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<valtimo-carbon-list\n [fields]=\"FIELDS\"\n [actionItems]=\"ACTION_ITEMS\"\n [items]=\"buildingBlockProcessDefinitionItems$ | async\"\n [loading]=\"$loading()\"\n (rowClicked)=\"onRowClick($event)\"\n>\n <div carbonToolbarContent>\n <div class=\"valtimo-building-block-management-list__actions\">\n <button\n cdsButton=\"ghost\"\n (click)=\"showUploadModal()\"\n [disabled]=\"(isFinal$ | async) || $loading()\"\n >\n {{ 'Upload' | translate }}\n\n <svg cdsIcon=\"upload\" size=\"16\" class=\"cds--btn__icon\"></svg>\n </button>\n\n <button\n cdsButton=\"primary\"\n (click)=\"onCreateClick()\"\n [disabled]=\"(isFinal$ | async) || $loading()\"\n >\n {{ 'interface.create' | translate }}\n\n <svg cdsIcon=\"add\" size=\"16\" class=\"cds--btn__icon\"></svg>\n </button>\n </div>\n </div>\n</valtimo-carbon-list>\n\n<valtimo-building-block-management-process-upload></valtimo-building-block-management-process-upload>\n\n<valtimo-confirmation-modal\n confirmButtonTextTranslationKey=\"interface.delete\"\n confirmButtonType=\"danger\"\n contentTranslationKey=\"processManagement.deleteModal.content\"\n [showModalSubject$]=\"showDeleteModal$\"\n titleTranslationKey=\"processManagement.deleteModal.title\"\n (confirmEvent)=\"onDeleteConfirm()\"\n></valtimo-confirmation-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: i4.AsyncPipe, name: "async" }, { kind: "ngmodule", type: CarbonListModule }, { kind: "component", type: i7.CarbonListComponent, selector: "valtimo-carbon-list", inputs: ["items", "fields", "tableTranslations", "paginatorConfig", "pagination", "loading", "skeletonRowCount", "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: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i2$2.TranslatePipe, name: "translate" }, { kind: "ngmodule", type: ButtonModule }, { kind: "directive", type: i3$1.Button, selector: "[cdsButton], [ibmButton]", inputs: ["ibmButton", "cdsButton", "size", "skeleton", "iconOnly", "isExpressive"] }, { kind: "ngmodule", type: IconModule }, { kind: "directive", type: i3$1.IconDirective, selector: "[cdsIcon], [ibmIcon]", inputs: ["ibmIcon", "cdsIcon", "size", "title", "ariaLabel", "ariaLabelledBy", "ariaHidden", "isFocusable"] }, { kind: "component", type: BuildingBlockManagementProcessUploadComponent, selector: "valtimo-building-block-management-process-upload" }, { kind: "ngmodule", type: ConfirmationModalModule }, { kind: "component", type: i7.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"] }] }); }
1424
+ }
1425
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: BuildingBlockManagementProcessesComponent, decorators: [{
1426
+ type: Component,
1427
+ args: [{ standalone: true, selector: 'valtimo-building-block-management-processes', imports: [
1428
+ CommonModule,
1429
+ CarbonListModule,
1430
+ TranslateModule,
1431
+ ButtonModule,
1432
+ IconModule,
1433
+ BuildingBlockManagementProcessUploadComponent,
1434
+ ConfirmationModalModule,
1435
+ ], 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<valtimo-carbon-list\n [fields]=\"FIELDS\"\n [actionItems]=\"ACTION_ITEMS\"\n [items]=\"buildingBlockProcessDefinitionItems$ | async\"\n [loading]=\"$loading()\"\n (rowClicked)=\"onRowClick($event)\"\n>\n <div carbonToolbarContent>\n <div class=\"valtimo-building-block-management-list__actions\">\n <button\n cdsButton=\"ghost\"\n (click)=\"showUploadModal()\"\n [disabled]=\"(isFinal$ | async) || $loading()\"\n >\n {{ 'Upload' | translate }}\n\n <svg cdsIcon=\"upload\" size=\"16\" class=\"cds--btn__icon\"></svg>\n </button>\n\n <button\n cdsButton=\"primary\"\n (click)=\"onCreateClick()\"\n [disabled]=\"(isFinal$ | async) || $loading()\"\n >\n {{ 'interface.create' | translate }}\n\n <svg cdsIcon=\"add\" size=\"16\" class=\"cds--btn__icon\"></svg>\n </button>\n </div>\n </div>\n</valtimo-carbon-list>\n\n<valtimo-building-block-management-process-upload></valtimo-building-block-management-process-upload>\n\n<valtimo-confirmation-modal\n confirmButtonTextTranslationKey=\"interface.delete\"\n confirmButtonType=\"danger\"\n contentTranslationKey=\"processManagement.deleteModal.content\"\n [showModalSubject$]=\"showDeleteModal$\"\n titleTranslationKey=\"processManagement.deleteModal.title\"\n (confirmEvent)=\"onDeleteConfirm()\"\n></valtimo-confirmation-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"] }]
1436
+ }], ctorParameters: () => [{ type: BuildingBlockManagementDetailService }, { type: BuildingBlockManagementApiService }, { type: i2$2.TranslateService }, { type: i3$1.IconService }, { type: i3.Router }] });
1437
+
1438
+ /*
1439
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
1440
+ *
1441
+ * Licensed under EUPL, Version 1.2 (the "License");
1442
+ * you may not use this file except in compliance with the License.
1443
+ * You may obtain a copy of the License at
1444
+ *
1445
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1446
+ *
1447
+ * Unless required by applicable law or agreed to in writing, software
1448
+ * distributed under the License is distributed on an "AS IS" basis,
1449
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1450
+ * See the License for the specific language governing permissions and
1451
+ * limitations under the License.
1452
+ */
1453
+ class BuildingBlockManagementVersionSelectorComponent {
1454
+ onVersionSelected(event) {
1455
+ const versionTag = event?.item?.id;
1456
+ if (!versionTag)
1457
+ return;
1458
+ this.buildingBlockManagementDetailService.navigateToVersionTag(versionTag);
1459
+ }
1460
+ constructor(buildingBlockManagementDetailService, buildingBlockManagementApiService) {
1461
+ this.buildingBlockManagementDetailService = buildingBlockManagementDetailService;
1462
+ this.buildingBlockManagementApiService = buildingBlockManagementApiService;
1463
+ this._versions$ = combineLatest([
1464
+ this.buildingBlockManagementDetailService.buildingBlockDefinitionKey$,
1465
+ this.buildingBlockManagementDetailService.reloadVersions$,
1466
+ ]).pipe(switchMap(([key]) => this.buildingBlockManagementApiService.getVersionsForBuildingBlock(key, 0, 10, true)));
1467
+ this.versionListItems$ = combineLatest([
1468
+ this._versions$,
1469
+ this.buildingBlockManagementDetailService.buildingBlockDefinitionVersionTag$,
1470
+ ]).pipe(map(([versions, versionTag]) => versions.content.map(version => ({
1471
+ id: version.versionTag,
1472
+ content: version.versionTag,
1473
+ selected: versionTag === version.versionTag,
1474
+ final: version.final,
1475
+ }))));
1476
+ }
1477
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: BuildingBlockManagementVersionSelectorComponent, deps: [{ token: BuildingBlockManagementDetailService }, { token: BuildingBlockManagementApiService }], target: i0.ɵɵFactoryTarget.Component }); }
1478
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.20", type: BuildingBlockManagementVersionSelectorComponent, isStandalone: true, selector: "valtimo-building-block-management-version-selector", 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 *ngIf=\"{versionListItems: (versionListItems$ | async) || []} as obs\">\n <cds-dropdown\n class=\"version-selector\"\n [disabled]=\"obs.versionListItems.length === 1\"\n [displayValue]=\"versionTemplate\"\n (selected)=\"onVersionSelected($event)\"\n >\n <cds-dropdown-list\n [items]=\"obs.versionListItems\"\n [listTpl]=\"versionTemplate\"\n ></cds-dropdown-list>\n </cds-dropdown>\n</ng-container>\n\n<ng-template #versionTemplate let-item=\"item\">\n <div class=\"version-selector-dropdown-template\">\n <cds-tag\n class=\"cds-tag--no-margin\"\n [type]=\"!item?.final ? 'red' : 'green'\"\n [title]=\"item?.content\"\n >\n {{ !item?.final ? 'DRAFT: ' + item?.content : item?.content }}\n </cds-tag>\n </div>\n</ng-template>\n", styles: [".version-selector{margin:0;max-width:300px}::ng-deep .version-selector-dropdown-template{display:flex}::ng-deep .version-selector-dropdown-template .cds--tag{margin:0 8px 0 0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:inline-block;line-height:24px;max-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: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }, { kind: "ngmodule", type: DropdownModule }, { kind: "component", type: i3$1.Dropdown, selector: "cds-dropdown, ibm-dropdown", inputs: ["id", "label", "hideLabel", "helperText", "placeholder", "displayValue", "clearText", "size", "type", "theme", "disabled", "readonly", "skeleton", "inline", "disableArrowKeys", "invalid", "invalidText", "warn", "warnText", "appendInline", "scrollableContainer", "itemValueKey", "selectionFeedback", "menuButtonLabel", "selectedLabel", "dropUp", "fluid"], outputs: ["selected", "onClose", "close"] }, { kind: "component", type: i3$1.DropdownList, selector: "cds-dropdown-list, ibm-dropdown-list", inputs: ["ariaLabel", "items", "listTpl", "type", "showTitles"], outputs: ["select", "scroll", "blurIntent"] }, { kind: "ngmodule", type: TagModule }, { kind: "component", type: i3$1.Tag, selector: "cds-tag, ibm-tag", inputs: ["type", "size", "class", "skeleton"] }] }); }
1479
+ }
1480
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: BuildingBlockManagementVersionSelectorComponent, decorators: [{
1481
+ type: Component,
1482
+ args: [{ standalone: true, selector: 'valtimo-building-block-management-version-selector', imports: [CommonModule, DropdownModule, TagModule], 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 *ngIf=\"{versionListItems: (versionListItems$ | async) || []} as obs\">\n <cds-dropdown\n class=\"version-selector\"\n [disabled]=\"obs.versionListItems.length === 1\"\n [displayValue]=\"versionTemplate\"\n (selected)=\"onVersionSelected($event)\"\n >\n <cds-dropdown-list\n [items]=\"obs.versionListItems\"\n [listTpl]=\"versionTemplate\"\n ></cds-dropdown-list>\n </cds-dropdown>\n</ng-container>\n\n<ng-template #versionTemplate let-item=\"item\">\n <div class=\"version-selector-dropdown-template\">\n <cds-tag\n class=\"cds-tag--no-margin\"\n [type]=\"!item?.final ? 'red' : 'green'\"\n [title]=\"item?.content\"\n >\n {{ !item?.final ? 'DRAFT: ' + item?.content : item?.content }}\n </cds-tag>\n </div>\n</ng-template>\n", styles: [".version-selector{margin:0;max-width:300px}::ng-deep .version-selector-dropdown-template{display:flex}::ng-deep .version-selector-dropdown-template .cds--tag{margin:0 8px 0 0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:inline-block;line-height:24px;max-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"] }]
1483
+ }], ctorParameters: () => [{ type: BuildingBlockManagementDetailService }, { type: BuildingBlockManagementApiService }] });
1484
+
1485
+ /*
1486
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
1487
+ *
1488
+ * Licensed under EUPL, Version 1.2 (the "License");
1489
+ * you may not use this file except in compliance with the License.
1490
+ * You may obtain a copy of the License at
1491
+ *
1492
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1493
+ *
1494
+ * Unless required by applicable law or agreed to in writing, software
1495
+ * distributed under the License is distributed on an "AS IS" basis,
1496
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1497
+ * See the License for the specific language governing permissions and
1498
+ * limitations under the License.
1499
+ */
1500
+ class BuildingBlockManagementDetailActionsComponent {
1501
+ get exporting$() {
1502
+ return this._exporting$.asObservable();
1503
+ }
1504
+ get versionTag() {
1505
+ return this.draftForm.get('versionTag');
1506
+ }
1507
+ constructor(buildingBlockManagementApiService, buildingBlockManagementDetailService, fb, notificationService, translateService, document) {
1508
+ this.buildingBlockManagementApiService = buildingBlockManagementApiService;
1509
+ this.buildingBlockManagementDetailService = buildingBlockManagementDetailService;
1510
+ this.fb = fb;
1511
+ this.notificationService = notificationService;
1512
+ this.translateService = translateService;
1513
+ this.document = document;
1514
+ this.actionInProgress$ = new BehaviorSubject(false);
1515
+ this.showDraftModal$ = new BehaviorSubject(false);
1516
+ this.definition$ = this.buildingBlockManagementDetailService.buildingBlockDefinition$;
1517
+ this.isFinal$ = this.buildingBlockManagementDetailService.isFinal$;
1518
+ this.buildingBlockName$ = this.buildingBlockManagementDetailService.buildingBlockDefinition$.pipe(map(definition => definition.name ?? definition.key));
1519
+ this._exporting$ = new BehaviorSubject(false);
1520
+ this.draftForm = this.fb.group({
1521
+ versionTag: this.fb.control('', Validators.required),
1522
+ });
1523
+ }
1524
+ finalizeDraft() {
1525
+ if (this.actionInProgress$.value)
1526
+ return;
1527
+ this.actionInProgress$.next(true);
1528
+ this.definition$
1529
+ .pipe(take(1), switchMap(definition => this.buildingBlockManagementApiService.finalizeBuildingBlockDefinition(definition.key, definition.versionTag)), finalize(() => this.actionInProgress$.next(false)))
1530
+ .subscribe({
1531
+ next: () => {
1532
+ this.notifySuccess('buildingBlockManagement.actions.finalize.success');
1533
+ this.buildingBlockManagementDetailService.reload();
1534
+ this.buildingBlockManagementDetailService.reloadVersions();
1535
+ },
1536
+ error: () => {
1537
+ this.notifyError('buildingBlockManagement.actions.finalize.error');
1538
+ },
1539
+ });
1540
+ }
1541
+ openDraftModal() {
1542
+ this.showDraftModal$.next(true);
1543
+ }
1544
+ closeDraftModal() {
1545
+ this.showDraftModal$.next(false);
1546
+ this.draftForm.reset();
1547
+ }
1548
+ createDraft() {
1549
+ if (this.draftForm.invalid || this.actionInProgress$.value)
1550
+ return;
1551
+ this.actionInProgress$.next(true);
1552
+ const newVersionTag = this.versionTag.value;
1553
+ this.definition$
1554
+ .pipe(take(1), switchMap(definition => this.buildingBlockManagementApiService.createDraftBuildingBlockDefinition(definition.key, definition.versionTag, newVersionTag)), finalize(() => this.actionInProgress$.next(false)))
1555
+ .subscribe({
1556
+ next: draft => {
1557
+ this.notifySuccess('buildingBlockManagement.actions.draft.success');
1558
+ this.closeDraftModal();
1559
+ this.buildingBlockManagementDetailService.reloadVersions();
1560
+ this.buildingBlockManagementDetailService.navigateToVersionTag(draft.versionTag);
1561
+ },
1562
+ error: () => {
1563
+ this.notifyError('buildingBlockManagement.actions.draft.error');
1564
+ },
1565
+ });
1566
+ }
1567
+ export() {
1568
+ if (this.actionInProgress$.value || this._exporting$.value)
1569
+ return;
1570
+ this._currentNotification = this.notificationService.showNotification({
1571
+ type: 'info',
1572
+ title: '',
1573
+ showClose: false,
1574
+ template: this._exportMessageTemplateRef,
1575
+ });
1576
+ this._exporting$.next(true);
1577
+ this.buildingBlockManagementApiService
1578
+ .exportBuildingBlock(this.buildingBlockManagementDetailService.buildingBlockDefinitionKey, this.buildingBlockManagementDetailService.buildingBlockDefinitionVersionTag)
1579
+ .pipe(finalize(() => this._exporting$.next(false)))
1580
+ .subscribe({
1581
+ next: response => {
1582
+ this.closeCurrentNotification();
1583
+ this._currentNotification = this.notificationService.showNotification({
1584
+ type: 'success',
1585
+ title: this.translateService.instant('buildingBlockManagement.overflowMenu.exportSuccessTitle'),
1586
+ duration: 5000,
1587
+ });
1588
+ this.downloadZip(response);
1589
+ },
1590
+ error: () => {
1591
+ this.closeCurrentNotification();
1592
+ this.notifyError('buildingBlockManagement.overflowMenu.exportErrorTitle');
1593
+ },
1594
+ });
1595
+ }
1596
+ downloadZip(response) {
1597
+ const link = this.document.createElement('a');
1598
+ const contentDisposition = response.headers.get('content-disposition');
1599
+ const splitContentDisposition = contentDisposition?.split('filename=') ?? [];
1600
+ const fileName = splitContentDisposition.length > 1 && splitContentDisposition[1];
1601
+ link.href = this.document.defaultView?.URL.createObjectURL(response.body) ?? '';
1602
+ link.download =
1603
+ fileName ||
1604
+ `${this.buildingBlockManagementDetailService.buildingBlockDefinitionKey}_${this.buildingBlockManagementDetailService.buildingBlockDefinitionVersionTag}.valtimo.zip`;
1605
+ link.target = '_blank';
1606
+ link.click();
1607
+ link.remove();
1608
+ }
1609
+ closeCurrentNotification() {
1610
+ if (this._currentNotification) {
1611
+ this.notificationService.close(this._currentNotification);
1612
+ }
1613
+ }
1614
+ notifySuccess(translationKey) {
1615
+ this.notificationService.showNotification({
1616
+ type: 'success',
1617
+ title: this.translateService.instant(translationKey),
1618
+ duration: 5000,
1619
+ });
1620
+ }
1621
+ notifyError(translationKey) {
1622
+ this.notificationService.showNotification({
1623
+ type: 'error',
1624
+ title: this.translateService.instant(translationKey),
1625
+ duration: 5000,
1626
+ });
1627
+ }
1628
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: BuildingBlockManagementDetailActionsComponent, deps: [{ token: BuildingBlockManagementApiService }, { token: BuildingBlockManagementDetailService }, { token: i2$1.FormBuilder }, { token: i5.GlobalNotificationService }, { token: i2$2.TranslateService }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Component }); }
1629
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.20", type: BuildingBlockManagementDetailActionsComponent, isStandalone: true, selector: "valtimo-building-block-management-detail-actions", viewQueries: [{ propertyName: "_exportMessageTemplateRef", first: true, predicate: ["exportingMessage"], descendants: 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<div\n class=\"building-block-actions\"\n *ngIf=\"{\n isFinal: isFinal$ | async,\n } as obs\"\n>\n <div class=\"building-block-metadata\">\n <valtimo-building-block-management-version-selector></valtimo-building-block-management-version-selector>\n </div>\n\n <div class=\"building-block-buttons\">\n <v-overflow-menu\n class=\"overflow-button\"\n [menuWidth]=\"250\"\n placement=\"bottom-end\"\n >\n <button overflowTrigger cdsButton=\"tertiary\">\n {{ 'buildingBlockManagement.actions.more' | translate }}\n <svg class=\"cds--btn__icon\" cdsIcon=\"overflow-menu--vertical\" size=\"16\"></svg>\n </button>\n\n <v-overflow-menu-option\n optionId=\"exportBuildingBlock\"\n (selected)=\"export()\"\n [disabled]=\"(actionInProgress$ | async) || (exporting$ | async)\"\n >\n {{\n 'buildingBlockManagement.overflowMenu.export'\n | translate: {value: buildingBlockName$ | async}\n }}\n </v-overflow-menu-option>\n\n <v-overflow-menu-option\n *ngIf=\"!obs.isFinal\"\n [disabled]=\"actionInProgress$ | async\"\n (selected)=\"finalizeDraft()\"\n >\n {{ 'buildingBlockManagement.actions.makeFinal' | translate }}\n </v-overflow-menu-option>\n\n <v-overflow-menu-option\n *ngIf=\"obs.isFinal\"\n [disabled]=\"actionInProgress$ | async\"\n (selected)=\"openDraftModal()\"\n >\n {{ 'buildingBlockManagement.actions.createDraft' | translate }}\n </v-overflow-menu-option>\n </v-overflow-menu>\n </div>\n</div>\n\n<ng-template #exportingMessage>\n <div class=\"exporting-message\">\n <span class=\"cds--inline-notification__title\">{{\n 'buildingBlockManagement.overflowMenu.preparingDownload' | translate\n }}</span>\n <cds-loading size=\"sm\"></cds-loading>\n </div>\n</ng-template>\n\n<cds-modal\n *ngIf=\"{open: showDraftModal$ | async} as obs\"\n [open]=\"obs.open\"\n showFooter=\"true\"\n valtimoCdsModal\n (close)=\"closeDraftModal()\"\n>\n <cds-modal-header showCloseButton=\"true\" (closeSelect)=\"closeDraftModal()\">\n <h3 cdsModalHeaderHeading>\n {{ 'buildingBlockManagement.actions.draft.title' | translate }}\n </h3>\n </cds-modal-header>\n\n <form [formGroup]=\"draftForm\" cdsModalContent class=\"bb-management-actions__modal\" [cdsLayer]=\"1\">\n <div class=\"cds--text-input__field-wrapper\">\n <cds-label\n [disabled]=\"draftForm.disabled\"\n [invalid]=\"versionTag.touched && versionTag.invalid\"\n >\n <span class=\"label-with-tooltip select-label\">\n {{ 'buildingBlockManagement.actions.draft.version' | translate }}\n </span>\n\n <input\n formControlName=\"versionTag\"\n cdsText\n placeholder=\"{{ 'buildingBlockManagement.actions.draft.placeholder' | translate }}\"\n />\n </cds-label>\n </div>\n </form>\n\n <cds-modal-footer>\n <button cdsButton=\"secondary\" (click)=\"closeDraftModal()\">\n {{ 'interface.cancel' | translate }}\n </button>\n\n <button\n cdsButton=\"primary\"\n [disabled]=\"draftForm.invalid || (actionInProgress$ | async)\"\n (click)=\"createDraft()\"\n >\n {{ 'buildingBlockManagement.actions.draft.confirm' | translate }}\n </button>\n </cds-modal-footer>\n</cds-modal>\n", styles: [".building-block-actions{display:flex;width:100%;justify-content:space-between;align-items:flex-end}.building-block-actions ::ng-deep .version-selection{width:160px}.building-block-actions ::ng-deep .version-selection .cds--list-box__selection{display:none}.bb-management-actions__modal{min-width:320px}.building-block-metadata{display:flex;gap:24px;align-items:flex-end}.building-block-buttons{display:flex;align-items:center;gap:16px}::ng-deep .cds--list-box__field{display:flex;justify-content:space-between}::ng-deep .cds--list-box__menu-item__option{display:flex;justify-content:space-between;padding-inline-end:0}::ng-deep .cds--list-box__menu-item__option>div{margin-top:-4px}.full-width-notification{max-inline-size:100%;min-inline-size:100%}::ng-deep .cds--text-input__field-wrapper cds-label{width:100%}.exporting-message{display:flex;align-items:center;gap:8px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }, { kind: "ngmodule", type: ButtonModule }, { kind: "directive", type: i3$1.Button, selector: "[cdsButton], [ibmButton]", inputs: ["ibmButton", "cdsButton", "size", "skeleton", "iconOnly", "isExpressive"] }, { kind: "ngmodule", type: ModalModule }, { kind: "component", type: i3$1.Modal, selector: "cds-modal, ibm-modal", inputs: ["size", "theme", "ariaLabel", "open", "trigger", "hasScrollingContent"], outputs: ["overlaySelected", "close"] }, { kind: "component", type: i3$1.ModalHeader, selector: "cds-modal-header, ibm-modal-header", inputs: ["theme", "closeLabel", "showCloseButton"], outputs: ["closeSelect"] }, { kind: "component", type: i3$1.ModalFooter, selector: "cds-modal-footer, ibm-modal-footer" }, { kind: "directive", type: i3$1.ModalContent, selector: "[cdsModalContent], [ibmModalContent]", inputs: ["hasForm"] }, { kind: "directive", type: i3$1.ModalHeaderHeading, selector: "[cdsModalHeaderHeading], [ibmModalHeaderHeading]" }, { kind: "ngmodule", type: InputModule }, { kind: "component", type: i3$1.Label, selector: "cds-label, ibm-label", inputs: ["labelInputID", "disabled", "skeleton", "helperText", "invalidText", "invalid", "warn", "warnText", "ariaLabel"] }, { kind: "directive", type: i3$1.TextInput, selector: "[cdsText], [ibmText]", inputs: ["theme", "size", "invalid", "warn", "skeleton"] }, { kind: "ngmodule", type: LayerModule }, { kind: "directive", type: i3$1.LayerDirective, selector: "[cdsLayer], [ibmLayer]", inputs: ["ibmLayer", "cdsLayer"], exportAs: ["layer"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: IconModule }, { kind: "directive", type: i3$1.IconDirective, selector: "[cdsIcon], [ibmIcon]", inputs: ["ibmIcon", "cdsIcon", "size", "title", "ariaLabel", "ariaLabelledBy", "ariaHidden", "isFocusable"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }, { kind: "directive", type: ValtimoCdsModalDirective, selector: "[valtimoCdsModal]", inputs: ["minContentHeight"] }, { kind: "ngmodule", type: DialogModule }, { kind: "component", type: BuildingBlockManagementVersionSelectorComponent, selector: "valtimo-building-block-management-version-selector" }, { kind: "component", type: OverflowMenuComponent, selector: "v-overflow-menu", inputs: ["open", "placement", "menuWidth", "offsetX", "offsetY", "closeOnSelect", "useHostAsReference", "portalToBody"], outputs: ["openChange"] }, { kind: "component", type: OverflowMenuOptionComponent, selector: "v-overflow-menu-option", inputs: ["disabled", "type", "testId", "optionId"], outputs: ["selected"] }, { kind: "ngmodule", type: LoadingModule }, { kind: "component", type: i3$1.Loading, selector: "cds-loading, ibm-loading", inputs: ["title", "isActive", "size", "overlay"] }] }); }
1630
+ }
1631
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: BuildingBlockManagementDetailActionsComponent, decorators: [{
1632
+ type: Component,
1633
+ args: [{ standalone: true, selector: 'valtimo-building-block-management-detail-actions', imports: [
1634
+ CommonModule,
1635
+ ButtonModule,
1636
+ ModalModule,
1637
+ InputModule,
1638
+ LayerModule,
1639
+ ReactiveFormsModule,
1640
+ IconModule,
1641
+ TranslatePipe,
1642
+ ValtimoCdsModalDirective,
1643
+ DialogModule,
1644
+ BuildingBlockManagementVersionSelectorComponent,
1645
+ OverflowMenuComponent,
1646
+ OverflowMenuOptionComponent,
1647
+ LoadingModule,
1648
+ ], 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<div\n class=\"building-block-actions\"\n *ngIf=\"{\n isFinal: isFinal$ | async,\n } as obs\"\n>\n <div class=\"building-block-metadata\">\n <valtimo-building-block-management-version-selector></valtimo-building-block-management-version-selector>\n </div>\n\n <div class=\"building-block-buttons\">\n <v-overflow-menu\n class=\"overflow-button\"\n [menuWidth]=\"250\"\n placement=\"bottom-end\"\n >\n <button overflowTrigger cdsButton=\"tertiary\">\n {{ 'buildingBlockManagement.actions.more' | translate }}\n <svg class=\"cds--btn__icon\" cdsIcon=\"overflow-menu--vertical\" size=\"16\"></svg>\n </button>\n\n <v-overflow-menu-option\n optionId=\"exportBuildingBlock\"\n (selected)=\"export()\"\n [disabled]=\"(actionInProgress$ | async) || (exporting$ | async)\"\n >\n {{\n 'buildingBlockManagement.overflowMenu.export'\n | translate: {value: buildingBlockName$ | async}\n }}\n </v-overflow-menu-option>\n\n <v-overflow-menu-option\n *ngIf=\"!obs.isFinal\"\n [disabled]=\"actionInProgress$ | async\"\n (selected)=\"finalizeDraft()\"\n >\n {{ 'buildingBlockManagement.actions.makeFinal' | translate }}\n </v-overflow-menu-option>\n\n <v-overflow-menu-option\n *ngIf=\"obs.isFinal\"\n [disabled]=\"actionInProgress$ | async\"\n (selected)=\"openDraftModal()\"\n >\n {{ 'buildingBlockManagement.actions.createDraft' | translate }}\n </v-overflow-menu-option>\n </v-overflow-menu>\n </div>\n</div>\n\n<ng-template #exportingMessage>\n <div class=\"exporting-message\">\n <span class=\"cds--inline-notification__title\">{{\n 'buildingBlockManagement.overflowMenu.preparingDownload' | translate\n }}</span>\n <cds-loading size=\"sm\"></cds-loading>\n </div>\n</ng-template>\n\n<cds-modal\n *ngIf=\"{open: showDraftModal$ | async} as obs\"\n [open]=\"obs.open\"\n showFooter=\"true\"\n valtimoCdsModal\n (close)=\"closeDraftModal()\"\n>\n <cds-modal-header showCloseButton=\"true\" (closeSelect)=\"closeDraftModal()\">\n <h3 cdsModalHeaderHeading>\n {{ 'buildingBlockManagement.actions.draft.title' | translate }}\n </h3>\n </cds-modal-header>\n\n <form [formGroup]=\"draftForm\" cdsModalContent class=\"bb-management-actions__modal\" [cdsLayer]=\"1\">\n <div class=\"cds--text-input__field-wrapper\">\n <cds-label\n [disabled]=\"draftForm.disabled\"\n [invalid]=\"versionTag.touched && versionTag.invalid\"\n >\n <span class=\"label-with-tooltip select-label\">\n {{ 'buildingBlockManagement.actions.draft.version' | translate }}\n </span>\n\n <input\n formControlName=\"versionTag\"\n cdsText\n placeholder=\"{{ 'buildingBlockManagement.actions.draft.placeholder' | translate }}\"\n />\n </cds-label>\n </div>\n </form>\n\n <cds-modal-footer>\n <button cdsButton=\"secondary\" (click)=\"closeDraftModal()\">\n {{ 'interface.cancel' | translate }}\n </button>\n\n <button\n cdsButton=\"primary\"\n [disabled]=\"draftForm.invalid || (actionInProgress$ | async)\"\n (click)=\"createDraft()\"\n >\n {{ 'buildingBlockManagement.actions.draft.confirm' | translate }}\n </button>\n </cds-modal-footer>\n</cds-modal>\n", styles: [".building-block-actions{display:flex;width:100%;justify-content:space-between;align-items:flex-end}.building-block-actions ::ng-deep .version-selection{width:160px}.building-block-actions ::ng-deep .version-selection .cds--list-box__selection{display:none}.bb-management-actions__modal{min-width:320px}.building-block-metadata{display:flex;gap:24px;align-items:flex-end}.building-block-buttons{display:flex;align-items:center;gap:16px}::ng-deep .cds--list-box__field{display:flex;justify-content:space-between}::ng-deep .cds--list-box__menu-item__option{display:flex;justify-content:space-between;padding-inline-end:0}::ng-deep .cds--list-box__menu-item__option>div{margin-top:-4px}.full-width-notification{max-inline-size:100%;min-inline-size:100%}::ng-deep .cds--text-input__field-wrapper cds-label{width:100%}.exporting-message{display:flex;align-items:center;gap:8px}\n"] }]
1649
+ }], ctorParameters: () => [{ type: BuildingBlockManagementApiService }, { type: BuildingBlockManagementDetailService }, { type: i2$1.FormBuilder }, { type: i5.GlobalNotificationService }, { type: i2$2.TranslateService }, { type: Document, decorators: [{
1650
+ type: Inject,
1651
+ args: [DOCUMENT]
1652
+ }] }], propDecorators: { _exportMessageTemplateRef: [{
1653
+ type: ViewChild,
1654
+ args: ['exportingMessage']
1655
+ }] } });
1656
+
1657
+ /*
1658
+ * Copyright 2015-2026 Ritense BV, the Netherlands.
1659
+ *
1660
+ * Licensed under EUPL, Version 1.2 (the "License");
1661
+ * you may not use this file except in compliance with the License.
1662
+ * You may obtain a copy of the License at
1663
+ *
1664
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1665
+ *
1666
+ * Unless required by applicable law or agreed to in writing, software
1667
+ * distributed under the License is distributed on an "AS IS" basis,
1668
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1669
+ * See the License for the specific language governing permissions and
1670
+ * limitations under the License.
1671
+ */
1672
+ class BuildingBlockManagementFormsComponent {
1673
+ get _partialPagination() {
1674
+ return this._partialPagination$.getValue();
1675
+ }
1676
+ constructor(buildingBlockManagementDetailService, buildingBlockManagementApiService, translateService, iconService, router, notificationService) {
1677
+ this.buildingBlockManagementDetailService = buildingBlockManagementDetailService;
1678
+ this.buildingBlockManagementApiService = buildingBlockManagementApiService;
1679
+ this.translateService = translateService;
1680
+ this.iconService = iconService;
1681
+ this.router = router;
1682
+ this.notificationService = notificationService;
1683
+ this.$loading = signal(true);
1684
+ this._buildingBlockFormDefinitions$ = new BehaviorSubject([]);
1685
+ this._buildingBlockFormDefinitionItems = [];
1686
+ this.buildingBlockFormDefinitionItems$ = combineLatest([this._buildingBlockFormDefinitions$, this.translateService.stream('key')]).pipe(map(([formDefinitions]) => formDefinitions.map(definition => ({
1687
+ ...definition,
1688
+ readOnlyText: definition.readOnly
1689
+ ? this.translateService.instant('formManagement.readOnly')
1690
+ : '',
1691
+ }))), tap(buildingBlockFormDefinitionItems => (this._buildingBlockFormDefinitionItems = buildingBlockFormDefinitionItems)));
1692
+ this.FIELDS = [
1693
+ { key: 'name', label: 'buildingBlockManagement.formDefinition.name' },
1694
+ {
1695
+ key: 'readOnlyText',
1696
+ label: '',
1697
+ viewType: ViewType.TAGS,
1698
+ },
1699
+ ];
1700
+ this.onDeleteClick = (form) => {
1701
+ this._formToDelete = form;
1702
+ this.showDeleteModal$.next(true);
1703
+ };
1704
+ this.ACTION_ITEMS = [
1705
+ {
1706
+ label: 'interface.edit',
1707
+ callback: this.onEditClick.bind(this),
1708
+ type: 'normal',
1709
+ disabledCallback: this.editDisabled.bind(this),
1710
+ },
1711
+ {
1712
+ label: 'interface.delete',
1713
+ callback: this.onDeleteClick,
1714
+ type: 'danger',
1715
+ disabledCallback: this.deleteDisabled.bind(this),
1716
+ },
1717
+ ];
1718
+ this.isFinal$ = this.buildingBlockManagementDetailService.isFinal$;
1719
+ this.showCreateModal$ = new BehaviorSubject(false);
1720
+ this.showDeleteModal$ = new BehaviorSubject(false);
1721
+ this.upload$ = new BehaviorSubject(false);
1722
+ this._collectionSize$ = new BehaviorSubject(0);
1723
+ this._partialPagination$ = new BehaviorSubject({
1724
+ page: 1,
1725
+ size: 10,
1726
+ });
1727
+ this.pagination$ = combineLatest([
1728
+ this._collectionSize$,
1729
+ this._partialPagination$,
1730
+ ]).pipe(map(([collectionSize, partialPagination]) => ({ ...partialPagination, collectionSize })));
1731
+ this.searchTerm$ = new BehaviorSubject('');
1732
+ this._subscriptions = new Subscription();
1733
+ this._isFinal = false;
1734
+ this.iconService.registerAll([Upload16, Add16]);
1735
+ }
1736
+ ngOnInit() {
1737
+ this._subscriptions.add(combineLatest([
1738
+ this.buildingBlockManagementDetailService.buildingBlockDefinitionKey$,
1739
+ this.buildingBlockManagementDetailService.buildingBlockDefinitionVersionTag$,
1740
+ ])
1741
+ .pipe(distinctUntilChanged((a, b) => isEqual(a, b)), tap(() => this.$loading.set(true)), switchMap(([key, versionTag]) => combineLatest([
1742
+ this.buildingBlockManagementDetailService.reloadFormDefinitions$,
1743
+ this._partialPagination$,
1744
+ this.searchTerm$,
1745
+ ]).pipe(tap(() => this.$loading.set(true)), switchMap(([, pagination, searchTerm]) => this.buildingBlockManagementApiService.getBuildingBlockFormDefinitions(key, versionTag, {
1746
+ page: (pagination?.page ?? 1) - 1,
1747
+ size: pagination?.size ?? 10,
1748
+ ...(searchTerm && { searchTerm }),
1749
+ })))), tap(response => {
1750
+ this._collectionSize$.next(response?.totalElements ?? 0);
1751
+ this._buildingBlockFormDefinitions$.next(response?.content ?? []);
1752
+ this.$loading.set(false);
1753
+ }))
1754
+ .subscribe());
1755
+ this._subscriptions.add(this.isFinal$.subscribe(isFinal => (this._isFinal = isFinal)));
1756
+ }
1757
+ ngOnDestroy() {
1758
+ this._subscriptions.unsubscribe();
1759
+ }
1760
+ onRowClick(formDefinition) {
1761
+ this.navigateToFormDefinition(formDefinition.id);
1762
+ }
1763
+ navigateToFormDefinition(formDefinitionId, upload = false) {
1764
+ this.router.navigate([
1765
+ '/building-block-management',
1766
+ 'building-block',
1767
+ this.buildingBlockManagementDetailService.buildingBlockDefinitionKey,
1768
+ 'version',
1769
+ this.buildingBlockManagementDetailService.buildingBlockDefinitionVersionTag,
1770
+ BUILDING_BLOCK_MANAGEMENT_TABS.FORMS,
1771
+ formDefinitionId,
1772
+ ], { queryParams: { ...(upload && { upload: true }) } });
1773
+ }
1774
+ onCreateClick() {
1775
+ this.showCreateModal$.next(true);
1776
+ }
1777
+ onUploadClick() {
1778
+ this.upload$.next(true);
1779
+ this.showCreateModal$.next(true);
1780
+ }
1781
+ onGoBackFromCreateEvent() {
1782
+ this.showCreateModal$.next(false);
1783
+ this.upload$.next(false);
1784
+ }
1785
+ onFormDefinitionCreateEvent(formDefinitionId) {
1786
+ this.showCreateModal$.next(false);
1787
+ this.notificationService.showToast({
1788
+ type: 'success',
1789
+ title: this.translateService.instant('formManagement.notifications.created'),
1790
+ });
1791
+ this.navigateToFormDefinition(formDefinitionId);
1792
+ }
1793
+ onFormDefinitionUploadEvent(formDefinitionId) {
1794
+ this.showCreateModal$.next(false);
1795
+ this.upload$.next(false);
1796
+ this.notificationService.showToast({
1797
+ type: 'success',
1798
+ title: this.translateService.instant('formManagement.notifications.created'),
1799
+ });
1800
+ this.navigateToFormDefinition(formDefinitionId, true);
1801
+ }
1802
+ onEditClick(form) {
1803
+ this.onRowClick(form);
1804
+ }
1805
+ onDeleteConfirm() {
1806
+ if (!this._formToDelete)
1807
+ return;
1808
+ this.$loading.set(true);
1809
+ this.buildingBlockManagementApiService
1810
+ .deleteBuildingBlockFormDefinition(this.buildingBlockManagementDetailService.buildingBlockDefinitionKey, this.buildingBlockManagementDetailService.buildingBlockDefinitionVersionTag, this._formToDelete.id)
1811
+ .subscribe({
1812
+ next: () => {
1813
+ this.notificationService.showToast({
1814
+ type: 'success',
1815
+ title: this.translateService.instant('formManagement.notifications.deleted'),
1816
+ });
1817
+ this.buildingBlockManagementDetailService.reloadFormDefinitions();
1818
+ },
1819
+ error: () => {
1820
+ this.notificationService.showToast({
1821
+ type: 'error',
1822
+ title: this.translateService.instant('formManagement.notifications.deletionError'),
1823
+ });
1824
+ this.$loading.set(false);
1825
+ },
1826
+ });
1827
+ }
1828
+ paginationClicked(page) {
1829
+ this.updatePagination({ page });
1830
+ }
1831
+ paginationSet(size) {
1832
+ this.updatePagination({ size, page: 1 });
1833
+ }
1834
+ searchTermEntered(searchTerm) {
1835
+ this.searchTerm$.next(searchTerm);
1836
+ }
1837
+ updatePagination(update) {
1838
+ this._partialPagination$.next({ ...this._partialPagination, ...update });
1839
+ }
1840
+ editDisabled() {
1841
+ return this._isFinal;
1842
+ }
1843
+ deleteDisabled(form) {
1844
+ return form.readOnly || this._isFinal;
1845
+ }
1846
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: BuildingBlockManagementFormsComponent, deps: [{ token: BuildingBlockManagementDetailService }, { token: BuildingBlockManagementApiService }, { token: i2$2.TranslateService }, { token: i3$1.IconService }, { token: i3.Router }, { token: i5.GlobalNotificationService }], target: i0.ɵɵFactoryTarget.Component }); }
1847
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.20", type: BuildingBlockManagementFormsComponent, isStandalone: true, selector: "valtimo-building-block-management-forms", ngImport: i0, template: "<!--\n ~ Copyright 2015-2026 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]=\"FIELDS\"\n [actionItems]=\"ACTION_ITEMS\"\n [items]=\"buildingBlockFormDefinitionItems$ | async\"\n [loading]=\"$loading()\"\n [pagination]=\"pagination$ | async\"\n (rowClicked)=\"onRowClick($event)\"\n (paginationClicked)=\"paginationClicked($event)\"\n (paginationSet)=\"paginationSet($event)\"\n (searchStringSubmit)=\"searchTermEntered($event)\"\n>\n <div carbonToolbarContent>\n <div class=\"valtimo-building-block-management-list__actions\">\n <button\n cdsButton=\"ghost\"\n [iconOnly]=\"true\"\n (click)=\"onUploadClick()\"\n [disabled]=\"(isFinal$ | async) || $loading()\"\n >\n <svg cdsIcon=\"upload\" size=\"16\"></svg>\n </button>\n\n <button\n cdsButton=\"primary\"\n (click)=\"onCreateClick()\"\n [disabled]=\"(isFinal$ | async) || $loading()\"\n >\n {{ 'interface.create' | translate }}\n\n <svg cdsIcon=\"add\" size=\"16\" class=\"cds--btn__icon\"></svg>\n </button>\n </div>\n </div>\n</valtimo-carbon-list>\n\n<valtimo-form-management-create\n *ngIf=\"showCreateModal$ | async\"\n [upload]=\"upload$ | async\"\n (goBackEvent)=\"onGoBackFromCreateEvent()\"\n (afterCreateEvent)=\"onFormDefinitionCreateEvent($event)\"\n (afterUploadEvent)=\"onFormDefinitionUploadEvent($event)\"\n></valtimo-form-management-create>\n\n<valtimo-confirmation-modal\n confirmButtonTextTranslationKey=\"interface.delete\"\n confirmButtonType=\"danger\"\n contentTranslationKey=\"formManagement.deleteModal.content\"\n [showModalSubject$]=\"showDeleteModal$\"\n titleTranslationKey=\"formManagement.deleteModal.title\"\n (confirmEvent)=\"onDeleteConfirm()\"\n></valtimo-confirmation-modal>\n", styles: [":host{display:block}.valtimo-building-block-management-list__actions{display:flex;gap:.5rem}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }, { kind: "ngmodule", type: CarbonListModule }, { kind: "component", type: i7.CarbonListComponent, selector: "valtimo-carbon-list", inputs: ["items", "fields", "tableTranslations", "paginatorConfig", "pagination", "loading", "skeletonRowCount", "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: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i2$2.TranslatePipe, name: "translate" }, { kind: "ngmodule", type: ButtonModule }, { kind: "directive", type: i3$1.Button, selector: "[cdsButton], [ibmButton]", inputs: ["ibmButton", "cdsButton", "size", "skeleton", "iconOnly", "isExpressive"] }, { kind: "ngmodule", type: IconModule }, { kind: "directive", type: i3$1.IconDirective, selector: "[cdsIcon], [ibmIcon]", inputs: ["ibmIcon", "cdsIcon", "size", "title", "ariaLabel", "ariaLabelledBy", "ariaHidden", "isFocusable"] }, { kind: "ngmodule", type: ConfirmationModalModule }, { kind: "component", type: i7.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: FormManagementCreateComponent, selector: "valtimo-form-management-create", inputs: ["upload"], outputs: ["goBackEvent", "afterCreateEvent", "afterUploadEvent"] }] }); }
1848
+ }
1849
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: BuildingBlockManagementFormsComponent, decorators: [{
1850
+ type: Component,
1851
+ args: [{ standalone: true, selector: 'valtimo-building-block-management-forms', imports: [
1852
+ CommonModule,
1853
+ CarbonListModule,
1854
+ TranslateModule,
1855
+ ButtonModule,
1856
+ IconModule,
1857
+ ConfirmationModalModule,
1858
+ FormManagementCreateComponent,
1859
+ ], template: "<!--\n ~ Copyright 2015-2026 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]=\"FIELDS\"\n [actionItems]=\"ACTION_ITEMS\"\n [items]=\"buildingBlockFormDefinitionItems$ | async\"\n [loading]=\"$loading()\"\n [pagination]=\"pagination$ | async\"\n (rowClicked)=\"onRowClick($event)\"\n (paginationClicked)=\"paginationClicked($event)\"\n (paginationSet)=\"paginationSet($event)\"\n (searchStringSubmit)=\"searchTermEntered($event)\"\n>\n <div carbonToolbarContent>\n <div class=\"valtimo-building-block-management-list__actions\">\n <button\n cdsButton=\"ghost\"\n [iconOnly]=\"true\"\n (click)=\"onUploadClick()\"\n [disabled]=\"(isFinal$ | async) || $loading()\"\n >\n <svg cdsIcon=\"upload\" size=\"16\"></svg>\n </button>\n\n <button\n cdsButton=\"primary\"\n (click)=\"onCreateClick()\"\n [disabled]=\"(isFinal$ | async) || $loading()\"\n >\n {{ 'interface.create' | translate }}\n\n <svg cdsIcon=\"add\" size=\"16\" class=\"cds--btn__icon\"></svg>\n </button>\n </div>\n </div>\n</valtimo-carbon-list>\n\n<valtimo-form-management-create\n *ngIf=\"showCreateModal$ | async\"\n [upload]=\"upload$ | async\"\n (goBackEvent)=\"onGoBackFromCreateEvent()\"\n (afterCreateEvent)=\"onFormDefinitionCreateEvent($event)\"\n (afterUploadEvent)=\"onFormDefinitionUploadEvent($event)\"\n></valtimo-form-management-create>\n\n<valtimo-confirmation-modal\n confirmButtonTextTranslationKey=\"interface.delete\"\n confirmButtonType=\"danger\"\n contentTranslationKey=\"formManagement.deleteModal.content\"\n [showModalSubject$]=\"showDeleteModal$\"\n titleTranslationKey=\"formManagement.deleteModal.title\"\n (confirmEvent)=\"onDeleteConfirm()\"\n></valtimo-confirmation-modal>\n", styles: [":host{display:block}.valtimo-building-block-management-list__actions{display:flex;gap:.5rem}\n"] }]
1860
+ }], ctorParameters: () => [{ type: BuildingBlockManagementDetailService }, { type: BuildingBlockManagementApiService }, { type: i2$2.TranslateService }, { type: i3$1.IconService }, { type: i3.Router }, { type: i5.GlobalNotificationService }] });
1861
+
1862
+ /*
1863
+ * Copyright 2015-2026 Ritense BV, the Netherlands.
1864
+ *
1865
+ * Licensed under EUPL, Version 1.2 (the "License");
1866
+ * you may not use this file except in compliance with the License.
1867
+ * You may obtain a copy of the License at
1868
+ *
1869
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1870
+ *
1871
+ * Unless required by applicable law or agreed to in writing, software
1872
+ * distributed under the License is distributed on an "AS IS" basis,
1873
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1874
+ * See the License for the specific language governing permissions and
1875
+ * limitations under the License.
1876
+ */
1877
+ class BuildingBlockManagementFormFlowsComponent {
1878
+ constructor(buildingBlockManagementDetailService, buildingBlockManagementApiService, translateService, iconService, router, notificationService) {
1879
+ this.buildingBlockManagementDetailService = buildingBlockManagementDetailService;
1880
+ this.buildingBlockManagementApiService = buildingBlockManagementApiService;
1881
+ this.translateService = translateService;
1882
+ this.iconService = iconService;
1883
+ this.router = router;
1884
+ this.notificationService = notificationService;
1885
+ this.$loading = signal(true);
1886
+ this._formFlowDefinitions$ = new BehaviorSubject([]);
1887
+ this._formFlowDefinitionItems = [];
1888
+ this.formFlowDefinitionItems$ = combineLatest([
1889
+ this._formFlowDefinitions$,
1890
+ this.translateService.stream('key'),
1891
+ ]).pipe(map(([definitions]) => definitions.map(definition => ({
1892
+ ...definition,
1893
+ latestVersion: definition.versions?.[0] ?? 0,
1894
+ }))), tap(items => (this._formFlowDefinitionItems = items)));
1895
+ this.FIELDS = [
1896
+ { key: 'key', label: 'formFlow.key' },
1897
+ { key: 'latestVersion', label: 'formFlow.version' },
1898
+ {
1899
+ viewType: ViewType.BOOLEAN,
1900
+ key: 'readOnly',
1901
+ label: 'formFlow.readOnly',
1902
+ },
1903
+ ];
1904
+ this.onDeleteClick = (formFlow) => {
1905
+ this._formFlowToDelete = formFlow;
1906
+ this.showDeleteModal$.next(true);
1907
+ };
1908
+ this.ACTION_ITEMS = [
1909
+ {
1910
+ label: 'interface.edit',
1911
+ callback: this.onEditClick.bind(this),
1912
+ type: 'normal',
1913
+ disabledCallback: this.editDisabled.bind(this),
1914
+ },
1915
+ {
1916
+ label: 'interface.delete',
1917
+ callback: this.onDeleteClick,
1918
+ type: 'danger',
1919
+ disabledCallback: this.deleteDisabled.bind(this),
1920
+ },
1921
+ ];
1922
+ this.isFinal$ = this.buildingBlockManagementDetailService.isFinal$;
1923
+ this.showCreateModal$ = new BehaviorSubject(false);
1924
+ this.showDeleteModal$ = new BehaviorSubject(false);
1925
+ this._refresh$ = new BehaviorSubject(null);
1926
+ this._subscriptions = new Subscription();
1927
+ this._isFinal = false;
1928
+ this.iconService.registerAll([Add16]);
1929
+ }
1930
+ ngOnInit() {
1931
+ this._subscriptions.add(combineLatest([
1932
+ this.buildingBlockManagementDetailService.buildingBlockDefinitionKey$,
1933
+ this.buildingBlockManagementDetailService.buildingBlockDefinitionVersionTag$,
1934
+ ])
1935
+ .pipe(distinctUntilChanged((a, b) => isEqual(a, b)), tap(() => this.$loading.set(true)), switchMap(([key, versionTag]) => combineLatest([this.buildingBlockManagementDetailService.reloadFormFlowDefinitions$, this._refresh$]).pipe(tap(() => this.$loading.set(true)), switchMap(() => this.buildingBlockManagementApiService.getBuildingBlockFormFlowDefinitions(key, versionTag)))), tap(response => {
1936
+ this._formFlowDefinitions$.next(response?.content ?? []);
1937
+ this.$loading.set(false);
1938
+ }))
1939
+ .subscribe());
1940
+ this._subscriptions.add(this.isFinal$.subscribe(isFinal => (this._isFinal = isFinal)));
1941
+ }
1942
+ ngOnDestroy() {
1943
+ this._subscriptions.unsubscribe();
1944
+ }
1945
+ onRowClick(formFlow) {
1946
+ this.navigateToFormFlowEditor(formFlow.key);
1947
+ }
1948
+ navigateToFormFlowEditor(formFlowDefinitionKey) {
1949
+ this.router.navigate([
1950
+ '/building-block-management',
1951
+ 'building-block',
1952
+ this.buildingBlockManagementDetailService.buildingBlockDefinitionKey,
1953
+ 'version',
1954
+ this.buildingBlockManagementDetailService.buildingBlockDefinitionVersionTag,
1955
+ BUILDING_BLOCK_MANAGEMENT_TABS.FORM_FLOWS,
1956
+ formFlowDefinitionKey,
1957
+ ]);
1958
+ }
1959
+ onCreateClick() {
1960
+ this.showCreateModal$.next(true);
1961
+ }
1962
+ onAdd(formFlowDefinition) {
1963
+ this.showCreateModal$.next(false);
1964
+ if (!formFlowDefinition)
1965
+ return;
1966
+ this.$loading.set(true);
1967
+ this.buildingBlockManagementApiService
1968
+ .createBuildingBlockFormFlowDefinition(this.buildingBlockManagementDetailService.buildingBlockDefinitionKey, this.buildingBlockManagementDetailService.buildingBlockDefinitionVersionTag, formFlowDefinition)
1969
+ .subscribe({
1970
+ next: (result) => {
1971
+ this.navigateToFormFlowEditor(result.key);
1972
+ },
1973
+ error: () => {
1974
+ this.$loading.set(false);
1975
+ },
1976
+ });
1977
+ }
1978
+ onEditClick(formFlow) {
1979
+ this.onRowClick(formFlow);
1980
+ }
1981
+ onDeleteConfirm() {
1982
+ if (!this._formFlowToDelete)
1983
+ return;
1984
+ this.$loading.set(true);
1985
+ this.buildingBlockManagementApiService
1986
+ .deleteBuildingBlockFormFlowDefinition(this.buildingBlockManagementDetailService.buildingBlockDefinitionKey, this.buildingBlockManagementDetailService.buildingBlockDefinitionVersionTag, this._formFlowToDelete.key)
1987
+ .subscribe({
1988
+ next: () => {
1989
+ this.notificationService.showToast({
1990
+ type: 'success',
1991
+ title: this.translateService.instant('formFlow.deletedSuccessfully', {
1992
+ key: this._formFlowToDelete.key,
1993
+ }),
1994
+ });
1995
+ this._refresh$.next(null);
1996
+ },
1997
+ error: () => {
1998
+ this.$loading.set(false);
1999
+ },
2000
+ });
2001
+ }
2002
+ editDisabled() {
2003
+ return this._isFinal;
2004
+ }
2005
+ deleteDisabled(formFlow) {
2006
+ return !!formFlow.readOnly || this._isFinal;
2007
+ }
2008
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: BuildingBlockManagementFormFlowsComponent, deps: [{ token: BuildingBlockManagementDetailService }, { token: BuildingBlockManagementApiService }, { token: i2$2.TranslateService }, { token: i3$1.IconService }, { token: i3.Router }, { token: i5.GlobalNotificationService }], target: i0.ɵɵFactoryTarget.Component }); }
2009
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.20", type: BuildingBlockManagementFormFlowsComponent, isStandalone: true, selector: "valtimo-building-block-management-form-flows", ngImport: i0, template: "<!--\n ~ Copyright 2015-2026 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]=\"FIELDS\"\n [actionItems]=\"ACTION_ITEMS\"\n [items]=\"formFlowDefinitionItems$ | async\"\n [loading]=\"$loading()\"\n (rowClicked)=\"onRowClick($event)\"\n>\n <div carbonToolbarContent>\n <ng-container [ngTemplateOutlet]=\"addFormFlowButton\"></ng-container>\n </div>\n\n <valtimo-no-results\n [action]=\"addFormFlowButton\"\n description=\"{{ 'formFlow.noResults.description' | translate }}\"\n title=\"{{ 'formFlow.noResults.title' | translate }}\"\n ></valtimo-no-results>\n</valtimo-carbon-list>\n\n<ng-template #addFormFlowButton>\n <button\n cdsButton=\"primary\"\n (click)=\"onCreateClick()\"\n [disabled]=\"(isFinal$ | async) || $loading()\"\n >\n {{ 'formFlow.add' | translate }}\n\n <svg cdsIcon=\"add\" size=\"16\" class=\"cds--btn__icon\"></svg>\n </button>\n</ng-template>\n\n<valtimo-new-form-flow-modal\n [open]=\"showCreateModal$ | async\"\n (closeEvent)=\"onAdd($event)\"\n></valtimo-new-form-flow-modal>\n\n<valtimo-confirmation-modal\n confirmButtonTextTranslationKey=\"interface.delete\"\n confirmButtonType=\"danger\"\n contentTranslationKey=\"formFlow.deleteModalContent\"\n [showModalSubject$]=\"showDeleteModal$\"\n titleTranslationKey=\"interface.delete\"\n (confirmEvent)=\"onDeleteConfirm()\"\n></valtimo-confirmation-modal>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i4.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }, { kind: "ngmodule", type: CarbonListModule }, { kind: "component", type: i7.CarbonListComponent, selector: "valtimo-carbon-list", inputs: ["items", "fields", "tableTranslations", "paginatorConfig", "pagination", "loading", "skeletonRowCount", "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: i7.CarbonNoResultsComponent, selector: "valtimo-no-results", inputs: ["action", "description", "illustration", "title", "smallPadding", "collapseVertically", "alwaysRenderVertically"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i2$2.TranslatePipe, name: "translate" }, { kind: "ngmodule", type: ButtonModule }, { kind: "directive", type: i3$1.Button, selector: "[cdsButton], [ibmButton]", inputs: ["ibmButton", "cdsButton", "size", "skeleton", "iconOnly", "isExpressive"] }, { kind: "ngmodule", type: IconModule }, { kind: "directive", type: i3$1.IconDirective, selector: "[cdsIcon], [ibmIcon]", inputs: ["ibmIcon", "cdsIcon", "size", "title", "ariaLabel", "ariaLabelledBy", "ariaHidden", "isFocusable"] }, { kind: "ngmodule", type: ConfirmationModalModule }, { kind: "component", type: i7.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: NewFormFlowModalComponent, selector: "valtimo-new-form-flow-modal", inputs: ["open"], outputs: ["closeEvent"] }] }); }
2010
+ }
2011
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: BuildingBlockManagementFormFlowsComponent, decorators: [{
2012
+ type: Component,
2013
+ args: [{ standalone: true, selector: 'valtimo-building-block-management-form-flows', imports: [
2014
+ CommonModule,
2015
+ CarbonListModule,
2016
+ TranslateModule,
2017
+ ButtonModule,
2018
+ IconModule,
2019
+ ConfirmationModalModule,
2020
+ NewFormFlowModalComponent,
2021
+ ], template: "<!--\n ~ Copyright 2015-2026 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]=\"FIELDS\"\n [actionItems]=\"ACTION_ITEMS\"\n [items]=\"formFlowDefinitionItems$ | async\"\n [loading]=\"$loading()\"\n (rowClicked)=\"onRowClick($event)\"\n>\n <div carbonToolbarContent>\n <ng-container [ngTemplateOutlet]=\"addFormFlowButton\"></ng-container>\n </div>\n\n <valtimo-no-results\n [action]=\"addFormFlowButton\"\n description=\"{{ 'formFlow.noResults.description' | translate }}\"\n title=\"{{ 'formFlow.noResults.title' | translate }}\"\n ></valtimo-no-results>\n</valtimo-carbon-list>\n\n<ng-template #addFormFlowButton>\n <button\n cdsButton=\"primary\"\n (click)=\"onCreateClick()\"\n [disabled]=\"(isFinal$ | async) || $loading()\"\n >\n {{ 'formFlow.add' | translate }}\n\n <svg cdsIcon=\"add\" size=\"16\" class=\"cds--btn__icon\"></svg>\n </button>\n</ng-template>\n\n<valtimo-new-form-flow-modal\n [open]=\"showCreateModal$ | async\"\n (closeEvent)=\"onAdd($event)\"\n></valtimo-new-form-flow-modal>\n\n<valtimo-confirmation-modal\n confirmButtonTextTranslationKey=\"interface.delete\"\n confirmButtonType=\"danger\"\n contentTranslationKey=\"formFlow.deleteModalContent\"\n [showModalSubject$]=\"showDeleteModal$\"\n titleTranslationKey=\"interface.delete\"\n (confirmEvent)=\"onDeleteConfirm()\"\n></valtimo-confirmation-modal>\n" }]
2022
+ }], ctorParameters: () => [{ type: BuildingBlockManagementDetailService }, { type: BuildingBlockManagementApiService }, { type: i2$2.TranslateService }, { type: i3$1.IconService }, { type: i3.Router }, { type: i5.GlobalNotificationService }] });
2023
+
2024
+ /*
2025
+ * Copyright 2015-2026 Ritense BV, the Netherlands.
2026
+ *
2027
+ * Licensed under EUPL, Version 1.2 (the "License");
2028
+ * you may not use this file except in compliance with the License.
2029
+ * You may obtain a copy of the License at
2030
+ *
2031
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
2032
+ *
2033
+ * Unless required by applicable law or agreed to in writing, software
2034
+ * distributed under the License is distributed on an "AS IS" basis,
2035
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2036
+ * See the License for the specific language governing permissions and
2037
+ * limitations under the License.
2038
+ */
2039
+ class BuildingBlockManagementDecisionsComponent {
2040
+ constructor(buildingBlockManagementDetailService, buildingBlockManagementApiService, decisionStateService, translateService, iconService, router, notificationService) {
2041
+ this.buildingBlockManagementDetailService = buildingBlockManagementDetailService;
2042
+ this.buildingBlockManagementApiService = buildingBlockManagementApiService;
2043
+ this.decisionStateService = decisionStateService;
2044
+ this.translateService = translateService;
2045
+ this.iconService = iconService;
2046
+ this.router = router;
2047
+ this.notificationService = notificationService;
2048
+ this.$loading = signal(true);
2049
+ this._decisions$ = new BehaviorSubject([]);
2050
+ this.decisions$ = this._decisions$.asObservable();
2051
+ this.FIELDS = [
2052
+ { key: 'key', label: 'Key' },
2053
+ { key: 'name', label: 'Name' },
2054
+ ];
2055
+ this.onDeleteClick = (decision) => {
2056
+ this._decisionToDelete = decision;
2057
+ this.showDeleteModal$.next(true);
2058
+ };
2059
+ this.ACTION_ITEMS = [
2060
+ {
2061
+ label: 'interface.delete',
2062
+ callback: this.onDeleteClick,
2063
+ type: 'danger',
2064
+ disabledCallback: this.deleteDisabled.bind(this),
2065
+ },
2066
+ ];
2067
+ this.isFinal$ = this.buildingBlockManagementDetailService.isFinal$;
2068
+ this.showDeleteModal$ = new BehaviorSubject(false);
2069
+ this._subscriptions = new Subscription();
2070
+ this._isFinal = false;
2071
+ this.iconService.registerAll([Upload16]);
2072
+ }
2073
+ ngOnInit() {
2074
+ this._subscriptions.add(combineLatest([
2075
+ this.buildingBlockManagementDetailService.buildingBlockDefinitionKey$,
2076
+ this.buildingBlockManagementDetailService.buildingBlockDefinitionVersionTag$,
2077
+ ])
2078
+ .pipe(distinctUntilChanged((a, b) => isEqual(a, b)), tap(() => this.$loading.set(true)), switchMap(([key, versionTag]) => this.decisionStateService.refreshDecisions$.pipe(tap(() => this.$loading.set(true)), switchMap(() => this.buildingBlockManagementApiService.getBuildingBlockDecisionDefinitions(key, versionTag)))), tap(decisions => {
2079
+ this._decisions$.next(decisions);
2080
+ this.$loading.set(false);
2081
+ }))
2082
+ .subscribe());
2083
+ this._subscriptions.add(this.isFinal$.subscribe(isFinal => (this._isFinal = isFinal)));
2084
+ }
2085
+ ngOnDestroy() {
2086
+ this._subscriptions.unsubscribe();
2087
+ }
2088
+ onRowClick(decision) {
2089
+ this.router.navigate([
2090
+ '/building-block-management',
2091
+ 'building-block',
2092
+ this.buildingBlockManagementDetailService.buildingBlockDefinitionKey,
2093
+ 'version',
2094
+ this.buildingBlockManagementDetailService.buildingBlockDefinitionVersionTag,
2095
+ BUILDING_BLOCK_MANAGEMENT_TABS.DECISIONS,
2096
+ decision.id,
2097
+ ]);
2098
+ }
2099
+ onDeploySuccessful() {
2100
+ this.decisionStateService.refreshDecisions();
2101
+ }
2102
+ onDeleteConfirm() {
2103
+ if (!this._decisionToDelete)
2104
+ return;
2105
+ this.$loading.set(true);
2106
+ this.buildingBlockManagementApiService
2107
+ .deleteBuildingBlockDecisionDefinition(this.buildingBlockManagementDetailService.buildingBlockDefinitionKey, this.buildingBlockManagementDetailService.buildingBlockDefinitionVersionTag, this._decisionToDelete.key)
2108
+ .subscribe({
2109
+ next: () => {
2110
+ this.notificationService.showToast({
2111
+ type: 'success',
2112
+ title: this.translateService.instant('decisions.deleteSuccess'),
2113
+ });
2114
+ this.decisionStateService.refreshDecisions();
2115
+ },
2116
+ error: () => {
2117
+ this.notificationService.showToast({
2118
+ type: 'error',
2119
+ title: this.translateService.instant('decisions.deleteFailure'),
2120
+ });
2121
+ this.$loading.set(false);
2122
+ },
2123
+ });
2124
+ }
2125
+ deleteDisabled() {
2126
+ return this._isFinal;
2127
+ }
2128
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: BuildingBlockManagementDecisionsComponent, deps: [{ token: BuildingBlockManagementDetailService }, { token: BuildingBlockManagementApiService }, { token: i2$4.DecisionStateService }, { token: i2$2.TranslateService }, { token: i3$1.IconService }, { token: i3.Router }, { token: i5.GlobalNotificationService }], target: i0.ɵɵFactoryTarget.Component }); }
2129
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.20", type: BuildingBlockManagementDecisionsComponent, isStandalone: true, selector: "valtimo-building-block-management-decisions", ngImport: i0, template: "<!--\n ~ Copyright 2015-2026 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]=\"FIELDS\"\n [actionItems]=\"ACTION_ITEMS\"\n [items]=\"decisions$ | async\"\n [loading]=\"$loading()\"\n (rowClicked)=\"onRowClick($event)\"\n>\n <div carbonToolbarContent>\n <div class=\"valtimo-building-block-management-list__actions\">\n <button\n cdsButton=\"ghost\"\n [iconOnly]=\"true\"\n (click)=\"deploy.openModal()\"\n [disabled]=\"(isFinal$ | async) || $loading()\"\n >\n <svg cdsIcon=\"upload\" size=\"16\"></svg>\n </button>\n </div>\n </div>\n</valtimo-carbon-list>\n\n<valtimo-decision-deploy\n #deploy\n (deploySuccessful)=\"onDeploySuccessful()\"\n></valtimo-decision-deploy>\n\n<valtimo-confirmation-modal\n confirmButtonTextTranslationKey=\"interface.delete\"\n confirmButtonType=\"danger\"\n contentTranslationKey=\"decisions.deleteModal.content\"\n [showModalSubject$]=\"showDeleteModal$\"\n titleTranslationKey=\"decisions.deleteModal.title\"\n (confirmEvent)=\"onDeleteConfirm()\"\n></valtimo-confirmation-modal>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }, { kind: "ngmodule", type: CarbonListModule }, { kind: "component", type: i7.CarbonListComponent, selector: "valtimo-carbon-list", inputs: ["items", "fields", "tableTranslations", "paginatorConfig", "pagination", "loading", "skeletonRowCount", "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: "ngmodule", type: TranslateModule }, { kind: "ngmodule", type: ButtonModule }, { kind: "directive", type: i3$1.Button, selector: "[cdsButton], [ibmButton]", inputs: ["ibmButton", "cdsButton", "size", "skeleton", "iconOnly", "isExpressive"] }, { kind: "ngmodule", type: IconModule }, { kind: "directive", type: i3$1.IconDirective, selector: "[cdsIcon], [ibmIcon]", inputs: ["ibmIcon", "cdsIcon", "size", "title", "ariaLabel", "ariaLabelledBy", "ariaHidden", "isFocusable"] }, { kind: "ngmodule", type: ConfirmationModalModule }, { kind: "component", type: i7.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: DecisionDeployComponent, selector: "valtimo-decision-deploy", outputs: ["deploySuccessful"] }] }); }
2130
+ }
2131
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: BuildingBlockManagementDecisionsComponent, decorators: [{
2132
+ type: Component,
2133
+ args: [{ standalone: true, selector: 'valtimo-building-block-management-decisions', imports: [
2134
+ CommonModule,
2135
+ CarbonListModule,
2136
+ TranslateModule,
2137
+ ButtonModule,
2138
+ IconModule,
2139
+ ConfirmationModalModule,
2140
+ DecisionDeployComponent,
2141
+ ], template: "<!--\n ~ Copyright 2015-2026 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]=\"FIELDS\"\n [actionItems]=\"ACTION_ITEMS\"\n [items]=\"decisions$ | async\"\n [loading]=\"$loading()\"\n (rowClicked)=\"onRowClick($event)\"\n>\n <div carbonToolbarContent>\n <div class=\"valtimo-building-block-management-list__actions\">\n <button\n cdsButton=\"ghost\"\n [iconOnly]=\"true\"\n (click)=\"deploy.openModal()\"\n [disabled]=\"(isFinal$ | async) || $loading()\"\n >\n <svg cdsIcon=\"upload\" size=\"16\"></svg>\n </button>\n </div>\n </div>\n</valtimo-carbon-list>\n\n<valtimo-decision-deploy\n #deploy\n (deploySuccessful)=\"onDeploySuccessful()\"\n></valtimo-decision-deploy>\n\n<valtimo-confirmation-modal\n confirmButtonTextTranslationKey=\"interface.delete\"\n confirmButtonType=\"danger\"\n contentTranslationKey=\"decisions.deleteModal.content\"\n [showModalSubject$]=\"showDeleteModal$\"\n titleTranslationKey=\"decisions.deleteModal.title\"\n (confirmEvent)=\"onDeleteConfirm()\"\n></valtimo-confirmation-modal>\n" }]
2142
+ }], ctorParameters: () => [{ type: BuildingBlockManagementDetailService }, { type: BuildingBlockManagementApiService }, { type: i2$4.DecisionStateService }, { type: i2$2.TranslateService }, { type: i3$1.IconService }, { type: i3.Router }, { type: i5.GlobalNotificationService }] });
2143
+
2144
+ /*
2145
+ * Copyright 2015-2026 Ritense BV, the Netherlands.
2146
+ *
2147
+ * Licensed under EUPL, Version 1.2 (the "License");
2148
+ * you may not use this file except in compliance with the License.
2149
+ * You may obtain a copy of the License at
2150
+ *
2151
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
2152
+ *
2153
+ * Unless required by applicable law or agreed to in writing, software
2154
+ * distributed under the License is distributed on an "AS IS" basis,
2155
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2156
+ * See the License for the specific language governing permissions and
2157
+ * limitations under the License.
2158
+ */
2159
+ class BuildingBlockManagementDetailComponent {
2160
+ constructor(route, buildingBlockManagementDetailService, pageTitleService, buildingBlockManagementTabConfig) {
2161
+ this.route = route;
2162
+ this.buildingBlockManagementDetailService = buildingBlockManagementDetailService;
2163
+ this.pageTitleService = pageTitleService;
2164
+ this.buildingBlockManagementTabConfig = buildingBlockManagementTabConfig;
2165
+ this.BUILDING_BLOCK_MANAGEMENT_TABS = BUILDING_BLOCK_MANAGEMENT_TABS;
2166
+ this.activeTabKey$ = this.buildingBlockManagementDetailService.activeTabKey$;
2167
+ this.buildingBlockManagementDetailService.setRoute(this.route);
2168
+ }
2169
+ get customTabs() {
2170
+ return this.toArray(this.buildingBlockManagementTabConfig).map(tab => ({
2171
+ ...tab,
2172
+ enabled$: tab.enabled$ ?? of(true),
2173
+ }));
2174
+ }
2175
+ ngOnInit() {
2176
+ this.pageTitleService.disableReset();
2177
+ }
2178
+ ngOnDestroy() {
2179
+ this.pageTitleService.enableReset();
2180
+ }
2181
+ switchTab(tabKey) {
2182
+ this.activeTabKey$.pipe(take(1)).subscribe(activeTabKey => {
2183
+ if (activeTabKey === tabKey)
2184
+ return;
2185
+ this.buildingBlockManagementDetailService.navigateToTab(tabKey);
2186
+ });
2187
+ }
2188
+ toArray(value) {
2189
+ if (Array.isArray(value))
2190
+ return value;
2191
+ if (value)
2192
+ return [value];
2193
+ return [];
2194
+ }
2195
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: BuildingBlockManagementDetailComponent, deps: [{ token: i3.ActivatedRoute }, { token: BuildingBlockManagementDetailService }, { token: i7.PageTitleService }, { token: BUILDING_BLOCK_MANAGEMENT_TAB_TOKEN, optional: true }], target: i0.ɵɵFactoryTarget.Component }); }
2196
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.20", type: BuildingBlockManagementDetailComponent, isStandalone: true, selector: "valtimo-building-block-management-detail", providers: [BuildingBlockManagementDetailService], ngImport: i0, template: "<!--\n ~ Copyright 2015-2026 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@if (activeTabKey$ | async; as activeTabKey) {\n <cds-tabs type=\"line\">\n @if ({active: activeTabKey === BUILDING_BLOCK_MANAGEMENT_TABS.GENERAL}; as obs) {\n <cds-tab\n [active]=\"obs.active\"\n [heading]=\"'buildingBlockManagement.tabs.general' | translate\"\n (selected)=\"switchTab(BUILDING_BLOCK_MANAGEMENT_TABS.GENERAL)\"\n >\n @if (obs.active) {\n <valtimo-building-block-management-general></valtimo-building-block-management-general>\n }\n </cds-tab>\n }\n\n @if ({active: activeTabKey === BUILDING_BLOCK_MANAGEMENT_TABS.DOCUMENT}; as obs) {\n <cds-tab\n [active]=\"obs.active\"\n [heading]=\"'buildingBlockManagement.tabs.document' | translate\"\n (selected)=\"switchTab(BUILDING_BLOCK_MANAGEMENT_TABS.DOCUMENT)\"\n >\n @if (obs.active) {\n <valtimo-building-block-management-document></valtimo-building-block-management-document>\n }\n </cds-tab>\n }\n\n @if ({active: activeTabKey === BUILDING_BLOCK_MANAGEMENT_TABS.PROCESSES}; as obs) {\n <cds-tab\n [active]=\"obs.active\"\n [heading]=\"'buildingBlockManagement.tabs.processes' | translate\"\n (selected)=\"switchTab(BUILDING_BLOCK_MANAGEMENT_TABS.PROCESSES)\"\n >\n @if (obs.active) {\n <valtimo-building-block-management-processes></valtimo-building-block-management-processes>\n }\n </cds-tab>\n }\n\n @if ({active: activeTabKey === BUILDING_BLOCK_MANAGEMENT_TABS.FORMS}; as obs) {\n <cds-tab\n [active]=\"obs.active\"\n [heading]=\"'buildingBlockManagement.tabs.forms' | translate\"\n (selected)=\"switchTab(BUILDING_BLOCK_MANAGEMENT_TABS.FORMS)\"\n >\n @if (obs.active) {\n <valtimo-building-block-management-forms></valtimo-building-block-management-forms>\n }\n </cds-tab>\n }\n\n @if ({active: activeTabKey === BUILDING_BLOCK_MANAGEMENT_TABS.FORM_FLOWS}; as obs) {\n <cds-tab\n [active]=\"obs.active\"\n [heading]=\"'buildingBlockManagement.tabs.formFlows' | translate\"\n (selected)=\"switchTab(BUILDING_BLOCK_MANAGEMENT_TABS.FORM_FLOWS)\"\n >\n @if (obs.active) {\n <valtimo-building-block-management-form-flows></valtimo-building-block-management-form-flows>\n }\n </cds-tab>\n }\n\n @if ({active: activeTabKey === BUILDING_BLOCK_MANAGEMENT_TABS.DECISIONS}; as obs) {\n <cds-tab\n [active]=\"obs.active\"\n [heading]=\"'buildingBlockManagement.tabs.decisions' | translate\"\n (selected)=\"switchTab(BUILDING_BLOCK_MANAGEMENT_TABS.DECISIONS)\"\n >\n @if (obs.active) {\n <valtimo-building-block-management-decisions></valtimo-building-block-management-decisions>\n }\n </cds-tab>\n }\n\n @for (customTab of customTabs; track customTab.tabRoute) {\n @if ((customTab.enabled$ | async) && {active: activeTabKey === customTab.tabRoute}; as obs) {\n <cds-tab\n [active]=\"obs.active\"\n [heading]=\"customTab.translationKey | translate\"\n (selected)=\"switchTab(customTab.tabRoute)\"\n >\n @if (obs.active) {\n <ng-container *ngComponentOutlet=\"customTab.component\"></ng-container>\n }\n </cds-tab>\n }\n }\n </cds-tabs>\n}\n\n<ng-container renderInPageHeader [fullWidth]=\"true\">\n <ng-template>\n <div class=\"building-block-management-detail__header\">\n <valtimo-building-block-management-detail-actions></valtimo-building-block-management-detail-actions>\n </div>\n </ng-template>\n</ng-container>\n", styles: [".valtimo-building-block-management-list__actions{display:flex}:host ::ng-deep .building-block-management-detail__header{display:flex;align-items:center;gap:.75rem;justify-content:flex-end}:host ::ng-deep .cds--tab-content{margin:0!important;padding-left:0!important;padding-right:0!important;outline:none!important}.building-block-management-header{display:flex;justify-content:space-between}\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: i4.NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInputs", "ngComponentOutletInjector", "ngComponentOutletContent", "ngComponentOutletNgModule", "ngComponentOutletNgModuleFactory"], exportAs: ["ngComponentOutlet"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }, { kind: "ngmodule", type: CarbonListModule }, { kind: "ngmodule", type: ButtonModule }, { kind: "ngmodule", type: IconModule }, { kind: "ngmodule", type: TabsModule }, { kind: "component", type: i3$1.Tabs, selector: "cds-tabs, ibm-tabs", inputs: ["position", "cacheActive", "followFocus", "isNavigation", "ariaLabel", "ariaLabelledby", "type", "theme", "skeleton"] }, { kind: "component", type: i3$1.Tab, selector: "cds-tab, ibm-tab", inputs: ["heading", "title", "context", "active", "disabled", "tabIndex", "id", "cacheActive", "tabContent", "templateContext"], outputs: ["selected"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }, { kind: "component", type: BuildingBlockManagementGeneralComponent, selector: "valtimo-building-block-management-general" }, { kind: "component", type: BuildingBlockManagementDocumentComponent, selector: "valtimo-building-block-management-document" }, { kind: "component", type: BuildingBlockManagementProcessesComponent, selector: "valtimo-building-block-management-processes" }, { kind: "component", type: BuildingBlockManagementFormsComponent, selector: "valtimo-building-block-management-forms" }, { kind: "component", type: BuildingBlockManagementFormFlowsComponent, selector: "valtimo-building-block-management-form-flows" }, { kind: "component", type: BuildingBlockManagementDecisionsComponent, selector: "valtimo-building-block-management-decisions" }, { kind: "directive", type: RenderInPageHeaderDirective, selector: "[renderInPageHeader]", inputs: ["fullWidth"] }, { kind: "component", type: BuildingBlockManagementDetailActionsComponent, selector: "valtimo-building-block-management-detail-actions" }, { kind: "ngmodule", type: DialogModule }] }); }
2197
+ }
2198
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: BuildingBlockManagementDetailComponent, decorators: [{
2199
+ type: Component,
2200
+ args: [{ standalone: true, selector: 'valtimo-building-block-management-detail', imports: [
2201
+ CommonModule,
2202
+ CarbonListModule,
2203
+ ButtonModule,
2204
+ IconModule,
2205
+ TabsModule,
2206
+ TranslatePipe,
2207
+ BuildingBlockManagementGeneralComponent,
2208
+ BuildingBlockManagementDocumentComponent,
2209
+ BuildingBlockManagementProcessesComponent,
2210
+ BuildingBlockManagementFormsComponent,
2211
+ BuildingBlockManagementFormFlowsComponent,
2212
+ BuildingBlockManagementDecisionsComponent,
2213
+ RenderInPageHeaderDirective,
2214
+ BuildingBlockManagementDetailActionsComponent,
2215
+ DialogModule,
2216
+ ], providers: [BuildingBlockManagementDetailService], template: "<!--\n ~ Copyright 2015-2026 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@if (activeTabKey$ | async; as activeTabKey) {\n <cds-tabs type=\"line\">\n @if ({active: activeTabKey === BUILDING_BLOCK_MANAGEMENT_TABS.GENERAL}; as obs) {\n <cds-tab\n [active]=\"obs.active\"\n [heading]=\"'buildingBlockManagement.tabs.general' | translate\"\n (selected)=\"switchTab(BUILDING_BLOCK_MANAGEMENT_TABS.GENERAL)\"\n >\n @if (obs.active) {\n <valtimo-building-block-management-general></valtimo-building-block-management-general>\n }\n </cds-tab>\n }\n\n @if ({active: activeTabKey === BUILDING_BLOCK_MANAGEMENT_TABS.DOCUMENT}; as obs) {\n <cds-tab\n [active]=\"obs.active\"\n [heading]=\"'buildingBlockManagement.tabs.document' | translate\"\n (selected)=\"switchTab(BUILDING_BLOCK_MANAGEMENT_TABS.DOCUMENT)\"\n >\n @if (obs.active) {\n <valtimo-building-block-management-document></valtimo-building-block-management-document>\n }\n </cds-tab>\n }\n\n @if ({active: activeTabKey === BUILDING_BLOCK_MANAGEMENT_TABS.PROCESSES}; as obs) {\n <cds-tab\n [active]=\"obs.active\"\n [heading]=\"'buildingBlockManagement.tabs.processes' | translate\"\n (selected)=\"switchTab(BUILDING_BLOCK_MANAGEMENT_TABS.PROCESSES)\"\n >\n @if (obs.active) {\n <valtimo-building-block-management-processes></valtimo-building-block-management-processes>\n }\n </cds-tab>\n }\n\n @if ({active: activeTabKey === BUILDING_BLOCK_MANAGEMENT_TABS.FORMS}; as obs) {\n <cds-tab\n [active]=\"obs.active\"\n [heading]=\"'buildingBlockManagement.tabs.forms' | translate\"\n (selected)=\"switchTab(BUILDING_BLOCK_MANAGEMENT_TABS.FORMS)\"\n >\n @if (obs.active) {\n <valtimo-building-block-management-forms></valtimo-building-block-management-forms>\n }\n </cds-tab>\n }\n\n @if ({active: activeTabKey === BUILDING_BLOCK_MANAGEMENT_TABS.FORM_FLOWS}; as obs) {\n <cds-tab\n [active]=\"obs.active\"\n [heading]=\"'buildingBlockManagement.tabs.formFlows' | translate\"\n (selected)=\"switchTab(BUILDING_BLOCK_MANAGEMENT_TABS.FORM_FLOWS)\"\n >\n @if (obs.active) {\n <valtimo-building-block-management-form-flows></valtimo-building-block-management-form-flows>\n }\n </cds-tab>\n }\n\n @if ({active: activeTabKey === BUILDING_BLOCK_MANAGEMENT_TABS.DECISIONS}; as obs) {\n <cds-tab\n [active]=\"obs.active\"\n [heading]=\"'buildingBlockManagement.tabs.decisions' | translate\"\n (selected)=\"switchTab(BUILDING_BLOCK_MANAGEMENT_TABS.DECISIONS)\"\n >\n @if (obs.active) {\n <valtimo-building-block-management-decisions></valtimo-building-block-management-decisions>\n }\n </cds-tab>\n }\n\n @for (customTab of customTabs; track customTab.tabRoute) {\n @if ((customTab.enabled$ | async) && {active: activeTabKey === customTab.tabRoute}; as obs) {\n <cds-tab\n [active]=\"obs.active\"\n [heading]=\"customTab.translationKey | translate\"\n (selected)=\"switchTab(customTab.tabRoute)\"\n >\n @if (obs.active) {\n <ng-container *ngComponentOutlet=\"customTab.component\"></ng-container>\n }\n </cds-tab>\n }\n }\n </cds-tabs>\n}\n\n<ng-container renderInPageHeader [fullWidth]=\"true\">\n <ng-template>\n <div class=\"building-block-management-detail__header\">\n <valtimo-building-block-management-detail-actions></valtimo-building-block-management-detail-actions>\n </div>\n </ng-template>\n</ng-container>\n", styles: [".valtimo-building-block-management-list__actions{display:flex}:host ::ng-deep .building-block-management-detail__header{display:flex;align-items:center;gap:.75rem;justify-content:flex-end}:host ::ng-deep .cds--tab-content{margin:0!important;padding-left:0!important;padding-right:0!important;outline:none!important}.building-block-management-header{display:flex;justify-content:space-between}\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"] }]
2217
+ }], ctorParameters: () => [{ type: i3.ActivatedRoute }, { type: BuildingBlockManagementDetailService }, { type: i7.PageTitleService }, { type: undefined, decorators: [{
2218
+ type: Optional
2219
+ }, {
2220
+ type: Inject,
2221
+ args: [BUILDING_BLOCK_MANAGEMENT_TAB_TOKEN]
2222
+ }] }] });
2223
+
2224
+ /*
2225
+ * Copyright 2015-2026 Ritense BV, the Netherlands.
2226
+ *
2227
+ * Licensed under EUPL, Version 1.2 (the "License");
2228
+ * you may not use this file except in compliance with the License.
2229
+ * You may obtain a copy of the License at
2230
+ *
2231
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
2232
+ *
2233
+ * Unless required by applicable law or agreed to in writing, software
2234
+ * distributed under the License is distributed on an "AS IS" basis,
2235
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2236
+ * See the License for the specific language governing permissions and
2237
+ * limitations under the License.
2238
+ */
2239
+ const routes = [
2240
+ {
2241
+ path: 'building-block-management',
2242
+ component: BuildingBlockManagementListComponent,
2243
+ canActivate: [AuthGuardService],
2244
+ data: { title: 'buildingBlockManagement.title', roles: [ROLE_ADMIN] },
2245
+ },
2246
+ {
2247
+ path: 'building-block-management/building-block/:buildingBlockDefinitionKey/version/:buildingBlockDefinitionVersionTag/:tabKey',
2248
+ component: BuildingBlockManagementDetailComponent,
2249
+ canActivate: [AuthGuardService],
2250
+ data: {
2251
+ title: 'buildingBlockManagement.detail.title',
2252
+ roles: [ROLE_ADMIN],
2253
+ customPageTitle: true,
2254
+ context: 'buildingBlock',
2255
+ },
2256
+ },
2257
+ {
2258
+ path: `building-block-management/building-block/:buildingBlockDefinitionKey/version/:buildingBlockDefinitionVersionTag/${BUILDING_BLOCK_MANAGEMENT_TABS.PROCESSES}/create`,
2259
+ component: ProcessManagementBuilderComponent,
2260
+ canActivate: [AuthGuardService],
2261
+ data: {
2262
+ title: 'Create new Process',
2263
+ roles: [ROLE_ADMIN],
2264
+ context: 'buildingBlock',
2265
+ },
2266
+ },
2267
+ {
2268
+ path: `building-block-management/building-block/:buildingBlockDefinitionKey/version/:buildingBlockDefinitionVersionTag/${BUILDING_BLOCK_MANAGEMENT_TABS.PROCESSES}/:processDefinitionKey`,
2269
+ component: ProcessManagementBuilderComponent,
2270
+ canActivate: [AuthGuardService],
2271
+ data: {
2272
+ title: 'Process details',
2273
+ roles: [ROLE_ADMIN],
2274
+ customPageTitle: true,
2275
+ context: 'buildingBlock',
2276
+ },
2277
+ },
2278
+ {
2279
+ path: `building-block-management/building-block/:buildingBlockDefinitionKey/version/:buildingBlockDefinitionVersionTag/${BUILDING_BLOCK_MANAGEMENT_TABS.FORMS}/:formDefinitionId`,
2280
+ component: FormManagementEditComponent,
2281
+ canActivate: [AuthGuardService],
2282
+ data: {
2283
+ title: 'formManagement.edit.title',
2284
+ roles: [ROLE_ADMIN],
2285
+ customPageTitle: true,
2286
+ context: 'buildingBlock',
2287
+ },
2288
+ },
2289
+ {
2290
+ path: `building-block-management/building-block/:buildingBlockDefinitionKey/version/:buildingBlockDefinitionVersionTag/${BUILDING_BLOCK_MANAGEMENT_TABS.FORM_FLOWS}/:formFlowDefinitionKey`,
2291
+ component: FormFlowEditorComponent,
2292
+ canActivate: [AuthGuardService],
2293
+ data: {
2294
+ title: 'formFlow.title',
2295
+ roles: [ROLE_ADMIN],
2296
+ customPageTitle: true,
2297
+ context: 'buildingBlock',
2298
+ },
2299
+ },
2300
+ {
2301
+ path: `building-block-management/building-block/:buildingBlockDefinitionKey/version/:buildingBlockDefinitionVersionTag/${BUILDING_BLOCK_MANAGEMENT_TABS.DECISIONS}/:id`,
2302
+ component: DecisionModelerComponent,
2303
+ canActivate: [AuthGuardService],
2304
+ data: {
2305
+ title: 'Edit decision table',
2306
+ roles: [ROLE_ADMIN],
2307
+ customPageTitle: true,
2308
+ context: 'buildingBlock',
2309
+ },
2310
+ },
2311
+ ];
2312
+ class BuildingBlockManagementRouting {
2313
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: BuildingBlockManagementRouting, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
2314
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.20", ngImport: i0, type: BuildingBlockManagementRouting, imports: [CommonModule, i3.RouterModule], exports: [RouterModule] }); }
2315
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: BuildingBlockManagementRouting, imports: [CommonModule, RouterModule.forChild(routes), RouterModule] }); }
2316
+ }
2317
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: BuildingBlockManagementRouting, decorators: [{
2318
+ type: NgModule,
2319
+ args: [{
2320
+ declarations: [],
2321
+ imports: [CommonModule, RouterModule.forChild(routes)],
2322
+ exports: [RouterModule],
2323
+ }]
2324
+ }] });
2325
+
2326
+ /*
2327
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
2328
+ *
2329
+ * Licensed under EUPL, Version 1.2 (the "License");
2330
+ * you may not use this file except in compliance with the License.
2331
+ * You may obtain a copy of the License at
2332
+ *
2333
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
2334
+ *
2335
+ * Unless required by applicable law or agreed to in writing, software
2336
+ * distributed under the License is distributed on an "AS IS" basis,
2337
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2338
+ * See the License for the specific language governing permissions and
2339
+ * limitations under the License.
2340
+ */
2341
+ class BuildingBlockManagementModule {
2342
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: BuildingBlockManagementModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
2343
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.20", ngImport: i0, type: BuildingBlockManagementModule, imports: [BuildingBlockManagementRouting, BuildingBlockManagementListComponent] }); }
2344
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: BuildingBlockManagementModule, imports: [BuildingBlockManagementRouting, BuildingBlockManagementListComponent] }); }
2345
+ }
2346
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: BuildingBlockManagementModule, decorators: [{
2347
+ type: NgModule,
2348
+ args: [{
2349
+ declarations: [],
2350
+ imports: [BuildingBlockManagementRouting, BuildingBlockManagementListComponent],
2351
+ providers: [],
2352
+ }]
2353
+ }] });
2354
+
2355
+ /*
2356
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
2357
+ *
2358
+ * Licensed under EUPL, Version 1.2 (the "License");
2359
+ * you may not use this file except in compliance with the License.
2360
+ * You may obtain a copy of the License at
2361
+ *
2362
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
2363
+ *
2364
+ * Unless required by applicable law or agreed to in writing, software
2365
+ * distributed under the License is distributed on an "AS IS" basis,
2366
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2367
+ * See the License for the specific language governing permissions and
2368
+ * limitations under the License.
2369
+ */
2370
+ /*
2371
+ * Public API Surface of building-block-management
2372
+ */
2373
+
2374
+ /**
2375
+ * Generated bundle index. Do not edit.
2376
+ */
2377
+
2378
+ export { BuildingBlockManagementApiService, BuildingBlockManagementDetailService, BuildingBlockManagementModule, BuildingBlockManagementService };
2379
+ //# sourceMappingURL=valtimo-building-block-management.mjs.map