@progress/kendo-angular-gantt 0.1.4 → 0.2.0-dev.202111241002
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 -76
- package/dist/cdn/main.js +23 -1
- package/dist/es/columns/column.component.js +5 -0
- package/dist/es/columns/columns.js +1 -0
- package/dist/es/columns/edit-template.directive.js +34 -0
- package/dist/es/columns/span-column.component.js +6 -0
- package/dist/es/common/default-callbacks.js +4 -0
- package/dist/es/editing/edit-dialog.component.js +44 -0
- package/dist/es/editing/edit.service.js +39 -0
- package/dist/es/editing/util.js +17 -0
- package/dist/es/gantt.component.js +478 -22
- package/dist/es/gantt.module.js +62 -5
- package/dist/es/index.js +6 -0
- package/dist/es/localization/custom-messages.component.js +44 -0
- package/dist/es/localization/localized-messages.directive.js +35 -0
- package/dist/es/localization/messages.js +246 -0
- package/dist/es/localization/treelist-messages.directive.js +31 -0
- package/dist/es/main.js +1 -0
- package/dist/es/models/events/cell-click-event.interface.js +4 -0
- package/dist/es/models/events/cell-close-event.interface.js +19 -0
- package/dist/es/models/events/preventable-event.js +32 -0
- package/dist/es/models/events/task-click-event.interface.js +4 -0
- package/dist/es/models/events/task-edit-event.interface.js +4 -0
- package/dist/es/models/gantt-task-model-fields.interface.js +2 -1
- package/dist/es/package-metadata.js +1 -1
- package/dist/es/rendering/gantt-milestone-task.component.js +1 -1
- package/dist/es/rendering/gantt-summary-task.component.js +1 -1
- package/dist/es/rendering/gantt-task-base.js +8 -0
- package/dist/es/rendering/gantt-task.component.js +12 -4
- package/dist/es/rendering/gantt-tasks-table-body.component.js +5 -1
- package/dist/es/selection/selectable.directive.js +141 -0
- package/dist/es/selection/selection-change-event.js +4 -0
- package/dist/es/timeline/gantt-timeline.component.js +5 -1
- package/dist/es/toolbar/view-selector.component.js +7 -4
- package/dist/es/utils.js +48 -1
- package/dist/es2015/columns/column.component.d.ts +2 -0
- package/dist/es2015/columns/column.component.js +5 -0
- package/dist/es2015/columns/columns.d.ts +1 -0
- package/dist/es2015/columns/columns.js +1 -0
- package/dist/es2015/columns/edit-template.directive.d.ts +23 -0
- package/dist/es2015/columns/edit-template.directive.js +33 -0
- package/dist/es2015/columns/span-column.component.d.ts +2 -0
- package/dist/es2015/columns/span-column.component.js +6 -0
- package/dist/es2015/common/default-callbacks.d.ts +4 -0
- package/dist/es2015/common/default-callbacks.js +4 -0
- package/dist/es2015/editing/edit-dialog.component.d.ts +21 -0
- package/dist/es2015/editing/edit-dialog.component.js +86 -0
- package/dist/es2015/editing/edit.service.d.ts +20 -0
- package/dist/es2015/editing/edit.service.js +41 -0
- package/dist/es2015/editing/util.d.ts +10 -0
- package/dist/es2015/editing/util.js +17 -0
- package/dist/es2015/gantt.component.d.ts +236 -12
- package/dist/es2015/gantt.component.js +662 -21
- package/dist/es2015/gantt.module.d.ts +29 -1
- package/dist/es2015/gantt.module.js +62 -5
- package/dist/es2015/index.d.ts +6 -0
- package/dist/es2015/index.js +6 -0
- package/dist/es2015/index.metadata.json +1 -1
- package/dist/es2015/localization/custom-messages.component.d.ts +15 -0
- package/dist/es2015/localization/custom-messages.component.js +36 -0
- package/dist/es2015/localization/localized-messages.directive.d.ts +13 -0
- package/dist/es2015/localization/localized-messages.directive.js +31 -0
- package/dist/es2015/localization/messages.d.ts +246 -0
- package/dist/es2015/localization/messages.js +240 -0
- package/dist/es2015/localization/treelist-messages.directive.d.ts +14 -0
- package/dist/es2015/localization/treelist-messages.directive.js +29 -0
- package/dist/es2015/main.d.ts +2 -0
- package/dist/es2015/main.js +1 -0
- package/dist/es2015/models/events/cell-click-event.interface.d.ts +43 -0
- package/dist/es2015/models/events/cell-click-event.interface.js +4 -0
- package/dist/es2015/models/events/cell-close-event.interface.d.ts +48 -0
- package/dist/es2015/models/events/cell-close-event.interface.js +14 -0
- package/dist/es2015/models/events/preventable-event.d.ts +24 -0
- package/dist/es2015/models/events/preventable-event.js +30 -0
- package/dist/es2015/models/events/task-click-event.interface.d.ts +30 -0
- package/dist/es2015/models/events/task-click-event.interface.js +4 -0
- package/dist/es2015/models/events/task-edit-event.interface.d.ts +46 -0
- package/dist/es2015/models/events/task-edit-event.interface.js +4 -0
- package/dist/es2015/models/gantt-task-model-fields.interface.d.ts +1 -0
- package/dist/es2015/models/gantt-task-model-fields.interface.js +2 -1
- package/dist/es2015/models/models.d.ts +2 -0
- package/dist/es2015/package-metadata.js +1 -1
- package/dist/es2015/rendering/gantt-milestone-task.component.js +2 -0
- package/dist/es2015/rendering/gantt-summary-task.component.js +2 -0
- package/dist/es2015/rendering/gantt-task-base.d.ts +2 -0
- package/dist/es2015/rendering/gantt-task-base.js +8 -0
- package/dist/es2015/rendering/gantt-task.component.d.ts +4 -1
- package/dist/es2015/rendering/gantt-task.component.js +18 -2
- package/dist/es2015/rendering/gantt-tasks-table-body.component.d.ts +1 -0
- package/dist/es2015/rendering/gantt-tasks-table-body.component.js +11 -1
- package/dist/es2015/selection/selectable.directive.d.ts +42 -0
- package/dist/es2015/selection/selectable.directive.js +122 -0
- package/dist/es2015/selection/selection-change-event.d.ts +25 -0
- package/dist/es2015/selection/selection-change-event.js +4 -0
- package/dist/es2015/timeline/gantt-timeline.component.d.ts +1 -0
- package/dist/es2015/timeline/gantt-timeline.component.js +5 -0
- package/dist/es2015/toolbar/view-selector.component.d.ts +3 -0
- package/dist/es2015/toolbar/view-selector.component.js +7 -7
- package/dist/es2015/utils.d.ts +39 -0
- package/dist/es2015/utils.js +48 -1
- package/dist/fesm2015/index.js +1387 -35
- package/dist/fesm5/index.js +1191 -45
- package/dist/npm/columns/column.component.js +5 -0
- package/dist/npm/columns/columns.js +2 -0
- package/dist/npm/columns/edit-template.directive.js +36 -0
- package/dist/npm/columns/span-column.component.js +6 -0
- package/dist/npm/common/default-callbacks.js +4 -0
- package/dist/npm/editing/edit-dialog.component.js +46 -0
- package/dist/npm/editing/edit.service.js +41 -0
- package/dist/npm/editing/util.js +19 -0
- package/dist/npm/gantt.component.js +475 -19
- package/dist/npm/gantt.module.js +61 -4
- package/dist/npm/index.js +12 -0
- package/dist/npm/localization/custom-messages.component.js +46 -0
- package/dist/npm/localization/localized-messages.directive.js +37 -0
- package/dist/npm/localization/messages.js +248 -0
- package/dist/npm/localization/treelist-messages.directive.js +33 -0
- package/dist/npm/main.js +2 -0
- package/dist/npm/models/events/cell-click-event.interface.js +6 -0
- package/dist/npm/models/events/cell-close-event.interface.js +21 -0
- package/dist/npm/models/events/preventable-event.js +34 -0
- package/dist/npm/models/events/task-click-event.interface.js +6 -0
- package/dist/npm/models/events/task-edit-event.interface.js +6 -0
- package/dist/npm/models/gantt-task-model-fields.interface.js +2 -1
- package/dist/npm/package-metadata.js +1 -1
- package/dist/npm/rendering/gantt-milestone-task.component.js +1 -1
- package/dist/npm/rendering/gantt-summary-task.component.js +1 -1
- package/dist/npm/rendering/gantt-task-base.js +8 -0
- package/dist/npm/rendering/gantt-task.component.js +12 -4
- package/dist/npm/rendering/gantt-tasks-table-body.component.js +5 -1
- package/dist/npm/selection/selectable.directive.js +143 -0
- package/dist/npm/selection/selection-change-event.js +6 -0
- package/dist/npm/timeline/gantt-timeline.component.js +5 -1
- package/dist/npm/toolbar/view-selector.component.js +7 -4
- package/dist/npm/utils.js +47 -0
- package/dist/systemjs/kendo-angular-gantt.js +1 -1
- package/package.json +15 -10
|
@@ -9,15 +9,22 @@ import { DependencyDomService } from '../dependencies/dependency-dom.service';
|
|
|
9
9
|
import { OptionChangesService } from '../common/option-changes.service';
|
|
10
10
|
import { TimelineViewService } from './../timeline/timeline-view.service';
|
|
11
11
|
import { GanttTaskBase } from './gantt-task-base';
|
|
12
|
+
import { EditService } from '../editing/edit.service';
|
|
12
13
|
/**
|
|
13
14
|
* @hidden
|
|
14
15
|
*/
|
|
15
16
|
var GanttTaskComponent = /** @class */ (function (_super) {
|
|
16
17
|
tslib_1.__extends(GanttTaskComponent, _super);
|
|
17
|
-
function GanttTaskComponent(mapper, timelineViewService, dependencyDomService, optionChangesService, cdr) {
|
|
18
|
-
|
|
18
|
+
function GanttTaskComponent(mapper, timelineViewService, dependencyDomService, optionChangesService, cdr, editService) {
|
|
19
|
+
var _this = _super.call(this, mapper, timelineViewService, dependencyDomService, optionChangesService, cdr) || this;
|
|
20
|
+
_this.editService = editService;
|
|
21
|
+
return _this;
|
|
19
22
|
}
|
|
20
23
|
GanttTaskComponent_1 = GanttTaskComponent;
|
|
24
|
+
GanttTaskComponent.prototype.onTaskDelete = function () {
|
|
25
|
+
this.editService.dataItem = this.dataItem;
|
|
26
|
+
this.editService.showConfirmationDialog.next();
|
|
27
|
+
};
|
|
21
28
|
var GanttTaskComponent_1;
|
|
22
29
|
tslib_1.__decorate([
|
|
23
30
|
Input(),
|
|
@@ -36,13 +43,14 @@ var GanttTaskComponent = /** @class */ (function (_super) {
|
|
|
36
43
|
useExisting: forwardRef(function () { return GanttTaskComponent_1; })
|
|
37
44
|
}
|
|
38
45
|
],
|
|
39
|
-
template: "\n <div\n #task\n class=\"k-task k-task-single\"\n [ngClass]=\"taskClass(dataItem)\"\n [style.width.px]=\"taskWidth\"\n [style.left.px]=\"taskOffset\"\n [attr.title]=\"mapper.extractFromTask(dataItem, 'title')\"\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 </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 "
|
|
46
|
+
template: "\n <div\n #task\n class=\"k-task k-task-single\"\n [ngClass]=\"taskClass(dataItem)\"\n [style.width.px]=\"taskWidth\"\n [style.left.px]=\"taskOffset\"\n [attr.title]=\"mapper.extractFromTask(dataItem, 'title')\"\n [attr.data-task-index]=\"index\"\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 class=\"k-task-actions\">\n <span\n (click)=\"onTaskDelete()\"\n class=\"k-link k-task-delete\">\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 "
|
|
40
47
|
}),
|
|
41
48
|
tslib_1.__metadata("design:paramtypes", [MappingService,
|
|
42
49
|
TimelineViewService,
|
|
43
50
|
DependencyDomService,
|
|
44
51
|
OptionChangesService,
|
|
45
|
-
ChangeDetectorRef
|
|
52
|
+
ChangeDetectorRef,
|
|
53
|
+
EditService])
|
|
46
54
|
], GanttTaskComponent);
|
|
47
55
|
return GanttTaskComponent;
|
|
48
56
|
}(GanttTaskBase));
|
|
@@ -63,10 +63,14 @@ var GanttTasksTableBodyComponent = /** @class */ (function () {
|
|
|
63
63
|
Input(),
|
|
64
64
|
tslib_1.__metadata("design:type", Function)
|
|
65
65
|
], GanttTasksTableBodyComponent.prototype, "hasChildren", void 0);
|
|
66
|
+
tslib_1.__decorate([
|
|
67
|
+
Input(),
|
|
68
|
+
tslib_1.__metadata("design:type", Function)
|
|
69
|
+
], GanttTasksTableBodyComponent.prototype, "isTaskSelected", void 0);
|
|
66
70
|
GanttTasksTableBodyComponent = tslib_1.__decorate([
|
|
67
71
|
Component({
|
|
68
72
|
selector: '[kendoGanttTasksTableBody]',
|
|
69
|
-
template: "\n <tr #timelineRow *ngFor=\"let item of rows\">\n <td>\n <kendo-gantt-milestone-task\n *ngIf=\"isMileStone(item); else task\"\n [dataItem]=\"item\"\n [activeView]=\"activeView\"\n [taskClass]=\"taskClass\"\n >\n </kendo-gantt-milestone-task>\n <ng-template #task>\n <kendo-gantt-summary-task\n *ngIf=\"hasChildren(item)\"\n [dataItem]=\"item\"\n [template]=\"summaryTaskTemplate\"\n [activeView]=\"activeView\"\n [taskClass]=\"taskClass\"\n >\n </kendo-gantt-summary-task>\n <kendo-gantt-task\n *ngIf=\"!hasChildren(item)\"\n [dataItem]=\"item\"\n [taskContentTemplate]=\"taskContentTemplate\"\n [taskTemplate]=\"taskTemplate\"\n [activeView]=\"activeView\"\n [taskClass]=\"taskClass\"\n >\n </kendo-gantt-task>\n </ng-template>\n </td>\n </tr>\n "
|
|
73
|
+
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 [index]=\"index\"\n >\n </kendo-gantt-milestone-task>\n <ng-template #task>\n <kendo-gantt-summary-task\n *ngIf=\"hasChildren(item)\"\n [dataItem]=\"item\"\n [template]=\"summaryTaskTemplate\"\n [activeView]=\"activeView\"\n [taskClass]=\"taskClass\"\n [isSelected]=\"isTaskSelected\"\n [index]=\"index\"\n >\n </kendo-gantt-summary-task>\n <kendo-gantt-task\n *ngIf=\"!hasChildren(item)\"\n [dataItem]=\"item\"\n [taskContentTemplate]=\"taskContentTemplate\"\n [taskTemplate]=\"taskTemplate\"\n [activeView]=\"activeView\"\n [taskClass]=\"taskClass\"\n [isSelected]=\"isTaskSelected\"\n [index]=\"index\"\n >\n </kendo-gantt-task>\n </ng-template>\n </td>\n </tr>\n "
|
|
70
74
|
}),
|
|
71
75
|
tslib_1.__metadata("design:paramtypes", [DependencyDomService,
|
|
72
76
|
MappingService])
|
|
@@ -0,0 +1,141 @@
|
|
|
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 { Directive, Input, Output, EventEmitter } from '@angular/core';
|
|
7
|
+
import { getter } from '@progress/kendo-common';
|
|
8
|
+
import { GanttComponent } from '../gantt.component';
|
|
9
|
+
import { isPresent, isString } from '../utils';
|
|
10
|
+
/**
|
|
11
|
+
* A directive which handles the [`selectionChange`]({% slug api_gantt_ganttcomponent %}#toc-selectionchange) event of the Gantt
|
|
12
|
+
* ([see example]({% slug selection_gantt %}#toc-built-in-directive))
|
|
13
|
+
*/
|
|
14
|
+
var SelectableDirective = /** @class */ (function () {
|
|
15
|
+
function SelectableDirective(gantt) {
|
|
16
|
+
this.gantt = gantt;
|
|
17
|
+
/**
|
|
18
|
+
* Fires when the selected keys are changed.
|
|
19
|
+
*/
|
|
20
|
+
this.selectedKeysChange = new EventEmitter();
|
|
21
|
+
this.state = new Set();
|
|
22
|
+
this.isSelected = this.isSelected.bind(this);
|
|
23
|
+
this.selectionChange = this.selectionChange.bind(this);
|
|
24
|
+
this.selectable = true;
|
|
25
|
+
}
|
|
26
|
+
Object.defineProperty(SelectableDirective.prototype, "selectable", {
|
|
27
|
+
/**
|
|
28
|
+
* @hidden
|
|
29
|
+
*/
|
|
30
|
+
set: function (value) {
|
|
31
|
+
if (value) {
|
|
32
|
+
this.gantt.isSelected = this.isSelected;
|
|
33
|
+
this.subscribeSelection();
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
this.gantt.isSelected = function () { return false; };
|
|
37
|
+
this.unsubscribeSelection();
|
|
38
|
+
}
|
|
39
|
+
this.gantt.selectable = value;
|
|
40
|
+
this.gantt.updateView();
|
|
41
|
+
},
|
|
42
|
+
enumerable: true,
|
|
43
|
+
configurable: true
|
|
44
|
+
});
|
|
45
|
+
Object.defineProperty(SelectableDirective.prototype, "selectedKeys", {
|
|
46
|
+
/**
|
|
47
|
+
* Sets the selected keys.
|
|
48
|
+
*/
|
|
49
|
+
set: function (value) {
|
|
50
|
+
if (isPresent(value) && value === this.lastChange) {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
// prevent multiple items displayed as selected as multiple selection still not supported fully
|
|
54
|
+
var keys = (value || []).slice(0, 1);
|
|
55
|
+
this.state = new Set(keys);
|
|
56
|
+
this.gantt.updateView();
|
|
57
|
+
},
|
|
58
|
+
enumerable: true,
|
|
59
|
+
configurable: true
|
|
60
|
+
});
|
|
61
|
+
Object.defineProperty(SelectableDirective.prototype, "itemKey", {
|
|
62
|
+
/**
|
|
63
|
+
* The field name or a function that specifies the data item unique key identifier.
|
|
64
|
+
* By default, the string field `id` is used.
|
|
65
|
+
*/
|
|
66
|
+
set: function (value) {
|
|
67
|
+
if (isString(value)) {
|
|
68
|
+
this._keyGetter = getter(value);
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
this._keyGetter = value;
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
enumerable: true,
|
|
75
|
+
configurable: true
|
|
76
|
+
});
|
|
77
|
+
Object.defineProperty(SelectableDirective.prototype, "keyGetter", {
|
|
78
|
+
get: function () {
|
|
79
|
+
return this._keyGetter || this.gantt.idGetter;
|
|
80
|
+
},
|
|
81
|
+
enumerable: true,
|
|
82
|
+
configurable: true
|
|
83
|
+
});
|
|
84
|
+
SelectableDirective.prototype.ngOnDestroy = function () {
|
|
85
|
+
this.unsubscribeSelection();
|
|
86
|
+
};
|
|
87
|
+
SelectableDirective.prototype.isSelected = function (dataItem) {
|
|
88
|
+
return this.state.has(this.keyGetter(dataItem));
|
|
89
|
+
};
|
|
90
|
+
SelectableDirective.prototype.selectionChange = function (_a) {
|
|
91
|
+
var _this = this;
|
|
92
|
+
var action = _a.action, items = _a.items;
|
|
93
|
+
this.state.clear();
|
|
94
|
+
if (action === 'select') {
|
|
95
|
+
items.forEach(function (item) { return _this.state.add(_this.keyGetter(item)); });
|
|
96
|
+
}
|
|
97
|
+
this.emitSelectedItemsChange();
|
|
98
|
+
};
|
|
99
|
+
SelectableDirective.prototype.emitSelectedItemsChange = function () {
|
|
100
|
+
this.lastChange = Array.from(this.state);
|
|
101
|
+
this.selectedKeysChange.emit(this.lastChange);
|
|
102
|
+
};
|
|
103
|
+
SelectableDirective.prototype.subscribeSelection = function () {
|
|
104
|
+
this.unsubscribeSelection();
|
|
105
|
+
this.selectionSubscription = this.gantt.selectionChange.subscribe(this.selectionChange);
|
|
106
|
+
};
|
|
107
|
+
SelectableDirective.prototype.unsubscribeSelection = function () {
|
|
108
|
+
if (this.selectionSubscription) {
|
|
109
|
+
this.selectionSubscription.unsubscribe();
|
|
110
|
+
this.selectionSubscription = null;
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
tslib_1.__decorate([
|
|
114
|
+
Input(),
|
|
115
|
+
tslib_1.__metadata("design:type", Boolean),
|
|
116
|
+
tslib_1.__metadata("design:paramtypes", [Boolean])
|
|
117
|
+
], SelectableDirective.prototype, "selectable", null);
|
|
118
|
+
tslib_1.__decorate([
|
|
119
|
+
Input(),
|
|
120
|
+
tslib_1.__metadata("design:type", Array),
|
|
121
|
+
tslib_1.__metadata("design:paramtypes", [Array])
|
|
122
|
+
], SelectableDirective.prototype, "selectedKeys", null);
|
|
123
|
+
tslib_1.__decorate([
|
|
124
|
+
Output(),
|
|
125
|
+
tslib_1.__metadata("design:type", EventEmitter)
|
|
126
|
+
], SelectableDirective.prototype, "selectedKeysChange", void 0);
|
|
127
|
+
tslib_1.__decorate([
|
|
128
|
+
Input(),
|
|
129
|
+
tslib_1.__metadata("design:type", Object),
|
|
130
|
+
tslib_1.__metadata("design:paramtypes", [Object])
|
|
131
|
+
], SelectableDirective.prototype, "itemKey", null);
|
|
132
|
+
SelectableDirective = tslib_1.__decorate([
|
|
133
|
+
Directive({
|
|
134
|
+
exportAs: 'kendoGanttSelectable',
|
|
135
|
+
selector: '[kendoGanttSelectable]'
|
|
136
|
+
}),
|
|
137
|
+
tslib_1.__metadata("design:paramtypes", [GanttComponent])
|
|
138
|
+
], SelectableDirective);
|
|
139
|
+
return SelectableDirective;
|
|
140
|
+
}());
|
|
141
|
+
export { SelectableDirective };
|
|
@@ -0,0 +1,4 @@
|
|
|
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
|
+
*-------------------------------------------------------------------------------------------*/
|
|
@@ -103,6 +103,10 @@ var GanttTimelineComponent = /** @class */ (function () {
|
|
|
103
103
|
Input(),
|
|
104
104
|
tslib_1.__metadata("design:type", Function)
|
|
105
105
|
], GanttTimelineComponent.prototype, "taskClass", void 0);
|
|
106
|
+
tslib_1.__decorate([
|
|
107
|
+
Input(),
|
|
108
|
+
tslib_1.__metadata("design:type", Function)
|
|
109
|
+
], GanttTimelineComponent.prototype, "isTaskSelected", void 0);
|
|
106
110
|
tslib_1.__decorate([
|
|
107
111
|
Input(),
|
|
108
112
|
tslib_1.__metadata("design:type", Function)
|
|
@@ -114,7 +118,7 @@ var GanttTimelineComponent = /** @class */ (function () {
|
|
|
114
118
|
GanttTimelineComponent = tslib_1.__decorate([
|
|
115
119
|
Component({
|
|
116
120
|
selector: 'kendo-gantt-timeline',
|
|
117
|
-
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 #timelineContent class=\"k-grid-content\">\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 [hasChildren]=\"hasChildren\"\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 </svg>\n </div>\n </div>\n "
|
|
121
|
+
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 #timelineContent class=\"k-grid-content\">\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 [hasChildren]=\"hasChildren\"\n [isTaskSelected]=\"isTaskSelected\"\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 </svg>\n </div>\n </div>\n "
|
|
118
122
|
}),
|
|
119
123
|
tslib_1.__metadata("design:paramtypes", [ScrollSyncService,
|
|
120
124
|
DependencyDomService,
|
|
@@ -4,11 +4,13 @@
|
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
5
|
import * as tslib_1 from "tslib";
|
|
6
6
|
import { Component, EventEmitter, Input, Output, HostBinding } from '@angular/core';
|
|
7
|
+
import { LocalizationService } from '@progress/kendo-angular-l10n';
|
|
7
8
|
/**
|
|
8
9
|
* The Gantt ViewSelector component. Shows the currently active view type, and allows switching to another view type.
|
|
9
10
|
*/
|
|
10
11
|
var ViewSelectorComponent = /** @class */ (function () {
|
|
11
|
-
function ViewSelectorComponent() {
|
|
12
|
+
function ViewSelectorComponent(localizationService) {
|
|
13
|
+
this.localizationService = localizationService;
|
|
12
14
|
this.hostClass = true;
|
|
13
15
|
/**
|
|
14
16
|
* The currently active view type.
|
|
@@ -32,7 +34,7 @@ var ViewSelectorComponent = /** @class */ (function () {
|
|
|
32
34
|
* @hidden
|
|
33
35
|
*/
|
|
34
36
|
ViewSelectorComponent.prototype.getViewTypeText = function (viewType) {
|
|
35
|
-
return
|
|
37
|
+
return this.localizationService.get(viewType + "ViewText");
|
|
36
38
|
};
|
|
37
39
|
tslib_1.__decorate([
|
|
38
40
|
HostBinding('class.k-gantt-views-wrapper'),
|
|
@@ -53,8 +55,9 @@ var ViewSelectorComponent = /** @class */ (function () {
|
|
|
53
55
|
ViewSelectorComponent = tslib_1.__decorate([
|
|
54
56
|
Component({
|
|
55
57
|
selector: 'kendo-gantt-view-selector',
|
|
56
|
-
template: "\n <select class=\"k-dropdown k-views-dropdown\"
|
|
57
|
-
})
|
|
58
|
+
template: "\n <select class=\"k-dropdown k-views-dropdown\"\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 [selected]=\"view === activeView\"\n (click)=\"onClick(view)\">{{getViewTypeText(view)}}</button>\n </kendo-buttongroup>\n "
|
|
59
|
+
}),
|
|
60
|
+
tslib_1.__metadata("design:paramtypes", [LocalizationService])
|
|
58
61
|
], ViewSelectorComponent);
|
|
59
62
|
return ViewSelectorComponent;
|
|
60
63
|
}());
|
package/dist/es/utils.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
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 { isDocumentAvailable } from '@progress/kendo-angular-common';
|
|
5
|
+
import { isDocumentAvailable, closestInScope, matchesClasses } from '@progress/kendo-angular-common';
|
|
6
6
|
import { addDays, addWeeks, cloneDate, firstDayInWeek } from '@progress/kendo-date-math';
|
|
7
7
|
/**
|
|
8
8
|
* @hidden
|
|
@@ -106,3 +106,50 @@ export var isColumnGroup = function (column) { return column.isColumnGroup; };
|
|
|
106
106
|
* @hidden
|
|
107
107
|
*/
|
|
108
108
|
export var isNumber = function (contender) { return typeof contender === 'number' && !isNaN(contender); };
|
|
109
|
+
/**
|
|
110
|
+
* @hidden
|
|
111
|
+
*/
|
|
112
|
+
export var isString = function (contender) { return typeof contender === 'string'; };
|
|
113
|
+
/**
|
|
114
|
+
* @hidden
|
|
115
|
+
*
|
|
116
|
+
* Gets the closest timeline task element from an event target.
|
|
117
|
+
* Restricts the search up to the provided gantt element from the second param.
|
|
118
|
+
*/
|
|
119
|
+
export var getClosestTask = function (element, gantt) {
|
|
120
|
+
return closestInScope(element, matchesClasses('k-task'), gantt);
|
|
121
|
+
};
|
|
122
|
+
/**
|
|
123
|
+
* @hidden
|
|
124
|
+
*
|
|
125
|
+
* Gets the closest timeline task element index from an event target.
|
|
126
|
+
* Uses the `data-task-index` attribute assigned to each task.
|
|
127
|
+
* Restricts the search up to the provided gantt element from the second param.
|
|
128
|
+
*/
|
|
129
|
+
export var getClosestTaskIndex = function (element, gantt) {
|
|
130
|
+
var task = closestInScope(element, matchesClasses('k-task'), gantt);
|
|
131
|
+
if (!isPresent(task)) {
|
|
132
|
+
return null;
|
|
133
|
+
}
|
|
134
|
+
return Number(task.getAttribute('data-task-index'));
|
|
135
|
+
};
|
|
136
|
+
/**
|
|
137
|
+
* @hidden
|
|
138
|
+
*
|
|
139
|
+
* Checks whether the queried item or its parent items has a `k-task` selector.
|
|
140
|
+
* Restricts the search up to the provided gantt element from the second param.
|
|
141
|
+
*/
|
|
142
|
+
export var isTask = function (contender, gantt) {
|
|
143
|
+
var task = closestInScope(contender, matchesClasses('k-task'), gantt);
|
|
144
|
+
return isPresent(task);
|
|
145
|
+
};
|
|
146
|
+
/**
|
|
147
|
+
* @hidden
|
|
148
|
+
*
|
|
149
|
+
* Checks whether the queried item or its parent items has a `k-task-actions` selector - used for the clear button.
|
|
150
|
+
* Restricts the search up to the provided gantt element from the second param.
|
|
151
|
+
*/
|
|
152
|
+
export var isClearButton = function (contender, gantt) {
|
|
153
|
+
var clearButtonContainer = closestInScope(contender, matchesClasses('k-task-actions'), gantt);
|
|
154
|
+
return isPresent(clearButtonContainer);
|
|
155
|
+
};
|
|
@@ -13,12 +13,14 @@ import { FilterMenuTemplateDirective } from './filter-menu-template.directive';
|
|
|
13
13
|
import { FooterTemplateDirective } from './footer-template.directive';
|
|
14
14
|
import { HeaderTemplateDirective } from './header-template.directive';
|
|
15
15
|
import { CellContentType } from '../models/cell-content-type.interface';
|
|
16
|
+
import { EditTemplateDirective } from './edit-template.directive';
|
|
16
17
|
export declare class GanttColumnComponent extends ColumnComponent {
|
|
17
18
|
private options;
|
|
18
19
|
headerTemplates: QueryList<HeaderTemplateDirective>;
|
|
19
20
|
footerTemplate: FooterTemplateDirective;
|
|
20
21
|
columnMenuTemplates: QueryList<ColumnMenuTemplateDirective>;
|
|
21
22
|
template: CellTemplateDirective;
|
|
23
|
+
editTemplate: EditTemplateDirective;
|
|
22
24
|
filterCellTemplate: FilterCellTemplateDirective;
|
|
23
25
|
filterMenuTemplate: FilterMenuTemplateDirective;
|
|
24
26
|
/**
|
|
@@ -14,6 +14,7 @@ import { FilterCellTemplateDirective } from './filter-cell-template.directive';
|
|
|
14
14
|
import { FilterMenuTemplateDirective } from './filter-menu-template.directive';
|
|
15
15
|
import { FooterTemplateDirective } from './footer-template.directive';
|
|
16
16
|
import { HeaderTemplateDirective } from './header-template.directive';
|
|
17
|
+
import { EditTemplateDirective } from './edit-template.directive';
|
|
17
18
|
let GanttColumnComponent = GanttColumnComponent_1 = class GanttColumnComponent extends ColumnComponent {
|
|
18
19
|
constructor(options, parent) {
|
|
19
20
|
super(parent);
|
|
@@ -68,6 +69,10 @@ tslib_1.__decorate([
|
|
|
68
69
|
ContentChild(CellTemplateDirective, { static: false }),
|
|
69
70
|
tslib_1.__metadata("design:type", CellTemplateDirective)
|
|
70
71
|
], GanttColumnComponent.prototype, "template", void 0);
|
|
72
|
+
tslib_1.__decorate([
|
|
73
|
+
ContentChild(EditTemplateDirective, { static: false }),
|
|
74
|
+
tslib_1.__metadata("design:type", EditTemplateDirective)
|
|
75
|
+
], GanttColumnComponent.prototype, "editTemplate", void 0);
|
|
71
76
|
tslib_1.__decorate([
|
|
72
77
|
ContentChild(FilterCellTemplateDirective, { static: false }),
|
|
73
78
|
tslib_1.__metadata("design:type", FilterCellTemplateDirective)
|
|
@@ -12,3 +12,4 @@ export { FooterTemplateDirective } from './footer-template.directive';
|
|
|
12
12
|
export { ColumnMenuTemplateDirective } from './column-menu-template.directive';
|
|
13
13
|
export { FilterCellTemplateDirective } from './filter-cell-template.directive';
|
|
14
14
|
export { FilterMenuTemplateDirective } from './filter-menu-template.directive';
|
|
15
|
+
export { EditTemplateDirective } from './edit-template.directive';
|
|
@@ -12,3 +12,4 @@ export { FooterTemplateDirective } from './footer-template.directive';
|
|
|
12
12
|
export { ColumnMenuTemplateDirective } from './column-menu-template.directive';
|
|
13
13
|
export { FilterCellTemplateDirective } from './filter-cell-template.directive';
|
|
14
14
|
export { FilterMenuTemplateDirective } from './filter-menu-template.directive';
|
|
15
|
+
export { EditTemplateDirective } from './edit-template.directive';
|
|
@@ -0,0 +1,23 @@
|
|
|
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 { TemplateRef } from '@angular/core';
|
|
6
|
+
/**
|
|
7
|
+
* Represents the column edit-cell template of the Gantt.
|
|
8
|
+
* Helps to customize the content of the edited cells. To define the cell template, nest an `<ng-template>`
|
|
9
|
+
* tag with the `kendoGanttEditTemplate` directive inside a `<kendo-gantt-column>` tag.
|
|
10
|
+
*
|
|
11
|
+
* The template context contains the following fields:
|
|
12
|
+
* - `column`—The current column instance.
|
|
13
|
+
* - `dataItem`—The current data item.
|
|
14
|
+
* - `cellContext`—An object used to pass context information to built-in directives.
|
|
15
|
+
* - `formGroup`—The current [`FormGroup`]({{ site.data.urls.angular['formgroupapi'] }}).
|
|
16
|
+
* If you use the Gantt inside [Template-Driven Forms]({{ site.data.urls.angular['forms'] }}), it will be `undefined`.
|
|
17
|
+
* - `isNew`—The state of the current item.
|
|
18
|
+
* - `rowIndex`—The current row index. If inside a new item row, `rowIndex` is `-1`.
|
|
19
|
+
*/
|
|
20
|
+
export declare class EditTemplateDirective {
|
|
21
|
+
templateRef: TemplateRef<any>;
|
|
22
|
+
constructor(templateRef: TemplateRef<any>);
|
|
23
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
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 { Directive, TemplateRef, Optional } from '@angular/core';
|
|
7
|
+
/**
|
|
8
|
+
* Represents the column edit-cell template of the Gantt.
|
|
9
|
+
* Helps to customize the content of the edited cells. To define the cell template, nest an `<ng-template>`
|
|
10
|
+
* tag with the `kendoGanttEditTemplate` directive inside a `<kendo-gantt-column>` tag.
|
|
11
|
+
*
|
|
12
|
+
* The template context contains the following fields:
|
|
13
|
+
* - `column`—The current column instance.
|
|
14
|
+
* - `dataItem`—The current data item.
|
|
15
|
+
* - `cellContext`—An object used to pass context information to built-in directives.
|
|
16
|
+
* - `formGroup`—The current [`FormGroup`]({{ site.data.urls.angular['formgroupapi'] }}).
|
|
17
|
+
* If you use the Gantt inside [Template-Driven Forms]({{ site.data.urls.angular['forms'] }}), it will be `undefined`.
|
|
18
|
+
* - `isNew`—The state of the current item.
|
|
19
|
+
* - `rowIndex`—The current row index. If inside a new item row, `rowIndex` is `-1`.
|
|
20
|
+
*/
|
|
21
|
+
let EditTemplateDirective = class EditTemplateDirective {
|
|
22
|
+
constructor(templateRef) {
|
|
23
|
+
this.templateRef = templateRef;
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
EditTemplateDirective = tslib_1.__decorate([
|
|
27
|
+
Directive({
|
|
28
|
+
selector: '[kendoGanttEditTemplate]'
|
|
29
|
+
}),
|
|
30
|
+
tslib_1.__param(0, Optional()),
|
|
31
|
+
tslib_1.__metadata("design:paramtypes", [TemplateRef])
|
|
32
|
+
], EditTemplateDirective);
|
|
33
|
+
export { EditTemplateDirective };
|
|
@@ -8,6 +8,7 @@ import { OptionChangesService } from '../common/option-changes.service';
|
|
|
8
8
|
import { CellTemplateDirective } from './cell-template.directive';
|
|
9
9
|
import { GanttColumnBase } from './column-base';
|
|
10
10
|
import { GanttColumnComponent } from './column.component';
|
|
11
|
+
import { EditTemplateDirective } from './edit-template.directive';
|
|
11
12
|
export declare class GanttSpanColumnComponent extends SpanColumnComponent {
|
|
12
13
|
private options;
|
|
13
14
|
/**
|
|
@@ -15,6 +16,7 @@ export declare class GanttSpanColumnComponent extends SpanColumnComponent {
|
|
|
15
16
|
*/
|
|
16
17
|
childColumns: QueryList<GanttColumnComponent>;
|
|
17
18
|
template: QueryList<CellTemplateDirective>;
|
|
19
|
+
editTemplate: QueryList<EditTemplateDirective>;
|
|
18
20
|
/**
|
|
19
21
|
* Toggles the locked (frozen) state of the columns. Locked columns are visible
|
|
20
22
|
* at all times during the horizontal scrolling of the Gantt.
|
|
@@ -10,6 +10,7 @@ import { OptionChangesService } from '../common/option-changes.service';
|
|
|
10
10
|
import { CellTemplateDirective } from './cell-template.directive';
|
|
11
11
|
import { GanttColumnBase } from './column-base';
|
|
12
12
|
import { GanttColumnComponent } from './column.component';
|
|
13
|
+
import { EditTemplateDirective } from './edit-template.directive';
|
|
13
14
|
let GanttSpanColumnComponent = GanttSpanColumnComponent_1 = class GanttSpanColumnComponent extends SpanColumnComponent {
|
|
14
15
|
constructor(options, parent) {
|
|
15
16
|
super(parent);
|
|
@@ -19,6 +20,7 @@ let GanttSpanColumnComponent = GanttSpanColumnComponent_1 = class GanttSpanColum
|
|
|
19
20
|
*/
|
|
20
21
|
this.childColumns = new QueryList();
|
|
21
22
|
this.template = new QueryList();
|
|
23
|
+
this.editTemplate = new QueryList();
|
|
22
24
|
}
|
|
23
25
|
ngOnChanges() {
|
|
24
26
|
this.options.notifyColumnChanges();
|
|
@@ -32,6 +34,10 @@ tslib_1.__decorate([
|
|
|
32
34
|
ContentChildren(CellTemplateDirective, { descendants: false }),
|
|
33
35
|
tslib_1.__metadata("design:type", QueryList)
|
|
34
36
|
], GanttSpanColumnComponent.prototype, "template", void 0);
|
|
37
|
+
tslib_1.__decorate([
|
|
38
|
+
ContentChildren(EditTemplateDirective, { descendants: false }),
|
|
39
|
+
tslib_1.__metadata("design:type", QueryList)
|
|
40
|
+
], GanttSpanColumnComponent.prototype, "editTemplate", void 0);
|
|
35
41
|
tslib_1.__decorate([
|
|
36
42
|
Input(),
|
|
37
43
|
tslib_1.__metadata("design:type", Boolean)
|
|
@@ -0,0 +1,21 @@
|
|
|
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 { FormGroup } from '@angular/forms';
|
|
6
|
+
import { LocalizationService } from '@progress/kendo-angular-l10n';
|
|
7
|
+
import { MappingService } from '../common/mapping.service';
|
|
8
|
+
import { EditService } from './edit.service';
|
|
9
|
+
/**
|
|
10
|
+
* @hidden
|
|
11
|
+
*/
|
|
12
|
+
export declare class EditDialogComponent {
|
|
13
|
+
mapper: MappingService;
|
|
14
|
+
editService: EditService;
|
|
15
|
+
private localizationService;
|
|
16
|
+
formGroup: FormGroup;
|
|
17
|
+
constructor(mapper: MappingService, editService: EditService, localizationService: LocalizationService);
|
|
18
|
+
getText(token: string): string;
|
|
19
|
+
handleEditingResult(editResultType: 'save' | 'cancel'): void;
|
|
20
|
+
onTaskDelete(): void;
|
|
21
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
import * as tslib_1 from "tslib";
|
|
6
|
+
import { Component, Input } from '@angular/core';
|
|
7
|
+
import { FormGroup } from '@angular/forms';
|
|
8
|
+
import { LocalizationService } from '@progress/kendo-angular-l10n';
|
|
9
|
+
import { MappingService } from '../common/mapping.service';
|
|
10
|
+
import { EditService } from './edit.service';
|
|
11
|
+
/**
|
|
12
|
+
* @hidden
|
|
13
|
+
*/
|
|
14
|
+
let EditDialogComponent = class EditDialogComponent {
|
|
15
|
+
constructor(mapper, editService, localizationService) {
|
|
16
|
+
this.mapper = mapper;
|
|
17
|
+
this.editService = editService;
|
|
18
|
+
this.localizationService = localizationService;
|
|
19
|
+
}
|
|
20
|
+
getText(token) {
|
|
21
|
+
return this.localizationService.get(token);
|
|
22
|
+
}
|
|
23
|
+
handleEditingResult(editResultType) {
|
|
24
|
+
this.editService.triggerEditEvent(editResultType);
|
|
25
|
+
}
|
|
26
|
+
onTaskDelete() {
|
|
27
|
+
this.editService.showConfirmationDialog.next();
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
tslib_1.__decorate([
|
|
31
|
+
Input(),
|
|
32
|
+
tslib_1.__metadata("design:type", FormGroup)
|
|
33
|
+
], EditDialogComponent.prototype, "formGroup", void 0);
|
|
34
|
+
EditDialogComponent = tslib_1.__decorate([
|
|
35
|
+
Component({
|
|
36
|
+
selector: 'kendo-gantt-edit-dialog',
|
|
37
|
+
template: `
|
|
38
|
+
<kendo-dialog
|
|
39
|
+
[title]="getText('taskEditingDialogTitle')"
|
|
40
|
+
[width]="575"
|
|
41
|
+
[height]="470"
|
|
42
|
+
(close)="handleEditingResult('cancel')">
|
|
43
|
+
<kendo-dialog-messages
|
|
44
|
+
[closeTitle]="getText('taskEditingDialogCloseTitle')"></kendo-dialog-messages>
|
|
45
|
+
<form class="k-form" [formGroup]="formGroup">
|
|
46
|
+
<kendo-formfield *ngIf="formGroup.contains(mapper.taskFields.title)">
|
|
47
|
+
<kendo-label [for]="mapper.taskFields.title" [text]="getText('titleFieldInputLabel')"></kendo-label>
|
|
48
|
+
<input class="k-textbox" [formControlName]="mapper.taskFields.title" />
|
|
49
|
+
</kendo-formfield>
|
|
50
|
+
<div class="k-hstack">
|
|
51
|
+
<kendo-formfield [style.width.%]="49" *ngIf="formGroup.contains(mapper.taskFields.start)">
|
|
52
|
+
<kendo-label [for]="mapper.taskFields.start" [text]="getText('startFieldInputLabel')"></kendo-label>
|
|
53
|
+
<kendo-datetimepicker [formControlName]="mapper.taskFields.start"></kendo-datetimepicker>
|
|
54
|
+
</kendo-formfield>
|
|
55
|
+
<kendo-treelist-spacer></kendo-treelist-spacer>
|
|
56
|
+
<kendo-formfield [style.width.%]="49" *ngIf="formGroup.contains(mapper.taskFields.end)">
|
|
57
|
+
<kendo-label [for]="mapper.taskFields.end" [text]="getText('endFieldInputLabel')"></kendo-label>
|
|
58
|
+
<kendo-datetimepicker [formControlName]="mapper.taskFields.end"></kendo-datetimepicker>
|
|
59
|
+
</kendo-formfield>
|
|
60
|
+
</div>
|
|
61
|
+
<kendo-formfield [style.width.%]="49" *ngIf="formGroup.contains(mapper.taskFields.completionRatio)">
|
|
62
|
+
<kendo-label [for]="mapper.taskFields.completionRatio" [text]="getText('completionRatioFieldInputLabel')"></kendo-label>
|
|
63
|
+
<kendo-numerictextbox
|
|
64
|
+
[formControlName]="mapper.taskFields.completionRatio"
|
|
65
|
+
[min]="0"
|
|
66
|
+
[max]="1"
|
|
67
|
+
[decimals]="2"
|
|
68
|
+
format="p2"
|
|
69
|
+
[step]="0.01"
|
|
70
|
+
></kendo-numerictextbox>
|
|
71
|
+
</kendo-formfield>
|
|
72
|
+
</form>
|
|
73
|
+
<kendo-dialog-actions layout="normal">
|
|
74
|
+
<button kendoButton (click)="onTaskDelete()">{{ getText('deleteButtonText') }}</button>
|
|
75
|
+
<kendo-treelist-spacer></kendo-treelist-spacer>
|
|
76
|
+
<button kendoButton [primary]="true" (click)="handleEditingResult('save')">{{ getText('saveButtonText') }}</button>
|
|
77
|
+
<button kendoButton (click)="handleEditingResult('cancel')">{{ getText('cancelButtonText') }}</button>
|
|
78
|
+
</kendo-dialog-actions>
|
|
79
|
+
</kendo-dialog>
|
|
80
|
+
`
|
|
81
|
+
}),
|
|
82
|
+
tslib_1.__metadata("design:paramtypes", [MappingService,
|
|
83
|
+
EditService,
|
|
84
|
+
LocalizationService])
|
|
85
|
+
], EditDialogComponent);
|
|
86
|
+
export { EditDialogComponent };
|