@progress/kendo-angular-gantt 2.0.0-next.202204010911 → 2.0.0-next.202204121022
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/binding-directives/flat-binding.directive.d.ts +24 -0
- package/binding-directives/hierarchy-binding.directive.d.ts +22 -0
- package/bundles/kendo-angular-gantt.umd.js +1 -1
- package/columns/cell-template.directive.d.ts +28 -0
- package/columns/column-base.d.ts +85 -0
- package/columns/column-group.component.d.ts +103 -0
- package/columns/column-menu-template.directive.d.ts +22 -0
- package/columns/column.component.d.ts +130 -0
- package/columns/columns.d.ts +15 -0
- package/columns/edit-template.directive.d.ts +26 -0
- package/columns/filter-cell-template.directive.d.ts +21 -0
- package/columns/filter-menu-template.directive.d.ts +20 -0
- package/columns/footer-template.directive.d.ts +24 -0
- package/columns/header-template.directive.d.ts +22 -0
- package/columns/span-column.component.d.ts +112 -0
- package/common/default-callbacks.d.ts +25 -0
- package/common/mapping.service.d.ts +38 -0
- package/common/option-changes.service.d.ts +17 -0
- package/common/touch-enabled.d.ts +9 -0
- package/dependencies/dependency-dom.service.d.ts +46 -0
- package/dependencies/dom-dependency-args.d.ts +24 -0
- package/dependencies/gantt-dependency.directive.d.ts +29 -0
- package/dependencies/utils.d.ts +53 -0
- package/dragging/dependency-drag-create.directive.d.ts +75 -0
- package/dragging/drag-validation-tooltip.component.d.ts +32 -0
- package/editing/add-task.component.d.ts +48 -0
- package/editing/dependencies-table.component.d.ts +42 -0
- package/editing/edit-dialog.component.d.ts +33 -0
- package/editing/edit.service.d.ts +44 -0
- package/editing/task-fields.component.d.ts +25 -0
- package/editing/utils.d.ts +10 -0
- package/esm2015/binding-directives/flat-binding.directive.js +34 -0
- package/esm2015/binding-directives/hierarchy-binding.directive.js +32 -0
- package/esm2015/columns/cell-template.directive.js +37 -0
- package/esm2015/columns/column-base.js +52 -0
- package/esm2015/columns/column-group.component.js +94 -0
- package/esm2015/columns/column-menu-template.directive.js +31 -0
- package/esm2015/columns/column.component.js +133 -0
- package/esm2015/columns/columns.js +15 -0
- package/esm2015/columns/edit-template.directive.js +35 -0
- package/esm2015/columns/filter-cell-template.directive.js +30 -0
- package/esm2015/columns/filter-menu-template.directive.js +29 -0
- package/esm2015/columns/footer-template.directive.js +33 -0
- package/esm2015/columns/header-template.directive.js +31 -0
- package/esm2015/columns/span-column.component.js +86 -0
- package/esm2015/common/default-callbacks.js +25 -0
- package/esm2015/common/mapping.service.js +64 -0
- package/esm2015/common/option-changes.service.js +26 -0
- package/esm2015/common/touch-enabled.js +9 -0
- package/esm2015/dependencies/dependency-dom.service.js +70 -0
- package/esm2015/dependencies/dom-dependency-args.js +5 -0
- package/esm2015/dependencies/gantt-dependency.directive.js +82 -0
- package/esm2015/dependencies/utils.js +195 -0
- package/esm2015/dragging/dependency-drag-create.directive.js +318 -0
- package/esm2015/dragging/drag-validation-tooltip.component.js +90 -0
- package/esm2015/editing/add-task.component.js +109 -0
- package/esm2015/editing/dependencies-table.component.js +196 -0
- package/esm2015/editing/edit-dialog.component.js +170 -0
- package/esm2015/editing/edit.service.js +111 -0
- package/esm2015/editing/task-fields.component.js +101 -0
- package/esm2015/editing/utils.js +15 -0
- package/esm2015/expanded-state/expand-event.js +9 -0
- package/esm2015/expanded-state/expandable.directive.js +23 -0
- package/esm2015/gantt.component.js +2226 -0
- package/esm2015/gantt.module.js +264 -0
- package/esm2015/kendo-angular-gantt.js +8 -0
- package/esm2015/localization/custom-messages.component.js +41 -0
- package/esm2015/localization/gantt-localization.service.js +25 -0
- package/esm2015/localization/localized-messages.directive.js +36 -0
- package/esm2015/localization/messages.js +157 -0
- package/esm2015/main.js +37 -0
- package/esm2015/models/cell-content-type.interface.js +5 -0
- package/esm2015/models/class-callbacks.js +5 -0
- package/esm2015/models/column-menu-settings.interface.js +5 -0
- package/esm2015/models/column-reorder-config.js +5 -0
- package/esm2015/models/date-range.interface.js +5 -0
- package/esm2015/models/dependency-type.enum.js +20 -0
- package/esm2015/models/events/cell-click-event.interface.js +5 -0
- package/esm2015/models/events/cell-close-event.interface.js +14 -0
- package/esm2015/models/events/click-event.interface.js +5 -0
- package/esm2015/models/events/column-locked-change-event.interface.js +5 -0
- package/esm2015/models/events/column-reorder-event.interface.js +5 -0
- package/esm2015/models/events/column-resize-event.interface.js +5 -0
- package/esm2015/models/events/column-visibility-change-event.interface.js +5 -0
- package/esm2015/models/events/data-state-change-event.interface.js +5 -0
- package/esm2015/models/events/dependency-add-event.interface.js +5 -0
- package/esm2015/models/events/selected-view-change-event.interface.js +5 -0
- package/esm2015/models/events/task-add-event.interface.js +5 -0
- package/esm2015/models/events/task-click-event.interface.js +5 -0
- package/esm2015/models/events/task-delete-event.interface.js +5 -0
- package/esm2015/models/events/task-edit-event.interface.js +5 -0
- package/esm2015/models/events/task-move-end-event.interface.js +5 -0
- package/esm2015/models/events/task-move-event.interface.js +5 -0
- package/esm2015/models/events/task-move-start-event.interface.js +5 -0
- package/esm2015/models/events/task-resize-end-event.interface.js +5 -0
- package/esm2015/models/events/task-resize-event.interface.js +5 -0
- package/esm2015/models/events/task-resize-start-event.interface.js +5 -0
- package/esm2015/models/filterable-settings.js +5 -0
- package/esm2015/models/gantt-dependency-model-fields.interface.js +13 -0
- package/esm2015/models/gantt-dependency.interface.js +5 -0
- package/esm2015/models/gantt-task-model-fields.interface.js +15 -0
- package/esm2015/models/gantt-task.interface.js +5 -0
- package/esm2015/models/models.js +7 -0
- package/esm2015/models/slot.interface.js +5 -0
- package/esm2015/models/sort-settings.js +17 -0
- package/esm2015/models/splitter-pane-options.interface.js +20 -0
- package/esm2015/models/timeline-options.interface.js +5 -0
- package/esm2015/models/timeline-view.js +5 -0
- package/esm2015/models/toolbar-settings.js +5 -0
- package/esm2015/models/view-item.interface.js +5 -0
- package/esm2015/navigation/navigation-models.js +5 -0
- package/esm2015/navigation/navigation.service.js +265 -0
- package/esm2015/navigation/utils.js +69 -0
- package/esm2015/package-metadata.js +15 -0
- package/esm2015/rendering/gantt-header-table-body.component.js +42 -0
- package/esm2015/rendering/gantt-milestone-task.component.js +107 -0
- package/esm2015/rendering/gantt-summary-task.component.js +158 -0
- package/esm2015/rendering/gantt-task-base.js +148 -0
- package/esm2015/rendering/gantt-task.component.js +204 -0
- package/esm2015/rendering/gantt-tasks-table-body.component.js +160 -0
- package/esm2015/scrolling/drag-scroll-settings.js +20 -0
- package/esm2015/scrolling/scroll-sync.service.js +80 -0
- package/esm2015/scrolling/timeline-scroll.directive.js +75 -0
- package/esm2015/scrolling/timeline-scroll.service.js +39 -0
- package/esm2015/scrolling/utils.js +77 -0
- package/esm2015/selection/selectable.directive.js +112 -0
- package/esm2015/selection/selection-change-event.js +5 -0
- package/esm2015/template-directives/summary-task-template.directive.js +50 -0
- package/esm2015/template-directives/task-content-template.directive.js +45 -0
- package/esm2015/template-directives/task-template.directive.js +48 -0
- package/esm2015/timeline/gantt-timeline.component.js +334 -0
- package/esm2015/timeline/timeline-base-view.service.js +160 -0
- package/esm2015/timeline/timeline-day-view.component.js +38 -0
- package/esm2015/timeline/timeline-day-view.service.js +66 -0
- package/esm2015/timeline/timeline-month-view.component.js +38 -0
- package/esm2015/timeline/timeline-month-view.service.js +64 -0
- package/esm2015/timeline/timeline-view.service.js +35 -0
- package/esm2015/timeline/timeline-week-view.component.js +38 -0
- package/esm2015/timeline/timeline-week-view.service.js +60 -0
- package/esm2015/timeline/view-base.js +45 -0
- package/esm2015/toolbar/toolbar-template.directive.js +127 -0
- package/esm2015/toolbar/toolbar.component.js +94 -0
- package/esm2015/toolbar/view-selector.component.js +96 -0
- package/esm2015/utils.js +293 -0
- package/expanded-state/expand-event.d.ts +13 -0
- package/expanded-state/expandable.directive.d.ts +20 -0
- package/fesm2015/kendo-angular-gantt.js +7706 -0
- package/gantt.component.d.ts +750 -0
- package/gantt.module.d.ts +94 -0
- package/kendo-angular-gantt.d.ts +9 -0
- package/localization/custom-messages.component.d.ts +18 -0
- package/localization/gantt-localization.service.d.ts +18 -0
- package/localization/localized-messages.directive.d.ts +16 -0
- package/localization/messages.d.ts +293 -0
- package/main.d.ts +39 -0
- package/models/cell-content-type.interface.d.ts +10 -0
- package/models/class-callbacks.d.ts +43 -0
- package/models/column-menu-settings.interface.d.ts +26 -0
- package/models/column-reorder-config.d.ts +10 -0
- package/models/date-range.interface.d.ts +19 -0
- package/models/dependency-type.enum.d.ts +19 -0
- package/models/events/cell-click-event.interface.d.ts +43 -0
- package/models/events/cell-close-event.interface.d.ts +48 -0
- package/models/events/click-event.interface.d.ts +23 -0
- package/models/events/column-locked-change-event.interface.d.ts +16 -0
- package/models/events/column-reorder-event.interface.d.ts +10 -0
- package/models/events/column-resize-event.interface.d.ts +10 -0
- package/models/events/column-visibility-change-event.interface.d.ts +14 -0
- package/models/events/data-state-change-event.interface.d.ts +10 -0
- package/models/events/dependency-add-event.interface.d.ts +26 -0
- package/models/events/selected-view-change-event.interface.d.ts +19 -0
- package/models/events/task-add-event.interface.d.ts +31 -0
- package/models/events/task-click-event.interface.d.ts +30 -0
- package/models/events/task-delete-event.interface.d.ts +21 -0
- package/models/events/task-edit-event.interface.d.ts +76 -0
- package/models/events/task-move-end-event.interface.d.ts +12 -0
- package/models/events/task-move-event.interface.d.ts +23 -0
- package/models/events/task-move-start-event.interface.d.ts +15 -0
- package/models/events/task-resize-end-event.interface.d.ts +12 -0
- package/models/events/task-resize-event.interface.d.ts +23 -0
- package/models/events/task-resize-start-event.interface.d.ts +15 -0
- package/models/filterable-settings.d.ts +10 -0
- package/models/gantt-dependency-model-fields.interface.d.ts +35 -0
- package/models/gantt-dependency.interface.d.ts +26 -0
- package/models/gantt-task-model-fields.interface.d.ts +42 -0
- package/models/gantt-task.interface.d.ts +31 -0
- package/models/models.d.ts +42 -0
- package/models/slot.interface.d.ts +31 -0
- package/models/sort-settings.d.ts +42 -0
- package/models/splitter-pane-options.interface.d.ts +54 -0
- package/models/timeline-options.interface.d.ts +41 -0
- package/models/timeline-view.d.ts +8 -0
- package/models/toolbar-settings.d.ts +29 -0
- package/models/view-item.interface.d.ts +35 -0
- package/navigation/navigation-models.d.ts +38 -0
- package/navigation/navigation.service.d.ts +130 -0
- package/navigation/utils.d.ts +26 -0
- package/package-metadata.d.ts +9 -0
- package/package.json +10 -14
- package/rendering/gantt-header-table-body.component.d.ts +14 -0
- package/rendering/gantt-milestone-task.component.d.ts +22 -0
- package/rendering/gantt-summary-task.component.d.ts +25 -0
- package/rendering/gantt-task-base.d.ts +59 -0
- package/rendering/gantt-task.component.d.ts +26 -0
- package/rendering/gantt-tasks-table-body.component.d.ts +33 -0
- package/scrolling/drag-scroll-settings.d.ts +47 -0
- package/scrolling/scroll-sync.service.d.ts +33 -0
- package/scrolling/timeline-scroll.directive.d.ts +27 -0
- package/scrolling/timeline-scroll.service.d.ts +23 -0
- package/scrolling/utils.d.ts +29 -0
- package/selection/selectable.directive.d.ts +45 -0
- package/selection/selection-change-event.d.ts +25 -0
- package/template-directives/summary-task-template.directive.d.ts +41 -0
- package/template-directives/task-content-template.directive.d.ts +36 -0
- package/template-directives/task-template.directive.d.ts +39 -0
- package/timeline/gantt-timeline.component.d.ts +67 -0
- package/timeline/timeline-base-view.service.d.ts +77 -0
- package/timeline/timeline-day-view.component.d.ts +18 -0
- package/timeline/timeline-day-view.service.d.ts +38 -0
- package/timeline/timeline-month-view.component.d.ts +18 -0
- package/timeline/timeline-month-view.service.d.ts +38 -0
- package/timeline/timeline-view.service.d.ts +19 -0
- package/timeline/timeline-week-view.component.d.ts +18 -0
- package/timeline/timeline-week-view.service.d.ts +38 -0
- package/timeline/view-base.d.ts +34 -0
- package/toolbar/toolbar-template.directive.d.ts +112 -0
- package/toolbar/toolbar.component.d.ts +29 -0
- package/toolbar/view-selector.component.d.ts +43 -0
- package/utils.d.ts +166 -0
|
@@ -0,0 +1,160 @@
|
|
|
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 { Component, Input, ViewChild } from '@angular/core';
|
|
6
|
+
import { isEqual } from '@progress/kendo-date-math';
|
|
7
|
+
import { isPresent } from '../utils';
|
|
8
|
+
import * as i0 from "@angular/core";
|
|
9
|
+
import * as i1 from "../dependencies/dependency-dom.service";
|
|
10
|
+
import * as i2 from "../common/mapping.service";
|
|
11
|
+
import * as i3 from "./gantt-milestone-task.component";
|
|
12
|
+
import * as i4 from "./gantt-summary-task.component";
|
|
13
|
+
import * as i5 from "./gantt-task.component";
|
|
14
|
+
import * as i6 from "@angular/common";
|
|
15
|
+
/**
|
|
16
|
+
* @hidden
|
|
17
|
+
*/
|
|
18
|
+
export class GanttTasksTableBodyComponent {
|
|
19
|
+
constructor(dependencyDomService, mapper) {
|
|
20
|
+
this.dependencyDomService = dependencyDomService;
|
|
21
|
+
this.mapper = mapper;
|
|
22
|
+
}
|
|
23
|
+
set timelineRow(timelineRow) {
|
|
24
|
+
// register the row value only when the first row is rendered
|
|
25
|
+
// with server-side data-binding, the rows rendering could be delayed
|
|
26
|
+
if (isPresent(timelineRow)) {
|
|
27
|
+
this.dependencyDomService.registerTimelineRow(timelineRow.nativeElement);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
isMileStone(item) {
|
|
31
|
+
return !item.hasChildren && isEqual(this.mapper.extractFromTask(item.data, 'start'), this.mapper.extractFromTask(item.data, 'end'));
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
GanttTasksTableBodyComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: GanttTasksTableBodyComponent, deps: [{ token: i1.DependencyDomService }, { token: i2.MappingService }], target: i0.ɵɵFactoryTarget.Component });
|
|
35
|
+
GanttTasksTableBodyComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: GanttTasksTableBodyComponent, selector: "[kendoGanttTasksTableBody]", inputs: { selectable: "selectable", rows: "rows", activeView: "activeView", taskContentTemplate: "taskContentTemplate", taskTemplate: "taskTemplate", summaryTaskTemplate: "summaryTaskTemplate", taskClass: "taskClass", isExpanded: "isExpanded", isTaskSelected: "isTaskSelected", renderDependencyDragClues: "renderDependencyDragClues" }, viewQueries: [{ propertyName: "timelineRow", first: true, predicate: ["timelineRow"], descendants: true }], ngImport: i0, template: `
|
|
36
|
+
<tr #timelineRow *ngFor="let item of rows; let index = index">
|
|
37
|
+
<td>
|
|
38
|
+
<kendo-gantt-milestone-task
|
|
39
|
+
*ngIf="isMileStone(item); else task"
|
|
40
|
+
[dataItem]="item.data"
|
|
41
|
+
[level]="item.level"
|
|
42
|
+
[activeView]="activeView"
|
|
43
|
+
[taskClass]="taskClass"
|
|
44
|
+
[selectable]="selectable"
|
|
45
|
+
[isSelected]="isTaskSelected"
|
|
46
|
+
[index]="index"
|
|
47
|
+
[renderDependencyDragClues]="renderDependencyDragClues"
|
|
48
|
+
>
|
|
49
|
+
</kendo-gantt-milestone-task>
|
|
50
|
+
<ng-template #task>
|
|
51
|
+
<kendo-gantt-summary-task
|
|
52
|
+
*ngIf="item.hasChildren"
|
|
53
|
+
[dataItem]="item.data"
|
|
54
|
+
[level]="item.level"
|
|
55
|
+
[template]="summaryTaskTemplate"
|
|
56
|
+
[activeView]="activeView"
|
|
57
|
+
[taskClass]="taskClass"
|
|
58
|
+
[selectable]="selectable"
|
|
59
|
+
[isSelected]="isTaskSelected"
|
|
60
|
+
[isExpanded]="isExpanded"
|
|
61
|
+
[index]="index"
|
|
62
|
+
[renderDependencyDragClues]="renderDependencyDragClues"
|
|
63
|
+
>
|
|
64
|
+
</kendo-gantt-summary-task>
|
|
65
|
+
<kendo-gantt-task
|
|
66
|
+
*ngIf="!item.hasChildren"
|
|
67
|
+
[dataItem]="item.data"
|
|
68
|
+
[level]="item.level"
|
|
69
|
+
[taskContentTemplate]="taskContentTemplate"
|
|
70
|
+
[taskTemplate]="taskTemplate"
|
|
71
|
+
[activeView]="activeView"
|
|
72
|
+
[taskClass]="taskClass"
|
|
73
|
+
[selectable]="selectable"
|
|
74
|
+
[isSelected]="isTaskSelected"
|
|
75
|
+
[index]="index"
|
|
76
|
+
[renderDependencyDragClues]="renderDependencyDragClues"
|
|
77
|
+
>
|
|
78
|
+
</kendo-gantt-task>
|
|
79
|
+
</ng-template>
|
|
80
|
+
</td>
|
|
81
|
+
</tr>
|
|
82
|
+
`, isInline: true, components: [{ type: i3.GanttMilestoneTaskComponent, selector: "kendo-gantt-milestone-task" }, { type: i4.GanttSummaryTaskComponent, selector: "kendo-gantt-summary-task", inputs: ["template", "isExpanded"] }, { type: i5.GanttTaskComponent, selector: "kendo-gantt-task", inputs: ["taskContentTemplate", "taskTemplate"] }], directives: [{ type: i6.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
83
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: GanttTasksTableBodyComponent, decorators: [{
|
|
84
|
+
type: Component,
|
|
85
|
+
args: [{
|
|
86
|
+
// eslint-disable-next-line @angular-eslint/component-selector
|
|
87
|
+
selector: '[kendoGanttTasksTableBody]',
|
|
88
|
+
template: `
|
|
89
|
+
<tr #timelineRow *ngFor="let item of rows; let index = index">
|
|
90
|
+
<td>
|
|
91
|
+
<kendo-gantt-milestone-task
|
|
92
|
+
*ngIf="isMileStone(item); else task"
|
|
93
|
+
[dataItem]="item.data"
|
|
94
|
+
[level]="item.level"
|
|
95
|
+
[activeView]="activeView"
|
|
96
|
+
[taskClass]="taskClass"
|
|
97
|
+
[selectable]="selectable"
|
|
98
|
+
[isSelected]="isTaskSelected"
|
|
99
|
+
[index]="index"
|
|
100
|
+
[renderDependencyDragClues]="renderDependencyDragClues"
|
|
101
|
+
>
|
|
102
|
+
</kendo-gantt-milestone-task>
|
|
103
|
+
<ng-template #task>
|
|
104
|
+
<kendo-gantt-summary-task
|
|
105
|
+
*ngIf="item.hasChildren"
|
|
106
|
+
[dataItem]="item.data"
|
|
107
|
+
[level]="item.level"
|
|
108
|
+
[template]="summaryTaskTemplate"
|
|
109
|
+
[activeView]="activeView"
|
|
110
|
+
[taskClass]="taskClass"
|
|
111
|
+
[selectable]="selectable"
|
|
112
|
+
[isSelected]="isTaskSelected"
|
|
113
|
+
[isExpanded]="isExpanded"
|
|
114
|
+
[index]="index"
|
|
115
|
+
[renderDependencyDragClues]="renderDependencyDragClues"
|
|
116
|
+
>
|
|
117
|
+
</kendo-gantt-summary-task>
|
|
118
|
+
<kendo-gantt-task
|
|
119
|
+
*ngIf="!item.hasChildren"
|
|
120
|
+
[dataItem]="item.data"
|
|
121
|
+
[level]="item.level"
|
|
122
|
+
[taskContentTemplate]="taskContentTemplate"
|
|
123
|
+
[taskTemplate]="taskTemplate"
|
|
124
|
+
[activeView]="activeView"
|
|
125
|
+
[taskClass]="taskClass"
|
|
126
|
+
[selectable]="selectable"
|
|
127
|
+
[isSelected]="isTaskSelected"
|
|
128
|
+
[index]="index"
|
|
129
|
+
[renderDependencyDragClues]="renderDependencyDragClues"
|
|
130
|
+
>
|
|
131
|
+
</kendo-gantt-task>
|
|
132
|
+
</ng-template>
|
|
133
|
+
</td>
|
|
134
|
+
</tr>
|
|
135
|
+
`
|
|
136
|
+
}]
|
|
137
|
+
}], ctorParameters: function () { return [{ type: i1.DependencyDomService }, { type: i2.MappingService }]; }, propDecorators: { timelineRow: [{
|
|
138
|
+
type: ViewChild,
|
|
139
|
+
args: ['timelineRow', { static: false }]
|
|
140
|
+
}], selectable: [{
|
|
141
|
+
type: Input
|
|
142
|
+
}], rows: [{
|
|
143
|
+
type: Input
|
|
144
|
+
}], activeView: [{
|
|
145
|
+
type: Input
|
|
146
|
+
}], taskContentTemplate: [{
|
|
147
|
+
type: Input
|
|
148
|
+
}], taskTemplate: [{
|
|
149
|
+
type: Input
|
|
150
|
+
}], summaryTaskTemplate: [{
|
|
151
|
+
type: Input
|
|
152
|
+
}], taskClass: [{
|
|
153
|
+
type: Input
|
|
154
|
+
}], isExpanded: [{
|
|
155
|
+
type: Input
|
|
156
|
+
}], isTaskSelected: [{
|
|
157
|
+
type: Input
|
|
158
|
+
}], renderDependencyDragClues: [{
|
|
159
|
+
type: Input
|
|
160
|
+
}] } });
|
|
@@ -0,0 +1,20 @@
|
|
|
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 var ScrollDirection;
|
|
9
|
+
(function (ScrollDirection) {
|
|
10
|
+
ScrollDirection[ScrollDirection["Backwards"] = -1] = "Backwards";
|
|
11
|
+
ScrollDirection[ScrollDirection["Forward"] = 1] = "Forward";
|
|
12
|
+
})(ScrollDirection || (ScrollDirection = {}));
|
|
13
|
+
/**
|
|
14
|
+
* @hidden
|
|
15
|
+
*/
|
|
16
|
+
export var ScrollAxis;
|
|
17
|
+
(function (ScrollAxis) {
|
|
18
|
+
ScrollAxis["Vertical"] = "scrollTop";
|
|
19
|
+
ScrollAxis["Horizontal"] = "scrollLeft";
|
|
20
|
+
})(ScrollAxis || (ScrollAxis = {}));
|
|
@@ -0,0 +1,80 @@
|
|
|
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 { Injectable } from '@angular/core';
|
|
6
|
+
import { Subscription, Subject, fromEvent } from 'rxjs';
|
|
7
|
+
import { distinctUntilChanged, map, take } from 'rxjs/operators';
|
|
8
|
+
import * as i0 from "@angular/core";
|
|
9
|
+
/**
|
|
10
|
+
* @hidden
|
|
11
|
+
*/
|
|
12
|
+
export class ScrollSyncService {
|
|
13
|
+
constructor(ngZone) {
|
|
14
|
+
this.ngZone = ngZone;
|
|
15
|
+
this.changes = new Subject();
|
|
16
|
+
this.elements = [];
|
|
17
|
+
this.subscriptions = new Subscription();
|
|
18
|
+
this.subscriptions.add(this.changes.subscribe(args => {
|
|
19
|
+
this.scroll(args);
|
|
20
|
+
}));
|
|
21
|
+
}
|
|
22
|
+
registerElement(el, sourceType) {
|
|
23
|
+
this.elements.push({ element: el, sourceType });
|
|
24
|
+
if (sourceType === "timeline" || sourceType === "treelist") {
|
|
25
|
+
this.ngZone.runOutsideAngular(() => {
|
|
26
|
+
const obs = fromEvent(el, 'scroll').pipe(map(({ target: { scrollTop, scrollLeft } }) => ({
|
|
27
|
+
scrollTop,
|
|
28
|
+
scrollLeft,
|
|
29
|
+
sourceType
|
|
30
|
+
})));
|
|
31
|
+
const comparisonFn = sourceType === 'timeline' ?
|
|
32
|
+
(x, y) => (x.scrollTop === y.scrollTop) && (x.scrollLeft === y.scrollLeft) :
|
|
33
|
+
(x, y) => (x.scrollTop === y.scrollTop);
|
|
34
|
+
this.subscriptions.add(obs.pipe(distinctUntilChanged(comparisonFn))
|
|
35
|
+
.subscribe((event) => this.changes.next(event)));
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
ngOnDestroy() {
|
|
40
|
+
this.subscriptions.unsubscribe();
|
|
41
|
+
this.elements = null;
|
|
42
|
+
}
|
|
43
|
+
syncScrollTop(sourceType, targetType) {
|
|
44
|
+
const source = this.elements.find(element => element.sourceType === sourceType);
|
|
45
|
+
const target = this.elements.find(element => element.sourceType === targetType);
|
|
46
|
+
// Need to wait for the splitter pane's content to be rendered
|
|
47
|
+
this.ngZone.onStable.pipe(take(1)).subscribe(() => target.element.scrollTop = source.element.scrollTop);
|
|
48
|
+
}
|
|
49
|
+
resetTimelineScrollLeft() {
|
|
50
|
+
const source = this.elements.find(element => element.sourceType === 'timeline');
|
|
51
|
+
source.element.scrollLeft = 0;
|
|
52
|
+
}
|
|
53
|
+
scroll({ scrollTop, scrollLeft, sourceType }) {
|
|
54
|
+
this.ngZone.runOutsideAngular(() => {
|
|
55
|
+
if (sourceType === 'timeline') {
|
|
56
|
+
const header = this.elements.find(element => element.sourceType === 'header').element;
|
|
57
|
+
header.scrollLeft = scrollLeft;
|
|
58
|
+
if (!this.syncingTimeline) {
|
|
59
|
+
this.syncingTreeList = true;
|
|
60
|
+
const treelist = this.elements.find(element => element.sourceType === 'treelist').element;
|
|
61
|
+
treelist.scrollTop = scrollTop;
|
|
62
|
+
}
|
|
63
|
+
this.syncingTimeline = false;
|
|
64
|
+
}
|
|
65
|
+
if (sourceType === 'treelist') {
|
|
66
|
+
if (!this.syncingTreeList) {
|
|
67
|
+
this.syncingTimeline = true;
|
|
68
|
+
const timeline = this.elements.find(element => element.sourceType === 'timeline').element;
|
|
69
|
+
timeline.scrollTop = scrollTop;
|
|
70
|
+
}
|
|
71
|
+
this.syncingTreeList = false;
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
ScrollSyncService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ScrollSyncService, deps: [{ token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
77
|
+
ScrollSyncService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ScrollSyncService });
|
|
78
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ScrollSyncService, decorators: [{
|
|
79
|
+
type: Injectable
|
|
80
|
+
}], ctorParameters: function () { return [{ type: i0.NgZone }]; } });
|
|
@@ -0,0 +1,75 @@
|
|
|
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 { Directive, Input } from '@angular/core';
|
|
6
|
+
import { Subscription } from 'rxjs';
|
|
7
|
+
import { isPresent } from '../utils';
|
|
8
|
+
import { ScrollAxis, ScrollDirection } from './drag-scroll-settings';
|
|
9
|
+
import { getViewportBoundaries, scrollElement } from './utils';
|
|
10
|
+
import * as i0 from "@angular/core";
|
|
11
|
+
import * as i1 from "./timeline-scroll.service";
|
|
12
|
+
/**
|
|
13
|
+
* @hidden
|
|
14
|
+
*/
|
|
15
|
+
export class TimelineScrollableDirective {
|
|
16
|
+
constructor(timelineScrollableContainer, scrollService, zone) {
|
|
17
|
+
this.timelineScrollableContainer = timelineScrollableContainer;
|
|
18
|
+
this.scrollService = scrollService;
|
|
19
|
+
this.zone = zone;
|
|
20
|
+
this.subscriptions = new Subscription();
|
|
21
|
+
this.subscriptions.add(this.scrollService.horizontalScroll
|
|
22
|
+
.subscribe(this.scrollHorizontallyTo.bind(this)));
|
|
23
|
+
this.subscriptions.add(this.scrollService.verticalScroll
|
|
24
|
+
.subscribe(this.scrollVerticallyTo.bind(this)));
|
|
25
|
+
this.subscriptions.add(this.scrollService.scrollCancel
|
|
26
|
+
.subscribe(this.cancelScroll.bind(this)));
|
|
27
|
+
}
|
|
28
|
+
ngOnDestroy() {
|
|
29
|
+
this.subscriptions.unsubscribe();
|
|
30
|
+
}
|
|
31
|
+
scrollHorizontallyTo(left) {
|
|
32
|
+
this.zone.runOutsideAngular(() => {
|
|
33
|
+
const container = this.timelineScrollableContainer.nativeElement;
|
|
34
|
+
const visibleBoundaries = getViewportBoundaries(container);
|
|
35
|
+
if (left < visibleBoundaries.left + this.scrollSettings.threshold) {
|
|
36
|
+
this.horizontalScrollInterval = setInterval(() => scrollElement(container, this.scrollSettings.step, ScrollDirection.Backwards, ScrollAxis.Horizontal), this.scrollSettings.interval);
|
|
37
|
+
}
|
|
38
|
+
else if (left > visibleBoundaries.right - this.scrollSettings.threshold) {
|
|
39
|
+
this.horizontalScrollInterval = setInterval(() => scrollElement(container, this.scrollSettings.step, ScrollDirection.Forward, ScrollAxis.Horizontal), this.scrollSettings.interval);
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
scrollVerticallyTo(top) {
|
|
44
|
+
this.zone.runOutsideAngular(() => {
|
|
45
|
+
const container = this.timelineScrollableContainer.nativeElement;
|
|
46
|
+
const visibleBoundaries = getViewportBoundaries(container);
|
|
47
|
+
if (top < visibleBoundaries.top + this.scrollSettings.threshold) {
|
|
48
|
+
this.verticalScrollInterval = setInterval(() => scrollElement(container, this.scrollSettings.step, ScrollDirection.Backwards, ScrollAxis.Vertical), this.scrollSettings.interval);
|
|
49
|
+
}
|
|
50
|
+
else if (top > visibleBoundaries.bottom - this.scrollSettings.threshold) {
|
|
51
|
+
this.verticalScrollInterval = setInterval(() => scrollElement(container, this.scrollSettings.step, ScrollDirection.Forward, ScrollAxis.Vertical), this.scrollSettings.interval);
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
cancelScroll() {
|
|
56
|
+
if (isPresent(this.verticalScrollInterval)) {
|
|
57
|
+
clearInterval(this.verticalScrollInterval);
|
|
58
|
+
this.verticalScrollInterval = null;
|
|
59
|
+
}
|
|
60
|
+
if (isPresent(this.horizontalScrollInterval)) {
|
|
61
|
+
clearInterval(this.horizontalScrollInterval);
|
|
62
|
+
this.horizontalScrollInterval = null;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
TimelineScrollableDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TimelineScrollableDirective, deps: [{ token: i0.ElementRef }, { token: i1.TimelineScrollService }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Directive });
|
|
67
|
+
TimelineScrollableDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: TimelineScrollableDirective, selector: "[kendoGanttTimelineScrollable]", inputs: { scrollSettings: "scrollSettings" }, ngImport: i0 });
|
|
68
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TimelineScrollableDirective, decorators: [{
|
|
69
|
+
type: Directive,
|
|
70
|
+
args: [{
|
|
71
|
+
selector: '[kendoGanttTimelineScrollable]'
|
|
72
|
+
}]
|
|
73
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i1.TimelineScrollService }, { type: i0.NgZone }]; }, propDecorators: { scrollSettings: [{
|
|
74
|
+
type: Input
|
|
75
|
+
}] } });
|
|
@@ -0,0 +1,39 @@
|
|
|
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 { Injectable } from '@angular/core';
|
|
6
|
+
import { Subject } from 'rxjs';
|
|
7
|
+
import * as i0 from "@angular/core";
|
|
8
|
+
/**
|
|
9
|
+
* @hidden
|
|
10
|
+
*
|
|
11
|
+
* Notifies the timeline-scroll.directive to scroll into view to requested coordinates.
|
|
12
|
+
* The scrolling is performed based on client (viewport) coordinates.
|
|
13
|
+
*/
|
|
14
|
+
export class TimelineScrollService {
|
|
15
|
+
constructor() {
|
|
16
|
+
this.horizontalScroll = new Subject();
|
|
17
|
+
this.verticalScroll = new Subject();
|
|
18
|
+
this.scrollCancel = new Subject();
|
|
19
|
+
}
|
|
20
|
+
ngOnDestroy() {
|
|
21
|
+
this.horizontalScroll.complete();
|
|
22
|
+
this.verticalScroll.complete();
|
|
23
|
+
this.scrollCancel.complete();
|
|
24
|
+
}
|
|
25
|
+
requestHorizontalScroll(clientTop) {
|
|
26
|
+
this.horizontalScroll.next(clientTop);
|
|
27
|
+
}
|
|
28
|
+
requestVerticalScroll(clientLeft) {
|
|
29
|
+
this.verticalScroll.next(clientLeft);
|
|
30
|
+
}
|
|
31
|
+
requestScrollCancel() {
|
|
32
|
+
this.scrollCancel.next();
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
TimelineScrollService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TimelineScrollService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
36
|
+
TimelineScrollService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TimelineScrollService });
|
|
37
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TimelineScrollService, decorators: [{
|
|
38
|
+
type: Injectable
|
|
39
|
+
}] });
|
|
@@ -0,0 +1,77 @@
|
|
|
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 { isDocumentAvailable } from '@progress/kendo-angular-common';
|
|
6
|
+
import { ScrollAxis, ScrollDirection } from './drag-scroll-settings';
|
|
7
|
+
import { isPresent } from '../utils';
|
|
8
|
+
/**
|
|
9
|
+
* @hidden
|
|
10
|
+
*
|
|
11
|
+
* Checks if the beginning of the scrollable element is reached (top/left).
|
|
12
|
+
* Floors the top value.
|
|
13
|
+
*/
|
|
14
|
+
const isUpperLimitReached = (element, axis) => Math.floor(element[axis]) <= 0;
|
|
15
|
+
/**
|
|
16
|
+
* @hidden
|
|
17
|
+
*
|
|
18
|
+
* Checks if the end of the scrollable element is reached (bottom/right).
|
|
19
|
+
* Ceils the top value.
|
|
20
|
+
*/
|
|
21
|
+
const isBottomLimitReached = (element, axis) => {
|
|
22
|
+
const elementSize = axis === ScrollAxis.Horizontal ?
|
|
23
|
+
element.scrollWidth - element.clientWidth :
|
|
24
|
+
element.scrollHeight - element.clientHeight;
|
|
25
|
+
return Math.ceil(element[axis]) >= elementSize;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* @hidden
|
|
29
|
+
*
|
|
30
|
+
* Scrolls the element in the given direction by the provided step in the provided scroll axis.
|
|
31
|
+
*
|
|
32
|
+
* If the targeted scroll incrementation doesn't yield any result due to device pixel ratio issues (https://github.com/dimitar-pechev/RenderingIndependentScrollOffsets#readme),
|
|
33
|
+
* increments the step with 1px and again attempts to change the scrollTop of the element, until the content is actually scrolled.
|
|
34
|
+
*
|
|
35
|
+
* Cuts the operation short after 20 unsuccessful attempts to prevent infinite loops in possible corner-case scenarios.
|
|
36
|
+
*/
|
|
37
|
+
export const scrollElement = (element, step, direction, scrollAxis) => {
|
|
38
|
+
if (!(isPresent(element) && isDocumentAvailable())) {
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
const initialScrollPosition = element[scrollAxis];
|
|
42
|
+
let currentStep = step;
|
|
43
|
+
let iterations = 0;
|
|
44
|
+
while (initialScrollPosition === element[scrollAxis] &&
|
|
45
|
+
!(direction === ScrollDirection.Backwards && isUpperLimitReached(element, scrollAxis)) &&
|
|
46
|
+
!(direction === ScrollDirection.Forward && isBottomLimitReached(element, scrollAxis)) &&
|
|
47
|
+
iterations < 20 // cut the operation short in 20 attempts - in case of a wild corner case
|
|
48
|
+
) {
|
|
49
|
+
element[scrollAxis] += (currentStep * direction);
|
|
50
|
+
// try with a larger step if the current one doesn't update the scroll position successfully
|
|
51
|
+
currentStep += 1;
|
|
52
|
+
iterations += 1;
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
/**
|
|
56
|
+
* @hidden
|
|
57
|
+
*
|
|
58
|
+
* As client coordinates are not restricted to the range 0px - {viewportSize}px, but can have negative starting values or ending values greater than the viewport size,
|
|
59
|
+
* this function extracts the visible boundaries of the provided element - fall-backing to 0 when the top/left are below 0,
|
|
60
|
+
* and fall-backing to the actual visible size of the container for bottom/right.
|
|
61
|
+
*/
|
|
62
|
+
export const getViewportBoundaries = (element) => {
|
|
63
|
+
const elementRect = element.getBoundingClientRect();
|
|
64
|
+
// if the beginning of the scrollable container is above/before the current viewport, fall-back to 0
|
|
65
|
+
const topLimit = Math.max(elementRect.top, 0);
|
|
66
|
+
const leftLimit = Math.max(elementRect.left, 0);
|
|
67
|
+
// if the end of the scrollable container is beneath/after the current viewport, fall-back to its client height
|
|
68
|
+
// add the distance from the start of the viewport to the beginning of the container to ensure scrolling bottom begins when the actual end of the container is reached
|
|
69
|
+
const bottomLimit = topLimit + Math.min(elementRect.bottom, element.clientHeight);
|
|
70
|
+
const rightLimit = leftLimit + Math.min(elementRect.right, element.clientWidth);
|
|
71
|
+
return {
|
|
72
|
+
top: topLimit,
|
|
73
|
+
bottom: bottomLimit,
|
|
74
|
+
left: leftLimit,
|
|
75
|
+
right: rightLimit
|
|
76
|
+
};
|
|
77
|
+
};
|
|
@@ -0,0 +1,112 @@
|
|
|
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 { Directive, Input, Output, EventEmitter } from '@angular/core';
|
|
6
|
+
import { getter } from '@progress/kendo-common';
|
|
7
|
+
import { isPresent, isString } from '../utils';
|
|
8
|
+
import * as i0 from "@angular/core";
|
|
9
|
+
import * as i1 from "../gantt.component";
|
|
10
|
+
/**
|
|
11
|
+
* A directive which handles the [`selectionChange`]({% slug api_gantt_ganttcomponent %}#toc-selectionchange) event of the Gantt
|
|
12
|
+
* ([see example]({% slug selection_gantt %}#toc-built-in-directive))
|
|
13
|
+
*/
|
|
14
|
+
export class SelectableDirective {
|
|
15
|
+
constructor(gantt) {
|
|
16
|
+
this.gantt = gantt;
|
|
17
|
+
/**
|
|
18
|
+
* Fires when the selected keys are changed.
|
|
19
|
+
*/
|
|
20
|
+
this.selectedKeysChange = new EventEmitter();
|
|
21
|
+
this.state = new Set();
|
|
22
|
+
this.isSelected = this.isSelected.bind(this);
|
|
23
|
+
this.selectionChange = this.selectionChange.bind(this);
|
|
24
|
+
this.selectable = true;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* @hidden
|
|
28
|
+
*/
|
|
29
|
+
set selectable(value) {
|
|
30
|
+
if (value) {
|
|
31
|
+
this.gantt.isSelected = this.isSelected;
|
|
32
|
+
this.subscribeSelection();
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
this.gantt.isSelected = () => false;
|
|
36
|
+
this.unsubscribeSelection();
|
|
37
|
+
}
|
|
38
|
+
this.gantt.selectable = value;
|
|
39
|
+
this.gantt.updateView();
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Sets the selected keys.
|
|
43
|
+
*/
|
|
44
|
+
set selectedKeys(value) {
|
|
45
|
+
if (isPresent(value) && value === this.lastChange) {
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
// prevent multiple items displayed as selected as multiple selection still not supported fully
|
|
49
|
+
const keys = (value || []).slice(0, 1);
|
|
50
|
+
this.state = new Set(keys);
|
|
51
|
+
this.gantt.updateView();
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* The field name or a function that specifies the data item unique key identifier.
|
|
55
|
+
* By default, the string field `id` is used.
|
|
56
|
+
*/
|
|
57
|
+
set itemKey(value) {
|
|
58
|
+
if (isString(value)) {
|
|
59
|
+
this._keyGetter = getter(value);
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
this._keyGetter = value;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
get keyGetter() {
|
|
66
|
+
return this._keyGetter || this.gantt.idGetter;
|
|
67
|
+
}
|
|
68
|
+
ngOnDestroy() {
|
|
69
|
+
this.unsubscribeSelection();
|
|
70
|
+
}
|
|
71
|
+
isSelected(dataItem) {
|
|
72
|
+
return this.state.has(this.keyGetter(dataItem));
|
|
73
|
+
}
|
|
74
|
+
selectionChange({ action, items }) {
|
|
75
|
+
this.state.clear();
|
|
76
|
+
if (action === 'select') {
|
|
77
|
+
items.forEach(item => this.state.add(this.keyGetter(item)));
|
|
78
|
+
}
|
|
79
|
+
this.emitSelectedItemsChange();
|
|
80
|
+
}
|
|
81
|
+
emitSelectedItemsChange() {
|
|
82
|
+
this.lastChange = Array.from(this.state);
|
|
83
|
+
this.selectedKeysChange.emit(this.lastChange);
|
|
84
|
+
}
|
|
85
|
+
subscribeSelection() {
|
|
86
|
+
this.unsubscribeSelection();
|
|
87
|
+
this.selectionSubscription = this.gantt.selectionChange.subscribe(this.selectionChange);
|
|
88
|
+
}
|
|
89
|
+
unsubscribeSelection() {
|
|
90
|
+
if (this.selectionSubscription) {
|
|
91
|
+
this.selectionSubscription.unsubscribe();
|
|
92
|
+
this.selectionSubscription = null;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
SelectableDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SelectableDirective, deps: [{ token: i1.GanttComponent }], target: i0.ɵɵFactoryTarget.Directive });
|
|
97
|
+
SelectableDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: SelectableDirective, selector: "[kendoGanttSelectable]", inputs: { selectable: "selectable", selectedKeys: "selectedKeys", itemKey: "itemKey" }, outputs: { selectedKeysChange: "selectedKeysChange" }, exportAs: ["kendoGanttSelectable"], ngImport: i0 });
|
|
98
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SelectableDirective, decorators: [{
|
|
99
|
+
type: Directive,
|
|
100
|
+
args: [{
|
|
101
|
+
exportAs: 'kendoGanttSelectable',
|
|
102
|
+
selector: '[kendoGanttSelectable]'
|
|
103
|
+
}]
|
|
104
|
+
}], ctorParameters: function () { return [{ type: i1.GanttComponent }]; }, propDecorators: { selectable: [{
|
|
105
|
+
type: Input
|
|
106
|
+
}], selectedKeys: [{
|
|
107
|
+
type: Input
|
|
108
|
+
}], selectedKeysChange: [{
|
|
109
|
+
type: Output
|
|
110
|
+
}], itemKey: [{
|
|
111
|
+
type: Input
|
|
112
|
+
}] } });
|
|
@@ -0,0 +1,5 @@
|
|
|
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
|
+
export {};
|
|
@@ -0,0 +1,50 @@
|
|
|
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 { Directive, Optional } from '@angular/core';
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
/**
|
|
8
|
+
* Represents a template that defines the whole content of the summary task component.
|
|
9
|
+
* To define the template, nest an `<ng-template>` tag
|
|
10
|
+
* with the `kendoGanttSummaryTaskTemplate` directive inside the `<kendo-gantt>` tag.
|
|
11
|
+
*
|
|
12
|
+
* The template context is set to the current data item. The following additional field is passed:
|
|
13
|
+
* - `elementWidth`—The current summary task wrapper element's calculated width in pixels based on its start and end date.
|
|
14
|
+
* Use it as an alias for a template variable by utilizing the `let-elementWidth="elementWidth"` syntax.
|
|
15
|
+
* Useful for calculations related to rendering custom elements representing the task progress.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```ts-preview
|
|
19
|
+
* _@Component({
|
|
20
|
+
* selector: 'my-app',
|
|
21
|
+
* template: `
|
|
22
|
+
* <kendo-gantt [kendoGanttHierarchyBinding]="data">
|
|
23
|
+
* <ng-template kendoGanttSummaryTaskTemplate let-dataItem let-elementWidth="elementWidth">
|
|
24
|
+
* <div style="color: white; font-size: 8px;">
|
|
25
|
+
* {{ dataItem.title }} - {{ dataItem.completionRatio * 100 }}% complete; width: {{ elementWidth }}
|
|
26
|
+
* </div>
|
|
27
|
+
* </ng-template>
|
|
28
|
+
* </kendo-gantt>
|
|
29
|
+
* `
|
|
30
|
+
* })
|
|
31
|
+
* class AppComponent {
|
|
32
|
+
* public data: any[] = sampleTasks;
|
|
33
|
+
* }
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
export class GanttSummaryTaskTemplateDirective {
|
|
37
|
+
constructor(templateRef) {
|
|
38
|
+
this.templateRef = templateRef;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
GanttSummaryTaskTemplateDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: GanttSummaryTaskTemplateDirective, deps: [{ token: i0.TemplateRef, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
|
|
42
|
+
GanttSummaryTaskTemplateDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: GanttSummaryTaskTemplateDirective, selector: "[kendoGanttSummaryTaskTemplate]", ngImport: i0 });
|
|
43
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: GanttSummaryTaskTemplateDirective, decorators: [{
|
|
44
|
+
type: Directive,
|
|
45
|
+
args: [{
|
|
46
|
+
selector: '[kendoGanttSummaryTaskTemplate]'
|
|
47
|
+
}]
|
|
48
|
+
}], ctorParameters: function () { return [{ type: i0.TemplateRef, decorators: [{
|
|
49
|
+
type: Optional
|
|
50
|
+
}] }]; } });
|