Refactor GridManager with new DateColumnDataSource

Introduces DateColumnDataSource to centralize date column generation logic
Simplifies GridManager by delegating date calculations to dedicated data source
Enhances flexibility for different calendar views and date rendering strategies

Improves separation of concerns and makes calendar view management more modular
This commit is contained in:
Janus C. H. Knudsen 2025-11-13 23:35:29 +01:00
parent 284c85b2f8
commit 75a2d4913e
6 changed files with 229 additions and 157 deletions

View file

@ -0,0 +1,18 @@
/**
* IColumnDataSource - Defines the contract for providing column data
*
* This interface abstracts away whether columns represent dates or resources,
* allowing the calendar to switch between date-based and resource-based views.
*/
export interface IColumnDataSource {
/**
* Get the list of column identifiers to render
* @returns Array of identifiers (dates or resource IDs)
*/
getColumns(): Date[];
/**
* Get the type of columns this datasource provides
*/
getType(): 'date' | 'resource';
}