@touchpoll/tp-survey 0.0.41 → 0.0.42
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.
|
@@ -465,6 +465,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.7", ngImpor
|
|
|
465
465
|
}], ctorParameters: () => [] });
|
|
466
466
|
|
|
467
467
|
class AlternativesContainerDirective {
|
|
468
|
+
set alternativesTemplates(value) {
|
|
469
|
+
this.#updateLayout(value);
|
|
470
|
+
}
|
|
468
471
|
#destroyRef;
|
|
469
472
|
constructor(_renderer, elementRef, _breakpointObserver) {
|
|
470
473
|
this._renderer = _renderer;
|
|
@@ -473,14 +476,15 @@ class AlternativesContainerDirective {
|
|
|
473
476
|
this.question = input.required({ alias: 'tpSurveyAlternativesContainer' });
|
|
474
477
|
this.viewModel = input.required({ alias: 'containerViewModel' });
|
|
475
478
|
this.#destroyRef = inject(DestroyRef);
|
|
476
|
-
effect(() =>
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
479
|
+
effect(() => this.#updateLayout());
|
|
480
|
+
}
|
|
481
|
+
#updateLayout(alternatives) {
|
|
482
|
+
if (this.viewModel() === ViewModel.vmTablet) {
|
|
483
|
+
this.#updateTabletLayout(alternatives);
|
|
484
|
+
}
|
|
485
|
+
else {
|
|
486
|
+
this.#updateDesktopLayout();
|
|
487
|
+
}
|
|
484
488
|
}
|
|
485
489
|
#updateDesktopLayout() {
|
|
486
490
|
this._breakpointObserver.observe(["(max-width: 480px)"]).pipe(map((result) => result.matches), takeUntilDestroyed(this.#destroyRef)).subscribe((isMobile) => {
|
|
@@ -494,8 +498,8 @@ class AlternativesContainerDirective {
|
|
|
494
498
|
this._renderer.setStyle(this.elementRef.nativeElement, 'grid-template-columns', `repeat(${columnCount}, 10fr)`);
|
|
495
499
|
});
|
|
496
500
|
}
|
|
497
|
-
#updateTabletLayout() {
|
|
498
|
-
if (!
|
|
501
|
+
#updateTabletLayout(alternatives) {
|
|
502
|
+
if (!alternatives) {
|
|
499
503
|
return;
|
|
500
504
|
}
|
|
501
505
|
if (this.viewModel() === ViewModel.vmTablet) {
|
|
@@ -507,7 +511,7 @@ class AlternativesContainerDirective {
|
|
|
507
511
|
const horizontalRatio = containerWidthFull / BASE_WIDTH;
|
|
508
512
|
const verticalRatio = containerHeightFull / BASE_HEIGHT;
|
|
509
513
|
const maxAlternativeWidth = containerWidthFull * 0.7; // для авторазмера установим максимальный размер альтернативы в 70% от доступной длинны контейнера
|
|
510
|
-
const alternativesCount = Math.max(
|
|
514
|
+
const alternativesCount = Math.max(alternatives.length, 1);
|
|
511
515
|
const horizontalDistance = question.AlternativeHorizontalDistance ?? 10 * horizontalRatio;
|
|
512
516
|
const verticalDistance = (question.AlternativeVerticalDistance ?? 10) * verticalRatio;
|
|
513
517
|
const marginTop = question.AlternativeMarginTop ?? 10 * verticalRatio;
|
|
@@ -520,7 +524,7 @@ class AlternativesContainerDirective {
|
|
|
520
524
|
if (question.AlternativeAutoSize ?? true) { // если авторазмер, то высоту и ширину считаем автоматом
|
|
521
525
|
const marginsWidth = horizontalDistance * (columnCount - 1) + defaultHorizontalPadding * 2;
|
|
522
526
|
width = Math.min((containerWidthFull - marginsWidth) / columnCount, maxAlternativeWidth);
|
|
523
|
-
height =
|
|
527
|
+
height = alternatives.reduce((maxHeight, alt) => {
|
|
524
528
|
const altWidthPercent = transformToPer(width, containerWidthFull);
|
|
525
529
|
this._renderer.setStyle(alt.nativeElement, 'width', `${altWidthPercent}%`);
|
|
526
530
|
return Math.max(maxHeight, alt.nativeElement.clientHeight);
|
|
@@ -534,7 +538,7 @@ class AlternativesContainerDirective {
|
|
|
534
538
|
const deltaHorizontal = (containerWidthFull - width * columnCount - horizontalDistance * (columnCount - 1)) / 2 - defaultHorizontalPadding;
|
|
535
539
|
let rowNum = -1;
|
|
536
540
|
let colNum = 0;
|
|
537
|
-
|
|
541
|
+
alternatives.forEach((alt, index) => {
|
|
538
542
|
let left = 0;
|
|
539
543
|
let top = 0;
|
|
540
544
|
if (question.AlternativeAutoArrange) {
|
|
@@ -565,7 +569,7 @@ class AlternativesContainerDirective {
|
|
|
565
569
|
});
|
|
566
570
|
}
|
|
567
571
|
else {
|
|
568
|
-
|
|
572
|
+
alternatives.forEach((alt) => {
|
|
569
573
|
this._renderer.setStyle(alt.nativeElement, 'width', ``);
|
|
570
574
|
this._renderer.setStyle(alt.nativeElement, 'height', ``);
|
|
571
575
|
this._renderer.setStyle(alt.nativeElement, 'left', ``);
|
|
@@ -574,7 +578,7 @@ class AlternativesContainerDirective {
|
|
|
574
578
|
}
|
|
575
579
|
}
|
|
576
580
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.7", ngImport: i0, type: AlternativesContainerDirective, deps: [{ token: i0.Renderer2 }, { token: i0.ElementRef }, { token: i1$1.BreakpointObserver }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
577
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.1.7", type: AlternativesContainerDirective, isStandalone: true, selector: "[tpSurveyAlternativesContainer]", inputs: { question: { classPropertyName: "question", publicName: "tpSurveyAlternativesContainer", isSignal: true, isRequired: true, transformFunction: null }, viewModel: { classPropertyName: "viewModel", publicName: "containerViewModel", isSignal: true, isRequired: true, transformFunction: null } }, queries: [{ propertyName: "
|
|
581
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.1.7", type: AlternativesContainerDirective, isStandalone: true, selector: "[tpSurveyAlternativesContainer]", inputs: { question: { classPropertyName: "question", publicName: "tpSurveyAlternativesContainer", isSignal: true, isRequired: true, transformFunction: null }, viewModel: { classPropertyName: "viewModel", publicName: "containerViewModel", isSignal: true, isRequired: true, transformFunction: null } }, queries: [{ propertyName: "alternativesTemplates", predicate: ["tablet_alt"], read: ElementRef }], ngImport: i0 }); }
|
|
578
582
|
}
|
|
579
583
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.7", ngImport: i0, type: AlternativesContainerDirective, decorators: [{
|
|
580
584
|
type: Directive,
|
|
@@ -582,9 +586,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.7", ngImpor
|
|
|
582
586
|
selector: '[tpSurveyAlternativesContainer]',
|
|
583
587
|
standalone: true
|
|
584
588
|
}]
|
|
585
|
-
}], ctorParameters: () => [{ type: i0.Renderer2 }, { type: i0.ElementRef }, { type: i1$1.BreakpointObserver }], propDecorators: {
|
|
589
|
+
}], ctorParameters: () => [{ type: i0.Renderer2 }, { type: i0.ElementRef }, { type: i1$1.BreakpointObserver }], propDecorators: { alternativesTemplates: [{
|
|
586
590
|
type: ContentChildren,
|
|
587
|
-
args: ['tablet_alt', { read: ElementRef }]
|
|
591
|
+
args: ['tablet_alt', { read: ElementRef, }]
|
|
588
592
|
}] } });
|
|
589
593
|
|
|
590
594
|
class GetQuestionImageBackgroundCssSizePipe {
|
|
@@ -1478,7 +1482,7 @@ class ContainerAnswerComponent {
|
|
|
1478
1482
|
this.logicChanged.emit(this.#getLogicVars());
|
|
1479
1483
|
}
|
|
1480
1484
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.7", ngImport: i0, type: ContainerAnswerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1481
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.1.7", type: ContainerAnswerComponent, isStandalone: true, selector: "tp-survey-container-answer", inputs: { findVariable: { classPropertyName: "findVariable", publicName: "findVariable", isSignal: true, isRequired: true, transformFunction: null }, question: { classPropertyName: "question", publicName: "question", isSignal: true, isRequired: true, transformFunction: null }, language: { classPropertyName: "language", publicName: "language", isSignal: true, isRequired: true, transformFunction: null }, viewModel: { classPropertyName: "viewModel", publicName: "viewModel", isSignal: true, isRequired: true, transformFunction: null }, answers: { classPropertyName: "answers", publicName: "answers", isSignal: true, isRequired: false, transformFunction: null }, developerMode: { classPropertyName: "developerMode", publicName: "developerMode", isSignal: true, isRequired: false, transformFunction: null }, languageList: { classPropertyName: "languageList", publicName: "languageList", isSignal: true, isRequired: true, transformFunction: null }, repositoryPath: { classPropertyName: "repositoryPath", publicName: "repositoryPath", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { logicChanged: "logicChanged", answerChanged: "answerChanged", onLanguageChange: "onLanguageChange" }, ngImport: i0, template: "<div class=\"container-main\" [formGroup]=\"answerForm\">\r\n @switch (question().QuestionType) {\r\n\r\n @case (questionsType.eqLANG) {\r\n <tp-survey-answer-lang\r\n [languageList]=\"languageList()\"\r\n [findVariable]=\"findVariable()\"\r\n [repositoryPath]=\"repositoryPath()\"\r\n [language]=\"2\"\r\n [viewModel]=\"viewModel()\"\r\n (onLanguageChange)=\"onLanguageChange.emit($event)\"/>\r\n }\r\n\r\n @case (questionsType.eqINFO) {\r\n <tp-survey-answer-info\r\n formControlName=\"answer\"\r\n [repositoryPath]=\"repositoryPath()\"\r\n [findVariable]=\"findVariable()\"\r\n [language]=\"language()\"\r\n [viewModel]=\"viewModel()\"/>\r\n }\r\n\r\n @case (questionsType.eqSS) {\r\n <tp-survey-answer-ss\r\n formControlName=\"answer\"\r\n [question]=\"question()\"\r\n [language]=\"language()\"\r\n [viewModel]=\"viewModel()\"\r\n [findVariable]=\"findVariable()\"\r\n [repositoryPath]=\"repositoryPath()\"\r\n [alternativeList]=\"visibleAlternativeList()\"\r\n (onAlternativeClick)=\"onAlternativeClick($event)\"\r\n />\r\n }\r\n\r\n @case (questionsType.eqMS) {\r\n <tp-survey-answer-ms\r\n formControlName=\"answer\"\r\n [question]=\"question()\"\r\n [language]=\"language()\"\r\n [viewModel]=\"viewModel()\"\r\n [findVariable]=\"findVariable()\"\r\n [repositoryPath]=\"repositoryPath()\"\r\n [alternativeMaxAnswersCount]=\"question().AlternativeMaxAnswersCount\"\r\n [alternativeList]=\"visibleAlternativeList()\"\r\n (onAlternativeClick)=\"onAlternativeClick($event)\"/>\r\n }\r\n\r\n @case (questionsType.eqOD) {\r\n <tp-survey-answer-od\r\n formControlName=\"answer\"\r\n [language]=\"language()\"\r\n [viewModel]=\"viewModel()\"\r\n [findVariable]=\"findVariable()\"\r\n [repositoryPath]=\"repositoryPath()\"\r\n [minValue]=\"question().ODMinValue\"\r\n [maxValue]=\"question().ODMaxValue\"\r\n />\r\n }\r\n\r\n @case (questionsType.eqOL) {\r\n <tp-survey-answer-ol\r\n formControlName=\"answer\"\r\n [language]=\"language()\"\r\n [viewModel]=\"viewModel()\"\r\n [repositoryPath]=\"repositoryPath()\"\r\n [findVariable]=\"findVariable()\"\r\n [telephoneInput]=\"question().OLTypeTel\"\r\n [canSkip]=\"question().CanSkip\"/>\r\n }\r\n\r\n @case (questionsType.eqSL) {\r\n <tp-survey-answer-sl\r\n formControlName=\"answer\"\r\n [question]=\"question()\"\r\n [alternativeList]=\"visibleAlternativeList()\"\r\n [sectionList]=\"visibleSectionList()\"\r\n [multiSelect]=\"question().MultiSelect\"\r\n [language]=\"language()\"\r\n [viewModel]=\"viewModel()\"\r\n [repositoryPath]=\"repositoryPath()\"\r\n [findVariable]=\"findVariable()\"\r\n [maxCount]=\"this.question().SLSectionMaxAnswersCount\"\r\n />\r\n }\r\n\r\n @case (questionsType.eqEND) {\r\n <tp-survey-answer-end\r\n formControlName=\"answer\"\r\n [findVariable]=\"findVariable()\"\r\n [repositoryPath]=\"repositoryPath()\"\r\n [language]=\"language()\"\r\n [viewModel]=\"viewModel()\"\r\n />\r\n }\r\n }\r\n\r\n <div class=\"container-additional-answer\">\r\n @for (addAnswer of answerForm.controls.additionalAnswers.controls | keyValues; track addAnswer) {\r\n @if (addAnswer.name | getAdditionalValueByValue:visibleAdditionalAnswerList(); as additionalAnswerObject ) {\r\n <tp-survey-answer-additional\r\n [control]=\"addAnswer.control\"\r\n [class.full-width]=\"additionalAnswerObject.AnswerType===AdditionalAnswerType.aatText\"\r\n [answerType]=\"additionalAnswerObject.AnswerType\"\r\n [caption]=\"additionalAnswerObject.MultiLangCaptions | multiLangObjectToHtml:language()\"\r\n [numberMinValue]=\"additionalAnswerObject.NumberMinValue\"\r\n [numberMaxValue]=\"additionalAnswerObject.NumberMaxValue\"\r\n [textMultiline]=\"additionalAnswerObject.TextMultiline\"\r\n [captionPosition]=\"additionalAnswerObject.CaptionPosition\"/>\r\n }\r\n }\r\n </div>\r\n</div>\r\n\r\n", styles: [".container-main{display:flex;flex-flow:column;align-items:center}tp-survey-answer-sl{width:100%}.full-width{width:100%}:host-context(.tp-view-desktop) .container-main{margin:0 auto;padding:0 1em}:host-context(.tp-view-desktop) .container-additional-answer{padding:1em;display:flex;flex-flow:column;align-items:baseline;gap:2em}:host-context(.tp-view-tablet) .container-main{width:100%;height:100%;overflow:auto}:host-context(.tp-view-tablet) .container-additional-answer{padding:1em;display:flex;flex-flow:column;align-items:baseline;gap:2em}@media (max-width: 480px){:host-context(.tp-view-desktop) .container-additional-answer{width:100%}}\n"], dependencies: [{ kind: "component", type: AnswerODComponent, selector: "tp-survey-answer-od", inputs: ["minValue", "maxValue"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: AnswerSSComponent, selector: "tp-survey-answer-ss", inputs: ["question", "alternativeList"], outputs: ["onAlternativeClick"] }, { kind: "component", type: AnswerInfoComponent, selector: "tp-survey-answer-info" }, { kind: "component", type: AnswerMSComponent, selector: "tp-survey-answer-ms", inputs: ["question", "alternativeList", "alternativeMaxAnswersCount"], outputs: ["onAlternativeClick"] }, { kind: "component", type: AnswerAdditionalComponent, selector: "tp-survey-answer-additional", inputs: ["control", "answerType", "caption", "numberMinValue", "numberMaxValue", "textMultiline", "captionPosition"] }, { kind: "pipe", type: MultiLangObjectToHtmlPipe, name: "multiLangObjectToHtml" }, { kind: "component", type: AnswerEndComponent, selector: "tp-survey-answer-end" }, { kind: "component", type: AnswerOLComponent, selector: "tp-survey-answer-ol", inputs: ["telephoneInput", "canSkip"] }, { kind: "component", type: AnswerSLComponent, selector: "tp-survey-answer-sl", inputs: ["question", "alternativeList", "sectionList", "multiSelect", "maxCount"] }, { kind: "pipe", type: GetAdditionalValueByValuePipe, name: "getAdditionalValueByValue" }, { kind: "pipe", type: KeyValuesPipe, name: "keyValues" }, { kind: "component", type: AnswerLangComponent, selector: "tp-survey-answer-lang", inputs: ["languageList"], outputs: ["onLanguageChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1485
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.1.7", type: ContainerAnswerComponent, isStandalone: true, selector: "tp-survey-container-answer", inputs: { findVariable: { classPropertyName: "findVariable", publicName: "findVariable", isSignal: true, isRequired: true, transformFunction: null }, question: { classPropertyName: "question", publicName: "question", isSignal: true, isRequired: true, transformFunction: null }, language: { classPropertyName: "language", publicName: "language", isSignal: true, isRequired: true, transformFunction: null }, viewModel: { classPropertyName: "viewModel", publicName: "viewModel", isSignal: true, isRequired: true, transformFunction: null }, answers: { classPropertyName: "answers", publicName: "answers", isSignal: true, isRequired: false, transformFunction: null }, developerMode: { classPropertyName: "developerMode", publicName: "developerMode", isSignal: true, isRequired: false, transformFunction: null }, languageList: { classPropertyName: "languageList", publicName: "languageList", isSignal: true, isRequired: true, transformFunction: null }, repositoryPath: { classPropertyName: "repositoryPath", publicName: "repositoryPath", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { logicChanged: "logicChanged", answerChanged: "answerChanged", onLanguageChange: "onLanguageChange" }, ngImport: i0, template: "<div class=\"container-main\" [formGroup]=\"answerForm\">\r\n @switch (question().QuestionType) {\r\n\r\n @case (questionsType.eqLANG) {\r\n <tp-survey-answer-lang\r\n [languageList]=\"languageList()\"\r\n [findVariable]=\"findVariable()\"\r\n [repositoryPath]=\"repositoryPath()\"\r\n [language]=\"2\"\r\n [viewModel]=\"viewModel()\"\r\n (onLanguageChange)=\"onLanguageChange.emit($event)\"/>\r\n }\r\n\r\n @case (questionsType.eqINFO) {\r\n <tp-survey-answer-info\r\n formControlName=\"answer\"\r\n [repositoryPath]=\"repositoryPath()\"\r\n [findVariable]=\"findVariable()\"\r\n [language]=\"language()\"\r\n [viewModel]=\"viewModel()\"/>\r\n }\r\n\r\n @case (questionsType.eqSS) {\r\n <tp-survey-answer-ss\r\n formControlName=\"answer\"\r\n [question]=\"question()\"\r\n [language]=\"language()\"\r\n [viewModel]=\"viewModel()\"\r\n [findVariable]=\"findVariable()\"\r\n [repositoryPath]=\"repositoryPath()\"\r\n [alternativeList]=\"visibleAlternativeList()\"\r\n (onAlternativeClick)=\"onAlternativeClick($event)\"\r\n />\r\n }\r\n\r\n @case (questionsType.eqMS) {\r\n <tp-survey-answer-ms\r\n formControlName=\"answer\"\r\n [question]=\"question()\"\r\n [language]=\"language()\"\r\n [viewModel]=\"viewModel()\"\r\n [findVariable]=\"findVariable()\"\r\n [repositoryPath]=\"repositoryPath()\"\r\n [alternativeMaxAnswersCount]=\"question().AlternativeMaxAnswersCount\"\r\n [alternativeList]=\"visibleAlternativeList()\"\r\n (onAlternativeClick)=\"onAlternativeClick($event)\"/>\r\n }\r\n\r\n @case (questionsType.eqOD) {\r\n <tp-survey-answer-od\r\n formControlName=\"answer\"\r\n [language]=\"language()\"\r\n [viewModel]=\"viewModel()\"\r\n [findVariable]=\"findVariable()\"\r\n [repositoryPath]=\"repositoryPath()\"\r\n [minValue]=\"question().ODMinValue\"\r\n [maxValue]=\"question().ODMaxValue\"\r\n />\r\n }\r\n\r\n @case (questionsType.eqOL) {\r\n <tp-survey-answer-ol\r\n formControlName=\"answer\"\r\n [language]=\"language()\"\r\n [viewModel]=\"viewModel()\"\r\n [repositoryPath]=\"repositoryPath()\"\r\n [findVariable]=\"findVariable()\"\r\n [telephoneInput]=\"question().OLTypeTel\"\r\n [canSkip]=\"question().CanSkip\"/>\r\n }\r\n\r\n @case (questionsType.eqSL) {\r\n <tp-survey-answer-sl\r\n formControlName=\"answer\"\r\n [question]=\"question()\"\r\n [alternativeList]=\"visibleAlternativeList()\"\r\n [sectionList]=\"visibleSectionList()\"\r\n [multiSelect]=\"question().MultiSelect\"\r\n [language]=\"language()\"\r\n [viewModel]=\"viewModel()\"\r\n [repositoryPath]=\"repositoryPath()\"\r\n [findVariable]=\"findVariable()\"\r\n [maxCount]=\"this.question().SLSectionMaxAnswersCount\"\r\n />\r\n }\r\n\r\n @case (questionsType.eqEND) {\r\n <tp-survey-answer-end\r\n formControlName=\"answer\"\r\n [findVariable]=\"findVariable()\"\r\n [repositoryPath]=\"repositoryPath()\"\r\n [language]=\"language()\"\r\n [viewModel]=\"viewModel()\"\r\n />\r\n }\r\n }\r\n\r\n <div class=\"container-additional-answer\">\r\n @for (addAnswer of answerForm.controls.additionalAnswers.controls | keyValues; track addAnswer) {\r\n @if (addAnswer.name | getAdditionalValueByValue:visibleAdditionalAnswerList(); as additionalAnswerObject ) {\r\n <tp-survey-answer-additional\r\n [control]=\"addAnswer.control\"\r\n [class.full-width]=\"additionalAnswerObject.AnswerType===AdditionalAnswerType.aatText\"\r\n [answerType]=\"additionalAnswerObject.AnswerType\"\r\n [caption]=\"additionalAnswerObject.MultiLangCaptions | multiLangObjectToHtml:language()\"\r\n [numberMinValue]=\"additionalAnswerObject.NumberMinValue\"\r\n [numberMaxValue]=\"additionalAnswerObject.NumberMaxValue\"\r\n [textMultiline]=\"additionalAnswerObject.TextMultiline\"\r\n [captionPosition]=\"additionalAnswerObject.CaptionPosition\"/>\r\n }\r\n }\r\n </div>\r\n</div>\r\n\r\n", styles: [".container-main{display:flex;flex-flow:column;align-items:center}tp-survey-answer-sl{width:100%}.full-width{width:100%}:host-context(.tp-view-desktop) .container-main{margin:0 auto;padding:0 1em}:host-context(.tp-view-desktop) .container-additional-answer{padding:1em;display:flex;flex-flow:column;align-items:baseline;gap:2em}:host-context(.tp-view-tablet) .container-main{width:100%;height:100%;overflow:auto}:host-context(.tp-view-tablet) .container-additional-answer{padding:1em;display:flex;flex-flow:column;align-items:baseline;gap:2em}:host-context(.tp-view-tablet) tp-survey-answer-ss,:host-context(.tp-view-tablet) tp-survey-answer-ms{width:100%;height:100%}@media (max-width: 480px){:host-context(.tp-view-desktop) .container-additional-answer{width:100%}}\n"], dependencies: [{ kind: "component", type: AnswerODComponent, selector: "tp-survey-answer-od", inputs: ["minValue", "maxValue"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: AnswerSSComponent, selector: "tp-survey-answer-ss", inputs: ["question", "alternativeList"], outputs: ["onAlternativeClick"] }, { kind: "component", type: AnswerInfoComponent, selector: "tp-survey-answer-info" }, { kind: "component", type: AnswerMSComponent, selector: "tp-survey-answer-ms", inputs: ["question", "alternativeList", "alternativeMaxAnswersCount"], outputs: ["onAlternativeClick"] }, { kind: "component", type: AnswerAdditionalComponent, selector: "tp-survey-answer-additional", inputs: ["control", "answerType", "caption", "numberMinValue", "numberMaxValue", "textMultiline", "captionPosition"] }, { kind: "pipe", type: MultiLangObjectToHtmlPipe, name: "multiLangObjectToHtml" }, { kind: "component", type: AnswerEndComponent, selector: "tp-survey-answer-end" }, { kind: "component", type: AnswerOLComponent, selector: "tp-survey-answer-ol", inputs: ["telephoneInput", "canSkip"] }, { kind: "component", type: AnswerSLComponent, selector: "tp-survey-answer-sl", inputs: ["question", "alternativeList", "sectionList", "multiSelect", "maxCount"] }, { kind: "pipe", type: GetAdditionalValueByValuePipe, name: "getAdditionalValueByValue" }, { kind: "pipe", type: KeyValuesPipe, name: "keyValues" }, { kind: "component", type: AnswerLangComponent, selector: "tp-survey-answer-lang", inputs: ["languageList"], outputs: ["onLanguageChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1482
1486
|
}
|
|
1483
1487
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.7", ngImport: i0, type: ContainerAnswerComponent, decorators: [{
|
|
1484
1488
|
type: Component,
|
|
@@ -1496,7 +1500,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.7", ngImpor
|
|
|
1496
1500
|
GetAdditionalValueByValuePipe,
|
|
1497
1501
|
KeyValuesPipe,
|
|
1498
1502
|
AnswerLangComponent
|
|
1499
|
-
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"container-main\" [formGroup]=\"answerForm\">\r\n @switch (question().QuestionType) {\r\n\r\n @case (questionsType.eqLANG) {\r\n <tp-survey-answer-lang\r\n [languageList]=\"languageList()\"\r\n [findVariable]=\"findVariable()\"\r\n [repositoryPath]=\"repositoryPath()\"\r\n [language]=\"2\"\r\n [viewModel]=\"viewModel()\"\r\n (onLanguageChange)=\"onLanguageChange.emit($event)\"/>\r\n }\r\n\r\n @case (questionsType.eqINFO) {\r\n <tp-survey-answer-info\r\n formControlName=\"answer\"\r\n [repositoryPath]=\"repositoryPath()\"\r\n [findVariable]=\"findVariable()\"\r\n [language]=\"language()\"\r\n [viewModel]=\"viewModel()\"/>\r\n }\r\n\r\n @case (questionsType.eqSS) {\r\n <tp-survey-answer-ss\r\n formControlName=\"answer\"\r\n [question]=\"question()\"\r\n [language]=\"language()\"\r\n [viewModel]=\"viewModel()\"\r\n [findVariable]=\"findVariable()\"\r\n [repositoryPath]=\"repositoryPath()\"\r\n [alternativeList]=\"visibleAlternativeList()\"\r\n (onAlternativeClick)=\"onAlternativeClick($event)\"\r\n />\r\n }\r\n\r\n @case (questionsType.eqMS) {\r\n <tp-survey-answer-ms\r\n formControlName=\"answer\"\r\n [question]=\"question()\"\r\n [language]=\"language()\"\r\n [viewModel]=\"viewModel()\"\r\n [findVariable]=\"findVariable()\"\r\n [repositoryPath]=\"repositoryPath()\"\r\n [alternativeMaxAnswersCount]=\"question().AlternativeMaxAnswersCount\"\r\n [alternativeList]=\"visibleAlternativeList()\"\r\n (onAlternativeClick)=\"onAlternativeClick($event)\"/>\r\n }\r\n\r\n @case (questionsType.eqOD) {\r\n <tp-survey-answer-od\r\n formControlName=\"answer\"\r\n [language]=\"language()\"\r\n [viewModel]=\"viewModel()\"\r\n [findVariable]=\"findVariable()\"\r\n [repositoryPath]=\"repositoryPath()\"\r\n [minValue]=\"question().ODMinValue\"\r\n [maxValue]=\"question().ODMaxValue\"\r\n />\r\n }\r\n\r\n @case (questionsType.eqOL) {\r\n <tp-survey-answer-ol\r\n formControlName=\"answer\"\r\n [language]=\"language()\"\r\n [viewModel]=\"viewModel()\"\r\n [repositoryPath]=\"repositoryPath()\"\r\n [findVariable]=\"findVariable()\"\r\n [telephoneInput]=\"question().OLTypeTel\"\r\n [canSkip]=\"question().CanSkip\"/>\r\n }\r\n\r\n @case (questionsType.eqSL) {\r\n <tp-survey-answer-sl\r\n formControlName=\"answer\"\r\n [question]=\"question()\"\r\n [alternativeList]=\"visibleAlternativeList()\"\r\n [sectionList]=\"visibleSectionList()\"\r\n [multiSelect]=\"question().MultiSelect\"\r\n [language]=\"language()\"\r\n [viewModel]=\"viewModel()\"\r\n [repositoryPath]=\"repositoryPath()\"\r\n [findVariable]=\"findVariable()\"\r\n [maxCount]=\"this.question().SLSectionMaxAnswersCount\"\r\n />\r\n }\r\n\r\n @case (questionsType.eqEND) {\r\n <tp-survey-answer-end\r\n formControlName=\"answer\"\r\n [findVariable]=\"findVariable()\"\r\n [repositoryPath]=\"repositoryPath()\"\r\n [language]=\"language()\"\r\n [viewModel]=\"viewModel()\"\r\n />\r\n }\r\n }\r\n\r\n <div class=\"container-additional-answer\">\r\n @for (addAnswer of answerForm.controls.additionalAnswers.controls | keyValues; track addAnswer) {\r\n @if (addAnswer.name | getAdditionalValueByValue:visibleAdditionalAnswerList(); as additionalAnswerObject ) {\r\n <tp-survey-answer-additional\r\n [control]=\"addAnswer.control\"\r\n [class.full-width]=\"additionalAnswerObject.AnswerType===AdditionalAnswerType.aatText\"\r\n [answerType]=\"additionalAnswerObject.AnswerType\"\r\n [caption]=\"additionalAnswerObject.MultiLangCaptions | multiLangObjectToHtml:language()\"\r\n [numberMinValue]=\"additionalAnswerObject.NumberMinValue\"\r\n [numberMaxValue]=\"additionalAnswerObject.NumberMaxValue\"\r\n [textMultiline]=\"additionalAnswerObject.TextMultiline\"\r\n [captionPosition]=\"additionalAnswerObject.CaptionPosition\"/>\r\n }\r\n }\r\n </div>\r\n</div>\r\n\r\n", styles: [".container-main{display:flex;flex-flow:column;align-items:center}tp-survey-answer-sl{width:100%}.full-width{width:100%}:host-context(.tp-view-desktop) .container-main{margin:0 auto;padding:0 1em}:host-context(.tp-view-desktop) .container-additional-answer{padding:1em;display:flex;flex-flow:column;align-items:baseline;gap:2em}:host-context(.tp-view-tablet) .container-main{width:100%;height:100%;overflow:auto}:host-context(.tp-view-tablet) .container-additional-answer{padding:1em;display:flex;flex-flow:column;align-items:baseline;gap:2em}@media (max-width: 480px){:host-context(.tp-view-desktop) .container-additional-answer{width:100%}}\n"] }]
|
|
1503
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"container-main\" [formGroup]=\"answerForm\">\r\n @switch (question().QuestionType) {\r\n\r\n @case (questionsType.eqLANG) {\r\n <tp-survey-answer-lang\r\n [languageList]=\"languageList()\"\r\n [findVariable]=\"findVariable()\"\r\n [repositoryPath]=\"repositoryPath()\"\r\n [language]=\"2\"\r\n [viewModel]=\"viewModel()\"\r\n (onLanguageChange)=\"onLanguageChange.emit($event)\"/>\r\n }\r\n\r\n @case (questionsType.eqINFO) {\r\n <tp-survey-answer-info\r\n formControlName=\"answer\"\r\n [repositoryPath]=\"repositoryPath()\"\r\n [findVariable]=\"findVariable()\"\r\n [language]=\"language()\"\r\n [viewModel]=\"viewModel()\"/>\r\n }\r\n\r\n @case (questionsType.eqSS) {\r\n <tp-survey-answer-ss\r\n formControlName=\"answer\"\r\n [question]=\"question()\"\r\n [language]=\"language()\"\r\n [viewModel]=\"viewModel()\"\r\n [findVariable]=\"findVariable()\"\r\n [repositoryPath]=\"repositoryPath()\"\r\n [alternativeList]=\"visibleAlternativeList()\"\r\n (onAlternativeClick)=\"onAlternativeClick($event)\"\r\n />\r\n }\r\n\r\n @case (questionsType.eqMS) {\r\n <tp-survey-answer-ms\r\n formControlName=\"answer\"\r\n [question]=\"question()\"\r\n [language]=\"language()\"\r\n [viewModel]=\"viewModel()\"\r\n [findVariable]=\"findVariable()\"\r\n [repositoryPath]=\"repositoryPath()\"\r\n [alternativeMaxAnswersCount]=\"question().AlternativeMaxAnswersCount\"\r\n [alternativeList]=\"visibleAlternativeList()\"\r\n (onAlternativeClick)=\"onAlternativeClick($event)\"/>\r\n }\r\n\r\n @case (questionsType.eqOD) {\r\n <tp-survey-answer-od\r\n formControlName=\"answer\"\r\n [language]=\"language()\"\r\n [viewModel]=\"viewModel()\"\r\n [findVariable]=\"findVariable()\"\r\n [repositoryPath]=\"repositoryPath()\"\r\n [minValue]=\"question().ODMinValue\"\r\n [maxValue]=\"question().ODMaxValue\"\r\n />\r\n }\r\n\r\n @case (questionsType.eqOL) {\r\n <tp-survey-answer-ol\r\n formControlName=\"answer\"\r\n [language]=\"language()\"\r\n [viewModel]=\"viewModel()\"\r\n [repositoryPath]=\"repositoryPath()\"\r\n [findVariable]=\"findVariable()\"\r\n [telephoneInput]=\"question().OLTypeTel\"\r\n [canSkip]=\"question().CanSkip\"/>\r\n }\r\n\r\n @case (questionsType.eqSL) {\r\n <tp-survey-answer-sl\r\n formControlName=\"answer\"\r\n [question]=\"question()\"\r\n [alternativeList]=\"visibleAlternativeList()\"\r\n [sectionList]=\"visibleSectionList()\"\r\n [multiSelect]=\"question().MultiSelect\"\r\n [language]=\"language()\"\r\n [viewModel]=\"viewModel()\"\r\n [repositoryPath]=\"repositoryPath()\"\r\n [findVariable]=\"findVariable()\"\r\n [maxCount]=\"this.question().SLSectionMaxAnswersCount\"\r\n />\r\n }\r\n\r\n @case (questionsType.eqEND) {\r\n <tp-survey-answer-end\r\n formControlName=\"answer\"\r\n [findVariable]=\"findVariable()\"\r\n [repositoryPath]=\"repositoryPath()\"\r\n [language]=\"language()\"\r\n [viewModel]=\"viewModel()\"\r\n />\r\n }\r\n }\r\n\r\n <div class=\"container-additional-answer\">\r\n @for (addAnswer of answerForm.controls.additionalAnswers.controls | keyValues; track addAnswer) {\r\n @if (addAnswer.name | getAdditionalValueByValue:visibleAdditionalAnswerList(); as additionalAnswerObject ) {\r\n <tp-survey-answer-additional\r\n [control]=\"addAnswer.control\"\r\n [class.full-width]=\"additionalAnswerObject.AnswerType===AdditionalAnswerType.aatText\"\r\n [answerType]=\"additionalAnswerObject.AnswerType\"\r\n [caption]=\"additionalAnswerObject.MultiLangCaptions | multiLangObjectToHtml:language()\"\r\n [numberMinValue]=\"additionalAnswerObject.NumberMinValue\"\r\n [numberMaxValue]=\"additionalAnswerObject.NumberMaxValue\"\r\n [textMultiline]=\"additionalAnswerObject.TextMultiline\"\r\n [captionPosition]=\"additionalAnswerObject.CaptionPosition\"/>\r\n }\r\n }\r\n </div>\r\n</div>\r\n\r\n", styles: [".container-main{display:flex;flex-flow:column;align-items:center}tp-survey-answer-sl{width:100%}.full-width{width:100%}:host-context(.tp-view-desktop) .container-main{margin:0 auto;padding:0 1em}:host-context(.tp-view-desktop) .container-additional-answer{padding:1em;display:flex;flex-flow:column;align-items:baseline;gap:2em}:host-context(.tp-view-tablet) .container-main{width:100%;height:100%;overflow:auto}:host-context(.tp-view-tablet) .container-additional-answer{padding:1em;display:flex;flex-flow:column;align-items:baseline;gap:2em}:host-context(.tp-view-tablet) tp-survey-answer-ss,:host-context(.tp-view-tablet) tp-survey-answer-ms{width:100%;height:100%}@media (max-width: 480px){:host-context(.tp-view-desktop) .container-additional-answer{width:100%}}\n"] }]
|
|
1500
1504
|
}], ctorParameters: () => [] });
|
|
1501
1505
|
|
|
1502
1506
|
class GetActiveLanguagePipe {
|