Small refactoring: use checkbox for sharescreen instead of toggles

This commit is contained in:
Pieter Vander Vennet 2022-03-31 03:30:20 +02:00
parent 68c3585d72
commit 592bc4ae0b
2 changed files with 26 additions and 25 deletions

View file

@ -2,6 +2,21 @@ import {InputElement} from "./InputElement";
import {UIEventSource} from "../../Logic/UIEventSource";
import {Utils} from "../../Utils";
import BaseUIElement from "../BaseUIElement";
import InputElementMap from "./InputElementMap";
export class CheckBox extends InputElementMap<number[], boolean> {
constructor(el: BaseUIElement , defaultValue?: boolean) {
super(
new CheckBoxes([el]),
(x0, x1) => x0 === x1,
t => t.length > 0,
x => x ? [0] : []
);
if(defaultValue !== undefined){
this.GetValue().setData(defaultValue)
}
}
}
/**
* Supports multi-input