@valtimo/form-management 11.3.1 → 12.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2022/lib/form-management-create/form-management-create.component.mjs +8 -8
- package/esm2022/lib/form-management-duplicate/form-management-duplicate.component.mjs +9 -9
- package/esm2022/lib/form-management-edit/form-management-edit.component.mjs +123 -87
- package/esm2022/lib/form-management-routing.module.mjs +8 -12
- package/esm2022/lib/form-management-upload/form-management-upload.component.mjs +8 -8
- package/esm2022/lib/form-management.component.mjs +61 -13
- package/esm2022/lib/form-management.module.mjs +37 -13
- package/esm2022/lib/models/form-definition.model.mjs +2 -2
- package/esm2022/lib/models/form-edit-tabs.enum.mjs +22 -0
- package/esm2022/lib/models/index.mjs +3 -2
- package/esm2022/lib/services/form-management-state.service.mjs +59 -0
- package/esm2022/lib/services/form-management.service.mjs +56 -0
- package/esm2022/lib/services/index.mjs +18 -0
- package/esm2022/lib/validators/no-duplicate-form.validator.mjs +2 -2
- package/esm2022/public-api.mjs +3 -3
- package/fesm2022/valtimo-form-management.mjs +358 -224
- package/fesm2022/valtimo-form-management.mjs.map +1 -1
- package/lib/form-management-create/form-management-create.component.d.ts +1 -1
- package/lib/form-management-create/form-management-create.component.d.ts.map +1 -1
- package/lib/form-management-duplicate/form-management-duplicate.component.d.ts +1 -1
- package/lib/form-management-duplicate/form-management-duplicate.component.d.ts.map +1 -1
- package/lib/form-management-edit/form-management-edit.component.d.ts +34 -13
- package/lib/form-management-edit/form-management-edit.component.d.ts.map +1 -1
- package/lib/form-management-routing.module.d.ts +0 -3
- package/lib/form-management-routing.module.d.ts.map +1 -1
- package/lib/form-management.component.d.ts +18 -4
- package/lib/form-management.component.d.ts.map +1 -1
- package/lib/form-management.module.d.ts +11 -12
- package/lib/form-management.module.d.ts.map +1 -1
- package/lib/models/form-edit-tabs.enum.d.ts +6 -0
- package/lib/models/form-edit-tabs.enum.d.ts.map +1 -0
- package/lib/models/index.d.ts +1 -0
- package/lib/models/index.d.ts.map +1 -1
- package/lib/services/form-management-state.service.d.ts +19 -0
- package/lib/services/form-management-state.service.d.ts.map +1 -0
- package/lib/{form-management.service.d.ts → services/form-management.service.d.ts} +1 -1
- package/lib/services/form-management.service.d.ts.map +1 -0
- package/lib/services/index.d.ts +3 -0
- package/lib/services/index.d.ts.map +1 -0
- package/lib/validators/no-duplicate-form.validator.d.ts +1 -1
- package/lib/validators/no-duplicate-form.validator.d.ts.map +1 -1
- package/package.json +3 -3
- package/public-api.d.ts +1 -1
- package/public-api.d.ts.map +1 -1
- package/esm2022/lib/form-management-list/form-management-list.component.mjs +0 -69
- package/esm2022/lib/form-management.service.mjs +0 -56
- package/lib/form-management-list/form-management-list.component.d.ts +0 -27
- package/lib/form-management-list/form-management-list.component.d.ts.map +0 -1
- package/lib/form-management.service.d.ts.map +0 -1
|
@@ -1,29 +1,30 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Injectable, Component, Inject, EventEmitter, ViewChild, Input, Output, ViewEncapsulation, NgModule } from '@angular/core';
|
|
2
|
+
import { Injectable, Component, Inject, EventEmitter, ViewChild, Input, Output, ViewEncapsulation, HostBinding, NgModule } from '@angular/core';
|
|
3
3
|
import * as i1 from '@angular/common/http';
|
|
4
4
|
import * as i2 from '@valtimo/config';
|
|
5
5
|
import { ROLE_ADMIN, RouterUtils } from '@valtimo/config';
|
|
6
|
-
import
|
|
6
|
+
import { Subject, BehaviorSubject, take, map, combineLatest, filter, distinctUntilChanged, tap, Subscription, switchMap } from 'rxjs';
|
|
7
|
+
import { Upload16 } from '@carbon/icons';
|
|
8
|
+
import * as i3 from 'carbon-components-angular';
|
|
9
|
+
import { ModalModule, InputModule as InputModule$1, PlaceholderModule, ButtonModule as ButtonModule$1, DialogModule, TabsModule, IconModule, TagModule } from 'carbon-components-angular';
|
|
10
|
+
import * as i3$1 from '@angular/router';
|
|
7
11
|
import { RouterModule } from '@angular/router';
|
|
8
12
|
import * as i1$1 from '@valtimo/components';
|
|
9
|
-
import { PendingChangesComponent, pendingChangesGuard, FormIoModule, WidgetModule, ListModule, DropzoneModule, VModalModule, ModalModule as ModalModule$1, InputModule, TitleModule, ButtonModule, FormModule, ValtimoCdsModalDirectiveModule } from '@valtimo/components';
|
|
13
|
+
import { PendingChangesComponent, pendingChangesGuard, FormIoModule, WidgetModule, ListModule, DropzoneModule, VModalModule, ModalModule as ModalModule$1, InputModule, TitleModule, ButtonModule, FormModule, ValtimoCdsModalDirectiveModule, CarbonListModule, RenderInPageHeaderDirectiveModule, EditorModule, SpinnerModule, ConfirmationModalModule } from '@valtimo/components';
|
|
10
14
|
import * as i2$1 from '@ngx-translate/core';
|
|
11
15
|
import { TranslateModule } from '@ngx-translate/core';
|
|
12
16
|
import { AuthGuardService } from '@valtimo/security';
|
|
13
17
|
import * as i2$2 from '@angular/forms';
|
|
14
18
|
import { FormControl, Validators, FormGroup, ReactiveFormsModule, FormsModule } from '@angular/forms';
|
|
15
|
-
import {
|
|
16
|
-
import { take, first } from 'rxjs/operators';
|
|
19
|
+
import { take as take$1 } from 'rxjs/operators';
|
|
17
20
|
import * as i5 from '@angular/common';
|
|
18
21
|
import { CommonModule } from '@angular/common';
|
|
19
22
|
import { BaseModal } from 'carbon-components-angular/modal';
|
|
20
|
-
import * as i6 from 'carbon-components-angular';
|
|
21
|
-
import { ModalModule, InputModule as InputModule$1, PlaceholderModule, ButtonModule as ButtonModule$1 } from 'carbon-components-angular';
|
|
22
23
|
import * as i1$2 from '@valtimo/document';
|
|
23
24
|
import { NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap';
|
|
24
25
|
|
|
25
26
|
/*
|
|
26
|
-
* Copyright 2015-
|
|
27
|
+
* Copyright 2015-2024 Ritense BV, the Netherlands.
|
|
27
28
|
*
|
|
28
29
|
* Licensed under EUPL, Version 1.2 (the "License");
|
|
29
30
|
* you may not use this file except in compliance with the License.
|
|
@@ -64,18 +65,18 @@ class FormManagementService {
|
|
|
64
65
|
deleteFormDefinition(formDefinitionId) {
|
|
65
66
|
return this.http.delete(`${this.valtimoApiConfig.endpointUri}v1/form-management/${formDefinitionId}`);
|
|
66
67
|
}
|
|
67
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
68
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
68
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: FormManagementService, deps: [{ token: i1.HttpClient }, { token: i2.ConfigService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
69
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: FormManagementService, providedIn: 'root' }); }
|
|
69
70
|
}
|
|
70
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
71
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: FormManagementService, decorators: [{
|
|
71
72
|
type: Injectable,
|
|
72
73
|
args: [{
|
|
73
74
|
providedIn: 'root',
|
|
74
75
|
}]
|
|
75
|
-
}], ctorParameters:
|
|
76
|
+
}], ctorParameters: () => [{ type: i1.HttpClient }, { type: i2.ConfigService }] });
|
|
76
77
|
|
|
77
78
|
/*
|
|
78
|
-
* Copyright 2015-
|
|
79
|
+
* Copyright 2015-2024 Ritense BV, the Netherlands.
|
|
79
80
|
*
|
|
80
81
|
* Licensed under EUPL, Version 1.2 (the "License");
|
|
81
82
|
* you may not use this file except in compliance with the License.
|
|
@@ -89,17 +90,86 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
89
90
|
* See the License for the specific language governing permissions and
|
|
90
91
|
* limitations under the License.
|
|
91
92
|
*/
|
|
92
|
-
class
|
|
93
|
-
|
|
94
|
-
this.
|
|
95
|
-
this.
|
|
93
|
+
class FormManagementStateService {
|
|
94
|
+
constructor() {
|
|
95
|
+
this._showModal$ = new Subject();
|
|
96
|
+
this._hideModal$ = new Subject();
|
|
97
|
+
this._refresh$ = new BehaviorSubject(null);
|
|
98
|
+
this._modalType$ = new BehaviorSubject('add');
|
|
99
|
+
}
|
|
100
|
+
get showModal$() {
|
|
101
|
+
return this._showModal$.asObservable();
|
|
102
|
+
}
|
|
103
|
+
get hideModal$() {
|
|
104
|
+
return this._hideModal$.asObservable();
|
|
105
|
+
}
|
|
106
|
+
get refresh$() {
|
|
107
|
+
return this._refresh$.asObservable();
|
|
108
|
+
}
|
|
109
|
+
get modalType$() {
|
|
110
|
+
return this._modalType$.asObservable();
|
|
111
|
+
}
|
|
112
|
+
showModal() {
|
|
113
|
+
this._showModal$.next(null);
|
|
96
114
|
}
|
|
97
|
-
|
|
115
|
+
hideModal() {
|
|
116
|
+
this._hideModal$.next(null);
|
|
117
|
+
}
|
|
118
|
+
refresh() {
|
|
119
|
+
this._refresh$.next(null);
|
|
120
|
+
}
|
|
121
|
+
setModalType(type) {
|
|
122
|
+
this._modalType$.next(type);
|
|
123
|
+
}
|
|
124
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: FormManagementStateService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
125
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: FormManagementStateService, providedIn: 'root' }); }
|
|
126
|
+
}
|
|
127
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: FormManagementStateService, decorators: [{
|
|
128
|
+
type: Injectable,
|
|
129
|
+
args: [{
|
|
130
|
+
providedIn: 'root',
|
|
131
|
+
}]
|
|
132
|
+
}] });
|
|
133
|
+
|
|
134
|
+
/*
|
|
135
|
+
* Copyright 2015-2024 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
|
+
|
|
150
|
+
/*
|
|
151
|
+
* Copyright 2015-2024 Ritense BV, the Netherlands.
|
|
152
|
+
*
|
|
153
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
154
|
+
* you may not use this file except in compliance with the License.
|
|
155
|
+
* You may obtain a copy of the License at
|
|
156
|
+
*
|
|
157
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
158
|
+
*
|
|
159
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
160
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
161
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
162
|
+
* See the License for the specific language governing permissions and
|
|
163
|
+
* limitations under the License.
|
|
164
|
+
*/
|
|
165
|
+
class FormManagementComponent {
|
|
166
|
+
constructor(formManagementService, iconService, router) {
|
|
98
167
|
this.formManagementService = formManagementService;
|
|
168
|
+
this.iconService = iconService;
|
|
99
169
|
this.router = router;
|
|
100
170
|
this.formDefinitions = [];
|
|
101
171
|
this.formDefinitionFields = [
|
|
102
|
-
{ key: 'name', label: '
|
|
172
|
+
{ key: 'name', label: 'Form name' },
|
|
103
173
|
{ key: 'readOnly', label: 'Read-only' },
|
|
104
174
|
];
|
|
105
175
|
this.pagination = {
|
|
@@ -107,19 +177,30 @@ class FormManagementListComponent {
|
|
|
107
177
|
page: 1,
|
|
108
178
|
size: 10,
|
|
109
179
|
};
|
|
110
|
-
this.
|
|
180
|
+
this.iconService.registerAll([Upload16]);
|
|
181
|
+
}
|
|
182
|
+
paginationClicked(page) {
|
|
183
|
+
this.pagination.page = page;
|
|
184
|
+
this.loadFormDefinitions();
|
|
111
185
|
}
|
|
112
|
-
|
|
113
|
-
|
|
186
|
+
paginationSet(size) {
|
|
187
|
+
this.pagination.size = size;
|
|
188
|
+
this.pagination.page = 1;
|
|
114
189
|
this.loadFormDefinitions();
|
|
115
190
|
}
|
|
116
191
|
loadFormDefinitions(searchTerm) {
|
|
117
|
-
const params = { page: this.
|
|
192
|
+
const params = { page: this.pagination.page - 1, size: this.pagination.size };
|
|
118
193
|
if (searchTerm) {
|
|
119
194
|
params['searchTerm'] = searchTerm;
|
|
120
195
|
}
|
|
121
|
-
this.formManagementService
|
|
122
|
-
|
|
196
|
+
this.formManagementService
|
|
197
|
+
.queryFormDefinitions(params)
|
|
198
|
+
.pipe(take(1))
|
|
199
|
+
.subscribe(results => {
|
|
200
|
+
this.pagination = {
|
|
201
|
+
...this.pagination,
|
|
202
|
+
collectionSize: results.body.totalElements,
|
|
203
|
+
};
|
|
123
204
|
this.formDefinitions = results.body.content;
|
|
124
205
|
});
|
|
125
206
|
}
|
|
@@ -129,42 +210,16 @@ class FormManagementListComponent {
|
|
|
129
210
|
searchTermEntered(searchTerm) {
|
|
130
211
|
this.loadFormDefinitions(searchTerm);
|
|
131
212
|
}
|
|
132
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
133
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "
|
|
213
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: FormManagementComponent, deps: [{ token: FormManagementService }, { token: i3.IconService }, { token: i3$1.Router }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
214
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.3", type: FormManagementComponent, selector: "valtimo-form-management", ngImport: i0, template: "<!--\n ~ Copyright 2015-2024 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<valtimo-carbon-list\n [fields]=\"formDefinitionFields\"\n [header]=\"false\"\n [isSearchable]=\"true\"\n [items]=\"formDefinitions\"\n [pagination]=\"pagination\"\n paginationIdentifier=\"formManagementList\"\n (paginationClicked)=\"paginationClicked($event)\"\n (paginationSet)=\"paginationSet($event)\"\n (rowClicked)=\"editFormDefinition($event)\"\n (search)=\"searchTermEntered($event)\"\n>\n <ng-container carbonToolbarContent>\n <button\n cdsButton=\"ghost\"\n [iconOnly]=\"true\"\n [routerLink]=\"'create'\"\n [queryParams]=\"{upload: 'true'}\"\n >\n <svg class=\"cds--btn__icon\" cdsIcon=\"upload\" size=\"16\"></svg>\n </button>\n\n <button cdsButton=\"primary\" [routerLink]=\"'create'\">\n {{ 'Create new Form' | translate }}\n\n <svg class=\"cds--btn__icon\" cdsIcon=\"add\" size=\"16\"></svg>\n </button>\n </ng-container>\n</valtimo-carbon-list>\n", styles: ["/*!\n * Copyright 2015-2024 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n"], dependencies: [{ kind: "directive", type: i3$1.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "directive", type: i3.Button, selector: "[cdsButton], [ibmButton]", inputs: ["ibmButton", "cdsButton", "size", "skeleton", "iconOnly", "isExpressive"] }, { kind: "component", type: i1$1.CarbonListComponent, selector: "valtimo-carbon-list", inputs: ["items", "fields", "tableTranslations", "paginatorConfig", "pagination", "loading", "actions", "actionItems", "header", "hideColumnHeader", "initialSortState", "isSearchable", "enableSingleSelection", "lastColumnTemplate", "paginationIdentifier", "showSelectionColumn", "striped", "hideToolbar", "lockedTooltipTranslationKey", "movingRowsEnabled"], outputs: ["rowClicked", "paginationClicked", "paginationSet", "search", "sortChanged", "moveRow", "itemsReordered"] }, { kind: "directive", type: i3.IconDirective, selector: "[cdsIcon], [ibmIcon]", inputs: ["ibmIcon", "cdsIcon", "size", "title", "ariaLabel", "ariaLabelledBy", "ariaHidden", "isFocusable"] }, { kind: "pipe", type: i2$1.TranslatePipe, name: "translate" }] }); }
|
|
134
215
|
}
|
|
135
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
216
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: FormManagementComponent, decorators: [{
|
|
136
217
|
type: Component,
|
|
137
|
-
args: [{ selector: 'valtimo-form-management
|
|
138
|
-
}], ctorParameters:
|
|
218
|
+
args: [{ selector: 'valtimo-form-management', template: "<!--\n ~ Copyright 2015-2024 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<valtimo-carbon-list\n [fields]=\"formDefinitionFields\"\n [header]=\"false\"\n [isSearchable]=\"true\"\n [items]=\"formDefinitions\"\n [pagination]=\"pagination\"\n paginationIdentifier=\"formManagementList\"\n (paginationClicked)=\"paginationClicked($event)\"\n (paginationSet)=\"paginationSet($event)\"\n (rowClicked)=\"editFormDefinition($event)\"\n (search)=\"searchTermEntered($event)\"\n>\n <ng-container carbonToolbarContent>\n <button\n cdsButton=\"ghost\"\n [iconOnly]=\"true\"\n [routerLink]=\"'create'\"\n [queryParams]=\"{upload: 'true'}\"\n >\n <svg class=\"cds--btn__icon\" cdsIcon=\"upload\" size=\"16\"></svg>\n </button>\n\n <button cdsButton=\"primary\" [routerLink]=\"'create'\">\n {{ 'Create new Form' | translate }}\n\n <svg class=\"cds--btn__icon\" cdsIcon=\"add\" size=\"16\"></svg>\n </button>\n </ng-container>\n</valtimo-carbon-list>\n", styles: ["/*!\n * Copyright 2015-2024 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n"] }]
|
|
219
|
+
}], ctorParameters: () => [{ type: FormManagementService }, { type: i3.IconService }, { type: i3$1.Router }] });
|
|
139
220
|
|
|
140
221
|
/*
|
|
141
|
-
* Copyright 2015-
|
|
142
|
-
*
|
|
143
|
-
* Licensed under EUPL, Version 1.2 (the "License");
|
|
144
|
-
* you may not use this file except in compliance with the License.
|
|
145
|
-
* You may obtain a copy of the License at
|
|
146
|
-
*
|
|
147
|
-
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
148
|
-
*
|
|
149
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
150
|
-
* distributed under the License is distributed on an "AS IS" basis,
|
|
151
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
152
|
-
* See the License for the specific language governing permissions and
|
|
153
|
-
* limitations under the License.
|
|
154
|
-
*/
|
|
155
|
-
class FormManagementComponent {
|
|
156
|
-
constructor() { }
|
|
157
|
-
ngOnInit() { }
|
|
158
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FormManagementComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
159
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: FormManagementComponent, selector: "valtimo-form-management", ngImport: i0, template: "<!--\n ~ Copyright 2015-2023 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div class=\"main-content pt-0\">\n <div class=\"container-fluid\">\n <div class=\"text-right\">\n <div class=\"btn-group mt-m3px mb-3\">\n <button\n [routerLink]=\"'create'\"\n [queryParams]=\"{upload: 'true'}\"\n class=\"btn btn-secondary btn-space\"\n >\n <i class=\"icon mdi mdi-upload mr-1\"></i>\n {{ 'Upload' | translate }}\n </button>\n <button [routerLink]=\"'create'\" class=\"btn btn-primary btn-space mr-0\">\n <i class=\"icon mdi mdi-plus mr-1\"></i>\n <span>{{ 'Create new Form' | translate }}</span>\n </button>\n </div>\n </div>\n <valtimo-widget>\n <valtimo-form-management-list></valtimo-form-management-list>\n </valtimo-widget>\n </div>\n</div>\n", styles: ["/*!\n * Copyright 2015-2023 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n"], dependencies: [{ kind: "directive", type: i3.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "component", type: i1$1.WidgetComponent, selector: "valtimo-widget", inputs: ["type", "name", "icon", "contrast", "divider", "title", "subtitle", "collapseAble", "collapse", "additionalClasses"] }, { kind: "component", type: FormManagementListComponent, selector: "valtimo-form-management-list" }, { kind: "pipe", type: i2$1.TranslatePipe, name: "translate" }] }); }
|
|
160
|
-
}
|
|
161
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FormManagementComponent, decorators: [{
|
|
162
|
-
type: Component,
|
|
163
|
-
args: [{ selector: 'valtimo-form-management', template: "<!--\n ~ Copyright 2015-2023 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div class=\"main-content pt-0\">\n <div class=\"container-fluid\">\n <div class=\"text-right\">\n <div class=\"btn-group mt-m3px mb-3\">\n <button\n [routerLink]=\"'create'\"\n [queryParams]=\"{upload: 'true'}\"\n class=\"btn btn-secondary btn-space\"\n >\n <i class=\"icon mdi mdi-upload mr-1\"></i>\n {{ 'Upload' | translate }}\n </button>\n <button [routerLink]=\"'create'\" class=\"btn btn-primary btn-space mr-0\">\n <i class=\"icon mdi mdi-plus mr-1\"></i>\n <span>{{ 'Create new Form' | translate }}</span>\n </button>\n </div>\n </div>\n <valtimo-widget>\n <valtimo-form-management-list></valtimo-form-management-list>\n </valtimo-widget>\n </div>\n</div>\n", styles: ["/*!\n * Copyright 2015-2023 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n"] }]
|
|
164
|
-
}], ctorParameters: function () { return []; } });
|
|
165
|
-
|
|
166
|
-
/*
|
|
167
|
-
* Copyright 2015-2023 Ritense BV, the Netherlands.
|
|
222
|
+
* Copyright 2015-2024 Ritense BV, the Netherlands.
|
|
168
223
|
*
|
|
169
224
|
* Licensed under EUPL, Version 1.2 (the "License");
|
|
170
225
|
* you may not use this file except in compliance with the License.
|
|
@@ -185,7 +240,7 @@ function noDuplicateFormValidator(formManagementService) {
|
|
|
185
240
|
}
|
|
186
241
|
|
|
187
242
|
/*
|
|
188
|
-
* Copyright 2015-
|
|
243
|
+
* Copyright 2015-2024 Ritense BV, the Netherlands.
|
|
189
244
|
*
|
|
190
245
|
* Licensed under EUPL, Version 1.2 (the "License");
|
|
191
246
|
* you may not use this file except in compliance with the License.
|
|
@@ -235,7 +290,7 @@ class FormManagementCreateComponent {
|
|
|
235
290
|
this.formManagementService.createFormDefinition(request),
|
|
236
291
|
this.route.queryParams,
|
|
237
292
|
])
|
|
238
|
-
.pipe(take(1))
|
|
293
|
+
.pipe(take$1(1))
|
|
239
294
|
.subscribe(([formDefinition, params]) => {
|
|
240
295
|
this.alertService.success('Created new Form');
|
|
241
296
|
if (params?.upload === 'true') {
|
|
@@ -250,16 +305,16 @@ class FormManagementCreateComponent {
|
|
|
250
305
|
this.alertService.error('Error creating new Form');
|
|
251
306
|
});
|
|
252
307
|
}
|
|
253
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
254
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "
|
|
308
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: FormManagementCreateComponent, deps: [{ token: FormManagementService }, { token: i2$2.FormBuilder }, { token: i3$1.Router }, { token: i1$1.AlertService }, { token: i3$1.ActivatedRoute }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
309
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.3", type: FormManagementCreateComponent, selector: "valtimo-form-management-create", ngImport: i0, template: "<!--\n ~ Copyright 2015-2024 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div class=\"main-content\">\n <div class=\"container-fluid\">\n <div class=\"col-12 px-0 mb-5\">\n <valtimo-widget>\n <div class=\"bg-white p-5\">\n <form [formGroup]=\"form\" (ngSubmit)=\"createFormDefinition()\">\n <div class=\"form-group row\">\n <label class=\"col-12 col-sm-3 col-form-label text-sm-right\" for=\"name\">{{\n 'formManagement.name' | translate\n }}</label>\n <div class=\"col-12 col-sm-8 col-lg-6\">\n <input\n type=\"text\"\n id=\"name\"\n formControlName=\"name\"\n class=\"form-control\"\n placeholder=\"Form definition name\"\n [ngClass]=\"{\n 'is-valid': formControls.name.touched && formControls.name.valid,\n 'is-invalid': formControls.name.touched && formControls.name.errors\n }\"\n required\n />\n <div\n *ngIf=\"formControls.name.touched && formControls.name.errors\"\n class=\"invalid-feedback\"\n >\n <div *ngIf=\"formControls.name.errors.required\">\n {{ 'formManagement.nameIsRequired' | translate }}\n </div>\n <div *ngIf=\"formControls.name.errors.duplicate\">\n {{ 'formManagement.nameIsInUse' | translate }}\n </div>\n </div>\n </div>\n </div>\n <div class=\"row pt-3 mt-1\">\n <div class=\"col-12 col-sm-6 text-left\">\n <a [routerLink]=\"'/form-management'\" class=\"btn btn-space btn-default\">{{\n 'formManagement.back' | translate\n }}</a>\n </div>\n <div class=\"col-12 col-sm-6 text-right\">\n <button class=\"btn btn-space btn-secondary\" type=\"button\" (click)=\"reset()\">\n {{ 'formManagement.reset' | translate }}\n </button>\n <button class=\"btn btn-space btn-primary\" type=\"submit\" [disabled]=\"form.invalid\">\n {{ 'formManagement.submit' | translate }}\n </button>\n </div>\n </div>\n </form>\n </div>\n </valtimo-widget>\n </div>\n </div>\n</div>\n", styles: ["/*!\n * Copyright 2015-2024 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n"], dependencies: [{ kind: "directive", type: i3$1.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "directive", type: i5.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2$2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2$2.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i2$2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2$2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i1$1.WidgetComponent, selector: "valtimo-widget", inputs: ["type", "name", "icon", "contrast", "divider", "title", "subtitle", "collapseAble", "collapse", "additionalClasses"] }, { kind: "pipe", type: i2$1.TranslatePipe, name: "translate" }] }); }
|
|
255
310
|
}
|
|
256
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
311
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: FormManagementCreateComponent, decorators: [{
|
|
257
312
|
type: Component,
|
|
258
|
-
args: [{ selector: 'valtimo-form-management-create', template: "<!--\n ~ Copyright 2015-
|
|
259
|
-
}], ctorParameters:
|
|
313
|
+
args: [{ selector: 'valtimo-form-management-create', template: "<!--\n ~ Copyright 2015-2024 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div class=\"main-content\">\n <div class=\"container-fluid\">\n <div class=\"col-12 px-0 mb-5\">\n <valtimo-widget>\n <div class=\"bg-white p-5\">\n <form [formGroup]=\"form\" (ngSubmit)=\"createFormDefinition()\">\n <div class=\"form-group row\">\n <label class=\"col-12 col-sm-3 col-form-label text-sm-right\" for=\"name\">{{\n 'formManagement.name' | translate\n }}</label>\n <div class=\"col-12 col-sm-8 col-lg-6\">\n <input\n type=\"text\"\n id=\"name\"\n formControlName=\"name\"\n class=\"form-control\"\n placeholder=\"Form definition name\"\n [ngClass]=\"{\n 'is-valid': formControls.name.touched && formControls.name.valid,\n 'is-invalid': formControls.name.touched && formControls.name.errors\n }\"\n required\n />\n <div\n *ngIf=\"formControls.name.touched && formControls.name.errors\"\n class=\"invalid-feedback\"\n >\n <div *ngIf=\"formControls.name.errors.required\">\n {{ 'formManagement.nameIsRequired' | translate }}\n </div>\n <div *ngIf=\"formControls.name.errors.duplicate\">\n {{ 'formManagement.nameIsInUse' | translate }}\n </div>\n </div>\n </div>\n </div>\n <div class=\"row pt-3 mt-1\">\n <div class=\"col-12 col-sm-6 text-left\">\n <a [routerLink]=\"'/form-management'\" class=\"btn btn-space btn-default\">{{\n 'formManagement.back' | translate\n }}</a>\n </div>\n <div class=\"col-12 col-sm-6 text-right\">\n <button class=\"btn btn-space btn-secondary\" type=\"button\" (click)=\"reset()\">\n {{ 'formManagement.reset' | translate }}\n </button>\n <button class=\"btn btn-space btn-primary\" type=\"submit\" [disabled]=\"form.invalid\">\n {{ 'formManagement.submit' | translate }}\n </button>\n </div>\n </div>\n </form>\n </div>\n </valtimo-widget>\n </div>\n </div>\n</div>\n", styles: ["/*!\n * Copyright 2015-2024 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n"] }]
|
|
314
|
+
}], ctorParameters: () => [{ type: FormManagementService }, { type: i2$2.FormBuilder }, { type: i3$1.Router }, { type: i1$1.AlertService }, { type: i3$1.ActivatedRoute }] });
|
|
260
315
|
|
|
261
316
|
/*
|
|
262
|
-
* Copyright 2015-
|
|
317
|
+
* Copyright 2015-2024 Ritense BV, the Netherlands.
|
|
263
318
|
*
|
|
264
319
|
* Licensed under EUPL, Version 1.2 (the "License");
|
|
265
320
|
* you may not use this file except in compliance with the License.
|
|
@@ -297,7 +352,7 @@ class FormManagementDuplicateComponent extends BaseModal {
|
|
|
297
352
|
this.formManagementService.createFormDefinition(request),
|
|
298
353
|
this.route.queryParams,
|
|
299
354
|
])
|
|
300
|
-
.pipe(take(1))
|
|
355
|
+
.pipe(take$1(1))
|
|
301
356
|
.subscribe(([formDefinition, params]) => {
|
|
302
357
|
this.alertService.success('Created new Form');
|
|
303
358
|
this.router
|
|
@@ -320,19 +375,82 @@ class FormManagementDuplicateComponent extends BaseModal {
|
|
|
320
375
|
getDefaultName() {
|
|
321
376
|
return this.formToDuplicate.name + '-duplicate';
|
|
322
377
|
}
|
|
323
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
324
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "
|
|
378
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: FormManagementDuplicateComponent, deps: [{ token: 'formToDuplicate' }, { token: i1$1.ModalService }, { token: FormManagementService }, { token: i1$1.AlertService }, { token: i3$1.ActivatedRoute }, { token: i3$1.Router }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
379
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.3", type: FormManagementDuplicateComponent, selector: "valtimo-form-management-duplicate-modal", usesInheritance: true, ngImport: i0, template: "<!--\n ~ Copyright 2015-2024 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n<cds-modal\n valtimoCdsModal\n [open]=\"open\"\n (overlaySelected)=\"closeModal()\"\n [formGroup]=\"duplicateForm\"\n>\n <cds-modal-header (closeSelect)=\"closeModal()\">{{\n 'formManagement.duplicate' | translate\n }}</cds-modal-header>\n <section class=\"bx--modal-content p-2\">\n <cds-label labelState=\"error\">\n {{ 'formManagement.name' | translate }}\n <input cdsText formControlName=\"duplicateFormName\" [invalid]=\"duplicateFormName.invalid\" />\n </cds-label>\n <div\n *ngIf=\"duplicateFormName.invalid && (duplicateFormName.dirty || duplicateFormName.touched)\"\n class=\"bg-warning text-black mb-0 p-2 pl-3 pr-3\"\n role=\"alert\"\n >\n <div *ngIf=\"duplicateFormName.errors.required\">\n {{ 'formManagement.nameIsRequired' | translate }}\n </div>\n <div *ngIf=\"duplicateFormName.errors.duplicate\">\n {{ 'formManagement.nameIsInUse' | translate }}\n </div>\n </div>\n </section>\n <cds-modal-footer>\n <button cdsButton=\"secondary\" (click)=\"closeModal()\">\n {{ 'interface.cancel' | translate }}\n </button>\n <button\n cdsButton=\"primary\"\n [attr.modal-primary-focus]=\"true\"\n modal-primary-focus\n (click)=\"duplicate()\"\n [disabled]=\"duplicateForm.invalid\"\n >\n {{ 'formManagement.submit' | translate }}\n </button>\n </cds-modal-footer>\n</cds-modal>\n", styles: ["/*!\n * Copyright 2015-2024 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n"], dependencies: [{ kind: "directive", type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2$2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2$2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i3.Modal, selector: "cds-modal, ibm-modal", inputs: ["size", "theme", "ariaLabel", "open", "trigger", "hasScrollingContent"], outputs: ["overlaySelected", "close"] }, { kind: "component", type: i3.ModalHeader, selector: "cds-modal-header, ibm-modal-header", inputs: ["theme", "closeLabel", "showCloseButton"], outputs: ["closeSelect"] }, { kind: "component", type: i3.ModalFooter, selector: "cds-modal-footer, ibm-modal-footer" }, { kind: "component", type: i3.Label, selector: "cds-label, ibm-label", inputs: ["labelInputID", "disabled", "skeleton", "helperText", "invalidText", "invalid", "warn", "warnText", "ariaLabel"] }, { kind: "directive", type: i3.TextInput, selector: "[cdsText], [ibmText]", inputs: ["theme", "size", "invalid", "warn", "skeleton"] }, { kind: "directive", type: i3.Button, selector: "[cdsButton], [ibmButton]", inputs: ["ibmButton", "cdsButton", "size", "skeleton", "iconOnly", "isExpressive"] }, { kind: "directive", type: i1$1.ValtimoCdsModalDirective, selector: "[valtimoCdsModal]" }, { kind: "pipe", type: i2$1.TranslatePipe, name: "translate" }] }); }
|
|
325
380
|
}
|
|
326
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
381
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: FormManagementDuplicateComponent, decorators: [{
|
|
327
382
|
type: Component,
|
|
328
|
-
args: [{ selector: 'valtimo-form-management-duplicate-modal', template: "<!--\n ~ Copyright 2015-
|
|
329
|
-
}], ctorParameters:
|
|
383
|
+
args: [{ selector: 'valtimo-form-management-duplicate-modal', template: "<!--\n ~ Copyright 2015-2024 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n<cds-modal\n valtimoCdsModal\n [open]=\"open\"\n (overlaySelected)=\"closeModal()\"\n [formGroup]=\"duplicateForm\"\n>\n <cds-modal-header (closeSelect)=\"closeModal()\">{{\n 'formManagement.duplicate' | translate\n }}</cds-modal-header>\n <section class=\"bx--modal-content p-2\">\n <cds-label labelState=\"error\">\n {{ 'formManagement.name' | translate }}\n <input cdsText formControlName=\"duplicateFormName\" [invalid]=\"duplicateFormName.invalid\" />\n </cds-label>\n <div\n *ngIf=\"duplicateFormName.invalid && (duplicateFormName.dirty || duplicateFormName.touched)\"\n class=\"bg-warning text-black mb-0 p-2 pl-3 pr-3\"\n role=\"alert\"\n >\n <div *ngIf=\"duplicateFormName.errors.required\">\n {{ 'formManagement.nameIsRequired' | translate }}\n </div>\n <div *ngIf=\"duplicateFormName.errors.duplicate\">\n {{ 'formManagement.nameIsInUse' | translate }}\n </div>\n </div>\n </section>\n <cds-modal-footer>\n <button cdsButton=\"secondary\" (click)=\"closeModal()\">\n {{ 'interface.cancel' | translate }}\n </button>\n <button\n cdsButton=\"primary\"\n [attr.modal-primary-focus]=\"true\"\n modal-primary-focus\n (click)=\"duplicate()\"\n [disabled]=\"duplicateForm.invalid\"\n >\n {{ 'formManagement.submit' | translate }}\n </button>\n </cds-modal-footer>\n</cds-modal>\n", styles: ["/*!\n * Copyright 2015-2024 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n"] }]
|
|
384
|
+
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
330
385
|
type: Inject,
|
|
331
386
|
args: ['formToDuplicate']
|
|
332
|
-
}] }, { type: i1$1.ModalService }, { type: FormManagementService }, { type: i1$1.AlertService }, { type: i3.ActivatedRoute }, { type: i3.Router }]
|
|
387
|
+
}] }, { type: i1$1.ModalService }, { type: FormManagementService }, { type: i1$1.AlertService }, { type: i3$1.ActivatedRoute }, { type: i3$1.Router }] });
|
|
333
388
|
|
|
334
389
|
/*
|
|
335
|
-
* Copyright 2015-
|
|
390
|
+
* Copyright 2015-2024 Ritense BV, the Netherlands.
|
|
391
|
+
*
|
|
392
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
393
|
+
* you may not use this file except in compliance with the License.
|
|
394
|
+
* You may obtain a copy of the License at
|
|
395
|
+
*
|
|
396
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
397
|
+
*
|
|
398
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
399
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
400
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
401
|
+
* See the License for the specific language governing permissions and
|
|
402
|
+
* limitations under the License.
|
|
403
|
+
*/
|
|
404
|
+
function compareFormDefinitions(fd1, fd2) {
|
|
405
|
+
if (fd1 === null && fd2 === null) {
|
|
406
|
+
return true;
|
|
407
|
+
}
|
|
408
|
+
if (fd1 === null || fd2 === null) {
|
|
409
|
+
return false;
|
|
410
|
+
}
|
|
411
|
+
return fd1.id === fd2.id;
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
/*
|
|
415
|
+
* Copyright 2015-2024 Ritense BV, the Netherlands.
|
|
416
|
+
*
|
|
417
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
418
|
+
* you may not use this file except in compliance with the License.
|
|
419
|
+
* You may obtain a copy of the License at
|
|
420
|
+
*
|
|
421
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
422
|
+
*
|
|
423
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
424
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
425
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
426
|
+
* See the License for the specific language governing permissions and
|
|
427
|
+
* limitations under the License.
|
|
428
|
+
*/
|
|
429
|
+
var EDIT_TABS;
|
|
430
|
+
(function (EDIT_TABS) {
|
|
431
|
+
EDIT_TABS["BUILDER"] = "formManagement.tabs.formBuilder";
|
|
432
|
+
EDIT_TABS["EDITOR"] = "formManagement.tabs.jsonEditor";
|
|
433
|
+
EDIT_TABS["OUTPUT"] = "formManagement.tabs.output";
|
|
434
|
+
})(EDIT_TABS || (EDIT_TABS = {}));
|
|
435
|
+
|
|
436
|
+
/*
|
|
437
|
+
* Copyright 2015-2024 Ritense BV, the Netherlands.
|
|
438
|
+
*
|
|
439
|
+
* Licensed under EUPL, Version 1.2 (the "License");
|
|
440
|
+
* you may not use this file except in compliance with the License.
|
|
441
|
+
* You may obtain a copy of the License at
|
|
442
|
+
*
|
|
443
|
+
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
444
|
+
*
|
|
445
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
446
|
+
* distributed under the License is distributed on an "AS IS" basis,
|
|
447
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
448
|
+
* See the License for the specific language governing permissions and
|
|
449
|
+
* limitations under the License.
|
|
450
|
+
*/
|
|
451
|
+
|
|
452
|
+
/*
|
|
453
|
+
* Copyright 2015-2024 Ritense BV, the Netherlands.
|
|
336
454
|
*
|
|
337
455
|
* Licensed under EUPL, Version 1.2 (the "License");
|
|
338
456
|
* you may not use this file except in compliance with the License.
|
|
@@ -372,7 +490,7 @@ class FormManagementUploadComponent {
|
|
|
372
490
|
}
|
|
373
491
|
uploadDefinition() {
|
|
374
492
|
this.disable();
|
|
375
|
-
this.jsonString$.pipe(take(1)).subscribe(definition => {
|
|
493
|
+
this.jsonString$.pipe(take$1(1)).subscribe(definition => {
|
|
376
494
|
this.closeErrorSubscription();
|
|
377
495
|
this.clearError();
|
|
378
496
|
this.enable();
|
|
@@ -442,7 +560,7 @@ class FormManagementUploadComponent {
|
|
|
442
560
|
}
|
|
443
561
|
stringIsValidJson(string) {
|
|
444
562
|
try {
|
|
445
|
-
// eslint-disable-next-line
|
|
563
|
+
// eslint-disable-next-line
|
|
446
564
|
JSON.parse(string)?.formDefinition?.components;
|
|
447
565
|
}
|
|
448
566
|
catch (e) {
|
|
@@ -458,13 +576,13 @@ class FormManagementUploadComponent {
|
|
|
458
576
|
enable() {
|
|
459
577
|
this.disabled$.next(false);
|
|
460
578
|
}
|
|
461
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
462
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "
|
|
579
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: FormManagementUploadComponent, deps: [{ token: i1$2.DocumentService }, { token: i2$1.TranslateService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
580
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.3", type: FormManagementUploadComponent, selector: "valtimo-form-management-upload", inputs: { show$: "show$" }, outputs: { definitionUploaded: "definitionUploaded" }, viewQueries: [{ propertyName: "modal", first: true, predicate: ["uploadFormDefinitionModal"], descendants: true }], ngImport: i0, template: "<!--\n ~ Copyright 2015-2024 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<valtimo-modal\n #uploadFormDefinitionModal\n [title]=\"'uploadFormDefinition' | translate\"\n showFooter=\"true\"\n>\n <div class=\"mt-2\" body>\n <valtimo-dropzone\n [clear$]=\"clear$\"\n (fileSelected)=\"setFile($event)\"\n [disabled]=\"disabled$ | async\"\n [subtitle]=\"'dropzone.formJsonDocDef' | translate\"\n [externalError$]=\"error$\"\n [maxFiles]=\"1\"\n ></valtimo-dropzone>\n </div>\n <div footer>\n <ng-container *ngIf=\"(jsonString$ | async) && (error$ | async) === ''; else disabledUpload\">\n <button [disabled]=\"disabled$ | async\" class=\"btn btn-primary\" (click)=\"uploadDefinition()\">\n {{ 'Upload' | translate }}\n </button>\n </ng-container>\n </div>\n</valtimo-modal>\n\n<ng-template #disabledUpload>\n <button [disabled]=\"true\" class=\"btn btn-primary\">\n <i class=\"icon mdi mdi-upload mr-1\"></i>\n {{ 'Upload' | translate }}\n </button>\n</ng-template>\n", styles: ["/*!\n * Copyright 2015-2024 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n"], dependencies: [{ kind: "directive", type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i1$1.DropzoneComponent, selector: "valtimo-dropzone", inputs: ["title", "hideTitle", "subtitle", "externalError$", "maxFileSize", "showMaxFileSize", "acceptedFiles", "clear$", "disabled", "hideFilePreview", "uploading", "camera", "maxFiles"], outputs: ["fileSelected"] }, { kind: "component", type: i1$1.ModalComponent, selector: "valtimo-modal", inputs: ["elementId", "title", "subtitle", "templateBelowSubtitle", "showFooter"] }, { kind: "pipe", type: i5.AsyncPipe, name: "async" }, { kind: "pipe", type: i2$1.TranslatePipe, name: "translate" }] }); }
|
|
463
581
|
}
|
|
464
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
582
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: FormManagementUploadComponent, decorators: [{
|
|
465
583
|
type: Component,
|
|
466
|
-
args: [{ selector: 'valtimo-form-management-upload', template: "<!--\n ~ Copyright 2015-
|
|
467
|
-
}], ctorParameters:
|
|
584
|
+
args: [{ selector: 'valtimo-form-management-upload', template: "<!--\n ~ Copyright 2015-2024 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<valtimo-modal\n #uploadFormDefinitionModal\n [title]=\"'uploadFormDefinition' | translate\"\n showFooter=\"true\"\n>\n <div class=\"mt-2\" body>\n <valtimo-dropzone\n [clear$]=\"clear$\"\n (fileSelected)=\"setFile($event)\"\n [disabled]=\"disabled$ | async\"\n [subtitle]=\"'dropzone.formJsonDocDef' | translate\"\n [externalError$]=\"error$\"\n [maxFiles]=\"1\"\n ></valtimo-dropzone>\n </div>\n <div footer>\n <ng-container *ngIf=\"(jsonString$ | async) && (error$ | async) === ''; else disabledUpload\">\n <button [disabled]=\"disabled$ | async\" class=\"btn btn-primary\" (click)=\"uploadDefinition()\">\n {{ 'Upload' | translate }}\n </button>\n </ng-container>\n </div>\n</valtimo-modal>\n\n<ng-template #disabledUpload>\n <button [disabled]=\"true\" class=\"btn btn-primary\">\n <i class=\"icon mdi mdi-upload mr-1\"></i>\n {{ 'Upload' | translate }}\n </button>\n</ng-template>\n", styles: ["/*!\n * Copyright 2015-2024 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n"] }]
|
|
585
|
+
}], ctorParameters: () => [{ type: i1$2.DocumentService }, { type: i2$1.TranslateService }], propDecorators: { modal: [{
|
|
468
586
|
type: ViewChild,
|
|
469
587
|
args: ['uploadFormDefinitionModal']
|
|
470
588
|
}], show$: [{
|
|
@@ -474,7 +592,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
474
592
|
}] } });
|
|
475
593
|
|
|
476
594
|
/*
|
|
477
|
-
* Copyright 2015-
|
|
595
|
+
* Copyright 2015-2024 Ritense BV, the Netherlands.
|
|
478
596
|
*
|
|
479
597
|
* Licensed under EUPL, Version 1.2 (the "License");
|
|
480
598
|
* you may not use this file except in compliance with the License.
|
|
@@ -489,7 +607,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
489
607
|
* limitations under the License.
|
|
490
608
|
*/
|
|
491
609
|
class FormManagementEditComponent extends PendingChangesComponent {
|
|
492
|
-
|
|
610
|
+
get _formDefinition() {
|
|
611
|
+
return this._formDefinition$.getValue();
|
|
612
|
+
}
|
|
613
|
+
constructor(alertService, formManagementService, modalService, pageTitleService, route, router, shellService, pageHeaderService) {
|
|
493
614
|
super();
|
|
494
615
|
this.alertService = alertService;
|
|
495
616
|
this.formManagementService = formManagementService;
|
|
@@ -497,12 +618,32 @@ class FormManagementEditComponent extends PendingChangesComponent {
|
|
|
497
618
|
this.pageTitleService = pageTitleService;
|
|
498
619
|
this.route = route;
|
|
499
620
|
this.router = router;
|
|
621
|
+
this.shellService = shellService;
|
|
622
|
+
this.pageHeaderService = pageHeaderService;
|
|
623
|
+
this.class = 'valtimo-form-management-edit';
|
|
500
624
|
this.modifiedFormDefinition = null;
|
|
501
|
-
this.
|
|
502
|
-
this.
|
|
625
|
+
this.validJsonChange = null;
|
|
626
|
+
this.CARBON_THEME = 'g10';
|
|
627
|
+
this.TABS = EDIT_TABS;
|
|
628
|
+
this.activeTab = EDIT_TABS.BUILDER;
|
|
629
|
+
this._formDefinition$ = new BehaviorSubject(null);
|
|
630
|
+
this.formDefinition$ = this._formDefinition$.pipe(filter((definition) => !!definition), distinctUntilChanged((prevFormDefinition, currFormDefinition) => JSON.stringify(prevFormDefinition?.formDefinition?.components) ===
|
|
631
|
+
JSON.stringify(currFormDefinition?.formDefinition?.components)), tap(() => {
|
|
632
|
+
if (!this._editorInitialized) {
|
|
633
|
+
this._editorInitialized = true;
|
|
634
|
+
return;
|
|
635
|
+
}
|
|
636
|
+
this.pendingChanges = true;
|
|
637
|
+
}));
|
|
638
|
+
this.jsonFormDefinition$ = new BehaviorSubject(null);
|
|
639
|
+
this.jsonOutput$ = new BehaviorSubject(null);
|
|
503
640
|
this.reloading$ = new BehaviorSubject(false);
|
|
641
|
+
this.showDeleteModal$ = new BehaviorSubject(false);
|
|
642
|
+
this.showModal$ = new BehaviorSubject(false);
|
|
643
|
+
this.compactMode$ = this.pageHeaderService.compactMode$;
|
|
504
644
|
this._alertSub = Subscription.EMPTY;
|
|
505
|
-
this.
|
|
645
|
+
this._changeActive = false;
|
|
646
|
+
this._editorInitialized = false;
|
|
506
647
|
}
|
|
507
648
|
ngOnInit() {
|
|
508
649
|
this.pageTitleService.disableReset();
|
|
@@ -511,30 +652,50 @@ class FormManagementEditComponent extends PendingChangesComponent {
|
|
|
511
652
|
}
|
|
512
653
|
ngOnDestroy() {
|
|
513
654
|
this._alertSub.unsubscribe();
|
|
655
|
+
this.pageTitleService.enableReset();
|
|
514
656
|
}
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
657
|
+
formBuilderChanged(event, definition) {
|
|
658
|
+
if (event.type === 'updateComponent') {
|
|
659
|
+
return;
|
|
660
|
+
}
|
|
661
|
+
this._changeActive = true;
|
|
662
|
+
this.modifiedFormDefinition = event.form;
|
|
663
|
+
this._formDefinition$.next({ ...this._formDefinition, formDefinition: event.form });
|
|
664
|
+
this.jsonFormDefinition$.next({ ...definition, value: JSON.stringify(event.form) });
|
|
665
|
+
this._changeActive = false;
|
|
666
|
+
}
|
|
667
|
+
delete() {
|
|
668
|
+
this.showDeleteModal$.next(true);
|
|
669
|
+
}
|
|
670
|
+
deleteFormDefinition(definition) {
|
|
671
|
+
this.pendingChanges = false;
|
|
672
|
+
this.formManagementService.deleteFormDefinition(definition.id).subscribe({
|
|
673
|
+
next: () => {
|
|
674
|
+
this.router.navigate(['/form-management']);
|
|
675
|
+
this.alertService.success('Form deleted');
|
|
521
676
|
},
|
|
522
677
|
error: () => {
|
|
523
|
-
this.alertService.error('Error
|
|
678
|
+
this.alertService.error('Error deleting Form');
|
|
524
679
|
},
|
|
525
680
|
});
|
|
526
681
|
}
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
}
|
|
682
|
+
downloadFormDefinition(definition) {
|
|
683
|
+
const file = new Blob([JSON.stringify(definition.formDefinition)], {
|
|
684
|
+
type: 'text/json',
|
|
685
|
+
});
|
|
686
|
+
const link = document.createElement('a');
|
|
687
|
+
link.download = `form_${definition.name}.json`;
|
|
688
|
+
link.href = window.URL.createObjectURL(file);
|
|
689
|
+
link.click();
|
|
690
|
+
window.URL.revokeObjectURL(link.href);
|
|
691
|
+
link.remove();
|
|
692
|
+
}
|
|
693
|
+
modifyFormDefinition(definition) {
|
|
531
694
|
this.pendingChanges = false;
|
|
532
|
-
const form = JSON.stringify(this.modifiedFormDefinition !== null
|
|
533
|
-
? this.modifiedFormDefinition
|
|
534
|
-
: this.formDefinition.formDefinition);
|
|
695
|
+
const form = JSON.stringify(this.modifiedFormDefinition !== null ? this.modifiedFormDefinition : definition.formDefinition);
|
|
535
696
|
const request = {
|
|
536
|
-
id:
|
|
537
|
-
name:
|
|
697
|
+
id: definition.id,
|
|
698
|
+
name: definition.name,
|
|
538
699
|
formDefinition: form,
|
|
539
700
|
};
|
|
540
701
|
this.formManagementService.modifyFormDefinition(request).subscribe({
|
|
@@ -547,73 +708,50 @@ class FormManagementEditComponent extends PendingChangesComponent {
|
|
|
547
708
|
},
|
|
548
709
|
});
|
|
549
710
|
}
|
|
550
|
-
|
|
551
|
-
this.
|
|
552
|
-
|
|
553
|
-
}
|
|
554
|
-
delete() {
|
|
555
|
-
if (!this._alertSub.closed) {
|
|
711
|
+
onSelectedTab(tab) {
|
|
712
|
+
this.activeTab = tab;
|
|
713
|
+
if (tab === EDIT_TABS.BUILDER) {
|
|
556
714
|
return;
|
|
557
715
|
}
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
{
|
|
561
|
-
label: 'Cancel',
|
|
562
|
-
class: 'btn btn-default',
|
|
563
|
-
value: false,
|
|
564
|
-
},
|
|
565
|
-
{
|
|
566
|
-
label: 'Delete',
|
|
567
|
-
class: 'btn btn-primary',
|
|
568
|
-
value: true,
|
|
569
|
-
},
|
|
570
|
-
];
|
|
571
|
-
this.alertService.notification(mssg, confirmations);
|
|
572
|
-
this._alertSub = this.alertService
|
|
573
|
-
.getAlertConfirmChangeEmitter()
|
|
574
|
-
.pipe(first())
|
|
575
|
-
.subscribe(alert => {
|
|
576
|
-
if (alert.confirm === true) {
|
|
577
|
-
this.deleteFormDefinition();
|
|
578
|
-
}
|
|
716
|
+
setTimeout(() => {
|
|
717
|
+
this.shellService.onMainContentResize();
|
|
579
718
|
});
|
|
580
719
|
}
|
|
581
|
-
|
|
582
|
-
if (!
|
|
720
|
+
onOutputChange(event) {
|
|
721
|
+
if (!event.data) {
|
|
583
722
|
return;
|
|
584
723
|
}
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
error: () => {
|
|
591
|
-
this.alertService.error('Error deleting Form');
|
|
592
|
-
},
|
|
593
|
-
});
|
|
724
|
+
else if (JSON.stringify(event.data) === this._activeOuput) {
|
|
725
|
+
return;
|
|
726
|
+
}
|
|
727
|
+
this._activeOuput = JSON.stringify(event.data);
|
|
728
|
+
this.jsonOutput$.next({ value: this._activeOuput, language: 'json' });
|
|
594
729
|
}
|
|
595
|
-
|
|
596
|
-
if (
|
|
730
|
+
onValueChangeEvent(value, definition, disabled) {
|
|
731
|
+
if (this._changeActive || this.validJsonChange === false || disabled) {
|
|
597
732
|
return;
|
|
598
733
|
}
|
|
599
|
-
const
|
|
600
|
-
|
|
734
|
+
const parsedDefinition = JSON.parse(value);
|
|
735
|
+
this.modifiedFormDefinition = parsedDefinition;
|
|
736
|
+
this._formDefinition$.next({
|
|
737
|
+
...definition,
|
|
738
|
+
formDefinition: parsedDefinition,
|
|
601
739
|
});
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
740
|
+
}
|
|
741
|
+
onValidEvent(value, disabled) {
|
|
742
|
+
if (this._changeActive || disabled) {
|
|
743
|
+
return;
|
|
744
|
+
}
|
|
745
|
+
this.validJsonChange = value;
|
|
608
746
|
}
|
|
609
747
|
showUploadModal() {
|
|
610
748
|
this.showModal$.next(true);
|
|
611
749
|
}
|
|
612
|
-
showDuplicateModal() {
|
|
750
|
+
showDuplicateModal(definition) {
|
|
613
751
|
this.modalService.create({
|
|
614
752
|
component: FormManagementDuplicateComponent,
|
|
615
753
|
inputs: {
|
|
616
|
-
formToDuplicate:
|
|
754
|
+
formToDuplicate: definition,
|
|
617
755
|
},
|
|
618
756
|
});
|
|
619
757
|
}
|
|
@@ -625,14 +763,15 @@ class FormManagementEditComponent extends PendingChangesComponent {
|
|
|
625
763
|
this.alertService.error('Invalid form.io. Missing JSON field "components".');
|
|
626
764
|
return;
|
|
627
765
|
}
|
|
628
|
-
if (!this.formDefinition) {
|
|
629
|
-
return;
|
|
630
|
-
}
|
|
631
766
|
const components = definition.components;
|
|
632
|
-
const currentDefinition = this.modifiedFormDefinition ||
|
|
767
|
+
const currentDefinition = this.modifiedFormDefinition || definition.formDefinition;
|
|
633
768
|
const newDefinition = { ...currentDefinition, ...(components && { components }) };
|
|
634
769
|
this.modifiedFormDefinition = newDefinition;
|
|
635
|
-
|
|
770
|
+
definition.formDefinition = newDefinition;
|
|
771
|
+
this.jsonFormDefinition$.next({
|
|
772
|
+
value: JSON.stringify(newDefinition),
|
|
773
|
+
language: 'json',
|
|
774
|
+
});
|
|
636
775
|
this.reloading$.next(false);
|
|
637
776
|
}
|
|
638
777
|
onConfirmRedirect() {
|
|
@@ -649,16 +788,31 @@ class FormManagementEditComponent extends PendingChangesComponent {
|
|
|
649
788
|
}
|
|
650
789
|
});
|
|
651
790
|
}
|
|
652
|
-
|
|
653
|
-
|
|
791
|
+
loadFormDefinition() {
|
|
792
|
+
this.route.paramMap
|
|
793
|
+
.pipe(take(1), switchMap((paramMap) => this.formManagementService.getFormDefinition(paramMap.get('id') ?? '')))
|
|
794
|
+
.subscribe((definition) => {
|
|
795
|
+
this._formDefinition$.next(definition);
|
|
796
|
+
this.pageTitleService.setCustomPageTitle(definition.name);
|
|
797
|
+
this.jsonFormDefinition$.next({
|
|
798
|
+
value: JSON.stringify(definition.formDefinition),
|
|
799
|
+
language: 'json',
|
|
800
|
+
});
|
|
801
|
+
});
|
|
802
|
+
}
|
|
803
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: FormManagementEditComponent, deps: [{ token: i1$1.AlertService }, { token: FormManagementService }, { token: i3.ModalService }, { token: i1$1.PageTitleService }, { token: i3$1.ActivatedRoute }, { token: i3$1.Router }, { token: i1$1.ShellService }, { token: i1$1.PageHeaderService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
804
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.3", type: FormManagementEditComponent, selector: "valtimo-form-management-edit", host: { properties: { "class": "this.class" } }, usesInheritance: true, ngImport: i0, template: "<!--\n ~ Copyright 2015-2024 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n<ng-container\n *ngIf=\"{\n formDefinition: formDefinition$ | async,\n jsonFormDefinition: jsonFormDefinition$ | async,\n jsonOutput: jsonOutput$ | async,\n compactMode: compactMode$ | async\n } as obs\"\n>\n @if (obs.formDefinition) {\n <ng-container renderInPageHeader [fullWidth]=\"true\">\n <ng-template>\n <div\n class=\"valtimo-form-management-edit__header-container\"\n [ngClass]=\"{'--compact': obs.compactMode}\"\n >\n @if (obs.formDefinition.readOnly) {\n <cds-tag size=\"sm\" type=\"blue\">{{ 'formManagement.readOnly' | translate }}</cds-tag>\n }\n\n <div class=\"valtimo-form-management-edit__header\">\n <cds-overflow-menu>\n <cds-overflow-menu-option (selected)=\"downloadFormDefinition(obs.formDefinition)\">\n {{ 'Download' | translate }}\n </cds-overflow-menu-option>\n\n <cds-overflow-menu-option\n [disabled]=\"obs.formDefinition.readOnly\"\n (selected)=\"showUploadModal()\"\n >\n {{ 'Upload' | translate }}\n </cds-overflow-menu-option>\n\n <cds-overflow-menu-option\n [disabled]=\"obs.formDefinition.readOnly\"\n (selected)=\"delete(obs.formDefinition)\"\n >\n {{ 'interface.delete' | translate }}\n </cds-overflow-menu-option>\n\n <cds-overflow-menu-option (selected)=\"showDuplicateModal(obs.formDefinition)\">\n {{ 'formManagement.duplicate' | translate }}\n </cds-overflow-menu-option>\n </cds-overflow-menu>\n\n <button\n cdsButton=\"primary\"\n [disabled]=\"obs.formDefinition.readOnly || !validJsonChange\"\n [size]=\"obs.compactMode ? 'sm' : 'md'\"\n (click)=\"modifyFormDefinition(obs.formDefinition)\"\n >\n {{ 'interface.save' | translate }}\n\n <svg class=\"cds--btn__icon\" cdsIcon=\"save\" size=\"16\"></svg>\n </button>\n </div>\n </div>\n </ng-template>\n </ng-container>\n\n <cds-tabs type=\"contained\">\n <cds-tab [heading]=\"TABS.BUILDER | translate\" (selected)=\"onSelectedTab(TABS.BUILDER)\">\n <valtimo-form-io-builder\n *ngIf=\"(reloading$ | async) === false && activeTab === TABS.BUILDER\"\n [form]=\"obs.formDefinition.formDefinition\"\n (change)=\"formBuilderChanged($event, obs.jsonFormDefinition)\"\n ></valtimo-form-io-builder>\n </cds-tab>\n\n <cds-tab [heading]=\"TABS.EDITOR | translate\" (selected)=\"onSelectedTab(TABS.EDITOR)\">\n <ng-container\n *ngTemplateOutlet=\"\n jsonEditor;\n context: {\n data: {\n disabled: obs.formDefinition.readOnly,\n formDefinition: obs.formDefinition,\n model: obs.jsonFormDefinition\n }\n }\n \"\n ></ng-container>\n </cds-tab>\n\n <cds-tab\n [heading]=\"TABS.OUTPUT | translate\"\n (selected)=\"onSelectedTab(TABS.OUTPUT)\"\n class=\"valtimo-form-management-edit__output\"\n >\n <valtimo-form-io\n [form]=\"obs.formDefinition.formDefinition\"\n (change)=\"onOutputChange($event)\"\n ></valtimo-form-io>\n\n <ng-container\n *ngTemplateOutlet=\"\n jsonEditor;\n context: {\n data: {disabled: true, formDefinition: obs.formDefinition, model: obs.jsonOutput}\n }\n \"\n ></ng-container>\n </cds-tab>\n </cds-tabs>\n } @else {\n <valtimo-spinner></valtimo-spinner>\n }\n\n <valtimo-confirmation-modal\n confirmButtonTextTranslationKey=\"interface.delete\"\n confirmButtonType=\"danger\"\n contentTranslationKey=\"interface.deleteConfirmation\"\n cancelButtonTextTranslationKey=\"interface.cancel\"\n [outputOnConfirm]=\"obs.formDefinition\"\n [showModalSubject$]=\"showDeleteModal$\"\n titleTranslationKey=\"dashboardManagement.delete\"\n (confirmEvent)=\"deleteFormDefinition($event)\"\n ></valtimo-confirmation-modal>\n\n <valtimo-form-management-upload\n [show$]=\"showModal$\"\n (definitionUploaded)=\"setFormDefinition($event)\"\n ></valtimo-form-management-upload>\n\n <ng-template #jsonEditor let-data=\"data\">\n <valtimo-editor\n [model]=\"data.model\"\n [disabled]=\"data.disabled\"\n (validEvent)=\"onValidEvent($event, data.disabled)\"\n (valueChangeEvent)=\"onValueChangeEvent($event, data.formDefinition, data.disabled)\"\n [fitPage]=\"true\"\n [fitPageExtraSpace]=\"80\"\n ></valtimo-editor>\n </ng-template>\n</ng-container>\n", styles: [".valtimo-form-management-edit__header{display:flex;align-items:center;justify-content:flex-end;gap:16px;margin-left:auto}.valtimo-form-management-edit__header-container{width:100%;display:flex;justify-content:space-between;align-items:flex-end;padding-bottom:4px}.valtimo-form-management-edit__header-container .cds--tag{margin:0;height:var(--cds-layout-size-height-md)}.valtimo-form-management-edit__header-container.--compact{align-items:flex-start;padding-bottom:0}.valtimo-form-management-edit__output .cds--tab-content{display:grid;grid-template-columns:1fr 1fr}.valtimo-form-management-edit__output .cds--tab-content>*{min-width:100%!important}.valtimo-form-management-edit .formbuilder .btn.formcomponent.drag-copy,.valtimo-form-management-edit .btn.formcomponent.gu-mirror{font-weight:400;background-color:silver;border-color:silver;color:#fff}.valtimo-form-management-edit .formbuilder .btn.formcomponent.drag-copy:hover,.valtimo-form-management-edit .formbuilder .btn.formcomponent.drag-copy:active,.valtimo-form-management-edit .btn.formcomponent.gu-mirror:hover,.valtimo-form-management-edit .btn.formcomponent.gu-mirror:active{box-shadow:none}.valtimo-form-management-edit .formbuilder .btn.formcomponent.drag-copy:active,.valtimo-form-management-edit .btn.formcomponent.gu-mirror:active{background-color:silver;border-color:silver}.valtimo-form-management-edit .formbuilder-header{padding-left:18px;padding-right:18px;font-size:18px;height:80px;border:1px solid #dee2e6;border-bottom:0}.valtimo-form-management-edit .formbuilder-header .formbuilder-title{margin-top:21px;margin-bottom:7px}.valtimo-form-management-edit .formbuilder-header .formbuilder-subtitle{margin-top:0;margin-bottom:12px}.valtimo-form-management-edit .formbuilder{background:#fff;padding:1rem;border:1px solid #dee2e6;margin-right:0!important;margin-left:0!important}.valtimo-form-management-edit .formbuilder .form-builder-panel .builder-group-button[aria-expanded=false],.valtimo-form-management-edit .formbuilder .form-builder-panel .builder-group-button[aria-expanded=\"\"]{color:#a9a9a9}.valtimo-form-management-edit .formbuilder .form-builder-panel .builder-group-button[aria-expanded=true]{color:#000}.valtimo-form-management-edit .formbuilder .drag-and-drop-alert{display:none}.valtimo-form-management-edit .formbuilder .formarea{padding:10px;border:solid 1px silver;background-color:#fff}.valtimo-form-management-edit .increase-size{font-size:1rem}.valtimo-form-management-edit .cds--tab-content{background:#fff!important}\n/*!\n * Copyright 2015-2024 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n"], dependencies: [{ kind: "component", type: i1$1.FormioComponent, selector: "valtimo-form-io", inputs: ["options", "submission", "form", "readOnly", "formRefresh$"], outputs: ["submit", "change"] }, { kind: "component", type: i1$1.FormioBuilderComponent, selector: "valtimo-form-io-builder", inputs: ["form"], outputs: ["change"] }, { kind: "directive", type: i5.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i5.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i3.Button, selector: "[cdsButton], [ibmButton]", inputs: ["ibmButton", "cdsButton", "size", "skeleton", "iconOnly", "isExpressive"] }, { kind: "component", type: i3.OverflowMenu, selector: "cds-overflow-menu, ibm-overflow-menu", inputs: ["buttonLabel", "flip", "placement", "open", "customTrigger", "offset", "wrapperClass", "triggerClass"], outputs: ["openChange"] }, { kind: "component", type: i3.OverflowMenuOption, selector: "cds-overflow-menu-option, ibm-overflow-menu-option", inputs: ["divider", "type", "disabled", "href", "target", "innerClass"], outputs: ["selected"] }, { kind: "directive", type: i1$1.RenderInPageHeaderDirective, selector: "[renderInPageHeader]", inputs: ["fullWidth"] }, { kind: "component", type: i3.Tabs, selector: "cds-tabs, ibm-tabs", inputs: ["position", "cacheActive", "followFocus", "isNavigation", "ariaLabel", "ariaLabelledby", "type", "theme", "skeleton"] }, { kind: "component", type: i3.Tab, selector: "cds-tab, ibm-tab", inputs: ["heading", "title", "context", "active", "disabled", "tabIndex", "id", "cacheActive"], outputs: ["selected"] }, { kind: "component", type: i1$1.EditorComponent, selector: "valtimo-editor", inputs: ["editorOptions", "model", "disabled", "formatOnLoad", "widthPx", "heightPx", "heightStyle", "jsonSchema", "fitPage", "fitPageExtraSpace"], outputs: ["validEvent", "valueChangeEvent"] }, { kind: "component", type: i1$1.SpinnerComponent, selector: "valtimo-spinner", inputs: ["useBootstrapSpinner", "name", "type", "size", "color", "bdColor", "fullScreen", "noMarginTop"] }, { kind: "directive", type: i3.IconDirective, selector: "[cdsIcon], [ibmIcon]", inputs: ["ibmIcon", "cdsIcon", "size", "title", "ariaLabel", "ariaLabelledBy", "ariaHidden", "isFocusable"] }, { kind: "component", type: i1$1.ConfirmationModalComponent, selector: "valtimo-confirmation-modal", inputs: ["titleTranslationKey", "title", "content", "contentTranslationKey", "confirmButtonText", "confirmButtonTextTranslationKey", "confirmButtonType", "showOptionalButton", "optionalButtonText", "optionalButtonTextTranslationKey", "optionalButtonType", "cancelButtonText", "cancelButtonTextTranslationKey", "cancelButtonType", "showModalSubject$", "outputOnConfirm", "outputOnOptional", "spacerAfterCancelButton"], outputs: ["confirmEvent", "optionalEvent", "cancelEvent"] }, { kind: "component", type: i3.Tag, selector: "cds-tag, ibm-tag", inputs: ["type", "size", "class"] }, { kind: "component", type: FormManagementUploadComponent, selector: "valtimo-form-management-upload", inputs: ["show$"], outputs: ["definitionUploaded"] }, { kind: "pipe", type: i5.AsyncPipe, name: "async" }, { kind: "pipe", type: i2$1.TranslatePipe, name: "translate" }], encapsulation: i0.ViewEncapsulation.None }); }
|
|
654
805
|
}
|
|
655
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
806
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: FormManagementEditComponent, decorators: [{
|
|
656
807
|
type: Component,
|
|
657
|
-
args: [{ selector: 'valtimo-form-management-edit', encapsulation: ViewEncapsulation.None, template: "<!--\n ~ Copyright 2015-
|
|
658
|
-
}], ctorParameters:
|
|
808
|
+
args: [{ selector: 'valtimo-form-management-edit', encapsulation: ViewEncapsulation.None, template: "<!--\n ~ Copyright 2015-2024 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n<ng-container\n *ngIf=\"{\n formDefinition: formDefinition$ | async,\n jsonFormDefinition: jsonFormDefinition$ | async,\n jsonOutput: jsonOutput$ | async,\n compactMode: compactMode$ | async\n } as obs\"\n>\n @if (obs.formDefinition) {\n <ng-container renderInPageHeader [fullWidth]=\"true\">\n <ng-template>\n <div\n class=\"valtimo-form-management-edit__header-container\"\n [ngClass]=\"{'--compact': obs.compactMode}\"\n >\n @if (obs.formDefinition.readOnly) {\n <cds-tag size=\"sm\" type=\"blue\">{{ 'formManagement.readOnly' | translate }}</cds-tag>\n }\n\n <div class=\"valtimo-form-management-edit__header\">\n <cds-overflow-menu>\n <cds-overflow-menu-option (selected)=\"downloadFormDefinition(obs.formDefinition)\">\n {{ 'Download' | translate }}\n </cds-overflow-menu-option>\n\n <cds-overflow-menu-option\n [disabled]=\"obs.formDefinition.readOnly\"\n (selected)=\"showUploadModal()\"\n >\n {{ 'Upload' | translate }}\n </cds-overflow-menu-option>\n\n <cds-overflow-menu-option\n [disabled]=\"obs.formDefinition.readOnly\"\n (selected)=\"delete(obs.formDefinition)\"\n >\n {{ 'interface.delete' | translate }}\n </cds-overflow-menu-option>\n\n <cds-overflow-menu-option (selected)=\"showDuplicateModal(obs.formDefinition)\">\n {{ 'formManagement.duplicate' | translate }}\n </cds-overflow-menu-option>\n </cds-overflow-menu>\n\n <button\n cdsButton=\"primary\"\n [disabled]=\"obs.formDefinition.readOnly || !validJsonChange\"\n [size]=\"obs.compactMode ? 'sm' : 'md'\"\n (click)=\"modifyFormDefinition(obs.formDefinition)\"\n >\n {{ 'interface.save' | translate }}\n\n <svg class=\"cds--btn__icon\" cdsIcon=\"save\" size=\"16\"></svg>\n </button>\n </div>\n </div>\n </ng-template>\n </ng-container>\n\n <cds-tabs type=\"contained\">\n <cds-tab [heading]=\"TABS.BUILDER | translate\" (selected)=\"onSelectedTab(TABS.BUILDER)\">\n <valtimo-form-io-builder\n *ngIf=\"(reloading$ | async) === false && activeTab === TABS.BUILDER\"\n [form]=\"obs.formDefinition.formDefinition\"\n (change)=\"formBuilderChanged($event, obs.jsonFormDefinition)\"\n ></valtimo-form-io-builder>\n </cds-tab>\n\n <cds-tab [heading]=\"TABS.EDITOR | translate\" (selected)=\"onSelectedTab(TABS.EDITOR)\">\n <ng-container\n *ngTemplateOutlet=\"\n jsonEditor;\n context: {\n data: {\n disabled: obs.formDefinition.readOnly,\n formDefinition: obs.formDefinition,\n model: obs.jsonFormDefinition\n }\n }\n \"\n ></ng-container>\n </cds-tab>\n\n <cds-tab\n [heading]=\"TABS.OUTPUT | translate\"\n (selected)=\"onSelectedTab(TABS.OUTPUT)\"\n class=\"valtimo-form-management-edit__output\"\n >\n <valtimo-form-io\n [form]=\"obs.formDefinition.formDefinition\"\n (change)=\"onOutputChange($event)\"\n ></valtimo-form-io>\n\n <ng-container\n *ngTemplateOutlet=\"\n jsonEditor;\n context: {\n data: {disabled: true, formDefinition: obs.formDefinition, model: obs.jsonOutput}\n }\n \"\n ></ng-container>\n </cds-tab>\n </cds-tabs>\n } @else {\n <valtimo-spinner></valtimo-spinner>\n }\n\n <valtimo-confirmation-modal\n confirmButtonTextTranslationKey=\"interface.delete\"\n confirmButtonType=\"danger\"\n contentTranslationKey=\"interface.deleteConfirmation\"\n cancelButtonTextTranslationKey=\"interface.cancel\"\n [outputOnConfirm]=\"obs.formDefinition\"\n [showModalSubject$]=\"showDeleteModal$\"\n titleTranslationKey=\"dashboardManagement.delete\"\n (confirmEvent)=\"deleteFormDefinition($event)\"\n ></valtimo-confirmation-modal>\n\n <valtimo-form-management-upload\n [show$]=\"showModal$\"\n (definitionUploaded)=\"setFormDefinition($event)\"\n ></valtimo-form-management-upload>\n\n <ng-template #jsonEditor let-data=\"data\">\n <valtimo-editor\n [model]=\"data.model\"\n [disabled]=\"data.disabled\"\n (validEvent)=\"onValidEvent($event, data.disabled)\"\n (valueChangeEvent)=\"onValueChangeEvent($event, data.formDefinition, data.disabled)\"\n [fitPage]=\"true\"\n [fitPageExtraSpace]=\"80\"\n ></valtimo-editor>\n </ng-template>\n</ng-container>\n", styles: [".valtimo-form-management-edit__header{display:flex;align-items:center;justify-content:flex-end;gap:16px;margin-left:auto}.valtimo-form-management-edit__header-container{width:100%;display:flex;justify-content:space-between;align-items:flex-end;padding-bottom:4px}.valtimo-form-management-edit__header-container .cds--tag{margin:0;height:var(--cds-layout-size-height-md)}.valtimo-form-management-edit__header-container.--compact{align-items:flex-start;padding-bottom:0}.valtimo-form-management-edit__output .cds--tab-content{display:grid;grid-template-columns:1fr 1fr}.valtimo-form-management-edit__output .cds--tab-content>*{min-width:100%!important}.valtimo-form-management-edit .formbuilder .btn.formcomponent.drag-copy,.valtimo-form-management-edit .btn.formcomponent.gu-mirror{font-weight:400;background-color:silver;border-color:silver;color:#fff}.valtimo-form-management-edit .formbuilder .btn.formcomponent.drag-copy:hover,.valtimo-form-management-edit .formbuilder .btn.formcomponent.drag-copy:active,.valtimo-form-management-edit .btn.formcomponent.gu-mirror:hover,.valtimo-form-management-edit .btn.formcomponent.gu-mirror:active{box-shadow:none}.valtimo-form-management-edit .formbuilder .btn.formcomponent.drag-copy:active,.valtimo-form-management-edit .btn.formcomponent.gu-mirror:active{background-color:silver;border-color:silver}.valtimo-form-management-edit .formbuilder-header{padding-left:18px;padding-right:18px;font-size:18px;height:80px;border:1px solid #dee2e6;border-bottom:0}.valtimo-form-management-edit .formbuilder-header .formbuilder-title{margin-top:21px;margin-bottom:7px}.valtimo-form-management-edit .formbuilder-header .formbuilder-subtitle{margin-top:0;margin-bottom:12px}.valtimo-form-management-edit .formbuilder{background:#fff;padding:1rem;border:1px solid #dee2e6;margin-right:0!important;margin-left:0!important}.valtimo-form-management-edit .formbuilder .form-builder-panel .builder-group-button[aria-expanded=false],.valtimo-form-management-edit .formbuilder .form-builder-panel .builder-group-button[aria-expanded=\"\"]{color:#a9a9a9}.valtimo-form-management-edit .formbuilder .form-builder-panel .builder-group-button[aria-expanded=true]{color:#000}.valtimo-form-management-edit .formbuilder .drag-and-drop-alert{display:none}.valtimo-form-management-edit .formbuilder .formarea{padding:10px;border:solid 1px silver;background-color:#fff}.valtimo-form-management-edit .increase-size{font-size:1rem}.valtimo-form-management-edit .cds--tab-content{background:#fff!important}\n/*!\n * Copyright 2015-2024 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n"] }]
|
|
809
|
+
}], ctorParameters: () => [{ type: i1$1.AlertService }, { type: FormManagementService }, { type: i3.ModalService }, { type: i1$1.PageTitleService }, { type: i3$1.ActivatedRoute }, { type: i3$1.Router }, { type: i1$1.ShellService }, { type: i1$1.PageHeaderService }], propDecorators: { class: [{
|
|
810
|
+
type: HostBinding,
|
|
811
|
+
args: ['class']
|
|
812
|
+
}] } });
|
|
659
813
|
|
|
660
814
|
/*
|
|
661
|
-
* Copyright 2015-
|
|
815
|
+
* Copyright 2015-2024 Ritense BV, the Netherlands.
|
|
662
816
|
*
|
|
663
817
|
* Licensed under EUPL, Version 1.2 (the "License");
|
|
664
818
|
* you may not use this file except in compliance with the License.
|
|
@@ -694,24 +848,20 @@ const routes = [
|
|
|
694
848
|
},
|
|
695
849
|
];
|
|
696
850
|
class FormManagementRoutingModule {
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
}
|
|
701
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FormManagementRoutingModule, deps: [{ token: i3.Router }], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
702
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: FormManagementRoutingModule, imports: [i3.RouterModule], exports: [RouterModule] }); }
|
|
703
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FormManagementRoutingModule, imports: [RouterModule.forChild(routes), RouterModule] }); }
|
|
851
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: FormManagementRoutingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
852
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.3", ngImport: i0, type: FormManagementRoutingModule, imports: [i3$1.RouterModule], exports: [RouterModule] }); }
|
|
853
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: FormManagementRoutingModule, imports: [RouterModule.forRoot(routes, RouterUtils.getRouterExtraOptions()), RouterModule] }); }
|
|
704
854
|
}
|
|
705
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
855
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: FormManagementRoutingModule, decorators: [{
|
|
706
856
|
type: NgModule,
|
|
707
857
|
args: [{
|
|
708
|
-
imports: [RouterModule.
|
|
858
|
+
imports: [RouterModule.forRoot(routes, RouterUtils.getRouterExtraOptions())],
|
|
709
859
|
exports: [RouterModule],
|
|
710
860
|
}]
|
|
711
|
-
}]
|
|
861
|
+
}] });
|
|
712
862
|
|
|
713
863
|
/*
|
|
714
|
-
* Copyright 2015-
|
|
864
|
+
* Copyright 2015-2024 Ritense BV, the Netherlands.
|
|
715
865
|
*
|
|
716
866
|
* Licensed under EUPL, Version 1.2 (the "License");
|
|
717
867
|
* you may not use this file except in compliance with the License.
|
|
@@ -726,10 +876,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
726
876
|
* limitations under the License.
|
|
727
877
|
*/
|
|
728
878
|
class FormManagementModule {
|
|
729
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
730
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "
|
|
879
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: FormManagementModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
880
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.3", ngImport: i0, type: FormManagementModule, declarations: [FormManagementComponent,
|
|
731
881
|
FormManagementCreateComponent,
|
|
732
|
-
FormManagementListComponent,
|
|
733
882
|
FormManagementEditComponent,
|
|
734
883
|
FormManagementUploadComponent,
|
|
735
884
|
FormManagementDuplicateComponent], imports: [FormManagementRoutingModule,
|
|
@@ -754,8 +903,17 @@ class FormManagementModule {
|
|
|
754
903
|
InputModule$1,
|
|
755
904
|
PlaceholderModule,
|
|
756
905
|
ButtonModule$1,
|
|
757
|
-
ValtimoCdsModalDirectiveModule
|
|
758
|
-
|
|
906
|
+
ValtimoCdsModalDirectiveModule,
|
|
907
|
+
CarbonListModule,
|
|
908
|
+
DialogModule,
|
|
909
|
+
RenderInPageHeaderDirectiveModule,
|
|
910
|
+
TabsModule,
|
|
911
|
+
EditorModule,
|
|
912
|
+
SpinnerModule,
|
|
913
|
+
IconModule,
|
|
914
|
+
ConfirmationModalModule,
|
|
915
|
+
TagModule], exports: [FormManagementComponent] }); }
|
|
916
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: FormManagementModule, imports: [FormManagementRoutingModule,
|
|
759
917
|
FormIoModule,
|
|
760
918
|
CommonModule,
|
|
761
919
|
ReactiveFormsModule,
|
|
@@ -777,15 +935,23 @@ class FormManagementModule {
|
|
|
777
935
|
InputModule$1,
|
|
778
936
|
PlaceholderModule,
|
|
779
937
|
ButtonModule$1,
|
|
780
|
-
ValtimoCdsModalDirectiveModule
|
|
938
|
+
ValtimoCdsModalDirectiveModule,
|
|
939
|
+
CarbonListModule,
|
|
940
|
+
DialogModule,
|
|
941
|
+
RenderInPageHeaderDirectiveModule,
|
|
942
|
+
TabsModule,
|
|
943
|
+
EditorModule,
|
|
944
|
+
SpinnerModule,
|
|
945
|
+
IconModule,
|
|
946
|
+
ConfirmationModalModule,
|
|
947
|
+
TagModule] }); }
|
|
781
948
|
}
|
|
782
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
949
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: FormManagementModule, decorators: [{
|
|
783
950
|
type: NgModule,
|
|
784
951
|
args: [{
|
|
785
952
|
declarations: [
|
|
786
953
|
FormManagementComponent,
|
|
787
954
|
FormManagementCreateComponent,
|
|
788
|
-
FormManagementListComponent,
|
|
789
955
|
FormManagementEditComponent,
|
|
790
956
|
FormManagementUploadComponent,
|
|
791
957
|
FormManagementDuplicateComponent,
|
|
@@ -814,54 +980,22 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
814
980
|
PlaceholderModule,
|
|
815
981
|
ButtonModule$1,
|
|
816
982
|
ValtimoCdsModalDirectiveModule,
|
|
983
|
+
CarbonListModule,
|
|
984
|
+
DialogModule,
|
|
985
|
+
RenderInPageHeaderDirectiveModule,
|
|
986
|
+
TabsModule,
|
|
987
|
+
EditorModule,
|
|
988
|
+
SpinnerModule,
|
|
989
|
+
IconModule,
|
|
990
|
+
ConfirmationModalModule,
|
|
991
|
+
TagModule,
|
|
817
992
|
],
|
|
818
993
|
exports: [FormManagementComponent],
|
|
819
994
|
}]
|
|
820
995
|
}] });
|
|
821
996
|
|
|
822
997
|
/*
|
|
823
|
-
* Copyright 2015-
|
|
824
|
-
*
|
|
825
|
-
* Licensed under EUPL, Version 1.2 (the "License");
|
|
826
|
-
* you may not use this file except in compliance with the License.
|
|
827
|
-
* You may obtain a copy of the License at
|
|
828
|
-
*
|
|
829
|
-
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
830
|
-
*
|
|
831
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
832
|
-
* distributed under the License is distributed on an "AS IS" basis,
|
|
833
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
834
|
-
* See the License for the specific language governing permissions and
|
|
835
|
-
* limitations under the License.
|
|
836
|
-
*/
|
|
837
|
-
function compareFormDefinitions(fd1, fd2) {
|
|
838
|
-
if (fd1 === null && fd2 === null) {
|
|
839
|
-
return true;
|
|
840
|
-
}
|
|
841
|
-
if (fd1 === null || fd2 === null) {
|
|
842
|
-
return false;
|
|
843
|
-
}
|
|
844
|
-
return fd1.id === fd2.id;
|
|
845
|
-
}
|
|
846
|
-
|
|
847
|
-
/*
|
|
848
|
-
* Copyright 2015-2023 Ritense BV, the Netherlands.
|
|
849
|
-
*
|
|
850
|
-
* Licensed under EUPL, Version 1.2 (the "License");
|
|
851
|
-
* you may not use this file except in compliance with the License.
|
|
852
|
-
* You may obtain a copy of the License at
|
|
853
|
-
*
|
|
854
|
-
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
855
|
-
*
|
|
856
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
857
|
-
* distributed under the License is distributed on an "AS IS" basis,
|
|
858
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
859
|
-
* See the License for the specific language governing permissions and
|
|
860
|
-
* limitations under the License.
|
|
861
|
-
*/
|
|
862
|
-
|
|
863
|
-
/*
|
|
864
|
-
* Copyright 2015-2023 Ritense BV, the Netherlands.
|
|
998
|
+
* Copyright 2015-2024 Ritense BV, the Netherlands.
|
|
865
999
|
*
|
|
866
1000
|
* Licensed under EUPL, Version 1.2 (the "License");
|
|
867
1001
|
* you may not use this file except in compliance with the License.
|
|
@@ -883,5 +1017,5 @@ function compareFormDefinitions(fd1, fd2) {
|
|
|
883
1017
|
* Generated bundle index. Do not edit.
|
|
884
1018
|
*/
|
|
885
1019
|
|
|
886
|
-
export { FormManagementComponent, FormManagementModule, FormManagementService, compareFormDefinitions };
|
|
1020
|
+
export { EDIT_TABS, FormManagementComponent, FormManagementModule, FormManagementService, compareFormDefinitions };
|
|
887
1021
|
//# sourceMappingURL=valtimo-form-management.mjs.map
|