'use strict';

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

const core = require('./core-859ae5a6.js');
const i18n_provider = require('./i18n.provider-ca81b0a0.js');

var AttributeTitles;
(function (AttributeTitles) {
    AttributeTitles["CHANGE_DAY"] = "Change Day";
    AttributeTitles["PREV_YEAR"] = "Previous Year";
    AttributeTitles["TODAY"] = "Today";
    AttributeTitles["NEXT_YEAR"] = "Next Year";
})(AttributeTitles || (AttributeTitles = {}));
const YearView = class {
    constructor(hostRef) {
        core.registerInstance(this, hostRef);
        this.anjToggleMonthMode = core.createEvent(this, "anjToggleMonthMode", 7);
        this.anjMonthChanged = core.createEvent(this, "anjMonthChanged", 7);
        this.anjYearChanged = core.createEvent(this, "anjYearChanged", 7);
    }
    yearChangeHandler(year) {
        this.anjYearChanged.emit(year);
    }
    monthChangeHandler(value) {
        this.anjMonthChanged.emit(value);
    }
    modeChangeHandler(value) {
        this.anjToggleMonthMode.emit(value);
    }
    render() {
        return [
            core.h("div", { class: "anj-calendar-top" }, core.h("anj-button", { context: "text", class: "anj-current", title: this.translator(AttributeTitles.CHANGE_DAY), onClick: () => this.modeChangeHandler(true) }, core.h("span", null, this.package.year), core.h("anj-icon-opener", { slot: "end", open: true })), core.h("div", { class: "anj-date-nav" }, core.h("anj-button", { context: "icon", title: this.translator(AttributeTitles.PREV_YEAR), "aria-label": this.translator(AttributeTitles.PREV_YEAR), onClick: () => this.yearChangeHandler(-1) }, core.h("svg", { slot: "icon-only", xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24" }, core.h("path", { d: "M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z" }))), core.h("anj-button", { context: "icon", title: this.translator(AttributeTitles.TODAY), "aria-label": this.translator(AttributeTitles.TODAY), onClick: () => this.modeChangeHandler(true) }, core.h("svg", { slot: "icon-only", xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24" }, core.h("circle", { cx: "12", cy: "12", r: "6" }))), core.h("anj-button", { context: "icon", title: this.translator(AttributeTitles.NEXT_YEAR), "aria-label": this.translator(AttributeTitles.NEXT_YEAR), onClick: () => this.yearChangeHandler(1) }, core.h("svg", { slot: "icon-only", xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24" }, core.h("path", { d: "M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z" }))))),
            core.h("div", { class: "anj-calendar-inner" }, this.package.months.map((month, index) => core.h("anj-date-picker-month", { month: month, selected: this.package.month === index, onClick: () => this.monthChangeHandler(index) })))
        ];
    }
    static get style() { return ".sc-anj-date-picker-year-view-h {\n  display: block;\n  display: block;\n}\n.sc-anj-date-picker-year-view-h .anj-current.sc-anj-date-picker-year-view {\n  --anj-link: --anj-text;\n  margin-left: -0.6rem;\n  position: relative;\n  top: 2px;\n}\n.sc-anj-date-picker-year-view-h .anj-date-nav.sc-anj-date-picker-year-view {\n  margin-right: -0.25rem;\n}\n.sc-anj-date-picker-year-view-h .anj-calendar-top.sc-anj-date-picker-year-view {\n  display: -ms-flexbox;\n  display: flex;\n  -ms-flex-pack: justify;\n  justify-content: space-between;\n  padding: 0.75rem 1.25rem;\n}\n.sc-anj-date-picker-year-view-h .anj-calendar-top.sc-anj-date-picker-year-view .anj-current.sc-anj-date-picker-year-view {\n  color: var(--anj-primary);\n}\n.sc-anj-date-picker-year-view-h anj-icon-opener.sc-anj-date-picker-year-view {\n  margin-left: 0.25rem;\n  position: relative;\n  top: -2px;\n}\n.sc-anj-date-picker-year-view-h .anj-calendar-inner.sc-anj-date-picker-year-view {\n  display: -ms-flexbox;\n  display: flex;\n  -ms-flex-flow: row wrap;\n  flex-flow: row wrap;\n  padding: 0.5rem 1rem;\n}\n.sc-anj-date-picker-year-view-h .anj-calendar-inner.sc-anj-date-picker-year-view {\n  padding: 0 0.5rem 0.5rem;\n}"; }
};
i18n_provider.Tunnel.injectProps(YearView, ['translator']);

exports.anj_date_picker_year_view = YearView;
