Addresses issues with all-day event duration calculation and positioning during drag and drop.
- Uses `differenceInCalendarDays` to correctly calculate event duration across timezone and DST boundaries.
- Preserves the original event time when moving events to a different day.
- Snaps dragged event to the top of the target time slot.
Refactors all-day event layout calculation and rendering for improved accuracy and performance.
Improves drag-and-drop behavior for all-day events, ensuring correct event placement and column detection.
Addresses issues with event overflow display and provides a more responsive user experience.
Refactors drag and drop logic to use the dragged clone consistently, fixing issues with event handling and element manipulation during drag operations.
Also includes a fix where the original element is removed after a drag is completed.
Adds column bounds cache update after drag operations for improved column detection.
Refactors all-day event conversion during drag and drop to
use the event payload, improving code clarity and reducing
redundancy.
Removes unnecessary style settings and fixes column detection
logic. Addresses an issue where event removal occurred before
successful placement.
Improves drag and drop functionality by refactoring column detection to use column bounds instead of dates.
This change enhances the accuracy and efficiency of determining the target column during drag operations.
It also removes redundant code and simplifies the logic in both the DragDropManager and AllDayManager.
Simplifies all-day event rendering by streamlining the layout
calculation and event placement process, using the AllDayLayoutEngine
to determine the grid positions. This removes deprecated methods
and improves overall code clarity.
Refactors drag and drop handling to use a cloned event element,
ensuring correct positioning and styling during drag operations
for both regular timed events and all-day events.
This change streamlines the drag and drop process by:
- Creating a clone of the dragged event at the start of the drag.
- Passing the clone through the drag events.
- Handling all-day events with the AllDayManager
- Handling regular timed events with the EventRendererManager
This resolves issues with event positioning and styling during
drag, especially when moving events across columns or between
all-day and timed sections.
Refactors all-day event drag and drop handling for improved accuracy and performance.
Introduces a shared `ColumnDetectionUtils` for consistent column detection.
Simplifies all-day conversion during drag, placing events in row 1 and calculating the column from the target date.
Implements differential updates during drag end, updating only changed events for smoother transitions.
Implements drag cancellation when the mouse leaves the calendar container during a drag operation. This prevents orphaned drag clones and restores the original event's state, enhancing user experience.
All-day events now correctly recalculate their height upon drag cancellation, ensuring accurate rendering after clone removal.
Refactors HeaderManager by removing redundant caching of the calendar header element.
Adds new mock event data for September and October 2025 to expand testing and demonstration scenarios.
Refactors drag-to-all-day functionality to apply CSS styling and reposition the existing drag clone within the all-day container, rather than creating a new event element.
Centralizes all-day container creation in HeaderManager. Introduces `drag:mouseleave-header` to handle transitions from all-day back to timed events.
Ensures consistent styling and robust cleanup of drag clones for a smoother user experience.
Removes the `swp-allday-event` custom element, using `swp-event` for all-day events instead. All-day events are now distinguished by their parent `swp-allday-container`. Simplifies element management and CSS selectors.
Introduces dedicated TypeScript interfaces for all drag-and-drop event payloads, enhancing type safety and developer experience.
Centralizes drag event detection and emission within `DragDropManager`. Refactors `AllDayManager`, `HeaderManager`, and `EventRendererManager` to subscribe to these typed events, improving decoupling and clarifying responsibilities.
Resolves known inconsistencies in drag event payloads, especially for all-day event conversions. Adds a comprehensive analysis document (`docs/EventSystem-Analysis.md`) detailing the event system and planned improvements.
Centralizes drag event listener setup in `EventRendererManager` for better separation of concerns.
Introduces factory and cloning methods in `SwpEventElement` to simplify event cloning and data extraction from DOM elements during drag operations.
Enhances `DragDropManager` to pass the actual dragged element for conversion and accurately detect the drop target (day column or header).
Updates `EventRenderer` to expose drag-handling methods publicly, allowing the `EventRendererManager` to delegate event-specific drag operations based on drop target.
Implements comprehensive drag and drop for all-day events, allowing movement within the header and conversion to timed events when dragged into the calendar grid.
Optimizes column detection with a cached bounding box strategy, improving performance and accuracy. Refactors event conversion logic and renames related event bus events for clarity.
Updates the `HeaderManager` to utilize `mouseenter` and `mouseleave` events on the calendar header for improved performance and accuracy.
Calculates the target date based on the mouse's X-coordinate within the header.
Removes the need for 'ghost columns' by simplifying the logic. This significantly reduces complexity.
The `AllDayEventRenderer` is modified to reflect this change, omitting ghost column creation.
Updates `DragDropManager` to accommodate the new interaction model.
Various console logs are added for debugging purposes.
Refactors drag and drop logic for better event handling and code clarity.
- Moves drag styling to CSS class for cleaner code.
- Emits a 'drag:convert-from-allday' event to handle the conversion of all-day events back to day events.
- Adds logging for debugging purposes.
Hides the drag clone when moving events to the all-day area and shows it again when the mouse leaves the header to prevent visual inconsistencies.
Ensures only the correct all-day event is removed by specifying the container in the selector.
Ensures that when dragging an event from the all-day section and the mouse leaves the header, the original all-day event is removed, allowing the cloned event in the day columns to take over seamlessly. This prevents duplicate events from appearing.
Refactors drag and drop logic to dynamically find the dragged element, ensuring correct behavior even when the DOM changes during the drag operation.
Creates all-day container if it doesn't exist.
This resolves issues where drag and drop operations would fail if the original element was no longer present in the DOM or if the container didn't exist.
Centralizes event position calculations into `PositionUtils` for consistency and reusability across managers and renderers.
Improves drag-and-drop functionality by emitting events for all-day event conversion and streamlining position calculations during drag operations.
Introduces `AllDayManager` and `AllDayEventRenderer` to manage and render all-day events in the calendar header. This allows dragging events to the header to convert them to all-day events.
Introduces the ability to convert all-day events to timed events by dragging them out of the header.
Leverages a factory method to create timed events from all-day elements, ensuring proper data conversion and styling.
Improves user experience by allowing more flexible event scheduling.
Improves drag and drop event handling, including conversion between all-day and timed events.
Introduces HeaderManager to handle header-related event logic and
centralizes header event handling for better code organization and
separation of concerns.
Optimizes event listeners and throttles events for improved performance.
Removes redundant code and improves the overall drag and drop
experience.
Enhances drag and drop behavior by introducing free positioning during auto-scroll and snapping to grid intervals.
- Introduces a `calculateFreePosition` method to allow events to follow the mouse exactly during auto-scroll.
- Modifies the drag move event to emit the snapped position during normal drag behavior.
- Updates event rendering to use grid settings for snap intervals.
- Updates grid styles to configure CSS variables dynamically.
Refines the drag and drop autoscroll functionality to correctly update the position of the dragged element relative to the scrolling container.
Calculates the snapped position based on the column's bounding rectangle and scroll movement, ensuring accurate placement during autoscroll. This provides a smoother and more responsive user experience when dragging elements near the edges of the scrollable area.
Streamlines calendar configuration by adopting a singleton pattern for consistent access and simplifies event handling.
- Removes direct `CalendarConfig` dependency injection in favor of the `calendarConfig` singleton, reducing code complexity.
- Replaces specific event emissions for grid, date, and resource settings updates with a general `REFRESH_REQUESTED` event.
- Updates event names to be more descriptive and consistent ("NAVIGATION_COMPLETED", "PERIOD_INFO_UPDATE").
- Removes the need to pass the calendar config to renderers since it is now a singleton.
This improves code maintainability and simplifies the event emission process.
Improves drag and drop performance by caching DOM elements and consolidating position calculations.
This reduces redundant DOM queries and optimizes event handling for smoother user interaction.
Also leverages `DateCalculator` for date/time conversions.
Cleans up the codebase by removing unnecessary console log statements.
These logs were primarily used for debugging and are no longer needed in the production code.
This reduces noise in the console and improves overall performance.
Introduces a DragDropManager to handle event dragging and dropping, replacing the ColumnDetector.
This change centralizes drag and drop logic, improving code organization and maintainability.
The EventRenderer now uses the DragDropManager's events to visually update the calendar during drag operations.
Removes ColumnDetector which is now replaced by the drag and drop manager.