@progress/kendo-angular-gantt 0.1.5 → 0.2.0-dev.202111231320
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/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 +309 -8
- package/dist/es/gantt.module.js +60 -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/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 +4 -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/toolbar/view-selector.component.js +7 -4
- package/dist/es/utils.js +44 -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/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 +180 -4
- package/dist/es2015/gantt.component.js +492 -8
- package/dist/es2015/gantt.module.d.ts +29 -1
- package/dist/es2015/gantt.module.js +60 -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/models/events/cell-click-event.interface.d.ts +20 -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 +22 -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/package-metadata.js +1 -1
- package/dist/es2015/rendering/gantt-milestone-task.component.js +1 -0
- package/dist/es2015/rendering/gantt-summary-task.component.js +1 -0
- package/dist/es2015/rendering/gantt-task-base.d.ts +1 -0
- package/dist/es2015/rendering/gantt-task-base.js +4 -0
- package/dist/es2015/rendering/gantt-task.component.d.ts +4 -1
- package/dist/es2015/rendering/gantt-task.component.js +17 -2
- package/dist/es2015/rendering/gantt-tasks-table-body.component.d.ts +1 -0
- package/dist/es2015/rendering/gantt-tasks-table-body.component.js +8 -1
- 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 +34 -0
- package/dist/es2015/utils.js +44 -1
- package/dist/fesm2015/index.js +1080 -23
- package/dist/fesm5/index.js +865 -24
- 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/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 +306 -5
- package/dist/npm/gantt.module.js +59 -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/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 +4 -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/toolbar/view-selector.component.js +7 -4
- package/dist/npm/utils.js +43 -0
- package/dist/systemjs/kendo-angular-gantt.js +1 -1
- package/package.json +5 -2
|
@@ -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 };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
import { FormGroup } from '@angular/forms';
|
|
6
|
+
import { Subject } from 'rxjs';
|
|
7
|
+
import { EditEvent, EditResultType } from '../models/events/task-edit-event.interface';
|
|
8
|
+
/**
|
|
9
|
+
* @hidden
|
|
10
|
+
*/
|
|
11
|
+
export declare class EditService {
|
|
12
|
+
showEditingDialog: Subject<boolean>;
|
|
13
|
+
showConfirmationDialog: Subject<any>;
|
|
14
|
+
editEvent: Subject<EditEvent>;
|
|
15
|
+
formGroup: FormGroup;
|
|
16
|
+
dataItem: any;
|
|
17
|
+
createEditDialog(dataItem: any, formGroup: FormGroup): void;
|
|
18
|
+
closeEditDialog(): void;
|
|
19
|
+
triggerEditEvent(editResultType: EditResultType): void;
|
|
20
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
import * as tslib_1 from "tslib";
|
|
6
|
+
import { Injectable } from '@angular/core';
|
|
7
|
+
import { Subject } from 'rxjs';
|
|
8
|
+
/**
|
|
9
|
+
* @hidden
|
|
10
|
+
*/
|
|
11
|
+
let EditService = class EditService {
|
|
12
|
+
/**
|
|
13
|
+
* @hidden
|
|
14
|
+
*/
|
|
15
|
+
constructor() {
|
|
16
|
+
this.showEditingDialog = new Subject();
|
|
17
|
+
this.showConfirmationDialog = new Subject();
|
|
18
|
+
this.editEvent = new Subject();
|
|
19
|
+
}
|
|
20
|
+
createEditDialog(dataItem, formGroup) {
|
|
21
|
+
this.dataItem = dataItem;
|
|
22
|
+
this.formGroup = formGroup;
|
|
23
|
+
this.showEditingDialog.next(true);
|
|
24
|
+
}
|
|
25
|
+
closeEditDialog() {
|
|
26
|
+
this.showEditingDialog.next(false);
|
|
27
|
+
this.dataItem = undefined;
|
|
28
|
+
this.formGroup = undefined;
|
|
29
|
+
}
|
|
30
|
+
triggerEditEvent(editResultType) {
|
|
31
|
+
this.editEvent.next({
|
|
32
|
+
formGroup: this.formGroup,
|
|
33
|
+
dataItem: this.dataItem,
|
|
34
|
+
editResultType
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
EditService = tslib_1.__decorate([
|
|
39
|
+
Injectable()
|
|
40
|
+
], EditService);
|
|
41
|
+
export { EditService };
|
|
@@ -0,0 +1,10 @@
|
|
|
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 { MappingService } from "../common/mapping.service";
|
|
6
|
+
import { TaskEditItem } from "../models/events/task-edit-event.interface";
|
|
7
|
+
/**
|
|
8
|
+
* @hidden
|
|
9
|
+
*/
|
|
10
|
+
export declare const getEditItem: (dataItem: any, data: any[], mapper: MappingService) => TaskEditItem;
|
|
@@ -0,0 +1,17 @@
|
|
|
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
|
+
/**
|
|
6
|
+
* @hidden
|
|
7
|
+
*/
|
|
8
|
+
export const getEditItem = (dataItem, data, mapper) => {
|
|
9
|
+
const treeListDataItem = data.find(item => mapper.extractFromTask(item.data, 'id') === mapper.extractFromTask(dataItem, 'id'));
|
|
10
|
+
return mapPath(treeListDataItem);
|
|
11
|
+
};
|
|
12
|
+
const mapPath = (item) => ({
|
|
13
|
+
dataItem: item.data,
|
|
14
|
+
parent: item.parent.data ? mapPath(item.parent) : null
|
|
15
|
+
});
|
|
16
|
+
const ɵ0 = mapPath;
|
|
17
|
+
export { ɵ0 };
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
import { EventEmitter, OnChanges, QueryList, SimpleChanges, Renderer2, AfterContentInit, OnDestroy } from '@angular/core';
|
|
6
|
-
import { DataBoundTreeComponent, ExpandableTreeComponent } from '@progress/kendo-angular-treelist';
|
|
5
|
+
import { EventEmitter, OnChanges, QueryList, SimpleChanges, Renderer2, AfterContentInit, OnDestroy, ElementRef, NgZone } from '@angular/core';
|
|
6
|
+
import { CellClickEvent as TreeListCellClickEvent, DataBoundTreeComponent, ExpandableTreeComponent } from '@progress/kendo-angular-treelist';
|
|
7
7
|
import { TreeListComponent } from '@progress/kendo-angular-treelist';
|
|
8
8
|
import { CompositeFilterDescriptor, SortDescriptor } from '@progress/kendo-data-query';
|
|
9
9
|
import { Observable } from 'rxjs';
|
|
@@ -16,6 +16,8 @@ import { ScrollSyncService } from './scrolling/scroll-sync.service';
|
|
|
16
16
|
import { DependencyDomService } from './dependencies/dependency-dom.service';
|
|
17
17
|
import { MappingService } from './common/mapping.service';
|
|
18
18
|
import { OptionChangesService } from './common/option-changes.service';
|
|
19
|
+
import { EditService } from './editing/edit.service';
|
|
20
|
+
import { LocalizationService } from '@progress/kendo-angular-l10n';
|
|
19
21
|
import { TimelinePaneOptions, TreeListPaneOptions } from './models/splitter-pane-options.interface';
|
|
20
22
|
import { GanttTaskTemplateDirective } from './template-directives/task-template.directive';
|
|
21
23
|
import { GanttSummaryTaskTemplateDirective } from './template-directives/summary-task-template.directive';
|
|
@@ -25,8 +27,81 @@ import { ToolbarPosition } from './models/toolbar-position';
|
|
|
25
27
|
import { ExpandEvent } from './expanded-state/expand-event';
|
|
26
28
|
import { ViewBase } from './timeline/view-base';
|
|
27
29
|
import { Day } from '@progress/kendo-date-math';
|
|
30
|
+
import { FormGroup } from '@angular/forms';
|
|
31
|
+
import { TaskClickEvent } from './models/events/task-click-event.interface';
|
|
32
|
+
import { TaskEditEvent } from './models/events/task-edit-event.interface';
|
|
33
|
+
import { CellClickEvent } from './models/events/cell-click-event.interface';
|
|
34
|
+
import { CellCloseEvent } from './models/events/cell-close-event.interface';
|
|
28
35
|
/**
|
|
29
|
-
*
|
|
36
|
+
* Represents the Kendo UI Gantt component for Angular.
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* ```ts-preview
|
|
40
|
+
* _@Component({
|
|
41
|
+
* selector: 'my-app',
|
|
42
|
+
* template: `
|
|
43
|
+
* <kendo-gantt
|
|
44
|
+
* [style.height.px]="500"
|
|
45
|
+
* [kendoGanttHierarchyBinding]="data"
|
|
46
|
+
* childrenField="subtasks"
|
|
47
|
+
* [dependencies]="dependencies">
|
|
48
|
+
* <kendo-gantt-column
|
|
49
|
+
* field="title"
|
|
50
|
+
* title="Task"
|
|
51
|
+
* [width]="200"
|
|
52
|
+
* [expandable]="true"></kendo-gantt-column>
|
|
53
|
+
* <kendo-gantt-column
|
|
54
|
+
* field="start"
|
|
55
|
+
* title="Start"
|
|
56
|
+
* format="dd-MMM-yyyy"
|
|
57
|
+
* [width]="120"></kendo-gantt-column>
|
|
58
|
+
* <kendo-gantt-column
|
|
59
|
+
* field="end"
|
|
60
|
+
* title="End"
|
|
61
|
+
* format="dd-MMM-yyyy"
|
|
62
|
+
* [width]="120"></kendo-gantt-column>
|
|
63
|
+
* <kendo-gantt-timeline-day-view></kendo-gantt-timeline-day-view>
|
|
64
|
+
* <kendo-gantt-timeline-week-view></kendo-gantt-timeline-week-view>
|
|
65
|
+
* <kendo-gantt-timeline-month-view></kendo-gantt-timeline-month-view>
|
|
66
|
+
* </kendo-gantt>
|
|
67
|
+
* `
|
|
68
|
+
* })
|
|
69
|
+
* class AppComponent {
|
|
70
|
+
* public data: Task[] = [{
|
|
71
|
+
* id: 7, title: 'Validation and R&D', start: new Date('2014-06-02T00:00:00.000Z'),
|
|
72
|
+
* end: new Date('2014-06-19T00:00:00.000Z'), completionRatio: 0.45708333333333334,
|
|
73
|
+
* subtasks: [
|
|
74
|
+
* { id: 18, title: 'Project Kickoff', start: new Date('2014-06-02T00:00:00.000Z'),
|
|
75
|
+
* end: new Date('2014-06-02T00:00:00.000Z'), completionRatio: 0.23 },
|
|
76
|
+
* { id: 11, title: 'Research', start: new Date('2014-06-02T00:00:00.000Z'),
|
|
77
|
+
* end: new Date('2014-06-07T00:00:00.000Z'), completionRatio: 0.5766666666666667,
|
|
78
|
+
* subtasks: [
|
|
79
|
+
* { id: 19, title: 'Validation', start: new Date('2014-06-02T00:00:00.000Z'),
|
|
80
|
+
* end: new Date('2014-06-04T00:00:00.000Z'), completionRatio: 0.25 },
|
|
81
|
+
* { id: 39, title: 'Specification', start: new Date('2014-06-04T00:00:00.000Z'),
|
|
82
|
+
* end: new Date('2014-06-07T00:00:00.000Z'), completionRatio: 0.66 }]
|
|
83
|
+
* }, { id: 13, title: 'Implementation', start: new Date('2014-06-08T00:00:00.000Z'),
|
|
84
|
+
* end: new Date('2014-06-19T00:00:00.000Z'), completionRatio: 0.77,
|
|
85
|
+
* subtasks: [
|
|
86
|
+
* { id: 24, title: 'Prototype', start: new Date('2014-06-08T00:00:00.000Z'),
|
|
87
|
+
* end: new Date('2014-06-14T00:00:00.000Z'), completionRatio: 0.77 },
|
|
88
|
+
* { id: 29, title: 'UI and Interaction', start: new Date('2014-06-14T00:00:00.000Z'),
|
|
89
|
+
* end: new Date('2014-06-19T00:00:00.000Z'), completionRatio: 0.6 }]
|
|
90
|
+
* }, { id: 17, title: 'Release', start: new Date('2014-06-19T00:00:00.000Z'),
|
|
91
|
+
* end: new Date('2014-06-19T00:00:00.000Z'), completionRatio: 0 }]
|
|
92
|
+
* }];
|
|
93
|
+
*
|
|
94
|
+
* public dependencies: GanttDependency[] = [
|
|
95
|
+
* { id: 528, fromId: 18, toId: 19, type: DependencyType.FS },
|
|
96
|
+
* { id: 529, fromId: 19, toId: 39, type: DependencyType.FS },
|
|
97
|
+
* { id: 535, fromId: 24, toId: 29, type: DependencyType.FS },
|
|
98
|
+
* { id: 551, fromId: 13, toId: 29, type: DependencyType.FF },
|
|
99
|
+
* { id: 777, fromId: 7, toId: 11, type: DependencyType.SF },
|
|
100
|
+
* { id: 556, fromId: 39, toId: 24, type: DependencyType.FS },
|
|
101
|
+
* { id: 546, fromId: 29, toId: 17, type: DependencyType.FS },
|
|
102
|
+
* ];
|
|
103
|
+
* }
|
|
104
|
+
* ```
|
|
30
105
|
*/
|
|
31
106
|
export declare class GanttComponent implements AfterContentInit, OnChanges, OnDestroy, DataBoundTreeComponent, ExpandableTreeComponent {
|
|
32
107
|
private timelineViewService;
|
|
@@ -35,6 +110,10 @@ export declare class GanttComponent implements AfterContentInit, OnChanges, OnDe
|
|
|
35
110
|
private mapper;
|
|
36
111
|
private optionChangesService;
|
|
37
112
|
private dependencyDomService;
|
|
113
|
+
private editService;
|
|
114
|
+
localizationService: LocalizationService;
|
|
115
|
+
private hostElement;
|
|
116
|
+
private zone;
|
|
38
117
|
treeList: TreeListComponent;
|
|
39
118
|
/**
|
|
40
119
|
* @hidden
|
|
@@ -51,6 +130,7 @@ export declare class GanttComponent implements AfterContentInit, OnChanges, OnDe
|
|
|
51
130
|
toolbarTemplateChildren: QueryList<ToolbarTemplateDirective>;
|
|
52
131
|
toolbarTemplate: ToolbarTemplateDirective;
|
|
53
132
|
hostClasses: boolean;
|
|
133
|
+
readonly dir: string;
|
|
54
134
|
/**
|
|
55
135
|
* A query list of all declared columns.
|
|
56
136
|
*/
|
|
@@ -202,10 +282,40 @@ export declare class GanttComponent implements AfterContentInit, OnChanges, OnDe
|
|
|
202
282
|
* Fires when an item is expanded.
|
|
203
283
|
*/
|
|
204
284
|
rowExpand: EventEmitter<ExpandEvent>;
|
|
285
|
+
/**
|
|
286
|
+
* Fires when a Gantt task in the timeline pane is double-clicked. The data item, associated with the clicked task,
|
|
287
|
+
* is available in the event data. Use the event handler to open a task editing dialog as necessary.
|
|
288
|
+
*/
|
|
289
|
+
taskDblClick: EventEmitter<TaskClickEvent>;
|
|
290
|
+
/**
|
|
291
|
+
* Fires when the user double clicks a cell.
|
|
292
|
+
*/
|
|
293
|
+
cellDblClick: EventEmitter<CellClickEvent>;
|
|
294
|
+
/**
|
|
295
|
+
* Fires when the user leaves an edited cell.
|
|
296
|
+
*/
|
|
297
|
+
cellClose: EventEmitter<CellCloseEvent>;
|
|
298
|
+
/**
|
|
299
|
+
* Fires when the end user clicks the `Delete` button in the task editing dialog or the task delete icon.
|
|
300
|
+
* Use the event handler to open a confirmation dialog when necessary.
|
|
301
|
+
*/
|
|
302
|
+
taskDelete: EventEmitter<any>;
|
|
205
303
|
/**
|
|
206
304
|
* Fires when an item is collapsed.
|
|
207
305
|
*/
|
|
208
306
|
rowCollapse: EventEmitter<ExpandEvent>;
|
|
307
|
+
/**
|
|
308
|
+
* Fires when the user confirms deleting a task.
|
|
309
|
+
*/
|
|
310
|
+
remove: EventEmitter<TaskEditEvent>;
|
|
311
|
+
/**
|
|
312
|
+
* Fires when the user cancels editing a task.
|
|
313
|
+
*/
|
|
314
|
+
cancel: EventEmitter<TaskEditEvent>;
|
|
315
|
+
/**
|
|
316
|
+
* Fires when the user saves an edited task.
|
|
317
|
+
*/
|
|
318
|
+
save: EventEmitter<TaskEditEvent>;
|
|
209
319
|
/**
|
|
210
320
|
* Fires when the sorting of the Gantt is changed.
|
|
211
321
|
* You have to handle the event yourself and sort the data.
|
|
@@ -290,12 +400,24 @@ export declare class GanttComponent implements AfterContentInit, OnChanges, OnDe
|
|
|
290
400
|
* Used by the views selector.
|
|
291
401
|
*/
|
|
292
402
|
readonly viewTypes: string[];
|
|
403
|
+
/**
|
|
404
|
+
* @hidden
|
|
405
|
+
*/
|
|
406
|
+
readonly editDialogFormGroup: FormGroup;
|
|
293
407
|
/**
|
|
294
408
|
* @hidden
|
|
295
409
|
*
|
|
296
410
|
* Used by the GanttExpandableDirective.
|
|
297
411
|
*/
|
|
298
412
|
expandStateChange: EventEmitter<any>;
|
|
413
|
+
/**
|
|
414
|
+
* @hidden
|
|
415
|
+
*/
|
|
416
|
+
showEditingDialog: boolean;
|
|
417
|
+
/**
|
|
418
|
+
* @hidden
|
|
419
|
+
*/
|
|
420
|
+
showConfirmationDialog: boolean;
|
|
299
421
|
private _columns;
|
|
300
422
|
private _data;
|
|
301
423
|
private _timelinePaneOptions;
|
|
@@ -304,8 +426,14 @@ export declare class GanttComponent implements AfterContentInit, OnChanges, OnDe
|
|
|
304
426
|
private _rowClass;
|
|
305
427
|
private _taskClass;
|
|
306
428
|
private _activeView;
|
|
429
|
+
private _cellClickEvent;
|
|
430
|
+
private direction;
|
|
431
|
+
private rtl;
|
|
432
|
+
private editItem;
|
|
307
433
|
private optionChangesSubscriptions;
|
|
308
|
-
|
|
434
|
+
private editServiceSubscription;
|
|
435
|
+
private localizationSubscription;
|
|
436
|
+
constructor(timelineViewService: TimelineViewService, scrollSyncService: ScrollSyncService, renderer: Renderer2, mapper: MappingService, optionChangesService: OptionChangesService, dependencyDomService: DependencyDomService, editService: EditService, localizationService: LocalizationService, hostElement: ElementRef, zone: NgZone);
|
|
309
437
|
ngOnChanges(changes: SimpleChanges): void;
|
|
310
438
|
ngAfterViewInit(): void;
|
|
311
439
|
ngAfterContentInit(): void;
|
|
@@ -340,6 +468,30 @@ export declare class GanttComponent implements AfterContentInit, OnChanges, OnDe
|
|
|
340
468
|
* @param {ColumnReorderConfig} options - Additional options.
|
|
341
469
|
*/
|
|
342
470
|
reorderColumn(source: GanttColumnBase, destIndex: number, options?: ColumnReorderConfig): void;
|
|
471
|
+
/**
|
|
472
|
+
* Opens the task editing dialog.
|
|
473
|
+
*/
|
|
474
|
+
editTask(dataItem: any, formGroup: FormGroup): void;
|
|
475
|
+
/**
|
|
476
|
+
* Closes the task editing dialog.
|
|
477
|
+
*/
|
|
478
|
+
closeTaskDialog(): void;
|
|
479
|
+
/**
|
|
480
|
+
* Opens the delete task confirmation dialog.
|
|
481
|
+
*/
|
|
482
|
+
openConfirmationDialog(): void;
|
|
483
|
+
/**
|
|
484
|
+
* Opens a cell for editing.
|
|
485
|
+
*/
|
|
486
|
+
editCell(dataItem: any, column: number | string | any, formGroup?: FormGroup): void;
|
|
487
|
+
/**
|
|
488
|
+
* Closes an edited cell.
|
|
489
|
+
*/
|
|
490
|
+
closeCell(): void;
|
|
491
|
+
/**
|
|
492
|
+
* @hidden
|
|
493
|
+
*/
|
|
494
|
+
handleCellClose(e: CellCloseEvent): void;
|
|
343
495
|
/**
|
|
344
496
|
* @hidden
|
|
345
497
|
*/
|
|
@@ -370,6 +522,30 @@ export declare class GanttComponent implements AfterContentInit, OnChanges, OnDe
|
|
|
370
522
|
* @hidden
|
|
371
523
|
*/
|
|
372
524
|
onTimelinePaneSizeChange(e: string): void;
|
|
525
|
+
/**
|
|
526
|
+
* @hidden
|
|
527
|
+
*/
|
|
528
|
+
handleCellClick(event: TreeListCellClickEvent): void;
|
|
529
|
+
/**
|
|
530
|
+
* @hidden
|
|
531
|
+
*/
|
|
532
|
+
handleDoubleClick(event: MouseEvent): void;
|
|
533
|
+
/**
|
|
534
|
+
* @hidden
|
|
535
|
+
*/
|
|
536
|
+
handleDeleteConfirmation(): void;
|
|
537
|
+
/**
|
|
538
|
+
* @hidden
|
|
539
|
+
*/
|
|
540
|
+
handleTimelineMouseDown(event: MouseEvent): void;
|
|
541
|
+
/**
|
|
542
|
+
* @hidden
|
|
543
|
+
*/
|
|
544
|
+
handleTimelineDblClick(event: MouseEvent): void;
|
|
545
|
+
/**
|
|
546
|
+
* @hidden
|
|
547
|
+
*/
|
|
548
|
+
getText(token: string): string;
|
|
373
549
|
private updateTreeListGroupClass;
|
|
374
550
|
/**
|
|
375
551
|
* Used to hide the vertical scrollbar
|