@progress/kendo-angular-gantt 0.2.0-dev.202111231320 → 0.2.1-dev.202112081924
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cdn/js/kendo-angular-gantt.js +2 -2
- package/dist/cdn/main.js +2 -2
- package/dist/es/common/default-callbacks.js +4 -0
- package/dist/es/expanded-state/expandable.directive.js +6 -4
- package/dist/es/gantt.component.js +187 -32
- package/dist/es/gantt.module.js +3 -1
- package/dist/es/main.js +1 -0
- package/dist/es/package-metadata.js +1 -1
- package/dist/es/rendering/gantt-milestone-task.component.js +1 -1
- package/dist/es/rendering/gantt-summary-task.component.js +1 -1
- package/dist/es/rendering/gantt-task-base.js +8 -4
- package/dist/es/rendering/gantt-task.component.js +1 -1
- package/dist/es/rendering/gantt-tasks-table-body.component.js +3 -3
- package/dist/es/selection/selectable.directive.js +141 -0
- package/dist/es/selection/selection-change-event.js +4 -0
- package/dist/es/timeline/gantt-timeline.component.js +5 -1
- package/dist/es/toolbar/view-selector.component.js +1 -1
- package/dist/es/utils.js +5 -1
- package/dist/es2015/common/default-callbacks.d.ts +4 -0
- package/dist/es2015/common/default-callbacks.js +4 -0
- package/dist/es2015/expanded-state/expandable.directive.d.ts +2 -1
- package/dist/es2015/expanded-state/expandable.directive.js +7 -2
- package/dist/es2015/gantt.component.d.ts +66 -18
- package/dist/es2015/gantt.component.js +191 -34
- package/dist/es2015/gantt.module.js +3 -1
- package/dist/es2015/index.metadata.json +1 -1
- package/dist/es2015/main.d.ts +2 -0
- package/dist/es2015/main.js +1 -0
- package/dist/es2015/models/events/cell-click-event.interface.d.ts +31 -8
- package/dist/es2015/models/events/task-click-event.interface.d.ts +13 -5
- package/dist/es2015/models/models.d.ts +2 -0
- package/dist/es2015/package-metadata.js +1 -1
- package/dist/es2015/rendering/gantt-milestone-task.component.js +1 -0
- package/dist/es2015/rendering/gantt-summary-task.component.js +1 -0
- package/dist/es2015/rendering/gantt-task-base.d.ts +2 -1
- package/dist/es2015/rendering/gantt-task-base.js +8 -4
- package/dist/es2015/rendering/gantt-task.component.js +1 -0
- package/dist/es2015/rendering/gantt-tasks-table-body.component.d.ts +1 -1
- package/dist/es2015/rendering/gantt-tasks-table-body.component.js +5 -2
- package/dist/es2015/selection/selectable.directive.d.ts +42 -0
- package/dist/es2015/selection/selectable.directive.js +122 -0
- package/dist/es2015/selection/selection-change-event.d.ts +25 -0
- package/dist/es2015/selection/selection-change-event.js +4 -0
- package/dist/es2015/timeline/gantt-timeline.component.d.ts +1 -0
- package/dist/es2015/timeline/gantt-timeline.component.js +5 -0
- package/dist/es2015/toolbar/view-selector.component.js +1 -0
- package/dist/es2015/utils.d.ts +5 -0
- package/dist/es2015/utils.js +5 -1
- package/dist/fesm2015/index.js +341 -40
- package/dist/fesm5/index.js +353 -46
- package/dist/npm/common/default-callbacks.js +4 -0
- package/dist/npm/expanded-state/expandable.directive.js +5 -3
- package/dist/npm/gantt.component.js +187 -32
- package/dist/npm/gantt.module.js +3 -1
- package/dist/npm/main.js +2 -0
- package/dist/npm/package-metadata.js +1 -1
- package/dist/npm/rendering/gantt-milestone-task.component.js +1 -1
- package/dist/npm/rendering/gantt-summary-task.component.js +1 -1
- package/dist/npm/rendering/gantt-task-base.js +8 -4
- package/dist/npm/rendering/gantt-task.component.js +1 -1
- package/dist/npm/rendering/gantt-tasks-table-body.component.js +3 -3
- package/dist/npm/selection/selectable.directive.js +143 -0
- package/dist/npm/selection/selection-change-event.js +6 -0
- package/dist/npm/timeline/gantt-timeline.component.js +5 -1
- package/dist/npm/toolbar/view-selector.component.js +1 -1
- package/dist/npm/utils.js +4 -0
- package/dist/systemjs/kendo-angular-gantt.js +1 -1
- package/package.json +1 -1
package/dist/es2015/main.d.ts
CHANGED
|
@@ -11,6 +11,8 @@ export { GanttTaskTemplateDirective } from './template-directives/task-template.
|
|
|
11
11
|
export { GanttTaskContentTemplateDirective } from './template-directives/task-content-template.directive';
|
|
12
12
|
export { GanttSummaryTaskTemplateDirective } from './template-directives/summary-task-template.directive';
|
|
13
13
|
export { ToolbarTemplateDirective } from './toolbar/toolbar-template.directive';
|
|
14
|
+
export { SelectableDirective } from './selection/selectable.directive';
|
|
15
|
+
export { SelectionChangeEvent } from './selection/selection-change-event';
|
|
14
16
|
export { TreeListPaneOptions, TimelinePaneOptions } from './models/splitter-pane-options.interface';
|
|
15
17
|
export * from './models/models';
|
|
16
18
|
export * from './columns/columns';
|
package/dist/es2015/main.js
CHANGED
|
@@ -11,5 +11,6 @@ export { GanttTaskTemplateDirective } from './template-directives/task-template.
|
|
|
11
11
|
export { GanttTaskContentTemplateDirective } from './template-directives/task-content-template.directive';
|
|
12
12
|
export { GanttSummaryTaskTemplateDirective } from './template-directives/summary-task-template.directive';
|
|
13
13
|
export { ToolbarTemplateDirective } from './toolbar/toolbar-template.directive';
|
|
14
|
+
export { SelectableDirective } from './selection/selectable.directive';
|
|
14
15
|
export * from './models/models';
|
|
15
16
|
export * from './columns/columns';
|
|
@@ -2,19 +2,42 @@
|
|
|
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 {
|
|
6
|
-
import {
|
|
7
|
-
import { Omit } from '../../utils';
|
|
5
|
+
import { GanttComponent } from '../../gantt.component';
|
|
6
|
+
import { GanttColumnComponent, GanttSpanColumnComponent } from '../../columns/columns';
|
|
8
7
|
/**
|
|
9
|
-
* Triggered every time a cell is
|
|
8
|
+
* Triggered every time a cell is clicked.
|
|
10
9
|
*/
|
|
11
|
-
export interface CellClickEvent
|
|
10
|
+
export interface CellClickEvent {
|
|
12
11
|
/**
|
|
13
|
-
* The
|
|
12
|
+
* The column component associated with the clicked cell.
|
|
13
|
+
*/
|
|
14
|
+
column: GanttColumnComponent | GanttSpanColumnComponent;
|
|
15
|
+
/**
|
|
16
|
+
* The column index of the clicked cell.
|
|
17
|
+
*/
|
|
18
|
+
columnIndex: number;
|
|
19
|
+
/**
|
|
20
|
+
* The data item associated with the clicked cell.
|
|
21
|
+
*/
|
|
22
|
+
dataItem: any;
|
|
23
|
+
/**
|
|
24
|
+
* Indicates whether the cell is in edit mode.
|
|
25
|
+
*/
|
|
26
|
+
isEdited: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* The DOM event that triggered the `cellClick` event.
|
|
29
|
+
*/
|
|
30
|
+
originalEvent: PointerEvent;
|
|
31
|
+
/**
|
|
32
|
+
* The row index for the clicked cell.
|
|
33
|
+
*/
|
|
34
|
+
rowIndex: number;
|
|
35
|
+
/**
|
|
36
|
+
* The Gantt component instance.
|
|
14
37
|
*/
|
|
15
38
|
sender: GanttComponent;
|
|
16
39
|
/**
|
|
17
|
-
* The
|
|
40
|
+
* The type of the event that triggered the `cellClick` event.
|
|
18
41
|
*/
|
|
19
|
-
|
|
42
|
+
type: 'click' | 'contextmenu' | 'dblclick';
|
|
20
43
|
}
|
|
@@ -2,21 +2,29 @@
|
|
|
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 { GanttComponent } from
|
|
5
|
+
import { GanttComponent } from '../../gantt.component';
|
|
6
6
|
/**
|
|
7
|
-
* Triggered every time a task is
|
|
7
|
+
* Triggered every time a task is clicked.
|
|
8
8
|
*/
|
|
9
9
|
export interface TaskClickEvent {
|
|
10
10
|
/**
|
|
11
|
-
* The
|
|
11
|
+
* The DOM event that triggered the `taskClick` event.
|
|
12
12
|
*/
|
|
13
|
-
originalEvent:
|
|
13
|
+
originalEvent: PointerEvent;
|
|
14
14
|
/**
|
|
15
15
|
* The data item associated with the clicked task.
|
|
16
16
|
*/
|
|
17
17
|
dataItem: any;
|
|
18
18
|
/**
|
|
19
|
-
* The Gantt component instance
|
|
19
|
+
* The Gantt component instance.
|
|
20
20
|
*/
|
|
21
21
|
sender: GanttComponent;
|
|
22
|
+
/**
|
|
23
|
+
* The row index for the clicked task.
|
|
24
|
+
*/
|
|
25
|
+
rowIndex: number;
|
|
26
|
+
/**
|
|
27
|
+
* The type of the event that triggered the `taskClick` event.
|
|
28
|
+
*/
|
|
29
|
+
type: 'click' | 'contextmenu' | 'dblclick';
|
|
22
30
|
}
|
|
@@ -28,6 +28,8 @@ export { TaskResizeEndEvent } from './events/task-resize-end-event.interface';
|
|
|
28
28
|
export { TaskResizeEvent } from './events/task-resize-event.interface';
|
|
29
29
|
export { TaskResizeStartEvent } from './events/task-resize-start-event.interface';
|
|
30
30
|
export { DataStateChangeEvent } from './events/data-state-change-event.interface';
|
|
31
|
+
export { CellClickEvent } from './events/cell-click-event.interface';
|
|
32
|
+
export { TaskClickEvent } from './events/task-click-event.interface';
|
|
31
33
|
export { ColumnLockedChangeEvent } from './events/column-locked-change-event.interface';
|
|
32
34
|
export { ColumnReorderEvent } from './events/column-reorder-event.interface';
|
|
33
35
|
export { ColumnResizeEvent } from './events/column-resize-event.interface';
|
|
@@ -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:
|
|
12
|
+
publishDate: 1638991092,
|
|
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
|
+
[class.k-state-selected]="isSelected(dataItem)"
|
|
42
43
|
[attr.data-task-index]="index"
|
|
43
44
|
>
|
|
44
45
|
</div>
|
|
@@ -45,6 +45,7 @@ GanttSummaryTaskComponent = GanttSummaryTaskComponent_1 = tslib_1.__decorate([
|
|
|
45
45
|
[style.left.px]="taskOffset"
|
|
46
46
|
[attr.title]="mapper.extractFromTask(dataItem, 'title')"
|
|
47
47
|
[attr.data-task-index]="index"
|
|
48
|
+
[class.k-state-selected]="isSelected(dataItem)"
|
|
48
49
|
>
|
|
49
50
|
<div *ngIf="!template; else summaryTemplate"
|
|
50
51
|
class="k-task-summary-progress"
|
|
@@ -24,9 +24,10 @@ export declare abstract class GanttTaskBase {
|
|
|
24
24
|
*/
|
|
25
25
|
taskElement: ElementRef<HTMLElement>;
|
|
26
26
|
dataItem: any;
|
|
27
|
+
index: number;
|
|
28
|
+
isSelected: (dataItem: object) => boolean;
|
|
27
29
|
activeView: TimelineViewType;
|
|
28
30
|
taskClass: TaskClassFn;
|
|
29
|
-
index: number;
|
|
30
31
|
private viewChangesSubscription;
|
|
31
32
|
readonly slotUnitDuration: number;
|
|
32
33
|
private readonly viewService;
|
|
@@ -85,6 +85,14 @@ tslib_1.__decorate([
|
|
|
85
85
|
Input(),
|
|
86
86
|
tslib_1.__metadata("design:type", Object)
|
|
87
87
|
], GanttTaskBase.prototype, "dataItem", void 0);
|
|
88
|
+
tslib_1.__decorate([
|
|
89
|
+
Input(),
|
|
90
|
+
tslib_1.__metadata("design:type", Number)
|
|
91
|
+
], GanttTaskBase.prototype, "index", void 0);
|
|
92
|
+
tslib_1.__decorate([
|
|
93
|
+
Input(),
|
|
94
|
+
tslib_1.__metadata("design:type", Function)
|
|
95
|
+
], GanttTaskBase.prototype, "isSelected", void 0);
|
|
88
96
|
tslib_1.__decorate([
|
|
89
97
|
Input(),
|
|
90
98
|
tslib_1.__metadata("design:type", String)
|
|
@@ -93,7 +101,3 @@ tslib_1.__decorate([
|
|
|
93
101
|
Input(),
|
|
94
102
|
tslib_1.__metadata("design:type", Function)
|
|
95
103
|
], GanttTaskBase.prototype, "taskClass", void 0);
|
|
96
|
-
tslib_1.__decorate([
|
|
97
|
-
Input(),
|
|
98
|
-
tslib_1.__metadata("design:type", Number)
|
|
99
|
-
], GanttTaskBase.prototype, "index", void 0);
|
|
@@ -50,6 +50,7 @@ GanttTaskComponent = GanttTaskComponent_1 = tslib_1.__decorate([
|
|
|
50
50
|
[style.left.px]="taskOffset"
|
|
51
51
|
[attr.title]="mapper.extractFromTask(dataItem, 'title')"
|
|
52
52
|
[attr.data-task-index]="index"
|
|
53
|
+
[class.k-state-selected]="isSelected(dataItem)"
|
|
53
54
|
>
|
|
54
55
|
<ng-container *ngIf="!taskTemplate">
|
|
55
56
|
<div
|
|
@@ -21,7 +21,7 @@ export declare class GanttTasksTableBodyComponent {
|
|
|
21
21
|
summaryTaskTemplate: TemplateRef<any>;
|
|
22
22
|
taskClass: TaskClassFn;
|
|
23
23
|
hasChildren: (item: object) => boolean;
|
|
24
|
-
|
|
24
|
+
isTaskSelected: (item: object) => boolean;
|
|
25
25
|
constructor(dependencyDomService: DependencyDomService, mapper: MappingService);
|
|
26
26
|
isMileStone(task: any): boolean;
|
|
27
27
|
}
|
|
@@ -62,8 +62,8 @@ tslib_1.__decorate([
|
|
|
62
62
|
], GanttTasksTableBodyComponent.prototype, "hasChildren", void 0);
|
|
63
63
|
tslib_1.__decorate([
|
|
64
64
|
Input(),
|
|
65
|
-
tslib_1.__metadata("design:type",
|
|
66
|
-
], GanttTasksTableBodyComponent.prototype, "
|
|
65
|
+
tslib_1.__metadata("design:type", Function)
|
|
66
|
+
], GanttTasksTableBodyComponent.prototype, "isTaskSelected", void 0);
|
|
67
67
|
GanttTasksTableBodyComponent = tslib_1.__decorate([
|
|
68
68
|
Component({
|
|
69
69
|
selector: '[kendoGanttTasksTableBody]',
|
|
@@ -75,6 +75,7 @@ GanttTasksTableBodyComponent = tslib_1.__decorate([
|
|
|
75
75
|
[dataItem]="item"
|
|
76
76
|
[activeView]="activeView"
|
|
77
77
|
[taskClass]="taskClass"
|
|
78
|
+
[isSelected]="isTaskSelected"
|
|
78
79
|
[index]="index"
|
|
79
80
|
>
|
|
80
81
|
</kendo-gantt-milestone-task>
|
|
@@ -85,6 +86,7 @@ GanttTasksTableBodyComponent = tslib_1.__decorate([
|
|
|
85
86
|
[template]="summaryTaskTemplate"
|
|
86
87
|
[activeView]="activeView"
|
|
87
88
|
[taskClass]="taskClass"
|
|
89
|
+
[isSelected]="isTaskSelected"
|
|
88
90
|
[index]="index"
|
|
89
91
|
>
|
|
90
92
|
</kendo-gantt-summary-task>
|
|
@@ -95,6 +97,7 @@ GanttTasksTableBodyComponent = tslib_1.__decorate([
|
|
|
95
97
|
[taskTemplate]="taskTemplate"
|
|
96
98
|
[activeView]="activeView"
|
|
97
99
|
[taskClass]="taskClass"
|
|
100
|
+
[isSelected]="isTaskSelected"
|
|
98
101
|
[index]="index"
|
|
99
102
|
>
|
|
100
103
|
</kendo-gantt-task>
|
|
@@ -0,0 +1,42 @@
|
|
|
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 { OnDestroy, EventEmitter } from '@angular/core';
|
|
6
|
+
import { GanttComponent } from '../gantt.component';
|
|
7
|
+
/**
|
|
8
|
+
* A directive which handles the [`selectionChange`]({% slug api_gantt_ganttcomponent %}#toc-selectionchange) event of the Gantt
|
|
9
|
+
* ([see example]({% slug selection_gantt %}#toc-built-in-directive))
|
|
10
|
+
*/
|
|
11
|
+
export declare class SelectableDirective implements OnDestroy {
|
|
12
|
+
private gantt;
|
|
13
|
+
/**
|
|
14
|
+
* @hidden
|
|
15
|
+
*/
|
|
16
|
+
selectable: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Sets the selected keys.
|
|
19
|
+
*/
|
|
20
|
+
selectedKeys: any[];
|
|
21
|
+
/**
|
|
22
|
+
* Fires when the selected keys are changed.
|
|
23
|
+
*/
|
|
24
|
+
selectedKeysChange: EventEmitter<any[]>;
|
|
25
|
+
/**
|
|
26
|
+
* The field name or a function that specifies the data item unique key identifier.
|
|
27
|
+
* By default, the string field `id` is used.
|
|
28
|
+
*/
|
|
29
|
+
itemKey: string | ((dataItem: any) => any);
|
|
30
|
+
private readonly keyGetter;
|
|
31
|
+
private selectionSubscription;
|
|
32
|
+
private state;
|
|
33
|
+
private lastChange;
|
|
34
|
+
private _keyGetter;
|
|
35
|
+
constructor(gantt: GanttComponent);
|
|
36
|
+
ngOnDestroy(): void;
|
|
37
|
+
private isSelected;
|
|
38
|
+
private selectionChange;
|
|
39
|
+
private emitSelectedItemsChange;
|
|
40
|
+
private subscribeSelection;
|
|
41
|
+
private unsubscribeSelection;
|
|
42
|
+
}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
import * as tslib_1 from "tslib";
|
|
6
|
+
import { Directive, Input, Output, EventEmitter } from '@angular/core';
|
|
7
|
+
import { getter } from '@progress/kendo-common';
|
|
8
|
+
import { GanttComponent } from '../gantt.component';
|
|
9
|
+
import { isPresent, isString } from '../utils';
|
|
10
|
+
/**
|
|
11
|
+
* A directive which handles the [`selectionChange`]({% slug api_gantt_ganttcomponent %}#toc-selectionchange) event of the Gantt
|
|
12
|
+
* ([see example]({% slug selection_gantt %}#toc-built-in-directive))
|
|
13
|
+
*/
|
|
14
|
+
let SelectableDirective = class SelectableDirective {
|
|
15
|
+
constructor(gantt) {
|
|
16
|
+
this.gantt = gantt;
|
|
17
|
+
/**
|
|
18
|
+
* Fires when the selected keys are changed.
|
|
19
|
+
*/
|
|
20
|
+
this.selectedKeysChange = new EventEmitter();
|
|
21
|
+
this.state = new Set();
|
|
22
|
+
this.isSelected = this.isSelected.bind(this);
|
|
23
|
+
this.selectionChange = this.selectionChange.bind(this);
|
|
24
|
+
this.selectable = true;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* @hidden
|
|
28
|
+
*/
|
|
29
|
+
set selectable(value) {
|
|
30
|
+
if (value) {
|
|
31
|
+
this.gantt.isSelected = this.isSelected;
|
|
32
|
+
this.subscribeSelection();
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
this.gantt.isSelected = () => false;
|
|
36
|
+
this.unsubscribeSelection();
|
|
37
|
+
}
|
|
38
|
+
this.gantt.selectable = value;
|
|
39
|
+
this.gantt.updateView();
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Sets the selected keys.
|
|
43
|
+
*/
|
|
44
|
+
set selectedKeys(value) {
|
|
45
|
+
if (isPresent(value) && value === this.lastChange) {
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
// prevent multiple items displayed as selected as multiple selection still not supported fully
|
|
49
|
+
const keys = (value || []).slice(0, 1);
|
|
50
|
+
this.state = new Set(keys);
|
|
51
|
+
this.gantt.updateView();
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* The field name or a function that specifies the data item unique key identifier.
|
|
55
|
+
* By default, the string field `id` is used.
|
|
56
|
+
*/
|
|
57
|
+
set itemKey(value) {
|
|
58
|
+
if (isString(value)) {
|
|
59
|
+
this._keyGetter = getter(value);
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
this._keyGetter = value;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
get keyGetter() {
|
|
66
|
+
return this._keyGetter || this.gantt.idGetter;
|
|
67
|
+
}
|
|
68
|
+
ngOnDestroy() {
|
|
69
|
+
this.unsubscribeSelection();
|
|
70
|
+
}
|
|
71
|
+
isSelected(dataItem) {
|
|
72
|
+
return this.state.has(this.keyGetter(dataItem));
|
|
73
|
+
}
|
|
74
|
+
selectionChange({ action, items }) {
|
|
75
|
+
this.state.clear();
|
|
76
|
+
if (action === 'select') {
|
|
77
|
+
items.forEach(item => this.state.add(this.keyGetter(item)));
|
|
78
|
+
}
|
|
79
|
+
this.emitSelectedItemsChange();
|
|
80
|
+
}
|
|
81
|
+
emitSelectedItemsChange() {
|
|
82
|
+
this.lastChange = Array.from(this.state);
|
|
83
|
+
this.selectedKeysChange.emit(this.lastChange);
|
|
84
|
+
}
|
|
85
|
+
subscribeSelection() {
|
|
86
|
+
this.unsubscribeSelection();
|
|
87
|
+
this.selectionSubscription = this.gantt.selectionChange.subscribe(this.selectionChange);
|
|
88
|
+
}
|
|
89
|
+
unsubscribeSelection() {
|
|
90
|
+
if (this.selectionSubscription) {
|
|
91
|
+
this.selectionSubscription.unsubscribe();
|
|
92
|
+
this.selectionSubscription = null;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
tslib_1.__decorate([
|
|
97
|
+
Input(),
|
|
98
|
+
tslib_1.__metadata("design:type", Boolean),
|
|
99
|
+
tslib_1.__metadata("design:paramtypes", [Boolean])
|
|
100
|
+
], SelectableDirective.prototype, "selectable", null);
|
|
101
|
+
tslib_1.__decorate([
|
|
102
|
+
Input(),
|
|
103
|
+
tslib_1.__metadata("design:type", Array),
|
|
104
|
+
tslib_1.__metadata("design:paramtypes", [Array])
|
|
105
|
+
], SelectableDirective.prototype, "selectedKeys", null);
|
|
106
|
+
tslib_1.__decorate([
|
|
107
|
+
Output(),
|
|
108
|
+
tslib_1.__metadata("design:type", EventEmitter)
|
|
109
|
+
], SelectableDirective.prototype, "selectedKeysChange", void 0);
|
|
110
|
+
tslib_1.__decorate([
|
|
111
|
+
Input(),
|
|
112
|
+
tslib_1.__metadata("design:type", Object),
|
|
113
|
+
tslib_1.__metadata("design:paramtypes", [Object])
|
|
114
|
+
], SelectableDirective.prototype, "itemKey", null);
|
|
115
|
+
SelectableDirective = tslib_1.__decorate([
|
|
116
|
+
Directive({
|
|
117
|
+
exportAs: 'kendoGanttSelectable',
|
|
118
|
+
selector: '[kendoGanttSelectable]'
|
|
119
|
+
}),
|
|
120
|
+
tslib_1.__metadata("design:paramtypes", [GanttComponent])
|
|
121
|
+
], SelectableDirective);
|
|
122
|
+
export { SelectableDirective };
|
|
@@ -0,0 +1,25 @@
|
|
|
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
|
+
* Arguments for the Gantt [`selectionChange`]({% slug api_gantt_ganttcomponent %}#toc-selectionchange) event.
|
|
8
|
+
*/
|
|
9
|
+
export interface SelectionChangeEvent {
|
|
10
|
+
/**
|
|
11
|
+
* Specifies how was the selection changed.
|
|
12
|
+
*
|
|
13
|
+
* - `select` - All specified `items` should be selected, all other persisted ones should be removed.
|
|
14
|
+
* - `remove` - Only the specified `items` should be removed, all others should be left untouched.
|
|
15
|
+
*/
|
|
16
|
+
action: 'select' | 'remove';
|
|
17
|
+
/**
|
|
18
|
+
* Specifies which items were changed.
|
|
19
|
+
*/
|
|
20
|
+
items: any[];
|
|
21
|
+
/**
|
|
22
|
+
* The Gantt component that triggered the event.
|
|
23
|
+
*/
|
|
24
|
+
sender: GanttComponent;
|
|
25
|
+
}
|
|
@@ -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
|
+
*-------------------------------------------------------------------------------------------*/
|
|
@@ -28,6 +28,7 @@ export declare class GanttTimelineComponent implements AfterViewInit {
|
|
|
28
28
|
taskTemplate: TemplateRef<any>;
|
|
29
29
|
summaryTaskTemplate: TemplateRef<any>;
|
|
30
30
|
taskClass: TaskClassFn;
|
|
31
|
+
isTaskSelected: (item: object) => boolean;
|
|
31
32
|
hasChildren: (item: object) => boolean;
|
|
32
33
|
dependencies: any[];
|
|
33
34
|
private subscriptions;
|
|
@@ -102,6 +102,10 @@ tslib_1.__decorate([
|
|
|
102
102
|
Input(),
|
|
103
103
|
tslib_1.__metadata("design:type", Function)
|
|
104
104
|
], GanttTimelineComponent.prototype, "taskClass", void 0);
|
|
105
|
+
tslib_1.__decorate([
|
|
106
|
+
Input(),
|
|
107
|
+
tslib_1.__metadata("design:type", Function)
|
|
108
|
+
], GanttTimelineComponent.prototype, "isTaskSelected", void 0);
|
|
105
109
|
tslib_1.__decorate([
|
|
106
110
|
Input(),
|
|
107
111
|
tslib_1.__metadata("design:type", Function)
|
|
@@ -181,6 +185,7 @@ GanttTimelineComponent = tslib_1.__decorate([
|
|
|
181
185
|
[summaryTaskTemplate]="summaryTaskTemplate"
|
|
182
186
|
[taskClass]="taskClass"
|
|
183
187
|
[hasChildren]="hasChildren"
|
|
188
|
+
[isTaskSelected]="isTaskSelected"
|
|
184
189
|
>
|
|
185
190
|
</tbody>
|
|
186
191
|
</table>
|
|
@@ -65,6 +65,7 @@ ViewSelectorComponent = tslib_1.__decorate([
|
|
|
65
65
|
<kendo-buttongroup class="k-gantt-views" selection="single">
|
|
66
66
|
<button *ngFor="let view of views"
|
|
67
67
|
kendoButton
|
|
68
|
+
type="button"
|
|
68
69
|
[selected]="view === activeView"
|
|
69
70
|
(click)="onClick(view)">{{getViewTypeText(view)}}</button>
|
|
70
71
|
</kendo-buttongroup>
|
package/dist/es2015/utils.d.ts
CHANGED
|
@@ -58,6 +58,11 @@ export declare const isColumnGroup: (column: GanttColumnBase) => column is Gantt
|
|
|
58
58
|
export declare const isNumber: (contender: any) => contender is number;
|
|
59
59
|
/**
|
|
60
60
|
* @hidden
|
|
61
|
+
*/
|
|
62
|
+
export declare const isString: (contender: any) => contender is string;
|
|
63
|
+
/**
|
|
64
|
+
* @hidden
|
|
65
|
+
*
|
|
61
66
|
* Native Omit appears in TS v3.5, we can use it when we drop Angular 8 (requires v3.4)
|
|
62
67
|
*/
|
|
63
68
|
export declare type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
|
package/dist/es2015/utils.js
CHANGED
|
@@ -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 {
|
|
5
|
+
import { isDocumentAvailable, closestInScope, matchesClasses } from '@progress/kendo-angular-common';
|
|
6
6
|
import { addDays, addWeeks, cloneDate, firstDayInWeek } from '@progress/kendo-date-math';
|
|
7
7
|
/**
|
|
8
8
|
* @hidden
|
|
@@ -103,6 +103,10 @@ 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
|
+
export const isString = (contender) => typeof contender === 'string';
|
|
106
110
|
/**
|
|
107
111
|
* @hidden
|
|
108
112
|
*
|