survery-lib 2.1.47 → 2.1.49
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2022/lib/components/question-file-template/question-file-template.component.mjs +66 -56
- package/esm2022/lib/core/states/entites/question.entity.mjs +1 -1
- package/esm2022/lib/core/states/survey-store/survey.action.mjs +1 -1
- package/esm2022/lib/core/states/survey-store/survey.reducer.mjs +3 -3
- package/esm2022/lib/survery-lib.component.mjs +1 -1
- package/esm2022/shared/dtos/default-question-answers.dto.mjs +1 -1
- package/esm2022/shared/dtos/survey-answer.dto.mjs +1 -1
- package/esm2022/shared/form-interfaces/question-file-template.form-interface.mjs +1 -1
- package/esm2022/shared/models/survery-question-result.model.mjs +1 -1
- package/fesm2022/survery-lib.mjs +68 -58
- package/fesm2022/survery-lib.mjs.map +1 -1
- package/lib/components/question-file-template/question-file-template.component.d.ts +9 -5
- package/lib/core/states/entites/question.entity.d.ts +4 -1
- package/lib/core/states/survey-store/survey.action.d.ts +8 -4
- package/package.json +1 -1
- package/shared/dtos/default-question-answers.dto.d.ts +4 -0
- package/shared/dtos/survey-answer.dto.d.ts +2 -0
- package/shared/form-interfaces/question-file-template.form-interface.d.ts +8 -2
- package/shared/models/survery-question-result.model.d.ts +4 -1
package/fesm2022/survery-lib.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Injectable, Directive, HostListener, Pipe, Component, Input, EventEmitter, Output, InjectionToken, Inject, computed, NgModule } from '@angular/core';
|
|
2
|
+
import { Injectable, Directive, HostListener, Pipe, Component, Input, EventEmitter, Output, InjectionToken, Inject, computed, ViewChild, NgModule } from '@angular/core';
|
|
3
3
|
import { v4 } from 'uuid';
|
|
4
4
|
import { Subject, of, debounceTime, distinctUntilChanged, map, filter, pairwise, take, withLatestFrom, switchMap } from 'rxjs';
|
|
5
5
|
import * as i1 from '@angular/forms';
|
|
@@ -2294,34 +2294,34 @@ class QuestionFileTemplateComponent {
|
|
|
2294
2294
|
this.fCtrls.isShow.setValue(value.isShow);
|
|
2295
2295
|
}
|
|
2296
2296
|
if (value.questionAllInfo.surveyAnswers[0]?.answerId != null && value.questionAllInfo.surveyAnswers[0]?.answerId != undefined) {
|
|
2297
|
-
|
|
2297
|
+
const answer = value.questionAllInfo.surveyAnswers[0];
|
|
2298
|
+
this.rForm.patchValue({
|
|
2299
|
+
surveyAnswerId: answer.answerId,
|
|
2300
|
+
isMultiple: answer.isMultiple,
|
|
2301
|
+
acceptedTypes: answer.acceptedTypes
|
|
2302
|
+
});
|
|
2298
2303
|
}
|
|
2299
2304
|
if (value.isRequired == true) {
|
|
2300
|
-
this.fCtrls.
|
|
2301
|
-
this.fCtrls.
|
|
2305
|
+
this.fCtrls.fileArr.addValidators([Validators.required]);
|
|
2306
|
+
this.fCtrls.fileArr.updateValueAndValidity();
|
|
2302
2307
|
}
|
|
2303
2308
|
var question = this.questionArr().find(x => x.questionId == value.questionId);
|
|
2304
2309
|
if (question?.answerText) {
|
|
2305
2310
|
this.rForm.patchValue({
|
|
2306
|
-
|
|
2311
|
+
fileArr: question.answerFile.map(x => ({ file: x.file, name: x.name, byteArr: null })),
|
|
2307
2312
|
isDisabled: question.isDisabled,
|
|
2308
2313
|
isShow: question.isShow
|
|
2309
2314
|
}, { emitEvent: false });
|
|
2310
2315
|
}
|
|
2311
|
-
this.toggleEnableAnswer(value.questionAllInfo.isReadOnly);
|
|
2312
2316
|
}
|
|
2313
2317
|
}
|
|
2314
|
-
set isDisabled(value) {
|
|
2315
|
-
this.toggleEnableAnswer(value);
|
|
2316
|
-
}
|
|
2317
2318
|
constructor(_formBuilder, _surveyLibService, _Store) {
|
|
2318
2319
|
this._formBuilder = _formBuilder;
|
|
2319
2320
|
this._surveyLibService = _surveyLibService;
|
|
2320
2321
|
this._Store = _Store;
|
|
2322
|
+
this.MAX_FILE_SIZE = 10 * 1024 * 1024;
|
|
2321
2323
|
this.questionArr = this._Store.selectSignal(questionSelectors.pageQuestions);
|
|
2322
2324
|
this.isArabicLang = false;
|
|
2323
|
-
// Define maximum size in bytes (e.g., 5MB = 5 * 1024 * 1024)
|
|
2324
|
-
this.MAX_FILE_SIZE = 10 * 1024 * 1024;
|
|
2325
2325
|
this.rForm = this._formBuilder.group({
|
|
2326
2326
|
id: new FormControl(null),
|
|
2327
2327
|
name: new FormControl(null),
|
|
@@ -2329,21 +2329,21 @@ class QuestionFileTemplateComponent {
|
|
|
2329
2329
|
typeId: new FormControl(null),
|
|
2330
2330
|
description: new FormControl(null),
|
|
2331
2331
|
surveyAnswerId: new FormControl(null),
|
|
2332
|
-
|
|
2333
|
-
fileName: new FormControl(null),
|
|
2332
|
+
fileArr: new FormControl(null),
|
|
2334
2333
|
isDisabled: new FormControl(false),
|
|
2335
2334
|
isShow: new FormControl(true),
|
|
2335
|
+
isMultiple: new FormControl(false),
|
|
2336
|
+
acceptedTypes: new FormControl(''),
|
|
2336
2337
|
});
|
|
2337
2338
|
}
|
|
2338
2339
|
ngOnInit() {
|
|
2339
|
-
this.fCtrls.
|
|
2340
|
+
this.fCtrls.fileArr.valueChanges.pipe().pipe(debounceTime(200), distinctUntilChanged()).subscribe(value => {
|
|
2340
2341
|
setTimeout(() => {
|
|
2341
2342
|
const formValue = this.rForm.value;
|
|
2342
2343
|
this._Store.dispatch(surveyActions.updateQuestionFileAnswer({
|
|
2343
2344
|
questionId: formValue.id,
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
isValid: this.fCtrls.file.valid
|
|
2345
|
+
fileArr: formValue.fileArr,
|
|
2346
|
+
isValid: this.fCtrls.fileArr.valid
|
|
2347
2347
|
}));
|
|
2348
2348
|
}, 100);
|
|
2349
2349
|
});
|
|
@@ -2352,8 +2352,8 @@ class QuestionFileTemplateComponent {
|
|
|
2352
2352
|
const oldValue = value[0];
|
|
2353
2353
|
const newValue = value[1];
|
|
2354
2354
|
//updated answer
|
|
2355
|
-
if (oldValue?.
|
|
2356
|
-
this.fCtrls.
|
|
2355
|
+
if (JSON.stringify(oldValue?.answerFile) != JSON.stringify(newValue?.answerFile) && oldValue?.answerFile == null) {
|
|
2356
|
+
this.fCtrls.fileArr.setValue(newValue?.answerFile.map(x => ({ file: x.file, name: x.name, byteArr: null })), { emitEvent: false });
|
|
2357
2357
|
}
|
|
2358
2358
|
//updated isDisabled
|
|
2359
2359
|
if (oldValue?.isDisabled != newValue?.isDisabled) {
|
|
@@ -2363,8 +2363,7 @@ class QuestionFileTemplateComponent {
|
|
|
2363
2363
|
if (oldValue?.isShow != newValue?.isShow) {
|
|
2364
2364
|
this.fCtrls.isShow.setValue(newValue?.isShow);
|
|
2365
2365
|
if (newValue?.isShow == false) {
|
|
2366
|
-
this.fCtrls.
|
|
2367
|
-
this.fCtrls.fileName.setValue(null);
|
|
2366
|
+
this.fCtrls.fileArr.setValue(null);
|
|
2368
2367
|
}
|
|
2369
2368
|
}
|
|
2370
2369
|
});
|
|
@@ -2375,52 +2374,63 @@ class QuestionFileTemplateComponent {
|
|
|
2375
2374
|
onFileSelect(event) {
|
|
2376
2375
|
const input = event.target;
|
|
2377
2376
|
if (input.files && input.files.length > 0) {
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
|
|
2396
|
-
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
|
|
2377
|
+
this.fCtrls.fileArr.setValue([]);
|
|
2378
|
+
for (let index = 0; index < input.files.length; index++) {
|
|
2379
|
+
const file = input.files[index];
|
|
2380
|
+
if (file.size > this.MAX_FILE_SIZE) {
|
|
2381
|
+
// Exceeds max length/size
|
|
2382
|
+
alert('File size exceeds the 10MB limit.');
|
|
2383
|
+
}
|
|
2384
|
+
else {
|
|
2385
|
+
const reader = new FileReader();
|
|
2386
|
+
// Read the file as a Data URL (Base64)
|
|
2387
|
+
reader.readAsDataURL(file);
|
|
2388
|
+
reader.onload = () => {
|
|
2389
|
+
const base64Result = reader.result;
|
|
2390
|
+
// Strip the Data URL prefix (e.g., "data:image/png;base64,") to leave raw Base64 data
|
|
2391
|
+
const base64Data = base64Result.split(',')[1];
|
|
2392
|
+
let fileArr = [...this.fCtrls.fileArr.value || []];
|
|
2393
|
+
if (this.fCtrls.isMultiple.value == false) {
|
|
2394
|
+
fileArr = [];
|
|
2395
|
+
}
|
|
2396
|
+
fileArr.push({ file: base64Result, name: file.name, byteArr: base64Data, fileRaw: file });
|
|
2397
|
+
this.fCtrls.fileArr.setValue(fileArr);
|
|
2398
|
+
this.fileInputRef.nativeElement.value = '';
|
|
2399
|
+
};
|
|
2400
|
+
}
|
|
2400
2401
|
}
|
|
2401
2402
|
}
|
|
2402
2403
|
}
|
|
2403
|
-
|
|
2404
|
-
if (
|
|
2405
|
-
|
|
2406
|
-
|
|
2407
|
-
|
|
2408
|
-
|
|
2409
|
-
|
|
2410
|
-
|
|
2404
|
+
openFileInNewTab(item) {
|
|
2405
|
+
if (!item?.file)
|
|
2406
|
+
return;
|
|
2407
|
+
console.log('Opening file in new tab:', item);
|
|
2408
|
+
const link = document.createElement('a');
|
|
2409
|
+
link.href = item.file;
|
|
2410
|
+
link.download = item.name || 'downloaded-file';
|
|
2411
|
+
// Append to body, trigger click, and remove
|
|
2412
|
+
document.body.appendChild(link);
|
|
2413
|
+
link.click();
|
|
2414
|
+
document.body.removeChild(link);
|
|
2415
|
+
}
|
|
2416
|
+
onDeleteFile(index) {
|
|
2417
|
+
const fileArr = this.fCtrls.fileArr.value || [];
|
|
2418
|
+
var newFileArr = fileArr.filter((_, i) => i !== index);
|
|
2419
|
+
this.fCtrls.fileArr.setValue(newFileArr);
|
|
2411
2420
|
}
|
|
2412
2421
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: QuestionFileTemplateComponent, deps: [{ token: i1.FormBuilder }, { token: SurveyLibService }, { token: i3.Store }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2413
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.7", type: QuestionFileTemplateComponent, selector: "lib-question-file-template", inputs: { isArabicLang: "isArabicLang", setQuestion: "setQuestion",
|
|
2422
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.7", type: QuestionFileTemplateComponent, selector: "lib-question-file-template", inputs: { isArabicLang: "isArabicLang", setQuestion: "setQuestion" }, viewQueries: [{ propertyName: "fileInputRef", first: true, predicate: ["fileInput"], descendants: true }], ngImport: i0, template: "<div class=\"quastion\" [formGroup]=\"rForm\" [attr.id]=\"'question_'+fCtrls.id.value\"\r\n [ngClass]=\"{'invalid-question': fCtrls.fileArr.invalid , 'd-none':fCtrls.isShow.value != true}\">\r\n <h3 class=\"quastion-title \">\r\n <span [innerHTML]=\"surveyQuestion?.questionTitle\"></span>\r\n <span style=\"color: red;\" *ngIf=\"surveyQuestion.isRequired\">*</span>\r\n </h3>\r\n <div class=\"text-quastion\">\r\n <input #fileInput class=\"form-control\" [disabled]=\"fCtrls.isDisabled.value\" [multiple]=\"fCtrls.isMultiple.value\"\r\n type=\"file\" (change)=\"onFileSelect($event)\">\r\n <div class=\"d-flex flex-row gap-2 mt-2\">\r\n <div *ngFor=\"let item of fCtrls.fileArr.value; let i = index\" class=\"me-4\">\r\n <a href=\"javascript:void(0)\" (click)=\"openFileInNewTab(item)\">{{item.name}}</a>\r\n <a href=\"javascript:void(0)\" class=\"text-danger ms-2\" (click)=\"onDeleteFile(i)\">\r\n <i class=\"fa-solid fa-xmark\"></i>\r\n </a>\r\n </div>\r\n </div>\r\n </div>", styles: [""], dependencies: [{ kind: "directive", type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }] }); }
|
|
2414
2423
|
}
|
|
2415
2424
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: QuestionFileTemplateComponent, decorators: [{
|
|
2416
2425
|
type: Component,
|
|
2417
|
-
args: [{ selector: 'lib-question-file-template', template: "<div class=\"quastion\" [formGroup]=\"rForm\" [attr.id]=\"'question_'+fCtrls.id.value\"\r\n [ngClass]=\"{'invalid-question': fCtrls.
|
|
2426
|
+
args: [{ selector: 'lib-question-file-template', template: "<div class=\"quastion\" [formGroup]=\"rForm\" [attr.id]=\"'question_'+fCtrls.id.value\"\r\n [ngClass]=\"{'invalid-question': fCtrls.fileArr.invalid , 'd-none':fCtrls.isShow.value != true}\">\r\n <h3 class=\"quastion-title \">\r\n <span [innerHTML]=\"surveyQuestion?.questionTitle\"></span>\r\n <span style=\"color: red;\" *ngIf=\"surveyQuestion.isRequired\">*</span>\r\n </h3>\r\n <div class=\"text-quastion\">\r\n <input #fileInput class=\"form-control\" [disabled]=\"fCtrls.isDisabled.value\" [multiple]=\"fCtrls.isMultiple.value\"\r\n type=\"file\" (change)=\"onFileSelect($event)\">\r\n <div class=\"d-flex flex-row gap-2 mt-2\">\r\n <div *ngFor=\"let item of fCtrls.fileArr.value; let i = index\" class=\"me-4\">\r\n <a href=\"javascript:void(0)\" (click)=\"openFileInNewTab(item)\">{{item.name}}</a>\r\n <a href=\"javascript:void(0)\" class=\"text-danger ms-2\" (click)=\"onDeleteFile(i)\">\r\n <i class=\"fa-solid fa-xmark\"></i>\r\n </a>\r\n </div>\r\n </div>\r\n </div>" }]
|
|
2418
2427
|
}], ctorParameters: function () { return [{ type: i1.FormBuilder }, { type: SurveyLibService }, { type: i3.Store }]; }, propDecorators: { isArabicLang: [{
|
|
2419
2428
|
type: Input
|
|
2420
2429
|
}], setQuestion: [{
|
|
2421
2430
|
type: Input
|
|
2422
|
-
}],
|
|
2423
|
-
type:
|
|
2431
|
+
}], fileInputRef: [{
|
|
2432
|
+
type: ViewChild,
|
|
2433
|
+
args: ['fileInput']
|
|
2424
2434
|
}] } });
|
|
2425
2435
|
|
|
2426
2436
|
class FilterQuestionPipe {
|
|
@@ -2572,7 +2582,7 @@ class SurveryLibComponent {
|
|
|
2572
2582
|
return null;
|
|
2573
2583
|
}
|
|
2574
2584
|
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 }); }
|
|
2575
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.7", type: SurveryLibComponent, selector: "lib-survery-lib", inputs: { isPre: "isPre", surveyLanguageId: "surveyLanguageId", surveyKey: "surveyKey", 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\" [applicantKey]=\"applicantKey\" [isPre]=\"isPre\"\r\n [surveyLanguageId]=\"surveyLanguageId\" [pageId]=\"question.surveyPageId\"\r\n [questionGroupId]=\"question.questionGroupId\" [surveyKey]=\"surveyKey\"\r\n [surveyLanguageId]=\"surveyLanguageId\"></lib-question-cascade-template>\r\n\r\n <lib-question-institutions-template #questionInstitutionsTemplate [setQuestion]=\"question\"\r\n *ngIf=\"question.questionType == questionTypeEnum.Institutions\"\r\n [isArabicLang]=\"isArabicLang\"></lib-question-institutions-template>\r\n\r\n <lib-question-file-template #questionFileTemplate [setQuestion]=\"question\"\r\n *ngIf=\"question.questionType == questionTypeEnum.File\">\r\n </lib-question-file-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", "surveyKey", "applicantKey", "setQuestion"] }, { kind: "component", type: QuestionFeedbackTemplateComponent, selector: "lib-question-feedback-template", inputs: ["isArabicLang", "setQuestion", "isDisabled"] }, { kind: "component", type: QuestionInstitutionsTemplateComponent, selector: "lib-question-institutions-template", inputs: ["isArabicLang", "setQuestion"] }, { kind: "component", type: QuestionFileTemplateComponent, selector: "lib-question-file-template", inputs: ["isArabicLang", "setQuestion"
|
|
2585
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.7", type: SurveryLibComponent, selector: "lib-survery-lib", inputs: { isPre: "isPre", surveyLanguageId: "surveyLanguageId", surveyKey: "surveyKey", 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\" [applicantKey]=\"applicantKey\" [isPre]=\"isPre\"\r\n [surveyLanguageId]=\"surveyLanguageId\" [pageId]=\"question.surveyPageId\"\r\n [questionGroupId]=\"question.questionGroupId\" [surveyKey]=\"surveyKey\"\r\n [surveyLanguageId]=\"surveyLanguageId\"></lib-question-cascade-template>\r\n\r\n <lib-question-institutions-template #questionInstitutionsTemplate [setQuestion]=\"question\"\r\n *ngIf=\"question.questionType == questionTypeEnum.Institutions\"\r\n [isArabicLang]=\"isArabicLang\"></lib-question-institutions-template>\r\n\r\n <lib-question-file-template #questionFileTemplate [setQuestion]=\"question\"\r\n *ngIf=\"question.questionType == questionTypeEnum.File\">\r\n </lib-question-file-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", "surveyKey", "applicantKey", "setQuestion"] }, { kind: "component", type: QuestionFeedbackTemplateComponent, selector: "lib-question-feedback-template", inputs: ["isArabicLang", "setQuestion", "isDisabled"] }, { kind: "component", type: QuestionInstitutionsTemplateComponent, selector: "lib-question-institutions-template", inputs: ["isArabicLang", "setQuestion"] }, { kind: "component", type: QuestionFileTemplateComponent, selector: "lib-question-file-template", inputs: ["isArabicLang", "setQuestion"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }, { kind: "pipe", type: FilterQuestionPipe, name: "filterQuestion" }] }); }
|
|
2576
2586
|
}
|
|
2577
2587
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: SurveryLibComponent, decorators: [{
|
|
2578
2588
|
type: Component,
|
|
@@ -2698,8 +2708,8 @@ const _surveyReducer = createReducer(initialSurveyState, on(surveyActions.loadSu
|
|
|
2698
2708
|
id: props.questionId,
|
|
2699
2709
|
changes: {
|
|
2700
2710
|
answerId: question.questionAllInfo.surveyAnswers[0].answerId,
|
|
2701
|
-
answerText:
|
|
2702
|
-
answerFile: props.
|
|
2711
|
+
answerText: null,
|
|
2712
|
+
answerFile: props.fileArr.map(x => ({ file: x.byteArr, name: x.name })),
|
|
2703
2713
|
isValid: props.isValid
|
|
2704
2714
|
}
|
|
2705
2715
|
};
|