survery-lib 0.1.34 → 0.1.36

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 (31) hide show
  1. package/esm2022/lib/components/question-boolean-template/question-boolean-template.component.mjs +15 -13
  2. package/esm2022/lib/components/question-cascade-template/question-cascade-template.component.mjs +14 -16
  3. package/esm2022/lib/components/question-check-box-template/question-check-box-template.component.mjs +14 -12
  4. package/esm2022/lib/components/question-dropdown-multi-template/question-dropdown-multi-template.component.mjs +14 -12
  5. package/esm2022/lib/components/question-matrix-template/question-matrix-template.component.mjs +8 -12
  6. package/esm2022/lib/components/question-radio-button-template/question-radio-button-template.component.mjs +14 -12
  7. package/esm2022/lib/components/question-text-template/question-text-template.component.mjs +14 -8
  8. package/esm2022/lib/survery-lib.component.mjs +3 -4
  9. package/esm2022/lib/survery-lib.module.mjs +6 -1
  10. package/esm2022/shared/form-interfaces/question-boolean-template.form-interface.mjs +1 -1
  11. package/esm2022/shared/form-interfaces/question-check-box-template.form-interface.mjs +1 -1
  12. package/esm2022/shared/form-interfaces/question-dropdown-multi-template.form-interface.mjs +1 -1
  13. package/esm2022/shared/form-interfaces/question-matrix-template.form-interface.mjs +1 -1
  14. package/esm2022/shared/form-interfaces/question-radio-button-template.form-interface.mjs +1 -1
  15. package/esm2022/shared/form-interfaces/question-text-template.form-interface.mjs +1 -1
  16. package/fesm2022/survery-lib.mjs +107 -94
  17. package/fesm2022/survery-lib.mjs.map +1 -1
  18. package/lib/components/question-boolean-template/question-boolean-template.component.d.ts +3 -3
  19. package/lib/components/question-check-box-template/question-check-box-template.component.d.ts +3 -3
  20. package/lib/components/question-dropdown-multi-template/question-dropdown-multi-template.component.d.ts +3 -3
  21. package/lib/components/question-matrix-template/question-matrix-template.component.d.ts +3 -3
  22. package/lib/components/question-radio-button-template/question-radio-button-template.component.d.ts +3 -3
  23. package/lib/components/question-text-template/question-text-template.component.d.ts +3 -2
  24. package/lib/survery-lib.module.d.ts +1 -0
  25. package/package.json +1 -1
  26. package/shared/form-interfaces/question-boolean-template.form-interface.d.ts +2 -0
  27. package/shared/form-interfaces/question-check-box-template.form-interface.d.ts +2 -0
  28. package/shared/form-interfaces/question-dropdown-multi-template.form-interface.d.ts +2 -0
  29. package/shared/form-interfaces/question-matrix-template.form-interface.d.ts +2 -0
  30. package/shared/form-interfaces/question-radio-button-template.form-interface.d.ts +2 -0
  31. package/shared/form-interfaces/question-text-template.form-interface.d.ts +2 -0
@@ -323,7 +323,9 @@ class QuestionTextTemplateComponent {
323
323
  name: value.questionName,
324
324
  title: value.questionTitle,
325
325
  typeId: value.questionTypeId,
326
- description: value.questionDescription
326
+ description: value.questionDescription,
327
+ isDisabled: value.isReadOnly,
328
+ isShow: value.isVisable
327
329
  });
328
330
  if (value.surveyAnswers[0]?.answerId != null && value.surveyAnswers[0]?.answerId != undefined) {
329
331
  this.fCtrls.surveyAnswerId.setValue(value.surveyAnswers[0].answerId);
@@ -344,7 +346,6 @@ class QuestionTextTemplateComponent {
344
346
  }
345
347
  this.fCtrls.answer.updateValueAndValidity();
346
348
  }
347
- this.isShow = value.isVisable;
348
349
  this.toggleEnableAnswer(value.isReadOnly);
349
350
  }
350
351
  set isDisabled(value) {
@@ -354,7 +355,6 @@ class QuestionTextTemplateComponent {
354
355
  this._formBuilder = _formBuilder;
355
356
  this._surveyLibService = _surveyLibService;
356
357
  this.emitter = new EventEmitter();
357
- this.isShow = true;
358
358
  this.rForm = this._formBuilder.group({
359
359
  id: [null],
360
360
  name: [null],
@@ -363,6 +363,8 @@ class QuestionTextTemplateComponent {
363
363
  description: [null],
364
364
  surveyAnswerId: [null],
365
365
  answer: [null],
366
+ isDisabled: [false],
367
+ isShow: [true],
366
368
  inputTypeId: [null]
367
369
  });
368
370
  }
@@ -382,6 +384,12 @@ class QuestionTextTemplateComponent {
382
384
  .subscribe(answer => {
383
385
  this.fCtrls.answer.setValue(answer.AnswerText);
384
386
  });
387
+ this._surveyLibService.questionIsDisabledObsrv.pipe(filter(x => x.questionId == this.fCtrls.id.value)).subscribe(x => {
388
+ this.fCtrls.isDisabled.setValue(x.isDisabled);
389
+ });
390
+ this._surveyLibService.questionIsShowObsrv.pipe(filter(x => x.questionId == this.fCtrls.id.value)).subscribe(x => {
391
+ this.fCtrls.isShow.setValue(x.isShow);
392
+ });
385
393
  }
386
394
  convertToFormControl(element) {
387
395
  return element;
@@ -396,15 +404,13 @@ class QuestionTextTemplateComponent {
396
404
  this.fCtrls.answer.updateValueAndValidity();
397
405
  }
398
406
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: QuestionTextTemplateComponent, deps: [{ token: i1.FormBuilder }, { token: SurveyLibService }], target: i0.ɵɵFactoryTarget.Component }); }
399
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.7", type: QuestionTextTemplateComponent, selector: "lib-question-text-template", inputs: { isShow: "isShow", isTextArea: "isTextArea", setQuestion: "setQuestion", isDisabled: "isDisabled" }, outputs: { emitter: "emitter" }, ngImport: i0, template: "<div class=\"quastion\" [formGroup]=\"rForm\" [attr.id]=\"'question_'+fCtrls.id.value\"\n [ngClass]=\"{'invalid-question': fCtrls.answer.invalid , 'd-none':isShow != true}\">\n <h3 class=\"quastion-title \">\n {{fCtrls.title.value}}\n <span style=\"color: red;\" *ngIf=\"surveyQuestion.isRequired\">*</span>\n </h3>\n <div class=\"text-quastion\">\n <ng-container *ngIf=\"isTextArea == false else textAreaTemplate\">\n <input class=\"form-control\" [formControl]=\"convertToFormControl(fCtrls.answer)\"\n [disabled]=\"isDisabled\" [attr.type]=\"fCtrls.inputTypeId.value | textBoxTypeAttr\" >\n </ng-container>\n <ng-template #textAreaTemplate>\n <textarea class=\"form-control\" rows=\"5\" [formControl]=\"convertToFormControl(fCtrls.answer)\"\n [disabled]=\"isDisabled\" ></textarea>\n </ng-template>\n </div>", styles: [""], dependencies: [{ kind: "directive", type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i4.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: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i4.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i4.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i4.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "pipe", type: TextBoxTypeAttrPipe, name: "textBoxTypeAttr" }] }); }
407
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.7", type: QuestionTextTemplateComponent, selector: "lib-question-text-template", inputs: { isTextArea: "isTextArea", setQuestion: "setQuestion", isDisabled: "isDisabled" }, outputs: { emitter: "emitter" }, 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 {{fCtrls.title.value}}\n <span style=\"color: red;\" *ngIf=\"surveyQuestion.isRequired\">*</span>\n </h3>\n <div class=\"text-quastion\">\n <ng-container *ngIf=\"isTextArea == false else textAreaTemplate\">\n <input class=\"form-control\" [formControl]=\"convertToFormControl(fCtrls.answer)\"\n [disabled]=\"isDisabled\" [attr.type]=\"fCtrls.inputTypeId.value | textBoxTypeAttr\" >\n </ng-container>\n <ng-template #textAreaTemplate>\n <textarea class=\"form-control\" rows=\"5\" [formControl]=\"convertToFormControl(fCtrls.answer)\"\n [disabled]=\"isDisabled\" ></textarea>\n </ng-template>\n </div>", styles: [""], dependencies: [{ kind: "directive", type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i4.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: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i4.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i4.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i4.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "pipe", type: TextBoxTypeAttrPipe, name: "textBoxTypeAttr" }] }); }
400
408
  }
