'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

const index = require('./index-7446596e.js');
const formInput = require('./form-input-52cab7f2.js');
const bem = require('./bem-81bc6a2d.js');
require('./helpers-46584747.js');
require('./browser-9ac97263.js');
require('./icons.constant-f1294def.js');
require('./config.utils-aef60f18.js');

const DateCalendar = class {
    constructor(hostRef) {
        index.registerInstance(this, hostRef);
        this.balSelectDay = index.createEvent(this, "balSelectDay", 7);
        this.onClick = (ev, selectedDate) => {
            if (!this.disabled) {
                this.balSelectDay.emit(selectedDate);
            }
            else {
                formInput.stopEventBubbling(ev);
            }
        };
        this.day = undefined;
        this.month = undefined;
        this.year = undefined;
        this.isoDate = undefined;
        this.fullDate = undefined;
        this.selected = false;
        this.today = false;
        this.disabled = false;
    }
    render() {
        const block = bem.BEM.block('date-calendar-cell');
        return (index.h(index.Host, { 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": this.selected ? 'true' : 'false', "aria-disabled": this.disabled ? 'true' : 'false', title: this.fullDate, onClick: (ev) => this.onClick(ev, this.isoDate) }, index.h("time", { dateTime: this.isoDate }, this.day)));
    }
};

exports.bal_date_calendar_cell = DateCalendar;
