@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 { __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,9 +11,9 @@ 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';
|
|
14
|
+
import { InputBoolean } from 'ngx-tethys/core';
|
|
13
15
|
import * as i2 from '@angular/cdk/drag-drop';
|
|
14
16
|
import { CdkDrag, DragDropModule } from '@angular/cdk/drag-drop';
|
|
15
|
-
import { __decorate, __param } from 'tslib';
|
|
16
17
|
|
|
17
18
|
class GanttDatePoint {
|
|
18
19
|
constructor(start, text, x, y, additions, style) {
|
|
@@ -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;
|
|
@@ -1719,16 +1720,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImpor
|
|
|
1719
1720
|
}] });
|
|
1720
1721
|
|
|
1721
1722
|
class GanttTableBodyComponent {
|
|
1722
|
-
set
|
|
1723
|
+
set viewportItems(data) {
|
|
1723
1724
|
const firstData = data[0];
|
|
1724
1725
|
if (firstData && firstData.hasOwnProperty('items')) {
|
|
1725
1726
|
this.hasGroup = true;
|
|
1726
1727
|
}
|
|
1727
1728
|
this.ganttTableEmptyClass = data?.length ? false : true;
|
|
1728
|
-
this.
|
|
1729
|
+
this._viewportItems = data;
|
|
1729
1730
|
}
|
|
1730
|
-
get
|
|
1731
|
-
return this.
|
|
1731
|
+
get viewportItems() {
|
|
1732
|
+
return this._viewportItems;
|
|
1732
1733
|
}
|
|
1733
1734
|
constructor(gantt, ganttUpper, cdr, document) {
|
|
1734
1735
|
this.gantt = gantt;
|
|
@@ -1889,13 +1890,13 @@ class GanttTableBodyComponent {
|
|
|
1889
1890
|
this.destroy$.complete();
|
|
1890
1891
|
}
|
|
1891
1892
|
removeItem(item, children) {
|
|
1892
|
-
this.
|
|
1893
|
-
this.
|
|
1893
|
+
this.viewportItems.splice(this.viewportItems.indexOf(item), 1 + children.length);
|
|
1894
|
+
this.flatItems.splice(this.flatItems.indexOf(item), 1 + children.length);
|
|
1894
1895
|
}
|
|
1895
1896
|
insertItem(target, inserted, children, position) {
|
|
1896
1897
|
if (position === 'before') {
|
|
1897
|
-
this.
|
|
1898
|
-
this.
|
|
1898
|
+
this.viewportItems.splice(this.viewportItems.indexOf(target), 0, inserted, ...children);
|
|
1899
|
+
this.flatItems.splice(this.flatItems.indexOf(target), 0, inserted, ...children);
|
|
1899
1900
|
}
|
|
1900
1901
|
else {
|
|
1901
1902
|
const dragRef = this.cdkDrags.find((drag) => drag.data === target);
|
|
@@ -1904,19 +1905,19 @@ class GanttTableBodyComponent {
|
|
|
1904
1905
|
if (target.expanded) {
|
|
1905
1906
|
childrenCount = this.getChildrenElementsByElement(dragRef.element.nativeElement)?.length || 0;
|
|
1906
1907
|
}
|
|
1907
|
-
this.
|
|
1908
|
-
this.
|
|
1908
|
+
this.viewportItems.splice(this.viewportItems.indexOf(target) + 1 + childrenCount, 0, inserted, ...children);
|
|
1909
|
+
this.flatItems.splice(this.flatItems.indexOf(target) + 1 + childrenCount, 0, inserted, ...children);
|
|
1909
1910
|
}
|
|
1910
1911
|
}
|
|
1911
1912
|
insertChildrenItem(target, inserted, children) {
|
|
1912
1913
|
if (target.expanded) {
|
|
1913
|
-
this.
|
|
1914
|
-
this.
|
|
1914
|
+
this.viewportItems.splice(this.viewportItems.indexOf(target) + target.children.length + 1, 0, inserted, ...children);
|
|
1915
|
+
this.flatItems.splice(this.flatItems.indexOf(target) + target.children.length + 1, 0, inserted, ...children);
|
|
1915
1916
|
}
|
|
1916
1917
|
target.children.push(inserted);
|
|
1917
1918
|
}
|
|
1918
1919
|
getParentByItem(item) {
|
|
1919
|
-
return (this.
|
|
1920
|
+
return (this.flatItems || []).find((n) => {
|
|
1920
1921
|
return n.children?.includes(item);
|
|
1921
1922
|
});
|
|
1922
1923
|
}
|
|
@@ -1974,10 +1975,10 @@ class GanttTableBodyComponent {
|
|
|
1974
1975
|
}
|
|
1975
1976
|
}
|
|
1976
1977
|
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 });
|
|
1977
|
-
GanttTableBodyComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.4", type: GanttTableBodyComponent, selector: "gantt-table-body", inputs: {
|
|
1978
|
+
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" }] });
|
|
1978
1979
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: GanttTableBodyComponent, decorators: [{
|
|
1979
1980
|
type: Component,
|
|
1980
|
-
args: [{ selector: 'gantt-table-body', template: "<div\n class=\"gantt-table-body-container\"\n cdkDropList\n [cdkDropListAutoScrollStep]=\"6\"\n [cdkDropListData]=\"
|
|
1981
|
+
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" }]
|
|
1981
1982
|
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
1982
1983
|
type: Inject,
|
|
1983
1984
|
args: [GANTT_ABSTRACT_TOKEN]
|
|
@@ -1987,9 +1988,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImpor
|
|
|
1987
1988
|
}] }, { type: i0.ChangeDetectorRef }, { type: Document, decorators: [{
|
|
1988
1989
|
type: Inject,
|
|
1989
1990
|
args: [DOCUMENT]
|
|
1990
|
-
}] }]; }, propDecorators: {
|
|
1991
|
+
}] }]; }, propDecorators: { viewportItems: [{
|
|
1991
1992
|
type: Input
|
|
1992
|
-
}],
|
|
1993
|
+
}], flatItems: [{
|
|
1993
1994
|
type: Input
|
|
1994
1995
|
}], columns: [{
|
|
1995
1996
|
type: Input
|
|
@@ -2291,7 +2292,7 @@ class GanttLinksComponent {
|
|
|
2291
2292
|
this.ngZone = ngZone;
|
|
2292
2293
|
// @Input() groups: GanttGroupInternal[] = [];
|
|
2293
2294
|
// @Input() items: GanttItemInternal[] = [];
|
|
2294
|
-
this.
|
|
2295
|
+
this.flatItems = [];
|
|
2295
2296
|
this.lineClick = new EventEmitter();
|
|
2296
2297
|
this.links = [];
|
|
2297
2298
|
this.ganttLinkTypes = GanttLinkType;
|
|
@@ -2368,7 +2369,7 @@ class GanttLinksComponent {
|
|
|
2368
2369
|
// });
|
|
2369
2370
|
// });
|
|
2370
2371
|
// }
|
|
2371
|
-
this.
|
|
2372
|
+
this.flatItems.forEach((item, itemIndex) => {
|
|
2372
2373
|
if (!item.hasOwnProperty('items')) {
|
|
2373
2374
|
const ganttItem = item;
|
|
2374
2375
|
if (ganttItem.refs) {
|
|
@@ -2452,14 +2453,14 @@ class GanttLinksComponent {
|
|
|
2452
2453
|
}
|
|
2453
2454
|
}
|
|
2454
2455
|
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 });
|
|
2455
|
-
GanttLinksComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.4", type: GanttLinksComponent, selector: "gantt-links-overlay", inputs: {
|
|
2456
|
+
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"] }] });
|
|
2456
2457
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: GanttLinksComponent, decorators: [{
|
|
2457
2458
|
type: Component,
|
|
2458
2459
|
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" }]
|
|
2459
2460
|
}], ctorParameters: function () { return [{ type: GanttUpper, decorators: [{
|
|
2460
2461
|
type: Inject,
|
|
2461
2462
|
args: [GANTT_UPPER_TOKEN]
|
|
2462
|
-
}] }, { type: i0.ChangeDetectorRef }, { type: i0.ElementRef }, { type: GanttDragContainer }, { type: i0.NgZone }]; }, propDecorators: {
|
|
2463
|
+
}] }, { type: i0.ChangeDetectorRef }, { type: i0.ElementRef }, { type: GanttDragContainer }, { type: i0.NgZone }]; }, propDecorators: { flatItems: [{
|
|
2463
2464
|
type: Input
|
|
2464
2465
|
}], lineClick: [{
|
|
2465
2466
|
type: Output
|
|
@@ -2532,6 +2533,25 @@ function isPointerNearClientRect(rect, threshold, pointerX, pointerY) {
|
|
|
2532
2533
|
const yThreshold = height * threshold;
|
|
2533
2534
|
return pointerY > top - yThreshold && pointerY < bottom + yThreshold && pointerX > left - xThreshold && pointerX < right + xThreshold;
|
|
2534
2535
|
}
|
|
2536
|
+
/**
|
|
2537
|
+
* Gets the speed rate of auto scrolling
|
|
2538
|
+
* @param clientRect Dimensions of the node.
|
|
2539
|
+
* @param pointerX Position of the user's pointer along the x axis.
|
|
2540
|
+
* @param horizontalScrollDirection The direction in which the mouse is dragged horizontally
|
|
2541
|
+
*/
|
|
2542
|
+
function getAutoScrollSpeedRates(clientRect, pointerX, horizontalScrollDirection) {
|
|
2543
|
+
let autoScrollSpeedRates = 4;
|
|
2544
|
+
const speedLevels = 4;
|
|
2545
|
+
const { left, right, width } = clientRect;
|
|
2546
|
+
const xThreshold = width * SCROLL_PROXIMITY_THRESHOLD;
|
|
2547
|
+
if (horizontalScrollDirection === 1 /* AutoScrollHorizontalDirection.LEFT */) {
|
|
2548
|
+
autoScrollSpeedRates = Math.ceil((xThreshold - (pointerX > left ? pointerX - left : 0)) / (xThreshold / speedLevels));
|
|
2549
|
+
}
|
|
2550
|
+
if (horizontalScrollDirection === 2 /* AutoScrollHorizontalDirection.RIGHT */) {
|
|
2551
|
+
autoScrollSpeedRates = Math.ceil((xThreshold - (right > pointerX ? right - pointerX : 0)) / (xThreshold / speedLevels));
|
|
2552
|
+
}
|
|
2553
|
+
return autoScrollSpeedRates;
|
|
2554
|
+
}
|
|
2535
2555
|
|
|
2536
2556
|
const scrollThreshold = 50;
|
|
2537
2557
|
var ScrollDirection;
|
|
@@ -2646,7 +2666,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImpor
|
|
|
2646
2666
|
*/
|
|
2647
2667
|
const DROP_PROXIMITY_THRESHOLD = 0.05;
|
|
2648
2668
|
const dragMinWidth = 10;
|
|
2649
|
-
const
|
|
2669
|
+
const autoScrollBaseStep = 2;
|
|
2650
2670
|
const activeClass = 'gantt-bar-active';
|
|
2651
2671
|
const dropActiveClass = 'gantt-bar-drop-active';
|
|
2652
2672
|
const singleDropActiveClass = 'gantt-bar-single-drop-active';
|
|
@@ -2662,6 +2682,12 @@ class GanttBarDrag {
|
|
|
2662
2682
|
get linkDragDisabled() {
|
|
2663
2683
|
return !this.item.linkable || !this.ganttUpper.linkable;
|
|
2664
2684
|
}
|
|
2685
|
+
get barHandleDragMoveAndScrollDistance() {
|
|
2686
|
+
return this.barHandleDragMoveDistance + this.dragScrollDistance;
|
|
2687
|
+
}
|
|
2688
|
+
get autoScrollStep() {
|
|
2689
|
+
return Math.pow(autoScrollBaseStep, this.autoScrollSpeedRates);
|
|
2690
|
+
}
|
|
2665
2691
|
constructor(dragDrop, dom, dragContainer, _ngZone) {
|
|
2666
2692
|
this.dragDrop = dragDrop;
|
|
2667
2693
|
this.dom = dom;
|
|
@@ -2681,13 +2707,15 @@ class GanttBarDrag {
|
|
|
2681
2707
|
this.dragScrollDistance = 0;
|
|
2682
2708
|
/** Horizontal direction in which the list is currently scrolling. */
|
|
2683
2709
|
this._horizontalScrollDirection = 0 /* AutoScrollHorizontalDirection.NONE */;
|
|
2710
|
+
/** Speed ratio for auto scroll */
|
|
2711
|
+
this.autoScrollSpeedRates = 1;
|
|
2684
2712
|
this.startScrollInterval = () => {
|
|
2685
2713
|
this.stopScrolling();
|
|
2686
2714
|
interval(0, animationFrameScheduler)
|
|
2687
2715
|
.pipe(takeUntil(this.stopScrollTimers$))
|
|
2688
2716
|
.subscribe(() => {
|
|
2689
2717
|
const node = this.dom.mainContainer;
|
|
2690
|
-
const scrollStep = autoScrollStep;
|
|
2718
|
+
const scrollStep = this.autoScrollStep;
|
|
2691
2719
|
if (this._horizontalScrollDirection === 1 /* AutoScrollHorizontalDirection.LEFT */) {
|
|
2692
2720
|
node.scrollBy(-scrollStep, 0);
|
|
2693
2721
|
}
|
|
@@ -2795,16 +2823,32 @@ class GanttBarDrag {
|
|
|
2795
2823
|
const dragScrollDistance = this.dom.mainContainer.scrollLeft - this.containerScrollLeft;
|
|
2796
2824
|
this.dragScrollDistance = dragScrollDistance;
|
|
2797
2825
|
dragRef['_boundaryRect'] = this.dom.mainItems.getBoundingClientRect();
|
|
2798
|
-
this.
|
|
2826
|
+
if (this.dragScrolling && this.isStartGreaterThanEndWhenBarHandleDragMove(isBefore)) {
|
|
2827
|
+
this.stopScrolling();
|
|
2828
|
+
this.dragScrolling = false;
|
|
2829
|
+
}
|
|
2830
|
+
if (isBefore) {
|
|
2831
|
+
this.barBeforeHandleDragMove();
|
|
2832
|
+
}
|
|
2833
|
+
else {
|
|
2834
|
+
this.barAfterHandleDragMove();
|
|
2835
|
+
}
|
|
2799
2836
|
}
|
|
2800
2837
|
});
|
|
2801
2838
|
this.dragContainer.dragStarted.emit({ item: this.item.origin });
|
|
2802
2839
|
});
|
|
2803
2840
|
dragRef.moved.subscribe((event) => {
|
|
2804
|
-
this.
|
|
2841
|
+
if (this.barHandleDragMoveRecordDays && this.barHandleDragMoveRecordDays > 0) {
|
|
2842
|
+
this.startScrollingIfNecessary(event.pointerPosition.x, event.pointerPosition.y);
|
|
2843
|
+
}
|
|
2805
2844
|
this.barHandleDragMoveDistance = event.distance.x;
|
|
2806
2845
|
if (!this.dragScrolling) {
|
|
2807
|
-
|
|
2846
|
+
if (isBefore) {
|
|
2847
|
+
this.barBeforeHandleDragMove();
|
|
2848
|
+
}
|
|
2849
|
+
else {
|
|
2850
|
+
this.barAfterHandleDragMove();
|
|
2851
|
+
}
|
|
2808
2852
|
}
|
|
2809
2853
|
});
|
|
2810
2854
|
dragRef.ended.subscribe((event) => {
|
|
@@ -2887,10 +2931,10 @@ class GanttBarDrag {
|
|
|
2887
2931
|
let left = dragRect.left - rootRect.left - (this.dom.side.clientWidth + 1);
|
|
2888
2932
|
if (this.dragScrolling) {
|
|
2889
2933
|
if (this._horizontalScrollDirection === 1 /* AutoScrollHorizontalDirection.LEFT */) {
|
|
2890
|
-
left += autoScrollStep;
|
|
2934
|
+
left += this.autoScrollStep;
|
|
2891
2935
|
}
|
|
2892
2936
|
else if (this._horizontalScrollDirection === 2 /* AutoScrollHorizontalDirection.RIGHT */) {
|
|
2893
|
-
left -= autoScrollStep;
|
|
2937
|
+
left -= this.autoScrollStep;
|
|
2894
2938
|
}
|
|
2895
2939
|
}
|
|
2896
2940
|
const width = dragRect.right - dragRect.left;
|
|
@@ -2940,44 +2984,51 @@ class GanttBarDrag {
|
|
|
2940
2984
|
this.item.updateDate(start, end);
|
|
2941
2985
|
this.dragContainer.dragMoved.emit({ item: this.item.origin });
|
|
2942
2986
|
}
|
|
2943
|
-
|
|
2944
|
-
const
|
|
2945
|
-
|
|
2946
|
-
|
|
2947
|
-
|
|
2948
|
-
|
|
2949
|
-
|
|
2950
|
-
|
|
2951
|
-
|
|
2987
|
+
barBeforeHandleDragMove() {
|
|
2988
|
+
const { x, start, oneDayWidth } = this.startOfBarHandle();
|
|
2989
|
+
const width = this.item.refs.width + this.barHandleDragMoveAndScrollDistance * -1;
|
|
2990
|
+
const days = differenceInDays(this.item.end.value, start.value);
|
|
2991
|
+
if (width > dragMinWidth && days > 0) {
|
|
2992
|
+
this.barElement.style.width = width + 'px';
|
|
2993
|
+
this.barElement.style.left = x + 'px';
|
|
2994
|
+
this.openDragBackdrop(this.barElement, start, this.item.end);
|
|
2995
|
+
if (!this.isStartOrEndInsideView(start, this.item.end)) {
|
|
2996
|
+
return;
|
|
2997
|
+
}
|
|
2998
|
+
this.item.updateDate(start, this.item.end);
|
|
2999
|
+
}
|
|
3000
|
+
else {
|
|
3001
|
+
if (this.barHandleDragMoveRecordDays > 0 && days <= 0) {
|
|
3002
|
+
this.barElement.style.width = oneDayWidth + 'px';
|
|
3003
|
+
const x = this.ganttUpper.view.getXPointByDate(this.item.end);
|
|
2952
3004
|
this.barElement.style.left = x + 'px';
|
|
2953
|
-
this.openDragBackdrop(this.barElement, start, this.item.end);
|
|
2954
|
-
if (!this.isStartOrEndInsideView(start, this.item.end)) {
|
|
2955
|
-
return;
|
|
2956
|
-
}
|
|
2957
|
-
this.item.updateDate(start, this.item.end);
|
|
2958
3005
|
}
|
|
2959
|
-
|
|
2960
|
-
|
|
2961
|
-
|
|
3006
|
+
this.openDragBackdrop(this.barElement, this.item.end.startOfDay(), this.item.end);
|
|
3007
|
+
this.item.updateDate(this.item.end.startOfDay(), this.item.end);
|
|
3008
|
+
}
|
|
3009
|
+
this.barHandleDragMoveRecordDays = days;
|
|
3010
|
+
this.dragContainer.dragMoved.emit({ item: this.item.origin });
|
|
3011
|
+
}
|
|
3012
|
+
barAfterHandleDragMove() {
|
|
3013
|
+
const { width, end } = this.endOfBarHandle();
|
|
3014
|
+
const days = differenceInDays(end.value, this.item.start.value);
|
|
3015
|
+
if (width > dragMinWidth && days > 0) {
|
|
3016
|
+
this.barElement.style.width = width + 'px';
|
|
3017
|
+
this.openDragBackdrop(this.barElement, this.item.start, end);
|
|
3018
|
+
if (!this.isStartOrEndInsideView(this.item.start, end)) {
|
|
3019
|
+
return;
|
|
2962
3020
|
}
|
|
3021
|
+
this.item.updateDate(this.item.start, end);
|
|
2963
3022
|
}
|
|
2964
3023
|
else {
|
|
2965
|
-
|
|
2966
|
-
|
|
2967
|
-
|
|
2968
|
-
if (width > dragMinWidth && days > 0) {
|
|
2969
|
-
this.barElement.style.width = width + 'px';
|
|
2970
|
-
this.openDragBackdrop(this.barElement, this.item.start, end);
|
|
2971
|
-
if (!this.isStartOrEndInsideView(this.item.start, end)) {
|
|
2972
|
-
return;
|
|
2973
|
-
}
|
|
2974
|
-
this.item.updateDate(this.item.start, end);
|
|
2975
|
-
}
|
|
2976
|
-
else {
|
|
2977
|
-
this.openDragBackdrop(this.barElement, this.item.start, this.item.start.endOfDay());
|
|
2978
|
-
this.item.updateDate(this.item.start, this.item.start.endOfDay());
|
|
3024
|
+
if (this.barHandleDragMoveRecordDays > 0 && days <= 0) {
|
|
3025
|
+
const oneDayWidth = this.ganttUpper.view.getDateRangeWidth(this.item.start, this.item.start.endOfDay());
|
|
3026
|
+
this.barElement.style.width = oneDayWidth + 'px';
|
|
2979
3027
|
}
|
|
3028
|
+
this.openDragBackdrop(this.barElement, this.item.start, this.item.start.endOfDay());
|
|
3029
|
+
this.item.updateDate(this.item.start, this.item.start.endOfDay());
|
|
2980
3030
|
}
|
|
3031
|
+
this.barHandleDragMoveRecordDays = days;
|
|
2981
3032
|
this.dragContainer.dragMoved.emit({ item: this.item.origin });
|
|
2982
3033
|
}
|
|
2983
3034
|
calcLinkLinePositions(target, isBefore) {
|
|
@@ -3016,6 +3067,7 @@ class GanttBarDrag {
|
|
|
3016
3067
|
(horizontalScrollDirection === 2 /* AutoScrollHorizontalDirection.RIGHT */ &&
|
|
3017
3068
|
scrollLeft < this.ganttUpper.view.width - clientRect.width)) {
|
|
3018
3069
|
this._horizontalScrollDirection = horizontalScrollDirection;
|
|
3070
|
+
this.autoScrollSpeedRates = getAutoScrollSpeedRates(clientRect, pointerX, horizontalScrollDirection);
|
|
3019
3071
|
this.dragScrolling = true;
|
|
3020
3072
|
this._ngZone.runOutsideAngular(this.startScrollInterval);
|
|
3021
3073
|
}
|
|
@@ -3025,6 +3077,44 @@ class GanttBarDrag {
|
|
|
3025
3077
|
}
|
|
3026
3078
|
}
|
|
3027
3079
|
}
|
|
3080
|
+
// Conditions to stop auto-scroll: when the start is greater than the end and the bar appears in the view
|
|
3081
|
+
isStartGreaterThanEndWhenBarHandleDragMove(isBefore) {
|
|
3082
|
+
let isStartGreaterThanEnd;
|
|
3083
|
+
let isBarAppearsInView;
|
|
3084
|
+
const scrollLeft = this.dom.mainContainer.scrollLeft;
|
|
3085
|
+
const clientWidth = this.dom.mainContainer.clientWidth;
|
|
3086
|
+
const xThreshold = clientWidth * DROP_PROXIMITY_THRESHOLD;
|
|
3087
|
+
if (isBefore) {
|
|
3088
|
+
const { start, oneDayWidth } = this.startOfBarHandle();
|
|
3089
|
+
const xPointerByEndDate = this.ganttUpper.view.getXPointByDate(this.item.end);
|
|
3090
|
+
isStartGreaterThanEnd = start.value > this.item.end.value;
|
|
3091
|
+
isBarAppearsInView = xPointerByEndDate + oneDayWidth + xThreshold <= scrollLeft + clientWidth;
|
|
3092
|
+
}
|
|
3093
|
+
else {
|
|
3094
|
+
const { end } = this.endOfBarHandle();
|
|
3095
|
+
const xPointerByStartDate = this.ganttUpper.view.getXPointByDate(this.item.start);
|
|
3096
|
+
isStartGreaterThanEnd = end.value < this.item.start.value;
|
|
3097
|
+
isBarAppearsInView = scrollLeft + xThreshold <= xPointerByStartDate;
|
|
3098
|
+
}
|
|
3099
|
+
return isStartGreaterThanEnd && isBarAppearsInView ? true : false;
|
|
3100
|
+
}
|
|
3101
|
+
// Some data information about dragging start until it is equal to or greater than end
|
|
3102
|
+
startOfBarHandle() {
|
|
3103
|
+
const x = this.item.refs.x + this.barHandleDragMoveAndScrollDistance;
|
|
3104
|
+
return {
|
|
3105
|
+
x,
|
|
3106
|
+
start: this.ganttUpper.view.getDateByXPoint(x),
|
|
3107
|
+
oneDayWidth: this.ganttUpper.view.getDateRangeWidth(this.item.end.startOfDay(), this.item.end)
|
|
3108
|
+
};
|
|
3109
|
+
}
|
|
3110
|
+
// Some data information about dragging end of bar handle
|
|
3111
|
+
endOfBarHandle() {
|
|
3112
|
+
const width = this.item.refs.width + this.barHandleDragMoveAndScrollDistance;
|
|
3113
|
+
return {
|
|
3114
|
+
width,
|
|
3115
|
+
end: this.ganttUpper.view.getDateByXPoint(this.item.refs.x + width)
|
|
3116
|
+
};
|
|
3117
|
+
}
|
|
3028
3118
|
stopScrolling() {
|
|
3029
3119
|
this.stopScrollTimers$.next();
|
|
3030
3120
|
}
|
|
@@ -3161,7 +3251,9 @@ class NgxGanttBarComponent extends GanttItemUpper {
|
|
|
3161
3251
|
if (!this.firstChange) {
|
|
3162
3252
|
this.drag.updateItem(this.item);
|
|
3163
3253
|
if (changes.item.currentValue.refs?.width !== changes.item.previousValue.refs?.width ||
|
|
3164
|
-
changes.item.currentValue.color !== changes.item.previousValue.color
|
|
3254
|
+
changes.item.currentValue.color !== changes.item.previousValue.color ||
|
|
3255
|
+
changes.item.currentValue.start?.value !== changes.item.previousValue.start?.value ||
|
|
3256
|
+
changes.item.currentValue.end?.value !== changes.item.previousValue.end?.value) {
|
|
3165
3257
|
this.setContentBackground();
|
|
3166
3258
|
}
|
|
3167
3259
|
}
|
|
@@ -3310,16 +3402,16 @@ class GanttMainComponent {
|
|
|
3310
3402
|
}
|
|
3311
3403
|
}
|
|
3312
3404
|
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 });
|
|
3313
|
-
GanttMainComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.4", type: GanttMainComponent, selector: "gantt-main", inputs: {
|
|
3405
|
+
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" }] });
|
|
3314
3406
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: GanttMainComponent, decorators: [{
|
|
3315
3407
|
type: Component,
|
|
3316
|
-
args: [{ selector: 'gantt-main', template: "
|
|
3408
|
+
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" }]
|
|
3317
3409
|
}], ctorParameters: function () { return [{ type: GanttUpper, decorators: [{
|
|
3318
3410
|
type: Inject,
|
|
3319
3411
|
args: [GANTT_UPPER_TOKEN]
|
|
3320
|
-
}] }]; }, propDecorators: {
|
|
3412
|
+
}] }]; }, propDecorators: { viewportItems: [{
|
|
3321
3413
|
type: Input
|
|
3322
|
-
}],
|
|
3414
|
+
}], flatItems: [{
|
|
3323
3415
|
type: Input
|
|
3324
3416
|
}], groupHeaderTemplate: [{
|
|
3325
3417
|
type: Input
|
|
@@ -3667,19 +3759,20 @@ class NgxGanttComponent extends GanttUpper {
|
|
|
3667
3759
|
super(elementRef, cdr, ngZone, config);
|
|
3668
3760
|
this.printService = printService;
|
|
3669
3761
|
this.maxLevel = 2;
|
|
3762
|
+
this.virtualScrollEnabled = true;
|
|
3670
3763
|
this.loadingDelay = 0;
|
|
3671
3764
|
this.linkDragStarted = new EventEmitter();
|
|
3672
3765
|
this.linkDragEnded = new EventEmitter();
|
|
3673
3766
|
this.lineClick = new EventEmitter();
|
|
3674
3767
|
this.selectedChange = new EventEmitter();
|
|
3675
|
-
this.
|
|
3676
|
-
this.
|
|
3768
|
+
this.flatItems = [];
|
|
3769
|
+
this.viewportItems = [];
|
|
3677
3770
|
this._loading = false;
|
|
3678
3771
|
this.computeAllRefs = false;
|
|
3679
3772
|
}
|
|
3680
3773
|
ngOnInit() {
|
|
3681
3774
|
super.ngOnInit();
|
|
3682
|
-
this.
|
|
3775
|
+
this.buildFlatItems();
|
|
3683
3776
|
// Note: the zone may be nooped through `BootstrapOptions` when bootstrapping the root module. This means
|
|
3684
3777
|
// the `onStable` will never emit any value.
|
|
3685
3778
|
const onStable$ = this.ngZone.isStable ? from(Promise.resolve()) : this.ngZone.onStable.pipe(take(1));
|
|
@@ -3701,32 +3794,38 @@ class NgxGanttComponent extends GanttUpper {
|
|
|
3701
3794
|
this.view.start$.pipe(skip(1), takeUntil(this.unsubscribe$)).subscribe(() => {
|
|
3702
3795
|
this.computeTempDataRefs();
|
|
3703
3796
|
});
|
|
3797
|
+
if (!this.virtualScrollEnabled) {
|
|
3798
|
+
this.viewportItems = this.flatItems.slice(this.rangeStart, this.rangeEnd);
|
|
3799
|
+
this.computeTempDataRefs();
|
|
3800
|
+
}
|
|
3704
3801
|
}
|
|
3705
3802
|
ngOnChanges(changes) {
|
|
3706
3803
|
super.ngOnChanges(changes);
|
|
3707
3804
|
if (!this.firstChange) {
|
|
3708
3805
|
if (changes.viewType && changes.viewType.currentValue) {
|
|
3709
|
-
this.
|
|
3806
|
+
this.viewportItems = this.flatItems.slice(this.rangeStart, this.rangeEnd);
|
|
3710
3807
|
this.computeTempDataRefs();
|
|
3711
3808
|
}
|
|
3712
3809
|
if (changes.originItems || changes.originGroups) {
|
|
3713
|
-
this.
|
|
3714
|
-
this.
|
|
3810
|
+
this.buildFlatItems();
|
|
3811
|
+
this.viewportItems = this.flatItems.slice(this.rangeStart, this.rangeEnd);
|
|
3715
3812
|
this.computeTempDataRefs();
|
|
3716
3813
|
}
|
|
3717
3814
|
}
|
|
3718
3815
|
}
|
|
3719
3816
|
ngAfterViewInit() {
|
|
3720
|
-
|
|
3721
|
-
|
|
3722
|
-
|
|
3723
|
-
|
|
3724
|
-
|
|
3725
|
-
|
|
3726
|
-
|
|
3727
|
-
|
|
3817
|
+
if (this.virtualScrollEnabled) {
|
|
3818
|
+
this.virtualScroll.renderedRangeStream.pipe(takeUntil(this.unsubscribe$)).subscribe((range) => {
|
|
3819
|
+
const linksElement = this.elementRef.nativeElement.querySelector('.gantt-links-overlay');
|
|
3820
|
+
linksElement.style.top = `${-(this.styles.lineHeight * range.start)}px`;
|
|
3821
|
+
this.rangeStart = range.start;
|
|
3822
|
+
this.rangeEnd = range.end;
|
|
3823
|
+
this.viewportItems = this.flatItems.slice(range.start, range.end);
|
|
3824
|
+
this.computeTempDataRefs();
|
|
3825
|
+
});
|
|
3826
|
+
}
|
|
3728
3827
|
}
|
|
3729
|
-
|
|
3828
|
+
buildFlatItems() {
|
|
3730
3829
|
const virtualData = [];
|
|
3731
3830
|
if (this.groups.length) {
|
|
3732
3831
|
this.groups.forEach((group) => {
|
|
@@ -3740,22 +3839,26 @@ class NgxGanttComponent extends GanttUpper {
|
|
|
3740
3839
|
if (this.items.length) {
|
|
3741
3840
|
virtualData.push(...recursiveItems(this.items));
|
|
3742
3841
|
}
|
|
3743
|
-
this.
|
|
3744
|
-
this.
|
|
3842
|
+
this.flatItems = [...virtualData];
|
|
3843
|
+
this.flatItemsMap = keyBy(this.flatItems, 'id');
|
|
3844
|
+
if (!this.virtualScrollEnabled) {
|
|
3845
|
+
this.rangeStart = 0;
|
|
3846
|
+
this.rangeEnd = this.flatItems.length - 1;
|
|
3847
|
+
}
|
|
3745
3848
|
}
|
|
3746
3849
|
afterExpand() {
|
|
3747
|
-
this.
|
|
3748
|
-
this.
|
|
3850
|
+
this.buildFlatItems();
|
|
3851
|
+
this.viewportItems = this.flatItems.slice(this.rangeStart, this.rangeEnd);
|
|
3749
3852
|
}
|
|
3750
3853
|
computeTempDataRefs() {
|
|
3751
3854
|
const tempItemData = [];
|
|
3752
|
-
this.
|
|
3855
|
+
this.viewportItems.forEach((data) => {
|
|
3753
3856
|
if (!data.hasOwnProperty('items')) {
|
|
3754
3857
|
const item = data;
|
|
3755
3858
|
if (item.links) {
|
|
3756
3859
|
item.links.forEach((link) => {
|
|
3757
|
-
if (this.
|
|
3758
|
-
tempItemData.push(this.
|
|
3860
|
+
if (this.flatItemsMap[link.link]) {
|
|
3861
|
+
tempItemData.push(this.flatItemsMap[link.link]);
|
|
3759
3862
|
}
|
|
3760
3863
|
});
|
|
3761
3864
|
}
|
|
@@ -3763,8 +3866,8 @@ class NgxGanttComponent extends GanttUpper {
|
|
|
3763
3866
|
}
|
|
3764
3867
|
});
|
|
3765
3868
|
this.computeItemsRefs(...uniqBy(tempItemData, 'id'));
|
|
3766
|
-
this.
|
|
3767
|
-
this.
|
|
3869
|
+
this.flatItems = [...this.flatItems];
|
|
3870
|
+
this.viewportItems = [...this.viewportItems];
|
|
3768
3871
|
}
|
|
3769
3872
|
expandChildren(item) {
|
|
3770
3873
|
if (!item.expanded) {
|
|
@@ -3833,7 +3936,7 @@ class NgxGanttComponent extends GanttUpper {
|
|
|
3833
3936
|
}
|
|
3834
3937
|
}
|
|
3835
3938
|
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 });
|
|
3836
|
-
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: [
|
|
3939
|
+
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: [
|
|
3837
3940
|
{
|
|
3838
3941
|
provide: GANTT_UPPER_TOKEN,
|
|
3839
3942
|
useExisting: NgxGanttComponent
|
|
@@ -3842,7 +3945,10 @@ NgxGanttComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", vers
|
|
|
3842
3945
|
provide: GANTT_ABSTRACT_TOKEN,
|
|
3843
3946
|
useExisting: forwardRef(() => NgxGanttComponent)
|
|
3844
3947
|
}
|
|
3845
|
-
], 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
|
|
3948
|
+
], 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 });
|
|
3949
|
+
__decorate([
|
|
3950
|
+
InputBoolean()
|
|
3951
|
+
], NgxGanttComponent.prototype, "virtualScrollEnabled", void 0);
|
|
3846
3952
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: NgxGanttComponent, decorators: [{
|
|
3847
3953
|
type: Component,
|
|
3848
3954
|
args: [{ selector: 'ngx-gantt', changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
@@ -3854,7 +3960,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImpor
|
|
|
3854
3960
|
provide: GANTT_ABSTRACT_TOKEN,
|
|
3855
3961
|
useExisting: forwardRef(() => NgxGanttComponent)
|
|
3856
3962
|
}
|
|
3857
|
-
], 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
|
|
3963
|
+
], 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" }]
|
|
3858
3964
|
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }, { type: i0.NgZone }, { type: GanttPrintService, decorators: [{
|
|
3859
3965
|
type: Optional
|
|
3860
3966
|
}] }, { type: undefined, decorators: [{
|
|
@@ -3870,6 +3976,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImpor
|
|
|
3870
3976
|
type: Input
|
|
3871
3977
|
}], loading: [{
|
|
3872
3978
|
type: Input
|
|
3979
|
+
}], virtualScrollEnabled: [{
|
|
3980
|
+
type: Input
|
|
3873
3981
|
}], loadingDelay: [{
|
|
3874
3982
|
type: Input
|
|
3875
3983
|
}], linkDragStarted: [{
|
|
@@ -3903,11 +4011,9 @@ NgxGanttModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version:
|
|
|
3903
4011
|
NgxGanttModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.1.4", ngImport: i0, type: NgxGanttModule, declarations: [NgxGanttComponent,
|
|
3904
4012
|
NgxGanttTableComponent,
|
|
3905
4013
|
NgxGanttTableColumnComponent,
|
|
3906
|
-
// GanttTableComponent,
|
|
3907
4014
|
GanttTableHeaderComponent,
|
|
3908
4015
|
GanttTableBodyComponent,
|
|
3909
4016
|
GanttMainComponent,
|
|
3910
|
-
// GanttCalendarComponent,
|
|
3911
4017
|
GanttCalendarHeaderComponent,
|
|
3912
4018
|
GanttCalendarGridComponent,
|
|
3913
4019
|
GanttLinksComponent,
|
|
@@ -3954,11 +4060,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImpor
|
|
|
3954
4060
|
NgxGanttComponent,
|
|
3955
4061
|
NgxGanttTableComponent,
|
|
3956
4062
|
NgxGanttTableColumnComponent,
|
|
3957
|
-
// GanttTableComponent,
|
|
3958
4063
|
GanttTableHeaderComponent,
|
|
3959
4064
|
GanttTableBodyComponent,
|
|
3960
4065
|
GanttMainComponent,
|
|
3961
|
-
// GanttCalendarComponent,
|
|
3962
4066
|
GanttCalendarHeaderComponent,
|
|
3963
4067
|
GanttCalendarGridComponent,
|
|
3964
4068
|
GanttLinksComponent,
|