import { AutoComplete, FILTER_CONTAINS, FILTER_STARTSWITH } from "../converse-autocomplete.js"; import { CustomElement } from './element.js'; import { html } from 'lit-element'; import { api } from "@converse/headless/converse-core"; 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`