import { html } from 'lit'; import { dayTemplate as defaultDayTemplate } from './dayTemplate.js'; /** * @param {{months: {weeks: {days: import('../../types/day').Day[]}[]}[]}} data * @param {{ weekdaysShort: string[], weekdays: string[], monthsLabels?: string[], dayTemplate?: (day: import('../../types/day').Day, { weekdays, monthsLabels }?: any) => import('@lion/core').TemplateResult }} opts */ export function dataTemplate( data, { weekdaysShort, weekdays, monthsLabels, dayTemplate = defaultDayTemplate }, ) { return html`
${data.months.map( month => html` ${weekdaysShort.map( (header, i) => html` `, )} ${month.weeks.map( week => html` ${week.days.map(day => dayTemplate(day, { weekdaysShort, weekdays, monthsLabels }), )} `, )}
${header}
`, )}
`; }