@worktile/gantt 15.1.0-next.9 → 15.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/class/link.d.ts +1 -1
- package/components/bar/bar-drag.d.ts +11 -1
- package/components/bar/bar.component.scss +2 -2
- package/components/links/links.component.d.ts +2 -2
- package/components/main/gantt-main.component.d.ts +3 -3
- package/components/table/body/gantt-table-body.component.d.ts +5 -5
- package/esm2020/class/link.mjs +2 -2
- package/esm2020/components/bar/bar-drag.mjs +110 -40
- package/esm2020/components/bar/bar.component.mjs +4 -2
- package/esm2020/components/links/links.component.mjs +5 -5
- package/esm2020/components/main/gantt-main.component.mjs +5 -5
- package/esm2020/components/table/body/gantt-table-body.component.mjs +18 -18
- package/esm2020/gantt.component.mjs +46 -28
- package/esm2020/gantt.module.mjs +1 -7
- package/esm2020/gantt.styles.mjs +2 -2
- package/esm2020/utils/drag-scroll.mjs +20 -1
- package/fesm2015/worktile-gantt.mjs +203 -99
- package/fesm2015/worktile-gantt.mjs.map +1 -1
- package/fesm2020/worktile-gantt.mjs +202 -98
- package/fesm2020/worktile-gantt.mjs.map +1 -1
- package/gantt.component.d.ts +7 -6
- package/gantt.component.scss +13 -0
- package/gantt.styles.d.ts +1 -1
- package/package.json +1 -1
- package/styles/variables.scss +3 -2
- package/utils/drag-scroll.d.ts +7 -0
- package/components/calendar/calendar.component.scss +0 -79
- package/components/table/gantt-table.component.scss +0 -237
|
@@ -2,6 +2,7 @@ import * as i0 from '@angular/core';
|
|
|
2
2
|
import { InjectionToken, EventEmitter, Directive, Inject, Input, Output, ContentChild, HostBinding, Component, Injectable, ViewChild, Pipe, ViewChildren, PLATFORM_ID, ElementRef, Optional, forwardRef, ChangeDetectionStrategy, ContentChildren, NgModule } from '@angular/core';
|
|
3
3
|
import * as i1 from '@angular/common';
|
|
4
4
|
import { DOCUMENT, isPlatformServer, CommonModule } from '@angular/common';
|
|
5
|
+
import { __awaiter, __decorate, __param } from 'tslib';
|
|
5
6
|
import { take, takeUntil, skip, switchMap, debounceTime, map, pairwise, auditTime as auditTime$1, startWith as startWith$1, finalize } from 'rxjs/operators';
|
|
6
7
|
import { BehaviorSubject, Subject, from, takeUntil as takeUntil$1, startWith, auditTime, filter, merge, EMPTY, fromEvent, Observable, interval, animationFrameScheduler } from 'rxjs';
|
|
7
8
|
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';
|
|
@@ -10,7 +11,7 @@ import { SelectionModel } from '@angular/cdk/collections';
|
|
|
10
11
|
import { coerceBooleanProperty, coerceCssPixelValue } from '@angular/cdk/coercion';
|
|
11
12
|
import * as i3 from '@angular/cdk/scrolling';
|
|
12
13
|
import { CdkVirtualScrollViewport, ScrollingModule } from '@angular/cdk/scrolling';
|
|
13
|
-
import {
|
|
14
|
+
import { InputBoolean } from 'ngx-tethys/core';
|
|
14
15
|
import * as i2 from '@angular/cdk/drag-drop';
|
|
15
16
|
import { CdkDrag, DragDropModule } from '@angular/cdk/drag-drop';
|
|
16
17
|
|
|
@@ -222,7 +223,7 @@ var LinkColors;
|
|
|
222
223
|
(function (LinkColors) {
|
|
223
224
|
LinkColors["default"] = "#cacaca";
|
|
224
225
|
LinkColors["blocked"] = "#FF7575";
|
|
225
|
-
LinkColors["active"] = "#
|
|
226
|
+
LinkColors["active"] = "#6698ff";
|
|
226
227
|
})(LinkColors || (LinkColors = {}));
|
|
227
228
|
|
|
228
229
|
var GanttItemType;
|
|
@@ -778,7 +779,7 @@ const sideWidth = 400;
|
|
|
778
779
|
const sideMiddleWidth = 500;
|
|
779
780
|
const sideMaxWidth = 600;
|
|
780
781
|
const sideMinWidth = 400;
|
|
781
|
-
const barBackground = '#
|
|
782
|
+
const barBackground = '#6698ff';
|
|
782
783
|
const rangeHeight = 17;
|
|
783
784
|
const todayHeight = 24;
|
|
784
785
|
const todayWidth = 35;
|
|
@@ -1730,16 +1731,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImpor
|
|
|
1730
1731
|
}] });
|
|
1731
1732
|
|
|
1732
1733
|
class GanttTableBodyComponent {
|
|
1733
|
-
set
|
|
1734
|
+
set viewportItems(data) {
|
|
1734
1735
|
const firstData = data[0];
|
|
1735
1736
|
if (firstData && firstData.hasOwnProperty('items')) {
|
|
1736
1737
|
this.hasGroup = true;
|
|
1737
1738
|
}
|
|
1738
1739
|
this.ganttTableEmptyClass = (data === null || data === void 0 ? void 0 : data.length) ? false : true;
|
|
1739
|
-
this.
|
|
1740
|
+
this._viewportItems = data;
|
|
1740
1741
|
}
|
|
1741
|
-
get
|
|
1742
|
-
return this.
|
|
1742
|
+
get viewportItems() {
|
|
1743
|
+
return this._viewportItems;
|
|
1743
1744
|
}
|
|
1744
1745
|
constructor(gantt, ganttUpper, cdr, document) {
|
|
1745
1746
|
this.gantt = gantt;
|
|
@@ -1903,14 +1904,14 @@ class GanttTableBodyComponent {
|
|
|
1903
1904
|
this.destroy$.complete();
|
|
1904
1905
|
}
|
|
1905
1906
|
removeItem(item, children) {
|
|
1906
|
-
this.
|
|
1907
|
-
this.
|
|
1907
|
+
this.viewportItems.splice(this.viewportItems.indexOf(item), 1 + children.length);
|
|
1908
|
+
this.flatItems.splice(this.flatItems.indexOf(item), 1 + children.length);
|
|
1908
1909
|
}
|
|
1909
1910
|
insertItem(target, inserted, children, position) {
|
|
1910
1911
|
var _a;
|
|
1911
1912
|
if (position === 'before') {
|
|
1912
|
-
this.
|
|
1913
|
-
this.
|
|
1913
|
+
this.viewportItems.splice(this.viewportItems.indexOf(target), 0, inserted, ...children);
|
|
1914
|
+
this.flatItems.splice(this.flatItems.indexOf(target), 0, inserted, ...children);
|
|
1914
1915
|
}
|
|
1915
1916
|
else {
|
|
1916
1917
|
const dragRef = this.cdkDrags.find((drag) => drag.data === target);
|
|
@@ -1919,19 +1920,19 @@ class GanttTableBodyComponent {
|
|
|
1919
1920
|
if (target.expanded) {
|
|
1920
1921
|
childrenCount = ((_a = this.getChildrenElementsByElement(dragRef.element.nativeElement)) === null || _a === void 0 ? void 0 : _a.length) || 0;
|
|
1921
1922
|
}
|
|
1922
|
-
this.
|
|
1923
|
-
this.
|
|
1923
|
+
this.viewportItems.splice(this.viewportItems.indexOf(target) + 1 + childrenCount, 0, inserted, ...children);
|
|
1924
|
+
this.flatItems.splice(this.flatItems.indexOf(target) + 1 + childrenCount, 0, inserted, ...children);
|
|
1924
1925
|
}
|
|
1925
1926
|
}
|
|
1926
1927
|
insertChildrenItem(target, inserted, children) {
|
|
1927
1928
|
if (target.expanded) {
|
|
1928
|
-
this.
|
|
1929
|
-
this.
|
|
1929
|
+
this.viewportItems.splice(this.viewportItems.indexOf(target) + target.children.length + 1, 0, inserted, ...children);
|
|
1930
|
+
this.flatItems.splice(this.flatItems.indexOf(target) + target.children.length + 1, 0, inserted, ...children);
|
|
1930
1931
|
}
|
|
1931
1932
|
target.children.push(inserted);
|
|
1932
1933
|
}
|
|
1933
1934
|
getParentByItem(item) {
|
|
1934
|
-
return (this.
|
|
1935
|
+
return (this.flatItems || []).find((n) => {
|
|
1935
1936
|
var _a;
|
|
1936
1937
|
return (_a = n.children) === null || _a === void 0 ? void 0 : _a.includes(item);
|
|
1937
1938
|
});
|
|
@@ -1990,10 +1991,10 @@ class GanttTableBodyComponent {
|
|
|
1990
1991
|
}
|
|
1991
1992
|
}
|
|
1992
1993
|
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 });
|
|
1993
|
-
GanttTableBodyComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.4", type: GanttTableBodyComponent, selector: "gantt-table-body", inputs: {
|
|
1994
|
+
GanttTableBodyComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.4", type: GanttTableBodyComponent, selector: "gantt-table-body", inputs: { viewportItems: "viewportItems", flatItems: "flatItems", columns: "columns", groupTemplate: "groupTemplate", emptyTemplate: "emptyTemplate", rowBeforeTemplate: "rowBeforeTemplate", rowAfterTemplate: "rowAfterTemplate", draggable: "draggable", dropEnterPredicate: "dropEnterPredicate" }, outputs: { dragDropped: "dragDropped", dragStarted: "dragStarted", dragEnded: "dragEnded", 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]=\"viewportItems\"\n [cdkDropListSortingDisabled]=\"true\"\n (cdkDropListDropped)=\"onListDropped($event)\"\n>\n <ng-container *ngIf=\"!viewportItems?.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=\"viewportItems && viewportItems.length > 0\">\n <ng-container *ngFor=\"let item of viewportItems; 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 && ((gantt.async && item.expandable) || item.children?.length > 0)\">\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" }] });
|
|
1994
1995
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: GanttTableBodyComponent, decorators: [{
|
|
1995
1996
|
type: Component,
|
|
1996
|
-
args: [{ selector: 'gantt-table-body', template: "<div\n class=\"gantt-table-body-container\"\n cdkDropList\n [cdkDropListAutoScrollStep]=\"6\"\n [cdkDropListData]=\"
|
|
1997
|
+
args: [{ selector: 'gantt-table-body', template: "<div\n class=\"gantt-table-body-container\"\n cdkDropList\n [cdkDropListAutoScrollStep]=\"6\"\n [cdkDropListData]=\"viewportItems\"\n [cdkDropListSortingDisabled]=\"true\"\n (cdkDropListDropped)=\"onListDropped($event)\"\n>\n <ng-container *ngIf=\"!viewportItems?.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=\"viewportItems && viewportItems.length > 0\">\n <ng-container *ngFor=\"let item of viewportItems; 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 && ((gantt.async && item.expandable) || item.children?.length > 0)\">\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" }]
|
|
1997
1998
|
}], ctorParameters: function () {
|
|
1998
1999
|
return [{ type: undefined, decorators: [{
|
|
1999
2000
|
type: Inject,
|
|
@@ -2005,9 +2006,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImpor
|
|
|
2005
2006
|
type: Inject,
|
|
2006
2007
|
args: [DOCUMENT]
|
|
2007
2008
|
}] }];
|
|
2008
|
-
}, propDecorators: {
|
|
2009
|
+
}, propDecorators: { viewportItems: [{
|
|
2009
2010
|
type: Input
|
|
2010
|
-
}],
|
|
2011
|
+
}], flatItems: [{
|
|
2011
2012
|
type: Input
|
|
2012
2013
|
}], columns: [{
|
|
2013
2014
|
type: Input
|
|
@@ -2313,7 +2314,7 @@ class GanttLinksComponent {
|
|
|
2313
2314
|
this.ngZone = ngZone;
|
|
2314
2315
|
// @Input() groups: GanttGroupInternal[] = [];
|
|
2315
2316
|
// @Input() items: GanttItemInternal[] = [];
|
|
2316
|
-
this.
|
|
2317
|
+
this.flatItems = [];
|
|
2317
2318
|
this.lineClick = new EventEmitter();
|
|
2318
2319
|
this.links = [];
|
|
2319
2320
|
this.ganttLinkTypes = GanttLinkType;
|
|
@@ -2390,7 +2391,7 @@ class GanttLinksComponent {
|
|
|
2390
2391
|
// });
|
|
2391
2392
|
// });
|
|
2392
2393
|
// }
|
|
2393
|
-
this.
|
|
2394
|
+
this.flatItems.forEach((item, itemIndex) => {
|
|
2394
2395
|
if (!item.hasOwnProperty('items')) {
|
|
2395
2396
|
const ganttItem = item;
|
|
2396
2397
|
if (ganttItem.refs) {
|
|
@@ -2470,7 +2471,7 @@ class GanttLinksComponent {
|
|
|
2470
2471
|
}
|
|
2471
2472
|
}
|
|
2472
2473
|
GanttLinksComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: GanttLinksComponent, deps: [{ token: GANTT_UPPER_TOKEN }, { token: i0.ChangeDetectorRef }, { token: i0.ElementRef }, { token: GanttDragContainer }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
|
|
2473
|
-
GanttLinksComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.4", type: GanttLinksComponent, selector: "gantt-links-overlay", inputs: {
|
|
2474
|
+
GanttLinksComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.4", type: GanttLinksComponent, selector: "gantt-links-overlay", inputs: { flatItems: "flatItems" }, 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"] }] });
|
|
2474
2475
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: GanttLinksComponent, decorators: [{
|
|
2475
2476
|
type: Component,
|
|
2476
2477
|
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" }]
|
|
@@ -2479,7 +2480,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImpor
|
|
|
2479
2480
|
type: Inject,
|
|
2480
2481
|
args: [GANTT_UPPER_TOKEN]
|
|
2481
2482
|
}] }, { type: i0.ChangeDetectorRef }, { type: i0.ElementRef }, { type: GanttDragContainer }, { type: i0.NgZone }];
|
|
2482
|
-
}, propDecorators: {
|
|
2483
|
+
}, propDecorators: { flatItems: [{
|
|
2483
2484
|
type: Input
|
|
2484
2485
|
}], lineClick: [{
|
|
2485
2486
|
type: Output
|
|
@@ -2552,6 +2553,25 @@ function isPointerNearClientRect(rect, threshold, pointerX, pointerY) {
|
|
|
2552
2553
|
const yThreshold = height * threshold;
|
|
2553
2554
|
return pointerY > top - yThreshold && pointerY < bottom + yThreshold && pointerX > left - xThreshold && pointerX < right + xThreshold;
|
|
2554
2555
|
}
|
|
2556
|
+
/**
|
|
2557
|
+
* Gets the speed rate of auto scrolling
|
|
2558
|
+
* @param clientRect Dimensions of the node.
|
|
2559
|
+
* @param pointerX Position of the user's pointer along the x axis.
|
|
2560
|
+
* @param horizontalScrollDirection The direction in which the mouse is dragged horizontally
|
|
2561
|
+
*/
|
|
2562
|
+
function getAutoScrollSpeedRates(clientRect, pointerX, horizontalScrollDirection) {
|
|
2563
|
+
let autoScrollSpeedRates = 4;
|
|
2564
|
+
const speedLevels = 4;
|
|
2565
|
+
const { left, right, width } = clientRect;
|
|
2566
|
+
const xThreshold = width * SCROLL_PROXIMITY_THRESHOLD;
|
|
2567
|
+
if (horizontalScrollDirection === 1 /* AutoScrollHorizontalDirection.LEFT */) {
|
|
2568
|
+
autoScrollSpeedRates = Math.ceil((xThreshold - (pointerX > left ? pointerX - left : 0)) / (xThreshold / speedLevels));
|
|
2569
|
+
}
|
|
2570
|
+
if (horizontalScrollDirection === 2 /* AutoScrollHorizontalDirection.RIGHT */) {
|
|
2571
|
+
autoScrollSpeedRates = Math.ceil((xThreshold - (right > pointerX ? right - pointerX : 0)) / (xThreshold / speedLevels));
|
|
2572
|
+
}
|
|
2573
|
+
return autoScrollSpeedRates;
|
|
2574
|
+
}
|
|
2555
2575
|
|
|
2556
2576
|
const scrollThreshold = 50;
|
|
2557
2577
|
var ScrollDirection;
|
|
@@ -2668,7 +2688,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImpor
|
|
|
2668
2688
|
*/
|
|
2669
2689
|
const DROP_PROXIMITY_THRESHOLD = 0.05;
|
|
2670
2690
|
const dragMinWidth = 10;
|
|
2671
|
-
const
|
|
2691
|
+
const autoScrollBaseStep = 2;
|
|
2672
2692
|
const activeClass = 'gantt-bar-active';
|
|
2673
2693
|
const dropActiveClass = 'gantt-bar-drop-active';
|
|
2674
2694
|
const singleDropActiveClass = 'gantt-bar-single-drop-active';
|
|
@@ -2684,6 +2704,12 @@ class GanttBarDrag {
|
|
|
2684
2704
|
get linkDragDisabled() {
|
|
2685
2705
|
return !this.item.linkable || !this.ganttUpper.linkable;
|
|
2686
2706
|
}
|
|
2707
|
+
get barHandleDragMoveAndScrollDistance() {
|
|
2708
|
+
return this.barHandleDragMoveDistance + this.dragScrollDistance;
|
|
2709
|
+
}
|
|
2710
|
+
get autoScrollStep() {
|
|
2711
|
+
return Math.pow(autoScrollBaseStep, this.autoScrollSpeedRates);
|
|
2712
|
+
}
|
|
2687
2713
|
constructor(dragDrop, dom, dragContainer, _ngZone) {
|
|
2688
2714
|
this.dragDrop = dragDrop;
|
|
2689
2715
|
this.dom = dom;
|
|
@@ -2703,13 +2729,15 @@ class GanttBarDrag {
|
|
|
2703
2729
|
this.dragScrollDistance = 0;
|
|
2704
2730
|
/** Horizontal direction in which the list is currently scrolling. */
|
|
2705
2731
|
this._horizontalScrollDirection = 0 /* AutoScrollHorizontalDirection.NONE */;
|
|
2732
|
+
/** Speed ratio for auto scroll */
|
|
2733
|
+
this.autoScrollSpeedRates = 1;
|
|
2706
2734
|
this.startScrollInterval = () => {
|
|
2707
2735
|
this.stopScrolling();
|
|
2708
2736
|
interval(0, animationFrameScheduler)
|
|
2709
2737
|
.pipe(takeUntil(this.stopScrollTimers$))
|
|
2710
2738
|
.subscribe(() => {
|
|
2711
2739
|
const node = this.dom.mainContainer;
|
|
2712
|
-
const scrollStep = autoScrollStep;
|
|
2740
|
+
const scrollStep = this.autoScrollStep;
|
|
2713
2741
|
if (this._horizontalScrollDirection === 1 /* AutoScrollHorizontalDirection.LEFT */) {
|
|
2714
2742
|
node.scrollBy(-scrollStep, 0);
|
|
2715
2743
|
}
|
|
@@ -2818,16 +2846,32 @@ class GanttBarDrag {
|
|
|
2818
2846
|
const dragScrollDistance = this.dom.mainContainer.scrollLeft - this.containerScrollLeft;
|
|
2819
2847
|
this.dragScrollDistance = dragScrollDistance;
|
|
2820
2848
|
dragRef['_boundaryRect'] = this.dom.mainItems.getBoundingClientRect();
|
|
2821
|
-
this.
|
|
2849
|
+
if (this.dragScrolling && this.isStartGreaterThanEndWhenBarHandleDragMove(isBefore)) {
|
|
2850
|
+
this.stopScrolling();
|
|
2851
|
+
this.dragScrolling = false;
|
|
2852
|
+
}
|
|
2853
|
+
if (isBefore) {
|
|
2854
|
+
this.barBeforeHandleDragMove();
|
|
2855
|
+
}
|
|
2856
|
+
else {
|
|
2857
|
+
this.barAfterHandleDragMove();
|
|
2858
|
+
}
|
|
2822
2859
|
}
|
|
2823
2860
|
});
|
|
2824
2861
|
this.dragContainer.dragStarted.emit({ item: this.item.origin });
|
|
2825
2862
|
});
|
|
2826
2863
|
dragRef.moved.subscribe((event) => {
|
|
2827
|
-
this.
|
|
2864
|
+
if (this.barHandleDragMoveRecordDays && this.barHandleDragMoveRecordDays > 0) {
|
|
2865
|
+
this.startScrollingIfNecessary(event.pointerPosition.x, event.pointerPosition.y);
|
|
2866
|
+
}
|
|
2828
2867
|
this.barHandleDragMoveDistance = event.distance.x;
|
|
2829
2868
|
if (!this.dragScrolling) {
|
|
2830
|
-
|
|
2869
|
+
if (isBefore) {
|
|
2870
|
+
this.barBeforeHandleDragMove();
|
|
2871
|
+
}
|
|
2872
|
+
else {
|
|
2873
|
+
this.barAfterHandleDragMove();
|
|
2874
|
+
}
|
|
2831
2875
|
}
|
|
2832
2876
|
});
|
|
2833
2877
|
dragRef.ended.subscribe((event) => {
|
|
@@ -2907,10 +2951,10 @@ class GanttBarDrag {
|
|
|
2907
2951
|
let left = dragRect.left - rootRect.left - (this.dom.side.clientWidth + 1);
|
|
2908
2952
|
if (this.dragScrolling) {
|
|
2909
2953
|
if (this._horizontalScrollDirection === 1 /* AutoScrollHorizontalDirection.LEFT */) {
|
|
2910
|
-
left += autoScrollStep;
|
|
2954
|
+
left += this.autoScrollStep;
|
|
2911
2955
|
}
|
|
2912
2956
|
else if (this._horizontalScrollDirection === 2 /* AutoScrollHorizontalDirection.RIGHT */) {
|
|
2913
|
-
left -= autoScrollStep;
|
|
2957
|
+
left -= this.autoScrollStep;
|
|
2914
2958
|
}
|
|
2915
2959
|
}
|
|
2916
2960
|
const width = dragRect.right - dragRect.left;
|
|
@@ -2960,44 +3004,51 @@ class GanttBarDrag {
|
|
|
2960
3004
|
this.item.updateDate(start, end);
|
|
2961
3005
|
this.dragContainer.dragMoved.emit({ item: this.item.origin });
|
|
2962
3006
|
}
|
|
2963
|
-
|
|
2964
|
-
const
|
|
2965
|
-
|
|
2966
|
-
|
|
2967
|
-
|
|
2968
|
-
|
|
2969
|
-
|
|
2970
|
-
|
|
2971
|
-
|
|
3007
|
+
barBeforeHandleDragMove() {
|
|
3008
|
+
const { x, start, oneDayWidth } = this.startOfBarHandle();
|
|
3009
|
+
const width = this.item.refs.width + this.barHandleDragMoveAndScrollDistance * -1;
|
|
3010
|
+
const days = differenceInDays(this.item.end.value, start.value);
|
|
3011
|
+
if (width > dragMinWidth && days > 0) {
|
|
3012
|
+
this.barElement.style.width = width + 'px';
|
|
3013
|
+
this.barElement.style.left = x + 'px';
|
|
3014
|
+
this.openDragBackdrop(this.barElement, start, this.item.end);
|
|
3015
|
+
if (!this.isStartOrEndInsideView(start, this.item.end)) {
|
|
3016
|
+
return;
|
|
3017
|
+
}
|
|
3018
|
+
this.item.updateDate(start, this.item.end);
|
|
3019
|
+
}
|
|
3020
|
+
else {
|
|
3021
|
+
if (this.barHandleDragMoveRecordDays > 0 && days <= 0) {
|
|
3022
|
+
this.barElement.style.width = oneDayWidth + 'px';
|
|
3023
|
+
const x = this.ganttUpper.view.getXPointByDate(this.item.end);
|
|
2972
3024
|
this.barElement.style.left = x + 'px';
|
|
2973
|
-
this.openDragBackdrop(this.barElement, start, this.item.end);
|
|
2974
|
-
if (!this.isStartOrEndInsideView(start, this.item.end)) {
|
|
2975
|
-
return;
|
|
2976
|
-
}
|
|
2977
|
-
this.item.updateDate(start, this.item.end);
|
|
2978
3025
|
}
|
|
2979
|
-
|
|
2980
|
-
|
|
2981
|
-
|
|
3026
|
+
this.openDragBackdrop(this.barElement, this.item.end.startOfDay(), this.item.end);
|
|
3027
|
+
this.item.updateDate(this.item.end.startOfDay(), this.item.end);
|
|
3028
|
+
}
|
|
3029
|
+
this.barHandleDragMoveRecordDays = days;
|
|
3030
|
+
this.dragContainer.dragMoved.emit({ item: this.item.origin });
|
|
3031
|
+
}
|
|
3032
|
+
barAfterHandleDragMove() {
|
|
3033
|
+
const { width, end } = this.endOfBarHandle();
|
|
3034
|
+
const days = differenceInDays(end.value, this.item.start.value);
|
|
3035
|
+
if (width > dragMinWidth && days > 0) {
|
|
3036
|
+
this.barElement.style.width = width + 'px';
|
|
3037
|
+
this.openDragBackdrop(this.barElement, this.item.start, end);
|
|
3038
|
+
if (!this.isStartOrEndInsideView(this.item.start, end)) {
|
|
3039
|
+
return;
|
|
2982
3040
|
}
|
|
3041
|
+
this.item.updateDate(this.item.start, end);
|
|
2983
3042
|
}
|
|
2984
3043
|
else {
|
|
2985
|
-
|
|
2986
|
-
|
|
2987
|
-
|
|
2988
|
-
if (width > dragMinWidth && days > 0) {
|
|
2989
|
-
this.barElement.style.width = width + 'px';
|
|
2990
|
-
this.openDragBackdrop(this.barElement, this.item.start, end);
|
|
2991
|
-
if (!this.isStartOrEndInsideView(this.item.start, end)) {
|
|
2992
|
-
return;
|
|
2993
|
-
}
|
|
2994
|
-
this.item.updateDate(this.item.start, end);
|
|
2995
|
-
}
|
|
2996
|
-
else {
|
|
2997
|
-
this.openDragBackdrop(this.barElement, this.item.start, this.item.start.endOfDay());
|
|
2998
|
-
this.item.updateDate(this.item.start, this.item.start.endOfDay());
|
|
3044
|
+
if (this.barHandleDragMoveRecordDays > 0 && days <= 0) {
|
|
3045
|
+
const oneDayWidth = this.ganttUpper.view.getDateRangeWidth(this.item.start, this.item.start.endOfDay());
|
|
3046
|
+
this.barElement.style.width = oneDayWidth + 'px';
|
|
2999
3047
|
}
|
|
3048
|
+
this.openDragBackdrop(this.barElement, this.item.start, this.item.start.endOfDay());
|
|
3049
|
+
this.item.updateDate(this.item.start, this.item.start.endOfDay());
|
|
3000
3050
|
}
|
|
3051
|
+
this.barHandleDragMoveRecordDays = days;
|
|
3001
3052
|
this.dragContainer.dragMoved.emit({ item: this.item.origin });
|
|
3002
3053
|
}
|
|
3003
3054
|
calcLinkLinePositions(target, isBefore) {
|
|
@@ -3036,6 +3087,7 @@ class GanttBarDrag {
|
|
|
3036
3087
|
(horizontalScrollDirection === 2 /* AutoScrollHorizontalDirection.RIGHT */ &&
|
|
3037
3088
|
scrollLeft < this.ganttUpper.view.width - clientRect.width)) {
|
|
3038
3089
|
this._horizontalScrollDirection = horizontalScrollDirection;
|
|
3090
|
+
this.autoScrollSpeedRates = getAutoScrollSpeedRates(clientRect, pointerX, horizontalScrollDirection);
|
|
3039
3091
|
this.dragScrolling = true;
|
|
3040
3092
|
this._ngZone.runOutsideAngular(this.startScrollInterval);
|
|
3041
3093
|
}
|
|
@@ -3045,6 +3097,44 @@ class GanttBarDrag {
|
|
|
3045
3097
|
}
|
|
3046
3098
|
}
|
|
3047
3099
|
}
|
|
3100
|
+
// Conditions to stop auto-scroll: when the start is greater than the end and the bar appears in the view
|
|
3101
|
+
isStartGreaterThanEndWhenBarHandleDragMove(isBefore) {
|
|
3102
|
+
let isStartGreaterThanEnd;
|
|
3103
|
+
let isBarAppearsInView;
|
|
3104
|
+
const scrollLeft = this.dom.mainContainer.scrollLeft;
|
|
3105
|
+
const clientWidth = this.dom.mainContainer.clientWidth;
|
|
3106
|
+
const xThreshold = clientWidth * DROP_PROXIMITY_THRESHOLD;
|
|
3107
|
+
if (isBefore) {
|
|
3108
|
+
const { start, oneDayWidth } = this.startOfBarHandle();
|
|
3109
|
+
const xPointerByEndDate = this.ganttUpper.view.getXPointByDate(this.item.end);
|
|
3110
|
+
isStartGreaterThanEnd = start.value > this.item.end.value;
|
|
3111
|
+
isBarAppearsInView = xPointerByEndDate + oneDayWidth + xThreshold <= scrollLeft + clientWidth;
|
|
3112
|
+
}
|
|
3113
|
+
else {
|
|
3114
|
+
const { end } = this.endOfBarHandle();
|
|
3115
|
+
const xPointerByStartDate = this.ganttUpper.view.getXPointByDate(this.item.start);
|
|
3116
|
+
isStartGreaterThanEnd = end.value < this.item.start.value;
|
|
3117
|
+
isBarAppearsInView = scrollLeft + xThreshold <= xPointerByStartDate;
|
|
3118
|
+
}
|
|
3119
|
+
return isStartGreaterThanEnd && isBarAppearsInView ? true : false;
|
|
3120
|
+
}
|
|
3121
|
+
// Some data information about dragging start until it is equal to or greater than end
|
|
3122
|
+
startOfBarHandle() {
|
|
3123
|
+
const x = this.item.refs.x + this.barHandleDragMoveAndScrollDistance;
|
|
3124
|
+
return {
|
|
3125
|
+
x,
|
|
3126
|
+
start: this.ganttUpper.view.getDateByXPoint(x),
|
|
3127
|
+
oneDayWidth: this.ganttUpper.view.getDateRangeWidth(this.item.end.startOfDay(), this.item.end)
|
|
3128
|
+
};
|
|
3129
|
+
}
|
|
3130
|
+
// Some data information about dragging end of bar handle
|
|
3131
|
+
endOfBarHandle() {
|
|
3132
|
+
const width = this.item.refs.width + this.barHandleDragMoveAndScrollDistance;
|
|
3133
|
+
return {
|
|
3134
|
+
width,
|
|
3135
|
+
end: this.ganttUpper.view.getDateByXPoint(this.item.refs.x + width)
|
|
3136
|
+
};
|
|
3137
|
+
}
|
|
3048
3138
|
stopScrolling() {
|
|
3049
3139
|
this.stopScrollTimers$.next();
|
|
3050
3140
|
}
|
|
@@ -3180,12 +3270,14 @@ class NgxGanttBarComponent extends GanttItemUpper {
|
|
|
3180
3270
|
});
|
|
3181
3271
|
}
|
|
3182
3272
|
ngOnChanges(changes) {
|
|
3183
|
-
var _a, _b;
|
|
3273
|
+
var _a, _b, _c, _d, _e, _f;
|
|
3184
3274
|
super.ngOnChanges(changes);
|
|
3185
3275
|
if (!this.firstChange) {
|
|
3186
3276
|
this.drag.updateItem(this.item);
|
|
3187
3277
|
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) ||
|
|
3188
|
-
changes.item.currentValue.color !== changes.item.previousValue.color
|
|
3278
|
+
changes.item.currentValue.color !== changes.item.previousValue.color ||
|
|
3279
|
+
((_c = changes.item.currentValue.start) === null || _c === void 0 ? void 0 : _c.value) !== ((_d = changes.item.previousValue.start) === null || _d === void 0 ? void 0 : _d.value) ||
|
|
3280
|
+
((_e = changes.item.currentValue.end) === null || _e === void 0 ? void 0 : _e.value) !== ((_f = changes.item.previousValue.end) === null || _f === void 0 ? void 0 : _f.value)) {
|
|
3189
3281
|
this.setContentBackground();
|
|
3190
3282
|
}
|
|
3191
3283
|
}
|
|
@@ -3341,18 +3433,18 @@ class GanttMainComponent {
|
|
|
3341
3433
|
}
|
|
3342
3434
|
}
|
|
3343
3435
|
GanttMainComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: GanttMainComponent, deps: [{ token: GANTT_UPPER_TOKEN }], target: i0.ɵɵFactoryTarget.Component });
|
|
3344
|
-
GanttMainComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.4", type: GanttMainComponent, selector: "gantt-main", inputs: {
|
|
3436
|
+
GanttMainComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.4", type: GanttMainComponent, selector: "gantt-main", inputs: { viewportItems: "viewportItems", flatItems: "flatItems", 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 [flatItems]=\"flatItems\" (lineClick)=\"lineClick.emit($event)\"></gantt-links-overlay>\n<div class=\"gantt-main-groups\" [style.width.px]=\"ganttUpper.view.width\">\n <ng-container *ngFor=\"let data of viewportItems; trackBy: trackBy\">\n <div class=\"gantt-group\" [ngClass]=\"data.class\" *ngIf=\"data.items\">\n <ng-template [ngTemplateOutlet]=\"groupHeaderTemplate\" [ngTemplateOutletContext]=\"{ group: data }\"></ng-template>\n </div>\n <div\n *ngIf=\"!data.items\"\n class=\"gantt-item\"\n [style.height.px]=\"ganttUpper.styles.lineHeight\"\n [class.gantt-main-item-active]=\"ganttUpper.isSelected(data.id)\"\n >\n <ng-container *ngIf=\"data.type | isGanttCustomItem\">\n <ng-template\n [ngTemplateOutlet]=\"itemTemplate\"\n [ngTemplateOutletContext]=\"{\n item: data.origin,\n refs: data.refs,\n baseline: ganttUpper.baselineItemsMap[data.id]?.origin,\n baselineRefs: ganttUpper.baselineItemsMap[data.id]?.refs\n }\"\n >\n </ng-template>\n </ng-container>\n\n <ng-container *ngIf=\"(data.type | isGanttRangeItem) || (data.type | isGanttBarItem)\">\n <gantt-range *ngIf=\"data.type | isGanttRangeItem\" [template]=\"rangeTemplate\" [item]=\"data\"></gantt-range>\n <gantt-bar *ngIf=\"data.type | isGanttBarItem\" [item]=\"data\" [template]=\"barTemplate\" (barClick)=\"barClick.emit($event)\"></gantt-bar>\n <gantt-baseline *ngIf=\"ganttUpper.baselineItemsMap[data.id]\" [baselineItem]=\"ganttUpper.baselineItemsMap[data.id]\"></gantt-baseline>\n </ng-container>\n </div>\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: "component", type: GanttLinksComponent, selector: "gantt-links-overlay", inputs: ["flatItems"], 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" }] });
|
|
3345
3437
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: GanttMainComponent, decorators: [{
|
|
3346
3438
|
type: Component,
|
|
3347
|
-
args: [{ selector: 'gantt-main', template: "
|
|
3439
|
+
args: [{ selector: 'gantt-main', template: "<gantt-links-overlay [flatItems]=\"flatItems\" (lineClick)=\"lineClick.emit($event)\"></gantt-links-overlay>\n<div class=\"gantt-main-groups\" [style.width.px]=\"ganttUpper.view.width\">\n <ng-container *ngFor=\"let data of viewportItems; trackBy: trackBy\">\n <div class=\"gantt-group\" [ngClass]=\"data.class\" *ngIf=\"data.items\">\n <ng-template [ngTemplateOutlet]=\"groupHeaderTemplate\" [ngTemplateOutletContext]=\"{ group: data }\"></ng-template>\n </div>\n <div\n *ngIf=\"!data.items\"\n class=\"gantt-item\"\n [style.height.px]=\"ganttUpper.styles.lineHeight\"\n [class.gantt-main-item-active]=\"ganttUpper.isSelected(data.id)\"\n >\n <ng-container *ngIf=\"data.type | isGanttCustomItem\">\n <ng-template\n [ngTemplateOutlet]=\"itemTemplate\"\n [ngTemplateOutletContext]=\"{\n item: data.origin,\n refs: data.refs,\n baseline: ganttUpper.baselineItemsMap[data.id]?.origin,\n baselineRefs: ganttUpper.baselineItemsMap[data.id]?.refs\n }\"\n >\n </ng-template>\n </ng-container>\n\n <ng-container *ngIf=\"(data.type | isGanttRangeItem) || (data.type | isGanttBarItem)\">\n <gantt-range *ngIf=\"data.type | isGanttRangeItem\" [template]=\"rangeTemplate\" [item]=\"data\"></gantt-range>\n <gantt-bar *ngIf=\"data.type | isGanttBarItem\" [item]=\"data\" [template]=\"barTemplate\" (barClick)=\"barClick.emit($event)\"></gantt-bar>\n <gantt-baseline *ngIf=\"ganttUpper.baselineItemsMap[data.id]\" [baselineItem]=\"ganttUpper.baselineItemsMap[data.id]\"></gantt-baseline>\n </ng-container>\n </div>\n </ng-container>\n</div>\n" }]
|
|
3348
3440
|
}], ctorParameters: function () {
|
|
3349
3441
|
return [{ type: GanttUpper, decorators: [{
|
|
3350
3442
|
type: Inject,
|
|
3351
3443
|
args: [GANTT_UPPER_TOKEN]
|
|
3352
3444
|
}] }];
|
|
3353
|
-
}, propDecorators: {
|
|
3445
|
+
}, propDecorators: { viewportItems: [{
|
|
3354
3446
|
type: Input
|
|
3355
|
-
}],
|
|
3447
|
+
}], flatItems: [{
|
|
3356
3448
|
type: Input
|
|
3357
3449
|
}], groupHeaderTemplate: [{
|
|
3358
3450
|
type: Input
|
|
@@ -3708,19 +3800,20 @@ class NgxGanttComponent extends GanttUpper {
|
|
|
3708
3800
|
super(elementRef, cdr, ngZone, config);
|
|
3709
3801
|
this.printService = printService;
|
|
3710
3802
|
this.maxLevel = 2;
|
|
3803
|
+
this.virtualScrollEnabled = true;
|
|
3711
3804
|
this.loadingDelay = 0;
|
|
3712
3805
|
this.linkDragStarted = new EventEmitter();
|
|
3713
3806
|
this.linkDragEnded = new EventEmitter();
|
|
3714
3807
|
this.lineClick = new EventEmitter();
|
|
3715
3808
|
this.selectedChange = new EventEmitter();
|
|
3716
|
-
this.
|
|
3717
|
-
this.
|
|
3809
|
+
this.flatItems = [];
|
|
3810
|
+
this.viewportItems = [];
|
|
3718
3811
|
this._loading = false;
|
|
3719
3812
|
this.computeAllRefs = false;
|
|
3720
3813
|
}
|
|
3721
3814
|
ngOnInit() {
|
|
3722
3815
|
super.ngOnInit();
|
|
3723
|
-
this.
|
|
3816
|
+
this.buildFlatItems();
|
|
3724
3817
|
// Note: the zone may be nooped through `BootstrapOptions` when bootstrapping the root module. This means
|
|
3725
3818
|
// the `onStable` will never emit any value.
|
|
3726
3819
|
const onStable$ = this.ngZone.isStable ? from(Promise.resolve()) : this.ngZone.onStable.pipe(take(1));
|
|
@@ -3742,32 +3835,38 @@ class NgxGanttComponent extends GanttUpper {
|
|
|
3742
3835
|
this.view.start$.pipe(skip(1), takeUntil(this.unsubscribe$)).subscribe(() => {
|
|
3743
3836
|
this.computeTempDataRefs();
|
|
3744
3837
|
});
|
|
3838
|
+
if (!this.virtualScrollEnabled) {
|
|
3839
|
+
this.viewportItems = this.flatItems.slice(this.rangeStart, this.rangeEnd);
|
|
3840
|
+
this.computeTempDataRefs();
|
|
3841
|
+
}
|
|
3745
3842
|
}
|
|
3746
3843
|
ngOnChanges(changes) {
|
|
3747
3844
|
super.ngOnChanges(changes);
|
|
3748
3845
|
if (!this.firstChange) {
|
|
3749
3846
|
if (changes.viewType && changes.viewType.currentValue) {
|
|
3750
|
-
this.
|
|
3847
|
+
this.viewportItems = this.flatItems.slice(this.rangeStart, this.rangeEnd);
|
|
3751
3848
|
this.computeTempDataRefs();
|
|
3752
3849
|
}
|
|
3753
3850
|
if (changes.originItems || changes.originGroups) {
|
|
3754
|
-
this.
|
|
3755
|
-
this.
|
|
3851
|
+
this.buildFlatItems();
|
|
3852
|
+
this.viewportItems = this.flatItems.slice(this.rangeStart, this.rangeEnd);
|
|
3756
3853
|
this.computeTempDataRefs();
|
|
3757
3854
|
}
|
|
3758
3855
|
}
|
|
3759
3856
|
}
|
|
3760
3857
|
ngAfterViewInit() {
|
|
3761
|
-
|
|
3762
|
-
|
|
3763
|
-
|
|
3764
|
-
|
|
3765
|
-
|
|
3766
|
-
|
|
3767
|
-
|
|
3768
|
-
|
|
3858
|
+
if (this.virtualScrollEnabled) {
|
|
3859
|
+
this.virtualScroll.renderedRangeStream.pipe(takeUntil(this.unsubscribe$)).subscribe((range) => {
|
|
3860
|
+
const linksElement = this.elementRef.nativeElement.querySelector('.gantt-links-overlay');
|
|
3861
|
+
linksElement.style.top = `${-(this.styles.lineHeight * range.start)}px`;
|
|
3862
|
+
this.rangeStart = range.start;
|
|
3863
|
+
this.rangeEnd = range.end;
|
|
3864
|
+
this.viewportItems = this.flatItems.slice(range.start, range.end);
|
|
3865
|
+
this.computeTempDataRefs();
|
|
3866
|
+
});
|
|
3867
|
+
}
|
|
3769
3868
|
}
|
|
3770
|
-
|
|
3869
|
+
buildFlatItems() {
|
|
3771
3870
|
const virtualData = [];
|
|
3772
3871
|
if (this.groups.length) {
|
|
3773
3872
|
this.groups.forEach((group) => {
|
|
@@ -3781,22 +3880,26 @@ class NgxGanttComponent extends GanttUpper {
|
|
|
3781
3880
|
if (this.items.length) {
|
|
3782
3881
|
virtualData.push(...recursiveItems(this.items));
|
|
3783
3882
|
}
|
|
3784
|
-
this.
|
|
3785
|
-
this.
|
|
3883
|
+
this.flatItems = [...virtualData];
|
|
3884
|
+
this.flatItemsMap = keyBy(this.flatItems, 'id');
|
|
3885
|
+
if (!this.virtualScrollEnabled) {
|
|
3886
|
+
this.rangeStart = 0;
|
|
3887
|
+
this.rangeEnd = this.flatItems.length - 1;
|
|
3888
|
+
}
|
|
3786
3889
|
}
|
|
3787
3890
|
afterExpand() {
|
|
3788
|
-
this.
|
|
3789
|
-
this.
|
|
3891
|
+
this.buildFlatItems();
|
|
3892
|
+
this.viewportItems = this.flatItems.slice(this.rangeStart, this.rangeEnd);
|
|
3790
3893
|
}
|
|
3791
3894
|
computeTempDataRefs() {
|
|
3792
3895
|
const tempItemData = [];
|
|
3793
|
-
this.
|
|
3896
|
+
this.viewportItems.forEach((data) => {
|
|
3794
3897
|
if (!data.hasOwnProperty('items')) {
|
|
3795
3898
|
const item = data;
|
|
3796
3899
|
if (item.links) {
|
|
3797
3900
|
item.links.forEach((link) => {
|
|
3798
|
-
if (this.
|
|
3799
|
-
tempItemData.push(this.
|
|
3901
|
+
if (this.flatItemsMap[link.link]) {
|
|
3902
|
+
tempItemData.push(this.flatItemsMap[link.link]);
|
|
3800
3903
|
}
|
|
3801
3904
|
});
|
|
3802
3905
|
}
|
|
@@ -3804,8 +3907,8 @@ class NgxGanttComponent extends GanttUpper {
|
|
|
3804
3907
|
}
|
|
3805
3908
|
});
|
|
3806
3909
|
this.computeItemsRefs(...uniqBy(tempItemData, 'id'));
|
|
3807
|
-
this.
|
|
3808
|
-
this.
|
|
3910
|
+
this.flatItems = [...this.flatItems];
|
|
3911
|
+
this.viewportItems = [...this.viewportItems];
|
|
3809
3912
|
}
|
|
3810
3913
|
expandChildren(item) {
|
|
3811
3914
|
if (!item.expanded) {
|
|
@@ -3875,7 +3978,7 @@ class NgxGanttComponent extends GanttUpper {
|
|
|
3875
3978
|
}
|
|
3876
3979
|
}
|
|
3877
3980
|
NgxGanttComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: NgxGanttComponent, deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }, { token: i0.NgZone }, { token: GanttPrintService, optional: true }, { token: GANTT_GLOBAL_CONFIG }], target: i0.ɵɵFactoryTarget.Component });
|
|
3878
|
-
NgxGanttComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.4", type: NgxGanttComponent, selector: "ngx-gantt", inputs: { maxLevel: "maxLevel", async: "async", childrenResolve: "childrenResolve", linkable: "linkable", loading: "loading", loadingDelay: "loadingDelay" }, outputs: { linkDragStarted: "linkDragStarted", linkDragEnded: "linkDragEnded", lineClick: "lineClick", selectedChange: "selectedChange" }, providers: [
|
|
3981
|
+
NgxGanttComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.4", type: NgxGanttComponent, selector: "ngx-gantt", inputs: { maxLevel: "maxLevel", async: "async", childrenResolve: "childrenResolve", linkable: "linkable", loading: "loading", virtualScrollEnabled: "virtualScrollEnabled", loadingDelay: "loadingDelay" }, outputs: { linkDragStarted: "linkDragStarted", linkDragEnded: "linkDragEnded", lineClick: "lineClick", selectedChange: "selectedChange" }, providers: [
|
|
3879
3982
|
{
|
|
3880
3983
|
provide: GANTT_UPPER_TOKEN,
|
|
3881
3984
|
useExisting: NgxGanttComponent
|
|
@@ -3884,7 +3987,10 @@ NgxGanttComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", vers
|
|
|
3884
3987
|
provide: GANTT_ABSTRACT_TOKEN,
|
|
3885
3988
|
useExisting: forwardRef(() => NgxGanttComponent)
|
|
3886
3989
|
}
|
|
3887
|
-
], 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
|
|
3990
|
+
], 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 [ngClass]=\"{ 'gantt-normal-viewport': !virtualScrollEnabled }\"\n [itemSize]=\"styles.lineHeight\"\n [minBufferPx]=\"styles.lineHeight * 10\"\n [maxBufferPx]=\"styles.lineHeight * 20\"\n >\n <ng-container *cdkVirtualFor=\"let item of flatItems; 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 [flatItems]=\"flatItems\"\n [viewportItems]=\"viewportItems\"\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 (dragStarted)=\"table.dragStarted.emit($event)\"\n (dragEnded)=\"table.dragEnded.emit($event)\"\n (itemClick)=\"selectItem($event)\"\n >\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 [flatItems]=\"flatItems\"\n [viewportItems]=\"viewportItems\"\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.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { 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: ["viewportItems", "flatItems", "columns", "groupTemplate", "emptyTemplate", "rowBeforeTemplate", "rowAfterTemplate", "draggable", "dropEnterPredicate"], outputs: ["dragDropped", "dragStarted", "dragEnded", "itemClick"] }, { kind: "component", type: GanttMainComponent, selector: "gantt-main", inputs: ["viewportItems", "flatItems", "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 });
|
|
3991
|
+
__decorate([
|
|
3992
|
+
InputBoolean()
|
|
3993
|
+
], NgxGanttComponent.prototype, "virtualScrollEnabled", void 0);
|
|
3888
3994
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: NgxGanttComponent, decorators: [{
|
|
3889
3995
|
type: Component,
|
|
3890
3996
|
args: [{ selector: 'ngx-gantt', changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
@@ -3896,7 +4002,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImpor
|
|
|
3896
4002
|
provide: GANTT_ABSTRACT_TOKEN,
|
|
3897
4003
|
useExisting: forwardRef(() => NgxGanttComponent)
|
|
3898
4004
|
}
|
|
3899
|
-
], 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
|
|
4005
|
+
], 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 [ngClass]=\"{ 'gantt-normal-viewport': !virtualScrollEnabled }\"\n [itemSize]=\"styles.lineHeight\"\n [minBufferPx]=\"styles.lineHeight * 10\"\n [maxBufferPx]=\"styles.lineHeight * 20\"\n >\n <ng-container *cdkVirtualFor=\"let item of flatItems; 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 [flatItems]=\"flatItems\"\n [viewportItems]=\"viewportItems\"\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 (dragStarted)=\"table.dragStarted.emit($event)\"\n (dragEnded)=\"table.dragEnded.emit($event)\"\n (itemClick)=\"selectItem($event)\"\n >\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 [flatItems]=\"flatItems\"\n [viewportItems]=\"viewportItems\"\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" }]
|
|
3900
4006
|
}], ctorParameters: function () {
|
|
3901
4007
|
return [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }, { type: i0.NgZone }, { type: GanttPrintService, decorators: [{
|
|
3902
4008
|
type: Optional
|
|
@@ -3914,6 +4020,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImpor
|
|
|
3914
4020
|
type: Input
|
|
3915
4021
|
}], loading: [{
|
|
3916
4022
|
type: Input
|
|
4023
|
+
}], virtualScrollEnabled: [{
|
|
4024
|
+
type: Input
|
|
3917
4025
|
}], loadingDelay: [{
|
|
3918
4026
|
type: Input
|
|
3919
4027
|
}], linkDragStarted: [{
|
|
@@ -3947,11 +4055,9 @@ NgxGanttModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version:
|
|
|
3947
4055
|
NgxGanttModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.1.4", ngImport: i0, type: NgxGanttModule, declarations: [NgxGanttComponent,
|
|
3948
4056
|
NgxGanttTableComponent,
|
|
3949
4057
|
NgxGanttTableColumnComponent,
|
|
3950
|
-
// GanttTableComponent,
|
|
3951
4058
|
GanttTableHeaderComponent,
|
|
3952
4059
|
GanttTableBodyComponent,
|
|
3953
4060
|
GanttMainComponent,
|
|
3954
|
-
// GanttCalendarComponent,
|
|
3955
4061
|
GanttCalendarHeaderComponent,
|
|
3956
4062
|
GanttCalendarGridComponent,
|
|
3957
4063
|
GanttLinksComponent,
|
|
@@ -3998,11 +4104,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImpor
|
|
|
3998
4104
|
NgxGanttComponent,
|
|
3999
4105
|
NgxGanttTableComponent,
|
|
4000
4106
|
NgxGanttTableColumnComponent,
|
|
4001
|
-
// GanttTableComponent,
|
|
4002
4107
|
GanttTableHeaderComponent,
|
|
4003
4108
|
GanttTableBodyComponent,
|
|
4004
4109
|
GanttMainComponent,
|
|
4005
|
-
// GanttCalendarComponent,
|
|
4006
4110
|
GanttCalendarHeaderComponent,
|
|
4007
4111
|
GanttCalendarGridComponent,
|
|
4008
4112
|
GanttLinksComponent,
|