@progress/kendo-angular-gantt 0.2.1-dev.202112081924 → 0.3.0-dev.202112141015

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 (69) hide show
  1. package/dist/cdn/js/kendo-angular-gantt.js +1 -1
  2. package/dist/cdn/main.js +2 -2
  3. package/dist/es/editing/add-task.component.js +94 -0
  4. package/dist/es/editing/edit.service.js +1 -0
  5. package/dist/es/expanded-state/expandable.directive.js +4 -6
  6. package/dist/es/gantt.component.js +68 -20
  7. package/dist/es/gantt.module.js +2 -2
  8. package/dist/es/index.js +2 -1
  9. package/dist/es/localization/messages.js +45 -1
  10. package/dist/es/models/events/{add-event.interface.js → task-add-event.interface.js} +0 -0
  11. package/dist/es/models/models.js +1 -0
  12. package/dist/es/models/{toolbar-position.js → toolbar-settings.js} +0 -0
  13. package/dist/es/package-metadata.js +1 -1
  14. package/dist/es/rendering/gantt-tasks-table-body.component.js +2 -2
  15. package/dist/es/timeline/timeline-base-view.service.js +12 -3
  16. package/dist/es/toolbar/toolbar.component.js +9 -1
  17. package/dist/es2015/editing/add-task.component.d.ts +45 -0
  18. package/dist/es2015/editing/add-task.component.js +102 -0
  19. package/dist/es2015/editing/edit.service.d.ts +3 -0
  20. package/dist/es2015/editing/edit.service.js +1 -0
  21. package/dist/es2015/expanded-state/expandable.directive.d.ts +1 -2
  22. package/dist/es2015/expanded-state/expandable.directive.js +2 -7
  23. package/dist/es2015/gantt.component.d.ts +25 -12
  24. package/dist/es2015/gantt.component.js +141 -20
  25. package/dist/es2015/gantt.module.js +2 -2
  26. package/dist/es2015/index.d.ts +2 -1
  27. package/dist/es2015/index.js +2 -1
  28. package/dist/es2015/index.metadata.json +1 -1
  29. package/dist/es2015/localization/messages.d.ts +46 -2
  30. package/dist/es2015/localization/messages.js +45 -1
  31. package/dist/es2015/models/events/cell-close-event.interface.d.ts +1 -1
  32. package/dist/es2015/models/events/task-add-event.interface.d.ts +31 -0
  33. package/dist/es2015/models/events/{add-event.interface.js → task-add-event.interface.js} +0 -0
  34. package/dist/es2015/models/events/task-edit-event.interface.d.ts +2 -2
  35. package/dist/es2015/models/models.d.ts +5 -1
  36. package/dist/es2015/models/models.js +1 -0
  37. package/dist/es2015/models/toolbar-settings.d.ts +29 -0
  38. package/dist/es2015/models/{toolbar-position.js → toolbar-settings.js} +0 -0
  39. package/dist/es2015/package-metadata.js +1 -1
  40. package/dist/es2015/rendering/gantt-tasks-table-body.component.js +2 -2
  41. package/dist/es2015/timeline/timeline-base-view.service.d.ts +12 -0
  42. package/dist/es2015/timeline/timeline-base-view.service.js +12 -3
  43. package/dist/es2015/toolbar/toolbar-template.directive.d.ts +1 -1
  44. package/dist/es2015/toolbar/toolbar.component.d.ts +2 -0
  45. package/dist/es2015/toolbar/toolbar.component.js +10 -0
  46. package/dist/fesm2015/index.js +334 -45
  47. package/dist/fesm5/index.js +257 -46
  48. package/dist/npm/editing/add-task.component.js +96 -0
  49. package/dist/npm/editing/edit.service.js +1 -0
  50. package/dist/npm/expanded-state/expandable.directive.js +3 -5
  51. package/dist/npm/gantt.component.js +68 -20
  52. package/dist/npm/gantt.module.js +2 -2
  53. package/dist/npm/index.js +4 -2
  54. package/dist/npm/localization/messages.js +45 -1
  55. package/dist/npm/models/events/{add-event.interface.js → task-add-event.interface.js} +0 -0
  56. package/dist/npm/models/models.js +2 -0
  57. package/dist/npm/models/{toolbar-position.js → toolbar-settings.js} +0 -0
  58. package/dist/npm/package-metadata.js +1 -1
  59. package/dist/npm/rendering/gantt-tasks-table-body.component.js +1 -1
  60. package/dist/npm/timeline/timeline-base-view.service.js +17 -8
  61. package/dist/npm/toolbar/toolbar.component.js +9 -1
  62. package/dist/systemjs/kendo-angular-gantt.js +1 -1
  63. package/package.json +3 -3
  64. package/dist/es/localization/treelist-messages.directive.js +0 -31
  65. package/dist/es2015/localization/treelist-messages.directive.d.ts +0 -14
  66. package/dist/es2015/localization/treelist-messages.directive.js +0 -29
  67. package/dist/es2015/models/events/add-event.interface.d.ts +0 -16
  68. package/dist/es2015/models/toolbar-position.d.ts +0 -9
  69. package/dist/npm/localization/treelist-messages.directive.js +0 -33