401
409
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: QuestionTextTemplateComponent, decorators: [{
402
410
  type: Component,
403
- args: [{ selector: 'lib-question-text-template', template: "<div class=\"quastion\" [formGroup]=\"rForm\" [attr.id]=\"'question_'+fCtrls.id.value\"\n [ngClass]=\"{'invalid-question': fCtrls.answer.invalid , 'd-none':isShow != true}\">\n <h3 class=\"quastion-title \">\n {{fCtrls.title.value}}\n <span style=\"color: red;\" *ngIf=\"surveyQuestion.isRequired\">*</span>\n </h3>\n <div class=\"text-quastion\">\n <ng-container *ngIf=\"isTextArea == false else textAreaTemplate\">\n <input class=\"form-control\" [formControl]=\"convertToFormControl(fCtrls.answer)\"\n [disabled]=\"isDisabled\" [attr.type]=\"fCtrls.inputTypeId.value | textBoxTypeAttr\" >\n </ng-container>\n <ng-template #textAreaTemplate>\n <textarea class=\"form-control\" rows=\"5\" [formControl]=\"convertToFormControl(fCtrls.answer)\"\n [disabled]=\"isDisabled\" ></textarea>\n </ng-template>\n </div>" }]
411
+ args: [{ selector: 'lib-question-text-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 {{fCtrls.title.value}}\n <span style=\"color: red;\" *ngIf=\"surveyQuestion.isRequired\">*</span>\n </h3>\n <div class=\"text-quastion\">\n <ng-container *ngIf=\"isTextArea == false else textAreaTemplate\">\n <input class=\"form-control\" [formControl]=\"convertToFormControl(fCtrls.answer)\"\n [disabled]=\"isDisabled\" [attr.type]=\"fCtrls.inputTypeId.value | textBoxTypeAttr\" >\n </ng-container>\n <ng-template #textAreaTemplate>\n <textarea class=\"form-control\" rows=\"5\" [formControl]=\"convertToFormControl(fCtrls.answer)\"\n [disabled]=\"isDisabled\" ></textarea>\n </ng-template>\n </div>" }]
404
412
  }], ctorParameters: function () { return [{ type: i1.FormBuilder }, { type: SurveyLibService }]; }, propDecorators: { emitter: [{
405
413
  type: Output
406
- }], isShow: [{
407
- type: Input
408
414
  }], isTextArea: [{
409
415
  type: Input
410
416
  }], setQuestion: [{
@@ -427,7 +433,9 @@ class QuestionRadioButtonTemplateComponent {
427
433
  name: value.questionName,
428
434
  title: value.questionTitle,
429
435
  typeId: value.questionTypeId,
430
- description: value.questionDescription
436
+ description: value.questionDescription,
437
+ isDisabled: value.isReadOnly,
438
+ isShow: value.isVisable
431
439
  });
432
440
  value.surveyAnswers.forEach(surveryAnswer => {
433
441
  this.fCtrls.answerArray.push(this._formBuilder.group({
@@ -440,16 +448,12 @@ class QuestionRadioButtonTemplateComponent {
440
448
  this.fCtrls.answer.addValidators([Validators.required]);
441
449
  this.fCtrls.answer.updateValueAndValidity();
442
450
  }
443
- this.isShow = value.isVisable;
444
- this.isDisabled = value.isReadOnly;
445
451
  }
446
452
  constructor(_formBuilder, _surveyLibService) {
447
453
  this._formBuilder = _formBuilder;
448
454
  this._surveyLibService = _surveyLibService;
449
455
  this.elemId = v4();
450
456
  this.emitter = new EventEmitter();
451
- this.isShow = true;
452
- this.isDisabled = false;
453
457
  this.rForm = this._formBuilder.group({
454
458
  id: [null],
455
459
  name: [null],
@@ -457,6 +461,8 @@ class QuestionRadioButtonTemplateComponent {
457
461
  typeId: [null],
458
462
  description: [null],
459
463
  answer: [null],
464
+ isDisabled: [false],
465
+ isShow: [true],
460
466
  answerArray: this._formBuilder.array([])
461
467
  });
462
468
  }
@@ -480,6 +486,12 @@ class QuestionRadioButtonTemplateComponent {
480
486
  this.fCtrls.answerArray.at(groupIndex).controls.isSelected.setValue(true);
481
487
  }
482
488
  });
489
+ this._surveyLibService.questionIsDisabledObsrv.pipe(filter(x => x.questionId == this.fCtrls.id.value)).subscribe(x => {
490
+ this.fCtrls.isDisabled.setValue(x.isDisabled);
491
+ });
492
+ this._surveyLibService.questionIsShowObsrv.pipe(filter(x => x.questionId == this.fCtrls.id.value)).subscribe(x => {
493
+ this.fCtrls.isShow.setValue(x.isShow);
494
+ });
483
495
  }
484
496
  onChangeAnswer(item) {
485
497
  this.fCtrls.answer.setValue(item.id);
@@ -488,17 +500,13 @@ class QuestionRadioButtonTemplateComponent {
488
500
  return element;
489
501
  }
490
502
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: QuestionRadioButtonTemplateComponent, deps: [{ token: i1.FormBuilder }, { token: SurveyLibService }], target: i0.ɵɵFactoryTarget.Component }); }
491
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.7", type: QuestionRadioButtonTemplateComponent, selector: "lib-question-radio-button-template", inputs: { isShow: "isShow", isDisabled: "isDisabled", 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':isShow != true}\">\n <h3 class=\"quastion-title \">\n {{fCtrls.title.value}}\n <span style=\"color: red;\" *ngIf=\"surveyQuestion.isRequired\">*</span>\n </h3>\n <div class=\"radio-button-quastion\">\n <div class=\"form-check form-check-radio form-check-inline\" \n *ngFor=\"let item of fCtrls.answerArray.controls;let i = index\">\n <input class=\"form-check-input\" type=\"radio\" (change)=\"onChangeAnswer(item.value)\" [disabled]=\"isDisabled\"\n name=\"{{elemId}}__radio-btn-option\" id=\"{{elemId}}__radio-btn_{{i}}\" [checked]=\"item.value.isSelected == true? true : null\">\n <label class=\"form-check-label\" for=\"{{elemId}}__radio-btn_{{i}}\">{{item.value.title}}</label>\n </div>\n </div>\n</div>\n", styles: [""], dependencies: [{ kind: "directive", type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] }); }
503
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.7", type: QuestionRadioButtonTemplateComponent, selector: "lib-question-radio-button-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}\">\n <h3 class=\"quastion-title \">\n {{fCtrls.title.value}}\n <span style=\"color: red;\" *ngIf=\"surveyQuestion.isRequired\">*</span>\n </h3>\n <div class=\"radio-button-quastion\">\n <div class=\"form-check form-check-radio form-check-inline\" \n *ngFor=\"let item of fCtrls.answerArray.controls;let i = index\">\n <input class=\"form-check-input\" type=\"radio\" (change)=\"onChangeAnswer(item.value)\" [disabled]=\"fCtrls.isDisabled.value\"\n name=\"{{elemId}}__radio-btn-option\" id=\"{{elemId}}__radio-btn_{{i}}\" [checked]=\"item.value.isSelected == true? true : null\">\n <label class=\"form-check-label\" for=\"{{elemId}}__radio-btn_{{i}}\">{{item.value.title}}</label>\n </div>\n </div>\n</div>\n", styles: [""], dependencies: [{ kind: "directive", type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] }); }
492
504
  }
493
505
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: QuestionRadioButtonTemplateComponent, decorators: [{
494
506
  type: Component,
495
- 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':isShow != true}\">\n <h3 class=\"quastion-title \">\n {{fCtrls.title.value}}\n <span style=\"color: red;\" *ngIf=\"surveyQuestion.isRequired\">*</span>\n </h3>\n <div class=\"radio-button-quastion\">\n <div class=\"form-check form-check-radio form-check-inline\" \n *ngFor=\"let item of fCtrls.answerArray.controls;let i = index\">\n <input class=\"form-check-input\" type=\"radio\" (change)=\"onChangeAnswer(item.value)\" [disabled]=\"isDisabled\"\n name=\"{{elemId}}__radio-btn-option\" id=\"{{elemId}}__radio-btn_{{i}}\" [checked]=\"item.value.isSelected == true? true : null\">\n <label class=\"form-check-label\" for=\"{{elemId}}__radio-btn_{{i}}\">{{item.value.title}}</label>\n </div>\n </div>\n</div>\n" }]
507
+ 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}\">\n <h3 class=\"quastion-title \">\n {{fCtrls.title.value}}\n <span style=\"color: red;\" *ngIf=\"surveyQuestion.isRequired\">*</span>\n </h3>\n <div class=\"radio-button-quastion\">\n <div class=\"form-check form-check-radio form-check-inline\" \n *ngFor=\"let item of fCtrls.answerArray.controls;let i = index\">\n <input class=\"form-check-input\" type=\"radio\" (change)=\"onChangeAnswer(item.value)\" [disabled]=\"fCtrls.isDisabled.value\"\n name=\"{{elemId}}__radio-btn-option\" id=\"{{elemId}}__radio-btn_{{i}}\" [checked]=\"item.value.isSelected == true? true : null\">\n <label class=\"form-check-label\" for=\"{{elemId}}__radio-btn_{{i}}\">{{item.value.title}}</label>\n </div>\n </div>\n</div>\n" }]
496
508
  }], ctorParameters: function () { return [{ type: i1.FormBuilder }, { type: SurveyLibService }]; }, propDecorators: { emitter: [{
497
509
  type: Output
498
- }], isShow: [{
499
- type: Input
500
- }], isDisabled: [{
501
- type: Input
502
510
  }], setQuestion: [{
503
511
  type: Input
504
512
  }] } });
@@ -517,7 +525,9 @@ class QuestionCheckBoxTemplateComponent {
517
525
  name: value.questionName,
518
526
  title: value.questionTitle,
519
527
  typeId: value.questionTypeId,
520
- description: value.questionDescription
528
+ description: value.questionDescription,
529
+ isDisabled: value.isReadOnly,
530
+ isShow: value.isVisable
521
531
  });
