survery-lib 2.1.3 → 2.1.5

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.
Files changed (27) hide show
  1. package/assets/style.css +398 -398
  2. package/esm2022/lib/components/question-boolean-template/question-boolean-template.component.mjs +11 -1
  3. package/esm2022/lib/components/question-cascade-template/question-cascade-template.component.mjs +5 -5
  4. package/esm2022/lib/components/question-check-box-template/question-check-box-template.component.mjs +10 -1
  5. package/esm2022/lib/components/question-dropdown-multi-template/question-dropdown-multi-template.component.mjs +10 -1
  6. package/esm2022/lib/components/question-dropdown-template/question-dropdown-template.component.mjs +13 -3
  7. package/esm2022/lib/components/question-feedback-template/question-feedback-template.component.mjs +10 -1
  8. package/esm2022/lib/components/question-matrix-template/question-matrix-template.component.mjs +13 -1
  9. package/esm2022/lib/components/question-radio-button-template/question-radio-button-template.component.mjs +12 -3
  10. package/esm2022/lib/components/question-text-template/question-text-template.component.mjs +10 -1
  11. package/esm2022/lib/core/states/survey-store/survey.effect.mjs +121 -0
  12. package/esm2022/lib/survery-lib.component.mjs +8 -5
  13. package/esm2022/lib/survery-lib.module.mjs +4 -3
  14. package/fesm2022/survery-lib.mjs +215 -17
  15. package/fesm2022/survery-lib.mjs.map +1 -1
  16. package/lib/components/question-boolean-template/question-boolean-template.component.d.ts +1 -0
  17. package/lib/components/question-cascade-template/question-cascade-template.component.d.ts +1 -1
  18. package/lib/components/question-check-box-template/question-check-box-template.component.d.ts +1 -0
  19. package/lib/components/question-dropdown-multi-template/question-dropdown-multi-template.component.d.ts +1 -0
  20. package/lib/components/question-dropdown-template/question-dropdown-template.component.d.ts +6 -2
  21. package/lib/components/question-feedback-template/question-feedback-template.component.d.ts +1 -0
  22. package/lib/components/question-matrix-template/question-matrix-template.component.d.ts +1 -0
  23. package/lib/components/question-radio-button-template/question-radio-button-template.component.d.ts +1 -0
  24. package/lib/components/question-text-template/question-text-template.component.d.ts +1 -0
  25. package/lib/core/states/survey-store/survey.effect.d.ts +13 -0
  26. package/lib/survery-lib.component.d.ts +4 -2
  27. package/package.json +3 -2
@@ -1,7 +1,7 @@
1
1
  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
- import { Subject, of, debounceTime, distinctUntilChanged, map, filter, pairwise, take } from 'rxjs';
4
+ import { Subject, of, debounceTime, distinctUntilChanged, map, filter, pairwise, take, withLatestFrom, switchMap } from 'rxjs';
5
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';
@@ -9,6 +9,7 @@ import { createFeatureSelector, createSelector, createAction, props, createReduc
9
9
  import { createEntityAdapter } from '@ngrx/entity';
10
10
  import * as i4 from '@angular/common';
11
11
  import { CommonModule } from '@angular/common';
12
+ import { SubSink } from 'subsink';
12
13
  import * as i5 from '@ng-select/ng-select';
13
14
  import { NgSelectModule } from '@ng-select/ng-select';
14
15
  import * as i1$1 from '@angular/common/http';
@@ -17,8 +18,8 @@ import * as i5$1 from 'ngx-bootstrap/rating';
17
18
  import { RatingModule } from 'ngx-bootstrap/rating';
18
19
  import * as i6 from 'ngx-bootstrap/pagination';
19
20
  import { PaginationModule } from 'ngx-bootstrap/pagination';
20
- import * as i2 from '@ngrx/effects';
21
- import { EffectsModule } from '@ngrx/effects';
21
+ import * as i1$2 from '@ngrx/effects';
22
+ import { createEffect, ofType, EffectsModule } from '@ngrx/effects';
22
23
 
23
24
  var QuestionTypeEnum;
24
25
  (function (QuestionTypeEnum) {
@@ -658,6 +659,14 @@ class QuestionTextTemplateComponent {
658
659
  }
659
660
  this.fCtrls.answer.updateValueAndValidity();
660
661
  }
662
+ var question = this.questionArr().find(x => x.questionId == value.questionId);
663
+ if (question?.answerText) {
664
+ this.rForm.patchValue({
665
+ answer: question.answerText,
666
+ isDisabled: question.isDisabled,
667
+ isShow: question.isShow
668
+ }, { emitEvent: false });
669
+ }
661
670
  this.toggleEnableAnswer(value.questionAllInfo.isReadOnly);
662
671
  }
663
672
  }