@@ -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 };
@@ -4,6 +4,7 @@
4
4
  *-------------------------------------------------------------------------------------------*/
5
5
  import { FormGroup } from '@angular/forms';
6
6
  import { Subject } from 'rxjs';
7
+ import { TaskAddEvent } from '../models/events/task-add-event.interface';
7
8
  import { EditEvent, EditResultType } from '../models/events/task-edit-event.interface';
8
9
  /**
9
10
  * @hidden
@@ -12,8 +13,10 @@ export declare class EditService {
12
13
  showEditingDialog: Subject<boolean>;
13
14
  showConfirmationDialog: Subject<any>;
14
15
  editEvent: Subject<EditEvent>;
16
+ addEvent: Subject<TaskAddEvent>;
15
17
  formGroup: FormGroup;
16
18
  dataItem: any;
19
+ getSelectedItem: () => any;
17
20
  createEditDialog(dataItem: any, formGroup: FormGroup): void;
18
21
  closeEditDialog(): void;
19
22
  triggerEditEvent(editResultType: EditResultType): void;
@@ -16,6 +16,7 @@ let EditService = class EditService {
16
16
  this.showEditingDialog = new Subject();
17
17
  this.showConfirmationDialog = new Subject();
18
18
  this.editEvent = new Subject();
19
+ this.addEvent = new Subject();
19
20
  }
20
21
  createEditDialog(dataItem, formGroup) {
21
22
  this.dataItem = dataItem;
@@ -2,7 +2,7 @@
2
2
  * Copyright © 2021 Progress Software Corporation. All rights reserved.
3
3
  * Licensed under commercial license. See LICENSE.md in the project root for more information
4
4
  *-------------------------------------------------------------------------------------------*/
5
- import { ExpandableDirective, ExpandableTreeComponent } from '@progress/kendo-angular-treelist';
5
+ import { ExpandableDirective } from '@progress/kendo-angular-treelist';
6
6
  /**
7
7
  * A directive which controls the expanded state of the items.
8
8
  */
@@ -14,5 +14,4 @@ export declare class GanttExpandableDirective extends ExpandableDirective {
14
14
  *
15
15
  */
16
16
  expandBy: string | ((dataItem: any) => any);
17
- constructor(gantt: ExpandableTreeComponent);
18
17
  }
@@ -4,15 +4,11 @@
4
4
  *-------------------------------------------------------------------------------------------*/
5
5
  import * as tslib_1 from "tslib";
6
6
  import { Directive, Input } from '@angular/core';
7
- import { ExpandableDirective, ExpandableTreeComponent } from '@progress/kendo-angular-treelist';
7
+ import { ExpandableDirective } from '@progress/kendo-angular-treelist';
8
8
  /**
9
9
  * A directive which controls the expanded state of the items.
10
10
  */
11
11
  let GanttExpandableDirective = class GanttExpandableDirective extends ExpandableDirective {
12
- // fixes an injection error in some builds/ng-versions (e.g. StackBlitz)
13
- constructor(gantt) {
14
- super(gantt);
15
- }
16
12
  };
17
13
  tslib_1.__decorate([
18
14
  Input(),
@@ -22,7 +18,6 @@ GanttExpandableDirective = tslib_1.__decorate([
22
18
  Directive({
23
19
  exportAs: 'kendoGanttExpandable',
24
20
  selector: '[kendoGanttExpandable]'
25
- }),
26
- tslib_1.__metadata("design:paramtypes", [ExpandableTreeComponent])
21
+ })
27
22
  ], GanttExpandableDirective);
28
23
  export { GanttExpandableDirective };
@@ -24,12 +24,13 @@ import { GanttTaskTemplateDirective } from './template-directives/task-template.
24
24
  import { GanttSummaryTaskTemplateDirective } from './template-directives/summary-task-template.directive';
