@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.
Files changed (68) hide show
  1. package/dist/cdn/js/kendo-angular-gantt.js +2 -2
  2. package/dist/cdn/main.js +2 -2
  3. package/dist/es/common/default-callbacks.js +4 -0
  4. package/dist/es/expanded-state/expandable.directive.js +6 -4
  5. package/dist/es/gantt.component.js +187 -32
  6. package/dist/es/gantt.module.js +3 -1
  7. package/dist/es/main.js +1 -0
  8. package/dist/es/package-metadata.js +1 -1
  9. package/dist/es/rendering/gantt-milestone-task.component.js +1 -1
  10. package/dist/es/rendering/gantt-summary-task.component.js +1 -1
  11. package/dist/es/rendering/gantt-task-base.js +8 -4
  12. package/dist/es/rendering/gantt-task.component.js +1 -1
  13. package/dist/es/rendering/gantt-tasks-table-body.component.js +3 -3
  14. package/dist/es/selection/selectable.directive.js +141 -0
  15. package/dist/es/selection/selection-change-event.js +4 -0
  16. package/dist/es/timeline/gantt-timeline.component.js +5 -1
  17. package/dist/es/toolbar/view-selector.component.js +1 -1
  18. package/dist/es/utils.js +5 -1
  19. package/dist/es2015/common/default-callbacks.d.ts +4 -0
  20. package/dist/es2015/common/default-callbacks.js +4 -0
  21. package/dist/es2015/expanded-state/expandable.directive.d.ts +2 -1
  22. package/dist/es2015/expanded-state/expandable.directive.js +7 -2
  23. package/dist/es2015/gantt.component.d.ts +66 -18
  24. package/dist/es2015/gantt.component.js +191 -34
  25. package/dist/es2015/gantt.module.js +3 -1
  26. package/dist/es2015/index.metadata.json +1 -1
  27. package/dist/es2015/main.d.ts +2 -0
  28. package/dist/es2015/main.js +1 -0
  29. package/dist/es2015/models/events/cell-click-event.interface.d.ts +31 -8
  30. package/dist/es2015/models/events/task-click-event.interface.d.ts +13 -5
  31. package/dist/es2015/models/models.d.ts +2 -0
  32. package/dist/es2015/package-metadata.js +1 -1
  33. package/dist/es2015/rendering/gantt-milestone-task.component.js +1 -0
  34. package/dist/es2015/rendering/gantt-summary-task.component.js +1 -0
  35. package/dist/es2015/rendering/gantt-task-base.d.ts +2 -1
  36. package/dist/es2015/rendering/gantt-task-base.js +8 -4
  37. package/dist/es2015/rendering/gantt-task.component.js +1 -0
  38. package/dist/es2015/rendering/gantt-tasks-table-body.component.d.ts +1 -1
  39. package/dist/es2015/rendering/gantt-tasks-table-body.component.js +5 -2
  40. package/dist/es2015/selection/selectable.directive.d.ts +42 -0
  41. package/dist/es2015/selection/selectable.directive.js +122 -0
  42. package/dist/es2015/selection/selection-change-event.d.ts +25 -0
  43. package/dist/es2015/selection/selection-change-event.js +4 -0
  44. package/dist/es2015/timeline/gantt-timeline.component.d.ts +1 -0
  45. package/dist/es2015/timeline/gantt-timeline.component.js +5 -0
  46. package/dist/es2015/toolbar/view-selector.component.js +1 -0
  47. package/dist/es2015/utils.d.ts +5 -0
  48. package/dist/es2015/utils.js +5 -1
  49. package/dist/fesm2015/index.js +341 -40
  50. package/dist/fesm5/index.js +353 -46
  51. package/dist/npm/common/default-callbacks.js +4 -0
  52. package/dist/npm/expanded-state/expandable.directive.js +5 -3
  53. package/dist/npm/gantt.component.js +187 -32
  54. package/dist/npm/gantt.module.js +3 -1
  55. package/dist/npm/main.js +2 -0
  56. package/dist/npm/package-metadata.js +1 -1
  57. package/dist/npm/rendering/gantt-milestone-task.component.js +1 -1
  58. package/dist/npm/rendering/gantt-summary-task.component.js +1 -1
  59. package/dist/npm/rendering/gantt-task-base.js +8 -4
  60. package/dist/npm/rendering/gantt-task.component.js +1 -1
  61. package/dist/npm/rendering/gantt-tasks-table-body.component.js +3 -3
  62. package/dist/npm/selection/selectable.directive.js +143 -0
  63. package/dist/npm/selection/selection-change-event.js +6 -0
  64. package/dist/npm/timeline/gantt-timeline.component.js +5 -1
  65. package/dist/npm/toolbar/view-selector.component.js +1 -1
  66. package/dist/npm/utils.js +4 -0
  67. package/dist/systemjs/kendo-angular-gantt.js +1 -1
  68. package/package.json +1 -1
