@valtimo/object-management 0.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,1634 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Injectable, Input, ViewChild, Component, NgModule } from '@angular/core';
3
+ import * as i1 from '@angular/common/http';
4
+ import * as i4 from '@valtimo/shared';
5
+ import { ROLE_ADMIN } from '@valtimo/shared';
6
+ import * as i2 from '@angular/router';
7
+ import { RouterModule } from '@angular/router';
8
+ import * as i6 from '@angular/common';
9
+ import { CommonModule } from '@angular/common';
10
+ import { AuthGuardService } from '@valtimo/security';
11
+ import { Subject, BehaviorSubject, map, combineLatest, delay, filter, switchMap, tap, startWith, of } from 'rxjs';
12
+ import { take, catchError, tap as tap$1, switchMap as switchMap$1 } from 'rxjs/operators';
13
+ import * as i5 from '@valtimo/components';
14
+ import { DropzoneModule, WidgetModule, VModalModule, FormModule, InputModule, SelectModule, TooltipIconModule, CarbonMultiInputModule, ConfirmationModalModule, SpinnerModule, ModalModule as ModalModule$1, ValtimoCdsModalDirective, CarbonListModule } from '@valtimo/components';
15
+ import * as i7 from 'carbon-components-angular';
16
+ import { InputModule as InputModule$1, ButtonModule, ModalModule, NotificationModule, LoadingModule, DropdownModule, CheckboxModule, LinkModule, IconModule } from 'carbon-components-angular';
17
+ import * as i3 from '@valtimo/form';
18
+ import * as i4$1 from '@valtimo/plugin';
19
+ import * as i3$1 from '@ngx-translate/core';
20
+ import { TranslateModule } from '@ngx-translate/core';
21
+ import * as i9 from '@angular/forms';
22
+ import { FormGroup, FormControl, Validators, ReactiveFormsModule } from '@angular/forms';
23
+ import * as i5$1 from '@angular/platform-browser';
24
+ import * as i3$2 from '@valtimo/form-management';
25
+
26
+ /*
27
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
28
+ *
29
+ * Licensed under EUPL, Version 1.2 (the "License");
30
+ * you may not use this file except in compliance with the License.
31
+ * You may obtain a copy of the License at
32
+ *
33
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
34
+ *
35
+ * Unless required by applicable law or agreed to in writing, software
36
+ * distributed under the License is distributed on an "AS IS" basis,
37
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
38
+ * See the License for the specific language governing permissions and
39
+ * limitations under the License.
40
+ */
41
+
42
+ /*
43
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
44
+ *
45
+ * Licensed under EUPL, Version 1.2 (the "License");
46
+ * you may not use this file except in compliance with the License.
47
+ * You may obtain a copy of the License at
48
+ *
49
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
50
+ *
51
+ * Unless required by applicable law or agreed to in writing, software
52
+ * distributed under the License is distributed on an "AS IS" basis,
53
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
54
+ * See the License for the specific language governing permissions and
55
+ * limitations under the License.
56
+ */
57
+ class ObjectManagementService {
58
+ constructor(http, configService) {
59
+ this.http = http;
60
+ this.valtimoEndpointUri = configService.config.valtimoApi.endpointUri;
61
+ }
62
+ getAllObjects() {
63
+ return this.http.get(`${this.valtimoEndpointUri}v1/object/management/configuration`);
64
+ }
65
+ getObjectById(id) {
66
+ return this.http.get(`${this.valtimoEndpointUri}v1/object/management/configuration/${id}`);
67
+ }
68
+ createObject(payload) {
69
+ return this.http.post(`${this.valtimoEndpointUri}v1/object/management/configuration`, payload);
70
+ }
71
+ editObject(payload) {
72
+ return this.http.put(`${this.valtimoEndpointUri}v1/object/management/configuration`, payload);
73
+ }
74
+ getSearchList(ownerId) {
75
+ return this.http.get(`${this.valtimoEndpointUri}v1/search/list-column/${ownerId}`);
76
+ }
77
+ postSearchList(ownerId, request) {
78
+ return this.http.post(`${this.valtimoEndpointUri}v1/search/list-column/${ownerId}`, { ...request, ownerId });
79
+ }
80
+ putSearchList(ownerId, columnKey, request) {
81
+ return this.http.put(`${this.valtimoEndpointUri}v1/search/list-column/${ownerId}/${columnKey}`, { ...request, ownerId });
82
+ }
83
+ putSearchListColumns(ownerId, request) {
84
+ return this.http.put(`${this.valtimoEndpointUri}v1/search/list-column/${ownerId}/search-list-columns`, [...request]);
85
+ }
86
+ deleteSearchList(ownerId, columnKey) {
87
+ return this.http.delete(`${this.valtimoEndpointUri}v1/search/list-column/${ownerId}/${columnKey}`);
88
+ }
89
+ getSearchField(ownerId) {
90
+ return this.http.get(`${this.valtimoEndpointUri}v1/search/field/Legacy/${ownerId}`);
91
+ }
92
+ postSearchField(ownerId, request) {
93
+ return this.http.post(`${this.valtimoEndpointUri}v1/search/field/${ownerId}`, {
94
+ ...request,
95
+ ownerId,
96
+ });
97
+ }
98
+ putSearchField(ownerId, key, request) {
99
+ return this.http.put(`${this.valtimoEndpointUri}v1/search/field/${ownerId}/${key}`, { ...request, ownerId });
100
+ }
101
+ putSearchFields(ownerId, request) {
102
+ return this.http.put(`${this.valtimoEndpointUri}v1/search/field/${ownerId}/fields`, [...request]);
103
+ }
104
+ deleteSearchField(ownerId, key) {
105
+ return this.http.delete(`${this.valtimoEndpointUri}v1/search/field/Legacy/${ownerId}/${key}`);
106
+ }
107
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: ObjectManagementService, deps: [{ token: i1.HttpClient }, { token: i4.ConfigService }], target: i0.ɵɵFactoryTarget.Injectable }); }
108
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: ObjectManagementService, providedIn: 'root' }); }
109
+ }
110
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: ObjectManagementService, decorators: [{
111
+ type: Injectable,
112
+ args: [{
113
+ providedIn: 'root',
114
+ }]
115
+ }], ctorParameters: () => [{ type: i1.HttpClient }, { type: i4.ConfigService }] });
116
+
117
+ /*
118
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
119
+ *
120
+ * Licensed under EUPL, Version 1.2 (the "License");
121
+ * you may not use this file except in compliance with the License.
122
+ * You may obtain a copy of the License at
123
+ *
124
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
125
+ *
126
+ * Unless required by applicable law or agreed to in writing, software
127
+ * distributed under the License is distributed on an "AS IS" basis,
128
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
129
+ * See the License for the specific language governing permissions and
130
+ * limitations under the License.
131
+ */
132
+ var TabEnum;
133
+ (function (TabEnum) {
134
+ TabEnum["GENERAL"] = "general";
135
+ TabEnum["LIST"] = "list";
136
+ TabEnum["SEARCH"] = "search";
137
+ })(TabEnum || (TabEnum = {}));
138
+
139
+ /*
140
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
141
+ *
142
+ * Licensed under EUPL, Version 1.2 (the "License");
143
+ * you may not use this file except in compliance with the License.
144
+ * You may obtain a copy of the License at
145
+ *
146
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
147
+ *
148
+ * Unless required by applicable law or agreed to in writing, software
149
+ * distributed under the License is distributed on an "AS IS" basis,
150
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
151
+ * See the License for the specific language governing permissions and
152
+ * limitations under the License.
153
+ */
154
+ class ObjectManagementStateService {
155
+ constructor() {
156
+ this._showModal$ = new Subject();
157
+ this._hideModal$ = new Subject();
158
+ this._refresh$ = new BehaviorSubject(null);
159
+ this._modalType$ = new BehaviorSubject('add');
160
+ }
161
+ get showModal$() {
162
+ return this._showModal$.asObservable();
163
+ }
164
+ get hideModal$() {
165
+ return this._hideModal$.asObservable();
166
+ }
167
+ get refresh$() {
168
+ return this._refresh$.asObservable();
169
+ }
170
+ get modalType$() {
171
+ return this._modalType$.asObservable();
172
+ }
173
+ showModal() {
174
+ this._showModal$.next(null);
175
+ }
176
+ hideModal() {
177
+ this._hideModal$.next(null);
178
+ }
179
+ refresh() {
180
+ this._refresh$.next(null);
181
+ }
182
+ setModalType(type) {
183
+ this._modalType$.next(type);
184
+ }
185
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: ObjectManagementStateService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
186
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: ObjectManagementStateService, providedIn: 'root' }); }
187
+ }
188
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: ObjectManagementStateService, decorators: [{
189
+ type: Injectable,
190
+ args: [{
191
+ providedIn: 'root',
192
+ }]
193
+ }], ctorParameters: () => [] });
194
+
195
+ /*
196
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
197
+ *
198
+ * Licensed under EUPL, Version 1.2 (the "License");
199
+ * you may not use this file except in compliance with the License.
200
+ * You may obtain a copy of the License at
201
+ *
202
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
203
+ *
204
+ * Unless required by applicable law or agreed to in writing, software
205
+ * distributed under the License is distributed on an "AS IS" basis,
206
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
207
+ * See the License for the specific language governing permissions and
208
+ * limitations under the License.
209
+ */
210
+ class TabService {
211
+ constructor() {
212
+ this._currentTab$ = new BehaviorSubject(TabEnum.GENERAL);
213
+ }
214
+ get currentTab$() {
215
+ return this._currentTab$.asObservable();
216
+ }
217
+ set currentTab(tab) {
218
+ this._currentTab$.next(tab);
219
+ }
220
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TabService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
221
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TabService, providedIn: 'root' }); }
222
+ }
223
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TabService, decorators: [{
224
+ type: Injectable,
225
+ args: [{
226
+ providedIn: 'root',
227
+ }]
228
+ }] });
229
+
230
+ /*
231
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
232
+ *
233
+ * Licensed under EUPL, Version 1.2 (the "License");
234
+ * you may not use this file except in compliance with the License.
235
+ * You may obtain a copy of the License at
236
+ *
237
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
238
+ *
239
+ * Unless required by applicable law or agreed to in writing, software
240
+ * distributed under the License is distributed on an "AS IS" basis,
241
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
242
+ * See the License for the specific language governing permissions and
243
+ * limitations under the License.
244
+ */
245
+ class ObjectManagementModalComponent {
246
+ constructor(objectManagementState, objectManagementService, formService, pluginManagementService, modalService) {
247
+ this.objectManagementState = objectManagementState;
248
+ this.objectManagementService = objectManagementService;
249
+ this.formService = formService;
250
+ this.pluginManagementService = pluginManagementService;
251
+ this.modalService = modalService;
252
+ this.valid$ = new BehaviorSubject(false);
253
+ this.showForm$ = this.modalService.modalVisible$;
254
+ this.modalType$ = this.objectManagementState.modalType$;
255
+ this.formData$ = new BehaviorSubject(null);
256
+ this.selectedObjecttype$ = new BehaviorSubject(null);
257
+ this.formDefinitions$ = this.formService
258
+ .getAllUnlinkedFormDefinitions()
259
+ .pipe(map(results => results?.map(configuration => ({
260
+ id: configuration.name,
261
+ text: configuration.name,
262
+ }))));
263
+ this.configurationInstances$ = this.pluginManagementService
264
+ .getAllPluginConfigurations()
265
+ .pipe(map(configurations => configurations));
266
+ this.objectsApiConfigurations$ = this.configurationInstances$.pipe(map(configurations => {
267
+ const filteredObjectsApiConfigurations = configurations.filter(configuration => configuration?.pluginDefinition?.key === 'objectenapi');
268
+ return filteredObjectsApiConfigurations.map(configuration => ({
269
+ id: configuration.id,
270
+ text: configuration.title,
271
+ }));
272
+ }));
273
+ this.objecttypesApiConfigurations$ = this.configurationInstances$.pipe(map(configurations => {
274
+ const filteredObjecttypesApiConfigurations = configurations.filter(configuration => configuration?.pluginDefinition?.key === 'objecttypenapi');
275
+ return filteredObjecttypesApiConfigurations.map(configuration => ({
276
+ id: configuration.id,
277
+ text: configuration.title,
278
+ properties: configuration.properties,
279
+ }));
280
+ }));
281
+ }
282
+ ngAfterViewInit() {
283
+ this.openShowSubscription();
284
+ this.openHideSubscription();
285
+ }
286
+ ngOnDestroy() {
287
+ this.showSubscription?.unsubscribe();
288
+ this.hideSubscription?.unsubscribe();
289
+ }
290
+ hide() {
291
+ this.formData$.next(null);
292
+ this.valid$.next(false);
293
+ this.modalService.closeModal();
294
+ }
295
+ cancel() {
296
+ this.hide();
297
+ }
298
+ save() {
299
+ combineLatest([this.valid$, this.formData$, this.modalType$])
300
+ .pipe(take(1))
301
+ .subscribe(([valid, formData, modalType]) => {
302
+ if (valid) {
303
+ if (modalType === 'add') {
304
+ this.objectManagementService.createObject({ ...formData }).subscribe(() => {
305
+ this.objectManagementState.refresh();
306
+ this.objectManagementState.hideModal();
307
+ });
308
+ }
309
+ else if (modalType === 'edit') {
310
+ this.objectManagementService.editObject({ ...formData }).subscribe(() => {
311
+ this.objectManagementState.refresh();
312
+ this.objectManagementState.hideModal();
313
+ });
314
+ }
315
+ }
316
+ });
317
+ }
318
+ openShowSubscription() {
319
+ this.showSubscription = this.objectManagementState.showModal$.subscribe(() => {
320
+ this.show();
321
+ });
322
+ }
323
+ openHideSubscription() {
324
+ this.hideSubscription = this.objectManagementState.hideModal$.subscribe(() => {
325
+ this.hide();
326
+ });
327
+ }
328
+ show() {
329
+ this.objectManagementState.modalType$.pipe(take(1)).subscribe(modalType => {
330
+ if (modalType === 'edit' || modalType === 'add') {
331
+ this.modalService.openModal(this.objectManagementModal);
332
+ }
333
+ });
334
+ }
335
+ formValueChange(data) {
336
+ if (data.showInDataMenu === '') {
337
+ data.showInDataMenu = false;
338
+ }
339
+ this.formData$.next(data);
340
+ this.setValid(data);
341
+ }
342
+ setValid(data) {
343
+ this.valid$.next(!!(data.title &&
344
+ data.objectenApiPluginConfigurationId &&
345
+ data.objecttypenApiPluginConfigurationId &&
346
+ data.objecttypeId &&
347
+ data.objecttypeVersion));
348
+ }
349
+ selectObjectType(objecttype) {
350
+ this.selectedObjecttype$.next(objecttype);
351
+ }
352
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: ObjectManagementModalComponent, deps: [{ token: ObjectManagementStateService }, { token: ObjectManagementService }, { token: i3.FormService }, { token: i4$1.PluginManagementService }, { token: i5.ModalService }], target: i0.ɵɵFactoryTarget.Component }); }
353
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.17", type: ObjectManagementModalComponent, isStandalone: false, selector: "valtimo-object-management-modal", inputs: { prefillObject$: "prefillObject$" }, viewQueries: [{ propertyName: "objectManagementModal", first: true, predicate: ["objectManagementModal"], 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<v-modal\n #objectManagementModal\n *ngIf=\"{\n disabled: disabled$ | async,\n valid: valid$ | async,\n modalType: modalType$ | async,\n prefillObject: prefillObject$ | async,\n } as obs\"\n>\n <div role=\"header\">\n <div class=\"add-title\">\n <h4>\n {{\n (obs.modalType === 'add'\n ? 'objectManagement.createObjecttype'\n : 'objectManagement.editObjecttype'\n ) | translate\n }}\n </h4>\n </div>\n </div>\n <div role=\"content\">\n <ng-container\n *ngTemplateOutlet=\"\n form;\n context: {prefillObject: obs.prefillObject, modalType: obs.modalType}\n \"\n ></ng-container>\n </div>\n <div role=\"footer\">\n <div class=\"buttons\">\n <button cdsButton=\"secondary\" (click)=\"cancel()\" [disabled]=\"obs.disabled\">\n {{ 'objectManagement.cancel' | translate }}\n </button>\n\n <button cdsButton=\"primary\" (click)=\"save()\" [disabled]=\"obs.disabled || !obs.valid\">\n {{\n (obs.modalType === 'add' ? 'objectManagement.add' : 'objectManagement.edit') | translate\n }}\n </button>\n </div>\n </div>\n</v-modal>\n\n<ng-template #form let-prefillObject=\"prefillObject\" let-modalType=\"modalType\">\n <ng-container *ngIf=\"showForm$ | async\">\n <v-form (valueChange)=\"formValueChange($event)\">\n <v-input\n *ngIf=\"modalType === 'edit'\"\n hidden\n [disabled]=\"true\"\n [defaultValue]=\"prefillObject?.id\"\n name=\"id\"\n ></v-input>\n\n <v-input\n [margin]=\"true\"\n [required]=\"true\"\n [title]=\"'objectManagement.labels.title' | translate\"\n [tooltip]=\"'objectManagement.tooltips.title' | translate\"\n [widthPx]=\"350\"\n [defaultValue]=\"prefillObject?.title\"\n name=\"title\"\n ></v-input>\n\n <ng-container\n *ngIf=\"{\n connectionInstances: configurationInstances$ | async,\n objectsApiConfigurations: objectsApiConfigurations$ | async,\n objecttypesApiConfigurations: objecttypesApiConfigurations$ | async,\n } as objectObs\"\n >\n <v-select\n [items]=\"objectObs.objectsApiConfigurations\"\n [margin]=\"true\"\n [widthInPx]=\"350\"\n name=\"objectenApiPluginConfigurationId\"\n [title]=\"'objectManagement.labels.objects' | translate\"\n [defaultSelectionId]=\"prefillObject?.objectenApiPluginConfigurationId\"\n [required]=\"true\"\n ></v-select>\n\n <v-select\n [items]=\"objectObs.objecttypesApiConfigurations\"\n [margin]=\"true\"\n [widthInPx]=\"350\"\n name=\"objecttypenApiPluginConfigurationId\"\n [title]=\"'objectManagement.labels.objecttypes' | translate\"\n [defaultSelectionId]=\"prefillObject?.objecttypenApiPluginConfigurationId\"\n [required]=\"true\"\n (selectedChange)=\"selectObjectType($event)\"\n ></v-select>\n </ng-container>\n\n <v-input\n [margin]=\"true\"\n [required]=\"true\"\n [title]=\"'objectManagement.labels.objecttypeId' | translate\"\n [tooltip]=\"'objectManagement.tooltips.objecttypeId' | translate\"\n [widthPx]=\"350\"\n [defaultValue]=\"prefillObject?.objecttypeId\"\n name=\"objecttypeId\"\n ></v-input>\n\n <v-input\n [margin]=\"true\"\n [required]=\"true\"\n [title]=\"'objectManagement.labels.objecttypeVersion' | translate\"\n [tooltip]=\"'objectManagement.tooltips.objecttypeVersion' | translate\"\n [widthPx]=\"350\"\n [defaultValue]=\"prefillObject?.objecttypeVersion\"\n [min]=\"1\"\n type=\"number\"\n name=\"objecttypeVersion\"\n ></v-input>\n\n <ng-container *ngIf=\"{formDefinitions: formDefinitions$ | async} as formObs\">\n <v-select\n [items]=\"formObs.formDefinitions\"\n [margin]=\"true\"\n [widthInPx]=\"350\"\n name=\"formDefinitionView\"\n [title]=\"'objectManagement.labels.formDefinitionView' | translate\"\n [tooltip]=\"'objectManagement.tooltips.formDefinitionView' | translate\"\n [defaultSelectionId]=\"prefillObject?.formDefinitionView\"\n ></v-select>\n\n <v-select\n [items]=\"formObs.formDefinitions\"\n [margin]=\"true\"\n [widthInPx]=\"350\"\n name=\"formDefinitionEdit\"\n [title]=\"'objectManagement.labels.formDefinitionEdit' | translate\"\n [tooltip]=\"'objectManagement.tooltips.formDefinitionEdit' | translate\"\n [defaultSelectionId]=\"prefillObject?.formDefinitionEdit\"\n ></v-select>\n </ng-container>\n\n <v-input\n [margin]=\"true\"\n type=\"checkbox\"\n [title]=\"'objectManagement.labels.showInDataMenu' | translate\"\n [tooltip]=\"'objectManagement.tooltips.showInDataMenu' | translate\"\n name=\"showInDataMenu\"\n [defaultValue]=\"prefillObject?.showInDataMenu\"\n ></v-input>\n </v-form>\n </ng-container>\n</ng-template>\n", styles: [".buttons{width:100%;display:flex;flex-direction:row;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: "directive", type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i6.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i5.VModalComponent, selector: "v-modal", inputs: ["appearingDelayMs", "maxWidthPx", "hideFooter", "parentId"], outputs: ["closeEvent"] }, { kind: "component", type: i5.FormComponent, selector: "v-form", inputs: ["className"], outputs: ["valueChange"] }, { kind: "component", type: i5.InputComponent, selector: "v-input", inputs: ["name", "type", "title", "titleTranslationKey", "defaultValue", "widthPx", "fullWidth", "margin", "smallMargin", "disabled", "step", "min", "maxLength", "tooltip", "required", "hideNumberSpinBox", "smallLabel", "rows", "clear$", "carbonTheme", "placeholder", "dataTestId", "trim", "presetsTitle", "presetOptions"], outputs: ["valueChange"] }, { kind: "component", type: i5.SelectComponent, selector: "v-select", inputs: ["items", "defaultSelection", "defaultSelectionId", "defaultSelectionIds", "disabled", "dropUp", "invalid", "multiple", "margin", "widthInPx", "notFoundText", "clearAllText", "clearText", "clearable", "name", "title", "titleTranslationKey", "clearSelectionSubject$", "tooltip", "required", "loading", "loadingText", "placeholder", "smallMargin", "carbonTheme", "appendInline", "dataTestId"], outputs: ["selectedChange"] }, { kind: "directive", type: i7.Button, selector: "[cdsButton], [ibmButton]", inputs: ["ibmButton", "cdsButton", "size", "skeleton", "iconOnly", "isExpressive"] }, { kind: "pipe", type: i6.AsyncPipe, name: "async" }, { kind: "pipe", type: i3$1.TranslatePipe, name: "translate" }] }); }
354
+ }
355
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: ObjectManagementModalComponent, decorators: [{
356
+ type: Component,
357
+ args: [{ standalone: false, selector: 'valtimo-object-management-modal', 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<v-modal\n #objectManagementModal\n *ngIf=\"{\n disabled: disabled$ | async,\n valid: valid$ | async,\n modalType: modalType$ | async,\n prefillObject: prefillObject$ | async,\n } as obs\"\n>\n <div role=\"header\">\n <div class=\"add-title\">\n <h4>\n {{\n (obs.modalType === 'add'\n ? 'objectManagement.createObjecttype'\n : 'objectManagement.editObjecttype'\n ) | translate\n }}\n </h4>\n </div>\n </div>\n <div role=\"content\">\n <ng-container\n *ngTemplateOutlet=\"\n form;\n context: {prefillObject: obs.prefillObject, modalType: obs.modalType}\n \"\n ></ng-container>\n </div>\n <div role=\"footer\">\n <div class=\"buttons\">\n <button cdsButton=\"secondary\" (click)=\"cancel()\" [disabled]=\"obs.disabled\">\n {{ 'objectManagement.cancel' | translate }}\n </button>\n\n <button cdsButton=\"primary\" (click)=\"save()\" [disabled]=\"obs.disabled || !obs.valid\">\n {{\n (obs.modalType === 'add' ? 'objectManagement.add' : 'objectManagement.edit') | translate\n }}\n </button>\n </div>\n </div>\n</v-modal>\n\n<ng-template #form let-prefillObject=\"prefillObject\" let-modalType=\"modalType\">\n <ng-container *ngIf=\"showForm$ | async\">\n <v-form (valueChange)=\"formValueChange($event)\">\n <v-input\n *ngIf=\"modalType === 'edit'\"\n hidden\n [disabled]=\"true\"\n [defaultValue]=\"prefillObject?.id\"\n name=\"id\"\n ></v-input>\n\n <v-input\n [margin]=\"true\"\n [required]=\"true\"\n [title]=\"'objectManagement.labels.title' | translate\"\n [tooltip]=\"'objectManagement.tooltips.title' | translate\"\n [widthPx]=\"350\"\n [defaultValue]=\"prefillObject?.title\"\n name=\"title\"\n ></v-input>\n\n <ng-container\n *ngIf=\"{\n connectionInstances: configurationInstances$ | async,\n objectsApiConfigurations: objectsApiConfigurations$ | async,\n objecttypesApiConfigurations: objecttypesApiConfigurations$ | async,\n } as objectObs\"\n >\n <v-select\n [items]=\"objectObs.objectsApiConfigurations\"\n [margin]=\"true\"\n [widthInPx]=\"350\"\n name=\"objectenApiPluginConfigurationId\"\n [title]=\"'objectManagement.labels.objects' | translate\"\n [defaultSelectionId]=\"prefillObject?.objectenApiPluginConfigurationId\"\n [required]=\"true\"\n ></v-select>\n\n <v-select\n [items]=\"objectObs.objecttypesApiConfigurations\"\n [margin]=\"true\"\n [widthInPx]=\"350\"\n name=\"objecttypenApiPluginConfigurationId\"\n [title]=\"'objectManagement.labels.objecttypes' | translate\"\n [defaultSelectionId]=\"prefillObject?.objecttypenApiPluginConfigurationId\"\n [required]=\"true\"\n (selectedChange)=\"selectObjectType($event)\"\n ></v-select>\n </ng-container>\n\n <v-input\n [margin]=\"true\"\n [required]=\"true\"\n [title]=\"'objectManagement.labels.objecttypeId' | translate\"\n [tooltip]=\"'objectManagement.tooltips.objecttypeId' | translate\"\n [widthPx]=\"350\"\n [defaultValue]=\"prefillObject?.objecttypeId\"\n name=\"objecttypeId\"\n ></v-input>\n\n <v-input\n [margin]=\"true\"\n [required]=\"true\"\n [title]=\"'objectManagement.labels.objecttypeVersion' | translate\"\n [tooltip]=\"'objectManagement.tooltips.objecttypeVersion' | translate\"\n [widthPx]=\"350\"\n [defaultValue]=\"prefillObject?.objecttypeVersion\"\n [min]=\"1\"\n type=\"number\"\n name=\"objecttypeVersion\"\n ></v-input>\n\n <ng-container *ngIf=\"{formDefinitions: formDefinitions$ | async} as formObs\">\n <v-select\n [items]=\"formObs.formDefinitions\"\n [margin]=\"true\"\n [widthInPx]=\"350\"\n name=\"formDefinitionView\"\n [title]=\"'objectManagement.labels.formDefinitionView' | translate\"\n [tooltip]=\"'objectManagement.tooltips.formDefinitionView' | translate\"\n [defaultSelectionId]=\"prefillObject?.formDefinitionView\"\n ></v-select>\n\n <v-select\n [items]=\"formObs.formDefinitions\"\n [margin]=\"true\"\n [widthInPx]=\"350\"\n name=\"formDefinitionEdit\"\n [title]=\"'objectManagement.labels.formDefinitionEdit' | translate\"\n [tooltip]=\"'objectManagement.tooltips.formDefinitionEdit' | translate\"\n [defaultSelectionId]=\"prefillObject?.formDefinitionEdit\"\n ></v-select>\n </ng-container>\n\n <v-input\n [margin]=\"true\"\n type=\"checkbox\"\n [title]=\"'objectManagement.labels.showInDataMenu' | translate\"\n [tooltip]=\"'objectManagement.tooltips.showInDataMenu' | translate\"\n name=\"showInDataMenu\"\n [defaultValue]=\"prefillObject?.showInDataMenu\"\n ></v-input>\n </v-form>\n </ng-container>\n</ng-template>\n", styles: [".buttons{width:100%;display:flex;flex-direction:row;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"] }]
358
+ }], ctorParameters: () => [{ type: ObjectManagementStateService }, { type: ObjectManagementService }, { type: i3.FormService }, { type: i4$1.PluginManagementService }, { type: i5.ModalService }], propDecorators: { objectManagementModal: [{
359
+ type: ViewChild,
360
+ args: ['objectManagementModal']
361
+ }], prefillObject$: [{
362
+ type: Input
363
+ }] } });
364
+
365
+ /*
366
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
367
+ *
368
+ * Licensed under EUPL, Version 1.2 (the "License");
369
+ * you may not use this file except in compliance with the License.
370
+ * You may obtain a copy of the License at
371
+ *
372
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
373
+ *
374
+ * Unless required by applicable law or agreed to in writing, software
375
+ * distributed under the License is distributed on an "AS IS" basis,
376
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
377
+ * See the License for the specific language governing permissions and
378
+ * limitations under the License.
379
+ */
380
+ class ObjectManagementDetailComponent {
381
+ constructor(objectManagementService, objectManagementState) {
382
+ this.objectManagementService = objectManagementService;
383
+ this.objectManagementState = objectManagementState;
384
+ this.loading$ = new BehaviorSubject(false);
385
+ }
386
+ downloadDefinition(object) {
387
+ this.loading$.next(true);
388
+ const dataString = 'data:text/json;charset=utf-8,' + encodeURIComponent(JSON.stringify(object, null, 2));
389
+ const downloadAnchorElement = document.getElementById('downloadAnchorElement');
390
+ downloadAnchorElement.setAttribute('href', dataString);
391
+ downloadAnchorElement.setAttribute('download', `${object.id}.json`);
392
+ downloadAnchorElement.click();
393
+ this.loading$.next(false);
394
+ }
395
+ showEditModal() {
396
+ this.loading$.next(true);
397
+ this.objectManagementState.setModalType('edit');
398
+ this.objectManagementState.showModal();
399
+ this.loading$.next(false);
400
+ }
401
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: ObjectManagementDetailComponent, deps: [{ token: ObjectManagementService }, { token: ObjectManagementStateService }], target: i0.ɵɵFactoryTarget.Component }); }
402
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.17", type: ObjectManagementDetailComponent, isStandalone: false, selector: "valtimo-object-management-detail", inputs: { object$: "object$" }, 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<div\n id=\"object-datail-content\"\n class=\"pt-0\"\n *ngIf=\"{\n object: object$ | async,\n loading: loading$ | async,\n } as obs\"\n>\n <ng-container\n *ngTemplateOutlet=\"buttons; context: {object: obs.object, loading: obs.loading}\"\n ></ng-container>\n <div class=\"clearfix\"></div>\n <ng-container\n *ngTemplateOutlet=\"widget; context: {object: obs.object, loading: obs.loading}\"\n ></ng-container>\n</div>\n\n<ng-template #buttons let-object=\"object\" let-loading=\"loading\">\n <div class=\"btn-group mt-m3px mb-3 pr-2 float-right\">\n <button\n (click)=\"downloadDefinition(object)\"\n cdsButton=\"secondary\"\n size=\"md\"\n [disabled]=\"loading\"\n class=\"ml-3\"\n >\n {{ 'objectManagement.download' | translate }}\n <svg class=\"cds--btn__icon\" cdsIcon=\"download\" size=\"16\"></svg>\n </button>\n <a id=\"downloadAnchorElement\" class=\"d-none\"></a>\n <button\n (click)=\"showEditModal()\"\n cdsButton=\"primary\"\n size=\"md\"\n [disabled]=\"loading\"\n class=\"ml-3\"\n >\n {{ 'objectManagement.editObjecttype' | translate }}\n <svg class=\"cds--btn__icon\" cdsIcon=\"edit\" size=\"16\"></svg>\n </button>\n </div>\n</ng-template>\n\n<ng-template #widget let-object=\"object\">\n <valtimo-widget>\n <div class=\"row bg-white mt-5 mb-2 pl-2 pr-2\">\n <div class=\"col-5 bg-red\">\n <textarea class=\"w-100 object-schema\" disabled rows=\"25\">{{ object | json }}</textarea>\n </div>\n </div>\n </valtimo-widget>\n</ng-template>\n\n<valtimo-object-management-modal [prefillObject$]=\"object$\"></valtimo-object-management-modal>\n", styles: [".row{margin:0}.object-schema{resize:none}valtimo-widget::ng-deep .card-border.card-full-default{border:none}\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: "directive", type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i6.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i5.WidgetComponent, selector: "valtimo-widget", inputs: ["type", "name", "icon", "contrast", "divider", "title", "subtitle", "collapseAble", "collapse", "additionalClasses"] }, { kind: "directive", type: i7.Button, selector: "[cdsButton], [ibmButton]", inputs: ["ibmButton", "cdsButton", "size", "skeleton", "iconOnly", "isExpressive"] }, { kind: "directive", type: i7.IconDirective, selector: "[cdsIcon], [ibmIcon]", inputs: ["ibmIcon", "cdsIcon", "size", "title", "ariaLabel", "ariaLabelledBy", "ariaHidden", "isFocusable"] }, { kind: "component", type: ObjectManagementModalComponent, selector: "valtimo-object-management-modal", inputs: ["prefillObject$"] }, { kind: "pipe", type: i6.AsyncPipe, name: "async" }, { kind: "pipe", type: i6.JsonPipe, name: "json" }, { kind: "pipe", type: i3$1.TranslatePipe, name: "translate" }] }); }
403
+ }
404
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: ObjectManagementDetailComponent, decorators: [{
405
+ type: Component,
406
+ args: [{ standalone: false, selector: 'valtimo-object-management-detail', 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<div\n id=\"object-datail-content\"\n class=\"pt-0\"\n *ngIf=\"{\n object: object$ | async,\n loading: loading$ | async,\n } as obs\"\n>\n <ng-container\n *ngTemplateOutlet=\"buttons; context: {object: obs.object, loading: obs.loading}\"\n ></ng-container>\n <div class=\"clearfix\"></div>\n <ng-container\n *ngTemplateOutlet=\"widget; context: {object: obs.object, loading: obs.loading}\"\n ></ng-container>\n</div>\n\n<ng-template #buttons let-object=\"object\" let-loading=\"loading\">\n <div class=\"btn-group mt-m3px mb-3 pr-2 float-right\">\n <button\n (click)=\"downloadDefinition(object)\"\n cdsButton=\"secondary\"\n size=\"md\"\n [disabled]=\"loading\"\n class=\"ml-3\"\n >\n {{ 'objectManagement.download' | translate }}\n <svg class=\"cds--btn__icon\" cdsIcon=\"download\" size=\"16\"></svg>\n </button>\n <a id=\"downloadAnchorElement\" class=\"d-none\"></a>\n <button\n (click)=\"showEditModal()\"\n cdsButton=\"primary\"\n size=\"md\"\n [disabled]=\"loading\"\n class=\"ml-3\"\n >\n {{ 'objectManagement.editObjecttype' | translate }}\n <svg class=\"cds--btn__icon\" cdsIcon=\"edit\" size=\"16\"></svg>\n </button>\n </div>\n</ng-template>\n\n<ng-template #widget let-object=\"object\">\n <valtimo-widget>\n <div class=\"row bg-white mt-5 mb-2 pl-2 pr-2\">\n <div class=\"col-5 bg-red\">\n <textarea class=\"w-100 object-schema\" disabled rows=\"25\">{{ object | json }}</textarea>\n </div>\n </div>\n </valtimo-widget>\n</ng-template>\n\n<valtimo-object-management-modal [prefillObject$]=\"object$\"></valtimo-object-management-modal>\n", styles: [".row{margin:0}.object-schema{resize:none}valtimo-widget::ng-deep .card-border.card-full-default{border:none}\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"] }]
407
+ }], ctorParameters: () => [{ type: ObjectManagementService }, { type: ObjectManagementStateService }], propDecorators: { object$: [{
408
+ type: Input
409
+ }] } });
410
+
411
+ /*
412
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
413
+ *
414
+ * Licensed under EUPL, Version 1.2 (the "License");
415
+ * you may not use this file except in compliance with the License.
416
+ * You may obtain a copy of the License at
417
+ *
418
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
419
+ *
420
+ * Unless required by applicable law or agreed to in writing, software
421
+ * distributed under the License is distributed on an "AS IS" basis,
422
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
423
+ * See the License for the specific language governing permissions and
424
+ * limitations under the License.
425
+ */
426
+ class ObjectManagementListColumnsComponent {
427
+ constructor(objectManagementService, route, translateService, configService, sanitizer) {
428
+ this.objectManagementService = objectManagementService;
429
+ this.route = route;
430
+ this.translateService = translateService;
431
+ this.configService = configService;
432
+ this.sanitizer = sanitizer;
433
+ this.downloadName$ = new BehaviorSubject('');
434
+ this.downloadUrl$ = new BehaviorSubject(undefined);
435
+ this.loading$ = new BehaviorSubject(true);
436
+ this.currentModalType$ = new BehaviorSubject('create');
437
+ this.showModal$ = new BehaviorSubject(false);
438
+ this.modalShowing$ = this.showModal$.pipe(delay(250));
439
+ this.disableInput$ = new BehaviorSubject(false);
440
+ this.showDeleteModal$ = new Subject();
441
+ this.deleteRowIndex$ = new BehaviorSubject(0);
442
+ this.defaultEnumValues$ = new BehaviorSubject(undefined);
443
+ this.INVALID_KEY = 'invalid';
444
+ this.formGroup = new FormGroup({
445
+ title: new FormControl(''),
446
+ key: new FormControl('', Validators.required),
447
+ path: new FormControl('', Validators.required),
448
+ dateFormat: new FormControl(''),
449
+ displayType: new FormControl({
450
+ key: this.INVALID_KEY,
451
+ }),
452
+ sortable: new FormControl(false),
453
+ defaultSort: new FormControl({
454
+ key: this.INVALID_KEY,
455
+ }),
456
+ enum: new FormControl([]),
457
+ });
458
+ this.DISPLAY_TYPES = [
459
+ 'string',
460
+ 'date',
461
+ 'boolean',
462
+ 'enum',
463
+ 'arrayCount',
464
+ 'underscoresToSpaces',
465
+ ];
466
+ this.COLUMNS = [
467
+ {
468
+ viewType: 'string',
469
+ sortable: false,
470
+ propertyName: 'title',
471
+ translationKey: 'title',
472
+ },
473
+ {
474
+ viewType: 'string',
475
+ sortable: false,
476
+ propertyName: 'key',
477
+ translationKey: 'key',
478
+ },
479
+ {
480
+ viewType: 'string',
481
+ sortable: false,
482
+ propertyName: 'path',
483
+ translationKey: 'path',
484
+ },
485
+ {
486
+ viewType: 'string',
487
+ sortable: false,
488
+ propertyName: 'displayType',
489
+ translationKey: 'displayType',
490
+ },
491
+ {
492
+ viewType: 'string',
493
+ sortable: false,
494
+ propertyName: 'displayTypeParameters',
495
+ translationKey: 'displayTypeParameters',
496
+ },
497
+ {
498
+ viewType: 'string',
499
+ sortable: false,
500
+ propertyName: 'sortable',
501
+ translationKey: 'sortable',
502
+ },
503
+ {
504
+ viewType: 'string',
505
+ sortable: false,
506
+ propertyName: 'defaultSort',
507
+ translationKey: 'defaultSort',
508
+ },
509
+ ];
510
+ this.cachedObjectManagementListColumns = [];
511
+ this.refreshObjectManagementListColumns$ = new BehaviorSubject(null);
512
+ this.objectManagementFields$ = this.translateService
513
+ .stream('key')
514
+ .pipe(map(() => this.COLUMNS.map(column => ({
515
+ key: column.propertyName,
516
+ label: this.translateService.instant(`listColumn.${column.translationKey}`),
517
+ sortable: column.sortable,
518
+ ...(column.viewType && { viewType: column.viewType }),
519
+ ...(column.enum && { enum: column.enum }),
520
+ }))));
521
+ this.objectId$ = this.route.params.pipe(map(params => params.id || ''), filter(objectId => !!objectId));
522
+ this.objectManagementListColumns$ = combineLatest([
523
+ this.objectId$,
524
+ this.refreshObjectManagementListColumns$,
525
+ ]).pipe(switchMap(([objectId]) => this.objectManagementService.getSearchList(objectId)), tap(objectManagementListColumns => {
526
+ this.objectId$.pipe(take(1)).subscribe(objectId => {
527
+ if (objectManagementListColumns &&
528
+ Array.isArray(objectManagementListColumns) &&
529
+ objectManagementListColumns.length > 0) {
530
+ this.setDownload(objectId, objectManagementListColumns);
531
+ }
532
+ });
533
+ }), tap(objectManagementListColumns => {
534
+ this.cachedObjectManagementListColumns = objectManagementListColumns;
535
+ this.loading$.next(false);
536
+ this.enableInput();
537
+ }));
538
+ this.translatedObjectManagementListColumns$ = combineLatest([this.objectManagementListColumns$, this.translateService.stream('key')]).pipe(map(([columns]) => columns.map(column => ({
539
+ ...column,
540
+ title: column.title || '-',
541
+ sortable: column.sortable
542
+ ? this.translateService.instant('listColumn.sortableYes')
543
+ : this.translateService.instant('listColumn.sortableNo'),
544
+ defaultSort: (column.defaultSort === 'ASC' &&
545
+ this.translateService.instant('listColumn.sortableAsc')) ||
546
+ (column.defaultSort === 'DESC' &&
547
+ this.translateService.instant('listColumn.sortableDesc')) ||
548
+ '-',
549
+ displayType: this.translateService.instant(`listColumnDisplayType.${column?.displayType?.type}`),
550
+ displayTypeParameters: this.getDisplayTypeParametersView(column.displayType.displayTypeParameters),
551
+ }))));
552
+ this.disableDefaultSort$ = combineLatest([
553
+ this.currentModalType$,
554
+ this.formGroup.valueChanges,
555
+ ]).pipe(map(([currentModalType]) => currentModalType === 'create' &&
556
+ this.cachedObjectManagementListColumns.find(column => !!column.defaultSort)), startWith(false));
557
+ this.showDateFormat$ = this.formGroup.valueChanges.pipe(map(formValues => formValues.displayType?.key === this.DISPLAY_TYPES[1]), tap(showDateFormat => {
558
+ if (showDateFormat === false && !!this.formGroup.value.dateFormat) {
559
+ this.formGroup.patchValue({ dateFormat: '' });
560
+ }
561
+ }), startWith(false));
562
+ this.showEnum$ = this.formGroup.valueChanges.pipe(map(formValues => !!(formValues.displayType?.key === this.DISPLAY_TYPES[3] ||
563
+ formValues.displayType?.key === this.DISPLAY_TYPES[2])), tap(showEnum => {
564
+ const enumValue = this.formGroup.value.enum;
565
+ if (showEnum === false && Array.isArray(enumValue) && enumValue.length > 0) {
566
+ this.formGroup.patchValue({ enum: [] });
567
+ }
568
+ }), startWith(false));
569
+ this.isYesNo$ = this.formGroup.valueChanges.pipe(map(formValues => formValues.displayType?.key === this.DISPLAY_TYPES[2]));
570
+ this.selectedViewTypeItemIndex$ = new BehaviorSubject(0);
571
+ this.viewTypeItems$ = combineLatest([
572
+ this.selectedViewTypeItemIndex$,
573
+ this.translateService.stream('key'),
574
+ ]).pipe(map(([selectedViewTypeItemIndex]) => [
575
+ {
576
+ content: this.translateService.instant(`listColumnDisplayType.select`),
577
+ key: this.INVALID_KEY,
578
+ },
579
+ ...this.DISPLAY_TYPES.map(type => ({
580
+ content: this.translateService.instant(`listColumnDisplayType.${type}`),
581
+ key: type,
582
+ })),
583
+ ].map((item, index) => ({
584
+ ...item,
585
+ selected: index === selectedViewTypeItemIndex,
586
+ }))));
587
+ this.selectedSortItemIndex$ = new BehaviorSubject(0);
588
+ this.sortItems$ = combineLatest([
589
+ this.selectedSortItemIndex$,
590
+ this.translateService.stream('key'),
591
+ ]).pipe(map(([selectedSortItemIndex]) => [
592
+ {
593
+ content: this.translateService.instant(`listColumn.selectDefaultSort`),
594
+ key: this.INVALID_KEY,
595
+ },
596
+ {
597
+ content: this.translateService.instant(`listColumn.sortableAsc`),
598
+ key: 'ASC',
599
+ },
600
+ {
601
+ content: this.translateService.instant(`listColumn.sortableDesc`),
602
+ key: 'DESC',
603
+ },
604
+ ].map((item, index) => ({
605
+ ...item,
606
+ selected: index === selectedSortItemIndex,
607
+ }))));
608
+ this.validKey$ = combineLatest([this.formGroup.valueChanges, this.currentModalType$]).pipe(map(([formValues, currentModalType]) => {
609
+ const existingKeys = this.cachedObjectManagementListColumns.map(column => column.key);
610
+ return currentModalType === 'create' ? !existingKeys.includes(formValues.key) : true;
611
+ }), startWith(false));
612
+ this.valid$ = combineLatest([this.formGroup.valueChanges, this.validKey$]).pipe(map(([formValues, validKey]) => !!(formValues.displayType?.key !== this.INVALID_KEY &&
613
+ formValues.path &&
614
+ validKey &&
615
+ (formValues.displayType.key === 'enum' ? formValues.enum?.length > 0 : true))), startWith(false));
616
+ }
617
+ openModal(modalType) {
618
+ this.showModal$.next(true);
619
+ this.currentModalType$.next(modalType);
620
+ if (modalType === 'create') {
621
+ this.formGroup.controls['key'].enable();
622
+ this.resetFormGroup();
623
+ }
624
+ else if (modalType === 'edit') {
625
+ this.formGroup.controls['key'].disable();
626
+ }
627
+ }
628
+ closeModal() {
629
+ this.showModal$.next(false);
630
+ }
631
+ deleteRow(searchListColumnRowIndex, clickEvent) {
632
+ clickEvent.stopPropagation();
633
+ this.showDeleteModal$.next(true);
634
+ this.deleteRowIndex$.next(searchListColumnRowIndex);
635
+ }
636
+ deleteRowConfirmation(searchListColumnRowIndex) {
637
+ const columnKey = this.getColumnKey(searchListColumnRowIndex);
638
+ if (columnKey) {
639
+ this.disableInput();
640
+ this.objectId$
641
+ .pipe(take(1), switchMap(objectId => this.objectManagementService.deleteSearchList(objectId, columnKey)), tap(() => this.refreshObjectManagementListColumns()), catchError(() => {
642
+ this.enableInput();
643
+ return of(null);
644
+ }))
645
+ .subscribe();
646
+ }
647
+ }
648
+ getColumnKey(searchListColumnRowIndex) {
649
+ return this.cachedObjectManagementListColumns[searchListColumnRowIndex]?.key;
650
+ }
651
+ moveRow(searchListColumnRowIndex, moveUp, clickEvent, objectId) {
652
+ const objectManagementListColumns = [...this.cachedObjectManagementListColumns];
653
+ const searchListColumnRow = objectManagementListColumns[searchListColumnRowIndex];
654
+ clickEvent.stopPropagation();
655
+ const searchListColumnIndex = objectManagementListColumns.findIndex(field => field.key === searchListColumnRow.key);
656
+ const foundSearchListColumn = { ...objectManagementListColumns[searchListColumnIndex] };
657
+ const filteredSearchListColumns = objectManagementListColumns.filter(field => field.key !== searchListColumnRow.key);
658
+ const multipleSearchListColumns = objectManagementListColumns.length > 1;
659
+ if (multipleSearchListColumns && moveUp && searchListColumnIndex > 0) {
660
+ const searchListColumnBeforeKey = `${objectManagementListColumns[searchListColumnIndex - 1].key}`;
661
+ const searchListColumnBeforeIndex = filteredSearchListColumns.findIndex(field => field.key === searchListColumnBeforeKey);
662
+ filteredSearchListColumns.splice(searchListColumnBeforeIndex, 0, foundSearchListColumn);
663
+ this.updateObjectManagementListColumn(objectId, filteredSearchListColumns);
664
+ }
665
+ else if (multipleSearchListColumns &&
666
+ !moveUp &&
667
+ searchListColumnIndex < objectManagementListColumns.length) {
668
+ const caseListColumnAfterKey = `${objectManagementListColumns[searchListColumnIndex + 1].key}`;
669
+ const caseListColumnAfterIndex = filteredSearchListColumns.findIndex(field => field.key === caseListColumnAfterKey);
670
+ filteredSearchListColumns.splice(caseListColumnAfterIndex + 1, 0, foundSearchListColumn);
671
+ this.updateObjectManagementListColumn(objectId, filteredSearchListColumns);
672
+ }
673
+ }
674
+ saveCasListColumns() {
675
+ this.disableInput();
676
+ this.currentModalType$.pipe(take(1)).subscribe(currentModalType => {
677
+ if (currentModalType === 'create') {
678
+ this.addColumn();
679
+ }
680
+ else {
681
+ this.updateColumn();
682
+ }
683
+ });
684
+ }
685
+ enumValueChange(value) {
686
+ this.formGroup.patchValue({ enum: value });
687
+ }
688
+ columnRowClicked(row) {
689
+ this.resetFormGroup();
690
+ combineLatest([this.viewTypeItems$, this.sortItems$])
691
+ .pipe(take(1))
692
+ .subscribe(([viewTypeItems, sortItems]) => {
693
+ const column = this.cachedObjectManagementListColumns.find(cachedColumn => cachedColumn.key === row.key);
694
+ const viewTypeItem = viewTypeItems.find(item => item.key === column.displayType.type);
695
+ const viewTypeItemIndex = viewTypeItems.findIndex(item => item.key === column.displayType.type);
696
+ const sortItem = sortItems.find(item => item.key === column.defaultSort);
697
+ const sortItemIndex = sortItems.findIndex(item => item.key === column.defaultSort);
698
+ const enumValues = column?.displayType?.displayTypeParameters?.enum;
699
+ const mappedEnumValues = [];
700
+ const columnDateFormat = column?.displayType?.displayTypeParameters?.dateFormat;
701
+ this.selectedViewTypeItemIndex$.next(viewTypeItemIndex);
702
+ if (sortItem) {
703
+ this.selectedSortItemIndex$.next(sortItemIndex);
704
+ }
705
+ if (enumValues) {
706
+ Object.keys(enumValues).forEach(key => {
707
+ mappedEnumValues.push({ key, value: enumValues[key] });
708
+ });
709
+ this.defaultEnumValues$.next(mappedEnumValues);
710
+ }
711
+ else {
712
+ this.defaultEnumValues$.next([{ key: '', value: '' }]);
713
+ }
714
+ this.formGroup.patchValue({
715
+ key: column.key,
716
+ title: column.title,
717
+ path: column.path,
718
+ sortable: column.sortable,
719
+ // @ts-ignore
720
+ displayType: { ...viewTypeItem },
721
+ // @ts-ignore
722
+ defaultSort: sortItem ? { ...sortItem } : { ...sortItems[0] },
723
+ ...(columnDateFormat && {
724
+ dateFormat: columnDateFormat,
725
+ }),
726
+ });
727
+ this.openModal('edit');
728
+ });
729
+ }
730
+ updateObjectManagementListColumn(objectId, listColumn) {
731
+ this.disableInput();
732
+ this.objectManagementService
733
+ .putSearchListColumns(objectId, listColumn)
734
+ .pipe(tap(() => {
735
+ this.refreshObjectManagementListColumns();
736
+ localStorage.setItem(`list-search-${objectId}`, null);
737
+ }), catchError(() => {
738
+ this.enableInput();
739
+ return of(null);
740
+ }))
741
+ .subscribe();
742
+ }
743
+ addColumn() {
744
+ const formValue = this.formGroup.value;
745
+ this.objectId$
746
+ .pipe(take(1), switchMap(objectId => this.objectManagementService.postSearchList(objectId, this.mapFormValuesToColumn(formValue))), tap(() => {
747
+ this.closeModal();
748
+ this.refreshObjectManagementListColumns();
749
+ }), catchError(() => {
750
+ this.enableInput();
751
+ return of(null);
752
+ }))
753
+ .subscribe();
754
+ }
755
+ getDisplayTypeParametersView(displayTypeParameters) {
756
+ if (displayTypeParameters?.dateFormat) {
757
+ return displayTypeParameters.dateFormat;
758
+ }
759
+ else if (displayTypeParameters?.enum) {
760
+ return Object.keys(displayTypeParameters.enum).reduce((acc, curr) => {
761
+ const keyValuePairString = `${curr}: ${displayTypeParameters.enum[curr]}`;
762
+ if (!acc) {
763
+ return `${keyValuePairString}`;
764
+ }
765
+ return `${acc}, ${keyValuePairString}`;
766
+ }, '');
767
+ }
768
+ return '-';
769
+ }
770
+ updateColumn() {
771
+ this.objectId$
772
+ .pipe(take(1), switchMap(objectId => this.objectManagementService.putSearchList(objectId, this.formGroup.value.key, this.mapFormValuesToColumn(this.formGroup.value))), tap(() => {
773
+ this.closeModal();
774
+ this.refreshObjectManagementListColumns();
775
+ }), catchError(() => {
776
+ this.enableInput();
777
+ return of(null);
778
+ }))
779
+ .subscribe();
780
+ }
781
+ setDownload(objectId, ObjectManagementListColumns) {
782
+ this.downloadName$.next(`${objectId}.json`);
783
+ this.downloadUrl$.next(this.sanitizer.bypassSecurityTrustUrl('data:text/json;charset=UTF-8,' +
784
+ encodeURIComponent(JSON.stringify(ObjectManagementListColumns, null, 2))));
785
+ }
786
+ disableInput() {
787
+ this.disableInput$.next(true);
788
+ this.formGroup.disable();
789
+ }
790
+ enableInput() {
791
+ this.disableInput$.next(false);
792
+ this.formGroup.enable();
793
+ }
794
+ refreshObjectManagementListColumns() {
795
+ this.refreshObjectManagementListColumns$.next(null);
796
+ }
797
+ resetFormGroup() {
798
+ this.formGroup.reset();
799
+ combineLatest([this.sortItems$, this.viewTypeItems$])
800
+ .pipe(take(1))
801
+ .subscribe(([sortItems, viewTypeItems]) => {
802
+ this.defaultEnumValues$.next([{ key: '', value: '' }]);
803
+ this.selectedViewTypeItemIndex$.next(0);
804
+ // @ts-ignore
805
+ this.formGroup.patchValue({ displayType: viewTypeItems[0] });
806
+ this.selectedSortItemIndex$.next(0);
807
+ // @ts-ignore
808
+ this.formGroup.patchValue({ defaultSort: sortItems[0] });
809
+ });
810
+ }
811
+ mapFormValuesToColumn(formValue) {
812
+ return {
813
+ key: formValue.key,
814
+ sortable: formValue.sortable,
815
+ ...(formValue.defaultSort?.key !== this.INVALID_KEY && {
816
+ defaultSort: formValue.defaultSort?.key,
817
+ }),
818
+ title: formValue.title || '',
819
+ path: formValue.path,
820
+ displayType: {
821
+ type: formValue.displayType?.key,
822
+ displayTypeParameters: {
823
+ ...(formValue.dateFormat && { dateFormat: formValue.dateFormat }),
824
+ ...(Array.isArray(formValue.enum) &&
825
+ formValue.enum.length > 0 && {
826
+ enum: formValue.enum.reduce((acc, curr) => ({ ...acc, [curr.key]: curr.value }), {}),
827
+ }),
828
+ },
829
+ },
830
+ };
831
+ }
832
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: ObjectManagementListColumnsComponent, deps: [{ token: ObjectManagementService }, { token: i2.ActivatedRoute }, { token: i3$1.TranslateService }, { token: i4.ConfigService }, { token: i5$1.DomSanitizer }], target: i0.ɵɵFactoryTarget.Component }); }
833
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.17", type: ObjectManagementListColumnsComponent, isStandalone: false, selector: "valtimo-object-management-list-columns", viewQueries: [{ propertyName: "moveRowButtonsTemplateRef", first: true, predicate: ["moveRowButtons"], 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<ng-container\n *ngIf=\"{\n listColumn: translatedObjectManagementListColumns$ | async,\n fields: objectManagementFields$ | async,\n objectId: objectId$ | async,\n downloadUrl: downloadUrl$ | async,\n downloadName: downloadName$ | async,\n loading: loading$ | async,\n } as obs\"\n>\n <div class=\"container-fluid pr-0 pl-0\">\n <div class=\"text-right\">\n <div class=\"btn-group mt-m3px mb-3 mr-2\">\n <ng-container *ngTemplateOutlet=\"buttons; context: {obs: obs}\"></ng-container>\n </div>\n </div>\n <ng-container *ngIf=\"!obs.loading; else loading\">\n <ng-container *ngIf=\"obs.listColumn?.length > 0; else noConfigWarning\">\n <ng-container *ngTemplateOutlet=\"list; context: {obs: obs}\"></ng-container>\n </ng-container>\n </ng-container>\n <ng-container *ngTemplateOutlet=\"createEditModal\"></ng-container>\n <ng-container *ngTemplateOutlet=\"deleteModal\"></ng-container>\n </div>\n</ng-container>\n\n<ng-template #buttons let-obs=\"obs\">\n <a\n cdsLink\n class=\"center-link\"\n [href]=\"obs.downloadUrl\"\n [download]=\"obs.downloadName\"\n [disabled]=\"\n !obs.downloadUrl ||\n !obs.downloadName ||\n obs.listColumn?.length < 1 ||\n obs.disableInput ||\n obs.loading\n \"\n >\n {{ 'listColumn.downloadButtonText' | translate }}\n </a>\n <button\n (click)=\"openModal('create')\"\n cdsButton=\"primary\"\n size=\"md\"\n [disabled]=\"obs.loading\"\n class=\"ml-3\"\n >\n {{ 'listColumn.addButtonText' | translate }}\n <svg class=\"cds--btn__icon\" cdsIcon=\"add\" size=\"16\"></svg>\n </button>\n</ng-template>\n\n<ng-template #moveRowButtons let-index=\"index\" let-length=\"length\">\n <div\n class=\"move-row-buttons\"\n *ngIf=\"{\n disableInput: disableInput$ | async,\n objectId: objectId$ | async,\n } as obs\"\n >\n <i\n class=\"mdi mdi-delete btn btn-outline-danger mr-1\"\n (click)=\"deleteRow(index, $event)\"\n [ngClass]=\"{'disabled disabled-move-row-button': obs.disableInput}\"\n ></i>\n <i\n class=\"mdi mdi-arrow-up-bold btn btn-outline-primary mr-1\"\n (click)=\"moveRow(index, true, $event, obs.objectId)\"\n [ngClass]=\"{'disabled disabled-move-row-button': index === 0 || obs.disableInput}\"\n ></i>\n <i\n class=\"mdi mdi-arrow-down-bold btn btn-outline-secondary\"\n (click)=\"moveRow(index, false, $event, obs.objectId)\"\n [ngClass]=\"{\n 'disabled disabled-move-row-button': index === length - 1 || obs.disableInput,\n }\"\n ></i>\n </div>\n</ng-template>\n\n<ng-template #list let-obs=\"obs\">\n <valtimo-carbon-list\n [items]=\"obs.listColumn\"\n [fields]=\"obs.fields\"\n [viewMode]=\"false\"\n [header]=\"false\"\n *ngIf=\"obs.listColumn; else loading\"\n [lastColumnTemplate]=\"moveRowButtonsTemplateRef\"\n (rowClicked)=\"columnRowClicked($event)\"\n >\n </valtimo-carbon-list>\n</ng-template>\n\n<ng-template #createEditModal>\n <cds-modal\n *ngIf=\"{\n type: currentModalType$ | async,\n show: showModal$ | async,\n valid: valid$ | async,\n disableInput: disableInput$ | async,\n validKey: validKey$ | async,\n disableDefaultSort: disableDefaultSort$ | async,\n showEnum: showEnum$ | async,\n isYesNo: isYesNo$ | async,\n } as modalObs\"\n [open]=\"modalObs.show\"\n (close)=\"closeModal()\"\n >\n <cds-modal-header [showCloseButton]=\"true\" (closeSelect)=\"closeModal()\">\n <h3 cdsModalHeaderHeading>\n {{\n modalObs.type === 'create'\n ? ('listColumn.addButtonText' | translate)\n : ('listColumn.editColumnTitle' | translate)\n }}\n </h3>\n </cds-modal-header>\n <section cdsModalContent>\n <ng-container *ngTemplateOutlet=\"modalContent; context: {modalObs: modalObs}\"></ng-container>\n </section>\n <ng-container *ngTemplateOutlet=\"modalFooter; context: {modalObs: modalObs}\"></ng-container>\n </cds-modal>\n</ng-template>\n\n<ng-template #modalContent let-modalObs=\"modalObs\">\n <form [formGroup]=\"formGroup\" class=\"list-column-form\">\n <div class=\"cds--text-input__field-wrapper\">\n <cds-label [disabled]=\"modalObs.disableInput\">\n <span class=\"label-with-tooltip\">\n {{ 'listColumn.titleTitle' | translate }}\n <v-tooltip-icon\n [tooltip]=\"'listColumn.titleTooltip' | translate\"\n [disabled]=\"modalObs.disableInput\"\n ></v-tooltip-icon>\n </span>\n <input cdsText formControlName=\"title\" />\n </cds-label>\n </div>\n <div class=\"cds--text-input__field-wrapper\">\n <cds-label\n [disabled]=\"modalObs.disableInput || modalObs.type === 'edit'\"\n [invalid]=\"modalObs.validKey === false\"\n [invalidText]=\"'listColumn.uniqueKeyWarning' | translate\"\n >\n <span class=\"label-with-tooltip\">\n {{ 'listColumn.key' | translate }}\n <v-tooltip-icon\n [tooltip]=\"'listColumn.keyTooltip' | translate\"\n [disabled]=\"modalObs.disableInput\"\n ></v-tooltip-icon>\n </span>\n <input cdsText formControlName=\"key\" [invalid]=\"modalObs.validKey === false\" />\n </cds-label>\n </div>\n <div class=\"cds--text-input__field-wrapper\">\n <cds-label [disabled]=\"modalObs.disableInput\">\n <span class=\"label-with-tooltip\">\n {{ 'listColumn.path' | translate }}\n <v-tooltip-icon\n [tooltip]=\"'listColumn.objectsApiPathTooltip' | translate\"\n [disabled]=\"modalObs.disableInput\"\n ></v-tooltip-icon>\n </span>\n <input cdsText formControlName=\"path\" />\n </cds-label>\n </div>\n <div class=\"cds--text-input__field-wrapper\">\n <cds-label [disabled]=\"modalObs.disableInput\">\n <span class=\"label-with-tooltip select-label\">\n {{ 'listColumn.displayType' | translate }}\n <v-tooltip-icon\n [tooltip]=\"'listColumn.displayTypeTooltip' | translate\"\n [disabled]=\"modalObs.disableInput\"\n ></v-tooltip-icon>\n </span>\n <cds-dropdown formControlName=\"displayType\" [disabled]=\"modalObs.disableInput\">\n <cds-dropdown-list [items]=\"viewTypeItems$ | async\"></cds-dropdown-list>\n </cds-dropdown>\n </cds-label>\n </div>\n <div class=\"cds--text-input__field-wrapper\" *ngIf=\"showDateFormat$ | async\">\n <cds-label [disabled]=\"modalObs.disableInput\">\n <span class=\"label-with-tooltip\">\n {{ 'listColumn.dateFormat' | translate }}\n <v-tooltip-icon\n [tooltip]=\"'listColumn.dateFormatTooltip' | translate\"\n [disabled]=\"modalObs.disableInput\"\n ></v-tooltip-icon>\n </span>\n <input cdsText formControlName=\"dateFormat\" />\n </cds-label>\n </div>\n <div class=\"cds--text-input__field-wrapper\" *ngIf=\"modalObs.showEnum || modalObs.isYesNo\">\n <cds-label [disabled]=\"modalObs.disableInput\">\n <span class=\"label-with-tooltip select-label\">\n {{\n modalObs.isYesNo\n ? ('listColumn.enumTitleOptional' | translate)\n : ('listColumn.enumTitle' | translate)\n }}\n <v-tooltip-icon\n [tooltip]=\"'listColumn.enumTooltip' | translate\"\n [disabled]=\"modalObs.disableInput\"\n ></v-tooltip-icon>\n </span>\n <valtimo-carbon-multi-input\n *ngIf=\"(showModal$ | async) || (modalShowing$ | async)\"\n type=\"keyValue\"\n (valueChange)=\"enumValueChange($event)\"\n [defaultValues]=\"defaultEnumValues$ | async\"\n ></valtimo-carbon-multi-input>\n </cds-label>\n </div>\n <div class=\"cds--text-input__field-wrapper\">\n <cds-checkbox formControlName=\"sortable\"\n >{{ 'listColumn.sortable' | translate }}\n </cds-checkbox>\n </div>\n <div class=\"cds--text-input__field-wrapper\">\n <cds-label [disabled]=\"modalObs.disableInput || modalObs.disableDefaultSort\">\n <span class=\"label-with-tooltip select-label\">\n {{ 'listColumn.defaultSortTitle' | translate }}\n <v-tooltip-icon\n [tooltip]=\"'listColumn.defaultSortTooltip' | translate\"\n [disabled]=\"modalObs.disableInput\"\n ></v-tooltip-icon>\n </span>\n <cds-dropdown\n formControlName=\"defaultSort\"\n [disabled]=\"modalObs.disableInput || modalObs.disableDefaultSort\"\n >\n <cds-dropdown-list [items]=\"sortItems$ | async\"></cds-dropdown-list>\n </cds-dropdown>\n </cds-label>\n </div>\n </form>\n</ng-template>\n\n<ng-template #modalFooter let-modalObs=\"modalObs\">\n <cds-modal-footer>\n <ng-container>\n <button\n cdsButton=\"secondary\"\n [attr.modal-primary-focus]=\"true\"\n (click)=\"closeModal()\"\n [disabled]=\"modalObs.disableInput\"\n >\n {{ 'listColumn.close' | translate }}\n </button>\n <button\n cdsButton=\"primary\"\n [attr.modal-primary-focus]=\"true\"\n [disabled]=\"modalObs.valid === false\"\n (click)=\"saveCasListColumns()\"\n [disabled]=\"\n modalObs.disableInput || modalObs.valid === false || modalObs.validKey === false\n \"\n >\n {{ 'listColumn.save' | translate }}\n </button>\n </ng-container>\n </cds-modal-footer>\n</ng-template>\n\n<ng-template #deleteModal>\n <valtimo-confirmation-modal\n [showModalSubject$]=\"showDeleteModal$\"\n [outputOnConfirm]=\"deleteRowIndex$ | async\"\n (confirmEvent)=\"deleteRowConfirmation($event)\"\n confirmButtonTextTranslationKey=\"listColumn.deleteColumn\"\n titleTranslationKey=\"listColumn.deleteColumn\"\n contentTranslationKey=\"listColumn.deleteColumnConfirmation\"\n ></valtimo-confirmation-modal>\n</ng-template>\n\n<ng-template #noConfigWarning>\n <div class=\"pl-2 pr-2 pb-2\">\n <cds-notification\n [notificationObj]=\"{\n type: 'info',\n title: 'listColumn.noConfigWarningTitle' | translate,\n showClose: false,\n }\"\n >\n </cds-notification>\n </div>\n</ng-template>\n\n<ng-template #loading>\n <div class=\"loading-icon\"><cds-loading></cds-loading></div>\n</ng-template>\n", styles: ["::ng-deep .tab-container{min-height:unset!important}::ng-deep .cds--inline-notification{max-width:100%}.label-with-tooltip{display:flex;align-items:center}.cds--text-input__field-wrapper:not(:last-child){margin-bottom:1rem}.display-type-dropdown{width:300px}.list-column-form{margin-bottom:3rem}.select-label{padding-bottom:.5rem;width:250px}.loading-icon{width:100%;display:flex;align-items:center;justify-content:center}.center-link{display:flex;align-items:center}::ng-deep .move-row-buttons{display:flex;flex-direction:row;justify-content:flex-end;padding-right:13px}\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: "directive", type: i6.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i6.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i7.Label, selector: "cds-label, ibm-label", inputs: ["labelInputID", "disabled", "skeleton", "helperText", "invalidText", "invalid", "warn", "warnText", "ariaLabel"] }, { kind: "directive", type: i7.TextInput, selector: "[cdsText], [ibmText]", inputs: ["theme", "size", "invalid", "warn", "skeleton"] }, { kind: "directive", type: i7.Button, selector: "[cdsButton], [ibmButton]", inputs: ["ibmButton", "cdsButton", "size", "skeleton", "iconOnly", "isExpressive"] }, { kind: "component", type: i5.TooltipIconComponent, selector: "v-tooltip-icon", inputs: ["tooltip", "disabled"] }, { kind: "component", type: i5.CarbonMultiInputComponent, selector: "valtimo-carbon-multi-input", inputs: ["addRowText", "addButtonType", "addRowTranslationKey", "arbitraryAmountTitles", "arbitraryValueAmount", "defaultValues", "deleteRowText", "deleteRowTranslationKey", "disabled", "dropdownColumnTitle", "dropdownItems", "dropdownWidth", "fullWidth", "hideAddButton", "hideDeleteButton", "initialAmountOfRows", "keyColumnTitle", "margin", "maxRows", "minimumAmountOfRows", "name", "required", "title", "titleTranslationKey", "tooltip", "type", "valueColumnTitle", "valuePathSelectorCaseDefinitionKey", "valuePathSelectorPrefixes", "valuePathSelectorShowCaseDefinitionSelector", "valuePathSelectorNotation", "keyColumnFlex", "dropdownColumnFlex", "valueColumnFlex"], outputs: ["valueChange", "allValuesValidEvent"] }, { kind: "component", type: i7.Modal, selector: "cds-modal, ibm-modal", inputs: ["size", "theme", "ariaLabel", "open", "trigger", "hasScrollingContent"], outputs: ["overlaySelected", "close"] }, { kind: "component", type: i7.ModalHeader, selector: "cds-modal-header, ibm-modal-header", inputs: ["theme", "closeLabel", "showCloseButton"], outputs: ["closeSelect"] }, { kind: "component", type: i7.ModalFooter, selector: "cds-modal-footer, ibm-modal-footer" }, { kind: "directive", type: i7.ModalContent, selector: "[cdsModalContent], [ibmModalContent]", inputs: ["hasForm"] }, { kind: "directive", type: i7.ModalHeaderHeading, selector: "[cdsModalHeaderHeading], [ibmModalHeaderHeading]" }, { kind: "component", type: i7.Notification, selector: "cds-notification, cds-inline-notification, ibm-notification, ibm-inline-notification", inputs: ["notificationObj"] }, { kind: "component", type: i7.Loading, selector: "cds-loading, ibm-loading", inputs: ["title", "isActive", "size", "overlay"] }, { kind: "component", type: i7.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: i7.DropdownList, selector: "cds-dropdown-list, ibm-dropdown-list", inputs: ["ariaLabel", "items", "listTpl", "type", "showTitles"], outputs: ["select", "scroll", "blurIntent"] }, { kind: "component", type: i7.Checkbox, selector: "cds-checkbox, ibm-checkbox", inputs: ["disabled", "skeleton", "hideLabel", "name", "id", "required", "value", "ariaLabel", "ariaLabelledby", "indeterminate", "checked"], outputs: ["click", "checkedChange", "indeterminateChange"] }, { kind: "directive", type: i7.Link, selector: "[cdsLink], [ibmLink]", inputs: ["inline", "disabled"] }, { kind: "directive", type: i7.IconDirective, selector: "[cdsIcon], [ibmIcon]", inputs: ["ibmIcon", "cdsIcon", "size", "title", "ariaLabel", "ariaLabelledBy", "ariaHidden", "isFocusable"] }, { kind: "directive", type: i9.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i9.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: i9.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i9.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i9.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i9.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i5.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: i5.CarbonListComponent, selector: "valtimo-carbon-list", inputs: ["items", "fields", "tableTranslations", "paginatorConfig", "pagination", "loading", "actions", "actionItems", "showActionItems", "header", "hideColumnHeader", "initialSortState", "sortState", "isSearchable", "enableSingleSelection", "lastColumnTemplate", "paginationIdentifier", "showSelectionColumn", "striped", "hideToolbar", "lockedTooltipTranslationKey", "movingRowsEnabled", "dragAndDrop", "dragAndDropDisabled"], outputs: ["rowClicked", "paginationClicked", "paginationSet", "search", "sortChanged", "moveRow", "itemsReordered"] }, { kind: "pipe", type: i6.AsyncPipe, name: "async" }, { kind: "pipe", type: i3$1.TranslatePipe, name: "translate" }] }); }
834
+ }
835
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: ObjectManagementListColumnsComponent, decorators: [{
836
+ type: Component,
837
+ args: [{ standalone: false, selector: 'valtimo-object-management-list-columns', template: "<!--\n ~ Copyright 2015-2025 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n<ng-container\n *ngIf=\"{\n listColumn: translatedObjectManagementListColumns$ | async,\n fields: objectManagementFields$ | async,\n objectId: objectId$ | async,\n downloadUrl: downloadUrl$ | async,\n downloadName: downloadName$ | async,\n loading: loading$ | async,\n } as obs\"\n>\n <div class=\"container-fluid pr-0 pl-0\">\n <div class=\"text-right\">\n <div class=\"btn-group mt-m3px mb-3 mr-2\">\n <ng-container *ngTemplateOutlet=\"buttons; context: {obs: obs}\"></ng-container>\n </div>\n </div>\n <ng-container *ngIf=\"!obs.loading; else loading\">\n <ng-container *ngIf=\"obs.listColumn?.length > 0; else noConfigWarning\">\n <ng-container *ngTemplateOutlet=\"list; context: {obs: obs}\"></ng-container>\n </ng-container>\n </ng-container>\n <ng-container *ngTemplateOutlet=\"createEditModal\"></ng-container>\n <ng-container *ngTemplateOutlet=\"deleteModal\"></ng-container>\n </div>\n</ng-container>\n\n<ng-template #buttons let-obs=\"obs\">\n <a\n cdsLink\n class=\"center-link\"\n [href]=\"obs.downloadUrl\"\n [download]=\"obs.downloadName\"\n [disabled]=\"\n !obs.downloadUrl ||\n !obs.downloadName ||\n obs.listColumn?.length < 1 ||\n obs.disableInput ||\n obs.loading\n \"\n >\n {{ 'listColumn.downloadButtonText' | translate }}\n </a>\n <button\n (click)=\"openModal('create')\"\n cdsButton=\"primary\"\n size=\"md\"\n [disabled]=\"obs.loading\"\n class=\"ml-3\"\n >\n {{ 'listColumn.addButtonText' | translate }}\n <svg class=\"cds--btn__icon\" cdsIcon=\"add\" size=\"16\"></svg>\n </button>\n</ng-template>\n\n<ng-template #moveRowButtons let-index=\"index\" let-length=\"length\">\n <div\n class=\"move-row-buttons\"\n *ngIf=\"{\n disableInput: disableInput$ | async,\n objectId: objectId$ | async,\n } as obs\"\n >\n <i\n class=\"mdi mdi-delete btn btn-outline-danger mr-1\"\n (click)=\"deleteRow(index, $event)\"\n [ngClass]=\"{'disabled disabled-move-row-button': obs.disableInput}\"\n ></i>\n <i\n class=\"mdi mdi-arrow-up-bold btn btn-outline-primary mr-1\"\n (click)=\"moveRow(index, true, $event, obs.objectId)\"\n [ngClass]=\"{'disabled disabled-move-row-button': index === 0 || obs.disableInput}\"\n ></i>\n <i\n class=\"mdi mdi-arrow-down-bold btn btn-outline-secondary\"\n (click)=\"moveRow(index, false, $event, obs.objectId)\"\n [ngClass]=\"{\n 'disabled disabled-move-row-button': index === length - 1 || obs.disableInput,\n }\"\n ></i>\n </div>\n</ng-template>\n\n<ng-template #list let-obs=\"obs\">\n <valtimo-carbon-list\n [items]=\"obs.listColumn\"\n [fields]=\"obs.fields\"\n [viewMode]=\"false\"\n [header]=\"false\"\n *ngIf=\"obs.listColumn; else loading\"\n [lastColumnTemplate]=\"moveRowButtonsTemplateRef\"\n (rowClicked)=\"columnRowClicked($event)\"\n >\n </valtimo-carbon-list>\n</ng-template>\n\n<ng-template #createEditModal>\n <cds-modal\n *ngIf=\"{\n type: currentModalType$ | async,\n show: showModal$ | async,\n valid: valid$ | async,\n disableInput: disableInput$ | async,\n validKey: validKey$ | async,\n disableDefaultSort: disableDefaultSort$ | async,\n showEnum: showEnum$ | async,\n isYesNo: isYesNo$ | async,\n } as modalObs\"\n [open]=\"modalObs.show\"\n (close)=\"closeModal()\"\n >\n <cds-modal-header [showCloseButton]=\"true\" (closeSelect)=\"closeModal()\">\n <h3 cdsModalHeaderHeading>\n {{\n modalObs.type === 'create'\n ? ('listColumn.addButtonText' | translate)\n : ('listColumn.editColumnTitle' | translate)\n }}\n </h3>\n </cds-modal-header>\n <section cdsModalContent>\n <ng-container *ngTemplateOutlet=\"modalContent; context: {modalObs: modalObs}\"></ng-container>\n </section>\n <ng-container *ngTemplateOutlet=\"modalFooter; context: {modalObs: modalObs}\"></ng-container>\n </cds-modal>\n</ng-template>\n\n<ng-template #modalContent let-modalObs=\"modalObs\">\n <form [formGroup]=\"formGroup\" class=\"list-column-form\">\n <div class=\"cds--text-input__field-wrapper\">\n <cds-label [disabled]=\"modalObs.disableInput\">\n <span class=\"label-with-tooltip\">\n {{ 'listColumn.titleTitle' | translate }}\n <v-tooltip-icon\n [tooltip]=\"'listColumn.titleTooltip' | translate\"\n [disabled]=\"modalObs.disableInput\"\n ></v-tooltip-icon>\n </span>\n <input cdsText formControlName=\"title\" />\n </cds-label>\n </div>\n <div class=\"cds--text-input__field-wrapper\">\n <cds-label\n [disabled]=\"modalObs.disableInput || modalObs.type === 'edit'\"\n [invalid]=\"modalObs.validKey === false\"\n [invalidText]=\"'listColumn.uniqueKeyWarning' | translate\"\n >\n <span class=\"label-with-tooltip\">\n {{ 'listColumn.key' | translate }}\n <v-tooltip-icon\n [tooltip]=\"'listColumn.keyTooltip' | translate\"\n [disabled]=\"modalObs.disableInput\"\n ></v-tooltip-icon>\n </span>\n <input cdsText formControlName=\"key\" [invalid]=\"modalObs.validKey === false\" />\n </cds-label>\n </div>\n <div class=\"cds--text-input__field-wrapper\">\n <cds-label [disabled]=\"modalObs.disableInput\">\n <span class=\"label-with-tooltip\">\n {{ 'listColumn.path' | translate }}\n <v-tooltip-icon\n [tooltip]=\"'listColumn.objectsApiPathTooltip' | translate\"\n [disabled]=\"modalObs.disableInput\"\n ></v-tooltip-icon>\n </span>\n <input cdsText formControlName=\"path\" />\n </cds-label>\n </div>\n <div class=\"cds--text-input__field-wrapper\">\n <cds-label [disabled]=\"modalObs.disableInput\">\n <span class=\"label-with-tooltip select-label\">\n {{ 'listColumn.displayType' | translate }}\n <v-tooltip-icon\n [tooltip]=\"'listColumn.displayTypeTooltip' | translate\"\n [disabled]=\"modalObs.disableInput\"\n ></v-tooltip-icon>\n </span>\n <cds-dropdown formControlName=\"displayType\" [disabled]=\"modalObs.disableInput\">\n <cds-dropdown-list [items]=\"viewTypeItems$ | async\"></cds-dropdown-list>\n </cds-dropdown>\n </cds-label>\n </div>\n <div class=\"cds--text-input__field-wrapper\" *ngIf=\"showDateFormat$ | async\">\n <cds-label [disabled]=\"modalObs.disableInput\">\n <span class=\"label-with-tooltip\">\n {{ 'listColumn.dateFormat' | translate }}\n <v-tooltip-icon\n [tooltip]=\"'listColumn.dateFormatTooltip' | translate\"\n [disabled]=\"modalObs.disableInput\"\n ></v-tooltip-icon>\n </span>\n <input cdsText formControlName=\"dateFormat\" />\n </cds-label>\n </div>\n <div class=\"cds--text-input__field-wrapper\" *ngIf=\"modalObs.showEnum || modalObs.isYesNo\">\n <cds-label [disabled]=\"modalObs.disableInput\">\n <span class=\"label-with-tooltip select-label\">\n {{\n modalObs.isYesNo\n ? ('listColumn.enumTitleOptional' | translate)\n : ('listColumn.enumTitle' | translate)\n }}\n <v-tooltip-icon\n [tooltip]=\"'listColumn.enumTooltip' | translate\"\n [disabled]=\"modalObs.disableInput\"\n ></v-tooltip-icon>\n </span>\n <valtimo-carbon-multi-input\n *ngIf=\"(showModal$ | async) || (modalShowing$ | async)\"\n type=\"keyValue\"\n (valueChange)=\"enumValueChange($event)\"\n [defaultValues]=\"defaultEnumValues$ | async\"\n ></valtimo-carbon-multi-input>\n </cds-label>\n </div>\n <div class=\"cds--text-input__field-wrapper\">\n <cds-checkbox formControlName=\"sortable\"\n >{{ 'listColumn.sortable' | translate }}\n </cds-checkbox>\n </div>\n <div class=\"cds--text-input__field-wrapper\">\n <cds-label [disabled]=\"modalObs.disableInput || modalObs.disableDefaultSort\">\n <span class=\"label-with-tooltip select-label\">\n {{ 'listColumn.defaultSortTitle' | translate }}\n <v-tooltip-icon\n [tooltip]=\"'listColumn.defaultSortTooltip' | translate\"\n [disabled]=\"modalObs.disableInput\"\n ></v-tooltip-icon>\n </span>\n <cds-dropdown\n formControlName=\"defaultSort\"\n [disabled]=\"modalObs.disableInput || modalObs.disableDefaultSort\"\n >\n <cds-dropdown-list [items]=\"sortItems$ | async\"></cds-dropdown-list>\n </cds-dropdown>\n </cds-label>\n </div>\n </form>\n</ng-template>\n\n<ng-template #modalFooter let-modalObs=\"modalObs\">\n <cds-modal-footer>\n <ng-container>\n <button\n cdsButton=\"secondary\"\n [attr.modal-primary-focus]=\"true\"\n (click)=\"closeModal()\"\n [disabled]=\"modalObs.disableInput\"\n >\n {{ 'listColumn.close' | translate }}\n </button>\n <button\n cdsButton=\"primary\"\n [attr.modal-primary-focus]=\"true\"\n [disabled]=\"modalObs.valid === false\"\n (click)=\"saveCasListColumns()\"\n [disabled]=\"\n modalObs.disableInput || modalObs.valid === false || modalObs.validKey === false\n \"\n >\n {{ 'listColumn.save' | translate }}\n </button>\n </ng-container>\n </cds-modal-footer>\n</ng-template>\n\n<ng-template #deleteModal>\n <valtimo-confirmation-modal\n [showModalSubject$]=\"showDeleteModal$\"\n [outputOnConfirm]=\"deleteRowIndex$ | async\"\n (confirmEvent)=\"deleteRowConfirmation($event)\"\n confirmButtonTextTranslationKey=\"listColumn.deleteColumn\"\n titleTranslationKey=\"listColumn.deleteColumn\"\n contentTranslationKey=\"listColumn.deleteColumnConfirmation\"\n ></valtimo-confirmation-modal>\n</ng-template>\n\n<ng-template #noConfigWarning>\n <div class=\"pl-2 pr-2 pb-2\">\n <cds-notification\n [notificationObj]=\"{\n type: 'info',\n title: 'listColumn.noConfigWarningTitle' | translate,\n showClose: false,\n }\"\n >\n </cds-notification>\n </div>\n</ng-template>\n\n<ng-template #loading>\n <div class=\"loading-icon\"><cds-loading></cds-loading></div>\n</ng-template>\n", styles: ["::ng-deep .tab-container{min-height:unset!important}::ng-deep .cds--inline-notification{max-width:100%}.label-with-tooltip{display:flex;align-items:center}.cds--text-input__field-wrapper:not(:last-child){margin-bottom:1rem}.display-type-dropdown{width:300px}.list-column-form{margin-bottom:3rem}.select-label{padding-bottom:.5rem;width:250px}.loading-icon{width:100%;display:flex;align-items:center;justify-content:center}.center-link{display:flex;align-items:center}::ng-deep .move-row-buttons{display:flex;flex-direction:row;justify-content:flex-end;padding-right:13px}\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"] }]
838
+ }], ctorParameters: () => [{ type: ObjectManagementService }, { type: i2.ActivatedRoute }, { type: i3$1.TranslateService }, { type: i4.ConfigService }, { type: i5$1.DomSanitizer }], propDecorators: { moveRowButtonsTemplateRef: [{
839
+ type: ViewChild,
840
+ args: ['moveRowButtons']
841
+ }] } });
842
+
843
+ /*
844
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
845
+ *
846
+ * Licensed under EUPL, Version 1.2 (the "License");
847
+ * you may not use this file except in compliance with the License.
848
+ * You may obtain a copy of the License at
849
+ *
850
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
851
+ *
852
+ * Unless required by applicable law or agreed to in writing, software
853
+ * distributed under the License is distributed on an "AS IS" basis,
854
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
855
+ * See the License for the specific language governing permissions and
856
+ * limitations under the License.
857
+ */
858
+ class ObjectManagementListSearchFieldsComponent {
859
+ constructor(objectManagementService, route, translateService, configService, sanitizer) {
860
+ this.objectManagementService = objectManagementService;
861
+ this.route = route;
862
+ this.translateService = translateService;
863
+ this.configService = configService;
864
+ this.sanitizer = sanitizer;
865
+ this.downloadName$ = new BehaviorSubject('');
866
+ this.downloadUrl$ = new BehaviorSubject(undefined);
867
+ this.loading$ = new BehaviorSubject(true);
868
+ this.currentModalType$ = new BehaviorSubject('create');
869
+ this.showModal$ = new BehaviorSubject(false);
870
+ this.disableInput$ = new BehaviorSubject(false);
871
+ this.showDeleteModal$ = new Subject();
872
+ this.deleteRowIndex$ = new BehaviorSubject(0);
873
+ this.INVALID_KEY = 'invalid';
874
+ this.formGroup = new FormGroup({
875
+ title: new FormControl(''),
876
+ key: new FormControl('', Validators.required),
877
+ path: new FormControl('', Validators.required),
878
+ dataType: new FormControl({
879
+ key: this.INVALID_KEY,
880
+ }),
881
+ fieldType: new FormControl({
882
+ key: this.INVALID_KEY,
883
+ }),
884
+ });
885
+ this.COLUMNS = [
886
+ {
887
+ viewType: 'string',
888
+ sortable: false,
889
+ propertyName: 'title',
890
+ translationKey: 'title',
891
+ },
892
+ {
893
+ viewType: 'string',
894
+ sortable: false,
895
+ propertyName: 'key',
896
+ translationKey: 'key',
897
+ },
898
+ {
899
+ viewType: 'string',
900
+ sortable: false,
901
+ propertyName: 'path',
902
+ translationKey: 'path',
903
+ },
904
+ {
905
+ viewType: 'string',
906
+ sortable: false,
907
+ propertyName: 'dataType',
908
+ translationKey: 'dataType',
909
+ },
910
+ {
911
+ viewType: 'string',
912
+ sortable: false,
913
+ propertyName: 'fieldType',
914
+ translationKey: 'fieldType',
915
+ },
916
+ ];
917
+ this.DATA_TYPES = [
918
+ 'text',
919
+ 'number',
920
+ 'date',
921
+ 'datetime',
922
+ 'boolean',
923
+ ];
924
+ this.FIELD_TYPES = ['single', 'range'];
925
+ this.cachedObjectManagementListSearchFields = [];
926
+ this.refreshObjectManagementListSearchFields$ = new BehaviorSubject(null);
927
+ this.objectManagementFields$ = this.translateService
928
+ .stream('key')
929
+ .pipe(map(() => this.COLUMNS.map(column => ({
930
+ key: column.propertyName,
931
+ label: this.translateService.instant(`searchFieldsOverview.${column.translationKey}`),
932
+ sortable: column.sortable,
933
+ ...(column.viewType && { viewType: column.viewType }),
934
+ }))));
935
+ this.objectId$ = this.route.params.pipe(map(params => params.id || ''), filter(objectId => !!objectId));
936
+ this.objectManagementListSearchFields$ = combineLatest([
937
+ this.objectId$,
938
+ this.refreshObjectManagementListSearchFields$,
939
+ ]).pipe(switchMap(([objectId]) => this.objectManagementService.getSearchField(objectId)), tap(objectManagementListSearchFields => {
940
+ this.objectId$.pipe(take(1)).subscribe(objectId => {
941
+ if (objectManagementListSearchFields &&
942
+ Array.isArray(objectManagementListSearchFields) &&
943
+ objectManagementListSearchFields.length > 0) {
944
+ this.setDownload(objectId, objectManagementListSearchFields);
945
+ }
946
+ });
947
+ }), tap(objectManagementListSearchFields => {
948
+ this.cachedObjectManagementListSearchFields = objectManagementListSearchFields;
949
+ this.loading$.next(false);
950
+ this.enableInput();
951
+ }));
952
+ this.translatedObjectManagementListSearchFields$ = combineLatest([
953
+ this.objectManagementListSearchFields$,
954
+ this.translateService.stream('key'),
955
+ ]).pipe(map(([columns]) => columns.map(column => ({
956
+ ...column,
957
+ title: column.title || '-',
958
+ dataType: this.translateService.instant(`searchFields.${column?.dataType?.toLowerCase()}`),
959
+ fieldType: this.translateService.instant(`searchFieldsOverview.${column?.fieldType?.toLowerCase()}`),
960
+ }))));
961
+ this.selectedDataTypeItemIndex$ = new BehaviorSubject(0);
962
+ this.dataTypeItems$ = combineLatest([
963
+ this.selectedDataTypeItemIndex$,
964
+ this.translateService.stream('key'),
965
+ ]).pipe(map(([selectedDataTypeItemIndex]) => [
966
+ {
967
+ content: this.translateService.instant(`searchFieldDataType.select`),
968
+ key: this.INVALID_KEY,
969
+ },
970
+ ...this.DATA_TYPES.map(type => ({
971
+ content: this.translateService.instant(`searchFields.${type}`),
972
+ key: type.toUpperCase(),
973
+ })),
974
+ ].map((item, index) => ({
975
+ ...item,
976
+ selected: index === selectedDataTypeItemIndex,
977
+ }))));
978
+ this.selectedFieldTypeItemIndex$ = new BehaviorSubject(0);
979
+ this.fieldTypeItems$ = combineLatest([
980
+ this.selectedFieldTypeItemIndex$,
981
+ this.translateService.stream('key'),
982
+ ]).pipe(map(([selectedFieldTypeItemIndex]) => [
983
+ {
984
+ content: this.translateService.instant(`searchFieldFieldType.select`),
985
+ key: this.INVALID_KEY,
986
+ },
987
+ ...this.FIELD_TYPES.map(type => ({
988
+ content: this.translateService.instant(`searchFieldsOverview.${type}`),
989
+ key: type.toUpperCase(),
990
+ })),
991
+ ].map((item, index) => ({
992
+ ...item,
993
+ selected: index === selectedFieldTypeItemIndex,
994
+ }))));
995
+ this.validKey$ = combineLatest([this.formGroup.valueChanges, this.currentModalType$]).pipe(map(([formValues, currentModalType]) => {
996
+ const existingKeys = this.cachedObjectManagementListSearchFields.map(column => column.key);
997
+ return currentModalType === 'create' ? !existingKeys.includes(formValues.key) : true;
998
+ }), startWith(false));
999
+ this.valid$ = combineLatest([this.formGroup.valueChanges, this.validKey$]).pipe(map(([formValues, validKey]) => !!(formValues.path && validKey)), startWith(false));
1000
+ }
1001
+ openModal(modalType) {
1002
+ this.showModal$.next(true);
1003
+ this.currentModalType$.next(modalType);
1004
+ if (modalType === 'create') {
1005
+ this.formGroup.controls['key'].enable();
1006
+ this.resetFormGroup();
1007
+ }
1008
+ else if (modalType === 'edit') {
1009
+ this.formGroup.controls['key'].disable();
1010
+ }
1011
+ }
1012
+ closeModal() {
1013
+ this.showModal$.next(false);
1014
+ }
1015
+ deleteRow(listSearchFieldRowIndex, clickEvent) {
1016
+ clickEvent.stopPropagation();
1017
+ this.showDeleteModal$.next(true);
1018
+ this.deleteRowIndex$.next(listSearchFieldRowIndex);
1019
+ }
1020
+ deleteRowConfirmation(listSearchFieldRowIndex) {
1021
+ const columnKey = this.getColumnKey(listSearchFieldRowIndex);
1022
+ if (columnKey) {
1023
+ this.disableInput();
1024
+ this.objectId$
1025
+ .pipe(take(1), switchMap(objectId => this.objectManagementService.deleteSearchField(objectId, columnKey)), tap(() => this.refreshObjectManagementListSearchFields()), catchError(() => {
1026
+ this.enableInput();
1027
+ return of(null);
1028
+ }))
1029
+ .subscribe();
1030
+ }
1031
+ }
1032
+ getColumnKey(listSearchFieldRowIndex) {
1033
+ return this.cachedObjectManagementListSearchFields[listSearchFieldRowIndex]?.key;
1034
+ }
1035
+ moveRow(listSearchFieldRowIndex, moveUp, clickEvent, objectId) {
1036
+ const objectManagementListSearchFields = [...this.cachedObjectManagementListSearchFields];
1037
+ const listSearchFieldRow = objectManagementListSearchFields[listSearchFieldRowIndex];
1038
+ clickEvent.stopPropagation();
1039
+ const listSearchFieldIndex = objectManagementListSearchFields.findIndex(field => field.key === listSearchFieldRow.key);
1040
+ const foundListSearchField = { ...objectManagementListSearchFields[listSearchFieldIndex] };
1041
+ const filteredListSearchField = objectManagementListSearchFields.filter(field => field.key !== listSearchFieldRow.key);
1042
+ const multipleListSearchFields = objectManagementListSearchFields.length > 1;
1043
+ if (multipleListSearchFields && moveUp && listSearchFieldIndex > 0) {
1044
+ const listSearchFieldBeforeKey = `${objectManagementListSearchFields[listSearchFieldIndex - 1].key}`;
1045
+ const listSearchFieldBeforeIndex = filteredListSearchField.findIndex(field => field.key === listSearchFieldBeforeKey);
1046
+ filteredListSearchField.splice(listSearchFieldBeforeIndex, 0, foundListSearchField);
1047
+ this.updateObjectManagementListSearchField(objectId, filteredListSearchField);
1048
+ }
1049
+ else if (multipleListSearchFields &&
1050
+ !moveUp &&
1051
+ listSearchFieldIndex < objectManagementListSearchFields.length) {
1052
+ const caseListColumnAfterKey = `${objectManagementListSearchFields[listSearchFieldIndex + 1].key}`;
1053
+ const caseListColumnAfterIndex = filteredListSearchField.findIndex(field => field.key === caseListColumnAfterKey);
1054
+ filteredListSearchField.splice(caseListColumnAfterIndex + 1, 0, foundListSearchField);
1055
+ this.updateObjectManagementListSearchField(objectId, filteredListSearchField);
1056
+ }
1057
+ }
1058
+ saveListSearchFields() {
1059
+ this.disableInput();
1060
+ this.currentModalType$.pipe(take(1)).subscribe(currentModalType => {
1061
+ if (currentModalType === 'create') {
1062
+ this.addSearchField();
1063
+ }
1064
+ else {
1065
+ this.updateSearchField();
1066
+ }
1067
+ });
1068
+ }
1069
+ columnRowClicked(row) {
1070
+ this.resetFormGroup();
1071
+ combineLatest([this.dataTypeItems$, this.fieldTypeItems$])
1072
+ .pipe(take(1))
1073
+ .subscribe(([dataTypeItems, fieldTypeItems]) => {
1074
+ const column = this.cachedObjectManagementListSearchFields.find(cachedColumn => cachedColumn.key === row.key);
1075
+ const dataTypeItem = dataTypeItems.find(item => item.key === column.dataType);
1076
+ const dataTypeItemIndex = dataTypeItems.findIndex(item => item.key === column.dataType);
1077
+ const fieldTypeItem = fieldTypeItems.find(item => item.key === column.fieldType);
1078
+ const fieldTypeItemIndex = fieldTypeItems.findIndex(item => item.key === column.fieldType);
1079
+ this.selectedDataTypeItemIndex$.next(dataTypeItemIndex);
1080
+ this.selectedFieldTypeItemIndex$.next(fieldTypeItemIndex);
1081
+ this.formGroup.patchValue({
1082
+ key: column.key,
1083
+ title: column.title,
1084
+ path: column.path,
1085
+ // @ts-ignore
1086
+ dataType: { ...dataTypeItem },
1087
+ // @ts-ignore
1088
+ fieldType: { ...fieldTypeItem },
1089
+ });
1090
+ this.openModal('edit');
1091
+ });
1092
+ }
1093
+ updateObjectManagementListSearchField(objectId, searchField) {
1094
+ this.disableInput();
1095
+ this.objectManagementService
1096
+ .putSearchFields(objectId, searchField)
1097
+ .pipe(tap(() => {
1098
+ this.refreshObjectManagementListSearchFields();
1099
+ localStorage.setItem(`list-search-fields${objectId}`, null);
1100
+ }), catchError(() => {
1101
+ this.enableInput();
1102
+ return of(null);
1103
+ }))
1104
+ .subscribe();
1105
+ }
1106
+ addSearchField() {
1107
+ const formValue = this.formGroup.value;
1108
+ this.objectId$
1109
+ .pipe(take(1), switchMap(objectId => this.objectManagementService.postSearchField(objectId, this.mapFormValuesToColumn(formValue))), tap(() => {
1110
+ this.closeModal();
1111
+ this.refreshObjectManagementListSearchFields();
1112
+ }), catchError(() => {
1113
+ this.enableInput();
1114
+ return of(null);
1115
+ }))
1116
+ .subscribe();
1117
+ }
1118
+ updateSearchField() {
1119
+ this.objectId$
1120
+ .pipe(take(1), switchMap(objectId => this.objectManagementService.putSearchField(objectId, this.formGroup.value.key, this.mapFormValuesToColumn(this.formGroup.value))), tap(() => {
1121
+ this.closeModal();
1122
+ this.refreshObjectManagementListSearchFields();
1123
+ }), catchError(() => {
1124
+ this.enableInput();
1125
+ return of(null);
1126
+ }))
1127
+ .subscribe();
1128
+ }
1129
+ setDownload(objectId, ObjectManagementSearchFields) {
1130
+ this.downloadName$.next(`${objectId}.json`);
1131
+ this.downloadUrl$.next(this.sanitizer.bypassSecurityTrustUrl('data:text/json;charset=UTF-8,' +
1132
+ encodeURIComponent(JSON.stringify(ObjectManagementSearchFields, null, 2))));
1133
+ }
1134
+ disableInput() {
1135
+ this.disableInput$.next(true);
1136
+ this.formGroup.disable();
1137
+ }
1138
+ enableInput() {
1139
+ this.disableInput$.next(false);
1140
+ this.formGroup.enable();
1141
+ }
1142
+ refreshObjectManagementListSearchFields() {
1143
+ this.refreshObjectManagementListSearchFields$.next(null);
1144
+ }
1145
+ resetFormGroup() {
1146
+ this.formGroup.reset();
1147
+ this.selectedDataTypeItemIndex$.next(0);
1148
+ this.selectedFieldTypeItemIndex$.next(0);
1149
+ }
1150
+ mapFormValuesToColumn(formValue) {
1151
+ return {
1152
+ key: formValue.key,
1153
+ title: formValue.title || '',
1154
+ path: formValue.path,
1155
+ dataType: formValue.dataType.key,
1156
+ fieldType: formValue.fieldType.key,
1157
+ };
1158
+ }
1159
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: ObjectManagementListSearchFieldsComponent, deps: [{ token: ObjectManagementService }, { token: i2.ActivatedRoute }, { token: i3$1.TranslateService }, { token: i4.ConfigService }, { token: i5$1.DomSanitizer }], target: i0.ɵɵFactoryTarget.Component }); }
1160
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.17", type: ObjectManagementListSearchFieldsComponent, isStandalone: false, selector: "valtimo-object-management-list-search-fields", viewQueries: [{ propertyName: "moveRowButtonsTemplateRef", first: true, predicate: ["moveRowButtons"], 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<ng-container\n *ngIf=\"{\n searchFields: translatedObjectManagementListSearchFields$ | async,\n fields: objectManagementFields$ | async,\n objectId: objectId$ | async,\n downloadUrl: downloadUrl$ | async,\n downloadName: downloadName$ | async,\n loading: loading$ | async,\n } as obs\"\n>\n <div class=\"container-fluid pr-0 pl-0\">\n <div class=\"text-right\">\n <div class=\"btn-group mt-m3px mb-3 mr-2\">\n <ng-container *ngTemplateOutlet=\"buttons; context: {obs: obs}\"></ng-container>\n </div>\n </div>\n <ng-container *ngIf=\"!obs.loading; else loading\">\n <ng-container *ngIf=\"obs.searchFields?.length > 0; else noConfigWarning\">\n <ng-container *ngTemplateOutlet=\"list; context: {obs: obs}\"></ng-container>\n </ng-container>\n </ng-container>\n <ng-container *ngTemplateOutlet=\"createEditModal\"></ng-container>\n <ng-container *ngTemplateOutlet=\"deleteModal\"></ng-container>\n </div>\n</ng-container>\n\n<ng-template #buttons let-obs=\"obs\">\n <a\n cdsLink\n class=\"center-link\"\n [href]=\"obs.downloadUrl\"\n [download]=\"obs.downloadName\"\n [disabled]=\"\n !obs.downloadUrl ||\n !obs.downloadName ||\n obs.searchFields?.length < 1 ||\n obs.disableInput ||\n obs.loading\n \"\n >\n {{ 'searchFieldsOverview.download' | translate }}\n </a>\n <button\n (click)=\"openModal('create')\"\n cdsButton=\"primary\"\n size=\"md\"\n [disabled]=\"obs.loading\"\n class=\"ml-3\"\n >\n {{ 'searchFieldsOverview.add' | translate }}\n <svg class=\"cds--btn__icon\" cdsIcon=\"add\" size=\"16\"></svg>\n </button>\n</ng-template>\n\n<ng-template #moveRowButtons let-index=\"index\" let-length=\"length\">\n <div\n class=\"move-row-buttons\"\n *ngIf=\"{\n disableInput: disableInput$ | async,\n objectId: objectId$ | async,\n } as obs\"\n >\n <i\n class=\"mdi mdi-delete btn btn-outline-danger mr-1\"\n (click)=\"deleteRow(index, $event)\"\n [ngClass]=\"{'disabled disabled-move-row-button': obs.disableInput}\"\n ></i>\n <i\n class=\"mdi mdi-arrow-up-bold btn btn-outline-primary mr-1\"\n (click)=\"moveRow(index, true, $event, obs.objectId)\"\n [ngClass]=\"{'disabled disabled-move-row-button': index === 0 || obs.disableInput}\"\n ></i>\n <i\n class=\"mdi mdi-arrow-down-bold btn btn-outline-secondary\"\n (click)=\"moveRow(index, false, $event, obs.objectId)\"\n [ngClass]=\"{'disabled disabled-move-row-button': index === length - 1 || obs.disableInput}\"\n ></i>\n </div>\n</ng-template>\n\n<ng-template #list let-obs=\"obs\">\n <valtimo-carbon-list\n [items]=\"obs.searchFields\"\n [fields]=\"obs.fields\"\n [viewMode]=\"false\"\n [header]=\"false\"\n *ngIf=\"obs.searchFields; else loading\"\n [lastColumnTemplate]=\"moveRowButtonsTemplateRef\"\n (rowClicked)=\"columnRowClicked($event)\"\n >\n </valtimo-carbon-list>\n</ng-template>\n\n<ng-template #createEditModal>\n <cds-modal\n valtimoCdsModal\n *ngIf=\"{\n type: currentModalType$ | async,\n show: showModal$ | async,\n valid: valid$ | async,\n disableInput: disableInput$ | async,\n validKey: validKey$ | async,\n } as modalObs\"\n [open]=\"modalObs.show\"\n (close)=\"closeModal()\"\n >\n <cds-modal-header [showCloseButton]=\"true\" (closeSelect)=\"closeModal()\">\n <h3 cdsModalHeaderHeading>\n {{\n modalObs.type === 'create'\n ? ('searchFieldsOverview.add' | translate)\n : ('searchFieldsOverview.edit' | translate)\n }}\n </h3>\n </cds-modal-header>\n <section cdsModalContent>\n <ng-container *ngTemplateOutlet=\"modalContent; context: {modalObs: modalObs}\"></ng-container>\n </section>\n <ng-container *ngTemplateOutlet=\"modalFooter; context: {modalObs: modalObs}\"></ng-container>\n </cds-modal>\n</ng-template>\n\n<ng-template #modalContent let-modalObs=\"modalObs\">\n <form [formGroup]=\"formGroup\" class=\"list-column-form\">\n <div class=\"cds--text-input__field-wrapper\">\n <cds-label [disabled]=\"modalObs.disableInput\">\n <span class=\"label-with-tooltip\">\n {{ 'searchFieldsOverview.title' | translate }}\n <v-tooltip-icon\n [tooltip]=\"'searchFieldsOverviewTooltips.title' | translate\"\n [disabled]=\"modalObs.disableInput\"\n ></v-tooltip-icon>\n </span>\n <input cdsText formControlName=\"title\" />\n </cds-label>\n </div>\n <div class=\"cds--text-input__field-wrapper\">\n <cds-label\n [disabled]=\"modalObs.disableInput || modalObs.type === 'edit'\"\n [invalid]=\"modalObs.validKey === false\"\n [invalidText]=\"'searchFieldsOverview.uniqueKeyWarning' | translate\"\n >\n <span class=\"label-with-tooltip\">\n {{ 'searchFieldsOverview.key' | translate }}\n <v-tooltip-icon\n [tooltip]=\"'searchFieldsOverviewTooltips.key' | translate\"\n [disabled]=\"modalObs.disableInput\"\n ></v-tooltip-icon>\n </span>\n <input cdsText formControlName=\"key\" [invalid]=\"modalObs.validKey === false\" />\n </cds-label>\n </div>\n <div class=\"cds--text-input__field-wrapper\">\n <cds-label [disabled]=\"modalObs.disableInput\">\n <span class=\"label-with-tooltip\">\n {{ 'searchFieldsOverview.path' | translate }}\n <v-tooltip-icon\n [tooltip]=\"'searchFieldsOverviewTooltips.objectsApiPath' | translate\"\n [disabled]=\"modalObs.disableInput\"\n ></v-tooltip-icon>\n </span>\n <input cdsText formControlName=\"path\" />\n </cds-label>\n </div>\n <div class=\"cds--text-input__field-wrapper\">\n <cds-label [disabled]=\"modalObs.disableInput\">\n <span class=\"label-with-tooltip select-label\">\n {{ 'searchFieldsOverview.dataType' | translate }}\n <v-tooltip-icon\n [tooltip]=\"'searchFieldsOverviewTooltips.dataType' | translate\"\n [disabled]=\"modalObs.disableInput\"\n ></v-tooltip-icon>\n </span>\n <cds-dropdown formControlName=\"dataType\" [disabled]=\"modalObs.disableInput\">\n <cds-dropdown-list [items]=\"dataTypeItems$ | async\"></cds-dropdown-list>\n </cds-dropdown>\n </cds-label>\n </div>\n <div class=\"cds--text-input__field-wrapper\">\n <cds-label [disabled]=\"modalObs.disableInput\">\n <span class=\"label-with-tooltip select-label\">\n {{ 'searchFieldsOverview.fieldType' | translate }}\n <v-tooltip-icon\n [tooltip]=\"'searchFieldsOverviewTooltips.fieldType' | translate\"\n [disabled]=\"modalObs.disableInput\"\n ></v-tooltip-icon>\n </span>\n <cds-dropdown formControlName=\"fieldType\" [disabled]=\"modalObs.disableInput\">\n <cds-dropdown-list [items]=\"fieldTypeItems$ | async\"></cds-dropdown-list>\n </cds-dropdown>\n </cds-label>\n </div>\n </form>\n</ng-template>\n\n<ng-template #modalFooter let-modalObs=\"modalObs\">\n <cds-modal-footer>\n <ng-container>\n <button\n cdsButton=\"secondary\"\n [attr.modal-primary-focus]=\"true\"\n (click)=\"closeModal()\"\n [disabled]=\"modalObs.disableInput\"\n >\n {{ 'searchFieldsOverview.close' | translate }}\n </button>\n <button\n cdsButton=\"primary\"\n [attr.modal-primary-focus]=\"true\"\n [disabled]=\"modalObs.valid === false\"\n (click)=\"saveListSearchFields()\"\n [disabled]=\"\n modalObs.disableInput || modalObs.valid === false || modalObs.validKey === false\n \"\n >\n {{ 'searchFieldsOverview.save' | translate }}\n </button>\n </ng-container>\n </cds-modal-footer>\n</ng-template>\n\n<ng-template #deleteModal>\n <valtimo-confirmation-modal\n [showModalSubject$]=\"showDeleteModal$\"\n [outputOnConfirm]=\"deleteRowIndex$ | async\"\n (confirmEvent)=\"deleteRowConfirmation($event)\"\n confirmButtonTextTranslationKey=\"searchFieldsOverview.deleteSearchField\"\n titleTranslationKey=\"searchFieldsOverview.searchField\"\n contentTranslationKey=\"searchFieldsOverview.deleteSearchFieldConfirmation\"\n ></valtimo-confirmation-modal>\n</ng-template>\n\n<ng-template #noConfigWarning>\n <div class=\"pl-2 pr-2 pb-2\">\n <cds-notification\n [notificationObj]=\"{\n type: 'info',\n title: 'searchFieldsOverview.noSearchFieldsConfiguredWarningTitle' | translate,\n showClose: false,\n }\"\n >\n </cds-notification>\n </div>\n</ng-template>\n\n<ng-template #loading>\n <div class=\"loading-icon\"><cds-loading></cds-loading></div>\n</ng-template>\n", styles: ["::ng-deep .tab-container{min-height:unset!important}::ng-deep .cds--inline-notification{max-width:100%}.label-with-tooltip{display:flex;align-items:center}.cds--text-input__field-wrapper:not(:last-child){margin-bottom:1rem}.display-type-dropdown{width:300px}.list-column-form{margin-bottom:3rem}.select-label{padding-bottom:.5rem;width:250px}.loading-icon{width:100%;display:flex;align-items:center;justify-content:center}.center-link{display:flex;align-items:center}::ng-deep .move-row-buttons{display:flex;flex-direction:row;justify-content:flex-end;padding-right:13px}\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: "directive", type: i6.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i6.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i7.Label, selector: "cds-label, ibm-label", inputs: ["labelInputID", "disabled", "skeleton", "helperText", "invalidText", "invalid", "warn", "warnText", "ariaLabel"] }, { kind: "directive", type: i7.TextInput, selector: "[cdsText], [ibmText]", inputs: ["theme", "size", "invalid", "warn", "skeleton"] }, { kind: "directive", type: i7.Button, selector: "[cdsButton], [ibmButton]", inputs: ["ibmButton", "cdsButton", "size", "skeleton", "iconOnly", "isExpressive"] }, { kind: "component", type: i5.TooltipIconComponent, selector: "v-tooltip-icon", inputs: ["tooltip", "disabled"] }, { kind: "component", type: i7.Modal, selector: "cds-modal, ibm-modal", inputs: ["size", "theme", "ariaLabel", "open", "trigger", "hasScrollingContent"], outputs: ["overlaySelected", "close"] }, { kind: "component", type: i7.ModalHeader, selector: "cds-modal-header, ibm-modal-header", inputs: ["theme", "closeLabel", "showCloseButton"], outputs: ["closeSelect"] }, { kind: "component", type: i7.ModalFooter, selector: "cds-modal-footer, ibm-modal-footer" }, { kind: "directive", type: i7.ModalContent, selector: "[cdsModalContent], [ibmModalContent]", inputs: ["hasForm"] }, { kind: "directive", type: i7.ModalHeaderHeading, selector: "[cdsModalHeaderHeading], [ibmModalHeaderHeading]" }, { kind: "component", type: i7.Notification, selector: "cds-notification, cds-inline-notification, ibm-notification, ibm-inline-notification", inputs: ["notificationObj"] }, { kind: "component", type: i7.Loading, selector: "cds-loading, ibm-loading", inputs: ["title", "isActive", "size", "overlay"] }, { kind: "component", type: i7.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: i7.DropdownList, selector: "cds-dropdown-list, ibm-dropdown-list", inputs: ["ariaLabel", "items", "listTpl", "type", "showTitles"], outputs: ["select", "scroll", "blurIntent"] }, { kind: "directive", type: i7.Link, selector: "[cdsLink], [ibmLink]", inputs: ["inline", "disabled"] }, { kind: "directive", type: i7.IconDirective, selector: "[cdsIcon], [ibmIcon]", inputs: ["ibmIcon", "cdsIcon", "size", "title", "ariaLabel", "ariaLabelledBy", "ariaHidden", "isFocusable"] }, { kind: "directive", type: i9.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i9.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: i9.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i9.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i9.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i9.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i5.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: "directive", type: i5.ValtimoCdsModalDirective, selector: "[valtimoCdsModal]", inputs: ["minContentHeight"] }, { kind: "component", type: i5.CarbonListComponent, selector: "valtimo-carbon-list", inputs: ["items", "fields", "tableTranslations", "paginatorConfig", "pagination", "loading", "actions", "actionItems", "showActionItems", "header", "hideColumnHeader", "initialSortState", "sortState", "isSearchable", "enableSingleSelection", "lastColumnTemplate", "paginationIdentifier", "showSelectionColumn", "striped", "hideToolbar", "lockedTooltipTranslationKey", "movingRowsEnabled", "dragAndDrop", "dragAndDropDisabled"], outputs: ["rowClicked", "paginationClicked", "paginationSet", "search", "sortChanged", "moveRow", "itemsReordered"] }, { kind: "pipe", type: i6.AsyncPipe, name: "async" }, { kind: "pipe", type: i3$1.TranslatePipe, name: "translate" }] }); }
1161
+ }
1162
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: ObjectManagementListSearchFieldsComponent, decorators: [{
1163
+ type: Component,
1164
+ args: [{ standalone: false, selector: 'valtimo-object-management-list-search-fields', template: "<!--\n ~ Copyright 2015-2025 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n<ng-container\n *ngIf=\"{\n searchFields: translatedObjectManagementListSearchFields$ | async,\n fields: objectManagementFields$ | async,\n objectId: objectId$ | async,\n downloadUrl: downloadUrl$ | async,\n downloadName: downloadName$ | async,\n loading: loading$ | async,\n } as obs\"\n>\n <div class=\"container-fluid pr-0 pl-0\">\n <div class=\"text-right\">\n <div class=\"btn-group mt-m3px mb-3 mr-2\">\n <ng-container *ngTemplateOutlet=\"buttons; context: {obs: obs}\"></ng-container>\n </div>\n </div>\n <ng-container *ngIf=\"!obs.loading; else loading\">\n <ng-container *ngIf=\"obs.searchFields?.length > 0; else noConfigWarning\">\n <ng-container *ngTemplateOutlet=\"list; context: {obs: obs}\"></ng-container>\n </ng-container>\n </ng-container>\n <ng-container *ngTemplateOutlet=\"createEditModal\"></ng-container>\n <ng-container *ngTemplateOutlet=\"deleteModal\"></ng-container>\n </div>\n</ng-container>\n\n<ng-template #buttons let-obs=\"obs\">\n <a\n cdsLink\n class=\"center-link\"\n [href]=\"obs.downloadUrl\"\n [download]=\"obs.downloadName\"\n [disabled]=\"\n !obs.downloadUrl ||\n !obs.downloadName ||\n obs.searchFields?.length < 1 ||\n obs.disableInput ||\n obs.loading\n \"\n >\n {{ 'searchFieldsOverview.download' | translate }}\n </a>\n <button\n (click)=\"openModal('create')\"\n cdsButton=\"primary\"\n size=\"md\"\n [disabled]=\"obs.loading\"\n class=\"ml-3\"\n >\n {{ 'searchFieldsOverview.add' | translate }}\n <svg class=\"cds--btn__icon\" cdsIcon=\"add\" size=\"16\"></svg>\n </button>\n</ng-template>\n\n<ng-template #moveRowButtons let-index=\"index\" let-length=\"length\">\n <div\n class=\"move-row-buttons\"\n *ngIf=\"{\n disableInput: disableInput$ | async,\n objectId: objectId$ | async,\n } as obs\"\n >\n <i\n class=\"mdi mdi-delete btn btn-outline-danger mr-1\"\n (click)=\"deleteRow(index, $event)\"\n [ngClass]=\"{'disabled disabled-move-row-button': obs.disableInput}\"\n ></i>\n <i\n class=\"mdi mdi-arrow-up-bold btn btn-outline-primary mr-1\"\n (click)=\"moveRow(index, true, $event, obs.objectId)\"\n [ngClass]=\"{'disabled disabled-move-row-button': index === 0 || obs.disableInput}\"\n ></i>\n <i\n class=\"mdi mdi-arrow-down-bold btn btn-outline-secondary\"\n (click)=\"moveRow(index, false, $event, obs.objectId)\"\n [ngClass]=\"{'disabled disabled-move-row-button': index === length - 1 || obs.disableInput}\"\n ></i>\n </div>\n</ng-template>\n\n<ng-template #list let-obs=\"obs\">\n <valtimo-carbon-list\n [items]=\"obs.searchFields\"\n [fields]=\"obs.fields\"\n [viewMode]=\"false\"\n [header]=\"false\"\n *ngIf=\"obs.searchFields; else loading\"\n [lastColumnTemplate]=\"moveRowButtonsTemplateRef\"\n (rowClicked)=\"columnRowClicked($event)\"\n >\n </valtimo-carbon-list>\n</ng-template>\n\n<ng-template #createEditModal>\n <cds-modal\n valtimoCdsModal\n *ngIf=\"{\n type: currentModalType$ | async,\n show: showModal$ | async,\n valid: valid$ | async,\n disableInput: disableInput$ | async,\n validKey: validKey$ | async,\n } as modalObs\"\n [open]=\"modalObs.show\"\n (close)=\"closeModal()\"\n >\n <cds-modal-header [showCloseButton]=\"true\" (closeSelect)=\"closeModal()\">\n <h3 cdsModalHeaderHeading>\n {{\n modalObs.type === 'create'\n ? ('searchFieldsOverview.add' | translate)\n : ('searchFieldsOverview.edit' | translate)\n }}\n </h3>\n </cds-modal-header>\n <section cdsModalContent>\n <ng-container *ngTemplateOutlet=\"modalContent; context: {modalObs: modalObs}\"></ng-container>\n </section>\n <ng-container *ngTemplateOutlet=\"modalFooter; context: {modalObs: modalObs}\"></ng-container>\n </cds-modal>\n</ng-template>\n\n<ng-template #modalContent let-modalObs=\"modalObs\">\n <form [formGroup]=\"formGroup\" class=\"list-column-form\">\n <div class=\"cds--text-input__field-wrapper\">\n <cds-label [disabled]=\"modalObs.disableInput\">\n <span class=\"label-with-tooltip\">\n {{ 'searchFieldsOverview.title' | translate }}\n <v-tooltip-icon\n [tooltip]=\"'searchFieldsOverviewTooltips.title' | translate\"\n [disabled]=\"modalObs.disableInput\"\n ></v-tooltip-icon>\n </span>\n <input cdsText formControlName=\"title\" />\n </cds-label>\n </div>\n <div class=\"cds--text-input__field-wrapper\">\n <cds-label\n [disabled]=\"modalObs.disableInput || modalObs.type === 'edit'\"\n [invalid]=\"modalObs.validKey === false\"\n [invalidText]=\"'searchFieldsOverview.uniqueKeyWarning' | translate\"\n >\n <span class=\"label-with-tooltip\">\n {{ 'searchFieldsOverview.key' | translate }}\n <v-tooltip-icon\n [tooltip]=\"'searchFieldsOverviewTooltips.key' | translate\"\n [disabled]=\"modalObs.disableInput\"\n ></v-tooltip-icon>\n </span>\n <input cdsText formControlName=\"key\" [invalid]=\"modalObs.validKey === false\" />\n </cds-label>\n </div>\n <div class=\"cds--text-input__field-wrapper\">\n <cds-label [disabled]=\"modalObs.disableInput\">\n <span class=\"label-with-tooltip\">\n {{ 'searchFieldsOverview.path' | translate }}\n <v-tooltip-icon\n [tooltip]=\"'searchFieldsOverviewTooltips.objectsApiPath' | translate\"\n [disabled]=\"modalObs.disableInput\"\n ></v-tooltip-icon>\n </span>\n <input cdsText formControlName=\"path\" />\n </cds-label>\n </div>\n <div class=\"cds--text-input__field-wrapper\">\n <cds-label [disabled]=\"modalObs.disableInput\">\n <span class=\"label-with-tooltip select-label\">\n {{ 'searchFieldsOverview.dataType' | translate }}\n <v-tooltip-icon\n [tooltip]=\"'searchFieldsOverviewTooltips.dataType' | translate\"\n [disabled]=\"modalObs.disableInput\"\n ></v-tooltip-icon>\n </span>\n <cds-dropdown formControlName=\"dataType\" [disabled]=\"modalObs.disableInput\">\n <cds-dropdown-list [items]=\"dataTypeItems$ | async\"></cds-dropdown-list>\n </cds-dropdown>\n </cds-label>\n </div>\n <div class=\"cds--text-input__field-wrapper\">\n <cds-label [disabled]=\"modalObs.disableInput\">\n <span class=\"label-with-tooltip select-label\">\n {{ 'searchFieldsOverview.fieldType' | translate }}\n <v-tooltip-icon\n [tooltip]=\"'searchFieldsOverviewTooltips.fieldType' | translate\"\n [disabled]=\"modalObs.disableInput\"\n ></v-tooltip-icon>\n </span>\n <cds-dropdown formControlName=\"fieldType\" [disabled]=\"modalObs.disableInput\">\n <cds-dropdown-list [items]=\"fieldTypeItems$ | async\"></cds-dropdown-list>\n </cds-dropdown>\n </cds-label>\n </div>\n </form>\n</ng-template>\n\n<ng-template #modalFooter let-modalObs=\"modalObs\">\n <cds-modal-footer>\n <ng-container>\n <button\n cdsButton=\"secondary\"\n [attr.modal-primary-focus]=\"true\"\n (click)=\"closeModal()\"\n [disabled]=\"modalObs.disableInput\"\n >\n {{ 'searchFieldsOverview.close' | translate }}\n </button>\n <button\n cdsButton=\"primary\"\n [attr.modal-primary-focus]=\"true\"\n [disabled]=\"modalObs.valid === false\"\n (click)=\"saveListSearchFields()\"\n [disabled]=\"\n modalObs.disableInput || modalObs.valid === false || modalObs.validKey === false\n \"\n >\n {{ 'searchFieldsOverview.save' | translate }}\n </button>\n </ng-container>\n </cds-modal-footer>\n</ng-template>\n\n<ng-template #deleteModal>\n <valtimo-confirmation-modal\n [showModalSubject$]=\"showDeleteModal$\"\n [outputOnConfirm]=\"deleteRowIndex$ | async\"\n (confirmEvent)=\"deleteRowConfirmation($event)\"\n confirmButtonTextTranslationKey=\"searchFieldsOverview.deleteSearchField\"\n titleTranslationKey=\"searchFieldsOverview.searchField\"\n contentTranslationKey=\"searchFieldsOverview.deleteSearchFieldConfirmation\"\n ></valtimo-confirmation-modal>\n</ng-template>\n\n<ng-template #noConfigWarning>\n <div class=\"pl-2 pr-2 pb-2\">\n <cds-notification\n [notificationObj]=\"{\n type: 'info',\n title: 'searchFieldsOverview.noSearchFieldsConfiguredWarningTitle' | translate,\n showClose: false,\n }\"\n >\n </cds-notification>\n </div>\n</ng-template>\n\n<ng-template #loading>\n <div class=\"loading-icon\"><cds-loading></cds-loading></div>\n</ng-template>\n", styles: ["::ng-deep .tab-container{min-height:unset!important}::ng-deep .cds--inline-notification{max-width:100%}.label-with-tooltip{display:flex;align-items:center}.cds--text-input__field-wrapper:not(:last-child){margin-bottom:1rem}.display-type-dropdown{width:300px}.list-column-form{margin-bottom:3rem}.select-label{padding-bottom:.5rem;width:250px}.loading-icon{width:100%;display:flex;align-items:center;justify-content:center}.center-link{display:flex;align-items:center}::ng-deep .move-row-buttons{display:flex;flex-direction:row;justify-content:flex-end;padding-right:13px}\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"] }]
1165
+ }], ctorParameters: () => [{ type: ObjectManagementService }, { type: i2.ActivatedRoute }, { type: i3$1.TranslateService }, { type: i4.ConfigService }, { type: i5$1.DomSanitizer }], propDecorators: { moveRowButtonsTemplateRef: [{
1166
+ type: ViewChild,
1167
+ args: ['moveRowButtons']
1168
+ }] } });
1169
+
1170
+ /*
1171
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
1172
+ *
1173
+ * Licensed under EUPL, Version 1.2 (the "License");
1174
+ * you may not use this file except in compliance with the License.
1175
+ * You may obtain a copy of the License at
1176
+ *
1177
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1178
+ *
1179
+ * Unless required by applicable law or agreed to in writing, software
1180
+ * distributed under the License is distributed on an "AS IS" basis,
1181
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1182
+ * See the License for the specific language governing permissions and
1183
+ * limitations under the License.
1184
+ */
1185
+ class ObjectManagementDetailContainerComponent {
1186
+ constructor(objectManagementState, objectManagementService, route, configService, tabService, pageTitleService) {
1187
+ this.objectManagementState = objectManagementState;
1188
+ this.objectManagementService = objectManagementService;
1189
+ this.route = route;
1190
+ this.configService = configService;
1191
+ this.tabService = tabService;
1192
+ this.pageTitleService = pageTitleService;
1193
+ this.TabEnum = TabEnum;
1194
+ this.objectId$ = this.route.params.pipe(map(params => params.id || ''), filter(id => !!id));
1195
+ this.object$ = combineLatest([this.objectId$, this.objectManagementState.refresh$]).pipe(switchMap(([object]) => this.objectManagementService.getObjectById(object)), tap$1(object => {
1196
+ this.pageTitleService.setCustomPageTitle(object.title);
1197
+ }));
1198
+ this.caseListColumn = this.configService.config.featureToggles?.caseListColumn ?? true;
1199
+ }
1200
+ ngOnInit() {
1201
+ this.openCurrentTabSubscription();
1202
+ }
1203
+ displayBodyComponent(tab) {
1204
+ this.tabService.currentTab = tab;
1205
+ }
1206
+ openCurrentTabSubscription() {
1207
+ this.tabSubscription = this.tabService.currentTab$.subscribe(value => (this.currentTab = value));
1208
+ }
1209
+ ngOnDestroy() {
1210
+ this.tabService.currentTab = TabEnum.GENERAL;
1211
+ this.tabSubscription?.unsubscribe();
1212
+ }
1213
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: ObjectManagementDetailContainerComponent, deps: [{ token: ObjectManagementStateService }, { token: ObjectManagementService }, { token: i2.ActivatedRoute }, { token: i4.ConfigService }, { token: TabService }, { token: i5.PageTitleService }], target: i0.ɵɵFactoryTarget.Component }); }
1214
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.17", type: ObjectManagementDetailContainerComponent, isStandalone: false, selector: "valtimo-object-management-detail-container", 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=\"main-content\">\n <div class=\"container-fluid\">\n <div class=\"col-12 px-0 mb-5\">\n <valtimo-widget>\n <ng-container *ngTemplateOutlet=\"title\"></ng-container>\n <ng-container *ngTemplateOutlet=\"tabs\"></ng-container>\n <ng-container *ngTemplateOutlet=\"tabContent\"></ng-container>\n </valtimo-widget>\n </div>\n </div>\n</div>\n\n<ng-template #title>\n <ng-container *ngIf=\"object$ | async as object\">\n <div class=\"bg-light dossier-header\" *ngIf=\"object.showInDataMenu\">\n <h3 class=\"dossier-title\">\n <div *ngIf=\"object.showInDataMenu\" class=\"pull-right\">\n <span class=\"badge badge-pill badge-info increase-size\">{{\n 'objectManagement.visibleInMenu' | translate\n }}</span>\n </div>\n </h3>\n </div>\n </ng-container>\n</ng-template>\n\n<ng-template #tabs>\n <ul class=\"nav nav-tabs\">\n <li class=\"nav-item\">\n <a\n id=\"general-tab\"\n class=\"nav-link clickable active\"\n data-toggle=\"tab\"\n (click)=\"displayBodyComponent(TabEnum.GENERAL)\"\n >\n {{ 'objectManagement.tabs.general' | translate }}\n </a>\n </li>\n <li class=\"nav-item\">\n <a\n id=\"search-tab\"\n class=\"nav-link clickable\"\n data-toggle=\"tab\"\n (click)=\"displayBodyComponent(TabEnum.SEARCH)\"\n >\n {{ 'objectManagement.tabs.searchFields' | translate }}\n </a>\n </li>\n <li class=\"nav-item\" *ngIf=\"caseListColumn\">\n <a\n id=\"list-tab\"\n class=\"nav-link clickable\"\n data-toggle=\"tab\"\n (click)=\"displayBodyComponent(TabEnum.LIST)\"\n >\n {{ 'objectManagement.tabs.list' | translate }}\n </a>\n </li>\n </ul>\n</ng-template>\n\n<ng-template #tabContent>\n <div class=\"pt-3 bg-white position-relative tab-container\">\n <div *ngIf=\"currentTab && currentTab === TabEnum.GENERAL\">\n <valtimo-object-management-detail [object$]=\"object$\"></valtimo-object-management-detail>\n </div>\n <div *ngIf=\"currentTab && currentTab === TabEnum.SEARCH\">\n <valtimo-object-management-list-search-fields></valtimo-object-management-list-search-fields>\n </div>\n <div *ngIf=\"currentTab && currentTab === TabEnum.LIST\">\n <valtimo-object-management-list-columns></valtimo-object-management-list-columns>\n </div>\n </div>\n</ng-template>\n", styles: [".tab-container{min-height:300px}.dossier-header{height:80px;padding-top:21px;padding-left:18px;padding-right:18px;border-bottom:1px solid rgba(0,0,0,.125)}.dossier-title{margin-top:0;margin-bottom:7px}\n"], dependencies: [{ kind: "directive", type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i6.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i5.WidgetComponent, selector: "valtimo-widget", inputs: ["type", "name", "icon", "contrast", "divider", "title", "subtitle", "collapseAble", "collapse", "additionalClasses"] }, { kind: "component", type: ObjectManagementDetailComponent, selector: "valtimo-object-management-detail", inputs: ["object$"] }, { kind: "component", type: ObjectManagementListColumnsComponent, selector: "valtimo-object-management-list-columns" }, { kind: "component", type: ObjectManagementListSearchFieldsComponent, selector: "valtimo-object-management-list-search-fields" }, { kind: "pipe", type: i6.AsyncPipe, name: "async" }, { kind: "pipe", type: i3$1.TranslatePipe, name: "translate" }] }); }
1215
+ }
1216
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: ObjectManagementDetailContainerComponent, decorators: [{
1217
+ type: Component,
1218
+ args: [{ standalone: false, selector: 'valtimo-object-management-detail-container', 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=\"main-content\">\n <div class=\"container-fluid\">\n <div class=\"col-12 px-0 mb-5\">\n <valtimo-widget>\n <ng-container *ngTemplateOutlet=\"title\"></ng-container>\n <ng-container *ngTemplateOutlet=\"tabs\"></ng-container>\n <ng-container *ngTemplateOutlet=\"tabContent\"></ng-container>\n </valtimo-widget>\n </div>\n </div>\n</div>\n\n<ng-template #title>\n <ng-container *ngIf=\"object$ | async as object\">\n <div class=\"bg-light dossier-header\" *ngIf=\"object.showInDataMenu\">\n <h3 class=\"dossier-title\">\n <div *ngIf=\"object.showInDataMenu\" class=\"pull-right\">\n <span class=\"badge badge-pill badge-info increase-size\">{{\n 'objectManagement.visibleInMenu' | translate\n }}</span>\n </div>\n </h3>\n </div>\n </ng-container>\n</ng-template>\n\n<ng-template #tabs>\n <ul class=\"nav nav-tabs\">\n <li class=\"nav-item\">\n <a\n id=\"general-tab\"\n class=\"nav-link clickable active\"\n data-toggle=\"tab\"\n (click)=\"displayBodyComponent(TabEnum.GENERAL)\"\n >\n {{ 'objectManagement.tabs.general' | translate }}\n </a>\n </li>\n <li class=\"nav-item\">\n <a\n id=\"search-tab\"\n class=\"nav-link clickable\"\n data-toggle=\"tab\"\n (click)=\"displayBodyComponent(TabEnum.SEARCH)\"\n >\n {{ 'objectManagement.tabs.searchFields' | translate }}\n </a>\n </li>\n <li class=\"nav-item\" *ngIf=\"caseListColumn\">\n <a\n id=\"list-tab\"\n class=\"nav-link clickable\"\n data-toggle=\"tab\"\n (click)=\"displayBodyComponent(TabEnum.LIST)\"\n >\n {{ 'objectManagement.tabs.list' | translate }}\n </a>\n </li>\n </ul>\n</ng-template>\n\n<ng-template #tabContent>\n <div class=\"pt-3 bg-white position-relative tab-container\">\n <div *ngIf=\"currentTab && currentTab === TabEnum.GENERAL\">\n <valtimo-object-management-detail [object$]=\"object$\"></valtimo-object-management-detail>\n </div>\n <div *ngIf=\"currentTab && currentTab === TabEnum.SEARCH\">\n <valtimo-object-management-list-search-fields></valtimo-object-management-list-search-fields>\n </div>\n <div *ngIf=\"currentTab && currentTab === TabEnum.LIST\">\n <valtimo-object-management-list-columns></valtimo-object-management-list-columns>\n </div>\n </div>\n</ng-template>\n", styles: [".tab-container{min-height:300px}.dossier-header{height:80px;padding-top:21px;padding-left:18px;padding-right:18px;border-bottom:1px solid rgba(0,0,0,.125)}.dossier-title{margin-top:0;margin-bottom:7px}\n"] }]
1219
+ }], ctorParameters: () => [{ type: ObjectManagementStateService }, { type: ObjectManagementService }, { type: i2.ActivatedRoute }, { type: i4.ConfigService }, { type: TabService }, { type: i5.PageTitleService }] });
1220
+
1221
+ /*
1222
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
1223
+ *
1224
+ * Licensed under EUPL, Version 1.2 (the "License");
1225
+ * you may not use this file except in compliance with the License.
1226
+ * You may obtain a copy of the License at
1227
+ *
1228
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1229
+ *
1230
+ * Unless required by applicable law or agreed to in writing, software
1231
+ * distributed under the License is distributed on an "AS IS" basis,
1232
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1233
+ * See the License for the specific language governing permissions and
1234
+ * limitations under the License.
1235
+ */
1236
+ class ObjectManagementUploadModalComponent {
1237
+ constructor(objectManagementState, objectManagementService, formManagementService, pluginManagementService, modalService, translateService) {
1238
+ this.objectManagementState = objectManagementState;
1239
+ this.objectManagementService = objectManagementService;
1240
+ this.formManagementService = formManagementService;
1241
+ this.pluginManagementService = pluginManagementService;
1242
+ this.modalService = modalService;
1243
+ this.translateService = translateService;
1244
+ this.clear$ = new Subject();
1245
+ this.jsonString$ = new BehaviorSubject('');
1246
+ this.error$ = new BehaviorSubject('');
1247
+ this.disabled$ = new BehaviorSubject(false);
1248
+ this.showForm$ = this.modalService.modalVisible$;
1249
+ this.file$ = new BehaviorSubject(undefined);
1250
+ }
1251
+ ngAfterViewInit() {
1252
+ this.openShowSubscription();
1253
+ this.openFileSubscription();
1254
+ this.openHideSubscription();
1255
+ }
1256
+ ngOnDestroy() {
1257
+ this.showSubscription?.unsubscribe();
1258
+ this.hideSubscription?.unsubscribe();
1259
+ this.fileSubscription.unsubscribe();
1260
+ }
1261
+ hide() {
1262
+ this.modalService.closeModal();
1263
+ }
1264
+ cancel() {
1265
+ this.hide();
1266
+ }
1267
+ setFile(file) {
1268
+ this.clearError();
1269
+ this.file$.next(file);
1270
+ }
1271
+ uploadDefinition() {
1272
+ this.disable();
1273
+ this.jsonString$.pipe(take(1)).subscribe(objecttypeDefinition => {
1274
+ this.objectManagementService
1275
+ .createObject({ ...JSON.parse(objecttypeDefinition) })
1276
+ .subscribe(() => {
1277
+ this.objectManagementState.refresh();
1278
+ this.objectManagementState.hideModal();
1279
+ });
1280
+ this.closeErrorSubscription();
1281
+ this.clearError();
1282
+ this.enable();
1283
+ this.hide();
1284
+ });
1285
+ }
1286
+ openErrorSubscription(errorCode) {
1287
+ this.closeErrorSubscription();
1288
+ this.errorSubscription = this.translateService.stream(errorCode).subscribe(error => {
1289
+ this.error$.next(error);
1290
+ });
1291
+ }
1292
+ closeErrorSubscription() {
1293
+ if (this.errorSubscription) {
1294
+ this.errorSubscription.unsubscribe();
1295
+ }
1296
+ }
1297
+ openFileSubscription() {
1298
+ this.fileSubscription = this.file$.subscribe(file => {
1299
+ if (file) {
1300
+ const reader = new FileReader();
1301
+ reader.onloadend = () => {
1302
+ const result = reader.result.toString();
1303
+ if (this.isValidJsonObjecttype(result)) {
1304
+ this.jsonString$.next(result);
1305
+ }
1306
+ else {
1307
+ this.clearJsonString();
1308
+ }
1309
+ };
1310
+ reader.readAsText(file);
1311
+ }
1312
+ else {
1313
+ this.clearJsonString();
1314
+ }
1315
+ });
1316
+ }
1317
+ openShowSubscription() {
1318
+ this.showSubscription = this.objectManagementState.showModal$.subscribe(() => {
1319
+ this.show();
1320
+ this.clearJsonString();
1321
+ this.clearError();
1322
+ this.clearDropzone();
1323
+ });
1324
+ }
1325
+ openHideSubscription() {
1326
+ this.hideSubscription = this.objectManagementState.hideModal$.subscribe(() => {
1327
+ this.hide();
1328
+ });
1329
+ }
1330
+ show() {
1331
+ this.objectManagementState.modalType$.pipe(take(1)).subscribe(modalType => {
1332
+ if (modalType === 'upload') {
1333
+ this.modalService.openModal(this.objectManagementUploadModal);
1334
+ }
1335
+ });
1336
+ }
1337
+ clearError() {
1338
+ this.error$.next('');
1339
+ }
1340
+ clearJsonString() {
1341
+ this.jsonString$.next('');
1342
+ }
1343
+ clearDropzone() {
1344
+ this.clear$.next(null);
1345
+ }
1346
+ isValidJsonObjecttype(string) {
1347
+ const jsonObjecttype = JSON.parse(string);
1348
+ const isValid = this.validateObject(jsonObjecttype, [
1349
+ 'title',
1350
+ 'objecttypenApiPluginConfigurationId',
1351
+ 'objecttypeId',
1352
+ 'objecttypeVersion',
1353
+ 'objectenApiPluginConfigurationId',
1354
+ 'showInDataMenu',
1355
+ ]);
1356
+ const isObjecttypeTitleUnique = !this.objecttypes?.find(objecttype => objecttype.title === jsonObjecttype.title);
1357
+ if (isValid && isObjecttypeTitleUnique) {
1358
+ return true;
1359
+ }
1360
+ else if (isValid && !isObjecttypeTitleUnique) {
1361
+ this.clearDropzone();
1362
+ this.openErrorSubscription('dropzone.error.objecttypeAlreadyExists');
1363
+ return false;
1364
+ }
1365
+ else if (!isValid && isObjecttypeTitleUnique) {
1366
+ this.clearDropzone();
1367
+ this.openErrorSubscription('dropzone.error.invalidObjecttypeDef');
1368
+ return false;
1369
+ }
1370
+ }
1371
+ validateObject(obj, requiredKeys) {
1372
+ const objKeys = Object.keys(obj);
1373
+ return requiredKeys.every(key => objKeys.includes(key));
1374
+ }
1375
+ disable() {
1376
+ this.disabled$.next(true);
1377
+ }
1378
+ enable() {
1379
+ this.disabled$.next(false);
1380
+ }
1381
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: ObjectManagementUploadModalComponent, deps: [{ token: ObjectManagementStateService }, { token: ObjectManagementService }, { token: i3$2.FormManagementService }, { token: i4$1.PluginManagementService }, { token: i5.ModalService }, { token: i3$1.TranslateService }], target: i0.ɵɵFactoryTarget.Component }); }
1382
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.17", type: ObjectManagementUploadModalComponent, isStandalone: false, selector: "valtimo-object-management-upload-modal", inputs: { objecttypes: "objecttypes" }, viewQueries: [{ propertyName: "objectManagementUploadModal", first: true, predicate: ["objectManagementUploadModal"], 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<v-modal\n #objectManagementUploadModal\n *ngIf=\"{\n disabled: disabled$ | async,\n jsonString: jsonString$ | async,\n error: error$ | async,\n } as obs\"\n>\n <div role=\"header\">\n <div class=\"add-title\">\n <h4>{{ 'objectManagement.uploadObjecttype' | translate }}</h4>\n </div>\n </div>\n <div role=\"content\">\n <ng-container *ngTemplateOutlet=\"uploadForm\"></ng-container>\n </div>\n <div role=\"footer\">\n <div class=\"buttons\">\n <button cdsButton=\"secondary\" (click)=\"cancel()\" [disabled]=\"obs.disabled\">\n {{ 'objectManagement.cancel' | translate }}\n </button>\n\n <button\n cdsButton=\"primary\"\n (click)=\"uploadDefinition()\"\n [disabled]=\"obs.jsonString === '' || obs.disabled\"\n >\n {{ 'Upload' | translate }}\n </button>\n </div>\n </div>\n</v-modal>\n\n<ng-template #uploadForm>\n <ng-container *ngIf=\"showForm$ | async\">\n <valtimo-dropzone\n [clear$]=\"clear$\"\n (fileSelected)=\"setFile($event)\"\n [disabled]=\"disabled$ | async\"\n [subtitle]=\"'dropzone.objecttypeDef' | translate\"\n [externalError$]=\"error$\"\n [maxFiles]=\"1\"\n ></valtimo-dropzone>\n </ng-container>\n</ng-template>\n", styles: [".buttons{width:100%;display:flex;flex-direction:row;justify-content:flex-end}\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: "directive", type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i6.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i5.DropzoneComponent, selector: "valtimo-dropzone", inputs: ["title", "hideTitle", "subtitle", "externalError$", "maxFileSize", "showMaxFileSize", "acceptedFiles", "clear$", "disabled", "hideFilePreview", "uploading", "camera", "maxFiles"], outputs: ["fileSelected"] }, { kind: "component", type: i5.VModalComponent, selector: "v-modal", inputs: ["appearingDelayMs", "maxWidthPx", "hideFooter", "parentId"], outputs: ["closeEvent"] }, { kind: "directive", type: i7.Button, selector: "[cdsButton], [ibmButton]", inputs: ["ibmButton", "cdsButton", "size", "skeleton", "iconOnly", "isExpressive"] }, { kind: "pipe", type: i6.AsyncPipe, name: "async" }, { kind: "pipe", type: i3$1.TranslatePipe, name: "translate" }] }); }
1383
+ }
1384
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: ObjectManagementUploadModalComponent, decorators: [{
1385
+ type: Component,
1386
+ args: [{ standalone: false, selector: 'valtimo-object-management-upload-modal', 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<v-modal\n #objectManagementUploadModal\n *ngIf=\"{\n disabled: disabled$ | async,\n jsonString: jsonString$ | async,\n error: error$ | async,\n } as obs\"\n>\n <div role=\"header\">\n <div class=\"add-title\">\n <h4>{{ 'objectManagement.uploadObjecttype' | translate }}</h4>\n </div>\n </div>\n <div role=\"content\">\n <ng-container *ngTemplateOutlet=\"uploadForm\"></ng-container>\n </div>\n <div role=\"footer\">\n <div class=\"buttons\">\n <button cdsButton=\"secondary\" (click)=\"cancel()\" [disabled]=\"obs.disabled\">\n {{ 'objectManagement.cancel' | translate }}\n </button>\n\n <button\n cdsButton=\"primary\"\n (click)=\"uploadDefinition()\"\n [disabled]=\"obs.jsonString === '' || obs.disabled\"\n >\n {{ 'Upload' | translate }}\n </button>\n </div>\n </div>\n</v-modal>\n\n<ng-template #uploadForm>\n <ng-container *ngIf=\"showForm$ | async\">\n <valtimo-dropzone\n [clear$]=\"clear$\"\n (fileSelected)=\"setFile($event)\"\n [disabled]=\"disabled$ | async\"\n [subtitle]=\"'dropzone.objecttypeDef' | translate\"\n [externalError$]=\"error$\"\n [maxFiles]=\"1\"\n ></valtimo-dropzone>\n </ng-container>\n</ng-template>\n", styles: [".buttons{width:100%;display:flex;flex-direction:row;justify-content:flex-end}\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"] }]
1387
+ }], ctorParameters: () => [{ type: ObjectManagementStateService }, { type: ObjectManagementService }, { type: i3$2.FormManagementService }, { type: i4$1.PluginManagementService }, { type: i5.ModalService }, { type: i3$1.TranslateService }], propDecorators: { objectManagementUploadModal: [{
1388
+ type: ViewChild,
1389
+ args: ['objectManagementUploadModal']
1390
+ }], objecttypes: [{
1391
+ type: Input
1392
+ }] } });
1393
+
1394
+ /*
1395
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
1396
+ *
1397
+ * Licensed under EUPL, Version 1.2 (the "License");
1398
+ * you may not use this file except in compliance with the License.
1399
+ * You may obtain a copy of the License at
1400
+ *
1401
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1402
+ *
1403
+ * Unless required by applicable law or agreed to in writing, software
1404
+ * distributed under the License is distributed on an "AS IS" basis,
1405
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1406
+ * See the License for the specific language governing permissions and
1407
+ * limitations under the License.
1408
+ */
1409
+ class ObjectManagementListComponent {
1410
+ constructor(objectManagementService, objectManagementState, translateService, router) {
1411
+ this.objectManagementService = objectManagementService;
1412
+ this.objectManagementState = objectManagementState;
1413
+ this.translateService = translateService;
1414
+ this.router = router;
1415
+ this.loading$ = new BehaviorSubject(true);
1416
+ this.fields$ = new BehaviorSubject([]);
1417
+ this.objecttypesInstances$ = combineLatest([
1418
+ this.translateService.stream('key'),
1419
+ this.objectManagementState.refresh$,
1420
+ ]).pipe(tap$1(() => this.setFields()), switchMap$1(() => this.objectManagementService.getAllObjects()), tap$1(() => this.loading$.next(false)));
1421
+ }
1422
+ showAddModal() {
1423
+ this.objectManagementState.setModalType('add');
1424
+ this.objectManagementState.showModal();
1425
+ }
1426
+ showUploadModal() {
1427
+ this.objectManagementState.setModalType('upload');
1428
+ this.objectManagementState.showModal();
1429
+ }
1430
+ redirectToDetails(objectManagement) {
1431
+ this.router.navigate(['/object-management/object', objectManagement.id]);
1432
+ }
1433
+ setFields() {
1434
+ const keys = ['title'];
1435
+ this.fields$.next(keys.map(key => ({
1436
+ label: `${this.translateService.instant(`objectManagement.labels.${key}`)}`,
1437
+ key,
1438
+ })));
1439
+ }
1440
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: ObjectManagementListComponent, deps: [{ token: ObjectManagementService }, { token: ObjectManagementStateService }, { token: i3$1.TranslateService }, { token: i2.Router }], target: i0.ɵɵFactoryTarget.Component }); }
1441
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.17", type: ObjectManagementListComponent, isStandalone: false, selector: "valtimo-object-management-list", 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=\"main-content pt-0\" *ngIf=\"{loading: loading$ | async} as obs\">\n <div class=\"container-fluid\">\n <div class=\"col-12 px-0 mb-5\">\n <div class=\"text-right mt-m3px mb-3\">\n <button (click)=\"showUploadModal()\" class=\"btn btn-secondary btn-space\">\n <i class=\"icon mdi mdi-upload mr-1\"></i>\n {{ 'objectManagement.uploadObjecttype' | translate }}\n </button>\n <button (click)=\"showAddModal()\" type=\"button\" class=\"btn btn-space btn-primary mr-0\">\n <i class=\"icon mdi mdi-plus mr-1\"></i>\n {{ 'objectManagement.createObjecttype' | translate }}\n </button>\n </div>\n <ng-container *ngTemplateOutlet=\"list; context: {obs: obs}\"></ng-container>\n </div>\n </div>\n</div>\n\n<ng-template #list let-obs=\"obs\">\n <ng-container *ngIf=\"fields$ | async as fields\">\n <ng-container *ngIf=\"objecttypesInstances$ | async as objecttypesInstances\">\n <valtimo-widget *ngIf=\"obs.loading === false\">\n <valtimo-carbon-list\n [items]=\"objecttypesInstances\"\n [fields]=\"fields\"\n [viewMode]=\"true\"\n [header]=\"true\"\n paginationIdentifier=\"objecttypesList\"\n (rowClicked)=\"redirectToDetails($event)\"\n >\n <div header>\n <h3 class=\"list-header-title\">\n {{ 'objectManagement.title' | translate }}\n <sup class=\"ml-1 badge badge-pill badge-primary\">{{\n objecttypesInstances?.length || 0\n }}</sup>\n </h3>\n </div>\n </valtimo-carbon-list>\n </valtimo-widget>\n </ng-container>\n </ng-container>\n</ng-template>\n\n<valtimo-object-management-upload-modal\n [objecttypes]=\"objecttypesInstances$ | async\"\n></valtimo-object-management-upload-modal>\n<valtimo-object-management-modal></valtimo-object-management-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: "directive", type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i6.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i5.WidgetComponent, selector: "valtimo-widget", inputs: ["type", "name", "icon", "contrast", "divider", "title", "subtitle", "collapseAble", "collapse", "additionalClasses"] }, { kind: "component", type: i5.CarbonListComponent, selector: "valtimo-carbon-list", inputs: ["items", "fields", "tableTranslations", "paginatorConfig", "pagination", "loading", "actions", "actionItems", "showActionItems", "header", "hideColumnHeader", "initialSortState", "sortState", "isSearchable", "enableSingleSelection", "lastColumnTemplate", "paginationIdentifier", "showSelectionColumn", "striped", "hideToolbar", "lockedTooltipTranslationKey", "movingRowsEnabled", "dragAndDrop", "dragAndDropDisabled"], outputs: ["rowClicked", "paginationClicked", "paginationSet", "search", "sortChanged", "moveRow", "itemsReordered"] }, { kind: "component", type: ObjectManagementModalComponent, selector: "valtimo-object-management-modal", inputs: ["prefillObject$"] }, { kind: "component", type: ObjectManagementUploadModalComponent, selector: "valtimo-object-management-upload-modal", inputs: ["objecttypes"] }, { kind: "pipe", type: i6.AsyncPipe, name: "async" }, { kind: "pipe", type: i3$1.TranslatePipe, name: "translate" }] }); }
1442
+ }
1443
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: ObjectManagementListComponent, decorators: [{
1444
+ type: Component,
1445
+ args: [{ standalone: false, selector: 'valtimo-object-management-list', 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=\"main-content pt-0\" *ngIf=\"{loading: loading$ | async} as obs\">\n <div class=\"container-fluid\">\n <div class=\"col-12 px-0 mb-5\">\n <div class=\"text-right mt-m3px mb-3\">\n <button (click)=\"showUploadModal()\" class=\"btn btn-secondary btn-space\">\n <i class=\"icon mdi mdi-upload mr-1\"></i>\n {{ 'objectManagement.uploadObjecttype' | translate }}\n </button>\n <button (click)=\"showAddModal()\" type=\"button\" class=\"btn btn-space btn-primary mr-0\">\n <i class=\"icon mdi mdi-plus mr-1\"></i>\n {{ 'objectManagement.createObjecttype' | translate }}\n </button>\n </div>\n <ng-container *ngTemplateOutlet=\"list; context: {obs: obs}\"></ng-container>\n </div>\n </div>\n</div>\n\n<ng-template #list let-obs=\"obs\">\n <ng-container *ngIf=\"fields$ | async as fields\">\n <ng-container *ngIf=\"objecttypesInstances$ | async as objecttypesInstances\">\n <valtimo-widget *ngIf=\"obs.loading === false\">\n <valtimo-carbon-list\n [items]=\"objecttypesInstances\"\n [fields]=\"fields\"\n [viewMode]=\"true\"\n [header]=\"true\"\n paginationIdentifier=\"objecttypesList\"\n (rowClicked)=\"redirectToDetails($event)\"\n >\n <div header>\n <h3 class=\"list-header-title\">\n {{ 'objectManagement.title' | translate }}\n <sup class=\"ml-1 badge badge-pill badge-primary\">{{\n objecttypesInstances?.length || 0\n }}</sup>\n </h3>\n </div>\n </valtimo-carbon-list>\n </valtimo-widget>\n </ng-container>\n </ng-container>\n</ng-template>\n\n<valtimo-object-management-upload-modal\n [objecttypes]=\"objecttypesInstances$ | async\"\n></valtimo-object-management-upload-modal>\n<valtimo-object-management-modal></valtimo-object-management-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"] }]
1446
+ }], ctorParameters: () => [{ type: ObjectManagementService }, { type: ObjectManagementStateService }, { type: i3$1.TranslateService }, { type: i2.Router }] });
1447
+
1448
+ /*
1449
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
1450
+ *
1451
+ * Licensed under EUPL, Version 1.2 (the "License");
1452
+ * you may not use this file except in compliance with the License.
1453
+ * You may obtain a copy of the License at
1454
+ *
1455
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1456
+ *
1457
+ * Unless required by applicable law or agreed to in writing, software
1458
+ * distributed under the License is distributed on an "AS IS" basis,
1459
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1460
+ * See the License for the specific language governing permissions and
1461
+ * limitations under the License.
1462
+ */
1463
+ const routes = [
1464
+ {
1465
+ path: 'object-management',
1466
+ canActivate: [AuthGuardService],
1467
+ component: ObjectManagementListComponent,
1468
+ data: { title: 'Objects', roles: [ROLE_ADMIN] },
1469
+ },
1470
+ {
1471
+ path: 'object-management/object/:id',
1472
+ canActivate: [AuthGuardService],
1473
+ component: ObjectManagementDetailContainerComponent,
1474
+ data: { title: 'Object', roles: [ROLE_ADMIN], customPageTitle: true },
1475
+ },
1476
+ ];
1477
+ class ObjectManagementRoutingModule {
1478
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: ObjectManagementRoutingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
1479
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.17", ngImport: i0, type: ObjectManagementRoutingModule, imports: [CommonModule, i2.RouterModule], exports: [RouterModule] }); }
1480
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: ObjectManagementRoutingModule, imports: [CommonModule, RouterModule.forChild(routes), RouterModule] }); }
1481
+ }
1482
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: ObjectManagementRoutingModule, decorators: [{
1483
+ type: NgModule,
1484
+ args: [{
1485
+ imports: [CommonModule, RouterModule.forChild(routes)],
1486
+ exports: [RouterModule],
1487
+ declarations: [],
1488
+ }]
1489
+ }] });
1490
+
1491
+ /*
1492
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
1493
+ *
1494
+ * Licensed under EUPL, Version 1.2 (the "License");
1495
+ * you may not use this file except in compliance with the License.
1496
+ * You may obtain a copy of the License at
1497
+ *
1498
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1499
+ *
1500
+ * Unless required by applicable law or agreed to in writing, software
1501
+ * distributed under the License is distributed on an "AS IS" basis,
1502
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1503
+ * See the License for the specific language governing permissions and
1504
+ * limitations under the License.
1505
+ */
1506
+ class ObjectManagementModule {
1507
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: ObjectManagementModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
1508
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.17", ngImport: i0, type: ObjectManagementModule, declarations: [ObjectManagementListComponent,
1509
+ ObjectManagementDetailContainerComponent,
1510
+ ObjectManagementDetailComponent,
1511
+ ObjectManagementListColumnsComponent,
1512
+ ObjectManagementModalComponent,
1513
+ ObjectManagementUploadModalComponent,
1514
+ ObjectManagementListSearchFieldsComponent], imports: [CommonModule,
1515
+ DropzoneModule,
1516
+ WidgetModule,
1517
+ TranslateModule,
1518
+ ObjectManagementRoutingModule,
1519
+ VModalModule,
1520
+ FormModule,
1521
+ InputModule,
1522
+ SelectModule,
1523
+ InputModule$1,
1524
+ ButtonModule,
1525
+ TooltipIconModule,
1526
+ CarbonMultiInputModule,
1527
+ ModalModule,
1528
+ NotificationModule,
1529
+ LoadingModule,
1530
+ DropdownModule,
1531
+ CheckboxModule,
1532
+ LinkModule,
1533
+ IconModule,
1534
+ ReactiveFormsModule,
1535
+ ConfirmationModalModule,
1536
+ SpinnerModule,
1537
+ ModalModule$1,
1538
+ ValtimoCdsModalDirective,
1539
+ CarbonListModule] }); }
1540
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: ObjectManagementModule, imports: [CommonModule,
1541
+ DropzoneModule,
1542
+ WidgetModule,
1543
+ TranslateModule,
1544
+ ObjectManagementRoutingModule,
1545
+ VModalModule,
1546
+ FormModule,
1547
+ InputModule,
1548
+ SelectModule,
1549
+ InputModule$1,
1550
+ ButtonModule,
1551
+ TooltipIconModule,
1552
+ CarbonMultiInputModule,
1553
+ ModalModule,
1554
+ NotificationModule,
1555
+ LoadingModule,
1556
+ DropdownModule,
1557
+ CheckboxModule,
1558
+ LinkModule,
1559
+ IconModule,
1560
+ ReactiveFormsModule,
1561
+ ConfirmationModalModule,
1562
+ SpinnerModule,
1563
+ ModalModule$1,
1564
+ CarbonListModule] }); }
1565
+ }
1566
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: ObjectManagementModule, decorators: [{
1567
+ type: NgModule,
1568
+ args: [{
1569
+ declarations: [
1570
+ ObjectManagementListComponent,
1571
+ ObjectManagementDetailContainerComponent,
1572
+ ObjectManagementDetailComponent,
1573
+ ObjectManagementListColumnsComponent,
1574
+ ObjectManagementModalComponent,
1575
+ ObjectManagementUploadModalComponent,
1576
+ ObjectManagementListSearchFieldsComponent,
1577
+ ],
1578
+ imports: [
1579
+ CommonModule,
1580
+ DropzoneModule,
1581
+ WidgetModule,
1582
+ TranslateModule,
1583
+ ObjectManagementRoutingModule,
1584
+ VModalModule,
1585
+ FormModule,
1586
+ InputModule,
1587
+ SelectModule,
1588
+ InputModule$1,
1589
+ ButtonModule,
1590
+ TooltipIconModule,
1591
+ CarbonMultiInputModule,
1592
+ ModalModule,
1593
+ NotificationModule,
1594
+ LoadingModule,
1595
+ DropdownModule,
1596
+ CheckboxModule,
1597
+ LinkModule,
1598
+ IconModule,
1599
+ ReactiveFormsModule,
1600
+ ConfirmationModalModule,
1601
+ SpinnerModule,
1602
+ ModalModule$1,
1603
+ ValtimoCdsModalDirective,
1604
+ CarbonListModule,
1605
+ ],
1606
+ exports: [],
1607
+ }]
1608
+ }] });
1609
+
1610
+ /*
1611
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
1612
+ *
1613
+ * Licensed under EUPL, Version 1.2 (the "License");
1614
+ * you may not use this file except in compliance with the License.
1615
+ * You may obtain a copy of the License at
1616
+ *
1617
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1618
+ *
1619
+ * Unless required by applicable law or agreed to in writing, software
1620
+ * distributed under the License is distributed on an "AS IS" basis,
1621
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1622
+ * See the License for the specific language governing permissions and
1623
+ * limitations under the License.
1624
+ */
1625
+ /*
1626
+ * Public API Surface of object-management
1627
+ */
1628
+
1629
+ /**
1630
+ * Generated bundle index. Do not edit.
1631
+ */
1632
+
1633
+ export { ObjectManagementModule, ObjectManagementService };
1634
+ //# sourceMappingURL=valtimo-object-management.mjs.map