forked from MapComplete/MapComplete
Add multi-checkbox component
This commit is contained in:
parent
e4bbf9a054
commit
eab842d18a
3 changed files with 138 additions and 5 deletions
24
test.ts
24
test.ts
|
@ -1,4 +1,26 @@
|
|||
import BikeCafes from "./Customizations/Layers/BikeCafes";
|
||||
import {CheckBoxes} from "./UI/Input/Checkboxes";
|
||||
import {FixedInputElement} from "./UI/Input/FixedInputElement";
|
||||
import {VariableUiElement} from "./UI/Base/VariableUIElement";
|
||||
|
||||
|
||||
console.log(JSON.stringify(new BikeCafes()))
|
||||
const cb = new CheckBoxes(
|
||||
[ new FixedInputElement("One", 1),
|
||||
new FixedInputElement("Two",2),
|
||||
new FixedInputElement("Thee",3)]
|
||||
)
|
||||
|
||||
cb.AttachTo("maindiv");
|
||||
new VariableUiElement(cb.GetValue().map(ts => ts?.join(", "))).AttachTo("extradiv")
|
||||
|
||||
window.setTimeout(() => {
|
||||
cb.GetValue().setData([2,3]);
|
||||
}, 2500)
|
||||
|
||||
window.setTimeout(() => {
|
||||
cb.GetValue().setData([2]);
|
||||
}, 3000)
|
||||
|
||||
window.setTimeout(() => {
|
||||
cb.GetValue().setData([1, 2]);
|
||||
}, 3500)
|
Loading…
Add table
Add a link
Reference in a new issue