@progress/kendo-angular-scheduler 2.1.6-dev.202111010913 → 2.2.0-dev.202112171600
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/dist/cdn/js/kendo-angular-scheduler.js +2 -2
- package/dist/cdn/main.js +1 -1
- package/dist/es/events/slot-drag-end-event.js +17 -0
- package/dist/es/events/slot-drag-event.js +18 -0
- package/dist/es/events/slot-drag-start-event.js +24 -0
- package/dist/es/events.js +3 -0
- package/dist/es/index.js +1 -0
- package/dist/es/package-metadata.js +1 -1
- package/dist/es/scheduler.component.js +73 -1
- package/dist/es/scheduler.module.js +2 -0
- package/dist/es/toolbar/view-selector.component.js +1 -1
- package/dist/es/types/slot-selection.js +23 -0
- package/dist/es/types.js +1 -0
- package/dist/es/views/common/base-view.js +102 -8
- package/dist/es/views/common/slot-selectable.directive.js +117 -0
- package/dist/es/views/day-time/day-time-view.component.js +1 -1
- package/dist/es/views/day-time/day-time.module.js +2 -1
- package/dist/es/views/month/month-view-renderer.component.js +12 -5
- package/dist/es/views/multi-day/multi-day-view-renderer.component.js +3 -3
- package/dist/es/views/timeline/timeline-multi-day-view.component.js +1 -1
- package/dist/es/views/utils.js +49 -0
- package/dist/es/views/view-state.service.js +18 -0
- package/dist/es2015/events/slot-drag-end-event.d.ts +10 -0
- package/dist/es2015/events/slot-drag-end-event.js +10 -0
- package/dist/es2015/events/slot-drag-event.d.ts +39 -0
- package/dist/es2015/events/slot-drag-event.js +16 -0
- package/dist/es2015/events/slot-drag-start-event.d.ts +41 -0
- package/dist/es2015/events/slot-drag-start-event.js +19 -0
- package/dist/es2015/events.d.ts +3 -0
- package/dist/es2015/events.js +3 -0
- package/dist/es2015/index.d.ts +2 -0
- package/dist/es2015/index.js +1 -0
- package/dist/es2015/index.metadata.json +1 -1
- package/dist/es2015/package-metadata.js +1 -1
- package/dist/es2015/scheduler.component.d.ts +27 -0
- package/dist/es2015/scheduler.component.js +73 -1
- package/dist/es2015/scheduler.module.js +2 -0
- package/dist/es2015/toolbar/view-selector.component.js +1 -0
- package/dist/es2015/types/datepicker-options.interface.d.ts +5 -5
- package/dist/es2015/types/slot-selection.d.ts +71 -0
- package/dist/es2015/types/slot-selection.js +19 -0
- package/dist/es2015/types.d.ts +2 -0
- package/dist/es2015/types.js +1 -0
- package/dist/es2015/views/common/base-view.d.ts +26 -5
- package/dist/es2015/views/common/base-view.js +102 -8
- package/dist/es2015/views/common/slot-selectable.directive.d.ts +45 -0
- package/dist/es2015/views/common/slot-selectable.directive.js +112 -0
- package/dist/es2015/views/day-time/day-time-view.component.js +1 -1
- package/dist/es2015/views/day-time/day-time.module.js +2 -1
- package/dist/es2015/views/month/month-view-renderer.component.d.ts +4 -2
- package/dist/es2015/views/month/month-view-renderer.component.js +20 -6
- package/dist/es2015/views/multi-day/multi-day-view-renderer.component.d.ts +1 -1
- package/dist/es2015/views/multi-day/multi-day-view-renderer.component.js +22 -4
- package/dist/es2015/views/timeline/timeline-multi-day-view.component.js +8 -1
- package/dist/es2015/views/utils.d.ts +29 -0
- package/dist/es2015/views/utils.js +49 -0
- package/dist/es2015/views/view-state.service.d.ts +24 -1
- package/dist/es2015/views/view-state.service.js +18 -0
- package/dist/fesm2015/index.js +1638 -1218
- package/dist/fesm5/index.js +1791 -1387
- package/dist/npm/events/slot-drag-end-event.js +19 -0
- package/dist/npm/events/slot-drag-event.js +20 -0
- package/dist/npm/events/slot-drag-start-event.js +26 -0
- package/dist/npm/events.js +6 -0
- package/dist/npm/index.js +2 -0
- package/dist/npm/package-metadata.js +1 -1
- package/dist/npm/scheduler.component.js +73 -1
- package/dist/npm/scheduler.module.js +2 -0
- package/dist/npm/toolbar/view-selector.component.js +1 -1
- package/dist/npm/types/slot-selection.js +25 -0
- package/dist/npm/types.js +2 -0
- package/dist/npm/views/common/base-view.js +101 -7
- package/dist/npm/views/common/slot-selectable.directive.js +119 -0
- package/dist/npm/views/day-time/day-time-view.component.js +1 -1
- package/dist/npm/views/day-time/day-time.module.js +2 -1
- package/dist/npm/views/month/month-view-renderer.component.js +11 -4
- package/dist/npm/views/multi-day/multi-day-view-renderer.component.js +3 -3
- package/dist/npm/views/timeline/timeline-multi-day-view.component.js +1 -1
- package/dist/npm/views/utils.js +53 -0
- package/dist/npm/views/view-state.service.js +18 -0
- package/dist/systemjs/kendo-angular-scheduler.js +1 -1
- package/package.json +9 -7
|
@@ -65,6 +65,24 @@ export function toUTCDateTime(localDate) {
|
|
|
65
65
|
export function dateWithTime(target, time) {
|
|
66
66
|
return new Date(target.getFullYear(), target.getMonth(), target.getDate(), time.getHours(), time.getMinutes());
|
|
67
67
|
}
|
|
68
|
+
/**
|
|
69
|
+
* @hidden
|
|
70
|
+
* Flips the start and end values of a slot selection based on whether
|
|
71
|
+
* the last dragged-over slot is before or after the slot where the selection began.
|
|
72
|
+
*/
|
|
73
|
+
export function normaliseRangeStartAndEnd(selectionOrigin, currentSlot) {
|
|
74
|
+
let start;
|
|
75
|
+
let end;
|
|
76
|
+
if (currentSlot.end <= selectionOrigin.end) {
|
|
77
|
+
end = selectionOrigin.end;
|
|
78
|
+
start = currentSlot.start;
|
|
79
|
+
}
|
|
80
|
+
else {
|
|
81
|
+
start = selectionOrigin.start;
|
|
82
|
+
end = currentSlot.end;
|
|
83
|
+
}
|
|
84
|
+
return { start, end };
|
|
85
|
+
}
|
|
68
86
|
function getDataIdx(value, resource) {
|
|
69
87
|
const data = resource.data;
|
|
70
88
|
for (let dataIdx = 0; dataIdx < data.length; dataIdx++) {
|
|
@@ -172,6 +190,33 @@ export function assignTasksResources(tasks, options) {
|
|
|
172
190
|
task.resources = eventResources(task.event, options);
|
|
173
191
|
}
|
|
174
192
|
}
|
|
193
|
+
/**
|
|
194
|
+
* @hidden
|
|
195
|
+
*/
|
|
196
|
+
export function areValidResources(resources) {
|
|
197
|
+
return Array.isArray(resources) && resources.length > 0 && resources[0] !== undefined;
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* @hidden
|
|
201
|
+
*/
|
|
202
|
+
export function resourcesMatch(res1, res2, strict) {
|
|
203
|
+
if (res1.length !== res2.length) {
|
|
204
|
+
return false;
|
|
205
|
+
}
|
|
206
|
+
if (!strict && !areValidResources(res1) || !areValidResources(res2)) {
|
|
207
|
+
return true;
|
|
208
|
+
}
|
|
209
|
+
return res1.every(r1 => res2.some(r2 => r2.value === r1.value));
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* @hidden
|
|
213
|
+
*/
|
|
214
|
+
export function isSameRange(range1, range2) {
|
|
215
|
+
return (range1.start.getTime() === range2.start.getTime() &&
|
|
216
|
+
range1.end.getTime() === range2.end.getTime() &&
|
|
217
|
+
range1.isAllDay === range2.isAllDay &&
|
|
218
|
+
resourcesMatch(range1.resources, range2.resources, true));
|
|
219
|
+
}
|
|
175
220
|
/** @hidden */
|
|
176
221
|
export function findRowIndex(events, data) {
|
|
177
222
|
if (data.rowIndex !== undefined) {
|
|
@@ -272,3 +317,7 @@ export const isWorkWeekDay = (day, start, end) => {
|
|
|
272
317
|
}
|
|
273
318
|
return start <= day && day <= end;
|
|
274
319
|
};
|
|
320
|
+
/**
|
|
321
|
+
* @hidden
|
|
322
|
+
*/
|
|
323
|
+
export const alwaysFalse = () => false;
|
|
@@ -3,7 +3,9 @@
|
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
5
|
import { Observable } from 'rxjs';
|
|
6
|
+
import { SlotDragStartEvent } from '../main';
|
|
6
7
|
import { DateRange } from '../types';
|
|
8
|
+
import { ExtendedSlotRange, slotDragEventName, SlotRange } from '../types/slot-selection';
|
|
7
9
|
/**
|
|
8
10
|
* A service for publishing the view state and actions to the Scheduler.
|
|
9
11
|
*/
|
|
@@ -32,12 +34,27 @@ export declare class ViewStateService {
|
|
|
32
34
|
* A stream for indicating that the view options has changed.
|
|
33
35
|
*/
|
|
34
36
|
readonly optionsChange: Observable<any>;
|
|
37
|
+
/**
|
|
38
|
+
* A stream indicating that the user has started making a new slot selection.
|
|
39
|
+
*/
|
|
40
|
+
readonly slotSelectionStart: Observable<SlotRange>;
|
|
41
|
+
/**
|
|
42
|
+
* A stream indicating that the user has dragged over a different slot while making a selection.
|
|
43
|
+
*/
|
|
44
|
+
readonly slotSelectionDrag: Observable<SlotRange>;
|
|
45
|
+
/**
|
|
46
|
+
* A stream indicating that the user has finished making a slot selection.
|
|
47
|
+
*/
|
|
48
|
+
readonly slotSelectionEnd: Observable<SlotRange>;
|
|
35
49
|
private dateRangeSource;
|
|
36
50
|
private nextDateSource;
|
|
37
51
|
private navigateSource;
|
|
38
52
|
private viewEventSource;
|
|
39
53
|
private layoutEndSource;
|
|
40
54
|
private optionsChangeSource;
|
|
55
|
+
private slotSelectionStartSource;
|
|
56
|
+
private slotSelectionStartDragSource;
|
|
57
|
+
private slotSelectionStartEndSource;
|
|
41
58
|
constructor();
|
|
42
59
|
/**
|
|
43
60
|
* Publishes the date that will be displayed by the Scheduler
|
|
@@ -65,5 +82,11 @@ export declare class ViewStateService {
|
|
|
65
82
|
/**
|
|
66
83
|
* Emits a DOM event to the Scheduler.
|
|
67
84
|
*/
|
|
68
|
-
emitEvent(name: string, args
|
|
85
|
+
emitEvent(name: string | slotDragEventName, args?: any): void;
|
|
86
|
+
/** @hidden */
|
|
87
|
+
notifySlotSelectionStart(selection: SlotDragStartEvent): void;
|
|
88
|
+
/** @hidden */
|
|
89
|
+
notifySlotSelectionDrag(selection: ExtendedSlotRange): void;
|
|
90
|
+
/** @hidden */
|
|
91
|
+
notifySlotSelectionEnd(selection: ExtendedSlotRange): void;
|
|
69
92
|
}
|
|
@@ -23,12 +23,18 @@ let ViewStateService = class ViewStateService {
|
|
|
23
23
|
this.viewEventSource = new Subject();
|
|
24
24
|
this.layoutEndSource = new Subject();
|
|
25
25
|
this.optionsChangeSource = new Subject();
|
|
26
|
+
this.slotSelectionStartSource = new Subject();
|
|
27
|
+
this.slotSelectionStartDragSource = new Subject();
|
|
28
|
+
this.slotSelectionStartEndSource = new Subject();
|
|
26
29
|
this.dateRange = this.dateRangeSource.asObservable();
|
|
27
30
|
this.nextDate = this.nextDateSource.asObservable();
|
|
28
31
|
this.navigate = this.navigateSource.asObservable();
|
|
29
32
|
this.viewEvent = this.viewEventSource.asObservable();
|
|
30
33
|
this.layoutEnd = this.layoutEndSource.asObservable();
|
|
31
34
|
this.optionsChange = this.optionsChangeSource.asObservable();
|
|
35
|
+
this.slotSelectionStart = this.slotSelectionStartSource.asObservable();
|
|
36
|
+
this.slotSelectionDrag = this.slotSelectionStartDragSource.asObservable();
|
|
37
|
+
this.slotSelectionEnd = this.slotSelectionStartEndSource.asObservable();
|
|
32
38
|
}
|
|
33
39
|
/**
|
|
34
40
|
* Publishes the date that will be displayed by the Scheduler
|
|
@@ -72,6 +78,18 @@ let ViewStateService = class ViewStateService {
|
|
|
72
78
|
args: args
|
|
73
79
|
});
|
|
74
80
|
}
|
|
81
|
+
/** @hidden */
|
|
82
|
+
notifySlotSelectionStart(selection) {
|
|
83
|
+
this.slotSelectionStartSource.next(selection);
|
|
84
|
+
}
|
|
85
|
+
/** @hidden */
|
|
86
|
+
notifySlotSelectionDrag(selection) {
|
|
87
|
+
this.slotSelectionStartDragSource.next(selection);
|
|
88
|
+
}
|
|
89
|
+
/** @hidden */
|
|
90
|
+
notifySlotSelectionEnd(selection) {
|
|
91
|
+
this.slotSelectionStartEndSource.next(selection);
|
|
92
|
+
}
|
|
75
93
|
};
|
|
76
94
|
ViewStateService = tslib_1.__decorate([
|
|
77
95
|
Injectable(),
|