@progress/kendo-angular-scheduler 4.0.0-next.202204011528 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/kendo-angular-scheduler.umd.js +1 -1
- package/editing-directives/base-edit.service.d.ts +18 -0
- package/esm2015/editing/edit-dialog.component.js +1 -1
- package/esm2015/editing/recurrence/recurrence-frequency-editor.component.js +1 -1
- package/esm2015/editing/recurrence/recurrence-weekday-rule-editor.component.js +1 -1
- package/esm2015/editing-directives/base-edit.service.js +18 -0
- package/esm2015/package-metadata.js +1 -1
- package/esm2015/scheduler.component.js +8 -1
- package/esm2015/toolbar/navigation.component.js +1 -1
- package/esm2015/toolbar/view-selector.component.js +1 -1
- package/esm2015/types/ongoing-events-settings.interface.js +5 -0
- package/esm2015/views/common/base-view.js +3 -0
- package/esm2015/views/common/configuration-view-base.js +9 -1
- package/esm2015/views/common/view-footer.component.js +1 -1
- package/esm2015/views/constants.js +6 -0
- package/esm2015/views/day-time/day-time-view-base.js +10 -1
- package/esm2015/views/day-time/day-time-view.component.js +32 -3
- package/esm2015/views/month/month-view-renderer.component.js +44 -7
- package/esm2015/views/month/month-view.component.js +3 -1
- package/esm2015/views/multi-day/day-view.component.js +2 -0
- package/esm2015/views/multi-day/multi-day-view.component.js +2 -0
- package/esm2015/views/multi-day/week-view.component.js +2 -0
- package/esm2015/views/multi-day/work-week-view.component.js +2 -0
- package/esm2015/views/timeline/timeline-month-view.component.js +2 -0
- package/esm2015/views/timeline/timeline-view.component.js +2 -0
- package/esm2015/views/timeline/timeline-week-view.component.js +2 -0
- package/esm2015/views/utils.js +5 -1
- package/fesm2015/kendo-angular-scheduler.js +257 -124
- package/package.json +16 -18
- package/scheduler.component.d.ts +6 -2
- package/schematics/ngAdd/index.js +1 -1
- package/types/ongoing-events-settings.interface.d.ts +23 -0
- package/types.d.ts +1 -0
- package/views/common/base-view.d.ts +6 -0
- package/views/common/configuration-view-base.d.ts +10 -2
- package/views/constants.d.ts +6 -0
- package/views/day-time/day-time-view-base.d.ts +10 -2
- package/views/day-time/day-time-view.component.d.ts +7 -1
- package/views/month/month-view-renderer.component.d.ts +11 -2
|
@@ -69,8 +69,26 @@ export declare abstract class BaseEditService<TEvent> implements EditService<TEv
|
|
|
69
69
|
remove(event: TEvent): void;
|
|
70
70
|
removeSeries(event: TEvent): void;
|
|
71
71
|
removeOccurrence(event: TEvent): void;
|
|
72
|
+
/**
|
|
73
|
+
* Returns the master recurring event for a specified recurring event.
|
|
74
|
+
*
|
|
75
|
+
* @param event - An event from the recurrence series.
|
|
76
|
+
* @returns the master recurring event for the series.
|
|
77
|
+
*/
|
|
72
78
|
findRecurrenceMaster(event: TEvent): any;
|
|
79
|
+
/**
|
|
80
|
+
* Checks if the event is part of the recurrence series.
|
|
81
|
+
*
|
|
82
|
+
* @param event - The event that will be checked.
|
|
83
|
+
* @returns `true` if the event is an occurrence, an exception, or a master event. Otherwise, returns `false`.
|
|
84
|
+
*/
|
|
73
85
|
isRecurring(event: any): boolean;
|
|
86
|
+
/**
|
|
87
|
+
* Checks if the event is a recurrence exception.
|
|
88
|
+
*
|
|
89
|
+
* @param event - The event that will be checked.
|
|
90
|
+
* @returns `true` if the event is a unique event which belongs to a recurrence series. Otherwise, returns `false`.
|
|
91
|
+
*/
|
|
74
92
|
isException(event: any): boolean;
|
|
75
93
|
/**
|
|
76
94
|
* Returns a Boolean value which indicates if the event is new.
|
|
@@ -359,7 +359,7 @@ EditDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", ve
|
|
|
359
359
|
<button kendoButton themeColor="primary" (click)="onSave($event)" [disabled]="!formGroup.valid">{{ textFor('save') }}</button>
|
|
360
360
|
</kendo-dialog-actions>
|
|
361
361
|
</kendo-dialog>
|
|
362
|
-
`, isInline: true, components: [{ type: i4.DialogComponent, selector: "kendo-dialog", inputs: ["actions", "actionsLayout", "autoFocusedElement", "title", "width", "minWidth", "maxWidth", "height", "minHeight", "maxHeight"], outputs: ["action", "close"], exportAs: ["kendoDialog"] }, { type: i5.SchedulerDateTimePickerComponent, selector: "kendo-scheduler-datetime-picker", inputs: ["isAllDay"], outputs: ["valueChange"] }, { type: i6.TimeZoneEditorComponent, selector: "kendo-timezone-editor", inputs: ["width"], outputs: ["valueChange"] }, { type: i7.RecurrenceEditorComponent, selector: "kendo-recurrence-editor", inputs: ["start", "timezone", "weekStart", "repeatEveryOptions", "endAfterOptions", "repeatOnOptions", "endOnOptions"], outputs: ["valueChange"], exportAs: ["kendoRecurrenceEditor"] }, { type: i8.MultipleResourceEditorComponent, selector: "kendo-multiple-resource-editor" }, { type: i9.SingleResourceEditorComponent, selector: "kendo-single-resource-editor" }, { type: i4.DialogActionsComponent, selector: "kendo-dialog-actions", inputs: ["actions", "layout"], outputs: ["action"] }], directives: [{ type: i10.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i11.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i11.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i11.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i12.TextBoxDirective, selector: "input[kendoTextBox]", inputs: ["value"] }, { type: i11.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i11.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i11.FormControlDirective, selector: "[formControl]", inputs: ["disabled", "formControl", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: i11.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { type: i12.CheckBoxDirective, selector: "input[kendoCheckBox]", inputs: ["size", "rounded"] }, { type: i11.FormControlName, selector: "[formControlName]", inputs: ["disabled", "formControlName", "ngModel"], outputs: ["ngModelChange"] }, { type: i12.TextAreaDirective, selector: "textarea[kendoTextArea]", inputs: ["autoSize", "value"], outputs: ["valueChange"] }, { type: i10.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i10.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i13.ButtonDirective, selector: "button[kendoButton], span[kendoButton]", inputs: ["toggleable", "togglable", "selected", "tabIndex", "icon", "iconClass", "imageUrl", "disabled", "size", "rounded", "fillMode", "themeColor", "
|
|
362
|
+
`, isInline: true, components: [{ type: i4.DialogComponent, selector: "kendo-dialog", inputs: ["actions", "actionsLayout", "autoFocusedElement", "title", "width", "minWidth", "maxWidth", "height", "minHeight", "maxHeight"], outputs: ["action", "close"], exportAs: ["kendoDialog"] }, { type: i5.SchedulerDateTimePickerComponent, selector: "kendo-scheduler-datetime-picker", inputs: ["isAllDay"], outputs: ["valueChange"] }, { type: i6.TimeZoneEditorComponent, selector: "kendo-timezone-editor", inputs: ["width"], outputs: ["valueChange"] }, { type: i7.RecurrenceEditorComponent, selector: "kendo-recurrence-editor", inputs: ["start", "timezone", "weekStart", "repeatEveryOptions", "endAfterOptions", "repeatOnOptions", "endOnOptions"], outputs: ["valueChange"], exportAs: ["kendoRecurrenceEditor"] }, { type: i8.MultipleResourceEditorComponent, selector: "kendo-multiple-resource-editor" }, { type: i9.SingleResourceEditorComponent, selector: "kendo-single-resource-editor" }, { type: i4.DialogActionsComponent, selector: "kendo-dialog-actions", inputs: ["actions", "layout"], outputs: ["action"] }], directives: [{ type: i10.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i11.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i11.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i11.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i12.TextBoxDirective, selector: "input[kendoTextBox]", inputs: ["value"] }, { type: i11.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i11.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i11.FormControlDirective, selector: "[formControl]", inputs: ["disabled", "formControl", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: i11.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { type: i12.CheckBoxDirective, selector: "input[kendoCheckBox]", inputs: ["size", "rounded"] }, { type: i11.FormControlName, selector: "[formControlName]", inputs: ["disabled", "formControlName", "ngModel"], outputs: ["ngModelChange"] }, { type: i12.TextAreaDirective, selector: "textarea[kendoTextArea]", inputs: ["autoSize", "value"], outputs: ["valueChange"] }, { type: i10.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i10.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i13.ButtonDirective, selector: "button[kendoButton], span[kendoButton]", inputs: ["toggleable", "togglable", "selected", "tabIndex", "icon", "iconClass", "imageUrl", "disabled", "size", "rounded", "fillMode", "themeColor", "role", "primary", "look"], outputs: ["selectedChange", "click"], exportAs: ["kendoButton"] }] });
|
|
363
363
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: EditDialogComponent, decorators: [{
|
|
364
364
|
type: Component,
|
|
365
365
|
args: [{
|
|
@@ -53,7 +53,7 @@ RecurrenceFrequencyEditorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersio
|
|
|
53
53
|
>{{ freq.text }}</button>
|
|
54
54
|
</kendo-buttongroup>
|
|
55
55
|
</div>
|
|
56
|
-
`, isInline: true, components: [{ type: i3.ButtonGroupComponent, selector: "kendo-buttongroup", inputs: ["disabled", "selection", "width", "tabIndex"], outputs: ["navigate"], exportAs: ["kendoButtonGroup"] }], directives: [{ type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i3.ButtonDirective, selector: "button[kendoButton], span[kendoButton]", inputs: ["toggleable", "togglable", "selected", "tabIndex", "icon", "iconClass", "imageUrl", "disabled", "size", "rounded", "fillMode", "themeColor", "
|
|
56
|
+
`, isInline: true, components: [{ type: i3.ButtonGroupComponent, selector: "kendo-buttongroup", inputs: ["disabled", "selection", "width", "tabIndex"], outputs: ["navigate"], exportAs: ["kendoButtonGroup"] }], directives: [{ type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i3.ButtonDirective, selector: "button[kendoButton], span[kendoButton]", inputs: ["toggleable", "togglable", "selected", "tabIndex", "icon", "iconClass", "imageUrl", "disabled", "size", "rounded", "fillMode", "themeColor", "role", "primary", "look"], outputs: ["selectedChange", "click"], exportAs: ["kendoButton"] }] });
|
|
57
57
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: RecurrenceFrequencyEditorComponent, decorators: [{
|
|
58
58
|
type: Component,
|
|
59
59
|
args: [{
|
|
@@ -78,7 +78,7 @@ RecurrenceWeekdayRuleEditorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVers
|
|
|
78
78
|
>{{ capitalize(day.text) }}</button>
|
|
79
79
|
</kendo-buttongroup>
|
|
80
80
|
</div>
|
|
81
|
-
`, isInline: true, components: [{ type: i3.ButtonGroupComponent, selector: "kendo-buttongroup", inputs: ["disabled", "selection", "width", "tabIndex"], outputs: ["navigate"], exportAs: ["kendoButtonGroup"] }], directives: [{ type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i3.ButtonDirective, selector: "button[kendoButton], span[kendoButton]", inputs: ["toggleable", "togglable", "selected", "tabIndex", "icon", "iconClass", "imageUrl", "disabled", "size", "rounded", "fillMode", "themeColor", "
|
|
81
|
+
`, isInline: true, components: [{ type: i3.ButtonGroupComponent, selector: "kendo-buttongroup", inputs: ["disabled", "selection", "width", "tabIndex"], outputs: ["navigate"], exportAs: ["kendoButtonGroup"] }], directives: [{ type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i3.ButtonDirective, selector: "button[kendoButton], span[kendoButton]", inputs: ["toggleable", "togglable", "selected", "tabIndex", "icon", "iconClass", "imageUrl", "disabled", "size", "rounded", "fillMode", "themeColor", "role", "primary", "look"], outputs: ["selectedChange", "click"], exportAs: ["kendoButton"] }] });
|
|
82
82
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: RecurrenceWeekdayRuleEditorComponent, decorators: [{
|
|
83
83
|
type: Component,
|
|
84
84
|
args: [{
|
|
@@ -99,6 +99,12 @@ export class BaseEditService {
|
|
|
99
99
|
this.logRemoveOccurrence(event);
|
|
100
100
|
this.saveChanges();
|
|
101
101
|
}
|
|
102
|
+
/**
|
|
103
|
+
* Returns the master recurring event for a specified recurring event.
|
|
104
|
+
*
|
|
105
|
+
* @param event - An event from the recurrence series.
|
|
106
|
+
* @returns the master recurring event for the series.
|
|
107
|
+
*/
|
|
102
108
|
findRecurrenceMaster(event) {
|
|
103
109
|
const id = this.getId(event);
|
|
104
110
|
const recurrenceId = this.getRecurrenceId(event);
|
|
@@ -106,9 +112,21 @@ export class BaseEditService {
|
|
|
106
112
|
const index = this.itemIndex(headId, this.data);
|
|
107
113
|
return this.data[index];
|
|
108
114
|
}
|
|
115
|
+
/**
|
|
116
|
+
* Checks if the event is part of the recurrence series.
|
|
117
|
+
*
|
|
118
|
+
* @param event - The event that will be checked.
|
|
119
|
+
* @returns `true` if the event is an occurrence, an exception, or a master event. Otherwise, returns `false`.
|
|
120
|
+
*/
|
|
109
121
|
isRecurring(event) {
|
|
110
122
|
return isRecurring(event, this.fields);
|
|
111
123
|
}
|
|
124
|
+
/**
|
|
125
|
+
* Checks if the event is a recurrence exception.
|
|
126
|
+
*
|
|
127
|
+
* @param event - The event that will be checked.
|
|
128
|
+
* @returns `true` if the event is a unique event which belongs to a recurrence series. Otherwise, returns `false`.
|
|
129
|
+
*/
|
|
112
130
|
isException(event) {
|
|
113
131
|
return isException(event, this.fields);
|
|
114
132
|
}
|
|
@@ -9,7 +9,7 @@ export const packageMetadata = {
|
|
|
9
9
|
name: '@progress/kendo-angular-scheduler',
|
|
10
10
|
productName: 'Kendo UI for Angular',
|
|
11
11
|
productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
|
|
12
|
-
publishDate:
|
|
12
|
+
publishDate: 1650441034,
|
|
13
13
|
version: '',
|
|
14
14
|
licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license/?utm_medium=product&utm_source=kendoangular&utm_campaign=kendo-ui-angular-purchase-license-keys-warning'
|
|
15
15
|
};
|
|
@@ -158,6 +158,10 @@ export class SchedulerComponent {
|
|
|
158
158
|
* Specifies the Scheduler current time marker settings.
|
|
159
159
|
*/
|
|
160
160
|
this.currentTimeMarker = true;
|
|
161
|
+
/**
|
|
162
|
+
* Specifies the settings for the ongoing events highlight of the Scheduler.
|
|
163
|
+
*/
|
|
164
|
+
this.highlightOngoingEvents = true;
|
|
161
165
|
/**
|
|
162
166
|
* A callback that executes for each slot of the Scheduler view.
|
|
163
167
|
* If it returns `true`, the `k-state-selected` CSS class will be added to the cell, making it visibly selected.
|
|
@@ -729,6 +733,7 @@ export class SchedulerComponent {
|
|
|
729
733
|
selectable: this.selectable,
|
|
730
734
|
timezone: this.timezone,
|
|
731
735
|
currentTimeMarker: this.currentTimeMarker,
|
|
736
|
+
highlightOngoingEvents: this.highlightOngoingEvents,
|
|
732
737
|
slotClass: this.slotClass,
|
|
733
738
|
slotFill: this.slotFill,
|
|
734
739
|
columnWidth: this.columnWidth,
|
|
@@ -860,7 +865,7 @@ export class SchedulerComponent {
|
|
|
860
865
|
}
|
|
861
866
|
}
|
|
862
867
|
SchedulerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SchedulerComponent, deps: [{ token: i0.ElementRef }, { token: i1.ViewContextService }, { token: i2.ViewStateService }, { token: i3.EditService }, { token: i4.DialogsService }, { token: i5.IntlService }, { token: i0.ChangeDetectorRef }, { token: i0.NgZone }, { token: i6.PDFService }, { token: i7.LocalizationService }, { token: i8.DomEventsService }, { token: i0.Renderer2 }, { token: i9.FocusService }], target: i0.ɵɵFactoryTarget.Component });
|
|
863
|
-
SchedulerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SchedulerComponent, selector: "kendo-scheduler", inputs: { selectedViewIndex: "selectedViewIndex", editable: "editable", selectable: "selectable", min: "min", max: "max", eventHeight: "eventHeight", columnWidth: "columnWidth", showWorkHours: "showWorkHours", startTime: "startTime", endTime: "endTime", workDayStart: "workDayStart", workDayEnd: "workDayEnd", workWeekStart: "workWeekStart", workWeekEnd: "workWeekEnd", weekStart: "weekStart", slotDuration: "slotDuration", slotDivisions: "slotDivisions", slotFill: "slotFill", scrollTime: "scrollTime", group: "group", resources: "resources", loading: "loading", timezone: "timezone", events: "events", selectedDate: "selectedDate", modelFields: "modelFields", currentTimeMarker: "currentTimeMarker", slotClass: "slotClass", eventClass: "eventClass", eventStyles: "eventStyles", isSlotSelected: "isSlotSelected" }, outputs: { selectedViewIndexChange: "selectedViewIndexChange", navigate: "navigate", dateChange: "dateChange", slotClick: "slotClick", slotDblClick: "slotDblClick", create: "create", eventClick: "eventClick", eventDblClick: "eventDblClick", eventKeydown: "eventKeydown", cancel: "cancel", save: "save", remove: "remove", resizeStart: "resizeStart", resize: "resize", resizeEnd: "resizeEnd", dragStart: "dragStart", drag: "drag", dragEnd: "dragEnd", slotDragStart: "slotDragStart", slotDrag: "slotDrag", slotDragEnd: "slotDragEnd", pdfExport: "pdfExport" }, host: { properties: { "class.k-widget": "this.hostClasses", "class.k-scheduler": "this.hostClasses", "class.k-floatwrap": "this.hostClasses", "class.k-rtl": "this.rtl", "attr.dir": "this.dir" } }, providers: [
|
|
868
|
+
SchedulerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SchedulerComponent, selector: "kendo-scheduler", inputs: { selectedViewIndex: "selectedViewIndex", editable: "editable", selectable: "selectable", min: "min", max: "max", eventHeight: "eventHeight", columnWidth: "columnWidth", showWorkHours: "showWorkHours", startTime: "startTime", endTime: "endTime", workDayStart: "workDayStart", workDayEnd: "workDayEnd", workWeekStart: "workWeekStart", workWeekEnd: "workWeekEnd", weekStart: "weekStart", slotDuration: "slotDuration", slotDivisions: "slotDivisions", slotFill: "slotFill", scrollTime: "scrollTime", group: "group", resources: "resources", loading: "loading", timezone: "timezone", events: "events", selectedDate: "selectedDate", modelFields: "modelFields", currentTimeMarker: "currentTimeMarker", highlightOngoingEvents: "highlightOngoingEvents", slotClass: "slotClass", eventClass: "eventClass", eventStyles: "eventStyles", isSlotSelected: "isSlotSelected" }, outputs: { selectedViewIndexChange: "selectedViewIndexChange", navigate: "navigate", dateChange: "dateChange", slotClick: "slotClick", slotDblClick: "slotDblClick", create: "create", eventClick: "eventClick", eventDblClick: "eventDblClick", eventKeydown: "eventKeydown", cancel: "cancel", save: "save", remove: "remove", resizeStart: "resizeStart", resize: "resize", resizeEnd: "resizeEnd", dragStart: "dragStart", drag: "drag", dragEnd: "dragEnd", slotDragStart: "slotDragStart", slotDrag: "slotDrag", slotDragEnd: "slotDragEnd", pdfExport: "pdfExport" }, host: { properties: { "class.k-widget": "this.hostClasses", "class.k-scheduler": "this.hostClasses", "class.k-floatwrap": "this.hostClasses", "class.k-rtl": "this.rtl", "attr.dir": "this.dir" } }, providers: [
|
|
864
869
|
EditService,
|
|
865
870
|
DialogsService,
|
|
866
871
|
DomEventsService,
|
|
@@ -1501,6 +1506,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
1501
1506
|
type: Input
|
|
1502
1507
|
}], currentTimeMarker: [{
|
|
1503
1508
|
type: Input
|
|
1509
|
+
}], highlightOngoingEvents: [{
|
|
1510
|
+
type: Input
|
|
1504
1511
|
}], slotClass: [{
|
|
1505
1512
|
type: Input
|
|
1506
1513
|
}], eventClass: [{
|
|
@@ -208,7 +208,7 @@ ToolbarNavigationComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0
|
|
|
208
208
|
</kendo-calendar-messages>
|
|
209
209
|
</kendo-calendar>
|
|
210
210
|
</ng-template>
|
|
211
|
-
`, isInline: true, components: [{ type: i4.CalendarComponent, selector: "kendo-calendar", inputs: ["id", "focusedDate", "min", "max", "rangeValidation", "selection", "value", "disabled", "tabindex", "tabIndex", "disabledDates", "navigation", "activeView", "bottomView", "topView", "type", "animateNavigation", "weekNumber", "cellTemplate", "monthCellTemplate", "yearCellTemplate", "decadeCellTemplate", "centuryCellTemplate", "weekNumberTemplate", "headerTitleTemplate", "navigationItemTemplate"], outputs: ["activeViewChange", "navigate", "activeViewDateChange", "valueChange"], exportAs: ["kendo-calendar"] }, { type: i4.CalendarCustomMessagesComponent, selector: "kendo-calendar-messages" }], directives: [{ type: i5.ButtonDirective, selector: "button[kendoButton], span[kendoButton]", inputs: ["toggleable", "togglable", "selected", "tabIndex", "icon", "iconClass", "imageUrl", "disabled", "size", "rounded", "fillMode", "themeColor", "
|
|
211
|
+
`, isInline: true, components: [{ type: i4.CalendarComponent, selector: "kendo-calendar", inputs: ["id", "focusedDate", "min", "max", "rangeValidation", "selection", "value", "disabled", "tabindex", "tabIndex", "disabledDates", "navigation", "activeView", "bottomView", "topView", "type", "animateNavigation", "weekNumber", "cellTemplate", "monthCellTemplate", "yearCellTemplate", "decadeCellTemplate", "centuryCellTemplate", "weekNumberTemplate", "headerTitleTemplate", "navigationItemTemplate"], outputs: ["activeViewChange", "navigate", "activeViewDateChange", "valueChange"], exportAs: ["kendo-calendar"] }, { type: i4.CalendarCustomMessagesComponent, selector: "kendo-calendar-messages" }], directives: [{ type: i5.ButtonDirective, selector: "button[kendoButton], span[kendoButton]", inputs: ["toggleable", "togglable", "selected", "tabIndex", "icon", "iconClass", "imageUrl", "disabled", "size", "rounded", "fillMode", "themeColor", "role", "primary", "look"], outputs: ["selectedChange", "click"], exportAs: ["kendoButton"] }], pipes: { "async": i6.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
212
212
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ToolbarNavigationComponent, decorators: [{
|
|
213
213
|
type: Component,
|
|
214
214
|
args: [{
|
|
@@ -93,7 +93,7 @@ ToolbarViewSelectorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12
|
|
|
93
93
|
</span>
|
|
94
94
|
</button>
|
|
95
95
|
</span>
|
|
96
|
-
`, isInline: true, directives: [{ type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i3.ButtonDirective, selector: "button[kendoButton], span[kendoButton]", inputs: ["toggleable", "togglable", "selected", "tabIndex", "icon", "iconClass", "imageUrl", "disabled", "size", "rounded", "fillMode", "themeColor", "
|
|
96
|
+
`, isInline: true, directives: [{ type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i3.ButtonDirective, selector: "button[kendoButton], span[kendoButton]", inputs: ["toggleable", "togglable", "selected", "tabIndex", "icon", "iconClass", "imageUrl", "disabled", "size", "rounded", "fillMode", "themeColor", "role", "primary", "look"], outputs: ["selectedChange", "click"], exportAs: ["kendoButton"] }] });
|
|
97
97
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ToolbarViewSelectorComponent, decorators: [{
|
|
98
98
|
type: Component,
|
|
99
99
|
args: [{
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
export {};
|
|
@@ -38,6 +38,9 @@ export class BaseView {
|
|
|
38
38
|
this.pdfService = pdfService;
|
|
39
39
|
this.localization = localization;
|
|
40
40
|
this.cdr = cdr;
|
|
41
|
+
/**
|
|
42
|
+
* The non-all-day events.
|
|
43
|
+
*/
|
|
41
44
|
this.items = new BehaviorSubject(null);
|
|
42
45
|
this.horizontalResources = [];
|
|
43
46
|
this.verticalResources = [];
|
|
@@ -45,6 +45,12 @@ export class ConfigurationViewBase extends SchedulerView {
|
|
|
45
45
|
get viewEventStyles() {
|
|
46
46
|
return isPresent(this.eventStyles) ? this.eventStyles : this.schedulerOptions.eventStyles;
|
|
47
47
|
}
|
|
48
|
+
/**
|
|
49
|
+
* @hidden
|
|
50
|
+
*/
|
|
51
|
+
get viewHighlightOngoingEvents() {
|
|
52
|
+
return isPresent(this.highlightOngoingEvents) ? this.highlightOngoingEvents : this.schedulerOptions.highlightOngoingEvents;
|
|
53
|
+
}
|
|
48
54
|
/**
|
|
49
55
|
* @hidden
|
|
50
56
|
*/
|
|
@@ -62,7 +68,7 @@ export class ConfigurationViewBase extends SchedulerView {
|
|
|
62
68
|
}
|
|
63
69
|
}
|
|
64
70
|
ConfigurationViewBase.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ConfigurationViewBase, deps: [{ token: i1.LocalizationService }, { token: i0.ChangeDetectorRef }, { token: i2.ViewContextService }, { token: i3.ViewStateService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
65
|
-
ConfigurationViewBase.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: ConfigurationViewBase, inputs: { slotClass: "slotClass", eventClass: "eventClass", eventStyles: "eventStyles" }, 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 });
|
|
71
|
+
ConfigurationViewBase.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: ConfigurationViewBase, inputs: { slotClass: "slotClass", eventClass: "eventClass", eventStyles: "eventStyles", highlightOngoingEvents: "highlightOngoingEvents" }, 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 });
|
|
66
72
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ConfigurationViewBase, decorators: [{
|
|
67
73
|
type: Directive
|
|
68
74
|
}], ctorParameters: function () { return [{ type: i1.LocalizationService }, { type: i0.ChangeDetectorRef }, { type: i2.ViewContextService }, { type: i3.ViewStateService }]; }, propDecorators: { slotClass: [{
|
|
@@ -71,6 +77,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
71
77
|
type: Input
|
|
72
78
|
}], eventStyles: [{
|
|
73
79
|
type: Input
|
|
80
|
+
}], highlightOngoingEvents: [{
|
|
81
|
+
type: Input
|
|
74
82
|
}], template: [{
|
|
75
83
|
type: ViewChild,
|
|
76
84
|
args: ['content', { static: true }]
|
|
@@ -30,7 +30,7 @@ ViewFooterComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", ve
|
|
|
30
30
|
<span class="k-button-icon k-icon" [ngClass]="item.iconClass"></span>
|
|
31
31
|
<span class="k-button-text">{{ item.text }}</span>
|
|
32
32
|
</button>
|
|
33
|
-
`, isInline: true, directives: [{ type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i2.ButtonDirective, selector: "button[kendoButton], span[kendoButton]", inputs: ["toggleable", "togglable", "selected", "tabIndex", "icon", "iconClass", "imageUrl", "disabled", "size", "rounded", "fillMode", "themeColor", "
|
|
33
|
+
`, isInline: true, directives: [{ type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i2.ButtonDirective, selector: "button[kendoButton], span[kendoButton]", inputs: ["toggleable", "togglable", "selected", "tabIndex", "icon", "iconClass", "imageUrl", "disabled", "size", "rounded", "fillMode", "themeColor", "role", "primary", "look"], outputs: ["selectedChange", "click"], exportAs: ["kendoButton"] }, { type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
|
|
34
34
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ViewFooterComponent, decorators: [{
|
|
35
35
|
type: Component,
|
|
36
36
|
args: [{
|
|
@@ -21,3 +21,9 @@ export { MS_PER_DAY } from '@progress/kendo-date-math';
|
|
|
21
21
|
export const BORDER_WIDTH = 1;
|
|
22
22
|
/** @hidden */
|
|
23
23
|
export const DEFAULT_EVENT_HEIGHT = 25;
|
|
24
|
+
/** @hidden */
|
|
25
|
+
export const ONGOING_EVENT_CSS_CLASS = 'k-event-ongoing';
|
|
26
|
+
/** @hidden */
|
|
27
|
+
export const DAYS_IN_WEEK_COUNT = 7;
|
|
28
|
+
/** @hidden */
|
|
29
|
+
export const WEEKS_COUNT = 6;
|
|
@@ -22,6 +22,7 @@ const WORK_WEEK_END = 'workWeekEnd';
|
|
|
22
22
|
const SLOT_DURATION = 'slotDuration';
|
|
23
23
|
const SLOT_DIVISIONS = 'slotDivisions';
|
|
24
24
|
const CURRENT_TIME_MARKER = 'currentTimeMarker';
|
|
25
|
+
const HIGHLIGHT_ONGOING_EVENTS = 'highlightOngoingEvents';
|
|
25
26
|
/**
|
|
26
27
|
* @hidden
|
|
27
28
|
*/
|
|
@@ -95,6 +96,12 @@ export class DayTimeViewBase extends ConfigurationViewBase {
|
|
|
95
96
|
get viewCurrentTimeMarker() {
|
|
96
97
|
return this.optionValue(CURRENT_TIME_MARKER);
|
|
97
98
|
}
|
|
99
|
+
/**
|
|
100
|
+
* @hidden
|
|
101
|
+
*/
|
|
102
|
+
get viewHighlightOngoingEvents() {
|
|
103
|
+
return this.optionValue(HIGHLIGHT_ONGOING_EVENTS);
|
|
104
|
+
}
|
|
98
105
|
/**
|
|
99
106
|
* @hidden
|
|
100
107
|
*/
|
|
@@ -106,7 +113,7 @@ export class DayTimeViewBase extends ConfigurationViewBase {
|
|
|
106
113
|
}
|
|
107
114
|
}
|
|
108
115
|
DayTimeViewBase.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: DayTimeViewBase, deps: [{ token: i1.LocalizationService }, { token: i0.ChangeDetectorRef }, { token: i2.ViewContextService }, { token: i3.ViewStateService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
109
|
-
DayTimeViewBase.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: DayTimeViewBase, inputs: { showWorkHours: "showWorkHours", eventHeight: "eventHeight", startTime: "startTime", scrollTime: "scrollTime", endTime: "endTime", workDayStart: "workDayStart", workDayEnd: "workDayEnd", workWeekStart: "workWeekStart", workWeekEnd: "workWeekEnd", slotDuration: "slotDuration", slotDivisions: "slotDivisions", currentTimeMarker: "currentTimeMarker" }, queries: [{ propertyName: "timeSlotTemplate", first: true, predicate: TimeSlotTemplateDirective, descendants: true }, { propertyName: "dateHeaderTemplate", first: true, predicate: DateHeaderTemplateDirective, descendants: true }], usesInheritance: true, ngImport: i0 });
|
|
116
|
+
DayTimeViewBase.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: DayTimeViewBase, inputs: { showWorkHours: "showWorkHours", eventHeight: "eventHeight", startTime: "startTime", scrollTime: "scrollTime", endTime: "endTime", workDayStart: "workDayStart", workDayEnd: "workDayEnd", workWeekStart: "workWeekStart", workWeekEnd: "workWeekEnd", slotDuration: "slotDuration", slotDivisions: "slotDivisions", currentTimeMarker: "currentTimeMarker", highlightOngoingEvents: "highlightOngoingEvents" }, queries: [{ propertyName: "timeSlotTemplate", first: true, predicate: TimeSlotTemplateDirective, descendants: true }, { propertyName: "dateHeaderTemplate", first: true, predicate: DateHeaderTemplateDirective, descendants: true }], usesInheritance: true, ngImport: i0 });
|
|
110
117
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: DayTimeViewBase, decorators: [{
|
|
111
118
|
type: Directive
|
|
112
119
|
}], ctorParameters: function () { return [{ type: i1.LocalizationService }, { type: i0.ChangeDetectorRef }, { type: i2.ViewContextService }, { type: i3.ViewStateService }]; }, propDecorators: { timeSlotTemplate: [{
|
|
@@ -139,4 +146,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
139
146
|
type: Input
|
|
140
147
|
}], currentTimeMarker: [{
|
|
141
148
|
type: Input
|
|
149
|
+
}], highlightOngoingEvents: [{
|
|
150
|
+
type: Input
|
|
142
151
|
}] } });
|
|
@@ -9,9 +9,10 @@ import { fromEvent } from 'rxjs';
|
|
|
9
9
|
import { toInvariantTime, dateInRange, setCoordinates, dateWithTime, toUTCTime, toUTCDateTime } from '../utils';
|
|
10
10
|
import { createTimeSlots } from './utils';
|
|
11
11
|
import { BaseView } from '../common/base-view';
|
|
12
|
-
import { MIDNIGHT_INVARIANT, MS_PER_MINUTE } from '../constants';
|
|
13
|
-
import { fromClick, fromDoubleClick, isNumber } from '../../common/util';
|
|
12
|
+
import { MIDNIGHT_INVARIANT, MS_PER_MINUTE, ONGOING_EVENT_CSS_CLASS } from '../constants';
|
|
13
|
+
import { fromClick, fromDoubleClick, isNumber, isPresent } from '../../common/util';
|
|
14
14
|
import { rtlScrollPosition, hasClasses } from '../../common/dom-queries';
|
|
15
|
+
import { DayTimeViewItemComponent } from './day-time-view-item.component';
|
|
15
16
|
import * as i0 from "@angular/core";
|
|
16
17
|
import * as i1 from "../view-context.service";
|
|
17
18
|
import * as i2 from "../view-state.service";
|
|
@@ -49,6 +50,8 @@ export class DayTimeViewComponent extends BaseView {
|
|
|
49
50
|
this.verticalTime = true;
|
|
50
51
|
this.initialUpdate = true;
|
|
51
52
|
this.updateCurrentTime = this.updateCurrentTime.bind(this);
|
|
53
|
+
this.toggleOngoingClass = this.toggleOngoingClass.bind(this);
|
|
54
|
+
this.updateOngoingEvents = this.updateOngoingEvents.bind(this);
|
|
52
55
|
}
|
|
53
56
|
get classNames() {
|
|
54
57
|
return `k-scheduler-${this.name}view`;
|
|
@@ -77,6 +80,7 @@ export class DayTimeViewComponent extends BaseView {
|
|
|
77
80
|
ngOnDestroy() {
|
|
78
81
|
super.ngOnDestroy();
|
|
79
82
|
clearTimeout(this.currentTimeTimeout);
|
|
83
|
+
clearTimeout(this.ongoingEventsTimeout);
|
|
80
84
|
}
|
|
81
85
|
verticalItem(leafIndex, resourceIndex) {
|
|
82
86
|
const data = this.verticalResources[resourceIndex].data || [];
|
|
@@ -97,6 +101,14 @@ export class DayTimeViewComponent extends BaseView {
|
|
|
97
101
|
});
|
|
98
102
|
}
|
|
99
103
|
}
|
|
104
|
+
toggleOngoingClass() {
|
|
105
|
+
const now = this.currentTime();
|
|
106
|
+
const cssClass = isPresent(this.highlightOngoingEvents.cssClass) ? this.highlightOngoingEvents.cssClass : ONGOING_EVENT_CSS_CLASS;
|
|
107
|
+
this.eventElements.forEach((event) => {
|
|
108
|
+
const isOngoing = dateInRange(now, event.item.start, event.item.end);
|
|
109
|
+
this.renderer[isOngoing ? 'addClass' : 'removeClass'](event.nativeElement, cssClass);
|
|
110
|
+
});
|
|
111
|
+
}
|
|
100
112
|
scrollToTime(time = this.scrollTime) {
|
|
101
113
|
let date;
|
|
102
114
|
if (typeof time === 'string') {
|
|
@@ -124,6 +136,7 @@ export class DayTimeViewComponent extends BaseView {
|
|
|
124
136
|
updateView() {
|
|
125
137
|
super.updateView();
|
|
126
138
|
this.updateCurrentTime();
|
|
139
|
+
this.updateOngoingEvents();
|
|
127
140
|
if (this.initialUpdate) {
|
|
128
141
|
this.scrollToTime();
|
|
129
142
|
this.initialUpdate = false;
|
|
@@ -162,6 +175,17 @@ export class DayTimeViewComponent extends BaseView {
|
|
|
162
175
|
this.positionCurrentTime();
|
|
163
176
|
}
|
|
164
177
|
}
|
|
178
|
+
updateOngoingEvents() {
|
|
179
|
+
const disabled = !this.highlightOngoingEvents || this.highlightOngoingEvents.enabled === false;
|
|
180
|
+
if (!isDocumentAvailable() || disabled) {
|
|
181
|
+
return;
|
|
182
|
+
}
|
|
183
|
+
clearTimeout(this.ongoingEventsTimeout);
|
|
184
|
+
this.zone.runOutsideAngular(() => {
|
|
185
|
+
this.ongoingEventsTimeout = setTimeout(this.updateOngoingEvents, this.highlightOngoingEvents.updateInterval || MS_PER_MINUTE);
|
|
186
|
+
});
|
|
187
|
+
this.toggleOngoingClass();
|
|
188
|
+
}
|
|
165
189
|
positionCurrentTime() {
|
|
166
190
|
if (this.currentTimeElements && this.currentTimeElements.length) {
|
|
167
191
|
const date = this.currentDate.toUTCDate();
|
|
@@ -308,7 +332,7 @@ export class DayTimeViewComponent extends BaseView {
|
|
|
308
332
|
}
|
|
309
333
|
}
|
|
310
334
|
DayTimeViewComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: DayTimeViewComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i1.ViewContextService }, { token: i2.ViewStateService }, { token: i3.IntlService }, { token: i4.DayTimeSlotService }, { token: i0.NgZone }, { token: i0.Renderer2 }, { token: i0.ElementRef }, { token: i5.PDFService }, { token: i6.LocalizationService }], target: i0.ɵɵFactoryTarget.Component });
|
|
311
|
-
DayTimeViewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: DayTimeViewComponent, selector: "kendo-day-time-view", inputs: { timeSlotTemplate: "timeSlotTemplate", dateHeaderTemplate: "dateHeaderTemplate", numberOfDays: "numberOfDays", scrollTime: "scrollTime", startTime: "startTime", endTime: "endTime", workDayStart: "workDayStart", workDayEnd: "workDayEnd", workWeekStart: "workWeekStart", workWeekEnd: "workWeekEnd", slotDuration: "slotDuration", slotDivisions: "slotDivisions", showWorkHours: "showWorkHours", getStartDate: "getStartDate", getEndDate: "getEndDate", getNextDate: "getNextDate", currentTimeMarker: "currentTimeMarker" }, viewQueries: [{ propertyName: "currentTimeElements", predicate: ["currentTimeMarker"], descendants: true }, { propertyName: "currentTimeArrows", predicate: ["currentTimeArrow"], descendants: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: '', isInline: true });
|
|
335
|
+
DayTimeViewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: DayTimeViewComponent, selector: "kendo-day-time-view", inputs: { timeSlotTemplate: "timeSlotTemplate", dateHeaderTemplate: "dateHeaderTemplate", numberOfDays: "numberOfDays", scrollTime: "scrollTime", startTime: "startTime", endTime: "endTime", workDayStart: "workDayStart", workDayEnd: "workDayEnd", workWeekStart: "workWeekStart", workWeekEnd: "workWeekEnd", slotDuration: "slotDuration", slotDivisions: "slotDivisions", showWorkHours: "showWorkHours", getStartDate: "getStartDate", getEndDate: "getEndDate", getNextDate: "getNextDate", currentTimeMarker: "currentTimeMarker", highlightOngoingEvents: "highlightOngoingEvents" }, viewQueries: [{ propertyName: "currentTimeElements", predicate: ["currentTimeMarker"], descendants: true }, { propertyName: "eventElements", predicate: DayTimeViewItemComponent, descendants: true }, { propertyName: "currentTimeArrows", predicate: ["currentTimeArrow"], descendants: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: '', isInline: true });
|
|
312
336
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: DayTimeViewComponent, decorators: [{
|
|
313
337
|
type: Component,
|
|
314
338
|
args: [{ selector: 'kendo-day-time-view', template: '' }]
|
|
@@ -346,9 +370,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
346
370
|
type: Input
|
|
347
371
|
}], currentTimeMarker: [{
|
|
348
372
|
type: Input
|
|
373
|
+
}], highlightOngoingEvents: [{
|
|
374
|
+
type: Input
|
|
349
375
|
}], currentTimeElements: [{
|
|
350
376
|
type: ViewChildren,
|
|
351
377
|
args: ['currentTimeMarker']
|
|
378
|
+
}], eventElements: [{
|
|
379
|
+
type: ViewChildren,
|
|
380
|
+
args: [DayTimeViewItemComponent]
|
|
352
381
|
}], currentTimeArrows: [{
|
|
353
382
|
type: ViewChildren,
|
|
354
383
|
args: ['currentTimeArrow']
|
|
@@ -2,14 +2,17 @@
|
|
|
2
2
|
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
import { Component, Input } from '@angular/core';
|
|
6
|
-
import { isChanged } from '@progress/kendo-angular-common';
|
|
5
|
+
import { Component, Input, ViewChildren } from '@angular/core';
|
|
6
|
+
import { isChanged, isDocumentAvailable } from '@progress/kendo-angular-common';
|
|
7
7
|
import { addDays, addMonths, firstDayInWeek, firstDayOfMonth, getDate, toLocalDate } from '@progress/kendo-date-math';
|
|
8
8
|
import { closestInScope, hasClasses } from '../../common/dom-queries';
|
|
9
9
|
import { MonthSlotService } from './month-slot.service';
|
|
10
10
|
import { updateTaskData, createTasks } from './utils';
|
|
11
|
-
import { toPx } from '../utils';
|
|
11
|
+
import { toPx, dateInRange } from '../utils';
|
|
12
12
|
import { BaseView } from '../common/base-view';
|
|
13
|
+
import { MonthViewItemComponent } from './month-view-item.component';
|
|
14
|
+
import { isPresent } from '../../common/util';
|
|
15
|
+
import { DAYS_IN_WEEK_COUNT, WEEKS_COUNT, MS_PER_MINUTE, ONGOING_EVENT_CSS_CLASS } from '../constants';
|
|
13
16
|
import * as i0 from "@angular/core";
|
|
14
17
|
import * as i1 from "../view-context.service";
|
|
15
18
|
import * as i2 from "../view-state.service";
|
|
@@ -25,8 +28,6 @@ import * as i11 from "./month-slot.directive";
|
|
|
25
28
|
import * as i12 from "../../navigation/focusable.directive";
|
|
26
29
|
import * as i13 from "../common/resource-iterator.pipe";
|
|
27
30
|
import * as i14 from "../common/repeat.pipe";
|
|
28
|
-
const DAYS_IN_WEEK_COUNT = 7;
|
|
29
|
-
const WEEKS_COUNT = 6;
|
|
30
31
|
/**
|
|
31
32
|
* @hidden
|
|
32
33
|
*/
|
|
@@ -35,6 +36,7 @@ export class MonthViewRendererComponent extends BaseView {
|
|
|
35
36
|
super(viewContext, viewState, intl, slotService, zone, renderer, element, pdfService, localization, changeDetector);
|
|
36
37
|
this.resizeHintFormat = { skeleton: 'Md' };
|
|
37
38
|
this.weeks = [];
|
|
39
|
+
this.updateOngoingEvents = this.updateOngoingEvents.bind(this);
|
|
38
40
|
}
|
|
39
41
|
get monthDaySlotTemplateRef() {
|
|
40
42
|
return this.monthDaySlotTemplate || (this.schedulerMonthDaySlotTemplate || {}).templateRef;
|
|
@@ -45,6 +47,14 @@ export class MonthViewRendererComponent extends BaseView {
|
|
|
45
47
|
}
|
|
46
48
|
super.ngOnChanges(changes);
|
|
47
49
|
}
|
|
50
|
+
ngAfterViewInit() {
|
|
51
|
+
this.updateOngoingEvents();
|
|
52
|
+
super.ngAfterViewInit();
|
|
53
|
+
}
|
|
54
|
+
ngOnDestroy() {
|
|
55
|
+
clearTimeout(this.ongoingEventsTimeout);
|
|
56
|
+
super.ngOnDestroy();
|
|
57
|
+
}
|
|
48
58
|
horizontalColspan(resourceIndex) {
|
|
49
59
|
const resources = this.horizontalResources;
|
|
50
60
|
let result = DAYS_IN_WEEK_COUNT;
|
|
@@ -172,6 +182,28 @@ export class MonthViewRendererComponent extends BaseView {
|
|
|
172
182
|
slotByPosition(x, y) {
|
|
173
183
|
return this.slotService.slotByPosition(x, y);
|
|
174
184
|
}
|
|
185
|
+
updateOngoingEvents() {
|
|
186
|
+
const disabled = !this.highlightOngoingEvents || this.highlightOngoingEvents.enabled === false;
|
|
187
|
+
if (!isDocumentAvailable() || disabled) {
|
|
188
|
+
return;
|
|
189
|
+
}
|
|
190
|
+
clearTimeout(this.ongoingEventsTimeout);
|
|
191
|
+
this.zone.runOutsideAngular(() => {
|
|
192
|
+
this.ongoingEventsTimeout = setTimeout(this.updateOngoingEvents, this.highlightOngoingEvents.updateInterval || MS_PER_MINUTE);
|
|
193
|
+
});
|
|
194
|
+
this.toggleOngoingClass();
|
|
195
|
+
}
|
|
196
|
+
currentTime() {
|
|
197
|
+
return new Date();
|
|
198
|
+
}
|
|
199
|
+
toggleOngoingClass() {
|
|
200
|
+
const now = this.currentTime();
|
|
201
|
+
const cssClass = isPresent(this.highlightOngoingEvents.cssClass) ? this.highlightOngoingEvents.cssClass : ONGOING_EVENT_CSS_CLASS;
|
|
202
|
+
this.eventElements.forEach((event) => {
|
|
203
|
+
const isOngoing = dateInRange(now, event.item.start, event.item.end);
|
|
204
|
+
this.renderer[isOngoing ? 'addClass' : 'removeClass'](event.nativeElement, cssClass);
|
|
205
|
+
});
|
|
206
|
+
}
|
|
175
207
|
createDaySlots({ start }) {
|
|
176
208
|
const weeks = [];
|
|
177
209
|
let date = start;
|
|
@@ -187,9 +219,9 @@ export class MonthViewRendererComponent extends BaseView {
|
|
|
187
219
|
}
|
|
188
220
|
}
|
|
189
221
|
MonthViewRendererComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: MonthViewRendererComponent, deps: [{ token: i1.ViewContextService }, { token: i2.ViewStateService }, { token: i3.IntlService }, { token: i4.MonthSlotService }, { token: i0.NgZone }, { token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i5.PDFService }, { token: i6.LocalizationService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
190
|
-
MonthViewRendererComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: MonthViewRendererComponent, selector: "month-view", inputs: { monthDaySlotTemplate: "monthDaySlotTemplate" }, providers: [
|
|
222
|
+
MonthViewRendererComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: MonthViewRendererComponent, selector: "month-view", inputs: { monthDaySlotTemplate: "monthDaySlotTemplate", highlightOngoingEvents: "highlightOngoingEvents" }, providers: [
|
|
191
223
|
MonthSlotService
|
|
192
|
-
], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: `
|
|
224
|
+
], viewQueries: [{ propertyName: "eventElements", predicate: MonthViewItemComponent, descendants: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: `
|
|
193
225
|
<div class="k-scheduler-layout k-scheduler-monthview k-scheduler-flex-layout">
|
|
194
226
|
<div class="k-scheduler-pane">
|
|
195
227
|
<div class="k-scheduler-times" #timesHeader *ngIf="verticalResources.length">
|
|
@@ -436,4 +468,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
436
468
|
}]
|
|
437
469
|
}], ctorParameters: function () { return [{ type: i1.ViewContextService }, { type: i2.ViewStateService }, { type: i3.IntlService }, { type: i4.MonthSlotService }, { type: i0.NgZone }, { type: i0.ElementRef }, { type: i0.Renderer2 }, { type: i5.PDFService }, { type: i6.LocalizationService }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { monthDaySlotTemplate: [{
|
|
438
470
|
type: Input
|
|
471
|
+
}], highlightOngoingEvents: [{
|
|
472
|
+
type: Input
|
|
473
|
+
}], eventElements: [{
|
|
474
|
+
type: ViewChildren,
|
|
475
|
+
args: [MonthViewItemComponent]
|
|
439
476
|
}] } });
|
|
@@ -64,10 +64,11 @@ MonthViewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", ver
|
|
|
64
64
|
[monthDaySlotTemplate]="monthDaySlotTemplate?.templateRef"
|
|
65
65
|
[selectedDateFormat]="selectedDateFormat"
|
|
66
66
|
[selectedShortDateFormat]="selectedShortDateFormat"
|
|
67
|
+
[highlightOngoingEvents]="viewHighlightOngoingEvents"
|
|
67
68
|
[weekStart]="viewWeekStart">
|
|
68
69
|
</month-view>
|
|
69
70
|
</ng-template>
|
|
70
|
-
`, isInline: true, components: [{ type: i4.MonthViewRendererComponent, selector: "month-view", inputs: ["monthDaySlotTemplate"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
71
|
+
`, isInline: true, components: [{ type: i4.MonthViewRendererComponent, selector: "month-view", inputs: ["monthDaySlotTemplate", "highlightOngoingEvents"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
71
72
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: MonthViewComponent, decorators: [{
|
|
72
73
|
type: Component,
|
|
73
74
|
args: [{
|
|
@@ -89,6 +90,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
89
90
|
[monthDaySlotTemplate]="monthDaySlotTemplate?.templateRef"
|
|
90
91
|
[selectedDateFormat]="selectedDateFormat"
|
|
91
92
|
[selectedShortDateFormat]="selectedShortDateFormat"
|
|
93
|
+
[highlightOngoingEvents]="viewHighlightOngoingEvents"
|
|
92
94
|
[weekStart]="viewWeekStart">
|
|
93
95
|
</month-view>
|
|
94
96
|
</ng-template>
|
|
@@ -69,6 +69,7 @@ DayViewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", versi
|
|
|
69
69
|
[name]="name"
|
|
70
70
|
[eventHeight]="viewEventHeight"
|
|
71
71
|
[currentTimeMarker]="viewCurrentTimeMarker"
|
|
72
|
+
[highlightOngoingEvents]="viewHighlightOngoingEvents"
|
|
72
73
|
[showWorkHours]="shouldShowWorkHours"
|
|
73
74
|
[scrollTime]="viewScrollTime"
|
|
74
75
|
[startTime]="viewStartTime"
|
|
@@ -112,6 +113,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
112
113
|
[name]="name"
|
|
113
114
|
[eventHeight]="viewEventHeight"
|
|
114
115
|
[currentTimeMarker]="viewCurrentTimeMarker"
|
|
116
|
+
[highlightOngoingEvents]="viewHighlightOngoingEvents"
|
|
115
117
|
[showWorkHours]="shouldShowWorkHours"
|
|
116
118
|
[scrollTime]="viewScrollTime"
|
|
117
119
|
[startTime]="viewStartTime"
|
|
@@ -77,6 +77,7 @@ MultiDayViewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0",
|
|
|
77
77
|
[numberOfDays]="numberOfDays"
|
|
78
78
|
[eventHeight]="viewEventHeight"
|
|
79
79
|
[currentTimeMarker]="viewCurrentTimeMarker"
|
|
80
|
+
[highlightOngoingEvents]="viewHighlightOngoingEvents"
|
|
80
81
|
[showWorkHours]="shouldShowWorkHours"
|
|
81
82
|
[scrollTime]="viewScrollTime"
|
|
82
83
|
[startTime]="viewStartTime"
|
|
@@ -122,6 +123,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
122
123
|
[numberOfDays]="numberOfDays"
|
|
123
124
|
[eventHeight]="viewEventHeight"
|
|
124
125
|
[currentTimeMarker]="viewCurrentTimeMarker"
|
|
126
|
+
[highlightOngoingEvents]="viewHighlightOngoingEvents"
|
|
125
127
|
[showWorkHours]="shouldShowWorkHours"
|
|
126
128
|
[scrollTime]="viewScrollTime"
|
|
127
129
|
[startTime]="viewStartTime"
|
|
@@ -69,6 +69,7 @@ WeekViewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", vers
|
|
|
69
69
|
[getStartDate]="getStartDate"
|
|
70
70
|
[eventHeight]="viewEventHeight"
|
|
71
71
|
[currentTimeMarker]="viewCurrentTimeMarker"
|
|
72
|
+
[highlightOngoingEvents]="viewHighlightOngoingEvents"
|
|
72
73
|
[showWorkHours]="shouldShowWorkHours"
|
|
73
74
|
[scrollTime]="viewScrollTime"
|
|
74
75
|
[startTime]="viewStartTime"
|
|
@@ -115,6 +116,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
115
116
|
[getStartDate]="getStartDate"
|
|
116
117
|
[eventHeight]="viewEventHeight"
|
|
117
118
|
[currentTimeMarker]="viewCurrentTimeMarker"
|
|
119
|
+
[highlightOngoingEvents]="viewHighlightOngoingEvents"
|
|
118
120
|
[showWorkHours]="shouldShowWorkHours"
|
|
119
121
|
[scrollTime]="viewScrollTime"
|
|
120
122
|
[startTime]="viewStartTime"
|
|
@@ -69,6 +69,7 @@ WorkWeekViewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0",
|
|
|
69
69
|
[getNextDate]="getNextDate"
|
|
70
70
|
[eventHeight]="viewEventHeight"
|
|
71
71
|
[currentTimeMarker]="viewCurrentTimeMarker"
|
|
72
|
+
[highlightOngoingEvents]="viewHighlightOngoingEvents"
|
|
72
73
|
[showWorkHours]="shouldShowWorkHours"
|
|
73
74
|
[scrollTime]="viewScrollTime"
|
|
74
75
|
[startTime]="viewStartTime"
|
|
@@ -116,6 +117,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
116
117
|
[getNextDate]="getNextDate"
|
|
117
118
|
[eventHeight]="viewEventHeight"
|
|
118
119
|
[currentTimeMarker]="viewCurrentTimeMarker"
|
|
120
|
+
[highlightOngoingEvents]="viewHighlightOngoingEvents"
|
|
119
121
|
[showWorkHours]="shouldShowWorkHours"
|
|
120
122
|
[scrollTime]="viewScrollTime"
|
|
121
123
|
[startTime]="viewStartTime"
|
|
@@ -78,6 +78,7 @@ TimelineMonthViewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0
|
|
|
78
78
|
[eventHeight]="viewEventHeight"
|
|
79
79
|
[columnWidth]="viewColumnWidth"
|
|
80
80
|
[currentTimeMarker]="viewCurrentTimeMarker"
|
|
81
|
+
[highlightOngoingEvents]="viewHighlightOngoingEvents"
|
|
81
82
|
[showWorkHours]="shouldShowWorkHours"
|
|
82
83
|
[scrollTime]="viewScrollTime"
|
|
83
84
|
[startTime]="viewStartTime"
|
|
@@ -121,6 +122,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
121
122
|
[eventHeight]="viewEventHeight"
|
|
122
123
|
[columnWidth]="viewColumnWidth"
|
|
123
124
|
[currentTimeMarker]="viewCurrentTimeMarker"
|
|
125
|
+
[highlightOngoingEvents]="viewHighlightOngoingEvents"
|
|
124
126
|
[showWorkHours]="shouldShowWorkHours"
|
|
125
127
|
[scrollTime]="viewScrollTime"
|
|
126
128
|
[startTime]="viewStartTime"
|