import { h } from "@stencil/core";
// TODO
// - max-height customisable
// - matching string
// - résultats de liste accessibles (scroll)
export class SpwSearchField {
    constructor() {
        /** Valeur actuelle du champ de recherche */
        this.value = '';
        /** Placeholder à afficher dans le champ de recherche */
        this.placeholder = 'Recherche...';
        /** Taille du champ de recherche */
        this.size = 'medium';
        /** Label associé au champ de recherche */
        this.label = '';
        /** Indique si le champ est requis */
        this.required = false;
        /** Texte du lien pour voir tous les résultats */
        this.viewAllResults = 'Voir plus de résultats';
        /** Soumet le formulaire parent au clic sur le lien "voir tous les résultats" */
        this.viewAllResultsSubmit = false;
        /** Texte à afficher si pas de résultats */
        this.noResults = 'Pas de résultats.';
        /** Texte à afficher pendant le chargement */
        this.loadingText = 'Recherche en cours...';
        /** Affiche un bouton submit (loupe) qui déclenche le submit du formulaire parent */
        this.hasSubmitButton = false;
        /** Nombre minimum de caractères requis pour déclencher la recherche */
        this.minCharacters = 3;
        /** Indique si le champ est en cours de chargement */
        this.isLoading = false;
        /** Indique si le dropdown de résultats doit être affiché */
        this.showDropdown = true;
        /** Positionnement du tooltip */
        this.tooltipDirection = 'top';
        /** Curseur du tooltip */
        this.tooltipCursor = 'help';
        this.filteredItems = [];
        this.parsedItems = [];
        this.searchText = '';
        this.isOpen = false;
        this.focusedItemIndex = null;
        this.dropdownDirection = 'down';
        this.isSelectingItem = false;
        this.handleClickOutside = (event) => {
            if (this.isOpen) {
                const target = event.composedPath()[0];
                const isInsideHost = this.hostElement.contains(target);
                if (!isInsideHost) {
                    this.isOpen = false;
                }
            }
        };
        this.handleValueChanged = (event) => {
            const newValue = String(event.detail);
            if (this.isSelectingItem) {
                return;
            }
            this.searchText = newValue;
            this.value = newValue;
            this.updateHiddenInput();
            if (this.filterTimeout) {
                clearTimeout(this.filterTimeout);
            }
            if (!this.searchText || this.searchText.length < this.minCharacters) {
                this.isOpen = false;
            }
            else {
                if (!this.isOpen && this.showDropdown) {
                    this.isOpen = true;
                    this.determineDropdownDirection();
                }
                this.filterTimeout = setTimeout(() => {
                    this.filterItems();
                }, 300);
            }
            this.valueChanged.emit(this.value);
        };
        this.handleSubmit = (event) => {
            event === null || event === void 0 ? void 0 : event.preventDefault();
            const form = this.el.closest('form');
            if (form) {
                form.requestSubmit();
            }
        };
    }
    componentWillLoad() {
        this.parseItems(this.items);
        this.defaultValue = this.value;
        this.initializeFromValue(this.value);
    }
    componentDidLoad() {
        document.addEventListener('click', this.handleClickOutside);
        this.createHiddenInput();
    }
    createHiddenInput() {
        if (this.name) {
            this.hiddenInput = document.createElement('input');
            this.hiddenInput.type = 'hidden';
            this.hiddenInput.name = this.name;
            this.hiddenInput.value = this.value || '';
            this.el.appendChild(this.hiddenInput);
        }
    }
    updateHiddenInput() {
        if (this.hiddenInput) {
            this.hiddenInput.value = this.value || '';
        }
    }
    initializeFromValue(val) {
        if (!val) {
            this.searchText = '';
            return;
        }
        const matchingItem = this.parsedItems.find(item => String(item.value) === val);
        if (matchingItem) {
            this.searchText = matchingItem.label;
        }
        else {
            this.searchText = val;
        }
    }
    disconnectedCallback() {
        document.removeEventListener('click', this.handleClickOutside);
        if (this.filterTimeout) {
            clearTimeout(this.filterTimeout);
        }
    }
    /** Réinitialise le champ de recherche */
    async resetInput() {
        this.value = this.defaultValue || '';
        this.initializeFromValue(this.value);
        this.updateHiddenInput();
        this.isOpen = false;
        this.focusedItemIndex = null;
        this.valueChanged.emit(this.value);
    }
    /** Définit la valeur du champ de recherche */
    async setValue(newValue) {
        this.value = newValue;
        this.initializeFromValue(newValue);
        this.filterItems();
        this.valueChanged.emit(this.value);
    }
    /** Récupère la valeur actuelle du champ de recherche */
    async getValue() {
        return this.value;
    }
    handleValueChange(newValue) {
        this.initializeFromValue(newValue !== null && newValue !== void 0 ? newValue : '');
        this.filterItems();
    }
    parseItems(newValue) {
        if (!newValue) {
            this.parsedItems = [];
            this.filteredItems = [];
            return;
        }
        if (Array.isArray(newValue)) {
            this.parsedItems = newValue;
        }
        else {
            try {
                this.parsedItems = JSON.parse(newValue);
            }
            catch (e) {
                console.error('Invalid JSON format for items:', newValue);
                this.parsedItems = [];
            }
        }
        this.filteredItems = [...this.parsedItems];
    }
    filterItems() {
        if (!this.parsedItems.length) {
            this.filteredItems = [];
            return;
        }
        const normalizedSearchText = this.normalizeString(this.searchText);
        this.filteredItems = this.parsedItems.filter(item => !item.disabled && this.normalizeString(item.label).includes(normalizedSearchText));
    }
    normalizeString(str) {
        return str
            .normalize('NFD')
            .replace(/[\u0300-\u036f]/g, '')
            .toLowerCase();
    }
    selectItem(item) {
        var _a;
        this.isSelectingItem = true;
        this.searchText = item.label;
        this.value = String((_a = item.value) !== null && _a !== void 0 ? _a : item.label);
        this.isOpen = false;
        this.focusedItemIndex = null;
        this.updateHiddenInput();
        this.filterItems();
        this.optionSelected.emit(item);
        this.valueChanged.emit(this.value);
        setTimeout(() => {
            this.isSelectingItem = false;
        }, 200);
        if (item.url) {
            window.location.href = item.url;
        }
    }
    determineDropdownDirection() {
        const rect = this.hostElement.getBoundingClientRect();
        const viewportHeight = window.innerHeight;
        if (rect.bottom + 200 > viewportHeight && rect.top > 200) {
            this.dropdownDirection = 'up';
        }
        else {
            this.dropdownDirection = 'down';
        }
    }
    handleKeyDown(event) {
        switch (event.key) {
            case 'ArrowDown':
                event.preventDefault();
                if (this.isOpen) {
                    this.focusedItemIndex = this.focusedItemIndex === null ? 0 : (this.focusedItemIndex + 1) % this.filteredItems.length;
                }
                break;
            case 'ArrowUp':
                event.preventDefault();
                if (this.isOpen) {
                    this.focusedItemIndex =
                        this.focusedItemIndex === null ? this.filteredItems.length - 1 : (this.focusedItemIndex - 1 + this.filteredItems.length) % this.filteredItems.length;
                }
                break;
            case 'Enter':
                if (this.isOpen && this.focusedItemIndex !== null) {
                    event.preventDefault();
                    this.selectItem(this.filteredItems[this.focusedItemIndex]);
                }
                else if (this.hasSubmitButton) {
                    event.preventDefault();
                    this.handleSubmit(event);
                }
                break;
            case 'Escape':
                this.isOpen = false;
                break;
        }
    }
    highlightMatch(item) {
        const normalizedSearchText = this.normalizeString(this.searchText);
        const normalizedItem = this.normalizeString(item);
        const startIndex = normalizedItem.indexOf(normalizedSearchText);
        if (startIndex === -1 || !this.searchText) {
            return item;
        }
        const endIndex = startIndex + normalizedSearchText.length;
        return (h("span", null, item.slice(0, startIndex), h("strong", null, item.slice(startIndex, endIndex)), item.slice(endIndex)));
    }
    get elementClass() {
        return {
            'spw-search-field': true,
            'spw-search-field--is-rounded': this.isRounded,
            'spw-search-field--has-submit-button': this.hasSubmitButton,
            'spw-search-field--is-open': this.isOpen,
            [`spw-search-field--${this.size}`]: true,
        };
    }
    render() {
        return (h("div", { key: '5837b60701c5adffa83e5ce64b2404c5d053c161', ref: el => (this.hostElement = el), class: this.elementClass }, this.label && (h("spw-field-label", { key: '1ef0c03b22c5aaa411c5f8e066cb09e1534b9e9d', label: this.label, name: this.name, required: this.required, tooltipTitle: this.tooltipTitle, tooltipText: this.tooltipText, tooltipMaxWidth: this.tooltipMaxWidth, tooltipDirection: this.tooltipDirection, tooltipCursor: this.tooltipCursor, onClick: () => { var _a; return (_a = this.textFieldElement) === null || _a === void 0 ? void 0 : _a.setFocus(); } })), h("div", { key: 'c3e4353df5ede82c0724535c93e38e54a360e13b', class: "spw-search-field__container" }, h("spw-text-field", { key: '7c8651c36d9d37929782972c02f7361095a9c584', ref: el => (this.textFieldElement = el), placeholder: this.placeholder, name: this.name, size: this.size, "is-search": true, "is-clear": true, required: this.required, disabled: this.disabled, assistiveText: this.assistiveText, value: this.searchText, onValueChanged: this.handleValueChanged, onKeyDown: event => this.handleKeyDown(event) }), this.hasSubmitButton && h("button", { key: '7bfed3b469a2bd50f08b7c071ace067641e3d173', type: "button", class: "spw-search-field__submit", onClick: this.handleSubmit, "aria-label": "Rechercher" })), this.showDropdown && this.isOpen && !!this.items && (h("div", { key: '9505e7903d1ab159afd59264e5c3c9cfdfd14c07', class: `spw-search-field__options spw-search-field__options--${this.dropdownDirection}` }, !!this.filteredItems.length && (h("ul", { key: '9655a5877ce3adc25703f44b7abb2a0f8c4b3a1e' }, this.filteredItems.map((item, index) => (h("li", { class: {
                'spw-search-field__option': true,
                'spw-search-field__option--focused': index === this.focusedItemIndex,
            }, onClick: () => this.selectItem(item) }, this.highlightMatch(item.label), " ", item.category && h("span", { class: "spw-search-field__category" }, " - ", item.category)))))), this.isLoading && (h("p", { key: 'ca7c114f02d66f03803edd7ba38e248da7319f9d', class: "spw-search-field__loading" }, h("spw-loading", { key: 'ca1d7ba8f7997fffdc94d38210ab45672fe275ca', text: this.loadingText }))), !this.isLoading && !this.filteredItems.length && h("p", { key: 'a3c9452107ec03b68ca1523544fa0f9075423452', class: "spw-search-field__no-results" }, this.noResults), !!this.filteredItems.length && this.viewAllResults && (h("p", { key: 'ed530b7e1b28ca9e809031a94c86138603a85902', class: "spw-search-field__view-all" }, h("a", { key: 'c2b9e5605e4dc849b1c715e9ae66830062884495', href: this.viewAllResultsLink, onClick: this.viewAllResultsSubmit ? this.handleSubmit : undefined }, this.viewAllResults, " ", h("spw-icon", { key: 'f5dae623c2204783d04f9ad45b8c89909b447be6', icon: "fa-arrow-right" }))))))));
    }
    static get is() { return "spw-search-field"; }
    static get encapsulation() { return "shadow"; }
    static get originalStyleUrls() {
        return {
            "$": ["spw-search-field.scss"]
        };
    }
    static get styleUrls() {
        return {
            "$": ["spw-search-field.css"]
        };
    }
    static get properties() {
        return {
            "value": {
                "type": "string",
                "mutable": true,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Valeur actuelle du champ de recherche"
                },
                "getter": false,
                "setter": false,
                "reflect": true,
                "attribute": "value",
                "defaultValue": "''"
            },
            "items": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "SearchItem[] | string",
                    "resolved": "SearchItem[] | string",
                    "references": {
                        "SearchItem": {
                            "location": "local",
                            "path": "/Users/pectonite/Desktop/SPW/spw-design-system/packages/spw-stencil-library/src/components/spw-search-field/spw-search-field.tsx",
                            "id": "src/components/spw-search-field/spw-search-field.tsx::SearchItem"
                        }
                    }
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Liste des \u00E9l\u00E9ments \u00E0 filtrer"
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "items"
            },
            "placeholder": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Placeholder \u00E0 afficher dans le champ de recherche"
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "placeholder",
                "defaultValue": "'Recherche...'"
            },
            "size": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "'large' | 'medium'",
                    "resolved": "\"large\" | \"medium\"",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Taille du champ de recherche"
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "size",
                "defaultValue": "'medium'"
            },
            "label": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Label associ\u00E9 au champ de recherche"
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "label",
                "defaultValue": "''"
            },
            "disabled": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Indique si le champ de recherche est d\u00E9sactiv\u00E9"
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "disabled"
            },
            "isRounded": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Indique si le champ de recherche est arrondi ou pas (commun\u00E9ment utilis\u00E9 dans un hero banner)"
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "is-rounded"
            },
            "name": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Nom du champ de recherche, utilis\u00E9 pour les formulaires"
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "name"
            },
            "required": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Indique si le champ est requis"
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "required",
                "defaultValue": "false"
            },
            "assistiveText": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Texte d'assistance affich\u00E9 sous le label"
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "assistive-text"
            },
            "viewAllResults": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Texte du lien pour voir tous les r\u00E9sultats"
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "view-all-results",
                "defaultValue": "'Voir plus de r\u00E9sultats'"
            },
            "viewAllResultsLink": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "URL vers laquelle renvoie le lien \"voir tous les r\u00E9sultats\""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "view-all-results-link"
            },
            "viewAllResultsSubmit": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Soumet le formulaire parent au clic sur le lien \"voir tous les r\u00E9sultats\""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "view-all-results-submit",
                "defaultValue": "false"
            },
            "noResults": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Texte \u00E0 afficher si pas de r\u00E9sultats"
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "no-results",
                "defaultValue": "'Pas de r\u00E9sultats.'"
            },
            "loadingText": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Texte \u00E0 afficher pendant le chargement"
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "loading-text",
                "defaultValue": "'Recherche en cours...'"
            },
            "hasSubmitButton": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Affiche un bouton submit (loupe) qui d\u00E9clenche le submit du formulaire parent"
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "has-submit-button",
                "defaultValue": "false"
            },
            "minCharacters": {
                "type": "number",
                "mutable": false,
                "complexType": {
                    "original": "number",
                    "resolved": "number",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Nombre minimum de caract\u00E8res requis pour d\u00E9clencher la recherche"
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "min-characters",
                "defaultValue": "3"
            },
            "isLoading": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Indique si le champ est en cours de chargement"
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "is-loading",
                "defaultValue": "false"
            },
            "showDropdown": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Indique si le dropdown de r\u00E9sultats doit \u00EAtre affich\u00E9"
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "show-dropdown",
                "defaultValue": "true"
            },
            "tooltipTitle": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Titre du tooltip"
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "tooltip-title"
            },
            "tooltipText": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Texte du tooltip"
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "tooltip-text"
            },
            "tooltipMaxWidth": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Largeur maximale du tooltip"
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "tooltip-max-width"
            },
            "tooltipDirection": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "'top' | 'bottom' | 'left' | 'right'",
                    "resolved": "\"bottom\" | \"left\" | \"right\" | \"top\"",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Positionnement du tooltip"
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "tooltip-direction",
                "defaultValue": "'top'"
            },
            "tooltipCursor": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "'pointer' | 'default' | 'help' | 'disabled'",
                    "resolved": "\"default\" | \"disabled\" | \"help\" | \"pointer\"",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Curseur du tooltip"
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "tooltip-cursor",
                "defaultValue": "'help'"
            }
        };
    }
    static get states() {
        return {
            "filteredItems": {},
            "parsedItems": {},
            "searchText": {},
            "isOpen": {},
            "focusedItemIndex": {},
            "dropdownDirection": {}
        };
    }
    static get events() {
        return [{
                "method": "valueChanged",
                "name": "valueChanged",
                "bubbles": true,
                "cancelable": true,
                "composed": true,
                "docs": {
                    "tags": [],
                    "text": "\u00C9v\u00E9nement \u00E9mis lorsque la valeur du champ de recherche change"
                },
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                }
            }, {
                "method": "optionSelected",
                "name": "optionSelected",
                "bubbles": true,
                "cancelable": true,
                "composed": true,
                "docs": {
                    "tags": [],
                    "text": "\u00C9v\u00E9nement \u00E9mis lorsqu'une option est s\u00E9lectionn\u00E9e dans le dropdown"
                },
                "complexType": {
                    "original": "SearchItem",
                    "resolved": "SearchItem",
                    "references": {
                        "SearchItem": {
                            "location": "local",
                            "path": "/Users/pectonite/Desktop/SPW/spw-design-system/packages/spw-stencil-library/src/components/spw-search-field/spw-search-field.tsx",
                            "id": "src/components/spw-search-field/spw-search-field.tsx::SearchItem"
                        }
                    }
                }
            }];
    }
    static get methods() {
        return {
            "resetInput": {
                "complexType": {
                    "signature": "() => Promise<void>",
                    "parameters": [],
                    "references": {
                        "Promise": {
                            "location": "global",
                            "id": "global::Promise"
                        }
                    },
                    "return": "Promise<void>"
                },
                "docs": {
                    "text": "R\u00E9initialise le champ de recherche",
                    "tags": []
                }
            },
            "setValue": {
                "complexType": {
                    "signature": "(newValue: string) => Promise<void>",
                    "parameters": [{
                            "name": "newValue",
                            "type": "string",
                            "docs": ""
                        }],
                    "references": {
                        "Promise": {
                            "location": "global",
                            "id": "global::Promise"
                        }
                    },
                    "return": "Promise<void>"
                },
                "docs": {
                    "text": "D\u00E9finit la valeur du champ de recherche",
                    "tags": []
                }
            },
            "getValue": {
                "complexType": {
                    "signature": "() => Promise<string>",
                    "parameters": [],
                    "references": {
                        "Promise": {
                            "location": "global",
                            "id": "global::Promise"
                        }
                    },
                    "return": "Promise<string>"
                },
                "docs": {
                    "text": "R\u00E9cup\u00E8re la valeur actuelle du champ de recherche",
                    "tags": []
                }
            }
        };
    }
    static get elementRef() { return "el"; }
    static get watchers() {
        return [{
                "propName": "value",
                "methodName": "handleValueChange"
            }, {
                "propName": "items",
                "methodName": "parseItems"
            }];
    }
}
