import AutoComplete from './autocomplete.js'; import { CustomElement } from 'shared/components/element.js'; import { FILTER_CONTAINS, FILTER_STARTSWITH } from './utils.js'; import { api } from '@converse/headless/core'; import { html } from 'lit-element'; export default class AutoCompleteComponent extends CustomElement { static get properties () { return { 'getAutoCompleteList': { type: Function }, 'auto_evaluate': { type: Boolean }, 'auto_first': { type: Boolean }, // Should the first element be automatically selected? 'filter': { type: String }, 'include_triggers': { type: String }, 'min_chars': { type: Number }, 'name': { type: String }, 'placeholder': { type: String }, 'triggers': { type: String } }; } constructor () { super(); this.auto_evaluate = true; // Should evaluation happen automatically without any particular key as trigger? this.auto_first = false; // Should the first element be automatically selected? this.filter = 'contains'; this.include_triggers = ''; // Space separated chars which should be included in the returned value this.match_current_word = false; // Match only the current word, otherwise all input is matched this.max_items = 10; this.min_chars = 1; this.triggers = ''; // String of space separated chars } render () { return html`