import { BoxProps, DataAttributes, ElementProps, Factory, MantineRadius, ScrollAreaAutosizeProps, StylesApiProps } from '@mantine/core'; import { ScheduleLabelsOverride } from '../../labels'; import { AnyDateValue, DateLabelFormat, DateStringValue, DateTimeStringValue, ScheduleEventData, ScheduleMode, ScheduleViewLevel } from '../../types'; import { AgendaViewStylesNames } from '../AgendaView/AgendaView'; import { CurrentTimeIndicatorStylesNames } from '../CurrentTimeIndicator/CurrentTimeIndicator'; import { MoreEventsProps, MoreEventsStylesNames } from '../MoreEvents/MoreEvents'; import { RenderEvent, RenderEventBody, ScheduleEventStylesNames } from '../ScheduleEvent/ScheduleEvent'; import { MonthYearSelectStylesNames } from '../ScheduleHeader/MonthYearSelect/MonthYearSelect'; import { CombinedScheduleHeaderStylesNames } from '../ScheduleHeader/ScheduleHeader'; import { ViewSelectProps } from '../ScheduleHeader/ViewSelect/ViewSelect'; export type DayViewStylesNames = 'dayView' | 'dayViewInner' | 'dayViewScrollArea' | 'dayViewAllDay' | 'dayViewAllDayEvents' | 'dayViewSlot' | 'dayViewSlots' | 'dayViewTimeSlots' | 'dayViewSlotLabel' | 'dayViewSlotLabels' | 'dayViewBackgroundEvent' | MoreEventsStylesNames | ScheduleEventStylesNames | Exclude | CurrentTimeIndicatorStylesNames | AgendaViewStylesNames; export type DayViewCssVariables = { dayView: '--day-view-radius' | '--day-view-slot-height' | '--day-view-all-day-slot-height'; }; export interface DayViewProps extends BoxProps, StylesApiProps, ElementProps<'div'> { __staticSelector?: string; /** Day to display, Date object or date string in `YYYY-MM-DD` format */ date: Date | DateStringValue; /** Called when date is changed */ onDateChange?: (date: DateStringValue) => void; /** Events to display, must be a stable reference */ events?: ScheduleEventData[]; /** Time slots start time, in `HH:mm:ss` format @default 00:00:00 */ startTime?: string; /** Time slots end time in `HH:mm:ss` format @default 23:59:59 */ endTime?: string; /** Number of minutes for each time slot @default 15 */ intervalMinutes?: number; /** If set, grid lines are displayed for intervals smaller than one hour, for example 15 and 30 minutes intervals @default true */ withSubHourGridLines?: boolean; /** If set, the all-day slot is displayed below the header @default true */ withAllDaySlot?: boolean; /** Locale passed down to dayjs, overrides value defined on `DatesProvider` */ locale?: string; /** Key of `theme.radius` or any valid CSS value to set `border-radius` @default theme.defaultRadius */ radius?: MantineRadius; /** Dayjs format for slot labels or a callback function that returns formatted value @default HH:mm */ slotLabelFormat?: DateLabelFormat; /** Date format in the header @default MMMM D, YYYY */ headerFormat?: DateLabelFormat; /** If set, displays a line indicating the current time. By default, displayed only for the current day. */ withCurrentTimeIndicator?: boolean; /** If set, the time indicator displays the current time in the bubble @default true */ withCurrentTimeBubble?: boolean; /** A function to get the current time, called on every tick. Can be used to display the current time indicator in a different timezone. @default () => dayjs() */ getCurrentTime?: () => AnyDateValue; /** If set, the header is displayed @default true */ withHeader?: boolean; /** Called when view level select button is clicked */ onViewChange?: (view: ScheduleViewLevel) => void; /** Props passed to previous month control */ previousControlProps?: React.ComponentProps<'button'> & DataAttributes; /** Props passed to next month control */ nextControlProps?: React.ComponentProps<'button'> & DataAttributes; /** Props passed to today control */ todayControlProps?: React.ComponentProps<'button'> & DataAttributes; /** Props passed to view level select */ viewSelectProps?: Partial & DataAttributes; /** Height of 1hr slot @default 64px */ slotHeight?: React.CSSProperties['height']; /** Height of all-day slot @default 44px */ allDaySlotHeight?: React.CSSProperties['height']; /** Props passed down to the `ScrollArea.Autosize` component */ scrollAreaProps?: ScrollAreaAutosizeProps & DataAttributes; /** Props passed down to `MoreEvents` component */ moreEventsProps?: Partial; /** Function to customize event body, `event` object is passed as first argument */ renderEventBody?: RenderEventBody; /** Function to fully customize event rendering, receives all props that would be passed to the root element including children */ renderEvent?: RenderEvent; /** Labels override */ labels?: ScheduleLabelsOverride; /** If set to true, highlights business hours with white background @default false */ highlightBusinessHours?: boolean; /** Business hours range in `HH:mm:ss` format @default ['09:00:00', '17:00:00'] */ businessHours?: [string, string]; /** If true, events can be dragged and dropped @default false */ withEventsDragAndDrop?: boolean; /** Called when event is dropped at new time */ onEventDrop?: (data: { eventId: string | number; newStart: DateTimeStringValue; newEnd: DateTimeStringValue; event: ScheduleEventData; }) => void; /** Function to determine if event can be dragged */ canDragEvent?: (event: ScheduleEventData) => boolean; /** Called when any event drag starts */ onEventDragStart?: (event: ScheduleEventData) => void; /** Called when any event drag ends */ onEventDragEnd?: () => void; /** Called when time slot is clicked */ onTimeSlotClick?: (data: { slotStart: DateTimeStringValue; slotEnd: DateTimeStringValue; nativeEvent: React.MouseEvent; }) => void; /** Called when all-day slot is clicked */ onAllDaySlotClick?: (date: DateStringValue, event: React.MouseEvent) => void; /** Called when event is clicked */ onEventClick?: (event: ScheduleEventData, e: React.MouseEvent) => void; /** If set, enables drag-to-select time slot ranges @default false */ withDragSlotSelect?: boolean; /** Called when a time slot range is selected by dragging */ onSlotDragEnd?: (rangeStart: DateTimeStringValue, rangeEnd: DateTimeStringValue) => void; /** Interaction mode: 'default' allows all interactions, 'static' disables event interactions @default default */ mode?: ScheduleMode; /** Time to scroll to on initial render, in `HH:mm:ss` format */ startScrollTime?: string; /** Called when an external item is dropped onto the schedule. Receives the `DataTransfer` object and the drop target datetime. */ onExternalEventDrop?: (dataTransfer: DataTransfer, dropDateTime: DateTimeStringValue) => void; /** If true, events can be resized by dragging their edges @default false */ withEventResize?: boolean; /** Called when event is resized */ onEventResize?: (data: { eventId: string | number; newStart: DateTimeStringValue; newEnd: DateTimeStringValue; event: ScheduleEventData; }) => void; /** Function to determine if event can be resized */ canResizeEvent?: (event: ScheduleEventData) => boolean; /** Max number of generated recurring instances per recurring series @default 2000 */ recurrenceExpansionLimit?: number; /** Function to get additional props for each time slot. Receives slot start and end datetime strings. Returned props are spread onto the slot element. Event handlers returned by this function are composed with internal handlers (e.g. onClick) rather than overriding them. */ getTimeSlotProps?: (data: { start: DateTimeStringValue; end: DateTimeStringValue; }) => Record | undefined; /** If set, displays an Agenda button in the header that opens an agenda list view @default false */ withAgenda?: boolean; } export type DayViewFactory = Factory<{ props: DayViewProps; ref: HTMLDivElement; stylesNames: DayViewStylesNames; vars: DayViewCssVariables; }>; export declare const DayView: import("@mantine/core").MantineComponent<{ props: DayViewProps; ref: HTMLDivElement; stylesNames: DayViewStylesNames; vars: DayViewCssVariables; }>; export declare namespace DayView { type Props = DayViewProps; type Factory = DayViewFactory; type StylesNames = DayViewStylesNames; type CssVariables = DayViewCssVariables; }