@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.
145 lines (144 loc) • 6.18 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 { TemplateRef, ViewChild, ContentChild, ChangeDetectorRef, Input, Directive } from '@angular/core';
import { SchedulerView } from '../../types';
import { EventTemplateDirective, GroupHeaderTemplateDirective } from '../templates';
import { LocalizationService } from '@progress/kendo-angular-l10n';
import { ViewContextService } from '../view-context.service';
import { ViewStateService } from '../view-state.service';
import { isPresent } from '../../common/util';
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";
const defaultSlotClass = (_args) => null;
/**
* @hidden
*/
export class ConfigurationViewBase extends SchedulerView {
localization;
changeDetector;
viewContext;
viewState;
/**
* Defines a function that is executed for every slot in the view.
* The function returns a value which is supported by [`ngClass`](link:site.data.urls.angular['ngclassapi']) [see example](slug:styling_scheduler#toc-styling-the-slots).
*/
slotClass;
/**
* Defines a function that is executed for every event in the view.
* The function returns a value which is supported by [`ngClass`](link:site.data.urls.angular['ngclassapi']).
*/
eventClass;
/**
* Defines a function that is executed for every event in the view.
* The function returns a value which is supported by [`ngStyle`](link:site.data.urls.angular['ngstyleapi']).
*/
eventStyles;
/**
* Specifies the settings for the ongoing events highlight of the Scheduler.
*/
highlightOngoingEvents;
/**
* Specifies whether to display the toolbar of the Scheduler.
*/
get showToolbar() {
return this._showToolbar;
}
set showToolbar(value) {
this._showToolbar = value;
this.viewState.toolbarVisibilityByView.set(this, value);
}
/**
* @hidden
*/
template;
/**
* @hidden
*/
eventTemplate;
/**
* @hidden
*/
groupHeaderTemplate;
/**
* @hidden
*/
get viewSlotClass() {
return isPresent(this.slotClass) ? this.slotClass : (this.schedulerOptions.slotClass || defaultSlotClass);
}
/**
* @hidden
*/
get viewEventClass() {
return isPresent(this.eventClass) ? this.eventClass : this.schedulerOptions.eventClass;
}
/**
* @hidden
*/
get viewEventStyles() {
return isPresent(this.eventStyles) ? this.eventStyles : this.schedulerOptions.eventStyles;
}
/**
* @hidden
*/
get viewHighlightOngoingEvents() {
return isPresent(this.highlightOngoingEvents) ? this.highlightOngoingEvents : this.schedulerOptions.highlightOngoingEvents;
}
/**
* @hidden
*/
get viewWeekStart() {
return this.schedulerOptions.weekStart;
}
subs;
schedulerOptions = {};
constructor(localization, changeDetector, viewContext, viewState) {
super();
this.localization = localization;
this.changeDetector = changeDetector;
this.viewContext = viewContext;
this.viewState = viewState;
this.subs = this.localization.changes.subscribe(() => {
changeDetector.markForCheck();
});
this.subs.add(this.viewContext.optionsChange.subscribe(this.optionsChange.bind(this)));
}
ngOnChanges(changes) {
this.viewState.notifyOptionsChange(changes);
}
ngOnDestroy() {
this.subs.unsubscribe();
this.viewState.toolbarVisibilityByView.delete(this);
}
optionsChange(options) {
this.schedulerOptions = options;
}
_showToolbar;
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ConfigurationViewBase, deps: [{ token: i1.LocalizationService }, { token: i0.ChangeDetectorRef }, { token: i2.ViewContextService }, { token: i3.ViewStateService }], target: i0.ɵɵFactoryTarget.Directive });
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: ConfigurationViewBase, inputs: { slotClass: "slotClass", eventClass: "eventClass", eventStyles: "eventStyles", highlightOngoingEvents: "highlightOngoingEvents", showToolbar: "showToolbar" }, queries: [{ propertyName: "eventTemplate", first: true, predicate: EventTemplateDirective, descendants: true }, { propertyName: "groupHeaderTemplate", first: true, predicate: GroupHeaderTemplateDirective, descendants: true }], viewQueries: [{ propertyName: "template", first: true, predicate: ["content"], descendants: true, static: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0 });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ConfigurationViewBase, decorators: [{
type: Directive
}], ctorParameters: function () { return [{ type: i1.LocalizationService }, { type: i0.ChangeDetectorRef }, { type: i2.ViewContextService }, { type: i3.ViewStateService }]; }, propDecorators: { slotClass: [{
type: Input
}], eventClass: [{
type: Input
}], eventStyles: [{
type: Input
}], highlightOngoingEvents: [{
type: Input
}], showToolbar: [{
type: Input
}], template: [{
type: ViewChild,
args: ['content', { static: true }]
}], eventTemplate: [{
type: ContentChild,
args: [EventTemplateDirective, { static: false }]
}], groupHeaderTemplate: [{
type: ContentChild,
args: [GroupHeaderTemplateDirective, { static: false }]
}] } });