@progress/kendo-angular-gantt 0.2.1-dev.202112091741 → 0.3.0-dev.202201131518

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 (158) hide show
  1. package/dist/cdn/js/kendo-angular-gantt.js +2 -2
  2. package/dist/cdn/main.js +4 -4
  3. package/dist/es/common/touch-enabled.js +9 -0
  4. package/dist/es/dependencies/utils.js +40 -5
  5. package/dist/es/dragging/dependency-drag-create.directive.js +347 -0
  6. package/dist/es/dragging/drag-validation-tooltip.component.js +27 -0
  7. package/dist/es/editing/add-task.component.js +94 -0
  8. package/dist/es/editing/dependencies-table.component.js +131 -0
  9. package/dist/es/editing/edit-dialog.component.js +37 -6
  10. package/dist/es/editing/edit.service.js +89 -7
  11. package/dist/es/editing/task-fields.component.js +43 -0
  12. package/dist/es/editing/{util.js → utils.js} +0 -0
  13. package/dist/es/expanded-state/expandable.directive.js +4 -6
  14. package/dist/es/gantt.component.js +230 -45
  15. package/dist/es/gantt.module.js +36 -10
  16. package/dist/es/index.js +8 -1
  17. package/dist/es/localization/gantt-localization.service.js +26 -0
  18. package/dist/es/localization/messages.js +45 -1
  19. package/dist/es/main.js +1 -0
  20. package/dist/es/models/dependency-type.enum.js +16 -0
  21. package/dist/es/models/events/{add-event.interface.js → dependency-add-event.interface.js} +0 -0
  22. package/dist/es/models/events/{edit-event.interface.js → task-add-event.interface.js} +0 -0
  23. package/dist/es/models/models.js +1 -0
  24. package/dist/es/models/{events/remove-event.interface.js → toolbar-settings.js} +0 -0
  25. package/dist/es/models/{toolbar-position.js → view-item.interface.js} +0 -0
  26. package/dist/es/package-metadata.js +1 -1
  27. package/dist/es/rendering/gantt-milestone-task.component.js +7 -4
  28. package/dist/es/rendering/gantt-summary-task.component.js +7 -4
  29. package/dist/es/rendering/gantt-task-base.js +30 -19
  30. package/dist/es/rendering/gantt-task.component.js +8 -6
  31. package/dist/es/rendering/gantt-tasks-table-body.component.js +5 -1
  32. package/dist/es/scrolling/drag-scroll-settings.js +20 -0
  33. package/dist/es/scrolling/timeline-scroll.directive.js +89 -0
  34. package/dist/es/scrolling/timeline-scroll.service.js +39 -0
  35. package/dist/es/scrolling/utils.js +80 -0
  36. package/dist/es/timeline/gantt-timeline.component.js +45 -3
  37. package/dist/es/toolbar/toolbar.component.js +9 -1
  38. package/dist/es/utils.js +143 -12
  39. package/dist/es2015/common/touch-enabled.d.ts +9 -0
  40. package/dist/es2015/common/touch-enabled.js +9 -0
  41. package/dist/es2015/dependencies/utils.d.ts +15 -0
  42. package/dist/es2015/dependencies/utils.js +40 -5
  43. package/dist/es2015/dragging/dependency-drag-create.directive.d.ts +72 -0
  44. package/dist/es2015/dragging/dependency-drag-create.directive.js +324 -0
  45. package/dist/es2015/dragging/drag-validation-tooltip.component.d.ts +29 -0
  46. package/dist/es2015/dragging/drag-validation-tooltip.component.js +76 -0
  47. package/dist/es2015/editing/add-task.component.d.ts +45 -0
  48. package/dist/es2015/editing/add-task.component.js +102 -0
  49. package/dist/es2015/editing/dependencies-table.component.d.ts +39 -0
  50. package/dist/es2015/editing/dependencies-table.component.js +160 -0
  51. package/dist/es2015/editing/edit-dialog.component.d.ts +10 -3
  52. package/dist/es2015/editing/edit-dialog.component.js +55 -33
  53. package/dist/es2015/editing/edit.service.d.ts +24 -3
  54. package/dist/es2015/editing/edit.service.js +78 -10
  55. package/dist/es2015/editing/task-fields.component.d.ts +22 -0
  56. package/dist/es2015/editing/task-fields.component.js +67 -0
  57. package/dist/es2015/editing/{util.d.ts → utils.d.ts} +0 -0
  58. package/dist/es2015/editing/{util.js → utils.js} +0 -0
  59. package/dist/es2015/expanded-state/expandable.directive.d.ts +1 -2
  60. package/dist/es2015/expanded-state/expandable.directive.js +2 -7
  61. package/dist/es2015/gantt.component.d.ts +62 -18
  62. package/dist/es2015/gantt.component.js +290 -43
  63. package/dist/es2015/gantt.module.js +36 -10
  64. package/dist/es2015/index.d.ts +8 -1
  65. package/dist/es2015/index.js +8 -1
  66. package/dist/es2015/index.metadata.json +1 -1
  67. package/dist/es2015/localization/{treelist-messages.directive.d.ts → gantt-localization.service.d.ts} +4 -3
  68. package/dist/es2015/localization/gantt-localization.service.js +25 -0
  69. package/dist/es2015/localization/messages.d.ts +46 -2
  70. package/dist/es2015/localization/messages.js +45 -1
  71. package/dist/es2015/main.d.ts +1 -0
  72. package/dist/es2015/main.js +1 -0
  73. package/dist/es2015/models/dependency-type.enum.d.ts +1 -1
  74. package/dist/es2015/models/dependency-type.enum.js +16 -0
  75. package/dist/es2015/models/events/dependency-add-event.interface.d.ts +26 -0
  76. package/dist/es2015/models/events/{add-event.interface.js → dependency-add-event.interface.js} +0 -0
  77. package/dist/es2015/models/events/task-add-event.interface.d.ts +31 -0
  78. package/dist/es2015/models/events/{edit-event.interface.js → task-add-event.interface.js} +0 -0
  79. package/dist/es2015/models/events/task-edit-event.interface.d.ts +17 -4
  80. package/dist/es2015/models/models.d.ts +4 -3
  81. package/dist/es2015/models/models.js +1 -0
  82. package/dist/es2015/models/toolbar-settings.d.ts +29 -0
  83. package/dist/es2015/models/{events/remove-event.interface.js → toolbar-settings.js} +0 -0
  84. package/dist/es2015/models/view-item.interface.d.ts +35 -0
  85. package/dist/es2015/models/{toolbar-position.js → view-item.interface.js} +0 -0
  86. package/dist/es2015/package-metadata.js +1 -1
  87. package/dist/es2015/rendering/gantt-milestone-task.component.d.ts +2 -1
  88. package/dist/es2015/rendering/gantt-milestone-task.component.js +18 -5
  89. package/dist/es2015/rendering/gantt-summary-task.component.d.ts +2 -1
  90. package/dist/es2015/rendering/gantt-summary-task.component.js +18 -5
  91. package/dist/es2015/rendering/gantt-task-base.d.ts +11 -5
  92. package/dist/es2015/rendering/gantt-task-base.js +30 -19
  93. package/dist/es2015/rendering/gantt-task.component.d.ts +2 -1
  94. package/dist/es2015/rendering/gantt-task.component.js +19 -7
  95. package/dist/es2015/rendering/gantt-tasks-table-body.component.d.ts +1 -0
  96. package/dist/es2015/rendering/gantt-tasks-table-body.component.js +10 -3
  97. package/dist/es2015/scrolling/drag-scroll-settings.d.ts +47 -0
  98. package/dist/es2015/scrolling/drag-scroll-settings.js +20 -0
  99. package/dist/es2015/scrolling/timeline-scroll.directive.d.ts +24 -0
  100. package/dist/es2015/scrolling/timeline-scroll.directive.js +78 -0
  101. package/dist/es2015/scrolling/timeline-scroll.service.d.ts +20 -0
  102. package/dist/es2015/scrolling/timeline-scroll.service.js +44 -0
  103. package/dist/es2015/scrolling/utils.d.ts +29 -0
  104. package/dist/es2015/scrolling/utils.js +80 -0
  105. package/dist/es2015/timeline/gantt-timeline.component.d.ts +25 -2
  106. package/dist/es2015/timeline/gantt-timeline.component.js +56 -3
  107. package/dist/es2015/toolbar/toolbar-template.directive.d.ts +1 -1
  108. package/dist/es2015/toolbar/toolbar.component.d.ts +2 -0
  109. package/dist/es2015/toolbar/toolbar.component.js +10 -0
  110. package/dist/es2015/utils.d.ts +70 -8
  111. package/dist/es2015/utils.js +143 -12
  112. package/dist/fesm2015/index.js +1981 -424
  113. package/dist/fesm5/index.js +1784 -391
  114. package/dist/npm/common/touch-enabled.js +11 -0
  115. package/dist/npm/dependencies/utils.js +40 -5
  116. package/dist/npm/dragging/dependency-drag-create.directive.js +349 -0
  117. package/dist/npm/dragging/drag-validation-tooltip.component.js +29 -0
  118. package/dist/npm/editing/add-task.component.js +96 -0
  119. package/dist/npm/editing/dependencies-table.component.js +133 -0
  120. package/dist/npm/editing/edit-dialog.component.js +36 -5
  121. package/dist/npm/editing/edit.service.js +88 -6
  122. package/dist/npm/editing/task-fields.component.js +45 -0
  123. package/dist/npm/editing/{util.js → utils.js} +0 -0
  124. package/dist/npm/expanded-state/expandable.directive.js +3 -5
  125. package/dist/npm/gantt.component.js +231 -46
  126. package/dist/npm/gantt.module.js +34 -8
  127. package/dist/npm/index.js +16 -2
  128. package/dist/npm/localization/gantt-localization.service.js +28 -0
  129. package/dist/npm/localization/messages.js +45 -1
  130. package/dist/npm/main.js +2 -0
  131. package/dist/npm/models/dependency-type.enum.js +16 -0
  132. package/dist/npm/models/events/{add-event.interface.js → dependency-add-event.interface.js} +0 -0
  133. package/dist/npm/models/events/{edit-event.interface.js → task-add-event.interface.js} +0 -0
  134. package/dist/npm/models/models.js +2 -0
  135. package/dist/npm/models/{events/remove-event.interface.js → toolbar-settings.js} +0 -0
  136. package/dist/npm/models/{toolbar-position.js → view-item.interface.js} +0 -0
  137. package/dist/npm/package-metadata.js +1 -1
  138. package/dist/npm/rendering/gantt-milestone-task.component.js +6 -3
  139. package/dist/npm/rendering/gantt-summary-task.component.js +6 -3
  140. package/dist/npm/rendering/gantt-task-base.js +30 -19
  141. package/dist/npm/rendering/gantt-task.component.js +7 -5
  142. package/dist/npm/rendering/gantt-tasks-table-body.component.js +5 -1
  143. package/dist/npm/scrolling/drag-scroll-settings.js +22 -0
  144. package/dist/npm/scrolling/timeline-scroll.directive.js +91 -0
  145. package/dist/npm/scrolling/timeline-scroll.service.js +41 -0
  146. package/dist/npm/scrolling/utils.js +83 -0
  147. package/dist/npm/timeline/gantt-timeline.component.js +44 -2
  148. package/dist/npm/toolbar/toolbar.component.js +9 -1
  149. package/dist/npm/utils.js +143 -12
  150. package/dist/systemjs/kendo-angular-gantt.js +1 -1
  151. package/package.json +9 -6
  152. package/dist/es/localization/treelist-messages.directive.js +0 -31
  153. package/dist/es2015/localization/treelist-messages.directive.js +0 -29
  154. package/dist/es2015/models/events/add-event.interface.d.ts +0 -16
  155. package/dist/es2015/models/events/edit-event.interface.d.ts +0 -19
  156. package/dist/es2015/models/events/remove-event.interface.d.ts +0 -16
  157. package/dist/es2015/models/toolbar-position.d.ts +0 -9
  158. package/dist/npm/localization/treelist-messages.directive.js +0 -33
@@ -3,25 +3,28 @@
3
3
  * Licensed under commercial license. See LICENSE.md in the project root for more information
4
4
  *-------------------------------------------------------------------------------------------*/
5
5
  import { __extends, __decorate, __metadata, __param, __assign } from 'tslib';
6
- import { Input, Injectable, EventEmitter, Directive, Optional, TemplateRef, QueryList, ContentChildren, ContentChild, Component, forwardRef, SkipSelf, Host, Injector, NgZone, isDevMode, ViewChild, HostBinding, Output, Renderer2, ElementRef, ChangeDetectorRef, NgModule } from '@angular/core';
6
+ import { Input, Injectable, EventEmitter, Directive, Optional, TemplateRef, QueryList, ContentChildren, ContentChild, Component, forwardRef, SkipSelf, Host, Injector, NgZone, ViewChild, ElementRef, ViewContainerRef, HostBinding, Output, Renderer2, isDevMode, InjectionToken, Inject, ChangeDetectorRef, NgModule } from '@angular/core';
7
7
  import { ColumnBase, ColumnComponent, ColumnGroupComponent, SpanColumnComponent, TreeListComponent, DataBoundTreeComponent, ExpandableTreeComponent, FlatBindingDirective, HierarchyBindingDirective, ExpandableDirective, TreeListModule } from '@progress/kendo-angular-treelist';
8
8
  import { cloneDate, addWeeks, firstDayInWeek, addDays, getDate, lastDayOfMonth, firstDayOfMonth, addMonths, isEqual, MS_PER_HOUR, MS_PER_DAY } from '@progress/kendo-date-math';
9
- import { of, fromEvent, Subject, Subscription } from 'rxjs';
9
+ import { of, fromEvent, Subject, Subscription, forkJoin, EMPTY, isObservable } from 'rxjs';
10
10
  import { validatePackage } from '@progress/kendo-licensing';
11
- import { isDocumentAvailable, closestInScope, matchesClasses, anyChanged, hasObservers, EventsModule } from '@progress/kendo-angular-common';
11
+ import { closestInScope, matchesClasses, isDocumentAvailable, anyChanged, hasObservers, EventsModule, DraggableModule } from '@progress/kendo-angular-common';
12
+ import { LocalizationService, ComponentMessages, L10N_PREFIX } from '@progress/kendo-angular-l10n';
12
13
  import { IntlService } from '@progress/kendo-angular-intl';
13
14
  import { orderBy } from '@progress/kendo-data-query';
14
- import { getter } from '@progress/kendo-common';
15
- import { map, distinctUntilChanged, take, filter, switchMap } from 'rxjs/operators';
16
- import { LocalizationService, ComponentMessages, L10N_PREFIX } from '@progress/kendo-angular-l10n';
15
+ import { getter, touchEnabled } from '@progress/kendo-common';
16
+ import { map, distinctUntilChanged, take, expand, reduce, filter, switchMap } from 'rxjs/operators';
17
17
  import { CommonModule } from '@angular/common';
18
- import { SplitterModule } from '@progress/kendo-angular-layout';
18
+ import { FormGroup, FormControl, Validators, FormArray, ReactiveFormsModule } from '@angular/forms';
19
+ import { SplitterModule, TabStripModule } from '@progress/kendo-angular-layout';
19
20
  import { ButtonsModule } from '@progress/kendo-angular-buttons';
20
21
  import { DialogModule } from '@progress/kendo-angular-dialog';
21
- import { FormGroup, ReactiveFormsModule } from '@angular/forms';
22
22
  import { LabelModule } from '@progress/kendo-angular-label';
23
23
  import { InputsModule } from '@progress/kendo-angular-inputs';
24
24
  import { DateInputsModule } from '@progress/kendo-angular-dateinputs';
25
+ import { PopupService, PopupModule } from '@progress/kendo-angular-popup';
26
+ import { GridModule } from '@progress/kendo-angular-grid';
27
+ import { DropDownsModule } from '@progress/kendo-angular-dropdowns';
25
28
 
26
29
  /**
27
30
  * @hidden
@@ -30,7 +33,7 @@ var packageMetadata = {
30
33
  name: '@progress/kendo-angular-gantt',
31
34
  productName: 'Kendo UI for Angular',
32
35
  productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
33
- publishDate: 1639071314,
36
+ publishDate: 1642086647,
34
37
  version: '',
35
38
  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'
36
39
  };
@@ -652,6 +655,64 @@ var taskClassCallback = function () { return null; };
652
655
  */
653
656
  var isSelected = function () { return false; };
654
657
 
658
+ /**
659
+ * The dependency type when two tasks are connected.
660
+ *
661
+ * The supported values are:
662
+ * * `FF`—from 'finish' to 'finish'
663
+ * * `FS`—from 'finish' to 'start'
664
+ * * `SS`—from 'start' to 'start'
665
+ * * `SF`—from 'start' to 'finish'
666
+ */
667
+ var DependencyType;
668
+ (function (DependencyType) {
669
+ DependencyType[DependencyType["FF"] = 0] = "FF";
670
+ DependencyType[DependencyType["FS"] = 1] = "FS";
671
+ DependencyType[DependencyType["SF"] = 2] = "SF";
672
+ DependencyType[DependencyType["SS"] = 3] = "SS"; // task B can't start before task A starts
673
+ })(DependencyType || (DependencyType = {}));
674
+
675
+ /**
676
+ * @hidden
677
+ */
678
+ var PreventableEvent = /** @class */ (function () {
679
+ function PreventableEvent() {
680
+ this.prevented = false;
681
+ }
682
+ /**
683
+ * Prevents the default action for a specified event.
684
+ * In this way, the source component suppresses
685
+ * the built-in behavior that follows the event.
686
+ */
687
+ PreventableEvent.prototype.preventDefault = function () {
688
+ this.prevented = true;
689
+ };
690
+ /**
691
+ * Returns `true` if the event was prevented
692
+ * by any of its subscribers.
693
+ *
694
+ * @returns `true` if the default action was prevented.
695
+ * Otherwise, returns `false`.
696
+ */
697
+ PreventableEvent.prototype.isDefaultPrevented = function () {
698
+ return this.prevented;
699
+ };
700
+ return PreventableEvent;
701
+ }());
702
+
703
+ /**
704
+ * Called every time a user leaves an edited cell.
705
+ */
706
+ var CellCloseEvent = /** @class */ (function (_super) {
707
+ __extends(CellCloseEvent, _super);
708
+ function CellCloseEvent(options) {
709
+ var _this = _super.call(this) || this;
710
+ Object.assign(_this, options);
711
+ return _this;
712
+ }
713
+ return CellCloseEvent;
714
+ }(PreventableEvent));
715
+
655
716
  /**
656
717
  * @hidden
657
718
  */
