Skip to content
Snippets Groups Projects
radio-button-group-element.ts 1.05 KiB
Newer Older
import { InputElement, UIElement } from './uI-element';
rhenck's avatar
rhenck committed
import { FontElement, SurfaceUIElement } from '../interfaces/UIElementInterfaces';
import { initFontElement, initSurfaceElement } from '../util/unit-interface-initializer';
rhenck's avatar
rhenck committed

export class RadioButtonGroupElement extends InputElement implements FontElement, SurfaceUIElement {
  options: string[] = [];
  alignment: 'vertical' | 'horizontal' = 'vertical';
  strikeOtherOptions: boolean = false;
rhenck's avatar
rhenck committed

  fontColor: string = 'black';
  font: string = 'Roboto';
  fontSize: number = 18;
  lineHeight: number = 120;
rhenck's avatar
rhenck committed
  bold: boolean = false;
  italic: boolean = false;
  underline: boolean = false;

  backgroundColor: string = 'transparent';

  constructor(serializedElement: UIElement) {
    super(serializedElement);
rhenck's avatar
rhenck committed
    Object.assign(this, serializedElement);
    Object.assign(this, initFontElement(serializedElement));
    Object.assign(this, initSurfaceElement(serializedElement));
rhenck's avatar
rhenck committed

    this.height = serializedElement.height || 85;
    this.backgroundColor = serializedElement.backgroundColor as string || 'transparent';
rhenck's avatar
rhenck committed
  }
}