diff --git a/src/modals/templates/add-contact.js b/src/modals/templates/add-contact.js index 69a614880..d57337a44 100644 --- a/src/modals/templates/add-contact.js +++ b/src/modals/templates/add-contact.js @@ -46,7 +46,7 @@ export default (el) => {
- +
${i18n_error_message}
diff --git a/src/plugins/muc-views/templates/ad-hoc.js b/src/plugins/muc-views/templates/ad-hoc.js index f9dd49901..ecfd97108 100644 --- a/src/plugins/muc-views/templates/ad-hoc.js +++ b/src/plugins/muc-views/templates/ad-hoc.js @@ -22,7 +22,7 @@ export default (o) => { + name="jid">
diff --git a/src/plugins/muc-views/templates/add-muc.js b/src/plugins/muc-views/templates/add-muc.js index 1fbb7be97..ba53f137c 100644 --- a/src/plugins/muc-views/templates/add-muc.js +++ b/src/plugins/muc-views/templates/add-muc.js @@ -38,7 +38,7 @@ export default (o) => { + name="chatroom"> ${ o.muc_roomid_policy_hint ? html`
${unsafeHTML(DOMPurify.sanitize(o.muc_roomid_policy_hint, {'ALLOWED_TAGS': ['b', 'br', 'em']}))}
` : '' } ${ !api.settings.get('locked_muc_nickname') ? nickname_input(o) : '' } diff --git a/src/shared/autocomplete/component.js b/src/shared/autocomplete/component.js index 873fe9183..138b1f209 100644 --- a/src/shared/autocomplete/component.js +++ b/src/shared/autocomplete/component.js @@ -4,13 +4,46 @@ import { FILTER_CONTAINS, FILTER_STARTSWITH } from './utils.js'; import { api } from '@converse/headless/core'; import { html } from 'lit'; + +/** + * A custom element that can be used to add auto-completion suggestions to a form input. + * @class AutoCompleteComponent + * + * @property { Boolean } [autofocus=false] + * Should the `focus` attribute be set on the input element? + * @property { Function } getAutoCompleteList + * A function that returns the list of autocomplete suggestions + * @property { Boolean } [auto_evaluate=true] + * Should evaluation happen automatically without any particular key as trigger? + * @property { Boolean } [auto_first=false] + * Should the first element automatically be selected? + * @property { "contains" | "startswith" } [filter="contains"] + * Provide matches which contain the entered text, or which starts with the entered text + * @property { String } [include_triggers=""] + * Space separated characters which should be included in the returned value + * @property { Number } [min_chars=1] + * The minimum number of characters to be entered into the input before autocomplete starts. + * @property { String } [name] + * The `name` attribute of the `input` element + * @property { String } [placeholder] + * The `placeholder` attribute of the `input` element + * @property { String } [triggers] + * String of space separated characters which trigger autocomplete + * + * @example + * + * + */ export default class AutoCompleteComponent extends CustomElement { static get properties () { return { 'autofocus': { type: Boolean }, 'getAutoCompleteList': { type: Function }, 'auto_evaluate': { type: Boolean }, - 'auto_first': { type: Boolean }, // Should the first element be automatically selected? + 'auto_first': { type: Boolean }, 'filter': { type: String }, 'include_triggers': { type: String }, 'min_chars': { type: Number }, @@ -22,14 +55,15 @@ export default class AutoCompleteComponent extends CustomElement { 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.position = "above"; + this.auto_evaluate = true; + this.auto_first = false; this.filter = 'contains'; - this.include_triggers = ''; // Space separated chars which should be included in the returned value + this.include_triggers = ''; 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 + this.triggers = ''; } render () {