import { h } from "@stencil/core";
export class EclText {
    constructor() {
        this.styleClass = '';
        this.tag = undefined;
        this.theme = 'ec';
        this.isBold = false;
        this.level = undefined;
        this.size = undefined;
        this.itemId = undefined;
    }
    getClass() {
        let styleClasses = [this.styleClass];
        if (this.level && !(this.size && this.tag === 'p')) {
            switch (this.level) {
                case 1:
                    styleClasses.push('ecl-u-type-3xl');
                    break;
                case 2:
                    styleClasses.push('ecl-u-type-2xl');
                    break;
                case 3:
                    styleClasses.push('ecl-u-type-xl');
                    break;
                case 4:
                    styleClasses.push('ecl-u-type-prolonged-l');
                    break;
                case 5:
                    styleClasses.push('ecl-u-type-prolonged-m');
                    break;
                default:
            }
        }
        if (this.size && this.tag === 'p') {
            styleClasses.push(`ecl-u-type-prolonged-${this.size}`);
        }
        if (styleClasses.length === 0) {
            styleClasses.push('ecl-u-type-prolonged-m');
        }
        if (this.isBold) {
            styleClasses.push('ecl-u-type-bold');
        }
        return styleClasses.join(' ');
    }
    render() {
        const Tag = this.tag;
        return (h(Tag, { class: this.getClass(), id: this.itemId ? this.itemId : null }, h("slot", null)));
    }
    static get is() { return "ecl-text"; }
    static get encapsulation() { return "scoped"; }
    static get originalStyleUrls() {
        return {
            "ec": ["./build/styles/ecl-text-ec.css"],
            "eu": ["./build/styles/ecl-text-eu.css"]
        };
    }
    static get styleUrls() {
        return {
            "ec": ["build/styles/ecl-text-ec.css"],
            "eu": ["build/styles/ecl-text-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": "''"
            },
            "tag": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "'div' | 'p' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'span' | undefined",
                    "resolved": "\"div\" | \"h1\" | \"h2\" | \"h3\" | \"h4\" | \"h5\" | \"h6\" | \"p\" | \"span\"",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "attribute": "tag",
                "reflect": false
            },
            "theme": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "attribute": "theme",
                "reflect": false,
                "defaultValue": "'ec'"
            },
            "isBold": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "attribute": "is-bold",
                "reflect": false,
                "defaultValue": "false"
            },
            "level": {
                "type": "number",
                "mutable": false,
                "complexType": {
                    "original": "1 | 2 | 3 | 4 | 5 | undefined",
                    "resolved": "1 | 2 | 3 | 4 | 5",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "attribute": "level",
                "reflect": false
            },
            "size": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "'l' | 'm' | 's' | 'xs' | undefined",
                    "resolved": "\"l\" | \"m\" | \"s\" | \"xs\"",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "attribute": "size",
                "reflect": false
            },
            "itemId": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "attribute": "item-id",
                "reflect": false
            }
        };
    }
    static get elementRef() { return "el"; }
}
//# sourceMappingURL=ecl-text.js.map
