import { h, Host } from "@stencil/core";
import { assignDescription, isSpecTest, messageId } from "../../utils/form";
import { inheritAriaAttributes } from "../../utils/attributes";
import { debounceEvent } from "../../utils/utils";
import { danger } from "@pine-ds/icons/icons";
/**
 * @slot append - Content to be displayed after the input field
 * @slot prefix - Content that is displayed visually within the input field before the input field
 * @slot prepend - Content to be displayed before the input field
 * @slot suffix - Content that is displayed visually within the input field after the input field
 * @slot action - Content to be displayed in the label area, typically for help icons or links
 */
export class PdsInput {
    constructor() {
        this.inheritedAttributes = {};
        this.isComposing = false;
        this.hasLoaded = false;
        /**
         * If true, the input has prefix content (non-focusable)
         */
        this.hasPrefix = false;
        /**
         * If true, the input has suffix content (non-focusable)
         */
        this.hasSuffix = false;
        /**
         * If true, the input has prepend content (focusable)
         */
        this.hasPrepend = false;
        /**
         * If true, the input has append content (focusable)
         */
        this.hasAppend = false;
        /**
         * If true, the input has action content in the label area
         */
        this.hasAction = false;
        /**
         * Determines the type of control that will be displayed
         * `'email'`, `'number'`, `'password'`, `'tel'`, `'text'`, `'url'`
         * @defaultValue "text"
         */
        this.type = 'text';
        /**
         * The value of the input.
         */
        this.value = '';
        /**
         * Determines if the input has focus.
         */
        this.hasFocus = false;
        this.onInputEvent = (ev) => {
            const input = ev.target;
            if (input) {
                this.value = input.value || '';
            }
            this.emitInputChange(ev);
        };
        this.onChangeEvent = (ev) => {
            this.emitValueChange(ev);
        };
        this.onBlurEvent = (ev) => {
            this.hasFocus = false;
            if (this.focusedValue !== this.value) {
                /**
                 * Emits the `pdsChange` event when the input value
                 * is different than the value when the input was focused.
                 */
                this.emitValueChange(ev);
            }
            this.pdsBlur.emit(ev);
        };
        this.onFocusEvent = (ev) => {
            this.hasFocus = true;
            this.focusedValue = this.value;
            this.pdsFocus.emit(ev);
        };
        this.onCompositionStart = () => {
            this.isComposing = true;
        };
        this.onCompositionEnd = () => {
            this.isComposing = false;
        };
        this.onKeyDownEvent = (ev) => {
            this.pdsKeyDown.emit(ev);
        };
    }
    /**
     * Sets focus on the native `input` in the `pds-input`. Use this method instead of the global
     * `input.focus()`.
     */
    async setFocus() {
        if (this.nativeInput) {
            this.nativeInput.focus();
        }
    }
    observeAddonResize() {
        var _a;
        if (typeof ResizeObserver === 'undefined')
            return;
        // Disconnect existing observer before creating a new one
        (_a = this.resizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
        this.resizeObserver = new ResizeObserver(() => {
            this.updateAddonWidths();
        });
        if (this.prefixEl) {
            this.resizeObserver.observe(this.prefixEl);
        }
        if (this.suffixEl) {
            this.resizeObserver.observe(this.suffixEl);
        }
    }
    updateAddonWidths() {
        requestAnimationFrame(() => {
            if (this.prefixEl) {
                const prefixWidth = this.prefixEl.offsetWidth;
                this.el.style.setProperty('--prefix-width', `${prefixWidth}px`);
            }
            if (this.suffixEl) {
                const suffixWidth = this.suffixEl.offsetWidth;
                this.el.style.setProperty('--suffix-width', `${suffixWidth}px`);
            }
        });
    }
    renderPrefix() {
        const hasPrefix = this.el.querySelector('[slot="prefix"]') !== null;
        if (hasPrefix) {
            return (h("div", { class: "pds-input__prefix", part: "prefix", ref: (el) => this.prefixEl = el }, h("slot", { name: "prefix", onSlotchange: () => this.updateAddonWidths() })));
        }
        return null;
    }
    renderSuffix() {
        const hasSuffix = this.el.querySelector('[slot="suffix"]') !== null;
        if (hasSuffix) {
            return (h("div", { class: "pds-input__suffix", part: "suffix", ref: (el) => this.suffixEl = el }, h("slot", { name: "suffix", onSlotchange: () => this.updateAddonWidths() })));
        }
        return null;
    }
    renderPrepend() {
        const hasPrepend = this.el.querySelector('[slot="prepend"]') !== null;
        if (hasPrepend) {
            return (h("div", { class: "pds-input__prepend", part: "prepend" }, h("slot", { name: "prepend" })));
        }
        return null;
    }
    renderAppend() {
        const hasAppend = this.el.querySelector('[slot="append"]') !== null;
        if (hasAppend) {
            return (h("div", { class: "pds-input__append", part: "append" }, h("slot", { name: "append" })));
        }
        return null;
    }
    renderAction() {
        const hasAction = this.el.querySelector('[slot="action"]') !== null;
        if (hasAction) {
            return (h("div", { class: "pds-input__action", part: "action" }, h("slot", { name: "action" })));
        }
        return null;
    }
    componentWillLoad() {
        this.inheritedAttributes = Object.assign({}, inheritAriaAttributes(this.el));
        this.hasPrefix = this.el.querySelector('[slot="prefix"]') !== null;
        this.hasSuffix = this.el.querySelector('[slot="suffix"]') !== null;
        this.hasPrepend = this.el.querySelector('[slot="prepend"]') !== null;
        this.hasAppend = this.el.querySelector('[slot="append"]') !== null;
        this.hasAction = this.el.querySelector('[slot="action"]') !== null;
        // Store the original pdsInput event emitter
        this.originalPdsInput = this.pdsInput;
    }
    connectedCallback() {
        // Initialize ElementInternals for form association (only once per element instance)
        if (this.el.attachInternals && !this.internals) {
            this.internals = this.el.attachInternals();
        }
        // Re-establish ResizeObserver after DOM reconnection
        // Only run if component has already loaded (refs are available)
        if (this.hasLoaded && !this.resizeObserver) {
            this.updateAddonWidths();
            this.observeAddonResize();
        }
    }
    disconnectedCallback() {
        var _a;
        (_a = this.resizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
        this.resizeObserver = undefined;
    }
    componentDidLoad() {
        this.hasLoaded = true;
        this.debounceChanged();
        this.updateAddonWidths();
        this.observeAddonResize();
        // Set initial form value
        this.updateFormValue();
    }
    debounceChanged() {
        const { pdsInput, debounce, originalPdsInput } = this;
        /**
         * If debounce is undefined, we have to manually revert the pdsInput emitter in case
         * debounce used to be set to a number. Otherwise, the event would stay debounced.
         */
        this.pdsInput = debounce === undefined ? originalPdsInput !== null && originalPdsInput !== void 0 ? originalPdsInput : pdsInput : debounceEvent(pdsInput, debounce);
    }
    valueChanged() {
        const nativeInput = this.nativeInput;
        const value = this.getValue();
        if (nativeInput && nativeInput.value !== value && !this.isComposing) {
            nativeInput.value = value;
        }
        // Update form value when value changes
        this.updateFormValue();
    }
    getValue() {
        return typeof this.value === 'number' ? this.value.toString() : (this.value || '').toString();
    }
    /**
     * Emits a pdsChange event
     */
    emitValueChange(event) {
        const { value } = this;
        const newValue = value == null ? value : value.toString();
        this.focusedValue = newValue;
        this.pdsChange.emit({ value: newValue, event });
    }
    /**
     * Emits a `pdsInput` event
     */
    emitInputChange(event) {
        const { value } = this;
        // Checks for both null and undefined values
        const newValue = value == null ? value : value.toString();
        this.pdsInput.emit({ value: newValue, event });
    }
    /**
     * Updates the form value using ElementInternals API
     */
    updateFormValue() {
        if (isSpecTest())
            return;
        if (this.internals && this.internals.setFormValue) {
            const value = this.getValue();
            this.internals.setFormValue(value || null);
            // Set validity based on native input validation
            if (this.nativeInput && this.internals && this.internals.setValidity) {
                this.internals.setValidity(this.nativeInput.validity, this.nativeInput.validationMessage, this.nativeInput);
            }
        }
    }
    /**
     * Form Associated Custom Elements API: Called when the form is reset
     */
    formResetCallback() {
        this.value = '';
        this.updateFormValue();
    }
    /**
     * Form Associated Custom Elements API: Called when the form is disabled
     */
    formDisabledCallback(disabled) {
        this.disabled = disabled;
    }
    /**
     * Form Associated Custom Elements API: Called to restore form state
     */
    formStateRestoreCallback(state) {
        if (typeof state === 'string') {
            this.value = state;
        }
        else if (state instanceof FormData && this.name) {
            // Extract value from FormData using the input's name
            const value = state.get(this.name);
            if (typeof value === 'string') {
                this.value = value;
            }
        }
    }
    render() {
        const { componentId, disabled, errorMessage, helperMessage, invalid = false, label, } = this;
        const value = this.getValue();
        const inputWrapperClasses = {
            'pds-input__field-wrapper': true,
            'has-focus': this.hasFocus,
            'has-error': invalid || !!errorMessage,
            'is-disabled': disabled,
            'has-prefix': this.hasPrefix,
            'has-suffix': this.hasSuffix,
            'has-prepend': this.hasPrepend,
            'has-append': this.hasAppend,
        };
        return (h(Host, { key: 'ecf4cc212e5c3ebc18082b790803e6b2ccb8ca77', "aria-disabled": this.disabled ? 'true' : null, "aria-readonly": this.readonly ? 'true' : null, "has-prefix": this.hasPrefix ? 'true' : null, "has-suffix": this.hasSuffix ? 'true' : null, "has-prepend": this.hasPrepend ? 'true' : null, "has-append": this.hasAppend ? 'true' : null, "has-action": this.hasAction && !this.hideLabel ? 'true' : null, "full-width": this.fullWidth ? 'true' : null }, h("div", { key: 'acdf92a30068fc04a17816ec6d85295b47e512ee', class: "pds-input" }, label && (h("div", { key: '4569f0b3761db89e85a090eff6af1c47cb562115', class: {
                'pds-input__label-wrapper': true,
                'visually-hidden': this.hideLabel,
            } }, h("label", { key: '90b0a863d78115fa158429db11548fc2a9ee5ae6', htmlFor: componentId, class: "pds-input__label" }, h("span", { key: '3d440aaafc4daeffe45152cd23d27472d7ebf85a' }, label, this.required && h("span", { key: 'c7bf6ef6191e961a106b8885cab604aa89730eba', class: "pds-input__required-indicator" }, " *"))), !this.hideLabel && this.renderAction())), h("div", { key: '81f0b8a347bc9a06c753b9f31f5e30ac78e45adb', class: inputWrapperClasses }, this.renderPrepend(), this.renderPrefix(), h("input", Object.assign({ key: '3785b396bf9174766973e8b19028e4dcecde19d9', ref: (input) => (this.nativeInput = input), class: "pds-input__field", "aria-describedby": assignDescription(componentId, invalid, helperMessage), "aria-invalid": invalid ? "true" : undefined, autocomplete: this.autocomplete, disabled: disabled, id: componentId, max: this.max, maxlength: this.maxlength, min: this.min, minlength: this.minlength, name: this.name, pattern: this.pattern, placeholder: this.placeholder, readOnly: this.readonly, required: this.required, step: this.step, type: this.type, value: value, onInput: this.onInputEvent, onChange: this.onChangeEvent, onBlur: this.onBlurEvent, onFocus: this.onFocusEvent, onKeyDown: this.onKeyDownEvent, onCompositionstart: this.onCompositionStart, onCompositionend: this.onCompositionEnd }, this.inheritedAttributes)), this.renderSuffix(), this.renderAppend()), helperMessage && (h("p", { key: 'e9e4aa936346811e0a5ca0fa5107f548b52fcc99', class: "pds-input__helper-message", id: messageId(componentId, 'helper') }, helperMessage)), errorMessage && (h("p", { key: 'ef3694246fa3d8f818da438e7ec4411dd56b084c', class: "pds-input__error-message", id: messageId(componentId, 'error') }, h("pds-icon", { key: '0e52079db701ca720cfa4d474107e55c85df5052', icon: danger, size: "small" }), errorMessage)))));
    }
    static get is() { return "pds-input"; }
    static get encapsulation() { return "shadow"; }
    static get formAssociated() { return true; }
    static get originalStyleUrls() {
        return {
            "$": ["pds-input.tokens.scss", "../../global/styles/utils/label.scss", "pds-input.scss"]
        };
    }
    static get styleUrls() {
        return {
            "$": ["pds-input.tokens.css", "../../global/styles/utils/label.css", "pds-input.css"]
        };
    }
    static get properties() {
        return {
            "autocomplete": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Specifies if and how the browser provides `autocomplete` assistance for the field."
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "autocomplete"
            },
            "componentId": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": true,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "A unique identifier used for the underlying component `id` attribute."
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "component-id"
            },
            "debounce": {
                "type": "number",
                "mutable": false,
                "complexType": {
                    "original": "number",
                    "resolved": "number",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Sets the number of milliseconds to wait before updating the value."
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "debounce"
            },
            "disabled": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Determines whether or not the input field is disabled."
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "disabled"
            },
            "errorMessage": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Specifies the error message and provides an error-themed treatment to the field."
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "error-message"
            },
            "helperMessage": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Displays a message or hint below the input field."
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "helper-message"
            },
            "invalid": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Determines whether or not the input field is invalid or throws an error."
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "invalid"
            },
            "label": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Text to be displayed as the input label."
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "label"
            },
            "hideLabel": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Visually hides the label text for instances where only the input should be displayed. Label remains accessible to assistive technology such as screen readers.\nNote: When true, the action slot is also hidden to maintain a minimal UI."
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "hide-label"
            },
            "max": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Specifies the maximum value for the input field."
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "max"
            },
            "maxlength": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Specifies the maximum number of characters allowed in the input field."
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "maxlength"
            },
            "min": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Specifies the minimum value for the input field."
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "min"
            },
            "minlength": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Specifies the minimum number of characters allowed in the input field."
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "minlength"
            },
            "name": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Specifies the name. Submitted with the form name/value pair."
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "name"
            },
            "pattern": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Specifies the regular expression that the input value is checked against."
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "pattern"
            },
            "placeholder": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Specifies a short hint that describes the expected value of the input field."
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "placeholder"
            },
            "readonly": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Determines whether or not the input field is readonly."
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "readonly"
            },
            "required": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Determines whether or not the input field is required."
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "required"
            },
            "step": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Works with the `min` and `max` attributes to define increments for the input field."
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "step"
            },
            "type": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [{
                            "name": "defaultValue",
                            "text": "\"text\""
                        }],
                    "text": "Determines the type of control that will be displayed\n`'email'`, `'number'`, `'password'`, `'tel'`, `'text'`, `'url'`"
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "type",
                "defaultValue": "'text'"
            },
            "value": {
                "type": "any",
                "mutable": true,
                "complexType": {
                    "original": "string | number | null",
                    "resolved": "number | string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "The value of the input."
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "value",
                "defaultValue": "''"
            },
            "fullWidth": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Determines whether or not the input field takes full width of its container."
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "full-width"
            },
            "highlight": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Applies highlight styling to the input field."
                },
                "getter": false,
                "setter": false,
                "reflect": true,
                "attribute": "highlight"
            }
        };
    }
    static get states() {
        return {
            "hasPrefix": {},
            "hasSuffix": {},
            "hasPrepend": {},
            "hasAppend": {},
            "hasAction": {},
            "hasFocus": {}
        };
    }
    static get events() {
        return [{
                "method": "pdsBlur",
                "name": "pdsBlur",
                "bubbles": true,
                "cancelable": true,
                "composed": true,
                "docs": {
                    "tags": [],
                    "text": "Emitted when the input loses focus."
                },
                "complexType": {
                    "original": "FocusEvent",
                    "resolved": "FocusEvent",
                    "references": {
                        "FocusEvent": {
                            "location": "global",
                            "id": "global::FocusEvent"
                        }
                    }
                }
            }, {
                "method": "pdsChange",
                "name": "pdsChange",
                "bubbles": true,
                "cancelable": true,
                "composed": true,
                "docs": {
                    "tags": [],
                    "text": "Emitted when the value has changed.\n\nThis event will not emit when programmatically setting the `value` property."
                },
                "complexType": {
                    "original": "InputChangeEventDetail",
                    "resolved": "InputChangeEventDetail",
                    "references": {
                        "InputChangeEventDetail": {
                            "location": "import",
                            "path": "./input-interface",
                            "id": "src/components/pds-input/input-interface.ts::InputChangeEventDetail"
                        }
                    }
                }
            }, {
                "method": "pdsFocus",
                "name": "pdsFocus",
                "bubbles": true,
                "cancelable": true,
                "composed": true,
                "docs": {
                    "tags": [],
                    "text": "Emitted when the input has focus."
                },
                "complexType": {
                    "original": "FocusEvent",
                    "resolved": "FocusEvent",
                    "references": {
                        "FocusEvent": {
                            "location": "global",
                            "id": "global::FocusEvent"
                        }
                    }
                }
            }, {
                "method": "pdsInput",
                "name": "pdsInput",
                "bubbles": true,
                "cancelable": true,
                "composed": true,
                "docs": {
                    "tags": [],
                    "text": "Emitted when a keyboard input occurs."
                },
                "complexType": {
                    "original": "InputInputEventDetail",
                    "resolved": "InputInputEventDetail",
                    "references": {
                        "InputInputEventDetail": {
                            "location": "import",
                            "path": "./input-interface",
                            "id": "src/components/pds-input/input-interface.ts::InputInputEventDetail"
                        }
                    }
                }
            }, {
                "method": "pdsKeyDown",
                "name": "pdsKeyDown",
                "bubbles": true,
                "cancelable": true,
                "composed": true,
                "docs": {
                    "tags": [],
                    "text": "Emitted when a key is pressed down in the input."
                },
                "complexType": {
                    "original": "KeyboardEvent",
                    "resolved": "KeyboardEvent",
                    "references": {
                        "KeyboardEvent": {
                            "location": "global",
                            "id": "global::KeyboardEvent"
                        }
                    }
                }
            }];
    }
    static get methods() {
        return {
            "setFocus": {
                "complexType": {
                    "signature": "() => Promise<void>",
                    "parameters": [],
                    "references": {
                        "Promise": {
                            "location": "global",
                            "id": "global::Promise"
                        }
                    },
                    "return": "Promise<void>"
                },
                "docs": {
                    "text": "Sets focus on the native `input` in the `pds-input`. Use this method instead of the global\n`input.focus()`.",
                    "tags": []
                }
            }
        };
    }
    static get elementRef() { return "el"; }
    static get watchers() {
        return [{
                "propName": "debounce",
                "methodName": "debounceChanged"
            }, {
                "propName": "value",
                "methodName": "valueChanged"
            }];
    }
}
//# sourceMappingURL=pds-input.js.map
