| 
									
										
										
										
											2021-06-14 17:28:11 +02:00
										 |  |  | import {UIEventSource} from "./Logic/UIEventSource"; | 
					
						
							| 
									
										
										
										
											2021-06-14 19:21:33 +02:00
										 |  |  | import SpecialVisualizations from "./UI/SpecialVisualizations"; | 
					
						
							|  |  |  | import State from "./State"; | 
					
						
							|  |  |  | import Combine from "./UI/Base/Combine"; | 
					
						
							|  |  |  | import {FixedUiElement} from "./UI/Base/FixedUiElement"; | 
					
						
							| 
									
										
										
										
											2020-08-31 02:59:47 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-06-14 17:28:11 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | const tagsSource = new UIEventSource({ | 
					
						
							|  |  |  |     id:'id', | 
					
						
							|  |  |  |     name:'name', | 
					
						
							| 
									
										
										
										
											2021-06-14 19:21:33 +02:00
										 |  |  |     surface:'asphalt', | 
					
						
							|  |  |  |     image: "https://i.imgur.com/kX3rl3v.jpg", | 
					
						
							|  |  |  |     "image:1": "https://i.imgur.com/kX3rl3v.jpg", | 
					
						
							|  |  |  |     _country:"be", | 
					
						
							|  |  |  |   //      "opening_hours":"mo-fr 09:00-18:00"
 | 
					
						
							| 
									
										
										
										
											2021-06-14 17:28:11 +02:00
										 |  |  | }) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-06-14 19:21:33 +02:00
										 |  |  | const state = new State(undefined) | 
					
						
							|  |  |  | State.state = state | 
					
						
							| 
									
										
										
										
											2021-06-14 17:28:11 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-06-14 19:21:33 +02:00
										 |  |  | const allSpecials = SpecialVisualizations.specialVisualizations.map(spec => { | 
					
						
							|  |  |  |     try{ | 
					
						
							| 
									
										
										
										
											2021-06-14 17:28:11 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-06-14 19:21:33 +02:00
										 |  |  |         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") |