diff --git a/src/main/resources/default/assets/tycho/libs/token-autocomplete/token-autocomplete.js b/src/main/resources/default/assets/tycho/libs/token-autocomplete/token-autocomplete.js index 2d9b25001..dae36dd43 100644 --- a/src/main/resources/default/assets/tycho/libs/token-autocomplete/token-autocomplete.js +++ b/src/main/resources/default/assets/tycho/libs/token-autocomplete/token-autocomplete.js @@ -56,7 +56,9 @@ var TokenAutocomplete = /** @class */ (function () { suggestionsUri: '', selectMode: SelectModes.MULTI, suggestionsUriBuilder: function (query) { - return this.suggestionsUri + '?query=' + query; + // We have to do this manually instead of using URL, as we can't be sure that a polyfill for IE11 is present + var querySeparator = this.suggestionsUri.indexOf('?') >= 0 ? '&' : '?'; + return this.suggestionsUri + querySeparator + 'query=' + query; }, suggestionRenderer: TokenAutocomplete.Autocomplete.defaultRenderer, minCharactersForSuggestion: 1, diff --git a/src/main/resources/default/assets/tycho/libs/token-autocomplete/token-autocomplete.js.map b/src/main/resources/default/assets/tycho/libs/token-autocomplete/token-autocomplete.js.map index 064457bfc..374b10382 100644 --- a/src/main/resources/default/assets/tycho/libs/token-autocomplete/token-autocomplete.js.map +++ b/src/main/resources/default/assets/tycho/libs/token-autocomplete/token-autocomplete.js.map @@ -1 +1 @@ -{"version":3,"file":"token-autocomplete.js","sourceRoot":"","sources":["../lib/token-autocomplete.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuCA,IAAK,WAEJ;AAFD,WAAK,WAAW;IACZ,iDAAM,CAAA;IAAE,+CAAK,CAAA;IAAE,iDAAM,CAAA;AACzB,CAAC,EAFI,WAAW,KAAX,WAAW,QAEf;AAmED;IA8CI,2BAAY,OAAgB;QA5C5B,kBAAa,GAAG,WAAW,CAAC;QAC5B,cAAS,GAAG,OAAO,CAAC;QACpB,YAAO,GAAG,KAAK,CAAC;QAChB,WAAM,GAAG,SAAS,CAAC;QACnB,aAAQ,GAAG,WAAW,CAAC;QACvB,aAAQ,GAAG,WAAW,CAAC;QACvB,cAAS,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,CAAC,kBAAkB,EAAE,UAAU,CAAC,CAAC;YAClD,CAAC;YAeL,cAAC;QAAD,CAAC,AA7ZqB;;QAgZX,kBAAe,GAAuB,UAAU,UAAsB;YACzE,IAAI,MAAM,GAAG,QAAQ,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;YAC1C,MAAM,CAAC,WAAW,GAAG,UAAU,CAAC,eAAe,IAAI,UAAU,CAAC,UAAU,CAAC;YAEzE,IAAI,UAAU,CAAC,qBAAqB,EAAE,CAAC;gBACnC,IAAI,WAAW,GAAG,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;gBAClD,WAAW,CAAC,WAAW,GAAG,UAAU,CAAC,qBAAqB,CAAC;gBAC3D,WAAW,CAAC,SAAS,CAAC,GAAG,CAAC,2CAA2C,CAAC,CAAC;gBACvE,MAAM,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;YACpC,CAAC;YAED,OAAO,MAAM,CAAC;QAClB,CAAC;WA5Zc,CA6ZlB;IAKL,wBAAC;CAAA,AAlwCD,IAkwCC","sourcesContent":["interface Token {\n value: string,\n text: string,\n type: string | null\n}\n\ninterface Suggestion {\n id: string | null,\n value: string,\n fieldLabel: string,\n type: string | null,\n completionLabel: string | null,\n completionDescription: string | null,\n disabled: boolean | null\n}\n\ninterface Options {\n name: string,\n selector: string,\n noMatchesText: string | null,\n noMatchesCustomEntriesDescription: string | null,\n placeholderText: string | null,\n initialTokens: Array | null,\n initialSuggestions: Array | null,\n tokenRenderer: TokenRenderer,\n selectMode: SelectModes,\n suggestionsUri: string,\n suggestionsUriBuilder: SuggestionUriBuilder,\n suggestionRenderer: SuggestionRenderer,\n minCharactersForSuggestion: number,\n allowCustomEntries: boolean,\n readonly: boolean,\n optional: boolean,\n showClearButton: boolean,\n enableTabulator: boolean,\n showSuggestionsOnFocus: boolean,\n requestDelay: number\n}\n\nenum SelectModes {\n SINGLE, MULTI, SEARCH\n}\n\ninterface SelectMode {\n addToken(suggestionValue: string | null, suggestionText: string | null, suggestionType: string | null, silent: boolean): void;\n\n handleInputAsValue(input: string): void;\n\n updateHasValue(): void;\n\n initEventListeners(): void;\n\n clear(silent: boolean): void;\n\n clearCurrentInput(): void;\n}\n\ninterface SingleSelect extends SelectMode {\n}\n\ninterface MultiSelect extends SelectMode {\n removeToken(token: HTMLSpanElement): void;\n\n removeLastToken(): void;\n\n removeTokenWithText(textContent: any): void;\n}\n\ninterface Autocomplete {\n suggestions: any;\n\n initEventListeners(): void;\n\n requestSuggestions(value: string): void;\n\n highlightSuggestionAtPosition(arg0: number): void;\n\n addSuggestion(suggestion: Suggestion, showSuggestions: boolean): void;\n\n clearSuggestions(): void;\n\n showSuggestions(): void;\n\n hideSuggestions(): void;\n\n loadSuggestions(): void;\n\n areSuggestionsDisplayed(): boolean;\n\n areSuggestionsActive(): boolean;\n\n highlightSuggestion(arg0: Element): void;\n\n dispatchSuggestionSelectedEvent(_suggestion: HTMLElement): void;\n}\n\ninterface TokenRenderer {\n (token: Token): HTMLElement;\n}\n\ninterface SuggestionRenderer {\n (suggestion: Suggestion): HTMLElement;\n}\n\ninterface SuggestionUriBuilder {\n (query: string): string;\n}\n\nclass TokenAutocomplete {\n\n KEY_BACKSPACE = 'Backspace';\n KEY_ENTER = 'Enter';\n KEY_TAB = 'Tab';\n KEY_UP = 'ArrowUp';\n KEY_DOWN = 'ArrowDown';\n KEY_LEFT = 'ArrowLeft';\n KEY_RIGHT = 'ArrowRight';\n KEY_ESC = 'Escape';\n\n options: Options;\n container: any;\n tokenContainer: HTMLDivElement;\n hiddenSelect: HTMLSelectElement;\n textInput: HTMLSpanElement;\n\n select: SelectMode;\n autocomplete: Autocomplete;\n\n defaults: Options = {\n name: '',\n selector: '',\n noMatchesText: null,\n noMatchesCustomEntriesDescription: null,\n placeholderText: 'enter some text',\n initialTokens: null,\n initialSuggestions: null,\n tokenRenderer: TokenAutocomplete.MultiSelect.defaultRenderer,\n suggestionsUri: '',\n selectMode: SelectModes.MULTI,\n suggestionsUriBuilder: function (query) {\n return this.suggestionsUri + '?query=' + query\n },\n suggestionRenderer: TokenAutocomplete.Autocomplete.defaultRenderer,\n minCharactersForSuggestion: 1,\n allowCustomEntries: true,\n readonly: false,\n optional: false,\n showClearButton: false,\n enableTabulator: true,\n showSuggestionsOnFocus: true,\n requestDelay: 200\n };\n log: any;\n\n constructor(options: Options) {\n this.options = {...this.defaults, ...options};\n\n let passedContainer = document.querySelector(this.options.selector);\n if (!passedContainer) {\n throw new Error('passed selector does not point to a DOM element.');\n }\n\n this.container = passedContainer;\n this.container.classList.add('token-autocomplete-container');\n\n this.tokenContainer = document.createElement('div');\n this.tokenContainer.classList.add('token-autocomplete-tokens');\n this.container.appendChild(this.tokenContainer);\n\n if (!Array.isArray(this.options.initialTokens) && !Array.isArray(this.options.initialSuggestions)) {\n this.parseTokensAndSuggestions();\n }\n\n this.hiddenSelect = document.createElement('select');\n this.hiddenSelect.id = this.container.id + '-select';\n this.hiddenSelect.name = this.options.name;\n this.hiddenSelect.setAttribute('multiple', 'true');\n this.hiddenSelect.setAttribute('autocomplete', 'off');\n this.hiddenSelect.style.display = 'none';\n\n // If the field is readonly, we don't want to show the clear button.\n if (this.options.readonly) {\n this.options.showClearButton = false;\n if (this.options.tokenRenderer === TokenAutocomplete.MultiSelect.defaultRenderer) {\n this.options.tokenRenderer = TokenAutocomplete.MultiSelect.defaultReadonlyRenderer;\n }\n }\n\n this.textInput = document.createElement('span');\n this.textInput.id = this.container.id + '-input';\n this.textInput.classList.add('token-autocomplete-input');\n if (!this.options.readonly) {\n if (this.options.placeholderText != null) {\n this.textInput.dataset.placeholder = this.options.placeholderText;\n }\n\n this.textInput.contentEditable = 'true';\n this.textInput.addEventListener(\"paste\", function (event) {\n event.preventDefault();\n if (event.clipboardData) {\n // Normal handling for modern browsers\n const text = event.clipboardData?.getData(\"text/plain\");\n document.execCommand(\"insertHTML\", false, text);\n } else {\n // Fallback logic for IE11\n const globalText = window.clipboardData?.getData(\"Text\");\n const range = document.getSelection()?.getRangeAt(0);\n range?.insertNode(document.createTextNode(globalText));\n }\n });\n } else {\n this.container.classList.add('token-autocomplete-readonly');\n }\n this.tokenContainer.appendChild(this.textInput);\n\n\n this.container.appendChild(this.hiddenSelect);\n this.addHiddenEmptyOption();\n\n if (this.options.selectMode == SelectModes.MULTI) {\n this.select = new TokenAutocomplete.MultiSelect(this);\n } else if (this.options.selectMode == SelectModes.SEARCH) {\n this.select = new TokenAutocomplete.SearchMultiSelect(this);\n } else if (this.options.selectMode == SelectModes.SINGLE) {\n this.hiddenSelect.removeAttribute('multiple');\n this.select = new TokenAutocomplete.SingleSelect(this);\n }\n this.autocomplete = new TokenAutocomplete.Autocomplete(this);\n\n this.select.initEventListeners();\n this.autocomplete.initEventListeners();\n\n this.debug(false);\n\n if (Array.isArray(this.options.initialTokens)) {\n this.val(this.options.initialTokens);\n }\n\n this.container.tokenAutocomplete = this as TokenAutocomplete;\n\n if (this.options.selectMode == SelectModes.SINGLE && !this.options.optional && this.val().length == 0) {\n this.autocomplete.loadSuggestions();\n }\n }\n\n /**\n * Searches the element given as a container for option elements and creates active tokens (when the option is marked selected)\n * and suggestions (all options found) from these. During this all found options are removed from the DOM.\n */\n parseTokensAndSuggestions() {\n let initialTokens: Array = [];\n let initialSuggestions: Array = [];\n\n let options: NodeListOf = this.container.querySelectorAll('option');\n\n let me = this;\n options.forEach(function (option) {\n if (option.text != null) {\n if (option.hasAttribute('selected')) {\n initialTokens.push({value: option.value, text: option.text, type: null});\n }\n initialSuggestions.push({\n id: null,\n value: option.value,\n fieldLabel: option.text,\n type: null,\n completionDescription: option.dataset.description || null,\n completionLabel: null,\n disabled: option.disabled || false\n });\n }\n me.container.removeChild(option);\n });\n\n if (initialSuggestions.length > 0) {\n this.options.initialSuggestions = initialSuggestions;\n if (!this.options.optional && initialTokens.length == 0) {\n let firstSuggestion = initialSuggestions[0];\n initialTokens.push({\n value: firstSuggestion.value, text: firstSuggestion.fieldLabel, type: firstSuggestion.type\n });\n }\n }\n\n if (initialTokens.length > 0) {\n this.options.initialTokens = initialTokens;\n }\n }\n\n /**\n * Clears the currently present tokens and creates new ones from the given input value, returns new tokens afterwards.\n *\n * The current tokens are only overwritten (cleared and added) when a value parameter is given.\n * In addition to the possibility of setting the value of the input this method also returns the values of all present tokens.\n *\n * @param {(Array|Token)} value - either the name of a single token or a list of tokens to create\n * @param {boolean} silent - whether appropriate events should be triggered when changing tokens or not\n *\n * @returns an array of the values of all current (after update) tokens of the input field\n */\n val(value: Array | Token | null = null, silent: boolean = false): Array {\n if (typeof value !== 'undefined' && value !== null) {\n this.select.clear(silent);\n this.addToken(value, silent);\n }\n\n let tokens: Array = [];\n this.hiddenSelect.querySelectorAll('option').forEach(option => {\n if (option.dataset.value != null && option.dataset.value !== \"\") {\n tokens.push(option.dataset.value);\n }\n });\n return tokens;\n }\n\n\n /**\n * Adds the given tokens to the field.\n *\n * The current tokens are only added when a value parameter is given.\n *\n * @param {(Array|Token)} value - either the name of a single token or a list of tokens to create\n * @param {boolean} silent - whether appropriate events should be triggered when changing tokens or not\n */\n addToken(value: Array | Token, silent: boolean = false) {\n if (Array.isArray(value)) {\n let me = this;\n value.forEach(function (token) {\n if (typeof token === 'object') {\n me.select.addToken(token.value, token.text, token.type, silent);\n }\n });\n } else {\n this.select.addToken(value.value, value.text, value.type, silent);\n }\n }\n\n /**\n * Returns the current text the user has input which is not converted into a token.\n */\n getCurrentInput() {\n return this.textInput.textContent || '';\n }\n\n setCurrentInput(input: string, silent: boolean) {\n this.textInput.textContent = input;\n this.select.updateHasValue();\n\n if (silent) {\n return;\n }\n\n this.container.dispatchEvent(new CustomEvent('query-changed', {\n detail: {\n query: input\n }\n }));\n }\n\n addHiddenOption(tokenValue: string, tokenText: string, tokenType: string | null, isLiveEntry: boolean = false) {\n tokenValue = tokenValue.trim();\n tokenText = tokenText.trim();\n let _emptyToken = this.hiddenSelect.querySelector('.empty-token');\n if (_emptyToken) {\n this.hiddenSelect.removeChild(_emptyToken);\n }\n let _existingLiveEntry = this.hiddenSelect.querySelector('.token-autocomplete-live-entry');\n if (_existingLiveEntry) {\n this.hiddenSelect.removeChild(_existingLiveEntry);\n }\n let _existingOption = this.findOptionWithValue(tokenValue);\n if (_existingOption) {\n this.hiddenSelect.removeChild(_existingOption);\n }\n const option = document.createElement('option');\n option.text = tokenText;\n option.value = tokenValue;\n option.selected = true;\n option.dataset.text = tokenText;\n option.dataset.value = tokenValue;\n if (tokenType != null) {\n option.dataset.type = tokenType;\n }\n if (isLiveEntry) {\n option.classList.add('token-autocomplete-live-entry');\n }\n this.hiddenSelect.add(option);\n }\n\n findOptionWithValue(optionValue: string) {\n for (let i = 0; i < this.hiddenSelect.options.length; i++) {\n let option = this.hiddenSelect.options[i];\n if (option.value === optionValue) {\n return option;\n }\n }\n return null;\n }\n\n addHiddenEmptyOption() {\n let _emptyToken = this.hiddenSelect.querySelector('.empty-token');\n if (_emptyToken) {\n _emptyToken.setAttribute('selected', 'true');\n } else {\n const _newOption = document.createElement('option');\n _newOption.text = '';\n _newOption.value = '';\n _newOption.selected = true;\n _newOption.classList.add('empty-token');\n this.hiddenSelect.add(_newOption);\n }\n }\n\n setPlaceholderText(placeholderText: string | undefined) {\n this.textInput.dataset.placeholder = placeholderText;\n }\n\n debug(state: boolean) {\n if (state) {\n this.log = console.log.bind(window.console);\n } else {\n this.log = function () {\n // Intentionally left empty to only log when debugging is enabled.\n }\n }\n }\n\n static MultiSelect = class implements MultiSelect {\n\n parent: TokenAutocomplete;\n container: any;\n tokenContainer: HTMLDivElement;\n options: Options;\n renderer: TokenRenderer;\n\n constructor(parent: TokenAutocomplete) {\n this.parent = parent;\n this.container = parent.container;\n this.tokenContainer = parent.tokenContainer;\n this.options = parent.options;\n this.renderer = parent.options.tokenRenderer;\n\n if (this.options.showClearButton) {\n let clearButton = document.createElement('span');\n clearButton.classList.add('token-autocomplete-delete-button');\n this.container.appendChild(clearButton);\n }\n }\n\n clearCurrentInput(): void {\n this.parent.textInput.textContent = '';\n }\n\n initEventListeners(): void {\n const me = this;\n const parent = this.parent;\n if (parent.options.readonly) {\n return;\n }\n\n let isComposing = false;\n parent.textInput.addEventListener('compositionstart', function (event) {\n isComposing = true;\n })\n parent.textInput.addEventListener('compositionend', function (event) {\n isComposing = false;\n\n // handles hitting ENTER on GBoard, which uses composition events instead of individual key triggers\n let inputString = event.data;\n if (inputString.charAt(inputString.length - 1) === \"\\n\") {\n event.preventDefault();\n me.handleInput(parent.autocomplete.suggestions.querySelector('.token-autocomplete-suggestion-highlighted'));\n }\n })\n\n parent.textInput.addEventListener('keydown', function (event) {\n if (isComposing) return;\n\n if (event.key == parent.KEY_ENTER || (event.key == parent.KEY_TAB && parent.options.enableTabulator && parent.autocomplete.areSuggestionsDisplayed() && parent.autocomplete.suggestions.childNodes.length == 1)) {\n event.preventDefault();\n\n let highlightedSuggestion = parent.autocomplete.suggestions.querySelector('.token-autocomplete-suggestion-highlighted');\n\n if (parent.options.enableTabulator && highlightedSuggestion == null && event.key == parent.KEY_TAB && parent.autocomplete.areSuggestionsDisplayed()) {\n highlightedSuggestion = parent.autocomplete.suggestions.firstChild;\n }\n\n me.handleInput(highlightedSuggestion);\n } else if (parent.getCurrentInput() === '' && event.key == parent.KEY_BACKSPACE) {\n event.preventDefault();\n me.removeLastToken();\n }\n if ((event.key == parent.KEY_DOWN || event.key == parent.KEY_UP) && parent.autocomplete.suggestions.childNodes.length > 0) {\n event.preventDefault();\n }\n });\n\n parent.textInput.addEventListener('keyup', function (event) {\n me.updateHasValue();\n });\n\n if (this.options.showClearButton) {\n parent.container.querySelector('.token-autocomplete-delete-button')?.addEventListener('click', function () {\n me.clear(true);\n me.clearCurrentInput();\n me.updateHasValue();\n\n me.container.dispatchEvent(new CustomEvent('input-cleared'));\n });\n }\n }\n\n handleInput(highlightedSuggestion: any): void {\n if (highlightedSuggestion !== null) {\n this.clearCurrentInput();\n if (highlightedSuggestion.classList.contains('token-autocomplete-suggestion-active')) {\n this.removeTokenWithText(highlightedSuggestion.dataset.tokenText);\n } else {\n if (highlightedSuggestion.dataset.becomesToken !== 'false') {\n this.addToken(highlightedSuggestion.dataset.value, highlightedSuggestion.dataset.tokenText, highlightedSuggestion.dataset.type, false);\n }\n this.parent.autocomplete.dispatchSuggestionSelectedEvent(highlightedSuggestion);\n }\n } else {\n this.handleInputAsValue(this.parent.getCurrentInput());\n }\n this.parent.autocomplete.clearSuggestions();\n this.parent.autocomplete.hideSuggestions();\n }\n\n /**\n * Updates the 'token-autocomplete-has-value' class of this MultiSelect autocomplete.\n */\n updateHasValue(): void {\n if (this.parent.getCurrentInput() === '' && this.parent.val().length === 0) {\n this.container.classList.remove('token-autocomplete-has-value');\n } else {\n this.container.classList.add('token-autocomplete-has-value');\n }\n }\n\n /**\n * Adds the current user input as a net token and resets the input area so new text can be entered.\n *\n * @param {string} input - the actual input the user entered\n */\n handleInputAsValue(input: string): void {\n if (input != '' && this.parent.options.allowCustomEntries) {\n this.clearCurrentInput();\n this.addToken(input, input, null);\n return;\n }\n if (this.parent.autocomplete.suggestions.childNodes.length === 1 && this.parent.autocomplete.suggestions.childNodes[0].dataset.value != '_no_match_') {\n this.parent.autocomplete.suggestions.firstChild.click();\n } else {\n this.clearCurrentInput();\n }\n }\n\n /**\n * Adds a token with the specified name to the list of currently present tokens displayed to the user and the hidden select.\n *\n * @param {string} tokenValue - the actual value of the token to create\n * @param {string} tokenText - the name of the token to create\n * @param {string} tokenType - the type of the token to create\n * @param {boolean} silent - whether an appropriate event should be triggered\n */\n addToken(tokenValue: string | null, tokenText: string | null, tokenType: string | null, silent: boolean = false) {\n if (tokenValue === null || tokenText === null || tokenValue === '_no_match_') {\n return;\n }\n\n tokenValue = tokenValue.trim();\n tokenText = tokenText.trim();\n\n this.parent.addHiddenOption(tokenValue, tokenText, tokenType);\n\n let addedToken = {\n value: tokenValue,\n text: tokenText,\n type: tokenType\n };\n\n let element = this.renderer(addedToken);\n\n let me = this;\n element.querySelector('.token-autocomplete-delete-button')?.addEventListener('click', function () {\n me.removeToken(element);\n });\n\n this.tokenContainer.insertBefore(element, this.parent.textInput);\n this.updateHasValue();\n\n if (!silent) {\n this.container.dispatchEvent(new CustomEvent('tokens-changed', {\n detail: {\n tokens: this.parent.val(),\n added: addedToken\n }\n }));\n }\n\n this.parent.log('added token', addedToken);\n }\n\n /**\n * Completely clears the currently present tokens from the field.\n */\n clear(silent: boolean = false) {\n let tokens: NodeListOf = this.tokenContainer.querySelectorAll('.token-autocomplete-token');\n\n let me = this;\n tokens.forEach(function (token) {\n me.removeToken(token, silent);\n });\n }\n\n /**\n * Removes the last token in the list of currently present token. This is the last added token next to the input field.\n */\n removeLastToken() {\n let tokens = this.tokenContainer.querySelectorAll('.token-autocomplete-token');\n let token = tokens[tokens.length - 1] as HTMLElement;\n if (token) {\n this.removeToken(token);\n }\n }\n\n /**\n * Removes the specified token from the list of currently present tokens.\n *\n * @param {Element} token - the token to remove\n * @param {boolean} silent - whether an appropriate event should be triggered\n */\n removeToken(token: HTMLElement, silent: boolean = false) {\n this.tokenContainer.removeChild(token);\n\n let tokenText = token.dataset.text;\n let hiddenOption = this.parent.hiddenSelect.querySelector('option[data-text=\"' + TokenAutocomplete.escapeQuotes(tokenText) + '\"]');\n hiddenOption?.parentElement?.removeChild(hiddenOption);\n\n let addedToken = {\n value: token.dataset.value,\n text: tokenText,\n type: token.dataset.type || null\n };\n\n if (!silent) {\n this.container.dispatchEvent(new CustomEvent('tokens-changed', {\n detail: {\n tokens: this.parent.val(),\n removed: addedToken\n }\n }));\n }\n\n if (this.parent.val().length === 0) {\n this.parent.addHiddenEmptyOption();\n }\n\n this.updateHasValue();\n\n this.parent.log('removed token', token.textContent);\n }\n\n removeTokenWithText(tokenText: string | null) {\n if (tokenText === null) {\n return;\n }\n let token = this.tokenContainer.querySelector('.token-autocomplete-token[data-text=\"' + TokenAutocomplete.escapeQuotes(tokenText) + '\"]') as HTMLElement;\n if (token !== null) {\n this.removeToken(token);\n }\n }\n\n static defaultRenderer: TokenRenderer = function (token: Token): HTMLElement {\n const chip = document.createElement('span');\n chip.classList.add('token-autocomplete-token');\n chip.dataset.text = token.text;\n chip.dataset.value = token.value;\n if (token.type != null) {\n chip.dataset.type = token.type;\n }\n chip.textContent = token.text;\n\n let deleteToken = document.createElement('span');\n deleteToken.classList.add('token-autocomplete-delete-button');\n chip.appendChild(deleteToken);\n\n return chip;\n }\n\n static defaultReadonlyRenderer: TokenRenderer = function (token: Token): HTMLElement {\n const chip = document.createElement('span');\n chip.classList.add('token-autocomplete-token');\n chip.dataset.text = token.text;\n chip.dataset.value = token.value;\n if (token.type != null) {\n chip.dataset.type = token.type;\n }\n chip.textContent = token.text;\n\n return chip;\n }\n }\n\n static SingleSelect = class implements SingleSelect {\n\n parent: TokenAutocomplete;\n container: any;\n options: Options;\n renderer: TokenRenderer;\n previousValue: any;\n previousText: any;\n previousType: any;\n\n constructor(parent: TokenAutocomplete) {\n this.parent = parent;\n this.container = parent.container;\n this.options = parent.options;\n\n this.container.classList.add('token-autocomplete-singleselect');\n this.parent.textInput.tabIndex = 0;\n if (this.options.optional) {\n let clearButton = document.createElement('span');\n clearButton.classList.add('token-autocomplete-delete-button');\n this.container.appendChild(clearButton);\n }\n }\n\n /**\n * Clears the current user input so new text can be entered.\n *\n * @param {boolean} silent - whether an appropriate event should be triggered\n * @param {boolean} keepPreviousValue - if true, the previous value will be stored and shown as a placeholder\n */\n clear(silent: boolean, keepPreviousValue = true): void {\n if (this.options.readonly) {\n return;\n }\n let me = this;\n let tokenText = me.parent.textInput.textContent;\n let hiddenOption = me.parent.hiddenSelect.querySelector('option[data-text=\"' + TokenAutocomplete.escapeQuotes(tokenText) + '\"]') as HTMLElement;\n\n this.container.classList.remove('token-autocomplete-has-value');\n\n const previousValue = hiddenOption?.dataset.value;\n const previousText = hiddenOption?.dataset.text;\n const previousType = hiddenOption?.dataset.type;\n if (keepPreviousValue) {\n me.previousValue = previousValue;\n me.previousText = previousText;\n me.previousType = previousType;\n if (hiddenOption == null && me.options.allowCustomEntries) {\n me.previousValue = tokenText;\n me.previousText = tokenText;\n }\n if (me.previousText && me.previousText !== '') {\n me.parent.textInput.dataset.placeholder = me.previousText;\n }\n } else {\n // We should reset these fields, so they are not used to restore the previously selected value\n // when the focusout event is handled after the click event on the suggestion.\n delete me.previousValue;\n delete me.previousText;\n delete me.previousType;\n if (me.parent.options.placeholderText != null) {\n me.parent.textInput.dataset.placeholder = me.parent.options.placeholderText;\n }\n }\n hiddenOption?.parentElement?.removeChild(hiddenOption);\n me.parent.addHiddenEmptyOption();\n me.parent.textInput.textContent = '';\n me.parent.textInput.contentEditable = 'true';\n\n if (!silent) {\n this.container.dispatchEvent(new CustomEvent('tokens-changed', {\n detail: {\n tokens: this.parent.val(),\n removed: {\n value: previousValue,\n text: previousText,\n type: previousType\n }\n }\n }));\n }\n }\n\n /**\n * Adds the current user input as a net token and resets the input area so new text can be entered.\n *\n * @param {string} input - the actual input the user entered\n */\n handleInputAsValue(input: string): void {\n if (input != '' && this.parent.options.allowCustomEntries) {\n this.clearCurrentInput();\n this.addToken(input, input, null, false);\n this.parent.autocomplete.clearSuggestions();\n this.parent.autocomplete.hideSuggestions();\n return;\n }\n if (this.parent.autocomplete.suggestions.childNodes.length === 1 && this.parent.autocomplete.suggestions.childNodes[0].dataset.value != '_no_match_') {\n this.parent.autocomplete.suggestions.firstChild.click();\n return;\n }\n this.clear(true, false);\n }\n\n clearCurrentInput(): void {\n this.clear(true);\n }\n\n /**\n * Updates the 'token-autocomplete-has-value' class of this SingleSelect autocomplete.\n */\n updateHasValue(): void {\n if (this.parent.getCurrentInput() === '' && this.parent.val().length === 0) {\n this.container.classList.remove('token-autocomplete-has-value');\n } else {\n this.container.classList.add('token-autocomplete-has-value');\n }\n }\n\n addToken(tokenValue: string | null, tokenText: string | null, tokenType: string | null, silent: boolean): void {\n if (tokenValue === null || tokenText === null || tokenValue === '_no_match_') {\n return;\n }\n\n tokenValue = tokenValue.trim();\n tokenText = tokenText.trim();\n\n this.clear(true, false);\n this.parent.textInput.textContent = tokenText;\n this.parent.textInput.contentEditable = 'false';\n this.parent.textInput.blur();\n if (tokenText !== '') {\n this.container.classList.add('token-autocomplete-has-value');\n }\n\n this.parent.addHiddenOption(tokenValue, tokenText, tokenType);\n\n if (!silent) {\n this.container.dispatchEvent(new CustomEvent('tokens-changed', {\n detail: {\n tokens: this.parent.val(),\n added: {\n value: tokenValue,\n text: tokenText,\n type: tokenType\n }\n }\n }));\n }\n }\n\n initEventListeners(): void {\n const me = this;\n const parent = this.parent;\n if (parent.options.readonly) {\n return;\n }\n\n parent.textInput.addEventListener('compositionend', function (event) {\n // handles hitting ENTER on GBoard, which uses composition events instead of individual key triggers\n let inputString = event.data;\n if (inputString.charAt(inputString.length - 1) === \"\\n\") {\n event.preventDefault();\n me.handleInput(parent.autocomplete.suggestions.querySelector('.token-autocomplete-suggestion-highlighted'));\n }\n })\n\n parent.textInput.addEventListener('keydown', function (event) {\n if (event.key == parent.KEY_ENTER || (event.key == parent.KEY_TAB && parent.options.enableTabulator && parent.autocomplete.areSuggestionsDisplayed() && parent.autocomplete.suggestions.childNodes.length == 1)) {\n event.preventDefault();\n\n let highlightedSuggestion = parent.autocomplete.suggestions.querySelector('.token-autocomplete-suggestion-highlighted');\n\n if (parent.options.enableTabulator && highlightedSuggestion == null && event.key == parent.KEY_TAB && parent.autocomplete.areSuggestionsDisplayed()) {\n highlightedSuggestion = parent.autocomplete.suggestions.firstChild;\n }\n\n me.handleInput(highlightedSuggestion);\n }\n if ((event.key == parent.KEY_DOWN || event.key == parent.KEY_UP) && parent.autocomplete.suggestions.childNodes.length > 0) {\n event.preventDefault();\n }\n });\n\n if (parent.options.allowCustomEntries) {\n parent.textInput.addEventListener('keyup', function (event) {\n if (event.key != parent.KEY_ENTER && event.key != parent.KEY_TAB && event.key != parent.KEY_DOWN && event.key != parent.KEY_UP) {\n event.preventDefault();\n parent.addHiddenOption(parent.getCurrentInput(), parent.getCurrentInput(), null, true);\n }\n });\n }\n\n function focusInput() {\n if (!parent.autocomplete.areSuggestionsDisplayed() && parent.options.showSuggestionsOnFocus) {\n parent.autocomplete.showSuggestions();\n parent.autocomplete.loadSuggestions();\n }\n // move the cursor into the editable div\n const selection = window.getSelection();\n const range = document.createRange();\n selection?.removeAllRanges();\n range.selectNodeContents(parent.textInput);\n range.collapse(false);\n selection?.addRange(range);\n parent.textInput.focus();\n }\n\n parent.textInput.addEventListener('click', function () {\n focusInput();\n });\n\n parent.textInput.addEventListener('focusout', function () {\n // Using setTimeout here seems hacky on first sight but ensures proper order of events / handling.\n // We first want to handle a click on a suggestion (when one is made) before hiding the suggestions on focusout of the input.\n // Not doing so could mean the suggestion is hidden before the click is handled und thus resulting in not being selected.\n // This depends on the order in which a browser handles different events and when it sets the active pseudo-selector on clicked events (Firefox for example)\n setTimeout(function () {\n if (parent.autocomplete.areSuggestionsActive()) {\n return;\n }\n const input = me.parent.getCurrentInput();\n if (me.parent.val().length !== 0 && me.parent.val()[0] !== '') {\n return;\n }\n if (input != '') {\n me.handleInputAsValue(input);\n return;\n }\n if (me.previousValue) {\n me.addToken(me.previousValue, me.previousText, me.previousType, true);\n }\n }, 0);\n\n });\n parent.container.querySelector('.token-autocomplete-delete-button')?.addEventListener('click', function () {\n me.clear(false, false);\n });\n }\n\n handleInput(highlightedSuggestion: any): void {\n if (highlightedSuggestion !== null) {\n this.addToken(highlightedSuggestion.dataset.value, highlightedSuggestion.dataset.tokenText, highlightedSuggestion.dataset.type, false);\n } else {\n this.handleInputAsValue(this.parent.getCurrentInput());\n }\n this.parent.autocomplete.clearSuggestions();\n this.parent.autocomplete.hideSuggestions();\n }\n }\n\n static SearchMultiSelect = class extends TokenAutocomplete.MultiSelect {\n /**\n * Instead of adding the custom user input as a token and handling it as a filter we let it remain in the input\n * area and instead send an event so the user search request can be handled / executed.\n *\n * @param {string} input - the actual input the user entered\n */\n handleInputAsValue(input: string) {\n this.container.dispatchEvent(new CustomEvent('query-changed', {\n detail: {\n query: input\n }\n }));\n }\n }\n\n static Autocomplete = class implements Autocomplete {\n\n parent: TokenAutocomplete;\n container: any;\n options: Options;\n suggestions: HTMLUListElement;\n renderer: SuggestionRenderer;\n request: XMLHttpRequest | null;\n timeout: number | undefined;\n\n constructor(parent: TokenAutocomplete) {\n this.parent = parent;\n this.container = parent.container;\n this.options = parent.options;\n this.renderer = parent.options.suggestionRenderer;\n\n this.suggestions = document.createElement('ul');\n this.suggestions.id = this.container.id + '-suggestions';\n this.suggestions.classList.add('token-autocomplete-suggestions');\n\n this.container.appendChild(this.suggestions);\n }\n\n initEventListeners() {\n let me = this;\n if (me.parent.options.readonly) {\n return;\n }\n me.parent.textInput.addEventListener('keyup', function (event) {\n if (event.key == me.parent.KEY_ESC) {\n me.hideSuggestions();\n me.parent.textInput.blur();\n return;\n }\n if (event.key == me.parent.KEY_UP && me.suggestions.childNodes.length > 0) {\n event.preventDefault();\n let highlightedSuggestion = me.suggestions.querySelector('.token-autocomplete-suggestion-highlighted');\n if (highlightedSuggestion == null) {\n // highlight last entry and scroll to bottom\n me.highlightSuggestionAtPosition(me.suggestions.childNodes.length - 1);\n me.suggestions.scrollTop = me.suggestions.scrollHeight;\n return;\n }\n let aboveSuggestion = highlightedSuggestion.previousSibling;\n if (aboveSuggestion != null) {\n // if the suggestions is above the scroll position, scroll to the suggestion\n let suggestionTop = (aboveSuggestion as HTMLElement).offsetTop;\n if (me.suggestions.scrollTop > suggestionTop) {\n me.suggestions.scrollTop = suggestionTop;\n }\n me.highlightSuggestion(aboveSuggestion as Element);\n } else {\n highlightedSuggestion.classList.remove('token-autocomplete-suggestion-highlighted');\n }\n return;\n }\n if (event.key == me.parent.KEY_DOWN && me.suggestions.childNodes.length > 0) {\n event.preventDefault();\n let highlightedSuggestion = me.suggestions.querySelector('.token-autocomplete-suggestion-highlighted');\n if (highlightedSuggestion == null) {\n // highlight first entry and scroll to top\n me.highlightSuggestionAtPosition(0);\n me.suggestions.scrollTop = 0;\n return;\n }\n let belowSuggestion = highlightedSuggestion?.nextSibling;\n if (belowSuggestion != null) {\n // if the suggestions is not completely visible, scroll until the suggestion is at the bottom\n let suggestionBottom = (belowSuggestion as HTMLElement).offsetTop + (belowSuggestion as HTMLElement).offsetHeight;\n if (me.suggestions.scrollTop + me.suggestions.clientHeight < suggestionBottom) {\n me.suggestions.scrollTop = suggestionBottom - me.suggestions.clientHeight;\n }\n me.highlightSuggestion(belowSuggestion as Element);\n } else {\n highlightedSuggestion.classList.remove('token-autocomplete-suggestion-highlighted');\n }\n return;\n }\n if (event.key == me.parent.KEY_LEFT || event.key == me.parent.KEY_RIGHT || event.key == me.parent.KEY_ENTER || event.key == me.parent.KEY_TAB) {\n // We don't want to re-trigger the autocompletion when the user navigates the cursor inside the input.\n return;\n }\n me.loadSuggestions();\n });\n me.parent.textInput.addEventListener('focusout', function () {\n // Using setTimeout here seems hacky on first sight but ensures proper order of events / handling.\n // We first want to handle a click on a suggestion (when one is made) before hiding the suggestions on focusout of the input.\n // Not doing so could mean the suggestion is hidden before the click is handled und thus resulting in not being selected.\n // This depends on the order in which a browser handles different events and when it sets the active pseudo-selector on clicked events (Firefox for example)\n setTimeout(function () {\n if (me.areSuggestionsActive()) {\n return;\n }\n me.hideSuggestions();\n }, 0);\n });\n me.parent.textInput.addEventListener('focusin', function () {\n if (me.options.showSuggestionsOnFocus) {\n me.loadSuggestions();\n me.showSuggestions();\n }\n });\n }\n\n loadSuggestions() {\n let me = this;\n let value = me.parent.getCurrentInput();\n\n if (me.parent.options.selectMode == SelectModes.SINGLE) {\n if (!me.parent.textInput.isContentEditable) {\n me.parent.select.clear(true);\n value = \"\";\n }\n } else if (value.length < me.parent.options.minCharactersForSuggestion) {\n me.clearSuggestions();\n me.hideSuggestions();\n return;\n }\n if (me.parent.options.suggestionsUri.length > 0) {\n me.requestSuggestions(value);\n return;\n }\n if (Array.isArray(me.parent.options.initialSuggestions)) {\n me.clearSuggestions();\n me.parent.options.initialSuggestions.forEach(function (suggestion) {\n if (typeof suggestion !== 'object') {\n // The suggestion is of wrong type and therefore ignored.\n return;\n }\n let text = suggestion.fieldLabel;\n if (value.length == 0 && me.options.selectMode == SelectModes.SINGLE && !me.options.optional && !me.areSuggestionsDisplayed()) {\n me.addSuggestion(suggestion, false);\n } else if (value.localeCompare(text.slice(0, value.length), undefined, {sensitivity: 'base'}) === 0) {\n // The suggestion starts with the query text the user entered and will be displayed.\n me.addSuggestion(suggestion);\n }\n });\n if (me.suggestions.childNodes.length == 0) {\n if (me.parent.options.allowCustomEntries && me.parent.options.noMatchesCustomEntriesDescription) {\n me.addSuggestion({\n id: null,\n value: value,\n fieldLabel: value,\n type: '_no_match_',\n completionDescription: me.parent.options.noMatchesCustomEntriesDescription,\n completionLabel: null,\n disabled: true\n });\n\n } else if (me.parent.options.noMatchesText) {\n me.addSuggestion({\n id: null,\n value: '_no_match_',\n fieldLabel: me.parent.options.noMatchesText,\n type: '_no_match_',\n completionDescription: null,\n completionLabel: null,\n disabled: true\n });\n }\n }\n }\n }\n\n /**\n * Hides the suggestions dropdown from the user.\n */\n hideSuggestions() {\n // as the suggestions will be re-shown if a pending request is executed, we abort them if we want to hide\n this.abortPendingRequest();\n this.container.classList.remove('token-autocomplete-suggestions-displayed');\n this.suggestions.style.display = '';\n\n let _highlightedSuggestions = this.suggestions.querySelectorAll('li.token-autocomplete-suggestion-highlighted');\n _highlightedSuggestions.forEach(function (_suggestion) {\n _suggestion.classList.remove('token-autocomplete-suggestion-highlighted');\n })\n }\n\n /**\n * Shows the suggestions dropdown to the user.\n */\n showSuggestions() {\n this.container.classList.add('token-autocomplete-suggestions-displayed');\n this.suggestions.style.display = 'block';\n\n const inputBottomPosition = this.parent.textInput.getBoundingClientRect().bottom;\n const suggestionsHeight = this.suggestions.offsetHeight;\n const viewportHeight = window.innerHeight;\n const spaceBelow = viewportHeight - inputBottomPosition;\n if (spaceBelow < suggestionsHeight) {\n this.suggestions.classList.add('token-autocomplete-suggestions-above');\n } else {\n this.suggestions.classList.remove('token-autocomplete-suggestions-above');\n }\n }\n\n areSuggestionsDisplayed() {\n return this.suggestions.style.display === 'block';\n }\n\n highlightSuggestionAtPosition(index: number) {\n let _suggestions = this.suggestions.querySelectorAll('li');\n _suggestions.forEach(function (_suggestion) {\n _suggestion.classList.remove('token-autocomplete-suggestion-highlighted');\n })\n _suggestions[index].classList.add('token-autocomplete-suggestion-highlighted');\n }\n\n highlightSuggestion(_suggestion: Element) {\n this.suggestions.querySelectorAll('li.token-autocomplete-suggestion-highlighted').forEach(function (_highlightedSuggestion) {\n _highlightedSuggestion.classList.remove('token-autocomplete-suggestion-highlighted');\n })\n _suggestion.classList.add('token-autocomplete-suggestion-highlighted');\n }\n\n /**\n * Checks for the presence of a suggestion that is currently clicked via mouse (active).\n */\n areSuggestionsActive() {\n return !!this.suggestions.querySelector('li:active');\n }\n\n /**\n * Removes all previous suggestions from the dropdown.\n */\n clearSuggestions() {\n this.abortPendingRequest();\n this.suggestions.innerHTML = '';\n }\n\n /**\n * Aborts currently in progress or scheduled suggestions requests.\n */\n abortPendingRequest() {\n this.request?.abort();\n clearTimeout(this.timeout);\n }\n\n /**\n * Loads suggestions matching the given query from the rest service behind the URI given as an option while initializing the field.\n *\n * @param query the query to search suggestions for\n */\n requestSuggestions(query: string) {\n let me = this;\n clearTimeout(me.timeout);\n if (!me.timeout) {\n me.debouncedRequestSuggestions.call(me, query);\n me.timeout = window.setTimeout(function () {\n delete me.timeout;\n }, me.parent.options.requestDelay);\n } else {\n me.timeout = window.setTimeout(function () {\n delete me.timeout;\n me.debouncedRequestSuggestions.call(me, query);\n }, me.parent.options.requestDelay);\n }\n }\n\n dispatchSuggestionSelectedEvent(_suggestion: HTMLElement) {\n _suggestion.dispatchEvent(new CustomEvent('suggestion-selected', {\n detail: {\n value: _suggestion.dataset.value,\n text: _suggestion.dataset.text,\n type: _suggestion.dataset.type || null\n }\n }));\n }\n\n debouncedRequestSuggestions(query: string) {\n let me = this;\n\n if (me.request != null && me.request.readyState) {\n me.request.abort();\n }\n\n me.request = new XMLHttpRequest();\n me.request.onload = function () {\n me.request = null;\n\n me.clearSuggestions();\n\n let answer = this.response;\n // IE 11 doesn't properly respect content type header, need to parse json string by hand.\n if (typeof answer === 'string') {\n answer = JSON.parse(answer);\n }\n\n if (Array.isArray(answer.completions)) {\n if (me.parent.val().length == 0 && answer.completions.length > 0 && me.options.selectMode == SelectModes.SINGLE && !me.options.optional && !me.areSuggestionsDisplayed()) {\n answer.completions.forEach(function (suggestion: Suggestion) {\n me.addSuggestion(suggestion, false);\n });\n let firstSuggestion = answer.completions[0] as Suggestion;\n let value = firstSuggestion.id || firstSuggestion.value;\n me.parent.select.addToken(value, firstSuggestion.fieldLabel, firstSuggestion.type, true);\n return;\n }\n answer.completions.forEach(function (suggestion: Suggestion) {\n me.addSuggestion(suggestion);\n });\n if (me.suggestions.childNodes.length == 0) {\n if (me.parent.options.allowCustomEntries && me.parent.options.noMatchesCustomEntriesDescription) {\n me.addSuggestion({\n id: null,\n value: query,\n fieldLabel: query,\n type: '_no_match_',\n completionDescription: me.parent.options.noMatchesCustomEntriesDescription,\n completionLabel: null,\n disabled: true\n });\n\n } else if (me.parent.options.noMatchesText) {\n me.addSuggestion({\n id: null,\n value: '_no_match_',\n fieldLabel: me.parent.options.noMatchesText,\n type: '_no_match_',\n completionDescription: null,\n completionLabel: null,\n disabled: true\n });\n }\n }\n }\n };\n let suggestionsUri = me.options.suggestionsUriBuilder(query);\n me.request.open('GET', suggestionsUri, true);\n me.request.responseType = 'json';\n me.request.setRequestHeader('Content-type', 'application/json');\n me.request.send();\n }\n\n /**\n * Adds a suggestion with the given text matching the users input to the dropdown.\n *\n * @param {string} suggestion - the metadata of the suggestion that should be added\n * @param showSuggestions - if the suggestions box should be shown, default true\n */\n addSuggestion(suggestion: Suggestion, showSuggestions = true) {\n let element = this.renderer(suggestion);\n\n let value = suggestion.id || suggestion.value;\n let text = suggestion.completionLabel || suggestion.fieldLabel;\n\n element.dataset.value = value;\n element.dataset.text = text;\n element.dataset.tokenText = suggestion.fieldLabel;\n if (suggestion.type != null) {\n element.dataset.type = suggestion.type;\n }\n\n let me = this;\n element.addEventListener('click', function (_event: Event) {\n if (value == '_no_match_' || suggestion.disabled) {\n return;\n }\n if (me.parent.options.selectMode == SelectModes.SINGLE) {\n if (element.classList.contains('token-autocomplete-suggestion-active')) {\n me.parent.select.clear(false);\n } else {\n if (element.dataset.becomesToken !== 'false') {\n me.parent.select.addToken(value, suggestion.fieldLabel, suggestion.type, false);\n }\n me.dispatchSuggestionSelectedEvent(element);\n }\n } else {\n me.parent.select.clearCurrentInput();\n if (element.classList.contains('token-autocomplete-suggestion-active')) {\n let multiSelect = me.parent.select as MultiSelect;\n multiSelect.removeTokenWithText(suggestion.fieldLabel);\n } else {\n if (element.dataset.becomesToken !== 'false') {\n me.parent.select.addToken(value, suggestion.fieldLabel, suggestion.type, false);\n }\n me.dispatchSuggestionSelectedEvent(element);\n }\n }\n me.clearSuggestions();\n me.hideSuggestions();\n });\n\n if (suggestion.disabled) {\n element.classList.add('token-autocomplete-suggestion-disabled');\n }\n\n if (this.parent.tokenContainer.querySelector('.token-autocomplete-token[data-value=\"' + value + '\"]') !== null) {\n element.classList.add('token-autocomplete-suggestion-active');\n }\n\n this.suggestions.appendChild(element);\n if (showSuggestions) {\n this.showSuggestions();\n }\n\n me.parent.log('added suggestion', suggestion);\n }\n\n static defaultRenderer: SuggestionRenderer = function (suggestion: Suggestion): HTMLElement {\n let option = document.createElement('li');\n option.textContent = suggestion.completionLabel || suggestion.fieldLabel;\n\n if (suggestion.completionDescription) {\n let description = document.createElement('small');\n description.textContent = suggestion.completionDescription;\n description.classList.add('token-autocomplete-suggestion-description');\n option.appendChild(description);\n }\n\n return option;\n }\n }\n\n static escapeQuotes(text: string | null | undefined): string {\n return text?.replace(/\\x22/g, '\\\\\\x22') ?? '';\n }\n}\n"]} \ No newline at end of file +{"version":3,"file":"token-autocomplete.js","sourceRoot":"","sources":["../lib/token-autocomplete.ts"],"names":[],"mappings":";;;;;;;;;;;;;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\n text: string,\n type: string | null\n}\n\ninterface Suggestion {\n id: string | null,\n value: string,\n fieldLabel: string,\n type: string | null,\n completionLabel: string | null,\n completionDescription: string | null,\n disabled: boolean | null\n}\n\ninterface Options {\n name: string,\n selector: string,\n noMatchesText: string | null,\n noMatchesCustomEntriesDescription: string | null,\n placeholderText: string | null,\n initialTokens: Array | null,\n initialSuggestions: Array | null,\n tokenRenderer: TokenRenderer,\n selectMode: SelectModes,\n suggestionsUri: string,\n suggestionsUriBuilder: SuggestionUriBuilder,\n suggestionRenderer: SuggestionRenderer,\n minCharactersForSuggestion: number,\n allowCustomEntries: boolean,\n readonly: boolean,\n optional: boolean,\n showClearButton: boolean,\n enableTabulator: boolean,\n showSuggestionsOnFocus: boolean,\n requestDelay: number\n}\n\nenum SelectModes {\n SINGLE, MULTI, SEARCH\n}\n\ninterface SelectMode {\n addToken(suggestionValue: string | null, suggestionText: string | null, suggestionType: string | null, silent: boolean): void;\n\n handleInputAsValue(input: string): void;\n\n updateHasValue(): void;\n\n initEventListeners(): void;\n\n clear(silent: boolean): void;\n\n clearCurrentInput(): void;\n}\n\ninterface SingleSelect extends SelectMode {\n}\n\ninterface MultiSelect extends SelectMode {\n removeToken(token: HTMLSpanElement): void;\n\n removeLastToken(): void;\n\n removeTokenWithText(textContent: any): void;\n}\n\ninterface Autocomplete {\n suggestions: any;\n\n initEventListeners(): void;\n\n requestSuggestions(value: string): void;\n\n highlightSuggestionAtPosition(arg0: number): void;\n\n addSuggestion(suggestion: Suggestion, showSuggestions: boolean): void;\n\n clearSuggestions(): void;\n\n showSuggestions(): void;\n\n hideSuggestions(): void;\n\n loadSuggestions(): void;\n\n areSuggestionsDisplayed(): boolean;\n\n areSuggestionsActive(): boolean;\n\n highlightSuggestion(arg0: Element): void;\n\n dispatchSuggestionSelectedEvent(_suggestion: HTMLElement): void;\n}\n\ninterface TokenRenderer {\n (token: Token): HTMLElement;\n}\n\ninterface SuggestionRenderer {\n (suggestion: Suggestion): HTMLElement;\n}\n\ninterface SuggestionUriBuilder {\n (query: string): string;\n}\n\nclass TokenAutocomplete {\n\n KEY_BACKSPACE = 'Backspace';\n KEY_ENTER = 'Enter';\n KEY_TAB = 'Tab';\n KEY_UP = 'ArrowUp';\n KEY_DOWN = 'ArrowDown';\n KEY_LEFT = 'ArrowLeft';\n KEY_RIGHT = 'ArrowRight';\n KEY_ESC = 'Escape';\n\n options: Options;\n container: any;\n tokenContainer: HTMLDivElement;\n hiddenSelect: HTMLSelectElement;\n textInput: HTMLSpanElement;\n\n select: SelectMode;\n autocomplete: Autocomplete;\n\n defaults: Options = {\n name: '',\n selector: '',\n noMatchesText: null,\n noMatchesCustomEntriesDescription: null,\n placeholderText: 'enter some text',\n initialTokens: null,\n initialSuggestions: null,\n tokenRenderer: TokenAutocomplete.MultiSelect.defaultRenderer,\n suggestionsUri: '',\n selectMode: SelectModes.MULTI,\n suggestionsUriBuilder: function (query) {\n // We have to do this manually instead of using URL, as we can't be sure that a polyfill for IE11 is present\n const querySeparator = this.suggestionsUri.indexOf('?') >= 0 ? '&' : '?';\n return this.suggestionsUri + querySeparator + 'query=' + query;\n },\n suggestionRenderer: TokenAutocomplete.Autocomplete.defaultRenderer,\n minCharactersForSuggestion: 1,\n allowCustomEntries: true,\n readonly: false,\n optional: false,\n showClearButton: false,\n enableTabulator: true,\n showSuggestionsOnFocus: true,\n requestDelay: 200\n };\n log: any;\n\n constructor(options: Options) {\n this.options = {...this.defaults, ...options};\n\n let passedContainer = document.querySelector(this.options.selector);\n if (!passedContainer) {\n throw new Error('passed selector does not point to a DOM element.');\n }\n\n this.container = passedContainer;\n this.container.classList.add('token-autocomplete-container');\n\n this.tokenContainer = document.createElement('div');\n this.tokenContainer.classList.add('token-autocomplete-tokens');\n this.container.appendChild(this.tokenContainer);\n\n if (!Array.isArray(this.options.initialTokens) && !Array.isArray(this.options.initialSuggestions)) {\n this.parseTokensAndSuggestions();\n }\n\n this.hiddenSelect = document.createElement('select');\n this.hiddenSelect.id = this.container.id + '-select';\n this.hiddenSelect.name = this.options.name;\n this.hiddenSelect.setAttribute('multiple', 'true');\n this.hiddenSelect.setAttribute('autocomplete', 'off');\n this.hiddenSelect.style.display = 'none';\n\n // If the field is readonly, we don't want to show the clear button.\n if (this.options.readonly) {\n this.options.showClearButton = false;\n if (this.options.tokenRenderer === TokenAutocomplete.MultiSelect.defaultRenderer) {\n this.options.tokenRenderer = TokenAutocomplete.MultiSelect.defaultReadonlyRenderer;\n }\n }\n\n this.textInput = document.createElement('span');\n this.textInput.id = this.container.id + '-input';\n this.textInput.classList.add('token-autocomplete-input');\n if (!this.options.readonly) {\n if (this.options.placeholderText != null) {\n this.textInput.dataset.placeholder = this.options.placeholderText;\n }\n\n this.textInput.contentEditable = 'true';\n this.textInput.addEventListener(\"paste\", function (event) {\n event.preventDefault();\n if (event.clipboardData) {\n // Normal handling for modern browsers\n const text = event.clipboardData?.getData(\"text/plain\");\n document.execCommand(\"insertHTML\", false, text);\n } else {\n // Fallback logic for IE11\n const globalText = window.clipboardData?.getData(\"Text\");\n const range = document.getSelection()?.getRangeAt(0);\n range?.insertNode(document.createTextNode(globalText));\n }\n });\n } else {\n this.container.classList.add('token-autocomplete-readonly');\n }\n this.tokenContainer.appendChild(this.textInput);\n\n\n this.container.appendChild(this.hiddenSelect);\n this.addHiddenEmptyOption();\n\n if (this.options.selectMode == SelectModes.MULTI) {\n this.select = new TokenAutocomplete.MultiSelect(this);\n } else if (this.options.selectMode == SelectModes.SEARCH) {\n this.select = new TokenAutocomplete.SearchMultiSelect(this);\n } else if (this.options.selectMode == SelectModes.SINGLE) {\n this.hiddenSelect.removeAttribute('multiple');\n this.select = new TokenAutocomplete.SingleSelect(this);\n }\n this.autocomplete = new TokenAutocomplete.Autocomplete(this);\n\n this.select.initEventListeners();\n this.autocomplete.initEventListeners();\n\n this.debug(false);\n\n if (Array.isArray(this.options.initialTokens)) {\n this.val(this.options.initialTokens);\n }\n\n this.container.tokenAutocomplete = this as TokenAutocomplete;\n\n if (this.options.selectMode == SelectModes.SINGLE && !this.options.optional && this.val().length == 0) {\n this.autocomplete.loadSuggestions();\n }\n }\n\n /**\n * Searches the element given as a container for option elements and creates active tokens (when the option is marked selected)\n * and suggestions (all options found) from these. During this all found options are removed from the DOM.\n */\n parseTokensAndSuggestions() {\n let initialTokens: Array = [];\n let initialSuggestions: Array = [];\n\n let options: NodeListOf = this.container.querySelectorAll('option');\n\n let me = this;\n options.forEach(function (option) {\n if (option.text != null) {\n if (option.hasAttribute('selected')) {\n initialTokens.push({value: option.value, text: option.text, type: null});\n }\n initialSuggestions.push({\n id: null,\n value: option.value,\n fieldLabel: option.text,\n type: null,\n completionDescription: option.dataset.description || null,\n completionLabel: null,\n disabled: option.disabled || false\n });\n }\n me.container.removeChild(option);\n });\n\n if (initialSuggestions.length > 0) {\n this.options.initialSuggestions = initialSuggestions;\n if (!this.options.optional && initialTokens.length == 0) {\n let firstSuggestion = initialSuggestions[0];\n initialTokens.push({\n value: firstSuggestion.value, text: firstSuggestion.fieldLabel, type: firstSuggestion.type\n });\n }\n }\n\n if (initialTokens.length > 0) {\n this.options.initialTokens = initialTokens;\n }\n }\n\n /**\n * Clears the currently present tokens and creates new ones from the given input value, returns new tokens afterwards.\n *\n * The current tokens are only overwritten (cleared and added) when a value parameter is given.\n * In addition to the possibility of setting the value of the input this method also returns the values of all present tokens.\n *\n * @param {(Array|Token)} value - either the name of a single token or a list of tokens to create\n * @param {boolean} silent - whether appropriate events should be triggered when changing tokens or not\n *\n * @returns an array of the values of all current (after update) tokens of the input field\n */\n val(value: Array | Token | null = null, silent: boolean = false): Array {\n if (typeof value !== 'undefined' && value !== null) {\n this.select.clear(silent);\n this.addToken(value, silent);\n }\n\n let tokens: Array = [];\n this.hiddenSelect.querySelectorAll('option').forEach(option => {\n if (option.dataset.value != null && option.dataset.value !== \"\") {\n tokens.push(option.dataset.value);\n }\n });\n return tokens;\n }\n\n\n /**\n * Adds the given tokens to the field.\n *\n * The current tokens are only added when a value parameter is given.\n *\n * @param {(Array|Token)} value - either the name of a single token or a list of tokens to create\n * @param {boolean} silent - whether appropriate events should be triggered when changing tokens or not\n */\n addToken(value: Array | Token, silent: boolean = false) {\n if (Array.isArray(value)) {\n let me = this;\n value.forEach(function (token) {\n if (typeof token === 'object') {\n me.select.addToken(token.value, token.text, token.type, silent);\n }\n });\n } else {\n this.select.addToken(value.value, value.text, value.type, silent);\n }\n }\n\n /**\n * Returns the current text the user has input which is not converted into a token.\n */\n getCurrentInput() {\n return this.textInput.textContent || '';\n }\n\n setCurrentInput(input: string, silent: boolean) {\n this.textInput.textContent = input;\n this.select.updateHasValue();\n\n if (silent) {\n return;\n }\n\n this.container.dispatchEvent(new CustomEvent('query-changed', {\n detail: {\n query: input\n }\n }));\n }\n\n addHiddenOption(tokenValue: string, tokenText: string, tokenType: string | null, isLiveEntry: boolean = false) {\n tokenValue = tokenValue.trim();\n tokenText = tokenText.trim();\n let _emptyToken = this.hiddenSelect.querySelector('.empty-token');\n if (_emptyToken) {\n this.hiddenSelect.removeChild(_emptyToken);\n }\n let _existingLiveEntry = this.hiddenSelect.querySelector('.token-autocomplete-live-entry');\n if (_existingLiveEntry) {\n this.hiddenSelect.removeChild(_existingLiveEntry);\n }\n let _existingOption = this.findOptionWithValue(tokenValue);\n if (_existingOption) {\n this.hiddenSelect.removeChild(_existingOption);\n }\n const option = document.createElement('option');\n option.text = tokenText;\n option.value = tokenValue;\n option.selected = true;\n option.dataset.text = tokenText;\n option.dataset.value = tokenValue;\n if (tokenType != null) {\n option.dataset.type = tokenType;\n }\n if (isLiveEntry) {\n option.classList.add('token-autocomplete-live-entry');\n }\n this.hiddenSelect.add(option);\n }\n\n findOptionWithValue(optionValue: string) {\n for (let i = 0; i < this.hiddenSelect.options.length; i++) {\n let option = this.hiddenSelect.options[i];\n if (option.value === optionValue) {\n return option;\n }\n }\n return null;\n }\n\n addHiddenEmptyOption() {\n let _emptyToken = this.hiddenSelect.querySelector('.empty-token');\n if (_emptyToken) {\n _emptyToken.setAttribute('selected', 'true');\n } else {\n const _newOption = document.createElement('option');\n _newOption.text = '';\n _newOption.value = '';\n _newOption.selected = true;\n _newOption.classList.add('empty-token');\n this.hiddenSelect.add(_newOption);\n }\n }\n\n setPlaceholderText(placeholderText: string | undefined) {\n this.textInput.dataset.placeholder = placeholderText;\n }\n\n debug(state: boolean) {\n if (state) {\n this.log = console.log.bind(window.console);\n } else {\n this.log = function () {\n // Intentionally left empty to only log when debugging is enabled.\n }\n }\n }\n\n static MultiSelect = class implements MultiSelect {\n\n parent: TokenAutocomplete;\n container: any;\n tokenContainer: HTMLDivElement;\n options: Options;\n renderer: TokenRenderer;\n\n constructor(parent: TokenAutocomplete) {\n this.parent = parent;\n this.container = parent.container;\n this.tokenContainer = parent.tokenContainer;\n this.options = parent.options;\n this.renderer = parent.options.tokenRenderer;\n\n if (this.options.showClearButton) {\n let clearButton = document.createElement('span');\n clearButton.classList.add('token-autocomplete-delete-button');\n this.container.appendChild(clearButton);\n }\n }\n\n clearCurrentInput(): void {\n this.parent.textInput.textContent = '';\n }\n\n initEventListeners(): void {\n const me = this;\n const parent = this.parent;\n if (parent.options.readonly) {\n return;\n }\n\n let isComposing = false;\n parent.textInput.addEventListener('compositionstart', function (event) {\n isComposing = true;\n })\n parent.textInput.addEventListener('compositionend', function (event) {\n isComposing = false;\n\n // handles hitting ENTER on GBoard, which uses composition events instead of individual key triggers\n let inputString = event.data;\n if (inputString.charAt(inputString.length - 1) === \"\\n\") {\n event.preventDefault();\n me.handleInput(parent.autocomplete.suggestions.querySelector('.token-autocomplete-suggestion-highlighted'));\n }\n })\n\n parent.textInput.addEventListener('keydown', function (event) {\n if (isComposing) return;\n\n if (event.key == parent.KEY_ENTER || (event.key == parent.KEY_TAB && parent.options.enableTabulator && parent.autocomplete.areSuggestionsDisplayed() && parent.autocomplete.suggestions.childNodes.length == 1)) {\n event.preventDefault();\n\n let highlightedSuggestion = parent.autocomplete.suggestions.querySelector('.token-autocomplete-suggestion-highlighted');\n\n if (parent.options.enableTabulator && highlightedSuggestion == null && event.key == parent.KEY_TAB && parent.autocomplete.areSuggestionsDisplayed()) {\n highlightedSuggestion = parent.autocomplete.suggestions.firstChild;\n }\n\n me.handleInput(highlightedSuggestion);\n } else if (parent.getCurrentInput() === '' && event.key == parent.KEY_BACKSPACE) {\n event.preventDefault();\n me.removeLastToken();\n }\n if ((event.key == parent.KEY_DOWN || event.key == parent.KEY_UP) && parent.autocomplete.suggestions.childNodes.length > 0) {\n event.preventDefault();\n }\n });\n\n parent.textInput.addEventListener('keyup', function (event) {\n me.updateHasValue();\n });\n\n if (this.options.showClearButton) {\n parent.container.querySelector('.token-autocomplete-delete-button')?.addEventListener('click', function () {\n me.clear(true);\n me.clearCurrentInput();\n me.updateHasValue();\n\n me.container.dispatchEvent(new CustomEvent('input-cleared'));\n });\n }\n }\n\n handleInput(highlightedSuggestion: any): void {\n if (highlightedSuggestion !== null) {\n this.clearCurrentInput();\n if (highlightedSuggestion.classList.contains('token-autocomplete-suggestion-active')) {\n this.removeTokenWithText(highlightedSuggestion.dataset.tokenText);\n } else {\n if (highlightedSuggestion.dataset.becomesToken !== 'false') {\n this.addToken(highlightedSuggestion.dataset.value, highlightedSuggestion.dataset.tokenText, highlightedSuggestion.dataset.type, false);\n }\n this.parent.autocomplete.dispatchSuggestionSelectedEvent(highlightedSuggestion);\n }\n } else {\n this.handleInputAsValue(this.parent.getCurrentInput());\n }\n this.parent.autocomplete.clearSuggestions();\n this.parent.autocomplete.hideSuggestions();\n }\n\n /**\n * Updates the 'token-autocomplete-has-value' class of this MultiSelect autocomplete.\n */\n updateHasValue(): void {\n if (this.parent.getCurrentInput() === '' && this.parent.val().length === 0) {\n this.container.classList.remove('token-autocomplete-has-value');\n } else {\n this.container.classList.add('token-autocomplete-has-value');\n }\n }\n\n /**\n * Adds the current user input as a net token and resets the input area so new text can be entered.\n *\n * @param {string} input - the actual input the user entered\n */\n handleInputAsValue(input: string): void {\n if (input != '' && this.parent.options.allowCustomEntries) {\n this.clearCurrentInput();\n this.addToken(input, input, null);\n return;\n }\n if (this.parent.autocomplete.suggestions.childNodes.length === 1 && this.parent.autocomplete.suggestions.childNodes[0].dataset.value != '_no_match_') {\n this.parent.autocomplete.suggestions.firstChild.click();\n } else {\n this.clearCurrentInput();\n }\n }\n\n /**\n * Adds a token with the specified name to the list of currently present tokens displayed to the user and the hidden select.\n *\n * @param {string} tokenValue - the actual value of the token to create\n * @param {string} tokenText - the name of the token to create\n * @param {string} tokenType - the type of the token to create\n * @param {boolean} silent - whether an appropriate event should be triggered\n */\n addToken(tokenValue: string | null, tokenText: string | null, tokenType: string | null, silent: boolean = false) {\n if (tokenValue === null || tokenText === null || tokenValue === '_no_match_') {\n return;\n }\n\n tokenValue = tokenValue.trim();\n tokenText = tokenText.trim();\n\n this.parent.addHiddenOption(tokenValue, tokenText, tokenType);\n\n let addedToken = {\n value: tokenValue,\n text: tokenText,\n type: tokenType\n };\n\n let element = this.renderer(addedToken);\n\n let me = this;\n element.querySelector('.token-autocomplete-delete-button')?.addEventListener('click', function () {\n me.removeToken(element);\n });\n\n this.tokenContainer.insertBefore(element, this.parent.textInput);\n this.updateHasValue();\n\n if (!silent) {\n this.container.dispatchEvent(new CustomEvent('tokens-changed', {\n detail: {\n tokens: this.parent.val(),\n added: addedToken\n }\n }));\n }\n\n this.parent.log('added token', addedToken);\n }\n\n /**\n * Completely clears the currently present tokens from the field.\n */\n clear(silent: boolean = false) {\n let tokens: NodeListOf = this.tokenContainer.querySelectorAll('.token-autocomplete-token');\n\n let me = this;\n tokens.forEach(function (token) {\n me.removeToken(token, silent);\n });\n }\n\n /**\n * Removes the last token in the list of currently present token. This is the last added token next to the input field.\n */\n removeLastToken() {\n let tokens = this.tokenContainer.querySelectorAll('.token-autocomplete-token');\n let token = tokens[tokens.length - 1] as HTMLElement;\n if (token) {\n this.removeToken(token);\n }\n }\n\n /**\n * Removes the specified token from the list of currently present tokens.\n *\n * @param {Element} token - the token to remove\n * @param {boolean} silent - whether an appropriate event should be triggered\n */\n removeToken(token: HTMLElement, silent: boolean = false) {\n this.tokenContainer.removeChild(token);\n\n let tokenText = token.dataset.text;\n let hiddenOption = this.parent.hiddenSelect.querySelector('option[data-text=\"' + TokenAutocomplete.escapeQuotes(tokenText) + '\"]');\n hiddenOption?.parentElement?.removeChild(hiddenOption);\n\n let addedToken = {\n value: token.dataset.value,\n text: tokenText,\n type: token.dataset.type || null\n };\n\n if (!silent) {\n this.container.dispatchEvent(new CustomEvent('tokens-changed', {\n detail: {\n tokens: this.parent.val(),\n removed: addedToken\n }\n }));\n }\n\n if (this.parent.val().length === 0) {\n this.parent.addHiddenEmptyOption();\n }\n\n this.updateHasValue();\n\n this.parent.log('removed token', token.textContent);\n }\n\n removeTokenWithText(tokenText: string | null) {\n if (tokenText === null) {\n return;\n }\n let token = this.tokenContainer.querySelector('.token-autocomplete-token[data-text=\"' + TokenAutocomplete.escapeQuotes(tokenText) + '\"]') as HTMLElement;\n if (token !== null) {\n this.removeToken(token);\n }\n }\n\n static defaultRenderer: TokenRenderer = function (token: Token): HTMLElement {\n const chip = document.createElement('span');\n chip.classList.add('token-autocomplete-token');\n chip.dataset.text = token.text;\n chip.dataset.value = token.value;\n if (token.type != null) {\n chip.dataset.type = token.type;\n }\n chip.textContent = token.text;\n\n let deleteToken = document.createElement('span');\n deleteToken.classList.add('token-autocomplete-delete-button');\n chip.appendChild(deleteToken);\n\n return chip;\n }\n\n static defaultReadonlyRenderer: TokenRenderer = function (token: Token): HTMLElement {\n const chip = document.createElement('span');\n chip.classList.add('token-autocomplete-token');\n chip.dataset.text = token.text;\n chip.dataset.value = token.value;\n if (token.type != null) {\n chip.dataset.type = token.type;\n }\n chip.textContent = token.text;\n\n return chip;\n }\n }\n\n static SingleSelect = class implements SingleSelect {\n\n parent: TokenAutocomplete;\n container: any;\n options: Options;\n renderer: TokenRenderer;\n previousValue: any;\n previousText: any;\n previousType: any;\n\n constructor(parent: TokenAutocomplete) {\n this.parent = parent;\n this.container = parent.container;\n this.options = parent.options;\n\n this.container.classList.add('token-autocomplete-singleselect');\n this.parent.textInput.tabIndex = 0;\n if (this.options.optional) {\n let clearButton = document.createElement('span');\n clearButton.classList.add('token-autocomplete-delete-button');\n this.container.appendChild(clearButton);\n }\n }\n\n /**\n * Clears the current user input so new text can be entered.\n *\n * @param {boolean} silent - whether an appropriate event should be triggered\n * @param {boolean} keepPreviousValue - if true, the previous value will be stored and shown as a placeholder\n */\n clear(silent: boolean, keepPreviousValue = true): void {\n if (this.options.readonly) {\n return;\n }\n let me = this;\n let tokenText = me.parent.textInput.textContent;\n let hiddenOption = me.parent.hiddenSelect.querySelector('option[data-text=\"' + TokenAutocomplete.escapeQuotes(tokenText) + '\"]') as HTMLElement;\n\n this.container.classList.remove('token-autocomplete-has-value');\n\n const previousValue = hiddenOption?.dataset.value;\n const previousText = hiddenOption?.dataset.text;\n const previousType = hiddenOption?.dataset.type;\n if (keepPreviousValue) {\n me.previousValue = previousValue;\n me.previousText = previousText;\n me.previousType = previousType;\n if (hiddenOption == null && me.options.allowCustomEntries) {\n me.previousValue = tokenText;\n me.previousText = tokenText;\n }\n if (me.previousText && me.previousText !== '') {\n me.parent.textInput.dataset.placeholder = me.previousText;\n }\n } else {\n // We should reset these fields, so they are not used to restore the previously selected value\n // when the focusout event is handled after the click event on the suggestion.\n delete me.previousValue;\n delete me.previousText;\n delete me.previousType;\n if (me.parent.options.placeholderText != null) {\n me.parent.textInput.dataset.placeholder = me.parent.options.placeholderText;\n }\n }\n hiddenOption?.parentElement?.removeChild(hiddenOption);\n me.parent.addHiddenEmptyOption();\n me.parent.textInput.textContent = '';\n me.parent.textInput.contentEditable = 'true';\n\n if (!silent) {\n this.container.dispatchEvent(new CustomEvent('tokens-changed', {\n detail: {\n tokens: this.parent.val(),\n removed: {\n value: previousValue,\n text: previousText,\n type: previousType\n }\n }\n }));\n }\n }\n\n /**\n * Adds the current user input as a net token and resets the input area so new text can be entered.\n *\n * @param {string} input - the actual input the user entered\n */\n handleInputAsValue(input: string): void {\n if (input != '' && this.parent.options.allowCustomEntries) {\n this.clearCurrentInput();\n this.addToken(input, input, null, false);\n this.parent.autocomplete.clearSuggestions();\n this.parent.autocomplete.hideSuggestions();\n return;\n }\n if (this.parent.autocomplete.suggestions.childNodes.length === 1 && this.parent.autocomplete.suggestions.childNodes[0].dataset.value != '_no_match_') {\n this.parent.autocomplete.suggestions.firstChild.click();\n return;\n }\n this.clear(true, false);\n }\n\n clearCurrentInput(): void {\n this.clear(true);\n }\n\n /**\n * Updates the 'token-autocomplete-has-value' class of this SingleSelect autocomplete.\n */\n updateHasValue(): void {\n if (this.parent.getCurrentInput() === '' && this.parent.val().length === 0) {\n this.container.classList.remove('token-autocomplete-has-value');\n } else {\n this.container.classList.add('token-autocomplete-has-value');\n }\n }\n\n addToken(tokenValue: string | null, tokenText: string | null, tokenType: string | null, silent: boolean): void {\n if (tokenValue === null || tokenText === null || tokenValue === '_no_match_') {\n return;\n }\n\n tokenValue = tokenValue.trim();\n tokenText = tokenText.trim();\n\n this.clear(true, false);\n this.parent.textInput.textContent = tokenText;\n this.parent.textInput.contentEditable = 'false';\n this.parent.textInput.blur();\n if (tokenText !== '') {\n this.container.classList.add('token-autocomplete-has-value');\n }\n\n this.parent.addHiddenOption(tokenValue, tokenText, tokenType);\n\n if (!silent) {\n this.container.dispatchEvent(new CustomEvent('tokens-changed', {\n detail: {\n tokens: this.parent.val(),\n added: {\n value: tokenValue,\n text: tokenText,\n type: tokenType\n }\n }\n }));\n }\n }\n\n initEventListeners(): void {\n const me = this;\n const parent = this.parent;\n if (parent.options.readonly) {\n return;\n }\n\n parent.textInput.addEventListener('compositionend', function (event) {\n // handles hitting ENTER on GBoard, which uses composition events instead of individual key triggers\n let inputString = event.data;\n if (inputString.charAt(inputString.length - 1) === \"\\n\") {\n event.preventDefault();\n me.handleInput(parent.autocomplete.suggestions.querySelector('.token-autocomplete-suggestion-highlighted'));\n }\n })\n\n parent.textInput.addEventListener('keydown', function (event) {\n if (event.key == parent.KEY_ENTER || (event.key == parent.KEY_TAB && parent.options.enableTabulator && parent.autocomplete.areSuggestionsDisplayed() && parent.autocomplete.suggestions.childNodes.length == 1)) {\n event.preventDefault();\n\n let highlightedSuggestion = parent.autocomplete.suggestions.querySelector('.token-autocomplete-suggestion-highlighted');\n\n if (parent.options.enableTabulator && highlightedSuggestion == null && event.key == parent.KEY_TAB && parent.autocomplete.areSuggestionsDisplayed()) {\n highlightedSuggestion = parent.autocomplete.suggestions.firstChild;\n }\n\n me.handleInput(highlightedSuggestion);\n }\n if ((event.key == parent.KEY_DOWN || event.key == parent.KEY_UP) && parent.autocomplete.suggestions.childNodes.length > 0) {\n event.preventDefault();\n }\n });\n\n if (parent.options.allowCustomEntries) {\n parent.textInput.addEventListener('keyup', function (event) {\n if (event.key != parent.KEY_ENTER && event.key != parent.KEY_TAB && event.key != parent.KEY_DOWN && event.key != parent.KEY_UP) {\n event.preventDefault();\n parent.addHiddenOption(parent.getCurrentInput(), parent.getCurrentInput(), null, true);\n }\n });\n }\n\n function focusInput() {\n if (!parent.autocomplete.areSuggestionsDisplayed() && parent.options.showSuggestionsOnFocus) {\n parent.autocomplete.showSuggestions();\n parent.autocomplete.loadSuggestions();\n }\n // move the cursor into the editable div\n const selection = window.getSelection();\n const range = document.createRange();\n selection?.removeAllRanges();\n range.selectNodeContents(parent.textInput);\n range.collapse(false);\n selection?.addRange(range);\n parent.textInput.focus();\n }\n\n parent.textInput.addEventListener('click', function () {\n focusInput();\n });\n\n parent.textInput.addEventListener('focusout', function () {\n // Using setTimeout here seems hacky on first sight but ensures proper order of events / handling.\n // We first want to handle a click on a suggestion (when one is made) before hiding the suggestions on focusout of the input.\n // Not doing so could mean the suggestion is hidden before the click is handled und thus resulting in not being selected.\n // This depends on the order in which a browser handles different events and when it sets the active pseudo-selector on clicked events (Firefox for example)\n setTimeout(function () {\n if (parent.autocomplete.areSuggestionsActive()) {\n return;\n }\n const input = me.parent.getCurrentInput();\n if (me.parent.val().length !== 0 && me.parent.val()[0] !== '') {\n return;\n }\n if (input != '') {\n me.handleInputAsValue(input);\n return;\n }\n if (me.previousValue) {\n me.addToken(me.previousValue, me.previousText, me.previousType, true);\n }\n }, 0);\n\n });\n parent.container.querySelector('.token-autocomplete-delete-button')?.addEventListener('click', function () {\n me.clear(false, false);\n });\n }\n\n handleInput(highlightedSuggestion: any): void {\n if (highlightedSuggestion !== null) {\n this.addToken(highlightedSuggestion.dataset.value, highlightedSuggestion.dataset.tokenText, highlightedSuggestion.dataset.type, false);\n } else {\n this.handleInputAsValue(this.parent.getCurrentInput());\n }\n this.parent.autocomplete.clearSuggestions();\n this.parent.autocomplete.hideSuggestions();\n }\n }\n\n static SearchMultiSelect = class extends TokenAutocomplete.MultiSelect {\n /**\n * Instead of adding the custom user input as a token and handling it as a filter we let it remain in the input\n * area and instead send an event so the user search request can be handled / executed.\n *\n * @param {string} input - the actual input the user entered\n */\n handleInputAsValue(input: string) {\n this.container.dispatchEvent(new CustomEvent('query-changed', {\n detail: {\n query: input\n }\n }));\n }\n }\n\n static Autocomplete = class implements Autocomplete {\n\n parent: TokenAutocomplete;\n container: any;\n options: Options;\n suggestions: HTMLUListElement;\n renderer: SuggestionRenderer;\n request: XMLHttpRequest | null;\n timeout: number | undefined;\n\n constructor(parent: TokenAutocomplete) {\n this.parent = parent;\n this.container = parent.container;\n this.options = parent.options;\n this.renderer = parent.options.suggestionRenderer;\n\n this.suggestions = document.createElement('ul');\n this.suggestions.id = this.container.id + '-suggestions';\n this.suggestions.classList.add('token-autocomplete-suggestions');\n\n this.container.appendChild(this.suggestions);\n }\n\n initEventListeners() {\n let me = this;\n if (me.parent.options.readonly) {\n return;\n }\n me.parent.textInput.addEventListener('keyup', function (event) {\n if (event.key == me.parent.KEY_ESC) {\n me.hideSuggestions();\n me.parent.textInput.blur();\n return;\n }\n if (event.key == me.parent.KEY_UP && me.suggestions.childNodes.length > 0) {\n event.preventDefault();\n let highlightedSuggestion = me.suggestions.querySelector('.token-autocomplete-suggestion-highlighted');\n if (highlightedSuggestion == null) {\n // highlight last entry and scroll to bottom\n me.highlightSuggestionAtPosition(me.suggestions.childNodes.length - 1);\n me.suggestions.scrollTop = me.suggestions.scrollHeight;\n return;\n }\n let aboveSuggestion = highlightedSuggestion.previousSibling;\n if (aboveSuggestion != null) {\n // if the suggestions is above the scroll position, scroll to the suggestion\n let suggestionTop = (aboveSuggestion as HTMLElement).offsetTop;\n if (me.suggestions.scrollTop > suggestionTop) {\n me.suggestions.scrollTop = suggestionTop;\n }\n me.highlightSuggestion(aboveSuggestion as Element);\n } else {\n highlightedSuggestion.classList.remove('token-autocomplete-suggestion-highlighted');\n }\n return;\n }\n if (event.key == me.parent.KEY_DOWN && me.suggestions.childNodes.length > 0) {\n event.preventDefault();\n let highlightedSuggestion = me.suggestions.querySelector('.token-autocomplete-suggestion-highlighted');\n if (highlightedSuggestion == null) {\n // highlight first entry and scroll to top\n me.highlightSuggestionAtPosition(0);\n me.suggestions.scrollTop = 0;\n return;\n }\n let belowSuggestion = highlightedSuggestion?.nextSibling;\n if (belowSuggestion != null) {\n // if the suggestions is not completely visible, scroll until the suggestion is at the bottom\n let suggestionBottom = (belowSuggestion as HTMLElement).offsetTop + (belowSuggestion as HTMLElement).offsetHeight;\n if (me.suggestions.scrollTop + me.suggestions.clientHeight < suggestionBottom) {\n me.suggestions.scrollTop = suggestionBottom - me.suggestions.clientHeight;\n }\n me.highlightSuggestion(belowSuggestion as Element);\n } else {\n highlightedSuggestion.classList.remove('token-autocomplete-suggestion-highlighted');\n }\n return;\n }\n if (event.key == me.parent.KEY_LEFT || event.key == me.parent.KEY_RIGHT || event.key == me.parent.KEY_ENTER || event.key == me.parent.KEY_TAB) {\n // We don't want to re-trigger the autocompletion when the user navigates the cursor inside the input.\n return;\n }\n me.loadSuggestions();\n });\n me.parent.textInput.addEventListener('focusout', function () {\n // Using setTimeout here seems hacky on first sight but ensures proper order of events / handling.\n // We first want to handle a click on a suggestion (when one is made) before hiding the suggestions on focusout of the input.\n // Not doing so could mean the suggestion is hidden before the click is handled und thus resulting in not being selected.\n // This depends on the order in which a browser handles different events and when it sets the active pseudo-selector on clicked events (Firefox for example)\n setTimeout(function () {\n if (me.areSuggestionsActive()) {\n return;\n }\n me.hideSuggestions();\n }, 0);\n });\n me.parent.textInput.addEventListener('focusin', function () {\n if (me.options.showSuggestionsOnFocus) {\n me.loadSuggestions();\n me.showSuggestions();\n }\n });\n }\n\n loadSuggestions() {\n let me = this;\n let value = me.parent.getCurrentInput();\n\n if (me.parent.options.selectMode == SelectModes.SINGLE) {\n if (!me.parent.textInput.isContentEditable) {\n me.parent.select.clear(true);\n value = \"\";\n }\n } else if (value.length < me.parent.options.minCharactersForSuggestion) {\n me.clearSuggestions();\n me.hideSuggestions();\n return;\n }\n if (me.parent.options.suggestionsUri.length > 0) {\n me.requestSuggestions(value);\n return;\n }\n if (Array.isArray(me.parent.options.initialSuggestions)) {\n me.clearSuggestions();\n me.parent.options.initialSuggestions.forEach(function (suggestion) {\n if (typeof suggestion !== 'object') {\n // The suggestion is of wrong type and therefore ignored.\n return;\n }\n let text = suggestion.fieldLabel;\n if (value.length == 0 && me.options.selectMode == SelectModes.SINGLE && !me.options.optional && !me.areSuggestionsDisplayed()) {\n me.addSuggestion(suggestion, false);\n } else if (value.localeCompare(text.slice(0, value.length), undefined, {sensitivity: 'base'}) === 0) {\n // The suggestion starts with the query text the user entered and will be displayed.\n me.addSuggestion(suggestion);\n }\n });\n if (me.suggestions.childNodes.length == 0) {\n if (me.parent.options.allowCustomEntries && me.parent.options.noMatchesCustomEntriesDescription) {\n me.addSuggestion({\n id: null,\n value: value,\n fieldLabel: value,\n type: '_no_match_',\n completionDescription: me.parent.options.noMatchesCustomEntriesDescription,\n completionLabel: null,\n disabled: true\n });\n\n } else if (me.parent.options.noMatchesText) {\n me.addSuggestion({\n id: null,\n value: '_no_match_',\n fieldLabel: me.parent.options.noMatchesText,\n type: '_no_match_',\n completionDescription: null,\n completionLabel: null,\n disabled: true\n });\n }\n }\n }\n }\n\n /**\n * Hides the suggestions dropdown from the user.\n */\n hideSuggestions() {\n // as the suggestions will be re-shown if a pending request is executed, we abort them if we want to hide\n this.abortPendingRequest();\n this.container.classList.remove('token-autocomplete-suggestions-displayed');\n this.suggestions.style.display = '';\n\n let _highlightedSuggestions = this.suggestions.querySelectorAll('li.token-autocomplete-suggestion-highlighted');\n _highlightedSuggestions.forEach(function (_suggestion) {\n _suggestion.classList.remove('token-autocomplete-suggestion-highlighted');\n })\n }\n\n /**\n * Shows the suggestions dropdown to the user.\n */\n showSuggestions() {\n this.container.classList.add('token-autocomplete-suggestions-displayed');\n this.suggestions.style.display = 'block';\n\n const inputBottomPosition = this.parent.textInput.getBoundingClientRect().bottom;\n const suggestionsHeight = this.suggestions.offsetHeight;\n const viewportHeight = window.innerHeight;\n const spaceBelow = viewportHeight - inputBottomPosition;\n if (spaceBelow < suggestionsHeight) {\n this.suggestions.classList.add('token-autocomplete-suggestions-above');\n } else {\n this.suggestions.classList.remove('token-autocomplete-suggestions-above');\n }\n }\n\n areSuggestionsDisplayed() {\n return this.suggestions.style.display === 'block';\n }\n\n highlightSuggestionAtPosition(index: number) {\n let _suggestions = this.suggestions.querySelectorAll('li');\n _suggestions.forEach(function (_suggestion) {\n _suggestion.classList.remove('token-autocomplete-suggestion-highlighted');\n })\n _suggestions[index].classList.add('token-autocomplete-suggestion-highlighted');\n }\n\n highlightSuggestion(_suggestion: Element) {\n this.suggestions.querySelectorAll('li.token-autocomplete-suggestion-highlighted').forEach(function (_highlightedSuggestion) {\n _highlightedSuggestion.classList.remove('token-autocomplete-suggestion-highlighted');\n })\n _suggestion.classList.add('token-autocomplete-suggestion-highlighted');\n }\n\n /**\n * Checks for the presence of a suggestion that is currently clicked via mouse (active).\n */\n areSuggestionsActive() {\n return !!this.suggestions.querySelector('li:active');\n }\n\n /**\n * Removes all previous suggestions from the dropdown.\n */\n clearSuggestions() {\n this.abortPendingRequest();\n this.suggestions.innerHTML = '';\n }\n\n /**\n * Aborts currently in progress or scheduled suggestions requests.\n */\n abortPendingRequest() {\n this.request?.abort();\n clearTimeout(this.timeout);\n }\n\n /**\n * Loads suggestions matching the given query from the rest service behind the URI given as an option while initializing the field.\n *\n * @param query the query to search suggestions for\n */\n requestSuggestions(query: string) {\n let me = this;\n clearTimeout(me.timeout);\n if (!me.timeout) {\n me.debouncedRequestSuggestions.call(me, query);\n me.timeout = window.setTimeout(function () {\n delete me.timeout;\n }, me.parent.options.requestDelay);\n } else {\n me.timeout = window.setTimeout(function () {\n delete me.timeout;\n me.debouncedRequestSuggestions.call(me, query);\n }, me.parent.options.requestDelay);\n }\n }\n\n dispatchSuggestionSelectedEvent(_suggestion: HTMLElement) {\n _suggestion.dispatchEvent(new CustomEvent('suggestion-selected', {\n detail: {\n value: _suggestion.dataset.value,\n text: _suggestion.dataset.text,\n type: _suggestion.dataset.type || null\n }\n }));\n }\n\n debouncedRequestSuggestions(query: string) {\n let me = this;\n\n if (me.request != null && me.request.readyState) {\n me.request.abort();\n }\n\n me.request = new XMLHttpRequest();\n me.request.onload = function () {\n me.request = null;\n\n me.clearSuggestions();\n\n let answer = this.response;\n // IE 11 doesn't properly respect content type header, need to parse json string by hand.\n if (typeof answer === 'string') {\n answer = JSON.parse(answer);\n }\n\n if (Array.isArray(answer.completions)) {\n if (me.parent.val().length == 0 && answer.completions.length > 0 && me.options.selectMode == SelectModes.SINGLE && !me.options.optional && !me.areSuggestionsDisplayed()) {\n answer.completions.forEach(function (suggestion: Suggestion) {\n me.addSuggestion(suggestion, false);\n });\n let firstSuggestion = answer.completions[0] as Suggestion;\n let value = firstSuggestion.id || firstSuggestion.value;\n me.parent.select.addToken(value, firstSuggestion.fieldLabel, firstSuggestion.type, true);\n return;\n }\n answer.completions.forEach(function (suggestion: Suggestion) {\n me.addSuggestion(suggestion);\n });\n if (me.suggestions.childNodes.length == 0) {\n if (me.parent.options.allowCustomEntries && me.parent.options.noMatchesCustomEntriesDescription) {\n me.addSuggestion({\n id: null,\n value: query,\n fieldLabel: query,\n type: '_no_match_',\n completionDescription: me.parent.options.noMatchesCustomEntriesDescription,\n completionLabel: null,\n disabled: true\n });\n\n } else if (me.parent.options.noMatchesText) {\n me.addSuggestion({\n id: null,\n value: '_no_match_',\n fieldLabel: me.parent.options.noMatchesText,\n type: '_no_match_',\n completionDescription: null,\n completionLabel: null,\n disabled: true\n });\n }\n }\n }\n };\n let suggestionsUri = me.options.suggestionsUriBuilder(query);\n me.request.open('GET', suggestionsUri, true);\n me.request.responseType = 'json';\n me.request.setRequestHeader('Content-type', 'application/json');\n me.request.send();\n }\n\n /**\n * Adds a suggestion with the given text matching the users input to the dropdown.\n *\n * @param {string} suggestion - the metadata of the suggestion that should be added\n * @param showSuggestions - if the suggestions box should be shown, default true\n */\n addSuggestion(suggestion: Suggestion, showSuggestions = true) {\n let element = this.renderer(suggestion);\n\n let value = suggestion.id || suggestion.value;\n let text = suggestion.completionLabel || suggestion.fieldLabel;\n\n element.dataset.value = value;\n element.dataset.text = text;\n element.dataset.tokenText = suggestion.fieldLabel;\n if (suggestion.type != null) {\n element.dataset.type = suggestion.type;\n }\n\n let me = this;\n element.addEventListener('click', function (_event: Event) {\n if (value == '_no_match_' || suggestion.disabled) {\n return;\n }\n if (me.parent.options.selectMode == SelectModes.SINGLE) {\n if (element.classList.contains('token-autocomplete-suggestion-active')) {\n me.parent.select.clear(false);\n } else {\n if (element.dataset.becomesToken !== 'false') {\n me.parent.select.addToken(value, suggestion.fieldLabel, suggestion.type, false);\n }\n me.dispatchSuggestionSelectedEvent(element);\n }\n } else {\n me.parent.select.clearCurrentInput();\n if (element.classList.contains('token-autocomplete-suggestion-active')) {\n let multiSelect = me.parent.select as MultiSelect;\n multiSelect.removeTokenWithText(suggestion.fieldLabel);\n } else {\n if (element.dataset.becomesToken !== 'false') {\n me.parent.select.addToken(value, suggestion.fieldLabel, suggestion.type, false);\n }\n me.dispatchSuggestionSelectedEvent(element);\n }\n }\n me.clearSuggestions();\n me.hideSuggestions();\n });\n\n if (suggestion.disabled) {\n element.classList.add('token-autocomplete-suggestion-disabled');\n }\n\n if (this.parent.tokenContainer.querySelector('.token-autocomplete-token[data-value=\"' + value + '\"]') !== null) {\n element.classList.add('token-autocomplete-suggestion-active');\n }\n\n this.suggestions.appendChild(element);\n if (showSuggestions) {\n this.showSuggestions();\n }\n\n me.parent.log('added suggestion', suggestion);\n }\n\n static defaultRenderer: SuggestionRenderer = function (suggestion: Suggestion): HTMLElement {\n let option = document.createElement('li');\n option.textContent = suggestion.completionLabel || suggestion.fieldLabel;\n\n if (suggestion.completionDescription) {\n let description = document.createElement('small');\n description.textContent = suggestion.completionDescription;\n description.classList.add('token-autocomplete-suggestion-description');\n option.appendChild(description);\n }\n\n return option;\n }\n }\n\n static escapeQuotes(text: string | null | undefined): string {\n return text?.replace(/\\x22/g, '\\\\\\x22') ?? '';\n }\n}\n"]} \ No newline at end of file