Separates all-day event rendering; handles header lifecycle
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.
This commit is contained in:
parent
996459f226
commit
f5e9909935
6 changed files with 128 additions and 18 deletions
|
|
@ -542,11 +542,20 @@ export abstract class BaseEventRenderer implements EventRendererStrategy {
|
|||
|
||||
renderEvents(events: CalendarEvent[], container: HTMLElement): void {
|
||||
|
||||
// Filter out all-day events - they should be handled by AllDayEventRenderer
|
||||
const timedEvents = events.filter(event => !event.allDay);
|
||||
|
||||
console.log('🎯 EventRenderer: Filtering events', {
|
||||
totalEvents: events.length,
|
||||
timedEvents: timedEvents.length,
|
||||
filteredOutAllDay: events.length - timedEvents.length
|
||||
});
|
||||
|
||||
// Find columns in the specific container for regular events
|
||||
const columns = this.getColumns(container);
|
||||
|
||||
columns.forEach(column => {
|
||||
const columnEvents = this.getEventsForColumn(column, events);
|
||||
const columnEvents = this.getEventsForColumn(column, timedEvents);
|
||||
|
||||
const eventsLayer = column.querySelector('swp-events-layer');
|
||||
if (eventsLayer) {
|
||||
|
|
@ -659,6 +668,14 @@ export class DateEventRenderer extends BaseEventRenderer {
|
|||
this.setupDragEventListeners();
|
||||
}
|
||||
|
||||
/**
|
||||
* Setup drag event listeners - placeholder method
|
||||
*/
|
||||
private setupDragEventListeners(): void {
|
||||
// Drag event listeners are handled by EventRendererManager
|
||||
// This method exists for compatibility
|
||||
}
|
||||
|
||||
protected getColumns(container: HTMLElement): HTMLElement[] {
|
||||
const columns = container.querySelectorAll('swp-day-column');
|
||||
return Array.from(columns) as HTMLElement[];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue