@valtimo/form 4.15.3-next-main.14 → 4.15.3-next-main.15

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,204 +6,204 @@ 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: [
70
- CommonModule,
71
- RouterModule.forChild(routes),
72
- ],
73
- exports: [RouterModule]
74
- },] }
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: [
70
+ CommonModule,
71
+ RouterModule.forChild(routes),
72
+ ],
73
+ exports: [RouterModule]
74
+ },] }
75
75
  ];
76
76
 
77
- /*
78
- * Copyright 2015-2020 Ritense BV, the Netherlands.
79
- *
80
- * Licensed under EUPL, Version 1.2 (the "License");
81
- * you may not use this file except in compliance with the License.
82
- * You may obtain a copy of the License at
83
- *
84
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
85
- *
86
- * Unless required by applicable law or agreed to in writing, software
87
- * distributed under the License is distributed on an "AS IS" basis,
88
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
89
- * See the License for the specific language governing permissions and
90
- * limitations under the License.
91
- */
92
- class FormModule {
93
- }
94
- FormModule.decorators = [
95
- { type: NgModule, args: [{
96
- imports: [CommonModule, FormRoutingModule, FormIoModule],
97
- exports: []
98
- },] }
77
+ /*
78
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
79
+ *
80
+ * Licensed under EUPL, Version 1.2 (the "License");
81
+ * you may not use this file except in compliance with the License.
82
+ * You may obtain a copy of the License at
83
+ *
84
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
85
+ *
86
+ * Unless required by applicable law or agreed to in writing, software
87
+ * distributed under the License is distributed on an "AS IS" basis,
88
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
89
+ * See the License for the specific language governing permissions and
90
+ * limitations under the License.
91
+ */
92
+ class FormModule {
93
+ }
94
+ FormModule.decorators = [
95
+ { type: NgModule, args: [{
96
+ imports: [CommonModule, FormRoutingModule, FormIoModule],
97
+ exports: []
98
+ },] }
99
99
  ];
100
100
 
101
- /*
102
- * Copyright 2015-2021 Ritense BV, the Netherlands.
103
- *
104
- * Licensed under EUPL, Version 1.2 (the "License");
105
- * you may not use this file except in compliance with the License.
106
- * You may obtain a copy of the License at
107
- *
108
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
109
- *
110
- * Unless required by applicable law or agreed to in writing, software
111
- * distributed under the License is distributed on an "AS IS" basis,
112
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
113
- * See the License for the specific language governing permissions and
114
- * limitations under the License.
115
- */
116
- class FormMappingService {
117
- mapComponents(form, mappingFunction) {
118
- var _a, _b;
119
- const recursiveMappingFunction = (component) => {
120
- const mappedComponent = mappingFunction(component);
121
- const innerComponents = component.components;
122
- if (innerComponents && innerComponents.length > 0) {
123
- return Object.assign(Object.assign({}, mappedComponent), { components: innerComponents.map((innerComponent) => recursiveMappingFunction(innerComponent)) });
124
- }
125
- return mappedComponent;
126
- };
127
- 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 && { components: (_b = form === null || form === void 0 ? void 0 : form.components) === null || _b === void 0 ? void 0 : _b.map((component) => recursiveMappingFunction(component)) }));
128
- }
129
- }
130
- FormMappingService.ɵprov = ɵɵdefineInjectable({ factory: function FormMappingService_Factory() { return new FormMappingService(); }, token: FormMappingService, providedIn: "root" });
131
- FormMappingService.decorators = [
132
- { type: Injectable, args: [{
133
- providedIn: 'root'
134
- },] }
101
+ /*
102
+ * Copyright 2015-2021 Ritense BV, the Netherlands.
103
+ *
104
+ * Licensed under EUPL, Version 1.2 (the "License");
105
+ * you may not use this file except in compliance with the License.
106
+ * You may obtain a copy of the License at
107
+ *
108
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
109
+ *
110
+ * Unless required by applicable law or agreed to in writing, software
111
+ * distributed under the License is distributed on an "AS IS" basis,
112
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
113
+ * See the License for the specific language governing permissions and
114
+ * limitations under the License.
115
+ */
116
+ class FormMappingService {
117
+ mapComponents(form, mappingFunction) {
118
+ var _a, _b;
119
+ const recursiveMappingFunction = (component) => {
120
+ const mappedComponent = mappingFunction(component);
121
+ const innerComponents = component.components;
122
+ if (innerComponents && innerComponents.length > 0) {
123
+ return Object.assign(Object.assign({}, mappedComponent), { components: innerComponents.map((innerComponent) => recursiveMappingFunction(innerComponent)) });
124
+ }
125
+ return mappedComponent;
126
+ };
127
+ 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 && { components: (_b = form === null || form === void 0 ? void 0 : form.components) === null || _b === void 0 ? void 0 : _b.map((component) => recursiveMappingFunction(component)) }));
128
+ }
129
+ }
130
+ FormMappingService.ɵprov = ɵɵdefineInjectable({ factory: function FormMappingService_Factory() { return new FormMappingService(); }, token: FormMappingService, providedIn: "root" });
131
+ FormMappingService.decorators = [
132
+ { type: Injectable, args: [{
133
+ providedIn: 'root'
134
+ },] }
135
135
  ];
136
136
 
