survery-lib 0.2.2 → 2.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2022/lib/components/question-boolean-template/question-boolean-template.component.mjs +17 -17
- package/esm2022/lib/components/question-cascade-template/question-cascade-template.component.mjs +9 -9
- package/esm2022/lib/components/question-check-box-template/question-check-box-template.component.mjs +18 -18
- package/esm2022/lib/components/question-dropdown-multi-template/question-dropdown-multi-template.component.mjs +16 -17
- package/esm2022/lib/components/question-dropdown-template/question-dropdown-template.component.mjs +13 -14
- package/esm2022/lib/components/question-feedback-template/question-feedback-template.component.mjs +129 -0
- package/esm2022/lib/components/question-matrix-template/question-matrix-template.component.mjs +13 -14
- package/esm2022/lib/components/question-radio-button-template/question-radio-button-template.component.mjs +17 -17
- package/esm2022/lib/components/question-text-template/question-text-template.component.mjs +18 -19
- package/esm2022/lib/core/states/survey-store/survey.reducer.mjs +2 -2
- package/esm2022/lib/pipes/find-question.pipe.mjs +1 -1
- package/esm2022/lib/services/survey-lib.service.mjs +34 -21
- package/esm2022/lib/survery-lib.component.mjs +5 -4
- package/esm2022/lib/survery-lib.module.mjs +12 -8
- package/esm2022/lib/usecases/check-rule-exps.usecase.mjs +3 -3
- package/esm2022/shared/dtos/survey-answer.dto.mjs +1 -1
- package/esm2022/shared/enums/evaluation-type.enum.mjs +6 -0
- package/esm2022/shared/enums/input-type.enum.mjs +3 -1
- package/esm2022/shared/enums/question-type.enum.mjs +2 -1
- package/esm2022/shared/form-interfaces/question-boolean-template.form-interface.mjs +1 -1
- package/esm2022/shared/form-interfaces/question-cascade.form-interface.mjs +1 -1
- package/esm2022/shared/form-interfaces/question-check-box-template.form-interface.mjs +1 -1
- package/esm2022/shared/form-interfaces/question-dropdown-multi-template.form-interface.mjs +1 -1
- package/esm2022/shared/form-interfaces/question-dropdown-template.form-interface.mjs +1 -1
- package/esm2022/shared/form-interfaces/question-feedback-template.form-interface.mjs +2 -0
- package/esm2022/shared/form-interfaces/question-matrix-template.form-interface.mjs +1 -1
- package/esm2022/shared/form-interfaces/question-radio-button-template.form-interface.mjs +1 -1
- package/esm2022/shared/form-interfaces/question-text-template.form-interface.mjs +1 -1
- package/fesm2022/survery-lib.mjs +269 -131
- package/fesm2022/survery-lib.mjs.map +1 -1
- package/lib/components/question-boolean-template/question-boolean-template.component.d.ts +3 -14
- package/lib/components/question-cascade-template/question-cascade-template.component.d.ts +4 -6
- package/lib/components/question-check-box-template/question-check-box-template.component.d.ts +4 -15
- package/lib/components/question-dropdown-multi-template/question-dropdown-multi-template.component.d.ts +3 -14
- package/lib/components/question-dropdown-template/question-dropdown-template.component.d.ts +2 -12
- package/lib/components/question-feedback-template/question-feedback-template.component.d.ts +27 -0
- package/lib/components/question-matrix-template/question-matrix-template.component.d.ts +3 -10
- package/lib/components/question-radio-button-template/question-radio-button-template.component.d.ts +3 -14
- package/lib/components/question-text-template/question-text-template.component.d.ts +2 -17
- package/lib/survery-lib.module.d.ts +7 -5
- package/package.json +2 -2
- package/shared/dtos/survey-answer.dto.d.ts +3 -0
- package/shared/enums/evaluation-type.enum.d.ts +4 -0
- package/shared/enums/input-type.enum.d.ts +3 -1
- package/shared/enums/question-type.enum.d.ts +2 -1
- package/shared/form-interfaces/question-boolean-template.form-interface.d.ts +13 -12
- package/shared/form-interfaces/question-cascade.form-interface.d.ts +5 -4
- package/shared/form-interfaces/question-check-box-template.form-interface.d.ts +13 -12
- package/shared/form-interfaces/question-dropdown-multi-template.form-interface.d.ts +13 -12
- package/shared/form-interfaces/question-dropdown-template.form-interface.d.ts +9 -8
- package/shared/form-interfaces/question-feedback-template.form-interface.d.ts +15 -0
- package/shared/form-interfaces/question-matrix-template.form-interface.d.ts +9 -8
- package/shared/form-interfaces/question-radio-button-template.form-interface.d.ts +13 -12
- package/shared/form-interfaces/question-text-template.form-interface.d.ts +13 -12
package/fesm2022/survery-lib.mjs
CHANGED
|
@@ -2,19 +2,21 @@ import * as i0 from '@angular/core';
|
|
|
2
2
|
import { Injectable, Directive, HostListener, Pipe, Component, Input, EventEmitter, Output, InjectionToken, Inject, NgModule } from '@angular/core';
|
|
3
3
|
import { v4 } from 'uuid';
|
|
4
4
|
import { Subject, of, debounceTime, distinctUntilChanged, map, filter, pairwise, take } from 'rxjs';
|
|
5
|
-
import * as
|
|
5
|
+
import * as i1 from '@angular/forms';
|
|
6
6
|
import { Validators, FormControl, ReactiveFormsModule, FormsModule } from '@angular/forms';
|
|
7
7
|
import * as i3 from '@ngrx/store';
|
|
8
8
|
import { createFeatureSelector, createSelector, createAction, props, createReducer, on, StoreModule } from '@ngrx/store';
|
|
9
9
|
import { createEntityAdapter } from '@ngrx/entity';
|
|
10
10
|
import * as i4 from '@angular/common';
|
|
11
11
|
import { CommonModule } from '@angular/common';
|
|
12
|
-
import * as
|
|
13
|
-
import { Validators as Validators$1, NgsFormsModule } from '@ng-stack/forms';
|
|
14
|
-
import * as i6 from '@ng-select/ng-select';
|
|
12
|
+
import * as i5 from '@ng-select/ng-select';
|
|
15
13
|
import { NgSelectModule } from '@ng-select/ng-select';
|
|
16
14
|
import * as i1$1 from '@angular/common/http';
|
|
17
15
|
import { HttpHeaders, HttpClientModule } from '@angular/common/http';
|
|
16
|
+
import * as i5$1 from 'ngx-bootstrap/rating';
|
|
17
|
+
import { RatingModule } from 'ngx-bootstrap/rating';
|
|
18
|
+
import * as i6 from 'ngx-bootstrap/pagination';
|
|
19
|
+
import { PaginationModule } from 'ngx-bootstrap/pagination';
|
|
18
20
|
import * as i2 from '@ngrx/effects';
|
|
19
21
|
import { EffectsModule } from '@ngrx/effects';
|
|
20
22
|
|
|
@@ -28,6 +30,7 @@ var QuestionTypeEnum;
|
|
|
28
30
|
QuestionTypeEnum[QuestionTypeEnum["Matrix"] = 6] = "Matrix";
|
|
29
31
|
QuestionTypeEnum[QuestionTypeEnum["DropDownMulti"] = 7] = "DropDownMulti";
|
|
30
32
|
QuestionTypeEnum[QuestionTypeEnum["Cascade"] = 8] = "Cascade";
|
|
33
|
+
QuestionTypeEnum[QuestionTypeEnum["FeedBack"] = 9] = "FeedBack";
|
|
31
34
|
})(QuestionTypeEnum || (QuestionTypeEnum = {}));
|
|
32
35
|
|
|
33
36
|
var InputTypeEnum;
|
|
@@ -40,6 +43,8 @@ var InputTypeEnum;
|
|
|
40
43
|
InputTypeEnum[InputTypeEnum["Password"] = 6] = "Password";
|
|
41
44
|
InputTypeEnum[InputTypeEnum["Text"] = 7] = "Text";
|
|
42
45
|
InputTypeEnum[InputTypeEnum["Phone"] = 8] = "Phone";
|
|
46
|
+
InputTypeEnum[InputTypeEnum["Stars"] = 20] = "Stars";
|
|
47
|
+
InputTypeEnum[InputTypeEnum["Pagination"] = 21] = "Pagination";
|
|
43
48
|
})(InputTypeEnum || (InputTypeEnum = {}));
|
|
44
49
|
|
|
45
50
|
function selectQuestionId(a) {
|
|
@@ -137,6 +142,12 @@ const surveyActions = {
|
|
|
137
142
|
updatePageId,
|
|
138
143
|
};
|
|
139
144
|
|
|
145
|
+
var EvaluationTypeEnum;
|
|
146
|
+
(function (EvaluationTypeEnum) {
|
|
147
|
+
EvaluationTypeEnum[EvaluationTypeEnum["Stars"] = 1] = "Stars";
|
|
148
|
+
EvaluationTypeEnum[EvaluationTypeEnum["Pagination"] = 2] = "Pagination";
|
|
149
|
+
})(EvaluationTypeEnum || (EvaluationTypeEnum = {}));
|
|
150
|
+
|
|
140
151
|
class SurveyLibService {
|
|
141
152
|
get reloadSurveyObsrv() {
|
|
142
153
|
return this.reloadSurveySubject.asObservable();
|
|
@@ -172,7 +183,8 @@ class SurveyLibService {
|
|
|
172
183
|
}
|
|
173
184
|
setsurveyAnswers(model) {
|
|
174
185
|
model.defaultAnswers.forEach(answer => {
|
|
175
|
-
if (answer.QuestionType == QuestionTypeEnum.TextInput
|
|
186
|
+
if (answer.QuestionType == QuestionTypeEnum.TextInput ||
|
|
187
|
+
answer.QuestionType == QuestionTypeEnum.FeedBack) {
|
|
176
188
|
this._Store.dispatch(surveyActions.updateQuestionAnswer({
|
|
177
189
|
questionId: answer.QuestionId,
|
|
178
190
|
answer: answer.AnswerText,
|
|
@@ -200,25 +212,35 @@ class SurveyLibService {
|
|
|
200
212
|
this.reloadSurveySubject.next(v4());
|
|
201
213
|
}
|
|
202
214
|
addQuestion(question, pageIndex, questionGroupId) {
|
|
203
|
-
var questionArr = [
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
215
|
+
var questionArr = [];
|
|
216
|
+
var questionNgrxModel = {
|
|
217
|
+
surveyPageId: pageIndex,
|
|
218
|
+
questionId: question.questionId,
|
|
219
|
+
questionType: question.questionTypeId,
|
|
220
|
+
inputTypeId: question.surveyAnswers[0].inputTypeId,
|
|
221
|
+
isMatrixGroup: question.questionTypeId == QuestionTypeEnum.Matrix,
|
|
222
|
+
answerId: null,
|
|
223
|
+
answerIdArr: null,
|
|
224
|
+
answerText: null,
|
|
225
|
+
isRequired: question.isRequired,
|
|
226
|
+
isValid: null,
|
|
227
|
+
isDisabled: question.isReadOnly,
|
|
228
|
+
isShow: question.isVisable,
|
|
229
|
+
isDisabled_default: question.isReadOnly,
|
|
230
|
+
isShow_default: question.isVisable,
|
|
231
|
+
questionGroupId: questionGroupId,
|
|
232
|
+
parentQuestionId: null,
|
|
233
|
+
questionAllInfo: question
|
|
234
|
+
};
|
|
235
|
+
if (question.questionTypeId == QuestionTypeEnum.FeedBack) {
|
|
236
|
+
if (question.surveyAnswers[0].evaluationTypeId == EvaluationTypeEnum.Stars) {
|
|
237
|
+
questionNgrxModel.inputTypeId = InputTypeEnum.Stars;
|
|
238
|
+
}
|
|
239
|
+
else if (question.surveyAnswers[0].evaluationTypeId == EvaluationTypeEnum.Pagination) {
|
|
240
|
+
questionNgrxModel.inputTypeId = InputTypeEnum.Pagination;
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
questionArr.push(questionNgrxModel);
|
|
222
244
|
if (question.questionTypeId == QuestionTypeEnum.Matrix) {
|
|
223
245
|
question.surveySubQuestions.forEach(subQuestion => {
|
|
224
246
|
questionArr.push({
|
|
@@ -285,7 +307,7 @@ class CheckRuleExpsUsecase {
|
|
|
285
307
|
const index = params.questions.findIndex(x => x.questionId == ruleExp.questionId);
|
|
286
308
|
var questionGroupValue = params.questions.at(index);
|
|
287
309
|
var result;
|
|
288
|
-
if (questionGroupValue.questionType == QuestionTypeEnum.TextInput) {
|
|
310
|
+
if (questionGroupValue.questionType == QuestionTypeEnum.TextInput || questionGroupValue.questionType == QuestionTypeEnum.FeedBack) {
|
|
289
311
|
result = this.checkRuleExpForAnswerText(ruleExp, questionGroupValue.answerText);
|
|
290
312
|
}
|
|
291
313
|
else if (questionGroupValue.questionType == QuestionTypeEnum.CheckBox || questionGroupValue.questionType == QuestionTypeEnum.DropDownMulti) {
|
|
@@ -296,7 +318,7 @@ class CheckRuleExpsUsecase {
|
|
|
296
318
|
}
|
|
297
319
|
useCaseResult.exprestionResultArr.push(result);
|
|
298
320
|
});
|
|
299
|
-
console.log(`Questions not passed ${useCaseResult.exprestionResultArr.filter(x => x == false).length}`);
|
|
321
|
+
// console.log(`Questions not passed ${useCaseResult.exprestionResultArr.filter(x => x == false).length}`);
|
|
300
322
|
return of(useCaseResult);
|
|
301
323
|
}
|
|
302
324
|
checkRuleExpForAnswerId(ruleExp, answerId) {
|
|
@@ -602,18 +624,18 @@ class QuestionTextTemplateComponent {
|
|
|
602
624
|
this._Store = _Store;
|
|
603
625
|
this.isArabicLang = false;
|
|
604
626
|
this.rForm = this._formBuilder.group({
|
|
605
|
-
id:
|
|
606
|
-
name:
|
|
607
|
-
title:
|
|
608
|
-
typeId:
|
|
609
|
-
description:
|
|
610
|
-
surveyAnswerId:
|
|
611
|
-
answer:
|
|
612
|
-
isDisabled:
|
|
613
|
-
isShow:
|
|
614
|
-
inputTypeId:
|
|
615
|
-
inputMin:
|
|
616
|
-
inputMax:
|
|
627
|
+
id: new FormControl(null),
|
|
628
|
+
name: new FormControl(null),
|
|
629
|
+
title: new FormControl(null),
|
|
630
|
+
typeId: new FormControl(null),
|
|
631
|
+
description: new FormControl(null),
|
|
632
|
+
surveyAnswerId: new FormControl(null),
|
|
633
|
+
answer: new FormControl(null),
|
|
634
|
+
isDisabled: new FormControl(false),
|
|
635
|
+
isShow: new FormControl(true),
|
|
636
|
+
inputTypeId: new FormControl(null),
|
|
637
|
+
inputMin: new FormControl(null),
|
|
638
|
+
inputMax: new FormControl(null),
|
|
617
639
|
});
|
|
618
640
|
}
|
|
619
641
|
ngOnInit() {
|
|
@@ -674,7 +696,7 @@ class QuestionTextTemplateComponent {
|
|
|
674
696
|
this.fCtrls.answer.updateValueAndValidity();
|
|
675
697
|
}
|
|
676
698
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: QuestionTextTemplateComponent, deps: [{ token: i1.FormBuilder }, { token: SurveyLibService }, { token: i3.Store }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
677
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.7", type: QuestionTextTemplateComponent, selector: "lib-question-text-template", inputs: { isArabicLang: "isArabicLang", setQuestion: "setQuestion", isDisabled: "isDisabled" }, ngImport: i0, template: "<div class=\"quastion\" [formGroup]=\"rForm\" [attr.id]=\"'question_'+fCtrls.id.value\"\r\n [ngClass]=\"{'invalid-question': fCtrls.answer.invalid , 'd-none':fCtrls.isShow.value != true}\">\r\n <h3 class=\"quastion-title \">\r\n <span [innerHTML]=\"surveyQuestion?.questionTitle\"></span>\r\n <span style=\"color: red;\" *ngIf=\"surveyQuestion.isRequired\">*</span>\r\n <p *ngIf=\"questionMinMaxIndicator\" class=\"text-danger\">\r\n <small >{{questionMinMaxIndicator}}</small>\r\n </p> \r\n </h3>\r\n <div class=\"text-quastion\">\r\n <ng-container *ngIf=\"isTextArea == false else textAreaTemplate\">\r\n <input class=\"form-control\" libMaskedForMinMax [attr.min]=\"fCtrls.inputMin.value\"\r\n [attr.max]=\"fCtrls.inputMax.value\" [formControl]=\"convertToFormControl(fCtrls.answer)\"\r\n [disabled]=\"isDisabled\" [attr.type]=\"fCtrls.inputTypeId.value | textBoxTypeAttr\">\r\n </ng-container>\r\n <ng-template #textAreaTemplate>\r\n <textarea class=\"form-control\" rows=\"2\" [formControl]=\"convertToFormControl(fCtrls.answer)\"\r\n [disabled]=\"isDisabled\"></textarea>\r\n </ng-template>\r\n </div>", styles: [""], dependencies: [{ kind: "directive", type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type:
|
|
699
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.7", type: QuestionTextTemplateComponent, selector: "lib-question-text-template", inputs: { isArabicLang: "isArabicLang", setQuestion: "setQuestion", isDisabled: "isDisabled" }, ngImport: i0, template: "<div class=\"quastion\" [formGroup]=\"rForm\" [attr.id]=\"'question_'+fCtrls.id.value\"\r\n [ngClass]=\"{'invalid-question': fCtrls.answer.invalid , 'd-none':fCtrls.isShow.value != true}\">\r\n <h3 class=\"quastion-title \">\r\n <span [innerHTML]=\"surveyQuestion?.questionTitle\"></span>\r\n <span style=\"color: red;\" *ngIf=\"surveyQuestion.isRequired\">*</span>\r\n <p *ngIf=\"questionMinMaxIndicator\" class=\"text-danger\">\r\n <small >{{questionMinMaxIndicator}}</small>\r\n </p> \r\n </h3>\r\n <div class=\"text-quastion\">\r\n <ng-container *ngIf=\"isTextArea == false else textAreaTemplate\">\r\n <input class=\"form-control\" libMaskedForMinMax [attr.min]=\"fCtrls.inputMin.value\"\r\n [attr.max]=\"fCtrls.inputMax.value\" [formControl]=\"convertToFormControl(fCtrls.answer)\"\r\n [disabled]=\"isDisabled\" [attr.type]=\"fCtrls.inputTypeId.value | textBoxTypeAttr\">\r\n </ng-container>\r\n <ng-template #textAreaTemplate>\r\n <textarea class=\"form-control\" rows=\"2\" [formControl]=\"convertToFormControl(fCtrls.answer)\"\r\n [disabled]=\"isDisabled\"></textarea>\r\n </ng-template>\r\n </div>", styles: [""], dependencies: [{ kind: "directive", type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: MaskedForMinMaxDirective, selector: "[libMaskedForMinMax]" }, { kind: "pipe", type: TextBoxTypeAttrPipe, name: "textBoxTypeAttr" }] }); }
|
|
678
700
|
}
|
|
679
701
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: QuestionTextTemplateComponent, decorators: [{
|
|
680
702
|
type: Component,
|
|
@@ -708,9 +730,9 @@ class QuestionRadioButtonTemplateComponent {
|
|
|
708
730
|
});
|
|
709
731
|
value.questionAllInfo.surveyAnswers.forEach(surveryAnswer => {
|
|
710
732
|
this.fCtrls.answerArray.push(this._formBuilder.group({
|
|
711
|
-
id:
|
|
712
|
-
title:
|
|
713
|
-
isSelected:
|
|
733
|
+
id: new FormControl(surveryAnswer.answerId),
|
|
734
|
+
title: new FormControl(surveryAnswer.answerTitle),
|
|
735
|
+
isSelected: new FormControl(false)
|
|
714
736
|
}));
|
|
715
737
|
});
|
|
716
738
|
if (value.isRequired == true) {
|
|
@@ -725,14 +747,14 @@ class QuestionRadioButtonTemplateComponent {
|
|
|
725
747
|
this._Store = _Store;
|
|
726
748
|
this.elemId = v4();
|
|
727
749
|
this.rForm = this._formBuilder.group({
|
|
728
|
-
id:
|
|
729
|
-
name:
|
|
730
|
-
title:
|
|
731
|
-
typeId:
|
|
732
|
-
description:
|
|
733
|
-
answer:
|
|
734
|
-
isDisabled:
|
|
735
|
-
isShow:
|
|
750
|
+
id: new FormControl(null),
|
|
751
|
+
name: new FormControl(null),
|
|
752
|
+
title: new FormControl(null),
|
|
753
|
+
typeId: new FormControl(null),
|
|
754
|
+
description: new FormControl(null),
|
|
755
|
+
answer: new FormControl(null),
|
|
756
|
+
isDisabled: new FormControl(false),
|
|
757
|
+
isShow: new FormControl(true),
|
|
736
758
|
answerArray: this._formBuilder.array([])
|
|
737
759
|
});
|
|
738
760
|
}
|
|
@@ -771,17 +793,17 @@ class QuestionRadioButtonTemplateComponent {
|
|
|
771
793
|
});
|
|
772
794
|
}
|
|
773
795
|
onChangeAnswer(item) {
|
|
774
|
-
this.fCtrls.answer.setValue(item.id);
|
|
796
|
+
this.fCtrls.answer.setValue(item.value.id);
|
|
775
797
|
}
|
|
776
798
|
convertToFormControl(element) {
|
|
777
799
|
return element;
|
|
778
800
|
}
|
|
779
801
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: QuestionRadioButtonTemplateComponent, deps: [{ token: i1.FormBuilder }, { token: SurveyLibService }, { token: i3.Store }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
780
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.7", type: QuestionRadioButtonTemplateComponent, selector: "lib-question-radio-button-template", inputs: { setQuestion: "setQuestion" }, ngImport: i0, template: "<div class=\"quastion\" [attr.id]=\"'question_'+fCtrls.id.value\" [ngClass]=\"{'invalid-question': fCtrls.answer.invalid , 'd-none':fCtrls.isShow.value != true}\">\r\n <h3 class=\"quastion-title \">\r\n <span [innerHTML]=\"surveyQuestion?.questionTitle\"></span>\r\n <span style=\"color: red;\" *ngIf=\"surveyQuestion.isRequired\">*</span>\r\n </h3>\r\n <div class=\"radio-button-quastion\">\r\n <div class=\"form-check form-check-radio form-check-inline\" \r\n *ngFor=\"let item of fCtrls.answerArray.controls;let i = index\">\r\n <input class=\"form-check-input\" type=\"radio\" (change)=\"onChangeAnswer(item
|
|
802
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.7", type: QuestionRadioButtonTemplateComponent, selector: "lib-question-radio-button-template", inputs: { setQuestion: "setQuestion" }, ngImport: i0, template: "<div class=\"quastion\" [attr.id]=\"'question_'+fCtrls.id.value\" [ngClass]=\"{'invalid-question': fCtrls.answer.invalid , 'd-none':fCtrls.isShow.value != true}\">\r\n <h3 class=\"quastion-title \">\r\n <span [innerHTML]=\"surveyQuestion?.questionTitle\"></span>\r\n <span style=\"color: red;\" *ngIf=\"surveyQuestion.isRequired\">*</span>\r\n </h3>\r\n <div class=\"radio-button-quastion\">\r\n <div class=\"form-check form-check-radio form-check-inline\" \r\n *ngFor=\"let item of fCtrls.answerArray.controls;let i = index\">\r\n <input class=\"form-check-input\" type=\"radio\" (change)=\"onChangeAnswer(item)\" [disabled]=\"fCtrls.isDisabled.value\"\r\n name=\"{{elemId}}__radio-btn-option\" id=\"{{elemId}}__radio-btn_{{i}}\" [checked]=\"item.value.isSelected == true? true : null\">\r\n <label class=\"form-check-label\" for=\"{{elemId}}__radio-btn_{{i}}\" [innerHTML]=\"item.value.title\"></label>\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [""], dependencies: [{ kind: "directive", type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] }); }
|
|
781
803
|
}
|
|
782
804
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: QuestionRadioButtonTemplateComponent, decorators: [{
|
|
783
805
|
type: Component,
|
|
784
|
-
args: [{ selector: 'lib-question-radio-button-template', template: "<div class=\"quastion\" [attr.id]=\"'question_'+fCtrls.id.value\" [ngClass]=\"{'invalid-question': fCtrls.answer.invalid , 'd-none':fCtrls.isShow.value != true}\">\r\n <h3 class=\"quastion-title \">\r\n <span [innerHTML]=\"surveyQuestion?.questionTitle\"></span>\r\n <span style=\"color: red;\" *ngIf=\"surveyQuestion.isRequired\">*</span>\r\n </h3>\r\n <div class=\"radio-button-quastion\">\r\n <div class=\"form-check form-check-radio form-check-inline\" \r\n *ngFor=\"let item of fCtrls.answerArray.controls;let i = index\">\r\n <input class=\"form-check-input\" type=\"radio\" (change)=\"onChangeAnswer(item
|
|
806
|
+
args: [{ selector: 'lib-question-radio-button-template', template: "<div class=\"quastion\" [attr.id]=\"'question_'+fCtrls.id.value\" [ngClass]=\"{'invalid-question': fCtrls.answer.invalid , 'd-none':fCtrls.isShow.value != true}\">\r\n <h3 class=\"quastion-title \">\r\n <span [innerHTML]=\"surveyQuestion?.questionTitle\"></span>\r\n <span style=\"color: red;\" *ngIf=\"surveyQuestion.isRequired\">*</span>\r\n </h3>\r\n <div class=\"radio-button-quastion\">\r\n <div class=\"form-check form-check-radio form-check-inline\" \r\n *ngFor=\"let item of fCtrls.answerArray.controls;let i = index\">\r\n <input class=\"form-check-input\" type=\"radio\" (change)=\"onChangeAnswer(item)\" [disabled]=\"fCtrls.isDisabled.value\"\r\n name=\"{{elemId}}__radio-btn-option\" id=\"{{elemId}}__radio-btn_{{i}}\" [checked]=\"item.value.isSelected == true? true : null\">\r\n <label class=\"form-check-label\" for=\"{{elemId}}__radio-btn_{{i}}\" [innerHTML]=\"item.value.title\"></label>\r\n </div>\r\n </div>\r\n</div>\r\n" }]
|
|
785
807
|
}], ctorParameters: function () { return [{ type: i1.FormBuilder }, { type: SurveyLibService }, { type: i3.Store }]; }, propDecorators: { setQuestion: [{
|
|
786
808
|
type: Input
|
|
787
809
|
}] } });
|
|
@@ -807,9 +829,9 @@ class QuestionCheckBoxTemplateComponent {
|
|
|
807
829
|
});
|
|
808
830
|
value.questionAllInfo.surveyAnswers.forEach(surveryAnswer => {
|
|
809
831
|
this.fCtrls.answerArray.push(this._formBuilder.group({
|
|
810
|
-
id:
|
|
811
|
-
title:
|
|
812
|
-
isSelected:
|
|
832
|
+
id: new FormControl(surveryAnswer.answerId),
|
|
833
|
+
title: new FormControl(surveryAnswer.answerTitle),
|
|
834
|
+
isSelected: new FormControl(false)
|
|
813
835
|
}));
|
|
814
836
|
});
|
|
815
837
|
if (value.isRequired == true) {
|
|
@@ -824,14 +846,14 @@ class QuestionCheckBoxTemplateComponent {
|
|
|
824
846
|
this._Store = _Store;
|
|
825
847
|
this.elemId = v4();
|
|
826
848
|
this.rForm = this._formBuilder.group({
|
|
827
|
-
id:
|
|
828
|
-
name:
|
|
829
|
-
title:
|
|
830
|
-
typeId:
|
|
831
|
-
description:
|
|
832
|
-
answer:
|
|
833
|
-
isDisabled:
|
|
834
|
-
isShow:
|
|
849
|
+
id: new FormControl(null),
|
|
850
|
+
name: new FormControl(null),
|
|
851
|
+
title: new FormControl(null),
|
|
852
|
+
typeId: new FormControl(null),
|
|
853
|
+
description: new FormControl(null),
|
|
854
|
+
answer: new FormControl(null),
|
|
855
|
+
isDisabled: new FormControl(false),
|
|
856
|
+
isShow: new FormControl(true),
|
|
835
857
|
answerArray: this._formBuilder.array([])
|
|
836
858
|
});
|
|
837
859
|
}
|
|
@@ -875,10 +897,10 @@ class QuestionCheckBoxTemplateComponent {
|
|
|
875
897
|
onChangeAnswer(item, event) {
|
|
876
898
|
var answerArr = this.fCtrls.answer.value || [];
|
|
877
899
|
if (event.target.checked == true) {
|
|
878
|
-
answerArr.push(item.id);
|
|
900
|
+
answerArr.push(item.value.id);
|
|
879
901
|
}
|
|
880
902
|
else {
|
|
881
|
-
answerArr = answerArr.filter(x => x != item.id);
|
|
903
|
+
answerArr = answerArr.filter(x => x != item.value.id);
|
|
882
904
|
}
|
|
883
905
|
answerArr = answerArr.length == 0 ? [] : answerArr;
|
|
884
906
|
this.fCtrls.answer.setValue(answerArr);
|
|
@@ -887,11 +909,11 @@ class QuestionCheckBoxTemplateComponent {
|
|
|
887
909
|
return element;
|
|
888
910
|
}
|
|
889
911
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: QuestionCheckBoxTemplateComponent, deps: [{ token: i1.FormBuilder }, { token: SurveyLibService }, { token: i3.Store }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
890
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.7", type: QuestionCheckBoxTemplateComponent, selector: "lib-question-check-box-template", inputs: { setQuestion: "setQuestion" }, ngImport: i0, template: "<div class=\"quastion\" [attr.id]=\"'question_'+fCtrls.id.value\" [ngClass]=\"{'invalid-question': fCtrls.answer.invalid , 'd-none':fCtrls.isShow.value != true}\">\r\n <h3 class=\"quastion-title \">\r\n <span [innerHTML]=\"fCtrls.title.value\"></span>\r\n <span style=\"color: red;\" *ngIf=\"surveyQuestion.isRequired\">*</span>\r\n </h3>\r\n\r\n <div class=\"checkbox-button-quastion\">\r\n <div class=\"form-check check-box-form-check\" *ngFor=\"let item of fCtrls.answerArray.controls ;let i = index\">\r\n <input type=\"checkbox\" class=\"form-check-input\" id=\"{{elemId}}__checkbox_{{i}}\" [disabled]=\"fCtrls.isDisabled.value\"\r\n (change)=\"onChangeAnswer(item
|
|
912
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.7", type: QuestionCheckBoxTemplateComponent, selector: "lib-question-check-box-template", inputs: { setQuestion: "setQuestion" }, ngImport: i0, template: "<div class=\"quastion\" [attr.id]=\"'question_'+fCtrls.id.value\" [ngClass]=\"{'invalid-question': fCtrls.answer.invalid , 'd-none':fCtrls.isShow.value != true}\">\r\n <h3 class=\"quastion-title \">\r\n <span [innerHTML]=\"fCtrls.title.value\"></span>\r\n <span style=\"color: red;\" *ngIf=\"surveyQuestion.isRequired\">*</span>\r\n </h3>\r\n\r\n <div class=\"checkbox-button-quastion\">\r\n <div class=\"form-check check-box-form-check\" *ngFor=\"let item of fCtrls.answerArray.controls ;let i = index\">\r\n <input type=\"checkbox\" class=\"form-check-input\" id=\"{{elemId}}__checkbox_{{i}}\" [disabled]=\"fCtrls.isDisabled.value\"\r\n (change)=\"onChangeAnswer(item ,$event)\" [checked]=\"item.value.isSelected == true? true : null\">\r\n <label class=\"form-check-label \" for=\"{{elemId}}__checkbox_{{i}}\" [innerHTML]=\"item.value.title\"></label>\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [""], dependencies: [{ kind: "directive", type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] }); }
|
|
891
913
|
}
|
|
892
914
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: QuestionCheckBoxTemplateComponent, decorators: [{
|
|
893
915
|
type: Component,
|
|
894
|
-
args: [{ selector: 'lib-question-check-box-template', template: "<div class=\"quastion\" [attr.id]=\"'question_'+fCtrls.id.value\" [ngClass]=\"{'invalid-question': fCtrls.answer.invalid , 'd-none':fCtrls.isShow.value != true}\">\r\n <h3 class=\"quastion-title \">\r\n <span [innerHTML]=\"fCtrls.title.value\"></span>\r\n <span style=\"color: red;\" *ngIf=\"surveyQuestion.isRequired\">*</span>\r\n </h3>\r\n\r\n <div class=\"checkbox-button-quastion\">\r\n <div class=\"form-check check-box-form-check\" *ngFor=\"let item of fCtrls.answerArray.controls ;let i = index\">\r\n <input type=\"checkbox\" class=\"form-check-input\" id=\"{{elemId}}__checkbox_{{i}}\" [disabled]=\"fCtrls.isDisabled.value\"\r\n (change)=\"onChangeAnswer(item
|
|
916
|
+
args: [{ selector: 'lib-question-check-box-template', template: "<div class=\"quastion\" [attr.id]=\"'question_'+fCtrls.id.value\" [ngClass]=\"{'invalid-question': fCtrls.answer.invalid , 'd-none':fCtrls.isShow.value != true}\">\r\n <h3 class=\"quastion-title \">\r\n <span [innerHTML]=\"fCtrls.title.value\"></span>\r\n <span style=\"color: red;\" *ngIf=\"surveyQuestion.isRequired\">*</span>\r\n </h3>\r\n\r\n <div class=\"checkbox-button-quastion\">\r\n <div class=\"form-check check-box-form-check\" *ngFor=\"let item of fCtrls.answerArray.controls ;let i = index\">\r\n <input type=\"checkbox\" class=\"form-check-input\" id=\"{{elemId}}__checkbox_{{i}}\" [disabled]=\"fCtrls.isDisabled.value\"\r\n (change)=\"onChangeAnswer(item ,$event)\" [checked]=\"item.value.isSelected == true? true : null\">\r\n <label class=\"form-check-label \" for=\"{{elemId}}__checkbox_{{i}}\" [innerHTML]=\"item.value.title\"></label>\r\n </div>\r\n </div>\r\n</div>\r\n" }]
|
|
895
917
|
}], ctorParameters: function () { return [{ type: i1.FormBuilder }, { type: SurveyLibService }, { type: i3.Store }]; }, propDecorators: { setQuestion: [{
|
|
896
918
|
type: Input
|
|
897
919
|
}] } });
|
|
@@ -927,14 +949,14 @@ class QuestionDropdownTemplateComponent {
|
|
|
927
949
|
this._Store = _Store;
|
|
928
950
|
this.emitter = new EventEmitter();
|
|
929
951
|
this.rForm = this._formBuilder.group({
|
|
930
|
-
id:
|
|
931
|
-
name:
|
|
932
|
-
title:
|
|
933
|
-
typeId:
|
|
934
|
-
description:
|
|
935
|
-
answer:
|
|
936
|
-
isDisabled:
|
|
937
|
-
isShow:
|
|
952
|
+
id: new FormControl(null),
|
|
953
|
+
name: new FormControl(null),
|
|
954
|
+
title: new FormControl(null),
|
|
955
|
+
typeId: new FormControl(null),
|
|
956
|
+
description: new FormControl(null),
|
|
957
|
+
answer: new FormControl(null),
|
|
958
|
+
isDisabled: new FormControl(false),
|
|
959
|
+
isShow: new FormControl(true),
|
|
938
960
|
});
|
|
939
961
|
}
|
|
940
962
|
ngOnInit() {
|
|
@@ -976,7 +998,7 @@ class QuestionDropdownTemplateComponent {
|
|
|
976
998
|
return element;
|
|
977
999
|
}
|
|
978
1000
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: QuestionDropdownTemplateComponent, deps: [{ token: i1.FormBuilder }, { token: SurveyLibService }, { token: i3.Store }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
979
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.7", type: QuestionDropdownTemplateComponent, selector: "lib-question-dropdown-template", inputs: { setQuestion: "setQuestion" }, outputs: { emitter: "emitter" }, ngImport: i0, template: "<div class=\"quastion\" [attr.id]=\"'question_'+fCtrls.id.value\" [ngClass]=\"{'invalid-question': fCtrls.answer.invalid , 'd-none':fCtrls.isShow.value != true}\">\r\n <h3 class=\"quastion-title \">\r\n <span [innerHTML]=\"fCtrls.title.value\"></span>\r\n <span style=\"color: red;\" *ngIf=\"surveyQuestion?.isRequired\">*</span>\r\n </h3>\r\n <div class=\"text-quastion text-quastion__dropdown\">\r\n <ng-select [items]=\"surveyQuestion?.surveyAnswers\" bindValue=\"answerId\" bindLabel=\"answerTitle\" class=\"form-control\"\r\n [formControl]=\"convertToFormControl(fCtrls.answer)\" [disabled]=\"fCtrls.isDisabled.value\" [multiple]=\"false\">\r\n </ng-select>\r\n </div>\r\n</div>\r\n", styles: [".text-quastion .form-control{padding:10px}\n"], dependencies: [{ kind: "directive", type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type:
|
|
1001
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.7", type: QuestionDropdownTemplateComponent, selector: "lib-question-dropdown-template", inputs: { setQuestion: "setQuestion" }, outputs: { emitter: "emitter" }, ngImport: i0, template: "<div class=\"quastion\" [attr.id]=\"'question_'+fCtrls.id.value\" [ngClass]=\"{'invalid-question': fCtrls.answer.invalid , 'd-none':fCtrls.isShow.value != true}\">\r\n <h3 class=\"quastion-title \">\r\n <span [innerHTML]=\"fCtrls.title.value\"></span>\r\n <span style=\"color: red;\" *ngIf=\"surveyQuestion?.isRequired\">*</span>\r\n </h3>\r\n <div class=\"text-quastion text-quastion__dropdown\">\r\n <ng-select [items]=\"surveyQuestion?.surveyAnswers\" bindValue=\"answerId\" bindLabel=\"answerTitle\" class=\"form-control\"\r\n [formControl]=\"convertToFormControl(fCtrls.answer)\" [disabled]=\"fCtrls.isDisabled.value\" [multiple]=\"false\">\r\n </ng-select>\r\n </div>\r\n</div>\r\n", styles: [".text-quastion .form-control{padding:10px}\n"], dependencies: [{ kind: "directive", type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: i5.NgSelectComponent, selector: "ng-select", inputs: ["bindLabel", "bindValue", "markFirst", "placeholder", "notFoundText", "typeToSearchText", "addTagText", "loadingText", "clearAllText", "appearance", "dropdownPosition", "appendTo", "loading", "closeOnSelect", "hideSelected", "selectOnTab", "openOnEnter", "maxSelectedItems", "groupBy", "groupValue", "bufferAmount", "virtualScroll", "selectableGroup", "selectableGroupAsModel", "searchFn", "trackByFn", "clearOnBackspace", "labelForId", "inputAttrs", "tabIndex", "readonly", "searchWhileComposing", "minTermLength", "editableSearchTerm", "keyDownFn", "typeahead", "multiple", "addTag", "searchable", "clearable", "isOpen", "items", "compareWith", "clearSearchOnAdd", "deselectOnClick"], outputs: ["blur", "focus", "change", "open", "close", "search", "clear", "add", "remove", "scroll", "scrollToEnd"] }] }); }
|
|
980
1002
|
}
|
|
981
1003
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: QuestionDropdownTemplateComponent, decorators: [{
|
|
982
1004
|
type: Component,
|
|
@@ -1005,9 +1027,9 @@ class QuestionMatrixTemplateComponent {
|
|
|
1005
1027
|
});
|
|
1006
1028
|
value.questionAllInfo.surveySubQuestions.forEach(x => {
|
|
1007
1029
|
var group = this._formBuilder.group({
|
|
1008
|
-
subQuestionId:
|
|
1009
|
-
questionTitle:
|
|
1010
|
-
answer:
|
|
1030
|
+
subQuestionId: new FormControl(x.questionId),
|
|
1031
|
+
questionTitle: new FormControl(x.questionTitle),
|
|
1032
|
+
answer: new FormControl(null),
|
|
1011
1033
|
});
|
|
1012
1034
|
if (value.isRequired == true) {
|
|
1013
1035
|
group.controls.answer.addValidators([Validators.required]);
|
|
@@ -1031,10 +1053,10 @@ class QuestionMatrixTemplateComponent {
|
|
|
1031
1053
|
this._Store = _Store;
|
|
1032
1054
|
this.elemId = v4();
|
|
1033
1055
|
this.rForm = this._formBuilder.group({
|
|
1034
|
-
id:
|
|
1035
|
-
typeId:
|
|
1036
|
-
isDisabled:
|
|
1037
|
-
isShow:
|
|
1056
|
+
id: new FormControl(null),
|
|
1057
|
+
typeId: new FormControl(null),
|
|
1058
|
+
isDisabled: new FormControl(false),
|
|
1059
|
+
isShow: new FormControl(true),
|
|
1038
1060
|
subQuestionArray: this._formBuilder.array([])
|
|
1039
1061
|
});
|
|
1040
1062
|
}
|
|
@@ -1067,7 +1089,7 @@ class QuestionMatrixTemplateComponent {
|
|
|
1067
1089
|
});
|
|
1068
1090
|
}
|
|
1069
1091
|
onChangeAnswer(question, answer) {
|
|
1070
|
-
const index = this.fCtrls.subQuestionArray.value.findIndex(x => x.subQuestionId == question.subQuestionId);
|
|
1092
|
+
const index = this.fCtrls.subQuestionArray.value.findIndex(x => x.subQuestionId == question.value.subQuestionId);
|
|
1071
1093
|
var subQuestionGroup = this.fCtrls.subQuestionArray.controls[index];
|
|
1072
1094
|
subQuestionGroup.controls.answer.setValue(answer.answerId);
|
|
1073
1095
|
// this.emitter.emit({
|
|
@@ -1080,11 +1102,11 @@ class QuestionMatrixTemplateComponent {
|
|
|
1080
1102
|
return element;
|
|
1081
1103
|
}
|
|
1082
1104
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: QuestionMatrixTemplateComponent, deps: [{ token: i1.FormBuilder }, { token: SurveyLibService }, { token: i3.Store }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1083
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.7", type: QuestionMatrixTemplateComponent, selector: "lib-question-matrix-template", inputs: { setQuestion: "setQuestion" }, ngImport: i0, template: "<div class=\"quastion\" [attr.id]=\"'question_'+fCtrls.id.value\" style=\" border-collapse: collapse;\"\r\n[ngClass]=\"{'d-none':fCtrls.isShow.value != true}\">\r\n <h3 class=\"quastion-title \">\r\n <span [innerHTML]=\"surveyQuestion?.questionTitle\"></span>\r\n <span style=\"color: red;\" *ngIf=\"surveyQuestion.isRequired\">*</span>\r\n </h3>\r\n <div class=\"matrix-question\" [formGroup]=\"rForm\">\r\n <div class=\"matrix-table\" formArrayName=\"subQuestionArray\">\r\n <div class=\"matrix-head-row\">\r\n <div class=\"matrix-col\">\r\n </div>\r\n <div class=\"matrix-col\" *ngFor=\"let answers of surveyQuestion?.surveyAnswers\" >\r\n <span [innerHTML]=\"answers.answerTitle\"></span>\r\n </div>\r\n </div>\r\n\r\n <div class=\"matrix-row\" [attr.id]=\"'question_'+questionGroup.value.subQuestionId\"\r\n *ngFor=\"let questionGroup of fCtrls.subQuestionArray.controls ;let subQuestionIndex = index\"\r\n [ngClass]=\"{'invalid-question': questionGroup.controls.answer.invalid}\">\r\n <div class=\"matrix-col matrix-sub-quastion\" [innerHTML]=\"questionGroup.value.questionTitle\">\r\n </div>\r\n <div class=\"matrix-col answer__container\" *ngFor=\"let answer of surveyQuestion?.surveyAnswers;let answerIndex = index\">\r\n <div class=\"form-check form-check-radio form-check-inline\">\r\n <input class=\"form-check-input\" type=\"radio\" name=\"{{elemId}}__radio-btn-option_{{subQuestionIndex}}\"\r\n id=\"{{elemId}}__radio-btn_{{subQuestionIndex}}_{{answerIndex}}\" (change)=\"onChangeAnswer(questionGroup
|
|
1105
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.7", type: QuestionMatrixTemplateComponent, selector: "lib-question-matrix-template", inputs: { setQuestion: "setQuestion" }, ngImport: i0, template: "<div class=\"quastion\" [attr.id]=\"'question_'+fCtrls.id.value\" style=\" border-collapse: collapse;\"\r\n[ngClass]=\"{'d-none':fCtrls.isShow.value != true}\">\r\n <h3 class=\"quastion-title \">\r\n <span [innerHTML]=\"surveyQuestion?.questionTitle\"></span>\r\n <span style=\"color: red;\" *ngIf=\"surveyQuestion.isRequired\">*</span>\r\n </h3>\r\n <div class=\"matrix-question\" [formGroup]=\"rForm\">\r\n <div class=\"matrix-table\" formArrayName=\"subQuestionArray\">\r\n <div class=\"matrix-head-row\">\r\n <div class=\"matrix-col\">\r\n </div>\r\n <div class=\"matrix-col\" *ngFor=\"let answers of surveyQuestion?.surveyAnswers\" >\r\n <span [innerHTML]=\"answers.answerTitle\"></span>\r\n </div>\r\n </div>\r\n\r\n <div class=\"matrix-row\" [attr.id]=\"'question_'+questionGroup.value.subQuestionId\"\r\n *ngFor=\"let questionGroup of fCtrls.subQuestionArray.controls ;let subQuestionIndex = index\"\r\n [ngClass]=\"{'invalid-question': questionGroup.controls.answer.invalid}\">\r\n <div class=\"matrix-col matrix-sub-quastion\" [innerHTML]=\"questionGroup.value.questionTitle\">\r\n </div>\r\n <div class=\"matrix-col answer__container\" *ngFor=\"let answer of surveyQuestion?.surveyAnswers;let answerIndex = index\">\r\n <div class=\"form-check form-check-radio form-check-inline\">\r\n <input class=\"form-check-input\" type=\"radio\" name=\"{{elemId}}__radio-btn-option_{{subQuestionIndex}}\"\r\n id=\"{{elemId}}__radio-btn_{{subQuestionIndex}}_{{answerIndex}}\" (change)=\"onChangeAnswer(questionGroup ,answer)\"\r\n value=\"{{answer.answerId}}\" [checked]=\"answer.answerId == questionGroup.value.answer\">\r\n <label class=\"form-check-label d-inline d-lg-none\" [innerHTML]=\"answer.answerTitle\"\r\n for=\"{{elemId}}__radio-btn_{{subQuestionIndex}}_{{answerIndex}}\"> </label>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n </div>\r\n\r\n </div>\r\n</div>", styles: ["@media (max-width: 767px){.quastion .quastion-title{position:sticky;top:150px;z-index:1000;padding:10px 20px;background-color:#4c3d8f;color:#fff;font-size:16px;box-shadow:4px 5px 5px #0000004d;border-radius:10px;-webkit-border-radius:10px;-moz-border-radius:10px;-ms-border-radius:10px;-o-border-radius:10px}.quastion .quastion-title:last-of-type(){position:static;z-index:initial}.quastion .matrix-question .matrix-table .matrix-row .matrix-col{width:100%!important}.matrix-table .matrix-row .matrix-col .form-check{flex-direction:row}.matrix-head-row{display:none!important}.answer__container.matrix-col{padding:5px 15px!important}.answer__container.matrix-col .form-check-radio .form-check-label{padding-right:15px!important}}\n"], dependencies: [{ kind: "directive", type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormArrayName, selector: "[formArrayName]", inputs: ["formArrayName"] }] }); }
|
|
1084
1106
|
}
|
|
1085
1107
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: QuestionMatrixTemplateComponent, decorators: [{
|
|
1086
1108
|
type: Component,
|
|
1087
|
-
args: [{ selector: 'lib-question-matrix-template', template: "<div class=\"quastion\" [attr.id]=\"'question_'+fCtrls.id.value\" style=\" border-collapse: collapse;\"\r\n[ngClass]=\"{'d-none':fCtrls.isShow.value != true}\">\r\n <h3 class=\"quastion-title \">\r\n <span [innerHTML]=\"surveyQuestion?.questionTitle\"></span>\r\n <span style=\"color: red;\" *ngIf=\"surveyQuestion.isRequired\">*</span>\r\n </h3>\r\n <div class=\"matrix-question\" [formGroup]=\"rForm\">\r\n <div class=\"matrix-table\" formArrayName=\"subQuestionArray\">\r\n <div class=\"matrix-head-row\">\r\n <div class=\"matrix-col\">\r\n </div>\r\n <div class=\"matrix-col\" *ngFor=\"let answers of surveyQuestion?.surveyAnswers\" >\r\n <span [innerHTML]=\"answers.answerTitle\"></span>\r\n </div>\r\n </div>\r\n\r\n <div class=\"matrix-row\" [attr.id]=\"'question_'+questionGroup.value.subQuestionId\"\r\n *ngFor=\"let questionGroup of fCtrls.subQuestionArray.controls ;let subQuestionIndex = index\"\r\n [ngClass]=\"{'invalid-question': questionGroup.controls.answer.invalid}\">\r\n <div class=\"matrix-col matrix-sub-quastion\" [innerHTML]=\"questionGroup.value.questionTitle\">\r\n </div>\r\n <div class=\"matrix-col answer__container\" *ngFor=\"let answer of surveyQuestion?.surveyAnswers;let answerIndex = index\">\r\n <div class=\"form-check form-check-radio form-check-inline\">\r\n <input class=\"form-check-input\" type=\"radio\" name=\"{{elemId}}__radio-btn-option_{{subQuestionIndex}}\"\r\n id=\"{{elemId}}__radio-btn_{{subQuestionIndex}}_{{answerIndex}}\" (change)=\"onChangeAnswer(questionGroup
|
|
1109
|
+
args: [{ selector: 'lib-question-matrix-template', template: "<div class=\"quastion\" [attr.id]=\"'question_'+fCtrls.id.value\" style=\" border-collapse: collapse;\"\r\n[ngClass]=\"{'d-none':fCtrls.isShow.value != true}\">\r\n <h3 class=\"quastion-title \">\r\n <span [innerHTML]=\"surveyQuestion?.questionTitle\"></span>\r\n <span style=\"color: red;\" *ngIf=\"surveyQuestion.isRequired\">*</span>\r\n </h3>\r\n <div class=\"matrix-question\" [formGroup]=\"rForm\">\r\n <div class=\"matrix-table\" formArrayName=\"subQuestionArray\">\r\n <div class=\"matrix-head-row\">\r\n <div class=\"matrix-col\">\r\n </div>\r\n <div class=\"matrix-col\" *ngFor=\"let answers of surveyQuestion?.surveyAnswers\" >\r\n <span [innerHTML]=\"answers.answerTitle\"></span>\r\n </div>\r\n </div>\r\n\r\n <div class=\"matrix-row\" [attr.id]=\"'question_'+questionGroup.value.subQuestionId\"\r\n *ngFor=\"let questionGroup of fCtrls.subQuestionArray.controls ;let subQuestionIndex = index\"\r\n [ngClass]=\"{'invalid-question': questionGroup.controls.answer.invalid}\">\r\n <div class=\"matrix-col matrix-sub-quastion\" [innerHTML]=\"questionGroup.value.questionTitle\">\r\n </div>\r\n <div class=\"matrix-col answer__container\" *ngFor=\"let answer of surveyQuestion?.surveyAnswers;let answerIndex = index\">\r\n <div class=\"form-check form-check-radio form-check-inline\">\r\n <input class=\"form-check-input\" type=\"radio\" name=\"{{elemId}}__radio-btn-option_{{subQuestionIndex}}\"\r\n id=\"{{elemId}}__radio-btn_{{subQuestionIndex}}_{{answerIndex}}\" (change)=\"onChangeAnswer(questionGroup ,answer)\"\r\n value=\"{{answer.answerId}}\" [checked]=\"answer.answerId == questionGroup.value.answer\">\r\n <label class=\"form-check-label d-inline d-lg-none\" [innerHTML]=\"answer.answerTitle\"\r\n for=\"{{elemId}}__radio-btn_{{subQuestionIndex}}_{{answerIndex}}\"> </label>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n </div>\r\n\r\n </div>\r\n</div>", styles: ["@media (max-width: 767px){.quastion .quastion-title{position:sticky;top:150px;z-index:1000;padding:10px 20px;background-color:#4c3d8f;color:#fff;font-size:16px;box-shadow:4px 5px 5px #0000004d;border-radius:10px;-webkit-border-radius:10px;-moz-border-radius:10px;-ms-border-radius:10px;-o-border-radius:10px}.quastion .quastion-title:last-of-type(){position:static;z-index:initial}.quastion .matrix-question .matrix-table .matrix-row .matrix-col{width:100%!important}.matrix-table .matrix-row .matrix-col .form-check{flex-direction:row}.matrix-head-row{display:none!important}.answer__container.matrix-col{padding:5px 15px!important}.answer__container.matrix-col .form-check-radio .form-check-label{padding-right:15px!important}}\n"] }]
|
|
1088
1110
|
}], ctorParameters: function () { return [{ type: i1.FormBuilder }, { type: SurveyLibService }, { type: i3.Store }]; }, propDecorators: { setQuestion: [{
|
|
1089
1111
|
type: Input
|
|
1090
1112
|
}] } });
|
|
@@ -1110,9 +1132,9 @@ class QuestionBooleanTemplateComponent {
|
|
|
1110
1132
|
});
|
|
1111
1133
|
value.questionAllInfo.surveyAnswers.forEach(surveryAnswer => {
|
|
1112
1134
|
this.fCtrls.answerArray.push(this._formBuilder.group({
|
|
1113
|
-
id:
|
|
1114
|
-
title:
|
|
1115
|
-
isSelected:
|
|
1135
|
+
id: new FormControl(surveryAnswer.answerId),
|
|
1136
|
+
title: new FormControl(surveryAnswer.answerTitle),
|
|
1137
|
+
isSelected: new FormControl(false)
|
|
1116
1138
|
}));
|
|
1117
1139
|
});
|
|
1118
1140
|
if (value.isRequired == true) {
|
|
@@ -1127,15 +1149,15 @@ class QuestionBooleanTemplateComponent {
|
|
|
1127
1149
|
this._Store = _Store;
|
|
1128
1150
|
this.elemId = v4();
|
|
1129
1151
|
this.rForm = this._formBuilder.group({
|
|
1130
|
-
id:
|
|
1131
|
-
name:
|
|
1132
|
-
title:
|
|
1133
|
-
typeId:
|
|
1134
|
-
description:
|
|
1135
|
-
answer:
|
|
1152
|
+
id: new FormControl(null),
|
|
1153
|
+
name: new FormControl(null),
|
|
1154
|
+
title: new FormControl(null),
|
|
1155
|
+
typeId: new FormControl(null),
|
|
1156
|
+
description: new FormControl(null),
|
|
1157
|
+
answer: new FormControl(null),
|
|
1158
|
+
isDisabled: new FormControl(false),
|
|
1159
|
+
isShow: new FormControl(true),
|
|
1136
1160
|
answerArray: this._formBuilder.array([]),
|
|
1137
|
-
isDisabled: [false],
|
|
1138
|
-
isShow: [true]
|
|
1139
1161
|
});
|
|
1140
1162
|
}
|
|
1141
1163
|
ngOnInit() {
|
|
@@ -1169,17 +1191,17 @@ class QuestionBooleanTemplateComponent {
|
|
|
1169
1191
|
});
|
|
1170
1192
|
}
|
|
1171
1193
|
onChangeAnswer(item) {
|
|
1172
|
-
this.fCtrls.answer.setValue(item.id);
|
|
1194
|
+
this.fCtrls.answer.setValue(item.value.id);
|
|
1173
1195
|
}
|
|
1174
1196
|
convertToFormControl(element) {
|
|
1175
1197
|
return element;
|
|
1176
1198
|
}
|
|
1177
1199
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: QuestionBooleanTemplateComponent, deps: [{ token: i1.FormBuilder }, { token: SurveyLibService }, { token: i3.Store }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1178
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.7", type: QuestionBooleanTemplateComponent, selector: "lib-question-boolean-template", inputs: { setQuestion: "setQuestion" }, ngImport: i0, template: "<div class=\"quastion\" [attr.id]=\"'question_'+fCtrls.id.value\"\r\n [ngClass]=\"{'invalid-question': fCtrls.answer.invalid , 'd-none':fCtrls.isShow.value != true}\">\r\n <h3 class=\"quastion-title \">\r\n <span [innerHTML]=\"fCtrls.title.value\"></span>\r\n <span style=\"color: red;\" *ngIf=\"surveyQuestion.isRequired\">*</span>\r\n </h3>\r\n <div class=\"radio-button-quastion\">\r\n <div class=\"form-check form-check-radio form-check-inline\"\r\n *ngFor=\"let item of fCtrls.answerArray.controls ;let i = index\">\r\n <input class=\"form-check-input\" type=\"radio\" (change)=\"onChangeAnswer(item
|
|
1200
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.7", type: QuestionBooleanTemplateComponent, selector: "lib-question-boolean-template", inputs: { setQuestion: "setQuestion" }, ngImport: i0, template: "<div class=\"quastion\" [attr.id]=\"'question_'+fCtrls.id.value\"\r\n [ngClass]=\"{'invalid-question': fCtrls.answer.invalid , 'd-none':fCtrls.isShow.value != true}\">\r\n <h3 class=\"quastion-title \">\r\n <span [innerHTML]=\"fCtrls.title.value\"></span>\r\n <span style=\"color: red;\" *ngIf=\"surveyQuestion.isRequired\">*</span>\r\n </h3>\r\n <div class=\"radio-button-quastion\">\r\n <div class=\"form-check form-check-radio form-check-inline\"\r\n *ngFor=\"let item of fCtrls.answerArray.controls ;let i = index\">\r\n <input class=\"form-check-input\" type=\"radio\" (change)=\"onChangeAnswer(item)\"\r\n [disabled]=\"fCtrls.isDisabled.value\" name=\"{{elemId}}__radio-btn-option\"\r\n id=\"{{elemId}}__radio-btn_{{i}}\" [checked]=\"item.value.isSelected == true? true : null\">\r\n <label class=\"form-check-label\" for=\"{{elemId}}__radio-btn_{{i}}\">{{item.value.title}}</label>\r\n </div>\r\n </div>\r\n</div>", styles: [""], dependencies: [{ kind: "directive", type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] }); }
|
|
1179
1201
|
}
|
|
1180
1202
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: QuestionBooleanTemplateComponent, decorators: [{
|
|
1181
1203
|
type: Component,
|
|
1182
|
-
args: [{ selector: 'lib-question-boolean-template', template: "<div class=\"quastion\" [attr.id]=\"'question_'+fCtrls.id.value\"\r\n [ngClass]=\"{'invalid-question': fCtrls.answer.invalid , 'd-none':fCtrls.isShow.value != true}\">\r\n <h3 class=\"quastion-title \">\r\n <span [innerHTML]=\"fCtrls.title.value\"></span>\r\n <span style=\"color: red;\" *ngIf=\"surveyQuestion.isRequired\">*</span>\r\n </h3>\r\n <div class=\"radio-button-quastion\">\r\n <div class=\"form-check form-check-radio form-check-inline\"\r\n *ngFor=\"let item of fCtrls.answerArray.controls ;let i = index\">\r\n <input class=\"form-check-input\" type=\"radio\" (change)=\"onChangeAnswer(item
|
|
1204
|
+
args: [{ selector: 'lib-question-boolean-template', template: "<div class=\"quastion\" [attr.id]=\"'question_'+fCtrls.id.value\"\r\n [ngClass]=\"{'invalid-question': fCtrls.answer.invalid , 'd-none':fCtrls.isShow.value != true}\">\r\n <h3 class=\"quastion-title \">\r\n <span [innerHTML]=\"fCtrls.title.value\"></span>\r\n <span style=\"color: red;\" *ngIf=\"surveyQuestion.isRequired\">*</span>\r\n </h3>\r\n <div class=\"radio-button-quastion\">\r\n <div class=\"form-check form-check-radio form-check-inline\"\r\n *ngFor=\"let item of fCtrls.answerArray.controls ;let i = index\">\r\n <input class=\"form-check-input\" type=\"radio\" (change)=\"onChangeAnswer(item)\"\r\n [disabled]=\"fCtrls.isDisabled.value\" name=\"{{elemId}}__radio-btn-option\"\r\n id=\"{{elemId}}__radio-btn_{{i}}\" [checked]=\"item.value.isSelected == true? true : null\">\r\n <label class=\"form-check-label\" for=\"{{elemId}}__radio-btn_{{i}}\">{{item.value.title}}</label>\r\n </div>\r\n </div>\r\n</div>" }]
|
|
1183
1205
|
}], ctorParameters: function () { return [{ type: i1.FormBuilder }, { type: SurveyLibService }, { type: i3.Store }]; }, propDecorators: { setQuestion: [{
|
|
1184
1206
|
type: Input
|
|
1185
1207
|
}] } });
|
|
@@ -1205,13 +1227,13 @@ class QuestionDropdownMultiTemplateComponent {
|
|
|
1205
1227
|
});
|
|
1206
1228
|
value.questionAllInfo.surveyAnswers.forEach(surveryAnswer => {
|
|
1207
1229
|
this.fCtrls.answerArray.push(this._formBuilder.group({
|
|
1208
|
-
id:
|
|
1209
|
-
title:
|
|
1210
|
-
isSelected:
|
|
1230
|
+
id: new FormControl(surveryAnswer.answerId),
|
|
1231
|
+
title: new FormControl(surveryAnswer.answerTitle),
|
|
1232
|
+
isSelected: new FormControl(false)
|
|
1211
1233
|
}));
|
|
1212
1234
|
});
|
|
1213
1235
|
if (value.isRequired == true) {
|
|
1214
|
-
this.fCtrls.answer.addValidators([Validators
|
|
1236
|
+
this.fCtrls.answer.addValidators([Validators.required]);
|
|
1215
1237
|
this.fCtrls.answer.updateValueAndValidity();
|
|
1216
1238
|
}
|
|
1217
1239
|
}
|
|
@@ -1222,14 +1244,14 @@ class QuestionDropdownMultiTemplateComponent {
|
|
|
1222
1244
|
this._Store = _Store;
|
|
1223
1245
|
this.elemId = v4();
|
|
1224
1246
|
this.rForm = this._formBuilder.group({
|
|
1225
|
-
id:
|
|
1226
|
-
name:
|
|
1227
|
-
title:
|
|
1228
|
-
typeId:
|
|
1229
|
-
description:
|
|
1230
|
-
answer:
|
|
1231
|
-
isDisabled:
|
|
1232
|
-
isShow:
|
|
1247
|
+
id: new FormControl(null),
|
|
1248
|
+
name: new FormControl(null),
|
|
1249
|
+
title: new FormControl(null),
|
|
1250
|
+
typeId: new FormControl(null),
|
|
1251
|
+
description: new FormControl(null),
|
|
1252
|
+
answer: new FormControl(null),
|
|
1253
|
+
isDisabled: new FormControl(false),
|
|
1254
|
+
isShow: new FormControl(true),
|
|
1233
1255
|
answerArray: this._formBuilder.array([])
|
|
1234
1256
|
});
|
|
1235
1257
|
}
|
|
@@ -1268,7 +1290,7 @@ class QuestionDropdownMultiTemplateComponent {
|
|
|
1268
1290
|
return element;
|
|
1269
1291
|
}
|
|
1270
1292
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: QuestionDropdownMultiTemplateComponent, deps: [{ token: i1.FormBuilder }, { token: SurveyLibService }, { token: i3.Store }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1271
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.7", type: QuestionDropdownMultiTemplateComponent, selector: "lib-question-dropdown-multi-template", inputs: { setQuestion: "setQuestion" }, ngImport: i0, template: "<div class=\"quastion\" [attr.id]=\"'question_'+fCtrls.id.value\" [ngClass]=\"{'invalid-question': fCtrls.answer.invalid , 'd-none':fCtrls.isShow.value != true}\">\r\n <h3 class=\"quastion-title \">\r\n <span [innerHTML]=\"fCtrls.title.value\"></span>\r\n <span style=\"color: red;\" *ngIf=\"surveyQuestion.isRequired\">*</span>\r\n </h3>\r\n <div class=\"text-quastion text-quastion__dropdown\">\r\n <ng-select [items]=\"this.fCtrls.answerArray.value\" bindValue=\"id\" bindLabel=\"title\" class=\"form-control\"\r\n [formControl]=\"convertToFormControl(fCtrls.answer)\" [disabled]=\"fCtrls.isDisabled.value\" [multiple]=\"true\">\r\n </ng-select>\r\n </div>\r\n</div>\r\n", styles: [".text-quastion .form-control{padding:10px}\n"], dependencies: [{ kind: "directive", type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type:
|
|
1293
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.7", type: QuestionDropdownMultiTemplateComponent, selector: "lib-question-dropdown-multi-template", inputs: { setQuestion: "setQuestion" }, ngImport: i0, template: "<div class=\"quastion\" [attr.id]=\"'question_'+fCtrls.id.value\" [ngClass]=\"{'invalid-question': fCtrls.answer.invalid , 'd-none':fCtrls.isShow.value != true}\">\r\n <h3 class=\"quastion-title \">\r\n <span [innerHTML]=\"fCtrls.title.value\"></span>\r\n <span style=\"color: red;\" *ngIf=\"surveyQuestion.isRequired\">*</span>\r\n </h3>\r\n <div class=\"text-quastion text-quastion__dropdown\">\r\n <ng-select [items]=\"this.fCtrls.answerArray.value\" bindValue=\"id\" bindLabel=\"title\" class=\"form-control\"\r\n [formControl]=\"convertToFormControl(fCtrls.answer)\" [disabled]=\"fCtrls.isDisabled.value\" [multiple]=\"true\">\r\n </ng-select>\r\n </div>\r\n</div>\r\n", styles: [".text-quastion .form-control{padding:10px}\n"], dependencies: [{ kind: "directive", type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: i5.NgSelectComponent, selector: "ng-select", inputs: ["bindLabel", "bindValue", "markFirst", "placeholder", "notFoundText", "typeToSearchText", "addTagText", "loadingText", "clearAllText", "appearance", "dropdownPosition", "appendTo", "loading", "closeOnSelect", "hideSelected", "selectOnTab", "openOnEnter", "maxSelectedItems", "groupBy", "groupValue", "bufferAmount", "virtualScroll", "selectableGroup", "selectableGroupAsModel", "searchFn", "trackByFn", "clearOnBackspace", "labelForId", "inputAttrs", "tabIndex", "readonly", "searchWhileComposing", "minTermLength", "editableSearchTerm", "keyDownFn", "typeahead", "multiple", "addTag", "searchable", "clearable", "isOpen", "items", "compareWith", "clearSearchOnAdd", "deselectOnClick"], outputs: ["blur", "focus", "change", "open", "close", "search", "clear", "add", "remove", "scroll", "scrollToEnd"] }] }); }
|
|
1272
1294
|
}
|
|
1273
1295
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: QuestionDropdownMultiTemplateComponent, decorators: [{
|
|
1274
1296
|
type: Component,
|
|
@@ -1404,14 +1426,14 @@ class QuestionCascadeTemplateComponent {
|
|
|
1404
1426
|
}
|
|
1405
1427
|
}
|
|
1406
1428
|
identify(index, item) {
|
|
1407
|
-
return item.id;
|
|
1429
|
+
return item.value.id;
|
|
1408
1430
|
}
|
|
1409
1431
|
setQuestions(value) {
|
|
1410
1432
|
this.surveyQuestionArr.push(value);
|
|
1411
1433
|
var group = this._formBuilder.group({
|
|
1412
|
-
id:
|
|
1413
|
-
typeId:
|
|
1414
|
-
answer: null
|
|
1434
|
+
id: new FormControl(value.questionId),
|
|
1435
|
+
typeId: new FormControl(value.questionTypeId),
|
|
1436
|
+
answer: new FormControl(null)
|
|
1415
1437
|
});
|
|
1416
1438
|
if (value.isRequired == true) {
|
|
1417
1439
|
group.controls.answer.addValidators([Validators.required]);
|
|
@@ -1421,11 +1443,11 @@ class QuestionCascadeTemplateComponent {
|
|
|
1421
1443
|
console.log(this.fCtrls.questionArr.value);
|
|
1422
1444
|
}
|
|
1423
1445
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: QuestionCascadeTemplateComponent, deps: [{ token: i1.FormBuilder }, { token: SurveyLibService }, { token: ApiService }, { token: i3.Store }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1424
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.7", type: QuestionCascadeTemplateComponent, selector: "lib-question-cascade-template", inputs: { pageId: "pageId", questionGroupId: "questionGroupId", isPre: "isPre", surveyLanguageId: "surveyLanguageId", applicantKey: "applicantKey", setQuestion: "setQuestion" }, ngImport: i0, template: "<ng-container *ngFor=\"let item of questionFormArray.
|
|
1446
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.7", type: QuestionCascadeTemplateComponent, selector: "lib-question-cascade-template", inputs: { pageId: "pageId", questionGroupId: "questionGroupId", isPre: "isPre", surveyLanguageId: "surveyLanguageId", applicantKey: "applicantKey", setQuestion: "setQuestion" }, ngImport: i0, template: "<ng-container *ngFor=\"let item of questionFormArray.controls; trackBy:identify ; let i = index\">\r\n <lib-question-dropdown-template #questionDropdownTemplate [setQuestion]=\"(pageQuestions$ |async) |findQuestion :item.value.id \"\r\n (emitter)=\"onUpdateAnswer($event)\" >\r\n </lib-question-dropdown-template> \r\n</ng-container>", styles: [""], dependencies: [{ kind: "directive", type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "component", type: QuestionDropdownTemplateComponent, selector: "lib-question-dropdown-template", inputs: ["setQuestion"], outputs: ["emitter"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }, { kind: "pipe", type: FindQuestionPipe, name: "findQuestion" }] }); }
|
|
1425
1447
|
}
|
|
1426
1448
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: QuestionCascadeTemplateComponent, decorators: [{
|
|
1427
1449
|
type: Component,
|
|
1428
|
-
args: [{ selector: 'lib-question-cascade-template', template: "<ng-container *ngFor=\"let item of questionFormArray.
|
|
1450
|
+
args: [{ selector: 'lib-question-cascade-template', template: "<ng-container *ngFor=\"let item of questionFormArray.controls; trackBy:identify ; let i = index\">\r\n <lib-question-dropdown-template #questionDropdownTemplate [setQuestion]=\"(pageQuestions$ |async) |findQuestion :item.value.id \"\r\n (emitter)=\"onUpdateAnswer($event)\" >\r\n </lib-question-dropdown-template> \r\n</ng-container>" }]
|
|
1429
1451
|
}], ctorParameters: function () { return [{ type: i1.FormBuilder }, { type: SurveyLibService }, { type: ApiService }, { type: i3.Store }]; }, propDecorators: { pageId: [{
|
|
1430
1452
|
type: Input
|
|
1431
1453
|
}], questionGroupId: [{
|
|
@@ -1440,6 +1462,120 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.7", ngImpor
|
|
|
1440
1462
|
type: Input
|
|
1441
1463
|
}] } });
|
|
1442
1464
|
|
|
1465
|
+
class QuestionFeedbackTemplateComponent {
|
|
1466
|
+
get fCtrls() {
|
|
1467
|
+
return this.rForm.controls;
|
|
1468
|
+
}
|
|
1469
|
+
get questionTypeEnum() {
|
|
1470
|
+
return QuestionTypeEnum;
|
|
1471
|
+
}
|
|
1472
|
+
get inputTypeEnum() {
|
|
1473
|
+
return InputTypeEnum;
|
|
1474
|
+
}
|
|
1475
|
+
set setQuestion(value) {
|
|
1476
|
+
if (!this.surveyQuestion) {
|
|
1477
|
+
this.surveyQuestion = value.questionAllInfo;
|
|
1478
|
+
this.rForm.patchValue({
|
|
1479
|
+
id: value.questionId,
|
|
1480
|
+
name: value.questionAllInfo.questionName,
|
|
1481
|
+
title: value.questionAllInfo.questionTitle,
|
|
1482
|
+
typeId: value.questionAllInfo.questionTypeId,
|
|
1483
|
+
description: value.questionAllInfo.questionDescription,
|
|
1484
|
+
isDisabled: value.questionAllInfo.isReadOnly,
|
|
1485
|
+
isShow: value.questionAllInfo.isVisable
|
|
1486
|
+
});
|
|
1487
|
+
if (value.questionAllInfo.surveyAnswers[0]?.answerId != null && value.questionAllInfo.surveyAnswers[0]?.answerId != undefined) {
|
|
1488
|
+
this.fCtrls.surveyAnswerId.setValue(value.questionAllInfo.surveyAnswers[0].answerId);
|
|
1489
|
+
if (value.questionAllInfo.surveyAnswers[0].evaluationTypeId == EvaluationTypeEnum.Stars) {
|
|
1490
|
+
this.fCtrls.inputTypeId.setValue(InputTypeEnum.Stars);
|
|
1491
|
+
}
|
|
1492
|
+
else if (value.questionAllInfo.surveyAnswers[0].evaluationTypeId == EvaluationTypeEnum.Pagination) {
|
|
1493
|
+
this.fCtrls.inputTypeId.setValue(InputTypeEnum.Pagination);
|
|
1494
|
+
}
|
|
1495
|
+
}
|
|
1496
|
+
if (value.isRequired == true) {
|
|
1497
|
+
this.fCtrls.answer.addValidators([Validators.required]);
|
|
1498
|
+
this.fCtrls.answer.updateValueAndValidity();
|
|
1499
|
+
}
|
|
1500
|
+
this.toggleEnableAnswer(value.questionAllInfo.isReadOnly);
|
|
1501
|
+
}
|
|
1502
|
+
}
|
|
1503
|
+
set isDisabled(value) {
|
|
1504
|
+
this.toggleEnableAnswer(value);
|
|
1505
|
+
}
|
|
1506
|
+
constructor(_formBuilder, _surveyLibService, _Store) {
|
|
1507
|
+
this._formBuilder = _formBuilder;
|
|
1508
|
+
this._surveyLibService = _surveyLibService;
|
|
1509
|
+
this._Store = _Store;
|
|
1510
|
+
this.isArabicLang = false;
|
|
1511
|
+
this.rForm = this._formBuilder.group({
|
|
1512
|
+
id: new FormControl(null),
|
|
1513
|
+
name: new FormControl(null),
|
|
1514
|
+
title: new FormControl(null),
|
|
1515
|
+
typeId: new FormControl(null),
|
|
1516
|
+
description: new FormControl(null),
|
|
1517
|
+
surveyAnswerId: new FormControl(null),
|
|
1518
|
+
answer: new FormControl(null),
|
|
1519
|
+
isDisabled: new FormControl(false),
|
|
1520
|
+
isShow: new FormControl(true),
|
|
1521
|
+
inputTypeId: new FormControl(null),
|
|
1522
|
+
});
|
|
1523
|
+
}
|
|
1524
|
+
ngOnInit() {
|
|
1525
|
+
this.fCtrls.answer.valueChanges.pipe().pipe(debounceTime(200), distinctUntilChanged()).subscribe(value => {
|
|
1526
|
+
setTimeout(() => {
|
|
1527
|
+
const formValue = this.rForm.value;
|
|
1528
|
+
this._Store.dispatch(surveyActions.updateQuestionAnswer({
|
|
1529
|
+
questionId: formValue.id,
|
|
1530
|
+
answer: value,
|
|
1531
|
+
isValid: this.fCtrls.answer.valid
|
|
1532
|
+
}));
|
|
1533
|
+
}, 100);
|
|
1534
|
+
});
|
|
1535
|
+
this._Store.select(questionSelectors.pageQuestions).pipe(map(arr => arr.find(x => x.questionId == this.fCtrls.id.value)))
|
|
1536
|
+
.pipe(filter(x => x != null), pairwise()).subscribe(value => {
|
|
1537
|
+
const oldValue = value[0];
|
|
1538
|
+
const newValue = value[1];
|
|
1539
|
+
//updated answer
|
|
1540
|
+
if (oldValue?.answerText != newValue?.answerText) {
|
|
1541
|
+
this.fCtrls.answer.setValue(newValue?.answerText, { emitEvent: false });
|
|
1542
|
+
}
|
|
1543
|
+
//updated isDisabled
|
|
1544
|
+
if (oldValue?.isDisabled != newValue?.isDisabled) {
|
|
1545
|
+
this.fCtrls.isDisabled.setValue(newValue?.isDisabled);
|
|
1546
|
+
}
|
|
1547
|
+
//updated isShow
|
|
1548
|
+
if (oldValue?.isShow != newValue?.isShow) {
|
|
1549
|
+
this.fCtrls.isShow.setValue(newValue?.isShow);
|
|
1550
|
+
if (newValue?.isShow == false) {
|
|
1551
|
+
this.fCtrls.answer.setValue(null);
|
|
1552
|
+
}
|
|
1553
|
+
}
|
|
1554
|
+
});
|
|
1555
|
+
}
|
|
1556
|
+
toggleEnableAnswer(isReadOnly) {
|
|
1557
|
+
if (isReadOnly == true) {
|
|
1558
|
+
this.fCtrls.answer.disable();
|
|
1559
|
+
}
|
|
1560
|
+
else {
|
|
1561
|
+
this.fCtrls.answer.enable();
|
|
1562
|
+
}
|
|
1563
|
+
this.fCtrls.answer.updateValueAndValidity();
|
|
1564
|
+
}
|
|
1565
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: QuestionFeedbackTemplateComponent, deps: [{ token: i1.FormBuilder }, { token: SurveyLibService }, { token: i3.Store }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1566
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.7", type: QuestionFeedbackTemplateComponent, selector: "lib-question-feedback-template", inputs: { isArabicLang: "isArabicLang", setQuestion: "setQuestion", isDisabled: "isDisabled" }, ngImport: i0, template: "<div class=\"quastion\" [formGroup]=\"rForm\" [attr.id]=\"'question_'+fCtrls.id.value\"\n [ngClass]=\"{'invalid-question': fCtrls.answer.invalid , 'd-none':fCtrls.isShow.value != true}\">\n <h3 class=\"quastion-title \">\n <span [innerHTML]=\"surveyQuestion?.questionTitle\"></span>\n <span style=\"color: red;\" *ngIf=\"surveyQuestion.isRequired\">*</span>\n </h3>\n <div class=\"text-quastion \" >\n <ng-container *ngIf=\"fCtrls.inputTypeId.value == inputTypeEnum.Stars else paginationTemplate\">\n <rating [formControl]=\"fCtrls.answer\" [max]=\"surveyQuestion?.surveyAnswers[0].maxValue\"></rating>\n </ng-container>\n <ng-template #paginationTemplate>\n <div style=\"margin-top: 20px;\">\n <pagination nextText=\">\" previousText=\"<\" [formControl]=\"fCtrls.answer\"\n [itemsPerPage]=\"1\" [totalItems]=\"surveyQuestion?.surveyAnswers[0].maxValue\" [maxSize]=\"10\"></pagination>\n </div>\n </ng-template>\n </div>", styles: [":host ::ng-deep rating .bs-rating-star{font-size:45px;color:#ffc107}:host ::ng-deep rating .bs-rating-star.active{color:#ffc107}\n"], dependencies: [{ kind: "directive", type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: i5$1.RatingComponent, selector: "rating", inputs: ["max", "readonly", "titles", "customTemplate"], outputs: ["onHover", "onLeave"] }, { kind: "component", type: i6.PaginationComponent, selector: "pagination", inputs: ["align", "maxSize", "boundaryLinks", "directionLinks", "firstText", "previousText", "nextText", "lastText", "rotate", "pageBtnClass", "disabled", "customPageTemplate", "customNextTemplate", "customPreviousTemplate", "customFirstTemplate", "customLastTemplate", "itemsPerPage", "totalItems"], outputs: ["numPages", "pageChanged"] }] }); }
|
|
1567
|
+
}
|
|
1568
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: QuestionFeedbackTemplateComponent, decorators: [{
|
|
1569
|
+
type: Component,
|
|
1570
|
+
args: [{ selector: 'lib-question-feedback-template', template: "<div class=\"quastion\" [formGroup]=\"rForm\" [attr.id]=\"'question_'+fCtrls.id.value\"\n [ngClass]=\"{'invalid-question': fCtrls.answer.invalid , 'd-none':fCtrls.isShow.value != true}\">\n <h3 class=\"quastion-title \">\n <span [innerHTML]=\"surveyQuestion?.questionTitle\"></span>\n <span style=\"color: red;\" *ngIf=\"surveyQuestion.isRequired\">*</span>\n </h3>\n <div class=\"text-quastion \" >\n <ng-container *ngIf=\"fCtrls.inputTypeId.value == inputTypeEnum.Stars else paginationTemplate\">\n <rating [formControl]=\"fCtrls.answer\" [max]=\"surveyQuestion?.surveyAnswers[0].maxValue\"></rating>\n </ng-container>\n <ng-template #paginationTemplate>\n <div style=\"margin-top: 20px;\">\n <pagination nextText=\">\" previousText=\"<\" [formControl]=\"fCtrls.answer\"\n [itemsPerPage]=\"1\" [totalItems]=\"surveyQuestion?.surveyAnswers[0].maxValue\" [maxSize]=\"10\"></pagination>\n </div>\n </ng-template>\n </div>", styles: [":host ::ng-deep rating .bs-rating-star{font-size:45px;color:#ffc107}:host ::ng-deep rating .bs-rating-star.active{color:#ffc107}\n"] }]
|
|
1571
|
+
}], ctorParameters: function () { return [{ type: i1.FormBuilder }, { type: SurveyLibService }, { type: i3.Store }]; }, propDecorators: { isArabicLang: [{
|
|
1572
|
+
type: Input
|
|
1573
|
+
}], setQuestion: [{
|
|
1574
|
+
type: Input
|
|
1575
|
+
}], isDisabled: [{
|
|
1576
|
+
type: Input
|
|
1577
|
+
}] } });
|
|
1578
|
+
|
|
1443
1579
|
class FilterQuestionPipe {
|
|
1444
1580
|
transform(arr, questionGroupId) {
|
|
1445
1581
|
return arr.filter(x => x.questionGroupId == questionGroupId && x.parentQuestionId == null);
|
|
@@ -1582,13 +1718,13 @@ class SurveryLibComponent {
|
|
|
1582
1718
|
}
|
|
1583
1719
|
return null;
|
|
1584
1720
|
}
|
|
1585
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: SurveryLibComponent, deps: [{ token: SurveyLibService }, { token: i3.Store }, { token:
|
|
1586
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.7", type: SurveryLibComponent, selector: "lib-survery-lib", inputs: { isPre: "isPre", surveyLanguageId: "surveyLanguageId", applicantKey: "applicantKey", isArabicLang: "isArabicLang" }, outputs: { surveyResultEmit: "surveyResultEmit", selectLanguageEmit: "selectLanguageEmit" }, ngImport: i0, template: "<div id=\"survery-card-{{surveryLibraryDivId}}\" class=\"survay-card\">\r\n <div [attr.id]=\"'survey-page_'+fCtrls.currentPageId.value\">\r\n <ng-container *ngFor=\"let item of (pageQuestionGroups$ | async)\">\r\n <div class=\"survay-card\">\r\n <div class=\"survay-card-body\">\r\n <div class=\"survay-group\">\r\n <div class=\"title\">\r\n <h2 class=\"group-title\" [innerHTML]=\"item.questionGroupName\">\r\n </h2>\r\n <span class=\"group-sub-title \" [innerHTML]=\"item.questionGroupDescription\">\r\n </span>\r\n </div>\r\n <ng-container\r\n *ngFor=\"let question of ((pageQuestions$|async) |filterQuestion : item.questionGroupId); trackBy:questionIdentify\">\r\n <lib-question-boolean-template #questionBooleanTemplate [setQuestion]=\"question\"\r\n *ngIf=\"question.questionType == questionTypeEnum.Boolean\">\r\n </lib-question-boolean-template>\r\n\r\n <lib-question-text-template #questionTextTemplate [setQuestion]=\"question\"\r\n *ngIf=\"question.questionType == questionTypeEnum.TextInput\"\r\n [isArabicLang]=\"isArabicLang\"></lib-question-text-template>\r\n\r\n <lib-question-radio-button-template #questionRadioButtonTemplate [setQuestion]=\"question\"\r\n *ngIf=\"question.questionType == questionTypeEnum.RadioButton\">\r\n </lib-question-radio-button-template>\r\n\r\n <lib-question-dropdown-template #questionDropdownTemplate [setQuestion]=\"question\"\r\n *ngIf=\"question.questionType == questionTypeEnum.DropDown\"></lib-question-dropdown-template>\r\n\r\n <lib-question-dropdown-multi-template [setQuestion]=\"question\"\r\n *ngIf=\"question.questionType == questionTypeEnum.DropDownMulti\">\r\n </lib-question-dropdown-multi-template>\r\n\r\n <lib-question-check-box-template #questionCheckBoxTemplate [setQuestion]=\"question\"\r\n *ngIf=\"question.questionType == questionTypeEnum.CheckBox\">\r\n </lib-question-check-box-template>\r\n\r\n <lib-question-matrix-template #questionMatrixTemplate [setQuestion]=\"question\"\r\n *ngIf=\"question.questionType == questionTypeEnum.Matrix\">\r\n </lib-question-matrix-template>\r\n\r\n <lib-question-cascade-template #questionCascadeTemplate [setQuestion]=\"question\"\r\n *ngIf=\"question.questionType == questionTypeEnum.Cascade\"\r\n [applicantKey]=\"applicantKey\" [isPre]=\"isPre\" [surveyLanguageId]=\"surveyLanguageId\"\r\n [pageId]=\"question.surveyPageId\" [questionGroupId]=\"question.questionGroupId\"></lib-question-cascade-template>\r\n </ng-container>\r\n </div>\r\n </div>\r\n </div>\r\n </ng-container>\r\n </div>\r\n <div class=\"survay-card-footr\" *ngIf=\"fCtrls.showedSurveyPages.value.length > 0\">\r\n <div class=\"container\" style=\" justify-content: start;\">\r\n <div class=\"survay-pagination fw-bold\">\r\n <span>{{ curruntShowedSurveyPages$ | async}}</span>\r\n <span class=\"ms-2 me-2\">{{isArabicLang ? '\u0645\u0646' : 'of'}} </span>\r\n <span>{{fCtrls.showedSurveyPages.value.length}}</span>\r\n </div>\r\n </div>\r\n </div>\r\n</div>", styles: [".disable__btn{background-color:gray!important;cursor:not-allowed}.quastion{padding:10px}.quastion .quastion-title{color:var(--dark-100, #363636);text-align:right;font-family:Almarai;font-size:18px;font-style:normal;font-weight:700;line-height:20.6px}\n"], dependencies: [{ kind: "directive", type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: QuestionTextTemplateComponent, selector: "lib-question-text-template", inputs: ["isArabicLang", "setQuestion", "isDisabled"] }, { kind: "component", type: QuestionRadioButtonTemplateComponent, selector: "lib-question-radio-button-template", inputs: ["setQuestion"] }, { kind: "component", type: QuestionCheckBoxTemplateComponent, selector: "lib-question-check-box-template", inputs: ["setQuestion"] }, { kind: "component", type: QuestionDropdownTemplateComponent, selector: "lib-question-dropdown-template", inputs: ["setQuestion"], outputs: ["emitter"] }, { kind: "component", type: QuestionMatrixTemplateComponent, selector: "lib-question-matrix-template", inputs: ["setQuestion"] }, { kind: "component", type: QuestionBooleanTemplateComponent, selector: "lib-question-boolean-template", inputs: ["setQuestion"] }, { kind: "component", type: QuestionDropdownMultiTemplateComponent, selector: "lib-question-dropdown-multi-template", inputs: ["setQuestion"] }, { kind: "component", type: QuestionCascadeTemplateComponent, selector: "lib-question-cascade-template", inputs: ["pageId", "questionGroupId", "isPre", "surveyLanguageId", "applicantKey", "setQuestion"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }, { kind: "pipe", type: FilterQuestionPipe, name: "filterQuestion" }] }); }
|
|
1721
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: SurveryLibComponent, deps: [{ token: SurveyLibService }, { token: i3.Store }, { token: i1.FormBuilder }, { token: CheckRuleExpsUsecase }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1722
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.7", type: SurveryLibComponent, selector: "lib-survery-lib", inputs: { isPre: "isPre", surveyLanguageId: "surveyLanguageId", applicantKey: "applicantKey", isArabicLang: "isArabicLang" }, outputs: { surveyResultEmit: "surveyResultEmit", selectLanguageEmit: "selectLanguageEmit" }, ngImport: i0, template: "<div id=\"survery-card-{{surveryLibraryDivId}}\" class=\"survay-card\">\r\n <div [attr.id]=\"'survey-page_'+fCtrls.currentPageId.value\">\r\n <ng-container *ngFor=\"let item of (pageQuestionGroups$ | async)\">\r\n <div class=\"survay-card\">\r\n <div class=\"survay-card-body\">\r\n <div class=\"survay-group\">\r\n <div class=\"title\">\r\n <h2 class=\"group-title\" [innerHTML]=\"item.questionGroupName\">\r\n </h2>\r\n <span class=\"group-sub-title \" [innerHTML]=\"item.questionGroupDescription\">\r\n </span>\r\n </div>\r\n <ng-container\r\n *ngFor=\"let question of ((pageQuestions$|async) |filterQuestion : item.questionGroupId); trackBy:questionIdentify\">\r\n <lib-question-boolean-template #questionBooleanTemplate [setQuestion]=\"question\"\r\n *ngIf=\"question.questionType == questionTypeEnum.Boolean\">\r\n </lib-question-boolean-template>\r\n\r\n <lib-question-text-template #questionTextTemplate [setQuestion]=\"question\"\r\n *ngIf=\"question.questionType == questionTypeEnum.TextInput\"\r\n [isArabicLang]=\"isArabicLang\"></lib-question-text-template>\r\n\r\n <lib-question-feedback-template #questionFeedTemplate [setQuestion]=\"question\"\r\n *ngIf=\"question.questionType == questionTypeEnum.FeedBack\"\r\n [isArabicLang]=\"isArabicLang\"></lib-question-feedback-template>\r\n\r\n <lib-question-radio-button-template #questionRadioButtonTemplate [setQuestion]=\"question\"\r\n *ngIf=\"question.questionType == questionTypeEnum.RadioButton\">\r\n </lib-question-radio-button-template>\r\n\r\n <lib-question-dropdown-template #questionDropdownTemplate [setQuestion]=\"question\"\r\n *ngIf=\"question.questionType == questionTypeEnum.DropDown\"></lib-question-dropdown-template>\r\n\r\n <lib-question-dropdown-multi-template [setQuestion]=\"question\"\r\n *ngIf=\"question.questionType == questionTypeEnum.DropDownMulti\">\r\n </lib-question-dropdown-multi-template>\r\n\r\n <lib-question-check-box-template #questionCheckBoxTemplate [setQuestion]=\"question\"\r\n *ngIf=\"question.questionType == questionTypeEnum.CheckBox\">\r\n </lib-question-check-box-template>\r\n\r\n <lib-question-matrix-template #questionMatrixTemplate [setQuestion]=\"question\"\r\n *ngIf=\"question.questionType == questionTypeEnum.Matrix\">\r\n </lib-question-matrix-template>\r\n\r\n <lib-question-cascade-template #questionCascadeTemplate [setQuestion]=\"question\"\r\n *ngIf=\"question.questionType == questionTypeEnum.Cascade\"\r\n [applicantKey]=\"applicantKey\" [isPre]=\"isPre\" [surveyLanguageId]=\"surveyLanguageId\"\r\n [pageId]=\"question.surveyPageId\" [questionGroupId]=\"question.questionGroupId\"></lib-question-cascade-template>\r\n </ng-container>\r\n </div>\r\n </div>\r\n </div>\r\n </ng-container>\r\n </div>\r\n <div class=\"survay-card-footr\" *ngIf=\"fCtrls.showedSurveyPages.value.length > 0\">\r\n <div class=\"container\" style=\" justify-content: start;\">\r\n <div class=\"survay-pagination fw-bold\">\r\n <span>{{ curruntShowedSurveyPages$ | async}}</span>\r\n <span class=\"ms-2 me-2\">{{isArabicLang ? '\u0645\u0646' : 'of'}} </span>\r\n <span>{{fCtrls.showedSurveyPages.value.length}}</span>\r\n </div>\r\n </div>\r\n </div>\r\n</div>", styles: [".disable__btn{background-color:gray!important;cursor:not-allowed}.quastion{padding:10px}.quastion .quastion-title{color:var(--dark-100, #363636);text-align:right;font-family:Almarai;font-size:18px;font-style:normal;font-weight:700;line-height:20.6px}\n"], dependencies: [{ kind: "directive", type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: QuestionTextTemplateComponent, selector: "lib-question-text-template", inputs: ["isArabicLang", "setQuestion", "isDisabled"] }, { kind: "component", type: QuestionRadioButtonTemplateComponent, selector: "lib-question-radio-button-template", inputs: ["setQuestion"] }, { kind: "component", type: QuestionCheckBoxTemplateComponent, selector: "lib-question-check-box-template", inputs: ["setQuestion"] }, { kind: "component", type: QuestionDropdownTemplateComponent, selector: "lib-question-dropdown-template", inputs: ["setQuestion"], outputs: ["emitter"] }, { kind: "component", type: QuestionMatrixTemplateComponent, selector: "lib-question-matrix-template", inputs: ["setQuestion"] }, { kind: "component", type: QuestionBooleanTemplateComponent, selector: "lib-question-boolean-template", inputs: ["setQuestion"] }, { kind: "component", type: QuestionDropdownMultiTemplateComponent, selector: "lib-question-dropdown-multi-template", inputs: ["setQuestion"] }, { kind: "component", type: QuestionCascadeTemplateComponent, selector: "lib-question-cascade-template", inputs: ["pageId", "questionGroupId", "isPre", "surveyLanguageId", "applicantKey", "setQuestion"] }, { kind: "component", type: QuestionFeedbackTemplateComponent, selector: "lib-question-feedback-template", inputs: ["isArabicLang", "setQuestion", "isDisabled"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }, { kind: "pipe", type: FilterQuestionPipe, name: "filterQuestion" }] }); }
|
|
1587
1723
|
}
|
|
1588
1724
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: SurveryLibComponent, decorators: [{
|
|
1589
1725
|
type: Component,
|
|
1590
|
-
args: [{ selector: 'lib-survery-lib', template: "<div id=\"survery-card-{{surveryLibraryDivId}}\" class=\"survay-card\">\r\n <div [attr.id]=\"'survey-page_'+fCtrls.currentPageId.value\">\r\n <ng-container *ngFor=\"let item of (pageQuestionGroups$ | async)\">\r\n <div class=\"survay-card\">\r\n <div class=\"survay-card-body\">\r\n <div class=\"survay-group\">\r\n <div class=\"title\">\r\n <h2 class=\"group-title\" [innerHTML]=\"item.questionGroupName\">\r\n </h2>\r\n <span class=\"group-sub-title \" [innerHTML]=\"item.questionGroupDescription\">\r\n </span>\r\n </div>\r\n <ng-container\r\n *ngFor=\"let question of ((pageQuestions$|async) |filterQuestion : item.questionGroupId); trackBy:questionIdentify\">\r\n <lib-question-boolean-template #questionBooleanTemplate [setQuestion]=\"question\"\r\n *ngIf=\"question.questionType == questionTypeEnum.Boolean\">\r\n </lib-question-boolean-template>\r\n\r\n <lib-question-text-template #questionTextTemplate [setQuestion]=\"question\"\r\n *ngIf=\"question.questionType == questionTypeEnum.TextInput\"\r\n [isArabicLang]=\"isArabicLang\"></lib-question-text-template>\r\n\r\n <lib-question-radio-button-template #questionRadioButtonTemplate [setQuestion]=\"question\"\r\n *ngIf=\"question.questionType == questionTypeEnum.RadioButton\">\r\n </lib-question-radio-button-template>\r\n\r\n <lib-question-dropdown-template #questionDropdownTemplate [setQuestion]=\"question\"\r\n *ngIf=\"question.questionType == questionTypeEnum.DropDown\"></lib-question-dropdown-template>\r\n\r\n <lib-question-dropdown-multi-template [setQuestion]=\"question\"\r\n *ngIf=\"question.questionType == questionTypeEnum.DropDownMulti\">\r\n </lib-question-dropdown-multi-template>\r\n\r\n <lib-question-check-box-template #questionCheckBoxTemplate [setQuestion]=\"question\"\r\n *ngIf=\"question.questionType == questionTypeEnum.CheckBox\">\r\n </lib-question-check-box-template>\r\n\r\n <lib-question-matrix-template #questionMatrixTemplate [setQuestion]=\"question\"\r\n *ngIf=\"question.questionType == questionTypeEnum.Matrix\">\r\n </lib-question-matrix-template>\r\n\r\n <lib-question-cascade-template #questionCascadeTemplate [setQuestion]=\"question\"\r\n *ngIf=\"question.questionType == questionTypeEnum.Cascade\"\r\n [applicantKey]=\"applicantKey\" [isPre]=\"isPre\" [surveyLanguageId]=\"surveyLanguageId\"\r\n [pageId]=\"question.surveyPageId\" [questionGroupId]=\"question.questionGroupId\"></lib-question-cascade-template>\r\n </ng-container>\r\n </div>\r\n </div>\r\n </div>\r\n </ng-container>\r\n </div>\r\n <div class=\"survay-card-footr\" *ngIf=\"fCtrls.showedSurveyPages.value.length > 0\">\r\n <div class=\"container\" style=\" justify-content: start;\">\r\n <div class=\"survay-pagination fw-bold\">\r\n <span>{{ curruntShowedSurveyPages$ | async}}</span>\r\n <span class=\"ms-2 me-2\">{{isArabicLang ? '\u0645\u0646' : 'of'}} </span>\r\n <span>{{fCtrls.showedSurveyPages.value.length}}</span>\r\n </div>\r\n </div>\r\n </div>\r\n</div>", styles: [".disable__btn{background-color:gray!important;cursor:not-allowed}.quastion{padding:10px}.quastion .quastion-title{color:var(--dark-100, #363636);text-align:right;font-family:Almarai;font-size:18px;font-style:normal;font-weight:700;line-height:20.6px}\n"] }]
|
|
1591
|
-
}], ctorParameters: function () { return [{ type: SurveyLibService }, { type: i3.Store }, { type:
|
|
1726
|
+
args: [{ selector: 'lib-survery-lib', template: "<div id=\"survery-card-{{surveryLibraryDivId}}\" class=\"survay-card\">\r\n <div [attr.id]=\"'survey-page_'+fCtrls.currentPageId.value\">\r\n <ng-container *ngFor=\"let item of (pageQuestionGroups$ | async)\">\r\n <div class=\"survay-card\">\r\n <div class=\"survay-card-body\">\r\n <div class=\"survay-group\">\r\n <div class=\"title\">\r\n <h2 class=\"group-title\" [innerHTML]=\"item.questionGroupName\">\r\n </h2>\r\n <span class=\"group-sub-title \" [innerHTML]=\"item.questionGroupDescription\">\r\n </span>\r\n </div>\r\n <ng-container\r\n *ngFor=\"let question of ((pageQuestions$|async) |filterQuestion : item.questionGroupId); trackBy:questionIdentify\">\r\n <lib-question-boolean-template #questionBooleanTemplate [setQuestion]=\"question\"\r\n *ngIf=\"question.questionType == questionTypeEnum.Boolean\">\r\n </lib-question-boolean-template>\r\n\r\n <lib-question-text-template #questionTextTemplate [setQuestion]=\"question\"\r\n *ngIf=\"question.questionType == questionTypeEnum.TextInput\"\r\n [isArabicLang]=\"isArabicLang\"></lib-question-text-template>\r\n\r\n <lib-question-feedback-template #questionFeedTemplate [setQuestion]=\"question\"\r\n *ngIf=\"question.questionType == questionTypeEnum.FeedBack\"\r\n [isArabicLang]=\"isArabicLang\"></lib-question-feedback-template>\r\n\r\n <lib-question-radio-button-template #questionRadioButtonTemplate [setQuestion]=\"question\"\r\n *ngIf=\"question.questionType == questionTypeEnum.RadioButton\">\r\n </lib-question-radio-button-template>\r\n\r\n <lib-question-dropdown-template #questionDropdownTemplate [setQuestion]=\"question\"\r\n *ngIf=\"question.questionType == questionTypeEnum.DropDown\"></lib-question-dropdown-template>\r\n\r\n <lib-question-dropdown-multi-template [setQuestion]=\"question\"\r\n *ngIf=\"question.questionType == questionTypeEnum.DropDownMulti\">\r\n </lib-question-dropdown-multi-template>\r\n\r\n <lib-question-check-box-template #questionCheckBoxTemplate [setQuestion]=\"question\"\r\n *ngIf=\"question.questionType == questionTypeEnum.CheckBox\">\r\n </lib-question-check-box-template>\r\n\r\n <lib-question-matrix-template #questionMatrixTemplate [setQuestion]=\"question\"\r\n *ngIf=\"question.questionType == questionTypeEnum.Matrix\">\r\n </lib-question-matrix-template>\r\n\r\n <lib-question-cascade-template #questionCascadeTemplate [setQuestion]=\"question\"\r\n *ngIf=\"question.questionType == questionTypeEnum.Cascade\"\r\n [applicantKey]=\"applicantKey\" [isPre]=\"isPre\" [surveyLanguageId]=\"surveyLanguageId\"\r\n [pageId]=\"question.surveyPageId\" [questionGroupId]=\"question.questionGroupId\"></lib-question-cascade-template>\r\n </ng-container>\r\n </div>\r\n </div>\r\n </div>\r\n </ng-container>\r\n </div>\r\n <div class=\"survay-card-footr\" *ngIf=\"fCtrls.showedSurveyPages.value.length > 0\">\r\n <div class=\"container\" style=\" justify-content: start;\">\r\n <div class=\"survay-pagination fw-bold\">\r\n <span>{{ curruntShowedSurveyPages$ | async}}</span>\r\n <span class=\"ms-2 me-2\">{{isArabicLang ? '\u0645\u0646' : 'of'}} </span>\r\n <span>{{fCtrls.showedSurveyPages.value.length}}</span>\r\n </div>\r\n </div>\r\n </div>\r\n</div>", styles: [".disable__btn{background-color:gray!important;cursor:not-allowed}.quastion{padding:10px}.quastion .quastion-title{color:var(--dark-100, #363636);text-align:right;font-family:Almarai;font-size:18px;font-style:normal;font-weight:700;line-height:20.6px}\n"] }]
|
|
1727
|
+
}], ctorParameters: function () { return [{ type: SurveyLibService }, { type: i3.Store }, { type: i1.FormBuilder }, { type: CheckRuleExpsUsecase }]; }, propDecorators: { isPre: [{
|
|
1592
1728
|
type: Input
|
|
1593
1729
|
}], surveyLanguageId: [{
|
|
1594
1730
|
type: Input
|
|
@@ -1660,7 +1796,7 @@ const _surveyReducer = createReducer(initialSurveyState, on(surveyActions.loadSu
|
|
|
1660
1796
|
const question = selectAll(state.questionArr).find(x => x.questionId == props.questionId);
|
|
1661
1797
|
if (question) {
|
|
1662
1798
|
var updateModel;
|
|
1663
|
-
if (question.questionType == QuestionTypeEnum.TextInput) {
|
|
1799
|
+
if (question.questionType == QuestionTypeEnum.TextInput || question.questionType == QuestionTypeEnum.FeedBack) {
|
|
1664
1800
|
updateModel = {
|
|
1665
1801
|
id: props.questionId,
|
|
1666
1802
|
changes: {
|
|
@@ -1761,11 +1897,12 @@ class SurveryLibModule {
|
|
|
1761
1897
|
TextBoxTypeAttrPipe,
|
|
1762
1898
|
QuestionCascadeTemplateComponent,
|
|
1763
1899
|
MaskedForMinMaxDirective,
|
|
1764
|
-
FindQuestionPipe
|
|
1900
|
+
FindQuestionPipe,
|
|
1901
|
+
QuestionFeedbackTemplateComponent], imports: [CommonModule, HttpClientModule, ReactiveFormsModule, FormsModule, NgSelectModule, i3.StoreFeatureModule, i2.EffectsFeatureModule, RatingModule, PaginationModule], exports: [SurveryLibComponent,
|
|
1765
1902
|
StoreModule] }); }
|
|
1766
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: SurveryLibModule, imports: [CommonModule, HttpClientModule, ReactiveFormsModule, FormsModule,
|
|
1903
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: SurveryLibModule, imports: [CommonModule, HttpClientModule, ReactiveFormsModule, FormsModule, NgSelectModule,
|
|
1767
1904
|
StoreModule.forFeature('survey-lib', surveyReducer),
|
|
1768
|
-
EffectsModule.forFeature([]), StoreModule] }); }
|
|
1905
|
+
EffectsModule.forFeature([]), RatingModule, PaginationModule, StoreModule] }); }
|
|
1769
1906
|
}
|
|
1770
1907
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: SurveryLibModule, decorators: [{
|
|
1771
1908
|
type: NgModule,
|
|
@@ -1785,12 +1922,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.7", ngImpor
|
|
|
1785
1922
|
TextBoxTypeAttrPipe,
|
|
1786
1923
|
QuestionCascadeTemplateComponent,
|
|
1787
1924
|
MaskedForMinMaxDirective,
|
|
1788
|
-
FindQuestionPipe
|
|
1925
|
+
FindQuestionPipe,
|
|
1926
|
+
QuestionFeedbackTemplateComponent
|
|
1789
1927
|
],
|
|
1790
1928
|
imports: [
|
|
1791
|
-
CommonModule, HttpClientModule, ReactiveFormsModule, FormsModule,
|
|
1929
|
+
CommonModule, HttpClientModule, ReactiveFormsModule, FormsModule, NgSelectModule,
|
|
1792
1930
|
StoreModule.forFeature('survey-lib', surveyReducer),
|
|
1793
|
-
EffectsModule.forFeature([])
|
|
1931
|
+
EffectsModule.forFeature([]), RatingModule, PaginationModule
|
|
1794
1932
|
],
|
|
1795
1933
|
exports: [
|
|
1796
1934
|
SurveryLibComponent,
|