Refactor data source and configuration management
Abstracts column data source with interface Updates managers to use configuration-driven view and date Decouples datasource creation from individual managers Improves flexibility and dependency injection for calendar components
This commit is contained in:
parent
0f10d44037
commit
9d270217bd
6 changed files with 31 additions and 17 deletions
|
|
@ -5,7 +5,7 @@ import { CoreEvents } from '../constants/CoreEvents';
|
|||
import { WeekInfoRenderer } from '../renderers/WeekInfoRenderer';
|
||||
import { GridRenderer } from '../renderers/GridRenderer';
|
||||
import { INavButtonClickedEventPayload } from '../types/EventTypes';
|
||||
import { DateColumnDataSource } from '../datasources/DateColumnDataSource';
|
||||
import { IColumnDataSource } from '../types/ColumnDataSource';
|
||||
import { Configuration } from '../configurations/CalendarConfig';
|
||||
|
||||
export class NavigationManager {
|
||||
|
|
@ -14,7 +14,7 @@ export class NavigationManager {
|
|||
private gridRenderer: GridRenderer;
|
||||
private dateService: DateService;
|
||||
private config: Configuration;
|
||||
private dataSource: DateColumnDataSource;
|
||||
private dataSource: IColumnDataSource;
|
||||
private currentWeek: Date;
|
||||
private targetWeek: Date;
|
||||
private animationQueue: number = 0;
|
||||
|
|
@ -25,7 +25,8 @@ export class NavigationManager {
|
|||
gridRenderer: GridRenderer,
|
||||
dateService: DateService,
|
||||
weekInfoRenderer: WeekInfoRenderer,
|
||||
config: Configuration
|
||||
config: Configuration,
|
||||
dataSource: IColumnDataSource
|
||||
) {
|
||||
this.eventBus = eventBus;
|
||||
this.dateService = dateService;
|
||||
|
|
@ -34,7 +35,7 @@ export class NavigationManager {
|
|||
this.config = config;
|
||||
this.currentWeek = this.getISOWeekStart(new Date());
|
||||
this.targetWeek = new Date(this.currentWeek);
|
||||
this.dataSource = new DateColumnDataSource(dateService, config, this.currentWeek, 'week' as CalendarView);
|
||||
this.dataSource = dataSource;
|
||||
this.init();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue