@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
@@ -0,0 +1,69 @@
1
+ /**-----------------------------------------------------------------------------------------
2
+ * Copyright © 2021 Progress Software Corporation. All rights reserved.
3
+ * Licensed under commercial license. See LICENSE.md in the project root for more information
4
+ *-------------------------------------------------------------------------------------------*/
5
+ import { Keys } from '@progress/kendo-angular-common';
6
+ // TODO: add those keys to `import { Keys } from '@progress/kendo-angular-common';`
7
+ var NumpadKeys;
8
+ (function (NumpadKeys) {
9
+ NumpadKeys[NumpadKeys["Digit1"] = 97] = "Digit1";
10
+ NumpadKeys[NumpadKeys["Digit2"] = 98] = "Digit2";
11
+ NumpadKeys[NumpadKeys["Digit3"] = 99] = "Digit3";
12
+ NumpadKeys[NumpadKeys["Digit4"] = 100] = "Digit4";
13
+ })(NumpadKeys || (NumpadKeys = {}));
14
+ /**
15
+ * @hidden
16
+ */
17
+ export const isArrowUpDownKey = (keyCode) => [
18
+ Keys.ArrowUp,
19
+ Keys.ArrowDown
20
+ ].some(arrowKeyCode => keyCode === arrowKeyCode);
21
+ /**
22
+ * @hidden
23
+ */
24
+ export const isNavigationKey = (keyCode) => [
25
+ Keys.ArrowUp,
26
+ Keys.ArrowDown,
27
+ Keys.Home,
28
+ Keys.End
29
+ ].some(navigationKeyCode => keyCode === navigationKeyCode);
30
+ /**
31
+ * @hidden
32
+ */
33
+ export const isExpandCollapseKey = (keyCode, altKey) => {
34
+ return altKey && [
35
+ Keys.ArrowLeft,
36
+ Keys.ArrowRight
37
+ ].some(navigationKeyCode => keyCode === navigationKeyCode);
38
+ };
39
+ /**
40
+ * @hidden
41
+ */
42
+ export const isViewDigitKey = (keyCode) => [
43
+ Keys.Digit1,
44
+ NumpadKeys.Digit1,
45
+ Keys.Digit2,
46
+ NumpadKeys.Digit2,
47
+ Keys.Digit3,
48
+ NumpadKeys.Digit3,
49
+ Keys.Digit4,
50
+ NumpadKeys.Digit4
51
+ ].some(digitKeyCode => keyCode === digitKeyCode);
52
+ /**
53
+ * @hidden
54
+ *
55
+ * Returns the corresponding view index for the pressed digit key (Digit 1 => 0, Digit 2 => 1, etc.).
56
+ */
57
+ export const getIndexFromViewDigitKeyCode = (keyCode) => {
58
+ switch (keyCode) {
59
+ case NumpadKeys.Digit1:
60
+ case Keys.Digit1: return 0;
61
+ case NumpadKeys.Digit2:
62
+ case Keys.Digit2: return 1;
63
+ case NumpadKeys.Digit3:
64
+ case Keys.Digit3: return 2;
65
+ case NumpadKeys.Digit4:
66
+ case Keys.Digit4: return 3;
67
+ default: return null;
68
+ }
69
+ };
@@ -9,7 +9,7 @@ export const packageMetadata = {
9
9
  name: '@progress/kendo-angular-gantt',
10
10
  productName: 'Kendo UI for Angular',
11
11
  productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
12
- publishDate: 1642086647,
12
+ publishDate: 1642580546,
13
13
  version: '',
14
14
  licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license/?utm_medium=product&utm_source=kendoangular&utm_campaign=kendo-ui-angular-purchase-license-keys-warning'
15
15
  };
@@ -4,6 +4,7 @@
4
4
  *-------------------------------------------------------------------------------------------*/
5
5
  import { ChangeDetectorRef } from '@angular/core';
6
6
  import { MappingService } from '../common/mapping.service';
7
+ import { NavigationService } from '../navigation/navigation.service';
7
8
  import { DependencyDomService } from '../dependencies/dependency-dom.service';
8
9
  import { OptionChangesService } from '../common/option-changes.service';
9
10
  import { TimelineViewService } from './../timeline/timeline-view.service';
