import { BoxProps, ElementProps, Factory, MantineRadius, StylesApiProps } from '@mantine/core'; import { ScheduleLabelsOverride } from '../../labels'; import { DateStringValue, DateTimeStringValue, ScheduleEventData, ScheduleMode, ScheduleResourceData } from '../../types'; import { ResourcesDayViewProps, ResourcesDayViewStylesNames } from '../ResourcesDayView/ResourcesDayView'; import { ResourcesMonthViewProps, ResourcesMonthViewStylesNames } from '../ResourcesMonthView/ResourcesMonthView'; import { ResourcesWeekViewProps, ResourcesWeekViewStylesNames } from '../ResourcesWeekView/ResourcesWeekView'; import { RenderEventBody } from '../ScheduleEvent/ScheduleEvent'; export type ResourcesScheduleStylesNames = 'root' | ResourcesDayViewStylesNames | ResourcesWeekViewStylesNames | ResourcesMonthViewStylesNames; export type ResourcesScheduleViewLevel = 'day' | 'week' | 'month'; type ResourcesScheduleCommonProps = 'date' | 'onDateChange' | 'resources' | 'events' | 'locale' | 'radius' | 'labels' | 'renderEventBody' | 'renderResourceLabel' | 'withEventsDragAndDrop' | 'onEventDrop' | 'canDragEvent' | 'onEventDragStart' | 'onEventDragEnd' | 'onTimeSlotClick' | 'onEventClick' | 'onDayClick' | 'withDragSlotSelect' | 'onSlotDragEnd' | 'view' | 'onViewChange' | 'mode' | 'onExternalEventDrop' | 'withEventResize' | 'onEventResize' | 'canResizeEvent' | 'recurrenceExpansionLimit'; type ResourcesScheduleViewProps = Partial>; export interface ResourcesScheduleProps extends BoxProps, StylesApiProps, ElementProps<'div'> { __staticSelector?: string; /** List of resources to display */ resources: ScheduleResourceData[]; /** Current date to display (controlled) */ date?: Date | DateStringValue; /** Default date (uncontrolled) */ defaultDate?: Date | DateStringValue; /** Called when date changes via navigation */ onDateChange?: (date: DateStringValue) => void; /** Current view level (controlled) */ view?: ResourcesScheduleViewLevel; /** Default view level (uncontrolled) @default 'day' */ defaultView?: ResourcesScheduleViewLevel; /** Called when view level changes */ onViewChange?: (view: ResourcesScheduleViewLevel) => void; /** Events to display across all views */ events?: ScheduleEventData[]; /** Locale for date formatting */ locale?: string; /** Key of theme.radius or any valid CSS value to set border-radius */ radius?: MantineRadius; /** Labels override for i18n */ labels?: ScheduleLabelsOverride; /** Custom event body renderer */ renderEventBody?: RenderEventBody; /** Custom resource label renderer */ renderResourceLabel?: (resource: ScheduleResourceData) => React.ReactNode; /** Enable drag and drop for events @default false */ withEventsDragAndDrop?: boolean; /** Called when event is dropped */ onEventDrop?: (data: { eventId: string | number; newStart: DateTimeStringValue; newEnd: DateTimeStringValue; event: ScheduleEventData; resourceId?: string | number; }) => 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; resourceId?: string | number; }) => void; /** Called when day is clicked in month view */ onDayClick?: (data: { date: DateStringValue; nativeEvent: React.MouseEvent; resourceId?: string | number; }) => void; /** Called when event is clicked */ onEventClick?: (event: ScheduleEventData, e: React.MouseEvent) => void; /** If set, enables drag-to-select slot ranges @default false */ withDragSlotSelect?: boolean; /** Called when a slot range is selected by dragging */ onSlotDragEnd?: (data: { rangeStart: DateTimeStringValue; rangeEnd: DateTimeStringValue; resourceId?: string | number; }) => void; /** Interaction mode @default default */ mode?: ScheduleMode; /** Called when an external item is dropped onto the schedule */ onExternalEventDrop?: (data: { dataTransfer: DataTransfer; dropDateTime: DateTimeStringValue; resourceId?: string | number; }) => void; /** If true, events can be resized @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 @default 2000 */ recurrenceExpansionLimit?: number; /** Props specific to ResourcesDayView */ dayViewProps?: ResourcesScheduleViewProps; /** Props specific to ResourcesWeekView */ weekViewProps?: ResourcesScheduleViewProps; /** Props specific to ResourcesMonthView */ monthViewProps?: ResourcesScheduleViewProps; } export type ResourcesScheduleFactory = Factory<{ props: ResourcesScheduleProps; ref: HTMLDivElement; stylesNames: ResourcesScheduleStylesNames; }>; export declare const ResourcesSchedule: import("@mantine/core").MantineComponent<{ props: ResourcesScheduleProps; ref: HTMLDivElement; stylesNames: ResourcesScheduleStylesNames; }>; export declare namespace ResourcesSchedule { type Props = ResourcesScheduleProps; type StylesNames = ResourcesScheduleStylesNames; type Factory = ResourcesScheduleFactory; type ViewLevel = ResourcesScheduleViewLevel; } export {};