/*!
 * Custom elements for Nanopore-Digital Web applications
 */
import { Build, Host, } from "@stencil/core";
import { closestElement } from "../../utils/dom";
import { debounceEvent } from "../../utils/throttle";
import { FormControl, FormControlWrap } from "../form-control/form-control";
import { h, transformTag } from "../../utils/renderer";
let inputIds = 0;
/**
 * Inputs collect text data from the user.
 *
 * @status stable
 * @version 1.0.0
 *
 * @slot start - suitable for inline action buttons or icons that may add extra contextual information
 * @slot end - suitable for inline action buttons or icons that may add extra contextual information
 * @slot value-start - similar to 'start', however clicking elements using this slot will activate the input control. This would be suitable to show a secondary 'value' for context or to show a dropdown arrow if using a datalist
 * @slot value-end - similar to 'end', however clicking elements using this slot will activate the input control. This would be suitable to show a secondary 'value' for context or to show a dropdown arrow if using a datalist
 * @slot label - if you do not set a label attribute, you can use this slot for more complex markup
 * @slot helper - helper text to accompany the form field underneath.
 * @slot helper-end - helper text to accompany the form field on the side.
 * @slot - can be used with a `nano-datalist`. See the `nano-datalist` docs for more information
 */
export class Input {
    nativeInput;
    inputId = `nano-input-${inputIds++}`;
    didBlurAfterEdit = false;
    rtl = false;
    mo;
    charCount = 0;
    hasRendered = false;
    pickerDropdown;
    picker;
    pickerCloseBtn;
    shouldValidate = false;
    // we don't want these rendered eles decorated with @State
    // because that will cause re-renders. User get/set to set datalist options
    _nativeInputWrap;
    get nativeInputWrap() {
        return this._nativeInputWrap;
    }
    set nativeInputWrap(ele) {
        if (this._nativeInputWrap === ele)
            return;
        this._nativeInputWrap = ele;
        this.setDataListOpts();
    }
    constructor() {
        this.handleBlur = this.handleBlur.bind(this);
    }
    hasFocus = false;
    hasLabelSlot = false;
    hasHelperSlot = false;
    hasHelperEndSlot = false;
    errorMessage = '';
    datalist = null;
    setDataListOpts() {
        if (!this.datalist)
            return;
        const currDWConfig = this.datalist.dropDownConfig || {};
        this.datalist.dropDownConfig = {
            distance: 10,
            ...currDWConfig,
            skidding: -1,
            tetherTo: this.nativeInputWrap,
        };
    }
    el;
    /**
     * This will be true when the control is in an invalid state.
     * Validity is determined by the `required` prop. Or if custom validity message is set. @readonly
     */
    get invalid() {
        return this._invalid;
    }
    _invalid = null;
    /**
     * Current validation message - if any. @readonly
     */
    get validityMessage() {
        if (!this.nativeInput)
            return '';
        return this.nativeInput.validationMessage;
    }
    /**
     * If the value of the type attribute is `"file"`, then this attribute will indicate the types of files that the server accepts, otherwise it will be ignored. The value must be a comma-separated list of unique content type specifiers.
     */
    accept;
    /**
     * Indicates whether and how the text value should be automatically capitalized as it is entered/edited by the user.
     */
    autocapitalise = 'none';
    /**
     * Indicates whether the value of the control can be automatically completed by the browser.
     */
    autocomplete = 'off';
    /**
     * Whether auto correction should be enabled when the user is entering/editing the text value.
     */
    autocorrect = 'off';
    /**
     * This Boolean attribute lets you specify that a form control should have input focus when the page loads.
     */
    autofocus = false;
    /**
     * If `true`, a clear icon will appear in the input when there is a value. Clicking it clears the input.
     */
    clearable = false;
    /**
     * If `true`, the value will be cleared after focus upon edit. Defaults to `true` when `type` is `"password"`, `false` for all other types.
     */
    clearOnEdit;
    /**
     * Set the amount of time, in milliseconds, to wait to trigger the `nanoChange` event after each keystroke.
     */
    debounce = 0;
    debounceChanged() {
        this.nanoChange = debounceEvent(this.nanoChange, this.debounce);
    }
    /**
     * If `true`, the user cannot interact with the input.
     */
    disabled = false;
    /**
     * A hint to the browser for which keyboard to display.
     * Possible values: `"none"`, `"text"`, `"tel"`, `"url"`,
     * `"email"`, `"numeric"`, `"decimal"`, and `"search"`.
     */
    inputmode;
    /**
     * When should the field perform validation
     */
    validateOn = 'submitThenDirty';
    /**
     * Whether to show validation errors underneath input
     */
    showInlineError = true;
    _label = '';
    /**
     * String to place within a label element. Alternatively you may use a label slot.
     */
    get label() {
        return this.required && !this._label.endsWith('*')
            ? this._label + ' *'
            : this._label;
    }
    set label(value) {
        this._label = value;
    }
    /**
     * Sometimes it can be helpful to always show the placeholder, even when the input has a value.
     * For example a postcode field could have a placeholder `e.g. LD1 1AA` which is helpful to show.
     */
    alwaysShowPlaceholder = false;
    /**
     * Visually hide the label - but make it accessible.
     */
    hideLabel = false;
    /**
     * Enable floating label behaviour. Will disable placeholder if set.
     */
    floatLabel = false;
    /**
     * The maximum value, which must not be less than its minimum (min attribute) value.
     */
    max;
    /**
     * If the value of the type attribute is `text`, `email`, `search`, `password`, `tel`, or `url`, this attribute specifies the maximum number of characters that the user can enter.
     */
    maxlength;
    /**
     * The minimum value, which must not be greater than its maximum (max attribute) value.
     */
    min;
    /**
     * If the value of the type attribute is `text`, `email`, `search`, `password`, `tel`, or `url`, this attribute specifies the minimum number of characters that the user can enter.
     */
    minlength;
    /**
     * If `true`, the user can enter more than one value. This attribute applies when the type attribute is set to `"email"` or `"file"`, otherwise it is ignored.
     */
    multiple;
    /**
     * The name of the control, which is submitted with the form data.
     */
    name = this.inputId;
    /**
     * A regular expression that the value is checked against. The pattern must match the entire value, not just some subset. Use the title attribute to describe the pattern to help the user. This attribute applies when the value of the type attribute is `"text"`, `"search"`, `"tel"`, `"url"`, `"email"`, or `"password"`, otherwise it is ignored.
     */
    pattern;
    /**
     * Instructional text that shows before the input has a value.
     */
    placeholder;
    /**
     * If `true`, the user cannot modify the value.
     */
    readonly = false;
    /**
     * If `true`, the user must fill in a value before submitting a form.
     * By default, setting this will also add an asterisk to the label.
     */
    required = false;
    /**
     * If `true`, the element will have its spelling and grammar checked.
     */
    spellcheck = false;
    /**
     * Works with the min and max attributes to limit the increments at which a value can be set.
     * Possible values are: `"any"` or a positive floating point number.
     */
    step;
    /**
     * The initial size of the control. This value is in pixels unless the value of the type attribute
     * is `"text"` or `"password"`, in which case it is an integer number of characters.
     * This attribute applies only when the `type` attribute is set to `"text"`, `"search"`, `"tel"`, `"url"`, `"email"`, or `"password"`, otherwise it is ignored.
     */
    size;
    /**
     * The type of control to display. The default type is text.
     */
    type = 'text';
    /**
     * The form element to associate the input with (its form owner). Must be the id of a form.
     */
    form;
    /**
     * The value of the input.
     */
    value = '';
    /**
     * Update the native input element when the value changes
     */
    valueChanged() {
        this.nanoChange.emit({ value: this.value });
        this.charCount = this.value?.length || 0;
        if (this.type === 'textarea' && this.resize === 'auto') {
            this.nativeInput.style.height = 'auto';
            if (this.value?.length)
                this.nativeInput.style.height = this.nativeInput.scrollHeight + 'px';
        }
        if (this.type === 'date') {
            if (this.isDateDisabled(this.valueAsDate)) {
                this.nativeInput.setCustomValidity('Date selected is not available.');
            }
            else if (this.nativeInput.validationMessage === 'Date selected is not available.') {
                this.nativeInput.setCustomValidity('');
            }
        }
        this.shouldValidate = true;
    }
    /** Represents the value of the input or NaN if numeric conversion is impossible */
    get valueAsNumber() {
        if (this.type === 'textarea')
            return NaN;
        return this.nativeInput?.valueAsNumber || NaN;
    }
    /** Represents the current value of the input as a Date, or null if conversion is not possible */
    get valueAsDate() {
        if (this.type === 'textarea')
            return null;
        return new Date(this.value);
    }
    /**
     * Whether to show a character count / remaining count when using the `maxlength` attribute.
     */
    showCharCount = false;
    handleValidatePropChange() {
        if (!this.hasRendered)
            return;
        this.shouldValidate = true;
    }
    ///// TYPE SPECIFIC PROPS /////
    /**
     * relevant to `type="textarea"`. Vertical resizing - enable / disable or make automatic.
     */
    resize = 'auto';
    /**
     * relevant to `type="textarea"`. Default number of rows to show
     */
    rows = 2;
    /**
     * relevant to `type="date"`. Whether to show a date picker.
     * Date pickers are not very useful if the potential input is too far in the distance or past e.g. Birthdays
     */
    showPicker = true;
    /** relevant to `type="date"`. Controls which days are disabled and therefore disallowed.
     * For example, this can be used to disallow selection of weekends.
     * @returns `false` for not disabled and `true` for disabled */
    isDateDisabled = () => false;
    /**
     * relevant to `type="date"`. Initial picker date. Defaults to `value` if set and today's date if not.
     * Must be in IS0-8601 format: YYYY-MM-DD.
     */
    initialPickerDate;
    /**
     * relevant to `type="date"`. If `true`, the input will close after a date is picked.
     */
    closeAfterPicked = true;
    /**
     * relevant to `type="date"`. Other options to pass to the date picker.
     * See the `nano-date-picker` docs for more information.
     */
    pickerOptions = {};
    /**
     * Emitted when a keyboard input occurred.
     */
    nanoInput;
    /**
     * Emitted when the value has changed.
     */
    nanoChange;
    /**
     * Emitted when the input loses focus.
     */
    nanoBlur;
    /**
     * Emitted when the input has focus.
     */
    nanoFocus;
    /**
     * Emitted when the input has been created.
     * @internal
     */
    nanoDidLoad;
    /**
     * Emitted when the input has been removed.
     * @internal
     */
    nanoDidUnload;
    /**
     * Called when validation is performed (which depends on `validateOn`).
     * @returns event.detail: `{ isValid: boolean, errorMessage: string, originalEvent: Event }`.
     */
    nanoValidate;
    /**
     * Get the current state of the control.
     * @param validateFirst - perform validation first before reporting
     * @returns `{ isValid: boolean, errorMessage: string }`
     */
    async reportValidity(validateFirst) {
        return new Promise((resolve) => {
            if (validateFirst)
                this.validate();
            setTimeout(() => {
                resolve({
                    isValid: !this._invalid,
                    errorMessage: this.nativeInput.validationMessage,
                });
            }, 50);
        });
    }
    /**
     * Sets focus on the specified `nano-input`. Use this method instead of the global
     * `input.focus()`.
     */
    async setFocus() {
        if (this.nativeInput) {
            this.nativeInput.focus();
            this.nativeInput.click();
        }
    }
    /**
     * Sets focus and select the text on the specified `nano-input`. Use this method instead of the global
     * `input.select()`.
     */
    async select() {
        if (this.nativeInput) {
            this.nativeInput.select();
        }
    }
    /**
     * @returns the native `<input>` element used under the hood.
     */
    getInputElement() {
        return Promise.resolve(this.nativeInput);
    }
    /**
     * Invalidate the field and show a custom error message. To clear the error you will need to re-call this method with an empty string.
     */
    async showError(message) {
        if (this.nativeInput) {
            this.nativeInput.setCustomValidity(message);
            this.validate();
        }
    }
    onReset(e) {
        const form = this.form
            ? document.querySelector('#' + this.form)
            : this.el.closest('form');
        if (!form || e.target !== this.el.closest('form'))
            return;
        this.value = '';
    }
    handleBlur(e) {
        if (!this.hasFocus)
            return;
        const kev = e;
        let target;
        requestAnimationFrame(() => {
            if (e instanceof KeyboardEvent && kev.key) {
                if (kev.key !== 'Tab')
                    return;
                target = document.activeElement;
            }
            else if (e instanceof FocusEvent) {
                target = document.activeElement;
            }
            else
                target = e.target;
            if (closestElement(this.el.tagName.toLowerCase(), target) !== this.el) {
                this.onBlur();
            }
        });
    }
    shouldClearOnEdit() {
        const { type, clearOnEdit } = this;
        return clearOnEdit === undefined ? type === 'password' : clearOnEdit;
    }
    getValue() {
        return this.value || '';
    }
    validate = (ev) => {
        if (this.validateOn === 'submitThenDirty')
            this.validateOn = 'dirty';
        if (!this.nativeInput.validity?.valid) {
            if (this.showInlineError) {
                if (ev)
                    ev.preventDefault();
                this.errorMessage = this.nativeInput.validationMessage;
            }
            this._invalid = true;
        }
        else
            this._invalid = false;
        this.nanoValidate.emit({
            isValid: !this._invalid,
            errorMessage: this.nativeInput.validationMessage,
            originalEvent: ev,
        });
    };
    onInput = (ev) => {
        const input = ev.target;
        this.value = input?.value || '';
        this.nanoInput.emit(ev);
    };
    onBlur = () => {
        this.hasFocus = false;
        this.focusChanged();
        if (this.validateOn === 'dirty')
            this.validate();
        this.nanoBlur.emit();
    };
    onFocus = (e) => {
        if (this.type === 'date') {
            // fix to stop native date picker from showing
            e.preventDefault();
        }
        this.hasFocus = true;
        this.focusChanged();
        this.nanoFocus.emit();
    };
    onKeydown = (e) => {
        if (this.type === 'date' && [' '].includes(e.key)) {
            // fix to stop native date picker from showing
            e.preventDefault();
            if (this.showPicker) {
                this.pickerDropdown?.show();
            }
        }
        if (this.shouldClearOnEdit()) {
            // Did the input value change after it was blurred and edited?
            if (this.didBlurAfterEdit && this.hasValue()) {
                // Clear the input
                this.clearTextInput();
            }
            // Reset the flag
            this.didBlurAfterEdit = false;
        }
    };
    clearTextInput = (ev) => {
        if (this.clearable && !this.readonly && !this.disabled && ev) {
            ev.preventDefault();
            ev.stopPropagation();
        }
        this.value = '';
        this.nativeInput.value = '';
        const event = new window.Event('change');
        this.nativeInput.dispatchEvent(event);
    };
    focusChanged() {
        // If clearOnEdit is enabled and the input blurred but has a value, set a flag
        if (!this.hasFocus && this.shouldClearOnEdit() && this.hasValue()) {
            this.didBlurAfterEdit = true;
        }
    }
    hasValue() {
        return this.getValue().length > 0;
    }
    slotChangeObserver() {
        if (!Build.isBrowser)
            return;
        if (this.mo)
            this.mo.disconnect();
        const mo = (this.mo = new MutationObserver(() => this.processSlottedContent()));
        mo.observe(this.el, { childList: true, subtree: true });
    }
    processSlottedContent() {
        // see if we have label / button content
        this.hasLabelSlot = !!this.el.querySelectorAll('[slot="label"]');
        this.hasHelperSlot = !!this.el.querySelector('[slot="helper"]');
        this.hasHelperEndSlot = !!this.el.querySelector('[slot="helper-end"]');
        this.datalist = this.el.querySelector(`${transformTag('nano-datalist')}:not([slot])`);
    }
    connectedCallback() {
        this.debounceChanged();
        if (Build.isBrowser) {
            this.el.dispatchEvent(new CustomEvent('nanoDidLoad', {
                detail: this.el,
            }));
        }
    }
    disconnectedCallback() {
        if (Build.isBrowser) {
            document.dispatchEvent(new CustomEvent('nanoDidUnload', {
                detail: this.el,
            }));
        }
        if (this.mo)
            this.mo.disconnect();
    }
    componentDidLoad() {
        this.slotChangeObserver();
        this.hasRendered = true;
        if (this.autofocus)
            setTimeout((_) => this.setFocus(), 300);
    }
    componentWillLoad() {
        this.processSlottedContent();
    }
    componentDidRender() {
        if (this.shouldValidate) {
            this.validate();
            this.shouldValidate = false;
        }
    }
    render() {
        const value = this.getValue();
        const labelId = this.inputId + '-lbl';
        const moreId = this.showInlineError || this.hasHelperSlot ? this.inputId + '-more' : '';
        const helperEndId = this.hasHelperEndSlot ? this.inputId + '-helper' : '';
        this.rtl = this.el.ownerDocument.dir === 'rtl';
        const compWrapOptions = (({ el, floatLabel, label, alwaysShowPlaceholder, errorMessage, type, showInlineError, hasHelperSlot, hasLabelSlot, hideLabel, placeholder, maxlength, charCount, showCharCount, rtl, hasHelperEndSlot, }) => ({
            el,
            floatLabel,
            label,
            alwaysShowPlaceholder,
            errorMessage,
            type,
            showInlineError,
            hasHelperSlot,
            hasLabelSlot,
            hideLabel,
            placeholder,
            maxlength,
            charCount,
            showCharCount,
            rtl,
            hasHelperEndSlot,
        }))(this);
        const wrapOptions = {
            ...compWrapOptions,
            labelId,
            moreId,
            helperEndId,
            hasValue: this.hasValue(),
            controlId: this.inputId,
        };
        const controlOptions = (({ clearable, readonly, disabled }) => ({
            clearable,
            readonly,
            disabled,
            clearControl: this.clearable,
        }))(this);
        return (h(Host, { key: '636d7624bcfe136a0e93b55cf9fc38e272f7aed6', "aria-disabled": this.disabled ? 'true' : null, class: {
                'has-value': this.hasValue(),
                'has-focus': this.hasFocus,
                'is-invalid': this._invalid === true,
                'is-valid': this._invalid === false,
                'nano-input': true,
            } }, h("div", { key: '942db1636f7d08dd581359b66df66ebf080d23ae', style: { width: '100%' } }, h(FormControlWrap, { key: 'd944b897545398b51ab0a76e1f8d62c57cd85843', ...wrapOptions, class: {
                'has-helper': this.hasHelperSlot,
                'has-error': !!this.errorMessage &&
                    this.showInlineError &&
                    this._invalid === true,
            } }, h(FormControl, { key: 'efd29f841ff0724228fc47754a5aad8d82f88d49', ...controlOptions, onClearText: this.clearTextInput, control: this.el, ref: (el) => (this.nativeInputWrap = el), showInlineError: this.showInlineError, endSlot: this.showPicker &&
                this.type === 'date' &&
                !this.readonly &&
                !this.disabled && [
                h("nano-dropdown", { slot: "end", dialogTitle: "Choose a date", class: "input__date-dropdown", part: "date__dropdown", placement: "bottom-end", skidding: 10, distance: 12, ref: (dd) => (this.pickerDropdown = dd), onNanoAfterShow: () => this.picker.setFocus(true) }, h("nano-icon-button", { label: "Open date picker", iconName: "light/calendar-days", slot: "trigger", class: "input__date-trigger" }), h("div", null, h("div", { class: "date-field__close-bar" }, h("nano-icon-button", { label: "Close date picker", iconName: "light/xmark", class: "input__date-close", onClick: (e) => {
                        e.target
                            .closest('nano-dropdown')
                            ?.hide();
                    }, ref: (btn) => (this.pickerCloseBtn = btn) })), h("nano-date-picker", { part: "date__picker", ref: (dp) => {
                        this.picker = dp;
                        this.picker.firstFocusEle = this.pickerCloseBtn;
                    }, ...this.pickerOptions, isDateDisabled: this.isDateDisabled, onNanoDatePicked: (e) => {
                        this.value = e.detail.value;
                        this.pickerDropdown?.hide();
                    }, min: this.min, max: this.max, "is-modal": true, selectedDate: this.value || this.initialPickerDate || undefined }))),
            ] }, this.type !== 'textarea' && (h("input", { key: 'ce5547777de11926717b27712f7d687171d0dde7', id: this.inputId, class: "input__native-ctrl", ref: (input) => (this.nativeInput = input), "aria-labelledby": labelId + ' ' + moreId + ' ' + helperEndId, disabled: this.disabled, accept: this.accept, autoCapitalize: this.autocapitalise, autoComplete: this.autocomplete, autoCorrect: this.autocorrect, autoFocus: this.autofocus, inputMode: this.inputmode, form: this.form, min: this.min, max: this.max, minLength: this.minlength, maxLength: this.maxlength, multiple: this.multiple, name: this.name, pattern: this.pattern, placeholder: this.placeholder, readOnly: this.readonly, required: this.required, spellcheck: this.spellcheck, step: this.step, size: this.size, type: this.type, value: value, onInput: this.onInput, onClick: (e) => e.preventDefault(), onChange: this.onInput, onFocus: this.onFocus, onBlur: this.handleBlur, onKeyDown: this.onKeydown, onInvalid: this.validate })), this.type === 'textarea' && (h("textarea", { key: 'e1dc2377200cdccda85cdbb6cda08a49d8459c1e', rows: this.floatLabel ? 1 : this.rows, id: this.inputId, class: {
                'input__native-ctrl': true,
                input__resizable: this.resize === 'true',
            }, ref: (input) => (this.nativeInput = input), "aria-labelledby": labelId + ' ' + moreId + ' ' + helperEndId, disabled: this.disabled, autoCapitalize: this.autocapitalise, autoCorrect: this.autocorrect, autoFocus: this.autofocus, inputMode: this.inputmode, form: this.form, minLength: this.minlength, maxLength: this.maxlength, name: this.name, placeholder: this.placeholder, readOnly: this.readonly, required: this.required, spellcheck: this.spellcheck, value: value, onInput: this.onInput, onChange: this.onInput, onFocus: this.onFocus, onKeyDown: this.onKeydown, onInvalid: this.validate, onBlur: this.handleBlur })))), h("slot", { key: '564511c369dc13eb85cbf7e1c48b5d5fbbea8679' }))));
    }
    static get is() { return "nano-input"; }
    static get encapsulation() { return "scoped"; }
    static get originalStyleUrls() {
        return {
            "$": ["input.scss"]
        };
    }
    static get styleUrls() {
        return {
            "$": ["input.css"]
        };
    }
    static get properties() {
        return {
            "invalid": {
                "type": "any",
                "attribute": "invalid",
                "mutable": false,
                "complexType": {
                    "original": "any",
                    "resolved": "any",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [{
                            "name": "readonly",
                            "text": undefined
                        }],
                    "text": "This will be true when the control is in an invalid state.\nValidity is determined by the `required` prop. Or if custom validity message is set."
                },
                "getter": true,
                "setter": false,
                "reflect": true,
                "defaultValue": "null"
            },
            "validityMessage": {
                "type": "string",
                "attribute": "validity-message",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [{
                            "name": "readonly",
                            "text": undefined
                        }],
                    "text": "Current validation message - if any."
                },
                "getter": true,
                "setter": false,
                "reflect": false
            },
            "accept": {
                "type": "string",
                "attribute": "accept",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "If the value of the type attribute is `\"file\"`, then this attribute will indicate the types of files that the server accepts, otherwise it will be ignored. The value must be a comma-separated list of unique content type specifiers."
                },
                "getter": false,
                "setter": false,
                "reflect": false
            },
            "autocapitalise": {
                "type": "string",
                "attribute": "autocapitalise",
                "mutable": false,
                "complexType": {
                    "original": "'none' | 'sentences' | 'words' | 'characters'",
                    "resolved": "\"characters\" | \"none\" | \"sentences\" | \"words\"",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Indicates whether and how the text value should be automatically capitalized as it is entered/edited by the user."
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "defaultValue": "'none'"
            },
            "autocomplete": {
                "type": "string",
                "attribute": "autocomplete",
                "mutable": false,
                "complexType": {
                    "original": "'on' | 'off'",
                    "resolved": "\"off\" | \"on\"",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Indicates whether the value of the control can be automatically completed by the browser."
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "defaultValue": "'off'"
            },
            "autocorrect": {
                "type": "string",
                "attribute": "autocorrect",
                "mutable": false,
                "complexType": {
                    "original": "'on' | 'off'",
                    "resolved": "\"off\" | \"on\"",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Whether auto correction should be enabled when the user is entering/editing the text value."
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "defaultValue": "'off'"
            },
            "autofocus": {
                "type": "boolean",
                "attribute": "autofocus",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "This Boolean attribute lets you specify that a form control should have input focus when the page loads."
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "defaultValue": "false"
            },
            "clearable": {
                "type": "boolean",
                "attribute": "clearable",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "If `true`, a clear icon will appear in the input when there is a value. Clicking it clears the input."
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "defaultValue": "false"
            },
            "clearOnEdit": {
                "type": "boolean",
                "attribute": "clear-on-edit",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "If `true`, the value will be cleared after focus upon edit. Defaults to `true` when `type` is `\"password\"`, `false` for all other types."
                },
                "getter": false,
                "setter": false,
                "reflect": false
            },
            "debounce": {
                "type": "number",
                "attribute": "debounce",
                "mutable": false,
                "complexType": {
                    "original": "number",
                    "resolved": "number",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Set the amount of time, in milliseconds, to wait to trigger the `nanoChange` event after each keystroke."
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "defaultValue": "0"
            },
            "disabled": {
                "type": "boolean",
                "attribute": "disabled",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "If `true`, the user cannot interact with the input."
                },
                "getter": false,
                "setter": false,
                "reflect": true,
                "defaultValue": "false"
            },
            "inputmode": {
                "type": "string",
                "attribute": "inputmode",
                "mutable": false,
                "complexType": {
                    "original": "| 'none'\n    | 'text'\n    | 'tel'\n    | 'url'\n    | 'email'\n    | 'numeric'\n    | 'decimal'\n    | 'search'",
                    "resolved": "\"decimal\" | \"email\" | \"none\" | \"numeric\" | \"search\" | \"tel\" | \"text\" | \"url\"",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "A hint to the browser for which keyboard to display.\nPossible values: `\"none\"`, `\"text\"`, `\"tel\"`, `\"url\"`,\n`\"email\"`, `\"numeric\"`, `\"decimal\"`, and `\"search\"`."
                },
                "getter": false,
                "setter": false,
                "reflect": false
            },
            "validateOn": {
                "type": "string",
                "attribute": "validate-on",
                "mutable": true,
                "complexType": {
                    "original": "'dirty' | 'submit' | 'submitThenDirty'",
                    "resolved": "\"dirty\" | \"submit\" | \"submitThenDirty\"",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "When should the field perform validation"
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "defaultValue": "'submitThenDirty'"
            },
            "showInlineError": {
                "type": "boolean",
                "attribute": "show-inline-error",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Whether to show validation errors underneath input"
                },
                "getter": false,
                "setter": false,
                "reflect": true,
                "defaultValue": "true"
            },
            "label": {
                "type": "string",
                "attribute": "label",
                "mutable": true,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "String to place within a label element. Alternatively you may use a label slot."
                },
                "getter": true,
                "setter": true,
                "reflect": false
            },
            "alwaysShowPlaceholder": {
                "type": "boolean",
                "attribute": "always-show-placeholder",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Sometimes it can be helpful to always show the placeholder, even when the input has a value.\nFor example a postcode field could have a placeholder `e.g. LD1 1AA` which is helpful to show."
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "defaultValue": "false"
            },
            "hideLabel": {
                "type": "boolean",
                "attribute": "hide-label",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Visually hide the label - but make it accessible."
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "defaultValue": "false"
            },
            "floatLabel": {
                "type": "boolean",
                "attribute": "float-label",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Enable floating label behaviour. Will disable placeholder if set."
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "defaultValue": "false"
            },
            "max": {
                "type": "string",
                "attribute": "max",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "The maximum value, which must not be less than its minimum (min attribute) value."
                },
                "getter": false,
                "setter": false,
                "reflect": false
            },
            "maxlength": {
                "type": "number",
                "attribute": "maxlength",
                "mutable": false,
                "complexType": {
                    "original": "number",
                    "resolved": "number",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "If the value of the type attribute is `text`, `email`, `search`, `password`, `tel`, or `url`, this attribute specifies the maximum number of characters that the user can enter."
                },
                "getter": false,
                "setter": false,
                "reflect": false
            },
            "min": {
                "type": "string",
                "attribute": "min",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "The minimum value, which must not be greater than its maximum (max attribute) value."
                },
                "getter": false,
                "setter": false,
                "reflect": false
            },
            "minlength": {
                "type": "number",
                "attribute": "minlength",
                "mutable": false,
                "complexType": {
                    "original": "number",
                    "resolved": "number",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "If the value of the type attribute is `text`, `email`, `search`, `password`, `tel`, or `url`, this attribute specifies the minimum number of characters that the user can enter."
                },
                "getter": false,
                "setter": false,
                "reflect": false
            },
            "multiple": {
                "type": "boolean",
                "attribute": "multiple",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "If `true`, the user can enter more than one value. This attribute applies when the type attribute is set to `\"email\"` or `\"file\"`, otherwise it is ignored."
                },
                "getter": false,
                "setter": false,
                "reflect": false
            },
            "name": {
                "type": "string",
                "attribute": "name",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "The name of the control, which is submitted with the form data."
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "defaultValue": "this.inputId"
            },
            "pattern": {
                "type": "string",
                "attribute": "pattern",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "A regular expression that the value is checked against. The pattern must match the entire value, not just some subset. Use the title attribute to describe the pattern to help the user. This attribute applies when the value of the type attribute is `\"text\"`, `\"search\"`, `\"tel\"`, `\"url\"`, `\"email\"`, or `\"password\"`, otherwise it is ignored."
                },
                "getter": false,
                "setter": false,
                "reflect": false
            },
            "placeholder": {
                "type": "string",
                "attribute": "placeholder",
                "mutable": false,
                "complexType": {
                    "original": "string | null",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Instructional text that shows before the input has a value."
                },
                "getter": false,
                "setter": false,
                "reflect": false
            },
            "readonly": {
                "type": "boolean",
                "attribute": "readonly",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "If `true`, the user cannot modify the value."
                },
                "getter": false,
                "setter": false,
                "reflect": true,
                "defaultValue": "false"
            },
            "required": {
                "type": "boolean",
                "attribute": "required",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "If `true`, the user must fill in a value before submitting a form.\nBy default, setting this will also add an asterisk to the label."
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "defaultValue": "false"
            },
            "spellcheck": {
                "type": "boolean",
                "attribute": "spellcheck",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "If `true`, the element will have its spelling and grammar checked."
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "defaultValue": "false"
            },
            "step": {
                "type": "string",
                "attribute": "step",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Works with the min and max attributes to limit the increments at which a value can be set.\nPossible values are: `\"any\"` or a positive floating point number."
                },
                "getter": false,
                "setter": false,
                "reflect": false
            },
            "size": {
                "type": "number",
                "attribute": "size",
                "mutable": false,
                "complexType": {
                    "original": "number",
                    "resolved": "number",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "The initial size of the control. This value is in pixels unless the value of the type attribute\nis `\"text\"` or `\"password\"`, in which case it is an integer number of characters.\nThis attribute applies only when the `type` attribute is set to `\"text\"`, `\"search\"`, `\"tel\"`, `\"url\"`, `\"email\"`, or `\"password\"`, otherwise it is ignored."
                },
                "getter": false,
                "setter": false,
                "reflect": false
            },
            "type": {
                "type": "string",
                "attribute": "type",
                "mutable": false,
                "complexType": {
                    "original": "TextFieldTypes",
                    "resolved": "\"date\" | \"email\" | \"number\" | \"password\" | \"search\" | \"tel\" | \"text\" | \"textarea\" | \"time\" | \"url\"",
                    "references": {
                        "TextFieldTypes": {
                            "location": "import",
                            "path": "../../types/shared",
                            "id": "src/types/shared.ts::TextFieldTypes"
                        }
                    }
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "The type of control to display. The default type is text."
                },
                "getter": false,
                "setter": false,
                "reflect": true,
                "defaultValue": "'text'"
            },
            "form": {
                "type": "string",
                "attribute": "form",
                "mutable": false,
                "complexType": {
                    "original": "string | null",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "The form element to associate the input with (its form owner). Must be the id of a form."
                },
                "getter": false,
                "setter": false,
                "reflect": false
            },
            "value": {
                "type": "string",
                "attribute": "value",
                "mutable": true,
                "complexType": {
                    "original": "string | null",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "The value of the input."
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "defaultValue": "''"
            },
            "valueAsNumber": {
                "type": "number",
                "attribute": "value-as-number",
                "mutable": false,
                "complexType": {
                    "original": "number",
                    "resolved": "number",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Represents the value of the input or NaN if numeric conversion is impossible"
                },
                "getter": true,
                "setter": false,
                "reflect": false
            },
            "valueAsDate": {
                "type": "unknown",
                "attribute": "value-as-date",
                "mutable": false,
                "complexType": {
                    "original": "Date",
                    "resolved": "Date",
                    "references": {
                        "Date": {
                            "location": "global",
                            "id": "global::Date"
                        }
                    }
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Represents the current value of the input as a Date, or null if conversion is not possible"
                },
                "getter": true,
                "setter": false
            },
            "showCharCount": {
                "type": "boolean",
                "attribute": "show-char-count",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Whether to show a character count / remaining count when using the `maxlength` attribute."
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "defaultValue": "false"
            },
            "resize": {
                "type": "string",
                "attribute": "resize",
                "mutable": false,
                "complexType": {
                    "original": "'true' | 'false' | 'auto'",
                    "resolved": "\"auto\" | \"false\" | \"true\"",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "relevant to `type=\"textarea\"`. Vertical resizing - enable / disable or make automatic."
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "defaultValue": "'auto'"
            },
            "rows": {
                "type": "number",
                "attribute": "rows",
                "mutable": false,
                "complexType": {
                    "original": "number",
                    "resolved": "number",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "relevant to `type=\"textarea\"`. Default number of rows to show"
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "defaultValue": "2"
            },
            "showPicker": {
                "type": "boolean",
                "attribute": "show-picker",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "relevant to `type=\"date\"`. Whether to show a date picker.\nDate pickers are not very useful if the potential input is too far in the distance or past e.g. Birthdays"
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "defaultValue": "true"
            },
            "isDateDisabled": {
                "type": "unknown",
                "attribute": "is-date-disabled",
                "mutable": false,
                "complexType": {
                    "original": "DateDisabledPredicate",
                    "resolved": "(date: Date) => boolean",
                    "references": {
                        "DateDisabledPredicate": {
                            "location": "import",
                            "path": "../date-picker/date-picker-interface",
                            "id": "src/components/date-picker/date-picker-interface.d.ts::DateDisabledPredicate"
                        }
                    }
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [{
                            "name": "returns",
                            "text": "`false` for not disabled and `true` for disabled"
                        }],
                    "text": "relevant to `type=\"date\"`. Controls which days are disabled and therefore disallowed.\nFor example, this can be used to disallow selection of weekends."
                },
                "getter": false,
                "setter": false,
                "defaultValue": "() => false"
            },
            "initialPickerDate": {
                "type": "string",
                "attribute": "initial-picker-date",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "relevant to `type=\"date\"`. Initial picker date. Defaults to `value` if set and today's date if not.\nMust be in IS0-8601 format: YYYY-MM-DD."
                },
                "getter": false,
                "setter": false,
                "reflect": false
            },
            "closeAfterPicked": {
                "type": "boolean",
                "attribute": "close-after-picked",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "relevant to `type=\"date\"`. If `true`, the input will close after a date is picked."
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "defaultValue": "true"
            },
            "pickerOptions": {
                "type": "unknown",
                "attribute": "picker-options",
                "mutable": false,
                "complexType": {
                    "original": "Partial<NanoDatePicker>",
                    "resolved": "{ host?: HTMLNanoDatePickerElement; activeFocus?: boolean; focusedDay?: Date; selectedDate?: string; min?: string; max?: string; firstDayOfWeek?: DaysOfWeek; localization?: DuetLocalizedText; isDateDisabled?: DateDisabledPredicate; isModal?: boolean; firstFocusEle?: HTMLElement; nanoDatePicked?: EventEmitter<PickerChangeEvent>; setFocus?: (day?: boolean) => Promise<void>; handleSelectedDateChange?: () => void; componentWillLoad?: () => void; render?: () => any; }",
                    "references": {
                        "Partial": {
                            "location": "global",
                            "id": "global::Partial"
                        },
                        "NanoDatePicker": {
                            "location": "import",
                            "path": "../date-picker/date-picker",
                            "id": "src/components/date-picker/date-picker.tsx::NanoDatePicker"
                        }
                    }
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "relevant to `type=\"date\"`. Other options to pass to the date picker.\nSee the `nano-date-picker` docs for more information."
                },
                "getter": false,
                "setter": false,
                "defaultValue": "{}"
            }
        };
    }
    static get states() {
        return {
            "hasFocus": {},
            "hasLabelSlot": {},
            "hasHelperSlot": {},
            "hasHelperEndSlot": {},
            "errorMessage": {},
            "datalist": {},
            "_invalid": {}
        };
    }
    static get events() {
        return [{
                "method": "nanoInput",
                "name": "nanoInput",
                "bubbles": true,
                "cancelable": true,
                "composed": true,
                "docs": {
                    "tags": [],
                    "text": "Emitted when a keyboard input occurred."
                },
                "complexType": {
                    "original": "InputEvent",
                    "resolved": "InputEvent",
                    "references": {
                        "InputEvent": {
                            "location": "global",
                            "id": "global::InputEvent"
                        }
                    }
                }
            }, {
                "method": "nanoChange",
                "name": "nanoChange",
                "bubbles": true,
                "cancelable": true,
                "composed": true,
                "docs": {
                    "tags": [],
                    "text": "Emitted when the value has changed."
                },
                "complexType": {
                    "original": "InputChangeEventDetail",
                    "resolved": "InputChangeEventDetail",
                    "references": {
                        "InputChangeEventDetail": {
                            "location": "import",
                            "path": "./input-interface",
                            "id": "src/components/input/input-interface.d.ts::InputChangeEventDetail"
                        }
                    }
                }
            }, {
                "method": "nanoBlur",
                "name": "nanoBlur",
                "bubbles": true,
                "cancelable": true,
                "composed": true,
                "docs": {
                    "tags": [],
                    "text": "Emitted when the input loses focus."
                },
                "complexType": {
                    "original": "void",
                    "resolved": "void",
                    "references": {}
                }
            }, {
                "method": "nanoFocus",
                "name": "nanoFocus",
                "bubbles": true,
                "cancelable": true,
                "composed": true,
                "docs": {
                    "tags": [],
                    "text": "Emitted when the input has focus."
                },
                "complexType": {
                    "original": "void",
                    "resolved": "void",
                    "references": {}
                }
            }, {
                "method": "nanoDidLoad",
                "name": "nanoDidLoad",
                "bubbles": true,
                "cancelable": true,
                "composed": true,
                "docs": {
                    "tags": [{
                            "name": "internal",
                            "text": undefined
                        }],
                    "text": "Emitted when the input has been created."
                },
                "complexType": {
                    "original": "void",
                    "resolved": "void",
                    "references": {}
                }
            }, {
                "method": "nanoDidUnload",
                "name": "nanoDidUnload",
                "bubbles": true,
                "cancelable": true,
                "composed": true,
                "docs": {
                    "tags": [{
                            "name": "internal",
                            "text": undefined
                        }],
                    "text": "Emitted when the input has been removed."
                },
                "complexType": {
                    "original": "void",
                    "resolved": "void",
                    "references": {}
                }
            }, {
                "method": "nanoValidate",
                "name": "nanoValidate",
                "bubbles": true,
                "cancelable": true,
                "composed": true,
                "docs": {
                    "tags": [{
                            "name": "returns",
                            "text": "event.detail: `{ isValid: boolean, errorMessage: string, originalEvent: Event }`."
                        }],
                    "text": "Called when validation is performed (which depends on `validateOn`)."
                },
                "complexType": {
                    "original": "ControlValidityEventDetail",
                    "resolved": "ControlValidityEventDetail",
                    "references": {
                        "ControlValidityEventDetail": {
                            "location": "import",
                            "path": "../../types/shared",
                            "id": "src/types/shared.ts::ControlValidityEventDetail"
                        }
                    }
                }
            }];
    }
    static get methods() {
        return {
            "reportValidity": {
                "complexType": {
                    "signature": "(validateFirst: boolean) => Promise<ControlValidity>",
                    "parameters": [{
                            "name": "validateFirst",
                            "type": "boolean",
                            "docs": "- perform validation first before reporting"
                        }],
                    "references": {
                        "Promise": {
                            "location": "global",
                            "id": "global::Promise"
                        },
                        "ControlValidity": {
                            "location": "import",
                            "path": "../../types/shared",
                            "id": "src/types/shared.ts::ControlValidity"
                        }
                    },
                    "return": "Promise<ControlValidity>"
                },
                "docs": {
                    "text": "Get the current state of the control.",
                    "tags": [{
                            "name": "param",
                            "text": "validateFirst - perform validation first before reporting"
                        }, {
                            "name": "returns",
                            "text": "`{ isValid: boolean, errorMessage: string }`"
                        }]
                }
            },
            "setFocus": {
                "complexType": {
                    "signature": "() => Promise<void>",
                    "parameters": [],
                    "references": {
                        "Promise": {
                            "location": "global",
                            "id": "global::Promise"
                        }
                    },
                    "return": "Promise<void>"
                },
                "docs": {
                    "text": "Sets focus on the specified `nano-input`. Use this method instead of the global\n`input.focus()`.",
                    "tags": []
                }
            },
            "select": {
                "complexType": {
                    "signature": "() => Promise<void>",
                    "parameters": [],
                    "references": {
                        "Promise": {
                            "location": "global",
                            "id": "global::Promise"
                        }
                    },
                    "return": "Promise<void>"
                },
                "docs": {
                    "text": "Sets focus and select the text on the specified `nano-input`. Use this method instead of the global\n`input.select()`.",
                    "tags": []
                }
            },
            "getInputElement": {
                "complexType": {
                    "signature": "() => Promise<HTMLInputElement | HTMLTextAreaElement>",
                    "parameters": [],
                    "references": {
                        "Promise": {
                            "location": "global",
                            "id": "global::Promise"
                        },
                        "HTMLTextAreaElement": {
                            "location": "global",
                            "id": "global::HTMLTextAreaElement"
                        },
                        "HTMLInputElement": {
                            "location": "global",
                            "id": "global::HTMLInputElement"
                        }
                    },
                    "return": "Promise<HTMLTextAreaElement | HTMLInputElement>"
                },
                "docs": {
                    "text": "",
                    "tags": [{
                            "name": "returns",
                            "text": "the native `<input>` element used under the hood."
                        }]
                }
            },
            "showError": {
                "complexType": {
                    "signature": "(message: string) => Promise<void>",
                    "parameters": [{
                            "name": "message",
                            "type": "string",
                            "docs": ""
                        }],
                    "references": {
                        "Promise": {
                            "location": "global",
                            "id": "global::Promise"
                        }
                    },
                    "return": "Promise<void>"
                },
                "docs": {
                    "text": "Invalidate the field and show a custom error message. To clear the error you will need to re-call this method with an empty string.",
                    "tags": []
                }
            }
        };
    }
    static get elementRef() { return "el"; }
    static get watchers() {
        return [{
                "propName": "datalist",
                "methodName": "setDataListOpts"
            }, {
                "propName": "debounce",
                "methodName": "debounceChanged"
            }, {
                "propName": "value",
                "methodName": "valueChanged"
            }, {
                "propName": "minlength",
                "methodName": "handleValidatePropChange"
            }, {
                "propName": "maxlength",
                "methodName": "handleValidatePropChange"
            }, {
                "propName": "min",
                "methodName": "handleValidatePropChange"
            }, {
                "propName": "max",
                "methodName": "handleValidatePropChange"
            }, {
                "propName": "required",
                "methodName": "handleValidatePropChange"
            }, {
                "propName": "disabled",
                "methodName": "handleValidatePropChange"
            }, {
                "propName": "readonly",
                "methodName": "handleValidatePropChange"
            }, {
                "propName": "pattern",
                "methodName": "handleValidatePropChange"
            }, {
                "propName": "inputmode",
                "methodName": "handleValidatePropChange"
            }, {
                "propName": "type",
                "methodName": "handleValidatePropChange"
            }];
    }
    static get listeners() {
        return [{
                "name": "reset",
                "method": "onReset",
                "target": "body",
                "capture": false,
                "passive": false
            }, {
                "name": "mousedown",
                "method": "handleBlur",
                "target": "body",
                "capture": false,
                "passive": true
            }, {
                "name": "keydown",
                "method": "handleBlur",
                "target": undefined,
                "capture": false,
                "passive": false
            }];
    }
}
