Skip to content
Snippets Groups Projects
Commit f86f5511 authored by rhenck's avatar rhenck
Browse files

Improve element defaults and add text for empty likert

parent 1c194303
No related branches found
No related tags found
No related merge requests found
......@@ -15,7 +15,7 @@ export abstract class UIElement {
type!: UIElementType;
id: string = 'id_placeholder';
width: number = 180;
width: number = 190;
height: number = 60;
positionProps?: PositionProperties;
......
......@@ -23,6 +23,8 @@ export class CheckboxElement extends InputElement implements PositionedElement,
this.value = serializedElement.value as boolean || false; // booleans are always initialized false
this.width = serializedElement.width || 215;
this.surfaceProps.backgroundColor =
serializedElement.surfaceProps?.backgroundColor as string ||
serializedElement.backgroundColor as string ||
......
......@@ -24,6 +24,7 @@ export class DropdownElement extends InputElement implements PositionedElement,
this.fontProps = initFontElement(serializedElement);
this.surfaceProps = initSurfaceElement(serializedElement);
this.width = serializedElement.width || 240;
this.height = serializedElement.height || 83;
}
}
......@@ -9,6 +9,9 @@ import { CompoundElementComponent } from '../../directives/compound-element.dire
@Component({
selector: 'app-likert',
template: `
<div *ngIf="elementModel.rows.length === 0 && elementModel.columns.length === 0">
Keine Zeilen oder Spalten vorhanden
</div>
<div [class.center-content]="elementModel.positionProps.dynamicPositioning &&
elementModel.positionProps.fixedSize"
[style.width]="elementModel.positionProps.fixedSize ? elementModel.width + 'px' : '100%'"
......
......@@ -28,6 +28,7 @@ export class TextAreaElement extends InputElement implements PositionedElement,
this.surfaceProps = initSurfaceElement(serializedElement);
this.height = serializedElement.height || 132;
this.width = serializedElement.width || 230;
this.surfaceProps.backgroundColor =
serializedElement.surfaceProps?.backgroundColor as string ||
serializedElement.backgroundColor as string ||
......
......@@ -33,6 +33,7 @@ export class TextFieldElement extends InputElement implements PositionedElement,
this.surfaceProps = initSurfaceElement(serializedElement);
this.height = serializedElement.height || 100;
this.width = serializedElement.width || 230;
this.surfaceProps.backgroundColor =
serializedElement.surfaceProps?.backgroundColor as string ||
serializedElement.backgroundColor as string ||
......
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