@progress/kendo-angular-gantt 0.3.0-dev.202201111723 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cdn/js/kendo-angular-gantt.js +2 -2
- package/dist/cdn/main.js +1 -29
- package/dist/es/common/touch-enabled.js +9 -0
- package/dist/es/dependencies/utils.js +34 -0
- package/dist/es/dragging/dependency-drag-create.directive.js +347 -0
- package/dist/es/dragging/drag-validation-tooltip.component.js +27 -0
- package/dist/es/editing/dependencies-table.component.js +1 -1
- package/dist/es/editing/edit-dialog.component.js +3 -3
- package/dist/es/editing/edit.service.js +4 -2
- package/dist/es/editing/task-fields.component.js +1 -1
- package/dist/es/editing/{util.js → utils.js} +0 -0
- package/dist/es/gantt.component.js +313 -28
- package/dist/es/gantt.module.js +23 -6
- package/dist/es/index.js +5 -0
- package/dist/es/main.js +1 -0
- package/dist/es/models/events/dependency-add-event.interface.js +4 -0
- package/dist/es/models/events/task-delete-event.interface.js +4 -0
- package/dist/es/models/view-item.interface.js +4 -0
- package/dist/es/navigation/navigation-models.js +4 -0
- package/dist/es/navigation/navigation.service.js +390 -0
- package/dist/es/navigation/utils.js +77 -0
- package/dist/es/package-metadata.js +1 -1
- package/dist/es/rendering/gantt-milestone-task.component.js +12 -6
- package/dist/es/rendering/gantt-summary-task.component.js +27 -6
- package/dist/es/rendering/gantt-task-base.js +84 -22
- package/dist/es/rendering/gantt-task.component.js +13 -8
- package/dist/es/rendering/gantt-tasks-table-body.component.js +13 -5
- package/dist/es/scrolling/drag-scroll-settings.js +20 -0
- package/dist/es/scrolling/timeline-scroll.directive.js +89 -0
- package/dist/es/scrolling/timeline-scroll.service.js +39 -0
- package/dist/es/scrolling/utils.js +80 -0
- package/dist/es/timeline/gantt-timeline.component.js +50 -4
- package/dist/es/toolbar/toolbar.component.js +12 -13
- package/dist/es/toolbar/view-selector.component.js +1 -1
- package/dist/es/utils.js +153 -12
- package/dist/es2015/common/touch-enabled.d.ts +9 -0
- package/dist/es2015/common/touch-enabled.js +9 -0
- package/dist/es2015/dependencies/utils.d.ts +15 -0
- package/dist/es2015/dependencies/utils.js +34 -0
- package/dist/es2015/dragging/dependency-drag-create.directive.d.ts +72 -0
- package/dist/es2015/dragging/dependency-drag-create.directive.js +324 -0
- package/dist/es2015/dragging/drag-validation-tooltip.component.d.ts +29 -0
- package/dist/es2015/dragging/drag-validation-tooltip.component.js +76 -0
- package/dist/es2015/editing/dependencies-table.component.js +1 -1
- package/dist/es2015/editing/edit-dialog.component.d.ts +1 -1
- package/dist/es2015/editing/edit-dialog.component.js +12 -4
- package/dist/es2015/editing/edit.service.d.ts +2 -3
- package/dist/es2015/editing/edit.service.js +4 -2
- package/dist/es2015/editing/task-fields.component.js +1 -1
- package/dist/es2015/editing/{util.d.ts → utils.d.ts} +2 -2
- package/dist/es2015/editing/{util.js → utils.js} +0 -0
- package/dist/es2015/gantt.component.d.ts +112 -17
- package/dist/es2015/gantt.component.js +292 -30
- package/dist/es2015/gantt.module.js +23 -6
- package/dist/es2015/index.d.ts +5 -0
- package/dist/es2015/index.js +5 -0
- package/dist/es2015/index.metadata.json +1 -1
- package/dist/es2015/main.d.ts +1 -0
- package/dist/es2015/main.js +1 -0
- package/dist/es2015/models/events/dependency-add-event.interface.d.ts +26 -0
- package/dist/es2015/models/events/dependency-add-event.interface.js +4 -0
- package/dist/es2015/models/events/task-click-event.interface.d.ts +3 -3
- package/dist/es2015/models/events/task-delete-event.interface.d.ts +21 -0
- package/dist/es2015/models/events/task-delete-event.interface.js +4 -0
- package/dist/es2015/models/events/task-edit-event.interface.d.ts +27 -10
- package/dist/es2015/models/models.d.ts +4 -0
- package/dist/es2015/models/view-item.interface.d.ts +35 -0
- package/dist/es2015/models/view-item.interface.js +4 -0
- package/dist/es2015/navigation/navigation-models.d.ts +34 -0
- package/dist/es2015/navigation/navigation-models.js +4 -0
- package/dist/es2015/navigation/navigation.service.d.ts +126 -0
- package/dist/es2015/navigation/navigation.service.js +355 -0
- package/dist/es2015/navigation/utils.d.ts +26 -0
- package/dist/es2015/navigation/utils.js +69 -0
- package/dist/es2015/package-metadata.js +1 -1
- package/dist/es2015/rendering/gantt-milestone-task.component.d.ts +3 -1
- package/dist/es2015/rendering/gantt-milestone-task.component.js +35 -8
- package/dist/es2015/rendering/gantt-summary-task.component.d.ts +5 -1
- package/dist/es2015/rendering/gantt-summary-task.component.js +47 -8
- package/dist/es2015/rendering/gantt-task-base.d.ts +20 -6
- package/dist/es2015/rendering/gantt-task-base.js +75 -22
- package/dist/es2015/rendering/gantt-task.component.d.ts +4 -2
- package/dist/es2015/rendering/gantt-task.component.js +47 -13
- package/dist/es2015/rendering/gantt-tasks-table-body.component.d.ts +6 -3
- package/dist/es2015/rendering/gantt-tasks-table-body.component.js +27 -9
- package/dist/es2015/scrolling/drag-scroll-settings.d.ts +47 -0
- package/dist/es2015/scrolling/drag-scroll-settings.js +20 -0
- package/dist/es2015/scrolling/scroll-sync.service.d.ts +1 -1
- package/dist/es2015/scrolling/timeline-scroll.directive.d.ts +24 -0
- package/dist/es2015/scrolling/timeline-scroll.directive.js +78 -0
- package/dist/es2015/scrolling/timeline-scroll.service.d.ts +20 -0
- package/dist/es2015/scrolling/timeline-scroll.service.js +44 -0
- package/dist/es2015/scrolling/utils.d.ts +29 -0
- package/dist/es2015/scrolling/utils.js +80 -0
- package/dist/es2015/timeline/gantt-timeline.component.d.ts +29 -4
- package/dist/es2015/timeline/gantt-timeline.component.js +67 -5
- package/dist/es2015/toolbar/toolbar.component.d.ts +4 -5
- package/dist/es2015/toolbar/toolbar.component.js +12 -13
- package/dist/es2015/toolbar/view-selector.component.js +3 -1
- package/dist/es2015/utils.d.ts +77 -8
- package/dist/es2015/utils.js +153 -12
- package/dist/fesm2015/index.js +3033 -1367
- package/dist/fesm5/index.js +2447 -830
- package/dist/npm/common/touch-enabled.js +11 -0
- package/dist/npm/dependencies/utils.js +34 -0
- package/dist/npm/dragging/dependency-drag-create.directive.js +349 -0
- package/dist/npm/dragging/drag-validation-tooltip.component.js +29 -0
- package/dist/npm/editing/dependencies-table.component.js +1 -1
- package/dist/npm/editing/edit-dialog.component.js +3 -3
- package/dist/npm/editing/edit.service.js +4 -2
- package/dist/npm/editing/task-fields.component.js +1 -1
- package/dist/npm/editing/{util.js → utils.js} +0 -0
- package/dist/npm/gantt.component.js +315 -30
- package/dist/npm/gantt.module.js +22 -5
- package/dist/npm/index.js +10 -0
- package/dist/npm/main.js +2 -0
- package/dist/npm/models/events/dependency-add-event.interface.js +6 -0
- package/dist/npm/models/events/task-delete-event.interface.js +6 -0
- package/dist/npm/models/view-item.interface.js +6 -0
- package/dist/npm/navigation/navigation-models.js +6 -0
- package/dist/npm/navigation/navigation.service.js +392 -0
- package/dist/npm/navigation/utils.js +79 -0
- package/dist/npm/package-metadata.js +1 -1
- package/dist/npm/rendering/gantt-milestone-task.component.js +11 -5
- package/dist/npm/rendering/gantt-summary-task.component.js +26 -5
- package/dist/npm/rendering/gantt-task-base.js +84 -22
- package/dist/npm/rendering/gantt-task.component.js +12 -7
- package/dist/npm/rendering/gantt-tasks-table-body.component.js +13 -5
- package/dist/npm/scrolling/drag-scroll-settings.js +22 -0
- package/dist/npm/scrolling/timeline-scroll.directive.js +91 -0
- package/dist/npm/scrolling/timeline-scroll.service.js +41 -0
- package/dist/npm/scrolling/utils.js +83 -0
- package/dist/npm/timeline/gantt-timeline.component.js +49 -3
- package/dist/npm/toolbar/toolbar.component.js +10 -11
- package/dist/npm/toolbar/view-selector.component.js +1 -1
- package/dist/npm/utils.js +153 -12
- package/dist/systemjs/kendo-angular-gantt.js +1 -1
- package/package.json +23 -21
|
@@ -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
|
+
import { Subject } from 'rxjs';
|
|
6
|
+
/**
|
|
7
|
+
* @hidden
|
|
8
|
+
*
|
|
9
|
+
* Notifies the timeline-scroll.directive to scroll into view to requested coordinates.
|
|
10
|
+
* The scrolling is performed based on client (viewport) coordinates.
|
|
11
|
+
*/
|
|
12
|
+
export declare class TimelineScrollService {
|
|
13
|
+
readonly horizontalScroll: Subject<number>;
|
|
14
|
+
readonly verticalScroll: Subject<number>;
|
|
15
|
+
readonly scrollCancel: Subject<any>;
|
|
16
|
+
ngOnDestroy(): void;
|
|
17
|
+
requestHorizontalScroll(clientTop: number): void;
|
|
18
|
+
requestVerticalScroll(clientLeft: number): void;
|
|
19
|
+
requestScrollCancel(): void;
|
|
20
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
import * as tslib_1 from "tslib";
|
|
6
|
+
import { Injectable } from '@angular/core';
|
|
7
|
+
import { Subject } from 'rxjs';
|
|
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
|
+
let TimelineScrollService = class TimelineScrollService {
|
|
15
|
+
/**
|
|
16
|
+
* @hidden
|
|
17
|
+
*
|
|
18
|
+
* Notifies the timeline-scroll.directive to scroll into view to requested coordinates.
|
|
19
|
+
* The scrolling is performed based on client (viewport) coordinates.
|
|
20
|
+
*/
|
|
21
|
+
constructor() {
|
|
22
|
+
this.horizontalScroll = new Subject();
|
|
23
|
+
this.verticalScroll = new Subject();
|
|
24
|
+
this.scrollCancel = new Subject();
|
|
25
|
+
}
|
|
26
|
+
ngOnDestroy() {
|
|
27
|
+
this.horizontalScroll.complete();
|
|
28
|
+
this.verticalScroll.complete();
|
|
29
|
+
this.scrollCancel.complete();
|
|
30
|
+
}
|
|
31
|
+
requestHorizontalScroll(clientTop) {
|
|
32
|
+
this.horizontalScroll.next(clientTop);
|
|
33
|
+
}
|
|
34
|
+
requestVerticalScroll(clientLeft) {
|
|
35
|
+
this.verticalScroll.next(clientLeft);
|
|
36
|
+
}
|
|
37
|
+
requestScrollCancel() {
|
|
38
|
+
this.scrollCancel.next();
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
TimelineScrollService = tslib_1.__decorate([
|
|
42
|
+
Injectable()
|
|
43
|
+
], TimelineScrollService);
|
|
44
|
+
export { TimelineScrollService };
|
|
@@ -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
|
+
import { ScrollAxis, ScrollDirection } from './drag-scroll-settings';
|
|
6
|
+
/**
|
|
7
|
+
* @hidden
|
|
8
|
+
*
|
|
9
|
+
* Scrolls the element in the given direction by the provided step in the provided scroll axis.
|
|
10
|
+
*
|
|
11
|
+
* If the targeted scroll incrementation doesn't yield any result due to device pixel ratio issues (https://github.com/dimitar-pechev/RenderingIndependentScrollOffsets#readme),
|
|
12
|
+
* increments the step with 1px and again attempts to change the scrollTop of the element, until the content is actually scrolled.
|
|
13
|
+
*
|
|
14
|
+
* Cuts the operation short after 20 unsuccessful attempts to prevent infinite loops in possible corner-case scenarios.
|
|
15
|
+
*/
|
|
16
|
+
export declare const scrollElement: (element: Element, step: number, direction: ScrollDirection, scrollAxis: ScrollAxis) => void;
|
|
17
|
+
/**
|
|
18
|
+
* @hidden
|
|
19
|
+
*
|
|
20
|
+
* 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,
|
|
21
|
+
* this function extracts the visible boundaries of the provided element - fall-backing to 0 when the top/left are below 0,
|
|
22
|
+
* and fall-backing to the actual visible size of the container for bottom/right.
|
|
23
|
+
*/
|
|
24
|
+
export declare const getViewportBoundaries: (element: Element) => {
|
|
25
|
+
top: number;
|
|
26
|
+
left: number;
|
|
27
|
+
right: number;
|
|
28
|
+
bottom: number;
|
|
29
|
+
};
|
|
@@ -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 { 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
|
+
const ɵ0 = isUpperLimitReached;
|
|
16
|
+
/**
|
|
17
|
+
* @hidden
|
|
18
|
+
*
|
|
19
|
+
* Checks if the end of the scrollable element is reached (bottom/right).
|
|
20
|
+
* Ceils the top value.
|
|
21
|
+
*/
|
|
22
|
+
const isBottomLimitReached = (element, axis) => {
|
|
23
|
+
const elementSize = axis === ScrollAxis.Horizontal ?
|
|
24
|
+
element.scrollWidth - element.clientWidth :
|
|
25
|
+
element.scrollHeight - element.clientHeight;
|
|
26
|
+
return Math.ceil(element[axis]) >= elementSize;
|
|
27
|
+
};
|
|
28
|
+
const ɵ1 = isBottomLimitReached;
|
|
29
|
+
/**
|
|
30
|
+
* @hidden
|
|
31
|
+
*
|
|
32
|
+
* Scrolls the element in the given direction by the provided step in the provided scroll axis.
|
|
33
|
+
*
|
|
34
|
+
* If the targeted scroll incrementation doesn't yield any result due to device pixel ratio issues (https://github.com/dimitar-pechev/RenderingIndependentScrollOffsets#readme),
|
|
35
|
+
* increments the step with 1px and again attempts to change the scrollTop of the element, until the content is actually scrolled.
|
|
36
|
+
*
|
|
37
|
+
* Cuts the operation short after 20 unsuccessful attempts to prevent infinite loops in possible corner-case scenarios.
|
|
38
|
+
*/
|
|
39
|
+
export const scrollElement = (element, step, direction, scrollAxis) => {
|
|
40
|
+
if (!(isPresent(element) && isDocumentAvailable())) {
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
const initialScrollPosition = element[scrollAxis];
|
|
44
|
+
let currentStep = step;
|
|
45
|
+
let iterations = 0;
|
|
46
|
+
while (initialScrollPosition === element[scrollAxis] &&
|
|
47
|
+
!(direction === ScrollDirection.Backwards && isUpperLimitReached(element, scrollAxis)) &&
|
|
48
|
+
!(direction === ScrollDirection.Forward && isBottomLimitReached(element, scrollAxis)) &&
|
|
49
|
+
iterations < 20 // cut the operation short in 20 attempts - in case of a wild corner case
|
|
50
|
+
) {
|
|
51
|
+
element[scrollAxis] += (currentStep * direction);
|
|
52
|
+
// try with a larger step if the current one doesn't update the scroll position successfully
|
|
53
|
+
currentStep += 1;
|
|
54
|
+
iterations += 1;
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
/**
|
|
58
|
+
* @hidden
|
|
59
|
+
*
|
|
60
|
+
* 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,
|
|
61
|
+
* this function extracts the visible boundaries of the provided element - fall-backing to 0 when the top/left are below 0,
|
|
62
|
+
* and fall-backing to the actual visible size of the container for bottom/right.
|
|
63
|
+
*/
|
|
64
|
+
export const getViewportBoundaries = (element) => {
|
|
65
|
+
const elementRect = element.getBoundingClientRect();
|
|
66
|
+
// if the beginning of the scrollable container is above/before the current viewport, fall-back to 0
|
|
67
|
+
const topLimit = Math.max(elementRect.top, 0);
|
|
68
|
+
const leftLimit = Math.max(elementRect.left, 0);
|
|
69
|
+
// if the end of the scrollable container is beneath/after the current viewport, fall-back to its client height
|
|
70
|
+
// 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
|
|
71
|
+
const bottomLimit = topLimit + Math.min(elementRect.bottom, element.clientHeight);
|
|
72
|
+
const rightLimit = leftLimit + Math.min(elementRect.right, element.clientWidth);
|
|
73
|
+
return {
|
|
74
|
+
top: topLimit,
|
|
75
|
+
bottom: bottomLimit,
|
|
76
|
+
left: leftLimit,
|
|
77
|
+
right: rightLimit
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
export { ɵ0, ɵ1 };
|
|
@@ -2,10 +2,11 @@
|
|
|
2
2
|
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
import { AfterViewInit, ElementRef, NgZone, Renderer2, TemplateRef } from '@angular/core';
|
|
5
|
+
import { AfterViewInit, ElementRef, EventEmitter, NgZone, Renderer2, TemplateRef, ViewContainerRef } from '@angular/core';
|
|
6
6
|
import { ScrollSyncService } from '../scrolling/scroll-sync.service';
|
|
7
7
|
import { DependencyDomService } from '../dependencies/dependency-dom.service';
|
|
8
|
-
import {
|
|
8
|
+
import { ViewItem } from '../models/view-item.interface';
|
|
9
|
+
import { TimelineViewType, TaskClassFn, DragScrollSettings } from '../models/models';
|
|
9
10
|
/**
|
|
10
11
|
* @hidden
|
|
11
12
|
*/
|
|
@@ -14,12 +15,26 @@ export declare class GanttTimelineComponent implements AfterViewInit {
|
|
|
14
15
|
private dependencyDomService;
|
|
15
16
|
private renderer;
|
|
16
17
|
private zone;
|
|
18
|
+
/**
|
|
19
|
+
* Represents the scrollable container of the timeline content.
|
|
20
|
+
* Used externally by the DependencyDragCreateDirective.
|
|
21
|
+
*/
|
|
17
22
|
timelineContent: ElementRef<HTMLElement>;
|
|
18
23
|
timelineColumns: ElementRef<HTMLElement>;
|
|
19
24
|
timelineHeaderWrap: ElementRef<HTMLElement>;
|
|
20
25
|
tasksContainer: ElementRef<HTMLElement>;
|
|
26
|
+
/**
|
|
27
|
+
* Represents the view container ref used for rendering the dependency drag popop.
|
|
28
|
+
* Used externally by the DependencyDragCreateDirective.
|
|
29
|
+
*/
|
|
30
|
+
dragPopupContainer: ViewContainerRef;
|
|
31
|
+
/**
|
|
32
|
+
* Represents the polyline element used for rendering the dependency drag editing interaction.
|
|
33
|
+
* Used externally by the DependencyDragCreateDirective.
|
|
34
|
+
*/
|
|
35
|
+
dependencyDragCreatePolyline: ElementRef<SVGPolylineElement>;
|
|
21
36
|
hostClass: boolean;
|
|
22
|
-
rows:
|
|
37
|
+
rows: ViewItem[];
|
|
23
38
|
slots: any[];
|
|
24
39
|
groupSlots: any[];
|
|
25
40
|
tableWidth: number;
|
|
@@ -28,9 +43,19 @@ export declare class GanttTimelineComponent implements AfterViewInit {
|
|
|
28
43
|
taskTemplate: TemplateRef<any>;
|
|
29
44
|
summaryTaskTemplate: TemplateRef<any>;
|
|
30
45
|
taskClass: TaskClassFn;
|
|
46
|
+
renderDependencyDragClues: boolean;
|
|
47
|
+
dragScrollSettings: DragScrollSettings;
|
|
48
|
+
selectable: boolean;
|
|
31
49
|
isTaskSelected: (item: object) => boolean;
|
|
32
|
-
|
|
50
|
+
isExpanded: (item: object) => boolean;
|
|
33
51
|
dependencies: any[];
|
|
52
|
+
timelineContainerPress: EventEmitter<any>;
|
|
53
|
+
timelineContainerDrag: EventEmitter<any>;
|
|
54
|
+
timelineContainerRelease: EventEmitter<any>;
|
|
55
|
+
/**
|
|
56
|
+
* Specifies whether the draggable will attach or detach its pointer event listeners.
|
|
57
|
+
*/
|
|
58
|
+
readonly draggableEnabled: boolean;
|
|
34
59
|
private subscriptions;
|
|
35
60
|
constructor(scrollSyncService: ScrollSyncService, dependencyDomService: DependencyDomService, renderer: Renderer2, zone: NgZone);
|
|
36
61
|
ngAfterViewInit(): void;
|
|
@@ -3,13 +3,13 @@
|
|
|
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, ElementRef, HostBinding, Input, NgZone, Renderer2, TemplateRef, ViewChild } from '@angular/core';
|
|
6
|
+
import { Component, ElementRef, EventEmitter, HostBinding, Input, NgZone, Output, Renderer2, TemplateRef, ViewChild, ViewContainerRef } from '@angular/core';
|
|
7
7
|
import { Subscription } from 'rxjs';
|
|
8
8
|
import { filter, map, switchMap, take } from 'rxjs/operators';
|
|
9
|
+
import { isDocumentAvailable } from '@progress/kendo-angular-common';
|
|
9
10
|
import { ScrollSyncService } from '../scrolling/scroll-sync.service';
|
|
10
11
|
import { DependencyDomService } from '../dependencies/dependency-dom.service';
|
|
11
12
|
import { isPresent } from '../utils';
|
|
12
|
-
import { isDocumentAvailable } from '@progress/kendo-angular-common';
|
|
13
13
|
/**
|
|
14
14
|
* @hidden
|
|
15
15
|
*/
|
|
@@ -21,6 +21,10 @@ let GanttTimelineComponent = class GanttTimelineComponent {
|
|
|
21
21
|
this.zone = zone;
|
|
22
22
|
this.hostClass = true;
|
|
23
23
|
this.dependencies = [];
|
|
24
|
+
// as all drag-and-drop operations are on the timeline container, use a single draggable instance
|
|
25
|
+
this.timelineContainerPress = new EventEmitter();
|
|
26
|
+
this.timelineContainerDrag = new EventEmitter();
|
|
27
|
+
this.timelineContainerRelease = new EventEmitter();
|
|
24
28
|
this.subscriptions = new Subscription();
|
|
25
29
|
this.subscriptions.add(
|
|
26
30
|
// task changes indicates change in row content, number, height, etc.
|
|
@@ -32,6 +36,12 @@ let GanttTimelineComponent = class GanttTimelineComponent {
|
|
|
32
36
|
this.renderer.setStyle(this.timelineColumns.nativeElement, 'height', `${(this.rows || []).length * timelineRowHeight}px`);
|
|
33
37
|
}));
|
|
34
38
|
}
|
|
39
|
+
/**
|
|
40
|
+
* Specifies whether the draggable will attach or detach its pointer event listeners.
|
|
41
|
+
*/
|
|
42
|
+
get draggableEnabled() {
|
|
43
|
+
return this.renderDependencyDragClues;
|
|
44
|
+
}
|
|
35
45
|
ngAfterViewInit() {
|
|
36
46
|
const timelineHeader = this.timelineHeaderWrap.nativeElement;
|
|
37
47
|
const rightContainer = this.timelineContent.nativeElement;
|
|
@@ -62,6 +72,14 @@ tslib_1.__decorate([
|
|
|
62
72
|
ViewChild('tasksContainer', { static: true }),
|
|
63
73
|
tslib_1.__metadata("design:type", ElementRef)
|
|
64
74
|
], GanttTimelineComponent.prototype, "tasksContainer", void 0);
|
|
75
|
+
tslib_1.__decorate([
|
|
76
|
+
ViewChild('dragPopupContainer', { static: false, read: ViewContainerRef }),
|
|
77
|
+
tslib_1.__metadata("design:type", ViewContainerRef)
|
|
78
|
+
], GanttTimelineComponent.prototype, "dragPopupContainer", void 0);
|
|
79
|
+
tslib_1.__decorate([
|
|
80
|
+
ViewChild('dependencyDragCreatePolyline', { static: false }),
|
|
81
|
+
tslib_1.__metadata("design:type", ElementRef)
|
|
82
|
+
], GanttTimelineComponent.prototype, "dependencyDragCreatePolyline", void 0);
|
|
65
83
|
tslib_1.__decorate([
|
|
66
84
|
HostBinding('class.k-gantt-timeline'),
|
|
67
85
|
tslib_1.__metadata("design:type", Boolean)
|
|
@@ -102,6 +120,18 @@ tslib_1.__decorate([
|
|
|
102
120
|
Input(),
|
|
103
121
|
tslib_1.__metadata("design:type", Function)
|
|
104
122
|
], GanttTimelineComponent.prototype, "taskClass", void 0);
|
|
123
|
+
tslib_1.__decorate([
|
|
124
|
+
Input(),
|
|
125
|
+
tslib_1.__metadata("design:type", Boolean)
|
|
126
|
+
], GanttTimelineComponent.prototype, "renderDependencyDragClues", void 0);
|
|
127
|
+
tslib_1.__decorate([
|
|
128
|
+
Input(),
|
|
129
|
+
tslib_1.__metadata("design:type", Object)
|
|
130
|
+
], GanttTimelineComponent.prototype, "dragScrollSettings", void 0);
|
|
131
|
+
tslib_1.__decorate([
|
|
132
|
+
Input(),
|
|
133
|
+
tslib_1.__metadata("design:type", Boolean)
|
|
134
|
+
], GanttTimelineComponent.prototype, "selectable", void 0);
|
|
105
135
|
tslib_1.__decorate([
|
|
106
136
|
Input(),
|
|
107
137
|
tslib_1.__metadata("design:type", Function)
|
|
@@ -109,11 +139,23 @@ tslib_1.__decorate([
|
|
|
109
139
|
tslib_1.__decorate([
|
|
110
140
|
Input(),
|
|
111
141
|
tslib_1.__metadata("design:type", Function)
|
|
112
|
-
], GanttTimelineComponent.prototype, "
|
|
142
|
+
], GanttTimelineComponent.prototype, "isExpanded", void 0);
|
|
113
143
|
tslib_1.__decorate([
|
|
114
144
|
Input(),
|
|
115
145
|
tslib_1.__metadata("design:type", Array)
|
|
116
146
|
], GanttTimelineComponent.prototype, "dependencies", void 0);
|
|
147
|
+
tslib_1.__decorate([
|
|
148
|
+
Output(),
|
|
149
|
+
tslib_1.__metadata("design:type", EventEmitter)
|
|
150
|
+
], GanttTimelineComponent.prototype, "timelineContainerPress", void 0);
|
|
151
|
+
tslib_1.__decorate([
|
|
152
|
+
Output(),
|
|
153
|
+
tslib_1.__metadata("design:type", EventEmitter)
|
|
154
|
+
], GanttTimelineComponent.prototype, "timelineContainerDrag", void 0);
|
|
155
|
+
tslib_1.__decorate([
|
|
156
|
+
Output(),
|
|
157
|
+
tslib_1.__metadata("design:type", EventEmitter)
|
|
158
|
+
], GanttTimelineComponent.prototype, "timelineContainerRelease", void 0);
|
|
117
159
|
GanttTimelineComponent = tslib_1.__decorate([
|
|
118
160
|
Component({
|
|
119
161
|
selector: 'kendo-gantt-timeline',
|
|
@@ -133,7 +175,21 @@ GanttTimelineComponent = tslib_1.__decorate([
|
|
|
133
175
|
</table>
|
|
134
176
|
</div>
|
|
135
177
|
</div>
|
|
136
|
-
|
|
178
|
+
<!-- tabindex="-1" required for https://bugzilla.mozilla.org/show_bug.cgi?id=1069739 -->
|
|
179
|
+
<div
|
|
180
|
+
#timelineContent
|
|
181
|
+
class="k-grid-content"
|
|
182
|
+
tabindex="-1"
|
|
183
|
+
role="tree"
|
|
184
|
+
aria-roledescription="Timeline"
|
|
185
|
+
kendoGanttTimelineScrollable
|
|
186
|
+
[scrollSettings]="dragScrollSettings"
|
|
187
|
+
kendoDraggable
|
|
188
|
+
[enableDrag]="draggableEnabled"
|
|
189
|
+
(kendoPress)="timelineContainerPress.emit($event)"
|
|
190
|
+
(kendoDrag)="timelineContainerDrag.emit($event)"
|
|
191
|
+
(kendoRelease)="timelineContainerRelease.emit($event)"
|
|
192
|
+
>
|
|
137
193
|
<div class="k-gantt-tables">
|
|
138
194
|
<table
|
|
139
195
|
class="k-gantt-rows"
|
|
@@ -184,8 +240,10 @@ GanttTimelineComponent = tslib_1.__decorate([
|
|
|
184
240
|
[taskTemplate]="taskTemplate"
|
|
185
241
|
[summaryTaskTemplate]="summaryTaskTemplate"
|
|
186
242
|
[taskClass]="taskClass"
|
|
187
|
-
[
|
|
243
|
+
[isExpanded]="isExpanded"
|
|
244
|
+
[selectable]="selectable"
|
|
188
245
|
[isTaskSelected]="isTaskSelected"
|
|
246
|
+
[renderDependencyDragClues]="renderDependencyDragClues"
|
|
189
247
|
>
|
|
190
248
|
</tbody>
|
|
191
249
|
</table>
|
|
@@ -196,7 +254,11 @@ GanttTimelineComponent = tslib_1.__decorate([
|
|
|
196
254
|
kendoGanttDependency
|
|
197
255
|
[dependency]="dependency"
|
|
198
256
|
/>
|
|
257
|
+
<polyline #dependencyDragCreatePolyline />
|
|
199
258
|
</svg>
|
|
259
|
+
|
|
260
|
+
<!-- placeholder for the dependency drag popup; its position is not arbitrary - the popup is intended to be absolutely positioned inside the .k-grid-content element -->
|
|
261
|
+
<ng-container #dragPopupContainer></ng-container>
|
|
200
262
|
</div>
|
|
201
263
|
</div>
|
|
202
264
|
`
|
|
@@ -3,22 +3,21 @@
|
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
5
|
import { TemplateRef } from '@angular/core';
|
|
6
|
-
import { GanttComponent } from
|
|
7
|
-
import { ScrollSyncService } from '../scrolling/scroll-sync.service';
|
|
6
|
+
import { GanttComponent } from '../gantt.component';
|
|
8
7
|
import { TimelineViewType } from './../models/timeline-view';
|
|
9
8
|
/**
|
|
10
9
|
* @hidden
|
|
11
10
|
*/
|
|
12
11
|
export declare class ToolbarComponent {
|
|
13
12
|
gantt: GanttComponent;
|
|
14
|
-
private scrollSyncService;
|
|
15
13
|
context: any;
|
|
14
|
+
role: string;
|
|
16
15
|
showAddTask: boolean;
|
|
17
16
|
showViewSelector: boolean;
|
|
18
17
|
position: 'top' | 'bottom';
|
|
19
18
|
readonly toolbarTemplateRef: TemplateRef<any>;
|
|
20
19
|
readonly renderTemplate: boolean;
|
|
21
20
|
private _position;
|
|
22
|
-
constructor(gantt: GanttComponent
|
|
23
|
-
|
|
21
|
+
constructor(gantt: GanttComponent);
|
|
22
|
+
handleViewChange(view: TimelineViewType): void;
|
|
24
23
|
}
|
|
@@ -3,17 +3,16 @@
|
|
|
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, Input } from '@angular/core';
|
|
7
|
-
import { GanttComponent } from
|
|
8
|
-
import { ScrollSyncService } from '../scrolling/scroll-sync.service';
|
|
6
|
+
import { Component, Input, HostBinding } from '@angular/core';
|
|
7
|
+
import { GanttComponent } from '../gantt.component';
|
|
9
8
|
/**
|
|
10
9
|
* @hidden
|
|
11
10
|
*/
|
|
12
11
|
let ToolbarComponent = class ToolbarComponent {
|
|
13
|
-
constructor(gantt
|
|
12
|
+
constructor(gantt) {
|
|
14
13
|
this.gantt = gantt;
|
|
15
|
-
this.scrollSyncService = scrollSyncService;
|
|
16
14
|
this.context = {};
|
|
15
|
+
this.role = 'toolbar';
|
|
17
16
|
}
|
|
18
17
|
set position(value) {
|
|
19
18
|
this.context.position = this._position = value;
|
|
@@ -29,13 +28,14 @@ let ToolbarComponent = class ToolbarComponent {
|
|
|
29
28
|
const templatePosition = ganttToolbarTemplate ? ganttToolbarTemplate.position : null;
|
|
30
29
|
return ganttToolbarTemplate && (templatePosition === 'both' || templatePosition === this.position);
|
|
31
30
|
}
|
|
32
|
-
|
|
33
|
-
this.gantt.
|
|
34
|
-
this.gantt.loadTimelineData();
|
|
35
|
-
this.gantt.activeViewChange.emit(e);
|
|
36
|
-
this.scrollSyncService.resetTimelineScrollLeft();
|
|
31
|
+
handleViewChange(view) {
|
|
32
|
+
this.gantt.changeActiveView(view);
|
|
37
33
|
}
|
|
38
34
|
};
|
|
35
|
+
tslib_1.__decorate([
|
|
36
|
+
HostBinding('attr.role'),
|
|
37
|
+
tslib_1.__metadata("design:type", String)
|
|
38
|
+
], ToolbarComponent.prototype, "role", void 0);
|
|
39
39
|
tslib_1.__decorate([
|
|
40
40
|
Input(),
|
|
41
41
|
tslib_1.__metadata("design:type", Boolean)
|
|
@@ -60,7 +60,7 @@ ToolbarComponent = tslib_1.__decorate([
|
|
|
60
60
|
*ngIf="showViewSelector"
|
|
61
61
|
[views]="gantt.viewTypes"
|
|
62
62
|
[activeView]="gantt.activeView"
|
|
63
|
-
(activeViewChange)="
|
|
63
|
+
(activeViewChange)="handleViewChange($event)"></kendo-gantt-view-selector>
|
|
64
64
|
</ng-container>
|
|
65
65
|
<ng-template
|
|
66
66
|
*ngIf="renderTemplate"
|
|
@@ -70,7 +70,6 @@ ToolbarComponent = tslib_1.__decorate([
|
|
|
70
70
|
</ng-template>
|
|
71
71
|
`
|
|
72
72
|
}),
|
|
73
|
-
tslib_1.__metadata("design:paramtypes", [GanttComponent
|
|
74
|
-
ScrollSyncService])
|
|
73
|
+
tslib_1.__metadata("design:paramtypes", [GanttComponent])
|
|
75
74
|
], ToolbarComponent);
|
|
76
75
|
export { ToolbarComponent };
|
|
@@ -57,7 +57,9 @@ ViewSelectorComponent = tslib_1.__decorate([
|
|
|
57
57
|
Component({
|
|
58
58
|
selector: 'kendo-gantt-view-selector',
|
|
59
59
|
template: `
|
|
60
|
-
<select
|
|
60
|
+
<select
|
|
61
|
+
class="k-dropdownlist k-picker k-rounded-md k-views-dropdown"
|
|
62
|
+
aria-label="View Selector"
|
|
61
63
|
[value]="activeView"
|
|
62
64
|
(change)="activeViewChange.emit($event.target.value)">
|
|
63
65
|
<option *ngFor="let view of views" [value]="view">{{getViewTypeText(view)}}</option>
|
package/dist/es2015/utils.d.ts
CHANGED
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
5
|
import { Day } from '@progress/kendo-date-math';
|
|
6
6
|
import { GanttColumnBase, GanttColumnGroupComponent } from './columns/columns';
|
|
7
|
+
import { DependencyType } from './models/dependency-type.enum';
|
|
8
|
+
import { ViewItem } from './models/view-item.interface';
|
|
7
9
|
/**
|
|
8
10
|
* @hidden
|
|
9
11
|
*/
|
|
@@ -66,32 +68,99 @@ export declare const isString: (contender: any) => contender is string;
|
|
|
66
68
|
* Native Omit appears in TS v3.5, we can use it when we drop Angular 8 (requires v3.4)
|
|
67
69
|
*/
|
|
68
70
|
export declare type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
|
|
71
|
+
/**
|
|
72
|
+
* @hidden
|
|
73
|
+
*
|
|
74
|
+
* Gets the closest timeline task wrapper element from an event target.
|
|
75
|
+
* Restricts the search up to the provided parent element from the second param.
|
|
76
|
+
*/
|
|
77
|
+
export declare const getClosestTaskWrapper: (element: Element, parentScope: Element) => Element;
|
|
78
|
+
/**
|
|
79
|
+
* @hidden
|
|
80
|
+
*
|
|
81
|
+
* Checks whether the queried item or its parent items has a `k-task-wrap` selector.
|
|
82
|
+
* Restricts the search up to the provided parent element from the second param.
|
|
83
|
+
*/
|
|
84
|
+
export declare const isTaskWrapper: (contender: Element, parentScope: Element) => boolean;
|
|
69
85
|
/**
|
|
70
86
|
* @hidden
|
|
71
87
|
*
|
|
72
88
|
* Gets the closest timeline task element from an event target.
|
|
73
|
-
* Restricts the search up to the provided
|
|
89
|
+
* Restricts the search up to the provided parent element from the second param.
|
|
74
90
|
*/
|
|
75
|
-
export declare const getClosestTask: (element: Element,
|
|
91
|
+
export declare const getClosestTask: (element: Element, parentScope: Element) => Element;
|
|
76
92
|
/**
|
|
77
93
|
* @hidden
|
|
78
94
|
*
|
|
79
95
|
* Gets the closest timeline task element index from an event target.
|
|
80
96
|
* Uses the `data-task-index` attribute assigned to each task.
|
|
81
|
-
* Restricts the search up to the provided
|
|
97
|
+
* Restricts the search up to the provided parent element from the second param.
|
|
82
98
|
*/
|
|
83
|
-
export declare const getClosestTaskIndex: (element: Element,
|
|
99
|
+
export declare const getClosestTaskIndex: (element: EventTarget | Element, parentScope: Element) => number;
|
|
84
100
|
/**
|
|
85
101
|
* @hidden
|
|
86
102
|
*
|
|
87
103
|
* Checks whether the queried item or its parent items has a `k-task` selector.
|
|
88
|
-
* Restricts the search up to the provided
|
|
104
|
+
* Restricts the search up to the provided parent element from the second param.
|
|
105
|
+
*/
|
|
106
|
+
export declare const isTask: (contender: EventTarget | Element, parentScope: Element) => boolean;
|
|
107
|
+
/**
|
|
108
|
+
* @hidden
|
|
109
|
+
*
|
|
110
|
+
* Checks whether the queried item or its parent items has a `k-toolbar` selector.
|
|
111
|
+
* Restricts the search up to the provided parent element from the second param.
|
|
89
112
|
*/
|
|
90
|
-
export declare const
|
|
113
|
+
export declare const isToolbar: (contender: EventTarget | Element, parentScope: Element) => boolean;
|
|
91
114
|
/**
|
|
92
115
|
* @hidden
|
|
93
116
|
*
|
|
94
117
|
* Checks whether the queried item or its parent items has a `k-task-actions` selector - used for the clear button.
|
|
95
|
-
* Restricts the search up to the provided
|
|
118
|
+
* Restricts the search up to the provided parent element from the second param.
|
|
119
|
+
*/
|
|
120
|
+
export declare const isClearButton: (contender: EventTarget | Element, parentScope: Element) => boolean;
|
|
121
|
+
/**
|
|
122
|
+
* @hidden
|
|
123
|
+
*
|
|
124
|
+
* Checks whether the queried item has a `k-task-dot` selector - used for the dependency drag clues.
|
|
125
|
+
*/
|
|
126
|
+
export declare const isDependencyDragClue: (element: Element) => boolean;
|
|
127
|
+
/**
|
|
128
|
+
* @hidden
|
|
129
|
+
*
|
|
130
|
+
* Checks whether the queried item has a `k-task-dot` & `k-task-start` selector - used for the dependency drag start clues.
|
|
131
|
+
*/
|
|
132
|
+
export declare const isDependencyDragStartClue: (element: Element) => boolean;
|
|
133
|
+
/**
|
|
134
|
+
* @hidden
|
|
135
|
+
*
|
|
136
|
+
* Gets the `DependencyType` for an attempted dependency create from the provided two elements.
|
|
137
|
+
* The two linked drag clue HTML elements are used to extract this data (via their CSS classes).
|
|
138
|
+
*/
|
|
139
|
+
export declare const getDependencyTypeFromTargetTasks: (fromTaskClue: Element, toTaskClue: Element) => DependencyType;
|
|
140
|
+
/**
|
|
141
|
+
* @hidden
|
|
142
|
+
*
|
|
143
|
+
* Checks whether the two provided drag clues belong to the same task element.
|
|
144
|
+
*/
|
|
145
|
+
export declare const sameTaskClues: (fromTaskClue: Element, toTaskClue: Element, parentScope: Element) => boolean;
|
|
146
|
+
/**
|
|
147
|
+
* @hidden
|
|
148
|
+
*
|
|
149
|
+
* Fits a contender number between a min and max range.
|
|
150
|
+
* If the contender is below the min value, the min value is returned.
|
|
151
|
+
* If the contender is above the max value, the max value is returned.
|
|
152
|
+
*/
|
|
153
|
+
export declare const fitToRange: (contender: number, min: number, max: number) => number;
|
|
154
|
+
/**
|
|
155
|
+
* @hidden
|
|
156
|
+
*
|
|
157
|
+
* Checks whether either of the two provided tasks is a parent of the other.
|
|
158
|
+
*/
|
|
159
|
+
export declare const areParentChild: (taskA: ViewItem, taskB: ViewItem) => boolean;
|
|
160
|
+
/**
|
|
161
|
+
* @hidden
|
|
162
|
+
*
|
|
163
|
+
* Extracts an element from the provided client coords.
|
|
164
|
+
* Using the `event.target` is not reliable under mobile devices with the current implementation of the draggable, so use this instead.
|
|
96
165
|
*/
|
|
97
|
-
export declare const
|
|
166
|
+
export declare const elementFromPoint: (clientX: number, clientY: number) => HTMLElement;
|