Enhance calendar view with resource-aware rendering
Adds support for filtering events and rendering across multiple views with resource-specific context Improves event and date rendering to handle resource-based filtering Introduces day view and extends existing calendar infrastructure to support more flexible view configurations
This commit is contained in:
parent
6fc9be9534
commit
7f6279a6f3
17 changed files with 570 additions and 38 deletions
|
|
@ -12,7 +12,7 @@ export class DemoApp {
|
|||
private animator!: NavigationAnimator;
|
||||
private container!: HTMLElement;
|
||||
private weekOffset = 0;
|
||||
private currentView: 'simple' | 'resource' | 'team' = 'simple';
|
||||
private currentView: 'day' | 'simple' | 'resource' | 'team' = 'simple';
|
||||
|
||||
constructor(
|
||||
private orchestrator: CalendarOrchestrator,
|
||||
|
|
@ -66,8 +66,18 @@ export class DemoApp {
|
|||
|
||||
private buildViewConfig(): ViewConfig {
|
||||
const dates = this.dateService.getWeekDates(this.weekOffset, 3);
|
||||
const today = this.dateService.getWeekDates(this.weekOffset, 1);
|
||||
|
||||
switch (this.currentView) {
|
||||
case 'day':
|
||||
return {
|
||||
templateId: 'day',
|
||||
groupings: [
|
||||
{ type: 'resource', values: ['res1', 'res2'] },
|
||||
{ type: 'date', values: today }
|
||||
]
|
||||
};
|
||||
|
||||
case 'simple':
|
||||
return {
|
||||
templateId: 'simple',
|
||||
|
|
@ -110,6 +120,11 @@ export class DemoApp {
|
|||
}
|
||||
|
||||
private setupViewSwitching(): void {
|
||||
document.getElementById('btn-day')?.addEventListener('click', () => {
|
||||
this.currentView = 'day';
|
||||
this.render();
|
||||
});
|
||||
|
||||
document.getElementById('btn-simple')?.addEventListener('click', () => {
|
||||
this.currentView = 'simple';
|
||||
this.render();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue