Enhances event drag and resize functionality

Improves event dragging by tracking the source column and using the updated event data for re-rendering affected columns.

Also, enhances event resizing by updating the event data and re-rendering the column to recalculate stacking/grouping.

Uses snap interval as minimum duration when resizing.
This commit is contained in:
Janus C. H. Knudsen 2025-10-08 22:18:06 +02:00
parent e83753a7d2
commit ecb1729c28
4 changed files with 154 additions and 7 deletions

View file

@ -39,9 +39,10 @@ export interface DragMoveEventPayload {
export interface DragEndEventPayload {
originalElement: HTMLElement;
draggedClone: HTMLElement | null;
sourceColumn: ColumnBounds | null; // Where drag started
mousePosition: MousePosition;
finalPosition: {
column: ColumnBounds | null;
column: ColumnBounds | null; // Where drag ended
snappedY: number;
};
target: 'swp-day-column' | 'swp-day-header' | null;
@ -78,5 +79,12 @@ export interface DragColumnChangeEventPayload {
// Header ready event payload
export interface HeaderReadyEventPayload {
headerElements: ColumnBounds[];
}
// Resize end event payload
export interface ResizeEndEventPayload {
eventId: string;
element: HTMLElement;
finalHeight: number;
}