survery-lib 0.1.45 → 0.1.46
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-text-template/question-text-template.component.mjs +11 -8
- package/esm2022/lib/directives/masked-for-min-max.directive.mjs +45 -0
- package/esm2022/lib/survery-lib.component.mjs +3 -3
- package/esm2022/lib/survery-lib.module.mjs +6 -3
- package/esm2022/shared/form-interfaces/question-text-template.form-interface.mjs +1 -1
- package/fesm2022/survery-lib.mjs +60 -12
- package/fesm2022/survery-lib.mjs.map +1 -1
- package/lib/components/question-text-template/question-text-template.component.d.ts +5 -2
- package/lib/directives/masked-for-min-max.directive.d.ts +9 -0
- package/lib/survery-lib.module.d.ts +7 -6
- package/package.json +1 -1
- package/shared/form-interfaces/question-text-template.form-interface.d.ts +2 -0
package/fesm2022/survery-lib.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Injectable, Pipe, EventEmitter, Component, Output, Input, InjectionToken, Inject, NgModule } from '@angular/core';
|
|
2
|
+
import { Injectable, Pipe, EventEmitter, Component, Output, Input, InjectionToken, Inject, Directive, HostListener, NgModule } from '@angular/core';
|
|
3
3
|
import { v4 } from 'uuid';
|
|
4
4
|
import { Subject, of, debounceTime, map, filter, distinctUntilChanged } from 'rxjs';
|
|
5
5
|
import * as i1 from '@ng-stack/forms';
|
|
@@ -318,10 +318,6 @@ class QuestionTextTemplateComponent {
|
|
|
318
318
|
get questionTypeEnum() {
|
|
319
319
|
return QuestionTypeEnum;
|
|
320
320
|
}
|
|
321
|
-
get isShowTextArea() {
|
|
322
|
-
const fromValue = this.rForm.value;
|
|
323
|
-
return fromValue.inputTypeId != InputTypeEnum.Number;
|
|
324
|
-
}
|
|
325
321
|
set setQuestion(value) {
|
|
326
322
|
this.surveyQuestion = value;
|
|
327
323
|
this.rForm.patchValue({
|
|
@@ -341,9 +337,11 @@ class QuestionTextTemplateComponent {
|
|
|
341
337
|
this.fCtrls.answer.addValidators([Validators.required]);
|
|
342
338
|
if (value.surveyAnswers[0].inputTypeId == InputTypeEnum.Number) {
|
|
343
339
|
if (value.surveyAnswers[0].inputMin != null) {
|
|
340
|
+
this.fCtrls.inputMin.setValue(value.surveyAnswers[0].inputMin);
|
|
344
341
|
this.fCtrls.answer.addValidators([Validators.min(value.surveyAnswers[0].inputMin)]);
|
|
345
342
|
}
|
|
346
343
|
if (value.surveyAnswers[0].inputMax != null) {
|
|
344
|
+
this.fCtrls.inputMax.setValue(value.surveyAnswers[0].inputMax);
|
|
347
345
|
this.fCtrls.answer.addValidators([Validators.max(value.surveyAnswers[0].inputMax)]);
|
|
348
346
|
}
|
|
349
347
|
}
|
|
@@ -361,6 +359,7 @@ class QuestionTextTemplateComponent {
|
|
|
361
359
|
this._formBuilder = _formBuilder;
|
|
362
360
|
this._surveyLibService = _surveyLibService;
|
|
363
361
|
this.emitter = new EventEmitter();
|
|
362
|
+
this.isArabicLang = false;
|
|
364
363
|
this.isTextArea = false;
|
|
365
364
|
this.rForm = this._formBuilder.group({
|
|
366
365
|
id: [null],
|
|
@@ -372,7 +371,9 @@ class QuestionTextTemplateComponent {
|
|
|
372
371
|
answer: [null],
|
|
373
372
|
isDisabled: [false],
|
|
374
373
|
isShow: [true],
|
|
375
|
-
inputTypeId: [null]
|
|
374
|
+
inputTypeId: [null],
|
|
375
|
+
inputMin: [null],
|
|
376
|
+
inputMax: [null]
|
|
376
377
|
});
|
|
377
378
|
}
|
|
378
379
|
ngOnInit() {
|
|
@@ -411,13 +412,15 @@ class QuestionTextTemplateComponent {
|
|
|
411
412
|
this.fCtrls.answer.updateValueAndValidity();
|
|
412
413
|
}
|
|
413
414
|
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 }); }
|
|
414
|
-
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 <span [innerHTML]=\"surveyQuestion?.questionTitle\"></span>\n <span style=\"color: red;\" *ngIf=\"surveyQuestion.isRequired\">*</span>\n </h3>\n <div class=\"text-quastion\">\n <ng-container *ngIf=\"
|
|
415
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.7", type: QuestionTextTemplateComponent, selector: "lib-question-text-template", inputs: { isArabicLang: "isArabicLang", 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 <span [innerHTML]=\"surveyQuestion?.questionTitle\"></span>\n <span style=\"color: red;\" *ngIf=\"surveyQuestion.isRequired\">*</span>\n <p *ngIf=\"fCtrls.inputMin.value != null || fCtrls.inputMax.value != null\" class=\"text-danger\">\n <small>{{isArabicLang == true ? ' \u0627\u0644\u0642\u064A\u0645\u0629 \u064A\u062C\u0628 \u0627\u0646 \u062A\u0643\u0648\u0646' :'The value must be '}}</small>\n <small *ngIf=\"fCtrls.inputMin.value\">{{isArabicLang == true ? ' \u0645\u0646' : 'from'}} {{fCtrls.inputMin.value}} </small>\n <small *ngIf=\"fCtrls.inputMax.value\">{{isArabicLang == true ? '\u0627\u0644\u0649' : 'to'}} {{fCtrls.inputMax.value}} </small>\n </p>\n </h3>\n <div class=\"text-quastion\">\n <ng-container *ngIf=\"isTextArea == false else textAreaTemplate\">\n <input class=\"form-control\" [attr.min]=\"fCtrls.inputMin.value\"\n [attr.max]=\"fCtrls.inputMax.value\" [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=\"2\" [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" }] }); }
|
|
415
416
|
}
|
|
416
417
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: QuestionTextTemplateComponent, decorators: [{
|
|
417
418
|
type: Component,
|
|
418
|
-
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 <span [innerHTML]=\"surveyQuestion?.questionTitle\"></span>\n <span style=\"color: red;\" *ngIf=\"surveyQuestion.isRequired\">*</span>\n </h3>\n <div class=\"text-quastion\">\n <ng-container *ngIf=\"
|
|
419
|
+
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 <span [innerHTML]=\"surveyQuestion?.questionTitle\"></span>\n <span style=\"color: red;\" *ngIf=\"surveyQuestion.isRequired\">*</span>\n <p *ngIf=\"fCtrls.inputMin.value != null || fCtrls.inputMax.value != null\" class=\"text-danger\">\n <small>{{isArabicLang == true ? ' \u0627\u0644\u0642\u064A\u0645\u0629 \u064A\u062C\u0628 \u0627\u0646 \u062A\u0643\u0648\u0646' :'The value must be '}}</small>\n <small *ngIf=\"fCtrls.inputMin.value\">{{isArabicLang == true ? ' \u0645\u0646' : 'from'}} {{fCtrls.inputMin.value}} </small>\n <small *ngIf=\"fCtrls.inputMax.value\">{{isArabicLang == true ? '\u0627\u0644\u0649' : 'to'}} {{fCtrls.inputMax.value}} </small>\n </p>\n </h3>\n <div class=\"text-quastion\">\n <ng-container *ngIf=\"isTextArea == false else textAreaTemplate\">\n <input class=\"form-control\" [attr.min]=\"fCtrls.inputMin.value\"\n [attr.max]=\"fCtrls.inputMax.value\" [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=\"2\" [formControl]=\"convertToFormControl(fCtrls.answer)\"\n [disabled]=\"isDisabled\"></textarea>\n </ng-template>\n </div>" }]
|
|
419
420
|
}], ctorParameters: function () { return [{ type: i1.FormBuilder }, { type: SurveyLibService }]; }, propDecorators: { emitter: [{
|
|
420
421
|
type: Output
|
|
422
|
+
}], isArabicLang: [{
|
|
423
|
+
type: Input
|
|
421
424
|
}], isTextArea: [{
|
|
422
425
|
type: Input
|
|
423
426
|
}], setQuestion: [{
|
|
@@ -1406,11 +1409,11 @@ class SurveryLibComponent {
|
|
|
1406
1409
|
});
|
|
1407
1410
|
}
|
|
1408
1411
|
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 }); }
|
|
1409
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.7", type: SurveryLibComponent, selector: "lib-survery-lib", inputs: { isPre: "isPre", surveyLanguageId: "surveyLanguageId", applicantKey: "applicantKey", isArabicLang: "isArabicLang" }, outputs: { surveyResultEmit: "surveyResultEmit", selectLanguageEmit: "selectLanguageEmit" }, ngImport: i0, template: "<div id=\"survery-card-{{surveryLibraryDivId}}\" class=\"survay-card\">\r\n <div *ngFor=\"let surveyPage of surveyData?.surveyPages; let surveyPageIndex = index\"\r\n [attr.id]=\"'survey-page_'+surveyPageIndex\" [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\" [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 *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)\"\r\n *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\">{{isArabicLang ? '\u0645\u0646' : '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"] }] }); }
|
|
1412
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.7", type: SurveryLibComponent, selector: "lib-survery-lib", inputs: { isPre: "isPre", surveyLanguageId: "surveyLanguageId", applicantKey: "applicantKey", isArabicLang: "isArabicLang" }, outputs: { surveyResultEmit: "surveyResultEmit", selectLanguageEmit: "selectLanguageEmit" }, ngImport: i0, template: "<div id=\"survery-card-{{surveryLibraryDivId}}\" class=\"survay-card\">\r\n <div *ngFor=\"let surveyPage of surveyData?.surveyPages; let surveyPageIndex = index\"\r\n [attr.id]=\"'survey-page_'+surveyPageIndex\" [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\" [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 *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\" [isArabicLang]=\"isArabicLang\"></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)\"\r\n *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\">{{isArabicLang ? '\u0645\u0646' : '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: ["isArabicLang", "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"] }] }); }
|
|
1410
1413
|
}
|
|
1411
1414
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: SurveryLibComponent, decorators: [{
|
|
1412
1415
|
type: Component,
|
|
1413
|
-
args: [{ selector: 'lib-survery-lib', template: "<div id=\"survery-card-{{surveryLibraryDivId}}\" class=\"survay-card\">\r\n <div *ngFor=\"let surveyPage of surveyData?.surveyPages; let surveyPageIndex = index\"\r\n [attr.id]=\"'survey-page_'+surveyPageIndex\" [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\" [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 *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)\"\r\n *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\">{{isArabicLang ? '\u0645\u0646' : '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"] }]
|
|
1416
|
+
args: [{ selector: 'lib-survery-lib', template: "<div id=\"survery-card-{{surveryLibraryDivId}}\" class=\"survay-card\">\r\n <div *ngFor=\"let surveyPage of surveyData?.surveyPages; let surveyPageIndex = index\"\r\n [attr.id]=\"'survey-page_'+surveyPageIndex\" [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\" [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 *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\" [isArabicLang]=\"isArabicLang\"></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)\"\r\n *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\">{{isArabicLang ? '\u0645\u0646' : '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"] }]
|
|
1414
1417
|
}], ctorParameters: function () { return [{ type: SurveyLibService }, { type: i1.FormBuilder }, { type: CheckRuleExpsUsecase }]; }, propDecorators: { isPre: [{
|
|
1415
1418
|
type: Input
|
|
1416
1419
|
}], surveyLanguageId: [{
|
|
@@ -1473,6 +1476,49 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.7", ngImpor
|
|
|
1473
1476
|
}]
|
|
1474
1477
|
}] });
|
|
1475
1478
|
|
|
1479
|
+
class MaskedForMinMaxDirective {
|
|
1480
|
+
constructor(el) {
|
|
1481
|
+
this.el = el;
|
|
1482
|
+
}
|
|
1483
|
+
onKeyUp(event) {
|
|
1484
|
+
let ele = this.el.nativeElement;
|
|
1485
|
+
const input = event.target;
|
|
1486
|
+
if (input.type === 'number') {
|
|
1487
|
+
var min = null;
|
|
1488
|
+
var max = null;
|
|
1489
|
+
if (input.getAttribute('min') !== null) {
|
|
1490
|
+
min = parseInt(input.getAttribute('min'));
|
|
1491
|
+
}
|
|
1492
|
+
if (input.getAttribute('max') !== null) {
|
|
1493
|
+
max = parseInt(input.getAttribute('max'));
|
|
1494
|
+
}
|
|
1495
|
+
if (min != null) {
|
|
1496
|
+
var newInputValue = input.value + event.key;
|
|
1497
|
+
if (parseInt(newInputValue) < min) {
|
|
1498
|
+
event.preventDefault();
|
|
1499
|
+
}
|
|
1500
|
+
}
|
|
1501
|
+
if (max !== null) {
|
|
1502
|
+
var newInputValue = input.value + event.key;
|
|
1503
|
+
if (parseInt(newInputValue) > max) {
|
|
1504
|
+
event.preventDefault();
|
|
1505
|
+
}
|
|
1506
|
+
}
|
|
1507
|
+
}
|
|
1508
|
+
}
|
|
1509
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: MaskedForMinMaxDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1510
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.1.7", type: MaskedForMinMaxDirective, selector: "[libMaskedForMinMax]", host: { listeners: { "keypress": "onKeyUp($event)" } }, ngImport: i0 }); }
|
|
1511
|
+
}
|
|
1512
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: MaskedForMinMaxDirective, decorators: [{
|
|
1513
|
+
type: Directive,
|
|
1514
|
+
args: [{
|
|
1515
|
+
selector: '[libMaskedForMinMax]'
|
|
1516
|
+
}]
|
|
1517
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { onKeyUp: [{
|
|
1518
|
+
type: HostListener,
|
|
1519
|
+
args: ['keypress', ['$event']]
|
|
1520
|
+
}] } });
|
|
1521
|
+
|
|
1476
1522
|
class SurveryLibModule {
|
|
1477
1523
|
static forRoot(config) {
|
|
1478
1524
|
return {
|
|
@@ -1500,7 +1546,8 @@ class SurveryLibModule {
|
|
|
1500
1546
|
DefaultQuestionAnswerPipe,
|
|
1501
1547
|
DefaultQuestionAnswersPipe,
|
|
1502
1548
|
TextBoxTypeAttrPipe,
|
|
1503
|
-
QuestionCascadeTemplateComponent
|
|
1549
|
+
QuestionCascadeTemplateComponent,
|
|
1550
|
+
MaskedForMinMaxDirective], imports: [CommonModule, HttpClientModule, ReactiveFormsModule, FormsModule, NgsFormsModule, NgSelectModule], exports: [SurveryLibComponent] }); }
|
|
1504
1551
|
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: SurveryLibModule, imports: [CommonModule, HttpClientModule, ReactiveFormsModule, FormsModule, NgsFormsModule, NgSelectModule] }); }
|
|
1505
1552
|
}
|
|
1506
1553
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: SurveryLibModule, decorators: [{
|
|
@@ -1519,7 +1566,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.7", ngImpor
|
|
|
1519
1566
|
DefaultQuestionAnswerPipe,
|
|
1520
1567
|
DefaultQuestionAnswersPipe,
|
|
1521
1568
|
TextBoxTypeAttrPipe,
|
|
1522
|
-
QuestionCascadeTemplateComponent
|
|
1569
|
+
QuestionCascadeTemplateComponent,
|
|
1570
|
+
MaskedForMinMaxDirective
|
|
1523
1571
|
],
|
|
1524
1572
|
imports: [
|
|
1525
1573
|
CommonModule, HttpClientModule, ReactiveFormsModule, FormsModule, NgsFormsModule, NgSelectModule
|