import { h } from "@stencil/core";
export class EclSpacing {
    constructor() {
        this.styleClass = '';
        this.outer = true;
        this.inner = false;
        this.vertical = false;
        this.horizontal = false;
        this.direction = 'a';
        this.value = 'm';
    }
    getClass() {
        let baseClass = 'ecl-u-';
        let styleClasses = [];
        if (this.vertical) {
            this.direction = 'v';
        }
        else if (this.horizontal) {
            this.direction = 'h';
        }
        if (this.outer) {
            if (!this.breakpoint) {
                styleClasses.push(`${baseClass}m${this.direction}-${this.value}`);
            }
            else {
                styleClasses.push(`${baseClass}m${this.direction}-${this.breakpoint}-${this.value}`);
            }
        }
        if (this.inner) {
            if (!this.breakpoint) {
                styleClasses.push(`${baseClass}p${this.direction}-${this.value}`);
            }
            else {
                styleClasses.push(`${baseClass}p${this.direction}-${this.breakpoint}-${this.value}`);
            }
        }
        return styleClasses.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: '20ae77322f5083a4d2fa0fba095e47b6ce0703ce', class: this.getClass() }, h("slot", { key: 'b91e967a352c316b5aba1d7909ae787e292bfbe3' })));
    }
    static get is() { return "ecl-spacing"; }
    static get originalStyleUrls() {
        return {
            "ec": ["./build/styles/ecl-spacing-ec.css"],
            "eu": ["./build/styles/ecl-spacing-eu.css"]
        };
    }
    static get styleUrls() {
        return {
            "ec": ["build/styles/ecl-spacing-ec.css"],
            "eu": ["build/styles/ecl-spacing-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": "''"
            },
            "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"
            },
            "breakpoint": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "breakpoint"
            },
            "outer": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "outer",
                "defaultValue": "true"
            },
            "inner": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "inner",
                "defaultValue": "false"
            },
            "vertical": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "vertical",
                "defaultValue": "false"
            },
            "horizontal": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "horizontal",
                "defaultValue": "false"
            },
            "direction": {
                "type": "string",
                "mutable": true,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "direction",
                "defaultValue": "'a'"
            },
            "value": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "value",
                "defaultValue": "'m'"
            }
        };
    }
    static get elementRef() { return "el"; }
}
