@progress/kendo-angular-scheduler 21.4.1-develop.1 → 22.0.0-develop.1
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/editing/recurrence/localization/messages.d.ts +1 -1
- package/editing/resource-editor-base.d.ts +1 -1
- package/editing-directives/editing-directive-base.d.ts +1 -1
- package/fesm2022/progress-kendo-angular-scheduler.mjs +313 -313
- package/localization/messages.d.ts +1 -1
- package/package.json +20 -28
- package/schematics/ngAdd/index.js +3 -3
- package/views/common/base-view.d.ts +1 -1
- package/views/common/configuration-view-base.d.ts +1 -1
- package/views/day-time/day-time-view-base.d.ts +1 -1
- package/views/day-time/day-time-view.component.d.ts +1 -1
- package/views/multi-day/multi-day-view-base.d.ts +1 -1
- package/views/timeline/timeline-base.d.ts +1 -1
- package/views/view-items/base-slot.directive.d.ts +1 -1
- package/views/view-items/base-view-item.d.ts +1 -1
- package/esm2022/common/constants.mjs +0 -8
- package/esm2022/common/default-model-fields.mjs +0 -20
- package/esm2022/common/dom-queries.mjs +0 -107
- package/esm2022/common/modifiers.mjs +0 -31
- package/esm2022/common/util.mjs +0 -227
- package/esm2022/data-binding.directive.mjs +0 -162
- package/esm2022/directives.mjs +0 -136
- package/esm2022/editing/date-time-picker.component.mjs +0 -190
- package/esm2022/editing/dialogs.service.mjs +0 -96
- package/esm2022/editing/edit-dialog-template.directive.mjs +0 -53
- package/esm2022/editing/edit-dialog.component.mjs +0 -679
- package/esm2022/editing/edit.service.mjs +0 -107
- package/esm2022/editing/local-data-changes.service.mjs +0 -18
- package/esm2022/editing/recurrence/end-rule-radio-button.directive.mjs +0 -77
- package/esm2022/editing/recurrence/localization/custom-messages.component.mjs +0 -44
- package/esm2022/editing/recurrence/localization/localized-messages.directive.mjs +0 -39
- package/esm2022/editing/recurrence/localization/messages.mjs +0 -239
- package/esm2022/editing/recurrence/localization/recurrence-localization.service.mjs +0 -47
- package/esm2022/editing/recurrence/recurrence-editor.component.mjs +0 -497
- package/esm2022/editing/recurrence/recurrence-end-rule-editor.component.mjs +0 -334
- package/esm2022/editing/recurrence/recurrence-frequency-editor.component.mjs +0 -105
- package/esm2022/editing/recurrence/recurrence-interval-editor.component.mjs +0 -169
- package/esm2022/editing/recurrence/recurrence-monthly-yearly-editor.component.mjs +0 -468
- package/esm2022/editing/recurrence/recurrence-weekday-rule-editor.component.mjs +0 -138
- package/esm2022/editing/recurrence/recurrence.service.mjs +0 -254
- package/esm2022/editing/recurrence/repeat-on-radio-button.directive.mjs +0 -81
- package/esm2022/editing/resource-editor-base.mjs +0 -59
- package/esm2022/editing/resource-multiple-editor.component.mjs +0 -101
- package/esm2022/editing/resource-single-editor.component.mjs +0 -82
- package/esm2022/editing/timezone-editor.component.mjs +0 -193
- package/esm2022/editing-directives/base-edit.service.mjs +0 -320
- package/esm2022/editing-directives/edit-service.interface.mjs +0 -5
- package/esm2022/editing-directives/editing-directive-base.mjs +0 -242
- package/esm2022/editing-directives/local-edit.service.mjs +0 -122
- package/esm2022/editing-directives/reactive-editing.directive.mjs +0 -132
- package/esm2022/editing-directives/utils.mjs +0 -107
- package/esm2022/events/add-event.mjs +0 -26
- package/esm2022/events/cancel-event.mjs +0 -14
- package/esm2022/events/create-event.mjs +0 -40
- package/esm2022/events/date-change-event.mjs +0 -29
- package/esm2022/events/drag-end-event.mjs +0 -46
- package/esm2022/events/drag-event.mjs +0 -54
- package/esm2022/events/drag-start-event.mjs +0 -30
- package/esm2022/events/edit-event-base.mjs +0 -32
- package/esm2022/events/edit-event.mjs +0 -30
- package/esm2022/events/event-click-event.mjs +0 -32
- package/esm2022/events/event-keydown-event.mjs +0 -28
- package/esm2022/events/more-events-click.mjs +0 -24
- package/esm2022/events/navigate-event.mjs +0 -26
- package/esm2022/events/preventable-event.mjs +0 -28
- package/esm2022/events/remove-event.mjs +0 -30
- package/esm2022/events/resize-end-event.mjs +0 -38
- package/esm2022/events/resize-event.mjs +0 -46
- package/esm2022/events/resize-start-event.mjs +0 -30
- package/esm2022/events/save-event.mjs +0 -18
- package/esm2022/events/slot-click-event.mjs +0 -44
- package/esm2022/events/slot-drag-end-event.mjs +0 -10
- package/esm2022/events/slot-drag-event.mjs +0 -40
- package/esm2022/events/slot-drag-start-event.mjs +0 -44
- package/esm2022/events/view-event-map.mjs +0 -35
- package/esm2022/events.mjs +0 -27
- package/esm2022/index.mjs +0 -83
- package/esm2022/loading.component.mjs +0 -52
- package/esm2022/localization/custom-messages.component.mjs +0 -56
- package/esm2022/localization/localized-messages.directive.mjs +0 -39
- package/esm2022/localization/messages.mjs +0 -614
- package/esm2022/localization/scheduler-localization.service.mjs +0 -31
- package/esm2022/navigation/focus-position.interface.mjs +0 -5
- package/esm2022/navigation/focus.service.mjs +0 -202
- package/esm2022/navigation/focusable-element.interface.mjs +0 -5
- package/esm2022/navigation/focusable.directive.mjs +0 -98
- package/esm2022/navigation/shortcuts.directive.mjs +0 -239
- package/esm2022/navigation.mjs +0 -6
- package/esm2022/package-metadata.mjs +0 -16
- package/esm2022/pdf/pdf-command.directive.mjs +0 -96
- package/esm2022/pdf/pdf-export-event.mjs +0 -10
- package/esm2022/pdf/pdf.component.mjs +0 -241
- package/esm2022/pdf/pdf.module.mjs +0 -42
- package/esm2022/pdf/pdf.service.mjs +0 -36
- package/esm2022/progress-kendo-angular-scheduler.mjs +0 -8
- package/esm2022/scheduler.component.mjs +0 -1981
- package/esm2022/scheduler.module.mjs +0 -138
- package/esm2022/toolbar/navigation.component.mjs +0 -391
- package/esm2022/toolbar/toolbar-context.mjs +0 -5
- package/esm2022/toolbar/toolbar-template.directive.mjs +0 -50
- package/esm2022/toolbar/toolbar.component.mjs +0 -168
- package/esm2022/toolbar/toolbar.service.mjs +0 -46
- package/esm2022/toolbar/view-selector.component.mjs +0 -181
- package/esm2022/types/actions.mjs +0 -5
- package/esm2022/types/create-form-group-args.interface.mjs +0 -5
- package/esm2022/types/crud-operation.enum.mjs +0 -18
- package/esm2022/types/current-time-settings.interface.mjs +0 -5
- package/esm2022/types/date-range.interface.mjs +0 -5
- package/esm2022/types/datepicker-options.interface.mjs +0 -5
- package/esm2022/types/edit-event-args.interface.mjs +0 -5
- package/esm2022/types/edit-mode.enum.mjs +0 -23
- package/esm2022/types/editable-settings.interface.mjs +0 -5
- package/esm2022/types/event-style-args.interface.mjs +0 -5
- package/esm2022/types/focusable-container.mjs +0 -5
- package/esm2022/types/group.interface.mjs +0 -5
- package/esm2022/types/numeric-options.interface.mjs +0 -5
- package/esm2022/types/ongoing-events-settings.interface.mjs +0 -5
- package/esm2022/types/resource.interface.mjs +0 -5
- package/esm2022/types/scheduler-event.mjs +0 -5
- package/esm2022/types/scheduler-model-fields.interface.mjs +0 -5
- package/esm2022/types/scheduler-slot.interface.mjs +0 -5
- package/esm2022/types/scheduler-view.mjs +0 -9
- package/esm2022/types/slot-class-args.interface.mjs +0 -5
- package/esm2022/types/slot-selection.mjs +0 -35
- package/esm2022/types/view-item.interface.mjs +0 -5
- package/esm2022/types.mjs +0 -12
- package/esm2022/views/agenda/agenda-header-item.component.mjs +0 -85
- package/esm2022/views/agenda/agenda-header.component.mjs +0 -75
- package/esm2022/views/agenda/agenda-task-item.component.mjs +0 -137
- package/esm2022/views/agenda/agenda-view-internal.component.mjs +0 -424
- package/esm2022/views/agenda/agenda-view-list.component.mjs +0 -256
- package/esm2022/views/agenda/agenda-view.component.mjs +0 -130
- package/esm2022/views/agenda/tasks.collection.mjs +0 -96
- package/esm2022/views/agenda/utils.mjs +0 -176
- package/esm2022/views/common/base-view.mjs +0 -1099
- package/esm2022/views/common/configuration-view-base.mjs +0 -164
- package/esm2022/views/common/dom-events.service.mjs +0 -22
- package/esm2022/views/common/hint-container.component.mjs +0 -41
- package/esm2022/views/common/repeat.pipe.mjs +0 -36
- package/esm2022/views/common/resize-hint.component.mjs +0 -97
- package/esm2022/views/common/resource-iterator.pipe.mjs +0 -49
- package/esm2022/views/common/scheduler-task.mjs +0 -5
- package/esm2022/views/common/slot-selectable.directive.mjs +0 -137
- package/esm2022/views/common/view-footer.component.mjs +0 -103
- package/esm2022/views/common/work-hours-footer.directive.mjs +0 -45
- package/esm2022/views/constants.mjs +0 -31
- package/esm2022/views/day-time/day-time-slot.service.mjs +0 -633
- package/esm2022/views/day-time/day-time-view-base.mjs +0 -244
- package/esm2022/views/day-time/day-time-view-item.component.mjs +0 -216
- package/esm2022/views/day-time/day-time-view.component.mjs +0 -437
- package/esm2022/views/day-time/event-slot.directive.mjs +0 -138
- package/esm2022/views/day-time/utils.mjs +0 -32
- package/esm2022/views/month/month-slot.component.mjs +0 -166
- package/esm2022/views/month/month-slot.service.mjs +0 -404
- package/esm2022/views/month/month-view-item.component.mjs +0 -161
- package/esm2022/views/month/month-view-renderer.component.mjs +0 -683
- package/esm2022/views/month/month-view.component.mjs +0 -203
- package/esm2022/views/month/multi-week-view.component.mjs +0 -202
- package/esm2022/views/month/utils.mjs +0 -107
- package/esm2022/views/multi-day/day-view.component.mjs +0 -186
- package/esm2022/views/multi-day/multi-day-view-base.mjs +0 -55
- package/esm2022/views/multi-day/multi-day-view-renderer.component.mjs +0 -1002
- package/esm2022/views/multi-day/multi-day-view.component.mjs +0 -197
- package/esm2022/views/multi-day/utils.mjs +0 -63
- package/esm2022/views/multi-day/week-view.component.mjs +0 -189
- package/esm2022/views/multi-day/work-week-view.component.mjs +0 -172
- package/esm2022/views/scheduler-view.directive.mjs +0 -65
- package/esm2022/views/templates/agenda-date-template.directive.mjs +0 -41
- package/esm2022/views/templates/agenda-time-template.directive.mjs +0 -46
- package/esm2022/views/templates/all-day-event-template.directive.mjs +0 -42
- package/esm2022/views/templates/all-day-slot-template.directive.mjs +0 -42
- package/esm2022/views/templates/date-header-template.directive.mjs +0 -42
- package/esm2022/views/templates/event-template.directive.mjs +0 -42
- package/esm2022/views/templates/group-header-template.directive.mjs +0 -42
- package/esm2022/views/templates/major-time-header-template.directive.mjs +0 -41
- package/esm2022/views/templates/minor-time-header-template.directive.mjs +0 -41
- package/esm2022/views/templates/month-day-slot-template.directive.mjs +0 -42
- package/esm2022/views/templates/multi-week-day-slot-template.directive.mjs +0 -42
- package/esm2022/views/templates/time-slot-template.directive.mjs +0 -43
- package/esm2022/views/templates.mjs +0 -16
- package/esm2022/views/timeline/timeline-base.mjs +0 -39
- package/esm2022/views/timeline/timeline-month-view.component.mjs +0 -211
- package/esm2022/views/timeline/timeline-multi-day-view.component.mjs +0 -649
- package/esm2022/views/timeline/timeline-view.component.mjs +0 -189
- package/esm2022/views/timeline/timeline-week-view.component.mjs +0 -181
- package/esm2022/views/timeline/utils.mjs +0 -60
- package/esm2022/views/utils.mjs +0 -373
- package/esm2022/views/view-context.service.mjs +0 -111
- package/esm2022/views/view-items/base-slot.directive.mjs +0 -104
- package/esm2022/views/view-items/base-slot.service.mjs +0 -82
- package/esm2022/views/view-items/base-view-item.mjs +0 -194
- package/esm2022/views/view-items/item-map.mjs +0 -38
- package/esm2022/views/view-items/types.mjs +0 -5
- package/esm2022/views/view-state.service.mjs +0 -144
- package/esm2022/views/year/utils.mjs +0 -60
- package/esm2022/views/year/year-view-internal.component.mjs +0 -471
- package/esm2022/views/year/year-view.component.mjs +0 -136
|
@@ -1,437 +0,0 @@
|
|
|
1
|
-
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
3
|
-
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
-
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
import { Input, TemplateRef, ViewChildren, QueryList, ElementRef, ChangeDetectorRef, NgZone, Renderer2, Component } from '@angular/core';
|
|
6
|
-
import { isChanged, isDocumentAvailable, ScrollbarWidthService } from '@progress/kendo-angular-common';
|
|
7
|
-
import { addDays, getDate, ZonedDate } from '@progress/kendo-date-math';
|
|
8
|
-
import { fromEvent } from 'rxjs';
|
|
9
|
-
import { toInvariantTime, dateInRange, setCoordinates, dateWithTime, toUTCTime, toUTCDateTime, allDaysHidden } from '../utils';
|
|
10
|
-
import { createTimeSlots } from './utils';
|
|
11
|
-
import { DayTimeSlotService } from './day-time-slot.service';
|
|
12
|
-
import { ViewContextService } from '../view-context.service';
|
|
13
|
-
import { ViewStateService } from '../view-state.service';
|
|
14
|
-
import { IntlService } from '@progress/kendo-angular-intl';
|
|
15
|
-
import { PDFService } from '../../pdf/pdf.service';
|
|
16
|
-
import { BaseView } from '../common/base-view';
|
|
17
|
-
import { MIDNIGHT_INVARIANT, MS_PER_MINUTE, ONGOING_EVENT_CSS_CLASS } from '../constants';
|
|
18
|
-
import { fromClick, fromDoubleClick, isNumber, isPresent } from '../../common/util';
|
|
19
|
-
import { rtlScrollPosition, hasClasses } from '../../common/dom-queries';
|
|
20
|
-
import { LocalizationService } from '@progress/kendo-angular-l10n';
|
|
21
|
-
import { DayTimeViewItemComponent } from './day-time-view-item.component';
|
|
22
|
-
import * as i0 from "@angular/core";
|
|
23
|
-
import * as i1 from "../view-context.service";
|
|
24
|
-
import * as i2 from "../view-state.service";
|
|
25
|
-
import * as i3 from "@progress/kendo-angular-intl";
|
|
26
|
-
import * as i4 from "./day-time-slot.service";
|
|
27
|
-
import * as i5 from "../../pdf/pdf.service";
|
|
28
|
-
import * as i6 from "@progress/kendo-angular-l10n";
|
|
29
|
-
import * as i7 from "@progress/kendo-angular-common";
|
|
30
|
-
const getStartDate = date => getDate(date);
|
|
31
|
-
const getEndDate = (start, numberOfDays) => getDate(addDays(start, numberOfDays || 1));
|
|
32
|
-
const getNextDate = (date, count, numberOfDays) => getDate(addDays(date, numberOfDays * count));
|
|
33
|
-
/**
|
|
34
|
-
* @hidden
|
|
35
|
-
*/
|
|
36
|
-
export class DayTimeViewComponent extends BaseView {
|
|
37
|
-
changeDetector;
|
|
38
|
-
timeSlotTemplate;
|
|
39
|
-
dateHeaderTemplate;
|
|
40
|
-
majorTimeHeaderTemplate;
|
|
41
|
-
minorTimeHeaderTemplate;
|
|
42
|
-
numberOfDays = 1;
|
|
43
|
-
scrollTime;
|
|
44
|
-
startTime = '00:00';
|
|
45
|
-
endTime = '00:00';
|
|
46
|
-
workDayStart = '08:00';
|
|
47
|
-
workDayEnd = '17:00';
|
|
48
|
-
workWeekStart = 1;
|
|
49
|
-
workWeekEnd = 5;
|
|
50
|
-
slotDuration = 60;
|
|
51
|
-
slotDivisions = 2;
|
|
52
|
-
showWorkHours = false;
|
|
53
|
-
getStartDate = getStartDate;
|
|
54
|
-
getEndDate = getEndDate;
|
|
55
|
-
getNextDate = getNextDate;
|
|
56
|
-
currentTimeMarker;
|
|
57
|
-
highlightOngoingEvents;
|
|
58
|
-
currentTimeElements;
|
|
59
|
-
eventElements;
|
|
60
|
-
currentTimeArrows;
|
|
61
|
-
name;
|
|
62
|
-
workDayStartTime;
|
|
63
|
-
workDayEndTime;
|
|
64
|
-
daySlots = [];
|
|
65
|
-
timeSlots = [];
|
|
66
|
-
resizeHintFormat = 't';
|
|
67
|
-
showCurrentTime = false;
|
|
68
|
-
get classNames() {
|
|
69
|
-
return `k-scheduler-${this.name}view`;
|
|
70
|
-
}
|
|
71
|
-
get timeSlotTemplateRef() {
|
|
72
|
-
return this.timeSlotTemplate || (this.schedulerTimeSlotTemplate || {}).templateRef;
|
|
73
|
-
}
|
|
74
|
-
get dateHeaderTemplateRef() {
|
|
75
|
-
return this.dateHeaderTemplate || (this.schedulerDateHeaderTemplate || {}).templateRef;
|
|
76
|
-
}
|
|
77
|
-
get majorTimeHeaderTemplateRef() {
|
|
78
|
-
return this.majorTimeHeaderTemplate || (this.schedulerMajorTimeHeaderTemplate || {}).templateRef;
|
|
79
|
-
}
|
|
80
|
-
get minorTimeHeaderTemplateRef() {
|
|
81
|
-
return this.minorTimeHeaderTemplate || (this.schedulerMinorTimeHeaderTemplate || {}).templateRef;
|
|
82
|
-
}
|
|
83
|
-
schedulerTimeSlotTemplate;
|
|
84
|
-
schedulerDateHeaderTemplate;
|
|
85
|
-
schedulerMajorTimeHeaderTemplate;
|
|
86
|
-
schedulerMinorTimeHeaderTemplate;
|
|
87
|
-
currentTimeTimeout;
|
|
88
|
-
ongoingEventsTimeout;
|
|
89
|
-
currentDate;
|
|
90
|
-
verticalTime = true;
|
|
91
|
-
initialUpdate = true;
|
|
92
|
-
dates = [];
|
|
93
|
-
constructor(changeDetector, viewContext, viewState, intl, slotService, zone, renderer, element, pdfService, localization, scrollBarWidthService) {
|
|
94
|
-
super(viewContext, viewState, intl, slotService, zone, renderer, element, pdfService, localization, changeDetector, scrollBarWidthService);
|
|
95
|
-
this.changeDetector = changeDetector;
|
|
96
|
-
this.updateCurrentTime = this.updateCurrentTime.bind(this);
|
|
97
|
-
this.toggleOngoingClass = this.toggleOngoingClass.bind(this);
|
|
98
|
-
this.updateOngoingEvents = this.updateOngoingEvents.bind(this);
|
|
99
|
-
}
|
|
100
|
-
ngOnChanges(changes) {
|
|
101
|
-
if (changes.startTime || changes.endTime || changes.showWorkHours || changes.workDayStart || changes.workDayEnd ||
|
|
102
|
-
changes.workWeekStart || changes.workWeekEnd || changes.slotDivisions || changes.slotDuration) {
|
|
103
|
-
this.timeSlots = this.createTimeSlots();
|
|
104
|
-
this.initWorkDay();
|
|
105
|
-
this.changes.next(null);
|
|
106
|
-
}
|
|
107
|
-
if (isChanged('currentTimeMarker', changes)) {
|
|
108
|
-
this.showCurrentTime = this.enableCurrentTime();
|
|
109
|
-
}
|
|
110
|
-
if (isChanged('weekStart', changes)) {
|
|
111
|
-
this.onSelectDate(this.selectedDate);
|
|
112
|
-
}
|
|
113
|
-
super.ngOnChanges(changes);
|
|
114
|
-
}
|
|
115
|
-
ngOnDestroy() {
|
|
116
|
-
super.ngOnDestroy();
|
|
117
|
-
clearTimeout(this.currentTimeTimeout);
|
|
118
|
-
clearTimeout(this.ongoingEventsTimeout);
|
|
119
|
-
}
|
|
120
|
-
verticalItem(leafIndex, resourceIndex) {
|
|
121
|
-
const data = this.verticalResources[resourceIndex].data || [];
|
|
122
|
-
const resources = this.verticalResources;
|
|
123
|
-
let result = 1;
|
|
124
|
-
for (let idx = resourceIndex + 1; idx < resources.length; idx++) {
|
|
125
|
-
result *= ((resources[idx].data || []).length || 1);
|
|
126
|
-
}
|
|
127
|
-
return data[(leafIndex / result) % data.length];
|
|
128
|
-
}
|
|
129
|
-
timeSlotClass(slot, date, resourceIndex) {
|
|
130
|
-
if (this.slotClass) {
|
|
131
|
-
return this.slotClass({
|
|
132
|
-
start: dateWithTime(date, slot.start),
|
|
133
|
-
end: dateWithTime(date, slot.end),
|
|
134
|
-
resources: this.resourcesByIndex(resourceIndex),
|
|
135
|
-
isAllDay: false
|
|
136
|
-
});
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
toggleOngoingClass() {
|
|
140
|
-
const now = this.currentTime();
|
|
141
|
-
const cssClass = isPresent(this.highlightOngoingEvents.cssClass) ? this.highlightOngoingEvents.cssClass : ONGOING_EVENT_CSS_CLASS;
|
|
142
|
-
this.eventElements.forEach((event) => {
|
|
143
|
-
const isOngoing = dateInRange(now, event.item.start, event.item.end);
|
|
144
|
-
this.renderer[isOngoing ? 'addClass' : 'removeClass'](event.nativeElement, cssClass);
|
|
145
|
-
});
|
|
146
|
-
}
|
|
147
|
-
scrollToTime(time = this.scrollTime) {
|
|
148
|
-
let date;
|
|
149
|
-
if (typeof time === 'string') {
|
|
150
|
-
const scrollDate = this.intl.parseDate(time);
|
|
151
|
-
if (!(scrollDate && this.daySlots[0]?.start)) {
|
|
152
|
-
return;
|
|
153
|
-
}
|
|
154
|
-
date = toUTCTime(this.daySlots[0].start, scrollDate);
|
|
155
|
-
}
|
|
156
|
-
else {
|
|
157
|
-
date = toUTCDateTime(time);
|
|
158
|
-
}
|
|
159
|
-
const position = this.slotService.timePosition(date, 0, this.verticalTime);
|
|
160
|
-
if (isNumber(position)) {
|
|
161
|
-
const contentElement = this.content.nativeElement;
|
|
162
|
-
contentElement[this.verticalTime ? 'scrollTop' : 'scrollLeft'] =
|
|
163
|
-
(this.localization.rtl && !this.verticalTime) ? rtlScrollPosition(contentElement, position) : position;
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
optionsChange(options) {
|
|
167
|
-
this.schedulerTimeSlotTemplate = options.timeSlotTemplate;
|
|
168
|
-
this.schedulerDateHeaderTemplate = options.dateHeaderTemplate;
|
|
169
|
-
this.schedulerMajorTimeHeaderTemplate = options.majorTimeHeaderTemplate;
|
|
170
|
-
this.schedulerMinorTimeHeaderTemplate = options.minorTimeHeaderTemplate;
|
|
171
|
-
super.optionsChange(options);
|
|
172
|
-
}
|
|
173
|
-
updateView() {
|
|
174
|
-
super.updateView();
|
|
175
|
-
this.updateCurrentTime();
|
|
176
|
-
this.updateOngoingEvents();
|
|
177
|
-
if (this.initialUpdate) {
|
|
178
|
-
this.scrollToTime();
|
|
179
|
-
this.initialUpdate = false;
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
enableCurrentTime() {
|
|
183
|
-
if (!this.currentTimeMarker || this.currentTimeMarker.enabled === false || !this.selectedDate) {
|
|
184
|
-
return false;
|
|
185
|
-
}
|
|
186
|
-
const dateRange = this.dateRange();
|
|
187
|
-
this.currentDate = ZonedDate.fromLocalDate(this.currentTime(), this.currentTimeMarker.localTimezone !== false ? '' : this.timezone);
|
|
188
|
-
const localTime = this.currentDate.toLocalDate();
|
|
189
|
-
const invariantTime = toInvariantTime(localTime);
|
|
190
|
-
const timeSlots = this.timeSlots;
|
|
191
|
-
const inDateRange = dateInRange(localTime, dateRange.start, dateRange.end);
|
|
192
|
-
const inTimeRange = timeSlots.length && dateInRange(invariantTime, timeSlots[0].start, timeSlots[timeSlots.length - 1].end);
|
|
193
|
-
return inDateRange && inTimeRange;
|
|
194
|
-
}
|
|
195
|
-
currentTime() {
|
|
196
|
-
return new Date();
|
|
197
|
-
}
|
|
198
|
-
updateCurrentTime() {
|
|
199
|
-
if (!isDocumentAvailable()) {
|
|
200
|
-
return;
|
|
201
|
-
}
|
|
202
|
-
const enable = this.enableCurrentTime();
|
|
203
|
-
if (enable !== this.showCurrentTime) {
|
|
204
|
-
this.showCurrentTime = enable;
|
|
205
|
-
this.changeDetector.detectChanges();
|
|
206
|
-
}
|
|
207
|
-
clearTimeout(this.currentTimeTimeout);
|
|
208
|
-
if (enable) {
|
|
209
|
-
this.zone.runOutsideAngular(() => {
|
|
210
|
-
this.currentTimeTimeout = setTimeout(this.updateCurrentTime, this.currentTimeMarker.updateInterval || MS_PER_MINUTE);
|
|
211
|
-
});
|
|
212
|
-
this.positionCurrentTime();
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
updateOngoingEvents() {
|
|
216
|
-
const disabled = !this.highlightOngoingEvents || this.highlightOngoingEvents.enabled === false;
|
|
217
|
-
if (!isDocumentAvailable() || disabled) {
|
|
218
|
-
return;
|
|
219
|
-
}
|
|
220
|
-
clearTimeout(this.ongoingEventsTimeout);
|
|
221
|
-
this.zone.runOutsideAngular(() => {
|
|
222
|
-
this.ongoingEventsTimeout = setTimeout(this.updateOngoingEvents, this.highlightOngoingEvents.updateInterval || MS_PER_MINUTE);
|
|
223
|
-
});
|
|
224
|
-
this.toggleOngoingClass();
|
|
225
|
-
}
|
|
226
|
-
positionCurrentTime() {
|
|
227
|
-
if (this.currentTimeElements && this.currentTimeElements.length) {
|
|
228
|
-
const date = this.currentDate.toUTCDate();
|
|
229
|
-
const currentTimeArrows = this.currentTimeArrows ? this.currentTimeArrows.toArray() : [];
|
|
230
|
-
const arrowOffset = currentTimeArrows.length ? this.currentTimeArrowOffset() : 0;
|
|
231
|
-
const arrowMid = currentTimeArrows.length ? (currentTimeArrows[0].nativeElement.offsetHeight / 2) : 4;
|
|
232
|
-
const tableWidth = this.contentTable.nativeElement.clientWidth;
|
|
233
|
-
const tableHeight = this.contentTable.nativeElement.clientHeight;
|
|
234
|
-
const vertical = this.verticalTime;
|
|
235
|
-
this.currentTimeElements.forEach((element, index) => {
|
|
236
|
-
const position = this.slotService.timePosition(date, index, vertical);
|
|
237
|
-
if (position !== undefined) {
|
|
238
|
-
const line = element.nativeElement;
|
|
239
|
-
if (currentTimeArrows[index]) {
|
|
240
|
-
const arrow = currentTimeArrows[index].nativeElement;
|
|
241
|
-
const origin = vertical ? arrowOffset : position - arrowMid;
|
|
242
|
-
setCoordinates(arrow, {
|
|
243
|
-
top: vertical ? position - arrowMid : arrowOffset,
|
|
244
|
-
left: origin,
|
|
245
|
-
right: origin
|
|
246
|
-
});
|
|
247
|
-
}
|
|
248
|
-
const origin = vertical ? 0 : position;
|
|
249
|
-
setCoordinates(line, {
|
|
250
|
-
top: vertical ? position : 0,
|
|
251
|
-
left: origin,
|
|
252
|
-
right: origin,
|
|
253
|
-
width: vertical ? tableWidth : 1,
|
|
254
|
-
height: vertical ? 1 : tableHeight
|
|
255
|
-
});
|
|
256
|
-
}
|
|
257
|
-
});
|
|
258
|
-
}
|
|
259
|
-
}
|
|
260
|
-
bindEvents() {
|
|
261
|
-
super.bindEvents();
|
|
262
|
-
this.zone.runOutsideAngular(() => {
|
|
263
|
-
this.subs.add(fromClick(this.headerWrap.nativeElement)
|
|
264
|
-
.subscribe(e => this.onHeaderClick(e)));
|
|
265
|
-
this.subs.add(fromEvent(this.headerWrap.nativeElement, 'contextmenu')
|
|
266
|
-
.subscribe(e => this.onClick(e)));
|
|
267
|
-
this.subs.add(fromDoubleClick(this.headerWrap.nativeElement)
|
|
268
|
-
.subscribe(e => this.onClick(e, 'dblclick')));
|
|
269
|
-
});
|
|
270
|
-
}
|
|
271
|
-
onHeaderClick(e) {
|
|
272
|
-
this.onClick(e);
|
|
273
|
-
if (this.daySlots.length <= 1) {
|
|
274
|
-
return;
|
|
275
|
-
}
|
|
276
|
-
const daySlotIndex = e.target.getAttribute('data-dayslot-index');
|
|
277
|
-
if (daySlotIndex) {
|
|
278
|
-
const slot = this.daySlots[parseInt(daySlotIndex, 10)];
|
|
279
|
-
this.zone.run(() => {
|
|
280
|
-
this.viewState.navigateTo({ viewName: 'day', date: slot.start });
|
|
281
|
-
});
|
|
282
|
-
}
|
|
283
|
-
}
|
|
284
|
-
slotByIndex(slotIndex, args) {
|
|
285
|
-
return this.slotService.slotByIndex(slotIndex, args.target.hasAttribute('data-day-slot'));
|
|
286
|
-
}
|
|
287
|
-
onSelectDate(date) {
|
|
288
|
-
this.selectedDate = date;
|
|
289
|
-
this.daySlots = this.createDaySlots();
|
|
290
|
-
this.showCurrentTime = this.enableCurrentTime();
|
|
291
|
-
this.viewState.notifyDateRange(this.dateRange());
|
|
292
|
-
}
|
|
293
|
-
onAction(e) {
|
|
294
|
-
const now = getDate(this.selectedDate);
|
|
295
|
-
if (e.type === 'next') {
|
|
296
|
-
const next = this.getNextDate(now, 1, this.numberOfDays);
|
|
297
|
-
if (this.isInRange(next)) {
|
|
298
|
-
this.viewState.notifyNextDate(next);
|
|
299
|
-
}
|
|
300
|
-
}
|
|
301
|
-
if (e.type === 'prev') {
|
|
302
|
-
const next = this.getNextDate(now, -1, this.numberOfDays);
|
|
303
|
-
if (this.isInRange(next)) {
|
|
304
|
-
this.viewState.notifyNextDate(next);
|
|
305
|
-
}
|
|
306
|
-
}
|
|
307
|
-
if (e.type === 'scroll-time') {
|
|
308
|
-
this.scrollToTime(e.time);
|
|
309
|
-
}
|
|
310
|
-
}
|
|
311
|
-
dateRange(date = this.selectedDate) {
|
|
312
|
-
const start = this.getStartDate(date);
|
|
313
|
-
const end = this.getEndDate(start, this.numberOfDays);
|
|
314
|
-
const rangeEnd = this.getEndDate(start, this.numberOfDays - 1);
|
|
315
|
-
const text = this.intl.format(this.selectedDateFormat, start, rangeEnd);
|
|
316
|
-
const shortText = this.intl.format(this.selectedShortDateFormat, start, rangeEnd);
|
|
317
|
-
return { start, end, text, shortText };
|
|
318
|
-
}
|
|
319
|
-
createDaySlots(multiDayEnd) {
|
|
320
|
-
if (!multiDayEnd) {
|
|
321
|
-
this.dates = [];
|
|
322
|
-
}
|
|
323
|
-
let current = this.getStartDate(this.selectedDate);
|
|
324
|
-
const end = multiDayEnd || this.getEndDate(current, this.numberOfDays);
|
|
325
|
-
const hiddenDays = this.slotService.hiddenDays;
|
|
326
|
-
while (current < end) {
|
|
327
|
-
const next = addDays(current, 1);
|
|
328
|
-
const isTimelineView = this.name === 'timelineWeek' || this.name === 'timelineMonth';
|
|
329
|
-
const isDisplayedDay = hiddenDays.indexOf(current.getDay()) === -1;
|
|
330
|
-
const hasSpace = isTimelineView || this.dates.length < this.numberOfDays;
|
|
331
|
-
if (isDisplayedDay && hasSpace) {
|
|
332
|
-
this.dates.push({
|
|
333
|
-
start: current,
|
|
334
|
-
end: next
|
|
335
|
-
});
|
|
336
|
-
}
|
|
337
|
-
current = next;
|
|
338
|
-
}
|
|
339
|
-
if (this.name === 'multiDay' && !allDaysHidden(hiddenDays) && this.dates.length < this.numberOfDays) {
|
|
340
|
-
const updatedEnd = addDays(end, this.numberOfDays - this.dates.length);
|
|
341
|
-
return this.createDaySlots(updatedEnd);
|
|
342
|
-
}
|
|
343
|
-
return this.dates;
|
|
344
|
-
}
|
|
345
|
-
createTimeSlots() {
|
|
346
|
-
return createTimeSlots(this.intl, {
|
|
347
|
-
showWorkHours: this.showWorkHours,
|
|
348
|
-
startTime: this.startTime,
|
|
349
|
-
endTime: this.endTime,
|
|
350
|
-
workDayStart: this.workDayStart,
|
|
351
|
-
workDayEnd: this.workDayEnd,
|
|
352
|
-
slotDivisions: this.slotDivisions,
|
|
353
|
-
slotDuration: this.slotDuration
|
|
354
|
-
});
|
|
355
|
-
}
|
|
356
|
-
initWorkDay() {
|
|
357
|
-
const startDate = this.intl.parseDate(this.workDayStart);
|
|
358
|
-
this.workDayStartTime = toInvariantTime(startDate);
|
|
359
|
-
const endDate = this.intl.parseDate(this.workDayEnd);
|
|
360
|
-
if (endDate <= startDate) {
|
|
361
|
-
this.workDayEndTime = addDays(MIDNIGHT_INVARIANT, 1);
|
|
362
|
-
}
|
|
363
|
-
else {
|
|
364
|
-
this.workDayEndTime = toInvariantTime(endDate);
|
|
365
|
-
}
|
|
366
|
-
}
|
|
367
|
-
slotByPosition(x, y, container) {
|
|
368
|
-
const isDaySlot = container ? hasClasses(container.parentNode, 'k-scheduler-header-wrap') : y < 0;
|
|
369
|
-
return this.slotService.slotByPosition(x, y, isDaySlot, Boolean(this.verticalResources.length));
|
|
370
|
-
}
|
|
371
|
-
slotFields(slot) {
|
|
372
|
-
const fields = super.slotFields(slot);
|
|
373
|
-
if (slot.isDaySlot) {
|
|
374
|
-
fields.isAllDay = true;
|
|
375
|
-
}
|
|
376
|
-
else {
|
|
377
|
-
fields.start = this.convertDate(slot.start);
|
|
378
|
-
fields.end = this.convertDate(slot.end);
|
|
379
|
-
}
|
|
380
|
-
return fields;
|
|
381
|
-
}
|
|
382
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", 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 }, { token: i7.ScrollbarWidthService }], target: i0.ɵɵFactoryTarget.Component });
|
|
383
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.14", type: DayTimeViewComponent, selector: "kendo-day-time-view", inputs: { timeSlotTemplate: "timeSlotTemplate", dateHeaderTemplate: "dateHeaderTemplate", majorTimeHeaderTemplate: "majorTimeHeaderTemplate", minorTimeHeaderTemplate: "minorTimeHeaderTemplate", 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 });
|
|
384
|
-
}
|
|
385
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: DayTimeViewComponent, decorators: [{
|
|
386
|
-
type: Component,
|
|
387
|
-
args: [{ selector: 'kendo-day-time-view', template: '' }]
|
|
388
|
-
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: i1.ViewContextService }, { type: i2.ViewStateService }, { type: i3.IntlService }, { type: i4.DayTimeSlotService }, { type: i0.NgZone }, { type: i0.Renderer2 }, { type: i0.ElementRef }, { type: i5.PDFService }, { type: i6.LocalizationService }, { type: i7.ScrollbarWidthService }], propDecorators: { timeSlotTemplate: [{
|
|
389
|
-
type: Input
|
|
390
|
-
}], dateHeaderTemplate: [{
|
|
391
|
-
type: Input
|
|
392
|
-
}], majorTimeHeaderTemplate: [{
|
|
393
|
-
type: Input
|
|
394
|
-
}], minorTimeHeaderTemplate: [{
|
|
395
|
-
type: Input
|
|
396
|
-
}], numberOfDays: [{
|
|
397
|
-
type: Input
|
|
398
|
-
}], scrollTime: [{
|
|
399
|
-
type: Input
|
|
400
|
-
}], startTime: [{
|
|
401
|
-
type: Input
|
|
402
|
-
}], endTime: [{
|
|
403
|
-
type: Input
|
|
404
|
-
}], workDayStart: [{
|
|
405
|
-
type: Input
|
|
406
|
-
}], workDayEnd: [{
|
|
407
|
-
type: Input
|
|
408
|
-
}], workWeekStart: [{
|
|
409
|
-
type: Input
|
|
410
|
-
}], workWeekEnd: [{
|
|
411
|
-
type: Input
|
|
412
|
-
}], slotDuration: [{
|
|
413
|
-
type: Input
|
|
414
|
-
}], slotDivisions: [{
|
|
415
|
-
type: Input
|
|
416
|
-
}], showWorkHours: [{
|
|
417
|
-
type: Input
|
|
418
|
-
}], getStartDate: [{
|
|
419
|
-
type: Input
|
|
420
|
-
}], getEndDate: [{
|
|
421
|
-
type: Input
|
|
422
|
-
}], getNextDate: [{
|
|
423
|
-
type: Input
|
|
424
|
-
}], currentTimeMarker: [{
|
|
425
|
-
type: Input
|
|
426
|
-
}], highlightOngoingEvents: [{
|
|
427
|
-
type: Input
|
|
428
|
-
}], currentTimeElements: [{
|
|
429
|
-
type: ViewChildren,
|
|
430
|
-
args: ['currentTimeMarker']
|
|
431
|
-
}], eventElements: [{
|
|
432
|
-
type: ViewChildren,
|
|
433
|
-
args: [DayTimeViewItemComponent]
|
|
434
|
-
}], currentTimeArrows: [{
|
|
435
|
-
type: ViewChildren,
|
|
436
|
-
args: ['currentTimeArrow']
|
|
437
|
-
}] } });
|
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
3
|
-
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
-
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
import { Directive, Input, ElementRef, HostBinding } from '@angular/core';
|
|
6
|
-
import { BaseSlotDirective } from '../view-items/base-slot.directive';
|
|
7
|
-
import { addUTCDays, toUTCTime, toUTCDate, dateWithTime, isWorkWeekDay } from '../utils';
|
|
8
|
-
import { DayTimeSlotService } from './day-time-slot.service';
|
|
9
|
-
import { LocalizationService } from '@progress/kendo-angular-l10n';
|
|
10
|
-
import { INVARIANT_END } from '../constants';
|
|
11
|
-
import * as i0 from "@angular/core";
|
|
12
|
-
import * as i1 from "./day-time-slot.service";
|
|
13
|
-
import * as i2 from "@progress/kendo-angular-l10n";
|
|
14
|
-
/**
|
|
15
|
-
* @hidden
|
|
16
|
-
*/
|
|
17
|
-
export class TimeSlotDirective extends BaseSlotDirective {
|
|
18
|
-
invariantStart;
|
|
19
|
-
invariantEnd;
|
|
20
|
-
workDayStart;
|
|
21
|
-
workDayEnd;
|
|
22
|
-
workWeekStart;
|
|
23
|
-
workWeekEnd;
|
|
24
|
-
date;
|
|
25
|
-
get nonWorkHour() {
|
|
26
|
-
const date = this.date.getDay();
|
|
27
|
-
return this.invariantStart < this.workDayStart || this.workDayEnd < this.invariantEnd || !isWorkWeekDay(date, this.workWeekStart, this.workWeekEnd);
|
|
28
|
-
}
|
|
29
|
-
isDaySlot = false;
|
|
30
|
-
get startLocalTime() {
|
|
31
|
-
if (!this.date || !this.invariantStart) {
|
|
32
|
-
return null;
|
|
33
|
-
}
|
|
34
|
-
return dateWithTime(this.date, this.invariantStart);
|
|
35
|
-
}
|
|
36
|
-
get endLocalTime() {
|
|
37
|
-
if (!this.date || !this.invariantEnd) {
|
|
38
|
-
return null;
|
|
39
|
-
}
|
|
40
|
-
return dateWithTime(this.date, this.invariantEnd);
|
|
41
|
-
}
|
|
42
|
-
get start() {
|
|
43
|
-
if (!this.date || !this.invariantStart) {
|
|
44
|
-
return null;
|
|
45
|
-
}
|
|
46
|
-
return toUTCTime(this.date, this.invariantStart);
|
|
47
|
-
}
|
|
48
|
-
get end() {
|
|
49
|
-
if (!this.date || !this.invariantEnd) {
|
|
50
|
-
return null;
|
|
51
|
-
}
|
|
52
|
-
const localEnd = toUTCTime(this.date, this.invariantEnd);
|
|
53
|
-
if (INVARIANT_END.getTime() <= this.invariantEnd.getTime()) {
|
|
54
|
-
return addUTCDays(localEnd, 1);
|
|
55
|
-
}
|
|
56
|
-
return localEnd;
|
|
57
|
-
}
|
|
58
|
-
constructor(element, slotService, localization) {
|
|
59
|
-
super(element, slotService, localization);
|
|
60
|
-
}
|
|
61
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: TimeSlotDirective, deps: [{ token: i0.ElementRef }, { token: i1.DayTimeSlotService }, { token: i2.LocalizationService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
62
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.14", type: TimeSlotDirective, isStandalone: true, selector: "[timeSlot]", inputs: { invariantStart: "invariantStart", invariantEnd: "invariantEnd", workDayStart: "workDayStart", workDayEnd: "workDayEnd", workWeekStart: "workWeekStart", workWeekEnd: "workWeekEnd", date: "date" }, host: { properties: { "class.k-nonwork-hour": "this.nonWorkHour" } }, exportAs: ["timeSlot"], usesInheritance: true, ngImport: i0 });
|
|
63
|
-
}
|
|
64
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: TimeSlotDirective, decorators: [{
|
|
65
|
-
type: Directive,
|
|
66
|
-
args: [{
|
|
67
|
-
// eslint-disable-next-line @angular-eslint/directive-selector
|
|
68
|
-
selector: '[timeSlot]',
|
|
69
|
-
exportAs: 'timeSlot',
|
|
70
|
-
standalone: true
|
|
71
|
-
}]
|
|
72
|
-
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i1.DayTimeSlotService }, { type: i2.LocalizationService }], propDecorators: { invariantStart: [{
|
|
73
|
-
type: Input
|
|
74
|
-
}], invariantEnd: [{
|
|
75
|
-
type: Input
|
|
76
|
-
}], workDayStart: [{
|
|
77
|
-
type: Input
|
|
78
|
-
}], workDayEnd: [{
|
|
79
|
-
type: Input
|
|
80
|
-
}], workWeekStart: [{
|
|
81
|
-
type: Input
|
|
82
|
-
}], workWeekEnd: [{
|
|
83
|
-
type: Input
|
|
84
|
-
}], date: [{
|
|
85
|
-
type: Input
|
|
86
|
-
}], nonWorkHour: [{
|
|
87
|
-
type: HostBinding,
|
|
88
|
-
args: ['class.k-nonwork-hour']
|
|
89
|
-
}] } });
|
|
90
|
-
/**
|
|
91
|
-
* @hidden
|
|
92
|
-
*/
|
|
93
|
-
export class DaySlotDirective extends BaseSlotDirective {
|
|
94
|
-
set start(value) {
|
|
95
|
-
this.startDate = value;
|
|
96
|
-
}
|
|
97
|
-
get start() {
|
|
98
|
-
if (!this.startDate) {
|
|
99
|
-
return null;
|
|
100
|
-
}
|
|
101
|
-
return toUTCDate(this.startDate);
|
|
102
|
-
}
|
|
103
|
-
set end(value) {
|
|
104
|
-
this.endDate = value;
|
|
105
|
-
}
|
|
106
|
-
get end() {
|
|
107
|
-
if (!this.endDate) {
|
|
108
|
-
return null;
|
|
109
|
-
}
|
|
110
|
-
return toUTCDate(this.endDate);
|
|
111
|
-
}
|
|
112
|
-
get daySlot() {
|
|
113
|
-
return true;
|
|
114
|
-
}
|
|
115
|
-
isDaySlot = true;
|
|
116
|
-
startDate;
|
|
117
|
-
endDate;
|
|
118
|
-
constructor(element, slotService, localization) {
|
|
119
|
-
super(element, slotService, localization);
|
|
120
|
-
}
|
|
121
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: DaySlotDirective, deps: [{ token: i0.ElementRef }, { token: i1.DayTimeSlotService }, { token: i2.LocalizationService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
122
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.14", type: DaySlotDirective, isStandalone: true, selector: "[daySlot]", inputs: { start: "start", end: "end" }, host: { properties: { "attr.data-day-slot": "this.daySlot" } }, usesInheritance: true, ngImport: i0 });
|
|
123
|
-
}
|
|
124
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: DaySlotDirective, decorators: [{
|
|
125
|
-
type: Directive,
|
|
126
|
-
args: [{
|
|
127
|
-
// eslint-disable-next-line @angular-eslint/directive-selector
|
|
128
|
-
selector: '[daySlot]',
|
|
129
|
-
standalone: true
|
|
130
|
-
}]
|
|
131
|
-
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i1.DayTimeSlotService }, { type: i2.LocalizationService }], propDecorators: { start: [{
|
|
132
|
-
type: Input
|
|
133
|
-
}], end: [{
|
|
134
|
-
type: Input
|
|
135
|
-
}], daySlot: [{
|
|
136
|
-
type: HostBinding,
|
|
137
|
-
args: ['attr.data-day-slot']
|
|
138
|
-
}] } });
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
3
|
-
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
-
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
import { toInvariantTime } from '../utils';
|
|
6
|
-
import { MIDNIGHT_INVARIANT, MS_PER_DAY, MS_PER_MINUTE } from '../constants';
|
|
7
|
-
/**
|
|
8
|
-
* @hidden
|
|
9
|
-
*/
|
|
10
|
-
export function createTimeSlots(intlService, { showWorkHours, startTime, endTime, workDayStart, workDayEnd, slotDivisions, slotDuration }) {
|
|
11
|
-
const startDate = intlService.parseDate(showWorkHours ? workDayStart : startTime);
|
|
12
|
-
const start = toInvariantTime(startDate).getTime();
|
|
13
|
-
const endDate = intlService.parseDate(showWorkHours ? workDayEnd : endTime);
|
|
14
|
-
let end = toInvariantTime(endDate).getTime();
|
|
15
|
-
if (end <= start) {
|
|
16
|
-
end = toInvariantTime(MIDNIGHT_INVARIANT).getTime() + MS_PER_DAY;
|
|
17
|
-
}
|
|
18
|
-
const slots = [];
|
|
19
|
-
const duration = Math.round((slotDuration / slotDivisions) * MS_PER_MINUTE);
|
|
20
|
-
let slotTime = start;
|
|
21
|
-
let index = 0;
|
|
22
|
-
while (slotTime < end) {
|
|
23
|
-
slots.push({
|
|
24
|
-
start: new Date(slotTime),
|
|
25
|
-
end: new Date(slotTime + duration),
|
|
26
|
-
isMajor: index % slotDivisions === 0
|
|
27
|
-
});
|
|
28
|
-
index++;
|
|
29
|
-
slotTime += duration;
|
|
30
|
-
}
|
|
31
|
-
return slots;
|
|
32
|
-
}
|