@worktile/gantt 15.1.0-next.8 → 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/event.d.ts +8 -0
- 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 +8 -6
- package/esm2020/class/event.mjs +5 -1
- package/esm2020/class/link.mjs +2 -2
- package/esm2020/components/bar/bar-drag.mjs +110 -40
- package/esm2020/components/bar/bar.component.mjs +5 -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 +32 -18
- package/esm2020/gantt.component.mjs +46 -28
- package/esm2020/gantt.module.mjs +1 -7
- package/esm2020/gantt.styles.mjs +2 -2
- package/esm2020/table/gantt-table.component.mjs +8 -2
- package/esm2020/utils/drag-scroll.mjs +20 -1
- package/fesm2015/worktile-gantt.mjs +232 -101
- package/fesm2015/worktile-gantt.mjs.map +1 -1
- package/fesm2020/worktile-gantt.mjs +229 -100
- 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/table/gantt-table.component.d.ts +4 -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) {
|
|
@@ -41,6 +42,10 @@ class GanttSelectedEvent {
|
|
|
41
42
|
}
|
|
42
43
|
class GanttTableDragDroppedEvent {
|
|
43
44
|
}
|
|
45
|
+
class GanttTableDragStartedEvent {
|
|
46
|
+
}
|
|
47
|
+
class GanttTableDragEndedEvent {
|
|
48
|
+
}
|
|
44
49
|
class GanttTableDragEnterPredicateContext {
|
|
45
50
|
}
|
|
46
51
|
|
|
@@ -218,7 +223,7 @@ var LinkColors;
|
|
|
218
223
|
(function (LinkColors) {
|
|
219
224
|
LinkColors["default"] = "#cacaca";
|
|
220
225
|
LinkColors["blocked"] = "#FF7575";
|
|
221
|
-
LinkColors["active"] = "#
|
|
226
|
+
LinkColors["active"] = "#6698ff";
|
|
222
227
|
})(LinkColors || (LinkColors = {}));
|
|
223
228
|
|
|
224
229
|
var GanttItemType;
|
|
@@ -774,7 +779,7 @@ const sideWidth = 400;
|
|
|
774
779
|
const sideMiddleWidth = 500;
|
|
775
780
|
const sideMaxWidth = 600;
|
|
776
781
|
const sideMinWidth = 400;
|
|
777
|
-
const barBackground = '#
|
|
782
|
+
const barBackground = '#6698ff';
|
|
778
783
|
const rangeHeight = 17;
|
|
779
784
|
const todayHeight = 24;
|
|
780
785
|
const todayWidth = 35;
|
|
@@ -1278,11 +1283,13 @@ class NgxGanttTableComponent {
|
|
|
1278
1283
|
constructor() {
|
|
1279
1284
|
this.draggable = false;
|
|
1280
1285
|
this.dragDropped = new EventEmitter();
|
|
1286
|
+
this.dragStarted = new EventEmitter();
|
|
1287
|
+
this.dragEnded = new EventEmitter();
|
|
1281
1288
|
this.columnChanges = new EventEmitter();
|
|
1282
1289
|
}
|
|
1283
1290
|
}
|
|
1284
1291
|
NgxGanttTableComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: NgxGanttTableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1285
|
-
NgxGanttTableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.4", type: NgxGanttTableComponent, selector: "ngx-gantt-table", inputs: { draggable: "draggable", dropEnterPredicate: "dropEnterPredicate" }, outputs: { dragDropped: "dragDropped", columnChanges: "columnChanges" }, queries: [{ propertyName: "rowBeforeTemplate", first: true, predicate: ["rowBeforeSlot"], descendants: true, static: true }, { propertyName: "rowAfterTemplate", first: true, predicate: ["rowAfterSlot"], descendants: true, static: true }], ngImport: i0, template: '', isInline: true });
|
|
1292
|
+
NgxGanttTableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.4", type: NgxGanttTableComponent, selector: "ngx-gantt-table", inputs: { draggable: "draggable", dropEnterPredicate: "dropEnterPredicate" }, outputs: { dragDropped: "dragDropped", dragStarted: "dragStarted", dragEnded: "dragEnded", columnChanges: "columnChanges" }, queries: [{ propertyName: "rowBeforeTemplate", first: true, predicate: ["rowBeforeSlot"], descendants: true, static: true }, { propertyName: "rowAfterTemplate", first: true, predicate: ["rowAfterSlot"], descendants: true, static: true }], ngImport: i0, template: '', isInline: true });
|
|
1286
1293
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: NgxGanttTableComponent, decorators: [{
|
|
1287
1294
|
type: Component,
|
|
1288
1295
|
args: [{
|
|
@@ -1295,6 +1302,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImpor
|
|
|
1295
1302
|
type: Input
|
|
1296
1303
|
}], dragDropped: [{
|
|
1297
1304
|
type: Output
|
|
1305
|
+
}], dragStarted: [{
|
|
1306
|
+
type: Output
|
|
1307
|
+
}], dragEnded: [{
|
|
1308
|
+
type: Output
|
|
1298
1309
|
}], columnChanges: [{
|
|
1299
1310
|
type: Output
|
|
1300
1311
|
}], rowBeforeTemplate: [{
|
|
@@ -1709,16 +1720,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImpor
|
|
|
1709
1720
|
}] });
|
|
1710
1721
|
|
|
1711
1722
|
class GanttTableBodyComponent {
|
|
1712
|
-
set
|
|
1723
|
+
set viewportItems(data) {
|
|
1713
1724
|
const firstData = data[0];
|
|
1714
1725
|
if (firstData && firstData.hasOwnProperty('items')) {
|
|
1715
1726
|
this.hasGroup = true;
|
|
1716
1727
|
}
|
|
1717
1728
|
this.ganttTableEmptyClass = data?.length ? false : true;
|
|
1718
|
-
this.
|
|
1729
|
+
this._viewportItems = data;
|
|
1719
1730
|
}
|
|
1720
|
-
get
|
|
1721
|
-
return this.
|
|
1731
|
+
get viewportItems() {
|
|
1732
|
+
return this._viewportItems;
|
|
1722
1733
|
}
|
|
1723
1734
|
constructor(gantt, ganttUpper, cdr, document) {
|
|
1724
1735
|
this.gantt = gantt;
|
|
@@ -1727,6 +1738,8 @@ class GanttTableBodyComponent {
|
|
|
1727
1738
|
this.document = document;
|
|
1728
1739
|
this.draggable = false;
|
|
1729
1740
|
this.dragDropped = new EventEmitter();
|
|
1741
|
+
this.dragStarted = new EventEmitter();
|
|
1742
|
+
this.dragEnded = new EventEmitter();
|
|
1730
1743
|
this.itemClick = new EventEmitter();
|
|
1731
1744
|
this.ganttTableClass = true;
|
|
1732
1745
|
this.ganttTableEmptyClass = false;
|
|
@@ -1785,6 +1798,10 @@ class GanttTableBodyComponent {
|
|
|
1785
1798
|
children.forEach((element) => {
|
|
1786
1799
|
element.classList.add('drag-item-hide');
|
|
1787
1800
|
});
|
|
1801
|
+
this.dragStarted.emit({
|
|
1802
|
+
source: event.source.data?.origin,
|
|
1803
|
+
sourceParent: this.getParentByItem(event.source.data)?.origin
|
|
1804
|
+
});
|
|
1788
1805
|
}
|
|
1789
1806
|
emitItemDragMoved(event) {
|
|
1790
1807
|
this.itemDragMoved.next(event);
|
|
@@ -1829,6 +1846,10 @@ class GanttTableBodyComponent {
|
|
|
1829
1846
|
}
|
|
1830
1847
|
onItemDragEnded(event) {
|
|
1831
1848
|
this.ganttTableDragging = false;
|
|
1849
|
+
this.dragEnded.emit({
|
|
1850
|
+
source: event.source.data?.origin,
|
|
1851
|
+
sourceParent: this.getParentByItem(event.source.data)?.origin
|
|
1852
|
+
});
|
|
1832
1853
|
}
|
|
1833
1854
|
onListDropped(event) {
|
|
1834
1855
|
if (!this.itemDropTarget) {
|
|
@@ -1869,13 +1890,13 @@ class GanttTableBodyComponent {
|
|
|
1869
1890
|
this.destroy$.complete();
|
|
1870
1891
|
}
|
|
1871
1892
|
removeItem(item, children) {
|
|
1872
|
-
this.
|
|
1873
|
-
this.
|
|
1893
|
+
this.viewportItems.splice(this.viewportItems.indexOf(item), 1 + children.length);
|
|
1894
|
+
this.flatItems.splice(this.flatItems.indexOf(item), 1 + children.length);
|
|
1874
1895
|
}
|
|
1875
1896
|
insertItem(target, inserted, children, position) {
|
|
1876
1897
|
if (position === 'before') {
|
|
1877
|
-
this.
|
|
1878
|
-
this.
|
|
1898
|
+
this.viewportItems.splice(this.viewportItems.indexOf(target), 0, inserted, ...children);
|
|
1899
|
+
this.flatItems.splice(this.flatItems.indexOf(target), 0, inserted, ...children);
|
|
1879
1900
|
}
|
|
1880
1901
|
else {
|
|
1881
1902
|
const dragRef = this.cdkDrags.find((drag) => drag.data === target);
|
|
@@ -1884,19 +1905,19 @@ class GanttTableBodyComponent {
|
|
|
1884
1905
|
if (target.expanded) {
|
|
1885
1906
|
childrenCount = this.getChildrenElementsByElement(dragRef.element.nativeElement)?.length || 0;
|
|
1886
1907
|
}
|
|
1887
|
-
this.
|
|
1888
|
-
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);
|
|
1889
1910
|
}
|
|
1890
1911
|
}
|
|
1891
1912
|
insertChildrenItem(target, inserted, children) {
|
|
1892
1913
|
if (target.expanded) {
|
|
1893
|
-
this.
|
|
1894
|
-
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);
|
|
1895
1916
|
}
|
|
1896
1917
|
target.children.push(inserted);
|
|
1897
1918
|
}
|
|
1898
1919
|
getParentByItem(item) {
|
|
1899
|
-
return (this.
|
|
1920
|
+
return (this.flatItems || []).find((n) => {
|
|
1900
1921
|
return n.children?.includes(item);
|
|
1901
1922
|
});
|
|
1902
1923
|
}
|
|
@@ -1954,10 +1975,10 @@ class GanttTableBodyComponent {
|
|
|
1954
1975
|
}
|
|
1955
1976
|
}
|
|
1956
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 });
|
|
1957
|
-
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" }] });
|
|
1958
1979
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: GanttTableBodyComponent, decorators: [{
|
|
1959
1980
|
type: Component,
|
|
1960
|
-
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" }]
|
|
1961
1982
|
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
1962
1983
|
type: Inject,
|
|
1963
1984
|
args: [GANTT_ABSTRACT_TOKEN]
|
|
@@ -1967,9 +1988,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImpor
|
|
|
1967
1988
|
}] }, { type: i0.ChangeDetectorRef }, { type: Document, decorators: [{
|
|
1968
1989
|
type: Inject,
|
|
1969
1990
|
args: [DOCUMENT]
|
|
1970
|
-
}] }]; }, propDecorators: {
|
|
1991
|
+
}] }]; }, propDecorators: { viewportItems: [{
|
|
1971
1992
|
type: Input
|
|
1972
|
-
}],
|
|
1993
|
+
}], flatItems: [{
|
|
1973
1994
|
type: Input
|
|
1974
1995
|
}], columns: [{
|
|
1975
1996
|
type: Input
|
|
@@ -1990,6 +2011,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImpor
|
|
|
1990
2011
|
type: Input
|
|
1991
2012
|
}], dragDropped: [{
|
|
1992
2013
|
type: Output
|
|
2014
|
+
}], dragStarted: [{
|
|
2015
|
+
type: Output
|
|
2016
|
+
}], dragEnded: [{
|
|
2017
|
+
type: Output
|
|
1993
2018
|
}], itemClick: [{
|
|
1994
2019
|
type: Output
|
|
1995
2020
|
}], ganttTableClass: [{
|
|
@@ -2267,7 +2292,7 @@ class GanttLinksComponent {
|
|
|
2267
2292
|
this.ngZone = ngZone;
|
|
2268
2293
|
// @Input() groups: GanttGroupInternal[] = [];
|
|
2269
2294
|
// @Input() items: GanttItemInternal[] = [];
|
|
2270
|
-
this.
|
|
2295
|
+
this.flatItems = [];
|
|
2271
2296
|
this.lineClick = new EventEmitter();
|
|
2272
2297
|
this.links = [];
|
|
2273
2298
|
this.ganttLinkTypes = GanttLinkType;
|
|
@@ -2344,7 +2369,7 @@ class GanttLinksComponent {
|
|
|
2344
2369
|
// });
|
|
2345
2370
|
// });
|
|
2346
2371
|
// }
|
|
2347
|
-
this.
|
|
2372
|
+
this.flatItems.forEach((item, itemIndex) => {
|
|
2348
2373
|
if (!item.hasOwnProperty('items')) {
|
|
2349
2374
|
const ganttItem = item;
|
|
2350
2375
|
if (ganttItem.refs) {
|
|
@@ -2428,14 +2453,14 @@ class GanttLinksComponent {
|
|
|
2428
2453
|
}
|
|
2429
2454
|
}
|
|
2430
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 });
|
|
2431
|
-
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"] }] });
|
|
2432
2457
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: GanttLinksComponent, decorators: [{
|
|
2433
2458
|
type: Component,
|
|
2434
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" }]
|
|
2435
2460
|
}], ctorParameters: function () { return [{ type: GanttUpper, decorators: [{
|
|
2436
2461
|
type: Inject,
|
|
2437
2462
|
args: [GANTT_UPPER_TOKEN]
|
|
2438
|
-
}] }, { 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: [{
|
|
2439
2464
|
type: Input
|
|
2440
2465
|
}], lineClick: [{
|
|
2441
2466
|
type: Output
|
|
@@ -2508,6 +2533,25 @@ function isPointerNearClientRect(rect, threshold, pointerX, pointerY) {
|
|
|
2508
2533
|
const yThreshold = height * threshold;
|
|
2509
2534
|
return pointerY > top - yThreshold && pointerY < bottom + yThreshold && pointerX > left - xThreshold && pointerX < right + xThreshold;
|
|
2510
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
|
+
}
|
|
2511
2555
|
|
|
2512
2556
|
const scrollThreshold = 50;
|
|
2513
2557
|
var ScrollDirection;
|
|
@@ -2622,7 +2666,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImpor
|
|
|
2622
2666
|
*/
|
|
2623
2667
|
const DROP_PROXIMITY_THRESHOLD = 0.05;
|
|
2624
2668
|
const dragMinWidth = 10;
|
|
2625
|
-
const
|
|
2669
|
+
const autoScrollBaseStep = 2;
|
|
2626
2670
|
const activeClass = 'gantt-bar-active';
|
|
2627
2671
|
const dropActiveClass = 'gantt-bar-drop-active';
|
|
2628
2672
|
const singleDropActiveClass = 'gantt-bar-single-drop-active';
|
|
@@ -2638,6 +2682,12 @@ class GanttBarDrag {
|
|
|
2638
2682
|
get linkDragDisabled() {
|
|
2639
2683
|
return !this.item.linkable || !this.ganttUpper.linkable;
|
|
2640
2684
|
}
|
|
2685
|
+
get barHandleDragMoveAndScrollDistance() {
|
|
2686
|
+
return this.barHandleDragMoveDistance + this.dragScrollDistance;
|
|
2687
|
+
}
|
|
2688
|
+
get autoScrollStep() {
|
|
2689
|
+
return Math.pow(autoScrollBaseStep, this.autoScrollSpeedRates);
|
|
2690
|
+
}
|
|
2641
2691
|
constructor(dragDrop, dom, dragContainer, _ngZone) {
|
|
2642
2692
|
this.dragDrop = dragDrop;
|
|
2643
2693
|
this.dom = dom;
|
|
@@ -2657,13 +2707,15 @@ class GanttBarDrag {
|
|
|
2657
2707
|
this.dragScrollDistance = 0;
|
|
2658
2708
|
/** Horizontal direction in which the list is currently scrolling. */
|
|
2659
2709
|
this._horizontalScrollDirection = 0 /* AutoScrollHorizontalDirection.NONE */;
|
|
2710
|
+
/** Speed ratio for auto scroll */
|
|
2711
|
+
this.autoScrollSpeedRates = 1;
|
|
2660
2712
|
this.startScrollInterval = () => {
|
|
2661
2713
|
this.stopScrolling();
|
|
2662
2714
|
interval(0, animationFrameScheduler)
|
|
2663
2715
|
.pipe(takeUntil(this.stopScrollTimers$))
|
|
2664
2716
|
.subscribe(() => {
|
|
2665
2717
|
const node = this.dom.mainContainer;
|
|
2666
|
-
const scrollStep = autoScrollStep;
|
|
2718
|
+
const scrollStep = this.autoScrollStep;
|
|
2667
2719
|
if (this._horizontalScrollDirection === 1 /* AutoScrollHorizontalDirection.LEFT */) {
|
|
2668
2720
|
node.scrollBy(-scrollStep, 0);
|
|
2669
2721
|
}
|
|
@@ -2771,16 +2823,32 @@ class GanttBarDrag {
|
|
|
2771
2823
|
const dragScrollDistance = this.dom.mainContainer.scrollLeft - this.containerScrollLeft;
|
|
2772
2824
|
this.dragScrollDistance = dragScrollDistance;
|
|
2773
2825
|
dragRef['_boundaryRect'] = this.dom.mainItems.getBoundingClientRect();
|
|
2774
|
-
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
|
+
}
|
|
2775
2836
|
}
|
|
2776
2837
|
});
|
|
2777
2838
|
this.dragContainer.dragStarted.emit({ item: this.item.origin });
|
|
2778
2839
|
});
|
|
2779
2840
|
dragRef.moved.subscribe((event) => {
|
|
2780
|
-
this.
|
|
2841
|
+
if (this.barHandleDragMoveRecordDays && this.barHandleDragMoveRecordDays > 0) {
|
|
2842
|
+
this.startScrollingIfNecessary(event.pointerPosition.x, event.pointerPosition.y);
|
|
2843
|
+
}
|
|
2781
2844
|
this.barHandleDragMoveDistance = event.distance.x;
|
|
2782
2845
|
if (!this.dragScrolling) {
|
|
2783
|
-
|
|
2846
|
+
if (isBefore) {
|
|
2847
|
+
this.barBeforeHandleDragMove();
|
|
2848
|
+
}
|
|
2849
|
+
else {
|
|
2850
|
+
this.barAfterHandleDragMove();
|
|
2851
|
+
}
|
|
2784
2852
|
}
|
|
2785
2853
|
});
|
|
2786
2854
|
dragRef.ended.subscribe((event) => {
|
|
@@ -2863,10 +2931,10 @@ class GanttBarDrag {
|
|
|
2863
2931
|
let left = dragRect.left - rootRect.left - (this.dom.side.clientWidth + 1);
|
|
2864
2932
|
if (this.dragScrolling) {
|
|
2865
2933
|
if (this._horizontalScrollDirection === 1 /* AutoScrollHorizontalDirection.LEFT */) {
|
|
2866
|
-
left += autoScrollStep;
|
|
2934
|
+
left += this.autoScrollStep;
|
|
2867
2935
|
}
|
|
2868
2936
|
else if (this._horizontalScrollDirection === 2 /* AutoScrollHorizontalDirection.RIGHT */) {
|
|
2869
|
-
left -= autoScrollStep;
|
|
2937
|
+
left -= this.autoScrollStep;
|
|
2870
2938
|
}
|
|
2871
2939
|
}
|
|
2872
2940
|
const width = dragRect.right - dragRect.left;
|
|
@@ -2916,44 +2984,51 @@ class GanttBarDrag {
|
|
|
2916
2984
|
this.item.updateDate(start, end);
|
|
2917
2985
|
this.dragContainer.dragMoved.emit({ item: this.item.origin });
|
|
2918
2986
|
}
|
|
2919
|
-
|
|
2920
|
-
const
|
|
2921
|
-
|
|
2922
|
-
|
|
2923
|
-
|
|
2924
|
-
|
|
2925
|
-
|
|
2926
|
-
|
|
2927
|
-
|
|
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);
|
|
2928
3004
|
this.barElement.style.left = x + 'px';
|
|
2929
|
-
this.openDragBackdrop(this.barElement, start, this.item.end);
|
|
2930
|
-
if (!this.isStartOrEndInsideView(start, this.item.end)) {
|
|
2931
|
-
return;
|
|
2932
|
-
}
|
|
2933
|
-
this.item.updateDate(start, this.item.end);
|
|
2934
3005
|
}
|
|
2935
|
-
|
|
2936
|
-
|
|
2937
|
-
|
|
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;
|
|
2938
3020
|
}
|
|
3021
|
+
this.item.updateDate(this.item.start, end);
|
|
2939
3022
|
}
|
|
2940
3023
|
else {
|
|
2941
|
-
|
|
2942
|
-
|
|
2943
|
-
|
|
2944
|
-
if (width > dragMinWidth && days > 0) {
|
|
2945
|
-
this.barElement.style.width = width + 'px';
|
|
2946
|
-
this.openDragBackdrop(this.barElement, this.item.start, end);
|
|
2947
|
-
if (!this.isStartOrEndInsideView(this.item.start, end)) {
|
|
2948
|
-
return;
|
|
2949
|
-
}
|
|
2950
|
-
this.item.updateDate(this.item.start, end);
|
|
2951
|
-
}
|
|
2952
|
-
else {
|
|
2953
|
-
this.openDragBackdrop(this.barElement, this.item.start, this.item.start.endOfDay());
|
|
2954
|
-
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';
|
|
2955
3027
|
}
|
|
3028
|
+
this.openDragBackdrop(this.barElement, this.item.start, this.item.start.endOfDay());
|
|
3029
|
+
this.item.updateDate(this.item.start, this.item.start.endOfDay());
|
|
2956
3030
|
}
|
|
3031
|
+
this.barHandleDragMoveRecordDays = days;
|
|
2957
3032
|
this.dragContainer.dragMoved.emit({ item: this.item.origin });
|
|
2958
3033
|
}
|
|
2959
3034
|
calcLinkLinePositions(target, isBefore) {
|
|
@@ -2992,6 +3067,7 @@ class GanttBarDrag {
|
|
|
2992
3067
|
(horizontalScrollDirection === 2 /* AutoScrollHorizontalDirection.RIGHT */ &&
|
|
2993
3068
|
scrollLeft < this.ganttUpper.view.width - clientRect.width)) {
|
|
2994
3069
|
this._horizontalScrollDirection = horizontalScrollDirection;
|
|
3070
|
+
this.autoScrollSpeedRates = getAutoScrollSpeedRates(clientRect, pointerX, horizontalScrollDirection);
|
|
2995
3071
|
this.dragScrolling = true;
|
|
2996
3072
|
this._ngZone.runOutsideAngular(this.startScrollInterval);
|
|
2997
3073
|
}
|
|
@@ -3001,6 +3077,44 @@ class GanttBarDrag {
|
|
|
3001
3077
|
}
|
|
3002
3078
|
}
|
|
3003
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
|
+
}
|
|
3004
3118
|
stopScrolling() {
|
|
3005
3119
|
this.stopScrollTimers$.next();
|
|
3006
3120
|
}
|
|
@@ -3136,7 +3250,10 @@ class NgxGanttBarComponent extends GanttItemUpper {
|
|
|
3136
3250
|
super.ngOnChanges(changes);
|
|
3137
3251
|
if (!this.firstChange) {
|
|
3138
3252
|
this.drag.updateItem(this.item);
|
|
3139
|
-
if (changes.item.currentValue.refs?.width !== changes.item.previousValue.refs?.width
|
|
3253
|
+
if (changes.item.currentValue.refs?.width !== changes.item.previousValue.refs?.width ||
|
|
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) {
|
|
3140
3257
|
this.setContentBackground();
|
|
3141
3258
|
}
|
|
3142
3259
|
}
|
|
@@ -3285,16 +3402,16 @@ class GanttMainComponent {
|
|
|
3285
3402
|
}
|
|
3286
3403
|
}
|
|
3287
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 });
|
|
3288
|
-
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" }] });
|
|
3289
3406
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: GanttMainComponent, decorators: [{
|
|
3290
3407
|
type: Component,
|
|
3291
|
-
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" }]
|
|
3292
3409
|
}], ctorParameters: function () { return [{ type: GanttUpper, decorators: [{
|
|
3293
3410
|
type: Inject,
|
|
3294
3411
|
args: [GANTT_UPPER_TOKEN]
|
|
3295
|
-
}] }]; }, propDecorators: {
|
|
3412
|
+
}] }]; }, propDecorators: { viewportItems: [{
|
|
3296
3413
|
type: Input
|
|
3297
|
-
}],
|
|
3414
|
+
}], flatItems: [{
|
|
3298
3415
|
type: Input
|
|
3299
3416
|
}], groupHeaderTemplate: [{
|
|
3300
3417
|
type: Input
|
|
@@ -3642,19 +3759,20 @@ class NgxGanttComponent extends GanttUpper {
|
|
|
3642
3759
|
super(elementRef, cdr, ngZone, config);
|
|
3643
3760
|
this.printService = printService;
|
|
3644
3761
|
this.maxLevel = 2;
|
|
3762
|
+
this.virtualScrollEnabled = true;
|
|
3645
3763
|
this.loadingDelay = 0;
|
|
3646
3764
|
this.linkDragStarted = new EventEmitter();
|
|
3647
3765
|
this.linkDragEnded = new EventEmitter();
|
|
3648
3766
|
this.lineClick = new EventEmitter();
|
|
3649
3767
|
this.selectedChange = new EventEmitter();
|
|
3650
|
-
this.
|
|
3651
|
-
this.
|
|
3768
|
+
this.flatItems = [];
|
|
3769
|
+
this.viewportItems = [];
|
|
3652
3770
|
this._loading = false;
|
|
3653
3771
|
this.computeAllRefs = false;
|
|
3654
3772
|
}
|
|
3655
3773
|
ngOnInit() {
|
|
3656
3774
|
super.ngOnInit();
|
|
3657
|
-
this.
|
|
3775
|
+
this.buildFlatItems();
|
|
3658
3776
|
// Note: the zone may be nooped through `BootstrapOptions` when bootstrapping the root module. This means
|
|
3659
3777
|
// the `onStable` will never emit any value.
|
|
3660
3778
|
const onStable$ = this.ngZone.isStable ? from(Promise.resolve()) : this.ngZone.onStable.pipe(take(1));
|
|
@@ -3676,32 +3794,38 @@ class NgxGanttComponent extends GanttUpper {
|
|
|
3676
3794
|
this.view.start$.pipe(skip(1), takeUntil(this.unsubscribe$)).subscribe(() => {
|
|
3677
3795
|
this.computeTempDataRefs();
|
|
3678
3796
|
});
|
|
3797
|
+
if (!this.virtualScrollEnabled) {
|
|
3798
|
+
this.viewportItems = this.flatItems.slice(this.rangeStart, this.rangeEnd);
|
|
3799
|
+
this.computeTempDataRefs();
|
|
3800
|
+
}
|
|
3679
3801
|
}
|
|
3680
3802
|
ngOnChanges(changes) {
|
|
3681
3803
|
super.ngOnChanges(changes);
|
|
3682
3804
|
if (!this.firstChange) {
|
|
3683
3805
|
if (changes.viewType && changes.viewType.currentValue) {
|
|
3684
|
-
this.
|
|
3806
|
+
this.viewportItems = this.flatItems.slice(this.rangeStart, this.rangeEnd);
|
|
3685
3807
|
this.computeTempDataRefs();
|
|
3686
3808
|
}
|
|
3687
3809
|
if (changes.originItems || changes.originGroups) {
|
|
3688
|
-
this.
|
|
3689
|
-
this.
|
|
3810
|
+
this.buildFlatItems();
|
|
3811
|
+
this.viewportItems = this.flatItems.slice(this.rangeStart, this.rangeEnd);
|
|
3690
3812
|
this.computeTempDataRefs();
|
|
3691
3813
|
}
|
|
3692
3814
|
}
|
|
3693
3815
|
}
|
|
3694
3816
|
ngAfterViewInit() {
|
|
3695
|
-
|
|
3696
|
-
|
|
3697
|
-
|
|
3698
|
-
|
|
3699
|
-
|
|
3700
|
-
|
|
3701
|
-
|
|
3702
|
-
|
|
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
|
+
}
|
|
3703
3827
|
}
|
|
3704
|
-
|
|
3828
|
+
buildFlatItems() {
|
|
3705
3829
|
const virtualData = [];
|
|
3706
3830
|
if (this.groups.length) {
|
|
3707
3831
|
this.groups.forEach((group) => {
|
|
@@ -3715,22 +3839,26 @@ class NgxGanttComponent extends GanttUpper {
|
|
|
3715
3839
|
if (this.items.length) {
|
|
3716
3840
|
virtualData.push(...recursiveItems(this.items));
|
|
3717
3841
|
}
|
|
3718
|
-
this.
|
|
3719
|
-
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
|
+
}
|
|
3720
3848
|
}
|
|
3721
3849
|
afterExpand() {
|
|
3722
|
-
this.
|
|
3723
|
-
this.
|
|
3850
|
+
this.buildFlatItems();
|
|
3851
|
+
this.viewportItems = this.flatItems.slice(this.rangeStart, this.rangeEnd);
|
|
3724
3852
|
}
|
|
3725
3853
|
computeTempDataRefs() {
|
|
3726
3854
|
const tempItemData = [];
|
|
3727
|
-
this.
|
|
3855
|
+
this.viewportItems.forEach((data) => {
|
|
3728
3856
|
if (!data.hasOwnProperty('items')) {
|
|
3729
3857
|
const item = data;
|
|
3730
3858
|
if (item.links) {
|
|
3731
3859
|
item.links.forEach((link) => {
|
|
3732
|
-
if (this.
|
|
3733
|
-
tempItemData.push(this.
|
|
3860
|
+
if (this.flatItemsMap[link.link]) {
|
|
3861
|
+
tempItemData.push(this.flatItemsMap[link.link]);
|
|
3734
3862
|
}
|
|
3735
3863
|
});
|
|
3736
3864
|
}
|
|
@@ -3738,8 +3866,8 @@ class NgxGanttComponent extends GanttUpper {
|
|
|
3738
3866
|
}
|
|
3739
3867
|
});
|
|
3740
3868
|
this.computeItemsRefs(...uniqBy(tempItemData, 'id'));
|
|
3741
|
-
this.
|
|
3742
|
-
this.
|
|
3869
|
+
this.flatItems = [...this.flatItems];
|
|
3870
|
+
this.viewportItems = [...this.viewportItems];
|
|
3743
3871
|
}
|
|
3744
3872
|
expandChildren(item) {
|
|
3745
3873
|
if (!item.expanded) {
|
|
@@ -3808,7 +3936,7 @@ class NgxGanttComponent extends GanttUpper {
|
|
|
3808
3936
|
}
|
|
3809
3937
|
}
|
|
3810
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 });
|
|
3811
|
-
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: [
|
|
3812
3940
|
{
|
|
3813
3941
|
provide: GANTT_UPPER_TOKEN,
|
|
3814
3942
|
useExisting: NgxGanttComponent
|
|
@@ -3817,7 +3945,10 @@ NgxGanttComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", vers
|
|
|
3817
3945
|
provide: GANTT_ABSTRACT_TOKEN,
|
|
3818
3946
|
useExisting: forwardRef(() => NgxGanttComponent)
|
|
3819
3947
|
}
|
|
3820
|
-
], 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);
|
|
3821
3952
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: NgxGanttComponent, decorators: [{
|
|
3822
3953
|
type: Component,
|
|
3823
3954
|
args: [{ selector: 'ngx-gantt', changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
@@ -3829,7 +3960,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImpor
|
|
|
3829
3960
|
provide: GANTT_ABSTRACT_TOKEN,
|
|
3830
3961
|
useExisting: forwardRef(() => NgxGanttComponent)
|
|
3831
3962
|
}
|
|
3832
|
-
], 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" }]
|
|
3833
3964
|
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }, { type: i0.NgZone }, { type: GanttPrintService, decorators: [{
|
|
3834
3965
|
type: Optional
|
|
3835
3966
|
}] }, { type: undefined, decorators: [{
|
|
@@ -3845,6 +3976,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImpor
|
|
|
3845
3976
|
type: Input
|
|
3846
3977
|
}], loading: [{
|
|
3847
3978
|
type: Input
|
|
3979
|
+
}], virtualScrollEnabled: [{
|
|
3980
|
+
type: Input
|
|
3848
3981
|
}], loadingDelay: [{
|
|
3849
3982
|
type: Input
|
|
3850
3983
|
}], linkDragStarted: [{
|
|
@@ -3878,11 +4011,9 @@ NgxGanttModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version:
|
|
|
3878
4011
|
NgxGanttModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.1.4", ngImport: i0, type: NgxGanttModule, declarations: [NgxGanttComponent,
|
|
3879
4012
|
NgxGanttTableComponent,
|
|
3880
4013
|
NgxGanttTableColumnComponent,
|
|
3881
|
-
// GanttTableComponent,
|
|
3882
4014
|
GanttTableHeaderComponent,
|
|
3883
4015
|
GanttTableBodyComponent,
|
|
3884
4016
|
GanttMainComponent,
|
|
3885
|
-
// GanttCalendarComponent,
|
|
3886
4017
|
GanttCalendarHeaderComponent,
|
|
3887
4018
|
GanttCalendarGridComponent,
|
|
3888
4019
|
GanttLinksComponent,
|
|
@@ -3929,11 +4060,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImpor
|
|
|
3929
4060
|
NgxGanttComponent,
|
|
3930
4061
|
NgxGanttTableComponent,
|
|
3931
4062
|
NgxGanttTableColumnComponent,
|
|
3932
|
-
// GanttTableComponent,
|
|
3933
4063
|
GanttTableHeaderComponent,
|
|
3934
4064
|
GanttTableBodyComponent,
|
|
3935
4065
|
GanttMainComponent,
|
|
3936
|
-
// GanttCalendarComponent,
|
|
3937
4066
|
GanttCalendarHeaderComponent,
|
|
3938
4067
|
GanttCalendarGridComponent,
|
|
3939
4068
|
GanttLinksComponent,
|
|
@@ -3967,5 +4096,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImpor
|
|
|
3967
4096
|
* Generated bundle index. Do not edit.
|
|
3968
4097
|
*/
|
|
3969
4098
|
|
|
3970
|
-
export { GANTT_GLOBAL_CONFIG, GANTT_UPPER_TOKEN, GanttBarClickEvent, GanttBaselineItemInternal, GanttDate, GanttDatePoint, GanttDragEvent, GanttGroupInternal, GanttItemInternal, GanttItemType, GanttItemUpper, GanttLineClickEvent, GanttLinkDragEvent, GanttLinkLineType, GanttLinkType, GanttLoadOnScrollEvent, GanttLoaderComponent, GanttPrintService, GanttSelectedEvent, GanttTableDragDroppedEvent, GanttTableDragEnterPredicateContext, GanttTableEvent, GanttUpper, GanttView, GanttViewType, IsGanttBarItemPipe, IsGanttCustomItemPipe, IsGanttRangeItemPipe, LinkColors, NgxGanttBarComponent, NgxGanttBaselineComponent, NgxGanttComponent, NgxGanttModule, NgxGanttRangeComponent, NgxGanttRootComponent, NgxGanttTableColumnComponent, NgxGanttTableComponent, NgxGanttToolbarComponent, defaultConfig, ganttViews, primaryDatePointTop, registerView, secondaryDatePointTop };
|
|
4099
|
+
export { GANTT_GLOBAL_CONFIG, GANTT_UPPER_TOKEN, GanttBarClickEvent, GanttBaselineItemInternal, GanttDate, GanttDatePoint, GanttDragEvent, GanttGroupInternal, GanttItemInternal, GanttItemType, GanttItemUpper, GanttLineClickEvent, GanttLinkDragEvent, GanttLinkLineType, GanttLinkType, GanttLoadOnScrollEvent, GanttLoaderComponent, GanttPrintService, GanttSelectedEvent, GanttTableDragDroppedEvent, GanttTableDragEndedEvent, GanttTableDragEnterPredicateContext, GanttTableDragStartedEvent, GanttTableEvent, GanttUpper, GanttView, GanttViewType, IsGanttBarItemPipe, IsGanttCustomItemPipe, IsGanttRangeItemPipe, LinkColors, NgxGanttBarComponent, NgxGanttBaselineComponent, NgxGanttComponent, NgxGanttModule, NgxGanttRangeComponent, NgxGanttRootComponent, NgxGanttTableColumnComponent, NgxGanttTableComponent, NgxGanttToolbarComponent, defaultConfig, ganttViews, primaryDatePointTop, registerView, secondaryDatePointTop };
|
|
3971
4100
|
//# sourceMappingURL=worktile-gantt.mjs.map
|