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