@@ -754,15 +815,34 @@ var isNumber = function (contender) { return typeof contender === 'number' && !i
754
815
  * @hidden
755
816
  */
756
817
  var isString = function (contender) { return typeof contender === 'string'; };
818
+ /**
819
+ * @hidden
820
+ *
821
+ * Gets the closest timeline task wrapper element from an event target.
822
+ * Restricts the search up to the provided parent element from the second param.
823
+ */
824
+ var getClosestTaskWrapper = function (element, parentScope) {
825
+ return closestInScope(element, matchesClasses('k-task-wrap'), parentScope);
826
+ };
827
+ /**
828
+ * @hidden
829
+ *
830
+ * Checks whether the queried item or its parent items has a `k-task-wrap` selector.
831
+ * Restricts the search up to the provided parent element from the second param.
832
+ */
833
+ var isTaskWrapper = function (contender, parentScope) {
834
+ var taskWrapper = closestInScope(contender, matchesClasses('k-task-wrap'), parentScope);
835
+ return isPresent(taskWrapper);
836
+ };
757
837
  /**
758
838
  * @hidden
759
839
  *
760
840
  * Gets the closest timeline task element index from an event target.
761
841
  * Uses the `data-task-index` attribute assigned to each task.
762
- * Restricts the search up to the provided gantt element from the second param.
842
+ * Restricts the search up to the provided parent element from the second param.
763
843
  */
764
- var getClosestTaskIndex = function (element, gantt) {
765
- var task = closestInScope(element, matchesClasses('k-task'), gantt);
844
+ var getClosestTaskIndex = function (element, parentScope) {
845
+ var task = closestInScope(element, matchesClasses('k-task-wrap'), parentScope);
766
846
  if (!isPresent(task)) {
767
847
  return null;
768
848
  }
@@ -772,22 +852,133 @@ var getClosestTaskIndex = function (element, gantt) {
772
852
  * @hidden
773
853
  *
774
854
  * Checks whether the queried item or its parent items has a `k-task` selector.
775
- * Restricts the search up to the provided gantt element from the second param.
855
+ * Restricts the search up to the provided parent element from the second param.
776
856
  */
777
- var isTask = function (contender, gantt) {
778
- var task = closestInScope(contender, matchesClasses('k-task'), gantt);
857
+ var isTask = function (contender, parentScope) {
858
+ var task = closestInScope(contender, matchesClasses('k-task'), parentScope);
779
859
  return isPresent(task);
780
860
  };
781
861
  /**
782
862
  * @hidden
783
863
  *
784
864
  * Checks whether the queried item or its parent items has a `k-task-actions` selector - used for the clear button.
785
- * Restricts the search up to the provided gantt element from the second param.
865
+ * Restricts the search up to the provided parent element from the second param.
786
866
  */
787
- var isClearButton = function (contender, gantt) {
788
- var clearButtonContainer = closestInScope(contender, matchesClasses('k-task-actions'), gantt);
867
+ var isClearButton = function (contender, parentScope) {
868
+ var clearButtonContainer = closestInScope(contender, matchesClasses('k-task-actions'), parentScope);
789
869
  return isPresent(clearButtonContainer);
790
870
  };
871
+ /**
872
+ * @hidden
873
+ *
874
+ * Checks whether the queried item has a `k-task-dot` selector - used for the dependency drag clues.
875
+ */
876
+ var isDependencyDragClue = function (element) {
877
+ if (!isPresent(element)) {
878
+ return false;
879
+ }
880
+ return element.classList.contains('k-task-dot');
881
+ };
882
+ /**
883
+ * @hidden
884
+ *
885
+ * Checks whether the queried item has a `k-task-dot` & `k-task-start` selector - used for the dependency drag start clues.
886
+ */
887
+ var isDependencyDragStartClue = function (element) {
888
+ if (!isPresent(element)) {
889
+ return false;
890
+ }
891
+ return element.classList.contains('k-task-dot') && element.classList.contains('k-task-start');
892
+ };
893
+ /**
894
+ * @hidden
895
+ *
896
+ * Gets the `DependencyType` for an attempted dependency create from the provided two elements.
897
+ * The two linked drag clue HTML elements are used to extract this data (via their CSS classes).
898
+ */
899
+ var getDependencyTypeFromTargetTasks = function (fromTaskClue, toTaskClue) {
900
+ if (!isDependencyDragClue(fromTaskClue) || !isDependencyDragClue(toTaskClue)) {
901
+ return null;
902
+ }
903
+ var fromTaskType = isDependencyDragStartClue(fromTaskClue) ? 'S' : 'F';
904
+ var toTaskType = isDependencyDragStartClue(toTaskClue) ? 'S' : 'F';
905
+ var dependencyTypeName = "" + fromTaskType + toTaskType;
906
+ switch (dependencyTypeName) {
907
+ case 'FF': return DependencyType.FF;
908
+ case 'FS': return DependencyType.FS;
909
+ case 'SF': return DependencyType.SF;
910
+ case 'SS': return DependencyType.SS;
911
+ default: return null;
912
+ }
913
+ };
914
+ /**
915
+ * @hidden
916
+ *
917
+ * Checks whether the two provided drag clues belong to the same task element.
918
+ */
919
+ var sameTaskClues = function (fromTaskClue, toTaskClue, parentScope) {
920
+ if (!isPresent(fromTaskClue) || !isPresent(toTaskClue)) {
921
+ return false;
922
+ }
923
+ var fromTaskWrapper = getClosestTaskWrapper(fromTaskClue, parentScope);
924
+ var toTaskWrapper = getClosestTaskWrapper(toTaskClue, parentScope);
925
+ return fromTaskWrapper === toTaskWrapper;
926
+ };
927
+ /**
928
+ * @hidden
929
+ *
930
+ * Fits a contender number between a min and max range.
931
+ * If the contender is below the min value, the min value is returned.
932
+ * If the contender is above the max value, the max value is returned.
933
+ */
934
+ var fitToRange = function (contender, min, max) {
935
+ if (contender > max) {
936
+ return max;
937
+ }
938
+ else if (contender < min) {
939
+ return min;
940
+ }
941
+ else {
942
+ return contender;
943
+ }
944
+ };
945
+ /**
946
+ * @hidden
947
+ *
948
+ * Checks whether either of the two provided tasks is a parent of the other.
949
+ */
950
+ var areParentChild = function (taskA, taskB) {
951
+ var parentChildRelationship = false;
952
+ var taskAParent = taskA;
953
+ while (isPresent(taskAParent) && isPresent(taskAParent.data)) {
954
+ if (taskAParent.data === taskB.data) {
955
+ parentChildRelationship = true;
956
+ break;
957
+ }
958
+ taskAParent = taskAParent.parent;
959
+ }
960
+ var taskBParent = taskB;
961
+ while (!parentChildRelationship && isPresent(taskBParent) && isPresent(taskBParent.data)) {
962
+ if (taskBParent.data === taskA.data) {
963
+ parentChildRelationship = true;
964
+ break;
965
+ }
966
+ taskBParent = taskBParent.parent;
967
+ }
968
+ return parentChildRelationship;
969
+ };
970
+ /**
971
+ * @hidden
972
+ *
973
+ * Extracts an element from the provided client coords.
974
+ * Using the `event.target` is not reliable under mobile devices with the current implementation of the draggable, so use this instead.
975
+ */
976
+ var elementFromPoint = function (clientX, clientY) {
977
+ if (!isDocumentAvailable()) {
978
+ return null;
979
+ }
980
+ return document.elementFromPoint(clientX, clientY);
981
+ };
791
982
 
792
983
  /**
793
984
  * @hidden
@@ -1380,34 +1571,164 @@ var DependencyDomService = /** @class */ (function () {
1380
1571
  * @hidden
1381
1572
  */
1382
1573
  var EditService = /** @class */ (function () {
1383
- function EditService() {
1574
+ function EditService(mapper) {
1575
+ var _this = this;
1576
+ this.mapper = mapper;
1384
1577
  this.showEditingDialog = new Subject();
1385
1578
  this.showConfirmationDialog = new Subject();
1386
1579
  this.editEvent = new Subject();
1580
+ this.addEvent = new Subject();
1581
+ this.updatedItems = [];
1582
+ this.deletedItems = [];
1583
+ this.itemIndex = function (item, data) {
1584
+ return data.findIndex(function (dataItem) { return _this.mapper.extractFromTask(dataItem, 'id') === _this.mapper.extractFromTask(item, 'id'); });
1585
+ };
1387
1586
  }
1388
- EditService.prototype.createEditDialog = function (dataItem, formGroup) {
1587
+ Object.defineProperty(EditService.prototype, "dependencies", {
1588
+ get: function () {
1589
+ return this.predecessors.concat(this.successors);
1590
+ },
1591
+ set: function (items) {
1592
+ var _this = this;
1593
+ // Can this whole thing be moved to edit-dialog? Dependencies might not be needed here
1594
+ var dataItemId = this.mapper.extractFromTask(this.dataItem, 'id');
1595
+ this.predecessors = items.filter(function (item) { return _this.mapper.extractFromDependency(item, 'toId') === dataItemId; });
1596
+ this.successors = items.filter(function (item) { return _this.mapper.extractFromDependency(item, 'fromId') === dataItemId; });
1597
+ },
1598
+ enumerable: true,
1599
+ configurable: true
1600
+ });
1601
+ EditService.prototype.createEditDialog = function (dataItem, taskFormGroup, dependencies) {
1389
1602
  this.dataItem = dataItem;
1390
- this.formGroup = formGroup;
1603
+ this.taskFormGroup = taskFormGroup;
1604
+ this.dependencies = dependencies;
1391
1605
  this.showEditingDialog.next(true);
1392
1606
  };
1393
1607
  EditService.prototype.closeEditDialog = function () {
1394
1608
  this.showEditingDialog.next(false);
1395
1609
  this.dataItem = undefined;
1396
- this.formGroup = undefined;
1610
+ this.taskFormGroup = undefined;
1611
+ this.dependencies = [];
1612
+ this.updatedItems = [];
1613
+ this.deletedItems = [];
1397
1614
  };
1398
1615
  EditService.prototype.triggerEditEvent = function (editResultType) {
1399
1616
  this.editEvent.next({
1400
- formGroup: this.formGroup,
1617
+ taskFormGroup: this.taskFormGroup,
1401
1618
  dataItem: this.dataItem,
1619
+ dependencies: {
1620
+ createdItems: this.getCreatedDependencies(),
1621
+ updatedItems: this.updatedItems,
1622
+ deletedItems: this.deletedItems
1623
+ },
1402
1624
  editResultType: editResultType
1403
1625
  });
1404
1626
  };
1627
+ EditService.prototype.updateDependencies = function (item) {
1628
+ if (!this.isNew(item)) {
1629
+ // update
1630
+ var index = this.itemIndex(item, this.updatedItems);
1631
+ if (index !== -1) {
1632
+ this.updatedItems.splice(index, 1, item);
1633
+ }
1634
+ else {
1635
+ this.updatedItems.push(item);
1636
+ }
1637
+ }
1638
+ };
1639
+ EditService.prototype.getCreatedDependencies = function () {
1640
+ var _this = this;
1641
+ return this.dependencies.filter(function (item) { return _this.mapper.extractFromDependency(item, 'id') === null; });
1642
+ };
1643
+ EditService.prototype.deleteDependency = function (item) {
1644
+ var updatedIndex = this.itemIndex(item, this.updatedItems);
1645
+ if (updatedIndex !== -1) {
1646
+ this.updatedItems.splice(updatedIndex, 1);
1647
+ }
1648
+ if (!this.isNew(item)) {
1649
+ this.deletedItems.push(item);
1650
+ }
1651
+ };
1652
+ EditService.prototype.loadTasks = function (initialValues, isInitializer) {
1653
+ var _this = this;
1654
+ if (isInitializer === void 0) { isInitializer = true; }
1655
+ return forkJoin(initialValues.map(function (v) { return _this.getElementById(v); })).pipe(map(function (value) {
1656
+ return value.reduce(function (acc, item) { return acc = acc.concat(normalizeGanttData(item)); }, []);
1657
+ }), expand(function (values) {
1658
+ if (values.some(function (el) { return _this.hasChildren(el); })) {
1659
+ return _this.loadTasks(values, false);
1660
+ }
1661
+ return EMPTY;
1662
+ }), reduce(function (acc, values) { return acc.concat(values); }, isInitializer ? initialValues.slice() : []));
1663
+ };
1664
+ EditService.prototype.getElementById = function (item) {
1665
+ var children = this.fetchChildren(item);
1666
+ if (isObservable(children)) {
1667
+ return children;
1668
+ }
1669
+ return of(children);
1670
+ };
1671
+ EditService.prototype.isNew = function (item) {
1672
+ return !isPresent(this.mapper.extractFromDependency(item, 'id'));
1673
+ };
1405
1674
  EditService = __decorate([
1406
- Injectable()
1675
+ Injectable(),
1676
+ __metadata("design:paramtypes", [MappingService])
1407
1677
  ], EditService);
1408
1678
  return EditService;
1409
1679
  }());
1410
1680
 
1681
+ /**
1682
+ * @hidden
1683
+ *
1684
+ * Notifies the timeline-scroll.directive to scroll into view to requested coordinates.
1685
+ * The scrolling is performed based on client (viewport) coordinates.
1686
+ */
1687
+ var TimelineScrollService = /** @class */ (function () {
1688
+ function TimelineScrollService() {
1689
+ this.horizontalScroll = new Subject();
1690
+ this.verticalScroll = new Subject();
1691
+ this.scrollCancel = new Subject();
1692
+ }
1693
+ TimelineScrollService.prototype.ngOnDestroy = function () {
1694
+ this.horizontalScroll.complete();
1695
+ this.verticalScroll.complete();
1696
+ this.scrollCancel.complete();
1697
+ };
1698
+ TimelineScrollService.prototype.requestHorizontalScroll = function (clientTop) {
1699
+ this.horizontalScroll.next(clientTop);
1700
+ };
1701
+ TimelineScrollService.prototype.requestVerticalScroll = function (clientLeft) {
1702
+ this.verticalScroll.next(clientLeft);
1703
+ };
1704
+ TimelineScrollService.prototype.requestScrollCancel = function () {
1705
+ this.scrollCancel.next();
1706
+ };
1707
+ TimelineScrollService = __decorate([
1708
+ Injectable()
1709
+ ], TimelineScrollService);
1710
+ return TimelineScrollService;
1711
+ }());
1712
+
1713
+ /**
1714
+ * @hidden
1715
+ *
1716
+ * Needed to keep the Gantt's LocalizationService reference and be able to use it component's inside the TabStrip
1717
+ */
1718
+ var GanttLocalizationService = /** @class */ (function () {
1719
+ function GanttLocalizationService(localizationService) {
1720
+ this.localizationService = localizationService;
1721
+ }
1722
+ GanttLocalizationService.prototype.get = function (token) {
1723
+ return this.localizationService.get(token);
1724
+ };
1725
+ GanttLocalizationService = __decorate([
1726
+ Injectable(),
1727
+ __metadata("design:paramtypes", [LocalizationService])
1728
+ ], GanttLocalizationService);
1729
+ return GanttLocalizationService;
1730
+ }());
1731
+
1411
1732
  /**
1412
1733
  * @hidden
1413
1734
  */
@@ -1674,34 +1995,194 @@ var ToolbarTemplateDirective = /** @class */ (function () {
1674
1995
  }());
1675
1996
 
1676
1997
  /**
1677
- * The base class for the column components of the Gantt.
1998
+ * @hidden
1678
1999
  */
1679
- var ViewBase = /** @class */ (function () {
1680
- /**
1681
- *
1682
- * @hidden
1683
- */
1684
- function ViewBase(optionChangesService, dependencyDomService) {
1685
- this.optionChangesService = optionChangesService;
2000
+ var GanttTimelineComponent = /** @class */ (function () {
2001
+ function GanttTimelineComponent(scrollSyncService, dependencyDomService, renderer, zone) {
2002
+ var _this = this;
2003
+ this.scrollSyncService = scrollSyncService;
1686
2004
  this.dependencyDomService = dependencyDomService;
2005
+ this.renderer = renderer;
2006
+ this.zone = zone;
2007
+ this.hostClass = true;
2008
+ this.dependencies = [];
2009
+ // as all drag-and-drop operations are on the timeline container, use a single draggable instance
2010
+ this.timelineContainerPress = new EventEmitter();
2011
+ this.timelineContainerDrag = new EventEmitter();
2012
+ this.timelineContainerRelease = new EventEmitter();
2013
+ this.subscriptions = new Subscription();
2014
+ this.subscriptions.add(
2015
+ // task changes indicates change in row content, number, height, etc.
2016
+ this.dependencyDomService.taskChanges
2017
+ .pipe(filter(function (args) { return isPresent(args.timelineRow); }), switchMap(function (args) { return _this.zone.onStable.pipe(take(1), map(function () { return args; })); }) // ensure the content is rendered
2018
+ )
2019
+ .subscribe(function (_a) {
2020
+ var timelineRow = _a.timelineRow;
2021
+ var timelineRowHeight = isDocumentAvailable() ? timelineRow.getBoundingClientRect().height : 0;
2022
+ _this.renderer.setStyle(_this.timelineColumns.nativeElement, 'height', (_this.rows || []).length * timelineRowHeight + "px");
2023
+ }));
2024
+ }
2025
+ Object.defineProperty(GanttTimelineComponent.prototype, "draggableEnabled", {
1687
2026
  /**
1688
- * The width of the time slot headers. Values are treated as pixels.
1689
- *
1690
- * @default 100
2027
+ * Specifies whether the draggable will attach or detach its pointer event listeners.
1691
2028
  */
1692
- this.slotWidth = 100;
1693
- }
1694
- ViewBase.prototype.ngOnChanges = function (changes) {
1695
- if (anyChanged(['slotWidth'], changes)) {
1696
- this.optionChangesService.notifyColumnChanges();
1697
- this.dependencyDomService.notifyChanges();
1698
- }
2029
+ get: function () {
2030
+ return this.renderDependencyDragClues;
2031
+ },
2032
+ enumerable: true,
2033
+ configurable: true
2034
+ });
2035
+ GanttTimelineComponent.prototype.ngAfterViewInit = function () {
2036
+ var timelineHeader = this.timelineHeaderWrap.nativeElement;
2037
+ var rightContainer = this.timelineContent.nativeElement;
2038
+ this.scrollSyncService.registerElement(rightContainer, 'timeline');
2039
+ this.scrollSyncService.registerElement(timelineHeader, 'header');
2040
+ this.dependencyDomService.registerContentContainer(this.tasksContainer.nativeElement);
2041
+ };
2042
+ GanttTimelineComponent.prototype.ngOnDestroy = function () {
2043
+ this.subscriptions.unsubscribe();
1699
2044
  };
2045
+ GanttTimelineComponent.prototype.isNonWorking = function (item) {
2046
+ return item.hasOwnProperty('isWorking') && !item.isWorking;
2047
+ };
2048
+ __decorate([
2049
+ ViewChild('timelineContent', { static: true }),
2050
+ __metadata("design:type", ElementRef)
2051
+ ], GanttTimelineComponent.prototype, "timelineContent", void 0);
2052
+ __decorate([
2053
+ ViewChild('timelineColumns', { static: true }),
2054
+ __metadata("design:type", ElementRef)
2055
+ ], GanttTimelineComponent.prototype, "timelineColumns", void 0);
2056
+ __decorate([
2057
+ ViewChild('timelineHeaderWrap', { static: true }),
2058
+ __metadata("design:type", ElementRef)
2059
+ ], GanttTimelineComponent.prototype, "timelineHeaderWrap", void 0);
2060
+ __decorate([
2061
+ ViewChild('tasksContainer', { static: true }),
2062
+ __metadata("design:type", ElementRef)
2063
+ ], GanttTimelineComponent.prototype, "tasksContainer", void 0);
2064
+ __decorate([
2065
+ ViewChild('dragPopupContainer', { static: false, read: ViewContainerRef }),
2066
+ __metadata("design:type", ViewContainerRef)
2067
+ ], GanttTimelineComponent.prototype, "dragPopupContainer", void 0);
2068
+ __decorate([
2069
+ ViewChild('dependencyDragCreatePolyline', { static: false }),
2070
+ __metadata("design:type", ElementRef)
2071
+ ], GanttTimelineComponent.prototype, "dependencyDragCreatePolyline", void 0);
2072
+ __decorate([
2073
+ HostBinding('class.k-gantt-timeline'),
2074
+ __metadata("design:type", Boolean)
2075
+ ], GanttTimelineComponent.prototype, "hostClass", void 0);
2076
+ __decorate([
2077
+ Input(),
2078
+ __metadata("design:type", Array)
2079
+ ], GanttTimelineComponent.prototype, "rows", void 0);
2080
+ __decorate([
2081
+ Input(),
2082
+ __metadata("design:type", Array)
2083
+ ], GanttTimelineComponent.prototype, "slots", void 0);
2084
+ __decorate([
2085
+ Input(),
2086
+ __metadata("design:type", Array)
2087
+ ], GanttTimelineComponent.prototype, "groupSlots", void 0);
1700
2088
  __decorate([
1701
2089
  Input(),
1702
2090
  __metadata("design:type", Number)
1703
- ], ViewBase.prototype, "slotWidth", void 0);
1704
- return ViewBase;
2091
+ ], GanttTimelineComponent.prototype, "tableWidth", void 0);
2092
+ __decorate([
2093
+ Input(),
2094
+ __metadata("design:type", String)
2095
+ ], GanttTimelineComponent.prototype, "activeView", void 0);
2096
+ __decorate([
2097
+ Input(),
2098
+ __metadata("design:type", TemplateRef)
2099
+ ], GanttTimelineComponent.prototype, "taskContentTemplate", void 0);
2100
+ __decorate([
2101
+ Input(),
2102
+ __metadata("design:type", TemplateRef)
2103
+ ], GanttTimelineComponent.prototype, "taskTemplate", void 0);
2104
+ __decorate([
2105
+ Input(),
2106
+ __metadata("design:type", TemplateRef)
2107
+ ], GanttTimelineComponent.prototype, "summaryTaskTemplate", void 0);
2108
+ __decorate([
2109
+ Input(),
2110
+ __metadata("design:type", Function)
2111
+ ], GanttTimelineComponent.prototype, "taskClass", void 0);
2112
+ __decorate([
2113
+ Input(),
2114
+ __metadata("design:type", Function)
2115
+ ], GanttTimelineComponent.prototype, "isTaskSelected", void 0);
2116
+ __decorate([
2117
+ Input(),
2118
+ __metadata("design:type", Boolean)
2119
+ ], GanttTimelineComponent.prototype, "renderDependencyDragClues", void 0);
2120
+ __decorate([
2121
+ Input(),
2122
+ __metadata("design:type", Object)
2123
+ ], GanttTimelineComponent.prototype, "dragScrollSettings", void 0);
2124
+ __decorate([
2125
+ Input(),
2126
+ __metadata("design:type", Function)
2127
+ ], GanttTimelineComponent.prototype, "hasChildren", void 0);
2128
+ __decorate([
2129
+ Input(),
2130
+ __metadata("design:type", Array)
2131
+ ], GanttTimelineComponent.prototype, "dependencies", void 0);
2132
+ __decorate([
2133
+ Output(),
2134
+ __metadata("design:type", EventEmitter)
2135
+ ], GanttTimelineComponent.prototype, "timelineContainerPress", void 0);
2136
+ __decorate([
2137
+ Output(),
2138
+ __metadata("design:type", EventEmitter)
2139
+ ], GanttTimelineComponent.prototype, "timelineContainerDrag", void 0);
2140
+ __decorate([
2141
+ Output(),
2142
+ __metadata("design:type", EventEmitter)
2143
+ ], GanttTimelineComponent.prototype, "timelineContainerRelease", void 0);
2144
+ GanttTimelineComponent = __decorate([
2145
+ Component({
2146
+ selector: 'kendo-gantt-timeline',
2147
+ 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\n #timelineContent\n class=\"k-grid-content\"\n kendoGanttTimelineScrollable\n [scrollSettings]=\"dragScrollSettings\"\n kendoDraggable\n [enableDrag]=\"draggableEnabled\"\n (kendoPress)=\"timelineContainerPress.emit($event)\"\n (kendoDrag)=\"timelineContainerDrag.emit($event)\"\n (kendoRelease)=\"timelineContainerRelease.emit($event)\"\n >\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 [renderDependencyDragClues]=\"renderDependencyDragClues\"\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 <polyline #dependencyDragCreatePolyline />\n </svg>\n\n <!-- placeholder for the dependency drag popup; its position is not arbitrary - the popup is intended to be absolutely positioned inside the .k-grid-content element -->\n <ng-container #dragPopupContainer></ng-container>\n </div>\n </div>\n "
2148
+ }),
2149
+ __metadata("design:paramtypes", [ScrollSyncService,
2150
+ DependencyDomService,
2151
+ Renderer2,
2152
+ NgZone])
2153
+ ], GanttTimelineComponent);
2154
+ return GanttTimelineComponent;
2155
+ }());
2156
+
2157
+ /**
2158
+ * The base class for the column components of the Gantt.
2159
+ */
2160
+ var ViewBase = /** @class */ (function () {
2161
+ /**
2162
+ *
2163
+ * @hidden
2164
+ */
2165
+ function ViewBase(optionChangesService, dependencyDomService) {
2166
+ this.optionChangesService = optionChangesService;
2167
+ this.dependencyDomService = dependencyDomService;
2168
+ /**
2169
+ * The width of the time slot headers. Values are treated as pixels.
2170
+ *
2171
+ * @default 100
2172
+ */
2173
+ this.slotWidth = 100;
2174
+ }
2175
+ ViewBase.prototype.ngOnChanges = function (changes) {
2176
+ if (anyChanged(['slotWidth'], changes)) {
2177
+ this.optionChangesService.notifyColumnChanges();
2178
+ this.dependencyDomService.notifyChanges();
2179
+ }
2180
+ };
2181
+ __decorate([
2182
+ Input(),
2183
+ __metadata("design:type", Number)
2184
+ ], ViewBase.prototype, "slotWidth", void 0);
2185
+ return ViewBase;
1705
2186
  }());
1706
2187
 
1707
2188
  /**
@@ -1718,6 +2199,12 @@ var mapPath = function (item) { return ({
1718
2199
 
1719
2200
  var TREELIST_GROUP_COLUMNS_CLASS = 'k-gantt-treelist-nested-columns';
1720
2201
  var DEFAULT_VIEW = 'week';
2202
+ var DEFAULT_DRAG_SCROLL_SETTINGS = {
2203
+ enabled: true,
2204
+ step: 3,
2205
+ interval: 1,
2206
+ threshold: 10
2207
+ };
1721
2208
  /**
1722
2209
  * Represents the Kendo UI Gantt component for Angular.
1723
2210
  *
@@ -1804,11 +2291,22 @@ var GanttComponent = /** @class */ (function () {
1804
2291
  this.zone = zone;
1805
2292
  this.hostClasses = true;
1806
2293
  /**
1807
- * Provides a callback that determines if the given task is selected ([see example]({% slug selection_gantt %}#toc-custom-selection))
2294
+ * Specifies a callback that determines if the given task is selected ([see example]({% slug selection_gantt %}#toc-custom-selection)).
1808
2295
  *
1809
2296
  * > The [`selectable`]({% slug api_gantt_ganttcomponent %}#toc-selectable) prop has to be set to `true` in order for this callback to be executed.
1810
2297
  */
1811
2298
  this.isSelected = isSelected;
2299
+ /**
2300
+ * Specifies a callback that determines if a new dependency is valid.
2301
+ * Used when evaluating if an attempt to create a new dependency will result in a valid link between the two tasks
2302
+ * [see example]({% slug editing_drag_create_dependencies_gantt %}#toc-validation).
2303
+ *
2304
+ * By defalut, dependencies are deemed invalid when:
2305
+ * - The two tasks are in a parent-child relationship.
2306
+ * - The two tasks are already dependent on one another. Only one dependency is allowed per pair.
2307
+ * - The start or end times of the two tasks are incompatible with the attempted dependency type.
2308
+ */
2309
+ this.validateNewDependency = this.defaultValidateNewDependencyCallback.bind(this);
1812
2310
  /**
1813
2311
  * Fires when the Gantt selection is changed through user interaction.
1814
2312
  *
@@ -1824,25 +2322,6 @@ var GanttComponent = /** @class */ (function () {
1824
2322
  * > When applied, the [`SelectableDirective`]({% slug api_gantt_selectabledirective %}) sets `selectable` to `true` internally.
1825
2323
  */
1826
2324
  this.selectable = false;
1827
- /**
1828
- * The position of the toolbar.
1829
- *
1830
- * The possible values are:
1831
- * - `top`&mdash;Positions the toolbar above the Gantt panes.
1832
- * - `bottom`&mdash;Positions the toolbar below the Gantt panes.
1833
- * - `both`&mdash;Displays two toolbar instances. Positions the first one above,
1834
- * and the second one - below the Gantt panes.
1835
- * - `none`&mdash;No toolbar is rendered.
1836
- */
1837
- this.toolbarPosition = 'top';
1838
- /**
1839
- * Gets or sets the callback function that retrieves the child items for a particular item.
1840
- */
1841
- this.fetchChildren = fetchChildren;
1842
- /**
1843
- * Gets or sets the callback function that indicates if a particular item has child items.
1844
- */
1845
- this.hasChildren = hasChildren;
1846
2325
  /**
1847
2326
  * Defines the dependencies that will be drawn between the rendered tasks.
1848
2327
  *
@@ -1944,6 +2423,15 @@ var GanttComponent = /** @class */ (function () {
1944
2423
  * Fires when the user saves an edited task.
1945
2424
  */
1946
2425
  this.save = new EventEmitter();
2426
+ /**
2427
+ * Fires when the user adds a task.
2428
+ */
2429
+ this.taskAdd = new EventEmitter();
2430
+ /**
2431
+ * Fires when the user adds a dependency via dragging
2432
+ * [see example]({% slug editing_drag_create_dependencies_gantt %}#toc-basic-concepts).
2433
+ */
2434
+ this.dependencyAdd = new EventEmitter();
1947
2435
  /**
1948
2436
  * Fires when the sorting of the Gantt is changed.
1949
2437
  * You have to handle the event yourself and sort the data.
@@ -2000,6 +2488,15 @@ var GanttComponent = /** @class */ (function () {
2000
2488
  * Fires when a task is clicked.
2001
2489
  */
2002
2490
  this.taskClick = new EventEmitter();
2491
+ /**
2492
+ * @hidden
2493
+ *
2494
+ * Specifies whether the dependency drag clues will be rendered.
2495
+ * Set internally by the dependency-drag-create directive.
2496
+ *
2497
+ * @default false
2498
+ */
2499
+ this.renderDependencyDragClues = false;
2003
2500
  /**
2004
2501
  * @hidden
2005
2502
  *
@@ -2016,11 +2513,19 @@ var GanttComponent = /** @class */ (function () {
2016
2513
  this.showConfirmationDialog = false;
2017
2514
  this._columns = new QueryList();
2018
2515
  this._data = [];
2516
+ this._dragScrollSettings = __assign({}, DEFAULT_DRAG_SCROLL_SETTINGS);
2019
2517
  this._timelinePaneOptions = __assign({}, DEFAULT_TIMELINE_PANE_SETTINGS);
2020
2518
  this._treeListPaneOptions = __assign({}, DEFAULT_TREELIST_PANE_SETTINGS);
2021
2519
  this._rowClass = rowClassCallback;
2022
2520
  this._taskClass = taskClassCallback;
2023
2521
  this._activeView = DEFAULT_VIEW;
2522
+ this._toolbarSettings = {
2523
+ position: 'top',
2524
+ addTaskTool: 'none',
2525
+ viewSelectorTool: 'top'
2526
+ };
2527
+ this._fetchChildren = fetchChildren;
2528
+ this._hasChildren = hasChildren;
2024
2529
  this.rtl = false;
2025
2530
  this.optionChangesSubscriptions = new Subscription();
2026
2531
  this.editServiceSubscription = new Subscription();
@@ -2031,16 +2536,26 @@ var GanttComponent = /** @class */ (function () {
2031
2536
  this.optionChangesSubscriptions.add(this.optionChangesService.columnChanges.subscribe(function () {
2032
2537
  _this.treeList.columns.notifyOnChanges();
2033
2538
  }));
2539
+ this.editService.getSelectedItem = this.getFirstSelectedItem.bind(this);
2034
2540
  this.editServiceSubscription.add(this.editService.showEditingDialog.subscribe(function (show) { return _this.showEditingDialog = show; }));
2035
2541
  this.editServiceSubscription.add(this.editService.showConfirmationDialog.subscribe(function () { return _this.taskDelete.emit(); }));
2036
2542
  this.editServiceSubscription.add(this.editService.editEvent.subscribe(function (args) {
2037
2543
  _this[args.editResultType].emit({
2038
- formGroup: args.formGroup,
2544
+ taskFormGroup: args.taskFormGroup,
2039
2545
  item: getEditItem(args.dataItem, _this.treeList.view.data, _this.mapper),
2546
+ dependencies: args.dependencies,
2040
2547
  sender: _this
2041
2548
  });
2042
2549
  _this.showConfirmationDialog = _this.showEditingDialog = false;
2043
- _this.editService.dataItem = _this.editService.formGroup = null;
2550
+ _this.editService.dataItem = _this.editService.taskFormGroup = null;
2551
+ _this.updateView();
2552
+ }));
2553
+ this.editServiceSubscription.add(this.editService.addEvent.subscribe(function (args) {
2554
+ var selectedItem = _this.getFirstSelectedItem();
2555
+ _this.taskAdd.emit({
2556
+ actionType: args.actionType,
2557
+ selectedItem: selectedItem ? getEditItem(selectedItem, _this.treeList.view.data, _this.mapper) : null
2558
+ });
2044
2559
  _this.updateView();
2045
2560
  }));
2046
2561
  this.localizationSubscription = this.localizationService.changes.subscribe(function (_a) {
@@ -2147,6 +2662,61 @@ var GanttComponent = /** @class */ (function () {
2147
2662
  enumerable: true,
2148
2663
  configurable: true
2149
2664
  });
2665
+ Object.defineProperty(GanttComponent.prototype, "toolbarSettings", {
2666
+ get: function () {
2667
+ return this._toolbarSettings;
2668
+ },
2669
+ /**
2670
+ * The toolbar configuration. Defines the position and content of the toolbar(s).
2671
+ * The available properties are `position`, `addTaskTool`, and `viewSelectorTool`.
2672
+ * All are optional and default to `top`.
2673
+ *
2674
+ * The possible values for each option are:
2675
+ * - `top`&mdash;Positions the toolbar above the Gantt panes. Renders the respective tool in the top toolbar.
2676
+ * - `bottom`&mdash;Positions the toolbar below the Gantt panes. Renders the respective tool in the bottom toolbar.
2677
+ * - `both`&mdash;Displays two toolbar instances. Positions the first one above,
2678
+ * and the second one - below the Gantt panes. Renders the respective tool in the both toolbars.
2679
+ * - `none`&mdash;No toolbar is rendered when used for setting `position`.
2680
+ * No add task or view selector tool is rendered when used for setting `addTaskTool` or `viewSelectorTool`.
2681
+ */
2682
+ set: function (value) {
2683
+ this._toolbarSettings = {
2684
+ position: value.position || 'top',
2685
+ addTaskTool: value.addTaskTool || 'none',
2686
+ viewSelectorTool: value.viewSelectorTool || 'top'
2687
+ };
2688
+ },
2689
+ enumerable: true,
2690
+ configurable: true
2691
+ });
2692
+ Object.defineProperty(GanttComponent.prototype, "fetchChildren", {
2693
+ get: function () {
2694
+ return this._fetchChildren;
2695
+ },
2696
+ /**
2697
+ * Gets or sets the callback function that retrieves the child items for a particular item.
2698
+ */
2699
+ set: function (fn) {
2700
+ this._fetchChildren = fn;
2701
+ this.editService.fetchChildren = fn;
2702
+ },
2703
+ enumerable: true,
2704
+ configurable: true
2705
+ });
2706
+ Object.defineProperty(GanttComponent.prototype, "hasChildren", {
2707
+ get: function () {
2708
+ return this._hasChildren;
2709
+ },
2710
+ /**
2711
+ * Gets or sets the callback function that indicates if a particular item has child items.
2712
+ */
2713
+ set: function (fn) {
2714
+ this._hasChildren = fn;
2715
+ this.editService.hasChildren = fn;
2716
+ },
2717
+ enumerable: true,
2718
+ configurable: true
2719
+ });
2150
2720
  Object.defineProperty(GanttComponent.prototype, "timelinePaneOptions", {
2151
2721
  get: function () {
2152
2722
  return __assign({}, this._timelinePaneOptions, { size: this.treeListPaneOptions.collapsed ? '100%' : this._timelinePaneOptions.size });
@@ -2222,6 +2792,21 @@ var GanttComponent = /** @class */ (function () {
2222
2792
  enumerable: true,
2223
2793
  configurable: true
2224
2794
  });
2795
+ Object.defineProperty(GanttComponent.prototype, "dragScrollSettings", {
2796
+ get: function () {
2797
+ return this._dragScrollSettings;
2798
+ },
2799
+ /**
2800
+ * Specifies the settings for auto-scrolling during dragging
2801
+ * when the pointer moves outside of the container bounderies
2802
+ * [see example]({% slug editing_drag_create_dependencies_gantt %}#toc-auto-scrolling).
2803
+ */
2804
+ set: function (settings) {
2805
+ this._dragScrollSettings = __assign({}, DEFAULT_DRAG_SCROLL_SETTINGS, settings);
2806
+ },
2807
+ enumerable: true,
2808
+ configurable: true
2809
+ });
2225
2810
  Object.defineProperty(GanttComponent.prototype, "renderedTreeListItems", {
2226
2811
  /**
2227
2812
  * @hidden
@@ -2298,16 +2883,6 @@ var GanttComponent = /** @class */ (function () {
2298
2883
  enumerable: true,
2299
2884
  configurable: true
2300
2885
  });
2301
- Object.defineProperty(GanttComponent.prototype, "editDialogFormGroup", {
2302
- /**
2303
- * @hidden
2304
- */
2305
- get: function () {
2306
- return this.editService.formGroup;
2307
- },
2308
- enumerable: true,
2309
- configurable: true
2310
- });
2311
2886
  GanttComponent.prototype.ngOnChanges = function (changes) {
2312
2887
  if (anyChanged(['data', 'activeView', 'workWeekStart', 'workWeekEnd', 'workDayStart', 'workDayEnd'], changes)) {
2313
2888
  this.loadTimelineData();
@@ -2397,8 +2972,14 @@ var GanttComponent = /** @class */ (function () {
2397
2972
  * Opens the task editing dialog.
2398
2973
  */
2399
2974
  GanttComponent.prototype.editTask = function (dataItem, formGroup) {
2975
+ var _this = this;
2400
2976
  if (!this.showEditingDialog) {
2401
- this.editService.createEditDialog(dataItem, formGroup);
2977
+ var taskId_1 = this.mapper.extractFromTask(dataItem, 'id');
2978
+ var dependencies = this.dependencies.filter(function (item) {
2979
+ return _this.mapper.extractFromDependency(item, 'toId') === taskId_1
2980
+ || _this.mapper.extractFromDependency(item, 'fromId') === taskId_1;
2981
+ });
2982
+ this.editService.createEditDialog(dataItem, formGroup, dependencies);
2402
2983
  }
2403
2984
  };
2404
2985
  /**
@@ -2471,7 +3052,7 @@ var GanttComponent = /** @class */ (function () {
2471
3052
  * @hidden
2472
3053
  */
2473
3054
  GanttComponent.prototype.showToolbar = function (position) {
2474
- return this.toolbarPosition !== 'none' && ([position, 'both'].indexOf(this.toolbarPosition) > -1);
3055
+ return this.toolbarSettings.position !== 'none' && ([position, 'both'].indexOf(this.toolbarSettings.position) > -1);
2475
3056
  };
2476
3057
  /**
2477
3058
  * @hidden
@@ -2679,11 +3260,70 @@ var GanttComponent = /** @class */ (function () {
2679
3260
  var shouldToggleSelection = ctrlKey || metaKey;
2680
3261
  return (shouldToggleSelection && this.isSelected(dataItem)) ? 'remove' : 'select';
2681
3262
  };
3263
+ GanttComponent.prototype.getFirstSelectedItem = function () {
3264
+ var isSelectedCallback = this.isSelected || isSelected;
3265
+ var loadedItems = this.renderedTreeListItems || [];
3266
+ return loadedItems.find(isSelectedCallback);
3267
+ };
3268
+ GanttComponent.prototype.defaultValidateNewDependencyCallback = function (dependency) {
3269
+ var _this = this;
3270
+ var fromTaskId = this.mapper.extractFromDependency(dependency, 'fromId');
3271
+ var toTaskId = this.mapper.extractFromDependency(dependency, 'toId');
3272
+ var fromTask = this.treeList.view.data.find(function (task) {
3273
+ return _this.mapper.extractFromTask(task.data, 'id') === fromTaskId;
3274
+ });
3275
+ var toTask = this.treeList.view.data.find(function (task) {
3276
+ return _this.mapper.extractFromTask(task.data, 'id') === toTaskId;
3277
+ });
3278
+ // mark as invalid if the attempted dependency is lacking valid from- and to-tasks
3279
+ // or when the from- and to-tasks are actually the same task
3280
+ if (!isPresent(fromTask) || !isPresent(fromTask.data) ||
3281
+ !isPresent(toTask) || !isPresent(toTask.data) ||
3282
+ fromTask.data === toTask.data) {
3283
+ return false;
3284
+ }
3285
+ var tasksDependentOnOneAnother = this.dependencies.some(function (current) {
3286
+ var currentFromId = _this.mapper.extractFromDependency(current, 'fromId');
3287
+ var currentToId = _this.mapper.extractFromDependency(current, 'toId');
3288
+ return (fromTaskId === currentFromId && toTaskId === currentToId) ||
3289
+ (toTaskId === currentFromId && fromTaskId === currentToId);
3290
+ });
3291
+ // mark as invalid if the attempted dependency is trying to connect already dependent tasks
3292
+ // mark as invalid if the two tasks are in parent-child relationship
3293
+ if (tasksDependentOnOneAnother || areParentChild(fromTask, toTask)) {
3294
+ return false;
3295
+ }
3296
+ var fromTaskStart = this.mapper.extractFromTask(fromTask.data, 'start');
3297
+ var fromTaskEnd = this.mapper.extractFromTask(fromTask.data, 'end');
3298
+ var toTaskStart = this.mapper.extractFromTask(toTask.data, 'start');
3299
+ var toTaskEnd = this.mapper.extractFromTask(toTask.data, 'end');
3300
+ // if the two tasks are available to be connected via a dependency,
3301
+ // check if their start and end time allow for the attempted dependency type
3302
+ switch (this.mapper.extractFromDependency(dependency, 'type')) {
3303
+ // finish to finish (FF) — the from-task ends before the to-task can end
3304
+ case DependencyType.FF:
3305
+ return fromTaskEnd <= toTaskEnd;
3306
+ // finish to start (FS) — the from-task ends before the to-task can begin
3307
+ case DependencyType.FS:
3308
+ return fromTaskEnd <= toTaskStart;
3309
+ // start to finish (SF) — the from-task begins before the to-task can end
3310
+ case DependencyType.SF:
3311
+ return fromTaskStart <= toTaskEnd;
3312
+ // start to start (SS) — the from-task begins before the to-task can begin
3313
+ case DependencyType.SS:
3314
+ return fromTaskStart <= toTaskStart;
3315
+ default: return false;
3316
+ }
3317
+ };
2682
3318
  var GanttComponent_1;
2683
3319
  __decorate([
2684
3320
  ViewChild(TreeListComponent, { static: true }),
2685
3321
  __metadata("design:type", TreeListComponent)
2686
3322
  ], GanttComponent.prototype, "treeList", void 0);
3323
+ __decorate([
3324
+ ViewChild(GanttTimelineComponent, { static: false }),
3325
+ __metadata("design:type", GanttTimelineComponent)
3326
+ ], GanttComponent.prototype, "timeline", void 0);
2687
3327
  __decorate([
2688
3328
  ContentChild(GanttTaskContentTemplateDirective, { static: true }),
2689
3329
  __metadata("design:type", GanttTaskContentTemplateDirective)
@@ -2742,6 +3382,10 @@ var GanttComponent = /** @class */ (function () {
2742
3382
  Input(),
2743
3383
  __metadata("design:type", Function)
2744
3384
  ], GanttComponent.prototype, "isSelected", void 0);
3385
+ __decorate([
3386
+ Input(),
3387
+ __metadata("design:type", Function)
3388
+ ], GanttComponent.prototype, "validateNewDependency", void 0);
2745
3389
  __decorate([
2746
3390
  Output(),
2747
3391
  __metadata("design:type", EventEmitter)
@@ -2752,16 +3396,19 @@ var GanttComponent = /** @class */ (function () {
2752
3396
  ], GanttComponent.prototype, "selectable", void 0);
2753
3397
  __decorate([
2754
3398
  Input(),
2755
- __metadata("design:type", String)
2756
- ], GanttComponent.prototype, "toolbarPosition", void 0);
3399
+ __metadata("design:type", Object),
3400
+ __metadata("design:paramtypes", [Object])
3401
+ ], GanttComponent.prototype, "toolbarSettings", null);
2757
3402
  __decorate([
2758
3403
  Input(),
2759
- __metadata("design:type", Function)
2760
- ], GanttComponent.prototype, "fetchChildren", void 0);
3404
+ __metadata("design:type", Function),
3405
+ __metadata("design:paramtypes", [Function])
3406
+ ], GanttComponent.prototype, "fetchChildren", null);
2761
3407
  __decorate([
2762
3408
  Input(),
2763
- __metadata("design:type", Function)
2764
- ], GanttComponent.prototype, "hasChildren", void 0);
3409
+ __metadata("design:type", Function),
3410
+ __metadata("design:paramtypes", [Function])
3411
+ ], GanttComponent.prototype, "hasChildren", null);
2765
3412
  __decorate([
2766
3413
  Input(),
2767
3414
  __metadata("design:type", Array)
@@ -2838,6 +3485,11 @@ var GanttComponent = /** @class */ (function () {
2838
3485
  Input(),
2839
3486
  __metadata("design:type", Boolean)
2840
3487
  ], GanttComponent.prototype, "columnsResizable", void 0);
3488
+ __decorate([
3489
+ Input(),
3490
+ __metadata("design:type", Object),
3491
+ __metadata("design:paramtypes", [Object])
3492
+ ], GanttComponent.prototype, "dragScrollSettings", null);
2841
3493
  __decorate([
2842
3494
  Output(),
2843
3495
  __metadata("design:type", EventEmitter)
@@ -2874,6 +3526,14 @@ var GanttComponent = /** @class */ (function () {
2874
3526
  Output(),
2875
3527
  __metadata("design:type", EventEmitter)
2876
3528
  ], GanttComponent.prototype, "save", void 0);
3529
+ __decorate([
3530
+ Output(),
3531
+ __metadata("design:type", EventEmitter)
3532
+ ], GanttComponent.prototype, "taskAdd", void 0);
3533
+ __decorate([
3534
+ Output(),
3535
+ __metadata("design:type", EventEmitter)
3536
+ ], GanttComponent.prototype, "dependencyAdd", void 0);
2877
3537
  __decorate([
2878
3538
  Output(),
2879
3539
  __metadata("design:type", EventEmitter)
@@ -2931,6 +3591,7 @@ var GanttComponent = /** @class */ (function () {
2931
3591
  selector: 'kendo-gantt',
2932
3592
  exportAs: 'kendoGantt',
2933
3593
  providers: [
3594
+ GanttLocalizationService,
2934
3595
  LocalizationService,
2935
3596
  {
2936
3597
  provide: DataBoundTreeComponent,
@@ -2948,9 +3609,10 @@ var GanttComponent = /** @class */ (function () {
2948
3609
  DependencyDomService,
2949
3610
  MappingService,
2950
3611
  OptionChangesService,
2951
- EditService
3612
+ EditService,
3613
+ TimelineScrollService
2952
3614
  ],
2953
- template: "\n <ng-container kendoGanttLocalizedMessages\n i18n-taskDeleteLabel=\"kendo.gantt.taskDeleteLabel|The label of the task delete icon\"\n taskDeleteLabel=\"Delete\"\n\n i18n-taskEditingDialogTitle=\"kendo.gantt.taskEditingDialogTitle|The title of the task editing dialog\"\n taskEditingDialogTitle=\"Editing Task\"\n\n i18n-taskEditingDialogCloseTitle=\"kendo.gantt.taskEditingDialogCloseTitle|The title of the task editing dialog close button\"\n taskEditingDialogCloseTitle=\"Close\"\n\n i18n-confirmationDialogCloseTitle=\"kendo.gantt.confirmationDialogCloseTitle|The title of the confirmation dialog close button\"\n confirmationDialogCloseTitle=\"Close\"\n\n i18n-confirmationDialogTitle=\"kendo.gantt.confirmationDialogTitle|The title of the delete task confirmation dialog\"\n confirmationDialogTitle=\"Delete Task\"\n\n i18n-confirmationDialogContent=\"kendo.gantt.confirmationDialogContent|The content of the delete task confirmation dialog\"\n confirmationDialogContent=\"Are you sure you want to delete this task?\"\n\n i18n-deleteButtonText=\"kendo.gantt.deleteButtonText|The text of the task editing dialog 'Delete' button\"\n deleteButtonText=\"Delete\"\n\n i18n-cancelButtonText=\"kendo.gantt.cancelButtonText|The text of the task editing dialog 'Cancel' button\"\n cancelButtonText=\"Cancel\"\n\n i18n-saveButtonText=\"kendo.gantt.saveButtonText|The text of the task editing dialog 'Save' button\"\n saveButtonText=\"Save\"\n\n i18n-titleFieldInputLabel=\"kendo.gantt.titleFieldInputLabel|The label of the 'title' field input in editing mode\"\n titleFieldInputLabel=\"Title\"\n\n i18n-startFieldInputLabel=\"kendo.gantt.startFieldInputLabel|The label of the 'start' field input in editing mode\"\n startFieldInputLabel=\"Start\"\n\n i18n-endFieldInputLabel=\"kendo.gantt.endFieldInputLabel|The label of the 'end' field input in editing mode\"\n endFieldInputLabel=\"End\"\n\n i18n-completionRatioFieldInputLabel=\"kendo.gantt.completionRatioFieldInputLabel|The label of the 'completionRatio' field input in editing mode\"\n completionRatioFieldInputLabel=\"Progress\"\n\n i18n-dayViewText=\"kendo.gantt.dayViewText|The text of the day view in the ViewSelector component\"\n dayViewText=\"Day\"\n\n i18n-weekViewText=\"kendo.gantt.weekViewText|The text of the week view in the ViewSelector component\"\n weekViewText=\"Week\"\n\n i18n-monthViewText=\"kendo.gantt.monthViewText|The text of the month view in the ViewSelector component\"\n monthViewText=\"Month\"\n\n i18n-yearViewText-disabled=\"kendo.gantt.yearViewText|The text of the year view in the ViewSelector component\"\n yearViewText=\"Year\"\n\n i18n-noRecords=\"kendo.gantt.noRecords|The label visible in the TreeList when there are no records\"\n noRecords=\"No records available.\"\n\n i18n-filter=\"kendo.gantt.filter|The label of the filter cell or icon\"\n filter=\"Filter\"\n\n i18n-filterEqOperator=\"kendo.gantt.filterEqOperator|The text of the equal filter operator\"\n filterEqOperator=\"Is equal to\"\n\n i18n-filterNotEqOperator=\"kendo.gantt.filterNotEqOperator|The text of the not equal filter operator\"\n filterNotEqOperator=\"Is not equal to\"\n\n i18n-filterIsNullOperator=\"kendo.gantt.filterIsNullOperator|The text of the is null filter operator\"\n filterIsNullOperator=\"Is null\"\n\n i18n-filterIsNotNullOperator=\"kendo.gantt.filterIsNotNullOperator|The text of the is not null filter operator\"\n filterIsNotNullOperator=\"Is not null\"\n\n i18n-filterIsEmptyOperator=\"kendo.gantt.filterIsEmptyOperator|The text of the is empty filter operator\"\n filterIsEmptyOperator=\"Is empty\"\n\n i18n-filterIsNotEmptyOperator=\"kendo.gantt.filterIsNotEmptyOperator|The text of the is not empty filter operator\"\n filterIsNotEmptyOperator=\"Is not empty\"\n\n i18n-filterStartsWithOperator=\"kendo.gantt.filterStartsWithOperator|The text of the starts with filter operator\"\n filterStartsWithOperator=\"Starts with\"\n\n i18n-filterContainsOperator=\"kendo.gantt.filterContainsOperator|The text of the contains filter operator\"\n filterContainsOperator=\"Contains\"\n\n i18n-filterNotContainsOperator=\"kendo.gantt.filterNotContainsOperator|The text of the does not contain filter operator\"\n filterNotContainsOperator=\"Does not contain\"\n\n i18n-filterEndsWithOperator=\"kendo.gantt.filterEndsWithOperator|The text of the ends with filter operator\"\n filterEndsWithOperator=\"Ends with\"\n\n i18n-filterGteOperator=\"kendo.gantt.filterGteOperator|The text of the greater than or equal filter operator\"\n filterGteOperator=\"Is greater than or equal to\"\n\n i18n-filterGtOperator=\"kendo.gantt.filterGtOperator|The text of the greater than filter operator\"\n filterGtOperator=\"Is greater than\"\n\n i18n-filterLteOperator=\"kendo.gantt.filterLteOperator|The text of the less than or equal filter operator\"\n filterLteOperator=\"Is less than or equal to\"\n\n i18n-filterLtOperator=\"kendo.gantt.filterLtOperator|The text of the less than filter operator\"\n filterLtOperator=\"Is less than\"\n\n i18n-filterIsTrue=\"kendo.gantt.filterIsTrue|The text of the IsTrue boolean filter option\"\n filterIsTrue=\"Is True\"\n\n i18n-filterIsFalse=\"kendo.gantt.filterIsFalse|The text of the IsFalse boolean filter option\"\n filterIsFalse=\"Is False\"\n\n i18n-filterBooleanAll=\"kendo.gantt.filterBooleanAll|The text of the (All) boolean filter option\"\n filterBooleanAll=\"(All)\"\n\n i18n-filterAfterOrEqualOperator=\"kendo.gantt.filterAfterOrEqualOperator|The text of the after or equal date filter operator\"\n filterAfterOrEqualOperator=\"Is after or equal to\"\n\n i18n-filterAfterOperator=\"kendo.gantt.filterAfterOperator|The text of the after date filter operator\"\n filterAfterOperator=\"Is after\"\n\n i18n-filterBeforeOperator=\"kendo.gantt.filterBeforeOperator|The text of the before date filter operator\"\n filterBeforeOperator=\"Is before\"\n\n i18n-filterBeforeOrEqualOperator=\"kendo.gantt.filterBeforeOrEqualOperator|The text of the before or equal date filter operator\"\n filterBeforeOrEqualOperator=\"Is before or equal to\"\n\n i18n-filterFilterButton=\"kendo.gantt.filterFilterButton|The text of the filter button\"\n filterFilterButton=\"Filter\"\n\n i18n-filterClearButton=\"kendo.gantt.filterClearButton|The text of the clear filter button\"\n filterClearButton=\"Clear\"\n\n i18n-filterAndLogic=\"kendo.gantt.filterAndLogic|The text of the And filter logic\"\n filterAndLogic=\"And\"\n\n i18n-filterOrLogic=\"kendo.gantt.filterOrLogic|The text of the Or filter logic\"\n filterOrLogic=\"Or\"\n\n i18n-loading=\"kendo.gantt.loading|The loading text\"\n loading=\"Loading\"\n\n i18n-columnMenu=\"kendo.gantt.columnMenu|The title of the column menu icon\"\n columnMenu=\"Column Menu\"\n\n i18n-columns=\"kendo.gantt.columns|The text shown in the column menu for the columns item\"\n columns=\"Columns\"\n\n i18n-lock-disabled=\"kendo.gantt.lock|The text shown in the column menu for the lock item\"\n lock-disabled=\"Lock\"\n\n i18n-unlock-disabled=\"kendo.gantt.unlock|The text shown in the column menu for the unlock item\"\n unlock-disabled=\"Unlock\"\n\n i18n-sortable=\"kendo.gantt.sortable|The label of the sort icon\"\n sortable=\"Sortable\"\n\n i18n-sortAscending=\"kendo.gantt.sortAscending|The text shown in the column menu for the sort ascending item\"\n sortAscending=\"Sort Ascending\"\n\n i18n-sortDescending=\"kendo.gantt.sortDescending|The text shown in the column menu for the sort descending item\"\n sortDescending=\"Sort Descending\"\n\n i18n-sortedAscending=\"kendo.gantt.sortedAscending|The status announcement when a column is sorted ascending\"\n sortedAscending=\"Sorted Ascending\"\n\n i18n-sortedDescending=\"kendo.gantt.sortedDescending|The status announcement when a column is sorted descending\"\n sortedDescending=\"Sorted Descending\"\n\n i18n-sortedDefault=\"kendo.gantt.sortedDefault|The status announcement when a column is no longer sorted\"\n sortedDefault=\"Not Sorted\"\n\n i18n-columnsApply=\"kendo.gantt.columnsApply|The text shown in the column menu or column chooser for the columns apply button\"\n columnsApply=\"Apply\"\n\n i18n-columnsReset=\"kendo.gantt.columnsReset|The text shown in the column menu or column chooser for the columns reset button\"\n columnsReset=\"Reset\"></ng-container>\n <kendo-gantt-toolbar\n *ngIf=\"showToolbar('top')\"\n class=\"k-gantt-header k-toolbar k-gantt-toolbar\"\n position=\"top\"></kendo-gantt-toolbar>\n <div class=\"k-gantt-content\">\n <kendo-splitter [style.border]=\"0\">\n <kendo-splitter-pane\n class=\"k-gantt-treelist k-gantt-treelist-scrollable\"\n [collapsible]=\"treeListPaneOptions?.collapsible\"\n [collapsed]=\"treeListPaneOptions?.collapsed\"\n (collapsedChange)=\"onTreeListCollapsedChange($event)\"\n [scrollable]=\"false\">\n <kendo-treelist\n [idField]=\"taskIdField\"\n [columns]=\"columns\"\n [data]=\"data\"\n [hasChildren]=\"hasChildren\"\n [fetchChildren]=\"fetchChildren\"\n [isExpanded]=\"isExpanded\"\n [autoSize]=\"columnsAutoSize\"\n [columnMenu]=\"columnMenu\"\n [reorderable]=\"columnsReorderable\"\n [resizable]=\"columnsResizable\"\n [rowClass]=\"rowClass\"\n [isSelected]=\"isSelected\"\n [selectable]=\"selectable\"\n [sortable]=\"sortable\"\n [sort]=\"sort\"\n [filterable]=\"filterMenu\"\n [filter]=\"filter\"\n (filterChange)=\"filterChange.emit($event)\"\n (sortChange)=\"sortChange.emit($event)\"\n (dataStateChange)=\"dataStateChange.emit({\n filter: $event.filter,\n sort: $event.sort\n })\"\n (expandStateChange)=\"expandStateChange.emit($event)\"\n (expand)=\"rowExpand.emit({ dataItem: $event.dataItem })\"\n (collapse)=\"rowCollapse.emit({ dataItem: $event.dataItem })\"\n (columnReorder)=\"columnReorder.emit($event)\"\n (columnResize)=\"columnResize.emit($event)\"\n (columnVisibilityChange)=\"handleColumnVisibilityChange($event)\"\n (columnLockedChange)=\"columnLockedChange.emit($event)\"\n (selectionChange)=\"handleTreeListSelectionChange($event)\"\n (cellClick)=\"handleTreeListCellClick($event)\"\n (cellClose)=\"handleCellClose($event)\"\n [kendoEventsOutsideAngular]=\"{\n dblclick: handleTreeListDoubleClick\n }\"\n [scope]=\"this\"\n >\n <kendo-treelist-messages [kendoGanttTreeListMessages]=\"localizationService\"></kendo-treelist-messages>\n </kendo-treelist>\n </kendo-splitter-pane>\n <kendo-splitter-pane\n [collapsible]=\"timelinePaneOptions?.collapsible\"\n [resizable]=\"timelinePaneOptions?.resizable\"\n [collapsed]=\"timelinePaneOptions?.collapsed\"\n [min]=\"timelinePaneOptions?.min\"\n [max]=\"timelinePaneOptions?.max\"\n [size]=\"timelinePaneOptions?.size\"\n (collapsedChange)=\"onTimelineCollapsedChange($event)\"\n (sizeChange)=\"onTimelinePaneSizeChange($event)\"\n [scrollable]=\"false\">\n <kendo-gantt-timeline\n *ngIf=\"views && views.length\"\n [rows]=\"renderedTreeListItems\"\n [slots]=\"timelineSlots\"\n [groupSlots]=\"timelineGroupSlots\"\n [tableWidth]=\"tableWidth\"\n [activeView]=\"activeView\"\n [taskContentTemplate]=\"taskContentTemplate?.templateRef\"\n [taskTemplate]=\"taskTemplate?.templateRef\"\n [summaryTaskTemplate]=\"summaryTaskTemplate?.templateRef\"\n [taskClass]=\"taskClass\"\n [dependencies]=\"dependencies\"\n [hasChildren]=\"hasChildren\"\n [isTaskSelected]=\"isTaskSelected\"\n [kendoEventsOutsideAngular]=\"{\n click: handleTimelineClick,\n contextmenu: handleTimelineRightClick,\n dblclick: handleTimelineDblClick,\n mousedown: handleTimelineMouseDown\n }\"\n [scope]=\"this\"\n ></kendo-gantt-timeline>\n </kendo-splitter-pane>\n </kendo-splitter>\n </div>\n <kendo-gantt-toolbar\n *ngIf=\"showToolbar('bottom')\"\n class=\"k-gantt-footer k-toolbar k-gantt-toolbar\"\n position=\"bottom\"></kendo-gantt-toolbar>\n <kendo-gantt-edit-dialog *ngIf=\"showEditingDialog\" [formGroup]=\"editDialogFormGroup\"></kendo-gantt-edit-dialog>\n <kendo-dialog\n *ngIf=\"showConfirmationDialog\"\n [width]=\"575\"\n [height]=\"170\"\n [title]=\"getText('confirmationDialogTitle')\"\n (close)=\"showConfirmationDialog = false;\">\n <span>{{getText('confirmationDialogContent')}}</span>\n <kendo-dialog-actions layout=\"normal\">\n <kendo-treelist-spacer></kendo-treelist-spacer>\n <button kendoButton [primary]=\"true\" (click)=\"handleDeleteConfirmation()\">{{ getText('deleteButtonText') }}</button>\n <button kendoButton (click)=\"showConfirmationDialog = false;\">{{ getText('cancelButtonText') }}</button>\n </kendo-dialog-actions>\n </kendo-dialog>\n "
3615
+ template: "\n <ng-container kendoGanttLocalizedMessages\n i18n-taskEditingGeneralTabTitle=\"kendo.gantt.taskEditingGeneralTabTitle|The title of the 'General' tab of the editing dialog TabStrip\"\n taskEditingGeneralTabTitle=\"General\"\n\n i18n-taskEditingPredecessorsTabTitle=\"kendo.gantt.taskEditingPredecessorsTabTitle|The title of the 'Predecessors' dependencies tab of the editing dialog TabStrip\"\n taskEditingPredecessorsTabTitle=\"Predecessors\"\n\n i18n-taskEditingSuccessorsTabTitle=\"kendo.gantt.taskEditingSuccessorsTabTitle|The title of the 'Successors' dependencies tab of the editing dialog TabStrip\"\n taskEditingSuccessorsTabTitle=\"Successors\"\n\n i18n-taskEditingDependenciesAddButtonText=\"kendo.gantt.taskEditingDependenciesAddButtonText|The text of the 'Add' button in the dependencies tabs of the editing dialog TabStrip\"\n taskEditingDependenciesAddButtonText=\"Add\"\n\n i18n-taskEditingDependenciesRemoveButtonText=\"kendo.gantt.taskEditingDependenciesRemoveButtonText|The text of the 'Remove' button in the dependencies tabs of the editing dialog TabStrip\"\n taskEditingDependenciesRemoveButtonText=\"Remove\"\n\n i18n-taskEditingDependenciesGridNameColumnTitle=\"kendo.gantt.taskEditingDependenciesGridNameColumnTitle|The title of the 'Task Title' Grid column in the dependencies tabs of the editing dialog TabStrip\"\n taskEditingDependenciesGridNameColumnTitle=\"Task Title\"\n\n i18n-taskEditingDependenciesGridTypeColumnTitle=\"kendo.gantt.taskEditingDependenciesGridTypeColumnTitle|The title of the 'Type' Grid column in the dependencies tabs of the editing dialog TabStrip\"\n taskEditingDependenciesGridTypeColumnTitle=\"Type\"\n\n i18n-taskDeleteLabel=\"kendo.gantt.taskDeleteLabel|The label of the task delete icon\"\n taskDeleteLabel=\"Delete\"\n\n i18n-taskEditingDialogTitle=\"kendo.gantt.taskEditingDialogTitle|The title of the task editing dialog\"\n taskEditingDialogTitle=\"Editing Task\"\n\n i18n-taskEditingDialogCloseTitle=\"kendo.gantt.taskEditingDialogCloseTitle|The title of the task editing dialog close button\"\n taskEditingDialogCloseTitle=\"Close\"\n\n i18n-confirmationDialogCloseTitle=\"kendo.gantt.confirmationDialogCloseTitle|The title of the confirmation dialog close button\"\n confirmationDialogCloseTitle=\"Close\"\n\n i18n-confirmationDialogTitle=\"kendo.gantt.confirmationDialogTitle|The title of the delete task confirmation dialog\"\n confirmationDialogTitle=\"Delete Task\"\n\n i18n-confirmationDialogContent=\"kendo.gantt.confirmationDialogContent|The content of the delete task confirmation dialog\"\n confirmationDialogContent=\"Are you sure you want to delete this task?\"\n\n i18n-deleteButtonText=\"kendo.gantt.deleteButtonText|The text of the task editing dialog 'Delete' button\"\n deleteButtonText=\"Delete\"\n\n i18n-cancelButtonText=\"kendo.gantt.cancelButtonText|The text of the task editing dialog 'Cancel' button\"\n cancelButtonText=\"Cancel\"\n\n i18n-saveButtonText=\"kendo.gantt.saveButtonText|The text of the task editing dialog 'Save' button\"\n saveButtonText=\"Save\"\n\n i18n-titleFieldInputLabel=\"kendo.gantt.titleFieldInputLabel|The label of the 'title' field input in editing mode\"\n titleFieldInputLabel=\"Title\"\n\n i18n-startFieldInputLabel=\"kendo.gantt.startFieldInputLabel|The label of the 'start' field input in editing mode\"\n startFieldInputLabel=\"Start\"\n\n i18n-endFieldInputLabel=\"kendo.gantt.endFieldInputLabel|The label of the 'end' field input in editing mode\"\n endFieldInputLabel=\"End\"\n\n i18n-completionRatioFieldInputLabel=\"kendo.gantt.completionRatioFieldInputLabel|The label of the 'completionRatio' field input in editing mode\"\n completionRatioFieldInputLabel=\"Progress\"\n\n i18n-dayViewText=\"kendo.gantt.dayViewText|The text of the day view in the ViewSelector component\"\n dayViewText=\"Day\"\n\n i18n-weekViewText=\"kendo.gantt.weekViewText|The text of the week view in the ViewSelector component\"\n weekViewText=\"Week\"\n\n i18n-monthViewText=\"kendo.gantt.monthViewText|The text of the month view in the ViewSelector component\"\n monthViewText=\"Month\"\n\n i18n-yearViewText-disabled=\"kendo.gantt.yearViewText|The text of the year view in the ViewSelector component\"\n yearViewText=\"Year\"\n\n i18n-addTaskText=\"kendo.gantt.addTaskText|The text of the DropDownButton in the AddTask component\"\n addTaskText=\"Add Task\"\n\n i18n-addChildText=\"kendo.gantt.addChildText|The text of the 'Add Child' option in the AddTask component\"\n addChildText=\"Add Child\"\n\n i18n-addAboveText=\"kendo.gantt.addAboveText|The text of the 'Add Above' option in the AddTask component\"\n addAboveText=\"Add Above\"\n\n i18n-addBelowText=\"kendo.gantt.addBelowText|The text of the 'Add Below' option in the AddTask component\"\n addBelowText=\"Add Below\"\n\n i18n-noRecords=\"kendo.gantt.noRecords|The label visible in the TreeList when there are no records\"\n noRecords=\"No records available.\"\n\n i18n-filter=\"kendo.gantt.filter|The label of the filter cell or icon\"\n filter=\"Filter\"\n\n i18n-filterEqOperator=\"kendo.gantt.filterEqOperator|The text of the equal filter operator\"\n filterEqOperator=\"Is equal to\"\n\n i18n-filterNotEqOperator=\"kendo.gantt.filterNotEqOperator|The text of the not equal filter operator\"\n filterNotEqOperator=\"Is not equal to\"\n\n i18n-filterIsNullOperator=\"kendo.gantt.filterIsNullOperator|The text of the is null filter operator\"\n filterIsNullOperator=\"Is null\"\n\n i18n-filterIsNotNullOperator=\"kendo.gantt.filterIsNotNullOperator|The text of the is not null filter operator\"\n filterIsNotNullOperator=\"Is not null\"\n\n i18n-filterIsEmptyOperator=\"kendo.gantt.filterIsEmptyOperator|The text of the is empty filter operator\"\n filterIsEmptyOperator=\"Is empty\"\n\n i18n-filterIsNotEmptyOperator=\"kendo.gantt.filterIsNotEmptyOperator|The text of the is not empty filter operator\"\n filterIsNotEmptyOperator=\"Is not empty\"\n\n i18n-filterStartsWithOperator=\"kendo.gantt.filterStartsWithOperator|The text of the starts with filter operator\"\n filterStartsWithOperator=\"Starts with\"\n\n i18n-filterContainsOperator=\"kendo.gantt.filterContainsOperator|The text of the contains filter operator\"\n filterContainsOperator=\"Contains\"\n\n i18n-filterNotContainsOperator=\"kendo.gantt.filterNotContainsOperator|The text of the does not contain filter operator\"\n filterNotContainsOperator=\"Does not contain\"\n\n i18n-filterEndsWithOperator=\"kendo.gantt.filterEndsWithOperator|The text of the ends with filter operator\"\n filterEndsWithOperator=\"Ends with\"\n\n i18n-filterGteOperator=\"kendo.gantt.filterGteOperator|The text of the greater than or equal filter operator\"\n filterGteOperator=\"Is greater than or equal to\"\n\n i18n-filterGtOperator=\"kendo.gantt.filterGtOperator|The text of the greater than filter operator\"\n filterGtOperator=\"Is greater than\"\n\n i18n-filterLteOperator=\"kendo.gantt.filterLteOperator|The text of the less than or equal filter operator\"\n filterLteOperator=\"Is less than or equal to\"\n\n i18n-filterLtOperator=\"kendo.gantt.filterLtOperator|The text of the less than filter operator\"\n filterLtOperator=\"Is less than\"\n\n i18n-filterIsTrue=\"kendo.gantt.filterIsTrue|The text of the IsTrue boolean filter option\"\n filterIsTrue=\"Is True\"\n\n i18n-filterIsFalse=\"kendo.gantt.filterIsFalse|The text of the IsFalse boolean filter option\"\n filterIsFalse=\"Is False\"\n\n i18n-filterBooleanAll=\"kendo.gantt.filterBooleanAll|The text of the (All) boolean filter option\"\n filterBooleanAll=\"(All)\"\n\n i18n-filterAfterOrEqualOperator=\"kendo.gantt.filterAfterOrEqualOperator|The text of the after or equal date filter operator\"\n filterAfterOrEqualOperator=\"Is after or equal to\"\n\n i18n-filterAfterOperator=\"kendo.gantt.filterAfterOperator|The text of the after date filter operator\"\n filterAfterOperator=\"Is after\"\n\n i18n-filterBeforeOperator=\"kendo.gantt.filterBeforeOperator|The text of the before date filter operator\"\n filterBeforeOperator=\"Is before\"\n\n i18n-filterBeforeOrEqualOperator=\"kendo.gantt.filterBeforeOrEqualOperator|The text of the before or equal date filter operator\"\n filterBeforeOrEqualOperator=\"Is before or equal to\"\n\n i18n-filterFilterButton=\"kendo.gantt.filterFilterButton|The text of the filter button\"\n filterFilterButton=\"Filter\"\n\n i18n-filterClearButton=\"kendo.gantt.filterClearButton|The text of the clear filter button\"\n filterClearButton=\"Clear\"\n\n i18n-filterAndLogic=\"kendo.gantt.filterAndLogic|The text of the And filter logic\"\n filterAndLogic=\"And\"\n\n i18n-filterOrLogic=\"kendo.gantt.filterOrLogic|The text of the Or filter logic\"\n filterOrLogic=\"Or\"\n\n i18n-loading=\"kendo.gantt.loading|The loading text\"\n loading=\"Loading\"\n\n i18n-columnMenu=\"kendo.gantt.columnMenu|The title of the column menu icon\"\n columnMenu=\"Column Menu\"\n\n i18n-columns=\"kendo.gantt.columns|The text shown in the column menu for the columns item\"\n columns=\"Columns\"\n\n i18n-lock-disabled=\"kendo.gantt.lock|The text shown in the column menu for the lock item\"\n lock-disabled=\"Lock\"\n\n i18n-unlock-disabled=\"kendo.gantt.unlock|The text shown in the column menu for the unlock item\"\n unlock-disabled=\"Unlock\"\n\n i18n-sortable=\"kendo.gantt.sortable|The label of the sort icon\"\n sortable=\"Sortable\"\n\n i18n-sortAscending=\"kendo.gantt.sortAscending|The text shown in the column menu for the sort ascending item\"\n sortAscending=\"Sort Ascending\"\n\n i18n-sortDescending=\"kendo.gantt.sortDescending|The text shown in the column menu for the sort descending item\"\n sortDescending=\"Sort Descending\"\n\n i18n-sortedAscending=\"kendo.gantt.sortedAscending|The status announcement when a column is sorted ascending\"\n sortedAscending=\"Sorted Ascending\"\n\n i18n-sortedDescending=\"kendo.gantt.sortedDescending|The status announcement when a column is sorted descending\"\n sortedDescending=\"Sorted Descending\"\n\n i18n-sortedDefault=\"kendo.gantt.sortedDefault|The status announcement when a column is no longer sorted\"\n sortedDefault=\"Not Sorted\"\n\n i18n-columnsApply=\"kendo.gantt.columnsApply|The text shown in the column menu or column chooser for the columns apply button\"\n columnsApply=\"Apply\"\n\n i18n-columnsReset=\"kendo.gantt.columnsReset|The text shown in the column menu or column chooser for the columns reset button\"\n columnsReset=\"Reset\"></ng-container>\n <kendo-gantt-toolbar\n *ngIf=\"showToolbar('top')\"\n [showAddTask]=\"toolbarSettings.addTaskTool === 'top' || toolbarSettings.addTaskTool === 'both'\"\n [showViewSelector]=\"toolbarSettings.viewSelectorTool === 'top' || toolbarSettings.viewSelectorTool === 'both'\"\n class=\"k-gantt-header k-toolbar k-gantt-toolbar\"\n position=\"top\"></kendo-gantt-toolbar>\n <div class=\"k-gantt-content\">\n <kendo-splitter [style.border]=\"0\">\n <kendo-splitter-pane\n class=\"k-gantt-treelist k-gantt-treelist-scrollable\"\n [collapsible]=\"treeListPaneOptions?.collapsible\"\n [collapsed]=\"treeListPaneOptions?.collapsed\"\n (collapsedChange)=\"onTreeListCollapsedChange($event)\"\n [scrollable]=\"false\">\n <kendo-treelist\n [idField]=\"taskIdField\"\n [columns]=\"columns\"\n [data]=\"data\"\n [hasChildren]=\"hasChildren\"\n [fetchChildren]=\"fetchChildren\"\n [isExpanded]=\"isExpanded\"\n [autoSize]=\"columnsAutoSize\"\n [columnMenu]=\"columnMenu\"\n [reorderable]=\"columnsReorderable\"\n [resizable]=\"columnsResizable\"\n [rowClass]=\"rowClass\"\n [isSelected]=\"isSelected\"\n [selectable]=\"selectable\"\n [sortable]=\"sortable\"\n [sort]=\"sort\"\n [filterable]=\"filterMenu\"\n [filter]=\"filter\"\n (filterChange)=\"filterChange.emit($event)\"\n (sortChange)=\"sortChange.emit($event)\"\n (dataStateChange)=\"dataStateChange.emit({\n filter: $event.filter,\n sort: $event.sort\n })\"\n (expandStateChange)=\"expandStateChange.emit($event)\"\n (expand)=\"rowExpand.emit({ dataItem: $event.dataItem })\"\n (collapse)=\"rowCollapse.emit({ dataItem: $event.dataItem })\"\n (columnReorder)=\"columnReorder.emit($event)\"\n (columnResize)=\"columnResize.emit($event)\"\n (columnVisibilityChange)=\"handleColumnVisibilityChange($event)\"\n (columnLockedChange)=\"columnLockedChange.emit($event)\"\n (selectionChange)=\"handleTreeListSelectionChange($event)\"\n (cellClick)=\"handleTreeListCellClick($event)\"\n (cellClose)=\"handleCellClose($event)\"\n [kendoEventsOutsideAngular]=\"{\n dblclick: handleTreeListDoubleClick\n }\"\n [scope]=\"this\"\n >\n <kendo-treelist-messages\n [noRecords]=\"getText('noRecords')\"\n [filter]=\"getText('filter')\"\n [filterEqOperator]=\"getText('filterEqOperator')\"\n [filterNotEqOperator]=\"getText('filterNotEqOperator')\"\n [filterIsNullOperator]=\"getText('filterIsNullOperator')\"\n [filterIsNotNullOperator]=\"getText('filterIsNotNullOperator')\"\n [filterIsEmptyOperator]=\"getText('filterIsEmptyOperator')\"\n [filterIsNotEmptyOperator]=\"getText('filterIsNotEmptyOperator')\"\n [filterStartsWithOperator]=\"getText('filterStartsWithOperator')\"\n [filterContainsOperator]=\"getText('filterContainsOperator')\"\n [filterNotContainsOperator]=\"getText('filterNotContainsOperator')\"\n [filterEndsWithOperator]=\"getText('filterEndsWithOperator')\"\n [filterGteOperator]=\"getText('filterGteOperator')\"\n [filterGtOperator]=\"getText('filterGtOperator')\"\n [filterLteOperator]=\"getText('filterLteOperator')\"\n [filterLtOperator]=\"getText('filterLtOperator')\"\n [filterIsTrue]=\"getText('filterIsTrue')\"\n [filterIsFalse]=\"getText('filterIsFalse')\"\n [filterBooleanAll]=\"getText('filterBooleanAll')\"\n [filterAfterOrEqualOperator]=\"getText('filterAfterOrEqualOperator')\"\n [filterAfterOperator]=\"getText('filterAfterOperator')\"\n [filterBeforeOperator]=\"getText('filterBeforeOperator')\"\n [filterBeforeOrEqualOperator]=\"getText('filterBeforeOrEqualOperator')\"\n [filterFilterButton]=\"getText('filterFilterButton')\"\n [filterClearButton]=\"getText('filterClearButton')\"\n [filterAndLogic]=\"getText('filterAndLogic')\"\n [filterOrLogic]=\"getText('filterOrLogic')\"\n [loading]=\"getText('loading')\"\n [columnMenu]=\"getText('columnMenu')\"\n [columns]=\"getText('columns')\"\n [sortable]=\"getText('sortable')\"\n [sortAscending]=\"getText('sortAscending')\"\n [sortDescending]=\"getText('sortDescending')\"\n [sortedAscending]=\"getText('sortedAscending')\"\n [sortedDescending]=\"getText('sortedDescending')\"\n [sortedDefault]=\"getText('sortedDefault')\"\n [columnsApply]=\"getText('columnsApply')\"\n [columnsReset]=\"getText('columnsReset')\"\n >\n </kendo-treelist-messages>\n </kendo-treelist>\n </kendo-splitter-pane>\n <kendo-splitter-pane\n [collapsible]=\"timelinePaneOptions?.collapsible\"\n [resizable]=\"timelinePaneOptions?.resizable\"\n [collapsed]=\"timelinePaneOptions?.collapsed\"\n [min]=\"timelinePaneOptions?.min\"\n [max]=\"timelinePaneOptions?.max\"\n [size]=\"timelinePaneOptions?.size\"\n (collapsedChange)=\"onTimelineCollapsedChange($event)\"\n (sizeChange)=\"onTimelinePaneSizeChange($event)\"\n [scrollable]=\"false\">\n <kendo-gantt-timeline\n *ngIf=\"views && views.length\"\n [renderDependencyDragClues]=\"renderDependencyDragClues\"\n [dragScrollSettings]=\"dragScrollSettings\"\n [rows]=\"renderedTreeListItems\"\n [slots]=\"timelineSlots\"\n [groupSlots]=\"timelineGroupSlots\"\n [tableWidth]=\"tableWidth\"\n [activeView]=\"activeView\"\n [taskContentTemplate]=\"taskContentTemplate?.templateRef\"\n [taskTemplate]=\"taskTemplate?.templateRef\"\n [summaryTaskTemplate]=\"summaryTaskTemplate?.templateRef\"\n [taskClass]=\"taskClass\"\n [dependencies]=\"dependencies\"\n [hasChildren]=\"hasChildren\"\n [isTaskSelected]=\"isTaskSelected\"\n [kendoEventsOutsideAngular]=\"{\n click: handleTimelineClick,\n contextmenu: handleTimelineRightClick,\n dblclick: handleTimelineDblClick,\n mousedown: handleTimelineMouseDown\n }\"\n [scope]=\"this\"\n ></kendo-gantt-timeline>\n </kendo-splitter-pane>\n </kendo-splitter>\n </div>\n <kendo-gantt-toolbar\n *ngIf=\"showToolbar('bottom')\"\n [showAddTask]=\"toolbarSettings.addTaskTool === 'bottom' || toolbarSettings.addTaskTool === 'both'\"\n [showViewSelector]=\"toolbarSettings.viewSelectorTool === 'bottom' || toolbarSettings.viewSelectorTool === 'both'\"\n class=\"k-gantt-footer k-toolbar k-gantt-toolbar\"\n position=\"bottom\"></kendo-gantt-toolbar>\n <kendo-gantt-edit-dialog\n *ngIf=\"showEditingDialog\"\n [data]=\"data\">\n </kendo-gantt-edit-dialog>\n <kendo-dialog\n *ngIf=\"showConfirmationDialog\"\n [width]=\"575\"\n [height]=\"170\"\n [title]=\"getText('confirmationDialogTitle')\"\n (close)=\"showConfirmationDialog = false;\">\n <span>{{ getText('confirmationDialogContent') }}</span>\n <kendo-dialog-actions layout=\"normal\">\n <kendo-treelist-spacer></kendo-treelist-spacer>\n <button kendoButton [primary]=\"true\" (click)=\"handleDeleteConfirmation()\">{{ getText('deleteButtonText') }}</button>\n <button kendoButton (click)=\"showConfirmationDialog = false;\">{{ getText('cancelButtonText') }}</button>\n </kendo-dialog-actions>\n </kendo-dialog>\n "
2954
3616
  }),
2955
3617
  __metadata("design:paramtypes", [TimelineViewService,
2956
3618
  ScrollSyncService,
@@ -2969,142 +3631,29 @@ var GanttComponent = /** @class */ (function () {
2969
3631
  /**
2970
3632
  * @hidden
2971
3633
  */
2972
- var GanttTimelineComponent = /** @class */ (function () {
2973
- function GanttTimelineComponent(scrollSyncService, dependencyDomService, renderer, zone) {
2974
- var _this = this;
2975
- this.scrollSyncService = scrollSyncService;
3634
+ var TOUCH_ENABLED = new InjectionToken('gantt-touch-enabled');
3635
+
3636
+ /**
3637
+ * @hidden
3638
+ */
3639
+ var GanttTasksTableBodyComponent = /** @class */ (function () {
3640
+ function GanttTasksTableBodyComponent(dependencyDomService, mapper) {
2976
3641
  this.dependencyDomService = dependencyDomService;
2977
- this.renderer = renderer;
2978
- this.zone = zone;
2979
- this.hostClass = true;
2980
- this.dependencies = [];
2981
- this.subscriptions = new Subscription();
2982
- this.subscriptions.add(
2983
- // task changes indicates change in row content, number, height, etc.
2984
- this.dependencyDomService.taskChanges
2985
- .pipe(filter(function (args) { return isPresent(args.timelineRow); }), switchMap(function (args) { return _this.zone.onStable.pipe(take(1), map(function () { return args; })); }) // ensure the content is rendered
2986
- )
2987
- .subscribe(function (_a) {
2988
- var timelineRow = _a.timelineRow;
2989
- var timelineRowHeight = isDocumentAvailable() ? timelineRow.getBoundingClientRect().height : 0;
2990
- _this.renderer.setStyle(_this.timelineColumns.nativeElement, 'height', (_this.rows || []).length * timelineRowHeight + "px");
2991
- }));
3642
+ this.mapper = mapper;
2992
3643
  }
2993
- GanttTimelineComponent.prototype.ngAfterViewInit = function () {
2994
- var timelineHeader = this.timelineHeaderWrap.nativeElement;
2995
- var rightContainer = this.timelineContent.nativeElement;
2996
- this.scrollSyncService.registerElement(rightContainer, 'timeline');
2997
- this.scrollSyncService.registerElement(timelineHeader, 'header');
2998
- this.dependencyDomService.registerContentContainer(this.tasksContainer.nativeElement);
2999
- };
3000
- GanttTimelineComponent.prototype.ngOnDestroy = function () {
3001
- this.subscriptions.unsubscribe();
3002
- };
3003
- GanttTimelineComponent.prototype.isNonWorking = function (item) {
3004
- return item.hasOwnProperty('isWorking') && !item.isWorking;
3005
- };
3006
- __decorate([
3007
- ViewChild('timelineContent', { static: true }),
3008
- __metadata("design:type", ElementRef)
3009
- ], GanttTimelineComponent.prototype, "timelineContent", void 0);
3010
- __decorate([
3011
- ViewChild('timelineColumns', { static: true }),
3012
- __metadata("design:type", ElementRef)
3013
- ], GanttTimelineComponent.prototype, "timelineColumns", void 0);
3014
- __decorate([
3015
- ViewChild('timelineHeaderWrap', { static: true }),
3016
- __metadata("design:type", ElementRef)
3017
- ], GanttTimelineComponent.prototype, "timelineHeaderWrap", void 0);
3018
- __decorate([
3019
- ViewChild('tasksContainer', { static: true }),
3020
- __metadata("design:type", ElementRef)
3021
- ], GanttTimelineComponent.prototype, "tasksContainer", void 0);
3022
- __decorate([
3023
- HostBinding('class.k-gantt-timeline'),
3024
- __metadata("design:type", Boolean)
3025
- ], GanttTimelineComponent.prototype, "hostClass", void 0);
3026
- __decorate([
3027
- Input(),
3028
- __metadata("design:type", Array)
3029
- ], GanttTimelineComponent.prototype, "rows", void 0);
3030
- __decorate([
3031
- Input(),
3032
- __metadata("design:type", Array)
3033
- ], GanttTimelineComponent.prototype, "slots", void 0);
3034
- __decorate([
3035
- Input(),
3036
- __metadata("design:type", Array)
3037
- ], GanttTimelineComponent.prototype, "groupSlots", void 0);
3038
- __decorate([
3039
- Input(),
3040
- __metadata("design:type", Number)
3041
- ], GanttTimelineComponent.prototype, "tableWidth", void 0);
3042
- __decorate([
3043
- Input(),
3044
- __metadata("design:type", String)
3045
- ], GanttTimelineComponent.prototype, "activeView", void 0);
3046
- __decorate([
3047
- Input(),
3048
- __metadata("design:type", TemplateRef)
3049
- ], GanttTimelineComponent.prototype, "taskContentTemplate", void 0);
3050
- __decorate([
3051
- Input(),
3052
- __metadata("design:type", TemplateRef)
3053
- ], GanttTimelineComponent.prototype, "taskTemplate", void 0);
3054
- __decorate([
3055
- Input(),
3056
- __metadata("design:type", TemplateRef)
3057
- ], GanttTimelineComponent.prototype, "summaryTaskTemplate", void 0);
3058
- __decorate([
3059
- Input(),
3060
- __metadata("design:type", Function)
3061
- ], GanttTimelineComponent.prototype, "taskClass", void 0);
3062
- __decorate([
3063
- Input(),
3064
- __metadata("design:type", Function)
3065
- ], GanttTimelineComponent.prototype, "isTaskSelected", void 0);
3066
- __decorate([
3067
- Input(),
3068
- __metadata("design:type", Function)
3069
- ], GanttTimelineComponent.prototype, "hasChildren", void 0);
3070
- __decorate([
3071
- Input(),
3072
- __metadata("design:type", Array)
3073
- ], GanttTimelineComponent.prototype, "dependencies", void 0);
3074
- GanttTimelineComponent = __decorate([
3075
- Component({
3076
- selector: 'kendo-gantt-timeline',
3077
- 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 "
3078
- }),
3079
- __metadata("design:paramtypes", [ScrollSyncService,
3080
- DependencyDomService,
3081
- Renderer2,
3082
- NgZone])
3083
- ], GanttTimelineComponent);
3084
- return GanttTimelineComponent;
3085
- }());
3086
-
3087
- /**
3088
- * @hidden
3089
- */
3090
- var GanttTasksTableBodyComponent = /** @class */ (function () {
3091
- function GanttTasksTableBodyComponent(dependencyDomService, mapper) {
3092
- this.dependencyDomService = dependencyDomService;
3093
- this.mapper = mapper;
3094
- }
3095
- Object.defineProperty(GanttTasksTableBodyComponent.prototype, "timelineRow", {
3096
- set: function (timelineRow) {
3097
- // register the row value only when the first row is rendered
3098
- // with server-side data-binding, the rows rendering could be delayed
3099
- if (isPresent(timelineRow)) {
3100
- this.dependencyDomService.registerTimelineRow(timelineRow.nativeElement);
3101
- }
3102
- },
3103
- enumerable: true,
3104
- configurable: true
3105
- });
3106
- GanttTasksTableBodyComponent.prototype.isMileStone = function (task) {
3107
- return !this.hasChildren(task) && isEqual(this.mapper.extractFromTask(task, 'start'), this.mapper.extractFromTask(task, 'end'));
3644
+ Object.defineProperty(GanttTasksTableBodyComponent.prototype, "timelineRow", {
3645
+ set: function (timelineRow) {
3646
+ // register the row value only when the first row is rendered
3647
+ // with server-side data-binding, the rows rendering could be delayed
3648
+ if (isPresent(timelineRow)) {
3649
+ this.dependencyDomService.registerTimelineRow(timelineRow.nativeElement);
3650
+ }
3651
+ },
3652
+ enumerable: true,
3653
+ configurable: true
3654
+ });
3655
+ GanttTasksTableBodyComponent.prototype.isMileStone = function (task) {
3656
+ return !this.hasChildren(task) && isEqual(this.mapper.extractFromTask(task, 'start'), this.mapper.extractFromTask(task, 'end'));
3108
3657
  };
3109
3658
  __decorate([
3110
3659
  ViewChild('timelineRow', { static: false }),
@@ -3143,10 +3692,14 @@ var GanttTasksTableBodyComponent = /** @class */ (function () {
3143
3692
  Input(),
3144
3693
  __metadata("design:type", Function)
3145
3694
  ], GanttTasksTableBodyComponent.prototype, "isTaskSelected", void 0);
3695
+ __decorate([
3696
+ Input(),
3697
+ __metadata("design:type", Boolean)
3698
+ ], GanttTasksTableBodyComponent.prototype, "renderDependencyDragClues", void 0);
3146
3699
  GanttTasksTableBodyComponent = __decorate([
3147
3700
  Component({
3148
3701
  selector: '[kendoGanttTasksTableBody]',
3149
- template: "\n <tr #timelineRow *ngFor=\"let item of rows; let index = index\">\n <td>\n <kendo-gantt-milestone-task\n *ngIf=\"isMileStone(item); else task\"\n [dataItem]=\"item\"\n [activeView]=\"activeView\"\n [taskClass]=\"taskClass\"\n [isSelected]=\"isTaskSelected\"\n [index]=\"index\"\n >\n </kendo-gantt-milestone-task>\n <ng-template #task>\n <kendo-gantt-summary-task\n *ngIf=\"hasChildren(item)\"\n [dataItem]=\"item\"\n [template]=\"summaryTaskTemplate\"\n [activeView]=\"activeView\"\n [taskClass]=\"taskClass\"\n [isSelected]=\"isTaskSelected\"\n [index]=\"index\"\n >\n </kendo-gantt-summary-task>\n <kendo-gantt-task\n *ngIf=\"!hasChildren(item)\"\n [dataItem]=\"item\"\n [taskContentTemplate]=\"taskContentTemplate\"\n [taskTemplate]=\"taskTemplate\"\n [activeView]=\"activeView\"\n [taskClass]=\"taskClass\"\n [isSelected]=\"isTaskSelected\"\n [index]=\"index\"\n >\n </kendo-gantt-task>\n </ng-template>\n </td>\n </tr>\n "
3702
+ template: "\n <tr #timelineRow *ngFor=\"let item of rows; let index = index\">\n <td>\n <kendo-gantt-milestone-task\n *ngIf=\"isMileStone(item); else task\"\n [dataItem]=\"item\"\n [activeView]=\"activeView\"\n [taskClass]=\"taskClass\"\n [isSelected]=\"isTaskSelected\"\n [attr.data-task-index]=\"index\"\n [renderDependencyDragClues]=\"renderDependencyDragClues\"\n >\n </kendo-gantt-milestone-task>\n <ng-template #task>\n <kendo-gantt-summary-task\n *ngIf=\"hasChildren(item)\"\n [dataItem]=\"item\"\n [template]=\"summaryTaskTemplate\"\n [activeView]=\"activeView\"\n [taskClass]=\"taskClass\"\n [isSelected]=\"isTaskSelected\"\n [attr.data-task-index]=\"index\"\n [renderDependencyDragClues]=\"renderDependencyDragClues\"\n >\n </kendo-gantt-summary-task>\n <kendo-gantt-task\n *ngIf=\"!hasChildren(item)\"\n [dataItem]=\"item\"\n [taskContentTemplate]=\"taskContentTemplate\"\n [taskTemplate]=\"taskTemplate\"\n [activeView]=\"activeView\"\n [taskClass]=\"taskClass\"\n [isSelected]=\"isTaskSelected\"\n [attr.data-task-index]=\"index\"\n [renderDependencyDragClues]=\"renderDependencyDragClues\"\n >\n </kendo-gantt-task>\n </ng-template>\n </td>\n </tr>\n "
3150
3703
  }),
3151
3704
  __metadata("design:paramtypes", [DependencyDomService,
3152
3705
  MappingService])
@@ -3221,23 +3774,6 @@ var GanttTaskBase = /** @class */ (function () {
3221
3774
  enumerable: true,
3222
3775
  configurable: true
3223
3776
  });
3224
- GanttTaskBase.prototype.ngOnChanges = function (changes) {
3225
- if (isPresent(changes.dataItem)) {
3226
- if (isPresent(changes.dataItem.previousValue)) {
3227
- this.dependencyDomService.unregisterTask(changes.dataItem.previousValue);
3228
- }
3229
- this.dependencyDomService.registerTask(this.dataItem, this.taskElement.nativeElement);
3230
- }
3231
- else if (isPresent(changes.activeView)) {
3232
- this.dependencyDomService.notifyChanges();
3233
- }
3234
- };
3235
- GanttTaskBase.prototype.ngOnDestroy = function () {
3236
- if (isPresent(this.dataItem)) {
3237
- this.dependencyDomService.unregisterTask(this.dataItem);
3238
- }
3239
- this.viewChangesSubscription.unsubscribe();
3240
- };
3241
3777
  Object.defineProperty(GanttTaskBase.prototype, "taskWidth", {
3242
3778
  get: function () {
3243
3779
  var itemDuration = this.mapper.extractFromTask(this.dataItem, 'end') - this.mapper.extractFromTask(this.dataItem, 'start');
@@ -3249,6 +3785,12 @@ var GanttTaskBase = /** @class */ (function () {
3249
3785
  configurable: true
3250
3786
  });
3251
3787
  Object.defineProperty(GanttTaskBase.prototype, "taskOffset", {
3788
+ /**
3789
+ * The `left` style prop has to be applied to the host element (.k-task-wrap), as the drag clue elements are displayed on .k-task-wrap hover.
3790
+ * Applying the `left` offset to the inner .k-task element leaves the .k-task-wrap element rendered with an offset of 0 somewhere on the left
3791
+ * and hovering just the .k-task element doesn't expose the drag clues.
3792
+ * Additionally, positioning the entire container takes care of positioning the hints as well.
3793
+ */
3252
3794
  get: function () {
3253
3795
  var timeAfterViewStart = this.mapper.extractFromTask(this.dataItem, 'start') - this.viewService.viewStart;
3254
3796
  var offsetInSlotUnits = timeAfterViewStart / this.slotUnitDuration;
@@ -3267,6 +3809,23 @@ var GanttTaskBase = /** @class */ (function () {
3267
3809
  enumerable: true,
3268
3810
  configurable: true
3269
3811
  });
3812
+ GanttTaskBase.prototype.ngOnChanges = function (changes) {
3813
+ if (isPresent(changes.dataItem)) {
3814
+ if (isPresent(changes.dataItem.previousValue)) {
3815
+ this.dependencyDomService.unregisterTask(changes.dataItem.previousValue);
3816
+ }
3817
+ this.dependencyDomService.registerTask(this.dataItem, this.taskElement.nativeElement);
3818
+ }
3819
+ else if (isPresent(changes.activeView)) {
3820
+ this.dependencyDomService.notifyChanges();
3821
+ }
3822
+ };
3823
+ GanttTaskBase.prototype.ngOnDestroy = function () {
3824
+ if (isPresent(this.dataItem)) {
3825
+ this.dependencyDomService.unregisterTask(this.dataItem);
3826
+ }
3827
+ this.viewChangesSubscription.unsubscribe();
3828
+ };
3270
3829
  __decorate([
3271
3830
  HostBinding('class.k-task-wrap'),
3272
3831
  __metadata("design:type", Boolean)
@@ -3281,8 +3840,8 @@ var GanttTaskBase = /** @class */ (function () {
3281
3840
  ], GanttTaskBase.prototype, "dataItem", void 0);
3282
3841
  __decorate([
3283
3842
  Input(),
3284
- __metadata("design:type", Number)
3285
- ], GanttTaskBase.prototype, "index", void 0);
3843
+ __metadata("design:type", Boolean)
3844
+ ], GanttTaskBase.prototype, "renderDependencyDragClues", void 0);
3286
3845
  __decorate([
3287
3846
  Input(),
3288
3847
  __metadata("design:type", Function)
@@ -3295,6 +3854,11 @@ var GanttTaskBase = /** @class */ (function () {
3295
3854
  Input(),
3296
3855
  __metadata("design:type", Function)
3297
3856
  ], GanttTaskBase.prototype, "taskClass", void 0);
3857
+ __decorate([
3858
+ HostBinding('style.left.px'),
3859
+ __metadata("design:type", Number),
3860
+ __metadata("design:paramtypes", [])
3861
+ ], GanttTaskBase.prototype, "taskOffset", null);
3298
3862
  return GanttTaskBase;
3299
3863
  }());
3300
3864
 
@@ -3303,9 +3867,10 @@ var GanttTaskBase = /** @class */ (function () {
3303
3867
  */
3304
3868
  var GanttTaskComponent = /** @class */ (function (_super) {
3305
3869
  __extends(GanttTaskComponent, _super);
3306
- function GanttTaskComponent(mapper, timelineViewService, dependencyDomService, optionChangesService, cdr, editService) {
3870
+ function GanttTaskComponent(editService, touchEnabled$$1, mapper, timelineViewService, dependencyDomService, optionChangesService, cdr) {
3307
3871
  var _this = _super.call(this, mapper, timelineViewService, dependencyDomService, optionChangesService, cdr) || this;
3308
3872
  _this.editService = editService;
3873
+ _this.touchEnabled = touchEnabled$$1;
3309
3874
  return _this;
3310
3875
  }
3311
3876
  GanttTaskComponent_1 = GanttTaskComponent;
@@ -3331,14 +3896,14 @@ var GanttTaskComponent = /** @class */ (function (_super) {
3331
3896
  useExisting: forwardRef(function () { return GanttTaskComponent_1; })
3332
3897
  }
3333
3898
  ],
3334
- template: "\n <div\n #task\n class=\"k-task k-task-single\"\n [ngClass]=\"taskClass(dataItem)\"\n [style.width.px]=\"taskWidth\"\n [style.left.px]=\"taskOffset\"\n [attr.title]=\"mapper.extractFromTask(dataItem, 'title')\"\n [attr.data-task-index]=\"index\"\n [class.k-state-selected]=\"isSelected(dataItem)\"\n >\n <ng-container *ngIf=\"!taskTemplate\">\n <div\n class=\"k-task-complete\"\n [style.width.px]=\"completionOverlayWidth\"\n >\n </div>\n <div class=\"k-task-content\">\n <div class=\"k-task-template\">\n <ng-container *ngIf=\"!taskContentTemplate; else taskContent\">\n {{ mapper.extractFromTask(dataItem, 'title') }}\n </ng-container>\n <ng-template\n #taskContent\n [ngTemplateOutlet]=\"taskContentTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: dataItem }\"\n >\n </ng-template>\n </div>\n <span class=\"k-task-actions\">\n <span\n (click)=\"onTaskDelete()\"\n class=\"k-link k-task-delete\">\n <span class=\"k-icon k-i-close\"></span>\n </span>\n </span>\n </div>\n </ng-container>\n <ng-template\n *ngIf=\"taskTemplate\"\n [ngTemplateOutlet]=\"taskTemplate\"\n [ngTemplateOutletContext]=\"{\n $implicit: dataItem,\n elementWidth: taskWidth\n }\"\n >\n </ng-template>\n </div>\n "
3899
+ template: "\n <div\n #task\n class=\"k-task k-task-single\"\n [ngClass]=\"taskClass(dataItem)\"\n [style.width.px]=\"taskWidth\"\n [attr.title]=\"mapper.extractFromTask(dataItem, 'title')\"\n [class.k-state-selected]=\"isSelected(dataItem)\"\n >\n <ng-container *ngIf=\"!taskTemplate\">\n <div\n class=\"k-task-complete\"\n [style.width.px]=\"completionOverlayWidth\"\n >\n </div>\n <div class=\"k-task-content\">\n <div class=\"k-task-template\">\n <ng-container *ngIf=\"!taskContentTemplate; else taskContent\">\n {{ mapper.extractFromTask(dataItem, 'title') }}\n </ng-container>\n <ng-template\n #taskContent\n [ngTemplateOutlet]=\"taskContentTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: dataItem }\"\n >\n </ng-template>\n </div>\n <span class=\"k-task-actions\">\n <span\n (click)=\"onTaskDelete()\"\n class=\"k-link k-task-delete\">\n <span class=\"k-icon k-i-close\"></span>\n </span>\n </span>\n </div>\n </ng-container>\n <ng-template\n *ngIf=\"taskTemplate\"\n [ngTemplateOutlet]=\"taskTemplate\"\n [ngTemplateOutletContext]=\"{\n $implicit: dataItem,\n elementWidth: taskWidth\n }\"\n >\n </ng-template>\n </div>\n <ng-container *ngIf=\"renderDependencyDragClues\">\n <div\n class=\"k-task-dot k-task-start k-touch-action-none\"\n [class.k-display-block]=\"touchEnabled\"\n >\n </div>\n <div\n class=\"k-task-dot k-task-end k-touch-action-none\"\n [class.k-display-block]=\"touchEnabled\"\n >\n </div>\n </ng-container>\n "
3335
3900
  }),
3336
- __metadata("design:paramtypes", [MappingService,
3901
+ __param(1, Inject(TOUCH_ENABLED)),
3902
+ __metadata("design:paramtypes", [EditService, Boolean, MappingService,
3337
3903
  TimelineViewService,
3338
3904
  DependencyDomService,
3339
3905
  OptionChangesService,
3340
- ChangeDetectorRef,
3341
- EditService])
3906
+ ChangeDetectorRef])
3342
3907
  ], GanttTaskComponent);
3343
3908
  return GanttTaskComponent;
3344
3909
  }(GanttTaskBase));
@@ -3348,8 +3913,9 @@ var GanttTaskComponent = /** @class */ (function (_super) {
3348
3913
  */
3349
3914
  var GanttSummaryTaskComponent = /** @class */ (function (_super) {
3350
3915
  __extends(GanttSummaryTaskComponent, _super);
3351
- function GanttSummaryTaskComponent(mapper, timelineViewService, dependencyDomService, optionChangesService, cdr) {
3916
+ function GanttSummaryTaskComponent(touchEnabled$$1, mapper, timelineViewService, dependencyDomService, optionChangesService, cdr) {
3352
3917
  var _this = _super.call(this, mapper, timelineViewService, dependencyDomService, optionChangesService, cdr) || this;
3918
+ _this.touchEnabled = touchEnabled$$1;
3353
3919
  _this.summaryWrapperClass = true;
3354
3920
  return _this;
3355
3921
  }
@@ -3372,9 +3938,10 @@ var GanttSummaryTaskComponent = /** @class */ (function (_super) {
3372
3938
  useExisting: forwardRef(function () { return GanttSummaryTaskComponent_1; })
3373
3939
  }
3374
3940
  ],
3375
- template: "\n <div\n #task\n class=\"k-task k-task-summary\"\n [ngClass]=\"taskClass(dataItem)\"\n [style.width.px]=\"taskWidth\"\n [style.left.px]=\"taskOffset\"\n [attr.title]=\"mapper.extractFromTask(dataItem, 'title')\"\n [attr.data-task-index]=\"index\"\n [class.k-state-selected]=\"isSelected(dataItem)\"\n >\n <div *ngIf=\"!template; else summaryTemplate\"\n class=\"k-task-summary-progress\"\n [style.width.px]=\"taskWidth\">\n <div\n class=\"k-task-summary-complete\"\n [style.width.px]=\"completionOverlayWidth\"\n >\n </div>\n </div>\n <ng-template\n #summaryTemplate\n [ngTemplateOutlet]=\"template\"\n [ngTemplateOutletContext]=\"{\n $implicit: dataItem,\n elementWidth: taskWidth\n }\"\n >\n </ng-template>\n </div>\n "
3941
+ template: "\n <div\n #task\n class=\"k-task k-task-summary\"\n [ngClass]=\"taskClass(dataItem)\"\n [style.width.px]=\"taskWidth\"\n [attr.title]=\"mapper.extractFromTask(dataItem, 'title')\"\n [class.k-state-selected]=\"isSelected(dataItem)\"\n >\n <div *ngIf=\"!template; else summaryTemplate\"\n class=\"k-task-summary-progress\"\n [style.width.px]=\"taskWidth\">\n <div\n class=\"k-task-summary-complete\"\n [style.width.px]=\"completionOverlayWidth\"\n >\n </div>\n </div>\n <ng-template\n #summaryTemplate\n [ngTemplateOutlet]=\"template\"\n [ngTemplateOutletContext]=\"{\n $implicit: dataItem,\n elementWidth: taskWidth\n }\"\n >\n </ng-template>\n </div>\n <ng-container *ngIf=\"renderDependencyDragClues\">\n <div\n class=\"k-task-dot k-task-start k-touch-action-none\"\n [class.k-display-block]=\"touchEnabled\"\n >\n </div>\n <div\n class=\"k-task-dot k-task-end k-touch-action-none\"\n [class.k-display-block]=\"touchEnabled\"\n >\n </div>\n </ng-container>\n "
3376
3942
  }),
3377
- __metadata("design:paramtypes", [MappingService,
3943
+ __param(0, Inject(TOUCH_ENABLED)),
3944
+ __metadata("design:paramtypes", [Boolean, MappingService,
3378
3945
  TimelineViewService,
3379
3946
  DependencyDomService,
3380
3947
  OptionChangesService,
@@ -3388,8 +3955,9 @@ var GanttSummaryTaskComponent = /** @class */ (function (_super) {
3388
3955
  */
3389
3956
  var GanttMilestoneTaskComponent = /** @class */ (function (_super) {
3390
3957
  __extends(GanttMilestoneTaskComponent, _super);
3391
- function GanttMilestoneTaskComponent(mapper, timelineViewService, dependencyDomService, optionChangesService, cdr) {
3958
+ function GanttMilestoneTaskComponent(touchEnabled$$1, mapper, timelineViewService, dependencyDomService, optionChangesService, cdr) {
3392
3959
  var _this = _super.call(this, mapper, timelineViewService, dependencyDomService, optionChangesService, cdr) || this;
3960
+ _this.touchEnabled = touchEnabled$$1;
3393
3961
  _this.milestoneWrapperClass = true;
3394
3962
  return _this;
3395
3963
  }
@@ -3408,9 +3976,10 @@ var GanttMilestoneTaskComponent = /** @class */ (function (_super) {
3408
3976
  useExisting: forwardRef(function () { return GanttMilestoneTaskComponent_1; })
3409
3977
  }
3410
3978
  ],
3411
- template: "\n <div\n #task\n class=\"k-task k-task-milestone\"\n [ngClass]=\"taskClass(dataItem)\"\n [style.left.px]=\"taskOffset\"\n [attr.title]=\"mapper.extractFromTask(dataItem, 'title')\"\n [class.k-state-selected]=\"isSelected(dataItem)\"\n [attr.data-task-index]=\"index\"\n >\n </div>\n "
3979
+ template: "\n <div\n #task\n class=\"k-task k-task-milestone\"\n [ngClass]=\"taskClass(dataItem)\"\n [attr.title]=\"mapper.extractFromTask(dataItem, 'title')\"\n [class.k-state-selected]=\"isSelected(dataItem)\"\n >\n </div>\n <ng-container *ngIf=\"renderDependencyDragClues\">\n <div\n class=\"k-task-dot k-task-start k-touch-action-none\"\n [class.k-display-block]=\"touchEnabled\"\n >\n </div>\n <div\n class=\"k-task-dot k-task-end k-touch-action-none\"\n [class.k-display-block]=\"touchEnabled\"\n >\n </div>\n </ng-container>\n "
3412
3980
  }),
3413
- __metadata("design:paramtypes", [MappingService,
3981
+ __param(0, Inject(TOUCH_ENABLED)),
3982
+ __metadata("design:paramtypes", [Boolean, MappingService,
3414
3983
  TimelineViewService,
3415
3984
  DependencyDomService,
3416
3985
  OptionChangesService,
@@ -3480,9 +4049,8 @@ var GanttHierarchyBindingDirective = /** @class */ (function (_super) {
3480
4049
  */
3481
4050
  var GanttExpandableDirective = /** @class */ (function (_super) {
3482
4051
  __extends(GanttExpandableDirective, _super);
3483
- // fixes an injection error in some builds/ng-versions (e.g. StackBlitz)
3484
- function GanttExpandableDirective(gantt) {
3485
- return _super.call(this, gantt) || this;
4052
+ function GanttExpandableDirective() {
4053
+ return _super !== null && _super.apply(this, arguments) || this;
3486
4054
  }
3487
4055
  __decorate([
3488
4056
  Input(),
@@ -3492,8 +4060,7 @@ var GanttExpandableDirective = /** @class */ (function (_super) {
3492
4060
  Directive({
3493
4061
  exportAs: 'kendoGanttExpandable',
3494
4062
  selector: '[kendoGanttExpandable]'
3495
- }),
3496
- __metadata("design:paramtypes", [ExpandableTreeComponent])
4063
+ })
3497
4064
  ], GanttExpandableDirective);
3498
4065
  return GanttExpandableDirective;
3499
4066
  }(ExpandableDirective));
@@ -3671,6 +4238,14 @@ var ToolbarComponent = /** @class */ (function () {
3671
4238
  this.gantt.activeViewChange.emit(e);
3672
4239
  this.scrollSyncService.resetTimelineScrollLeft();
3673
4240
  };
4241
+ __decorate([
4242
+ Input(),
4243
+ __metadata("design:type", Boolean)
4244
+ ], ToolbarComponent.prototype, "showAddTask", void 0);
4245
+ __decorate([
4246
+ Input(),
4247
+ __metadata("design:type", Boolean)
4248
+ ], ToolbarComponent.prototype, "showViewSelector", void 0);
3674
4249
  __decorate([
3675
4250
  Input(),
3676
4251
  __metadata("design:type", String),
@@ -3679,7 +4254,7 @@ var ToolbarComponent = /** @class */ (function () {
3679
4254
  ToolbarComponent = __decorate([
3680
4255
  Component({
3681
4256
  selector: 'kendo-gantt-toolbar',
3682
- template: "\n <ng-container *ngIf=\"!renderTemplate\">\n <span class=\"k-spacer k-toolbar-spacer\"></span>\n <kendo-gantt-view-selector\n [views]=\"gantt.viewTypes\"\n [activeView]=\"gantt.activeView\"\n (activeViewChange)=\"onViewChange($event)\"></kendo-gantt-view-selector>\n </ng-container>\n <ng-template\n *ngIf=\"renderTemplate\"\n [ngTemplateOutlet]=\"toolbarTemplateRef\"\n [ngTemplateOutletContext]=\"context\"\n >\n </ng-template>\n "
4257
+ template: "\n <ng-container *ngIf=\"!renderTemplate\">\n <kendo-gantt-add-task *ngIf=\"showAddTask\"></kendo-gantt-add-task>\n <span class=\"k-spacer k-toolbar-spacer\"></span>\n <kendo-gantt-view-selector\n *ngIf=\"showViewSelector\"\n [views]=\"gantt.viewTypes\"\n [activeView]=\"gantt.activeView\"\n (activeViewChange)=\"onViewChange($event)\"></kendo-gantt-view-selector>\n </ng-container>\n <ng-template\n *ngIf=\"renderTemplate\"\n [ngTemplateOutlet]=\"toolbarTemplateRef\"\n [ngTemplateOutletContext]=\"context\"\n >\n </ng-template>\n "
3683
4258
  }),
3684
4259
  __metadata("design:paramtypes", [GanttComponent,
3685
4260
  ScrollSyncService])
@@ -3754,6 +4329,9 @@ var getOffsetRelativeToParent = function (element, targetParent) {
3754
4329
  top: 0,
3755
4330
  left: 0
3756
4331
  };
4332
+ if (!targetParent.contains(element)) {
4333
+ return offset;
4334
+ }
3757
4335
  var offsetParent = element;
3758
4336
  while (offsetParent && offsetParent !== targetParent) {
3759
4337
  offset.top += offsetParent.offsetTop;
@@ -3787,9 +4365,9 @@ var dependencyCoordinates = function (from, to, rowHeight, type, minDistanceBefo
3787
4365
  | |
3788
4366
  [[[]]]- -[[[]]]
3789
4367
  */
3790
- if (type === 0 /* FF */ || type === 3 /* SS */) {
4368
+ if (type === DependencyType.FF || type === DependencyType.SS) {
3791
4369
  // polyline start from first task
3792
- var dir = type === 3 /* SS */ ? 'left' : 'right';
4370
+ var dir = type === DependencyType.SS ? 'left' : 'right';
3793
4371
  top = from.top;
3794
4372
  left = from[dir];
3795
4373
  points.push({ top: top, left: left });
@@ -3815,9 +4393,9 @@ var dependencyCoordinates = function (from, to, rowHeight, type, minDistanceBefo
3815
4393
  |
3816
4394
  -[[[]]]
3817
4395
  */
3818
- var startDir = type === 2 /* SF */ ? 'left' : 'right';
3819
- var endDir = type === 2 /* SF */ ? 'right' : 'left';
3820
- var additionalTurn = type === 2 /* SF */
4396
+ var startDir = type === DependencyType.SF ? 'left' : 'right';
4397
+ var endDir = type === DependencyType.SF ? 'right' : 'left';
4398
+ var additionalTurn = type === DependencyType.SF
3821
4399
  ? from[startDir] - minDistanceBeforeTurn * 2 < to[endDir]
3822
4400
  : from[startDir] + minDistanceBeforeTurn * 2 > to[endDir];
3823
4401
  // polyline start from first task
@@ -3900,6 +4478,37 @@ var getArrowEast = function (top, left, arrowSize) {
3900
4478
  });
3901
4479
  return points;
3902
4480
  };
4481
+ /**
4482
+ * @hidden
4483
+ *
4484
+ * Translates the provided client `left` and `top` coords to coords relative to the provided container.
4485
+ * https://developer.mozilla.org/en-US/docs/Web/CSS/CSSOM_View/Coordinate_systems#standard_cssom_coordinate_systems
4486
+ */
4487
+ var clientToOffsetCoords = function (clientLeft, clientTop, offsetContainer) {
4488
+ // client (viewport) coordinates of the target container
4489
+ // https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRect#value
4490
+ var offsetContainerClientRect = offsetContainer.getBoundingClientRect();
4491
+ return {
4492
+ left: clientLeft - offsetContainerClientRect.left + offsetContainer.scrollLeft,
4493
+ top: clientTop - offsetContainerClientRect.top + offsetContainer.scrollTop
4494
+ };
4495
+ };
4496
+ /**
4497
+ * @hidden
4498
+ *
4499
+ * Retrieves the `left` and `top` values of the center of the provided element.
4500
+ * The retrieved values are relative to the current viewport (client values).
4501
+ * https://developer.mozilla.org/en-US/docs/Web/CSS/CSSOM_View/Coordinate_systems#standard_cssom_coordinate_systems
4502
+ */
4503
+ var getElementClientCenterCoords = function (element) {
4504
+ // client (viewport) coordinates of the targeted element
4505
+ // https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRect#value
4506
+ var _a = element.getBoundingClientRect(), left = _a.left, top = _a.top, width = _a.width, height = _a.height;
4507
+ return {
4508
+ left: left + (width / 2),
4509
+ top: top + (height / 2)
4510
+ };
4511
+ };
3903
4512
 
3904
4513
  /**
3905
4514
  * Defines the size of the arrow that will be drawn at the end of each Gantt dependency.
@@ -3982,81 +4591,600 @@ var GanttDependencyDirective = /** @class */ (function () {
3982
4591
  return GanttDependencyDirective;
3983
4592
  }());
3984
4593
 
3985
- var TimelineDayViewComponent = /** @class */ (function (_super) {
3986
- __extends(TimelineDayViewComponent, _super);
3987
- function TimelineDayViewComponent(optionChangesService, dependencyDomService) {
3988
- var _this = _super.call(this, optionChangesService, dependencyDomService) || this;
3989
- /**
3990
- * The type for this view (`day`).
3991
- */
3992
- _this.type = 'day';
3993
- return _this;
3994
- }
3995
- TimelineDayViewComponent_1 = TimelineDayViewComponent;
3996
- var TimelineDayViewComponent_1;
3997
- TimelineDayViewComponent = TimelineDayViewComponent_1 = __decorate([
3998
- Component({
3999
- selector: 'kendo-gantt-timeline-day-view',
4000
- template: '',
4001
- providers: [
4002
- {
4003
- provide: ViewBase,
4004
- useExisting: forwardRef(function () { return TimelineDayViewComponent_1; })
4005
- }
4006
- ]
4007
- }),
4008
- __metadata("design:paramtypes", [OptionChangesService, DependencyDomService])
4009
- ], TimelineDayViewComponent);
4010
- return TimelineDayViewComponent;
4011
- }(ViewBase));
4012
-
4013
- var TimelineWeekViewComponent = /** @class */ (function (_super) {
4014
- __extends(TimelineWeekViewComponent, _super);
4015
- function TimelineWeekViewComponent(optionChangesService, dependencyDomService) {
4016
- var _this = _super.call(this, optionChangesService, dependencyDomService) || this;
4594
+ /**
4595
+ * @hidden
4596
+ */
4597
+ var DragValidationTooltipComponent = /** @class */ (function () {
4598
+ function DragValidationTooltipComponent() {
4017
4599
  /**
4018
- * The type for this view (`week`).
4600
+ * Sets the status class of the attempted operation.
4601
+ * Note that the status will be ignored and the `neutral` status class will be rendered,
4602
+ * if the any of the fromTaskName or toTaskName are not populated.
4019
4603
  */
4020
- _this.type = 'week';
4021
- return _this;
4604
+ this.isValid = false;
4022
4605
  }
4023
- TimelineWeekViewComponent_1 = TimelineWeekViewComponent;
4024
- var TimelineWeekViewComponent_1;
4025
- TimelineWeekViewComponent = TimelineWeekViewComponent_1 = __decorate([
4606
+ DragValidationTooltipComponent = __decorate([
4026
4607
  Component({
4027
- selector: 'kendo-gantt-timeline-week-view',
4028
- template: '',
4029
- providers: [
4030
- {
4031
- provide: ViewBase,
4032
- useExisting: forwardRef(function () { return TimelineWeekViewComponent_1; })
4033
- }
4034
- ]
4035
- }),
4036
- __metadata("design:paramtypes", [OptionChangesService, DependencyDomService])
4037
- ], TimelineWeekViewComponent);
4038
- return TimelineWeekViewComponent;
4039
- }(ViewBase));
4608
+ template: "\n <div\n class=\"k-tooltip k-gantt-tooltip-validation\"\n [class.k-gantt-tooltip-valid]=\"showValidityStatus && isValid\"\n [class.k-gantt-tooltip-invalid]=\"showValidityStatus && !isValid\"\n >\n <div class=\"k-gantt-tooltip-validation-row\">\n <span class=\"k-gantt-tooltip-validation-label\">From:</span>\n <span class=\"k-gantt-tooltip-validation-value\">{{ fromTaskName }}</span>\n </div>\n <div class=\"k-gantt-tooltip-validation-row\">\n <span class=\"k-gantt-tooltip-validation-label\">To:</span>\n <span class=\"k-gantt-tooltip-validation-value\">{{ toTaskName }}</span>\n </div>\n </div>\n ",
4609
+ styles: ["\n .k-gantt-tooltip-validation {\n max-width: 200px;\n display: block;\n }\n .k-gantt-tooltip-validation::before {\n content: '';\n position: absolute;\n left: 0;\n top: 0;\n width: 4px;\n height: 100%;\n background: #656565;\n }\n .k-gantt-tooltip-validation.k-gantt-tooltip-valid::before {\n background: #37B400;\n }\n .k-gantt-tooltip-validation.k-gantt-tooltip-invalid::before {\n background: #F31700;\n }\n .k-gantt-tooltip-validation-row {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n .k-gantt-tooltip-validation-label {\n display: inline-flex;\n width: 50px;\n }\n .k-gantt-tooltip-validation-value {\n font-weight: bold;\n }\n "]
4610
+ })
4611
+ ], DragValidationTooltipComponent);
4612
+ return DragValidationTooltipComponent;
4613
+ }());
4040
4614
 
4041
- var TimelineMonthViewComponent = /** @class */ (function (_super) {
4042
- __extends(TimelineMonthViewComponent, _super);
4043
- function TimelineMonthViewComponent(optionChangesService, dependencyDomService) {
4044
- var _this = _super.call(this, optionChangesService, dependencyDomService) || this;
4615
+ /**
4616
+ * When added to the .k-task-dot, the element will be kept with hover styles.
4617
+ * Used for the drag clue from which the dragging has started.
4618
+ */
4619
+ var DRAG_CLUE_HOVER_CLASS = 'k-state-hover';
4620
+ /**
4621
+ * Add the selection disabling class to the enitre container.
4622
+ * Otherwise existing selection on a given task text prevents dragging the clue even if the clue has `user-select: none` styles.
4623
+ */
4624
+ var USER_SELECT_NONE_CLASS = 'k-user-select-none';
4625
+ /**
4626
+ * When added to the .k-task-wrap, the containing .k-task-dot elements will be kept visible even when not hovered.
4627
+ * Used for the drag clue from which the dragging has started.
4628
+ */
4629
+ var TASK_WRAPPER_DRAG_CLASS = 'k-origin';
4630
+ /**
4631
+ * Use 20px margin between the pointer and the popup.
4632
+ * Could be made user-configurable if there's demand.
4633
+ */
4634
+ var DEFAULT_POPUP_VERTICAL_MARGIN = 20;
4635
+ /**
4636
+ * A directive which enables the creation of new dependencies via dragging.
4637
+ */
4638
+ var DependencyDragCreateDirective = /** @class */ (function () {
4639
+ function DependencyDragCreateDirective(gantt, zone, renderer, mapper, popupService, timelineScrollService) {
4640
+ this.gantt = gantt;
4641
+ this.zone = zone;
4642
+ this.renderer = renderer;
4643
+ this.mapper = mapper;
4644
+ this.popupService = popupService;
4645
+ this.timelineScrollService = timelineScrollService;
4045
4646
  /**
4046
- * The type for this view (`month`).
4647
+ * Specifies whether the validation tooltip will be displayed during drag operations.
4648
+ *
4649
+ * @default true
4047
4650
  */
4048
- _this.type = 'month';
4049
- return _this;
4651
+ this.displayValidationTooltip = true;
4652
+ this.gantt.renderDependencyDragClues = true;
4050
4653
  }
4051
- TimelineMonthViewComponent_1 = TimelineMonthViewComponent;
4052
- var TimelineMonthViewComponent_1;
4053
- TimelineMonthViewComponent = TimelineMonthViewComponent_1 = __decorate([
4054
- Component({
4055
- selector: 'kendo-gantt-timeline-month-view',
4056
- template: '',
4057
- providers: [
4058
- {
4059
- provide: ViewBase,
4654
+ Object.defineProperty(DependencyDragCreateDirective.prototype, "container", {
4655
+ get: function () {
4656
+ if (!isPresent(this.gantt.timeline) || !isPresent(this.gantt.timeline.timelineContent)) {
4657
+ return null;
4658
+ }
4659
+ return this.gantt.timeline.timelineContent.nativeElement;
4660
+ },
4661
+ enumerable: true,
4662
+ configurable: true
4663
+ });
4664
+ Object.defineProperty(DependencyDragCreateDirective.prototype, "polyline", {
4665
+ get: function () {
4666
+ if (!isPresent(this.gantt.timeline) || !isPresent(this.gantt.timeline.dependencyDragCreatePolyline)) {
4667
+ return null;
4668
+ }
4669
+ return this.gantt.timeline.dependencyDragCreatePolyline.nativeElement;
4670
+ },
4671
+ enumerable: true,
4672
+ configurable: true
4673
+ });
4674
+ Object.defineProperty(DependencyDragCreateDirective.prototype, "popupContainer", {
4675
+ get: function () {
4676
+ if (!isPresent(this.gantt.timeline) || !isPresent(this.gantt.timeline.dragPopupContainer)) {
4677
+ return null;
4678
+ }
4679
+ return this.gantt.timeline.dragPopupContainer;
4680
+ },
4681
+ enumerable: true,
4682
+ configurable: true
4683
+ });
4684
+ DependencyDragCreateDirective.prototype.ngAfterViewInit = function () {
4685
+ this.subscribeDraggable();
4686
+ this.addScrollListener();
4687
+ };
4688
+ DependencyDragCreateDirective.prototype.ngOnDestroy = function () {
4689
+ this.unsubscribeDraggable();
4690
+ this.removeScrollListener();
4691
+ this.fromTaskClue = null;
4692
+ this.cancelScroll();
4693
+ this.closeDragPopup();
4694
+ };
4695
+ DependencyDragCreateDirective.prototype.subscribeDraggable = function () {
4696
+ this.dragSubscriptions = this.gantt.timeline.timelineContainerPress
4697
+ .subscribe(this.handlePress.bind(this));
4698
+ this.dragSubscriptions.add(this.gantt.timeline.timelineContainerDrag
4699
+ .subscribe(this.handleDrag.bind(this)));
4700
+ this.dragSubscriptions.add(this.gantt.timeline.timelineContainerRelease
4701
+ .subscribe(this.handleRelease.bind(this)));
4702
+ };
4703
+ DependencyDragCreateDirective.prototype.unsubscribeDraggable = function () {
4704
+ if (isPresent(this.dragSubscriptions)) {
4705
+ this.dragSubscriptions.unsubscribe();
4706
+ this.dragSubscriptions = null;
4707
+ }
4708
+ };
4709
+ DependencyDragCreateDirective.prototype.handlePress = function (_a) {
4710
+ var clientX = _a.clientX, clientY = _a.clientY;
4711
+ // using `originalEvent.target` is not reliable under mobile devices with the current implementation of the draggable, so use this instead
4712
+ var target = elementFromPoint(clientX, clientY);
4713
+ if (isDependencyDragClue(target)) {
4714
+ this.fromTaskClue = target;
4715
+ this.assignDragStartClasses(this.fromTaskClue);
4716
+ // use the center of the target clue as polyline starting point
4717
+ var dragClueCenterCoords = getElementClientCenterCoords(this.fromTaskClue);
4718
+ // the polyline uses `position: aboslute`, so translate the client coordinates to offset coordinates (`left` and `top` relative to the timeline container)
4719
+ this.polylineStartCoords = clientToOffsetCoords(dragClueCenterCoords.left, dragClueCenterCoords.top, this.container);
4720
+ }
4721
+ };
4722
+ DependencyDragCreateDirective.prototype.handleDrag = function (_a) {
4723
+ var clientX = _a.clientX, clientY = _a.clientY;
4724
+ if (isPresent(this.fromTaskClue)) {
4725
+ // the polyline uses `position: aboslute`, so translate the client coordinates to offset coordinates (`left` and `top` relative to the timeline container)
4726
+ var pointerOffsetCoords = clientToOffsetCoords(clientX, clientY, this.container);
4727
+ // the start coords are calculated just once per drag session in handlePress
4728
+ // use the current drag coords as polyline end coords
4729
+ this.updatePolyline(this.polylineStartCoords, pointerOffsetCoords);
4730
+ this.currentPointerClientCoords = { left: clientX, top: clientY };
4731
+ if (this.gantt.dragScrollSettings.enabled) {
4732
+ // use client coordinates for scroll trigger
4733
+ this.scrollPointIntoView(this.currentPointerClientCoords);
4734
+ }
4735
+ if (this.displayValidationTooltip) {
4736
+ this.updateDragPopup(pointerOffsetCoords);
4737
+ }
4738
+ }
4739
+ };
4740
+ DependencyDragCreateDirective.prototype.handleRelease = function (_a) {
4741
+ var _this = this;
4742
+ var clientX = _a.clientX, clientY = _a.clientY;
4743
+ if (!isPresent(this.fromTaskClue)) {
4744
+ return;
4745
+ }
4746
+ // using `originalEvent.target` is not reliable under mobile devices with the current implementation of the draggable, so use this instead
4747
+ var target = elementFromPoint(clientX, clientY);
4748
+ if (isDependencyDragClue(target) && !sameTaskClues(this.fromTaskClue, target, this.container)) {
4749
+ this.zone.run(function () {
4750
+ var _a;
4751
+ var fromTaskClue = _this.fromTaskClue;
4752
+ var toTaskClue = target;
4753
+ var fromTask = _this.gantt.renderedTreeListItems[getClosestTaskIndex(fromTaskClue, _this.container)];
4754
+ var toTask = _this.gantt.renderedTreeListItems[getClosestTaskIndex(toTaskClue, _this.container)];
4755
+ var dependencyType = getDependencyTypeFromTargetTasks(fromTaskClue, toTaskClue);
4756
+ var _b = _this.mapper.dependencyFields, fromId = _b.fromId, toId = _b.toId, type = _b.type;
4757
+ _this.gantt.dependencyAdd.emit({
4758
+ fromTask: fromTask,
4759
+ toTask: toTask,
4760
+ type: dependencyType,
4761
+ isValid: _this.gantt.validateNewDependency((_a = {},
4762
+ _a[fromId] = _this.mapper.extractFromTask(fromTask, 'id'),
4763
+ _a[toId] = _this.mapper.extractFromTask(toTask, 'id'),
4764
+ _a[type] = dependencyType,
4765
+ _a))
4766
+ });
4767
+ });
4768
+ }
4769
+ this.clearPolyline();
4770
+ this.removeDragStartClasses(this.fromTaskClue);
4771
+ this.fromTaskClue = null;
4772
+ this.cancelScroll();
4773
+ this.closeDragPopup();
4774
+ };
4775
+ DependencyDragCreateDirective.prototype.updatePolyline = function (start, end) {
4776
+ var points = start.left + "," + start.top + " " + end.left + "," + end.top;
4777
+ this.renderer.setAttribute(this.polyline, 'points', points);
4778
+ };
4779
+ DependencyDragCreateDirective.prototype.clearPolyline = function () {
4780
+ this.renderer.removeAttribute(this.polyline, 'points');
4781
+ };
4782
+ DependencyDragCreateDirective.prototype.assignDragStartClasses = function (dragClue) {
4783
+ if (!isPresent(dragClue)) {
4784
+ return;
4785
+ }
4786
+ this.renderer.addClass(this.container, USER_SELECT_NONE_CLASS);
4787
+ this.renderer.addClass(dragClue, DRAG_CLUE_HOVER_CLASS);
4788
+ var taskWrapper = getClosestTaskWrapper(dragClue, this.container);
4789
+ if (isPresent(taskWrapper)) {
4790
+ this.renderer.addClass(taskWrapper, TASK_WRAPPER_DRAG_CLASS);
4791
+ }
4792
+ };
4793
+ DependencyDragCreateDirective.prototype.removeDragStartClasses = function (dragClue) {
4794
+ if (!isPresent(dragClue)) {
4795
+ return;
4796
+ }
4797
+ this.renderer.removeClass(this.container, USER_SELECT_NONE_CLASS);
4798
+ this.renderer.removeClass(dragClue, DRAG_CLUE_HOVER_CLASS);
4799
+ var taskWrapper = getClosestTaskWrapper(dragClue, this.container);
4800
+ if (isPresent(taskWrapper)) {
4801
+ this.renderer.removeClass(taskWrapper, TASK_WRAPPER_DRAG_CLASS);
4802
+ }
4803
+ };
4804
+ DependencyDragCreateDirective.prototype.scrollPointIntoView = function (_a) {
4805
+ var left = _a.left, top = _a.top;
4806
+ this.timelineScrollService.requestScrollCancel();
4807
+ this.timelineScrollService.requestHorizontalScroll(left);
4808
+ this.timelineScrollService.requestVerticalScroll(top);
4809
+ };
4810
+ DependencyDragCreateDirective.prototype.cancelScroll = function () {
4811
+ this.timelineScrollService.requestScrollCancel();
4812
+ };
4813
+ DependencyDragCreateDirective.prototype.addScrollListener = function () {
4814
+ var _this = this;
4815
+ if (!isDocumentAvailable()) {
4816
+ return;
4817
+ }
4818
+ this.zone.runOutsideAngular(function () {
4819
+ return _this.scrollListenerDisposer = _this.renderer.listen(_this.container, 'scroll', function () {
4820
+ // update the polyline only if we're currently dragging
4821
+ if (isPresent(_this.fromTaskClue) && isPresent(_this.currentPointerClientCoords)) {
4822
+ var _a = _this.currentPointerClientCoords, left = _a.left, top_1 = _a.top;
4823
+ var pointerOffsetCoords = clientToOffsetCoords(left, top_1, _this.container);
4824
+ _this.updatePolyline(_this.polylineStartCoords, pointerOffsetCoords);
4825
+ if (_this.displayValidationTooltip) {
4826
+ _this.updateDragPopup(pointerOffsetCoords);
4827
+ }
4828
+ }
4829
+ });
4830
+ });
4831
+ };
4832
+ DependencyDragCreateDirective.prototype.removeScrollListener = function () {
4833
+ if (isPresent(this.scrollListenerDisposer)) {
4834
+ this.scrollListenerDisposer();
4835
+ this.scrollListenerDisposer = null;
4836
+ }
4837
+ };
4838
+ DependencyDragCreateDirective.prototype.openDragPopup = function () {
4839
+ if (isPresent(this.dragPopup)) {
4840
+ this.closeDragPopup();
4841
+ }
4842
+ this.dragPopup = this.popupService.open({
4843
+ animate: false,
4844
+ content: DragValidationTooltipComponent,
4845
+ appendTo: this.popupContainer,
4846
+ positionMode: 'absolute',
4847
+ popupClass: 'k-popup-transparent'
4848
+ });
4849
+ };
4850
+ DependencyDragCreateDirective.prototype.updateDragPopup = function (pointerOffsetPosition) {
4851
+ if (!isPresent(this.dragPopup)) {
4852
+ this.openDragPopup();
4853
+ }
4854
+ var tooltip = this.dragPopup.content.instance;
4855
+ var _a = this.getTooltipContext(), fromTaskName = _a.fromTaskName, toTaskName = _a.toTaskName, isValid = _a.isValid, showValidityStatus = _a.showValidityStatus;
4856
+ if (tooltip.fromTaskName !== fromTaskName ||
4857
+ tooltip.toTaskName !== toTaskName ||
4858
+ tooltip.isValid !== isValid ||
4859
+ tooltip.showValidityStatus !== showValidityStatus) {
4860
+ tooltip.fromTaskName = fromTaskName;
4861
+ tooltip.toTaskName = toTaskName;
4862
+ tooltip.isValid = isValid;
4863
+ tooltip.showValidityStatus = showValidityStatus;
4864
+ this.dragPopup.content.changeDetectorRef.detectChanges();
4865
+ }
4866
+ this.dragPopup.popup.instance.offset = this.normalizePopupPosition(pointerOffsetPosition);
4867
+ this.dragPopup.popup.changeDetectorRef.detectChanges();
4868
+ };
4869
+ DependencyDragCreateDirective.prototype.closeDragPopup = function () {
4870
+ if (isPresent(this.dragPopup)) {
4871
+ this.dragPopup.close();
4872
+ this.dragPopup = null;
4873
+ }
4874
+ };
4875
+ DependencyDragCreateDirective.prototype.extractTaskName = function (target) {
4876
+ if (!isTaskWrapper(target, this.container)) {
4877
+ return null;
4878
+ }
4879
+ var taskIndex = getClosestTaskIndex(target, this.container);
4880
+ var task = this.gantt.renderedTreeListItems[taskIndex];
4881
+ var taskName = this.mapper.extractFromTask(task, 'title');
4882
+ return taskName;
4883
+ };
4884
+ DependencyDragCreateDirective.prototype.getTooltipContext = function () {
4885
+ var _a;
4886
+ var fromTaskName = this.extractTaskName(this.fromTaskClue);
4887
+ var currentPointerTarget = elementFromPoint(this.currentPointerClientCoords.left, this.currentPointerClientCoords.top);
4888
+ var toTaskName = isTaskWrapper(currentPointerTarget, this.container) && !sameTaskClues(this.fromTaskClue, currentPointerTarget, this.container) ?
4889
+ this.extractTaskName(currentPointerTarget) :
4890
+ '';
4891
+ var showValidityStatus = isDependencyDragClue(currentPointerTarget) && !sameTaskClues(this.fromTaskClue, currentPointerTarget, this.container);
4892
+ var _b = this.mapper.dependencyFields, fromId = _b.fromId, toId = _b.toId, type = _b.type;
4893
+ return {
4894
+ fromTaskName: fromTaskName,
4895
+ toTaskName: toTaskName,
4896
+ showValidityStatus: showValidityStatus,
4897
+ isValid: showValidityStatus && this.gantt.validateNewDependency((_a = {},
4898
+ _a[fromId] = this.mapper.extractFromTask(this.gantt.renderedTreeListItems[getClosestTaskIndex(this.fromTaskClue, this.container)], 'id'),
4899
+ _a[toId] = this.mapper.extractFromTask(this.gantt.renderedTreeListItems[getClosestTaskIndex(currentPointerTarget, this.container)], 'id'),
4900
+ _a[type] = getDependencyTypeFromTargetTasks(this.fromTaskClue, currentPointerTarget),
4901
+ _a))
4902
+ };
4903
+ };
4904
+ /**
4905
+ * Restricts the popup position to not go below the scroll height or width of the container.
4906
+ * Flips the position of the popup when there's not enough vertical space in the visible part of the container to render the popup.
4907
+ */
4908
+ DependencyDragCreateDirective.prototype.normalizePopupPosition = function (pointerOffsetPosition) {
4909
+ var top = pointerOffsetPosition.top + DEFAULT_POPUP_VERTICAL_MARGIN;
4910
+ var containerClientBottom = this.container.clientHeight + this.container.scrollTop;
4911
+ var popupHeight = this.dragPopup.popupElement.querySelector('.k-tooltip').clientHeight;
4912
+ var enoughSpaceToRender = top < containerClientBottom - popupHeight;
4913
+ // flip the popup above the pointer if there's not enough space in the bottom of the container
4914
+ if (!enoughSpaceToRender) {
4915
+ // margin * 2 to account for the already applied margin
4916
+ top -= popupHeight + (DEFAULT_POPUP_VERTICAL_MARGIN * 2);
4917
+ }
4918
+ // center the popup horizontally according to the pointer position
4919
+ var popupWidth = this.dragPopup.popupElement.querySelector('.k-tooltip').clientWidth;
4920
+ var left = pointerOffsetPosition.left - popupWidth / 2;
4921
+ // don't allow the popup to be cut out of the viewport
4922
+ var minLeftTop = 0;
4923
+ // restrict the popup from being positioned beyond or before the available scrollable space
4924
+ return {
4925
+ left: fitToRange(left, minLeftTop, this.container.scrollWidth - popupWidth),
4926
+ top: fitToRange(top, minLeftTop, this.container.scrollHeight - popupHeight)
4927
+ };
4928
+ };
4929
+ __decorate([
4930
+ Input(),
4931
+ __metadata("design:type", Boolean)
4932
+ ], DependencyDragCreateDirective.prototype, "displayValidationTooltip", void 0);
4933
+ DependencyDragCreateDirective = __decorate([
4934
+ Directive({
4935
+ selector: '[kendoGanttDependencyDragCreate]'
4936
+ }),
4937
+ __metadata("design:paramtypes", [GanttComponent,
4938
+ NgZone,
4939
+ Renderer2,
4940
+ MappingService,
4941
+ PopupService,
4942
+ TimelineScrollService])
4943
+ ], DependencyDragCreateDirective);
4944
+ return DependencyDragCreateDirective;
4945
+ }());
4946
+
4947
+ /**
4948
+ * @hidden
4949
+ */
4950
+ var ScrollDirection;
4951
+ (function (ScrollDirection) {
4952
+ ScrollDirection[ScrollDirection["Backwards"] = -1] = "Backwards";
4953
+ ScrollDirection[ScrollDirection["Forward"] = 1] = "Forward";
4954
+ })(ScrollDirection || (ScrollDirection = {}));
4955
+ /**
4956
+ * @hidden
4957
+ */
4958
+ var ScrollAxis;
4959
+ (function (ScrollAxis) {
4960
+ ScrollAxis["Vertical"] = "scrollTop";
4961
+ ScrollAxis["Horizontal"] = "scrollLeft";
4962
+ })(ScrollAxis || (ScrollAxis = {}));
4963
+
4964
+ /**
4965
+ * @hidden
4966
+ *
4967
+ * Checks if the beginning of the scrollable element is reached (top/left).
4968
+ * Floors the top value.
4969
+ */
4970
+ var isUpperLimitReached = function (element, axis) { return Math.floor(element[axis]) <= 0; };
4971
+ /**
4972
+ * @hidden
4973
+ *
4974
+ * Checks if the end of the scrollable element is reached (bottom/right).
4975
+ * Ceils the top value.
4976
+ */
4977
+ var isBottomLimitReached = function (element, axis) {
4978
+ var elementSize = axis === ScrollAxis.Horizontal ?
4979
+ element.scrollWidth - element.clientWidth :
4980
+ element.scrollHeight - element.clientHeight;
4981
+ return Math.ceil(element[axis]) >= elementSize;
4982
+ };
4983
+ /**
4984
+ * @hidden
4985
+ *
4986
+ * Scrolls the element in the given direction by the provided step in the provided scroll axis.
4987
+ *
4988
+ * If the targeted scroll incrementation doesn't yield any result due to device pixel ratio issues (https://github.com/dimitar-pechev/RenderingIndependentScrollOffsets#readme),
4989
+ * increments the step with 1px and again attempts to change the scrollTop of the element, until the content is actually scrolled.
4990
+ *
4991
+ * Cuts the operation short after 20 unsuccessful attempts to prevent infinite loops in possible corner-case scenarios.
4992
+ */
4993
+ var scrollElement = function (element, step, direction, scrollAxis) {
4994
+ if (!(isPresent(element) && isDocumentAvailable())) {
4995
+ return;
4996
+ }
4997
+ var initialScrollPosition = element[scrollAxis];
4998
+ var currentStep = step;
4999
+ var iterations = 0;
5000
+ while (initialScrollPosition === element[scrollAxis] &&
5001
+ !(direction === ScrollDirection.Backwards && isUpperLimitReached(element, scrollAxis)) &&
5002
+ !(direction === ScrollDirection.Forward && isBottomLimitReached(element, scrollAxis)) &&
5003
+ iterations < 20 // cut the operation short in 20 attempts - in case of a wild corner case
5004
+ ) {
5005
+ element[scrollAxis] += (currentStep * direction);
5006
+ // try with a larger step if the current one doesn't update the scroll position successfully
5007
+ currentStep += 1;
5008
+ iterations += 1;
5009
+ }
5010
+ };
5011
+ /**
5012
+ * @hidden
5013
+ *
5014
+ * As client coordinates are not restricted to the range 0px - {viewportSize}px, but can have negative starting values or ending values greater than the viewport size,
5015
+ * this function extracts the visible boundaries of the provided element - fall-backing to 0 when the top/left are below 0,
5016
+ * and fall-backing to the actual visible size of the container for bottom/right.
5017
+ */
5018
+ var getViewportBoundaries = function (element) {
5019
+ var elementRect = element.getBoundingClientRect();
5020
+ // if the beginning of the scrollable container is above/before the current viewport, fall-back to 0
5021
+ var topLimit = Math.max(elementRect.top, 0);
5022
+ var leftLimit = Math.max(elementRect.left, 0);
5023
+ // if the end of the scrollable container is beneath/after the current viewport, fall-back to its client height
5024
+ // add the distance from the start of the viewport to the beginning of the container to ensure scrolling bottom begins when the actual end of the container is reached
5025
+ var bottomLimit = topLimit + Math.min(elementRect.bottom, element.clientHeight);
5026
+ var rightLimit = leftLimit + Math.min(elementRect.right, element.clientWidth);
5027
+ return {
5028
+ top: topLimit,
5029
+ bottom: bottomLimit,
5030
+ left: leftLimit,
5031
+ right: rightLimit
5032
+ };
5033
+ };
5034
+
5035
+ /**
5036
+ * @hidden
5037
+ */
5038
+ var TimelineScrollableDirective = /** @class */ (function () {
5039
+ function TimelineScrollableDirective(timelineScrollableContainer, scrollService, zone) {
5040
+ this.timelineScrollableContainer = timelineScrollableContainer;
5041
+ this.scrollService = scrollService;
5042
+ this.zone = zone;
5043
+ this.subscriptions = new Subscription();
5044
+ this.subscriptions.add(this.scrollService.horizontalScroll
5045
+ .subscribe(this.scrollHorizontallyTo.bind(this)));
5046
+ this.subscriptions.add(this.scrollService.verticalScroll
5047
+ .subscribe(this.scrollVerticallyTo.bind(this)));
5048
+ this.subscriptions.add(this.scrollService.scrollCancel
5049
+ .subscribe(this.cancelScroll.bind(this)));
5050
+ }
5051
+ TimelineScrollableDirective.prototype.ngOnDestroy = function () {
5052
+ this.subscriptions.unsubscribe();
5053
+ };
5054
+ TimelineScrollableDirective.prototype.scrollHorizontallyTo = function (left) {
5055
+ var _this = this;
5056
+ this.zone.runOutsideAngular(function () {
5057
+ var container = _this.timelineScrollableContainer.nativeElement;
5058
+ var visibleBoundaries = getViewportBoundaries(container);
5059
+ if (left < visibleBoundaries.left + _this.scrollSettings.threshold) {
5060
+ _this.horizontalScrollInterval = setInterval(function () {
5061
+ return scrollElement(container, _this.scrollSettings.step, ScrollDirection.Backwards, ScrollAxis.Horizontal);
5062
+ }, _this.scrollSettings.interval);
5063
+ }
5064
+ else if (left > visibleBoundaries.right - _this.scrollSettings.threshold) {
5065
+ _this.horizontalScrollInterval = setInterval(function () {
5066
+ return scrollElement(container, _this.scrollSettings.step, ScrollDirection.Forward, ScrollAxis.Horizontal);
5067
+ }, _this.scrollSettings.interval);
5068
+ }
5069
+ });
5070
+ };
5071
+ TimelineScrollableDirective.prototype.scrollVerticallyTo = function (top) {
5072
+ var _this = this;
5073
+ this.zone.runOutsideAngular(function () {
5074
+ var container = _this.timelineScrollableContainer.nativeElement;
5075
+ var visibleBoundaries = getViewportBoundaries(container);
5076
+ if (top < visibleBoundaries.top + _this.scrollSettings.threshold) {
5077
+ _this.verticalScrollInterval = setInterval(function () {
5078
+ return scrollElement(container, _this.scrollSettings.step, ScrollDirection.Backwards, ScrollAxis.Vertical);
5079
+ }, _this.scrollSettings.interval);
5080
+ }
5081
+ else if (top > visibleBoundaries.bottom - _this.scrollSettings.threshold) {
5082
+ _this.verticalScrollInterval = setInterval(function () {
5083
+ return scrollElement(container, _this.scrollSettings.step, ScrollDirection.Forward, ScrollAxis.Vertical);
5084
+ }, _this.scrollSettings.interval);
5085
+ }
5086
+ });
5087
+ };
5088
+ TimelineScrollableDirective.prototype.cancelScroll = function () {
5089
+ if (isPresent(this.verticalScrollInterval)) {
5090
+ clearInterval(this.verticalScrollInterval);
5091
+ this.verticalScrollInterval = null;
5092
+ }
5093
+ if (isPresent(this.horizontalScrollInterval)) {
5094
+ clearInterval(this.horizontalScrollInterval);
5095
+ this.horizontalScrollInterval = null;
5096
+ }
5097
+ };
5098
+ __decorate([
5099
+ Input(),
5100
+ __metadata("design:type", Object)
5101
+ ], TimelineScrollableDirective.prototype, "scrollSettings", void 0);
5102
+ TimelineScrollableDirective = __decorate([
5103
+ Directive({
5104
+ selector: '[kendoGanttTimelineScrollable]'
5105
+ }),
5106
+ __metadata("design:paramtypes", [ElementRef,
5107
+ TimelineScrollService,
5108
+ NgZone])
5109
+ ], TimelineScrollableDirective);
5110
+ return TimelineScrollableDirective;
5111
+ }());
5112
+
5113
+ var TimelineDayViewComponent = /** @class */ (function (_super) {
5114
+ __extends(TimelineDayViewComponent, _super);
5115
+ function TimelineDayViewComponent(optionChangesService, dependencyDomService) {
5116
+ var _this = _super.call(this, optionChangesService, dependencyDomService) || this;
5117
+ /**
5118
+ * The type for this view (`day`).
5119
+ */
5120
+ _this.type = 'day';
5121
+ return _this;
5122
+ }
5123
+ TimelineDayViewComponent_1 = TimelineDayViewComponent;
5124
+ var TimelineDayViewComponent_1;
5125
+ TimelineDayViewComponent = TimelineDayViewComponent_1 = __decorate([
5126
+ Component({
5127
+ selector: 'kendo-gantt-timeline-day-view',
5128
+ template: '',
5129
+ providers: [
5130
+ {
5131
+ provide: ViewBase,
5132
+ useExisting: forwardRef(function () { return TimelineDayViewComponent_1; })
5133
+ }
5134
+ ]
5135
+ }),
5136
+ __metadata("design:paramtypes", [OptionChangesService, DependencyDomService])
5137
+ ], TimelineDayViewComponent);
5138
+ return TimelineDayViewComponent;
5139
+ }(ViewBase));
5140
+
5141
+ var TimelineWeekViewComponent = /** @class */ (function (_super) {
5142
+ __extends(TimelineWeekViewComponent, _super);
5143
+ function TimelineWeekViewComponent(optionChangesService, dependencyDomService) {
5144
+ var _this = _super.call(this, optionChangesService, dependencyDomService) || this;
5145
+ /**
5146
+ * The type for this view (`week`).
5147
+ */
5148
+ _this.type = 'week';
5149
+ return _this;
5150
+ }
5151
+ TimelineWeekViewComponent_1 = TimelineWeekViewComponent;
5152
+ var TimelineWeekViewComponent_1;
5153
+ TimelineWeekViewComponent = TimelineWeekViewComponent_1 = __decorate([
5154
+ Component({
5155
+ selector: 'kendo-gantt-timeline-week-view',
5156
+ template: '',
5157
+ providers: [
5158
+ {
5159
+ provide: ViewBase,
5160
+ useExisting: forwardRef(function () { return TimelineWeekViewComponent_1; })
5161
+ }
5162
+ ]
5163
+ }),
5164
+ __metadata("design:paramtypes", [OptionChangesService, DependencyDomService])
5165
+ ], TimelineWeekViewComponent);
5166
+ return TimelineWeekViewComponent;
5167
+ }(ViewBase));
5168
+
5169
+ var TimelineMonthViewComponent = /** @class */ (function (_super) {
5170
+ __extends(TimelineMonthViewComponent, _super);
5171
+ function TimelineMonthViewComponent(optionChangesService, dependencyDomService) {
5172
+ var _this = _super.call(this, optionChangesService, dependencyDomService) || this;
5173
+ /**
5174
+ * The type for this view (`month`).
5175
+ */
5176
+ _this.type = 'month';
5177
+ return _this;
5178
+ }
5179
+ TimelineMonthViewComponent_1 = TimelineMonthViewComponent;
5180
+ var TimelineMonthViewComponent_1;
5181
+ TimelineMonthViewComponent = TimelineMonthViewComponent_1 = __decorate([
5182
+ Component({
5183
+ selector: 'kendo-gantt-timeline-month-view',
5184
+ template: '',
5185
+ providers: [
5186
+ {
5187
+ provide: ViewBase,
4060
5188
  useExisting: forwardRef(function () { return TimelineMonthViewComponent_1; })
4061
5189
  }
4062
5190
  ]
@@ -4070,14 +5198,44 @@ var TimelineMonthViewComponent = /** @class */ (function (_super) {
4070
5198
  * @hidden
4071
5199
  */
4072
5200
  var EditDialogComponent = /** @class */ (function () {
4073
- function EditDialogComponent(mapper, editService, localizationService) {
5201
+ function EditDialogComponent(mapper, editService, cdr, localizationService) {
4074
5202
  this.mapper = mapper;
4075
5203
  this.editService = editService;
5204
+ this.cdr = cdr;
4076
5205
  this.localizationService = localizationService;
4077
5206
  }
5207
+ EditDialogComponent.prototype.ngOnInit = function () {
5208
+ var _this = this;
5209
+ this.editService.loadTasks(this.data).subscribe(function (value) {
5210
+ _this.loadedTasks = value;
5211
+ });
5212
+ };
5213
+ Object.defineProperty(EditDialogComponent.prototype, "predecessors", {
5214
+ get: function () {
5215
+ return this.editService.predecessors;
5216
+ },
5217
+ set: function (items) {
5218
+ this.editService.predecessors = items;
5219
+ },
5220
+ enumerable: true,
5221
+ configurable: true
5222
+ });
5223
+ Object.defineProperty(EditDialogComponent.prototype, "successors", {
5224
+ get: function () {
5225
+ return this.editService.successors;
5226
+ },
5227
+ set: function (items) {
5228
+ this.editService.successors = items;
5229
+ },
5230
+ enumerable: true,
5231
+ configurable: true
5232
+ });
4078
5233
  EditDialogComponent.prototype.getText = function (token) {
4079
5234
  return this.localizationService.get(token);
4080
5235
  };
5236
+ EditDialogComponent.prototype.getDependencyType = function (typeId) {
5237
+ return DependencyType[typeId];
5238
+ };
4081
5239
  EditDialogComponent.prototype.handleEditingResult = function (editResultType) {
4082
5240
  this.editService.triggerEditEvent(editResultType);
4083
5241
  };
@@ -4086,15 +5244,16 @@ var EditDialogComponent = /** @class */ (function () {
4086
5244
  };
4087
5245
  __decorate([
4088
5246
  Input(),
4089
- __metadata("design:type", FormGroup)
4090
- ], EditDialogComponent.prototype, "formGroup", void 0);
5247
+ __metadata("design:type", Array)
5248
+ ], EditDialogComponent.prototype, "data", void 0);
4091
5249
  EditDialogComponent = __decorate([
4092
5250
  Component({
4093
5251
  selector: 'kendo-gantt-edit-dialog',
4094
- template: "\n <kendo-dialog\n [title]=\"getText('taskEditingDialogTitle')\"\n [width]=\"575\"\n [height]=\"470\"\n (close)=\"handleEditingResult('cancel')\">\n <kendo-dialog-messages\n [closeTitle]=\"getText('taskEditingDialogCloseTitle')\"></kendo-dialog-messages>\n <form class=\"k-form\" [formGroup]=\"formGroup\">\n <kendo-formfield *ngIf=\"formGroup.contains(mapper.taskFields.title)\">\n <kendo-label [for]=\"mapper.taskFields.title\" [text]=\"getText('titleFieldInputLabel')\"></kendo-label>\n <input class=\"k-textbox\" [formControlName]=\"mapper.taskFields.title\" />\n </kendo-formfield>\n <div class=\"k-hstack\">\n <kendo-formfield [style.width.%]=\"49\" *ngIf=\"formGroup.contains(mapper.taskFields.start)\">\n <kendo-label [for]=\"mapper.taskFields.start\" [text]=\"getText('startFieldInputLabel')\"></kendo-label>\n <kendo-datetimepicker [formControlName]=\"mapper.taskFields.start\"></kendo-datetimepicker>\n </kendo-formfield>\n <kendo-treelist-spacer></kendo-treelist-spacer>\n <kendo-formfield [style.width.%]=\"49\" *ngIf=\"formGroup.contains(mapper.taskFields.end)\">\n <kendo-label [for]=\"mapper.taskFields.end\" [text]=\"getText('endFieldInputLabel')\"></kendo-label>\n <kendo-datetimepicker [formControlName]=\"mapper.taskFields.end\"></kendo-datetimepicker>\n </kendo-formfield>\n </div>\n <kendo-formfield [style.width.%]=\"49\" *ngIf=\"formGroup.contains(mapper.taskFields.completionRatio)\">\n <kendo-label [for]=\"mapper.taskFields.completionRatio\" [text]=\"getText('completionRatioFieldInputLabel')\"></kendo-label>\n <kendo-numerictextbox\n [formControlName]=\"mapper.taskFields.completionRatio\"\n [min]=\"0\"\n [max]=\"1\"\n [decimals]=\"2\"\n format=\"p2\"\n [step]=\"0.01\"\n ></kendo-numerictextbox>\n </kendo-formfield>\n </form>\n <kendo-dialog-actions layout=\"normal\">\n <button kendoButton (click)=\"onTaskDelete()\">{{ getText('deleteButtonText') }}</button>\n <kendo-treelist-spacer></kendo-treelist-spacer>\n <button kendoButton [primary]=\"true\" (click)=\"handleEditingResult('save')\">{{ getText('saveButtonText') }}</button>\n <button kendoButton (click)=\"handleEditingResult('cancel')\">{{ getText('cancelButtonText') }}</button>\n </kendo-dialog-actions>\n </kendo-dialog>\n "
5252
+ template: "\n <kendo-dialog\n [title]=\"getText('taskEditingDialogTitle')\"\n [width]=\"575\"\n [height]=\"470\"\n (close)=\"handleEditingResult('cancel')\">\n <kendo-dialog-messages\n [closeTitle]=\"getText('taskEditingDialogCloseTitle')\"></kendo-dialog-messages>\n\n <kendo-tabstrip [keepTabContent]=\"true\">\n <kendo-tabstrip-tab [title]=\"getText('taskEditingGeneralTabTitle')\" [selected]=\"true\">\n <ng-template kendoTabContent>\n <kendo-gantt-task-fields></kendo-gantt-task-fields>\n </ng-template>\n </kendo-tabstrip-tab>\n <kendo-tabstrip-tab [title]=\"getText('taskEditingPredecessorsTabTitle')\">\n <ng-template kendoTabContent>\n <kendo-gantt-dependencies-table\n [tasks]=\"loadedTasks\"\n [(dependencies)]=\"predecessors\"\n dependencyType=\"predecessor\"\n >\n </kendo-gantt-dependencies-table>\n </ng-template>\n </kendo-tabstrip-tab>\n <kendo-tabstrip-tab [title]=\"getText('taskEditingSuccessorsTabTitle')\">\n <ng-template kendoTabContent>\n <kendo-gantt-dependencies-table\n [tasks]=\"loadedTasks\"\n [(dependencies)]=\"successors\"\n dependencyType=\"successor\">\n </kendo-gantt-dependencies-table>\n </ng-template>\n </kendo-tabstrip-tab>\n </kendo-tabstrip>\n\n <kendo-dialog-actions layout=\"normal\">\n <button kendoButton (click)=\"onTaskDelete()\">{{ getText('deleteButtonText') }}</button>\n <kendo-treelist-spacer></kendo-treelist-spacer>\n <button kendoButton [primary]=\"true\" (click)=\"handleEditingResult('save')\">{{ getText('saveButtonText') }}</button>\n <button kendoButton (click)=\"handleEditingResult('cancel')\">{{ getText('cancelButtonText') }}</button>\n </kendo-dialog-actions>\n </kendo-dialog>\n "
4095
5253
  }),
4096
5254
  __metadata("design:paramtypes", [MappingService,
4097
5255
  EditService,
5256
+ ChangeDetectorRef,
4098
5257
  LocalizationService])
4099
5258
  ], EditDialogComponent);
4100
5259
  return EditDialogComponent;
@@ -4108,6 +5267,38 @@ var Messages = /** @class */ (function (_super) {
4108
5267
  function Messages() {
4109
5268
  return _super !== null && _super.apply(this, arguments) || this;
4110
5269
  }
5270
+ __decorate([
5271
+ Input(),
5272
+ __metadata("design:type", String)
5273
+ ], Messages.prototype, "taskEditingGeneralTabTitle", void 0);
5274
+ __decorate([
5275
+ Input(),
5276
+ __metadata("design:type", String)
5277
+ ], Messages.prototype, "taskEditingPredecessorsTabTitle", void 0);
5278
+ __decorate([
5279
+ Input(),
5280
+ __metadata("design:type", String)
5281
+ ], Messages.prototype, "taskEditingSuccessorsTabTitle", void 0);
5282
+ __decorate([
5283
+ Input(),
5284
+ __metadata("design:type", String)
5285
+ ], Messages.prototype, "taskEditingDependenciesAddButtonText", void 0);
5286
+ __decorate([
5287
+ Input(),
5288
+ __metadata("design:type", String)
5289
+ ], Messages.prototype, "taskEditingDependenciesRemoveButtonText", void 0);
5290
+ __decorate([
5291
+ Input(),
5292
+ __metadata("design:type", String)
5293
+ ], Messages.prototype, "taskEditingDependenciesGridNameColumnTitle", void 0);
5294
+ __decorate([
5295
+ Input(),
5296
+ __metadata("design:type", String)
5297
+ ], Messages.prototype, "taskEditingDependenciesGridTypeColumnTitle", void 0);
5298
+ __decorate([
5299
+ Input(),
5300
+ __metadata("design:type", String)
5301
+ ], Messages.prototype, "deleteButtonText", void 0);
4111
5302
  __decorate([
4112
5303
  Input(),
4113
5304
  __metadata("design:type", String)
@@ -4131,7 +5322,19 @@ var Messages = /** @class */ (function (_super) {
4131
5322
  __decorate([
4132
5323
  Input(),
4133
5324
  __metadata("design:type", String)
4134
- ], Messages.prototype, "deleteButtonText", void 0);
5325
+ ], Messages.prototype, "addTaskText", void 0);
5326
+ __decorate([
5327
+ Input(),
5328
+ __metadata("design:type", String)
5329
+ ], Messages.prototype, "addChildText", void 0);
5330
+ __decorate([
5331
+ Input(),
5332
+ __metadata("design:type", String)
5333
+ ], Messages.prototype, "addAboveText", void 0);
5334
+ __decorate([
5335
+ Input(),
5336
+ __metadata("design:type", String)
5337
+ ], Messages.prototype, "addBelowText", void 0);
4135
5338
  __decorate([
4136
5339
  Input(),
4137
5340
  __metadata("design:type", String)
@@ -4402,28 +5605,244 @@ var LocalizedMessagesDirective = /** @class */ (function (_super) {
4402
5605
  return LocalizedMessagesDirective;
4403
5606
  }(Messages));
4404
5607
 
5608
+ /**
5609
+ * The UI for adding new items to the Gantt.
5610
+ * Use it within a toolbar template to provide a custom icon or list of options.
5611
+ */
5612
+ var GanttAddTaskComponent = /** @class */ (function () {
5613
+ function GanttAddTaskComponent(localizationService, editService, ngZone) {
5614
+ this.localizationService = localizationService;
5615
+ this.editService = editService;
5616
+ this.ngZone = ngZone;
5617
+ /**
5618
+ * Sets the data of the DropDownButton.
5619
+ * > The data has to be provided in an array-like list.
5620
+ */
5621
+ this.data = [{
5622
+ text: this.getText('addChildText'),
5623
+ type: 'addChild'
5624
+ }, {
5625
+ text: this.getText('addAboveText'),
5626
+ type: 'addAbove'
5627
+ }, {
5628
+ text: this.getText('addBelowText'),
5629
+ type: 'addBelow'
5630
+ }];
5631
+ /**
5632
+ * Defines the name of an existing icon in a Kendo UI theme.
5633
+ * @default 'plus'
5634
+ */
5635
+ this.icon = 'plus';
5636
+ }
5637
+ /**
5638
+ * @hidden
5639
+ */
5640
+ GanttAddTaskComponent.prototype.getText = function (message) {
5641
+ return this.localizationService.get(message);
5642
+ };
5643
+ /**
5644
+ * @hidden
5645
+ */
5646
+ GanttAddTaskComponent.prototype.handleOpen = function (e) {
5647
+ if (!this.editService.getSelectedItem()) {
5648
+ e.preventDefault();
5649
+ }
5650
+ };
5651
+ /**
5652
+ * @hidden
5653
+ */
5654
+ GanttAddTaskComponent.prototype.handleMouseClick = function () {
5655
+ var _this = this;
5656
+ if (!this.editService.getSelectedItem()) {
5657
+ this.ngZone.run(function () {
5658
+ _this.editService.addEvent.next({
5659
+ selectedItem: null,
5660
+ actionType: 'addTask'
5661
+ });
5662
+ });
5663
+ }
5664
+ };
5665
+ /**
5666
+ * @hidden
5667
+ */
5668
+ GanttAddTaskComponent.prototype.handleItemClick = function (e) {
5669
+ this.editService.addEvent.next({
5670
+ actionType: e.type,
5671
+ selectedItem: null
5672
+ });
5673
+ };
5674
+ __decorate([
5675
+ Input(),
5676
+ __metadata("design:type", Array)
5677
+ ], GanttAddTaskComponent.prototype, "data", void 0);
5678
+ __decorate([
5679
+ Input(),
5680
+ __metadata("design:type", String)
5681
+ ], GanttAddTaskComponent.prototype, "icon", void 0);
5682
+ GanttAddTaskComponent = __decorate([
5683
+ Component({
5684
+ selector: 'kendo-gantt-add-task',
5685
+ template: "\n <kendo-dropdownbutton\n [data]=\"data\"\n [icon]=\"icon\"\n [kendoEventsOutsideAngular]=\"{ click: handleMouseClick }\"\n [scope]=\"this\"\n (itemClick)=\"handleItemClick($event)\"\n (open)=\"handleOpen($event)\">\n {{ getText('addTaskText') }}\n </kendo-dropdownbutton>\n "
5686
+ }),
5687
+ __metadata("design:paramtypes", [LocalizationService,
5688
+ EditService,
5689
+ NgZone])
5690
+ ], GanttAddTaskComponent);
5691
+ return GanttAddTaskComponent;
5692
+ }());
5693
+
4405
5694
  /**
4406
5695
  * @hidden
4407
5696
  */
4408
- var GanttTreeListMessagesDirective = /** @class */ (function () {
4409
- function GanttTreeListMessagesDirective(localizationService) {
5697
+ var DependenciesTableComponent = /** @class */ (function () {
5698
+ function DependenciesTableComponent(mapper, editService, localizationService) {
5699
+ this.mapper = mapper;
5700
+ this.editService = editService;
4410
5701
  this.localizationService = localizationService;
5702
+ this.dependenciesChange = new EventEmitter();
5703
+ this.selectedKeys = [];
5704
+ this.formGroups = new FormArray([]);
5705
+ this.dependencyTypes = this.getDependencyTypes();
4411
5706
  }
4412
- GanttTreeListMessagesDirective.prototype.ngAfterViewInit = function () {
5707
+ Object.defineProperty(DependenciesTableComponent.prototype, "taskId", {
5708
+ get: function () {
5709
+ return this.editService.dataItem.id;
5710
+ },
5711
+ enumerable: true,
5712
+ configurable: true
5713
+ });
5714
+ Object.defineProperty(DependenciesTableComponent.prototype, "dependencyIdField", {
5715
+ // The target dependency id field
5716
+ // e.g. if Predecessors, we have the `fromId` which is the currently edited task,
5717
+ // while the `toId` is missing (needs to be selected by the user)
5718
+ get: function () {
5719
+ return this.dependencyType === 'predecessor' ? 'fromId' : 'toId';
5720
+ },
5721
+ enumerable: true,
5722
+ configurable: true
5723
+ });
5724
+ DependenciesTableComponent.prototype.ngOnInit = function () {
4413
5725
  var _this = this;
4414
- var treeListServiceDictionary = this.localizationService.dictionary;
4415
- Object.keys(treeListServiceDictionary)
4416
- .forEach(function (token) { return treeListServiceDictionary[token] = _this.kendoGanttTreeListMessages.get(token.replace('kendo.treelist.', '')); });
5726
+ // generate the FormGroups per each Grid row
5727
+ if (this.formGroups.controls.length === 0) {
5728
+ var fields_1 = this.mapper.dependencyFields;
5729
+ this.dependencies.forEach(function (item) {
5730
+ var _a;
5731
+ var formGroup = new FormGroup((_a = {},
5732
+ _a[fields_1.id] = new FormControl(_this.mapper.extractFromDependency(item, 'id')),
5733
+ _a[fields_1.fromId] = new FormControl(_this.mapper.extractFromDependency(item, 'fromId'), Validators.required),
5734
+ _a[fields_1.toId] = new FormControl(_this.mapper.extractFromDependency(item, 'toId'), Validators.required),
5735
+ _a[fields_1.type] = new FormControl(_this.mapper.extractFromDependency(item, 'type'), Validators.required),
5736
+ _a));
5737
+ _this.formGroups.push(formGroup);
5738
+ });
5739
+ }
5740
+ this.formGroups.valueChanges.subscribe(function (val) {
5741
+ _this.formGroups.controls.forEach(function (control) {
5742
+ if (control.dirty) {
5743
+ _this.editService.updateDependencies(control.value);
5744
+ }
5745
+ });
5746
+ _this.dependenciesChange.emit(val);
5747
+ });
5748
+ };
5749
+ DependenciesTableComponent.prototype.getFormControl = function (dataItemIndex, field) {
5750
+ // return the FormControl for the respective column editor
5751
+ return this.formGroups.controls
5752
+ .find(function (_control, index) { return index === dataItemIndex; })
5753
+ .get(this.mapper.dependencyFields[field]);
5754
+ };
5755
+ DependenciesTableComponent.prototype.getText = function (token) {
5756
+ return this.localizationService.get(token);
5757
+ };
5758
+ DependenciesTableComponent.prototype.getDependencyTypes = function () {
5759
+ var types = Object.keys(DependencyType)
5760
+ .filter(function (value) { return typeof DependencyType[value] === 'number'; })
5761
+ .map(function (type) {
5762
+ return {
5763
+ type: type,
5764
+ id: DependencyType[type]
5765
+ };
5766
+ });
5767
+ return types;
5768
+ };
5769
+ DependenciesTableComponent.prototype.addHandler = function () {
5770
+ var _a;
5771
+ var fields = this.mapper.dependencyFields;
5772
+ var formGroup = new FormGroup((_a = {},
5773
+ _a[fields.id] = new FormControl(),
5774
+ _a[fields.fromId] = new FormControl(this.dependencyIdField === 'toId' ? this.taskId : null, Validators.required),
5775
+ _a[fields.toId] = new FormControl(this.dependencyIdField === 'fromId' ? this.taskId : null, Validators.required),
5776
+ _a[fields.type] = new FormControl(null, Validators.required),
5777
+ _a));
5778
+ this.formGroups.push(formGroup);
5779
+ };
5780
+ DependenciesTableComponent.prototype.removeHandler = function () {
5781
+ var selectedIndex = this.selectedKeys[0];
5782
+ var item = this.formGroups.at(selectedIndex).value;
5783
+ this.editService.deleteDependency(item);
5784
+ this.formGroups.removeAt(selectedIndex);
4417
5785
  };
4418
5786
  __decorate([
4419
5787
  Input(),
4420
- __metadata("design:type", LocalizationService)
4421
- ], GanttTreeListMessagesDirective.prototype, "kendoGanttTreeListMessages", void 0);
4422
- GanttTreeListMessagesDirective = __decorate([
4423
- Directive({ selector: '[kendoGanttTreeListMessages]' }),
4424
- __metadata("design:paramtypes", [LocalizationService])
4425
- ], GanttTreeListMessagesDirective);
4426
- return GanttTreeListMessagesDirective;
5788
+ __metadata("design:type", Array)
5789
+ ], DependenciesTableComponent.prototype, "tasks", void 0);
5790
+ __decorate([
5791
+ Input(),
5792
+ __metadata("design:type", Array)
5793
+ ], DependenciesTableComponent.prototype, "dependencies", void 0);
5794
+ __decorate([
5795
+ Input(),
5796
+ __metadata("design:type", String)
5797
+ ], DependenciesTableComponent.prototype, "dependencyType", void 0);
5798
+ __decorate([
5799
+ Output(),
5800
+ __metadata("design:type", EventEmitter)
5801
+ ], DependenciesTableComponent.prototype, "dependenciesChange", void 0);
5802
+ DependenciesTableComponent = __decorate([
5803
+ Component({
5804
+ selector: 'kendo-gantt-dependencies-table',
5805
+ template: "\n <kendo-grid\n [data]=\"dependencies\"\n [selectable]=\"{ mode: 'single' }\"\n [(selectedKeys)]=\"selectedKeys\"\n kendoGridSelectBy\n [height]=\"295\"\n >\n <ng-template kendoGridToolbarTemplate>\n <button kendoButton (click)=\"addHandler()\">\n {{ getText('taskEditingDependenciesAddButtonText') }}\n </button>\n <button kendoButton (click)=\"removeHandler()\" [disabled]=\"selectedKeys.length === 0\">\n {{ getText('taskEditingDependenciesRemoveButtonText') }}\n </button>\n </ng-template>\n <kendo-grid-column [title]=\"getText('taskEditingDependenciesGridNameColumnTitle')\" [field]=\"dependencyIdField\">\n <ng-template kendoGridCellTemplate let-dataItem=\"dataItem\" let-column=\"column\" let-rowIndex=\"rowIndex\">\n <kendo-dropdownlist\n [data]=\"tasks\"\n textField=\"title\"\n valueField=\"id\"\n [valuePrimitive]=\"true\"\n [formControl]=\"getFormControl(rowIndex, column.field)\"\n >\n </kendo-dropdownlist>\n </ng-template>\n </kendo-grid-column>\n <kendo-grid-column [title]=\"getText('taskEditingDependenciesGridTypeColumnTitle')\" field=\"type\">\n <ng-template kendoGridCellTemplate let-dataItem=\"dataItem\" let-column=\"column\" let-rowIndex=\"rowIndex\">\n <kendo-dropdownlist\n [data]=\"dependencyTypes\"\n textField=\"type\"\n valueField=\"id\"\n [valuePrimitive]=\"true\"\n [formControl]=\"getFormControl(rowIndex, column.field)\"\n >\n </kendo-dropdownlist>\n </ng-template>\n </kendo-grid-column>\n </kendo-grid>\n "
5806
+ }),
5807
+ __metadata("design:paramtypes", [MappingService,
5808
+ EditService,
5809
+ GanttLocalizationService])
5810
+ ], DependenciesTableComponent);
5811
+ return DependenciesTableComponent;
5812
+ }());
5813
+
5814
+ /**
5815
+ * @hidden
5816
+ */
5817
+ var TaskFieldsComponent = /** @class */ (function () {
5818
+ function TaskFieldsComponent(mapper, editService, localizationService) {
5819
+ this.mapper = mapper;
5820
+ this.editService = editService;
5821
+ this.localizationService = localizationService;
5822
+ }
5823
+ Object.defineProperty(TaskFieldsComponent.prototype, "formGroup", {
5824
+ /**
5825
+ * @hidden
5826
+ */
5827
+ get: function () {
5828
+ return this.editService.taskFormGroup;
5829
+ },
5830
+ enumerable: true,
5831
+ configurable: true
5832
+ });
5833
+ TaskFieldsComponent.prototype.getText = function (token) {
5834
+ return this.localizationService.get(token);
5835
+ };
5836
+ TaskFieldsComponent = __decorate([
5837
+ Component({
5838
+ selector: 'kendo-gantt-task-fields',
5839
+ template: "\n <form class=\"k-form\" [formGroup]=\"formGroup\">\n <kendo-formfield *ngIf=\"formGroup.contains(mapper.taskFields.title)\">\n <kendo-label [for]=\"mapper.taskFields.title\" [text]=\"getText('titleFieldInputLabel')\"></kendo-label>\n <input class=\"k-textbox\" [formControlName]=\"mapper.taskFields.title\" />\n </kendo-formfield>\n <div class=\"k-hstack\">\n <kendo-formfield [style.width.%]=\"49\" *ngIf=\"formGroup.contains(mapper.taskFields.start)\">\n <kendo-label [for]=\"mapper.taskFields.start\" [text]=\"getText('startFieldInputLabel')\"></kendo-label>\n <kendo-datetimepicker [formControlName]=\"mapper.taskFields.start\"></kendo-datetimepicker>\n </kendo-formfield>\n <kendo-treelist-spacer></kendo-treelist-spacer>\n <kendo-formfield [style.width.%]=\"49\" *ngIf=\"formGroup.contains(mapper.taskFields.end)\">\n <kendo-label [for]=\"mapper.taskFields.end\" [text]=\"getText('endFieldInputLabel')\"></kendo-label>\n <kendo-datetimepicker [formControlName]=\"mapper.taskFields.end\"></kendo-datetimepicker>\n </kendo-formfield>\n </div>\n <kendo-formfield [style.width.%]=\"49\" *ngIf=\"formGroup.contains(mapper.taskFields.completionRatio)\">\n <kendo-label [for]=\"mapper.taskFields.completionRatio\" [text]=\"getText('completionRatioFieldInputLabel')\"></kendo-label>\n <kendo-numerictextbox\n [formControlName]=\"mapper.taskFields.completionRatio\"\n [min]=\"0\"\n [max]=\"1\"\n [decimals]=\"2\"\n format=\"p2\"\n [step]=\"0.01\"\n ></kendo-numerictextbox>\n </kendo-formfield>\n </form>\n "
5840
+ }),
5841
+ __metadata("design:paramtypes", [MappingService,
5842
+ EditService,
5843
+ GanttLocalizationService])
5844
+ ], TaskFieldsComponent);
5845
+ return TaskFieldsComponent;
4427
5846
  }());
4428
5847
 
4429
5848
  var IMPORTED_MODULES = [
@@ -4437,7 +5856,12 @@ var IMPORTED_MODULES = [
4437
5856
  TreeListModule,
4438
5857
  ButtonsModule,
4439
5858
  DialogModule,
4440
- EventsModule
5859
+ EventsModule,
5860
+ PopupModule,
5861
+ DraggableModule,
5862
+ TabStripModule,
5863
+ GridModule,
5864
+ DropDownsModule
4441
5865
  ];
4442
5866
  var DECLARATIONS = [
4443
5867
  GanttComponent,
@@ -4467,6 +5891,7 @@ var DECLARATIONS = [
4467
5891
  FooterTemplateDirective,
4468
5892
  GanttExpandableDirective,
4469
5893
  GanttDependencyDirective,
5894
+ DependencyDragCreateDirective,
4470
5895
  TimelineDayViewComponent,
4471
5896
  TimelineWeekViewComponent,
4472
5897
  TimelineMonthViewComponent,
@@ -4474,8 +5899,13 @@ var DECLARATIONS = [
4474
5899
  EditDialogComponent,
4475
5900
  CustomMessagesComponent,
4476
5901
  LocalizedMessagesDirective,
4477
- GanttTreeListMessagesDirective
5902
+ GanttAddTaskComponent,
5903
+ DragValidationTooltipComponent,
5904
+ TimelineScrollableDirective,
5905
+ DependenciesTableComponent,
5906
+ TaskFieldsComponent
4478
5907
  ];
5908
+ var ɵ0$3 = touchEnabled;
4479
5909
  /**
4480
5910
  * Represents the [NgModule]({{ site.data.urls.angular['ngmoduleapi'] }})
4481
5911
  * definition for the Gantt component.
@@ -4515,58 +5945,21 @@ var GanttModule = /** @class */ (function () {
4515
5945
  imports: IMPORTED_MODULES.slice(),
4516
5946
  declarations: DECLARATIONS.slice(),
4517
5947
  exports: DECLARATIONS.slice(),
5948
+ entryComponents: [DragValidationTooltipComponent],
4518
5949
  providers: [{
4519
5950
  provide: L10N_PREFIX,
4520
5951
  useValue: 'kendo.gantt'
5952
+ }, {
5953
+ provide: TOUCH_ENABLED,
5954
+ useValue: ɵ0$3
4521
5955
  }]
4522
5956
  })
4523
5957
  ], GanttModule);
4524
5958
  return GanttModule;
4525
5959
  }());
4526
5960
 
4527
- /**
4528
- * @hidden
4529
- */
4530
- var PreventableEvent = /** @class */ (function () {
4531
- function PreventableEvent() {
4532
- this.prevented = false;
4533
- }
4534
- /**
4535
- * Prevents the default action for a specified event.
4536
- * In this way, the source component suppresses
4537
- * the built-in behavior that follows the event.
4538
- */
4539
- PreventableEvent.prototype.preventDefault = function () {
4540
- this.prevented = true;
4541
- };
4542
- /**
4543
- * Returns `true` if the event was prevented
4544
- * by any of its subscribers.
4545
- *
4546
- * @returns `true` if the default action was prevented.
4547
- * Otherwise, returns `false`.
4548
- */
4549
- PreventableEvent.prototype.isDefaultPrevented = function () {
4550
- return this.prevented;
4551
- };
4552
- return PreventableEvent;
4553
- }());
4554
-
4555
- /**
4556
- * Called every time a user leaves an edited cell.
4557
- */
4558
- var CellCloseEvent = /** @class */ (function (_super) {
4559
- __extends(CellCloseEvent, _super);
4560
- function CellCloseEvent(options) {
4561
- var _this = _super.call(this) || this;
4562
- Object.assign(_this, options);
4563
- return _this;
4564
- }
4565
- return CellCloseEvent;
4566
- }(PreventableEvent));
4567
-
4568
5961
  /**
4569
5962
  * Generated bundle index. Do not edit.
4570
5963
  */
4571
5964
 
4572
- export { MappingService, OptionChangesService, DependencyDomService, GanttDependencyDirective, EditDialogComponent, EditService, CustomMessagesComponent, LocalizedMessagesDirective, Messages, GanttTreeListMessagesDirective, PreventableEvent, GanttHeaderTableBodyComponent, GanttMilestoneTaskComponent, GanttSummaryTaskComponent, GanttTaskBase, GanttTaskComponent, GanttTasksTableBodyComponent, ScrollSyncService, GanttTimelineComponent, TimelineBaseViewService, TimelineDayViewComponent, TimelineDayViewService, TimelineMonthViewComponent, TimelineMonthViewService, TimelineViewService, TimelineWeekViewComponent, TimelineWeekViewService, ViewBase, ToolbarComponent, ViewSelectorComponent, GanttComponent, GanttModule, GanttHierarchyBindingDirective, GanttFlatBindingDirective, GanttExpandableDirective, GanttTaskTemplateDirective, GanttTaskContentTemplateDirective, GanttSummaryTaskTemplateDirective, ToolbarTemplateDirective, SelectableDirective, CellCloseEvent, GanttColumnBase, GanttColumnComponent, GanttColumnGroupComponent, GanttSpanColumnComponent, CellTemplateDirective, HeaderTemplateDirective, FooterTemplateDirective, ColumnMenuTemplateDirective, FilterCellTemplateDirective, FilterMenuTemplateDirective, EditTemplateDirective };
5965
+ export { MappingService, OptionChangesService, TOUCH_ENABLED, DependencyDomService, GanttDependencyDirective, DragValidationTooltipComponent, GanttAddTaskComponent, DependenciesTableComponent, EditDialogComponent, EditService, TaskFieldsComponent, CustomMessagesComponent, GanttLocalizationService, LocalizedMessagesDirective, Messages, PreventableEvent, GanttHeaderTableBodyComponent, GanttMilestoneTaskComponent, GanttSummaryTaskComponent, GanttTaskBase, GanttTaskComponent, GanttTasksTableBodyComponent, ScrollSyncService, TimelineScrollableDirective, TimelineScrollService, GanttTimelineComponent, TimelineBaseViewService, TimelineDayViewComponent, TimelineDayViewService, TimelineMonthViewComponent, TimelineMonthViewService, TimelineViewService, TimelineWeekViewComponent, TimelineWeekViewService, ViewBase, ToolbarComponent, ViewSelectorComponent, GanttComponent, GanttModule, GanttHierarchyBindingDirective, GanttFlatBindingDirective, GanttExpandableDirective, DependencyDragCreateDirective, GanttTaskTemplateDirective, GanttTaskContentTemplateDirective, GanttSummaryTaskTemplateDirective, ToolbarTemplateDirective, SelectableDirective, DependencyType, CellCloseEvent, GanttColumnBase, GanttColumnComponent, GanttColumnGroupComponent, GanttSpanColumnComponent, CellTemplateDirective, HeaderTemplateDirective, FooterTemplateDirective, ColumnMenuTemplateDirective, FilterCellTemplateDirective, FilterMenuTemplateDirective, EditTemplateDirective };