"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
class StarRating {
    onCreate() {
        this.state = {
            value: 0,
        };
    }
    onInput(input) {
        let value = parseInt(input.value) || 0;
        if (value > 5) {
            value = 0;
        }
        this.state.value = value;
    }
    emitEvent(name, value, originalEvent, el) {
        if (!el.disabled) {
            this.state.value = value;
            this.emit(name, {
                originalEvent,
                value: value,
            });
        }
    }
}
module.exports = StarRating;