522
532
  value.surveyAnswers.forEach(surveryAnswer => {
523
533
  this.fCtrls.answerArray.push(this._formBuilder.group({
@@ -530,16 +540,12 @@ class QuestionCheckBoxTemplateComponent {
530
540
  this.fCtrls.answer.addValidators([Validators.required]);
531
541
  this.fCtrls.answer.updateValueAndValidity();
532
542
  }
533
- this.isShow = value.isVisable;
534
- this.isDisabled = value.isReadOnly;
535
543
  }
536
544
  constructor(_formBuilder, _surveyLibService) {
537
545
  this._formBuilder = _formBuilder;
538
546
  this._surveyLibService = _surveyLibService;
539
547
  this.elemId = v4();
540
548
  this.emitter = new EventEmitter();
541
- this.isShow = true;
542
- this.isDisabled = false;
543
549
  this.rForm = this._formBuilder.group({
544
550
  id: [null],
545
551
  name: [null],
@@ -547,6 +553,8 @@ class QuestionCheckBoxTemplateComponent {
547
553
  typeId: [null],
548
554
  description: [null],
549
555
  answer: [null],
556
+ isDisabled: [false],
557
+ isShow: [true],
550
558
  answerArray: this._formBuilder.array([])
551
559
  });
552
560
  }
@@ -573,6 +581,12 @@ class QuestionCheckBoxTemplateComponent {
573
581
  }
574
582
  });
575
583
  });
584
+ this._surveyLibService.questionIsDisabledObsrv.pipe(filter(x => x.questionId == this.fCtrls.id.value)).subscribe(x => {
585
+ this.fCtrls.isDisabled.setValue(x.isDisabled);
586
+ });
587
+ this._surveyLibService.questionIsShowObsrv.pipe(filter(x => x.questionId == this.fCtrls.id.value)).subscribe(x => {
588
+ this.fCtrls.isShow.setValue(x.isShow);
589
+ });
576
590
  }
577
591
  onChangeAnswer(item, event) {
578
592
  var answerArr = this.fCtrls.answer.value || [];
@@ -589,17 +603,13 @@ class QuestionCheckBoxTemplateComponent {
589
603
  return element;
590
604
  }
591
605
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: QuestionCheckBoxTemplateComponent, deps: [{ token: i1.FormBuilder }, { token: SurveyLibService }], target: i0.ɵɵFactoryTarget.Component }); }
592
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.7", type: QuestionCheckBoxTemplateComponent, selector: "lib-question-check-box-template", inputs: { isShow: "isShow", isDisabled: "isDisabled", 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':isShow != true}\">\n <h3 class=\"quastion-title \">\n {{fCtrls.title.value}}\n <span style=\"color: red;\" *ngIf=\"surveyQuestion.isRequired\">*</span>\n </h3>\n\n <div class=\"checkbox-button-quastion\">\n <div class=\"form-check check-box-form-check\" *ngFor=\"let item of fCtrls.answerArray.controls ;let i = index\">\n <input type=\"checkbox\" class=\"form-check-input\" id=\"{{elemId}}__checkbox_{{i}}\" [disabled]=\"isDisabled\"\n (change)=\"onChangeAnswer(item.value ,$event)\" [checked]=\"item.value.isSelected == true? true : null\">\n <label class=\"form-check-label \" for=\"{{elemId}}__checkbox_{{i}}\">{{item.value.title}}</label>\n </div>\n </div>\n</div>\n", styles: [""], dependencies: [{ kind: "directive", type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] }); }
606
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.7", type: QuestionCheckBoxTemplateComponent, selector: "lib-question-check-box-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}\">\n <h3 class=\"quastion-title \">\n {{fCtrls.title.value}}\n <span style=\"color: red;\" *ngIf=\"surveyQuestion.isRequired\">*</span>\n </h3>\n\n <div class=\"checkbox-button-quastion\">\n <div class=\"form-check check-box-form-check\" *ngFor=\"let item of fCtrls.answerArray.controls ;let i = index\">\n <input type=\"checkbox\" class=\"form-check-input\" id=\"{{elemId}}__checkbox_{{i}}\" [disabled]=\"fCtrls.isDisabled.value\"\n (change)=\"onChangeAnswer(item.value ,$event)\" [checked]=\"item.value.isSelected == true? true : null\">\n <label class=\"form-check-label \" for=\"{{elemId}}__checkbox_{{i}}\">{{item.value.title}}</label>\n </div>\n </div>\n</div>\n", styles: [""], dependencies: [{ kind: "directive", type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] }); }
593
607
  }
594
608
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: QuestionCheckBoxTemplateComponent, decorators: [{
595
609
  type: Component,
596
- 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':isShow != true}\">\n <h3 class=\"quastion-title \">\n {{fCtrls.title.value}}\n <span style=\"color: red;\" *ngIf=\"surveyQuestion.isRequired\">*</span>\n </h3>\n\n <div class=\"checkbox-button-quastion\">\n <div class=\"form-check check-box-form-check\" *ngFor=\"let item of fCtrls.answerArray.controls ;let i = index\">\n <input type=\"checkbox\" class=\"form-check-input\" id=\"{{elemId}}__checkbox_{{i}}\" [disabled]=\"isDisabled\"\n (change)=\"onChangeAnswer(item.value ,$event)\" [checked]=\"item.value.isSelected == true? true : null\">\n <label class=\"form-check-label \" for=\"{{elemId}}__checkbox_{{i}}\">{{item.value.title}}</label>\n </div>\n </div>\n</div>\n" }]
610
+ 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}\">\n <h3 class=\"quastion-title \">\n {{fCtrls.title.value}}\n <span style=\"color: red;\" *ngIf=\"surveyQuestion.isRequired\">*</span>\n </h3>\n\n <div class=\"checkbox-button-quastion\">\n <div class=\"form-check check-box-form-check\" *ngFor=\"let item of fCtrls.answerArray.controls ;let i = index\">\n <input type=\"checkbox\" class=\"form-check-input\" id=\"{{elemId}}__checkbox_{{i}}\" [disabled]=\"fCtrls.isDisabled.value\"\n (change)=\"onChangeAnswer(item.value ,$event)\" [checked]=\"item.value.isSelected == true? true : null\">\n <label class=\"form-check-label \" for=\"{{elemId}}__checkbox_{{i}}\">{{item.value.title}}</label>\n </div>\n </div>\n</div>\n" }]
597
611
  }], ctorParameters: function () { return [{ type: i1.FormBuilder }, { type: SurveyLibService }]; }, propDecorators: { emitter: [{
598
612
  type: Output
599
- }], isShow: [{
600
- type: Input
601
- }], isDisabled: [{
602
- type: Input
603
613
  }], setQuestion: [{
604
614
  type: Input
605
615
  }] } });
@@ -691,7 +701,9 @@ class QuestionMatrixTemplateComponent {
691
701
  this.surveyQuestion = value;
692
702
  this.rForm.patchValue({
693
703
  id: value.questionId,
694
- typeId: value.questionTypeId
704
+ typeId: value.questionTypeId,
705
+ isDisabled: value.isReadOnly,
706
+ isShow: value.isVisable
695
707
  });
696
708
  value.surveySubQuestions.forEach(x => {
697
709
  var group = this._formBuilder.group({
@@ -713,19 +725,17 @@ class QuestionMatrixTemplateComponent {
713
725
  });
714
726
  this.fCtrls.subQuestionArray.push(group);
715
727
  });
716
- this.isShow = value.isVisable;
717
- this.isDisabled = value.isReadOnly;
718
728
  }
719
729
  constructor(_formBuilder, _surveyLibService) {
720
730
  this._formBuilder = _formBuilder;
721
731
  this._surveyLibService = _surveyLibService;
722
732
  this.elemId = v4();
723
733
  this.emitter = new EventEmitter();
724
- this.isShow = true;
725
- this.isDisabled = false;
726
734
  this.rForm = this._formBuilder.group({
727
735
  id: [null],
728
736
  typeId: [null],
737
+ isDisabled: [false],
738
+ isShow: [true],
729
739
  subQuestionArray: this._formBuilder.array([])
730
740
  });
731
741
  }
@@ -756,17 +766,13 @@ class QuestionMatrixTemplateComponent {
756
766
  return element;
757
767
  }
758
768
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: QuestionMatrixTemplateComponent, deps: [{ token: i1.FormBuilder }, { token: SurveyLibService }], target: i0.ɵɵFactoryTarget.Component }); }
759
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.7", type: QuestionMatrixTemplateComponent, selector: "lib-question-matrix-template", inputs: { isShow: "isShow", isDisabled: "isDisabled", setQuestion: "setQuestion" }, outputs: { emitter: "emitter" }, ngImport: i0, template: "<div class=\"quastion\" [attr.id]=\"'question_'+fCtrls.id.value\" style=\" border-collapse: collapse;\"\n[ngClass]=\"{'d-none':isShow != true}\">\n <h3 class=\"quastion-title \">\n {{surveyQuestion?.questionTitle}}\n <span style=\"color: red;\" *ngIf=\"surveyQuestion.isRequired\">*</span>\n </h3>\n <div class=\"matrix-question\" [formGroup]=\"rForm\">\n <div class=\"matrix-table\" formArrayName=\"subQuestionArray\">\n <div class=\"matrix-head-row\">\n <div class=\"matrix-col\">\n </div>\n <div class=\"matrix-col\" *ngFor=\"let answers of surveyQuestion?.surveyAnswers\">\n {{answers.answerTitle}}\n </div>\n </div>\n\n <div class=\"matrix-row\"\n *ngFor=\"let questionGroup of fCtrls.subQuestionArray.controls ;let subQuestionIndex = index\"\n [ngClass]=\"{'invalid-question': questionGroup.controls.answer.invalid}\">\n <div class=\"matrix-col matrix-sub-quastion\">\n {{questionGroup.value.questionTitle}} \n </div>\n <div class=\"matrix-col\" *ngFor=\"let answer of surveyQuestion?.surveyAnswers;let answerIndex = index\">\n <div class=\"form-check form-check-radio form-check-inline\">\n <input class=\"form-check-input\" type=\"radio\" name=\"{{elemId}}__radio-btn-option_{{subQuestionIndex}}\"\n id=\"{{elemId}}__radio-btn_{{subQuestionIndex}}_{{answerIndex}}\" (change)=\"onChangeAnswer(questionGroup.value ,answer)\"\n value=\"{{answer.answerId}}\" [checked]=\"answer.answerId == questionGroup.value.answer\">\n <label class=\"form-check-label d-md-inline d-lg-none\"\n for=\"{{elemId}}__radio-btn_{{subQuestionIndex}}_{{answerIndex}}\"> {{answer.answerTitle}}</label>\n </div>\n </div>\n </div>\n\n </div>\n\n </div>\n</div>", styles: [""], dependencies: [{ kind: "directive", type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i4.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i4.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i4.FormArrayName, selector: "[formArrayName]", inputs: ["formArrayName"] }] }); }
769
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.7", type: QuestionMatrixTemplateComponent, selector: "lib-question-matrix-template", inputs: { setQuestion: "setQuestion" }, outputs: { emitter: "emitter" }, ngImport: i0, template: "<div class=\"quastion\" [attr.id]=\"'question_'+fCtrls.id.value\" style=\" border-collapse: collapse;\"\n[ngClass]=\"{'d-none':fCtrls.isShow.value != true}\">\n <h3 class=\"quastion-title \">\n {{surveyQuestion?.questionTitle}}\n <span style=\"color: red;\" *ngIf=\"surveyQuestion.isRequired\">*</span>\n </h3>\n <div class=\"matrix-question\" [formGroup]=\"rForm\">\n <div class=\"matrix-table\" formArrayName=\"subQuestionArray\">\n <div class=\"matrix-head-row\">\n <div class=\"matrix-col\">\n </div>\n <div class=\"matrix-col\" *ngFor=\"let answers of surveyQuestion?.surveyAnswers\">\n {{answers.answerTitle}}\n </div>\n </div>\n\n <div class=\"matrix-row\"\n *ngFor=\"let questionGroup of fCtrls.subQuestionArray.controls ;let subQuestionIndex = index\"\n [ngClass]=\"{'invalid-question': questionGroup.controls.answer.invalid}\">\n <div class=\"matrix-col matrix-sub-quastion\">\n {{questionGroup.value.questionTitle}} \n </div>\n <div class=\"matrix-col\" *ngFor=\"let answer of surveyQuestion?.surveyAnswers;let answerIndex = index\">\n <div class=\"form-check form-check-radio form-check-inline\">\n <input class=\"form-check-input\" type=\"radio\" name=\"{{elemId}}__radio-btn-option_{{subQuestionIndex}}\"\n id=\"{{elemId}}__radio-btn_{{subQuestionIndex}}_{{answerIndex}}\" (change)=\"onChangeAnswer(questionGroup.value ,answer)\"\n value=\"{{answer.answerId}}\" [checked]=\"answer.answerId == questionGroup.value.answer\">\n <label class=\"form-check-label d-md-inline d-lg-none\"\n for=\"{{elemId}}__radio-btn_{{subQuestionIndex}}_{{answerIndex}}\"> {{answer.answerTitle}}</label>\n </div>\n </div>\n </div>\n\n </div>\n\n </div>\n</div>", styles: [""], dependencies: [{ kind: "directive", type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i4.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i4.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i4.FormArrayName, selector: "[formArrayName]", inputs: ["formArrayName"] }] }); }
760
770
  }
