import { h } from "@stencil/core";
export class SpwTextField {
    constructor() {
        /** Type d'input à rendre, par exemple, "text", "password", etc. */
        this.type = 'text';
        /** Texte à afficher au-dessus du champ de saisie */
        this.label = '';
        /** Indique si l'input est un champ de recherche */
        this.isSearch = false;
        /** Indique si le champ peut être effacé avec un bouton */
        this.isClear = false;
        /** Indique si l'input est requis */
        this.required = false;
        /** Spécifie la taille du champ de saisie : 'large' ou 'medium' */
        this.size = 'medium';
        /** Message d'erreur à afficher sous le champ */
        this.error = '';
        /** Message d'indication (hint) à afficher sous le champ */
        this.hint = '';
        /** Message de succès à afficher sous le champ */
        this.success = '';
        /** Message de warning à afficher sous le champ */
        this.warning = '';
        /** Affiche une icône d'erreur si vrai */
        this.showErrorIcon = true;
        /** Affiche une icône d'indication si vrai */
        this.showHintIcon = true;
        /** Affiche une icône de succès si vrai */
        this.showSuccessIcon = true;
        /** Affiche une icône de warning si vrai */
        this.showWarningIcon = true;
        /** Aria-label pour le bouton d'incrémentation (input number) */
        this.accAriaLabelIncrement = 'Incrémenter';
        /** Aria-label pour le bouton de décrémentation (input number) */
        this.accAriaLabelDecrement = 'Décrémenter';
        /** Si true, affiche les boutons +/- pour les champs numériques */
        this.hasControls = true;
        /** Affiche un bouton submit (loupe) qui déclenche le submit du formulaire parent */
        this.hasSubmitButton = false;
        /** Positionnement du tooltip */
        this.tooltipDirection = 'top';
        /** Curseur du tooltip */
        this.tooltipCursor = 'help';
        this.isClearIconVisible = false;
    }
    /** Méthode publique pour mettre le focus sur le champ de saisie. */
    async setFocus() {
        var _a;
        (_a = this.inputElement) === null || _a === void 0 ? void 0 : _a.focus();
    }
    valueChangedHandler(newValue) {
        this.setValue(this.normalizeDecimalSeparator(newValue != null ? String(newValue) : ''));
    }
    async setValue(newVal) {
        const formatted = this.mask ? this.applyMask(newVal) : newVal;
        if (this.inputElement && this.inputElement.value !== formatted) {
            this.inputElement.value = formatted;
        }
        if (this.value === formatted) {
            return;
        }
        this.value = formatted;
        const emitValue = this.getTypedValue(formatted);
        this.internals.setFormValue(emitValue ? String(emitValue) : null);
        this.isClearIconVisible = this.isClear && !!formatted;
        this.valueChanged.emit(emitValue);
    }
    getTypedValue(value) {
        if (!value)
            return '';
        if (this.type === 'number' && !isNaN(Number(value))) {
            return Number(value);
        }
        return value;
    }
    componentDidLoad() {
        const startValue = this.normalizeDecimalSeparator(this.value != null ? String(this.value) : '');
        this.defaultValue = startValue;
        if (this.inputElement) {
            this.inputElement.value = startValue;
        }
        const typedValue = this.getTypedValue(startValue);
        this.internals.setFormValue(typedValue ? String(typedValue) : null);
        this.isClearIconVisible = this.isClear && !!startValue;
    }
    formResetCallback() {
        var _a;
        this.setValue((_a = this.defaultValue) !== null && _a !== void 0 ? _a : '');
    }
    handleInput(event) {
        this.setValue(event.target.value);
    }
    handleClear() {
        this.setValue('');
    }
    handleKeyDown(event) {
        var _a, _b, _c, _d, _e;
        if (event.key === 'Enter' && this.hasSubmitButton) {
            event.preventDefault();
            this.handleSubmit();
        }
        if (this.type === 'number' && this.decimalPrecision != null) {
            const input = this.inputElement;
            const currentValue = (_a = input === null || input === void 0 ? void 0 : input.value) !== null && _a !== void 0 ? _a : '';
            const key = event.key;
            if (['Backspace', 'Delete', 'ArrowLeft', 'ArrowRight', 'ArrowUp', 'ArrowDown', 'Tab', 'Enter', 'Home', 'End'].includes(key))
                return;
            if (event.ctrlKey || event.metaKey)
                return;
            if (key === ',' || key === '.') {
                event.preventDefault();
                if (!currentValue.includes('.')) {
                    const start = (_b = input.selectionStart) !== null && _b !== void 0 ? _b : currentValue.length;
                    const end = (_c = input.selectionEnd) !== null && _c !== void 0 ? _c : currentValue.length;
                    const newValue = currentValue.slice(0, start) + '.' + currentValue.slice(end);
                    input.value = newValue;
                    input.setSelectionRange(start + 1, start + 1);
                    this.setValue(newValue);
                }
                return;
            }
            if (key === '-') {
                if (input.selectionStart !== 0 || currentValue.includes('-')) {
                    event.preventDefault();
                }
                return;
            }
            if (!/^[0-9]$/.test(key)) {
                event.preventDefault();
                return;
            }
            const dotIndex = currentValue.indexOf('.');
            if (dotIndex !== -1) {
                const selectionStart = (_d = input === null || input === void 0 ? void 0 : input.selectionStart) !== null && _d !== void 0 ? _d : currentValue.length;
                const selectionEnd = (_e = input === null || input === void 0 ? void 0 : input.selectionEnd) !== null && _e !== void 0 ? _e : currentValue.length;
                const selectedLength = selectionEnd - selectionStart;
                const decimals = currentValue.slice(dotIndex + 1);
                if (selectionStart > dotIndex && decimals.length - selectedLength >= this.decimalPrecision) {
                    event.preventDefault();
                }
            }
        }
    }
    handleSubmit() {
        const form = this.el.closest('form');
        if (form) {
            form.requestSubmit();
        }
    }
    normalizeDecimalSeparator(value) {
        if (this.type === 'number' && this.decimalPrecision != null) {
            return value.replace(',', '.');
        }
        return value;
    }
    roundToPrecision(value) {
        if (this.decimalPrecision == null)
            return value;
        const factor = Math.pow(10, this.decimalPrecision);
        return Math.round(value * factor) / factor;
    }
    getCurrentNumericValue() {
        var _a, _b, _c, _d;
        const raw = this.decimalPrecision != null ? ((_b = (_a = this.inputElement) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : String((_c = this.value) !== null && _c !== void 0 ? _c : '')) : String((_d = this.value) !== null && _d !== void 0 ? _d : '');
        const parsed = Number(raw);
        return isNaN(parsed) ? 0 : parsed;
    }
    increment() {
        var _a;
        if (this.disabled)
            return;
        const stepValue = (_a = this.step) !== null && _a !== void 0 ? _a : 1;
        let newValue = this.roundToPrecision(this.getCurrentNumericValue() + stepValue);
        if (this.max != null && newValue > this.max) {
            newValue = this.max;
        }
        this.setValue(String(newValue));
    }
    decrement() {
        var _a;
        if (this.disabled)
            return;
        const stepValue = (_a = this.step) !== null && _a !== void 0 ? _a : 1;
        let newValue = this.roundToPrecision(this.getCurrentNumericValue() - stepValue);
        if (this.min != null && newValue < this.min) {
            newValue = this.min;
        }
        this.setValue(String(newValue));
    }
    unmask(value) {
        if (!value)
            return '';
        if (this.type === 'number') {
            return value.replace(/[^0-9.,\-]/g, '');
        }
        return value.replace(/[^0-9A-Za-z]/g, '');
    }
    matchesPlaceholder(char, placeholder) {
        switch (placeholder) {
            case '9':
                return /[0-9]/.test(char);
            case 'A':
                return /[A-Za-z]/.test(char);
            case 'a':
                return /[A-Za-z]/.test(char);
            case 'X':
                return /[0-9A-Za-z]/.test(char);
            default:
                return false;
        }
    }
    transformForPlaceholder(char, placeholder) {
        switch (placeholder) {
            case 'A':
                return char.toUpperCase();
            default:
                return char;
        }
    }
    applyMask(rawOrMasked) {
        if (!this.mask)
            return rawOrMasked;
        const rawChars = this.unmask(rawOrMasked).split('');
        let rawIndex = 0;
        let result = '';
        for (let i = 0; i < this.mask.length; i++) {
            const p = this.mask[i];
            if (['9', 'A', 'a', 'X'].includes(p)) {
                while (rawIndex < rawChars.length && !this.matchesPlaceholder(rawChars[rawIndex], p)) {
                    rawIndex++;
                }
                if (rawIndex >= rawChars.length) {
                    break;
                }
                const ch = this.transformForPlaceholder(rawChars[rawIndex], p);
                result += ch;
                rawIndex++;
            }
            else {
                if (rawIndex >= rawChars.length) {
                    break;
                }
                result += p;
            }
        }
        return result;
    }
    renderErrorMessage() {
        if (this.error) {
            return (h("spw-field-message", { variant: "error", showIcon: this.showErrorIcon }, this.error));
        }
    }
    renderHintMessage() {
        if (this.hint) {
            return (h("spw-field-message", { variant: "hint", showIcon: this.showHintIcon }, this.hint));
        }
    }
    renderSuccessMessage() {
        if (this.success) {
            return (h("spw-field-message", { variant: "success", showIcon: this.showSuccessIcon }, this.success));
        }
    }
    renderWarningMessage() {
        if (this.warning) {
            return (h("spw-field-message", { variant: "warning", showIcon: this.showWarningIcon }, this.warning));
        }
    }
    get elementClass() {
        const isNumber = this.type === 'number';
        return {
            'spw-text-field': true,
            [`spw-text-field--${this.size}`]: true,
            'spw-text-field--is-search': this.isSearch,
            'spw-text-field--is-error': !!this.error,
            'spw-text-field--is-clear': this.isClearIconVisible,
            'spw-text-field--is-number': isNumber,
            'spw-text-field--has-controls': isNumber && this.hasControls,
            'spw-text-field--has-submit-button': this.hasSubmitButton,
            'spw-text-field--disabled': this.disabled,
        };
    }
    render() {
        return (h("div", { key: '41344c0a7baae0b78740a2e79bd60fe39cc5e1e8', class: this.elementClass }, this.label && (h("spw-field-label", { key: 'c544f2b87e9a5f140cd554e78e7b5cef504ed5b3', label: this.label, name: this.name, required: this.required, tooltipTitle: this.tooltipTitle, tooltipText: this.tooltipText, tooltipMaxWidth: this.tooltipMaxWidth, tooltipDirection: this.tooltipDirection, tooltipCursor: this.tooltipCursor })), this.assistiveText && (h("spw-field-message", { key: '91242a77c6e88000abda5d0dcb8759a38246c643', class: "spw-text-field__field-message", variant: "hint", showIcon: false }, this.assistiveText)), h("div", { key: '7bc7fe0d449a9780ac30a0770daf3f6b536cbf3e', class: "spw-text-field__container" }, this.type === 'number' && this.hasControls && (h("button", { key: '71b161b15cbd13c05f6b91c7708f8989705d5ebe', type: "button", class: "spw-text-field__number-btn spw-text-field__number-btn--decrement", onClick: () => this.decrement(), disabled: this.disabled || (this.min != null && Number(this.value) <= this.min), "aria-label": this.accAriaLabelDecrement }, h("spw-icon", { key: '4dc4e23dc7bed73b2ca9e206baa779bc5d23cdcc', icon: "fa-minus" }))), h("div", { key: '636cb26b066ed37b81f0c4d10d12076d407b2431', class: "spw-text-field__input-container" }, h("input", { key: '5a1b62cea32b86cda3127355d906bef1059c2370', class: "spw-text-field__input", ref: el => (this.inputElement = el), type: this.type === 'number' && (this.decimalPrecision != null || this.mask != null) ? 'text' : this.type, inputMode: this.type === 'number' && (this.decimalPrecision != null || this.mask != null) ? 'decimal' : undefined, min: this.type === 'number' && this.decimalPrecision == null && this.mask == null ? this.min : undefined, max: this.type === 'number' && this.decimalPrecision == null && this.mask == null ? this.max : undefined, step: this.type === 'number' && this.decimalPrecision == null && this.mask == null ? this.step : undefined, placeholder: this.placeholder, "aria-label": this.accAriaLabel || this.name, disabled: this.disabled, name: this.name, id: this.name, minLength: this.minLength, maxLength: this.maxLength, required: this.required, onInput: event => this.handleInput(event), onKeyDown: event => this.handleKeyDown(event) }), (this.isSearch || this.isClearIconVisible) && (h("div", { key: 'b0fbe8933d0525fd0c96b98ed20e777b4eb35802', class: "spw-text-field__icons" }, this.isClearIconVisible && (h("span", { key: '4de26508d572433ef32e8c041231050ee4f92817', class: "spw-text-field__clear", onClick: () => this.handleClear() }, h("spw-icon", { key: '09824f121d156c07e766e45faf96eb6e98b3577b', class: "spw-text-field__icon spw-text-field__icon--clear", icon: "fa-xmark" }))), this.isSearch && !this.hasSubmitButton && h("spw-icon", { key: '53d6e02efb0affe2fc302794119fc5f899f9f8a2', class: "spw-text-field__icon spw-text-field__icon--search", icon: "fa-magnifying-glass" }), this.hasSubmitButton && (h("button", { key: '011bd3f9db935cfcd677462a304d5ee2023bf079', type: "button", class: "spw-text-field__submit", onClick: () => this.handleSubmit(), "aria-label": "Rechercher" }, h("spw-icon", { key: '598ab546dabe19878ef9d4e96bb295d9e65ad021', icon: "fa-magnifying-glass" })))))), this.type === 'number' && this.hasControls && (h("button", { key: 'afef9bbbc44017125e83dab064054aad7ca69a9a', type: "button", class: "spw-text-field__number-btn spw-text-field__number-btn--increment", onClick: () => this.increment(), disabled: this.disabled || (this.max != null && Number(this.value) >= this.max), "aria-label": this.accAriaLabelIncrement }, h("spw-icon", { key: 'd466c191cdde8512b129fd268a61ea1c95a23e3c', icon: "fa-plus" }))), this.indicator && h("div", { key: '67e9077028fba14909aea13c9e8cacb698e42085', class: "spw-text-field__indicator" }, this.indicator)), this.renderErrorMessage(), this.renderHintMessage(), this.renderSuccessMessage(), this.renderWarningMessage()));
    }
    static get is() { return "spw-text-field"; }
    static get encapsulation() { return "shadow"; }
    static get formAssociated() { return true; }
    static get originalStyleUrls() {
        return {
            "$": ["spw-text-field.scss"]
        };
    }
    static get styleUrls() {
        return {
            "$": ["spw-text-field.css"]
        };
    }
    static get properties() {
        return {
            "value": {
                "type": "any",
                "mutable": true,
                "complexType": {
                    "original": "string | number",
                    "resolved": "number | string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Valeur actuelle du champ de saisie, mutable et refl\u00E9t\u00E9e dans le DOM"
                },
                "getter": false,
                "setter": false,
                "reflect": true,
                "attribute": "value"
            },
            "type": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Type d'input \u00E0 rendre, par exemple, \"text\", \"password\", etc."
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "type",
                "defaultValue": "'text'"
            },
            "label": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Texte \u00E0 afficher au-dessus du champ de saisie"
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "label",
                "defaultValue": "''"
            },
            "placeholder": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Texte du placeholder pour le champ de saisie"
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "placeholder"
            },
            "disabled": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Si `true`, le champ de saisie est d\u00E9sactiv\u00E9 et ne peut pas \u00EAtre utilis\u00E9"
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "disabled"
            },
            "name": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Attribut `name` de l'\u00E9l\u00E9ment input"
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "name"
            },
            "min": {
                "type": "number",
                "mutable": false,
                "complexType": {
                    "original": "number",
                    "resolved": "number",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Valeur minimale dans le cas d'un input number"
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "min"
            },
            "max": {
                "type": "number",
                "mutable": false,
                "complexType": {
                    "original": "number",
                    "resolved": "number",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Valeur maximale dans le cas d'un input number"
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "max"
            },
            "step": {
                "type": "number",
                "mutable": false,
                "complexType": {
                    "original": "number",
                    "resolved": "number",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Valeur d'incr\u00E9mentation dans le cas d'un input number"
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "step"
            },
            "minLength": {
                "type": "number",
                "mutable": false,
                "complexType": {
                    "original": "number",
                    "resolved": "number",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Longueur minimale pour la valeur de l'input"
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "min-length"
            },
            "maxLength": {
                "type": "number",
                "mutable": false,
                "complexType": {
                    "original": "number",
                    "resolved": "number",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Longueur maximale pour la valeur de l'input"
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "max-length"
            },
            "isSearch": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Indique si l'input est un champ de recherche"
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "is-search",
                "defaultValue": "false"
            },
            "isClear": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Indique si le champ peut \u00EAtre effac\u00E9 avec un bouton"
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "is-clear",
                "defaultValue": "false"
            },
            "required": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Indique si l'input est requis"
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "required",
                "defaultValue": "false"
            },
            "size": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "'large' | 'medium'",
                    "resolved": "\"large\" | \"medium\"",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Sp\u00E9cifie la taille du champ de saisie : 'large' ou 'medium'"
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "size",
                "defaultValue": "'medium'"
            },
            "indicator": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Indicateur \u00E0 afficher \u00E0 droite du champ de saisie"
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "indicator"
            },
            "assistiveText": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Texte d'assistance \u00E0 afficher sous le label"
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "assistive-text"
            },
            "error": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Message d'erreur \u00E0 afficher sous le champ"
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "error",
                "defaultValue": "''"
            },
            "hint": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Message d'indication (hint) \u00E0 afficher sous le champ"
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "hint",
                "defaultValue": "''"
            },
            "success": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Message de succ\u00E8s \u00E0 afficher sous le champ"
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "success",
                "defaultValue": "''"
            },
            "warning": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Message de warning \u00E0 afficher sous le champ"
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "warning",
                "defaultValue": "''"
            },
            "showErrorIcon": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Affiche une ic\u00F4ne d'erreur si vrai"
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "show-error-icon",
                "defaultValue": "true"
            },
            "showHintIcon": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Affiche une ic\u00F4ne d'indication si vrai"
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "show-hint-icon",
                "defaultValue": "true"
            },
            "showSuccessIcon": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Affiche une ic\u00F4ne de succ\u00E8s si vrai"
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "show-success-icon",
                "defaultValue": "true"
            },
            "showWarningIcon": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Affiche une ic\u00F4ne de warning si vrai"
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "show-warning-icon",
                "defaultValue": "true"
            },
            "accAriaLabel": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Remplit l'attribut aria-label, utilis\u00E9 \u00E0 des fins d'accessibilit\u00E9"
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "acc-aria-label"
            },
            "accAriaLabelIncrement": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Aria-label pour le bouton d'incr\u00E9mentation (input number)"
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "acc-aria-label-increment",
                "defaultValue": "'Incr\u00E9menter'"
            },
            "accAriaLabelDecrement": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Aria-label pour le bouton de d\u00E9cr\u00E9mentation (input number)"
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "acc-aria-label-decrement",
                "defaultValue": "'D\u00E9cr\u00E9menter'"
            },
            "hasControls": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Si true, affiche les boutons +/- pour les champs num\u00E9riques"
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "has-controls",
                "defaultValue": "true"
            },
            "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"
            },
            "mask": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "D\u00E9finition du masque (9 = chiffre, A = lettre majuscule, a = lettre, X = alphanum)"
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "mask"
            },
            "decimalPrecision": {
                "type": "number",
                "mutable": false,
                "complexType": {
                    "original": "number",
                    "resolved": "number",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Nombre maximum de chiffres apr\u00E8s la virgule (uniquement pour type=\"number\"). Les entiers restent autoris\u00E9s."
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "decimal-precision"
            },
            "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 {
            "isClearIconVisible": {}
        };
    }
    static get events() {
        return [{
                "method": "valueChanged",
                "name": "valueChanged",
                "bubbles": true,
                "cancelable": true,
                "composed": true,
                "docs": {
                    "tags": [],
                    "text": "\u00C9v\u00E9nement \u00E9mis lorsque la valeur de l'input change"
                },
                "complexType": {
                    "original": "string | number",
                    "resolved": "number | string",
                    "references": {}
                }
            }];
    }
    static get methods() {
        return {
            "setFocus": {
                "complexType": {
                    "signature": "() => Promise<void>",
                    "parameters": [],
                    "references": {
                        "Promise": {
                            "location": "global",
                            "id": "global::Promise"
                        }
                    },
                    "return": "Promise<void>"
                },
                "docs": {
                    "text": "M\u00E9thode publique pour mettre le focus sur le champ de saisie.",
                    "tags": []
                }
            },
            "setValue": {
                "complexType": {
                    "signature": "(newVal: string) => Promise<void>",
                    "parameters": [{
                            "name": "newVal",
                            "type": "string",
                            "docs": ""
                        }],
                    "references": {
                        "Promise": {
                            "location": "global",
                            "id": "global::Promise"
                        }
                    },
                    "return": "Promise<void>"
                },
                "docs": {
                    "text": "",
                    "tags": []
                }
            }
        };
    }
    static get elementRef() { return "el"; }
    static get watchers() {
        return [{
                "propName": "value",
                "methodName": "valueChangedHandler"
            }];
    }
    static get attachInternalsMemberName() { return "internals"; }
}
