@valtimo/form 4.15.3-next-main.16 → 4.17.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.
@@ -6,203 +6,203 @@ import { RouterModule } from '@angular/router';
6
6
  import { FormIoModule } from '@valtimo/components';
7
7
  import { TranslateService } from '@ngx-translate/core';
8
8
 
9
- /*
10
- * Copyright 2015-2020 Ritense BV, the Netherlands.
11
- *
12
- * Licensed under EUPL, Version 1.2 (the "License");
13
- * you may not use this file except in compliance with the License.
14
- * You may obtain a copy of the License at
15
- *
16
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
17
- *
18
- * Unless required by applicable law or agreed to in writing, software
19
- * distributed under the License is distributed on an "AS IS" basis,
20
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21
- * See the License for the specific language governing permissions and
22
- * limitations under the License.
23
- */
24
- class FormService {
25
- constructor(configService, http) {
26
- this.configService = configService;
27
- this.http = http;
28
- this.valtimoApiConfig = configService.config.valtimoApi;
29
- }
30
- getFormDefinitionByName(formDefinitionName) {
31
- return this.http.get(`${this.valtimoApiConfig.endpointUri}form/${formDefinitionName}`);
32
- }
33
- getFormDefinitionByNamePreFilled(formDefinitionName, documentId) {
34
- return this.http.get(`${this.valtimoApiConfig.endpointUri}form-association/form-definition/${formDefinitionName}?documentId=${documentId}`);
35
- }
36
- }
37
- FormService.ɵprov = ɵɵdefineInjectable({ factory: function FormService_Factory() { return new FormService(ɵɵinject(ConfigService), ɵɵinject(HttpClient)); }, token: FormService, providedIn: "root" });
38
- FormService.decorators = [
39
- { type: Injectable, args: [{
40
- providedIn: 'root',
41
- },] }
42
- ];
43
- FormService.ctorParameters = () => [
44
- { type: ConfigService },
45
- { type: HttpClient }
9
+ /*
10
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
11
+ *
12
+ * Licensed under EUPL, Version 1.2 (the "License");
13
+ * you may not use this file except in compliance with the License.
14
+ * You may obtain a copy of the License at
15
+ *
16
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
17
+ *
18
+ * Unless required by applicable law or agreed to in writing, software
19
+ * distributed under the License is distributed on an "AS IS" basis,
20
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21
+ * See the License for the specific language governing permissions and
22
+ * limitations under the License.
23
+ */
24
+ class FormService {
25
+ constructor(configService, http) {
26
+ this.configService = configService;
27
+ this.http = http;
28
+ this.valtimoApiConfig = configService.config.valtimoApi;
29
+ }
30
+ getFormDefinitionByName(formDefinitionName) {
31
+ return this.http.get(`${this.valtimoApiConfig.endpointUri}form/${formDefinitionName}`);
32
+ }
33
+ getFormDefinitionByNamePreFilled(formDefinitionName, documentId) {
34
+ return this.http.get(`${this.valtimoApiConfig.endpointUri}form-association/form-definition/${formDefinitionName}?documentId=${documentId}`);
35
+ }
36
+ }
37
+ FormService.ɵprov = ɵɵdefineInjectable({ factory: function FormService_Factory() { return new FormService(ɵɵinject(ConfigService), ɵɵinject(HttpClient)); }, token: FormService, providedIn: "root" });
38
+ FormService.decorators = [
39
+ { type: Injectable, args: [{
40
+ providedIn: 'root',
41
+ },] }
42
+ ];
43
+ FormService.ctorParameters = () => [
44
+ { type: ConfigService },
45
+ { type: HttpClient }
46
46
  ];
47
47
 
48
- /*
49
- * Copyright 2015-2020 Ritense BV, the Netherlands.
50
- *
51
- * Licensed under EUPL, Version 1.2 (the "License");
52
- * you may not use this file except in compliance with the License.
53
- * You may obtain a copy of the License at
54
- *
55
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
56
- *
57
- * Unless required by applicable law or agreed to in writing, software
58
- * distributed under the License is distributed on an "AS IS" basis,
59
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
60
- * See the License for the specific language governing permissions and
61
- * limitations under the License.
62
- */
63
- const routes = [];
64
- class FormRoutingModule {
65
- }
66
- FormRoutingModule.decorators = [
67
- { type: NgModule, args: [{
68
- declarations: [],
69
- imports: [CommonModule, RouterModule.forChild(routes)],
70
- exports: [RouterModule],
71
- },] }
48
+ /*
49
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
50
+ *
51
+ * Licensed under EUPL, Version 1.2 (the "License");
52
+ * you may not use this file except in compliance with the License.
53
+ * You may obtain a copy of the License at
54
+ *
55
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
56
+ *
57
+ * Unless required by applicable law or agreed to in writing, software
58
+ * distributed under the License is distributed on an "AS IS" basis,
59
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
60
+ * See the License for the specific language governing permissions and
61
+ * limitations under the License.
62
+ */
63
+ const routes = [];
64
+ class FormRoutingModule {
65
+ }
66
+ FormRoutingModule.decorators = [
67
+ { type: NgModule, args: [{
68
+ declarations: [],
69
+ imports: [CommonModule, RouterModule.forChild(routes)],
70
+ exports: [RouterModule],
71
+ },] }
72
72
  ];
73
73
 
74
- /*
75
- * Copyright 2015-2020 Ritense BV, the Netherlands.
76
- *
77
- * Licensed under EUPL, Version 1.2 (the "License");
78
- * you may not use this file except in compliance with the License.
79
- * You may obtain a copy of the License at
80
- *
81
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
82
- *
83
- * Unless required by applicable law or agreed to in writing, software
84
- * distributed under the License is distributed on an "AS IS" basis,
85
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
86
- * See the License for the specific language governing permissions and
87
- * limitations under the License.
88
- */
89
- class FormModule {
90
- }
91
- FormModule.decorators = [
92
- { type: NgModule, args: [{
93
- imports: [CommonModule, FormRoutingModule, FormIoModule],
94
- exports: [],
95
- },] }
74
+ /*
75
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
76
+ *
77
+ * Licensed under EUPL, Version 1.2 (the "License");
78
+ * you may not use this file except in compliance with the License.
79
+ * You may obtain a copy of the License at
80
+ *
81
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
82
+ *
83
+ * Unless required by applicable law or agreed to in writing, software
84
+ * distributed under the License is distributed on an "AS IS" basis,
85
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
86
+ * See the License for the specific language governing permissions and
87
+ * limitations under the License.
88
+ */
89
+ class FormModule {
90
+ }
91
+ FormModule.decorators = [
92
+ { type: NgModule, args: [{
93
+ imports: [CommonModule, FormRoutingModule, FormIoModule],
94
+ exports: [],
95
+ },] }
96
96
  ];
97
97
 
98
- /*
99
- * Copyright 2015-2021 Ritense BV, the Netherlands.
100
- *
101
- * Licensed under EUPL, Version 1.2 (the "License");
102
- * you may not use this file except in compliance with the License.
103
- * You may obtain a copy of the License at
104
- *
105
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
106
- *
107
- * Unless required by applicable law or agreed to in writing, software
108
- * distributed under the License is distributed on an "AS IS" basis,
109
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
110
- * See the License for the specific language governing permissions and
111
- * limitations under the License.
112
- */
113
- class FormMappingService {
114
- mapComponents(form, mappingFunction) {
115
- var _a, _b;
116
- const recursiveMappingFunction = (component) => {
117
- const mappedComponent = mappingFunction(component);
118
- const innerComponents = component.components;
119
- if (innerComponents && innerComponents.length > 0) {
120
- return Object.assign(Object.assign({}, mappedComponent), { components: innerComponents.map((innerComponent) => recursiveMappingFunction(innerComponent)) });
121
- }
122
- return mappedComponent;
123
- };
124
- return Object.assign(Object.assign({}, form), (((_a = form === null || form === void 0 ? void 0 : form.components) === null || _a === void 0 ? void 0 : _a.length) > 0 && {
125
- components: (_b = form === null || form === void 0 ? void 0 : form.components) === null || _b === void 0 ? void 0 : _b.map(component => recursiveMappingFunction(component)),
126
- }));
127
- }
128
- }
129
- FormMappingService.ɵprov = ɵɵdefineInjectable({ factory: function FormMappingService_Factory() { return new FormMappingService(); }, token: FormMappingService, providedIn: "root" });
130
- FormMappingService.decorators = [
131
- { type: Injectable, args: [{
132
- providedIn: 'root',
133
- },] }
98
+ /*
99
+ * Copyright 2015-2021 Ritense BV, the Netherlands.
100
+ *
101
+ * Licensed under EUPL, Version 1.2 (the "License");
102
+ * you may not use this file except in compliance with the License.
103
+ * You may obtain a copy of the License at
104
+ *
105
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
106
+ *
107
+ * Unless required by applicable law or agreed to in writing, software
108
+ * distributed under the License is distributed on an "AS IS" basis,
109
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
110
+ * See the License for the specific language governing permissions and
111
+ * limitations under the License.
112
+ */
113
+ class FormMappingService {
114
+ mapComponents(form, mappingFunction) {
115
+ var _a, _b;
116
+ const recursiveMappingFunction = (component) => {
117
+ const mappedComponent = mappingFunction(component);
118
+ const innerComponents = component.components;
119
+ if (innerComponents && innerComponents.length > 0) {
120
+ return Object.assign(Object.assign({}, mappedComponent), { components: innerComponents.map((innerComponent) => recursiveMappingFunction(innerComponent)) });
121
+ }
122
+ return mappedComponent;
123
+ };
124
+ return Object.assign(Object.assign({}, form), (((_a = form === null || form === void 0 ? void 0 : form.components) === null || _a === void 0 ? void 0 : _a.length) > 0 && {
125
+ components: (_b = form === null || form === void 0 ? void 0 : form.components) === null || _b === void 0 ? void 0 : _b.map(component => recursiveMappingFunction(component)),
126
+ }));
127
+ }
128
+ }
129
+ FormMappingService.ɵprov = ɵɵdefineInjectable({ factory: function FormMappingService_Factory() { return new FormMappingService(); }, token: FormMappingService, providedIn: "root" });
130
+ FormMappingService.decorators = [
131
+ { type: Injectable, args: [{
132
+ providedIn: 'root',
133
+ },] }
134
134
  ];
135
135
 
136
- /*
137
- * Copyright 2015-2021 Ritense BV, the Netherlands.
138
- *
139
- * Licensed under EUPL, Version 1.2 (the "License");
140
- * you may not use this file except in compliance with the License.
141
- * You may obtain a copy of the License at
142
- *
143
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
144
- *
145
- * Unless required by applicable law or agreed to in writing, software
146
- * distributed under the License is distributed on an "AS IS" basis,
147
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
148
- * See the License for the specific language governing permissions and
149
- * limitations under the License.
150
- */
151
- class FormTranslationService {
152
- constructor(translateService, formMappingService) {
153
- this.translateService = translateService;
154
- this.formMappingService = formMappingService;
155
- }
156
- translateForm(form) {
157
- const translateFunction = (component) => {
158
- const labelTranslation = this.getTranslation(`${component.label}`);
159
- const titleTranslation = this.getTranslation(`${component.title}`);
160
- const contentTranslation = this.getTranslation(`${component.content}`);
161
- const placeholderTranslation = this.getTranslation(`${component.placeholder}`);
162
- const tooltipTranslation = this.getTranslation(`${component.tooltip}`);
163
- return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, component), (labelTranslation && { label: `${labelTranslation}` })), (titleTranslation && { title: `${titleTranslation}` })), (contentTranslation && { content: `${contentTranslation}` })), (placeholderTranslation && { placeholder: `${placeholderTranslation}` })), (tooltipTranslation && { tooltip: `${tooltipTranslation}` }));
164
- };
165
- return this.formMappingService.mapComponents(form, translateFunction);
166
- }
167
- getTranslation(translationKey) {
168
- const translation = this.translateService.instant(translationKey);
169
- if (translation !== translationKey) {
170
- return translation;
171
- }
172
- else {
173
- return false;
174
- }
175
- }
176
- }
177
- FormTranslationService.ɵprov = ɵɵdefineInjectable({ factory: function FormTranslationService_Factory() { return new FormTranslationService(ɵɵinject(TranslateService), ɵɵinject(FormMappingService)); }, token: FormTranslationService, providedIn: "root" });
178
- FormTranslationService.decorators = [
179
- { type: Injectable, args: [{
180
- providedIn: 'root',
181
- },] }
182
- ];
183
- FormTranslationService.ctorParameters = () => [
184
- { type: TranslateService },
185
- { type: FormMappingService }
136
+ /*
137
+ * Copyright 2015-2021 Ritense BV, the Netherlands.
138
+ *
139
+ * Licensed under EUPL, Version 1.2 (the "License");
140
+ * you may not use this file except in compliance with the License.
141
+ * You may obtain a copy of the License at
142
+ *
143
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
144
+ *
145
+ * Unless required by applicable law or agreed to in writing, software
146
+ * distributed under the License is distributed on an "AS IS" basis,
147
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
148
+ * See the License for the specific language governing permissions and
149
+ * limitations under the License.
150
+ */
151
+ class FormTranslationService {
152
+ constructor(translateService, formMappingService) {
153
+ this.translateService = translateService;
154
+ this.formMappingService = formMappingService;
155
+ }
156
+ translateForm(form) {
157
+ const translateFunction = (component) => {
158
+ const labelTranslation = this.getTranslation(`${component.label}`);
159
+ const titleTranslation = this.getTranslation(`${component.title}`);
160
+ const contentTranslation = this.getTranslation(`${component.content}`);
161
+ const placeholderTranslation = this.getTranslation(`${component.placeholder}`);
162
+ const tooltipTranslation = this.getTranslation(`${component.tooltip}`);
163
+ return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, component), (labelTranslation && { label: `${labelTranslation}` })), (titleTranslation && { title: `${titleTranslation}` })), (contentTranslation && { content: `${contentTranslation}` })), (placeholderTranslation && { placeholder: `${placeholderTranslation}` })), (tooltipTranslation && { tooltip: `${tooltipTranslation}` }));
164
+ };
165
+ return this.formMappingService.mapComponents(form, translateFunction);
166
+ }
167
+ getTranslation(translationKey) {
168
+ const translation = this.translateService.instant(translationKey);
169
+ if (translation !== translationKey) {
170
+ return translation;
171
+ }
172
+ else {
173
+ return false;
174
+ }
175
+ }
176
+ }
177
+ FormTranslationService.ɵprov = ɵɵdefineInjectable({ factory: function FormTranslationService_Factory() { return new FormTranslationService(ɵɵinject(TranslateService), ɵɵinject(FormMappingService)); }, token: FormTranslationService, providedIn: "root" });
178
+ FormTranslationService.decorators = [
179
+ { type: Injectable, args: [{
180
+ providedIn: 'root',
181
+ },] }
182
+ ];
183
+ FormTranslationService.ctorParameters = () => [
184
+ { type: TranslateService },
185
+ { type: FormMappingService }
186
186
  ];
