import Icon from "./Icon.js"; import multiSelectAll from "@ui5/webcomponents-icons/dist/multiselect-all.js"; import InputTemplate from "./InputTemplate.js"; import type MultiInput from "./MultiInput.js"; import type { MultiInputTokenDeleteEventDetail } from "./MultiInput.js"; import Tokenizer from "./Tokenizer.js"; import ToggleButton from "./ToggleButton.js"; import List from "./List.js"; import ListItemStandard from "./ListItemStandard.js"; import ListAccessibleRole from "./types/ListAccessibleRole.js"; import valueHelp from "@ui5/webcomponents-icons/dist/value-help.js"; export default function MultiInputTemplate(this: MultiInput) { return [ InputTemplate.call(this, { preContent, postContent, suggestionsList: multiInputSuggestionsList, mobileHeader: multiInputMobileHeader, }), ]; } function preContent(this: MultiInput) { return ( <> {this._tokensCountText} {this.showValueHelpIcon && {this._valueHelpText} } { this.tokens.map(token => )} ); } function postContent(this: MultiInput) { return ( <> {this.showValueHelpIcon && } ); } function multiInputSuggestionsList(this: MultiInput) { if (this._effectiveShowTokensInSuggestions) { return ( { const listItem = e.detail.item; const tokenId = listItem.getAttribute("data-ui5-token-ref-id"); const token = this.tokens.find((t: any) => t._id === tokenId); if (token) { this.tokenDelete({ detail: { tokens: [token] } } as CustomEvent); } }} > {this.tokens?.map((token: any, index: number) => ( ))} ); } return ( ); } function multiInputMobileHeader(this: MultiInput) { return ( { this._userToggledShowTokens = true; this._showTokensInSuggestions = !this._effectiveShowTokensInSuggestions; }} /> ); }