@progress/kendo-angular-gantt 0.3.0-dev.202112141015 → 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.
Files changed (60) hide show
  1. package/dist/cdn/js/kendo-angular-gantt.js +2 -2
  2. package/dist/cdn/main.js +10 -4
  3. package/dist/es/dependencies/utils.js +6 -5
  4. package/dist/es/editing/dependencies-table.component.js +131 -0
  5. package/dist/es/editing/edit-dialog.component.js +37 -6
  6. package/dist/es/editing/edit.service.js +88 -7
  7. package/dist/es/editing/task-fields.component.js +43 -0
  8. package/dist/es/gantt.component.js +49 -26
  9. package/dist/es/gantt.module.js +12 -3
  10. package/dist/es/index.js +3 -0
  11. package/dist/es/localization/gantt-localization.service.js +26 -0
  12. package/dist/es/models/dependency-type.enum.js +16 -0
  13. package/dist/es/models/models.js +1 -0
  14. package/dist/es/package-metadata.js +1 -1
  15. package/dist/es2015/dependencies/utils.js +6 -5
  16. package/dist/es2015/editing/dependencies-table.component.d.ts +39 -0
  17. package/dist/es2015/editing/dependencies-table.component.js +160 -0
  18. package/dist/es2015/editing/edit-dialog.component.d.ts +10 -3
  19. package/dist/es2015/editing/edit-dialog.component.js +55 -33
  20. package/dist/es2015/editing/edit.service.d.ts +21 -3
  21. package/dist/es2015/editing/edit.service.js +77 -10
  22. package/dist/es2015/editing/task-fields.component.d.ts +22 -0
  23. package/dist/es2015/editing/task-fields.component.js +67 -0
  24. package/dist/es2015/gantt.component.d.ts +4 -6
  25. package/dist/es2015/gantt.component.js +42 -23
  26. package/dist/es2015/gantt.module.js +12 -3
  27. package/dist/es2015/index.d.ts +3 -0
  28. package/dist/es2015/index.js +3 -0
  29. package/dist/es2015/index.metadata.json +1 -1
  30. package/dist/es2015/{models/events/remove-event.interface.d.ts → localization/gantt-localization.service.d.ts} +6 -7
  31. package/dist/es2015/localization/gantt-localization.service.js +25 -0
  32. package/dist/es2015/models/dependency-type.enum.d.ts +1 -1
  33. package/dist/es2015/models/dependency-type.enum.js +16 -0
  34. package/dist/es2015/models/events/task-edit-event.interface.d.ts +17 -4
  35. package/dist/es2015/models/models.d.ts +0 -2
  36. package/dist/es2015/models/models.js +1 -0
  37. package/dist/es2015/package-metadata.js +1 -1
  38. package/dist/fesm2015/index.js +429 -76
  39. package/dist/fesm5/index.js +377 -49
  40. package/dist/npm/dependencies/utils.js +6 -5
  41. package/dist/npm/editing/dependencies-table.component.js +133 -0
  42. package/dist/npm/editing/edit-dialog.component.js +36 -5
  43. package/dist/npm/editing/edit.service.js +87 -6
  44. package/dist/npm/editing/task-fields.component.js +45 -0
  45. package/dist/npm/gantt.component.js +49 -26
  46. package/dist/npm/gantt.module.js +11 -2
  47. package/dist/npm/index.js +6 -0
  48. package/dist/npm/localization/gantt-localization.service.js +28 -0
  49. package/dist/npm/models/dependency-type.enum.js +16 -0
  50. package/dist/npm/models/models.js +2 -0
  51. package/dist/npm/package-metadata.js +1 -1
  52. package/dist/systemjs/kendo-angular-gantt.js +1 -1
  53. package/package.json +3 -1
  54. package/dist/es/models/events/edit-event.interface.js +0 -4
  55. package/dist/es/models/events/remove-event.interface.js +0 -4
  56. package/dist/es2015/models/events/edit-event.interface.d.ts +0 -19
  57. package/dist/es2015/models/events/edit-event.interface.js +0 -4
  58. package/dist/es2015/models/events/remove-event.interface.js +0 -4
  59. package/dist/npm/models/events/edit-event.interface.js +0 -6
  60. package/dist/npm/models/events/remove-event.interface.js +0 -6
