import {InputElement} from "./InputElement"; import {UIEventSource} from "../UIEventSource"; import {UIElement} from "../UIElement"; import {FixedUiElement} from "../Base/FixedUiElement"; import Translations from "../i18n/Translations"; export class InputElementWrapper extends InputElement{ private pre: UIElement ; private input: InputElement; private post: UIElement ; constructor( pre: UIElement | string, input: InputElement, post: UIElement | string ) { super(undefined); // this.pre = typeof(pre) === 'string' ? new FixedUiElement(pre) : pre this.pre = Translations.W(pre) this.input = input; // this.post =typeof(post) === 'string' ? new FixedUiElement(post) : post this.post = Translations.W(post) } GetValue(): UIEventSource { return this.input.GetValue(); } InnerRender(): string { return this.pre.Render() + this.input.Render() + this.post.Render(); } IsValid(t: T): boolean { return this.input.IsValid(t); } }