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.
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 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.
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.
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.
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.
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.
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.
Creates `SwpEventElement` and `SwpAllDayEventElement` classes for handling event rendering.
Refactors event creation logic in `EventRenderer` to utilize these classes, improving code organization and reusability.
Adds factory methods for creating event elements from `CalendarEvent` objects, simplifying event instantiation and data management.
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.
Updates event creation to correctly use the date from the calendar column, removing unnecessary time manipulation.
Simplifies duration handling by directly using the dataset value.
Removes unused all-day event drag and drop conversion functions.
Modifies event rendering to correctly handle dates that use a 1970 reference point during drag and drop operations.
This ensures that events maintain their correct date when moved between columns, resolving an issue where dragged events would revert to the 1970 reference date.
Introduces event resizing feature, allowing users to dynamically adjust event durations by dragging handles on the top or bottom of events.
Moves resize logic into a dedicated ResizeManager class for better code organization and separation of concerns.
Addresses an issue where dragging events that are part of a stack could lead to inconsistencies.
This change ensures that when an event is dragged and dropped, the other events in the stack are also repositioned correctly.
It traverses the stack, removes the related events from their original positions, and re-renders them in the correct column.
It also removes stack link data from the dragged element to prevent unexpected behavior.
Updates event start and end times in the dataset after a successful drag and drop operation. This ensures the event element reflects the new time position.
Also resets the z-index of the dropped element if no overlaps are detected, keeping the element's original appearance.
Ensures dragged event clones maintain correct positioning
by setting `marginLeft` to `0px`. This fixes a potential
visual issue where the clone might not fill the full
column width during dragging.
Replaces the old overlap handling system with a new approach.
The new system recalculates overlaps after a drag-and-drop action and re-renders the affected events, avoiding manual group management. This simplifies the overlap resolution logic and improves performance.
Restructures the project for better maintainability and clarity. Adds a ManagerFactory for dependency injection and reorganizes files.
Updates event rendering logic to correctly handle overlapping events using a stack link system. The EventRendererStrategy now correctly processes and renders event overlaps, ensuring proper display. Introduces processing tracking to avoid double rendering.
Updates documentation to reflect the new structure and build process. Also implements changes to build output and event system for improved clarity.
Fixes#123
Ensures existing events maintain their base positions when a new event is dragged and dropped into an overlapping time slot.
The fix prioritizes existing events in the stack, placing the newly dropped event on top. This ensures correct visual representation and expected behavior during event manipulation.
Refactors event overlap handling to use a DOM-centric approach with data attributes for stack tracking. This eliminates complex state management, reduces code complexity, and improves maintainability. Removes the previous Map-based linked list implementation.
The new approach offers better debugging, automatic memory management, and eliminates state synchronization bugs.
The solution maintains identical functionality with a significantly simpler implementation, focusing on DOM manipulation for visual stacking and column sharing.
Addresses potential performance concerns of DOM queries by scoping them to specific containers.
Refactors event overlap detection to use pixel-based comparison.
This improves accuracy and addresses issues with incorrect overlap
calculations when events have slight time differences but visually overlap.
It removes dependency on the event manager and the need to convert elements
to calendar events for overlap detection.
Refactors event dropping logic to first check for existing
event groups. If a group exists and the dropped event overlaps
with it, the dropped event is added to the group. Otherwise,
it proceeds with full overlap detection against individual events.
This change prevents unnecessary group creation and optimizes
event arrangement within columns. It also ensures the dragged
event is placed on the rightmost side by adding it to the
overlapping events array last.
Updates the event overlap detection to accurately determine when events overlap in time, fixing incorrect stacking behavior.
Implements column sharing for events starting within 30 minutes of each other.
Applies stacking only when events truly overlap in time but start times differ by more than 30 minutes.
Removes unnecessary data attributes and simplifies styling for stacked events, improving code cleanliness and performance.
Adds logic to handle event overlaps in the calendar view. It introduces two patterns: column sharing for events with the same start time (rendered using flexbox) and stacking for events with a >30 min difference (rendered with reduced width and z-index).
It also introduces deep linking to specific events via URL parameters.
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.