@@ -14,5 +15,5 @@ import { GanttTaskBase } from './gantt-task-base';
14
15
  export declare class GanttMilestoneTaskComponent extends GanttTaskBase {
15
16
  touchEnabled: boolean;
16
17
  milestoneWrapperClass: boolean;
17
- constructor(touchEnabled: boolean, mapper: MappingService, timelineViewService: TimelineViewService, dependencyDomService: DependencyDomService, optionChangesService: OptionChangesService, cdr: ChangeDetectorRef);
18
+ constructor(touchEnabled: boolean, mapper: MappingService, timelineViewService: TimelineViewService, dependencyDomService: DependencyDomService, optionChangesService: OptionChangesService, cdr: ChangeDetectorRef, navigationService: NavigationService);
18
19
  }
@@ -6,6 +6,7 @@ import * as tslib_1 from "tslib";
6
6
  var GanttMilestoneTaskComponent_1;
7
7
  import { Component, forwardRef, HostBinding, ChangeDetectorRef, Inject } from '@angular/core';
8
8
  import { MappingService } from '../common/mapping.service';
9
+ import { NavigationService } from '../navigation/navigation.service';
9
10
  import { TOUCH_ENABLED } from '../common/touch-enabled';
10
11
  import { DependencyDomService } from '../dependencies/dependency-dom.service';
11
12
  import { OptionChangesService } from '../common/option-changes.service';
@@ -15,8 +16,8 @@ import { GanttTaskBase } from './gantt-task-base';
15
16
  * @hidden
16
17
  */
17
18
  let GanttMilestoneTaskComponent = GanttMilestoneTaskComponent_1 = class GanttMilestoneTaskComponent extends GanttTaskBase {
18
- constructor(touchEnabled, mapper, timelineViewService, dependencyDomService, optionChangesService, cdr) {
19
- super(mapper, timelineViewService, dependencyDomService, optionChangesService, cdr);
19
+ constructor(touchEnabled, mapper, timelineViewService, dependencyDomService, optionChangesService, cdr, navigationService) {
20
+ super(mapper, timelineViewService, dependencyDomService, optionChangesService, cdr, navigationService);
20
21
  this.touchEnabled = touchEnabled;
21
22
  this.milestoneWrapperClass = true;
22
23
  }
@@ -37,10 +38,13 @@ GanttMilestoneTaskComponent = GanttMilestoneTaskComponent_1 = tslib_1.__decorate
37
38
  template: `
38
39
  <div
39
40
  #task
41
+ role="treeitem"
40
42
  class="k-task k-task-milestone"
41
43
  [ngClass]="taskClass(dataItem)"
42
44
  [attr.title]="mapper.extractFromTask(dataItem, 'title')"
43
45
  [class.k-state-selected]="isSelected(dataItem)"
46
+ [attr.aria-selected]="ariaSelected"
47
+ [attr.aria-level]="level + 1"
44
48
  >
45
49
  </div>
46
50
  <ng-container *ngIf="renderDependencyDragClues">
@@ -55,13 +59,23 @@ GanttMilestoneTaskComponent = GanttMilestoneTaskComponent_1 = tslib_1.__decorate
55
59
  >
56
60
  </div>
57
61
  </ng-container>
58
- `
62
+ `,
63
+ styles: [`
64
+ .k-task.k-focus {
65
+ box-shadow: 0 0 4px 3px grey;
66
+ outline: none;
67
+ }
68
+ .k-task.k-focus.k-state-selected {
69
+ box-shadow: 0 0 4px 3px #ffaea8;
70
+ }
71
+ `]
59
72
  }),
60
73
  tslib_1.__param(0, Inject(TOUCH_ENABLED)),
61
74
  tslib_1.__metadata("design:paramtypes", [Boolean, MappingService,
62
75
  TimelineViewService,
63
76
  DependencyDomService,
64
77
  OptionChangesService,
65
- ChangeDetectorRef])
78
+ ChangeDetectorRef,
79
+ NavigationService])
66
80
  ], GanttMilestoneTaskComponent);
67
81
  export { GanttMilestoneTaskComponent };
@@ -4,6 +4,7 @@
4
4
  *-------------------------------------------------------------------------------------------*/
5
5
  import { ChangeDetectorRef, TemplateRef } from '@angular/core';
6
6
  import { MappingService } from '../common/mapping.service';
7
+ import { NavigationService } from '../navigation/navigation.service';
7
8
  import { DependencyDomService } from '../dependencies/dependency-dom.service';
8
9
  import { OptionChangesService } from '../common/option-changes.service';
9
10
  import { TimelineViewService } from './../timeline/timeline-view.service';
@@ -15,5 +16,7 @@ export declare class GanttSummaryTaskComponent extends GanttTaskBase {
15
16
  touchEnabled: boolean;
16
17
  summaryWrapperClass: boolean;
17
18
  template: TemplateRef<any>;
18
- constructor(touchEnabled: boolean, mapper: MappingService, timelineViewService: TimelineViewService, dependencyDomService: DependencyDomService, optionChangesService: OptionChangesService, cdr: ChangeDetectorRef);
19
+ isExpanded: (task: object) => boolean;
20
+ readonly ariaExpanded: string;
21
+ constructor(touchEnabled: boolean, mapper: MappingService, timelineViewService: TimelineViewService, dependencyDomService: DependencyDomService, optionChangesService: OptionChangesService, cdr: ChangeDetectorRef, navigationService: NavigationService);
19
22
  }
@@ -6,20 +6,28 @@ import * as tslib_1 from "tslib";
6
6
  var GanttSummaryTaskComponent_1;
7
7
  import { ChangeDetectorRef, Component, forwardRef, HostBinding, Inject, Input, TemplateRef } from '@angular/core';
8
8
  import { MappingService } from '../common/mapping.service';
9
+ import { NavigationService } from '../navigation/navigation.service';
9
10
  import { TOUCH_ENABLED } from '../common/touch-enabled';
10
11
  import { DependencyDomService } from '../dependencies/dependency-dom.service';
11
12
  import { OptionChangesService } from '../common/option-changes.service';
12
13
  import { TimelineViewService } from './../timeline/timeline-view.service';
13
14
  import { GanttTaskBase } from './gantt-task-base';
15
+ import { isPresent } from '../utils';
14
16
  /**
15
17
  * @hidden
16
18
  */
17
19
  let GanttSummaryTaskComponent = GanttSummaryTaskComponent_1 = class GanttSummaryTaskComponent extends GanttTaskBase {
18
- constructor(touchEnabled, mapper, timelineViewService, dependencyDomService, optionChangesService, cdr) {
19
- super(mapper, timelineViewService, dependencyDomService, optionChangesService, cdr);
20
+ constructor(touchEnabled, mapper, timelineViewService, dependencyDomService, optionChangesService, cdr, navigationService) {
21
+ super(mapper, timelineViewService, dependencyDomService, optionChangesService, cdr, navigationService);
20
22
  this.touchEnabled = touchEnabled;
21
23
  this.summaryWrapperClass = true;
22
24
  }
25
+ get ariaExpanded() {
26
+ // if no callback is provided, all child items are displayed and the item is regarded as expanded
27
+ // replicates the TreeList aria-expanded behavior
28
+ const isExpanded = !isPresent(this.isExpanded) || this.isExpanded(this.dataItem);
29
+ return String(isExpanded);
30
+ }
23
31
  };
24
32
  tslib_1.__decorate([
25
33
  HostBinding('class.k-summary-wrap'),
@@ -29,6 +37,10 @@ tslib_1.__decorate([
29
37
  Input(),
30
38
  tslib_1.__metadata("design:type", TemplateRef)
31
39
  ], GanttSummaryTaskComponent.prototype, "template", void 0);
40
+ tslib_1.__decorate([
41
+ Input(),
42
+ tslib_1.__metadata("design:type", Function)
43
+ ], GanttSummaryTaskComponent.prototype, "isExpanded", void 0);
32
44
  GanttSummaryTaskComponent = GanttSummaryTaskComponent_1 = tslib_1.__decorate([
33
45
  Component({
34
46
  selector: 'kendo-gantt-summary-task',
@@ -41,11 +53,15 @@ GanttSummaryTaskComponent = GanttSummaryTaskComponent_1 = tslib_1.__decorate([
41
53
  template: `
42
54
  <div
43
55
  #task
56
+ role="treeitem"
44
57
  class="k-task k-task-summary"
45
58
  [ngClass]="taskClass(dataItem)"
46
59
  [style.width.px]="taskWidth"
47
60
  [attr.title]="mapper.extractFromTask(dataItem, 'title')"
48
61
  [class.k-state-selected]="isSelected(dataItem)"
62
+ [attr.aria-selected]="ariaSelected"
63
+ [attr.aria-expanded]="ariaExpanded"
64
+ [attr.aria-level]="level + 1"
49
65
  >
50
66
  <div *ngIf="!template; else summaryTemplate"
51
67
  class="k-task-summary-progress"
@@ -78,13 +94,23 @@ GanttSummaryTaskComponent = GanttSummaryTaskComponent_1 = tslib_1.__decorate([
78
94
  >
79
95
  </div>
80
96
  </ng-container>
81
- `
97
+ `,
98
+ styles: [`
99
+ .k-task.k-focus {
100
+ box-shadow: 0 0 4px 3px grey;
101
+ outline: none;
102
+ }
103
+ .k-task.k-focus.k-state-selected {
104
+ box-shadow: 0 0 4px 3px #ffaea8;
105
+ }
106
+ `]
82
107
  }),
83
108
  tslib_1.__param(0, Inject(TOUCH_ENABLED)),
84
109
  tslib_1.__metadata("design:paramtypes", [Boolean, MappingService,
85
110
  TimelineViewService,
86
111
  DependencyDomService,
87
112
  OptionChangesService,
88
- ChangeDetectorRef])
113
+ ChangeDetectorRef,
114
+ NavigationService])
89
115
  ], GanttSummaryTaskComponent);
