import { h } from "@stencil/core";
import { FormValidationMessageVariation } from "./form-validation-message-variation.enum";
/**
 * @slot default - Ska vara en textnod eller liknande element. Renderas inne i ett span-element.
 *
 * @enums FormValidationMessageVariation - form-validation-message-variation.enum.ts
 * @swedishName Valideringsmeddelande
 */
export class FormValidationMessage {
    constructor() {
        this.afVariation = FormValidationMessageVariation.SUCCESS;
    }
    get cssModifiers() {
        return {
            'digi-form-validation-message--success': this.afVariation === FormValidationMessageVariation.SUCCESS,
            'digi-form-validation-message--error': this.afVariation === FormValidationMessageVariation.ERROR,
            'digi-form-validation-message--warning': this.afVariation === FormValidationMessageVariation.WARNING
        };
    }
    get icon() {
        switch (this.afVariation) {
            case FormValidationMessageVariation.SUCCESS:
                return h("digi-icon-validation-success", null);
            case FormValidationMessageVariation.ERROR:
                return h("digi-icon-validation-error", null);
            case FormValidationMessageVariation.WARNING:
                return h("digi-icon-validation-warning", { class: "warning" });
        }
    }
    render() {
        return (h("div", { key: 'b39aa9f7c7e9ec75c7ffd7613953a350129f1689', class: Object.assign({ 'digi-form-validation-message': true }, this.cssModifiers) }, h("div", { key: '2b0507799231c329f600279e9140fc4ab4e09c70', class: "digi-form-validation-message__icon", "aria-hidden": "true" }, this.icon), h("span", { key: '4027b59a97f1ce0fe1d30b12453456ee0a044c06', class: "digi-form-validation-message__text" }, h("slot", { key: 'f115e6f24b60e34eb9b0b6bec5b6cfd2fff639fd' }))));
    }
    static get is() { return "digi-form-validation-message"; }
    static get encapsulation() { return "scoped"; }
    static get originalStyleUrls() {
        return {
            "$": ["form-validation-message.scss"]
        };
    }
    static get styleUrls() {
        return {
            "$": ["form-validation-message.css"]
        };
    }
    static get properties() {
        return {
            "afVariation": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "FormValidationMessageVariation",
                    "resolved": "FormValidationMessageVariation.ERROR | FormValidationMessageVariation.SUCCESS | FormValidationMessageVariation.WARNING",
                    "references": {
                        "FormValidationMessageVariation": {
                            "location": "import",
                            "path": "./form-validation-message-variation.enum",
                            "id": "src/components/_form/form-validation-message/form-validation-message-variation.enum.ts::FormValidationMessageVariation"
                        }
                    }
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [{
                            "name": "en",
                            "text": "Set validation status"
                        }],
                    "text": "S\u00E4tter valideringsstatus. Kan vara 'success', 'error' eller 'warning'."
                },
                "getter": false,
                "setter": false,
                "attribute": "af-variation",
                "reflect": false,
                "defaultValue": "FormValidationMessageVariation.SUCCESS"
            }
        };
    }
    static get elementRef() { return "hostElement"; }
}
