2025-08-20 19:42:13 +02:00
|
|
|
/**
|
|
|
|
|
* Type definitions for calendar events
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
export interface AllDayEvent {
|
|
|
|
|
id: string;
|
|
|
|
|
title: string;
|
|
|
|
|
start: Date | string;
|
|
|
|
|
end: Date | string;
|
|
|
|
|
allDay: true;
|
|
|
|
|
color?: string;
|
|
|
|
|
metadata?: {
|
|
|
|
|
color?: string;
|
|
|
|
|
category?: string;
|
|
|
|
|
location?: string;
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface TimeEvent {
|
|
|
|
|
id: string;
|
|
|
|
|
title: string;
|
|
|
|
|
start: Date | string;
|
|
|
|
|
end: Date | string;
|
|
|
|
|
allDay?: false;
|
|
|
|
|
color?: string;
|
|
|
|
|
metadata?: {
|
|
|
|
|
color?: string;
|
|
|
|
|
category?: string;
|
|
|
|
|
location?: string;
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
2025-09-21 15:48:13 +02:00
|
|
|
export type CalendarEventData = AllDayEvent | TimeEvent;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Drag Event Payload Interfaces
|
|
|
|
|
* Type-safe interfaces for drag and drop events
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
// Common position interface
|
|
|
|
|
export interface MousePosition {
|
|
|
|
|
x: number;
|
|
|
|
|
y: number;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Drag start event payload
|
|
|
|
|
export interface DragStartEventPayload {
|
|
|
|
|
draggedElement: HTMLElement;
|
|
|
|
|
mousePosition: MousePosition;
|
|
|
|
|
mouseOffset: MousePosition;
|
|
|
|
|
column: string | null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Drag move event payload
|
|
|
|
|
export interface DragMoveEventPayload {
|
|
|
|
|
draggedElement: HTMLElement;
|
|
|
|
|
mousePosition: MousePosition;
|
|
|
|
|
mouseOffset: MousePosition;
|
|
|
|
|
snappedY: number;
|
|
|
|
|
column: string | null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Drag end event payload
|
|
|
|
|
export interface DragEndEventPayload {
|
|
|
|
|
draggedElement: HTMLElement;
|
|
|
|
|
mousePosition: MousePosition;
|
|
|
|
|
finalPosition: {
|
|
|
|
|
column: string | null;
|
|
|
|
|
snappedY: number;
|
|
|
|
|
};
|
|
|
|
|
target: 'swp-day-column' | 'swp-day-header' | null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Drag mouse enter header event payload
|
|
|
|
|
export interface DragMouseEnterHeaderEventPayload {
|
|
|
|
|
targetDate: string;
|
|
|
|
|
mousePosition: MousePosition;
|
|
|
|
|
originalElement: HTMLElement | null;
|
|
|
|
|
cloneElement: HTMLElement | null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Drag mouse leave header event payload
|
|
|
|
|
export interface DragMouseLeaveHeaderEventPayload {
|
|
|
|
|
targetDate: string | null;
|
|
|
|
|
mousePosition: MousePosition;
|
|
|
|
|
originalElement: HTMLElement| null;
|
|
|
|
|
cloneElement: HTMLElement| null;
|
|
|
|
|
}
|