forked from MapComplete/MapComplete
		
	Lots of refactoring, first version of the import helper
This commit is contained in:
		
							parent
							
								
									612b8136ad
								
							
						
					
					
						commit
						3402ac0954
					
				
					 54 changed files with 1104 additions and 315 deletions
				
			
		|  | @ -5,7 +5,6 @@ import BaseUIElement from "../BaseUIElement"; | |||
| 
 | ||||
| export class TextField extends InputElement<string> { | ||||
|     public readonly enterPressed = new UIEventSource<string>(undefined); | ||||
|     public readonly IsSelected: UIEventSource<boolean> = new UIEventSource<boolean>(false); | ||||
|     private readonly value: UIEventSource<string>; | ||||
|     private _element: HTMLElement; | ||||
|     private readonly _isValid: (s: string, country?: () => string) => boolean; | ||||
|  | @ -26,11 +25,6 @@ export class TextField extends InputElement<string> { | |||
|         this.value = options?.value ?? new UIEventSource<string>(undefined); | ||||
|         this._isValid = options.isValid ?? (_ => true); | ||||
| 
 | ||||
|         this.onClick(() => { | ||||
|             self.IsSelected.setData(true) | ||||
|         }); | ||||
| 
 | ||||
| 
 | ||||
|         const placeholder = Translations.W(options.placeholder ?? "").ConstructElement().innerText.replace("'", "'"); | ||||
| 
 | ||||
|         this.SetClass("form-text-field") | ||||
|  | @ -107,10 +101,6 @@ export class TextField extends InputElement<string> { | |||
|         }; | ||||
| 
 | ||||
| 
 | ||||
|         field.addEventListener("focusin", () => self.IsSelected.setData(true)); | ||||
|         field.addEventListener("focusout", () => self.IsSelected.setData(false)); | ||||
| 
 | ||||
| 
 | ||||
|         field.addEventListener("keyup", function (event) { | ||||
|             if (event.key === "Enter") { | ||||
|                 // @ts-ignore
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue