@piserve-tech/form-submission 1.2.13 → 1.2.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.
- package/esm2022/form-submission/form-submission.module.mjs +6 -3
- package/esm2022/form-submission/submission-container/submission-container.component.mjs +17 -0
- package/esm2022/form-submission/submit-form/submit-form.component.mjs +130 -15
- package/esm2022/services/data.service.mjs +6 -1
- package/esm2022/services/form.service.mjs +10 -2
- package/fesm2022/piserve-tech-form-submission.mjs +155 -13
- package/fesm2022/piserve-tech-form-submission.mjs.map +1 -1
- package/form-submission/form-submission.module.d.ts +6 -5
- package/form-submission/submission-container/submission-container.component.d.ts +7 -0
- package/form-submission/submit-form/submit-form.component.d.ts +4 -2
- package/package.json +1 -1
- package/services/data.service.d.ts +3 -0
- package/services/form.service.d.ts +1 -0
|
@@ -15,6 +15,12 @@ export class FormService {
|
|
|
15
15
|
this.dataService.header$.subscribe((data) => {
|
|
16
16
|
this.header = data;
|
|
17
17
|
});
|
|
18
|
+
this.dataService.parentQuestions$.subscribe((questions) => {
|
|
19
|
+
if (questions) {
|
|
20
|
+
this.parentQuestions = questions;
|
|
21
|
+
console.log('parent questions', this.parentQuestions);
|
|
22
|
+
}
|
|
23
|
+
});
|
|
18
24
|
}
|
|
19
25
|
getQuestions(moduleName) {
|
|
20
26
|
return this.http.get(`${this.apiUrl}/api/public/forms/${moduleName}`);
|
|
@@ -41,7 +47,9 @@ export class FormService {
|
|
|
41
47
|
});
|
|
42
48
|
}
|
|
43
49
|
getSubmittedForm(moduleName, submissionId) {
|
|
44
|
-
|
|
50
|
+
const questions = this.parentQuestions ? this.parentQuestions.map((q) => `questions=${encodeURIComponent(q)}`).join('&') : '';
|
|
51
|
+
console.log('questions', questions);
|
|
52
|
+
return this.http.get(`${this.apiUrl}/api/forms/${moduleName}/submissions/${submissionId}?${questions}`);
|
|
45
53
|
}
|
|
46
54
|
updateForm(moduleName, submissionId, formData) {
|
|
47
55
|
const headers = new HttpHeaders({
|
|
@@ -61,4 +69,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
61
69
|
providedIn: 'root',
|
|
62
70
|
}]
|
|
63
71
|
}], ctorParameters: function () { return [{ type: i1.HttpClient }, { type: i2.DataService }]; } });
|
|
64
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
72
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZm9ybS5zZXJ2aWNlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vcHJvamVjdHMvZm9ybS1zdWJtaXNzaW9uL3NyYy9zZXJ2aWNlcy9mb3JtLnNlcnZpY2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFVBQVUsRUFBRSxNQUFNLGVBQWUsQ0FBQztBQUMzQyxPQUFPLEVBQWMsV0FBVyxFQUFFLE1BQU0sc0JBQXNCLENBQUM7Ozs7QUFPL0QsTUFBTSxPQUFPLFdBQVc7SUFLdEIsWUFBb0IsSUFBZ0IsRUFBVSxXQUF3QjtRQUFsRCxTQUFJLEdBQUosSUFBSSxDQUFZO1FBQVUsZ0JBQVcsR0FBWCxXQUFXLENBQWE7UUFKOUQsV0FBTSxHQUFXLEVBQUUsQ0FBQztRQUM1QixXQUFNLEdBQVEsRUFBRSxDQUFDO1FBSWYsSUFBSSxDQUFDLFdBQVcsQ0FBQyxPQUFPLENBQUMsU0FBUyxDQUFDLENBQUMsSUFBSSxFQUFFLEVBQUU7WUFDMUMsSUFBSSxDQUFDLE1BQU0sR0FBRyxJQUFJLENBQUM7UUFDckIsQ0FBQyxDQUFDLENBQUM7UUFFSCxJQUFJLENBQUMsV0FBVyxDQUFDLE9BQU8sQ0FBQyxTQUFTLENBQUMsQ0FBQyxJQUFJLEVBQUUsRUFBRTtZQUMxQyxJQUFJLENBQUMsTUFBTSxHQ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c2lvbklkfT8ke3F1ZXN0aW9uc31gKTtcbiAgfVxuXG4gIHVwZGF0ZUZvcm0obW9kdWxlTmFtZTogc3RyaW5nLCBzdWJtaXNzaW9uSWQ6IHN0cmluZywgZm9ybURhdGE6IEZvcm1EYXRhKTogT2JzZXJ2YWJsZTxhbnk+IHtcbiAgICBjb25zdCBoZWFkZXJzID0gbmV3IEh0dHBIZWFkZXJzKHtcbiAgICAgICdBdXRoLXVzZXInOiB0aGlzLmhlYWRlci5hdXRoVXNlcixcbiAgICB9KTtcbiAgICBjb25zdCB1cmwgPSBgJHt0aGlzLmFwaVVybH0vYXBpL3B1YmxpYy9mb3Jtcy8ke21vZHVsZU5hbWV9L3N1Ym1pc3Npb25zLyR7c3VibWlzc2lvbklkfWA7XG4gICAgcmV0dXJuIHRoaXMuaHR0cC5wdXQodXJsLCBmb3JtRGF0YSwge1xuICAgICAgaGVhZGVyc1xuICAgIH0pO1xuICB9XG5cbn1cbiJdfQ==
|
|
@@ -46,6 +46,8 @@ class DataService {
|
|
|
46
46
|
this.apiUrl$ = this.dataSubject.asObservable();
|
|
47
47
|
this.headerSubject = new BehaviorSubject({});
|
|
48
48
|
this.header$ = this.headerSubject.asObservable();
|
|
49
|
+
this.parentQuestionsSubject = new BehaviorSubject(null);
|
|
50
|
+
this.parentQuestions$ = this.parentQuestionsSubject.asObservable();
|
|
49
51
|
}
|
|
50
52
|
setApiUrl(data) {
|
|
51
53
|
this.dataSubject.next(data);
|
|
@@ -53,6 +55,9 @@ class DataService {
|
|
|
53
55
|
setHeader(data) {
|
|
54
56
|
this.headerSubject.next(data);
|
|
55
57
|
}
|
|
58
|
+
setParentQuestions(data) {
|
|
59
|
+
this.parentQuestionsSubject.next(data);
|
|
60
|
+
}
|
|
56
61
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DataService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
57
62
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DataService, providedIn: 'root' }); }
|
|
58
63
|
}
|
|
@@ -359,6 +364,12 @@ class FormService {
|
|
|
359
364
|
this.dataService.header$.subscribe((data) => {
|
|
360
365
|
this.header = data;
|
|
361
366
|
});
|
|
367
|
+
this.dataService.parentQuestions$.subscribe((questions) => {
|
|
368
|
+
if (questions) {
|
|
369
|
+
this.parentQuestions = questions;
|
|
370
|
+
console.log('parent questions', this.parentQuestions);
|
|
371
|
+
}
|
|
372
|
+
});
|
|
362
373
|
}
|
|
363
374
|
getQuestions(moduleName) {
|
|
364
375
|
return this.http.get(`${this.apiUrl}/api/public/forms/${moduleName}`);
|
|
@@ -385,7 +396,9 @@ class FormService {
|
|
|
385
396
|
});
|
|
386
397
|
}
|
|
387
398
|
getSubmittedForm(moduleName, submissionId) {
|
|
388
|
-
|
|
399
|
+
const questions = this.parentQuestions ? this.parentQuestions.map((q) => `questions=${encodeURIComponent(q)}`).join('&') : '';
|
|
400
|
+
console.log('questions', questions);
|
|
401
|
+
return this.http.get(`${this.apiUrl}/api/forms/${moduleName}/submissions/${submissionId}?${questions}`);
|
|
389
402
|
}
|
|
390
403
|
updateForm(moduleName, submissionId, formData) {
|
|
391
404
|
const headers = new HttpHeaders({
|
|
@@ -2967,11 +2980,26 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
2967
2980
|
type: Output
|
|
2968
2981
|
}] } });
|
|
2969
2982
|
|
|
2983
|
+
class SubmissionContainerComponent {
|
|
2984
|
+
isImageUrl(url) {
|
|
2985
|
+
return url.match(/\.(jpeg|jpg|gif|png)$/) != null;
|
|
2986
|
+
}
|
|
2987
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SubmissionContainerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2988
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: SubmissionContainerComponent, selector: "lib-submission-container", inputs: { submission: "submission" }, ngImport: i0, template: "<div class=\"subModule\">\n <div class=\"submission-container\">\n <div *ngFor=\"let qa of submission?.questionAnswers\" class=\"submission-item\">\n <div class=\"key\">{{ qa.question }}</div>\n <div class=\"value\">\n <ng-container *ngIf=\"qa.elementType === 'FILE_PICKER'; else text\">\n <div class=\"files\" *ngFor=\"let attachment of qa.attachments\">\n <ng-container *ngIf=\"isImageUrl(attachment.fileName); else fileLink\">\n <img [src]=\"attachment.fileUrl\" alt=\"{{ attachment.fileName }}\" class=\"image\">\n </ng-container>\n <ng-template #fileLink>\n <p>{{ attachment.fileName }}</p>\n <a class=\"fileName\" [href]=\"attachment.fileUrl\" target=\"_blank\">\n <i class=\"bi bi-file-earmark\"></i>\n </a>\n </ng-template>\n </div>\n </ng-container>\n <ng-template #text>\n <ng-container [ngSwitch]=\"qa.elementType\">\n <p *ngSwitchCase=\"'RICH_TEXT_EDITOR'\" [innerHTML]=\"qa.values\"></p>\n <p *ngSwitchCase=\"'DROP_DOWN'\">{{ qa.values.join(', ') }}</p>\n <p *ngSwitchCase=\"'SELECTION_MATRIX'\">{{ qa.values.join(', ') }}</p>\n <p *ngSwitchDefault>{{ qa.values }}</p>\n </ng-container>\n </ng-template>\n </div>\n </div>\n</div>\n </div>", styles: [".subModule{width:100%;position:relative;padding-left:3rem;padding-right:3rem;padding-top:4rem}@media (max-width: 1024px){.subModule{padding-left:1rem;padding-right:1rem}}@media (max-width: 576px){.subModule{padding:2rem .5rem}}.submission-container{background:#fff;display:flex;flex-wrap:wrap;box-shadow:0 4px 4px #00000040;border-radius:6px}.submission-item{flex:1 0 15%;margin:5px;padding:10px;border-radius:4px;display:flex;flex-direction:column}.key{font-weight:700;margin-bottom:5px}.value{word-break:break-word}.image{max-width:100%;height:auto;max-height:100px;margin-top:5px;border:1px solid #ddd;border-radius:4px;margin-bottom:10px}.files{display:flex;flex-direction:row}.fileName{text-decoration:none;margin-left:2%}.fileName i{font-size:20px}\n"], dependencies: [{ kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i1$1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "directive", type: i1$1.NgSwitchDefault, selector: "[ngSwitchDefault]" }] }); }
|
|
2989
|
+
}
|
|
2990
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SubmissionContainerComponent, decorators: [{
|
|
2991
|
+
type: Component,
|
|
2992
|
+
args: [{ selector: 'lib-submission-container', template: "<div class=\"subModule\">\n <div class=\"submission-container\">\n <div *ngFor=\"let qa of submission?.questionAnswers\" class=\"submission-item\">\n <div class=\"key\">{{ qa.question }}</div>\n <div class=\"value\">\n <ng-container *ngIf=\"qa.elementType === 'FILE_PICKER'; else text\">\n <div class=\"files\" *ngFor=\"let attachment of qa.attachments\">\n <ng-container *ngIf=\"isImageUrl(attachment.fileName); else fileLink\">\n <img [src]=\"attachment.fileUrl\" alt=\"{{ attachment.fileName }}\" class=\"image\">\n </ng-container>\n <ng-template #fileLink>\n <p>{{ attachment.fileName }}</p>\n <a class=\"fileName\" [href]=\"attachment.fileUrl\" target=\"_blank\">\n <i class=\"bi bi-file-earmark\"></i>\n </a>\n </ng-template>\n </div>\n </ng-container>\n <ng-template #text>\n <ng-container [ngSwitch]=\"qa.elementType\">\n <p *ngSwitchCase=\"'RICH_TEXT_EDITOR'\" [innerHTML]=\"qa.values\"></p>\n <p *ngSwitchCase=\"'DROP_DOWN'\">{{ qa.values.join(', ') }}</p>\n <p *ngSwitchCase=\"'SELECTION_MATRIX'\">{{ qa.values.join(', ') }}</p>\n <p *ngSwitchDefault>{{ qa.values }}</p>\n </ng-container>\n </ng-template>\n </div>\n </div>\n</div>\n </div>", styles: [".subModule{width:100%;position:relative;padding-left:3rem;padding-right:3rem;padding-top:4rem}@media (max-width: 1024px){.subModule{padding-left:1rem;padding-right:1rem}}@media (max-width: 576px){.subModule{padding:2rem .5rem}}.submission-container{background:#fff;display:flex;flex-wrap:wrap;box-shadow:0 4px 4px #00000040;border-radius:6px}.submission-item{flex:1 0 15%;margin:5px;padding:10px;border-radius:4px;display:flex;flex-direction:column}.key{font-weight:700;margin-bottom:5px}.value{word-break:break-word}.image{max-width:100%;height:auto;max-height:100px;margin-top:5px;border:1px solid #ddd;border-radius:4px;margin-bottom:10px}.files{display:flex;flex-direction:row}.fileName{text-decoration:none;margin-left:2%}.fileName i{font-size:20px}\n"] }]
|
|
2993
|
+
}], propDecorators: { submission: [{
|
|
2994
|
+
type: Input
|
|
2995
|
+
}] } });
|
|
2996
|
+
|
|
2970
2997
|
class SubmitFormComponent {
|
|
2971
|
-
constructor(formService, toastr, router) {
|
|
2998
|
+
constructor(formService, toastr, router, dataService) {
|
|
2972
2999
|
this.formService = formService;
|
|
2973
3000
|
this.toastr = toastr;
|
|
2974
3001
|
this.router = router;
|
|
3002
|
+
this.dataService = dataService;
|
|
2975
3003
|
this.question = null;
|
|
2976
3004
|
this.moduleName = '';
|
|
2977
3005
|
this.edit = false;
|
|
@@ -3000,7 +3028,120 @@ class SubmitFormComponent {
|
|
|
3000
3028
|
this.lastTab = false;
|
|
3001
3029
|
this.questionAnswers = { parentId: '', answers: [], forms: [] };
|
|
3002
3030
|
this.files = [];
|
|
3003
|
-
this.submission = {
|
|
3031
|
+
this.submission = {
|
|
3032
|
+
"id": "22d168a8-75b0-48ae-948f-4795b664c977",
|
|
3033
|
+
"module": "employee",
|
|
3034
|
+
"formId": "6f72fc7d-4bad-405c-a6d0-f6e26469ac4a",
|
|
3035
|
+
"formName": "sub module",
|
|
3036
|
+
"createdBy": "kripesh",
|
|
3037
|
+
"modifiedBy": "kripesh",
|
|
3038
|
+
"createdOn": "10/07/2024 03:27 PM",
|
|
3039
|
+
"modifiedOn": "10/07/2024 03:27 PM",
|
|
3040
|
+
"status": "PUBLISHED",
|
|
3041
|
+
"questionAnswers": [
|
|
3042
|
+
{
|
|
3043
|
+
"question": "text",
|
|
3044
|
+
"elementType": "TEXT_BOX",
|
|
3045
|
+
"values": "text"
|
|
3046
|
+
},
|
|
3047
|
+
{
|
|
3048
|
+
"question": "text area",
|
|
3049
|
+
"elementType": "TEXT_AREA",
|
|
3050
|
+
"values": "text area"
|
|
3051
|
+
},
|
|
3052
|
+
{
|
|
3053
|
+
"question": "mail",
|
|
3054
|
+
"elementType": "EMAIL",
|
|
3055
|
+
"values": "kripesh.mullachery@piserve.com"
|
|
3056
|
+
},
|
|
3057
|
+
{
|
|
3058
|
+
"question": "password",
|
|
3059
|
+
"elementType": "PASSWORD",
|
|
3060
|
+
"values": "Pass@123"
|
|
3061
|
+
},
|
|
3062
|
+
{
|
|
3063
|
+
"question": "rich text",
|
|
3064
|
+
"elementType": "RICH_TEXT_EDITOR",
|
|
3065
|
+
"values": "<font face=\"Arial\">sdasdsadas</font>"
|
|
3066
|
+
},
|
|
3067
|
+
{
|
|
3068
|
+
"question": "number",
|
|
3069
|
+
"elementType": "NUMBER",
|
|
3070
|
+
"values": "23"
|
|
3071
|
+
},
|
|
3072
|
+
{
|
|
3073
|
+
"question": "url",
|
|
3074
|
+
"elementType": "URL",
|
|
3075
|
+
"values": "https://www.lipsum.com/"
|
|
3076
|
+
},
|
|
3077
|
+
{
|
|
3078
|
+
"question": "dropdown",
|
|
3079
|
+
"elementType": "DROP_DOWN",
|
|
3080
|
+
"values": [
|
|
3081
|
+
"1"
|
|
3082
|
+
]
|
|
3083
|
+
},
|
|
3084
|
+
{
|
|
3085
|
+
"question": "dropdown2",
|
|
3086
|
+
"elementType": "DROP_DOWN",
|
|
3087
|
+
"values": [
|
|
3088
|
+
"b",
|
|
3089
|
+
"e"
|
|
3090
|
+
]
|
|
3091
|
+
},
|
|
3092
|
+
{
|
|
3093
|
+
"question": "radio",
|
|
3094
|
+
"elementType": "RADIO_BUTTON",
|
|
3095
|
+
"values": "1"
|
|
3096
|
+
},
|
|
3097
|
+
{
|
|
3098
|
+
"question": "check",
|
|
3099
|
+
"elementType": "CHECK_BOX",
|
|
3100
|
+
"values": [
|
|
3101
|
+
"2"
|
|
3102
|
+
]
|
|
3103
|
+
},
|
|
3104
|
+
{
|
|
3105
|
+
"question": "check2",
|
|
3106
|
+
"elementType": "CHECK_BOX",
|
|
3107
|
+
"values": [
|
|
3108
|
+
"c",
|
|
3109
|
+
"d",
|
|
3110
|
+
"e"
|
|
3111
|
+
]
|
|
3112
|
+
},
|
|
3113
|
+
{
|
|
3114
|
+
"question": "slide",
|
|
3115
|
+
"elementType": "SLIDER",
|
|
3116
|
+
"values": "60"
|
|
3117
|
+
},
|
|
3118
|
+
{
|
|
3119
|
+
"question": "matrix",
|
|
3120
|
+
"elementType": "SELECTION_MATRIX",
|
|
3121
|
+
"values": [
|
|
3122
|
+
"l1_c1",
|
|
3123
|
+
"l2_c2",
|
|
3124
|
+
"l3_c3"
|
|
3125
|
+
]
|
|
3126
|
+
},
|
|
3127
|
+
{
|
|
3128
|
+
"question": "file",
|
|
3129
|
+
"elementType": "FILE_PICKER",
|
|
3130
|
+
"attachments": [
|
|
3131
|
+
{
|
|
3132
|
+
"fileId": "a5e03507-a8d4-4403-b3cb-dc31e9329feb",
|
|
3133
|
+
"fileName": "Screenshot from 2024-02-19 15-05-17.png",
|
|
3134
|
+
"fileUrl": "http://192.168.1.150:9000/employee/Screenshot%20from%202024-02-19%2015-05-17.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=lIwtLyjUWs2TXosWpXW4%2F20240709%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20240709T084351Z&X-Amz-Expires=604800&X-Amz-SignedHeaders=host&X-Amz-Signature=31dee9b5ee3d3afac7b9e29d67f270e3beb833c57bdd733cc20f4d4d84d2f971"
|
|
3135
|
+
},
|
|
3136
|
+
{
|
|
3137
|
+
"fileId": "a5e03507-a8d4-4403-b3cb-dc31e9329feb",
|
|
3138
|
+
"fileName": "Screenshot from 2024-02-19 15-05-17.pdf",
|
|
3139
|
+
"fileUrl": "http://192.168.1.150:9000/employee/Screenshot%20from%202024-02-19%2015-05-17.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=lIwtLyjUWs2TXosWpXW4%2F20240709%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20240709T084351Z&X-Amz-Expires=604800&X-Amz-SignedHeaders=host&X-Amz-Signature=31dee9b5ee3d3afac7b9e29d67f270e3beb833c57bdd733cc20f4d4d84d2f971"
|
|
3140
|
+
}
|
|
3141
|
+
]
|
|
3142
|
+
}
|
|
3143
|
+
]
|
|
3144
|
+
};
|
|
3004
3145
|
this.updateSubForm = (pages, updatedSubForm) => {
|
|
3005
3146
|
pages.forEach((page) => {
|
|
3006
3147
|
page.rows.forEach((row) => {
|
|
@@ -3028,7 +3169,9 @@ class SubmitFormComponent {
|
|
|
3028
3169
|
});
|
|
3029
3170
|
};
|
|
3030
3171
|
const navigation = this.router.getCurrentNavigation();
|
|
3031
|
-
this.submission
|
|
3172
|
+
// this.submission= navigation?.extras.state?.['submission']
|
|
3173
|
+
this.parentQuestions = navigation?.extras.state?.['parentQuestions'];
|
|
3174
|
+
this.dataService.setParentQuestions(this.parentQuestions);
|
|
3032
3175
|
}
|
|
3033
3176
|
ngOnInit() {
|
|
3034
3177
|
if (this.edit && this.submissionId) {
|
|
@@ -3038,9 +3181,6 @@ class SubmitFormComponent {
|
|
|
3038
3181
|
this.getFormData();
|
|
3039
3182
|
}
|
|
3040
3183
|
}
|
|
3041
|
-
isImageUrl(url) {
|
|
3042
|
-
return url.match(/\.(jpeg|jpg|gif|png)$/) != null;
|
|
3043
|
-
}
|
|
3044
3184
|
getFormData() {
|
|
3045
3185
|
this.formService.getQuestions(this.moduleName).subscribe((response) => {
|
|
3046
3186
|
this.question = mapPublicFormToModel(response);
|
|
@@ -3435,13 +3575,13 @@ class SubmitFormComponent {
|
|
|
3435
3575
|
updateSubFormWithSubmissions(event) {
|
|
3436
3576
|
this.updateSubForm(this.pages, event);
|
|
3437
3577
|
}
|
|
3438
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SubmitFormComponent, deps: [{ token: FormService }, { token: i2$3.ToastrService }, { token: i3$4.Router }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
3439
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: SubmitFormComponent, selector: "lib-submit-form", inputs: { moduleName: "moduleName", edit: "edit", submissionId: "submissionId" }, outputs: { submit: "submit" }, ngImport: i0, template: "<div class=\"outer-container\">\n
|
|
3578
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SubmitFormComponent, deps: [{ token: FormService }, { token: i2$3.ToastrService }, { token: i3$4.Router }, { token: DataService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
3579
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: SubmitFormComponent, selector: "lib-submit-form", inputs: { moduleName: "moduleName", edit: "edit", submissionId: "submissionId" }, outputs: { submit: "submit" }, ngImport: i0, template: "<div class=\"outer-container\">\n \n \n <div class=\"head container\">\n <lib-header [name]=\"name\"></lib-header>\n </div>\n <div class=\"body container\">\n \n <lib-submission-container [submission]=\"submission\"></lib-submission-container>\n \n <lib-navigation-tabs\n *ngIf=\"navigation == 'TAB'\"\n [pages]=\"pages\"\n [currentPageIndex]=\"currentPageIndex\"\n (pageChanged)=\"setCurrentPage($event)\"\n (submitEmit)=\"submitForm()\"\n [edit]=\"edit\"\n (subFormChange)=\"updateSubFormWithSubmissions($event)\"\n ></lib-navigation-tabs>\n <lib-next-prev-navigation\n *ngIf=\"navigation == 'NEXT_AND_PREVIOUS_BUTTON'\"\n [currentPageIndex]=\"currentPageIndex\"\n [pages]=\"pages\"\n [previousPage]=\"previousPage\"\n [currentPage]=\"currentPage\"\n [nextPage]=\"nextPage\"\n (navigateNext)=\"navigateToNextPage()\"\n (navigatePrevious)=\"navigateToPreviousPage()\"\n (submitEmit)=\"submitForm()\"\n [edit]=\"edit\"\n (subFormChange)=\"updateSubFormWithSubmissions($event)\"\n ></lib-next-prev-navigation>\n </div>\n</div>\n", styles: [".outer-container{background-color:#fff;padding:20px;position:relative;margin-top:25px}@media (max-width: 576px){.outer-container{padding:8px}}.head{background-color:#fff;padding:0!important}.body{position:relative;z-index:1;background:#efefef;border-radius:6px}\n"], dependencies: [{ kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: HeaderComponent, selector: "lib-header", inputs: ["name"] }, { kind: "component", type: NavigationTabsComponent, selector: "lib-navigation-tabs", inputs: ["pages", "currentPageIndex", "edit"], outputs: ["pageChanged", "submitEmit", "subFormChange"] }, { kind: "component", type: NextPrevNavigationComponent, selector: "lib-next-prev-navigation", inputs: ["currentPageIndex", "pages", "previousPage", "nextPage", "currentPage", "edit"], outputs: ["navigateNext", "navigatePrevious", "submitEmit", "subFormChange"] }, { kind: "component", type: SubmissionContainerComponent, selector: "lib-submission-container", inputs: ["submission"] }] }); }
|
|
3440
3580
|
}
|
|
3441
3581
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SubmitFormComponent, decorators: [{
|
|
3442
3582
|
type: Component,
|
|
3443
|
-
args: [{ selector: 'lib-submit-form', template: "<div class=\"outer-container\">\n
|
|
3444
|
-
}], ctorParameters: function () { return [{ type: FormService }, { type: i2$3.ToastrService }, { type: i3$4.Router }]; }, propDecorators: { moduleName: [{
|
|
3583
|
+
args: [{ selector: 'lib-submit-form', template: "<div class=\"outer-container\">\n \n \n <div class=\"head container\">\n <lib-header [name]=\"name\"></lib-header>\n </div>\n <div class=\"body container\">\n \n <lib-submission-container [submission]=\"submission\"></lib-submission-container>\n \n <lib-navigation-tabs\n *ngIf=\"navigation == 'TAB'\"\n [pages]=\"pages\"\n [currentPageIndex]=\"currentPageIndex\"\n (pageChanged)=\"setCurrentPage($event)\"\n (submitEmit)=\"submitForm()\"\n [edit]=\"edit\"\n (subFormChange)=\"updateSubFormWithSubmissions($event)\"\n ></lib-navigation-tabs>\n <lib-next-prev-navigation\n *ngIf=\"navigation == 'NEXT_AND_PREVIOUS_BUTTON'\"\n [currentPageIndex]=\"currentPageIndex\"\n [pages]=\"pages\"\n [previousPage]=\"previousPage\"\n [currentPage]=\"currentPage\"\n [nextPage]=\"nextPage\"\n (navigateNext)=\"navigateToNextPage()\"\n (navigatePrevious)=\"navigateToPreviousPage()\"\n (submitEmit)=\"submitForm()\"\n [edit]=\"edit\"\n (subFormChange)=\"updateSubFormWithSubmissions($event)\"\n ></lib-next-prev-navigation>\n </div>\n</div>\n", styles: [".outer-container{background-color:#fff;padding:20px;position:relative;margin-top:25px}@media (max-width: 576px){.outer-container{padding:8px}}.head{background-color:#fff;padding:0!important}.body{position:relative;z-index:1;background:#efefef;border-radius:6px}\n"] }]
|
|
3584
|
+
}], ctorParameters: function () { return [{ type: FormService }, { type: i2$3.ToastrService }, { type: i3$4.Router }, { type: DataService }]; }, propDecorators: { moduleName: [{
|
|
3445
3585
|
type: Input
|
|
3446
3586
|
}], edit: [{
|
|
3447
3587
|
type: Input
|
|
@@ -3701,7 +3841,8 @@ class FormSubmitModule {
|
|
|
3701
3841
|
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: FormSubmitModule, declarations: [SubmitFormComponent,
|
|
3702
3842
|
HeaderComponent,
|
|
3703
3843
|
NavigationTabsComponent,
|
|
3704
|
-
NextPrevNavigationComponent
|
|
3844
|
+
NextPrevNavigationComponent,
|
|
3845
|
+
SubmissionContainerComponent], imports: [CommonModule, i3.BsDatepickerModule, ElementTypeModule,
|
|
3705
3846
|
ToastrModule], exports: [SubmitFormComponent, NextPrevNavigationComponent] }); }
|
|
3706
3847
|
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FormSubmitModule, imports: [CommonModule,
|
|
3707
3848
|
BsDatepickerModule.forRoot(),
|
|
@@ -3715,7 +3856,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
3715
3856
|
SubmitFormComponent,
|
|
3716
3857
|
HeaderComponent,
|
|
3717
3858
|
NavigationTabsComponent,
|
|
3718
|
-
NextPrevNavigationComponent
|
|
3859
|
+
NextPrevNavigationComponent,
|
|
3860
|
+
SubmissionContainerComponent
|
|
3719
3861
|
],
|
|
3720
3862
|
imports: [
|
|
3721
3863
|
CommonModule,
|