761
771
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: QuestionMatrixTemplateComponent, decorators: [{
762
772
  type: Component,
763
- args: [{ selector: 'lib-question-matrix-template', template: "<div class=\"quastion\" [attr.id]=\"'question_'+fCtrls.id.value\" style=\" border-collapse: collapse;\"\n[ngClass]=\"{'d-none':isShow != true}\">\n <h3 class=\"quastion-title \">\n {{surveyQuestion?.questionTitle}}\n <span style=\"color: red;\" *ngIf=\"surveyQuestion.isRequired\">*</span>\n </h3>\n <div class=\"matrix-question\" [formGroup]=\"rForm\">\n <div class=\"matrix-table\" formArrayName=\"subQuestionArray\">\n <div class=\"matrix-head-row\">\n <div class=\"matrix-col\">\n </div>\n <div class=\"matrix-col\" *ngFor=\"let answers of surveyQuestion?.surveyAnswers\">\n {{answers.answerTitle}}\n </div>\n </div>\n\n <div class=\"matrix-row\"\n *ngFor=\"let questionGroup of fCtrls.subQuestionArray.controls ;let subQuestionIndex = index\"\n [ngClass]=\"{'invalid-question': questionGroup.controls.answer.invalid}\">\n <div class=\"matrix-col matrix-sub-quastion\">\n {{questionGroup.value.questionTitle}} \n </div>\n <div class=\"matrix-col\" *ngFor=\"let answer of surveyQuestion?.surveyAnswers;let answerIndex = index\">\n <div class=\"form-check form-check-radio form-check-inline\">\n <input class=\"form-check-input\" type=\"radio\" name=\"{{elemId}}__radio-btn-option_{{subQuestionIndex}}\"\n id=\"{{elemId}}__radio-btn_{{subQuestionIndex}}_{{answerIndex}}\" (change)=\"onChangeAnswer(questionGroup.value ,answer)\"\n value=\"{{answer.answerId}}\" [checked]=\"answer.answerId == questionGroup.value.answer\">\n <label class=\"form-check-label d-md-inline d-lg-none\"\n for=\"{{elemId}}__radio-btn_{{subQuestionIndex}}_{{answerIndex}}\"> {{answer.answerTitle}}</label>\n </div>\n </div>\n </div>\n\n </div>\n\n </div>\n</div>" }]
773
+ args: [{ selector: 'lib-question-matrix-template', template: "<div class=\"quastion\" [attr.id]=\"'question_'+fCtrls.id.value\" style=\" border-collapse: collapse;\"\n[ngClass]=\"{'d-none':fCtrls.isShow.value != true}\">\n <h3 class=\"quastion-title \">\n {{surveyQuestion?.questionTitle}}\n <span style=\"color: red;\" *ngIf=\"surveyQuestion.isRequired\">*</span>\n </h3>\n <div class=\"matrix-question\" [formGroup]=\"rForm\">\n <div class=\"matrix-table\" formArrayName=\"subQuestionArray\">\n <div class=\"matrix-head-row\">\n <div class=\"matrix-col\">\n </div>\n <div class=\"matrix-col\" *ngFor=\"let answers of surveyQuestion?.surveyAnswers\">\n {{answers.answerTitle}}\n </div>\n </div>\n\n <div class=\"matrix-row\"\n *ngFor=\"let questionGroup of fCtrls.subQuestionArray.controls ;let subQuestionIndex = index\"\n [ngClass]=\"{'invalid-question': questionGroup.controls.answer.invalid}\">\n <div class=\"matrix-col matrix-sub-quastion\">\n {{questionGroup.value.questionTitle}} \n </div>\n <div class=\"matrix-col\" *ngFor=\"let answer of surveyQuestion?.surveyAnswers;let answerIndex = index\">\n <div class=\"form-check form-check-radio form-check-inline\">\n <input class=\"form-check-input\" type=\"radio\" name=\"{{elemId}}__radio-btn-option_{{subQuestionIndex}}\"\n id=\"{{elemId}}__radio-btn_{{subQuestionIndex}}_{{answerIndex}}\" (change)=\"onChangeAnswer(questionGroup.value ,answer)\"\n value=\"{{answer.answerId}}\" [checked]=\"answer.answerId == questionGroup.value.answer\">\n <label class=\"form-check-label d-md-inline d-lg-none\"\n for=\"{{elemId}}__radio-btn_{{subQuestionIndex}}_{{answerIndex}}\"> {{answer.answerTitle}}</label>\n </div>\n </div>\n </div>\n\n </div>\n\n </div>\n</div>" }]
764
774
  }], ctorParameters: function () { return [{ type: i1.FormBuilder }, { type: SurveyLibService }]; }, propDecorators: { emitter: [{
765
775
  type: Output
766
- }], isShow: [{
767
- type: Input
768
- }], isDisabled: [{
769
- type: Input
770
776
  }], setQuestion: [{
771
777
  type: Input
772
778
  }] } });
@@ -785,7 +791,9 @@ class QuestionBooleanTemplateComponent {
785
791
  name: value.questionName,
786
792
  title: value.questionTitle,
787
793
  typeId: value.questionTypeId,
788
- description: value.questionDescription
794
+ description: value.questionDescription,
795
+ isDisabled: value.isReadOnly,
796
+ isShow: value.isVisable
789
797
  });
