import { h } from "@stencil/core";
export class EclGrid {
    constructor() {
        this.styleClass = '';
        this.theme = 'ec';
        this.columns = 12;
        this.breakpoint = undefined;
        this.row = false;
        this.container = false;
    }
    getClass() {
        let styleClasses = [];
        if (this.row || this.container) {
            if (this.row) {
                styleClasses = [
                    `ecl-row`,
                    this.styleClass,
                ];
            }
            else {
                styleClasses = [
                    `ecl-container`,
                    this.styleClass,
                ];
            }
        }
        else {
            if (!this.breakpoint) {
                styleClasses = [
                    `ecl-col-${this.columns}`,
                    this.styleClass,
                ];
            }
            else {
                styleClasses = [
                    `ecl-col-${this.breakpoint}-${this.columns}`,
                    this.styleClass,
                ];
            }
        }
        return styleClasses.join(' ');
    }
    componentDidRender() {
        const parent = this.el.parentNode;
        while (this.el.firstChild)
            parent.insertBefore(this.el.firstChild, this.el);
        parent.removeChild(this.el);
    }
    render() {
        return (h("div", { class: this.getClass() }, h("slot", null)));
    }
    static get is() { return "ecl-grid"; }
    static get originalStyleUrls() {
        return {
            "ec": ["./build/styles/ecl-grid-ec.css"],
            "eu": ["./build/styles/ecl-grid-eu.css"]
        };
    }
    static get styleUrls() {
        return {
            "ec": ["build/styles/ecl-grid-ec.css"],
            "eu": ["build/styles/ecl-grid-eu.css"]
        };
    }
    static get properties() {
        return {
            "styleClass": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "attribute": "style-class",
                "reflect": false,
                "defaultValue": "''"
            },
            "theme": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "attribute": "theme",
                "reflect": false,
                "defaultValue": "'ec'"
            },
            "columns": {
                "type": "number",
                "mutable": false,
                "complexType": {
                    "original": "number",
                    "resolved": "number",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "attribute": "columns",
                "reflect": false,
                "defaultValue": "12"
            },
            "breakpoint": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "attribute": "breakpoint",
                "reflect": false
            },
            "row": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "attribute": "row",
                "reflect": false,
                "defaultValue": "false"
            },
            "container": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "attribute": "container",
                "reflect": false,
                "defaultValue": "false"
            }
        };
    }
    static get elementRef() { return "el"; }
}
//# sourceMappingURL=ecl-grid.js.map
