@piserve-tech/form-submission 1.2.7 → 1.2.8
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/element-type/form-elements/form-elements.component.d.ts +4 -1
- package/esm2022/element-type/form-elements/form-elements.component.mjs +10 -4
- package/esm2022/form-fields/slider-fields/slider-fields.component.mjs +2 -2
- package/esm2022/form-fields/text-fields/text-fields.component.mjs +1 -1
- package/esm2022/form-submission/navigation-tabs/navigation-tabs.component.mjs +9 -3
- package/esm2022/form-submission/next-prev-navigation/next-prev-navigation.component.mjs +9 -3
- package/esm2022/form-submission/submit-form/submit-form.component.mjs +113 -14
- package/esm2022/models/answer.model.mjs +2 -0
- package/esm2022/models/subForm.model.mjs +1 -1
- package/esm2022/models/submission.model.mjs +2 -0
- package/esm2022/services/mapper.service.mjs +17 -1
- package/esm2022/sub-form/multiple-subform/multiple-subform.component.mjs +125 -0
- package/esm2022/sub-form/sub-form/sub-form.component.mjs +39 -4
- package/esm2022/sub-form/sub-form.module.mjs +11 -5
- package/esm2022/sub-form/submission-modal/submission-modal.component.mjs +51 -0
- package/fesm2022/piserve-tech-form-submission.mjs +343 -27
- package/fesm2022/piserve-tech-form-submission.mjs.map +1 -1
- package/form-submission/navigation-tabs/navigation-tabs.component.d.ts +3 -1
- package/form-submission/next-prev-navigation/next-prev-navigation.component.d.ts +3 -1
- package/form-submission/submit-form/submit-form.component.d.ts +2 -0
- package/models/answer.model.d.ts +7 -0
- package/models/subForm.model.d.ts +4 -1
- package/models/submission.model.d.ts +5 -0
- package/package.json +1 -1
- package/sub-form/multiple-subform/multiple-subform.component.d.ts +34 -0
- package/sub-form/sub-form/sub-form.component.d.ts +8 -2
- package/sub-form/sub-form.module.d.ts +7 -4
- package/sub-form/submission-modal/submission-modal.component.d.ts +13 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Injectable, Component, Input, ViewChild, EventEmitter, Output, NgModule } from '@angular/core';
|
|
2
|
+
import { Injectable, Component, Input, ViewChild, EventEmitter, Output, Inject, NgModule } from '@angular/core';
|
|
3
3
|
import { BehaviorSubject } from 'rxjs';
|
|
4
4
|
import * as i1 from '@angular/common/http';
|
|
5
5
|
import { HttpHeaders } from '@angular/common/http';
|
|
@@ -22,6 +22,8 @@ import * as i3$2 from '@kolkov/angular-editor';
|
|
|
22
22
|
import { AngularEditorModule } from '@kolkov/angular-editor';
|
|
23
23
|
import * as i3$3 from '@angular/material/slider';
|
|
24
24
|
import { MatSliderModule } from '@angular/material/slider';
|
|
25
|
+
import * as i1$2 from '@angular/material/dialog';
|
|
26
|
+
import { MAT_DIALOG_DATA, MatDialogConfig, MatDialogModule } from '@angular/material/dialog';
|
|
25
27
|
import { FilePreviewModule } from '@piserve-tech/file-preview';
|
|
26
28
|
import { MatTabsModule } from '@angular/material/tabs';
|
|
27
29
|
import { BrowserModule } from '@angular/platform-browser';
|
|
@@ -170,10 +172,26 @@ function mapLogicToModel(apiLogic) {
|
|
|
170
172
|
function mapSubFormToModel(apiSubForm) {
|
|
171
173
|
return {
|
|
172
174
|
id: apiSubForm.id,
|
|
175
|
+
count: apiSubForm.count,
|
|
173
176
|
title: apiSubForm.title,
|
|
174
177
|
description: apiSubForm.description,
|
|
175
178
|
subFormStructure: apiSubForm.subFormStructure,
|
|
176
179
|
formElements: apiSubForm.formElements.map((element) => mapFormElementTypeToModel(element)),
|
|
180
|
+
submissions: apiSubForm?.submissions?.map((submission) => mapSubmissionToModel(submission)),
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
function mapSubmissionToModel(apiSubmission) {
|
|
184
|
+
return {
|
|
185
|
+
submissionId: apiSubmission.submissionId,
|
|
186
|
+
answers: apiSubmission?.answers?.map((answer) => mapAnswerToModel(answer)),
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
function mapAnswerToModel(apiAnswer) {
|
|
190
|
+
return {
|
|
191
|
+
questionId: apiAnswer.questionId,
|
|
192
|
+
answer: apiAnswer?.answer,
|
|
193
|
+
answerId: apiAnswer?.answerId,
|
|
194
|
+
attachments: apiAnswer?.attachments?.map((attachment) => mapAttachmentToModel(attachment)),
|
|
177
195
|
};
|
|
178
196
|
}
|
|
179
197
|
function mapFormElementTypeToModel(apiFormElementType) {
|
|
@@ -2150,7 +2168,7 @@ class SliderFieldsComponent {
|
|
|
2150
2168
|
if (this.changeSliderColor) {
|
|
2151
2169
|
this.sliderColor = this.question.formElement.appearance.sliderColor;
|
|
2152
2170
|
}
|
|
2153
|
-
if (this.question.answer) {
|
|
2171
|
+
if (this.question.answer && Object.keys(this.question.answer).length > 0) {
|
|
2154
2172
|
this.selectedValue = this.question?.answer;
|
|
2155
2173
|
}
|
|
2156
2174
|
else {
|
|
@@ -2570,18 +2588,196 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
2570
2588
|
type: Output
|
|
2571
2589
|
}] } });
|
|
2572
2590
|
|
|
2591
|
+
class SubmissionModalComponent {
|
|
2592
|
+
constructor(data, dialogRef) {
|
|
2593
|
+
this.data = data;
|
|
2594
|
+
this.dialogRef = dialogRef;
|
|
2595
|
+
}
|
|
2596
|
+
ngOnInit() {
|
|
2597
|
+
this.subForm = this.data.subForm;
|
|
2598
|
+
}
|
|
2599
|
+
closeModal() {
|
|
2600
|
+
this.dialogRef.close();
|
|
2601
|
+
}
|
|
2602
|
+
saveSubmission() {
|
|
2603
|
+
this.dialogRef.close(this.subForm);
|
|
2604
|
+
}
|
|
2605
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SubmissionModalComponent, deps: [{ token: MAT_DIALOG_DATA }, { token: i1$2.MatDialogRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2606
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: SubmissionModalComponent, selector: "lib-submission-modal", ngImport: i0, template: "<div class=\"mb-5\">\n <div class=\"modalHeader mb-4\">\n <div class=\"title-div\">\n <p class=\"title\">{{subForm.title}}</p>\n </div>\n <div class=\"header-btn\">\n <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" (click)=\"closeModal()\">\n <path d=\"M8 8L16 16\" stroke=\"#1D252D\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n <path d=\"M16 8L8 16\" stroke=\"#1D252D\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n </svg> \n </div>\n </div>\n\n <div class=\"px-3\" *ngFor=\"let formElement of subForm.formElements\">\n <div *ngIf=\"formElement.entityType === 'QUESTION'\">\n <lib-check-box-fields\n *ngIf=\"formElement.element.formElement.elementType === 'CHECK_BOX'\"\n [question]=\"formElement.element\"\n ></lib-check-box-fields>\n <lib-date-time-fields\n *ngIf=\"formElement.element.formElement.elementType === 'DATE_TIME'\"\n [question]=\"formElement.element\"\n ></lib-date-time-fields>\n <lib-drop-down-fields\n *ngIf=\"formElement.element.formElement.elementType === 'DROP_DOWN'\"\n [question]=\"formElement.element\"\n ></lib-drop-down-fields>\n <lib-file-picker-fields\n *ngIf=\"\n formElement.element.formElement.elementType === 'FILE_PICKER'\n \"\n [question]=\"formElement.element\"\n ></lib-file-picker-fields>\n <lib-location-fields\n *ngIf=\"formElement.element.formElement.elementType === 'LOCATION'\"\n [question]=\"formElement.element\"\n ></lib-location-fields>\n\n <lib-mail-fields\n *ngIf=\"formElement.element.formElement.elementType === 'EMAIL'\"\n [question]=\"formElement.element\"\n >\n </lib-mail-fields>\n <lib-mobile-fields\n *ngIf=\"formElement.element.formElement.elementType === 'MOBILE'\"\n [question]=\"formElement.element\"\n >\n </lib-mobile-fields>\n <lib-number-fields\n *ngIf=\"formElement.element.formElement.elementType === 'NUMBER'\"\n [question]=\"formElement.element\"\n >\n </lib-number-fields>\n <lib-password-fields\n *ngIf=\"formElement.element.formElement.elementType === 'PASSWORD'\"\n [question]=\"formElement.element\"\n >\n </lib-password-fields>\n <lib-radio-button-fields\n *ngIf=\"\n formElement.element.formElement.elementType === 'RADIO_BUTTON'\n \"\n [question]=\"formElement.element\"\n ></lib-radio-button-fields>\n <lib-rich-text-editor-fields\n *ngIf=\"\n formElement.element.formElement.elementType === 'RICH_TEXT_EDITOR'\n \"\n [question]=\"formElement.element\"\n ></lib-rich-text-editor-fields>\n <lib-selection-matrix-fields\n *ngIf=\"\n formElement.element.formElement.elementType === 'SELECTION_MATRIX'\n \"\n [question]=\"formElement.element\"\n ></lib-selection-matrix-fields>\n <lib-signature-fields\n *ngIf=\"formElement.element.formElement.elementType === 'SIGNATURE'\"\n [question]=\"formElement.element\"\n ></lib-signature-fields>\n <lib-slider-fields\n *ngIf=\"formElement.element.formElement.elementType === 'SLIDER'\"\n [question]=\"formElement.element\"\n ></lib-slider-fields>\n <lib-terms-and-condition-fields\n *ngIf=\"\n formElement.element.formElement.elementType ===\n 'TERMS_AND_CONDITION'\n \"\n [question]=\"formElement.element\"\n ></lib-terms-and-condition-fields>\n <lib-text-area-fields\n *ngIf=\"formElement.element.formElement.elementType === 'TEXT_AREA'\"\n [question]=\"formElement.element\"\n ></lib-text-area-fields>\n <lib-text-fields\n *ngIf=\"formElement.element.formElement.elementType === 'TEXT_BOX'\"\n [question]=\"formElement.element\"\n ></lib-text-fields>\n <lib-toggle-switch-fields\n *ngIf=\"\n formElement.element.formElement.elementType === 'TOGGLE_SWITCH'\n \"\n [question]=\"formElement.element\"\n ></lib-toggle-switch-fields>\n <lib-url-fields\n *ngIf=\"formElement.element.formElement.elementType === 'URL'\"\n [question]=\"formElement.element\"\n ></lib-url-fields>\n <lib-first-child\n *ngIf=\"formElement.element.childLogics\"\n [childLogics]=\"formElement.element.childLogics\"\n ></lib-first-child>\n </div>\n <div *ngIf=\"formElement.entityType === 'SECTION'\">\n <lib-section-fields\n [section]=\"formElement.element\"\n ></lib-section-fields>\n </div>\n </div>\n\n <div class=\"okBtn me-4\">\n <button\n class=\"submitBtn me-md-2 rounded-pill\"\n type=\"button\"\n (click)=\"saveSubmission()\">\n Ok\n </button>\n </div>\n</div>\n", styles: [".modalHeader{width:100%;display:flex;flex-direction:row}.modalHeader .title-div{width:90%;display:flex;justify-content:center;margin-top:5%}.modalHeader .title-div .title{height:24px;font-style:normal;font-weight:600;font-size:24px;font-weight:550;line-height:24px;text-align:center;color:#1d252d;letter-spacing:.5px}.modalHeader .header-btn{width:10%;margin-top:4%;display:flex;justify-content:center}.modalHeader .header-btn svg{font-size:20px;cursor:pointer}.submitBtn{background:#084fff;color:#fff;border:none;padding:10px 27px;width:auto}.okBtn{display:flex;justify-content:end;margin-left:auto;margin-bottom:5px}\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: "component", type: CheckBoxFieldsComponent, selector: "lib-check-box-fields", inputs: ["question"] }, { kind: "component", type: DateTimeFieldsComponent, selector: "lib-date-time-fields", inputs: ["question"] }, { kind: "component", type: DropDownFieldsComponent, selector: "lib-drop-down-fields", inputs: ["question"] }, { kind: "component", type: FilePickerFieldsComponent, selector: "lib-file-picker-fields", inputs: ["question"] }, { kind: "component", type: LocationFieldsComponent, selector: "lib-location-fields", inputs: ["question"] }, { kind: "component", type: MailFieldsComponent, selector: "lib-mail-fields", inputs: ["question"] }, { kind: "component", type: MobileFieldsComponent, selector: "lib-mobile-fields", inputs: ["question"] }, { kind: "component", type: NumberFieldsComponent, selector: "lib-number-fields", inputs: ["question"] }, { kind: "component", type: PasswordFieldsComponent, selector: "lib-password-fields", inputs: ["question"] }, { kind: "component", type: RadioButtonFieldsComponent, selector: "lib-radio-button-fields", inputs: ["question"] }, { kind: "component", type: RichTextEditorFieldsComponent, selector: "lib-rich-text-editor-fields", inputs: ["question"] }, { kind: "component", type: SelectionMatrixFieldsComponent, selector: "lib-selection-matrix-fields", inputs: ["question"] }, { kind: "component", type: SignatureFieldsComponent, selector: "lib-signature-fields", inputs: ["question"] }, { kind: "component", type: SliderFieldsComponent, selector: "lib-slider-fields", inputs: ["question"] }, { kind: "component", type: TermsAndConditionFieldsComponent, selector: "lib-terms-and-condition-fields", inputs: ["question"] }, { kind: "component", type: TextAreaFieldsComponent, selector: "lib-text-area-fields", inputs: ["question"] }, { kind: "component", type: TextFieldsComponent, selector: "lib-text-fields", inputs: ["question"] }, { kind: "component", type: ToggleSwitchFieldsComponent, selector: "lib-toggle-switch-fields", inputs: ["question"] }, { kind: "component", type: UrlFieldsComponent, selector: "lib-url-fields", inputs: ["question"] }, { kind: "component", type: SectionFieldsComponent, selector: "lib-section-fields", inputs: ["section"] }, { kind: "component", type: FirstChildComponent, selector: "lib-first-child", inputs: ["childLogics"] }] }); }
|
|
2607
|
+
}
|
|
2608
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SubmissionModalComponent, decorators: [{
|
|
2609
|
+
type: Component,
|
|
2610
|
+
args: [{ selector: 'lib-submission-modal', template: "<div class=\"mb-5\">\n <div class=\"modalHeader mb-4\">\n <div class=\"title-div\">\n <p class=\"title\">{{subForm.title}}</p>\n </div>\n <div class=\"header-btn\">\n <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" (click)=\"closeModal()\">\n <path d=\"M8 8L16 16\" stroke=\"#1D252D\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n <path d=\"M16 8L8 16\" stroke=\"#1D252D\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n </svg> \n </div>\n </div>\n\n <div class=\"px-3\" *ngFor=\"let formElement of subForm.formElements\">\n <div *ngIf=\"formElement.entityType === 'QUESTION'\">\n <lib-check-box-fields\n *ngIf=\"formElement.element.formElement.elementType === 'CHECK_BOX'\"\n [question]=\"formElement.element\"\n ></lib-check-box-fields>\n <lib-date-time-fields\n *ngIf=\"formElement.element.formElement.elementType === 'DATE_TIME'\"\n [question]=\"formElement.element\"\n ></lib-date-time-fields>\n <lib-drop-down-fields\n *ngIf=\"formElement.element.formElement.elementType === 'DROP_DOWN'\"\n [question]=\"formElement.element\"\n ></lib-drop-down-fields>\n <lib-file-picker-fields\n *ngIf=\"\n formElement.element.formElement.elementType === 'FILE_PICKER'\n \"\n [question]=\"formElement.element\"\n ></lib-file-picker-fields>\n <lib-location-fields\n *ngIf=\"formElement.element.formElement.elementType === 'LOCATION'\"\n [question]=\"formElement.element\"\n ></lib-location-fields>\n\n <lib-mail-fields\n *ngIf=\"formElement.element.formElement.elementType === 'EMAIL'\"\n [question]=\"formElement.element\"\n >\n </lib-mail-fields>\n <lib-mobile-fields\n *ngIf=\"formElement.element.formElement.elementType === 'MOBILE'\"\n [question]=\"formElement.element\"\n >\n </lib-mobile-fields>\n <lib-number-fields\n *ngIf=\"formElement.element.formElement.elementType === 'NUMBER'\"\n [question]=\"formElement.element\"\n >\n </lib-number-fields>\n <lib-password-fields\n *ngIf=\"formElement.element.formElement.elementType === 'PASSWORD'\"\n [question]=\"formElement.element\"\n >\n </lib-password-fields>\n <lib-radio-button-fields\n *ngIf=\"\n formElement.element.formElement.elementType === 'RADIO_BUTTON'\n \"\n [question]=\"formElement.element\"\n ></lib-radio-button-fields>\n <lib-rich-text-editor-fields\n *ngIf=\"\n formElement.element.formElement.elementType === 'RICH_TEXT_EDITOR'\n \"\n [question]=\"formElement.element\"\n ></lib-rich-text-editor-fields>\n <lib-selection-matrix-fields\n *ngIf=\"\n formElement.element.formElement.elementType === 'SELECTION_MATRIX'\n \"\n [question]=\"formElement.element\"\n ></lib-selection-matrix-fields>\n <lib-signature-fields\n *ngIf=\"formElement.element.formElement.elementType === 'SIGNATURE'\"\n [question]=\"formElement.element\"\n ></lib-signature-fields>\n <lib-slider-fields\n *ngIf=\"formElement.element.formElement.elementType === 'SLIDER'\"\n [question]=\"formElement.element\"\n ></lib-slider-fields>\n <lib-terms-and-condition-fields\n *ngIf=\"\n formElement.element.formElement.elementType ===\n 'TERMS_AND_CONDITION'\n \"\n [question]=\"formElement.element\"\n ></lib-terms-and-condition-fields>\n <lib-text-area-fields\n *ngIf=\"formElement.element.formElement.elementType === 'TEXT_AREA'\"\n [question]=\"formElement.element\"\n ></lib-text-area-fields>\n <lib-text-fields\n *ngIf=\"formElement.element.formElement.elementType === 'TEXT_BOX'\"\n [question]=\"formElement.element\"\n ></lib-text-fields>\n <lib-toggle-switch-fields\n *ngIf=\"\n formElement.element.formElement.elementType === 'TOGGLE_SWITCH'\n \"\n [question]=\"formElement.element\"\n ></lib-toggle-switch-fields>\n <lib-url-fields\n *ngIf=\"formElement.element.formElement.elementType === 'URL'\"\n [question]=\"formElement.element\"\n ></lib-url-fields>\n <lib-first-child\n *ngIf=\"formElement.element.childLogics\"\n [childLogics]=\"formElement.element.childLogics\"\n ></lib-first-child>\n </div>\n <div *ngIf=\"formElement.entityType === 'SECTION'\">\n <lib-section-fields\n [section]=\"formElement.element\"\n ></lib-section-fields>\n </div>\n </div>\n\n <div class=\"okBtn me-4\">\n <button\n class=\"submitBtn me-md-2 rounded-pill\"\n type=\"button\"\n (click)=\"saveSubmission()\">\n Ok\n </button>\n </div>\n</div>\n", styles: [".modalHeader{width:100%;display:flex;flex-direction:row}.modalHeader .title-div{width:90%;display:flex;justify-content:center;margin-top:5%}.modalHeader .title-div .title{height:24px;font-style:normal;font-weight:600;font-size:24px;font-weight:550;line-height:24px;text-align:center;color:#1d252d;letter-spacing:.5px}.modalHeader .header-btn{width:10%;margin-top:4%;display:flex;justify-content:center}.modalHeader .header-btn svg{font-size:20px;cursor:pointer}.submitBtn{background:#084fff;color:#fff;border:none;padding:10px 27px;width:auto}.okBtn{display:flex;justify-content:end;margin-left:auto;margin-bottom:5px}\n"] }]
|
|
2611
|
+
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
2612
|
+
type: Inject,
|
|
2613
|
+
args: [MAT_DIALOG_DATA]
|
|
2614
|
+
}] }, { type: i1$2.MatDialogRef }]; } });
|
|
2615
|
+
|
|
2616
|
+
class MultipleSubformComponent {
|
|
2617
|
+
constructor(dialog) {
|
|
2618
|
+
this.dialog = dialog;
|
|
2619
|
+
this.subForm = {};
|
|
2620
|
+
this.subFormChange = new EventEmitter();
|
|
2621
|
+
this.submissions = [];
|
|
2622
|
+
this.deletedSubmissions = [];
|
|
2623
|
+
}
|
|
2624
|
+
ngOnInit() {
|
|
2625
|
+
if (this.subForm?.submissions) {
|
|
2626
|
+
this.submissions = this.subForm.submissions;
|
|
2627
|
+
this.subForm.deletedSubmissions = [];
|
|
2628
|
+
}
|
|
2629
|
+
}
|
|
2630
|
+
subFormSubmission(subForm) {
|
|
2631
|
+
const answers = [];
|
|
2632
|
+
subForm.formElements.forEach((formElement) => {
|
|
2633
|
+
const answer = {
|
|
2634
|
+
questionId: formElement.element.id,
|
|
2635
|
+
answer: formElement.element?.answer || '',
|
|
2636
|
+
attachments: formElement.element.attachments,
|
|
2637
|
+
};
|
|
2638
|
+
answers.push(answer);
|
|
2639
|
+
formElement.element.answer = {};
|
|
2640
|
+
});
|
|
2641
|
+
const submission = {
|
|
2642
|
+
submissionId: '',
|
|
2643
|
+
answers: answers,
|
|
2644
|
+
};
|
|
2645
|
+
this.submissions.push(submission);
|
|
2646
|
+
this.updateSubFormWithSubmissions();
|
|
2647
|
+
}
|
|
2648
|
+
editSubFormSubmission(index, submission) {
|
|
2649
|
+
const subForm = this.bindAnswers(this.subForm, submission);
|
|
2650
|
+
const dialogConfig = new MatDialogConfig();
|
|
2651
|
+
dialogConfig.position = { top: '5%' };
|
|
2652
|
+
dialogConfig.width = '100%';
|
|
2653
|
+
dialogConfig.data = {
|
|
2654
|
+
subForm: subForm,
|
|
2655
|
+
};
|
|
2656
|
+
dialogConfig.hasBackdrop = true;
|
|
2657
|
+
dialogConfig.disableClose = true;
|
|
2658
|
+
dialogConfig.maxHeight = '80vh';
|
|
2659
|
+
const dialogRef = this.dialog.open(SubmissionModalComponent, dialogConfig);
|
|
2660
|
+
dialogRef.afterClosed().subscribe((result) => {
|
|
2661
|
+
if (result) {
|
|
2662
|
+
this.updateSubmission(result, index);
|
|
2663
|
+
}
|
|
2664
|
+
});
|
|
2665
|
+
}
|
|
2666
|
+
bindAnswers(subForm, submission) {
|
|
2667
|
+
const updatedSubForm = { ...subForm };
|
|
2668
|
+
updatedSubForm.formElements.forEach((formElement) => {
|
|
2669
|
+
const answer = submission.answers.find(a => a.questionId === formElement.element.id);
|
|
2670
|
+
if (answer) {
|
|
2671
|
+
formElement.element.answer = answer.answer;
|
|
2672
|
+
formElement.element.answerId = answer.answerId;
|
|
2673
|
+
formElement.element.attachments = answer.attachments;
|
|
2674
|
+
}
|
|
2675
|
+
});
|
|
2676
|
+
return updatedSubForm;
|
|
2677
|
+
}
|
|
2678
|
+
deleteSubForm(index) {
|
|
2679
|
+
const submission = this.submissions[index];
|
|
2680
|
+
if (submission.submissionId) {
|
|
2681
|
+
this.deletedSubmissions.push(submission.submissionId);
|
|
2682
|
+
}
|
|
2683
|
+
this.submissions.splice(index, 1);
|
|
2684
|
+
this.updateSubFormWithSubmissions();
|
|
2685
|
+
}
|
|
2686
|
+
addNewSubmission() {
|
|
2687
|
+
const dialogConfig = new MatDialogConfig();
|
|
2688
|
+
dialogConfig.position = { top: '5%' };
|
|
2689
|
+
dialogConfig.width = '100%';
|
|
2690
|
+
dialogConfig.data = {
|
|
2691
|
+
subForm: this.subForm,
|
|
2692
|
+
};
|
|
2693
|
+
dialogConfig.hasBackdrop = true;
|
|
2694
|
+
dialogConfig.disableClose = true;
|
|
2695
|
+
dialogConfig.maxHeight = '80vh';
|
|
2696
|
+
const dialogRef = this.dialog.open(SubmissionModalComponent, dialogConfig);
|
|
2697
|
+
dialogRef.afterClosed().subscribe((result) => {
|
|
2698
|
+
if (result) {
|
|
2699
|
+
this.subForm = result;
|
|
2700
|
+
this.subFormSubmission(result);
|
|
2701
|
+
}
|
|
2702
|
+
});
|
|
2703
|
+
}
|
|
2704
|
+
updateSubmission(result, index) {
|
|
2705
|
+
this.submissions[index].answers = [];
|
|
2706
|
+
result.formElements.forEach((formElement) => {
|
|
2707
|
+
const answer = {
|
|
2708
|
+
questionId: formElement.element.id,
|
|
2709
|
+
answer: formElement.element?.answer || '',
|
|
2710
|
+
answerId: formElement.element?.answerId || '',
|
|
2711
|
+
attachments: formElement.element.attachments,
|
|
2712
|
+
};
|
|
2713
|
+
formElement.element.answer = {};
|
|
2714
|
+
this.submissions[index].answers.push(answer);
|
|
2715
|
+
});
|
|
2716
|
+
this.updateSubFormWithSubmissions();
|
|
2717
|
+
}
|
|
2718
|
+
updateSubFormWithSubmissions() {
|
|
2719
|
+
this.subForm.submissions = this.submissions;
|
|
2720
|
+
this.subForm.deletedSubmissions = this.deletedSubmissions;
|
|
2721
|
+
this.subFormChange.emit(this.subForm);
|
|
2722
|
+
}
|
|
2723
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: MultipleSubformComponent, deps: [{ token: i1$2.MatDialog }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2724
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: MultipleSubformComponent, selector: "lib-multiple-subform", inputs: { subForm: "subForm" }, outputs: { subFormChange: "subFormChange" }, ngImport: i0, template: "<div class=\"mb-4\">\n <table class=\"table table-bordered border border-2\">\n <tr>\n <th\n class=\"border border-1\"\n *ngFor=\"let formElement of subForm.formElements\"\n >\n {{ formElement.element.question }}\n </th>\n <th></th>\n </tr>\n <tr *ngFor=\"let submission of submissions; let i = index\">\n <td class=\"border border-1\" *ngFor=\"let answer of submission.answers\">{{answer.answer}}</td>\n <td class=\"text-center\">\n <button class=\"border border-0 p-0 me-2\" (click)=\"editSubFormSubmission(i,submission)\">\n <svg width=\"29\" height=\"28\" viewBox=\"0 0 29 28\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <rect x=\"0.5\" y=\"0.5\" width=\"28\" height=\"26.4737\" rx=\"5.5\" fill=\"white\" stroke=\"#D8D8D8\"/>\n <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M12.0009 19.0787H9.1582V16.2361C9.1582 15.9447 9.2739 15.6653 9.47999 15.4593L16.2224 8.71686C16.4284 8.5105 16.708 8.39453 16.9995 8.39453C17.2911 8.39453 17.5707 8.5105 17.7767 8.71686L19.5201 10.4603C19.7264 10.6663 19.8424 10.9458 19.8424 11.2374C19.8424 11.529 19.7264 11.8086 19.5201 12.0145L12.7777 18.757C12.5715 18.9628 12.2922 19.0785 12.0009 19.0787Z\" stroke=\"#084FFF\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n <path d=\"M15.1704 10.3984L17.8415 13.0695\" stroke=\"#084FFF\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n </svg> \n </button>\n <button class=\"border border-0 p-0\" (click) = \"deleteSubForm(i)\" >\n <svg width=\"29\" height=\"28\" viewBox=\"0 0 29 28\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <rect x=\"0.5\" y=\"0.5\" width=\"27.6402\" height=\"26.1328\" rx=\"5.5\" fill=\"white\" stroke=\"#D8D8D8\"/>\n <path d=\"M8.60449 9.20637H20.0354\" stroke=\"#084FFF\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n <path d=\"M19.2189 9.20703V17.7863C19.2189 18.6482 18.4881 19.3462 17.5859 19.3462H11.0539C10.1517 19.3462 9.4209 18.6482 9.4209 17.7863V9.20703\" stroke=\"#084FFF\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n <path d=\"M16.7696 6.67122H11.8706\" stroke=\"#084FFF\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n <path d=\"M12.6871 12.3242V16.2239\" stroke=\"#084FFF\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n <path d=\"M15.9532 12.3242V16.2239\" stroke=\"#084FFF\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n </svg>\n \n </button>\n </td>\n </tr>\n </table>\n <div class=\"footer\">\n <div class=\"addNewBtn\" (click)=\"addNewSubmission()\">\n <svg\n width=\"15\"\n height=\"14\"\n viewBox=\"0 0 15 14\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M12.5556 13.2778H2.44444C1.64639 13.2778 1 12.6673 1 11.9136V2.3642C1 1.61048 1.64639 1 2.44444 1H12.5556C13.3536 1 14 1.61048 14 2.3642V11.9136C14 12.6673 13.3536 13.2778 12.5556 13.2778Z\"\n stroke=\"#D8D8D8\"\n stroke-width=\"0.8\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n <path\n d=\"M5.3335 7.50347H9.66683\"\n stroke=\"#084FFF\"\n stroke-width=\"0.8\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n <path\n d=\"M7.50005 5.33594V9.66927\"\n stroke=\"#084FFF\"\n stroke-width=\"0.8\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg> \n <a class=\"ms-2 text-decoration-none\">Add New</a>\n </div>\n </div>\n \n \n</div>\n", styles: [".footer{display:flex;justify-content:flex-end;align-items:center;cursor:pointer}\n"], dependencies: [{ kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] }); }
|
|
2725
|
+
}
|
|
2726
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: MultipleSubformComponent, decorators: [{
|
|
2727
|
+
type: Component,
|
|
2728
|
+
args: [{ selector: 'lib-multiple-subform', template: "<div class=\"mb-4\">\n <table class=\"table table-bordered border border-2\">\n <tr>\n <th\n class=\"border border-1\"\n *ngFor=\"let formElement of subForm.formElements\"\n >\n {{ formElement.element.question }}\n </th>\n <th></th>\n </tr>\n <tr *ngFor=\"let submission of submissions; let i = index\">\n <td class=\"border border-1\" *ngFor=\"let answer of submission.answers\">{{answer.answer}}</td>\n <td class=\"text-center\">\n <button class=\"border border-0 p-0 me-2\" (click)=\"editSubFormSubmission(i,submission)\">\n <svg width=\"29\" height=\"28\" viewBox=\"0 0 29 28\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <rect x=\"0.5\" y=\"0.5\" width=\"28\" height=\"26.4737\" rx=\"5.5\" fill=\"white\" stroke=\"#D8D8D8\"/>\n <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M12.0009 19.0787H9.1582V16.2361C9.1582 15.9447 9.2739 15.6653 9.47999 15.4593L16.2224 8.71686C16.4284 8.5105 16.708 8.39453 16.9995 8.39453C17.2911 8.39453 17.5707 8.5105 17.7767 8.71686L19.5201 10.4603C19.7264 10.6663 19.8424 10.9458 19.8424 11.2374C19.8424 11.529 19.7264 11.8086 19.5201 12.0145L12.7777 18.757C12.5715 18.9628 12.2922 19.0785 12.0009 19.0787Z\" stroke=\"#084FFF\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n <path d=\"M15.1704 10.3984L17.8415 13.0695\" stroke=\"#084FFF\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n </svg> \n </button>\n <button class=\"border border-0 p-0\" (click) = \"deleteSubForm(i)\" >\n <svg width=\"29\" height=\"28\" viewBox=\"0 0 29 28\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <rect x=\"0.5\" y=\"0.5\" width=\"27.6402\" height=\"26.1328\" rx=\"5.5\" fill=\"white\" stroke=\"#D8D8D8\"/>\n <path d=\"M8.60449 9.20637H20.0354\" stroke=\"#084FFF\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n <path d=\"M19.2189 9.20703V17.7863C19.2189 18.6482 18.4881 19.3462 17.5859 19.3462H11.0539C10.1517 19.3462 9.4209 18.6482 9.4209 17.7863V9.20703\" stroke=\"#084FFF\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n <path d=\"M16.7696 6.67122H11.8706\" stroke=\"#084FFF\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n <path d=\"M12.6871 12.3242V16.2239\" stroke=\"#084FFF\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n <path d=\"M15.9532 12.3242V16.2239\" stroke=\"#084FFF\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n </svg>\n \n </button>\n </td>\n </tr>\n </table>\n <div class=\"footer\">\n <div class=\"addNewBtn\" (click)=\"addNewSubmission()\">\n <svg\n width=\"15\"\n height=\"14\"\n viewBox=\"0 0 15 14\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M12.5556 13.2778H2.44444C1.64639 13.2778 1 12.6673 1 11.9136V2.3642C1 1.61048 1.64639 1 2.44444 1H12.5556C13.3536 1 14 1.61048 14 2.3642V11.9136C14 12.6673 13.3536 13.2778 12.5556 13.2778Z\"\n stroke=\"#D8D8D8\"\n stroke-width=\"0.8\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n <path\n d=\"M5.3335 7.50347H9.66683\"\n stroke=\"#084FFF\"\n stroke-width=\"0.8\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n <path\n d=\"M7.50005 5.33594V9.66927\"\n stroke=\"#084FFF\"\n stroke-width=\"0.8\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg> \n <a class=\"ms-2 text-decoration-none\">Add New</a>\n </div>\n </div>\n \n \n</div>\n", styles: [".footer{display:flex;justify-content:flex-end;align-items:center;cursor:pointer}\n"] }]
|
|
2729
|
+
}], ctorParameters: function () { return [{ type: i1$2.MatDialog }]; }, propDecorators: { subForm: [{
|
|
2730
|
+
type: Input
|
|
2731
|
+
}], subFormChange: [{
|
|
2732
|
+
type: Output
|
|
2733
|
+
}] } });
|
|
2734
|
+
|
|
2573
2735
|
class SubFormComponent {
|
|
2574
2736
|
constructor() {
|
|
2575
2737
|
this.subForm = {};
|
|
2738
|
+
this.edit = false;
|
|
2739
|
+
this.subFormChange = new EventEmitter();
|
|
2740
|
+
}
|
|
2741
|
+
ngOnInit() {
|
|
2742
|
+
if (this.subForm.subFormStructure == 'single') {
|
|
2743
|
+
this.bindAnswersToFormElements();
|
|
2744
|
+
}
|
|
2745
|
+
}
|
|
2746
|
+
bindAnswersToFormElements() {
|
|
2747
|
+
if (this.subForm && this.subForm.formElements && this.subForm.submissions) {
|
|
2748
|
+
this.subForm.formElements.forEach((formElement) => {
|
|
2749
|
+
if (formElement.entityType === 'QUESTION') {
|
|
2750
|
+
const submission = this.subForm.submissions.find((sub) => sub.answers.some((ans) => ans.questionId === formElement.element.id));
|
|
2751
|
+
if (submission) {
|
|
2752
|
+
const answer = submission.answers.find((ans) => ans.questionId === formElement.element.id);
|
|
2753
|
+
if (answer) {
|
|
2754
|
+
formElement.element.answer = answer.answer;
|
|
2755
|
+
formElement.element.answerId = answer.answerId;
|
|
2756
|
+
formElement.element.validation = true;
|
|
2757
|
+
formElement.element.attachments = answer.attachments;
|
|
2758
|
+
this.subForm.submissionId = submission.submissionId;
|
|
2759
|
+
}
|
|
2760
|
+
}
|
|
2761
|
+
}
|
|
2762
|
+
});
|
|
2763
|
+
}
|
|
2764
|
+
}
|
|
2765
|
+
updateSubFormWithSubmissions(event) {
|
|
2766
|
+
this.subForm = event;
|
|
2767
|
+
this.subFormChange.emit(this.subForm);
|
|
2576
2768
|
}
|
|
2577
2769
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SubFormComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2578
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: SubFormComponent, selector: "lib-sub-form", inputs: { subForm: "subForm" }, ngImport: i0, template: "<div class=\"outer-container mb-4 px-3\">\n <div class=\"body container pt-3 pb-3 px-3\">\n <div class=\"tab-content pt-4 pb-3 px-3\">\n <p class=\"sectionTitle\">{{subForm.title}}</p>\n <p [innerHTML]=\"subForm.description\" class=\"description mb-5\"></p>\n\n
|
|
2770
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: SubFormComponent, selector: "lib-sub-form", inputs: { subForm: "subForm", edit: "edit" }, outputs: { subFormChange: "subFormChange" }, ngImport: i0, template: "<div class=\"outer-container mb-4 px-3\">\n <div class=\"body container pt-3 pb-3 px-3\">\n <div class=\"tab-content pt-4 pb-3 px-3\">\n <p class=\"sectionTitle\">{{ subForm.title }}</p>\n <p [innerHTML]=\"subForm.description\" class=\"description mb-5\"></p>\n\n <div *ngIf=\"subForm.subFormStructure == 'multiple'\">\n <lib-multiple-subform\n [subForm]=\"subForm\"\n (subFormChange)=\"updateSubFormWithSubmissions($event)\"\n ></lib-multiple-subform>\n </div>\n <div *ngIf=\"subForm.subFormStructure == 'single'\">\n <div *ngFor=\"let formElement of subForm.formElements\">\n <div *ngIf=\"formElement.entityType === 'QUESTION'\">\n <lib-check-box-fields\n *ngIf=\"formElement.element.formElement.elementType === 'CHECK_BOX'\"\n [question]=\"formElement.element\"\n ></lib-check-box-fields>\n <lib-date-time-fields\n *ngIf=\"formElement.element.formElement.elementType === 'DATE_TIME'\"\n [question]=\"formElement.element\"\n ></lib-date-time-fields>\n <lib-drop-down-fields\n *ngIf=\"formElement.element.formElement.elementType === 'DROP_DOWN'\"\n [question]=\"formElement.element\"\n ></lib-drop-down-fields>\n <lib-file-picker-fields\n *ngIf=\"\n formElement.element.formElement.elementType === 'FILE_PICKER'\n \"\n [question]=\"formElement.element\"\n ></lib-file-picker-fields>\n <lib-location-fields\n *ngIf=\"formElement.element.formElement.elementType === 'LOCATION'\"\n [question]=\"formElement.element\"\n ></lib-location-fields>\n\n <lib-mail-fields\n *ngIf=\"formElement.element.formElement.elementType === 'EMAIL'\"\n [question]=\"formElement.element\"\n >\n </lib-mail-fields>\n <lib-mobile-fields\n *ngIf=\"formElement.element.formElement.elementType === 'MOBILE'\"\n [question]=\"formElement.element\"\n >\n </lib-mobile-fields>\n <lib-number-fields\n *ngIf=\"formElement.element.formElement.elementType === 'NUMBER'\"\n [question]=\"formElement.element\"\n >\n </lib-number-fields>\n <lib-password-fields\n *ngIf=\"formElement.element.formElement.elementType === 'PASSWORD'\"\n [question]=\"formElement.element\"\n >\n </lib-password-fields>\n <lib-radio-button-fields\n *ngIf=\"\n formElement.element.formElement.elementType === 'RADIO_BUTTON'\n \"\n [question]=\"formElement.element\"\n ></lib-radio-button-fields>\n <lib-rich-text-editor-fields\n *ngIf=\"\n formElement.element.formElement.elementType === 'RICH_TEXT_EDITOR'\n \"\n [question]=\"formElement.element\"\n ></lib-rich-text-editor-fields>\n <lib-selection-matrix-fields\n *ngIf=\"\n formElement.element.formElement.elementType === 'SELECTION_MATRIX'\n \"\n [question]=\"formElement.element\"\n ></lib-selection-matrix-fields>\n <lib-signature-fields\n *ngIf=\"formElement.element.formElement.elementType === 'SIGNATURE'\"\n [question]=\"formElement.element\"\n ></lib-signature-fields>\n <lib-slider-fields\n *ngIf=\"formElement.element.formElement.elementType === 'SLIDER'\"\n [question]=\"formElement.element\"\n ></lib-slider-fields>\n <lib-terms-and-condition-fields\n *ngIf=\"\n formElement.element.formElement.elementType ===\n 'TERMS_AND_CONDITION'\n \"\n [question]=\"formElement.element\"\n ></lib-terms-and-condition-fields>\n <lib-text-area-fields\n *ngIf=\"formElement.element.formElement.elementType === 'TEXT_AREA'\"\n [question]=\"formElement.element\"\n ></lib-text-area-fields>\n <lib-text-fields\n *ngIf=\"formElement.element.formElement.elementType === 'TEXT_BOX'\"\n [question]=\"formElement.element\"\n ></lib-text-fields>\n <lib-toggle-switch-fields\n *ngIf=\"\n formElement.element.formElement.elementType === 'TOGGLE_SWITCH'\n \"\n [question]=\"formElement.element\"\n ></lib-toggle-switch-fields>\n <lib-url-fields\n *ngIf=\"formElement.element.formElement.elementType === 'URL'\"\n [question]=\"formElement.element\"\n ></lib-url-fields>\n <lib-first-child\n *ngIf=\"formElement.element.childLogics\"\n [childLogics]=\"formElement.element.childLogics\"\n ></lib-first-child>\n </div>\n <div *ngIf=\"formElement.entityType === 'SECTION'\">\n <lib-section-fields\n [section]=\"formElement.element\"\n ></lib-section-fields>\n </div>\n </div>\n </div>\n </div>\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}}.body{position:relative;z-index:1;background:#efefef;border-radius:6px}.tab-content{background-color:#fff}.sectionTitle{font-size:15px;font-weight:500}\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: "component", type: CheckBoxFieldsComponent, selector: "lib-check-box-fields", inputs: ["question"] }, { kind: "component", type: DateTimeFieldsComponent, selector: "lib-date-time-fields", inputs: ["question"] }, { kind: "component", type: DropDownFieldsComponent, selector: "lib-drop-down-fields", inputs: ["question"] }, { kind: "component", type: FilePickerFieldsComponent, selector: "lib-file-picker-fields", inputs: ["question"] }, { kind: "component", type: LocationFieldsComponent, selector: "lib-location-fields", inputs: ["question"] }, { kind: "component", type: MailFieldsComponent, selector: "lib-mail-fields", inputs: ["question"] }, { kind: "component", type: MobileFieldsComponent, selector: "lib-mobile-fields", inputs: ["question"] }, { kind: "component", type: NumberFieldsComponent, selector: "lib-number-fields", inputs: ["question"] }, { kind: "component", type: PasswordFieldsComponent, selector: "lib-password-fields", inputs: ["question"] }, { kind: "component", type: RadioButtonFieldsComponent, selector: "lib-radio-button-fields", inputs: ["question"] }, { kind: "component", type: RichTextEditorFieldsComponent, selector: "lib-rich-text-editor-fields", inputs: ["question"] }, { kind: "component", type: SelectionMatrixFieldsComponent, selector: "lib-selection-matrix-fields", inputs: ["question"] }, { kind: "component", type: SignatureFieldsComponent, selector: "lib-signature-fields", inputs: ["question"] }, { kind: "component", type: SliderFieldsComponent, selector: "lib-slider-fields", inputs: ["question"] }, { kind: "component", type: TermsAndConditionFieldsComponent, selector: "lib-terms-and-condition-fields", inputs: ["question"] }, { kind: "component", type: TextAreaFieldsComponent, selector: "lib-text-area-fields", inputs: ["question"] }, { kind: "component", type: TextFieldsComponent, selector: "lib-text-fields", inputs: ["question"] }, { kind: "component", type: ToggleSwitchFieldsComponent, selector: "lib-toggle-switch-fields", inputs: ["question"] }, { kind: "component", type: UrlFieldsComponent, selector: "lib-url-fields", inputs: ["question"] }, { kind: "component", type: SectionFieldsComponent, selector: "lib-section-fields", inputs: ["section"] }, { kind: "component", type: FirstChildComponent, selector: "lib-first-child", inputs: ["childLogics"] }, { kind: "component", type: MultipleSubformComponent, selector: "lib-multiple-subform", inputs: ["subForm"], outputs: ["subFormChange"] }] }); }
|
|
2579
2771
|
}
|
|
2580
2772
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SubFormComponent, decorators: [{
|
|
2581
2773
|
type: Component,
|
|
2582
|
-
args: [{ selector: 'lib-sub-form', template: "<div class=\"outer-container mb-4 px-3\">\n <div class=\"body container pt-3 pb-3 px-3\">\n <div class=\"tab-content pt-4 pb-3 px-3\">\n <p class=\"sectionTitle\">{{subForm.title}}</p>\n <p [innerHTML]=\"subForm.description\" class=\"description mb-5\"></p>\n\n
|
|
2774
|
+
args: [{ selector: 'lib-sub-form', template: "<div class=\"outer-container mb-4 px-3\">\n <div class=\"body container pt-3 pb-3 px-3\">\n <div class=\"tab-content pt-4 pb-3 px-3\">\n <p class=\"sectionTitle\">{{ subForm.title }}</p>\n <p [innerHTML]=\"subForm.description\" class=\"description mb-5\"></p>\n\n <div *ngIf=\"subForm.subFormStructure == 'multiple'\">\n <lib-multiple-subform\n [subForm]=\"subForm\"\n (subFormChange)=\"updateSubFormWithSubmissions($event)\"\n ></lib-multiple-subform>\n </div>\n <div *ngIf=\"subForm.subFormStructure == 'single'\">\n <div *ngFor=\"let formElement of subForm.formElements\">\n <div *ngIf=\"formElement.entityType === 'QUESTION'\">\n <lib-check-box-fields\n *ngIf=\"formElement.element.formElement.elementType === 'CHECK_BOX'\"\n [question]=\"formElement.element\"\n ></lib-check-box-fields>\n <lib-date-time-fields\n *ngIf=\"formElement.element.formElement.elementType === 'DATE_TIME'\"\n [question]=\"formElement.element\"\n ></lib-date-time-fields>\n <lib-drop-down-fields\n *ngIf=\"formElement.element.formElement.elementType === 'DROP_DOWN'\"\n [question]=\"formElement.element\"\n ></lib-drop-down-fields>\n <lib-file-picker-fields\n *ngIf=\"\n formElement.element.formElement.elementType === 'FILE_PICKER'\n \"\n [question]=\"formElement.element\"\n ></lib-file-picker-fields>\n <lib-location-fields\n *ngIf=\"formElement.element.formElement.elementType === 'LOCATION'\"\n [question]=\"formElement.element\"\n ></lib-location-fields>\n\n <lib-mail-fields\n *ngIf=\"formElement.element.formElement.elementType === 'EMAIL'\"\n [question]=\"formElement.element\"\n >\n </lib-mail-fields>\n <lib-mobile-fields\n *ngIf=\"formElement.element.formElement.elementType === 'MOBILE'\"\n [question]=\"formElement.element\"\n >\n </lib-mobile-fields>\n <lib-number-fields\n *ngIf=\"formElement.element.formElement.elementType === 'NUMBER'\"\n [question]=\"formElement.element\"\n >\n </lib-number-fields>\n <lib-password-fields\n *ngIf=\"formElement.element.formElement.elementType === 'PASSWORD'\"\n [question]=\"formElement.element\"\n >\n </lib-password-fields>\n <lib-radio-button-fields\n *ngIf=\"\n formElement.element.formElement.elementType === 'RADIO_BUTTON'\n \"\n [question]=\"formElement.element\"\n ></lib-radio-button-fields>\n <lib-rich-text-editor-fields\n *ngIf=\"\n formElement.element.formElement.elementType === 'RICH_TEXT_EDITOR'\n \"\n [question]=\"formElement.element\"\n ></lib-rich-text-editor-fields>\n <lib-selection-matrix-fields\n *ngIf=\"\n formElement.element.formElement.elementType === 'SELECTION_MATRIX'\n \"\n [question]=\"formElement.element\"\n ></lib-selection-matrix-fields>\n <lib-signature-fields\n *ngIf=\"formElement.element.formElement.elementType === 'SIGNATURE'\"\n [question]=\"formElement.element\"\n ></lib-signature-fields>\n <lib-slider-fields\n *ngIf=\"formElement.element.formElement.elementType === 'SLIDER'\"\n [question]=\"formElement.element\"\n ></lib-slider-fields>\n <lib-terms-and-condition-fields\n *ngIf=\"\n formElement.element.formElement.elementType ===\n 'TERMS_AND_CONDITION'\n \"\n [question]=\"formElement.element\"\n ></lib-terms-and-condition-fields>\n <lib-text-area-fields\n *ngIf=\"formElement.element.formElement.elementType === 'TEXT_AREA'\"\n [question]=\"formElement.element\"\n ></lib-text-area-fields>\n <lib-text-fields\n *ngIf=\"formElement.element.formElement.elementType === 'TEXT_BOX'\"\n [question]=\"formElement.element\"\n ></lib-text-fields>\n <lib-toggle-switch-fields\n *ngIf=\"\n formElement.element.formElement.elementType === 'TOGGLE_SWITCH'\n \"\n [question]=\"formElement.element\"\n ></lib-toggle-switch-fields>\n <lib-url-fields\n *ngIf=\"formElement.element.formElement.elementType === 'URL'\"\n [question]=\"formElement.element\"\n ></lib-url-fields>\n <lib-first-child\n *ngIf=\"formElement.element.childLogics\"\n [childLogics]=\"formElement.element.childLogics\"\n ></lib-first-child>\n </div>\n <div *ngIf=\"formElement.entityType === 'SECTION'\">\n <lib-section-fields\n [section]=\"formElement.element\"\n ></lib-section-fields>\n </div>\n </div>\n </div>\n </div>\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}}.body{position:relative;z-index:1;background:#efefef;border-radius:6px}.tab-content{background-color:#fff}.sectionTitle{font-size:15px;font-weight:500}\n"] }]
|
|
2583
2775
|
}], propDecorators: { subForm: [{
|
|
2584
2776
|
type: Input
|
|
2777
|
+
}], edit: [{
|
|
2778
|
+
type: Input
|
|
2779
|
+
}], subFormChange: [{
|
|
2780
|
+
type: Output
|
|
2585
2781
|
}] } });
|
|
2586
2782
|
|
|
2587
2783
|
class FormElementsComponent {
|
|
@@ -2589,19 +2785,25 @@ class FormElementsComponent {
|
|
|
2589
2785
|
this.grid = {};
|
|
2590
2786
|
this.currentPageIndex = 0;
|
|
2591
2787
|
this.edit = false;
|
|
2788
|
+
this.subFormChange = new EventEmitter();
|
|
2789
|
+
}
|
|
2790
|
+
updateSubFormWithSubmissions(event) {
|
|
2791
|
+
this.subFormChange.emit(event);
|
|
2592
2792
|
}
|
|
2593
2793
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FormElementsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2594
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: FormElementsComponent, selector: "lib-form-elements", inputs: { grid: "grid", currentPageIndex: "currentPageIndex", edit: "edit" }, ngImport: i0, template: "<div *ngIf=\"grid.entityType === 'QUESTION'\">\n <lib-question [question]=\"grid?.element\"\n [currentPageIndex]=\"currentPageIndex\"\n [edit]=\"edit\"\n ></lib-question>\n</div>\n<div *ngIf=\"grid.entityType === 'SECTION'\">\n <lib-section-fields [section]=\"grid.element\"></lib-section-fields>\n</div>\n<div *ngIf=\"grid.entityType === 'SUBFORM'\">\n <lib-sub-form [subForm]=\"grid.element\"></lib-sub-form>\n</div>\n", styles: [""], dependencies: [{ kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: QuestionComponent, selector: "lib-question", inputs: ["question", "edit", "currentPageIndex"], outputs: ["emitValidations"] }, { kind: "component", type: SectionFieldsComponent, selector: "lib-section-fields", inputs: ["section"] }, { kind: "component", type: SubFormComponent, selector: "lib-sub-form", inputs: ["subForm"] }] }); }
|
|
2794
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: FormElementsComponent, selector: "lib-form-elements", inputs: { grid: "grid", currentPageIndex: "currentPageIndex", edit: "edit" }, outputs: { subFormChange: "subFormChange" }, ngImport: i0, template: "<div *ngIf=\"grid.entityType === 'QUESTION'\">\n <lib-question [question]=\"grid?.element\"\n [currentPageIndex]=\"currentPageIndex\"\n [edit]=\"edit\"\n ></lib-question>\n</div>\n<div *ngIf=\"grid.entityType === 'SECTION'\">\n <lib-section-fields [section]=\"grid.element\"></lib-section-fields>\n</div>\n<div *ngIf=\"grid.entityType === 'SUBFORM'\">\n <lib-sub-form [subForm]=\"grid.element\"\n (subFormChange)=\"updateSubFormWithSubmissions($event)\"\n ></lib-sub-form>\n</div>\n", styles: [""], dependencies: [{ kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: QuestionComponent, selector: "lib-question", inputs: ["question", "edit", "currentPageIndex"], outputs: ["emitValidations"] }, { kind: "component", type: SectionFieldsComponent, selector: "lib-section-fields", inputs: ["section"] }, { kind: "component", type: SubFormComponent, selector: "lib-sub-form", inputs: ["subForm", "edit"], outputs: ["subFormChange"] }] }); }
|
|
2595
2795
|
}
|
|
2596
2796
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FormElementsComponent, decorators: [{
|
|
2597
2797
|
type: Component,
|
|
2598
|
-
args: [{ selector: 'lib-form-elements', template: "<div *ngIf=\"grid.entityType === 'QUESTION'\">\n <lib-question [question]=\"grid?.element\"\n [currentPageIndex]=\"currentPageIndex\"\n [edit]=\"edit\"\n ></lib-question>\n</div>\n<div *ngIf=\"grid.entityType === 'SECTION'\">\n <lib-section-fields [section]=\"grid.element\"></lib-section-fields>\n</div>\n<div *ngIf=\"grid.entityType === 'SUBFORM'\">\n <lib-sub-form [subForm]=\"grid.element\"></lib-sub-form>\n</div>\n" }]
|
|
2798
|
+
args: [{ selector: 'lib-form-elements', template: "<div *ngIf=\"grid.entityType === 'QUESTION'\">\n <lib-question [question]=\"grid?.element\"\n [currentPageIndex]=\"currentPageIndex\"\n [edit]=\"edit\"\n ></lib-question>\n</div>\n<div *ngIf=\"grid.entityType === 'SECTION'\">\n <lib-section-fields [section]=\"grid.element\"></lib-section-fields>\n</div>\n<div *ngIf=\"grid.entityType === 'SUBFORM'\">\n <lib-sub-form [subForm]=\"grid.element\"\n (subFormChange)=\"updateSubFormWithSubmissions($event)\"\n ></lib-sub-form>\n</div>\n" }]
|
|
2599
2799
|
}], propDecorators: { grid: [{
|
|
2600
2800
|
type: Input
|
|
2601
2801
|
}], currentPageIndex: [{
|
|
2602
2802
|
type: Input
|
|
2603
2803
|
}], edit: [{
|
|
2604
2804
|
type: Input
|
|
2805
|
+
}], subFormChange: [{
|
|
2806
|
+
type: Output
|
|
2605
2807
|
}] } });
|
|
2606
2808
|
|
|
2607
2809
|
class NavigationTabsComponent {
|
|
@@ -2611,6 +2813,10 @@ class NavigationTabsComponent {
|
|
|
2611
2813
|
this.pageChanged = new EventEmitter();
|
|
2612
2814
|
this.submitEmit = new EventEmitter();
|
|
2613
2815
|
this.edit = false;
|
|
2816
|
+
this.subFormChange = new EventEmitter();
|
|
2817
|
+
}
|
|
2818
|
+
updateSubFormWithSubmissions(event) {
|
|
2819
|
+
this.subFormChange.emit(event);
|
|
2614
2820
|
}
|
|
2615
2821
|
setCurrentPage(index) {
|
|
2616
2822
|
this.pageChanged.emit(index);
|
|
@@ -2619,11 +2825,11 @@ class NavigationTabsComponent {
|
|
|
2619
2825
|
this.submitEmit.emit();
|
|
2620
2826
|
}
|
|
2621
2827
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NavigationTabsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2622
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: NavigationTabsComponent, selector: "lib-navigation-tabs", inputs: { pages: "pages", currentPageIndex: "currentPageIndex", edit: "edit" }, outputs: { pageChanged: "pageChanged", submitEmit: "submitEmit" }, ngImport: i0, template: "<div class=\"tab-inner-container\">\n <ul class=\"nav nav-tabs navTabs\" id=\"myTab\" role=\"tablist\">\n <li\n class=\"nav-item\"\n role=\"presentation\"\n *ngFor=\"let page of pages; let i = index\"\n >\n <button\n class=\"nav-link\"\n [class.active]=\"i === currentPageIndex\"\n id=\"tab-{{ i }}\"\n [attr.data-bs-toggle]=\"'tab'\"\n [attr.data-bs-target]=\"'#content-' + i\"\n type=\"button\"\n role=\"tab\"\n [attr.aria-controls]=\"'content-' + i\"\n [attr.aria-selected]=\"i === 0\"\n (click)=\"setCurrentPage(i)\"\n >\n {{ page.title }}\n </button>\n </li>\n </ul>\n\n <div class=\"tab-content pt-5 pb-3 px-1\">\n <div\n *ngFor=\"let page of pages; let i = index\"\n class=\"tab-pane fade\"\n [class.show]=\"i === 0\"\n [class.active]=\"i === 0\"\n id=\"content-{{ i }}\"\n role=\"tabpanel\"\n [attr.aria-labelledby]=\"'tab-' + i\"\n >\n <div *ngFor=\"let row of page.rows\">\n <div class=\"margin\">\n <div *ngFor=\"let grid of row.grid\">\n <lib-form-elements\n [grid]=\"grid\"\n [edit]=\"edit\"\n ></lib-form-elements>\n </div>\n </div>\n </div>\n <div\n *ngIf=\"currentPageIndex == pages.length - 1\"\n class=\"footerButton d-flex justify-content-end\"\n >\n <button\n class=\"btn btn-primary me-md-2 rounded-pill\"\n type=\"button\"\n (click)=\"submitForm()\"\n >\n Submit\n </button>\n </div>\n </div>\n </div>\n</div>\n", styles: [".tab-inner-container{width:100%;position:relative;padding:3rem}@media (max-width: 1024px){.tab-inner-container{padding-left:1rem;padding-right:1rem}}@media (max-width: 576px){.tab-inner-container{padding:2rem .5rem}}.navTabs{overflow-x:auto;overflow-y:hidden;flex-wrap:unset;margin:0 0 -1px!important}.nav-item{background-color:#fff;border-radius:5px;margin-right:.5%}.nav-link{position:relative;margin-bottom:-2px}.nav-link:after{content:\"\";position:absolute;left:0;bottom:0;width:101%;height:6px;background:#efefef}.nav-link.active:after{display:none}.tab-content{background-color:#fff}\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: "component", type: FormElementsComponent, selector: "lib-form-elements", inputs: ["grid", "currentPageIndex", "edit"] }] }); }
|
|
2828
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: NavigationTabsComponent, selector: "lib-navigation-tabs", inputs: { pages: "pages", currentPageIndex: "currentPageIndex", edit: "edit" }, outputs: { pageChanged: "pageChanged", submitEmit: "submitEmit", subFormChange: "subFormChange" }, ngImport: i0, template: "<div class=\"tab-inner-container\">\n <ul class=\"nav nav-tabs navTabs\" id=\"myTab\" role=\"tablist\">\n <li\n class=\"nav-item\"\n role=\"presentation\"\n *ngFor=\"let page of pages; let i = index\"\n >\n <button\n class=\"nav-link\"\n [class.active]=\"i === currentPageIndex\"\n id=\"tab-{{ i }}\"\n [attr.data-bs-toggle]=\"'tab'\"\n [attr.data-bs-target]=\"'#content-' + i\"\n type=\"button\"\n role=\"tab\"\n [attr.aria-controls]=\"'content-' + i\"\n [attr.aria-selected]=\"i === 0\"\n (click)=\"setCurrentPage(i)\"\n >\n {{ page.title }}\n </button>\n </li>\n </ul>\n\n <div class=\"tab-content pt-5 pb-3 px-1\">\n <div\n *ngFor=\"let page of pages; let i = index\"\n class=\"tab-pane fade\"\n [class.show]=\"i === 0\"\n [class.active]=\"i === 0\"\n id=\"content-{{ i }}\"\n role=\"tabpanel\"\n [attr.aria-labelledby]=\"'tab-' + i\"\n >\n <div *ngFor=\"let row of page.rows\">\n <div class=\"margin\">\n <div *ngFor=\"let grid of row.grid\">\n <lib-form-elements\n [grid]=\"grid\"\n [edit]=\"edit\"\n (subFormChange)=\"updateSubFormWithSubmissions($event)\"\n ></lib-form-elements>\n </div>\n </div>\n </div>\n <div\n *ngIf=\"currentPageIndex == pages.length - 1\"\n class=\"footerButton d-flex justify-content-end\"\n >\n <button\n class=\"btn btn-primary me-md-2 rounded-pill\"\n type=\"button\"\n (click)=\"submitForm()\"\n >\n Submit\n </button>\n </div>\n </div>\n </div>\n</div>\n", styles: [".tab-inner-container{width:100%;position:relative;padding:3rem}@media (max-width: 1024px){.tab-inner-container{padding-left:1rem;padding-right:1rem}}@media (max-width: 576px){.tab-inner-container{padding:2rem .5rem}}.navTabs{overflow-x:auto;overflow-y:hidden;flex-wrap:unset;margin:0 0 -1px!important}.nav-item{background-color:#fff;border-radius:5px;margin-right:.5%}.nav-link{position:relative;margin-bottom:-2px}.nav-link:after{content:\"\";position:absolute;left:0;bottom:0;width:101%;height:6px;background:#efefef}.nav-link.active:after{display:none}.tab-content{background-color:#fff}\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: "component", type: FormElementsComponent, selector: "lib-form-elements", inputs: ["grid", "currentPageIndex", "edit"], outputs: ["subFormChange"] }] }); }
|
|
2623
2829
|
}
|
|
2624
2830
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NavigationTabsComponent, decorators: [{
|
|
2625
2831
|
type: Component,
|
|
2626
|
-
args: [{ selector: 'lib-navigation-tabs', template: "<div class=\"tab-inner-container\">\n <ul class=\"nav nav-tabs navTabs\" id=\"myTab\" role=\"tablist\">\n <li\n class=\"nav-item\"\n role=\"presentation\"\n *ngFor=\"let page of pages; let i = index\"\n >\n <button\n class=\"nav-link\"\n [class.active]=\"i === currentPageIndex\"\n id=\"tab-{{ i }}\"\n [attr.data-bs-toggle]=\"'tab'\"\n [attr.data-bs-target]=\"'#content-' + i\"\n type=\"button\"\n role=\"tab\"\n [attr.aria-controls]=\"'content-' + i\"\n [attr.aria-selected]=\"i === 0\"\n (click)=\"setCurrentPage(i)\"\n >\n {{ page.title }}\n </button>\n </li>\n </ul>\n\n <div class=\"tab-content pt-5 pb-3 px-1\">\n <div\n *ngFor=\"let page of pages; let i = index\"\n class=\"tab-pane fade\"\n [class.show]=\"i === 0\"\n [class.active]=\"i === 0\"\n id=\"content-{{ i }}\"\n role=\"tabpanel\"\n [attr.aria-labelledby]=\"'tab-' + i\"\n >\n <div *ngFor=\"let row of page.rows\">\n <div class=\"margin\">\n <div *ngFor=\"let grid of row.grid\">\n <lib-form-elements\n [grid]=\"grid\"\n [edit]=\"edit\"\n ></lib-form-elements>\n </div>\n </div>\n </div>\n <div\n *ngIf=\"currentPageIndex == pages.length - 1\"\n class=\"footerButton d-flex justify-content-end\"\n >\n <button\n class=\"btn btn-primary me-md-2 rounded-pill\"\n type=\"button\"\n (click)=\"submitForm()\"\n >\n Submit\n </button>\n </div>\n </div>\n </div>\n</div>\n", styles: [".tab-inner-container{width:100%;position:relative;padding:3rem}@media (max-width: 1024px){.tab-inner-container{padding-left:1rem;padding-right:1rem}}@media (max-width: 576px){.tab-inner-container{padding:2rem .5rem}}.navTabs{overflow-x:auto;overflow-y:hidden;flex-wrap:unset;margin:0 0 -1px!important}.nav-item{background-color:#fff;border-radius:5px;margin-right:.5%}.nav-link{position:relative;margin-bottom:-2px}.nav-link:after{content:\"\";position:absolute;left:0;bottom:0;width:101%;height:6px;background:#efefef}.nav-link.active:after{display:none}.tab-content{background-color:#fff}\n"] }]
|
|
2832
|
+
args: [{ selector: 'lib-navigation-tabs', template: "<div class=\"tab-inner-container\">\n <ul class=\"nav nav-tabs navTabs\" id=\"myTab\" role=\"tablist\">\n <li\n class=\"nav-item\"\n role=\"presentation\"\n *ngFor=\"let page of pages; let i = index\"\n >\n <button\n class=\"nav-link\"\n [class.active]=\"i === currentPageIndex\"\n id=\"tab-{{ i }}\"\n [attr.data-bs-toggle]=\"'tab'\"\n [attr.data-bs-target]=\"'#content-' + i\"\n type=\"button\"\n role=\"tab\"\n [attr.aria-controls]=\"'content-' + i\"\n [attr.aria-selected]=\"i === 0\"\n (click)=\"setCurrentPage(i)\"\n >\n {{ page.title }}\n </button>\n </li>\n </ul>\n\n <div class=\"tab-content pt-5 pb-3 px-1\">\n <div\n *ngFor=\"let page of pages; let i = index\"\n class=\"tab-pane fade\"\n [class.show]=\"i === 0\"\n [class.active]=\"i === 0\"\n id=\"content-{{ i }}\"\n role=\"tabpanel\"\n [attr.aria-labelledby]=\"'tab-' + i\"\n >\n <div *ngFor=\"let row of page.rows\">\n <div class=\"margin\">\n <div *ngFor=\"let grid of row.grid\">\n <lib-form-elements\n [grid]=\"grid\"\n [edit]=\"edit\"\n (subFormChange)=\"updateSubFormWithSubmissions($event)\"\n ></lib-form-elements>\n </div>\n </div>\n </div>\n <div\n *ngIf=\"currentPageIndex == pages.length - 1\"\n class=\"footerButton d-flex justify-content-end\"\n >\n <button\n class=\"btn btn-primary me-md-2 rounded-pill\"\n type=\"button\"\n (click)=\"submitForm()\"\n >\n Submit\n </button>\n </div>\n </div>\n </div>\n</div>\n", styles: [".tab-inner-container{width:100%;position:relative;padding:3rem}@media (max-width: 1024px){.tab-inner-container{padding-left:1rem;padding-right:1rem}}@media (max-width: 576px){.tab-inner-container{padding:2rem .5rem}}.navTabs{overflow-x:auto;overflow-y:hidden;flex-wrap:unset;margin:0 0 -1px!important}.nav-item{background-color:#fff;border-radius:5px;margin-right:.5%}.nav-link{position:relative;margin-bottom:-2px}.nav-link:after{content:\"\";position:absolute;left:0;bottom:0;width:101%;height:6px;background:#efefef}.nav-link.active:after{display:none}.tab-content{background-color:#fff}\n"] }]
|
|
2627
2833
|
}], propDecorators: { pages: [{
|
|
2628
2834
|
type: Input
|
|
2629
2835
|
}], currentPageIndex: [{
|
|
@@ -2634,6 +2840,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
2634
2840
|
type: Output
|
|
2635
2841
|
}], edit: [{
|
|
2636
2842
|
type: Input
|
|
2843
|
+
}], subFormChange: [{
|
|
2844
|
+
type: Output
|
|
2637
2845
|
}] } });
|
|
2638
2846
|
|
|
2639
2847
|
class NextPrevNavigationComponent {
|
|
@@ -2647,6 +2855,10 @@ class NextPrevNavigationComponent {
|
|
|
2647
2855
|
this.navigatePrevious = new EventEmitter();
|
|
2648
2856
|
this.submitEmit = new EventEmitter();
|
|
2649
2857
|
this.edit = false;
|
|
2858
|
+
this.subFormChange = new EventEmitter();
|
|
2859
|
+
}
|
|
2860
|
+
updateSubFormWithSubmissions(event) {
|
|
2861
|
+
this.subFormChange.emit(event);
|
|
2650
2862
|
}
|
|
2651
2863
|
onNavigateNext() {
|
|
2652
2864
|
this.navigateNext.emit();
|
|
@@ -2658,11 +2870,11 @@ class NextPrevNavigationComponent {
|
|
|
2658
2870
|
this.submitEmit.emit();
|
|
2659
2871
|
}
|
|
2660
2872
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NextPrevNavigationComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2661
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: NextPrevNavigationComponent, selector: "lib-next-prev-navigation", inputs: { currentPageIndex: "currentPageIndex", pages: "pages", previousPage: "previousPage", nextPage: "nextPage", currentPage: "currentPage", edit: "edit" }, outputs: { navigateNext: "navigateNext", navigatePrevious: "navigatePrevious", submitEmit: "submitEmit" }, ngImport: i0, template: "<div class=\"pageTitleDiv\">\n <p class=\"pageTitle\">{{ currentPage.title }}</p>\n</div>\n<div class=\"button-inner-container rounded\">\n <div class=\"tab-content pt-5 pb-3 row\">\n <div *ngFor=\"let row of pages[currentPageIndex].rows\" class=\"marginSize\">\n <div *ngFor=\"let grid of row.grid\">\n <lib-form-elements\n [grid]=\"grid\"\n [currentPageIndex]=\"currentPageIndex\"\n [edit]=\"edit\"\n ></lib-form-elements>\n </div>\n </div>\n <div class=\"footerButton\">\n <div class=\"prevButtonDiv\">\n <button\n class=\"me-md-2 rounded-pill navButton\"\n type=\"button\"\n (click)=\"onNavigatePrevious()\"\n *ngIf=\"0 < currentPageIndex\"\n >\n <svg\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M4.51025 11.9883L19.5003 11.9883\"\n stroke=\"white\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n <path\n d=\"M10.514 17.9766L4.49805 11.9996L10.514 6.02256\"\n stroke=\"white\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n Previous | {{ previousPage.title }}\n </button>\n </div>\n <div class=\"nextButtonDiv\">\n <button\n class=\"md-2 rounded-pill navButton\"\n type=\"button\"\n (click)=\"onNavigateNext()\"\n *ngIf=\"currentPageIndex < pages.length - 1\"\n >\n Next | {{ nextPage.title }}\n <svg\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M19.4897 12.0117L4.49975 12.0117\"\n stroke=\"white\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n <path\n d=\"M13.486 6.02344L19.502 12.0004L13.486 17.9774\"\n stroke=\"white\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n </button>\n <button\n class=\"submitBtn me-md-2 rounded-pill\"\n type=\"button\"\n *ngIf=\"currentPageIndex == pages.length - 1\"\n (click)=\"submitForm()\"\n >\n Submit\n </button>\n </div>\n </div>\n </div>\n</div>\n", styles: [".pageTitle{font-size:15px;font-weight:500}.pageTitleDiv{padding-left:3rem;padding-top:3rem}@media (max-width: 1024px){.pageTitleDiv{padding-left:1rem;padding-top:2rem}}@media (max-width: 576px){.pageTitleDiv{padding-left:.4rem;padding-top:1.5rem}}.button-inner-container{width:100%;position:relative;padding:0rem 3rem 3rem}@media (max-width: 1024px){.button-inner-container{padding-left:1rem;padding-right:1rem}}@media (max-width: 576px){.button-inner-container{padding:.1rem .5rem 2rem}}@media (max-width: 576px){.marginSize{padding:0!important}}.footerButton{padding:10px 32px 16px 30px;display:flex;flex-wrap:wrap}@media (max-width: 576px){.footerButton{padding-left:20px;padding-right:17px}}.navButton{background:#084fff;color:#fff;border:none;padding:10px 8px;width:auto}.submitBtn{background:#084fff;color:#fff;border:none;padding:10px 27px;width:auto}.prevButtonDiv{display:flex;justify-content:center;margin-bottom:5px}.nextButtonDiv{display:flex;justify-content:end;margin-left:auto;margin-bottom:5px}.tab-content,.row{background-color:#fff}\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: "component", type: FormElementsComponent, selector: "lib-form-elements", inputs: ["grid", "currentPageIndex", "edit"] }] }); }
|
|
2873
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: NextPrevNavigationComponent, selector: "lib-next-prev-navigation", inputs: { currentPageIndex: "currentPageIndex", pages: "pages", previousPage: "previousPage", nextPage: "nextPage", currentPage: "currentPage", edit: "edit" }, outputs: { navigateNext: "navigateNext", navigatePrevious: "navigatePrevious", submitEmit: "submitEmit", subFormChange: "subFormChange" }, ngImport: i0, template: "<div class=\"pageTitleDiv\">\n <p class=\"pageTitle\">{{ currentPage.title }}</p>\n</div>\n<div class=\"button-inner-container rounded\">\n <div class=\"tab-content pt-5 pb-3 row\">\n <div *ngFor=\"let row of pages[currentPageIndex].rows\" class=\"marginSize\">\n <div *ngFor=\"let grid of row.grid\">\n <lib-form-elements\n [grid]=\"grid\"\n [currentPageIndex]=\"currentPageIndex\"\n [edit]=\"edit\"\n (subFormChange)=\"updateSubFormWithSubmissions($event)\"\n ></lib-form-elements>\n </div>\n </div>\n <div class=\"footerButton\">\n <div class=\"prevButtonDiv\">\n <button\n class=\"me-md-2 rounded-pill navButton\"\n type=\"button\"\n (click)=\"onNavigatePrevious()\"\n *ngIf=\"0 < currentPageIndex\"\n >\n <svg\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M4.51025 11.9883L19.5003 11.9883\"\n stroke=\"white\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n <path\n d=\"M10.514 17.9766L4.49805 11.9996L10.514 6.02256\"\n stroke=\"white\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n Previous | {{ previousPage.title }}\n </button>\n </div>\n <div class=\"nextButtonDiv\">\n <button\n class=\"md-2 rounded-pill navButton\"\n type=\"button\"\n (click)=\"onNavigateNext()\"\n *ngIf=\"currentPageIndex < pages.length - 1\"\n >\n Next | {{ nextPage.title }}\n <svg\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M19.4897 12.0117L4.49975 12.0117\"\n stroke=\"white\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n <path\n d=\"M13.486 6.02344L19.502 12.0004L13.486 17.9774\"\n stroke=\"white\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n </button>\n <button\n class=\"submitBtn me-md-2 rounded-pill\"\n type=\"button\"\n *ngIf=\"currentPageIndex == pages.length - 1\"\n (click)=\"submitForm()\"\n >\n Submit\n </button>\n </div>\n </div>\n </div>\n</div>\n", styles: [".pageTitle{font-size:15px;font-weight:500}.pageTitleDiv{padding-left:3rem;padding-top:3rem}@media (max-width: 1024px){.pageTitleDiv{padding-left:1rem;padding-top:2rem}}@media (max-width: 576px){.pageTitleDiv{padding-left:.4rem;padding-top:1.5rem}}.button-inner-container{width:100%;position:relative;padding:0rem 3rem 3rem}@media (max-width: 1024px){.button-inner-container{padding-left:1rem;padding-right:1rem}}@media (max-width: 576px){.button-inner-container{padding:.1rem .5rem 2rem}}@media (max-width: 576px){.marginSize{padding:0!important}}.footerButton{padding:10px 32px 16px 30px;display:flex;flex-wrap:wrap}@media (max-width: 576px){.footerButton{padding-left:20px;padding-right:17px}}.navButton{background:#084fff;color:#fff;border:none;padding:10px 8px;width:auto}.submitBtn{background:#084fff;color:#fff;border:none;padding:10px 27px;width:auto}.prevButtonDiv{display:flex;justify-content:center;margin-bottom:5px}.nextButtonDiv{display:flex;justify-content:end;margin-left:auto;margin-bottom:5px}.tab-content,.row{background-color:#fff}\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: "component", type: FormElementsComponent, selector: "lib-form-elements", inputs: ["grid", "currentPageIndex", "edit"], outputs: ["subFormChange"] }] }); }
|
|
2662
2874
|
}
|
|
2663
2875
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NextPrevNavigationComponent, decorators: [{
|
|
2664
2876
|
type: Component,
|
|
2665
|
-
args: [{ selector: 'lib-next-prev-navigation', template: "<div class=\"pageTitleDiv\">\n <p class=\"pageTitle\">{{ currentPage.title }}</p>\n</div>\n<div class=\"button-inner-container rounded\">\n <div class=\"tab-content pt-5 pb-3 row\">\n <div *ngFor=\"let row of pages[currentPageIndex].rows\" class=\"marginSize\">\n <div *ngFor=\"let grid of row.grid\">\n <lib-form-elements\n [grid]=\"grid\"\n [currentPageIndex]=\"currentPageIndex\"\n [edit]=\"edit\"\n ></lib-form-elements>\n </div>\n </div>\n <div class=\"footerButton\">\n <div class=\"prevButtonDiv\">\n <button\n class=\"me-md-2 rounded-pill navButton\"\n type=\"button\"\n (click)=\"onNavigatePrevious()\"\n *ngIf=\"0 < currentPageIndex\"\n >\n <svg\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M4.51025 11.9883L19.5003 11.9883\"\n stroke=\"white\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n <path\n d=\"M10.514 17.9766L4.49805 11.9996L10.514 6.02256\"\n stroke=\"white\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n Previous | {{ previousPage.title }}\n </button>\n </div>\n <div class=\"nextButtonDiv\">\n <button\n class=\"md-2 rounded-pill navButton\"\n type=\"button\"\n (click)=\"onNavigateNext()\"\n *ngIf=\"currentPageIndex < pages.length - 1\"\n >\n Next | {{ nextPage.title }}\n <svg\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M19.4897 12.0117L4.49975 12.0117\"\n stroke=\"white\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n <path\n d=\"M13.486 6.02344L19.502 12.0004L13.486 17.9774\"\n stroke=\"white\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n </button>\n <button\n class=\"submitBtn me-md-2 rounded-pill\"\n type=\"button\"\n *ngIf=\"currentPageIndex == pages.length - 1\"\n (click)=\"submitForm()\"\n >\n Submit\n </button>\n </div>\n </div>\n </div>\n</div>\n", styles: [".pageTitle{font-size:15px;font-weight:500}.pageTitleDiv{padding-left:3rem;padding-top:3rem}@media (max-width: 1024px){.pageTitleDiv{padding-left:1rem;padding-top:2rem}}@media (max-width: 576px){.pageTitleDiv{padding-left:.4rem;padding-top:1.5rem}}.button-inner-container{width:100%;position:relative;padding:0rem 3rem 3rem}@media (max-width: 1024px){.button-inner-container{padding-left:1rem;padding-right:1rem}}@media (max-width: 576px){.button-inner-container{padding:.1rem .5rem 2rem}}@media (max-width: 576px){.marginSize{padding:0!important}}.footerButton{padding:10px 32px 16px 30px;display:flex;flex-wrap:wrap}@media (max-width: 576px){.footerButton{padding-left:20px;padding-right:17px}}.navButton{background:#084fff;color:#fff;border:none;padding:10px 8px;width:auto}.submitBtn{background:#084fff;color:#fff;border:none;padding:10px 27px;width:auto}.prevButtonDiv{display:flex;justify-content:center;margin-bottom:5px}.nextButtonDiv{display:flex;justify-content:end;margin-left:auto;margin-bottom:5px}.tab-content,.row{background-color:#fff}\n"] }]
|
|
2877
|
+
args: [{ selector: 'lib-next-prev-navigation', template: "<div class=\"pageTitleDiv\">\n <p class=\"pageTitle\">{{ currentPage.title }}</p>\n</div>\n<div class=\"button-inner-container rounded\">\n <div class=\"tab-content pt-5 pb-3 row\">\n <div *ngFor=\"let row of pages[currentPageIndex].rows\" class=\"marginSize\">\n <div *ngFor=\"let grid of row.grid\">\n <lib-form-elements\n [grid]=\"grid\"\n [currentPageIndex]=\"currentPageIndex\"\n [edit]=\"edit\"\n (subFormChange)=\"updateSubFormWithSubmissions($event)\"\n ></lib-form-elements>\n </div>\n </div>\n <div class=\"footerButton\">\n <div class=\"prevButtonDiv\">\n <button\n class=\"me-md-2 rounded-pill navButton\"\n type=\"button\"\n (click)=\"onNavigatePrevious()\"\n *ngIf=\"0 < currentPageIndex\"\n >\n <svg\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M4.51025 11.9883L19.5003 11.9883\"\n stroke=\"white\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n <path\n d=\"M10.514 17.9766L4.49805 11.9996L10.514 6.02256\"\n stroke=\"white\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n Previous | {{ previousPage.title }}\n </button>\n </div>\n <div class=\"nextButtonDiv\">\n <button\n class=\"md-2 rounded-pill navButton\"\n type=\"button\"\n (click)=\"onNavigateNext()\"\n *ngIf=\"currentPageIndex < pages.length - 1\"\n >\n Next | {{ nextPage.title }}\n <svg\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M19.4897 12.0117L4.49975 12.0117\"\n stroke=\"white\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n <path\n d=\"M13.486 6.02344L19.502 12.0004L13.486 17.9774\"\n stroke=\"white\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n </button>\n <button\n class=\"submitBtn me-md-2 rounded-pill\"\n type=\"button\"\n *ngIf=\"currentPageIndex == pages.length - 1\"\n (click)=\"submitForm()\"\n >\n Submit\n </button>\n </div>\n </div>\n </div>\n</div>\n", styles: [".pageTitle{font-size:15px;font-weight:500}.pageTitleDiv{padding-left:3rem;padding-top:3rem}@media (max-width: 1024px){.pageTitleDiv{padding-left:1rem;padding-top:2rem}}@media (max-width: 576px){.pageTitleDiv{padding-left:.4rem;padding-top:1.5rem}}.button-inner-container{width:100%;position:relative;padding:0rem 3rem 3rem}@media (max-width: 1024px){.button-inner-container{padding-left:1rem;padding-right:1rem}}@media (max-width: 576px){.button-inner-container{padding:.1rem .5rem 2rem}}@media (max-width: 576px){.marginSize{padding:0!important}}.footerButton{padding:10px 32px 16px 30px;display:flex;flex-wrap:wrap}@media (max-width: 576px){.footerButton{padding-left:20px;padding-right:17px}}.navButton{background:#084fff;color:#fff;border:none;padding:10px 8px;width:auto}.submitBtn{background:#084fff;color:#fff;border:none;padding:10px 27px;width:auto}.prevButtonDiv{display:flex;justify-content:center;margin-bottom:5px}.nextButtonDiv{display:flex;justify-content:end;margin-left:auto;margin-bottom:5px}.tab-content,.row{background-color:#fff}\n"] }]
|
|
2666
2878
|
}], propDecorators: { currentPageIndex: [{
|
|
2667
2879
|
type: Input
|
|
2668
2880
|
}], pages: [{
|
|
@@ -2681,6 +2893,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
2681
2893
|
type: Output
|
|
2682
2894
|
}], edit: [{
|
|
2683
2895
|
type: Input
|
|
2896
|
+
}], subFormChange: [{
|
|
2897
|
+
type: Output
|
|
2684
2898
|
}] } });
|
|
2685
2899
|
|
|
2686
2900
|
class SubmitFormComponent {
|
|
@@ -2716,7 +2930,90 @@ class SubmitFormComponent {
|
|
|
2716
2930
|
this.lastTab = false;
|
|
2717
2931
|
this.questionAnswers = { answers: [], forms: [] };
|
|
2718
2932
|
this.files = [];
|
|
2719
|
-
this.submission = {
|
|
2933
|
+
this.submission = {
|
|
2934
|
+
"id": "d7056b98-b099-4a32-85a9-a0b69db67fcb",
|
|
2935
|
+
"module": "backend",
|
|
2936
|
+
"formId": "0d810a16-6f8b-45a1-98d1-6b3b7433dbe5",
|
|
2937
|
+
"formName": "submisson view ",
|
|
2938
|
+
"createdBy": "anish",
|
|
2939
|
+
"modifiedBy": "anish",
|
|
2940
|
+
"createdOn": "08/07/2024 07:00 PM",
|
|
2941
|
+
"modifiedOn": "08/07/2024 07:00 PM",
|
|
2942
|
+
"status": "PUBLISHED",
|
|
2943
|
+
"answers": [],
|
|
2944
|
+
"answerMap": {},
|
|
2945
|
+
"questionAnswers": [
|
|
2946
|
+
{
|
|
2947
|
+
"question": "profile",
|
|
2948
|
+
"elementType": "FILE_PICKER",
|
|
2949
|
+
"attachments": [
|
|
2950
|
+
{
|
|
2951
|
+
"fileId": "14ab669f-9f68-43a0-83f9-37375ad1d853",
|
|
2952
|
+
"fileName": "Screenshot from 2023-07-20 09-23-23.png",
|
|
2953
|
+
"fileUrl": "http://192.168.1.150:9000/employee/Screenshot%20from%202023-07-20%2009-23-23.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=lIwtLyjUWs2TXosWpXW4%2F20240710%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20240710T051502Z&X-Amz-Expires=604800&X-Amz-SignedHeaders=host&X-Amz-Signature=62f4d05f5075fe2f44abc406e6ada08357764c0c339179abfe16f462ec9deb78"
|
|
2954
|
+
},
|
|
2955
|
+
{
|
|
2956
|
+
"fileId": "ff5600a6-eb8a-481b-aa5d-2f7006bb34cb",
|
|
2957
|
+
"fileName": "Abhiram V.pdf",
|
|
2958
|
+
"fileUrl": "http://192.168.1.150:9000/employee/Abhiram%20V.pdf?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=lIwtLyjUWs2TXosWpXW4%2F20240710%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20240710T052831Z&X-Amz-Expires=604800&X-Amz-SignedHeaders=host&X-Amz-Signature=45ef3945c96233669d714dc20aab27d8af463cab120c1ae88e38007cfdf76442"
|
|
2959
|
+
},
|
|
2960
|
+
{
|
|
2961
|
+
"fileId": "c2c0e8fc-5510-4bf9-acb3-c5b5aa5ed4ac",
|
|
2962
|
+
"fileName": "Angular-code-format.doc",
|
|
2963
|
+
"fileUrl": "http://192.168.1.150:9000/employee/Angular-code-format.doc?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=lIwtLyjUWs2TXosWpXW4%2F20240710%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20240710T052831Z&X-Amz-Expires=604800&X-Amz-SignedHeaders=host&X-Amz-Signature=d25e754418f7feba444482b572925b4eb36551fe55e0e68b0dd41632b7932bfe"
|
|
2964
|
+
}
|
|
2965
|
+
]
|
|
2966
|
+
},
|
|
2967
|
+
{
|
|
2968
|
+
"question": "Name",
|
|
2969
|
+
"elementType": "TEXT_BOX",
|
|
2970
|
+
"values": "amrutha"
|
|
2971
|
+
},
|
|
2972
|
+
{
|
|
2973
|
+
"question": "Age",
|
|
2974
|
+
"elementType": "TEXT_BOX",
|
|
2975
|
+
"values": "28"
|
|
2976
|
+
},
|
|
2977
|
+
{
|
|
2978
|
+
"question": "Select",
|
|
2979
|
+
"elementType": "DROP_DOWN",
|
|
2980
|
+
"values": ["28", "29"]
|
|
2981
|
+
},
|
|
2982
|
+
{
|
|
2983
|
+
"question": "Selection matrix",
|
|
2984
|
+
"elementType": "SELECTION_MATRIX",
|
|
2985
|
+
"values": ["qq_ww", "ee_rr", "tt_yy"]
|
|
2986
|
+
},
|
|
2987
|
+
{
|
|
2988
|
+
"question": "Rich text",
|
|
2989
|
+
"elementType": "RICH_TEXT_EDITOR",
|
|
2990
|
+
"values": "<font face=\"Arial\">this is a sample text <u>in rich text </u></font>"
|
|
2991
|
+
}
|
|
2992
|
+
],
|
|
2993
|
+
};
|
|
2994
|
+
this.updateSubForm = (pages, updatedSubForm) => {
|
|
2995
|
+
pages.forEach(page => {
|
|
2996
|
+
page.rows.forEach((row) => {
|
|
2997
|
+
row.grid.forEach((element) => {
|
|
2998
|
+
if (element.entityType === 'SUBFORM' && element.element.id === updatedSubForm.formId) {
|
|
2999
|
+
// Update the existing subform with the new data
|
|
3000
|
+
element.element = updatedSubForm;
|
|
3001
|
+
}
|
|
3002
|
+
else if (element.entityType === 'SUBFORM' && element.element.id !== updatedSubForm.formId) {
|
|
3003
|
+
// Handle multiple subforms logic here if needed
|
|
3004
|
+
}
|
|
3005
|
+
else if (element.entityType === 'QUESTION' && element.element.childLogics) {
|
|
3006
|
+
// Recursively update child logics
|
|
3007
|
+
element.element.childLogics.forEach((logic) => {
|
|
3008
|
+
if (logic.showLogic) {
|
|
3009
|
+
this.updateSubForm(logic.formElements, updatedSubForm);
|
|
3010
|
+
}
|
|
3011
|
+
});
|
|
3012
|
+
}
|
|
3013
|
+
});
|
|
3014
|
+
});
|
|
3015
|
+
});
|
|
3016
|
+
};
|
|
2720
3017
|
const navigation = this.router.getCurrentNavigation();
|
|
2721
3018
|
this.submission = navigation?.extras.state?.['submission'];
|
|
2722
3019
|
}
|
|
@@ -2878,16 +3175,29 @@ class SubmitFormComponent {
|
|
|
2878
3175
|
}
|
|
2879
3176
|
else if (element.entityType === 'SUBFORM') {
|
|
2880
3177
|
const subformId = element.element.id;
|
|
2881
|
-
const
|
|
2882
|
-
|
|
2883
|
-
|
|
2884
|
-
|
|
2885
|
-
|
|
2886
|
-
|
|
2887
|
-
|
|
2888
|
-
|
|
2889
|
-
|
|
2890
|
-
|
|
3178
|
+
const submissionId = element.element.submissionId;
|
|
3179
|
+
if (element.element.subFormStructure === 'single') {
|
|
3180
|
+
const subformQuestions = extractQuestions(element.element.formElements, subformId, true, forms.length);
|
|
3181
|
+
const subform = {
|
|
3182
|
+
formId: subformId,
|
|
3183
|
+
deletedSubmissions: [],
|
|
3184
|
+
submissions: [{
|
|
3185
|
+
submissionId: submissionId,
|
|
3186
|
+
answers: subformQuestions.answers
|
|
3187
|
+
}]
|
|
3188
|
+
};
|
|
3189
|
+
forms.push(subform);
|
|
3190
|
+
}
|
|
3191
|
+
else if (element.element.subFormStructure === 'multiple') {
|
|
3192
|
+
const subformQuestions = extractQuestions(element.element.formElements, subformId, true, forms.length);
|
|
3193
|
+
const existingSubform = forms.find(form => form.formId === subformId);
|
|
3194
|
+
const subform = {
|
|
3195
|
+
formId: subformId,
|
|
3196
|
+
deletedSubmissions: element.element.deletedSubmissions,
|
|
3197
|
+
submissions: element.element.submissions
|
|
3198
|
+
};
|
|
3199
|
+
forms.push(subform);
|
|
3200
|
+
}
|
|
2891
3201
|
}
|
|
2892
3202
|
});
|
|
2893
3203
|
return { answers: questions, forms: forms };
|
|
@@ -3083,12 +3393,15 @@ class SubmitFormComponent {
|
|
|
3083
3393
|
}
|
|
3084
3394
|
return { isValid: true, message: 'All required questions are answered.' };
|
|
3085
3395
|
}
|
|
3396
|
+
updateSubFormWithSubmissions(event) {
|
|
3397
|
+
this.updateSubForm(this.pages, event);
|
|
3398
|
+
}
|
|
3086
3399
|
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 }); }
|
|
3087
|
-
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 <div class=\"submission-container container mb-2\">\n <div *ngFor=\"let
|
|
3400
|
+
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 <div class=\"submission-container container mb-2\">\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 \n <div class=\"head container\">\n <lib-header [name]=\"name\"></lib-header>\n </div>\n <div class=\"body container\">\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}.submission-container{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]" }, { 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"] }] }); }
|
|
3088
3401
|
}
|
|
3089
3402
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SubmitFormComponent, decorators: [{
|
|
3090
3403
|
type: Component,
|
|
3091
|
-
args: [{ selector: 'lib-submit-form', template: "<div class=\"outer-container\">\n <div class=\"submission-container container mb-2\">\n <div *ngFor=\"let
|
|
3404
|
+
args: [{ selector: 'lib-submit-form', template: "<div class=\"outer-container\">\n <div class=\"submission-container container mb-2\">\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 \n <div class=\"head container\">\n <lib-header [name]=\"name\"></lib-header>\n </div>\n <div class=\"body container\">\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}.submission-container{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"] }]
|
|
3092
3405
|
}], ctorParameters: function () { return [{ type: FormService }, { type: i2$3.ToastrService }, { type: i3$4.Router }]; }, propDecorators: { moduleName: [{
|
|
3093
3406
|
type: Input
|
|
3094
3407
|
}], edit: [{
|
|
@@ -3294,21 +3607,24 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
3294
3607
|
|
|
3295
3608
|
class SubFormModule {
|
|
3296
3609
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SubFormModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
3297
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: SubFormModule, declarations: [SubFormComponent], imports: [CommonModule,
|
|
3610
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: SubFormModule, declarations: [SubFormComponent, MultipleSubformComponent, SubmissionModalComponent], imports: [CommonModule,
|
|
3298
3611
|
FormFieldsModule,
|
|
3299
|
-
LogicModule
|
|
3612
|
+
LogicModule,
|
|
3613
|
+
MatDialogModule], exports: [SubFormComponent] }); }
|
|
3300
3614
|
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SubFormModule, imports: [CommonModule,
|
|
3301
3615
|
FormFieldsModule,
|
|
3302
|
-
LogicModule
|
|
3616
|
+
LogicModule,
|
|
3617
|
+
MatDialogModule] }); }
|
|
3303
3618
|
}
|
|
3304
3619
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SubFormModule, decorators: [{
|
|
3305
3620
|
type: NgModule,
|
|
3306
3621
|
args: [{
|
|
3307
|
-
declarations: [SubFormComponent],
|
|
3622
|
+
declarations: [SubFormComponent, MultipleSubformComponent, SubmissionModalComponent],
|
|
3308
3623
|
imports: [
|
|
3309
3624
|
CommonModule,
|
|
3310
3625
|
FormFieldsModule,
|
|
3311
3626
|
LogicModule,
|
|
3627
|
+
MatDialogModule
|
|
3312
3628
|
],
|
|
3313
3629
|
exports: [SubFormComponent]
|
|
3314
3630
|
}]
|