@progress/kendo-angular-gantt 0.3.0-dev.202201111723 → 0.3.0-dev.202201131518
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cdn/js/kendo-angular-gantt.js +2 -2
- package/dist/cdn/main.js +4 -10
- 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/{util.js → utils.js} +0 -0
- package/dist/es/gantt.component.js +125 -7
- package/dist/es/gantt.module.js +23 -6
- package/dist/es/index.js +4 -0
- package/dist/es/main.js +1 -0
- package/dist/es/models/events/dependency-add-event.interface.js +4 -0
- package/dist/es/models/view-item.interface.js +4 -0
- package/dist/es/package-metadata.js +1 -1
- package/dist/es/rendering/gantt-milestone-task.component.js +7 -4
- package/dist/es/rendering/gantt-summary-task.component.js +7 -4
- package/dist/es/rendering/gantt-task-base.js +30 -19
- package/dist/es/rendering/gantt-task.component.js +8 -6
- package/dist/es/rendering/gantt-tasks-table-body.component.js +5 -1
- 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 +45 -3
- package/dist/es/utils.js +143 -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/{util.d.ts → utils.d.ts} +0 -0
- package/dist/es2015/editing/{util.js → utils.js} +0 -0
- package/dist/es2015/gantt.component.d.ts +39 -3
- package/dist/es2015/gantt.component.js +117 -6
- package/dist/es2015/gantt.module.js +23 -6
- package/dist/es2015/index.d.ts +4 -0
- package/dist/es2015/index.js +4 -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/models.d.ts +2 -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/package-metadata.js +1 -1
- package/dist/es2015/rendering/gantt-milestone-task.component.d.ts +2 -1
- package/dist/es2015/rendering/gantt-milestone-task.component.js +18 -5
- package/dist/es2015/rendering/gantt-summary-task.component.d.ts +2 -1
- package/dist/es2015/rendering/gantt-summary-task.component.js +18 -5
- package/dist/es2015/rendering/gantt-task-base.d.ts +11 -5
- package/dist/es2015/rendering/gantt-task-base.js +30 -19
- package/dist/es2015/rendering/gantt-task.component.d.ts +2 -1
- package/dist/es2015/rendering/gantt-task.component.js +19 -7
- package/dist/es2015/rendering/gantt-tasks-table-body.component.d.ts +1 -0
- package/dist/es2015/rendering/gantt-tasks-table-body.component.js +10 -3
- 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/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 +25 -2
- package/dist/es2015/timeline/gantt-timeline.component.js +56 -3
- package/dist/es2015/utils.d.ts +70 -8
- package/dist/es2015/utils.js +143 -12
- package/dist/fesm2015/index.js +1337 -372
- package/dist/fesm5/index.js +1206 -298
- 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/{util.js → utils.js} +0 -0
- package/dist/npm/gantt.component.js +127 -9
- package/dist/npm/gantt.module.js +22 -5
- package/dist/npm/index.js +8 -0
- package/dist/npm/main.js +2 -0
- package/dist/npm/models/events/dependency-add-event.interface.js +6 -0
- package/dist/npm/models/view-item.interface.js +6 -0
- package/dist/npm/package-metadata.js +1 -1
- package/dist/npm/rendering/gantt-milestone-task.component.js +6 -3
- package/dist/npm/rendering/gantt-summary-task.component.js +6 -3
- package/dist/npm/rendering/gantt-task-base.js +30 -19
- package/dist/npm/rendering/gantt-task.component.js +7 -5
- package/dist/npm/rendering/gantt-tasks-table-body.component.js +5 -1
- 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 +44 -2
- package/dist/npm/utils.js +143 -12
- package/dist/systemjs/kendo-angular-gantt.js +1 -1
- package/package.json +5 -4
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
/**
|
|
6
|
+
* @hidden
|
|
7
|
+
*/
|
|
8
|
+
export declare class DragValidationTooltipComponent {
|
|
9
|
+
/**
|
|
10
|
+
* Sets the status class of the attempted operation.
|
|
11
|
+
* Note that the status will be ignored and the `neutral` status class will be rendered,
|
|
12
|
+
* if the any of the fromTaskName or toTaskName are not populated.
|
|
13
|
+
*/
|
|
14
|
+
isValid: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* The name of the task where the dragging has started.
|
|
17
|
+
*/
|
|
18
|
+
fromTaskName: string;
|
|
19
|
+
/**
|
|
20
|
+
* The name of the task which is being currently hovered.
|
|
21
|
+
*/
|
|
22
|
+
toTaskName: string;
|
|
23
|
+
/**
|
|
24
|
+
* Specifies whether the valid/invalid validity classes should be rendered or not.
|
|
25
|
+
* Prevents the validity classes being rendered when e.g. the same task is hovered during drag,
|
|
26
|
+
* or when a task body is hovered and not an actual drag clue.
|
|
27
|
+
*/
|
|
28
|
+
showValidityStatus: boolean;
|
|
29
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
import * as tslib_1 from "tslib";
|
|
6
|
+
import { Component } from '@angular/core';
|
|
7
|
+
/**
|
|
8
|
+
* @hidden
|
|
9
|
+
*/
|
|
10
|
+
let DragValidationTooltipComponent = class DragValidationTooltipComponent {
|
|
11
|
+
/**
|
|
12
|
+
* @hidden
|
|
13
|
+
*/
|
|
14
|
+
constructor() {
|
|
15
|
+
/**
|
|
16
|
+
* Sets the status class of the attempted operation.
|
|
17
|
+
* Note that the status will be ignored and the `neutral` status class will be rendered,
|
|
18
|
+
* if the any of the fromTaskName or toTaskName are not populated.
|
|
19
|
+
*/
|
|
20
|
+
this.isValid = false;
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
DragValidationTooltipComponent = tslib_1.__decorate([
|
|
24
|
+
Component({
|
|
25
|
+
template: `
|
|
26
|
+
<div
|
|
27
|
+
class="k-tooltip k-gantt-tooltip-validation"
|
|
28
|
+
[class.k-gantt-tooltip-valid]="showValidityStatus && isValid"
|
|
29
|
+
[class.k-gantt-tooltip-invalid]="showValidityStatus && !isValid"
|
|
30
|
+
>
|
|
31
|
+
<div class="k-gantt-tooltip-validation-row">
|
|
32
|
+
<span class="k-gantt-tooltip-validation-label">From:</span>
|
|
33
|
+
<span class="k-gantt-tooltip-validation-value">{{ fromTaskName }}</span>
|
|
34
|
+
</div>
|
|
35
|
+
<div class="k-gantt-tooltip-validation-row">
|
|
36
|
+
<span class="k-gantt-tooltip-validation-label">To:</span>
|
|
37
|
+
<span class="k-gantt-tooltip-validation-value">{{ toTaskName }}</span>
|
|
38
|
+
</div>
|
|
39
|
+
</div>
|
|
40
|
+
`,
|
|
41
|
+
styles: [`
|
|
42
|
+
.k-gantt-tooltip-validation {
|
|
43
|
+
max-width: 200px;
|
|
44
|
+
display: block;
|
|
45
|
+
}
|
|
46
|
+
.k-gantt-tooltip-validation::before {
|
|
47
|
+
content: '';
|
|
48
|
+
position: absolute;
|
|
49
|
+
left: 0;
|
|
50
|
+
top: 0;
|
|
51
|
+
width: 4px;
|
|
52
|
+
height: 100%;
|
|
53
|
+
background: #656565;
|
|
54
|
+
}
|
|
55
|
+
.k-gantt-tooltip-validation.k-gantt-tooltip-valid::before {
|
|
56
|
+
background: #37B400;
|
|
57
|
+
}
|
|
58
|
+
.k-gantt-tooltip-validation.k-gantt-tooltip-invalid::before {
|
|
59
|
+
background: #F31700;
|
|
60
|
+
}
|
|
61
|
+
.k-gantt-tooltip-validation-row {
|
|
62
|
+
white-space: nowrap;
|
|
63
|
+
overflow: hidden;
|
|
64
|
+
text-overflow: ellipsis;
|
|
65
|
+
}
|
|
66
|
+
.k-gantt-tooltip-validation-label {
|
|
67
|
+
display: inline-flex;
|
|
68
|
+
width: 50px;
|
|
69
|
+
}
|
|
70
|
+
.k-gantt-tooltip-validation-value {
|
|
71
|
+
font-weight: bold;
|
|
72
|
+
}
|
|
73
|
+
`]
|
|
74
|
+
})
|
|
75
|
+
], DragValidationTooltipComponent);
|
|
76
|
+
export { DragValidationTooltipComponent };
|
|
File without changes
|
|
File without changes
|
|
@@ -9,7 +9,8 @@ import { CompositeFilterDescriptor, SortDescriptor } from '@progress/kendo-data-
|
|
|
9
9
|
import { Day } from '@progress/kendo-date-math';
|
|
10
10
|
import { Observable } from 'rxjs';
|
|
11
11
|
import { GanttColumnBase } from './columns/columns';
|
|
12
|
-
import { DataStateChangeEvent, ColumnMenuSettings, RowClassFn, TaskClassFn, ColumnVisibilityChangeEvent, ColumnResizeEvent, ColumnLockedChangeEvent, ColumnReorderEvent, ColumnReorderConfig, GanttTaskModelFields, GanttDependencyModelFields, SortSettings, CellClickEvent, TaskClickEvent } from './models/models';
|
|
12
|
+
import { DataStateChangeEvent, ColumnMenuSettings, RowClassFn, TaskClassFn, ColumnVisibilityChangeEvent, ColumnResizeEvent, ColumnLockedChangeEvent, ColumnReorderEvent, ColumnReorderConfig, GanttTaskModelFields, GanttDependencyModelFields, SortSettings, CellClickEvent, TaskClickEvent, DependencyAddEvent } from './models/models';
|
|
13
|
+
import { LocalizationService } from '@progress/kendo-angular-l10n';
|
|
13
14
|
import { TimelineViewService } from './timeline/timeline-view.service';
|
|
14
15
|
import { TimelineViewType } from './models/timeline-view';
|
|
15
16
|
import { TimelineBaseViewService } from './timeline/timeline-base-view.service';
|
|
@@ -18,12 +19,12 @@ import { DependencyDomService } from './dependencies/dependency-dom.service';
|
|
|
18
19
|
import { MappingService } from './common/mapping.service';
|
|
19
20
|
import { OptionChangesService } from './common/option-changes.service';
|
|
20
21
|
import { EditService } from './editing/edit.service';
|
|
21
|
-
import { LocalizationService } from '@progress/kendo-angular-l10n';
|
|
22
22
|
import { TimelinePaneOptions, TreeListPaneOptions } from './models/splitter-pane-options.interface';
|
|
23
23
|
import { GanttTaskTemplateDirective } from './template-directives/task-template.directive';
|
|
24
24
|
import { GanttSummaryTaskTemplateDirective } from './template-directives/summary-task-template.directive';
|
|
25
25
|
import { GanttTaskContentTemplateDirective } from './template-directives/task-content-template.directive';
|
|
26
26
|
import { ToolbarTemplateDirective } from './toolbar/toolbar-template.directive';
|
|
27
|
+
import { GanttTimelineComponent } from './timeline/gantt-timeline.component';
|
|
27
28
|
import { ToolbarSettings } from './models/toolbar-settings';
|
|
28
29
|
import { ExpandEvent } from './expanded-state/expand-event';
|
|
29
30
|
import { ViewBase } from './timeline/view-base';
|
|
@@ -31,6 +32,7 @@ import { SelectionChangeEvent } from './selection/selection-change-event';
|
|
|
31
32
|
import { TaskEditEvent } from './models/events/task-edit-event.interface';
|
|
32
33
|
import { CellCloseEvent } from './models/events/cell-close-event.interface';
|
|
33
34
|
import { TaskAddEvent } from './models/events/task-add-event.interface';
|
|
35
|
+
import { DragScrollSettings } from './scrolling/drag-scroll-settings';
|
|
34
36
|
/**
|
|
35
37
|
* Represents the Kendo UI Gantt component for Angular.
|
|
36
38
|
*
|
|
@@ -114,6 +116,7 @@ export declare class GanttComponent implements AfterContentInit, OnChanges, OnDe
|
|
|
114
116
|
private hostElement;
|
|
115
117
|
private zone;
|
|
116
118
|
treeList: TreeListComponent;
|
|
119
|
+
timeline: GanttTimelineComponent;
|
|
117
120
|
/**
|
|
118
121
|
* @hidden
|
|
119
122
|
*/
|
|
@@ -163,11 +166,22 @@ export declare class GanttComponent implements AfterContentInit, OnChanges, OnDe
|
|
|
163
166
|
*/
|
|
164
167
|
data: any[];
|
|
165
168
|
/**
|
|
166
|
-
*
|
|
169
|
+
* Specifies a callback that determines if the given task is selected ([see example]({% slug selection_gantt %}#toc-custom-selection)).
|
|
167
170
|
*
|
|
168
171
|
* > The [`selectable`]({% slug api_gantt_ganttcomponent %}#toc-selectable) prop has to be set to `true` in order for this callback to be executed.
|
|
169
172
|
*/
|
|
170
173
|
isSelected: (dataItem: object) => boolean;
|
|
174
|
+
/**
|
|
175
|
+
* Specifies a callback that determines if a new dependency is valid.
|
|
176
|
+
* Used when evaluating if an attempt to create a new dependency will result in a valid link between the two tasks
|
|
177
|
+
* [see example]({% slug editing_drag_create_dependencies_gantt %}#toc-validation).
|
|
178
|
+
*
|
|
179
|
+
* By defalut, dependencies are deemed invalid when:
|
|
180
|
+
* - The two tasks are in a parent-child relationship.
|
|
181
|
+
* - The two tasks are already dependent on one another. Only one dependency is allowed per pair.
|
|
182
|
+
* - The start or end times of the two tasks are incompatible with the attempted dependency type.
|
|
183
|
+
*/
|
|
184
|
+
validateNewDependency: (dependency: object) => boolean;
|
|
171
185
|
/**
|
|
172
186
|
* Fires when the Gantt selection is changed through user interaction.
|
|
173
187
|
*
|
|
@@ -301,6 +315,12 @@ export declare class GanttComponent implements AfterContentInit, OnChanges, OnDe
|
|
|
301
315
|
* @default false
|
|
302
316
|
*/
|
|
303
317
|
columnsResizable: boolean;
|
|
318
|
+
/**
|
|
319
|
+
* Specifies the settings for auto-scrolling during dragging
|
|
320
|
+
* when the pointer moves outside of the container bounderies
|
|
321
|
+
* [see example]({% slug editing_drag_create_dependencies_gantt %}#toc-auto-scrolling).
|
|
322
|
+
*/
|
|
323
|
+
dragScrollSettings: DragScrollSettings;
|
|
304
324
|
/**
|
|
305
325
|
* Fires when an item is expanded.
|
|
306
326
|
*/
|
|
@@ -343,6 +363,11 @@ export declare class GanttComponent implements AfterContentInit, OnChanges, OnDe
|
|
|
343
363
|
* Fires when the user adds a task.
|
|
344
364
|
*/
|
|
345
365
|
taskAdd: EventEmitter<TaskAddEvent>;
|
|
366
|
+
/**
|
|
367
|
+
* Fires when the user adds a dependency via dragging
|
|
368
|
+
* [see example]({% slug editing_drag_create_dependencies_gantt %}#toc-basic-concepts).
|
|
369
|
+
*/
|
|
370
|
+
dependencyAdd: EventEmitter<DependencyAddEvent>;
|
|
346
371
|
/**
|
|
347
372
|
* Fires when the sorting of the Gantt is changed.
|
|
348
373
|
* You have to handle the event yourself and sort the data.
|
|
@@ -407,6 +432,15 @@ export declare class GanttComponent implements AfterContentInit, OnChanges, OnDe
|
|
|
407
432
|
* @hidden
|
|
408
433
|
*/
|
|
409
434
|
readonly filterMenu: string | boolean;
|
|
435
|
+
/**
|
|
436
|
+
* @hidden
|
|
437
|
+
*
|
|
438
|
+
* Specifies whether the dependency drag clues will be rendered.
|
|
439
|
+
* Set internally by the dependency-drag-create directive.
|
|
440
|
+
*
|
|
441
|
+
* @default false
|
|
442
|
+
*/
|
|
443
|
+
renderDependencyDragClues: boolean;
|
|
410
444
|
/**
|
|
411
445
|
* @hidden
|
|
412
446
|
*/
|
|
@@ -458,6 +492,7 @@ export declare class GanttComponent implements AfterContentInit, OnChanges, OnDe
|
|
|
458
492
|
showConfirmationDialog: boolean;
|
|
459
493
|
private _columns;
|
|
460
494
|
private _data;
|
|
495
|
+
private _dragScrollSettings;
|
|
461
496
|
private _timelinePaneOptions;
|
|
462
497
|
private _treeListPaneOptions;
|
|
463
498
|
private _customToolbarTemplate;
|
|
@@ -611,4 +646,5 @@ export declare class GanttComponent implements AfterContentInit, OnChanges, OnDe
|
|
|
611
646
|
private isSameSelection;
|
|
612
647
|
private getSelectionAction;
|
|
613
648
|
private getFirstSelectedItem;
|
|
649
|
+
private defaultValidateNewDependencyCallback;
|
|
614
650
|
}
|
|
@@ -13,6 +13,8 @@ import { packageMetadata } from './package-metadata';
|
|
|
13
13
|
import { anyChanged, hasObservers } from '@progress/kendo-angular-common';
|
|
14
14
|
import { GanttColumnBase } from './columns/columns';
|
|
15
15
|
import { fetchChildren, hasChildren, isSelected, rowClassCallback, taskClassCallback } from './common/default-callbacks';
|
|
16
|
+
import { DependencyType } from './models/models';
|
|
17
|
+
import { LocalizationService } from '@progress/kendo-angular-l10n';
|
|
16
18
|
import { TimelineViewService } from './timeline/timeline-view.service';
|
|
17
19
|
import { TimelineDayViewService } from './timeline/timeline-day-view.service';
|
|
18
20
|
import { TimelineWeekViewService } from './timeline/timeline-week-view.service';
|
|
@@ -22,18 +24,25 @@ import { DependencyDomService } from './dependencies/dependency-dom.service';
|
|
|
22
24
|
import { MappingService } from './common/mapping.service';
|
|
23
25
|
import { OptionChangesService } from './common/option-changes.service';
|
|
24
26
|
import { EditService } from './editing/edit.service';
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
+
import { TimelineScrollService } from './scrolling/timeline-scroll.service';
|
|
28
|
+
import { GanttLocalizationService } from './localization/gantt-localization.service';
|
|
29
|
+
import { areParentChild, getClosestTaskIndex, isClearButton, isColumnGroup, isPresent, isTask, normalizeGanttData, scrollbarWidth } from './utils';
|
|
27
30
|
import { DEFAULT_TIMELINE_PANE_SETTINGS, DEFAULT_TREELIST_PANE_SETTINGS } from './models/splitter-pane-options.interface';
|
|
28
31
|
import { GanttTaskTemplateDirective } from './template-directives/task-template.directive';
|
|
29
32
|
import { GanttSummaryTaskTemplateDirective } from './template-directives/summary-task-template.directive';
|
|
30
33
|
import { GanttTaskContentTemplateDirective } from './template-directives/task-content-template.directive';
|
|
31
34
|
import { ToolbarTemplateDirective } from './toolbar/toolbar-template.directive';
|
|
35
|
+
import { GanttTimelineComponent } from './timeline/gantt-timeline.component';
|
|
32
36
|
import { ViewBase } from './timeline/view-base';
|
|
33
|
-
import { getEditItem } from './editing/
|
|
34
|
-
import { GanttLocalizationService } from './localization/gantt-localization.service';
|
|
37
|
+
import { getEditItem } from './editing/utils';
|
|
35
38
|
const TREELIST_GROUP_COLUMNS_CLASS = 'k-gantt-treelist-nested-columns';
|
|
36
39
|
const DEFAULT_VIEW = 'week';
|
|
40
|
+
const DEFAULT_DRAG_SCROLL_SETTINGS = {
|
|
41
|
+
enabled: true,
|
|
42
|
+
step: 3,
|
|
43
|
+
interval: 1,
|
|
44
|
+
threshold: 10
|
|
45
|
+
};
|
|
37
46
|
/**
|
|
38
47
|
* Represents the Kendo UI Gantt component for Angular.
|
|
39
48
|
*
|
|
@@ -119,11 +128,22 @@ let GanttComponent = GanttComponent_1 = class GanttComponent {
|
|
|
119
128
|
this.zone = zone;
|
|
120
129
|
this.hostClasses = true;
|
|
121
130
|
/**
|
|
122
|
-
*
|
|
131
|
+
* Specifies a callback that determines if the given task is selected ([see example]({% slug selection_gantt %}#toc-custom-selection)).
|
|
123
132
|
*
|
|
124
133
|
* > The [`selectable`]({% slug api_gantt_ganttcomponent %}#toc-selectable) prop has to be set to `true` in order for this callback to be executed.
|
|
125
134
|
*/
|
|
126
135
|
this.isSelected = isSelected;
|
|
136
|
+
/**
|
|
137
|
+
* Specifies a callback that determines if a new dependency is valid.
|
|
138
|
+
* Used when evaluating if an attempt to create a new dependency will result in a valid link between the two tasks
|
|
139
|
+
* [see example]({% slug editing_drag_create_dependencies_gantt %}#toc-validation).
|
|
140
|
+
*
|
|
141
|
+
* By defalut, dependencies are deemed invalid when:
|
|
142
|
+
* - The two tasks are in a parent-child relationship.
|
|
143
|
+
* - The two tasks are already dependent on one another. Only one dependency is allowed per pair.
|
|
144
|
+
* - The start or end times of the two tasks are incompatible with the attempted dependency type.
|
|
145
|
+
*/
|
|
146
|
+
this.validateNewDependency = this.defaultValidateNewDependencyCallback.bind(this);
|
|
127
147
|
/**
|
|
128
148
|
* Fires when the Gantt selection is changed through user interaction.
|
|
129
149
|
*
|
|
@@ -244,6 +264,11 @@ let GanttComponent = GanttComponent_1 = class GanttComponent {
|
|
|
244
264
|
* Fires when the user adds a task.
|
|
245
265
|
*/
|
|
246
266
|
this.taskAdd = new EventEmitter();
|
|
267
|
+
/**
|
|
268
|
+
* Fires when the user adds a dependency via dragging
|
|
269
|
+
* [see example]({% slug editing_drag_create_dependencies_gantt %}#toc-basic-concepts).
|
|
270
|
+
*/
|
|
271
|
+
this.dependencyAdd = new EventEmitter();
|
|
247
272
|
/**
|
|
248
273
|
* Fires when the sorting of the Gantt is changed.
|
|
249
274
|
* You have to handle the event yourself and sort the data.
|
|
@@ -300,6 +325,15 @@ let GanttComponent = GanttComponent_1 = class GanttComponent {
|
|
|
300
325
|
* Fires when a task is clicked.
|
|
301
326
|
*/
|
|
302
327
|
this.taskClick = new EventEmitter();
|
|
328
|
+
/**
|
|
329
|
+
* @hidden
|
|
330
|
+
*
|
|
331
|
+
* Specifies whether the dependency drag clues will be rendered.
|
|
332
|
+
* Set internally by the dependency-drag-create directive.
|
|
333
|
+
*
|
|
334
|
+
* @default false
|
|
335
|
+
*/
|
|
336
|
+
this.renderDependencyDragClues = false;
|
|
303
337
|
/**
|
|
304
338
|
* @hidden
|
|
305
339
|
*
|
|
@@ -316,6 +350,7 @@ let GanttComponent = GanttComponent_1 = class GanttComponent {
|
|
|
316
350
|
this.showConfirmationDialog = false;
|
|
317
351
|
this._columns = new QueryList();
|
|
318
352
|
this._data = [];
|
|
353
|
+
this._dragScrollSettings = Object.assign({}, DEFAULT_DRAG_SCROLL_SETTINGS);
|
|
319
354
|
this._timelinePaneOptions = Object.assign({}, DEFAULT_TIMELINE_PANE_SETTINGS);
|
|
320
355
|
this._treeListPaneOptions = Object.assign({}, DEFAULT_TREELIST_PANE_SETTINGS);
|
|
321
356
|
this._rowClass = rowClassCallback;
|
|
@@ -531,6 +566,17 @@ let GanttComponent = GanttComponent_1 = class GanttComponent {
|
|
|
531
566
|
get taskIdField() {
|
|
532
567
|
return this.mapper.taskFields.id;
|
|
533
568
|
}
|
|
569
|
+
/**
|
|
570
|
+
* Specifies the settings for auto-scrolling during dragging
|
|
571
|
+
* when the pointer moves outside of the container bounderies
|
|
572
|
+
* [see example]({% slug editing_drag_create_dependencies_gantt %}#toc-auto-scrolling).
|
|
573
|
+
*/
|
|
574
|
+
set dragScrollSettings(settings) {
|
|
575
|
+
this._dragScrollSettings = Object.assign({}, DEFAULT_DRAG_SCROLL_SETTINGS, settings);
|
|
576
|
+
}
|
|
577
|
+
get dragScrollSettings() {
|
|
578
|
+
return this._dragScrollSettings;
|
|
579
|
+
}
|
|
534
580
|
/**
|
|
535
581
|
* @hidden
|
|
536
582
|
*/
|
|
@@ -951,11 +997,60 @@ let GanttComponent = GanttComponent_1 = class GanttComponent {
|
|
|
951
997
|
const loadedItems = this.renderedTreeListItems || [];
|
|
952
998
|
return loadedItems.find(isSelectedCallback);
|
|
953
999
|
}
|
|
1000
|
+
defaultValidateNewDependencyCallback(dependency) {
|
|
1001
|
+
const fromTaskId = this.mapper.extractFromDependency(dependency, 'fromId');
|
|
1002
|
+
const toTaskId = this.mapper.extractFromDependency(dependency, 'toId');
|
|
1003
|
+
const fromTask = this.treeList.view.data.find(task => this.mapper.extractFromTask(task.data, 'id') === fromTaskId);
|
|
1004
|
+
const toTask = this.treeList.view.data.find(task => this.mapper.extractFromTask(task.data, 'id') === toTaskId);
|
|
1005
|
+
// mark as invalid if the attempted dependency is lacking valid from- and to-tasks
|
|
1006
|
+
// or when the from- and to-tasks are actually the same task
|
|
1007
|
+
if (!isPresent(fromTask) || !isPresent(fromTask.data) ||
|
|
1008
|
+
!isPresent(toTask) || !isPresent(toTask.data) ||
|
|
1009
|
+
fromTask.data === toTask.data) {
|
|
1010
|
+
return false;
|
|
1011
|
+
}
|
|
1012
|
+
const tasksDependentOnOneAnother = this.dependencies.some(current => {
|
|
1013
|
+
const currentFromId = this.mapper.extractFromDependency(current, 'fromId');
|
|
1014
|
+
const currentToId = this.mapper.extractFromDependency(current, 'toId');
|
|
1015
|
+
return (fromTaskId === currentFromId && toTaskId === currentToId) ||
|
|
1016
|
+
(toTaskId === currentFromId && fromTaskId === currentToId);
|
|
1017
|
+
});
|
|
1018
|
+
// mark as invalid if the attempted dependency is trying to connect already dependent tasks
|
|
1019
|
+
// mark as invalid if the two tasks are in parent-child relationship
|
|
1020
|
+
if (tasksDependentOnOneAnother || areParentChild(fromTask, toTask)) {
|
|
1021
|
+
return false;
|
|
1022
|
+
}
|
|
1023
|
+
const fromTaskStart = this.mapper.extractFromTask(fromTask.data, 'start');
|
|
1024
|
+
const fromTaskEnd = this.mapper.extractFromTask(fromTask.data, 'end');
|
|
1025
|
+
const toTaskStart = this.mapper.extractFromTask(toTask.data, 'start');
|
|
1026
|
+
const toTaskEnd = this.mapper.extractFromTask(toTask.data, 'end');
|
|
1027
|
+
// if the two tasks are available to be connected via a dependency,
|
|
1028
|
+
// check if their start and end time allow for the attempted dependency type
|
|
1029
|
+
switch (this.mapper.extractFromDependency(dependency, 'type')) {
|
|
1030
|
+
// finish to finish (FF) — the from-task ends before the to-task can end
|
|
1031
|
+
case DependencyType.FF:
|
|
1032
|
+
return fromTaskEnd <= toTaskEnd;
|
|
1033
|
+
// finish to start (FS) — the from-task ends before the to-task can begin
|
|
1034
|
+
case DependencyType.FS:
|
|
1035
|
+
return fromTaskEnd <= toTaskStart;
|
|
1036
|
+
// start to finish (SF) — the from-task begins before the to-task can end
|
|
1037
|
+
case DependencyType.SF:
|
|
1038
|
+
return fromTaskStart <= toTaskEnd;
|
|
1039
|
+
// start to start (SS) — the from-task begins before the to-task can begin
|
|
1040
|
+
case DependencyType.SS:
|
|
1041
|
+
return fromTaskStart <= toTaskStart;
|
|
1042
|
+
default: return false;
|
|
1043
|
+
}
|
|
1044
|
+
}
|
|
954
1045
|
};
|
|
955
1046
|
tslib_1.__decorate([
|
|
956
1047
|
ViewChild(TreeListComponent, { static: true }),
|
|
957
1048
|
tslib_1.__metadata("design:type", TreeListComponent)
|
|
958
1049
|
], GanttComponent.prototype, "treeList", void 0);
|
|
1050
|
+
tslib_1.__decorate([
|
|
1051
|
+
ViewChild(GanttTimelineComponent, { static: false }),
|
|
1052
|
+
tslib_1.__metadata("design:type", GanttTimelineComponent)
|
|
1053
|
+
], GanttComponent.prototype, "timeline", void 0);
|
|
959
1054
|
tslib_1.__decorate([
|
|
960
1055
|
ContentChild(GanttTaskContentTemplateDirective, { static: true }),
|
|
961
1056
|
tslib_1.__metadata("design:type", GanttTaskContentTemplateDirective)
|
|
@@ -1014,6 +1109,10 @@ tslib_1.__decorate([
|
|
|
1014
1109
|
Input(),
|
|
1015
1110
|
tslib_1.__metadata("design:type", Function)
|
|
1016
1111
|
], GanttComponent.prototype, "isSelected", void 0);
|
|
1112
|
+
tslib_1.__decorate([
|
|
1113
|
+
Input(),
|
|
1114
|
+
tslib_1.__metadata("design:type", Function)
|
|
1115
|
+
], GanttComponent.prototype, "validateNewDependency", void 0);
|
|
1017
1116
|
tslib_1.__decorate([
|
|
1018
1117
|
Output(),
|
|
1019
1118
|
tslib_1.__metadata("design:type", EventEmitter)
|
|
@@ -1113,6 +1212,11 @@ tslib_1.__decorate([
|
|
|
1113
1212
|
Input(),
|
|
1114
1213
|
tslib_1.__metadata("design:type", Boolean)
|
|
1115
1214
|
], GanttComponent.prototype, "columnsResizable", void 0);
|
|
1215
|
+
tslib_1.__decorate([
|
|
1216
|
+
Input(),
|
|
1217
|
+
tslib_1.__metadata("design:type", Object),
|
|
1218
|
+
tslib_1.__metadata("design:paramtypes", [Object])
|
|
1219
|
+
], GanttComponent.prototype, "dragScrollSettings", null);
|
|
1116
1220
|
tslib_1.__decorate([
|
|
1117
1221
|
Output(),
|
|
1118
1222
|
tslib_1.__metadata("design:type", EventEmitter)
|
|
@@ -1153,6 +1257,10 @@ tslib_1.__decorate([
|
|
|
1153
1257
|
Output(),
|
|
1154
1258
|
tslib_1.__metadata("design:type", EventEmitter)
|
|
1155
1259
|
], GanttComponent.prototype, "taskAdd", void 0);
|
|
1260
|
+
tslib_1.__decorate([
|
|
1261
|
+
Output(),
|
|
1262
|
+
tslib_1.__metadata("design:type", EventEmitter)
|
|
1263
|
+
], GanttComponent.prototype, "dependencyAdd", void 0);
|
|
1156
1264
|
tslib_1.__decorate([
|
|
1157
1265
|
Output(),
|
|
1158
1266
|
tslib_1.__metadata("design:type", EventEmitter)
|
|
@@ -1228,7 +1336,8 @@ GanttComponent = GanttComponent_1 = tslib_1.__decorate([
|
|
|
1228
1336
|
DependencyDomService,
|
|
1229
1337
|
MappingService,
|
|
1230
1338
|
OptionChangesService,
|
|
1231
|
-
EditService
|
|
1339
|
+
EditService,
|
|
1340
|
+
TimelineScrollService
|
|
1232
1341
|
],
|
|
1233
1342
|
template: `
|
|
1234
1343
|
<ng-container kendoGanttLocalizedMessages
|
|
@@ -1543,6 +1652,8 @@ GanttComponent = GanttComponent_1 = tslib_1.__decorate([
|
|
|
1543
1652
|
[scrollable]="false">
|
|
1544
1653
|
<kendo-gantt-timeline
|
|
1545
1654
|
*ngIf="views && views.length"
|
|
1655
|
+
[renderDependencyDragClues]="renderDependencyDragClues"
|
|
1656
|
+
[dragScrollSettings]="dragScrollSettings"
|
|
1546
1657
|
[rows]="renderedTreeListItems"
|
|
1547
1658
|
[slots]="timelineSlots"
|
|
1548
1659
|
[groupSlots]="timelineGroupSlots"
|
|
@@ -5,11 +5,19 @@
|
|
|
5
5
|
import * as tslib_1 from "tslib";
|
|
6
6
|
import { NgModule } from '@angular/core';
|
|
7
7
|
import { CommonModule } from '@angular/common';
|
|
8
|
+
import { ReactiveFormsModule } from '@angular/forms';
|
|
8
9
|
import { SplitterModule, TabStripModule } from '@progress/kendo-angular-layout';
|
|
9
10
|
import { TreeListModule } from '@progress/kendo-angular-treelist';
|
|
10
11
|
import { ButtonsModule } from '@progress/kendo-angular-buttons';
|
|
11
|
-
import { EventsModule } from '@progress/kendo-angular-common';
|
|
12
|
+
import { DraggableModule, EventsModule } from '@progress/kendo-angular-common';
|
|
12
13
|
import { DialogModule } from '@progress/kendo-angular-dialog';
|
|
14
|
+
import { LabelModule } from '@progress/kendo-angular-label';
|
|
15
|
+
import { InputsModule } from '@progress/kendo-angular-inputs';
|
|
16
|
+
import { DateInputsModule } from '@progress/kendo-angular-dateinputs';
|
|
17
|
+
import { L10N_PREFIX } from '@progress/kendo-angular-l10n';
|
|
18
|
+
import { PopupModule } from '@progress/kendo-angular-popup';
|
|
19
|
+
import { touchEnabled } from '@progress/kendo-common';
|
|
20
|
+
import { TOUCH_ENABLED } from './common/touch-enabled';
|
|
13
21
|
import { GanttComponent } from './gantt.component';
|
|
14
22
|
import { GanttTimelineComponent } from './timeline/gantt-timeline.component';
|
|
15
23
|
import { GanttTasksTableBodyComponent } from './rendering/gantt-tasks-table-body.component';
|
|
@@ -28,17 +36,15 @@ import { ToolbarComponent } from './toolbar/toolbar.component';
|
|
|
28
36
|
import { ToolbarTemplateDirective } from './toolbar/toolbar-template.directive';
|
|
29
37
|
import { ViewSelectorComponent } from './toolbar/view-selector.component';
|
|
30
38
|
import { GanttDependencyDirective } from './dependencies/gantt-dependency.directive';
|
|
39
|
+
import { DependencyDragCreateDirective } from './dragging/dependency-drag-create.directive';
|
|
40
|
+
import { DragValidationTooltipComponent } from './dragging/drag-validation-tooltip.component';
|
|
41
|
+
import { TimelineScrollableDirective } from './scrolling/timeline-scroll.directive';
|
|
31
42
|
import { GanttColumnComponent, GanttColumnGroupComponent, GanttSpanColumnComponent, FilterMenuTemplateDirective, FilterCellTemplateDirective, CellTemplateDirective, ColumnMenuTemplateDirective, FooterTemplateDirective, HeaderTemplateDirective, EditTemplateDirective } from './columns/columns';
|
|
32
43
|
import { TimelineDayViewComponent } from './timeline/timeline-day-view.component';
|
|
33
44
|
import { TimelineWeekViewComponent } from './timeline/timeline-week-view.component';
|
|
34
45
|
import { TimelineMonthViewComponent } from './timeline/timeline-month-view.component';
|
|
35
46
|
import { EditDialogComponent } from './editing/edit-dialog.component';
|
|
36
|
-
import { ReactiveFormsModule } from '@angular/forms';
|
|
37
|
-
import { LabelModule } from '@progress/kendo-angular-label';
|
|
38
|
-
import { InputsModule } from '@progress/kendo-angular-inputs';
|
|
39
|
-
import { DateInputsModule } from '@progress/kendo-angular-dateinputs';
|
|
40
47
|
import { CustomMessagesComponent } from './localization/custom-messages.component';
|
|
41
|
-
import { L10N_PREFIX } from '@progress/kendo-angular-l10n';
|
|
42
48
|
import { LocalizedMessagesDirective } from './localization/localized-messages.directive';
|
|
43
49
|
import { GanttAddTaskComponent } from './editing/add-task.component';
|
|
44
50
|
import { GridModule } from '@progress/kendo-angular-grid';
|
|
@@ -57,6 +63,8 @@ const IMPORTED_MODULES = [
|
|
|
57
63
|
ButtonsModule,
|
|
58
64
|
DialogModule,
|
|
59
65
|
EventsModule,
|
|
66
|
+
PopupModule,
|
|
67
|
+
DraggableModule,
|
|
60
68
|
TabStripModule,
|
|
61
69
|
GridModule,
|
|
62
70
|
DropDownsModule
|
|
@@ -89,6 +97,7 @@ const DECLARATIONS = [
|
|
|
89
97
|
FooterTemplateDirective,
|
|
90
98
|
GanttExpandableDirective,
|
|
91
99
|
GanttDependencyDirective,
|
|
100
|
+
DependencyDragCreateDirective,
|
|
92
101
|
TimelineDayViewComponent,
|
|
93
102
|
TimelineWeekViewComponent,
|
|
94
103
|
TimelineMonthViewComponent,
|
|
@@ -97,9 +106,12 @@ const DECLARATIONS = [
|
|
|
97
106
|
CustomMessagesComponent,
|
|
98
107
|
LocalizedMessagesDirective,
|
|
99
108
|
GanttAddTaskComponent,
|
|
109
|
+
DragValidationTooltipComponent,
|
|
110
|
+
TimelineScrollableDirective,
|
|
100
111
|
DependenciesTableComponent,
|
|
101
112
|
TaskFieldsComponent
|
|
102
113
|
];
|
|
114
|
+
const ɵ0 = touchEnabled;
|
|
103
115
|
/**
|
|
104
116
|
* Represents the [NgModule]({{ site.data.urls.angular['ngmoduleapi'] }})
|
|
105
117
|
* definition for the Gantt component.
|
|
@@ -138,10 +150,15 @@ GanttModule = tslib_1.__decorate([
|
|
|
138
150
|
imports: [...IMPORTED_MODULES],
|
|
139
151
|
declarations: [...DECLARATIONS],
|
|
140
152
|
exports: [...DECLARATIONS],
|
|
153
|
+
entryComponents: [DragValidationTooltipComponent],
|
|
141
154
|
providers: [{
|
|
142
155
|
provide: L10N_PREFIX,
|
|
143
156
|
useValue: 'kendo.gantt'
|
|
157
|
+
}, {
|
|
158
|
+
provide: TOUCH_ENABLED,
|
|
159
|
+
useValue: ɵ0
|
|
144
160
|
}]
|
|
145
161
|
})
|
|
146
162
|
], GanttModule);
|
|
147
163
|
export { GanttModule };
|
|
164
|
+
export { ɵ0 };
|
package/dist/es2015/index.d.ts
CHANGED
|
@@ -8,8 +8,10 @@
|
|
|
8
8
|
export * from './main';
|
|
9
9
|
export { MappingService } from './common/mapping.service';
|
|
10
10
|
export { OptionChangesService } from './common/option-changes.service';
|
|
11
|
+
export { TOUCH_ENABLED } from './common/touch-enabled';
|
|
11
12
|
export { DependencyDomService } from './dependencies/dependency-dom.service';
|
|
12
13
|
export { GanttDependencyDirective } from './dependencies/gantt-dependency.directive';
|
|
14
|
+
export { DragValidationTooltipComponent } from './dragging/drag-validation-tooltip.component';
|
|
13
15
|
export { GanttAddTaskComponent } from './editing/add-task.component';
|
|
14
16
|
export { DependenciesTableComponent } from './editing/dependencies-table.component';
|
|
15
17
|
export { EditDialogComponent } from './editing/edit-dialog.component';
|
|
@@ -27,6 +29,8 @@ export { GanttTaskBase } from './rendering/gantt-task-base';
|
|
|
27
29
|
export { GanttTaskComponent } from './rendering/gantt-task.component';
|
|
28
30
|
export { GanttTasksTableBodyComponent } from './rendering/gantt-tasks-table-body.component';
|
|
29
31
|
export { ScrollSyncService } from './scrolling/scroll-sync.service';
|
|
32
|
+
export { TimelineScrollableDirective } from './scrolling/timeline-scroll.directive';
|
|
33
|
+
export { TimelineScrollService } from './scrolling/timeline-scroll.service';
|
|
30
34
|
export { GanttTimelineComponent } from './timeline/gantt-timeline.component';
|
|
31
35
|
export { TimelineBaseViewService } from './timeline/timeline-base-view.service';
|
|
32
36
|
export { TimelineDayViewComponent } from './timeline/timeline-day-view.component';
|
package/dist/es2015/index.js
CHANGED
|
@@ -8,8 +8,10 @@
|
|
|
8
8
|
export * from './main';
|
|
9
9
|
export { MappingService } from './common/mapping.service';
|
|
10
10
|
export { OptionChangesService } from './common/option-changes.service';
|
|
11
|
+
export { TOUCH_ENABLED } from './common/touch-enabled';
|
|
11
12
|
export { DependencyDomService } from './dependencies/dependency-dom.service';
|
|
12
13
|
export { GanttDependencyDirective } from './dependencies/gantt-dependency.directive';
|
|
14
|
+
export { DragValidationTooltipComponent } from './dragging/drag-validation-tooltip.component';
|
|
13
15
|
export { GanttAddTaskComponent } from './editing/add-task.component';
|
|
14
16
|
export { DependenciesTableComponent } from './editing/dependencies-table.component';
|
|
15
17
|
export { EditDialogComponent } from './editing/edit-dialog.component';
|
|
@@ -27,6 +29,8 @@ export { GanttTaskBase } from './rendering/gantt-task-base';
|
|
|
27
29
|
export { GanttTaskComponent } from './rendering/gantt-task.component';
|
|
28
30
|
export { GanttTasksTableBodyComponent } from './rendering/gantt-tasks-table-body.component';
|
|
29
31
|
export { ScrollSyncService } from './scrolling/scroll-sync.service';
|
|
32
|
+
export { TimelineScrollableDirective } from './scrolling/timeline-scroll.directive';
|
|
33
|
+
export { TimelineScrollService } from './scrolling/timeline-scroll.service';
|
|
30
34
|
export { GanttTimelineComponent } from './timeline/gantt-timeline.component';
|
|
31
35
|
export { TimelineBaseViewService } from './timeline/timeline-base-view.service';
|
|
32
36
|
export { TimelineDayViewComponent } from './timeline/timeline-day-view.component';
|