90
116
  export { GanttSummaryTaskComponent };
@@ -3,6 +3,7 @@
3
3
  * Licensed under commercial license. See LICENSE.md in the project root for more information
4
4
  *-------------------------------------------------------------------------------------------*/
5
5
  import { ChangeDetectorRef, ElementRef, SimpleChanges } from '@angular/core';
6
+ import { NavigationService } from '../navigation/navigation.service';
6
7
  import { OptionChangesService } from '../common/option-changes.service';
7
8
  import { TaskClassFn } from '../models/class-callbacks';
8
9
  import { TimelineViewType } from '../models/timeline-view';
@@ -18,17 +19,22 @@ export declare abstract class GanttTaskBase {
18
19
  private dependencyDomService;
19
20
  private optionChangesService;
20
21
  private cdr;
22
+ private navigationService;
21
23
  wrapperClass: boolean;
24
+ readonly taskIndexAttribute: number;
22
25
  /**
23
26
  * Points to the `.k-task` element of the template (present in all three task types).
24
27
  */
25
28
  taskElement: ElementRef<HTMLElement>;
26
29
  dataItem: any;
30
+ index: number;
31
+ level: number;
27
32
  renderDependencyDragClues: boolean;
33
+ selectable: boolean;
28
34
  isSelected: (dataItem: object) => boolean;
29
35
  activeView: TimelineViewType;
30
36
  taskClass: TaskClassFn;
31
- private viewChangesSubscription;
37
+ readonly ariaSelected: string;
32
38
  readonly slotUnitDuration: number;
33
39
  private readonly viewService;
34
40
  readonly slotWidth: number;
@@ -41,8 +47,10 @@ export declare abstract class GanttTaskBase {
41
47
  */
42
48
  readonly taskOffset: number;
43
49
  readonly completionOverlayWidth: number;
50
+ private subscriptions;
44
51
  constructor(mapper: MappingService, // left public to be available for usage in the templates
45
- timelineViewService: TimelineViewService, dependencyDomService: DependencyDomService, optionChangesService: OptionChangesService, cdr: ChangeDetectorRef);
52
+ timelineViewService: TimelineViewService, dependencyDomService: DependencyDomService, optionChangesService: OptionChangesService, cdr: ChangeDetectorRef, navigationService: NavigationService);
46
53
  ngOnChanges(changes: SimpleChanges): void;
47
54
  ngOnDestroy(): void;
55
+ private updateActiveState;
48
56
  }
@@ -12,22 +12,32 @@ const slotUnitDuration = {
12
12
  week: MS_PER_DAY,
13
13
  month: MS_PER_DAY * 7
14
14
  };
15
+ const FOCUSED_CLASS = 'k-focus';
15
16
  /**
16
17
  * @hidden
17
18
  */
