import { h } from "@stencil/core";
export class EclRatingField {
    constructor() {
        this.theme = 'ec';
        this.inputId = `ecl-rating-field-${Math.random().toString(36).slice(2, 10)}`;
        this.disabled = false;
        this.required = false;
    }
    componentDidRender() {
        const stars = this.el.querySelectorAll('.ecl-rating-field__star');
        this.el.querySelector('.ecl-rating-field').innerHTML = '';
        this.el.querySelector('.ecl-rating-field').append(...stars);
    }
    getClass() {
        const styleClasses = [
            `ecl-rating-field`,
            this.styleClass
        ];
        if (this.disabled) {
            styleClasses.push('ecl-rating-field--disabled');
        }
        return styleClasses.join(' ');
    }
    render() {
        return (h("div", { key: '512a244a1b2ac38f0f1ce269af18cc9200592a66', class: this.getClass() }, h("slot", { key: '669be3c6319675b9faa84241056016e327130643' })));
    }
    static get is() { return "ecl-rating-field"; }
    static get encapsulation() { return "scoped"; }
    static get originalStyleUrls() {
        return {
            "ec": ["./build/styles/ecl-rating-field-ec.css"],
            "eu": ["./build/styles/ecl-rating-field-eu.css"]
        };
    }
    static get styleUrls() {
        return {
            "ec": ["build/styles/ecl-rating-field-ec.css"],
            "eu": ["build/styles/ecl-rating-field-eu.css"]
        };
    }
    static get properties() {
        return {
            "theme": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "theme",
                "defaultValue": "'ec'"
            },
            "inputId": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "input-id",
                "defaultValue": "`ecl-rating-field-${Math.random().toString(36).slice(2, 10)}`"
            },
            "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"
            },
            "disabled": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "disabled",
                "defaultValue": "false"
            },
            "required": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "required",
                "defaultValue": "false"
            }
        };
    }
    static get elementRef() { return "el"; }
}
