import { Host, h } from "@stencil/core";
export class SpwFieldMessage {
    constructor() {
        /** Permet d'afficher ou pas une icône dans le message */
        this.showIcon = true;
    }
    get variantIcon() {
        switch (this.variant) {
            case 'error':
                return 'fa-warning';
            case 'hint':
                return 'fa-exclamation-circle';
            case 'success':
                return 'fa-check-circle';
            case 'warning':
                return 'fa-triangle-exclamation';
            default:
                return '';
        }
    }
    get elementClass() {
        return {
            'spw-field-message': true,
            [`spw-field-message--${this.variant}`]: true,
        };
    }
    render() {
        return (h(Host, { key: 'c37e4fcd1a62f74a582ea34b5ad35405d1fdfe15' }, h("div", { key: 'dec558441b64aaaba6fd7ce8501be8c674ade97d', class: this.elementClass }, this.showIcon && (h("div", { key: '867ccb3a82414bc19f8f0e59857b879d615f2d69', class: "spw-field-message__icon" }, h("spw-icon", { key: '2fde1c1acdcbe924bf3448355a17433540ff6a59', icon: this.variantIcon }))), h("span", { key: '0c9b68f44ec54d00aa6ee52b007a3c34e721ebdc', class: "spw-field-message__text" }, h("slot", { key: 'f2fb8c461e7b9b81d5b8a96a2fbcdf3373e66aea' })))));
    }
    static get is() { return "spw-field-message"; }
    static get encapsulation() { return "shadow"; }
    static get originalStyleUrls() {
        return {
            "$": ["spw-field-message.scss"]
        };
    }
    static get styleUrls() {
        return {
            "$": ["spw-field-message.css"]
        };
    }
    static get properties() {
        return {
            "showIcon": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Permet d'afficher ou pas une ic\u00F4ne dans le message"
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "show-icon",
                "defaultValue": "true"
            },
            "variant": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "'error' | 'hint' | 'warning' | 'success'",
                    "resolved": "\"error\" | \"hint\" | \"success\" | \"warning\"",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Choix du variant du message"
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "variant"
            }
        };
    }
}
