@progress/kendo-angular-gantt 0.1.4-dev.202109301203 → 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.
Files changed (116) hide show
  1. package/dist/cdn/js/kendo-angular-gantt.js +2 -76
  2. package/dist/cdn/main.js +23 -1
  3. package/dist/es/columns/column.component.js +5 -0
  4. package/dist/es/columns/columns.js +1 -0
  5. package/dist/es/columns/edit-template.directive.js +34 -0
  6. package/dist/es/columns/span-column.component.js +6 -0
  7. package/dist/es/editing/edit-dialog.component.js +44 -0
  8. package/dist/es/editing/edit.service.js +39 -0
  9. package/dist/es/editing/util.js +17 -0
  10. package/dist/es/gantt.component.js +309 -8
  11. package/dist/es/gantt.module.js +60 -5
  12. package/dist/es/index.js +6 -0
  13. package/dist/es/localization/custom-messages.component.js +44 -0
  14. package/dist/es/localization/localized-messages.directive.js +35 -0
  15. package/dist/es/localization/messages.js +246 -0
  16. package/dist/es/localization/treelist-messages.directive.js +31 -0
  17. package/dist/es/models/events/cell-click-event.interface.js +4 -0
  18. package/dist/es/models/events/cell-close-event.interface.js +19 -0
  19. package/dist/es/models/events/preventable-event.js +32 -0
  20. package/dist/es/models/events/task-click-event.interface.js +4 -0
  21. package/dist/es/models/events/task-edit-event.interface.js +4 -0
  22. package/dist/es/models/gantt-task-model-fields.interface.js +2 -1
  23. package/dist/es/package-metadata.js +1 -1
  24. package/dist/es/rendering/gantt-milestone-task.component.js +1 -1
  25. package/dist/es/rendering/gantt-summary-task.component.js +1 -1
  26. package/dist/es/rendering/gantt-task-base.js +4 -0
  27. package/dist/es/rendering/gantt-task.component.js +12 -4
  28. package/dist/es/rendering/gantt-tasks-table-body.component.js +5 -1
  29. package/dist/es/toolbar/view-selector.component.js +7 -4
  30. package/dist/es/utils.js +44 -1
  31. package/dist/es2015/columns/column.component.d.ts +2 -0
  32. package/dist/es2015/columns/column.component.js +5 -0
  33. package/dist/es2015/columns/columns.d.ts +1 -0
  34. package/dist/es2015/columns/columns.js +1 -0
  35. package/dist/es2015/columns/edit-template.directive.d.ts +23 -0
  36. package/dist/es2015/columns/edit-template.directive.js +33 -0
  37. package/dist/es2015/columns/span-column.component.d.ts +2 -0
  38. package/dist/es2015/columns/span-column.component.js +6 -0
  39. package/dist/es2015/editing/edit-dialog.component.d.ts +21 -0
  40. package/dist/es2015/editing/edit-dialog.component.js +86 -0
  41. package/dist/es2015/editing/edit.service.d.ts +20 -0
  42. package/dist/es2015/editing/edit.service.js +41 -0
  43. package/dist/es2015/editing/util.d.ts +10 -0
  44. package/dist/es2015/editing/util.js +17 -0
  45. package/dist/es2015/gantt.component.d.ts +180 -4
  46. package/dist/es2015/gantt.component.js +492 -8
  47. package/dist/es2015/gantt.module.d.ts +29 -1
  48. package/dist/es2015/gantt.module.js +60 -5
  49. package/dist/es2015/index.d.ts +6 -0
  50. package/dist/es2015/index.js +6 -0
  51. package/dist/es2015/index.metadata.json +1 -1
  52. package/dist/es2015/localization/custom-messages.component.d.ts +15 -0
  53. package/dist/es2015/localization/custom-messages.component.js +36 -0
  54. package/dist/es2015/localization/localized-messages.directive.d.ts +13 -0
  55. package/dist/es2015/localization/localized-messages.directive.js +31 -0
  56. package/dist/es2015/localization/messages.d.ts +246 -0
  57. package/dist/es2015/localization/messages.js +240 -0
  58. package/dist/es2015/localization/treelist-messages.directive.d.ts +14 -0
  59. package/dist/es2015/localization/treelist-messages.directive.js +29 -0
  60. package/dist/es2015/models/events/cell-click-event.interface.d.ts +20 -0
  61. package/dist/es2015/models/events/cell-click-event.interface.js +4 -0
  62. package/dist/es2015/models/events/cell-close-event.interface.d.ts +48 -0
  63. package/dist/es2015/models/events/cell-close-event.interface.js +14 -0
  64. package/dist/es2015/models/events/preventable-event.d.ts +24 -0
  65. package/dist/es2015/models/events/preventable-event.js +30 -0
  66. package/dist/es2015/models/events/task-click-event.interface.d.ts +22 -0
  67. package/dist/es2015/models/events/task-click-event.interface.js +4 -0
  68. package/dist/es2015/models/events/task-edit-event.interface.d.ts +46 -0
  69. package/dist/es2015/models/events/task-edit-event.interface.js +4 -0
  70. package/dist/es2015/models/gantt-task-model-fields.interface.d.ts +1 -0
  71. package/dist/es2015/models/gantt-task-model-fields.interface.js +2 -1
  72. package/dist/es2015/package-metadata.js +1 -1
  73. package/dist/es2015/rendering/gantt-milestone-task.component.js +1 -0
  74. package/dist/es2015/rendering/gantt-summary-task.component.js +1 -0
  75. package/dist/es2015/rendering/gantt-task-base.d.ts +1 -0
  76. package/dist/es2015/rendering/gantt-task-base.js +4 -0
  77. package/dist/es2015/rendering/gantt-task.component.d.ts +4 -1
  78. package/dist/es2015/rendering/gantt-task.component.js +17 -2
  79. package/dist/es2015/rendering/gantt-tasks-table-body.component.d.ts +1 -0
  80. package/dist/es2015/rendering/gantt-tasks-table-body.component.js +8 -1
  81. package/dist/es2015/toolbar/view-selector.component.d.ts +3 -0
  82. package/dist/es2015/toolbar/view-selector.component.js +7 -7
  83. package/dist/es2015/utils.d.ts +34 -0
  84. package/dist/es2015/utils.js +44 -1
  85. package/dist/fesm2015/index.js +1080 -23
  86. package/dist/fesm5/index.js +865 -24
  87. package/dist/npm/columns/column.component.js +5 -0
  88. package/dist/npm/columns/columns.js +2 -0
  89. package/dist/npm/columns/edit-template.directive.js +36 -0
  90. package/dist/npm/columns/span-column.component.js +6 -0
  91. package/dist/npm/editing/edit-dialog.component.js +46 -0
  92. package/dist/npm/editing/edit.service.js +41 -0
  93. package/dist/npm/editing/util.js +19 -0
  94. package/dist/npm/gantt.component.js +306 -5
  95. package/dist/npm/gantt.module.js +59 -4
  96. package/dist/npm/index.js +12 -0
  97. package/dist/npm/localization/custom-messages.component.js +46 -0
  98. package/dist/npm/localization/localized-messages.directive.js +37 -0
  99. package/dist/npm/localization/messages.js +248 -0
  100. package/dist/npm/localization/treelist-messages.directive.js +33 -0
  101. package/dist/npm/models/events/cell-click-event.interface.js +6 -0
  102. package/dist/npm/models/events/cell-close-event.interface.js +21 -0
  103. package/dist/npm/models/events/preventable-event.js +34 -0
  104. package/dist/npm/models/events/task-click-event.interface.js +6 -0
  105. package/dist/npm/models/events/task-edit-event.interface.js +6 -0
  106. package/dist/npm/models/gantt-task-model-fields.interface.js +2 -1
  107. package/dist/npm/package-metadata.js +1 -1
  108. package/dist/npm/rendering/gantt-milestone-task.component.js +1 -1
  109. package/dist/npm/rendering/gantt-summary-task.component.js +1 -1
  110. package/dist/npm/rendering/gantt-task-base.js +4 -0
  111. package/dist/npm/rendering/gantt-task.component.js +12 -4
  112. package/dist/npm/rendering/gantt-tasks-table-body.component.js +5 -1
  113. package/dist/npm/toolbar/view-selector.component.js +7 -4
  114. package/dist/npm/utils.js +43 -0
  115. package/dist/systemjs/kendo-angular-gantt.js +1 -1
  116. package/package.json +15 -10
