'use strict';

var index = require('./index-feA4skrY.js');
var formInput = require('./form-input-BwFB4Rej.js');
var bem = require('./bem-p0PWVN8n.js');
var aria = require('./aria-BzkqcV7W.js');
require('./helpers-HuaiWXrB.js');
require('./browser-BwmkTmm8.js');
require('./config.utils-Civnz2jT.js');

const DateCalendarCell = class {
    constructor(hostRef) {
        index.registerInstance(this, hostRef);
        this.balSelectDay = index.createEvent(this, "balSelectDay");
        this.selected = false;
        this.today = false;
        this.disabled = false;
        /**
         * EVENT BINDING
         * ------------------------------------------------------
         */
        this.onClick = (ev, selectedDate) => {
            if (!this.disabled) {
                this.balSelectDay.emit(selectedDate);
            }
            else {
                formInput.stopEventBubbling(ev);
            }
        };
    }
    /**
     * RENDER
     * ------------------------------------------------------
     */
    render() {
        const block = bem.BEM.block('date-calendar-cell');
        return (index.h(index.Host, { key: 'd1db2d94effc57679d76eda478c58b8b249ec8f8', class: Object.assign(Object.assign(Object.assign(Object.assign({}, block.class()), block.modifier('today').class(!this.disabled && this.today)), block.modifier('selected').class(!this.disabled && this.selected)), block.modifier('disabled').class(this.disabled === true)), tabIndex: -1, type: "button", role: "button", "aria-label": this.fullDate, "aria-selected": aria.ariaBooleanToString(this.selected), "aria-disabled": aria.ariaBooleanToString(this.disabled), title: this.fullDate, onClick: (ev) => this.onClick(ev, this.isoDate) }, index.h("time", { key: '9f52e4756e920afd593cc0e189fb7a3a787f87f0', dateTime: this.isoDate }, this.day)));
    }
};

exports.bal_date_calendar_cell = DateCalendarCell;
