| 
									
										
										
										
											2022-06-06 19:37:22 +02:00
										 |  |  | import {UIEventSource} from "./Logic/UIEventSource"; | 
					
						
							|  |  |  | import TagRenderingQuestion from "./UI/Popup/TagRenderingQuestion"; | 
					
						
							|  |  |  | import TagRenderingConfig from "./Models/ThemeConfig/TagRenderingConfig"; | 
					
						
							| 
									
										
										
										
											2022-06-09 02:55:14 +02:00
										 |  |  | import {RadioButton} from "./UI/Input/RadioButton"; | 
					
						
							|  |  |  | import {FixedInputElement} from "./UI/Input/FixedInputElement"; | 
					
						
							|  |  |  | import {VariableUiElement} from "./UI/Base/VariableUIElement"; | 
					
						
							|  |  |  | import ValidatedTextField from "./UI/Input/ValidatedTextField"; | 
					
						
							|  |  |  | import VariableInputElement from "./UI/Input/VariableInputElement"; | 
					
						
							| 
									
										
										
										
											2022-02-12 02:53:41 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-06-06 19:37:22 +02:00
										 |  |  | const config = new TagRenderingConfig({ | 
					
						
							|  |  |  |     question: "What is the name?", | 
					
						
							|  |  |  |     render: "The name is {name}", | 
					
						
							|  |  |  |     freeform: { | 
					
						
							|  |  |  |         key: 'name', | 
					
						
							|  |  |  |         inline:true | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |     mappings:[ | 
					
						
							|  |  |  |         { | 
					
						
							|  |  |  |             if:"noname=yes", | 
					
						
							|  |  |  |             then: "This feature has no name" | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  |     ] | 
					
						
							|  |  |  | }) | 
					
						
							| 
									
										
										
										
											2022-05-06 12:41:24 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-06-06 19:37:22 +02:00
										 |  |  | const tags = new UIEventSource<any>({ | 
					
						
							|  |  |  |     name: "current feature name" | 
					
						
							|  |  |  | }) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-06-09 02:55:14 +02:00
										 |  |  | /*new TagRenderingQuestion( | 
					
						
							|  |  |  |     tags, config, undefined).AttachTo("maindiv")*/ | 
					
						
							|  |  |  | const options = new UIEventSource<string[]>([]) | 
					
						
							|  |  |  | const rb = | 
					
						
							|  |  |  |     new VariableInputElement( | 
					
						
							|  |  |  |         options.map(options  => { | 
					
						
							|  |  |  |             console.trace("Construction an input element for", options) | 
					
						
							|  |  |  |            return new RadioButton( | 
					
						
							|  |  |  |                 [ | 
					
						
							|  |  |  |                     ...options.map(o => new FixedInputElement(o,o)), | 
					
						
							|  |  |  |                     new FixedInputElement<string>("abc", "abc"), | 
					
						
							|  |  |  |                     ValidatedTextField.ForType().ConstructInputElement() | 
					
						
							|  |  |  |                 ]) | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  |          | 
					
						
							|  |  |  |     ) | 
					
						
							|  |  |  |      | 
					
						
							|  |  |  | ) | 
					
						
							|  |  |  | rb.AttachTo("maindiv") | 
					
						
							|  |  |  | rb.GetValue().addCallbackAndRun(v => console.log("Current value is",v)) | 
					
						
							|  |  |  | new VariableUiElement(rb.GetValue()).AttachTo("extradiv") | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | window.setTimeout(() => {options.setData(["xyz","foo","bar"])},10000) |