@@ -0,0 +1,48 @@
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 { GanttComponent } from '../../main';
6
+ import { PreventableEvent } from './preventable-event';
7
+ import { TaskEditItem } from './task-edit-event.interface';
8
+ /**
9
+ * Called every time a user leaves an edited cell.
10
+ */
11
+ export declare class CellCloseEvent extends PreventableEvent {
12
+ /**
13
+ * The data item.
14
+ */
15
+ dataItem: any;
16
+ /**
17
+ * Indicates if the data item is new or existing.
18
+ */
19
+ isNew: boolean;
20
+ /**
21
+ * The data row index for the operation.
22
+ */
23
+ rowIndex: number;
24
+ /**
25
+ * The Gantt column that will be closed.
26
+ */
27
+ column: any;
28
+ /**
29
+ * The [`FormGroup`]({{ site.data.urls.angular['formgroupapi'] }}) that is used to edit the cell which will be closed.
30
+ */
31
+ formGroup: any;
32
+ /**
33
+ * The DOM event that caused the `cellClose` event.
34
+ * May not be present if `cellClose` was caused by an API call.
35
+ */
36
+ originalEvent: any;
37
+ /**
38
+ * The `GanttComponent` instance.
39
+ */
40
+ sender: GanttComponent;
41
+ /**
42
+ * The `TaskEditItem` associated with the edited task.
43
+ * The parent item is accessible through the `parent` property,
44
+ * and allows traversing all ancestors that need to be updated.
45
+ */
46
+ item: TaskEditItem;
47
+ constructor(options: any);
48
+ }
@@ -0,0 +1,14 @@
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 { PreventableEvent } from './preventable-event';
6
+ /**
7
+ * Called every time a user leaves an edited cell.
8
+ */
9
+ export class CellCloseEvent extends PreventableEvent {
10
+ constructor(options) {
11
+ super();
12
+ Object.assign(this, options);
13
+ }
14
+ }
@@ -0,0 +1,24 @@
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 declare abstract class PreventableEvent {
9
+ private prevented;
10
+ /**
11
+ * Prevents the default action for a specified event.
12
+ * In this way, the source component suppresses
13
+ * the built-in behavior that follows the event.
14
+ */
15
+ preventDefault(): void;
16
+ /**
17
+ * Returns `true` if the event was prevented
18
+ * by any of its subscribers.
19
+ *
20
+ * @returns `true` if the default action was prevented.
21
+ * Otherwise, returns `false`.
22
+ */
23
+ isDefaultPrevented(): boolean;
24
+ }
@@ -0,0 +1,30 @@
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 class PreventableEvent {
9
+ constructor() {
10
+ this.prevented = false;
11
+ }
12
+ /**
13
+ * Prevents the default action for a specified event.
14
+ * In this way, the source component suppresses
15
+ * the built-in behavior that follows the event.
16
+ */
17
+ preventDefault() {
18
+ this.prevented = true;
19
+ }
20
+ /**
21
+ * Returns `true` if the event was prevented
22
+ * by any of its subscribers.
23
+ *
24
+ * @returns `true` if the default action was prevented.
25
+ * Otherwise, returns `false`.
26
+ */
27
+ isDefaultPrevented() {
28
+ return this.prevented;
29
+ }
30
+ }
@@ -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 { GanttComponent } from "../../gantt.component";
6
+ /**
7
+ * Triggered every time a task is double-clicked.
8
+ */
9
+ export interface TaskClickEvent {
10
+ /**
11
+ * The original DOM event.
12
+ */
13
+ originalEvent: MouseEvent;
14
+ /**
15
+ * The data item associated with the clicked task.
16
+ */
17
+ dataItem: any;
18
+ /**
19
+ * The Gantt component instance
20
+ */
21
+ sender: GanttComponent;
22
+ }
@@ -0,0 +1,4 @@
1
+ /**-----------------------------------------------------------------------------------------
2
+ * Copyright © 2021 Progress Software Corporation. All rights reserved.
3
+ * Licensed under commercial license. See LICENSE.md in the project root for more information
4
+ *-------------------------------------------------------------------------------------------*/
@@ -0,0 +1,46 @@
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 { GanttComponent } from "../../gantt.component";
7
+ /**
8
+ * The event data for the task editing events.
9
+ */
10
+ export interface TaskEditEvent {
11
+ /**
12
+ * The `TaskEditItem` associated with the edited task.
13
+ * The parent item is accessible through the `parent` property,
14
+ * and allows traversing all ancestors that need to be updated.
15
+ */
16
+ item: TaskEditItem;
17
+ /**
18
+ * The FormGroup instance associated with the edited task.
19
+ */
20
+ formGroup?: FormGroup;
21
+ /**
22
+ * The GanttComponent instance.
23
+ */
24
+ sender: GanttComponent;
25
+ }
26
+ /**
27
+ * The `TaskEditItem` associated with the edited task.
28
+ * The parent item is accessible through the `parent` property,
29
+ * and allows traversing all ancestors that need to be updated.
30
+ */
31
+ export declare type TaskEditItem = {
32
+ dataItem: any;
33
+ parent?: TaskEditItem;
34
+ };
35
+ /**
36
+ * @hidden
37
+ */
38
+ export declare type EditResultType = 'save' | 'remove' | 'cancel';
39
+ /**
40
+ * @hidden
41
+ */
42
+ export interface EditEvent {
43
+ formGroup: FormGroup;
44
+ dataItem: any;
45
+ editResultType: EditResultType;
46
+ }
@@ -0,0 +1,4 @@
1
+ /**-----------------------------------------------------------------------------------------
2
+ * Copyright © 2021 Progress Software Corporation. All rights reserved.
3
+ * Licensed under commercial license. See LICENSE.md in the project root for more information
4
+ *-------------------------------------------------------------------------------------------*/
@@ -34,6 +34,7 @@ export interface GanttTaskModelFields {
34
34
  * Defaults to `"title"`.
35
35
  */
36
36
  title?: string;
37
+ children?: string;
37
38
  }