25
25
  import { GanttTaskContentTemplateDirective } from './template-directives/task-content-template.directive';
26
26
  import { ToolbarTemplateDirective } from './toolbar/toolbar-template.directive';
27
- import { ToolbarPosition } from './models/toolbar-position';
27
+ import { ToolbarSettings } from './models/toolbar-settings';
28
28
  import { ExpandEvent } from './expanded-state/expand-event';
29
29
  import { ViewBase } from './timeline/view-base';
30
30
  import { SelectionChangeEvent } from './selection/selection-change-event';
31
31
  import { TaskEditEvent } from './models/events/task-edit-event.interface';
32
32
  import { CellCloseEvent } from './models/events/cell-close-event.interface';
33
+ import { TaskAddEvent } from './models/events/task-add-event.interface';
33
34
  /**
34
35
  * Represents the Kendo UI Gantt component for Angular.
35
36
  *
@@ -109,7 +110,7 @@ export declare class GanttComponent implements AfterContentInit, OnChanges, OnDe
109
110
  private optionChangesService;
110
111
  private dependencyDomService;
111
112
  private editService;
112
- localizationService: LocalizationService;
113
+ private localizationService;
113
114
  private hostElement;
114
115
  private zone;
115
116
  treeList: TreeListComponent;
@@ -164,7 +165,7 @@ export declare class GanttComponent implements AfterContentInit, OnChanges, OnDe
164
165
  /**
165
166
  * Provides a callback that determines if the given task is selected ([see example]({% slug selection_gantt %}#toc-custom-selection))
166
167
  *
167
- * > The [`selectable`]({% slug gantt_api_ganttcomponent %}#toc-selectable) prop has to be set to `true` in order for this callback to be executed.
168
+ * > The [`selectable`]({% slug api_gantt_ganttcomponent %}#toc-selectable) prop has to be set to `true` in order for this callback to be executed.
168
169
  */
169
170
  isSelected: (dataItem: object) => boolean;
170
171
  /**
@@ -178,21 +179,24 @@ export declare class GanttComponent implements AfterContentInit, OnChanges, OnDe
178
179
  /**
179
180
  * Enables or disables the Gantt selection mechanism ([see example]({% slug selection_gantt %}#toc-custom-selection)).
180
181
  *
181
- * > When set to `true`, the [`isSelected`]({% slug gantt_api_ganttcomponent %}#toc-isselected) callback has to be provided.
182
+ * > When set to `true`, the [`isSelected`]({% slug api_gantt_ganttcomponent %}#toc-isselected) callback has to be provided.
182
183
  * > When applied, the [`SelectableDirective`]({% slug api_gantt_selectabledirective %}) sets `selectable` to `true` internally.
183
184
  */
184
185
  selectable: boolean;
185
186
  /**
186
- * The position of the toolbar.
187
+ * The toolbar configuration. Defines the position and content of the toolbar(s).
188
+ * The available properties are `position`, `addTaskTool`, and `viewSelectorTool`.
189
+ * All are optional and default to `top`.
187
190
  *
188
- * The possible values are:
189
- * - `top`&mdash;Positions the toolbar above the Gantt panes.
190
- * - `bottom`&mdash;Positions the toolbar below the Gantt panes.
191
+ * The possible values for each option are:
192
+ * - `top`&mdash;Positions the toolbar above the Gantt panes. Renders the respective tool in the top toolbar.
193
+ * - `bottom`&mdash;Positions the toolbar below the Gantt panes. Renders the respective tool in the bottom toolbar.
191
194
  * - `both`&mdash;Displays two toolbar instances. Positions the first one above,
192
- * and the second one - below the Gantt panes.
193
- * - `none`&mdash;No toolbar is rendered.
195
+ * and the second one - below the Gantt panes. Renders the respective tool in the both toolbars.
196
+ * - `none`&mdash;No toolbar is rendered when used for setting `position`.
197
+ * No add task or view selector tool is rendered when used for setting `addTaskTool` or `viewSelectorTool`.
194
198
  */
195
- toolbarPosition: ToolbarPosition;
199
+ toolbarSettings: ToolbarSettings;
196
200
  /**
197
201
  * Gets or sets the callback function that retrieves the child items for a particular item.
198
202
  */
@@ -335,6 +339,10 @@ export declare class GanttComponent implements AfterContentInit, OnChanges, OnDe
335
339
  * Fires when the user saves an edited task.
336
340
  */
337
341
  save: EventEmitter<TaskEditEvent>;
