Finishing refactoring

This commit is contained in:
Pieter Vander Vennet 2020-07-20 21:39:07 +02:00
parent 8026e99824
commit 00d95c4be1
8 changed files with 86 additions and 57 deletions

22
test.ts
View file

@ -10,17 +10,15 @@ import {VariableUiElement} from "./UI/Base/VariableUIElement";
import {TextField} from "./UI/Input/TextField";
import {FixedInputElement} from "./UI/Input/FixedInputElement";
import {RadioButton} from "./UI/Input/RadioButton";
import {DropDown} from "./UI/Input/DropDown";
import {FixedUiElement} from "./UI/Base/FixedUiElement";
const buttons = new RadioButton<number>(
[new FixedInputElement("Five", 5),
new FixedInputElement("Ten", 10),
new TextField<number>({
fromString: (str) => parseInt(str),
toString: (i) => ("" + i),
})
], false
const dropdown = new RadioButton<string>(
[new FixedInputElement("5","5"),
new TextField({
toString: ((str) => str),
fromString: ((str) => str),
})]
).AttachTo("maindiv");
buttons.GetValue().addCallback(console.log);
const value = dropdown.GetValue();
value.setData("asldkjvmqlksjdf")