790
798
  value.surveyAnswers.forEach(surveryAnswer => {
791
799
  this.fCtrls.answerArray.push(this._formBuilder.group({
@@ -798,16 +806,12 @@ class QuestionBooleanTemplateComponent {
798
806
  this.fCtrls.answer.addValidators([Validators.required]);
799
807
  this.fCtrls.answer.updateValueAndValidity();
800
808
  }
801
- this.isShow = value.isVisable;
802
- this.isDisabled = value.isReadOnly;
803
809
  }
804
810
  constructor(_formBuilder, _surveyLibService) {
805
811
  this._formBuilder = _formBuilder;
806
812
  this._surveyLibService = _surveyLibService;
807
813
  this.elemId = v4();
808
814
  this.emitter = new EventEmitter();
809
- this.isShow = true;
810
- this.isDisabled = false;
811
815
  this.rForm = this._formBuilder.group({
812
816
  id: [null],
813
817
  name: [null],
@@ -815,7 +819,9 @@ class QuestionBooleanTemplateComponent {
815
819
  typeId: [null],
816
820
  description: [null],
817
821
  answer: [null],
818
- answerArray: this._formBuilder.array([])
822
+ answerArray: this._formBuilder.array([]),
823
+ isDisabled: [false],
824
+ isShow: [true]
819
825
  });
820
826
  }
821
827
  ngOnInit() {
@@ -838,6 +844,12 @@ class QuestionBooleanTemplateComponent {
838
844
  this.fCtrls.answerArray.at(groupIndex).controls.isSelected.setValue(true);
839
845
  }
840
846
  });
847
+ this._surveyLibService.questionIsDisabledObsrv.pipe(filter(x => x.questionId == this.fCtrls.id.value)).subscribe(x => {
848
+ this.fCtrls.isDisabled.setValue(x.isDisabled);
849
+ });
850
+ this._surveyLibService.questionIsShowObsrv.pipe(filter(x => x.questionId == this.fCtrls.id.value)).subscribe(x => {
851
+ this.fCtrls.isShow.setValue(x.isShow);
852
+ });
841
853
  }
842
854
  onChangeAnswer(item) {
843
855
  this.fCtrls.answer.setValue(item.id);
@@ -846,17 +858,13 @@ class QuestionBooleanTemplateComponent {
846
858
  return element;
847
859
  }
848
860
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: QuestionBooleanTemplateComponent, deps: [{ token: i1.FormBuilder }, { token: SurveyLibService }], target: i0.ɵɵFactoryTarget.Component }); }
849
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.7", type: QuestionBooleanTemplateComponent, selector: "lib-question-boolean-template", inputs: { isShow: "isShow", isDisabled: "isDisabled", 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':isShow != true}\">\n <h3 class=\"quastion-title \">\n {{fCtrls.title.value}}\n <span style=\"color: red;\" *ngIf=\"surveyQuestion.isRequired\">*</span>\n </h3>\n <div class=\"radio-button-quastion\">\n <div class=\"form-check form-check-radio form-check-inline\" \n *ngFor=\"let item of fCtrls.answerArray.controls ;let i = index\">\n <input class=\"form-check-input\" type=\"radio\" (change)=\"onChangeAnswer(item.value)\" [disabled]=\"isDisabled\"\n name=\"{{elemId}}__radio-btn-option\" id=\"{{elemId}}__radio-btn_{{i}}\" [checked]=\"item.value.isSelected == true? true : null\">\n <label class=\"form-check-label\" for=\"{{elemId}}__radio-btn_{{i}}\">{{item.value.title}}</label>\n </div>\n </div>\n</div>\n", styles: [""], dependencies: [{ kind: "directive", type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] }); }
861
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.7", type: QuestionBooleanTemplateComponent, selector: "lib-question-boolean-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}\">\n <h3 class=\"quastion-title \">\n {{fCtrls.title.value}}\n <span style=\"color: red;\" *ngIf=\"surveyQuestion.isRequired\">*</span>\n </h3>\n <div class=\"radio-button-quastion\">\n <div class=\"form-check form-check-radio form-check-inline\" \n *ngFor=\"let item of fCtrls.answerArray.controls ;let i = index\">\n <input class=\"form-check-input\" type=\"radio\" (change)=\"onChangeAnswer(item.value)\" [disabled]=\"fCtrls.isDisabled.value\"\n name=\"{{elemId}}__radio-btn-option\" id=\"{{elemId}}__radio-btn_{{i}}\" [checked]=\"item.value.isSelected == true? true : null\">\n <label class=\"form-check-label\" for=\"{{elemId}}__radio-btn_{{i}}\">{{item.value.title}}</label>\n </div>\n </div>\n</div>\n", styles: [""], dependencies: [{ kind: "directive", type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] }); }
850
862
  }
851
863
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: QuestionBooleanTemplateComponent, decorators: [{
852
864
  type: Component,
853
- args: [{ selector: 'lib-question-boolean-template', template: "<div class=\"quastion\" [attr.id]=\"'question_'+fCtrls.id.value\" [ngClass]=\"{'invalid-question': fCtrls.answer.invalid , 'd-none':isShow != true}\">\n <h3 class=\"quastion-title \">\n {{fCtrls.title.value}}\n <span style=\"color: red;\" *ngIf=\"surveyQuestion.isRequired\">*</span>\n </h3>\n <div class=\"radio-button-quastion\">\n <div class=\"form-check form-check-radio form-check-inline\" \n *ngFor=\"let item of fCtrls.answerArray.controls ;let i = index\">\n <input class=\"form-check-input\" type=\"radio\" (change)=\"onChangeAnswer(item.value)\" [disabled]=\"isDisabled\"\n name=\"{{elemId}}__radio-btn-option\" id=\"{{elemId}}__radio-btn_{{i}}\" [checked]=\"item.value.isSelected == true? true : null\">\n <label class=\"form-check-label\" for=\"{{elemId}}__radio-btn_{{i}}\">{{item.value.title}}</label>\n </div>\n </div>\n</div>\n" }]
865
+ args: [{ selector: 'lib-question-boolean-template', template: "<div class=\"quastion\" [attr.id]=\"'question_'+fCtrls.id.value\" [ngClass]=\"{'invalid-question': fCtrls.answer.invalid , 'd-none':fCtrls.isShow.value != true}\">\n <h3 class=\"quastion-title \">\n {{fCtrls.title.value}}\n <span style=\"color: red;\" *ngIf=\"surveyQuestion.isRequired\">*</span>\n </h3>\n <div class=\"radio-button-quastion\">\n <div class=\"form-check form-check-radio form-check-inline\" \n *ngFor=\"let item of fCtrls.answerArray.controls ;let i = index\">\n <input class=\"form-check-input\" type=\"radio\" (change)=\"onChangeAnswer(item.value)\" [disabled]=\"fCtrls.isDisabled.value\"\n name=\"{{elemId}}__radio-btn-option\" id=\"{{elemId}}__radio-btn_{{i}}\" [checked]=\"item.value.isSelected == true? true : null\">\n <label class=\"form-check-label\" for=\"{{elemId}}__radio-btn_{{i}}\">{{item.value.title}}</label>\n </div>\n </div>\n</div>\n" }]
854
866
  }], ctorParameters: function () { return [{ type: i1.FormBuilder }, { type: SurveyLibService }]; }, propDecorators: { emitter: [{
855
867
  type: Output
856
- }], isShow: [{
857
- type: Input
858
- }], isDisabled: [{
859
- type: Input
860
868
  }], setQuestion: [{
861
869
  type: Input
862
870
  }] } });
@@ -875,7 +883,9 @@ class QuestionDropdownMultiTemplateComponent {
875
883
  name: value.questionName,
876
884
  title: value.questionTitle,
877
885
  typeId: value.questionTypeId,
878
- description: value.questionDescription
886
+ description: value.questionDescription,
887
+ isDisabled: value.isReadOnly,
888
+ isShow: value.isVisable
879
889
  });
880
890
  value.surveyAnswers.forEach(surveryAnswer => {
881
891
  this.fCtrls.answerArray.push(this._formBuilder.group({
@@ -888,16 +898,12 @@ class QuestionDropdownMultiTemplateComponent {
888
898
  this.fCtrls.answer.addValidators([Validators$1.required]);
889
899
  this.fCtrls.answer.updateValueAndValidity();
890
900
  }
891
- this.isShow = value.isVisable;
892
- this.isDisabled = value.isReadOnly;
893
901
  }
894
902
  constructor(_formBuilder, _surveyLibService) {
895
903
  this._formBuilder = _formBuilder;
896
904
  this._surveyLibService = _surveyLibService;
897
905
  this.elemId = v4();
898
906
  this.emitter = new EventEmitter();
899
- this.isShow = true;
900
- this.isDisabled = false;
901
907
  this.rForm = this._formBuilder.group({
902
908
  id: [null],
903
909
  name: [null],
@@ -905,6 +911,8 @@ class QuestionDropdownMultiTemplateComponent {
905
911
  typeId: [null],
906
912
  description: [null],
907
913
  answer: [null],
914
+ isDisabled: [false],
915
+ isShow: [true],
908
916
  answerArray: this._formBuilder.array([])
909
917
  });
910
918
  }
@@ -925,22 +933,24 @@ class QuestionDropdownMultiTemplateComponent {
925
933
  const distinctArray = answer.AnswerIdArr.filter((n, i) => answer.AnswerIdArr.indexOf(n) === i);
926
934
  this.fCtrls.answer.setValue(distinctArray);
927
935
  });
936
+ this._surveyLibService.questionIsDisabledObsrv.pipe(filter(x => x.questionId == this.fCtrls.id.value)).subscribe(x => {
937
+ this.fCtrls.isDisabled.setValue(x.isDisabled);
938
+ });
939
+ this._surveyLibService.questionIsShowObsrv.pipe(filter(x => x.questionId == this.fCtrls.id.value)).subscribe(x => {
940
+ this.fCtrls.isShow.setValue(x.isShow);
941
+ });
928
942
  }
929
943
  convertToFormControl(element) {
930
944
  return element;
931
945
  }
932
946
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: QuestionDropdownMultiTemplateComponent, deps: [{ token: i1.FormBuilder }, { token: SurveyLibService }], target: i0.ɵɵFactoryTarget.Component }); }
933
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.7", type: QuestionDropdownMultiTemplateComponent, selector: "lib-question-dropdown-multi-template", inputs: { isShow: "isShow", isDisabled: "isDisabled", 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':isShow != true}\">\n <h3 class=\"quastion-title \">\n {{fCtrls.title.value}}\n <span style=\"color: red;\" *ngIf=\"surveyQuestion.isRequired\">*</span>\n </h3>\n <div class=\"text-quastion text-quastion__dropdown\">\n <ng-select [items]=\"this.fCtrls.answerArray.value\" bindValue=\"id\" bindLabel=\"title\" class=\"form-control\"\n [formControl]=\"convertToFormControl(fCtrls.answer)\" [disabled]=\"isDisabled\" [multiple]=\"true\">\n </ng-select>\n </div>\n</div>\n", styles: [".text-quastion .form-control{padding:10px}\n"], dependencies: [{ kind: "directive", type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i4.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"] }] }); }
947
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.7", type: QuestionDropdownMultiTemplateComponent, selector: "lib-question-dropdown-multi-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}\">\n <h3 class=\"quastion-title \">\n {{fCtrls.title.value}}\n <span style=\"color: red;\" *ngIf=\"surveyQuestion.isRequired\">*</span>\n </h3>\n <div class=\"text-quastion text-quastion__dropdown\">\n <ng-select [items]=\"this.fCtrls.answerArray.value\" bindValue=\"id\" bindLabel=\"title\" class=\"form-control\"\n [formControl]=\"convertToFormControl(fCtrls.answer)\" [disabled]=\"fCtrls.isDisabled.value\" [multiple]=\"true\">\n </ng-select>\n </div>\n</div>\n", styles: [".text-quastion .form-control{padding:10px}\n"], dependencies: [{ kind: "directive", type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i4.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"] }] }); }
934
948
  }
935
949
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: QuestionDropdownMultiTemplateComponent, decorators: [{
936
950
  type: Component,
937
- args: [{ selector: 'lib-question-dropdown-multi-template', template: "<div class=\"quastion\" [attr.id]=\"'question_'+fCtrls.id.value\" [ngClass]=\"{'invalid-question': fCtrls.answer.invalid , 'd-none':isShow != true}\">\n <h3 class=\"quastion-title \">\n {{fCtrls.title.value}}\n <span style=\"color: red;\" *ngIf=\"surveyQuestion.isRequired\">*</span>\n </h3>\n <div class=\"text-quastion text-quastion__dropdown\">\n <ng-select [items]=\"this.fCtrls.answerArray.value\" bindValue=\"id\" bindLabel=\"title\" class=\"form-control\"\n [formControl]=\"convertToFormControl(fCtrls.answer)\" [disabled]=\"isDisabled\" [multiple]=\"true\">\n </ng-select>\n </div>\n</div>\n", styles: [".text-quastion .form-control{padding:10px}\n"] }]
951
+ args: [{ selector: 'lib-question-dropdown-multi-template', template: "<div class=\"quastion\" [attr.id]=\"'question_'+fCtrls.id.value\" [ngClass]=\"{'invalid-question': fCtrls.answer.invalid , 'd-none':fCtrls.isShow.value != true}\">\n <h3 class=\"quastion-title \">\n {{fCtrls.title.value}}\n <span style=\"color: red;\" *ngIf=\"surveyQuestion.isRequired\">*</span>\n </h3>\n <div class=\"text-quastion text-quastion__dropdown\">\n <ng-select [items]=\"this.fCtrls.answerArray.value\" bindValue=\"id\" bindLabel=\"title\" class=\"form-control\"\n [formControl]=\"convertToFormControl(fCtrls.answer)\" [disabled]=\"fCtrls.isDisabled.value\" [multiple]=\"true\">\n </ng-select>\n </div>\n</div>\n", styles: [".text-quastion .form-control{padding:10px}\n"] }]
938
952
  }], ctorParameters: function () { return [{ type: i1.FormBuilder }, { type: SurveyLibService }]; }, propDecorators: { emitter: [{
939
953
  type: Output
940
- }], isShow: [{
941
- type: Input
942
- }], isDisabled: [{
943
- type: Input
944
954
  }], setQuestion: [{
945
955
  type: Input
946
956
  }] } });
