@progress/kendo-angular-gantt 0.3.0-dev.202201131518 → 0.3.0-dev.202201190830

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.
Files changed (82) hide show
  1. package/dist/cdn/js/kendo-angular-gantt.js +2 -2
  2. package/dist/cdn/main.js +2 -2
  3. package/dist/es/editing/edit-dialog.component.js +3 -3
  4. package/dist/es/editing/edit.service.js +4 -2
  5. package/dist/es/gantt.component.js +191 -24
  6. package/dist/es/index.js +1 -0
  7. package/dist/es/models/events/task-delete-event.interface.js +4 -0
  8. package/dist/es/navigation/navigation-models.js +4 -0
  9. package/dist/es/navigation/navigation.service.js +390 -0
  10. package/dist/es/navigation/utils.js +77 -0
  11. package/dist/es/package-metadata.js +1 -1
  12. package/dist/es/rendering/gantt-milestone-task.component.js +7 -4
  13. package/dist/es/rendering/gantt-summary-task.component.js +22 -4
  14. package/dist/es/rendering/gantt-task-base.js +57 -6
  15. package/dist/es/rendering/gantt-task.component.js +9 -6
  16. package/dist/es/rendering/gantt-tasks-table-body.component.js +9 -5
  17. package/dist/es/timeline/gantt-timeline.component.js +10 -6
  18. package/dist/es/toolbar/toolbar.component.js +12 -13
  19. package/dist/es/toolbar/view-selector.component.js +1 -1
  20. package/dist/es/utils.js +14 -4
  21. package/dist/es2015/editing/edit-dialog.component.d.ts +1 -1
  22. package/dist/es2015/editing/edit-dialog.component.js +11 -3
  23. package/dist/es2015/editing/edit.service.d.ts +2 -3
  24. package/dist/es2015/editing/edit.service.js +4 -2
  25. package/dist/es2015/editing/utils.d.ts +2 -2
  26. package/dist/es2015/gantt.component.d.ts +75 -16
  27. package/dist/es2015/gantt.component.js +177 -26
  28. package/dist/es2015/index.d.ts +1 -0
  29. package/dist/es2015/index.js +1 -0
  30. package/dist/es2015/index.metadata.json +1 -1
  31. package/dist/es2015/models/events/task-click-event.interface.d.ts +3 -3
  32. package/dist/es2015/models/events/task-delete-event.interface.d.ts +21 -0
  33. package/dist/es2015/models/events/task-delete-event.interface.js +4 -0
  34. package/dist/es2015/models/events/task-edit-event.interface.d.ts +27 -10
  35. package/dist/es2015/models/models.d.ts +2 -0
  36. package/dist/es2015/navigation/navigation-models.d.ts +34 -0
  37. package/dist/es2015/navigation/navigation-models.js +4 -0
  38. package/dist/es2015/navigation/navigation.service.d.ts +126 -0
  39. package/dist/es2015/navigation/navigation.service.js +355 -0
  40. package/dist/es2015/navigation/utils.d.ts +26 -0
  41. package/dist/es2015/navigation/utils.js +69 -0
  42. package/dist/es2015/package-metadata.js +1 -1
  43. package/dist/es2015/rendering/gantt-milestone-task.component.d.ts +2 -1
  44. package/dist/es2015/rendering/gantt-milestone-task.component.js +18 -4
  45. package/dist/es2015/rendering/gantt-summary-task.component.d.ts +4 -1
  46. package/dist/es2015/rendering/gantt-summary-task.component.js +30 -4
  47. package/dist/es2015/rendering/gantt-task-base.d.ts +10 -2
  48. package/dist/es2015/rendering/gantt-task-base.js +48 -6
  49. package/dist/es2015/rendering/gantt-task.component.d.ts +3 -2
  50. package/dist/es2015/rendering/gantt-task.component.js +31 -9
  51. package/dist/es2015/rendering/gantt-tasks-table-body.component.d.ts +5 -3
  52. package/dist/es2015/rendering/gantt-tasks-table-body.component.js +23 -12
  53. package/dist/es2015/scrolling/scroll-sync.service.d.ts +1 -1
  54. package/dist/es2015/timeline/gantt-timeline.component.d.ts +5 -3
  55. package/dist/es2015/timeline/gantt-timeline.component.js +15 -6
  56. package/dist/es2015/toolbar/toolbar.component.d.ts +4 -5
  57. package/dist/es2015/toolbar/toolbar.component.js +12 -13
  58. package/dist/es2015/toolbar/view-selector.component.js +3 -1
  59. package/dist/es2015/utils.d.ts +10 -3
  60. package/dist/es2015/utils.js +14 -4
  61. package/dist/fesm2015/index.js +2311 -1610
  62. package/dist/fesm5/index.js +1722 -1013
  63. package/dist/npm/editing/edit-dialog.component.js +3 -3
  64. package/dist/npm/editing/edit.service.js +4 -2
  65. package/dist/npm/gantt.component.js +191 -24
  66. package/dist/npm/index.js +2 -0
  67. package/dist/npm/models/events/task-delete-event.interface.js +6 -0
  68. package/dist/npm/navigation/navigation-models.js +6 -0
  69. package/dist/npm/navigation/navigation.service.js +392 -0
  70. package/dist/npm/navigation/utils.js +79 -0
  71. package/dist/npm/package-metadata.js +1 -1
  72. package/dist/npm/rendering/gantt-milestone-task.component.js +7 -4
  73. package/dist/npm/rendering/gantt-summary-task.component.js +22 -4
  74. package/dist/npm/rendering/gantt-task-base.js +57 -6
  75. package/dist/npm/rendering/gantt-task.component.js +9 -6
  76. package/dist/npm/rendering/gantt-tasks-table-body.component.js +9 -5
  77. package/dist/npm/timeline/gantt-timeline.component.js +10 -6
  78. package/dist/npm/toolbar/toolbar.component.js +10 -11
  79. package/dist/npm/toolbar/view-selector.component.js +1 -1
  80. package/dist/npm/utils.js +14 -4
  81. package/dist/systemjs/kendo-angular-gantt.js +1 -1
  82. package/package.json +1 -1
@@ -2,18 +2,18 @@
2
2
  * Copyright © 2021 Progress Software Corporation. All rights reserved.
3
3
  * Licensed under commercial license. See LICENSE.md in the project root for more information
4
4
  *-------------------------------------------------------------------------------------------*/
5
- import { __extends, __decorate, __metadata, __param, __assign } from 'tslib';
6
- import { Input, Injectable, EventEmitter, Directive, Optional, TemplateRef, QueryList, ContentChildren, ContentChild, Component, forwardRef, SkipSelf, Host, Injector, NgZone, ViewChild, ElementRef, ViewContainerRef, HostBinding, Output, Renderer2, isDevMode, InjectionToken, Inject, ChangeDetectorRef, NgModule } from '@angular/core';
5
+ import { __decorate, __metadata, __assign, __extends, __param } from 'tslib';
6
+ import { Injectable, NgZone, ViewChild, ElementRef, ViewContainerRef, HostBinding, Input, TemplateRef, Output, EventEmitter, Component, Renderer2, Directive, Optional, QueryList, ContentChildren, ContentChild, forwardRef, SkipSelf, Host, Injector, isDevMode, InjectionToken, Inject, ChangeDetectorRef, NgModule } from '@angular/core';
7
7
  import { ColumnBase, ColumnComponent, ColumnGroupComponent, SpanColumnComponent, TreeListComponent, DataBoundTreeComponent, ExpandableTreeComponent, FlatBindingDirective, HierarchyBindingDirective, ExpandableDirective, TreeListModule } from '@progress/kendo-angular-treelist';
8
8
  import { cloneDate, addWeeks, firstDayInWeek, addDays, getDate, lastDayOfMonth, firstDayOfMonth, addMonths, isEqual, MS_PER_HOUR, MS_PER_DAY } from '@progress/kendo-date-math';
9
- import { of, fromEvent, Subject, Subscription, forkJoin, EMPTY, isObservable } from 'rxjs';
9
+ import { fromEvent, Subject, Subscription, of, forkJoin, EMPTY, isObservable } from 'rxjs';
10
10
  import { validatePackage } from '@progress/kendo-licensing';
11
- import { closestInScope, matchesClasses, isDocumentAvailable, anyChanged, hasObservers, EventsModule, DraggableModule } from '@progress/kendo-angular-common';
11
+ import { closestInScope, matchesClasses, isDocumentAvailable, Keys, hasObservers, anyChanged, EventsModule, DraggableModule } from '@progress/kendo-angular-common';
12
+ import { map, distinctUntilChanged, take, filter, switchMap, expand, reduce } from 'rxjs/operators';
13
+ import { getter, touchEnabled } from '@progress/kendo-common';
12
14
  import { LocalizationService, ComponentMessages, L10N_PREFIX } from '@progress/kendo-angular-l10n';
13
15
  import { IntlService } from '@progress/kendo-angular-intl';
14
16
  import { orderBy } from '@progress/kendo-data-query';
15
- import { getter, touchEnabled } from '@progress/kendo-common';
16
- import { map, distinctUntilChanged, take, expand, reduce, filter, switchMap } from 'rxjs/operators';
17
17
  import { CommonModule } from '@angular/common';
18
18
  import { FormGroup, FormControl, Validators, FormArray, ReactiveFormsModule } from '@angular/forms';
19
19
  import { SplitterModule, TabStripModule } from '@progress/kendo-angular-layout';
@@ -33,11 +33,704 @@ var packageMetadata = {
33
33
  name: '@progress/kendo-angular-gantt',
34
34
  productName: 'Kendo UI for Angular',
35
35
  productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
36
- publishDate: 1642086647,
36
+ publishDate: 1642580546,
37
37
  version: '',
38
38
  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'
39
39
  };
40
40
 
41
+ /**
42
+ * @hidden
43
+ */
44
+ var ScrollSyncService = /** @class */ (function () {
45
+ function ScrollSyncService(ngZone) {
46
+ var _this = this;
47
+ this.ngZone = ngZone;
48
+ this.changes = new Subject();
49
+ this.elements = [];
50
+ this.subscriptions = new Subscription();
51
+ this.subscriptions.add(this.changes.subscribe(function (args) {
52
+ _this.scroll(args);
53
+ }));
54
+ }
55
+ ScrollSyncService.prototype.registerElement = function (el, sourceType) {
56
+ var _this = this;
57
+ this.elements.push({ element: el, sourceType: sourceType });
58
+ if (sourceType === "timeline" || sourceType === "treelist") {
59
+ this.ngZone.runOutsideAngular(function () {
60
+ var obs = fromEvent(el, 'scroll').pipe(map(function (_a) {
61
+ var _b = _a.target, scrollTop = _b.scrollTop, scrollLeft = _b.scrollLeft;
62
+ return ({
63
+ scrollTop: scrollTop,
64
+ scrollLeft: scrollLeft,
65
+ sourceType: sourceType
66
+ });
67
+ }));
68
+ var comparisonFn = sourceType === 'timeline' ?
69
+ function (x, y) { return (x.scrollTop === y.scrollTop) && (x.scrollLeft === y.scrollLeft); } :
70
+ function (x, y) { return (x.scrollTop === y.scrollTop); };
71
+ _this.subscriptions.add(obs.pipe(distinctUntilChanged(comparisonFn))
72
+ .subscribe(function (event) { return _this.changes.next(event); }));
73
+ });
74
+ }
75
+ };
76
+ ScrollSyncService.prototype.ngOnDestroy = function () {
77
+ this.subscriptions.unsubscribe();
78
+ this.elements = null;
79
+ };
80
+ ScrollSyncService.prototype.syncScrollTop = function (sourceType, targetType) {
81
+ var source = this.elements.find(function (element) { return element.sourceType === sourceType; });
82
+ var target = this.elements.find(function (element) { return element.sourceType === targetType; });
83
+ // Need to wait for the splitter pane's content to be rendered
84
+ this.ngZone.onStable.pipe(take(1)).subscribe(function () { return target.element.scrollTop = source.element.scrollTop; });
85
+ };
86
+ ScrollSyncService.prototype.resetTimelineScrollLeft = function () {
87
+ var source = this.elements.find(function (element) { return element.sourceType === 'timeline'; });
88
+ source.element.scrollLeft = 0;
89
+ };
90
+ ScrollSyncService.prototype.scroll = function (_a) {
91
+ var _this = this;
92
+ var scrollTop = _a.scrollTop, scrollLeft = _a.scrollLeft, sourceType = _a.sourceType;
93
+ this.ngZone.runOutsideAngular(function () {
94
+ if (sourceType === 'timeline') {
95
+ var header = _this.elements.find(function (element) { return element.sourceType === 'header'; }).element;
96
+ header.scrollLeft = scrollLeft;
97
+ if (!_this.syncingTimeline) {
98
+ _this.syncingTreeList = true;
99
+ var treelist = _this.elements.find(function (element) { return element.sourceType === 'treelist'; }).element;
100
+ treelist.scrollTop = scrollTop;
101
+ }
102
+ _this.syncingTimeline = false;
103
+ }
104
+ if (sourceType === 'treelist') {
105
+ if (!_this.syncingTreeList) {
106
+ _this.syncingTimeline = true;
107
+ var timeline = _this.elements.find(function (element) { return element.sourceType === 'timeline'; }).element;
108
+ timeline.scrollTop = scrollTop;
109
+ }
110
+ _this.syncingTreeList = false;
111
+ }
112
+ });
113
+ };
114
+ ScrollSyncService = __decorate([
115
+ Injectable(),
116
+ __metadata("design:paramtypes", [NgZone])
117
+ ], ScrollSyncService);
118
+ return ScrollSyncService;
119
+ }());
120
+
121
+ /**
122
+ * @hidden
123
+ */
124
+ var DEFAULT_DEPENDENCY_MODEL_FIELDS = Object.freeze({
125
+ toId: 'toId',
126
+ fromId: 'fromId',
127
+ id: 'id',
128
+ type: 'type'
129
+ });
130
+
131
+ /**
132
+ * @hidden
133
+ */
134
+ var DEFAULT_TASK_MODEL_FIELDS = Object.freeze({
135
+ id: 'id',
136
+ start: 'start',
137
+ end: 'end',
138
+ title: 'title',
139
+ completionRatio: 'completionRatio',
140
+ children: 'children'
141
+ });
142
+
143
+ /**
144
+ * The dependency type when two tasks are connected.
145
+ *
146
+ * The supported values are:
147
+ * * `FF`—from 'finish' to 'finish'
148
+ * * `FS`—from 'finish' to 'start'
149
+ * * `SS`—from 'start' to 'start'
150
+ * * `SF`—from 'start' to 'finish'
151
+ */
152
+ var DependencyType;
153
+ (function (DependencyType) {
154
+ DependencyType[DependencyType["FF"] = 0] = "FF";
155
+ DependencyType[DependencyType["FS"] = 1] = "FS";
156
+ DependencyType[DependencyType["SF"] = 2] = "SF";
157
+ DependencyType[DependencyType["SS"] = 3] = "SS"; // task B can't start before task A starts
158
+ })(DependencyType || (DependencyType = {}));
159
+
160
+ /**
161
+ * @hidden
162
+ */
163
+ var isWorkDay = function (date, start, end) {
164
+ return date.getDay() >= start && date.getDay() <= end;
165
+ };
166
+ /**
167
+ * @hidden
168
+ */
169
+ var isWorkHour = function (date, start, end) {
170
+ return date.getHours() >= start && date.getHours() <= end;
171
+ };
172
+ /**
173
+ * @hidden
174
+ */
175
+ var isPresent = function (item) { return item !== null && item !== undefined; };
176
+ /**
177
+ * @hidden
178
+ *
179
+ * Normalized the data to an array in case a falsy value is passed
180
+ * or a TreeListDataResult object (applicable for the data-binding directives).
181
+ */
182
+ var normalizeGanttData = function (data) {
183
+ if (!isPresent(data)) {
184
+ return [];
185
+ }
186
+ else if (Array.isArray(data.data)) {
187
+ return data.data;
188
+ }
189
+ else {
190
+ return data;
191
+ }
192
+ };
193
+ /**
194
+ * @hidden
195
+ *
196
+ * Returns a new date with the specified hours, minutes, seconds and millliseconds set.
197
+ * Only the hours are required, the rest of the params are set to `0` by default.
198
+ */
199
+ var setTime = function (date, hours, minutes, seconds, milliseconds) {
200
+ if (minutes === void 0) { minutes = 0; }
201
+ if (seconds === void 0) { seconds = 0; }
202
+ if (milliseconds === void 0) { milliseconds = 0; }
203
+ if (!isPresent(date)) {
204
+ return null;
205
+ }
206
+ var result = cloneDate(date);
207
+ result.setHours(hours);
208
+ result.setMinutes(minutes);
209
+ result.setSeconds(seconds);
210
+ result.setMilliseconds(milliseconds);
211
+ return result;
212
+ };
213
+ /**
214
+ * @hidden
215
+ *
216
+ * Returns the last day of a week.
217
+ * @param standingPoint - Any day of the target week.
218
+ * @param firstWeekDay - The week's starting day (e.g. Monday, Tuesday, etc.)
219
+ */
220
+ var lastDayOfWeek = function (standingPoint, firstWeekDay) {
221
+ var followingWeek = addWeeks(standingPoint, 1);
222
+ var firstDayOfFollowingWeek = firstDayInWeek(followingWeek, firstWeekDay);
223
+ var lastDayOfTargetWeek = addDays(firstDayOfFollowingWeek, -1);
224
+ return lastDayOfTargetWeek;
225
+ };
226
+ /**
227
+ * Persists the intially resolved scrollbar width value.
228
+ */
229
+ var SCROLLBAR_WIDTH;
230
+ /**
231
+ * @hidden
232
+ *
233
+ * Gets the default scrollbar width accoring to the current environment.
234
+ */
235
+ var scrollbarWidth = function () {
236
+ if (!isDocumentAvailable()) {
237
+ return;
238
+ }
239
+ // calculate scrollbar width only once, then return the cached value
240
+ if (isNaN(SCROLLBAR_WIDTH)) {
241
+ var div = document.createElement('div');
242
+ div.style.cssText = 'overflow: scroll; overflow-x: hidden; zoom: 1; clear: both; display: block;';
243
+ div.innerHTML = '&nbsp;';
244
+ document.body.appendChild(div);
245
+ SCROLLBAR_WIDTH = div.offsetWidth - div.scrollWidth;
246
+ document.body.removeChild(div);
247
+ }
248
+ return SCROLLBAR_WIDTH;
249
+ };
250
+ /**
251
+ * @hidden
252
+ */
253
+ var isColumnGroup = function (column) { return column.isColumnGroup; };
254
+ /**
255
+ * @hidden
256
+ */
257
+ var isNumber = function (contender) { return typeof contender === 'number' && !isNaN(contender); };
258
+ /**
259
+ * @hidden
260
+ */
261
+ var isString = function (contender) { return typeof contender === 'string'; };
262
+ /**
263
+ * @hidden
264
+ *
265
+ * Gets the closest timeline task wrapper element from an event target.
266
+ * Restricts the search up to the provided parent element from the second param.
267
+ */
268
+ var getClosestTaskWrapper = function (element, parentScope) {
269
+ return closestInScope(element, matchesClasses('k-task-wrap'), parentScope);
270
+ };
271
+ /**
272
+ * @hidden
273
+ *
274
+ * Checks whether the queried item or its parent items has a `k-task-wrap` selector.
275
+ * Restricts the search up to the provided parent element from the second param.
276
+ */
277
+ var isTaskWrapper = function (contender, parentScope) {
278
+ var taskWrapper = closestInScope(contender, matchesClasses('k-task-wrap'), parentScope);
279
+ return isPresent(taskWrapper);
280
+ };
281
+ /**
282
+ * @hidden
283
+ *
284
+ * Gets the closest timeline task element index from an event target.
285
+ * Uses the `data-task-index` attribute assigned to each task.
286
+ * Restricts the search up to the provided parent element from the second param.
287
+ */
288
+ var getClosestTaskIndex = function (element, parentScope) {
289
+ var task = closestInScope(element, matchesClasses('k-task-wrap'), parentScope);
290
+ if (!isPresent(task)) {
291
+ return null;
292
+ }
293
+ return Number(task.getAttribute('data-task-index'));
294
+ };
295
+ /**
296
+ * @hidden
297
+ *
298
+ * Checks whether the queried item or its parent items has a `k-task` selector.
299
+ * Restricts the search up to the provided parent element from the second param.
300
+ */
301
+ var isTask = function (contender, parentScope) {
302
+ var task = closestInScope(contender, matchesClasses('k-task'), parentScope);
303
+ return isPresent(task);
304
+ };
305
+ /**
306
+ * @hidden
307
+ *
308
+ * Checks whether the queried item or its parent items has a `k-toolbar` selector.
309
+ * Restricts the search up to the provided parent element from the second param.
310
+ */
311
+ var isToolbar = function (contender, parentScope) {
312
+ var toolbar = closestInScope(contender, matchesClasses('k-gantt-toolbar'), parentScope);
313
+ return isPresent(toolbar);
314
+ };
315
+ /**
316
+ * @hidden
317
+ *
318
+ * Checks whether the queried item or its parent items has a `k-task-actions` selector - used for the clear button.
319
+ * Restricts the search up to the provided parent element from the second param.
320
+ */
321
+ var isClearButton = function (contender, parentScope) {
322
+ var clearButtonContainer = closestInScope(contender, matchesClasses('k-task-actions'), parentScope);
323
+ return isPresent(clearButtonContainer);
324
+ };
325
+ /**
326
+ * @hidden
327
+ *
328
+ * Checks whether the queried item has a `k-task-dot` selector - used for the dependency drag clues.
329
+ */
330
+ var isDependencyDragClue = function (element) {
331
+ if (!isPresent(element)) {
332
+ return false;
333
+ }
334
+ return element.classList.contains('k-task-dot');
335
+ };
336
+ /**
337
+ * @hidden
338
+ *
339
+ * Checks whether the queried item has a `k-task-dot` & `k-task-start` selector - used for the dependency drag start clues.
340
+ */
341
+ var isDependencyDragStartClue = function (element) {
342
+ if (!isPresent(element)) {
343
+ return false;
344
+ }
345
+ return element.classList.contains('k-task-dot') && element.classList.contains('k-task-start');
346
+ };
347
+ /**
348
+ * @hidden
349
+ *
350
+ * Gets the `DependencyType` for an attempted dependency create from the provided two elements.
351
+ * The two linked drag clue HTML elements are used to extract this data (via their CSS classes).
352
+ */
353
+ var getDependencyTypeFromTargetTasks = function (fromTaskClue, toTaskClue) {
354
+ if (!isDependencyDragClue(fromTaskClue) || !isDependencyDragClue(toTaskClue)) {
355
+ return null;
356
+ }
357
+ var fromTaskType = isDependencyDragStartClue(fromTaskClue) ? 'S' : 'F';
358
+ var toTaskType = isDependencyDragStartClue(toTaskClue) ? 'S' : 'F';
359
+ var dependencyTypeName = "" + fromTaskType + toTaskType;
360
+ switch (dependencyTypeName) {
361
+ case 'FF': return DependencyType.FF;
362
+ case 'FS': return DependencyType.FS;
363
+ case 'SF': return DependencyType.SF;
364
+ case 'SS': return DependencyType.SS;
365
+ default: return null;
366
+ }
367
+ };
368
+ /**
369
+ * @hidden
370
+ *
371
+ * Checks whether the two provided drag clues belong to the same task element.
372
+ */
373
+ var sameTaskClues = function (fromTaskClue, toTaskClue, parentScope) {
374
+ if (!isPresent(fromTaskClue) || !isPresent(toTaskClue)) {
375
+ return false;
376
+ }
377
+ var fromTaskWrapper = getClosestTaskWrapper(fromTaskClue, parentScope);
378
+ var toTaskWrapper = getClosestTaskWrapper(toTaskClue, parentScope);
379
+ return fromTaskWrapper === toTaskWrapper;
380
+ };
381
+ /**
382
+ * @hidden
383
+ *
384
+ * Fits a contender number between a min and max range.
385
+ * If the contender is below the min value, the min value is returned.
386
+ * If the contender is above the max value, the max value is returned.
387
+ */
388
+ var fitToRange = function (contender, min, max) {
389
+ if (!isPresent(contender) || contender < min) {
390
+ return min;
391
+ }
392
+ else if (contender > max) {
393
+ return max;
394
+ }
395
+ else {
396
+ return contender;
397
+ }
398
+ };
399
+ /**
400
+ * @hidden
401
+ *
402
+ * Checks whether either of the two provided tasks is a parent of the other.
403
+ */
404
+ var areParentChild = function (taskA, taskB) {
405
+ var parentChildRelationship = false;
406
+ var taskAParent = taskA;
407
+ while (isPresent(taskAParent) && isPresent(taskAParent.data)) {
408
+ if (taskAParent.data === taskB.data) {
409
+ parentChildRelationship = true;
410
+ break;
411
+ }
412
+ taskAParent = taskAParent.parent;
413
+ }
414
+ var taskBParent = taskB;
415
+ while (!parentChildRelationship && isPresent(taskBParent) && isPresent(taskBParent.data)) {
416
+ if (taskBParent.data === taskA.data) {
417
+ parentChildRelationship = true;
418
+ break;
419
+ }
420
+ taskBParent = taskBParent.parent;
421
+ }
422
+ return parentChildRelationship;
423
+ };
424
+ /**
425
+ * @hidden
426
+ *
427
+ * Extracts an element from the provided client coords.
428
+ * Using the `event.target` is not reliable under mobile devices with the current implementation of the draggable, so use this instead.
429
+ */
430
+ var elementFromPoint = function (clientX, clientY) {
431
+ if (!isDocumentAvailable()) {
432
+ return null;
433
+ }
434
+ return document.elementFromPoint(clientX, clientY);
435
+ };
436
+
437
+ /**
438
+ * @hidden
439
+ */
440
+ var MappingService = /** @class */ (function () {
441
+ function MappingService() {
442
+ this._taskFields = __assign({}, DEFAULT_TASK_MODEL_FIELDS);
443
+ this._dependencyFields = __assign({}, DEFAULT_DEPENDENCY_MODEL_FIELDS);
444
+ }
445
+ Object.defineProperty(MappingService.prototype, "taskFields", {
446
+ get: function () {
447
+ return this._taskFields;
448
+ },
449
+ /**
450
+ * Gets or sets the model fields for the task data items.
451
+ * Uses the default values for fields which are not specified.
452
+ */
453
+ set: function (fields) {
454
+ this._taskFields = __assign({}, DEFAULT_TASK_MODEL_FIELDS, fields);
455
+ },
456
+ enumerable: true,
457
+ configurable: true
458
+ });
459
+ Object.defineProperty(MappingService.prototype, "dependencyFields", {
460
+ get: function () {
461
+ return this._dependencyFields;
462
+ },
463
+ /**
464
+ * Gets or sets the model fields for the depenency data items.
465
+ * Uses the default values for fields which are not specified.
466
+ */
467
+ set: function (fields) {
468
+ this._dependencyFields = __assign({}, DEFAULT_DEPENDENCY_MODEL_FIELDS, fields);
469
+ },
470
+ enumerable: true,
471
+ configurable: true
472
+ });
473
+ /**
474
+ * Retrieves the value for the specified task field.
475
+ * Supports nested fields as well (e.g. 'manager.id').
476
+ */
477
+ MappingService.prototype.extractFromTask = function (dataItem, field) {
478
+ if (!isPresent(this.taskFields)) {
479
+ return null;
480
+ }
481
+ return getter(this.taskFields[field])(dataItem);
482
+ };
483
+ /**
484
+ * Retrieves the value for the specified dependency field.
485
+ * Supports nested fields as well (e.g. 'manager.id').
486
+ */
487
+ MappingService.prototype.extractFromDependency = function (dataItem, field) {
488
+ if (!isPresent(this.dependencyFields)) {
489
+ return null;
490
+ }
491
+ return getter(this.dependencyFields[field])(dataItem);
492
+ };
493
+ MappingService = __decorate([
494
+ Injectable()
495
+ ], MappingService);
496
+ return MappingService;
497
+ }());
498
+
499
+ /**
500
+ * @hidden
501
+ */
502
+ var DependencyDomService = /** @class */ (function () {
503
+ function DependencyDomService(mapper) {
504
+ this.mapper = mapper;
505
+ this.notifier = new Subject();
506
+ /**
507
+ * Maps each rendered task to its HTML element.
508
+ * Uses the task ID field value as key.
509
+ */
510
+ this.tasks = new Map();
511
+ }
512
+ Object.defineProperty(DependencyDomService.prototype, "taskChanges", {
513
+ /**
514
+ * Emits each time some of the tasks or the view have changed.
515
+ * Fires also on the first change of the table rows and the parent container.
516
+ */
517
+ get: function () {
518
+ return this.notifier.asObservable();
519
+ },
520
+ enumerable: true,
521
+ configurable: true
522
+ });
523
+ Object.defineProperty(DependencyDomService.prototype, "dependencyDomArgs", {
524
+ get: function () {
525
+ return {
526
+ tasks: this.tasks,
527
+ contentContainer: this.contentContainer,
528
+ timelineRow: this.timelineRow
529
+ };
530
+ },
531
+ enumerable: true,
532
+ configurable: true
533
+ });
534
+ DependencyDomService.prototype.ngOnDestroy = function () {
535
+ this.tasks.clear();
536
+ this.tasks = null;
537
+ this.contentContainer = null;
538
+ };
539
+ DependencyDomService.prototype.registerTimelineRow = function (timelineRow) {
540
+ this.timelineRow = timelineRow;
541
+ this.notifyChanges();
542
+ };
543
+ DependencyDomService.prototype.registerContentContainer = function (contentContainer) {
544
+ this.contentContainer = contentContainer;
545
+ this.notifyChanges();
546
+ };
547
+ DependencyDomService.prototype.registerTask = function (task, element) {
548
+ var id = this.mapper.extractFromTask(task, 'id');
549
+ this.tasks.set(id, element);
550
+ this.notifyChanges();
551
+ };
552
+ DependencyDomService.prototype.unregisterTask = function (task) {
553
+ var id = this.mapper.extractFromTask(task, 'id');
554
+ this.tasks.delete(id);
555
+ this.notifyChanges();
556
+ };
557
+ /**
558
+ * Notifies all dependency directives that a change in one of the elements has occured.
559
+ */
560
+ DependencyDomService.prototype.notifyChanges = function () {
561
+ this.notifier.next(this.dependencyDomArgs);
562
+ };
563
+ DependencyDomService = __decorate([
564
+ Injectable(),
565
+ __metadata("design:paramtypes", [MappingService])
566
+ ], DependencyDomService);
567
+ return DependencyDomService;
568
+ }());
569
+
570
+ /**
571
+ * @hidden
572
+ */
573
+ var GanttTimelineComponent = /** @class */ (function () {
574
+ function GanttTimelineComponent(scrollSyncService, dependencyDomService, renderer, zone) {
575
+ var _this = this;
576
+ this.scrollSyncService = scrollSyncService;
577
+ this.dependencyDomService = dependencyDomService;
578
+ this.renderer = renderer;
579
+ this.zone = zone;
580
+ this.hostClass = true;
581
+ this.dependencies = [];
582
+ // as all drag-and-drop operations are on the timeline container, use a single draggable instance
583
+ this.timelineContainerPress = new EventEmitter();
584
+ this.timelineContainerDrag = new EventEmitter();
585
+ this.timelineContainerRelease = new EventEmitter();
586
+ this.subscriptions = new Subscription();
587
+ this.subscriptions.add(
588
+ // task changes indicates change in row content, number, height, etc.
589
+ this.dependencyDomService.taskChanges
590
+ .pipe(filter(function (args) { return isPresent(args.timelineRow); }), switchMap(function (args) { return _this.zone.onStable.pipe(take(1), map(function () { return args; })); }) // ensure the content is rendered
591
+ )
592
+ .subscribe(function (_a) {
593
+ var timelineRow = _a.timelineRow;
594
+ var timelineRowHeight = isDocumentAvailable() ? timelineRow.getBoundingClientRect().height : 0;
595
+ _this.renderer.setStyle(_this.timelineColumns.nativeElement, 'height', (_this.rows || []).length * timelineRowHeight + "px");
596
+ }));
597
+ }
598
+ Object.defineProperty(GanttTimelineComponent.prototype, "draggableEnabled", {
599
+ /**
600
+ * Specifies whether the draggable will attach or detach its pointer event listeners.
601
+ */
602
+ get: function () {
603
+ return this.renderDependencyDragClues;
604
+ },
605
+ enumerable: true,
606
+ configurable: true
607
+ });
608
+ GanttTimelineComponent.prototype.ngAfterViewInit = function () {
609
+ var timelineHeader = this.timelineHeaderWrap.nativeElement;
610
+ var rightContainer = this.timelineContent.nativeElement;
611
+ this.scrollSyncService.registerElement(rightContainer, 'timeline');
612
+ this.scrollSyncService.registerElement(timelineHeader, 'header');
613
+ this.dependencyDomService.registerContentContainer(this.tasksContainer.nativeElement);
614
+ };
615
+ GanttTimelineComponent.prototype.ngOnDestroy = function () {
616
+ this.subscriptions.unsubscribe();
617
+ };
618
+ GanttTimelineComponent.prototype.isNonWorking = function (item) {
619
+ return item.hasOwnProperty('isWorking') && !item.isWorking;
620
+ };
621
+ __decorate([
622
+ ViewChild('timelineContent', { static: true }),
623
+ __metadata("design:type", ElementRef)
624
+ ], GanttTimelineComponent.prototype, "timelineContent", void 0);
625
+ __decorate([
626
+ ViewChild('timelineColumns', { static: true }),
627
+ __metadata("design:type", ElementRef)
628
+ ], GanttTimelineComponent.prototype, "timelineColumns", void 0);
629
+ __decorate([
630
+ ViewChild('timelineHeaderWrap', { static: true }),
631
+ __metadata("design:type", ElementRef)
632
+ ], GanttTimelineComponent.prototype, "timelineHeaderWrap", void 0);
633
+ __decorate([
634
+ ViewChild('tasksContainer', { static: true }),
635
+ __metadata("design:type", ElementRef)
636
+ ], GanttTimelineComponent.prototype, "tasksContainer", void 0);
637
+ __decorate([
638
+ ViewChild('dragPopupContainer', { static: false, read: ViewContainerRef }),
639
+ __metadata("design:type", ViewContainerRef)
640
+ ], GanttTimelineComponent.prototype, "dragPopupContainer", void 0);
641
+ __decorate([
642
+ ViewChild('dependencyDragCreatePolyline', { static: false }),
643
+ __metadata("design:type", ElementRef)
644
+ ], GanttTimelineComponent.prototype, "dependencyDragCreatePolyline", void 0);
645
+ __decorate([
646
+ HostBinding('class.k-gantt-timeline'),
647
+ __metadata("design:type", Boolean)
648
+ ], GanttTimelineComponent.prototype, "hostClass", void 0);
649
+ __decorate([
650
+ Input(),
651
+ __metadata("design:type", Array)
652
+ ], GanttTimelineComponent.prototype, "rows", void 0);
653
+ __decorate([
654
+ Input(),
655
+ __metadata("design:type", Array)
656
+ ], GanttTimelineComponent.prototype, "slots", void 0);
657
+ __decorate([
658
+ Input(),
659
+ __metadata("design:type", Array)
660
+ ], GanttTimelineComponent.prototype, "groupSlots", void 0);
661
+ __decorate([
662
+ Input(),
663
+ __metadata("design:type", Number)
664
+ ], GanttTimelineComponent.prototype, "tableWidth", void 0);
665
+ __decorate([
666
+ Input(),
667
+ __metadata("design:type", String)
668
+ ], GanttTimelineComponent.prototype, "activeView", void 0);
669
+ __decorate([
670
+ Input(),
671
+ __metadata("design:type", TemplateRef)
672
+ ], GanttTimelineComponent.prototype, "taskContentTemplate", void 0);
673
+ __decorate([
674
+ Input(),
675
+ __metadata("design:type", TemplateRef)
676
+ ], GanttTimelineComponent.prototype, "taskTemplate", void 0);
677
+ __decorate([
678
+ Input(),
679
+ __metadata("design:type", TemplateRef)
680
+ ], GanttTimelineComponent.prototype, "summaryTaskTemplate", void 0);
681
+ __decorate([
682
+ Input(),
683
+ __metadata("design:type", Function)
684
+ ], GanttTimelineComponent.prototype, "taskClass", void 0);
685
+ __decorate([
686
+ Input(),
687
+ __metadata("design:type", Boolean)
688
+ ], GanttTimelineComponent.prototype, "renderDependencyDragClues", void 0);
689
+ __decorate([
690
+ Input(),
691
+ __metadata("design:type", Object)
692
+ ], GanttTimelineComponent.prototype, "dragScrollSettings", void 0);
693
+ __decorate([
694
+ Input(),
695
+ __metadata("design:type", Boolean)
696
+ ], GanttTimelineComponent.prototype, "selectable", void 0);
697
+ __decorate([
698
+ Input(),
699
+ __metadata("design:type", Function)
700
+ ], GanttTimelineComponent.prototype, "isTaskSelected", void 0);
701
+ __decorate([
702
+ Input(),
703
+ __metadata("design:type", Function)
704
+ ], GanttTimelineComponent.prototype, "isExpanded", void 0);
705
+ __decorate([
706
+ Input(),
707
+ __metadata("design:type", Array)
708
+ ], GanttTimelineComponent.prototype, "dependencies", void 0);
709
+ __decorate([
710
+ Output(),
711
+ __metadata("design:type", EventEmitter)
712
+ ], GanttTimelineComponent.prototype, "timelineContainerPress", void 0);
713
+ __decorate([
714
+ Output(),
715
+ __metadata("design:type", EventEmitter)
716
+ ], GanttTimelineComponent.prototype, "timelineContainerDrag", void 0);
717
+ __decorate([
718
+ Output(),
719
+ __metadata("design:type", EventEmitter)
720
+ ], GanttTimelineComponent.prototype, "timelineContainerRelease", void 0);
721
+ GanttTimelineComponent = __decorate([
722
+ Component({
723
+ selector: 'kendo-gantt-timeline',
724
+ template: "\n <div class=\"k-timeline k-grid k-widget\">\n <div class=\"k-grid-header\">\n <div #timelineHeaderWrap class=\"k-grid-header-wrap\">\n <table\n role=\"presentation\"\n [style.width.px]=\"tableWidth\"\n >\n <tbody\n kendoGanttHeaderTableBody\n [groupSlots]=\"groupSlots\"\n [slots]=\"slots\">\n </tbody>\n </table>\n </div>\n </div>\n <!-- tabindex=\"-1\" required for https://bugzilla.mozilla.org/show_bug.cgi?id=1069739 -->\n <div\n #timelineContent\n class=\"k-grid-content\"\n tabindex=\"-1\"\n role=\"tree\"\n aria-roledescription=\"Timeline\"\n kendoGanttTimelineScrollable\n [scrollSettings]=\"dragScrollSettings\"\n kendoDraggable\n [enableDrag]=\"draggableEnabled\"\n (kendoPress)=\"timelineContainerPress.emit($event)\"\n (kendoDrag)=\"timelineContainerDrag.emit($event)\"\n (kendoRelease)=\"timelineContainerRelease.emit($event)\"\n >\n <div class=\"k-gantt-tables\">\n <table\n class=\"k-gantt-rows\"\n [style.width.px]=\"tableWidth\"\n role=\"presentation\"\n >\n <tbody>\n <tr *ngFor=\"let item of rows; let i = index;\"\n [class.k-alt]=\"i % 2\"\n >\n <td></td>\n </tr>\n </tbody>\n </table>\n\n <table\n #timelineColumns\n class=\"k-gantt-columns\"\n role=\"presentation\"\n [style.width.px]=\"tableWidth\"\n >\n <colgroup>\n <col *ngFor=\"let item of slots\">\n </colgroup>\n\n <tbody>\n <tr>\n <td *ngFor=\"let item of slots\"\n [class.k-nonwork-hour]=\"isNonWorking(item)\"\n >\n </td>\n </tr>\n </tbody>\n </table>\n\n <table\n #tasksContainer\n class=\"k-gantt-tasks\"\n role=\"presentation\"\n style=\"border-collapse: collapse;\"\n [style.width.px]=\"tableWidth\"\n >\n <tbody\n kendoGanttTasksTableBody\n [rows]=\"rows\"\n [activeView]=\"activeView\"\n [taskContentTemplate]=\"taskContentTemplate\"\n [taskTemplate]=\"taskTemplate\"\n [summaryTaskTemplate]=\"summaryTaskTemplate\"\n [taskClass]=\"taskClass\"\n [isExpanded]=\"isExpanded\"\n [selectable]=\"selectable\"\n [isTaskSelected]=\"isTaskSelected\"\n [renderDependencyDragClues]=\"renderDependencyDragClues\"\n >\n </tbody>\n </table>\n </div>\n <svg class=\"k-gantt-dependencies-svg\">\n <polyline\n *ngFor=\"let dependency of dependencies\"\n kendoGanttDependency\n [dependency]=\"dependency\"\n />\n <polyline #dependencyDragCreatePolyline />\n </svg>\n\n <!-- placeholder for the dependency drag popup; its position is not arbitrary - the popup is intended to be absolutely positioned inside the .k-grid-content element -->\n <ng-container #dragPopupContainer></ng-container>\n </div>\n </div>\n "
725
+ }),
726
+ __metadata("design:paramtypes", [ScrollSyncService,
727
+ DependencyDomService,
728
+ Renderer2,
729
+ NgZone])
730
+ ], GanttTimelineComponent);
731
+ return GanttTimelineComponent;
732
+ }());
733
+
41
734
  /**
42
735
  * The base class for the column components of the Gantt.
43
736
  */
