Skip to content
Snippets Groups Projects
Commit 8780cdcb authored by jojohoch's avatar jojohoch
Browse files

Start valid range of elements with list values at 0

parent 8fc2f3d7
No related branches found
No related tags found
No related merge requests found
...@@ -23,7 +23,7 @@ import { DropdownElement } from '../../interfaces/elements'; ...@@ -23,7 +23,7 @@ import { DropdownElement } from '../../interfaces/elements';
[style.pointer-events]="elementModel.readOnly ? 'none' : 'unset'" [style.pointer-events]="elementModel.readOnly ? 'none' : 'unset'"
(click)="$event.preventDefault()"> (click)="$event.preventDefault()">
</mat-option> </mat-option>
<mat-option *ngFor="let option of elementModel.options; let i = index" [value]="i + 1" <mat-option *ngFor="let option of elementModel.options; let i = index" [value]="i"
[style.pointer-events]="elementModel.readOnly ? 'none' : 'unset'"> [style.pointer-events]="elementModel.readOnly ? 'none' : 'unset'">
{{option}} {{option}}
</mat-option> </mat-option>
......
...@@ -19,7 +19,7 @@ import { LikertRowElement } from '../../interfaces/elements'; ...@@ -19,7 +19,7 @@ import { LikertRowElement } from '../../interfaces/elements';
<mat-radio-button *ngFor="let column of [].constructor(elementModel.columnCount); let j = index" <mat-radio-button *ngFor="let column of [].constructor(elementModel.columnCount); let j = index"
[style.pointer-events]="elementModel.readOnly ? 'none' : 'unset'" [style.pointer-events]="elementModel.readOnly ? 'none' : 'unset'"
[value]="j + 1" [value]="j"
[style.grid-column-start]="2 + j" [style.grid-column-start]="2 + j"
[style.grid-column-end]="3 + j" [style.grid-column-end]="3 + j"
[style.grid-row-start]="1" [style.grid-row-start]="1"
......
...@@ -26,8 +26,8 @@ import { RadioButtonGroupElement } from '../../interfaces/elements'; ...@@ -26,8 +26,8 @@ import { RadioButtonGroupElement } from '../../interfaces/elements';
<mat-radio-button *ngFor="let option of elementModel.options; let i = index" <mat-radio-button *ngFor="let option of elementModel.options; let i = index"
[ngClass]="{ 'strike' : elementModel.strikeOtherOptions && [ngClass]="{ 'strike' : elementModel.strikeOtherOptions &&
elementFormControl.value !== null && elementFormControl.value !== null &&
elementFormControl.value !== i + 1 }" elementFormControl.value !== i }"
[value]="i + 1" [value]="i"
[style.pointer-events]="elementModel.readOnly ? 'none' : 'unset'" [style.pointer-events]="elementModel.readOnly ? 'none' : 'unset'"
[style.line-height.%]="elementModel.styles.lineHeight"> [style.line-height.%]="elementModel.styles.lineHeight">
{{option}} {{option}}
......
...@@ -29,7 +29,7 @@ import { RadioButtonGroupComplexElement } from '../../interfaces/elements'; ...@@ -29,7 +29,7 @@ import { RadioButtonGroupComplexElement } from '../../interfaces/elements';
[style.grid-column-end]="2 + i" [style.grid-column-end]="2 + i"
[style.grid-row-start]="2" [style.grid-row-start]="2"
[style.grid-row-end]="3" [style.grid-row-end]="3"
(click)="selectOption(i + 1)"> (click)="selectOption(i)">
<img *ngIf="option.imgSrc && option.position === 'above'" <img *ngIf="option.imgSrc && option.position === 'above'"
[style.object-fit]="'scale-down'" [style.object-fit]="'scale-down'"
[style.max-width.%]="100" [style.max-width.%]="100"
...@@ -52,7 +52,7 @@ import { RadioButtonGroupComplexElement } from '../../interfaces/elements'; ...@@ -52,7 +52,7 @@ import { RadioButtonGroupComplexElement } from '../../interfaces/elements';
<mat-radio-button *ngFor="let option of elementModel.columns; let i = index" <mat-radio-button *ngFor="let option of elementModel.columns; let i = index"
aria-labelledby="radio-group-label" aria-labelledby="radio-group-label"
[style.pointer-events]="elementModel.readOnly ? 'none' : 'unset'" [style.pointer-events]="elementModel.readOnly ? 'none' : 'unset'"
[value]="i + 1" [value]="i"
[style.grid-column-start]="1 + i" [style.grid-column-start]="1 + i"
[style.grid-column-end]="2 + i" [style.grid-column-end]="2 + i"
[style.grid-row-start]="1" [style.grid-row-start]="1"
......
...@@ -12,10 +12,10 @@ import { ToggleButtonElement } from '../../interfaces/elements'; ...@@ -12,10 +12,10 @@ import { ToggleButtonElement } from '../../interfaces/elements';
[style.width]="elementModel.dynamicWidth ? 'unset' : elementModel.width+'px'" [style.width]="elementModel.dynamicWidth ? 'unset' : elementModel.width+'px'"
[vertical]="elementModel.verticalOrientation"> [vertical]="elementModel.verticalOrientation">
<mat-button-toggle *ngFor="let option of elementModel.options; let i = index" <mat-button-toggle *ngFor="let option of elementModel.options; let i = index"
[value]="i + 1" [value]="i"
[ngClass]="{ 'strike' : elementModel.strikeOtherOptions && [ngClass]="{ 'strike' : elementModel.strikeOtherOptions &&
elementFormControl.value !== null && elementFormControl.value !== null &&
elementFormControl.value !== i + 1 }" elementFormControl.value !== i }"
[style.color]="elementModel.styles.fontColor" [style.color]="elementModel.styles.fontColor"
[style.font-size.px]="elementModel.styles.fontSize" [style.font-size.px]="elementModel.styles.fontSize"
[style.font-weight]="elementModel.styles.bold ? 'bold' : ''" [style.font-weight]="elementModel.styles.bold ? 'bold' : ''"
...@@ -23,7 +23,7 @@ import { ToggleButtonElement } from '../../interfaces/elements'; ...@@ -23,7 +23,7 @@ import { ToggleButtonElement } from '../../interfaces/elements';
[style.text-decoration]="elementModel.styles.underline ? 'underline' : ''" [style.text-decoration]="elementModel.styles.underline ? 'underline' : ''"
[style.font-family]="elementModel.styles.font" [style.font-family]="elementModel.styles.font"
[style.background-color]="elementFormControl.value !== null && [style.background-color]="elementFormControl.value !== null &&
elementFormControl.value === i + 1 ? elementFormControl.value === i ?
elementModel.selectionColor : elementModel.selectionColor :
elementModel.styles.backgroundColor" elementModel.styles.backgroundColor"
[style.line-height.%]="elementModel.styles.lineHeight"> [style.line-height.%]="elementModel.styles.lineHeight">
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment