Skip to content
Snippets Groups Projects
slider-element.ts 1.24 KiB
Newer Older
  • Learn to ignore specific revisions
  • import localeDe from '@angular/common/locales/de';
    import { registerLocaleData } from '@angular/common';
    import { FontElement, SurfaceUIElement } from '../interfaces/UIElementInterfaces';
    import { InputElement, UIElement } from './uI-element';
    import { initFontElement, initSurfaceElement } from '../util/unit-interface-initializer';
    
    mechtelm's avatar
    mechtelm committed
    
    
    export class SliderElement extends InputElement implements FontElement, SurfaceUIElement {
    
    mechtelm's avatar
    mechtelm committed
      minValue: number = 0;
      maxValue: number = 100;
    
    mechtelm's avatar
    mechtelm committed
      showValues: boolean = true;
    
    mechtelm's avatar
    mechtelm committed
      barStyle: boolean = false;
    
      thumbLabel: boolean = false;
    
    mechtelm's avatar
    mechtelm committed
    
    
      bold: boolean = false;
      font: string = 'Roboto';
      fontColor: string = 'black';
      fontSize: number = 18;
      italic: boolean = false;
      lineHeight: number = 120;
      underline: boolean = false;
    
      backgroundColor: string = '#AAA0';
    
    mechtelm's avatar
    mechtelm committed
    
      constructor(serializedElement: UIElement) {
        super(serializedElement);
    
        registerLocaleData(localeDe);
    
    mechtelm's avatar
    mechtelm committed
        Object.assign(this, serializedElement);
    
        Object.assign(this, initFontElement(serializedElement));
    
    mechtelm's avatar
    mechtelm committed
        Object.assign(this, initSurfaceElement(serializedElement));
    
    
        this.height = serializedElement.height || 70;
        this.width = serializedElement.width || 300;
        this.backgroundColor = serializedElement.backgroundColor as string || '#d3d3d300';
    
    mechtelm's avatar
    mechtelm committed
      }
    }