342
+ /**
343
+ * Fires when the user adds a task.
344
+ */
345
+ taskAdd: EventEmitter<TaskAddEvent>;
338
346
  /**
339
347
  * Fires when the sorting of the Gantt is changed.
340
348
  * You have to handle the event yourself and sort the data.
@@ -460,6 +468,7 @@ export declare class GanttComponent implements AfterContentInit, OnChanges, OnDe
460
468
  private _rowClass;
461
469
  private _taskClass;
462
470
  private _activeView;
471
+ private _toolbarSettings;
463
472
  private lastTreeListCellClick;
464
473
  private direction;
465
474
  private rtl;
@@ -503,7 +512,10 @@ export declare class GanttComponent implements AfterContentInit, OnChanges, OnDe
503
512
  */
504
513
  reorderColumn(source: GanttColumnBase, destIndex: number, options?: ColumnReorderConfig): void;
505
514
  /**
506
- * Updates the data of the Gantt and forces row-related callbacks to be called anew.
515
+ * Forces the TreeList to evaluate if some data items have changed and re-renders the rows information, if needed.
516
+ * Recalculates and re-renders the Timeline period, if needed.
517
+ * Redraws changed dependencies, if needed.
518
+ * Executes all row-related callbacks anew.
507
519
  */
508
520
  updateView(): void;
509
521
  /**
@@ -600,4 +612,5 @@ export declare class GanttComponent implements AfterContentInit, OnChanges, OnDe
600
612
  private getActiveViewOptions;
601
613
  private isSameSelection;
602
614
  private getSelectionAction;
615
+ private getFirstSelectedItem;
603
616
  }
@@ -120,7 +120,7 @@ let GanttComponent = GanttComponent_1 = class GanttComponent {
120
120
  /**
121
121
  * Provides a callback that determines if the given task is selected ([see example]({% slug selection_gantt %}#toc-custom-selection))
122
122
  *
123
- * > The [`selectable`]({% slug gantt_api_ganttcomponent %}#toc-selectable) prop has to be set to `true` in order for this callback to be executed.
123
+ * > The [`selectable`]({% slug api_gantt_ganttcomponent %}#toc-selectable) prop has to be set to `true` in order for this callback to be executed.
124
124
  */
125
125
  this.isSelected = isSelected;
126
126
  /**
@@ -134,21 +134,10 @@ let GanttComponent = GanttComponent_1 = class GanttComponent {
134
134
  /**
135
135
  * Enables or disables the Gantt selection mechanism ([see example]({% slug selection_gantt %}#toc-custom-selection)).
136
136
  *
137
- * > When set to `true`, the [`isSelected`]({% slug gantt_api_ganttcomponent %}#toc-isselected) callback has to be provided.
137
+ * > When set to `true`, the [`isSelected`]({% slug api_gantt_ganttcomponent %}#toc-isselected) callback has to be provided.
138
138
  * > When applied, the [`SelectableDirective`]({% slug api_gantt_selectabledirective %}) sets `selectable` to `true` internally.
139
139
  */
140
140
  this.selectable = false;
141
- /**
142
- * The position of the toolbar.
143
- *
144
- * The possible values are:
145
- * - `top`&mdash;Positions the toolbar above the Gantt panes.
146
- * - `bottom`&mdash;Positions the toolbar below the Gantt panes.
147
- * - `both`&mdash;Displays two toolbar instances. Positions the first one above,
148
- * and the second one - below the Gantt panes.
149
- * - `none`&mdash;No toolbar is rendered.
150
- */
151
- this.toolbarPosition = 'top';
152
141
  /**
153
142
  * Gets or sets the callback function that retrieves the child items for a particular item.
154
143
  */
