/* eslint-disable @typescript-eslint/no-empty-interface */ import {ConfiguredComponent} from '@befe/brick-core' import dayjs, {Dayjs} from 'dayjs' import {safeInvoke} from '@befe/brick-utils' import {UiPanel} from '../../ui-comps/ui-panel' import {UiPanelTitle} from '../../ui-comps/ui-panel-title' import {UiItemLayout} from '../../ui-comps/ui-item-layout' import {getDateRows, getWeekTitleRow} from '../../utils/date-utils' import {UILayoutItem} from '../../ui-comps/ui-item' import {TypeLayoutItem} from '../../module-defs/ui-types' import {localeDictDatePicker} from '../../locale' interface MultiDatePanelProps { value: number[] displayedDate: Dayjs hideNow?: boolean getDisabledItem?: (date: Dayjs, firstDayOfCurrentUnit: Dayjs) => boolean onPrevYear: () => void onNextYear: () => void onPrevMonth: () => void onNextMonth: () => void onToggleZooming: () => void onClick: (value?: number) => void } /** */ export class MultiDatePanel extends ConfiguredComponent { componentLocale = localeDictDatePicker render() { return ( ) } private renderPanelTitle() { const yearMonthTitle = this.getLocaleText( 'get_year_month_title', // eslint-disable-next-line @typescript-eslint/no-unsafe-argument this.props.displayedDate as any ) return ( ) } private readonly getWeekDayText = (day: number) => { // console.log('why') return this.getLocaleText('get_week_day_text', day) } private renderPanelContent() { const date = this.props.displayedDate const year = date.year() const month = date.month() const today = dayjs().startOf('day') const boundRenderItem = this.renderItem.bind(this, { todayValue: today.valueOf(), today, }) return ( ) } private renderItem( { todayValue, today, }: { todayValue: number today: Dayjs }, item: TypeLayoutItem ) { const itemData = item.data! const itemValue = itemData.date.valueOf() const selected = this.props.value.includes(itemValue) const hideNow = this.props.hideNow const isDisabled = safeInvoke( this.props.getDisabledItem, itemData.date, today ) return { elem: , } } }