@worktile/gantt 13.1.0 → 14.0.0

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 (58) hide show
  1. package/class/baseline.d.ts +26 -0
  2. package/class/index.d.ts +1 -0
  3. package/class/item.d.ts +1 -2
  4. package/components/bar/bar.component.d.ts +1 -2
  5. package/components/baseline/baseline.component.d.ts +17 -0
  6. package/components/baseline/baseline.component.scss +11 -0
  7. package/components/calendar/calendar.component.d.ts +1 -1
  8. package/components/drag-backdrop/drag-backdrop.component.d.ts +1 -1
  9. package/components/icon/icon.component.d.ts +1 -1
  10. package/components/links/links.component.d.ts +1 -1
  11. package/components/main/gantt-main.component.d.ts +1 -1
  12. package/components/range/range.component.d.ts +1 -1
  13. package/components/table/gantt-table.component.d.ts +1 -1
  14. package/esm2020/class/baseline.mjs +18 -0
  15. package/esm2020/class/index.mjs +2 -1
  16. package/esm2020/class/item.mjs +1 -1
  17. package/esm2020/components/bar/bar-drag.mjs +3 -3
  18. package/esm2020/components/bar/bar.component.mjs +4 -5
  19. package/esm2020/components/baseline/baseline.component.mjs +40 -0
  20. package/esm2020/components/calendar/calendar.component.mjs +3 -3
  21. package/esm2020/components/drag-backdrop/drag-backdrop.component.mjs +3 -3
  22. package/esm2020/components/icon/icon.component.mjs +3 -3
  23. package/esm2020/components/links/links.component.mjs +3 -3
  24. package/esm2020/components/main/gantt-main.component.mjs +12 -11
  25. package/esm2020/components/range/range.component.mjs +3 -3
  26. package/esm2020/components/table/gantt-table.component.mjs +6 -6
  27. package/esm2020/gantt-dom.service.mjs +3 -3
  28. package/esm2020/gantt-drag-container.mjs +3 -3
  29. package/esm2020/gantt-item-upper.mjs +4 -6
  30. package/esm2020/gantt-print.service.mjs +3 -3
  31. package/esm2020/gantt-upper.mjs +30 -5
  32. package/esm2020/gantt.component.mjs +14 -8
  33. package/esm2020/gantt.module.mjs +13 -8
  34. package/esm2020/gantt.pipe.mjs +9 -9
  35. package/esm2020/gantt.styles.mjs +1 -1
  36. package/esm2020/public-api.mjs +2 -1
  37. package/esm2020/root.component.mjs +18 -7
  38. package/esm2020/table/gantt-column.component.mjs +3 -3
  39. package/esm2020/table/gantt-table.component.mjs +3 -3
  40. package/esm2020/utils/helpers.mjs +9 -1
  41. package/fesm2015/worktile-gantt.mjs +890 -789
  42. package/fesm2015/worktile-gantt.mjs.map +1 -1
  43. package/fesm2020/worktile-gantt.mjs +905 -806
  44. package/fesm2020/worktile-gantt.mjs.map +1 -1
  45. package/gantt-item-upper.d.ts +1 -1
  46. package/gantt-upper.d.ts +8 -2
  47. package/gantt.component.d.ts +4 -1
  48. package/gantt.module.d.ts +5 -4
  49. package/gantt.pipe.d.ts +3 -3
  50. package/{worktile-gantt.d.ts → index.d.ts} +0 -0
  51. package/package.json +6 -6
  52. package/public-api.d.ts +1 -0
  53. package/root.component.d.ts +3 -1
  54. package/styles/index.scss +1 -0
  55. package/styles/variables.scss +3 -0
  56. package/table/gantt-column.component.d.ts +1 -1
  57. package/table/gantt-table.component.d.ts +1 -1
  58. package/utils/helpers.d.ts +3 -0
@@ -1,14 +1,14 @@
1
1
  import * as i0 from '@angular/core';
2
- import { InjectionToken, EventEmitter, Directive, Inject, Input, Output, ContentChild, HostBinding, Component, Pipe, ViewChild, PLATFORM_ID, Injectable, ElementRef, Optional, SkipSelf, ViewChildren, forwardRef, ChangeDetectionStrategy, ContentChildren, NgModule } from '@angular/core';
3
- import * as i2 from '@angular/common';
2
+ import { InjectionToken, EventEmitter, Directive, Inject, Input, Output, ContentChild, HostBinding, Component, Pipe, ViewChild, Injectable, PLATFORM_ID, ElementRef, Optional, SkipSelf, ViewChildren, forwardRef, ChangeDetectionStrategy, ContentChildren, NgModule } from '@angular/core';
3
+ import * as i1 from '@angular/common';
4
4
  import { isPlatformServer, CommonModule } from '@angular/common';
5
- import { take, takeUntil, skip, map, pairwise, auditTime, startWith, debounceTime, switchMap, finalize } from 'rxjs/operators';
6
- import { BehaviorSubject, Subject, from, merge, fromEvent, Observable, EMPTY } from 'rxjs';
5
+ import { take, takeUntil, skip, debounceTime, map, pairwise, auditTime, startWith, switchMap, finalize } from 'rxjs/operators';
6
+ import { BehaviorSubject, Subject, from, merge, fromEvent, Observable, EMPTY, takeUntil as takeUntil$1 } from 'rxjs';
7
7
  import { fromUnixTime, getWeek, getDaysInMonth, differenceInCalendarDays, setDate, addSeconds, addMinutes, addHours, addDays, addWeeks, addMonths, addQuarters, addYears, startOfDay, startOfWeek, startOfMonth, startOfQuarter, startOfYear, endOfDay, endOfWeek, endOfMonth, endOfQuarter, endOfYear, getUnixTime, format, isWeekend, isToday, differenceInDays, differenceInCalendarQuarters, eachMonthOfInterval, eachYearOfInterval, eachWeekOfInterval, eachDayOfInterval, differenceInCalendarYears } from 'date-fns';
8
8
  export { addDays, addHours, addMinutes, addMonths, addQuarters, addSeconds, addWeeks, addYears, differenceInCalendarDays, differenceInCalendarQuarters, differenceInDays, eachDayOfInterval, eachMonthOfInterval, eachWeekOfInterval, endOfDay, endOfMonth, endOfQuarter, endOfWeek, endOfYear, format, fromUnixTime, getDaysInMonth, getUnixTime, getWeek, isToday, isWeekend, setDate, startOfDay, startOfMonth, startOfQuarter, startOfWeek, startOfYear } from 'date-fns';
9
9
  import { SelectionModel } from '@angular/cdk/collections';
10
10
  import { coerceBooleanProperty, coerceCssPixelValue } from '@angular/cdk/coercion';
11
- import * as i1 from '@angular/cdk/drag-drop';
11
+ import * as i1$1 from '@angular/cdk/drag-drop';
12
12
  import { DragDropModule } from '@angular/cdk/drag-drop';
13
13
  import { __decorate, __param } from 'tslib';
14
14
 
@@ -326,6 +326,22 @@ class GanttGroupInternal {
326
326
  }
327
327
  }
328
328
 
329
+ class GanttBaselineItemInternal {
330
+ constructor(item) {
331
+ this.refs$ = new BehaviorSubject(null);
332
+ this.origin = item;
333
+ this.id = this.origin.id;
334
+ this.start = item.start ? new GanttDate(item.start) : null;
335
+ this.end = item.end ? new GanttDate(item.end) : null;
336
+ }
337
+ get refs() {
338
+ return this.refs$.getValue();
339
+ }
340
+ updateRefs(refs) {
341
+ this.refs$.next(refs);
342
+ }
343
+ }
344
+
329
345
  const defaultConfig = {
330
346
  dateFormat: {
331
347
  week: '第w周',
@@ -784,6 +800,14 @@ function getFlatItems(items) {
784
800
  });
785
801
  return result;
786
802
  }
803
+ function keyBy(array, key) {
804
+ const result = {};
805
+ array.forEach((item) => {
806
+ const keyValue = item[key];
807
+ result[keyValue] = item;
808
+ });
809
+ return result;
810
+ }
787
811
 
