@valtimo/layout 13.2.0 → 13.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/img/emptystate-empty.svg +0 -0
- package/assets/img/emptystate-error.svg +0 -0
- package/assets/img/emptystate-error404.svg +0 -0
- package/assets/img/emptystate-no-result.svg +0 -0
- package/assets/img/emptystate-not-authorised.svg +0 -0
- package/assets/img/emptystate-success.svg +0 -0
- package/fesm2022/valtimo-layout.mjs +3147 -253
- package/fesm2022/valtimo-layout.mjs.map +1 -1
- package/lib/components/index.d.ts +13 -0
- package/lib/components/index.d.ts.map +1 -0
- package/lib/components/layout/index.d.ts +2 -0
- package/lib/components/layout/index.d.ts.map +1 -0
- package/lib/components/layout-internal/index.d.ts +2 -0
- package/lib/components/layout-internal/index.d.ts.map +1 -0
- package/lib/components/layout-public/index.d.ts +2 -0
- package/lib/components/layout-public/index.d.ts.map +1 -0
- package/lib/components/translation-management/index.d.ts +2 -0
- package/lib/components/translation-management/index.d.ts.map +1 -0
- package/lib/components/widget-block/index.d.ts +2 -0
- package/lib/components/widget-block/index.d.ts.map +1 -0
- package/lib/components/widget-block/widget-block.component.d.ts +40 -0
- package/lib/components/widget-block/widget-block.component.d.ts.map +1 -0
- package/lib/components/widget-collection/index.d.ts +2 -0
- package/lib/components/widget-collection/index.d.ts.map +1 -0
- package/lib/components/widget-collection/widget-collection.component.d.ts +45 -0
- package/lib/components/widget-collection/widget-collection.component.d.ts.map +1 -0
- package/lib/components/widget-container/index.d.ts +2 -0
- package/lib/components/widget-container/index.d.ts.map +1 -0
- package/lib/components/widget-container/widget-container.component.d.ts +29 -0
- package/lib/components/widget-container/widget-container.component.d.ts.map +1 -0
- package/lib/components/widget-custom/index.d.ts +2 -0
- package/lib/components/widget-custom/index.d.ts.map +1 -0
- package/lib/components/widget-custom/widget-custom.component.d.ts +29 -0
- package/lib/components/widget-custom/widget-custom.component.d.ts.map +1 -0
- package/lib/components/widget-field/index.d.ts +2 -0
- package/lib/components/widget-field/index.d.ts.map +1 -0
- package/lib/components/widget-field/widget-field.component.d.ts +35 -0
- package/lib/components/widget-field/widget-field.component.d.ts.map +1 -0
- package/lib/components/widget-formio/index.d.ts +2 -0
- package/lib/components/widget-formio/index.d.ts.map +1 -0
- package/lib/components/widget-formio/widget-formio.component.d.ts +30 -0
- package/lib/components/widget-formio/widget-formio.component.d.ts.map +1 -0
- package/lib/components/widget-management/index.d.ts +5 -0
- package/lib/components/widget-management/index.d.ts.map +1 -0
- package/lib/components/widget-management/management/widget-management.component.d.ts +19 -0
- package/lib/components/widget-management/management/widget-management.component.d.ts.map +1 -0
- package/lib/components/widget-management/management-content/collection/widget-management-collection.component.d.ts +63 -0
- package/lib/components/widget-management/management-content/collection/widget-management-collection.component.d.ts.map +1 -0
- package/lib/components/widget-management/management-content/custom/widget-management-custom.component.d.ts +40 -0
- package/lib/components/widget-management/management-content/custom/widget-management-custom.component.d.ts.map +1 -0
- package/lib/components/widget-management/management-content/fields/column/widget-management-fields-column.component.d.ts +56 -0
- package/lib/components/widget-management/management-content/fields/column/widget-management-fields-column.component.d.ts.map +1 -0
- package/lib/components/widget-management/management-content/fields/widget-management-fields.component.d.ts +42 -0
- package/lib/components/widget-management/management-content/fields/widget-management-fields.component.d.ts.map +1 -0
- package/lib/components/widget-management/management-content/index.d.ts +5 -0
- package/lib/components/widget-management/management-content/index.d.ts.map +1 -0
- package/lib/components/widget-management/management-content/table/widget-management-table.component.d.ts +38 -0
- package/lib/components/widget-management/management-content/table/widget-management-table.component.d.ts.map +1 -0
- package/lib/components/widget-management/management-editor/widget-management-editor.component.d.ts +35 -0
- package/lib/components/widget-management/management-editor/widget-management-editor.component.d.ts.map +1 -0
- package/lib/components/widget-management/management-wizard/steps/index.d.ts +6 -0
- package/lib/components/widget-management/management-wizard/steps/index.d.ts.map +1 -0
- package/lib/components/widget-management/management-wizard/steps/widget-wizard-content-step/widget-wizard-content-step.component.d.ts +15 -0
- package/lib/components/widget-management/management-wizard/steps/widget-wizard-content-step/widget-wizard-content-step.component.d.ts.map +1 -0
- package/lib/components/widget-management/management-wizard/steps/widget-wizard-style-step/widget-wizard-style-step.component.d.ts +15 -0
- package/lib/components/widget-management/management-wizard/steps/widget-wizard-style-step/widget-wizard-style-step.component.d.ts.map +1 -0
- package/lib/components/widget-management/management-wizard/steps/widget-wizard-type-step/widget-wizard-type-step.component.d.ts +15 -0
- package/lib/components/widget-management/management-wizard/steps/widget-wizard-type-step/widget-wizard-type-step.component.d.ts.map +1 -0
- package/lib/components/widget-management/management-wizard/steps/widget-wizard-width-step/widget-wizard-width-step.component.d.ts +16 -0
- package/lib/components/widget-management/management-wizard/steps/widget-wizard-width-step/widget-wizard-width-step.component.d.ts.map +1 -0
- package/lib/components/widget-management/management-wizard/widget-management-wizard.component.d.ts +38 -0
- package/lib/components/widget-management/management-wizard/widget-management-wizard.component.d.ts.map +1 -0
- package/lib/components/widget-table/index.d.ts +2 -0
- package/lib/components/widget-table/index.d.ts.map +1 -0
- package/lib/components/widget-table/widget-table.component.d.ts +26 -0
- package/lib/components/widget-table/widget-table.component.d.ts.map +1 -0
- package/lib/constants/custom-widget-token.d.ts +5 -0
- package/lib/constants/custom-widget-token.d.ts.map +1 -0
- package/lib/constants/index.d.ts +4 -0
- package/lib/constants/index.d.ts.map +1 -0
- package/lib/constants/widget-management.constants.d.ts +5 -0
- package/lib/constants/widget-management.constants.d.ts.map +1 -0
- package/lib/constants/widget.constants.d.ts +6 -0
- package/lib/constants/widget.constants.d.ts.map +1 -0
- package/lib/interfaces/index.d.ts +3 -0
- package/lib/interfaces/index.d.ts.map +1 -0
- package/lib/interfaces/widget-content-component.interface.d.ts +5 -0
- package/lib/interfaces/widget-content-component.interface.d.ts.map +1 -0
- package/lib/interfaces/widget-management-service.interface.d.ts +13 -0
- package/lib/interfaces/widget-management-service.interface.d.ts.map +1 -0
- package/lib/models/index.d.ts +6 -0
- package/lib/models/index.d.ts.map +1 -0
- package/lib/models/widget-content.model.d.ts +52 -0
- package/lib/models/widget-content.model.d.ts.map +1 -0
- package/lib/models/widget-display.model.d.ts +62 -0
- package/lib/models/widget-display.model.d.ts.map +1 -0
- package/lib/models/widget-editor.model.d.ts +10 -0
- package/lib/models/widget-editor.model.d.ts.map +1 -0
- package/lib/models/widget-wizard.model.d.ts +38 -0
- package/lib/models/widget-wizard.model.d.ts.map +1 -0
- package/lib/models/widget.model.d.ts +107 -0
- package/lib/models/widget.model.d.ts.map +1 -0
- package/lib/services/index.d.ts +3 -0
- package/lib/services/index.d.ts.map +1 -1
- package/lib/services/widget-fields.service.d.ts +17 -0
- package/lib/services/widget-fields.service.d.ts.map +1 -0
- package/lib/services/widget-layout.service.d.ts +35 -0
- package/lib/services/widget-layout.service.d.ts.map +1 -0
- package/lib/services/widget-wizard.service.d.ts +20 -0
- package/lib/services/widget-wizard.service.d.ts.map +1 -0
- package/package.json +1 -1
- package/public_api.d.ts +4 -0
- package/public_api.d.ts.map +1 -1
|
@@ -1,20 +1,29 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Injectable, Component, ViewChild, ViewContainerRef, NgModule
|
|
3
|
-
import
|
|
4
|
-
import { NavigationEnd, RouterModule } from '@angular/router';
|
|
5
|
-
import { Subscription, BehaviorSubject, tap, switchMap, map, combineLatest, take } from 'rxjs';
|
|
6
|
-
import { filter } from 'rxjs/operators';
|
|
7
|
-
import * as i5 from 'carbon-components-angular';
|
|
8
|
-
import { LoadingModule, ButtonModule, IconModule } from 'carbon-components-angular';
|
|
2
|
+
import { Injectable, InjectionToken, EventEmitter, computed, Output, Input, HostBinding, ViewEncapsulation, ChangeDetectionStrategy, Component, signal, ViewChild, Optional, Inject, ViewContainerRef, NgModule } from '@angular/core';
|
|
3
|
+
import { Subscription, debounceTime, map, BehaviorSubject, combineLatest, filter, tap, switchMap, take, of, startWith, merge, delay, Subject } from 'rxjs';
|
|
9
4
|
import * as i4 from '@angular/common';
|
|
10
5
|
import { CommonModule, DOCUMENT } from '@angular/common';
|
|
11
|
-
import * as i2
|
|
6
|
+
import * as i2 from '@angular/forms';
|
|
7
|
+
import { Validators, ReactiveFormsModule } from '@angular/forms';
|
|
8
|
+
import * as i2$1 from '@ngx-translate/core';
|
|
9
|
+
import { TranslateModule, TranslatePipe } from '@ngx-translate/core';
|
|
10
|
+
import * as i1 from '@valtimo/components';
|
|
11
|
+
import { ValuePathSelectorPrefix, InputLabelModule, ValuePathSelectorComponent, CARBON_THEME, CurrentCarbonTheme, ValuePathType, ViewType, CarbonListModule, EllipsisPipe, FormIoModule, CARBON_CONSTANTS, ConfirmationModalModule, JsonEditorComponent, MenuRoutingModule, TopbarModule, LeftSidebarModule, RightSidebarModule, PageHeaderModule, AlertModule, PromptModule, MultiInputFormModule, CarbonMultiInputModule, RenderInPageHeaderDirective } from '@valtimo/components';
|
|
12
|
+
import * as i3 from 'carbon-components-angular';
|
|
13
|
+
import { ButtonModule, DropdownModule, InputModule, IconModule, AccordionModule, CheckboxModule, TabsModule, Tab, ToggleModule, SelectModule, PaginationModel, PaginationModule, TilesModule, LoadingModule, ProgressIndicatorModule, ModalModule } from 'carbon-components-angular';
|
|
14
|
+
import { TrashCan16 } from '@carbon/icons';
|
|
15
|
+
import * as i2$2 from '@angular/router';
|
|
16
|
+
import { NavigationEnd, RouterModule } from '@angular/router';
|
|
17
|
+
import { filter as filter$1 } from 'rxjs/operators';
|
|
18
|
+
import * as i2$3 from '@valtimo/shared';
|
|
12
19
|
import { GlobalNotificationComponent, ROLE_ADMIN } from '@valtimo/shared';
|
|
13
|
-
import
|
|
14
|
-
import {
|
|
15
|
-
import
|
|
16
|
-
import * as
|
|
17
|
-
import
|
|
20
|
+
import { isEqual, cloneDeep } from 'lodash';
|
|
21
|
+
import { takeUntilDestroyed, toObservable } from '@angular/core/rxjs-interop';
|
|
22
|
+
import * as i1$1 from '@valtimo/form';
|
|
23
|
+
import * as i2$4 from '@valtimo/document';
|
|
24
|
+
import * as i3$1 from '@valtimo/access-control';
|
|
25
|
+
import { v4 } from 'uuid';
|
|
26
|
+
import Muuri from 'muuri';
|
|
18
27
|
import { AuthGuardService } from '@valtimo/security';
|
|
19
28
|
|
|
20
29
|
/*
|
|
@@ -42,10 +51,10 @@ class LayoutService {
|
|
|
42
51
|
toggleFullscreen() {
|
|
43
52
|
this.fullscreen = !this.fullscreen;
|
|
44
53
|
}
|
|
45
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
46
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.
|
|
54
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: LayoutService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
55
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: LayoutService, providedIn: 'root' }); }
|
|
47
56
|
}
|
|
48
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
57
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: LayoutService, decorators: [{
|
|
49
58
|
type: Injectable,
|
|
50
59
|
args: [{
|
|
51
60
|
providedIn: 'root',
|
|
@@ -67,6 +76,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
67
76
|
* See the License for the specific language governing permissions and
|
|
68
77
|
* limitations under the License.
|
|
69
78
|
*/
|
|
79
|
+
const CUSTOM_WIDGET_TOKEN = new InjectionToken('Specify a component to display per configured custom widget component key.');
|
|
70
80
|
|
|
71
81
|
/*
|
|
72
82
|
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
@@ -83,14 +93,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
83
93
|
* See the License for the specific language governing permissions and
|
|
84
94
|
* limitations under the License.
|
|
85
95
|
*/
|
|
86
|
-
class LayoutPublicComponent {
|
|
87
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: LayoutPublicComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
88
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: LayoutPublicComponent, isStandalone: false, selector: "valtimo-layout-public", 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=\"public-page-content\">\n <img src=\"assets/logo.svg\" class=\"logo\" />\n <router-outlet></router-outlet>\n</div>\n", styles: ["body{background-color:#eee}.public-page-content{background-color:#fff;margin:60px auto;border:1px solid #dee2e6;padding:0 30px 30px}.public-page-content .logo{width:25%;display:block;margin:30px auto}@media (min-width: 768px){.public-page-content{width:50%}}@media (max-width: 767px) and (min-width: 576px){.public-page-content{width:75%}}@media (max-width: 575px){.public-page-content{width:95%}.public-page-content .logo{width:50%}}\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: i2.RouterOutlet, selector: "router-outlet", inputs: ["name", "routerOutletData"], outputs: ["activate", "deactivate", "attach", "detach"], exportAs: ["outlet"] }] }); }
|
|
89
|
-
}
|
|
90
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: LayoutPublicComponent, decorators: [{
|
|
91
|
-
type: Component,
|
|
92
|
-
args: [{ selector: 'valtimo-layout-public', standalone: false, 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=\"public-page-content\">\n <img src=\"assets/logo.svg\" class=\"logo\" />\n <router-outlet></router-outlet>\n</div>\n", styles: ["body{background-color:#eee}.public-page-content{background-color:#fff;margin:60px auto;border:1px solid #dee2e6;padding:0 30px 30px}.public-page-content .logo{width:25%;display:block;margin:30px auto}@media (min-width: 768px){.public-page-content{width:50%}}@media (max-width: 767px) and (min-width: 576px){.public-page-content{width:75%}}@media (max-width: 575px){.public-page-content{width:95%}.public-page-content .logo{width:50%}}\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"] }]
|
|
93
|
-
}] });
|
|
94
96
|
|
|
95
97
|
/*
|
|
96
98
|
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
@@ -107,37 +109,260 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
107
109
|
* See the License for the specific language governing permissions and
|
|
108
110
|
* limitations under the License.
|
|
109
111
|
*/
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
112
|
+
var WidgetDisplayTypeKey;
|
|
113
|
+
(function (WidgetDisplayTypeKey) {
|
|
114
|
+
WidgetDisplayTypeKey["TEXT"] = "text";
|
|
115
|
+
WidgetDisplayTypeKey["BOOLEAN"] = "boolean";
|
|
116
|
+
WidgetDisplayTypeKey["CURRENCY"] = "currency";
|
|
117
|
+
WidgetDisplayTypeKey["DATE"] = "date";
|
|
118
|
+
WidgetDisplayTypeKey["DATE_TIME"] = "datetime";
|
|
119
|
+
WidgetDisplayTypeKey["ENUM"] = "enum";
|
|
120
|
+
WidgetDisplayTypeKey["NUMBER"] = "number";
|
|
121
|
+
WidgetDisplayTypeKey["PERCENT"] = "percent";
|
|
122
|
+
WidgetDisplayTypeKey["LINK"] = "link";
|
|
123
|
+
})(WidgetDisplayTypeKey || (WidgetDisplayTypeKey = {}));
|
|
124
|
+
|
|
125
|
+
var WidgetType;
|
|
126
|
+
(function (WidgetType) {
|
|
127
|
+
WidgetType["FIELDS"] = "fields";
|
|
128
|
+
WidgetType["TABLE"] = "table";
|
|
129
|
+
WidgetType["CUSTOM"] = "custom";
|
|
130
|
+
WidgetType["COLLECTION"] = "collection";
|
|
131
|
+
WidgetType["FORMIO"] = "formio";
|
|
132
|
+
})(WidgetType || (WidgetType = {}));
|
|
133
|
+
|
|
134
|
+
/*
|
|
135
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
136
|
+
*
|
|
137
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
138
|
+
* you may not use this file except in compliance with the License.
|
|
139
|
+
* You may obtain a copy of the License at
|
|
140
|
+
*
|
|
141
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
142
|
+
*
|
|
143
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
144
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
145
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
146
|
+
* See the License for the specific language governing permissions and
|
|
147
|
+
* limitations under the License.
|
|
148
|
+
*/
|
|
149
|
+
var WidgetManagementTab;
|
|
150
|
+
(function (WidgetManagementTab) {
|
|
151
|
+
WidgetManagementTab["VISUAL"] = "visual";
|
|
152
|
+
WidgetManagementTab["JSON"] = "json";
|
|
153
|
+
})(WidgetManagementTab || (WidgetManagementTab = {}));
|
|
154
|
+
const WidgetTypeTags = {
|
|
155
|
+
[WidgetType.COLLECTION]: 'teal',
|
|
156
|
+
[WidgetType.CUSTOM]: 'magenta',
|
|
157
|
+
[WidgetType.FIELDS]: 'blue',
|
|
158
|
+
[WidgetType.FORMIO]: 'green',
|
|
159
|
+
[WidgetType.TABLE]: 'purple',
|
|
160
|
+
};
|
|
161
|
+
|
|
162
|
+
/*
|
|
163
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
164
|
+
*
|
|
165
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
166
|
+
* you may not use this file except in compliance with the License.
|
|
167
|
+
* You may obtain a copy of the License at
|
|
168
|
+
*
|
|
169
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
170
|
+
*
|
|
171
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
172
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
173
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
174
|
+
* See the License for the specific language governing permissions and
|
|
175
|
+
* limitations under the License.
|
|
176
|
+
*/
|
|
177
|
+
class WidgetManagementFieldsColumnComponent {
|
|
178
|
+
get formRows() {
|
|
179
|
+
if (!this.formGroup.get('rows'))
|
|
180
|
+
return undefined;
|
|
181
|
+
return this.formGroup.get('rows');
|
|
120
182
|
}
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
183
|
+
getDisplayItemsSelected(row) {
|
|
184
|
+
return this.widgetFieldsService.getDisplayItemsSelected(row);
|
|
185
|
+
}
|
|
186
|
+
constructor(cdsThemeService, cdr, fb, iconService, translateService, widgetFieldsService, widgetWizardService) {
|
|
187
|
+
this.cdsThemeService = cdsThemeService;
|
|
188
|
+
this.cdr = cdr;
|
|
189
|
+
this.fb = fb;
|
|
190
|
+
this.iconService = iconService;
|
|
191
|
+
this.translateService = translateService;
|
|
192
|
+
this.widgetFieldsService = widgetFieldsService;
|
|
193
|
+
this.widgetWizardService = widgetWizardService;
|
|
194
|
+
this.class = 'valtimo-widget-management-field-column';
|
|
195
|
+
this.addTranslateKey = 'widgetTabManagement.content.fields.add';
|
|
196
|
+
this.showHideWhenEmptyCheckbox = false;
|
|
197
|
+
this.columnUpdateEvent = new EventEmitter();
|
|
198
|
+
this.ValuePathSelectorPrefix = ValuePathSelectorPrefix;
|
|
199
|
+
this.formGroup = this.fb.group({
|
|
200
|
+
rows: this.fb.array([]),
|
|
126
201
|
});
|
|
127
|
-
this.
|
|
202
|
+
this.displayTypeItems = this.widgetFieldsService.displayTypeItems;
|
|
203
|
+
this.WidgetDisplayTypeKey = WidgetDisplayTypeKey;
|
|
204
|
+
this.$widgetType = computed(() => this.widgetWizardService.$selectedWidget()?.type ?? WidgetType.FIELDS);
|
|
205
|
+
this.$isFieldWidget = computed(() => this.$widgetType() === WidgetType.FIELDS);
|
|
206
|
+
this.inputTheme$ = this.cdsThemeService.currentTheme$;
|
|
207
|
+
this._subscriptions = new Subscription();
|
|
208
|
+
this.iconService.register(TrashCan16);
|
|
209
|
+
}
|
|
210
|
+
ngOnInit() {
|
|
211
|
+
this.initForm();
|
|
212
|
+
this.openFormSubscription();
|
|
128
213
|
}
|
|
129
214
|
ngOnDestroy() {
|
|
130
|
-
this.
|
|
215
|
+
this._subscriptions.unsubscribe();
|
|
216
|
+
this.formGroup.reset();
|
|
217
|
+
}
|
|
218
|
+
addField() {
|
|
219
|
+
if (!this.formRows)
|
|
220
|
+
return;
|
|
221
|
+
this.formRows.push(this.fb.group({
|
|
222
|
+
type: this.fb.control({ content: '', selected: false }, [
|
|
223
|
+
Validators.required,
|
|
224
|
+
this.typeSelectValidator,
|
|
225
|
+
]),
|
|
226
|
+
title: this.fb.control('', Validators.required),
|
|
227
|
+
content: this.fb.control('', Validators.required),
|
|
228
|
+
ellipsisCharacterLimit: this.fb.control(null, Validators.pattern('[1-9][0-9]*')),
|
|
229
|
+
hideWhenEmpty: this.fb.control(false),
|
|
230
|
+
}));
|
|
231
|
+
}
|
|
232
|
+
onDeleteRowClick(event, formArray, index) {
|
|
233
|
+
event.stopImmediatePropagation();
|
|
234
|
+
if (!formArray)
|
|
235
|
+
return;
|
|
236
|
+
formArray.removeAt(index);
|
|
131
237
|
}
|
|
132
|
-
|
|
133
|
-
|
|
238
|
+
onTypeSelected(formRow, event) {
|
|
239
|
+
this.widgetFieldsService.onDisplayTypeSelected(['title', 'content', 'type', 'hideWhenEmpty'], formRow, event);
|
|
240
|
+
}
|
|
241
|
+
onAddEnumValueClick(valuesFormArray) {
|
|
242
|
+
valuesFormArray.push(this.fb.group({
|
|
243
|
+
key: this.fb.control('', Validators.required),
|
|
244
|
+
value: this.fb.control('', Validators.required),
|
|
245
|
+
}));
|
|
246
|
+
}
|
|
247
|
+
typeSelectValidator(control) {
|
|
248
|
+
const controlValue = control.value;
|
|
249
|
+
if (!controlValue || !controlValue.selected)
|
|
250
|
+
return { error: 'Type is not selected' };
|
|
251
|
+
return null;
|
|
252
|
+
}
|
|
253
|
+
getRowForm(row) {
|
|
254
|
+
return this.fb.group({
|
|
255
|
+
type: this.fb.control({
|
|
256
|
+
content: this.translateService.instant(this.translateService.instant(`widgetTabManagement.content.displayType.${row.displayProperties?.type ?? WidgetDisplayTypeKey.TEXT}`)),
|
|
257
|
+
id: row.displayProperties?.type ?? WidgetDisplayTypeKey.TEXT,
|
|
258
|
+
selected: true,
|
|
259
|
+
}, Validators.required),
|
|
260
|
+
title: this.fb.control(row.title, Validators.required),
|
|
261
|
+
content: this.fb.control(row.value, Validators.required),
|
|
262
|
+
...((!row.displayProperties || row.displayProperties?.type === WidgetDisplayTypeKey.TEXT) && {
|
|
263
|
+
ellipsisCharacterLimit: this.fb.control(row.displayProperties?.ellipsisCharacterLimit ?? null, Validators.pattern('[1-9][0-9]*')),
|
|
264
|
+
}),
|
|
265
|
+
hideWhenEmpty: this.fb.control(row.displayProperties?.hideWhenEmpty ?? false),
|
|
266
|
+
...([WidgetDisplayTypeKey.NUMBER, WidgetDisplayTypeKey.PERCENT].includes(row.displayProperties?.type) && {
|
|
267
|
+
digitsInfo: this.fb.control(row.displayProperties.digitsInfo ?? ''),
|
|
268
|
+
}),
|
|
269
|
+
...(row.displayProperties?.type === WidgetDisplayTypeKey.CURRENCY && {
|
|
270
|
+
digitsInfo: this.fb.control(row.displayProperties.digitsInfo ?? ''),
|
|
271
|
+
currencyCode: this.fb.control(row.displayProperties.currencyCode ?? ''),
|
|
272
|
+
display: this.fb.control(row.displayProperties.display ?? ''),
|
|
273
|
+
}),
|
|
274
|
+
...(row.displayProperties?.type === WidgetDisplayTypeKey.DATE && {
|
|
275
|
+
format: this.fb.control(row.displayProperties.format ?? ''),
|
|
276
|
+
}),
|
|
277
|
+
...(row.displayProperties?.type === WidgetDisplayTypeKey.DATE_TIME && {
|
|
278
|
+
format: this.fb.control(row.displayProperties.format ?? ''),
|
|
279
|
+
}),
|
|
280
|
+
...(row.displayProperties?.type === WidgetDisplayTypeKey.LINK && {
|
|
281
|
+
linkText: this.fb.control(row.displayProperties.linkText ?? ''),
|
|
282
|
+
}),
|
|
283
|
+
...(row.displayProperties?.type === WidgetDisplayTypeKey.ENUM && {
|
|
284
|
+
values: this.fb.array(Object.entries(row.displayProperties.values).map(([key, value]) => this.fb.group({
|
|
285
|
+
key: this.fb.control(key, Validators.required),
|
|
286
|
+
value: this.fb.control(value, Validators.required),
|
|
287
|
+
}))),
|
|
288
|
+
}),
|
|
289
|
+
});
|
|
290
|
+
}
|
|
291
|
+
initForm() {
|
|
292
|
+
if (!this.columnData) {
|
|
293
|
+
this.addField();
|
|
294
|
+
return;
|
|
295
|
+
}
|
|
296
|
+
const rowsControl = this.formGroup.get('rows');
|
|
297
|
+
if (!rowsControl)
|
|
298
|
+
return;
|
|
299
|
+
this.columnData.forEach((row) => {
|
|
300
|
+
rowsControl.push(this.getRowForm(row), { emitEvent: false });
|
|
301
|
+
});
|
|
302
|
+
this.columnUpdateEvent.emit({ data: this.columnData, valid: true });
|
|
303
|
+
this.cdr.detectChanges();
|
|
304
|
+
}
|
|
305
|
+
openFormSubscription() {
|
|
306
|
+
this._subscriptions.add(this.formRows?.valueChanges.pipe(debounceTime(100)).subscribe((rows) => {
|
|
307
|
+
const mappedRows = rows.map((row) => ({
|
|
308
|
+
key: row.title.replace(/\W+/g, '-').replace(/\-$/, '').toLowerCase(),
|
|
309
|
+
title: row.title,
|
|
310
|
+
value: row.content,
|
|
311
|
+
...(!!row?.type.id && {
|
|
312
|
+
displayProperties: {
|
|
313
|
+
type: row.type.id,
|
|
314
|
+
...(!!row?.ellipsisCharacterLimit && {
|
|
315
|
+
ellipsisCharacterLimit: row.ellipsisCharacterLimit,
|
|
316
|
+
}),
|
|
317
|
+
...(!!row?.hideWhenEmpty && { hideWhenEmpty: row.hideWhenEmpty }),
|
|
318
|
+
...(!!row?.currencyCode && { currencyCode: row.currencyCode }),
|
|
319
|
+
...(!!row?.display && { display: row.display }),
|
|
320
|
+
...(!!row?.digitsInfo && { digitsInfo: row.digitsInfo }),
|
|
321
|
+
...(!!row?.linkText && { linkText: row.linkText }),
|
|
322
|
+
...(!!row?.format && { format: row.format }),
|
|
323
|
+
...(!!row?.values && {
|
|
324
|
+
values: row.values?.reduce((acc, curr) => ({ ...acc, [curr.key]: curr.value }), {}),
|
|
325
|
+
}),
|
|
326
|
+
},
|
|
327
|
+
}),
|
|
328
|
+
}));
|
|
329
|
+
this.columnUpdateEvent.emit({ data: mappedRows, valid: this.formGroup.valid });
|
|
330
|
+
}));
|
|
331
|
+
}
|
|
332
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: WidgetManagementFieldsColumnComponent, deps: [{ token: i1.CdsThemeService }, { token: i0.ChangeDetectorRef }, { token: i2.FormBuilder }, { token: i3.IconService }, { token: i2$1.TranslateService }, { token: WidgetFieldsService }, { token: WidgetWizardService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
333
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.15", type: WidgetManagementFieldsColumnComponent, isStandalone: true, selector: "valtimo-widget-management-fields-column", inputs: { columnData: "columnData", addTranslateKey: "addTranslateKey", fieldWidthDropdown: "fieldWidthDropdown", selectedCollection: "selectedCollection", showHideWhenEmptyCheckbox: "showHideWhenEmptyCheckbox" }, outputs: { columnUpdateEvent: "columnUpdateEvent" }, host: { properties: { "class": "this.class" } }, ngImport: i0, template: "<!--\n ~ Copyright 2015-2025 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n<form\n *ngIf=\"inputTheme$ | async as inputTheme\"\n class=\"valtimo-widget-management-field-column\"\n [formGroup]=\"formGroup\"\n>\n <cds-accordion formArrayName=\"rows\" align=\"start\" size=\"sm\">\n @for (formRow of formRows.controls; track $index) {\n <cds-accordion-item\n [title]=\"fieldTitle\"\n [context]=\"{count: $count, index: $index, title: formRow.get('title')?.value}\"\n [expanded]=\"$index === 0\"\n class=\"valtimo-widget-management-field-column__item\"\n >\n <form [formGroup]=\"formRow\" class=\"valtimo-widget-management-field-column__container\">\n <div\n class=\"valtimo-widget-management-field-column__content\"\n [class.valtimo-widget-management-field-column__content--collection]=\"\n !!fieldWidthDropdown\n \"\n >\n <cds-text-label>\n <v-input-label\n [title]=\"'widgetTabManagement.content.fields.title' | translate\"\n [tooltip]=\"\n 'widgetTabManagement.content.' + $widgetType() + '.titleTooltip' | translate\n \"\n >\n </v-input-label>\n\n <input\n cdsText\n [attr.data-carbon-theme]=\"inputTheme\"\n [placeholder]=\"'widgetTabManagement.content.fields.titlePlaceholder' | translate\"\n type=\"text\"\n formControlName=\"title\"\n />\n </cds-text-label>\n\n <cds-dropdown\n [attr.data-carbon-theme]=\"inputTheme\"\n [label]=\"'widgetTabManagement.content.fields.type' | translate\"\n [dropUp]=\"false\"\n [placeholder]=\"'widgetTabManagement.content.fields.typePlaceholder' | translate\"\n (selected)=\"onTypeSelected(formRow, $event)\"\n formControlName=\"type\"\n >\n <cds-dropdown-list [items]=\"getDisplayItemsSelected(formRow)\"></cds-dropdown-list>\n </cds-dropdown>\n\n <ng-container\n *ngTemplateOutlet=\"fieldWidthDropdown; context: {index: $index}\"\n ></ng-container>\n\n <div class=\"valtimo-widget-management-field-column__path-selector\">\n <v-input-label\n [title]=\"'widgetTabManagement.content.fields.value' | translate\"\n [tooltip]=\"\n 'widgetTabManagement.content.' + $widgetType() + '.valueTooltip' | translate\n \"\n >\n </v-input-label>\n\n <input\n cdsText\n [attr.data-carbon-theme]=\"inputTheme\"\n [placeholder]=\"'widgetTabManagement.content.fields.value' | translate\"\n type=\"text\"\n formControlName=\"content\"\n />\n <!-- TODO: Implement when selector is up and parameterise -->\n <!-- <valtimo-value-path-selector\n formControlName=\"content\"\n [caseDefinitionKey]=\"params?.caseDefinitionKey\"\n [caseDefinitionVersionTag]=\"params?.caseDefinitionVersionTag\"\n [parentItem]=\"selectedCollection\"\n ></valtimo-value-path-selector> -->\n </div>\n </div>\n\n <div class=\"valtimo-widget-management-field-column__options\">\n @switch (formRow.get('type').value.id) {\n @case (WidgetDisplayTypeKey.CURRENCY) {\n <cds-text-label>\n <v-input-label\n [title]=\"'widgetTabManagement.content.fields.currencyCode' | translate\"\n [tooltip]=\"'widgetTabManagement.content.fields.currencyCodeTooltip' | translate\"\n >\n </v-input-label>\n\n <input\n cdsText\n [attr.data-carbon-theme]=\"inputTheme\"\n [placeholder]=\"\n 'widgetTabManagement.content.fields.currencyCodePlaceholder' | translate\n \"\n type=\"text\"\n formControlName=\"currencyCode\"\n />\n </cds-text-label>\n\n <cds-text-label>\n <v-input-label\n [title]=\"'widgetTabManagement.content.fields.display' | translate\"\n [tooltip]=\"'widgetTabManagement.content.fields.displayTooltip' | translate\"\n >\n </v-input-label>\n\n <input\n cdsText\n [attr.data-carbon-theme]=\"inputTheme\"\n [placeholder]=\"\n 'widgetTabManagement.content.fields.displayPlaceholder' | translate\n \"\n type=\"text\"\n formControlName=\"display\"\n />\n </cds-text-label>\n\n <cds-text-label>\n <v-input-label\n [title]=\"'widgetTabManagement.content.fields.digitsInfo' | translate\"\n tooltip=\"{{\n 'widgetTabManagement.content.fields.digitsInfoTooltip'\n | translate: {minFractionDigits: 2, maxFractionDigits: 2}\n }}\"\n >\n </v-input-label>\n\n <input\n cdsText\n [attr.data-carbon-theme]=\"inputTheme\"\n [placeholder]=\"\n 'widgetTabManagement.content.fields.digitsInfoPlaceholder' | translate\n \"\n type=\"text\"\n formControlName=\"digitsInfo\"\n />\n </cds-text-label>\n }\n @case (WidgetDisplayTypeKey.DATE) {\n <cds-text-label>\n <v-input-label\n [title]=\"'widgetTabManagement.content.fields.format' | translate\"\n [tooltip]=\"'widgetTabManagement.content.fields.dateFormatTooltip' | translate\"\n ></v-input-label>\n\n <input\n cdsText\n [attr.data-carbon-theme]=\"inputTheme\"\n [placeholder]=\"\n 'widgetTabManagement.content.fields.formatPlaceholder' | translate\n \"\n type=\"text\"\n formControlName=\"format\"\n />\n </cds-text-label>\n }\n @case (WidgetDisplayTypeKey.DATE_TIME) {\n <cds-text-label>\n <v-input-label\n [title]=\"'widgetTabManagement.content.fields.format' | translate\"\n [tooltip]=\"\n 'widgetTabManagement.content.fields.dateTimeFormatTooltip' | translate\n \"\n ></v-input-label>\n\n <input\n cdsText\n [attr.data-carbon-theme]=\"inputTheme\"\n [placeholder]=\"\n 'widgetTabManagement.content.fields.formatPlaceholder' | translate\n \"\n type=\"text\"\n formControlName=\"format\"\n />\n </cds-text-label>\n }\n @case (WidgetDisplayTypeKey.ENUM) {\n <div class=\"valtimo-widget-management-field-column__enum\" formArrayName=\"values\">\n @for (rowValue of formRow.get('values')?.controls; track $index) {\n <form\n [formGroup]=\"rowValue\"\n class=\"valtimo-widget-management-field-column__enum-form\"\n >\n <cds-text-label>\n <v-input-label\n *ngIf=\"$index === 0\"\n [title]=\"'widgetTabManagement.content.fields.enumValue' | translate\"\n [tooltip]=\"\n 'widgetTabManagement.content.fields.enumValueTooltip' | translate\n \"\n ></v-input-label>\n\n <input\n [attr.data-carbon-theme]=\"inputTheme\"\n cdsText\n [placeholder]=\"'widgetTabManagement.content.fields.enumValue' | translate\"\n type=\"text\"\n formControlName=\"key\"\n />\n </cds-text-label>\n\n <cds-text-label>\n <v-input-label\n *ngIf=\"$index === 0\"\n [title]=\"'widgetTabManagement.content.fields.enumDisplay' | translate\"\n [tooltip]=\"\n 'widgetTabManagement.content.fields.enumDisplayTooltip' | translate\n \"\n ></v-input-label>\n\n <input\n cdsText\n [attr.data-carbon-theme]=\"inputTheme\"\n [placeholder]=\"\n 'widgetTabManagement.content.fields.enumDisplay' | translate\n \"\n type=\"text\"\n formControlName=\"value\"\n />\n </cds-text-label>\n\n <button\n cdsButton=\"danger--ghost\"\n [disabled]=\"$count === 1\"\n [iconOnly]=\"true\"\n class=\"valtimo-widget-management-field-column__delete-button enum\"\n (click)=\"onDeleteRowClick($event, formRow.get('values'), $index)\"\n >\n <svg cdsIcon=\"trash-can\" size=\"16\"></svg>\n </button>\n </form>\n }\n\n <button\n cdsButton=\"primary\"\n size=\"sm\"\n (click)=\"onAddEnumValueClick(formRow.get('values'))\"\n >\n {{ 'widgetTabManagement.content.fields.addEnum' | translate }}\n\n <svg class=\"cds--btn__icon\" cdsIcon=\"add\" size=\"16\"></svg>\n </button>\n </div>\n }\n @case (WidgetDisplayTypeKey.NUMBER) {\n <cds-text-label>\n <v-input-label\n [title]=\"'widgetTabManagement.content.fields.digitsInfo' | translate\"\n tooltip=\"{{\n 'widgetTabManagement.content.fields.digitsInfoTooltip'\n | translate\n : {\n minFractionDigits: 0,\n maxFractionDigits: 3,\n }\n }}\"\n >\n </v-input-label>\n\n <input\n cdsText\n [attr.data-carbon-theme]=\"inputTheme\"\n [placeholder]=\"'widgetTabManagement.content.fields.digitsInfo' | translate\"\n type=\"text\"\n formControlName=\"digitsInfo\"\n />\n </cds-text-label>\n }\n @case (WidgetDisplayTypeKey.PERCENT) {\n <cds-text-label>\n <v-input-label\n [title]=\"'widgetTabManagement.content.fields.digitsInfo' | translate\"\n tooltip=\"{{\n 'widgetTabManagement.content.fields.digitsInfoTooltip'\n | translate\n : {\n minFractionDigits: 0,\n maxFractionDigits: 0,\n }\n }}\"\n >\n </v-input-label>\n\n <input\n cdsText\n [attr.data-carbon-theme]=\"inputTheme\"\n [placeholder]=\"'widgetTabManagement.content.fields.digitsInfo' | translate\"\n type=\"text\"\n formControlName=\"digitsInfo\"\n />\n </cds-text-label>\n }\n @case (WidgetDisplayTypeKey.LINK) {\n <cds-text-label>\n <v-input-label\n [title]=\"'widgetTabManagement.content.fields.linkText' | translate\"\n [tooltip]=\"'widgetTabManagement.content.fields.linkTextTooltip' | translate\"\n >\n </v-input-label>\n\n <input\n cdsText\n [attr.data-carbon-theme]=\"inputTheme\"\n [placeholder]=\"\n 'widgetTabManagement.content.fields.linkTextPlaceholder' | translate\n \"\n type=\"text\"\n formControlName=\"linkText\"\n />\n </cds-text-label>\n }\n }\n\n <cds-text-label\n *ngIf=\"formRow.get('type').value.id === WidgetDisplayTypeKey.TEXT && $isFieldWidget()\"\n >\n <v-input-label\n [title]=\"'widgetTabManagement.content.fields.ellipsisCharacterLimit' | translate\"\n tooltip=\"{{\n 'widgetTabManagement.content.fields.ellipsisCharacterLimitTooltip' | translate\n }}\"\n >\n </v-input-label>\n\n <input\n cdsText\n [attr.data-carbon-theme]=\"inputTheme\"\n [placeholder]=\"\n 'widgetTabManagement.content.fields.ellipsisCharacterLimitPlaceholder' | translate\n \"\n type=\"text\"\n formControlName=\"ellipsisCharacterLimit\"\n />\n </cds-text-label>\n\n <cds-checkbox *ngIf=\"showHideWhenEmptyCheckbox\" formControlName=\"hideWhenEmpty\">\n {{ 'widgetTabManagement.content.hideWhenEmpty' | translate }}\n </cds-checkbox>\n </div>\n </form>\n </cds-accordion-item>\n }\n </cds-accordion>\n\n <button cdsButton=\"primary\" size=\"sm\" (click)=\"addField()\">\n {{ addTranslateKey | translate }}\n\n <svg class=\"cds--btn__icon\" cdsIcon=\"add\" size=\"16\"></svg>\n </button>\n</form>\n\n<ng-template #fieldTitle let-count=\"count\" let-index=\"index\" let-title=\"title\">\n <div class=\"valtimo-widget-management-field-column__title\">\n {{ title || ('widgetTabManagement.content.fields.titlePlaceholder' | translate) }}\n\n <button\n cdsButton=\"danger\"\n [disabled]=\"count === 1\"\n [iconOnly]=\"true\"\n (click)=\"onDeleteRowClick($event, formRows, index)\"\n class=\"valtimo-widget-management-field-column__delete-button\"\n >\n <svg cdsIcon=\"trash-can\" size=\"16\"></svg>\n </button>\n </div>\n</ng-template>\n", styles: [".valtimo-widget-management-field-column{display:flex;flex-direction:column;gap:16px}.valtimo-widget-management-field-column__item,.valtimo-widget-management-field-column__cotainer{background:var(--cds-layer-01)}.valtimo-widget-management-field-column__item .cds--accordion__content{padding-inline-end:20px}.valtimo-widget-management-field-column__container{display:flex;flex-direction:column;gap:16px}.valtimo-widget-management-field-column__content{display:grid;grid-template-columns:1fr 180px 1fr;align-items:flex-end;gap:16px}.valtimo-widget-management-field-column__content--collection{grid-template-columns:1fr 180px 180px 1fr}.valtimo-widget-management-field-column__title{display:flex;justify-content:space-between;align-items:center;width:100%;padding:8px}.valtimo-widget-management-field-column__delete-button{display:flex;align-items:center;justify-content:center;padding:0;align-self:center}.valtimo-widget-management-field-column__delete-button.enum{align-self:flex-end}.valtimo-widget-management-field-column__path-selector{display:flex;flex-direction:column}.valtimo-widget-management-field-column__options{display:grid;grid-template-columns:repeat(3,1fr);gap:16px}.valtimo-widget-management-field-column__enum{display:flex;flex-direction:column;gap:16px}.valtimo-widget-management-field-column__enum-form{display:grid;grid-template-columns:1fr 1fr auto;align-items:flex-end;gap:16px}\n/*!\n * Copyright 2015-2025 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i4.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i2$1.TranslatePipe, name: "translate" }, { kind: "ngmodule", type: ButtonModule }, { kind: "directive", type: i3.Button, selector: "[cdsButton], [ibmButton]", inputs: ["ibmButton", "cdsButton", "size", "skeleton", "iconOnly", "isExpressive"] }, { kind: "ngmodule", type: DropdownModule }, { kind: "component", type: i3.Dropdown, selector: "cds-dropdown, ibm-dropdown", inputs: ["id", "label", "hideLabel", "helperText", "placeholder", "displayValue", "clearText", "size", "type", "theme", "disabled", "readonly", "skeleton", "inline", "disableArrowKeys", "invalid", "invalidText", "warn", "warnText", "appendInline", "scrollableContainer", "itemValueKey", "selectionFeedback", "menuButtonLabel", "selectedLabel", "dropUp", "fluid"], outputs: ["selected", "onClose", "close"] }, { kind: "component", type: i3.DropdownList, selector: "cds-dropdown-list, ibm-dropdown-list", inputs: ["ariaLabel", "items", "listTpl", "type", "showTitles"], outputs: ["select", "scroll", "blurIntent"] }, { kind: "ngmodule", type: InputModule }, { kind: "component", type: i3.TextInputLabelComponent, selector: "cds-text-label, ibm-text-label", inputs: ["labelInputID", "disabled", "skeleton", "labelTemplate", "textInputTemplate", "helperText", "invalidText", "invalid", "warn", "warnText", "ariaLabel", "fluid"] }, { kind: "directive", type: i3.TextInput, selector: "[cdsText], [ibmText]", inputs: ["theme", "size", "invalid", "warn", "skeleton"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i2.FormArrayName, selector: "[formArrayName]", inputs: ["formArrayName"] }, { kind: "ngmodule", type: IconModule }, { kind: "directive", type: i3.IconDirective, selector: "[cdsIcon], [ibmIcon]", inputs: ["ibmIcon", "cdsIcon", "size", "title", "ariaLabel", "ariaLabelledBy", "ariaHidden", "isFocusable"] }, { kind: "ngmodule", type: AccordionModule }, { kind: "component", type: i3.Accordion, selector: "cds-accordion, ibm-accordion", inputs: ["align", "size", "skeleton"] }, { kind: "component", type: i3.AccordionItem, selector: "cds-accordion-item, ibm-accordion-item", inputs: ["title", "context", "id", "skeleton", "expanded", "disabled"], outputs: ["selected"] }, { kind: "ngmodule", type: InputLabelModule }, { kind: "component", type: i1.InputLabelComponent, selector: "v-input-label", inputs: ["name", "tooltip", "tooltipTranslationKey", "largeMargin", "small", "noMargin", "title", "titleTranslationKey", "required", "disabled", "carbonTheme"] }, { kind: "ngmodule", type: CheckboxModule }, { kind: "component", type: i3.Checkbox, selector: "cds-checkbox, ibm-checkbox", inputs: ["disabled", "skeleton", "hideLabel", "name", "id", "required", "value", "ariaLabel", "ariaLabelledby", "indeterminate", "checked"], outputs: ["click", "checkedChange", "indeterminateChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
134
334
|
}
|
|
135
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
335
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: WidgetManagementFieldsColumnComponent, decorators: [{
|
|
136
336
|
type: Component,
|
|
137
|
-
args: [{ selector: 'valtimo-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
337
|
+
args: [{ selector: 'valtimo-widget-management-fields-column', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, standalone: true, imports: [
|
|
338
|
+
CommonModule,
|
|
339
|
+
TranslateModule,
|
|
340
|
+
ButtonModule,
|
|
341
|
+
DropdownModule,
|
|
342
|
+
InputModule,
|
|
343
|
+
ReactiveFormsModule,
|
|
344
|
+
IconModule,
|
|
345
|
+
AccordionModule,
|
|
346
|
+
InputLabelModule,
|
|
347
|
+
ValuePathSelectorComponent,
|
|
348
|
+
CheckboxModule,
|
|
349
|
+
], 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<form\n *ngIf=\"inputTheme$ | async as inputTheme\"\n class=\"valtimo-widget-management-field-column\"\n [formGroup]=\"formGroup\"\n>\n <cds-accordion formArrayName=\"rows\" align=\"start\" size=\"sm\">\n @for (formRow of formRows.controls; track $index) {\n <cds-accordion-item\n [title]=\"fieldTitle\"\n [context]=\"{count: $count, index: $index, title: formRow.get('title')?.value}\"\n [expanded]=\"$index === 0\"\n class=\"valtimo-widget-management-field-column__item\"\n >\n <form [formGroup]=\"formRow\" class=\"valtimo-widget-management-field-column__container\">\n <div\n class=\"valtimo-widget-management-field-column__content\"\n [class.valtimo-widget-management-field-column__content--collection]=\"\n !!fieldWidthDropdown\n \"\n >\n <cds-text-label>\n <v-input-label\n [title]=\"'widgetTabManagement.content.fields.title' | translate\"\n [tooltip]=\"\n 'widgetTabManagement.content.' + $widgetType() + '.titleTooltip' | translate\n \"\n >\n </v-input-label>\n\n <input\n cdsText\n [attr.data-carbon-theme]=\"inputTheme\"\n [placeholder]=\"'widgetTabManagement.content.fields.titlePlaceholder' | translate\"\n type=\"text\"\n formControlName=\"title\"\n />\n </cds-text-label>\n\n <cds-dropdown\n [attr.data-carbon-theme]=\"inputTheme\"\n [label]=\"'widgetTabManagement.content.fields.type' | translate\"\n [dropUp]=\"false\"\n [placeholder]=\"'widgetTabManagement.content.fields.typePlaceholder' | translate\"\n (selected)=\"onTypeSelected(formRow, $event)\"\n formControlName=\"type\"\n >\n <cds-dropdown-list [items]=\"getDisplayItemsSelected(formRow)\"></cds-dropdown-list>\n </cds-dropdown>\n\n <ng-container\n *ngTemplateOutlet=\"fieldWidthDropdown; context: {index: $index}\"\n ></ng-container>\n\n <div class=\"valtimo-widget-management-field-column__path-selector\">\n <v-input-label\n [title]=\"'widgetTabManagement.content.fields.value' | translate\"\n [tooltip]=\"\n 'widgetTabManagement.content.' + $widgetType() + '.valueTooltip' | translate\n \"\n >\n </v-input-label>\n\n <input\n cdsText\n [attr.data-carbon-theme]=\"inputTheme\"\n [placeholder]=\"'widgetTabManagement.content.fields.value' | translate\"\n type=\"text\"\n formControlName=\"content\"\n />\n <!-- TODO: Implement when selector is up and parameterise -->\n <!-- <valtimo-value-path-selector\n formControlName=\"content\"\n [caseDefinitionKey]=\"params?.caseDefinitionKey\"\n [caseDefinitionVersionTag]=\"params?.caseDefinitionVersionTag\"\n [parentItem]=\"selectedCollection\"\n ></valtimo-value-path-selector> -->\n </div>\n </div>\n\n <div class=\"valtimo-widget-management-field-column__options\">\n @switch (formRow.get('type').value.id) {\n @case (WidgetDisplayTypeKey.CURRENCY) {\n <cds-text-label>\n <v-input-label\n [title]=\"'widgetTabManagement.content.fields.currencyCode' | translate\"\n [tooltip]=\"'widgetTabManagement.content.fields.currencyCodeTooltip' | translate\"\n >\n </v-input-label>\n\n <input\n cdsText\n [attr.data-carbon-theme]=\"inputTheme\"\n [placeholder]=\"\n 'widgetTabManagement.content.fields.currencyCodePlaceholder' | translate\n \"\n type=\"text\"\n formControlName=\"currencyCode\"\n />\n </cds-text-label>\n\n <cds-text-label>\n <v-input-label\n [title]=\"'widgetTabManagement.content.fields.display' | translate\"\n [tooltip]=\"'widgetTabManagement.content.fields.displayTooltip' | translate\"\n >\n </v-input-label>\n\n <input\n cdsText\n [attr.data-carbon-theme]=\"inputTheme\"\n [placeholder]=\"\n 'widgetTabManagement.content.fields.displayPlaceholder' | translate\n \"\n type=\"text\"\n formControlName=\"display\"\n />\n </cds-text-label>\n\n <cds-text-label>\n <v-input-label\n [title]=\"'widgetTabManagement.content.fields.digitsInfo' | translate\"\n tooltip=\"{{\n 'widgetTabManagement.content.fields.digitsInfoTooltip'\n | translate: {minFractionDigits: 2, maxFractionDigits: 2}\n }}\"\n >\n </v-input-label>\n\n <input\n cdsText\n [attr.data-carbon-theme]=\"inputTheme\"\n [placeholder]=\"\n 'widgetTabManagement.content.fields.digitsInfoPlaceholder' | translate\n \"\n type=\"text\"\n formControlName=\"digitsInfo\"\n />\n </cds-text-label>\n }\n @case (WidgetDisplayTypeKey.DATE) {\n <cds-text-label>\n <v-input-label\n [title]=\"'widgetTabManagement.content.fields.format' | translate\"\n [tooltip]=\"'widgetTabManagement.content.fields.dateFormatTooltip' | translate\"\n ></v-input-label>\n\n <input\n cdsText\n [attr.data-carbon-theme]=\"inputTheme\"\n [placeholder]=\"\n 'widgetTabManagement.content.fields.formatPlaceholder' | translate\n \"\n type=\"text\"\n formControlName=\"format\"\n />\n </cds-text-label>\n }\n @case (WidgetDisplayTypeKey.DATE_TIME) {\n <cds-text-label>\n <v-input-label\n [title]=\"'widgetTabManagement.content.fields.format' | translate\"\n [tooltip]=\"\n 'widgetTabManagement.content.fields.dateTimeFormatTooltip' | translate\n \"\n ></v-input-label>\n\n <input\n cdsText\n [attr.data-carbon-theme]=\"inputTheme\"\n [placeholder]=\"\n 'widgetTabManagement.content.fields.formatPlaceholder' | translate\n \"\n type=\"text\"\n formControlName=\"format\"\n />\n </cds-text-label>\n }\n @case (WidgetDisplayTypeKey.ENUM) {\n <div class=\"valtimo-widget-management-field-column__enum\" formArrayName=\"values\">\n @for (rowValue of formRow.get('values')?.controls; track $index) {\n <form\n [formGroup]=\"rowValue\"\n class=\"valtimo-widget-management-field-column__enum-form\"\n >\n <cds-text-label>\n <v-input-label\n *ngIf=\"$index === 0\"\n [title]=\"'widgetTabManagement.content.fields.enumValue' | translate\"\n [tooltip]=\"\n 'widgetTabManagement.content.fields.enumValueTooltip' | translate\n \"\n ></v-input-label>\n\n <input\n [attr.data-carbon-theme]=\"inputTheme\"\n cdsText\n [placeholder]=\"'widgetTabManagement.content.fields.enumValue' | translate\"\n type=\"text\"\n formControlName=\"key\"\n />\n </cds-text-label>\n\n <cds-text-label>\n <v-input-label\n *ngIf=\"$index === 0\"\n [title]=\"'widgetTabManagement.content.fields.enumDisplay' | translate\"\n [tooltip]=\"\n 'widgetTabManagement.content.fields.enumDisplayTooltip' | translate\n \"\n ></v-input-label>\n\n <input\n cdsText\n [attr.data-carbon-theme]=\"inputTheme\"\n [placeholder]=\"\n 'widgetTabManagement.content.fields.enumDisplay' | translate\n \"\n type=\"text\"\n formControlName=\"value\"\n />\n </cds-text-label>\n\n <button\n cdsButton=\"danger--ghost\"\n [disabled]=\"$count === 1\"\n [iconOnly]=\"true\"\n class=\"valtimo-widget-management-field-column__delete-button enum\"\n (click)=\"onDeleteRowClick($event, formRow.get('values'), $index)\"\n >\n <svg cdsIcon=\"trash-can\" size=\"16\"></svg>\n </button>\n </form>\n }\n\n <button\n cdsButton=\"primary\"\n size=\"sm\"\n (click)=\"onAddEnumValueClick(formRow.get('values'))\"\n >\n {{ 'widgetTabManagement.content.fields.addEnum' | translate }}\n\n <svg class=\"cds--btn__icon\" cdsIcon=\"add\" size=\"16\"></svg>\n </button>\n </div>\n }\n @case (WidgetDisplayTypeKey.NUMBER) {\n <cds-text-label>\n <v-input-label\n [title]=\"'widgetTabManagement.content.fields.digitsInfo' | translate\"\n tooltip=\"{{\n 'widgetTabManagement.content.fields.digitsInfoTooltip'\n | translate\n : {\n minFractionDigits: 0,\n maxFractionDigits: 3,\n }\n }}\"\n >\n </v-input-label>\n\n <input\n cdsText\n [attr.data-carbon-theme]=\"inputTheme\"\n [placeholder]=\"'widgetTabManagement.content.fields.digitsInfo' | translate\"\n type=\"text\"\n formControlName=\"digitsInfo\"\n />\n </cds-text-label>\n }\n @case (WidgetDisplayTypeKey.PERCENT) {\n <cds-text-label>\n <v-input-label\n [title]=\"'widgetTabManagement.content.fields.digitsInfo' | translate\"\n tooltip=\"{{\n 'widgetTabManagement.content.fields.digitsInfoTooltip'\n | translate\n : {\n minFractionDigits: 0,\n maxFractionDigits: 0,\n }\n }}\"\n >\n </v-input-label>\n\n <input\n cdsText\n [attr.data-carbon-theme]=\"inputTheme\"\n [placeholder]=\"'widgetTabManagement.content.fields.digitsInfo' | translate\"\n type=\"text\"\n formControlName=\"digitsInfo\"\n />\n </cds-text-label>\n }\n @case (WidgetDisplayTypeKey.LINK) {\n <cds-text-label>\n <v-input-label\n [title]=\"'widgetTabManagement.content.fields.linkText' | translate\"\n [tooltip]=\"'widgetTabManagement.content.fields.linkTextTooltip' | translate\"\n >\n </v-input-label>\n\n <input\n cdsText\n [attr.data-carbon-theme]=\"inputTheme\"\n [placeholder]=\"\n 'widgetTabManagement.content.fields.linkTextPlaceholder' | translate\n \"\n type=\"text\"\n formControlName=\"linkText\"\n />\n </cds-text-label>\n }\n }\n\n <cds-text-label\n *ngIf=\"formRow.get('type').value.id === WidgetDisplayTypeKey.TEXT && $isFieldWidget()\"\n >\n <v-input-label\n [title]=\"'widgetTabManagement.content.fields.ellipsisCharacterLimit' | translate\"\n tooltip=\"{{\n 'widgetTabManagement.content.fields.ellipsisCharacterLimitTooltip' | translate\n }}\"\n >\n </v-input-label>\n\n <input\n cdsText\n [attr.data-carbon-theme]=\"inputTheme\"\n [placeholder]=\"\n 'widgetTabManagement.content.fields.ellipsisCharacterLimitPlaceholder' | translate\n \"\n type=\"text\"\n formControlName=\"ellipsisCharacterLimit\"\n />\n </cds-text-label>\n\n <cds-checkbox *ngIf=\"showHideWhenEmptyCheckbox\" formControlName=\"hideWhenEmpty\">\n {{ 'widgetTabManagement.content.hideWhenEmpty' | translate }}\n </cds-checkbox>\n </div>\n </form>\n </cds-accordion-item>\n }\n </cds-accordion>\n\n <button cdsButton=\"primary\" size=\"sm\" (click)=\"addField()\">\n {{ addTranslateKey | translate }}\n\n <svg class=\"cds--btn__icon\" cdsIcon=\"add\" size=\"16\"></svg>\n </button>\n</form>\n\n<ng-template #fieldTitle let-count=\"count\" let-index=\"index\" let-title=\"title\">\n <div class=\"valtimo-widget-management-field-column__title\">\n {{ title || ('widgetTabManagement.content.fields.titlePlaceholder' | translate) }}\n\n <button\n cdsButton=\"danger\"\n [disabled]=\"count === 1\"\n [iconOnly]=\"true\"\n (click)=\"onDeleteRowClick($event, formRows, index)\"\n class=\"valtimo-widget-management-field-column__delete-button\"\n >\n <svg cdsIcon=\"trash-can\" size=\"16\"></svg>\n </button>\n </div>\n</ng-template>\n", styles: [".valtimo-widget-management-field-column{display:flex;flex-direction:column;gap:16px}.valtimo-widget-management-field-column__item,.valtimo-widget-management-field-column__cotainer{background:var(--cds-layer-01)}.valtimo-widget-management-field-column__item .cds--accordion__content{padding-inline-end:20px}.valtimo-widget-management-field-column__container{display:flex;flex-direction:column;gap:16px}.valtimo-widget-management-field-column__content{display:grid;grid-template-columns:1fr 180px 1fr;align-items:flex-end;gap:16px}.valtimo-widget-management-field-column__content--collection{grid-template-columns:1fr 180px 180px 1fr}.valtimo-widget-management-field-column__title{display:flex;justify-content:space-between;align-items:center;width:100%;padding:8px}.valtimo-widget-management-field-column__delete-button{display:flex;align-items:center;justify-content:center;padding:0;align-self:center}.valtimo-widget-management-field-column__delete-button.enum{align-self:flex-end}.valtimo-widget-management-field-column__path-selector{display:flex;flex-direction:column}.valtimo-widget-management-field-column__options{display:grid;grid-template-columns:repeat(3,1fr);gap:16px}.valtimo-widget-management-field-column__enum{display:flex;flex-direction:column;gap:16px}.valtimo-widget-management-field-column__enum-form{display:grid;grid-template-columns:1fr 1fr auto;align-items:flex-end;gap:16px}\n/*!\n * Copyright 2015-2025 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n"] }]
|
|
350
|
+
}], ctorParameters: () => [{ type: i1.CdsThemeService }, { type: i0.ChangeDetectorRef }, { type: i2.FormBuilder }, { type: i3.IconService }, { type: i2$1.TranslateService }, { type: WidgetFieldsService }, { type: WidgetWizardService }], propDecorators: { class: [{
|
|
351
|
+
type: HostBinding,
|
|
352
|
+
args: ['class']
|
|
353
|
+
}], columnData: [{
|
|
354
|
+
type: Input,
|
|
355
|
+
args: [{ required: true }]
|
|
356
|
+
}], addTranslateKey: [{
|
|
357
|
+
type: Input
|
|
358
|
+
}], fieldWidthDropdown: [{
|
|
359
|
+
type: Input
|
|
360
|
+
}], selectedCollection: [{
|
|
361
|
+
type: Input
|
|
362
|
+
}], showHideWhenEmptyCheckbox: [{
|
|
363
|
+
type: Input
|
|
364
|
+
}], columnUpdateEvent: [{
|
|
365
|
+
type: Output
|
|
141
366
|
}] } });
|
|
142
367
|
|
|
143
368
|
/*
|
|
@@ -155,44 +380,119 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
155
380
|
* See the License for the specific language governing permissions and
|
|
156
381
|
* limitations under the License.
|
|
157
382
|
*/
|
|
158
|
-
class
|
|
159
|
-
constructor(
|
|
160
|
-
this.
|
|
383
|
+
class WidgetManagementFieldsComponent {
|
|
384
|
+
constructor(cdsThemeService, fb, route, widgetWizardService) {
|
|
385
|
+
this.cdsThemeService = cdsThemeService;
|
|
386
|
+
this.fb = fb;
|
|
161
387
|
this.route = route;
|
|
162
|
-
this.
|
|
163
|
-
this.
|
|
164
|
-
this.
|
|
165
|
-
this.
|
|
388
|
+
this.widgetWizardService = widgetWizardService;
|
|
389
|
+
this.class = 'valtimo-widget-management-fields';
|
|
390
|
+
this.changeValidEvent = new EventEmitter();
|
|
391
|
+
this.form = this.fb.group({
|
|
392
|
+
widgetTitle: this.fb.control(this.widgetWizardService.$widgetTitle(), Validators.required),
|
|
393
|
+
});
|
|
394
|
+
this.$columns = signal([null]);
|
|
395
|
+
this.$widgetWidth = this.widgetWizardService.$widgetWidth();
|
|
396
|
+
this.selectedTabIndex = -1;
|
|
397
|
+
this.theme$ = this.cdsThemeService.currentTheme$.pipe(map((theme) => theme === CurrentCarbonTheme.G10 ? CARBON_THEME.WHITE : CARBON_THEME.G90));
|
|
398
|
+
this.$selectedWidgetContent = computed(() => this.widgetWizardService.$widgetContent()?.columns.reduce((acc, curr, index) => ({
|
|
399
|
+
...acc,
|
|
400
|
+
[index]: curr,
|
|
401
|
+
}), {}));
|
|
402
|
+
this.activeTab = signal(0);
|
|
403
|
+
this._subscriptions = new Subscription();
|
|
404
|
+
this._contentValid = signal(false);
|
|
166
405
|
}
|
|
167
406
|
ngOnInit() {
|
|
168
|
-
this.
|
|
407
|
+
this._subscriptions.add(this.form.valueChanges.pipe(debounceTime(100)).subscribe(formValue => {
|
|
408
|
+
this.widgetWizardService.$widgetTitle.set(formValue.widgetTitle ?? '');
|
|
409
|
+
this.changeValidEvent.emit(this.form.valid && this._contentValid());
|
|
410
|
+
}));
|
|
411
|
+
const widgetContent = this.widgetWizardService.$widgetContent()
|
|
412
|
+
?.columns;
|
|
413
|
+
if (!widgetContent)
|
|
414
|
+
return;
|
|
415
|
+
this.$columns.set(Object.keys(widgetContent).map(() => null));
|
|
169
416
|
}
|
|
170
417
|
ngAfterViewInit() {
|
|
171
|
-
this.
|
|
418
|
+
this._tab.tabIndex = -1;
|
|
172
419
|
}
|
|
173
420
|
ngOnDestroy() {
|
|
174
|
-
this.
|
|
421
|
+
this._subscriptions.unsubscribe();
|
|
422
|
+
this.changeValidEvent.emit(false);
|
|
423
|
+
this.form.reset();
|
|
424
|
+
this._contentValid.set(false);
|
|
175
425
|
}
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
426
|
+
onAddColumnClick() {
|
|
427
|
+
this.$columns.update(value => [...value, null]);
|
|
428
|
+
this.activeTab.set(this.$columns().length - 1);
|
|
429
|
+
this.changeValidEvent.emit(false);
|
|
180
430
|
}
|
|
181
|
-
|
|
182
|
-
this.
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
431
|
+
onTabSelected(index) {
|
|
432
|
+
this.activeTab.set(index);
|
|
433
|
+
}
|
|
434
|
+
onDeleteColumnClick(index) {
|
|
435
|
+
this.widgetWizardService.$widgetContent.update(content => {
|
|
436
|
+
if (!content)
|
|
437
|
+
return null;
|
|
438
|
+
const widgetContent = content;
|
|
439
|
+
let tempIndex = index;
|
|
440
|
+
let tempContent = { ...widgetContent };
|
|
441
|
+
while (tempIndex < this.$columns().length - 1) {
|
|
442
|
+
tempContent.columns[tempIndex] = tempContent.columns[tempIndex + 1];
|
|
443
|
+
tempIndex++;
|
|
444
|
+
}
|
|
445
|
+
tempContent.columns.splice(tempIndex, 1);
|
|
446
|
+
return tempContent;
|
|
447
|
+
});
|
|
448
|
+
this.$columns.update((columns) => {
|
|
449
|
+
const temp = columns;
|
|
450
|
+
temp.splice(index, 1);
|
|
451
|
+
return temp;
|
|
452
|
+
});
|
|
453
|
+
if (this.activeTab() !== index)
|
|
454
|
+
return;
|
|
455
|
+
this.activeTab.set(-1);
|
|
456
|
+
}
|
|
457
|
+
onColumnUpdateEvent(event, columnIndex) {
|
|
458
|
+
this.widgetWizardService.$widgetContent.update(content => {
|
|
459
|
+
if (!content)
|
|
460
|
+
return { columns: [event.data] };
|
|
461
|
+
const columns = content?.columns.map((column, index) => index === columnIndex ? event.data : column);
|
|
462
|
+
return {
|
|
463
|
+
columns: columnIndex > columns.length - 1 ? [...columns, event.data] : columns,
|
|
464
|
+
};
|
|
465
|
+
});
|
|
466
|
+
this._contentValid.set(event.valid);
|
|
467
|
+
this.changeValidEvent.emit(event.valid && this.form.valid);
|
|
186
468
|
}
|
|
187
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
188
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
469
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: WidgetManagementFieldsComponent, deps: [{ token: i1.CdsThemeService }, { token: i2.FormBuilder }, { token: i2$2.ActivatedRoute }, { token: WidgetWizardService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
470
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.15", type: WidgetManagementFieldsComponent, isStandalone: true, selector: "ng-component", outputs: { changeValidEvent: "changeValidEvent" }, host: { properties: { "class": "this.class" } }, viewQueries: [{ propertyName: "_tab", first: true, predicate: Tab, 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<p>{{ 'widgetTabManagement.content.description' | translate }}</p>\n\n<form [formGroup]=\"form\">\n <cds-text-label\n [attr.data-carbon-theme]=\"theme$ | async\"\n class=\"valtimo-widget-management-fields__input\"\n >\n <v-input-label\n [title]=\"'widgetTabManagement.content.widgetTitle' | translate\"\n [tooltip]=\"'widgetTabManagement.content.widgetTitleTooltip' | translate\"\n >\n </v-input-label>\n\n <input\n formControlName=\"widgetTitle\"\n cdsText\n [placeholder]=\"'widgetTabManagement.content.widgetTitlePlaceholder' | translate\"\n type=\"text\"\n />\n </cds-text-label>\n</form>\n\n<!-- For projecting elements such as process selector in case widgets -->\n<ng-content></ng-content>\n\n<cds-tabs type=\"contained\">\n @for (column of $columns(); track $index) {\n <cds-tab\n [active]=\"activeTab() === $index\"\n [heading]=\"columnHeading\"\n [context]=\"{index: $index, count: $count}\"\n (selected)=\"onTabSelected($index)\"\n >\n <valtimo-widget-management-fields-column\n *ngIf=\"activeTab() === $index\"\n [isFieldWidget]=\"true\"\n [columnData]=\"$selectedWidgetContent()?.[$index]\"\n [showHideWhenEmptyCheckbox]=\"true\"\n (columnUpdateEvent)=\"onColumnUpdateEvent($event, $index)\"\n ></valtimo-widget-management-fields-column>\n </cds-tab>\n }\n\n <cds-tab\n *ngIf=\"$columns().length < $widgetWidth\"\n [heading]=\"addColumn\"\n [id]=\"'addColumn'\"\n class=\"valtimo-widget-management-fields__add\"\n ></cds-tab>\n</cds-tabs>\n\n<ng-template #addColumn>\n <button\n cdsButton=\"ghost\"\n [iconOnly]=\"true\"\n (click)=\"$event.stopImmediatePropagation(); onAddColumnClick()\"\n >\n <svg cdsIcon=\"add\" size=\"16\"></svg>\n </button>\n</ng-template>\n\n<ng-template #columnHeading let-data>\n <div class=\"valtimo-widget-management-fields__heading\">\n {{ 'widgetTabManagement.content.column' | translate: {number: data.index + 1} }}\n\n <button\n cdsButton=\"ghost\"\n [disabled]=\"data.count === 1\"\n [iconOnly]=\"true\"\n size=\"sm\"\n (click)=\"onDeleteColumnClick(data.index)\"\n >\n <svg cdsIcon=\"close\" size=\"16\"></svg>\n </button>\n </div>\n</ng-template>\n", styles: [".cds--tab-content{padding:0!important}.valtimo-widget-management-fields{display:flex;flex-direction:column;gap:16px}.valtimo-widget-management-fields__input{max-width:288px}.valtimo-widget-management-fields__heading{display:flex;align-items:center}.valtimo-widget-management-fields #addColumn-header{padding:0!important}.valtimo-widget-management-fields .cds--tabs__nav-item{padding-right:0!important}\n/*!\n * Copyright 2015-2025 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i2$1.TranslatePipe, name: "translate" }, { kind: "ngmodule", type: InputModule }, { kind: "component", type: i3.TextInputLabelComponent, selector: "cds-text-label, ibm-text-label", inputs: ["labelInputID", "disabled", "skeleton", "labelTemplate", "textInputTemplate", "helperText", "invalidText", "invalid", "warn", "warnText", "ariaLabel", "fluid"] }, { kind: "directive", type: i3.TextInput, selector: "[cdsText], [ibmText]", inputs: ["theme", "size", "invalid", "warn", "skeleton"] }, { kind: "ngmodule", type: TabsModule }, { kind: "component", type: i3.Tabs, selector: "cds-tabs, ibm-tabs", inputs: ["position", "cacheActive", "followFocus", "isNavigation", "ariaLabel", "ariaLabelledby", "type", "theme", "skeleton"] }, { kind: "component", type: i3.Tab, selector: "cds-tab, ibm-tab", inputs: ["heading", "title", "context", "active", "disabled", "tabIndex", "id", "cacheActive", "tabContent", "templateContext"], outputs: ["selected"] }, { kind: "ngmodule", type: IconModule }, { kind: "directive", type: i3.IconDirective, selector: "[cdsIcon], [ibmIcon]", inputs: ["ibmIcon", "cdsIcon", "size", "title", "ariaLabel", "ariaLabelledBy", "ariaHidden", "isFocusable"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: ButtonModule }, { kind: "directive", type: i3.Button, selector: "[cdsButton], [ibmButton]", inputs: ["ibmButton", "cdsButton", "size", "skeleton", "iconOnly", "isExpressive"] }, { kind: "component", type: WidgetManagementFieldsColumnComponent, selector: "valtimo-widget-management-fields-column", inputs: ["columnData", "addTranslateKey", "fieldWidthDropdown", "selectedCollection", "showHideWhenEmptyCheckbox"], outputs: ["columnUpdateEvent"] }, { kind: "ngmodule", type:
|
|
471
|
+
// CaseManagementWidgetProcessSelectorComponent,
|
|
472
|
+
InputLabelModule }, { kind: "component", type: i1.InputLabelComponent, selector: "v-input-label", inputs: ["name", "tooltip", "tooltipTranslationKey", "largeMargin", "small", "noMargin", "title", "titleTranslationKey", "required", "disabled", "carbonTheme"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
189
473
|
}
|
|
190
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
474
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: WidgetManagementFieldsComponent, decorators: [{
|
|
191
475
|
type: Component,
|
|
192
|
-
args: [{
|
|
193
|
-
|
|
476
|
+
args: [{ changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, standalone: true, imports: [
|
|
477
|
+
CommonModule,
|
|
478
|
+
TranslateModule,
|
|
479
|
+
InputModule,
|
|
480
|
+
TabsModule,
|
|
481
|
+
IconModule,
|
|
482
|
+
ReactiveFormsModule,
|
|
483
|
+
ButtonModule,
|
|
484
|
+
WidgetManagementFieldsColumnComponent,
|
|
485
|
+
// CaseManagementWidgetProcessSelectorComponent,
|
|
486
|
+
InputLabelModule,
|
|
487
|
+
], 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<p>{{ 'widgetTabManagement.content.description' | translate }}</p>\n\n<form [formGroup]=\"form\">\n <cds-text-label\n [attr.data-carbon-theme]=\"theme$ | async\"\n class=\"valtimo-widget-management-fields__input\"\n >\n <v-input-label\n [title]=\"'widgetTabManagement.content.widgetTitle' | translate\"\n [tooltip]=\"'widgetTabManagement.content.widgetTitleTooltip' | translate\"\n >\n </v-input-label>\n\n <input\n formControlName=\"widgetTitle\"\n cdsText\n [placeholder]=\"'widgetTabManagement.content.widgetTitlePlaceholder' | translate\"\n type=\"text\"\n />\n </cds-text-label>\n</form>\n\n<!-- For projecting elements such as process selector in case widgets -->\n<ng-content></ng-content>\n\n<cds-tabs type=\"contained\">\n @for (column of $columns(); track $index) {\n <cds-tab\n [active]=\"activeTab() === $index\"\n [heading]=\"columnHeading\"\n [context]=\"{index: $index, count: $count}\"\n (selected)=\"onTabSelected($index)\"\n >\n <valtimo-widget-management-fields-column\n *ngIf=\"activeTab() === $index\"\n [isFieldWidget]=\"true\"\n [columnData]=\"$selectedWidgetContent()?.[$index]\"\n [showHideWhenEmptyCheckbox]=\"true\"\n (columnUpdateEvent)=\"onColumnUpdateEvent($event, $index)\"\n ></valtimo-widget-management-fields-column>\n </cds-tab>\n }\n\n <cds-tab\n *ngIf=\"$columns().length < $widgetWidth\"\n [heading]=\"addColumn\"\n [id]=\"'addColumn'\"\n class=\"valtimo-widget-management-fields__add\"\n ></cds-tab>\n</cds-tabs>\n\n<ng-template #addColumn>\n <button\n cdsButton=\"ghost\"\n [iconOnly]=\"true\"\n (click)=\"$event.stopImmediatePropagation(); onAddColumnClick()\"\n >\n <svg cdsIcon=\"add\" size=\"16\"></svg>\n </button>\n</ng-template>\n\n<ng-template #columnHeading let-data>\n <div class=\"valtimo-widget-management-fields__heading\">\n {{ 'widgetTabManagement.content.column' | translate: {number: data.index + 1} }}\n\n <button\n cdsButton=\"ghost\"\n [disabled]=\"data.count === 1\"\n [iconOnly]=\"true\"\n size=\"sm\"\n (click)=\"onDeleteColumnClick(data.index)\"\n >\n <svg cdsIcon=\"close\" size=\"16\"></svg>\n </button>\n </div>\n</ng-template>\n", styles: [".cds--tab-content{padding:0!important}.valtimo-widget-management-fields{display:flex;flex-direction:column;gap:16px}.valtimo-widget-management-fields__input{max-width:288px}.valtimo-widget-management-fields__heading{display:flex;align-items:center}.valtimo-widget-management-fields #addColumn-header{padding:0!important}.valtimo-widget-management-fields .cds--tabs__nav-item{padding-right:0!important}\n/*!\n * Copyright 2015-2025 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n"] }]
|
|
488
|
+
}], ctorParameters: () => [{ type: i1.CdsThemeService }, { type: i2.FormBuilder }, { type: i2$2.ActivatedRoute }, { type: WidgetWizardService }], propDecorators: { class: [{
|
|
489
|
+
type: HostBinding,
|
|
490
|
+
args: ['class']
|
|
491
|
+
}], changeValidEvent: [{
|
|
492
|
+
type: Output
|
|
493
|
+
}], _tab: [{
|
|
194
494
|
type: ViewChild,
|
|
195
|
-
args: [
|
|
495
|
+
args: [Tab]
|
|
196
496
|
}] } });
|
|
197
497
|
|
|
198
498
|
/*
|
|
@@ -210,48 +510,79 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
210
510
|
* See the License for the specific language governing permissions and
|
|
211
511
|
* limitations under the License.
|
|
212
512
|
*/
|
|
213
|
-
class
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
513
|
+
class WidgetManagementTableComponent {
|
|
514
|
+
constructor(cdsThemeService, fb, widgetWizardService, route) {
|
|
515
|
+
this.cdsThemeService = cdsThemeService;
|
|
516
|
+
this.fb = fb;
|
|
517
|
+
this.widgetWizardService = widgetWizardService;
|
|
518
|
+
this.route = route;
|
|
519
|
+
this.class = 'valtimo-widget-management-table';
|
|
520
|
+
this.changeValidEvent = new EventEmitter();
|
|
521
|
+
this.form = this.fb.group({
|
|
522
|
+
title: this.fb.control(this.widgetWizardService.$widgetTitle() ?? '', Validators.required),
|
|
523
|
+
collection: this.fb.control(this.widgetWizardService.$widgetContent()?.collection ?? '', Validators.required),
|
|
524
|
+
defaultPageSize: this.fb.control(this.widgetWizardService.$widgetContent()?.defaultPageSize ?? 5, Validators.required),
|
|
525
|
+
});
|
|
526
|
+
this.theme$ = this.cdsThemeService.currentTheme$.pipe(map((currentTheme) => currentTheme === CurrentCarbonTheme.G10 ? CARBON_THEME.WHITE : CARBON_THEME.G90));
|
|
527
|
+
this.$content = this.widgetWizardService
|
|
528
|
+
.$widgetContent;
|
|
529
|
+
this.$checked = computed(() => this.widgetWizardService.$widgetContent()?.firstColumnAsTitle || false);
|
|
530
|
+
this.selectedCollection$ = new BehaviorSubject(null);
|
|
531
|
+
this.ValuePathSelectorPrefix = ValuePathSelectorPrefix;
|
|
532
|
+
this.ValuePathType = ValuePathType;
|
|
533
|
+
this._contentValid = signal(this.widgetWizardService.$editMode());
|
|
534
|
+
this._subscriptions = new Subscription();
|
|
535
|
+
}
|
|
536
|
+
ngOnInit() {
|
|
537
|
+
this._subscriptions.add(this.form.valueChanges.pipe(debounceTime(500)).subscribe(value => {
|
|
538
|
+
this.widgetWizardService.$widgetTitle.set(value?.title ?? '');
|
|
539
|
+
this.widgetWizardService.$widgetContent.update((content) => ({
|
|
540
|
+
...content,
|
|
541
|
+
collection: value?.collection || '',
|
|
542
|
+
defaultPageSize: value?.defaultPageSize || 5,
|
|
543
|
+
}));
|
|
544
|
+
this.changeValidEvent.emit(this.form.valid && this._contentValid());
|
|
545
|
+
}));
|
|
546
|
+
}
|
|
547
|
+
ngOnDestroy() {
|
|
548
|
+
this._contentValid.set(false);
|
|
549
|
+
this._subscriptions.unsubscribe();
|
|
550
|
+
this.changeValidEvent.emit(false);
|
|
551
|
+
this.form.reset();
|
|
552
|
+
}
|
|
553
|
+
onColumnUpdateEvent(event) {
|
|
554
|
+
const { data, valid } = event;
|
|
555
|
+
this.widgetWizardService.$widgetContent.update((content) => ({ ...content, columns: data }));
|
|
556
|
+
this._contentValid.set(valid);
|
|
557
|
+
this.changeValidEvent.emit(valid && this.form.valid);
|
|
558
|
+
}
|
|
559
|
+
onCheckedChange(firstColumnAsTitle) {
|
|
560
|
+
this.widgetWizardService.$widgetContent.update((content) => ({ ...content, firstColumnAsTitle }));
|
|
561
|
+
}
|
|
562
|
+
onCollectionSelected(item) {
|
|
563
|
+
this.selectedCollection$.next(item);
|
|
564
|
+
}
|
|
565
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: WidgetManagementTableComponent, deps: [{ token: i1.CdsThemeService }, { token: i2.FormBuilder }, { token: WidgetWizardService }, { token: i2$2.ActivatedRoute }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
566
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.15", type: WidgetManagementTableComponent, isStandalone: true, selector: "ng-component", outputs: { changeValidEvent: "changeValidEvent" }, host: { properties: { "class": "this.class" } }, ngImport: i0, template: "<!--\n ~ Copyright 2015-2025 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<form\n *ngIf=\"theme$ | async as theme\"\n [formGroup]=\"form\"\n class=\"valtimo-widget-management-table__form\"\n>\n <cds-text-label [attr.data-carbon-theme]=\"theme\">\n <v-input-label\n [title]=\"'widgetTabManagement.content.widgetTitle' | translate\"\n [tooltip]=\"'widgetTabManagement.content.widgetTitleTooltip' | translate\"\n >\n </v-input-label>\n\n <input\n formControlName=\"title\"\n cdsText\n [placeholder]=\"'widgetTabManagement.content.widgetTitlePlaceholder' | translate\"\n type=\"text\"\n />\n </cds-text-label>\n\n <cds-text-label [attr.data-carbon-theme]=\"theme\">\n <v-input-label\n [title]=\"'widgetTabManagement.content.table.defaultPageSize' | translate\"\n [tooltip]=\"'widgetTabManagement.content.table.defaultPageSizeTooltip' | translate\"\n >\n </v-input-label>\n\n <input\n formControlName=\"defaultPageSize\"\n cdsText\n [placeholder]=\"'widgetTabManagement.content.table.defaultPageSizePlaceholder' | translate\"\n type=\"text\"\n />\n </cds-text-label>\n\n <div class=\"valtimo-widget-management-table__path-selector\">\n <v-input-label\n [title]=\"'widgetTabManagement.content.table.collection' | translate\"\n [tooltip]=\"'widgetTabManagement.content.table.collectionTooltip' | translate\"\n >\n </v-input-label>\n\n <input\n formControlName=\"collection\"\n cdsText\n [attr.data-carbon-theme]=\"theme\"\n [placeholder]=\"'widgetTabManagement.content.table.collection' | translate\"\n type=\"text\"\n />\n\n <!-- TODO: Implement to work for case as well -->\n\n <!-- <valtimo-value-path-selector\n formControlName=\"collection\"\n [attr.data-carbon-theme]=\"obs.theme\"\n [caseDefinitionKey]=\"obs.params?.caseDefinitionKey\"\n [caseDefinitionVersionTag]=\"obs.params?.caseDefinitionVersionTag\"\n [type]=\"ValuePathType.COLLECTION\"\n (collectionSelected)=\"onCollectionSelected($event)\"\n ></valtimo-value-path-selector> -->\n </div>\n</form>\n\n<!-- For projecting elements such as process selector in case widgets -->\n<ng-content></ng-content>\n\n<span class=\"valtimo-widget-management-table__subtitle\">\n {{ 'widgetTabManagement.content.table.columns' | translate }}\n</span>\n\n<valtimo-widget-management-fields-column\n [addTranslateKey]=\"'widgetTabManagement.content.table.addColumn'\"\n [columnData]=\"$content()?.columns\"\n (columnUpdateEvent)=\"onColumnUpdateEvent($event)\"\n></valtimo-widget-management-fields-column>\n<!-- TODO: Implement to work for case as well -->\n<!-- [selectedCollection]=\"selectedCollection$ | async\" -->\n\n<section class=\"valtimo-widget-management-table__toggle\">\n <span class=\"valtimo-widget-management-table__subtitle\">\n {{ 'widgetTabManagement.content.table.options' | translate }}\n </span>\n\n <cds-toggle\n [checked]=\"$checked()\"\n [label]=\"'widgetTabManagement.content.table.firstColumnAsTitle' | translate\"\n [onText]=\"'interface.yes' | translate\"\n [offText]=\"'interface.no' | translate\"\n (checkedChange)=\"onCheckedChange($event)\"\n ></cds-toggle>\n</section>\n", styles: [".valtimo-widget-management-table{display:flex;flex-direction:column;gap:24px}.valtimo-widget-management-table__form{display:grid;gap:16px;grid-template-columns:repeat(3,1fr);align-items:flex-end}.valtimo-widget-management-table__subtitle{font-size:16px;font-weight:600;line-height:22px}.valtimo-widget-management-table__toggle{display:flex;flex-direction:column;gap:8px}.valtimo-widget-management-table__path-selector{display:flex;flex-direction:column}\n/*!\n * Copyright 2015-2025 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i2$1.TranslatePipe, name: "translate" }, { kind: "component", type: WidgetManagementFieldsColumnComponent, selector: "valtimo-widget-management-fields-column", inputs: ["columnData", "addTranslateKey", "fieldWidthDropdown", "selectedCollection", "showHideWhenEmptyCheckbox"], outputs: ["columnUpdateEvent"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: InputModule }, { kind: "component", type: i3.TextInputLabelComponent, selector: "cds-text-label, ibm-text-label", inputs: ["labelInputID", "disabled", "skeleton", "labelTemplate", "textInputTemplate", "helperText", "invalidText", "invalid", "warn", "warnText", "ariaLabel", "fluid"] }, { kind: "directive", type: i3.TextInput, selector: "[cdsText], [ibmText]", inputs: ["theme", "size", "invalid", "warn", "skeleton"] }, { kind: "ngmodule", type: ToggleModule }, { kind: "component", type: i3.Toggle, selector: "cds-toggle, ibm-toggle", inputs: ["offText", "onText", "label", "size", "hideLabel", "ariaLabel", "skeleton"] }, { kind: "ngmodule", type: ButtonModule }, { kind: "ngmodule", type: InputLabelModule }, { kind: "component", type: i1.InputLabelComponent, selector: "v-input-label", inputs: ["name", "tooltip", "tooltipTranslationKey", "largeMargin", "small", "noMargin", "title", "titleTranslationKey", "required", "disabled", "carbonTheme"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
235
567
|
}
|
|
236
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
237
|
-
type:
|
|
238
|
-
args: [{
|
|
239
|
-
declarations: [LayoutComponent, LayoutPublicComponent, LayoutInternalComponent],
|
|
240
|
-
imports: [
|
|
241
|
-
RouterModule,
|
|
242
|
-
MenuRoutingModule,
|
|
243
|
-
TopbarModule,
|
|
244
|
-
LeftSidebarModule,
|
|
245
|
-
RightSidebarModule,
|
|
246
|
-
PageHeaderModule,
|
|
247
|
-
AlertModule,
|
|
568
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: WidgetManagementTableComponent, decorators: [{
|
|
569
|
+
type: Component,
|
|
570
|
+
args: [{ changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, encapsulation: ViewEncapsulation.None, imports: [
|
|
248
571
|
CommonModule,
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
572
|
+
TranslateModule,
|
|
573
|
+
WidgetManagementFieldsColumnComponent,
|
|
574
|
+
ReactiveFormsModule,
|
|
575
|
+
InputModule,
|
|
576
|
+
ToggleModule,
|
|
577
|
+
ButtonModule,
|
|
578
|
+
InputLabelModule,
|
|
579
|
+
], template: "<!--\n ~ Copyright 2015-2025 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<form\n *ngIf=\"theme$ | async as theme\"\n [formGroup]=\"form\"\n class=\"valtimo-widget-management-table__form\"\n>\n <cds-text-label [attr.data-carbon-theme]=\"theme\">\n <v-input-label\n [title]=\"'widgetTabManagement.content.widgetTitle' | translate\"\n [tooltip]=\"'widgetTabManagement.content.widgetTitleTooltip' | translate\"\n >\n </v-input-label>\n\n <input\n formControlName=\"title\"\n cdsText\n [placeholder]=\"'widgetTabManagement.content.widgetTitlePlaceholder' | translate\"\n type=\"text\"\n />\n </cds-text-label>\n\n <cds-text-label [attr.data-carbon-theme]=\"theme\">\n <v-input-label\n [title]=\"'widgetTabManagement.content.table.defaultPageSize' | translate\"\n [tooltip]=\"'widgetTabManagement.content.table.defaultPageSizeTooltip' | translate\"\n >\n </v-input-label>\n\n <input\n formControlName=\"defaultPageSize\"\n cdsText\n [placeholder]=\"'widgetTabManagement.content.table.defaultPageSizePlaceholder' | translate\"\n type=\"text\"\n />\n </cds-text-label>\n\n <div class=\"valtimo-widget-management-table__path-selector\">\n <v-input-label\n [title]=\"'widgetTabManagement.content.table.collection' | translate\"\n [tooltip]=\"'widgetTabManagement.content.table.collectionTooltip' | translate\"\n >\n </v-input-label>\n\n <input\n formControlName=\"collection\"\n cdsText\n [attr.data-carbon-theme]=\"theme\"\n [placeholder]=\"'widgetTabManagement.content.table.collection' | translate\"\n type=\"text\"\n />\n\n <!-- TODO: Implement to work for case as well -->\n\n <!-- <valtimo-value-path-selector\n formControlName=\"collection\"\n [attr.data-carbon-theme]=\"obs.theme\"\n [caseDefinitionKey]=\"obs.params?.caseDefinitionKey\"\n [caseDefinitionVersionTag]=\"obs.params?.caseDefinitionVersionTag\"\n [type]=\"ValuePathType.COLLECTION\"\n (collectionSelected)=\"onCollectionSelected($event)\"\n ></valtimo-value-path-selector> -->\n </div>\n</form>\n\n<!-- For projecting elements such as process selector in case widgets -->\n<ng-content></ng-content>\n\n<span class=\"valtimo-widget-management-table__subtitle\">\n {{ 'widgetTabManagement.content.table.columns' | translate }}\n</span>\n\n<valtimo-widget-management-fields-column\n [addTranslateKey]=\"'widgetTabManagement.content.table.addColumn'\"\n [columnData]=\"$content()?.columns\"\n (columnUpdateEvent)=\"onColumnUpdateEvent($event)\"\n></valtimo-widget-management-fields-column>\n<!-- TODO: Implement to work for case as well -->\n<!-- [selectedCollection]=\"selectedCollection$ | async\" -->\n\n<section class=\"valtimo-widget-management-table__toggle\">\n <span class=\"valtimo-widget-management-table__subtitle\">\n {{ 'widgetTabManagement.content.table.options' | translate }}\n </span>\n\n <cds-toggle\n [checked]=\"$checked()\"\n [label]=\"'widgetTabManagement.content.table.firstColumnAsTitle' | translate\"\n [onText]=\"'interface.yes' | translate\"\n [offText]=\"'interface.no' | translate\"\n (checkedChange)=\"onCheckedChange($event)\"\n ></cds-toggle>\n</section>\n", styles: [".valtimo-widget-management-table{display:flex;flex-direction:column;gap:24px}.valtimo-widget-management-table__form{display:grid;gap:16px;grid-template-columns:repeat(3,1fr);align-items:flex-end}.valtimo-widget-management-table__subtitle{font-size:16px;font-weight:600;line-height:22px}.valtimo-widget-management-table__toggle{display:flex;flex-direction:column;gap:8px}.valtimo-widget-management-table__path-selector{display:flex;flex-direction:column}\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"] }]
|
|
580
|
+
}], ctorParameters: () => [{ type: i1.CdsThemeService }, { type: i2.FormBuilder }, { type: WidgetWizardService }, { type: i2$2.ActivatedRoute }], propDecorators: { class: [{
|
|
581
|
+
type: HostBinding,
|
|
582
|
+
args: ['class']
|
|
583
|
+
}], changeValidEvent: [{
|
|
584
|
+
type: Output
|
|
585
|
+
}] } });
|
|
255
586
|
|
|
256
587
|
/*
|
|
257
588
|
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
@@ -268,165 +599,2696 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
268
599
|
* See the License for the specific language governing permissions and
|
|
269
600
|
* limitations under the License.
|
|
270
601
|
*/
|
|
271
|
-
class
|
|
272
|
-
constructor(translateService,
|
|
602
|
+
class WidgetManagementCollectionComponent {
|
|
603
|
+
constructor(cdsThemeService, fb, translateService, widgetFieldsService, route, widgetWizardService) {
|
|
604
|
+
this.cdsThemeService = cdsThemeService;
|
|
605
|
+
this.fb = fb;
|
|
273
606
|
this.translateService = translateService;
|
|
274
|
-
this.
|
|
275
|
-
this.
|
|
276
|
-
this.
|
|
277
|
-
this.
|
|
278
|
-
this.
|
|
279
|
-
this.
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
this.
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
this.
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
607
|
+
this.widgetFieldsService = widgetFieldsService;
|
|
608
|
+
this.route = route;
|
|
609
|
+
this.widgetWizardService = widgetWizardService;
|
|
610
|
+
this.class = 'valtimo-widget-management-collection';
|
|
611
|
+
this.changeValidEvent = new EventEmitter();
|
|
612
|
+
this.widgetForm = this.fb.group({
|
|
613
|
+
title: this.fb.control(this.widgetWizardService.$widgetTitle() ?? '', Validators.required),
|
|
614
|
+
defaultPageSize: this.fb.control(this.widgetWizardService.$widgetContent()?.defaultPageSize ?? 5, Validators.required),
|
|
615
|
+
collection: this.fb.control(this.widgetWizardService.$widgetContent()?.collection ?? '', Validators.required),
|
|
616
|
+
});
|
|
617
|
+
this.cardForm = this.fb.group({
|
|
618
|
+
value: this.fb.control(this.widgetWizardService.$widgetContent()?.title?.value ?? '', Validators.required),
|
|
619
|
+
type: this.fb.control({
|
|
620
|
+
content: this.translateService.instant(this.translateService.instant(`widgetTabManagement.content.displayType.${this.widgetWizardService.$widgetContent()?.title?.displayProperties?.type ?? WidgetDisplayTypeKey.TEXT}`)),
|
|
621
|
+
id: this.widgetWizardService.$widgetContent()?.title
|
|
622
|
+
?.displayProperties?.type ?? WidgetDisplayTypeKey.TEXT,
|
|
623
|
+
selected: true,
|
|
624
|
+
}, Validators.required),
|
|
625
|
+
});
|
|
626
|
+
this.theme$ = this.cdsThemeService.currentTheme$.pipe(map((theme) => theme === CurrentCarbonTheme.G10 ? CARBON_THEME.WHITE : CARBON_THEME.G90));
|
|
627
|
+
this.ValuePathSelectorPrefix = ValuePathSelectorPrefix;
|
|
628
|
+
this.ValuePathType = ValuePathType;
|
|
629
|
+
this.WidgetDisplayTypeKey = WidgetDisplayTypeKey;
|
|
630
|
+
this.$content = this.widgetWizardService
|
|
631
|
+
.$widgetContent;
|
|
632
|
+
this.displayTypeItems = this.widgetFieldsService.displayTypeItems;
|
|
633
|
+
this.selectedCollection$ = new BehaviorSubject(null);
|
|
634
|
+
this.WIDTH_ITEMS = [
|
|
635
|
+
{
|
|
636
|
+
content: this.translateService.instant('widgetTabManagement.width.fullWidth'),
|
|
637
|
+
id: 'full',
|
|
638
|
+
selected: true,
|
|
639
|
+
},
|
|
640
|
+
{
|
|
641
|
+
content: this.translateService.instant('widgetTabManagement.width.half'),
|
|
642
|
+
id: 'half',
|
|
643
|
+
selected: false,
|
|
644
|
+
},
|
|
645
|
+
];
|
|
646
|
+
this._subscriptions = new Subscription();
|
|
647
|
+
this._$contentValid = signal(false);
|
|
307
648
|
}
|
|
308
649
|
ngOnInit() {
|
|
309
|
-
this.
|
|
650
|
+
this.openWidgetFormSubscription();
|
|
651
|
+
this.openCardFormSubscription();
|
|
652
|
+
this.initForm();
|
|
310
653
|
}
|
|
311
|
-
|
|
312
|
-
this.
|
|
654
|
+
ngOnDestroy() {
|
|
655
|
+
this._subscriptions.unsubscribe();
|
|
313
656
|
}
|
|
314
|
-
|
|
315
|
-
this.
|
|
657
|
+
onAddEnumValueClick(valuesFormArray) {
|
|
658
|
+
valuesFormArray.push(this.fb.group({
|
|
659
|
+
key: this.fb.control('', Validators.required),
|
|
660
|
+
value: this.fb.control('', Validators.required),
|
|
661
|
+
}));
|
|
316
662
|
}
|
|
317
|
-
|
|
318
|
-
this.
|
|
663
|
+
getDisplayItemsSelected(control) {
|
|
664
|
+
return this.widgetFieldsService.getDisplayItemsSelected(control);
|
|
319
665
|
}
|
|
320
|
-
|
|
321
|
-
this.
|
|
666
|
+
getSelectedWidthItem(fieldIndex) {
|
|
667
|
+
const widgetContent = this.widgetWizardService.$widgetContent();
|
|
668
|
+
return !widgetContent
|
|
669
|
+
? this.WIDTH_ITEMS
|
|
670
|
+
: this.WIDTH_ITEMS.map((item) => ({
|
|
671
|
+
...item,
|
|
672
|
+
selected: widgetContent.fields?.[fieldIndex]?.width === item.id,
|
|
673
|
+
}));
|
|
322
674
|
}
|
|
323
|
-
|
|
324
|
-
|
|
675
|
+
onColumnUpdateEvent(event) {
|
|
676
|
+
const { data, valid } = event;
|
|
677
|
+
this.widgetWizardService.$widgetContent.update((content) => {
|
|
678
|
+
const existingFields = content?.fields;
|
|
679
|
+
return {
|
|
680
|
+
...content,
|
|
681
|
+
fields: data.map((item, index) => ({
|
|
682
|
+
...item,
|
|
683
|
+
width: existingFields?.[index]?.width ?? 'full',
|
|
684
|
+
})),
|
|
685
|
+
};
|
|
686
|
+
});
|
|
687
|
+
this._$contentValid.set(valid);
|
|
688
|
+
this.changeValidEvent.emit(valid && this.widgetForm.valid);
|
|
325
689
|
}
|
|
326
|
-
|
|
327
|
-
|
|
690
|
+
onDeleteRowClick(formArray, index) {
|
|
691
|
+
if (!formArray)
|
|
692
|
+
return;
|
|
693
|
+
formArray.removeAt(index);
|
|
328
694
|
}
|
|
329
|
-
|
|
330
|
-
this.
|
|
331
|
-
combineLatest([this._changedValues$, this._languageOptions$])
|
|
332
|
-
.pipe(take(1), map(([changedValues, languageOptions]) => this.getLocalizationsForUpdateRequest(changedValues, languageOptions)), switchMap(updatedLocalizations => this.localizationService.updateLocalizations(updatedLocalizations)))
|
|
333
|
-
.subscribe(() => {
|
|
334
|
-
if (reload) {
|
|
335
|
-
this.document?.defaultView?.location?.reload();
|
|
336
|
-
}
|
|
337
|
-
else {
|
|
338
|
-
this._refreshLocalizations$.next(null);
|
|
339
|
-
this.enable();
|
|
340
|
-
}
|
|
341
|
-
});
|
|
695
|
+
onTypeSelected(formGroup, event) {
|
|
696
|
+
this.widgetFieldsService.onDisplayTypeSelected(['value', 'type'], formGroup, event);
|
|
342
697
|
}
|
|
343
|
-
|
|
344
|
-
this.
|
|
698
|
+
onWidthSelected(event, fieldIndex) {
|
|
699
|
+
this.widgetWizardService.$widgetContent.update((content) => ({
|
|
700
|
+
...content,
|
|
701
|
+
fields: content?.fields.map((field, index) => index === fieldIndex ? { ...field, width: event.item.id } : field),
|
|
702
|
+
}));
|
|
345
703
|
}
|
|
346
|
-
|
|
347
|
-
this.
|
|
704
|
+
onCollectionSelected(item) {
|
|
705
|
+
this.selectedCollection$.next(item);
|
|
348
706
|
}
|
|
349
|
-
|
|
350
|
-
this.
|
|
707
|
+
initForm() {
|
|
708
|
+
if (!this.widgetWizardService.$widgetContent())
|
|
709
|
+
return;
|
|
710
|
+
const title = this.widgetWizardService.$widgetContent().title;
|
|
711
|
+
if (!title)
|
|
712
|
+
return;
|
|
713
|
+
this.onTypeSelected(this.cardForm, {
|
|
714
|
+
item: { id: title.displayProperties?.type ?? '', content: '', selected: true },
|
|
715
|
+
});
|
|
716
|
+
this.cardForm.patchValue({
|
|
717
|
+
...([
|
|
718
|
+
WidgetDisplayTypeKey.NUMBER,
|
|
719
|
+
WidgetDisplayTypeKey.PERCENT,
|
|
720
|
+
WidgetDisplayTypeKey.CURRENCY,
|
|
721
|
+
].includes(title.displayProperties?.type) && {
|
|
722
|
+
digitsInfo: title.displayProperties.digitsInfo,
|
|
723
|
+
}),
|
|
724
|
+
...(title.displayProperties?.type === WidgetDisplayTypeKey.CURRENCY && {
|
|
725
|
+
currencyCode: title.displayProperties.currencyCode,
|
|
726
|
+
display: title.displayProperties.display,
|
|
727
|
+
}),
|
|
728
|
+
...(title.displayProperties?.type === WidgetDisplayTypeKey.DATE && {
|
|
729
|
+
format: title.displayProperties.format,
|
|
730
|
+
}),
|
|
731
|
+
...(title.displayProperties?.type === WidgetDisplayTypeKey.DATE_TIME && {
|
|
732
|
+
format: title.displayProperties.format,
|
|
733
|
+
}),
|
|
734
|
+
...(title.displayProperties?.type === WidgetDisplayTypeKey.ENUM && {
|
|
735
|
+
values: Object.entries(title.displayProperties.values).map(([key, value]) => ({ key, value })),
|
|
736
|
+
}),
|
|
737
|
+
}, { emitEvent: false });
|
|
351
738
|
}
|
|
352
|
-
|
|
353
|
-
this.
|
|
739
|
+
openWidgetFormSubscription() {
|
|
740
|
+
this._subscriptions.add(this.widgetForm.valueChanges.pipe(debounceTime(500)).subscribe(value => {
|
|
741
|
+
this.widgetWizardService.$widgetTitle.set(value?.title ?? '');
|
|
742
|
+
this.widgetWizardService.$widgetContent.update((content) => ({
|
|
743
|
+
...content,
|
|
744
|
+
collection: value?.collection || '',
|
|
745
|
+
defaultPageSize: value?.defaultPageSize || 5,
|
|
746
|
+
}));
|
|
747
|
+
this.changeValidEvent.emit(this.widgetForm.valid && this.cardForm.valid && this._$contentValid());
|
|
748
|
+
}));
|
|
354
749
|
}
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
750
|
+
openCardFormSubscription() {
|
|
751
|
+
this._subscriptions.add(this.cardForm.valueChanges.pipe(debounceTime(500)).subscribe(formValue => {
|
|
752
|
+
let { value, ...displayProperties } = formValue;
|
|
753
|
+
displayProperties = {
|
|
754
|
+
...displayProperties,
|
|
755
|
+
...(!!displayProperties.type && {
|
|
756
|
+
type: displayProperties.type.id,
|
|
757
|
+
}),
|
|
758
|
+
...(!!formValue.values && {
|
|
759
|
+
values: formValue.values?.reduce((acc, curr) => ({ ...acc, [curr.key]: curr.value }), {}),
|
|
760
|
+
}),
|
|
761
|
+
};
|
|
762
|
+
this.widgetWizardService.$widgetContent.update((content) => ({
|
|
763
|
+
...content,
|
|
764
|
+
title: {
|
|
765
|
+
value,
|
|
766
|
+
...(displayProperties.type !== WidgetDisplayTypeKey.TEXT && {
|
|
767
|
+
displayProperties,
|
|
768
|
+
}),
|
|
769
|
+
},
|
|
770
|
+
}));
|
|
771
|
+
this.changeValidEvent.emit(this.widgetForm.valid && this.cardForm.valid && this._$contentValid());
|
|
772
|
+
}));
|
|
773
|
+
}
|
|
774
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: WidgetManagementCollectionComponent, deps: [{ token: i1.CdsThemeService }, { token: i2.FormBuilder }, { token: i2$1.TranslateService }, { token: WidgetFieldsService }, { token: i2$2.ActivatedRoute }, { token: WidgetWizardService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
775
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.15", type: WidgetManagementCollectionComponent, isStandalone: true, selector: "ng-component", outputs: { changeValidEvent: "changeValidEvent" }, host: { properties: { "class": "this.class" } }, ngImport: i0, template: "<!--\n ~ Copyright 2015-2025 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<ng-container *ngIf=\"theme$ | async as theme\">\n <form [formGroup]=\"widgetForm\" class=\"valtimo-widget-management-collection__form\">\n <cds-text-label [attr.data-carbon-theme]=\"theme\">\n <v-input-label\n [title]=\"'widgetTabManagement.content.widgetTitle' | translate\"\n [tooltip]=\"'widgetTabManagement.content.widgetTitleTooltip' | translate\"\n >\n </v-input-label>\n\n <input\n formControlName=\"title\"\n cdsText\n [placeholder]=\"'widgetTabManagement.content.widgetTitlePlaceholder' | translate\"\n type=\"text\"\n />\n </cds-text-label>\n\n <cds-text-label [attr.data-carbon-theme]=\"theme\">\n <v-input-label\n [title]=\"'widgetTabManagement.content.collection.defaultPageSize' | translate\"\n [tooltip]=\"'widgetTabManagement.content.collection.defaultPageSizeTooltip' | translate\"\n >\n </v-input-label>\n\n <input\n formControlName=\"defaultPageSize\"\n cdsText\n [placeholder]=\"\n 'widgetTabManagement.content.collection.defaultPageSizePlaceholder' | translate\n \"\n type=\"text\"\n />\n </cds-text-label>\n\n <div class=\"valtimo-widget-management-collection__path-selector\">\n <v-input-label\n [title]=\"'widgetTabManagement.content.collection.collection' | translate\"\n [tooltip]=\"'widgetTabManagement.content.collection.collectionTooltip' | translate\"\n >\n </v-input-label>\n\n <input\n formControlName=\"collection\"\n cdsText\n [attr.data-carbon-theme]=\"theme\"\n [placeholder]=\"'widgetTabManagement.content.collection.collection' | translate\"\n type=\"text\"\n />\n <!-- <valtimo-value-path-selector\n formControlName=\"collection\"\n [attr.data-carbon-theme]=\"theme\"\n [caseDefinitionKey]=\"obs.params?.caseDefinitionKey\"\n [caseDefinitionVersionTag]=\"obs.params?.caseDefinitionVersionTag\"\n [type]=\"ValuePathType.COLLECTION\"\n (collectionSelected)=\"onCollectionSelected($event)\"\n ></valtimo-value-path-selector> -->\n </div>\n </form>\n\n <!-- For injecting things such as process-selector in case widgets -->\n <ng-content></ng-content>\n\n <!-- <valtimo-case-management-widget-process-selector\n [params]=\"params$ | async\"\n ></valtimo-case-management-widget-process-selector> -->\n\n <span class=\"valtimo-widget-management-collection__subtitle\">\n {{ 'widgetTabManagement.content.collection.cardTitle' | translate }}\n </span>\n\n <form [formGroup]=\"cardForm\" class=\"valtimo-widget-management-collection__card\">\n <section class=\"valtimo-widget-management-collection__card-title\">\n <div class=\"valtimo-widget-management-collection__path-selector\">\n <v-input-label\n [title]=\"'widgetTabManagement.content.fields.value' | translate\"\n [tooltip]=\"'widgetTabManagement.content.collection.valueTooltip' | translate\"\n >\n </v-input-label>\n\n <input\n formControlName=\"value\"\n cdsText\n [attr.data-carbon-theme]=\"theme\"\n [placeholder]=\"'widgetTabManagement.content.fields.value' | translate\"\n type=\"text\"\n />\n <!-- <valtimo-value-path-selector\n formControlName=\"value\"\n [attr.data-carbon-theme]=\"theme\"\n [caseDefinitionKey]=\"obs.params?.caseDefinitionKey\"\n [caseDefinitionVersionTag]=\"obs.params?.caseDefinitionVersionTag\"\n [parentItem]=\"selectedCollection$ | async\"\n ></valtimo-value-path-selector> -->\n </div>\n\n <cds-dropdown\n [attr.data-carbon-theme]=\"theme\"\n [label]=\"'widgetTabManagement.content.fields.type' | translate\"\n [dropUp]=\"false\"\n [placeholder]=\"'widgetTabManagement.content.fields.typePlaceholder' | translate\"\n (selected)=\"onTypeSelected(cardForm, $event)\"\n formControlName=\"type\"\n >\n <cds-dropdown-list [items]=\"getDisplayItemsSelected(cardForm)\"></cds-dropdown-list>\n </cds-dropdown>\n </section>\n\n <section class=\"valtimo-widget-management-collection__card-options\">\n @switch (cardForm.get('type').value.id) {\n @case (WidgetDisplayTypeKey.CURRENCY) {\n <cds-text-label>\n <v-input-label\n [title]=\"'widgetTabManagement.content.fields.currencyCode' | translate\"\n [tooltip]=\"'widgetTabManagement.content.fields.currencyCodeTooltip' | translate\"\n >\n </v-input-label>\n\n <input\n cdsText\n [attr.data-carbon-theme]=\"theme\"\n [placeholder]=\"\n 'widgetTabManagement.content.fields.currencyCodePlaceholder' | translate\n \"\n type=\"text\"\n formControlName=\"currencyCode\"\n />\n </cds-text-label>\n\n <cds-text-label>\n <v-input-label\n [title]=\"'widgetTabManagement.content.fields.display' | translate\"\n [tooltip]=\"'widgetTabManagement.content.fields.displayTooltip' | translate\"\n >\n </v-input-label>\n\n <input\n cdsText\n [attr.data-carbon-theme]=\"theme\"\n [placeholder]=\"'widgetTabManagement.content.fields.displayPlaceholder' | translate\"\n type=\"text\"\n formControlName=\"display\"\n />\n </cds-text-label>\n\n <cds-text-label>\n <v-input-label\n [title]=\"'widgetTabManagement.content.fields.digitsInfo' | translate\"\n tooltip=\"{{\n 'widgetTabManagement.content.fields.digitsInfoTooltip'\n | translate: {minFractionDigits: 2, maxFractionDigits: 2}\n }}\"\n >\n </v-input-label>\n\n <input\n cdsText\n [attr.data-carbon-theme]=\"theme\"\n [placeholder]=\"'widgetTabManagement.content.fields.digitsInfoPlaceholder' | translate\"\n type=\"text\"\n formControlName=\"digitsInfo\"\n />\n </cds-text-label>\n }\n @case (WidgetDisplayTypeKey.DATE) {\n <cds-text-label>\n <v-input-label\n [title]=\"'widgetTabManagement.content.fields.format' | translate\"\n [tooltip]=\"'widgetTabManagement.content.fields.dateFormatTooltip' | translate\"\n ></v-input-label>\n\n <input\n cdsText\n [attr.data-carbon-theme]=\"theme\"\n [placeholder]=\"'widgetTabManagement.content.fields.formatPlaceholder' | translate\"\n type=\"text\"\n formControlName=\"format\"\n />\n </cds-text-label>\n }\n @case (WidgetDisplayTypeKey.DATE_TIME) {\n <cds-text-label>\n <v-input-label\n [title]=\"'widgetTabManagement.content.fields.format' | translate\"\n [tooltip]=\"'widgetTabManagement.content.fields.dateTimeFormatTooltip' | translate\"\n ></v-input-label>\n\n <input\n cdsText\n [attr.data-carbon-theme]=\"theme\"\n [placeholder]=\"'widgetTabManagement.content.fields.formatPlaceholder' | translate\"\n type=\"text\"\n formControlName=\"format\"\n />\n </cds-text-label>\n }\n @case (WidgetDisplayTypeKey.ENUM) {\n <div class=\"valtimo-widget-management-collection__enum\" formArrayName=\"values\">\n @for (rowValue of cardForm.get('values')?.controls; track $index) {\n <form [formGroup]=\"rowValue\" class=\"valtimo-widget-management-collection__enum-form\">\n <cds-text-label>\n <v-input-label\n [title]=\"'widgetTabManagement.content.fields.enumValue' | translate\"\n [tooltip]=\"'widgetTabManagement.content.fields.enumValueTooltip' | translate\"\n >\n </v-input-label>\n\n <input\n [attr.data-carbon-theme]=\"theme\"\n cdsText\n [placeholder]=\"'widgetTabManagement.content.enumValue' | translate\"\n type=\"text\"\n formControlName=\"key\"\n />\n </cds-text-label>\n\n <cds-text-label>\n <v-input-label\n [title]=\"'widgetTabManagement.content.fields.enumDisplay' | translate\"\n [tooltip]=\"'widgetTabManagement.content.fields.enumDisplayTooltip' | translate\"\n >\n </v-input-label>\n\n <input\n cdsText\n [attr.data-carbon-theme]=\"theme\"\n [placeholder]=\"'widgetTabManagement.content.fields.enumDisplay' | translate\"\n type=\"text\"\n formControlName=\"value\"\n />\n </cds-text-label>\n\n <button\n cdsButton=\"danger--ghost\"\n [disabled]=\"$count === 1\"\n [iconOnly]=\"true\"\n class=\"valtimo-case-management-widget-field-column__delete-button enum\"\n (click)=\"onDeleteRowClick(cardForm.get('values'), $index)\"\n >\n <svg cdsIcon=\"trash-can\" size=\"16\"></svg>\n </button>\n </form>\n }\n\n <button\n cdsButton=\"primary\"\n size=\"sm\"\n (click)=\"onAddEnumValueClick(cardForm.get('values'))\"\n >\n {{ 'widgetTabManagement.content.fields.addEnum' | translate }}\n\n <svg class=\"cds--btn__icon\" cdsIcon=\"add\" size=\"16\"></svg>\n </button>\n </div>\n }\n @case (WidgetDisplayTypeKey.NUMBER) {\n <cds-text-label>\n <v-input-label\n [title]=\"'widgetTabManagement.content.fields.digitsInfo' | translate\"\n tooltip=\"{{\n 'widgetTabManagement.content.fields.digitsInfoTooltip'\n | translate\n : {\n minFractionDigits: 0,\n maxFractionDigits: 3,\n }\n }}\"\n >\n </v-input-label>\n\n <input\n cdsText\n [attr.data-carbon-theme]=\"theme\"\n [placeholder]=\"'widgetTabManagement.content.fields.digitsInfo' | translate\"\n type=\"text\"\n formControlName=\"digitsInfo\"\n />\n </cds-text-label>\n }\n @case (WidgetDisplayTypeKey.PERCENT) {\n <cds-text-label>\n <v-input-label\n [title]=\"'widgetTabManagement.content.fields.digitsInfo' | translate\"\n tooltip=\"{{\n 'widgetTabManagement.content.fields.digitsInfoTooltip'\n | translate\n : {\n minFractionDigits: 0,\n maxFractionDigits: 0,\n }\n }}\"\n >\n </v-input-label>\n\n <input\n cdsText\n [attr.data-carbon-theme]=\"theme\"\n [placeholder]=\"'widgetTabManagement.content.fields.digitsInfo' | translate\"\n type=\"text\"\n formControlName=\"digitsInfo\"\n />\n </cds-text-label>\n }\n }\n </section>\n </form>\n\n <span class=\"valtimo-widget-management-collection__subtitle\">\n {{ 'widgetTabManagement.content.collection.cardFields' | translate }}\n </span>\n\n <valtimo-widget-management-fields-column\n [columnData]=\"$content()?.fields\"\n [fieldWidthDropdown]=\"fieldWidthDropdown\"\n [showHideWhenEmptyCheckbox]=\"true\"\n (columnUpdateEvent)=\"onColumnUpdateEvent($event)\"\n >\n <!-- [params]=\"params$ | async\"\n [selectedCollection]=\"selectedCollection$ | async\" -->\n </valtimo-widget-management-fields-column>\n\n <ng-template #fieldWidthDropdown let-index=\"index\">\n <cds-dropdown\n [label]=\"'widgetTabManagement.content.collection.fieldWidth' | translate\"\n [dropUp]=\"false\"\n [placeholder]=\"'widgetTabManagement.content.collection.fieldWidthPlaceholder' | translate\"\n (selected)=\"onWidthSelected($event, index)\"\n >\n <cds-dropdown-list [items]=\"getSelectedWidthItem(index)\"></cds-dropdown-list>\n </cds-dropdown>\n </ng-template>\n</ng-container>\n", styles: [".valtimo-widget-management-collection{display:flex;flex-direction:column;gap:24px}.valtimo-widget-management-collection__form{display:grid;gap:16px;grid-template-columns:repeat(3,1fr);align-items:flex-end}.valtimo-widget-management-collection__subtitle{font-size:16px;font-weight:600;line-height:22px}.valtimo-widget-management-collection__path-selector{display:flex;flex-direction:column}.valtimo-widget-management-collection__card{flex-direction:column;display:flex;gap:16px}.valtimo-widget-management-collection__card-title{display:grid;grid-template-columns:repeat(2,1fr);gap:16px;align-items:flex-end}.valtimo-widget-management-collection__card-options{display:grid;grid-template-columns:repeat(3,1fr);gap:16px}.valtimo-widget-management-collection__enum{display:flex;flex-direction:column;gap:16px}.valtimo-widget-management-collection__enum-form{display:grid;grid-template-columns:1fr 1fr auto;align-items:flex-end;gap:16px}\n/*!\n * Copyright 2015-2025 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i2$1.TranslatePipe, name: "translate" }, { kind: "component", type: WidgetManagementFieldsColumnComponent, selector: "valtimo-widget-management-fields-column", inputs: ["columnData", "addTranslateKey", "fieldWidthDropdown", "selectedCollection", "showHideWhenEmptyCheckbox"], outputs: ["columnUpdateEvent"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i2.FormArrayName, selector: "[formArrayName]", inputs: ["formArrayName"] }, { kind: "ngmodule", type: InputModule }, { kind: "component", type: i3.TextInputLabelComponent, selector: "cds-text-label, ibm-text-label", inputs: ["labelInputID", "disabled", "skeleton", "labelTemplate", "textInputTemplate", "helperText", "invalidText", "invalid", "warn", "warnText", "ariaLabel", "fluid"] }, { kind: "directive", type: i3.TextInput, selector: "[cdsText], [ibmText]", inputs: ["theme", "size", "invalid", "warn", "skeleton"] }, { kind: "ngmodule", type: DropdownModule }, { kind: "component", type: i3.Dropdown, selector: "cds-dropdown, ibm-dropdown", inputs: ["id", "label", "hideLabel", "helperText", "placeholder", "displayValue", "clearText", "size", "type", "theme", "disabled", "readonly", "skeleton", "inline", "disableArrowKeys", "invalid", "invalidText", "warn", "warnText", "appendInline", "scrollableContainer", "itemValueKey", "selectionFeedback", "menuButtonLabel", "selectedLabel", "dropUp", "fluid"], outputs: ["selected", "onClose", "close"] }, { kind: "component", type: i3.DropdownList, selector: "cds-dropdown-list, ibm-dropdown-list", inputs: ["ariaLabel", "items", "listTpl", "type", "showTitles"], outputs: ["select", "scroll", "blurIntent"] }, { kind: "ngmodule", type: ButtonModule }, { kind: "directive", type: i3.Button, selector: "[cdsButton], [ibmButton]", inputs: ["ibmButton", "cdsButton", "size", "skeleton", "iconOnly", "isExpressive"] }, { kind: "ngmodule", type: IconModule }, { kind: "directive", type: i3.IconDirective, selector: "[cdsIcon], [ibmIcon]", inputs: ["ibmIcon", "cdsIcon", "size", "title", "ariaLabel", "ariaLabelledBy", "ariaHidden", "isFocusable"] }, { kind: "ngmodule", type: InputLabelModule }, { kind: "component", type: i1.InputLabelComponent, selector: "v-input-label", inputs: ["name", "tooltip", "tooltipTranslationKey", "largeMargin", "small", "noMargin", "title", "titleTranslationKey", "required", "disabled", "carbonTheme"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
776
|
+
}
|
|
777
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: WidgetManagementCollectionComponent, decorators: [{
|
|
778
|
+
type: Component,
|
|
779
|
+
args: [{ changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, standalone: true, imports: [
|
|
780
|
+
CommonModule,
|
|
781
|
+
TranslateModule,
|
|
782
|
+
WidgetManagementFieldsColumnComponent,
|
|
783
|
+
ReactiveFormsModule,
|
|
784
|
+
InputModule,
|
|
785
|
+
DropdownModule,
|
|
786
|
+
ButtonModule,
|
|
787
|
+
IconModule,
|
|
788
|
+
InputLabelModule,
|
|
789
|
+
ValuePathSelectorComponent,
|
|
790
|
+
], template: "<!--\n ~ Copyright 2015-2025 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<ng-container *ngIf=\"theme$ | async as theme\">\n <form [formGroup]=\"widgetForm\" class=\"valtimo-widget-management-collection__form\">\n <cds-text-label [attr.data-carbon-theme]=\"theme\">\n <v-input-label\n [title]=\"'widgetTabManagement.content.widgetTitle' | translate\"\n [tooltip]=\"'widgetTabManagement.content.widgetTitleTooltip' | translate\"\n >\n </v-input-label>\n\n <input\n formControlName=\"title\"\n cdsText\n [placeholder]=\"'widgetTabManagement.content.widgetTitlePlaceholder' | translate\"\n type=\"text\"\n />\n </cds-text-label>\n\n <cds-text-label [attr.data-carbon-theme]=\"theme\">\n <v-input-label\n [title]=\"'widgetTabManagement.content.collection.defaultPageSize' | translate\"\n [tooltip]=\"'widgetTabManagement.content.collection.defaultPageSizeTooltip' | translate\"\n >\n </v-input-label>\n\n <input\n formControlName=\"defaultPageSize\"\n cdsText\n [placeholder]=\"\n 'widgetTabManagement.content.collection.defaultPageSizePlaceholder' | translate\n \"\n type=\"text\"\n />\n </cds-text-label>\n\n <div class=\"valtimo-widget-management-collection__path-selector\">\n <v-input-label\n [title]=\"'widgetTabManagement.content.collection.collection' | translate\"\n [tooltip]=\"'widgetTabManagement.content.collection.collectionTooltip' | translate\"\n >\n </v-input-label>\n\n <input\n formControlName=\"collection\"\n cdsText\n [attr.data-carbon-theme]=\"theme\"\n [placeholder]=\"'widgetTabManagement.content.collection.collection' | translate\"\n type=\"text\"\n />\n <!-- <valtimo-value-path-selector\n formControlName=\"collection\"\n [attr.data-carbon-theme]=\"theme\"\n [caseDefinitionKey]=\"obs.params?.caseDefinitionKey\"\n [caseDefinitionVersionTag]=\"obs.params?.caseDefinitionVersionTag\"\n [type]=\"ValuePathType.COLLECTION\"\n (collectionSelected)=\"onCollectionSelected($event)\"\n ></valtimo-value-path-selector> -->\n </div>\n </form>\n\n <!-- For injecting things such as process-selector in case widgets -->\n <ng-content></ng-content>\n\n <!-- <valtimo-case-management-widget-process-selector\n [params]=\"params$ | async\"\n ></valtimo-case-management-widget-process-selector> -->\n\n <span class=\"valtimo-widget-management-collection__subtitle\">\n {{ 'widgetTabManagement.content.collection.cardTitle' | translate }}\n </span>\n\n <form [formGroup]=\"cardForm\" class=\"valtimo-widget-management-collection__card\">\n <section class=\"valtimo-widget-management-collection__card-title\">\n <div class=\"valtimo-widget-management-collection__path-selector\">\n <v-input-label\n [title]=\"'widgetTabManagement.content.fields.value' | translate\"\n [tooltip]=\"'widgetTabManagement.content.collection.valueTooltip' | translate\"\n >\n </v-input-label>\n\n <input\n formControlName=\"value\"\n cdsText\n [attr.data-carbon-theme]=\"theme\"\n [placeholder]=\"'widgetTabManagement.content.fields.value' | translate\"\n type=\"text\"\n />\n <!-- <valtimo-value-path-selector\n formControlName=\"value\"\n [attr.data-carbon-theme]=\"theme\"\n [caseDefinitionKey]=\"obs.params?.caseDefinitionKey\"\n [caseDefinitionVersionTag]=\"obs.params?.caseDefinitionVersionTag\"\n [parentItem]=\"selectedCollection$ | async\"\n ></valtimo-value-path-selector> -->\n </div>\n\n <cds-dropdown\n [attr.data-carbon-theme]=\"theme\"\n [label]=\"'widgetTabManagement.content.fields.type' | translate\"\n [dropUp]=\"false\"\n [placeholder]=\"'widgetTabManagement.content.fields.typePlaceholder' | translate\"\n (selected)=\"onTypeSelected(cardForm, $event)\"\n formControlName=\"type\"\n >\n <cds-dropdown-list [items]=\"getDisplayItemsSelected(cardForm)\"></cds-dropdown-list>\n </cds-dropdown>\n </section>\n\n <section class=\"valtimo-widget-management-collection__card-options\">\n @switch (cardForm.get('type').value.id) {\n @case (WidgetDisplayTypeKey.CURRENCY) {\n <cds-text-label>\n <v-input-label\n [title]=\"'widgetTabManagement.content.fields.currencyCode' | translate\"\n [tooltip]=\"'widgetTabManagement.content.fields.currencyCodeTooltip' | translate\"\n >\n </v-input-label>\n\n <input\n cdsText\n [attr.data-carbon-theme]=\"theme\"\n [placeholder]=\"\n 'widgetTabManagement.content.fields.currencyCodePlaceholder' | translate\n \"\n type=\"text\"\n formControlName=\"currencyCode\"\n />\n </cds-text-label>\n\n <cds-text-label>\n <v-input-label\n [title]=\"'widgetTabManagement.content.fields.display' | translate\"\n [tooltip]=\"'widgetTabManagement.content.fields.displayTooltip' | translate\"\n >\n </v-input-label>\n\n <input\n cdsText\n [attr.data-carbon-theme]=\"theme\"\n [placeholder]=\"'widgetTabManagement.content.fields.displayPlaceholder' | translate\"\n type=\"text\"\n formControlName=\"display\"\n />\n </cds-text-label>\n\n <cds-text-label>\n <v-input-label\n [title]=\"'widgetTabManagement.content.fields.digitsInfo' | translate\"\n tooltip=\"{{\n 'widgetTabManagement.content.fields.digitsInfoTooltip'\n | translate: {minFractionDigits: 2, maxFractionDigits: 2}\n }}\"\n >\n </v-input-label>\n\n <input\n cdsText\n [attr.data-carbon-theme]=\"theme\"\n [placeholder]=\"'widgetTabManagement.content.fields.digitsInfoPlaceholder' | translate\"\n type=\"text\"\n formControlName=\"digitsInfo\"\n />\n </cds-text-label>\n }\n @case (WidgetDisplayTypeKey.DATE) {\n <cds-text-label>\n <v-input-label\n [title]=\"'widgetTabManagement.content.fields.format' | translate\"\n [tooltip]=\"'widgetTabManagement.content.fields.dateFormatTooltip' | translate\"\n ></v-input-label>\n\n <input\n cdsText\n [attr.data-carbon-theme]=\"theme\"\n [placeholder]=\"'widgetTabManagement.content.fields.formatPlaceholder' | translate\"\n type=\"text\"\n formControlName=\"format\"\n />\n </cds-text-label>\n }\n @case (WidgetDisplayTypeKey.DATE_TIME) {\n <cds-text-label>\n <v-input-label\n [title]=\"'widgetTabManagement.content.fields.format' | translate\"\n [tooltip]=\"'widgetTabManagement.content.fields.dateTimeFormatTooltip' | translate\"\n ></v-input-label>\n\n <input\n cdsText\n [attr.data-carbon-theme]=\"theme\"\n [placeholder]=\"'widgetTabManagement.content.fields.formatPlaceholder' | translate\"\n type=\"text\"\n formControlName=\"format\"\n />\n </cds-text-label>\n }\n @case (WidgetDisplayTypeKey.ENUM) {\n <div class=\"valtimo-widget-management-collection__enum\" formArrayName=\"values\">\n @for (rowValue of cardForm.get('values')?.controls; track $index) {\n <form [formGroup]=\"rowValue\" class=\"valtimo-widget-management-collection__enum-form\">\n <cds-text-label>\n <v-input-label\n [title]=\"'widgetTabManagement.content.fields.enumValue' | translate\"\n [tooltip]=\"'widgetTabManagement.content.fields.enumValueTooltip' | translate\"\n >\n </v-input-label>\n\n <input\n [attr.data-carbon-theme]=\"theme\"\n cdsText\n [placeholder]=\"'widgetTabManagement.content.enumValue' | translate\"\n type=\"text\"\n formControlName=\"key\"\n />\n </cds-text-label>\n\n <cds-text-label>\n <v-input-label\n [title]=\"'widgetTabManagement.content.fields.enumDisplay' | translate\"\n [tooltip]=\"'widgetTabManagement.content.fields.enumDisplayTooltip' | translate\"\n >\n </v-input-label>\n\n <input\n cdsText\n [attr.data-carbon-theme]=\"theme\"\n [placeholder]=\"'widgetTabManagement.content.fields.enumDisplay' | translate\"\n type=\"text\"\n formControlName=\"value\"\n />\n </cds-text-label>\n\n <button\n cdsButton=\"danger--ghost\"\n [disabled]=\"$count === 1\"\n [iconOnly]=\"true\"\n class=\"valtimo-case-management-widget-field-column__delete-button enum\"\n (click)=\"onDeleteRowClick(cardForm.get('values'), $index)\"\n >\n <svg cdsIcon=\"trash-can\" size=\"16\"></svg>\n </button>\n </form>\n }\n\n <button\n cdsButton=\"primary\"\n size=\"sm\"\n (click)=\"onAddEnumValueClick(cardForm.get('values'))\"\n >\n {{ 'widgetTabManagement.content.fields.addEnum' | translate }}\n\n <svg class=\"cds--btn__icon\" cdsIcon=\"add\" size=\"16\"></svg>\n </button>\n </div>\n }\n @case (WidgetDisplayTypeKey.NUMBER) {\n <cds-text-label>\n <v-input-label\n [title]=\"'widgetTabManagement.content.fields.digitsInfo' | translate\"\n tooltip=\"{{\n 'widgetTabManagement.content.fields.digitsInfoTooltip'\n | translate\n : {\n minFractionDigits: 0,\n maxFractionDigits: 3,\n }\n }}\"\n >\n </v-input-label>\n\n <input\n cdsText\n [attr.data-carbon-theme]=\"theme\"\n [placeholder]=\"'widgetTabManagement.content.fields.digitsInfo' | translate\"\n type=\"text\"\n formControlName=\"digitsInfo\"\n />\n </cds-text-label>\n }\n @case (WidgetDisplayTypeKey.PERCENT) {\n <cds-text-label>\n <v-input-label\n [title]=\"'widgetTabManagement.content.fields.digitsInfo' | translate\"\n tooltip=\"{{\n 'widgetTabManagement.content.fields.digitsInfoTooltip'\n | translate\n : {\n minFractionDigits: 0,\n maxFractionDigits: 0,\n }\n }}\"\n >\n </v-input-label>\n\n <input\n cdsText\n [attr.data-carbon-theme]=\"theme\"\n [placeholder]=\"'widgetTabManagement.content.fields.digitsInfo' | translate\"\n type=\"text\"\n formControlName=\"digitsInfo\"\n />\n </cds-text-label>\n }\n }\n </section>\n </form>\n\n <span class=\"valtimo-widget-management-collection__subtitle\">\n {{ 'widgetTabManagement.content.collection.cardFields' | translate }}\n </span>\n\n <valtimo-widget-management-fields-column\n [columnData]=\"$content()?.fields\"\n [fieldWidthDropdown]=\"fieldWidthDropdown\"\n [showHideWhenEmptyCheckbox]=\"true\"\n (columnUpdateEvent)=\"onColumnUpdateEvent($event)\"\n >\n <!-- [params]=\"params$ | async\"\n [selectedCollection]=\"selectedCollection$ | async\" -->\n </valtimo-widget-management-fields-column>\n\n <ng-template #fieldWidthDropdown let-index=\"index\">\n <cds-dropdown\n [label]=\"'widgetTabManagement.content.collection.fieldWidth' | translate\"\n [dropUp]=\"false\"\n [placeholder]=\"'widgetTabManagement.content.collection.fieldWidthPlaceholder' | translate\"\n (selected)=\"onWidthSelected($event, index)\"\n >\n <cds-dropdown-list [items]=\"getSelectedWidthItem(index)\"></cds-dropdown-list>\n </cds-dropdown>\n </ng-template>\n</ng-container>\n", styles: [".valtimo-widget-management-collection{display:flex;flex-direction:column;gap:24px}.valtimo-widget-management-collection__form{display:grid;gap:16px;grid-template-columns:repeat(3,1fr);align-items:flex-end}.valtimo-widget-management-collection__subtitle{font-size:16px;font-weight:600;line-height:22px}.valtimo-widget-management-collection__path-selector{display:flex;flex-direction:column}.valtimo-widget-management-collection__card{flex-direction:column;display:flex;gap:16px}.valtimo-widget-management-collection__card-title{display:grid;grid-template-columns:repeat(2,1fr);gap:16px;align-items:flex-end}.valtimo-widget-management-collection__card-options{display:grid;grid-template-columns:repeat(3,1fr);gap:16px}.valtimo-widget-management-collection__enum{display:flex;flex-direction:column;gap:16px}.valtimo-widget-management-collection__enum-form{display:grid;grid-template-columns:1fr 1fr auto;align-items:flex-end;gap:16px}\n/*!\n * Copyright 2015-2025 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n"] }]
|
|
791
|
+
}], ctorParameters: () => [{ type: i1.CdsThemeService }, { type: i2.FormBuilder }, { type: i2$1.TranslateService }, { type: WidgetFieldsService }, { type: i2$2.ActivatedRoute }, { type: WidgetWizardService }], propDecorators: { class: [{
|
|
792
|
+
type: HostBinding,
|
|
793
|
+
args: ['class']
|
|
794
|
+
}], changeValidEvent: [{
|
|
795
|
+
type: Output
|
|
796
|
+
}] } });
|
|
797
|
+
|
|
798
|
+
/*
|
|
799
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
800
|
+
*
|
|
801
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
802
|
+
* you may not use this file except in compliance with the License.
|
|
803
|
+
* You may obtain a copy of the License at
|
|
804
|
+
*
|
|
805
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
806
|
+
*
|
|
807
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
808
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
809
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
810
|
+
* See the License for the specific language governing permissions and
|
|
811
|
+
* limitations under the License.
|
|
812
|
+
*/
|
|
813
|
+
class WidgetManagementCustomComponent {
|
|
814
|
+
get widgetTitle() {
|
|
815
|
+
return this.form.get('widgetTitle');
|
|
816
|
+
}
|
|
817
|
+
constructor(customWidgetConfig, cdsThemeService, fb, widgetWizardService) {
|
|
818
|
+
this.customWidgetConfig = customWidgetConfig;
|
|
819
|
+
this.cdsThemeService = cdsThemeService;
|
|
820
|
+
this.fb = fb;
|
|
821
|
+
this.widgetWizardService = widgetWizardService;
|
|
822
|
+
this.changeValidEvent = new EventEmitter();
|
|
823
|
+
this.form = this.fb.group({
|
|
824
|
+
widgetTitle: this.fb.control(this.widgetWizardService.$widgetTitle(), Validators.required),
|
|
825
|
+
});
|
|
826
|
+
this.theme$ = this.cdsThemeService.currentTheme$.pipe(map((theme) => theme === CurrentCarbonTheme.G10 ? CARBON_THEME.WHITE : CARBON_THEME.G90));
|
|
827
|
+
this._selectedCustomComponentKey$ = new BehaviorSubject(null);
|
|
828
|
+
this._customWidgetConfig$ = new BehaviorSubject({});
|
|
829
|
+
this.componentListItems$ = combineLatest([
|
|
830
|
+
this._customWidgetConfig$,
|
|
831
|
+
this._selectedCustomComponentKey$,
|
|
832
|
+
]).pipe(filter(([config]) => !!config), map(([config, selectedKey]) => Object.keys(config).reduce((acc, curr) => [...acc, { content: curr, selected: curr === selectedKey }], [])));
|
|
833
|
+
this._subscriptions = new Subscription();
|
|
834
|
+
if (customWidgetConfig)
|
|
835
|
+
this._customWidgetConfig$.next(customWidgetConfig);
|
|
836
|
+
}
|
|
837
|
+
componentDropDownChange(event) {
|
|
838
|
+
const componentKey = event?.item?.content;
|
|
839
|
+
if (!componentKey)
|
|
840
|
+
return;
|
|
841
|
+
this._selectedCustomComponentKey$.next(componentKey);
|
|
842
|
+
this.widgetWizardService.$widgetContent.set({ componentKey });
|
|
843
|
+
this.changeValidEvent.emit(true);
|
|
844
|
+
}
|
|
845
|
+
ngOnInit() {
|
|
846
|
+
this.openTitleSubscription();
|
|
847
|
+
this.prefill();
|
|
848
|
+
}
|
|
849
|
+
ngOnDestroy() {
|
|
850
|
+
this._subscriptions.unsubscribe();
|
|
851
|
+
}
|
|
852
|
+
openTitleSubscription() {
|
|
853
|
+
this._subscriptions.add(this.widgetTitle?.valueChanges.subscribe(title => {
|
|
854
|
+
this.widgetWizardService.$widgetTitle.set(title);
|
|
855
|
+
}));
|
|
856
|
+
}
|
|
857
|
+
prefill() {
|
|
858
|
+
const componentKey = this.widgetWizardService.$widgetContent()
|
|
859
|
+
?.componentKey;
|
|
860
|
+
if (!componentKey || Object.keys(this.customWidgetConfig || {}).length === 0)
|
|
861
|
+
return;
|
|
862
|
+
this._selectedCustomComponentKey$.next(componentKey);
|
|
863
|
+
this.changeValidEvent.emit(true);
|
|
864
|
+
}
|
|
865
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: WidgetManagementCustomComponent, deps: [{ token: CUSTOM_WIDGET_TOKEN, optional: true }, { token: i1.CdsThemeService }, { token: i2.FormBuilder }, { token: WidgetWizardService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
866
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.15", type: WidgetManagementCustomComponent, isStandalone: true, selector: "ng-component", outputs: { changeValidEvent: "changeValidEvent" }, ngImport: i0, template: "<!--\n ~ Copyright 2015-2025 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<form\n class=\"valtimo-widget-management-custom\"\n [formGroup]=\"form\"\n [attr.data-carbon-theme]=\"theme$ | async\"\n>\n <cds-text-label class=\"valtimo-widget-management-field__input\">\n {{ 'widgetTabManagement.content.widgetTitle' | translate }}\n\n <input\n formControlName=\"widgetTitle\"\n cdsText\n [placeholder]=\"'widgetTabManagement.content.widgetTitlePlaceholder' | translate\"\n type=\"text\"\n />\n </cds-text-label>\n\n <!-- For injecting things such as process selector in case management -->\n <ng-container></ng-container>\n\n <cds-label class=\"dropdown-label\">\n {{ 'widgetTabManagement.content.custom.selectComponent' | translate }}\n\n <cds-dropdown\n *ngIf=\"componentListItems$ | async as componentListItems\"\n [appendInline]=\"false\"\n [placeholder]=\"'widgetTabManagement.content.custom.placeholder' | translate\"\n [disabled]=\"componentListItems.length === 0\"\n (selected)=\"componentDropDownChange($event)\"\n >\n <cds-dropdown-list [items]=\"componentListItems\"> </cds-dropdown-list>\n </cds-dropdown>\n </cds-label>\n</form>\n", styles: [".valtimo-widget-management-custom{display:flex;flex-direction:column;gap:16px}.valtimo-widget-management-custom ::ng-deep .dropdown-label label{display:flex;flex-direction:column;width:100%}.valtimo-widget-management-custom ::ng-deep .dropdown-label cds-dropdown{margin-top:8px}\n/*!\n * Copyright 2015-2025 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i2$1.TranslatePipe, name: "translate" }, { kind: "ngmodule", type: InputModule }, { kind: "component", type: i3.Label, selector: "cds-label, ibm-label", inputs: ["labelInputID", "disabled", "skeleton", "helperText", "invalidText", "invalid", "warn", "warnText", "ariaLabel"] }, { kind: "component", type: i3.TextInputLabelComponent, selector: "cds-text-label, ibm-text-label", inputs: ["labelInputID", "disabled", "skeleton", "labelTemplate", "textInputTemplate", "helperText", "invalidText", "invalid", "warn", "warnText", "ariaLabel", "fluid"] }, { kind: "directive", type: i3.TextInput, selector: "[cdsText], [ibmText]", inputs: ["theme", "size", "invalid", "warn", "skeleton"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: SelectModule }, { kind: "ngmodule", type: DropdownModule }, { kind: "component", type: i3.Dropdown, selector: "cds-dropdown, ibm-dropdown", inputs: ["id", "label", "hideLabel", "helperText", "placeholder", "displayValue", "clearText", "size", "type", "theme", "disabled", "readonly", "skeleton", "inline", "disableArrowKeys", "invalid", "invalidText", "warn", "warnText", "appendInline", "scrollableContainer", "itemValueKey", "selectionFeedback", "menuButtonLabel", "selectedLabel", "dropUp", "fluid"], outputs: ["selected", "onClose", "close"] }, { kind: "component", type: i3.DropdownList, selector: "cds-dropdown-list, ibm-dropdown-list", inputs: ["ariaLabel", "items", "listTpl", "type", "showTitles"], outputs: ["select", "scroll", "blurIntent"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
867
|
+
}
|
|
868
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: WidgetManagementCustomComponent, decorators: [{
|
|
869
|
+
type: Component,
|
|
870
|
+
args: [{ changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [
|
|
871
|
+
CommonModule,
|
|
872
|
+
TranslateModule,
|
|
873
|
+
InputModule,
|
|
874
|
+
ReactiveFormsModule,
|
|
875
|
+
SelectModule,
|
|
876
|
+
DropdownModule,
|
|
877
|
+
], template: "<!--\n ~ Copyright 2015-2025 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<form\n class=\"valtimo-widget-management-custom\"\n [formGroup]=\"form\"\n [attr.data-carbon-theme]=\"theme$ | async\"\n>\n <cds-text-label class=\"valtimo-widget-management-field__input\">\n {{ 'widgetTabManagement.content.widgetTitle' | translate }}\n\n <input\n formControlName=\"widgetTitle\"\n cdsText\n [placeholder]=\"'widgetTabManagement.content.widgetTitlePlaceholder' | translate\"\n type=\"text\"\n />\n </cds-text-label>\n\n <!-- For injecting things such as process selector in case management -->\n <ng-container></ng-container>\n\n <cds-label class=\"dropdown-label\">\n {{ 'widgetTabManagement.content.custom.selectComponent' | translate }}\n\n <cds-dropdown\n *ngIf=\"componentListItems$ | async as componentListItems\"\n [appendInline]=\"false\"\n [placeholder]=\"'widgetTabManagement.content.custom.placeholder' | translate\"\n [disabled]=\"componentListItems.length === 0\"\n (selected)=\"componentDropDownChange($event)\"\n >\n <cds-dropdown-list [items]=\"componentListItems\"> </cds-dropdown-list>\n </cds-dropdown>\n </cds-label>\n</form>\n", styles: [".valtimo-widget-management-custom{display:flex;flex-direction:column;gap:16px}.valtimo-widget-management-custom ::ng-deep .dropdown-label label{display:flex;flex-direction:column;width:100%}.valtimo-widget-management-custom ::ng-deep .dropdown-label cds-dropdown{margin-top:8px}\n/*!\n * Copyright 2015-2025 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n"] }]
|
|
878
|
+
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
879
|
+
type: Optional
|
|
880
|
+
}, {
|
|
881
|
+
type: Inject,
|
|
882
|
+
args: [CUSTOM_WIDGET_TOKEN]
|
|
883
|
+
}] }, { type: i1.CdsThemeService }, { type: i2.FormBuilder }, { type: WidgetWizardService }], propDecorators: { changeValidEvent: [{
|
|
884
|
+
type: Output
|
|
885
|
+
}] } });
|
|
886
|
+
|
|
887
|
+
/*
|
|
888
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
889
|
+
*
|
|
890
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
891
|
+
* you may not use this file except in compliance with the License.
|
|
892
|
+
* You may obtain a copy of the License at
|
|
893
|
+
*
|
|
894
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
895
|
+
*
|
|
896
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
897
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
898
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
899
|
+
* See the License for the specific language governing permissions and
|
|
900
|
+
* limitations under the License.
|
|
901
|
+
*/
|
|
902
|
+
|
|
903
|
+
var WidgetWizardStep;
|
|
904
|
+
(function (WidgetWizardStep) {
|
|
905
|
+
WidgetWizardStep[WidgetWizardStep["TYPE"] = 0] = "TYPE";
|
|
906
|
+
WidgetWizardStep[WidgetWizardStep["WIDTH"] = 1] = "WIDTH";
|
|
907
|
+
WidgetWizardStep[WidgetWizardStep["STYLE"] = 2] = "STYLE";
|
|
908
|
+
WidgetWizardStep[WidgetWizardStep["CONTENT"] = 3] = "CONTENT";
|
|
909
|
+
})(WidgetWizardStep || (WidgetWizardStep = {}));
|
|
910
|
+
var WidgetWizardCloseEventType;
|
|
911
|
+
(function (WidgetWizardCloseEventType) {
|
|
912
|
+
WidgetWizardCloseEventType[WidgetWizardCloseEventType["CANCEL"] = 0] = "CANCEL";
|
|
913
|
+
WidgetWizardCloseEventType[WidgetWizardCloseEventType["CREATE"] = 1] = "CREATE";
|
|
914
|
+
WidgetWizardCloseEventType[WidgetWizardCloseEventType["EDIT"] = 2] = "EDIT";
|
|
915
|
+
})(WidgetWizardCloseEventType || (WidgetWizardCloseEventType = {}));
|
|
916
|
+
var WidgetStyle;
|
|
917
|
+
(function (WidgetStyle) {
|
|
918
|
+
WidgetStyle["DEFAULT"] = "default";
|
|
919
|
+
WidgetStyle["HIGH_CONTRAST"] = "high-contrast";
|
|
920
|
+
})(WidgetStyle || (WidgetStyle = {}));
|
|
921
|
+
const AVAILABLE_WIDGETS = [
|
|
922
|
+
{
|
|
923
|
+
titleKey: 'widgetTabManagement.types.fields.title',
|
|
924
|
+
descriptionKey: 'widgetTabManagement.types.fields.description',
|
|
925
|
+
illustrationUrl: 'valtimo-layout/img/widget-management/types/fields.svg',
|
|
926
|
+
type: WidgetType.FIELDS,
|
|
927
|
+
component: WidgetManagementFieldsComponent,
|
|
928
|
+
},
|
|
929
|
+
{
|
|
930
|
+
titleKey: 'widgetTabManagement.types.custom.title',
|
|
931
|
+
descriptionKey: 'widgetTabManagement.types.custom.description',
|
|
932
|
+
illustrationUrl: 'valtimo-layout/img/widget-management/types/angular.svg',
|
|
933
|
+
type: WidgetType.CUSTOM,
|
|
934
|
+
component: WidgetManagementCustomComponent,
|
|
935
|
+
},
|
|
936
|
+
{
|
|
937
|
+
titleKey: 'widgetTabManagement.types.table.title',
|
|
938
|
+
descriptionKey: 'widgetTabManagement.types.table.description',
|
|
939
|
+
illustrationUrl: 'valtimo-layout/img/widget-management/types/table.svg',
|
|
940
|
+
type: WidgetType.TABLE,
|
|
941
|
+
component: WidgetManagementTableComponent,
|
|
942
|
+
},
|
|
943
|
+
{
|
|
944
|
+
titleKey: 'widgetTabManagement.types.collection.title',
|
|
945
|
+
descriptionKey: 'widgetTabManagement.types.collection.description',
|
|
946
|
+
illustrationUrl: 'valtimo-layout/img/widget-management/types/collection.svg',
|
|
947
|
+
type: WidgetType.COLLECTION,
|
|
948
|
+
component: WidgetManagementCollectionComponent,
|
|
949
|
+
},
|
|
950
|
+
];
|
|
951
|
+
const WIDGET_WIDTH_LABELS = {
|
|
952
|
+
1: 'widgetTabManagement.width.small.title',
|
|
953
|
+
2: 'widgetTabManagement.width.medium.title',
|
|
954
|
+
3: 'widgetTabManagement.width.large.title',
|
|
955
|
+
4: 'widgetTabManagement.width.xtraLarge.title',
|
|
956
|
+
};
|
|
957
|
+
const WIDGET_STYLE_LABELS = {
|
|
958
|
+
[WidgetStyle.DEFAULT]: 'widgetTabManagement.style.default.title',
|
|
959
|
+
[WidgetStyle.HIGH_CONTRAST]: 'widgetTabManagement.style.highContrast.title',
|
|
960
|
+
};
|
|
961
|
+
|
|
962
|
+
/*
|
|
963
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
964
|
+
*
|
|
965
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
966
|
+
* you may not use this file except in compliance with the License.
|
|
967
|
+
* You may obtain a copy of the License at
|
|
968
|
+
*
|
|
969
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
970
|
+
*
|
|
971
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
972
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
973
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
974
|
+
* See the License for the specific language governing permissions and
|
|
975
|
+
* limitations under the License.
|
|
976
|
+
*/
|
|
977
|
+
|
|
978
|
+
/*
|
|
979
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
980
|
+
*
|
|
981
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
982
|
+
* you may not use this file except in compliance with the License.
|
|
983
|
+
* You may obtain a copy of the License at
|
|
984
|
+
*
|
|
985
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
986
|
+
*
|
|
987
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
988
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
989
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
990
|
+
* See the License for the specific language governing permissions and
|
|
991
|
+
* limitations under the License.
|
|
992
|
+
*/
|
|
993
|
+
class LayoutPublicComponent {
|
|
994
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: LayoutPublicComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
995
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.15", type: LayoutPublicComponent, isStandalone: false, selector: "valtimo-layout-public", 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=\"public-page-content\">\n <img src=\"assets/logo.svg\" class=\"logo\" />\n <router-outlet></router-outlet>\n</div>\n", styles: ["body{background-color:#eee}.public-page-content{background-color:#fff;margin:60px auto;border:1px solid #dee2e6;padding:0 30px 30px}.public-page-content .logo{width:25%;display:block;margin:30px auto}@media (min-width: 768px){.public-page-content{width:50%}}@media (max-width: 767px) and (min-width: 576px){.public-page-content{width:75%}}@media (max-width: 575px){.public-page-content{width:95%}.public-page-content .logo{width:50%}}\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: i2$2.RouterOutlet, selector: "router-outlet", inputs: ["name", "routerOutletData"], outputs: ["activate", "deactivate", "attach", "detach"], exportAs: ["outlet"] }] }); }
|
|
996
|
+
}
|
|
997
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: LayoutPublicComponent, decorators: [{
|
|
998
|
+
type: Component,
|
|
999
|
+
args: [{ selector: 'valtimo-layout-public', standalone: false, 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=\"public-page-content\">\n <img src=\"assets/logo.svg\" class=\"logo\" />\n <router-outlet></router-outlet>\n</div>\n", styles: ["body{background-color:#eee}.public-page-content{background-color:#fff;margin:60px auto;border:1px solid #dee2e6;padding:0 30px 30px}.public-page-content .logo{width:25%;display:block;margin:30px auto}@media (min-width: 768px){.public-page-content{width:50%}}@media (max-width: 767px) and (min-width: 576px){.public-page-content{width:75%}}@media (max-width: 575px){.public-page-content{width:95%}.public-page-content .logo{width:50%}}\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"] }]
|
|
1000
|
+
}] });
|
|
1001
|
+
|
|
1002
|
+
/*
|
|
1003
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
1004
|
+
*
|
|
1005
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
1006
|
+
* you may not use this file except in compliance with the License.
|
|
1007
|
+
* You may obtain a copy of the License at
|
|
1008
|
+
*
|
|
1009
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
1010
|
+
*
|
|
1011
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
1012
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
1013
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1014
|
+
* See the License for the specific language governing permissions and
|
|
1015
|
+
* limitations under the License.
|
|
1016
|
+
*/
|
|
1017
|
+
class LayoutInternalComponent {
|
|
1018
|
+
constructor(layoutService, renderer, userInterfaceService, shellService) {
|
|
1019
|
+
this.layoutService = layoutService;
|
|
1020
|
+
this.renderer = renderer;
|
|
1021
|
+
this.userInterfaceService = userInterfaceService;
|
|
1022
|
+
this.shellService = shellService;
|
|
1023
|
+
this.showPageHeader$ = this.userInterfaceService.showPageHeader$;
|
|
1024
|
+
this.sideBarExpanded$ = this.shellService.sideBarExpanded$;
|
|
1025
|
+
this.collapsibleWidescreenMenu$ = this.shellService.collapsibleWidescreenMenu$;
|
|
1026
|
+
this.renderer.addClass(document.body, 'be-animate');
|
|
1027
|
+
}
|
|
1028
|
+
ngAfterViewInit() {
|
|
1029
|
+
App.init();
|
|
1030
|
+
this.shellService.setContentElement(this.mainContentRef.nativeElement);
|
|
1031
|
+
this._observer = new ResizeObserver(() => {
|
|
1032
|
+
this.shellService.onMainContentResize();
|
|
1033
|
+
});
|
|
1034
|
+
this._observer.observe(this.mainContentRef.nativeElement);
|
|
1035
|
+
}
|
|
1036
|
+
ngOnDestroy() {
|
|
1037
|
+
this._observer.disconnect();
|
|
1038
|
+
}
|
|
1039
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: LayoutInternalComponent, deps: [{ token: LayoutService }, { token: i0.Renderer2 }, { token: i1.UserInterfaceService }, { token: i1.ShellService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1040
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.15", type: LayoutInternalComponent, isStandalone: false, selector: "valtimo-layout-internal", viewQueries: [{ propertyName: "mainContentRef", first: true, predicate: ["mainContent"], 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<valtimo-topbar></valtimo-topbar>\n<main\n class=\"cds--content\"\n [ngClass]=\"{\n 'cds--content--sidebar':\n (sideBarExpanded$ | async) && (collapsibleWidescreenMenu$ | async) === false,\n }\"\n #mainContent\n>\n <valtimo-left-sidebar [hidden]=\"layoutService.isFullscreen\"></valtimo-left-sidebar>\n <valtimo-alert></valtimo-alert>\n <valtimo-page-header [hidden]=\"layoutService.isFullscreen\"></valtimo-page-header>\n <router-outlet></router-outlet>\n <valtimo-right-sidebar></valtimo-right-sidebar>\n <v-prompt></v-prompt>\n</main>\n", styles: ["::ng-deep .cds--content{padding-top:24px!important}@media screen and (max-width: 767px){.be-content{margin-left:0!important}}@media only screen and (min-width: 1056px){.cds--content--sidebar{padding-left:18rem}}\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: i2$2.RouterOutlet, selector: "router-outlet", inputs: ["name", "routerOutletData"], outputs: ["activate", "deactivate", "attach", "detach"], exportAs: ["outlet"] }, { kind: "component", type: i1.TopbarComponent, selector: "valtimo-topbar" }, { kind: "component", type: i1.LeftSidebarComponent, selector: "valtimo-left-sidebar" }, { kind: "component", type: i1.RightSidebarComponent, selector: "valtimo-right-sidebar" }, { kind: "component", type: i1.PageHeaderComponent, selector: "valtimo-page-header" }, { kind: "component", type: i1.AlertComponent, selector: "valtimo-alert" }, { kind: "directive", type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: i1.PromptComponent, selector: "v-prompt", inputs: ["appearingDelayMs", "maxWidthPx"], outputs: ["closeEvent"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }] }); }
|
|
1041
|
+
}
|
|
1042
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: LayoutInternalComponent, decorators: [{
|
|
1043
|
+
type: Component,
|
|
1044
|
+
args: [{ selector: 'valtimo-layout-internal', standalone: false, template: "<!--\n ~ Copyright 2015-2025 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<valtimo-topbar></valtimo-topbar>\n<main\n class=\"cds--content\"\n [ngClass]=\"{\n 'cds--content--sidebar':\n (sideBarExpanded$ | async) && (collapsibleWidescreenMenu$ | async) === false,\n }\"\n #mainContent\n>\n <valtimo-left-sidebar [hidden]=\"layoutService.isFullscreen\"></valtimo-left-sidebar>\n <valtimo-alert></valtimo-alert>\n <valtimo-page-header [hidden]=\"layoutService.isFullscreen\"></valtimo-page-header>\n <router-outlet></router-outlet>\n <valtimo-right-sidebar></valtimo-right-sidebar>\n <v-prompt></v-prompt>\n</main>\n", styles: ["::ng-deep .cds--content{padding-top:24px!important}@media screen and (max-width: 767px){.be-content{margin-left:0!important}}@media only screen and (min-width: 1056px){.cds--content--sidebar{padding-left:18rem}}\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"] }]
|
|
1045
|
+
}], ctorParameters: () => [{ type: LayoutService }, { type: i0.Renderer2 }, { type: i1.UserInterfaceService }, { type: i1.ShellService }], propDecorators: { mainContentRef: [{
|
|
1046
|
+
type: ViewChild,
|
|
1047
|
+
args: ['mainContent']
|
|
1048
|
+
}] } });
|
|
1049
|
+
|
|
1050
|
+
/*
|
|
1051
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
1052
|
+
*
|
|
1053
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
1054
|
+
* you may not use this file except in compliance with the License.
|
|
1055
|
+
* You may obtain a copy of the License at
|
|
1056
|
+
*
|
|
1057
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
1058
|
+
*
|
|
1059
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
1060
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
1061
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1062
|
+
* See the License for the specific language governing permissions and
|
|
1063
|
+
* limitations under the License.
|
|
1064
|
+
*/
|
|
1065
|
+
class LayoutComponent {
|
|
1066
|
+
constructor(placeHolderService, route, router) {
|
|
1067
|
+
this.placeHolderService = placeHolderService;
|
|
1068
|
+
this.route = route;
|
|
1069
|
+
this.router = router;
|
|
1070
|
+
this.layoutType = null;
|
|
1071
|
+
this._routerSub = new Subscription();
|
|
1072
|
+
this._DEFAULT_LAYOUT = 'internal';
|
|
1073
|
+
}
|
|
1074
|
+
ngOnInit() {
|
|
1075
|
+
this.openRouterSubscription();
|
|
1076
|
+
}
|
|
1077
|
+
ngAfterViewInit() {
|
|
1078
|
+
this.registerCarbonPlaceHolder();
|
|
1079
|
+
}
|
|
1080
|
+
ngOnDestroy() {
|
|
1081
|
+
this._routerSub.unsubscribe();
|
|
1082
|
+
}
|
|
1083
|
+
registerCarbonPlaceHolder() {
|
|
1084
|
+
if (this._carbonPlaceHolder) {
|
|
1085
|
+
this.placeHolderService.registerViewContainerRef(this._carbonPlaceHolder);
|
|
1086
|
+
}
|
|
1087
|
+
}
|
|
1088
|
+
openRouterSubscription() {
|
|
1089
|
+
this._routerSub.add(this.router.events.pipe(filter$1(event => event instanceof NavigationEnd)).subscribe(() => {
|
|
1090
|
+
const layout = this.route.snapshot.firstChild.data.layout;
|
|
1091
|
+
this.layoutType = layout ? layout : this._DEFAULT_LAYOUT;
|
|
1092
|
+
}));
|
|
1093
|
+
}
|
|
1094
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: LayoutComponent, deps: [{ token: i3.PlaceholderService }, { token: i2$2.ActivatedRoute }, { token: i2$2.Router }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1095
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.15", type: LayoutComponent, isStandalone: false, selector: "valtimo-layout", viewQueries: [{ propertyName: "_carbonPlaceHolder", first: true, predicate: ["carbonPlaceHolder"], descendants: true, read: ViewContainerRef, static: true }], ngImport: i0, template: "<!--\n ~ Copyright 2015-2025 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div #carbonPlaceHolder class=\"carbon-placeholder\"></div>\n\n<valtimo-global-notification></valtimo-global-notification>\n<valtimo-layout-public *ngIf=\"layoutType === 'public'\"></valtimo-layout-public>\n<valtimo-layout-internal *ngIf=\"layoutType === 'internal'\"></valtimo-layout-internal>\n", dependencies: [{ kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i2$3.GlobalNotificationComponent, selector: "valtimo-global-notification" }, { kind: "component", type: LayoutPublicComponent, selector: "valtimo-layout-public" }, { kind: "component", type: LayoutInternalComponent, selector: "valtimo-layout-internal" }] }); }
|
|
1096
|
+
}
|
|
1097
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: LayoutComponent, decorators: [{
|
|
1098
|
+
type: Component,
|
|
1099
|
+
args: [{ selector: 'valtimo-layout', standalone: false, 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 #carbonPlaceHolder class=\"carbon-placeholder\"></div>\n\n<valtimo-global-notification></valtimo-global-notification>\n<valtimo-layout-public *ngIf=\"layoutType === 'public'\"></valtimo-layout-public>\n<valtimo-layout-internal *ngIf=\"layoutType === 'internal'\"></valtimo-layout-internal>\n" }]
|
|
1100
|
+
}], ctorParameters: () => [{ type: i3.PlaceholderService }, { type: i2$2.ActivatedRoute }, { type: i2$2.Router }], propDecorators: { _carbonPlaceHolder: [{
|
|
1101
|
+
type: ViewChild,
|
|
1102
|
+
args: ['carbonPlaceHolder', { static: true, read: ViewContainerRef }]
|
|
1103
|
+
}] } });
|
|
1104
|
+
|
|
1105
|
+
/*
|
|
1106
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
1107
|
+
*
|
|
1108
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
1109
|
+
* you may not use this file except in compliance with the License.
|
|
1110
|
+
* You may obtain a copy of the License at
|
|
1111
|
+
*
|
|
1112
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
1113
|
+
*
|
|
1114
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
1115
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
1116
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1117
|
+
* See the License for the specific language governing permissions and
|
|
1118
|
+
* limitations under the License.
|
|
1119
|
+
*/
|
|
1120
|
+
|
|
1121
|
+
/*
|
|
1122
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
1123
|
+
*
|
|
1124
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
1125
|
+
* you may not use this file except in compliance with the License.
|
|
1126
|
+
* You may obtain a copy of the License at
|
|
1127
|
+
*
|
|
1128
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
1129
|
+
*
|
|
1130
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
1131
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
1132
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1133
|
+
* See the License for the specific language governing permissions and
|
|
1134
|
+
* limitations under the License.
|
|
1135
|
+
*/
|
|
1136
|
+
|
|
1137
|
+
/*
|
|
1138
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
1139
|
+
*
|
|
1140
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
1141
|
+
* you may not use this file except in compliance with the License.
|
|
1142
|
+
* You may obtain a copy of the License at
|
|
1143
|
+
*
|
|
1144
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
1145
|
+
*
|
|
1146
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
1147
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
1148
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1149
|
+
* See the License for the specific language governing permissions and
|
|
1150
|
+
* limitations under the License.
|
|
1151
|
+
*/
|
|
1152
|
+
|
|
1153
|
+
/*
|
|
1154
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
1155
|
+
*
|
|
1156
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
1157
|
+
* you may not use this file except in compliance with the License.
|
|
1158
|
+
* You may obtain a copy of the License at
|
|
1159
|
+
*
|
|
1160
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
1161
|
+
*
|
|
1162
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
1163
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
1164
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1165
|
+
* See the License for the specific language governing permissions and
|
|
1166
|
+
* limitations under the License.
|
|
1167
|
+
*/
|
|
1168
|
+
class WidgetFieldComponent {
|
|
1169
|
+
set widgetConfiguration(value) {
|
|
1170
|
+
if (!value)
|
|
1171
|
+
return;
|
|
1172
|
+
this.widgetConfiguration$.next(value);
|
|
1173
|
+
}
|
|
1174
|
+
set widgetData(value) {
|
|
1175
|
+
if (!value)
|
|
1176
|
+
return;
|
|
1177
|
+
this.widgetData$.next(value);
|
|
1178
|
+
this.isEmptyWidgetData$.next(this.checkEmptyWidgetData(value));
|
|
1179
|
+
}
|
|
1180
|
+
constructor(viewContentService) {
|
|
1181
|
+
this.viewContentService = viewContentService;
|
|
1182
|
+
this.class = 'widget-field';
|
|
1183
|
+
this.isEmptyWidgetData$ = new BehaviorSubject(false);
|
|
1184
|
+
this.noVisibleFields$ = new BehaviorSubject(true);
|
|
1185
|
+
this.renderVertically = signal(0);
|
|
1186
|
+
this.widgetConfiguration$ = new BehaviorSubject(null);
|
|
1187
|
+
this.widgetData$ = new BehaviorSubject(null);
|
|
1188
|
+
this.widgetPropertyValue$ = combineLatest([this.widgetConfiguration$, this.widgetData$]).pipe(map(([widget, widgetData]) => widget?.properties.columns.map(column => column.reduce((columnFields, property) => [
|
|
1189
|
+
...columnFields,
|
|
1190
|
+
...(widgetData?.hasOwnProperty(property.key)
|
|
1191
|
+
? [
|
|
1192
|
+
{
|
|
1193
|
+
title: property.title,
|
|
1194
|
+
ellipsisCharacterLimit: property.displayProperties
|
|
1195
|
+
?.ellipsisCharacterLimit ?? null,
|
|
1196
|
+
hideWhenEmpty: property.displayProperties?.hideWhenEmpty ?? false,
|
|
1197
|
+
value: this.viewContentService.get(widgetData[property.key], {
|
|
1198
|
+
...property.displayProperties,
|
|
1199
|
+
viewType: property.displayProperties?.type ?? ViewType.TEXT,
|
|
1200
|
+
}),
|
|
1201
|
+
isRawValue: this.viewContentService.isRawValue({
|
|
1202
|
+
...property.displayProperties,
|
|
1203
|
+
viewType: property.displayProperties?.type ?? ViewType.TEXT,
|
|
1204
|
+
}),
|
|
1205
|
+
},
|
|
1206
|
+
]
|
|
1207
|
+
: []),
|
|
1208
|
+
], []))), tap(columns => this.checkEmptyFields(columns)));
|
|
1209
|
+
}
|
|
1210
|
+
ngAfterViewInit() {
|
|
1211
|
+
if (this._widgetFieldRef)
|
|
1212
|
+
this.openWidthObserver();
|
|
1213
|
+
}
|
|
1214
|
+
ngOnDestroy() {
|
|
1215
|
+
this._observer?.disconnect();
|
|
1216
|
+
}
|
|
1217
|
+
openWidthObserver() {
|
|
1218
|
+
this._observer = new ResizeObserver(event => {
|
|
1219
|
+
this.observerMutation(event);
|
|
1220
|
+
});
|
|
1221
|
+
this._observer.observe(this._widgetFieldRef.nativeElement);
|
|
1222
|
+
}
|
|
1223
|
+
observerMutation(event) {
|
|
1224
|
+
const elementWidth = event[0]?.borderBoxSize[0]?.inlineSize;
|
|
1225
|
+
if (typeof elementWidth === 'number' && elementWidth !== 0) {
|
|
1226
|
+
if (elementWidth < 640) {
|
|
1227
|
+
this.renderVertically.set(1);
|
|
1228
|
+
}
|
|
1229
|
+
else if (elementWidth > 640 && elementWidth <= 768) {
|
|
1230
|
+
this.renderVertically.set(2);
|
|
1231
|
+
}
|
|
1232
|
+
else if (elementWidth > 768 && elementWidth <= 1080) {
|
|
1233
|
+
this.renderVertically.set(3);
|
|
1234
|
+
}
|
|
1235
|
+
else if (elementWidth > 1080) {
|
|
1236
|
+
this.renderVertically.set(4);
|
|
1237
|
+
}
|
|
1238
|
+
}
|
|
1239
|
+
}
|
|
1240
|
+
checkEmptyWidgetData(widgetData) {
|
|
1241
|
+
return widgetData && Object.keys(widgetData).length === 0;
|
|
1242
|
+
}
|
|
1243
|
+
checkEmptyFields(columns) {
|
|
1244
|
+
columns.forEach(column => {
|
|
1245
|
+
column.forEach(field => {
|
|
1246
|
+
if (!field?.hideWhenEmpty || (field?.hideWhenEmpty && field?.value && field?.value !== '-'))
|
|
1247
|
+
this.noVisibleFields$.next(false);
|
|
1248
|
+
});
|
|
1249
|
+
});
|
|
1250
|
+
}
|
|
1251
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: WidgetFieldComponent, deps: [{ token: i1.ViewContentService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1252
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.15", type: WidgetFieldComponent, isStandalone: true, selector: "valtimo-widget-field", inputs: { widgetConfiguration: "widgetConfiguration", widgetData: "widgetData" }, host: { properties: { "class": "this.class" } }, viewQueries: [{ propertyName: "_widgetFieldRef", first: true, predicate: ["widgetField"], 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<ng-container\n *ngIf=\"{\n widgetConfiguration: widgetConfiguration$ | async,\n widgetPropertyValue: widgetPropertyValue$ | async,\n widgetData: widgetData$ | async,\n isEmptyWidgetData: isEmptyWidgetData$ | async,\n noVisibleFields: noVisibleFields$ | async,\n } as obs\"\n>\n <section class=\"widget-field__header\">\n <h4 class=\"widget-field__title\">{{ obs?.widgetConfiguration?.title }}</h4>\n\n <ng-content></ng-content>\n </section>\n\n @if (obs?.isEmptyWidgetData) {\n <valtimo-no-results\n [collapseVertically]=\"true\"\n [description]=\"'widgets.noData' | translate\"\n [smallPadding]=\"true\"\n ></valtimo-no-results>\n } @else {\n <div\n #widgetField\n [ngClass]=\"{\n 'widget-field__render-vertically': renderVertically() === 1,\n 'widget-field__render-two-columns': renderVertically() === 2,\n 'widget-field__render-three-columns': renderVertically() === 3,\n 'widget-field__container': renderVertically() === 4,\n }\"\n >\n @if (obs.noVisibleFields) {\n <valtimo-no-results\n [collapseVertically]=\"true\"\n [description]=\"'widgets.emptyFields' | translate\"\n [smallPadding]=\"true\"\n ></valtimo-no-results>\n } @else {\n @for (column of obs?.widgetPropertyValue; track column.key) {\n <div class=\"widget-field__column\">\n @for (property of column; track property) {\n <div\n *ngIf=\"\n (property?.value !== null &&\n property?.value !== '-' &&\n property?.hideWhenEmpty) ||\n !property?.hideWhenEmpty\n \"\n class=\"widget-field__field\"\n >\n <label class=\"widget-field__field-label\" [attr.title]=\"property?.title\">\n {{ property?.title }}</label\n >\n\n <div [attr.title]=\"property?.value\" class=\"widget-field__field-value\">\n @if (property?.isRawValue) {\n <div [innerHTML]=\"property?.value\"></div>\n } @else {\n {{ property?.value | valtimoEllipsis: property?.ellipsisCharacterLimit }}\n }\n </div>\n </div>\n }\n </div>\n }\n }\n </div>\n }\n</ng-container>\n", styles: [".widget-field{padding:24px}.widget-field__header{display:flex;align-items:center;justify-content:space-between}.widget-field,.widget-field__column{display:flex;flex-direction:column;gap:16px;width:100%;overflow:hidden}.widget-field__title{color:var(--cds-text-primary);font-weight:600;font-size:16px;line-height:24px}.widget-field__container{display:grid;grid-gap:24px;grid-template-columns:repeat(4,1fr)}.widget-field__field{display:flex;width:100%;flex-direction:column;gap:8px}.widget-field__field-label{font-size:12px;color:var(--cds-text-secondary)}.widget-field__field-value{color:var(--cds-text-primary);padding:8px 16px;border-bottom:1px solid var(--cds-border-subtle-01);font-size:14px}.widget-field .cds--label{width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.widget-field__render-vertically,.widget-field__render-two-columns,.widget-field__render-three-columns{display:grid;align-items:stretch;gap:24px}.widget-field__render-vertically{grid-template-columns:repeat(1,1fr)}.widget-field__render-two-columns{grid-template-columns:repeat(2,1fr)}.widget-field__render-three-columns{grid-template-columns:repeat(3,1fr)}\n/*!\n * Copyright 2015-2025 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }, { kind: "ngmodule", type: InputModule }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i2$1.TranslatePipe, name: "translate" }, { kind: "ngmodule", type: CarbonListModule }, { kind: "component", type: i1.CarbonNoResultsComponent, selector: "valtimo-no-results", inputs: ["action", "description", "illustration", "title", "smallPadding", "collapseVertically", "alwaysRenderVertically"] }, { kind: "pipe", type: EllipsisPipe, name: "valtimoEllipsis" }, { kind: "ngmodule", type: ButtonModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
1253
|
+
}
|
|
1254
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: WidgetFieldComponent, decorators: [{
|
|
1255
|
+
type: Component,
|
|
1256
|
+
args: [{ selector: 'valtimo-widget-field', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, standalone: true, imports: [
|
|
1257
|
+
CommonModule,
|
|
1258
|
+
InputModule,
|
|
1259
|
+
TranslateModule,
|
|
1260
|
+
CarbonListModule,
|
|
1261
|
+
EllipsisPipe,
|
|
1262
|
+
ButtonModule,
|
|
1263
|
+
], template: "<!--\n ~ Copyright 2015-2025 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<ng-container\n *ngIf=\"{\n widgetConfiguration: widgetConfiguration$ | async,\n widgetPropertyValue: widgetPropertyValue$ | async,\n widgetData: widgetData$ | async,\n isEmptyWidgetData: isEmptyWidgetData$ | async,\n noVisibleFields: noVisibleFields$ | async,\n } as obs\"\n>\n <section class=\"widget-field__header\">\n <h4 class=\"widget-field__title\">{{ obs?.widgetConfiguration?.title }}</h4>\n\n <ng-content></ng-content>\n </section>\n\n @if (obs?.isEmptyWidgetData) {\n <valtimo-no-results\n [collapseVertically]=\"true\"\n [description]=\"'widgets.noData' | translate\"\n [smallPadding]=\"true\"\n ></valtimo-no-results>\n } @else {\n <div\n #widgetField\n [ngClass]=\"{\n 'widget-field__render-vertically': renderVertically() === 1,\n 'widget-field__render-two-columns': renderVertically() === 2,\n 'widget-field__render-three-columns': renderVertically() === 3,\n 'widget-field__container': renderVertically() === 4,\n }\"\n >\n @if (obs.noVisibleFields) {\n <valtimo-no-results\n [collapseVertically]=\"true\"\n [description]=\"'widgets.emptyFields' | translate\"\n [smallPadding]=\"true\"\n ></valtimo-no-results>\n } @else {\n @for (column of obs?.widgetPropertyValue; track column.key) {\n <div class=\"widget-field__column\">\n @for (property of column; track property) {\n <div\n *ngIf=\"\n (property?.value !== null &&\n property?.value !== '-' &&\n property?.hideWhenEmpty) ||\n !property?.hideWhenEmpty\n \"\n class=\"widget-field__field\"\n >\n <label class=\"widget-field__field-label\" [attr.title]=\"property?.title\">\n {{ property?.title }}</label\n >\n\n <div [attr.title]=\"property?.value\" class=\"widget-field__field-value\">\n @if (property?.isRawValue) {\n <div [innerHTML]=\"property?.value\"></div>\n } @else {\n {{ property?.value | valtimoEllipsis: property?.ellipsisCharacterLimit }}\n }\n </div>\n </div>\n }\n </div>\n }\n }\n </div>\n }\n</ng-container>\n", styles: [".widget-field{padding:24px}.widget-field__header{display:flex;align-items:center;justify-content:space-between}.widget-field,.widget-field__column{display:flex;flex-direction:column;gap:16px;width:100%;overflow:hidden}.widget-field__title{color:var(--cds-text-primary);font-weight:600;font-size:16px;line-height:24px}.widget-field__container{display:grid;grid-gap:24px;grid-template-columns:repeat(4,1fr)}.widget-field__field{display:flex;width:100%;flex-direction:column;gap:8px}.widget-field__field-label{font-size:12px;color:var(--cds-text-secondary)}.widget-field__field-value{color:var(--cds-text-primary);padding:8px 16px;border-bottom:1px solid var(--cds-border-subtle-01);font-size:14px}.widget-field .cds--label{width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.widget-field__render-vertically,.widget-field__render-two-columns,.widget-field__render-three-columns{display:grid;align-items:stretch;gap:24px}.widget-field__render-vertically{grid-template-columns:repeat(1,1fr)}.widget-field__render-two-columns{grid-template-columns:repeat(2,1fr)}.widget-field__render-three-columns{grid-template-columns:repeat(3,1fr)}\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"] }]
|
|
1264
|
+
}], ctorParameters: () => [{ type: i1.ViewContentService }], propDecorators: { class: [{
|
|
1265
|
+
type: HostBinding,
|
|
1266
|
+
args: ['class']
|
|
1267
|
+
}], _widgetFieldRef: [{
|
|
1268
|
+
type: ViewChild,
|
|
1269
|
+
args: ['widgetField']
|
|
1270
|
+
}], widgetConfiguration: [{
|
|
1271
|
+
type: Input
|
|
1272
|
+
}], widgetData: [{
|
|
1273
|
+
type: Input
|
|
1274
|
+
}] } });
|
|
1275
|
+
|
|
1276
|
+
/*
|
|
1277
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
1278
|
+
*
|
|
1279
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
1280
|
+
* you may not use this file except in compliance with the License.
|
|
1281
|
+
* You may obtain a copy of the License at
|
|
1282
|
+
*
|
|
1283
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
1284
|
+
*
|
|
1285
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
1286
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
1287
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1288
|
+
* See the License for the specific language governing permissions and
|
|
1289
|
+
* limitations under the License.
|
|
1290
|
+
*/
|
|
1291
|
+
|
|
1292
|
+
/*
|
|
1293
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
1294
|
+
*
|
|
1295
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
1296
|
+
* you may not use this file except in compliance with the License.
|
|
1297
|
+
* You may obtain a copy of the License at
|
|
1298
|
+
*
|
|
1299
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
1300
|
+
*
|
|
1301
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
1302
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
1303
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1304
|
+
* See the License for the specific language governing permissions and
|
|
1305
|
+
* limitations under the License.
|
|
1306
|
+
*/
|
|
1307
|
+
class TranslationManagementComponent {
|
|
1308
|
+
constructor(translateService, localizationService, pageHeaderService, document) {
|
|
1309
|
+
this.translateService = translateService;
|
|
1310
|
+
this.localizationService = localizationService;
|
|
1311
|
+
this.pageHeaderService = pageHeaderService;
|
|
1312
|
+
this.document = document;
|
|
1313
|
+
this.loading$ = new BehaviorSubject(true);
|
|
1314
|
+
this.allChangedValuesValid$ = new BehaviorSubject(false);
|
|
1315
|
+
this.disabled$ = new BehaviorSubject(false);
|
|
1316
|
+
this._languageOptions$ = new BehaviorSubject(undefined);
|
|
1317
|
+
this._refreshLocalizations$ = new BehaviorSubject(null);
|
|
1318
|
+
this._localizationTranslations$ = this._refreshLocalizations$.pipe(tap(() => this.loading$.next(true)), switchMap(() => this.localizationService.getMergedLocalizations()), tap(() => this.loading$.next(false)));
|
|
1319
|
+
this._defaultValues = [];
|
|
1320
|
+
this._changedValues$ = new BehaviorSubject(undefined);
|
|
1321
|
+
this.showConfirmationModal$ = new BehaviorSubject(false);
|
|
1322
|
+
this.valuesChanged$ = this._changedValues$.pipe(map(changedValues => !isEqual(changedValues, this._defaultValues)));
|
|
1323
|
+
this.localizationTranslationValues$ = combineLatest([
|
|
1324
|
+
this._languageOptions$,
|
|
1325
|
+
this._localizationTranslations$,
|
|
1326
|
+
this.translateService.stream('key'),
|
|
1327
|
+
]).pipe(map(([languageOptions, localizationTranslations]) => this.mapMergedLocalizationsToMultiInput(languageOptions, localizationTranslations)), tap(defaultValues => {
|
|
1328
|
+
this._defaultValues = defaultValues;
|
|
1329
|
+
}));
|
|
1330
|
+
this.multiInputTiles$ = combineLatest([
|
|
1331
|
+
this._languageOptions$,
|
|
1332
|
+
this.translateService.stream('key'),
|
|
1333
|
+
]).pipe(map(([languageOptions]) => {
|
|
1334
|
+
const objToReturn = {};
|
|
1335
|
+
objToReturn[0] = this.translateService.instant('listColumn.key');
|
|
1336
|
+
languageOptions.forEach((languageOption, index) => {
|
|
1337
|
+
objToReturn[index + 1] = this.translateService.instant(`settings.language.options.${languageOption}`);
|
|
1338
|
+
});
|
|
1339
|
+
return objToReturn;
|
|
1340
|
+
}));
|
|
1341
|
+
this.amountOfArbitraryValues$ = this.multiInputTiles$.pipe(map(multiInputTitles => Object.keys(multiInputTitles).length));
|
|
1342
|
+
this.compactMode$ = this.pageHeaderService.compactMode$;
|
|
1343
|
+
}
|
|
1344
|
+
ngOnInit() {
|
|
1345
|
+
this.setLanguages();
|
|
1346
|
+
}
|
|
1347
|
+
validChange(valid) {
|
|
1348
|
+
this.allChangedValuesValid$.next(valid);
|
|
1349
|
+
}
|
|
1350
|
+
valueChange(value) {
|
|
1351
|
+
this._changedValues$.next(value);
|
|
1352
|
+
}
|
|
1353
|
+
saveAndRefresh() {
|
|
1354
|
+
this.saveChanges(true);
|
|
1355
|
+
}
|
|
1356
|
+
saveAndStay() {
|
|
1357
|
+
this.saveChanges();
|
|
1358
|
+
}
|
|
1359
|
+
cancel() {
|
|
1360
|
+
this.hideModal();
|
|
1361
|
+
}
|
|
1362
|
+
showModal() {
|
|
1363
|
+
this.showConfirmationModal$.next(true);
|
|
1364
|
+
}
|
|
1365
|
+
saveChanges(reload = false) {
|
|
1366
|
+
this.disable();
|
|
1367
|
+
combineLatest([this._changedValues$, this._languageOptions$])
|
|
1368
|
+
.pipe(take(1), map(([changedValues, languageOptions]) => this.getLocalizationsForUpdateRequest(changedValues, languageOptions)), switchMap(updatedLocalizations => this.localizationService.updateLocalizations(updatedLocalizations)))
|
|
1369
|
+
.subscribe(() => {
|
|
1370
|
+
if (reload) {
|
|
1371
|
+
this.document?.defaultView?.location?.reload();
|
|
1372
|
+
}
|
|
1373
|
+
else {
|
|
1374
|
+
this._refreshLocalizations$.next(null);
|
|
1375
|
+
this.enable();
|
|
1376
|
+
}
|
|
1377
|
+
});
|
|
1378
|
+
}
|
|
1379
|
+
setLanguages() {
|
|
1380
|
+
this._languageOptions$.next(this.translateService.langs);
|
|
1381
|
+
}
|
|
1382
|
+
disable() {
|
|
1383
|
+
this.disabled$.next(true);
|
|
1384
|
+
}
|
|
1385
|
+
enable() {
|
|
1386
|
+
this.disabled$.next(false);
|
|
1387
|
+
}
|
|
1388
|
+
hideModal() {
|
|
1389
|
+
this.showConfirmationModal$.next(false);
|
|
1390
|
+
}
|
|
1391
|
+
flattenObject(ob) {
|
|
1392
|
+
const toReturn = {};
|
|
1393
|
+
for (const i in ob) {
|
|
1394
|
+
if (!ob.hasOwnProperty(i))
|
|
1395
|
+
continue;
|
|
1396
|
+
if (typeof ob[i] == 'object' && ob[i] !== null) {
|
|
1397
|
+
const flatObject = this.flattenObject(ob[i]);
|
|
1398
|
+
for (const x in flatObject) {
|
|
1399
|
+
if (!flatObject.hasOwnProperty(x))
|
|
1400
|
+
continue;
|
|
1401
|
+
toReturn[i + '.' + x] = flatObject[x];
|
|
1402
|
+
}
|
|
1403
|
+
}
|
|
368
1404
|
else {
|
|
369
1405
|
toReturn[i] = ob[i];
|
|
370
1406
|
}
|
|
371
1407
|
}
|
|
372
|
-
return toReturn;
|
|
1408
|
+
return toReturn;
|
|
1409
|
+
}
|
|
1410
|
+
unflattenObject(obj, delimiter = '.') {
|
|
1411
|
+
return Object.keys(obj).reduce((res, k) => {
|
|
1412
|
+
k.split(delimiter).reduce((acc, e, i, keys) => acc[e] ||
|
|
1413
|
+
(acc[e] = isNaN(Number(keys[i + 1])) ? (keys.length - 1 === i ? obj[k] : {}) : []), res);
|
|
1414
|
+
return res;
|
|
1415
|
+
}, {});
|
|
1416
|
+
}
|
|
1417
|
+
getLocalizationsForUpdateRequest(changedValues, languageOptions) {
|
|
1418
|
+
const localizations = [];
|
|
1419
|
+
const translationObject = {};
|
|
1420
|
+
languageOptions.forEach(languageOption => {
|
|
1421
|
+
translationObject[languageOption] = {};
|
|
1422
|
+
});
|
|
1423
|
+
changedValues.forEach(changedValue => {
|
|
1424
|
+
languageOptions.forEach((languageOption, index) => {
|
|
1425
|
+
translationObject[languageOption] = {
|
|
1426
|
+
...translationObject[languageOption],
|
|
1427
|
+
[changedValue[0]]: changedValue[index + 1],
|
|
1428
|
+
};
|
|
1429
|
+
});
|
|
1430
|
+
});
|
|
1431
|
+
languageOptions.forEach(languageOption => {
|
|
1432
|
+
translationObject[languageOption] = this.unflattenObject(translationObject[languageOption]);
|
|
1433
|
+
});
|
|
1434
|
+
Object.keys(translationObject).forEach(languageKey => {
|
|
1435
|
+
localizations.push({ languageKey, content: translationObject[languageKey] });
|
|
1436
|
+
});
|
|
1437
|
+
return localizations;
|
|
1438
|
+
}
|
|
1439
|
+
mapMergedLocalizationsToMultiInput(languageOptions, mergedLocalizations) {
|
|
1440
|
+
if (Object.keys(mergedLocalizations).length === 0) {
|
|
1441
|
+
return [];
|
|
1442
|
+
}
|
|
1443
|
+
const firstLanguageOption = languageOptions[0];
|
|
1444
|
+
const firstLanguageTranslations = firstLanguageOption && mergedLocalizations[firstLanguageOption];
|
|
1445
|
+
const flattenedFirstLanguageTranslations = firstLanguageTranslations && this.flattenObject(firstLanguageTranslations);
|
|
1446
|
+
return Object.keys(flattenedFirstLanguageTranslations).map(flattenedTranslationKey => {
|
|
1447
|
+
const emptyArbitraryValue = {};
|
|
1448
|
+
emptyArbitraryValue['0'] = flattenedTranslationKey;
|
|
1449
|
+
languageOptions.forEach((languageOption, index) => {
|
|
1450
|
+
emptyArbitraryValue[`${index + 1}`] =
|
|
1451
|
+
this.flattenObject(mergedLocalizations[languageOption])[flattenedTranslationKey] || '';
|
|
1452
|
+
});
|
|
1453
|
+
return emptyArbitraryValue;
|
|
1454
|
+
});
|
|
1455
|
+
}
|
|
1456
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TranslationManagementComponent, deps: [{ token: i2$1.TranslateService }, { token: i2$3.LocalizationService }, { token: i1.PageHeaderService }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1457
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.15", type: TranslationManagementComponent, isStandalone: false, selector: "valtimo-translation-management", ngImport: i0, template: "<!--\n ~ Copyright 2015-2025 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<ng-container\n *ngIf=\"{\n localizationTranslationValues: localizationTranslationValues$ | async,\n loading: loading$ | async,\n disabled: disabled$ | async,\n multiInputTitles: multiInputTiles$ | async,\n amountOfArbitraryValues: amountOfArbitraryValues$ | async,\n showConfirmationModal: showConfirmationModal$,\n allChangedValuesValid: allChangedValuesValid$ | async,\n valuesChanged: valuesChanged$ | async,\n compactMode: compactMode$ | async,\n } as obs\"\n>\n <ng-container *ngIf=\"!obs.loading && obs.localizationTranslationValues; else loading\">\n <valtimo-carbon-multi-input\n [disabled]=\"obs.disabled\"\n [arbitraryAmountTitles]=\"obs.multiInputTitles\"\n [fullWidth]=\"true\"\n [minimumAmountOfRows]=\"0\"\n type=\"arbitraryAmount\"\n [arbitraryValueAmount]=\"obs.amountOfArbitraryValues\"\n [defaultValues]=\"obs.localizationTranslationValues\"\n (allValuesValidEvent)=\"validChange($event)\"\n (valueChange)=\"valueChange($event)\"\n addRowTranslationKey=\"translationManagement.add\"\n ></valtimo-carbon-multi-input>\n </ng-container>\n\n <ng-template #loading>\n <div class=\"loading-container\"><cds-loading></cds-loading></div>\n </ng-template>\n\n <valtimo-confirmation-modal\n [showModalSubject$]=\"obs.showConfirmationModal\"\n (confirmEvent)=\"saveAndRefresh()\"\n (optionalEvent)=\"saveAndStay()\"\n (cancelEvent)=\"cancel()\"\n [showOptionalButton]=\"true\"\n cancelButtonType=\"ghost\"\n optionalButtonType=\"secondary\"\n confirmButtonTextTranslationKey=\"translationManagement.saveWithReload\"\n optionalButtonTextTranslationKey=\"translationManagement.saveWithoutReload\"\n titleTranslationKey=\"translationManagement.modalTitle\"\n contentTranslationKey=\"translationManagement.modalContent\"\n [spacerAfterCancelButton]=\"true\"\n ></valtimo-confirmation-modal>\n\n <ng-container renderInPageHeader>\n <ng-template>\n <button\n cdsButton=\"primary\"\n [size]=\"obs.compactMode ? 'sm' : 'md'\"\n (click)=\"showModal()\"\n [disabled]=\"!obs.allChangedValuesValid || obs.disabled || !obs.valuesChanged\"\n >\n {{ 'interface.save' | translate }}\n\n <svg class=\"cds--btn__icon\" cdsIcon=\"save\" size=\"16\"></svg>\n </button>\n </ng-template>\n </ng-container>\n</ng-container>\n", styles: [".loading-container{display:flex;width:100%;justify-content:center}\n/*!\n * Copyright 2015-2025 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n"], dependencies: [{ kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i1.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: i3.Loading, selector: "cds-loading, ibm-loading", inputs: ["title", "isActive", "size", "overlay"] }, { kind: "directive", type: i1.RenderInPageHeaderDirective, selector: "[renderInPageHeader]", inputs: ["fullWidth"] }, { kind: "directive", type: i3.Button, selector: "[cdsButton], [ibmButton]", inputs: ["ibmButton", "cdsButton", "size", "skeleton", "iconOnly", "isExpressive"] }, { kind: "directive", type: i3.IconDirective, selector: "[cdsIcon], [ibmIcon]", inputs: ["ibmIcon", "cdsIcon", "size", "title", "ariaLabel", "ariaLabelledBy", "ariaHidden", "isFocusable"] }, { kind: "component", type: i1.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: "pipe", type: i4.AsyncPipe, name: "async" }, { kind: "pipe", type: i2$1.TranslatePipe, name: "translate" }] }); }
|
|
1458
|
+
}
|
|
1459
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TranslationManagementComponent, decorators: [{
|
|
1460
|
+
type: Component,
|
|
1461
|
+
args: [{ selector: 'valtimo-translation-management', standalone: false, template: "<!--\n ~ Copyright 2015-2025 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<ng-container\n *ngIf=\"{\n localizationTranslationValues: localizationTranslationValues$ | async,\n loading: loading$ | async,\n disabled: disabled$ | async,\n multiInputTitles: multiInputTiles$ | async,\n amountOfArbitraryValues: amountOfArbitraryValues$ | async,\n showConfirmationModal: showConfirmationModal$,\n allChangedValuesValid: allChangedValuesValid$ | async,\n valuesChanged: valuesChanged$ | async,\n compactMode: compactMode$ | async,\n } as obs\"\n>\n <ng-container *ngIf=\"!obs.loading && obs.localizationTranslationValues; else loading\">\n <valtimo-carbon-multi-input\n [disabled]=\"obs.disabled\"\n [arbitraryAmountTitles]=\"obs.multiInputTitles\"\n [fullWidth]=\"true\"\n [minimumAmountOfRows]=\"0\"\n type=\"arbitraryAmount\"\n [arbitraryValueAmount]=\"obs.amountOfArbitraryValues\"\n [defaultValues]=\"obs.localizationTranslationValues\"\n (allValuesValidEvent)=\"validChange($event)\"\n (valueChange)=\"valueChange($event)\"\n addRowTranslationKey=\"translationManagement.add\"\n ></valtimo-carbon-multi-input>\n </ng-container>\n\n <ng-template #loading>\n <div class=\"loading-container\"><cds-loading></cds-loading></div>\n </ng-template>\n\n <valtimo-confirmation-modal\n [showModalSubject$]=\"obs.showConfirmationModal\"\n (confirmEvent)=\"saveAndRefresh()\"\n (optionalEvent)=\"saveAndStay()\"\n (cancelEvent)=\"cancel()\"\n [showOptionalButton]=\"true\"\n cancelButtonType=\"ghost\"\n optionalButtonType=\"secondary\"\n confirmButtonTextTranslationKey=\"translationManagement.saveWithReload\"\n optionalButtonTextTranslationKey=\"translationManagement.saveWithoutReload\"\n titleTranslationKey=\"translationManagement.modalTitle\"\n contentTranslationKey=\"translationManagement.modalContent\"\n [spacerAfterCancelButton]=\"true\"\n ></valtimo-confirmation-modal>\n\n <ng-container renderInPageHeader>\n <ng-template>\n <button\n cdsButton=\"primary\"\n [size]=\"obs.compactMode ? 'sm' : 'md'\"\n (click)=\"showModal()\"\n [disabled]=\"!obs.allChangedValuesValid || obs.disabled || !obs.valuesChanged\"\n >\n {{ 'interface.save' | translate }}\n\n <svg class=\"cds--btn__icon\" cdsIcon=\"save\" size=\"16\"></svg>\n </button>\n </ng-template>\n </ng-container>\n</ng-container>\n", styles: [".loading-container{display:flex;width:100%;justify-content:center}\n/*!\n * Copyright 2015-2025 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n"] }]
|
|
1462
|
+
}], ctorParameters: () => [{ type: i2$1.TranslateService }, { type: i2$3.LocalizationService }, { type: i1.PageHeaderService }, { type: Document, decorators: [{
|
|
1463
|
+
type: Inject,
|
|
1464
|
+
args: [DOCUMENT]
|
|
1465
|
+
}] }] });
|
|
1466
|
+
|
|
1467
|
+
/*
|
|
1468
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
1469
|
+
*
|
|
1470
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
1471
|
+
* you may not use this file except in compliance with the License.
|
|
1472
|
+
* You may obtain a copy of the License at
|
|
1473
|
+
*
|
|
1474
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
1475
|
+
*
|
|
1476
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
1477
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
1478
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1479
|
+
* See the License for the specific language governing permissions and
|
|
1480
|
+
* limitations under the License.
|
|
1481
|
+
*/
|
|
1482
|
+
|
|
1483
|
+
/*
|
|
1484
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
1485
|
+
*
|
|
1486
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
1487
|
+
* you may not use this file except in compliance with the License.
|
|
1488
|
+
* You may obtain a copy of the License at
|
|
1489
|
+
*
|
|
1490
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
1491
|
+
*
|
|
1492
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
1493
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
1494
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1495
|
+
* See the License for the specific language governing permissions and
|
|
1496
|
+
* limitations under the License.
|
|
1497
|
+
*/
|
|
1498
|
+
class WidgetFormioComponent {
|
|
1499
|
+
set documentId(value) {
|
|
1500
|
+
if (value)
|
|
1501
|
+
this._documentIdSubject$.next(value);
|
|
1502
|
+
}
|
|
1503
|
+
set widgetConfiguration(value) {
|
|
1504
|
+
if (!value)
|
|
1505
|
+
return;
|
|
1506
|
+
this._widgetConfigurationSubject$.next(value);
|
|
1507
|
+
}
|
|
1508
|
+
set widgetUuid(value) {
|
|
1509
|
+
this._widgetUuid = value;
|
|
1510
|
+
this._hasSignalledExternalDataReady = false;
|
|
1511
|
+
this.widgetLayoutService.setWidgetDataLoaded(value);
|
|
1512
|
+
this.widgetLayoutService.setWidgetWithExternalData(value);
|
|
1513
|
+
}
|
|
1514
|
+
set refreshForm(value) {
|
|
1515
|
+
if (value === this._refreshEmitter)
|
|
1516
|
+
return;
|
|
1517
|
+
this._refreshSubscription?.unsubscribe();
|
|
1518
|
+
this._refreshSubscription = null;
|
|
1519
|
+
this._refreshEmitter = value;
|
|
1520
|
+
if (!value)
|
|
1521
|
+
return;
|
|
1522
|
+
this._refreshSubscription = value
|
|
1523
|
+
.pipe(takeUntilDestroyed(this.destroyRef))
|
|
1524
|
+
.subscribe(() => this._refreshTrigger$.next());
|
|
1525
|
+
}
|
|
1526
|
+
get widgetConfiguration$() {
|
|
1527
|
+
return this._widgetConfigurationSubject$.pipe(filter(config => !!config));
|
|
1528
|
+
}
|
|
1529
|
+
get _documentId$() {
|
|
1530
|
+
return this._documentIdSubject$.pipe(filter(id => !!id));
|
|
1531
|
+
}
|
|
1532
|
+
constructor(formService, widgetLayoutService, destroyRef) {
|
|
1533
|
+
this.formService = formService;
|
|
1534
|
+
this.widgetLayoutService = widgetLayoutService;
|
|
1535
|
+
this.destroyRef = destroyRef;
|
|
1536
|
+
this._refreshTrigger$ = new BehaviorSubject(undefined);
|
|
1537
|
+
this._refreshEmitter = null;
|
|
1538
|
+
this._refreshSubscription = null;
|
|
1539
|
+
this._widgetUuid = null;
|
|
1540
|
+
this._hasSignalledExternalDataReady = false;
|
|
1541
|
+
this._widgetConfigurationSubject$ = new BehaviorSubject(null);
|
|
1542
|
+
this._documentIdSubject$ = new BehaviorSubject('');
|
|
1543
|
+
this.prefilledFormDefinition$ = combineLatest([
|
|
1544
|
+
this.widgetConfiguration$,
|
|
1545
|
+
this._documentId$,
|
|
1546
|
+
this._refreshTrigger$,
|
|
1547
|
+
]).pipe(switchMap(([config, documentId]) => combineLatest([
|
|
1548
|
+
this.formService.getFormDefinitionByNamePreFilled(config.properties.formDefinitionName, documentId),
|
|
1549
|
+
of(config),
|
|
1550
|
+
])), tap(() => {
|
|
1551
|
+
if (!this._widgetUuid)
|
|
1552
|
+
return;
|
|
1553
|
+
if (!this._hasSignalledExternalDataReady) {
|
|
1554
|
+
this.widgetLayoutService.setWidgetWithExternalDataReady(this._widgetUuid);
|
|
1555
|
+
this._hasSignalledExternalDataReady = true;
|
|
1556
|
+
}
|
|
1557
|
+
}), map(([formDef]) => formDef));
|
|
1558
|
+
}
|
|
1559
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: WidgetFormioComponent, deps: [{ token: i1$1.FormService }, { token: WidgetLayoutService }, { token: i0.DestroyRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1560
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.15", type: WidgetFormioComponent, isStandalone: true, selector: "valtimo-widget-formio", inputs: { documentId: "documentId", widgetConfiguration: "widgetConfiguration", widgetUuid: "widgetUuid", refreshForm: "refreshForm" }, ngImport: i0, template: "<!--\n ~ Copyright 2015-2025 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div\n class=\"formio-widget\"\n *ngIf=\"{\n prefilledFormDefinition: prefilledFormDefinition$ | async,\n widgetConfiguration: widgetConfiguration$ | async,\n } as obs\"\n>\n <section class=\"formio-widget__header\">\n <h4 class=\"formio-widget__title\">{{ obs.widgetConfiguration$?.title || '-' }}</h4>\n\n <ng-content></ng-content>\n </section>\n\n <valtimo-form-io [form]=\"obs.prefilledFormDefinition\"></valtimo-form-io>\n</div>\n", styles: [".loading-container{display:flex;width:100%;flex-direction:row;justify-content:center}.error-message{text-align:center}\n/*!\n * Copyright 2015-2025 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }, { kind: "ngmodule", type: TranslateModule }, { kind: "ngmodule", type: FormIoModule }, { kind: "component", type: i1.FormioComponent, selector: "valtimo-form-io", inputs: ["options", "submission", "form", "readOnly", "formRefresh$"], outputs: ["submit", "change", "event"] }, { kind: "ngmodule", type: ButtonModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1561
|
+
}
|
|
1562
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: WidgetFormioComponent, decorators: [{
|
|
1563
|
+
type: Component,
|
|
1564
|
+
args: [{ selector: 'valtimo-widget-formio', standalone: true, imports: [CommonModule, TranslateModule, FormIoModule, ButtonModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "<!--\n ~ Copyright 2015-2025 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div\n class=\"formio-widget\"\n *ngIf=\"{\n prefilledFormDefinition: prefilledFormDefinition$ | async,\n widgetConfiguration: widgetConfiguration$ | async,\n } as obs\"\n>\n <section class=\"formio-widget__header\">\n <h4 class=\"formio-widget__title\">{{ obs.widgetConfiguration$?.title || '-' }}</h4>\n\n <ng-content></ng-content>\n </section>\n\n <valtimo-form-io [form]=\"obs.prefilledFormDefinition\"></valtimo-form-io>\n</div>\n", styles: [".loading-container{display:flex;width:100%;flex-direction:row;justify-content:center}.error-message{text-align:center}\n/*!\n * Copyright 2015-2025 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n"] }]
|
|
1565
|
+
}], ctorParameters: () => [{ type: i1$1.FormService }, { type: WidgetLayoutService }, { type: i0.DestroyRef }], propDecorators: { documentId: [{
|
|
1566
|
+
type: Input
|
|
1567
|
+
}], widgetConfiguration: [{
|
|
1568
|
+
type: Input
|
|
1569
|
+
}], widgetUuid: [{
|
|
1570
|
+
type: Input
|
|
1571
|
+
}], refreshForm: [{
|
|
1572
|
+
type: Input
|
|
1573
|
+
}] } });
|
|
1574
|
+
|
|
1575
|
+
/*
|
|
1576
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
1577
|
+
*
|
|
1578
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
1579
|
+
* you may not use this file except in compliance with the License.
|
|
1580
|
+
* You may obtain a copy of the License at
|
|
1581
|
+
*
|
|
1582
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
1583
|
+
*
|
|
1584
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
1585
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
1586
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1587
|
+
* See the License for the specific language governing permissions and
|
|
1588
|
+
* limitations under the License.
|
|
1589
|
+
*/
|
|
1590
|
+
|
|
1591
|
+
/*
|
|
1592
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
1593
|
+
*
|
|
1594
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
1595
|
+
* you may not use this file except in compliance with the License.
|
|
1596
|
+
* You may obtain a copy of the License at
|
|
1597
|
+
*
|
|
1598
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
1599
|
+
*
|
|
1600
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
1601
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
1602
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1603
|
+
* See the License for the specific language governing permissions and
|
|
1604
|
+
* limitations under the License.
|
|
1605
|
+
*/
|
|
1606
|
+
class WidgetCollectionComponent {
|
|
1607
|
+
set widgetConfiguration(value) {
|
|
1608
|
+
if (!value)
|
|
1609
|
+
return;
|
|
1610
|
+
this.widgetConfiguration$.next(value);
|
|
1611
|
+
}
|
|
1612
|
+
get widgetData$() {
|
|
1613
|
+
return this._widgetData$.pipe(filter(data => !!data));
|
|
1614
|
+
}
|
|
1615
|
+
set widgetData(value) {
|
|
1616
|
+
if (!value)
|
|
1617
|
+
return;
|
|
1618
|
+
if (!this._initialNumberOfElements)
|
|
1619
|
+
this._initialNumberOfElements = value.numberOfElements;
|
|
1620
|
+
let widgetData = value;
|
|
1621
|
+
if (typeof value?.content?.length !== 'number')
|
|
1622
|
+
return;
|
|
1623
|
+
if (value.content.length < this._initialNumberOfElements) {
|
|
1624
|
+
const rows = new Array(this._initialNumberOfElements).fill(null);
|
|
1625
|
+
widgetData = {
|
|
1626
|
+
...value,
|
|
1627
|
+
content: rows.map((_, index) => value.content[index] || { ...value[0], hidden: true }),
|
|
1628
|
+
};
|
|
1629
|
+
}
|
|
1630
|
+
this._widgetData$.next(widgetData);
|
|
1631
|
+
if (!this._paginationInitialized) {
|
|
1632
|
+
this.showPagination$.next(value.totalElements > value.size);
|
|
1633
|
+
this.paginationModel.set(value.totalPages < 0
|
|
1634
|
+
? null
|
|
1635
|
+
: {
|
|
1636
|
+
currentPage: 1,
|
|
1637
|
+
totalDataLength: Math.ceil(value.totalElements / value.size),
|
|
1638
|
+
pageLength: value.size,
|
|
1639
|
+
});
|
|
1640
|
+
this._paginationInitialized = true;
|
|
1641
|
+
}
|
|
1642
|
+
else {
|
|
1643
|
+
this.paginationModel.update((model) => ({
|
|
1644
|
+
...model,
|
|
1645
|
+
currentPage: value.number + 1,
|
|
1646
|
+
}));
|
|
1647
|
+
}
|
|
1648
|
+
this.cdr.detectChanges();
|
|
1649
|
+
}
|
|
1650
|
+
constructor(viewContentService, cdr) {
|
|
1651
|
+
this.viewContentService = viewContentService;
|
|
1652
|
+
this.cdr = cdr;
|
|
1653
|
+
this.class = 'valtimo-widget-collection';
|
|
1654
|
+
this.showPagination$ = new BehaviorSubject(false);
|
|
1655
|
+
this._widgetData$ = new BehaviorSubject(null);
|
|
1656
|
+
this._paginationInitialized = false;
|
|
1657
|
+
this.paginationEvent = new EventEmitter();
|
|
1658
|
+
this.noVisibleFields$ = new BehaviorSubject(true);
|
|
1659
|
+
this.widgetTitle = signal('-');
|
|
1660
|
+
this.widgetConfiguration$ = new BehaviorSubject(null);
|
|
1661
|
+
this.paginationModel = signal(new PaginationModel());
|
|
1662
|
+
this.amountOfColumns = signal(0);
|
|
1663
|
+
this.collectionWidgetCards$ = combineLatest([this.widgetConfiguration$, this.widgetData$]).pipe(filter(([widgetConfig, widgetData]) => !!widgetConfig && !!widgetData), tap(([widgetConfig]) => {
|
|
1664
|
+
this.widgetTitle.set(widgetConfig.title);
|
|
1665
|
+
}), map(([widgetConfig, widgetData]) => widgetData.content.map((cardData, index) => ({
|
|
1666
|
+
hidden: cardData.hidden,
|
|
1667
|
+
key: index,
|
|
1668
|
+
title: this.getCardTitle({
|
|
1669
|
+
value: cardData.title,
|
|
1670
|
+
displayProperties: widgetConfig?.properties?.title?.displayProperties,
|
|
1671
|
+
}),
|
|
1672
|
+
fields: widgetConfig?.properties.fields.reduce((cardFieldsAccumulator, currentField) => [
|
|
1673
|
+
...cardFieldsAccumulator,
|
|
1674
|
+
this.getCardField(currentField, cardData),
|
|
1675
|
+
], []),
|
|
1676
|
+
}))), tap(card => this.checkEmptyFields(card)));
|
|
1677
|
+
}
|
|
1678
|
+
ngAfterViewInit() {
|
|
1679
|
+
this.openWidthObserver();
|
|
1680
|
+
}
|
|
1681
|
+
ngOnDestroy() {
|
|
1682
|
+
this._observer?.disconnect();
|
|
1683
|
+
}
|
|
1684
|
+
onSelectPage(page) {
|
|
1685
|
+
this.paginationEvent.emit({ ...this.paginationModel(), currentPage: page });
|
|
1686
|
+
}
|
|
1687
|
+
getCardField(field, data) {
|
|
1688
|
+
const resolvedValue = this.viewContentService.get(data.fields && field.key ? data.fields[field.key] : '', {
|
|
1689
|
+
...field.displayProperties,
|
|
1690
|
+
viewType: field.displayProperties?.type ?? WidgetDisplayTypeKey.TEXT,
|
|
1691
|
+
});
|
|
1692
|
+
return {
|
|
1693
|
+
key: field.key,
|
|
1694
|
+
title: field.title,
|
|
1695
|
+
width: field.width,
|
|
1696
|
+
value: resolvedValue || data.fields[field.key],
|
|
1697
|
+
hideWhenEmpty: field.displayProperties?.hideWhenEmpty,
|
|
1698
|
+
};
|
|
1699
|
+
}
|
|
1700
|
+
openWidthObserver() {
|
|
1701
|
+
this._observer = new ResizeObserver(event => {
|
|
1702
|
+
this.observerMutation(event);
|
|
1703
|
+
});
|
|
1704
|
+
this._observer.observe(this._widgetCollectionRef.nativeElement);
|
|
1705
|
+
}
|
|
1706
|
+
observerMutation(event) {
|
|
1707
|
+
const elementWidth = event[0]?.borderBoxSize[0]?.inlineSize;
|
|
1708
|
+
if (typeof elementWidth === 'number' && elementWidth !== 0) {
|
|
1709
|
+
if (elementWidth < 640) {
|
|
1710
|
+
this.amountOfColumns.set(1);
|
|
1711
|
+
}
|
|
1712
|
+
else if (elementWidth > 640 && elementWidth <= 768) {
|
|
1713
|
+
this.amountOfColumns.set(2);
|
|
1714
|
+
}
|
|
1715
|
+
else if (elementWidth > 768 && elementWidth <= 1080) {
|
|
1716
|
+
this.amountOfColumns.set(3);
|
|
1717
|
+
}
|
|
1718
|
+
else if (elementWidth > 1080) {
|
|
1719
|
+
this.amountOfColumns.set(4);
|
|
1720
|
+
}
|
|
1721
|
+
}
|
|
1722
|
+
}
|
|
1723
|
+
getCardTitle(collectionCaseWidgetTitle) {
|
|
1724
|
+
const widgetTitleValue = collectionCaseWidgetTitle.value;
|
|
1725
|
+
const widgetTitleDisplayProperties = collectionCaseWidgetTitle.displayProperties;
|
|
1726
|
+
if (!widgetTitleDisplayProperties && widgetTitleValue) {
|
|
1727
|
+
return widgetTitleValue;
|
|
1728
|
+
}
|
|
1729
|
+
else if (widgetTitleDisplayProperties && widgetTitleValue) {
|
|
1730
|
+
const convertedTitle = this.viewContentService.get(widgetTitleValue, {
|
|
1731
|
+
...widgetTitleDisplayProperties,
|
|
1732
|
+
viewType: widgetTitleDisplayProperties.type,
|
|
1733
|
+
hideWhenEmpty: widgetTitleDisplayProperties.hideWhenEmpty,
|
|
1734
|
+
});
|
|
1735
|
+
if (convertedTitle)
|
|
1736
|
+
return convertedTitle;
|
|
1737
|
+
}
|
|
1738
|
+
return '-';
|
|
1739
|
+
}
|
|
1740
|
+
checkEmptyFields(card) {
|
|
1741
|
+
card.forEach(collection => {
|
|
1742
|
+
collection.fields.forEach(field => {
|
|
1743
|
+
if (!field.hideWhenEmpty || (field.hideWhenEmpty && field.value && field.value !== '-'))
|
|
1744
|
+
this.noVisibleFields$.next(false);
|
|
1745
|
+
});
|
|
1746
|
+
});
|
|
1747
|
+
}
|
|
1748
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: WidgetCollectionComponent, deps: [{ token: i1.ViewContentService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1749
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.15", type: WidgetCollectionComponent, isStandalone: true, selector: "valtimo-widget-collection", inputs: { widgetConfiguration: "widgetConfiguration", widgetData: "widgetData" }, outputs: { paginationEvent: "paginationEvent" }, host: { properties: { "class": "this.class" } }, viewQueries: [{ propertyName: "_widgetCollectionRef", first: true, predicate: ["widgetCollection"], 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<ng-container\n *ngIf=\"{\n widgetConfiguration: widgetConfiguration$ | async,\n collectionWidgetCards: collectionWidgetCards$ | async,\n noVisibleFields: noVisibleFields$ | async,\n } as obs\"\n>\n <section class=\"valtimo-widget-collection__header\">\n <span class=\"valtimo-widget-collection__title\">{{ widgetTitle() }}</span>\n\n <ng-content></ng-content>\n </section>\n\n <div\n #widgetCollection\n [ngClass]=\"{\n 'valtimo-widget-collection__render-vertically': amountOfColumns() === 1,\n 'valtimo-widget-collection__render-two-columns': amountOfColumns() === 2,\n 'valtimo-widget-collection__render-three-columns': amountOfColumns() === 3,\n 'valtimo-widget-collection__container': amountOfColumns() === 4,\n }\"\n >\n @for (card of obs?.collectionWidgetCards; track card.key) {\n <div\n *ngIf=\"!obs.noVisibleFields\"\n class=\"valtimo-widget-collection__card\"\n [ngClass]=\"{'valtimo-widget-collection__card--hidden': card.hidden}\"\n >\n <span class=\"valtimo-widget-collection__card-title\">{{ card.title }}</span>\n\n @for (field of card.fields; track field.key) {\n <div\n *ngIf=\"\n (field?.value !== null && field?.value !== '-' && field?.hideWhenEmpty) ||\n !field?.hideWhenEmpty\n \"\n [ngClass]=\"{\n 'valtimo-widget-collection__full-width-input': field?.width === 'full',\n 'valtimo-widget-collection__half-width-input': field?.width === 'half',\n }\"\n >\n <cds-label class=\"valtimo-widget-collection__label\" [attr.title]=\"field?.title\">\n {{ field?.title }}\n\n <input\n [value]=\"field?.value\"\n [readonly]=\"true\"\n class=\"valtimo-widget-collection__card-input\"\n cdsText\n />\n </cds-label>\n </div>\n }\n </div>\n }\n </div>\n\n @if (obs.noVisibleFields || !obs?.collectionWidgetCards?.length) {\n <valtimo-no-results\n [collapseVertically]=\"true\"\n [description]=\"\n (obs.noVisibleFields ? 'case.widgets.emptyFields' : 'case.widgets.noData') | translate\n \"\n [smallPadding]=\"true\"\n ></valtimo-no-results>\n }\n\n <cds-pagination-nav\n *ngIf=\"paginationModel() && (showPagination$ | async)\"\n class=\"valtimo-widget-collection__pagination\"\n [model]=\"paginationModel()\"\n (selectPage)=\"onSelectPage($event)\"\n >\n </cds-pagination-nav>\n</ng-container>\n", styles: [".valtimo-widget-collection{padding:24px}.valtimo-widget-collection .cds--label{overflow:hidden;text-overflow:ellipsis;width:100%}.valtimo-widget-collection__header{display:flex;align-items:center;justify-content:space-between}.valtimo-widget-collection__title{color:var(--cds-text-primary);font-weight:600;font-size:16px;line-height:24px}.valtimo-widget-collection__container{display:flex;column-gap:16px}.valtimo-widget-collection,.valtimo-widget-collection__column{display:flex;flex-direction:column;width:100%;overflow:hidden}.valtimo-widget-collection__card{margin-top:16px;display:flex;flex-flow:row wrap;background-color:var(--cds-background);padding:16px;width:100%;gap:16px}.valtimo-widget-collection__card--hidden{visibility:hidden}.valtimo-widget-collection__card-title{color:var(--cds-text-primary);font-weight:500;font-size:14px;line-height:22px;font-style:italic;width:100%}.valtimo-widget-collection__card-input{background:transparent}.valtimo-widget-collection__full-width-input{width:100%}.valtimo-widget-collection__half-width-input{width:calc(50% - 16px);box-sizing:border-box}.valtimo-widget-collection__pagination{padding:8px 0;display:flex;justify-content:center}.valtimo-widget-collection__render-vertically,.valtimo-widget-collection__render-two-columns,.valtimo-widget-collection__render-three-columns{grid-gap:16px;align-items:stretch;overflow:hidden;text-overflow:ellipsis;width:100%}.valtimo-widget-collection__render-vertically{display:flex!important}.valtimo-widget-collection__render-two-columns{grid-template-columns:repeat(2,1fr)}.valtimo-widget-collection__render-three-columns{grid-template-columns:repeat(3,1fr)}\n/*!\n * Copyright 2015-2025 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }, { kind: "ngmodule", type: InputModule }, { kind: "component", type: i3.Label, selector: "cds-label, ibm-label", inputs: ["labelInputID", "disabled", "skeleton", "helperText", "invalidText", "invalid", "warn", "warnText", "ariaLabel"] }, { kind: "directive", type: i3.TextInput, selector: "[cdsText], [ibmText]", inputs: ["theme", "size", "invalid", "warn", "skeleton"] }, { kind: "ngmodule", type: PaginationModule }, { kind: "component", type: i3.PaginationNav, selector: "cds-pagination-nav, ibm-pagination-navm", inputs: ["model", "disabled", "numOfItemsToShow", "translations", "size"], outputs: ["selectPage"] }, { kind: "ngmodule", type: TilesModule }, { kind: "ngmodule", type: CarbonListModule }, { kind: "component", type: i1.CarbonNoResultsComponent, selector: "valtimo-no-results", inputs: ["action", "description", "illustration", "title", "smallPadding", "collapseVertically", "alwaysRenderVertically"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i2$1.TranslatePipe, name: "translate" }, { kind: "ngmodule", type: ButtonModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
1750
|
+
}
|
|
1751
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: WidgetCollectionComponent, decorators: [{
|
|
1752
|
+
type: Component,
|
|
1753
|
+
args: [{ selector: 'valtimo-widget-collection', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, standalone: true, imports: [
|
|
1754
|
+
CommonModule,
|
|
1755
|
+
InputModule,
|
|
1756
|
+
PaginationModule,
|
|
1757
|
+
TilesModule,
|
|
1758
|
+
CarbonListModule,
|
|
1759
|
+
TranslateModule,
|
|
1760
|
+
ButtonModule,
|
|
1761
|
+
], template: "<!--\n ~ Copyright 2015-2025 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<ng-container\n *ngIf=\"{\n widgetConfiguration: widgetConfiguration$ | async,\n collectionWidgetCards: collectionWidgetCards$ | async,\n noVisibleFields: noVisibleFields$ | async,\n } as obs\"\n>\n <section class=\"valtimo-widget-collection__header\">\n <span class=\"valtimo-widget-collection__title\">{{ widgetTitle() }}</span>\n\n <ng-content></ng-content>\n </section>\n\n <div\n #widgetCollection\n [ngClass]=\"{\n 'valtimo-widget-collection__render-vertically': amountOfColumns() === 1,\n 'valtimo-widget-collection__render-two-columns': amountOfColumns() === 2,\n 'valtimo-widget-collection__render-three-columns': amountOfColumns() === 3,\n 'valtimo-widget-collection__container': amountOfColumns() === 4,\n }\"\n >\n @for (card of obs?.collectionWidgetCards; track card.key) {\n <div\n *ngIf=\"!obs.noVisibleFields\"\n class=\"valtimo-widget-collection__card\"\n [ngClass]=\"{'valtimo-widget-collection__card--hidden': card.hidden}\"\n >\n <span class=\"valtimo-widget-collection__card-title\">{{ card.title }}</span>\n\n @for (field of card.fields; track field.key) {\n <div\n *ngIf=\"\n (field?.value !== null && field?.value !== '-' && field?.hideWhenEmpty) ||\n !field?.hideWhenEmpty\n \"\n [ngClass]=\"{\n 'valtimo-widget-collection__full-width-input': field?.width === 'full',\n 'valtimo-widget-collection__half-width-input': field?.width === 'half',\n }\"\n >\n <cds-label class=\"valtimo-widget-collection__label\" [attr.title]=\"field?.title\">\n {{ field?.title }}\n\n <input\n [value]=\"field?.value\"\n [readonly]=\"true\"\n class=\"valtimo-widget-collection__card-input\"\n cdsText\n />\n </cds-label>\n </div>\n }\n </div>\n }\n </div>\n\n @if (obs.noVisibleFields || !obs?.collectionWidgetCards?.length) {\n <valtimo-no-results\n [collapseVertically]=\"true\"\n [description]=\"\n (obs.noVisibleFields ? 'case.widgets.emptyFields' : 'case.widgets.noData') | translate\n \"\n [smallPadding]=\"true\"\n ></valtimo-no-results>\n }\n\n <cds-pagination-nav\n *ngIf=\"paginationModel() && (showPagination$ | async)\"\n class=\"valtimo-widget-collection__pagination\"\n [model]=\"paginationModel()\"\n (selectPage)=\"onSelectPage($event)\"\n >\n </cds-pagination-nav>\n</ng-container>\n", styles: [".valtimo-widget-collection{padding:24px}.valtimo-widget-collection .cds--label{overflow:hidden;text-overflow:ellipsis;width:100%}.valtimo-widget-collection__header{display:flex;align-items:center;justify-content:space-between}.valtimo-widget-collection__title{color:var(--cds-text-primary);font-weight:600;font-size:16px;line-height:24px}.valtimo-widget-collection__container{display:flex;column-gap:16px}.valtimo-widget-collection,.valtimo-widget-collection__column{display:flex;flex-direction:column;width:100%;overflow:hidden}.valtimo-widget-collection__card{margin-top:16px;display:flex;flex-flow:row wrap;background-color:var(--cds-background);padding:16px;width:100%;gap:16px}.valtimo-widget-collection__card--hidden{visibility:hidden}.valtimo-widget-collection__card-title{color:var(--cds-text-primary);font-weight:500;font-size:14px;line-height:22px;font-style:italic;width:100%}.valtimo-widget-collection__card-input{background:transparent}.valtimo-widget-collection__full-width-input{width:100%}.valtimo-widget-collection__half-width-input{width:calc(50% - 16px);box-sizing:border-box}.valtimo-widget-collection__pagination{padding:8px 0;display:flex;justify-content:center}.valtimo-widget-collection__render-vertically,.valtimo-widget-collection__render-two-columns,.valtimo-widget-collection__render-three-columns{grid-gap:16px;align-items:stretch;overflow:hidden;text-overflow:ellipsis;width:100%}.valtimo-widget-collection__render-vertically{display:flex!important}.valtimo-widget-collection__render-two-columns{grid-template-columns:repeat(2,1fr)}.valtimo-widget-collection__render-three-columns{grid-template-columns:repeat(3,1fr)}\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"] }]
|
|
1762
|
+
}], ctorParameters: () => [{ type: i1.ViewContentService }, { type: i0.ChangeDetectorRef }], propDecorators: { class: [{
|
|
1763
|
+
type: HostBinding,
|
|
1764
|
+
args: ['class']
|
|
1765
|
+
}], _widgetCollectionRef: [{
|
|
1766
|
+
type: ViewChild,
|
|
1767
|
+
args: ['widgetCollection']
|
|
1768
|
+
}], widgetConfiguration: [{
|
|
1769
|
+
type: Input
|
|
1770
|
+
}], widgetData: [{
|
|
1771
|
+
type: Input
|
|
1772
|
+
}], paginationEvent: [{
|
|
1773
|
+
type: Output
|
|
1774
|
+
}] } });
|
|
1775
|
+
|
|
1776
|
+
/*
|
|
1777
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
1778
|
+
*
|
|
1779
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
1780
|
+
* you may not use this file except in compliance with the License.
|
|
1781
|
+
* You may obtain a copy of the License at
|
|
1782
|
+
*
|
|
1783
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
1784
|
+
*
|
|
1785
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
1786
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
1787
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1788
|
+
* See the License for the specific language governing permissions and
|
|
1789
|
+
* limitations under the License.
|
|
1790
|
+
*/
|
|
1791
|
+
|
|
1792
|
+
/*
|
|
1793
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
1794
|
+
*
|
|
1795
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
1796
|
+
* you may not use this file except in compliance with the License.
|
|
1797
|
+
* You may obtain a copy of the License at
|
|
1798
|
+
*
|
|
1799
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
1800
|
+
*
|
|
1801
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
1802
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
1803
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1804
|
+
* See the License for the specific language governing permissions and
|
|
1805
|
+
* limitations under the License.
|
|
1806
|
+
*/
|
|
1807
|
+
class WidgetTableComponent {
|
|
1808
|
+
get widgetConfiguration() {
|
|
1809
|
+
return this._widgetConfiguration;
|
|
1810
|
+
}
|
|
1811
|
+
set widgetConfiguration(value) {
|
|
1812
|
+
this._widgetConfiguration = value;
|
|
1813
|
+
this.fields$.next(value.properties.columns.map((column, index) => ({
|
|
1814
|
+
key: column.key,
|
|
1815
|
+
label: column.title,
|
|
1816
|
+
viewType: column.displayProperties?.type ?? ViewType.TEXT,
|
|
1817
|
+
className: `valtimo-widget-table--transparent ${index === 0 && value.properties.firstColumnAsTitle ? 'valtimo-widget-table--title' : ''}`,
|
|
1818
|
+
...(!!column.displayProperties?.['format'] && {
|
|
1819
|
+
format: column.displayProperties['format'],
|
|
1820
|
+
}),
|
|
1821
|
+
...(!!column.displayProperties?.['digitsInfo'] && {
|
|
1822
|
+
digitsInfo: column.displayProperties['digitsInfo'],
|
|
1823
|
+
}),
|
|
1824
|
+
...(!!column.displayProperties?.['display'] && {
|
|
1825
|
+
display: column.displayProperties['display'],
|
|
1826
|
+
}),
|
|
1827
|
+
...(!!column.displayProperties?.['currencyCode'] && {
|
|
1828
|
+
currencyCode: column.displayProperties['currencyCode'],
|
|
1829
|
+
}),
|
|
1830
|
+
...(!!column.displayProperties?.['values'] && {
|
|
1831
|
+
values: column.displayProperties['values'],
|
|
1832
|
+
}),
|
|
1833
|
+
})));
|
|
1834
|
+
this.cdr.detectChanges();
|
|
1835
|
+
}
|
|
1836
|
+
set widgetData(value) {
|
|
1837
|
+
if (!value)
|
|
1838
|
+
return;
|
|
1839
|
+
this.showPagination.set(value.totalElements > value.size);
|
|
1840
|
+
if (!this._initialNumberOfElements)
|
|
1841
|
+
this._initialNumberOfElements = value.numberOfElements;
|
|
1842
|
+
let widgetData = value.content;
|
|
1843
|
+
if (typeof value?.content?.length !== 'number')
|
|
1844
|
+
return;
|
|
1845
|
+
if (value.content.length < this._initialNumberOfElements) {
|
|
1846
|
+
const rows = new Array(this._initialNumberOfElements).fill(null);
|
|
1847
|
+
widgetData = rows.map((_, index) => value.content[index] || { ...value[0], hidden: true });
|
|
1848
|
+
}
|
|
1849
|
+
this.widgetData$.next(widgetData);
|
|
1850
|
+
if (!this._paginationInitialized) {
|
|
1851
|
+
this.showPagination.set(value.totalElements > value.size);
|
|
1852
|
+
this.paginationModel.set(value.totalPages < 0
|
|
1853
|
+
? null
|
|
1854
|
+
: {
|
|
1855
|
+
currentPage: 1,
|
|
1856
|
+
totalDataLength: Math.ceil(value.totalElements / value.size),
|
|
1857
|
+
pageLength: value.size,
|
|
1858
|
+
});
|
|
1859
|
+
this._paginationInitialized = true;
|
|
1860
|
+
}
|
|
1861
|
+
else {
|
|
1862
|
+
this.paginationModel.update((model) => !model
|
|
1863
|
+
? null
|
|
1864
|
+
: {
|
|
1865
|
+
...model,
|
|
1866
|
+
currentPage: value.number + 1,
|
|
1867
|
+
});
|
|
1868
|
+
}
|
|
1869
|
+
this.cdr.detectChanges();
|
|
1870
|
+
}
|
|
1871
|
+
constructor(cdr) {
|
|
1872
|
+
this.cdr = cdr;
|
|
1873
|
+
this.showPagination = signal(false);
|
|
1874
|
+
this.widgetData$ = new BehaviorSubject(null);
|
|
1875
|
+
this._paginationInitialized = false;
|
|
1876
|
+
this.paginationEvent = new EventEmitter();
|
|
1877
|
+
this.fields$ = new BehaviorSubject([]);
|
|
1878
|
+
this.paginationModel = signal(new PaginationModel());
|
|
1879
|
+
}
|
|
1880
|
+
onSelectPage(page) {
|
|
1881
|
+
const paginationModel = this.paginationModel();
|
|
1882
|
+
if (!paginationModel)
|
|
1883
|
+
return;
|
|
1884
|
+
this.paginationEvent.emit({ ...paginationModel, currentPage: page });
|
|
1885
|
+
}
|
|
1886
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: WidgetTableComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1887
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.15", type: WidgetTableComponent, isStandalone: true, selector: "valtimo-widget-table", inputs: { widgetConfiguration: "widgetConfiguration", widgetData: "widgetData" }, outputs: { paginationEvent: "paginationEvent" }, ngImport: i0, template: "<!--\n ~ Copyright 2015-2025 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<cds-tile\n *ngIf=\"{\n fields: fields$ | async,\n widgetData: widgetData$ | async,\n } as obs\"\n class=\"valtimo-widget-table\"\n>\n <section class=\"valtimo-widget-table__header\">\n <span class=\"widget-title\">{{ widgetConfiguration?.title }}</span>\n\n <ng-content></ng-content>\n </section>\n\n @if (obs.widgetData && obs.fields && obs.widgetData.length) {\n <section class=\"valtimo-widget-table__content\">\n <valtimo-carbon-list\n [header]=\"false\"\n [hideToolbar]=\"true\"\n [fields]=\"obs.fields\"\n [items]=\"obs.widgetData\"\n >\n </valtimo-carbon-list>\n\n <cds-pagination-nav\n *ngIf=\"paginationModel() && showPagination()\"\n class=\"valtimo-widget-table__pagination\"\n [model]=\"paginationModel()\"\n (selectPage)=\"onSelectPage($event)\"\n >\n </cds-pagination-nav>\n </section>\n } @else {\n <valtimo-no-results\n [collapseVertically]=\"true\"\n [description]=\"'case.widgets.noData' | translate\"\n [smallPadding]=\"true\"\n ></valtimo-no-results>\n }\n</cds-tile>\n", styles: [".valtimo-widget-table{padding:24px;display:flex;flex-direction:column;gap:16px}.valtimo-widget-table__header{display:flex;align-items:center;justify-content:space-between}.valtimo-widget-table__content{display:flex;align-items:center;flex-direction:column}.valtimo-widget-table__content valtimo-carbon-list{width:100%}.valtimo-widget-table__pagination{padding:8px 0}.valtimo-widget-table .cds--data-table>thead{background:transparent!important}.valtimo-widget-table .cds--data-table td,.valtimo-widget-table .cds--data-table tr,.valtimo-widget-table .cds--data-table th{display:flex;width:100%}.valtimo-widget-table .cds--data-table td{white-space:nowrap;overflow:hidden}.valtimo-widget-table .cds--data-table td span{text-overflow:ellipsis;overflow:hidden}.valtimo-widget-table .cds--data-table tr{gap:16px}.valtimo-widget-table .cds--table-header-label>span{font-weight:400;font-size:12px;color:var(--cds-text-secondary)}.valtimo-widget-table--transparent{background:transparent!important}.valtimo-widget-table--title{border:none!important;font-style:italic}.valtimo-widget-table .widget-title{color:var(--cds-text-primary);font-weight:600;font-size:16px;line-height:24px}\n/*!\n * Copyright 2015-2025 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }, { kind: "ngmodule", type: CarbonListModule }, { kind: "component", type: i1.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: i1.CarbonNoResultsComponent, selector: "valtimo-no-results", inputs: ["action", "description", "illustration", "title", "smallPadding", "collapseVertically", "alwaysRenderVertically"] }, { kind: "ngmodule", type: PaginationModule }, { kind: "component", type: i3.PaginationNav, selector: "cds-pagination-nav, ibm-pagination-navm", inputs: ["model", "disabled", "numOfItemsToShow", "translations", "size"], outputs: ["selectPage"] }, { kind: "ngmodule", type: TilesModule }, { kind: "component", type: i3.Tile, selector: "cds-tile, ibm-tile", inputs: ["theme"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i2$1.TranslatePipe, name: "translate" }, { kind: "ngmodule", type: ButtonModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
1888
|
+
}
|
|
1889
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: WidgetTableComponent, decorators: [{
|
|
1890
|
+
type: Component,
|
|
1891
|
+
args: [{ selector: 'valtimo-widget-table', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, standalone: true, imports: [
|
|
1892
|
+
CommonModule,
|
|
1893
|
+
CarbonListModule,
|
|
1894
|
+
PaginationModule,
|
|
1895
|
+
TilesModule,
|
|
1896
|
+
TranslateModule,
|
|
1897
|
+
ButtonModule,
|
|
1898
|
+
], template: "<!--\n ~ Copyright 2015-2025 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<cds-tile\n *ngIf=\"{\n fields: fields$ | async,\n widgetData: widgetData$ | async,\n } as obs\"\n class=\"valtimo-widget-table\"\n>\n <section class=\"valtimo-widget-table__header\">\n <span class=\"widget-title\">{{ widgetConfiguration?.title }}</span>\n\n <ng-content></ng-content>\n </section>\n\n @if (obs.widgetData && obs.fields && obs.widgetData.length) {\n <section class=\"valtimo-widget-table__content\">\n <valtimo-carbon-list\n [header]=\"false\"\n [hideToolbar]=\"true\"\n [fields]=\"obs.fields\"\n [items]=\"obs.widgetData\"\n >\n </valtimo-carbon-list>\n\n <cds-pagination-nav\n *ngIf=\"paginationModel() && showPagination()\"\n class=\"valtimo-widget-table__pagination\"\n [model]=\"paginationModel()\"\n (selectPage)=\"onSelectPage($event)\"\n >\n </cds-pagination-nav>\n </section>\n } @else {\n <valtimo-no-results\n [collapseVertically]=\"true\"\n [description]=\"'case.widgets.noData' | translate\"\n [smallPadding]=\"true\"\n ></valtimo-no-results>\n }\n</cds-tile>\n", styles: [".valtimo-widget-table{padding:24px;display:flex;flex-direction:column;gap:16px}.valtimo-widget-table__header{display:flex;align-items:center;justify-content:space-between}.valtimo-widget-table__content{display:flex;align-items:center;flex-direction:column}.valtimo-widget-table__content valtimo-carbon-list{width:100%}.valtimo-widget-table__pagination{padding:8px 0}.valtimo-widget-table .cds--data-table>thead{background:transparent!important}.valtimo-widget-table .cds--data-table td,.valtimo-widget-table .cds--data-table tr,.valtimo-widget-table .cds--data-table th{display:flex;width:100%}.valtimo-widget-table .cds--data-table td{white-space:nowrap;overflow:hidden}.valtimo-widget-table .cds--data-table td span{text-overflow:ellipsis;overflow:hidden}.valtimo-widget-table .cds--data-table tr{gap:16px}.valtimo-widget-table .cds--table-header-label>span{font-weight:400;font-size:12px;color:var(--cds-text-secondary)}.valtimo-widget-table--transparent{background:transparent!important}.valtimo-widget-table--title{border:none!important;font-style:italic}.valtimo-widget-table .widget-title{color:var(--cds-text-primary);font-weight:600;font-size:16px;line-height:24px}\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"] }]
|
|
1899
|
+
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }], propDecorators: { widgetConfiguration: [{
|
|
1900
|
+
type: Input,
|
|
1901
|
+
args: [{ required: true }]
|
|
1902
|
+
}], widgetData: [{
|
|
1903
|
+
type: Input,
|
|
1904
|
+
args: [{ required: true }]
|
|
1905
|
+
}], paginationEvent: [{
|
|
1906
|
+
type: Output
|
|
1907
|
+
}] } });
|
|
1908
|
+
|
|
1909
|
+
/*
|
|
1910
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
1911
|
+
*
|
|
1912
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
1913
|
+
* you may not use this file except in compliance with the License.
|
|
1914
|
+
* You may obtain a copy of the License at
|
|
1915
|
+
*
|
|
1916
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
1917
|
+
*
|
|
1918
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
1919
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
1920
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1921
|
+
* See the License for the specific language governing permissions and
|
|
1922
|
+
* limitations under the License.
|
|
1923
|
+
*/
|
|
1924
|
+
|
|
1925
|
+
/*
|
|
1926
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
1927
|
+
*
|
|
1928
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
1929
|
+
* you may not use this file except in compliance with the License.
|
|
1930
|
+
* You may obtain a copy of the License at
|
|
1931
|
+
*
|
|
1932
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
1933
|
+
*
|
|
1934
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
1935
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
1936
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1937
|
+
* See the License for the specific language governing permissions and
|
|
1938
|
+
* limitations under the License.
|
|
1939
|
+
*/
|
|
1940
|
+
class WidgetCustomComponent {
|
|
1941
|
+
set widgetConfiguration(value) {
|
|
1942
|
+
if (!value)
|
|
1943
|
+
return;
|
|
1944
|
+
this._widgetConfigSubject$.next(value);
|
|
1945
|
+
}
|
|
1946
|
+
set widgetUuid(value) {
|
|
1947
|
+
this.widgetLayoutService.setWidgetDataLoaded(value);
|
|
1948
|
+
}
|
|
1949
|
+
get widgetConfig$() {
|
|
1950
|
+
return this._widgetConfigSubject$.pipe(filter(config => config !== null));
|
|
1951
|
+
}
|
|
1952
|
+
constructor(customWidgetConfig, cdr, widgetLayoutService, documentService, permissionService) {
|
|
1953
|
+
this.customWidgetConfig = customWidgetConfig;
|
|
1954
|
+
this.cdr = cdr;
|
|
1955
|
+
this.widgetLayoutService = widgetLayoutService;
|
|
1956
|
+
this.documentService = documentService;
|
|
1957
|
+
this.permissionService = permissionService;
|
|
1958
|
+
this._customWidgetConfig$ = new BehaviorSubject({});
|
|
1959
|
+
this._widgetConfigSubject$ = new BehaviorSubject(null);
|
|
1960
|
+
this.noCustomComponentAvailable = signal(false);
|
|
1961
|
+
this._subscriptions = new Subscription();
|
|
1962
|
+
if (customWidgetConfig)
|
|
1963
|
+
this._customWidgetConfig$.next(this.customWidgetConfig);
|
|
1964
|
+
}
|
|
1965
|
+
ngAfterViewInit() {
|
|
1966
|
+
this.openCustomWidgetSubscription();
|
|
1967
|
+
}
|
|
1968
|
+
ngOnDestroy() {
|
|
1969
|
+
this._subscriptions.unsubscribe();
|
|
1970
|
+
}
|
|
1971
|
+
openCustomWidgetSubscription() {
|
|
1972
|
+
this._subscriptions.add(combineLatest([this.widgetConfig$, this._customWidgetConfig$]).subscribe(([widgetConfig, customCaseWidgetConfig]) => {
|
|
1973
|
+
const customWidgetComponentKey = widgetConfig?.properties?.componentKey;
|
|
1974
|
+
const customComponent = customCaseWidgetConfig[customWidgetComponentKey];
|
|
1975
|
+
if (!customComponent) {
|
|
1976
|
+
this.noCustomComponentAvailable.set(true);
|
|
1977
|
+
return;
|
|
1978
|
+
}
|
|
1979
|
+
const componentRef = this._customWidgetContainerRef.createComponent(customComponent);
|
|
1980
|
+
componentRef.changeDetectorRef.detectChanges();
|
|
1981
|
+
this.cdr.detectChanges();
|
|
1982
|
+
}));
|
|
1983
|
+
}
|
|
1984
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: WidgetCustomComponent, deps: [{ token: CUSTOM_WIDGET_TOKEN, optional: true }, { token: i0.ChangeDetectorRef }, { token: WidgetLayoutService }, { token: i2$4.DocumentService }, { token: i3$1.PermissionService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1985
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.15", type: WidgetCustomComponent, isStandalone: true, selector: "valtimo-widget-custom", inputs: { widgetConfiguration: "widgetConfiguration", widgetUuid: "widgetUuid" }, viewQueries: [{ propertyName: "_customWidgetContainerRef", first: true, predicate: ["customWidgetContainer"], descendants: true, read: ViewContainerRef }], 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 *ngIf=\"{widgetConfig: widgetConfig$ | async} as obs\" class=\"custom-widget\">\n <section class=\"custom-widget__header\">\n <h4 class=\"custom-widget__title\">{{ obs.widgetConfig$?.title || '-' }}</h4>\n\n <ng-content></ng-content>\n </section>\n\n <div class=\"custom-widget__content\">\n <ng-template #customWidgetContainer></ng-template>\n\n @if (noCustomComponentAvailable()) {\n <valtimo-no-results\n [collapseVertically]=\"true\"\n [description]=\"'case.widgets.noCustomComponentDescription' | translate\"\n [smallPadding]=\"true\"\n ></valtimo-no-results>\n }\n </div>\n</div>\n", styles: [".custom-widget{padding:24px}.custom-widget__header{display:flex;align-items:center;justify-content:space-between}.custom-widget__title{color:var(--cds-text-primary);font-weight:600;font-size:16px;line-height:24px}\n/*!\n * Copyright 2015-2025 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }, { kind: "ngmodule", type: CarbonListModule }, { kind: "component", type: i1.CarbonNoResultsComponent, selector: "valtimo-no-results", inputs: ["action", "description", "illustration", "title", "smallPadding", "collapseVertically", "alwaysRenderVertically"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i2$1.TranslatePipe, name: "translate" }, { kind: "ngmodule", type: ButtonModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1986
|
+
}
|
|
1987
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: WidgetCustomComponent, decorators: [{
|
|
1988
|
+
type: Component,
|
|
1989
|
+
args: [{ selector: 'valtimo-widget-custom', standalone: true, imports: [CommonModule, CarbonListModule, TranslateModule, ButtonModule], changeDetection: ChangeDetectionStrategy.OnPush, 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 *ngIf=\"{widgetConfig: widgetConfig$ | async} as obs\" class=\"custom-widget\">\n <section class=\"custom-widget__header\">\n <h4 class=\"custom-widget__title\">{{ obs.widgetConfig$?.title || '-' }}</h4>\n\n <ng-content></ng-content>\n </section>\n\n <div class=\"custom-widget__content\">\n <ng-template #customWidgetContainer></ng-template>\n\n @if (noCustomComponentAvailable()) {\n <valtimo-no-results\n [collapseVertically]=\"true\"\n [description]=\"'case.widgets.noCustomComponentDescription' | translate\"\n [smallPadding]=\"true\"\n ></valtimo-no-results>\n }\n </div>\n</div>\n", styles: [".custom-widget{padding:24px}.custom-widget__header{display:flex;align-items:center;justify-content:space-between}.custom-widget__title{color:var(--cds-text-primary);font-weight:600;font-size:16px;line-height:24px}\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"] }]
|
|
1990
|
+
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
1991
|
+
type: Optional
|
|
1992
|
+
}, {
|
|
1993
|
+
type: Inject,
|
|
1994
|
+
args: [CUSTOM_WIDGET_TOKEN]
|
|
1995
|
+
}] }, { type: i0.ChangeDetectorRef }, { type: WidgetLayoutService }, { type: i2$4.DocumentService }, { type: i3$1.PermissionService }], propDecorators: { _customWidgetContainerRef: [{
|
|
1996
|
+
type: ViewChild,
|
|
1997
|
+
args: ['customWidgetContainer', { read: ViewContainerRef }]
|
|
1998
|
+
}], widgetConfiguration: [{
|
|
1999
|
+
type: Input
|
|
2000
|
+
}], widgetUuid: [{
|
|
2001
|
+
type: Input
|
|
2002
|
+
}] } });
|
|
2003
|
+
|
|
2004
|
+
/*
|
|
2005
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
2006
|
+
*
|
|
2007
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
2008
|
+
* you may not use this file except in compliance with the License.
|
|
2009
|
+
* You may obtain a copy of the License at
|
|
2010
|
+
*
|
|
2011
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
2012
|
+
*
|
|
2013
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
2014
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
2015
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2016
|
+
* See the License for the specific language governing permissions and
|
|
2017
|
+
* limitations under the License.
|
|
2018
|
+
*/
|
|
2019
|
+
|
|
2020
|
+
/*
|
|
2021
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
2022
|
+
*
|
|
2023
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
2024
|
+
* you may not use this file except in compliance with the License.
|
|
2025
|
+
* You may obtain a copy of the License at
|
|
2026
|
+
*
|
|
2027
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
2028
|
+
*
|
|
2029
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
2030
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
2031
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2032
|
+
* See the License for the specific language governing permissions and
|
|
2033
|
+
* limitations under the License.
|
|
2034
|
+
*/
|
|
2035
|
+
class WidgetBlockComponent {
|
|
2036
|
+
set widget(value) {
|
|
2037
|
+
this._widgetUuid = value.uuid;
|
|
2038
|
+
this._widget$.next(value);
|
|
2039
|
+
}
|
|
2040
|
+
get widget$() {
|
|
2041
|
+
return this._widget$.pipe(filter(widget => widget !== null));
|
|
2042
|
+
}
|
|
2043
|
+
get _viewContainerRef$() {
|
|
2044
|
+
return this._viewContainerRefSubject$.pipe(filter(ref => !!ref));
|
|
2045
|
+
}
|
|
2046
|
+
constructor(widgetLayoutService, route, cdsThemeService, renderer, viewRef) {
|
|
2047
|
+
this.widgetLayoutService = widgetLayoutService;
|
|
2048
|
+
this.route = route;
|
|
2049
|
+
this.cdsThemeService = cdsThemeService;
|
|
2050
|
+
this.renderer = renderer;
|
|
2051
|
+
this.viewRef = viewRef;
|
|
2052
|
+
this._widget$ = new BehaviorSubject(null);
|
|
2053
|
+
this._viewContainerRefSubject$ = new BehaviorSubject(null);
|
|
2054
|
+
this._contentHeight$ = new BehaviorSubject(0);
|
|
2055
|
+
this.blockHeightPx$ = combineLatest([
|
|
2056
|
+
this._contentHeight$,
|
|
2057
|
+
this._viewContainerRef$,
|
|
2058
|
+
]).pipe(filter(([contentHeight]) => contentHeight !== 0), tap(([contentHeight, viewRef]) => {
|
|
2059
|
+
const blockHeight = Math.ceil((contentHeight + 16) / WIDGET_HEIGHT_1X) * WIDGET_HEIGHT_1X;
|
|
2060
|
+
this.renderer.setStyle(viewRef.element.nativeElement, 'height', `${blockHeight}px`);
|
|
2061
|
+
this.widgetLayoutService.triggerMuuriLayout();
|
|
2062
|
+
}));
|
|
2063
|
+
this.blockWidthPercentage$ = combineLatest([
|
|
2064
|
+
this.widgetLayoutService.amountOfColumns$,
|
|
2065
|
+
this.widget$,
|
|
2066
|
+
this._viewContainerRef$,
|
|
2067
|
+
]).pipe(tap(([amountOfColumns, widget, viewRef]) => {
|
|
2068
|
+
const percentage = widget.width > amountOfColumns ? 100 : (widget.width / amountOfColumns) * 100;
|
|
2069
|
+
this.renderer.setStyle(viewRef.element.nativeElement, 'width', `${percentage}%`);
|
|
2070
|
+
this.widgetLayoutService.triggerMuuriLayout();
|
|
2071
|
+
}));
|
|
2072
|
+
this.documentId$ = this.route.params.pipe(map(params => params?.documentId), filter(documentId => !!documentId));
|
|
2073
|
+
this.theme$ = combineLatest([this.cdsThemeService.currentTheme$, this.widget$]).pipe(map(([currentTheme, widgetConfiguration]) => {
|
|
2074
|
+
return currentTheme === CurrentCarbonTheme.G10
|
|
2075
|
+
? widgetConfiguration.highContrast
|
|
2076
|
+
? CARBON_THEME.G100
|
|
2077
|
+
: CARBON_THEME.G10
|
|
2078
|
+
: widgetConfiguration.highContrast
|
|
2079
|
+
? CARBON_THEME.WHITE
|
|
2080
|
+
: CARBON_THEME.G90;
|
|
2081
|
+
}));
|
|
2082
|
+
this._subscriptions = new Subscription();
|
|
2083
|
+
}
|
|
2084
|
+
ngAfterViewInit() {
|
|
2085
|
+
this._viewContainerRefSubject$.next(this.viewRef);
|
|
2086
|
+
this.openContentHeightObserver();
|
|
2087
|
+
this.openWidgetComponentSubscription();
|
|
2088
|
+
}
|
|
2089
|
+
ngOnDestroy() {
|
|
2090
|
+
this._subscriptions.unsubscribe();
|
|
2091
|
+
this._observer?.disconnect();
|
|
2092
|
+
}
|
|
2093
|
+
openContentHeightObserver() {
|
|
2094
|
+
this._observer = new ResizeObserver(event => {
|
|
2095
|
+
this.observerMutation(event);
|
|
2096
|
+
});
|
|
2097
|
+
this._observer.observe(this._widgetBlockContentRef.nativeElement);
|
|
2098
|
+
}
|
|
2099
|
+
observerMutation(event) {
|
|
2100
|
+
const widgetContentHeight = event[0]?.borderBoxSize[0]?.blockSize;
|
|
2101
|
+
if (typeof widgetContentHeight === 'number' && widgetContentHeight !== 0) {
|
|
2102
|
+
this._contentHeight$.next(widgetContentHeight);
|
|
2103
|
+
}
|
|
2104
|
+
}
|
|
2105
|
+
openWidgetComponentSubscription() {
|
|
2106
|
+
this._subscriptions.add(combineLatest([this.widget$, this.documentId$.pipe(startWith(null))]).subscribe(([widget, documentId]) => {
|
|
2107
|
+
const component = this.widgetComponentMap[widget.type];
|
|
2108
|
+
if (!component)
|
|
2109
|
+
return;
|
|
2110
|
+
this.dynamicContainer.clear();
|
|
2111
|
+
const componentRef = this.dynamicContainer.createComponent(component);
|
|
2112
|
+
if (documentId)
|
|
2113
|
+
componentRef.instance.documentId = documentId;
|
|
2114
|
+
componentRef.instance.widgetConfiguration = widget;
|
|
2115
|
+
componentRef.instance.widgetUuid = widget.uuid;
|
|
2116
|
+
componentRef.instance.widgetParams = this.widgetParams;
|
|
2117
|
+
}));
|
|
2118
|
+
}
|
|
2119
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: WidgetBlockComponent, deps: [{ token: WidgetLayoutService }, { token: i2$2.ActivatedRoute }, { token: i1.CdsThemeService }, { token: i0.Renderer2 }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2120
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.15", type: WidgetBlockComponent, isStandalone: true, selector: "valtimo-widget-block", inputs: { widget: "widget", widgetComponentMap: "widgetComponentMap", widgetParams: "widgetParams" }, viewQueries: [{ propertyName: "_widgetBlockContentRef", first: true, predicate: ["widgetBlockContent"], descendants: true }, { propertyName: "dynamicContainer", first: true, predicate: ["widgetComponent"], descendants: true, read: ViewContainerRef, static: true }], ngImport: i0, template: "<!--\n ~ Copyright 2015-2025 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div class=\"widget-block\" [attr.data-carbon-theme]=\"theme$ | async\">\n <div #widgetBlockContent class=\"widget-block__content\">\n <ng-template #widgetComponent></ng-template>\n </div>\n</div>\n\n<ng-container\n *ngIf=\"{\n documentId: documentId$ | async,\n widgetConfiguration: widget$ | async,\n theme: theme$ | async,\n blockHeightPx: blockHeightPx$ | async,\n blockWidthPercentage: blockWidthPercentage$ | async,\n } as obs\"\n></ng-container>\n", styles: [":host{display:block;position:absolute}.widget-block{width:100%;height:100%;box-sizing:border-box;padding:8px;overflow-wrap:break-word;background-color:var(--cds-layer-01);background-clip:content-box}.widget-block__not-available{padding:16px}\n/*!\n * Copyright 2015-2025 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }, { kind: "ngmodule", type: LoadingModule }, { kind: "ngmodule", type: CarbonListModule }, { kind: "ngmodule", type: TranslateModule }, { kind: "ngmodule", type: TilesModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
2121
|
+
}
|
|
2122
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: WidgetBlockComponent, decorators: [{
|
|
2123
|
+
type: Component,
|
|
2124
|
+
args: [{ selector: 'valtimo-widget-block', standalone: true, imports: [CommonModule, LoadingModule, CarbonListModule, TranslateModule, TilesModule], changeDetection: ChangeDetectionStrategy.OnPush, 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=\"widget-block\" [attr.data-carbon-theme]=\"theme$ | async\">\n <div #widgetBlockContent class=\"widget-block__content\">\n <ng-template #widgetComponent></ng-template>\n </div>\n</div>\n\n<ng-container\n *ngIf=\"{\n documentId: documentId$ | async,\n widgetConfiguration: widget$ | async,\n theme: theme$ | async,\n blockHeightPx: blockHeightPx$ | async,\n blockWidthPercentage: blockWidthPercentage$ | async,\n } as obs\"\n></ng-container>\n", styles: [":host{display:block;position:absolute}.widget-block{width:100%;height:100%;box-sizing:border-box;padding:8px;overflow-wrap:break-word;background-color:var(--cds-layer-01);background-clip:content-box}.widget-block__not-available{padding:16px}\n/*!\n * Copyright 2015-2025 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n"] }]
|
|
2125
|
+
}], ctorParameters: () => [{ type: WidgetLayoutService }, { type: i2$2.ActivatedRoute }, { type: i1.CdsThemeService }, { type: i0.Renderer2 }, { type: i0.ViewContainerRef }], propDecorators: { _widgetBlockContentRef: [{
|
|
2126
|
+
type: ViewChild,
|
|
2127
|
+
args: ['widgetBlockContent']
|
|
2128
|
+
}], dynamicContainer: [{
|
|
2129
|
+
type: ViewChild,
|
|
2130
|
+
args: ['widgetComponent', { static: true, read: ViewContainerRef }]
|
|
2131
|
+
}], widget: [{
|
|
2132
|
+
type: Input
|
|
2133
|
+
}], widgetComponentMap: [{
|
|
2134
|
+
type: Input
|
|
2135
|
+
}], widgetParams: [{
|
|
2136
|
+
type: Input,
|
|
2137
|
+
args: [{ required: false }]
|
|
2138
|
+
}] } });
|
|
2139
|
+
|
|
2140
|
+
/*
|
|
2141
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
2142
|
+
*
|
|
2143
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
2144
|
+
* you may not use this file except in compliance with the License.
|
|
2145
|
+
* You may obtain a copy of the License at
|
|
2146
|
+
*
|
|
2147
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
2148
|
+
*
|
|
2149
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
2150
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
2151
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2152
|
+
* See the License for the specific language governing permissions and
|
|
2153
|
+
* limitations under the License.
|
|
2154
|
+
*/
|
|
2155
|
+
|
|
2156
|
+
/*
|
|
2157
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
2158
|
+
*
|
|
2159
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
2160
|
+
* you may not use this file except in compliance with the License.
|
|
2161
|
+
* You may obtain a copy of the License at
|
|
2162
|
+
*
|
|
2163
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
2164
|
+
*
|
|
2165
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
2166
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
2167
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2168
|
+
* See the License for the specific language governing permissions and
|
|
2169
|
+
* limitations under the License.
|
|
2170
|
+
*/
|
|
2171
|
+
class WidgetContainerComponent {
|
|
2172
|
+
set widgets(value) {
|
|
2173
|
+
if (!value)
|
|
2174
|
+
return;
|
|
2175
|
+
const widgetsWithUuids = value.map(widget => ({ ...widget, uuid: v4() }));
|
|
2176
|
+
this.resetLayout();
|
|
2177
|
+
this.widgetLayoutService.setWidgets(widgetsWithUuids);
|
|
2178
|
+
this.widgetsWithUuids$.next(widgetsWithUuids);
|
|
2179
|
+
this.loadingWidgetConfiguration$.next(false);
|
|
2180
|
+
this.initLayout();
|
|
2181
|
+
}
|
|
2182
|
+
get widgetComponentMap$() {
|
|
2183
|
+
return this._widgetComponentMap$.pipe(filter$1(componentMap => componentMap !== null));
|
|
2184
|
+
}
|
|
2185
|
+
set widgetComponentMap(value) {
|
|
2186
|
+
this._widgetComponentMap$.next({ ...DEFAULT_WIDGET_COMPONENT_MAP, ...value });
|
|
2187
|
+
}
|
|
2188
|
+
constructor(widgetLayoutService) {
|
|
2189
|
+
this.widgetLayoutService = widgetLayoutService;
|
|
2190
|
+
this.widgetsWithUuids$ = new BehaviorSubject(null);
|
|
2191
|
+
this._widgetComponentMap$ = new BehaviorSubject(DEFAULT_WIDGET_COMPONENT_MAP);
|
|
2192
|
+
this.widgetParams = {};
|
|
2193
|
+
this.loadingWidgetConfiguration$ = new BehaviorSubject(true);
|
|
2194
|
+
this.reload$ = new BehaviorSubject(false);
|
|
2195
|
+
this.loaded$ = merge(this.reload$, this.widgetLayoutService.loaded$.pipe(delay(400)));
|
|
2196
|
+
}
|
|
2197
|
+
resetLayout() {
|
|
2198
|
+
if (!this._observer)
|
|
2199
|
+
return;
|
|
2200
|
+
this.reload$.next(false);
|
|
2201
|
+
this.destroyLayout();
|
|
2202
|
+
}
|
|
2203
|
+
destroyLayout() {
|
|
2204
|
+
this.widgetLayoutService.reset();
|
|
2205
|
+
this._observer?.disconnect();
|
|
2206
|
+
}
|
|
2207
|
+
initLayout() {
|
|
2208
|
+
this._observer = new ResizeObserver(event => {
|
|
2209
|
+
this.observerMutation(event);
|
|
2210
|
+
});
|
|
2211
|
+
this._observer.observe(this._widgetsContainerRef.nativeElement);
|
|
2212
|
+
this.initMuuri();
|
|
2213
|
+
}
|
|
2214
|
+
ngOnDestroy() {
|
|
2215
|
+
this.destroyLayout();
|
|
2216
|
+
}
|
|
2217
|
+
observerMutation(event) {
|
|
2218
|
+
const containerWidth = event[0]?.borderBoxSize[0]?.inlineSize;
|
|
2219
|
+
if (typeof containerWidth === 'number' && containerWidth !== 0) {
|
|
2220
|
+
this.widgetLayoutService.setContainerWidth(containerWidth);
|
|
2221
|
+
this.widgetLayoutService.triggerMuuriLayout();
|
|
2222
|
+
}
|
|
2223
|
+
}
|
|
2224
|
+
initMuuri() {
|
|
2225
|
+
this.widgetLayoutService.loaded$.pipe(take(1), delay(300)).subscribe(() => {
|
|
2226
|
+
this.widgetLayoutService.setMuuri(new Muuri(this._widgetsContainerRef.nativeElement, {
|
|
2227
|
+
layout: {
|
|
2228
|
+
fillGaps: true,
|
|
2229
|
+
},
|
|
2230
|
+
layoutOnResize: false,
|
|
2231
|
+
}));
|
|
2232
|
+
});
|
|
2233
|
+
}
|
|
2234
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: WidgetContainerComponent, deps: [{ token: WidgetLayoutService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2235
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.15", type: WidgetContainerComponent, isStandalone: true, selector: "valtimo-widget-container", inputs: { widgets: "widgets", widgetComponentMap: "widgetComponentMap", widgetParams: "widgetParams" }, viewQueries: [{ propertyName: "_widgetsContainerRef", first: true, predicate: ["widgetsContainer"], 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<ng-container\n *ngIf=\"{\n loadingWidgetConfiguration: loadingWidgetConfiguration$ | async,\n widgets: widgetsWithUuids$ | async,\n loaded: loaded$ | async,\n } as obs\"\n>\n <ng-container\n *ngIf=\"{\n noWidgetsConfigured: obs.widgets && obs.widgets.length === 0,\n } as vars\"\n >\n @if (!obs.loaded && !vars.noWidgetsConfigured) {\n <div class=\"loading-container\">\n <cds-loading></cds-loading>\n </div>\n }\n\n @if (vars.noWidgetsConfigured) {\n <valtimo-no-results\n [title]=\"'case.widgets.noWidgets' | translate\"\n [description]=\"'case.widgets.noWidgetsDescription' | translate\"\n illustration=\"valtimo-layout/img/no-widgets.svg\"\n ></valtimo-no-results>\n }\n\n <div [style.visibility]=\"!obs.loaded ? 'hidden' : 'visible'\">\n <div #widgetsContainer class=\"widgets-container\">\n @for (widget of (widgetsWithUuids$ | async) || []; track widget.uuid) {\n <valtimo-widget-block\n [widget]=\"widget\"\n [widgetComponentMap]=\"widgetComponentMap$ | async\"\n [widgetParams]=\"widgetParams\"\n ></valtimo-widget-block>\n }\n </div>\n </div>\n </ng-container>\n</ng-container>\n", styles: [".widgets-container{position:relative;width:calc(100% + 16px);margin-left:-8px;margin-top:-8px;padding-bottom:32px;box-sizing:content-box}.loading-container{display:flex;justify-content:center;padding:16px 0}\n/*!\n * Copyright 2015-2025 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }, { kind: "component", type: WidgetBlockComponent, selector: "valtimo-widget-block", inputs: ["widget", "widgetComponentMap", "widgetParams"] }, { kind: "ngmodule", type: LoadingModule }, { kind: "component", type: i3.Loading, selector: "cds-loading, ibm-loading", inputs: ["title", "isActive", "size", "overlay"] }, { kind: "ngmodule", type: CarbonListModule }, { kind: "component", type: i1.CarbonNoResultsComponent, selector: "valtimo-no-results", inputs: ["action", "description", "illustration", "title", "smallPadding", "collapseVertically", "alwaysRenderVertically"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
2236
|
+
}
|
|
2237
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: WidgetContainerComponent, decorators: [{
|
|
2238
|
+
type: Component,
|
|
2239
|
+
args: [{ selector: 'valtimo-widget-container', standalone: true, imports: [CommonModule, WidgetBlockComponent, LoadingModule, CarbonListModule, TranslatePipe], changeDetection: ChangeDetectionStrategy.OnPush, template: "<!--\n ~ Copyright 2015-2025 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<ng-container\n *ngIf=\"{\n loadingWidgetConfiguration: loadingWidgetConfiguration$ | async,\n widgets: widgetsWithUuids$ | async,\n loaded: loaded$ | async,\n } as obs\"\n>\n <ng-container\n *ngIf=\"{\n noWidgetsConfigured: obs.widgets && obs.widgets.length === 0,\n } as vars\"\n >\n @if (!obs.loaded && !vars.noWidgetsConfigured) {\n <div class=\"loading-container\">\n <cds-loading></cds-loading>\n </div>\n }\n\n @if (vars.noWidgetsConfigured) {\n <valtimo-no-results\n [title]=\"'case.widgets.noWidgets' | translate\"\n [description]=\"'case.widgets.noWidgetsDescription' | translate\"\n illustration=\"valtimo-layout/img/no-widgets.svg\"\n ></valtimo-no-results>\n }\n\n <div [style.visibility]=\"!obs.loaded ? 'hidden' : 'visible'\">\n <div #widgetsContainer class=\"widgets-container\">\n @for (widget of (widgetsWithUuids$ | async) || []; track widget.uuid) {\n <valtimo-widget-block\n [widget]=\"widget\"\n [widgetComponentMap]=\"widgetComponentMap$ | async\"\n [widgetParams]=\"widgetParams\"\n ></valtimo-widget-block>\n }\n </div>\n </div>\n </ng-container>\n</ng-container>\n", styles: [".widgets-container{position:relative;width:calc(100% + 16px);margin-left:-8px;margin-top:-8px;padding-bottom:32px;box-sizing:content-box}.loading-container{display:flex;justify-content:center;padding:16px 0}\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"] }]
|
|
2240
|
+
}], ctorParameters: () => [{ type: WidgetLayoutService }], propDecorators: { _widgetsContainerRef: [{
|
|
2241
|
+
type: ViewChild,
|
|
2242
|
+
args: ['widgetsContainer']
|
|
2243
|
+
}], widgets: [{
|
|
2244
|
+
type: Input
|
|
2245
|
+
}], widgetComponentMap: [{
|
|
2246
|
+
type: Input
|
|
2247
|
+
}], widgetParams: [{
|
|
2248
|
+
type: Input,
|
|
2249
|
+
args: [{ required: false }]
|
|
2250
|
+
}] } });
|
|
2251
|
+
|
|
2252
|
+
/*
|
|
2253
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
2254
|
+
*
|
|
2255
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
2256
|
+
* you may not use this file except in compliance with the License.
|
|
2257
|
+
* You may obtain a copy of the License at
|
|
2258
|
+
*
|
|
2259
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
2260
|
+
*
|
|
2261
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
2262
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
2263
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2264
|
+
* See the License for the specific language governing permissions and
|
|
2265
|
+
* limitations under the License.
|
|
2266
|
+
*/
|
|
2267
|
+
|
|
2268
|
+
/*
|
|
2269
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
2270
|
+
*
|
|
2271
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
2272
|
+
* you may not use this file except in compliance with the License.
|
|
2273
|
+
* You may obtain a copy of the License at
|
|
2274
|
+
*
|
|
2275
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
2276
|
+
*
|
|
2277
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
2278
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
2279
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2280
|
+
* See the License for the specific language governing permissions and
|
|
2281
|
+
* limitations under the License.
|
|
2282
|
+
*/
|
|
2283
|
+
class WidgetWizardContentStepComponent {
|
|
2284
|
+
constructor(cdr, widgetWizardService) {
|
|
2285
|
+
this.cdr = cdr;
|
|
2286
|
+
this.widgetWizardService = widgetWizardService;
|
|
2287
|
+
this.contentValidEvent = new EventEmitter();
|
|
2288
|
+
}
|
|
2289
|
+
ngOnInit() {
|
|
2290
|
+
this.renderComponent();
|
|
2291
|
+
}
|
|
2292
|
+
renderComponent() {
|
|
2293
|
+
this._vcr.clear();
|
|
2294
|
+
const $widget = this.widgetWizardService.$selectedWidget();
|
|
2295
|
+
if (!$widget)
|
|
2296
|
+
return;
|
|
2297
|
+
const componentInstance = this._vcr.createComponent($widget.component).instance;
|
|
2298
|
+
if (!componentInstance)
|
|
2299
|
+
return;
|
|
2300
|
+
componentInstance.changeValidEvent.subscribe((valid) => this.contentValidEvent.emit(valid));
|
|
2301
|
+
this.cdr.detectChanges();
|
|
2302
|
+
}
|
|
2303
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: WidgetWizardContentStepComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: WidgetWizardService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2304
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.15", type: WidgetWizardContentStepComponent, isStandalone: true, selector: "valtimo-widget-wizard-content-step", outputs: { contentValidEvent: "contentValidEvent" }, viewQueries: [{ propertyName: "_vcr", first: true, predicate: ["contentRenderer"], descendants: true, read: ViewContainerRef, static: 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<ng-template #contentRenderer></ng-template>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
2305
|
+
}
|
|
2306
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: WidgetWizardContentStepComponent, decorators: [{
|
|
2307
|
+
type: Component,
|
|
2308
|
+
args: [{ selector: 'valtimo-widget-wizard-content-step', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, standalone: true, imports: [CommonModule], template: "<!--\n ~ Copyright 2015-2025 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<ng-template #contentRenderer></ng-template>\n" }]
|
|
2309
|
+
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: WidgetWizardService }], propDecorators: { _vcr: [{
|
|
2310
|
+
type: ViewChild,
|
|
2311
|
+
args: ['contentRenderer', { static: true, read: ViewContainerRef }]
|
|
2312
|
+
}], contentValidEvent: [{
|
|
2313
|
+
type: Output
|
|
2314
|
+
}] } });
|
|
2315
|
+
|
|
2316
|
+
/*
|
|
2317
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
2318
|
+
*
|
|
2319
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
2320
|
+
* you may not use this file except in compliance with the License.
|
|
2321
|
+
* You may obtain a copy of the License at
|
|
2322
|
+
*
|
|
2323
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
2324
|
+
*
|
|
2325
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
2326
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
2327
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2328
|
+
* See the License for the specific language governing permissions and
|
|
2329
|
+
* limitations under the License.
|
|
2330
|
+
*/
|
|
2331
|
+
class WidgetWizardStyleStepComponent {
|
|
2332
|
+
constructor(widgetWizardService) {
|
|
2333
|
+
this.widgetWizardService = widgetWizardService;
|
|
2334
|
+
this.WidgetStyle = WidgetStyle;
|
|
2335
|
+
this.$widgetStyle = this.widgetWizardService.$widgetStyle;
|
|
2336
|
+
}
|
|
2337
|
+
onSelectedEvent(event) {
|
|
2338
|
+
this.widgetWizardService.$widgetStyle.set(event.value);
|
|
2339
|
+
}
|
|
2340
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: WidgetWizardStyleStepComponent, deps: [{ token: WidgetWizardService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2341
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.15", type: WidgetWizardStyleStepComponent, isStandalone: true, selector: "valtimo-widget-wizard-style-step", ngImport: i0, template: "<!--\n ~ Copyright 2015-2025 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<cds-tile-group\n [multiple]=\"false\"\n (selected)=\"onSelectedEvent($event)\"\n class=\"valtimo-widget-wizard-step__content\"\n>\n <cds-selection-tile\n class=\"valtimo-widget-wizard-step__tile\"\n [value]=\"WidgetStyle.DEFAULT\"\n [selected]=\"$widgetStyle() === WidgetStyle.DEFAULT\"\n >\n <h3>{{ 'widgetTabManagement.style.default.title' | translate }}</h3>\n\n <span>{{ 'widgetTabManagement.style.default.description' | translate }}</span>\n\n <img\n src=\"valtimo-layout/img/widget-management/style/default.svg\"\n [alt]=\"'widgetTabManagement.style.default.title' | translate\"\n />\n </cds-selection-tile>\n\n <cds-selection-tile\n class=\"valtimo-widget-wizard-step__tile\"\n [value]=\"WidgetStyle.HIGH_CONTRAST\"\n [selected]=\"$widgetStyle() === WidgetStyle.HIGH_CONTRAST\"\n >\n <h3>{{ 'widgetTabManagement.style.highContrast.title' | translate }}</h3>\n\n <span>{{ 'widgetTabManagement.style.highContrast.description' | translate }}</span>\n\n <img\n src=\"valtimo-layout/img/widget-management/style/high-contrast.svg\"\n [alt]=\"'widgetTabManagement.style.highContrast.title' | translate\"\n />\n </cds-selection-tile>\n</cds-tile-group>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i2$1.TranslatePipe, name: "translate" }, { kind: "ngmodule", type: TilesModule }, { kind: "component", type: i3.SelectionTile, selector: "cds-selection-tile, ibm-selection-tile", inputs: ["theme", "id", "selected", "value", "disabled"], outputs: ["change"] }, { kind: "component", type: i3.TileGroup, selector: "cds-tile-group, ibm-tile-group", inputs: ["name", "multiple", "legend"], outputs: ["selected"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
2342
|
+
}
|
|
2343
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: WidgetWizardStyleStepComponent, decorators: [{
|
|
2344
|
+
type: Component,
|
|
2345
|
+
args: [{ selector: 'valtimo-widget-wizard-style-step', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [CommonModule, TranslateModule, TilesModule], template: "<!--\n ~ Copyright 2015-2025 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<cds-tile-group\n [multiple]=\"false\"\n (selected)=\"onSelectedEvent($event)\"\n class=\"valtimo-widget-wizard-step__content\"\n>\n <cds-selection-tile\n class=\"valtimo-widget-wizard-step__tile\"\n [value]=\"WidgetStyle.DEFAULT\"\n [selected]=\"$widgetStyle() === WidgetStyle.DEFAULT\"\n >\n <h3>{{ 'widgetTabManagement.style.default.title' | translate }}</h3>\n\n <span>{{ 'widgetTabManagement.style.default.description' | translate }}</span>\n\n <img\n src=\"valtimo-layout/img/widget-management/style/default.svg\"\n [alt]=\"'widgetTabManagement.style.default.title' | translate\"\n />\n </cds-selection-tile>\n\n <cds-selection-tile\n class=\"valtimo-widget-wizard-step__tile\"\n [value]=\"WidgetStyle.HIGH_CONTRAST\"\n [selected]=\"$widgetStyle() === WidgetStyle.HIGH_CONTRAST\"\n >\n <h3>{{ 'widgetTabManagement.style.highContrast.title' | translate }}</h3>\n\n <span>{{ 'widgetTabManagement.style.highContrast.description' | translate }}</span>\n\n <img\n src=\"valtimo-layout/img/widget-management/style/high-contrast.svg\"\n [alt]=\"'widgetTabManagement.style.highContrast.title' | translate\"\n />\n </cds-selection-tile>\n</cds-tile-group>\n" }]
|
|
2346
|
+
}], ctorParameters: () => [{ type: WidgetWizardService }] });
|
|
2347
|
+
|
|
2348
|
+
/*
|
|
2349
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
2350
|
+
*
|
|
2351
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
2352
|
+
* you may not use this file except in compliance with the License.
|
|
2353
|
+
* You may obtain a copy of the License at
|
|
2354
|
+
*
|
|
2355
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
2356
|
+
*
|
|
2357
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
2358
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
2359
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2360
|
+
* See the License for the specific language governing permissions and
|
|
2361
|
+
* limitations under the License.
|
|
2362
|
+
*/
|
|
2363
|
+
class WidgetWizardTypeStepComponent {
|
|
2364
|
+
constructor(widgetWizardService) {
|
|
2365
|
+
this.widgetWizardService = widgetWizardService;
|
|
2366
|
+
this.$availableWidgetTypes = computed(() => {
|
|
2367
|
+
const availableTypes = this.widgetWizardService.$availableWidgetTypes();
|
|
2368
|
+
return !availableTypes
|
|
2369
|
+
? AVAILABLE_WIDGETS
|
|
2370
|
+
: AVAILABLE_WIDGETS.filter((typeSelection) => availableTypes.includes(typeSelection.type));
|
|
2371
|
+
});
|
|
2372
|
+
this.$selectedWidget = this.widgetWizardService.$selectedWidget;
|
|
2373
|
+
}
|
|
2374
|
+
onSelectedEvent(event) {
|
|
2375
|
+
if (event.value.type !== this.widgetWizardService.$selectedWidget()?.type) {
|
|
2376
|
+
this.widgetWizardService.$widgetContent.set(null);
|
|
2377
|
+
this.widgetWizardService.$widgetTitle.set(null);
|
|
2378
|
+
}
|
|
2379
|
+
this.widgetWizardService.$selectedWidget.set(event.value);
|
|
2380
|
+
}
|
|
2381
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: WidgetWizardTypeStepComponent, deps: [{ token: WidgetWizardService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2382
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.15", type: WidgetWizardTypeStepComponent, isStandalone: true, selector: "valtimo-widget-wizard-type-step", ngImport: i0, template: "<!--\n ~ Copyright 2015-2025 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<cds-tile-group\n [multiple]=\"false\"\n (selected)=\"onSelectedEvent($event)\"\n class=\"valtimo-widget-wizard-step__content\"\n>\n @for (widgetType of $availableWidgetTypes(); track widgetType.titleKey) {\n <cds-selection-tile\n class=\"valtimo-widget-wizard-step__tile\"\n [value]=\"widgetType\"\n [selected]=\"widgetType.type === $selectedWidget()?.type\"\n >\n <h3 class=\"valtimo-widget-wizard-step__tile-title\">{{ widgetType.titleKey | translate }}</h3>\n\n <span>{{ widgetType.descriptionKey | translate }}</span>\n\n <img [src]=\"widgetType.illustrationUrl\" [alt]=\"widgetType.titleKey | translate\" />\n </cds-selection-tile>\n }\n</cds-tile-group>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i2$1.TranslatePipe, name: "translate" }, { kind: "ngmodule", type: TilesModule }, { kind: "component", type: i3.SelectionTile, selector: "cds-selection-tile, ibm-selection-tile", inputs: ["theme", "id", "selected", "value", "disabled"], outputs: ["change"] }, { kind: "component", type: i3.TileGroup, selector: "cds-tile-group, ibm-tile-group", inputs: ["name", "multiple", "legend"], outputs: ["selected"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
2383
|
+
}
|
|
2384
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: WidgetWizardTypeStepComponent, decorators: [{
|
|
2385
|
+
type: Component,
|
|
2386
|
+
args: [{ selector: 'valtimo-widget-wizard-type-step', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, standalone: true, imports: [CommonModule, TranslateModule, TilesModule], template: "<!--\n ~ Copyright 2015-2025 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<cds-tile-group\n [multiple]=\"false\"\n (selected)=\"onSelectedEvent($event)\"\n class=\"valtimo-widget-wizard-step__content\"\n>\n @for (widgetType of $availableWidgetTypes(); track widgetType.titleKey) {\n <cds-selection-tile\n class=\"valtimo-widget-wizard-step__tile\"\n [value]=\"widgetType\"\n [selected]=\"widgetType.type === $selectedWidget()?.type\"\n >\n <h3 class=\"valtimo-widget-wizard-step__tile-title\">{{ widgetType.titleKey | translate }}</h3>\n\n <span>{{ widgetType.descriptionKey | translate }}</span>\n\n <img [src]=\"widgetType.illustrationUrl\" [alt]=\"widgetType.titleKey | translate\" />\n </cds-selection-tile>\n }\n</cds-tile-group>\n" }]
|
|
2387
|
+
}], ctorParameters: () => [{ type: WidgetWizardService }] });
|
|
2388
|
+
|
|
2389
|
+
/*
|
|
2390
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
2391
|
+
*
|
|
2392
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
2393
|
+
* you may not use this file except in compliance with the License.
|
|
2394
|
+
* You may obtain a copy of the License at
|
|
2395
|
+
*
|
|
2396
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
2397
|
+
*
|
|
2398
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
2399
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
2400
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2401
|
+
* See the License for the specific language governing permissions and
|
|
2402
|
+
* limitations under the License.
|
|
2403
|
+
*/
|
|
2404
|
+
class WidgetWizardWidthStepComponent {
|
|
2405
|
+
constructor(widgetWizardService) {
|
|
2406
|
+
this.widgetWizardService = widgetWizardService;
|
|
2407
|
+
this.$fieldsColumnsLength = computed(() => this.widgetWizardService.$selectedWidget()?.type === WidgetType.FIELDS
|
|
2408
|
+
? (this.widgetWizardService.$widgetContent()?.['columns']?.length ?? 0)
|
|
2409
|
+
: 0);
|
|
2410
|
+
this.$widgetWidth = this.widgetWizardService.$widgetWidth;
|
|
2411
|
+
}
|
|
2412
|
+
onSelectedEvent(event) {
|
|
2413
|
+
this.widgetWizardService.$widgetWidth.set(event.value);
|
|
2414
|
+
}
|
|
2415
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: WidgetWizardWidthStepComponent, deps: [{ token: WidgetWizardService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2416
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.15", type: WidgetWizardWidthStepComponent, isStandalone: true, selector: "valtimo-widget-wizard-width-step", ngImport: i0, template: "<!--\n ~ Copyright 2015-2025 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<cds-tile-group\n [multiple]=\"false\"\n (selected)=\"onSelectedEvent($event)\"\n class=\"valtimo-widget-wizard-step__content\"\n>\n <cds-selection-tile\n class=\"valtimo-widget-wizard-step__tile\"\n [value]=\"1\"\n [selected]=\"$widgetWidth() === 1\"\n [disabled]=\"$fieldsColumnsLength() > 1\"\n >\n <h3>{{ 'widgetTabManagement.width.small.title' | translate }}</h3>\n\n <span>{{ 'widgetTabManagement.width.small.subtitle' | translate }}</span>\n\n <img\n src=\"valtimo-layout/img/widget-management/width/quarter.svg\"\n [alt]=\"'widgetTabManagement.width.small.title' | translate\"\n />\n </cds-selection-tile>\n\n <cds-selection-tile\n class=\"valtimo-widget-wizard-step__tile\"\n [value]=\"2\"\n [selected]=\"$widgetWidth() === 2\"\n [disabled]=\"$fieldsColumnsLength() > 2\"\n >\n <h3>{{ 'widgetTabManagement.width.medium.title' | translate }}</h3>\n\n <span>{{ 'widgetTabManagement.width.medium.subtitle' | translate }}</span>\n\n <img\n src=\"valtimo-layout/img/widget-management/width/half.svg\"\n [alt]=\"'widgetTabManagement.width.medium.title' | translate\"\n />\n </cds-selection-tile>\n\n <cds-selection-tile\n class=\"valtimo-widget-wizard-step__tile\"\n [value]=\"3\"\n [selected]=\"$widgetWidth() === 3\"\n [disabled]=\"$fieldsColumnsLength() > 3\"\n >\n <h3>{{ 'widgetTabManagement.width.large.title' | translate }}</h3>\n\n <span>{{ 'widgetTabManagement.width.large.subtitle' | translate }}</span>\n\n <img\n src=\"valtimo-layout/img/widget-management/width/three-quarters.svg\"\n [alt]=\"'widgetTabManagement.width.large.title' | translate\"\n />\n </cds-selection-tile>\n\n <cds-selection-tile\n class=\"valtimo-widget-wizard-step__tile\"\n [value]=\"4\"\n [selected]=\"$widgetWidth() === 4\"\n >\n <h3>{{ 'widgetTabManagement.width.xtraLarge.title' | translate }}</h3>\n\n <span>{{ 'widgetTabManagement.width.xtraLarge.subtitle' | translate }}</span>\n\n <img\n src=\"valtimo-layout/img/widget-management/width/full-width.svg\"\n [alt]=\"'widgetTabManagement.width.xtraLarge.title' | translate\"\n />\n </cds-selection-tile>\n</cds-tile-group>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i2$1.TranslatePipe, name: "translate" }, { kind: "ngmodule", type: TilesModule }, { kind: "component", type: i3.SelectionTile, selector: "cds-selection-tile, ibm-selection-tile", inputs: ["theme", "id", "selected", "value", "disabled"], outputs: ["change"] }, { kind: "component", type: i3.TileGroup, selector: "cds-tile-group, ibm-tile-group", inputs: ["name", "multiple", "legend"], outputs: ["selected"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
2417
|
+
}
|
|
2418
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: WidgetWizardWidthStepComponent, decorators: [{
|
|
2419
|
+
type: Component,
|
|
2420
|
+
args: [{ selector: 'valtimo-widget-wizard-width-step', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [CommonModule, TranslateModule, TilesModule], template: "<!--\n ~ Copyright 2015-2025 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<cds-tile-group\n [multiple]=\"false\"\n (selected)=\"onSelectedEvent($event)\"\n class=\"valtimo-widget-wizard-step__content\"\n>\n <cds-selection-tile\n class=\"valtimo-widget-wizard-step__tile\"\n [value]=\"1\"\n [selected]=\"$widgetWidth() === 1\"\n [disabled]=\"$fieldsColumnsLength() > 1\"\n >\n <h3>{{ 'widgetTabManagement.width.small.title' | translate }}</h3>\n\n <span>{{ 'widgetTabManagement.width.small.subtitle' | translate }}</span>\n\n <img\n src=\"valtimo-layout/img/widget-management/width/quarter.svg\"\n [alt]=\"'widgetTabManagement.width.small.title' | translate\"\n />\n </cds-selection-tile>\n\n <cds-selection-tile\n class=\"valtimo-widget-wizard-step__tile\"\n [value]=\"2\"\n [selected]=\"$widgetWidth() === 2\"\n [disabled]=\"$fieldsColumnsLength() > 2\"\n >\n <h3>{{ 'widgetTabManagement.width.medium.title' | translate }}</h3>\n\n <span>{{ 'widgetTabManagement.width.medium.subtitle' | translate }}</span>\n\n <img\n src=\"valtimo-layout/img/widget-management/width/half.svg\"\n [alt]=\"'widgetTabManagement.width.medium.title' | translate\"\n />\n </cds-selection-tile>\n\n <cds-selection-tile\n class=\"valtimo-widget-wizard-step__tile\"\n [value]=\"3\"\n [selected]=\"$widgetWidth() === 3\"\n [disabled]=\"$fieldsColumnsLength() > 3\"\n >\n <h3>{{ 'widgetTabManagement.width.large.title' | translate }}</h3>\n\n <span>{{ 'widgetTabManagement.width.large.subtitle' | translate }}</span>\n\n <img\n src=\"valtimo-layout/img/widget-management/width/three-quarters.svg\"\n [alt]=\"'widgetTabManagement.width.large.title' | translate\"\n />\n </cds-selection-tile>\n\n <cds-selection-tile\n class=\"valtimo-widget-wizard-step__tile\"\n [value]=\"4\"\n [selected]=\"$widgetWidth() === 4\"\n >\n <h3>{{ 'widgetTabManagement.width.xtraLarge.title' | translate }}</h3>\n\n <span>{{ 'widgetTabManagement.width.xtraLarge.subtitle' | translate }}</span>\n\n <img\n src=\"valtimo-layout/img/widget-management/width/full-width.svg\"\n [alt]=\"'widgetTabManagement.width.xtraLarge.title' | translate\"\n />\n </cds-selection-tile>\n</cds-tile-group>\n" }]
|
|
2421
|
+
}], ctorParameters: () => [{ type: WidgetWizardService }] });
|
|
2422
|
+
|
|
2423
|
+
/*
|
|
2424
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
2425
|
+
*
|
|
2426
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
2427
|
+
* you may not use this file except in compliance with the License.
|
|
2428
|
+
* You may obtain a copy of the License at
|
|
2429
|
+
*
|
|
2430
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
2431
|
+
*
|
|
2432
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
2433
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
2434
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2435
|
+
* See the License for the specific language governing permissions and
|
|
2436
|
+
* limitations under the License.
|
|
2437
|
+
*/
|
|
2438
|
+
const WIDGET_STEPS = [
|
|
2439
|
+
WidgetWizardContentStepComponent,
|
|
2440
|
+
WidgetWizardStyleStepComponent,
|
|
2441
|
+
WidgetWizardTypeStepComponent,
|
|
2442
|
+
WidgetWizardWidthStepComponent,
|
|
2443
|
+
];
|
|
2444
|
+
|
|
2445
|
+
/*
|
|
2446
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
2447
|
+
*
|
|
2448
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
2449
|
+
* you may not use this file except in compliance with the License.
|
|
2450
|
+
* You may obtain a copy of the License at
|
|
2451
|
+
*
|
|
2452
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
2453
|
+
*
|
|
2454
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
2455
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
2456
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2457
|
+
* See the License for the specific language governing permissions and
|
|
2458
|
+
* limitations under the License.
|
|
2459
|
+
*/
|
|
2460
|
+
class WidgetManagementWizardComponent {
|
|
2461
|
+
set editMode(value) {
|
|
2462
|
+
this._editMode = value;
|
|
2463
|
+
if (!value)
|
|
2464
|
+
return;
|
|
2465
|
+
this.$currentStep.set(WidgetWizardStep.CONTENT);
|
|
2466
|
+
}
|
|
2467
|
+
get editMode() {
|
|
2468
|
+
return this._editMode;
|
|
2469
|
+
}
|
|
2470
|
+
constructor(keyGeneratorService, translateService, widgetWizardService) {
|
|
2471
|
+
this.keyGeneratorService = keyGeneratorService;
|
|
2472
|
+
this.translateService = translateService;
|
|
2473
|
+
this.widgetWizardService = widgetWizardService;
|
|
2474
|
+
this.open = false;
|
|
2475
|
+
this.closeEvent = new EventEmitter();
|
|
2476
|
+
this.WidgetWizardSteps = WidgetWizardStep;
|
|
2477
|
+
this._secondaryLabels = computed(() => {
|
|
2478
|
+
const selectedWidgetType = this.widgetWizardService.$selectedWidget()?.type ?? '';
|
|
2479
|
+
const selectedWidth = this.widgetWizardService.$widgetWidth() ?? '';
|
|
2480
|
+
const selectedStyle = this.widgetWizardService.$widgetStyle() ?? '';
|
|
2481
|
+
return {
|
|
2482
|
+
[WidgetWizardStep.TYPE]: selectedWidgetType
|
|
2483
|
+
? `widgetTabManagement.types.${selectedWidgetType}.title`
|
|
2484
|
+
: '',
|
|
2485
|
+
[WidgetWizardStep.WIDTH]: WIDGET_WIDTH_LABELS[selectedWidth] ?? '',
|
|
2486
|
+
[WidgetWizardStep.STYLE]: WIDGET_STYLE_LABELS[selectedStyle] ?? '',
|
|
2487
|
+
};
|
|
2488
|
+
});
|
|
2489
|
+
this.steps$ = combineLatest([
|
|
2490
|
+
toObservable(this._secondaryLabels),
|
|
2491
|
+
toObservable(this.widgetWizardService.$editMode),
|
|
2492
|
+
this.translateService.stream('key'),
|
|
2493
|
+
]).pipe(map(([secondaryLabels, editMode]) => {
|
|
2494
|
+
return [
|
|
2495
|
+
{
|
|
2496
|
+
label: this.translateService.instant('widgetTabManagement.wizard.steps.type'),
|
|
2497
|
+
...(secondaryLabels[WidgetWizardStep.TYPE] && {
|
|
2498
|
+
secondaryLabel: this.translateService.instant(secondaryLabels[WidgetWizardStep.TYPE]),
|
|
2499
|
+
}),
|
|
2500
|
+
disabled: editMode,
|
|
2501
|
+
complete: !!this.widgetWizardService.$selectedWidget()?.type,
|
|
2502
|
+
},
|
|
2503
|
+
{
|
|
2504
|
+
label: this.translateService.instant('widgetTabManagement.wizard.steps.width'),
|
|
2505
|
+
...(secondaryLabels[WidgetWizardStep.WIDTH] && {
|
|
2506
|
+
secondaryLabel: this.translateService.instant(secondaryLabels[WidgetWizardStep.WIDTH]),
|
|
2507
|
+
}),
|
|
2508
|
+
disabled: !secondaryLabels[WidgetWizardStep.TYPE],
|
|
2509
|
+
complete: !!this.widgetWizardService.$widgetWidth(),
|
|
2510
|
+
},
|
|
2511
|
+
{
|
|
2512
|
+
label: this.translateService.instant('widgetTabManagement.wizard.steps.style'),
|
|
2513
|
+
...(secondaryLabels[WidgetWizardStep.STYLE] && {
|
|
2514
|
+
secondaryLabel: this.translateService.instant(secondaryLabels[WidgetWizardStep.STYLE]),
|
|
2515
|
+
}),
|
|
2516
|
+
disabled: !secondaryLabels[WidgetWizardStep.WIDTH],
|
|
2517
|
+
complete: !!this.widgetWizardService.$widgetStyle(),
|
|
2518
|
+
},
|
|
2519
|
+
{
|
|
2520
|
+
label: this.translateService.instant('widgetTabManagement.wizard.steps.content'),
|
|
2521
|
+
disabled: !secondaryLabels[WidgetWizardStep.TYPE] ||
|
|
2522
|
+
!secondaryLabels[WidgetWizardStep.WIDTH] ||
|
|
2523
|
+
!secondaryLabels[WidgetWizardStep.STYLE],
|
|
2524
|
+
complete: !!this.widgetWizardService.$widgetContent(),
|
|
2525
|
+
},
|
|
2526
|
+
];
|
|
2527
|
+
}));
|
|
2528
|
+
this._$contentStepValid = signal(false);
|
|
2529
|
+
this.$currentStep = signal(WidgetWizardStep.TYPE);
|
|
2530
|
+
this.$backButtonDisabled = computed(() => this.widgetWizardService.$editMode() && this.$currentStep() === WidgetWizardStep.WIDTH);
|
|
2531
|
+
this.$nextButtonDisabled = computed(() => {
|
|
2532
|
+
switch (this.$currentStep()) {
|
|
2533
|
+
case WidgetWizardStep.TYPE:
|
|
2534
|
+
return !this.widgetWizardService.$selectedWidget();
|
|
2535
|
+
case WidgetWizardStep.WIDTH:
|
|
2536
|
+
return !this.widgetWizardService.$widgetWidth();
|
|
2537
|
+
case WidgetWizardStep.STYLE:
|
|
2538
|
+
return this.widgetWizardService.$widgetStyle() === null;
|
|
2539
|
+
case WidgetWizardStep.CONTENT:
|
|
2540
|
+
return this.widgetWizardService.$widgetContent() === null || !this._$contentStepValid();
|
|
2541
|
+
default:
|
|
2542
|
+
return true;
|
|
2543
|
+
}
|
|
2544
|
+
});
|
|
2545
|
+
}
|
|
2546
|
+
onStepSelected(event) {
|
|
2547
|
+
this.$currentStep.set(event.index);
|
|
2548
|
+
}
|
|
2549
|
+
onNextButtonClick() {
|
|
2550
|
+
if (this.$currentStep() === WidgetWizardStep.CONTENT) {
|
|
2551
|
+
const isDuplicateMode = this.editMode && !this.widgetWizardService.$widgetKey();
|
|
2552
|
+
if (isDuplicateMode || !this.editMode) {
|
|
2553
|
+
this.widgetWizardService.$widgetKey.set(this.keyGeneratorService.getUniqueKey(this.widgetWizardService.$widgetTitle() ?? '', this.widgetWizardService.$usedWidgetKeys()));
|
|
2554
|
+
}
|
|
2555
|
+
this.closeEvent.emit({
|
|
2556
|
+
type: this.editMode && !isDuplicateMode
|
|
2557
|
+
? WidgetWizardCloseEventType.EDIT
|
|
2558
|
+
: WidgetWizardCloseEventType.CREATE,
|
|
2559
|
+
widget: this.widgetWizardService.$widgetsConfig(),
|
|
2560
|
+
});
|
|
2561
|
+
this.resetWizard();
|
|
2562
|
+
return;
|
|
2563
|
+
}
|
|
2564
|
+
this.$currentStep.update((step) => step + 1);
|
|
2565
|
+
}
|
|
2566
|
+
onBackButtonClick() {
|
|
2567
|
+
this.$currentStep.update((step) => step - 1);
|
|
2568
|
+
}
|
|
2569
|
+
onClose() {
|
|
2570
|
+
this.closeEvent.emit({ type: WidgetWizardCloseEventType.CANCEL, widget: null });
|
|
2571
|
+
this.resetWizard();
|
|
2572
|
+
}
|
|
2573
|
+
onContentValidEvent(valid) {
|
|
2574
|
+
this._$contentStepValid.set(valid);
|
|
2575
|
+
}
|
|
2576
|
+
resetWizard() {
|
|
2577
|
+
setTimeout(() => {
|
|
2578
|
+
this.widgetWizardService.resetWizard();
|
|
2579
|
+
this.$currentStep.set(WidgetWizardStep.TYPE);
|
|
2580
|
+
}, CARBON_CONSTANTS.modalAnimationMs);
|
|
2581
|
+
}
|
|
2582
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: WidgetManagementWizardComponent, deps: [{ token: i1.KeyGeneratorService }, { token: i2$1.TranslateService }, { token: WidgetWizardService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2583
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.15", type: WidgetManagementWizardComponent, isStandalone: true, selector: "valtimo-widget-management-wizard", inputs: { open: "open", editMode: "editMode" }, outputs: { closeEvent: "closeEvent" }, ngImport: i0, template: "<!--\n ~ Copyright 2015-2025 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<cds-modal\n *ngIf=\"{steps: steps$ | async} as obs\"\n [open]=\"open\"\n showFooter=\"true\"\n size=\"lg\"\n valtimoCdsModal\n class=\"valtimo-widget-management-wizard\"\n (close)=\"onClose()\"\n>\n <cds-modal-header [showCloseButton]=\"true\" (closeSelect)=\"onClose()\">\n <h3 cdsModalHeaderHeading>\n {{ 'widgetTabManagement.wizard.' + (editMode ? 'edit' : 'create') | translate }}\n </h3>\n </cds-modal-header>\n\n <section cdsModalContent class=\"valtimo-widget-management-wizard__content\">\n <cds-progress-indicator\n [current]=\"$currentStep()\"\n [skeleton]=\"!obs.steps\"\n [spacing]=\"'equal'\"\n [steps]=\"obs.steps\"\n (stepSelected)=\"onStepSelected($event)\"\n >\n </cds-progress-indicator>\n\n @switch ($currentStep()) {\n @case (WidgetWizardSteps.TYPE) {\n <p>{{ 'widgetTabManagement.types.description' | translate }}</p>\n\n <valtimo-widget-wizard-type-step\n class=\"valtimo-widget-wizard-step\"\n ></valtimo-widget-wizard-type-step>\n }\n @case (WidgetWizardSteps.WIDTH) {\n <p>{{ 'widgetTabManagement.width.description' | translate }}</p>\n\n <valtimo-widget-wizard-width-step\n class=\"valtimo-widget-wizard-step\"\n ></valtimo-widget-wizard-width-step>\n }\n @case (WidgetWizardSteps.STYLE) {\n <p>{{ 'widgetTabManagement.style.description' | translate }}</p>\n\n <valtimo-widget-wizard-style-step\n class=\"valtimo-widget-wizard-step\"\n ></valtimo-widget-wizard-style-step>\n }\n @case (WidgetWizardSteps.CONTENT) {\n <valtimo-widget-wizard-content-step\n (contentValidEvent)=\"onContentValidEvent($event)\"\n ></valtimo-widget-wizard-content-step>\n }\n @default {\n <p>{{ 'widgetTabManagement.types.description' | translate }}</p>\n\n <valtimo-widget-wizard-type-step></valtimo-widget-wizard-type-step>\n }\n }\n </section>\n\n <cds-modal-footer class=\"valtimo-widget-management-wizard__footer\">\n <button class=\"valtimo-widget-management-wizard__cancel\" cdsButton=\"ghost\" (click)=\"onClose()\">\n {{ 'interface.cancel' | translate }}\n </button>\n\n @if ($currentStep() !== WidgetWizardSteps.TYPE) {\n <button\n class=\"valtimo-widget-management-wizard__back\"\n cdsButton=\"secondary\"\n [disabled]=\"$backButtonDisabled()\"\n (click)=\"onBackButtonClick()\"\n >\n {{ 'interface.back' | translate }}\n </button>\n }\n\n <button\n class=\"valtimo-widget-management-wizard__next\"\n cdsButton=\"primary\"\n [disabled]=\"$nextButtonDisabled()\"\n (click)=\"onNextButtonClick()\"\n >\n {{\n 'interface.' + ($currentStep() === WidgetWizardSteps.CONTENT ? 'save' : 'next') | translate\n }}\n </button>\n </cds-modal-footer>\n</cds-modal>\n", styles: [".valtimo-widget-management-wizard__content{display:flex;flex-direction:column;gap:32px}.valtimo-widget-management-wizard__footer footer{display:grid;grid-template-columns:repeat(4,1fr);grid-template-areas:\"cancel . back next\"}.valtimo-widget-management-wizard__footer footer button{width:100%}.valtimo-widget-management-wizard__cancel{grid-area:cancel}.valtimo-widget-management-wizard__back{grid-area:back}.valtimo-widget-management-wizard__next{grid-area:next}.valtimo-widget-management-wizard .cds--modal-container{height:88%;background:var(--cds-layer-02)}.valtimo-widget-management-wizard .valtimo-widget-wizard-step__content fieldset{display:grid;grid-template-columns:repeat(auto-fill,minmax(300px,1fr));gap:16px}.valtimo-widget-management-wizard .valtimo-widget-wizard-step__tile .cds--tile{height:100%}.valtimo-widget-management-wizard .valtimo-widget-wizard-step__tile .cds--tile-content{display:flex;flex-direction:column;max-width:260px;gap:16px;justify-content:space-between}.valtimo-widget-management-wizard .valtimo-widget-wizard-step__tile .cds--tile:not(.cds--tile--disabled) .cds--tile-content{color:var(--cds-text-primary)}.valtimo-widget-management-wizard .valtimo-widget-wizard-step__tile-title{font-size:20px}::ng-deep .cds--tab-content{padding:0}\n/*!\n * Copyright 2015-2025 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i2$1.TranslatePipe, name: "translate" }, { kind: "ngmodule", type: ProgressIndicatorModule }, { kind: "component", type: i3.ProgressIndicator, selector: "cds-progress-indicator, ibm-progress-indicator", inputs: ["current", "steps", "translations", "orientation", "skeleton", "spacing"], outputs: ["stepSelected"] }, { kind: "ngmodule", type: ModalModule }, { kind: "component", type: i3.Modal, selector: "cds-modal, ibm-modal", inputs: ["size", "theme", "ariaLabel", "open", "trigger", "hasScrollingContent"], outputs: ["overlaySelected", "close"] }, { kind: "component", type: i3.ModalHeader, selector: "cds-modal-header, ibm-modal-header", inputs: ["theme", "closeLabel", "showCloseButton"], outputs: ["closeSelect"] }, { kind: "component", type: i3.ModalFooter, selector: "cds-modal-footer, ibm-modal-footer" }, { kind: "directive", type: i3.ModalContent, selector: "[cdsModalContent], [ibmModalContent]", inputs: ["hasForm"] }, { kind: "directive", type: i3.ModalHeaderHeading, selector: "[cdsModalHeaderHeading], [ibmModalHeaderHeading]" }, { kind: "ngmodule", type: ButtonModule }, { kind: "directive", type: i3.Button, selector: "[cdsButton], [ibmButton]", inputs: ["ibmButton", "cdsButton", "size", "skeleton", "iconOnly", "isExpressive"] }, { kind: "component", type: WidgetWizardContentStepComponent, selector: "valtimo-widget-wizard-content-step", outputs: ["contentValidEvent"] }, { kind: "component", type: WidgetWizardStyleStepComponent, selector: "valtimo-widget-wizard-style-step" }, { kind: "component", type: WidgetWizardTypeStepComponent, selector: "valtimo-widget-wizard-type-step" }, { kind: "component", type: WidgetWizardWidthStepComponent, selector: "valtimo-widget-wizard-width-step" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
2584
|
+
}
|
|
2585
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: WidgetManagementWizardComponent, decorators: [{
|
|
2586
|
+
type: Component,
|
|
2587
|
+
args: [{ selector: 'valtimo-widget-management-wizard', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, standalone: true, imports: [
|
|
2588
|
+
CommonModule,
|
|
2589
|
+
TranslateModule,
|
|
2590
|
+
ProgressIndicatorModule,
|
|
2591
|
+
ModalModule,
|
|
2592
|
+
ButtonModule,
|
|
2593
|
+
...WIDGET_STEPS,
|
|
2594
|
+
], template: "<!--\n ~ Copyright 2015-2025 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<cds-modal\n *ngIf=\"{steps: steps$ | async} as obs\"\n [open]=\"open\"\n showFooter=\"true\"\n size=\"lg\"\n valtimoCdsModal\n class=\"valtimo-widget-management-wizard\"\n (close)=\"onClose()\"\n>\n <cds-modal-header [showCloseButton]=\"true\" (closeSelect)=\"onClose()\">\n <h3 cdsModalHeaderHeading>\n {{ 'widgetTabManagement.wizard.' + (editMode ? 'edit' : 'create') | translate }}\n </h3>\n </cds-modal-header>\n\n <section cdsModalContent class=\"valtimo-widget-management-wizard__content\">\n <cds-progress-indicator\n [current]=\"$currentStep()\"\n [skeleton]=\"!obs.steps\"\n [spacing]=\"'equal'\"\n [steps]=\"obs.steps\"\n (stepSelected)=\"onStepSelected($event)\"\n >\n </cds-progress-indicator>\n\n @switch ($currentStep()) {\n @case (WidgetWizardSteps.TYPE) {\n <p>{{ 'widgetTabManagement.types.description' | translate }}</p>\n\n <valtimo-widget-wizard-type-step\n class=\"valtimo-widget-wizard-step\"\n ></valtimo-widget-wizard-type-step>\n }\n @case (WidgetWizardSteps.WIDTH) {\n <p>{{ 'widgetTabManagement.width.description' | translate }}</p>\n\n <valtimo-widget-wizard-width-step\n class=\"valtimo-widget-wizard-step\"\n ></valtimo-widget-wizard-width-step>\n }\n @case (WidgetWizardSteps.STYLE) {\n <p>{{ 'widgetTabManagement.style.description' | translate }}</p>\n\n <valtimo-widget-wizard-style-step\n class=\"valtimo-widget-wizard-step\"\n ></valtimo-widget-wizard-style-step>\n }\n @case (WidgetWizardSteps.CONTENT) {\n <valtimo-widget-wizard-content-step\n (contentValidEvent)=\"onContentValidEvent($event)\"\n ></valtimo-widget-wizard-content-step>\n }\n @default {\n <p>{{ 'widgetTabManagement.types.description' | translate }}</p>\n\n <valtimo-widget-wizard-type-step></valtimo-widget-wizard-type-step>\n }\n }\n </section>\n\n <cds-modal-footer class=\"valtimo-widget-management-wizard__footer\">\n <button class=\"valtimo-widget-management-wizard__cancel\" cdsButton=\"ghost\" (click)=\"onClose()\">\n {{ 'interface.cancel' | translate }}\n </button>\n\n @if ($currentStep() !== WidgetWizardSteps.TYPE) {\n <button\n class=\"valtimo-widget-management-wizard__back\"\n cdsButton=\"secondary\"\n [disabled]=\"$backButtonDisabled()\"\n (click)=\"onBackButtonClick()\"\n >\n {{ 'interface.back' | translate }}\n </button>\n }\n\n <button\n class=\"valtimo-widget-management-wizard__next\"\n cdsButton=\"primary\"\n [disabled]=\"$nextButtonDisabled()\"\n (click)=\"onNextButtonClick()\"\n >\n {{\n 'interface.' + ($currentStep() === WidgetWizardSteps.CONTENT ? 'save' : 'next') | translate\n }}\n </button>\n </cds-modal-footer>\n</cds-modal>\n", styles: [".valtimo-widget-management-wizard__content{display:flex;flex-direction:column;gap:32px}.valtimo-widget-management-wizard__footer footer{display:grid;grid-template-columns:repeat(4,1fr);grid-template-areas:\"cancel . back next\"}.valtimo-widget-management-wizard__footer footer button{width:100%}.valtimo-widget-management-wizard__cancel{grid-area:cancel}.valtimo-widget-management-wizard__back{grid-area:back}.valtimo-widget-management-wizard__next{grid-area:next}.valtimo-widget-management-wizard .cds--modal-container{height:88%;background:var(--cds-layer-02)}.valtimo-widget-management-wizard .valtimo-widget-wizard-step__content fieldset{display:grid;grid-template-columns:repeat(auto-fill,minmax(300px,1fr));gap:16px}.valtimo-widget-management-wizard .valtimo-widget-wizard-step__tile .cds--tile{height:100%}.valtimo-widget-management-wizard .valtimo-widget-wizard-step__tile .cds--tile-content{display:flex;flex-direction:column;max-width:260px;gap:16px;justify-content:space-between}.valtimo-widget-management-wizard .valtimo-widget-wizard-step__tile .cds--tile:not(.cds--tile--disabled) .cds--tile-content{color:var(--cds-text-primary)}.valtimo-widget-management-wizard .valtimo-widget-wizard-step__tile-title{font-size:20px}::ng-deep .cds--tab-content{padding:0}\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"] }]
|
|
2595
|
+
}], ctorParameters: () => [{ type: i1.KeyGeneratorService }, { type: i2$1.TranslateService }, { type: WidgetWizardService }], propDecorators: { open: [{
|
|
2596
|
+
type: Input
|
|
2597
|
+
}], editMode: [{
|
|
2598
|
+
type: Input
|
|
2599
|
+
}], closeEvent: [{
|
|
2600
|
+
type: Output
|
|
2601
|
+
}] } });
|
|
2602
|
+
|
|
2603
|
+
/*
|
|
2604
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
2605
|
+
*
|
|
2606
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
2607
|
+
* you may not use this file except in compliance with the License.
|
|
2608
|
+
* You may obtain a copy of the License at
|
|
2609
|
+
*
|
|
2610
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
2611
|
+
*
|
|
2612
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
2613
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
2614
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2615
|
+
* See the License for the specific language governing permissions and
|
|
2616
|
+
* limitations under the License.
|
|
2617
|
+
*/
|
|
2618
|
+
class WidgetManagementEditorComponent {
|
|
2619
|
+
set params(value) {
|
|
2620
|
+
if (!value)
|
|
2621
|
+
return;
|
|
2622
|
+
this.widgetManagementService.initParams(value);
|
|
2623
|
+
}
|
|
2624
|
+
set availableWidgetTypes(value) {
|
|
2625
|
+
if (!value)
|
|
2626
|
+
return;
|
|
2627
|
+
this.widgetWizardService.$availableWidgetTypes.set(value);
|
|
2628
|
+
}
|
|
2629
|
+
constructor(translateService, widgetWizardService, widgetManagementService) {
|
|
2630
|
+
this.translateService = translateService;
|
|
2631
|
+
this.widgetWizardService = widgetWizardService;
|
|
2632
|
+
this.widgetManagementService = widgetManagementService;
|
|
2633
|
+
this.FIELDS = [
|
|
2634
|
+
{
|
|
2635
|
+
key: 'title',
|
|
2636
|
+
label: 'interface.title',
|
|
2637
|
+
viewType: ViewType.TEXT,
|
|
2638
|
+
},
|
|
2639
|
+
{
|
|
2640
|
+
key: 'tags',
|
|
2641
|
+
label: 'widgetTabManagement.columns.type',
|
|
2642
|
+
viewType: ViewType.TAGS,
|
|
2643
|
+
},
|
|
2644
|
+
{
|
|
2645
|
+
key: 'key',
|
|
2646
|
+
label: 'interface.key',
|
|
2647
|
+
viewType: ViewType.TEXT,
|
|
2648
|
+
},
|
|
2649
|
+
{
|
|
2650
|
+
key: 'widthTranslation',
|
|
2651
|
+
label: 'widgetTabManagement.columns.width',
|
|
2652
|
+
viewType: ViewType.TEXT,
|
|
2653
|
+
},
|
|
2654
|
+
{
|
|
2655
|
+
key: 'highContrast',
|
|
2656
|
+
label: 'widgetTabManagement.columns.highContrast',
|
|
2657
|
+
viewType: ViewType.BOOLEAN,
|
|
2658
|
+
},
|
|
2659
|
+
];
|
|
2660
|
+
this.ACTION_ITEMS = [
|
|
2661
|
+
{
|
|
2662
|
+
label: 'interface.edit',
|
|
2663
|
+
callback: this.editWidget.bind(this),
|
|
2664
|
+
},
|
|
2665
|
+
{
|
|
2666
|
+
label: 'interface.duplicate',
|
|
2667
|
+
callback: this.duplicateWidget.bind(this),
|
|
2668
|
+
},
|
|
2669
|
+
{
|
|
2670
|
+
label: 'interface.delete',
|
|
2671
|
+
callback: this.deleteWidget.bind(this),
|
|
2672
|
+
type: 'danger',
|
|
2673
|
+
},
|
|
2674
|
+
];
|
|
2675
|
+
this._refresh$ = new BehaviorSubject(null);
|
|
2676
|
+
this.widgets$ = this._refresh$.pipe(switchMap(() => combineLatest([
|
|
2677
|
+
this.widgetManagementService.getWidgetConfiguration(),
|
|
2678
|
+
this.translateService.stream('key'),
|
|
2679
|
+
])), filter(([widgets]) => !!widgets), tap(([widgets]) => this.widgetWizardService.$usedWidgetKeys.set(widgets.map((widget) => widget.key))), map(([widgets]) => widgets.map(item => ({
|
|
2680
|
+
...item,
|
|
2681
|
+
widthTranslation: this.translateService.instant(this.getWidthTranslationKey(item.width)),
|
|
2682
|
+
tags: [
|
|
2683
|
+
{
|
|
2684
|
+
content: this.translateService.instant(`widgetTabManagement.types.${item.type}.title`),
|
|
2685
|
+
type: WidgetTypeTags[item.type],
|
|
2686
|
+
},
|
|
2687
|
+
],
|
|
2688
|
+
}))));
|
|
2689
|
+
this.$isWizardOpen = signal(false);
|
|
2690
|
+
this.$isEditMode = this.widgetWizardService.$editMode;
|
|
2691
|
+
this.deleteModalOpen$ = new BehaviorSubject(false);
|
|
2692
|
+
this.$deleteWidget = signal(null);
|
|
2693
|
+
this.$dragAndDropDisabled = signal(false);
|
|
2694
|
+
}
|
|
2695
|
+
editWidget(tabWidget) {
|
|
2696
|
+
this.widgetWizardService.$widgetTitle.set(tabWidget.title);
|
|
2697
|
+
this.widgetWizardService.$widgetStyle.set(tabWidget.highContrast ? WidgetStyle.HIGH_CONTRAST : WidgetStyle.DEFAULT);
|
|
2698
|
+
this.widgetWizardService.$widgetWidth.set(tabWidget.width);
|
|
2699
|
+
this.widgetWizardService.$selectedWidget.set(AVAILABLE_WIDGETS.find(available => available.type === tabWidget.type) ?? null);
|
|
2700
|
+
this.widgetWizardService.$widgetContent.set(tabWidget.properties);
|
|
2701
|
+
this.widgetWizardService.$editMode.set(true);
|
|
2702
|
+
this.widgetWizardService.$widgetKey.set(tabWidget.key);
|
|
2703
|
+
this.widgetWizardService.$widgetActions.set(tabWidget.actions);
|
|
2704
|
+
this.$isWizardOpen.set(true);
|
|
2705
|
+
}
|
|
2706
|
+
duplicateWidget(tabWidget) {
|
|
2707
|
+
const tabWidgetClone = cloneDeep(tabWidget);
|
|
2708
|
+
tabWidgetClone.key = '';
|
|
2709
|
+
this.editWidget(tabWidgetClone);
|
|
2710
|
+
}
|
|
2711
|
+
openAddModal() {
|
|
2712
|
+
this.$isWizardOpen.set(true);
|
|
2713
|
+
}
|
|
2714
|
+
onDeleteConfirm(widget) {
|
|
2715
|
+
this.widgetManagementService
|
|
2716
|
+
.deleteWidget?.(widget)
|
|
2717
|
+
.pipe(take(1))
|
|
2718
|
+
.subscribe(() => this._refresh$.next(null));
|
|
2719
|
+
}
|
|
2720
|
+
onCloseEvent(event) {
|
|
2721
|
+
this.$isWizardOpen.set(false);
|
|
2722
|
+
this.widgetWizardService.resetWizard();
|
|
2723
|
+
const { type, widget } = event;
|
|
2724
|
+
if (!widget || type === WidgetWizardCloseEventType.CANCEL)
|
|
2725
|
+
return;
|
|
2726
|
+
(type === WidgetWizardCloseEventType.CREATE
|
|
2727
|
+
? this.widgetManagementService.createWidget(widget)
|
|
2728
|
+
: this.widgetManagementService.updateWidget(widget))
|
|
2729
|
+
.pipe(take(1))
|
|
2730
|
+
.subscribe(() => {
|
|
2731
|
+
this._refresh$.next(null);
|
|
2732
|
+
});
|
|
2733
|
+
}
|
|
2734
|
+
onItemsReordered(widgets) {
|
|
2735
|
+
this.$dragAndDropDisabled.set(true);
|
|
2736
|
+
this.widgetManagementService
|
|
2737
|
+
.updateWidgetConfiguration(widgets)
|
|
2738
|
+
.pipe(take(1))
|
|
2739
|
+
.subscribe(() => this.$dragAndDropDisabled.set(false));
|
|
2740
|
+
}
|
|
2741
|
+
deleteWidget(tabWidget) {
|
|
2742
|
+
this.$deleteWidget.set(tabWidget);
|
|
2743
|
+
this.deleteModalOpen$.next(true);
|
|
2744
|
+
}
|
|
2745
|
+
getWidthTranslationKey(width) {
|
|
2746
|
+
switch (width) {
|
|
2747
|
+
case 1:
|
|
2748
|
+
return 'widgetTabManagement.width.small.title';
|
|
2749
|
+
case 2:
|
|
2750
|
+
return 'widgetTabManagement.width.medium.title';
|
|
2751
|
+
case 3:
|
|
2752
|
+
return 'widgetTabManagement.width.large.title';
|
|
2753
|
+
case 4:
|
|
2754
|
+
return 'widgetTabManagement.width.xtraLarge.title';
|
|
2755
|
+
default:
|
|
2756
|
+
return '-';
|
|
2757
|
+
}
|
|
2758
|
+
}
|
|
2759
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: WidgetManagementEditorComponent, deps: [{ token: i2$1.TranslateService }, { token: WidgetWizardService }, { token: WIDGET_MANAGEMENT_SERVICE }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2760
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.15", type: WidgetManagementEditorComponent, isStandalone: true, selector: "valtimo-widget-management-editor", inputs: { params: "params", availableWidgetTypes: "availableWidgetTypes" }, ngImport: i0, template: "<!--\n ~ Copyright 2015-2025 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<valtimo-carbon-list\n [actionItems]=\"ACTION_ITEMS\"\n [fields]=\"FIELDS\"\n [header]=\"false\"\n [items]=\"widgets$ | async\"\n [dragAndDrop]=\"true\"\n [dragAndDropDisabled]=\"$dragAndDropDisabled()\"\n (itemsReordered)=\"onItemsReordered($event)\"\n (rowClicked)=\"editWidget($event)\"\n>\n <ng-container carbonToolbarContent>\n <ng-container *ngTemplateOutlet=\"addWidgetButton\"></ng-container>\n </ng-container>\n\n <valtimo-no-results\n [action]=\"addWidgetButton\"\n [description]=\"'widgetTabManagement.list.noResults.description' | translate\"\n [title]=\"'widgetTabManagement.list.noResults.title' | translate\"\n ></valtimo-no-results>\n</valtimo-carbon-list>\n\n<ng-template #addWidgetButton>\n <button cdsButton=\"primary\" (click)=\"openAddModal()\">\n {{ 'widgetTabManagement.list.add' | translate }}\n\n <svg class=\"cds--btn__icon\" cdsIcon=\"add\" size=\"16\"></svg>\n </button>\n</ng-template>\n\n<valtimo-widget-management-wizard\n [editMode]=\"$isEditMode()\"\n [open]=\"$isWizardOpen()\"\n (closeEvent)=\"onCloseEvent($event)\"\n></valtimo-widget-management-wizard>\n\n<valtimo-confirmation-modal\n confirmButtonTextTranslationKey=\"interface.delete\"\n confirmButtonType=\"danger\"\n contentTranslationKey=\"Are you sure you want to delete this widget?\"\n [outputOnConfirm]=\"$deleteWidget()\"\n [showModalSubject$]=\"deleteModalOpen$\"\n titleTranslationKey=\"interface.delete\"\n (confirmEvent)=\"onDeleteConfirm($event)\"\n></valtimo-confirmation-modal>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i4.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i2$1.TranslatePipe, name: "translate" }, { kind: "ngmodule", type: CarbonListModule }, { kind: "component", type: i1.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: i1.CarbonNoResultsComponent, selector: "valtimo-no-results", inputs: ["action", "description", "illustration", "title", "smallPadding", "collapseVertically", "alwaysRenderVertically"] }, { kind: "ngmodule", type: ButtonModule }, { kind: "directive", type: i3.Button, selector: "[cdsButton], [ibmButton]", inputs: ["ibmButton", "cdsButton", "size", "skeleton", "iconOnly", "isExpressive"] }, { kind: "ngmodule", type: IconModule }, { kind: "directive", type: i3.IconDirective, selector: "[cdsIcon], [ibmIcon]", inputs: ["ibmIcon", "cdsIcon", "size", "title", "ariaLabel", "ariaLabelledBy", "ariaHidden", "isFocusable"] }, { kind: "ngmodule", type: TabsModule }, { kind: "component", type: WidgetManagementWizardComponent, selector: "valtimo-widget-management-wizard", inputs: ["open", "editMode"], outputs: ["closeEvent"] }, { kind: "ngmodule", type: ConfirmationModalModule }, { kind: "component", type: i1.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"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
2761
|
+
}
|
|
2762
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: WidgetManagementEditorComponent, decorators: [{
|
|
2763
|
+
type: Component,
|
|
2764
|
+
args: [{ selector: 'valtimo-widget-management-editor', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [
|
|
2765
|
+
CommonModule,
|
|
2766
|
+
TranslateModule,
|
|
2767
|
+
CarbonListModule,
|
|
2768
|
+
ButtonModule,
|
|
2769
|
+
IconModule,
|
|
2770
|
+
TabsModule,
|
|
2771
|
+
WidgetManagementWizardComponent,
|
|
2772
|
+
ConfirmationModalModule,
|
|
2773
|
+
], template: "<!--\n ~ Copyright 2015-2025 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<valtimo-carbon-list\n [actionItems]=\"ACTION_ITEMS\"\n [fields]=\"FIELDS\"\n [header]=\"false\"\n [items]=\"widgets$ | async\"\n [dragAndDrop]=\"true\"\n [dragAndDropDisabled]=\"$dragAndDropDisabled()\"\n (itemsReordered)=\"onItemsReordered($event)\"\n (rowClicked)=\"editWidget($event)\"\n>\n <ng-container carbonToolbarContent>\n <ng-container *ngTemplateOutlet=\"addWidgetButton\"></ng-container>\n </ng-container>\n\n <valtimo-no-results\n [action]=\"addWidgetButton\"\n [description]=\"'widgetTabManagement.list.noResults.description' | translate\"\n [title]=\"'widgetTabManagement.list.noResults.title' | translate\"\n ></valtimo-no-results>\n</valtimo-carbon-list>\n\n<ng-template #addWidgetButton>\n <button cdsButton=\"primary\" (click)=\"openAddModal()\">\n {{ 'widgetTabManagement.list.add' | translate }}\n\n <svg class=\"cds--btn__icon\" cdsIcon=\"add\" size=\"16\"></svg>\n </button>\n</ng-template>\n\n<valtimo-widget-management-wizard\n [editMode]=\"$isEditMode()\"\n [open]=\"$isWizardOpen()\"\n (closeEvent)=\"onCloseEvent($event)\"\n></valtimo-widget-management-wizard>\n\n<valtimo-confirmation-modal\n confirmButtonTextTranslationKey=\"interface.delete\"\n confirmButtonType=\"danger\"\n contentTranslationKey=\"Are you sure you want to delete this widget?\"\n [outputOnConfirm]=\"$deleteWidget()\"\n [showModalSubject$]=\"deleteModalOpen$\"\n titleTranslationKey=\"interface.delete\"\n (confirmEvent)=\"onDeleteConfirm($event)\"\n></valtimo-confirmation-modal>\n" }]
|
|
2774
|
+
}], ctorParameters: () => [{ type: i2$1.TranslateService }, { type: WidgetWizardService }, { type: undefined, decorators: [{
|
|
2775
|
+
type: Inject,
|
|
2776
|
+
args: [WIDGET_MANAGEMENT_SERVICE]
|
|
2777
|
+
}] }], propDecorators: { params: [{
|
|
2778
|
+
type: Input
|
|
2779
|
+
}], availableWidgetTypes: [{
|
|
2780
|
+
type: Input
|
|
2781
|
+
}] } });
|
|
2782
|
+
|
|
2783
|
+
/*
|
|
2784
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
2785
|
+
*
|
|
2786
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
2787
|
+
* you may not use this file except in compliance with the License.
|
|
2788
|
+
* You may obtain a copy of the License at
|
|
2789
|
+
*
|
|
2790
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
2791
|
+
*
|
|
2792
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
2793
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
2794
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2795
|
+
* See the License for the specific language governing permissions and
|
|
2796
|
+
* limitations under the License.
|
|
2797
|
+
*/
|
|
2798
|
+
class WidgetManagementComponent {
|
|
2799
|
+
set params(value) {
|
|
2800
|
+
if (!value)
|
|
2801
|
+
return;
|
|
2802
|
+
this.widgetManagementService.initParams(value);
|
|
2803
|
+
}
|
|
2804
|
+
constructor(widgetManagementService) {
|
|
2805
|
+
this.widgetManagementService = widgetManagementService;
|
|
2806
|
+
this.jsonModel$ = this.widgetManagementService
|
|
2807
|
+
.getWidgetConfiguration()
|
|
2808
|
+
.pipe(map((widgets) => ({
|
|
2809
|
+
value: JSON.stringify(widgets),
|
|
2810
|
+
language: 'json',
|
|
2811
|
+
})));
|
|
2812
|
+
this.$activeTab = signal(WidgetManagementTab.VISUAL);
|
|
2813
|
+
this.WidgetManagementTab = WidgetManagementTab;
|
|
2814
|
+
}
|
|
2815
|
+
onSaveEvent(widgets) {
|
|
2816
|
+
this.widgetManagementService.updateWidgetConfiguration(widgets).pipe(take(1)).subscribe();
|
|
2817
|
+
}
|
|
2818
|
+
switchTab(tab) {
|
|
2819
|
+
this.$activeTab.set(tab);
|
|
2820
|
+
}
|
|
2821
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: WidgetManagementComponent, deps: [{ token: WIDGET_MANAGEMENT_SERVICE }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2822
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.15", type: WidgetManagementComponent, isStandalone: true, selector: "valtimo-widget-management", inputs: { params: "params", availableWidgetTypes: "availableWidgetTypes" }, ngImport: i0, template: "<!--\n ~ Copyright 2015-2025 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<cds-tabs type=\"contained\">\n <cds-tab\n [heading]=\"'interface.editor.visualEditor' | translate\"\n (selected)=\"switchTab(WidgetManagementTab.VISUAL)\"\n >\n <valtimo-widget-management-editor\n *ngIf=\"$activeTab() === WidgetManagementTab.VISUAL\"\n [availableWidgetTypes]=\"availableWidgetTypes\"\n ></valtimo-widget-management-editor>\n </cds-tab>\n\n <cds-tab\n [heading]=\"'interface.editor.jsonEditor' | translate\"\n (selected)=\"switchTab(WidgetManagementTab.JSON)\"\n >\n <valtimo-json-editor\n *ngIf=\"$activeTab() === WidgetManagementTab.JSON\"\n [model]=\"jsonModel$ | async\"\n [fitPage]=\"true\"\n [fitPageExtraSpace]=\"136\"\n (saveEvent)=\"onSaveEvent($event)\"\n ></valtimo-json-editor>\n </cds-tab>\n</cds-tabs>\n", styles: ["::ng-deep .cds--tab-content{padding:0!important}\n/*!\n * Copyright 2015-2025 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }, { kind: "component", type: WidgetManagementEditorComponent, selector: "valtimo-widget-management-editor", inputs: ["params", "availableWidgetTypes"] }, { kind: "ngmodule", type: TabsModule }, { kind: "component", type: i3.Tabs, selector: "cds-tabs, ibm-tabs", inputs: ["position", "cacheActive", "followFocus", "isNavigation", "ariaLabel", "ariaLabelledby", "type", "theme", "skeleton"] }, { kind: "component", type: i3.Tab, selector: "cds-tab, ibm-tab", inputs: ["heading", "title", "context", "active", "disabled", "tabIndex", "id", "cacheActive", "tabContent", "templateContext"], outputs: ["selected"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i2$1.TranslatePipe, name: "translate" }, { kind: "component", type: JsonEditorComponent, selector: "valtimo-json-editor", inputs: ["disabled", "model", "editorOptions", "fitPage", "fitPageExtraSpace", "formatOnLoad", "heightPx", "heightStyle", "jsonSchema", "showEditButton", "widthPx"], outputs: ["changeEvent", "discardEvent", "keepEditingEvent", "saveEvent"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
2823
|
+
}
|
|
2824
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: WidgetManagementComponent, decorators: [{
|
|
2825
|
+
type: Component,
|
|
2826
|
+
args: [{ selector: 'valtimo-widget-management', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [
|
|
2827
|
+
CommonModule,
|
|
2828
|
+
WidgetManagementEditorComponent,
|
|
2829
|
+
TabsModule,
|
|
2830
|
+
TranslateModule,
|
|
2831
|
+
JsonEditorComponent,
|
|
2832
|
+
], template: "<!--\n ~ Copyright 2015-2025 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<cds-tabs type=\"contained\">\n <cds-tab\n [heading]=\"'interface.editor.visualEditor' | translate\"\n (selected)=\"switchTab(WidgetManagementTab.VISUAL)\"\n >\n <valtimo-widget-management-editor\n *ngIf=\"$activeTab() === WidgetManagementTab.VISUAL\"\n [availableWidgetTypes]=\"availableWidgetTypes\"\n ></valtimo-widget-management-editor>\n </cds-tab>\n\n <cds-tab\n [heading]=\"'interface.editor.jsonEditor' | translate\"\n (selected)=\"switchTab(WidgetManagementTab.JSON)\"\n >\n <valtimo-json-editor\n *ngIf=\"$activeTab() === WidgetManagementTab.JSON\"\n [model]=\"jsonModel$ | async\"\n [fitPage]=\"true\"\n [fitPageExtraSpace]=\"136\"\n (saveEvent)=\"onSaveEvent($event)\"\n ></valtimo-json-editor>\n </cds-tab>\n</cds-tabs>\n", styles: ["::ng-deep .cds--tab-content{padding:0!important}\n/*!\n * Copyright 2015-2025 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n"] }]
|
|
2833
|
+
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
2834
|
+
type: Inject,
|
|
2835
|
+
args: [WIDGET_MANAGEMENT_SERVICE]
|
|
2836
|
+
}] }], propDecorators: { params: [{
|
|
2837
|
+
type: Input
|
|
2838
|
+
}], availableWidgetTypes: [{
|
|
2839
|
+
type: Input
|
|
2840
|
+
}] } });
|
|
2841
|
+
|
|
2842
|
+
/*
|
|
2843
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
2844
|
+
*
|
|
2845
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
2846
|
+
* you may not use this file except in compliance with the License.
|
|
2847
|
+
* You may obtain a copy of the License at
|
|
2848
|
+
*
|
|
2849
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
2850
|
+
*
|
|
2851
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
2852
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
2853
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2854
|
+
* See the License for the specific language governing permissions and
|
|
2855
|
+
* limitations under the License.
|
|
2856
|
+
*/
|
|
2857
|
+
|
|
2858
|
+
/*
|
|
2859
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
2860
|
+
*
|
|
2861
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
2862
|
+
* you may not use this file except in compliance with the License.
|
|
2863
|
+
* You may obtain a copy of the License at
|
|
2864
|
+
*
|
|
2865
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
2866
|
+
*
|
|
2867
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
2868
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
2869
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2870
|
+
* See the License for the specific language governing permissions and
|
|
2871
|
+
* limitations under the License.
|
|
2872
|
+
*/
|
|
2873
|
+
|
|
2874
|
+
/*
|
|
2875
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
2876
|
+
*
|
|
2877
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
2878
|
+
* you may not use this file except in compliance with the License.
|
|
2879
|
+
* You may obtain a copy of the License at
|
|
2880
|
+
*
|
|
2881
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
2882
|
+
*
|
|
2883
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
2884
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
2885
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2886
|
+
* See the License for the specific language governing permissions and
|
|
2887
|
+
* limitations under the License.
|
|
2888
|
+
*/
|
|
2889
|
+
const WIDGET_WIDTH_1X = 320;
|
|
2890
|
+
const WIDGET_HEIGHT_1X = 200;
|
|
2891
|
+
const DEFAULT_WIDGET_COMPONENT_MAP = {
|
|
2892
|
+
[WidgetType.FORMIO]: WidgetFormioComponent,
|
|
2893
|
+
[WidgetType.CUSTOM]: WidgetCustomComponent,
|
|
2894
|
+
[WidgetType.COLLECTION]: WidgetCollectionComponent,
|
|
2895
|
+
[WidgetType.TABLE]: WidgetTableComponent,
|
|
2896
|
+
[WidgetType.FIELDS]: WidgetFieldComponent,
|
|
2897
|
+
};
|
|
2898
|
+
|
|
2899
|
+
/*
|
|
2900
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
2901
|
+
*
|
|
2902
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
2903
|
+
* you may not use this file except in compliance with the License.
|
|
2904
|
+
* You may obtain a copy of the License at
|
|
2905
|
+
*
|
|
2906
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
2907
|
+
*
|
|
2908
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
2909
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
2910
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2911
|
+
* See the License for the specific language governing permissions and
|
|
2912
|
+
* limitations under the License.
|
|
2913
|
+
*/
|
|
2914
|
+
const WIDGET_MANAGEMENT_SERVICE = new InjectionToken('WIDGET_MANAGEMENT_SERVICE');
|
|
2915
|
+
|
|
2916
|
+
/*
|
|
2917
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
2918
|
+
*
|
|
2919
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
2920
|
+
* you may not use this file except in compliance with the License.
|
|
2921
|
+
* You may obtain a copy of the License at
|
|
2922
|
+
*
|
|
2923
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
2924
|
+
*
|
|
2925
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
2926
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
2927
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2928
|
+
* See the License for the specific language governing permissions and
|
|
2929
|
+
* limitations under the License.
|
|
2930
|
+
*/
|
|
2931
|
+
|
|
2932
|
+
/*
|
|
2933
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
2934
|
+
*
|
|
2935
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
2936
|
+
* you may not use this file except in compliance with the License.
|
|
2937
|
+
* You may obtain a copy of the License at
|
|
2938
|
+
*
|
|
2939
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
2940
|
+
*
|
|
2941
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
2942
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
2943
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2944
|
+
* See the License for the specific language governing permissions and
|
|
2945
|
+
* limitations under the License.
|
|
2946
|
+
*/
|
|
2947
|
+
class WidgetLayoutService {
|
|
2948
|
+
get _muuri$() {
|
|
2949
|
+
return this._muuriSubject$.pipe(filter(muuri => !!muuri));
|
|
373
2950
|
}
|
|
374
|
-
|
|
375
|
-
return
|
|
376
|
-
k.split(delimiter).reduce((acc, e, i, keys) => acc[e] ||
|
|
377
|
-
(acc[e] = isNaN(Number(keys[i + 1])) ? (keys.length - 1 === i ? obj[k] : {}) : []), res);
|
|
378
|
-
return res;
|
|
379
|
-
}, {});
|
|
2951
|
+
get _containerWidth$() {
|
|
2952
|
+
return this._containerWidthSubject$.pipe(filter(width => width !== null));
|
|
380
2953
|
}
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
2954
|
+
get amountOfColumns$() {
|
|
2955
|
+
return this._containerWidth$.pipe(map(containerWidth => Math.floor(containerWidth / WIDGET_WIDTH_1X)));
|
|
2956
|
+
}
|
|
2957
|
+
get _widgets$() {
|
|
2958
|
+
return this._widgetsSubject$.pipe(filter(widgets => widgets !== null));
|
|
2959
|
+
}
|
|
2960
|
+
get _widgetDataLoaded$() {
|
|
2961
|
+
return this._widgetDataLoadedSubject$.pipe(filter(loaded => loaded !== null));
|
|
2962
|
+
}
|
|
2963
|
+
get loaded$() {
|
|
2964
|
+
return combineLatest([
|
|
2965
|
+
this._widgetDataLoaded$,
|
|
2966
|
+
this._widgets$,
|
|
2967
|
+
this._widgetsWithExternalData$,
|
|
2968
|
+
this._widgetsWithExternalDataReady$,
|
|
2969
|
+
this._containerWidth$,
|
|
2970
|
+
]).pipe(map(([widgetDataLoaded, widgets, widgetsWithExternalData, widgetsWithExternalDataReady]) => widgetDataLoaded?.length === widgets.length &&
|
|
2971
|
+
widgetsWithExternalData.length === widgetsWithExternalDataReady.length), filter(loaded => !!loaded));
|
|
2972
|
+
}
|
|
2973
|
+
constructor() {
|
|
2974
|
+
this._containerWidthSubject$ = new BehaviorSubject(null);
|
|
2975
|
+
this._widgetsSubject$ = new BehaviorSubject(null);
|
|
2976
|
+
this._widgetDataLoadedSubject$ = new BehaviorSubject(null);
|
|
2977
|
+
this._muuriSubject$ = new BehaviorSubject(null);
|
|
2978
|
+
this._triggerMuuriLayout$ = new Subject();
|
|
2979
|
+
this._widgetsWithExternalData$ = new BehaviorSubject([]);
|
|
2980
|
+
this._widgetsWithExternalDataReady$ = new BehaviorSubject([]);
|
|
2981
|
+
this._subscriptions = new Subscription();
|
|
2982
|
+
this.openMuuriSubscription();
|
|
2983
|
+
}
|
|
2984
|
+
ngOnDestroy() {
|
|
2985
|
+
this._subscriptions.unsubscribe();
|
|
2986
|
+
}
|
|
2987
|
+
setMuuri(muuri) {
|
|
2988
|
+
this._muuriSubject$.next(muuri);
|
|
2989
|
+
}
|
|
2990
|
+
triggerMuuriLayout() {
|
|
2991
|
+
this._triggerMuuriLayout$.next(null);
|
|
2992
|
+
}
|
|
2993
|
+
setWidgets(widgets) {
|
|
2994
|
+
this._widgetsSubject$.next(widgets);
|
|
2995
|
+
}
|
|
2996
|
+
setWidgetWithExternalData(uuid) {
|
|
2997
|
+
this._widgetsWithExternalData$.pipe(take(1)).subscribe(widgetsWithExternalData => {
|
|
2998
|
+
this._widgetsWithExternalData$.next([...widgetsWithExternalData, uuid]);
|
|
394
2999
|
});
|
|
395
|
-
|
|
396
|
-
|
|
3000
|
+
}
|
|
3001
|
+
setWidgetWithExternalDataReady(uuid) {
|
|
3002
|
+
this._widgetsWithExternalDataReady$.pipe(take(1)).subscribe(widgetsWithExternalDataReady => {
|
|
3003
|
+
this._widgetsWithExternalDataReady$.next([...widgetsWithExternalDataReady, uuid]);
|
|
397
3004
|
});
|
|
398
|
-
|
|
399
|
-
|
|
3005
|
+
}
|
|
3006
|
+
setContainerWidth(width) {
|
|
3007
|
+
this._containerWidthSubject$.next(width);
|
|
3008
|
+
}
|
|
3009
|
+
setWidgetDataLoaded(uuid) {
|
|
3010
|
+
this._widgetDataLoadedSubject$.pipe(take(1)).subscribe(widgetDataLoaded => {
|
|
3011
|
+
if (!(widgetDataLoaded || []).includes(uuid)) {
|
|
3012
|
+
this._widgetDataLoadedSubject$.next([...(widgetDataLoaded || []), uuid]);
|
|
3013
|
+
}
|
|
400
3014
|
});
|
|
401
|
-
return localizations;
|
|
402
3015
|
}
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
3016
|
+
reset() {
|
|
3017
|
+
this._containerWidthSubject$.next(null);
|
|
3018
|
+
this._widgetsSubject$.next(null);
|
|
3019
|
+
this._widgetDataLoadedSubject$.next(null);
|
|
3020
|
+
this._widgetsWithExternalData$.next([]);
|
|
3021
|
+
this._widgetsWithExternalDataReady$.next([]);
|
|
3022
|
+
this._muuriSubject$.next(null);
|
|
3023
|
+
}
|
|
3024
|
+
openMuuriSubscription() {
|
|
3025
|
+
this._subscriptions.add(combineLatest([this._muuri$, this._triggerMuuriLayout$])
|
|
3026
|
+
.pipe(debounceTime(150))
|
|
3027
|
+
.subscribe(([muuri]) => {
|
|
3028
|
+
muuri.refreshItems();
|
|
3029
|
+
muuri.layout();
|
|
3030
|
+
}));
|
|
3031
|
+
}
|
|
3032
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: WidgetLayoutService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
3033
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: WidgetLayoutService, providedIn: 'root' }); }
|
|
3034
|
+
}
|
|
3035
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: WidgetLayoutService, decorators: [{
|
|
3036
|
+
type: Injectable,
|
|
3037
|
+
args: [{ providedIn: 'root' }]
|
|
3038
|
+
}], ctorParameters: () => [] });
|
|
3039
|
+
|
|
3040
|
+
/*
|
|
3041
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
3042
|
+
*
|
|
3043
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
3044
|
+
* you may not use this file except in compliance with the License.
|
|
3045
|
+
* You may obtain a copy of the License at
|
|
3046
|
+
*
|
|
3047
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
3048
|
+
*
|
|
3049
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
3050
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
3051
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
3052
|
+
* See the License for the specific language governing permissions and
|
|
3053
|
+
* limitations under the License.
|
|
3054
|
+
*/
|
|
3055
|
+
class WidgetFieldsService {
|
|
3056
|
+
constructor(fb, translateService) {
|
|
3057
|
+
this.fb = fb;
|
|
3058
|
+
this.translateService = translateService;
|
|
3059
|
+
this.displayTypeItems = [
|
|
3060
|
+
{
|
|
3061
|
+
content: this.translateService.instant(`widgetTabManagement.content.displayType.${WidgetDisplayTypeKey.TEXT}`),
|
|
3062
|
+
id: WidgetDisplayTypeKey.TEXT,
|
|
3063
|
+
selected: true,
|
|
3064
|
+
},
|
|
3065
|
+
{
|
|
3066
|
+
content: this.translateService.instant(`widgetTabManagement.content.displayType.${WidgetDisplayTypeKey.BOOLEAN}`),
|
|
3067
|
+
id: WidgetDisplayTypeKey.BOOLEAN,
|
|
3068
|
+
selected: false,
|
|
3069
|
+
},
|
|
3070
|
+
{
|
|
3071
|
+
content: this.translateService.instant(`widgetTabManagement.content.displayType.${WidgetDisplayTypeKey.CURRENCY}`),
|
|
3072
|
+
id: WidgetDisplayTypeKey.CURRENCY,
|
|
3073
|
+
selected: false,
|
|
3074
|
+
},
|
|
3075
|
+
{
|
|
3076
|
+
content: this.translateService.instant(`widgetTabManagement.content.displayType.${WidgetDisplayTypeKey.DATE}`),
|
|
3077
|
+
id: WidgetDisplayTypeKey.DATE,
|
|
3078
|
+
selected: false,
|
|
3079
|
+
},
|
|
3080
|
+
{
|
|
3081
|
+
content: this.translateService.instant(`widgetTabManagement.content.displayType.${WidgetDisplayTypeKey.DATE_TIME}`),
|
|
3082
|
+
id: WidgetDisplayTypeKey.DATE_TIME,
|
|
3083
|
+
selected: false,
|
|
3084
|
+
},
|
|
3085
|
+
{
|
|
3086
|
+
content: this.translateService.instant(`widgetTabManagement.content.displayType.${WidgetDisplayTypeKey.ENUM}`),
|
|
3087
|
+
id: WidgetDisplayTypeKey.ENUM,
|
|
3088
|
+
selected: false,
|
|
3089
|
+
},
|
|
3090
|
+
{
|
|
3091
|
+
content: this.translateService.instant(`widgetTabManagement.content.displayType.${WidgetDisplayTypeKey.NUMBER}`),
|
|
3092
|
+
id: WidgetDisplayTypeKey.NUMBER,
|
|
3093
|
+
selected: false,
|
|
3094
|
+
},
|
|
3095
|
+
{
|
|
3096
|
+
content: this.translateService.instant(`widgetTabManagement.content.displayType.${WidgetDisplayTypeKey.PERCENT}`),
|
|
3097
|
+
id: WidgetDisplayTypeKey.PERCENT,
|
|
3098
|
+
selected: false,
|
|
3099
|
+
},
|
|
3100
|
+
{
|
|
3101
|
+
content: this.translateService.instant(`widgetTabManagement.content.displayType.${WidgetDisplayTypeKey.LINK}`),
|
|
3102
|
+
id: WidgetDisplayTypeKey.LINK,
|
|
3103
|
+
selected: false,
|
|
3104
|
+
},
|
|
3105
|
+
];
|
|
3106
|
+
}
|
|
3107
|
+
getDisplayItemsSelected(control) {
|
|
3108
|
+
const typeControlValue = control.get('type')?.value;
|
|
3109
|
+
if (!typeControlValue)
|
|
3110
|
+
return this.displayTypeItems;
|
|
3111
|
+
return this.displayTypeItems.map((item) => ({
|
|
3112
|
+
...item,
|
|
3113
|
+
selected: typeControlValue.id === item.id && typeControlValue.selected,
|
|
3114
|
+
}));
|
|
3115
|
+
}
|
|
3116
|
+
onDisplayTypeSelected(mainKeysArray, formGroup, event) {
|
|
3117
|
+
const extraControlKeys = Object.keys(formGroup.controls).filter((key) => !mainKeysArray.includes(key));
|
|
3118
|
+
extraControlKeys.forEach((controlKey) => formGroup.removeControl(controlKey));
|
|
3119
|
+
switch (event.item.id) {
|
|
3120
|
+
case WidgetDisplayTypeKey.BOOLEAN:
|
|
3121
|
+
break;
|
|
3122
|
+
case WidgetDisplayTypeKey.TEXT:
|
|
3123
|
+
formGroup.addControl('ellipsisCharacterLimit', this.fb.control(''));
|
|
3124
|
+
break;
|
|
3125
|
+
case WidgetDisplayTypeKey.CURRENCY:
|
|
3126
|
+
formGroup.addControl('currencyCode', this.fb.control(''));
|
|
3127
|
+
formGroup.addControl('display', this.fb.control(''));
|
|
3128
|
+
formGroup.addControl('digitsInfo', this.fb.control(''));
|
|
3129
|
+
break;
|
|
3130
|
+
case WidgetDisplayTypeKey.DATE:
|
|
3131
|
+
formGroup.addControl('format', this.fb.control(''));
|
|
3132
|
+
break;
|
|
3133
|
+
case WidgetDisplayTypeKey.DATE_TIME:
|
|
3134
|
+
formGroup.addControl('format', this.fb.control(''));
|
|
3135
|
+
break;
|
|
3136
|
+
case WidgetDisplayTypeKey.LINK:
|
|
3137
|
+
formGroup.addControl('linkText', this.fb.control(''));
|
|
3138
|
+
break;
|
|
3139
|
+
case WidgetDisplayTypeKey.ENUM:
|
|
3140
|
+
formGroup.addControl('values', this.fb.array([
|
|
3141
|
+
this.fb.group({
|
|
3142
|
+
key: this.fb.control('', Validators.required),
|
|
3143
|
+
value: this.fb.control('', Validators.required),
|
|
3144
|
+
}),
|
|
3145
|
+
], Validators.required));
|
|
3146
|
+
break;
|
|
3147
|
+
default:
|
|
3148
|
+
formGroup.addControl('digitsInfo', this.fb.control(''));
|
|
3149
|
+
break;
|
|
406
3150
|
}
|
|
407
|
-
const firstLanguageOption = languageOptions[0];
|
|
408
|
-
const firstLanguageTranslations = firstLanguageOption && mergedLocalizations[firstLanguageOption];
|
|
409
|
-
const flattenedFirstLanguageTranslations = firstLanguageTranslations && this.flattenObject(firstLanguageTranslations);
|
|
410
|
-
return Object.keys(flattenedFirstLanguageTranslations).map(flattenedTranslationKey => {
|
|
411
|
-
const emptyArbitraryValue = {};
|
|
412
|
-
emptyArbitraryValue['0'] = flattenedTranslationKey;
|
|
413
|
-
languageOptions.forEach((languageOption, index) => {
|
|
414
|
-
emptyArbitraryValue[`${index + 1}`] =
|
|
415
|
-
this.flattenObject(mergedLocalizations[languageOption])[flattenedTranslationKey] || '';
|
|
416
|
-
});
|
|
417
|
-
return emptyArbitraryValue;
|
|
418
|
-
});
|
|
419
3151
|
}
|
|
420
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
421
|
-
static { this.ɵ
|
|
3152
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: WidgetFieldsService, deps: [{ token: i2.FormBuilder }, { token: i2$1.TranslateService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
3153
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: WidgetFieldsService, providedIn: 'root' }); }
|
|
422
3154
|
}
|
|
423
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
424
|
-
type:
|
|
425
|
-
args: [{
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
3155
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: WidgetFieldsService, decorators: [{
|
|
3156
|
+
type: Injectable,
|
|
3157
|
+
args: [{
|
|
3158
|
+
providedIn: 'root',
|
|
3159
|
+
}]
|
|
3160
|
+
}], ctorParameters: () => [{ type: i2.FormBuilder }, { type: i2$1.TranslateService }] });
|
|
3161
|
+
|
|
3162
|
+
/*
|
|
3163
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
3164
|
+
*
|
|
3165
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
3166
|
+
* you may not use this file except in compliance with the License.
|
|
3167
|
+
* You may obtain a copy of the License at
|
|
3168
|
+
*
|
|
3169
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
3170
|
+
*
|
|
3171
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
3172
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
3173
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
3174
|
+
* See the License for the specific language governing permissions and
|
|
3175
|
+
* limitations under the License.
|
|
3176
|
+
*/
|
|
3177
|
+
class WidgetWizardService {
|
|
3178
|
+
constructor() {
|
|
3179
|
+
this.$selectedWidget = signal(null);
|
|
3180
|
+
this.$widgetWidth = signal(null);
|
|
3181
|
+
this.$widgetStyle = signal(null);
|
|
3182
|
+
this.$widgetContent = signal(null);
|
|
3183
|
+
this.$widgetTitle = signal(null);
|
|
3184
|
+
this.$widgetKey = signal(null);
|
|
3185
|
+
this.$widgetActions = signal(undefined);
|
|
3186
|
+
this.$widgetsConfig = computed(() => ({
|
|
3187
|
+
key: this.$widgetKey() ?? '',
|
|
3188
|
+
title: this.$widgetTitle() ?? '',
|
|
3189
|
+
type: this.$selectedWidget()?.type ?? WidgetType.FIELDS,
|
|
3190
|
+
width: this.$widgetWidth() ?? 4,
|
|
3191
|
+
highContrast: (this.$widgetStyle() ?? WidgetStyle.DEFAULT) === WidgetStyle.HIGH_CONTRAST,
|
|
3192
|
+
properties: this.$widgetContent() ?? {},
|
|
3193
|
+
actions: this.$widgetActions() ?? [],
|
|
3194
|
+
}));
|
|
3195
|
+
this.$editMode = signal(false);
|
|
3196
|
+
this.$usedWidgetKeys = signal([]);
|
|
3197
|
+
this.$availableWidgetTypes = signal(null);
|
|
3198
|
+
}
|
|
3199
|
+
resetWizard() {
|
|
3200
|
+
this.$selectedWidget.set(null);
|
|
3201
|
+
this.$widgetWidth.set(null);
|
|
3202
|
+
this.$widgetStyle.set(null);
|
|
3203
|
+
this.$widgetContent.set(null);
|
|
3204
|
+
this.$widgetTitle.set(null);
|
|
3205
|
+
this.$widgetKey.set(null);
|
|
3206
|
+
this.$widgetActions.set(undefined);
|
|
3207
|
+
this.$editMode.set(false);
|
|
3208
|
+
}
|
|
3209
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: WidgetWizardService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
3210
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: WidgetWizardService, providedIn: 'root' }); }
|
|
3211
|
+
}
|
|
3212
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: WidgetWizardService, decorators: [{
|
|
3213
|
+
type: Injectable,
|
|
3214
|
+
args: [{
|
|
3215
|
+
providedIn: 'root',
|
|
3216
|
+
}]
|
|
3217
|
+
}] });
|
|
3218
|
+
|
|
3219
|
+
/*
|
|
3220
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
3221
|
+
*
|
|
3222
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
3223
|
+
* you may not use this file except in compliance with the License.
|
|
3224
|
+
* You may obtain a copy of the License at
|
|
3225
|
+
*
|
|
3226
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
3227
|
+
*
|
|
3228
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
3229
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
3230
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
3231
|
+
* See the License for the specific language governing permissions and
|
|
3232
|
+
* limitations under the License.
|
|
3233
|
+
*/
|
|
3234
|
+
|
|
3235
|
+
/*
|
|
3236
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
3237
|
+
*
|
|
3238
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
3239
|
+
* you may not use this file except in compliance with the License.
|
|
3240
|
+
* You may obtain a copy of the License at
|
|
3241
|
+
*
|
|
3242
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
3243
|
+
*
|
|
3244
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
3245
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
3246
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
3247
|
+
* See the License for the specific language governing permissions and
|
|
3248
|
+
* limitations under the License.
|
|
3249
|
+
*/
|
|
3250
|
+
class LayoutModule {
|
|
3251
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: LayoutModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
3252
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.15", ngImport: i0, type: LayoutModule, declarations: [LayoutComponent, LayoutPublicComponent, LayoutInternalComponent], imports: [RouterModule,
|
|
3253
|
+
MenuRoutingModule,
|
|
3254
|
+
TopbarModule,
|
|
3255
|
+
LeftSidebarModule,
|
|
3256
|
+
RightSidebarModule,
|
|
3257
|
+
PageHeaderModule,
|
|
3258
|
+
AlertModule,
|
|
3259
|
+
CommonModule,
|
|
3260
|
+
PromptModule,
|
|
3261
|
+
GlobalNotificationComponent], exports: [LayoutComponent] }); }
|
|
3262
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: LayoutModule, imports: [RouterModule,
|
|
3263
|
+
MenuRoutingModule,
|
|
3264
|
+
TopbarModule,
|
|
3265
|
+
LeftSidebarModule,
|
|
3266
|
+
RightSidebarModule,
|
|
3267
|
+
PageHeaderModule,
|
|
3268
|
+
AlertModule,
|
|
3269
|
+
CommonModule,
|
|
3270
|
+
PromptModule,
|
|
3271
|
+
GlobalNotificationComponent] }); }
|
|
3272
|
+
}
|
|
3273
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: LayoutModule, decorators: [{
|
|
3274
|
+
type: NgModule,
|
|
3275
|
+
args: [{
|
|
3276
|
+
declarations: [LayoutComponent, LayoutPublicComponent, LayoutInternalComponent],
|
|
3277
|
+
imports: [
|
|
3278
|
+
RouterModule,
|
|
3279
|
+
MenuRoutingModule,
|
|
3280
|
+
TopbarModule,
|
|
3281
|
+
LeftSidebarModule,
|
|
3282
|
+
RightSidebarModule,
|
|
3283
|
+
PageHeaderModule,
|
|
3284
|
+
AlertModule,
|
|
3285
|
+
CommonModule,
|
|
3286
|
+
PromptModule,
|
|
3287
|
+
GlobalNotificationComponent,
|
|
3288
|
+
],
|
|
3289
|
+
exports: [LayoutComponent],
|
|
3290
|
+
}]
|
|
3291
|
+
}] });
|
|
430
3292
|
|
|
431
3293
|
/*
|
|
432
3294
|
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
@@ -452,11 +3314,11 @@ const routes = [
|
|
|
452
3314
|
},
|
|
453
3315
|
];
|
|
454
3316
|
class TranslationManagementRoutingModule {
|
|
455
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
456
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.
|
|
457
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.
|
|
3317
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TranslationManagementRoutingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
3318
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.15", ngImport: i0, type: TranslationManagementRoutingModule, imports: [i2$2.RouterModule], exports: [RouterModule] }); }
|
|
3319
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TranslationManagementRoutingModule, imports: [RouterModule.forChild(routes), RouterModule] }); }
|
|
458
3320
|
}
|
|
459
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
3321
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TranslationManagementRoutingModule, decorators: [{
|
|
460
3322
|
type: NgModule,
|
|
461
3323
|
args: [{
|
|
462
3324
|
imports: [RouterModule.forChild(routes)],
|
|
@@ -480,8 +3342,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
480
3342
|
* limitations under the License.
|
|
481
3343
|
*/
|
|
482
3344
|
class TranslationManagementModule {
|
|
483
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
484
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.
|
|
3345
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TranslationManagementModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
3346
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.15", ngImport: i0, type: TranslationManagementModule, declarations: [TranslationManagementComponent], imports: [CommonModule,
|
|
485
3347
|
TranslateModule,
|
|
486
3348
|
TranslationManagementRoutingModule,
|
|
487
3349
|
MultiInputFormModule,
|
|
@@ -491,7 +3353,7 @@ class TranslationManagementModule {
|
|
|
491
3353
|
ButtonModule,
|
|
492
3354
|
IconModule,
|
|
493
3355
|
ConfirmationModalModule] }); }
|
|
494
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.
|
|
3356
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TranslationManagementModule, imports: [CommonModule,
|
|
495
3357
|
TranslateModule,
|
|
496
3358
|
TranslationManagementRoutingModule,
|
|
497
3359
|
MultiInputFormModule,
|
|
@@ -501,7 +3363,7 @@ class TranslationManagementModule {
|
|
|
501
3363
|
IconModule,
|
|
502
3364
|
ConfirmationModalModule] }); }
|
|
503
3365
|
}
|
|
504
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
3366
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TranslationManagementModule, decorators: [{
|
|
505
3367
|
type: NgModule,
|
|
506
3368
|
args: [{
|
|
507
3369
|
declarations: [TranslationManagementComponent],
|
|
@@ -521,6 +3383,38 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
521
3383
|
}]
|
|
522
3384
|
}] });
|
|
523
3385
|
|
|
3386
|
+
/*
|
|
3387
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
3388
|
+
*
|
|
3389
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
3390
|
+
* you may not use this file except in compliance with the License.
|
|
3391
|
+
* You may obtain a copy of the License at
|
|
3392
|
+
*
|
|
3393
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
3394
|
+
*
|
|
3395
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
3396
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
3397
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
3398
|
+
* See the License for the specific language governing permissions and
|
|
3399
|
+
* limitations under the License.
|
|
3400
|
+
*/
|
|
3401
|
+
|
|
3402
|
+
/*
|
|
3403
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
3404
|
+
*
|
|
3405
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
3406
|
+
* you may not use this file except in compliance with the License.
|
|
3407
|
+
* You may obtain a copy of the License at
|
|
3408
|
+
*
|
|
3409
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
3410
|
+
*
|
|
3411
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
3412
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
3413
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
3414
|
+
* See the License for the specific language governing permissions and
|
|
3415
|
+
* limitations under the License.
|
|
3416
|
+
*/
|
|
3417
|
+
|
|
524
3418
|
/*
|
|
525
3419
|
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
526
3420
|
*
|
|
@@ -544,5 +3438,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
544
3438
|
* Generated bundle index. Do not edit.
|
|
545
3439
|
*/
|
|
546
3440
|
|
|
547
|
-
export { LayoutComponent, LayoutModule, LayoutService, TranslationManagementModule };
|
|
3441
|
+
export { AVAILABLE_WIDGETS, CUSTOM_WIDGET_TOKEN, DEFAULT_WIDGET_COMPONENT_MAP, LayoutComponent, LayoutInternalComponent, LayoutModule, LayoutPublicComponent, LayoutService, TranslationManagementComponent, TranslationManagementModule, WIDGET_HEIGHT_1X, WIDGET_MANAGEMENT_SERVICE, WIDGET_STYLE_LABELS, WIDGET_WIDTH_1X, WIDGET_WIDTH_LABELS, WidgetBlockComponent, WidgetCollectionComponent, WidgetContainerComponent, WidgetCustomComponent, WidgetDisplayTypeKey, WidgetFieldComponent, WidgetFieldsService, WidgetFormioComponent, WidgetLayoutService, WidgetManagementCollectionComponent, WidgetManagementComponent, WidgetManagementCustomComponent, WidgetManagementEditorComponent, WidgetManagementFieldsComponent, WidgetManagementTab, WidgetManagementTableComponent, WidgetManagementWizardComponent, WidgetStyle, WidgetTableComponent, WidgetType, WidgetTypeTags, WidgetWizardCloseEventType, WidgetWizardService, WidgetWizardStep };
|
|
548
3442
|
//# sourceMappingURL=valtimo-layout.mjs.map
|