@@ -0,0 +1,143 @@
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
+ "use strict";
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ var tslib_1 = require("tslib");
8
+ var core_1 = require("@angular/core");
9
+ var kendo_common_1 = require("@progress/kendo-common");
10
+ var gantt_component_1 = require("../gantt.component");
11
+ var utils_1 = require("../utils");
12
+ /**
13
+ * A directive which handles the [`selectionChange`]({% slug api_gantt_ganttcomponent %}#toc-selectionchange) event of the Gantt
14
+ * ([see example]({% slug selection_gantt %}#toc-built-in-directive))
15
+ */
16
+ var SelectableDirective = /** @class */ (function () {
17
+ function SelectableDirective(gantt) {
18
+ this.gantt = gantt;
19
+ /**
20
+ * Fires when the selected keys are changed.
21
+ */
22
+ this.selectedKeysChange = new core_1.EventEmitter();
23
+ this.state = new Set();
24
+ this.isSelected = this.isSelected.bind(this);
25
+ this.selectionChange = this.selectionChange.bind(this);
26
+ this.selectable = true;
27
+ }
28
+ Object.defineProperty(SelectableDirective.prototype, "selectable", {
29
+ /**
30
+ * @hidden
31
+ */
32
+ set: function (value) {
33
+ if (value) {
34
+ this.gantt.isSelected = this.isSelected;
35
+ this.subscribeSelection();
36
+ }
37
+ else {
38
+ this.gantt.isSelected = function () { return false; };
39
+ this.unsubscribeSelection();
40
+ }
41
+ this.gantt.selectable = value;
42
+ this.gantt.updateView();
43
+ },
44
+ enumerable: true,
45
+ configurable: true
46
+ });
47
+ Object.defineProperty(SelectableDirective.prototype, "selectedKeys", {
48
+ /**
49
+ * Sets the selected keys.
50
+ */
51
+ set: function (value) {
52
+ if (utils_1.isPresent(value) && value === this.lastChange) {
53
+ return;
54
+ }
55
+ // prevent multiple items displayed as selected as multiple selection still not supported fully
56
+ var keys = (value || []).slice(0, 1);
57
+ this.state = new Set(keys);
58
+ this.gantt.updateView();
59
+ },
60
+ enumerable: true,
61
+ configurable: true
62
+ });
63
+ Object.defineProperty(SelectableDirective.prototype, "itemKey", {
64
+ /**
65
+ * The field name or a function that specifies the data item unique key identifier.
66
+ * By default, the string field `id` is used.
67
+ */
68
+ set: function (value) {
69
+ if (utils_1.isString(value)) {
70
+ this._keyGetter = kendo_common_1.getter(value);
71
+ }
72
+ else {
73
+ this._keyGetter = value;
74
+ }
75
+ },
76
+ enumerable: true,
77
+ configurable: true
78
+ });
79
+ Object.defineProperty(SelectableDirective.prototype, "keyGetter", {
80
+ get: function () {
81
+ return this._keyGetter || this.gantt.idGetter;
82
+ },
83
+ enumerable: true,
84
+ configurable: true
85
+ });
86
+ SelectableDirective.prototype.ngOnDestroy = function () {
87
+ this.unsubscribeSelection();
88
+ };
89
+ SelectableDirective.prototype.isSelected = function (dataItem) {
90
+ return this.state.has(this.keyGetter(dataItem));
91
+ };
92
+ SelectableDirective.prototype.selectionChange = function (_a) {
93
+ var _this = this;
94
+ var action = _a.action, items = _a.items;
95
+ this.state.clear();
96
+ if (action === 'select') {
97
+ items.forEach(function (item) { return _this.state.add(_this.keyGetter(item)); });
98
+ }
99
+ this.emitSelectedItemsChange();
100
+ };
101
+ SelectableDirective.prototype.emitSelectedItemsChange = function () {
102
+ this.lastChange = Array.from(this.state);
103
+ this.selectedKeysChange.emit(this.lastChange);
104
+ };
105
+ SelectableDirective.prototype.subscribeSelection = function () {
106
+ this.unsubscribeSelection();
107
+ this.selectionSubscription = this.gantt.selectionChange.subscribe(this.selectionChange);
108
+ };
109
+ SelectableDirective.prototype.unsubscribeSelection = function () {
110
+ if (this.selectionSubscription) {
111
+ this.selectionSubscription.unsubscribe();
112
+ this.selectionSubscription = null;
113
+ }
114
+ };
115
+ tslib_1.__decorate([
116
+ core_1.Input(),
117
+ tslib_1.__metadata("design:type", Boolean),
118
+ tslib_1.__metadata("design:paramtypes", [Boolean])
119
+ ], SelectableDirective.prototype, "selectable", null);
120
+ tslib_1.__decorate([
121
+ core_1.Input(),
122
+ tslib_1.__metadata("design:type", Array),
123
+ tslib_1.__metadata("design:paramtypes", [Array])
124
+ ], SelectableDirective.prototype, "selectedKeys", null);
125
+ tslib_1.__decorate([
126
+ core_1.Output(),
127
+ tslib_1.__metadata("design:type", core_1.EventEmitter)
128
+ ], SelectableDirective.prototype, "selectedKeysChange", void 0);
129
+ tslib_1.__decorate([
130
+ core_1.Input(),
131
+ tslib_1.__metadata("design:type", Object),
132
+ tslib_1.__metadata("design:paramtypes", [Object])
133
+ ], SelectableDirective.prototype, "itemKey", null);
134
+ SelectableDirective = tslib_1.__decorate([
135
+ core_1.Directive({
136
+ exportAs: 'kendoGanttSelectable',
137
+ selector: '[kendoGanttSelectable]'
138
+ }),
139
+ tslib_1.__metadata("design:paramtypes", [gantt_component_1.GanttComponent])
140
+ ], SelectableDirective);
141
+ return SelectableDirective;
142
+ }());
143
+ exports.SelectableDirective = SelectableDirective;
@@ -0,0 +1,6 @@
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
+ "use strict";
6
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -105,6 +105,10 @@ var GanttTimelineComponent = /** @class */ (function () {
105
105
  core_1.Input(),
106
106
  tslib_1.__metadata("design:type", Function)
107
107
  ], GanttTimelineComponent.prototype, "taskClass", void 0);
