import type Input from "./Input.js"; import type { JsxTemplateResult } from "@ui5/webcomponents-base/dist/index.js"; import Icon from "./Icon.js"; import decline from "@ui5/webcomponents-icons/dist/decline.js"; import InputPopoverTemplate from "./InputPopoverTemplate.js"; type TemplateHook = () => JsxTemplateResult; export default function InputTemplate(this: Input, hooks?: { preContent: TemplateHook, postContent: TemplateHook, suggestionsList?: TemplateHook, mobileHeader?: TemplateHook }) { const suggestionsList = hooks?.suggestionsList; const mobileHeader = hooks?.mobileHeader; const preContent = hooks?.preContent || defaultPreContent; const postContent = hooks?.postContent || defaultPostContent; return ( <>
{ preContent.call(this) } 0} disabled={this.disabled} readonly={this._readonly} value={this.value} required={this.required} placeholder={this._placeholder} maxlength={this.maxlength} role={this.accInfo.role} enterkeyhint={this.hint} aria-controls={this.accInfo.ariaControls} aria-invalid={this.accInfo.ariaInvalid} aria-haspopup={this.accInfo.ariaHasPopup} aria-describedby={this.accInfo.ariaDescribedBy} aria-roledescription={this.accInfo.ariaRoledescription} aria-autocomplete={this.accInfo.ariaAutoComplete} aria-expanded={this.accInfo.ariaExpanded} aria-label={this.accInfo.ariaLabel} aria-required={this.required} autocomplete="off" data-sap-focus-ref step={this.nativeInputAttributes.step} min={this.nativeInputAttributes.min} max={this.nativeInputAttributes.max} onInput={this._handleNativeInput} onChange={this._handleChange} onSelect={this._handleSelect} onKeyDown={this._onkeydown} onKeyUp={this._onkeyup} onClick={this._click} onFocusIn={this.innerFocusIn} /> {this._effectiveShowClearIcon &&
} {this.icon.length > 0 &&
}
{this._valueStateInputIcon}
{ postContent.call(this) } {this._effectiveShowSuggestions && <> {this.suggestionsText} {this.availableSuggestionsCount} } {this.accInfo.ariaDescription && {this.accInfo.ariaDescription} } {this.accInfo.accessibleDescription && {this.accInfo.accessibleDescription} } {this.linksInAriaValueStateHiddenText.length > 0 && {this.valueStateLinksShortcutsTextAcc} } {this.hasValueState && {this.ariaValueStateHiddenText} }
{ InputPopoverTemplate.call(this, { suggestionsList, mobileHeader }) } ); } function defaultPreContent() {} function defaultPostContent() {}