///
class SayLeftRight extends Say {
private left : Say = new Say();
private right : Say = new Say();
public constructor () {
super();
}
public addLeft (...objs : Array string)>) {
this.left.add(...objs);
}
public addRight (...objs : Array string)>) {
this.right.add(...objs);
}
public async getPureElements () : Promise> {
if (this.left.sequence.length == 0) {
return await this.right.getPureElements();
} else if (this.right.sequence.length == 0) {
return await this.left.getPureElements();
}
let mainDiv = document.createElement("div");
mainDiv.classList.add("horFlex");
let left = document.createElement("div");
left.classList.add("horFlexColumn");
mainDiv.appendChild(left);
let right = document.createElement("div");
right.classList.add("horFlexColumn");
mainDiv.appendChild(right);
await this.left.getPureElements().then(value => {
value.forEach(element => {
left.appendChild(element);
})
});
await this.right.getPureElements().then(value => {
value.forEach(element => {
right.appendChild(element);
})
});
return [mainDiv];
}
}