@@ -1016,21 +1026,19 @@ class QuestionCascadeTemplateComponent {
1016
1026
  }
1017
1027
  });
1018
1028
  }
1019
- else {
1020
- if (this.surveyQuestionArr.length > 1) {
1021
- const surveyQuestionIndex = this.surveyQuestionArr.findIndex(c => c.questionId == model.QuestionId);
1022
- var deletedQuestions = [];
1023
- for (let index = surveyQuestionIndex + 1; index < this.surveyQuestionArr.length; index++) {
1024
- deletedQuestions.push(index);
1025
- }
1026
- var sortDeletedArr = deletedQuestions.sort((a, b) => (a > b ? -1 : 1));
1027
- for (let index = 0; index < sortDeletedArr.length; index++) {
1028
- const elementIndex = sortDeletedArr[index];
1029
- const questionId = this.surveyQuestionArr[elementIndex].questionId;
1030
- this._surveyLibService.setRemoveQuestion(questionId);
1031
- this.surveyQuestionArr.slice(elementIndex, 1);
1032
- this.questionFormArray.removeAt(elementIndex);
1033
- }
1029
+ if (this.surveyQuestionArr.length > 1) {
1030
+ const surveyQuestionIndex = this.surveyQuestionArr.findIndex(c => c.questionId == model.QuestionId);
1031
+ var deletedQuestions = [];
1032
+ for (let index = surveyQuestionIndex + 1; index < this.surveyQuestionArr.length; index++) {
1033
+ deletedQuestions.push(index);
1034
+ }
1035
+ var sortDeletedArr = deletedQuestions.sort((a, b) => (a > b ? -1 : 1));
1036
+ for (let index = 0; index < sortDeletedArr.length; index++) {
1037
+ const elementIndex = sortDeletedArr[index];
1038
+ const questionId = this.surveyQuestionArr[elementIndex].questionId;
1039
+ this._surveyLibService.setRemoveQuestion(questionId);
1040
+ this.surveyQuestionArr.slice(elementIndex, 1);
1041
+ this.questionFormArray.removeAt(elementIndex);
1034
1042
  }
1035
1043
  }
1036
1044
  this.emitter.emit(model);
@@ -1068,20 +1076,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.7", ngImpor
1068
1076
  type: Input
1069
1077
  }] } });
1070
1078
 