18
19
  export class GanttTaskBase {
19
20
  constructor(mapper, // left public to be available for usage in the templates
20
- timelineViewService, dependencyDomService, optionChangesService, cdr) {
21
+ timelineViewService, dependencyDomService, optionChangesService, cdr, navigationService) {
21
22
  this.mapper = mapper;
22
23
  this.timelineViewService = timelineViewService;
23
24
  this.dependencyDomService = dependencyDomService;
24
25
  this.optionChangesService = optionChangesService;
25
26
  this.cdr = cdr;
27
+ this.navigationService = navigationService;
26
28
  this.wrapperClass = true;
27
- this.viewChangesSubscription = new Subscription();
28
- this.viewChangesSubscription.add(this.optionChangesService.viewChanges.subscribe(() => {
29
- this.cdr.markForCheck();
30
- }));
29
+ this.subscriptions = new Subscription();
30
+ this.subscriptions.add(this.optionChangesService.viewChanges
31
+ .subscribe(() => this.cdr.markForCheck()));
32
+ this.subscriptions.add(this.navigationService.taskStatusChanges
33
+ .subscribe(this.updateActiveState.bind(this)));
34
+ }
35
+ get taskIndexAttribute() {
36
+ return this.index;
37
+ }
38
+ get ariaSelected() {
39
+ // assinging null will not render the attribute at all (desired in selectable="false" mode)
40
+ return this.selectable ? String(this.isSelected(this.dataItem)) : null;
31
41
  }
32
42
  get slotUnitDuration() {
33
43
  return slotUnitDuration[this.activeView];
@@ -71,18 +81,38 @@ export class GanttTaskBase {
71
81
  else if (isPresent(changes.activeView)) {
72
82
  this.dependencyDomService.notifyChanges();
73
83
  }
84
+ if (this.navigationService.enabled && isPresent(changes.index)) {
85
+ this.updateActiveState(this.navigationService.activeTask);
86
+ }
74
87
  }
75
88
  ngOnDestroy() {
76
89
  if (isPresent(this.dataItem)) {
77
90
  this.dependencyDomService.unregisterTask(this.dataItem);
78
91
  }
79
- this.viewChangesSubscription.unsubscribe();
92
+ this.subscriptions.unsubscribe();
93
+ }
94
+ updateActiveState({ activeIndex, isFocused }) {
95
+ const isActive = activeIndex === this.index;
96
+ const tabindex = isActive ? '0' : '-1';
97
+ this.taskElement.nativeElement.setAttribute('tabindex', tabindex);
98
+ if (isActive && isFocused) {
99
+ this.taskElement.nativeElement.focus();
100
+ this.taskElement.nativeElement.classList.add(FOCUSED_CLASS);
101
+ }
102
+ else {
103
+ this.taskElement.nativeElement.classList.remove(FOCUSED_CLASS);
104
+ }
80
105
  }
81
106
  }
82
107
  tslib_1.__decorate([
83
108
  HostBinding('class.k-task-wrap'),
84
109
  tslib_1.__metadata("design:type", Boolean)
85
110
  ], GanttTaskBase.prototype, "wrapperClass", void 0);
111
+ tslib_1.__decorate([
112
+ HostBinding('attr.data-task-index'),
113
+ tslib_1.__metadata("design:type", Number),
114
+ tslib_1.__metadata("design:paramtypes", [])
115
+ ], GanttTaskBase.prototype, "taskIndexAttribute", null);
86
116
  tslib_1.__decorate([
87
117
  ViewChild('task', { static: true }),
88
118
  tslib_1.__metadata("design:type", ElementRef)
@@ -91,10 +121,22 @@ tslib_1.__decorate([
91
121
  Input(),
92
122
  tslib_1.__metadata("design:type", Object)
93
123
  ], GanttTaskBase.prototype, "dataItem", void 0);
124
+ tslib_1.__decorate([
125
+ Input(),
126
+ tslib_1.__metadata("design:type", Number)
127
+ ], GanttTaskBase.prototype, "index", void 0);
128
+ tslib_1.__decorate([
129
+ Input(),
130
+ tslib_1.__metadata("design:type", Number)
131
+ ], GanttTaskBase.prototype, "level", void 0);
94
132
  tslib_1.__decorate([
95
133
  Input(),
96
134
  tslib_1.__metadata("design:type", Boolean)
97
135
  ], GanttTaskBase.prototype, "renderDependencyDragClues", void 0);
136
+ tslib_1.__decorate([
137
+ Input(),
138
+ tslib_1.__metadata("design:type", Boolean)
139
+ ], GanttTaskBase.prototype, "selectable", void 0);
98
140
  tslib_1.__decorate([
99
141
  Input(),
100
142
  tslib_1.__metadata("design:type", Function)
@@ -4,11 +4,12 @@
4
4
  *-------------------------------------------------------------------------------------------*/
5
5
  import { ChangeDetectorRef, TemplateRef } from '@angular/core';
6
6
  import { MappingService } from '../common/mapping.service';
7
+ import { NavigationService } from '../navigation/navigation.service';
8
+ import { EditService } from '../editing/edit.service';
7
9
  import { DependencyDomService } from '../dependencies/dependency-dom.service';
8
10
  import { OptionChangesService } from '../common/option-changes.service';
9
11
  import { TimelineViewService } from './../timeline/timeline-view.service';
10
12
  import { GanttTaskBase } from './gantt-task-base';
11
- import { EditService } from '../editing/edit.service';
12
13
  /**
13
14
  * @hidden
14
15
  */
@@ -17,6 +18,6 @@ export declare class GanttTaskComponent extends GanttTaskBase {
17
18
  touchEnabled: boolean;
18
19
  taskContentTemplate: TemplateRef<any>;
19
20
  taskTemplate: TemplateRef<any>;
20
- constructor(editService: EditService, touchEnabled: boolean, mapper: MappingService, timelineViewService: TimelineViewService, dependencyDomService: DependencyDomService, optionChangesService: OptionChangesService, cdr: ChangeDetectorRef);
21
+ constructor(editService: EditService, touchEnabled: boolean, mapper: MappingService, timelineViewService: TimelineViewService, dependencyDomService: DependencyDomService, optionChangesService: OptionChangesService, cdr: ChangeDetectorRef, navigationService: NavigationService);
21
22
  onTaskDelete(): void;
22
23
  }
@@ -6,24 +6,25 @@ import * as tslib_1 from "tslib";
6
6
  var GanttTaskComponent_1;
7
7
  import { ChangeDetectorRef, Component, forwardRef, Inject, Input, TemplateRef } from '@angular/core';
8
8
  import { MappingService } from '../common/mapping.service';
9
+ import { NavigationService } from '../navigation/navigation.service';
10
+ import { EditService } from '../editing/edit.service';
9
11
  import { TOUCH_ENABLED } from '../common/touch-enabled';
10
12
  import { DependencyDomService } from '../dependencies/dependency-dom.service';
11
13
  import { OptionChangesService } from '../common/option-changes.service';
12
14
  import { TimelineViewService } from './../timeline/timeline-view.service';
13
15
  import { GanttTaskBase } from './gantt-task-base';
14
- import { EditService } from '../editing/edit.service';
15
16
  /**
16
17
  * @hidden
17
18
  */
18
19
  let GanttTaskComponent = GanttTaskComponent_1 = class GanttTaskComponent extends GanttTaskBase {
19
- constructor(editService, touchEnabled, mapper, timelineViewService, dependencyDomService, optionChangesService, cdr) {
20
- super(mapper, timelineViewService, dependencyDomService, optionChangesService, cdr);
20
+ constructor(editService, touchEnabled, mapper, timelineViewService, dependencyDomService, optionChangesService, cdr, navigationService) {
21
+ super(mapper, timelineViewService, dependencyDomService, optionChangesService, cdr, navigationService);
21
22
  this.editService = editService;
22
23
  this.touchEnabled = touchEnabled;
23
24
  }
24
25
  onTaskDelete() {
25
26
  this.editService.dataItem = this.dataItem;
26
- this.editService.showConfirmationDialog.next();
27
+ this.editService.taskDelete.next(this.dataItem);
27
28
  }
28
29
  };
29
30
  tslib_1.__decorate([
@@ -47,15 +48,19 @@ GanttTaskComponent = GanttTaskComponent_1 = tslib_1.__decorate([
47
48
  <div
48
49
  #task
49
50
  class="k-task k-task-single"
51
+ role="treeitem"
50
52
  [ngClass]="taskClass(dataItem)"
51
53
  [style.width.px]="taskWidth"
52
54
  [attr.title]="mapper.extractFromTask(dataItem, 'title')"
53
55
  [class.k-state-selected]="isSelected(dataItem)"
56
+ [attr.aria-selected]="ariaSelected"
57
+ [attr.aria-level]="level + 1"
54
58
  >
55
59
  <ng-container *ngIf="!taskTemplate">
56
60
  <div
57
61
  class="k-task-complete"
58
62
  [style.width.px]="completionOverlayWidth"
63
+ aria-hidden="true"
59
64
  >
60
65
  </div>
61
66
  <div class="k-task-content">
@@ -70,10 +75,17 @@ GanttTaskComponent = GanttTaskComponent_1 = tslib_1.__decorate([
70
75
  >
71
76
  </ng-template>
72
77
  </div>
73
- <span class="k-task-actions">
78
+ <span
79
+ class="k-task-actions"
80
+ aria-hidden="true"
81
+ >
74
82
  <span
75
- (click)="onTaskDelete()"
76
- class="k-link k-task-delete">
83
+ class="k-link k-task-delete"
84
+ [kendoEventsOutsideAngular]="{
85
+ click: onTaskDelete
86
+ }"
87
+ [scope]="this"
88
+ >
77
89
  <span class="k-icon k-i-close"></span>
78
90
  </span>
79
91
  </span>
@@ -101,13 +113,23 @@ GanttTaskComponent = GanttTaskComponent_1 = tslib_1.__decorate([
101
113
  >
102
114
  </div>
103
115
  </ng-container>
104
- `
116
+ `,
117
+ styles: [`
118
+ .k-task.k-focus {
119
+ box-shadow: 0 0 4px 3px grey;
120
+ outline: none;
121
+ }
122
+ .k-task.k-focus.k-state-selected {
123
+ box-shadow: 0 0 4px 3px #ffaea8;
124
+ }
125
+ `]
105
126
  }),
106
127
  tslib_1.__param(1, Inject(TOUCH_ENABLED)),
107
128
  tslib_1.__metadata("design:paramtypes", [EditService, Boolean, MappingService,
108
129
  TimelineViewService,
109
130
  DependencyDomService,
110
131
  OptionChangesService,
111
- ChangeDetectorRef])
132
+ ChangeDetectorRef,
133
+ NavigationService])
112
134
  ], GanttTaskComponent);
113
135
  export { GanttTaskComponent };
@@ -7,6 +7,7 @@ import { TaskClassFn } from '../models/class-callbacks';
7
7
  import { TimelineViewType } from '../models/timeline-view';
8
8
  import { DependencyDomService } from '../dependencies/dependency-dom.service';
9
9
  import { MappingService } from '../common/mapping.service';
10
+ import { ViewItem } from '../models/view-item.interface';
10
11
  /**
11
12
  * @hidden
12
13
  */
@@ -14,15 +15,16 @@ export declare class GanttTasksTableBodyComponent {
14
15
  private dependencyDomService;
15
16
  private mapper;
16
17
  timelineRow: ElementRef<HTMLTableRowElement>;
17
- rows: any[];
18
+ selectable: boolean;
19
+ rows: ViewItem[];
18
20
  activeView: TimelineViewType;
19
21
  taskContentTemplate: TemplateRef<any>;
20
22
  taskTemplate: TemplateRef<any>;
21
23
  summaryTaskTemplate: TemplateRef<any>;
22
24
  taskClass: TaskClassFn;
23
- hasChildren: (item: object) => boolean;
25
+ isExpanded: (item: object) => boolean;
24
26
  isTaskSelected: (item: object) => boolean;
25
27
  renderDependencyDragClues: boolean;
26
28
  constructor(dependencyDomService: DependencyDomService, mapper: MappingService);
27
- isMileStone(task: any): boolean;
29
+ isMileStone(item: ViewItem): boolean;
28
30
  }
@@ -6,8 +6,8 @@ import * as tslib_1 from "tslib";
6
6
  import { Component, Input, TemplateRef, ViewChild, ElementRef } from '@angular/core';
7
7
  import { isEqual } from '@progress/kendo-date-math';
8
8
  import { DependencyDomService } from '../dependencies/dependency-dom.service';
9
- import { isPresent } from '../utils';
10
9
  import { MappingService } from '../common/mapping.service';
10
+ import { isPresent } from '../utils';
11
11
  /**
12
12
  * @hidden
13
13
  */
@@ -23,8 +23,8 @@ let GanttTasksTableBodyComponent = class GanttTasksTableBodyComponent {
23
23
  this.dependencyDomService.registerTimelineRow(timelineRow.nativeElement);
24
24
  }
25
25
  }
26
- isMileStone(task) {
27
- return !this.hasChildren(task) && isEqual(this.mapper.extractFromTask(task, 'start'), this.mapper.extractFromTask(task, 'end'));
26
+ isMileStone(item) {
27
+ return !item.hasChildren && isEqual(this.mapper.extractFromTask(item.data, 'start'), this.mapper.extractFromTask(item.data, 'end'));
28
28
  }
29
29
  };
30
30
  tslib_1.__decorate([
@@ -32,6 +32,10 @@ tslib_1.__decorate([
32
32
  tslib_1.__metadata("design:type", ElementRef),
33
33
  tslib_1.__metadata("design:paramtypes", [ElementRef])
34
34
  ], GanttTasksTableBodyComponent.prototype, "timelineRow", null);
35
+ tslib_1.__decorate([
36
+ Input(),
37
+ tslib_1.__metadata("design:type", Boolean)
38
+ ], GanttTasksTableBodyComponent.prototype, "selectable", void 0);
35
39
  tslib_1.__decorate([
36
40
  Input(),
37
41
  tslib_1.__metadata("design:type", Array)
@@ -59,7 +63,7 @@ tslib_1.__decorate([
59
63
  tslib_1.__decorate([
60
64
  Input(),
61
65
  tslib_1.__metadata("design:type", Function)
62
- ], GanttTasksTableBodyComponent.prototype, "hasChildren", void 0);
66
+ ], GanttTasksTableBodyComponent.prototype, "isExpanded", void 0);
63
67
  tslib_1.__decorate([
64
68
  Input(),
65
69
  tslib_1.__metadata("design:type", Function)
@@ -76,35 +80,42 @@ GanttTasksTableBodyComponent = tslib_1.__decorate([
76
80
  <td>
77
81
  <kendo-gantt-milestone-task
78
82
  *ngIf="isMileStone(item); else task"
79
- [dataItem]="item"
83
+ [dataItem]="item.data"
84
+ [level]="item.level"
80
85
  [activeView]="activeView"
81
86
  [taskClass]="taskClass"
87
+ [selectable]="selectable"
82
88
  [isSelected]="isTaskSelected"
83
- [attr.data-task-index]="index"
89
+ [index]="index"
84
90
  [renderDependencyDragClues]="renderDependencyDragClues"
85
91
  >
86
92
  </kendo-gantt-milestone-task>
87
93
  <ng-template #task>
88
94
  <kendo-gantt-summary-task
89
- *ngIf="hasChildren(item)"
90
- [dataItem]="item"
95
+ *ngIf="item.hasChildren"
96
+ [dataItem]="item.data"
97
+ [level]="item.level"
91
98
  [template]="summaryTaskTemplate"
92
99
  [activeView]="activeView"
93
100
  [taskClass]="taskClass"
101
+ [selectable]="selectable"
94
102
  [isSelected]="isTaskSelected"
95
- [attr.data-task-index]="index"
103
+ [isExpanded]="isExpanded"
104
+ [index]="index"
96
105
  [renderDependencyDragClues]="renderDependencyDragClues"
97
106
  >
98
107
  </kendo-gantt-summary-task>
99
108
  <kendo-gantt-task
100
- *ngIf="!hasChildren(item)"
101
- [dataItem]="item"
109
+ *ngIf="!item.hasChildren"
110
+ [dataItem]="item.data"
111
+ [level]="item.level"
102
112
  [taskContentTemplate]="taskContentTemplate"
103
113
  [taskTemplate]="taskTemplate"
104
114
  [activeView]="activeView"
105
115
  [taskClass]="taskClass"
116
+ [selectable]="selectable"
106
117
  [isSelected]="isTaskSelected"
107
- [attr.data-task-index]="index"
118
+ [index]="index"
108
119
  [renderDependencyDragClues]="renderDependencyDragClues"
109
120
  >
110
121
  </kendo-gantt-task>
@@ -23,7 +23,7 @@ export declare class ScrollSyncService implements OnDestroy {
23
23
  constructor(ngZone: NgZone);
24
24
  registerElement(el: any, sourceType: SourceType): void;
25
25
  ngOnDestroy(): void;
26
- syncScrollTop(sourceType: string, targetType: string): void;
26
+ syncScrollTop(sourceType: SourceType, targetType: SourceType): void;
27
27
  resetTimelineScrollLeft(): void;
28
28
  private scroll;
29
29
  }