@progress/kendo-angular-gantt 0.2.1-dev.202112091019 → 0.3.0-dev.202201111723
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 +10 -4
- package/dist/es/dependencies/utils.js +6 -5
- package/dist/es/editing/add-task.component.js +94 -0
- package/dist/es/editing/dependencies-table.component.js +131 -0
- package/dist/es/editing/edit-dialog.component.js +37 -6
- package/dist/es/editing/edit.service.js +89 -7
- package/dist/es/editing/task-fields.component.js +43 -0
- package/dist/es/expanded-state/expandable.directive.js +4 -6
- package/dist/es/gantt.component.js +116 -45
- package/dist/es/gantt.module.js +13 -4
- package/dist/es/index.js +5 -1
- package/dist/es/localization/gantt-localization.service.js +26 -0
- package/dist/es/localization/messages.js +45 -1
- package/dist/es/models/dependency-type.enum.js +16 -0
- package/dist/es/models/events/{add-event.interface.js → task-add-event.interface.js} +0 -0
- package/dist/es/models/models.js +2 -0
- package/dist/es/models/{events/edit-event.interface.js → toolbar-settings.js} +0 -0
- package/dist/es/package-metadata.js +1 -1
- package/dist/es/timeline/timeline-base-view.service.js +12 -3
- package/dist/es/toolbar/toolbar.component.js +9 -1
- package/dist/es2015/dependencies/utils.js +6 -5
- package/dist/es2015/editing/add-task.component.d.ts +45 -0
- package/dist/es2015/editing/add-task.component.js +102 -0
- package/dist/es2015/editing/dependencies-table.component.d.ts +39 -0
- package/dist/es2015/editing/dependencies-table.component.js +160 -0
- package/dist/es2015/editing/edit-dialog.component.d.ts +10 -3
- package/dist/es2015/editing/edit-dialog.component.js +55 -33
- package/dist/es2015/editing/edit.service.d.ts +24 -3
- package/dist/es2015/editing/edit.service.js +78 -10
- package/dist/es2015/editing/task-fields.component.d.ts +22 -0
- package/dist/es2015/editing/task-fields.component.js +67 -0
- package/dist/es2015/expanded-state/expandable.directive.d.ts +1 -2
- package/dist/es2015/expanded-state/expandable.directive.js +2 -7
- package/dist/es2015/gantt.component.d.ts +29 -18
- package/dist/es2015/gantt.component.js +183 -43
- package/dist/es2015/gantt.module.js +13 -4
- package/dist/es2015/index.d.ts +5 -1
- package/dist/es2015/index.js +5 -1
- package/dist/es2015/index.metadata.json +1 -1
- package/dist/es2015/localization/{treelist-messages.directive.d.ts → gantt-localization.service.d.ts} +4 -3
- package/dist/es2015/localization/gantt-localization.service.js +25 -0
- package/dist/es2015/localization/messages.d.ts +46 -2
- package/dist/es2015/localization/messages.js +45 -1
- package/dist/es2015/models/dependency-type.enum.d.ts +1 -1
- package/dist/es2015/models/dependency-type.enum.js +16 -0
- package/dist/es2015/models/events/cell-close-event.interface.d.ts +1 -1
- package/dist/es2015/models/events/task-add-event.interface.d.ts +31 -0
- package/dist/{es/models/events/remove-event.interface.js → es2015/models/events/task-add-event.interface.js} +0 -0
- package/dist/es2015/models/events/task-edit-event.interface.d.ts +15 -2
- package/dist/es2015/models/models.d.ts +5 -3
- package/dist/es2015/models/models.js +2 -0
- package/dist/es2015/models/toolbar-settings.d.ts +29 -0
- package/dist/{es/models/toolbar-position.js → es2015/models/toolbar-settings.js} +0 -0
- package/dist/es2015/package-metadata.js +1 -1
- package/dist/es2015/timeline/timeline-base-view.service.d.ts +12 -0
- package/dist/es2015/timeline/timeline-base-view.service.js +12 -3
- package/dist/es2015/toolbar/toolbar-template.directive.d.ts +1 -1
- package/dist/es2015/toolbar/toolbar.component.d.ts +2 -0
- package/dist/es2015/toolbar/toolbar.component.js +10 -0
- package/dist/fesm2015/index.js +757 -115
- package/dist/fesm5/index.js +627 -88
- package/dist/npm/dependencies/utils.js +6 -5
- package/dist/npm/editing/add-task.component.js +96 -0
- package/dist/npm/editing/dependencies-table.component.js +133 -0
- package/dist/npm/editing/edit-dialog.component.js +36 -5
- package/dist/npm/editing/edit.service.js +88 -6
- package/dist/npm/editing/task-fields.component.js +45 -0
- package/dist/npm/expanded-state/expandable.directive.js +3 -5
- package/dist/npm/gantt.component.js +116 -45
- package/dist/npm/gantt.module.js +12 -3
- package/dist/npm/index.js +10 -2
- package/dist/npm/localization/gantt-localization.service.js +28 -0
- package/dist/npm/localization/messages.js +45 -1
- package/dist/npm/models/dependency-type.enum.js +16 -0
- package/dist/npm/models/events/{add-event.interface.js → task-add-event.interface.js} +0 -0
- package/dist/npm/models/models.js +4 -0
- package/dist/npm/models/{events/edit-event.interface.js → toolbar-settings.js} +0 -0
- package/dist/npm/package-metadata.js +1 -1
- package/dist/npm/timeline/timeline-base-view.service.js +17 -8
- package/dist/npm/toolbar/toolbar.component.js +9 -1
- package/dist/systemjs/kendo-angular-gantt.js +1 -1
- package/package.json +5 -3
- package/dist/es/localization/treelist-messages.directive.js +0 -31
- package/dist/es2015/localization/treelist-messages.directive.js +0 -29
- package/dist/es2015/models/events/add-event.interface.d.ts +0 -16
- package/dist/es2015/models/events/add-event.interface.js +0 -4
- package/dist/es2015/models/events/edit-event.interface.d.ts +0 -19
- package/dist/es2015/models/events/edit-event.interface.js +0 -4
- package/dist/es2015/models/events/remove-event.interface.d.ts +0 -16
- package/dist/es2015/models/events/remove-event.interface.js +0 -4
- package/dist/es2015/models/toolbar-position.d.ts +0 -9
- package/dist/es2015/models/toolbar-position.js +0 -4
- package/dist/npm/localization/treelist-messages.directive.js +0 -33
- package/dist/npm/models/events/remove-event.interface.js +0 -6
- package/dist/npm/models/toolbar-position.js +0 -6
|
@@ -2,6 +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 { DependencyType } from '../models/dependency-type.enum';
|
|
5
6
|
/**
|
|
6
7
|
* @hidden
|
|
7
8
|
*
|
|
@@ -45,9 +46,9 @@ export const dependencyCoordinates = (from, to, rowHeight, type, minDistanceBefo
|
|
|
45
46
|
| |
|
|
46
47
|
[[[]]]- -[[[]]]
|
|
47
48
|
*/
|
|
48
|
-
if (type ===
|
|
49
|
+
if (type === DependencyType.FF || type === DependencyType.SS) {
|
|
49
50
|
// polyline start from first task
|
|
50
|
-
const dir = type ===
|
|
51
|
+
const dir = type === DependencyType.SS ? 'left' : 'right';
|
|
51
52
|
top = from.top;
|
|
52
53
|
left = from[dir];
|
|
53
54
|
points.push({ top, left });
|
|
@@ -73,9 +74,9 @@ export const dependencyCoordinates = (from, to, rowHeight, type, minDistanceBefo
|
|
|
73
74
|
|
|
|
74
75
|
-[[[]]]
|
|
75
76
|
*/
|
|
76
|
-
const startDir = type ===
|
|
77
|
-
const endDir = type ===
|
|
78
|
-
const additionalTurn = type ===
|
|
77
|
+
const startDir = type === DependencyType.SF ? 'left' : 'right';
|
|
78
|
+
const endDir = type === DependencyType.SF ? 'right' : 'left';
|
|
79
|
+
const additionalTurn = type === DependencyType.SF
|
|
79
80
|
? from[startDir] - minDistanceBeforeTurn * 2 < to[endDir]
|
|
80
81
|
: from[startDir] + minDistanceBeforeTurn * 2 > to[endDir];
|
|
81
82
|
// polyline start from first task
|
|
@@ -0,0 +1,45 @@
|
|
|
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 { NgZone } from '@angular/core';
|
|
6
|
+
import { LocalizationService } from '@progress/kendo-angular-l10n';
|
|
7
|
+
import { PreventableEvent } from '@progress/kendo-angular-treelist';
|
|
8
|
+
import { GanttAddTaskActionItem } from '../models/events/task-add-event.interface';
|
|
9
|
+
import { EditService } from './edit.service';
|
|
10
|
+
/**
|
|
11
|
+
* The UI for adding new items to the Gantt.
|
|
12
|
+
* Use it within a toolbar template to provide a custom icon or list of options.
|
|
13
|
+
*/
|
|
14
|
+
export declare class GanttAddTaskComponent {
|
|
15
|
+
private localizationService;
|
|
16
|
+
private editService;
|
|
17
|
+
private ngZone;
|
|
18
|
+
/**
|
|
19
|
+
* Sets the data of the DropDownButton.
|
|
20
|
+
* > The data has to be provided in an array-like list.
|
|
21
|
+
*/
|
|
22
|
+
data: GanttAddTaskActionItem[];
|
|
23
|
+
/**
|
|
24
|
+
* Defines the name of an existing icon in a Kendo UI theme.
|
|
25
|
+
* @default 'plus'
|
|
26
|
+
*/
|
|
27
|
+
icon: string;
|
|
28
|
+
constructor(localizationService: LocalizationService, editService: EditService, ngZone: NgZone);
|
|
29
|
+
/**
|
|
30
|
+
* @hidden
|
|
31
|
+
*/
|
|
32
|
+
getText(message: string): string;
|
|
33
|
+
/**
|
|
34
|
+
* @hidden
|
|
35
|
+
*/
|
|
36
|
+
handleOpen(e: PreventableEvent): void;
|
|
37
|
+
/**
|
|
38
|
+
* @hidden
|
|
39
|
+
*/
|
|
40
|
+
handleMouseClick(): void;
|
|
41
|
+
/**
|
|
42
|
+
* @hidden
|
|
43
|
+
*/
|
|
44
|
+
handleItemClick(e: any): void;
|
|
45
|
+
}
|
|
@@ -0,0 +1,102 @@
|
|
|
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, NgZone } from '@angular/core';
|
|
7
|
+
import { LocalizationService } from '@progress/kendo-angular-l10n';
|
|
8
|
+
import { EditService } from './edit.service';
|
|
9
|
+
/**
|
|
10
|
+
* The UI for adding new items to the Gantt.
|
|
11
|
+
* Use it within a toolbar template to provide a custom icon or list of options.
|
|
12
|
+
*/
|
|
13
|
+
let GanttAddTaskComponent = class GanttAddTaskComponent {
|
|
14
|
+
constructor(localizationService, editService, ngZone) {
|
|
15
|
+
this.localizationService = localizationService;
|
|
16
|
+
this.editService = editService;
|
|
17
|
+
this.ngZone = ngZone;
|
|
18
|
+
/**
|
|
19
|
+
* Sets the data of the DropDownButton.
|
|
20
|
+
* > The data has to be provided in an array-like list.
|
|
21
|
+
*/
|
|
22
|
+
this.data = [{
|
|
23
|
+
text: this.getText('addChildText'),
|
|
24
|
+
type: 'addChild'
|
|
25
|
+
}, {
|
|
26
|
+
text: this.getText('addAboveText'),
|
|
27
|
+
type: 'addAbove'
|
|
28
|
+
}, {
|
|
29
|
+
text: this.getText('addBelowText'),
|
|
30
|
+
type: 'addBelow'
|
|
31
|
+
}];
|
|
32
|
+
/**
|
|
33
|
+
* Defines the name of an existing icon in a Kendo UI theme.
|
|
34
|
+
* @default 'plus'
|
|
35
|
+
*/
|
|
36
|
+
this.icon = 'plus';
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* @hidden
|
|
40
|
+
*/
|
|
41
|
+
getText(message) {
|
|
42
|
+
return this.localizationService.get(message);
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* @hidden
|
|
46
|
+
*/
|
|
47
|
+
handleOpen(e) {
|
|
48
|
+
if (!this.editService.getSelectedItem()) {
|
|
49
|
+
e.preventDefault();
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* @hidden
|
|
54
|
+
*/
|
|
55
|
+
handleMouseClick() {
|
|
56
|
+
if (!this.editService.getSelectedItem()) {
|
|
57
|
+
this.ngZone.run(() => {
|
|
58
|
+
this.editService.addEvent.next({
|
|
59
|
+
selectedItem: null,
|
|
60
|
+
actionType: 'addTask'
|
|
61
|
+
});
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* @hidden
|
|
67
|
+
*/
|
|
68
|
+
handleItemClick(e) {
|
|
69
|
+
this.editService.addEvent.next({
|
|
70
|
+
actionType: e.type,
|
|
71
|
+
selectedItem: null
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
tslib_1.__decorate([
|
|
76
|
+
Input(),
|
|
77
|
+
tslib_1.__metadata("design:type", Array)
|
|
78
|
+
], GanttAddTaskComponent.prototype, "data", void 0);
|
|
79
|
+
tslib_1.__decorate([
|
|
80
|
+
Input(),
|
|
81
|
+
tslib_1.__metadata("design:type", String)
|
|
82
|
+
], GanttAddTaskComponent.prototype, "icon", void 0);
|
|
83
|
+
GanttAddTaskComponent = tslib_1.__decorate([
|
|
84
|
+
Component({
|
|
85
|
+
selector: 'kendo-gantt-add-task',
|
|
86
|
+
template: `
|
|
87
|
+
<kendo-dropdownbutton
|
|
88
|
+
[data]="data"
|
|
89
|
+
[icon]="icon"
|
|
90
|
+
[kendoEventsOutsideAngular]="{ click: handleMouseClick }"
|
|
91
|
+
[scope]="this"
|
|
92
|
+
(itemClick)="handleItemClick($event)"
|
|
93
|
+
(open)="handleOpen($event)">
|
|
94
|
+
{{ getText('addTaskText') }}
|
|
95
|
+
</kendo-dropdownbutton>
|
|
96
|
+
`
|
|
97
|
+
}),
|
|
98
|
+
tslib_1.__metadata("design:paramtypes", [LocalizationService,
|
|
99
|
+
EditService,
|
|
100
|
+
NgZone])
|
|
101
|
+
], GanttAddTaskComponent);
|
|
102
|
+
export { GanttAddTaskComponent };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
import { EventEmitter } from '@angular/core';
|
|
6
|
+
import { FormArray, FormControl } from '@angular/forms';
|
|
7
|
+
import { MappingService } from '../common/mapping.service';
|
|
8
|
+
import { GanttLocalizationService } from '../localization/gantt-localization.service';
|
|
9
|
+
import { EditService } from './edit.service';
|
|
10
|
+
/**
|
|
11
|
+
* @hidden
|
|
12
|
+
*/
|
|
13
|
+
export declare class DependenciesTableComponent {
|
|
14
|
+
mapper: MappingService;
|
|
15
|
+
editService: EditService;
|
|
16
|
+
private localizationService;
|
|
17
|
+
tasks: any[];
|
|
18
|
+
dependencies: any[];
|
|
19
|
+
dependencyType: 'predecessor' | 'successor';
|
|
20
|
+
dependenciesChange: EventEmitter<any>;
|
|
21
|
+
selectedKeys: any[];
|
|
22
|
+
formGroups: FormArray;
|
|
23
|
+
dependencyTypes: {
|
|
24
|
+
type: string;
|
|
25
|
+
id: number;
|
|
26
|
+
}[];
|
|
27
|
+
readonly taskId: number;
|
|
28
|
+
readonly dependencyIdField: string;
|
|
29
|
+
constructor(mapper: MappingService, editService: EditService, localizationService: GanttLocalizationService);
|
|
30
|
+
ngOnInit(): void;
|
|
31
|
+
getFormControl(dataItemIndex: number, field: string): FormControl;
|
|
32
|
+
getText(token: string): string;
|
|
33
|
+
getDependencyTypes(): {
|
|
34
|
+
type: string;
|
|
35
|
+
id: number;
|
|
36
|
+
}[];
|
|
37
|
+
addHandler(): void;
|
|
38
|
+
removeHandler(): void;
|
|
39
|
+
}
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
import * as tslib_1 from "tslib";
|
|
6
|
+
import { Component, EventEmitter, Input, Output } from '@angular/core';
|
|
7
|
+
import { FormArray, FormControl, FormGroup, Validators } from '@angular/forms';
|
|
8
|
+
import { MappingService } from '../common/mapping.service';
|
|
9
|
+
import { GanttLocalizationService } from '../localization/gantt-localization.service';
|
|
10
|
+
import { DependencyType } from '../models/dependency-type.enum';
|
|
11
|
+
import { EditService } from './edit.service';
|
|
12
|
+
/**
|
|
13
|
+
* @hidden
|
|
14
|
+
*/
|
|
15
|
+
let DependenciesTableComponent = class DependenciesTableComponent {
|
|
16
|
+
constructor(mapper, editService, localizationService) {
|
|
17
|
+
this.mapper = mapper;
|
|
18
|
+
this.editService = editService;
|
|
19
|
+
this.localizationService = localizationService;
|
|
20
|
+
this.dependenciesChange = new EventEmitter();
|
|
21
|
+
this.selectedKeys = [];
|
|
22
|
+
this.formGroups = new FormArray([]);
|
|
23
|
+
this.dependencyTypes = this.getDependencyTypes();
|
|
24
|
+
}
|
|
25
|
+
get taskId() {
|
|
26
|
+
return this.editService.dataItem.id;
|
|
27
|
+
}
|
|
28
|
+
// The target dependency id field
|
|
29
|
+
// e.g. if Predecessors, we have the `fromId` which is the currently edited task,
|
|
30
|
+
// while the `toId` is missing (needs to be selected by the user)
|
|
31
|
+
get dependencyIdField() {
|
|
32
|
+
return this.dependencyType === 'predecessor' ? 'fromId' : 'toId';
|
|
33
|
+
}
|
|
34
|
+
ngOnInit() {
|
|
35
|
+
// generate the FormGroups per each Grid row
|
|
36
|
+
if (this.formGroups.controls.length === 0) {
|
|
37
|
+
const fields = this.mapper.dependencyFields;
|
|
38
|
+
this.dependencies.forEach(item => {
|
|
39
|
+
const formGroup = new FormGroup({
|
|
40
|
+
[fields.id]: new FormControl(this.mapper.extractFromDependency(item, 'id')),
|
|
41
|
+
[fields.fromId]: new FormControl(this.mapper.extractFromDependency(item, 'fromId'), Validators.required),
|
|
42
|
+
[fields.toId]: new FormControl(this.mapper.extractFromDependency(item, 'toId'), Validators.required),
|
|
43
|
+
[fields.type]: new FormControl(this.mapper.extractFromDependency(item, 'type'), Validators.required)
|
|
44
|
+
});
|
|
45
|
+
this.formGroups.push(formGroup);
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
this.formGroups.valueChanges.subscribe(val => {
|
|
49
|
+
this.formGroups.controls.forEach(control => {
|
|
50
|
+
if (control.dirty) {
|
|
51
|
+
this.editService.updateDependencies(control.value);
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
this.dependenciesChange.emit(val);
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
getFormControl(dataItemIndex, field) {
|
|
58
|
+
// return the FormControl for the respective column editor
|
|
59
|
+
return this.formGroups.controls
|
|
60
|
+
.find((_control, index) => index === dataItemIndex)
|
|
61
|
+
.get(this.mapper.dependencyFields[field]);
|
|
62
|
+
}
|
|
63
|
+
getText(token) {
|
|
64
|
+
return this.localizationService.get(token);
|
|
65
|
+
}
|
|
66
|
+
getDependencyTypes() {
|
|
67
|
+
const types = Object.keys(DependencyType)
|
|
68
|
+
.filter(value => typeof DependencyType[value] === 'number')
|
|
69
|
+
.map(type => {
|
|
70
|
+
return {
|
|
71
|
+
type,
|
|
72
|
+
id: DependencyType[type]
|
|
73
|
+
};
|
|
74
|
+
});
|
|
75
|
+
return types;
|
|
76
|
+
}
|
|
77
|
+
addHandler() {
|
|
78
|
+
const fields = this.mapper.dependencyFields;
|
|
79
|
+
const formGroup = new FormGroup({
|
|
80
|
+
[fields.id]: new FormControl(),
|
|
81
|
+
[fields.fromId]: new FormControl(this.dependencyIdField === 'toId' ? this.taskId : null, Validators.required),
|
|
82
|
+
[fields.toId]: new FormControl(this.dependencyIdField === 'fromId' ? this.taskId : null, Validators.required),
|
|
83
|
+
[fields.type]: new FormControl(null, Validators.required)
|
|
84
|
+
});
|
|
85
|
+
this.formGroups.push(formGroup);
|
|
86
|
+
}
|
|
87
|
+
removeHandler() {
|
|
88
|
+
const [selectedIndex] = this.selectedKeys;
|
|
89
|
+
const item = this.formGroups.at(selectedIndex).value;
|
|
90
|
+
this.editService.deleteDependency(item);
|
|
91
|
+
this.formGroups.removeAt(selectedIndex);
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
tslib_1.__decorate([
|
|
95
|
+
Input(),
|
|
96
|
+
tslib_1.__metadata("design:type", Array)
|
|
97
|
+
], DependenciesTableComponent.prototype, "tasks", void 0);
|
|
98
|
+
tslib_1.__decorate([
|
|
99
|
+
Input(),
|
|
100
|
+
tslib_1.__metadata("design:type", Array)
|
|
101
|
+
], DependenciesTableComponent.prototype, "dependencies", void 0);
|
|
102
|
+
tslib_1.__decorate([
|
|
103
|
+
Input(),
|
|
104
|
+
tslib_1.__metadata("design:type", String)
|
|
105
|
+
], DependenciesTableComponent.prototype, "dependencyType", void 0);
|
|
106
|
+
tslib_1.__decorate([
|
|
107
|
+
Output(),
|
|
108
|
+
tslib_1.__metadata("design:type", EventEmitter)
|
|
109
|
+
], DependenciesTableComponent.prototype, "dependenciesChange", void 0);
|
|
110
|
+
DependenciesTableComponent = tslib_1.__decorate([
|
|
111
|
+
Component({
|
|
112
|
+
selector: 'kendo-gantt-dependencies-table',
|
|
113
|
+
template: `
|
|
114
|
+
<kendo-grid
|
|
115
|
+
[data]="dependencies"
|
|
116
|
+
[selectable]="{ mode: 'single' }"
|
|
117
|
+
[(selectedKeys)]="selectedKeys"
|
|
118
|
+
kendoGridSelectBy
|
|
119
|
+
[height]="295"
|
|
120
|
+
>
|
|
121
|
+
<ng-template kendoGridToolbarTemplate>
|
|
122
|
+
<button kendoButton (click)="addHandler()">
|
|
123
|
+
{{ getText('taskEditingDependenciesAddButtonText') }}
|
|
124
|
+
</button>
|
|
125
|
+
<button kendoButton (click)="removeHandler()" [disabled]="selectedKeys.length === 0">
|
|
126
|
+
{{ getText('taskEditingDependenciesRemoveButtonText') }}
|
|
127
|
+
</button>
|
|
128
|
+
</ng-template>
|
|
129
|
+
<kendo-grid-column [title]="getText('taskEditingDependenciesGridNameColumnTitle')" [field]="dependencyIdField">
|
|
130
|
+
<ng-template kendoGridCellTemplate let-dataItem="dataItem" let-column="column" let-rowIndex="rowIndex">
|
|
131
|
+
<kendo-dropdownlist
|
|
132
|
+
[data]="tasks"
|
|
133
|
+
textField="title"
|
|
134
|
+
valueField="id"
|
|
135
|
+
[valuePrimitive]="true"
|
|
136
|
+
[formControl]="getFormControl(rowIndex, column.field)"
|
|
137
|
+
>
|
|
138
|
+
</kendo-dropdownlist>
|
|
139
|
+
</ng-template>
|
|
140
|
+
</kendo-grid-column>
|
|
141
|
+
<kendo-grid-column [title]="getText('taskEditingDependenciesGridTypeColumnTitle')" field="type">
|
|
142
|
+
<ng-template kendoGridCellTemplate let-dataItem="dataItem" let-column="column" let-rowIndex="rowIndex">
|
|
143
|
+
<kendo-dropdownlist
|
|
144
|
+
[data]="dependencyTypes"
|
|
145
|
+
textField="type"
|
|
146
|
+
valueField="id"
|
|
147
|
+
[valuePrimitive]="true"
|
|
148
|
+
[formControl]="getFormControl(rowIndex, column.field)"
|
|
149
|
+
>
|
|
150
|
+
</kendo-dropdownlist>
|
|
151
|
+
</ng-template>
|
|
152
|
+
</kendo-grid-column>
|
|
153
|
+
</kendo-grid>
|
|
154
|
+
`
|
|
155
|
+
}),
|
|
156
|
+
tslib_1.__metadata("design:paramtypes", [MappingService,
|
|
157
|
+
EditService,
|
|
158
|
+
GanttLocalizationService])
|
|
159
|
+
], DependenciesTableComponent);
|
|
160
|
+
export { DependenciesTableComponent };
|
|
@@ -2,9 +2,10 @@
|
|
|
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 {
|
|
5
|
+
import { ChangeDetectorRef } from '@angular/core';
|
|
6
6
|
import { LocalizationService } from '@progress/kendo-angular-l10n';
|
|
7
7
|
import { MappingService } from '../common/mapping.service';
|
|
8
|
+
import { GanttDependency } from '../models/models';
|
|
8
9
|
import { EditService } from './edit.service';
|
|
9
10
|
/**
|
|
10
11
|
* @hidden
|
|
@@ -12,10 +13,16 @@ import { EditService } from './edit.service';
|
|
|
12
13
|
export declare class EditDialogComponent {
|
|
13
14
|
mapper: MappingService;
|
|
14
15
|
editService: EditService;
|
|
16
|
+
cdr: ChangeDetectorRef;
|
|
15
17
|
private localizationService;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
+
data: any[];
|
|
19
|
+
loadedTasks: any[];
|
|
20
|
+
constructor(mapper: MappingService, editService: EditService, cdr: ChangeDetectorRef, localizationService: LocalizationService);
|
|
21
|
+
ngOnInit(): void;
|
|
22
|
+
predecessors: GanttDependency[];
|
|
23
|
+
successors: GanttDependency[];
|
|
18
24
|
getText(token: string): string;
|
|
25
|
+
getDependencyType(typeId: number): string;
|
|
19
26
|
handleEditingResult(editResultType: 'save' | 'cancel'): void;
|
|
20
27
|
onTaskDelete(): void;
|
|
21
28
|
}
|
|
@@ -3,23 +3,44 @@
|
|
|
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 { FormGroup } from '@angular/forms';
|
|
6
|
+
import { ChangeDetectorRef, Component, Input } from '@angular/core';
|
|
8
7
|
import { LocalizationService } from '@progress/kendo-angular-l10n';
|
|
9
8
|
import { MappingService } from '../common/mapping.service';
|
|
9
|
+
import { DependencyType } from '../models/dependency-type.enum';
|
|
10
10
|
import { EditService } from './edit.service';
|
|
11
11
|
/**
|
|
12
12
|
* @hidden
|
|
13
13
|
*/
|
|
14
14
|
let EditDialogComponent = class EditDialogComponent {
|
|
15
|
-
constructor(mapper, editService, localizationService) {
|
|
15
|
+
constructor(mapper, editService, cdr, localizationService) {
|
|
16
16
|
this.mapper = mapper;
|
|
17
17
|
this.editService = editService;
|
|
18
|
+
this.cdr = cdr;
|
|
18
19
|
this.localizationService = localizationService;
|
|
19
20
|
}
|
|
21
|
+
ngOnInit() {
|
|
22
|
+
this.editService.loadTasks(this.data).subscribe(value => {
|
|
23
|
+
this.loadedTasks = value;
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
get predecessors() {
|
|
27
|
+
return this.editService.predecessors;
|
|
28
|
+
}
|
|
29
|
+
set predecessors(items) {
|
|
30
|
+
this.editService.predecessors = items;
|
|
31
|
+
}
|
|
32
|
+
get successors() {
|
|
33
|
+
return this.editService.successors;
|
|
34
|
+
}
|
|
35
|
+
set successors(items) {
|
|
36
|
+
this.editService.successors = items;
|
|
37
|
+
}
|
|
20
38
|
getText(token) {
|
|
21
39
|
return this.localizationService.get(token);
|
|
22
40
|
}
|
|
41
|
+
getDependencyType(typeId) {
|
|
42
|
+
return DependencyType[typeId];
|
|
43
|
+
}
|
|
23
44
|
handleEditingResult(editResultType) {
|
|
24
45
|
this.editService.triggerEditEvent(editResultType);
|
|
25
46
|
}
|
|
@@ -29,8 +50,8 @@ let EditDialogComponent = class EditDialogComponent {
|
|
|
29
50
|
};
|
|
30
51
|
tslib_1.__decorate([
|
|
31
52
|
Input(),
|
|
32
|
-
tslib_1.__metadata("design:type",
|
|
33
|
-
], EditDialogComponent.prototype, "
|
|
53
|
+
tslib_1.__metadata("design:type", Array)
|
|
54
|
+
], EditDialogComponent.prototype, "data", void 0);
|
|
34
55
|
EditDialogComponent = tslib_1.__decorate([
|
|
35
56
|
Component({
|
|
36
57
|
selector: 'kendo-gantt-edit-dialog',
|
|
@@ -42,34 +63,34 @@ EditDialogComponent = tslib_1.__decorate([
|
|
|
42
63
|
(close)="handleEditingResult('cancel')">
|
|
43
64
|
<kendo-dialog-messages
|
|
44
65
|
[closeTitle]="getText('taskEditingDialogCloseTitle')"></kendo-dialog-messages>
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
<
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
<
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
66
|
+
|
|
67
|
+
<kendo-tabstrip [keepTabContent]="true">
|
|
68
|
+
<kendo-tabstrip-tab [title]="getText('taskEditingGeneralTabTitle')" [selected]="true">
|
|
69
|
+
<ng-template kendoTabContent>
|
|
70
|
+
<kendo-gantt-task-fields></kendo-gantt-task-fields>
|
|
71
|
+
</ng-template>
|
|
72
|
+
</kendo-tabstrip-tab>
|
|
73
|
+
<kendo-tabstrip-tab [title]="getText('taskEditingPredecessorsTabTitle')">
|
|
74
|
+
<ng-template kendoTabContent>
|
|
75
|
+
<kendo-gantt-dependencies-table
|
|
76
|
+
[tasks]="loadedTasks"
|
|
77
|
+
[(dependencies)]="predecessors"
|
|
78
|
+
dependencyType="predecessor"
|
|
79
|
+
>
|
|
80
|
+
</kendo-gantt-dependencies-table>
|
|
81
|
+
</ng-template>
|
|
82
|
+
</kendo-tabstrip-tab>
|
|
83
|
+
<kendo-tabstrip-tab [title]="getText('taskEditingSuccessorsTabTitle')">
|
|
84
|
+
<ng-template kendoTabContent>
|
|
85
|
+
<kendo-gantt-dependencies-table
|
|
86
|
+
[tasks]="loadedTasks"
|
|
87
|
+
[(dependencies)]="successors"
|
|
88
|
+
dependencyType="successor">
|
|
89
|
+
</kendo-gantt-dependencies-table>
|
|
90
|
+
</ng-template>
|
|
91
|
+
</kendo-tabstrip-tab>
|
|
92
|
+
</kendo-tabstrip>
|
|
93
|
+
|
|
73
94
|
<kendo-dialog-actions layout="normal">
|
|
74
95
|
<button kendoButton (click)="onTaskDelete()">{{ getText('deleteButtonText') }}</button>
|
|
75
96
|
<kendo-treelist-spacer></kendo-treelist-spacer>
|
|
@@ -81,6 +102,7 @@ EditDialogComponent = tslib_1.__decorate([
|
|
|
81
102
|
}),
|
|
82
103
|
tslib_1.__metadata("design:paramtypes", [MappingService,
|
|
83
104
|
EditService,
|
|
105
|
+
ChangeDetectorRef,
|
|
84
106
|
LocalizationService])
|
|
85
107
|
], EditDialogComponent);
|
|
86
108
|
export { EditDialogComponent };
|
|
@@ -3,18 +3,39 @@
|
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
5
|
import { FormGroup } from '@angular/forms';
|
|
6
|
-
import { Subject } from 'rxjs';
|
|
6
|
+
import { Observable, Subject } from 'rxjs';
|
|
7
|
+
import { TaskAddEvent } from '../models/events/task-add-event.interface';
|
|
8
|
+
import { GanttDependency } from '../main';
|
|
7
9
|
import { EditEvent, EditResultType } from '../models/events/task-edit-event.interface';
|
|
10
|
+
import { MappingService } from '../common/mapping.service';
|
|
8
11
|
/**
|
|
9
12
|
* @hidden
|
|
10
13
|
*/
|
|
11
14
|
export declare class EditService {
|
|
15
|
+
private mapper;
|
|
12
16
|
showEditingDialog: Subject<boolean>;
|
|
13
17
|
showConfirmationDialog: Subject<any>;
|
|
14
18
|
editEvent: Subject<EditEvent>;
|
|
15
|
-
|
|
19
|
+
addEvent: Subject<TaskAddEvent>;
|
|
20
|
+
taskFormGroup: FormGroup;
|
|
16
21
|
dataItem: any;
|
|
17
|
-
|
|
22
|
+
getSelectedItem: () => any;
|
|
23
|
+
hasChildren: (node: any) => boolean;
|
|
24
|
+
fetchChildren: (node: any) => Observable<any[]> | any[];
|
|
25
|
+
dependencies: any[];
|
|
26
|
+
predecessors: GanttDependency[];
|
|
27
|
+
successors: GanttDependency[];
|
|
28
|
+
updatedItems: any[];
|
|
29
|
+
deletedItems: any[];
|
|
30
|
+
constructor(mapper: MappingService);
|
|
31
|
+
createEditDialog(dataItem: any, taskFormGroup: FormGroup, dependencies: any[]): void;
|
|
18
32
|
closeEditDialog(): void;
|
|
19
33
|
triggerEditEvent(editResultType: EditResultType): void;
|
|
34
|
+
updateDependencies(item: GanttDependency): void;
|
|
35
|
+
getCreatedDependencies(): any[];
|
|
36
|
+
deleteDependency(item: GanttDependency): void;
|
|
37
|
+
loadTasks(initialValues: any[], isInitializer?: boolean): Observable<any[]>;
|
|
38
|
+
private getElementById;
|
|
39
|
+
private itemIndex;
|
|
40
|
+
private isNew;
|
|
20
41
|
}
|