@valtimo/choice-field 4.23.0 → 5.2.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.
Files changed (68) hide show
  1. package/esm2020/lib/choice-field-create/choice-field-create.component.mjs +59 -0
  2. package/esm2020/lib/choice-field-detail/choice-field-detail.component.mjs +119 -0
  3. package/esm2020/lib/choice-field-list/choice-field-list.component.mjs +73 -0
  4. package/esm2020/lib/choice-field-routing.module.mjs +87 -0
  5. package/esm2020/lib/choice-field-value-create/choice-field-value-create.component.mjs +77 -0
  6. package/esm2020/lib/choice-field-value-detail/choice-field-value-detail.component.mjs +83 -0
  7. package/esm2020/lib/choice-field-value-list/choice-field-value-list.component.mjs +96 -0
  8. package/esm2020/lib/choice-field.module.mjs +82 -0
  9. package/esm2020/lib/choice-field.service.mjs +67 -0
  10. package/esm2020/lib/models/choice-field.model.mjs +17 -0
  11. package/esm2020/lib/models/choicefield-value.model.mjs +17 -0
  12. package/esm2020/lib/models/index.mjs +20 -0
  13. package/esm2020/public_api.mjs +22 -0
  14. package/esm2020/valtimo-choice-field.mjs +5 -0
  15. package/fesm2015/valtimo-choice-field.mjs +725 -0
  16. package/fesm2015/valtimo-choice-field.mjs.map +1 -0
  17. package/fesm2020/valtimo-choice-field.mjs +757 -0
  18. package/fesm2020/valtimo-choice-field.mjs.map +1 -0
  19. package/lib/choice-field-create/choice-field-create.component.d.ts +4 -0
  20. package/lib/choice-field-create/choice-field-create.component.d.ts.map +1 -0
  21. package/lib/choice-field-detail/choice-field-detail.component.d.ts +4 -0
  22. package/lib/choice-field-detail/choice-field-detail.component.d.ts.map +1 -0
  23. package/lib/choice-field-list/choice-field-list.component.d.ts +4 -0
  24. package/lib/choice-field-list/choice-field-list.component.d.ts.map +1 -0
  25. package/lib/choice-field-routing.module.d.ts +7 -0
  26. package/lib/choice-field-routing.module.d.ts.map +1 -0
  27. package/lib/choice-field-value-create/choice-field-value-create.component.d.ts +4 -0
  28. package/lib/choice-field-value-create/choice-field-value-create.component.d.ts.map +1 -0
  29. package/lib/choice-field-value-detail/choice-field-value-detail.component.d.ts +4 -0
  30. package/lib/choice-field-value-detail/choice-field-value-detail.component.d.ts.map +1 -0
  31. package/lib/choice-field-value-list/choice-field-value-list.component.d.ts +4 -0
  32. package/lib/choice-field-value-list/choice-field-value-list.component.d.ts.map +1 -0
  33. package/lib/choice-field.module.d.ts +16 -0
  34. package/lib/choice-field.module.d.ts.map +1 -0
  35. package/lib/choice-field.service.d.ts +4 -0
  36. package/lib/choice-field.service.d.ts.map +1 -0
  37. package/lib/models/choice-field.model.d.ts +1 -0
  38. package/lib/models/choice-field.model.d.ts.map +1 -0
  39. package/lib/models/choicefield-value.model.d.ts +1 -0
  40. package/lib/models/choicefield-value.model.d.ts.map +1 -0
  41. package/lib/models/index.d.ts +1 -0
  42. package/lib/models/index.d.ts.map +1 -0
  43. package/package.json +22 -10
  44. package/public_api.d.ts +1 -0
  45. package/public_api.d.ts.map +1 -0
  46. package/valtimo-choice-field.d.ts +2 -7
  47. package/valtimo-choice-field.d.ts.map +1 -0
  48. package/bundles/valtimo-choice-field.umd.js +0 -811
  49. package/bundles/valtimo-choice-field.umd.js.map +0 -1
  50. package/bundles/valtimo-choice-field.umd.min.js +0 -2
  51. package/bundles/valtimo-choice-field.umd.min.js.map +0 -1
  52. package/esm2015/lib/choice-field-create/choice-field-create.component.js +0 -63
  53. package/esm2015/lib/choice-field-detail/choice-field-detail.component.js +0 -123
  54. package/esm2015/lib/choice-field-list/choice-field-list.component.js +0 -75
  55. package/esm2015/lib/choice-field-routing.module.js +0 -83
  56. package/esm2015/lib/choice-field-value-create/choice-field-value-create.component.js +0 -82
  57. package/esm2015/lib/choice-field-value-detail/choice-field-value-detail.component.js +0 -88
  58. package/esm2015/lib/choice-field-value-list/choice-field-value-list.component.js +0 -100
  59. package/esm2015/lib/choice-field.module.js +0 -54
  60. package/esm2015/lib/choice-field.service.js +0 -71
  61. package/esm2015/lib/models/choice-field.model.js +0 -16
  62. package/esm2015/lib/models/choicefield-value.model.js +0 -16
  63. package/esm2015/lib/models/index.js +0 -20
  64. package/esm2015/public_api.js +0 -22
  65. package/esm2015/valtimo-choice-field.js +0 -12
  66. package/fesm2015/valtimo-choice-field.js +0 -765
  67. package/fesm2015/valtimo-choice-field.js.map +0 -1
  68. package/valtimo-choice-field.metadata.json +0 -1