1071
- class FilterQuestionPipe {
1072
- transform(value, questionArr) {
1073
- return questionArr.find(x => x.questionId == value.questionId);
1074
- }
1075
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: FilterQuestionPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
1076
- static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "16.1.7", ngImport: i0, type: FilterQuestionPipe, name: "filterQuestion" }); }
1077
- }
1078
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: FilterQuestionPipe, decorators: [{
1079
- type: Pipe,
1080
- args: [{
1081
- name: 'filterQuestion'
1082
- }]
1083
- }] });
1084
-
1085
1079
  class SurveryLibComponent {
1086
1080
  get fCtrls() {
1087
1081
  return this.rForm.controls;
@@ -1368,11 +1362,11 @@ class SurveryLibComponent {
1368
1362
  }
1369
1363
  }
1370
1364
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: SurveryLibComponent, deps: [{ token: SurveyLibService }, { token: i1.FormBuilder }, { token: CheckRuleExpsUsecase }], target: i0.ɵɵFactoryTarget.Component }); }
1371
- 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" }, outputs: { surveyResultEmit: "surveyResultEmit", selectLanguageEmit: "selectLanguageEmit" }, ngImport: i0, template: "<div id=\"survery-card-{{surveryLibraryDivId}}\" class=\"survay-card\" >\r\n <div class=\"alert alert-warning text-center\" role=\"alert\" *ngIf=\"isPre == true && surveyData != null\">\r\n <h4 class=\"alert-heading mb-0\">This survey in review phase </h4>\r\n </div>\r\n <div *ngFor=\"let surveyPage of surveyData?.surveyPages; let surveyPageIndex = index\"\r\n [attr.id]=\"'survey-page_'+surveyPageIndex\"\r\n [ngClass]=\"{'d-none': surveyPageIndex != fCtrls.currentPageIndex.value}\">\r\n <ng-container *ngFor=\"let item of surveyPage.surveyQuestionGroups\">\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\">\r\n {{item.questionGroupName}}\r\n </h2>\r\n <span class=\"group-sub-title \">\r\n {{item.questionGroupDescription}}\r\n </span>\r\n </div>\r\n <ng-container *ngFor=\"let question of item.surveyQuestions\">\r\n <lib-question-boolean-template #questionBooleanTemplate [setQuestion]=\"question\"\r\n (emitter)=\"onUpdateAnswer($event)\" *ngIf=\"question.questionTypeId == questionTypeEnum.Boolean\"\r\n [isShow]=\" (question|filterQuestion : fCtrls.questionArray.value).isShow\"\r\n [isDisabled]=\"(question|filterQuestion : fCtrls.questionArray.value).isDisabled\"></lib-question-boolean-template>\r\n\r\n <lib-question-text-template #questionTextTemplate [setQuestion]=\"question\"\r\n (emitter)=\"onUpdateAnswer($event)\" *ngIf=\"question.questionTypeId == questionTypeEnum.TextInput\"\r\n [isShow]=\" (question|filterQuestion : fCtrls.questionArray.value).isShow\"\r\n [isDisabled]=\"(question|filterQuestion : fCtrls.questionArray.value).isDisabled\"\r\n [isTextArea]=\"question.isAdvanceTextArea\"></lib-question-text-template>\r\n\r\n <lib-question-radio-button-template #questionRadioButtonTemplate [setQuestion]=\"question\"\r\n (emitter)=\"onUpdateAnswer($event)\" *ngIf=\"question.questionTypeId == questionTypeEnum.RadioButton\"\r\n [isShow]=\" (question|filterQuestion : fCtrls.questionArray.value).isShow\"\r\n [isDisabled]=\"(question|filterQuestion : fCtrls.questionArray.value).isDisabled\"></lib-question-radio-button-template>\r\n\r\n <lib-question-dropdown-template #questionDropdownTemplate [setQuestion]=\"question\"\r\n (emitter)=\"onUpdateAnswer($event)\" *ngIf=\"question.questionTypeId == questionTypeEnum.DropDown\"></lib-question-dropdown-template>\r\n\r\n <lib-question-dropdown-multi-template [setQuestion]=\"question\" (emitter)=\"onUpdateAnswer($event)\"\r\n *ngIf=\"question.questionTypeId == questionTypeEnum.DropDownMulti\"\r\n [isShow]=\" (question|filterQuestion : fCtrls.questionArray.value).isShow\"\r\n [isDisabled]=\"(question|filterQuestion : fCtrls.questionArray.value).isDisabled\"></lib-question-dropdown-multi-template>\r\n\r\n <lib-question-check-box-template #questionCheckBoxTemplate [setQuestion]=\"question\"\r\n (emitter)=\"onUpdateAnswer($event)\" *ngIf=\"question.questionTypeId == questionTypeEnum.CheckBox\"\r\n [isShow]=\" (question|filterQuestion : fCtrls.questionArray.value).isShow\"\r\n [isDisabled]=\"(question|filterQuestion : fCtrls.questionArray.value).isDisabled\"></lib-question-check-box-template>\r\n\r\n <lib-question-matrix-template #questionMatrixTemplate [setQuestion]=\"question\"\r\n (emitter)=\"onUpdateAnswer($event)\" *ngIf=\"question.questionTypeId == questionTypeEnum.Matrix\"\r\n [isShow]=\" (question|filterQuestion : fCtrls.questionArray.value).isShow\"\r\n [isDisabled]=\"(question|filterQuestion : fCtrls.questionArray.value).isDisabled\"></lib-question-matrix-template>\r\n\r\n <lib-question-cascade-template #questionCascadeTemplate [setQuestion]=\"question\"\r\n (emitter)=\"onUpdateAnswer($event)\" *ngIf=\"question.questionTypeId == questionTypeEnum.Cascade\"\r\n [applicantKey]=\"applicantKey\" [isPre]=\"isPre\" [surveyLanguageId]=\"surveyLanguageId\" \r\n [pageIndex]=\"surveyPageIndex\"></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=\"surveyData != null\">\r\n <div class=\"container\" style=\" justify-content: start;\">\r\n <div class=\"survay-pagination fw-bold\">\r\n <span>{{curruntShowedSurveyPages}}</span>\r\n <span class=\"ms-2 me-2\">of</span>\r\n <span>{{showedSurveyPages?.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: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: QuestionTextTemplateComponent, selector: "lib-question-text-template", inputs: ["isShow", "isTextArea", "setQuestion", "isDisabled"], outputs: ["emitter"] }, { kind: "component", type: QuestionRadioButtonTemplateComponent, selector: "lib-question-radio-button-template", inputs: ["isShow", "isDisabled", "setQuestion"], outputs: ["emitter"] }, { kind: "component", type: QuestionCheckBoxTemplateComponent, selector: "lib-question-check-box-template", inputs: ["isShow", "isDisabled", "setQuestion"], outputs: ["emitter"] }, { kind: "component", type: QuestionDropdownTemplateComponent, selector: "lib-question-dropdown-template", inputs: ["setQuestion"], outputs: ["emitter"] }, { kind: "component", type: QuestionMatrixTemplateComponent, selector: "lib-question-matrix-template", inputs: ["isShow", "isDisabled", "setQuestion"], outputs: ["emitter"] }, { kind: "component", type: QuestionBooleanTemplateComponent, selector: "lib-question-boolean-template", inputs: ["isShow", "isDisabled", "setQuestion"], outputs: ["emitter"] }, { kind: "component", type: QuestionDropdownMultiTemplateComponent, selector: "lib-question-dropdown-multi-template", inputs: ["isShow", "isDisabled", "setQuestion"], outputs: ["emitter"] }, { kind: "component", type: QuestionCascadeTemplateComponent, selector: "lib-question-cascade-template", inputs: ["pageIndex", "isPre", "surveyLanguageId", "applicantKey", "setQuestion"], outputs: ["emitter"] }, { kind: "pipe", type: FilterQuestionPipe, name: "filterQuestion" }] }); }
1365
+ 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" }, outputs: { surveyResultEmit: "surveyResultEmit", selectLanguageEmit: "selectLanguageEmit" }, ngImport: i0, template: "<div id=\"survery-card-{{surveryLibraryDivId}}\" class=\"survay-card\" >\r\n <div class=\"alert alert-warning text-center\" role=\"alert\" *ngIf=\"isPre == true && surveyData != null\">\r\n <h4 class=\"alert-heading mb-0\">This survey in review phase </h4>\r\n </div>\r\n <div *ngFor=\"let surveyPage of surveyData?.surveyPages; let surveyPageIndex = index\"\r\n [attr.id]=\"'survey-page_'+surveyPageIndex\"\r\n [ngClass]=\"{'d-none': surveyPageIndex != fCtrls.currentPageIndex.value}\">\r\n <ng-container *ngFor=\"let item of surveyPage.surveyQuestionGroups\">\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\">\r\n {{item.questionGroupName}}\r\n </h2>\r\n <span class=\"group-sub-title \">\r\n {{item.questionGroupDescription}}\r\n </span>\r\n </div>\r\n <ng-container *ngFor=\"let question of item.surveyQuestions\">\r\n <lib-question-boolean-template #questionBooleanTemplate [setQuestion]=\"question\"\r\n (emitter)=\"onUpdateAnswer($event)\" *ngIf=\"question.questionTypeId == questionTypeEnum.Boolean\">\r\n </lib-question-boolean-template>\r\n\r\n <lib-question-text-template #questionTextTemplate [setQuestion]=\"question\"\r\n (emitter)=\"onUpdateAnswer($event)\" *ngIf=\"question.questionTypeId == questionTypeEnum.TextInput\"\r\n [isTextArea]=\"question.isAdvanceTextArea\"></lib-question-text-template>\r\n\r\n <lib-question-radio-button-template #questionRadioButtonTemplate [setQuestion]=\"question\"\r\n (emitter)=\"onUpdateAnswer($event)\" *ngIf=\"question.questionTypeId == questionTypeEnum.RadioButton\">\r\n </lib-question-radio-button-template>\r\n\r\n <lib-question-dropdown-template #questionDropdownTemplate [setQuestion]=\"question\"\r\n (emitter)=\"onUpdateAnswer($event)\" *ngIf=\"question.questionTypeId == questionTypeEnum.DropDown\"></lib-question-dropdown-template>\r\n\r\n <lib-question-dropdown-multi-template [setQuestion]=\"question\" (emitter)=\"onUpdateAnswer($event)\"\r\n *ngIf=\"question.questionTypeId == questionTypeEnum.DropDownMulti\">\r\n </lib-question-dropdown-multi-template>\r\n\r\n <lib-question-check-box-template #questionCheckBoxTemplate [setQuestion]=\"question\"\r\n (emitter)=\"onUpdateAnswer($event)\" *ngIf=\"question.questionTypeId == questionTypeEnum.CheckBox\">\r\n </lib-question-check-box-template>\r\n\r\n <lib-question-matrix-template #questionMatrixTemplate [setQuestion]=\"question\"\r\n (emitter)=\"onUpdateAnswer($event)\" *ngIf=\"question.questionTypeId == questionTypeEnum.Matrix\">\r\n </lib-question-matrix-template>\r\n\r\n <lib-question-cascade-template #questionCascadeTemplate [setQuestion]=\"question\"\r\n (emitter)=\"onUpdateAnswer($event)\" *ngIf=\"question.questionTypeId == questionTypeEnum.Cascade\"\r\n [applicantKey]=\"applicantKey\" [isPre]=\"isPre\" [surveyLanguageId]=\"surveyLanguageId\" \r\n [pageIndex]=\"surveyPageIndex\"></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=\"surveyData != null\">\r\n <div class=\"container\" style=\" justify-content: start;\">\r\n <div class=\"survay-pagination fw-bold\">\r\n <span>{{curruntShowedSurveyPages}}</span>\r\n <span class=\"ms-2 me-2\">of</span>\r\n <span>{{showedSurveyPages?.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: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: QuestionTextTemplateComponent, selector: "lib-question-text-template", inputs: ["isTextArea", "setQuestion", "isDisabled"], outputs: ["emitter"] }, { kind: "component", type: QuestionRadioButtonTemplateComponent, selector: "lib-question-radio-button-template", inputs: ["setQuestion"], outputs: ["emitter"] }, { kind: "component", type: QuestionCheckBoxTemplateComponent, selector: "lib-question-check-box-template", inputs: ["setQuestion"], outputs: ["emitter"] }, { kind: "component", type: QuestionDropdownTemplateComponent, selector: "lib-question-dropdown-template", inputs: ["setQuestion"], outputs: ["emitter"] }, { kind: "component", type: QuestionMatrixTemplateComponent, selector: "lib-question-matrix-template", inputs: ["setQuestion"], outputs: ["emitter"] }, { kind: "component", type: QuestionBooleanTemplateComponent, selector: "lib-question-boolean-template", inputs: ["setQuestion"], outputs: ["emitter"] }, { kind: "component", type: QuestionDropdownMultiTemplateComponent, selector: "lib-question-dropdown-multi-template", inputs: ["setQuestion"], outputs: ["emitter"] }, { kind: "component", type: QuestionCascadeTemplateComponent, selector: "lib-question-cascade-template", inputs: ["pageIndex", "isPre", "surveyLanguageId", "applicantKey", "setQuestion"], outputs: ["emitter"] }] }); }
1372
1366
  }
