Fix input elements
This commit is contained in:
parent
48f66bd17e
commit
910970e4a4
6 changed files with 78 additions and 81 deletions
42
test.ts
42
test.ts
|
@ -1,40 +1,10 @@
|
|||
import {UIEventSource} from "./Logic/UIEventSource";
|
||||
import SpecialVisualizations from "./UI/SpecialVisualizations";
|
||||
import State from "./State";
|
||||
import ValidatedTextField from "./UI/Input/ValidatedTextField";
|
||||
import Combine from "./UI/Base/Combine";
|
||||
import {FixedUiElement} from "./UI/Base/FixedUiElement";
|
||||
import OpeningHoursVisualization from "./UI/OpeningHours/OpeningHoursVisualization";
|
||||
import OpeningHoursPickerTable from "./UI/OpeningHours/OpeningHoursPickerTable";
|
||||
import OpeningHoursPicker from "./UI/OpeningHours/OpeningHoursPicker";
|
||||
import {OH, OpeningHour} from "./UI/OpeningHours/OpeningHours";
|
||||
import {VariableUiElement} from "./UI/Base/VariableUIElement";
|
||||
import PublicHolidayInput from "./UI/OpeningHours/PublicHolidayInput";
|
||||
|
||||
|
||||
const tagsSource = new UIEventSource({
|
||||
id: 'id',
|
||||
name: 'name',
|
||||
surface: 'asphalt',
|
||||
image: "https://i.imgur.com/kX3rl3v.jpg",
|
||||
"image:1": "https://i.imgur.com/oHAJqMB.jpg",
|
||||
"opening_hours": "mo-fr 09:00-18:00",
|
||||
_country: "be",
|
||||
})
|
||||
|
||||
const state = new State(undefined)
|
||||
State.state = state
|
||||
|
||||
const ohData = new UIEventSource<string>("")
|
||||
new OpeningHoursPicker().AttachTo("maindiv")
|
||||
/*
|
||||
const allSpecials = SpecialVisualizations.specialVisualizations.map(spec => {
|
||||
try{
|
||||
|
||||
return new Combine([spec.funcName, spec.constr(state, tagsSource, spec.args.map(a => a.defaultValue ?? "")).SetClass("block")])
|
||||
.SetClass("flex flex-col border border-black p-2 m-2");
|
||||
}catch(e){
|
||||
console.error(e)
|
||||
return new FixedUiElement("Could not construct "+spec.funcName+" due to "+e).SetClass("alert")
|
||||
}
|
||||
})
|
||||
new Combine(allSpecials).AttachTo("maindiv")*/
|
||||
new Combine(ValidatedTextField.tpList.map(tp => {
|
||||
const tf = ValidatedTextField.InputForType(tp.name);
|
||||
|
||||
return new Combine([tf, new VariableUiElement(tf.GetValue()).SetClass("alert")]);
|
||||
})).AttachTo("maindiv")
|
Loading…
Add table
Add a link
Reference in a new issue