Introduces web components for event elements, separating timed and all-day events into distinct components for better organization and reusability.
This change also simplifies event rendering and drag-and-drop operations by leveraging the properties and lifecycle methods of web components.
Refactors event rendering to handle transitive overlaps, ensuring that entire chains of overlapping events are correctly processed.
Fixes an issue where only direct overlaps were re-rendered after a drag and drop, leading to inconsistent stacking.
Now collects and re-renders all events in the stack.
Enhances date validation and timezone handling using DateService, ensuring data integrity and consistency.
Refactors event rendering and dragging to correctly handle date transformations.
Adds a test plan for event stacking and z-index management.
Fixes edge cases in navigation and date calculations for week/year boundaries and DST transitions.
Standardizes date manipulation across the application by leveraging the DateService.
This change improves consistency and reduces code duplication by removing redundant date calculations.
Replaces DateCalculator with DateService for improved date and time operations, including timezone handling.
This change enhances the calendar's accuracy and flexibility in managing dates, especially concerning timezone configurations.
It also corrects a typo in the `allDay` dataset attribute.
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.
Adds DateService using date-fns-tz for robust time zone
conversions and date manipulations.
Refactors DateCalculator and TimeFormatter to utilize the
DateService, centralizing date logic and ensuring consistent
time zone handling throughout the application.
Improves event dragging by updating time displays and data
attributes, handling cross-midnight events correctly.
Comments out the timestamp update logic within the dragged clone functionality.
This change is a preliminary step towards refactoring the scroll logic, which will be managed by a dedicated scroll manager, decoupling it from the event renderer.
Adds options for technical date and time formatting and includes the option to show seconds.
Updates time formatting to use UTC-to-local conversion and ensures consistent colon separators for time values.
Adjusts all-day event handling to preserve original start/end times.
Refines drag and drop behavior for all-day events.
Removes unnecessary logging and conditional logic in the
AllDayManager.
Simplifies column change handling in the EventRendererManager.
Ensures that the all-day event overflow indicator updates
correctly when the number of events changes, instead of
creating duplicate indicators.
Removes unused event click handling logic.
Refactors all-day event rendering to use header column data.
This ensures events are rendered based on the actual visible
dates in the header, improving accuracy and responsiveness to view changes.
Removes direct dependency on week dates in `AllDayManager` and
`EventRenderingService`, instead, the all-day manager is instantiated
with event manager.
Updates `HeaderManager` to emit header bounds.
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.
Moves event extraction logic to a shared utility function for reusability.
Removes redundant code and improves consistency in event handling.
The original duration is now mandatory.
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.
Refactors all-day event rendering to use a layout engine
for overlap detection and positioning, ensuring events
are placed in available rows and columns.
Removes deprecated method and adds unit tests.
Ensures all-day container is created as part of the standard header structure, rather than on-demand.
Removes the request listener and logic for ensuring all-day container existence.
Ensures navigation grid uses the same creation method
as the initial load.
This ensures workweek and resource settings are respected,
creating a more consistent experience.
Centralizes grid creation logic within the GridRenderer
for better code organization and reusability. This change
moves the grid rendering functionality from
NavigationRenderer to GridRenderer and updates the
NavigationManager to use the new GridRenderer.
Decouples all-day event rendering, making it reactive to header readiness with period data.
Eliminates explicit DOM element caching, simplifying element access.
Enhances the `header:ready` event payload with `startDate` and `endDate`.
Improves all-day row height animation and calculation.
Event rendering strategies now exclusively handle timed events, while all-day events are managed by a dedicated renderer.
Centralizes calendar header creation within `GridRenderer`, ensuring the header element is always present from initial DOM construction. `HeaderManager` and `ScrollManager` now react to a `header:ready` event, which signifies the header is fully initialized.
Synchronizes all-day event rendering with header readiness, temporarily queuing events until the header is prepared. Emits an `allday:checkHeight` event to prompt all-day container height adjustments after rendering.
Deletes a large set of architectural plans, code reviews, and implementation documents. This content is no longer relevant as the described features and refactorings are complete.
Streamlines the event renderer by removing legacy drag event listener setup and outdated comments, reflecting improved separation of concerns and rendering strategies.
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.
Addresses two key issues related to dragging events to the header: the premature removal of the original event element and the creation of duplicate all-day events.
The original event is no longer removed when dragging to the header; it is now only removed upon a successful drop.
Also, it prevents the creation of duplicate all-day events by checking for existing all-day events before creating new ones, using DOM queries to ensure accurate state.
Enhances the all-day event selection by creating transparent, full-height columns for each day, which enables more accurate and reliable hover detection across all-day events.
Now selects all-day events by hovering on the entire column, not just day headers.
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.
This commit streamlines the codebase by removing the unnecessary `new_` prefixes from the event handling functions, resulting in cleaner and more consistent naming conventions. The functions were likely renamed at some point and the old names were kept around for a while.
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.
Addresses inconsistent time formatting and lack of timezone
handling throughout the application by introducing a
`TimeFormatter` utility.
This class centralizes time formatting logic, providing
timezone conversion (defaults to Europe/Copenhagen) and
support for both 12-hour and 24-hour formats, configurable
via `CalendarConfig`.
It also updates event rendering to utilize the new
`TimeFormatter` for consistent time displays.
Improves code organization and maintainability by separating concerns related to all-day event rendering, header management, and event resizing.
Moves all-day event rendering logic into a dedicated `AllDayEventRenderer` class, utilizing the factory pattern for event element creation.
Refactors `AllDayManager` to handle all-day row height animations, separated from `HeaderManager`.
Removes the `ResizeManager` and related functionality.
These changes aim to reduce code duplication, improve testability, and enhance the overall architecture of the calendar component.