@touchpoll/tp-survey 0.0.48 → 0.0.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.
|
@@ -546,7 +546,6 @@ class AlternativesContainerDirective {
|
|
|
546
546
|
const deltaHorizontal = (containerWidthFull - width * columnCount - horizontalDistance * (columnCount - 1)) / 2 - defaultHorizontalPadding;
|
|
547
547
|
let rowNum = -1;
|
|
548
548
|
let colNum = 0;
|
|
549
|
-
console.log(containerHeightFull, height * rowCount, verticalDistance, (rowCount - 1));
|
|
550
549
|
alternatives.forEach((alt, index) => {
|
|
551
550
|
let left = 0;
|
|
552
551
|
let top = 0;
|
|
@@ -954,7 +953,7 @@ class AnswerOLComponent extends AnswerMasterComponent {
|
|
|
954
953
|
useExisting: forwardRef(() => AnswerOLComponent),
|
|
955
954
|
multi: true
|
|
956
955
|
},
|
|
957
|
-
], usesInheritance: true, ngImport: i0, template: "<div class=\"container-main\">\r\n @if (telephoneInput()) {\r\n <mat-form-field appearance=\"outline\">\r\n <input\r\n type=\"text\"\r\n inputmode=\"numeric\"\r\n matInput\r\n [formControl]=\"control\" tpSurveyFocusAndSelect>\r\n <span matTextPrefix>+380 </span>\r\n </mat-form-field>\r\n @if(canSkip()) {\r\n <button mat-button (click)=\"skipClick()\">\u041F\u0440\u043E\u043F\u0443\u0441\u0442\u0438\u0442\u0438</button>\r\n }\r\n\r\n } @else {\r\n <mat-form-field appearance=\"outline\" class=\"input-text\">\r\n <textarea rows=\"10\" matInput [formControl]=\"control\" tpSurveyFocusAndSelect></textarea>\r\n </mat-form-field>\r\n
|
|
956
|
+
], usesInheritance: true, ngImport: i0, template: "<div class=\"container-main\">\r\n @if (telephoneInput()) {\r\n <mat-form-field appearance=\"outline\">\r\n <input\r\n type=\"text\"\r\n inputmode=\"numeric\"\r\n matInput\r\n [formControl]=\"control\" tpSurveyFocusAndSelect>\r\n <span matTextPrefix>+380 </span>\r\n </mat-form-field>\r\n @if(canSkip()) {\r\n <button mat-button (click)=\"skipClick()\">\u041F\u0440\u043E\u043F\u0443\u0441\u0442\u0438\u0442\u0438</button>\r\n }\r\n\r\n } @else {\r\n <mat-form-field appearance=\"outline\" class=\"input-text\">\r\n <textarea rows=\"10\" matInput [formControl]=\"control\" tpSurveyFocusAndSelect></textarea>\r\n </mat-form-field>\r\n }\r\n</div>\r\n", styles: [":host{width:100%}.container-main{display:flex;width:100%;justify-content:center;align-items:center;flex-flow:column;gap:2em;padding:0 2em;box-sizing:border-box}.input-text{width:100%}\n"], dependencies: [{ kind: "directive", type: FocusAndSelectDirective, selector: "[tpSurveyFocusAndSelect]" }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$2.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: i1$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "component", type: MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: MatPrefix, selector: "[matPrefix], [matIconPrefix], [matTextPrefix]", inputs: ["matTextPrefix"] }, { kind: "component", type: MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }] }); }
|
|
958
957
|
}
|
|
959
958
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.7", ngImport: i0, type: AnswerOLComponent, decorators: [{
|
|
960
959
|
type: Component,
|
|
@@ -972,7 +971,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.7", ngImpor
|
|
|
972
971
|
useExisting: forwardRef(() => AnswerOLComponent),
|
|
973
972
|
multi: true
|
|
974
973
|
},
|
|
975
|
-
], template: "<div class=\"container-main\">\r\n @if (telephoneInput()) {\r\n <mat-form-field appearance=\"outline\">\r\n <input\r\n type=\"text\"\r\n inputmode=\"numeric\"\r\n matInput\r\n [formControl]=\"control\" tpSurveyFocusAndSelect>\r\n <span matTextPrefix>+380 </span>\r\n </mat-form-field>\r\n @if(canSkip()) {\r\n <button mat-button (click)=\"skipClick()\">\u041F\u0440\u043E\u043F\u0443\u0441\u0442\u0438\u0442\u0438</button>\r\n }\r\n\r\n } @else {\r\n <mat-form-field appearance=\"outline\" class=\"input-text\">\r\n <textarea rows=\"10\" matInput [formControl]=\"control\" tpSurveyFocusAndSelect></textarea>\r\n </mat-form-field>\r\n
|
|
974
|
+
], template: "<div class=\"container-main\">\r\n @if (telephoneInput()) {\r\n <mat-form-field appearance=\"outline\">\r\n <input\r\n type=\"text\"\r\n inputmode=\"numeric\"\r\n matInput\r\n [formControl]=\"control\" tpSurveyFocusAndSelect>\r\n <span matTextPrefix>+380 </span>\r\n </mat-form-field>\r\n @if(canSkip()) {\r\n <button mat-button (click)=\"skipClick()\">\u041F\u0440\u043E\u043F\u0443\u0441\u0442\u0438\u0442\u0438</button>\r\n }\r\n\r\n } @else {\r\n <mat-form-field appearance=\"outline\" class=\"input-text\">\r\n <textarea rows=\"10\" matInput [formControl]=\"control\" tpSurveyFocusAndSelect></textarea>\r\n </mat-form-field>\r\n }\r\n</div>\r\n", styles: [":host{width:100%}.container-main{display:flex;width:100%;justify-content:center;align-items:center;flex-flow:column;gap:2em;padding:0 2em;box-sizing:border-box}.input-text{width:100%}\n"] }]
|
|
976
975
|
}] });
|
|
977
976
|
|
|
978
977
|
class AsFormArrayPipe {
|
|
@@ -1813,8 +1812,8 @@ class TpSurveyCoreService {
|
|
|
1813
1812
|
if (!currentQuestion) {
|
|
1814
1813
|
return;
|
|
1815
1814
|
}
|
|
1816
|
-
//если ответ на текущий вопрос не
|
|
1817
|
-
if (!this._interview.questionIsComplete(currentQuestion.QuestionGuid)) {
|
|
1815
|
+
//если ответ на текущий вопрос не закончен И опция пропуска вопроса не активна, выходим
|
|
1816
|
+
if (!this._interview.questionIsComplete(currentQuestion.QuestionGuid) && !currentQuestion.CanSkip) {
|
|
1818
1817
|
return;
|
|
1819
1818
|
}
|
|
1820
1819
|
//если указан PostScript, выполним его
|
|
@@ -2475,7 +2474,9 @@ class SurveyPlayComponent {
|
|
|
2475
2474
|
* кнопка далее нужно проверять при показе вопроса и при изменении ответа. При показе она может быть доступна сразу(например info).
|
|
2476
2475
|
* Кнопка доступна если ответ корректно заполнен(questionIsComplete) и это не eqEND вопрос
|
|
2477
2476
|
* */
|
|
2478
|
-
this.nextButtonAvailable = toSignal(merge(this.#core.on(SurveyEvents.seQuestionAnswersChange).pipe(map(data => data.question)), this.#core.on(SurveyEvents.seQuestionShow).pipe(map(data => data))).pipe(
|
|
2477
|
+
this.nextButtonAvailable = toSignal(merge(this.#core.on(SurveyEvents.seQuestionAnswersChange).pipe(map(data => data.question)), this.#core.on(SurveyEvents.seQuestionShow).pipe(map(data => data))).pipe(
|
|
2478
|
+
//вопрос должен быть не eqEND и не eqLANG(для них кнопки далее быть не должно) + вопрос должен быть заполнен или его можно пропустить(указано в настройках)
|
|
2479
|
+
map(question => !([QuestionsType.eqEND, QuestionsType.eqLANG].includes(question.QuestionType)) && (this.#core.questionIsComplete(question.QuestionGuid) || question.CanSkip)), delay(1)), { initialValue: false });
|
|
2479
2480
|
//кнопку Назад можно показывать если в настройках указали ShowBtnBack и это не eqEND вопрос
|
|
2480
2481
|
this.backButtonAvailable = toSignal(this.#core.on(SurveyEvents.seQuestionShow).pipe(filter(question => !!question), map((question) => question.QuestionNum > 1 && question.ShowBtnBack && question.QuestionType !== QuestionsType.eqEND && question.QuestionType !== QuestionsType.eqLANG), delay(1)));
|
|
2481
2482
|
this.#core.on(SurveyEvents.seSurveyEnd).pipe(takeUntilDestroyed(this.#destroyRef)).subscribe({
|