@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
package/dist/es/gantt.module.js
CHANGED
|
@@ -5,11 +5,19 @@
|
|
|
5
5
|
import * as tslib_1 from "tslib";
|
|
6
6
|
import { NgModule } from '@angular/core';
|
|
7
7
|
import { CommonModule } from '@angular/common';
|
|
8
|
-
import {
|
|
8
|
+
import { ReactiveFormsModule } from '@angular/forms';
|
|
9
|
+
import { SplitterModule, TabStripModule } from '@progress/kendo-angular-layout';
|
|
9
10
|
import { TreeListModule } from '@progress/kendo-angular-treelist';
|
|
10
11
|
import { ButtonsModule } from '@progress/kendo-angular-buttons';
|
|
11
|
-
import { EventsModule } from '@progress/kendo-angular-common';
|
|
12
|
+
import { DraggableModule, EventsModule } from '@progress/kendo-angular-common';
|
|
12
13
|
import { DialogModule } from '@progress/kendo-angular-dialog';
|
|
14
|
+
import { LabelModule } from '@progress/kendo-angular-label';
|
|
15
|
+
import { InputsModule } from '@progress/kendo-angular-inputs';
|
|
16
|
+
import { DateInputsModule } from '@progress/kendo-angular-dateinputs';
|
|
17
|
+
import { L10N_PREFIX } from '@progress/kendo-angular-l10n';
|
|
18
|
+
import { PopupModule } from '@progress/kendo-angular-popup';
|
|
19
|
+
import { touchEnabled } from '@progress/kendo-common';
|
|
20
|
+
import { TOUCH_ENABLED } from './common/touch-enabled';
|
|
13
21
|
import { GanttComponent } from './gantt.component';
|
|
14
22
|
import { GanttTimelineComponent } from './timeline/gantt-timeline.component';
|
|
15
23
|
import { GanttTasksTableBodyComponent } from './rendering/gantt-tasks-table-body.component';
|
|
@@ -28,18 +36,21 @@ import { ToolbarComponent } from './toolbar/toolbar.component';
|
|
|
28
36
|
import { ToolbarTemplateDirective } from './toolbar/toolbar-template.directive';
|
|
29
37
|
import { ViewSelectorComponent } from './toolbar/view-selector.component';
|
|
30
38
|
import { GanttDependencyDirective } from './dependencies/gantt-dependency.directive';
|
|
39
|
+
import { DependencyDragCreateDirective } from './dragging/dependency-drag-create.directive';
|
|
40
|
+
import { DragValidationTooltipComponent } from './dragging/drag-validation-tooltip.component';
|
|
41
|
+
import { TimelineScrollableDirective } from './scrolling/timeline-scroll.directive';
|
|
31
42
|
import { GanttColumnComponent, GanttColumnGroupComponent, GanttSpanColumnComponent, FilterMenuTemplateDirective, FilterCellTemplateDirective, CellTemplateDirective, ColumnMenuTemplateDirective, FooterTemplateDirective, HeaderTemplateDirective, EditTemplateDirective } from './columns/columns';
|
|
32
43
|
import { TimelineDayViewComponent } from './timeline/timeline-day-view.component';
|
|
33
44
|
import { TimelineWeekViewComponent } from './timeline/timeline-week-view.component';
|
|
34
45
|
import { TimelineMonthViewComponent } from './timeline/timeline-month-view.component';
|
|
35
46
|
import { EditDialogComponent } from './editing/edit-dialog.component';
|
|
36
|
-
import { ReactiveFormsModule } from '@angular/forms';
|
|
37
|
-
import { LabelModule } from '@progress/kendo-angular-label';
|
|
38
|
-
import { InputsModule } from '@progress/kendo-angular-inputs';
|
|
39
|
-
import { DateInputsModule } from '@progress/kendo-angular-dateinputs';
|
|
40
47
|
import { CustomMessagesComponent } from './localization/custom-messages.component';
|
|
41
|
-
import { L10N_PREFIX } from '@progress/kendo-angular-l10n';
|
|
42
48
|
import { LocalizedMessagesDirective } from './localization/localized-messages.directive';
|
|
49
|
+
import { GanttAddTaskComponent } from './editing/add-task.component';
|
|
50
|
+
import { GridModule } from '@progress/kendo-angular-grid';
|
|
51
|
+
import { DropDownsModule } from '@progress/kendo-angular-dropdowns';
|
|
52
|
+
import { DependenciesTableComponent } from './editing/dependencies-table.component';
|
|
53
|
+
import { TaskFieldsComponent } from './editing/task-fields.component';
|
|
43
54
|
var IMPORTED_MODULES = [
|
|
44
55
|
CommonModule,
|
|
45
56
|
ReactiveFormsModule,
|
|
@@ -51,7 +62,12 @@ var IMPORTED_MODULES = [
|
|
|
51
62
|
TreeListModule,
|
|
52
63
|
ButtonsModule,
|
|
53
64
|
DialogModule,
|
|
54
|
-
EventsModule
|
|
65
|
+
EventsModule,
|
|
66
|
+
PopupModule,
|
|
67
|
+
DraggableModule,
|
|
68
|
+
TabStripModule,
|
|
69
|
+
GridModule,
|
|
70
|
+
DropDownsModule
|
|
55
71
|
];
|
|
56
72
|
var DECLARATIONS = [
|
|
57
73
|
GanttComponent,
|
|
@@ -81,14 +97,21 @@ var DECLARATIONS = [
|
|
|
81
97
|
FooterTemplateDirective,
|
|
82
98
|
GanttExpandableDirective,
|
|
83
99
|
GanttDependencyDirective,
|
|
100
|
+
DependencyDragCreateDirective,
|
|
84
101
|
TimelineDayViewComponent,
|
|
85
102
|
TimelineWeekViewComponent,
|
|
86
103
|
TimelineMonthViewComponent,
|
|
87
104
|
SelectableDirective,
|
|
88
105
|
EditDialogComponent,
|
|
89
106
|
CustomMessagesComponent,
|
|
90
|
-
LocalizedMessagesDirective
|
|
107
|
+
LocalizedMessagesDirective,
|
|
108
|
+
GanttAddTaskComponent,
|
|
109
|
+
DragValidationTooltipComponent,
|
|
110
|
+
TimelineScrollableDirective,
|
|
111
|
+
DependenciesTableComponent,
|
|
112
|
+
TaskFieldsComponent
|
|
91
113
|
];
|
|
114
|
+
var ɵ0 = touchEnabled;
|
|
92
115
|
/**
|
|
93
116
|
* Represents the [NgModule]({{ site.data.urls.angular['ngmoduleapi'] }})
|
|
94
117
|
* definition for the Gantt component.
|
|
@@ -128,12 +151,17 @@ var GanttModule = /** @class */ (function () {
|
|
|
128
151
|
imports: IMPORTED_MODULES.slice(),
|
|
129
152
|
declarations: DECLARATIONS.slice(),
|
|
130
153
|
exports: DECLARATIONS.slice(),
|
|
154
|
+
entryComponents: [DragValidationTooltipComponent],
|
|
131
155
|
providers: [{
|
|
132
156
|
provide: L10N_PREFIX,
|
|
133
157
|
useValue: 'kendo.gantt'
|
|
158
|
+
}, {
|
|
159
|
+
provide: TOUCH_ENABLED,
|
|
160
|
+
useValue: ɵ0
|
|
134
161
|
}]
|
|
135
162
|
})
|
|
136
163
|
], GanttModule);
|
|
137
164
|
return GanttModule;
|
|
138
165
|
}());
|
|
139
166
|
export { GanttModule };
|
|
167
|
+
export { ɵ0 };
|
package/dist/es/index.js
CHANGED
|
@@ -8,14 +8,21 @@
|
|
|
8
8
|
export * from './main';
|
|
9
9
|
export { MappingService } from './common/mapping.service';
|
|
10
10
|
export { OptionChangesService } from './common/option-changes.service';
|
|
11
|
+
export { TOUCH_ENABLED } from './common/touch-enabled';
|
|
11
12
|
export { DependencyDomService } from './dependencies/dependency-dom.service';
|
|
12
13
|
export { GanttDependencyDirective } from './dependencies/gantt-dependency.directive';
|
|
14
|
+
export { DragValidationTooltipComponent } from './dragging/drag-validation-tooltip.component';
|
|
15
|
+
export { GanttAddTaskComponent } from './editing/add-task.component';
|
|
16
|
+
export { DependenciesTableComponent } from './editing/dependencies-table.component';
|
|
13
17
|
export { EditDialogComponent } from './editing/edit-dialog.component';
|
|
14
18
|
export { EditService } from './editing/edit.service';
|
|
19
|
+
export { TaskFieldsComponent } from './editing/task-fields.component';
|
|
15
20
|
export { CustomMessagesComponent } from './localization/custom-messages.component';
|
|
21
|
+
export { GanttLocalizationService } from './localization/gantt-localization.service';
|
|
16
22
|
export { LocalizedMessagesDirective } from './localization/localized-messages.directive';
|
|
17
23
|
export { Messages } from './localization/messages';
|
|
18
24
|
export { PreventableEvent } from './models/events/preventable-event';
|
|
25
|
+
export { NavigationService } from './navigation/navigation.service';
|
|
19
26
|
export { GanttHeaderTableBodyComponent } from './rendering/gantt-header-table-body.component';
|
|
20
27
|
export { GanttMilestoneTaskComponent } from './rendering/gantt-milestone-task.component';
|
|
21
28
|
export { GanttSummaryTaskComponent } from './rendering/gantt-summary-task.component';
|
|
@@ -23,6 +30,8 @@ export { GanttTaskBase } from './rendering/gantt-task-base';
|
|
|
23
30
|
export { GanttTaskComponent } from './rendering/gantt-task.component';
|
|
24
31
|
export { GanttTasksTableBodyComponent } from './rendering/gantt-tasks-table-body.component';
|
|
25
32
|
export { ScrollSyncService } from './scrolling/scroll-sync.service';
|
|
33
|
+
export { TimelineScrollableDirective } from './scrolling/timeline-scroll.directive';
|
|
34
|
+
export { TimelineScrollService } from './scrolling/timeline-scroll.service';
|
|
26
35
|
export { GanttTimelineComponent } from './timeline/gantt-timeline.component';
|
|
27
36
|
export { TimelineBaseViewService } from './timeline/timeline-base-view.service';
|
|
28
37
|
export { TimelineDayViewComponent } from './timeline/timeline-day-view.component';
|
|
@@ -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
|
+
import * as tslib_1 from "tslib";
|
|
6
|
+
import { Injectable } from '@angular/core';
|
|
7
|
+
import { LocalizationService } from '@progress/kendo-angular-l10n';
|
|
8
|
+
/**
|
|
9
|
+
* @hidden
|
|
10
|
+
*
|
|
11
|
+
* Needed to keep the Gantt's LocalizationService reference and be able to use it component's inside the TabStrip
|
|
12
|
+
*/
|
|
13
|
+
var GanttLocalizationService = /** @class */ (function () {
|
|
14
|
+
function GanttLocalizationService(localizationService) {
|
|
15
|
+
this.localizationService = localizationService;
|
|
16
|
+
}
|
|
17
|
+
GanttLocalizationService.prototype.get = function (token) {
|
|
18
|
+
return this.localizationService.get(token);
|
|
19
|
+
};
|
|
20
|
+
GanttLocalizationService = tslib_1.__decorate([
|
|
21
|
+
Injectable(),
|
|
22
|
+
tslib_1.__metadata("design:paramtypes", [LocalizationService])
|
|
23
|
+
], GanttLocalizationService);
|
|
24
|
+
return GanttLocalizationService;
|
|
25
|
+
}());
|
|
26
|
+
export { GanttLocalizationService };
|
|
@@ -13,6 +13,38 @@ var Messages = /** @class */ (function (_super) {
|
|
|
13
13
|
function Messages() {
|
|
14
14
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
15
15
|
}
|
|
16
|
+
tslib_1.__decorate([
|
|
17
|
+
Input(),
|
|
18
|
+
tslib_1.__metadata("design:type", String)
|
|
19
|
+
], Messages.prototype, "taskEditingGeneralTabTitle", void 0);
|
|
20
|
+
tslib_1.__decorate([
|
|
21
|
+
Input(),
|
|
22
|
+
tslib_1.__metadata("design:type", String)
|
|
23
|
+
], Messages.prototype, "taskEditingPredecessorsTabTitle", void 0);
|
|
24
|
+
tslib_1.__decorate([
|
|
25
|
+
Input(),
|
|
26
|
+
tslib_1.__metadata("design:type", String)
|
|
27
|
+
], Messages.prototype, "taskEditingSuccessorsTabTitle", void 0);
|
|
28
|
+
tslib_1.__decorate([
|
|
29
|
+
Input(),
|
|
30
|
+
tslib_1.__metadata("design:type", String)
|
|
31
|
+
], Messages.prototype, "taskEditingDependenciesAddButtonText", void 0);
|
|
32
|
+
tslib_1.__decorate([
|
|
33
|
+
Input(),
|
|
34
|
+
tslib_1.__metadata("design:type", String)
|
|
35
|
+
], Messages.prototype, "taskEditingDependenciesRemoveButtonText", void 0);
|
|
36
|
+
tslib_1.__decorate([
|
|
37
|
+
Input(),
|
|
38
|
+
tslib_1.__metadata("design:type", String)
|
|
39
|
+
], Messages.prototype, "taskEditingDependenciesGridNameColumnTitle", void 0);
|
|
40
|
+
tslib_1.__decorate([
|
|
41
|
+
Input(),
|
|
42
|
+
tslib_1.__metadata("design:type", String)
|
|
43
|
+
], Messages.prototype, "taskEditingDependenciesGridTypeColumnTitle", void 0);
|
|
44
|
+
tslib_1.__decorate([
|
|
45
|
+
Input(),
|
|
46
|
+
tslib_1.__metadata("design:type", String)
|
|
47
|
+
], Messages.prototype, "deleteButtonText", void 0);
|
|
16
48
|
tslib_1.__decorate([
|
|
17
49
|
Input(),
|
|
18
50
|
tslib_1.__metadata("design:type", String)
|
|
@@ -36,7 +68,19 @@ var Messages = /** @class */ (function (_super) {
|
|
|
36
68
|
tslib_1.__decorate([
|
|
37
69
|
Input(),
|
|
38
70
|
tslib_1.__metadata("design:type", String)
|
|
39
|
-
], Messages.prototype, "
|
|
71
|
+
], Messages.prototype, "addTaskText", void 0);
|
|
72
|
+
tslib_1.__decorate([
|
|
73
|
+
Input(),
|
|
74
|
+
tslib_1.__metadata("design:type", String)
|
|
75
|
+
], Messages.prototype, "addChildText", void 0);
|
|
76
|
+
tslib_1.__decorate([
|
|
77
|
+
Input(),
|
|
78
|
+
tslib_1.__metadata("design:type", String)
|
|
79
|
+
], Messages.prototype, "addAboveText", void 0);
|
|
80
|
+
tslib_1.__decorate([
|
|
81
|
+
Input(),
|
|
82
|
+
tslib_1.__metadata("design:type", String)
|
|
83
|
+
], Messages.prototype, "addBelowText", void 0);
|
|
40
84
|
tslib_1.__decorate([
|
|
41
85
|
Input(),
|
|
42
86
|
tslib_1.__metadata("design:type", String)
|
package/dist/es/main.js
CHANGED
|
@@ -7,6 +7,7 @@ export { GanttModule } from './gantt.module';
|
|
|
7
7
|
export { GanttHierarchyBindingDirective } from './binding-directives/hierarchy-binding.directive';
|
|
8
8
|
export { GanttFlatBindingDirective } from './binding-directives/flat-binding.directive';
|
|
9
9
|
export { GanttExpandableDirective } from './expanded-state/expandable.directive';
|
|
10
|
+
export { DependencyDragCreateDirective } from './dragging/dependency-drag-create.directive';
|
|
10
11
|
export { GanttTaskTemplateDirective } from './template-directives/task-template.directive';
|
|
11
12
|
export { GanttTaskContentTemplateDirective } from './template-directives/task-content-template.directive';
|
|
12
13
|
export { GanttSummaryTaskTemplateDirective } from './template-directives/summary-task-template.directive';
|
|
@@ -2,3 +2,19 @@
|
|
|
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
|
+
/**
|
|
6
|
+
* The dependency type when two tasks are connected.
|
|
7
|
+
*
|
|
8
|
+
* The supported values are:
|
|
9
|
+
* * `FF`—from 'finish' to 'finish'
|
|
10
|
+
* * `FS`—from 'finish' to 'start'
|
|
11
|
+
* * `SS`—from 'start' to 'start'
|
|
12
|
+
* * `SF`—from 'start' to 'finish'
|
|
13
|
+
*/
|
|
14
|
+
export var DependencyType;
|
|
15
|
+
(function (DependencyType) {
|
|
16
|
+
DependencyType[DependencyType["FF"] = 0] = "FF";
|
|
17
|
+
DependencyType[DependencyType["FS"] = 1] = "FS";
|
|
18
|
+
DependencyType[DependencyType["SF"] = 2] = "SF";
|
|
19
|
+
DependencyType[DependencyType["SS"] = 3] = "SS"; // task B can't start before task A starts
|
|
20
|
+
})(DependencyType || (DependencyType = {}));
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/dist/es/models/models.js
CHANGED
|
@@ -2,4 +2,5 @@
|
|
|
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
|
+
export { DependencyType } from './dependency-type.enum';
|
|
5
6
|
export { CellCloseEvent } from './events/cell-close-event.interface';
|
|
File without changes
|
package/dist/{es2015/models/events/add-event.interface.js → es/models/view-item.interface.js}
RENAMED
|
File without changes
|
package/dist/{es2015/models/events/edit-event.interface.js → es/navigation/navigation-models.js}
RENAMED
|
File without changes
|
|
@@ -0,0 +1,390 @@
|
|
|
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
|
+
var NavigationService = /** @class */ (function () {
|
|
16
|
+
function NavigationService(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
|
+
Object.defineProperty(NavigationService.prototype, "enabled", {
|
|
49
|
+
/**
|
|
50
|
+
* Specifies whether navigation is enabled.
|
|
51
|
+
*/
|
|
52
|
+
get: function () {
|
|
53
|
+
return this._enabled;
|
|
54
|
+
},
|
|
55
|
+
enumerable: true,
|
|
56
|
+
configurable: true
|
|
57
|
+
});
|
|
58
|
+
Object.defineProperty(NavigationService.prototype, "activeTask", {
|
|
59
|
+
/**
|
|
60
|
+
* Used to retrieve read-only data about the currently active task.
|
|
61
|
+
*/
|
|
62
|
+
get: function () {
|
|
63
|
+
return {
|
|
64
|
+
activeIndex: this.activeTimelineIndex,
|
|
65
|
+
isFocused: this.isTimelineFocused
|
|
66
|
+
};
|
|
67
|
+
},
|
|
68
|
+
enumerable: true,
|
|
69
|
+
configurable: true
|
|
70
|
+
});
|
|
71
|
+
Object.defineProperty(NavigationService.prototype, "activeTreeListCell", {
|
|
72
|
+
get: function () {
|
|
73
|
+
var firstAvailableIndex = 0;
|
|
74
|
+
var lastAvailableRowIndex = this.treeListHeaderRowsCount + this.gantt.treeList.view.data.length - 1;
|
|
75
|
+
var rowIndex = fitToRange(this._activeTreeListCell.rowIndex, firstAvailableIndex, lastAvailableRowIndex);
|
|
76
|
+
var lastAvailableColIndex = this.gantt.columns.length;
|
|
77
|
+
var colIndex = fitToRange(this._activeTreeListCell.colIndex, firstAvailableIndex, lastAvailableColIndex);
|
|
78
|
+
return { rowIndex: rowIndex, colIndex: colIndex };
|
|
79
|
+
},
|
|
80
|
+
/**
|
|
81
|
+
* Persists the expected TreeList focused cell coords.
|
|
82
|
+
* When the tasks in the Timeline are navigated through, the expected TreeList focus target should also change,
|
|
83
|
+
* in order to allow back-tabbing from the Timeline to the same row in the TreeList.
|
|
84
|
+
*/
|
|
85
|
+
set: function (cell) {
|
|
86
|
+
this._activeTreeListCell = cell;
|
|
87
|
+
},
|
|
88
|
+
enumerable: true,
|
|
89
|
+
configurable: true
|
|
90
|
+
});
|
|
91
|
+
Object.defineProperty(NavigationService.prototype, "activeTimelineIndex", {
|
|
92
|
+
get: function () {
|
|
93
|
+
var firstAvailableIndex = 0;
|
|
94
|
+
var lastAvailableIndex = this.gantt.treeList.view.data.length - 1;
|
|
95
|
+
return fitToRange(this._activeTimelineIndex, firstAvailableIndex, lastAvailableIndex);
|
|
96
|
+
},
|
|
97
|
+
/**
|
|
98
|
+
* Persists the expected Timeline focused task index.
|
|
99
|
+
* When the cells in the TreeList are navigated through, the expected Timeline focus target should also change,
|
|
100
|
+
* in order to allow tabbing from the TreeList to the same row in the Timeline.
|
|
101
|
+
*/
|
|
102
|
+
set: function (index) {
|
|
103
|
+
this._activeTimelineIndex = index;
|
|
104
|
+
},
|
|
105
|
+
enumerable: true,
|
|
106
|
+
configurable: true
|
|
107
|
+
});
|
|
108
|
+
Object.defineProperty(NavigationService.prototype, "treeListHeaderRowsCount", {
|
|
109
|
+
/**
|
|
110
|
+
* The TreeList row index takes into account the header and filter rows.
|
|
111
|
+
* Used when translating Timeline task indices to TreeList row indices.
|
|
112
|
+
*/
|
|
113
|
+
get: function () {
|
|
114
|
+
// captures nested group header rows + filter row if we start supporting it at some point
|
|
115
|
+
return this.treeListElement.querySelectorAll('.k-grid-header tr').length;
|
|
116
|
+
},
|
|
117
|
+
enumerable: true,
|
|
118
|
+
configurable: true
|
|
119
|
+
});
|
|
120
|
+
NavigationService.prototype.initialize = function (_a) {
|
|
121
|
+
var _this = this;
|
|
122
|
+
var gantt = _a.gantt, host = _a.host, treeListElement = _a.treeListElement, timelineElement = _a.timelineElement;
|
|
123
|
+
// no private property setters in TypeScript, so use a getter and a poorly named private prop for this value
|
|
124
|
+
this._enabled = true;
|
|
125
|
+
this.gantt = gantt;
|
|
126
|
+
this.host = host;
|
|
127
|
+
this.treeListElement = treeListElement;
|
|
128
|
+
this.timelineElement = timelineElement;
|
|
129
|
+
// TODO: fix in the splitter package and remove
|
|
130
|
+
// move the splitbar HTML element between the two panes to keep the visial tabbing order in tact
|
|
131
|
+
var splitbar = this.host.querySelector('.k-splitbar');
|
|
132
|
+
if (isPresent(splitbar) && isPresent(splitbar.previousElementSibling) && isPresent(splitbar.after)) {
|
|
133
|
+
splitbar.after(splitbar.previousElementSibling);
|
|
134
|
+
}
|
|
135
|
+
this.zone.runOutsideAngular(function () {
|
|
136
|
+
_this.eventListenerDisposers = [
|
|
137
|
+
_this.renderer.listen(_this.host, 'keydown', _this.handleKeydown.bind(_this)),
|
|
138
|
+
_this.renderer.listen(_this.treeListElement, 'mousedown', _this.focusTreeList.bind(_this)),
|
|
139
|
+
_this.renderer.listen(_this.treeListElement, 'focusin', _this.handleTreeListFocusIn.bind(_this)),
|
|
140
|
+
_this.renderer.listen(_this.timelineElement, 'mousedown', _this.handleTimelineMousedown.bind(_this)),
|
|
141
|
+
_this.renderer.listen(_this.timelineElement, 'focusin', _this.handleTimelineFocusIn.bind(_this)),
|
|
142
|
+
_this.renderer.listen(_this.timelineElement, 'focusout', _this.handleTimelineFocusOut.bind(_this))
|
|
143
|
+
];
|
|
144
|
+
});
|
|
145
|
+
};
|
|
146
|
+
NavigationService.prototype.ngOnDestroy = function () {
|
|
147
|
+
if (isPresent(this.eventListenerDisposers)) {
|
|
148
|
+
this.eventListenerDisposers.forEach(function (removeListener) { return removeListener(); });
|
|
149
|
+
this.eventListenerDisposers = null;
|
|
150
|
+
}
|
|
151
|
+
this.gantt = null;
|
|
152
|
+
this.host = null;
|
|
153
|
+
this.treeListElement = null;
|
|
154
|
+
this.timelineElement = null;
|
|
155
|
+
};
|
|
156
|
+
/**
|
|
157
|
+
* Focuses either the last active TreeList cell, or the last active Timeline task,
|
|
158
|
+
* dependening on which of the two last held focus.
|
|
159
|
+
*
|
|
160
|
+
* Focuses the first TreeList cell by default.
|
|
161
|
+
*/
|
|
162
|
+
NavigationService.prototype.focusLastActiveItem = function () {
|
|
163
|
+
if (this.gantt.data.length === 0 || (!this.treeListLastActive && !this.timelineLastActive)) {
|
|
164
|
+
this.focusCell(0, 0);
|
|
165
|
+
}
|
|
166
|
+
else if (this.treeListLastActive) {
|
|
167
|
+
var _a = this.activeTreeListCell, rowIndex = _a.rowIndex, colIndex = _a.colIndex;
|
|
168
|
+
this.gantt.treeList.focusCell(rowIndex, colIndex);
|
|
169
|
+
}
|
|
170
|
+
else if (this.timelineLastActive) {
|
|
171
|
+
this.focusTask(this.activeTimelineIndex);
|
|
172
|
+
}
|
|
173
|
+
};
|
|
174
|
+
/**
|
|
175
|
+
* Focuses the targeted TreeList cell regardless of the last peresisted target.
|
|
176
|
+
*/
|
|
177
|
+
NavigationService.prototype.focusCell = function (rowIndex, colIndex) {
|
|
178
|
+
this.activeTreeListCell = { rowIndex: rowIndex, colIndex: colIndex };
|
|
179
|
+
this.activeTimelineIndex = rowIndex - this.treeListHeaderRowsCount;
|
|
180
|
+
this.gantt.treeList.focusCell(this.activeTreeListCell.rowIndex, this.activeTreeListCell.colIndex);
|
|
181
|
+
};
|
|
182
|
+
/**
|
|
183
|
+
* Focuses the targeted Timeline task regardless of the last peresisted target.
|
|
184
|
+
*/
|
|
185
|
+
NavigationService.prototype.focusTask = function (index) {
|
|
186
|
+
this.activeTimelineIndex = index;
|
|
187
|
+
this.isTimelineFocused = true;
|
|
188
|
+
this.activeTreeListCell = {
|
|
189
|
+
rowIndex: index + this.treeListHeaderRowsCount,
|
|
190
|
+
colIndex: this.activeTreeListCell.colIndex
|
|
191
|
+
};
|
|
192
|
+
this.notifyTaskStatusChange();
|
|
193
|
+
};
|
|
194
|
+
/**
|
|
195
|
+
* Updates the focus target flags and notifies the active task to update its focused state.
|
|
196
|
+
*/
|
|
197
|
+
NavigationService.prototype.handleTimelineFocusIn = function (_a) {
|
|
198
|
+
var target = _a.target;
|
|
199
|
+
this.treeListLastActive = false;
|
|
200
|
+
this.timelineLastActive = true;
|
|
201
|
+
this.isTimelineFocused = true;
|
|
202
|
+
if (isTask(target, this.timelineElement)) {
|
|
203
|
+
this.notifyTaskStatusChange();
|
|
204
|
+
}
|
|
205
|
+
};
|
|
206
|
+
/**
|
|
207
|
+
* Updates the timeline focus state flag and notifies the active task to update its focused state.
|
|
208
|
+
*/
|
|
209
|
+
NavigationService.prototype.handleTimelineFocusOut = function (_a) {
|
|
210
|
+
var relatedTarget = _a.relatedTarget;
|
|
211
|
+
this.isTimelineFocused = this.timelineElement.contains(relatedTarget);
|
|
212
|
+
// 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
|
|
213
|
+
if (!isTask(relatedTarget, this.timelineElement)) {
|
|
214
|
+
this.notifyTaskStatusChange();
|
|
215
|
+
}
|
|
216
|
+
};
|
|
217
|
+
/**
|
|
218
|
+
* Updates the focus target flags and corrects the TreeList focus target if needed.
|
|
219
|
+
* As the TreeList will keep its last focused cell with tabindex="0",
|
|
220
|
+
* this methods forcefully focuses the correct cell,
|
|
221
|
+
* when navigating in the Timeline has updated the expected TreeList focus target.
|
|
222
|
+
*/
|
|
223
|
+
NavigationService.prototype.handleTreeListFocusIn = function (event) {
|
|
224
|
+
this.treeListLastActive = true;
|
|
225
|
+
this.timelineLastActive = false;
|
|
226
|
+
// if the previous focus target was in the TreeList, rely on its component navigation and just record the focused item index
|
|
227
|
+
if (this.treeListElement.contains(event.relatedTarget)) {
|
|
228
|
+
var _a = this.gantt.treeList.activeCell, colIndex = _a.colIndex, rowIndex = _a.rowIndex;
|
|
229
|
+
this.activeTreeListCell = { colIndex: colIndex, rowIndex: rowIndex };
|
|
230
|
+
}
|
|
231
|
+
else {
|
|
232
|
+
// if the previous focus target was outside the TreeList, ensure the expected focus coords are used
|
|
233
|
+
var _b = this.activeTreeListCell, rowIndex = _b.rowIndex, colIndex = _b.colIndex;
|
|
234
|
+
this.gantt.treeList.focusCell(rowIndex, colIndex); // activates the target cell even if it has tabindex="-1"
|
|
235
|
+
}
|
|
236
|
+
this.activeTimelineIndex = this.gantt.treeList.activeCell.dataRowIndex;
|
|
237
|
+
this.notifyTaskStatusChange();
|
|
238
|
+
if (this.gantt.treeList.activeCell.dataRowIndex >= 0) {
|
|
239
|
+
this.scrollHorizontallyToTask(this.activeTimelineIndex);
|
|
240
|
+
this.scrollSyncService.syncScrollTop('treelist', 'timeline');
|
|
241
|
+
}
|
|
242
|
+
};
|
|
243
|
+
NavigationService.prototype.handleKeydown = function (event) {
|
|
244
|
+
var _this = this;
|
|
245
|
+
var _a = event, keyCode = _a.keyCode, target = _a.target, altKey = _a.altKey;
|
|
246
|
+
var isTimelineActive = this.timelineElement.contains(target);
|
|
247
|
+
if (isTimelineActive) {
|
|
248
|
+
if (isArrowUpDownKey(keyCode)) {
|
|
249
|
+
var direction = keyCode === Keys.ArrowUp ? -1 : 1;
|
|
250
|
+
this.activeTimelineIndex = this.activeTimelineIndex + direction;
|
|
251
|
+
this.activeTreeListCell = {
|
|
252
|
+
rowIndex: this.activeTimelineIndex + this.treeListHeaderRowsCount,
|
|
253
|
+
colIndex: this.activeTreeListCell.colIndex
|
|
254
|
+
};
|
|
255
|
+
}
|
|
256
|
+
else if (keyCode === Keys.Home) {
|
|
257
|
+
this.activeTimelineIndex = 0;
|
|
258
|
+
this.activeTreeListCell = {
|
|
259
|
+
rowIndex: this.activeTimelineIndex + this.treeListHeaderRowsCount,
|
|
260
|
+
colIndex: this.activeTreeListCell.colIndex
|
|
261
|
+
};
|
|
262
|
+
}
|
|
263
|
+
else if (keyCode === Keys.End) {
|
|
264
|
+
var lastAvailableIndex = this.gantt.treeList.view.data.length - 1;
|
|
265
|
+
this.activeTimelineIndex = lastAvailableIndex;
|
|
266
|
+
this.activeTreeListCell = {
|
|
267
|
+
rowIndex: this.activeTimelineIndex + this.treeListHeaderRowsCount,
|
|
268
|
+
colIndex: this.activeTreeListCell.colIndex
|
|
269
|
+
};
|
|
270
|
+
}
|
|
271
|
+
if (isNavigationKey(keyCode)) {
|
|
272
|
+
this.scrollHorizontallyToTask(this.activeTimelineIndex);
|
|
273
|
+
this.scrollSyncService.syncScrollTop('timeline', 'treelist');
|
|
274
|
+
this.notifyTaskStatusChange();
|
|
275
|
+
event.preventDefault();
|
|
276
|
+
}
|
|
277
|
+
if (keyCode === Keys.Space && hasObservers(this.gantt.selectionChange)) {
|
|
278
|
+
var task_1 = this.gantt.renderedTreeListItems[this.activeTimelineIndex];
|
|
279
|
+
var selectionAction_1 = this.gantt.getSelectionAction(event, task_1);
|
|
280
|
+
if (isPresent(task_1) && !this.gantt.isSameSelection(selectionAction_1, task_1)) {
|
|
281
|
+
this.zone.run(function () {
|
|
282
|
+
return _this.gantt.notifySelectionChange(task_1, selectionAction_1);
|
|
283
|
+
});
|
|
284
|
+
}
|
|
285
|
+
event.preventDefault();
|
|
286
|
+
}
|
|
287
|
+
if (keyCode === Keys.Enter && hasObservers(this.gantt.taskClick)) {
|
|
288
|
+
var task_2 = this.gantt.renderedTreeListItems[this.activeTimelineIndex];
|
|
289
|
+
if (isPresent(task_2)) {
|
|
290
|
+
this.zone.run(function () {
|
|
291
|
+
return _this.gantt.notifyTaskClick(event, task_2, _this.activeTimelineIndex);
|
|
292
|
+
});
|
|
293
|
+
}
|
|
294
|
+
event.preventDefault();
|
|
295
|
+
}
|
|
296
|
+
if (isExpandCollapseKey(keyCode, altKey)) {
|
|
297
|
+
var task_3 = this.gantt.renderedTreeListItems[this.activeTimelineIndex];
|
|
298
|
+
if (isPresent(task_3) && this.gantt.hasChildren(task_3)) {
|
|
299
|
+
var shouldExpand_1 = keyCode === Keys.ArrowRight;
|
|
300
|
+
var isExpanded = this.gantt.isExpanded(task_3);
|
|
301
|
+
var sameState = shouldExpand_1 === isExpanded;
|
|
302
|
+
if (!sameState) {
|
|
303
|
+
this.zone.run(function () {
|
|
304
|
+
var expandEvent = { dataItem: task_3 };
|
|
305
|
+
// order is not arbitrary
|
|
306
|
+
// the TreeList emits the individual events first, then the combined `expandStateChange` event
|
|
307
|
+
var individualEmitter = shouldExpand_1 ? _this.gantt.rowExpand : _this.gantt.rowCollapse;
|
|
308
|
+
individualEmitter.emit(expandEvent);
|
|
309
|
+
_this.gantt.expandStateChange.emit(tslib_1.__assign({}, expandEvent, { expand: shouldExpand_1 }));
|
|
310
|
+
_this.gantt.updateView();
|
|
311
|
+
_this.scrollHorizontallyToTask(_this.activeTimelineIndex);
|
|
312
|
+
});
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
event.preventDefault();
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
var isTreeListActive = this.treeListElement.contains(target);
|
|
319
|
+
if (keyCode === Keys.Delete && (isTimelineActive || isTreeListActive) && hasObservers(this.gantt.taskDelete)) {
|
|
320
|
+
var taskIndex = isTreeListActive ?
|
|
321
|
+
this.gantt.treeList.activeCell.dataRowIndex :
|
|
322
|
+
this.activeTimelineIndex;
|
|
323
|
+
var task_4 = this.gantt.renderedTreeListItems[taskIndex];
|
|
324
|
+
if (isPresent(task_4)) {
|
|
325
|
+
this.zone.run(function () {
|
|
326
|
+
return _this.gantt.notifyTaskDelete(task_4);
|
|
327
|
+
});
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
if (isViewDigitKey(keyCode) && !isToolbar(target, this.host) && !this.gantt.isInEditMode) {
|
|
331
|
+
var targetViewIndex = getIndexFromViewDigitKeyCode(keyCode);
|
|
332
|
+
var availableViews = this.gantt.views.toArray();
|
|
333
|
+
var targetView_1 = availableViews[targetViewIndex];
|
|
334
|
+
if (isPresent(targetView_1) && targetView_1.type !== this.gantt.activeView) {
|
|
335
|
+
this.zone.run(function () {
|
|
336
|
+
return _this.gantt.changeActiveView(targetView_1.type);
|
|
337
|
+
});
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
};
|
|
341
|
+
/**
|
|
342
|
+
* Filters for task mousedown in the Timeline.
|
|
343
|
+
*/
|
|
344
|
+
NavigationService.prototype.handleTimelineMousedown = function (_a) {
|
|
345
|
+
var target = _a.target;
|
|
346
|
+
if (isTask(target, this.host) && !isClearButton(target, this.host)) {
|
|
347
|
+
var taskIndex = getClosestTaskIndex(target, this.host);
|
|
348
|
+
this.focusTask(taskIndex);
|
|
349
|
+
}
|
|
350
|
+
};
|
|
351
|
+
/**
|
|
352
|
+
* Scrolls horizontally to the beginning of the target task if the beginning of its content is not in the viewport.
|
|
353
|
+
*/
|
|
354
|
+
NavigationService.prototype.scrollHorizontallyToTask = function (index) {
|
|
355
|
+
var task = this.timelineElement.querySelectorAll('.k-task-wrap').item(index);
|
|
356
|
+
if (!isPresent(task)) {
|
|
357
|
+
return;
|
|
358
|
+
}
|
|
359
|
+
// scroll horizontally to the item if less than 200px from the beginning of its content are visible
|
|
360
|
+
var targetVisibleWidth = 200;
|
|
361
|
+
var isScrollBeforeTask = (this.timelineElement.clientWidth + this.timelineElement.scrollLeft) < (task.offsetLeft + targetVisibleWidth);
|
|
362
|
+
var isScrollAfterTask = this.timelineElement.scrollLeft > task.offsetLeft;
|
|
363
|
+
if (isScrollBeforeTask || isScrollAfterTask) {
|
|
364
|
+
this.timelineElement.scrollLeft = task.offsetLeft;
|
|
365
|
+
}
|
|
366
|
+
};
|
|
367
|
+
/**
|
|
368
|
+
* Focus the TreeList on TreeList mousedown.
|
|
369
|
+
* A nasty hack to trick `handleTreeListFocusIn` into regarding the previous focus target as again the TreeList.
|
|
370
|
+
* Otherwise cell clicks are wrongly overwritten in `handleTreeListFocusIn` and the click focus target is not respected.
|
|
371
|
+
*/
|
|
372
|
+
NavigationService.prototype.focusTreeList = function () {
|
|
373
|
+
this.gantt.treeList.focus();
|
|
374
|
+
};
|
|
375
|
+
/**
|
|
376
|
+
* Fires the `taskStatusChanges` event with active and focused status retrieved from
|
|
377
|
+
* `this.activeTimelineIndex` and `this.isTimelineFocused`.
|
|
378
|
+
*/
|
|
379
|
+
NavigationService.prototype.notifyTaskStatusChange = function () {
|
|
380
|
+
this.taskStatusChanges.next(this.activeTask);
|
|
381
|
+
};
|
|
382
|
+
NavigationService = tslib_1.__decorate([
|
|
383
|
+
Injectable(),
|
|
384
|
+
tslib_1.__metadata("design:paramtypes", [NgZone,
|
|
385
|
+
Renderer2,
|
|
386
|
+
ScrollSyncService])
|
|
387
|
+
], NavigationService);
|
|
388
|
+
return NavigationService;
|
|
389
|
+
}());
|
|
390
|
+
export { NavigationService };
|