@@ -615,370 +1308,86 @@ var GanttSpanColumnComponent = /** @class */ (function (_super) {
615
1308
  __decorate([
616
1309
  Input(),
617
1310
  __metadata("design:type", Object)
618
- ], GanttSpanColumnComponent.prototype, "footerClass", void 0);
619
- GanttSpanColumnComponent = GanttSpanColumnComponent_1 = __decorate([
620
- Component({
621
- selector: 'kendo-gantt-span-column',
622
- template: '',
623
- providers: [
624
- {
625
- provide: GanttColumnBase,
626
- useExisting: forwardRef(function () { return GanttSpanColumnComponent_1; })
627
- }
628
- ]
629
- }),
630
- __param(1, SkipSelf()), __param(1, Host()), __param(1, Optional()),
631
- __metadata("design:paramtypes", [OptionChangesService,
632
- GanttColumnBase])
633
- ], GanttSpanColumnComponent);
634
- return GanttSpanColumnComponent;
635
- }(SpanColumnComponent));
636
-
637
- /**
638
- * @hidden
639
- */
640
- var hasChildren = function () { return false; };
641
- /**
642
- * @hidden
643
- */
644
- var fetchChildren = function () { return of([]); };
645
- /**
646
- * @hidden
647
- */
648
- var rowClassCallback = function () { return null; };
649
- /**
650
- * @hidden
651
- */
652
- var taskClassCallback = function () { return null; };
653
- /**
654
- * @hidden
655
- */
656
- var isSelected = function () { return false; };
657
-
658
- /**
659
- * The dependency type when two tasks are connected.
660
- *
661
- * The supported values are:
662
- * * `FF`&mdash;from 'finish' to 'finish'
663
- * * `FS`&mdash;from 'finish' to 'start'
664
- * * `SS`&mdash;from 'start' to 'start'
665
- * * `SF`&mdash;from 'start' to 'finish'
666
- */
667
- var DependencyType;
668
- (function (DependencyType) {
669
- DependencyType[DependencyType["FF"] = 0] = "FF";
670
- DependencyType[DependencyType["FS"] = 1] = "FS";
671
- DependencyType[DependencyType["SF"] = 2] = "SF";
672
- DependencyType[DependencyType["SS"] = 3] = "SS"; // task B can't start before task A starts
673
- })(DependencyType || (DependencyType = {}));
674
-
675
- /**
676
- * @hidden
677
- */
678
- var PreventableEvent = /** @class */ (function () {
679
- function PreventableEvent() {
680
- this.prevented = false;
681
- }
682
- /**
683
- * Prevents the default action for a specified event.
684
- * In this way, the source component suppresses
685
- * the built-in behavior that follows the event.
686
- */
687
- PreventableEvent.prototype.preventDefault = function () {
688
- this.prevented = true;
689
- };
690
- /**
691
- * Returns `true` if the event was prevented
692
- * by any of its subscribers.
693
- *
694
- * @returns `true` if the default action was prevented.
695
- * Otherwise, returns `false`.
696
- */
697
- PreventableEvent.prototype.isDefaultPrevented = function () {
698
- return this.prevented;
699
- };
700
- return PreventableEvent;
701
- }());
702
-
703
- /**
704
- * Called every time a user leaves an edited cell.
705
- */
706
- var CellCloseEvent = /** @class */ (function (_super) {
707
- __extends(CellCloseEvent, _super);
708
- function CellCloseEvent(options) {
709
- var _this = _super.call(this) || this;
710
- Object.assign(_this, options);
711
- return _this;
712
- }
713
- return CellCloseEvent;
714
- }(PreventableEvent));
715
-
716
- /**
717
- * @hidden
718
- */
719
- var isWorkDay = function (date, start, end) {
720
- return date.getDay() >= start && date.getDay() <= end;
721
- };
722
- /**
723
- * @hidden
724
- */
725
- var isWorkHour = function (date, start, end) {
726
- return date.getHours() >= start && date.getHours() <= end;
727
- };
728
- /**
729
- * @hidden
730
- */
731
- var isPresent = function (item) { return item !== null && item !== undefined; };
732
- /**
733
- * @hidden
734
- *
735
- * Normalized the data to an array in case a falsy value is passed
736
- * or a TreeListDataResult object (applicable for the data-binding directives).
737
- */
738
- var normalizeGanttData = function (data) {
739
- if (!isPresent(data)) {
740
- return [];
741
- }
742
- else if (Array.isArray(data.data)) {
743
- return data.data;
744
- }
745
- else {
746
- return data;
747
- }
748
- };
749
- /**
750
- * @hidden
751
- *
752
- * Returns a new date with the specified hours, minutes, seconds and millliseconds set.
753
- * Only the hours are required, the rest of the params are set to `0` by default.
754
- */
755
- var setTime = function (date, hours, minutes, seconds, milliseconds) {
756
- if (minutes === void 0) { minutes = 0; }
757
- if (seconds === void 0) { seconds = 0; }
758
- if (milliseconds === void 0) { milliseconds = 0; }
759
- if (!isPresent(date)) {
760
- return null;
761
- }
762
- var result = cloneDate(date);
763
- result.setHours(hours);
764
- result.setMinutes(minutes);
765
- result.setSeconds(seconds);
766
- result.setMilliseconds(milliseconds);
767
- return result;
768
- };
769
- /**
770
- * @hidden
771
- *
772
- * Returns the last day of a week.
773
- * @param standingPoint - Any day of the target week.
774
- * @param firstWeekDay - The week's starting day (e.g. Monday, Tuesday, etc.)
775
- */
776
- var lastDayOfWeek = function (standingPoint, firstWeekDay) {
777
- var followingWeek = addWeeks(standingPoint, 1);
778
- var firstDayOfFollowingWeek = firstDayInWeek(followingWeek, firstWeekDay);
779
- var lastDayOfTargetWeek = addDays(firstDayOfFollowingWeek, -1);
780
- return lastDayOfTargetWeek;
781
- };
782
- /**
783
- * Persists the intially resolved scrollbar width value.
784
- */
785
- var SCROLLBAR_WIDTH;
786
- /**
787
- * @hidden
788
- *
789
- * Gets the default scrollbar width accoring to the current environment.
790
- */
791
- var scrollbarWidth = function () {
792
- if (!isDocumentAvailable()) {
793
- return;
794
- }
795
- // calculate scrollbar width only once, then return the cached value
796
- if (isNaN(SCROLLBAR_WIDTH)) {
797
- var div = document.createElement('div');
798
- div.style.cssText = 'overflow: scroll; overflow-x: hidden; zoom: 1; clear: both; display: block;';
799
- div.innerHTML = '&nbsp;';
800
- document.body.appendChild(div);
801
- SCROLLBAR_WIDTH = div.offsetWidth - div.scrollWidth;
802
- document.body.removeChild(div);
803
- }
804
- return SCROLLBAR_WIDTH;
805
- };
806
- /**
807
- * @hidden
808
- */
809
- var isColumnGroup = function (column) { return column.isColumnGroup; };
810
- /**
811
- * @hidden
812
- */
813
- var isNumber = function (contender) { return typeof contender === 'number' && !isNaN(contender); };
814
- /**
815
- * @hidden
816
- */
817
- var isString = function (contender) { return typeof contender === 'string'; };
818
- /**
819
- * @hidden
820
- *
821
- * Gets the closest timeline task wrapper element from an event target.
822
- * Restricts the search up to the provided parent element from the second param.
823
- */
824
- var getClosestTaskWrapper = function (element, parentScope) {
825
- return closestInScope(element, matchesClasses('k-task-wrap'), parentScope);
826
- };
827
- /**
828
- * @hidden
829
- *
830
- * Checks whether the queried item or its parent items has a `k-task-wrap` selector.
831
- * Restricts the search up to the provided parent element from the second param.
832
- */
833
- var isTaskWrapper = function (contender, parentScope) {
834
- var taskWrapper = closestInScope(contender, matchesClasses('k-task-wrap'), parentScope);
835
- return isPresent(taskWrapper);
836
- };
837
- /**
838
- * @hidden
839
- *
840
- * Gets the closest timeline task element index from an event target.
841
- * Uses the `data-task-index` attribute assigned to each task.
842
- * Restricts the search up to the provided parent element from the second param.
843
- */
844
- var getClosestTaskIndex = function (element, parentScope) {
845
- var task = closestInScope(element, matchesClasses('k-task-wrap'), parentScope);
846
- if (!isPresent(task)) {
847
- return null;
848
- }
849
- return Number(task.getAttribute('data-task-index'));
850
- };
851
- /**
852
- * @hidden
853
- *
854
- * Checks whether the queried item or its parent items has a `k-task` selector.
855
- * Restricts the search up to the provided parent element from the second param.
856
- */
857
- var isTask = function (contender, parentScope) {
858
- var task = closestInScope(contender, matchesClasses('k-task'), parentScope);
859
- return isPresent(task);
860
- };
861
- /**
862
- * @hidden
863
- *
864
- * Checks whether the queried item or its parent items has a `k-task-actions` selector - used for the clear button.
865
- * Restricts the search up to the provided parent element from the second param.
866
- */
867
- var isClearButton = function (contender, parentScope) {
868
- var clearButtonContainer = closestInScope(contender, matchesClasses('k-task-actions'), parentScope);
869
- return isPresent(clearButtonContainer);
870
- };
1311
+ ], GanttSpanColumnComponent.prototype, "footerClass", void 0);
1312
+ GanttSpanColumnComponent = GanttSpanColumnComponent_1 = __decorate([
1313
+ Component({
1314
+ selector: 'kendo-gantt-span-column',
1315
+ template: '',
1316
+ providers: [
1317
+ {
1318
+ provide: GanttColumnBase,
1319
+ useExisting: forwardRef(function () { return GanttSpanColumnComponent_1; })
1320
+ }
1321
+ ]
1322
+ }),
1323
+ __param(1, SkipSelf()), __param(1, Host()), __param(1, Optional()),
1324
+ __metadata("design:paramtypes", [OptionChangesService,
1325
+ GanttColumnBase])
1326
+ ], GanttSpanColumnComponent);
1327
+ return GanttSpanColumnComponent;
1328
+ }(SpanColumnComponent));
1329
+
871
1330
  /**
872
1331
  * @hidden
873
- *
874
- * Checks whether the queried item has a `k-task-dot` selector - used for the dependency drag clues.
875
1332
  */
876
- var isDependencyDragClue = function (element) {
877
- if (!isPresent(element)) {
878
- return false;
879
- }
880
- return element.classList.contains('k-task-dot');
881
- };
1333
+ var hasChildren = function () { return false; };
882
1334
  /**
883
1335
  * @hidden
884
- *
885
- * Checks whether the queried item has a `k-task-dot` & `k-task-start` selector - used for the dependency drag start clues.
886
1336
  */
887
- var isDependencyDragStartClue = function (element) {
888
- if (!isPresent(element)) {
889
- return false;
890
- }
891
- return element.classList.contains('k-task-dot') && element.classList.contains('k-task-start');
892
- };
1337
+ var fetchChildren = function () { return of([]); };
893
1338
  /**
894
1339
  * @hidden
895
- *
896
- * Gets the `DependencyType` for an attempted dependency create from the provided two elements.
897
- * The two linked drag clue HTML elements are used to extract this data (via their CSS classes).
898
1340
  */
899
- var getDependencyTypeFromTargetTasks = function (fromTaskClue, toTaskClue) {
900
- if (!isDependencyDragClue(fromTaskClue) || !isDependencyDragClue(toTaskClue)) {
901
- return null;
902
- }
903
- var fromTaskType = isDependencyDragStartClue(fromTaskClue) ? 'S' : 'F';
904
- var toTaskType = isDependencyDragStartClue(toTaskClue) ? 'S' : 'F';
905
- var dependencyTypeName = "" + fromTaskType + toTaskType;
906
- switch (dependencyTypeName) {
907
- case 'FF': return DependencyType.FF;
908
- case 'FS': return DependencyType.FS;
909
- case 'SF': return DependencyType.SF;
910
- case 'SS': return DependencyType.SS;
911
- default: return null;
912
- }
913
- };
1341
+ var rowClassCallback = function () { return null; };
914
1342
  /**
915
1343
  * @hidden
916
- *
917
- * Checks whether the two provided drag clues belong to the same task element.
918
1344
  */
919
- var sameTaskClues = function (fromTaskClue, toTaskClue, parentScope) {
920
- if (!isPresent(fromTaskClue) || !isPresent(toTaskClue)) {
921
- return false;
922
- }
923
- var fromTaskWrapper = getClosestTaskWrapper(fromTaskClue, parentScope);
924
- var toTaskWrapper = getClosestTaskWrapper(toTaskClue, parentScope);
925
- return fromTaskWrapper === toTaskWrapper;
926
- };
1345
+ var taskClassCallback = function () { return null; };
927
1346
  /**
928
1347
  * @hidden
929
- *
930
- * Fits a contender number between a min and max range.
931
- * If the contender is below the min value, the min value is returned.
932
- * If the contender is above the max value, the max value is returned.
933
1348
  */
934
- var fitToRange = function (contender, min, max) {
935
- if (contender > max) {
936
- return max;
937
- }
938
- else if (contender < min) {
939
- return min;
940
- }
941
- else {
942
- return contender;
943
- }
944
- };
1349
+ var isSelected = function () { return false; };
1350
+
945
1351
  /**
946
1352
  * @hidden
947
- *
948
- * Checks whether either of the two provided tasks is a parent of the other.
949
1353
  */