187
187
 
188
- /*
189
- * Copyright 2015-2020 Ritense BV, the Netherlands.
190
- *
191
- * Licensed under EUPL, Version 1.2 (the "License");
192
- * you may not use this file except in compliance with the License.
193
- * You may obtain a copy of the License at
194
- *
195
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
196
- *
197
- * Unless required by applicable law or agreed to in writing, software
198
- * distributed under the License is distributed on an "AS IS" basis,
199
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
- * See the License for the specific language governing permissions and
201
- * limitations under the License.
188
+ /*
189
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
190
+ *
191
+ * Licensed under EUPL, Version 1.2 (the "License");
192
+ * you may not use this file except in compliance with the License.
193
+ * You may obtain a copy of the License at
194
+ *
195
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
196
+ *
197
+ * Unless required by applicable law or agreed to in writing, software
198
+ * distributed under the License is distributed on an "AS IS" basis,
199
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ * See the License for the specific language governing permissions and
201
+ * limitations under the License.
202
202
  */
203
203
 
204
- /**
205
- * Generated bundle index. Do not edit.
204
+ /**
205
+ * Generated bundle index. Do not edit.
206
206
  */
207
207
 
208
208
  export { FormMappingService, FormModule, FormService, FormTranslationService, FormRoutingModule as ɵa };
