@worktile/gantt 15.1.0-next.1 → 15.1.0-next.3

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.
@@ -3,7 +3,7 @@ import { InjectionToken, EventEmitter, Directive, Inject, Input, Output, Content
3
3
  import * as i1 from '@angular/common';
4
4
  import { DOCUMENT, isPlatformServer, CommonModule } from '@angular/common';
5
5
  import { take, takeUntil, skip, switchMap, debounceTime as debounceTime$1, map, pairwise, auditTime, startWith as startWith$1, finalize } from 'rxjs/operators';
6
- import { BehaviorSubject, Subject, from, takeUntil as takeUntil$1, startWith, debounceTime, filter, merge, EMPTY, fromEvent, Observable } from 'rxjs';
6
+ import { BehaviorSubject, Subject, from, takeUntil as takeUntil$1, startWith, debounceTime, filter, merge, EMPTY, fromEvent, Observable, interval, animationFrameScheduler } 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';
@@ -1242,11 +1242,15 @@ class NgxGanttTableColumnComponent {
1242
1242
  set width(width) {
1243
1243
  this.columnWidth = coerceCssPixelValue(width);
1244
1244
  }
1245
- constructor(ganttUpper) {
1245
+ constructor(ganttUpper, elementRef) {
1246
1246
  this.ganttUpper = ganttUpper;
1247
+ this.elementRef = elementRef;
1248
+ }
1249
+ get classList() {
1250
+ return this.elementRef.nativeElement.classList;
1247
1251
  }
1248
1252
  }
1249
- NgxGanttTableColumnComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: NgxGanttTableColumnComponent, deps: [{ token: GANTT_UPPER_TOKEN }], target: i0.ɵɵFactoryTarget.Component });
1253
+ NgxGanttTableColumnComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: NgxGanttTableColumnComponent, deps: [{ token: GANTT_UPPER_TOKEN }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
1250
1254
  NgxGanttTableColumnComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.4", type: NgxGanttTableColumnComponent, selector: "ngx-gantt-column", inputs: { width: "width", name: "name", showExpandIcon: "showExpandIcon" }, 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 });
1251
1255
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: NgxGanttTableColumnComponent, decorators: [{
1252
1256
  type: Component,
@@ -1258,7 +1262,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImpor
1258
1262
  return [{ type: GanttUpper, decorators: [{
1259
1263
  type: Inject,
1260
1264
  args: [GANTT_UPPER_TOKEN]
1261
- }] }];
1265
+ }] }, { type: i0.ElementRef }];
1262
1266
  }, propDecorators: { width: [{
1263
1267
  type: Input
1264
1268
  }], name: [{
@@ -1430,7 +1434,7 @@ class GanttTableHeaderComponent {
1430
1434
  this.columnsChange();
1431
1435
  this.columns.changes.pipe(takeUntil$1(this.unsubscribe$)).subscribe(() => {
1432
1436
  this.columnsChange();
1433
- this.cdr.detectChanges();
1437
+ this.gantt.cdr.detectChanges();
1434
1438
  });
1435
1439
  }
1436
1440
  columnsChange() {
@@ -1744,6 +1748,7 @@ class GanttTableBodyComponent {
1744
1748
  this.columns.changes.pipe(startWith(this.columns), takeUntil$1(this.destroy$)).subscribe(() => {
1745
1749
  this.hasExpandIcon = false;
1746
1750
  this.columns.forEach((column) => {
1751
+ column.classList.add('gantt-table-column');
1747
1752
  if (!column.columnWidth) {
1748
1753
  column.columnWidth = coerceCssPixelValue(defaultColumnWidth);
1749
1754
  }
@@ -1784,7 +1789,7 @@ class GanttTableBodyComponent {
1784
1789
  onItemDragStarted(event) {
1785
1790
  this.ganttTableDragging = true;
1786
1791
  // 拖动开始时隐藏所有的子项
1787
- const children = this.getChildrenElementsByElement(event.source.getPlaceholderElement());
1792
+ const children = this.getChildrenElementsByElement(event.source.element.nativeElement);
1788
1793
  children.forEach((element) => {
1789
1794
  element.classList.add('drag-item-hide');
1790
1795
  });
@@ -1903,11 +1908,12 @@ class GanttTableBodyComponent {
1903
1908
  return (_a = n.children) === null || _a === void 0 ? void 0 : _a.includes(item);
1904
1909
  });
1905
1910
  }
1906
- getChildrenElementsByElement(element) {
1911
+ getChildrenElementsByElement(dragElement) {
1907
1912
  // 通过循环持续查找 next element,如果 element 的 level 小于当前 item 的 level,则为它的 children
1908
1913
  const children = [];
1909
- const dragRef = this.itemDragRefMap.get(element);
1910
- let nextElement = element.nextElementSibling;
1914
+ const dragRef = this.itemDragRefMap.get(dragElement);
1915
+ // 如果当前的 Drag 正在拖拽,会创建 PlaceholderElement 占位,所以以 PlaceholderElement 向下查找
1916
+ let nextElement = (dragRef.getPlaceholderElement() || dragElement).nextElementSibling;
1911
1917
  let nextDragRef = this.itemDragRefMap.get(nextElement);
1912
1918
  while (nextDragRef && nextDragRef.data.level > dragRef.data.level) {
1913
1919
  children.push(nextElement);
@@ -1947,10 +1953,10 @@ class GanttTableBodyComponent {
1947
1953
  }
1948
1954
  }
1949
1955
  GanttTableBodyComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: GanttTableBodyComponent, deps: [{ token: GANTT_ABSTRACT_TOKEN }, { token: GANTT_UPPER_TOKEN }, { token: i0.ChangeDetectorRef }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Component });
1950
- GanttTableBodyComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.4", type: GanttTableBodyComponent, selector: "gantt-table-body", inputs: { renderData: "renderData", flatData: "flatData", columns: "columns", groupTemplate: "groupTemplate", emptyTemplate: "emptyTemplate", rowBeforeTemplate: "rowBeforeTemplate", rowAfterTemplate: "rowAfterTemplate", draggable: "draggable", dropEnterPredicate: "dropEnterPredicate" }, outputs: { dragDropped: "dragDropped", itemClick: "itemClick" }, host: { properties: { "class.gantt-table-draggable": "this.draggable", "class.gantt-table-body": "this.ganttTableClass", "class.gantt-table-empty": "this.ganttTableEmptyClass", "class.gantt-table-dragging": "this.ganttTableDragging" } }, viewQueries: [{ propertyName: "cdkDrags", predicate: (CdkDrag), descendants: true }], ngImport: i0, template: "<div\n class=\"gantt-table-body-container\"\n cdkDropList\n [cdkDropListAutoScrollStep]=\"6\"\n [cdkDropListData]=\"renderData\"\n [cdkDropListSortingDisabled]=\"true\"\n (cdkDropListDropped)=\"onListDropped($event)\"\n>\n <ng-container *ngIf=\"!renderData?.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=\"renderData && renderData.length > 0\">\n <ng-container *ngFor=\"let item of renderData; trackBy: trackBy\">\n <div class=\"gantt-table-group\" [ngClass]=\"item.class\" *ngIf=\"item.items\">\n <div class=\"gantt-table-group-title\" [class.expanded]=\"item.expanded\" (click)=\"expandGroup(item)\">\n <gantt-icon class=\"expand-icon\" [iconName]=\"item.expanded ? 'angle-down' : 'angle-right'\"></gantt-icon>\n <ng-container *ngIf=\"groupTemplate; else default\">\n <ng-template\n [ngTemplateOutlet]=\"groupTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: item.origin, group: item.origin }\"\n ></ng-template>\n </ng-container>\n <ng-template #default>\n <span class=\"group-title\">{{ item.title }}</span>\n </ng-template>\n </div>\n </div>\n\n <div\n *ngIf=\"!item.items\"\n (click)=\"itemClick.emit({ event: $event, selectedValue: item.origin })\"\n cdkDrag\n [cdkDragData]=\"item\"\n [cdkDragDisabled]=\"(draggable && item.itemDraggable === false) || !draggable\"\n (cdkDragStarted)=\"onItemDragStarted($event)\"\n (cdkDragEnded)=\"onItemDragEnded($event)\"\n (cdkDragMoved)=\"emitItemDragMoved($event)\"\n class=\"gantt-table-item\"\n [class.gantt-table-item-with-group]=\"hasGroup\"\n [class.gantt-table-item-first-level-group]=\"item.level === 0 && (item.type | isGanttRangeItem)\"\n [style.height.px]=\"gantt.styles.lineHeight\"\n [style.lineHeight.px]=\"gantt.styles.lineHeight\"\n [class.gantt-table-item-active]=\"ganttUpper.isSelected(item.id)\"\n >\n <ng-template\n [ngTemplateOutlet]=\"rowBeforeTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: item.origin, item: item.origin }\"\n ></ng-template>\n\n <div class=\"gantt-table-column\" *ngFor=\"let column of columns; let first = first\" [style.width]=\"column.columnWidth\">\n <!-- drag icon -->\n <gantt-icon\n *ngIf=\"first && draggable\"\n class=\"gantt-drag-handle\"\n iconName=\"drag\"\n cdkDragHandle\n [cdkDragHandleDisabled]=\"(draggable && item.itemDraggable === false) || !draggable\"\n ></gantt-icon>\n <!-- expand icon -->\n <div\n *ngIf=\"column?.showExpandIcon || (!hasExpandIcon && first)\"\n class=\"gantt-expand-icon\"\n [style.marginLeft.px]=\"item.level * 20\"\n >\n <ng-container *ngIf=\"item.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 >\n </gantt-icon>\n <gantt-icon *ngIf=\"item.loading\" [iconName]=\"'loading'\"></gantt-icon>\n </ng-container>\n </div>\n <!-- column content -->\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-container>\n </ng-container>\n</div>\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: i2.CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "directive", type: i2.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: "directive", type: i2.CdkDragHandle, selector: "[cdkDragHandle]", inputs: ["cdkDragHandleDisabled"] }, { kind: "component", type: GanttIconComponent, selector: "gantt-icon", inputs: ["iconName"] }, { kind: "pipe", type: IsGanttRangeItemPipe, name: "isGanttRangeItem" }] });
1956
+ GanttTableBodyComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.4", type: GanttTableBodyComponent, selector: "gantt-table-body", inputs: { renderData: "renderData", flatData: "flatData", columns: "columns", groupTemplate: "groupTemplate", emptyTemplate: "emptyTemplate", rowBeforeTemplate: "rowBeforeTemplate", rowAfterTemplate: "rowAfterTemplate", draggable: "draggable", dropEnterPredicate: "dropEnterPredicate" }, outputs: { dragDropped: "dragDropped", itemClick: "itemClick" }, host: { properties: { "class.gantt-table-draggable": "this.draggable", "class.gantt-table-body": "this.ganttTableClass", "class.gantt-table-empty": "this.ganttTableEmptyClass", "class.gantt-table-dragging": "this.ganttTableDragging" } }, viewQueries: [{ propertyName: "cdkDrags", predicate: (CdkDrag), descendants: true }], ngImport: i0, template: "<div\n class=\"gantt-table-body-container\"\n cdkDropList\n [cdkDropListAutoScrollStep]=\"6\"\n [cdkDropListData]=\"renderData\"\n [cdkDropListSortingDisabled]=\"true\"\n (cdkDropListDropped)=\"onListDropped($event)\"\n>\n <ng-container *ngIf=\"!renderData?.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=\"renderData && renderData.length > 0\">\n <ng-container *ngFor=\"let item of renderData; trackBy: trackBy\">\n <div class=\"gantt-table-group\" [ngClass]=\"item.class\" *ngIf=\"item.items\">\n <div class=\"gantt-table-group-title\" [class.expanded]=\"item.expanded\" (click)=\"expandGroup(item)\">\n <gantt-icon class=\"expand-icon\" [iconName]=\"item.expanded ? 'angle-down' : 'angle-right'\"></gantt-icon>\n <ng-container *ngIf=\"groupTemplate; else default\">\n <ng-template\n [ngTemplateOutlet]=\"groupTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: item.origin, group: item.origin }\"\n ></ng-template>\n </ng-container>\n <ng-template #default>\n <span class=\"group-title\">{{ item.title }}</span>\n </ng-template>\n </div>\n </div>\n\n <div\n *ngIf=\"!item.items\"\n (click)=\"itemClick.emit({ event: $event, selectedValue: item.origin })\"\n cdkDrag\n [cdkDragData]=\"item\"\n [cdkDragDisabled]=\"(draggable && item.itemDraggable === false) || !draggable\"\n (cdkDragStarted)=\"onItemDragStarted($event)\"\n (cdkDragEnded)=\"onItemDragEnded($event)\"\n (cdkDragMoved)=\"emitItemDragMoved($event)\"\n class=\"gantt-table-item\"\n [class.gantt-table-item-with-group]=\"hasGroup\"\n [class.gantt-table-item-first-level-group]=\"item.level === 0 && (item.type | isGanttRangeItem)\"\n [style.height.px]=\"gantt.styles.lineHeight\"\n [style.lineHeight.px]=\"gantt.styles.lineHeight\"\n [class.gantt-table-item-active]=\"ganttUpper.isSelected(item.id)\"\n >\n <ng-template\n [ngTemplateOutlet]=\"rowBeforeTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: item.origin, item: item.origin }\"\n ></ng-template>\n\n <div [classList]=\"column.classList\" *ngFor=\"let column of columns; let first = first\" [style.width]=\"column.columnWidth\">\n <!-- drag icon -->\n <gantt-icon\n *ngIf=\"first && draggable\"\n class=\"gantt-drag-handle\"\n iconName=\"drag\"\n cdkDragHandle\n [cdkDragHandleDisabled]=\"(draggable && item.itemDraggable === false) || !draggable\"\n ></gantt-icon>\n <!-- expand icon -->\n <div\n *ngIf=\"column?.showExpandIcon || (!hasExpandIcon && first)\"\n class=\"gantt-expand-icon\"\n [style.marginLeft.px]=\"item.level * 20\"\n >\n <ng-container *ngIf=\"item.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 >\n </gantt-icon>\n <gantt-icon *ngIf=\"item.loading\" [iconName]=\"'loading'\"></gantt-icon>\n </ng-container>\n </div>\n <!-- column content -->\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-container>\n </ng-container>\n</div>\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: i2.CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "directive", type: i2.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: "directive", type: i2.CdkDragHandle, selector: "[cdkDragHandle]", inputs: ["cdkDragHandleDisabled"] }, { kind: "component", type: GanttIconComponent, selector: "gantt-icon", inputs: ["iconName"] }, { kind: "pipe", type: IsGanttRangeItemPipe, name: "isGanttRangeItem" }] });
1951
1957
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: GanttTableBodyComponent, decorators: [{
1952
1958
  type: Component,
1953
- args: [{ selector: 'gantt-table-body', template: "<div\n class=\"gantt-table-body-container\"\n cdkDropList\n [cdkDropListAutoScrollStep]=\"6\"\n [cdkDropListData]=\"renderData\"\n [cdkDropListSortingDisabled]=\"true\"\n (cdkDropListDropped)=\"onListDropped($event)\"\n>\n <ng-container *ngIf=\"!renderData?.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=\"renderData && renderData.length > 0\">\n <ng-container *ngFor=\"let item of renderData; trackBy: trackBy\">\n <div class=\"gantt-table-group\" [ngClass]=\"item.class\" *ngIf=\"item.items\">\n <div class=\"gantt-table-group-title\" [class.expanded]=\"item.expanded\" (click)=\"expandGroup(item)\">\n <gantt-icon class=\"expand-icon\" [iconName]=\"item.expanded ? 'angle-down' : 'angle-right'\"></gantt-icon>\n <ng-container *ngIf=\"groupTemplate; else default\">\n <ng-template\n [ngTemplateOutlet]=\"groupTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: item.origin, group: item.origin }\"\n ></ng-template>\n </ng-container>\n <ng-template #default>\n <span class=\"group-title\">{{ item.title }}</span>\n </ng-template>\n </div>\n </div>\n\n <div\n *ngIf=\"!item.items\"\n (click)=\"itemClick.emit({ event: $event, selectedValue: item.origin })\"\n cdkDrag\n [cdkDragData]=\"item\"\n [cdkDragDisabled]=\"(draggable && item.itemDraggable === false) || !draggable\"\n (cdkDragStarted)=\"onItemDragStarted($event)\"\n (cdkDragEnded)=\"onItemDragEnded($event)\"\n (cdkDragMoved)=\"emitItemDragMoved($event)\"\n class=\"gantt-table-item\"\n [class.gantt-table-item-with-group]=\"hasGroup\"\n [class.gantt-table-item-first-level-group]=\"item.level === 0 && (item.type | isGanttRangeItem)\"\n [style.height.px]=\"gantt.styles.lineHeight\"\n [style.lineHeight.px]=\"gantt.styles.lineHeight\"\n [class.gantt-table-item-active]=\"ganttUpper.isSelected(item.id)\"\n >\n <ng-template\n [ngTemplateOutlet]=\"rowBeforeTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: item.origin, item: item.origin }\"\n ></ng-template>\n\n <div class=\"gantt-table-column\" *ngFor=\"let column of columns; let first = first\" [style.width]=\"column.columnWidth\">\n <!-- drag icon -->\n <gantt-icon\n *ngIf=\"first && draggable\"\n class=\"gantt-drag-handle\"\n iconName=\"drag\"\n cdkDragHandle\n [cdkDragHandleDisabled]=\"(draggable && item.itemDraggable === false) || !draggable\"\n ></gantt-icon>\n <!-- expand icon -->\n <div\n *ngIf=\"column?.showExpandIcon || (!hasExpandIcon && first)\"\n class=\"gantt-expand-icon\"\n [style.marginLeft.px]=\"item.level * 20\"\n >\n <ng-container *ngIf=\"item.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 >\n </gantt-icon>\n <gantt-icon *ngIf=\"item.loading\" [iconName]=\"'loading'\"></gantt-icon>\n </ng-container>\n </div>\n <!-- column content -->\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-container>\n </ng-container>\n</div>\n" }]
1959
+ args: [{ selector: 'gantt-table-body', template: "<div\n class=\"gantt-table-body-container\"\n cdkDropList\n [cdkDropListAutoScrollStep]=\"6\"\n [cdkDropListData]=\"renderData\"\n [cdkDropListSortingDisabled]=\"true\"\n (cdkDropListDropped)=\"onListDropped($event)\"\n>\n <ng-container *ngIf=\"!renderData?.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=\"renderData && renderData.length > 0\">\n <ng-container *ngFor=\"let item of renderData; trackBy: trackBy\">\n <div class=\"gantt-table-group\" [ngClass]=\"item.class\" *ngIf=\"item.items\">\n <div class=\"gantt-table-group-title\" [class.expanded]=\"item.expanded\" (click)=\"expandGroup(item)\">\n <gantt-icon class=\"expand-icon\" [iconName]=\"item.expanded ? 'angle-down' : 'angle-right'\"></gantt-icon>\n <ng-container *ngIf=\"groupTemplate; else default\">\n <ng-template\n [ngTemplateOutlet]=\"groupTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: item.origin, group: item.origin }\"\n ></ng-template>\n </ng-container>\n <ng-template #default>\n <span class=\"group-title\">{{ item.title }}</span>\n </ng-template>\n </div>\n </div>\n\n <div\n *ngIf=\"!item.items\"\n (click)=\"itemClick.emit({ event: $event, selectedValue: item.origin })\"\n cdkDrag\n [cdkDragData]=\"item\"\n [cdkDragDisabled]=\"(draggable && item.itemDraggable === false) || !draggable\"\n (cdkDragStarted)=\"onItemDragStarted($event)\"\n (cdkDragEnded)=\"onItemDragEnded($event)\"\n (cdkDragMoved)=\"emitItemDragMoved($event)\"\n class=\"gantt-table-item\"\n [class.gantt-table-item-with-group]=\"hasGroup\"\n [class.gantt-table-item-first-level-group]=\"item.level === 0 && (item.type | isGanttRangeItem)\"\n [style.height.px]=\"gantt.styles.lineHeight\"\n [style.lineHeight.px]=\"gantt.styles.lineHeight\"\n [class.gantt-table-item-active]=\"ganttUpper.isSelected(item.id)\"\n >\n <ng-template\n [ngTemplateOutlet]=\"rowBeforeTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: item.origin, item: item.origin }\"\n ></ng-template>\n\n <div [classList]=\"column.classList\" *ngFor=\"let column of columns; let first = first\" [style.width]=\"column.columnWidth\">\n <!-- drag icon -->\n <gantt-icon\n *ngIf=\"first && draggable\"\n class=\"gantt-drag-handle\"\n iconName=\"drag\"\n cdkDragHandle\n [cdkDragHandleDisabled]=\"(draggable && item.itemDraggable === false) || !draggable\"\n ></gantt-icon>\n <!-- expand icon -->\n <div\n *ngIf=\"column?.showExpandIcon || (!hasExpandIcon && first)\"\n class=\"gantt-expand-icon\"\n [style.marginLeft.px]=\"item.level * 20\"\n >\n <ng-container *ngIf=\"item.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 >\n </gantt-icon>\n <gantt-icon *ngIf=\"item.loading\" [iconName]=\"'loading'\"></gantt-icon>\n </ng-container>\n </div>\n <!-- column content -->\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-container>\n </ng-container>\n</div>\n" }]
1954
1960
  }], ctorParameters: function () {
1955
1961
  return [{ type: undefined, decorators: [{
1956
1962
  type: Inject,
@@ -2471,6 +2477,41 @@ function normalizePassiveListenerOptions(options) {
2471
2477
  /** Options used to bind passive event listeners. */
2472
2478
  const passiveListenerOptions = normalizePassiveListenerOptions({ passive: true });
2473
2479
 
2480
+ /**
2481
+ * Proximity, as a ratio to width/height at which to start auto-scrolling the drop list or the
2482
+ * viewport. The value comes from trying it out manually until it feels right.
2483
+ */
2484
+ const SCROLL_PROXIMITY_THRESHOLD = 0.05;
2485
+ /**
2486
+ * Gets whether the horizontal auto-scroll direction of a node.
2487
+ * @param clientRect Dimensions of the node.
2488
+ * @param pointerX Position of the user's pointer along the x axis.
2489
+ */
2490
+ function getHorizontalScrollDirection(clientRect, pointerX) {
2491
+ const { left, right, width } = clientRect;
2492
+ const xThreshold = width * SCROLL_PROXIMITY_THRESHOLD;
2493
+ if (pointerX >= left - xThreshold && pointerX <= left + xThreshold) {
2494
+ return 1 /* AutoScrollHorizontalDirection.LEFT */;
2495
+ }
2496
+ else if (pointerX >= right - xThreshold && pointerX <= right + xThreshold) {
2497
+ return 2 /* AutoScrollHorizontalDirection.RIGHT */;
2498
+ }
2499
+ return 0 /* AutoScrollHorizontalDirection.NONE */;
2500
+ }
2501
+ /**
2502
+ * Checks whether the pointer coordinates are close to a ClientRect.
2503
+ * @param rect ClientRect to check against.
2504
+ * @param threshold Threshold around the ClientRect.
2505
+ * @param pointerX Coordinates along the X axis.
2506
+ * @param pointerY Coordinates along the Y axis.
2507
+ */
2508
+ function isPointerNearClientRect(rect, threshold, pointerX, pointerY) {
2509
+ const { top, right, bottom, left, width, height } = rect;
2510
+ const xThreshold = width * threshold;
2511
+ const yThreshold = height * threshold;
2512
+ return pointerY > top - yThreshold && pointerY < bottom + yThreshold && pointerX > left - xThreshold && pointerX < right + xThreshold;
2513
+ }
2514
+
2474
2515
  const scrollThreshold = 50;
2475
2516
  var ScrollDirection;
2476
2517
  (function (ScrollDirection) {
@@ -2865,8 +2906,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImpor
2865
2906
  args: [GanttDragBackdropComponent, { static: true, read: ElementRef }]
2866
2907
  }] } });
2867
2908
 
2909
+ /**
2910
+ * Proximity, as a ratio to width/height, at which a
2911
+ * dragged item will affect the drop container.
2912
+ */
2913
+ const DROP_PROXIMITY_THRESHOLD = 0.05;
2868
2914
  const dragMinWidth = 10;
2869
- const autoScrollStep = 10;
2915
+ const autoScrollStep = 5;
2870
2916
  const activeClass = 'gantt-bar-active';
2871
2917
  const dropActiveClass = 'gantt-bar-drop-active';
2872
2918
  const singleDropActiveClass = 'gantt-bar-single-drop-active';
@@ -2882,19 +2928,44 @@ class GanttBarDrag {
2882
2928
  get linkDragDisabled() {
2883
2929
  return !this.item.linkable || !this.ganttUpper.linkable;
2884
2930
  }
2885
- constructor(dragDrop, dom, dragContainer, root) {
2931
+ constructor(dragDrop, dom, dragContainer, _ngZone, root) {
2886
2932
  this.dragDrop = dragDrop;
2887
2933
  this.dom = dom;
2888
2934
  this.dragContainer = dragContainer;
2935
+ this._ngZone = _ngZone;
2889
2936
  this.root = root;
2890
2937
  this.dragRefs = [];
2891
2938
  this.destroy$ = new Subject();
2892
- // scrolling state when drag
2939
+ /** Used to signal to the current auto-scroll sequence when to stop. */
2940
+ this.stopScrollTimers$ = new Subject();
2941
+ /** move distance when drag bar */
2942
+ this.barDragMoveDistance = 0;
2943
+ /** move distance when drag bar handle */
2944
+ this.barHandleDragMoveDistance = 0;
2945
+ /** scrolling state when drag */
2893
2946
  this.dragScrolling = false;
2947
+ /** dragScrollDistance */
2948
+ this.dragScrollDistance = 0;
2949
+ /** Horizontal direction in which the list is currently scrolling. */
2950
+ this._horizontalScrollDirection = 0 /* AutoScrollHorizontalDirection.NONE */;
2951
+ this.startScrollInterval = () => {
2952
+ this.stopScrolling();
2953
+ interval(0, animationFrameScheduler)
2954
+ .pipe(takeUntil(this.stopScrollTimers$))
2955
+ .subscribe(() => {
2956
+ const node = this.dom.mainContainer;
2957
+ const scrollStep = autoScrollStep;
2958
+ if (this._horizontalScrollDirection === 1 /* AutoScrollHorizontalDirection.LEFT */) {
2959
+ node.scrollBy(-scrollStep, 0);
2960
+ }
2961
+ else if (this._horizontalScrollDirection === 2 /* AutoScrollHorizontalDirection.RIGHT */) {
2962
+ node.scrollBy(scrollStep, 0);
2963
+ }
2964
+ });
2965
+ };
2894
2966
  }
2895
2967
  createDragRef(element) {
2896
2968
  const dragRef = this.dragDrop.createDrag(element);
2897
- // dragRef.withPreviewContainer(this.dom.mainContainer as HTMLElement);
2898
2969
  return dragRef;
2899
2970
  }
2900
2971
  createDragScrollEvent(dragRef) {
@@ -2942,18 +3013,19 @@ class GanttBarDrag {
2942
3013
  this.setDraggingStyles();
2943
3014
  this.containerScrollLeft = this.dom.mainContainer.scrollLeft;
2944
3015
  this.createDragScrollEvent(dragRef).subscribe(() => {
2945
- if (this.dropListRef.isDragging()) {
2946
- this.dragScrolling = true;
2947
- const scrollDistance = this.dom.mainContainer.scrollLeft - this.containerScrollLeft;
2948
- this.barDragMove(dragRef, scrollDistance + this.barDragMoveDistance);
3016
+ if (dragRef.isDragging()) {
3017
+ const dragScrollDistance = this.dom.mainContainer.scrollLeft - this.containerScrollLeft;
3018
+ this.dragScrollDistance = dragScrollDistance;
3019
+ this.barDragMove();
2949
3020
  }
2950
3021
  });
2951
3022
  this.dragContainer.dragStarted.emit({ item: this.item.origin });
2952
3023
  });
2953
3024
  dragRef.moved.subscribe((event) => {
2954
- this.barDragMove(dragRef, event.distance.x);
3025
+ this.startScrollingIfNecessary(event.pointerPosition.x, event.pointerPosition.y);
3026
+ this.barDragMoveDistance = event.distance.x;
2955
3027
  if (!this.dragScrolling) {
2956
- this.barDragMoveDistance = event.distance.x;
3028
+ this.barDragMove();
2957
3029
  }
2958
3030
  });
2959
3031
  dragRef.ended.subscribe((event) => {
@@ -2965,7 +3037,9 @@ class GanttBarDrag {
2965
3037
  this.clearDraggingStyles();
2966
3038
  this.closeDragBackdrop();
2967
3039
  event.source.reset();
3040
+ this.stopScrolling();
2968
3041
  this.dragScrolling = false;
3042
+ this.dragScrollDistance = 0;
2969
3043
  this.barDragMoveDistance = 0;
2970
3044
  this.dragContainer.dragEnded.emit({ item: this.item.origin });
2971
3045
  });
@@ -2984,18 +3058,19 @@ class GanttBarDrag {
2984
3058
  this.setDraggingStyles();
2985
3059
  this.containerScrollLeft = this.dom.mainContainer.scrollLeft;
2986
3060
  this.createDragScrollEvent(dragRef).subscribe(() => {
2987
- if (this.dropListRef.isDragging()) {
2988
- this.dragScrolling = true;
2989
- const scrollDistance = this.dom.mainContainer.scrollLeft - this.containerScrollLeft;
2990
- this.barHandleDragMove(scrollDistance + this.barHandleDragMoveDistance, isBefore);
3061
+ if (dragRef.isDragging()) {
3062
+ const dragScrollDistance = this.dom.mainContainer.scrollLeft - this.containerScrollLeft;
3063
+ this.dragScrollDistance = dragScrollDistance;
3064
+ this.barHandleDragMove(isBefore);
2991
3065
  }
2992
3066
  });
2993
3067
  this.dragContainer.dragStarted.emit({ item: this.item.origin });
2994
3068
  });
2995
3069
  dragRef.moved.subscribe((event) => {
2996
- this.barHandleDragMove(event.distance.x, isBefore);
3070
+ this.startScrollingIfNecessary(event.pointerPosition.x, event.pointerPosition.y);
3071
+ this.barHandleDragMoveDistance = event.distance.x;
2997
3072
  if (!this.dragScrolling) {
2998
- this.barHandleDragMoveDistance = event.distance.x;
3073
+ this.barHandleDragMove(isBefore);
2999
3074
  }
3000
3075
  });
3001
3076
  dragRef.ended.subscribe((event) => {
@@ -3019,7 +3094,9 @@ class GanttBarDrag {
3019
3094
  this.clearDraggingStyles();
3020
3095
  this.closeDragBackdrop();
3021
3096
  event.source.reset();
3097
+ this.stopScrolling();
3022
3098
  this.dragScrolling = false;
3099
+ this.dragScrollDistance = 0;
3023
3100
  this.barHandleDragMoveDistance = 0;
3024
3101
  this.dragContainer.dragEnded.emit({ item: this.item.origin });
3025
3102
  });
@@ -3109,8 +3186,8 @@ class GanttBarDrag {
3109
3186
  this.barElement.style.pointerEvents = '';
3110
3187
  this.barElement.classList.remove('gantt-bar-draggable-drag');
3111
3188
  }
3112
- barDragMove(dragRef, distance) {
3113
- const currentX = this.item.refs.x + distance;
3189
+ barDragMove() {
3190
+ const currentX = this.item.refs.x + this.barDragMoveDistance + this.dragScrollDistance;
3114
3191
  const currentDate = this.ganttUpper.view.getDateByXPoint(currentX);
3115
3192
  const currentStartX = this.ganttUpper.view.getXPointByDate(currentDate);
3116
3193
  const dayWidth = this.ganttUpper.view.getDayOccupancyWidth(currentDate);
@@ -3121,11 +3198,18 @@ class GanttBarDrag {
3121
3198
  start = start.addDays(1);
3122
3199
  end = end.addDays(1);
3123
3200
  }
3124
- this.openDragBackdrop(dragRef['_preview'], this.ganttUpper.view.getDateByXPoint(currentX), this.ganttUpper.view.getDateByXPoint(currentX + this.item.refs.width));
3201
+ if (this.dragScrolling) {
3202
+ this.barElement.style.left = currentX - this.barDragMoveDistance + 'px';
3203
+ }
3204
+ this.openDragBackdrop(this.barElement, this.ganttUpper.view.getDateByXPoint(currentX), this.ganttUpper.view.getDateByXPoint(currentX + this.item.refs.width));
3205
+ if (!this.isStartOrEndInsideView(start, end)) {
3206
+ return;
3207
+ }
3125
3208
  this.item.updateDate(start, end);
3126
3209
  this.dragContainer.dragMoved.emit({ item: this.item.origin });
3127
3210
  }
3128
- barHandleDragMove(distance, isBefore) {
3211
+ barHandleDragMove(isBefore) {
3212
+ const distance = this.barHandleDragMoveDistance + this.dragScrollDistance;
3129
3213
  if (isBefore) {
3130
3214
  const x = this.item.refs.x + distance;
3131
3215
  const width = this.item.refs.width + distance * -1;
@@ -3134,6 +3218,9 @@ class GanttBarDrag {
3134
3218
  this.barElement.style.width = width + 'px';
3135
3219
  this.barElement.style.left = x + 'px';
3136
3220
  this.openDragBackdrop(this.barElement, start, this.item.end);
3221
+ if (!this.isStartOrEndInsideView(start, this.item.end)) {
3222
+ return;
3223
+ }
3137
3224
  this.item.updateDate(start, this.item.end);
3138
3225
  }
3139
3226
  }
@@ -3143,6 +3230,9 @@ class GanttBarDrag {
3143
3230
  if (width > dragMinWidth) {
3144
3231
  this.barElement.style.width = width + 'px';
3145
3232
  this.openDragBackdrop(this.barElement, this.item.start, end);
3233
+ if (!this.isStartOrEndInsideView(this.item.start, end)) {
3234
+ return;
3235
+ }
3146
3236
  this.item.updateDate(this.item.start, end);
3147
3237
  }
3148
3238
  }
@@ -3175,6 +3265,36 @@ class GanttBarDrag {
3175
3265
  this.linkDraggingLine = null;
3176
3266
  }
3177
3267
  }
3268
+ startScrollingIfNecessary(pointerX, pointerY) {
3269
+ const clientRect = this.dom.mainContainer.getBoundingClientRect();
3270
+ if (isPointerNearClientRect(clientRect, DROP_PROXIMITY_THRESHOLD, pointerX, pointerY)) {
3271
+ const horizontalScrollDirection = getHorizontalScrollDirection(clientRect, pointerX);
3272
+ if (horizontalScrollDirection) {
3273
+ this._horizontalScrollDirection = horizontalScrollDirection;
3274
+ this.dragScrolling = true;
3275
+ this._ngZone.runOutsideAngular(this.startScrollInterval);
3276
+ }
3277
+ else {
3278
+ this.dragScrolling = false;
3279
+ this.stopScrolling();
3280
+ }
3281
+ }
3282
+ }
3283
+ stopScrolling() {
3284
+ this.stopScrollTimers$.next();
3285
+ }
3286
+ isStartOrEndInsideView(start, end) {
3287
+ const itemStart = start.getUnixTime();
3288
+ const itemEnd = end.getUnixTime();
3289
+ const viewStart = this.ganttUpper.view.start.getUnixTime();
3290
+ const viewEnd = this.ganttUpper.view.end.getUnixTime();
3291
+ if (itemStart < viewStart || itemEnd > viewEnd) {
3292
+ return false;
3293
+ }
3294
+ else {
3295
+ return true;
3296
+ }
3297
+ }
3178
3298
  createDrags(elementRef, item, ganttUpper) {
3179
3299
  this.item = item;
3180
3300
  this.barElement = elementRef.nativeElement;
@@ -3188,13 +3308,6 @@ class GanttBarDrag {
3188
3308
  const dragRef = this.createBarDrag();
3189
3309
  const dragHandlesRefs = this.createBarHandleDrags();
3190
3310
  this.dragRefs.push(dragRef, ...dragHandlesRefs);
3191
- // 创建拖拽容器并将所有元素添加到容器中,利用容器来实现自动滚动
3192
- if (!this.dropListRef) {
3193
- this.dropListRef = this.dragDrop.createDropList(this.dom.mainContainer);
3194
- this.dropListRef.autoScrollStep = autoScrollStep;
3195
- this.dropListRef.withOrientation('horizontal');
3196
- }
3197
- this.dropListRef.withItems([dragRef, ...dragHandlesRefs]);
3198
3311
  }
3199
3312
  if (!this.linkDragDisabled) {
3200
3313
  const linkDragRefs = this.createLinkHandleDrags();
@@ -3210,14 +3323,16 @@ class GanttBarDrag {
3210
3323
  this.dragRefs.forEach((dragRef) => dragRef.dispose());
3211
3324
  this.destroy$.next();
3212
3325
  this.destroy$.complete();
3326
+ this.stopScrolling();
3327
+ this.stopScrollTimers$.complete();
3213
3328
  }
3214
3329
  }
3215
- GanttBarDrag.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: GanttBarDrag, deps: [{ token: i2.DragDrop }, { token: GanttDomService }, { token: GanttDragContainer }, { token: NgxGanttRootComponent, skipSelf: true }], target: i0.ɵɵFactoryTarget.Injectable });
3330
+ GanttBarDrag.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: GanttBarDrag, deps: [{ token: i2.DragDrop }, { token: GanttDomService }, { token: GanttDragContainer }, { token: i0.NgZone }, { token: NgxGanttRootComponent, skipSelf: true }], target: i0.ɵɵFactoryTarget.Injectable });
3216
3331
  GanttBarDrag.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: GanttBarDrag });
3217
3332
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: GanttBarDrag, decorators: [{
3218
3333
  type: Injectable
3219
3334
  }], ctorParameters: function () {
3220
- return [{ type: i2.DragDrop }, { type: GanttDomService }, { type: GanttDragContainer }, { type: NgxGanttRootComponent, decorators: [{
3335
+ return [{ type: i2.DragDrop }, { type: GanttDomService }, { type: GanttDragContainer }, { type: i0.NgZone }, { type: NgxGanttRootComponent, decorators: [{
3221
3336
  type: SkipSelf
3222
3337
  }] }];
3223
3338
  } });
@@ -3228,10 +3343,11 @@ class GanttItemUpper {
3228
3343
  this.ganttUpper = ganttUpper;
3229
3344
  this.firstChange = true;
3230
3345
  this.unsubscribe$ = new Subject();
3346
+ this.refsUnsubscribe$ = new Subject();
3231
3347
  }
3232
3348
  ngOnInit() {
3233
3349
  this.firstChange = false;
3234
- this.item.refs$.pipe(takeUntil(this.unsubscribe$)).subscribe(() => {
3350
+ this.item.refs$.pipe(takeUntil(this.refsUnsubscribe$)).subscribe(() => {
3235
3351
  this.setPositions();
3236
3352
  });
3237
3353
  }
@@ -3241,11 +3357,11 @@ class GanttItemUpper {
3241
3357
  }
3242
3358
  }
3243
3359
  itemChange(item) {
3244
- this.unsubscribe$.next();
3245
- this.unsubscribe$.complete();
3360
+ this.refsUnsubscribe$.next();
3361
+ this.refsUnsubscribe$.complete();
3246
3362
  this.item = item;
3247
3363
  this.setPositions();
3248
- this.item.refs$.pipe(takeUntil(this.unsubscribe$)).subscribe(() => {
3364
+ this.item.refs$.pipe(takeUntil(this.refsUnsubscribe$)).subscribe(() => {
3249
3365
  this.setPositions();
3250
3366
  });
3251
3367
  }
@@ -3265,6 +3381,8 @@ class GanttItemUpper {
3265
3381
  ngOnDestroy() {
3266
3382
  this.unsubscribe$.next();
3267
3383
  this.unsubscribe$.complete();
3384
+ this.refsUnsubscribe$.next();
3385
+ this.refsUnsubscribe$.complete();
3268
3386
  }
3269
3387
  }
3270
3388
  GanttItemUpper.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: GanttItemUpper, deps: [{ token: i0.ElementRef }, { token: GANTT_UPPER_TOKEN }], target: i0.ɵɵFactoryTarget.Directive });
@@ -3302,9 +3420,13 @@ class NgxGanttBarComponent extends GanttItemUpper {
3302
3420
  });
3303
3421
  }
3304
3422
  ngOnChanges(changes) {
3423
+ var _a, _b;
3305
3424
  super.ngOnChanges(changes);
3306
3425
  if (!this.firstChange) {
3307
3426
  this.drag.updateItem(this.item);
3427
+ if (((_a = changes.item.currentValue.refs) === null || _a === void 0 ? void 0 : _a.width) !== ((_b = changes.item.previousValue.refs) === null || _b === void 0 ? void 0 : _b.width)) {
3428
+ this.setContentBackground();
3429
+ }
3308
3430
  }
3309
3431
  }
3310
3432
  ngAfterViewInit() {
@@ -3332,30 +3454,33 @@ class NgxGanttBarComponent extends GanttItemUpper {
3332
3454
  this.barClick.emit({ event, item: this.item.origin });
3333
3455
  }
3334
3456
  setContentBackground() {
3335
- const contentElement = this.contentElementRef.nativeElement;
3336
- const color = this.item.color || barBackground;
3337
- const style = this.item.barStyle || {};
3338
- if (this.item.origin.start && this.item.origin.end) {
3339
- style.background = color;
3340
- style.borderRadius = '';
3341
- }
3342
- if (this.item.origin.start && !this.item.origin.end) {
3343
- style.background = linearGradient('to left', hexToRgb(color, 0.55), hexToRgb(color, 1));
3344
- style.borderRadius = '4px 12.5px 12.5px 4px';
3345
- }
3346
- if (!this.item.origin.start && this.item.origin.end) {
3347
- style.background = linearGradient('to right', hexToRgb(color, 0.55), hexToRgb(color, 1));
3348
- style.borderRadius = '12.5px 4px 4px 12.5px';
3349
- }
3350
- if (this.item.progress >= 0) {
3351
- const contentProgressElement = contentElement.querySelector('.gantt-bar-content-progress');
3352
- style.background = hexToRgb(color, 0.3);
3353
- style.borderRadius = '';
3354
- contentProgressElement.style.background = color;
3355
- }
3356
- for (const key in style) {
3357
- if (style.hasOwnProperty(key)) {
3358
- contentElement.style[key] = style[key];
3457
+ var _a;
3458
+ if ((_a = this.item.refs) === null || _a === void 0 ? void 0 : _a.width) {
3459
+ const contentElement = this.contentElementRef.nativeElement;
3460
+ const color = this.item.color || barBackground;
3461
+ const style = this.item.barStyle || {};
3462
+ if (this.item.origin.start && this.item.origin.end) {
3463
+ style.background = color;
3464
+ style.borderRadius = '';
3465
+ }
3466
+ if (this.item.origin.start && !this.item.origin.end) {
3467
+ style.background = linearGradient('to left', hexToRgb(color, 0.55), hexToRgb(color, 1));
3468
+ style.borderRadius = '4px 12.5px 12.5px 4px';
3469
+ }
3470
+ if (!this.item.origin.start && this.item.origin.end) {
3471
+ style.background = linearGradient('to right', hexToRgb(color, 0.55), hexToRgb(color, 1));
3472
+ style.borderRadius = '12.5px 4px 4px 12.5px';
3473
+ }
3474
+ if (this.item.progress >= 0) {
3475
+ const contentProgressElement = contentElement.querySelector('.gantt-bar-content-progress');
3476
+ style.background = hexToRgb(color, 0.3);
3477
+ style.borderRadius = '';
3478
+ contentProgressElement.style.background = color;
3479
+ }
3480
+ for (const key in style) {
3481
+ if (style.hasOwnProperty(key)) {
3482
+ contentElement.style[key] = style[key];
3483
+ }
3359
3484
  }
3360
3485
  }
3361
3486
  }
@@ -3364,10 +3489,10 @@ class NgxGanttBarComponent extends GanttItemUpper {
3364
3489
  }
3365
3490
  }
3366
3491
  NgxGanttBarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: NgxGanttBarComponent, deps: [{ token: GanttDragContainer }, { token: GanttBarDrag }, { token: i0.ElementRef }, { token: GANTT_UPPER_TOKEN }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
3367
- NgxGanttBarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.4", 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, usesOnChanges: 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"] }] });
3492
+ NgxGanttBarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.4", 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, usesOnChanges: 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"] }] });
3368
3493
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: NgxGanttBarComponent, decorators: [{
3369
3494
  type: Component,
3370
- 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" }]
3495
+ 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" }]
3371
3496
  }], ctorParameters: function () {
3372
3497
  return [{ type: GanttDragContainer }, { type: GanttBarDrag }, { type: i0.ElementRef }, { type: GanttUpper, decorators: [{
3373
3498
  type: Inject,
@@ -3713,7 +3838,7 @@ NgxGanttComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", vers
3713
3838
  provide: GANTT_ABSTRACT_TOKEN,
3714
3839
  useExisting: forwardRef(() => NgxGanttComponent)
3715
3840
  }
3716
- ], 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 }, { propertyName: "virtualScroll", first: true, predicate: CdkVirtualScrollViewport, descendants: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<ngx-gantt-root #ganttRoot>\n <div class=\"gantt-header\">\n <gantt-table-header #tableHeader [columns]=\"columns\"></gantt-table-header>\n <div class=\"gantt-container-header\">\n <gantt-calendar-header></gantt-calendar-header>\n </div>\n </div>\n <gantt-loader *ngIf=\"loading\"></gantt-loader>\n <cdk-virtual-scroll-viewport\n class=\"gantt-virtual-scroll-viewport\"\n [itemSize]=\"styles.lineHeight\"\n [minBufferPx]=\"styles.lineHeight * 10\"\n [maxBufferPx]=\"styles.lineHeight * 20\"\n >\n <ng-container *cdkVirtualFor=\"let item of flatData; trackBy: trackBy\"></ng-container>\n <div class=\"gantt-side\" [style.width.px]=\"tableHeader.tableWidth + 1\">\n <div class=\"gantt-side-container\">\n <div class=\"gantt-table\">\n <gantt-table-body\n [flatData]=\"flatData\"\n [renderData]=\"renderData\"\n [columns]=\"columns\"\n [groupTemplate]=\"groupTemplate\"\n [emptyTemplate]=\"tableEmptyTemplate\"\n [rowBeforeTemplate]=\"table?.rowBeforeTemplate\"\n [rowAfterTemplate]=\"table?.rowAfterTemplate\"\n [draggable]=\"table.draggable\"\n [dropEnterPredicate]=\"table.dropEnterPredicate\"\n (dragDropped)=\"table.dragDropped.emit($event)\"\n (itemClick)=\"selectItem($event)\"\n ></gantt-table-body>\n </div>\n </div>\n </div>\n <div class=\"gantt-container\">\n <gantt-calendar-grid></gantt-calendar-grid>\n <div class=\"gantt-main\">\n <gantt-main\n [flatData]=\"flatData\"\n [renderData]=\"renderData\"\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 </div>\n </div>\n </cdk-virtual-scroll-viewport>\n <gantt-drag-backdrop [style.left.px]=\"tableHeader.tableWidth + 1\"></gantt-drag-backdrop>\n</ngx-gantt-root>\n", dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.CdkFixedSizeVirtualScroll, selector: "cdk-virtual-scroll-viewport[itemSize]", inputs: ["itemSize", "minBufferPx", "maxBufferPx"] }, { kind: "directive", type: i3.CdkVirtualForOf, selector: "[cdkVirtualFor][cdkVirtualForOf]", inputs: ["cdkVirtualForOf", "cdkVirtualForTrackBy", "cdkVirtualForTemplate", "cdkVirtualForTemplateCacheSize"] }, { kind: "component", type: i3.CdkVirtualScrollViewport, selector: "cdk-virtual-scroll-viewport", inputs: ["orientation", "appendOnly"], outputs: ["scrolledIndexChange"] }, { kind: "component", type: GanttTableHeaderComponent, selector: "gantt-table-header", inputs: ["columns"] }, { kind: "component", type: GanttTableBodyComponent, selector: "gantt-table-body", inputs: ["renderData", "flatData", "columns", "groupTemplate", "emptyTemplate", "rowBeforeTemplate", "rowAfterTemplate", "draggable", "dropEnterPredicate"], outputs: ["dragDropped", "itemClick"] }, { kind: "component", type: GanttMainComponent, selector: "gantt-main", inputs: ["renderData", "flatData", "groupHeaderTemplate", "itemTemplate", "barTemplate", "rangeTemplate"], outputs: ["barClick", "lineClick"] }, { kind: "component", type: GanttCalendarHeaderComponent, selector: "gantt-calendar-header" }, { kind: "component", type: GanttCalendarGridComponent, selector: "gantt-calendar-grid" }, { kind: "component", type: GanttLoaderComponent, selector: "gantt-loader" }, { kind: "component", type: GanttDragBackdropComponent, selector: "gantt-drag-backdrop" }, { kind: "component", type: NgxGanttRootComponent, selector: "ngx-gantt-root", inputs: ["sideWidth"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
3841
+ ], 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 }, { propertyName: "virtualScroll", first: true, predicate: CdkVirtualScrollViewport, descendants: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<ngx-gantt-root #ganttRoot>\n <div class=\"gantt-header\">\n <gantt-table-header #tableHeader [columns]=\"columns\"></gantt-table-header>\n <div class=\"gantt-container-header\">\n <gantt-calendar-header></gantt-calendar-header>\n </div>\n </div>\n <gantt-loader *ngIf=\"loading\"></gantt-loader>\n\n <cdk-virtual-scroll-viewport\n class=\"gantt-virtual-scroll-viewport\"\n [itemSize]=\"styles.lineHeight\"\n [minBufferPx]=\"styles.lineHeight * 10\"\n [maxBufferPx]=\"styles.lineHeight * 20\"\n >\n <ng-container *cdkVirtualFor=\"let item of flatData; trackBy: trackBy\"></ng-container>\n <div class=\"gantt-side\" [style.width.px]=\"tableHeader.tableWidth + 1\">\n <div class=\"gantt-side-container\">\n <div class=\"gantt-table\">\n <gantt-table-body\n [flatData]=\"flatData\"\n [renderData]=\"renderData\"\n [columns]=\"columns\"\n [groupTemplate]=\"groupTemplate\"\n [emptyTemplate]=\"tableEmptyTemplate\"\n [rowBeforeTemplate]=\"table?.rowBeforeTemplate\"\n [rowAfterTemplate]=\"table?.rowAfterTemplate\"\n [draggable]=\"table.draggable\"\n [dropEnterPredicate]=\"table.dropEnterPredicate\"\n (dragDropped)=\"table.dragDropped.emit($event)\"\n (itemClick)=\"selectItem($event)\"\n ></gantt-table-body>\n </div>\n </div>\n </div>\n\n <div class=\"gantt-container\">\n <gantt-calendar-grid></gantt-calendar-grid>\n <div class=\"gantt-main\">\n <gantt-main\n [flatData]=\"flatData\"\n [renderData]=\"renderData\"\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 </div>\n </div>\n </cdk-virtual-scroll-viewport>\n\n <gantt-drag-backdrop [style.left.px]=\"tableHeader.tableWidth + 1\"></gantt-drag-backdrop>\n</ngx-gantt-root>\n", dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.CdkFixedSizeVirtualScroll, selector: "cdk-virtual-scroll-viewport[itemSize]", inputs: ["itemSize", "minBufferPx", "maxBufferPx"] }, { kind: "directive", type: i3.CdkVirtualForOf, selector: "[cdkVirtualFor][cdkVirtualForOf]", inputs: ["cdkVirtualForOf", "cdkVirtualForTrackBy", "cdkVirtualForTemplate", "cdkVirtualForTemplateCacheSize"] }, { kind: "component", type: i3.CdkVirtualScrollViewport, selector: "cdk-virtual-scroll-viewport", inputs: ["orientation", "appendOnly"], outputs: ["scrolledIndexChange"] }, { kind: "component", type: GanttTableHeaderComponent, selector: "gantt-table-header", inputs: ["columns"] }, { kind: "component", type: GanttTableBodyComponent, selector: "gantt-table-body", inputs: ["renderData", "flatData", "columns", "groupTemplate", "emptyTemplate", "rowBeforeTemplate", "rowAfterTemplate", "draggable", "dropEnterPredicate"], outputs: ["dragDropped", "itemClick"] }, { kind: "component", type: GanttMainComponent, selector: "gantt-main", inputs: ["renderData", "flatData", "groupHeaderTemplate", "itemTemplate", "barTemplate", "rangeTemplate"], outputs: ["barClick", "lineClick"] }, { kind: "component", type: GanttCalendarHeaderComponent, selector: "gantt-calendar-header" }, { kind: "component", type: GanttCalendarGridComponent, selector: "gantt-calendar-grid" }, { kind: "component", type: GanttLoaderComponent, selector: "gantt-loader" }, { kind: "component", type: GanttDragBackdropComponent, selector: "gantt-drag-backdrop" }, { kind: "component", type: NgxGanttRootComponent, selector: "ngx-gantt-root", inputs: ["sideWidth"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
3717
3842
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: NgxGanttComponent, decorators: [{
3718
3843
  type: Component,
3719
3844
  args: [{ selector: 'ngx-gantt', changeDetection: ChangeDetectionStrategy.OnPush, providers: [
@@ -3725,7 +3850,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImpor
3725
3850
  provide: GANTT_ABSTRACT_TOKEN,
3726
3851
  useExisting: forwardRef(() => NgxGanttComponent)
3727
3852
  }
3728
- ], template: "<ngx-gantt-root #ganttRoot>\n <div class=\"gantt-header\">\n <gantt-table-header #tableHeader [columns]=\"columns\"></gantt-table-header>\n <div class=\"gantt-container-header\">\n <gantt-calendar-header></gantt-calendar-header>\n </div>\n </div>\n <gantt-loader *ngIf=\"loading\"></gantt-loader>\n <cdk-virtual-scroll-viewport\n class=\"gantt-virtual-scroll-viewport\"\n [itemSize]=\"styles.lineHeight\"\n [minBufferPx]=\"styles.lineHeight * 10\"\n [maxBufferPx]=\"styles.lineHeight * 20\"\n >\n <ng-container *cdkVirtualFor=\"let item of flatData; trackBy: trackBy\"></ng-container>\n <div class=\"gantt-side\" [style.width.px]=\"tableHeader.tableWidth + 1\">\n <div class=\"gantt-side-container\">\n <div class=\"gantt-table\">\n <gantt-table-body\n [flatData]=\"flatData\"\n [renderData]=\"renderData\"\n [columns]=\"columns\"\n [groupTemplate]=\"groupTemplate\"\n [emptyTemplate]=\"tableEmptyTemplate\"\n [rowBeforeTemplate]=\"table?.rowBeforeTemplate\"\n [rowAfterTemplate]=\"table?.rowAfterTemplate\"\n [draggable]=\"table.draggable\"\n [dropEnterPredicate]=\"table.dropEnterPredicate\"\n (dragDropped)=\"table.dragDropped.emit($event)\"\n (itemClick)=\"selectItem($event)\"\n ></gantt-table-body>\n </div>\n </div>\n </div>\n <div class=\"gantt-container\">\n <gantt-calendar-grid></gantt-calendar-grid>\n <div class=\"gantt-main\">\n <gantt-main\n [flatData]=\"flatData\"\n [renderData]=\"renderData\"\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 </div>\n </div>\n </cdk-virtual-scroll-viewport>\n <gantt-drag-backdrop [style.left.px]=\"tableHeader.tableWidth + 1\"></gantt-drag-backdrop>\n</ngx-gantt-root>\n" }]
3853
+ ], template: "<ngx-gantt-root #ganttRoot>\n <div class=\"gantt-header\">\n <gantt-table-header #tableHeader [columns]=\"columns\"></gantt-table-header>\n <div class=\"gantt-container-header\">\n <gantt-calendar-header></gantt-calendar-header>\n </div>\n </div>\n <gantt-loader *ngIf=\"loading\"></gantt-loader>\n\n <cdk-virtual-scroll-viewport\n class=\"gantt-virtual-scroll-viewport\"\n [itemSize]=\"styles.lineHeight\"\n [minBufferPx]=\"styles.lineHeight * 10\"\n [maxBufferPx]=\"styles.lineHeight * 20\"\n >\n <ng-container *cdkVirtualFor=\"let item of flatData; trackBy: trackBy\"></ng-container>\n <div class=\"gantt-side\" [style.width.px]=\"tableHeader.tableWidth + 1\">\n <div class=\"gantt-side-container\">\n <div class=\"gantt-table\">\n <gantt-table-body\n [flatData]=\"flatData\"\n [renderData]=\"renderData\"\n [columns]=\"columns\"\n [groupTemplate]=\"groupTemplate\"\n [emptyTemplate]=\"tableEmptyTemplate\"\n [rowBeforeTemplate]=\"table?.rowBeforeTemplate\"\n [rowAfterTemplate]=\"table?.rowAfterTemplate\"\n [draggable]=\"table.draggable\"\n [dropEnterPredicate]=\"table.dropEnterPredicate\"\n (dragDropped)=\"table.dragDropped.emit($event)\"\n (itemClick)=\"selectItem($event)\"\n ></gantt-table-body>\n </div>\n </div>\n </div>\n\n <div class=\"gantt-container\">\n <gantt-calendar-grid></gantt-calendar-grid>\n <div class=\"gantt-main\">\n <gantt-main\n [flatData]=\"flatData\"\n [renderData]=\"renderData\"\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 </div>\n </div>\n </cdk-virtual-scroll-viewport>\n\n <gantt-drag-backdrop [style.left.px]=\"tableHeader.tableWidth + 1\"></gantt-drag-backdrop>\n</ngx-gantt-root>\n" }]
3729
3854
  }], ctorParameters: function () {
3730
3855
  return [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }, { type: i0.NgZone }, { type: GanttPrintService, decorators: [{
3731
3856
  type: Optional