import { h } from "@stencil/core";
export class EclSpinner {
    constructor() {
        this.styleClass = '';
        this.variant = 'primary';
        this.centered = false;
        this.visible = false;
        this.overlay = false;
        this.size = 'm';
    }
    getClass() {
        const classes = [
            `ecl-spinner`,
            `ecl-spinner--${this.variant}`,
            `ecl-spinner--${this.size}`,
            this.styleClass
        ];
        if (this.centered) {
            classes.push('ecl-spinner--centered');
        }
        if (this.visible) {
            classes.push('ecl-spinner--visible');
        }
        return classes.join(' ');
    }
    getOverlayClass() {
        const overlayClasses = ['ecl-spinner__overlay'];
        if (this.visible) {
            overlayClasses.push('ecl-spinner__overlay--visible');
        }
        return overlayClasses.join(' ');
    }
    componentWillLoad() {
        var _a;
        this.theme = (_a = document.documentElement.getAttribute('data-ecl-theme')) !== null && _a !== void 0 ? _a : (this.theme || 'ec');
    }
    render() {
        return (h("div", { key: 'f6b9df140cee02cc56773002f025d14a2c7f765b' }, this.overlay ?
            h("div", { class: this.getOverlayClass() }) : '', h("div", { key: '5ac55203ce2cef9152fa2ea7f47c9b976326d823', class: this.getClass() }, h("svg", { key: '21430148d4016c1817b8096a88555d7da9faa287', class: "ecl-spinner__loader", viewBox: "25 25 50 50" }, h("circle", { key: '3f592d92f897af5fd08cc73748d56439f7a8edd2', class: "ecl-spinner__circle", cx: "50", cy: "50", r: "20", fill: "none", "stroke-width": "4px", "stroke-miterlimit": "10", "vector-effect": "non-scaling-stroke" })), h("div", { key: 'a9324842893c48ad58f6076ff12e4e26e85ceb4f', class: "ecl-spinner__text" }, h("slot", { key: '4c5b8ba0fb99edabb545b142dd43d06756c42de7' })))));
    }
    static get is() { return "ecl-spinner"; }
    static get encapsulation() { return "scoped"; }
    static get originalStyleUrls() {
        return {
            "ec": ["./build/styles/ecl-spinner-ec.css"],
            "eu": ["./build/styles/ecl-spinner-eu.css"]
        };
    }
    static get styleUrls() {
        return {
            "ec": ["build/styles/ecl-spinner-ec.css"],
            "eu": ["build/styles/ecl-spinner-eu.css"]
        };
    }
    static get properties() {
        return {
            "styleClass": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "style-class",
                "defaultValue": "''"
            },
            "variant": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "variant",
                "defaultValue": "'primary'"
            },
            "theme": {
                "type": "string",
                "mutable": true,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "theme"
            },
            "centered": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "centered",
                "defaultValue": "false"
            },
            "visible": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "visible",
                "defaultValue": "false"
            },
            "overlay": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "overlay",
                "defaultValue": "false"
            },
            "size": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "size",
                "defaultValue": "'m'"
            }
        };
    }
}
