Cleanup of empty classes, partial use of default export

This commit is contained in:
Pieter Vander Vennet 2020-10-02 19:00:24 +02:00
parent cc75f5c4fd
commit 9970c4b8bb
55 changed files with 939 additions and 206 deletions

View file

@ -1,20 +0,0 @@
import {UIElement} from "../UIElement";
export class Image extends UIElement{
private src: string;
private style: string = "";
constructor(src: string, style: string = "") {
super(undefined);
this.style = style;
this.src = src;
}
InnerRender(): string {
if(this.src === undefined){
return "";
}
return `<img src='${this.src}' style='${this.style}'>`;
}
}

View file

@ -1,28 +1,20 @@
import {UIElement} from "../UIElement";
export class VerticalCombine extends UIElement {
private _elements: UIElement[];
private _className: string;
private readonly _elements: UIElement[];
constructor(elements: UIElement[], className: string = undefined) {
constructor(elements: UIElement[]) {
super(undefined);
this._elements = elements;
this._className = className;
}
InnerRender(): string {
let html = "";
for (const element of this._elements) {
if (element!== undefined && !element.IsEmpty()) {
if (element !== undefined && !element.IsEmpty()) {
html += "<div>" + element.Render() + "</div>";
}
}
if(html === ""){
return "";
}
if (this._className === undefined) {
return html;
}
return "<div class='"+this._className+"'>" + html + "</div>";
return html;
}
}