import * as React from 'react'; import BaseCalendarView, { BaseCalendarViewProps, CalendarWithOptionalHeaderViewProps, SingleSelectionCalendarViewProps, } from './BaseCalendarView'; import Calendar from './Calendar'; import Body from './CalendarBody/Body'; import Header, { HeaderProps } from './CalendarHeader/Header'; import { findHTMLElement } from '../lib'; export const MONTH_CALENDAR_ROW_WIDTH = 3; type MonthViewProps = BaseCalendarViewProps & SingleSelectionCalendarViewProps & CalendarWithOptionalHeaderViewProps; class MonthView extends BaseCalendarView { public render() { const { values, hasHeader, onValueClick, onNextPageBtnClick, onPrevPageBtnClick, hasPrevPage, hasNextPage, onHeaderClick, disabledItemIndexes, activeItemIndex, currentHeadingValue, onCellHover, hoveredItemIndex, onMount, inline, localization, ...rest } = this.props; const headerProps: HeaderProps = { className: 'suicr-month-view-header', onNextPageBtnClick, onPrevPageBtnClick, hasPrevPage, hasNextPage, onHeaderClick, title: currentHeadingValue, displayWeeks: false, width: MONTH_CALENDAR_ROW_WIDTH, localization, }; return ( this.calendarNode = findHTMLElement(e)} outlineOnFocus={inline} {...rest}> { hasHeader &&
} ); } } export default MonthView;