108
+ tslib_1.__decorate([
109
+ core_1.Input(),
110
+ tslib_1.__metadata("design:type", Function)
111
+ ], GanttTimelineComponent.prototype, "isTaskSelected", void 0);
108
112
  tslib_1.__decorate([
109
113
  core_1.Input(),
110
114
  tslib_1.__metadata("design:type", Function)
@@ -116,7 +120,7 @@ var GanttTimelineComponent = /** @class */ (function () {
116
120
  GanttTimelineComponent = tslib_1.__decorate([
117
121
  core_1.Component({
118
122
  selector: 'kendo-gantt-timeline',
119
- template: "\n <div class=\"k-timeline k-grid k-widget\">\n <div class=\"k-grid-header\">\n <div #timelineHeaderWrap class=\"k-grid-header-wrap\">\n <table\n role=\"presentation\"\n [style.width.px]=\"tableWidth\"\n >\n <tbody\n kendoGanttHeaderTableBody\n [groupSlots]=\"groupSlots\"\n [slots]=\"slots\">\n </tbody>\n </table>\n </div>\n </div>\n <div #timelineContent class=\"k-grid-content\">\n <div class=\"k-gantt-tables\">\n <table\n class=\"k-gantt-rows\"\n [style.width.px]=\"tableWidth\"\n role=\"presentation\"\n >\n <tbody>\n <tr *ngFor=\"let item of rows; let i = index;\"\n [class.k-alt]=\"i % 2\"\n >\n <td></td>\n </tr>\n </tbody>\n </table>\n\n <table\n #timelineColumns\n class=\"k-gantt-columns\"\n role=\"presentation\"\n [style.width.px]=\"tableWidth\"\n >\n <colgroup>\n <col *ngFor=\"let item of slots\">\n </colgroup>\n\n <tbody>\n <tr>\n <td *ngFor=\"let item of slots\"\n [class.k-nonwork-hour]=\"isNonWorking(item)\"\n >\n </td>\n </tr>\n </tbody>\n </table>\n\n <table\n #tasksContainer\n class=\"k-gantt-tasks\"\n role=\"presentation\"\n style=\"border-collapse: collapse;\"\n [style.width.px]=\"tableWidth\"\n >\n <tbody\n kendoGanttTasksTableBody\n [rows]=\"rows\"\n [activeView]=\"activeView\"\n [taskContentTemplate]=\"taskContentTemplate\"\n [taskTemplate]=\"taskTemplate\"\n [summaryTaskTemplate]=\"summaryTaskTemplate\"\n [taskClass]=\"taskClass\"\n [hasChildren]=\"hasChildren\"\n >\n </tbody>\n </table>\n </div>\n <svg class=\"k-gantt-dependencies-svg\">\n <polyline\n *ngFor=\"let dependency of dependencies\"\n kendoGanttDependency\n [dependency]=\"dependency\"\n />\n </svg>\n </div>\n </div>\n "
123
+ template: "\n <div class=\"k-timeline k-grid k-widget\">\n <div class=\"k-grid-header\">\n <div #timelineHeaderWrap class=\"k-grid-header-wrap\">\n <table\n role=\"presentation\"\n [style.width.px]=\"tableWidth\"\n >\n <tbody\n kendoGanttHeaderTableBody\n [groupSlots]=\"groupSlots\"\n [slots]=\"slots\">\n </tbody>\n </table>\n </div>\n </div>\n <div #timelineContent class=\"k-grid-content\">\n <div class=\"k-gantt-tables\">\n <table\n class=\"k-gantt-rows\"\n [style.width.px]=\"tableWidth\"\n role=\"presentation\"\n >\n <tbody>\n <tr *ngFor=\"let item of rows; let i = index;\"\n [class.k-alt]=\"i % 2\"\n >\n <td></td>\n </tr>\n </tbody>\n </table>\n\n <table\n #timelineColumns\n class=\"k-gantt-columns\"\n role=\"presentation\"\n [style.width.px]=\"tableWidth\"\n >\n <colgroup>\n <col *ngFor=\"let item of slots\">\n </colgroup>\n\n <tbody>\n <tr>\n <td *ngFor=\"let item of slots\"\n [class.k-nonwork-hour]=\"isNonWorking(item)\"\n >\n </td>\n </tr>\n </tbody>\n </table>\n\n <table\n #tasksContainer\n class=\"k-gantt-tasks\"\n role=\"presentation\"\n style=\"border-collapse: collapse;\"\n [style.width.px]=\"tableWidth\"\n >\n <tbody\n kendoGanttTasksTableBody\n [rows]=\"rows\"\n [activeView]=\"activeView\"\n [taskContentTemplate]=\"taskContentTemplate\"\n [taskTemplate]=\"taskTemplate\"\n [summaryTaskTemplate]=\"summaryTaskTemplate\"\n [taskClass]=\"taskClass\"\n [hasChildren]=\"hasChildren\"\n [isTaskSelected]=\"isTaskSelected\"\n >\n </tbody>\n </table>\n </div>\n <svg class=\"k-gantt-dependencies-svg\">\n <polyline\n *ngFor=\"let dependency of dependencies\"\n kendoGanttDependency\n [dependency]=\"dependency\"\n />\n </svg>\n </div>\n </div>\n "
120
124
  }),
121
125
  tslib_1.__metadata("design:paramtypes", [scroll_sync_service_1.ScrollSyncService,
122
126
  dependency_dom_service_1.DependencyDomService,
@@ -57,7 +57,7 @@ var ViewSelectorComponent = /** @class */ (function () {
57
57
  ViewSelectorComponent = tslib_1.__decorate([
58
58
  core_1.Component({
59
59
  selector: 'kendo-gantt-view-selector',
60
- template: "\n <select class=\"k-dropdown k-views-dropdown\"\n [value]=\"activeView\"\n (change)=\"activeViewChange.emit($event.target.value)\">\n <option *ngFor=\"let view of views\" [value]=\"view\">{{getViewTypeText(view)}}</option>\n </select>\n <kendo-buttongroup class=\"k-gantt-views\" selection=\"single\">\n <button *ngFor=\"let view of views\"\n kendoButton\n [selected]=\"view === activeView\"\n (click)=\"onClick(view)\">{{getViewTypeText(view)}}</button>\n </kendo-buttongroup>\n "
60
+ template: "\n <select class=\"k-dropdown k-views-dropdown\"\n [value]=\"activeView\"\n (change)=\"activeViewChange.emit($event.target.value)\">\n <option *ngFor=\"let view of views\" [value]=\"view\">{{getViewTypeText(view)}}</option>\n </select>\n <kendo-buttongroup class=\"k-gantt-views\" selection=\"single\">\n <button *ngFor=\"let view of views\"\n kendoButton\n type=\"button\"\n [selected]=\"view === activeView\"\n (click)=\"onClick(view)\">{{getViewTypeText(view)}}</button>\n </kendo-buttongroup>\n "
61
61
  }),
62
62
  tslib_1.__metadata("design:paramtypes", [kendo_angular_l10n_1.LocalizationService])
63
63
  ], ViewSelectorComponent);
package/dist/npm/utils.js CHANGED
@@ -108,6 +108,10 @@ exports.isColumnGroup = function (column) { return column.isColumnGroup; };
108
108
  * @hidden
109
109
  */
110
110
  exports.isNumber = function (contender) { return typeof contender === 'number' && !isNaN(contender); };
111
+ /**
112
+ * @hidden
113
+ */
114
+ exports.isString = function (contender) { return typeof contender === 'string'; };
111
115
  /**
112
116
  * @hidden
113
117
  *