2020-06-29 03:12:44 +02:00
|
|
|
import {UIElement} from "../UIElement";
|
2020-06-24 00:35:19 +02:00
|
|
|
|
|
|
|
export class VerticalCombine extends UIElement {
|
|
|
|
private _elements: UIElement[];
|
2020-06-28 00:06:23 +02:00
|
|
|
private _className: string;
|
|
|
|
|
|
|
|
constructor(elements: UIElement[], className: string = undefined) {
|
2020-06-24 00:35:19 +02:00
|
|
|
super(undefined);
|
|
|
|
this._elements = elements;
|
2020-06-28 00:06:23 +02:00
|
|
|
this._className = className;
|
2020-06-24 00:35:19 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
protected InnerRender(): string {
|
|
|
|
let html = "";
|
2020-06-28 00:06:23 +02:00
|
|
|
for (const element of this._elements) {
|
2020-06-24 00:35:19 +02:00
|
|
|
if (!element.IsEmpty()) {
|
2020-06-28 00:06:23 +02:00
|
|
|
html += "<div>" + element.Render() + "</div>";
|
2020-06-24 00:35:19 +02:00
|
|
|
}
|
2020-06-28 00:06:23 +02:00
|
|
|
}
|
|
|
|
if(html === ""){
|
|
|
|
return "";
|
|
|
|
}
|
|
|
|
if (this._className === undefined) {
|
|
|
|
return html;
|
|
|
|
}
|
|
|
|
return "<div class='"+this._className+"'>" + html + "</div>";
|
2020-06-24 00:35:19 +02:00
|
|
|
}
|
|
|
|
}
|