Improves all-day event drag and drop

Enhances the drag and drop experience for all-day events by expanding the header to display the all-day row when dragging an event over it.

Introduces constants for all-day event layout.
This commit is contained in:
Janus Knudsen 2025-08-24 23:31:11 +02:00
parent 457e222262
commit eb08a28495
6 changed files with 118 additions and 10 deletions

View file

@ -1,6 +1,7 @@
// Event rendering strategy interface and implementations
import { CalendarEvent } from '../types/CalendarTypes';
import { ALL_DAY_CONSTANTS } from '../core/CalendarConfig';
import { CalendarConfig } from '../core/CalendarConfig';
import { DateCalculator } from '../utils/DateCalculator';
@ -181,12 +182,8 @@ export abstract class BaseEventRenderer implements EventRendererStrategy {
});
// Calculate and set the all-day row height based on max stack
// Each event is 22px height + 2px gap
const eventHeight = 22;
const gap = 2;
const padding = 4; // Container padding (2px top + 2px bottom)
const calculatedHeight = maxStackHeight > 0
? (maxStackHeight * eventHeight) + ((maxStackHeight - 1) * gap) + padding
? (maxStackHeight * ALL_DAY_CONSTANTS.EVENT_HEIGHT) + ((maxStackHeight - 1) * ALL_DAY_CONSTANTS.EVENT_GAP) + ALL_DAY_CONSTANTS.CONTAINER_PADDING
: 0; // No height if no events
// Set CSS variable for row height