@progress/kendo-angular-gantt 0.3.0-dev.202201131518 → 0.3.0-dev.202201190830
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 +2 -2
- package/dist/es/editing/edit-dialog.component.js +3 -3
- package/dist/es/editing/edit.service.js +4 -2
- package/dist/es/gantt.component.js +191 -24
- package/dist/es/index.js +1 -0
- package/dist/es/models/events/task-delete-event.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 +7 -4
- package/dist/es/rendering/gantt-summary-task.component.js +22 -4
- package/dist/es/rendering/gantt-task-base.js +57 -6
- package/dist/es/rendering/gantt-task.component.js +9 -6
- package/dist/es/rendering/gantt-tasks-table-body.component.js +9 -5
- package/dist/es/timeline/gantt-timeline.component.js +10 -6
- package/dist/es/toolbar/toolbar.component.js +12 -13
- package/dist/es/toolbar/view-selector.component.js +1 -1
- package/dist/es/utils.js +14 -4
- package/dist/es2015/editing/edit-dialog.component.d.ts +1 -1
- package/dist/es2015/editing/edit-dialog.component.js +11 -3
- package/dist/es2015/editing/edit.service.d.ts +2 -3
- package/dist/es2015/editing/edit.service.js +4 -2
- package/dist/es2015/editing/utils.d.ts +2 -2
- package/dist/es2015/gantt.component.d.ts +75 -16
- package/dist/es2015/gantt.component.js +177 -26
- package/dist/es2015/index.d.ts +1 -0
- package/dist/es2015/index.js +1 -0
- package/dist/es2015/index.metadata.json +1 -1
- 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 +2 -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 +2 -1
- package/dist/es2015/rendering/gantt-milestone-task.component.js +18 -4
- package/dist/es2015/rendering/gantt-summary-task.component.d.ts +4 -1
- package/dist/es2015/rendering/gantt-summary-task.component.js +30 -4
- package/dist/es2015/rendering/gantt-task-base.d.ts +10 -2
- package/dist/es2015/rendering/gantt-task-base.js +48 -6
- package/dist/es2015/rendering/gantt-task.component.d.ts +3 -2
- package/dist/es2015/rendering/gantt-task.component.js +31 -9
- package/dist/es2015/rendering/gantt-tasks-table-body.component.d.ts +5 -3
- package/dist/es2015/rendering/gantt-tasks-table-body.component.js +23 -12
- package/dist/es2015/scrolling/scroll-sync.service.d.ts +1 -1
- package/dist/es2015/timeline/gantt-timeline.component.d.ts +5 -3
- package/dist/es2015/timeline/gantt-timeline.component.js +15 -6
- 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 +10 -3
- package/dist/es2015/utils.js +14 -4
- package/dist/fesm2015/index.js +2311 -1610
- package/dist/fesm5/index.js +1722 -1013
- package/dist/npm/editing/edit-dialog.component.js +3 -3
- package/dist/npm/editing/edit.service.js +4 -2
- package/dist/npm/gantt.component.js +191 -24
- package/dist/npm/index.js +2 -0
- package/dist/npm/models/events/task-delete-event.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 +7 -4
- package/dist/npm/rendering/gantt-summary-task.component.js +22 -4
- package/dist/npm/rendering/gantt-task-base.js +57 -6
- package/dist/npm/rendering/gantt-task.component.js +9 -6
- package/dist/npm/rendering/gantt-tasks-table-body.component.js +9 -5
- package/dist/npm/timeline/gantt-timeline.component.js +10 -6
- package/dist/npm/toolbar/toolbar.component.js +10 -11
- package/dist/npm/toolbar/view-selector.component.js +1 -1
- package/dist/npm/utils.js +14 -4
- package/dist/systemjs/kendo-angular-gantt.js +1 -1
- package/package.json +1 -1
|
@@ -12,24 +12,42 @@ var slotUnitDuration = {
|
|
|
12
12
|
week: MS_PER_DAY,
|
|
13
13
|
month: MS_PER_DAY * 7
|
|
14
14
|
};
|
|
15
|
+
var FOCUSED_CLASS = 'k-focus';
|
|
15
16
|
/**
|
|
16
17
|
* @hidden
|
|
17
18
|
*/
|
|
18
19
|
var GanttTaskBase = /** @class */ (function () {
|
|
19
20
|
function GanttTaskBase(mapper, // left public to be available for usage in the templates
|
|
20
|
-
timelineViewService, dependencyDomService, optionChangesService, cdr) {
|
|
21
|
+
timelineViewService, dependencyDomService, optionChangesService, cdr, navigationService) {
|
|
21
22
|
var _this = this;
|
|
22
23
|
this.mapper = mapper;
|
|
23
24
|
this.timelineViewService = timelineViewService;
|
|
24
25
|
this.dependencyDomService = dependencyDomService;
|
|
25
26
|
this.optionChangesService = optionChangesService;
|
|
26
27
|
this.cdr = cdr;
|
|
28
|
+
this.navigationService = navigationService;
|
|
27
29
|
this.wrapperClass = true;
|
|
28
|
-
this.
|
|
29
|
-
this.
|
|
30
|
-
_this.cdr.markForCheck();
|
|
31
|
-
|
|
30
|
+
this.subscriptions = new Subscription();
|
|
31
|
+
this.subscriptions.add(this.optionChangesService.viewChanges
|
|
32
|
+
.subscribe(function () { return _this.cdr.markForCheck(); }));
|
|
33
|
+
this.subscriptions.add(this.navigationService.taskStatusChanges
|
|
34
|
+
.subscribe(this.updateActiveState.bind(this)));
|
|
32
35
|
}
|
|
36
|
+
Object.defineProperty(GanttTaskBase.prototype, "taskIndexAttribute", {
|
|
37
|
+
get: function () {
|
|
38
|
+
return this.index;
|
|
39
|
+
},
|
|
40
|
+
enumerable: true,
|
|
41
|
+
configurable: true
|
|
42
|
+
});
|
|
43
|
+
Object.defineProperty(GanttTaskBase.prototype, "ariaSelected", {
|
|
44
|
+
get: function () {
|
|
45
|
+
// assinging null will not render the attribute at all (desired in selectable="false" mode)
|
|
46
|
+
return this.selectable ? String(this.isSelected(this.dataItem)) : null;
|
|
47
|
+
},
|
|
48
|
+
enumerable: true,
|
|
49
|
+
configurable: true
|
|
50
|
+
});
|
|
33
51
|
Object.defineProperty(GanttTaskBase.prototype, "slotUnitDuration", {
|
|
34
52
|
get: function () {
|
|
35
53
|
return slotUnitDuration[this.activeView];
|
|
@@ -96,17 +114,38 @@ var GanttTaskBase = /** @class */ (function () {
|
|
|
96
114
|
else if (isPresent(changes.activeView)) {
|
|
97
115
|
this.dependencyDomService.notifyChanges();
|
|
98
116
|
}
|
|
117
|
+
if (this.navigationService.enabled && isPresent(changes.index)) {
|
|
118
|
+
this.updateActiveState(this.navigationService.activeTask);
|
|
119
|
+
}
|
|
99
120
|
};
|
|
100
121
|
GanttTaskBase.prototype.ngOnDestroy = function () {
|
|
101
122
|
if (isPresent(this.dataItem)) {
|
|
102
123
|
this.dependencyDomService.unregisterTask(this.dataItem);
|
|
103
124
|
}
|
|
104
|
-
this.
|
|
125
|
+
this.subscriptions.unsubscribe();
|
|
126
|
+
};
|
|
127
|
+
GanttTaskBase.prototype.updateActiveState = function (_a) {
|
|
128
|
+
var activeIndex = _a.activeIndex, isFocused = _a.isFocused;
|
|
129
|
+
var isActive = activeIndex === this.index;
|
|
130
|
+
var tabindex = isActive ? '0' : '-1';
|
|
131
|
+
this.taskElement.nativeElement.setAttribute('tabindex', tabindex);
|
|
132
|
+
if (isActive && isFocused) {
|
|
133
|
+
this.taskElement.nativeElement.focus();
|
|
134
|
+
this.taskElement.nativeElement.classList.add(FOCUSED_CLASS);
|
|
135
|
+
}
|
|
136
|
+
else {
|
|
137
|
+
this.taskElement.nativeElement.classList.remove(FOCUSED_CLASS);
|
|
138
|
+
}
|
|
105
139
|
};
|
|
106
140
|
tslib_1.__decorate([
|
|
107
141
|
HostBinding('class.k-task-wrap'),
|
|
108
142
|
tslib_1.__metadata("design:type", Boolean)
|
|
109
143
|
], GanttTaskBase.prototype, "wrapperClass", void 0);
|
|
144
|
+
tslib_1.__decorate([
|
|
145
|
+
HostBinding('attr.data-task-index'),
|
|
146
|
+
tslib_1.__metadata("design:type", Number),
|
|
147
|
+
tslib_1.__metadata("design:paramtypes", [])
|
|
148
|
+
], GanttTaskBase.prototype, "taskIndexAttribute", null);
|
|
110
149
|
tslib_1.__decorate([
|
|
111
150
|
ViewChild('task', { static: true }),
|
|
112
151
|
tslib_1.__metadata("design:type", ElementRef)
|
|
@@ -115,10 +154,22 @@ var GanttTaskBase = /** @class */ (function () {
|
|
|
115
154
|
Input(),
|
|
116
155
|
tslib_1.__metadata("design:type", Object)
|
|
117
156
|
], GanttTaskBase.prototype, "dataItem", void 0);
|
|
157
|
+
tslib_1.__decorate([
|
|
158
|
+
Input(),
|
|
159
|
+
tslib_1.__metadata("design:type", Number)
|
|
160
|
+
], GanttTaskBase.prototype, "index", void 0);
|
|
161
|
+
tslib_1.__decorate([
|
|
162
|
+
Input(),
|
|
163
|
+
tslib_1.__metadata("design:type", Number)
|
|
164
|
+
], GanttTaskBase.prototype, "level", void 0);
|
|
118
165
|
tslib_1.__decorate([
|
|
119
166
|
Input(),
|
|
120
167
|
tslib_1.__metadata("design:type", Boolean)
|
|
121
168
|
], GanttTaskBase.prototype, "renderDependencyDragClues", void 0);
|
|
169
|
+
tslib_1.__decorate([
|
|
170
|
+
Input(),
|
|
171
|
+
tslib_1.__metadata("design:type", Boolean)
|
|
172
|
+
], GanttTaskBase.prototype, "selectable", void 0);
|
|
122
173
|
tslib_1.__decorate([
|
|
123
174
|
Input(),
|
|
124
175
|
tslib_1.__metadata("design:type", Function)
|
|
@@ -5,19 +5,20 @@
|
|
|
5
5
|
import * as tslib_1 from "tslib";
|
|
6
6
|
import { ChangeDetectorRef, Component, forwardRef, Inject, Input, TemplateRef } from '@angular/core';
|
|
7
7
|
import { MappingService } from '../common/mapping.service';
|
|
8
|
+
import { NavigationService } from '../navigation/navigation.service';
|
|
9
|
+
import { EditService } from '../editing/edit.service';
|
|
8
10
|
import { TOUCH_ENABLED } from '../common/touch-enabled';
|
|
9
11
|
import { DependencyDomService } from '../dependencies/dependency-dom.service';
|
|
10
12
|
import { OptionChangesService } from '../common/option-changes.service';
|
|
11
13
|
import { TimelineViewService } from './../timeline/timeline-view.service';
|
|
12
14
|
import { GanttTaskBase } from './gantt-task-base';
|
|
13
|
-
import { EditService } from '../editing/edit.service';
|
|
14
15
|
/**
|
|
15
16
|
* @hidden
|
|
16
17
|
*/
|
|
17
18
|
var GanttTaskComponent = /** @class */ (function (_super) {
|
|
18
19
|
tslib_1.__extends(GanttTaskComponent, _super);
|
|
19
|
-
function GanttTaskComponent(editService, touchEnabled, mapper, timelineViewService, dependencyDomService, optionChangesService, cdr) {
|
|
20
|
-
var _this = _super.call(this, mapper, timelineViewService, dependencyDomService, optionChangesService, cdr) || this;
|
|
20
|
+
function GanttTaskComponent(editService, touchEnabled, mapper, timelineViewService, dependencyDomService, optionChangesService, cdr, navigationService) {
|
|
21
|
+
var _this = _super.call(this, mapper, timelineViewService, dependencyDomService, optionChangesService, cdr, navigationService) || this;
|
|
21
22
|
_this.editService = editService;
|
|
22
23
|
_this.touchEnabled = touchEnabled;
|
|
23
24
|
return _this;
|
|
@@ -25,7 +26,7 @@ var GanttTaskComponent = /** @class */ (function (_super) {
|
|
|
25
26
|
GanttTaskComponent_1 = GanttTaskComponent;
|
|
26
27
|
GanttTaskComponent.prototype.onTaskDelete = function () {
|
|
27
28
|
this.editService.dataItem = this.dataItem;
|
|
28
|
-
this.editService.
|
|
29
|
+
this.editService.taskDelete.next(this.dataItem);
|
|
29
30
|
};
|
|
30
31
|
var GanttTaskComponent_1;
|
|
31
32
|
tslib_1.__decorate([
|
|
@@ -45,14 +46,16 @@ var GanttTaskComponent = /** @class */ (function (_super) {
|
|
|
45
46
|
useExisting: forwardRef(function () { return GanttTaskComponent_1; })
|
|
46
47
|
}
|
|
47
48
|
],
|
|
48
|
-
template: "\n <div\n #task\n class=\"k-task k-task-single\"\n [ngClass]=\"taskClass(dataItem)\"\n [style.width.px]=\"taskWidth\"\n [attr.title]=\"mapper.extractFromTask(dataItem, 'title')\"\n [class.k-state-selected]=\"isSelected(dataItem)\"\n >\n <ng-container *ngIf=\"!taskTemplate\">\n <div\n class=\"k-task-complete\"\n [style.width.px]=\"completionOverlayWidth\"\n >\n </div>\n <div class=\"k-task-content\">\n <div class=\"k-task-template\">\n <ng-container *ngIf=\"!taskContentTemplate; else taskContent\">\n {{ mapper.extractFromTask(dataItem, 'title') }}\n </ng-container>\n <ng-template\n #taskContent\n [ngTemplateOutlet]=\"taskContentTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: dataItem }\"\n >\n </ng-template>\n </div>\n <span
|
|
49
|
+
template: "\n <div\n #task\n class=\"k-task k-task-single\"\n role=\"treeitem\"\n [ngClass]=\"taskClass(dataItem)\"\n [style.width.px]=\"taskWidth\"\n [attr.title]=\"mapper.extractFromTask(dataItem, 'title')\"\n [class.k-state-selected]=\"isSelected(dataItem)\"\n [attr.aria-selected]=\"ariaSelected\"\n [attr.aria-level]=\"level + 1\"\n >\n <ng-container *ngIf=\"!taskTemplate\">\n <div\n class=\"k-task-complete\"\n [style.width.px]=\"completionOverlayWidth\"\n aria-hidden=\"true\"\n >\n </div>\n <div class=\"k-task-content\">\n <div class=\"k-task-template\">\n <ng-container *ngIf=\"!taskContentTemplate; else taskContent\">\n {{ mapper.extractFromTask(dataItem, 'title') }}\n </ng-container>\n <ng-template\n #taskContent\n [ngTemplateOutlet]=\"taskContentTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: dataItem }\"\n >\n </ng-template>\n </div>\n <span\n class=\"k-task-actions\"\n aria-hidden=\"true\"\n >\n <span\n class=\"k-link k-task-delete\"\n [kendoEventsOutsideAngular]=\"{\n click: onTaskDelete\n }\"\n [scope]=\"this\"\n >\n <span class=\"k-icon k-i-close\"></span>\n </span>\n </span>\n </div>\n </ng-container>\n <ng-template\n *ngIf=\"taskTemplate\"\n [ngTemplateOutlet]=\"taskTemplate\"\n [ngTemplateOutletContext]=\"{\n $implicit: dataItem,\n elementWidth: taskWidth\n }\"\n >\n </ng-template>\n </div>\n <ng-container *ngIf=\"renderDependencyDragClues\">\n <div\n class=\"k-task-dot k-task-start k-touch-action-none\"\n [class.k-display-block]=\"touchEnabled\"\n >\n </div>\n <div\n class=\"k-task-dot k-task-end k-touch-action-none\"\n [class.k-display-block]=\"touchEnabled\"\n >\n </div>\n </ng-container>\n ",
|
|
50
|
+
styles: ["\n .k-task.k-focus {\n box-shadow: 0 0 4px 3px grey;\n outline: none;\n }\n .k-task.k-focus.k-state-selected {\n box-shadow: 0 0 4px 3px #ffaea8;\n }\n "]
|
|
49
51
|
}),
|
|
50
52
|
tslib_1.__param(1, Inject(TOUCH_ENABLED)),
|
|
51
53
|
tslib_1.__metadata("design:paramtypes", [EditService, Boolean, MappingService,
|
|
52
54
|
TimelineViewService,
|
|
53
55
|
DependencyDomService,
|
|
54
56
|
OptionChangesService,
|
|
55
|
-
ChangeDetectorRef
|
|
57
|
+
ChangeDetectorRef,
|
|
58
|
+
NavigationService])
|
|
56
59
|
], GanttTaskComponent);
|
|
57
60
|
return GanttTaskComponent;
|
|
58
61
|
}(GanttTaskBase));
|
|
@@ -6,8 +6,8 @@ import * as tslib_1 from "tslib";
|
|
|
6
6
|
import { Component, Input, TemplateRef, ViewChild, ElementRef } from '@angular/core';
|
|
7
7
|
import { isEqual } from '@progress/kendo-date-math';
|
|
8
8
|
import { DependencyDomService } from '../dependencies/dependency-dom.service';
|
|
9
|
-
import { isPresent } from '../utils';
|
|
10
9
|
import { MappingService } from '../common/mapping.service';
|
|
10
|
+
import { isPresent } from '../utils';
|
|
11
11
|
/**
|
|
12
12
|
* @hidden
|
|
13
13
|
*/
|
|
@@ -27,14 +27,18 @@ var GanttTasksTableBodyComponent = /** @class */ (function () {
|
|
|
27
27
|
enumerable: true,
|
|
28
28
|
configurable: true
|
|
29
29
|
});
|
|
30
|
-
GanttTasksTableBodyComponent.prototype.isMileStone = function (
|
|
31
|
-
return !
|
|
30
|
+
GanttTasksTableBodyComponent.prototype.isMileStone = function (item) {
|
|
31
|
+
return !item.hasChildren && isEqual(this.mapper.extractFromTask(item.data, 'start'), this.mapper.extractFromTask(item.data, 'end'));
|
|
32
32
|
};
|
|
33
33
|
tslib_1.__decorate([
|
|
34
34
|
ViewChild('timelineRow', { static: false }),
|
|
35
35
|
tslib_1.__metadata("design:type", ElementRef),
|
|
36
36
|
tslib_1.__metadata("design:paramtypes", [ElementRef])
|
|
37
37
|
], GanttTasksTableBodyComponent.prototype, "timelineRow", null);
|
|
38
|
+
tslib_1.__decorate([
|
|
39
|
+
Input(),
|
|
40
|
+
tslib_1.__metadata("design:type", Boolean)
|
|
41
|
+
], GanttTasksTableBodyComponent.prototype, "selectable", void 0);
|
|
38
42
|
tslib_1.__decorate([
|
|
39
43
|
Input(),
|
|
40
44
|
tslib_1.__metadata("design:type", Array)
|
|
@@ -62,7 +66,7 @@ var GanttTasksTableBodyComponent = /** @class */ (function () {
|
|
|
62
66
|
tslib_1.__decorate([
|
|
63
67
|
Input(),
|
|
64
68
|
tslib_1.__metadata("design:type", Function)
|
|
65
|
-
], GanttTasksTableBodyComponent.prototype, "
|
|
69
|
+
], GanttTasksTableBodyComponent.prototype, "isExpanded", void 0);
|
|
66
70
|
tslib_1.__decorate([
|
|
67
71
|
Input(),
|
|
68
72
|
tslib_1.__metadata("design:type", Function)
|
|
@@ -74,7 +78,7 @@ var GanttTasksTableBodyComponent = /** @class */ (function () {
|
|
|
74
78
|
GanttTasksTableBodyComponent = tslib_1.__decorate([
|
|
75
79
|
Component({
|
|
76
80
|
selector: '[kendoGanttTasksTableBody]',
|
|
77
|
-
template: "\n <tr #timelineRow *ngFor=\"let item of rows; let index = index\">\n <td>\n <kendo-gantt-milestone-task\n *ngIf=\"isMileStone(item); else task\"\n [dataItem]=\"item\"\n [activeView]=\"activeView\"\n [taskClass]=\"taskClass\"\n [isSelected]=\"isTaskSelected\"\n [
|
|
81
|
+
template: "\n <tr #timelineRow *ngFor=\"let item of rows; let index = index\">\n <td>\n <kendo-gantt-milestone-task\n *ngIf=\"isMileStone(item); else task\"\n [dataItem]=\"item.data\"\n [level]=\"item.level\"\n [activeView]=\"activeView\"\n [taskClass]=\"taskClass\"\n [selectable]=\"selectable\"\n [isSelected]=\"isTaskSelected\"\n [index]=\"index\"\n [renderDependencyDragClues]=\"renderDependencyDragClues\"\n >\n </kendo-gantt-milestone-task>\n <ng-template #task>\n <kendo-gantt-summary-task\n *ngIf=\"item.hasChildren\"\n [dataItem]=\"item.data\"\n [level]=\"item.level\"\n [template]=\"summaryTaskTemplate\"\n [activeView]=\"activeView\"\n [taskClass]=\"taskClass\"\n [selectable]=\"selectable\"\n [isSelected]=\"isTaskSelected\"\n [isExpanded]=\"isExpanded\"\n [index]=\"index\"\n [renderDependencyDragClues]=\"renderDependencyDragClues\"\n >\n </kendo-gantt-summary-task>\n <kendo-gantt-task\n *ngIf=\"!item.hasChildren\"\n [dataItem]=\"item.data\"\n [level]=\"item.level\"\n [taskContentTemplate]=\"taskContentTemplate\"\n [taskTemplate]=\"taskTemplate\"\n [activeView]=\"activeView\"\n [taskClass]=\"taskClass\"\n [selectable]=\"selectable\"\n [isSelected]=\"isTaskSelected\"\n [index]=\"index\"\n [renderDependencyDragClues]=\"renderDependencyDragClues\"\n >\n </kendo-gantt-task>\n </ng-template>\n </td>\n </tr>\n "
|
|
78
82
|
}),
|
|
79
83
|
tslib_1.__metadata("design:paramtypes", [DependencyDomService,
|
|
80
84
|
MappingService])
|
|
@@ -125,10 +125,6 @@ var GanttTimelineComponent = /** @class */ (function () {
|
|
|
125
125
|
Input(),
|
|
126
126
|
tslib_1.__metadata("design:type", Function)
|
|
127
127
|
], GanttTimelineComponent.prototype, "taskClass", void 0);
|
|
128
|
-
tslib_1.__decorate([
|
|
129
|
-
Input(),
|
|
130
|
-
tslib_1.__metadata("design:type", Function)
|
|
131
|
-
], GanttTimelineComponent.prototype, "isTaskSelected", void 0);
|
|
132
128
|
tslib_1.__decorate([
|
|
133
129
|
Input(),
|
|
134
130
|
tslib_1.__metadata("design:type", Boolean)
|
|
@@ -137,10 +133,18 @@ var GanttTimelineComponent = /** @class */ (function () {
|
|
|
137
133
|
Input(),
|
|
138
134
|
tslib_1.__metadata("design:type", Object)
|
|
139
135
|
], GanttTimelineComponent.prototype, "dragScrollSettings", void 0);
|
|
136
|
+
tslib_1.__decorate([
|
|
137
|
+
Input(),
|
|
138
|
+
tslib_1.__metadata("design:type", Boolean)
|
|
139
|
+
], GanttTimelineComponent.prototype, "selectable", void 0);
|
|
140
|
+
tslib_1.__decorate([
|
|
141
|
+
Input(),
|
|
142
|
+
tslib_1.__metadata("design:type", Function)
|
|
143
|
+
], GanttTimelineComponent.prototype, "isTaskSelected", void 0);
|
|
140
144
|
tslib_1.__decorate([
|
|
141
145
|
Input(),
|
|
142
146
|
tslib_1.__metadata("design:type", Function)
|
|
143
|
-
], GanttTimelineComponent.prototype, "
|
|
147
|
+
], GanttTimelineComponent.prototype, "isExpanded", void 0);
|
|
144
148
|
tslib_1.__decorate([
|
|
145
149
|
Input(),
|
|
146
150
|
tslib_1.__metadata("design:type", Array)
|
|
@@ -160,7 +164,7 @@ var GanttTimelineComponent = /** @class */ (function () {
|
|
|
160
164
|
GanttTimelineComponent = tslib_1.__decorate([
|
|
161
165
|
Component({
|
|
162
166
|
selector: 'kendo-gantt-timeline',
|
|
163
|
-
template: "\n <div class=\"k-timeline k-grid k-widget\">\n <div class=\"k-grid-header\">\n <div #timelineHeaderWrap class=\"k-grid-header-wrap\">\n <table\n role=\"presentation\"\n [style.width.px]=\"tableWidth\"\n >\n <tbody\n kendoGanttHeaderTableBody\n [groupSlots]=\"groupSlots\"\n [slots]=\"slots\">\n </tbody>\n </table>\n </div>\n </div>\n <div\n #timelineContent\n class=\"k-grid-content\"\n kendoGanttTimelineScrollable\n [scrollSettings]=\"dragScrollSettings\"\n kendoDraggable\n [enableDrag]=\"draggableEnabled\"\n (kendoPress)=\"timelineContainerPress.emit($event)\"\n (kendoDrag)=\"timelineContainerDrag.emit($event)\"\n (kendoRelease)=\"timelineContainerRelease.emit($event)\"\n >\n <div class=\"k-gantt-tables\">\n <table\n class=\"k-gantt-rows\"\n [style.width.px]=\"tableWidth\"\n role=\"presentation\"\n >\n <tbody>\n <tr *ngFor=\"let item of rows; let i = index;\"\n [class.k-alt]=\"i % 2\"\n >\n <td></td>\n </tr>\n </tbody>\n </table>\n\n <table\n #timelineColumns\n class=\"k-gantt-columns\"\n role=\"presentation\"\n [style.width.px]=\"tableWidth\"\n >\n <colgroup>\n <col *ngFor=\"let item of slots\">\n </colgroup>\n\n <tbody>\n <tr>\n <td *ngFor=\"let item of slots\"\n [class.k-nonwork-hour]=\"isNonWorking(item)\"\n >\n </td>\n </tr>\n </tbody>\n </table>\n\n <table\n #tasksContainer\n class=\"k-gantt-tasks\"\n role=\"presentation\"\n style=\"border-collapse: collapse;\"\n [style.width.px]=\"tableWidth\"\n >\n <tbody\n kendoGanttTasksTableBody\n [rows]=\"rows\"\n [activeView]=\"activeView\"\n [taskContentTemplate]=\"taskContentTemplate\"\n [taskTemplate]=\"taskTemplate\"\n [summaryTaskTemplate]=\"summaryTaskTemplate\"\n [taskClass]=\"taskClass\"\n [
|
|
167
|
+
template: "\n <div class=\"k-timeline k-grid k-widget\">\n <div class=\"k-grid-header\">\n <div #timelineHeaderWrap class=\"k-grid-header-wrap\">\n <table\n role=\"presentation\"\n [style.width.px]=\"tableWidth\"\n >\n <tbody\n kendoGanttHeaderTableBody\n [groupSlots]=\"groupSlots\"\n [slots]=\"slots\">\n </tbody>\n </table>\n </div>\n </div>\n <!-- tabindex=\"-1\" required for https://bugzilla.mozilla.org/show_bug.cgi?id=1069739 -->\n <div\n #timelineContent\n class=\"k-grid-content\"\n tabindex=\"-1\"\n role=\"tree\"\n aria-roledescription=\"Timeline\"\n kendoGanttTimelineScrollable\n [scrollSettings]=\"dragScrollSettings\"\n kendoDraggable\n [enableDrag]=\"draggableEnabled\"\n (kendoPress)=\"timelineContainerPress.emit($event)\"\n (kendoDrag)=\"timelineContainerDrag.emit($event)\"\n (kendoRelease)=\"timelineContainerRelease.emit($event)\"\n >\n <div class=\"k-gantt-tables\">\n <table\n class=\"k-gantt-rows\"\n [style.width.px]=\"tableWidth\"\n role=\"presentation\"\n >\n <tbody>\n <tr *ngFor=\"let item of rows; let i = index;\"\n [class.k-alt]=\"i % 2\"\n >\n <td></td>\n </tr>\n </tbody>\n </table>\n\n <table\n #timelineColumns\n class=\"k-gantt-columns\"\n role=\"presentation\"\n [style.width.px]=\"tableWidth\"\n >\n <colgroup>\n <col *ngFor=\"let item of slots\">\n </colgroup>\n\n <tbody>\n <tr>\n <td *ngFor=\"let item of slots\"\n [class.k-nonwork-hour]=\"isNonWorking(item)\"\n >\n </td>\n </tr>\n </tbody>\n </table>\n\n <table\n #tasksContainer\n class=\"k-gantt-tasks\"\n role=\"presentation\"\n style=\"border-collapse: collapse;\"\n [style.width.px]=\"tableWidth\"\n >\n <tbody\n kendoGanttTasksTableBody\n [rows]=\"rows\"\n [activeView]=\"activeView\"\n [taskContentTemplate]=\"taskContentTemplate\"\n [taskTemplate]=\"taskTemplate\"\n [summaryTaskTemplate]=\"summaryTaskTemplate\"\n [taskClass]=\"taskClass\"\n [isExpanded]=\"isExpanded\"\n [selectable]=\"selectable\"\n [isTaskSelected]=\"isTaskSelected\"\n [renderDependencyDragClues]=\"renderDependencyDragClues\"\n >\n </tbody>\n </table>\n </div>\n <svg class=\"k-gantt-dependencies-svg\">\n <polyline\n *ngFor=\"let dependency of dependencies\"\n kendoGanttDependency\n [dependency]=\"dependency\"\n />\n <polyline #dependencyDragCreatePolyline />\n </svg>\n\n <!-- 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 -->\n <ng-container #dragPopupContainer></ng-container>\n </div>\n </div>\n "
|
|
164
168
|
}),
|
|
165
169
|
tslib_1.__metadata("design:paramtypes", [ScrollSyncService,
|
|
166
170
|
DependencyDomService,
|
|
@@ -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
|
var ToolbarComponent = /** @class */ (function () {
|
|
13
|
-
function ToolbarComponent(gantt
|
|
12
|
+
function ToolbarComponent(gantt) {
|
|
14
13
|
this.gantt = gantt;
|
|
15
|
-
this.scrollSyncService = scrollSyncService;
|
|
16
14
|
this.context = {};
|
|
15
|
+
this.role = 'toolbar';
|
|
17
16
|
}
|
|
18
17
|
Object.defineProperty(ToolbarComponent.prototype, "position", {
|
|
19
18
|
get: function () {
|
|
@@ -41,12 +40,13 @@ var ToolbarComponent = /** @class */ (function () {
|
|
|
41
40
|
enumerable: true,
|
|
42
41
|
configurable: true
|
|
43
42
|
});
|
|
44
|
-
ToolbarComponent.prototype.
|
|
45
|
-
this.gantt.
|
|
46
|
-
this.gantt.loadTimelineData();
|
|
47
|
-
this.gantt.activeViewChange.emit(e);
|
|
48
|
-
this.scrollSyncService.resetTimelineScrollLeft();
|
|
43
|
+
ToolbarComponent.prototype.handleViewChange = function (view) {
|
|
44
|
+
this.gantt.changeActiveView(view);
|
|
49
45
|
};
|
|
46
|
+
tslib_1.__decorate([
|
|
47
|
+
HostBinding('attr.role'),
|
|
48
|
+
tslib_1.__metadata("design:type", String)
|
|
49
|
+
], ToolbarComponent.prototype, "role", void 0);
|
|
50
50
|
tslib_1.__decorate([
|
|
51
51
|
Input(),
|
|
52
52
|
tslib_1.__metadata("design:type", Boolean)
|
|
@@ -63,10 +63,9 @@ var ToolbarComponent = /** @class */ (function () {
|
|
|
63
63
|
ToolbarComponent = tslib_1.__decorate([
|
|
64
64
|
Component({
|
|
65
65
|
selector: 'kendo-gantt-toolbar',
|
|
66
|
-
template: "\n <ng-container *ngIf=\"!renderTemplate\">\n <kendo-gantt-add-task *ngIf=\"showAddTask\"></kendo-gantt-add-task>\n <span class=\"k-spacer k-toolbar-spacer\"></span>\n <kendo-gantt-view-selector\n *ngIf=\"showViewSelector\"\n [views]=\"gantt.viewTypes\"\n [activeView]=\"gantt.activeView\"\n (activeViewChange)=\"
|
|
66
|
+
template: "\n <ng-container *ngIf=\"!renderTemplate\">\n <kendo-gantt-add-task *ngIf=\"showAddTask\"></kendo-gantt-add-task>\n <span class=\"k-spacer k-toolbar-spacer\"></span>\n <kendo-gantt-view-selector\n *ngIf=\"showViewSelector\"\n [views]=\"gantt.viewTypes\"\n [activeView]=\"gantt.activeView\"\n (activeViewChange)=\"handleViewChange($event)\"></kendo-gantt-view-selector>\n </ng-container>\n <ng-template\n *ngIf=\"renderTemplate\"\n [ngTemplateOutlet]=\"toolbarTemplateRef\"\n [ngTemplateOutletContext]=\"context\"\n >\n </ng-template>\n "
|
|
67
67
|
}),
|
|
68
|
-
tslib_1.__metadata("design:paramtypes", [GanttComponent
|
|
69
|
-
ScrollSyncService])
|
|
68
|
+
tslib_1.__metadata("design:paramtypes", [GanttComponent])
|
|
70
69
|
], ToolbarComponent);
|
|
71
70
|
return ToolbarComponent;
|
|
72
71
|
}());
|
|
@@ -55,7 +55,7 @@ var ViewSelectorComponent = /** @class */ (function () {
|
|
|
55
55
|
ViewSelectorComponent = tslib_1.__decorate([
|
|
56
56
|
Component({
|
|
57
57
|
selector: 'kendo-gantt-view-selector',
|
|
58
|
-
template: "\n <select
|
|
58
|
+
template: "\n <select\n class=\"k-dropdown k-views-dropdown\"\n aria-label=\"View Selector\"\n [value]=\"activeView\"\n (change)=\"activeViewChange.emit($event.target.value)\">\n <option *ngFor=\"let view of views\" [value]=\"view\">{{getViewTypeText(view)}}</option>\n </select>\n <kendo-buttongroup class=\"k-gantt-views\" selection=\"single\">\n <button *ngFor=\"let view of views\"\n kendoButton\n type=\"button\"\n [selected]=\"view === activeView\"\n (click)=\"onClick(view)\">{{getViewTypeText(view)}}</button>\n </kendo-buttongroup>\n "
|
|
59
59
|
}),
|
|
60
60
|
tslib_1.__metadata("design:paramtypes", [LocalizationService])
|
|
61
61
|
], ViewSelectorComponent);
|
package/dist/es/utils.js
CHANGED
|
@@ -163,6 +163,16 @@ export var isTask = function (contender, parentScope) {
|
|
|
163
163
|
var task = closestInScope(contender, matchesClasses('k-task'), parentScope);
|
|
164
164
|
return isPresent(task);
|
|
165
165
|
};
|
|
166
|
+
/**
|
|
167
|
+
* @hidden
|
|
168
|
+
*
|
|
169
|
+
* Checks whether the queried item or its parent items has a `k-toolbar` selector.
|
|
170
|
+
* Restricts the search up to the provided parent element from the second param.
|
|
171
|
+
*/
|
|
172
|
+
export var isToolbar = function (contender, parentScope) {
|
|
173
|
+
var toolbar = closestInScope(contender, matchesClasses('k-gantt-toolbar'), parentScope);
|
|
174
|
+
return isPresent(toolbar);
|
|
175
|
+
};
|
|
166
176
|
/**
|
|
167
177
|
* @hidden
|
|
168
178
|
*
|
|
@@ -237,12 +247,12 @@ export var sameTaskClues = function (fromTaskClue, toTaskClue, parentScope) {
|
|
|
237
247
|
* If the contender is above the max value, the max value is returned.
|
|
238
248
|
*/
|
|
239
249
|
export var fitToRange = function (contender, min, max) {
|
|
240
|
-
if (contender
|
|
241
|
-
return max;
|
|
242
|
-
}
|
|
243
|
-
else if (contender < min) {
|
|
250
|
+
if (!isPresent(contender) || contender < min) {
|
|
244
251
|
return min;
|
|
245
252
|
}
|
|
253
|
+
else if (contender > max) {
|
|
254
|
+
return max;
|
|
255
|
+
}
|
|
246
256
|
else {
|
|
247
257
|
return contender;
|
|
248
258
|
}
|
|
@@ -44,8 +44,8 @@ let EditDialogComponent = class EditDialogComponent {
|
|
|
44
44
|
handleEditingResult(editResultType) {
|
|
45
45
|
this.editService.triggerEditEvent(editResultType);
|
|
46
46
|
}
|
|
47
|
-
|
|
48
|
-
this.editService.
|
|
47
|
+
handleTaskDelete() {
|
|
48
|
+
this.editService.taskDelete.next(this.editService.dataItem);
|
|
49
49
|
}
|
|
50
50
|
};
|
|
51
51
|
tslib_1.__decorate([
|
|
@@ -92,7 +92,15 @@ EditDialogComponent = tslib_1.__decorate([
|
|
|
92
92
|
</kendo-tabstrip>
|
|
93
93
|
|
|
94
94
|
<kendo-dialog-actions layout="normal">
|
|
95
|
-
<button
|
|
95
|
+
<button
|
|
96
|
+
kendoButton
|
|
97
|
+
[kendoEventsOutsideAngular]="{
|
|
98
|
+
click: handleTaskDelete
|
|
99
|
+
}"
|
|
100
|
+
[scope]="this"
|
|
101
|
+
>
|
|
102
|
+
{{ getText('deleteButtonText') }}
|
|
103
|
+
</button>
|
|
96
104
|
<kendo-treelist-spacer></kendo-treelist-spacer>
|
|
97
105
|
<button kendoButton [primary]="true" (click)="handleEditingResult('save')">{{ getText('saveButtonText') }}</button>
|
|
98
106
|
<button kendoButton (click)="handleEditingResult('cancel')">{{ getText('cancelButtonText') }}</button>
|
|
@@ -4,8 +4,7 @@
|
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
5
|
import { FormGroup } from '@angular/forms';
|
|
6
6
|
import { Observable, Subject } from 'rxjs';
|
|
7
|
-
import { TaskAddEvent } from '../models/
|
|
8
|
-
import { GanttDependency } from '../main';
|
|
7
|
+
import { GanttDependency, TaskAddEvent } from '../models/models';
|
|
9
8
|
import { EditEvent, EditResultType } from '../models/events/task-edit-event.interface';
|
|
10
9
|
import { MappingService } from '../common/mapping.service';
|
|
11
10
|
/**
|
|
@@ -14,7 +13,7 @@ import { MappingService } from '../common/mapping.service';
|
|
|
14
13
|
export declare class EditService {
|
|
15
14
|
private mapper;
|
|
16
15
|
showEditingDialog: Subject<boolean>;
|
|
17
|
-
|
|
16
|
+
taskDelete: Subject<object>;
|
|
18
17
|
editEvent: Subject<EditEvent>;
|
|
19
18
|
addEvent: Subject<TaskAddEvent>;
|
|
20
19
|
taskFormGroup: FormGroup;
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
import * as tslib_1 from "tslib";
|
|
6
6
|
import { Injectable } from '@angular/core';
|
|
7
7
|
import { EMPTY, forkJoin, isObservable, of, Subject } from 'rxjs';
|
|
8
|
-
import { MappingService } from '../common/mapping.service';
|
|
9
8
|
import { map, expand, reduce } from 'rxjs/operators';
|
|
9
|
+
import { MappingService } from '../common/mapping.service';
|
|
10
10
|
import { isPresent, normalizeGanttData } from '../utils';
|
|
11
11
|
/**
|
|
12
12
|
* @hidden
|
|
@@ -15,9 +15,11 @@ let EditService = class EditService {
|
|
|
15
15
|
constructor(mapper) {
|
|
16
16
|
this.mapper = mapper;
|
|
17
17
|
this.showEditingDialog = new Subject();
|
|
18
|
-
this.
|
|
18
|
+
this.taskDelete = new Subject();
|
|
19
19
|
this.editEvent = new Subject();
|
|
20
20
|
this.addEvent = new Subject();
|
|
21
|
+
this.predecessors = [];
|
|
22
|
+
this.successors = [];
|
|
21
23
|
this.updatedItems = [];
|
|
22
24
|
this.deletedItems = [];
|
|
23
25
|
this.itemIndex = (item, data) => {
|
|
@@ -2,8 +2,8 @@
|
|
|
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 { MappingService } from
|
|
6
|
-
import { TaskEditItem } from
|
|
5
|
+
import { MappingService } from '../common/mapping.service';
|
|
6
|
+
import { TaskEditItem } from '../models/events/task-edit-event.interface';
|
|
7
7
|
/**
|
|
8
8
|
* @hidden
|
|
9
9
|
*/
|