@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
|
@@ -8,10 +8,10 @@ var tslib_1 = require("tslib");
|
|
|
8
8
|
var core_1 = require("@angular/core");
|
|
9
9
|
var rxjs_1 = require("rxjs");
|
|
10
10
|
var operators_1 = require("rxjs/operators");
|
|
11
|
+
var kendo_angular_common_1 = require("@progress/kendo-angular-common");
|
|
11
12
|
var scroll_sync_service_1 = require("../scrolling/scroll-sync.service");
|
|
12
13
|
var dependency_dom_service_1 = require("../dependencies/dependency-dom.service");
|
|
13
14
|
var utils_1 = require("../utils");
|
|
14
|
-
var kendo_angular_common_1 = require("@progress/kendo-angular-common");
|
|
15
15
|
/**
|
|
16
16
|
* @hidden
|
|
17
17
|
*/
|
|
@@ -24,6 +24,10 @@ var GanttTimelineComponent = /** @class */ (function () {
|
|
|
24
24
|
this.zone = zone;
|
|
25
25
|
this.hostClass = true;
|
|
26
26
|
this.dependencies = [];
|
|
27
|
+
// as all drag-and-drop operations are on the timeline container, use a single draggable instance
|
|
28
|
+
this.timelineContainerPress = new core_1.EventEmitter();
|
|
29
|
+
this.timelineContainerDrag = new core_1.EventEmitter();
|
|
30
|
+
this.timelineContainerRelease = new core_1.EventEmitter();
|
|
27
31
|
this.subscriptions = new rxjs_1.Subscription();
|
|
28
32
|
this.subscriptions.add(
|
|
29
33
|
// task changes indicates change in row content, number, height, etc.
|
|
@@ -36,6 +40,16 @@ var GanttTimelineComponent = /** @class */ (function () {
|
|
|
36
40
|
_this.renderer.setStyle(_this.timelineColumns.nativeElement, 'height', (_this.rows || []).length * timelineRowHeight + "px");
|
|
37
41
|
}));
|
|
38
42
|
}
|
|
43
|
+
Object.defineProperty(GanttTimelineComponent.prototype, "draggableEnabled", {
|
|
44
|
+
/**
|
|
45
|
+
* Specifies whether the draggable will attach or detach its pointer event listeners.
|
|
46
|
+
*/
|
|
47
|
+
get: function () {
|
|
48
|
+
return this.renderDependencyDragClues;
|
|
49
|
+
},
|
|
50
|
+
enumerable: true,
|
|
51
|
+
configurable: true
|
|
52
|
+
});
|
|
39
53
|
GanttTimelineComponent.prototype.ngAfterViewInit = function () {
|
|
40
54
|
var timelineHeader = this.timelineHeaderWrap.nativeElement;
|
|
41
55
|
var rightContainer = this.timelineContent.nativeElement;
|
|
@@ -65,6 +79,14 @@ var GanttTimelineComponent = /** @class */ (function () {
|
|
|
65
79
|
core_1.ViewChild('tasksContainer', { static: true }),
|
|
66
80
|
tslib_1.__metadata("design:type", core_1.ElementRef)
|
|
67
81
|
], GanttTimelineComponent.prototype, "tasksContainer", void 0);
|
|
82
|
+
tslib_1.__decorate([
|
|
83
|
+
core_1.ViewChild('dragPopupContainer', { static: false, read: core_1.ViewContainerRef }),
|
|
84
|
+
tslib_1.__metadata("design:type", core_1.ViewContainerRef)
|
|
85
|
+
], GanttTimelineComponent.prototype, "dragPopupContainer", void 0);
|
|
86
|
+
tslib_1.__decorate([
|
|
87
|
+
core_1.ViewChild('dependencyDragCreatePolyline', { static: false }),
|
|
88
|
+
tslib_1.__metadata("design:type", core_1.ElementRef)
|
|
89
|
+
], GanttTimelineComponent.prototype, "dependencyDragCreatePolyline", void 0);
|
|
68
90
|
tslib_1.__decorate([
|
|
69
91
|
core_1.HostBinding('class.k-gantt-timeline'),
|
|
70
92
|
tslib_1.__metadata("design:type", Boolean)
|
|
@@ -105,6 +127,18 @@ var GanttTimelineComponent = /** @class */ (function () {
|
|
|
105
127
|
core_1.Input(),
|
|
106
128
|
tslib_1.__metadata("design:type", Function)
|
|
107
129
|
], GanttTimelineComponent.prototype, "taskClass", void 0);
|
|
130
|
+
tslib_1.__decorate([
|
|
131
|
+
core_1.Input(),
|
|
132
|
+
tslib_1.__metadata("design:type", Boolean)
|
|
133
|
+
], GanttTimelineComponent.prototype, "renderDependencyDragClues", void 0);
|
|
134
|
+
tslib_1.__decorate([
|
|
135
|
+
core_1.Input(),
|
|
136
|
+
tslib_1.__metadata("design:type", Object)
|
|
137
|
+
], GanttTimelineComponent.prototype, "dragScrollSettings", void 0);
|
|
138
|
+
tslib_1.__decorate([
|
|
139
|
+
core_1.Input(),
|
|
140
|
+
tslib_1.__metadata("design:type", Boolean)
|
|
141
|
+
], GanttTimelineComponent.prototype, "selectable", void 0);
|
|
108
142
|
tslib_1.__decorate([
|
|
109
143
|
core_1.Input(),
|
|
110
144
|
tslib_1.__metadata("design:type", Function)
|
|
@@ -112,15 +146,27 @@ var GanttTimelineComponent = /** @class */ (function () {
|
|
|
112
146
|
tslib_1.__decorate([
|
|
113
147
|
core_1.Input(),
|
|
114
148
|
tslib_1.__metadata("design:type", Function)
|
|
115
|
-
], GanttTimelineComponent.prototype, "
|
|
149
|
+
], GanttTimelineComponent.prototype, "isExpanded", void 0);
|
|
116
150
|
tslib_1.__decorate([
|
|
117
151
|
core_1.Input(),
|
|
118
152
|
tslib_1.__metadata("design:type", Array)
|
|
119
153
|
], GanttTimelineComponent.prototype, "dependencies", void 0);
|
|
154
|
+
tslib_1.__decorate([
|
|
155
|
+
core_1.Output(),
|
|
156
|
+
tslib_1.__metadata("design:type", core_1.EventEmitter)
|
|
157
|
+
], GanttTimelineComponent.prototype, "timelineContainerPress", void 0);
|
|
158
|
+
tslib_1.__decorate([
|
|
159
|
+
core_1.Output(),
|
|
160
|
+
tslib_1.__metadata("design:type", core_1.EventEmitter)
|
|
161
|
+
], GanttTimelineComponent.prototype, "timelineContainerDrag", void 0);
|
|
162
|
+
tslib_1.__decorate([
|
|
163
|
+
core_1.Output(),
|
|
164
|
+
tslib_1.__metadata("design:type", core_1.EventEmitter)
|
|
165
|
+
], GanttTimelineComponent.prototype, "timelineContainerRelease", void 0);
|
|
120
166
|
GanttTimelineComponent = tslib_1.__decorate([
|
|
121
167
|
core_1.Component({
|
|
122
168
|
selector: 'kendo-gantt-timeline',
|
|
123
|
-
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
|
|
169
|
+
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 "
|
|
124
170
|
}),
|
|
125
171
|
tslib_1.__metadata("design:paramtypes", [scroll_sync_service_1.ScrollSyncService,
|
|
126
172
|
dependency_dom_service_1.DependencyDomService,
|
|
@@ -7,15 +7,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
7
7
|
var tslib_1 = require("tslib");
|
|
8
8
|
var core_1 = require("@angular/core");
|
|
9
9
|
var gantt_component_1 = require("../gantt.component");
|
|
10
|
-
var scroll_sync_service_1 = require("../scrolling/scroll-sync.service");
|
|
11
10
|
/**
|
|
12
11
|
* @hidden
|
|
13
12
|
*/
|
|
14
13
|
var ToolbarComponent = /** @class */ (function () {
|
|
15
|
-
function ToolbarComponent(gantt
|
|
14
|
+
function ToolbarComponent(gantt) {
|
|
16
15
|
this.gantt = gantt;
|
|
17
|
-
this.scrollSyncService = scrollSyncService;
|
|
18
16
|
this.context = {};
|
|
17
|
+
this.role = 'toolbar';
|
|
19
18
|
}
|
|
20
19
|
Object.defineProperty(ToolbarComponent.prototype, "position", {
|
|
21
20
|
get: function () {
|
|
@@ -43,12 +42,13 @@ var ToolbarComponent = /** @class */ (function () {
|
|
|
43
42
|
enumerable: true,
|
|
44
43
|
configurable: true
|
|
45
44
|
});
|
|
46
|
-
ToolbarComponent.prototype.
|
|
47
|
-
this.gantt.
|
|
48
|
-
this.gantt.loadTimelineData();
|
|
49
|
-
this.gantt.activeViewChange.emit(e);
|
|
50
|
-
this.scrollSyncService.resetTimelineScrollLeft();
|
|
45
|
+
ToolbarComponent.prototype.handleViewChange = function (view) {
|
|
46
|
+
this.gantt.changeActiveView(view);
|
|
51
47
|
};
|
|
48
|
+
tslib_1.__decorate([
|
|
49
|
+
core_1.HostBinding('attr.role'),
|
|
50
|
+
tslib_1.__metadata("design:type", String)
|
|
51
|
+
], ToolbarComponent.prototype, "role", void 0);
|
|
52
52
|
tslib_1.__decorate([
|
|
53
53
|
core_1.Input(),
|
|
54
54
|
tslib_1.__metadata("design:type", Boolean)
|
|
@@ -65,10 +65,9 @@ var ToolbarComponent = /** @class */ (function () {
|
|
|
65
65
|
ToolbarComponent = tslib_1.__decorate([
|
|
66
66
|
core_1.Component({
|
|
67
67
|
selector: 'kendo-gantt-toolbar',
|
|
68
|
-
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)=\"
|
|
68
|
+
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 "
|
|
69
69
|
}),
|
|
70
|
-
tslib_1.__metadata("design:paramtypes", [gantt_component_1.GanttComponent
|
|
71
|
-
scroll_sync_service_1.ScrollSyncService])
|
|
70
|
+
tslib_1.__metadata("design:paramtypes", [gantt_component_1.GanttComponent])
|
|
72
71
|
], ToolbarComponent);
|
|
73
72
|
return ToolbarComponent;
|
|
74
73
|
}());
|
|
@@ -57,7 +57,7 @@ var ViewSelectorComponent = /** @class */ (function () {
|
|
|
57
57
|
ViewSelectorComponent = tslib_1.__decorate([
|
|
58
58
|
core_1.Component({
|
|
59
59
|
selector: 'kendo-gantt-view-selector',
|
|
60
|
-
template: "\n <select
|
|
60
|
+
template: "\n <select\n class=\"k-dropdownlist k-picker k-rounded-md 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 "
|
|
61
61
|
}),
|
|
62
62
|
tslib_1.__metadata("design:paramtypes", [kendo_angular_l10n_1.LocalizationService])
|
|
63
63
|
], ViewSelectorComponent);
|
package/dist/npm/utils.js
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
7
|
var kendo_angular_common_1 = require("@progress/kendo-angular-common");
|
|
8
8
|
var kendo_date_math_1 = require("@progress/kendo-date-math");
|
|
9
|
+
var dependency_type_enum_1 = require("./models/dependency-type.enum");
|
|
9
10
|
/**
|
|
10
11
|
* @hidden
|
|
11
12
|
*/
|
|
@@ -112,24 +113,43 @@ exports.isNumber = function (contender) { return typeof contender === 'number' &
|
|
|
112
113
|
* @hidden
|
|
113
114
|
*/
|
|
114
115
|
exports.isString = function (contender) { return typeof contender === 'string'; };
|
|
116
|
+
/**
|
|
117
|
+
* @hidden
|
|
118
|
+
*
|
|
119
|
+
* Gets the closest timeline task wrapper element from an event target.
|
|
120
|
+
* Restricts the search up to the provided parent element from the second param.
|
|
121
|
+
*/
|
|
122
|
+
exports.getClosestTaskWrapper = function (element, parentScope) {
|
|
123
|
+
return kendo_angular_common_1.closestInScope(element, kendo_angular_common_1.matchesClasses('k-task-wrap'), parentScope);
|
|
124
|
+
};
|
|
125
|
+
/**
|
|
126
|
+
* @hidden
|
|
127
|
+
*
|
|
128
|
+
* Checks whether the queried item or its parent items has a `k-task-wrap` selector.
|
|
129
|
+
* Restricts the search up to the provided parent element from the second param.
|
|
130
|
+
*/
|
|
131
|
+
exports.isTaskWrapper = function (contender, parentScope) {
|
|
132
|
+
var taskWrapper = kendo_angular_common_1.closestInScope(contender, kendo_angular_common_1.matchesClasses('k-task-wrap'), parentScope);
|
|
133
|
+
return exports.isPresent(taskWrapper);
|
|
134
|
+
};
|
|
115
135
|
/**
|
|
116
136
|
* @hidden
|
|
117
137
|
*
|
|
118
138
|
* Gets the closest timeline task element from an event target.
|
|
119
|
-
* Restricts the search up to the provided
|
|
139
|
+
* Restricts the search up to the provided parent element from the second param.
|
|
120
140
|
*/
|
|
121
|
-
exports.getClosestTask = function (element,
|
|
122
|
-
return kendo_angular_common_1.closestInScope(element, kendo_angular_common_1.matchesClasses('k-task'),
|
|
141
|
+
exports.getClosestTask = function (element, parentScope) {
|
|
142
|
+
return kendo_angular_common_1.closestInScope(element, kendo_angular_common_1.matchesClasses('k-task'), parentScope);
|
|
123
143
|
};
|
|
124
144
|
/**
|
|
125
145
|
* @hidden
|
|
126
146
|
*
|
|
127
147
|
* Gets the closest timeline task element index from an event target.
|
|
128
148
|
* Uses the `data-task-index` attribute assigned to each task.
|
|
129
|
-
* Restricts the search up to the provided
|
|
149
|
+
* Restricts the search up to the provided parent element from the second param.
|
|
130
150
|
*/
|
|
131
|
-
exports.getClosestTaskIndex = function (element,
|
|
132
|
-
var task = kendo_angular_common_1.closestInScope(element, kendo_angular_common_1.matchesClasses('k-task'),
|
|
151
|
+
exports.getClosestTaskIndex = function (element, parentScope) {
|
|
152
|
+
var task = kendo_angular_common_1.closestInScope(element, kendo_angular_common_1.matchesClasses('k-task-wrap'), parentScope);
|
|
133
153
|
if (!exports.isPresent(task)) {
|
|
134
154
|
return null;
|
|
135
155
|
}
|
|
@@ -139,19 +159,140 @@ exports.getClosestTaskIndex = function (element, gantt) {
|
|
|
139
159
|
* @hidden
|
|
140
160
|
*
|
|
141
161
|
* Checks whether the queried item or its parent items has a `k-task` selector.
|
|
142
|
-
* Restricts the search up to the provided
|
|
162
|
+
* Restricts the search up to the provided parent element from the second param.
|
|
143
163
|
*/
|
|
144
|
-
exports.isTask = function (contender,
|
|
145
|
-
var task = kendo_angular_common_1.closestInScope(contender, kendo_angular_common_1.matchesClasses('k-task'),
|
|
164
|
+
exports.isTask = function (contender, parentScope) {
|
|
165
|
+
var task = kendo_angular_common_1.closestInScope(contender, kendo_angular_common_1.matchesClasses('k-task'), parentScope);
|
|
146
166
|
return exports.isPresent(task);
|
|
147
167
|
};
|
|
168
|
+
/**
|
|
169
|
+
* @hidden
|
|
170
|
+
*
|
|
171
|
+
* Checks whether the queried item or its parent items has a `k-toolbar` selector.
|
|
172
|
+
* Restricts the search up to the provided parent element from the second param.
|
|
173
|
+
*/
|
|
174
|
+
exports.isToolbar = function (contender, parentScope) {
|
|
175
|
+
var toolbar = kendo_angular_common_1.closestInScope(contender, kendo_angular_common_1.matchesClasses('k-gantt-toolbar'), parentScope);
|
|
176
|
+
return exports.isPresent(toolbar);
|
|
177
|
+
};
|
|
148
178
|
/**
|
|
149
179
|
* @hidden
|
|
150
180
|
*
|
|
151
181
|
* Checks whether the queried item or its parent items has a `k-task-actions` selector - used for the clear button.
|
|
152
|
-
* Restricts the search up to the provided
|
|
182
|
+
* Restricts the search up to the provided parent element from the second param.
|
|
153
183
|
*/
|
|
154
|
-
exports.isClearButton = function (contender,
|
|
155
|
-
var clearButtonContainer = kendo_angular_common_1.closestInScope(contender, kendo_angular_common_1.matchesClasses('k-task-actions'),
|
|
184
|
+
exports.isClearButton = function (contender, parentScope) {
|
|
185
|
+
var clearButtonContainer = kendo_angular_common_1.closestInScope(contender, kendo_angular_common_1.matchesClasses('k-task-actions'), parentScope);
|
|
156
186
|
return exports.isPresent(clearButtonContainer);
|
|
157
187
|
};
|
|
188
|
+
/**
|
|
189
|
+
* @hidden
|
|
190
|
+
*
|
|
191
|
+
* Checks whether the queried item has a `k-task-dot` selector - used for the dependency drag clues.
|
|
192
|
+
*/
|
|
193
|
+
exports.isDependencyDragClue = function (element) {
|
|
194
|
+
if (!exports.isPresent(element)) {
|
|
195
|
+
return false;
|
|
196
|
+
}
|
|
197
|
+
return element.classList.contains('k-task-dot');
|
|
198
|
+
};
|
|
199
|
+
/**
|
|
200
|
+
* @hidden
|
|
201
|
+
*
|
|
202
|
+
* Checks whether the queried item has a `k-task-dot` & `k-task-start` selector - used for the dependency drag start clues.
|
|
203
|
+
*/
|
|
204
|
+
exports.isDependencyDragStartClue = function (element) {
|
|
205
|
+
if (!exports.isPresent(element)) {
|
|
206
|
+
return false;
|
|
207
|
+
}
|
|
208
|
+
return element.classList.contains('k-task-dot') && element.classList.contains('k-task-start');
|
|
209
|
+
};
|
|
210
|
+
/**
|
|
211
|
+
* @hidden
|
|
212
|
+
*
|
|
213
|
+
* Gets the `DependencyType` for an attempted dependency create from the provided two elements.
|
|
214
|
+
* The two linked drag clue HTML elements are used to extract this data (via their CSS classes).
|
|
215
|
+
*/
|
|
216
|
+
exports.getDependencyTypeFromTargetTasks = function (fromTaskClue, toTaskClue) {
|
|
217
|
+
if (!exports.isDependencyDragClue(fromTaskClue) || !exports.isDependencyDragClue(toTaskClue)) {
|
|
218
|
+
return null;
|
|
219
|
+
}
|
|
220
|
+
var fromTaskType = exports.isDependencyDragStartClue(fromTaskClue) ? 'S' : 'F';
|
|
221
|
+
var toTaskType = exports.isDependencyDragStartClue(toTaskClue) ? 'S' : 'F';
|
|
222
|
+
var dependencyTypeName = "" + fromTaskType + toTaskType;
|
|
223
|
+
switch (dependencyTypeName) {
|
|
224
|
+
case 'FF': return dependency_type_enum_1.DependencyType.FF;
|
|
225
|
+
case 'FS': return dependency_type_enum_1.DependencyType.FS;
|
|
226
|
+
case 'SF': return dependency_type_enum_1.DependencyType.SF;
|
|
227
|
+
case 'SS': return dependency_type_enum_1.DependencyType.SS;
|
|
228
|
+
default: return null;
|
|
229
|
+
}
|
|
230
|
+
};
|
|
231
|
+
/**
|
|
232
|
+
* @hidden
|
|
233
|
+
*
|
|
234
|
+
* Checks whether the two provided drag clues belong to the same task element.
|
|
235
|
+
*/
|
|
236
|
+
exports.sameTaskClues = function (fromTaskClue, toTaskClue, parentScope) {
|
|
237
|
+
if (!exports.isPresent(fromTaskClue) || !exports.isPresent(toTaskClue)) {
|
|
238
|
+
return false;
|
|
239
|
+
}
|
|
240
|
+
var fromTaskWrapper = exports.getClosestTaskWrapper(fromTaskClue, parentScope);
|
|
241
|
+
var toTaskWrapper = exports.getClosestTaskWrapper(toTaskClue, parentScope);
|
|
242
|
+
return fromTaskWrapper === toTaskWrapper;
|
|
243
|
+
};
|
|
244
|
+
/**
|
|
245
|
+
* @hidden
|
|
246
|
+
*
|
|
247
|
+
* Fits a contender number between a min and max range.
|
|
248
|
+
* If the contender is below the min value, the min value is returned.
|
|
249
|
+
* If the contender is above the max value, the max value is returned.
|
|
250
|
+
*/
|
|
251
|
+
exports.fitToRange = function (contender, min, max) {
|
|
252
|
+
if (!exports.isPresent(contender) || contender < min) {
|
|
253
|
+
return min;
|
|
254
|
+
}
|
|
255
|
+
else if (contender > max) {
|
|
256
|
+
return max;
|
|
257
|
+
}
|
|
258
|
+
else {
|
|
259
|
+
return contender;
|
|
260
|
+
}
|
|
261
|
+
};
|
|
262
|
+
/**
|
|
263
|
+
* @hidden
|
|
264
|
+
*
|
|
265
|
+
* Checks whether either of the two provided tasks is a parent of the other.
|
|
266
|
+
*/
|
|
267
|
+
exports.areParentChild = function (taskA, taskB) {
|
|
268
|
+
var parentChildRelationship = false;
|
|
269
|
+
var taskAParent = taskA;
|
|
270
|
+
while (exports.isPresent(taskAParent) && exports.isPresent(taskAParent.data)) {
|
|
271
|
+
if (taskAParent.data === taskB.data) {
|
|
272
|
+
parentChildRelationship = true;
|
|
273
|
+
break;
|
|
274
|
+
}
|
|
275
|
+
taskAParent = taskAParent.parent;
|
|
276
|
+
}
|
|
277
|
+
var taskBParent = taskB;
|
|
278
|
+
while (!parentChildRelationship && exports.isPresent(taskBParent) && exports.isPresent(taskBParent.data)) {
|
|
279
|
+
if (taskBParent.data === taskA.data) {
|
|
280
|
+
parentChildRelationship = true;
|
|
281
|
+
break;
|
|
282
|
+
}
|
|
283
|
+
taskBParent = taskBParent.parent;
|
|
284
|
+
}
|
|
285
|
+
return parentChildRelationship;
|
|
286
|
+
};
|
|
287
|
+
/**
|
|
288
|
+
* @hidden
|
|
289
|
+
*
|
|
290
|
+
* Extracts an element from the provided client coords.
|
|
291
|
+
* Using the `event.target` is not reliable under mobile devices with the current implementation of the draggable, so use this instead.
|
|
292
|
+
*/
|
|
293
|
+
exports.elementFromPoint = function (clientX, clientY) {
|
|
294
|
+
if (!kendo_angular_common_1.isDocumentAvailable()) {
|
|
295
|
+
return null;
|
|
296
|
+
}
|
|
297
|
+
return document.elementFromPoint(clientX, clientY);
|
|
298
|
+
};
|