@@ -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", FormGroup)
33
- ], EditDialogComponent.prototype, "formGroup", void 0);
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
- <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>
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,21 +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
7
  import { TaskAddEvent } from '../models/events/task-add-event.interface';
8
+ import { GanttDependency } from '../main';
8
9
  import { EditEvent, EditResultType } from '../models/events/task-edit-event.interface';
10
+ import { MappingService } from '../common/mapping.service';
9
11
  /**
10
12
  * @hidden
11
13
  */
12
14
  export declare class EditService {
15
+ private mapper;
13
16
  showEditingDialog: Subject<boolean>;
14
17
  showConfirmationDialog: Subject<any>;
15
18
  editEvent: Subject<EditEvent>;
16
19
  addEvent: Subject<TaskAddEvent>;
17
- formGroup: FormGroup;
20
+ taskFormGroup: FormGroup;
18
21
  dataItem: any;
19
22
  getSelectedItem: () => any;
20
- createEditDialog(dataItem: any, formGroup: FormGroup): void;
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;
21
32
  closeEditDialog(): void;
22
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;
23
41
  }
@@ -4,39 +4,106 @@
4
4
  *-------------------------------------------------------------------------------------------*/
5
5
  import * as tslib_1 from "tslib";
6
6
  import { Injectable } from '@angular/core';
7
- import { Subject } from 'rxjs';
7
+ import { EMPTY, forkJoin, isObservable, of, Subject } from 'rxjs';
8
+ import { MappingService } from '../common/mapping.service';
9
+ import { map, expand, reduce } from 'rxjs/operators';
10
+ import { isPresent, normalizeGanttData } from '../utils';
8
11
  /**
9
12
  * @hidden
10
13
  */
