import {InputElement} from "./InputElement"; import {UIEventSource} from "../../Logic/UIEventSource"; import BaseUIElement from "../BaseUIElement"; import {Translation} from "../i18n/Translation"; import {SubstitutedTranslation} from "../SubstitutedTranslation"; export default class InputElementWrapper extends InputElement { public readonly IsSelected: UIEventSource; private readonly _inputElement: InputElement; private readonly _renderElement: BaseUIElement constructor(inputElement: InputElement, translation: Translation, key: string, tags: UIEventSource) { super() this._inputElement = inputElement; this.IsSelected = inputElement.IsSelected const mapping = new Map() mapping.set(key, inputElement) this._renderElement = new SubstitutedTranslation(translation, tags, mapping) } GetValue(): UIEventSource { return this._inputElement.GetValue(); } IsValid(t: T): boolean { return this._inputElement.IsValid(t); } protected InnerConstructElement(): HTMLElement { return this._renderElement.ConstructElement(); } }