38
39
  /**
39
40
  * @hidden
@@ -10,5 +10,6 @@ export const DEFAULT_TASK_MODEL_FIELDS = Object.freeze({
10
10
  start: 'start',
11
11
  end: 'end',
12
12
  title: 'title',
13
- completionRatio: 'completionRatio'
13
+ completionRatio: 'completionRatio',
14
+ children: 'children'
14
15
  });
@@ -9,7 +9,7 @@ export const packageMetadata = {
9
9
  name: '@progress/kendo-angular-gantt',
10
10
  productName: 'Kendo UI for Angular',
11
11
  productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
12
- publishDate: 1633003166,
12
+ publishDate: 1637673280,
13
13
  version: '',
14
14
  licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license/?utm_medium=product&utm_source=kendoangular&utm_campaign=kendo-ui-angular-purchase-license-keys-warning'
15
15
  };
@@ -39,6 +39,7 @@ GanttMilestoneTaskComponent = GanttMilestoneTaskComponent_1 = tslib_1.__decorate
39
39
  [ngClass]="taskClass(dataItem)"
40
40
  [style.left.px]="taskOffset"
41
41
  [attr.title]="mapper.extractFromTask(dataItem, 'title')"
42
+ [attr.data-task-index]="index"
42
43
  >
43
44
  </div>
44
45
  `
@@ -44,6 +44,7 @@ GanttSummaryTaskComponent = GanttSummaryTaskComponent_1 = tslib_1.__decorate([
44
44
  [style.width.px]="taskWidth"
45
45
  [style.left.px]="taskOffset"
46
46
  [attr.title]="mapper.extractFromTask(dataItem, 'title')"
47
+ [attr.data-task-index]="index"
47
48
  >
48
49
  <div *ngIf="!template; else summaryTemplate"
49
50
  class="k-task-summary-progress"
@@ -26,6 +26,7 @@ export declare abstract class GanttTaskBase {
26
26
  dataItem: any;
27
27
  activeView: TimelineViewType;
28
28
  taskClass: TaskClassFn;
29
+ index: number;
29
30
  private viewChangesSubscription;
30
31
  readonly slotUnitDuration: number;
31
32
  private readonly viewService;
@@ -93,3 +93,7 @@ tslib_1.__decorate([
93
93
  Input(),
94
94
  tslib_1.__metadata("design:type", Function)
95
95
  ], GanttTaskBase.prototype, "taskClass", void 0);
96
+ tslib_1.__decorate([
97
+ Input(),
98
+ tslib_1.__metadata("design:type", Number)
99
+ ], GanttTaskBase.prototype, "index", void 0);
@@ -8,11 +8,14 @@ import { DependencyDomService } from '../dependencies/dependency-dom.service';
8
8
  import { OptionChangesService } from '../common/option-changes.service';
9
9
  import { TimelineViewService } from './../timeline/timeline-view.service';
10
10
  import { GanttTaskBase } from './gantt-task-base';
11
+ import { EditService } from '../editing/edit.service';
11
12
  /**
12
13
  * @hidden
13
14
  */
