mapcomplete/test.ts

31 lines
992 B
TypeScript
Raw Normal View History

2020-10-03 23:04:46 +00:00
//*
2020-09-30 20:22:58 +00:00
import {VariableUiElement} from "./UI/Base/VariableUIElement";
2020-10-03 23:04:46 +00:00
import OpeningHoursRange from "./UI/Input/OpeningHours/OpeningHoursRange";
import {UIEventSource} from "./Logic/UIEventSource";
import OpeningHoursPicker from "./UI/Input/OpeningHours/OpeningHoursPicker";
import {OpeningHour} from "./Logic/OpeningHours";
2020-10-03 23:04:46 +00:00
let oh = new OpeningHoursPicker(new UIEventSource<OpeningHour[]>([]));
oh.SetStyle("height:100vh;display:block;").AttachTo('maindiv');
2020-09-30 20:22:58 +00:00
oh.GetValue().addCallback(data => console.log(data))
new VariableUiElement(oh.GetValue().map(oh => {
if(oh === undefined){
return "<no value selected>";
}
return oh.weekdayStart + " " + oh.startHour + ":" + oh.startMinutes + " --> " +
oh.weekdayEnd + " " + oh.endHour + ":" + oh.endMinutes
2020-09-30 21:06:22 +00:00
})).AttachTo("extradiv");
2020-10-03 23:04:46 +00:00
/*/
import {Utils} from "./Utils";
import {FixedUiElement} from "./UI/Base/FixedUiElement";
Utils.generateStats((stats) => {
new FixedUiElement(stats).AttachTo('maindiv')
})
//*/