1373
1367
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: SurveryLibComponent, decorators: [{
1374
1368
  type: Component,
1375
- args: [{ selector: 'lib-survery-lib', template: "<div id=\"survery-card-{{surveryLibraryDivId}}\" class=\"survay-card\" >\r\n <div class=\"alert alert-warning text-center\" role=\"alert\" *ngIf=\"isPre == true && surveyData != null\">\r\n <h4 class=\"alert-heading mb-0\">This survey in review phase </h4>\r\n </div>\r\n <div *ngFor=\"let surveyPage of surveyData?.surveyPages; let surveyPageIndex = index\"\r\n [attr.id]=\"'survey-page_'+surveyPageIndex\"\r\n [ngClass]=\"{'d-none': surveyPageIndex != fCtrls.currentPageIndex.value}\">\r\n <ng-container *ngFor=\"let item of surveyPage.surveyQuestionGroups\">\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\">\r\n {{item.questionGroupName}}\r\n </h2>\r\n <span class=\"group-sub-title \">\r\n {{item.questionGroupDescription}}\r\n </span>\r\n </div>\r\n <ng-container *ngFor=\"let question of item.surveyQuestions\">\r\n <lib-question-boolean-template #questionBooleanTemplate [setQuestion]=\"question\"\r\n (emitter)=\"onUpdateAnswer($event)\" *ngIf=\"question.questionTypeId == questionTypeEnum.Boolean\"\r\n [isShow]=\" (question|filterQuestion : fCtrls.questionArray.value).isShow\"\r\n [isDisabled]=\"(question|filterQuestion : fCtrls.questionArray.value).isDisabled\"></lib-question-boolean-template>\r\n\r\n <lib-question-text-template #questionTextTemplate [setQuestion]=\"question\"\r\n (emitter)=\"onUpdateAnswer($event)\" *ngIf=\"question.questionTypeId == questionTypeEnum.TextInput\"\r\n [isShow]=\" (question|filterQuestion : fCtrls.questionArray.value).isShow\"\r\n [isDisabled]=\"(question|filterQuestion : fCtrls.questionArray.value).isDisabled\"\r\n [isTextArea]=\"question.isAdvanceTextArea\"></lib-question-text-template>\r\n\r\n <lib-question-radio-button-template #questionRadioButtonTemplate [setQuestion]=\"question\"\r\n (emitter)=\"onUpdateAnswer($event)\" *ngIf=\"question.questionTypeId == questionTypeEnum.RadioButton\"\r\n [isShow]=\" (question|filterQuestion : fCtrls.questionArray.value).isShow\"\r\n [isDisabled]=\"(question|filterQuestion : fCtrls.questionArray.value).isDisabled\"></lib-question-radio-button-template>\r\n\r\n <lib-question-dropdown-template #questionDropdownTemplate [setQuestion]=\"question\"\r\n (emitter)=\"onUpdateAnswer($event)\" *ngIf=\"question.questionTypeId == questionTypeEnum.DropDown\"></lib-question-dropdown-template>\r\n\r\n <lib-question-dropdown-multi-template [setQuestion]=\"question\" (emitter)=\"onUpdateAnswer($event)\"\r\n *ngIf=\"question.questionTypeId == questionTypeEnum.DropDownMulti\"\r\n [isShow]=\" (question|filterQuestion : fCtrls.questionArray.value).isShow\"\r\n [isDisabled]=\"(question|filterQuestion : fCtrls.questionArray.value).isDisabled\"></lib-question-dropdown-multi-template>\r\n\r\n <lib-question-check-box-template #questionCheckBoxTemplate [setQuestion]=\"question\"\r\n (emitter)=\"onUpdateAnswer($event)\" *ngIf=\"question.questionTypeId == questionTypeEnum.CheckBox\"\r\n [isShow]=\" (question|filterQuestion : fCtrls.questionArray.value).isShow\"\r\n [isDisabled]=\"(question|filterQuestion : fCtrls.questionArray.value).isDisabled\"></lib-question-check-box-template>\r\n\r\n <lib-question-matrix-template #questionMatrixTemplate [setQuestion]=\"question\"\r\n (emitter)=\"onUpdateAnswer($event)\" *ngIf=\"question.questionTypeId == questionTypeEnum.Matrix\"\r\n [isShow]=\" (question|filterQuestion : fCtrls.questionArray.value).isShow\"\r\n [isDisabled]=\"(question|filterQuestion : fCtrls.questionArray.value).isDisabled\"></lib-question-matrix-template>\r\n\r\n <lib-question-cascade-template #questionCascadeTemplate [setQuestion]=\"question\"\r\n (emitter)=\"onUpdateAnswer($event)\" *ngIf=\"question.questionTypeId == questionTypeEnum.Cascade\"\r\n [applicantKey]=\"applicantKey\" [isPre]=\"isPre\" [surveyLanguageId]=\"surveyLanguageId\" \r\n [pageIndex]=\"surveyPageIndex\"></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=\"surveyData != null\">\r\n <div class=\"container\" style=\" justify-content: start;\">\r\n <div class=\"survay-pagination fw-bold\">\r\n <span>{{curruntShowedSurveyPages}}</span>\r\n <span class=\"ms-2 me-2\">of</span>\r\n <span>{{showedSurveyPages?.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"] }]
1369
+ args: [{ selector: 'lib-survery-lib', template: "<div id=\"survery-card-{{surveryLibraryDivId}}\" class=\"survay-card\" >\r\n <div class=\"alert alert-warning text-center\" role=\"alert\" *ngIf=\"isPre == true && surveyData != null\">\r\n <h4 class=\"alert-heading mb-0\">This survey in review phase </h4>\r\n </div>\r\n <div *ngFor=\"let surveyPage of surveyData?.surveyPages; let surveyPageIndex = index\"\r\n [attr.id]=\"'survey-page_'+surveyPageIndex\"\r\n [ngClass]=\"{'d-none': surveyPageIndex != fCtrls.currentPageIndex.value}\">\r\n <ng-container *ngFor=\"let item of surveyPage.surveyQuestionGroups\">\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\">\r\n {{item.questionGroupName}}\r\n </h2>\r\n <span class=\"group-sub-title \">\r\n {{item.questionGroupDescription}}\r\n </span>\r\n </div>\r\n <ng-container *ngFor=\"let question of item.surveyQuestions\">\r\n <lib-question-boolean-template #questionBooleanTemplate [setQuestion]=\"question\"\r\n (emitter)=\"onUpdateAnswer($event)\" *ngIf=\"question.questionTypeId == questionTypeEnum.Boolean\">\r\n </lib-question-boolean-template>\r\n\r\n <lib-question-text-template #questionTextTemplate [setQuestion]=\"question\"\r\n (emitter)=\"onUpdateAnswer($event)\" *ngIf=\"question.questionTypeId == questionTypeEnum.TextInput\"\r\n [isTextArea]=\"question.isAdvanceTextArea\"></lib-question-text-template>\r\n\r\n <lib-question-radio-button-template #questionRadioButtonTemplate [setQuestion]=\"question\"\r\n (emitter)=\"onUpdateAnswer($event)\" *ngIf=\"question.questionTypeId == questionTypeEnum.RadioButton\">\r\n </lib-question-radio-button-template>\r\n\r\n <lib-question-dropdown-template #questionDropdownTemplate [setQuestion]=\"question\"\r\n (emitter)=\"onUpdateAnswer($event)\" *ngIf=\"question.questionTypeId == questionTypeEnum.DropDown\"></lib-question-dropdown-template>\r\n\r\n <lib-question-dropdown-multi-template [setQuestion]=\"question\" (emitter)=\"onUpdateAnswer($event)\"\r\n *ngIf=\"question.questionTypeId == questionTypeEnum.DropDownMulti\">\r\n </lib-question-dropdown-multi-template>\r\n\r\n <lib-question-check-box-template #questionCheckBoxTemplate [setQuestion]=\"question\"\r\n (emitter)=\"onUpdateAnswer($event)\" *ngIf=\"question.questionTypeId == questionTypeEnum.CheckBox\">\r\n </lib-question-check-box-template>\r\n\r\n <lib-question-matrix-template #questionMatrixTemplate [setQuestion]=\"question\"\r\n (emitter)=\"onUpdateAnswer($event)\" *ngIf=\"question.questionTypeId == questionTypeEnum.Matrix\">\r\n </lib-question-matrix-template>\r\n\r\n <lib-question-cascade-template #questionCascadeTemplate [setQuestion]=\"question\"\r\n (emitter)=\"onUpdateAnswer($event)\" *ngIf=\"question.questionTypeId == questionTypeEnum.Cascade\"\r\n [applicantKey]=\"applicantKey\" [isPre]=\"isPre\" [surveyLanguageId]=\"surveyLanguageId\" \r\n [pageIndex]=\"surveyPageIndex\"></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=\"surveyData != null\">\r\n <div class=\"container\" style=\" justify-content: start;\">\r\n <div class=\"survay-pagination fw-bold\">\r\n <span>{{curruntShowedSurveyPages}}</span>\r\n <span class=\"ms-2 me-2\">of</span>\r\n <span>{{showedSurveyPages?.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"] }]
1376
1370
  }], ctorParameters: function () { return [{ type: SurveyLibService }, { type: i1.FormBuilder }, { type: CheckRuleExpsUsecase }]; }, propDecorators: { isPre: [{
1377
1371
  type: Input
1378
1372
  }], surveyLanguageId: [{
@@ -1385,6 +1379,20 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.7", ngImpor
1385
1379
  type: Output
1386
1380
  }] } });
1387
1381
 
1382
+ class FilterQuestionPipe {
1383
+ transform(value, questionArr) {
1384
+ return questionArr.find(x => x.questionId == value.questionId);
1385
+ }
1386
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: FilterQuestionPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
1387
+ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "16.1.7", ngImport: i0, type: FilterQuestionPipe, name: "filterQuestion" }); }
1388
+ }
1389
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: FilterQuestionPipe, decorators: [{
1390
+ type: Pipe,
1391
+ args: [{
1392
+ name: 'filterQuestion'
1393
+ }]
1394
+ }] });
1395
+
1388
1396
  class DefaultQuestionAnswerPipe {
1389
1397
  transform(value, questionId, reloadId) {
1390
1398
  if (value != null) {
@@ -1428,6 +1436,11 @@ class SurveryLibModule {
1428
1436
  ]
1429
1437
  };
1430
1438
  }
1439
+ static forChild() {
1440
+ return {
1441
+ ngModule: SurveryLibModule
1442
+ };
1443
+ }
1431
1444
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: SurveryLibModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
1432
1445
  static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.1.7", ngImport: i0, type: SurveryLibModule, declarations: [SurveryLibComponent,
1433
1446
  QuestionTextTemplateComponent,