950
- var areParentChild = function (taskA, taskB) {
951
- var parentChildRelationship = false;
952
- var taskAParent = taskA;
953
- while (isPresent(taskAParent) && isPresent(taskAParent.data)) {
954
- if (taskAParent.data === taskB.data) {
955
- parentChildRelationship = true;
956
- break;
957
- }
958
- taskAParent = taskAParent.parent;
959
- }
960
- var taskBParent = taskB;
961
- while (!parentChildRelationship && isPresent(taskBParent) && isPresent(taskBParent.data)) {
962
- if (taskBParent.data === taskA.data) {
963
- parentChildRelationship = true;
964
- break;
965
- }
966
- taskBParent = taskBParent.parent;
1354
+ var PreventableEvent = /** @class */ (function () {
1355
+ function PreventableEvent() {
1356
+ this.prevented = false;
967
1357
  }
968
- return parentChildRelationship;
969
- };
1358
+ /**
1359
+ * Prevents the default action for a specified event.
1360
+ * In this way, the source component suppresses
1361
+ * the built-in behavior that follows the event.
1362
+ */
1363
+ PreventableEvent.prototype.preventDefault = function () {
1364
+ this.prevented = true;
1365
+ };
1366
+ /**
1367
+ * Returns `true` if the event was prevented
1368
+ * by any of its subscribers.
1369
+ *
1370
+ * @returns `true` if the default action was prevented.
1371
+ * Otherwise, returns `false`.
1372
+ */
1373
+ PreventableEvent.prototype.isDefaultPrevented = function () {
1374
+ return this.prevented;
1375
+ };
1376
+ return PreventableEvent;
1377
+ }());
1378
+
970
1379
  /**
971
- * @hidden
972
- *
973
- * Extracts an element from the provided client coords.
974
- * Using the `event.target` is not reliable under mobile devices with the current implementation of the draggable, so use this instead.
1380
+ * Called every time a user leaves an edited cell.
975
1381
  */
976
- var elementFromPoint = function (clientX, clientY) {
977
- if (!isDocumentAvailable()) {
978
- return null;
1382
+ var CellCloseEvent = /** @class */ (function (_super) {
1383
+ __extends(CellCloseEvent, _super);
1384
+ function CellCloseEvent(options) {
1385
+ var _this = _super.call(this) || this;
1386
+ Object.assign(_this, options);
1387
+ return _this;
979
1388
  }
980
- return document.elementFromPoint(clientX, clientY);
981
- };
1389
+ return CellCloseEvent;
1390
+ }(PreventableEvent));
982
1391
 
983
1392
  /**
984
1393
  * @hidden
@@ -1093,134 +1502,50 @@ var TimelineBaseViewService = /** @class */ (function () {
1093
1502
  var weekStart = this.intlService.firstDay();
1094
1503
  var slots = [];
1095
1504
  var startDay = new Date(start);
1096
- var endDay = new Date(end);
1097
- while (startDay <= endDay) {
1098
- var lastWeekDay = lastDayOfWeek(startDay, weekStart);
1099
- var slotEnd = lastWeekDay > endDay ? endDay : lastWeekDay;
1100
- var daySlots = this.getDays(startDay, slotEnd);
1101
- var span = daySlots.length;
1102
- var firstDay = this.intlService.formatDate(firstDayInWeek(getDate(startDay), weekStart), DAY_FORMAT);
1103
- var lastDay = this.intlService.formatDate(addDays(slotEnd, -1), DAY_FORMAT);
1104
- if (span > 0) {
1105
- slots.push({
1106
- start: daySlots[0].start,
1107
- end: daySlots[span - 1].end,
1108
- text: firstDay + " - " + lastDay,
1109
- span: span
1110
- });
1111
- }
1112
- startDay = firstDayInWeek(addWeeks(slotEnd, 1));
1113
- }
1114
- return slots;
1115
- };
1116
- TimelineBaseViewService.prototype.getMonths = function (start, end) {
1117
- var slots = [];
1118
- var startDay = new Date(start);
1119
- var endDay = new Date(end);
1120
- while (startDay < endDay) {
1121
- var endMonth = lastDayOfMonth(startDay);
1122
- var slotEnd = endDay < endMonth ? endDay : endMonth;
1123
- var daySlots = this.getDays(startDay, slotEnd);
1124
- var span = daySlots.length;
1125
- var monthStart = firstDayOfMonth(getDate(startDay));
1126
- var shortText = this.intlService.formatDate(monthStart, MONTH_FORMAT);
1127
- if (span > 0) {
1128
- slots.push({
1129
- start: daySlots[0].start,
1130
- end: daySlots[span - 1].end,
1131
- span: span,
1132
- text: shortText
1133
- });
1134
- }
1135
- startDay = firstDayOfMonth(addMonths(slotEnd, 1));
1136
- }
1137
- return slots;
1138
- };
1139
- return TimelineBaseViewService;
1140
- }());
1141
-
1142
- /**
1143
- * @hidden
1144
- */
1145
- var DEFAULT_DEPENDENCY_MODEL_FIELDS = Object.freeze({
1146
- toId: 'toId',
1147
- fromId: 'fromId',
1148
- id: 'id',
1149
- type: 'type'
1150
- });
1151
-
1152
- /**
1153
- * @hidden
1154
- */
1155
- var DEFAULT_TASK_MODEL_FIELDS = Object.freeze({
1156
- id: 'id',
1157
- start: 'start',
1158
- end: 'end',
1159
- title: 'title',
1160
- completionRatio: 'completionRatio',
1161
- children: 'children'
1162
- });
1163
-
1164
- /**
1165
- * @hidden
1166
- */
1167
- var MappingService = /** @class */ (function () {
1168
- function MappingService() {
1169
- this._taskFields = __assign({}, DEFAULT_TASK_MODEL_FIELDS);
1170
- this._dependencyFields = __assign({}, DEFAULT_DEPENDENCY_MODEL_FIELDS);
1171
- }
1172
- Object.defineProperty(MappingService.prototype, "taskFields", {
1173
- get: function () {
1174
- return this._taskFields;
1175
- },
1176
- /**
1177
- * Gets or sets the model fields for the task data items.
1178
- * Uses the default values for fields which are not specified.
1179
- */
1180
- set: function (fields) {
1181
- this._taskFields = __assign({}, DEFAULT_TASK_MODEL_FIELDS, fields);
1182
- },
1183
- enumerable: true,
1184
- configurable: true
1185
- });
1186
- Object.defineProperty(MappingService.prototype, "dependencyFields", {
1187
- get: function () {
1188
- return this._dependencyFields;
1189
- },
1190
- /**
1191
- * Gets or sets the model fields for the depenency data items.
1192
- * Uses the default values for fields which are not specified.
1193
- */
1194
- set: function (fields) {
1195
- this._dependencyFields = __assign({}, DEFAULT_DEPENDENCY_MODEL_FIELDS, fields);
1196
- },
1197
- enumerable: true,
1198
- configurable: true
1199
- });
1200
- /**
1201
- * Retrieves the value for the specified task field.
1202
- * Supports nested fields as well (e.g. 'manager.id').
1203
- */
1204
- MappingService.prototype.extractFromTask = function (dataItem, field) {
1205
- if (!isPresent(this.taskFields)) {
1206
- return null;
1505
+ var endDay = new Date(end);
1506
+ while (startDay <= endDay) {
1507
+ var lastWeekDay = lastDayOfWeek(startDay, weekStart);
1508
+ var slotEnd = lastWeekDay > endDay ? endDay : lastWeekDay;
1509
+ var daySlots = this.getDays(startDay, slotEnd);
1510
+ var span = daySlots.length;
1511
+ var firstDay = this.intlService.formatDate(firstDayInWeek(getDate(startDay), weekStart), DAY_FORMAT);
1512
+ var lastDay = this.intlService.formatDate(addDays(slotEnd, -1), DAY_FORMAT);
1513
+ if (span > 0) {
1514
+ slots.push({
1515
+ start: daySlots[0].start,
1516
+ end: daySlots[span - 1].end,
1517
+ text: firstDay + " - " + lastDay,
1518
+ span: span
1519
+ });
1520
+ }
1521
+ startDay = firstDayInWeek(addWeeks(slotEnd, 1));
1207
1522
  }
1208
- return getter(this.taskFields[field])(dataItem);
1523
+ return slots;
1209
1524
  };
1210
- /**
1211
- * Retrieves the value for the specified dependency field.
1212
- * Supports nested fields as well (e.g. 'manager.id').
1213
- */
1214
- MappingService.prototype.extractFromDependency = function (dataItem, field) {
1215
- if (!isPresent(this.dependencyFields)) {
1216
- return null;
1525
+ TimelineBaseViewService.prototype.getMonths = function (start, end) {
1526
+ var slots = [];
1527
+ var startDay = new Date(start);
1528
+ var endDay = new Date(end);
1529
+ while (startDay < endDay) {
1530
+ var endMonth = lastDayOfMonth(startDay);
1531
+ var slotEnd = endDay < endMonth ? endDay : endMonth;
1532
+ var daySlots = this.getDays(startDay, slotEnd);
1533
+ var span = daySlots.length;
1534
+ var monthStart = firstDayOfMonth(getDate(startDay));
1535
+ var shortText = this.intlService.formatDate(monthStart, MONTH_FORMAT);
1536
+ if (span > 0) {
1537
+ slots.push({
1538
+ start: daySlots[0].start,
1539
+ end: daySlots[span - 1].end,
1540
+ span: span,
1541
+ text: shortText
1542
+ });
1543
+ }
1544
+ startDay = firstDayOfMonth(addMonths(slotEnd, 1));
1217
1545
  }
1218
- return getter(this.dependencyFields[field])(dataItem);
1546
+ return slots;
1219
1547
  };
1220
- MappingService = __decorate([
1221
- Injectable()
1222
- ], MappingService);
1223
- return MappingService;
1548
+ return TimelineBaseViewService;
1224
1549
  }());
1225
1550
 
1226
1551
  /**
@@ -1340,231 +1665,80 @@ var TimelineMonthViewService = /** @class */ (function (_super) {
1340
1665
  /**
1341
1666
  * @hidden
1342
1667
  */
1343
- var TimelineWeekViewService = /** @class */ (function (_super) {
1344
- __extends(TimelineWeekViewService, _super);
1345
- function TimelineWeekViewService(intlService, mapper) {
1346
- return _super.call(this, intlService, mapper) || this;
1347
- }
1348
- /**
1349
- * Gets a date a day before the first task start with hours, minutes, seconds, milliseconds cleared.
1350
- */
1351
- TimelineWeekViewService.prototype.getStartOffset = function (rangeStart) {
1352
- return addDays(getDate(rangeStart), -1);
1353
- };
1354
- /**
1355
- * Gets a date a day after the last task start with hours, minutes, seconds, milliseconds cleared.
1356
- */
1357
- TimelineWeekViewService.prototype.getEndOffset = function (rangeEnd) {
1358
- return addDays(getDate(rangeEnd), 1);
1359
- };
1360
- /**
1361
- *
1362
- * @param tasks - The tasks which are going to be rendered in the table
1363
- * @returns {number}
1364
- */
1365
- TimelineWeekViewService.prototype.getTableWidth = function (tasks) {
1366
- var timeSlots = this.getSlots(tasks)[1];
1367
- var slotWidth = this.options.slotWidth;
1368
- return Math.round(timeSlots.length * slotWidth);
1369
- };
1370
- /**
1371
- *
1372
- * @param tasks - The tasks which are going to be rendered in the table
1373
- * @returns {Array<Object>} - A collection containing the day and hours slots
1374
- * Used to render the number of columns and the header
1375
- */
1376
- TimelineWeekViewService.prototype.getSlots = function (tasks) {
1377
- // will return the header rows slots
1378
- var slots = [];
1379
- var _a = this.getRange(tasks), start = _a.start, end = _a.end;
1380
- var weeks = this.getWeeks(start, end);
1381
- var days = this.getDays(start, end);
1382
- slots.push(weeks, days);
1383
- return slots;
1384
- };
1385
- TimelineWeekViewService = __decorate([
1386
- Injectable(),
1387
- __metadata("design:paramtypes", [IntlService, MappingService])
1388
- ], TimelineWeekViewService);
1389
- return TimelineWeekViewService;
1390
- }(TimelineBaseViewService));
1391
-
1392
- /**
1393
- * @hidden
1394
- */
1395
- var services = {
1396
- day: TimelineDayViewService,
1397
- week: TimelineWeekViewService,
1398
- month: TimelineMonthViewService
1399
- };
1400
- /**
1401
- * @hidden
1402
- */
1403
- var TimelineViewService = /** @class */ (function () {
1404
- function TimelineViewService(injector) {
1405
- this.injector = injector;
1406
- this.viewChange = new EventEmitter();
1407
- }
1408
- TimelineViewService.prototype.service = function (view) {
1409
- var serviceType = services[view];
1410
- return serviceType ? this.injector.get(serviceType) : null;
1411
- };
1412
- TimelineViewService = __decorate([
1413
- Injectable(),
1414
- __metadata("design:paramtypes", [Injector])
1415
- ], TimelineViewService);
1416
- return TimelineViewService;
1417
- }());
1418
-
1419
- /**
1420
- * @hidden
1421
- */
1422
- var ScrollSyncService = /** @class */ (function () {
1423
- function ScrollSyncService(ngZone) {
1424
- var _this = this;
1425
- this.ngZone = ngZone;
1426
- this.changes = new Subject();
1427
- this.elements = [];
1428
- this.subscriptions = new Subscription();
1429
- this.subscriptions.add(this.changes.subscribe(function (args) {
1430
- _this.scroll(args);
1431
- }));
1432
- }
1433
- ScrollSyncService.prototype.registerElement = function (el, sourceType) {
1434
- var _this = this;
1435
- this.elements.push({ element: el, sourceType: sourceType });
1436
- if (sourceType === "timeline" || sourceType === "treelist") {
1437
- this.ngZone.runOutsideAngular(function () {
1438
- var obs = fromEvent(el, 'scroll').pipe(map(function (_a) {
1439
- var _b = _a.target, scrollTop = _b.scrollTop, scrollLeft = _b.scrollLeft;
1440
- return ({
1441
- scrollTop: scrollTop,
1442
- scrollLeft: scrollLeft,
1443
- sourceType: sourceType
1444
- });
1445
- }));
1446
- var comparisonFn = sourceType === 'timeline' ?
1447
- function (x, y) { return (x.scrollTop === y.scrollTop) && (x.scrollLeft === y.scrollLeft); } :
1448
- function (x, y) { return (x.scrollTop === y.scrollTop); };
1449
- _this.subscriptions.add(obs.pipe(distinctUntilChanged(comparisonFn))
1450
- .subscribe(function (event) { return _this.changes.next(event); }));
1451
- });
1452
- }
1453
- };
1454
- ScrollSyncService.prototype.ngOnDestroy = function () {
1455
- this.subscriptions.unsubscribe();
1456
- this.elements = null;
1457
- };
1458
- ScrollSyncService.prototype.syncScrollTop = function (sourceType, targetType) {
1459
- var source = this.elements.find(function (element) { return element.sourceType === sourceType; });
1460
- var target = this.elements.find(function (element) { return element.sourceType === targetType; });
1461
- // Need to wait for the splitter pane's content to be rendered
1462
- this.ngZone.onStable.pipe(take(1)).subscribe(function () { return target.element.scrollTop = source.element.scrollTop; });
1463
- };
1464
- ScrollSyncService.prototype.resetTimelineScrollLeft = function () {
1465
- var source = this.elements.find(function (element) { return element.sourceType === 'timeline'; });
1466
- source.element.scrollLeft = 0;
1467
- };
1468
- ScrollSyncService.prototype.scroll = function (_a) {
1469
- var _this = this;
1470
- var scrollTop = _a.scrollTop, scrollLeft = _a.scrollLeft, sourceType = _a.sourceType;
1471
- this.ngZone.runOutsideAngular(function () {
1472
- if (sourceType === 'timeline') {
1473
- var header = _this.elements.find(function (element) { return element.sourceType === 'header'; }).element;
1474
- header.scrollLeft = scrollLeft;
1475
- if (!_this.syncingTimeline) {
1476
- _this.syncingTreeList = true;
1477
- var treelist = _this.elements.find(function (element) { return element.sourceType === 'treelist'; }).element;
1478
- treelist.scrollTop = scrollTop;
1479
- }
1480
- _this.syncingTimeline = false;
1481
- }
1482
- if (sourceType === 'treelist') {
1483
- if (!_this.syncingTreeList) {
1484
- _this.syncingTimeline = true;
1485
- var timeline = _this.elements.find(function (element) { return element.sourceType === 'timeline'; }).element;
1486
- timeline.scrollTop = scrollTop;
1487
- }
1488
- _this.syncingTreeList = false;
1489
- }
1490
- });
1491
- };
1492
- ScrollSyncService = __decorate([
1493
- Injectable(),
1494
- __metadata("design:paramtypes", [NgZone])
1495
- ], ScrollSyncService);
1496
- return ScrollSyncService;
1497
- }());
1498
-
1499
- /**
1500
- * @hidden
1501
- */
1502
- var DependencyDomService = /** @class */ (function () {
1503
- function DependencyDomService(mapper) {
1504
- this.mapper = mapper;
1505
- this.notifier = new Subject();
1506
- /**
1507
- * Maps each rendered task to its HTML element.
1508
- * Uses the task ID field value as key.
1509
- */
1510
- this.tasks = new Map();
1511
- }
1512
- Object.defineProperty(DependencyDomService.prototype, "taskChanges", {
1513
- /**
1514
- * Emits each time some of the tasks or the view have changed.
1515
- * Fires also on the first change of the table rows and the parent container.
1516
- */
1517
- get: function () {
1518
- return this.notifier.asObservable();
1519
- },
1520
- enumerable: true,
1521
- configurable: true
1522
- });
1523
- Object.defineProperty(DependencyDomService.prototype, "dependencyDomArgs", {
1524
- get: function () {
1525
- return {
1526
- tasks: this.tasks,
1527
- contentContainer: this.contentContainer,
1528
- timelineRow: this.timelineRow
1529
- };
1530
- },
1531
- enumerable: true,
1532
- configurable: true
1533
- });
1534
- DependencyDomService.prototype.ngOnDestroy = function () {
1535
- this.tasks.clear();
1536
- this.tasks = null;
1537
- this.contentContainer = null;
1538
- };
1539
- DependencyDomService.prototype.registerTimelineRow = function (timelineRow) {
1540
- this.timelineRow = timelineRow;
1541
- this.notifyChanges();
1542
- };
1543
- DependencyDomService.prototype.registerContentContainer = function (contentContainer) {
1544
- this.contentContainer = contentContainer;
1545
- this.notifyChanges();
1668
+ var TimelineWeekViewService = /** @class */ (function (_super) {
1669
+ __extends(TimelineWeekViewService, _super);
1670
+ function TimelineWeekViewService(intlService, mapper) {
1671
+ return _super.call(this, intlService, mapper) || this;
1672
+ }
1673
+ /**
1674
+ * Gets a date a day before the first task start with hours, minutes, seconds, milliseconds cleared.
1675
+ */
1676
+ TimelineWeekViewService.prototype.getStartOffset = function (rangeStart) {
1677
+ return addDays(getDate(rangeStart), -1);
1546
1678
  };
1547
- DependencyDomService.prototype.registerTask = function (task, element) {
1548
- var id = this.mapper.extractFromTask(task, 'id');
1549
- this.tasks.set(id, element);
1550
- this.notifyChanges();
1679
+ /**
1680
+ * Gets a date a day after the last task start with hours, minutes, seconds, milliseconds cleared.
1681
+ */
1682
+ TimelineWeekViewService.prototype.getEndOffset = function (rangeEnd) {
1683
+ return addDays(getDate(rangeEnd), 1);
1551
1684
  };
1552
- DependencyDomService.prototype.unregisterTask = function (task) {
1553
- var id = this.mapper.extractFromTask(task, 'id');
1554
- this.tasks.delete(id);
1555
- this.notifyChanges();
1685
+ /**
1686
+ *
1687
+ * @param tasks - The tasks which are going to be rendered in the table
1688
+ * @returns {number}
1689
+ */
1690
+ TimelineWeekViewService.prototype.getTableWidth = function (tasks) {
1691
+ var timeSlots = this.getSlots(tasks)[1];
1692
+ var slotWidth = this.options.slotWidth;
1693
+ return Math.round(timeSlots.length * slotWidth);
1556
1694
  };
1557
1695
  /**
1558
- * Notifies all dependency directives that a change in one of the elements has occured.
1696
+ *
1697
+ * @param tasks - The tasks which are going to be rendered in the table
1698
+ * @returns {Array<Object>} - A collection containing the day and hours slots
1699
+ * Used to render the number of columns and the header
1559
1700
  */
1560
- DependencyDomService.prototype.notifyChanges = function () {
1561
- this.notifier.next(this.dependencyDomArgs);
1701
+ TimelineWeekViewService.prototype.getSlots = function (tasks) {
1702
+ // will return the header rows slots
1703
+ var slots = [];
1704
+ var _a = this.getRange(tasks), start = _a.start, end = _a.end;
1705
+ var weeks = this.getWeeks(start, end);
1706
+ var days = this.getDays(start, end);
1707
+ slots.push(weeks, days);
1708
+ return slots;
1562
1709
  };
1563
- DependencyDomService = __decorate([
1710
+ TimelineWeekViewService = __decorate([
1564
1711
  Injectable(),
1565
- __metadata("design:paramtypes", [MappingService])
1566
- ], DependencyDomService);
1567
- return DependencyDomService;
1712
+ __metadata("design:paramtypes", [IntlService, MappingService])
1713
+ ], TimelineWeekViewService);
1714
+ return TimelineWeekViewService;
1715
+ }(TimelineBaseViewService));
1716
+
1717
+ /**
1718
+ * @hidden
1719
+ */
1720
+ var services = {
1721
+ day: TimelineDayViewService,
1722
+ week: TimelineWeekViewService,
1723
+ month: TimelineMonthViewService
1724
+ };
1725
+ /**
1726
+ * @hidden
1727
+ */
1728
+ var TimelineViewService = /** @class */ (function () {
1729
+ function TimelineViewService(injector) {
1730
+ this.injector = injector;
1731
+ this.viewChange = new EventEmitter();
1732
+ }
1733
+ TimelineViewService.prototype.service = function (view) {
1734
+ var serviceType = services[view];
1735
+ return serviceType ? this.injector.get(serviceType) : null;
1736
+ };
1737
+ TimelineViewService = __decorate([
1738
+ Injectable(),
1739
+ __metadata("design:paramtypes", [Injector])
1740
+ ], TimelineViewService);
1741
+ return TimelineViewService;
1568
1742
  }());
1569
1743
 
1570
1744
  /**
@@ -1575,9 +1749,11 @@ var EditService = /** @class */ (function () {
1575
1749
  var _this = this;
1576
1750
  this.mapper = mapper;
1577
1751
  this.showEditingDialog = new Subject();
1578
- this.showConfirmationDialog = new Subject();
1752
+ this.taskDelete = new Subject();
1579
1753
  this.editEvent = new Subject();
1580
1754
  this.addEvent = new Subject();
1755
+ this.predecessors = [];
1756
+ this.successors = [];
1581
1757
  this.updatedItems = [];
1582
1758
  this.deletedItems = [];
1583
1759
  this.itemIndex = function (item, data) {
@@ -1701,32 +1877,484 @@ var TimelineScrollService = /** @class */ (function () {
1701
1877
  TimelineScrollService.prototype.requestVerticalScroll = function (clientLeft) {
1702
1878
  this.verticalScroll.next(clientLeft);
1703
1879
  };
1704
- TimelineScrollService.prototype.requestScrollCancel = function () {
1705
- this.scrollCancel.next();
1880
+ TimelineScrollService.prototype.requestScrollCancel = function () {
1881
+ this.scrollCancel.next();
1882
+ };
1883
+ TimelineScrollService = __decorate([
1884
+ Injectable()
1885
+ ], TimelineScrollService);
1886
+ return TimelineScrollService;
1887
+ }());
1888
+
1889
+ /**
1890
+ * @hidden
1891
+ *
1892
+ * Needed to keep the Gantt's LocalizationService reference and be able to use it component's inside the TabStrip
1893
+ */
1894
+ var GanttLocalizationService = /** @class */ (function () {
1895
+ function GanttLocalizationService(localizationService) {
1896
+ this.localizationService = localizationService;
1897
+ }
1898
+ GanttLocalizationService.prototype.get = function (token) {
1899
+ return this.localizationService.get(token);
1900
+ };
1901
+ GanttLocalizationService = __decorate([
1902
+ Injectable(),
1903
+ __metadata("design:paramtypes", [LocalizationService])
1904
+ ], GanttLocalizationService);
1905
+ return GanttLocalizationService;
1906
+ }());
1907
+
1908
+ // TODO: add those keys to `import { Keys } from '@progress/kendo-angular-common';`
1909
+ var NumpadKeys;
1910
+ (function (NumpadKeys) {
1911
+ NumpadKeys[NumpadKeys["Digit1"] = 97] = "Digit1";
1912
+ NumpadKeys[NumpadKeys["Digit2"] = 98] = "Digit2";
1913
+ NumpadKeys[NumpadKeys["Digit3"] = 99] = "Digit3";
1914
+ NumpadKeys[NumpadKeys["Digit4"] = 100] = "Digit4";
1915
+ })(NumpadKeys || (NumpadKeys = {}));
1916
+ /**
1917
+ * @hidden
1918
+ */
1919
+ var isArrowUpDownKey = function (keyCode) { return [
1920
+ Keys.ArrowUp,
1921
+ Keys.ArrowDown
1922
+ ].some(function (arrowKeyCode) {
1923
+ return keyCode === arrowKeyCode;
1924
+ }); };
1925
+ /**
1926
+ * @hidden
1927
+ */
1928
+ var isNavigationKey = function (keyCode) { return [
1929
+ Keys.ArrowUp,
1930
+ Keys.ArrowDown,
1931
+ Keys.Home,
1932
+ Keys.End
1933
+ ].some(function (navigationKeyCode) {
1934
+ return keyCode === navigationKeyCode;
1935
+ }); };
1936
+ /**
1937
+ * @hidden
1938
+ */
1939
+ var isExpandCollapseKey = function (keyCode, altKey) {
1940
+ return altKey && [
1941
+ Keys.ArrowLeft,
1942
+ Keys.ArrowRight
1943
+ ].some(function (navigationKeyCode) {
1944
+ return keyCode === navigationKeyCode;
1945
+ });
1946
+ };
1947
+ /**
1948
+ * @hidden
1949
+ */
1950
+ var isViewDigitKey = function (keyCode) { return [
1951
+ Keys.Digit1,
1952
+ NumpadKeys.Digit1,
1953
+ Keys.Digit2,
1954
+ NumpadKeys.Digit2,
1955
+ Keys.Digit3,
1956
+ NumpadKeys.Digit3,
1957
+ Keys.Digit4,
1958
+ NumpadKeys.Digit4
1959
+ ].some(function (digitKeyCode) {
1960
+ return keyCode === digitKeyCode;
1961
+ }); };
1962
+ /**
1963
+ * @hidden
1964
+ *
1965
+ * Returns the corresponding view index for the pressed digit key (Digit 1 => 0, Digit 2 => 1, etc.).
1966
+ */
1967
+ var getIndexFromViewDigitKeyCode = function (keyCode) {
1968
+ switch (keyCode) {
1969
+ case NumpadKeys.Digit1:
1970
+ case Keys.Digit1: return 0;
1971
+ case NumpadKeys.Digit2:
1972
+ case Keys.Digit2: return 1;
1973
+ case NumpadKeys.Digit3:
1974
+ case Keys.Digit3: return 2;
1975
+ case NumpadKeys.Digit4:
1976
+ case Keys.Digit4: return 3;
1977
+ default: return null;
1978
+ }
1979
+ };
1980
+
1981
+ /**
1982
+ * @hidden
1983
+ */
1984
+ var NavigationService = /** @class */ (function () {
1985
+ function NavigationService(zone, renderer, scrollSyncService) {
1986
+ this.zone = zone;
1987
+ this.renderer = renderer;
1988
+ this.scrollSyncService = scrollSyncService;
1989
+ /**
1990
+ * Notifies when the tasks' focused and interactive (tabindex) state has changed.
1991
+ *
1992
+ * All tasks are rendered with tabindex="-1".
1993
+ * When one is clicked, or when some navigation key keyboard key is pressed, it should be focused, assigned the focus class, and its tabindex updated to 0.
1994
+ * All other tasks should get -1 tabindex and have the focus class removed from them.
1995
+ */
1996
+ this.taskStatusChanges = new Subject();
1997
+ /**
1998
+ * Keeps track of whether the Timeline part is focused.
1999
+ * Used when the index of the task elements change (tasks are changed, pushed to, spliced from, etc.)
2000
+ * and their status should be updated accordingly.
2001
+ */
2002
+ this.isTimelineFocused = false;
2003
+ /**
2004
+ * Keeps track of which part has last been focused.
2005
+ * Used when calling `gantt.focus()` to determine which part of the component should receive focus.
2006
+ */
2007
+ this.treeListLastActive = false;
2008
+ /**
2009
+ * Keeps track of which part has last been focused.
2010
+ * Used when calling `gantt.focus()` to determine which part of the component should receive focus.
2011
+ */
2012
+ this.timelineLastActive = false;
2013
+ this._enabled = false;
2014
+ this._activeTimelineIndex = 0;
2015
+ this._activeTreeListCell = { rowIndex: 0, colIndex: 0 };
2016
+ }
2017
+ Object.defineProperty(NavigationService.prototype, "enabled", {
2018
+ /**
2019
+ * Specifies whether navigation is enabled.
2020
+ */
2021
+ get: function () {
2022
+ return this._enabled;
2023
+ },
2024
+ enumerable: true,
2025
+ configurable: true
2026
+ });
2027
+ Object.defineProperty(NavigationService.prototype, "activeTask", {
2028
+ /**
2029
+ * Used to retrieve read-only data about the currently active task.
2030
+ */
2031
+ get: function () {
2032
+ return {
2033
+ activeIndex: this.activeTimelineIndex,
2034
+ isFocused: this.isTimelineFocused
2035
+ };
2036
+ },
2037
+ enumerable: true,
2038
+ configurable: true
2039
+ });
2040
+ Object.defineProperty(NavigationService.prototype, "activeTreeListCell", {
2041
+ get: function () {
2042
+ var firstAvailableIndex = 0;
2043
+ var lastAvailableRowIndex = this.treeListHeaderRowsCount + this.gantt.treeList.view.data.length - 1;
2044
+ var rowIndex = fitToRange(this._activeTreeListCell.rowIndex, firstAvailableIndex, lastAvailableRowIndex);
2045
+ var lastAvailableColIndex = this.gantt.columns.length;
2046
+ var colIndex = fitToRange(this._activeTreeListCell.colIndex, firstAvailableIndex, lastAvailableColIndex);
2047
+ return { rowIndex: rowIndex, colIndex: colIndex };
2048
+ },
2049
+ /**
2050
+ * Persists the expected TreeList focused cell coords.
2051
+ * When the tasks in the Timeline are navigated through, the expected TreeList focus target should also change,
2052
+ * in order to allow back-tabbing from the Timeline to the same row in the TreeList.
2053
+ */
2054
+ set: function (cell) {
2055
+ this._activeTreeListCell = cell;
2056
+ },
2057
+ enumerable: true,
2058
+ configurable: true
2059
+ });
2060
+ Object.defineProperty(NavigationService.prototype, "activeTimelineIndex", {
2061
+ get: function () {
2062
+ var firstAvailableIndex = 0;
2063
+ var lastAvailableIndex = this.gantt.treeList.view.data.length - 1;
2064
+ return fitToRange(this._activeTimelineIndex, firstAvailableIndex, lastAvailableIndex);
2065
+ },
2066
+ /**
2067
+ * Persists the expected Timeline focused task index.
2068
+ * When the cells in the TreeList are navigated through, the expected Timeline focus target should also change,
2069
+ * in order to allow tabbing from the TreeList to the same row in the Timeline.
2070
+ */
2071
+ set: function (index) {
2072
+ this._activeTimelineIndex = index;
2073
+ },
2074
+ enumerable: true,
2075
+ configurable: true
2076
+ });
2077
+ Object.defineProperty(NavigationService.prototype, "treeListHeaderRowsCount", {
2078
+ /**
2079
+ * The TreeList row index takes into account the header and filter rows.
2080
+ * Used when translating Timeline task indices to TreeList row indices.
2081
+ */
2082
+ get: function () {
2083
+ // captures nested group header rows + filter row if we start supporting it at some point
2084
+ return this.treeListElement.querySelectorAll('.k-grid-header tr').length;
2085
+ },
2086
+ enumerable: true,
2087
+ configurable: true
2088
+ });
2089
+ NavigationService.prototype.initialize = function (_a) {
2090
+ var _this = this;
2091
+ var gantt = _a.gantt, host = _a.host, treeListElement = _a.treeListElement, timelineElement = _a.timelineElement;
2092
+ // no private property setters in TypeScript, so use a getter and a poorly named private prop for this value
2093
+ this._enabled = true;
2094
+ this.gantt = gantt;
2095
+ this.host = host;
2096
+ this.treeListElement = treeListElement;
2097
+ this.timelineElement = timelineElement;
2098
+ // TODO: fix in the splitter package and remove
2099
+ // move the splitbar HTML element between the two panes to keep the visial tabbing order in tact
2100
+ var splitbar = this.host.querySelector('.k-splitbar');
2101
+ if (isPresent(splitbar) && isPresent(splitbar.previousElementSibling) && isPresent(splitbar.after)) {
2102
+ splitbar.after(splitbar.previousElementSibling);
2103
+ }
2104
+ this.zone.runOutsideAngular(function () {
2105
+ _this.eventListenerDisposers = [
2106
+ _this.renderer.listen(_this.host, 'keydown', _this.handleKeydown.bind(_this)),
2107
+ _this.renderer.listen(_this.treeListElement, 'mousedown', _this.focusTreeList.bind(_this)),
2108
+ _this.renderer.listen(_this.treeListElement, 'focusin', _this.handleTreeListFocusIn.bind(_this)),
2109
+ _this.renderer.listen(_this.timelineElement, 'mousedown', _this.handleTimelineMousedown.bind(_this)),
2110
+ _this.renderer.listen(_this.timelineElement, 'focusin', _this.handleTimelineFocusIn.bind(_this)),
2111
+ _this.renderer.listen(_this.timelineElement, 'focusout', _this.handleTimelineFocusOut.bind(_this))
2112
+ ];
2113
+ });
2114
+ };
2115
+ NavigationService.prototype.ngOnDestroy = function () {
2116
+ if (isPresent(this.eventListenerDisposers)) {
2117
+ this.eventListenerDisposers.forEach(function (removeListener) { return removeListener(); });
2118
+ this.eventListenerDisposers = null;
2119
+ }
2120
+ this.gantt = null;
2121
+ this.host = null;
2122
+ this.treeListElement = null;
2123
+ this.timelineElement = null;
2124
+ };
2125
+ /**
2126
+ * Focuses either the last active TreeList cell, or the last active Timeline task,
2127
+ * dependening on which of the two last held focus.
2128
+ *
2129
+ * Focuses the first TreeList cell by default.
2130
+ */
2131
+ NavigationService.prototype.focusLastActiveItem = function () {
2132
+ if (this.gantt.data.length === 0 || (!this.treeListLastActive && !this.timelineLastActive)) {
2133
+ this.focusCell(0, 0);
2134
+ }
2135
+ else if (this.treeListLastActive) {
2136
+ var _a = this.activeTreeListCell, rowIndex = _a.rowIndex, colIndex = _a.colIndex;
2137
+ this.gantt.treeList.focusCell(rowIndex, colIndex);
2138
+ }
2139
+ else if (this.timelineLastActive) {
2140
+ this.focusTask(this.activeTimelineIndex);
2141
+ }
2142
+ };
2143
+ /**
2144
+ * Focuses the targeted TreeList cell regardless of the last peresisted target.
2145
+ */
2146
+ NavigationService.prototype.focusCell = function (rowIndex, colIndex) {
2147
+ this.activeTreeListCell = { rowIndex: rowIndex, colIndex: colIndex };
2148
+ this.activeTimelineIndex = rowIndex - this.treeListHeaderRowsCount;
2149
+ this.gantt.treeList.focusCell(this.activeTreeListCell.rowIndex, this.activeTreeListCell.colIndex);
2150
+ };
2151
+ /**
2152
+ * Focuses the targeted Timeline task regardless of the last peresisted target.
2153
+ */
2154
+ NavigationService.prototype.focusTask = function (index) {
2155
+ this.activeTimelineIndex = index;
2156
+ this.isTimelineFocused = true;
2157
+ this.activeTreeListCell = {
2158
+ rowIndex: index + this.treeListHeaderRowsCount,
2159
+ colIndex: this.activeTreeListCell.colIndex
2160
+ };
2161
+ this.notifyTaskStatusChange();
2162
+ };
2163
+ /**
2164
+ * Updates the focus target flags and notifies the active task to update its focused state.
2165
+ */
2166
+ NavigationService.prototype.handleTimelineFocusIn = function (_a) {
2167
+ var target = _a.target;
2168
+ this.treeListLastActive = false;
2169
+ this.timelineLastActive = true;
2170
+ this.isTimelineFocused = true;
2171
+ if (isTask(target, this.timelineElement)) {
2172
+ this.notifyTaskStatusChange();
2173
+ }
2174
+ };
2175
+ /**
2176
+ * Updates the timeline focus state flag and notifies the active task to update its focused state.
2177
+ */
2178
+ NavigationService.prototype.handleTimelineFocusOut = function (_a) {
2179
+ var relatedTarget = _a.relatedTarget;
2180
+ this.isTimelineFocused = this.timelineElement.contains(relatedTarget);
2181
+ // update the task element only if the new focus target is not in the Timeline - focus change between tasks is handled in the focusin handler
2182
+ if (!isTask(relatedTarget, this.timelineElement)) {
2183
+ this.notifyTaskStatusChange();
2184
+ }
2185
+ };
2186
+ /**
2187
+ * Updates the focus target flags and corrects the TreeList focus target if needed.
2188
+ * As the TreeList will keep its last focused cell with tabindex="0",
2189
+ * this methods forcefully focuses the correct cell,
2190
+ * when navigating in the Timeline has updated the expected TreeList focus target.
2191
+ */
2192
+ NavigationService.prototype.handleTreeListFocusIn = function (event) {
2193
+ this.treeListLastActive = true;
2194
+ this.timelineLastActive = false;
2195
+ // if the previous focus target was in the TreeList, rely on its component navigation and just record the focused item index
2196
+ if (this.treeListElement.contains(event.relatedTarget)) {
2197
+ var _a = this.gantt.treeList.activeCell, colIndex = _a.colIndex, rowIndex = _a.rowIndex;
2198
+ this.activeTreeListCell = { colIndex: colIndex, rowIndex: rowIndex };
2199
+ }
2200
+ else {
2201
+ // if the previous focus target was outside the TreeList, ensure the expected focus coords are used
2202
+ var _b = this.activeTreeListCell, rowIndex = _b.rowIndex, colIndex = _b.colIndex;
2203
+ this.gantt.treeList.focusCell(rowIndex, colIndex); // activates the target cell even if it has tabindex="-1"
2204
+ }
2205
+ this.activeTimelineIndex = this.gantt.treeList.activeCell.dataRowIndex;
2206
+ this.notifyTaskStatusChange();
2207
+ if (this.gantt.treeList.activeCell.dataRowIndex >= 0) {
2208
+ this.scrollHorizontallyToTask(this.activeTimelineIndex);
2209
+ this.scrollSyncService.syncScrollTop('treelist', 'timeline');
2210
+ }
2211
+ };
2212
+ NavigationService.prototype.handleKeydown = function (event) {
2213
+ var _this = this;
2214
+ var _a = event, keyCode = _a.keyCode, target = _a.target, altKey = _a.altKey;
2215
+ var isTimelineActive = this.timelineElement.contains(target);
2216
+ if (isTimelineActive) {
2217
+ if (isArrowUpDownKey(keyCode)) {
2218
+ var direction = keyCode === Keys.ArrowUp ? -1 : 1;
2219
+ this.activeTimelineIndex = this.activeTimelineIndex + direction;
2220
+ this.activeTreeListCell = {
2221
+ rowIndex: this.activeTimelineIndex + this.treeListHeaderRowsCount,
2222
+ colIndex: this.activeTreeListCell.colIndex
2223
+ };
2224
+ }
2225
+ else if (keyCode === Keys.Home) {
2226
+ this.activeTimelineIndex = 0;
2227
+ this.activeTreeListCell = {
2228
+ rowIndex: this.activeTimelineIndex + this.treeListHeaderRowsCount,
2229
+ colIndex: this.activeTreeListCell.colIndex
2230
+ };
2231
+ }
2232
+ else if (keyCode === Keys.End) {
2233
+ var lastAvailableIndex = this.gantt.treeList.view.data.length - 1;
2234
+ this.activeTimelineIndex = lastAvailableIndex;
2235
+ this.activeTreeListCell = {
2236
+ rowIndex: this.activeTimelineIndex + this.treeListHeaderRowsCount,
2237
+ colIndex: this.activeTreeListCell.colIndex
2238
+ };
2239
+ }
2240
+ if (isNavigationKey(keyCode)) {
2241
+ this.scrollHorizontallyToTask(this.activeTimelineIndex);
2242
+ this.scrollSyncService.syncScrollTop('timeline', 'treelist');
2243
+ this.notifyTaskStatusChange();
2244
+ event.preventDefault();
2245
+ }
2246
+ if (keyCode === Keys.Space && hasObservers(this.gantt.selectionChange)) {
2247
+ var task_1 = this.gantt.renderedTreeListItems[this.activeTimelineIndex];
2248
+ var selectionAction_1 = this.gantt.getSelectionAction(event, task_1);
2249
+ if (isPresent(task_1) && !this.gantt.isSameSelection(selectionAction_1, task_1)) {
2250
+ this.zone.run(function () {
2251
+ return _this.gantt.notifySelectionChange(task_1, selectionAction_1);
2252
+ });
2253
+ }
2254
+ event.preventDefault();
2255
+ }
2256
+ if (keyCode === Keys.Enter && hasObservers(this.gantt.taskClick)) {
2257
+ var task_2 = this.gantt.renderedTreeListItems[this.activeTimelineIndex];
2258
+ if (isPresent(task_2)) {
2259
+ this.zone.run(function () {
2260
+ return _this.gantt.notifyTaskClick(event, task_2, _this.activeTimelineIndex);
2261
+ });
2262
+ }
2263
+ event.preventDefault();
2264
+ }
2265
+ if (isExpandCollapseKey(keyCode, altKey)) {
2266
+ var task_3 = this.gantt.renderedTreeListItems[this.activeTimelineIndex];
2267
+ if (isPresent(task_3) && this.gantt.hasChildren(task_3)) {
2268
+ var shouldExpand_1 = keyCode === Keys.ArrowRight;
2269
+ var isExpanded = this.gantt.isExpanded(task_3);
2270
+ var sameState = shouldExpand_1 === isExpanded;
2271
+ if (!sameState) {
2272
+ this.zone.run(function () {
2273
+ var expandEvent = { dataItem: task_3 };
2274
+ // order is not arbitrary
2275
+ // the TreeList emits the individual events first, then the combined `expandStateChange` event
2276
+ var individualEmitter = shouldExpand_1 ? _this.gantt.rowExpand : _this.gantt.rowCollapse;
2277
+ individualEmitter.emit(expandEvent);
2278
+ _this.gantt.expandStateChange.emit(__assign({}, expandEvent, { expand: shouldExpand_1 }));
2279
+ _this.gantt.updateView();
2280
+ _this.scrollHorizontallyToTask(_this.activeTimelineIndex);
2281
+ });
2282
+ }
2283
+ }
2284
+ event.preventDefault();
2285
+ }
2286
+ }
2287
+ var isTreeListActive = this.treeListElement.contains(target);
2288
+ if (keyCode === Keys.Delete && (isTimelineActive || isTreeListActive) && hasObservers(this.gantt.taskDelete)) {
2289
+ var taskIndex = isTreeListActive ?
2290
+ this.gantt.treeList.activeCell.dataRowIndex :
2291
+ this.activeTimelineIndex;
2292
+ var task_4 = this.gantt.renderedTreeListItems[taskIndex];
2293
+ if (isPresent(task_4)) {
2294
+ this.zone.run(function () {
2295
+ return _this.gantt.notifyTaskDelete(task_4);
2296
+ });
2297
+ }
2298
+ }
2299
+ if (isViewDigitKey(keyCode) && !isToolbar(target, this.host) && !this.gantt.isInEditMode) {
2300
+ var targetViewIndex = getIndexFromViewDigitKeyCode(keyCode);
2301
+ var availableViews = this.gantt.views.toArray();
2302
+ var targetView_1 = availableViews[targetViewIndex];
2303
+ if (isPresent(targetView_1) && targetView_1.type !== this.gantt.activeView) {
2304
+ this.zone.run(function () {
2305
+ return _this.gantt.changeActiveView(targetView_1.type);
2306
+ });
2307
+ }
2308
+ }
2309
+ };
2310
+ /**
2311
+ * Filters for task mousedown in the Timeline.
2312
+ */
2313
+ NavigationService.prototype.handleTimelineMousedown = function (_a) {
2314
+ var target = _a.target;
2315
+ if (isTask(target, this.host) && !isClearButton(target, this.host)) {
2316
+ var taskIndex = getClosestTaskIndex(target, this.host);
2317
+ this.focusTask(taskIndex);
2318
+ }
2319
+ };
2320
+ /**
2321
+ * Scrolls horizontally to the beginning of the target task if the beginning of its content is not in the viewport.
2322
+ */
2323
+ NavigationService.prototype.scrollHorizontallyToTask = function (index) {
2324
+ var task = this.timelineElement.querySelectorAll('.k-task-wrap').item(index);
2325
+ if (!isPresent(task)) {
2326
+ return;
2327
+ }
2328
+ // scroll horizontally to the item if less than 200px from the beginning of its content are visible
2329
+ var targetVisibleWidth = 200;
2330
+ var isScrollBeforeTask = (this.timelineElement.clientWidth + this.timelineElement.scrollLeft) < (task.offsetLeft + targetVisibleWidth);
2331
+ var isScrollAfterTask = this.timelineElement.scrollLeft > task.offsetLeft;
2332
+ if (isScrollBeforeTask || isScrollAfterTask) {
2333
+ this.timelineElement.scrollLeft = task.offsetLeft;
2334
+ }
2335
+ };
2336
+ /**
2337
+ * Focus the TreeList on TreeList mousedown.
2338
+ * A nasty hack to trick `handleTreeListFocusIn` into regarding the previous focus target as again the TreeList.
2339
+ * Otherwise cell clicks are wrongly overwritten in `handleTreeListFocusIn` and the click focus target is not respected.
2340
+ */
2341
+ NavigationService.prototype.focusTreeList = function () {
2342
+ this.gantt.treeList.focus();
1706
2343
  };
1707
- TimelineScrollService = __decorate([
1708
- Injectable()
1709
- ], TimelineScrollService);
1710
- return TimelineScrollService;
1711
- }());
1712
-
1713
- /**
1714
- * @hidden
1715
- *
1716
- * Needed to keep the Gantt's LocalizationService reference and be able to use it component's inside the TabStrip
1717
- */
1718
- var GanttLocalizationService = /** @class */ (function () {
1719
- function GanttLocalizationService(localizationService) {
1720
- this.localizationService = localizationService;
1721
- }
1722
- GanttLocalizationService.prototype.get = function (token) {
1723
- return this.localizationService.get(token);
2344
+ /**
2345
+ * Fires the `taskStatusChanges` event with active and focused status retrieved from
2346
+ * `this.activeTimelineIndex` and `this.isTimelineFocused`.
2347
+ */
2348
+ NavigationService.prototype.notifyTaskStatusChange = function () {
2349
+ this.taskStatusChanges.next(this.activeTask);
1724
2350
  };
1725
- GanttLocalizationService = __decorate([
2351
+ NavigationService = __decorate([
1726
2352
  Injectable(),
1727
- __metadata("design:paramtypes", [LocalizationService])
1728
- ], GanttLocalizationService);
1729
- return GanttLocalizationService;
2353
+ __metadata("design:paramtypes", [NgZone,
2354
+ Renderer2,
2355
+ ScrollSyncService])
2356
+ ], NavigationService);
2357
+ return NavigationService;
1730
2358
  }());
1731
2359
 
1732
2360
  /**
@@ -1913,245 +2541,85 @@ var GanttTaskContentTemplateDirective = /** @class */ (function () {
1913
2541
  * orderId: 1,
1914
2542
  * start: new Date("2014-06-02T00:00:00.000Z"),
1915
2543
  * end: new Date("2014-06-07T00:00:00.000Z"),
1916
- * completionRatio: 0.5766666666666667,
1917
- * isExpanded: true,
1918
- * children: [{
1919
- * id: 19,
1920
- * title: "Validation with Customers",
1921
- * orderId: 0,
1922
- * start: new Date("2014-06-02T00:00:00.000Z"),
1923
- * end: new Date("2014-06-04T00:00:00.000Z"),
1924
- * completionRatio: 0.25,
1925
- * isExpanded: true
1926
- * },
1927
- * {
1928
- * id: 20,
1929
- * title: "Market Research",
1930
- * orderId: 1,
1931
- * start: new Date("2014-06-02T00:00:00.000Z"),
1932
- * end: new Date("2014-06-03T02:00:00.000Z"),
1933
- * completionRatio: 0.82,
1934
- * isExpanded: true
1935
- * },
1936
- * {
1937
- * id: 39,
1938
- * title: "Functional and Technical Specification",
1939
- * orderId: 2,
1940
- * start: new Date("2014-06-04T00:00:00.000Z"),
1941
- * end: new Date("2014-06-07T00:00:00.000Z"),
1942
- * completionRatio: 0.66,
1943
- * isExpanded: true
1944
- * }]
1945
- * }]
1946
- * };
1947
- *
1948
- * public positionChange({ target }): void {
1949
- * this.position = target.value;
1950
- * }
1951
- *
1952
- * public onClick(): void {
1953
- * console.log("button was clicked");
1954
- * }
1955
- * }
1956
- *
1957
- * ```
1958
- */
1959
- var ToolbarTemplateDirective = /** @class */ (function () {
1960
- function ToolbarTemplateDirective(templateRef) {
1961
- this.templateRef = templateRef;
1962
- this._position = "top";
1963
- }
1964
- Object.defineProperty(ToolbarTemplateDirective.prototype, "position", {
1965
- get: function () {
1966
- return this._position;
1967
- },
1968
- /**
1969
- * Defines the Gantt Toolbar that will use this template.
1970
- *
1971
- * The possible values are:
1972
- * - `top`&mdash;The template will be rendered in the top toolbar (if present) only.
1973
- * - `bottom`&mdash;The template will be rendered in the bottom toolbar (if present) only.
1974
- * - `both`&mdash;The template will be rendered in both toolbars (if present).
1975
- */
1976
- set: function (position) {
1977
- this._position = position;
1978
- },
1979
- enumerable: true,
1980
- configurable: true
1981
- });
1982
- __decorate([
1983
- Input('position'),
1984
- __metadata("design:type", String),
1985
- __metadata("design:paramtypes", [String])
1986
- ], ToolbarTemplateDirective.prototype, "position", null);
1987
- ToolbarTemplateDirective = __decorate([
1988
- Directive({
1989
- selector: '[kendoGanttToolbarTemplate]'
1990
- }),
1991
- __param(0, Optional()),
1992
- __metadata("design:paramtypes", [TemplateRef])
1993
- ], ToolbarTemplateDirective);
1994
- return ToolbarTemplateDirective;
1995
- }());
1996
-
1997
- /**
1998
- * @hidden
1999
- */
2000
- var GanttTimelineComponent = /** @class */ (function () {
2001
- function GanttTimelineComponent(scrollSyncService, dependencyDomService, renderer, zone) {
2002
- var _this = this;
2003
- this.scrollSyncService = scrollSyncService;
2004
- this.dependencyDomService = dependencyDomService;
2005
- this.renderer = renderer;
2006
- this.zone = zone;
2007
- this.hostClass = true;
2008
- this.dependencies = [];
2009
- // as all drag-and-drop operations are on the timeline container, use a single draggable instance
2010
- this.timelineContainerPress = new EventEmitter();
2011
- this.timelineContainerDrag = new EventEmitter();
2012
- this.timelineContainerRelease = new EventEmitter();
2013
- this.subscriptions = new Subscription();
2014
- this.subscriptions.add(
2015
- // task changes indicates change in row content, number, height, etc.
2016
- this.dependencyDomService.taskChanges
2017
- .pipe(filter(function (args) { return isPresent(args.timelineRow); }), switchMap(function (args) { return _this.zone.onStable.pipe(take(1), map(function () { return args; })); }) // ensure the content is rendered
2018
- )
2019
- .subscribe(function (_a) {
2020
- var timelineRow = _a.timelineRow;
2021
- var timelineRowHeight = isDocumentAvailable() ? timelineRow.getBoundingClientRect().height : 0;
2022
- _this.renderer.setStyle(_this.timelineColumns.nativeElement, 'height', (_this.rows || []).length * timelineRowHeight + "px");
2023
- }));
2024
- }
2025
- Object.defineProperty(GanttTimelineComponent.prototype, "draggableEnabled", {
2026
- /**
2027
- * Specifies whether the draggable will attach or detach its pointer event listeners.
2028
- */
2029
- get: function () {
2030
- return this.renderDependencyDragClues;
2031
- },
2032
- enumerable: true,
2033
- configurable: true
2034
- });
2035
- GanttTimelineComponent.prototype.ngAfterViewInit = function () {
2036
- var timelineHeader = this.timelineHeaderWrap.nativeElement;
2037
- var rightContainer = this.timelineContent.nativeElement;
2038
- this.scrollSyncService.registerElement(rightContainer, 'timeline');
2039
- this.scrollSyncService.registerElement(timelineHeader, 'header');
2040
- this.dependencyDomService.registerContentContainer(this.tasksContainer.nativeElement);
2041
- };
2042
- GanttTimelineComponent.prototype.ngOnDestroy = function () {
2043
- this.subscriptions.unsubscribe();
2044
- };
2045
- GanttTimelineComponent.prototype.isNonWorking = function (item) {
2046
- return item.hasOwnProperty('isWorking') && !item.isWorking;
2047
- };
2048
- __decorate([
2049
- ViewChild('timelineContent', { static: true }),
2050
- __metadata("design:type", ElementRef)
2051
- ], GanttTimelineComponent.prototype, "timelineContent", void 0);
2052
- __decorate([
2053
- ViewChild('timelineColumns', { static: true }),
2054
- __metadata("design:type", ElementRef)
2055
- ], GanttTimelineComponent.prototype, "timelineColumns", void 0);
2056
- __decorate([
2057
- ViewChild('timelineHeaderWrap', { static: true }),
2058
- __metadata("design:type", ElementRef)
2059
- ], GanttTimelineComponent.prototype, "timelineHeaderWrap", void 0);
2060
- __decorate([
2061
- ViewChild('tasksContainer', { static: true }),
2062
- __metadata("design:type", ElementRef)
2063
- ], GanttTimelineComponent.prototype, "tasksContainer", void 0);
2064
- __decorate([
2065
- ViewChild('dragPopupContainer', { static: false, read: ViewContainerRef }),
2066
- __metadata("design:type", ViewContainerRef)
2067
- ], GanttTimelineComponent.prototype, "dragPopupContainer", void 0);
2068
- __decorate([
2069
- ViewChild('dependencyDragCreatePolyline', { static: false }),
2070
- __metadata("design:type", ElementRef)
2071
- ], GanttTimelineComponent.prototype, "dependencyDragCreatePolyline", void 0);
2072
- __decorate([
2073
- HostBinding('class.k-gantt-timeline'),
2074
- __metadata("design:type", Boolean)
2075
- ], GanttTimelineComponent.prototype, "hostClass", void 0);
2076
- __decorate([
2077
- Input(),
2078
- __metadata("design:type", Array)
2079
- ], GanttTimelineComponent.prototype, "rows", void 0);
2080
- __decorate([
2081
- Input(),
2082
- __metadata("design:type", Array)
2083
- ], GanttTimelineComponent.prototype, "slots", void 0);
2084
- __decorate([
2085
- Input(),
2086
- __metadata("design:type", Array)
2087
- ], GanttTimelineComponent.prototype, "groupSlots", void 0);
2088
- __decorate([
2089
- Input(),
2090
- __metadata("design:type", Number)
2091
- ], GanttTimelineComponent.prototype, "tableWidth", void 0);
2092
- __decorate([
2093
- Input(),
2094
- __metadata("design:type", String)
2095
- ], GanttTimelineComponent.prototype, "activeView", void 0);
2096
- __decorate([
2097
- Input(),
2098
- __metadata("design:type", TemplateRef)
2099
- ], GanttTimelineComponent.prototype, "taskContentTemplate", void 0);
2100
- __decorate([
2101
- Input(),
2102
- __metadata("design:type", TemplateRef)
2103
- ], GanttTimelineComponent.prototype, "taskTemplate", void 0);
2104
- __decorate([
2105
- Input(),
2106
- __metadata("design:type", TemplateRef)
2107
- ], GanttTimelineComponent.prototype, "summaryTaskTemplate", void 0);
2108
- __decorate([
2109
- Input(),
2110
- __metadata("design:type", Function)
2111
- ], GanttTimelineComponent.prototype, "taskClass", void 0);
2112
- __decorate([
2113
- Input(),
2114
- __metadata("design:type", Function)
2115
- ], GanttTimelineComponent.prototype, "isTaskSelected", void 0);
2116
- __decorate([
2117
- Input(),
2118
- __metadata("design:type", Boolean)
2119
- ], GanttTimelineComponent.prototype, "renderDependencyDragClues", void 0);
2120
- __decorate([
2121
- Input(),
2122
- __metadata("design:type", Object)
2123
- ], GanttTimelineComponent.prototype, "dragScrollSettings", void 0);
2124
- __decorate([
2125
- Input(),
2126
- __metadata("design:type", Function)
2127
- ], GanttTimelineComponent.prototype, "hasChildren", void 0);
2128
- __decorate([
2129
- Input(),
2130
- __metadata("design:type", Array)
2131
- ], GanttTimelineComponent.prototype, "dependencies", void 0);
2132
- __decorate([
2133
- Output(),
2134
- __metadata("design:type", EventEmitter)
2135
- ], GanttTimelineComponent.prototype, "timelineContainerPress", void 0);
2136
- __decorate([
2137
- Output(),
2138
- __metadata("design:type", EventEmitter)
2139
- ], GanttTimelineComponent.prototype, "timelineContainerDrag", void 0);
2544
+ * completionRatio: 0.5766666666666667,
2545
+ * isExpanded: true,
2546
+ * children: [{
2547
+ * id: 19,
2548
+ * title: "Validation with Customers",
2549
+ * orderId: 0,
2550
+ * start: new Date("2014-06-02T00:00:00.000Z"),
2551
+ * end: new Date("2014-06-04T00:00:00.000Z"),
2552
+ * completionRatio: 0.25,
2553
+ * isExpanded: true
2554
+ * },
2555
+ * {
2556
+ * id: 20,
2557
+ * title: "Market Research",
2558
+ * orderId: 1,
2559
+ * start: new Date("2014-06-02T00:00:00.000Z"),
2560
+ * end: new Date("2014-06-03T02:00:00.000Z"),
2561
+ * completionRatio: 0.82,
2562
+ * isExpanded: true
2563
+ * },
2564
+ * {
2565
+ * id: 39,
2566
+ * title: "Functional and Technical Specification",
2567
+ * orderId: 2,
2568
+ * start: new Date("2014-06-04T00:00:00.000Z"),
2569
+ * end: new Date("2014-06-07T00:00:00.000Z"),
2570
+ * completionRatio: 0.66,
2571
+ * isExpanded: true
2572
+ * }]
2573
+ * }]
2574
+ * };
2575
+ *
2576
+ * public positionChange({ target }): void {
2577
+ * this.position = target.value;
2578
+ * }
2579
+ *
2580
+ * public onClick(): void {
2581
+ * console.log("button was clicked");
2582
+ * }
2583
+ * }
2584
+ *
2585
+ * ```
2586
+ */
2587
+ var ToolbarTemplateDirective = /** @class */ (function () {
2588
+ function ToolbarTemplateDirective(templateRef) {
2589
+ this.templateRef = templateRef;
2590
+ this._position = "top";
2591
+ }
2592
+ Object.defineProperty(ToolbarTemplateDirective.prototype, "position", {
2593
+ get: function () {
2594
+ return this._position;
2595
+ },
2596
+ /**
2597
+ * Defines the Gantt Toolbar that will use this template.
2598
+ *
2599
+ * The possible values are:
2600
+ * - `top`&mdash;The template will be rendered in the top toolbar (if present) only.
2601
+ * - `bottom`&mdash;The template will be rendered in the bottom toolbar (if present) only.
2602
+ * - `both`&mdash;The template will be rendered in both toolbars (if present).
2603
+ */
2604
+ set: function (position) {
2605
+ this._position = position;
2606
+ },
2607
+ enumerable: true,
2608
+ configurable: true
2609
+ });
2140
2610
  __decorate([
2141
- Output(),
2142
- __metadata("design:type", EventEmitter)
2143
- ], GanttTimelineComponent.prototype, "timelineContainerRelease", void 0);
2144
- GanttTimelineComponent = __decorate([
2145
- Component({
2146
- selector: 'kendo-gantt-timeline',
2147
- template: "\n <div class=\"k-timeline k-grid k-widget\">\n <div class=\"k-grid-header\">\n <div #timelineHeaderWrap class=\"k-grid-header-wrap\">\n <table\n role=\"presentation\"\n [style.width.px]=\"tableWidth\"\n >\n <tbody\n kendoGanttHeaderTableBody\n [groupSlots]=\"groupSlots\"\n [slots]=\"slots\">\n </tbody>\n </table>\n </div>\n </div>\n <div\n #timelineContent\n class=\"k-grid-content\"\n kendoGanttTimelineScrollable\n [scrollSettings]=\"dragScrollSettings\"\n kendoDraggable\n [enableDrag]=\"draggableEnabled\"\n (kendoPress)=\"timelineContainerPress.emit($event)\"\n (kendoDrag)=\"timelineContainerDrag.emit($event)\"\n (kendoRelease)=\"timelineContainerRelease.emit($event)\"\n >\n <div class=\"k-gantt-tables\">\n <table\n class=\"k-gantt-rows\"\n [style.width.px]=\"tableWidth\"\n role=\"presentation\"\n >\n <tbody>\n <tr *ngFor=\"let item of rows; let i = index;\"\n [class.k-alt]=\"i % 2\"\n >\n <td></td>\n </tr>\n </tbody>\n </table>\n\n <table\n #timelineColumns\n class=\"k-gantt-columns\"\n role=\"presentation\"\n [style.width.px]=\"tableWidth\"\n >\n <colgroup>\n <col *ngFor=\"let item of slots\">\n </colgroup>\n\n <tbody>\n <tr>\n <td *ngFor=\"let item of slots\"\n [class.k-nonwork-hour]=\"isNonWorking(item)\"\n >\n </td>\n </tr>\n </tbody>\n </table>\n\n <table\n #tasksContainer\n class=\"k-gantt-tasks\"\n role=\"presentation\"\n style=\"border-collapse: collapse;\"\n [style.width.px]=\"tableWidth\"\n >\n <tbody\n kendoGanttTasksTableBody\n [rows]=\"rows\"\n [activeView]=\"activeView\"\n [taskContentTemplate]=\"taskContentTemplate\"\n [taskTemplate]=\"taskTemplate\"\n [summaryTaskTemplate]=\"summaryTaskTemplate\"\n [taskClass]=\"taskClass\"\n [hasChildren]=\"hasChildren\"\n [isTaskSelected]=\"isTaskSelected\"\n [renderDependencyDragClues]=\"renderDependencyDragClues\"\n >\n </tbody>\n </table>\n </div>\n <svg class=\"k-gantt-dependencies-svg\">\n <polyline\n *ngFor=\"let dependency of dependencies\"\n kendoGanttDependency\n [dependency]=\"dependency\"\n />\n <polyline #dependencyDragCreatePolyline />\n </svg>\n\n <!-- placeholder for the dependency drag popup; its position is not arbitrary - the popup is intended to be absolutely positioned inside the .k-grid-content element -->\n <ng-container #dragPopupContainer></ng-container>\n </div>\n </div>\n "
2611
+ Input('position'),
2612
+ __metadata("design:type", String),
2613
+ __metadata("design:paramtypes", [String])
2614
+ ], ToolbarTemplateDirective.prototype, "position", null);
2615
+ ToolbarTemplateDirective = __decorate([
2616
+ Directive({
2617
+ selector: '[kendoGanttToolbarTemplate]'
2148
2618
  }),
2149
- __metadata("design:paramtypes", [ScrollSyncService,
2150
- DependencyDomService,
2151
- Renderer2,
2152
- NgZone])
2153
- ], GanttTimelineComponent);
2154
- return GanttTimelineComponent;
2619
+ __param(0, Optional()),
2620
+ __metadata("design:paramtypes", [TemplateRef])
2621
+ ], ToolbarTemplateDirective);
2622
+ return ToolbarTemplateDirective;
2155
2623
  }());
2156
2624
 
2157
2625
  /**
@@ -2277,7 +2745,7 @@ var DEFAULT_DRAG_SCROLL_SETTINGS = {
2277
2745
  * ```
2278
2746
  */
2279
2747
  var GanttComponent = /** @class */ (function () {
2280
- function GanttComponent(timelineViewService, scrollSyncService, renderer, mapper, optionChangesService, dependencyDomService, editService, localizationService, hostElement, zone) {
2748
+ function GanttComponent(timelineViewService, scrollSyncService, renderer, mapper, optionChangesService, dependencyDomService, editService, localizationService, hostElement, zone, navigationService) {
2281
2749
  var _this = this;
2282
2750
  this.timelineViewService = timelineViewService;
2283
2751
  this.scrollSyncService = scrollSyncService;
@@ -2289,6 +2757,15 @@ var GanttComponent = /** @class */ (function () {
2289
2757
  this.localizationService = localizationService;
2290
2758
  this.hostElement = hostElement;
2291
2759
  this.zone = zone;
2760
+ this.navigationService = navigationService;
2761
+ /**
2762
+ * @hidden
2763
+ */
2764
+ this.roleDescription = 'Gantt Chart';
2765
+ /**
2766
+ * @hidden
2767
+ */
2768
+ this.role = 'application';
2292
2769
  this.hostClasses = true;
2293
2770
  /**
2294
2771
  * Specifies a callback that determines if the given task is selected ([see example]({% slug selection_gantt %}#toc-custom-selection)).
@@ -2360,6 +2837,12 @@ var GanttComponent = /** @class */ (function () {
2360
2837
  * The end of the work week (index based).
2361
2838
  */
2362
2839
  this.workWeekEnd = 5;
2840
+ /**
2841
+ * If set to `true`, the user can use dedicated shortcuts to interact with the Gantt.
2842
+ * By default, navigation is disabled for the TreeList and Timeline parts of the component,
2843
+ * ([see example]({% slug keyboard_navigation_gantt %})).
2844
+ */
2845
+ this.navigable = false;
2363
2846
  /**
2364
2847
  * Indicates whether the Gantt columns will be resized during initialization so that they fit their headers and row content.
2365
2848
  * Columns with autoSize set to false are excluded.
@@ -2403,7 +2886,8 @@ var GanttComponent = /** @class */ (function () {
2403
2886
  */
2404
2887
  this.cellClose = new EventEmitter();
2405
2888
  /**
2406
- * Fires when the end user clicks the `Delete` button in the task editing dialog or the task delete icon.
2889
+ * Fires when the end user clicks the `Delete` button in the task editing dialog,
2890
+ * the task delete icon, or presses the `Delete` key on the keyboard when a task in the timeline is focused.
2407
2891
  * Use the event handler to open a confirmation dialog when necessary.
2408
2892
  */
2409
2893
  this.taskDelete = new EventEmitter();
@@ -2538,7 +3022,13 @@ var GanttComponent = /** @class */ (function () {
2538
3022
  }));
2539
3023
  this.editService.getSelectedItem = this.getFirstSelectedItem.bind(this);
2540
3024
  this.editServiceSubscription.add(this.editService.showEditingDialog.subscribe(function (show) { return _this.showEditingDialog = show; }));
2541
- this.editServiceSubscription.add(this.editService.showConfirmationDialog.subscribe(function () { return _this.taskDelete.emit(); }));
3025
+ this.editServiceSubscription.add(this.editService.taskDelete.subscribe(function (task) {
3026
+ if (hasObservers(_this.taskDelete)) {
3027
+ _this.zone.run(function () {
3028
+ return _this.notifyTaskDelete(task);
3029
+ });
3030
+ }
3031
+ }));
2542
3032
  this.editServiceSubscription.add(this.editService.editEvent.subscribe(function (args) {
2543
3033
  _this[args.editResultType].emit({
2544
3034
  taskFormGroup: args.taskFormGroup,
@@ -2549,6 +3039,9 @@ var GanttComponent = /** @class */ (function () {
2549
3039
  _this.showConfirmationDialog = _this.showEditingDialog = false;
2550
3040
  _this.editService.dataItem = _this.editService.taskFormGroup = null;
2551
3041
  _this.updateView();
3042
+ if (_this.navigable) {
3043
+ _this.focus();
3044
+ }
2552
3045
  }));
2553
3046
  this.editServiceSubscription.add(this.editService.addEvent.subscribe(function (args) {
2554
3047
  var selectedItem = _this.getFirstSelectedItem();
@@ -2578,6 +3071,20 @@ var GanttComponent = /** @class */ (function () {
2578
3071
  enumerable: true,
2579
3072
  configurable: true
2580
3073
  });
3074
+ Object.defineProperty(GanttComponent.prototype, "hostRoleDescriptionAttr", {
3075
+ get: function () {
3076
+ return this.roleDescription;
3077
+ },
3078
+ enumerable: true,
3079
+ configurable: true
3080
+ });
3081
+ Object.defineProperty(GanttComponent.prototype, "hostRoleAttr", {
3082
+ get: function () {
3083
+ return this.role;
3084
+ },
3085
+ enumerable: true,
3086
+ configurable: true
3087
+ });
2581
3088
  Object.defineProperty(GanttComponent.prototype, "dir", {
2582
3089
  get: function () {
2583
3090
  return this.direction;
@@ -2820,6 +3327,19 @@ var GanttComponent = /** @class */ (function () {
2820
3327
  enumerable: true,
2821
3328
  configurable: true
2822
3329
  });
3330
+ Object.defineProperty(GanttComponent.prototype, "viewItems", {
3331
+ /**
3332
+ * @hidden
3333
+ */
3334
+ get: function () {
3335
+ if (!isPresent(this.treeList)) {
3336
+ return [];
3337
+ }
3338
+ return this.treeList.view.data;
3339
+ },
3340
+ enumerable: true,
3341
+ configurable: true
3342
+ });
2823
3343
  Object.defineProperty(GanttComponent.prototype, "filterMenu", {
2824
3344
  /**
2825
3345
  * @hidden
@@ -2883,6 +3403,16 @@ var GanttComponent = /** @class */ (function () {
2883
3403
  enumerable: true,
2884
3404
  configurable: true
2885
3405
  });
3406
+ Object.defineProperty(GanttComponent.prototype, "isInEditMode", {
3407
+ /**
3408
+ * @hidden
3409
+ */
3410
+ get: function () {
3411
+ return this.showEditingDialog || this.showConfirmationDialog || this.treeList.isEditing();
3412
+ },
3413
+ enumerable: true,
3414
+ configurable: true
3415
+ });
2886
3416
  GanttComponent.prototype.ngOnChanges = function (changes) {
2887
3417
  if (anyChanged(['data', 'activeView', 'workWeekStart', 'workWeekEnd', 'workDayStart', 'workDayEnd'], changes)) {
2888
3418
  this.loadTimelineData();
@@ -2890,6 +3420,14 @@ var GanttComponent = /** @class */ (function () {
2890
3420
  };
2891
3421
  GanttComponent.prototype.ngAfterViewInit = function () {
2892
3422
  this.updateTreeListMargin();
3423
+ if (this.navigable) {
3424
+ this.navigationService.initialize({
3425
+ gantt: this,
3426
+ host: this.hostElement.nativeElement,
3427
+ treeListElement: this.treeList.wrapper.nativeElement,
3428
+ timelineElement: this.timeline.timelineContent.nativeElement
3429
+ });
3430
+ }
2893
3431
  var leftContainer = this.treeList.wrapper.nativeElement.querySelector('kendo-treelist-list > div');
2894
3432
  this.scrollSyncService.registerElement(leftContainer, 'treelist');
2895
3433
  };
@@ -2907,6 +3445,34 @@ var GanttComponent = /** @class */ (function () {
2907
3445
  this.localizationSubscription.unsubscribe();
2908
3446
  }
2909
3447
  };
3448
+ /**
3449
+ * Focuses the last active cell or task in the Gantt.
3450
+ * If no item has previously been focused, the first cell of the TreeList part will receive focus,
3451
+ * ([see example]({% slug keyboard_navigation_gantt %}#toc-controlling-the-focus)).
3452
+ */
3453
+ GanttComponent.prototype.focus = function () {
3454
+ if (this.navigable) {
3455
+ this.navigationService.focusLastActiveItem();
3456
+ }
3457
+ };
3458
+ /**
3459
+ * Focuses the targeted cell in the TreeList part of the component,
3460
+ * ([see example]({% slug keyboard_navigation_gantt %}#toc-controlling-the-focus)).
3461
+ */
3462
+ GanttComponent.prototype.focusCell = function (rowIndex, colIndex) {
3463
+ if (this.navigable) {
3464
+ this.navigationService.focusCell(rowIndex, colIndex);
3465
+ }
3466
+ };
3467
+ /**
3468
+ * Focuses the targeted task in the Timeline part of the component,
3469
+ * ([see example]({% slug keyboard_navigation_gantt %}#toc-controlling-the-focus)).
3470
+ */
3471
+ GanttComponent.prototype.focusTask = function (taskIndex) {
3472
+ if (this.navigable) {
3473
+ this.navigationService.focusTask(taskIndex);
3474
+ }
3475
+ };
2910
3476
  /**
2911
3477
  * Applies the minimum possible width for the specified column,
2912
3478
  * so that the whole text fits without wrapping. This method expects the Gantt
@@ -2996,6 +3562,15 @@ var GanttComponent = /** @class */ (function () {
2996
3562
  GanttComponent.prototype.openConfirmationDialog = function () {
2997
3563
  this.showConfirmationDialog = true;
2998
3564
  };
3565
+ /**
3566
+ * @hidden
3567
+ */
3568
+ GanttComponent.prototype.handleConfirmationDialogClose = function () {
3569
+ this.showConfirmationDialog = false;
3570
+ if (this.navigable) {
3571
+ this.focus();
3572
+ }
3573
+ };
2999
3574
  /**
3000
3575
  * Opens a cell for editing.
3001
3576
  */
@@ -3081,7 +3656,7 @@ var GanttComponent = /** @class */ (function () {
3081
3656
  if (hasObservers(this.taskClick)) {
3082
3657
  var taskIndex_1 = getClosestTaskIndex(target, gantt);
3083
3658
  var task_1 = this.renderedTreeListItems[taskIndex_1];
3084
- this.zone.run(function () { return _this.emitTaskClick(event, task_1, taskIndex_1); });
3659
+ this.zone.run(function () { return _this.notifyTaskClick(event, task_1, taskIndex_1); });
3085
3660
  }
3086
3661
  };
3087
3662
  /**
@@ -3100,8 +3675,8 @@ var GanttComponent = /** @class */ (function () {
3100
3675
  if ((hasObservers(this.selectionChange) && !this.isSameSelection(selectionAction, task)) ||
3101
3676
  hasObservers(this.taskClick)) {
3102
3677
  this.zone.run(function () {
3103
- _this.emitSelectionChange(task, selectionAction);
3104
- _this.emitTaskClick(event, task, taskIndex);
3678
+ _this.notifySelectionChange(task, selectionAction);
3679
+ _this.notifyTaskClick(event, task, taskIndex);
3105
3680
  });
3106
3681
  }
3107
3682
  };
@@ -3139,7 +3714,7 @@ var GanttComponent = /** @class */ (function () {
3139
3714
  }
3140
3715
  var task = event.items.map(function (item) { return item.dataItem; })[0]; // single selection only currently available
3141
3716
  var action = event.action;
3142
- this.emitSelectionChange(task, action);
3717
+ this.notifySelectionChange(task, action);
3143
3718
  };
3144
3719
  /**
3145
3720
  * @hidden
@@ -3191,7 +3766,7 @@ var GanttComponent = /** @class */ (function () {
3191
3766
  dataItem: task_2,
3192
3767
  originalEvent: event,
3193
3768
  sender: _this,
3194
- rowIndex: taskIndex_2,
3769
+ index: taskIndex_2,
3195
3770
  type: 'dblclick'
3196
3771
  }); });
3197
3772
  }
@@ -3202,16 +3777,35 @@ var GanttComponent = /** @class */ (function () {
3202
3777
  GanttComponent.prototype.getText = function (token) {
3203
3778
  return this.localizationService.get(token);
3204
3779
  };
3205
- GanttComponent.prototype.emitTaskClick = function (event, dataItem, itemIndex) {
3780
+ /**
3781
+ * @hidden
3782
+ */
3783
+ GanttComponent.prototype.changeActiveView = function (view) {
3784
+ if (view !== this.activeView) {
3785
+ this.activeView = view;
3786
+ this.loadTimelineData();
3787
+ this.scrollSyncService.resetTimelineScrollLeft();
3788
+ this.activeViewChange.emit(view);
3789
+ }
3790
+ };
3791
+ /**
3792
+ * @hidden
3793
+ */
3794
+ GanttComponent.prototype.notifyTaskClick = function (event, dataItem, itemIndex) {
3795
+ // simulates the TreeList `cellClick` event triggered by enter press (type: 'click')
3796
+ var type = event instanceof KeyboardEvent ? 'click' : event.type;
3206
3797
  this.taskClick.emit({
3207
3798
  originalEvent: event,
3208
3799
  dataItem: dataItem,
3209
- rowIndex: itemIndex,
3210
- type: event.type,
3800
+ index: itemIndex,
3801
+ type: type,
3211
3802
  sender: this
3212
3803
  });
3213
3804
  };
3214
- GanttComponent.prototype.emitSelectionChange = function (dataItem, action) {
3805
+ /**
3806
+ * @hidden
3807
+ */
3808
+ GanttComponent.prototype.notifySelectionChange = function (dataItem, action) {
3215
3809
  if (this.isSameSelection(action, dataItem)) {
3216
3810
  return;
3217
3811
  }
@@ -3222,6 +3816,30 @@ var GanttComponent = /** @class */ (function () {
3222
3816
  });
3223
3817
  this.treeList.updateView();
3224
3818
  };
3819
+ /**
3820
+ * @hidden
3821
+ */
3822
+ GanttComponent.prototype.notifyTaskDelete = function (task) {
3823
+ this.editService.dataItem = task;
3824
+ this.taskDelete.emit({
3825
+ item: getEditItem(task, this.treeList.view.data, this.mapper),
3826
+ sender: this
3827
+ });
3828
+ };
3829
+ /**
3830
+ * @hidden
3831
+ */
3832
+ GanttComponent.prototype.isSameSelection = function (action, dataItem) {
3833
+ return action === 'select' && this.isSelected(dataItem);
3834
+ };
3835
+ /**
3836
+ * @hidden
3837
+ */
3838
+ GanttComponent.prototype.getSelectionAction = function (_a, dataItem) {
3839
+ var ctrlKey = _a.ctrlKey, metaKey = _a.metaKey;
3840
+ var shouldToggleSelection = ctrlKey || metaKey;
3841
+ return (shouldToggleSelection && this.isSelected(dataItem)) ? 'remove' : 'select';
3842
+ };
3225
3843
  GanttComponent.prototype.updateTreeListGroupClass = function (columns) {
3226
3844
  if (columns === void 0) { columns = this.columns; }
3227
3845
  if (!isPresent(this.treeList)) {
@@ -3252,14 +3870,6 @@ var GanttComponent = /** @class */ (function () {
3252
3870
  }
3253
3871
  return this.views.find(function (view) { return view.type === _this.activeView; });
3254
3872
  };
3255
- GanttComponent.prototype.isSameSelection = function (action, dataItem) {
3256
- return action === 'select' && this.isSelected(dataItem);
3257
- };
3258
- GanttComponent.prototype.getSelectionAction = function (_a, dataItem) {
3259
- var ctrlKey = _a.ctrlKey, metaKey = _a.metaKey;
3260
- var shouldToggleSelection = ctrlKey || metaKey;
3261
- return (shouldToggleSelection && this.isSelected(dataItem)) ? 'remove' : 'select';
3262
- };
3263
3873
  GanttComponent.prototype.getFirstSelectedItem = function () {
3264
3874
  var isSelectedCallback = this.isSelected || isSelected;
3265
3875
  var loadedItems = this.renderedTreeListItems || [];
@@ -3340,6 +3950,24 @@ var GanttComponent = /** @class */ (function () {
3340
3950
  ContentChildren(ToolbarTemplateDirective),
3341
3951
  __metadata("design:type", QueryList)
3342
3952
  ], GanttComponent.prototype, "toolbarTemplateChildren", void 0);
3953
+ __decorate([
3954
+ Input('aria-roledescription'),
3955
+ __metadata("design:type", String)
3956
+ ], GanttComponent.prototype, "roleDescription", void 0);
3957
+ __decorate([
3958
+ HostBinding('attr.aria-roledescription'),
3959
+ __metadata("design:type", String),
3960
+ __metadata("design:paramtypes", [])
3961
+ ], GanttComponent.prototype, "hostRoleDescriptionAttr", null);
3962
+ __decorate([
3963
+ Input('role'),
3964
+ __metadata("design:type", String)
3965
+ ], GanttComponent.prototype, "role", void 0);
3966
+ __decorate([
3967
+ HostBinding('attr.role'),
3968
+ __metadata("design:type", String),
3969
+ __metadata("design:paramtypes", [])
3970
+ ], GanttComponent.prototype, "hostRoleAttr", null);
3343
3971
  __decorate([
3344
3972
  HostBinding('class.k-gantt'),
3345
3973
  __metadata("design:type", Boolean)
@@ -3445,6 +4073,10 @@ var GanttComponent = /** @class */ (function () {
3445
4073
  Input(),
3446
4074
  __metadata("design:type", Number)
3447
4075
  ], GanttComponent.prototype, "workWeekEnd", void 0);
4076
+ __decorate([
4077
+ Input(),
4078
+ __metadata("design:type", Boolean)
4079
+ ], GanttComponent.prototype, "navigable", void 0);
3448
4080
  __decorate([
3449
4081
  Input(),
3450
4082
  __metadata("design:type", Object),
@@ -3610,9 +4242,10 @@ var GanttComponent = /** @class */ (function () {
3610
4242
  MappingService,
3611
4243
  OptionChangesService,
3612
4244
  EditService,
3613
- TimelineScrollService
4245
+ TimelineScrollService,
4246
+ NavigationService
3614
4247
  ],
3615
- template: "\n <ng-container kendoGanttLocalizedMessages\n i18n-taskEditingGeneralTabTitle=\"kendo.gantt.taskEditingGeneralTabTitle|The title of the 'General' tab of the editing dialog TabStrip\"\n taskEditingGeneralTabTitle=\"General\"\n\n i18n-taskEditingPredecessorsTabTitle=\"kendo.gantt.taskEditingPredecessorsTabTitle|The title of the 'Predecessors' dependencies tab of the editing dialog TabStrip\"\n taskEditingPredecessorsTabTitle=\"Predecessors\"\n\n i18n-taskEditingSuccessorsTabTitle=\"kendo.gantt.taskEditingSuccessorsTabTitle|The title of the 'Successors' dependencies tab of the editing dialog TabStrip\"\n taskEditingSuccessorsTabTitle=\"Successors\"\n\n i18n-taskEditingDependenciesAddButtonText=\"kendo.gantt.taskEditingDependenciesAddButtonText|The text of the 'Add' button in the dependencies tabs of the editing dialog TabStrip\"\n taskEditingDependenciesAddButtonText=\"Add\"\n\n i18n-taskEditingDependenciesRemoveButtonText=\"kendo.gantt.taskEditingDependenciesRemoveButtonText|The text of the 'Remove' button in the dependencies tabs of the editing dialog TabStrip\"\n taskEditingDependenciesRemoveButtonText=\"Remove\"\n\n i18n-taskEditingDependenciesGridNameColumnTitle=\"kendo.gantt.taskEditingDependenciesGridNameColumnTitle|The title of the 'Task Title' Grid column in the dependencies tabs of the editing dialog TabStrip\"\n taskEditingDependenciesGridNameColumnTitle=\"Task Title\"\n\n i18n-taskEditingDependenciesGridTypeColumnTitle=\"kendo.gantt.taskEditingDependenciesGridTypeColumnTitle|The title of the 'Type' Grid column in the dependencies tabs of the editing dialog TabStrip\"\n taskEditingDependenciesGridTypeColumnTitle=\"Type\"\n\n i18n-taskDeleteLabel=\"kendo.gantt.taskDeleteLabel|The label of the task delete icon\"\n taskDeleteLabel=\"Delete\"\n\n i18n-taskEditingDialogTitle=\"kendo.gantt.taskEditingDialogTitle|The title of the task editing dialog\"\n taskEditingDialogTitle=\"Editing Task\"\n\n i18n-taskEditingDialogCloseTitle=\"kendo.gantt.taskEditingDialogCloseTitle|The title of the task editing dialog close button\"\n taskEditingDialogCloseTitle=\"Close\"\n\n i18n-confirmationDialogCloseTitle=\"kendo.gantt.confirmationDialogCloseTitle|The title of the confirmation dialog close button\"\n confirmationDialogCloseTitle=\"Close\"\n\n i18n-confirmationDialogTitle=\"kendo.gantt.confirmationDialogTitle|The title of the delete task confirmation dialog\"\n confirmationDialogTitle=\"Delete Task\"\n\n i18n-confirmationDialogContent=\"kendo.gantt.confirmationDialogContent|The content of the delete task confirmation dialog\"\n confirmationDialogContent=\"Are you sure you want to delete this task?\"\n\n i18n-deleteButtonText=\"kendo.gantt.deleteButtonText|The text of the task editing dialog 'Delete' button\"\n deleteButtonText=\"Delete\"\n\n i18n-cancelButtonText=\"kendo.gantt.cancelButtonText|The text of the task editing dialog 'Cancel' button\"\n cancelButtonText=\"Cancel\"\n\n i18n-saveButtonText=\"kendo.gantt.saveButtonText|The text of the task editing dialog 'Save' button\"\n saveButtonText=\"Save\"\n\n i18n-titleFieldInputLabel=\"kendo.gantt.titleFieldInputLabel|The label of the 'title' field input in editing mode\"\n titleFieldInputLabel=\"Title\"\n\n i18n-startFieldInputLabel=\"kendo.gantt.startFieldInputLabel|The label of the 'start' field input in editing mode\"\n startFieldInputLabel=\"Start\"\n\n i18n-endFieldInputLabel=\"kendo.gantt.endFieldInputLabel|The label of the 'end' field input in editing mode\"\n endFieldInputLabel=\"End\"\n\n i18n-completionRatioFieldInputLabel=\"kendo.gantt.completionRatioFieldInputLabel|The label of the 'completionRatio' field input in editing mode\"\n completionRatioFieldInputLabel=\"Progress\"\n\n i18n-dayViewText=\"kendo.gantt.dayViewText|The text of the day view in the ViewSelector component\"\n dayViewText=\"Day\"\n\n i18n-weekViewText=\"kendo.gantt.weekViewText|The text of the week view in the ViewSelector component\"\n weekViewText=\"Week\"\n\n i18n-monthViewText=\"kendo.gantt.monthViewText|The text of the month view in the ViewSelector component\"\n monthViewText=\"Month\"\n\n i18n-yearViewText-disabled=\"kendo.gantt.yearViewText|The text of the year view in the ViewSelector component\"\n yearViewText=\"Year\"\n\n i18n-addTaskText=\"kendo.gantt.addTaskText|The text of the DropDownButton in the AddTask component\"\n addTaskText=\"Add Task\"\n\n i18n-addChildText=\"kendo.gantt.addChildText|The text of the 'Add Child' option in the AddTask component\"\n addChildText=\"Add Child\"\n\n i18n-addAboveText=\"kendo.gantt.addAboveText|The text of the 'Add Above' option in the AddTask component\"\n addAboveText=\"Add Above\"\n\n i18n-addBelowText=\"kendo.gantt.addBelowText|The text of the 'Add Below' option in the AddTask component\"\n addBelowText=\"Add Below\"\n\n i18n-noRecords=\"kendo.gantt.noRecords|The label visible in the TreeList when there are no records\"\n noRecords=\"No records available.\"\n\n i18n-filter=\"kendo.gantt.filter|The label of the filter cell or icon\"\n filter=\"Filter\"\n\n i18n-filterEqOperator=\"kendo.gantt.filterEqOperator|The text of the equal filter operator\"\n filterEqOperator=\"Is equal to\"\n\n i18n-filterNotEqOperator=\"kendo.gantt.filterNotEqOperator|The text of the not equal filter operator\"\n filterNotEqOperator=\"Is not equal to\"\n\n i18n-filterIsNullOperator=\"kendo.gantt.filterIsNullOperator|The text of the is null filter operator\"\n filterIsNullOperator=\"Is null\"\n\n i18n-filterIsNotNullOperator=\"kendo.gantt.filterIsNotNullOperator|The text of the is not null filter operator\"\n filterIsNotNullOperator=\"Is not null\"\n\n i18n-filterIsEmptyOperator=\"kendo.gantt.filterIsEmptyOperator|The text of the is empty filter operator\"\n filterIsEmptyOperator=\"Is empty\"\n\n i18n-filterIsNotEmptyOperator=\"kendo.gantt.filterIsNotEmptyOperator|The text of the is not empty filter operator\"\n filterIsNotEmptyOperator=\"Is not empty\"\n\n i18n-filterStartsWithOperator=\"kendo.gantt.filterStartsWithOperator|The text of the starts with filter operator\"\n filterStartsWithOperator=\"Starts with\"\n\n i18n-filterContainsOperator=\"kendo.gantt.filterContainsOperator|The text of the contains filter operator\"\n filterContainsOperator=\"Contains\"\n\n i18n-filterNotContainsOperator=\"kendo.gantt.filterNotContainsOperator|The text of the does not contain filter operator\"\n filterNotContainsOperator=\"Does not contain\"\n\n i18n-filterEndsWithOperator=\"kendo.gantt.filterEndsWithOperator|The text of the ends with filter operator\"\n filterEndsWithOperator=\"Ends with\"\n\n i18n-filterGteOperator=\"kendo.gantt.filterGteOperator|The text of the greater than or equal filter operator\"\n filterGteOperator=\"Is greater than or equal to\"\n\n i18n-filterGtOperator=\"kendo.gantt.filterGtOperator|The text of the greater than filter operator\"\n filterGtOperator=\"Is greater than\"\n\n i18n-filterLteOperator=\"kendo.gantt.filterLteOperator|The text of the less than or equal filter operator\"\n filterLteOperator=\"Is less than or equal to\"\n\n i18n-filterLtOperator=\"kendo.gantt.filterLtOperator|The text of the less than filter operator\"\n filterLtOperator=\"Is less than\"\n\n i18n-filterIsTrue=\"kendo.gantt.filterIsTrue|The text of the IsTrue boolean filter option\"\n filterIsTrue=\"Is True\"\n\n i18n-filterIsFalse=\"kendo.gantt.filterIsFalse|The text of the IsFalse boolean filter option\"\n filterIsFalse=\"Is False\"\n\n i18n-filterBooleanAll=\"kendo.gantt.filterBooleanAll|The text of the (All) boolean filter option\"\n filterBooleanAll=\"(All)\"\n\n i18n-filterAfterOrEqualOperator=\"kendo.gantt.filterAfterOrEqualOperator|The text of the after or equal date filter operator\"\n filterAfterOrEqualOperator=\"Is after or equal to\"\n\n i18n-filterAfterOperator=\"kendo.gantt.filterAfterOperator|The text of the after date filter operator\"\n filterAfterOperator=\"Is after\"\n\n i18n-filterBeforeOperator=\"kendo.gantt.filterBeforeOperator|The text of the before date filter operator\"\n filterBeforeOperator=\"Is before\"\n\n i18n-filterBeforeOrEqualOperator=\"kendo.gantt.filterBeforeOrEqualOperator|The text of the before or equal date filter operator\"\n filterBeforeOrEqualOperator=\"Is before or equal to\"\n\n i18n-filterFilterButton=\"kendo.gantt.filterFilterButton|The text of the filter button\"\n filterFilterButton=\"Filter\"\n\n i18n-filterClearButton=\"kendo.gantt.filterClearButton|The text of the clear filter button\"\n filterClearButton=\"Clear\"\n\n i18n-filterAndLogic=\"kendo.gantt.filterAndLogic|The text of the And filter logic\"\n filterAndLogic=\"And\"\n\n i18n-filterOrLogic=\"kendo.gantt.filterOrLogic|The text of the Or filter logic\"\n filterOrLogic=\"Or\"\n\n i18n-loading=\"kendo.gantt.loading|The loading text\"\n loading=\"Loading\"\n\n i18n-columnMenu=\"kendo.gantt.columnMenu|The title of the column menu icon\"\n columnMenu=\"Column Menu\"\n\n i18n-columns=\"kendo.gantt.columns|The text shown in the column menu for the columns item\"\n columns=\"Columns\"\n\n i18n-lock-disabled=\"kendo.gantt.lock|The text shown in the column menu for the lock item\"\n lock-disabled=\"Lock\"\n\n i18n-unlock-disabled=\"kendo.gantt.unlock|The text shown in the column menu for the unlock item\"\n unlock-disabled=\"Unlock\"\n\n i18n-sortable=\"kendo.gantt.sortable|The label of the sort icon\"\n sortable=\"Sortable\"\n\n i18n-sortAscending=\"kendo.gantt.sortAscending|The text shown in the column menu for the sort ascending item\"\n sortAscending=\"Sort Ascending\"\n\n i18n-sortDescending=\"kendo.gantt.sortDescending|The text shown in the column menu for the sort descending item\"\n sortDescending=\"Sort Descending\"\n\n i18n-sortedAscending=\"kendo.gantt.sortedAscending|The status announcement when a column is sorted ascending\"\n sortedAscending=\"Sorted Ascending\"\n\n i18n-sortedDescending=\"kendo.gantt.sortedDescending|The status announcement when a column is sorted descending\"\n sortedDescending=\"Sorted Descending\"\n\n i18n-sortedDefault=\"kendo.gantt.sortedDefault|The status announcement when a column is no longer sorted\"\n sortedDefault=\"Not Sorted\"\n\n i18n-columnsApply=\"kendo.gantt.columnsApply|The text shown in the column menu or column chooser for the columns apply button\"\n columnsApply=\"Apply\"\n\n i18n-columnsReset=\"kendo.gantt.columnsReset|The text shown in the column menu or column chooser for the columns reset button\"\n columnsReset=\"Reset\"></ng-container>\n <kendo-gantt-toolbar\n *ngIf=\"showToolbar('top')\"\n [showAddTask]=\"toolbarSettings.addTaskTool === 'top' || toolbarSettings.addTaskTool === 'both'\"\n [showViewSelector]=\"toolbarSettings.viewSelectorTool === 'top' || toolbarSettings.viewSelectorTool === 'both'\"\n class=\"k-gantt-header k-toolbar k-gantt-toolbar\"\n position=\"top\"></kendo-gantt-toolbar>\n <div class=\"k-gantt-content\">\n <kendo-splitter [style.border]=\"0\">\n <kendo-splitter-pane\n class=\"k-gantt-treelist k-gantt-treelist-scrollable\"\n [collapsible]=\"treeListPaneOptions?.collapsible\"\n [collapsed]=\"treeListPaneOptions?.collapsed\"\n (collapsedChange)=\"onTreeListCollapsedChange($event)\"\n [scrollable]=\"false\">\n <kendo-treelist\n [idField]=\"taskIdField\"\n [columns]=\"columns\"\n [data]=\"data\"\n [hasChildren]=\"hasChildren\"\n [fetchChildren]=\"fetchChildren\"\n [isExpanded]=\"isExpanded\"\n [autoSize]=\"columnsAutoSize\"\n [columnMenu]=\"columnMenu\"\n [reorderable]=\"columnsReorderable\"\n [resizable]=\"columnsResizable\"\n [rowClass]=\"rowClass\"\n [isSelected]=\"isSelected\"\n [selectable]=\"selectable\"\n [sortable]=\"sortable\"\n [sort]=\"sort\"\n [filterable]=\"filterMenu\"\n [filter]=\"filter\"\n (filterChange)=\"filterChange.emit($event)\"\n (sortChange)=\"sortChange.emit($event)\"\n (dataStateChange)=\"dataStateChange.emit({\n filter: $event.filter,\n sort: $event.sort\n })\"\n (expandStateChange)=\"expandStateChange.emit($event)\"\n (expand)=\"rowExpand.emit({ dataItem: $event.dataItem })\"\n (collapse)=\"rowCollapse.emit({ dataItem: $event.dataItem })\"\n (columnReorder)=\"columnReorder.emit($event)\"\n (columnResize)=\"columnResize.emit($event)\"\n (columnVisibilityChange)=\"handleColumnVisibilityChange($event)\"\n (columnLockedChange)=\"columnLockedChange.emit($event)\"\n (selectionChange)=\"handleTreeListSelectionChange($event)\"\n (cellClick)=\"handleTreeListCellClick($event)\"\n (cellClose)=\"handleCellClose($event)\"\n [kendoEventsOutsideAngular]=\"{\n dblclick: handleTreeListDoubleClick\n }\"\n [scope]=\"this\"\n >\n <kendo-treelist-messages\n [noRecords]=\"getText('noRecords')\"\n [filter]=\"getText('filter')\"\n [filterEqOperator]=\"getText('filterEqOperator')\"\n [filterNotEqOperator]=\"getText('filterNotEqOperator')\"\n [filterIsNullOperator]=\"getText('filterIsNullOperator')\"\n [filterIsNotNullOperator]=\"getText('filterIsNotNullOperator')\"\n [filterIsEmptyOperator]=\"getText('filterIsEmptyOperator')\"\n [filterIsNotEmptyOperator]=\"getText('filterIsNotEmptyOperator')\"\n [filterStartsWithOperator]=\"getText('filterStartsWithOperator')\"\n [filterContainsOperator]=\"getText('filterContainsOperator')\"\n [filterNotContainsOperator]=\"getText('filterNotContainsOperator')\"\n [filterEndsWithOperator]=\"getText('filterEndsWithOperator')\"\n [filterGteOperator]=\"getText('filterGteOperator')\"\n [filterGtOperator]=\"getText('filterGtOperator')\"\n [filterLteOperator]=\"getText('filterLteOperator')\"\n [filterLtOperator]=\"getText('filterLtOperator')\"\n [filterIsTrue]=\"getText('filterIsTrue')\"\n [filterIsFalse]=\"getText('filterIsFalse')\"\n [filterBooleanAll]=\"getText('filterBooleanAll')\"\n [filterAfterOrEqualOperator]=\"getText('filterAfterOrEqualOperator')\"\n [filterAfterOperator]=\"getText('filterAfterOperator')\"\n [filterBeforeOperator]=\"getText('filterBeforeOperator')\"\n [filterBeforeOrEqualOperator]=\"getText('filterBeforeOrEqualOperator')\"\n [filterFilterButton]=\"getText('filterFilterButton')\"\n [filterClearButton]=\"getText('filterClearButton')\"\n [filterAndLogic]=\"getText('filterAndLogic')\"\n [filterOrLogic]=\"getText('filterOrLogic')\"\n [loading]=\"getText('loading')\"\n [columnMenu]=\"getText('columnMenu')\"\n [columns]=\"getText('columns')\"\n [sortable]=\"getText('sortable')\"\n [sortAscending]=\"getText('sortAscending')\"\n [sortDescending]=\"getText('sortDescending')\"\n [sortedAscending]=\"getText('sortedAscending')\"\n [sortedDescending]=\"getText('sortedDescending')\"\n [sortedDefault]=\"getText('sortedDefault')\"\n [columnsApply]=\"getText('columnsApply')\"\n [columnsReset]=\"getText('columnsReset')\"\n >\n </kendo-treelist-messages>\n </kendo-treelist>\n </kendo-splitter-pane>\n <kendo-splitter-pane\n [collapsible]=\"timelinePaneOptions?.collapsible\"\n [resizable]=\"timelinePaneOptions?.resizable\"\n [collapsed]=\"timelinePaneOptions?.collapsed\"\n [min]=\"timelinePaneOptions?.min\"\n [max]=\"timelinePaneOptions?.max\"\n [size]=\"timelinePaneOptions?.size\"\n (collapsedChange)=\"onTimelineCollapsedChange($event)\"\n (sizeChange)=\"onTimelinePaneSizeChange($event)\"\n [scrollable]=\"false\">\n <kendo-gantt-timeline\n *ngIf=\"views && views.length\"\n [renderDependencyDragClues]=\"renderDependencyDragClues\"\n [dragScrollSettings]=\"dragScrollSettings\"\n [rows]=\"renderedTreeListItems\"\n [slots]=\"timelineSlots\"\n [groupSlots]=\"timelineGroupSlots\"\n [tableWidth]=\"tableWidth\"\n [activeView]=\"activeView\"\n [taskContentTemplate]=\"taskContentTemplate?.templateRef\"\n [taskTemplate]=\"taskTemplate?.templateRef\"\n [summaryTaskTemplate]=\"summaryTaskTemplate?.templateRef\"\n [taskClass]=\"taskClass\"\n [dependencies]=\"dependencies\"\n [hasChildren]=\"hasChildren\"\n [isTaskSelected]=\"isTaskSelected\"\n [kendoEventsOutsideAngular]=\"{\n click: handleTimelineClick,\n contextmenu: handleTimelineRightClick,\n dblclick: handleTimelineDblClick,\n mousedown: handleTimelineMouseDown\n }\"\n [scope]=\"this\"\n ></kendo-gantt-timeline>\n </kendo-splitter-pane>\n </kendo-splitter>\n </div>\n <kendo-gantt-toolbar\n *ngIf=\"showToolbar('bottom')\"\n [showAddTask]=\"toolbarSettings.addTaskTool === 'bottom' || toolbarSettings.addTaskTool === 'both'\"\n [showViewSelector]=\"toolbarSettings.viewSelectorTool === 'bottom' || toolbarSettings.viewSelectorTool === 'both'\"\n class=\"k-gantt-footer k-toolbar k-gantt-toolbar\"\n position=\"bottom\"></kendo-gantt-toolbar>\n <kendo-gantt-edit-dialog\n *ngIf=\"showEditingDialog\"\n [data]=\"data\">\n </kendo-gantt-edit-dialog>\n <kendo-dialog\n *ngIf=\"showConfirmationDialog\"\n [width]=\"575\"\n [height]=\"170\"\n [title]=\"getText('confirmationDialogTitle')\"\n (close)=\"showConfirmationDialog = false;\">\n <span>{{ getText('confirmationDialogContent') }}</span>\n <kendo-dialog-actions layout=\"normal\">\n <kendo-treelist-spacer></kendo-treelist-spacer>\n <button kendoButton [primary]=\"true\" (click)=\"handleDeleteConfirmation()\">{{ getText('deleteButtonText') }}</button>\n <button kendoButton (click)=\"showConfirmationDialog = false;\">{{ getText('cancelButtonText') }}</button>\n </kendo-dialog-actions>\n </kendo-dialog>\n "
4248
+ template: "\n <ng-container kendoGanttLocalizedMessages\n i18n-taskEditingGeneralTabTitle=\"kendo.gantt.taskEditingGeneralTabTitle|The title of the 'General' tab of the editing dialog TabStrip\"\n taskEditingGeneralTabTitle=\"General\"\n\n i18n-taskEditingPredecessorsTabTitle=\"kendo.gantt.taskEditingPredecessorsTabTitle|The title of the 'Predecessors' dependencies tab of the editing dialog TabStrip\"\n taskEditingPredecessorsTabTitle=\"Predecessors\"\n\n i18n-taskEditingSuccessorsTabTitle=\"kendo.gantt.taskEditingSuccessorsTabTitle|The title of the 'Successors' dependencies tab of the editing dialog TabStrip\"\n taskEditingSuccessorsTabTitle=\"Successors\"\n\n i18n-taskEditingDependenciesAddButtonText=\"kendo.gantt.taskEditingDependenciesAddButtonText|The text of the 'Add' button in the dependencies tabs of the editing dialog TabStrip\"\n taskEditingDependenciesAddButtonText=\"Add\"\n\n i18n-taskEditingDependenciesRemoveButtonText=\"kendo.gantt.taskEditingDependenciesRemoveButtonText|The text of the 'Remove' button in the dependencies tabs of the editing dialog TabStrip\"\n taskEditingDependenciesRemoveButtonText=\"Remove\"\n\n i18n-taskEditingDependenciesGridNameColumnTitle=\"kendo.gantt.taskEditingDependenciesGridNameColumnTitle|The title of the 'Task Title' Grid column in the dependencies tabs of the editing dialog TabStrip\"\n taskEditingDependenciesGridNameColumnTitle=\"Task Title\"\n\n i18n-taskEditingDependenciesGridTypeColumnTitle=\"kendo.gantt.taskEditingDependenciesGridTypeColumnTitle|The title of the 'Type' Grid column in the dependencies tabs of the editing dialog TabStrip\"\n taskEditingDependenciesGridTypeColumnTitle=\"Type\"\n\n i18n-taskDeleteLabel=\"kendo.gantt.taskDeleteLabel|The label of the task delete icon\"\n taskDeleteLabel=\"Delete\"\n\n i18n-taskEditingDialogTitle=\"kendo.gantt.taskEditingDialogTitle|The title of the task editing dialog\"\n taskEditingDialogTitle=\"Editing Task\"\n\n i18n-taskEditingDialogCloseTitle=\"kendo.gantt.taskEditingDialogCloseTitle|The title of the task editing dialog close button\"\n taskEditingDialogCloseTitle=\"Close\"\n\n i18n-confirmationDialogCloseTitle=\"kendo.gantt.confirmationDialogCloseTitle|The title of the confirmation dialog close button\"\n confirmationDialogCloseTitle=\"Close\"\n\n i18n-confirmationDialogTitle=\"kendo.gantt.confirmationDialogTitle|The title of the delete task confirmation dialog\"\n confirmationDialogTitle=\"Delete Task\"\n\n i18n-confirmationDialogContent=\"kendo.gantt.confirmationDialogContent|The content of the delete task confirmation dialog\"\n confirmationDialogContent=\"Are you sure you want to delete this task?\"\n\n i18n-deleteButtonText=\"kendo.gantt.deleteButtonText|The text of the task editing dialog 'Delete' button\"\n deleteButtonText=\"Delete\"\n\n i18n-cancelButtonText=\"kendo.gantt.cancelButtonText|The text of the task editing dialog 'Cancel' button\"\n cancelButtonText=\"Cancel\"\n\n i18n-saveButtonText=\"kendo.gantt.saveButtonText|The text of the task editing dialog 'Save' button\"\n saveButtonText=\"Save\"\n\n i18n-titleFieldInputLabel=\"kendo.gantt.titleFieldInputLabel|The label of the 'title' field input in editing mode\"\n titleFieldInputLabel=\"Title\"\n\n i18n-startFieldInputLabel=\"kendo.gantt.startFieldInputLabel|The label of the 'start' field input in editing mode\"\n startFieldInputLabel=\"Start\"\n\n i18n-endFieldInputLabel=\"kendo.gantt.endFieldInputLabel|The label of the 'end' field input in editing mode\"\n endFieldInputLabel=\"End\"\n\n i18n-completionRatioFieldInputLabel=\"kendo.gantt.completionRatioFieldInputLabel|The label of the 'completionRatio' field input in editing mode\"\n completionRatioFieldInputLabel=\"Progress\"\n\n i18n-dayViewText=\"kendo.gantt.dayViewText|The text of the day view in the ViewSelector component\"\n dayViewText=\"Day\"\n\n i18n-weekViewText=\"kendo.gantt.weekViewText|The text of the week view in the ViewSelector component\"\n weekViewText=\"Week\"\n\n i18n-monthViewText=\"kendo.gantt.monthViewText|The text of the month view in the ViewSelector component\"\n monthViewText=\"Month\"\n\n i18n-yearViewText-disabled=\"kendo.gantt.yearViewText|The text of the year view in the ViewSelector component\"\n yearViewText=\"Year\"\n\n i18n-addTaskText=\"kendo.gantt.addTaskText|The text of the DropDownButton in the AddTask component\"\n addTaskText=\"Add Task\"\n\n i18n-addChildText=\"kendo.gantt.addChildText|The text of the 'Add Child' option in the AddTask component\"\n addChildText=\"Add Child\"\n\n i18n-addAboveText=\"kendo.gantt.addAboveText|The text of the 'Add Above' option in the AddTask component\"\n addAboveText=\"Add Above\"\n\n i18n-addBelowText=\"kendo.gantt.addBelowText|The text of the 'Add Below' option in the AddTask component\"\n addBelowText=\"Add Below\"\n\n i18n-noRecords=\"kendo.gantt.noRecords|The label visible in the TreeList when there are no records\"\n noRecords=\"No records available.\"\n\n i18n-filter=\"kendo.gantt.filter|The label of the filter cell or icon\"\n filter=\"Filter\"\n\n i18n-filterEqOperator=\"kendo.gantt.filterEqOperator|The text of the equal filter operator\"\n filterEqOperator=\"Is equal to\"\n\n i18n-filterNotEqOperator=\"kendo.gantt.filterNotEqOperator|The text of the not equal filter operator\"\n filterNotEqOperator=\"Is not equal to\"\n\n i18n-filterIsNullOperator=\"kendo.gantt.filterIsNullOperator|The text of the is null filter operator\"\n filterIsNullOperator=\"Is null\"\n\n i18n-filterIsNotNullOperator=\"kendo.gantt.filterIsNotNullOperator|The text of the is not null filter operator\"\n filterIsNotNullOperator=\"Is not null\"\n\n i18n-filterIsEmptyOperator=\"kendo.gantt.filterIsEmptyOperator|The text of the is empty filter operator\"\n filterIsEmptyOperator=\"Is empty\"\n\n i18n-filterIsNotEmptyOperator=\"kendo.gantt.filterIsNotEmptyOperator|The text of the is not empty filter operator\"\n filterIsNotEmptyOperator=\"Is not empty\"\n\n i18n-filterStartsWithOperator=\"kendo.gantt.filterStartsWithOperator|The text of the starts with filter operator\"\n filterStartsWithOperator=\"Starts with\"\n\n i18n-filterContainsOperator=\"kendo.gantt.filterContainsOperator|The text of the contains filter operator\"\n filterContainsOperator=\"Contains\"\n\n i18n-filterNotContainsOperator=\"kendo.gantt.filterNotContainsOperator|The text of the does not contain filter operator\"\n filterNotContainsOperator=\"Does not contain\"\n\n i18n-filterEndsWithOperator=\"kendo.gantt.filterEndsWithOperator|The text of the ends with filter operator\"\n filterEndsWithOperator=\"Ends with\"\n\n i18n-filterGteOperator=\"kendo.gantt.filterGteOperator|The text of the greater than or equal filter operator\"\n filterGteOperator=\"Is greater than or equal to\"\n\n i18n-filterGtOperator=\"kendo.gantt.filterGtOperator|The text of the greater than filter operator\"\n filterGtOperator=\"Is greater than\"\n\n i18n-filterLteOperator=\"kendo.gantt.filterLteOperator|The text of the less than or equal filter operator\"\n filterLteOperator=\"Is less than or equal to\"\n\n i18n-filterLtOperator=\"kendo.gantt.filterLtOperator|The text of the less than filter operator\"\n filterLtOperator=\"Is less than\"\n\n i18n-filterIsTrue=\"kendo.gantt.filterIsTrue|The text of the IsTrue boolean filter option\"\n filterIsTrue=\"Is True\"\n\n i18n-filterIsFalse=\"kendo.gantt.filterIsFalse|The text of the IsFalse boolean filter option\"\n filterIsFalse=\"Is False\"\n\n i18n-filterBooleanAll=\"kendo.gantt.filterBooleanAll|The text of the (All) boolean filter option\"\n filterBooleanAll=\"(All)\"\n\n i18n-filterAfterOrEqualOperator=\"kendo.gantt.filterAfterOrEqualOperator|The text of the after or equal date filter operator\"\n filterAfterOrEqualOperator=\"Is after or equal to\"\n\n i18n-filterAfterOperator=\"kendo.gantt.filterAfterOperator|The text of the after date filter operator\"\n filterAfterOperator=\"Is after\"\n\n i18n-filterBeforeOperator=\"kendo.gantt.filterBeforeOperator|The text of the before date filter operator\"\n filterBeforeOperator=\"Is before\"\n\n i18n-filterBeforeOrEqualOperator=\"kendo.gantt.filterBeforeOrEqualOperator|The text of the before or equal date filter operator\"\n filterBeforeOrEqualOperator=\"Is before or equal to\"\n\n i18n-filterFilterButton=\"kendo.gantt.filterFilterButton|The text of the filter button\"\n filterFilterButton=\"Filter\"\n\n i18n-filterClearButton=\"kendo.gantt.filterClearButton|The text of the clear filter button\"\n filterClearButton=\"Clear\"\n\n i18n-filterAndLogic=\"kendo.gantt.filterAndLogic|The text of the And filter logic\"\n filterAndLogic=\"And\"\n\n i18n-filterOrLogic=\"kendo.gantt.filterOrLogic|The text of the Or filter logic\"\n filterOrLogic=\"Or\"\n\n i18n-loading=\"kendo.gantt.loading|The loading text\"\n loading=\"Loading\"\n\n i18n-columnMenu=\"kendo.gantt.columnMenu|The title of the column menu icon\"\n columnMenu=\"Column Menu\"\n\n i18n-columns=\"kendo.gantt.columns|The text shown in the column menu for the columns item\"\n columns=\"Columns\"\n\n i18n-lock-disabled=\"kendo.gantt.lock|The text shown in the column menu for the lock item\"\n lock-disabled=\"Lock\"\n\n i18n-unlock-disabled=\"kendo.gantt.unlock|The text shown in the column menu for the unlock item\"\n unlock-disabled=\"Unlock\"\n\n i18n-sortable=\"kendo.gantt.sortable|The label of the sort icon\"\n sortable=\"Sortable\"\n\n i18n-sortAscending=\"kendo.gantt.sortAscending|The text shown in the column menu for the sort ascending item\"\n sortAscending=\"Sort Ascending\"\n\n i18n-sortDescending=\"kendo.gantt.sortDescending|The text shown in the column menu for the sort descending item\"\n sortDescending=\"Sort Descending\"\n\n i18n-sortedAscending=\"kendo.gantt.sortedAscending|The status announcement when a column is sorted ascending\"\n sortedAscending=\"Sorted Ascending\"\n\n i18n-sortedDescending=\"kendo.gantt.sortedDescending|The status announcement when a column is sorted descending\"\n sortedDescending=\"Sorted Descending\"\n\n i18n-sortedDefault=\"kendo.gantt.sortedDefault|The status announcement when a column is no longer sorted\"\n sortedDefault=\"Not Sorted\"\n\n i18n-columnsApply=\"kendo.gantt.columnsApply|The text shown in the column menu or column chooser for the columns apply button\"\n columnsApply=\"Apply\"\n\n i18n-columnsReset=\"kendo.gantt.columnsReset|The text shown in the column menu or column chooser for the columns reset button\"\n columnsReset=\"Reset\"></ng-container>\n <kendo-gantt-toolbar\n *ngIf=\"showToolbar('top')\"\n [showAddTask]=\"toolbarSettings.addTaskTool === 'top' || toolbarSettings.addTaskTool === 'both'\"\n [showViewSelector]=\"toolbarSettings.viewSelectorTool === 'top' || toolbarSettings.viewSelectorTool === 'both'\"\n class=\"k-gantt-header k-toolbar k-gantt-toolbar\"\n position=\"top\"></kendo-gantt-toolbar>\n <div class=\"k-gantt-content\">\n <kendo-splitter [style.border]=\"0\">\n <kendo-splitter-pane\n class=\"k-gantt-treelist k-gantt-treelist-scrollable\"\n [collapsible]=\"treeListPaneOptions?.collapsible\"\n [collapsed]=\"treeListPaneOptions?.collapsed\"\n (collapsedChange)=\"onTreeListCollapsedChange($event)\"\n [scrollable]=\"false\">\n <kendo-treelist\n [idField]=\"taskIdField\"\n [columns]=\"columns\"\n [data]=\"data\"\n [hasChildren]=\"hasChildren\"\n [fetchChildren]=\"fetchChildren\"\n [navigable]=\"navigable\"\n [isExpanded]=\"isExpanded\"\n [autoSize]=\"columnsAutoSize\"\n [columnMenu]=\"columnMenu\"\n [reorderable]=\"columnsReorderable\"\n [resizable]=\"columnsResizable\"\n [rowClass]=\"rowClass\"\n [isSelected]=\"isSelected\"\n [selectable]=\"selectable\"\n [sortable]=\"sortable\"\n [sort]=\"sort\"\n [filterable]=\"filterMenu\"\n [filter]=\"filter\"\n (filterChange)=\"filterChange.emit($event)\"\n (sortChange)=\"sortChange.emit($event)\"\n (dataStateChange)=\"dataStateChange.emit({\n filter: $event.filter,\n sort: $event.sort\n })\"\n (expandStateChange)=\"expandStateChange.emit($event)\"\n (expand)=\"rowExpand.emit({ dataItem: $event.dataItem })\"\n (collapse)=\"rowCollapse.emit({ dataItem: $event.dataItem })\"\n (columnReorder)=\"columnReorder.emit($event)\"\n (columnResize)=\"columnResize.emit($event)\"\n (columnVisibilityChange)=\"handleColumnVisibilityChange($event)\"\n (columnLockedChange)=\"columnLockedChange.emit($event)\"\n (selectionChange)=\"handleTreeListSelectionChange($event)\"\n (cellClick)=\"handleTreeListCellClick($event)\"\n (cellClose)=\"handleCellClose($event)\"\n [kendoEventsOutsideAngular]=\"{\n dblclick: handleTreeListDoubleClick\n }\"\n [scope]=\"this\"\n >\n <kendo-treelist-messages\n [noRecords]=\"getText('noRecords')\"\n [filter]=\"getText('filter')\"\n [filterEqOperator]=\"getText('filterEqOperator')\"\n [filterNotEqOperator]=\"getText('filterNotEqOperator')\"\n [filterIsNullOperator]=\"getText('filterIsNullOperator')\"\n [filterIsNotNullOperator]=\"getText('filterIsNotNullOperator')\"\n [filterIsEmptyOperator]=\"getText('filterIsEmptyOperator')\"\n [filterIsNotEmptyOperator]=\"getText('filterIsNotEmptyOperator')\"\n [filterStartsWithOperator]=\"getText('filterStartsWithOperator')\"\n [filterContainsOperator]=\"getText('filterContainsOperator')\"\n [filterNotContainsOperator]=\"getText('filterNotContainsOperator')\"\n [filterEndsWithOperator]=\"getText('filterEndsWithOperator')\"\n [filterGteOperator]=\"getText('filterGteOperator')\"\n [filterGtOperator]=\"getText('filterGtOperator')\"\n [filterLteOperator]=\"getText('filterLteOperator')\"\n [filterLtOperator]=\"getText('filterLtOperator')\"\n [filterIsTrue]=\"getText('filterIsTrue')\"\n [filterIsFalse]=\"getText('filterIsFalse')\"\n [filterBooleanAll]=\"getText('filterBooleanAll')\"\n [filterAfterOrEqualOperator]=\"getText('filterAfterOrEqualOperator')\"\n [filterAfterOperator]=\"getText('filterAfterOperator')\"\n [filterBeforeOperator]=\"getText('filterBeforeOperator')\"\n [filterBeforeOrEqualOperator]=\"getText('filterBeforeOrEqualOperator')\"\n [filterFilterButton]=\"getText('filterFilterButton')\"\n [filterClearButton]=\"getText('filterClearButton')\"\n [filterAndLogic]=\"getText('filterAndLogic')\"\n [filterOrLogic]=\"getText('filterOrLogic')\"\n [loading]=\"getText('loading')\"\n [columnMenu]=\"getText('columnMenu')\"\n [columns]=\"getText('columns')\"\n [sortable]=\"getText('sortable')\"\n [sortAscending]=\"getText('sortAscending')\"\n [sortDescending]=\"getText('sortDescending')\"\n [sortedAscending]=\"getText('sortedAscending')\"\n [sortedDescending]=\"getText('sortedDescending')\"\n [sortedDefault]=\"getText('sortedDefault')\"\n [columnsApply]=\"getText('columnsApply')\"\n [columnsReset]=\"getText('columnsReset')\"\n >\n </kendo-treelist-messages>\n </kendo-treelist>\n </kendo-splitter-pane>\n <kendo-splitter-pane\n [collapsible]=\"timelinePaneOptions?.collapsible\"\n [resizable]=\"timelinePaneOptions?.resizable\"\n [collapsed]=\"timelinePaneOptions?.collapsed\"\n [min]=\"timelinePaneOptions?.min\"\n [max]=\"timelinePaneOptions?.max\"\n [size]=\"timelinePaneOptions?.size\"\n (collapsedChange)=\"onTimelineCollapsedChange($event)\"\n (sizeChange)=\"onTimelinePaneSizeChange($event)\"\n [scrollable]=\"false\">\n <kendo-gantt-timeline\n *ngIf=\"views && views.length\"\n [renderDependencyDragClues]=\"renderDependencyDragClues\"\n [dragScrollSettings]=\"dragScrollSettings\"\n [rows]=\"viewItems\"\n [slots]=\"timelineSlots\"\n [groupSlots]=\"timelineGroupSlots\"\n [tableWidth]=\"tableWidth\"\n [activeView]=\"activeView\"\n [taskContentTemplate]=\"taskContentTemplate?.templateRef\"\n [taskTemplate]=\"taskTemplate?.templateRef\"\n [summaryTaskTemplate]=\"summaryTaskTemplate?.templateRef\"\n [taskClass]=\"taskClass\"\n [dependencies]=\"dependencies\"\n [isExpanded]=\"isExpanded\"\n [selectable]=\"selectable\"\n [isTaskSelected]=\"isTaskSelected\"\n [kendoEventsOutsideAngular]=\"{\n click: handleTimelineClick,\n contextmenu: handleTimelineRightClick,\n dblclick: handleTimelineDblClick,\n mousedown: handleTimelineMouseDown\n }\"\n [scope]=\"this\"\n ></kendo-gantt-timeline>\n </kendo-splitter-pane>\n </kendo-splitter>\n </div>\n <kendo-gantt-toolbar\n *ngIf=\"showToolbar('bottom')\"\n [showAddTask]=\"toolbarSettings.addTaskTool === 'bottom' || toolbarSettings.addTaskTool === 'both'\"\n [showViewSelector]=\"toolbarSettings.viewSelectorTool === 'bottom' || toolbarSettings.viewSelectorTool === 'both'\"\n class=\"k-gantt-footer k-toolbar k-gantt-toolbar\"\n position=\"bottom\"></kendo-gantt-toolbar>\n <kendo-gantt-edit-dialog\n *ngIf=\"showEditingDialog\"\n [data]=\"data\">\n </kendo-gantt-edit-dialog>\n <kendo-dialog\n *ngIf=\"showConfirmationDialog\"\n [width]=\"575\"\n [height]=\"170\"\n [title]=\"getText('confirmationDialogTitle')\"\n (close)=\"handleConfirmationDialogClose()\">\n <span>{{ getText('confirmationDialogContent') }}</span>\n <kendo-dialog-actions layout=\"normal\">\n <kendo-treelist-spacer></kendo-treelist-spacer>\n <button kendoButton [primary]=\"true\" (click)=\"handleDeleteConfirmation()\">{{ getText('deleteButtonText') }}</button>\n <button kendoButton (click)=\"handleConfirmationDialogClose()\">{{ getText('cancelButtonText') }}</button>\n </kendo-dialog-actions>\n </kendo-dialog>\n "
3616
4249
  }),
3617
4250
  __metadata("design:paramtypes", [TimelineViewService,
3618
4251
  ScrollSyncService,
@@ -3623,7 +4256,8 @@ var GanttComponent = /** @class */ (function () {
3623
4256
  EditService,
3624
4257
  LocalizationService,
3625
4258
  ElementRef,
3626
- NgZone])
4259
+ NgZone,
4260
+ NavigationService])
3627
4261
  ], GanttComponent);
3628
4262
  return GanttComponent;
3629
4263
  }());
@@ -3652,14 +4286,18 @@ var GanttTasksTableBodyComponent = /** @class */ (function () {
3652
4286
  enumerable: true,
3653
4287
  configurable: true
3654
4288
  });
3655
- GanttTasksTableBodyComponent.prototype.isMileStone = function (task) {
3656
- return !this.hasChildren(task) && isEqual(this.mapper.extractFromTask(task, 'start'), this.mapper.extractFromTask(task, 'end'));
4289
+ GanttTasksTableBodyComponent.prototype.isMileStone = function (item) {
4290
+ return !item.hasChildren && isEqual(this.mapper.extractFromTask(item.data, 'start'), this.mapper.extractFromTask(item.data, 'end'));
3657
4291
  };
3658
4292
  __decorate([
3659
4293
  ViewChild('timelineRow', { static: false }),
3660
4294
  __metadata("design:type", ElementRef),
3661
4295
  __metadata("design:paramtypes", [ElementRef])
3662
4296
  ], GanttTasksTableBodyComponent.prototype, "timelineRow", null);
4297
+ __decorate([
4298
+ Input(),
4299
+ __metadata("design:type", Boolean)
4300
+ ], GanttTasksTableBodyComponent.prototype, "selectable", void 0);
3663
4301
  __decorate([
3664
4302
  Input(),
3665
4303
  __metadata("design:type", Array)
@@ -3687,7 +4325,7 @@ var GanttTasksTableBodyComponent = /** @class */ (function () {
3687
4325
  __decorate([
3688
4326
  Input(),
3689
4327
  __metadata("design:type", Function)
3690
- ], GanttTasksTableBodyComponent.prototype, "hasChildren", void 0);
4328
+ ], GanttTasksTableBodyComponent.prototype, "isExpanded", void 0);
3691
4329
  __decorate([
3692
4330
  Input(),
3693
4331
  __metadata("design:type", Function)
@@ -3699,7 +4337,7 @@ var GanttTasksTableBodyComponent = /** @class */ (function () {
3699
4337
  GanttTasksTableBodyComponent = __decorate([
3700
4338
  Component({
3701
4339
  selector: '[kendoGanttTasksTableBody]',
3702
- template: "\n <tr #timelineRow *ngFor=\"let item of rows; let index = index\">\n <td>\n <kendo-gantt-milestone-task\n *ngIf=\"isMileStone(item); else task\"\n [dataItem]=\"item\"\n [activeView]=\"activeView\"\n [taskClass]=\"taskClass\"\n [isSelected]=\"isTaskSelected\"\n [attr.data-task-index]=\"index\"\n [renderDependencyDragClues]=\"renderDependencyDragClues\"\n >\n </kendo-gantt-milestone-task>\n <ng-template #task>\n <kendo-gantt-summary-task\n *ngIf=\"hasChildren(item)\"\n [dataItem]=\"item\"\n [template]=\"summaryTaskTemplate\"\n [activeView]=\"activeView\"\n [taskClass]=\"taskClass\"\n [isSelected]=\"isTaskSelected\"\n [attr.data-task-index]=\"index\"\n [renderDependencyDragClues]=\"renderDependencyDragClues\"\n >\n </kendo-gantt-summary-task>\n <kendo-gantt-task\n *ngIf=\"!hasChildren(item)\"\n [dataItem]=\"item\"\n [taskContentTemplate]=\"taskContentTemplate\"\n [taskTemplate]=\"taskTemplate\"\n [activeView]=\"activeView\"\n [taskClass]=\"taskClass\"\n [isSelected]=\"isTaskSelected\"\n [attr.data-task-index]=\"index\"\n [renderDependencyDragClues]=\"renderDependencyDragClues\"\n >\n </kendo-gantt-task>\n </ng-template>\n </td>\n </tr>\n "
4340
+ template: "\n <tr #timelineRow *ngFor=\"let item of rows; let index = index\">\n <td>\n <kendo-gantt-milestone-task\n *ngIf=\"isMileStone(item); else task\"\n [dataItem]=\"item.data\"\n [level]=\"item.level\"\n [activeView]=\"activeView\"\n [taskClass]=\"taskClass\"\n [selectable]=\"selectable\"\n [isSelected]=\"isTaskSelected\"\n [index]=\"index\"\n [renderDependencyDragClues]=\"renderDependencyDragClues\"\n >\n </kendo-gantt-milestone-task>\n <ng-template #task>\n <kendo-gantt-summary-task\n *ngIf=\"item.hasChildren\"\n [dataItem]=\"item.data\"\n [level]=\"item.level\"\n [template]=\"summaryTaskTemplate\"\n [activeView]=\"activeView\"\n [taskClass]=\"taskClass\"\n [selectable]=\"selectable\"\n [isSelected]=\"isTaskSelected\"\n [isExpanded]=\"isExpanded\"\n [index]=\"index\"\n [renderDependencyDragClues]=\"renderDependencyDragClues\"\n >\n </kendo-gantt-summary-task>\n <kendo-gantt-task\n *ngIf=\"!item.hasChildren\"\n [dataItem]=\"item.data\"\n [level]=\"item.level\"\n [taskContentTemplate]=\"taskContentTemplate\"\n [taskTemplate]=\"taskTemplate\"\n [activeView]=\"activeView\"\n [taskClass]=\"taskClass\"\n [selectable]=\"selectable\"\n [isSelected]=\"isTaskSelected\"\n [index]=\"index\"\n [renderDependencyDragClues]=\"renderDependencyDragClues\"\n >\n </kendo-gantt-task>\n </ng-template>\n </td>\n </tr>\n "
3703
4341
  }),
3704
4342
  __metadata("design:paramtypes", [DependencyDomService,
3705
4343
  MappingService])
@@ -3735,24 +4373,42 @@ var slotUnitDuration = {
3735
4373
  week: MS_PER_DAY,
3736
4374
  month: MS_PER_DAY * 7
3737
4375
  };
4376
+ var FOCUSED_CLASS = 'k-focus';
3738
4377
  /**
3739
4378
  * @hidden
3740
4379
  */
3741
4380
  var GanttTaskBase = /** @class */ (function () {
3742
4381
  function GanttTaskBase(mapper, // left public to be available for usage in the templates
3743
- timelineViewService, dependencyDomService, optionChangesService, cdr) {
4382
+ timelineViewService, dependencyDomService, optionChangesService, cdr, navigationService) {
3744
4383
  var _this = this;
3745
4384
  this.mapper = mapper;
3746
4385
  this.timelineViewService = timelineViewService;
3747
4386
  this.dependencyDomService = dependencyDomService;
3748
4387
  this.optionChangesService = optionChangesService;
3749
4388
  this.cdr = cdr;
4389
+ this.navigationService = navigationService;
3750
4390
  this.wrapperClass = true;
3751
- this.viewChangesSubscription = new Subscription();
3752
- this.viewChangesSubscription.add(this.optionChangesService.viewChanges.subscribe(function () {
3753
- _this.cdr.markForCheck();
3754
- }));
4391
+ this.subscriptions = new Subscription();
4392
+ this.subscriptions.add(this.optionChangesService.viewChanges
4393
+ .subscribe(function () { return _this.cdr.markForCheck(); }));
4394
+ this.subscriptions.add(this.navigationService.taskStatusChanges
4395
+ .subscribe(this.updateActiveState.bind(this)));
3755
4396
  }
4397
+ Object.defineProperty(GanttTaskBase.prototype, "taskIndexAttribute", {
4398
+ get: function () {
4399
+ return this.index;
4400
+ },
4401
+ enumerable: true,
4402
+ configurable: true
4403
+ });
4404
+ Object.defineProperty(GanttTaskBase.prototype, "ariaSelected", {
4405
+ get: function () {
4406
+ // assinging null will not render the attribute at all (desired in selectable="false" mode)
4407
+ return this.selectable ? String(this.isSelected(this.dataItem)) : null;
4408
+ },
4409
+ enumerable: true,
4410
+ configurable: true
4411
+ });
3756
4412
  Object.defineProperty(GanttTaskBase.prototype, "slotUnitDuration", {
3757
4413
  get: function () {
3758
4414
  return slotUnitDuration[this.activeView];
@@ -3819,17 +4475,38 @@ var GanttTaskBase = /** @class */ (function () {
3819
4475
  else if (isPresent(changes.activeView)) {
3820
4476
  this.dependencyDomService.notifyChanges();
3821
4477
  }
4478
+ if (this.navigationService.enabled && isPresent(changes.index)) {
4479
+ this.updateActiveState(this.navigationService.activeTask);
4480
+ }
3822
4481
  };
3823
4482
  GanttTaskBase.prototype.ngOnDestroy = function () {
3824
4483
  if (isPresent(this.dataItem)) {
3825
4484
  this.dependencyDomService.unregisterTask(this.dataItem);
3826
4485
  }
3827
- this.viewChangesSubscription.unsubscribe();
4486
+ this.subscriptions.unsubscribe();
4487
+ };
4488
+ GanttTaskBase.prototype.updateActiveState = function (_a) {
4489
+ var activeIndex = _a.activeIndex, isFocused = _a.isFocused;
4490
+ var isActive = activeIndex === this.index;
4491
+ var tabindex = isActive ? '0' : '-1';
4492
+ this.taskElement.nativeElement.setAttribute('tabindex', tabindex);
4493
+ if (isActive && isFocused) {
4494
+ this.taskElement.nativeElement.focus();
4495
+ this.taskElement.nativeElement.classList.add(FOCUSED_CLASS);
4496
+ }
4497
+ else {
4498
+ this.taskElement.nativeElement.classList.remove(FOCUSED_CLASS);
4499
+ }
3828
4500
  };
3829
4501
  __decorate([
3830
4502
  HostBinding('class.k-task-wrap'),
3831
4503
  __metadata("design:type", Boolean)
3832
4504
  ], GanttTaskBase.prototype, "wrapperClass", void 0);
4505
+ __decorate([
4506
+ HostBinding('attr.data-task-index'),
4507
+ __metadata("design:type", Number),
4508
+ __metadata("design:paramtypes", [])
4509
+ ], GanttTaskBase.prototype, "taskIndexAttribute", null);
3833
4510
  __decorate([
3834
4511
  ViewChild('task', { static: true }),
3835
4512
  __metadata("design:type", ElementRef)
@@ -3838,10 +4515,22 @@ var GanttTaskBase = /** @class */ (function () {
3838
4515
  Input(),
3839
4516
  __metadata("design:type", Object)
3840
4517
  ], GanttTaskBase.prototype, "dataItem", void 0);
4518
+ __decorate([
4519
+ Input(),
4520
+ __metadata("design:type", Number)
4521
+ ], GanttTaskBase.prototype, "index", void 0);
4522
+ __decorate([
4523
+ Input(),
4524
+ __metadata("design:type", Number)
4525
+ ], GanttTaskBase.prototype, "level", void 0);
3841
4526
  __decorate([
3842
4527
  Input(),
3843
4528
  __metadata("design:type", Boolean)
3844
4529
  ], GanttTaskBase.prototype, "renderDependencyDragClues", void 0);
4530
+ __decorate([
4531
+ Input(),
4532
+ __metadata("design:type", Boolean)
4533
+ ], GanttTaskBase.prototype, "selectable", void 0);
3845
4534
  __decorate([
3846
4535
  Input(),
3847
4536
  __metadata("design:type", Function)
@@ -3867,8 +4556,8 @@ var GanttTaskBase = /** @class */ (function () {
3867
4556
  */
3868
4557
  var GanttTaskComponent = /** @class */ (function (_super) {
3869
4558
  __extends(GanttTaskComponent, _super);
3870
- function GanttTaskComponent(editService, touchEnabled$$1, mapper, timelineViewService, dependencyDomService, optionChangesService, cdr) {
3871
- var _this = _super.call(this, mapper, timelineViewService, dependencyDomService, optionChangesService, cdr) || this;
4559
+ function GanttTaskComponent(editService, touchEnabled$$1, mapper, timelineViewService, dependencyDomService, optionChangesService, cdr, navigationService) {
4560
+ var _this = _super.call(this, mapper, timelineViewService, dependencyDomService, optionChangesService, cdr, navigationService) || this;
3872
4561
  _this.editService = editService;
3873
4562
  _this.touchEnabled = touchEnabled$$1;
3874
4563
  return _this;
@@ -3876,7 +4565,7 @@ var GanttTaskComponent = /** @class */ (function (_super) {
3876
4565
  GanttTaskComponent_1 = GanttTaskComponent;
3877
4566
  GanttTaskComponent.prototype.onTaskDelete = function () {
3878
4567
  this.editService.dataItem = this.dataItem;
3879
- this.editService.showConfirmationDialog.next();
4568
+ this.editService.taskDelete.next(this.dataItem);
3880
4569
  };
3881
4570
  var GanttTaskComponent_1;
3882
4571
  __decorate([
@@ -3896,14 +4585,16 @@ var GanttTaskComponent = /** @class */ (function (_super) {
3896
4585
  useExisting: forwardRef(function () { return GanttTaskComponent_1; })
3897
4586
  }
3898
4587
  ],
3899
- template: "\n <div\n #task\n class=\"k-task k-task-single\"\n [ngClass]=\"taskClass(dataItem)\"\n [style.width.px]=\"taskWidth\"\n [attr.title]=\"mapper.extractFromTask(dataItem, 'title')\"\n [class.k-state-selected]=\"isSelected(dataItem)\"\n >\n <ng-container *ngIf=\"!taskTemplate\">\n <div\n class=\"k-task-complete\"\n [style.width.px]=\"completionOverlayWidth\"\n >\n </div>\n <div class=\"k-task-content\">\n <div class=\"k-task-template\">\n <ng-container *ngIf=\"!taskContentTemplate; else taskContent\">\n {{ mapper.extractFromTask(dataItem, 'title') }}\n </ng-container>\n <ng-template\n #taskContent\n [ngTemplateOutlet]=\"taskContentTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: dataItem }\"\n >\n </ng-template>\n </div>\n <span class=\"k-task-actions\">\n <span\n (click)=\"onTaskDelete()\"\n class=\"k-link k-task-delete\">\n <span class=\"k-icon k-i-close\"></span>\n </span>\n </span>\n </div>\n </ng-container>\n <ng-template\n *ngIf=\"taskTemplate\"\n [ngTemplateOutlet]=\"taskTemplate\"\n [ngTemplateOutletContext]=\"{\n $implicit: dataItem,\n elementWidth: taskWidth\n }\"\n >\n </ng-template>\n </div>\n <ng-container *ngIf=\"renderDependencyDragClues\">\n <div\n class=\"k-task-dot k-task-start k-touch-action-none\"\n [class.k-display-block]=\"touchEnabled\"\n >\n </div>\n <div\n class=\"k-task-dot k-task-end k-touch-action-none\"\n [class.k-display-block]=\"touchEnabled\"\n >\n </div>\n </ng-container>\n "
4588
+ template: "\n <div\n #task\n class=\"k-task k-task-single\"\n role=\"treeitem\"\n [ngClass]=\"taskClass(dataItem)\"\n [style.width.px]=\"taskWidth\"\n [attr.title]=\"mapper.extractFromTask(dataItem, 'title')\"\n [class.k-state-selected]=\"isSelected(dataItem)\"\n [attr.aria-selected]=\"ariaSelected\"\n [attr.aria-level]=\"level + 1\"\n >\n <ng-container *ngIf=\"!taskTemplate\">\n <div\n class=\"k-task-complete\"\n [style.width.px]=\"completionOverlayWidth\"\n aria-hidden=\"true\"\n >\n </div>\n <div class=\"k-task-content\">\n <div class=\"k-task-template\">\n <ng-container *ngIf=\"!taskContentTemplate; else taskContent\">\n {{ mapper.extractFromTask(dataItem, 'title') }}\n </ng-container>\n <ng-template\n #taskContent\n [ngTemplateOutlet]=\"taskContentTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: dataItem }\"\n >\n </ng-template>\n </div>\n <span\n class=\"k-task-actions\"\n aria-hidden=\"true\"\n >\n <span\n class=\"k-link k-task-delete\"\n [kendoEventsOutsideAngular]=\"{\n click: onTaskDelete\n }\"\n [scope]=\"this\"\n >\n <span class=\"k-icon k-i-close\"></span>\n </span>\n </span>\n </div>\n </ng-container>\n <ng-template\n *ngIf=\"taskTemplate\"\n [ngTemplateOutlet]=\"taskTemplate\"\n [ngTemplateOutletContext]=\"{\n $implicit: dataItem,\n elementWidth: taskWidth\n }\"\n >\n </ng-template>\n </div>\n <ng-container *ngIf=\"renderDependencyDragClues\">\n <div\n class=\"k-task-dot k-task-start k-touch-action-none\"\n [class.k-display-block]=\"touchEnabled\"\n >\n </div>\n <div\n class=\"k-task-dot k-task-end k-touch-action-none\"\n [class.k-display-block]=\"touchEnabled\"\n >\n </div>\n </ng-container>\n ",
4589
+ styles: ["\n .k-task.k-focus {\n box-shadow: 0 0 4px 3px grey;\n outline: none;\n }\n .k-task.k-focus.k-state-selected {\n box-shadow: 0 0 4px 3px #ffaea8;\n }\n "]
3900
4590
  }),
3901
4591
  __param(1, Inject(TOUCH_ENABLED)),
3902
4592
  __metadata("design:paramtypes", [EditService, Boolean, MappingService,
3903
4593
  TimelineViewService,
3904
4594
  DependencyDomService,
3905
4595
  OptionChangesService,
3906
- ChangeDetectorRef])
4596
+ ChangeDetectorRef,
4597
+ NavigationService])
3907
4598
  ], GanttTaskComponent);
3908
4599
  return GanttTaskComponent;
3909
4600
  }(GanttTaskBase));
@@ -3913,13 +4604,23 @@ var GanttTaskComponent = /** @class */ (function (_super) {
3913
4604
  */
3914
4605
  var GanttSummaryTaskComponent = /** @class */ (function (_super) {
3915
4606
  __extends(GanttSummaryTaskComponent, _super);
3916
- function GanttSummaryTaskComponent(touchEnabled$$1, mapper, timelineViewService, dependencyDomService, optionChangesService, cdr) {
3917
- var _this = _super.call(this, mapper, timelineViewService, dependencyDomService, optionChangesService, cdr) || this;
4607
+ function GanttSummaryTaskComponent(touchEnabled$$1, mapper, timelineViewService, dependencyDomService, optionChangesService, cdr, navigationService) {
4608
+ var _this = _super.call(this, mapper, timelineViewService, dependencyDomService, optionChangesService, cdr, navigationService) || this;
3918
4609
  _this.touchEnabled = touchEnabled$$1;
3919
4610
  _this.summaryWrapperClass = true;
3920
4611
  return _this;
3921
4612
  }
3922
4613
  GanttSummaryTaskComponent_1 = GanttSummaryTaskComponent;
4614
+ Object.defineProperty(GanttSummaryTaskComponent.prototype, "ariaExpanded", {
4615
+ get: function () {
4616
+ // if no callback is provided, all child items are displayed and the item is regarded as expanded
4617
+ // replicates the TreeList aria-expanded behavior
4618
+ var isExpanded = !isPresent(this.isExpanded) || this.isExpanded(this.dataItem);
4619
+ return String(isExpanded);
4620
+ },
4621
+ enumerable: true,
4622
+ configurable: true
4623
+ });
3923
4624
  var GanttSummaryTaskComponent_1;
3924
4625
  __decorate([
3925
4626
  HostBinding('class.k-summary-wrap'),
@@ -3929,6 +4630,10 @@ var GanttSummaryTaskComponent = /** @class */ (function (_super) {
3929
4630
  Input(),
3930
4631
  __metadata("design:type", TemplateRef)
3931
4632
  ], GanttSummaryTaskComponent.prototype, "template", void 0);
4633
+ __decorate([
4634
+ Input(),
4635
+ __metadata("design:type", Function)
4636
+ ], GanttSummaryTaskComponent.prototype, "isExpanded", void 0);
3932
4637
  GanttSummaryTaskComponent = GanttSummaryTaskComponent_1 = __decorate([
3933
4638
  Component({
3934
4639
  selector: 'kendo-gantt-summary-task',
@@ -3938,14 +4643,16 @@ var GanttSummaryTaskComponent = /** @class */ (function (_super) {
3938
4643
  useExisting: forwardRef(function () { return GanttSummaryTaskComponent_1; })
3939
4644
  }
3940
4645
  ],
3941
- template: "\n <div\n #task\n class=\"k-task k-task-summary\"\n [ngClass]=\"taskClass(dataItem)\"\n [style.width.px]=\"taskWidth\"\n [attr.title]=\"mapper.extractFromTask(dataItem, 'title')\"\n [class.k-state-selected]=\"isSelected(dataItem)\"\n >\n <div *ngIf=\"!template; else summaryTemplate\"\n class=\"k-task-summary-progress\"\n [style.width.px]=\"taskWidth\">\n <div\n class=\"k-task-summary-complete\"\n [style.width.px]=\"completionOverlayWidth\"\n >\n </div>\n </div>\n <ng-template\n #summaryTemplate\n [ngTemplateOutlet]=\"template\"\n [ngTemplateOutletContext]=\"{\n $implicit: dataItem,\n elementWidth: taskWidth\n }\"\n >\n </ng-template>\n </div>\n <ng-container *ngIf=\"renderDependencyDragClues\">\n <div\n class=\"k-task-dot k-task-start k-touch-action-none\"\n [class.k-display-block]=\"touchEnabled\"\n >\n </div>\n <div\n class=\"k-task-dot k-task-end k-touch-action-none\"\n [class.k-display-block]=\"touchEnabled\"\n >\n </div>\n </ng-container>\n "
4646
+ template: "\n <div\n #task\n role=\"treeitem\"\n class=\"k-task k-task-summary\"\n [ngClass]=\"taskClass(dataItem)\"\n [style.width.px]=\"taskWidth\"\n [attr.title]=\"mapper.extractFromTask(dataItem, 'title')\"\n [class.k-state-selected]=\"isSelected(dataItem)\"\n [attr.aria-selected]=\"ariaSelected\"\n [attr.aria-expanded]=\"ariaExpanded\"\n [attr.aria-level]=\"level + 1\"\n >\n <div *ngIf=\"!template; else summaryTemplate\"\n class=\"k-task-summary-progress\"\n [style.width.px]=\"taskWidth\">\n <div\n class=\"k-task-summary-complete\"\n [style.width.px]=\"completionOverlayWidth\"\n >\n </div>\n </div>\n <ng-template\n #summaryTemplate\n [ngTemplateOutlet]=\"template\"\n [ngTemplateOutletContext]=\"{\n $implicit: dataItem,\n elementWidth: taskWidth\n }\"\n >\n </ng-template>\n </div>\n <ng-container *ngIf=\"renderDependencyDragClues\">\n <div\n class=\"k-task-dot k-task-start k-touch-action-none\"\n [class.k-display-block]=\"touchEnabled\"\n >\n </div>\n <div\n class=\"k-task-dot k-task-end k-touch-action-none\"\n [class.k-display-block]=\"touchEnabled\"\n >\n </div>\n </ng-container>\n ",
4647
+ styles: ["\n .k-task.k-focus {\n box-shadow: 0 0 4px 3px grey;\n outline: none;\n }\n .k-task.k-focus.k-state-selected {\n box-shadow: 0 0 4px 3px #ffaea8;\n }\n "]
3942
4648
  }),
3943
4649
  __param(0, Inject(TOUCH_ENABLED)),
3944
4650
  __metadata("design:paramtypes", [Boolean, MappingService,
3945
4651
  TimelineViewService,
3946
4652
  DependencyDomService,
3947
4653
  OptionChangesService,
3948
- ChangeDetectorRef])
4654
+ ChangeDetectorRef,
4655
+ NavigationService])
3949
4656
  ], GanttSummaryTaskComponent);
3950
4657
  return GanttSummaryTaskComponent;
3951
4658
  }(GanttTaskBase));
@@ -3955,8 +4662,8 @@ var GanttSummaryTaskComponent = /** @class */ (function (_super) {
3955
4662
  */
3956
4663
  var GanttMilestoneTaskComponent = /** @class */ (function (_super) {
3957
4664
  __extends(GanttMilestoneTaskComponent, _super);
3958
- function GanttMilestoneTaskComponent(touchEnabled$$1, mapper, timelineViewService, dependencyDomService, optionChangesService, cdr) {
3959
- var _this = _super.call(this, mapper, timelineViewService, dependencyDomService, optionChangesService, cdr) || this;
4665
+ function GanttMilestoneTaskComponent(touchEnabled$$1, mapper, timelineViewService, dependencyDomService, optionChangesService, cdr, navigationService) {
4666
+ var _this = _super.call(this, mapper, timelineViewService, dependencyDomService, optionChangesService, cdr, navigationService) || this;
3960
4667
  _this.touchEnabled = touchEnabled$$1;
3961
4668
  _this.milestoneWrapperClass = true;
3962
4669
  return _this;
@@ -3976,14 +4683,16 @@ var GanttMilestoneTaskComponent = /** @class */ (function (_super) {
3976
4683
  useExisting: forwardRef(function () { return GanttMilestoneTaskComponent_1; })
3977
4684
  }
3978
4685
  ],
3979
- template: "\n <div\n #task\n class=\"k-task k-task-milestone\"\n [ngClass]=\"taskClass(dataItem)\"\n [attr.title]=\"mapper.extractFromTask(dataItem, 'title')\"\n [class.k-state-selected]=\"isSelected(dataItem)\"\n >\n </div>\n <ng-container *ngIf=\"renderDependencyDragClues\">\n <div\n class=\"k-task-dot k-task-start k-touch-action-none\"\n [class.k-display-block]=\"touchEnabled\"\n >\n </div>\n <div\n class=\"k-task-dot k-task-end k-touch-action-none\"\n [class.k-display-block]=\"touchEnabled\"\n >\n </div>\n </ng-container>\n "
4686
+ template: "\n <div\n #task\n role=\"treeitem\"\n class=\"k-task k-task-milestone\"\n [ngClass]=\"taskClass(dataItem)\"\n [attr.title]=\"mapper.extractFromTask(dataItem, 'title')\"\n [class.k-state-selected]=\"isSelected(dataItem)\"\n [attr.aria-selected]=\"ariaSelected\"\n [attr.aria-level]=\"level + 1\"\n >\n </div>\n <ng-container *ngIf=\"renderDependencyDragClues\">\n <div\n class=\"k-task-dot k-task-start k-touch-action-none\"\n [class.k-display-block]=\"touchEnabled\"\n >\n </div>\n <div\n class=\"k-task-dot k-task-end k-touch-action-none\"\n [class.k-display-block]=\"touchEnabled\"\n >\n </div>\n </ng-container>\n ",
4687
+ styles: ["\n .k-task.k-focus {\n box-shadow: 0 0 4px 3px grey;\n outline: none;\n }\n .k-task.k-focus.k-state-selected {\n box-shadow: 0 0 4px 3px #ffaea8;\n }\n "]
3980
4688
  }),
3981
4689
  __param(0, Inject(TOUCH_ENABLED)),
3982
4690
  __metadata("design:paramtypes", [Boolean, MappingService,
3983
4691
  TimelineViewService,
3984
4692
  DependencyDomService,
3985
4693
  OptionChangesService,
3986
- ChangeDetectorRef])
4694
+ ChangeDetectorRef,
4695
+ NavigationService])
3987
4696
  ], GanttMilestoneTaskComponent);
3988
4697
  return GanttMilestoneTaskComponent;
3989
4698
  }(GanttTaskBase));
@@ -4201,10 +4910,10 @@ var SelectableDirective = /** @class */ (function () {
4201
4910
  * @hidden
4202
4911
  */
4203
4912
  var ToolbarComponent = /** @class */ (function () {
4204
- function ToolbarComponent(gantt, scrollSyncService) {
4913
+ function ToolbarComponent(gantt) {
4205
4914
  this.gantt = gantt;
4206
- this.scrollSyncService = scrollSyncService;
4207
4915
  this.context = {};
4916
+ this.role = 'toolbar';
4208
4917
  }
4209
4918
  Object.defineProperty(ToolbarComponent.prototype, "position", {
4210
4919
  get: function () {
@@ -4232,12 +4941,13 @@ var ToolbarComponent = /** @class */ (function () {
4232
4941
  enumerable: true,
4233
4942
  configurable: true
4234
4943
  });
4235
- ToolbarComponent.prototype.onViewChange = function (e) {
4236
- this.gantt.activeView = e; // TODO: may be load the timeline data directly in an activeView setter?
4237
- this.gantt.loadTimelineData();
4238
- this.gantt.activeViewChange.emit(e);
4239
- this.scrollSyncService.resetTimelineScrollLeft();
4944
+ ToolbarComponent.prototype.handleViewChange = function (view) {
4945
+ this.gantt.changeActiveView(view);
4240
4946
  };
4947
+ __decorate([
4948
+ HostBinding('attr.role'),
4949
+ __metadata("design:type", String)
4950
+ ], ToolbarComponent.prototype, "role", void 0);
4241
4951
  __decorate([
4242
4952
  Input(),
4243
4953
  __metadata("design:type", Boolean)
@@ -4254,10 +4964,9 @@ var ToolbarComponent = /** @class */ (function () {
4254
4964
  ToolbarComponent = __decorate([
4255
4965
  Component({
4256
4966
  selector: 'kendo-gantt-toolbar',
4257
- template: "\n <ng-container *ngIf=\"!renderTemplate\">\n <kendo-gantt-add-task *ngIf=\"showAddTask\"></kendo-gantt-add-task>\n <span class=\"k-spacer k-toolbar-spacer\"></span>\n <kendo-gantt-view-selector\n *ngIf=\"showViewSelector\"\n [views]=\"gantt.viewTypes\"\n [activeView]=\"gantt.activeView\"\n (activeViewChange)=\"onViewChange($event)\"></kendo-gantt-view-selector>\n </ng-container>\n <ng-template\n *ngIf=\"renderTemplate\"\n [ngTemplateOutlet]=\"toolbarTemplateRef\"\n [ngTemplateOutletContext]=\"context\"\n >\n </ng-template>\n "
4967
+ template: "\n <ng-container *ngIf=\"!renderTemplate\">\n <kendo-gantt-add-task *ngIf=\"showAddTask\"></kendo-gantt-add-task>\n <span class=\"k-spacer k-toolbar-spacer\"></span>\n <kendo-gantt-view-selector\n *ngIf=\"showViewSelector\"\n [views]=\"gantt.viewTypes\"\n [activeView]=\"gantt.activeView\"\n (activeViewChange)=\"handleViewChange($event)\"></kendo-gantt-view-selector>\n </ng-container>\n <ng-template\n *ngIf=\"renderTemplate\"\n [ngTemplateOutlet]=\"toolbarTemplateRef\"\n [ngTemplateOutletContext]=\"context\"\n >\n </ng-template>\n "
4258
4968
  }),
4259
- __metadata("design:paramtypes", [GanttComponent,
4260
- ScrollSyncService])
4969
+ __metadata("design:paramtypes", [GanttComponent])
4261
4970
  ], ToolbarComponent);
4262
4971
  return ToolbarComponent;
4263
4972
  }());
@@ -4312,7 +5021,7 @@ var ViewSelectorComponent = /** @class */ (function () {
4312
5021
  ViewSelectorComponent = __decorate([
4313
5022
  Component({
4314
5023
  selector: 'kendo-gantt-view-selector',
4315
- template: "\n <select class=\"k-dropdown k-views-dropdown\"\n [value]=\"activeView\"\n (change)=\"activeViewChange.emit($event.target.value)\">\n <option *ngFor=\"let view of views\" [value]=\"view\">{{getViewTypeText(view)}}</option>\n </select>\n <kendo-buttongroup class=\"k-gantt-views\" selection=\"single\">\n <button *ngFor=\"let view of views\"\n kendoButton\n type=\"button\"\n [selected]=\"view === activeView\"\n (click)=\"onClick(view)\">{{getViewTypeText(view)}}</button>\n </kendo-buttongroup>\n "
5024
+ template: "\n <select\n class=\"k-dropdown k-views-dropdown\"\n aria-label=\"View Selector\"\n [value]=\"activeView\"\n (change)=\"activeViewChange.emit($event.target.value)\">\n <option *ngFor=\"let view of views\" [value]=\"view\">{{getViewTypeText(view)}}</option>\n </select>\n <kendo-buttongroup class=\"k-gantt-views\" selection=\"single\">\n <button *ngFor=\"let view of views\"\n kendoButton\n type=\"button\"\n [selected]=\"view === activeView\"\n (click)=\"onClick(view)\">{{getViewTypeText(view)}}</button>\n </kendo-buttongroup>\n "
4316
5025
  }),
4317
5026
  __metadata("design:paramtypes", [LocalizationService])
4318
5027
  ], ViewSelectorComponent);
@@ -5239,8 +5948,8 @@ var EditDialogComponent = /** @class */ (function () {
5239
5948
  EditDialogComponent.prototype.handleEditingResult = function (editResultType) {
5240
5949
  this.editService.triggerEditEvent(editResultType);
5241
5950
  };
5242
- EditDialogComponent.prototype.onTaskDelete = function () {
5243
- this.editService.showConfirmationDialog.next();
5951
+ EditDialogComponent.prototype.handleTaskDelete = function () {
5952
+ this.editService.taskDelete.next(this.editService.dataItem);
5244
5953
  };
5245
5954
  __decorate([
5246
5955
  Input(),
@@ -5249,7 +5958,7 @@ var EditDialogComponent = /** @class */ (function () {
5249
5958
  EditDialogComponent = __decorate([
5250
5959
  Component({
5251
5960
  selector: 'kendo-gantt-edit-dialog',
5252
- template: "\n <kendo-dialog\n [title]=\"getText('taskEditingDialogTitle')\"\n [width]=\"575\"\n [height]=\"470\"\n (close)=\"handleEditingResult('cancel')\">\n <kendo-dialog-messages\n [closeTitle]=\"getText('taskEditingDialogCloseTitle')\"></kendo-dialog-messages>\n\n <kendo-tabstrip [keepTabContent]=\"true\">\n <kendo-tabstrip-tab [title]=\"getText('taskEditingGeneralTabTitle')\" [selected]=\"true\">\n <ng-template kendoTabContent>\n <kendo-gantt-task-fields></kendo-gantt-task-fields>\n </ng-template>\n </kendo-tabstrip-tab>\n <kendo-tabstrip-tab [title]=\"getText('taskEditingPredecessorsTabTitle')\">\n <ng-template kendoTabContent>\n <kendo-gantt-dependencies-table\n [tasks]=\"loadedTasks\"\n [(dependencies)]=\"predecessors\"\n dependencyType=\"predecessor\"\n >\n </kendo-gantt-dependencies-table>\n </ng-template>\n </kendo-tabstrip-tab>\n <kendo-tabstrip-tab [title]=\"getText('taskEditingSuccessorsTabTitle')\">\n <ng-template kendoTabContent>\n <kendo-gantt-dependencies-table\n [tasks]=\"loadedTasks\"\n [(dependencies)]=\"successors\"\n dependencyType=\"successor\">\n </kendo-gantt-dependencies-table>\n </ng-template>\n </kendo-tabstrip-tab>\n </kendo-tabstrip>\n\n <kendo-dialog-actions layout=\"normal\">\n <button kendoButton (click)=\"onTaskDelete()\">{{ getText('deleteButtonText') }}</button>\n <kendo-treelist-spacer></kendo-treelist-spacer>\n <button kendoButton [primary]=\"true\" (click)=\"handleEditingResult('save')\">{{ getText('saveButtonText') }}</button>\n <button kendoButton (click)=\"handleEditingResult('cancel')\">{{ getText('cancelButtonText') }}</button>\n </kendo-dialog-actions>\n </kendo-dialog>\n "
5961
+ template: "\n <kendo-dialog\n [title]=\"getText('taskEditingDialogTitle')\"\n [width]=\"575\"\n [height]=\"470\"\n (close)=\"handleEditingResult('cancel')\">\n <kendo-dialog-messages\n [closeTitle]=\"getText('taskEditingDialogCloseTitle')\"></kendo-dialog-messages>\n\n <kendo-tabstrip [keepTabContent]=\"true\">\n <kendo-tabstrip-tab [title]=\"getText('taskEditingGeneralTabTitle')\" [selected]=\"true\">\n <ng-template kendoTabContent>\n <kendo-gantt-task-fields></kendo-gantt-task-fields>\n </ng-template>\n </kendo-tabstrip-tab>\n <kendo-tabstrip-tab [title]=\"getText('taskEditingPredecessorsTabTitle')\">\n <ng-template kendoTabContent>\n <kendo-gantt-dependencies-table\n [tasks]=\"loadedTasks\"\n [(dependencies)]=\"predecessors\"\n dependencyType=\"predecessor\"\n >\n </kendo-gantt-dependencies-table>\n </ng-template>\n </kendo-tabstrip-tab>\n <kendo-tabstrip-tab [title]=\"getText('taskEditingSuccessorsTabTitle')\">\n <ng-template kendoTabContent>\n <kendo-gantt-dependencies-table\n [tasks]=\"loadedTasks\"\n [(dependencies)]=\"successors\"\n dependencyType=\"successor\">\n </kendo-gantt-dependencies-table>\n </ng-template>\n </kendo-tabstrip-tab>\n </kendo-tabstrip>\n\n <kendo-dialog-actions layout=\"normal\">\n <button\n kendoButton\n [kendoEventsOutsideAngular]=\"{\n click: handleTaskDelete\n }\"\n [scope]=\"this\"\n >\n {{ getText('deleteButtonText') }}\n </button>\n <kendo-treelist-spacer></kendo-treelist-spacer>\n <button kendoButton [primary]=\"true\" (click)=\"handleEditingResult('save')\">{{ getText('saveButtonText') }}</button>\n <button kendoButton (click)=\"handleEditingResult('cancel')\">{{ getText('cancelButtonText') }}</button>\n </kendo-dialog-actions>\n </kendo-dialog>\n "
5253
5962
  }),
5254
5963
  __metadata("design:paramtypes", [MappingService,
5255
5964
  EditService,
@@ -5962,4 +6671,4 @@ var GanttModule = /** @class */ (function () {
5962
6671
  * Generated bundle index. Do not edit.
5963
6672
  */
5964
6673
 
5965
- export { MappingService, OptionChangesService, TOUCH_ENABLED, DependencyDomService, GanttDependencyDirective, DragValidationTooltipComponent, GanttAddTaskComponent, DependenciesTableComponent, EditDialogComponent, EditService, TaskFieldsComponent, CustomMessagesComponent, GanttLocalizationService, LocalizedMessagesDirective, Messages, PreventableEvent, GanttHeaderTableBodyComponent, GanttMilestoneTaskComponent, GanttSummaryTaskComponent, GanttTaskBase, GanttTaskComponent, GanttTasksTableBodyComponent, ScrollSyncService, TimelineScrollableDirective, TimelineScrollService, GanttTimelineComponent, TimelineBaseViewService, TimelineDayViewComponent, TimelineDayViewService, TimelineMonthViewComponent, TimelineMonthViewService, TimelineViewService, TimelineWeekViewComponent, TimelineWeekViewService, ViewBase, ToolbarComponent, ViewSelectorComponent, GanttComponent, GanttModule, GanttHierarchyBindingDirective, GanttFlatBindingDirective, GanttExpandableDirective, DependencyDragCreateDirective, GanttTaskTemplateDirective, GanttTaskContentTemplateDirective, GanttSummaryTaskTemplateDirective, ToolbarTemplateDirective, SelectableDirective, DependencyType, CellCloseEvent, GanttColumnBase, GanttColumnComponent, GanttColumnGroupComponent, GanttSpanColumnComponent, CellTemplateDirective, HeaderTemplateDirective, FooterTemplateDirective, ColumnMenuTemplateDirective, FilterCellTemplateDirective, FilterMenuTemplateDirective, EditTemplateDirective };
6674
+ export { MappingService, OptionChangesService, TOUCH_ENABLED, DependencyDomService, GanttDependencyDirective, DragValidationTooltipComponent, GanttAddTaskComponent, DependenciesTableComponent, EditDialogComponent, EditService, TaskFieldsComponent, CustomMessagesComponent, GanttLocalizationService, LocalizedMessagesDirective, Messages, PreventableEvent, NavigationService, GanttHeaderTableBodyComponent, GanttMilestoneTaskComponent, GanttSummaryTaskComponent, GanttTaskBase, GanttTaskComponent, GanttTasksTableBodyComponent, ScrollSyncService, TimelineScrollableDirective, TimelineScrollService, GanttTimelineComponent, TimelineBaseViewService, TimelineDayViewComponent, TimelineDayViewService, TimelineMonthViewComponent, TimelineMonthViewService, TimelineViewService, TimelineWeekViewComponent, TimelineWeekViewService, ViewBase, ToolbarComponent, ViewSelectorComponent, GanttComponent, GanttModule, GanttHierarchyBindingDirective, GanttFlatBindingDirective, GanttExpandableDirective, DependencyDragCreateDirective, GanttTaskTemplateDirective, GanttTaskContentTemplateDirective, GanttSummaryTaskTemplateDirective, ToolbarTemplateDirective, SelectableDirective, DependencyType, CellCloseEvent, GanttColumnBase, GanttColumnComponent, GanttColumnGroupComponent, GanttSpanColumnComponent, CellTemplateDirective, HeaderTemplateDirective, FooterTemplateDirective, ColumnMenuTemplateDirective, FilterCellTemplateDirective, FilterMenuTemplateDirective, EditTemplateDirective };