@worktile/gantt 13.1.2 → 14.0.1

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 (43) hide show
  1. package/components/bar/bar.component.d.ts +1 -1
  2. package/components/baseline/baseline.component.d.ts +1 -1
  3. package/components/calendar/calendar.component.d.ts +1 -1
  4. package/components/drag-backdrop/drag-backdrop.component.d.ts +1 -1
  5. package/components/icon/icon.component.d.ts +1 -1
  6. package/components/links/links.component.d.ts +1 -1
  7. package/components/main/gantt-main.component.d.ts +1 -1
  8. package/components/range/range.component.d.ts +1 -1
  9. package/components/table/gantt-table.component.d.ts +1 -1
  10. package/esm2020/components/bar/bar-drag.mjs +3 -3
  11. package/esm2020/components/bar/bar.component.mjs +3 -3
  12. package/esm2020/components/baseline/baseline.component.mjs +3 -3
  13. package/esm2020/components/calendar/calendar.component.mjs +3 -3
  14. package/esm2020/components/drag-backdrop/drag-backdrop.component.mjs +3 -3
  15. package/esm2020/components/icon/icon.component.mjs +3 -3
  16. package/esm2020/components/links/links.component.mjs +3 -3
  17. package/esm2020/components/main/gantt-main.component.mjs +7 -7
  18. package/esm2020/components/range/range.component.mjs +3 -3
  19. package/esm2020/components/table/gantt-table.component.mjs +6 -6
  20. package/esm2020/gantt-dom.service.mjs +3 -3
  21. package/esm2020/gantt-drag-container.mjs +3 -3
  22. package/esm2020/gantt-item-upper.mjs +3 -3
  23. package/esm2020/gantt-print.service.mjs +3 -3
  24. package/esm2020/gantt-upper.mjs +3 -3
  25. package/esm2020/gantt.component.mjs +7 -7
  26. package/esm2020/gantt.module.mjs +6 -6
  27. package/esm2020/gantt.pipe.mjs +9 -9
  28. package/esm2020/root.component.mjs +6 -6
  29. package/esm2020/table/gantt-column.component.mjs +3 -3
  30. package/esm2020/table/gantt-table.component.mjs +3 -3
  31. package/fesm2015/worktile-gantt.mjs +825 -825
  32. package/fesm2015/worktile-gantt.mjs.map +1 -1
  33. package/fesm2020/worktile-gantt.mjs +807 -807
  34. package/fesm2020/worktile-gantt.mjs.map +1 -1
  35. package/gantt-item-upper.d.ts +1 -1
  36. package/gantt-upper.d.ts +1 -1
  37. package/gantt.component.d.ts +1 -1
  38. package/gantt.pipe.d.ts +3 -3
  39. package/{worktile-gantt.d.ts → index.d.ts} +0 -0
  40. package/package.json +6 -6
  41. package/root.component.d.ts +1 -1
  42. package/table/gantt-column.component.d.ts +1 -1
  43. package/table/gantt-table.component.d.ts +1 -1
@@ -1,16 +1,16 @@
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';
5
+ import { take, takeUntil, skip, debounceTime, map, pairwise, auditTime, startWith, switchMap, finalize } from 'rxjs/operators';
6
6
  import { BehaviorSubject, Subject, from, merge, fromEvent, Observable, EMPTY } 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
- import { __awaiter, __decorate, __param } from 'tslib';
13
+ import { __decorate, __param, __awaiter } from 'tslib';
14
14
 