@@ -0,0 +1,757 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Injectable, Component, NgModule } from '@angular/core';
3
+ import * as i1 from '@angular/common/http';
4
+ import * as i2 from '@valtimo/config';
5
+ import { ROLE_ADMIN } from '@valtimo/config';
6
+ import * as i5 from '@angular/common';
7
+ import { CommonModule } from '@angular/common';
8
+ import * as i2$1 from '@angular/forms';
9
+ import { FormControl, Validators, FormsModule, ReactiveFormsModule } from '@angular/forms';
10
+ import * as i4 from '@valtimo/components';
11
+ import { ListModule, WidgetModule, FieldAutoFocusModule, AlertModule } from '@valtimo/components';
12
+ import * as i1$1 from '@angular/router';
13
+ import { RouterModule } from '@angular/router';
14
+ import { AuthGuardService } from '@valtimo/security';
15
+ import * as i4$1 from '@ngx-translate/core';
16
+ import { TranslateModule } from '@ngx-translate/core';
17
+ import { Subscription } from 'rxjs';
18
+ import { first } from 'rxjs/operators';
19
+
20
+ /*
21
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
22
+ *
23
+ * Licensed under EUPL, Version 1.2 (the "License");
24
+ * you may not use this file except in compliance with the License.
25
+ * You may obtain a copy of the License at
26
+ *
27
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
28
+ *
29
+ * Unless required by applicable law or agreed to in writing, software
30
+ * distributed under the License is distributed on an "AS IS" basis,
31
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
32
+ * See the License for the specific language governing permissions and
33
+ * limitations under the License.
34
+ */
35
+
36
+ /*
37
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
38
+ *
39
+ * Licensed under EUPL, Version 1.2 (the "License");
40
+ * you may not use this file except in compliance with the License.
41
+ * You may obtain a copy of the License at
42
+ *
43
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
44
+ *
45
+ * Unless required by applicable law or agreed to in writing, software
46
+ * distributed under the License is distributed on an "AS IS" basis,
47
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
48
+ * See the License for the specific language governing permissions and
49
+ * limitations under the License.
50
+ */
51
+
52
+ /*
53
+ *
54
+ * * Copyright 2015-2020 Ritense BV, the Netherlands.
55
+ * *
56
+ * * Licensed under EUPL, Version 1.2 (the "License");
57
+ * * you may not use this file except in compliance with the License.
58
+ * * You may obtain a copy of the License at
59
+ * *
60
+ * * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
61
+ * *
62
+ * * Unless required by applicable law or agreed to in writing, software
63
+ * * distributed under the License is distributed on an "AS IS" basis,
64
+ * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
65
+ * * See the License for the specific language governing permissions and
66
+ * * limitations under the License.
67
+ *
68
+ */
69
+
70
+ /*
71
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
72
+ *
73
+ * Licensed under EUPL, Version 1.2 (the "License");
74
+ * you may not use this file except in compliance with the License.
75
+ * You may obtain a copy of the License at
76
+ *
77
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
78
+ *
79
+ * Unless required by applicable law or agreed to in writing, software
80
+ * distributed under the License is distributed on an "AS IS" basis,
81
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
82
+ * See the License for the specific language governing permissions and
83
+ * limitations under the License.
84
+ */
85
+ class ChoiceFieldService {
86
+ constructor(http, configService) {
87
+ this.http = http;
88
+ this.configService = configService;
89
+ this.valtimoApiConfig = configService.config.valtimoApi;
90
+ }
91
+ query(params) {
92
+ return this.http.get(`${this.valtimoApiConfig.endpointUri}choice-fields`, {
93
+ observe: 'response',
94
+ params,
95
+ });
96
+ }
97
+ get(id) {
98
+ return this.http.get(`${this.valtimoApiConfig.endpointUri}choice-fields/${id}`);
99
+ }
100
+ create(choiceField) {
101
+ return this.http.post(`${this.valtimoApiConfig.endpointUri}choice-fields`, choiceField);
102
+ }
103
+ delete(id) {
104
+ return this.http.delete(`${this.valtimoApiConfig.endpointUri}choice-fields/${id}`);
105
+ }
106
+ update(choiceField) {
107
+ return this.http.put(`${this.valtimoApiConfig.endpointUri}choice-fields`, choiceField);
108
+ }
109
+ queryValues(keyName, params) {
110
+ return this.http.get(`${this.valtimoApiConfig.endpointUri}choice-field-values/${keyName}/values`, { observe: 'response', params });
111
+ }
112
+ getValue(choiceFieldId) {
113
+ return this.http.get(`${this.valtimoApiConfig.endpointUri}choice-field-values/${choiceFieldId}`);
114
+ }
115
+ updateValue(choiceFieldValue, choiceFieldName) {
116
+ return this.http.put(`${this.valtimoApiConfig.endpointUri}choice-field-values`, choiceFieldValue, {
117
+ params: { choice_field_name: choiceFieldName },
118
+ });
119
+ }
120
+ createValue(choiceFieldValue, choiceFieldName) {
121
+ return this.http.post(`${this.valtimoApiConfig.endpointUri}choice-field-values`, choiceFieldValue, { params: { choice_field_name: choiceFieldName } });
122
+ }
123
+ }
124
+ ChoiceFieldService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: ChoiceFieldService, deps: [{ token: i1.HttpClient }, { token: i2.ConfigService }], target: i0.ɵɵFactoryTarget.Injectable });
125
+ ChoiceFieldService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: ChoiceFieldService, providedIn: 'root' });
126
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: ChoiceFieldService, decorators: [{
127
+ type: Injectable,
128
+ args: [{
129
+ providedIn: 'root',
130
+ }]
131
+ }], ctorParameters: function () { return [{ type: i1.HttpClient }, { type: i2.ConfigService }]; } });
132
+
133
+ /*
134
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
135
+ *
136
+ * Licensed under EUPL, Version 1.2 (the "License");
137
+ * you may not use this file except in compliance with the License.
138
+ * You may obtain a copy of the License at
139
+ *
140
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
141
+ *
142
+ * Unless required by applicable law or agreed to in writing, software
143
+ * distributed under the License is distributed on an "AS IS" basis,
144
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
145
+ * See the License for the specific language governing permissions and
146
+ * limitations under the License.
147
+ */
148
+ class ChoiceFieldListComponent {
149
+ constructor(router, service) {
150
+ this.router = router;
151
+ this.service = service;
152
+ this.choiceFields = [];
153
+ this.pagination = {
154
+ collectionSize: 0,
155
+ page: 1,
156
+ size: 10,
157
+ maxPaginationItemSize: 5,
158
+ };
159
+ this.pageParam = 0;
160
+ this.fields = [
161
+ {
162
+ key: 'id',
163
+ label: 'ID',
164
+ },
165
+ {
166
+ key: 'keyName',
167
+ label: 'Key',
168
+ },
169
+ {
170
+ key: 'title',
171
+ label: 'Title',
172
+ },
173
+ ];
174
+ }
175
+ ngOnInit() { }
176
+ paginationSet() {
177
+ this.initData();
178
+ }
179
+ initData() {
180
+ this.service.query({ page: this.pageParam, size: this.pagination.size }).subscribe(results => {
181
+ this.pagination.collectionSize = results.headers.get('x-total-count');
182
+ this.choiceFields = results.body;
183
+ });
184
+ }
185
+ rowClick(data) {
186
+ this.router.navigate([`/choice-fields/field/${encodeURI(data.id)}`]);
187
+ }
188
+ paginationClicked(page) {
189
+ this.pageParam = page - 1;
190
+ this.initData();
191
+ }
192
+ }
193
+ ChoiceFieldListComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: ChoiceFieldListComponent, deps: [{ token: i1$1.Router }, { token: ChoiceFieldService }], target: i0.ɵɵFactoryTarget.Component });
194
+ ChoiceFieldListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.9", type: ChoiceFieldListComponent, selector: "valtimo-choice-field-list", ngImport: i0, template: "<!--\n ~ Copyright 2015-2020 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 [routerLink]=\"'create'\" class=\"btn btn-primary btn-space mr-0\">\n <i class=\"icon mdi mdi-plus mr-1\"></i>\n <span>{{ 'Create new Choice field' | translate }}</span>\n </button>\n </div>\n </div>\n <valtimo-widget>\n <valtimo-list\n [items]=\"choiceFields\"\n [fields]=\"fields\"\n (rowClicked)=\"rowClick($event)\"\n [pagination]=\"pagination\"\n [viewMode]=\"true\"\n [isSearchable]=\"true\"\n paginationIdentifier=\"choiceFieldList\"\n (paginationClicked)=\"paginationClicked($event)\"\n (paginationSet)=\"paginationSet()\"\n [header]=\"true\"\n >\n <div header>\n <h3 class=\"list-header-title\">{{ 'Choice fields' | translate }}</h3>\n <h5 class=\"list-header-description\">{{ 'Overview of all Choice fields' | translate }}</h5>\n </div>\n </valtimo-list>\n </valtimo-widget>\n </div>\n</div>\n", styles: [""], components: [{ type: i4.WidgetComponent, selector: "valtimo-widget", inputs: ["type", "name", "icon", "contrast", "divider", "title", "subtitle", "collapseAble", "collapse", "additionalClasses"] }, { type: i4.ListComponent, selector: "valtimo-list", inputs: ["items", "fields", "pagination", "viewMode", "isSearchable", "header", "actions", "paginationIdentifier", "initialSortState"], outputs: ["rowClicked", "paginationClicked", "paginationSet", "search", "sortChanged"] }], directives: [{ type: i1$1.RouterLink, selector: ":not(a):not(area)[routerLink]", inputs: ["queryParams", "fragment", "queryParamsHandling", "preserveFragment", "skipLocationChange", "replaceUrl", "state", "relativeTo", "routerLink"] }], pipes: { "translate": i4$1.TranslatePipe } });
195
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: ChoiceFieldListComponent, decorators: [{
196
+ type: Component,
197
+ args: [{ selector: 'valtimo-choice-field-list', template: "<!--\n ~ Copyright 2015-2020 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 [routerLink]=\"'create'\" class=\"btn btn-primary btn-space mr-0\">\n <i class=\"icon mdi mdi-plus mr-1\"></i>\n <span>{{ 'Create new Choice field' | translate }}</span>\n </button>\n </div>\n </div>\n <valtimo-widget>\n <valtimo-list\n [items]=\"choiceFields\"\n [fields]=\"fields\"\n (rowClicked)=\"rowClick($event)\"\n [pagination]=\"pagination\"\n [viewMode]=\"true\"\n [isSearchable]=\"true\"\n paginationIdentifier=\"choiceFieldList\"\n (paginationClicked)=\"paginationClicked($event)\"\n (paginationSet)=\"paginationSet()\"\n [header]=\"true\"\n >\n <div header>\n <h3 class=\"list-header-title\">{{ 'Choice fields' | translate }}</h3>\n <h5 class=\"list-header-description\">{{ 'Overview of all Choice fields' | translate }}</h5>\n </div>\n </valtimo-list>\n </valtimo-widget>\n </div>\n</div>\n", styles: [""] }]
198
+ }], ctorParameters: function () { return [{ type: i1$1.Router }, { type: ChoiceFieldService }]; } });
199
+
200
+ /*
201
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
202
+ *
203
+ * Licensed under EUPL, Version 1.2 (the "License");
204
+ * you may not use this file except in compliance with the License.
205
+ * You may obtain a copy of the License at
206
+ *
207
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
208
+ *
209
+ * Unless required by applicable law or agreed to in writing, software
210
+ * distributed under the License is distributed on an "AS IS" basis,
211
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
212
+ * See the License for the specific language governing permissions and
213
+ * limitations under the License.
214
+ */
215
+ class ChoiceFieldValueListComponent {
216
+ constructor(router, route, formBuilder, service) {
217
+ this.router = router;
218
+ this.route = route;
219
+ this.formBuilder = formBuilder;
220
+ this.service = service;
221
+ this.choiceFieldValues = [];
222
+ this.pagination = {
223
+ collectionSize: 0,
224
+ page: 1,
225
+ size: 10,
226
+ maxPaginationItemSize: 5,
227
+ };
228
+ this.pageParam = 0;
229
+ this.fields = [
230
+ {
231
+ key: 'id',
232
+ label: 'ID',
233
+ },
234
+ {
235
+ key: 'name',
236
+ label: 'Key',
237
+ },
238
+ {
239
+ key: 'value',
240
+ label: 'Value',
241
+ },
242
+ {
243
+ key: 'deprecatedDisplayString',
244
+ label: 'Deprecated',
245
+ },
246
+ {
247
+ key: 'sortOrder',
248
+ label: 'Sequence',
249
+ },
250
+ ];
251
+ const snapshot = this.route.snapshot.paramMap;
252
+ this.id = snapshot.get('id');
253
+ }
254
+ ngOnInit() {
255
+ this.paginationSet();
256
+ }
257
+ paginationSet() {
258
+ this.initData(this.id);
259
+ }
260
+ initData(id) {
261
+ this.service.get(id).subscribe(result => {
262
+ this.choiceField = result;
263
+ this.service
264
+ .queryValues(this.choiceField.keyName, { page: this.pageParam, size: this.pagination.size })
265
+ .subscribe(values => {
266
+ this.pagination.collectionSize = values.headers.get('x-total-count');
267
+ this.choiceFieldValues = values.body;
268
+ this.choiceFieldValues.forEach(choiceFieldValue => {
269
+ choiceFieldValue.deprecatedDisplayString = choiceFieldValue.deprecated ? 'Yes' : 'No';
270
+ });
271
+ });
272
+ });
273
+ }
274
+ rowClick(data) {
275
+ this.router.navigate([`/choice-fields/field/${data.choiceField.id}/value/${data.id}`]);
276
+ }
277
+ paginationClicked(page) {
278
+ this.pageParam = page - 1;
279
+ this.initData(this.id);
280
+ }
281
+ }
282
+ ChoiceFieldValueListComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: ChoiceFieldValueListComponent, deps: [{ token: i1$1.Router }, { token: i1$1.ActivatedRoute }, { token: i2$1.FormBuilder }, { token: ChoiceFieldService }], target: i0.ɵɵFactoryTarget.Component });
283
+ ChoiceFieldValueListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.9", type: ChoiceFieldValueListComponent, selector: "valtimo-choice-field-value-list", ngImport: i0, template: "<!--\n ~ Copyright 2015-2020 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 [routerLink]=\"'create-value'\" class=\"btn btn-primary btn-space mr-0\">\n <i class=\"icon mdi mdi-plus mr-1\"></i>\n <span>{{ 'Create new Choice field value' | translate }}</span>\n </button>\n </div>\n </div>\n <valtimo-widget>\n <valtimo-list\n [items]=\"choiceFieldValues\"\n [fields]=\"fields\"\n [viewMode]=\"true\"\n [isSearchable]=\"true\"\n (rowClicked)=\"rowClick($event)\"\n [pagination]=\"pagination\"\n paginationIdentifier=\"choiceFieldValueList\"\n (paginationClicked)=\"paginationClicked($event)\"\n [header]=\"true\"\n >\n <div header>\n <h3 class=\"list-header-title\">{{ 'Choice field values' | translate }}</h3>\n <h5 class=\"list-header-description\">\n {{ 'Overview of all Choice field values' | translate }}\n </h5>\n </div>\n </valtimo-list>\n </valtimo-widget>\n </div>\n</div>\n", styles: [""], components: [{ type: i4.WidgetComponent, selector: "valtimo-widget", inputs: ["type", "name", "icon", "contrast", "divider", "title", "subtitle", "collapseAble", "collapse", "additionalClasses"] }, { type: i4.ListComponent, selector: "valtimo-list", inputs: ["items", "fields", "pagination", "viewMode", "isSearchable", "header", "actions", "paginationIdentifier", "initialSortState"], outputs: ["rowClicked", "paginationClicked", "paginationSet", "search", "sortChanged"] }], directives: [{ type: i1$1.RouterLink, selector: ":not(a):not(area)[routerLink]", inputs: ["queryParams", "fragment", "queryParamsHandling", "preserveFragment", "skipLocationChange", "replaceUrl", "state", "relativeTo", "routerLink"] }], pipes: { "translate": i4$1.TranslatePipe } });
284
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: ChoiceFieldValueListComponent, decorators: [{
285
+ type: Component,
286
+ args: [{ selector: 'valtimo-choice-field-value-list', template: "<!--\n ~ Copyright 2015-2020 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 [routerLink]=\"'create-value'\" class=\"btn btn-primary btn-space mr-0\">\n <i class=\"icon mdi mdi-plus mr-1\"></i>\n <span>{{ 'Create new Choice field value' | translate }}</span>\n </button>\n </div>\n </div>\n <valtimo-widget>\n <valtimo-list\n [items]=\"choiceFieldValues\"\n [fields]=\"fields\"\n [viewMode]=\"true\"\n [isSearchable]=\"true\"\n (rowClicked)=\"rowClick($event)\"\n [pagination]=\"pagination\"\n paginationIdentifier=\"choiceFieldValueList\"\n (paginationClicked)=\"paginationClicked($event)\"\n [header]=\"true\"\n >\n <div header>\n <h3 class=\"list-header-title\">{{ 'Choice field values' | translate }}</h3>\n <h5 class=\"list-header-description\">\n {{ 'Overview of all Choice field values' | translate }}\n </h5>\n </div>\n </valtimo-list>\n </valtimo-widget>\n </div>\n</div>\n", styles: [""] }]
287
+ }], ctorParameters: function () { return [{ type: i1$1.Router }, { type: i1$1.ActivatedRoute }, { type: i2$1.FormBuilder }, { type: ChoiceFieldService }]; } });
288
+
289
+ /*
290
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
291
+ *
292
+ * Licensed under EUPL, Version 1.2 (the "License");
293
+ * you may not use this file except in compliance with the License.
294
+ * You may obtain a copy of the License at
295
+ *
296
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
297
+ *
298
+ * Unless required by applicable law or agreed to in writing, software
299
+ * distributed under the License is distributed on an "AS IS" basis,
300
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
301
+ * See the License for the specific language governing permissions and
302
+ * limitations under the License.
303
+ */
304
+ class ChoiceFieldDetailComponent {
305
+ constructor(router, route, formBuilder, service, alertService) {
306
+ this.router = router;
307
+ this.route = route;
308
+ this.formBuilder = formBuilder;
309
+ this.service = service;
310
+ this.alertService = alertService;
311
+ this.alertSub = Subscription.EMPTY;
312
+ const snapshot = this.route.snapshot.paramMap;
313
+ this.id = snapshot.get('id');
314
+ }
315
+ ngOnInit() {
316
+ this.reset();
317
+ }
318
+ ngOnDestroy() {
319
+ this.alertSub.unsubscribe();
320
+ }
321
+ get formControls() {
322
+ return this.form.controls;
323
+ }
324
+ initData(id) {
325
+ this.service.get(id).subscribe(result => {
326
+ this.choiceField = result;
327
+ this.setValues();
328
+ });
329
+ }
330
+ setValues() {
331
+ if (this.choiceField) {
332
+ // set form values
333
+ this.form.controls.id.setValue(this.choiceField.id);
334
+ this.form.controls.keyName.setValue(this.choiceField.keyName);
335
+ this.form.controls.title.setValue(this.choiceField.title);
336
+ }
337
+ }
338
+ createFormGroup() {
339
+ return this.formBuilder.group({
340
+ id: new FormControl('', Validators.required),
341
+ keyName: new FormControl('', Validators.required),
342
+ title: new FormControl('', Validators.required),
343
+ });
344
+ }
345
+ reset() {
346
+ this.form = this.createFormGroup();
347
+ this.initData(this.id);
348
+ }
349
+ delete() {
350
+ if (!this.alertSub.closed) {
351
+ return;
352
+ }
353
+ // confirm delete
354
+ const mssg = 'Delete choice field?';
355
+ const confirmations = [
356
+ {
357
+ label: 'Cancel',
358
+ class: 'btn btn-default',
359
+ value: false,
360
+ },
361
+ {
362
+ label: 'Delete',
363
+ class: 'btn btn-primary',
364
+ value: true,
365
+ },
366
+ ];
367
+ this.alertService.notification(mssg, confirmations);
368
+ this.alertSub = this.alertService
369
+ .getAlertConfirmChangeEmitter()
370
+ .pipe(first())
371
+ .subscribe(alert => {
372
+ if (alert.confirm === true) {
373
+ this.deleteConfirmed();
374
+ }
375
+ });
376
+ }
377
+ deleteConfirmed() {
378
+ this.service.delete(this.id).subscribe(() => {
379
+ this.router.navigate([`/choice-fields`]);
380
+ this.alertService.success('Choice field has been deleted');
381
+ });
382
+ }
383
+ onSubmit() {
384
+ this.service.update(this.form.value).subscribe(() => {
385
+ this.reset();
386
+ this.alertService.success('Choice field details have been updated');
387
+ });
388
+ }
389
+ }
390
+ ChoiceFieldDetailComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: ChoiceFieldDetailComponent, deps: [{ token: i1$1.Router }, { token: i1$1.ActivatedRoute }, { token: i2$1.FormBuilder }, { token: ChoiceFieldService }, { token: i4.AlertService }], target: i0.ɵɵFactoryTarget.Component });
391
+ ChoiceFieldDetailComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.9", type: ChoiceFieldDetailComponent, selector: "valtimo-choice-field-detail", ngImport: i0, template: "<!--\n ~ Copyright 2015-2020 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 *ngIf=\"choiceField\">\n <div>\n <div class=\"card-body bg-light\">\n <div class=\"row py-5\">\n <div class=\"col-12\">\n <div class=\"row mb-3\">\n <div class=\"col-12 col-sm-3 text-sm-right\"><strong>ID</strong></div>\n <div class=\"col-12 col-sm-8 col-lg-6\">{{ choiceField.id }}</div>\n </div>\n <div class=\"row\">\n <div class=\"col-12 col-sm-3 text-sm-right\"><strong>Key</strong></div>\n <div class=\"col-12 col-sm-8 col-lg-6\">{{ choiceField.keyName }}</div>\n </div>\n </div>\n </div>\n </div>\n\n <div class=\"p-5 bg-white\">\n <form [formGroup]=\"form\" (ngSubmit)=\"onSubmit()\">\n <div class=\"form-group row\">\n <label class=\"col-12 col-sm-3 col-form-label text-sm-right\" for=\"title\"\n >Title</label\n >\n <div class=\"col-12 col-sm-8 col-lg-6\">\n <input\n valtimoFieldAutoFocus\n type=\"text\"\n id=\"title\"\n formControlName=\"title\"\n class=\"form-control\"\n placeholder=\"Choice field title\"\n [ngClass]=\"{\n 'is-valid': formControls.title.touched && formControls.title.valid,\n 'is-invalid': formControls.title.touched && formControls.title.errors\n }\"\n required\n />\n <div\n *ngIf=\"formControls.title.touched && formControls.title.errors\"\n class=\"invalid-feedback\"\n >\n <div *ngIf=\"formControls.title.errors.required\">Title is required</div>\n </div>\n </div>\n </div>\n\n <div class=\"row pt-3 mt-1\">\n <div class=\"col-12 col-sm-6 text-left\">\n <a [routerLink]=\"'/choice-fields'\" class=\"btn btn-space btn-default\">Back</a>\n <button class=\"btn btn-space btn-danger\" type=\"button\" (click)=\"delete()\">\n Delete\n </button>\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 Reset\n </button>\n <button class=\"btn btn-space btn-primary\" type=\"submit\" [disabled]=\"form.invalid\">\n Submit\n </button>\n </div>\n </div>\n </form>\n </div>\n </div>\n </valtimo-widget>\n </div>\n </div>\n</div>\n\n<div class=\"page-head\">\n <h2 class=\"page-head-title\">Choice field values</h2>\n</div>\n<valtimo-choice-field-value-list></valtimo-choice-field-value-list>\n", styles: [""], components: [{ type: i4.WidgetComponent, selector: "valtimo-widget", inputs: ["type", "name", "icon", "contrast", "divider", "title", "subtitle", "collapseAble", "collapse", "additionalClasses"] }, { type: ChoiceFieldValueListComponent, selector: "valtimo-choice-field-value-list" }], directives: [{ type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i2$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i2$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i2$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i4.FieldAutoFocusDirective, selector: "[valtimoFieldAutoFocus]" }, { type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i2$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { type: i2$1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { type: i5.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i1$1.RouterLinkWithHref, selector: "a[routerLink],area[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "preserveFragment", "skipLocationChange", "replaceUrl", "state", "relativeTo", "routerLink"] }] });
392
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: ChoiceFieldDetailComponent, decorators: [{
393
+ type: Component,
394
+ args: [{ selector: 'valtimo-choice-field-detail', template: "<!--\n ~ Copyright 2015-2020 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 *ngIf=\"choiceField\">\n <div>\n <div class=\"card-body bg-light\">\n <div class=\"row py-5\">\n <div class=\"col-12\">\n <div class=\"row mb-3\">\n <div class=\"col-12 col-sm-3 text-sm-right\"><strong>ID</strong></div>\n <div class=\"col-12 col-sm-8 col-lg-6\">{{ choiceField.id }}</div>\n </div>\n <div class=\"row\">\n <div class=\"col-12 col-sm-3 text-sm-right\"><strong>Key</strong></div>\n <div class=\"col-12 col-sm-8 col-lg-6\">{{ choiceField.keyName }}</div>\n </div>\n </div>\n </div>\n </div>\n\n <div class=\"p-5 bg-white\">\n <form [formGroup]=\"form\" (ngSubmit)=\"onSubmit()\">\n <div class=\"form-group row\">\n <label class=\"col-12 col-sm-3 col-form-label text-sm-right\" for=\"title\"\n >Title</label\n >\n <div class=\"col-12 col-sm-8 col-lg-6\">\n <input\n valtimoFieldAutoFocus\n type=\"text\"\n id=\"title\"\n formControlName=\"title\"\n class=\"form-control\"\n placeholder=\"Choice field title\"\n [ngClass]=\"{\n 'is-valid': formControls.title.touched && formControls.title.valid,\n 'is-invalid': formControls.title.touched && formControls.title.errors\n }\"\n required\n />\n <div\n *ngIf=\"formControls.title.touched && formControls.title.errors\"\n class=\"invalid-feedback\"\n >\n <div *ngIf=\"formControls.title.errors.required\">Title is required</div>\n </div>\n </div>\n </div>\n\n <div class=\"row pt-3 mt-1\">\n <div class=\"col-12 col-sm-6 text-left\">\n <a [routerLink]=\"'/choice-fields'\" class=\"btn btn-space btn-default\">Back</a>\n <button class=\"btn btn-space btn-danger\" type=\"button\" (click)=\"delete()\">\n Delete\n </button>\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 Reset\n </button>\n <button class=\"btn btn-space btn-primary\" type=\"submit\" [disabled]=\"form.invalid\">\n Submit\n </button>\n </div>\n </div>\n </form>\n </div>\n </div>\n </valtimo-widget>\n </div>\n </div>\n</div>\n\n<div class=\"page-head\">\n <h2 class=\"page-head-title\">Choice field values</h2>\n</div>\n<valtimo-choice-field-value-list></valtimo-choice-field-value-list>\n", styles: [""] }]
395
+ }], ctorParameters: function () { return [{ type: i1$1.Router }, { type: i1$1.ActivatedRoute }, { type: i2$1.FormBuilder }, { type: ChoiceFieldService }, { type: i4.AlertService }]; } });
396
+
397
+ /*
398
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
399
+ *
400
+ * Licensed under EUPL, Version 1.2 (the "License");
401
+ * you may not use this file except in compliance with the License.
402
+ * You may obtain a copy of the License at
403
+ *
404
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
405
+ *
406
+ * Unless required by applicable law or agreed to in writing, software
407
+ * distributed under the License is distributed on an "AS IS" basis,
408
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
409
+ * See the License for the specific language governing permissions and
410
+ * limitations under the License.
411
+ */
412
+ class ChoiceFieldCreateComponent {
413
+ constructor(router, formBuilder, service, alertService) {
414
+ this.router = router;
415
+ this.formBuilder = formBuilder;
416
+ this.service = service;
417
+ this.alertService = alertService;
418
+ }
419
+ ngOnInit() {
420
+ this.reset();
421
+ }
422
+ get formControls() {
423
+ return this.form.controls;
424
+ }
425
+ createFormGroup() {
426
+ return this.formBuilder.group({
427
+ keyName: new FormControl('', Validators.required),
428
+ title: new FormControl('', Validators.required),
429
+ });
430
+ }
431
+ onSubmit() {
432
+ this.service.create(this.form.value).subscribe(result => {
433
+ this.router.navigate([`/choice-fields/field/${result.id}`]);
434
+ this.alertService.success('New choice field has been created');
435
+ });
436
+ }
437
+ reset() {
438
+ this.form = this.createFormGroup();
439
+ }
440
+ }
441
+ ChoiceFieldCreateComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: ChoiceFieldCreateComponent, deps: [{ token: i1$1.Router }, { token: i2$1.FormBuilder }, { token: ChoiceFieldService }, { token: i4.AlertService }], target: i0.ɵɵFactoryTarget.Component });
442
+ ChoiceFieldCreateComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.9", type: ChoiceFieldCreateComponent, selector: "valtimo-choice-field-create", ngImport: i0, template: "<!--\n ~ Copyright 2015-2020 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>\n <div class=\"p-5 bg-white\">\n <form [formGroup]=\"form\" (ngSubmit)=\"onSubmit()\">\n <div class=\"form-group row\">\n <label class=\"col-12 col-sm-3 col-form-label text-sm-right\" for=\"keyName\"\n >Key</label\n >\n <div class=\"col-12 col-sm-8 col-lg-6\">\n <input\n valtimoFieldAutoFocus\n type=\"text\"\n id=\"keyName\"\n formControlName=\"keyName\"\n class=\"form-control\"\n placeholder=\"Choice field key name\"\n [ngClass]=\"{\n 'is-valid': formControls.keyName.touched && formControls.keyName.valid,\n 'is-invalid': formControls.keyName.touched && formControls.keyName.errors\n }\"\n required\n />\n <div\n *ngIf=\"formControls.keyName.touched && formControls.keyName.errors\"\n class=\"invalid-feedback\"\n >\n <div *ngIf=\"formControls.keyName.errors.required\">Key name is required</div>\n </div>\n </div>\n </div>\n\n <div class=\"form-group row\">\n <label class=\"col-12 col-sm-3 col-form-label text-sm-right\" for=\"title\"\n >Title</label\n >\n <div class=\"col-12 col-sm-8 col-lg-6\">\n <input\n type=\"text\"\n id=\"title\"\n formControlName=\"title\"\n class=\"form-control\"\n placeholder=\"Choice field title\"\n [ngClass]=\"{\n 'is-valid': formControls.title.touched && formControls.title.valid,\n 'is-invalid': formControls.title.touched && formControls.title.errors\n }\"\n required\n />\n <div\n *ngIf=\"formControls.title.touched && formControls.title.errors\"\n class=\"invalid-feedback\"\n >\n <div *ngIf=\"formControls.title.errors.required\">Title is required</div>\n </div>\n </div>\n </div>\n\n <div class=\"row pt-3 mt-1\">\n <div class=\"col-12 col-sm-6 text-left\">\n <a [routerLink]=\"'/choice-fields'\" class=\"btn btn-space btn-default\">Back</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 Reset\n </button>\n <button class=\"btn btn-space btn-primary\" type=\"submit\" [disabled]=\"form.invalid\">\n Submit\n </button>\n </div>\n </div>\n </form>\n </div>\n </div>\n </valtimo-widget>\n </div>\n </div>\n</div>\n", styles: [""], components: [{ type: i4.WidgetComponent, selector: "valtimo-widget", inputs: ["type", "name", "icon", "contrast", "divider", "title", "subtitle", "collapseAble", "collapse", "additionalClasses"] }], directives: [{ type: i2$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i2$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i2$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i2$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i4.FieldAutoFocusDirective, selector: "[valtimoFieldAutoFocus]" }, { type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i2$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { type: i2$1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { type: i5.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1$1.RouterLinkWithHref, selector: "a[routerLink],area[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "preserveFragment", "skipLocationChange", "replaceUrl", "state", "relativeTo", "routerLink"] }] });
443
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: ChoiceFieldCreateComponent, decorators: [{
444
+ type: Component,
445
+ args: [{ selector: 'valtimo-choice-field-create', template: "<!--\n ~ Copyright 2015-2020 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>\n <div class=\"p-5 bg-white\">\n <form [formGroup]=\"form\" (ngSubmit)=\"onSubmit()\">\n <div class=\"form-group row\">\n <label class=\"col-12 col-sm-3 col-form-label text-sm-right\" for=\"keyName\"\n >Key</label\n >\n <div class=\"col-12 col-sm-8 col-lg-6\">\n <input\n valtimoFieldAutoFocus\n type=\"text\"\n id=\"keyName\"\n formControlName=\"keyName\"\n class=\"form-control\"\n placeholder=\"Choice field key name\"\n [ngClass]=\"{\n 'is-valid': formControls.keyName.touched && formControls.keyName.valid,\n 'is-invalid': formControls.keyName.touched && formControls.keyName.errors\n }\"\n required\n />\n <div\n *ngIf=\"formControls.keyName.touched && formControls.keyName.errors\"\n class=\"invalid-feedback\"\n >\n <div *ngIf=\"formControls.keyName.errors.required\">Key name is required</div>\n </div>\n </div>\n </div>\n\n <div class=\"form-group row\">\n <label class=\"col-12 col-sm-3 col-form-label text-sm-right\" for=\"title\"\n >Title</label\n >\n <div class=\"col-12 col-sm-8 col-lg-6\">\n <input\n type=\"text\"\n id=\"title\"\n formControlName=\"title\"\n class=\"form-control\"\n placeholder=\"Choice field title\"\n [ngClass]=\"{\n 'is-valid': formControls.title.touched && formControls.title.valid,\n 'is-invalid': formControls.title.touched && formControls.title.errors\n }\"\n required\n />\n <div\n *ngIf=\"formControls.title.touched && formControls.title.errors\"\n class=\"invalid-feedback\"\n >\n <div *ngIf=\"formControls.title.errors.required\">Title is required</div>\n </div>\n </div>\n </div>\n\n <div class=\"row pt-3 mt-1\">\n <div class=\"col-12 col-sm-6 text-left\">\n <a [routerLink]=\"'/choice-fields'\" class=\"btn btn-space btn-default\">Back</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 Reset\n </button>\n <button class=\"btn btn-space btn-primary\" type=\"submit\" [disabled]=\"form.invalid\">\n Submit\n </button>\n </div>\n </div>\n </form>\n </div>\n </div>\n </valtimo-widget>\n </div>\n </div>\n</div>\n", styles: [""] }]
446
+ }], ctorParameters: function () { return [{ type: i1$1.Router }, { type: i2$1.FormBuilder }, { type: ChoiceFieldService }, { type: i4.AlertService }]; } });
447
+
448
+ /*
449
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
450
+ *
451
+ * Licensed under EUPL, Version 1.2 (the "License");
452
+ * you may not use this file except in compliance with the License.
453
+ * You may obtain a copy of the License at
454
+ *
455
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
456
+ *
457
+ * Unless required by applicable law or agreed to in writing, software
458
+ * distributed under the License is distributed on an "AS IS" basis,
459
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
460
+ * See the License for the specific language governing permissions and
461
+ * limitations under the License.
462
+ */
463
+ class ChoiceFieldValueCreateComponent {
464
+ constructor(router, route, formBuilder, service, alertService) {
465
+ this.router = router;
466
+ this.route = route;
467
+ this.formBuilder = formBuilder;
468
+ this.service = service;
469
+ this.alertService = alertService;
470
+ const snapshot = this.route.snapshot.paramMap;
471
+ this.choiceFieldId = snapshot.get('id');
472
+ }
473
+ ngOnInit() {
474
+ this.reset();
475
+ }
476
+ get formControls() {
477
+ return this.form.controls;
478
+ }
479
+ createFormGroup() {
480
+ return this.formBuilder.group({
481
+ name: new FormControl('', Validators.required),
482
+ value: new FormControl('', Validators.required),
483
+ sortOrder: new FormControl('', Validators.required),
484
+ deprecated: new FormControl('', Validators.required),
485
+ });
486
+ }
487
+ initData(id) {
488
+ this.service.get(id).subscribe(result => {
489
+ this.choiceField = result;
490
+ this.setValues();
491
+ });
492
+ }
493
+ setValues() {
494
+ if (this.choiceField) {
495
+ // set form values default false
496
+ this.form.controls.deprecated.setValue(false);
497
+ }
498
+ }
499
+ onSubmit() {
500
+ this.service.createValue(this.form.value, this.choiceField.keyName).subscribe(result => {
501
+ this.router.navigate([`/choice-fields/field/${encodeURI(this.choiceFieldId)}`]);
502
+ this.alertService.success('New choice field value has been created');
503
+ });
504
+ }
505
+ reset() {
506
+ this.form = this.createFormGroup();
507
+ this.initData(this.choiceFieldId);
508
+ }
509
+ }
510
+ ChoiceFieldValueCreateComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: ChoiceFieldValueCreateComponent, deps: [{ token: i1$1.Router }, { token: i1$1.ActivatedRoute }, { token: i2$1.FormBuilder }, { token: ChoiceFieldService }, { token: i4.AlertService }], target: i0.ɵɵFactoryTarget.Component });
511
+ ChoiceFieldValueCreateComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.9", type: ChoiceFieldValueCreateComponent, selector: "valtimo-choice-field-value-create", ngImport: i0, template: "<!--\n ~ Copyright 2015-2020 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 *ngIf=\"choiceField\">\n <div>\n <div class=\"card-body bg-light\">\n <div class=\"row py-5\">\n <div class=\"col-12\">\n <div class=\"row mb-3\">\n <div class=\"col-12\">\n <strong>Choice field</strong>\n <hr />\n </div>\n </div>\n <div class=\"row mb-3\">\n <div class=\"col-12 col-sm-3 text-sm-right\"><strong>ID</strong></div>\n <div class=\"col-12 col-sm-8 col-lg-6\">{{ choiceField.id }}</div>\n </div>\n <div class=\"row mb-3\">\n <div class=\"col-12 col-sm-3 text-sm-right\"><strong>Key</strong></div>\n <div class=\"col-12 col-sm-8 col-lg-6\">{{ choiceField.keyName }}</div>\n </div>\n <div class=\"row\">\n <div class=\"col-12 col-sm-3 text-sm-right\"><strong>Title</strong></div>\n <div class=\"col-12 col-sm-8 col-lg-6\">{{ choiceField.title }}</div>\n </div>\n </div>\n </div>\n </div>\n\n <div class=\"bg-white p-5\">\n <form [formGroup]=\"form\" (ngSubmit)=\"onSubmit()\">\n <div class=\"form-group row\">\n <label class=\"col-12 col-sm-3 col-form-label text-sm-right\" for=\"name\">Key</label>\n <div class=\"col-12 col-sm-8 col-lg-6\">\n <input\n valtimoFieldAutoFocus\n type=\"text\"\n id=\"name\"\n formControlName=\"name\"\n class=\"form-control\"\n placeholder=\"Choice field value key\"\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 Choice field value key is required\n </div>\n </div>\n </div>\n </div>\n\n <div class=\"form-group row\">\n <label class=\"col-12 col-sm-3 col-form-label text-sm-right\" for=\"value\"\n >Value</label\n >\n <div class=\"col-12 col-sm-8 col-lg-6\">\n <input\n type=\"text\"\n id=\"value\"\n formControlName=\"value\"\n class=\"form-control\"\n placeholder=\"Choice field value\"\n [ngClass]=\"{\n 'is-valid': formControls.value.touched && formControls.value.valid,\n 'is-invalid': formControls.value.touched && formControls.value.errors\n }\"\n required\n />\n <div\n *ngIf=\"formControls.value.touched && formControls.value.errors\"\n class=\"invalid-feedback\"\n >\n <div *ngIf=\"formControls.value.errors.required\">\n Choice field value is required\n </div>\n </div>\n </div>\n </div>\n\n <div class=\"form-group row\">\n <label class=\"col-12 col-sm-3 col-form-label text-sm-right\" for=\"sortOrder\"\n >Sequence</label\n >\n <div class=\"col-12 col-sm-8 col-lg-6\">\n <input\n type=\"number\"\n id=\"sortOrder\"\n formControlName=\"sortOrder\"\n class=\"form-control\"\n placeholder=\"Choice field value sequence\"\n [ngClass]=\"{\n 'is-valid': formControls.sortOrder.touched && formControls.sortOrder.valid,\n 'is-invalid': formControls.sortOrder.touched && formControls.sortOrder.errors\n }\"\n required\n />\n <div\n *ngIf=\"formControls.sortOrder.touched && formControls.sortOrder.errors\"\n class=\"invalid-feedback\"\n >\n <div *ngIf=\"formControls.sortOrder.errors.required\">\n Choice field value sequence is required\n </div>\n </div>\n </div>\n </div>\n\n <div class=\"form-group row\">\n <label class=\"col-12 col-sm-3 col-form-label text-sm-right\" for=\"deprecated\"\n >Deprecated</label\n >\n <div class=\"col-12 col-sm-8 col-lg-6\">\n <div class=\"switch-button switch-button-sm switch-button-success\">\n <input type=\"checkbox\" formControlName=\"deprecated\" id=\"deprecated\" /><span>\n <label for=\"deprecated\"></label\n ></span>\n </div>\n </div>\n </div>\n\n <div class=\"row pt-3 mt-1\">\n <div class=\"col-12 col-sm-6 text-left\">\n <a [routerLink]=\"'../'\" class=\"btn btn-space btn-default\">Back</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 Reset\n </button>\n <button class=\"btn btn-space btn-primary\" type=\"submit\" [disabled]=\"form.invalid\">\n Submit\n </button>\n </div>\n </div>\n </form>\n </div>\n </div>\n </valtimo-widget>\n </div>\n </div>\n</div>\n", styles: [""], components: [{ type: i4.WidgetComponent, selector: "valtimo-widget", inputs: ["type", "name", "icon", "contrast", "divider", "title", "subtitle", "collapseAble", "collapse", "additionalClasses"] }], directives: [{ type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i2$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i2$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i2$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i4.FieldAutoFocusDirective, selector: "[valtimoFieldAutoFocus]" }, { type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i2$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { type: i2$1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { type: i5.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i2$1.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { type: i2$1.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { type: i1$1.RouterLinkWithHref, selector: "a[routerLink],area[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "preserveFragment", "skipLocationChange", "replaceUrl", "state", "relativeTo", "routerLink"] }] });
512
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: ChoiceFieldValueCreateComponent, decorators: [{
513
+ type: Component,
514
+ args: [{ selector: 'valtimo-choice-field-value-create', template: "<!--\n ~ Copyright 2015-2020 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 *ngIf=\"choiceField\">\n <div>\n <div class=\"card-body bg-light\">\n <div class=\"row py-5\">\n <div class=\"col-12\">\n <div class=\"row mb-3\">\n <div class=\"col-12\">\n <strong>Choice field</strong>\n <hr />\n </div>\n </div>\n <div class=\"row mb-3\">\n <div class=\"col-12 col-sm-3 text-sm-right\"><strong>ID</strong></div>\n <div class=\"col-12 col-sm-8 col-lg-6\">{{ choiceField.id }}</div>\n </div>\n <div class=\"row mb-3\">\n <div class=\"col-12 col-sm-3 text-sm-right\"><strong>Key</strong></div>\n <div class=\"col-12 col-sm-8 col-lg-6\">{{ choiceField.keyName }}</div>\n </div>\n <div class=\"row\">\n <div class=\"col-12 col-sm-3 text-sm-right\"><strong>Title</strong></div>\n <div class=\"col-12 col-sm-8 col-lg-6\">{{ choiceField.title }}</div>\n </div>\n </div>\n </div>\n </div>\n\n <div class=\"bg-white p-5\">\n <form [formGroup]=\"form\" (ngSubmit)=\"onSubmit()\">\n <div class=\"form-group row\">\n <label class=\"col-12 col-sm-3 col-form-label text-sm-right\" for=\"name\">Key</label>\n <div class=\"col-12 col-sm-8 col-lg-6\">\n <input\n valtimoFieldAutoFocus\n type=\"text\"\n id=\"name\"\n formControlName=\"name\"\n class=\"form-control\"\n placeholder=\"Choice field value key\"\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 Choice field value key is required\n </div>\n </div>\n </div>\n </div>\n\n <div class=\"form-group row\">\n <label class=\"col-12 col-sm-3 col-form-label text-sm-right\" for=\"value\"\n >Value</label\n >\n <div class=\"col-12 col-sm-8 col-lg-6\">\n <input\n type=\"text\"\n id=\"value\"\n formControlName=\"value\"\n class=\"form-control\"\n placeholder=\"Choice field value\"\n [ngClass]=\"{\n 'is-valid': formControls.value.touched && formControls.value.valid,\n 'is-invalid': formControls.value.touched && formControls.value.errors\n }\"\n required\n />\n <div\n *ngIf=\"formControls.value.touched && formControls.value.errors\"\n class=\"invalid-feedback\"\n >\n <div *ngIf=\"formControls.value.errors.required\">\n Choice field value is required\n </div>\n </div>\n </div>\n </div>\n\n <div class=\"form-group row\">\n <label class=\"col-12 col-sm-3 col-form-label text-sm-right\" for=\"sortOrder\"\n >Sequence</label\n >\n <div class=\"col-12 col-sm-8 col-lg-6\">\n <input\n type=\"number\"\n id=\"sortOrder\"\n formControlName=\"sortOrder\"\n class=\"form-control\"\n placeholder=\"Choice field value sequence\"\n [ngClass]=\"{\n 'is-valid': formControls.sortOrder.touched && formControls.sortOrder.valid,\n 'is-invalid': formControls.sortOrder.touched && formControls.sortOrder.errors\n }\"\n required\n />\n <div\n *ngIf=\"formControls.sortOrder.touched && formControls.sortOrder.errors\"\n class=\"invalid-feedback\"\n >\n <div *ngIf=\"formControls.sortOrder.errors.required\">\n Choice field value sequence is required\n </div>\n </div>\n </div>\n </div>\n\n <div class=\"form-group row\">\n <label class=\"col-12 col-sm-3 col-form-label text-sm-right\" for=\"deprecated\"\n >Deprecated</label\n >\n <div class=\"col-12 col-sm-8 col-lg-6\">\n <div class=\"switch-button switch-button-sm switch-button-success\">\n <input type=\"checkbox\" formControlName=\"deprecated\" id=\"deprecated\" /><span>\n <label for=\"deprecated\"></label\n ></span>\n </div>\n </div>\n </div>\n\n <div class=\"row pt-3 mt-1\">\n <div class=\"col-12 col-sm-6 text-left\">\n <a [routerLink]=\"'../'\" class=\"btn btn-space btn-default\">Back</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 Reset\n </button>\n <button class=\"btn btn-space btn-primary\" type=\"submit\" [disabled]=\"form.invalid\">\n Submit\n </button>\n </div>\n </div>\n </form>\n </div>\n </div>\n </valtimo-widget>\n </div>\n </div>\n</div>\n", styles: [""] }]
515
+ }], ctorParameters: function () { return [{ type: i1$1.Router }, { type: i1$1.ActivatedRoute }, { type: i2$1.FormBuilder }, { type: ChoiceFieldService }, { type: i4.AlertService }]; } });
516
+
517
+ /*
518
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
519
+ *
520
+ * Licensed under EUPL, Version 1.2 (the "License");
521
+ * you may not use this file except in compliance with the License.
522
+ * You may obtain a copy of the License at
523
+ *
524
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
525
+ *
526
+ * Unless required by applicable law or agreed to in writing, software
527
+ * distributed under the License is distributed on an "AS IS" basis,
528
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
529
+ * See the License for the specific language governing permissions and
530
+ * limitations under the License.
531
+ */
532
+ class ChoiceFieldValueDetailComponent {
533
+ constructor(router, route, formBuilder, service, alertService) {
534
+ this.router = router;
535
+ this.route = route;
536
+ this.formBuilder = formBuilder;
537
+ this.service = service;
538
+ this.alertService = alertService;
539
+ const snapshot = this.route.snapshot.paramMap;
540
+ this.choiceFieldValueId = snapshot.get('valueId');
541
+ }
542
+ ngOnInit() {
543
+ this.reset();
544
+ }
545
+ get formControls() {
546
+ return this.form.controls;
547
+ }
548
+ initData(choiceFieldValueId) {
549
+ this.service.getValue(choiceFieldValueId).subscribe(result => {
550
+ this.choiceField = result.choiceField;
551
+ this.choiceFieldValue = result;
552
+ this.setValues();
553
+ });
554
+ }
555
+ createFormGroup() {
556
+ return this.formBuilder.group({
557
+ id: new FormControl('', Validators.required),
558
+ name: new FormControl('', Validators.required),
559
+ value: new FormControl('', Validators.required),
560
+ sortOrder: new FormControl('', Validators.required),
561
+ deprecated: new FormControl('', Validators.required),
562
+ });
563
+ }
564
+ setValues() {
565
+ if (this.choiceField) {
566
+ // set form values
567
+ this.form.controls.id.setValue(this.choiceFieldValue.id);
568
+ this.form.controls.name.setValue(this.choiceFieldValue.name);
569
+ this.form.controls.value.setValue(this.choiceFieldValue.value);
570
+ this.form.controls.sortOrder.setValue(this.choiceFieldValue.sortOrder);
571
+ this.form.controls.deprecated.setValue(this.choiceFieldValue.deprecated);
572
+ }
573
+ }
574
+ reset() {
575
+ this.form = this.createFormGroup();
576
+ this.initData(this.choiceFieldValueId);
577
+ }
578
+ onSubmit() {
579
+ this.service.updateValue(this.form.value, this.choiceField.keyName).subscribe(() => {
580
+ this.reset();
581
+ this.alertService.success('Choice field value details have been updated');
582
+ });
583
+ }
584
+ }
585
+ ChoiceFieldValueDetailComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: ChoiceFieldValueDetailComponent, deps: [{ token: i1$1.Router }, { token: i1$1.ActivatedRoute }, { token: i2$1.FormBuilder }, { token: ChoiceFieldService }, { token: i4.AlertService }], target: i0.ɵɵFactoryTarget.Component });
586
+ ChoiceFieldValueDetailComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.9", type: ChoiceFieldValueDetailComponent, selector: "valtimo-choice-field-value-detail", ngImport: i0, template: "<!--\n ~ Copyright 2015-2020 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 *ngIf=\"choiceField\">\n <div>\n <div class=\"card-body bg-light\">\n <div class=\"row py-5\">\n <div class=\"col-12\">\n <div class=\"row mb-3\">\n <div class=\"col-12\">\n <strong>Choice field</strong>\n <hr />\n </div>\n </div>\n <div class=\"row mb-3\">\n <div class=\"col-12 col-sm-3 text-sm-right\"><strong>ID</strong></div>\n <div class=\"col-12 col-sm-8 col-lg-6\">{{ choiceField.id }}</div>\n </div>\n <div class=\"row mb-3\">\n <div class=\"col-12 col-sm-3 text-sm-right\"><strong>Key</strong></div>\n <div class=\"col-12 col-sm-8 col-lg-6\">{{ choiceField.keyName }}</div>\n </div>\n <div class=\"row mb-3\">\n <div class=\"col-12 col-sm-3 text-sm-right\"><strong>Title</strong></div>\n <div class=\"col-12 col-sm-8 col-lg-6\">{{ choiceField.title }}</div>\n </div>\n <div class=\"row mb-3\">\n <div class=\"col-12 pt-3\">\n <strong>Choice field value</strong>\n <hr />\n </div>\n </div>\n <div class=\"row\">\n <div class=\"col-12 col-sm-3 text-sm-right\"><strong>ID</strong></div>\n <div class=\"col-12 col-sm-8 col-lg-6\">{{ choiceFieldValue.id }}</div>\n </div>\n </div>\n </div>\n </div>\n\n <div class=\"bg-white p-5\">\n <form [formGroup]=\"form\" (ngSubmit)=\"onSubmit()\">\n <div class=\"form-group row\">\n <label class=\"col-12 col-sm-3 col-form-label text-sm-right\" for=\"name\">Key</label>\n <div class=\"col-12 col-sm-8 col-lg-6\">\n <input\n valtimoFieldAutoFocus\n type=\"text\"\n id=\"name\"\n formControlName=\"name\"\n class=\"form-control\"\n placeholder=\"Choice field value key\"\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 Choice field value key is required\n </div>\n </div>\n </div>\n </div>\n\n <div class=\"form-group row\">\n <label class=\"col-12 col-sm-3 col-form-label text-sm-right\" for=\"value\"\n >Value</label\n >\n <div class=\"col-12 col-sm-8 col-lg-6\">\n <input\n type=\"text\"\n id=\"value\"\n formControlName=\"value\"\n class=\"form-control\"\n placeholder=\"Choice field value\"\n [ngClass]=\"{\n 'is-valid': formControls.value.touched && formControls.value.valid,\n 'is-invalid': formControls.value.touched && formControls.value.errors\n }\"\n required\n />\n <div\n *ngIf=\"formControls.value.touched && formControls.value.errors\"\n class=\"invalid-feedback\"\n >\n <div *ngIf=\"formControls.value.errors.required\">\n Choice field value is required\n </div>\n </div>\n </div>\n </div>\n\n <div class=\"form-group row\">\n <label class=\"col-12 col-sm-3 col-form-label text-sm-right\" for=\"sortOrder\"\n >Sequence</label\n >\n <div class=\"col-12 col-sm-8 col-lg-6\">\n <input\n type=\"number\"\n id=\"sortOrder\"\n formControlName=\"sortOrder\"\n class=\"form-control\"\n placeholder=\"Choice field value sequence\"\n [ngClass]=\"{\n 'is-valid': formControls.sortOrder.touched && formControls.sortOrder.valid,\n 'is-invalid': formControls.sortOrder.touched && formControls.sortOrder.errors\n }\"\n required\n />\n <div\n *ngIf=\"formControls.sortOrder.touched && formControls.sortOrder.errors\"\n class=\"invalid-feedback\"\n >\n <div *ngIf=\"formControls.sortOrder.errors.required\">\n Choice field value sequence is required\n </div>\n </div>\n </div>\n </div>\n\n <div class=\"form-group row\">\n <label class=\"col-12 col-sm-3 col-form-label text-sm-right\" for=\"deprecated\"\n >Deprecated</label\n >\n <div class=\"col-12 col-sm-8 col-lg-6\">\n <div class=\"switch-button switch-button-sm switch-button-success\">\n <input type=\"checkbox\" formControlName=\"deprecated\" id=\"deprecated\" /><span>\n <label for=\"deprecated\"></label\n ></span>\n </div>\n </div>\n </div>\n\n <div class=\"row pt-3 mt-1\">\n <div class=\"col-12 col-sm-6 text-left\">\n <a [routerLink]=\"'../../'\" class=\"btn btn-space btn-default\">Back</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 Reset\n </button>\n <button class=\"btn btn-space btn-primary\" type=\"submit\" [disabled]=\"form.invalid\">\n Submit\n </button>\n </div>\n </div>\n </form>\n </div>\n </div>\n </valtimo-widget>\n </div>\n </div>\n</div>\n", styles: [""], components: [{ type: i4.WidgetComponent, selector: "valtimo-widget", inputs: ["type", "name", "icon", "contrast", "divider", "title", "subtitle", "collapseAble", "collapse", "additionalClasses"] }], directives: [{ type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i2$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i2$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i2$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i4.FieldAutoFocusDirective, selector: "[valtimoFieldAutoFocus]" }, { type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i2$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { type: i2$1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { type: i5.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i2$1.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { type: i2$1.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { type: i1$1.RouterLinkWithHref, selector: "a[routerLink],area[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "preserveFragment", "skipLocationChange", "replaceUrl", "state", "relativeTo", "routerLink"] }] });
587
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: ChoiceFieldValueDetailComponent, decorators: [{
588
+ type: Component,
589
+ args: [{ selector: 'valtimo-choice-field-value-detail', template: "<!--\n ~ Copyright 2015-2020 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 *ngIf=\"choiceField\">\n <div>\n <div class=\"card-body bg-light\">\n <div class=\"row py-5\">\n <div class=\"col-12\">\n <div class=\"row mb-3\">\n <div class=\"col-12\">\n <strong>Choice field</strong>\n <hr />\n </div>\n </div>\n <div class=\"row mb-3\">\n <div class=\"col-12 col-sm-3 text-sm-right\"><strong>ID</strong></div>\n <div class=\"col-12 col-sm-8 col-lg-6\">{{ choiceField.id }}</div>\n </div>\n <div class=\"row mb-3\">\n <div class=\"col-12 col-sm-3 text-sm-right\"><strong>Key</strong></div>\n <div class=\"col-12 col-sm-8 col-lg-6\">{{ choiceField.keyName }}</div>\n </div>\n <div class=\"row mb-3\">\n <div class=\"col-12 col-sm-3 text-sm-right\"><strong>Title</strong></div>\n <div class=\"col-12 col-sm-8 col-lg-6\">{{ choiceField.title }}</div>\n </div>\n <div class=\"row mb-3\">\n <div class=\"col-12 pt-3\">\n <strong>Choice field value</strong>\n <hr />\n </div>\n </div>\n <div class=\"row\">\n <div class=\"col-12 col-sm-3 text-sm-right\"><strong>ID</strong></div>\n <div class=\"col-12 col-sm-8 col-lg-6\">{{ choiceFieldValue.id }}</div>\n </div>\n </div>\n </div>\n </div>\n\n <div class=\"bg-white p-5\">\n <form [formGroup]=\"form\" (ngSubmit)=\"onSubmit()\">\n <div class=\"form-group row\">\n <label class=\"col-12 col-sm-3 col-form-label text-sm-right\" for=\"name\">Key</label>\n <div class=\"col-12 col-sm-8 col-lg-6\">\n <input\n valtimoFieldAutoFocus\n type=\"text\"\n id=\"name\"\n formControlName=\"name\"\n class=\"form-control\"\n placeholder=\"Choice field value key\"\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 Choice field value key is required\n </div>\n </div>\n </div>\n </div>\n\n <div class=\"form-group row\">\n <label class=\"col-12 col-sm-3 col-form-label text-sm-right\" for=\"value\"\n >Value</label\n >\n <div class=\"col-12 col-sm-8 col-lg-6\">\n <input\n type=\"text\"\n id=\"value\"\n formControlName=\"value\"\n class=\"form-control\"\n placeholder=\"Choice field value\"\n [ngClass]=\"{\n 'is-valid': formControls.value.touched && formControls.value.valid,\n 'is-invalid': formControls.value.touched && formControls.value.errors\n }\"\n required\n />\n <div\n *ngIf=\"formControls.value.touched && formControls.value.errors\"\n class=\"invalid-feedback\"\n >\n <div *ngIf=\"formControls.value.errors.required\">\n Choice field value is required\n </div>\n </div>\n </div>\n </div>\n\n <div class=\"form-group row\">\n <label class=\"col-12 col-sm-3 col-form-label text-sm-right\" for=\"sortOrder\"\n >Sequence</label\n >\n <div class=\"col-12 col-sm-8 col-lg-6\">\n <input\n type=\"number\"\n id=\"sortOrder\"\n formControlName=\"sortOrder\"\n class=\"form-control\"\n placeholder=\"Choice field value sequence\"\n [ngClass]=\"{\n 'is-valid': formControls.sortOrder.touched && formControls.sortOrder.valid,\n 'is-invalid': formControls.sortOrder.touched && formControls.sortOrder.errors\n }\"\n required\n />\n <div\n *ngIf=\"formControls.sortOrder.touched && formControls.sortOrder.errors\"\n class=\"invalid-feedback\"\n >\n <div *ngIf=\"formControls.sortOrder.errors.required\">\n Choice field value sequence is required\n </div>\n </div>\n </div>\n </div>\n\n <div class=\"form-group row\">\n <label class=\"col-12 col-sm-3 col-form-label text-sm-right\" for=\"deprecated\"\n >Deprecated</label\n >\n <div class=\"col-12 col-sm-8 col-lg-6\">\n <div class=\"switch-button switch-button-sm switch-button-success\">\n <input type=\"checkbox\" formControlName=\"deprecated\" id=\"deprecated\" /><span>\n <label for=\"deprecated\"></label\n ></span>\n </div>\n </div>\n </div>\n\n <div class=\"row pt-3 mt-1\">\n <div class=\"col-12 col-sm-6 text-left\">\n <a [routerLink]=\"'../../'\" class=\"btn btn-space btn-default\">Back</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 Reset\n </button>\n <button class=\"btn btn-space btn-primary\" type=\"submit\" [disabled]=\"form.invalid\">\n Submit\n </button>\n </div>\n </div>\n </form>\n </div>\n </div>\n </valtimo-widget>\n </div>\n </div>\n</div>\n", styles: [""] }]
590
+ }], ctorParameters: function () { return [{ type: i1$1.Router }, { type: i1$1.ActivatedRoute }, { type: i2$1.FormBuilder }, { type: ChoiceFieldService }, { type: i4.AlertService }]; } });
591
+
592
+ /*
593
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
594
+ *
595
+ * Licensed under EUPL, Version 1.2 (the "License");
596
+ * you may not use this file except in compliance with the License.
597
+ * You may obtain a copy of the License at
598
+ *
599
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
600
+ *
601
+ * Unless required by applicable law or agreed to in writing, software
602
+ * distributed under the License is distributed on an "AS IS" basis,
603
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
604
+ * See the License for the specific language governing permissions and
605
+ * limitations under the License.
606
+ */
607
+ const routes = [
608
+ {
609
+ path: 'choice-fields',
610
+ data: {
611
+ title: 'Choice fields',
612
+ roles: [ROLE_ADMIN],
613
+ },
614
+ component: ChoiceFieldListComponent,
615
+ canActivate: [AuthGuardService],
616
+ },
617
+ {
618
+ path: 'choice-fields/field/:id',
619
+ data: {
620
+ title: 'Choice field details',
621
+ roles: [ROLE_ADMIN],
622
+ },
623
+ component: ChoiceFieldDetailComponent,
624
+ canActivate: [AuthGuardService],
625
+ },
626
+ {
627
+ path: 'choice-fields/create',
628
+ data: {
629
+ title: 'Create new Choice field',
630
+ roles: [ROLE_ADMIN],
631
+ },
632
+ component: ChoiceFieldCreateComponent,
633
+ canActivate: [AuthGuardService],
634
+ },
635
+ {
636
+ path: 'choice-fields/field/:id/create-value',
637
+ data: {
638
+ title: 'Create new Choice field value',
639
+ roles: [ROLE_ADMIN],
640
+ },
641
+ component: ChoiceFieldValueCreateComponent,
642
+ canActivate: [AuthGuardService],
643
+ },
644
+ {
645
+ path: 'choice-fields/field/:id/value/:valueId',
646
+ data: {
647
+ title: 'Choice field value details',
648
+ roles: [ROLE_ADMIN],
649
+ },
650
+ component: ChoiceFieldValueDetailComponent,
651
+ canActivate: [AuthGuardService],
652
+ },
653
+ ];
654
+ class ChoiceFieldRoutingModule {
655
+ }
656
+ ChoiceFieldRoutingModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: ChoiceFieldRoutingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
657
+ ChoiceFieldRoutingModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: ChoiceFieldRoutingModule, imports: [CommonModule, i1$1.RouterModule], exports: [RouterModule] });
658
+ ChoiceFieldRoutingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: ChoiceFieldRoutingModule, imports: [[CommonModule, RouterModule.forChild(routes)], RouterModule] });
659
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: ChoiceFieldRoutingModule, decorators: [{
660
+ type: NgModule,
661
+ args: [{
662
+ imports: [CommonModule, RouterModule.forChild(routes)],
663
+ exports: [RouterModule],
664
+ }]
665
+ }] });
666
+
667
+ /*
668
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
669
+ *
670
+ * Licensed under EUPL, Version 1.2 (the "License");
671
+ * you may not use this file except in compliance with the License.
672
+ * You may obtain a copy of the License at
673
+ *
674
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
675
+ *
676
+ * Unless required by applicable law or agreed to in writing, software
677
+ * distributed under the License is distributed on an "AS IS" basis,
678
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
679
+ * See the License for the specific language governing permissions and
680
+ * limitations under the License.
681
+ */
682
+ class ChoiceFieldModule {
683
+ }
684
+ ChoiceFieldModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: ChoiceFieldModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
685
+ ChoiceFieldModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: ChoiceFieldModule, declarations: [ChoiceFieldListComponent,
686
+ ChoiceFieldDetailComponent,
687
+ ChoiceFieldCreateComponent,
688
+ ChoiceFieldValueListComponent,
689
+ ChoiceFieldValueCreateComponent,
690
+ ChoiceFieldValueDetailComponent], imports: [CommonModule,
691
+ ListModule,
692
+ WidgetModule,
693
+ FieldAutoFocusModule,
694
+ FormsModule,
695
+ ReactiveFormsModule,
696
+ ChoiceFieldRoutingModule,
697
+ AlertModule,
698
+ TranslateModule] });
699
+ ChoiceFieldModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: ChoiceFieldModule, imports: [[
700
+ CommonModule,
701
+ ListModule,
702
+ WidgetModule,
703
+ FieldAutoFocusModule,
704
+ FormsModule,
705
+ ReactiveFormsModule,
706
+ ChoiceFieldRoutingModule,
707
+ AlertModule,
708
+ TranslateModule,
709
+ ]] });
710
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: ChoiceFieldModule, decorators: [{
711
+ type: NgModule,
712
+ args: [{
713
+ declarations: [
714
+ ChoiceFieldListComponent,
715
+ ChoiceFieldDetailComponent,
716
+ ChoiceFieldCreateComponent,
717
+ ChoiceFieldValueListComponent,
718
+ ChoiceFieldValueCreateComponent,
719
+ ChoiceFieldValueDetailComponent,
720
+ ],
721
+ imports: [
722
+ CommonModule,
723
+ ListModule,
724
+ WidgetModule,
725
+ FieldAutoFocusModule,
726
+ FormsModule,
727
+ ReactiveFormsModule,
728
+ ChoiceFieldRoutingModule,
729
+ AlertModule,
730
+ TranslateModule,
731
+ ],
732
+ exports: [],
733
+ }]
734
+ }] });
735
+
736
+ /*
737
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
738
+ *
739
+ * Licensed under EUPL, Version 1.2 (the "License");
740
+ * you may not use this file except in compliance with the License.
741
+ * You may obtain a copy of the License at
742
+ *
743
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
744
+ *
745
+ * Unless required by applicable law or agreed to in writing, software
746
+ * distributed under the License is distributed on an "AS IS" basis,
747
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
748
+ * See the License for the specific language governing permissions and
749
+ * limitations under the License.
750
+ */
751
+
752
+ /**
753
+ * Generated bundle index. Do not edit.
754
+ */
755
+
756
+ export { ChoiceFieldModule, ChoiceFieldService };
757
+ //# sourceMappingURL=valtimo-choice-field.mjs.map