@progress/kendo-angular-scheduler
Version:
Kendo UI Scheduler Angular - Outlook or Google-style angular scheduler calendar. Full-featured and customizable embedded scheduling from the creator developers trust for professional UI components.
129 lines (128 loc) • 6.83 kB
JavaScript
/**-----------------------------------------------------------------------------------------
* Copyright © 2025 Progress Software Corporation. All rights reserved.
* Licensed under commercial license. See LICENSE.md in the project root for more information
*-------------------------------------------------------------------------------------------*/
import { Component, forwardRef, Input, ContentChild, ChangeDetectionStrategy, ChangeDetectorRef } from '@angular/core';
import { LocalizationService } from '@progress/kendo-angular-l10n';
import { ConfigurationViewBase } from '../common/configuration-view-base';
import { SchedulerView } from '../../types';
import { ViewContextService } from '../view-context.service';
import { ViewStateService } from '../view-state.service';
import { AgendaTimeTemplateDirective, AgendaDateTemplateDirective } from '../templates';
import { AgendaViewInternalComponent } from './agenda-view-internal.component';
import * as i0 from "@angular/core";
import * as i1 from "@progress/kendo-angular-l10n";
import * as i2 from "../view-context.service";
import * as i3 from "../view-state.service";
/**
* Represents the component that renders the **Agenda** view in the Scheduler.
*
* @example
* ```html
* <kendo-scheduler>
* <kendo-scheduler-agenda-view></kendo-scheduler-agenda-view>
* </kendo-scheduler>
* ```
*/
export class AgendaViewComponent extends ConfigurationViewBase {
/**
* @hidden
*/
get title() {
return this.localization.get('agendaViewTitle');
}
/**
* Sets the long-date format for the selected date in the Scheduler toolbar.
* Defaults to `'{0:D} - {1:D}'`, where `0` is the start and `1` is the end date.
* For more information, see [Parsing and Formatting Dates and Numbers](slug:parsingandformatting_intl#date-formatting).
* @default '{0:D} - {1:D}'
*/
selectedDateFormat = '{0:D} - {1:D}';
/**
* Sets the short-date format for the selected date in the Scheduler toolbar.
* Defaults to `'{0:d} - {1:d}'`, where `0` is the start and `1` is the end date.
* For more information, see [Parsing and Formatting Dates and Numbers](slug:parsingandformatting_intl#date-formatting).
* @default '{0:d} - {1:d}'
*/
selectedShortDateFormat = '{0:d} - {1:d}';
/**
* Specifies the number of days that the view will render.
* @default 7
*/
numberOfDays = 7;
/**
* @hidden
*/
agendaTimeTemplate;
/**
* @hidden
*/
agendaDateTemplate;
/**
* The invariant name for this view (`agenda`).
* @default 'agenda'
*/
name = 'agenda';
constructor(localization, changeDetector, viewContext, viewState) {
super(localization, changeDetector, viewContext, viewState);
}
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: AgendaViewComponent, deps: [{ token: i1.LocalizationService }, { token: i0.ChangeDetectorRef }, { token: i2.ViewContextService }, { token: i3.ViewStateService }], target: i0.ɵɵFactoryTarget.Component });
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.14", type: AgendaViewComponent, isStandalone: true, selector: "kendo-scheduler-agenda-view", inputs: { selectedDateFormat: "selectedDateFormat", selectedShortDateFormat: "selectedShortDateFormat", numberOfDays: "numberOfDays" }, providers: [{
provide: SchedulerView,
useExisting: forwardRef(() => AgendaViewComponent)
}], queries: [{ propertyName: "agendaTimeTemplate", first: true, predicate: AgendaTimeTemplateDirective, descendants: true }, { propertyName: "agendaDateTemplate", first: true, predicate: AgendaDateTemplateDirective, descendants: true }], usesInheritance: true, ngImport: i0, template: `
<ng-template #content>
<agenda-view-internal
[numberOfDays]="numberOfDays"
[eventTemplate]="eventTemplate?.templateRef"
[slotClass]="viewSlotClass"
[eventClass]="viewEventClass"
[eventStyles]="viewEventStyles"
[agendaTimeTemplate]="agendaTimeTemplate?.templateRef"
[agendaDateTemplate]="agendaDateTemplate?.templateRef"
[selectedDateFormat]="selectedDateFormat"
[selectedShortDateFormat]="selectedShortDateFormat">
</agenda-view-internal>
</ng-template>
`, isInline: true, dependencies: [{ kind: "component", type: AgendaViewInternalComponent, selector: "agenda-view-internal", inputs: ["eventTemplate", "slotClass", "eventClass", "eventStyles", "agendaTimeTemplate", "agendaDateTemplate", "selectedDateFormat", "selectedShortDateFormat", "numberOfDays"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: AgendaViewComponent, decorators: [{
type: Component,
args: [{
changeDetection: ChangeDetectionStrategy.OnPush,
selector: 'kendo-scheduler-agenda-view',
providers: [{
provide: SchedulerView,
useExisting: forwardRef(() => AgendaViewComponent)
}],
template: `
<ng-template #content>
<agenda-view-internal
[numberOfDays]="numberOfDays"
[eventTemplate]="eventTemplate?.templateRef"
[slotClass]="viewSlotClass"
[eventClass]="viewEventClass"
[eventStyles]="viewEventStyles"
[agendaTimeTemplate]="agendaTimeTemplate?.templateRef"
[agendaDateTemplate]="agendaDateTemplate?.templateRef"
[selectedDateFormat]="selectedDateFormat"
[selectedShortDateFormat]="selectedShortDateFormat">
</agenda-view-internal>
</ng-template>
`,
standalone: true,
imports: [AgendaViewInternalComponent]
}]
}], ctorParameters: () => [{ type: i1.LocalizationService }, { type: i0.ChangeDetectorRef }, { type: i2.ViewContextService }, { type: i3.ViewStateService }], propDecorators: { selectedDateFormat: [{
type: Input
}], selectedShortDateFormat: [{
type: Input
}], numberOfDays: [{
type: Input
}], agendaTimeTemplate: [{
type: ContentChild,
args: [AgendaTimeTemplateDirective, { static: false }]
}], agendaDateTemplate: [{
type: ContentChild,
args: [AgendaDateTemplateDirective, { static: false }]
}] } });