2022-11-07 17:44:57 -06:00
|
|
|
export class DisplayValue {
|
|
|
|
constructor(name, box) {
|
|
|
|
this.value = undefined;
|
|
|
|
this.name = name;
|
|
|
|
this.box = box;
|
|
|
|
this.nameBox = this.box.addBox(`${this.name}-name`).addClass('name');
|
|
|
|
this.valueBox = this.box.addBox(`${this.name}-value`).addClass('value');
|
|
|
|
this.nameBox.setInnerHTML(this.name);
|
|
|
|
}
|
|
|
|
|
|
|
|
render() {
|
|
|
|
this.valueBox.setInnerHTML(this.value);
|
|
|
|
}
|
|
|
|
|
|
|
|
set(value) {
|
|
|
|
this.value = value;
|
|
|
|
this.render();
|
|
|
|
}
|
|
|
|
|
|
|
|
get() {
|
|
|
|
return this.value;
|
|
|
|
}
|
2023-01-27 21:20:13 -06:00
|
|
|
|
|
|
|
getName() {
|
|
|
|
return this.name;
|
|
|
|
}
|
2022-11-07 17:44:57 -06:00
|
|
|
}
|