@progress/kendo-angular-gantt 0.2.1-dev.202112101349 → 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.
- package/dist/cdn/js/kendo-angular-gantt.js +2 -2
- package/dist/cdn/main.js +4 -4
- package/dist/es/common/touch-enabled.js +9 -0
- package/dist/es/dependencies/utils.js +40 -5
- package/dist/es/dragging/dependency-drag-create.directive.js +347 -0
- package/dist/es/dragging/drag-validation-tooltip.component.js +27 -0
- package/dist/es/editing/add-task.component.js +94 -0
- package/dist/es/editing/dependencies-table.component.js +131 -0
- package/dist/es/editing/edit-dialog.component.js +39 -8
- package/dist/es/editing/edit.service.js +92 -8
- package/dist/es/editing/task-fields.component.js +43 -0
- package/dist/es/editing/{util.js → utils.js} +0 -0
- package/dist/es/gantt.component.js +408 -56
- package/dist/es/gantt.module.js +37 -9
- package/dist/es/index.js +9 -0
- package/dist/es/localization/gantt-localization.service.js +26 -0
- package/dist/es/localization/messages.js +45 -1
- package/dist/es/main.js +1 -0
- package/dist/es/models/dependency-type.enum.js +16 -0
- package/dist/es/models/events/{add-event.interface.js → dependency-add-event.interface.js} +0 -0
- package/dist/es/models/events/{edit-event.interface.js → task-add-event.interface.js} +0 -0
- package/dist/es/models/events/{remove-event.interface.js → task-delete-event.interface.js} +0 -0
- package/dist/es/models/models.js +1 -0
- package/dist/es/models/{toolbar-position.js → toolbar-settings.js} +0 -0
- package/dist/{es2015/models/events/add-event.interface.js → es/models/view-item.interface.js} +0 -0
- package/dist/{es2015/models/events/edit-event.interface.js → es/navigation/navigation-models.js} +0 -0
- package/dist/es/navigation/navigation.service.js +390 -0
- package/dist/es/navigation/utils.js +77 -0
- package/dist/es/package-metadata.js +1 -1
- package/dist/es/rendering/gantt-milestone-task.component.js +12 -6
- package/dist/es/rendering/gantt-summary-task.component.js +27 -6
- package/dist/es/rendering/gantt-task-base.js +84 -22
- package/dist/es/rendering/gantt-task.component.js +13 -8
- package/dist/es/rendering/gantt-tasks-table-body.component.js +13 -5
- package/dist/es/scrolling/drag-scroll-settings.js +20 -0
- package/dist/es/scrolling/timeline-scroll.directive.js +89 -0
- package/dist/es/scrolling/timeline-scroll.service.js +39 -0
- package/dist/es/scrolling/utils.js +80 -0
- package/dist/es/timeline/gantt-timeline.component.js +50 -4
- package/dist/es/toolbar/toolbar.component.js +20 -13
- package/dist/es/toolbar/view-selector.component.js +1 -1
- package/dist/es/utils.js +153 -12
- package/dist/es2015/common/touch-enabled.d.ts +9 -0
- package/dist/es2015/common/touch-enabled.js +9 -0
- package/dist/es2015/dependencies/utils.d.ts +15 -0
- package/dist/es2015/dependencies/utils.js +40 -5
- package/dist/es2015/dragging/dependency-drag-create.directive.d.ts +72 -0
- package/dist/es2015/dragging/dependency-drag-create.directive.js +324 -0
- package/dist/es2015/dragging/drag-validation-tooltip.component.d.ts +29 -0
- package/dist/es2015/dragging/drag-validation-tooltip.component.js +76 -0
- package/dist/es2015/editing/add-task.component.d.ts +45 -0
- package/dist/es2015/editing/add-task.component.js +102 -0
- package/dist/es2015/editing/dependencies-table.component.d.ts +39 -0
- package/dist/es2015/editing/dependencies-table.component.js +160 -0
- package/dist/es2015/editing/edit-dialog.component.d.ts +11 -4
- package/dist/es2015/editing/edit-dialog.component.js +66 -36
- package/dist/es2015/editing/edit.service.d.ts +24 -4
- package/dist/es2015/editing/edit.service.js +81 -11
- package/dist/es2015/editing/task-fields.component.d.ts +22 -0
- package/dist/es2015/editing/task-fields.component.js +67 -0
- package/dist/es2015/editing/{util.d.ts → utils.d.ts} +2 -2
- package/dist/es2015/editing/{util.js → utils.js} +0 -0
- package/dist/es2015/gantt.component.d.ts +134 -31
- package/dist/es2015/gantt.component.js +419 -61
- package/dist/es2015/gantt.module.js +37 -9
- package/dist/es2015/index.d.ts +9 -0
- package/dist/es2015/index.js +9 -0
- package/dist/es2015/index.metadata.json +1 -1
- package/dist/es2015/{models/events/edit-event.interface.d.ts → localization/gantt-localization.service.d.ts} +6 -10
- package/dist/es2015/localization/gantt-localization.service.js +25 -0
- package/dist/es2015/localization/messages.d.ts +46 -2
- package/dist/es2015/localization/messages.js +45 -1
- package/dist/es2015/main.d.ts +1 -0
- package/dist/es2015/main.js +1 -0
- package/dist/es2015/models/dependency-type.enum.d.ts +1 -1
- package/dist/es2015/models/dependency-type.enum.js +16 -0
- package/dist/es2015/models/events/dependency-add-event.interface.d.ts +26 -0
- package/dist/es2015/models/events/{remove-event.interface.js → dependency-add-event.interface.js} +0 -0
- package/dist/es2015/models/events/task-add-event.interface.d.ts +31 -0
- package/dist/es2015/models/{toolbar-position.js → events/task-add-event.interface.js} +0 -0
- package/dist/es2015/models/events/task-click-event.interface.d.ts +3 -3
- package/dist/es2015/models/events/task-delete-event.interface.d.ts +21 -0
- package/dist/es2015/models/events/task-delete-event.interface.js +4 -0
- package/dist/es2015/models/events/task-edit-event.interface.d.ts +36 -6
- package/dist/es2015/models/models.d.ts +6 -3
- package/dist/es2015/models/models.js +1 -0
- package/dist/es2015/models/toolbar-settings.d.ts +29 -0
- package/dist/es2015/models/toolbar-settings.js +4 -0
- package/dist/es2015/models/view-item.interface.d.ts +35 -0
- package/dist/es2015/models/view-item.interface.js +4 -0
- package/dist/es2015/navigation/navigation-models.d.ts +34 -0
- package/dist/es2015/navigation/navigation-models.js +4 -0
- package/dist/es2015/navigation/navigation.service.d.ts +126 -0
- package/dist/es2015/navigation/navigation.service.js +355 -0
- package/dist/es2015/navigation/utils.d.ts +26 -0
- package/dist/es2015/navigation/utils.js +69 -0
- package/dist/es2015/package-metadata.js +1 -1
- package/dist/es2015/rendering/gantt-milestone-task.component.d.ts +3 -1
- package/dist/es2015/rendering/gantt-milestone-task.component.js +35 -8
- package/dist/es2015/rendering/gantt-summary-task.component.d.ts +5 -1
- package/dist/es2015/rendering/gantt-summary-task.component.js +47 -8
- package/dist/es2015/rendering/gantt-task-base.d.ts +20 -6
- package/dist/es2015/rendering/gantt-task-base.js +75 -22
- package/dist/es2015/rendering/gantt-task.component.d.ts +4 -2
- package/dist/es2015/rendering/gantt-task.component.js +47 -13
- package/dist/es2015/rendering/gantt-tasks-table-body.component.d.ts +6 -3
- package/dist/es2015/rendering/gantt-tasks-table-body.component.js +27 -9
- package/dist/es2015/scrolling/drag-scroll-settings.d.ts +47 -0
- package/dist/es2015/scrolling/drag-scroll-settings.js +20 -0
- package/dist/es2015/scrolling/scroll-sync.service.d.ts +1 -1
- package/dist/es2015/scrolling/timeline-scroll.directive.d.ts +24 -0
- package/dist/es2015/scrolling/timeline-scroll.directive.js +78 -0
- package/dist/es2015/scrolling/timeline-scroll.service.d.ts +20 -0
- package/dist/es2015/scrolling/timeline-scroll.service.js +44 -0
- package/dist/es2015/scrolling/utils.d.ts +29 -0
- package/dist/es2015/scrolling/utils.js +80 -0
- package/dist/es2015/timeline/gantt-timeline.component.d.ts +29 -4
- package/dist/es2015/timeline/gantt-timeline.component.js +67 -5
- package/dist/es2015/toolbar/toolbar-template.directive.d.ts +1 -1
- package/dist/es2015/toolbar/toolbar.component.d.ts +6 -5
- package/dist/es2015/toolbar/toolbar.component.js +22 -13
- package/dist/es2015/toolbar/view-selector.component.js +3 -1
- package/dist/es2015/utils.d.ts +77 -8
- package/dist/es2015/utils.js +153 -12
- package/dist/fesm2015/index.js +5258 -3012
- package/dist/fesm5/index.js +2862 -733
- package/dist/npm/common/touch-enabled.js +11 -0
- package/dist/npm/dependencies/utils.js +40 -5
- package/dist/npm/dragging/dependency-drag-create.directive.js +349 -0
- package/dist/npm/dragging/drag-validation-tooltip.component.js +29 -0
- package/dist/npm/editing/add-task.component.js +96 -0
- package/dist/npm/editing/dependencies-table.component.js +133 -0
- package/dist/npm/editing/edit-dialog.component.js +38 -7
- package/dist/npm/editing/edit.service.js +91 -7
- package/dist/npm/editing/task-fields.component.js +45 -0
- package/dist/npm/editing/{util.js → utils.js} +0 -0
- package/dist/npm/gantt.component.js +409 -57
- package/dist/npm/gantt.module.js +35 -7
- package/dist/npm/index.js +18 -0
- package/dist/npm/localization/gantt-localization.service.js +28 -0
- package/dist/npm/localization/messages.js +45 -1
- package/dist/npm/main.js +2 -0
- package/dist/npm/models/dependency-type.enum.js +16 -0
- package/dist/npm/models/events/{add-event.interface.js → dependency-add-event.interface.js} +0 -0
- package/dist/npm/models/events/{edit-event.interface.js → task-add-event.interface.js} +0 -0
- package/dist/npm/models/events/{remove-event.interface.js → task-delete-event.interface.js} +0 -0
- package/dist/npm/models/models.js +2 -0
- package/dist/npm/models/{toolbar-position.js → toolbar-settings.js} +0 -0
- package/dist/npm/models/view-item.interface.js +6 -0
- package/dist/npm/navigation/navigation-models.js +6 -0
- package/dist/npm/navigation/navigation.service.js +392 -0
- package/dist/npm/navigation/utils.js +79 -0
- package/dist/npm/package-metadata.js +1 -1
- package/dist/npm/rendering/gantt-milestone-task.component.js +11 -5
- package/dist/npm/rendering/gantt-summary-task.component.js +26 -5
- package/dist/npm/rendering/gantt-task-base.js +84 -22
- package/dist/npm/rendering/gantt-task.component.js +12 -7
- package/dist/npm/rendering/gantt-tasks-table-body.component.js +13 -5
- package/dist/npm/scrolling/drag-scroll-settings.js +22 -0
- package/dist/npm/scrolling/timeline-scroll.directive.js +91 -0
- package/dist/npm/scrolling/timeline-scroll.service.js +41 -0
- package/dist/npm/scrolling/utils.js +83 -0
- package/dist/npm/timeline/gantt-timeline.component.js +49 -3
- package/dist/npm/toolbar/toolbar.component.js +18 -11
- package/dist/npm/toolbar/view-selector.component.js +1 -1
- package/dist/npm/utils.js +153 -12
- package/dist/systemjs/kendo-angular-gantt.js +1 -1
- package/package.json +7 -4
- package/dist/es2015/models/events/add-event.interface.d.ts +0 -16
- package/dist/es2015/models/events/remove-event.interface.d.ts +0 -16
- package/dist/es2015/models/toolbar-position.d.ts +0 -9
|
@@ -0,0 +1,126 @@
|
|
|
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 { NgZone, OnDestroy, Renderer2 } from '@angular/core';
|
|
6
|
+
import { Subject } from 'rxjs';
|
|
7
|
+
import { ScrollSyncService } from '../scrolling/scroll-sync.service';
|
|
8
|
+
import { NavigationMetadata, TaskActivityStatus } from './navigation-models';
|
|
9
|
+
/**
|
|
10
|
+
* @hidden
|
|
11
|
+
*/
|
|
12
|
+
export declare class NavigationService implements OnDestroy {
|
|
13
|
+
private zone;
|
|
14
|
+
private renderer;
|
|
15
|
+
private scrollSyncService;
|
|
16
|
+
/**
|
|
17
|
+
* Notifies when the tasks' focused and interactive (tabindex) state has changed.
|
|
18
|
+
*
|
|
19
|
+
* All tasks are rendered with tabindex="-1".
|
|
20
|
+
* 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.
|
|
21
|
+
* All other tasks should get -1 tabindex and have the focus class removed from them.
|
|
22
|
+
*/
|
|
23
|
+
readonly taskStatusChanges: Subject<TaskActivityStatus>;
|
|
24
|
+
/**
|
|
25
|
+
* Specifies whether navigation is enabled.
|
|
26
|
+
*/
|
|
27
|
+
readonly enabled: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Used to retrieve read-only data about the currently active task.
|
|
30
|
+
*/
|
|
31
|
+
readonly activeTask: TaskActivityStatus;
|
|
32
|
+
/**
|
|
33
|
+
* Persists the expected TreeList focused cell coords.
|
|
34
|
+
* When the tasks in the Timeline are navigated through, the expected TreeList focus target should also change,
|
|
35
|
+
* in order to allow back-tabbing from the Timeline to the same row in the TreeList.
|
|
36
|
+
*/
|
|
37
|
+
private activeTreeListCell;
|
|
38
|
+
/**
|
|
39
|
+
* Persists the expected Timeline focused task index.
|
|
40
|
+
* When the cells in the TreeList are navigated through, the expected Timeline focus target should also change,
|
|
41
|
+
* in order to allow tabbing from the TreeList to the same row in the Timeline.
|
|
42
|
+
*/
|
|
43
|
+
private activeTimelineIndex;
|
|
44
|
+
/**
|
|
45
|
+
* Keeps track of whether the Timeline part is focused.
|
|
46
|
+
* Used when the index of the task elements change (tasks are changed, pushed to, spliced from, etc.)
|
|
47
|
+
* and their status should be updated accordingly.
|
|
48
|
+
*/
|
|
49
|
+
private isTimelineFocused;
|
|
50
|
+
/**
|
|
51
|
+
* The TreeList row index takes into account the header and filter rows.
|
|
52
|
+
* Used when translating Timeline task indices to TreeList row indices.
|
|
53
|
+
*/
|
|
54
|
+
private readonly treeListHeaderRowsCount;
|
|
55
|
+
/**
|
|
56
|
+
* Keeps track of which part has last been focused.
|
|
57
|
+
* Used when calling `gantt.focus()` to determine which part of the component should receive focus.
|
|
58
|
+
*/
|
|
59
|
+
private treeListLastActive;
|
|
60
|
+
/**
|
|
61
|
+
* Keeps track of which part has last been focused.
|
|
62
|
+
* Used when calling `gantt.focus()` to determine which part of the component should receive focus.
|
|
63
|
+
*/
|
|
64
|
+
private timelineLastActive;
|
|
65
|
+
private gantt;
|
|
66
|
+
private host;
|
|
67
|
+
private treeListElement;
|
|
68
|
+
private timelineElement;
|
|
69
|
+
private _enabled;
|
|
70
|
+
private _activeTimelineIndex;
|
|
71
|
+
private _activeTreeListCell;
|
|
72
|
+
private eventListenerDisposers;
|
|
73
|
+
constructor(zone: NgZone, renderer: Renderer2, scrollSyncService: ScrollSyncService);
|
|
74
|
+
initialize({ gantt, host, treeListElement, timelineElement }: NavigationMetadata): void;
|
|
75
|
+
ngOnDestroy(): void;
|
|
76
|
+
/**
|
|
77
|
+
* Focuses either the last active TreeList cell, or the last active Timeline task,
|
|
78
|
+
* dependening on which of the two last held focus.
|
|
79
|
+
*
|
|
80
|
+
* Focuses the first TreeList cell by default.
|
|
81
|
+
*/
|
|
82
|
+
focusLastActiveItem(): void;
|
|
83
|
+
/**
|
|
84
|
+
* Focuses the targeted TreeList cell regardless of the last peresisted target.
|
|
85
|
+
*/
|
|
86
|
+
focusCell(rowIndex: number, colIndex: number): void;
|
|
87
|
+
/**
|
|
88
|
+
* Focuses the targeted Timeline task regardless of the last peresisted target.
|
|
89
|
+
*/
|
|
90
|
+
focusTask(index: number): void;
|
|
91
|
+
/**
|
|
92
|
+
* Updates the focus target flags and notifies the active task to update its focused state.
|
|
93
|
+
*/
|
|
94
|
+
handleTimelineFocusIn({ target }: FocusEvent): void;
|
|
95
|
+
/**
|
|
96
|
+
* Updates the timeline focus state flag and notifies the active task to update its focused state.
|
|
97
|
+
*/
|
|
98
|
+
handleTimelineFocusOut({ relatedTarget }: FocusEvent): void;
|
|
99
|
+
/**
|
|
100
|
+
* Updates the focus target flags and corrects the TreeList focus target if needed.
|
|
101
|
+
* As the TreeList will keep its last focused cell with tabindex="0",
|
|
102
|
+
* this methods forcefully focuses the correct cell,
|
|
103
|
+
* when navigating in the Timeline has updated the expected TreeList focus target.
|
|
104
|
+
*/
|
|
105
|
+
handleTreeListFocusIn(event: FocusEvent): void;
|
|
106
|
+
handleKeydown(event: KeyboardEvent): void;
|
|
107
|
+
/**
|
|
108
|
+
* Filters for task mousedown in the Timeline.
|
|
109
|
+
*/
|
|
110
|
+
private handleTimelineMousedown;
|
|
111
|
+
/**
|
|
112
|
+
* Scrolls horizontally to the beginning of the target task if the beginning of its content is not in the viewport.
|
|
113
|
+
*/
|
|
114
|
+
private scrollHorizontallyToTask;
|
|
115
|
+
/**
|
|
116
|
+
* Focus the TreeList on TreeList mousedown.
|
|
117
|
+
* A nasty hack to trick `handleTreeListFocusIn` into regarding the previous focus target as again the TreeList.
|
|
118
|
+
* Otherwise cell clicks are wrongly overwritten in `handleTreeListFocusIn` and the click focus target is not respected.
|
|
119
|
+
*/
|
|
120
|
+
private focusTreeList;
|
|
121
|
+
/**
|
|
122
|
+
* Fires the `taskStatusChanges` event with active and focused status retrieved from
|
|
123
|
+
* `this.activeTimelineIndex` and `this.isTimelineFocused`.
|
|
124
|
+
*/
|
|
125
|
+
private notifyTaskStatusChange;
|
|
126
|
+
}
|
|
@@ -0,0 +1,355 @@
|
|
|
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 * as tslib_1 from "tslib";
|
|
6
|
+
import { Injectable, NgZone, Renderer2 } from '@angular/core';
|
|
7
|
+
import { Keys, hasObservers } from '@progress/kendo-angular-common';
|
|
8
|
+
import { Subject } from 'rxjs';
|
|
9
|
+
import { ScrollSyncService } from '../scrolling/scroll-sync.service';
|
|
10
|
+
import { fitToRange, getClosestTaskIndex, isClearButton, isPresent, isTask, isToolbar } from '../utils';
|
|
11
|
+
import { getIndexFromViewDigitKeyCode, isArrowUpDownKey, isExpandCollapseKey, isNavigationKey, isViewDigitKey } from './utils';
|
|
12
|
+
/**
|
|
13
|
+
* @hidden
|
|
14
|
+
*/
|
|
15
|
+
let NavigationService = class NavigationService {
|
|
16
|
+
constructor(zone, renderer, scrollSyncService) {
|
|
17
|
+
this.zone = zone;
|
|
18
|
+
this.renderer = renderer;
|
|
19
|
+
this.scrollSyncService = scrollSyncService;
|
|
20
|
+
/**
|
|
21
|
+
* Notifies when the tasks' focused and interactive (tabindex) state has changed.
|
|
22
|
+
*
|
|
23
|
+
* All tasks are rendered with tabindex="-1".
|
|
24
|
+
* 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.
|
|
25
|
+
* All other tasks should get -1 tabindex and have the focus class removed from them.
|
|
26
|
+
*/
|
|
27
|
+
this.taskStatusChanges = new Subject();
|
|
28
|
+
/**
|
|
29
|
+
* Keeps track of whether the Timeline part is focused.
|
|
30
|
+
* Used when the index of the task elements change (tasks are changed, pushed to, spliced from, etc.)
|
|
31
|
+
* and their status should be updated accordingly.
|
|
32
|
+
*/
|
|
33
|
+
this.isTimelineFocused = false;
|
|
34
|
+
/**
|
|
35
|
+
* Keeps track of which part has last been focused.
|
|
36
|
+
* Used when calling `gantt.focus()` to determine which part of the component should receive focus.
|
|
37
|
+
*/
|
|
38
|
+
this.treeListLastActive = false;
|
|
39
|
+
/**
|
|
40
|
+
* Keeps track of which part has last been focused.
|
|
41
|
+
* Used when calling `gantt.focus()` to determine which part of the component should receive focus.
|
|
42
|
+
*/
|
|
43
|
+
this.timelineLastActive = false;
|
|
44
|
+
this._enabled = false;
|
|
45
|
+
this._activeTimelineIndex = 0;
|
|
46
|
+
this._activeTreeListCell = { rowIndex: 0, colIndex: 0 };
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Specifies whether navigation is enabled.
|
|
50
|
+
*/
|
|
51
|
+
get enabled() {
|
|
52
|
+
return this._enabled;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Used to retrieve read-only data about the currently active task.
|
|
56
|
+
*/
|
|
57
|
+
get activeTask() {
|
|
58
|
+
return {
|
|
59
|
+
activeIndex: this.activeTimelineIndex,
|
|
60
|
+
isFocused: this.isTimelineFocused
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Persists the expected TreeList focused cell coords.
|
|
65
|
+
* When the tasks in the Timeline are navigated through, the expected TreeList focus target should also change,
|
|
66
|
+
* in order to allow back-tabbing from the Timeline to the same row in the TreeList.
|
|
67
|
+
*/
|
|
68
|
+
set activeTreeListCell(cell) {
|
|
69
|
+
this._activeTreeListCell = cell;
|
|
70
|
+
}
|
|
71
|
+
get activeTreeListCell() {
|
|
72
|
+
const firstAvailableIndex = 0;
|
|
73
|
+
const lastAvailableRowIndex = this.treeListHeaderRowsCount + this.gantt.treeList.view.data.length - 1;
|
|
74
|
+
const rowIndex = fitToRange(this._activeTreeListCell.rowIndex, firstAvailableIndex, lastAvailableRowIndex);
|
|
75
|
+
const lastAvailableColIndex = this.gantt.columns.length;
|
|
76
|
+
const colIndex = fitToRange(this._activeTreeListCell.colIndex, firstAvailableIndex, lastAvailableColIndex);
|
|
77
|
+
return { rowIndex, colIndex };
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Persists the expected Timeline focused task index.
|
|
81
|
+
* When the cells in the TreeList are navigated through, the expected Timeline focus target should also change,
|
|
82
|
+
* in order to allow tabbing from the TreeList to the same row in the Timeline.
|
|
83
|
+
*/
|
|
84
|
+
set activeTimelineIndex(index) {
|
|
85
|
+
this._activeTimelineIndex = index;
|
|
86
|
+
}
|
|
87
|
+
get activeTimelineIndex() {
|
|
88
|
+
const firstAvailableIndex = 0;
|
|
89
|
+
const lastAvailableIndex = this.gantt.treeList.view.data.length - 1;
|
|
90
|
+
return fitToRange(this._activeTimelineIndex, firstAvailableIndex, lastAvailableIndex);
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* The TreeList row index takes into account the header and filter rows.
|
|
94
|
+
* Used when translating Timeline task indices to TreeList row indices.
|
|
95
|
+
*/
|
|
96
|
+
get treeListHeaderRowsCount() {
|
|
97
|
+
// captures nested group header rows + filter row if we start supporting it at some point
|
|
98
|
+
return this.treeListElement.querySelectorAll('.k-grid-header tr').length;
|
|
99
|
+
}
|
|
100
|
+
initialize({ gantt, host, treeListElement, timelineElement }) {
|
|
101
|
+
// no private property setters in TypeScript, so use a getter and a poorly named private prop for this value
|
|
102
|
+
this._enabled = true;
|
|
103
|
+
this.gantt = gantt;
|
|
104
|
+
this.host = host;
|
|
105
|
+
this.treeListElement = treeListElement;
|
|
106
|
+
this.timelineElement = timelineElement;
|
|
107
|
+
// TODO: fix in the splitter package and remove
|
|
108
|
+
// move the splitbar HTML element between the two panes to keep the visial tabbing order in tact
|
|
109
|
+
const splitbar = this.host.querySelector('.k-splitbar');
|
|
110
|
+
if (isPresent(splitbar) && isPresent(splitbar.previousElementSibling) && isPresent(splitbar.after)) {
|
|
111
|
+
splitbar.after(splitbar.previousElementSibling);
|
|
112
|
+
}
|
|
113
|
+
this.zone.runOutsideAngular(() => {
|
|
114
|
+
this.eventListenerDisposers = [
|
|
115
|
+
this.renderer.listen(this.host, 'keydown', this.handleKeydown.bind(this)),
|
|
116
|
+
this.renderer.listen(this.treeListElement, 'mousedown', this.focusTreeList.bind(this)),
|
|
117
|
+
this.renderer.listen(this.treeListElement, 'focusin', this.handleTreeListFocusIn.bind(this)),
|
|
118
|
+
this.renderer.listen(this.timelineElement, 'mousedown', this.handleTimelineMousedown.bind(this)),
|
|
119
|
+
this.renderer.listen(this.timelineElement, 'focusin', this.handleTimelineFocusIn.bind(this)),
|
|
120
|
+
this.renderer.listen(this.timelineElement, 'focusout', this.handleTimelineFocusOut.bind(this))
|
|
121
|
+
];
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
ngOnDestroy() {
|
|
125
|
+
if (isPresent(this.eventListenerDisposers)) {
|
|
126
|
+
this.eventListenerDisposers.forEach(removeListener => removeListener());
|
|
127
|
+
this.eventListenerDisposers = null;
|
|
128
|
+
}
|
|
129
|
+
this.gantt = null;
|
|
130
|
+
this.host = null;
|
|
131
|
+
this.treeListElement = null;
|
|
132
|
+
this.timelineElement = null;
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Focuses either the last active TreeList cell, or the last active Timeline task,
|
|
136
|
+
* dependening on which of the two last held focus.
|
|
137
|
+
*
|
|
138
|
+
* Focuses the first TreeList cell by default.
|
|
139
|
+
*/
|
|
140
|
+
focusLastActiveItem() {
|
|
141
|
+
if (this.gantt.data.length === 0 || (!this.treeListLastActive && !this.timelineLastActive)) {
|
|
142
|
+
this.focusCell(0, 0);
|
|
143
|
+
}
|
|
144
|
+
else if (this.treeListLastActive) {
|
|
145
|
+
const { rowIndex, colIndex } = this.activeTreeListCell;
|
|
146
|
+
this.gantt.treeList.focusCell(rowIndex, colIndex);
|
|
147
|
+
}
|
|
148
|
+
else if (this.timelineLastActive) {
|
|
149
|
+
this.focusTask(this.activeTimelineIndex);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* Focuses the targeted TreeList cell regardless of the last peresisted target.
|
|
154
|
+
*/
|
|
155
|
+
focusCell(rowIndex, colIndex) {
|
|
156
|
+
this.activeTreeListCell = { rowIndex, colIndex };
|
|
157
|
+
this.activeTimelineIndex = rowIndex - this.treeListHeaderRowsCount;
|
|
158
|
+
this.gantt.treeList.focusCell(this.activeTreeListCell.rowIndex, this.activeTreeListCell.colIndex);
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Focuses the targeted Timeline task regardless of the last peresisted target.
|
|
162
|
+
*/
|
|
163
|
+
focusTask(index) {
|
|
164
|
+
this.activeTimelineIndex = index;
|
|
165
|
+
this.isTimelineFocused = true;
|
|
166
|
+
this.activeTreeListCell = {
|
|
167
|
+
rowIndex: index + this.treeListHeaderRowsCount,
|
|
168
|
+
colIndex: this.activeTreeListCell.colIndex
|
|
169
|
+
};
|
|
170
|
+
this.notifyTaskStatusChange();
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Updates the focus target flags and notifies the active task to update its focused state.
|
|
174
|
+
*/
|
|
175
|
+
handleTimelineFocusIn({ target }) {
|
|
176
|
+
this.treeListLastActive = false;
|
|
177
|
+
this.timelineLastActive = true;
|
|
178
|
+
this.isTimelineFocused = true;
|
|
179
|
+
if (isTask(target, this.timelineElement)) {
|
|
180
|
+
this.notifyTaskStatusChange();
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* Updates the timeline focus state flag and notifies the active task to update its focused state.
|
|
185
|
+
*/
|
|
186
|
+
handleTimelineFocusOut({ relatedTarget }) {
|
|
187
|
+
this.isTimelineFocused = this.timelineElement.contains(relatedTarget);
|
|
188
|
+
// 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
|
|
189
|
+
if (!isTask(relatedTarget, this.timelineElement)) {
|
|
190
|
+
this.notifyTaskStatusChange();
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* Updates the focus target flags and corrects the TreeList focus target if needed.
|
|
195
|
+
* As the TreeList will keep its last focused cell with tabindex="0",
|
|
196
|
+
* this methods forcefully focuses the correct cell,
|
|
197
|
+
* when navigating in the Timeline has updated the expected TreeList focus target.
|
|
198
|
+
*/
|
|
199
|
+
handleTreeListFocusIn(event) {
|
|
200
|
+
this.treeListLastActive = true;
|
|
201
|
+
this.timelineLastActive = false;
|
|
202
|
+
// if the previous focus target was in the TreeList, rely on its component navigation and just record the focused item index
|
|
203
|
+
if (this.treeListElement.contains(event.relatedTarget)) {
|
|
204
|
+
const { colIndex, rowIndex } = this.gantt.treeList.activeCell;
|
|
205
|
+
this.activeTreeListCell = { colIndex, rowIndex };
|
|
206
|
+
}
|
|
207
|
+
else {
|
|
208
|
+
// if the previous focus target was outside the TreeList, ensure the expected focus coords are used
|
|
209
|
+
const { rowIndex, colIndex } = this.activeTreeListCell;
|
|
210
|
+
this.gantt.treeList.focusCell(rowIndex, colIndex); // activates the target cell even if it has tabindex="-1"
|
|
211
|
+
}
|
|
212
|
+
this.activeTimelineIndex = this.gantt.treeList.activeCell.dataRowIndex;
|
|
213
|
+
this.notifyTaskStatusChange();
|
|
214
|
+
if (this.gantt.treeList.activeCell.dataRowIndex >= 0) {
|
|
215
|
+
this.scrollHorizontallyToTask(this.activeTimelineIndex);
|
|
216
|
+
this.scrollSyncService.syncScrollTop('treelist', 'timeline');
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
handleKeydown(event) {
|
|
220
|
+
const { keyCode, target, altKey } = event;
|
|
221
|
+
const isTimelineActive = this.timelineElement.contains(target);
|
|
222
|
+
if (isTimelineActive) {
|
|
223
|
+
if (isArrowUpDownKey(keyCode)) {
|
|
224
|
+
const direction = keyCode === Keys.ArrowUp ? -1 : 1;
|
|
225
|
+
this.activeTimelineIndex = this.activeTimelineIndex + direction;
|
|
226
|
+
this.activeTreeListCell = {
|
|
227
|
+
rowIndex: this.activeTimelineIndex + this.treeListHeaderRowsCount,
|
|
228
|
+
colIndex: this.activeTreeListCell.colIndex
|
|
229
|
+
};
|
|
230
|
+
}
|
|
231
|
+
else if (keyCode === Keys.Home) {
|
|
232
|
+
this.activeTimelineIndex = 0;
|
|
233
|
+
this.activeTreeListCell = {
|
|
234
|
+
rowIndex: this.activeTimelineIndex + this.treeListHeaderRowsCount,
|
|
235
|
+
colIndex: this.activeTreeListCell.colIndex
|
|
236
|
+
};
|
|
237
|
+
}
|
|
238
|
+
else if (keyCode === Keys.End) {
|
|
239
|
+
const lastAvailableIndex = this.gantt.treeList.view.data.length - 1;
|
|
240
|
+
this.activeTimelineIndex = lastAvailableIndex;
|
|
241
|
+
this.activeTreeListCell = {
|
|
242
|
+
rowIndex: this.activeTimelineIndex + this.treeListHeaderRowsCount,
|
|
243
|
+
colIndex: this.activeTreeListCell.colIndex
|
|
244
|
+
};
|
|
245
|
+
}
|
|
246
|
+
if (isNavigationKey(keyCode)) {
|
|
247
|
+
this.scrollHorizontallyToTask(this.activeTimelineIndex);
|
|
248
|
+
this.scrollSyncService.syncScrollTop('timeline', 'treelist');
|
|
249
|
+
this.notifyTaskStatusChange();
|
|
250
|
+
event.preventDefault();
|
|
251
|
+
}
|
|
252
|
+
if (keyCode === Keys.Space && hasObservers(this.gantt.selectionChange)) {
|
|
253
|
+
const task = this.gantt.renderedTreeListItems[this.activeTimelineIndex];
|
|
254
|
+
const selectionAction = this.gantt.getSelectionAction(event, task);
|
|
255
|
+
if (isPresent(task) && !this.gantt.isSameSelection(selectionAction, task)) {
|
|
256
|
+
this.zone.run(() => this.gantt.notifySelectionChange(task, selectionAction));
|
|
257
|
+
}
|
|
258
|
+
event.preventDefault();
|
|
259
|
+
}
|
|
260
|
+
if (keyCode === Keys.Enter && hasObservers(this.gantt.taskClick)) {
|
|
261
|
+
const task = this.gantt.renderedTreeListItems[this.activeTimelineIndex];
|
|
262
|
+
if (isPresent(task)) {
|
|
263
|
+
this.zone.run(() => this.gantt.notifyTaskClick(event, task, this.activeTimelineIndex));
|
|
264
|
+
}
|
|
265
|
+
event.preventDefault();
|
|
266
|
+
}
|
|
267
|
+
if (isExpandCollapseKey(keyCode, altKey)) {
|
|
268
|
+
const task = this.gantt.renderedTreeListItems[this.activeTimelineIndex];
|
|
269
|
+
if (isPresent(task) && this.gantt.hasChildren(task)) {
|
|
270
|
+
const shouldExpand = keyCode === Keys.ArrowRight;
|
|
271
|
+
const isExpanded = this.gantt.isExpanded(task);
|
|
272
|
+
const sameState = shouldExpand === isExpanded;
|
|
273
|
+
if (!sameState) {
|
|
274
|
+
this.zone.run(() => {
|
|
275
|
+
const expandEvent = { dataItem: task };
|
|
276
|
+
// order is not arbitrary
|
|
277
|
+
// the TreeList emits the individual events first, then the combined `expandStateChange` event
|
|
278
|
+
const individualEmitter = shouldExpand ? this.gantt.rowExpand : this.gantt.rowCollapse;
|
|
279
|
+
individualEmitter.emit(expandEvent);
|
|
280
|
+
this.gantt.expandStateChange.emit(Object.assign({}, expandEvent, { expand: shouldExpand }));
|
|
281
|
+
this.gantt.updateView();
|
|
282
|
+
this.scrollHorizontallyToTask(this.activeTimelineIndex);
|
|
283
|
+
});
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
event.preventDefault();
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
const isTreeListActive = this.treeListElement.contains(target);
|
|
290
|
+
if (keyCode === Keys.Delete && (isTimelineActive || isTreeListActive) && hasObservers(this.gantt.taskDelete)) {
|
|
291
|
+
const taskIndex = isTreeListActive ?
|
|
292
|
+
this.gantt.treeList.activeCell.dataRowIndex :
|
|
293
|
+
this.activeTimelineIndex;
|
|
294
|
+
const task = this.gantt.renderedTreeListItems[taskIndex];
|
|
295
|
+
if (isPresent(task)) {
|
|
296
|
+
this.zone.run(() => this.gantt.notifyTaskDelete(task));
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
if (isViewDigitKey(keyCode) && !isToolbar(target, this.host) && !this.gantt.isInEditMode) {
|
|
300
|
+
const targetViewIndex = getIndexFromViewDigitKeyCode(keyCode);
|
|
301
|
+
const availableViews = this.gantt.views.toArray();
|
|
302
|
+
const targetView = availableViews[targetViewIndex];
|
|
303
|
+
if (isPresent(targetView) && targetView.type !== this.gantt.activeView) {
|
|
304
|
+
this.zone.run(() => this.gantt.changeActiveView(targetView.type));
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
/**
|
|
309
|
+
* Filters for task mousedown in the Timeline.
|
|
310
|
+
*/
|
|
311
|
+
handleTimelineMousedown({ target }) {
|
|
312
|
+
if (isTask(target, this.host) && !isClearButton(target, this.host)) {
|
|
313
|
+
const taskIndex = getClosestTaskIndex(target, this.host);
|
|
314
|
+
this.focusTask(taskIndex);
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
/**
|
|
318
|
+
* Scrolls horizontally to the beginning of the target task if the beginning of its content is not in the viewport.
|
|
319
|
+
*/
|
|
320
|
+
scrollHorizontallyToTask(index) {
|
|
321
|
+
const task = this.timelineElement.querySelectorAll('.k-task-wrap').item(index);
|
|
322
|
+
if (!isPresent(task)) {
|
|
323
|
+
return;
|
|
324
|
+
}
|
|
325
|
+
// scroll horizontally to the item if less than 200px from the beginning of its content are visible
|
|
326
|
+
const targetVisibleWidth = 200;
|
|
327
|
+
const isScrollBeforeTask = (this.timelineElement.clientWidth + this.timelineElement.scrollLeft) < (task.offsetLeft + targetVisibleWidth);
|
|
328
|
+
const isScrollAfterTask = this.timelineElement.scrollLeft > task.offsetLeft;
|
|
329
|
+
if (isScrollBeforeTask || isScrollAfterTask) {
|
|
330
|
+
this.timelineElement.scrollLeft = task.offsetLeft;
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
/**
|
|
334
|
+
* Focus the TreeList on TreeList mousedown.
|
|
335
|
+
* A nasty hack to trick `handleTreeListFocusIn` into regarding the previous focus target as again the TreeList.
|
|
336
|
+
* Otherwise cell clicks are wrongly overwritten in `handleTreeListFocusIn` and the click focus target is not respected.
|
|
337
|
+
*/
|
|
338
|
+
focusTreeList() {
|
|
339
|
+
this.gantt.treeList.focus();
|
|
340
|
+
}
|
|
341
|
+
/**
|
|
342
|
+
* Fires the `taskStatusChanges` event with active and focused status retrieved from
|
|
343
|
+
* `this.activeTimelineIndex` and `this.isTimelineFocused`.
|
|
344
|
+
*/
|
|
345
|
+
notifyTaskStatusChange() {
|
|
346
|
+
this.taskStatusChanges.next(this.activeTask);
|
|
347
|
+
}
|
|
348
|
+
};
|
|
349
|
+
NavigationService = tslib_1.__decorate([
|
|
350
|
+
Injectable(),
|
|
351
|
+
tslib_1.__metadata("design:paramtypes", [NgZone,
|
|
352
|
+
Renderer2,
|
|
353
|
+
ScrollSyncService])
|
|
354
|
+
], NavigationService);
|
|
355
|
+
export { NavigationService };
|
|
@@ -0,0 +1,26 @@
|
|
|
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
|
+
/**
|
|
6
|
+
* @hidden
|
|
7
|
+
*/
|
|
8
|
+
export declare const isArrowUpDownKey: (keyCode: number) => boolean;
|
|
9
|
+
/**
|
|
10
|
+
* @hidden
|
|
11
|
+
*/
|
|
12
|
+
export declare const isNavigationKey: (keyCode: number) => boolean;
|
|
13
|
+
/**
|
|
14
|
+
* @hidden
|
|
15
|
+
*/
|
|
16
|
+
export declare const isExpandCollapseKey: (keyCode: number, altKey: boolean) => boolean;
|
|
17
|
+
/**
|
|
18
|
+
* @hidden
|
|
19
|
+
*/
|
|
20
|
+
export declare const isViewDigitKey: (keyCode: number) => boolean;
|
|
21
|
+
/**
|
|
22
|
+
* @hidden
|
|
23
|
+
*
|
|
24
|
+
* Returns the corresponding view index for the pressed digit key (Digit 1 => 0, Digit 2 => 1, etc.).
|
|
25
|
+
*/
|
|
26
|
+
export declare const getIndexFromViewDigitKeyCode: (keyCode: number) => number;
|
|
@@ -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:
|
|
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';
|
|
@@ -12,6 +13,7 @@ import { GanttTaskBase } from './gantt-task-base';
|
|
|
12
13
|
* @hidden
|
|
13
14
|
*/
|
|
14
15
|
export declare class GanttMilestoneTaskComponent extends GanttTaskBase {
|
|
16
|
+
touchEnabled: boolean;
|
|
15
17
|
milestoneWrapperClass: boolean;
|
|
16
|
-
constructor(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);
|
|
17
19
|
}
|
|
@@ -4,8 +4,10 @@
|
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
5
|
import * as tslib_1 from "tslib";
|
|
6
6
|
var GanttMilestoneTaskComponent_1;
|
|
7
|
-
import { Component, forwardRef, HostBinding, ChangeDetectorRef } from '@angular/core';
|
|
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';
|
|
10
|
+
import { TOUCH_ENABLED } from '../common/touch-enabled';
|
|
9
11
|
import { DependencyDomService } from '../dependencies/dependency-dom.service';
|
|
10
12
|
import { OptionChangesService } from '../common/option-changes.service';
|
|
11
13
|
import { TimelineViewService } from './../timeline/timeline-view.service';
|
|
@@ -14,8 +16,9 @@ import { GanttTaskBase } from './gantt-task-base';
|
|
|
14
16
|
* @hidden
|
|
15
17
|
*/
|
|
16
18
|
let GanttMilestoneTaskComponent = GanttMilestoneTaskComponent_1 = class GanttMilestoneTaskComponent extends GanttTaskBase {
|
|
17
|
-
constructor(mapper, timelineViewService, dependencyDomService, optionChangesService, cdr) {
|
|
18
|
-
super(mapper, timelineViewService, dependencyDomService, optionChangesService, cdr);
|
|
19
|
+
constructor(touchEnabled, mapper, timelineViewService, dependencyDomService, optionChangesService, cdr, navigationService) {
|
|
20
|
+
super(mapper, timelineViewService, dependencyDomService, optionChangesService, cdr, navigationService);
|
|
21
|
+
this.touchEnabled = touchEnabled;
|
|
19
22
|
this.milestoneWrapperClass = true;
|
|
20
23
|
}
|
|
21
24
|
};
|
|
@@ -35,20 +38,44 @@ GanttMilestoneTaskComponent = GanttMilestoneTaskComponent_1 = tslib_1.__decorate
|
|
|
35
38
|
template: `
|
|
36
39
|
<div
|
|
37
40
|
#task
|
|
41
|
+
role="treeitem"
|
|
38
42
|
class="k-task k-task-milestone"
|
|
39
43
|
[ngClass]="taskClass(dataItem)"
|
|
40
|
-
[style.left.px]="taskOffset"
|
|
41
44
|
[attr.title]="mapper.extractFromTask(dataItem, 'title')"
|
|
42
45
|
[class.k-state-selected]="isSelected(dataItem)"
|
|
43
|
-
[attr.
|
|
46
|
+
[attr.aria-selected]="ariaSelected"
|
|
47
|
+
[attr.aria-level]="level + 1"
|
|
44
48
|
>
|
|
45
49
|
</div>
|
|
46
|
-
|
|
50
|
+
<ng-container *ngIf="renderDependencyDragClues">
|
|
51
|
+
<div
|
|
52
|
+
class="k-task-dot k-task-start k-touch-action-none"
|
|
53
|
+
[class.k-display-block]="touchEnabled"
|
|
54
|
+
>
|
|
55
|
+
</div>
|
|
56
|
+
<div
|
|
57
|
+
class="k-task-dot k-task-end k-touch-action-none"
|
|
58
|
+
[class.k-display-block]="touchEnabled"
|
|
59
|
+
>
|
|
60
|
+
</div>
|
|
61
|
+
</ng-container>
|
|
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
|
+
`]
|
|
47
72
|
}),
|
|
48
|
-
tslib_1.
|
|
73
|
+
tslib_1.__param(0, Inject(TOUCH_ENABLED)),
|
|
74
|
+
tslib_1.__metadata("design:paramtypes", [Boolean, MappingService,
|
|
49
75
|
TimelineViewService,
|
|
50
76
|
DependencyDomService,
|
|
51
77
|
OptionChangesService,
|
|
52
|
-
ChangeDetectorRef
|
|
78
|
+
ChangeDetectorRef,
|
|
79
|
+
NavigationService])
|
|
53
80
|
], GanttMilestoneTaskComponent);
|
|
54
81
|
export { GanttMilestoneTaskComponent };
|