137
- /*
138
- * Copyright 2015-2021 Ritense BV, the Netherlands.
139
- *
140
- * Licensed under EUPL, Version 1.2 (the "License");
141
- * you may not use this file except in compliance with the License.
142
- * You may obtain a copy of the License at
143
- *
144
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
145
- *
146
- * Unless required by applicable law or agreed to in writing, software
147
- * distributed under the License is distributed on an "AS IS" basis,
148
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
149
- * See the License for the specific language governing permissions and
150
- * limitations under the License.
151
- */
152
- class FormTranslationService {
153
- constructor(translateService, formMappingService) {
154
- this.translateService = translateService;
155
- this.formMappingService = formMappingService;
156
- }
157
- translateForm(form) {
158
- const translateFunction = (component) => {
159
- const labelTranslation = this.getTranslation(`${component.label}`);
160
- const titleTranslation = this.getTranslation(`${component.title}`);
161
- const contentTranslation = this.getTranslation(`${component.content}`);
162
- const placeholderTranslation = this.getTranslation(`${component.placeholder}`);
163
- const tooltipTranslation = this.getTranslation(`${component.tooltip}`);
164
- 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}` }));
165
- };
166
- return this.formMappingService.mapComponents(form, translateFunction);
167
- }
168
- getTranslation(translationKey) {
169
- const translation = this.translateService.instant(translationKey);
170
- if (translation !== translationKey) {
171
- return translation;
172
- }
173
- else {
174
- return false;
175
- }
176
- }
177
- }
178
- FormTranslationService.ɵprov = ɵɵdefineInjectable({ factory: function FormTranslationService_Factory() { return new FormTranslationService(ɵɵinject(TranslateService), ɵɵinject(FormMappingService)); }, token: FormTranslationService, providedIn: "root" });
179
- FormTranslationService.decorators = [
180
- { type: Injectable, args: [{
181
- providedIn: 'root'
182
- },] }
183
- ];
184
- FormTranslationService.ctorParameters = () => [
185
- { type: TranslateService },
186
- { type: FormMappingService }
137
+ /*
138
+ * Copyright 2015-2021 Ritense BV, the Netherlands.
139
+ *
140
+ * Licensed under EUPL, Version 1.2 (the "License");
141
+ * you may not use this file except in compliance with the License.
142
+ * You may obtain a copy of the License at
143
+ *
144
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
145
+ *
146
+ * Unless required by applicable law or agreed to in writing, software
147
+ * distributed under the License is distributed on an "AS IS" basis,
148
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
149
+ * See the License for the specific language governing permissions and
150
+ * limitations under the License.
151
+ */
152
+ class FormTranslationService {
153
+ constructor(translateService, formMappingService) {
154
+ this.translateService = translateService;
155
+ this.formMappingService = formMappingService;
156
+ }
157
+ translateForm(form) {
158
+ const translateFunction = (component) => {
159
+ const labelTranslation = this.getTranslation(`${component.label}`);
160
+ const titleTranslation = this.getTranslation(`${component.title}`);
161
+ const contentTranslation = this.getTranslation(`${component.content}`);
162
+ const placeholderTranslation = this.getTranslation(`${component.placeholder}`);
163
+ const tooltipTranslation = this.getTranslation(`${component.tooltip}`);
164
+ 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}` }));
165
+ };
166
+ return this.formMappingService.mapComponents(form, translateFunction);
167
+ }
168
+ getTranslation(translationKey) {
169
+ const translation = this.translateService.instant(translationKey);
170
+ if (translation !== translationKey) {
171
+ return translation;
172
+ }
173
+ else {
174
+ return false;
175
+ }
176
+ }
177
+ }
178
+ FormTranslationService.ɵprov = ɵɵdefineInjectable({ factory: function FormTranslationService_Factory() { return new FormTranslationService(ɵɵinject(TranslateService), ɵɵinject(FormMappingService)); }, token: FormTranslationService, providedIn: "root" });
179
+ FormTranslationService.decorators = [
180
+ { type: Injectable, args: [{
181
+ providedIn: 'root'
182
+ },] }
183
+ ];
184
+ FormTranslationService.ctorParameters = () => [
185
+ { type: TranslateService },
186
+ { type: FormMappingService }
187
187
  ];
188
188
 
189
- /*
190
- * Copyright 2015-2020 Ritense BV, the Netherlands.
191
- *
192
- * Licensed under EUPL, Version 1.2 (the "License");
193
- * you may not use this file except in compliance with the License.
194
- * You may obtain a copy of the License at
195
- *
196
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
197
- *
198
- * Unless required by applicable law or agreed to in writing, software
199
- * distributed under the License is distributed on an "AS IS" basis,
200
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
- * See the License for the specific language governing permissions and
202
- * limitations under the License.
189
+ /*
190
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
191
+ *
192
+ * Licensed under EUPL, Version 1.2 (the "License");
193
+ * you may not use this file except in compliance with the License.
194
+ * You may obtain a copy of the License at
195
+ *
196
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
197
+ *
198
+ * Unless required by applicable law or agreed to in writing, software
199
+ * distributed under the License is distributed on an "AS IS" basis,
200
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ * See the License for the specific language governing permissions and
202
+ * limitations under the License.
203
203
  */
204
204
 
205
- /**
206
- * Generated bundle index. Do not edit.
205
+ /**
206
+ * Generated bundle index. Do not edit.
207
207
  */
208
208
 
209
209
  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.14",
4
+ "version": "4.15.3-next-main.15",
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';