import { __assign, __spreadArray } from "tslib";
import { getWeekNumbersInMonth } from '@fluentui/date-time-utilities';
import { format } from '@uifabric-vue/utilities';
import Vue from 'vue';
import { withCalendarProps } from '../Calendar/useCalendar';
import { CalendarGridDayCell } from './CalendarGridDayCell';
import { withCalendarGridRowProps } from './useCalendarDayGrid';
export var CalendarGridRow = Vue.extend({
    name: 'CalendarGridRow',
    functional: true,
    props: __assign(__assign({}, withCalendarProps()), withCalendarGridRowProps()),
    render: function (h, ctx) {
        var _a = ctx.props, classNames = _a.classNames, week = _a.week, weeks = _a.weeks, weekIndex = _a.weekIndex, rowClassName = _a.rowClassName, ariaRole = _a.ariaRole, showWeekNumbers = _a.showWeekNumbers, firstDayOfWeek = _a.firstDayOfWeek, firstWeekOfYear = _a.firstWeekOfYear, navigatedDate = _a.navigatedDate, strings = _a.strings;
        var weekNumbers = showWeekNumbers
            ? getWeekNumbersInMonth(weeks.length, firstDayOfWeek, firstWeekOfYear, navigatedDate)
            : null;
        var titleString = weekNumbers
            ? strings.weekNumberFormatString && format(strings.weekNumberFormatString, weekNumbers[weekIndex])
            : '';
        return h('tr', {
            key: weekIndex + '_' + week[0].key,
            class: rowClassName,
            attrs: {
                role: ariaRole,
            },
        }, __spreadArray([
            showWeekNumbers && weekNumbers && h('th', {
                key: weekIndex,
                class: classNames.weekNumberCell,
                attrs: {
                    title: titleString,
                    'aria-label': titleString,
                    scope: 'row',
                },
            }, [
                h('span', "".concat(weekNumbers[weekIndex])),
            ])
        ], week.map(function (day, dayIndex) { return h(CalendarGridDayCell, __assign(__assign({ key: day.key }, ctx.data), { props: __assign(__assign({}, ctx.props), { day: day, dayIndex: dayIndex }) })); }), true));
    },
});
//# sourceMappingURL=CalendarGridRow.js.map