Intermediary refactoring

This commit is contained in:
Pieter Vander Vennet 2020-07-20 15:54:50 +02:00
parent dcf5d24002
commit 93db813cfc
15 changed files with 280 additions and 178 deletions

26
test.ts
View file

@ -7,33 +7,19 @@ import {OsmLink} from "./Customizations/Questions/OsmLink";
import {ConfirmDialog} from "./UI/ConfirmDialog";
import {Imgur} from "./Logic/Imgur";
import {VariableUiElement} from "./UI/Base/VariableUIElement";
import {UIRadioButton} from "./UI/Base/UIRadioButton";
import {FixedInputElement} from "./UI/Base/FixedInputElement";
import {TextField} from "./UI/Base/TextField";
import {TextField} from "./UI/Input/TextField";
import {FixedInputElement} from "./UI/Input/FixedInputElement";
import {RadioButton} from "./UI/Input/RadioButton";
const buttons = new UIRadioButton<number>(
const buttons = new RadioButton<number>(
[new FixedInputElement("Five", 5),
new FixedInputElement("Ten", 10),
new TextField<number>({
fromString: (str) => parseInt(str),
toString: (i) => ("" + i),
})
]
], false
).AttachTo("maindiv");
buttons.GetValue().addCallback(console.log);
buttons.GetValue().setData(10)
const value = new TextField<number>({
fromString: (str) => parseInt(str),
toString: (i) => {
if(isNaN(i)){
return ""
}
return ("" + i)
},
}).AttachTo("extradiv").GetValue();
value.setData(42);
value.addCallback(console.log)
buttons.GetValue().addCallback(console.log);