Unifies all-day event element tag

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.
This commit is contained in:
Janus C. H. Knudsen 2025-09-21 16:03:34 +02:00
parent c7dcfbbaed
commit 2cdbc8f1a3
5 changed files with 12 additions and 12 deletions

View file

@ -225,7 +225,7 @@ export class SwpEventElement extends BaseEventElement {
}
/**
* All-day event element (swp-allday-event)
* All-day event element (now using unified swp-event tag)
*/
export class SwpAllDayEventElement extends BaseEventElement {
private columnIndex: number;
@ -239,7 +239,7 @@ export class SwpAllDayEventElement extends BaseEventElement {
}
protected createElement(): HTMLElement {
return document.createElement('swp-allday-event');
return document.createElement('swp-event');
}
/**
@ -295,7 +295,7 @@ export class SwpAllDayEventElement extends BaseEventElement {
const finalColumnSpan = targetDate ? 1 : columnSpan;
// Find occupied rows in the spanned columns using computedStyle
const existingEvents = document.querySelectorAll('swp-allday-event');
const existingEvents = document.querySelectorAll('swp-allday-container swp-event');
const occupiedRows = new Set<number>();
console.log('🔍 SwpAllDayEventElement: Checking grid row for new event', {