@formio/angular 6.0.0-rc.2 → 6.0.0-rc.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/auth/auth.service.d.ts.map +1 -1
- package/auth/login/login.component.d.ts +1 -0
- package/auth/login/login.component.d.ts.map +1 -1
- package/auth/register/register.component.d.ts +1 -0
- package/auth/register/register.component.d.ts.map +1 -1
- package/esm2022/FormioBaseComponent.mjs +3 -3
- package/esm2022/auth/auth.component.mjs +3 -3
- package/esm2022/auth/auth.config.mjs +3 -3
- package/esm2022/auth/auth.module.mjs +4 -4
- package/esm2022/auth/auth.service.mjs +12 -6
- package/esm2022/auth/login/login.component.mjs +8 -5
- package/esm2022/auth/register/register.component.mjs +8 -5
- package/esm2022/auth/resetpass/resetpass.component.mjs +3 -3
- package/esm2022/components/alerts/formio.alerts.component.mjs +3 -3
- package/esm2022/components/alerts/parse-html-content.pipe.mjs +3 -3
- package/esm2022/components/formbuilder/formbuilder.component.mjs +3 -3
- package/esm2022/components/formio/formio.component.mjs +3 -3
- package/esm2022/components/loader/formio.loader.component.mjs +3 -3
- package/esm2022/custom-component/custom-tags.service.mjs +3 -3
- package/esm2022/formio.config.mjs +3 -3
- package/esm2022/formio.module.mjs +4 -4
- package/esm2022/grid/GridBodyComponent.mjs +3 -3
- package/esm2022/grid/GridFooterComponent.mjs +3 -3
- package/esm2022/grid/GridHeaderComponent.mjs +3 -3
- package/esm2022/grid/form/FormGridBody.component.mjs +52 -8
- package/esm2022/grid/form/FormGridFooter.component.mjs +5 -5
- package/esm2022/grid/form/FormGridHeader.component.mjs +5 -5
- package/esm2022/grid/form/time-since.pipe.mjs +3 -3
- package/esm2022/grid/grid.component.mjs +3 -3
- package/esm2022/grid/grid.module.mjs +4 -4
- package/esm2022/grid/grid.service.mjs +3 -3
- package/esm2022/grid/submission/SubmissionGridBody.component.mjs +3 -3
- package/esm2022/grid/submission/SubmissionGridFooter.component.mjs +5 -5
- package/esm2022/grid/submission/SubmissionGridHeader.component.mjs +5 -5
- package/esm2022/manager/create/create.component.mjs +5 -5
- package/esm2022/manager/delete/delete.component.mjs +3 -3
- package/esm2022/manager/edit/edit.component.mjs +5 -5
- package/esm2022/manager/form/form.component.mjs +5 -5
- package/esm2022/manager/form-manager.config.mjs +3 -3
- package/esm2022/manager/form-manager.module.mjs +4 -4
- package/esm2022/manager/form-manager.service.mjs +3 -3
- package/esm2022/manager/index/index.component.mjs +25 -18
- package/esm2022/manager/submission/delete/delete.component.mjs +3 -3
- package/esm2022/manager/submission/edit/edit.component.mjs +3 -3
- package/esm2022/manager/submission/index/index.component.mjs +3 -3
- package/esm2022/manager/submission/submission/submission.component.mjs +5 -5
- package/esm2022/manager/submission/view/view.component.mjs +3 -3
- package/esm2022/manager/view/view.component.mjs +3 -3
- package/esm2022/resource/create/create.component.mjs +6 -6
- package/esm2022/resource/delete/delete.component.mjs +3 -3
- package/esm2022/resource/edit/edit.component.mjs +3 -3
- package/esm2022/resource/index/index.component.mjs +7 -8
- package/esm2022/resource/resource.component.mjs +23 -27
- package/esm2022/resource/resource.config.mjs +3 -3
- package/esm2022/resource/resource.module.mjs +4 -4
- package/esm2022/resource/resource.service.mjs +60 -37
- package/esm2022/resource/resources.service.mjs +3 -3
- package/esm2022/resource/view/view.component.mjs +3 -3
- package/fesm2022/formio-angular-auth.mjs +38 -26
- package/fesm2022/formio-angular-auth.mjs.map +1 -1
- package/fesm2022/formio-angular-grid.mjs +92 -48
- package/fesm2022/formio-angular-grid.mjs.map +1 -1
- package/fesm2022/formio-angular-manager.mjs +71 -63
- package/fesm2022/formio-angular-manager.mjs.map +1 -1
- package/fesm2022/formio-angular-resource.mjs +111 -94
- package/fesm2022/formio-angular-resource.mjs.map +1 -1
- package/fesm2022/formio-angular.mjs +28 -28
- package/grid/form/FormGridBody.component.d.ts +12 -2
- package/grid/form/FormGridBody.component.d.ts.map +1 -1
- package/manager/index/index.component.d.ts +6 -4
- package/manager/index/index.component.d.ts.map +1 -1
- package/package.json +1 -1
- package/resource/create/create.component.d.ts.map +1 -1
- package/resource/index/index.component.d.ts.map +1 -1
- package/resource/resource.component.d.ts +8 -6
- package/resource/resource.component.d.ts.map +1 -1
- package/resource/resource.service.d.ts +12 -8
- package/resource/resource.service.d.ts.map +1 -1
|
@@ -7,7 +7,7 @@ import Promise$1 from 'native-promise-only';
|
|
|
7
7
|
import { Formio, Utils } from '@formio/js';
|
|
8
8
|
import _, { each } from 'lodash';
|
|
9
9
|
import * as i2 from '@angular/router';
|
|
10
|
-
import { RouterModule } from '@angular/router';
|
|
10
|
+
import { NavigationEnd, RouterModule } from '@angular/router';
|
|
11
11
|
import * as i4 from '@angular/common';
|
|
12
12
|
import { CommonModule } from '@angular/common';
|
|
13
13
|
import * as i5 from '@formio/angular/grid';
|
|
@@ -17,10 +17,10 @@ class FormioResourceConfig {
|
|
|
17
17
|
name = '';
|
|
18
18
|
form = '';
|
|
19
19
|
parents = [];
|
|
20
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.
|
|
21
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.
|
|
20
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.1", ngImport: i0, type: FormioResourceConfig, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
21
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.1", ngImport: i0, type: FormioResourceConfig });
|
|
22
22
|
}
|
|
23
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.
|
|
23
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.1", ngImport: i0, type: FormioResourceConfig, decorators: [{
|
|
24
24
|
type: Injectable
|
|
25
25
|
}] });
|
|
26
26
|
|
|
@@ -39,10 +39,10 @@ class FormioResources {
|
|
|
39
39
|
}
|
|
40
40
|
};
|
|
41
41
|
}
|
|
42
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.
|
|
43
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.
|
|
42
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.1", ngImport: i0, type: FormioResources, deps: [{ token: i1.FormioAuthService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
43
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.1", ngImport: i0, type: FormioResources });
|
|
44
44
|
}
|
|
45
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.
|
|
45
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.1", ngImport: i0, type: FormioResources, decorators: [{
|
|
46
46
|
type: Injectable
|
|
47
47
|
}], ctorParameters: function () { return [{ type: i1.FormioAuthService }]; } });
|
|
48
48
|
|
|
@@ -50,7 +50,6 @@ class FormioResourceService {
|
|
|
50
50
|
appConfig;
|
|
51
51
|
config;
|
|
52
52
|
resourcesService;
|
|
53
|
-
appRef;
|
|
54
53
|
initialized = false;
|
|
55
54
|
form;
|
|
56
55
|
alerts;
|
|
@@ -60,37 +59,51 @@ class FormioResourceService {
|
|
|
60
59
|
formFormio;
|
|
61
60
|
formio;
|
|
62
61
|
refresh;
|
|
63
|
-
|
|
62
|
+
resourceResolve;
|
|
63
|
+
resourceReject;
|
|
64
64
|
resourceLoaded;
|
|
65
|
+
resourceLoading;
|
|
65
66
|
resourceId;
|
|
66
67
|
resources;
|
|
68
|
+
ready;
|
|
69
|
+
readyResolve;
|
|
70
|
+
readyReject;
|
|
67
71
|
formLoading;
|
|
68
72
|
formLoaded;
|
|
69
73
|
formResolve;
|
|
70
74
|
formReject;
|
|
71
75
|
isLoading;
|
|
72
|
-
constructor(appConfig, config, resourcesService
|
|
76
|
+
constructor(appConfig, config, resourcesService) {
|
|
73
77
|
this.appConfig = appConfig;
|
|
74
78
|
this.config = config;
|
|
75
79
|
this.resourcesService = resourcesService;
|
|
76
|
-
this.appRef = appRef;
|
|
77
80
|
this.isLoading = true;
|
|
78
81
|
this.alerts = new FormioAlerts();
|
|
79
82
|
this.refresh = new EventEmitter();
|
|
80
|
-
this.formLoaded = new Promise$1((resolve, reject) => {
|
|
81
|
-
this.formResolve = resolve;
|
|
82
|
-
this.formReject = reject;
|
|
83
|
-
});
|
|
84
|
-
this.init();
|
|
85
83
|
}
|
|
86
84
|
initialize() {
|
|
87
85
|
console.warn('FormioResourceService.initialize() has been deprecated.');
|
|
88
86
|
}
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
87
|
+
setResource(resourceId) {
|
|
88
|
+
this.resourceLoading = null;
|
|
89
|
+
this.formLoading = null;
|
|
90
|
+
this.ready = new Promise$1((resolve, reject) => {
|
|
91
|
+
this.readyResolve = resolve;
|
|
92
|
+
this.readyReject = reject;
|
|
93
|
+
});
|
|
94
|
+
this.formLoaded = new Promise$1((resolve, reject) => {
|
|
95
|
+
this.formResolve = resolve;
|
|
96
|
+
this.formReject = reject;
|
|
97
|
+
});
|
|
98
|
+
this.resourceLoaded = new Promise$1((resolve, reject) => {
|
|
99
|
+
this.resourceResolve = resolve;
|
|
100
|
+
this.resourceReject = reject;
|
|
101
|
+
});
|
|
102
|
+
this.resourceId = resourceId;
|
|
103
|
+
this.resourceUrl = this.appConfig.appUrl + '/' + this.config.form;
|
|
104
|
+
if (this.resourceId) {
|
|
105
|
+
this.resourceUrl += '/submission/' + this.resourceId;
|
|
92
106
|
}
|
|
93
|
-
this.initialized = true;
|
|
94
107
|
if (this.appConfig && this.appConfig.appUrl) {
|
|
95
108
|
Formio.setBaseUrl(this.appConfig.apiUrl);
|
|
96
109
|
Formio.setProjectUrl(this.appConfig.appUrl);
|
|
@@ -99,15 +112,30 @@ class FormioResourceService {
|
|
|
99
112
|
else {
|
|
100
113
|
console.error('You must provide an AppConfig within your application!');
|
|
101
114
|
}
|
|
102
|
-
|
|
103
|
-
this.formUrl = this.appConfig.appUrl + '/' + this.config.form;
|
|
115
|
+
this.formio = new FormioPromiseService(this.resourceUrl);
|
|
104
116
|
this.resource = { data: {} };
|
|
117
|
+
}
|
|
118
|
+
init(route) {
|
|
119
|
+
const resourceId = route.snapshot.params['id'];
|
|
120
|
+
if (resourceId && (resourceId === this.resourceId)) {
|
|
121
|
+
return this.ready;
|
|
122
|
+
}
|
|
123
|
+
// Set the resource.
|
|
124
|
+
this.setResource(resourceId);
|
|
105
125
|
// Add this resource service to the list of all resources in context.
|
|
106
126
|
if (this.resourcesService) {
|
|
107
127
|
this.resources = this.resourcesService.resources;
|
|
108
128
|
this.resources[this.config.name] = this;
|
|
109
129
|
}
|
|
110
|
-
|
|
130
|
+
if (this.resourceId) {
|
|
131
|
+
return this.loadForm()
|
|
132
|
+
.then(() => this.loadResource())
|
|
133
|
+
.then(() => this.readyResolve(this.form))
|
|
134
|
+
.catch((err) => this.readyReject(err));
|
|
135
|
+
}
|
|
136
|
+
return this.loadForm()
|
|
137
|
+
.then(() => this.readyResolve(this.form))
|
|
138
|
+
.catch((err) => this.readyReject(err));
|
|
111
139
|
}
|
|
112
140
|
onError(error) {
|
|
113
141
|
this.alerts.setAlert({
|
|
@@ -123,20 +151,11 @@ class FormioResourceService {
|
|
|
123
151
|
this.formReject(err);
|
|
124
152
|
this.onError(err);
|
|
125
153
|
}
|
|
126
|
-
setContext(route) {
|
|
127
|
-
this.resourceId = route.snapshot.params['id'];
|
|
128
|
-
this.resource = { data: {} };
|
|
129
|
-
this.resourceUrl = this.appConfig.appUrl + '/' + this.config.form;
|
|
130
|
-
if (this.resourceId) {
|
|
131
|
-
this.resourceUrl += '/submission/' + this.resourceId;
|
|
132
|
-
}
|
|
133
|
-
this.formio = new FormioPromiseService(this.resourceUrl);
|
|
134
|
-
if (this.resourcesService) {
|
|
135
|
-
this.resources[this.config.name] = this;
|
|
136
|
-
}
|
|
137
|
-
this.loadParents();
|
|
138
|
-
}
|
|
139
154
|
loadForm() {
|
|
155
|
+
if (this.formLoading) {
|
|
156
|
+
return this.formLoading;
|
|
157
|
+
}
|
|
158
|
+
this.formUrl = this.appConfig.appUrl + '/' + this.config.form;
|
|
140
159
|
this.formFormio = new FormioPromiseService(this.formUrl);
|
|
141
160
|
this.isLoading = true;
|
|
142
161
|
this.formLoading = this.formFormio
|
|
@@ -198,11 +217,14 @@ class FormioResourceService {
|
|
|
198
217
|
}
|
|
199
218
|
onSubmissionError(err) {
|
|
200
219
|
this.onError(err);
|
|
220
|
+
this.resourceReject(err);
|
|
201
221
|
}
|
|
202
|
-
loadResource(
|
|
203
|
-
this.
|
|
222
|
+
loadResource() {
|
|
223
|
+
if (this.resourceLoading) {
|
|
224
|
+
return this.resourceLoading;
|
|
225
|
+
}
|
|
204
226
|
this.isLoading = true;
|
|
205
|
-
this.resourceLoading = this.
|
|
227
|
+
this.resourceLoading = this.formio
|
|
206
228
|
.loadSubmission(null, { ignoreCache: true })
|
|
207
229
|
.then((resource) => {
|
|
208
230
|
this.resource = resource;
|
|
@@ -211,6 +233,7 @@ class FormioResourceService {
|
|
|
211
233
|
property: 'submission',
|
|
212
234
|
value: this.resource
|
|
213
235
|
});
|
|
236
|
+
this.resourceResolve(resource);
|
|
214
237
|
return resource;
|
|
215
238
|
}, (err) => this.onSubmissionError(err))
|
|
216
239
|
.catch((err) => this.onSubmissionError(err));
|
|
@@ -234,58 +257,53 @@ class FormioResourceService {
|
|
|
234
257
|
}, (err) => this.onError(err))
|
|
235
258
|
.catch((err) => this.onError(err));
|
|
236
259
|
}
|
|
237
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.
|
|
238
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.
|
|
260
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.1", ngImport: i0, type: FormioResourceService, deps: [{ token: i1$1.FormioAppConfig }, { token: FormioResourceConfig }, { token: FormioResources, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
261
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.1", ngImport: i0, type: FormioResourceService });
|
|
239
262
|
}
|
|
240
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.
|
|
263
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.1", ngImport: i0, type: FormioResourceService, decorators: [{
|
|
241
264
|
type: Injectable
|
|
242
265
|
}], ctorParameters: function () { return [{ type: i1$1.FormioAppConfig }, { type: FormioResourceConfig }, { type: FormioResources, decorators: [{
|
|
243
266
|
type: Optional
|
|
244
|
-
}] }
|
|
267
|
+
}] }]; } });
|
|
245
268
|
|
|
246
269
|
class FormioResourceComponent {
|
|
247
270
|
service;
|
|
248
271
|
route;
|
|
249
272
|
auth;
|
|
250
|
-
|
|
273
|
+
router;
|
|
251
274
|
perms = { delete: false, edit: false };
|
|
252
|
-
|
|
275
|
+
routerSubscription;
|
|
276
|
+
constructor(service, route, auth, router) {
|
|
253
277
|
this.service = service;
|
|
254
278
|
this.route = route;
|
|
255
279
|
this.auth = auth;
|
|
256
|
-
|
|
257
|
-
this.paramsSubscription = this.route.params.subscribe((params) => {
|
|
258
|
-
this.init();
|
|
259
|
-
});
|
|
280
|
+
this.router = router;
|
|
260
281
|
}
|
|
261
282
|
ngOnInit() {
|
|
262
283
|
this.init();
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
this.auth.ready.then(() => {
|
|
268
|
-
this.service.resourceLoaded.then((resource) => {
|
|
269
|
-
this.service.formFormio.userPermissions(this.auth.user, form, resource).then((perms) => {
|
|
270
|
-
this.perms.delete = perms.delete;
|
|
271
|
-
this.perms.edit = perms.edit;
|
|
272
|
-
});
|
|
273
|
-
});
|
|
274
|
-
});
|
|
284
|
+
this.routerSubscription = this.router.events.subscribe((event) => {
|
|
285
|
+
if (event instanceof NavigationEnd) {
|
|
286
|
+
this.init();
|
|
287
|
+
}
|
|
275
288
|
});
|
|
276
289
|
}
|
|
277
290
|
ngOnDestroy() {
|
|
278
|
-
|
|
279
|
-
this.paramsSubscription.unsubscribe();
|
|
280
|
-
}
|
|
291
|
+
this.routerSubscription.unsubscribe();
|
|
281
292
|
}
|
|
282
|
-
|
|
283
|
-
|
|
293
|
+
init() {
|
|
294
|
+
return this.service.init(this.route).then(() => this.auth.ready.then(() => this.service.formFormio.userPermissions(this.auth.user, this.service.form, this.service.resource).then((perms) => {
|
|
295
|
+
this.perms.delete = perms.delete;
|
|
296
|
+
this.perms.edit = perms.edit;
|
|
297
|
+
return this.service.resource;
|
|
298
|
+
})));
|
|
299
|
+
}
|
|
300
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.1", ngImport: i0, type: FormioResourceComponent, deps: [{ token: FormioResourceService }, { token: i2.ActivatedRoute }, { token: i1.FormioAuthService }, { token: i2.Router }], target: i0.ɵɵFactoryTarget.Component });
|
|
301
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.1", type: FormioResourceComponent, selector: "ng-component", ngImport: i0, template: "<ul class=\"nav nav-tabs\" style=\"margin-bottom: 10px\">\n <li class=\"nav-item\"><a class=\"nav-link\" routerLink=\"../\"><em class=\"fa fa-chevron-left bi bi-chevron-left\"></em></a></li>\n <li class=\"nav-item\" routerLinkActive=\"active\"><a class=\"nav-link\" routerLink=\"view\" routerLinkActive=\"active\">View</a></li>\n <li class=\"nav-item\" routerLinkActive=\"active\" *ngIf=\"perms.edit\"><a class=\"nav-link\" routerLink=\"edit\" routerLinkActive=\"active\">Edit</a></li>\n <li class=\"nav-item\" routerLinkActive=\"active\" *ngIf=\"perms.delete\"><a class=\"nav-link\" routerLink=\"delete\" routerLinkActive=\"active\"><span class=\"fa fa-trash bi bi-trash\"></span></a></li>\n</ul>\n<router-outlet></router-outlet>\n", dependencies: [{ kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.RouterOutlet, selector: "router-outlet", inputs: ["name"], outputs: ["activate", "deactivate", "attach", "detach"], exportAs: ["outlet"] }, { kind: "directive", type: i2.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "directive", type: i2.RouterLinkActive, selector: "[routerLinkActive]", inputs: ["routerLinkActiveOptions", "ariaCurrentWhenActive", "routerLinkActive"], outputs: ["isActiveChange"], exportAs: ["routerLinkActive"] }] });
|
|
284
302
|
}
|
|
285
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.
|
|
303
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.1", ngImport: i0, type: FormioResourceComponent, decorators: [{
|
|
286
304
|
type: Component,
|
|
287
|
-
args: [{ template: "<ul class=\"nav nav-tabs\" style=\"margin-bottom: 10px\">\n <li class=\"nav-item\"><a class=\"nav-link\" routerLink=\"../\"><em class=\"fa fa-chevron-left
|
|
288
|
-
}], ctorParameters: function () { return [{ type: FormioResourceService }, { type: i2.ActivatedRoute }, { type: i1.FormioAuthService }]; } });
|
|
305
|
+
args: [{ template: "<ul class=\"nav nav-tabs\" style=\"margin-bottom: 10px\">\n <li class=\"nav-item\"><a class=\"nav-link\" routerLink=\"../\"><em class=\"fa fa-chevron-left bi bi-chevron-left\"></em></a></li>\n <li class=\"nav-item\" routerLinkActive=\"active\"><a class=\"nav-link\" routerLink=\"view\" routerLinkActive=\"active\">View</a></li>\n <li class=\"nav-item\" routerLinkActive=\"active\" *ngIf=\"perms.edit\"><a class=\"nav-link\" routerLink=\"edit\" routerLinkActive=\"active\">Edit</a></li>\n <li class=\"nav-item\" routerLinkActive=\"active\" *ngIf=\"perms.delete\"><a class=\"nav-link\" routerLink=\"delete\" routerLinkActive=\"active\"><span class=\"fa fa-trash bi bi-trash\"></span></a></li>\n</ul>\n<router-outlet></router-outlet>\n" }]
|
|
306
|
+
}], ctorParameters: function () { return [{ type: FormioResourceService }, { type: i2.ActivatedRoute }, { type: i1.FormioAuthService }, { type: i2.Router }]; } });
|
|
289
307
|
|
|
290
308
|
class FormioResourceViewComponent {
|
|
291
309
|
service;
|
|
@@ -298,10 +316,10 @@ class FormioResourceViewComponent {
|
|
|
298
316
|
ngOnDestroy() {
|
|
299
317
|
Formio.clearCache();
|
|
300
318
|
}
|
|
301
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.
|
|
302
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.
|
|
319
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.1", ngImport: i0, type: FormioResourceViewComponent, deps: [{ token: FormioResourceService }, { token: FormioResourceConfig }], target: i0.ɵɵFactoryTarget.Component });
|
|
320
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.1", type: FormioResourceViewComponent, selector: "ng-component", ngImport: i0, template: "<formio\n [form]=\"service.form\"\n [submission]=\"service.resource\"\n [hideComponents]=\"config.parents\"\n [readOnly]=\"true\"\n></formio>\n", dependencies: [{ kind: "component", type: i1$1.FormioComponent, selector: "formio" }] });
|
|
303
321
|
}
|
|
304
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.
|
|
322
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.1", ngImport: i0, type: FormioResourceViewComponent, decorators: [{
|
|
305
323
|
type: Component,
|
|
306
324
|
args: [{ template: "<formio\n [form]=\"service.form\"\n [submission]=\"service.resource\"\n [hideComponents]=\"config.parents\"\n [readOnly]=\"true\"\n></formio>\n" }]
|
|
307
325
|
}], ctorParameters: function () { return [{ type: FormioResourceService }, { type: FormioResourceConfig }]; } });
|
|
@@ -333,10 +351,10 @@ class FormioResourceEditComponent {
|
|
|
333
351
|
ngOnDestroy() {
|
|
334
352
|
Formio.clearCache();
|
|
335
353
|
}
|
|
336
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.
|
|
337
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.
|
|
354
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.1", ngImport: i0, type: FormioResourceEditComponent, deps: [{ token: FormioResourceService }, { token: i2.ActivatedRoute }, { token: i2.Router }, { token: FormioResourceConfig }], target: i0.ɵɵFactoryTarget.Component });
|
|
355
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.1", type: FormioResourceEditComponent, selector: "ng-component", ngImport: i0, template: "<formio\n [form]=\"service.form\"\n [submission]=\"service.resource\"\n [error]=\"triggerError\"\n [submitDone]=\"onSubmitDone\"\n (submit)=\"onSubmit($event)\"\n></formio>\n", dependencies: [{ kind: "component", type: i1$1.FormioComponent, selector: "formio" }] });
|
|
338
356
|
}
|
|
339
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.
|
|
357
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.1", ngImport: i0, type: FormioResourceEditComponent, decorators: [{
|
|
340
358
|
type: Component,
|
|
341
359
|
args: [{ template: "<formio\n [form]=\"service.form\"\n [submission]=\"service.resource\"\n [error]=\"triggerError\"\n [submitDone]=\"onSubmitDone\"\n (submit)=\"onSubmit($event)\"\n></formio>\n" }]
|
|
342
360
|
}], ctorParameters: function () { return [{ type: FormioResourceService }, { type: i2.ActivatedRoute }, { type: i2.Router }, { type: FormioResourceConfig }]; } });
|
|
@@ -358,10 +376,10 @@ class FormioResourceDeleteComponent {
|
|
|
358
376
|
onCancel() {
|
|
359
377
|
this.router.navigate(['../', 'view'], { relativeTo: this.route });
|
|
360
378
|
}
|
|
361
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.
|
|
362
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.
|
|
379
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.1", ngImport: i0, type: FormioResourceDeleteComponent, deps: [{ token: FormioResourceService }, { token: i2.ActivatedRoute }, { token: i2.Router }], target: i0.ɵɵFactoryTarget.Component });
|
|
380
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.1", type: FormioResourceDeleteComponent, selector: "ng-component", ngImport: i0, template: "<h3>Are you sure you wish to delete this record?</h3>\n<div class=\"btn-toolbar\">\n <button type=\"button\" (click)=\"onDelete()\" class=\"btn btn-danger\" style=\"margin-right: 10px;\">Yes</button>\n <button type=\"button\" (click)=\"onCancel()\" class=\"btn btn-danger\">No</button>\n</div>\n" });
|
|
363
381
|
}
|
|
364
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.
|
|
382
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.1", ngImport: i0, type: FormioResourceDeleteComponent, decorators: [{
|
|
365
383
|
type: Component,
|
|
366
384
|
args: [{ template: "<h3>Are you sure you wish to delete this record?</h3>\n<div class=\"btn-toolbar\">\n <button type=\"button\" (click)=\"onDelete()\" class=\"btn btn-danger\" style=\"margin-right: 10px;\">Yes</button>\n <button type=\"button\" (click)=\"onCancel()\" class=\"btn btn-danger\">No</button>\n</div>\n" }]
|
|
367
385
|
}], ctorParameters: function () { return [{ type: FormioResourceService }, { type: i2.ActivatedRoute }, { type: i2.Router }]; } });
|
|
@@ -382,7 +400,7 @@ class FormioResourceCreateComponent {
|
|
|
382
400
|
this.onSuccess = new EventEmitter();
|
|
383
401
|
}
|
|
384
402
|
ngOnInit() {
|
|
385
|
-
this.service.
|
|
403
|
+
this.service.init(this.route);
|
|
386
404
|
}
|
|
387
405
|
onSubmit(submission) {
|
|
388
406
|
this.service
|
|
@@ -394,12 +412,12 @@ class FormioResourceCreateComponent {
|
|
|
394
412
|
})
|
|
395
413
|
.catch((err) => this.onError.emit(err));
|
|
396
414
|
}
|
|
397
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.
|
|
398
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.
|
|
415
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.1", ngImport: i0, type: FormioResourceCreateComponent, deps: [{ token: FormioResourceService }, { token: i2.ActivatedRoute }, { token: i2.Router }, { token: FormioResourceConfig }], target: i0.ɵɵFactoryTarget.Component });
|
|
416
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.1", type: FormioResourceCreateComponent, selector: "ng-component", ngImport: i0, template: "<h3 *ngIf=\"service.form\" style=\"margin-top:0;\">\n <a routerLink=\"../\" class=\"back-button\">\n <em class=\"fa fa-chevron-left bi bi-chevron-left\"></em>\n </a> | New {{ service.form.title }}\n</h3>\n<formio\n [form]=\"service.form\"\n [submission]=\"service.resource\"\n [refresh]=\"service.refresh\"\n [error]=\"onError\"\n [success]=\"onSuccess\"\n (submit)=\"onSubmit($event)\"\n></formio>\n", styles: [".back-button{font-size:.8em}\n"], dependencies: [{ kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i1$1.FormioComponent, selector: "formio" }, { kind: "directive", type: i2.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }] });
|
|
399
417
|
}
|
|
400
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.
|
|
418
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.1", ngImport: i0, type: FormioResourceCreateComponent, decorators: [{
|
|
401
419
|
type: Component,
|
|
402
|
-
args: [{ template: "<h3 *ngIf=\"service.form\" style=\"margin-top:0;\">\n <a routerLink=\"../\" class=\"back-button\">\n <em class=\"fa fa-chevron-left
|
|
420
|
+
args: [{ template: "<h3 *ngIf=\"service.form\" style=\"margin-top:0;\">\n <a routerLink=\"../\" class=\"back-button\">\n <em class=\"fa fa-chevron-left bi bi-chevron-left\"></em>\n </a> | New {{ service.form.title }}\n</h3>\n<formio\n [form]=\"service.form\"\n [submission]=\"service.resource\"\n [refresh]=\"service.refresh\"\n [error]=\"onError\"\n [success]=\"onSuccess\"\n (submit)=\"onSubmit($event)\"\n></formio>\n", styles: [".back-button{font-size:.8em}\n"] }]
|
|
403
421
|
}], ctorParameters: function () { return [{ type: FormioResourceService }, { type: i2.ActivatedRoute }, { type: i2.Router }, { type: FormioResourceConfig }]; } });
|
|
404
422
|
|
|
405
423
|
class FormioResourceIndexComponent {
|
|
@@ -421,9 +439,8 @@ class FormioResourceIndexComponent {
|
|
|
421
439
|
this.ngZone = ngZone;
|
|
422
440
|
}
|
|
423
441
|
ngOnInit() {
|
|
424
|
-
this.
|
|
425
|
-
|
|
426
|
-
this.service.formLoaded.then(() => {
|
|
442
|
+
this.service.init(this.route).then(() => {
|
|
443
|
+
this.gridQuery = {};
|
|
427
444
|
if (this.service &&
|
|
428
445
|
this.config.parents &&
|
|
429
446
|
this.config.parents.length) {
|
|
@@ -437,13 +454,13 @@ class FormioResourceIndexComponent {
|
|
|
437
454
|
// Set the source to load the grid.
|
|
438
455
|
this.gridSrc = this.service.formUrl;
|
|
439
456
|
this.createText = `New ${this.service.form.title}`;
|
|
457
|
+
this.cdr.detectChanges();
|
|
440
458
|
});
|
|
441
459
|
}
|
|
442
460
|
else if (this.service.formUrl) {
|
|
443
461
|
this.gridSrc = this.service.formUrl;
|
|
444
462
|
this.createText = `New ${this.service.form.title}`;
|
|
445
463
|
}
|
|
446
|
-
this.cdr.detectChanges();
|
|
447
464
|
});
|
|
448
465
|
}
|
|
449
466
|
onSelect(row) {
|
|
@@ -456,10 +473,10 @@ class FormioResourceIndexComponent {
|
|
|
456
473
|
this.router.navigate(['new'], { relativeTo: this.route });
|
|
457
474
|
});
|
|
458
475
|
}
|
|
459
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.
|
|
460
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.
|
|
476
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.1", ngImport: i0, type: FormioResourceIndexComponent, deps: [{ token: FormioResourceService }, { token: i2.ActivatedRoute }, { token: i2.Router }, { token: FormioResourceConfig }, { token: i0.ChangeDetectorRef }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
|
|
477
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.1", type: FormioResourceIndexComponent, selector: "ng-component", ngImport: i0, template: "<formio-alerts [alerts]=\"service.alerts\"></formio-alerts>\n<formio-grid\n [src]=\"gridSrc\"\n [query]=\"gridQuery\"\n [onForm]=\"service.formLoaded\"\n (rowSelect)=\"onSelect($event)\"\n (error)=\"service.onError($event)\"\n (createItem)=\"onCreateItem()\"\n [createText]=\"createText\"\n></formio-grid>\n", dependencies: [{ kind: "component", type: i1$1.FormioAlertsComponent, selector: "formio-alerts", inputs: ["alerts"], outputs: ["focusComponent"] }, { kind: "component", type: i5.FormioGridComponent, selector: "formio-grid", inputs: ["footerPosition", "src", "items", "onForm", "query", "refresh", "columns", "gridType", "size", "components", "formio", "label", "createText", "isActionAllowed"], outputs: ["select", "rowSelect", "rowAction", "createItem", "error"] }] });
|
|
461
478
|
}
|
|
462
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.
|
|
479
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.1", ngImport: i0, type: FormioResourceIndexComponent, decorators: [{
|
|
463
480
|
type: Component,
|
|
464
481
|
args: [{ template: "<formio-alerts [alerts]=\"service.alerts\"></formio-alerts>\n<formio-grid\n [src]=\"gridSrc\"\n [query]=\"gridQuery\"\n [onForm]=\"service.formLoaded\"\n (rowSelect)=\"onSelect($event)\"\n (error)=\"service.onError($event)\"\n (createItem)=\"onCreateItem()\"\n [createText]=\"createText\"\n></formio-grid>\n" }]
|
|
465
482
|
}], ctorParameters: function () { return [{ type: FormioResourceService }, { type: i2.ActivatedRoute }, { type: i2.Router }, { type: FormioResourceConfig }, { type: i0.ChangeDetectorRef }, { type: i0.NgZone }]; } });
|
|
@@ -507,8 +524,8 @@ class FormioResource {
|
|
|
507
524
|
static forRoot(config) {
|
|
508
525
|
return extendRouter(FormioResource, config, FormioResourceRoutes);
|
|
509
526
|
}
|
|
510
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.
|
|
511
|
-
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.
|
|
527
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.1", ngImport: i0, type: FormioResource, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
528
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.1.1", ngImport: i0, type: FormioResource, declarations: [FormioResourceComponent,
|
|
512
529
|
FormioResourceCreateComponent,
|
|
513
530
|
FormioResourceIndexComponent,
|
|
514
531
|
FormioResourceViewComponent,
|
|
@@ -517,14 +534,14 @@ class FormioResource {
|
|
|
517
534
|
FormioModule,
|
|
518
535
|
FormioGrid,
|
|
519
536
|
RouterModule] });
|
|
520
|
-
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.
|
|
537
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.1.1", ngImport: i0, type: FormioResource, providers: [
|
|
521
538
|
FormioAlerts
|
|
522
539
|
], imports: [CommonModule,
|
|
523
540
|
FormioModule,
|
|
524
541
|
FormioGrid,
|
|
525
542
|
RouterModule] });
|
|
526
543
|
}
|
|
527
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.
|
|
544
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.1", ngImport: i0, type: FormioResource, decorators: [{
|
|
528
545
|
type: NgModule,
|
|
529
546
|
args: [{
|
|
530
547
|
imports: [
|