@@ -1,2 +1,2 @@
1
- export declare class FormRoutingModule {
2
- }
1
+ export declare class FormRoutingModule {
2
+ }
@@ -1,2 +1,2 @@
1
- export declare class FormModule {
2
- }
1
+ export declare class FormModule {
2
+ }
@@ -1,12 +1,12 @@
1
- import { HttpClient } from '@angular/common/http';
2
- import { Observable } from 'rxjs';
3
- import { FormioForm } from 'angular-formio';
4
- import { ConfigService } from '@valtimo/config';
5
- export declare class FormService {
6
- private configService;
7
- private http;
8
- private valtimoApiConfig;
9
- constructor(configService: ConfigService, http: HttpClient);
10
- getFormDefinitionByName(formDefinitionName: string): Observable<FormioForm>;
11
- getFormDefinitionByNamePreFilled(formDefinitionName: string, documentId: string): Observable<FormioForm>;
12
- }
1
+ import { HttpClient } from '@angular/common/http';
2
+ import { Observable } from 'rxjs';
3
+ import { FormioForm } from 'angular-formio';
4
+ import { ConfigService } from '@valtimo/config';
5
+ export declare class FormService {
6
+ private configService;
7
+ private http;
8
+ private valtimoApiConfig;
9
+ constructor(configService: ConfigService, http: HttpClient);
10
+ getFormDefinitionByName(formDefinitionName: string): Observable<FormioForm>;
11
+ getFormDefinitionByNamePreFilled(formDefinitionName: string, documentId: string): Observable<FormioForm>;
12
+ }
@@ -1,5 +1,5 @@
1
- import { FormioForm } from 'angular-formio';
2
- import { ExtendedComponentSchema } from 'formiojs';
3
- export declare class FormMappingService {
4
- mapComponents(form: FormioForm, mappingFunction: (component: ExtendedComponentSchema) => ExtendedComponentSchema): FormioForm;
5
- }
1
+ import { FormioForm } from 'angular-formio';
2
+ import { ExtendedComponentSchema } from 'formiojs';
3
+ export declare class FormMappingService {
4
+ mapComponents(form: FormioForm, mappingFunction: (component: ExtendedComponentSchema) => ExtendedComponentSchema): FormioForm;
5
+ }
@@ -1,10 +1,10 @@
1
- import { TranslateService } from '@ngx-translate/core';
2
- import { FormioForm } from 'angular-formio';
3
- import { FormMappingService } from '../form-mapping/form-mapping.service';
4
- export declare class FormTranslationService {
5
- private readonly translateService;
6
- private readonly formMappingService;
7
- constructor(translateService: TranslateService, formMappingService: FormMappingService);
8
- translateForm(form: FormioForm): FormioForm;
9
- private getTranslation;
10
- }
1
+ import { TranslateService } from '@ngx-translate/core';
2
+ import { FormioForm } from 'angular-formio';
3
+ import { FormMappingService } from '../form-mapping/form-mapping.service';
4
+ export declare class FormTranslationService {
5
+ private readonly translateService;
6
+ private readonly formMappingService;
7
+ constructor(translateService: TranslateService, formMappingService: FormMappingService);
8
+ translateForm(form: FormioForm): FormioForm;
9
+ private getTranslation;
10
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@valtimo/form",
3
3
  "license": "EUPL-1.2",
4
- "version": "4.15.3-next-main.16",
4
+ "version": "4.17.0",
5
5
  "peerDependencies": {
6
6
  "@angular/common": "^10.0.11",
7
7
  "@angular/core": "^10.0.11"
package/public_api.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export * from './lib/form.service';
2
- export * from './lib/form.module';
3
- export * from './lib/services/form-mapping/form-mapping.service';
4
- export * from './lib/services/form-translation/form-translation.service';
1
+ export * from './lib/form.service';
2
+ export * from './lib/form.module';
3
+ export * from './lib/services/form-mapping/form-mapping.service';
4
+ export * from './lib/services/form-translation/form-translation.service';
package/valtimo-form.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- /**
2
- * Generated bundle index. Do not edit.
3
- */
4
- export * from './public_api';
5
- export { FormRoutingModule as ɵa } from './lib/form-routing.module';
1
+ /**
2
+ * Generated bundle index. Do not edit.
3
+ */
4
+ export * from './public_api';
5
+ export { FormRoutingModule as ɵa } from './lib/form-routing.module';