@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
package/dist/fesm2015/index.js
CHANGED
|
@@ -6,14 +6,14 @@ import { __decorate, __param, __metadata } from 'tslib';
|
|
|
6
6
|
import { Directive, Optional, TemplateRef, Injectable, EventEmitter, NgZone, Input, Renderer2, ElementRef, ChangeDetectorRef, Inject, isDevMode, HostBinding, Component, Output, ContentChild, ContentChildren, QueryList, ViewChild, ViewContainerRef, ChangeDetectionStrategy, ViewEncapsulation, forwardRef, NgModule, LOCALE_ID, Pipe, ViewChildren, HostListener } from '@angular/core';
|
|
7
7
|
import { LocalizationService, L10N_PREFIX, RTL, MessageService, ComponentMessages } from '@progress/kendo-angular-l10n';
|
|
8
8
|
import { hasObservers, isDocumentAvailable, isChanged, anyChanged, ResizeSensorComponent, EventsModule, guid, Keys, ResizeSensorModule } from '@progress/kendo-angular-common';
|
|
9
|
-
import { getDate, Day, ZonedDate,
|
|
9
|
+
import { isEqualDate, getDate, Day, ZonedDate, toLocalDate, MS_PER_DAY, addDays, firstDayOfMonth, addMonths, firstDayInWeek, timezoneNames } from '@progress/kendo-date-math';
|
|
10
10
|
import { validatePackage } from '@progress/kendo-licensing';
|
|
11
11
|
import { PreventableEvent, CalendarComponent, CalendarModule, DatePickerComponent, DateInputsModule } from '@progress/kendo-angular-dateinputs';
|
|
12
12
|
import { Subject, BehaviorSubject, fromEvent, Subscription, Observable, combineLatest, merge } from 'rxjs';
|
|
13
|
-
import { buffer, filter, map, auditTime, debounceTime, take, switchMap, tap } from 'rxjs/operators';
|
|
13
|
+
import { buffer, filter, map, auditTime, debounceTime, take, switchMap, tap, distinctUntilChanged } from 'rxjs/operators';
|
|
14
14
|
import { FormControl, FormGroup, NG_VALUE_ACCESSOR, ReactiveFormsModule } from '@angular/forms';
|
|
15
15
|
import { DialogCloseResult, DialogService, DialogModule } from '@progress/kendo-angular-dialog';
|
|
16
|
-
import {
|
|
16
|
+
import { formatDate, IntlService, IntlModule, CldrIntlService, parseDate } from '@progress/kendo-angular-intl';
|
|
17
17
|
import { CommonModule } from '@angular/common';
|
|
18
18
|
import { parseRule, expand, serializeRule } from '@progress/kendo-recurrence';
|
|
19
19
|
import { ButtonsModule, Button } from '@progress/kendo-angular-buttons';
|
|
@@ -32,7 +32,7 @@ const packageMetadata = {
|
|
|
32
32
|
name: '@progress/kendo-angular-scheduler',
|
|
33
33
|
productName: 'Kendo UI for Angular',
|
|
34
34
|
productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
|
|
35
|
-
publishDate:
|
|
35
|
+
publishDate: 1639756470,
|
|
36
36
|
version: '',
|
|
37
37
|
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'
|
|
38
38
|
};
|
|
@@ -316,6 +316,40 @@ class AddEvent extends PreventableEvent$1 {
|
|
|
316
316
|
}
|
|
317
317
|
}
|
|
318
318
|
|
|
319
|
+
/**
|
|
320
|
+
* Arguments for the `slotDragStart` event.
|
|
321
|
+
* The event is preventable and if prevented, subsequent `slotDrag`, `slotDragEnd`, and `slotSelectionChange` will not be fired.
|
|
322
|
+
*/
|
|
323
|
+
class SlotDragStartEvent extends PreventableEvent$1 {
|
|
324
|
+
/**
|
|
325
|
+
* @hidden
|
|
326
|
+
*/
|
|
327
|
+
constructor(sender, args) {
|
|
328
|
+
super();
|
|
329
|
+
this.sender = sender;
|
|
330
|
+
Object.assign(this, args);
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
/**
|
|
335
|
+
* Arguments for the `slotDrag` event.
|
|
336
|
+
*/
|
|
337
|
+
class SlotDragEvent {
|
|
338
|
+
/**
|
|
339
|
+
* @hidden
|
|
340
|
+
*/
|
|
341
|
+
constructor(sender, args) {
|
|
342
|
+
this.sender = sender;
|
|
343
|
+
Object.assign(this, args);
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
/**
|
|
348
|
+
* Arguments for the `slotDragEnd` event.
|
|
349
|
+
*/
|
|
350
|
+
class SlotDragEndEvent extends SlotDragEvent {
|
|
351
|
+
}
|
|
352
|
+
|
|
319
353
|
/**
|
|
320
354
|
* Represents the toolbar template of the Scheduler. To define a toolbar
|
|
321
355
|
* template, nest an `<ng-template kendoSchedulerToolbarTemplate>` tag
|
|
@@ -387,6 +421,22 @@ ToolbarService = __decorate([
|
|
|
387
421
|
class SchedulerView {
|
|
388
422
|
}
|
|
389
423
|
|
|
424
|
+
/**
|
|
425
|
+
* The arguments for the [`isSlotSelected`]({% slug api_scheduler_schedulercomponent %}#toc-isslotselected) callback.
|
|
426
|
+
*/
|
|
427
|
+
class IsSlotSelectedArgs {
|
|
428
|
+
}
|
|
429
|
+
/**
|
|
430
|
+
* @hidden
|
|
431
|
+
*/
|
|
432
|
+
var slotDragEventName;
|
|
433
|
+
(function (slotDragEventName) {
|
|
434
|
+
slotDragEventName["initDragSelect"] = "initDragSelect";
|
|
435
|
+
slotDragEventName["dragSelect"] = "dragSelect";
|
|
436
|
+
slotDragEventName["refreshSlotSelection"] = "refreshSlotSelection";
|
|
437
|
+
slotDragEventName["dragSelectRelease"] = "dragSelectRelease";
|
|
438
|
+
})(slotDragEventName || (slotDragEventName = {}));
|
|
439
|
+
|
|
390
440
|
/**
|
|
391
441
|
* Represents the template which renders the date header in the **Agenda** view.
|
|
392
442
|
* To define the date template, nest an `<ng-template>` tag with the `kendoSchedulerAgendaDateTemplate`
|
|
@@ -803,12 +853,18 @@ let ViewStateService = class ViewStateService {
|
|
|
803
853
|
this.viewEventSource = new Subject();
|
|
804
854
|
this.layoutEndSource = new Subject();
|
|
805
855
|
this.optionsChangeSource = new Subject();
|
|
856
|
+
this.slotSelectionStartSource = new Subject();
|
|
857
|
+
this.slotSelectionStartDragSource = new Subject();
|
|
858
|
+
this.slotSelectionStartEndSource = new Subject();
|
|
806
859
|
this.dateRange = this.dateRangeSource.asObservable();
|
|
807
860
|
this.nextDate = this.nextDateSource.asObservable();
|
|
808
861
|
this.navigate = this.navigateSource.asObservable();
|
|
809
862
|
this.viewEvent = this.viewEventSource.asObservable();
|
|
810
863
|
this.layoutEnd = this.layoutEndSource.asObservable();
|
|
811
864
|
this.optionsChange = this.optionsChangeSource.asObservable();
|
|
865
|
+
this.slotSelectionStart = this.slotSelectionStartSource.asObservable();
|
|
866
|
+
this.slotSelectionDrag = this.slotSelectionStartDragSource.asObservable();
|
|
867
|
+
this.slotSelectionEnd = this.slotSelectionStartEndSource.asObservable();
|
|
812
868
|
}
|
|
813
869
|
/**
|
|
814
870
|
* Publishes the date that will be displayed by the Scheduler
|
|
@@ -852,6 +908,18 @@ let ViewStateService = class ViewStateService {
|
|
|
852
908
|
args: args
|
|
853
909
|
});
|
|
854
910
|
}
|
|
911
|
+
/** @hidden */
|
|
912
|
+
notifySlotSelectionStart(selection) {
|
|
913
|
+
this.slotSelectionStartSource.next(selection);
|
|
914
|
+
}
|
|
915
|
+
/** @hidden */
|
|
916
|
+
notifySlotSelectionDrag(selection) {
|
|
917
|
+
this.slotSelectionStartDragSource.next(selection);
|
|
918
|
+
}
|
|
919
|
+
/** @hidden */
|
|
920
|
+
notifySlotSelectionEnd(selection) {
|
|
921
|
+
this.slotSelectionStartEndSource.next(selection);
|
|
922
|
+
}
|
|
855
923
|
};
|
|
856
924
|
ViewStateService = __decorate([
|
|
857
925
|
Injectable(),
|
|
@@ -1747,845 +1815,1208 @@ function rtlScrollPosition(element, position) {
|
|
|
1747
1815
|
return result;
|
|
1748
1816
|
}
|
|
1749
1817
|
|
|
1750
|
-
|
|
1751
|
-
const
|
|
1818
|
+
/** @hidden */
|
|
1819
|
+
const intersects = (startTime, endTime, periodStart, periodEnd) => (startTime < periodStart && endTime > periodEnd) ||
|
|
1820
|
+
(periodStart <= startTime && startTime < periodEnd) ||
|
|
1821
|
+
(periodStart < endTime && endTime <= periodEnd && startTime < endTime);
|
|
1822
|
+
/** @hidden */
|
|
1823
|
+
const dateInRange = (date, start, end) => start.getTime() <= date.getTime() && date.getTime() <= end.getTime();
|
|
1824
|
+
/** @hidden */
|
|
1825
|
+
const roundAllDayEnd = ({ start, end }) => {
|
|
1826
|
+
const startDate = start.stripTime();
|
|
1827
|
+
const endDate = end.stripTime();
|
|
1828
|
+
return endDate.getTime() !== end.getTime() || startDate.getTime() === endDate.getTime() ? endDate.addDays(1) : endDate;
|
|
1829
|
+
};
|
|
1830
|
+
/** @hidden */
|
|
1831
|
+
function toInvariantTime(date) {
|
|
1832
|
+
var staticDate = new Date(1980, 0, 1, 0, 0, 0);
|
|
1833
|
+
if (date) {
|
|
1834
|
+
staticDate.setHours(date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds());
|
|
1835
|
+
}
|
|
1836
|
+
return staticDate;
|
|
1837
|
+
}
|
|
1752
1838
|
/**
|
|
1753
|
-
*
|
|
1754
|
-
*
|
|
1755
|
-
* @example
|
|
1756
|
-
* ```ts-preview
|
|
1757
|
-
* _@Component({
|
|
1758
|
-
* selector: 'my-app',
|
|
1759
|
-
* template: `
|
|
1760
|
-
* <kendo-scheduler style="height: 600px">
|
|
1761
|
-
* <kendo-scheduler-day-view>
|
|
1762
|
-
* </kendo-scheduler-day-view>
|
|
1763
|
-
* <kendo-scheduler-week-view>
|
|
1764
|
-
* </kendo-scheduler-week-view>
|
|
1765
|
-
* </kendo-scheduler>
|
|
1766
|
-
* `
|
|
1767
|
-
* })
|
|
1768
|
-
* class AppComponent {}
|
|
1769
|
-
* ```
|
|
1839
|
+
* @hidden
|
|
1840
|
+
* TODO Move to date-math
|
|
1770
1841
|
*/
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
* The start time of the view when `showWorkHours` is set to `true`.
|
|
1812
|
-
* Accepts string values in the `HH:mm` format. Applicable for the **Day**, **Week**, and **Timeline** views.
|
|
1813
|
-
*/
|
|
1814
|
-
this.workDayStart = '08:00';
|
|
1815
|
-
/**
|
|
1816
|
-
* The end time of the view when `showWorkHours` is set to `true`.
|
|
1817
|
-
* Accepts string values in the `HH:mm` format. Applicable for the **Day**, **Week**, and **Timeline** views.
|
|
1818
|
-
*/
|
|
1819
|
-
this.workDayEnd = '17:00';
|
|
1820
|
-
/**
|
|
1821
|
-
* The duration (in minutes) of the time slots. Applicable for the day, week and timeline views.
|
|
1822
|
-
*/
|
|
1823
|
-
this.slotDuration = 60;
|
|
1824
|
-
/**
|
|
1825
|
-
* The number of divisions of the time slots. Applicable for the **Day**, **Week**, and **Timeline** views.
|
|
1826
|
-
*/
|
|
1827
|
-
this.slotDivisions = 2;
|
|
1828
|
-
/**
|
|
1829
|
-
* A numeric value between 0 and 1 that specifies what percentage of the slot will be filled by the events.
|
|
1830
|
-
* Applicable for the **Day** and **Week** views.
|
|
1831
|
-
* Defaults to `0.9` (90% fill).
|
|
1832
|
-
*/
|
|
1833
|
-
this.slotFill = 0.9;
|
|
1834
|
-
/**
|
|
1835
|
-
* The time to which the view will initially be scrolled.
|
|
1836
|
-
* Accepts string values in the `HH:mm` format or a JavaScript `Date`. Applicable for the **Day**, **Week**, and **Timeline** views.
|
|
1837
|
-
*/
|
|
1838
|
-
this.scrollTime = this.workDayStart;
|
|
1839
|
-
/**
|
|
1840
|
-
* Specifies the Scheduler current time marker settings.
|
|
1841
|
-
*/
|
|
1842
|
-
this.currentTimeMarker = true;
|
|
1843
|
-
/**
|
|
1844
|
-
* @hidden
|
|
1845
|
-
*/
|
|
1846
|
-
this.selectedViewIndexChange = new EventEmitter();
|
|
1847
|
-
/**
|
|
1848
|
-
* Fires when the Scheduler is about to execute a navigation action
|
|
1849
|
-
* (a view, date, or focus change).
|
|
1850
|
-
*/
|
|
1851
|
-
this.navigate = new EventEmitter();
|
|
1852
|
-
/**
|
|
1853
|
-
* Fires when the date range that is displayed in the Scheduler changes.
|
|
1854
|
-
*/
|
|
1855
|
-
this.dateChange = new EventEmitter();
|
|
1856
|
-
/**
|
|
1857
|
-
* Fires when a Scheduler view slot is clicked.
|
|
1858
|
-
*/
|
|
1859
|
-
this.slotClick = new EventEmitter();
|
|
1860
|
-
/**
|
|
1861
|
-
* Fires when a Scheduler view slot is double-clicked.
|
|
1862
|
-
*/
|
|
1863
|
-
this.slotDblClick = new EventEmitter();
|
|
1864
|
-
/**
|
|
1865
|
-
* Fires when the user creates a new event using the `'c'` key.
|
|
1866
|
-
* ([see example]({% slug keyboard_navigation_scheduler %})).
|
|
1867
|
-
*/
|
|
1868
|
-
this.create = new EventEmitter();
|
|
1869
|
-
/**
|
|
1870
|
-
* Fires when a Scheduler event is clicked.
|
|
1871
|
-
*/
|
|
1872
|
-
this.eventClick = new EventEmitter();
|
|
1873
|
-
/**
|
|
1874
|
-
* Fires when a Scheduler event is double-clicked.
|
|
1875
|
-
*/
|
|
1876
|
-
this.eventDblClick = new EventEmitter();
|
|
1877
|
-
/**
|
|
1878
|
-
* Fires when a key is pressed on a focused Scheduler event.
|
|
1879
|
-
*/
|
|
1880
|
-
this.eventKeydown = new EventEmitter();
|
|
1881
|
-
/**
|
|
1882
|
-
* Fires when the user cancels the editing by clicking the **Cancel** command button.
|
|
1883
|
-
*/
|
|
1884
|
-
this.cancel = new EventEmitter();
|
|
1885
|
-
/**
|
|
1886
|
-
* Fires when the user clicks the **Save** command button to save the changes of the edited event.
|
|
1887
|
-
*/
|
|
1888
|
-
this.save = new EventEmitter();
|
|
1889
|
-
/**
|
|
1890
|
-
* Fires when the user clicks the **Remove** icon of a Scheduler event.
|
|
1891
|
-
*/
|
|
1892
|
-
this.remove = new EventEmitter();
|
|
1893
|
-
/**
|
|
1894
|
-
* Fires when the user starts resizing a Scheduler event.
|
|
1895
|
-
*/
|
|
1896
|
-
this.resizeStart = new EventEmitter();
|
|
1897
|
-
/**
|
|
1898
|
-
* Fires when the user is resizing a Scheduler event.
|
|
1899
|
-
*/
|
|
1900
|
-
this.resize = new EventEmitter();
|
|
1901
|
-
/**
|
|
1902
|
-
* Fires when the user stops resizing a Scheduler event.
|
|
1903
|
-
*/
|
|
1904
|
-
this.resizeEnd = new EventEmitter();
|
|
1905
|
-
/**
|
|
1906
|
-
* Fires when the user starts dragging a Scheduler event.
|
|
1907
|
-
*/
|
|
1908
|
-
this.dragStart = new EventEmitter();
|
|
1909
|
-
/**
|
|
1910
|
-
* Fires when the user is dragging a Scheduler event.
|
|
1911
|
-
*/
|
|
1912
|
-
this.drag = new EventEmitter();
|
|
1913
|
-
/**
|
|
1914
|
-
* Fires when the user stops dragging a Scheduler event.
|
|
1915
|
-
*/
|
|
1916
|
-
this.dragEnd = new EventEmitter();
|
|
1917
|
-
/**
|
|
1918
|
-
* Fires when the user clicks the **PDF export** command button.
|
|
1919
|
-
*/
|
|
1920
|
-
this.pdfExport = new EventEmitter();
|
|
1921
|
-
/**
|
|
1922
|
-
* @hidden
|
|
1923
|
-
*/
|
|
1924
|
-
this.dragEndConfirmed = new EventEmitter();
|
|
1925
|
-
/**
|
|
1926
|
-
* @hidden
|
|
1927
|
-
*/
|
|
1928
|
-
this.resizeEndConfirmed = new EventEmitter();
|
|
1929
|
-
/**
|
|
1930
|
-
* @hidden
|
|
1931
|
-
*/
|
|
1932
|
-
this.removeConfirmed = new EventEmitter();
|
|
1933
|
-
this.viewIndex = 0;
|
|
1934
|
-
this._timezone = '';
|
|
1935
|
-
this._modelFields = defaultModelFields;
|
|
1936
|
-
validatePackage(packageMetadata);
|
|
1937
|
-
this.dateRangeStream = viewState.dateRange;
|
|
1938
|
-
this.selectedDateStream = viewContext.selectedDate;
|
|
1939
|
-
}
|
|
1940
|
-
get dir() {
|
|
1941
|
-
return this.direction;
|
|
1942
|
-
}
|
|
1943
|
-
/**
|
|
1944
|
-
* The index of the currently selected view.
|
|
1945
|
-
*
|
|
1946
|
-
* By default, the selected view index is `0` and
|
|
1947
|
-
* indicates that the first declared view is visible.
|
|
1948
|
-
*/
|
|
1949
|
-
set selectedViewIndex(index) {
|
|
1950
|
-
this.viewIndex = index;
|
|
1951
|
-
this.onViewIndexChange();
|
|
1952
|
-
}
|
|
1953
|
-
get selectedViewIndex() {
|
|
1954
|
-
return this.viewIndex;
|
|
1842
|
+
const addUTCDays = (date, offset) => {
|
|
1843
|
+
const newDate = new Date(date.getTime());
|
|
1844
|
+
newDate.setUTCDate(newDate.getUTCDate() + offset);
|
|
1845
|
+
return newDate;
|
|
1846
|
+
};
|
|
1847
|
+
// TODO: name? move to date-math
|
|
1848
|
+
/** @hidden */
|
|
1849
|
+
function toUTCTime(localDate, localTime) {
|
|
1850
|
+
return new Date(Date.UTC(localDate.getFullYear(), localDate.getMonth(), localDate.getDate(), localTime.getHours(), localTime.getMinutes(), localTime.getSeconds(), localTime.getMilliseconds()));
|
|
1851
|
+
}
|
|
1852
|
+
// TODO: move to date-math
|
|
1853
|
+
/** @hidden */
|
|
1854
|
+
function toUTCDate(localDate) {
|
|
1855
|
+
return new Date(Date.UTC(localDate.getFullYear(), localDate.getMonth(), localDate.getDate()));
|
|
1856
|
+
}
|
|
1857
|
+
// TODO: move to date-math
|
|
1858
|
+
/** @hidden */
|
|
1859
|
+
function getUTCDate(utcDate) {
|
|
1860
|
+
return new Date(Date.UTC(utcDate.getUTCFullYear(), utcDate.getUTCMonth(), utcDate.getUTCDate()));
|
|
1861
|
+
}
|
|
1862
|
+
// TODO: move to date-math
|
|
1863
|
+
/** @hidden */
|
|
1864
|
+
function toUTCDateTime(localDate) {
|
|
1865
|
+
return new Date(Date.UTC(localDate.getFullYear(), localDate.getMonth(), localDate.getDate(), localDate.getHours(), localDate.getMinutes(), localDate.getSeconds(), localDate.getMilliseconds()));
|
|
1866
|
+
}
|
|
1867
|
+
/** @hidden */
|
|
1868
|
+
function dateWithTime(target, time) {
|
|
1869
|
+
return new Date(target.getFullYear(), target.getMonth(), target.getDate(), time.getHours(), time.getMinutes());
|
|
1870
|
+
}
|
|
1871
|
+
/**
|
|
1872
|
+
* @hidden
|
|
1873
|
+
* Flips the start and end values of a slot selection based on whether
|
|
1874
|
+
* the last dragged-over slot is before or after the slot where the selection began.
|
|
1875
|
+
*/
|
|
1876
|
+
function normaliseRangeStartAndEnd(selectionOrigin, currentSlot) {
|
|
1877
|
+
let start;
|
|
1878
|
+
let end;
|
|
1879
|
+
if (currentSlot.end <= selectionOrigin.end) {
|
|
1880
|
+
end = selectionOrigin.end;
|
|
1881
|
+
start = currentSlot.start;
|
|
1955
1882
|
}
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
*/
|
|
1960
|
-
set weekStart(value) {
|
|
1961
|
-
this._weekStart = value;
|
|
1883
|
+
else {
|
|
1884
|
+
start = selectionOrigin.start;
|
|
1885
|
+
end = currentSlot.end;
|
|
1962
1886
|
}
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1887
|
+
return { start, end };
|
|
1888
|
+
}
|
|
1889
|
+
function getDataIdx(value, resource) {
|
|
1890
|
+
const data = resource.data;
|
|
1891
|
+
for (let dataIdx = 0; dataIdx < data.length; dataIdx++) {
|
|
1892
|
+
if (getField(data[dataIdx], resource.valueField) === value) {
|
|
1893
|
+
return dataIdx;
|
|
1966
1894
|
}
|
|
1967
|
-
return this.intlService.firstDay();
|
|
1968
|
-
}
|
|
1969
|
-
/**
|
|
1970
|
-
* Specifies the id of the timezone that will be displayed in the Scheduler.
|
|
1971
|
-
* For example, `Europe/Sofia`.
|
|
1972
|
-
* Defaults to `Etc/UTC`.
|
|
1973
|
-
*/
|
|
1974
|
-
set timezone(value) {
|
|
1975
|
-
this._timezone = value;
|
|
1976
|
-
this.events = this.events || [];
|
|
1977
|
-
}
|
|
1978
|
-
get timezone() {
|
|
1979
|
-
return this._timezone;
|
|
1980
1895
|
}
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1896
|
+
return -1;
|
|
1897
|
+
}
|
|
1898
|
+
function resourceItem(value, resource) {
|
|
1899
|
+
const index = getDataIdx(value, resource);
|
|
1900
|
+
return index >= 0 ? resource.data[index] : {};
|
|
1901
|
+
}
|
|
1902
|
+
function resourceItems(values, resource) {
|
|
1903
|
+
return values.map(value => resourceItem(value, resource));
|
|
1904
|
+
}
|
|
1905
|
+
function cloneResources(arr) {
|
|
1906
|
+
const result = [];
|
|
1907
|
+
for (let idx = 0; idx < arr.length; idx++) {
|
|
1908
|
+
const clone$$1 = Object.assign({}, arr[idx]);
|
|
1909
|
+
clone$$1.resources = clone$$1.resources.slice(0);
|
|
1910
|
+
result.push(clone$$1);
|
|
1987
1911
|
}
|
|
1988
|
-
|
|
1989
|
-
|
|
1912
|
+
return result;
|
|
1913
|
+
}
|
|
1914
|
+
/** @hidden */
|
|
1915
|
+
function resourceItemByValue(event, resource) {
|
|
1916
|
+
const value = getField(event, resource.field);
|
|
1917
|
+
if (Array.isArray(value)) {
|
|
1918
|
+
return resourceItems(value, resource);
|
|
1990
1919
|
}
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1920
|
+
return resourceItem(value, resource);
|
|
1921
|
+
}
|
|
1922
|
+
function addNotGroupedResources(event, resources, allResources) {
|
|
1923
|
+
for (let resourceIdx = 0; resourceIdx < resources.length; resourceIdx++) {
|
|
1924
|
+
const current = resources[resourceIdx];
|
|
1925
|
+
for (let idx = 0; idx < allResources.length; idx++) {
|
|
1926
|
+
const item = allResources[idx];
|
|
1927
|
+
if (!current.resources[idx] && item.data) {
|
|
1928
|
+
current.resources[idx] = resourceItemByValue(event, item);
|
|
1929
|
+
}
|
|
1998
1930
|
}
|
|
1999
|
-
this._selectedDate = value;
|
|
2000
|
-
this.viewContext.notifySelectedDate(value);
|
|
2001
|
-
}
|
|
2002
|
-
get selectedDate() {
|
|
2003
|
-
return this._selectedDate;
|
|
2004
|
-
}
|
|
2005
|
-
/**
|
|
2006
|
-
* The names of the model fields from which the Scheduler will read its data
|
|
2007
|
-
* ([see example]({% slug databinding_scheduler %}#toc-binding-to-models)).
|
|
2008
|
-
*/
|
|
2009
|
-
set modelFields(value) {
|
|
2010
|
-
this._modelFields = Object.assign({}, defaultModelFields, value);
|
|
2011
1931
|
}
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
1932
|
+
}
|
|
1933
|
+
/** @hidden */
|
|
1934
|
+
function eventResources(event, { taskResources, hasGroups, spans, allResources = [] }) {
|
|
1935
|
+
let resources = [];
|
|
1936
|
+
for (let resourceIdx = 0; resourceIdx < taskResources.length; resourceIdx++) {
|
|
1937
|
+
const resource = taskResources[resourceIdx];
|
|
1938
|
+
if (!resource.data) {
|
|
1939
|
+
resources = [{ leafIdx: 0, resources: [] }];
|
|
1940
|
+
continue;
|
|
2018
1941
|
}
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
if (
|
|
2022
|
-
|
|
1942
|
+
const resourceIndex = allResources.indexOf(resource);
|
|
1943
|
+
let values = getField(event, resource.field);
|
|
1944
|
+
if (!Array.isArray(values)) {
|
|
1945
|
+
values = [values];
|
|
2023
1946
|
}
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
this.subs.add(this.viewState.dateRange.subscribe(dateRange => {
|
|
2030
|
-
const isEmpty = dateRange.start.getTime() === 0;
|
|
2031
|
-
if (!isEmpty) {
|
|
2032
|
-
const args = new DateChangeEvent(this, this.selectedDate, dateRange);
|
|
2033
|
-
this.dateChange.emit(args);
|
|
2034
|
-
}
|
|
2035
|
-
}));
|
|
2036
|
-
this.subs.add(this.viewState.navigate.subscribe(({ viewName, date }) => {
|
|
2037
|
-
const views = this.views.toArray();
|
|
2038
|
-
const view = views.find(v => v.name === viewName);
|
|
2039
|
-
const args = new NavigateEvent(this, {
|
|
2040
|
-
type: 'show-date',
|
|
2041
|
-
view: view || {
|
|
2042
|
-
name: viewName,
|
|
2043
|
-
title: viewName
|
|
2044
|
-
},
|
|
2045
|
-
date: date
|
|
2046
|
-
});
|
|
2047
|
-
this.navigate.next(args);
|
|
2048
|
-
if (view && !args.isDefaultPrevented()) {
|
|
2049
|
-
const index = views.indexOf(view);
|
|
2050
|
-
this.selectedView = view;
|
|
2051
|
-
this.setViewIndex(index);
|
|
2052
|
-
this.selectedDate = date;
|
|
1947
|
+
const expandedResources = [];
|
|
1948
|
+
for (let valueIdx = 0; valueIdx < values.length; valueIdx++) {
|
|
1949
|
+
const dataIdx = getDataIdx(values[valueIdx], resource);
|
|
1950
|
+
if (dataIdx < 0) {
|
|
1951
|
+
return [{ leafIdx: hasGroups ? -1 : 0, resources: [] }];
|
|
2053
1952
|
}
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
confirmedEmitter.emit(eventInstance);
|
|
2065
|
-
}
|
|
1953
|
+
const item = resource.data[dataIdx];
|
|
1954
|
+
// has groups - need all copies of the multiple resource
|
|
1955
|
+
// no groups - just the first
|
|
1956
|
+
if (resourceIdx === 0 && (hasGroups || valueIdx === 0)) {
|
|
1957
|
+
const resourceItems = [];
|
|
1958
|
+
resourceItems[resourceIndex] = resource.multiple && !hasGroups ? [item] : item;
|
|
1959
|
+
resources.push({
|
|
1960
|
+
leafIdx: hasGroups ? dataIdx * spans[resourceIdx] : 0,
|
|
1961
|
+
color: getField(item, resource.colorField),
|
|
1962
|
+
resources: resourceItems
|
|
2066
1963
|
});
|
|
2067
1964
|
}
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
1965
|
+
else if (hasGroups) { // don't create multiple resource groups if no groups for multiple resources
|
|
1966
|
+
let currentResources = resources;
|
|
1967
|
+
if (values.length > 1) {
|
|
1968
|
+
currentResources = cloneResources(resources);
|
|
1969
|
+
expandedResources.push.apply(expandedResources, currentResources);
|
|
1970
|
+
}
|
|
1971
|
+
for (let currentIdx = 0; currentIdx < currentResources.length; currentIdx++) {
|
|
1972
|
+
currentResources[currentIdx].leafIdx += dataIdx * spans[resourceIdx];
|
|
1973
|
+
currentResources[currentIdx].resources[resourceIndex] = item;
|
|
1974
|
+
}
|
|
2072
1975
|
}
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
this.subs.add(this.eventTemplate.changes.subscribe(this.notifyOptionsChange));
|
|
2078
|
-
this.subs.add(this.timeSlotTemplate.changes.subscribe(this.notifyOptionsChange));
|
|
2079
|
-
this.subs.add(this.timeSlotTemplate.changes.subscribe(this.notifyOptionsChange));
|
|
2080
|
-
this.subs.add(this.minorTimeHeaderTemplate.changes.subscribe(this.notifyOptionsChange));
|
|
2081
|
-
this.subs.add(this.majorTimeHeaderTemplate.changes.subscribe(this.notifyOptionsChange));
|
|
2082
|
-
this.subs.add(this.monthDaySlotTemplate.changes.subscribe(this.notifyOptionsChange));
|
|
2083
|
-
this.subs.add(this.dateHeaderTemplate.changes.subscribe(this.notifyOptionsChange));
|
|
2084
|
-
this.subs.add(this.allDaySlotTemplate.changes.subscribe(this.notifyOptionsChange));
|
|
2085
|
-
this.subs.add(this.groupHeaderTemplate.changes.subscribe(this.notifyOptionsChange));
|
|
2086
|
-
this.subs.add(this.agendaDateTemplate.changes.subscribe(this.notifyOptionsChange));
|
|
2087
|
-
this.subs.add(this.agendaTimeTemplate.changes.subscribe(this.notifyOptionsChange));
|
|
2088
|
-
this.subs.add(this.views.changes.subscribe(() => {
|
|
2089
|
-
this.changeDetector.markForCheck();
|
|
2090
|
-
}));
|
|
2091
|
-
//this.editService.timezone = this.timezone;
|
|
2092
|
-
this.attachEditHandlers();
|
|
2093
|
-
this.dialogsService.container = this.confirmationDialogContainerRef;
|
|
2094
|
-
this.notifyOptionsChange();
|
|
2095
|
-
this.subs.add(this.pdfService.exportClick.subscribe(() => {
|
|
2096
|
-
const args = new PDFExportEvent();
|
|
2097
|
-
this.pdfExport.emit(args);
|
|
2098
|
-
if (!args.isDefaultPrevented()) {
|
|
2099
|
-
this.saveAsPDF();
|
|
1976
|
+
else if (valueIdx > 0) {
|
|
1977
|
+
for (let idx = 0; idx < resources.length; idx++) {
|
|
1978
|
+
resources[idx].resources[resourceIndex].push(item);
|
|
1979
|
+
}
|
|
2100
1980
|
}
|
|
2101
|
-
}));
|
|
2102
|
-
this.subs.add(this.pdfService.done.subscribe(() => {
|
|
2103
|
-
this.loadingComponent.toggle(false);
|
|
2104
|
-
}));
|
|
2105
|
-
this.subs.add(this.localization.changes.subscribe(({ rtl }) => {
|
|
2106
|
-
this.rtl = rtl;
|
|
2107
|
-
this.direction = this.rtl ? 'rtl' : 'ltr';
|
|
2108
|
-
}));
|
|
2109
|
-
this.subs.add(this.viewState.optionsChange.subscribe(() => {
|
|
2110
|
-
this.changeDetector.markForCheck();
|
|
2111
|
-
}));
|
|
2112
|
-
this.attachElementEventHandlers();
|
|
2113
|
-
}
|
|
2114
|
-
ngOnChanges(changes) {
|
|
2115
|
-
if (isChanged('resources', changes) && !isChanged('events', changes) && this.viewItems) {
|
|
2116
|
-
this.viewItems.forEach(item => {
|
|
2117
|
-
copyResources(item.event, this.resources);
|
|
2118
|
-
});
|
|
2119
1981
|
}
|
|
2120
|
-
if (
|
|
2121
|
-
|
|
2122
|
-
'workDayStart', 'workDayEnd', 'workWeekStart', 'workWeekEnd', 'weekStart', 'slotDuration', 'slotDivisions',
|
|
2123
|
-
'editable', 'timezone', 'slotClass', 'slotFill', 'columnWidth', 'eventClass', 'eventStyles'
|
|
2124
|
-
], changes)) {
|
|
2125
|
-
this.notifyOptionsChange(changes);
|
|
1982
|
+
if (expandedResources.length) {
|
|
1983
|
+
resources = expandedResources;
|
|
2126
1984
|
}
|
|
2127
1985
|
}
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
1986
|
+
addNotGroupedResources(event, resources, allResources);
|
|
1987
|
+
return resources;
|
|
1988
|
+
}
|
|
1989
|
+
/** @hidden */
|
|
1990
|
+
function assignTasksResources(tasks, options) {
|
|
1991
|
+
for (let idx = 0; idx < tasks.length; idx++) {
|
|
1992
|
+
const task = tasks[idx];
|
|
1993
|
+
task.resources = eventResources(task.event, options);
|
|
2135
1994
|
}
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
1995
|
+
}
|
|
1996
|
+
/**
|
|
1997
|
+
* @hidden
|
|
1998
|
+
*/
|
|
1999
|
+
function areValidResources(resources) {
|
|
2000
|
+
return Array.isArray(resources) && resources.length > 0 && resources[0] !== undefined;
|
|
2001
|
+
}
|
|
2002
|
+
/**
|
|
2003
|
+
* @hidden
|
|
2004
|
+
*/
|
|
2005
|
+
function resourcesMatch(res1, res2, strict) {
|
|
2006
|
+
if (res1.length !== res2.length) {
|
|
2007
|
+
return false;
|
|
2141
2008
|
}
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
*/
|
|
2145
|
-
onNavigationAction(action) {
|
|
2146
|
-
const args = new NavigateEvent(this, action);
|
|
2147
|
-
this.navigate.next(args);
|
|
2148
|
-
if (args.isDefaultPrevented()) {
|
|
2149
|
-
return true;
|
|
2150
|
-
}
|
|
2151
|
-
if (action.type === 'view-change') {
|
|
2152
|
-
const views = this.views.toArray();
|
|
2153
|
-
const index = views.indexOf(action.view);
|
|
2154
|
-
this.selectedView = action.view;
|
|
2155
|
-
this.setViewIndex(index);
|
|
2156
|
-
}
|
|
2157
|
-
else if (action.type === 'select-date') {
|
|
2158
|
-
if (this.isInRange(action.date)) {
|
|
2159
|
-
this.selectedDate = action.date;
|
|
2160
|
-
}
|
|
2161
|
-
}
|
|
2162
|
-
else if (action.type === 'today') {
|
|
2163
|
-
const date = new Date();
|
|
2164
|
-
if (this.isInRange(date)) {
|
|
2165
|
-
this.selectedDate = date;
|
|
2166
|
-
}
|
|
2167
|
-
}
|
|
2168
|
-
else {
|
|
2169
|
-
this.viewContext.notifyAction(action);
|
|
2170
|
-
}
|
|
2009
|
+
if (!strict && !areValidResources(res1) || !areValidResources(res2)) {
|
|
2010
|
+
return true;
|
|
2171
2011
|
}
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
|
|
2012
|
+
return res1.every(r1 => res2.some(r2 => r2.value === r1.value));
|
|
2013
|
+
}
|
|
2014
|
+
/**
|
|
2015
|
+
* @hidden
|
|
2016
|
+
*/
|
|
2017
|
+
function isSameRange(range1, range2) {
|
|
2018
|
+
return (range1.start.getTime() === range2.start.getTime() &&
|
|
2019
|
+
range1.end.getTime() === range2.end.getTime() &&
|
|
2020
|
+
range1.isAllDay === range2.isAllDay &&
|
|
2021
|
+
resourcesMatch(range1.resources, range2.resources, true));
|
|
2022
|
+
}
|
|
2023
|
+
/** @hidden */
|
|
2024
|
+
function findRowIndex(events, data) {
|
|
2025
|
+
if (data.rowIndex !== undefined) {
|
|
2026
|
+
return data.rowIndex;
|
|
2027
|
+
}
|
|
2028
|
+
for (let idx = 0; idx < events.length; idx++) {
|
|
2029
|
+
if (!events[idx]) {
|
|
2030
|
+
return idx;
|
|
2187
2031
|
}
|
|
2188
|
-
this.editService.addEvent(group);
|
|
2189
2032
|
}
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
|
|
2033
|
+
return events.length;
|
|
2034
|
+
}
|
|
2035
|
+
/** @hidden */
|
|
2036
|
+
function isRecurrence(task) {
|
|
2037
|
+
return Boolean(task.event && task.event.recurrenceRule);
|
|
2038
|
+
}
|
|
2039
|
+
/** @hidden */
|
|
2040
|
+
function isRecurrenceException(task) {
|
|
2041
|
+
return task.event && isPresent(task.event.recurrenceId) && !task.event.recurrenceRule;
|
|
2042
|
+
}
|
|
2043
|
+
/** @hidden */
|
|
2044
|
+
const rectContains = (rect, left, top) => rect.left <= left && left <= rect.left + rect.width && rect.top <= top && top <= rect.top + rect.height;
|
|
2045
|
+
/** @hidden */
|
|
2046
|
+
const rectContainsX = (rect, left) => rect.left <= left && left <= rect.left + rect.width;
|
|
2047
|
+
/** @hidden */
|
|
2048
|
+
const toPx = value => `${value}px`;
|
|
2049
|
+
/** @hidden */
|
|
2050
|
+
const elementOffset = (element) => {
|
|
2051
|
+
if (!element) {
|
|
2052
|
+
return null;
|
|
2200
2053
|
}
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
|
|
2054
|
+
const box = element.getBoundingClientRect();
|
|
2055
|
+
const documentElement = document.documentElement;
|
|
2056
|
+
return {
|
|
2057
|
+
top: box.top + (window.pageYOffset || documentElement.scrollTop) - (documentElement.clientTop || 0),
|
|
2058
|
+
left: box.left + (window.pageXOffset || documentElement.scrollLeft) - (documentElement.clientLeft || 0),
|
|
2059
|
+
width: box.width,
|
|
2060
|
+
height: box.height
|
|
2061
|
+
};
|
|
2062
|
+
};
|
|
2063
|
+
/** @hidden */
|
|
2064
|
+
const pointDistance = (x1, y1, x2, y2) => Math.sqrt(Math.pow(x1 - x2, 2) + Math.pow(y1 - y2, 2));
|
|
2065
|
+
/** @hidden */
|
|
2066
|
+
const ignoreContentChild = child => child.nodeName === 'KENDO-RESIZE-SENSOR' || hasClasses(child, 'k-loading-mask');
|
|
2067
|
+
/** @hidden */
|
|
2068
|
+
const setCoordinates = (element, coordinates) => {
|
|
2069
|
+
for (let field in coordinates) {
|
|
2070
|
+
if (coordinates.hasOwnProperty(field)) {
|
|
2071
|
+
element.style[field] = toPx(coordinates[field]);
|
|
2072
|
+
}
|
|
2206
2073
|
}
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
return this.editService.isEditing();
|
|
2074
|
+
};
|
|
2075
|
+
/** @hidden */
|
|
2076
|
+
const convertNgClassBindings = (bindingValues) => {
|
|
2077
|
+
const result = [];
|
|
2078
|
+
if (isString(bindingValues)) {
|
|
2079
|
+
result.push(bindingValues);
|
|
2214
2080
|
}
|
|
2215
|
-
|
|
2216
|
-
|
|
2217
|
-
* that will be used when the user edits or removes a recurring event.
|
|
2218
|
-
*
|
|
2219
|
-
* @param operation - The type of operation that will be confirmed. Has to be either **Edit** or **Remove**.
|
|
2220
|
-
*
|
|
2221
|
-
* @return {Observable<EditMode>}
|
|
2222
|
-
*/
|
|
2223
|
-
openRecurringConfirmationDialog(operation) {
|
|
2224
|
-
return this.dialogsService.openRecurringConfirmationDialog(operation);
|
|
2081
|
+
else if (isArray(bindingValues)) {
|
|
2082
|
+
result.push.apply(result, bindingValues);
|
|
2225
2083
|
}
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
-
return this.dialogsService.openRemoveConfirmationDialog();
|
|
2084
|
+
else if (isObject(bindingValues)) {
|
|
2085
|
+
for (let field in bindingValues) {
|
|
2086
|
+
if (bindingValues.hasOwnProperty(field) && bindingValues[field]) {
|
|
2087
|
+
result.push(field);
|
|
2088
|
+
}
|
|
2089
|
+
}
|
|
2233
2090
|
}
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
})
|
|
2091
|
+
return result;
|
|
2092
|
+
};
|
|
2093
|
+
/**
|
|
2094
|
+
* @hidden
|
|
2095
|
+
*/
|
|
2096
|
+
function formatEventTime(start, end, isAllDay, localeId) {
|
|
2097
|
+
const startTimeFormat = { skeleton: 'yMMMMEEEEdhm' };
|
|
2098
|
+
const startDateFormat = { skeleton: 'yMMMMEEEEd' };
|
|
2099
|
+
const endFormat = isEqualDate(start, end) ? 't' : startTimeFormat;
|
|
2100
|
+
return isAllDay ?
|
|
2101
|
+
`${formatDate(start, startDateFormat, localeId)}` :
|
|
2102
|
+
`${formatDate(start, startTimeFormat, localeId)}–${formatDate(end, endFormat, localeId)}`;
|
|
2103
|
+
}
|
|
2104
|
+
/**
|
|
2105
|
+
* @hidden
|
|
2106
|
+
*/
|
|
2107
|
+
function formValueOrDefault(group, field, defaultValue) {
|
|
2108
|
+
const control = group.get(field);
|
|
2109
|
+
if (!control) {
|
|
2110
|
+
return defaultValue;
|
|
2246
2111
|
}
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2112
|
+
return control.value || defaultValue;
|
|
2113
|
+
}
|
|
2114
|
+
/**
|
|
2115
|
+
* @hidden
|
|
2116
|
+
*/
|
|
2117
|
+
const isWorkWeekDay = (day, start, end) => {
|
|
2118
|
+
if (end < start) {
|
|
2119
|
+
return day <= end || start <= day;
|
|
2255
2120
|
}
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2121
|
+
return start <= day && day <= end;
|
|
2122
|
+
};
|
|
2123
|
+
/**
|
|
2124
|
+
* @hidden
|
|
2125
|
+
*/
|
|
2126
|
+
const alwaysFalse = () => false;
|
|
2127
|
+
|
|
2128
|
+
const todayDate = () => getDate(new Date());
|
|
2129
|
+
const DAYS_IN_WEEK = 7;
|
|
2130
|
+
/**
|
|
2131
|
+
* Represents the [Kendo UI Scheduler component for Angular]({% slug overview_scheduler %}).
|
|
2132
|
+
*
|
|
2133
|
+
* @example
|
|
2134
|
+
* ```ts-preview
|
|
2135
|
+
* _@Component({
|
|
2136
|
+
* selector: 'my-app',
|
|
2137
|
+
* template: `
|
|
2138
|
+
* <kendo-scheduler style="height: 600px">
|
|
2139
|
+
* <kendo-scheduler-day-view>
|
|
2140
|
+
* </kendo-scheduler-day-view>
|
|
2141
|
+
* <kendo-scheduler-week-view>
|
|
2142
|
+
* </kendo-scheduler-week-view>
|
|
2143
|
+
* </kendo-scheduler>
|
|
2144
|
+
* `
|
|
2145
|
+
* })
|
|
2146
|
+
* class AppComponent {}
|
|
2147
|
+
* ```
|
|
2148
|
+
*/
|
|
2149
|
+
let SchedulerComponent = class SchedulerComponent {
|
|
2150
|
+
constructor(wrapper, viewContext, viewState, editService, dialogsService, intlService, changeDetector, zone, pdfService, localization, domEvents, renderer, focusService) {
|
|
2151
|
+
this.wrapper = wrapper;
|
|
2152
|
+
this.viewContext = viewContext;
|
|
2153
|
+
this.viewState = viewState;
|
|
2154
|
+
this.editService = editService;
|
|
2155
|
+
this.dialogsService = dialogsService;
|
|
2156
|
+
this.intlService = intlService;
|
|
2157
|
+
this.changeDetector = changeDetector;
|
|
2158
|
+
this.zone = zone;
|
|
2159
|
+
this.pdfService = pdfService;
|
|
2160
|
+
this.localization = localization;
|
|
2161
|
+
this.domEvents = domEvents;
|
|
2162
|
+
this.renderer = renderer;
|
|
2163
|
+
this.focusService = focusService;
|
|
2164
|
+
this.hostClasses = true;
|
|
2165
|
+
this.rtl = false;
|
|
2166
|
+
/**
|
|
2167
|
+
* Specifies if the Scheduler is editable.
|
|
2168
|
+
*/
|
|
2169
|
+
this.editable = false;
|
|
2170
|
+
/**
|
|
2171
|
+
* Specifies if the Scheduler's day or time slots are selectable ([see example]({% slug slotselection_scheduler %}#toc-custom-callback)).
|
|
2172
|
+
*
|
|
2173
|
+
* When this input is set to `true`, the Scheduler component will emit [`slotDragStart`]({% slug api_scheduler_schedulercomponent %}#toc-slotdragstart), [`slotDrag`]({% slug api_scheduler_schedulercomponent %}#toc-slotdrag), and [`slotDragEnd`]({% slug api_scheduler_schedulercomponent %}#toc-slotdragend) events upon user interaction.
|
|
2174
|
+
*/
|
|
2175
|
+
this.selectable = false;
|
|
2176
|
+
/**
|
|
2177
|
+
* The height of the events in the **Month** and **Timeline** views, and the height of the **All day** events in the **Day** and **Week** views.
|
|
2178
|
+
*/
|
|
2179
|
+
this.eventHeight = 25;
|
|
2180
|
+
/**
|
|
2181
|
+
* Specifies the columns width. Applicable for the **Timeline** views.
|
|
2182
|
+
*/
|
|
2183
|
+
this.columnWidth = 100;
|
|
2184
|
+
/**
|
|
2185
|
+
* The start time of the view. The Scheduler displays events which start after the start time.
|
|
2186
|
+
* Accepts string values in the `HH:mm` format. Applicable for the **Day**, **Week**, and **Timeline** views.
|
|
2187
|
+
*/
|
|
2188
|
+
this.startTime = '00:00';
|
|
2189
|
+
/**
|
|
2190
|
+
* The end time of the view. The Scheduler displays events which end before the end time.
|
|
2191
|
+
* Accepts string values in the `HH:mm` format. Applicable for the **Day**, **Week**, and **Timeline** views.
|
|
2192
|
+
*/
|
|
2193
|
+
this.endTime = '00:00';
|
|
2194
|
+
/**
|
|
2195
|
+
* The start time of the view when `showWorkHours` is set to `true`.
|
|
2196
|
+
* Accepts string values in the `HH:mm` format. Applicable for the **Day**, **Week**, and **Timeline** views.
|
|
2197
|
+
*/
|
|
2198
|
+
this.workDayStart = '08:00';
|
|
2199
|
+
/**
|
|
2200
|
+
* The end time of the view when `showWorkHours` is set to `true`.
|
|
2201
|
+
* Accepts string values in the `HH:mm` format. Applicable for the **Day**, **Week**, and **Timeline** views.
|
|
2202
|
+
*/
|
|
2203
|
+
this.workDayEnd = '17:00';
|
|
2204
|
+
/**
|
|
2205
|
+
* The duration (in minutes) of the time slots. Applicable for the day, week and timeline views.
|
|
2206
|
+
*/
|
|
2207
|
+
this.slotDuration = 60;
|
|
2208
|
+
/**
|
|
2209
|
+
* The number of divisions of the time slots. Applicable for the **Day**, **Week**, and **Timeline** views.
|
|
2210
|
+
*/
|
|
2211
|
+
this.slotDivisions = 2;
|
|
2212
|
+
/**
|
|
2213
|
+
* A numeric value between 0 and 1 that specifies what percentage of the slot will be filled by the events.
|
|
2214
|
+
* Applicable for the **Day** and **Week** views.
|
|
2215
|
+
* Defaults to `0.9` (90% fill).
|
|
2216
|
+
*/
|
|
2217
|
+
this.slotFill = 0.9;
|
|
2218
|
+
/**
|
|
2219
|
+
* The time to which the view will initially be scrolled.
|
|
2220
|
+
* Accepts string values in the `HH:mm` format or a JavaScript `Date`. Applicable for the **Day**, **Week**, and **Timeline** views.
|
|
2221
|
+
*/
|
|
2222
|
+
this.scrollTime = this.workDayStart;
|
|
2223
|
+
/**
|
|
2224
|
+
* Specifies the Scheduler current time marker settings.
|
|
2225
|
+
*/
|
|
2226
|
+
this.currentTimeMarker = true;
|
|
2227
|
+
/**
|
|
2228
|
+
* A callback that executes for each slot of the Scheduler view.
|
|
2229
|
+
* If it returns `true`, the `k-state-selected` CSS class will be added to the cell, making it visibly selected.
|
|
2230
|
+
*/
|
|
2231
|
+
this.isSlotSelected = alwaysFalse;
|
|
2232
|
+
/**
|
|
2233
|
+
* @hidden
|
|
2234
|
+
*/
|
|
2235
|
+
this.selectedViewIndexChange = new EventEmitter();
|
|
2236
|
+
/**
|
|
2237
|
+
* Fires when the Scheduler is about to execute a navigation action
|
|
2238
|
+
* (a view, date, or focus change).
|
|
2239
|
+
*/
|
|
2240
|
+
this.navigate = new EventEmitter();
|
|
2241
|
+
/**
|
|
2242
|
+
* Fires when the date range that is displayed in the Scheduler changes.
|
|
2243
|
+
*/
|
|
2244
|
+
this.dateChange = new EventEmitter();
|
|
2245
|
+
/**
|
|
2246
|
+
* Fires when a Scheduler view slot is clicked.
|
|
2247
|
+
*/
|
|
2248
|
+
this.slotClick = new EventEmitter();
|
|
2249
|
+
/**
|
|
2250
|
+
* Fires when a Scheduler view slot is double-clicked.
|
|
2251
|
+
*/
|
|
2252
|
+
this.slotDblClick = new EventEmitter();
|
|
2253
|
+
/**
|
|
2254
|
+
* Fires when the user creates a new event using the `'c'` key.
|
|
2255
|
+
* ([see example]({% slug keyboard_navigation_scheduler %})).
|
|
2256
|
+
*/
|
|
2257
|
+
this.create = new EventEmitter();
|
|
2258
|
+
/**
|
|
2259
|
+
* Fires when a Scheduler event is clicked.
|
|
2260
|
+
*/
|
|
2261
|
+
this.eventClick = new EventEmitter();
|
|
2262
|
+
/**
|
|
2263
|
+
* Fires when a Scheduler event is double-clicked.
|
|
2264
|
+
*/
|
|
2265
|
+
this.eventDblClick = new EventEmitter();
|
|
2266
|
+
/**
|
|
2267
|
+
* Fires when a key is pressed on a focused Scheduler event.
|
|
2268
|
+
*/
|
|
2269
|
+
this.eventKeydown = new EventEmitter();
|
|
2270
|
+
/**
|
|
2271
|
+
* Fires when the user cancels the editing by clicking the **Cancel** command button.
|
|
2272
|
+
*/
|
|
2273
|
+
this.cancel = new EventEmitter();
|
|
2274
|
+
/**
|
|
2275
|
+
* Fires when the user clicks the **Save** command button to save the changes of the edited event.
|
|
2276
|
+
*/
|
|
2277
|
+
this.save = new EventEmitter();
|
|
2278
|
+
/**
|
|
2279
|
+
* Fires when the user clicks the **Remove** icon of a Scheduler event.
|
|
2280
|
+
*/
|
|
2281
|
+
this.remove = new EventEmitter();
|
|
2282
|
+
/**
|
|
2283
|
+
* Fires when the user starts resizing a Scheduler event.
|
|
2284
|
+
*/
|
|
2285
|
+
this.resizeStart = new EventEmitter();
|
|
2286
|
+
/**
|
|
2287
|
+
* Fires when the user is resizing a Scheduler event.
|
|
2288
|
+
*/
|
|
2289
|
+
this.resize = new EventEmitter();
|
|
2290
|
+
/**
|
|
2291
|
+
* Fires when the user stops resizing a Scheduler event.
|
|
2292
|
+
*/
|
|
2293
|
+
this.resizeEnd = new EventEmitter();
|
|
2294
|
+
/**
|
|
2295
|
+
* Fires when the user starts dragging a Scheduler event.
|
|
2296
|
+
*/
|
|
2297
|
+
this.dragStart = new EventEmitter();
|
|
2298
|
+
/**
|
|
2299
|
+
* Fires when the user is dragging a Scheduler event.
|
|
2300
|
+
*/
|
|
2301
|
+
this.drag = new EventEmitter();
|
|
2302
|
+
/**
|
|
2303
|
+
* Fires when the user stops dragging a Scheduler event.
|
|
2304
|
+
*/
|
|
2305
|
+
this.dragEnd = new EventEmitter();
|
|
2306
|
+
/**
|
|
2307
|
+
* Fires when the user starts drag-selecting a Scheduler slot range.
|
|
2308
|
+
*/
|
|
2309
|
+
this.slotDragStart = new EventEmitter();
|
|
2310
|
+
/**
|
|
2311
|
+
* Fires when the user is drag-selecting a Scheduler slot range.
|
|
2312
|
+
*/
|
|
2313
|
+
this.slotDrag = new EventEmitter();
|
|
2314
|
+
/**
|
|
2315
|
+
* Fires when the user stops drag-selecting a Scheduler slot range.
|
|
2316
|
+
*/
|
|
2317
|
+
this.slotDragEnd = new EventEmitter();
|
|
2318
|
+
/**
|
|
2319
|
+
* Fires when the user clicks the **PDF export** command button.
|
|
2320
|
+
*/
|
|
2321
|
+
this.pdfExport = new EventEmitter();
|
|
2322
|
+
/**
|
|
2323
|
+
* @hidden
|
|
2324
|
+
*/
|
|
2325
|
+
this.dragEndConfirmed = new EventEmitter();
|
|
2326
|
+
/**
|
|
2327
|
+
* @hidden
|
|
2328
|
+
*/
|
|
2329
|
+
this.resizeEndConfirmed = new EventEmitter();
|
|
2330
|
+
/**
|
|
2331
|
+
* @hidden
|
|
2332
|
+
*/
|
|
2333
|
+
this.removeConfirmed = new EventEmitter();
|
|
2334
|
+
this.viewIndex = 0;
|
|
2335
|
+
this._timezone = '';
|
|
2336
|
+
this._modelFields = defaultModelFields;
|
|
2337
|
+
validatePackage(packageMetadata);
|
|
2338
|
+
this.dateRangeStream = viewState.dateRange;
|
|
2339
|
+
this.selectedDateStream = viewContext.selectedDate;
|
|
2340
|
+
}
|
|
2341
|
+
get dir() {
|
|
2342
|
+
return this.direction;
|
|
2271
2343
|
}
|
|
2272
2344
|
/**
|
|
2273
|
-
*
|
|
2345
|
+
* The index of the currently selected view.
|
|
2274
2346
|
*
|
|
2275
|
-
*
|
|
2276
|
-
*
|
|
2347
|
+
* By default, the selected view index is `0` and
|
|
2348
|
+
* indicates that the first declared view is visible.
|
|
2277
2349
|
*/
|
|
2278
|
-
|
|
2279
|
-
|
|
2350
|
+
set selectedViewIndex(index) {
|
|
2351
|
+
this.viewIndex = index;
|
|
2352
|
+
this.onViewIndexChange();
|
|
2353
|
+
}
|
|
2354
|
+
get selectedViewIndex() {
|
|
2355
|
+
return this.viewIndex;
|
|
2280
2356
|
}
|
|
2281
2357
|
/**
|
|
2282
|
-
*
|
|
2283
|
-
*
|
|
2358
|
+
* The first day of the week. Applicable to **Week**, **Month** and **TimelineWeek** views.
|
|
2359
|
+
* Defaults to the locale settings.
|
|
2284
2360
|
*/
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
|
|
2288
|
-
|
|
2361
|
+
set weekStart(value) {
|
|
2362
|
+
this._weekStart = value;
|
|
2363
|
+
}
|
|
2364
|
+
get weekStart() {
|
|
2365
|
+
if (isPresent(this._weekStart)) {
|
|
2366
|
+
return this._weekStart;
|
|
2289
2367
|
}
|
|
2368
|
+
return this.intlService.firstDay();
|
|
2290
2369
|
}
|
|
2291
2370
|
/**
|
|
2292
|
-
*
|
|
2293
|
-
*
|
|
2294
|
-
*
|
|
2295
|
-
* A `nowrap` flag toggles the wrapping to the first or to the last item.
|
|
2296
|
-
*
|
|
2297
|
-
* @example
|
|
2298
|
-
* ```ts-no-run
|
|
2299
|
-
* scheduler.focusNext(); // Focuses the next event.
|
|
2300
|
-
* scheduler.focusNext({ offset: 1 }); // Focuses the next event.
|
|
2301
|
-
* scheduler.focusNext({ offset: -1 }); // Focuses the previous event.
|
|
2302
|
-
* scheduler.focusNext({ nowrap: true }); // If the focus is on the last event, does not move the focus to the first event.
|
|
2303
|
-
* ```
|
|
2304
|
-
*
|
|
2305
|
-
* @param position The relative position of the event to focus.
|
|
2306
|
-
* @returns `true` if the focused event changed. Otherwise, returns `false`.
|
|
2371
|
+
* Specifies the id of the timezone that will be displayed in the Scheduler.
|
|
2372
|
+
* For example, `Europe/Sofia`.
|
|
2373
|
+
* Defaults to `Etc/UTC`.
|
|
2307
2374
|
*/
|
|
2308
|
-
|
|
2309
|
-
|
|
2375
|
+
set timezone(value) {
|
|
2376
|
+
this._timezone = value;
|
|
2377
|
+
this.events = this.events || [];
|
|
2378
|
+
}
|
|
2379
|
+
get timezone() {
|
|
2380
|
+
return this._timezone;
|
|
2310
2381
|
}
|
|
2311
2382
|
/**
|
|
2312
|
-
*
|
|
2313
|
-
* The `options` parameter can be used to set a positive or negative offset
|
|
2314
|
-
* that is relative to the currently focused event.
|
|
2315
|
-
* A `nowrap` flag toggles the wrapping to the first or to the last item.
|
|
2316
|
-
*
|
|
2317
|
-
* @example
|
|
2318
|
-
* ```ts-no-run
|
|
2319
|
-
* scheduler.focusPrev(); // Focuses the previous event
|
|
2320
|
-
* scheduler.focusPrev({ nowrap: true }); // Does not move the focus to the last event, if focus is on the first one.
|
|
2321
|
-
* ```
|
|
2322
|
-
*
|
|
2323
|
-
* @param position The relative position of the event to focus.
|
|
2324
|
-
* @returns `true` if the focused event changed. Otherwise, returns `false`.
|
|
2383
|
+
* An array of event instances which will be shown by the Scheduler.
|
|
2325
2384
|
*/
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
2385
|
+
set events(value) {
|
|
2386
|
+
this._events = value;
|
|
2387
|
+
this.processEvents(value);
|
|
2388
|
+
}
|
|
2389
|
+
get events() {
|
|
2390
|
+
return this._events;
|
|
2329
2391
|
}
|
|
2330
2392
|
/**
|
|
2331
|
-
*
|
|
2393
|
+
* The currently selected date of the Scheduler.
|
|
2394
|
+
* Determines the period which is displayed.
|
|
2332
2395
|
*/
|
|
2333
|
-
|
|
2334
|
-
|
|
2396
|
+
set selectedDate(value) {
|
|
2397
|
+
if (!value) {
|
|
2398
|
+
return;
|
|
2399
|
+
}
|
|
2400
|
+
this._selectedDate = value;
|
|
2401
|
+
this.viewContext.notifySelectedDate(value);
|
|
2335
2402
|
}
|
|
2336
|
-
|
|
2337
|
-
return
|
|
2403
|
+
get selectedDate() {
|
|
2404
|
+
return this._selectedDate;
|
|
2338
2405
|
}
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
eventTemplate: this.eventTemplate ? this.eventTemplate.first : null,
|
|
2346
|
-
timeSlotTemplate: this.timeSlotTemplate ? this.timeSlotTemplate.first : null,
|
|
2347
|
-
minorTimeHeaderTemplate: this.minorTimeHeaderTemplate ? this.minorTimeHeaderTemplate.first : null,
|
|
2348
|
-
majorTimeHeaderTemplate: this.majorTimeHeaderTemplate ? this.majorTimeHeaderTemplate.first : null,
|
|
2349
|
-
monthDaySlotTemplate: this.monthDaySlotTemplate ? this.monthDaySlotTemplate.first : null,
|
|
2350
|
-
dateHeaderTemplate: this.dateHeaderTemplate ? this.dateHeaderTemplate.first : null,
|
|
2351
|
-
allDaySlotTemplate: this.allDaySlotTemplate ? this.allDaySlotTemplate.first : null,
|
|
2352
|
-
groupHeaderTemplate: this.groupHeaderTemplate ? this.groupHeaderTemplate.first : null,
|
|
2353
|
-
agendaDateTemplate: this.agendaDateTemplate ? this.agendaDateTemplate.first : null,
|
|
2354
|
-
agendaTimeTemplate: this.agendaTimeTemplate ? this.agendaTimeTemplate.first : null,
|
|
2355
|
-
min: this.min,
|
|
2356
|
-
max: this.max,
|
|
2357
|
-
showWorkHours: this.showWorkHours,
|
|
2358
|
-
startTime: this.startTime,
|
|
2359
|
-
scrollTime: this.scrollTime,
|
|
2360
|
-
endTime: this.endTime,
|
|
2361
|
-
workDayStart: this.workDayStart,
|
|
2362
|
-
workDayEnd: this.workDayEnd,
|
|
2363
|
-
workWeekStart: workweek.start,
|
|
2364
|
-
workWeekEnd: workweek.end,
|
|
2365
|
-
weekStart: this.weekStart,
|
|
2366
|
-
slotDuration: this.slotDuration,
|
|
2367
|
-
slotDivisions: this.slotDivisions,
|
|
2368
|
-
eventHeight: this.eventHeight,
|
|
2369
|
-
editable: this.editable,
|
|
2370
|
-
timezone: this.timezone,
|
|
2371
|
-
currentTimeMarker: this.currentTimeMarker,
|
|
2372
|
-
slotClass: this.slotClass,
|
|
2373
|
-
slotFill: this.slotFill,
|
|
2374
|
-
columnWidth: this.columnWidth,
|
|
2375
|
-
eventClass: this.eventClass,
|
|
2376
|
-
eventStyles: this.eventStyles,
|
|
2377
|
-
changes: changes
|
|
2378
|
-
});
|
|
2406
|
+
/**
|
|
2407
|
+
* The names of the model fields from which the Scheduler will read its data
|
|
2408
|
+
* ([see example]({% slug databinding_scheduler %}#toc-binding-to-models)).
|
|
2409
|
+
*/
|
|
2410
|
+
set modelFields(value) {
|
|
2411
|
+
this._modelFields = Object.assign({}, defaultModelFields, value);
|
|
2379
2412
|
}
|
|
2380
|
-
get
|
|
2381
|
-
|
|
2382
|
-
const workWeekStart = isPresent(this.workWeekStart) ? this.workWeekStart : (end + 1) % DAYS_IN_WEEK;
|
|
2383
|
-
const weekEnd = start > 0 ? start - 1 : Day.Saturday;
|
|
2384
|
-
const workWeekEnd = isPresent(this.workWeekEnd) ? this.workWeekEnd : weekEnd;
|
|
2385
|
-
return { start: workWeekStart, end: workWeekEnd };
|
|
2413
|
+
get modelFields() {
|
|
2414
|
+
return this._modelFields;
|
|
2386
2415
|
}
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
|
|
2416
|
+
ngOnInit() {
|
|
2417
|
+
if (!this.selectedDate) {
|
|
2418
|
+
this.selectedDate = todayDate();
|
|
2419
|
+
}
|
|
2420
|
+
}
|
|
2421
|
+
ngAfterContentInit() {
|
|
2422
|
+
if (isDevMode() && this.views.length === 0) {
|
|
2423
|
+
throw new Error('No views declared for <kendo-scheduler>. Please, declare at least one view.');
|
|
2424
|
+
}
|
|
2425
|
+
this.subs = this.views.changes.subscribe(() => this.resetViewIndex());
|
|
2426
|
+
this.subs.add(this.intlService.changes.subscribe(this.intlChange.bind(this)));
|
|
2427
|
+
this.subs.add(this.viewState.nextDate.subscribe(nextDate => {
|
|
2428
|
+
this.selectedDate = nextDate;
|
|
2429
|
+
}));
|
|
2430
|
+
this.subs.add(this.viewState.dateRange.subscribe(dateRange => {
|
|
2431
|
+
const isEmpty = dateRange.start.getTime() === 0;
|
|
2432
|
+
if (!isEmpty) {
|
|
2433
|
+
const args = new DateChangeEvent(this, this.selectedDate, dateRange);
|
|
2434
|
+
this.dateChange.emit(args);
|
|
2435
|
+
}
|
|
2436
|
+
}));
|
|
2437
|
+
this.subs.add(this.viewState.navigate.subscribe(({ viewName, date }) => {
|
|
2438
|
+
const views = this.views.toArray();
|
|
2439
|
+
const view = views.find(v => v.name === viewName);
|
|
2440
|
+
const args = new NavigateEvent(this, {
|
|
2441
|
+
type: 'show-date',
|
|
2442
|
+
view: view || {
|
|
2443
|
+
name: viewName,
|
|
2444
|
+
title: viewName
|
|
2445
|
+
},
|
|
2446
|
+
date: date
|
|
2447
|
+
});
|
|
2448
|
+
this.navigate.next(args);
|
|
2449
|
+
if (view && !args.isDefaultPrevented()) {
|
|
2450
|
+
const index = views.indexOf(view);
|
|
2451
|
+
this.selectedView = view;
|
|
2452
|
+
this.setViewIndex(index);
|
|
2453
|
+
this.selectedDate = date;
|
|
2454
|
+
}
|
|
2455
|
+
}));
|
|
2456
|
+
this.subs.add(this.viewState.viewEvent.subscribe(({ name, args }) => {
|
|
2457
|
+
const emitter = this[name];
|
|
2458
|
+
const confirmedEmitter = this[`${name}Confirmed`];
|
|
2459
|
+
if (hasObservers(emitter) || (confirmedEmitter && hasObservers(confirmedEmitter))) {
|
|
2460
|
+
this.zone.run(() => {
|
|
2461
|
+
const eventInstance = new VIEW_EVENT_MAP[name](this, args);
|
|
2462
|
+
emitter.emit(eventInstance);
|
|
2463
|
+
args.prevented = eventInstance.prevented;
|
|
2464
|
+
if (confirmedEmitter && !args.prevented) {
|
|
2465
|
+
confirmedEmitter.emit(eventInstance);
|
|
2466
|
+
}
|
|
2467
|
+
});
|
|
2468
|
+
}
|
|
2469
|
+
}));
|
|
2470
|
+
this.subs.add(this.viewState.layoutEnd.subscribe(() => {
|
|
2471
|
+
if (this.resizeSensor) {
|
|
2472
|
+
this.resizeSensor.acceptSize();
|
|
2473
|
+
}
|
|
2474
|
+
}));
|
|
2475
|
+
this.subs.add(this.viewState.slotSelectionStart
|
|
2476
|
+
.subscribe((e) => {
|
|
2477
|
+
if (hasObservers(this.slotDragStart)) {
|
|
2478
|
+
this.zone.run(() => {
|
|
2479
|
+
this.slotDragStart.emit(Object.assign(e, { sender: this }));
|
|
2480
|
+
});
|
|
2481
|
+
}
|
|
2482
|
+
}));
|
|
2483
|
+
this.subs.add(this.viewState.slotSelectionDrag
|
|
2484
|
+
.subscribe((value) => {
|
|
2485
|
+
if (hasObservers(this.slotDrag)) {
|
|
2486
|
+
this.zone.run(() => {
|
|
2487
|
+
this.slotDrag.emit(new SlotDragEvent(this, value));
|
|
2488
|
+
});
|
|
2489
|
+
}
|
|
2490
|
+
}));
|
|
2491
|
+
this.subs.add(this.viewState.slotSelectionEnd
|
|
2492
|
+
.subscribe((value) => {
|
|
2493
|
+
if (hasObservers(this.slotDragEnd)) {
|
|
2494
|
+
this.zone.run(() => {
|
|
2495
|
+
this.slotDragEnd.emit(new SlotDragEndEvent(this, value));
|
|
2496
|
+
});
|
|
2497
|
+
}
|
|
2498
|
+
}));
|
|
2391
2499
|
this.onViewIndexChange();
|
|
2500
|
+
this.notifyOptionsChange = this.notifyOptionsChange.bind(this);
|
|
2501
|
+
this.subs.add(this.allDayEventTemplate.changes.subscribe(this.notifyOptionsChange));
|
|
2502
|
+
this.subs.add(this.eventTemplate.changes.subscribe(this.notifyOptionsChange));
|
|
2503
|
+
this.subs.add(this.timeSlotTemplate.changes.subscribe(this.notifyOptionsChange));
|
|
2504
|
+
this.subs.add(this.timeSlotTemplate.changes.subscribe(this.notifyOptionsChange));
|
|
2505
|
+
this.subs.add(this.minorTimeHeaderTemplate.changes.subscribe(this.notifyOptionsChange));
|
|
2506
|
+
this.subs.add(this.majorTimeHeaderTemplate.changes.subscribe(this.notifyOptionsChange));
|
|
2507
|
+
this.subs.add(this.monthDaySlotTemplate.changes.subscribe(this.notifyOptionsChange));
|
|
2508
|
+
this.subs.add(this.dateHeaderTemplate.changes.subscribe(this.notifyOptionsChange));
|
|
2509
|
+
this.subs.add(this.allDaySlotTemplate.changes.subscribe(this.notifyOptionsChange));
|
|
2510
|
+
this.subs.add(this.groupHeaderTemplate.changes.subscribe(this.notifyOptionsChange));
|
|
2511
|
+
this.subs.add(this.agendaDateTemplate.changes.subscribe(this.notifyOptionsChange));
|
|
2512
|
+
this.subs.add(this.agendaTimeTemplate.changes.subscribe(this.notifyOptionsChange));
|
|
2513
|
+
this.subs.add(this.views.changes.subscribe(() => {
|
|
2514
|
+
this.changeDetector.markForCheck();
|
|
2515
|
+
}));
|
|
2516
|
+
//this.editService.timezone = this.timezone;
|
|
2517
|
+
this.attachEditHandlers();
|
|
2518
|
+
this.dialogsService.container = this.confirmationDialogContainerRef;
|
|
2519
|
+
this.notifyOptionsChange();
|
|
2520
|
+
this.subs.add(this.pdfService.exportClick.subscribe(() => {
|
|
2521
|
+
const args = new PDFExportEvent();
|
|
2522
|
+
this.pdfExport.emit(args);
|
|
2523
|
+
if (!args.isDefaultPrevented()) {
|
|
2524
|
+
this.saveAsPDF();
|
|
2525
|
+
}
|
|
2526
|
+
}));
|
|
2527
|
+
this.subs.add(this.pdfService.done.subscribe(() => {
|
|
2528
|
+
this.loadingComponent.toggle(false);
|
|
2529
|
+
}));
|
|
2530
|
+
this.subs.add(this.localization.changes.subscribe(({ rtl }) => {
|
|
2531
|
+
this.rtl = rtl;
|
|
2532
|
+
this.direction = this.rtl ? 'rtl' : 'ltr';
|
|
2533
|
+
}));
|
|
2534
|
+
this.subs.add(this.viewState.optionsChange.subscribe(() => {
|
|
2535
|
+
this.changeDetector.markForCheck();
|
|
2536
|
+
}));
|
|
2537
|
+
this.attachElementEventHandlers();
|
|
2392
2538
|
}
|
|
2393
|
-
|
|
2394
|
-
if (!this.
|
|
2395
|
-
|
|
2539
|
+
ngOnChanges(changes) {
|
|
2540
|
+
if (isChanged('resources', changes) && !isChanged('events', changes) && this.viewItems) {
|
|
2541
|
+
this.viewItems.forEach(item => {
|
|
2542
|
+
copyResources(item.event, this.resources);
|
|
2543
|
+
});
|
|
2396
2544
|
}
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
|
|
2545
|
+
if (anyChanged([
|
|
2546
|
+
'group', 'resources', 'min', 'max', 'showWorkHours', 'startTime', 'scrollTime', 'endTime', 'eventHeight',
|
|
2547
|
+
'workDayStart', 'workDayEnd', 'workWeekStart', 'workWeekEnd', 'weekStart', 'slotDuration', 'slotDivisions',
|
|
2548
|
+
'editable', 'timezone', 'slotClass', 'slotFill', 'columnWidth', 'eventClass', 'eventStyles', 'isSlotSelected', 'selectable'
|
|
2549
|
+
], changes)) {
|
|
2550
|
+
this.notifyOptionsChange(changes);
|
|
2401
2551
|
}
|
|
2402
2552
|
}
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
|
|
2407
|
-
|
|
2553
|
+
ngOnDestroy() {
|
|
2554
|
+
if (this.subs) {
|
|
2555
|
+
this.subs.unsubscribe();
|
|
2556
|
+
}
|
|
2557
|
+
if (this.detachElementEventHandlers) {
|
|
2558
|
+
this.detachElementEventHandlers();
|
|
2408
2559
|
}
|
|
2409
|
-
return changed;
|
|
2410
2560
|
}
|
|
2411
|
-
|
|
2412
|
-
|
|
2413
|
-
|
|
2414
|
-
|
|
2415
|
-
|
|
2416
|
-
.filter(event => !isRecurrenceMaster(event))
|
|
2417
|
-
.map(event => {
|
|
2418
|
-
const start = ZonedDate.fromLocalDate(event.start, timezone);
|
|
2419
|
-
const end = ZonedDate.fromLocalDate(event.end, timezone);
|
|
2420
|
-
return { start, end, event };
|
|
2421
|
-
});
|
|
2422
|
-
this.viewItems = items;
|
|
2423
|
-
this.viewContext.notifyItems(items);
|
|
2561
|
+
/**
|
|
2562
|
+
* @hidden
|
|
2563
|
+
*/
|
|
2564
|
+
onResize(_event) {
|
|
2565
|
+
this.viewContext.notifyResize();
|
|
2424
2566
|
}
|
|
2425
|
-
|
|
2426
|
-
|
|
2427
|
-
|
|
2567
|
+
/**
|
|
2568
|
+
* @hidden
|
|
2569
|
+
*/
|
|
2570
|
+
onNavigationAction(action) {
|
|
2571
|
+
const args = new NavigateEvent(this, action);
|
|
2572
|
+
this.navigate.next(args);
|
|
2573
|
+
if (args.isDefaultPrevented()) {
|
|
2574
|
+
return true;
|
|
2428
2575
|
}
|
|
2429
|
-
|
|
2430
|
-
|
|
2431
|
-
|
|
2432
|
-
|
|
2433
|
-
|
|
2434
|
-
case 'cancel':
|
|
2435
|
-
this.cancel.emit(args);
|
|
2436
|
-
break;
|
|
2437
|
-
case 'save':
|
|
2438
|
-
this.save.emit(args);
|
|
2439
|
-
break;
|
|
2440
|
-
default: break;
|
|
2576
|
+
if (action.type === 'view-change') {
|
|
2577
|
+
const views = this.views.toArray();
|
|
2578
|
+
const index = views.indexOf(action.view);
|
|
2579
|
+
this.selectedView = action.view;
|
|
2580
|
+
this.setViewIndex(index);
|
|
2441
2581
|
}
|
|
2442
|
-
|
|
2443
|
-
|
|
2444
|
-
|
|
2445
|
-
|
|
2446
|
-
if (!isPresent(this.workWeekStart) || !isPresent(this.workWeekEnd)) {
|
|
2447
|
-
this.notifyOptionsChange();
|
|
2582
|
+
else if (action.type === 'select-date') {
|
|
2583
|
+
if (this.isInRange(action.date)) {
|
|
2584
|
+
this.selectedDate = action.date;
|
|
2585
|
+
}
|
|
2448
2586
|
}
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
-
|
|
2452
|
-
|
|
2587
|
+
else if (action.type === 'today') {
|
|
2588
|
+
const date = new Date();
|
|
2589
|
+
if (this.isInRange(date)) {
|
|
2590
|
+
this.selectedDate = date;
|
|
2591
|
+
}
|
|
2453
2592
|
}
|
|
2454
2593
|
else {
|
|
2455
|
-
this.
|
|
2594
|
+
this.viewContext.notifyAction(action);
|
|
2456
2595
|
}
|
|
2457
2596
|
}
|
|
2458
|
-
|
|
2459
|
-
|
|
2460
|
-
|
|
2597
|
+
/**
|
|
2598
|
+
* Creates a popup editor for the new event.
|
|
2599
|
+
*
|
|
2600
|
+
* @param group - The [`FormGroup`](https://angular.io/docs/ts/latest/api/forms/index/FormGroup-class.html) that describes
|
|
2601
|
+
* the edit form. If called with a data item, the parameter will build the `FormGroup` from the data item fields.
|
|
2602
|
+
*/
|
|
2603
|
+
addEvent(group) {
|
|
2604
|
+
const isFormGroup = group instanceof FormGroup;
|
|
2605
|
+
if (!isFormGroup) {
|
|
2606
|
+
const createControl = (source) => (acc, key) => {
|
|
2607
|
+
acc[key] = new FormControl(source[key]);
|
|
2608
|
+
return acc;
|
|
2609
|
+
};
|
|
2610
|
+
const fields = Object.keys(group).reduce(createControl(group), {});
|
|
2611
|
+
group = new FormGroup(fields);
|
|
2461
2612
|
}
|
|
2462
|
-
|
|
2613
|
+
this.editService.addEvent(group);
|
|
2614
|
+
}
|
|
2615
|
+
/**
|
|
2616
|
+
* Switches the specified event in edit mode.
|
|
2617
|
+
*
|
|
2618
|
+
* @param dataItem - The event that will be switched to edit mode.
|
|
2619
|
+
* @param options - An object which contains the form `group` that will be bound in the edit dialog and the current edit `mode`.
|
|
2620
|
+
*
|
|
2621
|
+
*/
|
|
2622
|
+
editEvent(dataItem, options = {}) {
|
|
2623
|
+
const { group, mode } = options;
|
|
2624
|
+
this.editService.editEvent(dataItem, group, mode);
|
|
2625
|
+
}
|
|
2626
|
+
/**
|
|
2627
|
+
* Closes the event editor, if open.
|
|
2628
|
+
*/
|
|
2629
|
+
closeEvent() {
|
|
2630
|
+
this.editService.close();
|
|
2631
|
+
}
|
|
2632
|
+
/**
|
|
2633
|
+
* Returns a flag which indicates if an event is currently edited.
|
|
2634
|
+
*
|
|
2635
|
+
* @return {boolean} - A flag which indicates if an event is currently edited.
|
|
2636
|
+
*/
|
|
2637
|
+
isEditing() {
|
|
2638
|
+
return this.editService.isEditing();
|
|
2639
|
+
}
|
|
2640
|
+
/**
|
|
2641
|
+
* Opens the built-in confirmation dialog for defining the edit mode
|
|
2642
|
+
* that will be used when the user edits or removes a recurring event.
|
|
2643
|
+
*
|
|
2644
|
+
* @param operation - The type of operation that will be confirmed. Has to be either **Edit** or **Remove**.
|
|
2645
|
+
*
|
|
2646
|
+
* @return {Observable<EditMode>}
|
|
2647
|
+
*/
|
|
2648
|
+
openRecurringConfirmationDialog(operation) {
|
|
2649
|
+
return this.dialogsService.openRecurringConfirmationDialog(operation);
|
|
2650
|
+
}
|
|
2651
|
+
/**
|
|
2652
|
+
* Opens the built-in removal confirmation dialog.
|
|
2653
|
+
*
|
|
2654
|
+
* @return {Observable<boolean>}
|
|
2655
|
+
*/
|
|
2656
|
+
openRemoveConfirmationDialog() {
|
|
2657
|
+
return this.dialogsService.openRemoveConfirmationDialog();
|
|
2658
|
+
}
|
|
2659
|
+
/**
|
|
2660
|
+
* Saves the current view as PDF.
|
|
2661
|
+
*/
|
|
2662
|
+
saveAsPDF() {
|
|
2663
|
+
this.loadingComponent.toggle(true);
|
|
2463
2664
|
this.zone.runOutsideAngular(() => {
|
|
2464
|
-
|
|
2465
|
-
|
|
2466
|
-
|
|
2467
|
-
|
|
2468
|
-
|
|
2469
|
-
});
|
|
2470
|
-
const keydownSubscription = this.renderer.listen(wrapper, 'keydown', args => {
|
|
2471
|
-
this.domEvents.keydown.emit(args);
|
|
2472
|
-
});
|
|
2473
|
-
let focused = false;
|
|
2474
|
-
const focusInSubscription = this.renderer.listen(wrapper, 'focusin', (args) => {
|
|
2475
|
-
this.domEvents.focus.emit(args);
|
|
2476
|
-
if (!focused) {
|
|
2477
|
-
this.domEvents.focusIn.emit(args);
|
|
2478
|
-
this.renderer.addClass(this.wrapper.nativeElement, 'k-state-focused');
|
|
2479
|
-
focused = true;
|
|
2480
|
-
}
|
|
2481
|
-
});
|
|
2482
|
-
const focusOutSubscription = this.renderer.listen(wrapper, 'focusout', (args) => {
|
|
2483
|
-
const next = args.relatedTarget || document.activeElement;
|
|
2484
|
-
const outside = !closest(next, (node) => node === wrapper);
|
|
2485
|
-
if (outside) {
|
|
2486
|
-
this.domEvents.focusOut.emit(args);
|
|
2487
|
-
this.renderer.removeClass(this.wrapper.nativeElement, 'k-state-focused');
|
|
2488
|
-
focused = false;
|
|
2489
|
-
}
|
|
2490
|
-
});
|
|
2491
|
-
this.detachElementEventHandlers = () => {
|
|
2492
|
-
windowBlurSubscription();
|
|
2493
|
-
clickSubscription();
|
|
2494
|
-
keydownSubscription();
|
|
2495
|
-
focusInSubscription();
|
|
2496
|
-
focusOutSubscription();
|
|
2497
|
-
};
|
|
2665
|
+
// wait a tick in order for the loading element style to be updated by the browser.
|
|
2666
|
+
// if the export is synchronous, the browser will not update the element before the export is finished.
|
|
2667
|
+
setTimeout(() => {
|
|
2668
|
+
this.pdfService.save();
|
|
2669
|
+
}, 0);
|
|
2498
2670
|
});
|
|
2499
2671
|
}
|
|
2500
|
-
|
|
2501
|
-
|
|
2502
|
-
|
|
2503
|
-
|
|
2504
|
-
|
|
2505
|
-
|
|
2506
|
-
|
|
2507
|
-
|
|
2508
|
-
|
|
2509
|
-
|
|
2510
|
-
|
|
2511
|
-
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
|
|
2516
|
-
|
|
2517
|
-
|
|
2518
|
-
|
|
2519
|
-
|
|
2520
|
-
|
|
2521
|
-
|
|
2522
|
-
|
|
2523
|
-
|
|
2524
|
-
|
|
2525
|
-
|
|
2526
|
-
|
|
2527
|
-
|
|
2528
|
-
|
|
2529
|
-
|
|
2530
|
-
|
|
2531
|
-
|
|
2532
|
-
|
|
2533
|
-
|
|
2534
|
-
|
|
2535
|
-
|
|
2536
|
-
|
|
2537
|
-
|
|
2538
|
-
|
|
2539
|
-
|
|
2540
|
-
|
|
2541
|
-
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
|
|
2550
|
-
|
|
2551
|
-
|
|
2552
|
-
|
|
2553
|
-
|
|
2554
|
-
|
|
2555
|
-
|
|
2556
|
-
|
|
2557
|
-
|
|
2558
|
-
|
|
2559
|
-
|
|
2560
|
-
|
|
2561
|
-
|
|
2562
|
-
|
|
2563
|
-
|
|
2564
|
-
|
|
2565
|
-
|
|
2566
|
-
|
|
2567
|
-
|
|
2568
|
-
|
|
2569
|
-
|
|
2570
|
-
|
|
2571
|
-
|
|
2572
|
-
|
|
2573
|
-
|
|
2574
|
-
|
|
2575
|
-
|
|
2576
|
-
|
|
2577
|
-
|
|
2578
|
-
|
|
2579
|
-
|
|
2580
|
-
|
|
2581
|
-
|
|
2582
|
-
|
|
2583
|
-
|
|
2584
|
-
|
|
2585
|
-
|
|
2672
|
+
/**
|
|
2673
|
+
* Scrolls the view to the specified time.
|
|
2674
|
+
*/
|
|
2675
|
+
scrollToTime(time) {
|
|
2676
|
+
this.viewContext.notifyAction({
|
|
2677
|
+
type: 'scroll-time',
|
|
2678
|
+
time: time
|
|
2679
|
+
});
|
|
2680
|
+
}
|
|
2681
|
+
/**
|
|
2682
|
+
* Returns the current view slot that matches the passed document position.
|
|
2683
|
+
*
|
|
2684
|
+
* @param x - The x document position.
|
|
2685
|
+
* @param y - The y document position.
|
|
2686
|
+
*
|
|
2687
|
+
* @return {SchedulerSlot} - The slot.
|
|
2688
|
+
*
|
|
2689
|
+
* {% embed_file drag-and-drop/app.component.ts %}
|
|
2690
|
+
* {% embed_file drag-and-drop/draggable.directive.ts %}
|
|
2691
|
+
* {% embed_file drag-and-drop/app.module.ts %}
|
|
2692
|
+
* {% embed_file shared/main.ts %}
|
|
2693
|
+
*/
|
|
2694
|
+
slotByPosition(x, y) {
|
|
2695
|
+
return this.viewContext.executeMethod('slotByPosition', { x, y });
|
|
2696
|
+
}
|
|
2697
|
+
/**
|
|
2698
|
+
* Returns the event associated with the specified DOM element, if any.
|
|
2699
|
+
*
|
|
2700
|
+
* @param element - The DOM element document position.
|
|
2701
|
+
* @return the event instance, if found.
|
|
2702
|
+
*/
|
|
2703
|
+
eventFromElement(element) {
|
|
2704
|
+
return this.viewContext.executeMethod('eventFromElement', { element });
|
|
2705
|
+
}
|
|
2706
|
+
/**
|
|
2707
|
+
* Gets the currently active event, if any.
|
|
2708
|
+
* The active event is the event that can currently receive focus.
|
|
2709
|
+
*/
|
|
2710
|
+
get activeEvent() {
|
|
2711
|
+
const activeElement = this.focusService.activeElement;
|
|
2712
|
+
if (activeElement) {
|
|
2713
|
+
return this.eventFromElement(activeElement.nativeElement);
|
|
2714
|
+
}
|
|
2715
|
+
}
|
|
2716
|
+
/**
|
|
2717
|
+
* Focuses the next event or an event at a specified relative position.
|
|
2718
|
+
* The `options` parameter can be used to set a positive or negative offset
|
|
2719
|
+
* that is relative to the currently focused event.
|
|
2720
|
+
* A `nowrap` flag toggles the wrapping to the first or to the last item.
|
|
2721
|
+
*
|
|
2722
|
+
* @example
|
|
2723
|
+
* ```ts-no-run
|
|
2724
|
+
* scheduler.focusNext(); // Focuses the next event.
|
|
2725
|
+
* scheduler.focusNext({ offset: 1 }); // Focuses the next event.
|
|
2726
|
+
* scheduler.focusNext({ offset: -1 }); // Focuses the previous event.
|
|
2727
|
+
* scheduler.focusNext({ nowrap: true }); // If the focus is on the last event, does not move the focus to the first event.
|
|
2728
|
+
* ```
|
|
2729
|
+
*
|
|
2730
|
+
* @param position The relative position of the event to focus.
|
|
2731
|
+
* @returns `true` if the focused event changed. Otherwise, returns `false`.
|
|
2732
|
+
*/
|
|
2733
|
+
focusNext(position) {
|
|
2734
|
+
return this.focusService.focusNext(position);
|
|
2735
|
+
}
|
|
2736
|
+
/**
|
|
2737
|
+
* Focuses the previous event or an event at a specified relative position.
|
|
2738
|
+
* The `options` parameter can be used to set a positive or negative offset
|
|
2739
|
+
* that is relative to the currently focused event.
|
|
2740
|
+
* A `nowrap` flag toggles the wrapping to the first or to the last item.
|
|
2741
|
+
*
|
|
2742
|
+
* @example
|
|
2743
|
+
* ```ts-no-run
|
|
2744
|
+
* scheduler.focusPrev(); // Focuses the previous event
|
|
2745
|
+
* scheduler.focusPrev({ nowrap: true }); // Does not move the focus to the last event, if focus is on the first one.
|
|
2746
|
+
* ```
|
|
2747
|
+
*
|
|
2748
|
+
* @param position The relative position of the event to focus.
|
|
2749
|
+
* @returns `true` if the focused event changed. Otherwise, returns `false`.
|
|
2750
|
+
*/
|
|
2751
|
+
focusPrev(position) {
|
|
2752
|
+
const prevPosition = Object.assign({ offset: -1 }, position);
|
|
2753
|
+
return this.focusService.focusNext(prevPosition);
|
|
2754
|
+
}
|
|
2755
|
+
/**
|
|
2756
|
+
* Focuses the last focused event or the Scheduler element, if no events are available.
|
|
2757
|
+
*/
|
|
2758
|
+
focus() {
|
|
2759
|
+
return this.focusService.focus();
|
|
2760
|
+
}
|
|
2761
|
+
isInRange(date) {
|
|
2762
|
+
return (!this.min || this.min <= date) && (!this.max || date <= this.max);
|
|
2763
|
+
}
|
|
2764
|
+
notifyOptionsChange(changes) {
|
|
2765
|
+
const workweek = this.workWeek;
|
|
2766
|
+
this.viewContext.notifyOptionsChange({
|
|
2767
|
+
group: this.group,
|
|
2768
|
+
resources: this.resources,
|
|
2769
|
+
allDayEventTemplate: this.allDayEventTemplate ? this.allDayEventTemplate.first : null,
|
|
2770
|
+
eventTemplate: this.eventTemplate ? this.eventTemplate.first : null,
|
|
2771
|
+
timeSlotTemplate: this.timeSlotTemplate ? this.timeSlotTemplate.first : null,
|
|
2772
|
+
minorTimeHeaderTemplate: this.minorTimeHeaderTemplate ? this.minorTimeHeaderTemplate.first : null,
|
|
2773
|
+
majorTimeHeaderTemplate: this.majorTimeHeaderTemplate ? this.majorTimeHeaderTemplate.first : null,
|
|
2774
|
+
monthDaySlotTemplate: this.monthDaySlotTemplate ? this.monthDaySlotTemplate.first : null,
|
|
2775
|
+
dateHeaderTemplate: this.dateHeaderTemplate ? this.dateHeaderTemplate.first : null,
|
|
2776
|
+
allDaySlotTemplate: this.allDaySlotTemplate ? this.allDaySlotTemplate.first : null,
|
|
2777
|
+
groupHeaderTemplate: this.groupHeaderTemplate ? this.groupHeaderTemplate.first : null,
|
|
2778
|
+
agendaDateTemplate: this.agendaDateTemplate ? this.agendaDateTemplate.first : null,
|
|
2779
|
+
agendaTimeTemplate: this.agendaTimeTemplate ? this.agendaTimeTemplate.first : null,
|
|
2780
|
+
min: this.min,
|
|
2781
|
+
max: this.max,
|
|
2782
|
+
showWorkHours: this.showWorkHours,
|
|
2783
|
+
startTime: this.startTime,
|
|
2784
|
+
scrollTime: this.scrollTime,
|
|
2785
|
+
endTime: this.endTime,
|
|
2786
|
+
workDayStart: this.workDayStart,
|
|
2787
|
+
workDayEnd: this.workDayEnd,
|
|
2788
|
+
workWeekStart: workweek.start,
|
|
2789
|
+
workWeekEnd: workweek.end,
|
|
2790
|
+
weekStart: this.weekStart,
|
|
2791
|
+
slotDuration: this.slotDuration,
|
|
2792
|
+
slotDivisions: this.slotDivisions,
|
|
2793
|
+
eventHeight: this.eventHeight,
|
|
2794
|
+
editable: this.editable,
|
|
2795
|
+
selectable: this.selectable,
|
|
2796
|
+
timezone: this.timezone,
|
|
2797
|
+
currentTimeMarker: this.currentTimeMarker,
|
|
2798
|
+
slotClass: this.slotClass,
|
|
2799
|
+
slotFill: this.slotFill,
|
|
2800
|
+
columnWidth: this.columnWidth,
|
|
2801
|
+
eventClass: this.eventClass,
|
|
2802
|
+
eventStyles: this.eventStyles,
|
|
2803
|
+
isSlotSelected: this.isSlotSelected,
|
|
2804
|
+
changes: changes
|
|
2805
|
+
});
|
|
2806
|
+
}
|
|
2807
|
+
get workWeek() {
|
|
2808
|
+
let { start, end } = this.intlService.weekendRange();
|
|
2809
|
+
const workWeekStart = isPresent(this.workWeekStart) ? this.workWeekStart : (end + 1) % DAYS_IN_WEEK;
|
|
2810
|
+
const weekEnd = start > 0 ? start - 1 : Day.Saturday;
|
|
2811
|
+
const workWeekEnd = isPresent(this.workWeekEnd) ? this.workWeekEnd : weekEnd;
|
|
2812
|
+
return { start: workWeekStart, end: workWeekEnd };
|
|
2813
|
+
}
|
|
2814
|
+
resetViewIndex() {
|
|
2815
|
+
const index = this.selectedViewIndex;
|
|
2816
|
+
const newIndex = Math.max(0, Math.min(index, this.views.length - 1));
|
|
2817
|
+
this.setViewIndex(newIndex);
|
|
2818
|
+
this.onViewIndexChange();
|
|
2819
|
+
}
|
|
2820
|
+
onViewIndexChange() {
|
|
2821
|
+
if (!this.views) {
|
|
2822
|
+
return;
|
|
2823
|
+
}
|
|
2824
|
+
const views = this.views.toArray();
|
|
2825
|
+
const selectedView = views[this.viewIndex];
|
|
2826
|
+
if (selectedView) {
|
|
2827
|
+
this.selectedView = selectedView;
|
|
2828
|
+
}
|
|
2829
|
+
}
|
|
2830
|
+
setViewIndex(newIndex) {
|
|
2831
|
+
const changed = this.selectedViewIndex !== newIndex;
|
|
2832
|
+
if (changed) {
|
|
2833
|
+
this.selectedViewIndex = newIndex;
|
|
2834
|
+
this.selectedViewIndexChange.emit(newIndex);
|
|
2835
|
+
}
|
|
2836
|
+
return changed;
|
|
2837
|
+
}
|
|
2838
|
+
processEvents(dataItems) {
|
|
2839
|
+
const timezone = this.timezone;
|
|
2840
|
+
const fields = this.modelFields;
|
|
2841
|
+
const items = dataItems
|
|
2842
|
+
.map(dataItem => readEvent(dataItem, fields, this.resources))
|
|
2843
|
+
.filter(event => !isRecurrenceMaster(event))
|
|
2844
|
+
.map(event => {
|
|
2845
|
+
const start = ZonedDate.fromLocalDate(event.start, timezone);
|
|
2846
|
+
const end = ZonedDate.fromLocalDate(event.end, timezone);
|
|
2847
|
+
return { start, end, event };
|
|
2848
|
+
});
|
|
2849
|
+
this.viewItems = items;
|
|
2850
|
+
this.viewContext.notifyItems(items);
|
|
2851
|
+
}
|
|
2852
|
+
attachEditHandlers() {
|
|
2853
|
+
if (!this.editService) {
|
|
2854
|
+
return;
|
|
2855
|
+
}
|
|
2856
|
+
this.subs.add(this.editService.changes.subscribe(this.emitCRUDEvent.bind(this)));
|
|
2857
|
+
}
|
|
2858
|
+
emitCRUDEvent(args) {
|
|
2859
|
+
Object.assign(args, { sender: this });
|
|
2860
|
+
switch (args.action) {
|
|
2861
|
+
case 'cancel':
|
|
2862
|
+
this.cancel.emit(args);
|
|
2863
|
+
break;
|
|
2864
|
+
case 'save':
|
|
2865
|
+
this.save.emit(args);
|
|
2866
|
+
break;
|
|
2867
|
+
default: break;
|
|
2868
|
+
}
|
|
2869
|
+
}
|
|
2870
|
+
intlChange() {
|
|
2871
|
+
const currentView = this.selectedView;
|
|
2872
|
+
this.selectedView = null;
|
|
2873
|
+
if (!isPresent(this.workWeekStart) || !isPresent(this.workWeekEnd)) {
|
|
2874
|
+
this.notifyOptionsChange();
|
|
2875
|
+
}
|
|
2876
|
+
this.changeDetector.detectChanges();
|
|
2877
|
+
this.selectedView = currentView;
|
|
2878
|
+
if (NgZone.isInAngularZone()) {
|
|
2879
|
+
this.changeDetector.markForCheck();
|
|
2880
|
+
}
|
|
2881
|
+
else {
|
|
2882
|
+
this.changeDetector.detectChanges();
|
|
2883
|
+
}
|
|
2884
|
+
}
|
|
2885
|
+
attachElementEventHandlers() {
|
|
2886
|
+
if (!isDocumentAvailable()) {
|
|
2887
|
+
return;
|
|
2888
|
+
}
|
|
2889
|
+
const wrapper = this.wrapper.nativeElement;
|
|
2890
|
+
this.zone.runOutsideAngular(() => {
|
|
2891
|
+
const windowBlurSubscription = this.renderer.listen('window', 'blur', (args) => {
|
|
2892
|
+
this.domEvents.windowBlur.emit(args);
|
|
2893
|
+
});
|
|
2894
|
+
const clickSubscription = this.renderer.listen(wrapper, 'click', (args) => {
|
|
2895
|
+
this.domEvents.click.emit(args);
|
|
2896
|
+
});
|
|
2897
|
+
const keydownSubscription = this.renderer.listen(wrapper, 'keydown', args => {
|
|
2898
|
+
this.domEvents.keydown.emit(args);
|
|
2899
|
+
});
|
|
2900
|
+
let focused = false;
|
|
2901
|
+
const focusInSubscription = this.renderer.listen(wrapper, 'focusin', (args) => {
|
|
2902
|
+
this.domEvents.focus.emit(args);
|
|
2903
|
+
if (!focused) {
|
|
2904
|
+
this.domEvents.focusIn.emit(args);
|
|
2905
|
+
this.renderer.addClass(this.wrapper.nativeElement, 'k-state-focused');
|
|
2906
|
+
focused = true;
|
|
2907
|
+
}
|
|
2908
|
+
});
|
|
2909
|
+
const focusOutSubscription = this.renderer.listen(wrapper, 'focusout', (args) => {
|
|
2910
|
+
const next = args.relatedTarget || document.activeElement;
|
|
2911
|
+
const outside = !closest(next, (node) => node === wrapper);
|
|
2912
|
+
if (outside) {
|
|
2913
|
+
this.domEvents.focusOut.emit(args);
|
|
2914
|
+
this.renderer.removeClass(this.wrapper.nativeElement, 'k-state-focused');
|
|
2915
|
+
focused = false;
|
|
2916
|
+
}
|
|
2917
|
+
});
|
|
2918
|
+
this.detachElementEventHandlers = () => {
|
|
2919
|
+
windowBlurSubscription();
|
|
2920
|
+
clickSubscription();
|
|
2921
|
+
keydownSubscription();
|
|
2922
|
+
focusInSubscription();
|
|
2923
|
+
focusOutSubscription();
|
|
2924
|
+
};
|
|
2925
|
+
});
|
|
2926
|
+
}
|
|
2927
|
+
};
|
|
2586
2928
|
__decorate([
|
|
2587
|
-
|
|
2588
|
-
|
|
2929
|
+
HostBinding('class.k-widget'),
|
|
2930
|
+
HostBinding('class.k-scheduler'),
|
|
2931
|
+
HostBinding('class.k-floatwrap'),
|
|
2932
|
+
__metadata("design:type", Boolean)
|
|
2933
|
+
], SchedulerComponent.prototype, "hostClasses", void 0);
|
|
2934
|
+
__decorate([
|
|
2935
|
+
HostBinding('class.k-rtl'),
|
|
2936
|
+
__metadata("design:type", Boolean)
|
|
2937
|
+
], SchedulerComponent.prototype, "rtl", void 0);
|
|
2938
|
+
__decorate([
|
|
2939
|
+
HostBinding('attr.dir'),
|
|
2940
|
+
__metadata("design:type", String),
|
|
2941
|
+
__metadata("design:paramtypes", [])
|
|
2942
|
+
], SchedulerComponent.prototype, "dir", null);
|
|
2943
|
+
__decorate([
|
|
2944
|
+
Input(),
|
|
2945
|
+
__metadata("design:type", Number),
|
|
2946
|
+
__metadata("design:paramtypes", [Number])
|
|
2947
|
+
], SchedulerComponent.prototype, "selectedViewIndex", null);
|
|
2948
|
+
__decorate([
|
|
2949
|
+
Input(),
|
|
2950
|
+
__metadata("design:type", Object)
|
|
2951
|
+
], SchedulerComponent.prototype, "editable", void 0);
|
|
2952
|
+
__decorate([
|
|
2953
|
+
Input(),
|
|
2954
|
+
__metadata("design:type", Boolean)
|
|
2955
|
+
], SchedulerComponent.prototype, "selectable", void 0);
|
|
2956
|
+
__decorate([
|
|
2957
|
+
Input(),
|
|
2958
|
+
__metadata("design:type", Date)
|
|
2959
|
+
], SchedulerComponent.prototype, "min", void 0);
|
|
2960
|
+
__decorate([
|
|
2961
|
+
Input(),
|
|
2962
|
+
__metadata("design:type", Date)
|
|
2963
|
+
], SchedulerComponent.prototype, "max", void 0);
|
|
2964
|
+
__decorate([
|
|
2965
|
+
Input(),
|
|
2966
|
+
__metadata("design:type", Number)
|
|
2967
|
+
], SchedulerComponent.prototype, "eventHeight", void 0);
|
|
2968
|
+
__decorate([
|
|
2969
|
+
Input(),
|
|
2970
|
+
__metadata("design:type", Number)
|
|
2971
|
+
], SchedulerComponent.prototype, "columnWidth", void 0);
|
|
2972
|
+
__decorate([
|
|
2973
|
+
Input(),
|
|
2974
|
+
__metadata("design:type", Boolean)
|
|
2975
|
+
], SchedulerComponent.prototype, "showWorkHours", void 0);
|
|
2976
|
+
__decorate([
|
|
2977
|
+
Input(),
|
|
2978
|
+
__metadata("design:type", String)
|
|
2979
|
+
], SchedulerComponent.prototype, "startTime", void 0);
|
|
2980
|
+
__decorate([
|
|
2981
|
+
Input(),
|
|
2982
|
+
__metadata("design:type", String)
|
|
2983
|
+
], SchedulerComponent.prototype, "endTime", void 0);
|
|
2984
|
+
__decorate([
|
|
2985
|
+
Input(),
|
|
2986
|
+
__metadata("design:type", String)
|
|
2987
|
+
], SchedulerComponent.prototype, "workDayStart", void 0);
|
|
2988
|
+
__decorate([
|
|
2989
|
+
Input(),
|
|
2990
|
+
__metadata("design:type", String)
|
|
2991
|
+
], SchedulerComponent.prototype, "workDayEnd", void 0);
|
|
2992
|
+
__decorate([
|
|
2993
|
+
Input(),
|
|
2994
|
+
__metadata("design:type", Number)
|
|
2995
|
+
], SchedulerComponent.prototype, "workWeekStart", void 0);
|
|
2996
|
+
__decorate([
|
|
2997
|
+
Input(),
|
|
2998
|
+
__metadata("design:type", Number)
|
|
2999
|
+
], SchedulerComponent.prototype, "workWeekEnd", void 0);
|
|
3000
|
+
__decorate([
|
|
3001
|
+
Input(),
|
|
3002
|
+
__metadata("design:type", Number),
|
|
3003
|
+
__metadata("design:paramtypes", [Number])
|
|
3004
|
+
], SchedulerComponent.prototype, "weekStart", null);
|
|
3005
|
+
__decorate([
|
|
3006
|
+
Input(),
|
|
3007
|
+
__metadata("design:type", Number)
|
|
3008
|
+
], SchedulerComponent.prototype, "slotDuration", void 0);
|
|
3009
|
+
__decorate([
|
|
3010
|
+
Input(),
|
|
3011
|
+
__metadata("design:type", Number)
|
|
3012
|
+
], SchedulerComponent.prototype, "slotDivisions", void 0);
|
|
3013
|
+
__decorate([
|
|
3014
|
+
Input(),
|
|
3015
|
+
__metadata("design:type", Number)
|
|
3016
|
+
], SchedulerComponent.prototype, "slotFill", void 0);
|
|
3017
|
+
__decorate([
|
|
3018
|
+
Input(),
|
|
3019
|
+
__metadata("design:type", Object)
|
|
2589
3020
|
], SchedulerComponent.prototype, "scrollTime", void 0);
|
|
2590
3021
|
__decorate([
|
|
2591
3022
|
Input(),
|
|
@@ -2635,6 +3066,10 @@ __decorate([
|
|
|
2635
3066
|
Input(),
|
|
2636
3067
|
__metadata("design:type", Function)
|
|
2637
3068
|
], SchedulerComponent.prototype, "eventStyles", void 0);
|
|
3069
|
+
__decorate([
|
|
3070
|
+
Input(),
|
|
3071
|
+
__metadata("design:type", Function)
|
|
3072
|
+
], SchedulerComponent.prototype, "isSlotSelected", void 0);
|
|
2638
3073
|
__decorate([
|
|
2639
3074
|
Output(),
|
|
2640
3075
|
__metadata("design:type", EventEmitter)
|
|
@@ -2707,6 +3142,18 @@ __decorate([
|
|
|
2707
3142
|
Output(),
|
|
2708
3143
|
__metadata("design:type", EventEmitter)
|
|
2709
3144
|
], SchedulerComponent.prototype, "dragEnd", void 0);
|
|
3145
|
+
__decorate([
|
|
3146
|
+
Output(),
|
|
3147
|
+
__metadata("design:type", EventEmitter)
|
|
3148
|
+
], SchedulerComponent.prototype, "slotDragStart", void 0);
|
|
3149
|
+
__decorate([
|
|
3150
|
+
Output(),
|
|
3151
|
+
__metadata("design:type", EventEmitter)
|
|
3152
|
+
], SchedulerComponent.prototype, "slotDrag", void 0);
|
|
3153
|
+
__decorate([
|
|
3154
|
+
Output(),
|
|
3155
|
+
__metadata("design:type", EventEmitter)
|
|
3156
|
+
], SchedulerComponent.prototype, "slotDragEnd", void 0);
|
|
2710
3157
|
__decorate([
|
|
2711
3158
|
Output(),
|
|
2712
3159
|
__metadata("design:type", EventEmitter)
|
|
@@ -2916,434 +3363,173 @@ SchedulerComponent = __decorate([
|
|
|
2916
3363
|
i18n-recurrenceEditorDailyRepeatEvery="kendo.scheduler.recurrenceEditorDailyRepeatEvery|The text similar to 'Repeat every' displayed in the scheduler recurrence editor."
|
|
2917
3364
|
recurrenceEditorDailyRepeatEvery='Repeat every'
|
|
2918
3365
|
|
|
2919
|
-
i18n-recurrenceEditorWeeklyInterval="kendo.scheduler.recurrenceEditorWeeklyInterval|The text similar to 'week(s)' displayed in the scheduler recurrence editor."
|
|
2920
|
-
recurrenceEditorWeeklyInterval='week(s)'
|
|
2921
|
-
|
|
2922
|
-
i18n-recurrenceEditorWeeklyRepeatEvery="kendo.scheduler.recurrenceEditorWeeklyRepeatEvery|The text similar to 'Repeat every' displayed in the scheduler recurrence editor."
|
|
2923
|
-
recurrenceEditorWeeklyRepeatEvery='Repeat every'
|
|
2924
|
-
|
|
2925
|
-
i18n-recurrenceEditorWeeklyRepeatOn="kendo.scheduler.recurrenceEditorWeeklyRepeatOn|The text similar to 'Repeat on' displayed in the scheduler recurrence editor."
|
|
2926
|
-
recurrenceEditorWeeklyRepeatOn='Repeat on'
|
|
2927
|
-
|
|
2928
|
-
i18n-recurrenceEditorMonthlyDay="kendo.scheduler.recurrenceEditorMonthlyDay|The text similar to 'Day' displayed in the scheduler recurrence editor."
|
|
2929
|
-
recurrenceEditorMonthlyDay='Day'
|
|
2930
|
-
|
|
2931
|
-
i18n-recurrenceEditorMonthlyInterval="kendo.scheduler.recurrenceEditorMonthlyInterval|The text similar to 'month(s)' displayed in the scheduler recurrence editor."
|
|
2932
|
-
recurrenceEditorMonthlyInterval='month(s)'
|
|
2933
|
-
|
|
2934
|
-
i18n-recurrenceEditorMonthlyRepeatEvery="kendo.scheduler.recurrenceEditorMonthlyRepeatEvery|The text similar to 'Repeat every' displayed in the scheduler recurrence editor."
|
|
2935
|
-
recurrenceEditorMonthlyRepeatEvery='Repeat every'
|
|
2936
|
-
|
|
2937
|
-
i18n-recurrenceEditorMonthlyRepeatOn="kendo.scheduler.recurrenceEditorMonthlyRepeatOn|The text similar to 'Repeat on' displayed in the scheduler recurrence editor."
|
|
2938
|
-
recurrenceEditorMonthlyRepeatOn='Repeat on'
|
|
2939
|
-
|
|
2940
|
-
i18n-recurrenceEditorYearlyOf="kendo.scheduler.recurrenceEditorYearlyOf|The text similar to 'of' displayed in the scheduler recurrence editor."
|
|
2941
|
-
recurrenceEditorYearlyOf='of'
|
|
2942
|
-
|
|
2943
|
-
i18n-recurrenceEditorYearlyRepeatEvery="kendo.scheduler.recurrenceEditorYearlyRepeatEvery|The text similar to 'Repeat every' displayed in the scheduler recurrence editor."
|
|
2944
|
-
recurrenceEditorYearlyRepeatEvery='Repeat every'
|
|
2945
|
-
|
|
2946
|
-
i18n-recurrenceEditorYearlyRepeatOn="kendo.scheduler.recurrenceEditorYearlyRepeatOn|The text similar to 'Repeat on' displayed in the scheduler recurrence editor."
|
|
2947
|
-
recurrenceEditorYearlyRepeatOn='Repeat on'
|
|
2948
|
-
|
|
2949
|
-
i18n-recurrenceEditorYearlyInterval="kendo.scheduler.recurrenceEditorYearlyInterval|The text similar to 'year(s)' displayed in the scheduler recurrence editor."
|
|
2950
|
-
recurrenceEditorYearlyInterval='year(s)'
|
|
2951
|
-
|
|
2952
|
-
i18n-recurrenceEditorFrequenciesDaily="kendo.scheduler.recurrenceEditorFrequenciesDaily|The text similar to 'Daily' displayed in the scheduler recurrence editor."
|
|
2953
|
-
recurrenceEditorFrequenciesDaily='Daily'
|
|
2954
|
-
|
|
2955
|
-
i18n-recurrenceEditorFrequenciesMonthly="kendo.scheduler.recurrenceEditorFrequenciesMonthly|The text similar to 'Monthly' displayed in the scheduler recurrence editor."
|
|
2956
|
-
recurrenceEditorFrequenciesMonthly='Monthly'
|
|
2957
|
-
|
|
2958
|
-
i18n-recurrenceEditorFrequenciesNever="kendo.scheduler.recurrenceEditorFrequenciesNever|The text similar to 'Never' displayed in the scheduler recurrence editor."
|
|
2959
|
-
recurrenceEditorFrequenciesNever='Never'
|
|
2960
|
-
|
|
2961
|
-
i18n-recurrenceEditorFrequenciesWeekly="kendo.scheduler.recurrenceEditorFrequenciesWeekly|The text similar to 'Weekly' displayed in the scheduler recurrence editor."
|
|
2962
|
-
recurrenceEditorFrequenciesWeekly='Weekly'
|
|
2963
|
-
|
|
2964
|
-
i18n-recurrenceEditorFrequenciesYearly="kendo.scheduler.recurrenceEditorFrequenciesYearly|The text similar to 'Yearly' displayed in the scheduler recurrence editor."
|
|
2965
|
-
recurrenceEditorFrequenciesYearly='Yearly'
|
|
2966
|
-
|
|
2967
|
-
i18n-recurrenceEditorOffsetPositionsFirst="kendo.scheduler.recurrenceEditorOffsetPositionsFirst|The text similar to 'First' displayed in the scheduler recurrence editor."
|
|
2968
|
-
recurrenceEditorOffsetPositionsFirst='First'
|
|
2969
|
-
|
|
2970
|
-
i18n-recurrenceEditorOffsetPositionsSecond="kendo.scheduler.recurrenceEditorOffsetPositionsSecond|The text similar to 'Second' displayed in the scheduler recurrence editor."
|
|
2971
|
-
recurrenceEditorOffsetPositionsSecond='Second'
|
|
2972
|
-
|
|
2973
|
-
i18n-recurrenceEditorOffsetPositionsThird="kendo.scheduler.recurrenceEditorOffsetPositionsThird|The text similar to 'Third' displayed in the scheduler recurrence editor."
|
|
2974
|
-
recurrenceEditorOffsetPositionsThird='Third'
|
|
2975
|
-
|
|
2976
|
-
i18n-recurrenceEditorOffsetPositionsFourth="kendo.scheduler.recurrenceEditorOffsetPositionsFourth|The text similar to 'Fourth' displayed in the scheduler recurrence editor."
|
|
2977
|
-
recurrenceEditorOffsetPositionsFourth='Fourth'
|
|
2978
|
-
|
|
2979
|
-
i18n-recurrenceEditorOffsetPositionsLast="kendo.scheduler.recurrenceEditorOffsetPositionsLast|The text similar to 'Last' displayed in the scheduler recurrence editor."
|
|
2980
|
-
recurrenceEditorOffsetPositionsLast='Last'
|
|
2981
|
-
|
|
2982
|
-
i18n-recurrenceEditorWeekdaysDay="kendo.scheduler.recurrenceEditorWeekdaysDay|The text similar to 'Day' displayed in the repeat by section of the monthly recurrence pattern."
|
|
2983
|
-
recurrenceEditorWeekdaysDay='Day'
|
|
2984
|
-
|
|
2985
|
-
i18n-recurrenceEditorWeekdaysWeekday="kendo.scheduler.recurrenceEditorWeekdaysWeekday|The text similar to 'Weekday' displayed in the repeat by section of the monthly recurrence pattern."
|
|
2986
|
-
recurrenceEditorWeekdaysWeekday='Weekday'
|
|
2987
|
-
|
|
2988
|
-
i18n-recurrenceEditorWeekdaysWeekendday="kendo.scheduler.recurrenceEditorWeekdaysWeekendday|The text similar to 'Weekend Day' displayed in the repeat by section of the monthly recurrence pattern."
|
|
2989
|
-
recurrenceEditorWeekdaysWeekendday='Weekend Day'
|
|
2990
|
-
|
|
2991
|
-
i18n-recurrenceEditorEndAfter="kendo.scheduler.recurrenceEditorEndAfter|The text similar to 'After' displayed in the scheduler recurrence editor."
|
|
2992
|
-
recurrenceEditorEndAfter='After'
|
|
2993
|
-
|
|
2994
|
-
i18n-recurrenceEditorEndOccurrence="kendo.scheduler.recurrenceEditorEndOccurrence|The text similar to 'occurrence(s)' displayed in the scheduler recurrence editor."
|
|
2995
|
-
recurrenceEditorEndOccurrence='occurrence(s)'
|
|
2996
|
-
|
|
2997
|
-
i18n-recurrenceEditorEndLabel="kendo.scheduler.recurrenceEditorEndLabel|The text similar to 'End' displayed in the scheduler recurrence editor."
|
|
2998
|
-
recurrenceEditorEndLabel='End'
|
|
2999
|
-
|
|
3000
|
-
i18n-recurrenceEditorEndNever="kendo.scheduler.recurrenceEditorEndNever|The text similar to 'Never' displayed in the scheduler recurrence editor."
|
|
3001
|
-
recurrenceEditorEndNever='Never'
|
|
3002
|
-
|
|
3003
|
-
i18n-recurrenceEditorEndOn="kendo.scheduler.recurrenceEditorEndOn|The text similar to 'On' displayed in the scheduler recurrence editor."
|
|
3004
|
-
recurrenceEditorEndOn='On'
|
|
3005
|
-
|
|
3006
|
-
i18n-destroy="kendo.scheduler.destroy|The text of the 'Delete' button displayed in the scheduler remove confirmation dialog."
|
|
3007
|
-
destroy='Delete'
|
|
3008
|
-
|
|
3009
|
-
i18n-deleteConfirmation="kendo.scheduler.deleteConfirmation|The text similar to 'Are you sure you want to delete this event?' displayed in scheduler remove confirmation dialog."
|
|
3010
|
-
deleteConfirmation='Are you sure you want to delete this event?'
|
|
3011
|
-
|
|
3012
|
-
i18n-editRecurringConfirmation="kendo.scheduler.editRecurringConfirmation|The text similar to 'Do you want to edit only this event occurrence or the whole series?' displayed in the scheduler recurring confirmation dialog."
|
|
3013
|
-
editRecurringConfirmation='Do you want to edit only this event occurrence or the whole series?'
|
|
3014
|
-
|
|
3015
|
-
i18n-editOccurrence="kendo.scheduler.editOccurrence|The text of the 'Edit current occurrence' button displayed in the scheduler recurring confirmation dialog."
|
|
3016
|
-
editOccurrence='Edit current occurrence'
|
|
3017
|
-
|
|
3018
|
-
i18n-editSeries="kendo.scheduler.editSeries|The text of the 'Edit the series' button displayed in the scheduler recurring confirmation dialog."
|
|
3019
|
-
editSeries='Edit the series'
|
|
3020
|
-
|
|
3021
|
-
i18n-deleteRecurringConfirmation="kendo.scheduler.deleteRecurringConfirmation|The text similar to 'Do you want to delete only this event occurrence or the whole series?' displayed in the scheduler recurring confirmation dialog."
|
|
3022
|
-
deleteRecurringConfirmation='Do you want to delete only this event occurrence or the whole series?'
|
|
3023
|
-
|
|
3024
|
-
i18n-deleteOccurrence="kendo.scheduler.deleteOccurrence|The text of the 'Delete current occurrence' button displayed in the scheduler recurring confirmation dialog."
|
|
3025
|
-
deleteOccurrence='Delete current occurrence'
|
|
3026
|
-
|
|
3027
|
-
i18n-deleteSeries="kendo.scheduler.deleteSeries|The text similar of the 'Delete the series' button displayed in the scheduler recurring confirmation dialog."
|
|
3028
|
-
deleteSeries='Delete the series'
|
|
3029
|
-
|
|
3030
|
-
i18n-deleteDialogTitle="kendo.scheduler.deleteDialogTitle|The title of the remove confirmation dialog, similar to 'Delete Event'."
|
|
3031
|
-
deleteDialogTitle='Delete Event'
|
|
3032
|
-
|
|
3033
|
-
i18n-deleteRecurringDialogTitle="kendo.scheduler.deleteRecurringDialogTitle|The title of the recurring remove confirmation dialog, similar to 'Delete Recurring Item'"
|
|
3034
|
-
deleteRecurringDialogTitle='Delete Recurring Item'
|
|
3035
|
-
|
|
3036
|
-
i18n-editRecurringDialogTitle="kendo.scheduler.editRecurringDialogTitle|The title of the recurring edit confirmation dialog, similar to 'Edit Recurring Item'"
|
|
3037
|
-
editRecurringDialogTitle='Edit Recurring Item'
|
|
3038
|
-
>
|
|
3039
|
-
</ng-container>
|
|
3040
|
-
|
|
3041
|
-
<kendo-scheduler-toolbar
|
|
3042
|
-
[dateRange]="dateRangeStream"
|
|
3043
|
-
[selectedDate]="selectedDateStream"
|
|
3044
|
-
[views]="views"
|
|
3045
|
-
[selectedView]="selectedView"
|
|
3046
|
-
[template]="toolbarTemplate"
|
|
3047
|
-
(navigate)="onNavigationAction($event)"
|
|
3048
|
-
[min]="min"
|
|
3049
|
-
[max]="max"
|
|
3050
|
-
></kendo-scheduler-toolbar>
|
|
3051
|
-
|
|
3052
|
-
<ng-container *ngTemplateOutlet="selectedView?.template">
|
|
3053
|
-
</ng-container>
|
|
3054
|
-
|
|
3055
|
-
<ng-container #confirmationDialogContainer>
|
|
3056
|
-
</ng-container>
|
|
3057
|
-
|
|
3058
|
-
<kendo-scheduler-edit-dialog
|
|
3059
|
-
[resources]="resources"
|
|
3060
|
-
[editTemplate]="editDialogTemplate"
|
|
3061
|
-
[timezone]="timezone"
|
|
3062
|
-
[weekStart]="weekStart"
|
|
3063
|
-
[fields]="modelFields"
|
|
3064
|
-
></kendo-scheduler-edit-dialog>
|
|
3065
|
-
|
|
3066
|
-
<kendo-resize-sensor (resize)="onResize()"></kendo-resize-sensor>
|
|
3067
|
-
|
|
3068
|
-
<div [loading]="loading" kendoSchedulerLoading>
|
|
3069
|
-
</div>
|
|
3070
|
-
`
|
|
3071
|
-
}),
|
|
3072
|
-
__metadata("design:paramtypes", [ElementRef,
|
|
3073
|
-
ViewContextService,
|
|
3074
|
-
ViewStateService,
|
|
3075
|
-
EditService,
|
|
3076
|
-
DialogsService,
|
|
3077
|
-
IntlService,
|
|
3078
|
-
ChangeDetectorRef,
|
|
3079
|
-
NgZone,
|
|
3080
|
-
PDFService,
|
|
3081
|
-
LocalizationService,
|
|
3082
|
-
DomEventsService,
|
|
3083
|
-
Renderer2,
|
|
3084
|
-
FocusService])
|
|
3085
|
-
], SchedulerComponent);
|
|
3086
|
-
|
|
3087
|
-
/** @hidden */
|
|
3088
|
-
const intersects = (startTime, endTime, periodStart, periodEnd) => (startTime < periodStart && endTime > periodEnd) ||
|
|
3089
|
-
(periodStart <= startTime && startTime < periodEnd) ||
|
|
3090
|
-
(periodStart < endTime && endTime <= periodEnd && startTime < endTime);
|
|
3091
|
-
/** @hidden */
|
|
3092
|
-
const dateInRange = (date, start, end) => start.getTime() <= date.getTime() && date.getTime() <= end.getTime();
|
|
3093
|
-
/** @hidden */
|
|
3094
|
-
const roundAllDayEnd = ({ start, end }) => {
|
|
3095
|
-
const startDate = start.stripTime();
|
|
3096
|
-
const endDate = end.stripTime();
|
|
3097
|
-
return endDate.getTime() !== end.getTime() || startDate.getTime() === endDate.getTime() ? endDate.addDays(1) : endDate;
|
|
3098
|
-
};
|
|
3099
|
-
/** @hidden */
|
|
3100
|
-
function toInvariantTime(date) {
|
|
3101
|
-
var staticDate = new Date(1980, 0, 1, 0, 0, 0);
|
|
3102
|
-
if (date) {
|
|
3103
|
-
staticDate.setHours(date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds());
|
|
3104
|
-
}
|
|
3105
|
-
return staticDate;
|
|
3106
|
-
}
|
|
3107
|
-
/**
|
|
3108
|
-
* @hidden
|
|
3109
|
-
* TODO Move to date-math
|
|
3110
|
-
*/
|
|
3111
|
-
const addUTCDays = (date, offset) => {
|
|
3112
|
-
const newDate = new Date(date.getTime());
|
|
3113
|
-
newDate.setUTCDate(newDate.getUTCDate() + offset);
|
|
3114
|
-
return newDate;
|
|
3115
|
-
};
|
|
3116
|
-
// TODO: name? move to date-math
|
|
3117
|
-
/** @hidden */
|
|
3118
|
-
function toUTCTime(localDate, localTime) {
|
|
3119
|
-
return new Date(Date.UTC(localDate.getFullYear(), localDate.getMonth(), localDate.getDate(), localTime.getHours(), localTime.getMinutes(), localTime.getSeconds(), localTime.getMilliseconds()));
|
|
3120
|
-
}
|
|
3121
|
-
// TODO: move to date-math
|
|
3122
|
-
/** @hidden */
|
|
3123
|
-
function toUTCDate(localDate) {
|
|
3124
|
-
return new Date(Date.UTC(localDate.getFullYear(), localDate.getMonth(), localDate.getDate()));
|
|
3125
|
-
}
|
|
3126
|
-
// TODO: move to date-math
|
|
3127
|
-
/** @hidden */
|
|
3128
|
-
function getUTCDate(utcDate) {
|
|
3129
|
-
return new Date(Date.UTC(utcDate.getUTCFullYear(), utcDate.getUTCMonth(), utcDate.getUTCDate()));
|
|
3130
|
-
}
|
|
3131
|
-
// TODO: move to date-math
|
|
3132
|
-
/** @hidden */
|
|
3133
|
-
function toUTCDateTime(localDate) {
|
|
3134
|
-
return new Date(Date.UTC(localDate.getFullYear(), localDate.getMonth(), localDate.getDate(), localDate.getHours(), localDate.getMinutes(), localDate.getSeconds(), localDate.getMilliseconds()));
|
|
3135
|
-
}
|
|
3136
|
-
/** @hidden */
|
|
3137
|
-
function dateWithTime(target, time) {
|
|
3138
|
-
return new Date(target.getFullYear(), target.getMonth(), target.getDate(), time.getHours(), time.getMinutes());
|
|
3139
|
-
}
|
|
3140
|
-
function getDataIdx(value, resource) {
|
|
3141
|
-
const data = resource.data;
|
|
3142
|
-
for (let dataIdx = 0; dataIdx < data.length; dataIdx++) {
|
|
3143
|
-
if (getField(data[dataIdx], resource.valueField) === value) {
|
|
3144
|
-
return dataIdx;
|
|
3145
|
-
}
|
|
3146
|
-
}
|
|
3147
|
-
return -1;
|
|
3148
|
-
}
|
|
3149
|
-
function resourceItem(value, resource) {
|
|
3150
|
-
const index = getDataIdx(value, resource);
|
|
3151
|
-
return index >= 0 ? resource.data[index] : {};
|
|
3152
|
-
}
|
|
3153
|
-
function resourceItems(values, resource) {
|
|
3154
|
-
return values.map(value => resourceItem(value, resource));
|
|
3155
|
-
}
|
|
3156
|
-
function cloneResources(arr) {
|
|
3157
|
-
const result = [];
|
|
3158
|
-
for (let idx = 0; idx < arr.length; idx++) {
|
|
3159
|
-
const clone$$1 = Object.assign({}, arr[idx]);
|
|
3160
|
-
clone$$1.resources = clone$$1.resources.slice(0);
|
|
3161
|
-
result.push(clone$$1);
|
|
3162
|
-
}
|
|
3163
|
-
return result;
|
|
3164
|
-
}
|
|
3165
|
-
/** @hidden */
|
|
3166
|
-
function resourceItemByValue(event, resource) {
|
|
3167
|
-
const value = getField(event, resource.field);
|
|
3168
|
-
if (Array.isArray(value)) {
|
|
3169
|
-
return resourceItems(value, resource);
|
|
3170
|
-
}
|
|
3171
|
-
return resourceItem(value, resource);
|
|
3172
|
-
}
|
|
3173
|
-
function addNotGroupedResources(event, resources, allResources) {
|
|
3174
|
-
for (let resourceIdx = 0; resourceIdx < resources.length; resourceIdx++) {
|
|
3175
|
-
const current = resources[resourceIdx];
|
|
3176
|
-
for (let idx = 0; idx < allResources.length; idx++) {
|
|
3177
|
-
const item = allResources[idx];
|
|
3178
|
-
if (!current.resources[idx] && item.data) {
|
|
3179
|
-
current.resources[idx] = resourceItemByValue(event, item);
|
|
3180
|
-
}
|
|
3181
|
-
}
|
|
3182
|
-
}
|
|
3183
|
-
}
|
|
3184
|
-
/** @hidden */
|
|
3185
|
-
function eventResources(event, { taskResources, hasGroups, spans, allResources = [] }) {
|
|
3186
|
-
let resources = [];
|
|
3187
|
-
for (let resourceIdx = 0; resourceIdx < taskResources.length; resourceIdx++) {
|
|
3188
|
-
const resource = taskResources[resourceIdx];
|
|
3189
|
-
if (!resource.data) {
|
|
3190
|
-
resources = [{ leafIdx: 0, resources: [] }];
|
|
3191
|
-
continue;
|
|
3192
|
-
}
|
|
3193
|
-
const resourceIndex = allResources.indexOf(resource);
|
|
3194
|
-
let values = getField(event, resource.field);
|
|
3195
|
-
if (!Array.isArray(values)) {
|
|
3196
|
-
values = [values];
|
|
3197
|
-
}
|
|
3198
|
-
const expandedResources = [];
|
|
3199
|
-
for (let valueIdx = 0; valueIdx < values.length; valueIdx++) {
|
|
3200
|
-
const dataIdx = getDataIdx(values[valueIdx], resource);
|
|
3201
|
-
if (dataIdx < 0) {
|
|
3202
|
-
return [{ leafIdx: hasGroups ? -1 : 0, resources: [] }];
|
|
3203
|
-
}
|
|
3204
|
-
const item = resource.data[dataIdx];
|
|
3205
|
-
// has groups - need all copies of the multiple resource
|
|
3206
|
-
// no groups - just the first
|
|
3207
|
-
if (resourceIdx === 0 && (hasGroups || valueIdx === 0)) {
|
|
3208
|
-
const resourceItems = [];
|
|
3209
|
-
resourceItems[resourceIndex] = resource.multiple && !hasGroups ? [item] : item;
|
|
3210
|
-
resources.push({
|
|
3211
|
-
leafIdx: hasGroups ? dataIdx * spans[resourceIdx] : 0,
|
|
3212
|
-
color: getField(item, resource.colorField),
|
|
3213
|
-
resources: resourceItems
|
|
3214
|
-
});
|
|
3215
|
-
}
|
|
3216
|
-
else if (hasGroups) { // don't create multiple resource groups if no groups for multiple resources
|
|
3217
|
-
let currentResources = resources;
|
|
3218
|
-
if (values.length > 1) {
|
|
3219
|
-
currentResources = cloneResources(resources);
|
|
3220
|
-
expandedResources.push.apply(expandedResources, currentResources);
|
|
3221
|
-
}
|
|
3222
|
-
for (let currentIdx = 0; currentIdx < currentResources.length; currentIdx++) {
|
|
3223
|
-
currentResources[currentIdx].leafIdx += dataIdx * spans[resourceIdx];
|
|
3224
|
-
currentResources[currentIdx].resources[resourceIndex] = item;
|
|
3225
|
-
}
|
|
3226
|
-
}
|
|
3227
|
-
else if (valueIdx > 0) {
|
|
3228
|
-
for (let idx = 0; idx < resources.length; idx++) {
|
|
3229
|
-
resources[idx].resources[resourceIndex].push(item);
|
|
3230
|
-
}
|
|
3231
|
-
}
|
|
3232
|
-
}
|
|
3233
|
-
if (expandedResources.length) {
|
|
3234
|
-
resources = expandedResources;
|
|
3235
|
-
}
|
|
3236
|
-
}
|
|
3237
|
-
addNotGroupedResources(event, resources, allResources);
|
|
3238
|
-
return resources;
|
|
3239
|
-
}
|
|
3240
|
-
/** @hidden */
|
|
3241
|
-
function assignTasksResources(tasks, options) {
|
|
3242
|
-
for (let idx = 0; idx < tasks.length; idx++) {
|
|
3243
|
-
const task = tasks[idx];
|
|
3244
|
-
task.resources = eventResources(task.event, options);
|
|
3245
|
-
}
|
|
3246
|
-
}
|
|
3247
|
-
/** @hidden */
|
|
3248
|
-
function findRowIndex(events, data) {
|
|
3249
|
-
if (data.rowIndex !== undefined) {
|
|
3250
|
-
return data.rowIndex;
|
|
3251
|
-
}
|
|
3252
|
-
for (let idx = 0; idx < events.length; idx++) {
|
|
3253
|
-
if (!events[idx]) {
|
|
3254
|
-
return idx;
|
|
3255
|
-
}
|
|
3256
|
-
}
|
|
3257
|
-
return events.length;
|
|
3258
|
-
}
|
|
3259
|
-
/** @hidden */
|
|
3260
|
-
function isRecurrence(task) {
|
|
3261
|
-
return Boolean(task.event && task.event.recurrenceRule);
|
|
3262
|
-
}
|
|
3263
|
-
/** @hidden */
|
|
3264
|
-
function isRecurrenceException(task) {
|
|
3265
|
-
return task.event && isPresent(task.event.recurrenceId) && !task.event.recurrenceRule;
|
|
3266
|
-
}
|
|
3267
|
-
/** @hidden */
|
|
3268
|
-
const rectContains = (rect, left, top) => rect.left <= left && left <= rect.left + rect.width && rect.top <= top && top <= rect.top + rect.height;
|
|
3269
|
-
/** @hidden */
|
|
3270
|
-
const rectContainsX = (rect, left) => rect.left <= left && left <= rect.left + rect.width;
|
|
3271
|
-
/** @hidden */
|
|
3272
|
-
const toPx = value => `${value}px`;
|
|
3273
|
-
/** @hidden */
|
|
3274
|
-
const elementOffset = (element) => {
|
|
3275
|
-
if (!element) {
|
|
3276
|
-
return null;
|
|
3277
|
-
}
|
|
3278
|
-
const box = element.getBoundingClientRect();
|
|
3279
|
-
const documentElement = document.documentElement;
|
|
3280
|
-
return {
|
|
3281
|
-
top: box.top + (window.pageYOffset || documentElement.scrollTop) - (documentElement.clientTop || 0),
|
|
3282
|
-
left: box.left + (window.pageXOffset || documentElement.scrollLeft) - (documentElement.clientLeft || 0),
|
|
3283
|
-
width: box.width,
|
|
3284
|
-
height: box.height
|
|
3285
|
-
};
|
|
3286
|
-
};
|
|
3287
|
-
/** @hidden */
|
|
3288
|
-
const pointDistance = (x1, y1, x2, y2) => Math.sqrt(Math.pow(x1 - x2, 2) + Math.pow(y1 - y2, 2));
|
|
3289
|
-
/** @hidden */
|
|
3290
|
-
const ignoreContentChild = child => child.nodeName === 'KENDO-RESIZE-SENSOR' || hasClasses(child, 'k-loading-mask');
|
|
3291
|
-
/** @hidden */
|
|
3292
|
-
const setCoordinates = (element, coordinates) => {
|
|
3293
|
-
for (let field in coordinates) {
|
|
3294
|
-
if (coordinates.hasOwnProperty(field)) {
|
|
3295
|
-
element.style[field] = toPx(coordinates[field]);
|
|
3296
|
-
}
|
|
3297
|
-
}
|
|
3298
|
-
};
|
|
3299
|
-
/** @hidden */
|
|
3300
|
-
const convertNgClassBindings = (bindingValues) => {
|
|
3301
|
-
const result = [];
|
|
3302
|
-
if (isString(bindingValues)) {
|
|
3303
|
-
result.push(bindingValues);
|
|
3304
|
-
}
|
|
3305
|
-
else if (isArray(bindingValues)) {
|
|
3306
|
-
result.push.apply(result, bindingValues);
|
|
3307
|
-
}
|
|
3308
|
-
else if (isObject(bindingValues)) {
|
|
3309
|
-
for (let field in bindingValues) {
|
|
3310
|
-
if (bindingValues.hasOwnProperty(field) && bindingValues[field]) {
|
|
3311
|
-
result.push(field);
|
|
3312
|
-
}
|
|
3313
|
-
}
|
|
3314
|
-
}
|
|
3315
|
-
return result;
|
|
3316
|
-
};
|
|
3317
|
-
/**
|
|
3318
|
-
* @hidden
|
|
3319
|
-
*/
|
|
3320
|
-
function formatEventTime(start, end, isAllDay, localeId) {
|
|
3321
|
-
const startTimeFormat = { skeleton: 'yMMMMEEEEdhm' };
|
|
3322
|
-
const startDateFormat = { skeleton: 'yMMMMEEEEd' };
|
|
3323
|
-
const endFormat = isEqualDate(start, end) ? 't' : startTimeFormat;
|
|
3324
|
-
return isAllDay ?
|
|
3325
|
-
`${formatDate(start, startDateFormat, localeId)}` :
|
|
3326
|
-
`${formatDate(start, startTimeFormat, localeId)}–${formatDate(end, endFormat, localeId)}`;
|
|
3327
|
-
}
|
|
3328
|
-
/**
|
|
3329
|
-
* @hidden
|
|
3330
|
-
*/
|
|
3331
|
-
function formValueOrDefault(group, field, defaultValue) {
|
|
3332
|
-
const control = group.get(field);
|
|
3333
|
-
if (!control) {
|
|
3334
|
-
return defaultValue;
|
|
3335
|
-
}
|
|
3336
|
-
return control.value || defaultValue;
|
|
3337
|
-
}
|
|
3338
|
-
/**
|
|
3339
|
-
* @hidden
|
|
3340
|
-
*/
|
|
3341
|
-
const isWorkWeekDay = (day, start, end) => {
|
|
3342
|
-
if (end < start) {
|
|
3343
|
-
return day <= end || start <= day;
|
|
3344
|
-
}
|
|
3345
|
-
return start <= day && day <= end;
|
|
3346
|
-
};
|
|
3366
|
+
i18n-recurrenceEditorWeeklyInterval="kendo.scheduler.recurrenceEditorWeeklyInterval|The text similar to 'week(s)' displayed in the scheduler recurrence editor."
|
|
3367
|
+
recurrenceEditorWeeklyInterval='week(s)'
|
|
3368
|
+
|
|
3369
|
+
i18n-recurrenceEditorWeeklyRepeatEvery="kendo.scheduler.recurrenceEditorWeeklyRepeatEvery|The text similar to 'Repeat every' displayed in the scheduler recurrence editor."
|
|
3370
|
+
recurrenceEditorWeeklyRepeatEvery='Repeat every'
|
|
3371
|
+
|
|
3372
|
+
i18n-recurrenceEditorWeeklyRepeatOn="kendo.scheduler.recurrenceEditorWeeklyRepeatOn|The text similar to 'Repeat on' displayed in the scheduler recurrence editor."
|
|
3373
|
+
recurrenceEditorWeeklyRepeatOn='Repeat on'
|
|
3374
|
+
|
|
3375
|
+
i18n-recurrenceEditorMonthlyDay="kendo.scheduler.recurrenceEditorMonthlyDay|The text similar to 'Day' displayed in the scheduler recurrence editor."
|
|
3376
|
+
recurrenceEditorMonthlyDay='Day'
|
|
3377
|
+
|
|
3378
|
+
i18n-recurrenceEditorMonthlyInterval="kendo.scheduler.recurrenceEditorMonthlyInterval|The text similar to 'month(s)' displayed in the scheduler recurrence editor."
|
|
3379
|
+
recurrenceEditorMonthlyInterval='month(s)'
|
|
3380
|
+
|
|
3381
|
+
i18n-recurrenceEditorMonthlyRepeatEvery="kendo.scheduler.recurrenceEditorMonthlyRepeatEvery|The text similar to 'Repeat every' displayed in the scheduler recurrence editor."
|
|
3382
|
+
recurrenceEditorMonthlyRepeatEvery='Repeat every'
|
|
3383
|
+
|
|
3384
|
+
i18n-recurrenceEditorMonthlyRepeatOn="kendo.scheduler.recurrenceEditorMonthlyRepeatOn|The text similar to 'Repeat on' displayed in the scheduler recurrence editor."
|
|
3385
|
+
recurrenceEditorMonthlyRepeatOn='Repeat on'
|
|
3386
|
+
|
|
3387
|
+
i18n-recurrenceEditorYearlyOf="kendo.scheduler.recurrenceEditorYearlyOf|The text similar to 'of' displayed in the scheduler recurrence editor."
|
|
3388
|
+
recurrenceEditorYearlyOf='of'
|
|
3389
|
+
|
|
3390
|
+
i18n-recurrenceEditorYearlyRepeatEvery="kendo.scheduler.recurrenceEditorYearlyRepeatEvery|The text similar to 'Repeat every' displayed in the scheduler recurrence editor."
|
|
3391
|
+
recurrenceEditorYearlyRepeatEvery='Repeat every'
|
|
3392
|
+
|
|
3393
|
+
i18n-recurrenceEditorYearlyRepeatOn="kendo.scheduler.recurrenceEditorYearlyRepeatOn|The text similar to 'Repeat on' displayed in the scheduler recurrence editor."
|
|
3394
|
+
recurrenceEditorYearlyRepeatOn='Repeat on'
|
|
3395
|
+
|
|
3396
|
+
i18n-recurrenceEditorYearlyInterval="kendo.scheduler.recurrenceEditorYearlyInterval|The text similar to 'year(s)' displayed in the scheduler recurrence editor."
|
|
3397
|
+
recurrenceEditorYearlyInterval='year(s)'
|
|
3398
|
+
|
|
3399
|
+
i18n-recurrenceEditorFrequenciesDaily="kendo.scheduler.recurrenceEditorFrequenciesDaily|The text similar to 'Daily' displayed in the scheduler recurrence editor."
|
|
3400
|
+
recurrenceEditorFrequenciesDaily='Daily'
|
|
3401
|
+
|
|
3402
|
+
i18n-recurrenceEditorFrequenciesMonthly="kendo.scheduler.recurrenceEditorFrequenciesMonthly|The text similar to 'Monthly' displayed in the scheduler recurrence editor."
|
|
3403
|
+
recurrenceEditorFrequenciesMonthly='Monthly'
|
|
3404
|
+
|
|
3405
|
+
i18n-recurrenceEditorFrequenciesNever="kendo.scheduler.recurrenceEditorFrequenciesNever|The text similar to 'Never' displayed in the scheduler recurrence editor."
|
|
3406
|
+
recurrenceEditorFrequenciesNever='Never'
|
|
3407
|
+
|
|
3408
|
+
i18n-recurrenceEditorFrequenciesWeekly="kendo.scheduler.recurrenceEditorFrequenciesWeekly|The text similar to 'Weekly' displayed in the scheduler recurrence editor."
|
|
3409
|
+
recurrenceEditorFrequenciesWeekly='Weekly'
|
|
3410
|
+
|
|
3411
|
+
i18n-recurrenceEditorFrequenciesYearly="kendo.scheduler.recurrenceEditorFrequenciesYearly|The text similar to 'Yearly' displayed in the scheduler recurrence editor."
|
|
3412
|
+
recurrenceEditorFrequenciesYearly='Yearly'
|
|
3413
|
+
|
|
3414
|
+
i18n-recurrenceEditorOffsetPositionsFirst="kendo.scheduler.recurrenceEditorOffsetPositionsFirst|The text similar to 'First' displayed in the scheduler recurrence editor."
|
|
3415
|
+
recurrenceEditorOffsetPositionsFirst='First'
|
|
3416
|
+
|
|
3417
|
+
i18n-recurrenceEditorOffsetPositionsSecond="kendo.scheduler.recurrenceEditorOffsetPositionsSecond|The text similar to 'Second' displayed in the scheduler recurrence editor."
|
|
3418
|
+
recurrenceEditorOffsetPositionsSecond='Second'
|
|
3419
|
+
|
|
3420
|
+
i18n-recurrenceEditorOffsetPositionsThird="kendo.scheduler.recurrenceEditorOffsetPositionsThird|The text similar to 'Third' displayed in the scheduler recurrence editor."
|
|
3421
|
+
recurrenceEditorOffsetPositionsThird='Third'
|
|
3422
|
+
|
|
3423
|
+
i18n-recurrenceEditorOffsetPositionsFourth="kendo.scheduler.recurrenceEditorOffsetPositionsFourth|The text similar to 'Fourth' displayed in the scheduler recurrence editor."
|
|
3424
|
+
recurrenceEditorOffsetPositionsFourth='Fourth'
|
|
3425
|
+
|
|
3426
|
+
i18n-recurrenceEditorOffsetPositionsLast="kendo.scheduler.recurrenceEditorOffsetPositionsLast|The text similar to 'Last' displayed in the scheduler recurrence editor."
|
|
3427
|
+
recurrenceEditorOffsetPositionsLast='Last'
|
|
3428
|
+
|
|
3429
|
+
i18n-recurrenceEditorWeekdaysDay="kendo.scheduler.recurrenceEditorWeekdaysDay|The text similar to 'Day' displayed in the repeat by section of the monthly recurrence pattern."
|
|
3430
|
+
recurrenceEditorWeekdaysDay='Day'
|
|
3431
|
+
|
|
3432
|
+
i18n-recurrenceEditorWeekdaysWeekday="kendo.scheduler.recurrenceEditorWeekdaysWeekday|The text similar to 'Weekday' displayed in the repeat by section of the monthly recurrence pattern."
|
|
3433
|
+
recurrenceEditorWeekdaysWeekday='Weekday'
|
|
3434
|
+
|
|
3435
|
+
i18n-recurrenceEditorWeekdaysWeekendday="kendo.scheduler.recurrenceEditorWeekdaysWeekendday|The text similar to 'Weekend Day' displayed in the repeat by section of the monthly recurrence pattern."
|
|
3436
|
+
recurrenceEditorWeekdaysWeekendday='Weekend Day'
|
|
3437
|
+
|
|
3438
|
+
i18n-recurrenceEditorEndAfter="kendo.scheduler.recurrenceEditorEndAfter|The text similar to 'After' displayed in the scheduler recurrence editor."
|
|
3439
|
+
recurrenceEditorEndAfter='After'
|
|
3440
|
+
|
|
3441
|
+
i18n-recurrenceEditorEndOccurrence="kendo.scheduler.recurrenceEditorEndOccurrence|The text similar to 'occurrence(s)' displayed in the scheduler recurrence editor."
|
|
3442
|
+
recurrenceEditorEndOccurrence='occurrence(s)'
|
|
3443
|
+
|
|
3444
|
+
i18n-recurrenceEditorEndLabel="kendo.scheduler.recurrenceEditorEndLabel|The text similar to 'End' displayed in the scheduler recurrence editor."
|
|
3445
|
+
recurrenceEditorEndLabel='End'
|
|
3446
|
+
|
|
3447
|
+
i18n-recurrenceEditorEndNever="kendo.scheduler.recurrenceEditorEndNever|The text similar to 'Never' displayed in the scheduler recurrence editor."
|
|
3448
|
+
recurrenceEditorEndNever='Never'
|
|
3449
|
+
|
|
3450
|
+
i18n-recurrenceEditorEndOn="kendo.scheduler.recurrenceEditorEndOn|The text similar to 'On' displayed in the scheduler recurrence editor."
|
|
3451
|
+
recurrenceEditorEndOn='On'
|
|
3452
|
+
|
|
3453
|
+
i18n-destroy="kendo.scheduler.destroy|The text of the 'Delete' button displayed in the scheduler remove confirmation dialog."
|
|
3454
|
+
destroy='Delete'
|
|
3455
|
+
|
|
3456
|
+
i18n-deleteConfirmation="kendo.scheduler.deleteConfirmation|The text similar to 'Are you sure you want to delete this event?' displayed in scheduler remove confirmation dialog."
|
|
3457
|
+
deleteConfirmation='Are you sure you want to delete this event?'
|
|
3458
|
+
|
|
3459
|
+
i18n-editRecurringConfirmation="kendo.scheduler.editRecurringConfirmation|The text similar to 'Do you want to edit only this event occurrence or the whole series?' displayed in the scheduler recurring confirmation dialog."
|
|
3460
|
+
editRecurringConfirmation='Do you want to edit only this event occurrence or the whole series?'
|
|
3461
|
+
|
|
3462
|
+
i18n-editOccurrence="kendo.scheduler.editOccurrence|The text of the 'Edit current occurrence' button displayed in the scheduler recurring confirmation dialog."
|
|
3463
|
+
editOccurrence='Edit current occurrence'
|
|
3464
|
+
|
|
3465
|
+
i18n-editSeries="kendo.scheduler.editSeries|The text of the 'Edit the series' button displayed in the scheduler recurring confirmation dialog."
|
|
3466
|
+
editSeries='Edit the series'
|
|
3467
|
+
|
|
3468
|
+
i18n-deleteRecurringConfirmation="kendo.scheduler.deleteRecurringConfirmation|The text similar to 'Do you want to delete only this event occurrence or the whole series?' displayed in the scheduler recurring confirmation dialog."
|
|
3469
|
+
deleteRecurringConfirmation='Do you want to delete only this event occurrence or the whole series?'
|
|
3470
|
+
|
|
3471
|
+
i18n-deleteOccurrence="kendo.scheduler.deleteOccurrence|The text of the 'Delete current occurrence' button displayed in the scheduler recurring confirmation dialog."
|
|
3472
|
+
deleteOccurrence='Delete current occurrence'
|
|
3473
|
+
|
|
3474
|
+
i18n-deleteSeries="kendo.scheduler.deleteSeries|The text similar of the 'Delete the series' button displayed in the scheduler recurring confirmation dialog."
|
|
3475
|
+
deleteSeries='Delete the series'
|
|
3476
|
+
|
|
3477
|
+
i18n-deleteDialogTitle="kendo.scheduler.deleteDialogTitle|The title of the remove confirmation dialog, similar to 'Delete Event'."
|
|
3478
|
+
deleteDialogTitle='Delete Event'
|
|
3479
|
+
|
|
3480
|
+
i18n-deleteRecurringDialogTitle="kendo.scheduler.deleteRecurringDialogTitle|The title of the recurring remove confirmation dialog, similar to 'Delete Recurring Item'"
|
|
3481
|
+
deleteRecurringDialogTitle='Delete Recurring Item'
|
|
3482
|
+
|
|
3483
|
+
i18n-editRecurringDialogTitle="kendo.scheduler.editRecurringDialogTitle|The title of the recurring edit confirmation dialog, similar to 'Edit Recurring Item'"
|
|
3484
|
+
editRecurringDialogTitle='Edit Recurring Item'
|
|
3485
|
+
>
|
|
3486
|
+
</ng-container>
|
|
3487
|
+
|
|
3488
|
+
<kendo-scheduler-toolbar
|
|
3489
|
+
[dateRange]="dateRangeStream"
|
|
3490
|
+
[selectedDate]="selectedDateStream"
|
|
3491
|
+
[views]="views"
|
|
3492
|
+
[selectedView]="selectedView"
|
|
3493
|
+
[template]="toolbarTemplate"
|
|
3494
|
+
(navigate)="onNavigationAction($event)"
|
|
3495
|
+
[min]="min"
|
|
3496
|
+
[max]="max"
|
|
3497
|
+
></kendo-scheduler-toolbar>
|
|
3498
|
+
|
|
3499
|
+
<ng-container *ngTemplateOutlet="selectedView?.template">
|
|
3500
|
+
</ng-container>
|
|
3501
|
+
|
|
3502
|
+
<ng-container #confirmationDialogContainer>
|
|
3503
|
+
</ng-container>
|
|
3504
|
+
|
|
3505
|
+
<kendo-scheduler-edit-dialog
|
|
3506
|
+
[resources]="resources"
|
|
3507
|
+
[editTemplate]="editDialogTemplate"
|
|
3508
|
+
[timezone]="timezone"
|
|
3509
|
+
[weekStart]="weekStart"
|
|
3510
|
+
[fields]="modelFields"
|
|
3511
|
+
></kendo-scheduler-edit-dialog>
|
|
3512
|
+
|
|
3513
|
+
<kendo-resize-sensor (resize)="onResize()"></kendo-resize-sensor>
|
|
3514
|
+
|
|
3515
|
+
<div [loading]="loading" kendoSchedulerLoading>
|
|
3516
|
+
</div>
|
|
3517
|
+
`
|
|
3518
|
+
}),
|
|
3519
|
+
__metadata("design:paramtypes", [ElementRef,
|
|
3520
|
+
ViewContextService,
|
|
3521
|
+
ViewStateService,
|
|
3522
|
+
EditService,
|
|
3523
|
+
DialogsService,
|
|
3524
|
+
IntlService,
|
|
3525
|
+
ChangeDetectorRef,
|
|
3526
|
+
NgZone,
|
|
3527
|
+
PDFService,
|
|
3528
|
+
LocalizationService,
|
|
3529
|
+
DomEventsService,
|
|
3530
|
+
Renderer2,
|
|
3531
|
+
FocusService])
|
|
3532
|
+
], SchedulerComponent);
|
|
3347
3533
|
|
|
3348
3534
|
// TODO
|
|
3349
3535
|
// Extract as public method
|
|
@@ -4255,6 +4441,7 @@ ToolbarViewSelectorComponent = __decorate([
|
|
|
4255
4441
|
</select>
|
|
4256
4442
|
<span class="k-scheduler-views k-button-group">
|
|
4257
4443
|
<button kendoButton
|
|
4444
|
+
type="button"
|
|
4258
4445
|
*ngFor="let view of ctx.views"
|
|
4259
4446
|
[selected]="isSelected(view)"
|
|
4260
4447
|
[attr.aria-pressed]="isSelected(view)"
|
|
@@ -6209,7 +6396,7 @@ const SCROLL_INTERVAL = 50;
|
|
|
6209
6396
|
const MIN_MOVE_DISTANCE = 10;
|
|
6210
6397
|
/** @hidden */
|
|
6211
6398
|
class BaseView {
|
|
6212
|
-
constructor(viewContext, viewState, intl, slotService, zone, renderer, element, pdfService, localization) {
|
|
6399
|
+
constructor(viewContext, viewState, intl, slotService, zone, renderer, element, pdfService, localization, cdr) {
|
|
6213
6400
|
this.viewContext = viewContext;
|
|
6214
6401
|
this.viewState = viewState;
|
|
6215
6402
|
this.intl = intl;
|
|
@@ -6219,6 +6406,7 @@ class BaseView {
|
|
|
6219
6406
|
this.element = element;
|
|
6220
6407
|
this.pdfService = pdfService;
|
|
6221
6408
|
this.localization = localization;
|
|
6409
|
+
this.cdr = cdr;
|
|
6222
6410
|
this.items = new BehaviorSubject(null);
|
|
6223
6411
|
this.horizontalResources = [];
|
|
6224
6412
|
this.verticalResources = [];
|
|
@@ -6232,8 +6420,17 @@ class BaseView {
|
|
|
6232
6420
|
this.spans = [];
|
|
6233
6421
|
this.domEvents = [];
|
|
6234
6422
|
this.resourcesCache = {};
|
|
6423
|
+
/**
|
|
6424
|
+
* The slot which is currently being dragged over while selecting a range of slots.
|
|
6425
|
+
*/
|
|
6426
|
+
this.dragSelecting = null;
|
|
6427
|
+
/**
|
|
6428
|
+
* The slot where the drag-selecting originated. Used for flipping the start and end of the emitted range.
|
|
6429
|
+
*/
|
|
6430
|
+
this.dragSelectOrigin = null;
|
|
6235
6431
|
this.autoHeight = false;
|
|
6236
6432
|
this.rtl = false;
|
|
6433
|
+
this.isSlotSelected = () => false;
|
|
6237
6434
|
this.setSlotClass = this.setSlotClass.bind(this);
|
|
6238
6435
|
this.setHintClass = this.setHintClass.bind(this);
|
|
6239
6436
|
this.weekStart = intl.firstDay();
|
|
@@ -6350,6 +6547,20 @@ class BaseView {
|
|
|
6350
6547
|
}
|
|
6351
6548
|
return result;
|
|
6352
6549
|
}
|
|
6550
|
+
// Similar to https://tc39.es/proposal-temporal/docs/plaindate.html
|
|
6551
|
+
// Stores a "plain date" in the UTC parts of a regular `Date`.
|
|
6552
|
+
toPlainDate(date) {
|
|
6553
|
+
const result = toUTCDateTime(this.convertDate(date));
|
|
6554
|
+
return result;
|
|
6555
|
+
}
|
|
6556
|
+
// Similar to https://tc39.es/proposal-temporal/docs/plaindatetime.html
|
|
6557
|
+
// Stores a "plain date-time" in the UTC parts of a regular `Date`.
|
|
6558
|
+
toPlainDateTime(date, time) {
|
|
6559
|
+
if (!date || !time) {
|
|
6560
|
+
return null;
|
|
6561
|
+
}
|
|
6562
|
+
return this.toPlainDate(dateWithTime(date, time));
|
|
6563
|
+
}
|
|
6353
6564
|
optionsChange(options) {
|
|
6354
6565
|
this.schedulerEventTemplate = options.eventTemplate;
|
|
6355
6566
|
this.schedulerGroupHeaderTemplate = options.groupHeaderTemplate;
|
|
@@ -6357,6 +6568,8 @@ class BaseView {
|
|
|
6357
6568
|
this.max = options.max;
|
|
6358
6569
|
this.editable = options.editable;
|
|
6359
6570
|
this.timezone = options.timezone;
|
|
6571
|
+
this.selectable = options.selectable;
|
|
6572
|
+
this.isSlotSelected = options.isSlotSelected;
|
|
6360
6573
|
if (!options.changes || anyChanged(['group', 'resources'], options.changes, false) ||
|
|
6361
6574
|
options.group !== this.group || options.resources !== this.resources) {
|
|
6362
6575
|
this.group = options.group;
|
|
@@ -6383,6 +6596,7 @@ class BaseView {
|
|
|
6383
6596
|
this.toggleElement(true);
|
|
6384
6597
|
this.reflow();
|
|
6385
6598
|
this.viewState.notifyLayoutEnd();
|
|
6599
|
+
this.viewState.emitEvent(slotDragEventName.refreshSlotSelection);
|
|
6386
6600
|
}
|
|
6387
6601
|
assignResources() {
|
|
6388
6602
|
assignTasksResources(this.tasks, {
|
|
@@ -6423,16 +6637,16 @@ class BaseView {
|
|
|
6423
6637
|
});
|
|
6424
6638
|
}
|
|
6425
6639
|
onPress(args) {
|
|
6426
|
-
const
|
|
6427
|
-
const
|
|
6640
|
+
const editResizable = this.editable && this.editable.resize !== false;
|
|
6641
|
+
const editDraggable = this.editable && this.editable.drag !== false;
|
|
6428
6642
|
const target = args.originalEvent.target;
|
|
6429
6643
|
if (hasClasses(target, 'k-resize-handle')) {
|
|
6430
|
-
if (!
|
|
6644
|
+
if (!editResizable) {
|
|
6431
6645
|
return;
|
|
6432
6646
|
}
|
|
6433
6647
|
this.initResize(args);
|
|
6434
6648
|
}
|
|
6435
|
-
else if (
|
|
6649
|
+
else if (editDraggable) {
|
|
6436
6650
|
const task = this.targetTask(target);
|
|
6437
6651
|
if (task) {
|
|
6438
6652
|
if (!args.isTouch) {
|
|
@@ -6442,6 +6656,9 @@ class BaseView {
|
|
|
6442
6656
|
this.pressTarget = task;
|
|
6443
6657
|
}
|
|
6444
6658
|
}
|
|
6659
|
+
if (this.selectable) {
|
|
6660
|
+
this.initDragSelect(args);
|
|
6661
|
+
}
|
|
6445
6662
|
this.dragArgs = args;
|
|
6446
6663
|
}
|
|
6447
6664
|
onDrag(args) {
|
|
@@ -6456,12 +6673,15 @@ class BaseView {
|
|
|
6456
6673
|
args.originalEvent.preventDefault();
|
|
6457
6674
|
this.scrollContainer(this.drag, args);
|
|
6458
6675
|
}
|
|
6676
|
+
if (this.dragSelecting) {
|
|
6677
|
+
this.dragSelect(args);
|
|
6678
|
+
}
|
|
6459
6679
|
}
|
|
6460
6680
|
this.dragArgs = args;
|
|
6461
6681
|
}
|
|
6462
|
-
onRelease() {
|
|
6682
|
+
onRelease(args) {
|
|
6463
6683
|
clearInterval(this.scrollInterval);
|
|
6464
|
-
const { resizing, dragging } = this;
|
|
6684
|
+
const { resizing, dragging, dragSelecting } = this;
|
|
6465
6685
|
if (resizing) {
|
|
6466
6686
|
this.emitEvent('resizeEnd', {
|
|
6467
6687
|
event: resizing.task.event,
|
|
@@ -6488,6 +6708,20 @@ class BaseView {
|
|
|
6488
6708
|
this.resizing = null;
|
|
6489
6709
|
this.dragging = null;
|
|
6490
6710
|
}
|
|
6711
|
+
if (dragSelecting) {
|
|
6712
|
+
const { start, end } = normaliseRangeStartAndEnd(this.dragSelectOrigin, this.dragSelecting);
|
|
6713
|
+
const range = {
|
|
6714
|
+
start: this.convertDate(start),
|
|
6715
|
+
end: this.convertDate(end),
|
|
6716
|
+
isAllDay: this.dragSelecting.isDaySlot,
|
|
6717
|
+
resources: this.resourcesByIndex(this.dragSelecting.id.resourceIndex),
|
|
6718
|
+
originalEvent: args.originalEvent
|
|
6719
|
+
};
|
|
6720
|
+
this.viewState.notifySlotSelectionEnd(range);
|
|
6721
|
+
this.dragSelectOrigin = null;
|
|
6722
|
+
this.dragSelecting = null;
|
|
6723
|
+
this.cdr.markForCheck();
|
|
6724
|
+
}
|
|
6491
6725
|
this.container = null;
|
|
6492
6726
|
this.dragArgs = null;
|
|
6493
6727
|
this.pressLocation = null;
|
|
@@ -6635,6 +6869,51 @@ class BaseView {
|
|
|
6635
6869
|
this.updateHintContainer();
|
|
6636
6870
|
}
|
|
6637
6871
|
}
|
|
6872
|
+
initDragSelect(args) {
|
|
6873
|
+
this.updateDragContainer(args);
|
|
6874
|
+
if (!this.containerOffset) {
|
|
6875
|
+
return;
|
|
6876
|
+
}
|
|
6877
|
+
const { x, y } = this.coordinatesOffset(args.pageX, args.pageY);
|
|
6878
|
+
const slot = this.slotByPosition(x, y, this.container);
|
|
6879
|
+
if (!slot) {
|
|
6880
|
+
return;
|
|
6881
|
+
}
|
|
6882
|
+
const range = {
|
|
6883
|
+
start: this.convertDate(slot.start),
|
|
6884
|
+
end: this.convertDate(slot.end),
|
|
6885
|
+
isAllDay: slot.isDaySlot,
|
|
6886
|
+
resources: this.resourcesByIndex(slot.id.resourceIndex),
|
|
6887
|
+
originalEvent: args.originalEvent
|
|
6888
|
+
};
|
|
6889
|
+
const slotDragStartEvent = new SlotDragStartEvent(null, range);
|
|
6890
|
+
this.viewState.notifySlotSelectionStart(slotDragStartEvent);
|
|
6891
|
+
if (!slotDragStartEvent.isDefaultPrevented()) {
|
|
6892
|
+
this.dragSelecting = slot;
|
|
6893
|
+
this.dragSelectOrigin = slot;
|
|
6894
|
+
this.cdr.markForCheck();
|
|
6895
|
+
}
|
|
6896
|
+
}
|
|
6897
|
+
dragSelect(args) {
|
|
6898
|
+
const { x, y } = this.coordinatesOffset(args.pageX, args.pageY);
|
|
6899
|
+
const slot = this.slotByPosition(x, y, this.container);
|
|
6900
|
+
if (!slot) {
|
|
6901
|
+
return;
|
|
6902
|
+
}
|
|
6903
|
+
if (this.dragSelecting !== slot) {
|
|
6904
|
+
this.dragSelecting = slot;
|
|
6905
|
+
const { start, end } = normaliseRangeStartAndEnd(this.dragSelectOrigin, this.dragSelecting);
|
|
6906
|
+
const range = {
|
|
6907
|
+
start: this.convertDate(start),
|
|
6908
|
+
end: this.convertDate(end),
|
|
6909
|
+
isAllDay: slot.isDaySlot,
|
|
6910
|
+
resources: this.resourcesByIndex(slot.id.resourceIndex),
|
|
6911
|
+
originalEvent: args.originalEvent
|
|
6912
|
+
};
|
|
6913
|
+
this.viewState.notifySlotSelectionDrag(range);
|
|
6914
|
+
this.cdr.markForCheck();
|
|
6915
|
+
}
|
|
6916
|
+
}
|
|
6638
6917
|
dragHintClasses() {
|
|
6639
6918
|
const hintClass = this.dragging.hintClass;
|
|
6640
6919
|
let result = [];
|
|
@@ -7115,8 +7394,8 @@ const WEEKS_COUNT = 6;
|
|
|
7115
7394
|
* @hidden
|
|
7116
7395
|
*/
|
|
7117
7396
|
let MonthViewRendererComponent = class MonthViewRendererComponent extends BaseView {
|
|
7118
|
-
constructor(viewContext, viewState, intl, slotService, zone, element, renderer, pdfService, localization) {
|
|
7119
|
-
super(viewContext, viewState, intl, slotService, zone, renderer, element, pdfService, localization);
|
|
7397
|
+
constructor(viewContext, viewState, intl, slotService, zone, element, renderer, pdfService, localization, changeDetector) {
|
|
7398
|
+
super(viewContext, viewState, intl, slotService, zone, renderer, element, pdfService, localization, changeDetector);
|
|
7120
7399
|
this.resizeHintFormat = { skeleton: 'Md' };
|
|
7121
7400
|
this.weeks = [];
|
|
7122
7401
|
}
|
|
@@ -7164,6 +7443,12 @@ let MonthViewRendererComponent = class MonthViewRendererComponent extends BaseVi
|
|
|
7164
7443
|
});
|
|
7165
7444
|
}
|
|
7166
7445
|
}
|
|
7446
|
+
cellTitle(value) {
|
|
7447
|
+
return this.intl.formatDate(value, 'D');
|
|
7448
|
+
}
|
|
7449
|
+
addDay(dayStart) {
|
|
7450
|
+
return addDays(dayStart, 1);
|
|
7451
|
+
}
|
|
7167
7452
|
optionsChange(changes) {
|
|
7168
7453
|
this.schedulerMonthDaySlotTemplate = changes.monthDaySlotTemplate;
|
|
7169
7454
|
super.optionsChange(changes);
|
|
@@ -7328,7 +7613,7 @@ MonthViewRendererComponent = __decorate([
|
|
|
7328
7613
|
</table>
|
|
7329
7614
|
</div>
|
|
7330
7615
|
<div class="k-scheduler-content" #content>
|
|
7331
|
-
<table class="k-scheduler-table" #contentTable role="presentation">
|
|
7616
|
+
<table class="k-scheduler-table k-user-select-none" #contentTable role="presentation">
|
|
7332
7617
|
<ng-container *ngFor="let resourceItem of verticalResources | resourceIterator; let verticalIndex = index; trackBy: itemIndex">
|
|
7333
7618
|
<tr *ngFor="let week of weeks; let rangeIndex = index; trackBy: itemIndex">
|
|
7334
7619
|
<ng-container *ngFor="let resource of horizontalResources | resourceIterator; let horizontalIndex = index; trackBy: itemIndex">
|
|
@@ -7337,8 +7622,15 @@ MonthViewRendererComponent = __decorate([
|
|
|
7337
7622
|
[ngClass]="daySlotClass(day, verticalResources.length ? verticalIndex : horizontalIndex)"
|
|
7338
7623
|
[start]="day"
|
|
7339
7624
|
[id]="{ resourceIndex: verticalResources.length ? verticalIndex : horizontalIndex, rangeIndex: rangeIndex, index: index }"
|
|
7625
|
+
[title]="cellTitle(day)"
|
|
7626
|
+
[class.k-state-selected]="isSlotSelected({
|
|
7627
|
+
start: toPlainDate(day),
|
|
7628
|
+
end: addDay(toPlainDate(day)),
|
|
7629
|
+
isAllDay: true,
|
|
7630
|
+
resources: resourcesByIndex(verticalResources.length ? verticalIndex : horizontalIndex)
|
|
7631
|
+
})"
|
|
7340
7632
|
>
|
|
7341
|
-
<span class="k-link k-nav-day" *ngIf="!monthDaySlotTemplateRef">{{ day | kendoDate: 'dd' }}</span>
|
|
7633
|
+
<span aria-hidden="true" class="k-link k-nav-day" *ngIf="!monthDaySlotTemplateRef">{{ day | kendoDate: 'dd' }}</span>
|
|
7342
7634
|
<ng-container *ngIf="monthDaySlotTemplateRef" [ngTemplateOutlet]="monthDaySlotTemplateRef"
|
|
7343
7635
|
[ngTemplateOutletContext]="{ date: day, resources: resourcesByIndex(verticalResources.length ? verticalIndex : horizontalIndex) }"></ng-container>
|
|
7344
7636
|
</td>
|
|
@@ -7395,7 +7687,8 @@ MonthViewRendererComponent = __decorate([
|
|
|
7395
7687
|
ElementRef,
|
|
7396
7688
|
Renderer2,
|
|
7397
7689
|
PDFService,
|
|
7398
|
-
LocalizationService
|
|
7690
|
+
LocalizationService,
|
|
7691
|
+
ChangeDetectorRef])
|
|
7399
7692
|
], MonthViewRendererComponent);
|
|
7400
7693
|
|
|
7401
7694
|
/**
|
|
@@ -9111,7 +9404,7 @@ const getNextDate = (date, count, numberOfDays) => getDate(addDays(date, numberO
|
|
|
9111
9404
|
*/
|
|
9112
9405
|
class DayTimeViewComponent extends BaseView {
|
|
9113
9406
|
constructor(changeDetector, viewContext, viewState, intl, slotService, zone, renderer, element, pdfService, localization) {
|
|
9114
|
-
super(viewContext, viewState, intl, slotService, zone, renderer, element, pdfService, localization);
|
|
9407
|
+
super(viewContext, viewState, intl, slotService, zone, renderer, element, pdfService, localization, changeDetector);
|
|
9115
9408
|
this.changeDetector = changeDetector;
|
|
9116
9409
|
this.numberOfDays = 1;
|
|
9117
9410
|
this.startTime = '00:00';
|
|
@@ -9597,8 +9890,8 @@ let MultiDayViewRendererComponent = class MultiDayViewRendererComponent extends
|
|
|
9597
9890
|
}
|
|
9598
9891
|
super.updateHintContainer();
|
|
9599
9892
|
}
|
|
9600
|
-
onRelease() {
|
|
9601
|
-
super.onRelease();
|
|
9893
|
+
onRelease(args) {
|
|
9894
|
+
super.onRelease(args);
|
|
9602
9895
|
this.dragContainers = null;
|
|
9603
9896
|
}
|
|
9604
9897
|
updateDragContainer(args) {
|
|
@@ -9759,7 +10052,7 @@ MultiDayViewRendererComponent = __decorate([
|
|
|
9759
10052
|
</tr>
|
|
9760
10053
|
</table>
|
|
9761
10054
|
<div style="position: relative;" *ngIf="!verticalResources.length">
|
|
9762
|
-
<table class="k-scheduler-table k-scheduler-header-all-day" aria-hidden="true">
|
|
10055
|
+
<table class="k-scheduler-table k-scheduler-header-all-day k-user-select-none" aria-hidden="true">
|
|
9763
10056
|
<tr>
|
|
9764
10057
|
<ng-container *ngFor="let resource of horizontalResources | resourceIterator; let resourceIndex = index; trackBy: itemIndex;">
|
|
9765
10058
|
<td *ngFor="let slot of daySlots; let index = index; trackBy: itemIndex"
|
|
@@ -9767,6 +10060,12 @@ MultiDayViewRendererComponent = __decorate([
|
|
|
9767
10060
|
[start]="slot.start"
|
|
9768
10061
|
[end]="slot.end"
|
|
9769
10062
|
[id]="{ resourceIndex: resourceIndex, rangeIndex: 0, index: index }"
|
|
10063
|
+
[class.k-state-selected]="isSlotSelected({
|
|
10064
|
+
start: toPlainDate(slot.start),
|
|
10065
|
+
end: toPlainDate(slot.end),
|
|
10066
|
+
isAllDay: true,
|
|
10067
|
+
resources: resourcesByIndex(resourceIndex)
|
|
10068
|
+
})"
|
|
9770
10069
|
[ngClass]="allDaySlotClass(slot, resourceIndex)">
|
|
9771
10070
|
<ng-container *ngIf="allDaySlotTemplateRef" [ngTemplateOutlet]="allDaySlotTemplateRef"
|
|
9772
10071
|
[ngTemplateOutletContext]="{ date: slot.start, resources: resourcesByIndex(resourceIndex) }"></ng-container>
|
|
@@ -9848,7 +10147,7 @@ MultiDayViewRendererComponent = __decorate([
|
|
|
9848
10147
|
</ng-container>
|
|
9849
10148
|
</table>
|
|
9850
10149
|
</div>
|
|
9851
|
-
<div class="k-scheduler-content" #content>
|
|
10150
|
+
<div class="k-scheduler-content k-user-select-none" #content>
|
|
9852
10151
|
<ng-container *ngIf="showCurrentTime">
|
|
9853
10152
|
<div *ngFor="let resource of verticalResources | resourceIterator; trackBy: itemIndex;"
|
|
9854
10153
|
#currentTimeMarker class="k-current-time">
|
|
@@ -9861,6 +10160,12 @@ MultiDayViewRendererComponent = __decorate([
|
|
|
9861
10160
|
daySlot
|
|
9862
10161
|
[start]="slot.start"
|
|
9863
10162
|
[end]="slot.end"
|
|
10163
|
+
[class.k-state-selected]="isSlotSelected({
|
|
10164
|
+
start: toPlainDate(slot.start),
|
|
10165
|
+
end: toPlainDate(slot.end),
|
|
10166
|
+
isAllDay: true,
|
|
10167
|
+
resources: resourcesByIndex(verticalIndex)
|
|
10168
|
+
})"
|
|
9864
10169
|
[id]="{ resourceIndex: verticalIndex, rangeIndex: 0, index: index }">
|
|
9865
10170
|
<ng-container *ngIf="allDaySlotTemplateRef" [ngTemplateOutlet]="allDaySlotTemplateRef"
|
|
9866
10171
|
[ngTemplateOutletContext]="{ date: slot.start, resources: resourcesByIndex(verticalIndex) }"></ng-container>
|
|
@@ -9879,6 +10184,12 @@ MultiDayViewRendererComponent = __decorate([
|
|
|
9879
10184
|
[workWeekStart]="workWeekStart"
|
|
9880
10185
|
[workWeekEnd]="workWeekEnd"
|
|
9881
10186
|
[id]="{ resourceIndex: verticalResources.length ? verticalIndex : horizontalIndex, rangeIndex: rangeIndex, index: index }"
|
|
10187
|
+
[class.k-state-selected]="isSlotSelected({
|
|
10188
|
+
start: toPlainDateTime(daySlot.start, slot.start),
|
|
10189
|
+
end: toPlainDateTime(daySlot.start, slot.end),
|
|
10190
|
+
isAllDay: false,
|
|
10191
|
+
resources: resourcesByIndex(verticalResources.length ? verticalIndex : horizontalIndex)
|
|
10192
|
+
})"
|
|
9882
10193
|
>
|
|
9883
10194
|
<ng-container *ngIf="timeSlotTemplateRef" [ngTemplateOutlet]="timeSlotTemplateRef"
|
|
9884
10195
|
[ngTemplateOutletContext]="{ date: timeSlot.startLocalTime, resources: resourcesByIndex(timeSlot.id.resourceIndex) }">
|
|
@@ -10184,7 +10495,7 @@ let DayTimeModule = class DayTimeModule {
|
|
|
10184
10495
|
};
|
|
10185
10496
|
DayTimeModule = __decorate([
|
|
10186
10497
|
NgModule({
|
|
10187
|
-
imports: [CommonModule, SharedModule],
|
|
10498
|
+
imports: [CommonModule, SharedModule, ViewsSharedModule],
|
|
10188
10499
|
exports: [
|
|
10189
10500
|
DIRECTIVES
|
|
10190
10501
|
],
|
|
@@ -10494,7 +10805,7 @@ TimelineMultiDayViewComponent = __decorate([
|
|
|
10494
10805
|
class="k-current-time" #currentTimeMarker>
|
|
10495
10806
|
</div>
|
|
10496
10807
|
</ng-container>
|
|
10497
|
-
<table class="k-scheduler-table" #contentTable role="presentation">
|
|
10808
|
+
<table class="k-scheduler-table k-user-select-none" #contentTable role="presentation">
|
|
10498
10809
|
<colgroup>
|
|
10499
10810
|
<col *ngFor="let slotIndex of slotsCount | repeat; trackBy: itemIndex;" [ngStyle]="{ 'width.px': columnWidth }" />
|
|
10500
10811
|
</colgroup>
|
|
@@ -10511,7 +10822,14 @@ TimelineMultiDayViewComponent = __decorate([
|
|
|
10511
10822
|
[workDayEnd]="workDayEndTime"
|
|
10512
10823
|
[workWeekStart]="workWeekStart"
|
|
10513
10824
|
[workWeekEnd]="workWeekEnd"
|
|
10825
|
+
selectableSlot
|
|
10514
10826
|
[id]="{ resourceIndex: verticalResources.length ? verticalIndex : horizontalIndex, rangeIndex: rangeIndex, index: index }"
|
|
10827
|
+
[class.k-state-selected]="isSlotSelected({
|
|
10828
|
+
start: toPlainDateTime(daySlot.start, slot.start),
|
|
10829
|
+
end: toPlainDateTime(daySlot.start, slot.end),
|
|
10830
|
+
isAllDay: false,
|
|
10831
|
+
resources: resourcesByIndex(verticalResources.length ? verticalIndex : horizontalIndex)
|
|
10832
|
+
})"
|
|
10515
10833
|
>
|
|
10516
10834
|
<ng-container *ngIf="timeSlotTemplateRef" [ngTemplateOutlet]="timeSlotTemplateRef"
|
|
10517
10835
|
[ngTemplateOutletContext]="{ date: timeSlot.start, resources: resourcesByIndex(timeSlot.id.resourceIndex ) }">
|
|
@@ -13873,6 +14191,107 @@ ShortcutsDirective = __decorate([
|
|
|
13873
14191
|
DialogsService])
|
|
13874
14192
|
], ShortcutsDirective);
|
|
13875
14193
|
|
|
14194
|
+
/**
|
|
14195
|
+
* A directive which manages the in-memory selection state of the Scheduler slots
|
|
14196
|
+
* ([see example]({% slug slotselection_scheduler %}#toc-built-in-directive)).
|
|
14197
|
+
*/
|
|
14198
|
+
let SlotSelectableDirective = class SlotSelectableDirective {
|
|
14199
|
+
constructor(scheduler, cdr) {
|
|
14200
|
+
this.scheduler = scheduler;
|
|
14201
|
+
this.cdr = cdr;
|
|
14202
|
+
/**
|
|
14203
|
+
* Fires when the currently selected slot range has changed through user interaction.
|
|
14204
|
+
*/
|
|
14205
|
+
this.slotSelectionChange = new EventEmitter();
|
|
14206
|
+
this.selectedRange = null;
|
|
14207
|
+
this.slotSelectionChangeSource = new EventEmitter();
|
|
14208
|
+
this.subscriptions = new Subscription();
|
|
14209
|
+
this.scheduler.selectable = true;
|
|
14210
|
+
this.subscriptions.add(this.slotSelectionChangeSource
|
|
14211
|
+
.pipe(distinctUntilChanged(isSameRange)).subscribe((v) => {
|
|
14212
|
+
this.slotSelectionChange.emit(v);
|
|
14213
|
+
}));
|
|
14214
|
+
const start$ = this.scheduler.slotDragStart;
|
|
14215
|
+
const drag$ = this.scheduler.slotDrag;
|
|
14216
|
+
const end$ = this.scheduler.slotDragEnd;
|
|
14217
|
+
const startSource = start$.pipe(filter(e => !e.isDefaultPrevented()));
|
|
14218
|
+
this.subscriptions.add(startSource.subscribe(e => this.initDragSelect(e)));
|
|
14219
|
+
this.subscriptions.add(drag$.subscribe(e => this.onDrag(e)));
|
|
14220
|
+
this.subscriptions.add(end$.subscribe(() => this.onRelease()));
|
|
14221
|
+
}
|
|
14222
|
+
ngOnInit() {
|
|
14223
|
+
this.scheduler.isSlotSelected = this.isSlotSelected.bind(this);
|
|
14224
|
+
}
|
|
14225
|
+
ngOnChanges(changes) {
|
|
14226
|
+
if (isChanged("slotSelection", changes, false)) {
|
|
14227
|
+
/**
|
|
14228
|
+
* The default values for resources below are necessarry because this is not fixed yet: https://github.com/telerik/kendo-angular-scheduler/pull/338
|
|
14229
|
+
*/
|
|
14230
|
+
const resources = this.scheduler.resources ? [this.scheduler.resources[0].data[0]] : [undefined];
|
|
14231
|
+
this.selectedRange = Object.assign({}, { isAllDay: false, resources }, changes.slotSelection.currentValue);
|
|
14232
|
+
this.cdr.markForCheck();
|
|
14233
|
+
}
|
|
14234
|
+
}
|
|
14235
|
+
ngOnDestroy() {
|
|
14236
|
+
this.subscriptions.unsubscribe();
|
|
14237
|
+
}
|
|
14238
|
+
isSlotSelected({ start, end, isAllDay, resources }) {
|
|
14239
|
+
if (!start || !end || !this.selectedRange) {
|
|
14240
|
+
return false;
|
|
14241
|
+
}
|
|
14242
|
+
const match = resourcesMatch(this.selectedRange.resources, resources, true);
|
|
14243
|
+
if (!match) {
|
|
14244
|
+
return false; // Limit selection to the grouped resource where the drag started.
|
|
14245
|
+
}
|
|
14246
|
+
return this.selectedRange && isAllDay === this.selectedRange.isAllDay && this.isInRange(start, end);
|
|
14247
|
+
}
|
|
14248
|
+
initDragSelect({ start, end, isAllDay, resources, originalEvent }) {
|
|
14249
|
+
this.selectionOriginResources = resources.slice();
|
|
14250
|
+
this.selectedRange = { start, end, isAllDay, resources: resources.slice(), originalEvent };
|
|
14251
|
+
this.cdr.markForCheck();
|
|
14252
|
+
}
|
|
14253
|
+
onDrag({ start, end, resources }) {
|
|
14254
|
+
const match = resourcesMatch(this.selectionOriginResources, resources, false); // Not strict - allow matching [ undefined ] and [ undefined ]
|
|
14255
|
+
if (!match) {
|
|
14256
|
+
return; // Don't change selection when dragging over a different grouped resource's cells.
|
|
14257
|
+
}
|
|
14258
|
+
this.selectedRange.start = start;
|
|
14259
|
+
this.selectedRange.end = end;
|
|
14260
|
+
this.cdr.markForCheck();
|
|
14261
|
+
}
|
|
14262
|
+
onRelease() {
|
|
14263
|
+
this.selectionOriginResources = null;
|
|
14264
|
+
if (this.selectedRange) {
|
|
14265
|
+
this.slotSelectionChangeSource.emit(this.selectedRange);
|
|
14266
|
+
}
|
|
14267
|
+
}
|
|
14268
|
+
/**
|
|
14269
|
+
* @hidden
|
|
14270
|
+
* Checks if the selected range contains a local date range.
|
|
14271
|
+
*/
|
|
14272
|
+
isInRange(start, end) {
|
|
14273
|
+
if (!this.selectedRange) {
|
|
14274
|
+
return;
|
|
14275
|
+
}
|
|
14276
|
+
return intersects(start, end, this.selectedRange.start, this.selectedRange.end);
|
|
14277
|
+
}
|
|
14278
|
+
};
|
|
14279
|
+
__decorate([
|
|
14280
|
+
Input(),
|
|
14281
|
+
__metadata("design:type", Object)
|
|
14282
|
+
], SlotSelectableDirective.prototype, "slotSelection", void 0);
|
|
14283
|
+
__decorate([
|
|
14284
|
+
Output(),
|
|
14285
|
+
__metadata("design:type", EventEmitter)
|
|
14286
|
+
], SlotSelectableDirective.prototype, "slotSelectionChange", void 0);
|
|
14287
|
+
SlotSelectableDirective = __decorate([
|
|
14288
|
+
Directive({
|
|
14289
|
+
selector: '[kendoSchedulerSlotSelectable]'
|
|
14290
|
+
}),
|
|
14291
|
+
__metadata("design:paramtypes", [SchedulerComponent,
|
|
14292
|
+
ChangeDetectorRef])
|
|
14293
|
+
], SlotSelectableDirective);
|
|
14294
|
+
|
|
13876
14295
|
const TEMPLATES = [
|
|
13877
14296
|
AgendaDateTemplateDirective,
|
|
13878
14297
|
AgendaTimeTemplateDirective,
|
|
@@ -13893,6 +14312,7 @@ const declarations = [
|
|
|
13893
14312
|
DataBindingDirective,
|
|
13894
14313
|
ShortcutsDirective,
|
|
13895
14314
|
ReactiveEditingDirective,
|
|
14315
|
+
SlotSelectableDirective,
|
|
13896
14316
|
SchedulerDateTimePickerComponent,
|
|
13897
14317
|
RecurrenceEditorComponent,
|
|
13898
14318
|
RecurrenceEndRuleEditorComponent,
|
|
@@ -14534,4 +14954,4 @@ PDFModule = __decorate([
|
|
|
14534
14954
|
* Generated bundle index. Do not edit.
|
|
14535
14955
|
*/
|
|
14536
14956
|
|
|
14537
|
-
export { DataBindingDirective, EditingDirectiveBase, ReactiveEditingDirective, SCHEDULER_DATETIMEPICKER_VALUE_ACCESSOR, SchedulerDateTimePickerComponent, DialogsService, EditDialogTemplateDirective, EditDialogComponent, EditService, LocalDataChangesService, EndRuleRadioButtonDirective, RecurrenceEditorCustomMessagesComponent, RecurrenceEditorLocalizedMessagesDirective, Messages$1 as Messages, RecurrenceLocalizationService, RECURRENCE_VALUE_ACCESSOR, RecurrenceEndRuleEditorComponent, RecurrenceFrequencyEditorComponent, RecurrenceIntervalEditorComponent, RecurrenceMonthlyYearlyEditorComponent, RecurrenceWeekdayRuleEditorComponent, RecurrenceService, RepeatOnRadioButtonDirective, ResourceEditorBase, MULTIPLE_RESOURCE_VALUE_ACCESSOR, MultipleResourceEditorComponent, SINGLE_RESOURCE_VALUE_ACCESSOR, SingleResourceEditorComponent, TIME_ZONE_VALUE_ACCESSOR, TimeZoneEditorComponent, CreateEvent, PreventableEvent$1 as PreventableEvent, LoadingComponent, SchedulerCustomMessagesComponent, LocalizedMessagesDirective, Messages as Messages$1, SchedulerLocalizationService, FocusService, ShortcutsDirective, ToolbarNavigationComponent, ToolbarTemplateDirective, ToolbarComponent, ToolbarModule, publicDirectives, ToolbarViewSelectorComponent, AgendaHeaderItemComponent, AgendaHeaderComponent, AgendaTaskItemComponent, AgendaViewInternalComponent, AgendaListComponent, AgendaViewModule, BaseView, ConfigurationViewBase, DomEventsService, HintContainerComponent, RepeatPipe, ResizeHintComponent, ResourceIteratorPipe, ViewFooterComponent, ViewsSharedModule, WorkHoursFooterDirective, DayTimeSlotService, DayTimeViewBase, DayTimeViewItemComponent, DayTimeViewComponent, DayTimeModule, DaySlotDirective, TimeSlotDirective, MonthSlotDirective, MonthSlotService, MonthViewItemComponent, MonthViewRendererComponent, MonthViewComponent, MonthViewModule, MultiDayViewBase, MultiDayViewRendererComponent, MultiDayViewComponent, MultiDayViewModule, WorkWeekViewComponent, SchedulerViewDirective, AgendaDateTemplateDirective, AgendaTimeTemplateDirective, AllDayEventTemplateDirective, AllDaySlotTemplateDirective, DateHeaderTemplateDirective, EventTemplateDirective, GroupHeaderTemplateDirective, MajorTimeHeaderTemplateDirective, MinorTimeHeaderTemplateDirective, MonthDaySlotTemplateDirective, TimeSlotTemplateDirective, TimelineBase, TimelineMonthViewComponent, TimelineMultiDayViewComponent, TimelineViewComponent, TimelineViewModule, TimelineWeekViewComponent, BaseSlotDirective, BaseSlotService, BaseViewItem, SchedulerComponent, SchedulerModule, ViewContextService, ViewStateService, ToolbarService, AgendaViewComponent, DayViewComponent, WeekViewComponent, RecurrenceEditorComponent, BaseEditService, PDFModule, PDFComponent, PDFService, PDFCommandDirective, PDFExportEvent, FocusableDirective, SharedModule, SchedulerView, DateChangeEvent, NavigateEvent, SlotClickEvent, EventClickEvent, EventKeydownEvent, VIEW_EVENT_MAP, CancelEvent, EditEventBase, RemoveEvent, SaveEvent, ResizeStartEvent, ResizeEvent, ResizeEndEvent, DragStartEvent, DragEvent, DragEndEvent, EditEvent, AddEvent };
|
|
14957
|
+
export { DataBindingDirective, EditingDirectiveBase, ReactiveEditingDirective, SCHEDULER_DATETIMEPICKER_VALUE_ACCESSOR, SchedulerDateTimePickerComponent, DialogsService, EditDialogTemplateDirective, EditDialogComponent, EditService, LocalDataChangesService, EndRuleRadioButtonDirective, RecurrenceEditorCustomMessagesComponent, RecurrenceEditorLocalizedMessagesDirective, Messages$1 as Messages, RecurrenceLocalizationService, RECURRENCE_VALUE_ACCESSOR, RecurrenceEndRuleEditorComponent, RecurrenceFrequencyEditorComponent, RecurrenceIntervalEditorComponent, RecurrenceMonthlyYearlyEditorComponent, RecurrenceWeekdayRuleEditorComponent, RecurrenceService, RepeatOnRadioButtonDirective, ResourceEditorBase, MULTIPLE_RESOURCE_VALUE_ACCESSOR, MultipleResourceEditorComponent, SINGLE_RESOURCE_VALUE_ACCESSOR, SingleResourceEditorComponent, TIME_ZONE_VALUE_ACCESSOR, TimeZoneEditorComponent, CreateEvent, PreventableEvent$1 as PreventableEvent, LoadingComponent, SchedulerCustomMessagesComponent, LocalizedMessagesDirective, Messages as Messages$1, SchedulerLocalizationService, FocusService, ShortcutsDirective, ToolbarNavigationComponent, ToolbarTemplateDirective, ToolbarComponent, ToolbarModule, publicDirectives, ToolbarViewSelectorComponent, AgendaHeaderItemComponent, AgendaHeaderComponent, AgendaTaskItemComponent, AgendaViewInternalComponent, AgendaListComponent, AgendaViewModule, BaseView, ConfigurationViewBase, DomEventsService, HintContainerComponent, RepeatPipe, ResizeHintComponent, ResourceIteratorPipe, SlotSelectableDirective, ViewFooterComponent, ViewsSharedModule, WorkHoursFooterDirective, DayTimeSlotService, DayTimeViewBase, DayTimeViewItemComponent, DayTimeViewComponent, DayTimeModule, DaySlotDirective, TimeSlotDirective, MonthSlotDirective, MonthSlotService, MonthViewItemComponent, MonthViewRendererComponent, MonthViewComponent, MonthViewModule, MultiDayViewBase, MultiDayViewRendererComponent, MultiDayViewComponent, MultiDayViewModule, WorkWeekViewComponent, SchedulerViewDirective, AgendaDateTemplateDirective, AgendaTimeTemplateDirective, AllDayEventTemplateDirective, AllDaySlotTemplateDirective, DateHeaderTemplateDirective, EventTemplateDirective, GroupHeaderTemplateDirective, MajorTimeHeaderTemplateDirective, MinorTimeHeaderTemplateDirective, MonthDaySlotTemplateDirective, TimeSlotTemplateDirective, TimelineBase, TimelineMonthViewComponent, TimelineMultiDayViewComponent, TimelineViewComponent, TimelineViewModule, TimelineWeekViewComponent, BaseSlotDirective, BaseSlotService, BaseViewItem, SchedulerComponent, SchedulerModule, ViewContextService, ViewStateService, ToolbarService, AgendaViewComponent, DayViewComponent, WeekViewComponent, RecurrenceEditorComponent, BaseEditService, PDFModule, PDFComponent, PDFService, PDFCommandDirective, PDFExportEvent, FocusableDirective, SharedModule, IsSlotSelectedArgs, SchedulerView, DateChangeEvent, NavigateEvent, SlotClickEvent, EventClickEvent, EventKeydownEvent, VIEW_EVENT_MAP, CancelEvent, EditEventBase, RemoveEvent, SaveEvent, ResizeStartEvent, ResizeEvent, ResizeEndEvent, DragStartEvent, DragEvent, DragEndEvent, EditEvent, AddEvent, SlotDragStartEvent, SlotDragEvent, SlotDragEndEvent };
|