15
15
  class GanttDatePoint {
16
16
  constructor(start, text, x, y, additions) {
@@ -1092,9 +1092,9 @@ class GanttUpper {
1092
1092
  return this.selectionModel.isSelected(id);
1093
1093
  }
1094
1094
  }
1095
- GanttUpper.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: GanttUpper, deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }, { token: i0.NgZone }, { token: GANTT_GLOBAL_CONFIG }], target: i0.ɵɵFactoryTarget.Directive });
1096
- GanttUpper.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.9", 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 });
1097
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: GanttUpper, decorators: [{
1095
+ 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 });
1096
+ 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 });
1097
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: GanttUpper, decorators: [{
1098
1098
  type: Directive
1099
1099
  }], ctorParameters: function () {
1100
1100
  return [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }, { type: i0.NgZone }, { type: undefined, decorators: [{
@@ -1171,9 +1171,9 @@ class NgxGanttTableColumnComponent {
1171
1171
  this.columnWidth = coerceCssPixelValue(width);
1172
1172
  }
1173
1173
  }
1174
- NgxGanttTableColumnComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: NgxGanttTableColumnComponent, deps: [{ token: GANTT_UPPER_TOKEN }], target: i0.ɵɵFactoryTarget.Component });
1175
- NgxGanttTableColumnComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.9", 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 });
1176
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: NgxGanttTableColumnComponent, decorators: [{
1174
+ 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 });
1175
+ 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 });
1176
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: NgxGanttTableColumnComponent, decorators: [{
1177
1177
  type: Component,
1178
1178
  args: [{
1179
1179
  selector: 'ngx-gantt-column',
@@ -1201,9 +1201,9 @@ class NgxGanttTableComponent {
1201
1201
  this.columnChanges = new EventEmitter();
1202
1202
  }
1203
1203
  }
1204
- NgxGanttTableComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: NgxGanttTableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1205
- NgxGanttTableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.9", 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 });
1206
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: NgxGanttTableComponent, decorators: [{
1204
+ NgxGanttTableComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: NgxGanttTableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1205
+ 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 });
1206
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: NgxGanttTableComponent, decorators: [{
1207
1207
  type: Component,
1208
1208
  args: [{
1209
1209
  selector: 'ngx-gantt-table',
@@ -1341,9 +1341,9 @@ class GanttIconComponent {
1341
1341
  }
1342
1342
  }
1343
1343
  }
1344
- GanttIconComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: GanttIconComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
1345
- GanttIconComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.9", type: GanttIconComponent, selector: "gantt-icon", inputs: { iconName: "iconName" }, host: { properties: { "class.gantt-icon": "this.isIcon" } }, ngImport: i0, template: '', isInline: true });
1346
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: GanttIconComponent, decorators: [{
1344
+ GanttIconComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: GanttIconComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
1345
+ 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 });
1346
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: GanttIconComponent, decorators: [{
1347
1347
  type: Component,
1348
1348
  args: [{
1349
1349
  selector: 'gantt-icon',
@@ -1361,9 +1361,9 @@ class IsGanttRangeItemPipe {
1361
1361
  return value === GanttItemType.range;
1362
1362
  }
1363
1363
  }
1364
- IsGanttRangeItemPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: IsGanttRangeItemPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1365
- IsGanttRangeItemPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: IsGanttRangeItemPipe, name: "isGanttRangeItem" });
1366
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: IsGanttRangeItemPipe, decorators: [{
1364
+ IsGanttRangeItemPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: IsGanttRangeItemPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1365
+ IsGanttRangeItemPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.1.3", ngImport: i0, type: IsGanttRangeItemPipe, name: "isGanttRangeItem" });
1366
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: IsGanttRangeItemPipe, decorators: [{
1367
1367
  type: Pipe,
1368
1368
  args: [{
1369
1369
  name: 'isGanttRangeItem'
@@ -1374,9 +1374,9 @@ class IsGanttBarItemPipe {
1374
1374
  return value === GanttItemType.bar;
1375
1375
  }
1376
1376
  }
1377
- IsGanttBarItemPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: IsGanttBarItemPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1378
- IsGanttBarItemPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: IsGanttBarItemPipe, name: "isGanttBarItem" });
1379
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: IsGanttBarItemPipe, decorators: [{
1377
+ IsGanttBarItemPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: IsGanttBarItemPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1378
+ IsGanttBarItemPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.1.3", ngImport: i0, type: IsGanttBarItemPipe, name: "isGanttBarItem" });
1379
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: IsGanttBarItemPipe, decorators: [{
1380
1380
  type: Pipe,
1381
1381
  args: [{
1382
1382
  name: 'isGanttBarItem'
@@ -1387,9 +1387,9 @@ class IsGanttCustomItemPipe {
1387
1387
  return value === GanttItemType.custom;
1388
1388
  }
1389
1389
  }
1390
- IsGanttCustomItemPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: IsGanttCustomItemPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1391
- IsGanttCustomItemPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: IsGanttCustomItemPipe, name: "isGanttCustomItem" });
1392
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: IsGanttCustomItemPipe, decorators: [{
1390
+ IsGanttCustomItemPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: IsGanttCustomItemPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1391
+ IsGanttCustomItemPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.1.3", ngImport: i0, type: IsGanttCustomItemPipe, name: "isGanttCustomItem" });
1392
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: IsGanttCustomItemPipe, decorators: [{
1393
1393
  type: Pipe,
1394
1394
  args: [{
1395
1395
  name: 'isGanttCustomItem'
@@ -1509,9 +1509,9 @@ class GanttTableComponent {
1509
1509
  return item.id || index;
1510
1510
  }
1511
1511
  }
1512
- GanttTableComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: GanttTableComponent, deps: [{ token: GANTT_ABSTRACT_TOKEN }, { token: GANTT_UPPER_TOKEN }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
1513
- GanttTableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.9", 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 } });
1514
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: GanttTableComponent, decorators: [{
1512
+ 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 });
1513
+ 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" }] });
1514
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: GanttTableComponent, decorators: [{
1515
1515
  type: Component,
1516
1516
  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" }]
1517
1517
  }], ctorParameters: function () {
@@ -1549,164 +1549,202 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.9", ngImpor
1549
1549
  args: ['class.gantt-table-empty']
1550
1550
  }] } });
1551
1551
 
1552
- /** Cached result of whether the user's browser supports passive event listeners. */
1553
- let supportsPassiveEvents;
1554
- /**
1555
- * Checks whether the user's browser supports passive event listeners.
1556
- * See: https://github.com/WICG/EventListenerOptions/blob/gh-pages/explainer.md
1557
- */
1558
- function supportsPassiveEventListeners() {
1559
- if (supportsPassiveEvents == null && typeof window !== 'undefined') {
1560
- try {
1561
- window.addEventListener('test', null, Object.defineProperty({}, 'passive', {
1562
- get: () => (supportsPassiveEvents = true)
1563
- }));
1564
- }
1565
- finally {
1566
- supportsPassiveEvents = supportsPassiveEvents || false;
1552
+ class GanttLinkLine {
1553
+ constructor() { }
1554
+ generatePath(source, target, type) {
1555
+ if (source.before && source.after && target.before && target.after) {
1556
+ let path = '';
1557
+ switch (type) {
1558
+ case GanttLinkType.ss:
1559
+ path = this.generateSSPath(source, target);
1560
+ break;
1561
+ case GanttLinkType.ff:
1562
+ path = this.generateFFPath(source, target);
1563
+ break;
1564
+ case GanttLinkType.sf:
1565
+ path = this.generateFSAndSFPath(source, target, type);
1566
+ break;
1567
+ default:
1568
+ path = this.generateFSAndSFPath(source, target);
1569
+ }
1570
+ return path;
1567
1571
  }
1568
1572
  }
1569
- return supportsPassiveEvents;
1570
- }
1571
- /**
1572
- * Normalizes an `AddEventListener` object to something that can be passed
1573
- * to `addEventListener` on any browser, no matter whether it supports the
1574
- * `options` parameter.
1575
- */
1576
- function normalizePassiveListenerOptions(options) {
1577
- return supportsPassiveEventListeners() ? options : !!options.capture;
1578
1573
  }
1579
- /** Options used to bind passive event listeners. */
1580
- const passiveListenerOptions = normalizePassiveListenerOptions({ passive: true });
1581
1574
 
1582
- const scrollThreshold = 50;
1583
- var ScrollDirection;
1584
- (function (ScrollDirection) {
1585
- ScrollDirection[ScrollDirection["NONE"] = 0] = "NONE";
1586
- ScrollDirection[ScrollDirection["LEFT"] = 1] = "LEFT";
1587
- ScrollDirection[ScrollDirection["RIGHT"] = 2] = "RIGHT";
1588
- })(ScrollDirection || (ScrollDirection = {}));
1589
- class GanttDomService {
1590
- constructor(ngZone, platformId) {
1591
- this.ngZone = ngZone;
1592
- this.platformId = platformId;
1593
- this.unsubscribe$ = new Subject();
1594
- }
1595
- monitorScrollChange() {
1596
- this.ngZone.runOutsideAngular(() => merge(fromEvent(this.mainContainer, 'scroll', passiveListenerOptions), fromEvent(this.sideContainer, 'scroll', passiveListenerOptions))
1597
- .pipe(takeUntil(this.unsubscribe$))
1598
- .subscribe((event) => {
1599
- this.syncScroll(event);
1600
- }));
1601
- // fromEvent(this.mainContainer, 'scroll')
1602
- // .pipe(startWith(), takeUntil(this.unsubscribe$))
1603
- // .subscribe((event) => {
1604
- // // if (this.mainContainer.scrollLeft > 0) {
1605
- // // this.side.classList.add('gantt-side-has-shadow');
1606
- // // } else {
1607
- // // this.side.classList.remove('gantt-side-has-shadow');
1608
- // // }
1609
- // });
1610
- }
1611
- syncScroll(event) {
1612
- const target = event.currentTarget;
1613
- this.calendarOverlay.scrollLeft = this.mainContainer.scrollLeft;
1614
- this.sideContainer.scrollTop = target.scrollTop;
1615
- this.mainContainer.scrollTop = target.scrollTop;
1575
+ let GanttLinkLineCurve = class GanttLinkLineCurve extends GanttLinkLine {
1576
+ constructor(ganttUpper) {
1577
+ super();
1578
+ this.ganttUpper = ganttUpper;
1616
1579
  }
1617
- disableBrowserWheelEvent() {
1618
- const container = this.mainContainer;
1619
- this.ngZone.runOutsideAngular(() => fromEvent(container, 'wheel')
1620
- .pipe(takeUntil(this.unsubscribe$))
1621
- .subscribe((event) => {
1622
- const delta = event.deltaX;
1623
- if (!delta) {
1624
- return;
1625
- }
1626
- if ((container.scrollLeft + container.offsetWidth === container.scrollWidth && delta > 0) ||
1627
- (container.scrollLeft === 0 && delta < 0)) {
1628
- event.preventDefault();
1629
- }
1630
- }));
1580
+ generateSSPath(source, target) {
1581
+ const x1 = source.before.x;
1582
+ const y1 = source.before.y;
1583
+ const x4 = target.before.x;
1584
+ const y4 = target.before.y;
1585
+ const isMirror = y4 > y1 ? 0 : 1;
1586
+ const radius = Math.abs(y4 - y1) / 2;
1587
+ if (x4 > x1) {
1588
+ return `M ${x1} ${y1}
1589
+ A ${radius} ${radius} 0 1 ${isMirror} ${x1} ${y4}
1590
+ L ${x4} ${y4}`;
1591
+ }
1592
+ else {
1593
+ return `M ${x1} ${y1}
1594
+ L ${x4} ${y1}
1595
+ A ${radius} ${radius} 0 1 ${isMirror} ${x4} ${y4}`;
1596
+ }
1631
1597
  }
1632
- initialize(root) {
1633
- this.root = root.nativeElement;
1634
- this.side = this.root.getElementsByClassName('gantt-side')[0];
1635
- this.container = this.root.getElementsByClassName('gantt-container')[0];
1636
- this.sideContainer = this.root.getElementsByClassName('gantt-side-container')[0];
1637
- this.mainContainer = this.root.getElementsByClassName('gantt-main-container')[0];
1638
- this.calendarOverlay = this.root.getElementsByClassName('gantt-calendar-overlay')[0];
1639
- this.monitorScrollChange();
1640
- this.disableBrowserWheelEvent();
1598
+ generateFFPath(source, target) {
1599
+ const x1 = source.after.x;
1600
+ const y1 = source.after.y;
1601
+ const x4 = target.after.x;
1602
+ const y4 = target.after.y;
1603
+ const isMirror = y4 > y1 ? 1 : 0;
1604
+ const radius = Math.abs(y4 - y1) / 2;
1605
+ if (x4 > x1) {
1606
+ return `M ${x1} ${y1}
1607
+ L ${x4} ${y1}
1608
+ A ${radius} ${radius} 0 1 ${isMirror} ${x4} ${y4}`;
1609
+ }
1610
+ else {
1611
+ return `M ${x1} ${y1}
1612
+ A ${radius} ${radius} 0 1 ${isMirror} ${x1} ${y4}
1613
+ L ${x4} ${y4}`;
1614
+ }
1641
1615
  }
1642
- /**
1643
- * @returns An observable that will emit outside the Angular zone. Note, consumers should re-enter the Angular zone
1644
- * to run the change detection if needed.
1645
- */
1646
- getViewerScroll(options) {
1647
- return new Observable((subscriber) => this.ngZone.runOutsideAngular(() => fromEvent(this.mainContainer, 'scroll', options)
1648
- .pipe(map(() => this.mainContainer.scrollLeft), pairwise(), map(([previous, current]) => {
1649
- const event = {
1650
- target: this.mainContainer,
1651
- direction: ScrollDirection.NONE
1652
- };
1653
- if (current - previous < 0) {
1654
- if (this.mainContainer.scrollLeft < scrollThreshold && this.mainContainer.scrollLeft > 0) {
1655
- event.direction = ScrollDirection.LEFT;
1656
- }
1616
+ generateFSAndSFPath(source, target, type) {
1617
+ var _a;
1618
+ let x1 = source.after.x;
1619
+ let y1 = source.after.y;
1620
+ let x4 = target.before.x;
1621
+ let y4 = target.before.y;
1622
+ const bezierWeight = 0.5;
1623
+ if (type === GanttLinkType.sf) {
1624
+ x1 = target.after.x;
1625
+ y1 = target.after.y;
1626
+ x4 = source.before.x;
1627
+ y4 = source.before.y;
1628
+ }
1629
+ let dx = Math.abs(x4 - x1) * bezierWeight;
1630
+ let x2 = x1 + dx;
1631
+ let x3 = x4 - dx;
1632
+ const centerX = (x1 + x4) / 2;
1633
+ const centerY = (y1 + y4) / 2;
1634
+ let controlX = this.ganttUpper.styles.lineHeight / 2;
1635
+ const controlY = this.ganttUpper.styles.lineHeight / 2;
1636
+ if (x1 >= x4) {
1637
+ if (Math.abs(y4 - y1) <= this.ganttUpper.styles.lineHeight) {
1638
+ return `M ${x1} ${y1}
1639
+ C ${x1 + controlX} ${y1} ${x1 + controlX} ${y4 > y1 ? y1 + controlX : y1 - controlX} ${x1} ${y4 > y1 ? y1 + controlY : y1 - controlY}
1640
+ L ${x4} ${y4 > y1 ? y4 - controlY : y4 + controlY}
1641
+ C ${x4 - controlY} ${y4 > y1 ? y4 - controlY : y4 + controlY} ${x4 - controlX} ${y4} ${x4} ${y4}
1642
+ `;
1657
1643
  }
1658
- if (current - previous > 0) {
1659
- if (this.mainContainer.scrollWidth - this.mainContainer.clientWidth - this.mainContainer.scrollLeft <
1660
- scrollThreshold) {
1661
- event.direction = ScrollDirection.RIGHT;
1662
- }
1644
+ else {
1645
+ controlX = this.ganttUpper.styles.lineHeight;
1646
+ return `M ${x1} ${y1}
1647
+ C ${x1 + controlX} ${y1} ${x1 + controlX} ${y4 > y1 ? y1 + controlX : y1 - controlX} ${centerX} ${centerY}
1648
+ C ${x4 - controlX} ${y4 > y1 ? y4 - controlX : y4 + controlX} ${x4 - controlX} ${y4} ${x4} ${y4}
1649
+ `;
1663
1650
  }
1664
- return event;
1665
- }))
1666
- .subscribe(subscriber)));
1667
- }
1668
- getResize() {
1669
- return isPlatformServer(this.platformId) ? EMPTY : fromEvent(window, 'resize').pipe(auditTime(150));
1670
- }
1671
- scrollMainContainer(left) {
1672
- if (isNumber(left)) {
1673
- const scrollLeft = left - this.mainContainer.clientWidth / 2;
1674
- this.mainContainer.scrollLeft = scrollLeft > scrollThreshold ? scrollLeft : 0;
1675
- this.calendarOverlay.scrollLeft = this.mainContainer.scrollLeft;
1676
1651
  }
1652
+ else if (((_a = this.ganttUpper.linkOptions) === null || _a === void 0 ? void 0 : _a.showArrow) && x4 - x1 < 200) {
1653
+ dx = Math.max(Math.abs(y4 - y1) * bezierWeight, 60);
1654
+ x2 = x1 + dx;
1655
+ x3 = x4 - dx;
1656
+ return `M ${x1} ${y1} C ${x2} ${y1} ${x3} ${y4} ${x4} ${y4}`;
1657
+ }
1658
+ return `M ${x1} ${y1} C ${x2} ${y1} ${x3} ${y4} ${x4} ${y4}`;
1677
1659
  }
1678
- ngOnDestroy() {
1679
- this.unsubscribe$.next();
1680
- this.unsubscribe$.complete();
1681
- }
1682
- }
1683
- GanttDomService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: GanttDomService, deps: [{ token: i0.NgZone }, { token: PLATFORM_ID }], target: i0.ɵɵFactoryTarget.Injectable });
1684
- GanttDomService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: GanttDomService });
1685
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: GanttDomService, decorators: [{
1686
- type: Injectable
1687
- }], ctorParameters: function () {
1688
- return [{ type: i0.NgZone }, { type: undefined, decorators: [{
1689
- type: Inject,
1690
- args: [PLATFORM_ID]
1691
- }] }];
1692
- } });
1660
+ };
1661
+ GanttLinkLineCurve = __decorate([
1662
+ __param(0, Inject(GANTT_UPPER_TOKEN))
1663
+ ], GanttLinkLineCurve);
1693
1664
 
1694
- function getDependencyType(path, dependencyTypes) {
1695
- if (dependencyTypes.includes(GanttLinkType.ss) && path.from.pos === InBarPosition.start && path.to.pos === InBarPosition.start) {
1696
- return GanttLinkType.ss;
1697
- }
1698
- if (dependencyTypes.includes(GanttLinkType.ff) && path.from.pos === InBarPosition.finish && path.to.pos === InBarPosition.finish) {
1699
- return GanttLinkType.ff;
1665
+ class GanttLinkLineStraight extends GanttLinkLine {
1666
+ constructor() {
1667
+ super();
1668
+ this.pathControl = 20;
1700
1669
  }
1701
- if (dependencyTypes.includes(GanttLinkType.sf) && path.from.pos === InBarPosition.start && path.to.pos === InBarPosition.finish) {
1702
- return GanttLinkType.sf;
1670
+ generateSSPath(source, target) {
1671
+ const x1 = source.before.x;
1672
+ const y1 = source.before.y;
1673
+ const x4 = target.before.x;
1674
+ const y4 = target.before.y;
1675
+ const control = this.pathControl;
1676
+ return `M ${x1} ${y1}
1677
+ L ${x4 > x1 ? x1 - control : x4 - control} ${y1}
1678
+ L ${x4 > x1 ? x1 - control : x4 - control} ${y4}
1679
+ L ${x4} ${y4}`;
1703
1680
  }
1704
- return GanttLinkType.fs;
1705
- }
1706
- var InBarPosition;
1707
- (function (InBarPosition) {
1708
- InBarPosition["start"] = "start";
1709
- InBarPosition["finish"] = "finish";
1681
+ generateFFPath(source, target) {
1682
+ const x1 = source.after.x;
1683
+ const y1 = source.after.y;
1684
+ const x4 = target.after.x;
1685
+ const y4 = target.after.y;
1686
+ const control = this.pathControl;
1687
+ return `M ${x1} ${y1}
1688
+ L ${x4 > x1 ? x4 + control : x1 + control} ${y1}
1689
+ L ${x4 > x1 ? x4 + control : x1 + control} ${y4}
1690
+ L ${x4} ${y4}`;
1691
+ }
1692
+ generateFSAndSFPath(source, target, type) {
1693
+ let x1 = source.after.x;
1694
+ let y1 = source.after.y;
1695
+ let x4 = target.before.x;
1696
+ let y4 = target.before.y;
1697
+ const control = this.pathControl;
1698
+ if (type === GanttLinkType.sf) {
1699
+ x1 = target.after.x;
1700
+ y1 = target.after.y;
1701
+ x4 = source.before.x;
1702
+ y4 = source.before.y;
1703
+ }
1704
+ if (x4 - x1 >= 40) {
1705
+ return `M ${x1} ${y1}
1706
+ L ${x1 + control} ${y1}
1707
+ L ${x1 + control} ${y4}
1708
+ L ${x4} ${y4}`;
1709
+ }
1710
+ else {
1711
+ return `M ${x1} ${y1}
1712
+ L ${x1 + control} ${y1}
1713
+ L ${x1 + control} ${y4 > y1 ? y1 + control : y1 - control}
1714
+ L ${x4 - control} ${y4 > y1 ? y1 + control : y1 - control}
1715
+ L ${x4 - control} ${y4}
1716
+ L ${x4} ${y4}`;
1717
+ }
1718
+ }
1719
+ }
1720
+
1721
+ function createLineGenerator(type, ganttUpper) {
1722
+ switch (type) {
1723
+ case GanttLinkLineType.curve:
1724
+ return new GanttLinkLineCurve(ganttUpper);
1725
+ case GanttLinkLineType.straight:
1726
+ return new GanttLinkLineStraight();
1727
+ default:
1728
+ throw new Error('gantt link path type invalid');
1729
+ }
1730
+ }
1731
+
1732
+ function getDependencyType(path, dependencyTypes) {
1733
+ if (dependencyTypes.includes(GanttLinkType.ss) && path.from.pos === InBarPosition.start && path.to.pos === InBarPosition.start) {
1734
+ return GanttLinkType.ss;
1735
+ }
1736
+ if (dependencyTypes.includes(GanttLinkType.ff) && path.from.pos === InBarPosition.finish && path.to.pos === InBarPosition.finish) {
1737
+ return GanttLinkType.ff;
1738
+ }
1739
+ if (dependencyTypes.includes(GanttLinkType.sf) && path.from.pos === InBarPosition.start && path.to.pos === InBarPosition.finish) {
1740
+ return GanttLinkType.sf;
1741
+ }
1742
+ return GanttLinkType.fs;
1743
+ }
1744
+ var InBarPosition;
1745
+ (function (InBarPosition) {
1746
+ InBarPosition["start"] = "start";
1747
+ InBarPosition["finish"] = "finish";
1710
1748
  })(InBarPosition || (InBarPosition = {}));
1711
1749
  class GanttDragContainer {
1712
1750
  constructor(ganttUpper) {
@@ -1756,9 +1794,9 @@ class GanttDragContainer {
1756
1794
  this.linkDragPath = { from: null, to: null };
1757
1795
  }
1758
1796
  }
1759
- GanttDragContainer.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: GanttDragContainer, deps: [{ token: GANTT_UPPER_TOKEN }], target: i0.ɵɵFactoryTarget.Injectable });
1760
- GanttDragContainer.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: GanttDragContainer });
1761
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: GanttDragContainer, decorators: [{
1797
+ 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 });
1798
+ GanttDragContainer.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: GanttDragContainer });
1799
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: GanttDragContainer, decorators: [{
1762
1800
  type: Injectable
1763
1801
  }], ctorParameters: function () {
1764
1802
  return [{ type: GanttUpper, decorators: [{
@@ -1767,726 +1805,617 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.9", ngImpor
1767
1805
  }] }];
1768
1806
  } });
1769
1807
 
1770
- class GanttDragBackdropComponent {
1771
- }
1772
- GanttDragBackdropComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: GanttDragBackdropComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1773
- GanttDragBackdropComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.9", 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" });
1774
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: GanttDragBackdropComponent, decorators: [{
1775
- type: Component,
1776
- args: [{ selector: 'gantt-drag-backdrop', host: {
1777
- class: 'gantt-drag-backdrop'
1778
- }, 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" }]
1779
- }] });
1780
-
1781
- class GanttPrintService {
1782
- constructor() { }
1783
- setInlineStyles(targetElem) {
1784
- const svgElements = Array.from(targetElem.getElementsByTagName('svg'));
1785
- for (const svgElement of svgElements) {
1786
- this.recursElementChildren(svgElement);
1787
- }
1788
- }
1789
- recursElementChildren(node) {
1790
- const transformProperties = [
1791
- 'fill',
1792
- 'color',
1793
- 'font-size',
1794
- 'stroke',
1795
- 'font',
1796
- 'text-anchor',
1797
- 'stroke-dasharray',
1798
- 'shape-rendering',
1799
- 'stroke-width'
1800
- ];
1801
- if (!node.style) {
1802
- return;
1803
- }
1804
- const styles = getComputedStyle(node);
1805
- for (const transformProperty of transformProperties) {
1806
- node.style[transformProperty] = styles[transformProperty];
1807
- }
1808
- for (const child of Array.from(node.childNodes)) {
1809
- this.recursElementChildren(child);
1810
- }
1811
- }
1812
- register(root) {
1813
- this.root = root.nativeElement;
1814
- this.mainContainer = this.root.getElementsByClassName('gantt-main-container')[0];
1815
- }
1816
- print(name = 'download', ignoreElementClass) {
1817
- return __awaiter(this, void 0, void 0, function* () {
1818
- const root = this.root;
1819
- const mainContainer = this.mainContainer;
1820
- // set print width
1821
- const printWidth = root.offsetWidth;
1822
- // set print height
1823
- const printHeight = root.offsetHeight - mainContainer.offsetHeight + mainContainer.scrollHeight;
1824
- const html2canvas = (yield import(/* webpackChunkName: 'html2canvas' */ 'html2canvas')).default;
1825
- html2canvas(root, {
1826
- logging: false,
1827
- allowTaint: true,
1828
- useCORS: true,
1829
- width: printWidth,
1830
- height: printHeight,
1831
- ignoreElements: (element) => {
1832
- if (ignoreElementClass && element.classList.contains(ignoreElementClass)) {
1833
- return true;
1834
- }
1835
- if (element.classList.contains('gantt-calendar-today-overlay')) {
1836
- return true;
1837
- }
1838
- },
1839
- onclone: (cloneDocument) => {
1840
- const ganttClass = root.className;
1841
- const cloneGanttDom = cloneDocument.querySelector(`.${ganttClass.replace(/\s+/g, '.')}`);
1842
- const cloneGanttContainerDom = cloneDocument.querySelector('.gantt-container');
1843
- const cloneCalendarOverlay = cloneDocument.querySelector('.gantt-calendar-overlay-main');
1844
- const cloneLinksOverlay = cloneDocument.querySelector('.gantt-links-overlay-main');
1845
- // change targetDom width
1846
- cloneGanttDom.style.width = `${printWidth}px`;
1847
- cloneGanttDom.style.height = `${printHeight}px`;
1848
- cloneGanttDom.style.overflow = `unset`;
1849
- cloneGanttContainerDom.style.backgroundColor = '#fff';
1850
- cloneCalendarOverlay.setAttribute('height', `${printHeight}`);
1851
- cloneCalendarOverlay.setAttribute('style', `background: transparent`);
1852
- if (cloneLinksOverlay) {
1853
- cloneLinksOverlay.setAttribute('height', `${printHeight}`);
1854
- cloneLinksOverlay.setAttribute('style', `height: ${printHeight}px`);
1855
- }
1856
- // setInlineStyles for svg
1857
- this.setInlineStyles(cloneGanttDom);
1858
- }
1859
- }).then((canvas) => {
1860
- const link = document.createElement('a');
1861
- const dataUrl = canvas.toDataURL('image/png');
1862
- link.download = `${name}.png`;
1863
- link.href = dataUrl;
1864
- link.click();
1865
- });
1866
- });
1867
- }
1868
- }
1869
- GanttPrintService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: GanttPrintService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1870
- GanttPrintService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: GanttPrintService });
1871
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: GanttPrintService, decorators: [{
1872
- type: Injectable
1873
- }], ctorParameters: function () { return []; } });
1874
-
1875
- const mainHeight = 5000;
1876
- class GanttCalendarComponent {
1877
- constructor(ganttUpper, ngZone, elementRef) {
1808
+ class GanttLinksComponent {
1809
+ constructor(ganttUpper, cdr, elementRef, ganttDragContainer) {
1878
1810
  this.ganttUpper = ganttUpper;
1879
- this.ngZone = ngZone;
1811
+ this.cdr = cdr;
1880
1812
  this.elementRef = elementRef;
1881
- this.headerHeight = headerHeight;
1882
- this.mainHeight = mainHeight;
1883
- this.todayHeight = todayHeight;
1884
- this.todayWidth = todayWidth;
1885
- this.todayBorderRadius = todayBorderRadius;
1886
- this.viewTypes = GanttViewType;
1887
- this.className = true;
1813
+ this.ganttDragContainer = ganttDragContainer;
1814
+ this.groups = [];
1815
+ this.items = [];
1816
+ this.lineClick = new EventEmitter();
1817
+ this.links = [];
1818
+ this.ganttLinkTypes = GanttLinkType;
1819
+ this.showArrow = false;
1820
+ this.linkItems = [];
1821
+ this.firstChange = true;
1888
1822
  this.unsubscribe$ = new Subject();
1889
- }
1890
- get view() {
1891
- return this.ganttUpper.view;
1892
- }
1893
- setTodayPoint() {
1894
- const x = this.view.getTodayXPoint();
1895
- const today = new GanttDate().getDate();
1896
- const todayEle = this.elementRef.nativeElement.getElementsByClassName('gantt-calendar-today-overlay')[0];
1897
- const rect = this.elementRef.nativeElement.getElementsByClassName('today-rect')[0];
1898
- const line = this.elementRef.nativeElement.getElementsByClassName('today-line')[0];
1899
- if (isNumber(x)) {
1900
- if (rect) {
1901
- rect.style.left = `${x - todayWidth / 2}px`;
1902
- rect.style.top = `${headerHeight - todayHeight}px`;
1903
- rect.innerHTML = today.toString();
1904
- }
1905
- if (line) {
1906
- line.style.left = `${x}px`;
1907
- line.style.top = `${headerHeight}px`;
1908
- line.style.bottom = `${-mainHeight}px`;
1909
- }
1910
- }
1911
- else {
1912
- todayEle.style.display = 'none';
1913
- }
1823
+ this.ganttLinksOverlay = true;
1914
1824
  }
1915
1825
  ngOnInit() {
1916
- // Note: the zone may be nooped through `BootstrapOptions` when bootstrapping the root module. This means
1917
- // the `onStable` will never emit any value.
1918
- const onStable$ = this.ngZone.isStable ? from(Promise.resolve()) : this.ngZone.onStable.pipe(take(1));
1919
- // Normally this isn't in the zone, but it can cause performance regressions for apps
1920
- // using `zone-patch-rxjs` because it'll trigger a change detection when it unsubscribes.
1921
- this.ngZone.runOutsideAngular(() => {
1922
- onStable$.pipe(takeUntil(this.unsubscribe$)).subscribe(() => {
1923
- merge(this.ganttUpper.viewChange, this.ganttUpper.view.start$)
1924
- .pipe(takeUntil(this.unsubscribe$))
1925
- .subscribe(() => {
1926
- this.setTodayPoint();
1927
- });
1928
- });
1826
+ this.linkLine = createLineGenerator(this.ganttUpper.linkOptions.lineType, this.ganttUpper);
1827
+ this.showArrow = this.ganttUpper.linkOptions.showArrow;
1828
+ this.buildLinks();
1829
+ this.firstChange = false;
1830
+ this.ganttDragContainer.dragStarted.pipe(takeUntil(this.unsubscribe$)).subscribe(() => {
1831
+ this.elementRef.nativeElement.style.visibility = 'hidden';
1832
+ });
1833
+ merge(this.ganttUpper.viewChange, this.ganttUpper.expandChange, this.ganttUpper.view.start$, this.ganttUpper.dragEnded, this.ganttUpper.linkDragEnded)
1834
+ .pipe(skip(1), debounceTime(0), takeUntil(this.unsubscribe$))
1835
+ .subscribe(() => {
1836
+ this.elementRef.nativeElement.style.visibility = 'visible';
1837
+ this.buildLinks();
1838
+ this.cdr.detectChanges();
1929
1839
  });
1930
1840
  }
1931
- trackBy(index, point) {
1932
- return point.text || index;
1933
- }
1934
- ngOnDestroy() {
1935
- this.unsubscribe$.next();
1936
- this.unsubscribe$.complete();
1841
+ ngOnChanges() {
1842
+ if (!this.firstChange) {
1843
+ this.buildLinks();
1844
+ }
1937
1845
  }
1938
- }
1939
- GanttCalendarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: GanttCalendarComponent, deps: [{ token: GANTT_UPPER_TOKEN }, { token: i0.NgZone }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
1940
- GanttCalendarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.9", 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"] }] });
1941
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: GanttCalendarComponent, decorators: [{
1942
- type: Component,
1943
- 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" }]
1944
- }], ctorParameters: function () {
1945
- return [{ type: GanttUpper, decorators: [{
1946
- type: Inject,
1947
- args: [GANTT_UPPER_TOKEN]
1948
- }] }, { type: i0.NgZone }, { type: i0.ElementRef }];
1949
- }, propDecorators: { className: [{
1950
- type: HostBinding,
1951
- args: ['class.gantt-calendar-overlay']
1952
- }] } });
1953
-
1954
- class NgxGanttRootComponent {
1955
- constructor(elementRef, ngZone, dom, dragContainer, ganttUpper, printService) {
1956
- this.elementRef = elementRef;
1957
- this.ngZone = ngZone;
1958
- this.dom = dom;
1959
- this.dragContainer = dragContainer;
1960
- this.ganttUpper = ganttUpper;
1961
- this.printService = printService;
1962
- this.unsubscribe$ = new Subject();
1963
- this.ganttUpper.dragContainer = dragContainer;
1964
- }
1965
- get view() {
1966
- return this.ganttUpper.view;
1967
- }
1968
- ngOnInit() {
1969
- // Note: the zone may be nooped through `BootstrapOptions` when bootstrapping the root module. This means
1970
- // the `onStable` will never emit any value.
1971
- const onStable$ = this.ngZone.isStable ? from(Promise.resolve()) : this.ngZone.onStable.pipe(take(1));
1972
- // Normally this isn't in the zone, but it can cause performance regressions for apps
1973
- // using `zone-patch-rxjs` because it'll trigger a change detection when it unsubscribes.
1974
- this.ngZone.runOutsideAngular(() => {
1975
- onStable$.pipe(takeUntil(this.unsubscribe$)).subscribe(() => {
1976
- this.dom.initialize(this.elementRef);
1977
- if (this.printService) {
1978
- this.printService.register(this.elementRef);
1846
+ computeItemPosition() {
1847
+ const lineHeight = this.ganttUpper.styles.lineHeight;
1848
+ const barHeight = this.ganttUpper.styles.barHeight;
1849
+ this.linkItems = [];
1850
+ if (this.groups.length > 0) {
1851
+ let itemNum = 0;
1852
+ let groupNum = 0;
1853
+ this.groups.forEach((group) => {
1854
+ groupNum++;
1855
+ if (group.expanded) {
1856
+ const items = recursiveItems(group.items);
1857
+ items.forEach((item, itemIndex) => {
1858
+ const y = (groupNum + itemNum + itemIndex) * lineHeight + item.refs.y + barHeight / 2;
1859
+ this.linkItems.push(Object.assign(Object.assign({}, item), { before: {
1860
+ x: item.refs.x,
1861
+ y
1862
+ }, after: {
1863
+ x: item.refs.x + item.refs.width,
1864
+ y
1865
+ } }));
1866
+ });
1867
+ itemNum += items.length;
1979
1868
  }
1980
- this.setupScrollClass();
1981
- this.setupResize();
1982
- this.setupViewScroll();
1983
- // 优化初始化时Scroll滚动体验问题,通过透明度解决,默认透明度为0,滚动结束后恢复
1984
- this.elementRef.nativeElement.style.opacity = '1';
1985
- this.ganttUpper.viewChange.pipe(startWith(null), takeUntil(this.unsubscribe$)).subscribe(() => {
1986
- this.scrollToToday();
1987
- });
1988
1869
  });
1989
- });
1990
- }
1991
- ngOnDestroy() {
1992
- this.unsubscribe$.next();
1993
- }
1994
- setupViewScroll() {
1995
- if (this.ganttUpper.disabledLoadOnScroll) {
1996
- return;
1997
1870
  }
1998
- this.dom
1999
- .getViewerScroll(passiveListenerOptions)
2000
- .pipe(takeUntil(this.unsubscribe$))
2001
- .subscribe((event) => {
2002
- if (event.direction === ScrollDirection.LEFT) {
2003
- const dates = this.view.addStartDate();
2004
- if (dates) {
2005
- event.target.scrollLeft += this.view.getDateRangeWidth(dates.start, dates.end);
2006
- if (this.ganttUpper.loadOnScroll.observers) {
2007
- this.ngZone.run(() => this.ganttUpper.loadOnScroll.emit({ start: dates.start.getUnixTime(), end: dates.end.getUnixTime() }));
1871
+ else {
1872
+ const items = recursiveItems(this.items);
1873
+ items.forEach((item, itemIndex) => {
1874
+ const y = itemIndex * lineHeight + item.refs.y + barHeight / 2;
1875
+ this.linkItems.push(Object.assign(Object.assign({}, item), { before: {
1876
+ x: item.refs.x,
1877
+ y
1878
+ }, after: {
1879
+ x: item.refs.x + item.refs.width,
1880
+ y
1881
+ } }));
1882
+ });
1883
+ }
1884
+ }
1885
+ buildLinks() {
1886
+ this.computeItemPosition();
1887
+ this.links = [];
1888
+ this.linkItems.forEach((source) => {
1889
+ if (source.origin.start || source.origin.end) {
1890
+ source.links.forEach((link) => {
1891
+ const target = this.linkItems.find((item) => item.id === link.link);
1892
+ if (target && (target.origin.start || target.origin.end)) {
1893
+ let defaultColor = LinkColors.default;
1894
+ let activeColor = LinkColors.active;
1895
+ if (link.type === GanttLinkType.fs && source.end.getTime() > target.start.getTime()) {
1896
+ defaultColor = LinkColors.blocked;
1897
+ activeColor = LinkColors.blocked;
1898
+ }
1899
+ if (link.color) {
1900
+ if (typeof link.color === 'string') {
1901
+ defaultColor = link.color;
1902
+ activeColor = link.color;
1903
+ }
1904
+ else {
1905
+ defaultColor = link.color.default;
1906
+ activeColor = link.color.active;
1907
+ }
1908
+ }
1909
+ this.links.push({
1910
+ path: this.linkLine.generatePath(source, target, link.type),
1911
+ source: source.origin,
1912
+ target: target.origin,
1913
+ type: link.type,
1914
+ color: defaultColor,
1915
+ defaultColor,
1916
+ activeColor
1917
+ });
2008
1918
  }
2009
- }
2010
- }
2011
- if (event.direction === ScrollDirection.RIGHT) {
2012
- const dates = this.view.addEndDate();
2013
- if (dates && this.ganttUpper.loadOnScroll.observers) {
2014
- this.ngZone.run(() => this.ganttUpper.loadOnScroll.emit({ start: dates.start.getUnixTime(), end: dates.end.getUnixTime() }));
2015
- }
1919
+ });
2016
1920
  }
2017
1921
  });
2018
1922
  }
2019
- setupResize() {
2020
- this.dom
2021
- .getResize()
2022
- .pipe(takeUntil(this.unsubscribe$))
2023
- .subscribe(() => {
2024
- this.setupScrollClass();
1923
+ trackBy(index) {
1924
+ return index;
1925
+ }
1926
+ onLineClick(event, link) {
1927
+ this.lineClick.emit({
1928
+ event,
1929
+ source: link.source,
1930
+ target: link.target
2025
1931
  });
2026
1932
  }
2027
- setupScrollClass() {
2028
- const mainContainer = this.dom.mainContainer;
2029
- const height = mainContainer.offsetHeight;
2030
- const scrollHeight = mainContainer.scrollHeight;
2031
- if (scrollHeight > height) {
2032
- this.elementRef.nativeElement.className = 'gantt gantt-scroll';
2033
- }
2034
- else {
2035
- this.elementRef.nativeElement.className = 'gantt';
1933
+ mouseEnterPath(link, index) {
1934
+ link.color = link.activeColor || link.defaultColor;
1935
+ if (index < this.links.length - 1) {
1936
+ this.links.splice(index, 1);
1937
+ this.links.push(link);
2036
1938
  }
2037
1939
  }
2038
- scrollToToday() {
2039
- const x = this.view.getTodayXPoint();
2040
- this.dom.scrollMainContainer(x);
1940
+ mouseLeavePath(link) {
1941
+ link.color = link.defaultColor;
2041
1942
  }
2042
- scrollToDate(date) {
2043
- let x;
2044
- if (typeof date === 'number') {
2045
- x = this.view.getXPointByDate(new GanttDate(date));
2046
- }
2047
- else {
2048
- x = this.view.getXPointByDate(date);
2049
- }
2050
- this.dom.scrollMainContainer(x);
1943
+ ngOnDestroy() {
1944
+ this.unsubscribe$.next();
1945
+ this.unsubscribe$.complete();
2051
1946
  }
2052
1947
  }
2053
- NgxGanttRootComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.9", 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 });
2054
- NgxGanttRootComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.9", 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"] }] });
2055
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: NgxGanttRootComponent, decorators: [{
1948
+ 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 });
1949
+ 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"] }] });
1950
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: GanttLinksComponent, decorators: [{
2056
1951
  type: Component,
2057
- args: [{ selector: 'ngx-gantt-root', providers: [GanttDomService, GanttDragContainer], host: {
2058
- class: 'gantt'
2059
- }, 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" }]
1952
+ 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" }]
2060
1953
  }], ctorParameters: function () {
2061
- return [{ type: i0.ElementRef }, { type: i0.NgZone }, { type: GanttDomService }, { type: GanttDragContainer }, { type: GanttUpper, decorators: [{
1954
+ return [{ type: GanttUpper, decorators: [{
2062
1955
  type: Inject,
2063
1956
  args: [GANTT_UPPER_TOKEN]
2064
- }] }, { type: GanttPrintService, decorators: [{
2065
- type: Optional
2066
- }] }];
2067
- }, propDecorators: { sideWidth: [{
1957
+ }] }, { type: i0.ChangeDetectorRef }, { type: i0.ElementRef }, { type: GanttDragContainer }];
1958
+ }, propDecorators: { groups: [{
2068
1959
  type: Input
2069
- }], sideTemplate: [{
2070
- type: ContentChild,
2071
- args: ['sideTemplate', { static: true }]
2072
- }], mainTemplate: [{
2073
- type: ContentChild,
2074
- args: ['mainTemplate', { static: true }]
2075
- }], backdrop: [{
2076
- type: ViewChild,
2077
- args: [GanttDragBackdropComponent, { static: true, read: ElementRef }]
1960
+ }], items: [{
1961
+ type: Input
1962
+ }], lineClick: [{
1963
+ type: Output
1964
+ }], ganttLinksOverlay: [{
1965
+ type: HostBinding,
1966
+ args: ['class.gantt-links-overlay']
2078
1967
  }] } });
2079
1968
 
2080
- class GanttLinkLine {
2081
- constructor() { }
2082
- generatePath(source, target, type) {
2083
- if (source.before && source.after && target.before && target.after) {
2084
- let path = '';
2085
- switch (type) {
2086
- case GanttLinkType.ss:
2087
- path = this.generateSSPath(source, target);
2088
- break;
2089
- case GanttLinkType.ff:
2090
- path = this.generateFFPath(source, target);
2091
- break;
2092
- case GanttLinkType.sf:
2093
- path = this.generateFSAndSFPath(source, target, type);
2094
- break;
2095
- default:
2096
- path = this.generateFSAndSFPath(source, target);
2097
- }
2098
- return path;
1969
+ /** Cached result of whether the user's browser supports passive event listeners. */
1970
+ let supportsPassiveEvents;
1971
+ /**
1972
+ * Checks whether the user's browser supports passive event listeners.
1973
+ * See: https://github.com/WICG/EventListenerOptions/blob/gh-pages/explainer.md
1974
+ */
1975
+ function supportsPassiveEventListeners() {
1976
+ if (supportsPassiveEvents == null && typeof window !== 'undefined') {
1977
+ try {
1978
+ window.addEventListener('test', null, Object.defineProperty({}, 'passive', {
1979
+ get: () => (supportsPassiveEvents = true)
1980
+ }));
1981
+ }
1982
+ finally {
1983
+ supportsPassiveEvents = supportsPassiveEvents || false;
2099
1984
  }
2100
1985
  }
1986
+ return supportsPassiveEvents;
1987
+ }
1988
+ /**
1989
+ * Normalizes an `AddEventListener` object to something that can be passed
1990
+ * to `addEventListener` on any browser, no matter whether it supports the
1991
+ * `options` parameter.
1992
+ */
1993
+ function normalizePassiveListenerOptions(options) {
1994
+ return supportsPassiveEventListeners() ? options : !!options.capture;
2101
1995
  }
1996
+ /** Options used to bind passive event listeners. */
1997
+ const passiveListenerOptions = normalizePassiveListenerOptions({ passive: true });
2102
1998
 
2103
- let GanttLinkLineCurve = class GanttLinkLineCurve extends GanttLinkLine {
2104
- constructor(ganttUpper) {
2105
- super();
2106
- this.ganttUpper = ganttUpper;
1999
+ const scrollThreshold = 50;
2000
+ var ScrollDirection;
2001
+ (function (ScrollDirection) {
2002
+ ScrollDirection[ScrollDirection["NONE"] = 0] = "NONE";
2003
+ ScrollDirection[ScrollDirection["LEFT"] = 1] = "LEFT";
2004
+ ScrollDirection[ScrollDirection["RIGHT"] = 2] = "RIGHT";
2005
+ })(ScrollDirection || (ScrollDirection = {}));
2006
+ class GanttDomService {
2007
+ constructor(ngZone, platformId) {
2008
+ this.ngZone = ngZone;
2009
+ this.platformId = platformId;
2010
+ this.unsubscribe$ = new Subject();
2107
2011
  }
2108
- generateSSPath(source, target) {
2109
- const x1 = source.before.x;
2110
- const y1 = source.before.y;
2111
- const x4 = target.before.x;
2112
- const y4 = target.before.y;
2113
- const isMirror = y4 > y1 ? 0 : 1;
2114
- const radius = Math.abs(y4 - y1) / 2;
2115
- if (x4 > x1) {
2116
- return `M ${x1} ${y1}
2117
- A ${radius} ${radius} 0 1 ${isMirror} ${x1} ${y4}
2118
- L ${x4} ${y4}`;
2119
- }
2120
- else {
2121
- return `M ${x1} ${y1}
2122
- L ${x4} ${y1}
2123
- A ${radius} ${radius} 0 1 ${isMirror} ${x4} ${y4}`;
2124
- }
2012
+ monitorScrollChange() {
2013
+ this.ngZone.runOutsideAngular(() => merge(fromEvent(this.mainContainer, 'scroll', passiveListenerOptions), fromEvent(this.sideContainer, 'scroll', passiveListenerOptions))
2014
+ .pipe(takeUntil(this.unsubscribe$))
2015
+ .subscribe((event) => {
2016
+ this.syncScroll(event);
2017
+ }));
2018
+ // fromEvent(this.mainContainer, 'scroll')
2019
+ // .pipe(startWith(), takeUntil(this.unsubscribe$))
2020
+ // .subscribe((event) => {
2021
+ // // if (this.mainContainer.scrollLeft > 0) {
2022
+ // // this.side.classList.add('gantt-side-has-shadow');
2023
+ // // } else {
2024
+ // // this.side.classList.remove('gantt-side-has-shadow');
2025
+ // // }
2026
+ // });
2125
2027
  }
2126
- generateFFPath(source, target) {
2127
- const x1 = source.after.x;
2128
- const y1 = source.after.y;
2129
- const x4 = target.after.x;
2130
- const y4 = target.after.y;
2131
- const isMirror = y4 > y1 ? 1 : 0;
2132
- const radius = Math.abs(y4 - y1) / 2;
2133
- if (x4 > x1) {
2134
- return `M ${x1} ${y1}
2135
- L ${x4} ${y1}
2136
- A ${radius} ${radius} 0 1 ${isMirror} ${x4} ${y4}`;
2137
- }
2138
- else {
2139
- return `M ${x1} ${y1}
2140
- A ${radius} ${radius} 0 1 ${isMirror} ${x1} ${y4}
2141
- L ${x4} ${y4}`;
2142
- }
2028
+ syncScroll(event) {
2029
+ const target = event.currentTarget;
2030
+ this.calendarOverlay.scrollLeft = this.mainContainer.scrollLeft;
2031
+ this.sideContainer.scrollTop = target.scrollTop;
2032
+ this.mainContainer.scrollTop = target.scrollTop;
2143
2033
  }
2144
- generateFSAndSFPath(source, target, type) {
2145
- var _a;
2146
- let x1 = source.after.x;
2147
- let y1 = source.after.y;
2148
- let x4 = target.before.x;
2149
- let y4 = target.before.y;
2150
- const bezierWeight = 0.5;
2151
- if (type === GanttLinkType.sf) {
2152
- x1 = target.after.x;
2153
- y1 = target.after.y;
2154
- x4 = source.before.x;
2155
- y4 = source.before.y;
2156
- }
2157
- let dx = Math.abs(x4 - x1) * bezierWeight;
2158
- let x2 = x1 + dx;
2159
- let x3 = x4 - dx;
2160
- const centerX = (x1 + x4) / 2;
2161
- const centerY = (y1 + y4) / 2;
2162
- let controlX = this.ganttUpper.styles.lineHeight / 2;
2163
- const controlY = this.ganttUpper.styles.lineHeight / 2;
2164
- if (x1 >= x4) {
2165
- if (Math.abs(y4 - y1) <= this.ganttUpper.styles.lineHeight) {
2166
- return `M ${x1} ${y1}
2167
- C ${x1 + controlX} ${y1} ${x1 + controlX} ${y4 > y1 ? y1 + controlX : y1 - controlX} ${x1} ${y4 > y1 ? y1 + controlY : y1 - controlY}
2168
- L ${x4} ${y4 > y1 ? y4 - controlY : y4 + controlY}
2169
- C ${x4 - controlY} ${y4 > y1 ? y4 - controlY : y4 + controlY} ${x4 - controlX} ${y4} ${x4} ${y4}
2170
- `;
2034
+ disableBrowserWheelEvent() {
2035
+ const container = this.mainContainer;
2036
+ this.ngZone.runOutsideAngular(() => fromEvent(container, 'wheel')
2037
+ .pipe(takeUntil(this.unsubscribe$))
2038
+ .subscribe((event) => {
2039
+ const delta = event.deltaX;
2040
+ if (!delta) {
2041
+ return;
2171
2042
  }
2172
- else {
2173
- controlX = this.ganttUpper.styles.lineHeight;
2174
- return `M ${x1} ${y1}
2175
- C ${x1 + controlX} ${y1} ${x1 + controlX} ${y4 > y1 ? y1 + controlX : y1 - controlX} ${centerX} ${centerY}
2176
- C ${x4 - controlX} ${y4 > y1 ? y4 - controlX : y4 + controlX} ${x4 - controlX} ${y4} ${x4} ${y4}
2177
- `;
2043
+ if ((container.scrollLeft + container.offsetWidth === container.scrollWidth && delta > 0) ||
2044
+ (container.scrollLeft === 0 && delta < 0)) {
2045
+ event.preventDefault();
2178
2046
  }
2179
- }
2180
- else if (((_a = this.ganttUpper.linkOptions) === null || _a === void 0 ? void 0 : _a.showArrow) && x4 - x1 < 200) {
2181
- dx = Math.max(Math.abs(y4 - y1) * bezierWeight, 60);
2182
- x2 = x1 + dx;
2183
- x3 = x4 - dx;
2184
- return `M ${x1} ${y1} C ${x2} ${y1} ${x3} ${y4} ${x4} ${y4}`;
2185
- }
2186
- return `M ${x1} ${y1} C ${x2} ${y1} ${x3} ${y4} ${x4} ${y4}`;
2047
+ }));
2187
2048
  }
2188
- };
2189
- GanttLinkLineCurve = __decorate([
2190
- __param(0, Inject(GANTT_UPPER_TOKEN))
2191
- ], GanttLinkLineCurve);
2192
-
2193
- class GanttLinkLineStraight extends GanttLinkLine {
2194
- constructor() {
2195
- super();
2196
- this.pathControl = 20;
2049
+ initialize(root) {
2050
+ this.root = root.nativeElement;
2051
+ this.side = this.root.getElementsByClassName('gantt-side')[0];
2052
+ this.container = this.root.getElementsByClassName('gantt-container')[0];
2053
+ this.sideContainer = this.root.getElementsByClassName('gantt-side-container')[0];
2054
+ this.mainContainer = this.root.getElementsByClassName('gantt-main-container')[0];
2055
+ this.calendarOverlay = this.root.getElementsByClassName('gantt-calendar-overlay')[0];
2056
+ this.monitorScrollChange();
2057
+ this.disableBrowserWheelEvent();
2197
2058
  }
2198
- generateSSPath(source, target) {
2199
- const x1 = source.before.x;
2200
- const y1 = source.before.y;
2201
- const x4 = target.before.x;
2202
- const y4 = target.before.y;
2203
- const control = this.pathControl;
2204
- return `M ${x1} ${y1}
2205
- L ${x4 > x1 ? x1 - control : x4 - control} ${y1}
2206
- L ${x4 > x1 ? x1 - control : x4 - control} ${y4}
2207
- L ${x4} ${y4}`;
2059
+ /**
2060
+ * @returns An observable that will emit outside the Angular zone. Note, consumers should re-enter the Angular zone
2061
+ * to run the change detection if needed.
2062
+ */
2063
+ getViewerScroll(options) {
2064
+ return new Observable((subscriber) => this.ngZone.runOutsideAngular(() => fromEvent(this.mainContainer, 'scroll', options)
2065
+ .pipe(map(() => this.mainContainer.scrollLeft), pairwise(), map(([previous, current]) => {
2066
+ const event = {
2067
+ target: this.mainContainer,
2068
+ direction: ScrollDirection.NONE
2069
+ };
2070
+ if (current - previous < 0) {
2071
+ if (this.mainContainer.scrollLeft < scrollThreshold && this.mainContainer.scrollLeft > 0) {
2072
+ event.direction = ScrollDirection.LEFT;
2073
+ }
2074
+ }
2075
+ if (current - previous > 0) {
2076
+ if (this.mainContainer.scrollWidth - this.mainContainer.clientWidth - this.mainContainer.scrollLeft <
2077
+ scrollThreshold) {
2078
+ event.direction = ScrollDirection.RIGHT;
2079
+ }
2080
+ }
2081
+ return event;
2082
+ }))
2083
+ .subscribe(subscriber)));
2208
2084
  }
2209
- generateFFPath(source, target) {
2210
- const x1 = source.after.x;
2211
- const y1 = source.after.y;
2212
- const x4 = target.after.x;
2213
- const y4 = target.after.y;
2214
- const control = this.pathControl;
2215
- return `M ${x1} ${y1}
2216
- L ${x4 > x1 ? x4 + control : x1 + control} ${y1}
2217
- L ${x4 > x1 ? x4 + control : x1 + control} ${y4}
2218
- L ${x4} ${y4}`;
2085
+ getResize() {
2086
+ return isPlatformServer(this.platformId) ? EMPTY : fromEvent(window, 'resize').pipe(auditTime(150));
2219
2087
  }
2220
- generateFSAndSFPath(source, target, type) {
2221
- let x1 = source.after.x;
2222
- let y1 = source.after.y;
2223
- let x4 = target.before.x;
2224
- let y4 = target.before.y;
2225
- const control = this.pathControl;
2226
- if (type === GanttLinkType.sf) {
2227
- x1 = target.after.x;
2228
- y1 = target.after.y;
2229
- x4 = source.before.x;
2230
- y4 = source.before.y;
2231
- }
2232
- if (x4 - x1 >= 40) {
2233
- return `M ${x1} ${y1}
2234
- L ${x1 + control} ${y1}
2235
- L ${x1 + control} ${y4}
2236
- L ${x4} ${y4}`;
2237
- }
2238
- else {
2239
- return `M ${x1} ${y1}
2240
- L ${x1 + control} ${y1}
2241
- L ${x1 + control} ${y4 > y1 ? y1 + control : y1 - control}
2242
- L ${x4 - control} ${y4 > y1 ? y1 + control : y1 - control}
2243
- L ${x4 - control} ${y4}
2244
- L ${x4} ${y4}`;
2088
+ scrollMainContainer(left) {
2089
+ if (isNumber(left)) {
2090
+ const scrollLeft = left - this.mainContainer.clientWidth / 2;
2091
+ this.mainContainer.scrollLeft = scrollLeft > scrollThreshold ? scrollLeft : 0;
2092
+ this.calendarOverlay.scrollLeft = this.mainContainer.scrollLeft;
2245
2093
  }
2246
2094
  }
2095
+ ngOnDestroy() {
2096
+ this.unsubscribe$.next();
2097
+ this.unsubscribe$.complete();
2098
+ }
2247
2099
  }
2100
+ 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 });
2101
+ GanttDomService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: GanttDomService });
2102
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: GanttDomService, decorators: [{
2103
+ type: Injectable
2104
+ }], ctorParameters: function () {
2105
+ return [{ type: i0.NgZone }, { type: undefined, decorators: [{
2106
+ type: Inject,
2107
+ args: [PLATFORM_ID]
2108
+ }] }];
2109
+ } });
2248
2110
 
2249
- function createLineGenerator(type, ganttUpper) {
2250
- switch (type) {
2251
- case GanttLinkLineType.curve:
2252
- return new GanttLinkLineCurve(ganttUpper);
2253
- case GanttLinkLineType.straight:
2254
- return new GanttLinkLineStraight();
2255
- default:
2256
- throw new Error('gantt link path type invalid');
2257
- }
2111
+ class GanttDragBackdropComponent {
2258
2112
  }
2113
+ GanttDragBackdropComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: GanttDragBackdropComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2114
+ 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" });
2115
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: GanttDragBackdropComponent, decorators: [{
2116
+ type: Component,
2117
+ args: [{ selector: 'gantt-drag-backdrop', host: {
2118
+ class: 'gantt-drag-backdrop'
2119
+ }, 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" }]
2120
+ }] });
2259
2121
 
2260
- class GanttLinksComponent {
2261
- constructor(ganttUpper, cdr, elementRef, ganttDragContainer) {
2262
- this.ganttUpper = ganttUpper;
2263
- this.cdr = cdr;
2264
- this.elementRef = elementRef;
2265
- this.ganttDragContainer = ganttDragContainer;
2266
- this.groups = [];
2267
- this.items = [];
2268
- this.lineClick = new EventEmitter();
2269
- this.links = [];
2270
- this.ganttLinkTypes = GanttLinkType;
2271
- this.showArrow = false;
2272
- this.linkItems = [];
2273
- this.firstChange = true;
2274
- this.unsubscribe$ = new Subject();
2275
- this.ganttLinksOverlay = true;
2276
- }
2277
- ngOnInit() {
2278
- this.linkLine = createLineGenerator(this.ganttUpper.linkOptions.lineType, this.ganttUpper);
2279
- this.showArrow = this.ganttUpper.linkOptions.showArrow;
2280
- this.buildLinks();
2281
- this.firstChange = false;
2282
- this.ganttDragContainer.dragStarted.pipe(takeUntil(this.unsubscribe$)).subscribe(() => {
2283
- this.elementRef.nativeElement.style.visibility = 'hidden';
2284
- });
2285
- merge(this.ganttUpper.viewChange, this.ganttUpper.expandChange, this.ganttUpper.view.start$, this.ganttUpper.dragEnded, this.ganttUpper.linkDragEnded)
2286
- .pipe(skip(1), debounceTime(0), takeUntil(this.unsubscribe$))
2287
- .subscribe(() => {
2288
- this.elementRef.nativeElement.style.visibility = 'visible';
2289
- this.buildLinks();
2290
- this.cdr.detectChanges();
2291
- });
2292
- }
2293
- ngOnChanges() {
2294
- if (!this.firstChange) {
2295
- this.buildLinks();
2122
+ class GanttPrintService {
2123
+ constructor() { }
2124
+ setInlineStyles(targetElem) {
2125
+ const svgElements = Array.from(targetElem.getElementsByTagName('svg'));
2126
+ for (const svgElement of svgElements) {
2127
+ this.recursElementChildren(svgElement);
2296
2128
  }
2297
2129
  }
2298
- computeItemPosition() {
2299
- const lineHeight = this.ganttUpper.styles.lineHeight;
2300
- const barHeight = this.ganttUpper.styles.barHeight;
2301
- this.linkItems = [];
2302
- if (this.groups.length > 0) {
2303
- let itemNum = 0;
2304
- let groupNum = 0;
2305
- this.groups.forEach((group) => {
2306
- groupNum++;
2307
- if (group.expanded) {
2308
- const items = recursiveItems(group.items);
2309
- items.forEach((item, itemIndex) => {
2310
- const y = (groupNum + itemNum + itemIndex) * lineHeight + item.refs.y + barHeight / 2;
2311
- this.linkItems.push(Object.assign(Object.assign({}, item), { before: {
2312
- x: item.refs.x,
2313
- y
2314
- }, after: {
2315
- x: item.refs.x + item.refs.width,
2316
- y
2317
- } }));
2318
- });
2319
- itemNum += items.length;
2320
- }
2321
- });
2130
+ recursElementChildren(node) {
2131
+ const transformProperties = [
2132
+ 'fill',
2133
+ 'color',
2134
+ 'font-size',
2135
+ 'stroke',
2136
+ 'font',
2137
+ 'text-anchor',
2138
+ 'stroke-dasharray',
2139
+ 'shape-rendering',
2140
+ 'stroke-width'
2141
+ ];
2142
+ if (!node.style) {
2143
+ return;
2322
2144
  }
2323
- else {
2324
- const items = recursiveItems(this.items);
2325
- items.forEach((item, itemIndex) => {
2326
- const y = itemIndex * lineHeight + item.refs.y + barHeight / 2;
2327
- this.linkItems.push(Object.assign(Object.assign({}, item), { before: {
2328
- x: item.refs.x,
2329
- y
2330
- }, after: {
2331
- x: item.refs.x + item.refs.width,
2332
- y
2333
- } }));
2334
- });
2145
+ const styles = getComputedStyle(node);
2146
+ for (const transformProperty of transformProperties) {
2147
+ node.style[transformProperty] = styles[transformProperty];
2148
+ }
2149
+ for (const child of Array.from(node.childNodes)) {
2150
+ this.recursElementChildren(child);
2335
2151
  }
2336
2152
  }
2337
- buildLinks() {
2338
- this.computeItemPosition();
2339
- this.links = [];
2340
- this.linkItems.forEach((source) => {
2341
- if (source.origin.start || source.origin.end) {
2342
- source.links.forEach((link) => {
2343
- const target = this.linkItems.find((item) => item.id === link.link);
2344
- if (target && (target.origin.start || target.origin.end)) {
2345
- let defaultColor = LinkColors.default;
2346
- let activeColor = LinkColors.active;
2347
- if (link.type === GanttLinkType.fs && source.end.getTime() > target.start.getTime()) {
2348
- defaultColor = LinkColors.blocked;
2349
- activeColor = LinkColors.blocked;
2350
- }
2351
- if (link.color) {
2352
- if (typeof link.color === 'string') {
2353
- defaultColor = link.color;
2354
- activeColor = link.color;
2355
- }
2356
- else {
2357
- defaultColor = link.color.default;
2358
- activeColor = link.color.active;
2359
- }
2360
- }
2361
- this.links.push({
2362
- path: this.linkLine.generatePath(source, target, link.type),
2363
- source: source.origin,
2364
- target: target.origin,
2365
- type: link.type,
2366
- color: defaultColor,
2367
- defaultColor,
2368
- activeColor
2369
- });
2153
+ register(root) {
2154
+ this.root = root.nativeElement;
2155
+ this.mainContainer = this.root.getElementsByClassName('gantt-main-container')[0];
2156
+ }
2157
+ print(name = 'download', ignoreElementClass) {
2158
+ return __awaiter(this, void 0, void 0, function* () {
2159
+ const root = this.root;
2160
+ const mainContainer = this.mainContainer;
2161
+ // set print width
2162
+ const printWidth = root.offsetWidth;
2163
+ // set print height
2164
+ const printHeight = root.offsetHeight - mainContainer.offsetHeight + mainContainer.scrollHeight;
2165
+ const html2canvas = (yield import(/* webpackChunkName: 'html2canvas' */ 'html2canvas')).default;
2166
+ html2canvas(root, {
2167
+ logging: false,
2168
+ allowTaint: true,
2169
+ useCORS: true,
2170
+ width: printWidth,
2171
+ height: printHeight,
2172
+ ignoreElements: (element) => {
2173
+ if (ignoreElementClass && element.classList.contains(ignoreElementClass)) {
2174
+ return true;
2370
2175
  }
2371
- });
2372
- }
2176
+ if (element.classList.contains('gantt-calendar-today-overlay')) {
2177
+ return true;
2178
+ }
2179
+ },
2180
+ onclone: (cloneDocument) => {
2181
+ const ganttClass = root.className;
2182
+ const cloneGanttDom = cloneDocument.querySelector(`.${ganttClass.replace(/\s+/g, '.')}`);
2183
+ const cloneGanttContainerDom = cloneDocument.querySelector('.gantt-container');
2184
+ const cloneCalendarOverlay = cloneDocument.querySelector('.gantt-calendar-overlay-main');
2185
+ const cloneLinksOverlay = cloneDocument.querySelector('.gantt-links-overlay-main');
2186
+ // change targetDom width
2187
+ cloneGanttDom.style.width = `${printWidth}px`;
2188
+ cloneGanttDom.style.height = `${printHeight}px`;
2189
+ cloneGanttDom.style.overflow = `unset`;
2190
+ cloneGanttContainerDom.style.backgroundColor = '#fff';
2191
+ cloneCalendarOverlay.setAttribute('height', `${printHeight}`);
2192
+ cloneCalendarOverlay.setAttribute('style', `background: transparent`);
2193
+ if (cloneLinksOverlay) {
2194
+ cloneLinksOverlay.setAttribute('height', `${printHeight}`);
2195
+ cloneLinksOverlay.setAttribute('style', `height: ${printHeight}px`);
2196
+ }
2197
+ // setInlineStyles for svg
2198
+ this.setInlineStyles(cloneGanttDom);
2199
+ }
2200
+ }).then((canvas) => {
2201
+ const link = document.createElement('a');
2202
+ const dataUrl = canvas.toDataURL('image/png');
2203
+ link.download = `${name}.png`;
2204
+ link.href = dataUrl;
2205
+ link.click();
2206
+ });
2373
2207
  });
2374
2208
  }
2375
- trackBy(index) {
2376
- return index;
2209
+ }
2210
+ GanttPrintService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: GanttPrintService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
2211
+ GanttPrintService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: GanttPrintService });
2212
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: GanttPrintService, decorators: [{
2213
+ type: Injectable
2214
+ }], ctorParameters: function () { return []; } });
2215
+
2216
+ const mainHeight = 5000;
2217
+ class GanttCalendarComponent {
2218
+ constructor(ganttUpper, ngZone, elementRef) {
2219
+ this.ganttUpper = ganttUpper;
2220
+ this.ngZone = ngZone;
2221
+ this.elementRef = elementRef;
2222
+ this.headerHeight = headerHeight;
2223
+ this.mainHeight = mainHeight;
2224
+ this.todayHeight = todayHeight;
2225
+ this.todayWidth = todayWidth;
2226
+ this.todayBorderRadius = todayBorderRadius;
2227
+ this.viewTypes = GanttViewType;
2228
+ this.className = true;
2229
+ this.unsubscribe$ = new Subject();
2230
+ }
2231
+ get view() {
2232
+ return this.ganttUpper.view;
2233
+ }
2234
+ setTodayPoint() {
2235
+ const x = this.view.getTodayXPoint();
2236
+ const today = new GanttDate().getDate();
2237
+ const todayEle = this.elementRef.nativeElement.getElementsByClassName('gantt-calendar-today-overlay')[0];
2238
+ const rect = this.elementRef.nativeElement.getElementsByClassName('today-rect')[0];
2239
+ const line = this.elementRef.nativeElement.getElementsByClassName('today-line')[0];
2240
+ if (isNumber(x)) {
2241
+ if (rect) {
2242
+ rect.style.left = `${x - todayWidth / 2}px`;
2243
+ rect.style.top = `${headerHeight - todayHeight}px`;
2244
+ rect.innerHTML = today.toString();
2245
+ }
2246
+ if (line) {
2247
+ line.style.left = `${x}px`;
2248
+ line.style.top = `${headerHeight}px`;
2249
+ line.style.bottom = `${-mainHeight}px`;
2250
+ }
2251
+ }
2252
+ else {
2253
+ todayEle.style.display = 'none';
2254
+ }
2377
2255
  }
2378
- onLineClick(event, link) {
2379
- this.lineClick.emit({
2380
- event,
2381
- source: link.source,
2382
- target: link.target
2256
+ ngOnInit() {
2257
+ // Note: the zone may be nooped through `BootstrapOptions` when bootstrapping the root module. This means
2258
+ // the `onStable` will never emit any value.
2259
+ const onStable$ = this.ngZone.isStable ? from(Promise.resolve()) : this.ngZone.onStable.pipe(take(1));
2260
+ // Normally this isn't in the zone, but it can cause performance regressions for apps
2261
+ // using `zone-patch-rxjs` because it'll trigger a change detection when it unsubscribes.
2262
+ this.ngZone.runOutsideAngular(() => {
2263
+ onStable$.pipe(takeUntil(this.unsubscribe$)).subscribe(() => {
2264
+ merge(this.ganttUpper.viewChange, this.ganttUpper.view.start$)
2265
+ .pipe(takeUntil(this.unsubscribe$))
2266
+ .subscribe(() => {
2267
+ this.setTodayPoint();
2268
+ });
2269
+ });
2383
2270
  });
2384
2271
  }
2385
- mouseEnterPath(link, index) {
2386
- link.color = link.activeColor || link.defaultColor;
2387
- if (index < this.links.length - 1) {
2388
- this.links.splice(index, 1);
2389
- this.links.push(link);
2390
- }
2391
- }
2392
- mouseLeavePath(link) {
2393
- link.color = link.defaultColor;
2272
+ trackBy(index, point) {
2273
+ return point.text || index;
2394
2274
  }
2395
2275
  ngOnDestroy() {
2396
2276
  this.unsubscribe$.next();
2397
2277
  this.unsubscribe$.complete();
2398
2278
  }
2399
2279
  }
2400
- GanttLinksComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: GanttLinksComponent, deps: [{ token: GANTT_UPPER_TOKEN }, { token: i0.ChangeDetectorRef }, { token: i0.ElementRef }, { token: GanttDragContainer }], target: i0.ɵɵFactoryTarget.Component });
2401
- GanttLinksComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.9", 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"] }] });
2402
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: GanttLinksComponent, decorators: [{
2280
+ 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 });
2281
+ 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"] }] });
2282
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: GanttCalendarComponent, decorators: [{
2403
2283
  type: Component,
2404
- 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" }]
2284
+ 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" }]
2405
2285
  }], ctorParameters: function () {
2406
2286
  return [{ type: GanttUpper, decorators: [{
2407
2287
  type: Inject,
2408
2288
  args: [GANTT_UPPER_TOKEN]
2409
- }] }, { type: i0.ChangeDetectorRef }, { type: i0.ElementRef }, { type: GanttDragContainer }];
2410
- }, propDecorators: { groups: [{
2411
- type: Input
2412
- }], items: [{
2413
- type: Input
2414
- }], lineClick: [{
2415
- type: Output
2416
- }], ganttLinksOverlay: [{
2289
+ }] }, { type: i0.NgZone }, { type: i0.ElementRef }];
2290
+ }, propDecorators: { className: [{
2417
2291
  type: HostBinding,
2418
- args: ['class.gantt-links-overlay']
2292
+ args: ['class.gantt-calendar-overlay']
2419
2293
  }] } });
2420
2294
 
2421
- class GanttItemUpper {
2422
- constructor(elementRef, ganttUpper) {
2295
+ class NgxGanttRootComponent {
2296
+ constructor(elementRef, ngZone, dom, dragContainer, ganttUpper, printService) {
2423
2297
  this.elementRef = elementRef;
2298
+ this.ngZone = ngZone;
2299
+ this.dom = dom;
2300
+ this.dragContainer = dragContainer;
2424
2301
  this.ganttUpper = ganttUpper;
2425
- this.firstChange = true;
2302
+ this.printService = printService;
2426
2303
  this.unsubscribe$ = new Subject();
2304
+ this.ganttUpper.dragContainer = dragContainer;
2305
+ }
2306
+ get view() {
2307
+ return this.ganttUpper.view;
2427
2308
  }
2428
2309
  ngOnInit() {
2429
- this.firstChange = false;
2430
- this.item.refs$.pipe(takeUntil(this.unsubscribe$)).subscribe(() => {
2431
- this.setPositions();
2310
+ // Note: the zone may be nooped through `BootstrapOptions` when bootstrapping the root module. This means
2311
+ // the `onStable` will never emit any value.
2312
+ const onStable$ = this.ngZone.isStable ? from(Promise.resolve()) : this.ngZone.onStable.pipe(take(1));
2313
+ // Normally this isn't in the zone, but it can cause performance regressions for apps
2314
+ // using `zone-patch-rxjs` because it'll trigger a change detection when it unsubscribes.
2315
+ this.ngZone.runOutsideAngular(() => {
2316
+ onStable$.pipe(takeUntil(this.unsubscribe$)).subscribe(() => {
2317
+ this.dom.initialize(this.elementRef);
2318
+ if (this.printService) {
2319
+ this.printService.register(this.elementRef);
2320
+ }
2321
+ this.setupScrollClass();
2322
+ this.setupResize();
2323
+ this.setupViewScroll();
2324
+ // 优化初始化时Scroll滚动体验问题,通过透明度解决,默认透明度为0,滚动结束后恢复
2325
+ this.elementRef.nativeElement.style.opacity = '1';
2326
+ this.ganttUpper.viewChange.pipe(startWith(null), takeUntil(this.unsubscribe$)).subscribe(() => {
2327
+ this.scrollToToday();
2328
+ });
2329
+ });
2432
2330
  });
2433
2331
  }
2434
- ngOnChanges() {
2435
- if (!this.firstChange) {
2436
- this.setPositions();
2332
+ ngOnDestroy() {
2333
+ this.unsubscribe$.next();
2334
+ }
2335
+ setupViewScroll() {
2336
+ if (this.ganttUpper.disabledLoadOnScroll) {
2337
+ return;
2437
2338
  }
2339
+ this.dom
2340
+ .getViewerScroll(passiveListenerOptions)
2341
+ .pipe(takeUntil(this.unsubscribe$))
2342
+ .subscribe((event) => {
2343
+ if (event.direction === ScrollDirection.LEFT) {
2344
+ const dates = this.view.addStartDate();
2345
+ if (dates) {
2346
+ event.target.scrollLeft += this.view.getDateRangeWidth(dates.start, dates.end);
2347
+ if (this.ganttUpper.loadOnScroll.observers) {
2348
+ this.ngZone.run(() => this.ganttUpper.loadOnScroll.emit({ start: dates.start.getUnixTime(), end: dates.end.getUnixTime() }));
2349
+ }
2350
+ }
2351
+ }
2352
+ if (event.direction === ScrollDirection.RIGHT) {
2353
+ const dates = this.view.addEndDate();
2354
+ if (dates && this.ganttUpper.loadOnScroll.observers) {
2355
+ this.ngZone.run(() => this.ganttUpper.loadOnScroll.emit({ start: dates.start.getUnixTime(), end: dates.end.getUnixTime() }));
2356
+ }
2357
+ }
2358
+ });
2438
2359
  }
2439
- setPositions() {
2440
- const itemElement = this.elementRef.nativeElement;
2441
- itemElement.style.left = this.item.refs.x + 'px';
2442
- itemElement.style.top = this.item.refs.y + 'px';
2443
- itemElement.style.width = this.item.refs.width + 'px';
2444
- if (this.item.type === GanttItemType.bar) {
2445
- itemElement.style.height = this.ganttUpper.styles.barHeight + 'px';
2360
+ setupResize() {
2361
+ this.dom
2362
+ .getResize()
2363
+ .pipe(takeUntil(this.unsubscribe$))
2364
+ .subscribe(() => {
2365
+ this.setupScrollClass();
2366
+ });
2367
+ }
2368
+ setupScrollClass() {
2369
+ const mainContainer = this.dom.mainContainer;
2370
+ const height = mainContainer.offsetHeight;
2371
+ const scrollHeight = mainContainer.scrollHeight;
2372
+ if (scrollHeight > height) {
2373
+ this.elementRef.nativeElement.className = 'gantt gantt-scroll';
2446
2374
  }
2447
- else if (this.item.type === GanttItemType.range) {
2448
- itemElement.style.height = rangeHeight + 'px';
2375
+ else {
2376
+ this.elementRef.nativeElement.className = 'gantt';
2449
2377
  }
2450
2378
  }
2451
- ngOnDestroy() {
2452
- this.unsubscribe$.next();
2453
- this.unsubscribe$.complete();
2379
+ scrollToToday() {
2380
+ const x = this.view.getTodayXPoint();
2381
+ this.dom.scrollMainContainer(x);
2454
2382
  }
2455
- }
2456
- GanttItemUpper.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: GanttItemUpper, deps: [{ token: i0.ElementRef }, { token: GANTT_UPPER_TOKEN }], target: i0.ɵɵFactoryTarget.Directive });
2457
- GanttItemUpper.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.9", type: GanttItemUpper, inputs: { template: "template", item: "item" }, usesOnChanges: true, ngImport: i0 });
2458
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: GanttItemUpper, decorators: [{
2459
- type: Directive
2460
- }], ctorParameters: function () {
2461
- return [{ type: i0.ElementRef }, { type: GanttUpper, decorators: [{
2462
- type: Inject,
2463
- args: [GANTT_UPPER_TOKEN]
2464
- }] }];
2465
- }, propDecorators: { template: [{
2466
- type: Input
2467
- }], item: [{
2468
- type: Input
2469
- }] } });
2470
-
2471
- class NgxGanttRangeComponent extends GanttItemUpper {
2472
- constructor(elementRef, ganttUpper) {
2473
- super(elementRef, ganttUpper);
2474
- this.ganttRangeClass = true;
2383
+ scrollToDate(date) {
2384
+ let x;
2385
+ if (typeof date === 'number') {
2386
+ x = this.view.getXPointByDate(new GanttDate(date));
2387
+ }
2388
+ else {
2389
+ x = this.view.getXPointByDate(date);
2390
+ }
2391
+ this.dom.scrollMainContainer(x);
2475
2392
  }
2476
2393
  }
2477
- NgxGanttRangeComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: NgxGanttRangeComponent, deps: [{ token: i0.ElementRef }, { token: GANTT_UPPER_TOKEN }], target: i0.ɵɵFactoryTarget.Component });
2478
- NgxGanttRangeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.9", 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"] }] });
2479
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: NgxGanttRangeComponent, decorators: [{
2394
+ 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 });
2395
+ 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" }] });
2396
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: NgxGanttRootComponent, decorators: [{
2480
2397
  type: Component,
2481
- 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" }]
2398
+ args: [{ selector: 'ngx-gantt-root', providers: [GanttDomService, GanttDragContainer], host: {
2399
+ class: 'gantt'
2400
+ }, 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" }]
2482
2401
  }], ctorParameters: function () {
2483
- return [{ type: i0.ElementRef }, { type: GanttUpper, decorators: [{
2402
+ return [{ type: i0.ElementRef }, { type: i0.NgZone }, { type: GanttDomService }, { type: GanttDragContainer }, { type: GanttUpper, decorators: [{
2484
2403
  type: Inject,
2485
2404
  args: [GANTT_UPPER_TOKEN]
2405
+ }] }, { type: GanttPrintService, decorators: [{
2406
+ type: Optional
2486
2407
  }] }];
2487
- }, propDecorators: { ganttRangeClass: [{
2488
- type: HostBinding,
2489
- args: ['class.gantt-range']
2408
+ }, propDecorators: { sideWidth: [{
2409
+ type: Input
2410
+ }], sideTemplate: [{
2411
+ type: ContentChild,
2412
+ args: ['sideTemplate', { static: true }]
2413
+ }], mainTemplate: [{
2414
+ type: ContentChild,
2415
+ args: ['mainTemplate', { static: true }]
2416
+ }], backdrop: [{
2417
+ type: ViewChild,
2418
+ args: [GanttDragBackdropComponent, { static: true, read: ElementRef }]
2490
2419
  }] } });
2491
2420
 
2492
2421
  const dragMinWidth = 10;
@@ -2775,16 +2704,66 @@ class GanttBarDrag {
2775
2704
  this.destroy$.complete();
2776
2705
  }
2777
2706
  }
2778
- GanttBarDrag.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: GanttBarDrag, deps: [{ token: i1.DragDrop }, { token: GanttDomService }, { token: GanttDragContainer }, { token: NgxGanttRootComponent, skipSelf: true }], target: i0.ɵɵFactoryTarget.Injectable });
2779
- GanttBarDrag.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: GanttBarDrag });
2780
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: GanttBarDrag, decorators: [{
2707
+ 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 });
2708
+ GanttBarDrag.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: GanttBarDrag });
2709
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: GanttBarDrag, decorators: [{
2781
2710
  type: Injectable
2782
2711
  }], ctorParameters: function () {
2783
- return [{ type: i1.DragDrop }, { type: GanttDomService }, { type: GanttDragContainer }, { type: NgxGanttRootComponent, decorators: [{
2712
+ return [{ type: i1$1.DragDrop }, { type: GanttDomService }, { type: GanttDragContainer }, { type: NgxGanttRootComponent, decorators: [{
2784
2713
  type: SkipSelf
2785
2714
  }] }];
2786
2715
  } });
2787
2716
 
2717
+ class GanttItemUpper {
2718
+ constructor(elementRef, ganttUpper) {
2719
+ this.elementRef = elementRef;
2720
+ this.ganttUpper = ganttUpper;
2721
+ this.firstChange = true;
2722
+ this.unsubscribe$ = new Subject();
2723
+ }
2724
+ ngOnInit() {
2725
+ this.firstChange = false;
2726
+ this.item.refs$.pipe(takeUntil(this.unsubscribe$)).subscribe(() => {
2727
+ this.setPositions();
2728
+ });
2729
+ }
2730
+ ngOnChanges() {
2731
+ if (!this.firstChange) {
2732
+ this.setPositions();
2733
+ }
2734
+ }
2735
+ setPositions() {
2736
+ const itemElement = this.elementRef.nativeElement;
2737
+ itemElement.style.left = this.item.refs.x + 'px';
2738
+ itemElement.style.top = this.item.refs.y + 'px';
2739
+ itemElement.style.width = this.item.refs.width + 'px';
2740
+ if (this.item.type === GanttItemType.bar) {
2741
+ itemElement.style.height = this.ganttUpper.styles.barHeight + 'px';
2742
+ }
2743
+ else if (this.item.type === GanttItemType.range) {
2744
+ itemElement.style.height = rangeHeight + 'px';
2745
+ }
2746
+ }
2747
+ ngOnDestroy() {
2748
+ this.unsubscribe$.next();
2749
+ this.unsubscribe$.complete();
2750
+ }
2751
+ }
2752
+ 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 });
2753
+ GanttItemUpper.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.1.3", type: GanttItemUpper, inputs: { template: "template", item: "item" }, usesOnChanges: true, ngImport: i0 });
2754
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: GanttItemUpper, decorators: [{
2755
+ type: Directive
2756
+ }], ctorParameters: function () {
2757
+ return [{ type: i0.ElementRef }, { type: GanttUpper, decorators: [{
2758
+ type: Inject,
2759
+ args: [GANTT_UPPER_TOKEN]
2760
+ }] }];
2761
+ }, propDecorators: { template: [{
2762
+ type: Input
2763
+ }], item: [{
2764
+ type: Input
2765
+ }] } });
2766
+
2788
2767
  function linearGradient(sideOrCorner, color, stop) {
2789
2768
  return `linear-gradient(${sideOrCorner},${color} 0%,${stop} 40%)`;
2790
2769
  }
@@ -2851,9 +2830,9 @@ class NgxGanttBarComponent extends GanttItemUpper {
2851
2830
  event.stopPropagation();
2852
2831
  }
2853
2832
  }
2854
- NgxGanttBarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: NgxGanttBarComponent, deps: [{ token: GanttDragContainer }, { token: GanttBarDrag }, { token: i0.ElementRef }, { token: GANTT_UPPER_TOKEN }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
2855
- NgxGanttBarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.9", 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"] }] });
2856
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: NgxGanttBarComponent, decorators: [{
2833
+ 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 });
2834
+ 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"] }] });
2835
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: NgxGanttBarComponent, decorators: [{
2857
2836
  type: Component,
2858
2837
  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" }]
2859
2838
  }], ctorParameters: function () {
@@ -2874,6 +2853,27 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.9", ngImpor
2874
2853
  args: ['handle']
2875
2854
  }] } });
2876
2855
 
2856
+ class NgxGanttRangeComponent extends GanttItemUpper {
2857
+ constructor(elementRef, ganttUpper) {
2858
+ super(elementRef, ganttUpper);
2859
+ this.ganttRangeClass = true;
2860
+ }
2861
+ }
2862
+ 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 });
2863
+ 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"] }] });
2864
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: NgxGanttRangeComponent, decorators: [{
2865
+ type: Component,
2866
+ 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" }]
2867
+ }], ctorParameters: function () {
2868
+ return [{ type: i0.ElementRef }, { type: GanttUpper, decorators: [{
2869
+ type: Inject,
2870
+ args: [GANTT_UPPER_TOKEN]
2871
+ }] }];
2872
+ }, propDecorators: { ganttRangeClass: [{
2873
+ type: HostBinding,
2874
+ args: ['class.gantt-range']
2875
+ }] } });
2876
+
2877
2877
  class NgxGanttBaselineComponent {
2878
2878
  constructor(elementRef, ganttUpper) {
2879
2879
  this.elementRef = elementRef;
@@ -2893,9 +2893,9 @@ class NgxGanttBaselineComponent {
2893
2893
  itemElement.style.width = this.baselineItem.refs.width + 'px';
2894
2894
  }
2895
2895
  }
2896
- NgxGanttBaselineComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: NgxGanttBaselineComponent, deps: [{ token: i0.ElementRef }, { token: GANTT_UPPER_TOKEN }], target: i0.ɵɵFactoryTarget.Component });
2897
- NgxGanttBaselineComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.9", 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", directives: [{ type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
2898
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: NgxGanttBaselineComponent, decorators: [{
2896
+ 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 });
2897
+ 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"] }] });
2898
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: NgxGanttBaselineComponent, decorators: [{
2899
2899
  type: Component,
2900
2900
  args: [{ selector: 'ngx-gantt-baseline,gantt-baseline', template: "<div #content *ngIf=\"baselineItem\" class=\"baseline-content\"></div>\n" }]
2901
2901
  }], ctorParameters: function () {
@@ -2921,9 +2921,9 @@ class GanttMainComponent {
2921
2921
  return item.id || index;
2922
2922
  }
2923
2923
  }
2924
- GanttMainComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: GanttMainComponent, deps: [{ token: GANTT_UPPER_TOKEN }], target: i0.ɵɵFactoryTarget.Component });
2925
- GanttMainComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.9", 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", 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"] }, { type: NgxGanttBaselineComponent, selector: "ngx-gantt-baseline,gantt-baseline", inputs: ["baselineItem"] }], 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 } });
2926
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: GanttMainComponent, decorators: [{
2924
+ 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 });
2925
+ 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" }] });
2926
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: GanttMainComponent, decorators: [{
2927
2927
  type: Component,
2928
2928
  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" }]
2929
2929
  }], ctorParameters: function () {
@@ -3041,8 +3041,8 @@ class NgxGanttComponent extends GanttUpper {
3041
3041
  this.ganttRoot.scrollToDate(date);
3042
3042
  }
3043
3043
  }
3044
- NgxGanttComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: NgxGanttComponent, deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }, { token: i0.NgZone }, { token: GANTT_GLOBAL_CONFIG }], target: i0.ɵɵFactoryTarget.Component });
3045
- NgxGanttComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.9", type: NgxGanttComponent, selector: "ngx-gantt", inputs: { maxLevel: "maxLevel", async: "async", childrenResolve: "childrenResolve", linkable: "linkable" }, outputs: { linkDragStarted: "linkDragStarted", linkDragEnded: "linkDragEnded", lineClick: "lineClick", selectedChange: "selectedChange" }, providers: [
3044
+ 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 });
3045
+ 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: [
3046
3046
  {
3047
3047
  provide: GANTT_UPPER_TOKEN,
3048
3048
  useExisting: NgxGanttComponent
@@ -3051,8 +3051,8 @@ NgxGanttComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", vers
3051
3051
  provide: GANTT_ABSTRACT_TOKEN,
3052
3052
  useExisting: forwardRef(() => NgxGanttComponent)
3053
3053
  }
3054
- ], 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 });
3055
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: NgxGanttComponent, decorators: [{
3054
+ ], 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 });
3055
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: NgxGanttComponent, decorators: [{
3056
3056
  type: Component,
3057
3057
  args: [{ selector: 'ngx-gantt', changeDetection: ChangeDetectionStrategy.OnPush, providers: [
3058
3058
  {
@@ -3101,8 +3101,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.9", ngImpor
3101
3101
 
3102
3102
  class NgxGanttModule {
3103
3103
  }
3104
- NgxGanttModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: NgxGanttModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
3105
- NgxGanttModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: NgxGanttModule, declarations: [NgxGanttComponent,
3104
+ NgxGanttModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: NgxGanttModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
3105
+ NgxGanttModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.1.3", ngImport: i0, type: NgxGanttModule, declarations: [NgxGanttComponent,
3106
3106
  NgxGanttTableComponent,
3107
3107
  NgxGanttTableColumnComponent,
3108
3108
  GanttTableComponent,
@@ -3124,13 +3124,13 @@ NgxGanttModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version:
3124
3124
  NgxGanttBarComponent,
3125
3125
  NgxGanttRangeComponent,
3126
3126
  NgxGanttBaselineComponent] });
3127
- NgxGanttModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: NgxGanttModule, providers: [
3127
+ NgxGanttModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: NgxGanttModule, providers: [
3128
3128
  {
3129
3129
  provide: GANTT_GLOBAL_CONFIG,
3130
3130
  useValue: defaultConfig
3131
3131
  }
3132
- ], imports: [[CommonModule, DragDropModule]] });
3133
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: NgxGanttModule, decorators: [{
3132
+ ], imports: [CommonModule, DragDropModule] });
3133
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: NgxGanttModule, decorators: [{
3134
3134
  type: NgModule,
3135
3135
  args: [{
3136
3136
  imports: [CommonModule, DragDropModule],