import { r as registerInstance, c as createEvent, h } from './index-e78ba223.js';

const eclRatingFieldEcCss = ".ecl-rating-field{display:inline-flex;flex-direction:row-reverse}.ecl-rating-field .ecl-rating-field__input:checked~.ecl-rating-field__label .ecl-rating-field__icon-filled,.ecl-rating-field:not(.ecl-rating-field--disabled)>.ecl-rating-field__label:hover .ecl-rating-field__icon-filled,.ecl-rating-field:not(.ecl-rating-field--disabled)>.ecl-rating-field__label:hover~.ecl-rating-field__label .ecl-rating-field__icon-filled{display:inline-block}.ecl-rating-field .ecl-rating-field__input:checked~.ecl-rating-field__label .ecl-rating-field__icon-outline,.ecl-rating-field:not(.ecl-rating-field--disabled)>.ecl-rating-field__label:hover .ecl-rating-field__icon-outline,.ecl-rating-field:not(.ecl-rating-field--disabled)>.ecl-rating-field__label:hover~.ecl-rating-field__label .ecl-rating-field__icon-outline{display:none}.ecl-rating-field__input{border:0;clip:rect(0,0,0,0);-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}.ecl-rating-field:not(.ecl-rating-field--disabled) .ecl-rating-field__input:active~.ecl-rating-field__label,.ecl-rating-field:not(.ecl-rating-field--disabled) .ecl-rating-field__input:focus~.ecl-rating-field__label{outline:2px solid #004494}.ecl-rating-field__label{cursor:pointer;margin-right:.5rem}.ecl-rating-field--disabled .ecl-rating-field__label{cursor:default}.ecl-rating-field__icon-filled{display:none;fill:#ffd617}.ecl-rating-field__icon-outline{fill:#707070}@media (min-width:480px){.ecl-rating-field__label{margin-right:.25rem}}.ecl-rating-field{margin-top:.75rem}.ecl-rating-field__icon-filled{fill:#ffd617!important}.ecl-rating-field__icon-outline{fill:#707070!important}.ecl-form-label__optional{margin-inline-start:.5rem}.ecl-u-sr-only{clip:rect(0,0,0,0)!important;border:0!important;-webkit-clip-path:inset(50%)!important;clip-path:inset(50%)!important;height:1px!important;margin:-1px!important;overflow:hidden!important;padding:0!important;position:absolute!important;white-space:nowrap!important;width:1px!important}";

const eclRatingFieldEuCss = ".ecl-rating-field{display:inline-flex;flex-direction:row-reverse}.ecl-rating-field .ecl-rating-field__input:checked~.ecl-rating-field__label .ecl-rating-field__icon-filled,.ecl-rating-field:not(.ecl-rating-field--disabled)>.ecl-rating-field__label:hover .ecl-rating-field__icon-filled,.ecl-rating-field:not(.ecl-rating-field--disabled)>.ecl-rating-field__label:hover~.ecl-rating-field__label .ecl-rating-field__icon-filled{display:inline-block}.ecl-rating-field .ecl-rating-field__input:checked~.ecl-rating-field__label .ecl-rating-field__icon-outline,.ecl-rating-field:not(.ecl-rating-field--disabled)>.ecl-rating-field__label:hover .ecl-rating-field__icon-outline,.ecl-rating-field:not(.ecl-rating-field--disabled)>.ecl-rating-field__label:hover~.ecl-rating-field__label .ecl-rating-field__icon-outline{display:none}.ecl-rating-field__input{border:0;clip:rect(0,0,0,0);-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}.ecl-rating-field:not(.ecl-rating-field--disabled) .ecl-rating-field__input:active~.ecl-rating-field__label,.ecl-rating-field:not(.ecl-rating-field--disabled) .ecl-rating-field__input:focus~.ecl-rating-field__label{outline:2px solid #0e47cb}.ecl-rating-field__label{cursor:pointer;margin-right:.5rem}.ecl-rating-field--disabled .ecl-rating-field__label{cursor:default}.ecl-rating-field__icon-filled{display:none;fill:#fc0}.ecl-rating-field__icon-outline{fill:#707070}@media (min-width:480px){.ecl-rating-field__label{margin-right:.25rem}}.ecl-rating-field{margin-top:.75rem}.ecl-rating-field__icon-filled{fill:#ffd617!important}.ecl-rating-field__icon-outline{fill:#707070!important}.ecl-form-label__optional{margin-inline-start:.5rem}.ecl-u-sr-only{clip:rect(0,0,0,0)!important;border:0!important;-webkit-clip-path:inset(50%)!important;clip-path:inset(50%)!important;height:1px!important;margin:-1px!important;overflow:hidden!important;padding:0!important;position:absolute!important;white-space:nowrap!important;width:1px!important}";

const EclRatingStar = class {
    constructor(hostRef) {
        registerInstance(this, hostRef);
        this.inputFocus = createEvent(this, "inputFocus", 7);
        this.inputBlur = createEvent(this, "inputBlur", 7);
        this.inputChange = createEvent(this, "inputChange", 7);
        this.theme = 'ec';
        this.styleClass = undefined;
        this.itemId = undefined;
        this.value = undefined;
        this.name = undefined;
        this.checked = false;
        this.required = false;
        this.disabled = false;
        this.icon = 'star-outline';
        this.iconFilled = 'star-filled';
        this.label = undefined;
        this.hasChanged = false;
        this.isFocused = false;
    }
    handleFocus(event) {
        this.inputFocus.emit(event);
        this.isFocused = true;
    }
    handleChange(event) {
        this.inputChange.emit(event);
        this.hasChanged = true;
    }
    handleBlur(event) {
        this.inputBlur.emit(event);
        this.isFocused = false;
    }
    render() {
        return (h("div", null, h("input", { id: this.itemId, class: `ecl-rating-field__input ecl-rating-field-${this.theme} ecl-rating-field__star`, type: "radio", name: this.name, value: this.value, checked: this.checked, required: this.required, disabled: this.disabled, onFocus: ev => this.handleFocus(ev), onBlur: ev => this.handleBlur(ev), onChange: ev => this.handleChange(ev) }), h("label", { class: `ecl-rating-field__label ecl-rating-field-${this.theme} ecl-rating-field__star`, htmlFor: this.itemId }, this.label ?
            h("span", { class: "ecl-u-sr-only" }, this.label) : '', h("ecl-icon", { theme: this.theme, icon: this.iconFilled, styleClass: `ecl-rating-field__icon-filled ecl-rating-field-${this.theme}`, size: "m" }), h("ecl-icon", { theme: this.theme, icon: this.icon, styleClass: `ecl-rating-field__icon-outline ecl-rating-field-${this.theme}`, size: "m" }))));
    }
};
EclRatingStar.style = {
    ec: eclRatingFieldEcCss,
    eu: eclRatingFieldEuCss
};

export { EclRatingStar as ecl_rating_star };

//# sourceMappingURL=ecl-rating-star.entry.js.map