11
14
  let EditService = class EditService {
12
- /**
13
- * @hidden
14
- */
15
- constructor() {
15
+ constructor(mapper) {
16
+ this.mapper = mapper;
16
17
  this.showEditingDialog = new Subject();
17
18
  this.showConfirmationDialog = new Subject();
18
19
  this.editEvent = new Subject();
19
20
  this.addEvent = new Subject();
21
+ this.updatedItems = [];
22
+ this.deletedItems = [];
23
+ this.itemIndex = (item, data) => {
24
+ return data.findIndex(dataItem => this.mapper.extractFromTask(dataItem, 'id') === this.mapper.extractFromTask(item, 'id'));
25
+ };
20
26
  }
21
- createEditDialog(dataItem, formGroup) {
27
+ set dependencies(items) {
28
+ // Can this whole thing be moved to edit-dialog? Dependencies might not be needed here
29
+ const dataItemId = this.mapper.extractFromTask(this.dataItem, 'id');
30
+ this.predecessors = items.filter(item => this.mapper.extractFromDependency(item, 'toId') === dataItemId);
31
+ this.successors = items.filter(item => this.mapper.extractFromDependency(item, 'fromId') === dataItemId);
32
+ }
33
+ get dependencies() {
34
+ return [...this.predecessors, ...this.successors];
35
+ }
36
+ createEditDialog(dataItem, taskFormGroup, dependencies) {
22
37
  this.dataItem = dataItem;
23
- this.formGroup = formGroup;
38
+ this.taskFormGroup = taskFormGroup;
39
+ this.dependencies = dependencies;
24
40
  this.showEditingDialog.next(true);
25
41
  }
26
42
  closeEditDialog() {
27
43
  this.showEditingDialog.next(false);
28
44
  this.dataItem = undefined;
29
- this.formGroup = undefined;
45
+ this.taskFormGroup = undefined;
46
+ this.dependencies = [];
47
+ this.updatedItems = [];
48
+ this.deletedItems = [];
30
49
  }
31
50
  triggerEditEvent(editResultType) {
32
51
  this.editEvent.next({
33
- formGroup: this.formGroup,
52
+ taskFormGroup: this.taskFormGroup,
34
53
  dataItem: this.dataItem,
54
+ dependencies: {
55
+ createdItems: this.getCreatedDependencies(),
56
+ updatedItems: this.updatedItems,
57
+ deletedItems: this.deletedItems
58
+ },
35
59
  editResultType
36
60
  });
37
61
  }
62
+ updateDependencies(item) {
63
+ if (!this.isNew(item)) {
64
+ // update
65
+ const index = this.itemIndex(item, this.updatedItems);
66
+ if (index !== -1) {
67
+ this.updatedItems.splice(index, 1, item);
68
+ }
69
+ else {
70
+ this.updatedItems.push(item);
71
+ }
72
+ }
73
+ }
74
+ getCreatedDependencies() {
75
+ return this.dependencies.filter(item => this.mapper.extractFromDependency(item, 'id') === null);
76
+ }
77
+ deleteDependency(item) {
78
+ const updatedIndex = this.itemIndex(item, this.updatedItems);
79
+ if (updatedIndex !== -1) {
80
+ this.updatedItems.splice(updatedIndex, 1);
81
+ }
82
+ if (!this.isNew(item)) {
83
+ this.deletedItems.push(item);
84
+ }
85
+ }
86
+ loadTasks(initialValues, isInitializer = true) {
87
+ return forkJoin(initialValues.map(v => this.getElementById(v))).pipe(map((value) => value.reduce((acc, item) => acc = acc.concat(normalizeGanttData(item)), [])), expand(values => {
88
+ if (values.some(el => this.hasChildren(el))) {
89
+ return this.loadTasks(values, false);
90
+ }
91
+ return EMPTY;
92
+ }), reduce((acc, values) => acc.concat(values), isInitializer ? [...initialValues] : []));
93
+ }
94
+ getElementById(item) {
95
+ const children = this.fetchChildren(item);
96
+ if (isObservable(children)) {
97
+ return children;
98
+ }
99
+ return of(children);
100
+ }
101
+ isNew(item) {
102
+ return !isPresent(this.mapper.extractFromDependency(item, 'id'));
103
+ }
38
104
  };
39
105
  EditService = tslib_1.__decorate([
40
- Injectable()
106
+ Injectable(),
107
+ tslib_1.__metadata("design:paramtypes", [MappingService])
41
108
  ], EditService);
42
109
  export { EditService };
@@ -0,0 +1,22 @@
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 { MappingService } from '../common/mapping.service';
7
+ import { GanttLocalizationService } from '../localization/gantt-localization.service';
8
+ import { EditService } from './edit.service';
9
+ /**
10
+ * @hidden
11
+ */
12
+ export declare class TaskFieldsComponent {
13
+ mapper: MappingService;
14
+ private editService;
15
+ private localizationService;
16
+ constructor(mapper: MappingService, editService: EditService, localizationService: GanttLocalizationService);
17
+ /**
18
+ * @hidden
19
+ */
20
+ readonly formGroup: FormGroup;
21
+ getText(token: string): string;
22
+ }
@@ -0,0 +1,67 @@
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 } from '@angular/core';
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
+ let TaskFieldsComponent = class TaskFieldsComponent {
14
+ constructor(mapper, editService, localizationService) {
15
+ this.mapper = mapper;
16
+ this.editService = editService;
17
+ this.localizationService = localizationService;
18
+ }
19
+ /**
20
+ * @hidden
21
+ */
22
+ get formGroup() {
23
+ return this.editService.taskFormGroup;
24
+ }
25
+ getText(token) {
26
+ return this.localizationService.get(token);
27
+ }
28
+ };
29
+ TaskFieldsComponent = tslib_1.__decorate([
30
+ Component({
31
+ selector: 'kendo-gantt-task-fields',
32
+ template: `
33
+ <form class="k-form" [formGroup]="formGroup">
34
+ <kendo-formfield *ngIf="formGroup.contains(mapper.taskFields.title)">
35
+ <kendo-label [for]="mapper.taskFields.title" [text]="getText('titleFieldInputLabel')"></kendo-label>
36
+ <input class="k-textbox" [formControlName]="mapper.taskFields.title" />
37
+ </kendo-formfield>
38
+ <div class="k-hstack">
39
+ <kendo-formfield [style.width.%]="49" *ngIf="formGroup.contains(mapper.taskFields.start)">
40
+ <kendo-label [for]="mapper.taskFields.start" [text]="getText('startFieldInputLabel')"></kendo-label>
41
+ <kendo-datetimepicker [formControlName]="mapper.taskFields.start"></kendo-datetimepicker>
42
+ </kendo-formfield>
43
+ <kendo-treelist-spacer></kendo-treelist-spacer>
44
+ <kendo-formfield [style.width.%]="49" *ngIf="formGroup.contains(mapper.taskFields.end)">
45
+ <kendo-label [for]="mapper.taskFields.end" [text]="getText('endFieldInputLabel')"></kendo-label>
46
+ <kendo-datetimepicker [formControlName]="mapper.taskFields.end"></kendo-datetimepicker>
47
+ </kendo-formfield>
48
+ </div>
49
+ <kendo-formfield [style.width.%]="49" *ngIf="formGroup.contains(mapper.taskFields.completionRatio)">
50
+ <kendo-label [for]="mapper.taskFields.completionRatio" [text]="getText('completionRatioFieldInputLabel')"></kendo-label>
51
+ <kendo-numerictextbox
52
+ [formControlName]="mapper.taskFields.completionRatio"
53
+ [min]="0"
54
+ [max]="1"
55
+ [decimals]="2"
56
+ format="p2"
57
+ [step]="0.01"
58
+ ></kendo-numerictextbox>
59
+ </kendo-formfield>
60
+ </form>
61
+ `
62
+ }),
63
+ tslib_1.__metadata("design:paramtypes", [MappingService,
64
+ EditService,
65
+ GanttLocalizationService])
66
+ ], TaskFieldsComponent);
67
+ export { TaskFieldsComponent };
@@ -200,11 +200,11 @@ export declare class GanttComponent implements AfterContentInit, OnChanges, OnDe
200
200
  /**
201
201
  * Gets or sets the callback function that retrieves the child items for a particular item.
202
202
  */
203
- fetchChildren: (item: object) => Observable<object[]>;
203
+ fetchChildren: (dataItem: any) => Observable<object[]>;
204
204
  /**
205
205
  * Gets or sets the callback function that indicates if a particular item has child items.
206
206
  */
207
- hasChildren: (item: object) => boolean;
207
+ hasChildren: (dataItem: any) => boolean;
208
208
  /**
209
209
  * Defines the dependencies that will be drawn between the rendered tasks.
210
210
  *
@@ -442,10 +442,6 @@ export declare class GanttComponent implements AfterContentInit, OnChanges, OnDe
442
442
  * Used by the views selector.
443
443
  */
444
444
  readonly viewTypes: string[];
445
- /**
446
- * @hidden
447
- */
448
- readonly editDialogFormGroup: FormGroup;
449
445
  /**
450
446
  * @hidden
451
447
  *
@@ -469,6 +465,8 @@ export declare class GanttComponent implements AfterContentInit, OnChanges, OnDe
469
465
  private _taskClass;
470
466
  private _activeView;
471
467
  private _toolbarSettings;
468
+ private _fetchChildren;
469
+ private _hasChildren;
472
470
  private lastTreeListCellClick;
473
471
  private direction;
474
472
  private rtl;
@@ -31,6 +31,7 @@ import { GanttTaskContentTemplateDirective } from './template-directives/task-co
31
31
  import { ToolbarTemplateDirective } from './toolbar/toolbar-template.directive';
32
32
  import { ViewBase } from './timeline/view-base';
33
33
  import { getEditItem } from './editing/util';
34
+ import { GanttLocalizationService } from './localization/gantt-localization.service';
34
35
  const TREELIST_GROUP_COLUMNS_CLASS = 'k-gantt-treelist-nested-columns';
35
36
  const DEFAULT_VIEW = 'week';
36
37
  /**
@@ -138,14 +139,6 @@ let GanttComponent = GanttComponent_1 = class GanttComponent {
138
139
  * > When applied, the [`SelectableDirective`]({% slug api_gantt_selectabledirective %}) sets `selectable` to `true` internally.
139
140
  */
140
141
  this.selectable = false;
141
- /**
142
- * Gets or sets the callback function that retrieves the child items for a particular item.
143
- */
144
- this.fetchChildren = fetchChildren;
145
- /**
146
- * Gets or sets the callback function that indicates if a particular item has child items.
147
- */
148
- this.hasChildren = hasChildren;
149
142
  /**
150
143
  * Defines the dependencies that will be drawn between the rendered tasks.
151
144
  *
@@ -333,6 +326,8 @@ let GanttComponent = GanttComponent_1 = class GanttComponent {
333
326
  addTaskTool: 'none',
334
327
  viewSelectorTool: 'top'
335
328
  };
329
+ this._fetchChildren = fetchChildren;
330
+ this._hasChildren = hasChildren;
336
331
  this.rtl = false;
337
332
  this.optionChangesSubscriptions = new Subscription();
338
333
  this.editServiceSubscription = new Subscription();
@@ -348,12 +343,13 @@ let GanttComponent = GanttComponent_1 = class GanttComponent {
348
343
  this.editServiceSubscription.add(this.editService.showConfirmationDialog.subscribe(() => this.taskDelete.emit()));
349
344
  this.editServiceSubscription.add(this.editService.editEvent.subscribe(args => {
350
345
  this[args.editResultType].emit({
351
- formGroup: args.formGroup,
346
+ taskFormGroup: args.taskFormGroup,
352
347
  item: getEditItem(args.dataItem, this.treeList.view.data, this.mapper),
348
+ dependencies: args.dependencies,
353
349
  sender: this
354
350
  });
355
351
  this.showConfirmationDialog = this.showEditingDialog = false;
356
- this.editService.dataItem = this.editService.formGroup = null;
352
+ this.editService.dataItem = this.editService.taskFormGroup = null;
357
353
  this.updateView();
358
354
  }));
359
355
  this.editServiceSubscription.add(this.editService.addEvent.subscribe(args => {
@@ -460,6 +456,26 @@ let GanttComponent = GanttComponent_1 = class GanttComponent {
460
456
  get toolbarSettings() {
461
457
  return this._toolbarSettings;
462
458
  }
459
+ /**
460
+ * Gets or sets the callback function that retrieves the child items for a particular item.
461
+ */
462
+ set fetchChildren(fn) {
463
+ this._fetchChildren = fn;
464
+ this.editService.fetchChildren = fn;
465
+ }
466
+ get fetchChildren() {
467
+ return this._fetchChildren;
468
+ }
469
+ /**
470
+ * Gets or sets the callback function that indicates if a particular item has child items.
471
+ */
472
+ set hasChildren(fn) {
473
+ this._hasChildren = fn;
474
+ this.editService.hasChildren = fn;
475
+ }
476
+ get hasChildren() {
477
+ return this._hasChildren;
478
+ }
463
479
  /**
464
480
  * The options of the timeline splitter pane. By default the pane is `collapsible`,
465
481
  * `resizable`, not `collapsed`, and its `size` is `'50%'`.
@@ -567,12 +583,6 @@ let GanttComponent = GanttComponent_1 = class GanttComponent {
567
583
  get viewTypes() {
568
584
  return this.views.map(view => view.type);
569
585
  }
570
- /**
571
- * @hidden
572
- */
573
- get editDialogFormGroup() {
574
- return this.editService.formGroup;
575
- }
576
586
  ngOnChanges(changes) {
577
587
  if (anyChanged(['data', 'activeView', 'workWeekStart', 'workWeekEnd', 'workDayStart', 'workDayEnd'], changes)) {
578
588
  this.loadTimelineData();
@@ -661,7 +671,10 @@ let GanttComponent = GanttComponent_1 = class GanttComponent {
661
671
  */
662
672
  editTask(dataItem, formGroup) {
663
673
  if (!this.showEditingDialog) {
664
- this.editService.createEditDialog(dataItem, formGroup);
674
+ const taskId = this.mapper.extractFromTask(dataItem, 'id');
675
+ const dependencies = this.dependencies.filter(item => this.mapper.extractFromDependency(item, 'toId') === taskId
676
+ || this.mapper.extractFromDependency(item, 'fromId') === taskId);
677
+ this.editService.createEditDialog(dataItem, formGroup, dependencies);
665
678
  }
666
679
  }
667
680
  /**
@@ -1016,12 +1029,14 @@ tslib_1.__decorate([
1016
1029
  ], GanttComponent.prototype, "toolbarSettings", null);
1017
1030
  tslib_1.__decorate([
1018
1031
  Input(),
1019
- tslib_1.__metadata("design:type", Function)
1020
- ], GanttComponent.prototype, "fetchChildren", void 0);
1032
+ tslib_1.__metadata("design:type", Function),
1033
+ tslib_1.__metadata("design:paramtypes", [Function])
1034
+ ], GanttComponent.prototype, "fetchChildren", null);
1021
1035
  tslib_1.__decorate([
1022
1036
  Input(),
1023
- tslib_1.__metadata("design:type", Function)
1024
- ], GanttComponent.prototype, "hasChildren", void 0);
1037
+ tslib_1.__metadata("design:type", Function),
1038
+ tslib_1.__metadata("design:paramtypes", [Function])
1039
+ ], GanttComponent.prototype, "hasChildren", null);
1025
1040
  tslib_1.__decorate([
1026
1041
  Input(),
1027
1042
  tslib_1.__metadata("design:type", Array)
@@ -1195,6 +1210,7 @@ GanttComponent = GanttComponent_1 = tslib_1.__decorate([
1195
1210
  selector: 'kendo-gantt',
1196
1211
  exportAs: 'kendoGantt',
1197
1212
  providers: [
1213
+ GanttLocalizationService,
1198
1214
  LocalizationService,
1199
1215
  {
1200
1216
  provide: DataBoundTreeComponent,
@@ -1556,14 +1572,17 @@ GanttComponent = GanttComponent_1 = tslib_1.__decorate([
1556
1572
  [showViewSelector]="toolbarSettings.viewSelectorTool === 'bottom' || toolbarSettings.viewSelectorTool === 'both'"
1557
1573
  class="k-gantt-footer k-toolbar k-gantt-toolbar"
1558
1574
  position="bottom"></kendo-gantt-toolbar>
1559
- <kendo-gantt-edit-dialog *ngIf="showEditingDialog" [formGroup]="editDialogFormGroup"></kendo-gantt-edit-dialog>
1575
+ <kendo-gantt-edit-dialog
1576
+ *ngIf="showEditingDialog"
1577
+ [data]="data">
1578
+ </kendo-gantt-edit-dialog>
1560
1579
  <kendo-dialog
1561
1580
  *ngIf="showConfirmationDialog"
1562
1581
  [width]="575"
1563
1582
  [height]="170"
1564
1583
  [title]="getText('confirmationDialogTitle')"
1565
1584
  (close)="showConfirmationDialog = false;">
1566
- <span>{{getText('confirmationDialogContent')}}</span>
1585
+ <span>{{ getText('confirmationDialogContent') }}</span>
1567
1586
  <kendo-dialog-actions layout="normal">
1568
1587
  <kendo-treelist-spacer></kendo-treelist-spacer>
1569
1588
  <button kendoButton [primary]="true" (click)="handleDeleteConfirmation()">{{ getText('deleteButtonText') }}</button>
@@ -5,7 +5,7 @@
5
5
  import * as tslib_1 from "tslib";
6
6
  import { NgModule } from '@angular/core';
7
7
  import { CommonModule } from '@angular/common';
8
- import { SplitterModule } from '@progress/kendo-angular-layout';
8
+ import { SplitterModule, TabStripModule } from '@progress/kendo-angular-layout';
9
9
  import { TreeListModule } from '@progress/kendo-angular-treelist';
10
10
  import { ButtonsModule } from '@progress/kendo-angular-buttons';
11
11
  import { EventsModule } from '@progress/kendo-angular-common';
@@ -41,6 +41,10 @@ import { CustomMessagesComponent } from './localization/custom-messages.componen
41
41
  import { L10N_PREFIX } from '@progress/kendo-angular-l10n';
42
42
  import { LocalizedMessagesDirective } from './localization/localized-messages.directive';
43
43
  import { GanttAddTaskComponent } from './editing/add-task.component';
44
+ import { GridModule } from '@progress/kendo-angular-grid';
45
+ import { DropDownsModule } from '@progress/kendo-angular-dropdowns';
46
+ import { DependenciesTableComponent } from './editing/dependencies-table.component';
47
+ import { TaskFieldsComponent } from './editing/task-fields.component';
44
48
  const IMPORTED_MODULES = [
45
49
  CommonModule,
46
50
  ReactiveFormsModule,
@@ -52,7 +56,10 @@ const IMPORTED_MODULES = [
52
56
  TreeListModule,
53
57
  ButtonsModule,
54
58
  DialogModule,
55
- EventsModule
59
+ EventsModule,
60
+ TabStripModule,
61
+ GridModule,
62
+ DropDownsModule
56
63
  ];
57
64
  const DECLARATIONS = [
58
65
  GanttComponent,
@@ -89,7 +96,9 @@ const DECLARATIONS = [
89
96
  EditDialogComponent,
90
97
  CustomMessagesComponent,
91
98
  LocalizedMessagesDirective,
92
- GanttAddTaskComponent
99
+ GanttAddTaskComponent,
100
+ DependenciesTableComponent,
101
+ TaskFieldsComponent
93
102
  ];
94
103
  /**
95
104
  * Represents the [NgModule]({{ site.data.urls.angular['ngmoduleapi'] }})
@@ -11,9 +11,12 @@ export { OptionChangesService } from './common/option-changes.service';
11
11
  export { DependencyDomService } from './dependencies/dependency-dom.service';
12
12
  export { GanttDependencyDirective } from './dependencies/gantt-dependency.directive';
13
13
  export { GanttAddTaskComponent } from './editing/add-task.component';
14
+ export { DependenciesTableComponent } from './editing/dependencies-table.component';
14
15
  export { EditDialogComponent } from './editing/edit-dialog.component';
15
16
  export { EditService } from './editing/edit.service';
17
+ export { TaskFieldsComponent } from './editing/task-fields.component';
16
18
  export { CustomMessagesComponent } from './localization/custom-messages.component';
19
+ export { GanttLocalizationService } from './localization/gantt-localization.service';
17
20
  export { LocalizedMessagesDirective } from './localization/localized-messages.directive';
18
21
  export { Messages } from './localization/messages';
19
22
  export { PreventableEvent } from './models/events/preventable-event';
@@ -11,9 +11,12 @@ export { OptionChangesService } from './common/option-changes.service';
11
11
  export { DependencyDomService } from './dependencies/dependency-dom.service';
12
12
  export { GanttDependencyDirective } from './dependencies/gantt-dependency.directive';
13
13
  export { GanttAddTaskComponent } from './editing/add-task.component';
14
+ export { DependenciesTableComponent } from './editing/dependencies-table.component';
14
15
  export { EditDialogComponent } from './editing/edit-dialog.component';
15
16
  export { EditService } from './editing/edit.service';
17
+ export { TaskFieldsComponent } from './editing/task-fields.component';
16
18
  export { CustomMessagesComponent } from './localization/custom-messages.component';
19
+ export { GanttLocalizationService } from './localization/gantt-localization.service';
17
20
  export { LocalizedMessagesDirective } from './localization/localized-messages.directive';
18
21
  export { Messages } from './localization/messages';
19
22
  export { PreventableEvent } from './models/events/preventable-event';