@@ -258,6 +247,10 @@ let GanttComponent = GanttComponent_1 = class GanttComponent {
258
247
  * Fires when the user saves an edited task.
259
248
  */
260
249
  this.save = new EventEmitter();
250
+ /**
251
+ * Fires when the user adds a task.
252
+ */
253
+ this.taskAdd = new EventEmitter();
261
254
  /**
262
255
  * Fires when the sorting of the Gantt is changed.
263
256
  * You have to handle the event yourself and sort the data.
@@ -335,6 +328,11 @@ let GanttComponent = GanttComponent_1 = class GanttComponent {
335
328
  this._rowClass = rowClassCallback;
336
329
  this._taskClass = taskClassCallback;
337
330
  this._activeView = DEFAULT_VIEW;
331
+ this._toolbarSettings = {
332
+ position: 'top',
333
+ addTaskTool: 'none',
334
+ viewSelectorTool: 'top'
335
+ };
338
336
  this.rtl = false;
339
337
  this.optionChangesSubscriptions = new Subscription();
340
338
  this.editServiceSubscription = new Subscription();
@@ -345,6 +343,7 @@ let GanttComponent = GanttComponent_1 = class GanttComponent {
345
343
  this.optionChangesSubscriptions.add(this.optionChangesService.columnChanges.subscribe(() => {
346
344
  this.treeList.columns.notifyOnChanges();
347
345
  }));
346
+ this.editService.getSelectedItem = this.getFirstSelectedItem.bind(this);
348
347
  this.editServiceSubscription.add(this.editService.showEditingDialog.subscribe(show => this.showEditingDialog = show));
349
348
  this.editServiceSubscription.add(this.editService.showConfirmationDialog.subscribe(() => this.taskDelete.emit()));
350
349
  this.editServiceSubscription.add(this.editService.editEvent.subscribe(args => {
@@ -356,7 +355,14 @@ let GanttComponent = GanttComponent_1 = class GanttComponent {
356
355
  this.showConfirmationDialog = this.showEditingDialog = false;
357
356
  this.editService.dataItem = this.editService.formGroup = null;
358
357
  this.updateView();
359
- this.dependencyDomService.notifyChanges();
358
+ }));
359
+ this.editServiceSubscription.add(this.editService.addEvent.subscribe(args => {
360
+ const selectedItem = this.getFirstSelectedItem();
361
+ this.taskAdd.emit({
362
+ actionType: args.actionType,
363
+ selectedItem: selectedItem ? getEditItem(selectedItem, this.treeList.view.data, this.mapper) : null
364
+ });
365
+ this.updateView();
360
366
  }));
361
367
  this.localizationSubscription = this.localizationService.changes.subscribe(({ rtl }) => {
362
368
  this.rtl = rtl;
@@ -431,6 +437,29 @@ let GanttComponent = GanttComponent_1 = class GanttComponent {
431
437
  get data() {
432
438
  return this._data;
433
439
  }
440
+ /**
441
+ * The toolbar configuration. Defines the position and content of the toolbar(s).
442
+ * The available properties are `position`, `addTaskTool`, and `viewSelectorTool`.
443
+ * All are optional and default to `top`.
444
+ *
445
+ * The possible values for each option are:
446
+ * - `top`&mdash;Positions the toolbar above the Gantt panes. Renders the respective tool in the top toolbar.
447
+ * - `bottom`&mdash;Positions the toolbar below the Gantt panes. Renders the respective tool in the bottom toolbar.
448
+ * - `both`&mdash;Displays two toolbar instances. Positions the first one above,
449
+ * and the second one - below the Gantt panes. Renders the respective tool in the both toolbars.
450
+ * - `none`&mdash;No toolbar is rendered when used for setting `position`.
451
+ * No add task or view selector tool is rendered when used for setting `addTaskTool` or `viewSelectorTool`.
452
+ */
453
+ set toolbarSettings(value) {
454
+ this._toolbarSettings = {
455
+ position: value.position || 'top',
456
+ addTaskTool: value.addTaskTool || 'none',
457
+ viewSelectorTool: value.viewSelectorTool || 'top'
458
+ };
459
+ }
460
+ get toolbarSettings() {
461
+ return this._toolbarSettings;
462
+ }
434
463
  /**
435
464
  * The options of the timeline splitter pane. By default the pane is `collapsible`,
436
465
  * `resizable`, not `collapsed`, and its `size` is `'50%'`.
@@ -615,12 +644,17 @@ let GanttComponent = GanttComponent_1 = class GanttComponent {
615
644
  }
616
645
  }
617
646
  /**
618
- * Updates the data of the Gantt and forces row-related callbacks to be called anew.
647
+ * Forces the TreeList to evaluate if some data items have changed and re-renders the rows information, if needed.
648
+ * Recalculates and re-renders the Timeline period, if needed.
649
+ * Redraws changed dependencies, if needed.
650
+ * Executes all row-related callbacks anew.
619
651
  */
620
652
  updateView() {
621
653
  if (isPresent(this.treeList)) {
622
654
  this.treeList.updateView();
623
655
  }
656
+ this.loadTimelineData();
657
+ this.dependencyDomService.notifyChanges();
624
658
  }
625
659
  /**
626
660
  * Opens the task editing dialog.
@@ -700,7 +734,7 @@ let GanttComponent = GanttComponent_1 = class GanttComponent {
700
734
  * @hidden
701
735
  */
702
736
  showToolbar(position) {
703
- return this.toolbarPosition !== 'none' && ([position, 'both'].indexOf(this.toolbarPosition) > -1);
737
+ return this.toolbarSettings.position !== 'none' && ([position, 'both'].indexOf(this.toolbarSettings.position) > -1);
704
738
  }
705
739
  /**
706
740
  * @hidden
@@ -864,7 +898,7 @@ let GanttComponent = GanttComponent_1 = class GanttComponent {
864
898
  items: [dataItem],
865
899
  sender: this
866
900
  });
867
- this.updateView();
901
+ this.treeList.updateView();
868
902
  }
869
903
  updateTreeListGroupClass(columns = this.columns) {
870
904
  if (!isPresent(this.treeList)) {
@@ -899,6 +933,11 @@ let GanttComponent = GanttComponent_1 = class GanttComponent {
899
933
  const shouldToggleSelection = ctrlKey || metaKey;
900
934
  return (shouldToggleSelection && this.isSelected(dataItem)) ? 'remove' : 'select';
901
935
  }
936
+ getFirstSelectedItem() {
937
+ const isSelectedCallback = this.isSelected || isSelected;
938
+ const loadedItems = this.renderedTreeListItems || [];
939
+ return loadedItems.find(isSelectedCallback);
940
+ }
902
941
  };
903
942
  tslib_1.__decorate([
904
943
  ViewChild(TreeListComponent, { static: true }),
@@ -972,8 +1011,9 @@ tslib_1.__decorate([
972
1011
  ], GanttComponent.prototype, "selectable", void 0);
973
1012
  tslib_1.__decorate([
974
1013
  Input(),
975
- tslib_1.__metadata("design:type", String)
976
- ], GanttComponent.prototype, "toolbarPosition", void 0);
1014
+ tslib_1.__metadata("design:type", Object),
1015
+ tslib_1.__metadata("design:paramtypes", [Object])
1016
+ ], GanttComponent.prototype, "toolbarSettings", null);
977
1017
  tslib_1.__decorate([
978
1018
  Input(),
979
1019
  tslib_1.__metadata("design:type", Function)
@@ -1094,6 +1134,10 @@ tslib_1.__decorate([
1094
1134
  Output(),
1095
1135
  tslib_1.__metadata("design:type", EventEmitter)
1096
1136
  ], GanttComponent.prototype, "save", void 0);
1137
+ tslib_1.__decorate([
1138
+ Output(),
1139
+ tslib_1.__metadata("design:type", EventEmitter)
1140
+ ], GanttComponent.prototype, "taskAdd", void 0);
1097
1141
  tslib_1.__decorate([
1098
1142
  Output(),
1099
1143
  tslib_1.__metadata("design:type", EventEmitter)
@@ -1172,6 +1216,27 @@ GanttComponent = GanttComponent_1 = tslib_1.__decorate([
1172
1216
  ],
1173
1217
  template: `
1174
1218
  <ng-container kendoGanttLocalizedMessages
1219
+ i18n-taskEditingGeneralTabTitle="kendo.gantt.taskEditingGeneralTabTitle|The title of the 'General' tab of the editing dialog TabStrip"
1220
+ taskEditingGeneralTabTitle="General"
1221
+
1222
+ i18n-taskEditingPredecessorsTabTitle="kendo.gantt.taskEditingPredecessorsTabTitle|The title of the 'Predecessors' dependencies tab of the editing dialog TabStrip"
1223
+ taskEditingPredecessorsTabTitle="Predecessors"
1224
+
1225
+ i18n-taskEditingSuccessorsTabTitle="kendo.gantt.taskEditingSuccessorsTabTitle|The title of the 'Successors' dependencies tab of the editing dialog TabStrip"
1226
+ taskEditingSuccessorsTabTitle="Successors"
1227
+
1228
+ i18n-taskEditingDependenciesAddButtonText="kendo.gantt.taskEditingDependenciesAddButtonText|The text of the 'Add' button in the dependencies tabs of the editing dialog TabStrip"
1229
+ taskEditingDependenciesAddButtonText="Add"
1230
+
1231
+ i18n-taskEditingDependenciesRemoveButtonText="kendo.gantt.taskEditingDependenciesRemoveButtonText|The text of the 'Remove' button in the dependencies tabs of the editing dialog TabStrip"
1232
+ taskEditingDependenciesRemoveButtonText="Remove"
1233
+
1234
+ i18n-taskEditingDependenciesGridNameColumnTitle="kendo.gantt.taskEditingDependenciesGridNameColumnTitle|The title of the 'Task Title' Grid column in the dependencies tabs of the editing dialog TabStrip"
1235
+ taskEditingDependenciesGridNameColumnTitle="Task Title"
1236
+
1237
+ i18n-taskEditingDependenciesGridTypeColumnTitle="kendo.gantt.taskEditingDependenciesGridTypeColumnTitle|The title of the 'Type' Grid column in the dependencies tabs of the editing dialog TabStrip"
1238
+ taskEditingDependenciesGridTypeColumnTitle="Type"
1239
+
1175
1240
  i18n-taskDeleteLabel="kendo.gantt.taskDeleteLabel|The label of the task delete icon"
1176
1241
  taskDeleteLabel="Delete"
1177
1242
 
@@ -1223,6 +1288,18 @@ GanttComponent = GanttComponent_1 = tslib_1.__decorate([
1223
1288
  i18n-yearViewText-disabled="kendo.gantt.yearViewText|The text of the year view in the ViewSelector component"
1224
1289
  yearViewText="Year"
1225
1290
 
1291
+ i18n-addTaskText="kendo.gantt.addTaskText|The text of the DropDownButton in the AddTask component"
1292
+ addTaskText="Add Task"
1293
+
1294
+ i18n-addChildText="kendo.gantt.addChildText|The text of the 'Add Child' option in the AddTask component"
1295
+ addChildText="Add Child"
1296
+
1297
+ i18n-addAboveText="kendo.gantt.addAboveText|The text of the 'Add Above' option in the AddTask component"
1298
+ addAboveText="Add Above"
1299
+
1300
+ i18n-addBelowText="kendo.gantt.addBelowText|The text of the 'Add Below' option in the AddTask component"
1301
+ addBelowText="Add Below"
1302
+
1226
1303
  i18n-noRecords="kendo.gantt.noRecords|The label visible in the TreeList when there are no records"
1227
1304
  noRecords="No records available."
1228
1305
 
@@ -1344,6 +1421,8 @@ GanttComponent = GanttComponent_1 = tslib_1.__decorate([
1344
1421
  columnsReset="Reset"></ng-container>
1345
1422
  <kendo-gantt-toolbar
1346
1423
  *ngIf="showToolbar('top')"
1424
+ [showAddTask]="toolbarSettings.addTaskTool === 'top' || toolbarSettings.addTaskTool === 'both'"
1425
+ [showViewSelector]="toolbarSettings.viewSelectorTool === 'top' || toolbarSettings.viewSelectorTool === 'both'"
1347
1426
  class="k-gantt-header k-toolbar k-gantt-toolbar"
1348
1427
  position="top"></kendo-gantt-toolbar>
1349
1428
  <div class="k-gantt-content">
@@ -1393,7 +1472,47 @@ GanttComponent = GanttComponent_1 = tslib_1.__decorate([
1393
1472
  }"
1394
1473
  [scope]="this"
1395
1474
  >
1396
- <kendo-treelist-messages [kendoGanttTreeListMessages]="localizationService"></kendo-treelist-messages>
1475
+ <kendo-treelist-messages
1476
+ [noRecords]="getText('noRecords')"
1477
+ [filter]="getText('filter')"
1478
+ [filterEqOperator]="getText('filterEqOperator')"
1479
+ [filterNotEqOperator]="getText('filterNotEqOperator')"
1480
+ [filterIsNullOperator]="getText('filterIsNullOperator')"
1481
+ [filterIsNotNullOperator]="getText('filterIsNotNullOperator')"
1482
+ [filterIsEmptyOperator]="getText('filterIsEmptyOperator')"
1483
+ [filterIsNotEmptyOperator]="getText('filterIsNotEmptyOperator')"
1484
+ [filterStartsWithOperator]="getText('filterStartsWithOperator')"
1485
+ [filterContainsOperator]="getText('filterContainsOperator')"
1486
+ [filterNotContainsOperator]="getText('filterNotContainsOperator')"
1487
+ [filterEndsWithOperator]="getText('filterEndsWithOperator')"
1488
+ [filterGteOperator]="getText('filterGteOperator')"
1489
+ [filterGtOperator]="getText('filterGtOperator')"
1490
+ [filterLteOperator]="getText('filterLteOperator')"
1491
+ [filterLtOperator]="getText('filterLtOperator')"
1492
+ [filterIsTrue]="getText('filterIsTrue')"
1493
+ [filterIsFalse]="getText('filterIsFalse')"
1494
+ [filterBooleanAll]="getText('filterBooleanAll')"
1495
+ [filterAfterOrEqualOperator]="getText('filterAfterOrEqualOperator')"
1496
+ [filterAfterOperator]="getText('filterAfterOperator')"
1497
+ [filterBeforeOperator]="getText('filterBeforeOperator')"
1498
+ [filterBeforeOrEqualOperator]="getText('filterBeforeOrEqualOperator')"
1499
+ [filterFilterButton]="getText('filterFilterButton')"
1500
+ [filterClearButton]="getText('filterClearButton')"
1501
+ [filterAndLogic]="getText('filterAndLogic')"
1502
+ [filterOrLogic]="getText('filterOrLogic')"
1503
+ [loading]="getText('loading')"
1504
+ [columnMenu]="getText('columnMenu')"
1505
+ [columns]="getText('columns')"
1506
+ [sortable]="getText('sortable')"
1507
+ [sortAscending]="getText('sortAscending')"
1508
+ [sortDescending]="getText('sortDescending')"
1509
+ [sortedAscending]="getText('sortedAscending')"
1510
+ [sortedDescending]="getText('sortedDescending')"
1511
+ [sortedDefault]="getText('sortedDefault')"
1512
+ [columnsApply]="getText('columnsApply')"
1513
+ [columnsReset]="getText('columnsReset')"
1514
+ >
1515
+ </kendo-treelist-messages>
1397
1516
  </kendo-treelist>
1398
1517
  </kendo-splitter-pane>
1399
1518
  <kendo-splitter-pane
@@ -1433,6 +1552,8 @@ GanttComponent = GanttComponent_1 = tslib_1.__decorate([
1433
1552
  </div>
1434
1553
  <kendo-gantt-toolbar
1435
1554
  *ngIf="showToolbar('bottom')"
1555
+ [showAddTask]="toolbarSettings.addTaskTool === 'bottom' || toolbarSettings.addTaskTool === 'both'"
1556
+ [showViewSelector]="toolbarSettings.viewSelectorTool === 'bottom' || toolbarSettings.viewSelectorTool === 'both'"
1436
1557
  class="k-gantt-footer k-toolbar k-gantt-toolbar"
1437
1558
  position="bottom"></kendo-gantt-toolbar>
1438
1559
  <kendo-gantt-edit-dialog *ngIf="showEditingDialog" [formGroup]="editDialogFormGroup"></kendo-gantt-edit-dialog>
@@ -40,7 +40,7 @@ import { DateInputsModule } from '@progress/kendo-angular-dateinputs';
40
40
  import { CustomMessagesComponent } from './localization/custom-messages.component';
41
41
  import { L10N_PREFIX } from '@progress/kendo-angular-l10n';
42
42
  import { LocalizedMessagesDirective } from './localization/localized-messages.directive';
43
- import { GanttTreeListMessagesDirective } from './localization/treelist-messages.directive';
43
+ import { GanttAddTaskComponent } from './editing/add-task.component';
44
44
  const IMPORTED_MODULES = [
45
45
  CommonModule,
46
46
  ReactiveFormsModule,
@@ -89,7 +89,7 @@ const DECLARATIONS = [
89
89
  EditDialogComponent,
90
90
  CustomMessagesComponent,
91
91
  LocalizedMessagesDirective,
92
- GanttTreeListMessagesDirective
92
+ GanttAddTaskComponent
93
93
  ];
94
94
  /**
95
95
  * Represents the [NgModule]({{ site.data.urls.angular['ngmoduleapi'] }})
@@ -10,12 +10,13 @@ export { MappingService } from './common/mapping.service';
10
10
  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
+ export { GanttAddTaskComponent } from './editing/add-task.component';
13
14
  export { EditDialogComponent } from './editing/edit-dialog.component';
14
15
  export { EditService } from './editing/edit.service';
15
16
  export { CustomMessagesComponent } from './localization/custom-messages.component';
16
17
  export { LocalizedMessagesDirective } from './localization/localized-messages.directive';
17
18
  export { Messages } from './localization/messages';
18
- export { GanttTreeListMessagesDirective } from './localization/treelist-messages.directive';
19
+ export { PreventableEvent } from './models/events/preventable-event';
19
20
  export { GanttHeaderTableBodyComponent } from './rendering/gantt-header-table-body.component';
20
21
  export { GanttMilestoneTaskComponent } from './rendering/gantt-milestone-task.component';
21
22
  export { GanttSummaryTaskComponent } from './rendering/gantt-summary-task.component';