14
15
  export declare class GanttTaskComponent extends GanttTaskBase {
16
+ private editService;
15
17
  taskContentTemplate: TemplateRef<any>;
16
18
  taskTemplate: TemplateRef<any>;
17
- constructor(mapper: MappingService, timelineViewService: TimelineViewService, dependencyDomService: DependencyDomService, optionChangesService: OptionChangesService, cdr: ChangeDetectorRef);
19
+ constructor(mapper: MappingService, timelineViewService: TimelineViewService, dependencyDomService: DependencyDomService, optionChangesService: OptionChangesService, cdr: ChangeDetectorRef, editService: EditService);
20
+ onTaskDelete(): void;
18
21
  }
@@ -10,12 +10,18 @@ import { DependencyDomService } from '../dependencies/dependency-dom.service';
10
10
  import { OptionChangesService } from '../common/option-changes.service';
11
11
  import { TimelineViewService } from './../timeline/timeline-view.service';
12
12
  import { GanttTaskBase } from './gantt-task-base';
13
+ import { EditService } from '../editing/edit.service';
13
14
  /**
14
15
  * @hidden
15
16
  */
16
17
  let GanttTaskComponent = GanttTaskComponent_1 = class GanttTaskComponent extends GanttTaskBase {
17
- constructor(mapper, timelineViewService, dependencyDomService, optionChangesService, cdr) {
18
+ constructor(mapper, timelineViewService, dependencyDomService, optionChangesService, cdr, editService) {
18
19
  super(mapper, timelineViewService, dependencyDomService, optionChangesService, cdr);
20
+ this.editService = editService;
21
+ }
22
+ onTaskDelete() {
23
+ this.editService.dataItem = this.dataItem;
24
+ this.editService.showConfirmationDialog.next();
19
25
  }
20
26
  };
21
27
  tslib_1.__decorate([
@@ -43,6 +49,7 @@ GanttTaskComponent = GanttTaskComponent_1 = tslib_1.__decorate([
43
49
  [style.width.px]="taskWidth"
44
50
  [style.left.px]="taskOffset"
45
51
  [attr.title]="mapper.extractFromTask(dataItem, 'title')"
52
+ [attr.data-task-index]="index"
46
53
  >
47
54
  <ng-container *ngIf="!taskTemplate">
48
55
  <div
@@ -62,6 +69,13 @@ GanttTaskComponent = GanttTaskComponent_1 = tslib_1.__decorate([
62
69
  >
63
70
  </ng-template>
64
71
  </div>
72
+ <span class="k-task-actions">
73
+ <span
74
+ (click)="onTaskDelete()"
75
+ class="k-link k-task-delete">
76
+ <span class="k-icon k-i-close"></span>
77
+ </span>
78
+ </span>
65
79
  </div>
66
80
  </ng-container>
67
81
  <ng-template
@@ -80,6 +94,7 @@ GanttTaskComponent = GanttTaskComponent_1 = tslib_1.__decorate([
80
94
  TimelineViewService,
81
95
  DependencyDomService,
82
96
  OptionChangesService,
83
- ChangeDetectorRef])
97
+ ChangeDetectorRef,
98
+ EditService])
84
99
  ], GanttTaskComponent);
85
100
  export { GanttTaskComponent };
@@ -21,6 +21,7 @@ export declare class GanttTasksTableBodyComponent {
21
21
  summaryTaskTemplate: TemplateRef<any>;
22
22
  taskClass: TaskClassFn;
23
23
  hasChildren: (item: object) => boolean;
24
+ index: number;
24
25
  constructor(dependencyDomService: DependencyDomService, mapper: MappingService);
25
26
  isMileStone(task: any): boolean;
26
27
  }
@@ -60,17 +60,22 @@ tslib_1.__decorate([
60
60
  Input(),
61
61
  tslib_1.__metadata("design:type", Function)
62
62
  ], GanttTasksTableBodyComponent.prototype, "hasChildren", void 0);
63
+ tslib_1.__decorate([
64
+ Input(),
65
+ tslib_1.__metadata("design:type", Number)
66
+ ], GanttTasksTableBodyComponent.prototype, "index", void 0);
63
67
  GanttTasksTableBodyComponent = tslib_1.__decorate([
64
68
  Component({
65
69
  selector: '[kendoGanttTasksTableBody]',
66
70
  template: `
67
- <tr #timelineRow *ngFor="let item of rows">
71
+ <tr #timelineRow *ngFor="let item of rows; let index = index">
68
72
  <td>
69
73
  <kendo-gantt-milestone-task
70
74
  *ngIf="isMileStone(item); else task"
71
75
  [dataItem]="item"
72
76
  [activeView]="activeView"
73
77
  [taskClass]="taskClass"
78
+ [index]="index"
74
79
  >
75
80
  </kendo-gantt-milestone-task>
76
81
  <ng-template #task>
@@ -80,6 +85,7 @@ GanttTasksTableBodyComponent = tslib_1.__decorate([
80
85
  [template]="summaryTaskTemplate"
81
86
  [activeView]="activeView"
82
87
  [taskClass]="taskClass"
88
+ [index]="index"
83
89
  >
84
90
  </kendo-gantt-summary-task>
85
91
  <kendo-gantt-task
@@ -89,6 +95,7 @@ GanttTasksTableBodyComponent = tslib_1.__decorate([
89
95
  [taskTemplate]="taskTemplate"
90
96
  [activeView]="activeView"
91
97
  [taskClass]="taskClass"
98
+ [index]="index"
92
99
  >
93
100
  </kendo-gantt-task>
94
101
  </ng-template>
@@ -3,11 +3,13 @@
3
3
  * Licensed under commercial license. See LICENSE.md in the project root for more information
4
4
  *-------------------------------------------------------------------------------------------*/
5
5
  import { EventEmitter } from '@angular/core';
6
+ import { LocalizationService } from '@progress/kendo-angular-l10n';
6
7
  import { TimelineViewType } from './../models/timeline-view';
7
8
  /**
8
9
  * The Gantt ViewSelector component. Shows the currently active view type, and allows switching to another view type.
9
10
  */
10
11
  export declare class ViewSelectorComponent {
12
+ private localizationService;
11
13
  hostClass: boolean;
12
14
  /**
13
15
  * The collection of the timeline view types in the current Gantt configuration.
@@ -22,6 +24,7 @@ export declare class ViewSelectorComponent {
22
24
  * Fires each time the user selects a different view type. The event data contains the type of the newly selected view.
23
25
  */
24
26
  activeViewChange: EventEmitter<TimelineViewType>;
27
+ constructor(localizationService: LocalizationService);
25
28
  /**
26
29
  * @hidden
27
30
  */
@@ -4,14 +4,13 @@
4
4
  *-------------------------------------------------------------------------------------------*/
5
5
  import * as tslib_1 from "tslib";
6
6
  import { Component, EventEmitter, Input, Output, HostBinding } from '@angular/core';
7
+ import { LocalizationService } from '@progress/kendo-angular-l10n';
7
8
  /**
8
9
  * The Gantt ViewSelector component. Shows the currently active view type, and allows switching to another view type.
9
10
  */
10
11
  let ViewSelectorComponent = class ViewSelectorComponent {
11
- /**
12
- * The Gantt ViewSelector component. Shows the currently active view type, and allows switching to another view type.
13
- */
14
- constructor() {
12
+ constructor(localizationService) {
13
+ this.localizationService = localizationService;
15
14
  this.hostClass = true;
16
15
  /**
17
16
  * The currently active view type.
@@ -35,7 +34,7 @@ let ViewSelectorComponent = class ViewSelectorComponent {
35
34
  * @hidden
36
35
  */
37
36
  getViewTypeText(viewType) {
38
- return `${viewType[0].toLocaleUpperCase()}${viewType.slice(1)}`;
37
+ return this.localizationService.get(`${viewType}ViewText`);
39
38
  }
40
39
  };
41
40
  tslib_1.__decorate([
@@ -58,7 +57,7 @@ ViewSelectorComponent = tslib_1.__decorate([
58
57
  Component({
59
58
  selector: 'kendo-gantt-view-selector',
60
59
  template: `
61
- <select class="k-dropdown k-views-dropdown" style="text-transform: capitalize;"
60
+ <select class="k-dropdown k-views-dropdown"
62
61
  [value]="activeView"
63
62
  (change)="activeViewChange.emit($event.target.value)">
64
63
  <option *ngFor="let view of views" [value]="view">{{getViewTypeText(view)}}</option>
@@ -70,6 +69,7 @@ ViewSelectorComponent = tslib_1.__decorate([
70
69
  (click)="onClick(view)">{{getViewTypeText(view)}}</button>
71
70
  </kendo-buttongroup>
72
71
  `
73
- })
72
+ }),
73
+ tslib_1.__metadata("design:paramtypes", [LocalizationService])
74
74
  ], ViewSelectorComponent);
75
75
  export { ViewSelectorComponent };
@@ -56,3 +56,37 @@ export declare const isColumnGroup: (column: GanttColumnBase) => column is Gantt
56
56
  * @hidden
57
57
  */
58
58
  export declare const isNumber: (contender: any) => contender is number;
59
+ /**
60
+ * @hidden
61
+ * Native Omit appears in TS v3.5, we can use it when we drop Angular 8 (requires v3.4)
62
+ */
63
+ export declare type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
64
+ /**
65
+ * @hidden
66
+ *
67
+ * Gets the closest timeline task element from an event target.
68
+ * Restricts the search up to the provided gantt element from the second param.
69
+ */
70
+ export declare const getClosestTask: (element: Element, gantt: Element) => Element;
71
+ /**
72
+ * @hidden
73
+ *
74
+ * Gets the closest timeline task element index from an event target.
75
+ * Uses the `data-task-index` attribute assigned to each task.
76
+ * Restricts the search up to the provided gantt element from the second param.
77
+ */
78
+ export declare const getClosestTaskIndex: (element: Element, gantt: Element) => number;
79
+ /**
80
+ * @hidden
81
+ *
82
+ * Checks whether the queried item or its parent items has a `k-task` selector.
83
+ * Restricts the search up to the provided gantt element from the second param.
84
+ */
85
+ export declare const isTask: (contender: Element, gantt: Element) => boolean;
86
+ /**
87
+ * @hidden
88
+ *
89
+ * Checks whether the queried item or its parent items has a `k-task-actions` selector - used for the clear button.
90
+ * Restricts the search up to the provided gantt element from the second param.
91
+ */
92
+ export declare const isClearButton: (contender: Element, gantt: Element) => boolean;
@@ -2,7 +2,7 @@
2
2
  * Copyright © 2021 Progress Software Corporation. All rights reserved.
3
3
  * Licensed under commercial license. See LICENSE.md in the project root for more information
4
4
  *-------------------------------------------------------------------------------------------*/
5
- import { isDocumentAvailable } from '@progress/kendo-angular-common';
5
+ import { closestInScope, isDocumentAvailable, matchesClasses } from '@progress/kendo-angular-common';
6
6
  import { addDays, addWeeks, cloneDate, firstDayInWeek } from '@progress/kendo-date-math';
7
7
  /**
8
8
  * @hidden
@@ -103,3 +103,46 @@ export const isColumnGroup = (column) => column.isColumnGroup;
103
103
  * @hidden
104
104
  */
105
105
  export const isNumber = (contender) => typeof contender === 'number' && !isNaN(contender);
106
+ /**
107
+ * @hidden
108
+ *
109
+ * Gets the closest timeline task element from an event target.
110
+ * Restricts the search up to the provided gantt element from the second param.
111
+ */
112
+ export const getClosestTask = (element, gantt) => {
113
+ return closestInScope(element, matchesClasses('k-task'), gantt);
114
+ };
115
+ /**
116
+ * @hidden
117
+ *
118
+ * Gets the closest timeline task element index from an event target.
119
+ * Uses the `data-task-index` attribute assigned to each task.
120
+ * Restricts the search up to the provided gantt element from the second param.
121
+ */
122
+ export const getClosestTaskIndex = (element, gantt) => {
123
+ const task = closestInScope(element, matchesClasses('k-task'), gantt);
124
+ if (!isPresent(task)) {
125
+ return null;
126
+ }
127
+ return Number(task.getAttribute('data-task-index'));
128
+ };
129
+ /**
130
+ * @hidden
131
+ *
132
+ * Checks whether the queried item or its parent items has a `k-task` selector.
133
+ * Restricts the search up to the provided gantt element from the second param.
134
+ */
135
+ export const isTask = (contender, gantt) => {
136
+ const task = closestInScope(contender, matchesClasses('k-task'), gantt);
137
+ return isPresent(task);
138
+ };
139
+ /**
140
+ * @hidden
141
+ *
142
+ * Checks whether the queried item or its parent items has a `k-task-actions` selector - used for the clear button.
143
+ * Restricts the search up to the provided gantt element from the second param.
144
+ */
145
+ export const isClearButton = (contender, gantt) => {
146
+ const clearButtonContainer = closestInScope(contender, matchesClasses('k-task-actions'), gantt);
147
+ return isPresent(clearButtonContainer);
148
+ };