@@ -668,6 +677,7 @@ class QuestionTextTemplateComponent {
668
677
  this._formBuilder = _formBuilder;
669
678
  this._surveyLibService = _surveyLibService;
670
679
  this._Store = _Store;
680
+ this.questionArr = this._Store.selectSignal(questionSelectors.pageQuestions);
671
681
  this.isArabicLang = false;
672
682
  this.rForm = this._formBuilder.group({
673
683
  id: new FormControl(null),
@@ -785,6 +795,14 @@ class QuestionRadioButtonTemplateComponent {
785
795
  this.fCtrls.answer.addValidators([Validators.required]);
786
796
  this.fCtrls.answer.updateValueAndValidity();
787
797
  }
798
+ var question = this.questionArr().find(x => x.questionId == value.questionId);
799
+ if (question?.answerId) {
800
+ this.rForm.patchValue({ answer: question.answerId,
801
+ isDisabled: question.isDisabled,
802
+ isShow: question.isShow
803
+ }, { emitEvent: false });
804
+ this.fCtrls.answerArray.controls.find(x => x.value.id == question.answerId).controls.isSelected.setValue(true);
805
+ }
788
806
  }
789
807
  }
790
808
  constructor(_formBuilder, _surveyLibService, _Store) {
@@ -792,6 +810,7 @@ class QuestionRadioButtonTemplateComponent {
792
810
  this._surveyLibService = _surveyLibService;
793
811
  this._Store = _Store;
794
812
  this.elemId = v4();
813
+ this.questionArr = this._Store.selectSignal(questionSelectors.pageQuestions);
795
814
  this.rForm = this._formBuilder.group({
796
815
  id: new FormControl(null),
797
816
  name: new FormControl(null),
@@ -805,7 +824,7 @@ class QuestionRadioButtonTemplateComponent {
805
824
  });
806
825
  }
807
826
  ngOnInit() {
808
- this.fCtrls.answer.valueChanges.pipe().pipe(debounceTime(200)).subscribe(value => {
827
+ this.fCtrls.answer.valueChanges.pipe().pipe(debounceTime(200), distinctUntilChanged()).subscribe(value => {
809
828
  const formValue = this.rForm.value;
810
829
  this._Store.dispatch(surveyActions.updateQuestionAnswer({
811
830
  questionId: formValue.id,
@@ -884,6 +903,14 @@ class QuestionCheckBoxTemplateComponent {
884
903
  this.fCtrls.answer.addValidators([Validators.required]);
885
904
  this.fCtrls.answer.updateValueAndValidity();
886
905
  }
906
+ var question = this.questionArr().find(x => x.questionId == value.questionId);
907
+ if (question?.answerIdArr) {
908
+ this.rForm.patchValue({
909
+ answer: question.answerIdArr,
910
+ isDisabled: question.isDisabled,
911
+ isShow: question.isShow
912
+ }, { emitEvent: false });
913
+ }
887
914
  }
888
915
  }
889
916
  constructor(_formBuilder, _surveyLibService, _Store) {
@@ -891,6 +918,7 @@ class QuestionCheckBoxTemplateComponent {
891
918
  this._surveyLibService = _surveyLibService;
892
919
  this._Store = _Store;
893
920
  this.elemId = v4();
921
+ this.questionArr = this._Store.selectSignal(questionSelectors.pageQuestions);
894
922
  this.rForm = this._formBuilder.group({
895
923
  id: new FormControl(null),
896
924
  name: new FormControl(null),
@@ -987,12 +1015,18 @@ class QuestionDropdownTemplateComponent {
987
1015
  this.fCtrls.answer.addValidators([Validators.required]);
988
1016
  this.fCtrls.answer.updateValueAndValidity();
989
1017
  }
1018
+ var question = this.questionArr().find(x => x.questionId == value.questionId);
1019
+ if (question?.answerId) {
1020
+ this.rForm.controls.answer.setValue(question.answerId, { emitEvent: false });
1021
+ }
990
1022
  }
991
1023
  }
992
1024
  constructor(_formBuilder, _surveyLibService, _Store) {
993
1025
  this._formBuilder = _formBuilder;
994
1026
  this._surveyLibService = _surveyLibService;
995
1027
  this._Store = _Store;
1028
+ this.subs = new SubSink();
1029
+ this.questionArr = this._Store.selectSignal(questionSelectors.pageQuestions);
996
1030
  this.emitter = new EventEmitter();
997
1031
  this.rForm = this._formBuilder.group({
998
1032
  id: new FormControl(null),
@@ -1005,8 +1039,11 @@ class QuestionDropdownTemplateComponent {
1005
1039
  isShow: new FormControl(true),
1006
1040
  });
1007
1041
  }
1042
+ ngOnDestroy() {
1043
+ this.subs.unsubscribe();
1044
+ }
1008
1045
  ngOnInit() {
1009
- this.fCtrls.answer.valueChanges.pipe().pipe(debounceTime(200), distinctUntilChanged()).subscribe(value => {
1046
+ this.subs.sink = this.fCtrls.answer.valueChanges.pipe().pipe(debounceTime(200), distinctUntilChanged()).subscribe(value => {
1010
1047
  const formValue = this.rForm.value;
1011
1048
  this._Store.dispatch(surveyActions.updateQuestionAnswer({
1012
1049
  questionId: formValue.id,
@@ -1019,7 +1056,7 @@ class QuestionDropdownTemplateComponent {
1019
1056
  Answer: value
1020
1057
  });
1021
1058
  });
1022
- this._Store.select(questionSelectors.pageQuestions).pipe(map(arr => arr.find(x => x.questionId == this.fCtrls.id.value)))
1059
+ this.subs.sink = this._Store.select(questionSelectors.pageQuestions).pipe(map(arr => arr.find(x => x.questionId == this.fCtrls.id.value)))
1023
1060
  .pipe(filter(x => x != null), pairwise()).subscribe(value => {
1024
1061
  const oldValue = value[0];
1025
1062
  const newValue = value[1];
@@ -1089,8 +1126,19 @@ class QuestionMatrixTemplateComponent {
1089
1126
  isValid: group.controls.answer.valid
1090
1127
  }));
1091
1128
  });
1129
+ var question = this.questionArr().find(x => x.questionId == group.value.subQuestionId);
1130
+ if (question != null) {
1131
+ group.controls.answer.setValue(question.answerId, { emitEvent: false });
1132
+ }
1092
1133
  this.fCtrls.subQuestionArray.push(group);
1093
1134
  });
1135
+ var matrixQuestion = this.questionArr().find(x => x.parentQuestionId == this.fCtrls.id.value);
1136
+ if (matrixQuestion) {
1137
+ this.rForm.patchValue({
1138
+ isDisabled: matrixQuestion.isDisabled,
1139
+ isShow: matrixQuestion.isShow
1140
+ }, { emitEvent: false });
1141
+ }
1094
1142
  }
1095
1143
  }
1096
1144
  constructor(_formBuilder, _surveyLibService, _Store) {
@@ -1098,6 +1146,7 @@ class QuestionMatrixTemplateComponent {
1098
1146
  this._surveyLibService = _surveyLibService;
1099
1147
  this._Store = _Store;
1100
1148
  this.elemId = v4();
1149
+ this.questionArr = this._Store.selectSignal(questionSelectors.pageQuestions);
1101
1150
  this.rForm = this._formBuilder.group({
1102
1151
  id: new FormControl(null),
1103
1152
  typeId: new FormControl(null),
@@ -1187,6 +1236,15 @@ class QuestionBooleanTemplateComponent {
1187
1236
  this.fCtrls.answer.addValidators([Validators.required]);
1188
1237
  this.fCtrls.answer.updateValueAndValidity();
1189
1238
  }
1239
+ var question = this.questionArr().find(x => x.questionId == value.questionId);
1240
+ if (question?.answerId) {
1241
+ this.rForm.patchValue({
1242
+ answer: question.answerId,
1243
+ isDisabled: question.isDisabled,
1244
+ isShow: question.isShow
1245
+ }, { emitEvent: false });
1246
+ this.fCtrls.answerArray.controls.find(x => x.value.id == question.answerId).controls.isSelected.setValue(true);
1247
+ }
1190
1248
  }
1191
1249
  }
1192
1250
  constructor(_formBuilder, _surveyLibService, _Store) {
@@ -1194,6 +1252,7 @@ class QuestionBooleanTemplateComponent {
1194
1252
  this._surveyLibService = _surveyLibService;
1195
1253
  this._Store = _Store;
1196
1254
  this.elemId = v4();
1255
+ this.questionArr = this._Store.selectSignal(questionSelectors.pageQuestions);
1197
1256
  this.rForm = this._formBuilder.group({
1198
1257
  id: new FormControl(null),
1199
1258
  name: new FormControl(null),
@@ -1282,6 +1341,14 @@ class QuestionDropdownMultiTemplateComponent {
1282
1341
  this.fCtrls.answer.addValidators([Validators.required]);
1283
1342
  this.fCtrls.answer.updateValueAndValidity();
1284
1343
  }
1344
+ var question = this.questionArr().find(x => x.questionId == value.questionId);
1345
+ if (question?.answerIdArr) {
1346
+ this.rForm.patchValue({
1347
+ answer: question.answerIdArr,
1348
+ isDisabled: question.isDisabled,
1349
+ isShow: question.isShow
1350
+ }, { emitEvent: false });
1351
+ }
1285
1352
  }
1286
1353
  }
1287
1354
  constructor(_formBuilder, _surveyLibService, _Store) {
@@ -1289,6 +1356,7 @@ class QuestionDropdownMultiTemplateComponent {
1289
1356
  this._surveyLibService = _surveyLibService;
1290
1357
  this._Store = _Store;
1291
1358
  this.elemId = v4();
1359
+ this.questionArr = this._Store.selectSignal(questionSelectors.pageQuestions);
1292
1360
  this.rForm = this._formBuilder.group({
1293
1361
  id: new FormControl(null),
1294
1362
  name: new FormControl(null),
@@ -1400,6 +1468,7 @@ class QuestionCascadeTemplateComponent {
1400
1468
  set setQuestion(value) {
1401
1469
  if (this.surveyQuestionArr?.length == 0) {
1402
1470
  this.setQuestions(value.questionAllInfo);
1471
+ console.log(value.questionAllInfo);
1403
1472
  }
1404
1473
  }
1405
1474
  constructor(_formBuilder, _surveyLibService, _ApiService, _Store) {
@@ -1408,7 +1477,7 @@ class QuestionCascadeTemplateComponent {
1408
1477
  this._ApiService = _ApiService;
1409
1478
  this._Store = _Store;
1410
1479
  this.surveyQuestionArr = [];
1411
- this.pageQuestions$ = this._Store.select(questionSelectors.pageQuestions);
1480
+ this.pageQuestions$ = this._Store.selectSignal(questionSelectors.pageQuestions);
1412
1481
  this.pageId = null;
1413
1482
  this.questionGroupId = null;
1414
1483
  this.isPre = false;
@@ -1486,14 +1555,13 @@ class QuestionCascadeTemplateComponent {
1486
1555
  group.controls.answer.updateValueAndValidity();
1487
1556
  }
1488
1557
  this.fCtrls.questionArr.push(group);
1489
- console.log(this.fCtrls.questionArr.value);
1490
1558
  }
1491
1559
  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 }); }
1492
- 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" }] }); }
1560
+ 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$() |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: FindQuestionPipe, name: "findQuestion" }] }); }
1493
1561
  }
1494
1562
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: QuestionCascadeTemplateComponent, decorators: [{
1495
1563
  type: Component,
1496
- 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>" }]
1564
+ 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$() |findQuestion :item.value.id \"\r\n (emitter)=\"onUpdateAnswer($event)\" >\r\n </lib-question-dropdown-template> \r\n</ng-container>" }]
1497
1565
  }], ctorParameters: function () { return [{ type: i1.FormBuilder }, { type: SurveyLibService }, { type: ApiService }, { type: i3.Store }]; }, propDecorators: { pageId: [{
1498
1566
  type: Input
1499
1567
  }], questionGroupId: [{
@@ -1543,6 +1611,14 @@ class QuestionFeedbackTemplateComponent {
1543
1611
  this.fCtrls.answer.addValidators([Validators.required]);
1544
1612
  this.fCtrls.answer.updateValueAndValidity();
1545
1613
  }
1614
+ var question = this.questionArr().find(x => x.questionId == value.questionId);
1615
+ if (question) {
1616
+ this.rForm.patchValue({
1617
+ answer: question.answerText,
1618
+ isDisabled: question.isDisabled,
1619
+ isShow: question.isShow
1620
+ }, { emitEvent: false });
1621
+ }
1546
1622
  this.toggleEnableAnswer(value.questionAllInfo.isReadOnly);
1547
1623
  }
1548
1624
  }
@@ -1553,6 +1629,7 @@ class QuestionFeedbackTemplateComponent {
1553
1629
  this._formBuilder = _formBuilder;
1554
1630
  this._surveyLibService = _surveyLibService;
1555
1631
  this._Store = _Store;
1632
+ this.questionArr = this._Store.selectSignal(questionSelectors.pageQuestions);
1556
1633
  this.isArabicLang = false;
1557
1634
  this.rForm = this._formBuilder.group({
1558
1635
  id: new FormControl(null),
@@ -1661,8 +1738,8 @@ class SurveryLibComponent {
1661
1738
  this.surveryLibraryDivId = v4();
1662
1739
  this.reloadDefaultAnswerId = v4();
1663
1740
  this.questionAnswerArr = [];
1664
- this.pageQuestionGroups$ = this._Store.select(questionGroupSelectors.pageQuestionGroups);
1665
- this.pageQuestions$ = this._Store.select(questionSelectors.pageQuestions);
1741
+ this.pageQuestionGroups$ = this._Store.selectSignal(questionGroupSelectors.pageQuestionGroups);
1742
+ this.pageQuestions$ = this._Store.selectSignal(questionSelectors.pageQuestions);
1666
1743
  this.isFirstPage$ = this._Store.select(surveySelectors.isFirstPage);
1667
1744
  this.isLastPage$ = this._Store.select(surveySelectors.isLastPage);
1668
1745
  this.curruntShowedSurveyPages$ = this._Store.select(surveySelectors.selectedPageIndex).pipe(map(x => x + 1));
@@ -1685,6 +1762,9 @@ class SurveryLibComponent {
1685
1762
  questionIdentify(index, item) {
1686
1763
  return item.questionId;
1687
1764
  }
1765
+ questionGroupIdentify(index, item) {
1766
+ return item.questionGroupId;
1767
+ }
1688
1768
  ngOnInit() {
1689
1769
  this._Store.select(surveySelectors.selectedPageId).subscribe(value => {
1690
1770
  this.fCtrls.currentPageId.setValue(value);
@@ -1765,11 +1845,11 @@ class SurveryLibComponent {
1765
1845
  return null;
1766
1846
  }
1767
1847
  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 }); }
1768
- 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" }] }); }
1848
+ 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$(); trackBy:questionGroupIdentify\">\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$() |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" }] }); }
1769
1849
  }
1770
1850
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: SurveryLibComponent, decorators: [{
1771
1851
  type: Component,
1772
- 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"] }]
1852
+ 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$(); trackBy:questionGroupIdentify\">\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$() |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"] }]
1773
1853
  }], ctorParameters: function () { return [{ type: SurveyLibService }, { type: i3.Store }, { type: i1.FormBuilder }, { type: CheckRuleExpsUsecase }]; }, propDecorators: { isPre: [{
1774
1854
  type: Input
1775
1855
  }], surveyLanguageId: [{
@@ -1914,6 +1994,124 @@ function surveyReducer(state, action) {
1914
1994
  return _surveyReducer(state, action);
1915
1995
  }
1916
1996
 
1997
+ var LogicActionEnum;
1998
+ (function (LogicActionEnum) {
1999
+ LogicActionEnum[LogicActionEnum["Show"] = 1] = "Show";
2000
+ LogicActionEnum[LogicActionEnum["Hide"] = 2] = "Hide";
2001
+ LogicActionEnum[LogicActionEnum["Enable"] = 3] = "Enable";
2002
+ LogicActionEnum[LogicActionEnum["Disable"] = 4] = "Disable";
2003
+ LogicActionEnum[LogicActionEnum["SetAnswer"] = 5] = "SetAnswer";
2004
+ })(LogicActionEnum || (LogicActionEnum = {}));
2005
+
2006
+ class SurveyEffects {
2007
+ constructor(_actions, _store, _checkRuleExpsUsecase) {
2008
+ this._actions = _actions;
2009
+ this._store = _store;
2010
+ this._checkRuleExpsUsecase = _checkRuleExpsUsecase;
2011
+ this.updateQuestionAnswer$ = createEffect(() => this._actions.pipe(ofType(surveyActions.updateQuestionAnswer), withLatestFrom(this._store.select(surveySelectors.ruleArr), this._store.select(questionSelectors.allQuestions)), switchMap(([action, ruleArr, questionArr]) => {
2012
+ var formatedRuleArr = [];
2013
+ ruleArr.forEach(rule => {
2014
+ rule.ruleExps.forEach(ruleQuestion => {
2015
+ formatedRuleArr.push({
2016
+ ruleId: rule.ruleId,
2017
+ questionId: ruleQuestion.questionId
2018
+ });
2019
+ });
2020
+ });
2021
+ var selectedRuleIdArr = formatedRuleArr.filter(x => x.questionId == action.questionId).map(x => Number(x.ruleId));
2022
+ var arr = ruleArr.filter(x => selectedRuleIdArr.find(c => c == x.ruleId) != null);
2023
+ arr.forEach(rule => {
2024
+ this._checkRuleExpsUsecase.execute({
2025
+ ruleExps: rule.ruleExps,
2026
+ questions: questionArr,
2027
+ }).subscribe(result => {
2028
+ var isPassed = result.exprestionResultArr.filter(x => x == false).length == 0;
2029
+ if (isPassed) {
2030
+ rule.ruleResultQuestions.forEach(resultQuestion => {
2031
+ if (rule.logicActionId == LogicActionEnum.Show) {
2032
+ this._store.dispatch(surveyActions.updateQuestionShow({
2033
+ questionId: resultQuestion.questionId,
2034
+ isShow: true
2035
+ }));
2036
+ }
2037
+ else if (rule.logicActionId == LogicActionEnum.Hide) {
2038
+ this._store.dispatch(surveyActions.updateQuestionShow({
2039
+ questionId: resultQuestion.questionId,
2040
+ isShow: false
2041
+ }));
2042
+ }
2043
+ else if (rule.logicActionId == LogicActionEnum.Enable) {
2044
+ this._store.dispatch(surveyActions.updateQuestionDisable({
2045
+ questionId: resultQuestion.questionId,
2046
+ isDisabled: false
2047
+ }));
2048
+ }
2049
+ else if (rule.logicActionId == LogicActionEnum.Disable) {
2050
+ this._store.dispatch(surveyActions.updateQuestionDisable({
2051
+ questionId: resultQuestion.questionId,
2052
+ isDisabled: true
2053
+ }));
2054
+ }
2055
+ else if (rule.logicActionId == LogicActionEnum.SetAnswer) {
2056
+ }
2057
+ const question = questionArr.find(x => x.questionId == resultQuestion.questionId);
2058
+ //update matrix sub questions
2059
+ if (question.questionType == QuestionTypeEnum.Matrix && question.isMatrixGroup == true) {
2060
+ var subQuestions = questionArr.filter(x => x.parentQuestionId == question.questionId);
2061
+ subQuestions.forEach(subQuestion => {
2062
+ if (rule.logicActionId == LogicActionEnum.Show) {
2063
+ this._store.dispatch(surveyActions.updateQuestionShow({
2064
+ questionId: subQuestion.questionId,
2065
+ isShow: true
2066
+ }));
2067
+ }
2068
+ else if (rule.logicActionId == LogicActionEnum.Hide) {
2069
+ this._store.dispatch(surveyActions.updateQuestionShow({
2070
+ questionId: subQuestion.questionId,
2071
+ isShow: false
2072
+ }));
2073
+ }
2074
+ else if (rule.logicActionId == LogicActionEnum.Enable) {
2075
+ this._store.dispatch(surveyActions.updateQuestionDisable({
2076
+ questionId: subQuestion.questionId,
2077
+ isDisabled: false
2078
+ }));
2079
+ }
2080
+ else if (rule.logicActionId == LogicActionEnum.Disable) {
2081
+ this._store.dispatch(surveyActions.updateQuestionDisable({
2082
+ questionId: subQuestion.questionId,
2083
+ isDisabled: true
2084
+ }));
2085
+ }
2086
+ });
2087
+ }
2088
+ });
2089
+ }
2090
+ else {
2091
+ rule.ruleResultQuestions.forEach(resultQuestion => {
2092
+ const question = questionArr.find(x => x.questionId == resultQuestion.questionId);
2093
+ this._store.dispatch(surveyActions.updateQuestionShow({
2094
+ questionId: resultQuestion.questionId,
2095
+ isShow: question.isShow_default
2096
+ }));
2097
+ this._store.dispatch(surveyActions.updateQuestionDisable({
2098
+ questionId: resultQuestion.questionId,
2099
+ isDisabled: question.isDisabled_default
2100
+ }));
2101
+ });
2102
+ }
2103
+ });
2104
+ });
2105
+ return of([]);
2106
+ })), { dispatch: false });
2107
+ }
2108
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: SurveyEffects, deps: [{ token: i1$2.Actions }, { token: i3.Store }, { token: CheckRuleExpsUsecase }], target: i0.ɵɵFactoryTarget.Injectable }); }
2109
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: SurveyEffects }); }
2110
+ }
2111
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: SurveyEffects, decorators: [{
2112
+ type: Injectable
2113
+ }], ctorParameters: function () { return [{ type: i1$2.Actions }, { type: i3.Store }, { type: CheckRuleExpsUsecase }]; } });
2114
+
1917
2115
  class SurveryLibModule {
1918
2116
  static forRoot(config) {
1919
2117
  return {
@@ -1945,11 +2143,11 @@ class SurveryLibModule {
1945
2143
  MaskedForMinMaxDirective,
1946
2144
  FindQuestionPipe,
1947
2145
  QuestionFeedbackTemplateComponent,
1948
- MaskedForMaxLengthDirective], imports: [CommonModule, HttpClientModule, ReactiveFormsModule, FormsModule, NgSelectModule, i3.StoreFeatureModule, i2.EffectsFeatureModule, RatingModule, PaginationModule], exports: [SurveryLibComponent,
2146
+ MaskedForMaxLengthDirective], imports: [CommonModule, HttpClientModule, ReactiveFormsModule, FormsModule, NgSelectModule, i3.StoreFeatureModule, i1$2.EffectsFeatureModule, RatingModule, PaginationModule], exports: [SurveryLibComponent,
1949
2147
  StoreModule] }); }
1950
2148
  static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: SurveryLibModule, imports: [CommonModule, HttpClientModule, ReactiveFormsModule, FormsModule, NgSelectModule,
1951
2149
  StoreModule.forFeature('survey-lib', surveyReducer),
1952
- EffectsModule.forFeature([]), RatingModule, PaginationModule, StoreModule] }); }
2150
+ EffectsModule.forFeature([SurveyEffects]), RatingModule, PaginationModule, StoreModule] }); }
1953
2151
  }
1954
2152
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: SurveryLibModule, decorators: [{
1955
2153
  type: NgModule,
@@ -1976,7 +2174,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.7", ngImpor
1976
2174
  imports: [
1977
2175
  CommonModule, HttpClientModule, ReactiveFormsModule, FormsModule, NgSelectModule,
1978
2176
  StoreModule.forFeature('survey-lib', surveyReducer),
1979
- EffectsModule.forFeature([]), RatingModule, PaginationModule
2177
+ EffectsModule.forFeature([SurveyEffects]), RatingModule, PaginationModule
1980
2178
  ],
1981
2179
  exports: [
1982
2180
  SurveryLibComponent,