@progress/kendo-angular-gantt 0.1.4 → 0.2.0-dev.202111241002
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 -76
- package/dist/cdn/main.js +23 -1
- package/dist/es/columns/column.component.js +5 -0
- package/dist/es/columns/columns.js +1 -0
- package/dist/es/columns/edit-template.directive.js +34 -0
- package/dist/es/columns/span-column.component.js +6 -0
- package/dist/es/common/default-callbacks.js +4 -0
- package/dist/es/editing/edit-dialog.component.js +44 -0
- package/dist/es/editing/edit.service.js +39 -0
- package/dist/es/editing/util.js +17 -0
- package/dist/es/gantt.component.js +478 -22
- package/dist/es/gantt.module.js +62 -5
- package/dist/es/index.js +6 -0
- package/dist/es/localization/custom-messages.component.js +44 -0
- package/dist/es/localization/localized-messages.directive.js +35 -0
- package/dist/es/localization/messages.js +246 -0
- package/dist/es/localization/treelist-messages.directive.js +31 -0
- package/dist/es/main.js +1 -0
- package/dist/es/models/events/cell-click-event.interface.js +4 -0
- package/dist/es/models/events/cell-close-event.interface.js +19 -0
- package/dist/es/models/events/preventable-event.js +32 -0
- package/dist/es/models/events/task-click-event.interface.js +4 -0
- package/dist/es/models/events/task-edit-event.interface.js +4 -0
- package/dist/es/models/gantt-task-model-fields.interface.js +2 -1
- package/dist/es/package-metadata.js +1 -1
- package/dist/es/rendering/gantt-milestone-task.component.js +1 -1
- package/dist/es/rendering/gantt-summary-task.component.js +1 -1
- package/dist/es/rendering/gantt-task-base.js +8 -0
- package/dist/es/rendering/gantt-task.component.js +12 -4
- package/dist/es/rendering/gantt-tasks-table-body.component.js +5 -1
- package/dist/es/selection/selectable.directive.js +141 -0
- package/dist/es/selection/selection-change-event.js +4 -0
- package/dist/es/timeline/gantt-timeline.component.js +5 -1
- package/dist/es/toolbar/view-selector.component.js +7 -4
- package/dist/es/utils.js +48 -1
- package/dist/es2015/columns/column.component.d.ts +2 -0
- package/dist/es2015/columns/column.component.js +5 -0
- package/dist/es2015/columns/columns.d.ts +1 -0
- package/dist/es2015/columns/columns.js +1 -0
- package/dist/es2015/columns/edit-template.directive.d.ts +23 -0
- package/dist/es2015/columns/edit-template.directive.js +33 -0
- package/dist/es2015/columns/span-column.component.d.ts +2 -0
- package/dist/es2015/columns/span-column.component.js +6 -0
- package/dist/es2015/common/default-callbacks.d.ts +4 -0
- package/dist/es2015/common/default-callbacks.js +4 -0
- package/dist/es2015/editing/edit-dialog.component.d.ts +21 -0
- package/dist/es2015/editing/edit-dialog.component.js +86 -0
- package/dist/es2015/editing/edit.service.d.ts +20 -0
- package/dist/es2015/editing/edit.service.js +41 -0
- package/dist/es2015/editing/util.d.ts +10 -0
- package/dist/es2015/editing/util.js +17 -0
- package/dist/es2015/gantt.component.d.ts +236 -12
- package/dist/es2015/gantt.component.js +662 -21
- package/dist/es2015/gantt.module.d.ts +29 -1
- package/dist/es2015/gantt.module.js +62 -5
- package/dist/es2015/index.d.ts +6 -0
- package/dist/es2015/index.js +6 -0
- package/dist/es2015/index.metadata.json +1 -1
- package/dist/es2015/localization/custom-messages.component.d.ts +15 -0
- package/dist/es2015/localization/custom-messages.component.js +36 -0
- package/dist/es2015/localization/localized-messages.directive.d.ts +13 -0
- package/dist/es2015/localization/localized-messages.directive.js +31 -0
- package/dist/es2015/localization/messages.d.ts +246 -0
- package/dist/es2015/localization/messages.js +240 -0
- package/dist/es2015/localization/treelist-messages.directive.d.ts +14 -0
- package/dist/es2015/localization/treelist-messages.directive.js +29 -0
- package/dist/es2015/main.d.ts +2 -0
- package/dist/es2015/main.js +1 -0
- package/dist/es2015/models/events/cell-click-event.interface.d.ts +43 -0
- package/dist/es2015/models/events/cell-click-event.interface.js +4 -0
- package/dist/es2015/models/events/cell-close-event.interface.d.ts +48 -0
- package/dist/es2015/models/events/cell-close-event.interface.js +14 -0
- package/dist/es2015/models/events/preventable-event.d.ts +24 -0
- package/dist/es2015/models/events/preventable-event.js +30 -0
- package/dist/es2015/models/events/task-click-event.interface.d.ts +30 -0
- package/dist/es2015/models/events/task-click-event.interface.js +4 -0
- package/dist/es2015/models/events/task-edit-event.interface.d.ts +46 -0
- package/dist/es2015/models/events/task-edit-event.interface.js +4 -0
- package/dist/es2015/models/gantt-task-model-fields.interface.d.ts +1 -0
- package/dist/es2015/models/gantt-task-model-fields.interface.js +2 -1
- package/dist/es2015/models/models.d.ts +2 -0
- package/dist/es2015/package-metadata.js +1 -1
- package/dist/es2015/rendering/gantt-milestone-task.component.js +2 -0
- package/dist/es2015/rendering/gantt-summary-task.component.js +2 -0
- package/dist/es2015/rendering/gantt-task-base.d.ts +2 -0
- package/dist/es2015/rendering/gantt-task-base.js +8 -0
- package/dist/es2015/rendering/gantt-task.component.d.ts +4 -1
- package/dist/es2015/rendering/gantt-task.component.js +18 -2
- package/dist/es2015/rendering/gantt-tasks-table-body.component.d.ts +1 -0
- package/dist/es2015/rendering/gantt-tasks-table-body.component.js +11 -1
- package/dist/es2015/selection/selectable.directive.d.ts +42 -0
- package/dist/es2015/selection/selectable.directive.js +122 -0
- package/dist/es2015/selection/selection-change-event.d.ts +25 -0
- package/dist/es2015/selection/selection-change-event.js +4 -0
- package/dist/es2015/timeline/gantt-timeline.component.d.ts +1 -0
- package/dist/es2015/timeline/gantt-timeline.component.js +5 -0
- package/dist/es2015/toolbar/view-selector.component.d.ts +3 -0
- package/dist/es2015/toolbar/view-selector.component.js +7 -7
- package/dist/es2015/utils.d.ts +39 -0
- package/dist/es2015/utils.js +48 -1
- package/dist/fesm2015/index.js +1387 -35
- package/dist/fesm5/index.js +1191 -45
- package/dist/npm/columns/column.component.js +5 -0
- package/dist/npm/columns/columns.js +2 -0
- package/dist/npm/columns/edit-template.directive.js +36 -0
- package/dist/npm/columns/span-column.component.js +6 -0
- package/dist/npm/common/default-callbacks.js +4 -0
- package/dist/npm/editing/edit-dialog.component.js +46 -0
- package/dist/npm/editing/edit.service.js +41 -0
- package/dist/npm/editing/util.js +19 -0
- package/dist/npm/gantt.component.js +475 -19
- package/dist/npm/gantt.module.js +61 -4
- package/dist/npm/index.js +12 -0
- package/dist/npm/localization/custom-messages.component.js +46 -0
- package/dist/npm/localization/localized-messages.directive.js +37 -0
- package/dist/npm/localization/messages.js +248 -0
- package/dist/npm/localization/treelist-messages.directive.js +33 -0
- package/dist/npm/main.js +2 -0
- package/dist/npm/models/events/cell-click-event.interface.js +6 -0
- package/dist/npm/models/events/cell-close-event.interface.js +21 -0
- package/dist/npm/models/events/preventable-event.js +34 -0
- package/dist/npm/models/events/task-click-event.interface.js +6 -0
- package/dist/npm/models/events/task-edit-event.interface.js +6 -0
- package/dist/npm/models/gantt-task-model-fields.interface.js +2 -1
- package/dist/npm/package-metadata.js +1 -1
- package/dist/npm/rendering/gantt-milestone-task.component.js +1 -1
- package/dist/npm/rendering/gantt-summary-task.component.js +1 -1
- package/dist/npm/rendering/gantt-task-base.js +8 -0
- package/dist/npm/rendering/gantt-task.component.js +12 -4
- package/dist/npm/rendering/gantt-tasks-table-body.component.js +5 -1
- package/dist/npm/selection/selectable.directive.js +143 -0
- package/dist/npm/selection/selection-change-event.js +6 -0
- package/dist/npm/timeline/gantt-timeline.component.js +5 -1
- package/dist/npm/toolbar/view-selector.component.js +7 -4
- package/dist/npm/utils.js +47 -0
- package/dist/systemjs/kendo-angular-gantt.js +1 -1
- package/package.json +15 -10
|
@@ -3,15 +3,15 @@
|
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
5
|
import * as tslib_1 from "tslib";
|
|
6
|
-
import { Component, forwardRef, HostBinding, Input, Output, EventEmitter, ViewChild, ContentChildren, ContentChild, QueryList, isDevMode, Renderer2 } from '@angular/core';
|
|
7
|
-
import { DataBoundTreeComponent, ExpandableTreeComponent } from '@progress/kendo-angular-treelist';
|
|
8
|
-
import {
|
|
6
|
+
import { Component, forwardRef, HostBinding, Input, Output, EventEmitter, ViewChild, ContentChildren, ContentChild, QueryList, isDevMode, Renderer2, ElementRef, NgZone } from '@angular/core';
|
|
7
|
+
import { TreeListComponent, DataBoundTreeComponent, ExpandableTreeComponent } from '@progress/kendo-angular-treelist';
|
|
8
|
+
import { Day } from '@progress/kendo-date-math';
|
|
9
9
|
import { Subscription } from 'rxjs';
|
|
10
10
|
import { validatePackage } from '@progress/kendo-licensing';
|
|
11
11
|
import { packageMetadata } from './package-metadata';
|
|
12
|
-
import { anyChanged } from '@progress/kendo-angular-common';
|
|
12
|
+
import { anyChanged, hasObservers } from '@progress/kendo-angular-common';
|
|
13
13
|
import { GanttColumnBase } from './columns/columns';
|
|
14
|
-
import { fetchChildren, hasChildren, rowClassCallback, taskClassCallback } from './common/default-callbacks';
|
|
14
|
+
import { fetchChildren, hasChildren, isSelected, rowClassCallback, taskClassCallback } from './common/default-callbacks';
|
|
15
15
|
import { TimelineViewService } from './timeline/timeline-view.service';
|
|
16
16
|
import { TimelineDayViewService } from './timeline/timeline-day-view.service';
|
|
17
17
|
import { TimelineWeekViewService } from './timeline/timeline-week-view.service';
|
|
@@ -20,21 +20,91 @@ import { ScrollSyncService } from './scrolling/scroll-sync.service';
|
|
|
20
20
|
import { DependencyDomService } from './dependencies/dependency-dom.service';
|
|
21
21
|
import { MappingService } from './common/mapping.service';
|
|
22
22
|
import { OptionChangesService } from './common/option-changes.service';
|
|
23
|
-
import {
|
|
23
|
+
import { EditService } from './editing/edit.service';
|
|
24
|
+
import { LocalizationService } from '@progress/kendo-angular-l10n';
|
|
25
|
+
import { getClosestTaskIndex, isClearButton, isColumnGroup, isPresent, isTask, normalizeGanttData, scrollbarWidth } from './utils';
|
|
24
26
|
import { DEFAULT_TIMELINE_PANE_SETTINGS, DEFAULT_TREELIST_PANE_SETTINGS } from './models/splitter-pane-options.interface';
|
|
25
27
|
import { GanttTaskTemplateDirective } from './template-directives/task-template.directive';
|
|
26
28
|
import { GanttSummaryTaskTemplateDirective } from './template-directives/summary-task-template.directive';
|
|
27
29
|
import { GanttTaskContentTemplateDirective } from './template-directives/task-content-template.directive';
|
|
28
30
|
import { ToolbarTemplateDirective } from './toolbar/toolbar-template.directive';
|
|
29
31
|
import { ViewBase } from './timeline/view-base';
|
|
30
|
-
import {
|
|
32
|
+
import { getEditItem } from './editing/util';
|
|
31
33
|
var TREELIST_GROUP_COLUMNS_CLASS = 'k-gantt-treelist-nested-columns';
|
|
32
34
|
var DEFAULT_VIEW = 'week';
|
|
33
35
|
/**
|
|
34
|
-
*
|
|
36
|
+
* Represents the Kendo UI Gantt component for Angular.
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* ```ts-preview
|
|
40
|
+
* _@Component({
|
|
41
|
+
* selector: 'my-app',
|
|
42
|
+
* template: `
|
|
43
|
+
* <kendo-gantt
|
|
44
|
+
* [style.height.px]="500"
|
|
45
|
+
* [kendoGanttHierarchyBinding]="data"
|
|
46
|
+
* childrenField="subtasks"
|
|
47
|
+
* [dependencies]="dependencies">
|
|
48
|
+
* <kendo-gantt-column
|
|
49
|
+
* field="title"
|
|
50
|
+
* title="Task"
|
|
51
|
+
* [width]="200"
|
|
52
|
+
* [expandable]="true"></kendo-gantt-column>
|
|
53
|
+
* <kendo-gantt-column
|
|
54
|
+
* field="start"
|
|
55
|
+
* title="Start"
|
|
56
|
+
* format="dd-MMM-yyyy"
|
|
57
|
+
* [width]="120"></kendo-gantt-column>
|
|
58
|
+
* <kendo-gantt-column
|
|
59
|
+
* field="end"
|
|
60
|
+
* title="End"
|
|
61
|
+
* format="dd-MMM-yyyy"
|
|
62
|
+
* [width]="120"></kendo-gantt-column>
|
|
63
|
+
* <kendo-gantt-timeline-day-view></kendo-gantt-timeline-day-view>
|
|
64
|
+
* <kendo-gantt-timeline-week-view></kendo-gantt-timeline-week-view>
|
|
65
|
+
* <kendo-gantt-timeline-month-view></kendo-gantt-timeline-month-view>
|
|
66
|
+
* </kendo-gantt>
|
|
67
|
+
* `
|
|
68
|
+
* })
|
|
69
|
+
* class AppComponent {
|
|
70
|
+
* public data: Task[] = [{
|
|
71
|
+
* id: 7, title: 'Validation and R&D', start: new Date('2014-06-02T00:00:00.000Z'),
|
|
72
|
+
* end: new Date('2014-06-19T00:00:00.000Z'), completionRatio: 0.45708333333333334,
|
|
73
|
+
* subtasks: [
|
|
74
|
+
* { id: 18, title: 'Project Kickoff', start: new Date('2014-06-02T00:00:00.000Z'),
|
|
75
|
+
* end: new Date('2014-06-02T00:00:00.000Z'), completionRatio: 0.23 },
|
|
76
|
+
* { id: 11, title: 'Research', start: new Date('2014-06-02T00:00:00.000Z'),
|
|
77
|
+
* end: new Date('2014-06-07T00:00:00.000Z'), completionRatio: 0.5766666666666667,
|
|
78
|
+
* subtasks: [
|
|
79
|
+
* { id: 19, title: 'Validation', start: new Date('2014-06-02T00:00:00.000Z'),
|
|
80
|
+
* end: new Date('2014-06-04T00:00:00.000Z'), completionRatio: 0.25 },
|
|
81
|
+
* { id: 39, title: 'Specification', start: new Date('2014-06-04T00:00:00.000Z'),
|
|
82
|
+
* end: new Date('2014-06-07T00:00:00.000Z'), completionRatio: 0.66 }]
|
|
83
|
+
* }, { id: 13, title: 'Implementation', start: new Date('2014-06-08T00:00:00.000Z'),
|
|
84
|
+
* end: new Date('2014-06-19T00:00:00.000Z'), completionRatio: 0.77,
|
|
85
|
+
* subtasks: [
|
|
86
|
+
* { id: 24, title: 'Prototype', start: new Date('2014-06-08T00:00:00.000Z'),
|
|
87
|
+
* end: new Date('2014-06-14T00:00:00.000Z'), completionRatio: 0.77 },
|
|
88
|
+
* { id: 29, title: 'UI and Interaction', start: new Date('2014-06-14T00:00:00.000Z'),
|
|
89
|
+
* end: new Date('2014-06-19T00:00:00.000Z'), completionRatio: 0.6 }]
|
|
90
|
+
* }, { id: 17, title: 'Release', start: new Date('2014-06-19T00:00:00.000Z'),
|
|
91
|
+
* end: new Date('2014-06-19T00:00:00.000Z'), completionRatio: 0 }]
|
|
92
|
+
* }];
|
|
93
|
+
*
|
|
94
|
+
* public dependencies: GanttDependency[] = [
|
|
95
|
+
* { id: 528, fromId: 18, toId: 19, type: DependencyType.FS },
|
|
96
|
+
* { id: 529, fromId: 19, toId: 39, type: DependencyType.FS },
|
|
97
|
+
* { id: 535, fromId: 24, toId: 29, type: DependencyType.FS },
|
|
98
|
+
* { id: 551, fromId: 13, toId: 29, type: DependencyType.FF },
|
|
99
|
+
* { id: 777, fromId: 7, toId: 11, type: DependencyType.SF },
|
|
100
|
+
* { id: 556, fromId: 39, toId: 24, type: DependencyType.FS },
|
|
101
|
+
* { id: 546, fromId: 29, toId: 17, type: DependencyType.FS },
|
|
102
|
+
* ];
|
|
103
|
+
* }
|
|
104
|
+
* ```
|
|
35
105
|
*/
|
|
36
106
|
var GanttComponent = /** @class */ (function () {
|
|
37
|
-
function GanttComponent(timelineViewService, scrollSyncService, renderer, mapper, optionChangesService, dependencyDomService) {
|
|
107
|
+
function GanttComponent(timelineViewService, scrollSyncService, renderer, mapper, optionChangesService, dependencyDomService, editService, localizationService, hostElement, zone) {
|
|
38
108
|
var _this = this;
|
|
39
109
|
this.timelineViewService = timelineViewService;
|
|
40
110
|
this.scrollSyncService = scrollSyncService;
|
|
@@ -42,7 +112,32 @@ var GanttComponent = /** @class */ (function () {
|
|
|
42
112
|
this.mapper = mapper;
|
|
43
113
|
this.optionChangesService = optionChangesService;
|
|
44
114
|
this.dependencyDomService = dependencyDomService;
|
|
115
|
+
this.editService = editService;
|
|
116
|
+
this.localizationService = localizationService;
|
|
117
|
+
this.hostElement = hostElement;
|
|
118
|
+
this.zone = zone;
|
|
45
119
|
this.hostClasses = true;
|
|
120
|
+
/**
|
|
121
|
+
* Provides a callback that determines if the given task is selected ([see example]({% slug selection_gantt %}#toc-custom-selection))
|
|
122
|
+
*
|
|
123
|
+
* > The [`selectable`]({% slug gantt_api_ganttcomponent %}#toc-selectable) prop has to be set to `true` in order for this callback to be executed.
|
|
124
|
+
*/
|
|
125
|
+
this.isSelected = isSelected;
|
|
126
|
+
/**
|
|
127
|
+
* Fires when the Gantt selection is changed through user interaction.
|
|
128
|
+
*
|
|
129
|
+
* Holds data about the affected [`items`]({% slug api_gantt_selectionchangeevent %}#toc-items) and the attempted [`action`]({% slug api_gantt_selectionchangeevent %}#toc-action):
|
|
130
|
+
* - `select` - Triggered on `click` or `ctrl + click` on deselected items.
|
|
131
|
+
* - `remove` - Triggered on `ctrl + click` on selected items.
|
|
132
|
+
*/
|
|
133
|
+
this.selectionChange = new EventEmitter();
|
|
134
|
+
/**
|
|
135
|
+
* Enables or disables the Gantt selection mechanism ([see example]({% slug selection_gantt %}#toc-custom-selection)).
|
|
136
|
+
*
|
|
137
|
+
* > When set to `true`, the [`isSelected`]({% slug gantt_api_ganttcomponent %}#toc-isselected) callback has to be provided.
|
|
138
|
+
* > When applied, the [`SelectableDirective`]({% slug api_gantt_selectabledirective %}) sets `selectable` to `true` internally.
|
|
139
|
+
*/
|
|
140
|
+
this.selectable = false;
|
|
46
141
|
/**
|
|
47
142
|
* The position of the toolbar.
|
|
48
143
|
*
|
|
@@ -129,10 +224,40 @@ var GanttComponent = /** @class */ (function () {
|
|
|
129
224
|
* Fires when an item is expanded.
|
|
130
225
|
*/
|
|
131
226
|
this.rowExpand = new EventEmitter();
|
|
227
|
+
/**
|
|
228
|
+
* Fires when a Gantt task in the timeline pane is double-clicked. The data item, associated with the clicked task,
|
|
229
|
+
* is available in the event data. Use the event handler to open a task editing dialog as necessary.
|
|
230
|
+
*/
|
|
231
|
+
this.taskDblClick = new EventEmitter();
|
|
232
|
+
/**
|
|
233
|
+
* Fires when the user double clicks a cell.
|
|
234
|
+
*/
|
|
235
|
+
this.cellDblClick = new EventEmitter();
|
|
236
|
+
/**
|
|
237
|
+
* Fires when the user leaves an edited cell.
|
|
238
|
+
*/
|
|
239
|
+
this.cellClose = new EventEmitter();
|
|
240
|
+
/**
|
|
241
|
+
* Fires when the end user clicks the `Delete` button in the task editing dialog or the task delete icon.
|
|
242
|
+
* Use the event handler to open a confirmation dialog when necessary.
|
|
243
|
+
*/
|
|
244
|
+
this.taskDelete = new EventEmitter();
|
|
132
245
|
/**
|
|
133
246
|
* Fires when an item is collapsed.
|
|
134
247
|
*/
|
|
135
248
|
this.rowCollapse = new EventEmitter();
|
|
249
|
+
/**
|
|
250
|
+
* Fires when the user confirms deleting a task.
|
|
251
|
+
*/
|
|
252
|
+
this.remove = new EventEmitter();
|
|
253
|
+
/**
|
|
254
|
+
* Fires when the user cancels editing a task.
|
|
255
|
+
*/
|
|
256
|
+
this.cancel = new EventEmitter();
|
|
257
|
+
/**
|
|
258
|
+
* Fires when the user saves an edited task.
|
|
259
|
+
*/
|
|
260
|
+
this.save = new EventEmitter();
|
|
136
261
|
/**
|
|
137
262
|
* Fires when the sorting of the Gantt is changed.
|
|
138
263
|
* You have to handle the event yourself and sort the data.
|
|
@@ -181,12 +306,28 @@ var GanttComponent = /** @class */ (function () {
|
|
|
181
306
|
* Fires when the user changes the locked state of the columns from the column menu or by reordering the columns.
|
|
182
307
|
*/
|
|
183
308
|
this.columnLockedChange = new EventEmitter();
|
|
309
|
+
/**
|
|
310
|
+
* Fires when a cell is clicked.
|
|
311
|
+
*/
|
|
312
|
+
this.cellClick = new EventEmitter();
|
|
313
|
+
/**
|
|
314
|
+
* Fires when a task is clicked.
|
|
315
|
+
*/
|
|
316
|
+
this.taskClick = new EventEmitter();
|
|
184
317
|
/**
|
|
185
318
|
* @hidden
|
|
186
319
|
*
|
|
187
320
|
* Used by the GanttExpandableDirective.
|
|
188
321
|
*/
|
|
189
322
|
this.expandStateChange = new EventEmitter();
|
|
323
|
+
/**
|
|
324
|
+
* @hidden
|
|
325
|
+
*/
|
|
326
|
+
this.showEditingDialog = false;
|
|
327
|
+
/**
|
|
328
|
+
* @hidden
|
|
329
|
+
*/
|
|
330
|
+
this.showConfirmationDialog = false;
|
|
190
331
|
this._columns = new QueryList();
|
|
191
332
|
this._data = [];
|
|
192
333
|
this._timelinePaneOptions = tslib_1.__assign({}, DEFAULT_TIMELINE_PANE_SETTINGS);
|
|
@@ -194,7 +335,9 @@ var GanttComponent = /** @class */ (function () {
|
|
|
194
335
|
this._rowClass = rowClassCallback;
|
|
195
336
|
this._taskClass = taskClassCallback;
|
|
196
337
|
this._activeView = DEFAULT_VIEW;
|
|
338
|
+
this.rtl = false;
|
|
197
339
|
this.optionChangesSubscriptions = new Subscription();
|
|
340
|
+
this.editServiceSubscription = new Subscription();
|
|
198
341
|
validatePackage(packageMetadata);
|
|
199
342
|
this.optionChangesSubscriptions.add(this.optionChangesService.viewChanges.subscribe(function () {
|
|
200
343
|
_this.loadTimelineData();
|
|
@@ -202,6 +345,24 @@ var GanttComponent = /** @class */ (function () {
|
|
|
202
345
|
this.optionChangesSubscriptions.add(this.optionChangesService.columnChanges.subscribe(function () {
|
|
203
346
|
_this.treeList.columns.notifyOnChanges();
|
|
204
347
|
}));
|
|
348
|
+
this.editServiceSubscription.add(this.editService.showEditingDialog.subscribe(function (show) { return _this.showEditingDialog = show; }));
|
|
349
|
+
this.editServiceSubscription.add(this.editService.showConfirmationDialog.subscribe(function () { return _this.taskDelete.emit(); }));
|
|
350
|
+
this.editServiceSubscription.add(this.editService.editEvent.subscribe(function (args) {
|
|
351
|
+
_this[args.editResultType].emit({
|
|
352
|
+
formGroup: args.formGroup,
|
|
353
|
+
item: getEditItem(args.dataItem, _this.treeList.view.data, _this.mapper),
|
|
354
|
+
sender: _this
|
|
355
|
+
});
|
|
356
|
+
_this.showConfirmationDialog = _this.showEditingDialog = false;
|
|
357
|
+
_this.editService.dataItem = _this.editService.formGroup = null;
|
|
358
|
+
_this.updateView();
|
|
359
|
+
_this.dependencyDomService.notifyChanges();
|
|
360
|
+
}));
|
|
361
|
+
this.localizationSubscription = this.localizationService.changes.subscribe(function (_a) {
|
|
362
|
+
var rtl = _a.rtl;
|
|
363
|
+
_this.rtl = rtl;
|
|
364
|
+
_this.direction = _this.rtl ? 'rtl' : 'ltr';
|
|
365
|
+
});
|
|
205
366
|
}
|
|
206
367
|
GanttComponent_1 = GanttComponent;
|
|
207
368
|
Object.defineProperty(GanttComponent.prototype, "toolbarTemplate", {
|
|
@@ -217,6 +378,13 @@ var GanttComponent = /** @class */ (function () {
|
|
|
217
378
|
enumerable: true,
|
|
218
379
|
configurable: true
|
|
219
380
|
});
|
|
381
|
+
Object.defineProperty(GanttComponent.prototype, "dir", {
|
|
382
|
+
get: function () {
|
|
383
|
+
return this.direction;
|
|
384
|
+
},
|
|
385
|
+
enumerable: true,
|
|
386
|
+
configurable: true
|
|
387
|
+
});
|
|
220
388
|
Object.defineProperty(GanttComponent.prototype, "columns", {
|
|
221
389
|
get: function () {
|
|
222
390
|
return this._columns;
|
|
@@ -406,6 +574,19 @@ var GanttComponent = /** @class */ (function () {
|
|
|
406
574
|
enumerable: true,
|
|
407
575
|
configurable: true
|
|
408
576
|
});
|
|
577
|
+
Object.defineProperty(GanttComponent.prototype, "isTaskSelected", {
|
|
578
|
+
/**
|
|
579
|
+
* @hidden
|
|
580
|
+
*
|
|
581
|
+
* Retrieves the `isSelected` callback if `selectable` is set to `true`
|
|
582
|
+
* Otherwise returns the default callback, which always returns `false`.
|
|
583
|
+
*/
|
|
584
|
+
get: function () {
|
|
585
|
+
return this.selectable ? this.isSelected : isSelected;
|
|
586
|
+
},
|
|
587
|
+
enumerable: true,
|
|
588
|
+
configurable: true
|
|
589
|
+
});
|
|
409
590
|
Object.defineProperty(GanttComponent.prototype, "idGetter", {
|
|
410
591
|
/**
|
|
411
592
|
* @hidden
|
|
@@ -432,6 +613,16 @@ var GanttComponent = /** @class */ (function () {
|
|
|
432
613
|
enumerable: true,
|
|
433
614
|
configurable: true
|
|
434
615
|
});
|
|
616
|
+
Object.defineProperty(GanttComponent.prototype, "editDialogFormGroup", {
|
|
617
|
+
/**
|
|
618
|
+
* @hidden
|
|
619
|
+
*/
|
|
620
|
+
get: function () {
|
|
621
|
+
return this.editService.formGroup;
|
|
622
|
+
},
|
|
623
|
+
enumerable: true,
|
|
624
|
+
configurable: true
|
|
625
|
+
});
|
|
435
626
|
GanttComponent.prototype.ngOnChanges = function (changes) {
|
|
436
627
|
if (anyChanged(['data', 'activeView', 'workWeekStart', 'workWeekEnd', 'workDayStart', 'workDayEnd'], changes)) {
|
|
437
628
|
this.loadTimelineData();
|
|
@@ -451,6 +642,10 @@ var GanttComponent = /** @class */ (function () {
|
|
|
451
642
|
};
|
|
452
643
|
GanttComponent.prototype.ngOnDestroy = function () {
|
|
453
644
|
this.optionChangesSubscriptions.unsubscribe();
|
|
645
|
+
this.editServiceSubscription.unsubscribe();
|
|
646
|
+
if (this.localizationSubscription) {
|
|
647
|
+
this.localizationSubscription.unsubscribe();
|
|
648
|
+
}
|
|
454
649
|
};
|
|
455
650
|
/**
|
|
456
651
|
* Applies the minimum possible width for the specified column,
|
|
@@ -500,6 +695,55 @@ var GanttComponent = /** @class */ (function () {
|
|
|
500
695
|
this.treeList.reorderColumn(source, destIndex, options);
|
|
501
696
|
}
|
|
502
697
|
};
|
|
698
|
+
/**
|
|
699
|
+
* Updates the data of the Gantt and forces row-related callbacks to be called anew.
|
|
700
|
+
*/
|
|
701
|
+
GanttComponent.prototype.updateView = function () {
|
|
702
|
+
if (isPresent(this.treeList)) {
|
|
703
|
+
this.treeList.updateView();
|
|
704
|
+
}
|
|
705
|
+
};
|
|
706
|
+
/**
|
|
707
|
+
* Opens the task editing dialog.
|
|
708
|
+
*/
|
|
709
|
+
GanttComponent.prototype.editTask = function (dataItem, formGroup) {
|
|
710
|
+
if (!this.showEditingDialog) {
|
|
711
|
+
this.editService.createEditDialog(dataItem, formGroup);
|
|
712
|
+
}
|
|
713
|
+
};
|
|
714
|
+
/**
|
|
715
|
+
* Closes the task editing dialog.
|
|
716
|
+
*/
|
|
717
|
+
GanttComponent.prototype.closeTaskDialog = function () {
|
|
718
|
+
if (this.showEditingDialog) {
|
|
719
|
+
this.editService.closeEditDialog();
|
|
720
|
+
}
|
|
721
|
+
};
|
|
722
|
+
/**
|
|
723
|
+
* Opens the delete task confirmation dialog.
|
|
724
|
+
*/
|
|
725
|
+
GanttComponent.prototype.openConfirmationDialog = function () {
|
|
726
|
+
this.showConfirmationDialog = true;
|
|
727
|
+
};
|
|
728
|
+
/**
|
|
729
|
+
* Opens a cell for editing.
|
|
730
|
+
*/
|
|
731
|
+
GanttComponent.prototype.editCell = function (dataItem, column, formGroup) {
|
|
732
|
+
this.treeList.editCell(dataItem, column, formGroup);
|
|
733
|
+
};
|
|
734
|
+
/**
|
|
735
|
+
* Closes an edited cell.
|
|
736
|
+
*/
|
|
737
|
+
GanttComponent.prototype.closeCell = function () {
|
|
738
|
+
this.treeList.closeCell();
|
|
739
|
+
};
|
|
740
|
+
/**
|
|
741
|
+
* @hidden
|
|
742
|
+
*/
|
|
743
|
+
GanttComponent.prototype.handleCellClose = function (e) {
|
|
744
|
+
this.cellClose.emit(Object.assign(e, { item: this.editItem, sender: this }));
|
|
745
|
+
this.dependencyDomService.notifyChanges();
|
|
746
|
+
};
|
|
503
747
|
/**
|
|
504
748
|
* @hidden
|
|
505
749
|
*/
|
|
@@ -519,16 +763,6 @@ var GanttComponent = /** @class */ (function () {
|
|
|
519
763
|
this.dependencyDomService.notifyChanges();
|
|
520
764
|
}
|
|
521
765
|
};
|
|
522
|
-
/**
|
|
523
|
-
* @hidden
|
|
524
|
-
*
|
|
525
|
-
* Used by the GanttExpandableDirective.
|
|
526
|
-
*/
|
|
527
|
-
GanttComponent.prototype.updateView = function () {
|
|
528
|
-
if (isPresent(this.treeList)) {
|
|
529
|
-
this.treeList.updateView();
|
|
530
|
-
}
|
|
531
|
-
};
|
|
532
766
|
/**
|
|
533
767
|
* @hidden
|
|
534
768
|
*/
|
|
@@ -563,6 +797,160 @@ var GanttComponent = /** @class */ (function () {
|
|
|
563
797
|
this._timelinePaneOptions.size = e;
|
|
564
798
|
this.timelinePaneSizeChange.emit(e);
|
|
565
799
|
};
|
|
800
|
+
/**
|
|
801
|
+
* @hidden
|
|
802
|
+
*/
|
|
803
|
+
GanttComponent.prototype.handleTimelineRightClick = function (event) {
|
|
804
|
+
var _this = this;
|
|
805
|
+
var target = event.target;
|
|
806
|
+
var gantt = this.hostElement.nativeElement;
|
|
807
|
+
if (!isTask(target, gantt) || isClearButton(target, gantt)) {
|
|
808
|
+
return;
|
|
809
|
+
}
|
|
810
|
+
if (hasObservers(this.taskClick)) {
|
|
811
|
+
var taskIndex_1 = getClosestTaskIndex(target, gantt);
|
|
812
|
+
var task_1 = this.renderedTreeListItems[taskIndex_1];
|
|
813
|
+
this.zone.run(function () { return _this.emitTaskClick(event, task_1, taskIndex_1); });
|
|
814
|
+
}
|
|
815
|
+
};
|
|
816
|
+
/**
|
|
817
|
+
* @hidden
|
|
818
|
+
*/
|
|
819
|
+
GanttComponent.prototype.handleTimelineClick = function (event) {
|
|
820
|
+
var _this = this;
|
|
821
|
+
var target = event.target;
|
|
822
|
+
var gantt = this.hostElement.nativeElement;
|
|
823
|
+
if (!isTask(target, gantt) || isClearButton(target, gantt)) {
|
|
824
|
+
return;
|
|
825
|
+
}
|
|
826
|
+
var taskIndex = getClosestTaskIndex(target, gantt);
|
|
827
|
+
var task = this.renderedTreeListItems[taskIndex];
|
|
828
|
+
var selectionAction = this.getSelectionAction(event, task);
|
|
829
|
+
if ((hasObservers(this.selectionChange) && !this.isSameSelection(selectionAction, task)) ||
|
|
830
|
+
hasObservers(this.taskClick)) {
|
|
831
|
+
this.zone.run(function () {
|
|
832
|
+
_this.emitSelectionChange(task, selectionAction);
|
|
833
|
+
_this.emitTaskClick(event, task, taskIndex);
|
|
834
|
+
});
|
|
835
|
+
}
|
|
836
|
+
};
|
|
837
|
+
/**
|
|
838
|
+
* @hidden
|
|
839
|
+
*/
|
|
840
|
+
GanttComponent.prototype.handleTreeListDoubleClick = function (event) {
|
|
841
|
+
var _this = this;
|
|
842
|
+
if (!isPresent(this.lastTreeListCellClick) || event.target !== this.lastTreeListCellClick.originalEvent.target) {
|
|
843
|
+
return;
|
|
844
|
+
}
|
|
845
|
+
this.editItem = getEditItem(this.lastTreeListCellClick.dataItem, this.treeList.view.data, this.mapper);
|
|
846
|
+
if (hasObservers(this.cellDblClick)) {
|
|
847
|
+
this.zone.run(function () {
|
|
848
|
+
_this.cellDblClick.emit({
|
|
849
|
+
column: _this.lastTreeListCellClick.column,
|
|
850
|
+
columnIndex: _this.lastTreeListCellClick.columnIndex,
|
|
851
|
+
dataItem: _this.lastTreeListCellClick.dataItem,
|
|
852
|
+
isEdited: _this.lastTreeListCellClick.isEdited,
|
|
853
|
+
originalEvent: _this.lastTreeListCellClick.originalEvent,
|
|
854
|
+
rowIndex: _this.lastTreeListCellClick.rowIndex,
|
|
855
|
+
type: 'dblclick',
|
|
856
|
+
sender: _this
|
|
857
|
+
});
|
|
858
|
+
});
|
|
859
|
+
}
|
|
860
|
+
};
|
|
861
|
+
/**
|
|
862
|
+
* @hidden
|
|
863
|
+
*/
|
|
864
|
+
GanttComponent.prototype.handleTreeListSelectionChange = function (event) {
|
|
865
|
+
// prevent selection change from right-click
|
|
866
|
+
if (isPresent(this.lastTreeListCellClick) && this.lastTreeListCellClick.type === 'contextmenu') {
|
|
867
|
+
return;
|
|
868
|
+
}
|
|
869
|
+
var task = event.items.map(function (item) { return item.dataItem; })[0]; // single selection only currently available
|
|
870
|
+
var action = event.action;
|
|
871
|
+
this.emitSelectionChange(task, action);
|
|
872
|
+
};
|
|
873
|
+
/**
|
|
874
|
+
* @hidden
|
|
875
|
+
*/
|
|
876
|
+
GanttComponent.prototype.handleTreeListCellClick = function (event) {
|
|
877
|
+
this.lastTreeListCellClick = event;
|
|
878
|
+
this.cellClick.emit({
|
|
879
|
+
column: event.column,
|
|
880
|
+
columnIndex: event.columnIndex,
|
|
881
|
+
dataItem: event.dataItem,
|
|
882
|
+
isEdited: event.isEdited,
|
|
883
|
+
originalEvent: event.originalEvent,
|
|
884
|
+
rowIndex: event.rowIndex,
|
|
885
|
+
type: event.type,
|
|
886
|
+
sender: this
|
|
887
|
+
});
|
|
888
|
+
};
|
|
889
|
+
/**
|
|
890
|
+
* @hidden
|
|
891
|
+
*/
|
|
892
|
+
GanttComponent.prototype.handleDeleteConfirmation = function () {
|
|
893
|
+
this.editService.triggerEditEvent('remove');
|
|
894
|
+
};
|
|
895
|
+
/**
|
|
896
|
+
* @hidden
|
|
897
|
+
*/
|
|
898
|
+
GanttComponent.prototype.handleTimelineMouseDown = function (event) {
|
|
899
|
+
var target = event.target;
|
|
900
|
+
var gantt = this.hostElement.nativeElement;
|
|
901
|
+
if (!isTask(target, gantt) || isClearButton(target, gantt)) {
|
|
902
|
+
return;
|
|
903
|
+
}
|
|
904
|
+
event.preventDefault();
|
|
905
|
+
};
|
|
906
|
+
/**
|
|
907
|
+
* @hidden
|
|
908
|
+
*/
|
|
909
|
+
GanttComponent.prototype.handleTimelineDblClick = function (event) {
|
|
910
|
+
var _this = this;
|
|
911
|
+
var target = event.target;
|
|
912
|
+
var gantt = this.hostElement.nativeElement;
|
|
913
|
+
if (!isTask(target, gantt) || isClearButton(target, gantt)) {
|
|
914
|
+
return;
|
|
915
|
+
}
|
|
916
|
+
if (hasObservers(this.taskDblClick)) {
|
|
917
|
+
var taskIndex_2 = getClosestTaskIndex(target, gantt);
|
|
918
|
+
var task_2 = this.renderedTreeListItems[taskIndex_2];
|
|
919
|
+
this.zone.run(function () { return _this.taskDblClick.emit({
|
|
920
|
+
dataItem: task_2,
|
|
921
|
+
originalEvent: event,
|
|
922
|
+
sender: _this,
|
|
923
|
+
rowIndex: taskIndex_2,
|
|
924
|
+
type: 'dblclick'
|
|
925
|
+
}); });
|
|
926
|
+
}
|
|
927
|
+
};
|
|
928
|
+
/**
|
|
929
|
+
* @hidden
|
|
930
|
+
*/
|
|
931
|
+
GanttComponent.prototype.getText = function (token) {
|
|
932
|
+
return this.localizationService.get(token);
|
|
933
|
+
};
|
|
934
|
+
GanttComponent.prototype.emitTaskClick = function (event, dataItem, itemIndex) {
|
|
935
|
+
this.taskClick.emit({
|
|
936
|
+
originalEvent: event,
|
|
937
|
+
dataItem: dataItem,
|
|
938
|
+
rowIndex: itemIndex,
|
|
939
|
+
type: event.type,
|
|
940
|
+
sender: this
|
|
941
|
+
});
|
|
942
|
+
};
|
|
943
|
+
GanttComponent.prototype.emitSelectionChange = function (dataItem, action) {
|
|
944
|
+
if (this.isSameSelection(action, dataItem)) {
|
|
945
|
+
return;
|
|
946
|
+
}
|
|
947
|
+
this.selectionChange.emit({
|
|
948
|
+
action: action,
|
|
949
|
+
items: [dataItem],
|
|
950
|
+
sender: this
|
|
951
|
+
});
|
|
952
|
+
this.updateView();
|
|
953
|
+
};
|
|
566
954
|
GanttComponent.prototype.updateTreeListGroupClass = function (columns) {
|
|
567
955
|
if (columns === void 0) { columns = this.columns; }
|
|
568
956
|
if (!isPresent(this.treeList)) {
|
|
@@ -593,6 +981,14 @@ var GanttComponent = /** @class */ (function () {
|
|
|
593
981
|
}
|
|
594
982
|
return this.views.find(function (view) { return view.type === _this.activeView; });
|
|
595
983
|
};
|
|
984
|
+
GanttComponent.prototype.isSameSelection = function (action, dataItem) {
|
|
985
|
+
return action === 'select' && this.isSelected(dataItem);
|
|
986
|
+
};
|
|
987
|
+
GanttComponent.prototype.getSelectionAction = function (_a, dataItem) {
|
|
988
|
+
var ctrlKey = _a.ctrlKey, metaKey = _a.metaKey;
|
|
989
|
+
var shouldToggleSelection = ctrlKey || metaKey;
|
|
990
|
+
return (shouldToggleSelection && this.isSelected(dataItem)) ? 'remove' : 'select';
|
|
991
|
+
};
|
|
596
992
|
var GanttComponent_1;
|
|
597
993
|
tslib_1.__decorate([
|
|
598
994
|
ViewChild(TreeListComponent, { static: true }),
|
|
@@ -618,6 +1014,11 @@ var GanttComponent = /** @class */ (function () {
|
|
|
618
1014
|
HostBinding('class.k-gantt'),
|
|
619
1015
|
tslib_1.__metadata("design:type", Boolean)
|
|
620
1016
|
], GanttComponent.prototype, "hostClasses", void 0);
|
|
1017
|
+
tslib_1.__decorate([
|
|
1018
|
+
HostBinding('attr.dir'),
|
|
1019
|
+
tslib_1.__metadata("design:type", String),
|
|
1020
|
+
tslib_1.__metadata("design:paramtypes", [])
|
|
1021
|
+
], GanttComponent.prototype, "dir", null);
|
|
621
1022
|
tslib_1.__decorate([
|
|
622
1023
|
ContentChildren(GanttColumnBase),
|
|
623
1024
|
tslib_1.__metadata("design:type", QueryList),
|
|
@@ -647,6 +1048,18 @@ var GanttComponent = /** @class */ (function () {
|
|
|
647
1048
|
tslib_1.__metadata("design:type", Array),
|
|
648
1049
|
tslib_1.__metadata("design:paramtypes", [Array])
|
|
649
1050
|
], GanttComponent.prototype, "data", null);
|
|
1051
|
+
tslib_1.__decorate([
|
|
1052
|
+
Input(),
|
|
1053
|
+
tslib_1.__metadata("design:type", Function)
|
|
1054
|
+
], GanttComponent.prototype, "isSelected", void 0);
|
|
1055
|
+
tslib_1.__decorate([
|
|
1056
|
+
Output(),
|
|
1057
|
+
tslib_1.__metadata("design:type", EventEmitter)
|
|
1058
|
+
], GanttComponent.prototype, "selectionChange", void 0);
|
|
1059
|
+
tslib_1.__decorate([
|
|
1060
|
+
Input(),
|
|
1061
|
+
tslib_1.__metadata("design:type", Boolean)
|
|
1062
|
+
], GanttComponent.prototype, "selectable", void 0);
|
|
650
1063
|
tslib_1.__decorate([
|
|
651
1064
|
Input(),
|
|
652
1065
|
tslib_1.__metadata("design:type", String)
|
|
@@ -739,10 +1152,38 @@ var GanttComponent = /** @class */ (function () {
|
|
|
739
1152
|
Output(),
|
|
740
1153
|
tslib_1.__metadata("design:type", EventEmitter)
|
|
741
1154
|
], GanttComponent.prototype, "rowExpand", void 0);
|
|
1155
|
+
tslib_1.__decorate([
|
|
1156
|
+
Output(),
|
|
1157
|
+
tslib_1.__metadata("design:type", EventEmitter)
|
|
1158
|
+
], GanttComponent.prototype, "taskDblClick", void 0);
|
|
1159
|
+
tslib_1.__decorate([
|
|
1160
|
+
Output(),
|
|
1161
|
+
tslib_1.__metadata("design:type", EventEmitter)
|
|
1162
|
+
], GanttComponent.prototype, "cellDblClick", void 0);
|
|
1163
|
+
tslib_1.__decorate([
|
|
1164
|
+
Output(),
|
|
1165
|
+
tslib_1.__metadata("design:type", EventEmitter)
|
|
1166
|
+
], GanttComponent.prototype, "cellClose", void 0);
|
|
1167
|
+
tslib_1.__decorate([
|
|
1168
|
+
Output(),
|
|
1169
|
+
tslib_1.__metadata("design:type", EventEmitter)
|
|
1170
|
+
], GanttComponent.prototype, "taskDelete", void 0);
|
|
742
1171
|
tslib_1.__decorate([
|
|
743
1172
|
Output(),
|
|
744
1173
|
tslib_1.__metadata("design:type", EventEmitter)
|
|
745
1174
|
], GanttComponent.prototype, "rowCollapse", void 0);
|
|
1175
|
+
tslib_1.__decorate([
|
|
1176
|
+
Output(),
|
|
1177
|
+
tslib_1.__metadata("design:type", EventEmitter)
|
|
1178
|
+
], GanttComponent.prototype, "remove", void 0);
|
|
1179
|
+
tslib_1.__decorate([
|
|
1180
|
+
Output(),
|
|
1181
|
+
tslib_1.__metadata("design:type", EventEmitter)
|
|
1182
|
+
], GanttComponent.prototype, "cancel", void 0);
|
|
1183
|
+
tslib_1.__decorate([
|
|
1184
|
+
Output(),
|
|
1185
|
+
tslib_1.__metadata("design:type", EventEmitter)
|
|
1186
|
+
], GanttComponent.prototype, "save", void 0);
|
|
746
1187
|
tslib_1.__decorate([
|
|
747
1188
|
Output(),
|
|
748
1189
|
tslib_1.__metadata("design:type", EventEmitter)
|
|
@@ -787,10 +1228,20 @@ var GanttComponent = /** @class */ (function () {
|
|
|
787
1228
|
Output(),
|
|
788
1229
|
tslib_1.__metadata("design:type", EventEmitter)
|
|
789
1230
|
], GanttComponent.prototype, "columnLockedChange", void 0);
|
|
1231
|
+
tslib_1.__decorate([
|
|
1232
|
+
Output(),
|
|
1233
|
+
tslib_1.__metadata("design:type", EventEmitter)
|
|
1234
|
+
], GanttComponent.prototype, "cellClick", void 0);
|
|
1235
|
+
tslib_1.__decorate([
|
|
1236
|
+
Output(),
|
|
1237
|
+
tslib_1.__metadata("design:type", EventEmitter)
|
|
1238
|
+
], GanttComponent.prototype, "taskClick", void 0);
|
|
790
1239
|
GanttComponent = GanttComponent_1 = tslib_1.__decorate([
|
|
791
1240
|
Component({
|
|
792
1241
|
selector: 'kendo-gantt',
|
|
1242
|
+
exportAs: 'kendoGantt',
|
|
793
1243
|
providers: [
|
|
1244
|
+
LocalizationService,
|
|
794
1245
|
{
|
|
795
1246
|
provide: DataBoundTreeComponent,
|
|
796
1247
|
useExisting: forwardRef(function () { return GanttComponent_1; })
|
|
@@ -806,16 +1257,21 @@ var GanttComponent = /** @class */ (function () {
|
|
|
806
1257
|
ScrollSyncService,
|
|
807
1258
|
DependencyDomService,
|
|
808
1259
|
MappingService,
|
|
809
|
-
OptionChangesService
|
|
1260
|
+
OptionChangesService,
|
|
1261
|
+
EditService
|
|
810
1262
|
],
|
|
811
|
-
template: "\n <kendo-gantt-toolbar\n *ngIf=\"showToolbar('top')\"\n class=\"k-gantt-header k-toolbar k-gantt-toolbar\"\n position=\"top\"></kendo-gantt-toolbar>\n <div class=\"k-gantt-content\">\n <kendo-splitter [style.border]=\"0\">\n <kendo-splitter-pane\n class=\"k-gantt-treelist k-gantt-treelist-scrollable\"\n [collapsible]=\"treeListPaneOptions?.collapsible\"\n [collapsed]=\"treeListPaneOptions?.collapsed\"\n (collapsedChange)=\"onTreeListCollapsedChange($event)\"\n [scrollable]=\"false\">\n <kendo-treelist\n [idField]=\"taskIdField\"\n [columns]=\"columns\"\n [data]=\"data\"\n [hasChildren]=\"hasChildren\"\n [fetchChildren]=\"fetchChildren\"\n [isExpanded]=\"isExpanded\"\n [autoSize]=\"columnsAutoSize\"\n [columnMenu]=\"columnMenu\"\n [reorderable]=\"columnsReorderable\"\n [resizable]=\"columnsResizable\"\n [rowClass]=\"rowClass\"\n [sortable]=\"sortable\"\n [sort]=\"sort\"\n [filterable]=\"filterMenu\"\n [filter]=\"filter\"\n (filterChange)=\"filterChange.emit($event)\"\n (sortChange)=\"sortChange.emit($event)\"\n (dataStateChange)=\"dataStateChange.emit({\n filter: $event.filter,\n sort: $event.sort\n })\"\n (expandStateChange)=\"expandStateChange.emit($event)\"\n (expand)=\"rowExpand.emit({ dataItem: $event.dataItem })\"\n (collapse)=\"rowCollapse.emit({ dataItem: $event.dataItem })\"\n (columnReorder)=\"columnReorder.emit($event)\"\n (columnResize)=\"columnResize.emit($event)\"\n (columnVisibilityChange)=\"handleColumnVisibilityChange($event)\"\n (columnLockedChange)=\"columnLockedChange.emit($event)\"\n >\n </kendo-treelist>\n </kendo-splitter-pane>\n <kendo-splitter-pane\n [collapsible]=\"timelinePaneOptions?.collapsible\"\n [resizable]=\"timelinePaneOptions?.resizable\"\n [collapsed]=\"timelinePaneOptions?.collapsed\"\n [min]=\"timelinePaneOptions?.min\"\n [max]=\"timelinePaneOptions?.max\"\n [size]=\"timelinePaneOptions?.size\"\n (collapsedChange)=\"onTimelineCollapsedChange($event)\"\n (sizeChange)=\"onTimelinePaneSizeChange($event)\"\n [scrollable]=\"false\">\n <kendo-gantt-timeline\n *ngIf=\"views && views.length\"\n [rows]=\"renderedTreeListItems\"\n [slots]=\"timelineSlots\"\n [groupSlots]=\"timelineGroupSlots\"\n [tableWidth]=\"tableWidth\"\n [activeView]=\"activeView\"\n [taskContentTemplate]=\"taskContentTemplate?.templateRef\"\n [taskTemplate]=\"taskTemplate?.templateRef\"\n [summaryTaskTemplate]=\"summaryTaskTemplate?.templateRef\"\n [taskClass]=\"taskClass\"\n [dependencies]=\"dependencies\"\n [hasChildren]=\"hasChildren\"\n ></kendo-gantt-timeline>\n </kendo-splitter-pane>\n </kendo-splitter>\n </div>\n <kendo-gantt-toolbar\n *ngIf=\"showToolbar('bottom')\"\n class=\"k-gantt-footer k-toolbar k-gantt-toolbar\"\n position=\"bottom\"></kendo-gantt-toolbar>\n "
|
|
1263
|
+
template: "\n <ng-container kendoGanttLocalizedMessages\n i18n-taskDeleteLabel=\"kendo.gantt.taskDeleteLabel|The label of the task delete icon\"\n taskDeleteLabel=\"Delete\"\n\n i18n-taskEditingDialogTitle=\"kendo.gantt.taskEditingDialogTitle|The title of the task editing dialog\"\n taskEditingDialogTitle=\"Editing Task\"\n\n i18n-taskEditingDialogCloseTitle=\"kendo.gantt.taskEditingDialogCloseTitle|The title of the task editing dialog close button\"\n taskEditingDialogCloseTitle=\"Close\"\n\n i18n-confirmationDialogCloseTitle=\"kendo.gantt.confirmationDialogCloseTitle|The title of the confirmation dialog close button\"\n confirmationDialogCloseTitle=\"Close\"\n\n i18n-confirmationDialogTitle=\"kendo.gantt.confirmationDialogTitle|The title of the delete task confirmation dialog\"\n confirmationDialogTitle=\"Delete Task\"\n\n i18n-confirmationDialogContent=\"kendo.gantt.confirmationDialogContent|The content of the delete task confirmation dialog\"\n confirmationDialogContent=\"Are you sure you want to delete this task?\"\n\n i18n-deleteButtonText=\"kendo.gantt.deleteButtonText|The text of the task editing dialog 'Delete' button\"\n deleteButtonText=\"Delete\"\n\n i18n-cancelButtonText=\"kendo.gantt.cancelButtonText|The text of the task editing dialog 'Cancel' button\"\n cancelButtonText=\"Cancel\"\n\n i18n-saveButtonText=\"kendo.gantt.saveButtonText|The text of the task editing dialog 'Save' button\"\n saveButtonText=\"Save\"\n\n i18n-titleFieldInputLabel=\"kendo.gantt.titleFieldInputLabel|The label of the 'title' field input in editing mode\"\n titleFieldInputLabel=\"Title\"\n\n i18n-startFieldInputLabel=\"kendo.gantt.startFieldInputLabel|The label of the 'start' field input in editing mode\"\n startFieldInputLabel=\"Start\"\n\n i18n-endFieldInputLabel=\"kendo.gantt.endFieldInputLabel|The label of the 'end' field input in editing mode\"\n endFieldInputLabel=\"End\"\n\n i18n-completionRatioFieldInputLabel=\"kendo.gantt.completionRatioFieldInputLabel|The label of the 'completionRatio' field input in editing mode\"\n completionRatioFieldInputLabel=\"Progress\"\n\n i18n-dayViewText=\"kendo.gantt.dayViewText|The text of the day view in the ViewSelector component\"\n dayViewText=\"Day\"\n\n i18n-weekViewText=\"kendo.gantt.weekViewText|The text of the week view in the ViewSelector component\"\n weekViewText=\"Week\"\n\n i18n-monthViewText=\"kendo.gantt.monthViewText|The text of the month view in the ViewSelector component\"\n monthViewText=\"Month\"\n\n i18n-yearViewText-disabled=\"kendo.gantt.yearViewText|The text of the year view in the ViewSelector component\"\n yearViewText=\"Year\"\n\n i18n-noRecords=\"kendo.gantt.noRecords|The label visible in the TreeList when there are no records\"\n noRecords=\"No records available.\"\n\n i18n-filter=\"kendo.gantt.filter|The label of the filter cell or icon\"\n filter=\"Filter\"\n\n i18n-filterEqOperator=\"kendo.gantt.filterEqOperator|The text of the equal filter operator\"\n filterEqOperator=\"Is equal to\"\n\n i18n-filterNotEqOperator=\"kendo.gantt.filterNotEqOperator|The text of the not equal filter operator\"\n filterNotEqOperator=\"Is not equal to\"\n\n i18n-filterIsNullOperator=\"kendo.gantt.filterIsNullOperator|The text of the is null filter operator\"\n filterIsNullOperator=\"Is null\"\n\n i18n-filterIsNotNullOperator=\"kendo.gantt.filterIsNotNullOperator|The text of the is not null filter operator\"\n filterIsNotNullOperator=\"Is not null\"\n\n i18n-filterIsEmptyOperator=\"kendo.gantt.filterIsEmptyOperator|The text of the is empty filter operator\"\n filterIsEmptyOperator=\"Is empty\"\n\n i18n-filterIsNotEmptyOperator=\"kendo.gantt.filterIsNotEmptyOperator|The text of the is not empty filter operator\"\n filterIsNotEmptyOperator=\"Is not empty\"\n\n i18n-filterStartsWithOperator=\"kendo.gantt.filterStartsWithOperator|The text of the starts with filter operator\"\n filterStartsWithOperator=\"Starts with\"\n\n i18n-filterContainsOperator=\"kendo.gantt.filterContainsOperator|The text of the contains filter operator\"\n filterContainsOperator=\"Contains\"\n\n i18n-filterNotContainsOperator=\"kendo.gantt.filterNotContainsOperator|The text of the does not contain filter operator\"\n filterNotContainsOperator=\"Does not contain\"\n\n i18n-filterEndsWithOperator=\"kendo.gantt.filterEndsWithOperator|The text of the ends with filter operator\"\n filterEndsWithOperator=\"Ends with\"\n\n i18n-filterGteOperator=\"kendo.gantt.filterGteOperator|The text of the greater than or equal filter operator\"\n filterGteOperator=\"Is greater than or equal to\"\n\n i18n-filterGtOperator=\"kendo.gantt.filterGtOperator|The text of the greater than filter operator\"\n filterGtOperator=\"Is greater than\"\n\n i18n-filterLteOperator=\"kendo.gantt.filterLteOperator|The text of the less than or equal filter operator\"\n filterLteOperator=\"Is less than or equal to\"\n\n i18n-filterLtOperator=\"kendo.gantt.filterLtOperator|The text of the less than filter operator\"\n filterLtOperator=\"Is less than\"\n\n i18n-filterIsTrue=\"kendo.gantt.filterIsTrue|The text of the IsTrue boolean filter option\"\n filterIsTrue=\"Is True\"\n\n i18n-filterIsFalse=\"kendo.gantt.filterIsFalse|The text of the IsFalse boolean filter option\"\n filterIsFalse=\"Is False\"\n\n i18n-filterBooleanAll=\"kendo.gantt.filterBooleanAll|The text of the (All) boolean filter option\"\n filterBooleanAll=\"(All)\"\n\n i18n-filterAfterOrEqualOperator=\"kendo.gantt.filterAfterOrEqualOperator|The text of the after or equal date filter operator\"\n filterAfterOrEqualOperator=\"Is after or equal to\"\n\n i18n-filterAfterOperator=\"kendo.gantt.filterAfterOperator|The text of the after date filter operator\"\n filterAfterOperator=\"Is after\"\n\n i18n-filterBeforeOperator=\"kendo.gantt.filterBeforeOperator|The text of the before date filter operator\"\n filterBeforeOperator=\"Is before\"\n\n i18n-filterBeforeOrEqualOperator=\"kendo.gantt.filterBeforeOrEqualOperator|The text of the before or equal date filter operator\"\n filterBeforeOrEqualOperator=\"Is before or equal to\"\n\n i18n-filterFilterButton=\"kendo.gantt.filterFilterButton|The text of the filter button\"\n filterFilterButton=\"Filter\"\n\n i18n-filterClearButton=\"kendo.gantt.filterClearButton|The text of the clear filter button\"\n filterClearButton=\"Clear\"\n\n i18n-filterAndLogic=\"kendo.gantt.filterAndLogic|The text of the And filter logic\"\n filterAndLogic=\"And\"\n\n i18n-filterOrLogic=\"kendo.gantt.filterOrLogic|The text of the Or filter logic\"\n filterOrLogic=\"Or\"\n\n i18n-loading=\"kendo.gantt.loading|The loading text\"\n loading=\"Loading\"\n\n i18n-columnMenu=\"kendo.gantt.columnMenu|The title of the column menu icon\"\n columnMenu=\"Column Menu\"\n\n i18n-columns=\"kendo.gantt.columns|The text shown in the column menu for the columns item\"\n columns=\"Columns\"\n\n i18n-lock-disabled=\"kendo.gantt.lock|The text shown in the column menu for the lock item\"\n lock-disabled=\"Lock\"\n\n i18n-unlock-disabled=\"kendo.gantt.unlock|The text shown in the column menu for the unlock item\"\n unlock-disabled=\"Unlock\"\n\n i18n-sortable=\"kendo.gantt.sortable|The label of the sort icon\"\n sortable=\"Sortable\"\n\n i18n-sortAscending=\"kendo.gantt.sortAscending|The text shown in the column menu for the sort ascending item\"\n sortAscending=\"Sort Ascending\"\n\n i18n-sortDescending=\"kendo.gantt.sortDescending|The text shown in the column menu for the sort descending item\"\n sortDescending=\"Sort Descending\"\n\n i18n-sortedAscending=\"kendo.gantt.sortedAscending|The status announcement when a column is sorted ascending\"\n sortedAscending=\"Sorted Ascending\"\n\n i18n-sortedDescending=\"kendo.gantt.sortedDescending|The status announcement when a column is sorted descending\"\n sortedDescending=\"Sorted Descending\"\n\n i18n-sortedDefault=\"kendo.gantt.sortedDefault|The status announcement when a column is no longer sorted\"\n sortedDefault=\"Not Sorted\"\n\n i18n-columnsApply=\"kendo.gantt.columnsApply|The text shown in the column menu or column chooser for the columns apply button\"\n columnsApply=\"Apply\"\n\n i18n-columnsReset=\"kendo.gantt.columnsReset|The text shown in the column menu or column chooser for the columns reset button\"\n columnsReset=\"Reset\"></ng-container>\n <kendo-gantt-toolbar\n *ngIf=\"showToolbar('top')\"\n class=\"k-gantt-header k-toolbar k-gantt-toolbar\"\n position=\"top\"></kendo-gantt-toolbar>\n <div class=\"k-gantt-content\">\n <kendo-splitter [style.border]=\"0\">\n <kendo-splitter-pane\n class=\"k-gantt-treelist k-gantt-treelist-scrollable\"\n [collapsible]=\"treeListPaneOptions?.collapsible\"\n [collapsed]=\"treeListPaneOptions?.collapsed\"\n (collapsedChange)=\"onTreeListCollapsedChange($event)\"\n [scrollable]=\"false\">\n <kendo-treelist\n [idField]=\"taskIdField\"\n [columns]=\"columns\"\n [data]=\"data\"\n [hasChildren]=\"hasChildren\"\n [fetchChildren]=\"fetchChildren\"\n [isExpanded]=\"isExpanded\"\n [autoSize]=\"columnsAutoSize\"\n [columnMenu]=\"columnMenu\"\n [reorderable]=\"columnsReorderable\"\n [resizable]=\"columnsResizable\"\n [rowClass]=\"rowClass\"\n [isSelected]=\"isSelected\"\n [selectable]=\"selectable\"\n [sortable]=\"sortable\"\n [sort]=\"sort\"\n [filterable]=\"filterMenu\"\n [filter]=\"filter\"\n (filterChange)=\"filterChange.emit($event)\"\n (sortChange)=\"sortChange.emit($event)\"\n (dataStateChange)=\"dataStateChange.emit({\n filter: $event.filter,\n sort: $event.sort\n })\"\n (expandStateChange)=\"expandStateChange.emit($event)\"\n (expand)=\"rowExpand.emit({ dataItem: $event.dataItem })\"\n (collapse)=\"rowCollapse.emit({ dataItem: $event.dataItem })\"\n (columnReorder)=\"columnReorder.emit($event)\"\n (columnResize)=\"columnResize.emit($event)\"\n (columnVisibilityChange)=\"handleColumnVisibilityChange($event)\"\n (columnLockedChange)=\"columnLockedChange.emit($event)\"\n (selectionChange)=\"handleTreeListSelectionChange($event)\"\n (cellClick)=\"handleTreeListCellClick($event)\"\n (cellClose)=\"handleCellClose($event)\"\n [kendoEventsOutsideAngular]=\"{\n dblclick: handleTreeListDoubleClick\n }\"\n [scope]=\"this\"\n >\n <kendo-treelist-messages [kendoGanttTreeListMessages]=\"localizationService\"></kendo-treelist-messages>\n </kendo-treelist>\n </kendo-splitter-pane>\n <kendo-splitter-pane\n [collapsible]=\"timelinePaneOptions?.collapsible\"\n [resizable]=\"timelinePaneOptions?.resizable\"\n [collapsed]=\"timelinePaneOptions?.collapsed\"\n [min]=\"timelinePaneOptions?.min\"\n [max]=\"timelinePaneOptions?.max\"\n [size]=\"timelinePaneOptions?.size\"\n (collapsedChange)=\"onTimelineCollapsedChange($event)\"\n (sizeChange)=\"onTimelinePaneSizeChange($event)\"\n [scrollable]=\"false\">\n <kendo-gantt-timeline\n *ngIf=\"views && views.length\"\n [rows]=\"renderedTreeListItems\"\n [slots]=\"timelineSlots\"\n [groupSlots]=\"timelineGroupSlots\"\n [tableWidth]=\"tableWidth\"\n [activeView]=\"activeView\"\n [taskContentTemplate]=\"taskContentTemplate?.templateRef\"\n [taskTemplate]=\"taskTemplate?.templateRef\"\n [summaryTaskTemplate]=\"summaryTaskTemplate?.templateRef\"\n [taskClass]=\"taskClass\"\n [dependencies]=\"dependencies\"\n [hasChildren]=\"hasChildren\"\n [isTaskSelected]=\"isTaskSelected\"\n [kendoEventsOutsideAngular]=\"{\n click: handleTimelineClick,\n contextmenu: handleTimelineRightClick,\n dblclick: handleTimelineDblClick,\n mousedown: handleTimelineMouseDown\n }\"\n [scope]=\"this\"\n ></kendo-gantt-timeline>\n </kendo-splitter-pane>\n </kendo-splitter>\n </div>\n <kendo-gantt-toolbar\n *ngIf=\"showToolbar('bottom')\"\n class=\"k-gantt-footer k-toolbar k-gantt-toolbar\"\n position=\"bottom\"></kendo-gantt-toolbar>\n <kendo-gantt-edit-dialog *ngIf=\"showEditingDialog\" [formGroup]=\"editDialogFormGroup\"></kendo-gantt-edit-dialog>\n <kendo-dialog\n *ngIf=\"showConfirmationDialog\"\n [width]=\"575\"\n [height]=\"170\"\n [title]=\"getText('confirmationDialogTitle')\"\n (close)=\"showConfirmationDialog = false;\">\n <span>{{getText('confirmationDialogContent')}}</span>\n <kendo-dialog-actions layout=\"normal\">\n <kendo-treelist-spacer></kendo-treelist-spacer>\n <button kendoButton [primary]=\"true\" (click)=\"handleDeleteConfirmation()\">{{ getText('deleteButtonText') }}</button>\n <button kendoButton (click)=\"showConfirmationDialog = false;\">{{ getText('cancelButtonText') }}</button>\n </kendo-dialog-actions>\n </kendo-dialog>\n "
|
|
812
1264
|
}),
|
|
813
1265
|
tslib_1.__metadata("design:paramtypes", [TimelineViewService,
|
|
814
1266
|
ScrollSyncService,
|
|
815
1267
|
Renderer2,
|
|
816
1268
|
MappingService,
|
|
817
1269
|
OptionChangesService,
|
|
818
|
-
DependencyDomService
|
|
1270
|
+
DependencyDomService,
|
|
1271
|
+
EditService,
|
|
1272
|
+
LocalizationService,
|
|
1273
|
+
ElementRef,
|
|
1274
|
+
NgZone])
|
|
819
1275
|
], GanttComponent);
|
|
820
1276
|
return GanttComponent;
|
|
821
1277
|
}());
|