788
812
  class GanttUpper {
789
813
  constructor(elementRef, cdr, ngZone, config) {
@@ -795,6 +819,8 @@ class GanttUpper {
795
819
  this.originItems = [];
796
820
  // eslint-disable-next-line @angular-eslint/no-input-rename
797
821
  this.originGroups = [];
822
+ // eslint-disable-next-line @angular-eslint/no-input-rename
823
+ this.originBaselineItems = [];
798
824
  this.viewType = GanttViewType.month;
799
825
  this.showTodayLine = true;
800
826
  this.viewOptions = {};
@@ -806,6 +832,8 @@ class GanttUpper {
806
832
  this.linkDragEnded = new EventEmitter();
807
833
  this.items = [];
808
834
  this.groups = [];
835
+ this.baselineItems = [];
836
+ this.baselineItemsMap = {};
809
837
  this.viewChange = new EventEmitter();
810
838
  this.expandChange = new EventEmitter();
811
839
  this.firstChange = true;
@@ -878,6 +906,15 @@ class GanttUpper {
878
906
  });
879
907
  }
880
908
  }
909
+ setupBaselineItems() {
910
+ this.originBaselineItems = uniqBy(this.originBaselineItems, 'id');
911
+ this.baselineItems = [];
912
+ this.originBaselineItems.forEach((origin) => {
913
+ const item = new GanttBaselineItemInternal(origin);
914
+ this.baselineItems.push(item);
915
+ });
916
+ this.baselineItemsMap = keyBy(this.baselineItems, 'id');
917
+ }
881
918
  setupExpandedState() {
882
919
  this.originItems = uniqBy(this.originItems, 'id');
883
920
  let items = [];
@@ -948,6 +985,8 @@ class GanttUpper {
948
985
  this.setupGroups();
949
986
  this.setupItems();
950
987
  this.computeRefs();
988
+ this.setupBaselineItems();
989
+ this.computeItemsRefs(...this.baselineItems);
951
990
  this.initSelectionModel();
952
991
  this.firstChange = false;
953
992
  // Note: the zone may be nooped through `BootstrapOptions` when bootstrapping the root module. This means
@@ -982,6 +1021,8 @@ class GanttUpper {
982
1021
  this.setupGroups();
983
1022
  this.setupItems();
984
1023
  this.computeRefs();
1024
+ this.setupBaselineItems();
1025
+ this.computeItemsRefs(...this.baselineItems);
985
1026
  this.viewChange.emit(this.view);
986
1027
  }
987
1028
  if (changes.originItems || changes.originGroups) {
@@ -990,6 +1031,10 @@ class GanttUpper {
990
1031
  this.setupItems();
991
1032
  this.computeRefs();
992
1033
  }
1034
+ if (changes.originBaselineItems) {
1035
+ this.setupBaselineItems();
1036
+ this.computeItemsRefs(...this.baselineItems);
1037
+ }
993
1038
  }
994
1039
  }
995
1040
  ngOnDestroy() {
@@ -1046,9 +1091,9 @@ class GanttUpper {
1046
1091
  return this.selectionModel.isSelected(id);
1047
1092
  }
1048
1093
  }
1049
- GanttUpper.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: GanttUpper, deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }, { token: i0.NgZone }, { token: GANTT_GLOBAL_CONFIG }], target: i0.ɵɵFactoryTarget.Directive });
1050
- GanttUpper.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.8", type: GanttUpper, inputs: { originItems: ["items", "originItems"], originGroups: ["groups", "originGroups"], viewType: "viewType", start: "start", end: "end", showTodayLine: "showTodayLine", draggable: "draggable", styles: "styles", viewOptions: "viewOptions", linkOptions: "linkOptions", disabledLoadOnScroll: "disabledLoadOnScroll", selectable: "selectable", multiple: "multiple" }, outputs: { loadOnScroll: "loadOnScroll", dragStarted: "dragStarted", dragMoved: "dragMoved", dragEnded: "dragEnded", barClick: "barClick" }, host: { properties: { "class.gantt": "this.ganttClass" } }, queries: [{ propertyName: "barTemplate", first: true, predicate: ["bar"], descendants: true, static: true }, { propertyName: "rangeTemplate", first: true, predicate: ["range"], descendants: true, static: true }, { propertyName: "itemTemplate", first: true, predicate: ["item"], descendants: true, static: true }, { propertyName: "groupTemplate", first: true, predicate: ["group"], descendants: true, static: true }, { propertyName: "groupHeaderTemplate", first: true, predicate: ["groupHeader"], descendants: true, static: true }], usesOnChanges: true, ngImport: i0 });
1051
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: GanttUpper, decorators: [{
1094
+ GanttUpper.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: GanttUpper, deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }, { token: i0.NgZone }, { token: GANTT_GLOBAL_CONFIG }], target: i0.ɵɵFactoryTarget.Directive });
1095
+ GanttUpper.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.1.3", type: GanttUpper, inputs: { originItems: ["items", "originItems"], originGroups: ["groups", "originGroups"], originBaselineItems: ["baselineItems", "originBaselineItems"], viewType: "viewType", start: "start", end: "end", showTodayLine: "showTodayLine", draggable: "draggable", styles: "styles", viewOptions: "viewOptions", linkOptions: "linkOptions", disabledLoadOnScroll: "disabledLoadOnScroll", selectable: "selectable", multiple: "multiple" }, outputs: { loadOnScroll: "loadOnScroll", dragStarted: "dragStarted", dragMoved: "dragMoved", dragEnded: "dragEnded", barClick: "barClick" }, host: { properties: { "class.gantt": "this.ganttClass" } }, queries: [{ propertyName: "barTemplate", first: true, predicate: ["bar"], descendants: true, static: true }, { propertyName: "rangeTemplate", first: true, predicate: ["range"], descendants: true, static: true }, { propertyName: "itemTemplate", first: true, predicate: ["item"], descendants: true, static: true }, { propertyName: "groupTemplate", first: true, predicate: ["group"], descendants: true, static: true }, { propertyName: "groupHeaderTemplate", first: true, predicate: ["groupHeader"], descendants: true, static: true }], usesOnChanges: true, ngImport: i0 });
1096
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: GanttUpper, decorators: [{
1052
1097
  type: Directive
1053
1098
  }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }, { type: i0.NgZone }, { type: undefined, decorators: [{
1054
1099
  type: Inject,
@@ -1059,6 +1104,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImpor
1059
1104
  }], originGroups: [{
1060
1105
  type: Input,
1061
1106
  args: ['groups']
1107
+ }], originBaselineItems: [{
1108
+ type: Input,
1109
+ args: ['baselineItems']
1062
1110
  }], viewType: [{
1063
1111
  type: Input
1064
1112
  }], start: [{
@@ -1120,9 +1168,9 @@ class NgxGanttTableColumnComponent {
1120
1168
  this.columnWidth = coerceCssPixelValue(width);
1121
1169
  }
1122
1170
  }
1123
- NgxGanttTableColumnComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: NgxGanttTableColumnComponent, deps: [{ token: GANTT_UPPER_TOKEN }], target: i0.ɵɵFactoryTarget.Component });
1124
- NgxGanttTableColumnComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.8", type: NgxGanttTableColumnComponent, selector: "ngx-gantt-column", inputs: { width: "width", name: "name" }, queries: [{ propertyName: "templateRef", first: true, predicate: ["cell"], descendants: true, static: true }, { propertyName: "headerTemplateRef", first: true, predicate: ["header"], descendants: true, static: true }], ngImport: i0, template: '', isInline: true });
1125
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: NgxGanttTableColumnComponent, decorators: [{
1171
+ NgxGanttTableColumnComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: NgxGanttTableColumnComponent, deps: [{ token: GANTT_UPPER_TOKEN }], target: i0.ɵɵFactoryTarget.Component });
1172
+ NgxGanttTableColumnComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.3", type: NgxGanttTableColumnComponent, selector: "ngx-gantt-column", inputs: { width: "width", name: "name" }, queries: [{ propertyName: "templateRef", first: true, predicate: ["cell"], descendants: true, static: true }, { propertyName: "headerTemplateRef", first: true, predicate: ["header"], descendants: true, static: true }], ngImport: i0, template: '', isInline: true });
1173
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: NgxGanttTableColumnComponent, decorators: [{
1126
1174
  type: Component,
1127
1175
  args: [{
1128
1176
  selector: 'ngx-gantt-column',
@@ -1148,9 +1196,9 @@ class NgxGanttTableComponent {
1148
1196
  this.columnChanges = new EventEmitter();
1149
1197
  }
1150
1198
  }
1151
- NgxGanttTableComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: NgxGanttTableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1152
- NgxGanttTableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.8", type: NgxGanttTableComponent, selector: "ngx-gantt-table", outputs: { columnChanges: "columnChanges" }, queries: [{ propertyName: "rowBeforeTemplate", first: true, predicate: ["rowBeforeSlot"], descendants: true, static: true }, { propertyName: "rowAfterTemplate", first: true, predicate: ["rowAfterSlot"], descendants: true, static: true }], ngImport: i0, template: '', isInline: true });
1153
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: NgxGanttTableComponent, decorators: [{
1199
+ NgxGanttTableComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: NgxGanttTableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1200
+ NgxGanttTableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.3", type: NgxGanttTableComponent, selector: "ngx-gantt-table", outputs: { columnChanges: "columnChanges" }, queries: [{ propertyName: "rowBeforeTemplate", first: true, predicate: ["rowBeforeSlot"], descendants: true, static: true }, { propertyName: "rowAfterTemplate", first: true, predicate: ["rowAfterSlot"], descendants: true, static: true }], ngImport: i0, template: '', isInline: true });
1201
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: NgxGanttTableComponent, decorators: [{
1154
1202
  type: Component,
1155
1203
  args: [{
1156
1204
  selector: 'ngx-gantt-table',
@@ -1288,9 +1336,9 @@ class GanttIconComponent {
1288
1336
  }
1289
1337
  }
1290
1338
  }
1291
- GanttIconComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: GanttIconComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
1292
- GanttIconComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.8", type: GanttIconComponent, selector: "gantt-icon", inputs: { iconName: "iconName" }, host: { properties: { "class.gantt-icon": "this.isIcon" } }, ngImport: i0, template: '', isInline: true });
1293
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: GanttIconComponent, decorators: [{
1339
+ GanttIconComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: GanttIconComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
1340
+ GanttIconComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.3", type: GanttIconComponent, selector: "gantt-icon", inputs: { iconName: "iconName" }, host: { properties: { "class.gantt-icon": "this.isIcon" } }, ngImport: i0, template: '', isInline: true });
1341
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: GanttIconComponent, decorators: [{
1294
1342
  type: Component,
1295
1343
  args: [{
1296
1344
  selector: 'gantt-icon',
@@ -1308,9 +1356,9 @@ class IsGanttRangeItemPipe {
1308
1356
  return value === GanttItemType.range;
1309
1357
  }
1310
1358
  }
1311
- IsGanttRangeItemPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: IsGanttRangeItemPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1312
- IsGanttRangeItemPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: IsGanttRangeItemPipe, name: "isGanttRangeItem" });
1313
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: IsGanttRangeItemPipe, decorators: [{
1359
+ IsGanttRangeItemPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: IsGanttRangeItemPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1360
+ IsGanttRangeItemPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.1.3", ngImport: i0, type: IsGanttRangeItemPipe, name: "isGanttRangeItem" });
1361
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: IsGanttRangeItemPipe, decorators: [{
1314
1362
  type: Pipe,
1315
1363
  args: [{
1316
1364
  name: 'isGanttRangeItem'
@@ -1321,9 +1369,9 @@ class IsGanttBarItemPipe {
1321
1369
  return value === GanttItemType.bar;
1322
1370
  }
1323
1371
  }
1324
- IsGanttBarItemPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: IsGanttBarItemPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1325
- IsGanttBarItemPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: IsGanttBarItemPipe, name: "isGanttBarItem" });
1326
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: IsGanttBarItemPipe, decorators: [{
1372
+ IsGanttBarItemPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: IsGanttBarItemPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1373
+ IsGanttBarItemPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.1.3", ngImport: i0, type: IsGanttBarItemPipe, name: "isGanttBarItem" });
1374
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: IsGanttBarItemPipe, decorators: [{
1327
1375
  type: Pipe,
1328
1376
  args: [{
1329
1377
  name: 'isGanttBarItem'
@@ -1334,9 +1382,9 @@ class IsGanttCustomItemPipe {
1334
1382
  return value === GanttItemType.custom;
1335
1383
  }
1336
1384
  }
1337
- IsGanttCustomItemPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: IsGanttCustomItemPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1338
- IsGanttCustomItemPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: IsGanttCustomItemPipe, name: "isGanttCustomItem" });
1339
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: IsGanttCustomItemPipe, decorators: [{
1385
+ IsGanttCustomItemPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: IsGanttCustomItemPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1386
+ IsGanttCustomItemPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.1.3", ngImport: i0, type: IsGanttCustomItemPipe, name: "isGanttCustomItem" });
1387
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: IsGanttCustomItemPipe, decorators: [{
1340
1388
  type: Pipe,
1341
1389
  args: [{
1342
1390
  name: 'isGanttCustomItem'
@@ -1455,9 +1503,9 @@ class GanttTableComponent {
1455
1503
  return item.id || index;
1456
1504
  }
1457
1505
  }
1458
- GanttTableComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: GanttTableComponent, deps: [{ token: GANTT_ABSTRACT_TOKEN }, { token: GANTT_UPPER_TOKEN }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
1459
- GanttTableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.8", type: GanttTableComponent, selector: "gantt-table", inputs: { groups: "groups", items: "items", columns: "columns", groupTemplate: "groupTemplate", emptyTemplate: "emptyTemplate", rowBeforeTemplate: "rowBeforeTemplate", rowAfterTemplate: "rowAfterTemplate" }, outputs: { itemClick: "itemClick" }, host: { properties: { "class.gantt-table": "this.ganttTableClass", "class.gantt-table-empty": "this.ganttTableEmptyClass" } }, viewQueries: [{ propertyName: "draglineElementRef", first: true, predicate: ["dragLine"], descendants: true, static: true }], usesOnChanges: true, ngImport: i0, template: "<div class=\"gantt-table-header gantt-table-row\">\n <div class=\"gantt-table-column\" *ngFor=\"let column of columnList; let i = index\" [style.width]=\"column.columnWidth\">\n <ng-container *ngIf=\"column.headerTemplateRef; else default\" [ngTemplateOutlet]=\"column.headerTemplateRef\"></ng-container>\n <ng-template #default>\n {{ column.name }}\n </ng-template>\n <div\n class=\"gantt-table-drag-trigger\"\n cdkDrag\n cdkDragLockAxis=\"x\"\n cdkDragBoundary=\".gantt\"\n (cdkDragMoved)=\"dragMoved($event, column)\"\n (cdkDragStarted)=\"dragStarted($event)\"\n (cdkDragEnded)=\"columnDragEnded($event, column)\"\n ></div>\n </div>\n</div>\n<div class=\"gantt-table-body\">\n <ng-container *ngIf=\"!groups.length && !items.length\">\n <ng-container *ngIf=\"!emptyTemplate\">\n <gantt-icon class=\"empty-icon\" iconName=\"empty\"></gantt-icon>\n <div class=\"empty-text\">\u6CA1\u6709\u6570\u636E</div>\n </ng-container>\n <ng-template [ngTemplateOutlet]=\"emptyTemplate\"></ng-template>\n </ng-container>\n\n <ng-container *ngIf=\"groups && groups.length > 0; else itemsTemplate\">\n <ng-container *ngFor=\"let group of groups; trackBy: trackBy\">\n <div class=\"gantt-table-group\" [ngClass]=\"group.class\">\n <div class=\"gantt-table-group-title\" [class.expanded]=\"group.expanded\" (click)=\"expandGroup(group)\">\n <gantt-icon class=\"expand-icon\" [iconName]=\"group.expanded ? 'angle-down' : 'angle-right'\"></gantt-icon>\n <ng-container *ngIf=\"groupTemplate; else default\">\n <ng-template\n [ngTemplateOutlet]=\"groupTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: group.origin, group: group.origin }\"\n ></ng-template>\n </ng-container>\n <ng-template #default>\n <span class=\"group-title\">{{ group.title }}</span>\n </ng-template>\n </div>\n </div>\n\n <ng-container *ngIf=\"group.expanded\">\n <ng-template\n [ngTemplateOutlet]=\"ganttItems\"\n [ngTemplateOutletContext]=\"{ group: group, items: group.items, level: 0 }\"\n ></ng-template>\n </ng-container>\n </ng-container>\n </ng-container>\n</div>\n\n<div\n class=\"gantt-table-drag-trigger\"\n cdkDrag\n cdkDragLockAxis=\"x\"\n cdkDragBoundary=\".gantt\"\n (cdkDragMoved)=\"dragMoved($event)\"\n (cdkDragStarted)=\"dragStarted($event)\"\n (cdkDragEnded)=\"tableDragEnded($event)\"\n></div>\n\n<div #dragLine class=\"gantt-table-drag-auxiliary-line\"></div>\n\n<ng-template #itemsTemplate>\n <ng-template [ngTemplateOutlet]=\"ganttItems\" [ngTemplateOutletContext]=\"{ items: items, level: 0 }\"></ng-template>\n</ng-template>\n\n<ng-template #ganttItems let-group=\"group\" let-items=\"items\" let-level=\"level\">\n <ng-container *ngFor=\"let item of items; trackBy: trackBy\">\n <div\n (click)=\"itemClick.emit({ event: $event, selectedValue: this.item.origin })\"\n class=\"gantt-table-item gantt-table-row\"\n [class.gantt-table-item-first-level-group]=\"level === 0 && (item.type | isGanttRangeItem)\"\n [class.gantt-table-item-with-group]=\"group\"\n [class.gantt-table-item-active]=\"ganttUpper.isSelected(item.id)\"\n [style.height.px]=\"gantt.styles.lineHeight\"\n [style.lineHeight.px]=\"gantt.styles.lineHeight\"\n >\n <ng-template\n [ngTemplateOutlet]=\"rowBeforeTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: item.origin, item: item.origin }\"\n ></ng-template>\n <div class=\"gantt-table-column\" *ngFor=\"let column of columnList; let first = first\" [style.width]=\"column.columnWidth\">\n <div *ngIf=\"first\" class=\"gantt-expand-icon\" [style.marginLeft.px]=\"level * 20\">\n <ng-container *ngIf=\"level < gantt.maxLevel - 1 && item.expandable\">\n <gantt-icon\n *ngIf=\"!item.loading\"\n class=\"expand-icon\"\n [iconName]=\"item.expanded ? 'angle-down' : 'angle-right'\"\n (click)=\"expandChildren($event, item)\"\n ></gantt-icon>\n <gantt-icon *ngIf=\"item.loading\" [iconName]=\"'loading'\"></gantt-icon>\n </ng-container>\n </div>\n <div class=\"gantt-table-column-content\">\n <ng-template\n [ngTemplateOutlet]=\"column.templateRef\"\n [ngTemplateOutletContext]=\"{ $implicit: item.origin, item: item.origin }\"\n ></ng-template>\n </div>\n </div>\n <ng-template\n [ngTemplateOutlet]=\"rowAfterTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: item.origin, item: item.origin }\"\n ></ng-template>\n </div>\n <ng-template\n *ngIf=\"item.children && item.expanded\"\n [ngTemplateOutlet]=\"ganttItems\"\n [ngTemplateOutletContext]=\"{ items: item.children, level: level + 1, group: group }\"\n ></ng-template>\n </ng-container>\n</ng-template>\n", components: [{ type: GanttIconComponent, selector: "gantt-icon", inputs: ["iconName"] }], directives: [{ type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i1.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], pipes: { "isGanttRangeItem": IsGanttRangeItemPipe } });
1460
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: GanttTableComponent, decorators: [{
1506
+ GanttTableComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: GanttTableComponent, deps: [{ token: GANTT_ABSTRACT_TOKEN }, { token: GANTT_UPPER_TOKEN }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
1507
+ GanttTableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.3", type: GanttTableComponent, selector: "gantt-table", inputs: { groups: "groups", items: "items", columns: "columns", groupTemplate: "groupTemplate", emptyTemplate: "emptyTemplate", rowBeforeTemplate: "rowBeforeTemplate", rowAfterTemplate: "rowAfterTemplate" }, outputs: { itemClick: "itemClick" }, host: { properties: { "class.gantt-table": "this.ganttTableClass", "class.gantt-table-empty": "this.ganttTableEmptyClass" } }, viewQueries: [{ propertyName: "draglineElementRef", first: true, predicate: ["dragLine"], descendants: true, static: true }], usesOnChanges: true, ngImport: i0, template: "<div class=\"gantt-table-header gantt-table-row\">\n <div class=\"gantt-table-column\" *ngFor=\"let column of columnList; let i = index\" [style.width]=\"column.columnWidth\">\n <ng-container *ngIf=\"column.headerTemplateRef; else default\" [ngTemplateOutlet]=\"column.headerTemplateRef\"></ng-container>\n <ng-template #default>\n {{ column.name }}\n </ng-template>\n <div\n class=\"gantt-table-drag-trigger\"\n cdkDrag\n cdkDragLockAxis=\"x\"\n cdkDragBoundary=\".gantt\"\n (cdkDragMoved)=\"dragMoved($event, column)\"\n (cdkDragStarted)=\"dragStarted($event)\"\n (cdkDragEnded)=\"columnDragEnded($event, column)\"\n ></div>\n </div>\n</div>\n<div class=\"gantt-table-body\">\n <ng-container *ngIf=\"!groups.length && !items.length\">\n <ng-container *ngIf=\"!emptyTemplate\">\n <gantt-icon class=\"empty-icon\" iconName=\"empty\"></gantt-icon>\n <div class=\"empty-text\">\u6CA1\u6709\u6570\u636E</div>\n </ng-container>\n <ng-template [ngTemplateOutlet]=\"emptyTemplate\"></ng-template>\n </ng-container>\n\n <ng-container *ngIf=\"groups && groups.length > 0; else itemsTemplate\">\n <ng-container *ngFor=\"let group of groups; trackBy: trackBy\">\n <div class=\"gantt-table-group\" [ngClass]=\"group.class\">\n <div class=\"gantt-table-group-title\" [class.expanded]=\"group.expanded\" (click)=\"expandGroup(group)\">\n <gantt-icon class=\"expand-icon\" [iconName]=\"group.expanded ? 'angle-down' : 'angle-right'\"></gantt-icon>\n <ng-container *ngIf=\"groupTemplate; else default\">\n <ng-template\n [ngTemplateOutlet]=\"groupTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: group.origin, group: group.origin }\"\n ></ng-template>\n </ng-container>\n <ng-template #default>\n <span class=\"group-title\">{{ group.title }}</span>\n </ng-template>\n </div>\n </div>\n\n <ng-container *ngIf=\"group.expanded\">\n <ng-template\n [ngTemplateOutlet]=\"ganttItems\"\n [ngTemplateOutletContext]=\"{ group: group, items: group.items, level: 0 }\"\n ></ng-template>\n </ng-container>\n </ng-container>\n </ng-container>\n</div>\n\n<div\n class=\"gantt-table-drag-trigger\"\n cdkDrag\n cdkDragLockAxis=\"x\"\n cdkDragBoundary=\".gantt\"\n (cdkDragMoved)=\"dragMoved($event)\"\n (cdkDragStarted)=\"dragStarted($event)\"\n (cdkDragEnded)=\"tableDragEnded($event)\"\n></div>\n\n<div #dragLine class=\"gantt-table-drag-auxiliary-line\"></div>\n\n<ng-template #itemsTemplate>\n <ng-template [ngTemplateOutlet]=\"ganttItems\" [ngTemplateOutletContext]=\"{ items: items, level: 0 }\"></ng-template>\n</ng-template>\n\n<ng-template #ganttItems let-group=\"group\" let-items=\"items\" let-level=\"level\">\n <ng-container *ngFor=\"let item of items; trackBy: trackBy\">\n <div\n (click)=\"itemClick.emit({ event: $event, selectedValue: this.item.origin })\"\n class=\"gantt-table-item gantt-table-row\"\n [class.gantt-table-item-first-level-group]=\"level === 0 && (item.type | isGanttRangeItem)\"\n [class.gantt-table-item-with-group]=\"group\"\n [class.gantt-table-item-active]=\"ganttUpper.isSelected(item.id)\"\n [style.height.px]=\"gantt.styles.lineHeight\"\n [style.lineHeight.px]=\"gantt.styles.lineHeight\"\n >\n <ng-template\n [ngTemplateOutlet]=\"rowBeforeTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: item.origin, item: item.origin }\"\n ></ng-template>\n <div class=\"gantt-table-column\" *ngFor=\"let column of columnList; let first = first\" [style.width]=\"column.columnWidth\">\n <div *ngIf=\"first\" class=\"gantt-expand-icon\" [style.marginLeft.px]=\"level * 20\">\n <ng-container *ngIf=\"level < gantt.maxLevel - 1 && item.expandable\">\n <gantt-icon\n *ngIf=\"!item.loading\"\n class=\"expand-icon\"\n [iconName]=\"item.expanded ? 'angle-down' : 'angle-right'\"\n (click)=\"expandChildren($event, item)\"\n ></gantt-icon>\n <gantt-icon *ngIf=\"item.loading\" [iconName]=\"'loading'\"></gantt-icon>\n </ng-container>\n </div>\n <div class=\"gantt-table-column-content\">\n <ng-template\n [ngTemplateOutlet]=\"column.templateRef\"\n [ngTemplateOutletContext]=\"{ $implicit: item.origin, item: item.origin }\"\n ></ng-template>\n </div>\n </div>\n <ng-template\n [ngTemplateOutlet]=\"rowAfterTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: item.origin, item: item.origin }\"\n ></ng-template>\n </div>\n <ng-template\n *ngIf=\"item.children && item.expanded\"\n [ngTemplateOutlet]=\"ganttItems\"\n [ngTemplateOutletContext]=\"{ items: item.children, level: level + 1, group: group }\"\n ></ng-template>\n </ng-container>\n</ng-template>\n", dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i1$1.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "component", type: GanttIconComponent, selector: "gantt-icon", inputs: ["iconName"] }, { kind: "pipe", type: IsGanttRangeItemPipe, name: "isGanttRangeItem" }] });
1508
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: GanttTableComponent, decorators: [{
1461
1509
  type: Component,
1462
1510
  args: [{ selector: 'gantt-table', template: "<div class=\"gantt-table-header gantt-table-row\">\n <div class=\"gantt-table-column\" *ngFor=\"let column of columnList; let i = index\" [style.width]=\"column.columnWidth\">\n <ng-container *ngIf=\"column.headerTemplateRef; else default\" [ngTemplateOutlet]=\"column.headerTemplateRef\"></ng-container>\n <ng-template #default>\n {{ column.name }}\n </ng-template>\n <div\n class=\"gantt-table-drag-trigger\"\n cdkDrag\n cdkDragLockAxis=\"x\"\n cdkDragBoundary=\".gantt\"\n (cdkDragMoved)=\"dragMoved($event, column)\"\n (cdkDragStarted)=\"dragStarted($event)\"\n (cdkDragEnded)=\"columnDragEnded($event, column)\"\n ></div>\n </div>\n</div>\n<div class=\"gantt-table-body\">\n <ng-container *ngIf=\"!groups.length && !items.length\">\n <ng-container *ngIf=\"!emptyTemplate\">\n <gantt-icon class=\"empty-icon\" iconName=\"empty\"></gantt-icon>\n <div class=\"empty-text\">\u6CA1\u6709\u6570\u636E</div>\n </ng-container>\n <ng-template [ngTemplateOutlet]=\"emptyTemplate\"></ng-template>\n </ng-container>\n\n <ng-container *ngIf=\"groups && groups.length > 0; else itemsTemplate\">\n <ng-container *ngFor=\"let group of groups; trackBy: trackBy\">\n <div class=\"gantt-table-group\" [ngClass]=\"group.class\">\n <div class=\"gantt-table-group-title\" [class.expanded]=\"group.expanded\" (click)=\"expandGroup(group)\">\n <gantt-icon class=\"expand-icon\" [iconName]=\"group.expanded ? 'angle-down' : 'angle-right'\"></gantt-icon>\n <ng-container *ngIf=\"groupTemplate; else default\">\n <ng-template\n [ngTemplateOutlet]=\"groupTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: group.origin, group: group.origin }\"\n ></ng-template>\n </ng-container>\n <ng-template #default>\n <span class=\"group-title\">{{ group.title }}</span>\n </ng-template>\n </div>\n </div>\n\n <ng-container *ngIf=\"group.expanded\">\n <ng-template\n [ngTemplateOutlet]=\"ganttItems\"\n [ngTemplateOutletContext]=\"{ group: group, items: group.items, level: 0 }\"\n ></ng-template>\n </ng-container>\n </ng-container>\n </ng-container>\n</div>\n\n<div\n class=\"gantt-table-drag-trigger\"\n cdkDrag\n cdkDragLockAxis=\"x\"\n cdkDragBoundary=\".gantt\"\n (cdkDragMoved)=\"dragMoved($event)\"\n (cdkDragStarted)=\"dragStarted($event)\"\n (cdkDragEnded)=\"tableDragEnded($event)\"\n></div>\n\n<div #dragLine class=\"gantt-table-drag-auxiliary-line\"></div>\n\n<ng-template #itemsTemplate>\n <ng-template [ngTemplateOutlet]=\"ganttItems\" [ngTemplateOutletContext]=\"{ items: items, level: 0 }\"></ng-template>\n</ng-template>\n\n<ng-template #ganttItems let-group=\"group\" let-items=\"items\" let-level=\"level\">\n <ng-container *ngFor=\"let item of items; trackBy: trackBy\">\n <div\n (click)=\"itemClick.emit({ event: $event, selectedValue: this.item.origin })\"\n class=\"gantt-table-item gantt-table-row\"\n [class.gantt-table-item-first-level-group]=\"level === 0 && (item.type | isGanttRangeItem)\"\n [class.gantt-table-item-with-group]=\"group\"\n [class.gantt-table-item-active]=\"ganttUpper.isSelected(item.id)\"\n [style.height.px]=\"gantt.styles.lineHeight\"\n [style.lineHeight.px]=\"gantt.styles.lineHeight\"\n >\n <ng-template\n [ngTemplateOutlet]=\"rowBeforeTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: item.origin, item: item.origin }\"\n ></ng-template>\n <div class=\"gantt-table-column\" *ngFor=\"let column of columnList; let first = first\" [style.width]=\"column.columnWidth\">\n <div *ngIf=\"first\" class=\"gantt-expand-icon\" [style.marginLeft.px]=\"level * 20\">\n <ng-container *ngIf=\"level < gantt.maxLevel - 1 && item.expandable\">\n <gantt-icon\n *ngIf=\"!item.loading\"\n class=\"expand-icon\"\n [iconName]=\"item.expanded ? 'angle-down' : 'angle-right'\"\n (click)=\"expandChildren($event, item)\"\n ></gantt-icon>\n <gantt-icon *ngIf=\"item.loading\" [iconName]=\"'loading'\"></gantt-icon>\n </ng-container>\n </div>\n <div class=\"gantt-table-column-content\">\n <ng-template\n [ngTemplateOutlet]=\"column.templateRef\"\n [ngTemplateOutletContext]=\"{ $implicit: item.origin, item: item.origin }\"\n ></ng-template>\n </div>\n </div>\n <ng-template\n [ngTemplateOutlet]=\"rowAfterTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: item.origin, item: item.origin }\"\n ></ng-template>\n </div>\n <ng-template\n *ngIf=\"item.children && item.expanded\"\n [ngTemplateOutlet]=\"ganttItems\"\n [ngTemplateOutletContext]=\"{ items: item.children, level: level + 1, group: group }\"\n ></ng-template>\n </ng-container>\n</ng-template>\n" }]
1463
1511
  }], ctorParameters: function () { return [{ type: undefined, decorators: [{
@@ -1493,152 +1541,191 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImpor
1493
1541
  args: ['class.gantt-table-empty']
1494
1542
  }] } });
1495
1543
 
1496
- /** Cached result of whether the user's browser supports passive event listeners. */
1497
- let supportsPassiveEvents;
1498
- /**
1499
- * Checks whether the user's browser supports passive event listeners.
1500
- * See: https://github.com/WICG/EventListenerOptions/blob/gh-pages/explainer.md
1501
- */
1502
- function supportsPassiveEventListeners() {
1503
- if (supportsPassiveEvents == null && typeof window !== 'undefined') {
1504
- try {
1505
- window.addEventListener('test', null, Object.defineProperty({}, 'passive', {
1506
- get: () => (supportsPassiveEvents = true)
1507
- }));
1508
- }
1509
- finally {
1510
- supportsPassiveEvents = supportsPassiveEvents || false;
1544
+ class GanttLinkLine {
1545
+ constructor() { }
1546
+ generatePath(source, target, type) {
1547
+ if (source.before && source.after && target.before && target.after) {
1548
+ let path = '';
1549
+ switch (type) {
1550
+ case GanttLinkType.ss:
1551
+ path = this.generateSSPath(source, target);
1552
+ break;
1553
+ case GanttLinkType.ff:
1554
+ path = this.generateFFPath(source, target);
1555
+ break;
1556
+ case GanttLinkType.sf:
1557
+ path = this.generateFSAndSFPath(source, target, type);
1558
+ break;
1559
+ default:
1560
+ path = this.generateFSAndSFPath(source, target);
1561
+ }
1562
+ return path;
1511
1563
  }
1512
1564
  }
1513
- return supportsPassiveEvents;
1514
- }
1515
- /**
1516
- * Normalizes an `AddEventListener` object to something that can be passed
1517
- * to `addEventListener` on any browser, no matter whether it supports the
1518
- * `options` parameter.
1519
- */
1520
- function normalizePassiveListenerOptions(options) {
1521
- return supportsPassiveEventListeners() ? options : !!options.capture;
1522
1565
  }
1523
- /** Options used to bind passive event listeners. */
1524
- const passiveListenerOptions = normalizePassiveListenerOptions({ passive: true });
1525
1566
 
1526
- const scrollThreshold = 50;
1527
- var ScrollDirection;
1528
- (function (ScrollDirection) {
1529
- ScrollDirection[ScrollDirection["NONE"] = 0] = "NONE";
1530
- ScrollDirection[ScrollDirection["LEFT"] = 1] = "LEFT";
1531
- ScrollDirection[ScrollDirection["RIGHT"] = 2] = "RIGHT";
1532
- })(ScrollDirection || (ScrollDirection = {}));
1533
- class GanttDomService {
1534
- constructor(ngZone, platformId) {
1535
- this.ngZone = ngZone;
1536
- this.platformId = platformId;
1537
- this.unsubscribe$ = new Subject();
1538
- }
1539
- monitorScrollChange() {
1540
- this.ngZone.runOutsideAngular(() => merge(fromEvent(this.mainContainer, 'scroll', passiveListenerOptions), fromEvent(this.sideContainer, 'scroll', passiveListenerOptions))
1541
- .pipe(takeUntil(this.unsubscribe$))
1542
- .subscribe((event) => {
1543
- this.syncScroll(event);
1544
- }));
1545
- // fromEvent(this.mainContainer, 'scroll')
1546
- // .pipe(startWith(), takeUntil(this.unsubscribe$))
1547
- // .subscribe((event) => {
1548
- // // if (this.mainContainer.scrollLeft > 0) {
1549
- // // this.side.classList.add('gantt-side-has-shadow');
1550
- // // } else {
1551
- // // this.side.classList.remove('gantt-side-has-shadow');
1552
- // // }
1553
- // });
1554
- }
1555
- syncScroll(event) {
1556
- const target = event.currentTarget;
1557
- this.calendarOverlay.scrollLeft = this.mainContainer.scrollLeft;
1558
- this.sideContainer.scrollTop = target.scrollTop;
1559
- this.mainContainer.scrollTop = target.scrollTop;
1567
+ let GanttLinkLineCurve = class GanttLinkLineCurve extends GanttLinkLine {
1568
+ constructor(ganttUpper) {
1569
+ super();
1570
+ this.ganttUpper = ganttUpper;
1560
1571
  }
1561
- disableBrowserWheelEvent() {
1562
- const container = this.mainContainer;
1563
- this.ngZone.runOutsideAngular(() => fromEvent(container, 'wheel')
1564
- .pipe(takeUntil(this.unsubscribe$))
1565
- .subscribe((event) => {
1566
- const delta = event.deltaX;
1567
- if (!delta) {
1568
- return;
1569
- }
1570
- if ((container.scrollLeft + container.offsetWidth === container.scrollWidth && delta > 0) ||
1571
- (container.scrollLeft === 0 && delta < 0)) {
1572
- event.preventDefault();
1573
- }
1574
- }));
1572
+ generateSSPath(source, target) {
1573
+ const x1 = source.before.x;
1574
+ const y1 = source.before.y;
1575
+ const x4 = target.before.x;
1576
+ const y4 = target.before.y;
1577
+ const isMirror = y4 > y1 ? 0 : 1;
1578
+ const radius = Math.abs(y4 - y1) / 2;
1579
+ if (x4 > x1) {
1580
+ return `M ${x1} ${y1}
1581
+ A ${radius} ${radius} 0 1 ${isMirror} ${x1} ${y4}
1582
+ L ${x4} ${y4}`;
1583
+ }
1584
+ else {
1585
+ return `M ${x1} ${y1}
1586
+ L ${x4} ${y1}
1587
+ A ${radius} ${radius} 0 1 ${isMirror} ${x4} ${y4}`;
1588
+ }
1575
1589
  }
1576
- initialize(root) {
1577
- this.root = root.nativeElement;
1578
- this.side = this.root.getElementsByClassName('gantt-side')[0];
1579
- this.container = this.root.getElementsByClassName('gantt-container')[0];
1580
- this.sideContainer = this.root.getElementsByClassName('gantt-side-container')[0];
1581
- this.mainContainer = this.root.getElementsByClassName('gantt-main-container')[0];
1582
- this.calendarOverlay = this.root.getElementsByClassName('gantt-calendar-overlay')[0];
1583
- this.monitorScrollChange();
1584
- this.disableBrowserWheelEvent();
1590
+ generateFFPath(source, target) {
1591
+ const x1 = source.after.x;
1592
+ const y1 = source.after.y;
1593
+ const x4 = target.after.x;
1594
+ const y4 = target.after.y;
1595
+ const isMirror = y4 > y1 ? 1 : 0;
1596
+ const radius = Math.abs(y4 - y1) / 2;
1597
+ if (x4 > x1) {
1598
+ return `M ${x1} ${y1}
1599
+ L ${x4} ${y1}
1600
+ A ${radius} ${radius} 0 1 ${isMirror} ${x4} ${y4}`;
1601
+ }
1602
+ else {
1603
+ return `M ${x1} ${y1}
1604
+ A ${radius} ${radius} 0 1 ${isMirror} ${x1} ${y4}
1605
+ L ${x4} ${y4}`;
1606
+ }
1585
1607
  }
1586
- /**
1587
- * @returns An observable that will emit outside the Angular zone. Note, consumers should re-enter the Angular zone
1588
- * to run the change detection if needed.
1589
- */
1590
- getViewerScroll(options) {
1591
- return new Observable((subscriber) => this.ngZone.runOutsideAngular(() => fromEvent(this.mainContainer, 'scroll', options)
1592
- .pipe(map(() => this.mainContainer.scrollLeft), pairwise(), map(([previous, current]) => {
1593
- const event = {
1594
- target: this.mainContainer,
1595
- direction: ScrollDirection.NONE
1596
- };
1597
- if (current - previous < 0) {
1598
- if (this.mainContainer.scrollLeft < scrollThreshold && this.mainContainer.scrollLeft > 0) {
1599
- event.direction = ScrollDirection.LEFT;
1600
- }
1608
+ generateFSAndSFPath(source, target, type) {
1609
+ let x1 = source.after.x;
1610
+ let y1 = source.after.y;
1611
+ let x4 = target.before.x;
1612
+ let y4 = target.before.y;
1613
+ const bezierWeight = 0.5;
1614
+ if (type === GanttLinkType.sf) {
1615
+ x1 = target.after.x;
1616
+ y1 = target.after.y;
1617
+ x4 = source.before.x;
1618
+ y4 = source.before.y;
1619
+ }
1620
+ let dx = Math.abs(x4 - x1) * bezierWeight;
1621
+ let x2 = x1 + dx;
1622
+ let x3 = x4 - dx;
1623
+ const centerX = (x1 + x4) / 2;
1624
+ const centerY = (y1 + y4) / 2;
1625
+ let controlX = this.ganttUpper.styles.lineHeight / 2;
1626
+ const controlY = this.ganttUpper.styles.lineHeight / 2;
1627
+ if (x1 >= x4) {
1628
+ if (Math.abs(y4 - y1) <= this.ganttUpper.styles.lineHeight) {
1629
+ return `M ${x1} ${y1}
1630
+ C ${x1 + controlX} ${y1} ${x1 + controlX} ${y4 > y1 ? y1 + controlX : y1 - controlX} ${x1} ${y4 > y1 ? y1 + controlY : y1 - controlY}
1631
+ L ${x4} ${y4 > y1 ? y4 - controlY : y4 + controlY}
1632
+ C ${x4 - controlY} ${y4 > y1 ? y4 - controlY : y4 + controlY} ${x4 - controlX} ${y4} ${x4} ${y4}
1633
+ `;
1601
1634
  }
1602
- if (current - previous > 0) {
1603
- if (this.mainContainer.scrollWidth - this.mainContainer.clientWidth - this.mainContainer.scrollLeft <
1604
- scrollThreshold) {
1605
- event.direction = ScrollDirection.RIGHT;
1606
- }
1635
+ else {
1636
+ controlX = this.ganttUpper.styles.lineHeight;
1637
+ return `M ${x1} ${y1}
1638
+ C ${x1 + controlX} ${y1} ${x1 + controlX} ${y4 > y1 ? y1 + controlX : y1 - controlX} ${centerX} ${centerY}
1639
+ C ${x4 - controlX} ${y4 > y1 ? y4 - controlX : y4 + controlX} ${x4 - controlX} ${y4} ${x4} ${y4}
1640
+ `;
1607
1641
  }
1608
- return event;
1609
- }))
1610
- .subscribe(subscriber)));
1611
- }
1612
- getResize() {
1613
- return isPlatformServer(this.platformId) ? EMPTY : fromEvent(window, 'resize').pipe(auditTime(150));
1614
- }
1615
- scrollMainContainer(left) {
1616
- if (isNumber(left)) {
1617
- const scrollLeft = left - this.mainContainer.clientWidth / 2;
1618
- this.mainContainer.scrollLeft = scrollLeft > scrollThreshold ? scrollLeft : 0;
1619
- this.calendarOverlay.scrollLeft = this.mainContainer.scrollLeft;
1620
1642
  }
1643
+ else if (this.ganttUpper.linkOptions?.showArrow && x4 - x1 < 200) {
1644
+ dx = Math.max(Math.abs(y4 - y1) * bezierWeight, 60);
1645
+ x2 = x1 + dx;
1646
+ x3 = x4 - dx;
1647
+ return `M ${x1} ${y1} C ${x2} ${y1} ${x3} ${y4} ${x4} ${y4}`;
1648
+ }
1649
+ return `M ${x1} ${y1} C ${x2} ${y1} ${x3} ${y4} ${x4} ${y4}`;
1621
1650
  }
1622
- ngOnDestroy() {
1623
- this.unsubscribe$.next();
1624
- this.unsubscribe$.complete();
1625
- }
1626
- }
1627
- GanttDomService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: GanttDomService, deps: [{ token: i0.NgZone }, { token: PLATFORM_ID }], target: i0.ɵɵFactoryTarget.Injectable });
1628
- GanttDomService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: GanttDomService });
1629
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: GanttDomService, decorators: [{
1630
- type: Injectable
1631
- }], ctorParameters: function () { return [{ type: i0.NgZone }, { type: undefined, decorators: [{
1632
- type: Inject,
1633
- args: [PLATFORM_ID]
1634
- }] }]; } });
1651
+ };
1652
+ GanttLinkLineCurve = __decorate([
1653
+ __param(0, Inject(GANTT_UPPER_TOKEN))
1654
+ ], GanttLinkLineCurve);
1635
1655
 
1636
- function getDependencyType(path, dependencyTypes) {
1637
- if (dependencyTypes.includes(GanttLinkType.ss) && path.from.pos === InBarPosition.start && path.to.pos === InBarPosition.start) {
1638
- return GanttLinkType.ss;
1656
+ class GanttLinkLineStraight extends GanttLinkLine {
1657
+ constructor() {
1658
+ super();
1659
+ this.pathControl = 20;
1639
1660
  }
1640
- if (dependencyTypes.includes(GanttLinkType.ff) && path.from.pos === InBarPosition.finish && path.to.pos === InBarPosition.finish) {
1641
- return GanttLinkType.ff;
1661
+ generateSSPath(source, target) {
1662
+ const x1 = source.before.x;
1663
+ const y1 = source.before.y;
1664
+ const x4 = target.before.x;
1665
+ const y4 = target.before.y;
1666
+ const control = this.pathControl;
1667
+ return `M ${x1} ${y1}
1668
+ L ${x4 > x1 ? x1 - control : x4 - control} ${y1}
1669
+ L ${x4 > x1 ? x1 - control : x4 - control} ${y4}
1670
+ L ${x4} ${y4}`;
1671
+ }
1672
+ generateFFPath(source, target) {
1673
+ const x1 = source.after.x;
1674
+ const y1 = source.after.y;
1675
+ const x4 = target.after.x;
1676
+ const y4 = target.after.y;
1677
+ const control = this.pathControl;
1678
+ return `M ${x1} ${y1}
1679
+ L ${x4 > x1 ? x4 + control : x1 + control} ${y1}
1680
+ L ${x4 > x1 ? x4 + control : x1 + control} ${y4}
1681
+ L ${x4} ${y4}`;
1682
+ }
1683
+ generateFSAndSFPath(source, target, type) {
1684
+ let x1 = source.after.x;
1685
+ let y1 = source.after.y;
1686
+ let x4 = target.before.x;
1687
+ let y4 = target.before.y;
1688
+ const control = this.pathControl;
1689
+ if (type === GanttLinkType.sf) {
1690
+ x1 = target.after.x;
1691
+ y1 = target.after.y;
1692
+ x4 = source.before.x;
1693
+ y4 = source.before.y;
1694
+ }
1695
+ if (x4 - x1 >= 40) {
1696
+ return `M ${x1} ${y1}
1697
+ L ${x1 + control} ${y1}
1698
+ L ${x1 + control} ${y4}
1699
+ L ${x4} ${y4}`;
1700
+ }
1701
+ else {
1702
+ return `M ${x1} ${y1}
1703
+ L ${x1 + control} ${y1}
1704
+ L ${x1 + control} ${y4 > y1 ? y1 + control : y1 - control}
1705
+ L ${x4 - control} ${y4 > y1 ? y1 + control : y1 - control}
1706
+ L ${x4 - control} ${y4}
1707
+ L ${x4} ${y4}`;
1708
+ }
1709
+ }
1710
+ }
1711
+
1712
+ function createLineGenerator(type, ganttUpper) {
1713
+ switch (type) {
1714
+ case GanttLinkLineType.curve:
1715
+ return new GanttLinkLineCurve(ganttUpper);
1716
+ case GanttLinkLineType.straight:
1717
+ return new GanttLinkLineStraight();
1718
+ default:
1719
+ throw new Error('gantt link path type invalid');
1720
+ }
1721
+ }
1722
+
1723
+ function getDependencyType(path, dependencyTypes) {
1724
+ if (dependencyTypes.includes(GanttLinkType.ss) && path.from.pos === InBarPosition.start && path.to.pos === InBarPosition.start) {
1725
+ return GanttLinkType.ss;
1726
+ }
1727
+ if (dependencyTypes.includes(GanttLinkType.ff) && path.from.pos === InBarPosition.finish && path.to.pos === InBarPosition.finish) {
1728
+ return GanttLinkType.ff;
1642
1729
  }
1643
1730
  if (dependencyTypes.includes(GanttLinkType.sf) && path.from.pos === InBarPosition.start && path.to.pos === InBarPosition.finish) {
1644
1731
  return GanttLinkType.sf;
@@ -1697,722 +1784,624 @@ class GanttDragContainer {
1697
1784
  this.linkDragPath = { from: null, to: null };
1698
1785
  }
1699
1786
  }
1700
- GanttDragContainer.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: GanttDragContainer, deps: [{ token: GANTT_UPPER_TOKEN }], target: i0.ɵɵFactoryTarget.Injectable });
1701
- GanttDragContainer.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: GanttDragContainer });
1702
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: GanttDragContainer, decorators: [{
1787
+ GanttDragContainer.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: GanttDragContainer, deps: [{ token: GANTT_UPPER_TOKEN }], target: i0.ɵɵFactoryTarget.Injectable });
1788
+ GanttDragContainer.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: GanttDragContainer });
1789
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: GanttDragContainer, decorators: [{
1703
1790
  type: Injectable
1704
1791
  }], ctorParameters: function () { return [{ type: GanttUpper, decorators: [{
1705
1792
  type: Inject,
1706
1793
  args: [GANTT_UPPER_TOKEN]
1707
1794
  }] }]; } });
1708
1795
 
1709
- class GanttDragBackdropComponent {
1710
- }
1711
- GanttDragBackdropComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: GanttDragBackdropComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1712
- GanttDragBackdropComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.8", type: GanttDragBackdropComponent, selector: "gantt-drag-backdrop", host: { classAttribute: "gantt-drag-backdrop" }, ngImport: i0, template: "<div class=\"gantt-drag-mask\">\n <div class=\"date-range\">\n <span class=\"start\"></span>\n <span class=\"end\"></span>\n </div>\n</div>\n" });
1713
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: GanttDragBackdropComponent, decorators: [{
1714
- type: Component,
1715
- args: [{ selector: 'gantt-drag-backdrop', host: {
1716
- class: 'gantt-drag-backdrop'
1717
- }, template: "<div class=\"gantt-drag-mask\">\n <div class=\"date-range\">\n <span class=\"start\"></span>\n <span class=\"end\"></span>\n </div>\n</div>\n" }]
1718
- }] });
1719
-
1720
- class GanttPrintService {
1721
- constructor() { }
1722
- setInlineStyles(targetElem) {
1723
- const svgElements = Array.from(targetElem.getElementsByTagName('svg'));
1724
- for (const svgElement of svgElements) {
1725
- this.recursElementChildren(svgElement);
1726
- }
1727
- }
1728
- recursElementChildren(node) {
1729
- const transformProperties = [
1730
- 'fill',
1731
- 'color',
1732
- 'font-size',
1733
- 'stroke',
1734
- 'font',
1735
- 'text-anchor',
1736
- 'stroke-dasharray',
1737
- 'shape-rendering',
1738
- 'stroke-width'
1739
- ];
1740
- if (!node.style) {
1741
- return;
1742
- }
1743
- const styles = getComputedStyle(node);
1744
- for (const transformProperty of transformProperties) {
1745
- node.style[transformProperty] = styles[transformProperty];
1746
- }
1747
- for (const child of Array.from(node.childNodes)) {
1748
- this.recursElementChildren(child);
1749
- }
1750
- }
1751
- register(root) {
1752
- this.root = root.nativeElement;
1753
- this.mainContainer = this.root.getElementsByClassName('gantt-main-container')[0];
1754
- }
1755
- async print(name = 'download', ignoreElementClass) {
1756
- const root = this.root;
1757
- const mainContainer = this.mainContainer;
1758
- // set print width
1759
- const printWidth = root.offsetWidth;
1760
- // set print height
1761
- const printHeight = root.offsetHeight - mainContainer.offsetHeight + mainContainer.scrollHeight;
1762
- const html2canvas = (await import(/* webpackChunkName: 'html2canvas' */ 'html2canvas')).default;
1763
- html2canvas(root, {
1764
- logging: false,
1765
- allowTaint: true,
1766
- useCORS: true,
1767
- width: printWidth,
1768
- height: printHeight,
1769
- ignoreElements: (element) => {
1770
- if (ignoreElementClass && element.classList.contains(ignoreElementClass)) {
1771
- return true;
1772
- }
1773
- if (element.classList.contains('gantt-calendar-today-overlay')) {
1774
- return true;
1775
- }
1776
- },
1777
- onclone: (cloneDocument) => {
1778
- const ganttClass = root.className;
1779
- const cloneGanttDom = cloneDocument.querySelector(`.${ganttClass.replace(/\s+/g, '.')}`);
1780
- const cloneGanttContainerDom = cloneDocument.querySelector('.gantt-container');
1781
- const cloneCalendarOverlay = cloneDocument.querySelector('.gantt-calendar-overlay-main');
1782
- const cloneLinksOverlay = cloneDocument.querySelector('.gantt-links-overlay-main');
1783
- // change targetDom width
1784
- cloneGanttDom.style.width = `${printWidth}px`;
1785
- cloneGanttDom.style.height = `${printHeight}px`;
1786
- cloneGanttDom.style.overflow = `unset`;
1787
- cloneGanttContainerDom.style.backgroundColor = '#fff';
1788
- cloneCalendarOverlay.setAttribute('height', `${printHeight}`);
1789
- cloneCalendarOverlay.setAttribute('style', `background: transparent`);
1790
- if (cloneLinksOverlay) {
1791
- cloneLinksOverlay.setAttribute('height', `${printHeight}`);
1792
- cloneLinksOverlay.setAttribute('style', `height: ${printHeight}px`);
1793
- }
1794
- // setInlineStyles for svg
1795
- this.setInlineStyles(cloneGanttDom);
1796
- }
1797
- }).then((canvas) => {
1798
- const link = document.createElement('a');
1799
- const dataUrl = canvas.toDataURL('image/png');
1800
- link.download = `${name}.png`;
1801
- link.href = dataUrl;
1802
- link.click();
1803
- });
1804
- }
1805
- }
1806
- GanttPrintService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: GanttPrintService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1807
- GanttPrintService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: GanttPrintService });
1808
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: GanttPrintService, decorators: [{
1809
- type: Injectable
1810
- }], ctorParameters: function () { return []; } });
1811
-
1812
- const mainHeight = 5000;
1813
- class GanttCalendarComponent {
1814
- constructor(ganttUpper, ngZone, elementRef) {
1796
+ class GanttLinksComponent {
1797
+ constructor(ganttUpper, cdr, elementRef, ganttDragContainer) {
1815
1798
  this.ganttUpper = ganttUpper;
1816
- this.ngZone = ngZone;
1799
+ this.cdr = cdr;
1817
1800
  this.elementRef = elementRef;
1818
- this.headerHeight = headerHeight;
1819
- this.mainHeight = mainHeight;
1820
- this.todayHeight = todayHeight;
1821
- this.todayWidth = todayWidth;
1822
- this.todayBorderRadius = todayBorderRadius;
1823
- this.viewTypes = GanttViewType;
1824
- this.className = true;
1801
+ this.ganttDragContainer = ganttDragContainer;
1802
+ this.groups = [];
1803
+ this.items = [];
1804
+ this.lineClick = new EventEmitter();
1805
+ this.links = [];
1806
+ this.ganttLinkTypes = GanttLinkType;
1807
+ this.showArrow = false;
1808
+ this.linkItems = [];
1809
+ this.firstChange = true;
1825
1810
  this.unsubscribe$ = new Subject();
1826
- }
1827
- get view() {
1828
- return this.ganttUpper.view;
1829
- }
1830
- setTodayPoint() {
1831
- const x = this.view.getTodayXPoint();
1832
- const today = new GanttDate().getDate();
1833
- const todayEle = this.elementRef.nativeElement.getElementsByClassName('gantt-calendar-today-overlay')[0];
1834
- const rect = this.elementRef.nativeElement.getElementsByClassName('today-rect')[0];
1835
- const line = this.elementRef.nativeElement.getElementsByClassName('today-line')[0];
1836
- if (isNumber(x)) {
1837
- if (rect) {
1838
- rect.style.left = `${x - todayWidth / 2}px`;
1839
- rect.style.top = `${headerHeight - todayHeight}px`;
1840
- rect.innerHTML = today.toString();
1841
- }
1842
- if (line) {
1843
- line.style.left = `${x}px`;
1844
- line.style.top = `${headerHeight}px`;
1845
- line.style.bottom = `${-mainHeight}px`;
1846
- }
1847
- }
1848
- else {
1849
- todayEle.style.display = 'none';
1850
- }
1811
+ this.ganttLinksOverlay = true;
1851
1812
  }
1852
1813
  ngOnInit() {
1853
- // Note: the zone may be nooped through `BootstrapOptions` when bootstrapping the root module. This means
1854
- // the `onStable` will never emit any value.
1855
- const onStable$ = this.ngZone.isStable ? from(Promise.resolve()) : this.ngZone.onStable.pipe(take(1));
1856
- // Normally this isn't in the zone, but it can cause performance regressions for apps
1857
- // using `zone-patch-rxjs` because it'll trigger a change detection when it unsubscribes.
1858
- this.ngZone.runOutsideAngular(() => {
1859
- onStable$.pipe(takeUntil(this.unsubscribe$)).subscribe(() => {
1860
- merge(this.ganttUpper.viewChange, this.ganttUpper.view.start$)
1861
- .pipe(takeUntil(this.unsubscribe$))
1862
- .subscribe(() => {
1863
- this.setTodayPoint();
1864
- });
1865
- });
1814
+ this.linkLine = createLineGenerator(this.ganttUpper.linkOptions.lineType, this.ganttUpper);
1815
+ this.showArrow = this.ganttUpper.linkOptions.showArrow;
1816
+ this.buildLinks();
1817
+ this.firstChange = false;
1818
+ this.ganttDragContainer.dragStarted.pipe(takeUntil(this.unsubscribe$)).subscribe(() => {
1819
+ this.elementRef.nativeElement.style.visibility = 'hidden';
1820
+ });
1821
+ merge(this.ganttUpper.viewChange, this.ganttUpper.expandChange, this.ganttUpper.view.start$, this.ganttUpper.dragEnded, this.ganttUpper.linkDragEnded)
1822
+ .pipe(skip(1), debounceTime(0), takeUntil(this.unsubscribe$))
1823
+ .subscribe(() => {
1824
+ this.elementRef.nativeElement.style.visibility = 'visible';
1825
+ this.buildLinks();
1826
+ this.cdr.detectChanges();
1866
1827
  });
1867
1828
  }
1868
- trackBy(index, point) {
1869
- return point.text || index;
1870
- }
1871
- ngOnDestroy() {
1872
- this.unsubscribe$.next();
1873
- this.unsubscribe$.complete();
1829
+ ngOnChanges() {
1830
+ if (!this.firstChange) {
1831
+ this.buildLinks();
1832
+ }
1874
1833
  }
1875
- }
1876
- GanttCalendarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: GanttCalendarComponent, deps: [{ token: GANTT_UPPER_TOKEN }, { token: i0.NgZone }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
1877
- GanttCalendarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.8", type: GanttCalendarComponent, selector: "gantt-calendar-overlay", host: { properties: { "class.gantt-calendar-overlay": "this.className" } }, ngImport: i0, template: "<div class=\"gantt-calendar-today-overlay\" [style.width.px]=\"view.width\">\n <span class=\"today-rect\" [hidden]=\"ganttUpper.viewType !== viewTypes.day\"> </span>\n <span class=\"today-line\" *ngIf=\"ganttUpper.showTodayLine\"> </span>\n</div>\n\n<svg class=\"gantt-calendar-overlay-main\" [attr.width]=\"view.width\" [attr.height]=\"headerHeight\">\n <g>\n <text class=\"primary-text\" *ngFor=\"let point of view.primaryDatePoints; trackBy: trackBy\" [attr.x]=\"point.x\" [attr.y]=\"point.y\">\n {{ point.text }}\n </text>\n <ng-container *ngFor=\"let point of view.secondaryDatePoints; trackBy: trackBy\">\n <text class=\"secondary-text\" [class.secondary-text-weekend]=\"point.additions?.isWeekend\" [attr.x]=\"point.x\" [attr.y]=\"point.y\">\n {{ point.text }}\n </text>\n </ng-container>\n\n <g>\n <line\n *ngFor=\"let point of view.primaryDatePoints; let i = index; trackBy: trackBy\"\n [attr.x1]=\"(i + 1) * view.primaryWidth\"\n [attr.x2]=\"(i + 1) * view.primaryWidth\"\n [attr.y1]=\"0\"\n [attr.y2]=\"mainHeight\"\n class=\"primary-line\"\n ></line>\n </g>\n\n <g>\n <line [attr.x1]=\"0\" [attr.x2]=\"view.width\" [attr.y1]=\"headerHeight\" [attr.y2]=\"headerHeight\" class=\"header-line\"></line>\n </g>\n </g>\n <g>\n <g *ngIf=\"view.showTimeline\">\n <line\n *ngFor=\"let point of view.secondaryDatePoints; let i = index; trackBy: trackBy\"\n [attr.x1]=\"(i + 1) * view.cellWidth\"\n [attr.x2]=\"(i + 1) * view.cellWidth\"\n [attr.y1]=\"headerHeight\"\n [attr.y2]=\"mainHeight\"\n class=\"secondary-line\"\n ></line>\n <line\n *ngFor=\"let point of view.primaryDatePoints; let i = index; trackBy: trackBy\"\n [attr.x1]=\"(i + 1) * view.primaryWidth\"\n [attr.x2]=\"(i + 1) * view.primaryWidth\"\n [attr.y1]=\"0\"\n [attr.y2]=\"mainHeight\"\n class=\"primary-line\"\n ></line>\n </g>\n </g>\n</svg>\n", directives: [{ type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
1878
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: GanttCalendarComponent, decorators: [{
1879
- type: Component,
1880
- args: [{ selector: 'gantt-calendar-overlay', template: "<div class=\"gantt-calendar-today-overlay\" [style.width.px]=\"view.width\">\n <span class=\"today-rect\" [hidden]=\"ganttUpper.viewType !== viewTypes.day\"> </span>\n <span class=\"today-line\" *ngIf=\"ganttUpper.showTodayLine\"> </span>\n</div>\n\n<svg class=\"gantt-calendar-overlay-main\" [attr.width]=\"view.width\" [attr.height]=\"headerHeight\">\n <g>\n <text class=\"primary-text\" *ngFor=\"let point of view.primaryDatePoints; trackBy: trackBy\" [attr.x]=\"point.x\" [attr.y]=\"point.y\">\n {{ point.text }}\n </text>\n <ng-container *ngFor=\"let point of view.secondaryDatePoints; trackBy: trackBy\">\n <text class=\"secondary-text\" [class.secondary-text-weekend]=\"point.additions?.isWeekend\" [attr.x]=\"point.x\" [attr.y]=\"point.y\">\n {{ point.text }}\n </text>\n </ng-container>\n\n <g>\n <line\n *ngFor=\"let point of view.primaryDatePoints; let i = index; trackBy: trackBy\"\n [attr.x1]=\"(i + 1) * view.primaryWidth\"\n [attr.x2]=\"(i + 1) * view.primaryWidth\"\n [attr.y1]=\"0\"\n [attr.y2]=\"mainHeight\"\n class=\"primary-line\"\n ></line>\n </g>\n\n <g>\n <line [attr.x1]=\"0\" [attr.x2]=\"view.width\" [attr.y1]=\"headerHeight\" [attr.y2]=\"headerHeight\" class=\"header-line\"></line>\n </g>\n </g>\n <g>\n <g *ngIf=\"view.showTimeline\">\n <line\n *ngFor=\"let point of view.secondaryDatePoints; let i = index; trackBy: trackBy\"\n [attr.x1]=\"(i + 1) * view.cellWidth\"\n [attr.x2]=\"(i + 1) * view.cellWidth\"\n [attr.y1]=\"headerHeight\"\n [attr.y2]=\"mainHeight\"\n class=\"secondary-line\"\n ></line>\n <line\n *ngFor=\"let point of view.primaryDatePoints; let i = index; trackBy: trackBy\"\n [attr.x1]=\"(i + 1) * view.primaryWidth\"\n [attr.x2]=\"(i + 1) * view.primaryWidth\"\n [attr.y1]=\"0\"\n [attr.y2]=\"mainHeight\"\n class=\"primary-line\"\n ></line>\n </g>\n </g>\n</svg>\n" }]
1881
- }], ctorParameters: function () { return [{ type: GanttUpper, decorators: [{
1882
- type: Inject,
1883
- args: [GANTT_UPPER_TOKEN]
1884
- }] }, { type: i0.NgZone }, { type: i0.ElementRef }]; }, propDecorators: { className: [{
1885
- type: HostBinding,
1886
- args: ['class.gantt-calendar-overlay']
1887
- }] } });
1888
-
1889
- class NgxGanttRootComponent {
1890
- constructor(elementRef, ngZone, dom, dragContainer, ganttUpper, printService) {
1891
- this.elementRef = elementRef;
1892
- this.ngZone = ngZone;
1893
- this.dom = dom;
1894
- this.dragContainer = dragContainer;
1895
- this.ganttUpper = ganttUpper;
1896
- this.printService = printService;
1897
- this.unsubscribe$ = new Subject();
1898
- this.ganttUpper.dragContainer = dragContainer;
1899
- }
1900
- get view() {
1901
- return this.ganttUpper.view;
1902
- }
1903
- ngOnInit() {
1904
- // Note: the zone may be nooped through `BootstrapOptions` when bootstrapping the root module. This means
1905
- // the `onStable` will never emit any value.
1906
- const onStable$ = this.ngZone.isStable ? from(Promise.resolve()) : this.ngZone.onStable.pipe(take(1));
1907
- // Normally this isn't in the zone, but it can cause performance regressions for apps
1908
- // using `zone-patch-rxjs` because it'll trigger a change detection when it unsubscribes.
1909
- this.ngZone.runOutsideAngular(() => {
1910
- onStable$.pipe(takeUntil(this.unsubscribe$)).subscribe(() => {
1911
- this.dom.initialize(this.elementRef);
1912
- if (this.printService) {
1913
- this.printService.register(this.elementRef);
1834
+ computeItemPosition() {
1835
+ const lineHeight = this.ganttUpper.styles.lineHeight;
1836
+ const barHeight = this.ganttUpper.styles.barHeight;
1837
+ this.linkItems = [];
1838
+ if (this.groups.length > 0) {
1839
+ let itemNum = 0;
1840
+ let groupNum = 0;
1841
+ this.groups.forEach((group) => {
1842
+ groupNum++;
1843
+ if (group.expanded) {
1844
+ const items = recursiveItems(group.items);
1845
+ items.forEach((item, itemIndex) => {
1846
+ const y = (groupNum + itemNum + itemIndex) * lineHeight + item.refs.y + barHeight / 2;
1847
+ this.linkItems.push({
1848
+ ...item,
1849
+ before: {
1850
+ x: item.refs.x,
1851
+ y
1852
+ },
1853
+ after: {
1854
+ x: item.refs.x + item.refs.width,
1855
+ y
1856
+ }
1857
+ });
1858
+ });
1859
+ itemNum += items.length;
1914
1860
  }
1915
- this.setupScrollClass();
1916
- this.setupResize();
1917
- this.setupViewScroll();
1918
- // 优化初始化时Scroll滚动体验问题,通过透明度解决,默认透明度为0,滚动结束后恢复
1919
- this.elementRef.nativeElement.style.opacity = '1';
1920
- this.ganttUpper.viewChange.pipe(startWith(null), takeUntil(this.unsubscribe$)).subscribe(() => {
1921
- this.scrollToToday();
1861
+ });
1862
+ }
1863
+ else {
1864
+ const items = recursiveItems(this.items);
1865
+ items.forEach((item, itemIndex) => {
1866
+ const y = itemIndex * lineHeight + item.refs.y + barHeight / 2;
1867
+ this.linkItems.push({
1868
+ ...item,
1869
+ before: {
1870
+ x: item.refs.x,
1871
+ y
1872
+ },
1873
+ after: {
1874
+ x: item.refs.x + item.refs.width,
1875
+ y
1876
+ }
1922
1877
  });
1923
1878
  });
1924
- });
1925
- }
1926
- ngOnDestroy() {
1927
- this.unsubscribe$.next();
1928
- }
1929
- setupViewScroll() {
1930
- if (this.ganttUpper.disabledLoadOnScroll) {
1931
- return;
1932
1879
  }
1933
- this.dom
1934
- .getViewerScroll(passiveListenerOptions)
1935
- .pipe(takeUntil(this.unsubscribe$))
1936
- .subscribe((event) => {
1937
- if (event.direction === ScrollDirection.LEFT) {
1938
- const dates = this.view.addStartDate();
1939
- if (dates) {
1940
- event.target.scrollLeft += this.view.getDateRangeWidth(dates.start, dates.end);
1941
- if (this.ganttUpper.loadOnScroll.observers) {
1942
- this.ngZone.run(() => this.ganttUpper.loadOnScroll.emit({ start: dates.start.getUnixTime(), end: dates.end.getUnixTime() }));
1880
+ }
1881
+ buildLinks() {
1882
+ this.computeItemPosition();
1883
+ this.links = [];
1884
+ this.linkItems.forEach((source) => {
1885
+ if (source.origin.start || source.origin.end) {
1886
+ source.links.forEach((link) => {
1887
+ const target = this.linkItems.find((item) => item.id === link.link);
1888
+ if (target && (target.origin.start || target.origin.end)) {
1889
+ let defaultColor = LinkColors.default;
1890
+ let activeColor = LinkColors.active;
1891
+ if (link.type === GanttLinkType.fs && source.end.getTime() > target.start.getTime()) {
1892
+ defaultColor = LinkColors.blocked;
1893
+ activeColor = LinkColors.blocked;
1894
+ }
1895
+ if (link.color) {
1896
+ if (typeof link.color === 'string') {
1897
+ defaultColor = link.color;
1898
+ activeColor = link.color;
1899
+ }
1900
+ else {
1901
+ defaultColor = link.color.default;
1902
+ activeColor = link.color.active;
1903
+ }
1904
+ }
1905
+ this.links.push({
1906
+ path: this.linkLine.generatePath(source, target, link.type),
1907
+ source: source.origin,
1908
+ target: target.origin,
1909
+ type: link.type,
1910
+ color: defaultColor,
1911
+ defaultColor,
1912
+ activeColor
1913
+ });
1943
1914
  }
1944
- }
1945
- }
1946
- if (event.direction === ScrollDirection.RIGHT) {
1947
- const dates = this.view.addEndDate();
1948
- if (dates && this.ganttUpper.loadOnScroll.observers) {
1949
- this.ngZone.run(() => this.ganttUpper.loadOnScroll.emit({ start: dates.start.getUnixTime(), end: dates.end.getUnixTime() }));
1950
- }
1915
+ });
1951
1916
  }
1952
1917
  });
1953
1918
  }
1954
- setupResize() {
1955
- this.dom
1956
- .getResize()
1957
- .pipe(takeUntil(this.unsubscribe$))
1958
- .subscribe(() => {
1959
- this.setupScrollClass();
1919
+ trackBy(index) {
1920
+ return index;
1921
+ }
1922
+ onLineClick(event, link) {
1923
+ this.lineClick.emit({
1924
+ event,
1925
+ source: link.source,
1926
+ target: link.target
1960
1927
  });
1961
1928
  }
1962
- setupScrollClass() {
1963
- const mainContainer = this.dom.mainContainer;
1964
- const height = mainContainer.offsetHeight;
1965
- const scrollHeight = mainContainer.scrollHeight;
1966
- if (scrollHeight > height) {
1967
- this.elementRef.nativeElement.className = 'gantt gantt-scroll';
1968
- }
1969
- else {
1970
- this.elementRef.nativeElement.className = 'gantt';
1929
+ mouseEnterPath(link, index) {
1930
+ link.color = link.activeColor || link.defaultColor;
1931
+ if (index < this.links.length - 1) {
1932
+ this.links.splice(index, 1);
1933
+ this.links.push(link);
1971
1934
  }
1972
1935
  }
1973
- scrollToToday() {
1974
- const x = this.view.getTodayXPoint();
1975
- this.dom.scrollMainContainer(x);
1936
+ mouseLeavePath(link) {
1937
+ link.color = link.defaultColor;
1938
+ }
1939
+ ngOnDestroy() {
1940
+ this.unsubscribe$.next();
1941
+ this.unsubscribe$.complete();
1976
1942
  }
1977
1943
  }
1978
- NgxGanttRootComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: NgxGanttRootComponent, deps: [{ token: i0.ElementRef }, { token: i0.NgZone }, { token: GanttDomService }, { token: GanttDragContainer }, { token: GANTT_UPPER_TOKEN }, { token: GanttPrintService, optional: true }], target: i0.ɵɵFactoryTarget.Component });
1979
- NgxGanttRootComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.8", type: NgxGanttRootComponent, selector: "ngx-gantt-root", inputs: { sideWidth: "sideWidth" }, host: { classAttribute: "gantt" }, providers: [GanttDomService, GanttDragContainer], queries: [{ propertyName: "sideTemplate", first: true, predicate: ["sideTemplate"], descendants: true, static: true }, { propertyName: "mainTemplate", first: true, predicate: ["mainTemplate"], descendants: true, static: true }], viewQueries: [{ propertyName: "backdrop", first: true, predicate: GanttDragBackdropComponent, descendants: true, read: ElementRef, static: true }], ngImport: i0, template: "<div class=\"gantt-side\" [style.width.px]=\"sideWidth\">\n <div class=\"gantt-side-container\">\n <ng-template [ngTemplateOutlet]=\"sideTemplate\"></ng-template>\n </div>\n</div>\n<div class=\"gantt-container\">\n <gantt-calendar-overlay></gantt-calendar-overlay>\n <gantt-drag-backdrop></gantt-drag-backdrop>\n <div class=\"gantt-main\">\n <ng-template [ngTemplateOutlet]=\"mainTemplate\"></ng-template>\n </div>\n</div>\n", components: [{ type: GanttCalendarComponent, selector: "gantt-calendar-overlay" }, { type: GanttDragBackdropComponent, selector: "gantt-drag-backdrop" }], directives: [{ type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }] });
1980
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: NgxGanttRootComponent, decorators: [{
1944
+ GanttLinksComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: GanttLinksComponent, deps: [{ token: GANTT_UPPER_TOKEN }, { token: i0.ChangeDetectorRef }, { token: i0.ElementRef }, { token: GanttDragContainer }], target: i0.ɵɵFactoryTarget.Component });
1945
+ GanttLinksComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.3", type: GanttLinksComponent, selector: "gantt-links-overlay", inputs: { groups: "groups", items: "items" }, outputs: { lineClick: "lineClick" }, host: { properties: { "class.gantt-links-overlay": "this.ganttLinksOverlay" } }, usesOnChanges: true, ngImport: i0, template: "<svg [attr.width]=\"ganttUpper.view.width\" class=\"gantt-links-overlay-main\">\n <ng-container *ngFor=\"let link of links; let i = index; trackBy: trackBy\">\n <path\n [attr.d]=\"link.path\"\n fill=\"transparent\"\n stroke-width=\"2\"\n [attr.stroke]=\"link.color\"\n pointer-events=\"none\"\n [attr.style]=\"link.type === ganttLinkTypes.sf ? 'marker-start: url(#triangle' + i + ')' : 'marker-end: url(#triangle' + i + ')'\"\n ></path>\n\n <g>\n <path\n class=\"link-line\"\n (click)=\"onLineClick($event, link)\"\n [attr.d]=\"link.path\"\n (mouseenter)=\"mouseEnterPath(link, i)\"\n (mouseleave)=\"mouseLeavePath(link)\"\n stroke=\"transparent\"\n stroke-width=\"9\"\n fill=\"none\"\n cursor=\"pointer\"\n ></path>\n </g>\n <defs *ngIf=\"showArrow\">\n <marker\n *ngIf=\"link.type === ganttLinkTypes.sf; else markerEnd\"\n [id]=\"'triangle' + i\"\n markerUnits=\"strokeWidth\"\n markerWidth=\"5\"\n markerHeight=\"4\"\n refX=\"5\"\n refY=\"2\"\n orient=\"180\"\n >\n <path [attr.fill]=\"link.color\" [attr.stroke]=\"link.color\" d=\"M 0 0 L 5 2 L 0 4 z\" />\n </marker>\n\n <ng-template #markerEnd>\n <marker [id]=\"'triangle' + i\" markerUnits=\"strokeWidth\" markerWidth=\"5\" markerHeight=\"4\" refX=\"5\" refY=\"2\" orient=\"auto\">\n <path [attr.fill]=\"link.color\" [attr.stroke]=\"link.color\" d=\"M 0 0 L 5 2 L 0 4 z\" />\n </marker>\n </ng-template>\n </defs>\n </ng-container>\n <line class=\"link-dragging-line\"></line>\n</svg>\n", dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
1946
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: GanttLinksComponent, decorators: [{
1981
1947
  type: Component,
1982
- args: [{ selector: 'ngx-gantt-root', providers: [GanttDomService, GanttDragContainer], host: {
1983
- class: 'gantt'
1984
- }, template: "<div class=\"gantt-side\" [style.width.px]=\"sideWidth\">\n <div class=\"gantt-side-container\">\n <ng-template [ngTemplateOutlet]=\"sideTemplate\"></ng-template>\n </div>\n</div>\n<div class=\"gantt-container\">\n <gantt-calendar-overlay></gantt-calendar-overlay>\n <gantt-drag-backdrop></gantt-drag-backdrop>\n <div class=\"gantt-main\">\n <ng-template [ngTemplateOutlet]=\"mainTemplate\"></ng-template>\n </div>\n</div>\n" }]
1985
- }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.NgZone }, { type: GanttDomService }, { type: GanttDragContainer }, { type: GanttUpper, decorators: [{
1948
+ args: [{ selector: 'gantt-links-overlay', template: "<svg [attr.width]=\"ganttUpper.view.width\" class=\"gantt-links-overlay-main\">\n <ng-container *ngFor=\"let link of links; let i = index; trackBy: trackBy\">\n <path\n [attr.d]=\"link.path\"\n fill=\"transparent\"\n stroke-width=\"2\"\n [attr.stroke]=\"link.color\"\n pointer-events=\"none\"\n [attr.style]=\"link.type === ganttLinkTypes.sf ? 'marker-start: url(#triangle' + i + ')' : 'marker-end: url(#triangle' + i + ')'\"\n ></path>\n\n <g>\n <path\n class=\"link-line\"\n (click)=\"onLineClick($event, link)\"\n [attr.d]=\"link.path\"\n (mouseenter)=\"mouseEnterPath(link, i)\"\n (mouseleave)=\"mouseLeavePath(link)\"\n stroke=\"transparent\"\n stroke-width=\"9\"\n fill=\"none\"\n cursor=\"pointer\"\n ></path>\n </g>\n <defs *ngIf=\"showArrow\">\n <marker\n *ngIf=\"link.type === ganttLinkTypes.sf; else markerEnd\"\n [id]=\"'triangle' + i\"\n markerUnits=\"strokeWidth\"\n markerWidth=\"5\"\n markerHeight=\"4\"\n refX=\"5\"\n refY=\"2\"\n orient=\"180\"\n >\n <path [attr.fill]=\"link.color\" [attr.stroke]=\"link.color\" d=\"M 0 0 L 5 2 L 0 4 z\" />\n </marker>\n\n <ng-template #markerEnd>\n <marker [id]=\"'triangle' + i\" markerUnits=\"strokeWidth\" markerWidth=\"5\" markerHeight=\"4\" refX=\"5\" refY=\"2\" orient=\"auto\">\n <path [attr.fill]=\"link.color\" [attr.stroke]=\"link.color\" d=\"M 0 0 L 5 2 L 0 4 z\" />\n </marker>\n </ng-template>\n </defs>\n </ng-container>\n <line class=\"link-dragging-line\"></line>\n</svg>\n" }]
1949
+ }], ctorParameters: function () { return [{ type: GanttUpper, decorators: [{
1986
1950
  type: Inject,
1987
1951
  args: [GANTT_UPPER_TOKEN]
1988
- }] }, { type: GanttPrintService, decorators: [{
1989
- type: Optional
1990
- }] }]; }, propDecorators: { sideWidth: [{
1952
+ }] }, { type: i0.ChangeDetectorRef }, { type: i0.ElementRef }, { type: GanttDragContainer }]; }, propDecorators: { groups: [{
1991
1953
  type: Input
1992
- }], sideTemplate: [{
1993
- type: ContentChild,
1994
- args: ['sideTemplate', { static: true }]
1995
- }], mainTemplate: [{
1996
- type: ContentChild,
1997
- args: ['mainTemplate', { static: true }]
1998
- }], backdrop: [{
1999
- type: ViewChild,
2000
- args: [GanttDragBackdropComponent, { static: true, read: ElementRef }]
1954
+ }], items: [{
1955
+ type: Input
1956
+ }], lineClick: [{
1957
+ type: Output
1958
+ }], ganttLinksOverlay: [{
1959
+ type: HostBinding,
1960
+ args: ['class.gantt-links-overlay']
2001
1961
  }] } });
2002
1962
 
2003
- class GanttLinkLine {
2004
- constructor() { }
2005
- generatePath(source, target, type) {
2006
- if (source.before && source.after && target.before && target.after) {
2007
- let path = '';
2008
- switch (type) {
2009
- case GanttLinkType.ss:
2010
- path = this.generateSSPath(source, target);
2011
- break;
2012
- case GanttLinkType.ff:
2013
- path = this.generateFFPath(source, target);
2014
- break;
2015
- case GanttLinkType.sf:
2016
- path = this.generateFSAndSFPath(source, target, type);
2017
- break;
2018
- default:
2019
- path = this.generateFSAndSFPath(source, target);
2020
- }
2021
- return path;
1963
+ /** Cached result of whether the user's browser supports passive event listeners. */
1964
+ let supportsPassiveEvents;
1965
+ /**
1966
+ * Checks whether the user's browser supports passive event listeners.
1967
+ * See: https://github.com/WICG/EventListenerOptions/blob/gh-pages/explainer.md
1968
+ */
1969
+ function supportsPassiveEventListeners() {
1970
+ if (supportsPassiveEvents == null && typeof window !== 'undefined') {
1971
+ try {
1972
+ window.addEventListener('test', null, Object.defineProperty({}, 'passive', {
1973
+ get: () => (supportsPassiveEvents = true)
1974
+ }));
1975
+ }
1976
+ finally {
1977
+ supportsPassiveEvents = supportsPassiveEvents || false;
2022
1978
  }
2023
1979
  }
1980
+ return supportsPassiveEvents;
1981
+ }
1982
+ /**
1983
+ * Normalizes an `AddEventListener` object to something that can be passed
1984
+ * to `addEventListener` on any browser, no matter whether it supports the
1985
+ * `options` parameter.
1986
+ */
1987
+ function normalizePassiveListenerOptions(options) {
1988
+ return supportsPassiveEventListeners() ? options : !!options.capture;
2024
1989
  }
1990
+ /** Options used to bind passive event listeners. */
1991
+ const passiveListenerOptions = normalizePassiveListenerOptions({ passive: true });
2025
1992
 
2026
- let GanttLinkLineCurve = class GanttLinkLineCurve extends GanttLinkLine {
2027
- constructor(ganttUpper) {
2028
- super();
2029
- this.ganttUpper = ganttUpper;
2030
- }
2031
- generateSSPath(source, target) {
2032
- const x1 = source.before.x;
2033
- const y1 = source.before.y;
2034
- const x4 = target.before.x;
2035
- const y4 = target.before.y;
2036
- const isMirror = y4 > y1 ? 0 : 1;
2037
- const radius = Math.abs(y4 - y1) / 2;
2038
- if (x4 > x1) {
2039
- return `M ${x1} ${y1}
2040
- A ${radius} ${radius} 0 1 ${isMirror} ${x1} ${y4}
2041
- L ${x4} ${y4}`;
2042
- }
2043
- else {
2044
- return `M ${x1} ${y1}
2045
- L ${x4} ${y1}
2046
- A ${radius} ${radius} 0 1 ${isMirror} ${x4} ${y4}`;
2047
- }
1993
+ const scrollThreshold = 50;
1994
+ var ScrollDirection;
1995
+ (function (ScrollDirection) {
1996
+ ScrollDirection[ScrollDirection["NONE"] = 0] = "NONE";
1997
+ ScrollDirection[ScrollDirection["LEFT"] = 1] = "LEFT";
1998
+ ScrollDirection[ScrollDirection["RIGHT"] = 2] = "RIGHT";
1999
+ })(ScrollDirection || (ScrollDirection = {}));
2000
+ class GanttDomService {
2001
+ constructor(ngZone, platformId) {
2002
+ this.ngZone = ngZone;
2003
+ this.platformId = platformId;
2004
+ this.unsubscribe$ = new Subject();
2048
2005
  }
2049
- generateFFPath(source, target) {
2050
- const x1 = source.after.x;
2051
- const y1 = source.after.y;
2052
- const x4 = target.after.x;
2053
- const y4 = target.after.y;
2054
- const isMirror = y4 > y1 ? 1 : 0;
2055
- const radius = Math.abs(y4 - y1) / 2;
2056
- if (x4 > x1) {
2057
- return `M ${x1} ${y1}
2058
- L ${x4} ${y1}
2059
- A ${radius} ${radius} 0 1 ${isMirror} ${x4} ${y4}`;
2060
- }
2061
- else {
2062
- return `M ${x1} ${y1}
2063
- A ${radius} ${radius} 0 1 ${isMirror} ${x1} ${y4}
2064
- L ${x4} ${y4}`;
2065
- }
2006
+ monitorScrollChange() {
2007
+ this.ngZone.runOutsideAngular(() => merge(fromEvent(this.mainContainer, 'scroll', passiveListenerOptions), fromEvent(this.sideContainer, 'scroll', passiveListenerOptions))
2008
+ .pipe(takeUntil(this.unsubscribe$))
2009
+ .subscribe((event) => {
2010
+ this.syncScroll(event);
2011
+ }));
2012
+ // fromEvent(this.mainContainer, 'scroll')
2013
+ // .pipe(startWith(), takeUntil(this.unsubscribe$))
2014
+ // .subscribe((event) => {
2015
+ // // if (this.mainContainer.scrollLeft > 0) {
2016
+ // // this.side.classList.add('gantt-side-has-shadow');
2017
+ // // } else {
2018
+ // // this.side.classList.remove('gantt-side-has-shadow');
2019
+ // // }
2020
+ // });
2066
2021
  }
2067
- generateFSAndSFPath(source, target, type) {
2068
- let x1 = source.after.x;
2069
- let y1 = source.after.y;
2070
- let x4 = target.before.x;
2071
- let y4 = target.before.y;
2072
- const bezierWeight = 0.5;
2073
- if (type === GanttLinkType.sf) {
2074
- x1 = target.after.x;
2075
- y1 = target.after.y;
2076
- x4 = source.before.x;
2077
- y4 = source.before.y;
2078
- }
2079
- let dx = Math.abs(x4 - x1) * bezierWeight;
2080
- let x2 = x1 + dx;
2081
- let x3 = x4 - dx;
2082
- const centerX = (x1 + x4) / 2;
2083
- const centerY = (y1 + y4) / 2;
2084
- let controlX = this.ganttUpper.styles.lineHeight / 2;
2085
- const controlY = this.ganttUpper.styles.lineHeight / 2;
2086
- if (x1 >= x4) {
2087
- if (Math.abs(y4 - y1) <= this.ganttUpper.styles.lineHeight) {
2088
- return `M ${x1} ${y1}
2089
- C ${x1 + controlX} ${y1} ${x1 + controlX} ${y4 > y1 ? y1 + controlX : y1 - controlX} ${x1} ${y4 > y1 ? y1 + controlY : y1 - controlY}
2090
- L ${x4} ${y4 > y1 ? y4 - controlY : y4 + controlY}
2091
- C ${x4 - controlY} ${y4 > y1 ? y4 - controlY : y4 + controlY} ${x4 - controlX} ${y4} ${x4} ${y4}
2092
- `;
2022
+ syncScroll(event) {
2023
+ const target = event.currentTarget;
2024
+ this.calendarOverlay.scrollLeft = this.mainContainer.scrollLeft;
2025
+ this.sideContainer.scrollTop = target.scrollTop;
2026
+ this.mainContainer.scrollTop = target.scrollTop;
2027
+ }
2028
+ disableBrowserWheelEvent() {
2029
+ const container = this.mainContainer;
2030
+ this.ngZone.runOutsideAngular(() => fromEvent(container, 'wheel')
2031
+ .pipe(takeUntil(this.unsubscribe$))
2032
+ .subscribe((event) => {
2033
+ const delta = event.deltaX;
2034
+ if (!delta) {
2035
+ return;
2093
2036
  }
2094
- else {
2095
- controlX = this.ganttUpper.styles.lineHeight;
2096
- return `M ${x1} ${y1}
2097
- C ${x1 + controlX} ${y1} ${x1 + controlX} ${y4 > y1 ? y1 + controlX : y1 - controlX} ${centerX} ${centerY}
2098
- C ${x4 - controlX} ${y4 > y1 ? y4 - controlX : y4 + controlX} ${x4 - controlX} ${y4} ${x4} ${y4}
2099
- `;
2037
+ if ((container.scrollLeft + container.offsetWidth === container.scrollWidth && delta > 0) ||
2038
+ (container.scrollLeft === 0 && delta < 0)) {
2039
+ event.preventDefault();
2100
2040
  }
2101
- }
2102
- else if (this.ganttUpper.linkOptions?.showArrow && x4 - x1 < 200) {
2103
- dx = Math.max(Math.abs(y4 - y1) * bezierWeight, 60);
2104
- x2 = x1 + dx;
2105
- x3 = x4 - dx;
2106
- return `M ${x1} ${y1} C ${x2} ${y1} ${x3} ${y4} ${x4} ${y4}`;
2107
- }
2108
- return `M ${x1} ${y1} C ${x2} ${y1} ${x3} ${y4} ${x4} ${y4}`;
2041
+ }));
2109
2042
  }
2110
- };
2111
- GanttLinkLineCurve = __decorate([
2112
- __param(0, Inject(GANTT_UPPER_TOKEN))
2113
- ], GanttLinkLineCurve);
2114
-
2115
- class GanttLinkLineStraight extends GanttLinkLine {
2116
- constructor() {
2117
- super();
2118
- this.pathControl = 20;
2043
+ initialize(root) {
2044
+ this.root = root.nativeElement;
2045
+ this.side = this.root.getElementsByClassName('gantt-side')[0];
2046
+ this.container = this.root.getElementsByClassName('gantt-container')[0];
2047
+ this.sideContainer = this.root.getElementsByClassName('gantt-side-container')[0];
2048
+ this.mainContainer = this.root.getElementsByClassName('gantt-main-container')[0];
2049
+ this.calendarOverlay = this.root.getElementsByClassName('gantt-calendar-overlay')[0];
2050
+ this.monitorScrollChange();
2051
+ this.disableBrowserWheelEvent();
2119
2052
  }
2120
- generateSSPath(source, target) {
2121
- const x1 = source.before.x;
2122
- const y1 = source.before.y;
2123
- const x4 = target.before.x;
2124
- const y4 = target.before.y;
2125
- const control = this.pathControl;
2126
- return `M ${x1} ${y1}
2127
- L ${x4 > x1 ? x1 - control : x4 - control} ${y1}
2128
- L ${x4 > x1 ? x1 - control : x4 - control} ${y4}
2129
- L ${x4} ${y4}`;
2053
+ /**
2054
+ * @returns An observable that will emit outside the Angular zone. Note, consumers should re-enter the Angular zone
2055
+ * to run the change detection if needed.
2056
+ */
2057
+ getViewerScroll(options) {
2058
+ return new Observable((subscriber) => this.ngZone.runOutsideAngular(() => fromEvent(this.mainContainer, 'scroll', options)
2059
+ .pipe(map(() => this.mainContainer.scrollLeft), pairwise(), map(([previous, current]) => {
2060
+ const event = {
2061
+ target: this.mainContainer,
2062
+ direction: ScrollDirection.NONE
2063
+ };
2064
+ if (current - previous < 0) {
2065
+ if (this.mainContainer.scrollLeft < scrollThreshold && this.mainContainer.scrollLeft > 0) {
2066
+ event.direction = ScrollDirection.LEFT;
2067
+ }
2068
+ }
2069
+ if (current - previous > 0) {
2070
+ if (this.mainContainer.scrollWidth - this.mainContainer.clientWidth - this.mainContainer.scrollLeft <
2071
+ scrollThreshold) {
2072
+ event.direction = ScrollDirection.RIGHT;
2073
+ }
2074
+ }
2075
+ return event;
2076
+ }))
2077
+ .subscribe(subscriber)));
2130
2078
  }
2131
- generateFFPath(source, target) {
2132
- const x1 = source.after.x;
2133
- const y1 = source.after.y;
2134
- const x4 = target.after.x;
2135
- const y4 = target.after.y;
2136
- const control = this.pathControl;
2137
- return `M ${x1} ${y1}
2138
- L ${x4 > x1 ? x4 + control : x1 + control} ${y1}
2139
- L ${x4 > x1 ? x4 + control : x1 + control} ${y4}
2140
- L ${x4} ${y4}`;
2079
+ getResize() {
2080
+ return isPlatformServer(this.platformId) ? EMPTY : fromEvent(window, 'resize').pipe(auditTime(150));
2141
2081
  }
2142
- generateFSAndSFPath(source, target, type) {
2143
- let x1 = source.after.x;
2144
- let y1 = source.after.y;
2145
- let x4 = target.before.x;
2146
- let y4 = target.before.y;
2147
- const control = this.pathControl;
2148
- if (type === GanttLinkType.sf) {
2149
- x1 = target.after.x;
2150
- y1 = target.after.y;
2151
- x4 = source.before.x;
2152
- y4 = source.before.y;
2153
- }
2154
- if (x4 - x1 >= 40) {
2155
- return `M ${x1} ${y1}
2156
- L ${x1 + control} ${y1}
2157
- L ${x1 + control} ${y4}
2158
- L ${x4} ${y4}`;
2159
- }
2160
- else {
2161
- return `M ${x1} ${y1}
2162
- L ${x1 + control} ${y1}
2163
- L ${x1 + control} ${y4 > y1 ? y1 + control : y1 - control}
2164
- L ${x4 - control} ${y4 > y1 ? y1 + control : y1 - control}
2165
- L ${x4 - control} ${y4}
2166
- L ${x4} ${y4}`;
2082
+ scrollMainContainer(left) {
2083
+ if (isNumber(left)) {
2084
+ const scrollLeft = left - this.mainContainer.clientWidth / 2;
2085
+ this.mainContainer.scrollLeft = scrollLeft > scrollThreshold ? scrollLeft : 0;
2086
+ this.calendarOverlay.scrollLeft = this.mainContainer.scrollLeft;
2167
2087
  }
2168
2088
  }
2089
+ ngOnDestroy() {
2090
+ this.unsubscribe$.next();
2091
+ this.unsubscribe$.complete();
2092
+ }
2169
2093
  }
2094
+ GanttDomService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: GanttDomService, deps: [{ token: i0.NgZone }, { token: PLATFORM_ID }], target: i0.ɵɵFactoryTarget.Injectable });
2095
+ GanttDomService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: GanttDomService });
2096
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: GanttDomService, decorators: [{
2097
+ type: Injectable
2098
+ }], ctorParameters: function () { return [{ type: i0.NgZone }, { type: undefined, decorators: [{
2099
+ type: Inject,
2100
+ args: [PLATFORM_ID]
2101
+ }] }]; } });
2170
2102
 
2171
- function createLineGenerator(type, ganttUpper) {
2172
- switch (type) {
2173
- case GanttLinkLineType.curve:
2174
- return new GanttLinkLineCurve(ganttUpper);
2175
- case GanttLinkLineType.straight:
2176
- return new GanttLinkLineStraight();
2177
- default:
2178
- throw new Error('gantt link path type invalid');
2179
- }
2103
+ class GanttDragBackdropComponent {
2180
2104
  }
2105
+ GanttDragBackdropComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: GanttDragBackdropComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2106
+ GanttDragBackdropComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.3", type: GanttDragBackdropComponent, selector: "gantt-drag-backdrop", host: { classAttribute: "gantt-drag-backdrop" }, ngImport: i0, template: "<div class=\"gantt-drag-mask\">\n <div class=\"date-range\">\n <span class=\"start\"></span>\n <span class=\"end\"></span>\n </div>\n</div>\n" });
2107
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: GanttDragBackdropComponent, decorators: [{
2108
+ type: Component,
2109
+ args: [{ selector: 'gantt-drag-backdrop', host: {
2110
+ class: 'gantt-drag-backdrop'
2111
+ }, template: "<div class=\"gantt-drag-mask\">\n <div class=\"date-range\">\n <span class=\"start\"></span>\n <span class=\"end\"></span>\n </div>\n</div>\n" }]
2112
+ }] });
2181
2113
 
2182
- class GanttLinksComponent {
2183
- constructor(ganttUpper, cdr, elementRef, ganttDragContainer) {
2184
- this.ganttUpper = ganttUpper;
2185
- this.cdr = cdr;
2186
- this.elementRef = elementRef;
2187
- this.ganttDragContainer = ganttDragContainer;
2188
- this.groups = [];
2189
- this.items = [];
2190
- this.lineClick = new EventEmitter();
2191
- this.links = [];
2192
- this.ganttLinkTypes = GanttLinkType;
2193
- this.showArrow = false;
2194
- this.linkItems = [];
2195
- this.firstChange = true;
2196
- this.unsubscribe$ = new Subject();
2197
- this.ganttLinksOverlay = true;
2198
- }
2199
- ngOnInit() {
2200
- this.linkLine = createLineGenerator(this.ganttUpper.linkOptions.lineType, this.ganttUpper);
2201
- this.showArrow = this.ganttUpper.linkOptions.showArrow;
2202
- this.buildLinks();
2203
- this.firstChange = false;
2204
- this.ganttDragContainer.dragStarted.pipe(takeUntil(this.unsubscribe$)).subscribe(() => {
2205
- this.elementRef.nativeElement.style.visibility = 'hidden';
2206
- });
2207
- merge(this.ganttUpper.viewChange, this.ganttUpper.expandChange, this.ganttUpper.view.start$, this.ganttUpper.dragEnded, this.ganttUpper.linkDragEnded)
2208
- .pipe(skip(1), debounceTime(0), takeUntil(this.unsubscribe$))
2209
- .subscribe(() => {
2210
- this.elementRef.nativeElement.style.visibility = 'visible';
2211
- this.buildLinks();
2212
- this.cdr.detectChanges();
2213
- });
2214
- }
2215
- ngOnChanges() {
2216
- if (!this.firstChange) {
2217
- this.buildLinks();
2114
+ class GanttPrintService {
2115
+ constructor() { }
2116
+ setInlineStyles(targetElem) {
2117
+ const svgElements = Array.from(targetElem.getElementsByTagName('svg'));
2118
+ for (const svgElement of svgElements) {
2119
+ this.recursElementChildren(svgElement);
2218
2120
  }
2219
2121
  }
2220
- computeItemPosition() {
2221
- const lineHeight = this.ganttUpper.styles.lineHeight;
2222
- const barHeight = this.ganttUpper.styles.barHeight;
2223
- this.linkItems = [];
2224
- if (this.groups.length > 0) {
2225
- let itemNum = 0;
2226
- let groupNum = 0;
2227
- this.groups.forEach((group) => {
2228
- groupNum++;
2229
- if (group.expanded) {
2230
- const items = recursiveItems(group.items);
2231
- items.forEach((item, itemIndex) => {
2232
- const y = (groupNum + itemNum + itemIndex) * lineHeight + item.refs.y + barHeight / 2;
2233
- this.linkItems.push({
2234
- ...item,
2235
- before: {
2236
- x: item.refs.x,
2237
- y
2238
- },
2239
- after: {
2240
- x: item.refs.x + item.refs.width,
2241
- y
2242
- }
2243
- });
2244
- });
2245
- itemNum += items.length;
2246
- }
2247
- });
2122
+ recursElementChildren(node) {
2123
+ const transformProperties = [
2124
+ 'fill',
2125
+ 'color',
2126
+ 'font-size',
2127
+ 'stroke',
2128
+ 'font',
2129
+ 'text-anchor',
2130
+ 'stroke-dasharray',
2131
+ 'shape-rendering',
2132
+ 'stroke-width'
2133
+ ];
2134
+ if (!node.style) {
2135
+ return;
2248
2136
  }
2249
- else {
2250
- const items = recursiveItems(this.items);
2251
- items.forEach((item, itemIndex) => {
2252
- const y = itemIndex * lineHeight + item.refs.y + barHeight / 2;
2253
- this.linkItems.push({
2254
- ...item,
2255
- before: {
2256
- x: item.refs.x,
2257
- y
2258
- },
2259
- after: {
2260
- x: item.refs.x + item.refs.width,
2261
- y
2262
- }
2263
- });
2264
- });
2137
+ const styles = getComputedStyle(node);
2138
+ for (const transformProperty of transformProperties) {
2139
+ node.style[transformProperty] = styles[transformProperty];
2140
+ }
2141
+ for (const child of Array.from(node.childNodes)) {
2142
+ this.recursElementChildren(child);
2265
2143
  }
2266
2144
  }
2267
- buildLinks() {
2268
- this.computeItemPosition();
2269
- this.links = [];
2270
- this.linkItems.forEach((source) => {
2271
- if (source.origin.start || source.origin.end) {
2272
- source.links.forEach((link) => {
2273
- const target = this.linkItems.find((item) => item.id === link.link);
2274
- if (target && (target.origin.start || target.origin.end)) {
2275
- let defaultColor = LinkColors.default;
2276
- let activeColor = LinkColors.active;
2277
- if (link.type === GanttLinkType.fs && source.end.getTime() > target.start.getTime()) {
2278
- defaultColor = LinkColors.blocked;
2279
- activeColor = LinkColors.blocked;
2280
- }
2281
- if (link.color) {
2282
- if (typeof link.color === 'string') {
2283
- defaultColor = link.color;
2284
- activeColor = link.color;
2285
- }
2286
- else {
2287
- defaultColor = link.color.default;
2288
- activeColor = link.color.active;
2289
- }
2290
- }
2291
- this.links.push({
2292
- path: this.linkLine.generatePath(source, target, link.type),
2293
- source: source.origin,
2294
- target: target.origin,
2295
- type: link.type,
2296
- color: defaultColor,
2297
- defaultColor,
2298
- activeColor
2299
- });
2300
- }
2301
- });
2145
+ register(root) {
2146
+ this.root = root.nativeElement;
2147
+ this.mainContainer = this.root.getElementsByClassName('gantt-main-container')[0];
2148
+ }
2149
+ async print(name = 'download', ignoreElementClass) {
2150
+ const root = this.root;
2151
+ const mainContainer = this.mainContainer;
2152
+ // set print width
2153
+ const printWidth = root.offsetWidth;
2154
+ // set print height
2155
+ const printHeight = root.offsetHeight - mainContainer.offsetHeight + mainContainer.scrollHeight;
2156
+ const html2canvas = (await import(/* webpackChunkName: 'html2canvas' */ 'html2canvas')).default;
2157
+ html2canvas(root, {
2158
+ logging: false,
2159
+ allowTaint: true,
2160
+ useCORS: true,
2161
+ width: printWidth,
2162
+ height: printHeight,
2163
+ ignoreElements: (element) => {
2164
+ if (ignoreElementClass && element.classList.contains(ignoreElementClass)) {
2165
+ return true;
2166
+ }
2167
+ if (element.classList.contains('gantt-calendar-today-overlay')) {
2168
+ return true;
2169
+ }
2170
+ },
2171
+ onclone: (cloneDocument) => {
2172
+ const ganttClass = root.className;
2173
+ const cloneGanttDom = cloneDocument.querySelector(`.${ganttClass.replace(/\s+/g, '.')}`);
2174
+ const cloneGanttContainerDom = cloneDocument.querySelector('.gantt-container');
2175
+ const cloneCalendarOverlay = cloneDocument.querySelector('.gantt-calendar-overlay-main');
2176
+ const cloneLinksOverlay = cloneDocument.querySelector('.gantt-links-overlay-main');
2177
+ // change targetDom width
2178
+ cloneGanttDom.style.width = `${printWidth}px`;
2179
+ cloneGanttDom.style.height = `${printHeight}px`;
2180
+ cloneGanttDom.style.overflow = `unset`;
2181
+ cloneGanttContainerDom.style.backgroundColor = '#fff';
2182
+ cloneCalendarOverlay.setAttribute('height', `${printHeight}`);
2183
+ cloneCalendarOverlay.setAttribute('style', `background: transparent`);
2184
+ if (cloneLinksOverlay) {
2185
+ cloneLinksOverlay.setAttribute('height', `${printHeight}`);
2186
+ cloneLinksOverlay.setAttribute('style', `height: ${printHeight}px`);
2187
+ }
2188
+ // setInlineStyles for svg
2189
+ this.setInlineStyles(cloneGanttDom);
2302
2190
  }
2191
+ }).then((canvas) => {
2192
+ const link = document.createElement('a');
2193
+ const dataUrl = canvas.toDataURL('image/png');
2194
+ link.download = `${name}.png`;
2195
+ link.href = dataUrl;
2196
+ link.click();
2303
2197
  });
2304
2198
  }
2305
- trackBy(index) {
2306
- return index;
2199
+ }
2200
+ GanttPrintService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: GanttPrintService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
2201
+ GanttPrintService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: GanttPrintService });
2202
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: GanttPrintService, decorators: [{
2203
+ type: Injectable
2204
+ }], ctorParameters: function () { return []; } });
2205
+
2206
+ const mainHeight = 5000;
2207
+ class GanttCalendarComponent {
2208
+ constructor(ganttUpper, ngZone, elementRef) {
2209
+ this.ganttUpper = ganttUpper;
2210
+ this.ngZone = ngZone;
2211
+ this.elementRef = elementRef;
2212
+ this.headerHeight = headerHeight;
2213
+ this.mainHeight = mainHeight;
2214
+ this.todayHeight = todayHeight;
2215
+ this.todayWidth = todayWidth;
2216
+ this.todayBorderRadius = todayBorderRadius;
2217
+ this.viewTypes = GanttViewType;
2218
+ this.className = true;
2219
+ this.unsubscribe$ = new Subject();
2307
2220
  }
2308
- onLineClick(event, link) {
2309
- this.lineClick.emit({
2310
- event,
2311
- source: link.source,
2312
- target: link.target
2313
- });
2221
+ get view() {
2222
+ return this.ganttUpper.view;
2314
2223
  }
2315
- mouseEnterPath(link, index) {
2316
- link.color = link.activeColor || link.defaultColor;
2317
- if (index < this.links.length - 1) {
2318
- this.links.splice(index, 1);
2319
- this.links.push(link);
2224
+ setTodayPoint() {
2225
+ const x = this.view.getTodayXPoint();
2226
+ const today = new GanttDate().getDate();
2227
+ const todayEle = this.elementRef.nativeElement.getElementsByClassName('gantt-calendar-today-overlay')[0];
2228
+ const rect = this.elementRef.nativeElement.getElementsByClassName('today-rect')[0];
2229
+ const line = this.elementRef.nativeElement.getElementsByClassName('today-line')[0];
2230
+ if (isNumber(x)) {
2231
+ if (rect) {
2232
+ rect.style.left = `${x - todayWidth / 2}px`;
2233
+ rect.style.top = `${headerHeight - todayHeight}px`;
2234
+ rect.innerHTML = today.toString();
2235
+ }
2236
+ if (line) {
2237
+ line.style.left = `${x}px`;
2238
+ line.style.top = `${headerHeight}px`;
2239
+ line.style.bottom = `${-mainHeight}px`;
2240
+ }
2241
+ }
2242
+ else {
2243
+ todayEle.style.display = 'none';
2320
2244
  }
2321
2245
  }
2322
- mouseLeavePath(link) {
2323
- link.color = link.defaultColor;
2246
+ ngOnInit() {
2247
+ // Note: the zone may be nooped through `BootstrapOptions` when bootstrapping the root module. This means
2248
+ // the `onStable` will never emit any value.
2249
+ const onStable$ = this.ngZone.isStable ? from(Promise.resolve()) : this.ngZone.onStable.pipe(take(1));
2250
+ // Normally this isn't in the zone, but it can cause performance regressions for apps
2251
+ // using `zone-patch-rxjs` because it'll trigger a change detection when it unsubscribes.
2252
+ this.ngZone.runOutsideAngular(() => {
2253
+ onStable$.pipe(takeUntil(this.unsubscribe$)).subscribe(() => {
2254
+ merge(this.ganttUpper.viewChange, this.ganttUpper.view.start$)
2255
+ .pipe(takeUntil(this.unsubscribe$))
2256
+ .subscribe(() => {
2257
+ this.setTodayPoint();
2258
+ });
2259
+ });
2260
+ });
2261
+ }
2262
+ trackBy(index, point) {
2263
+ return point.text || index;
2324
2264
  }
2325
2265
  ngOnDestroy() {
2326
2266
  this.unsubscribe$.next();
2327
2267
  this.unsubscribe$.complete();
2328
2268
  }
2329
2269
  }
2330
- GanttLinksComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: GanttLinksComponent, deps: [{ token: GANTT_UPPER_TOKEN }, { token: i0.ChangeDetectorRef }, { token: i0.ElementRef }, { token: GanttDragContainer }], target: i0.ɵɵFactoryTarget.Component });
2331
- GanttLinksComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.8", type: GanttLinksComponent, selector: "gantt-links-overlay", inputs: { groups: "groups", items: "items" }, outputs: { lineClick: "lineClick" }, host: { properties: { "class.gantt-links-overlay": "this.ganttLinksOverlay" } }, usesOnChanges: true, ngImport: i0, template: "<svg [attr.width]=\"ganttUpper.view.width\" class=\"gantt-links-overlay-main\">\n <ng-container *ngFor=\"let link of links; let i = index; trackBy: trackBy\">\n <path\n [attr.d]=\"link.path\"\n fill=\"transparent\"\n stroke-width=\"2\"\n [attr.stroke]=\"link.color\"\n pointer-events=\"none\"\n [attr.style]=\"link.type === ganttLinkTypes.sf ? 'marker-start: url(#triangle' + i + ')' : 'marker-end: url(#triangle' + i + ')'\"\n ></path>\n\n <g>\n <path\n class=\"link-line\"\n (click)=\"onLineClick($event, link)\"\n [attr.d]=\"link.path\"\n (mouseenter)=\"mouseEnterPath(link, i)\"\n (mouseleave)=\"mouseLeavePath(link)\"\n stroke=\"transparent\"\n stroke-width=\"9\"\n fill=\"none\"\n cursor=\"pointer\"\n ></path>\n </g>\n <defs *ngIf=\"showArrow\">\n <marker\n *ngIf=\"link.type === ganttLinkTypes.sf; else markerEnd\"\n [id]=\"'triangle' + i\"\n markerUnits=\"strokeWidth\"\n markerWidth=\"5\"\n markerHeight=\"4\"\n refX=\"5\"\n refY=\"2\"\n orient=\"180\"\n >\n <path [attr.fill]=\"link.color\" [attr.stroke]=\"link.color\" d=\"M 0 0 L 5 2 L 0 4 z\" />\n </marker>\n\n <ng-template #markerEnd>\n <marker [id]=\"'triangle' + i\" markerUnits=\"strokeWidth\" markerWidth=\"5\" markerHeight=\"4\" refX=\"5\" refY=\"2\" orient=\"auto\">\n <path [attr.fill]=\"link.color\" [attr.stroke]=\"link.color\" d=\"M 0 0 L 5 2 L 0 4 z\" />\n </marker>\n </ng-template>\n </defs>\n </ng-container>\n <line class=\"link-dragging-line\"></line>\n</svg>\n", directives: [{ type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
2332
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: GanttLinksComponent, decorators: [{
2270
+ GanttCalendarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: GanttCalendarComponent, deps: [{ token: GANTT_UPPER_TOKEN }, { token: i0.NgZone }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
2271
+ GanttCalendarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.3", type: GanttCalendarComponent, selector: "gantt-calendar-overlay", host: { properties: { "class.gantt-calendar-overlay": "this.className" } }, ngImport: i0, template: "<div class=\"gantt-calendar-today-overlay\" [style.width.px]=\"view.width\">\n <span class=\"today-rect\" [hidden]=\"ganttUpper.viewType !== viewTypes.day\"> </span>\n <span class=\"today-line\" *ngIf=\"ganttUpper.showTodayLine\"> </span>\n</div>\n\n<svg class=\"gantt-calendar-overlay-main\" [attr.width]=\"view.width\" [attr.height]=\"headerHeight\">\n <g>\n <text class=\"primary-text\" *ngFor=\"let point of view.primaryDatePoints; trackBy: trackBy\" [attr.x]=\"point.x\" [attr.y]=\"point.y\">\n {{ point.text }}\n </text>\n <ng-container *ngFor=\"let point of view.secondaryDatePoints; trackBy: trackBy\">\n <text class=\"secondary-text\" [class.secondary-text-weekend]=\"point.additions?.isWeekend\" [attr.x]=\"point.x\" [attr.y]=\"point.y\">\n {{ point.text }}\n </text>\n </ng-container>\n\n <g>\n <line\n *ngFor=\"let point of view.primaryDatePoints; let i = index; trackBy: trackBy\"\n [attr.x1]=\"(i + 1) * view.primaryWidth\"\n [attr.x2]=\"(i + 1) * view.primaryWidth\"\n [attr.y1]=\"0\"\n [attr.y2]=\"mainHeight\"\n class=\"primary-line\"\n ></line>\n </g>\n\n <g>\n <line [attr.x1]=\"0\" [attr.x2]=\"view.width\" [attr.y1]=\"headerHeight\" [attr.y2]=\"headerHeight\" class=\"header-line\"></line>\n </g>\n </g>\n <g>\n <g *ngIf=\"view.showTimeline\">\n <line\n *ngFor=\"let point of view.secondaryDatePoints; let i = index; trackBy: trackBy\"\n [attr.x1]=\"(i + 1) * view.cellWidth\"\n [attr.x2]=\"(i + 1) * view.cellWidth\"\n [attr.y1]=\"headerHeight\"\n [attr.y2]=\"mainHeight\"\n class=\"secondary-line\"\n ></line>\n <line\n *ngFor=\"let point of view.primaryDatePoints; let i = index; trackBy: trackBy\"\n [attr.x1]=\"(i + 1) * view.primaryWidth\"\n [attr.x2]=\"(i + 1) * view.primaryWidth\"\n [attr.y1]=\"0\"\n [attr.y2]=\"mainHeight\"\n class=\"primary-line\"\n ></line>\n </g>\n </g>\n</svg>\n", dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
2272
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: GanttCalendarComponent, decorators: [{
2333
2273
  type: Component,
2334
- args: [{ selector: 'gantt-links-overlay', template: "<svg [attr.width]=\"ganttUpper.view.width\" class=\"gantt-links-overlay-main\">\n <ng-container *ngFor=\"let link of links; let i = index; trackBy: trackBy\">\n <path\n [attr.d]=\"link.path\"\n fill=\"transparent\"\n stroke-width=\"2\"\n [attr.stroke]=\"link.color\"\n pointer-events=\"none\"\n [attr.style]=\"link.type === ganttLinkTypes.sf ? 'marker-start: url(#triangle' + i + ')' : 'marker-end: url(#triangle' + i + ')'\"\n ></path>\n\n <g>\n <path\n class=\"link-line\"\n (click)=\"onLineClick($event, link)\"\n [attr.d]=\"link.path\"\n (mouseenter)=\"mouseEnterPath(link, i)\"\n (mouseleave)=\"mouseLeavePath(link)\"\n stroke=\"transparent\"\n stroke-width=\"9\"\n fill=\"none\"\n cursor=\"pointer\"\n ></path>\n </g>\n <defs *ngIf=\"showArrow\">\n <marker\n *ngIf=\"link.type === ganttLinkTypes.sf; else markerEnd\"\n [id]=\"'triangle' + i\"\n markerUnits=\"strokeWidth\"\n markerWidth=\"5\"\n markerHeight=\"4\"\n refX=\"5\"\n refY=\"2\"\n orient=\"180\"\n >\n <path [attr.fill]=\"link.color\" [attr.stroke]=\"link.color\" d=\"M 0 0 L 5 2 L 0 4 z\" />\n </marker>\n\n <ng-template #markerEnd>\n <marker [id]=\"'triangle' + i\" markerUnits=\"strokeWidth\" markerWidth=\"5\" markerHeight=\"4\" refX=\"5\" refY=\"2\" orient=\"auto\">\n <path [attr.fill]=\"link.color\" [attr.stroke]=\"link.color\" d=\"M 0 0 L 5 2 L 0 4 z\" />\n </marker>\n </ng-template>\n </defs>\n </ng-container>\n <line class=\"link-dragging-line\"></line>\n</svg>\n" }]
2274
+ args: [{ selector: 'gantt-calendar-overlay', template: "<div class=\"gantt-calendar-today-overlay\" [style.width.px]=\"view.width\">\n <span class=\"today-rect\" [hidden]=\"ganttUpper.viewType !== viewTypes.day\"> </span>\n <span class=\"today-line\" *ngIf=\"ganttUpper.showTodayLine\"> </span>\n</div>\n\n<svg class=\"gantt-calendar-overlay-main\" [attr.width]=\"view.width\" [attr.height]=\"headerHeight\">\n <g>\n <text class=\"primary-text\" *ngFor=\"let point of view.primaryDatePoints; trackBy: trackBy\" [attr.x]=\"point.x\" [attr.y]=\"point.y\">\n {{ point.text }}\n </text>\n <ng-container *ngFor=\"let point of view.secondaryDatePoints; trackBy: trackBy\">\n <text class=\"secondary-text\" [class.secondary-text-weekend]=\"point.additions?.isWeekend\" [attr.x]=\"point.x\" [attr.y]=\"point.y\">\n {{ point.text }}\n </text>\n </ng-container>\n\n <g>\n <line\n *ngFor=\"let point of view.primaryDatePoints; let i = index; trackBy: trackBy\"\n [attr.x1]=\"(i + 1) * view.primaryWidth\"\n [attr.x2]=\"(i + 1) * view.primaryWidth\"\n [attr.y1]=\"0\"\n [attr.y2]=\"mainHeight\"\n class=\"primary-line\"\n ></line>\n </g>\n\n <g>\n <line [attr.x1]=\"0\" [attr.x2]=\"view.width\" [attr.y1]=\"headerHeight\" [attr.y2]=\"headerHeight\" class=\"header-line\"></line>\n </g>\n </g>\n <g>\n <g *ngIf=\"view.showTimeline\">\n <line\n *ngFor=\"let point of view.secondaryDatePoints; let i = index; trackBy: trackBy\"\n [attr.x1]=\"(i + 1) * view.cellWidth\"\n [attr.x2]=\"(i + 1) * view.cellWidth\"\n [attr.y1]=\"headerHeight\"\n [attr.y2]=\"mainHeight\"\n class=\"secondary-line\"\n ></line>\n <line\n *ngFor=\"let point of view.primaryDatePoints; let i = index; trackBy: trackBy\"\n [attr.x1]=\"(i + 1) * view.primaryWidth\"\n [attr.x2]=\"(i + 1) * view.primaryWidth\"\n [attr.y1]=\"0\"\n [attr.y2]=\"mainHeight\"\n class=\"primary-line\"\n ></line>\n </g>\n </g>\n</svg>\n" }]
2335
2275
  }], ctorParameters: function () { return [{ type: GanttUpper, decorators: [{
2336
2276
  type: Inject,
2337
2277
  args: [GANTT_UPPER_TOKEN]
2338
- }] }, { type: i0.ChangeDetectorRef }, { type: i0.ElementRef }, { type: GanttDragContainer }]; }, propDecorators: { groups: [{
2339
- type: Input
2340
- }], items: [{
2341
- type: Input
2342
- }], lineClick: [{
2343
- type: Output
2344
- }], ganttLinksOverlay: [{
2278
+ }] }, { type: i0.NgZone }, { type: i0.ElementRef }]; }, propDecorators: { className: [{
2345
2279
  type: HostBinding,
2346
- args: ['class.gantt-links-overlay']
2280
+ args: ['class.gantt-calendar-overlay']
2347
2281
  }] } });
2348
2282
 
2349
- class GanttItemUpper {
2350
- constructor(elementRef, ganttUpper) {
2283
+ class NgxGanttRootComponent {
2284
+ constructor(elementRef, ngZone, dom, dragContainer, ganttUpper, printService) {
2351
2285
  this.elementRef = elementRef;
2286
+ this.ngZone = ngZone;
2287
+ this.dom = dom;
2288
+ this.dragContainer = dragContainer;
2352
2289
  this.ganttUpper = ganttUpper;
2353
- this.firstChange = true;
2290
+ this.printService = printService;
2354
2291
  this.unsubscribe$ = new Subject();
2292
+ this.ganttUpper.dragContainer = dragContainer;
2293
+ }
2294
+ get view() {
2295
+ return this.ganttUpper.view;
2355
2296
  }
2356
2297
  ngOnInit() {
2357
- this.firstChange = false;
2358
- this.item.refs$.pipe(takeUntil(this.unsubscribe$)).subscribe(() => {
2359
- this.setPositions();
2298
+ // Note: the zone may be nooped through `BootstrapOptions` when bootstrapping the root module. This means
2299
+ // the `onStable` will never emit any value.
2300
+ const onStable$ = this.ngZone.isStable ? from(Promise.resolve()) : this.ngZone.onStable.pipe(take(1));
2301
+ // Normally this isn't in the zone, but it can cause performance regressions for apps
2302
+ // using `zone-patch-rxjs` because it'll trigger a change detection when it unsubscribes.
2303
+ this.ngZone.runOutsideAngular(() => {
2304
+ onStable$.pipe(takeUntil(this.unsubscribe$)).subscribe(() => {
2305
+ this.dom.initialize(this.elementRef);
2306
+ if (this.printService) {
2307
+ this.printService.register(this.elementRef);
2308
+ }
2309
+ this.setupScrollClass();
2310
+ this.setupResize();
2311
+ this.setupViewScroll();
2312
+ // 优化初始化时Scroll滚动体验问题,通过透明度解决,默认透明度为0,滚动结束后恢复
2313
+ this.elementRef.nativeElement.style.opacity = '1';
2314
+ this.ganttUpper.viewChange.pipe(startWith(null), takeUntil(this.unsubscribe$)).subscribe(() => {
2315
+ this.scrollToToday();
2316
+ });
2317
+ });
2360
2318
  });
2361
2319
  }
2362
- ngOnChanges() {
2363
- if (!this.firstChange) {
2364
- this.setPositions();
2365
- }
2320
+ ngOnDestroy() {
2321
+ this.unsubscribe$.next();
2366
2322
  }
2367
- setPositions() {
2368
- const itemElement = this.elementRef.nativeElement;
2369
- itemElement.style.left = this.item.refs.x + 'px';
2370
- itemElement.style.top = this.item.refs.y + 'px';
2371
- itemElement.style.width = this.item.refs.width + 'px';
2372
- if (this.item.type === GanttItemType.bar) {
2373
- itemElement.style.height = this.ganttUpper.styles.barHeight + 'px';
2323
+ setupViewScroll() {
2324
+ if (this.ganttUpper.disabledLoadOnScroll) {
2325
+ return;
2374
2326
  }
2375
- else if (this.item.type === GanttItemType.range) {
2376
- itemElement.style.height = rangeHeight + 'px';
2327
+ this.dom
2328
+ .getViewerScroll(passiveListenerOptions)
2329
+ .pipe(takeUntil(this.unsubscribe$))
2330
+ .subscribe((event) => {
2331
+ if (event.direction === ScrollDirection.LEFT) {
2332
+ const dates = this.view.addStartDate();
2333
+ if (dates) {
2334
+ event.target.scrollLeft += this.view.getDateRangeWidth(dates.start, dates.end);
2335
+ if (this.ganttUpper.loadOnScroll.observers) {
2336
+ this.ngZone.run(() => this.ganttUpper.loadOnScroll.emit({ start: dates.start.getUnixTime(), end: dates.end.getUnixTime() }));
2337
+ }
2338
+ }
2339
+ }
2340
+ if (event.direction === ScrollDirection.RIGHT) {
2341
+ const dates = this.view.addEndDate();
2342
+ if (dates && this.ganttUpper.loadOnScroll.observers) {
2343
+ this.ngZone.run(() => this.ganttUpper.loadOnScroll.emit({ start: dates.start.getUnixTime(), end: dates.end.getUnixTime() }));
2344
+ }
2345
+ }
2346
+ });
2347
+ }
2348
+ setupResize() {
2349
+ this.dom
2350
+ .getResize()
2351
+ .pipe(takeUntil(this.unsubscribe$))
2352
+ .subscribe(() => {
2353
+ this.setupScrollClass();
2354
+ });
2355
+ }
2356
+ setupScrollClass() {
2357
+ const mainContainer = this.dom.mainContainer;
2358
+ const height = mainContainer.offsetHeight;
2359
+ const scrollHeight = mainContainer.scrollHeight;
2360
+ if (scrollHeight > height) {
2361
+ this.elementRef.nativeElement.className = 'gantt gantt-scroll';
2377
2362
  }
2378
2363
  else {
2364
+ this.elementRef.nativeElement.className = 'gantt';
2379
2365
  }
2380
2366
  }
2381
- ngOnDestroy() {
2382
- this.unsubscribe$.next();
2383
- this.unsubscribe$.complete();
2367
+ scrollToToday() {
2368
+ const x = this.view.getTodayXPoint();
2369
+ this.dom.scrollMainContainer(x);
2384
2370
  }
2385
- }
2386
- GanttItemUpper.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: GanttItemUpper, deps: [{ token: i0.ElementRef }, { token: GANTT_UPPER_TOKEN }], target: i0.ɵɵFactoryTarget.Directive });
2387
- GanttItemUpper.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.8", type: GanttItemUpper, inputs: { template: "template", item: "item" }, usesOnChanges: true, ngImport: i0 });
2388
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: GanttItemUpper, decorators: [{
2389
- type: Directive
2390
- }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: GanttUpper, decorators: [{
2391
- type: Inject,
2392
- args: [GANTT_UPPER_TOKEN]
2393
- }] }]; }, propDecorators: { template: [{
2394
- type: Input
2395
- }], item: [{
2396
- type: Input
2397
- }] } });
2398
-
2399
- class NgxGanttRangeComponent extends GanttItemUpper {
2400
- constructor(elementRef, ganttUpper) {
2401
- super(elementRef, ganttUpper);
2402
- this.ganttRangeClass = true;
2371
+ scrollToDate(date) {
2372
+ let x;
2373
+ if (typeof date === 'number') {
2374
+ x = this.view.getXPointByDate(new GanttDate(date));
2375
+ }
2376
+ else {
2377
+ x = this.view.getXPointByDate(date);
2378
+ }
2379
+ this.dom.scrollMainContainer(x);
2403
2380
  }
2404
2381
  }
2405
- NgxGanttRangeComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: NgxGanttRangeComponent, deps: [{ token: i0.ElementRef }, { token: GANTT_UPPER_TOKEN }], target: i0.ɵɵFactoryTarget.Component });
2406
- NgxGanttRangeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.8", type: NgxGanttRangeComponent, selector: "ngx-gantt-range,gantt-range", host: { properties: { "class.gantt-range": "this.ganttRangeClass" } }, usesInheritance: true, ngImport: i0, template: "<ng-container *ngIf=\"item.start && item.end\">\n <div class=\"gantt-range-main\">\n <div class=\"gantt-range-main-progress\" *ngIf=\"item.progress >= 0\" [style.width.%]=\"item.progress * 100\"></div>\n </div>\n <div class=\"gantt-range-triangle left\"></div>\n <div class=\"gantt-range-triangle right\"></div>\n <ng-template [ngTemplateOutlet]=\"template\" [ngTemplateOutletContext]=\"{ item: item.origin, refs: item.refs }\"></ng-template>\n</ng-container>\n", directives: [{ type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }] });
2407
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: NgxGanttRangeComponent, decorators: [{
2382
+ NgxGanttRootComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: NgxGanttRootComponent, deps: [{ token: i0.ElementRef }, { token: i0.NgZone }, { token: GanttDomService }, { token: GanttDragContainer }, { token: GANTT_UPPER_TOKEN }, { token: GanttPrintService, optional: true }], target: i0.ɵɵFactoryTarget.Component });
2383
+ NgxGanttRootComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.3", type: NgxGanttRootComponent, selector: "ngx-gantt-root", inputs: { sideWidth: "sideWidth" }, host: { classAttribute: "gantt" }, providers: [GanttDomService, GanttDragContainer], queries: [{ propertyName: "sideTemplate", first: true, predicate: ["sideTemplate"], descendants: true, static: true }, { propertyName: "mainTemplate", first: true, predicate: ["mainTemplate"], descendants: true, static: true }], viewQueries: [{ propertyName: "backdrop", first: true, predicate: GanttDragBackdropComponent, descendants: true, read: ElementRef, static: true }], ngImport: i0, template: "<div class=\"gantt-side\" [style.width.px]=\"sideWidth\">\n <div class=\"gantt-side-container\">\n <ng-template [ngTemplateOutlet]=\"sideTemplate\"></ng-template>\n </div>\n</div>\n<div class=\"gantt-container\">\n <gantt-calendar-overlay></gantt-calendar-overlay>\n <gantt-drag-backdrop></gantt-drag-backdrop>\n <div class=\"gantt-main\">\n <ng-template [ngTemplateOutlet]=\"mainTemplate\"></ng-template>\n </div>\n</div>\n", dependencies: [{ kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: GanttCalendarComponent, selector: "gantt-calendar-overlay" }, { kind: "component", type: GanttDragBackdropComponent, selector: "gantt-drag-backdrop" }] });
2384
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: NgxGanttRootComponent, decorators: [{
2408
2385
  type: Component,
2409
- args: [{ selector: 'ngx-gantt-range,gantt-range', template: "<ng-container *ngIf=\"item.start && item.end\">\n <div class=\"gantt-range-main\">\n <div class=\"gantt-range-main-progress\" *ngIf=\"item.progress >= 0\" [style.width.%]=\"item.progress * 100\"></div>\n </div>\n <div class=\"gantt-range-triangle left\"></div>\n <div class=\"gantt-range-triangle right\"></div>\n <ng-template [ngTemplateOutlet]=\"template\" [ngTemplateOutletContext]=\"{ item: item.origin, refs: item.refs }\"></ng-template>\n</ng-container>\n" }]
2410
- }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: GanttUpper, decorators: [{
2386
+ args: [{ selector: 'ngx-gantt-root', providers: [GanttDomService, GanttDragContainer], host: {
2387
+ class: 'gantt'
2388
+ }, template: "<div class=\"gantt-side\" [style.width.px]=\"sideWidth\">\n <div class=\"gantt-side-container\">\n <ng-template [ngTemplateOutlet]=\"sideTemplate\"></ng-template>\n </div>\n</div>\n<div class=\"gantt-container\">\n <gantt-calendar-overlay></gantt-calendar-overlay>\n <gantt-drag-backdrop></gantt-drag-backdrop>\n <div class=\"gantt-main\">\n <ng-template [ngTemplateOutlet]=\"mainTemplate\"></ng-template>\n </div>\n</div>\n" }]
2389
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.NgZone }, { type: GanttDomService }, { type: GanttDragContainer }, { type: GanttUpper, decorators: [{
2411
2390
  type: Inject,
2412
2391
  args: [GANTT_UPPER_TOKEN]
2413
- }] }]; }, propDecorators: { ganttRangeClass: [{
2414
- type: HostBinding,
2415
- args: ['class.gantt-range']
2392
+ }] }, { type: GanttPrintService, decorators: [{
2393
+ type: Optional
2394
+ }] }]; }, propDecorators: { sideWidth: [{
2395
+ type: Input
2396
+ }], sideTemplate: [{
2397
+ type: ContentChild,
2398
+ args: ['sideTemplate', { static: true }]
2399
+ }], mainTemplate: [{
2400
+ type: ContentChild,
2401
+ args: ['mainTemplate', { static: true }]
2402
+ }], backdrop: [{
2403
+ type: ViewChild,
2404
+ args: [GanttDragBackdropComponent, { static: true, read: ElementRef }]
2416
2405
  }] } });
2417
2406
 
2418
2407
  const dragMinWidth = 10;
@@ -2703,14 +2692,62 @@ class GanttBarDrag {
2703
2692
  this.destroy$.complete();
2704
2693
  }
2705
2694
  }
2706
- GanttBarDrag.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: GanttBarDrag, deps: [{ token: i1.DragDrop }, { token: GanttDomService }, { token: GanttDragContainer }, { token: NgxGanttRootComponent, skipSelf: true }], target: i0.ɵɵFactoryTarget.Injectable });
2707
- GanttBarDrag.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: GanttBarDrag });
2708
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: GanttBarDrag, decorators: [{
2695
+ GanttBarDrag.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: GanttBarDrag, deps: [{ token: i1$1.DragDrop }, { token: GanttDomService }, { token: GanttDragContainer }, { token: NgxGanttRootComponent, skipSelf: true }], target: i0.ɵɵFactoryTarget.Injectable });
2696
+ GanttBarDrag.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: GanttBarDrag });
2697
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: GanttBarDrag, decorators: [{
2709
2698
  type: Injectable
2710
- }], ctorParameters: function () { return [{ type: i1.DragDrop }, { type: GanttDomService }, { type: GanttDragContainer }, { type: NgxGanttRootComponent, decorators: [{
2699
+ }], ctorParameters: function () { return [{ type: i1$1.DragDrop }, { type: GanttDomService }, { type: GanttDragContainer }, { type: NgxGanttRootComponent, decorators: [{
2711
2700
  type: SkipSelf
2712
2701
  }] }]; } });
2713
2702
 
2703
+ class GanttItemUpper {
2704
+ constructor(elementRef, ganttUpper) {
2705
+ this.elementRef = elementRef;
2706
+ this.ganttUpper = ganttUpper;
2707
+ this.firstChange = true;
2708
+ this.unsubscribe$ = new Subject();
2709
+ }
2710
+ ngOnInit() {
2711
+ this.firstChange = false;
2712
+ this.item.refs$.pipe(takeUntil(this.unsubscribe$)).subscribe(() => {
2713
+ this.setPositions();
2714
+ });
2715
+ }
2716
+ ngOnChanges() {
2717
+ if (!this.firstChange) {
2718
+ this.setPositions();
2719
+ }
2720
+ }
2721
+ setPositions() {
2722
+ const itemElement = this.elementRef.nativeElement;
2723
+ itemElement.style.left = this.item.refs.x + 'px';
2724
+ itemElement.style.top = this.item.refs.y + 'px';
2725
+ itemElement.style.width = this.item.refs.width + 'px';
2726
+ if (this.item.type === GanttItemType.bar) {
2727
+ itemElement.style.height = this.ganttUpper.styles.barHeight + 'px';
2728
+ }
2729
+ else if (this.item.type === GanttItemType.range) {
2730
+ itemElement.style.height = rangeHeight + 'px';
2731
+ }
2732
+ }
2733
+ ngOnDestroy() {
2734
+ this.unsubscribe$.next();
2735
+ this.unsubscribe$.complete();
2736
+ }
2737
+ }
2738
+ GanttItemUpper.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: GanttItemUpper, deps: [{ token: i0.ElementRef }, { token: GANTT_UPPER_TOKEN }], target: i0.ɵɵFactoryTarget.Directive });
2739
+ GanttItemUpper.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.1.3", type: GanttItemUpper, inputs: { template: "template", item: "item" }, usesOnChanges: true, ngImport: i0 });
2740
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: GanttItemUpper, decorators: [{
2741
+ type: Directive
2742
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: GanttUpper, decorators: [{
2743
+ type: Inject,
2744
+ args: [GANTT_UPPER_TOKEN]
2745
+ }] }]; }, propDecorators: { template: [{
2746
+ type: Input
2747
+ }], item: [{
2748
+ type: Input
2749
+ }] } });
2750
+
2714
2751
  function linearGradient(sideOrCorner, color, stop) {
2715
2752
  return `linear-gradient(${sideOrCorner},${color} 0%,${stop} 40%)`;
2716
2753
  }
@@ -2723,7 +2760,6 @@ class NgxGanttBarComponent extends GanttItemUpper {
2723
2760
  this.ngZone = ngZone;
2724
2761
  this.barClick = new EventEmitter();
2725
2762
  this.ganttItemClass = true;
2726
- this.color = 'red';
2727
2763
  }
2728
2764
  ngOnInit() {
2729
2765
  super.ngOnInit();
@@ -2778,9 +2814,9 @@ class NgxGanttBarComponent extends GanttItemUpper {
2778
2814
  event.stopPropagation();
2779
2815
  }
2780
2816
  }
2781
- NgxGanttBarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: NgxGanttBarComponent, deps: [{ token: GanttDragContainer }, { token: GanttBarDrag }, { token: i0.ElementRef }, { token: GANTT_UPPER_TOKEN }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
2782
- NgxGanttBarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.8", type: NgxGanttBarComponent, selector: "ngx-gantt-bar,gantt-bar", outputs: { barClick: "barClick" }, host: { properties: { "class.gantt-bar": "this.ganttItemClass" } }, providers: [GanttBarDrag], viewQueries: [{ propertyName: "contentElementRef", first: true, predicate: ["content"], descendants: true }, { propertyName: "handles", predicate: ["handle"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<div class=\"gantt-bar-layer\">\n <div class=\"drag-handles\">\n <ng-container *ngIf=\"item.draggable && ganttUpper.draggable\">\n <span class=\"handle\" #handle></span>\n <span class=\"handle\" #handle></span>\n </ng-container>\n </div>\n <div *ngIf=\"item.linkable && ganttUpper.linkable\" class=\"link-handles\">\n <span class=\"handle\"><span class=\"point\"></span></span>\n <span class=\"handle\"> <span class=\"point\"></span></span>\n </div>\n</div>\n<div class=\"gantt-bar-border\"></div>\n<div #content class=\"gantt-bar-content\" (click)=\"onBarClick($event)\">\n <div class=\"gantt-bar-content-progress\" *ngIf=\"item.progress >= 0\" [style.width.%]=\"item.progress * 100\"></div>\n <ng-template [ngTemplateOutlet]=\"template\" [ngTemplateOutletContext]=\"{ item: item.origin, refs: item.refs }\"></ng-template>\n</div>\n", directives: [{ type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }] });
2783
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: NgxGanttBarComponent, decorators: [{
2817
+ NgxGanttBarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: NgxGanttBarComponent, deps: [{ token: GanttDragContainer }, { token: GanttBarDrag }, { token: i0.ElementRef }, { token: GANTT_UPPER_TOKEN }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
2818
+ NgxGanttBarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.3", type: NgxGanttBarComponent, selector: "ngx-gantt-bar,gantt-bar", outputs: { barClick: "barClick" }, host: { properties: { "class.gantt-bar": "this.ganttItemClass" } }, providers: [GanttBarDrag], viewQueries: [{ propertyName: "contentElementRef", first: true, predicate: ["content"], descendants: true }, { propertyName: "handles", predicate: ["handle"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<div class=\"gantt-bar-layer\">\n <div class=\"drag-handles\">\n <ng-container *ngIf=\"item.draggable && ganttUpper.draggable\">\n <span class=\"handle\" #handle></span>\n <span class=\"handle\" #handle></span>\n </ng-container>\n </div>\n <div *ngIf=\"item.linkable && ganttUpper.linkable\" class=\"link-handles\">\n <span class=\"handle\"><span class=\"point\"></span></span>\n <span class=\"handle\"> <span class=\"point\"></span></span>\n </div>\n</div>\n<div class=\"gantt-bar-border\"></div>\n<div #content class=\"gantt-bar-content\" (click)=\"onBarClick($event)\">\n <div class=\"gantt-bar-content-progress\" *ngIf=\"item.progress >= 0\" [style.width.%]=\"item.progress * 100\"></div>\n <ng-template [ngTemplateOutlet]=\"template\" [ngTemplateOutletContext]=\"{ item: item.origin, refs: item.refs }\"></ng-template>\n</div>\n", dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
2819
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: NgxGanttBarComponent, decorators: [{
2784
2820
  type: Component,
2785
2821
  args: [{ selector: 'ngx-gantt-bar,gantt-bar', providers: [GanttBarDrag], template: "<div class=\"gantt-bar-layer\">\n <div class=\"drag-handles\">\n <ng-container *ngIf=\"item.draggable && ganttUpper.draggable\">\n <span class=\"handle\" #handle></span>\n <span class=\"handle\" #handle></span>\n </ng-container>\n </div>\n <div *ngIf=\"item.linkable && ganttUpper.linkable\" class=\"link-handles\">\n <span class=\"handle\"><span class=\"point\"></span></span>\n <span class=\"handle\"> <span class=\"point\"></span></span>\n </div>\n</div>\n<div class=\"gantt-bar-border\"></div>\n<div #content class=\"gantt-bar-content\" (click)=\"onBarClick($event)\">\n <div class=\"gantt-bar-content-progress\" *ngIf=\"item.progress >= 0\" [style.width.%]=\"item.progress * 100\"></div>\n <ng-template [ngTemplateOutlet]=\"template\" [ngTemplateOutletContext]=\"{ item: item.origin, refs: item.refs }\"></ng-template>\n</div>\n" }]
2786
2822
  }], ctorParameters: function () { return [{ type: GanttDragContainer }, { type: GanttBarDrag }, { type: i0.ElementRef }, { type: GanttUpper, decorators: [{
@@ -2799,6 +2835,59 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImpor
2799
2835
  args: ['handle']
2800
2836
  }] } });
2801
2837
 
2838
+ class NgxGanttRangeComponent extends GanttItemUpper {
2839
+ constructor(elementRef, ganttUpper) {
2840
+ super(elementRef, ganttUpper);
2841
+ this.ganttRangeClass = true;
2842
+ }
2843
+ }
2844
+ NgxGanttRangeComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: NgxGanttRangeComponent, deps: [{ token: i0.ElementRef }, { token: GANTT_UPPER_TOKEN }], target: i0.ɵɵFactoryTarget.Component });
2845
+ NgxGanttRangeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.3", type: NgxGanttRangeComponent, selector: "ngx-gantt-range,gantt-range", host: { properties: { "class.gantt-range": "this.ganttRangeClass" } }, usesInheritance: true, ngImport: i0, template: "<ng-container *ngIf=\"item.start && item.end\">\n <div class=\"gantt-range-main\">\n <div class=\"gantt-range-main-progress\" *ngIf=\"item.progress >= 0\" [style.width.%]=\"item.progress * 100\"></div>\n </div>\n <div class=\"gantt-range-triangle left\"></div>\n <div class=\"gantt-range-triangle right\"></div>\n <ng-template [ngTemplateOutlet]=\"template\" [ngTemplateOutletContext]=\"{ item: item.origin, refs: item.refs }\"></ng-template>\n</ng-container>\n", dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
2846
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: NgxGanttRangeComponent, decorators: [{
2847
+ type: Component,
2848
+ args: [{ selector: 'ngx-gantt-range,gantt-range', template: "<ng-container *ngIf=\"item.start && item.end\">\n <div class=\"gantt-range-main\">\n <div class=\"gantt-range-main-progress\" *ngIf=\"item.progress >= 0\" [style.width.%]=\"item.progress * 100\"></div>\n </div>\n <div class=\"gantt-range-triangle left\"></div>\n <div class=\"gantt-range-triangle right\"></div>\n <ng-template [ngTemplateOutlet]=\"template\" [ngTemplateOutletContext]=\"{ item: item.origin, refs: item.refs }\"></ng-template>\n</ng-container>\n" }]
2849
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: GanttUpper, decorators: [{
2850
+ type: Inject,
2851
+ args: [GANTT_UPPER_TOKEN]
2852
+ }] }]; }, propDecorators: { ganttRangeClass: [{
2853
+ type: HostBinding,
2854
+ args: ['class.gantt-range']
2855
+ }] } });
2856
+
2857
+ class NgxGanttBaselineComponent {
2858
+ constructor(elementRef, ganttUpper) {
2859
+ this.elementRef = elementRef;
2860
+ this.ganttUpper = ganttUpper;
2861
+ this.unsubscribe$ = new Subject();
2862
+ this.ganttBaselineClass = true;
2863
+ }
2864
+ ngOnInit() {
2865
+ this.baselineItem.refs$.pipe(takeUntil$1(this.unsubscribe$)).subscribe(() => {
2866
+ this.setPositions();
2867
+ });
2868
+ }
2869
+ setPositions() {
2870
+ const itemElement = this.elementRef.nativeElement;
2871
+ itemElement.style.left = this.baselineItem.refs.x + 'px';
2872
+ itemElement.style.bottom = '2px';
2873
+ itemElement.style.width = this.baselineItem.refs.width + 'px';
2874
+ }
2875
+ }
2876
+ NgxGanttBaselineComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: NgxGanttBaselineComponent, deps: [{ token: i0.ElementRef }, { token: GANTT_UPPER_TOKEN }], target: i0.ɵɵFactoryTarget.Component });
2877
+ NgxGanttBaselineComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.3", type: NgxGanttBaselineComponent, selector: "ngx-gantt-baseline,gantt-baseline", inputs: { baselineItem: "baselineItem" }, host: { properties: { "class.gantt-baseline": "this.ganttBaselineClass" } }, ngImport: i0, template: "<div #content *ngIf=\"baselineItem\" class=\"baseline-content\"></div>\n", dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
2878
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: NgxGanttBaselineComponent, decorators: [{
2879
+ type: Component,
2880
+ args: [{ selector: 'ngx-gantt-baseline,gantt-baseline', template: "<div #content *ngIf=\"baselineItem\" class=\"baseline-content\"></div>\n" }]
2881
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: GanttUpper, decorators: [{
2882
+ type: Inject,
2883
+ args: [GANTT_UPPER_TOKEN]
2884
+ }] }]; }, propDecorators: { baselineItem: [{
2885
+ type: Input
2886
+ }], ganttBaselineClass: [{
2887
+ type: HostBinding,
2888
+ args: ['class.gantt-baseline']
2889
+ }] } });
2890
+
2802
2891
  class GanttMainComponent {
2803
2892
  constructor(ganttUpper) {
2804
2893
  this.ganttUpper = ganttUpper;
@@ -2810,11 +2899,11 @@ class GanttMainComponent {
2810
2899
  return item.id || index;
2811
2900
  }
2812
2901
  }
2813
- GanttMainComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: GanttMainComponent, deps: [{ token: GANTT_UPPER_TOKEN }], target: i0.ɵɵFactoryTarget.Component });
2814
- GanttMainComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.8", type: GanttMainComponent, selector: "gantt-main", inputs: { groups: "groups", items: "items", groupHeaderTemplate: "groupHeaderTemplate", itemTemplate: "itemTemplate", barTemplate: "barTemplate", rangeTemplate: "rangeTemplate" }, outputs: { barClick: "barClick", lineClick: "lineClick" }, host: { properties: { "class.gantt-main-container": "this.ganttMainClass" } }, ngImport: i0, template: "<gantt-links-overlay [groups]=\"groups\" [items]=\"items\" (lineClick)=\"lineClick.emit($event)\"></gantt-links-overlay>\n<!-- groups -->\n<div class=\"gantt-main-groups\" *ngIf=\"groups && groups.length > 0; else itemsTemplate\" [style.width.px]=\"ganttUpper.view.width\">\n <ng-container *ngFor=\"let group of groups; trackBy: trackBy\">\n <div class=\"gantt-group\" [ngClass]=\"group.class\">\n <ng-template [ngTemplateOutlet]=\"groupHeaderTemplate\" [ngTemplateOutletContext]=\"{ group: group }\"></ng-template>\n </div>\n <div *ngIf=\"group.expanded\" class=\"gantt-items\">\n <ng-template [ngTemplateOutlet]=\"ganttItems\" [ngTemplateOutletContext]=\"{ items: group.items }\"></ng-template>\n </div>\n </ng-container>\n</div>\n<!-- items -->\n<ng-template #itemsTemplate>\n <div class=\"gantt-main-items\" [style.width.px]=\"ganttUpper.view.width\">\n <ng-template [ngTemplateOutlet]=\"ganttItems\" [ngTemplateOutletContext]=\"{ items: items }\"></ng-template>\n </div>\n</ng-template>\n\n<ng-template #ganttItems let-items=\"items\">\n <ng-container *ngFor=\"let item of items;\">\n <div\n class=\"gantt-item\"\n [style.height.px]=\"ganttUpper.styles.lineHeight\"\n [class.gantt-main-item-active]=\"ganttUpper.isSelected(item.id)\"\n >\n <ng-container *ngIf=\"item.type | isGanttCustomItem\">\n <ng-template [ngTemplateOutlet]=\"itemTemplate\" [ngTemplateOutletContext]=\"{ item: item.origin, refs: item.refs }\"></ng-template>\n </ng-container>\n <gantt-range *ngIf=\"item.type | isGanttRangeItem\" [template]=\"rangeTemplate\" [item]=\"item\"></gantt-range>\n <gantt-bar *ngIf=\"item.type | isGanttBarItem\" [item]=\"item\" [template]=\"barTemplate\" (barClick)=\"barClick.emit($event)\"></gantt-bar>\n </div>\n <ng-template\n *ngIf=\"item.children && item.expanded\"\n [ngTemplateOutlet]=\"ganttItems\"\n [ngTemplateOutletContext]=\"{ items: item.children }\"\n ></ng-template>\n </ng-container>\n</ng-template>\n", components: [{ type: GanttLinksComponent, selector: "gantt-links-overlay", inputs: ["groups", "items"], outputs: ["lineClick"] }, { type: NgxGanttRangeComponent, selector: "ngx-gantt-range,gantt-range" }, { type: NgxGanttBarComponent, selector: "ngx-gantt-bar,gantt-bar", outputs: ["barClick"] }], directives: [{ type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }], pipes: { "isGanttCustomItem": IsGanttCustomItemPipe, "isGanttRangeItem": IsGanttRangeItemPipe, "isGanttBarItem": IsGanttBarItemPipe } });
2815
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: GanttMainComponent, decorators: [{
2902
+ GanttMainComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: GanttMainComponent, deps: [{ token: GANTT_UPPER_TOKEN }], target: i0.ɵɵFactoryTarget.Component });
2903
+ GanttMainComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.3", type: GanttMainComponent, selector: "gantt-main", inputs: { groups: "groups", items: "items", groupHeaderTemplate: "groupHeaderTemplate", itemTemplate: "itemTemplate", barTemplate: "barTemplate", rangeTemplate: "rangeTemplate" }, outputs: { barClick: "barClick", lineClick: "lineClick" }, host: { properties: { "class.gantt-main-container": "this.ganttMainClass" } }, ngImport: i0, template: "<gantt-links-overlay [groups]=\"groups\" [items]=\"items\" (lineClick)=\"lineClick.emit($event)\"></gantt-links-overlay>\n<!-- groups -->\n<div class=\"gantt-main-groups\" *ngIf=\"groups && groups.length > 0; else itemsTemplate\" [style.width.px]=\"ganttUpper.view.width\">\n <ng-container *ngFor=\"let group of groups; trackBy: trackBy\">\n <div class=\"gantt-group\" [ngClass]=\"group.class\">\n <ng-template [ngTemplateOutlet]=\"groupHeaderTemplate\" [ngTemplateOutletContext]=\"{ group: group }\"></ng-template>\n </div>\n <div *ngIf=\"group.expanded\" class=\"gantt-items\">\n <ng-template [ngTemplateOutlet]=\"ganttItems\" [ngTemplateOutletContext]=\"{ items: group.items }\"></ng-template>\n </div>\n </ng-container>\n</div>\n<!-- items -->\n<ng-template #itemsTemplate>\n <div class=\"gantt-main-items\" [style.width.px]=\"ganttUpper.view.width\">\n <ng-template [ngTemplateOutlet]=\"ganttItems\" [ngTemplateOutletContext]=\"{ items: items }\"></ng-template>\n </div>\n</ng-template>\n\n<ng-template #ganttItems let-items=\"items\">\n <ng-container *ngFor=\"let item of items\">\n <div\n class=\"gantt-item\"\n [style.height.px]=\"ganttUpper.styles.lineHeight\"\n [class.gantt-main-item-active]=\"ganttUpper.isSelected(item.id)\"\n >\n <ng-container *ngIf=\"item.type | isGanttCustomItem\">\n <ng-template\n [ngTemplateOutlet]=\"itemTemplate\"\n [ngTemplateOutletContext]=\"{\n item: item.origin,\n refs: item.refs,\n baseline: ganttUpper.baselineItemsMap[item.id]?.origin,\n baselineRefs: ganttUpper.baselineItemsMap[item.id]?.refs\n }\"\n >\n </ng-template>\n </ng-container>\n\n <ng-container *ngIf=\"(item.type | isGanttRangeItem) || (item.type | isGanttBarItem)\">\n <gantt-range *ngIf=\"item.type | isGanttRangeItem\" [template]=\"rangeTemplate\" [item]=\"item\"></gantt-range>\n <gantt-bar *ngIf=\"item.type | isGanttBarItem\" [item]=\"item\" [template]=\"barTemplate\" (barClick)=\"barClick.emit($event)\"></gantt-bar>\n <gantt-baseline *ngIf=\"ganttUpper.baselineItemsMap[item.id]\" [baselineItem]=\"ganttUpper.baselineItemsMap[item.id]\"></gantt-baseline>\n </ng-container>\n </div>\n <ng-template\n *ngIf=\"item.children && item.expanded\"\n [ngTemplateOutlet]=\"ganttItems\"\n [ngTemplateOutletContext]=\"{ items: item.children }\"\n ></ng-template>\n </ng-container>\n</ng-template>\n", dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: GanttLinksComponent, selector: "gantt-links-overlay", inputs: ["groups", "items"], outputs: ["lineClick"] }, { kind: "component", type: NgxGanttBarComponent, selector: "ngx-gantt-bar,gantt-bar", outputs: ["barClick"] }, { kind: "component", type: NgxGanttRangeComponent, selector: "ngx-gantt-range,gantt-range" }, { kind: "component", type: NgxGanttBaselineComponent, selector: "ngx-gantt-baseline,gantt-baseline", inputs: ["baselineItem"] }, { kind: "pipe", type: IsGanttRangeItemPipe, name: "isGanttRangeItem" }, { kind: "pipe", type: IsGanttBarItemPipe, name: "isGanttBarItem" }, { kind: "pipe", type: IsGanttCustomItemPipe, name: "isGanttCustomItem" }] });
2904
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: GanttMainComponent, decorators: [{
2816
2905
  type: Component,
2817
- args: [{ selector: 'gantt-main', template: "<gantt-links-overlay [groups]=\"groups\" [items]=\"items\" (lineClick)=\"lineClick.emit($event)\"></gantt-links-overlay>\n<!-- groups -->\n<div class=\"gantt-main-groups\" *ngIf=\"groups && groups.length > 0; else itemsTemplate\" [style.width.px]=\"ganttUpper.view.width\">\n <ng-container *ngFor=\"let group of groups; trackBy: trackBy\">\n <div class=\"gantt-group\" [ngClass]=\"group.class\">\n <ng-template [ngTemplateOutlet]=\"groupHeaderTemplate\" [ngTemplateOutletContext]=\"{ group: group }\"></ng-template>\n </div>\n <div *ngIf=\"group.expanded\" class=\"gantt-items\">\n <ng-template [ngTemplateOutlet]=\"ganttItems\" [ngTemplateOutletContext]=\"{ items: group.items }\"></ng-template>\n </div>\n </ng-container>\n</div>\n<!-- items -->\n<ng-template #itemsTemplate>\n <div class=\"gantt-main-items\" [style.width.px]=\"ganttUpper.view.width\">\n <ng-template [ngTemplateOutlet]=\"ganttItems\" [ngTemplateOutletContext]=\"{ items: items }\"></ng-template>\n </div>\n</ng-template>\n\n<ng-template #ganttItems let-items=\"items\">\n <ng-container *ngFor=\"let item of items;\">\n <div\n class=\"gantt-item\"\n [style.height.px]=\"ganttUpper.styles.lineHeight\"\n [class.gantt-main-item-active]=\"ganttUpper.isSelected(item.id)\"\n >\n <ng-container *ngIf=\"item.type | isGanttCustomItem\">\n <ng-template [ngTemplateOutlet]=\"itemTemplate\" [ngTemplateOutletContext]=\"{ item: item.origin, refs: item.refs }\"></ng-template>\n </ng-container>\n <gantt-range *ngIf=\"item.type | isGanttRangeItem\" [template]=\"rangeTemplate\" [item]=\"item\"></gantt-range>\n <gantt-bar *ngIf=\"item.type | isGanttBarItem\" [item]=\"item\" [template]=\"barTemplate\" (barClick)=\"barClick.emit($event)\"></gantt-bar>\n </div>\n <ng-template\n *ngIf=\"item.children && item.expanded\"\n [ngTemplateOutlet]=\"ganttItems\"\n [ngTemplateOutletContext]=\"{ items: item.children }\"\n ></ng-template>\n </ng-container>\n</ng-template>\n" }]
2906
+ args: [{ selector: 'gantt-main', template: "<gantt-links-overlay [groups]=\"groups\" [items]=\"items\" (lineClick)=\"lineClick.emit($event)\"></gantt-links-overlay>\n<!-- groups -->\n<div class=\"gantt-main-groups\" *ngIf=\"groups && groups.length > 0; else itemsTemplate\" [style.width.px]=\"ganttUpper.view.width\">\n <ng-container *ngFor=\"let group of groups; trackBy: trackBy\">\n <div class=\"gantt-group\" [ngClass]=\"group.class\">\n <ng-template [ngTemplateOutlet]=\"groupHeaderTemplate\" [ngTemplateOutletContext]=\"{ group: group }\"></ng-template>\n </div>\n <div *ngIf=\"group.expanded\" class=\"gantt-items\">\n <ng-template [ngTemplateOutlet]=\"ganttItems\" [ngTemplateOutletContext]=\"{ items: group.items }\"></ng-template>\n </div>\n </ng-container>\n</div>\n<!-- items -->\n<ng-template #itemsTemplate>\n <div class=\"gantt-main-items\" [style.width.px]=\"ganttUpper.view.width\">\n <ng-template [ngTemplateOutlet]=\"ganttItems\" [ngTemplateOutletContext]=\"{ items: items }\"></ng-template>\n </div>\n</ng-template>\n\n<ng-template #ganttItems let-items=\"items\">\n <ng-container *ngFor=\"let item of items\">\n <div\n class=\"gantt-item\"\n [style.height.px]=\"ganttUpper.styles.lineHeight\"\n [class.gantt-main-item-active]=\"ganttUpper.isSelected(item.id)\"\n >\n <ng-container *ngIf=\"item.type | isGanttCustomItem\">\n <ng-template\n [ngTemplateOutlet]=\"itemTemplate\"\n [ngTemplateOutletContext]=\"{\n item: item.origin,\n refs: item.refs,\n baseline: ganttUpper.baselineItemsMap[item.id]?.origin,\n baselineRefs: ganttUpper.baselineItemsMap[item.id]?.refs\n }\"\n >\n </ng-template>\n </ng-container>\n\n <ng-container *ngIf=\"(item.type | isGanttRangeItem) || (item.type | isGanttBarItem)\">\n <gantt-range *ngIf=\"item.type | isGanttRangeItem\" [template]=\"rangeTemplate\" [item]=\"item\"></gantt-range>\n <gantt-bar *ngIf=\"item.type | isGanttBarItem\" [item]=\"item\" [template]=\"barTemplate\" (barClick)=\"barClick.emit($event)\"></gantt-bar>\n <gantt-baseline *ngIf=\"ganttUpper.baselineItemsMap[item.id]\" [baselineItem]=\"ganttUpper.baselineItemsMap[item.id]\"></gantt-baseline>\n </ng-container>\n </div>\n <ng-template\n *ngIf=\"item.children && item.expanded\"\n [ngTemplateOutlet]=\"ganttItems\"\n [ngTemplateOutletContext]=\"{ items: item.children }\"\n ></ng-template>\n </ng-container>\n</ng-template>\n" }]
2818
2907
  }], ctorParameters: function () { return [{ type: GanttUpper, decorators: [{
2819
2908
  type: Inject,
2820
2909
  args: [GANTT_UPPER_TOKEN]
@@ -2920,9 +3009,15 @@ class NgxGanttComponent extends GanttUpper {
2920
3009
  this.selectedChange.emit({ event, selectedValue: _selectedValue });
2921
3010
  }
2922
3011
  }
3012
+ scrollToToday() {
3013
+ this.ganttRoot.scrollToToday();
3014
+ }
3015
+ scrollToDate(date) {
3016
+ this.ganttRoot.scrollToDate(date);
3017
+ }
2923
3018
  }
2924
- NgxGanttComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: NgxGanttComponent, deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }, { token: i0.NgZone }, { token: GANTT_GLOBAL_CONFIG }], target: i0.ɵɵFactoryTarget.Component });
2925
- NgxGanttComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.8", type: NgxGanttComponent, selector: "ngx-gantt", inputs: { maxLevel: "maxLevel", async: "async", childrenResolve: "childrenResolve", linkable: "linkable" }, outputs: { linkDragStarted: "linkDragStarted", linkDragEnded: "linkDragEnded", lineClick: "lineClick", selectedChange: "selectedChange" }, providers: [
3019
+ NgxGanttComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: NgxGanttComponent, deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }, { token: i0.NgZone }, { token: GANTT_GLOBAL_CONFIG }], target: i0.ɵɵFactoryTarget.Component });
3020
+ NgxGanttComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.3", type: NgxGanttComponent, selector: "ngx-gantt", inputs: { maxLevel: "maxLevel", async: "async", childrenResolve: "childrenResolve", linkable: "linkable" }, outputs: { linkDragStarted: "linkDragStarted", linkDragEnded: "linkDragEnded", lineClick: "lineClick", selectedChange: "selectedChange" }, providers: [
2926
3021
  {
2927
3022
  provide: GANTT_UPPER_TOKEN,
2928
3023
  useExisting: NgxGanttComponent
@@ -2931,8 +3026,8 @@ NgxGanttComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", vers
2931
3026
  provide: GANTT_ABSTRACT_TOKEN,
2932
3027
  useExisting: forwardRef(() => NgxGanttComponent)
2933
3028
  }
2934
- ], queries: [{ propertyName: "table", first: true, predicate: NgxGanttTableComponent, descendants: true }, { propertyName: "tableEmptyTemplate", first: true, predicate: ["tableEmpty"], descendants: true, static: true }, { propertyName: "columns", predicate: NgxGanttTableColumnComponent, descendants: true }], viewQueries: [{ propertyName: "ganttRoot", first: true, predicate: ["ganttRoot"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<ngx-gantt-root #ganttRoot>\n <ng-template #sideTemplate>\n <gantt-table\n [groups]=\"groups\"\n [items]=\"items\"\n [columns]=\"columns\"\n [groupTemplate]=\"groupTemplate\"\n [emptyTemplate]=\"tableEmptyTemplate\"\n [rowBeforeTemplate]=\"table?.rowBeforeTemplate\"\n [rowAfterTemplate]=\"table?.rowAfterTemplate\"\n (itemClick)=\"selectItem($event)\"\n ></gantt-table>\n </ng-template>\n <ng-template #mainTemplate>\n <gantt-main\n [groups]=\"groups\"\n [items]=\"items\"\n [groupHeaderTemplate]=\"groupHeaderTemplate\"\n [itemTemplate]=\"itemTemplate\"\n [barTemplate]=\"barTemplate\"\n [rangeTemplate]=\"rangeTemplate\"\n (barClick)=\"barClick.emit($event)\"\n (lineClick)=\"lineClick.emit($event)\"\n >\n </gantt-main>\n </ng-template>\n</ngx-gantt-root>\n", components: [{ type: NgxGanttRootComponent, selector: "ngx-gantt-root", inputs: ["sideWidth"] }, { type: GanttTableComponent, selector: "gantt-table", inputs: ["groups", "items", "columns", "groupTemplate", "emptyTemplate", "rowBeforeTemplate", "rowAfterTemplate"], outputs: ["itemClick"] }, { type: GanttMainComponent, selector: "gantt-main", inputs: ["groups", "items", "groupHeaderTemplate", "itemTemplate", "barTemplate", "rangeTemplate"], outputs: ["barClick", "lineClick"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2935
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: NgxGanttComponent, decorators: [{
3029
+ ], queries: [{ propertyName: "table", first: true, predicate: NgxGanttTableComponent, descendants: true }, { propertyName: "tableEmptyTemplate", first: true, predicate: ["tableEmpty"], descendants: true, static: true }, { propertyName: "columns", predicate: NgxGanttTableColumnComponent, descendants: true }], viewQueries: [{ propertyName: "ganttRoot", first: true, predicate: ["ganttRoot"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<ngx-gantt-root #ganttRoot>\n <ng-template #sideTemplate>\n <gantt-table\n [groups]=\"groups\"\n [items]=\"items\"\n [columns]=\"columns\"\n [groupTemplate]=\"groupTemplate\"\n [emptyTemplate]=\"tableEmptyTemplate\"\n [rowBeforeTemplate]=\"table?.rowBeforeTemplate\"\n [rowAfterTemplate]=\"table?.rowAfterTemplate\"\n (itemClick)=\"selectItem($event)\"\n ></gantt-table>\n </ng-template>\n <ng-template #mainTemplate>\n <gantt-main\n [groups]=\"groups\"\n [items]=\"items\"\n [groupHeaderTemplate]=\"groupHeaderTemplate\"\n [itemTemplate]=\"itemTemplate\"\n [barTemplate]=\"barTemplate\"\n [rangeTemplate]=\"rangeTemplate\"\n (barClick)=\"barClick.emit($event)\"\n (lineClick)=\"lineClick.emit($event)\"\n >\n </gantt-main>\n </ng-template>\n</ngx-gantt-root>\n", dependencies: [{ kind: "component", type: GanttTableComponent, selector: "gantt-table", inputs: ["groups", "items", "columns", "groupTemplate", "emptyTemplate", "rowBeforeTemplate", "rowAfterTemplate"], outputs: ["itemClick"] }, { kind: "component", type: GanttMainComponent, selector: "gantt-main", inputs: ["groups", "items", "groupHeaderTemplate", "itemTemplate", "barTemplate", "rangeTemplate"], outputs: ["barClick", "lineClick"] }, { kind: "component", type: NgxGanttRootComponent, selector: "ngx-gantt-root", inputs: ["sideWidth"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
3030
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: NgxGanttComponent, decorators: [{
2936
3031
  type: Component,
2937
3032
  args: [{ selector: 'ngx-gantt', changeDetection: ChangeDetectionStrategy.OnPush, providers: [
2938
3033
  {
@@ -2979,8 +3074,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImpor
2979
3074
 
2980
3075
  class NgxGanttModule {
2981
3076
  }
2982
- NgxGanttModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: NgxGanttModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2983
- NgxGanttModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: NgxGanttModule, declarations: [NgxGanttComponent,
3077
+ NgxGanttModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: NgxGanttModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
3078
+ NgxGanttModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.1.3", ngImport: i0, type: NgxGanttModule, declarations: [NgxGanttComponent,
2984
3079
  NgxGanttTableComponent,
2985
3080
  NgxGanttTableColumnComponent,
2986
3081
  GanttTableComponent,
@@ -2992,6 +3087,7 @@ NgxGanttModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version:
2992
3087
  GanttDragBackdropComponent,
2993
3088
  NgxGanttRangeComponent,
2994
3089
  NgxGanttRootComponent,
3090
+ NgxGanttBaselineComponent,
2995
3091
  IsGanttRangeItemPipe,
2996
3092
  IsGanttBarItemPipe,
2997
3093
  IsGanttCustomItemPipe], imports: [CommonModule, DragDropModule], exports: [NgxGanttComponent,
@@ -2999,14 +3095,15 @@ NgxGanttModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version:
2999
3095
  NgxGanttTableColumnComponent,
3000
3096
  NgxGanttRootComponent,
3001
3097
  NgxGanttBarComponent,
3002
- NgxGanttRangeComponent] });
3003
- NgxGanttModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: NgxGanttModule, providers: [
3098
+ NgxGanttRangeComponent,
3099
+ NgxGanttBaselineComponent] });
3100
+ NgxGanttModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: NgxGanttModule, providers: [
3004
3101
  {
3005
3102
  provide: GANTT_GLOBAL_CONFIG,
3006
3103
  useValue: defaultConfig
3007
3104
  }
3008
- ], imports: [[CommonModule, DragDropModule]] });
3009
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: NgxGanttModule, decorators: [{
3105
+ ], imports: [CommonModule, DragDropModule] });
3106
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: NgxGanttModule, decorators: [{
3010
3107
  type: NgModule,
3011
3108
  args: [{
3012
3109
  imports: [CommonModule, DragDropModule],
@@ -3016,7 +3113,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImpor
3016
3113
  NgxGanttTableColumnComponent,
3017
3114
  NgxGanttRootComponent,
3018
3115
  NgxGanttBarComponent,
3019
- NgxGanttRangeComponent
3116
+ NgxGanttRangeComponent,
3117
+ NgxGanttBaselineComponent
3020
3118
  ],
3021
3119
  declarations: [
3022
3120
  NgxGanttComponent,
@@ -3031,6 +3129,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImpor
3031
3129
  GanttDragBackdropComponent,
3032
3130
  NgxGanttRangeComponent,
3033
3131
  NgxGanttRootComponent,
3132
+ NgxGanttBaselineComponent,
3034
3133
  IsGanttRangeItemPipe,
3035
3134
  IsGanttBarItemPipe,
3036
3135
  IsGanttCustomItemPipe
@@ -3052,5 +3151,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImpor
3052
3151
  * Generated bundle index. Do not edit.
3053
3152
  */
3054
3153
 
3055
- export { GANTT_GLOBAL_CONFIG, GANTT_UPPER_TOKEN, GanttBarClickEvent, GanttDate, GanttDatePoint, GanttDragEvent, GanttGroupInternal, GanttItemInternal, GanttItemType, GanttItemUpper, GanttLineClickEvent, GanttLinkDragEvent, GanttLinkLineType, GanttLinkType, GanttLoadOnScrollEvent, GanttPrintService, GanttSelectedEvent, GanttTableEvent, GanttUpper, GanttView, GanttViewType, IsGanttBarItemPipe, IsGanttCustomItemPipe, IsGanttRangeItemPipe, LinkColors, NgxGanttBarComponent, NgxGanttComponent, NgxGanttModule, NgxGanttRangeComponent, NgxGanttRootComponent, NgxGanttTableColumnComponent, NgxGanttTableComponent, defaultConfig, primaryDatePointTop, secondaryDatePointTop };
3154
+ export { GANTT_GLOBAL_CONFIG, GANTT_UPPER_TOKEN, GanttBarClickEvent, GanttBaselineItemInternal, GanttDate, GanttDatePoint, GanttDragEvent, GanttGroupInternal, GanttItemInternal, GanttItemType, GanttItemUpper, GanttLineClickEvent, GanttLinkDragEvent, GanttLinkLineType, GanttLinkType, GanttLoadOnScrollEvent, GanttPrintService, GanttSelectedEvent, GanttTableEvent, GanttUpper, GanttView, GanttViewType, IsGanttBarItemPipe, IsGanttCustomItemPipe, IsGanttRangeItemPipe, LinkColors, NgxGanttBarComponent, NgxGanttBaselineComponent, NgxGanttComponent, NgxGanttModule, NgxGanttRangeComponent, NgxGanttRootComponent, NgxGanttTableColumnComponent, NgxGanttTableComponent, defaultConfig, primaryDatePointTop, secondaryDatePointTop };
3056
3155
  //# sourceMappingURL=worktile-gantt.mjs.map