@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 { __awaiter, __decorate, __param } from 'tslib';
|
|
5
6
|
import { take, takeUntil, skip, switchMap, debounceTime, map, pairwise, auditTime as auditTime$1, startWith as startWith$1, finalize } from 'rxjs/operators';
|
|
6
7
|
import { BehaviorSubject, Subject, from, takeUntil as takeUntil$1, startWith, auditTime, filter, merge, EMPTY, fromEvent, Observable, interval, animationFrameScheduler } from 'rxjs';
|
|
7
8
|
import { fromUnixTime, getWeek, getDaysInMonth, differenceInCalendarDays, setDate, addSeconds, addMinutes, addHours, addDays, addWeeks, addMonths, addQuarters, addYears, startOfDay, startOfWeek, startOfMonth, startOfQuarter, startOfYear, endOfDay, endOfWeek, endOfMonth, endOfQuarter, endOfYear, getUnixTime, format, isWeekend, isToday, differenceInDays, differenceInCalendarQuarters, eachMonthOfInterval, eachYearOfInterval, eachWeekOfInterval, eachDayOfInterval, differenceInCalendarYears } from 'date-fns';
|
|
@@ -10,7 +11,7 @@ import { SelectionModel } from '@angular/cdk/collections';
|
|
|
10
11
|
import { coerceBooleanProperty, coerceCssPixelValue } from '@angular/cdk/coercion';
|
|
11
12
|
import * as i3 from '@angular/cdk/scrolling';
|
|
12
13
|
import { CdkVirtualScrollViewport, ScrollingModule } from '@angular/cdk/scrolling';
|
|
13
|
-
import {
|
|
14
|
+
import { InputBoolean } from 'ngx-tethys/core';
|
|
14
15
|
import * as i2 from '@angular/cdk/drag-drop';
|
|
15
16
|
import { CdkDrag, DragDropModule } from '@angular/cdk/drag-drop';
|
|
16
17
|
|
|
@@ -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;
|
|
@@ -1285,11 +1290,13 @@ class NgxGanttTableComponent {
|
|
|
1285
1290
|
constructor() {
|
|
1286
1291
|
this.draggable = false;
|
|
1287
1292
|
this.dragDropped = new EventEmitter();
|
|
1293
|
+
this.dragStarted = new EventEmitter();
|
|
1294
|
+
this.dragEnded = new EventEmitter();
|
|
1288
1295
|
this.columnChanges = new EventEmitter();
|
|
1289
1296
|
}
|
|
1290
1297
|
}
|
|
1291
1298
|
NgxGanttTableComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: NgxGanttTableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
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", 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 });
|
|
1299
|
+
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 });
|
|
1293
1300
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: NgxGanttTableComponent, decorators: [{
|
|
1294
1301
|
type: Component,
|
|
1295
1302
|
args: [{
|
|
@@ -1302,6 +1309,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImpor
|
|
|
1302
1309
|
type: Input
|
|
1303
1310
|
}], dragDropped: [{
|
|
1304
1311
|
type: Output
|
|
1312
|
+
}], dragStarted: [{
|
|
1313
|
+
type: Output
|
|
1314
|
+
}], dragEnded: [{
|
|
1315
|
+
type: Output
|
|
1305
1316
|
}], columnChanges: [{
|
|
1306
1317
|
type: Output
|
|
1307
1318
|
}], rowBeforeTemplate: [{
|
|
@@ -1720,16 +1731,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImpor
|
|
|
1720
1731
|
}] });
|
|
1721
1732
|
|
|
1722
1733
|
class GanttTableBodyComponent {
|
|
1723
|
-
set
|
|
1734
|
+
set viewportItems(data) {
|
|
1724
1735
|
const firstData = data[0];
|
|
1725
1736
|
if (firstData && firstData.hasOwnProperty('items')) {
|
|
1726
1737
|
this.hasGroup = true;
|
|
1727
1738
|
}
|
|
1728
1739
|
this.ganttTableEmptyClass = (data === null || data === void 0 ? void 0 : data.length) ? false : true;
|
|
1729
|
-
this.
|
|
1740
|
+
this._viewportItems = data;
|
|
1730
1741
|
}
|
|
1731
|
-
get
|
|
1732
|
-
return this.
|
|
1742
|
+
get viewportItems() {
|
|
1743
|
+
return this._viewportItems;
|
|
1733
1744
|
}
|
|
1734
1745
|
constructor(gantt, ganttUpper, cdr, document) {
|
|
1735
1746
|
this.gantt = gantt;
|
|
@@ -1738,6 +1749,8 @@ class GanttTableBodyComponent {
|
|
|
1738
1749
|
this.document = document;
|
|
1739
1750
|
this.draggable = false;
|
|
1740
1751
|
this.dragDropped = new EventEmitter();
|
|
1752
|
+
this.dragStarted = new EventEmitter();
|
|
1753
|
+
this.dragEnded = new EventEmitter();
|
|
1741
1754
|
this.itemClick = new EventEmitter();
|
|
1742
1755
|
this.ganttTableClass = true;
|
|
1743
1756
|
this.ganttTableEmptyClass = false;
|
|
@@ -1790,12 +1803,17 @@ class GanttTableBodyComponent {
|
|
|
1790
1803
|
this.gantt.expandChildren(item);
|
|
1791
1804
|
}
|
|
1792
1805
|
onItemDragStarted(event) {
|
|
1806
|
+
var _a, _b;
|
|
1793
1807
|
this.ganttTableDragging = true;
|
|
1794
1808
|
// 拖动开始时隐藏所有的子项
|
|
1795
1809
|
const children = this.getChildrenElementsByElement(event.source.element.nativeElement);
|
|
1796
1810
|
children.forEach((element) => {
|
|
1797
1811
|
element.classList.add('drag-item-hide');
|
|
1798
1812
|
});
|
|
1813
|
+
this.dragStarted.emit({
|
|
1814
|
+
source: (_a = event.source.data) === null || _a === void 0 ? void 0 : _a.origin,
|
|
1815
|
+
sourceParent: (_b = this.getParentByItem(event.source.data)) === null || _b === void 0 ? void 0 : _b.origin
|
|
1816
|
+
});
|
|
1799
1817
|
}
|
|
1800
1818
|
emitItemDragMoved(event) {
|
|
1801
1819
|
this.itemDragMoved.next(event);
|
|
@@ -1840,7 +1858,12 @@ class GanttTableBodyComponent {
|
|
|
1840
1858
|
}
|
|
1841
1859
|
}
|
|
1842
1860
|
onItemDragEnded(event) {
|
|
1861
|
+
var _a, _b;
|
|
1843
1862
|
this.ganttTableDragging = false;
|
|
1863
|
+
this.dragEnded.emit({
|
|
1864
|
+
source: (_a = event.source.data) === null || _a === void 0 ? void 0 : _a.origin,
|
|
1865
|
+
sourceParent: (_b = this.getParentByItem(event.source.data)) === null || _b === void 0 ? void 0 : _b.origin
|
|
1866
|
+
});
|
|
1844
1867
|
}
|
|
1845
1868
|
onListDropped(event) {
|
|
1846
1869
|
if (!this.itemDropTarget) {
|
|
@@ -1881,14 +1904,14 @@ class GanttTableBodyComponent {
|
|
|
1881
1904
|
this.destroy$.complete();
|
|
1882
1905
|
}
|
|
1883
1906
|
removeItem(item, children) {
|
|
1884
|
-
this.
|
|
1885
|
-
this.
|
|
1907
|
+
this.viewportItems.splice(this.viewportItems.indexOf(item), 1 + children.length);
|
|
1908
|
+
this.flatItems.splice(this.flatItems.indexOf(item), 1 + children.length);
|
|
1886
1909
|
}
|
|
1887
1910
|
insertItem(target, inserted, children, position) {
|
|
1888
1911
|
var _a;
|
|
1889
1912
|
if (position === 'before') {
|
|
1890
|
-
this.
|
|
1891
|
-
this.
|
|
1913
|
+
this.viewportItems.splice(this.viewportItems.indexOf(target), 0, inserted, ...children);
|
|
1914
|
+
this.flatItems.splice(this.flatItems.indexOf(target), 0, inserted, ...children);
|
|
1892
1915
|
}
|
|
1893
1916
|
else {
|
|
1894
1917
|
const dragRef = this.cdkDrags.find((drag) => drag.data === target);
|
|
@@ -1897,19 +1920,19 @@ class GanttTableBodyComponent {
|
|
|
1897
1920
|
if (target.expanded) {
|
|
1898
1921
|
childrenCount = ((_a = this.getChildrenElementsByElement(dragRef.element.nativeElement)) === null || _a === void 0 ? void 0 : _a.length) || 0;
|
|
1899
1922
|
}
|
|
1900
|
-
this.
|
|
1901
|
-
this.
|
|
1923
|
+
this.viewportItems.splice(this.viewportItems.indexOf(target) + 1 + childrenCount, 0, inserted, ...children);
|
|
1924
|
+
this.flatItems.splice(this.flatItems.indexOf(target) + 1 + childrenCount, 0, inserted, ...children);
|
|
1902
1925
|
}
|
|
1903
1926
|
}
|
|
1904
1927
|
insertChildrenItem(target, inserted, children) {
|
|
1905
1928
|
if (target.expanded) {
|
|
1906
|
-
this.
|
|
1907
|
-
this.
|
|
1929
|
+
this.viewportItems.splice(this.viewportItems.indexOf(target) + target.children.length + 1, 0, inserted, ...children);
|
|
1930
|
+
this.flatItems.splice(this.flatItems.indexOf(target) + target.children.length + 1, 0, inserted, ...children);
|
|
1908
1931
|
}
|
|
1909
1932
|
target.children.push(inserted);
|
|
1910
1933
|
}
|
|
1911
1934
|
getParentByItem(item) {
|
|
1912
|
-
return (this.
|
|
1935
|
+
return (this.flatItems || []).find((n) => {
|
|
1913
1936
|
var _a;
|
|
1914
1937
|
return (_a = n.children) === null || _a === void 0 ? void 0 : _a.includes(item);
|
|
1915
1938
|
});
|
|
@@ -1968,10 +1991,10 @@ class GanttTableBodyComponent {
|
|
|
1968
1991
|
}
|
|
1969
1992
|
}
|
|
1970
1993
|
GanttTableBodyComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: GanttTableBodyComponent, deps: [{ token: GANTT_ABSTRACT_TOKEN }, { token: GANTT_UPPER_TOKEN }, { token: i0.ChangeDetectorRef }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Component });
|
|
1971
|
-
GanttTableBodyComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.4", type: GanttTableBodyComponent, selector: "gantt-table-body", inputs: {
|
|
1994
|
+
GanttTableBodyComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.4", type: GanttTableBodyComponent, selector: "gantt-table-body", inputs: { viewportItems: "viewportItems", flatItems: "flatItems", columns: "columns", groupTemplate: "groupTemplate", emptyTemplate: "emptyTemplate", rowBeforeTemplate: "rowBeforeTemplate", rowAfterTemplate: "rowAfterTemplate", draggable: "draggable", dropEnterPredicate: "dropEnterPredicate" }, outputs: { dragDropped: "dragDropped", dragStarted: "dragStarted", dragEnded: "dragEnded", itemClick: "itemClick" }, host: { properties: { "class.gantt-table-draggable": "this.draggable", "class.gantt-table-body": "this.ganttTableClass", "class.gantt-table-empty": "this.ganttTableEmptyClass", "class.gantt-table-dragging": "this.ganttTableDragging" } }, viewQueries: [{ propertyName: "cdkDrags", predicate: (CdkDrag), descendants: true }], ngImport: i0, template: "<div\n class=\"gantt-table-body-container\"\n cdkDropList\n [cdkDropListAutoScrollStep]=\"6\"\n [cdkDropListData]=\"viewportItems\"\n [cdkDropListSortingDisabled]=\"true\"\n (cdkDropListDropped)=\"onListDropped($event)\"\n>\n <ng-container *ngIf=\"!viewportItems?.length\">\n <ng-container *ngIf=\"!emptyTemplate\">\n <gantt-icon class=\"empty-icon\" iconName=\"empty\"></gantt-icon>\n <div class=\"empty-text\">\u6CA1\u6709\u6570\u636E</div>\n </ng-container>\n <ng-template [ngTemplateOutlet]=\"emptyTemplate\"></ng-template>\n </ng-container>\n\n <ng-container *ngIf=\"viewportItems && viewportItems.length > 0\">\n <ng-container *ngFor=\"let item of viewportItems; trackBy: trackBy\">\n <div class=\"gantt-table-group\" [ngClass]=\"item.class\" *ngIf=\"item.items\">\n <div class=\"gantt-table-group-title\" [class.expanded]=\"item.expanded\" (click)=\"expandGroup(item)\">\n <gantt-icon class=\"expand-icon\" [iconName]=\"item.expanded ? 'angle-down' : 'angle-right'\"></gantt-icon>\n <ng-container *ngIf=\"groupTemplate; else default\">\n <ng-template\n [ngTemplateOutlet]=\"groupTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: item.origin, group: item.origin }\"\n ></ng-template>\n </ng-container>\n <ng-template #default>\n <span class=\"group-title\">{{ item.title }}</span>\n </ng-template>\n </div>\n </div>\n\n <div\n *ngIf=\"!item.items\"\n (click)=\"itemClick.emit({ event: $event, selectedValue: item.origin })\"\n cdkDrag\n [cdkDragData]=\"item\"\n [cdkDragDisabled]=\"(draggable && item.itemDraggable === false) || !draggable\"\n (cdkDragStarted)=\"onItemDragStarted($event)\"\n (cdkDragEnded)=\"onItemDragEnded($event)\"\n (cdkDragMoved)=\"emitItemDragMoved($event)\"\n class=\"gantt-table-item\"\n [class.gantt-table-item-with-group]=\"hasGroup\"\n [class.gantt-table-item-first-level-group]=\"item.level === 0 && (item.type | isGanttRangeItem)\"\n [style.height.px]=\"gantt.styles.lineHeight\"\n [style.lineHeight.px]=\"gantt.styles.lineHeight\"\n [class.gantt-table-item-active]=\"ganttUpper.isSelected(item.id)\"\n >\n <ng-template\n [ngTemplateOutlet]=\"rowBeforeTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: item.origin, item: item.origin }\"\n ></ng-template>\n\n <div [classList]=\"column.classList\" *ngFor=\"let column of columns; let first = first\" [style.width]=\"column.columnWidth\">\n <!-- drag icon -->\n <gantt-icon\n *ngIf=\"first && draggable\"\n class=\"gantt-drag-handle\"\n iconName=\"drag\"\n cdkDragHandle\n [cdkDragHandleDisabled]=\"(draggable && item.itemDraggable === false) || !draggable\"\n ></gantt-icon>\n <!-- expand icon -->\n <div\n *ngIf=\"column?.showExpandIcon || (!hasExpandIcon && first)\"\n class=\"gantt-expand-icon\"\n [style.marginLeft.px]=\"item.level * 20\"\n >\n <ng-container *ngIf=\"item.level < gantt.maxLevel - 1 && ((gantt.async && item.expandable) || item.children?.length > 0)\">\n <gantt-icon\n *ngIf=\"!item.loading\"\n class=\"expand-icon\"\n [iconName]=\"item.expanded ? 'angle-down' : 'angle-right'\"\n (click)=\"expandChildren($event, item)\"\n >\n </gantt-icon>\n <gantt-icon *ngIf=\"item.loading\" [iconName]=\"'loading'\"></gantt-icon>\n </ng-container>\n </div>\n <!-- column content -->\n <div class=\"gantt-table-column-content\">\n <ng-template\n [ngTemplateOutlet]=\"column.templateRef\"\n [ngTemplateOutletContext]=\"{ $implicit: item.origin, item: item.origin }\"\n ></ng-template>\n </div>\n </div>\n <ng-template\n [ngTemplateOutlet]=\"rowAfterTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: item.origin, item: item.origin }\"\n ></ng-template>\n </div>\n </ng-container>\n </ng-container>\n</div>\n", dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i2.CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "directive", type: i2.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "directive", type: i2.CdkDragHandle, selector: "[cdkDragHandle]", inputs: ["cdkDragHandleDisabled"] }, { kind: "component", type: GanttIconComponent, selector: "gantt-icon", inputs: ["iconName"] }, { kind: "pipe", type: IsGanttRangeItemPipe, name: "isGanttRangeItem" }] });
|
|
1972
1995
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: GanttTableBodyComponent, decorators: [{
|
|
1973
1996
|
type: Component,
|
|
1974
|
-
args: [{ selector: 'gantt-table-body', template: "<div\n class=\"gantt-table-body-container\"\n cdkDropList\n [cdkDropListAutoScrollStep]=\"6\"\n [cdkDropListData]=\"
|
|
1997
|
+
args: [{ selector: 'gantt-table-body', template: "<div\n class=\"gantt-table-body-container\"\n cdkDropList\n [cdkDropListAutoScrollStep]=\"6\"\n [cdkDropListData]=\"viewportItems\"\n [cdkDropListSortingDisabled]=\"true\"\n (cdkDropListDropped)=\"onListDropped($event)\"\n>\n <ng-container *ngIf=\"!viewportItems?.length\">\n <ng-container *ngIf=\"!emptyTemplate\">\n <gantt-icon class=\"empty-icon\" iconName=\"empty\"></gantt-icon>\n <div class=\"empty-text\">\u6CA1\u6709\u6570\u636E</div>\n </ng-container>\n <ng-template [ngTemplateOutlet]=\"emptyTemplate\"></ng-template>\n </ng-container>\n\n <ng-container *ngIf=\"viewportItems && viewportItems.length > 0\">\n <ng-container *ngFor=\"let item of viewportItems; trackBy: trackBy\">\n <div class=\"gantt-table-group\" [ngClass]=\"item.class\" *ngIf=\"item.items\">\n <div class=\"gantt-table-group-title\" [class.expanded]=\"item.expanded\" (click)=\"expandGroup(item)\">\n <gantt-icon class=\"expand-icon\" [iconName]=\"item.expanded ? 'angle-down' : 'angle-right'\"></gantt-icon>\n <ng-container *ngIf=\"groupTemplate; else default\">\n <ng-template\n [ngTemplateOutlet]=\"groupTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: item.origin, group: item.origin }\"\n ></ng-template>\n </ng-container>\n <ng-template #default>\n <span class=\"group-title\">{{ item.title }}</span>\n </ng-template>\n </div>\n </div>\n\n <div\n *ngIf=\"!item.items\"\n (click)=\"itemClick.emit({ event: $event, selectedValue: item.origin })\"\n cdkDrag\n [cdkDragData]=\"item\"\n [cdkDragDisabled]=\"(draggable && item.itemDraggable === false) || !draggable\"\n (cdkDragStarted)=\"onItemDragStarted($event)\"\n (cdkDragEnded)=\"onItemDragEnded($event)\"\n (cdkDragMoved)=\"emitItemDragMoved($event)\"\n class=\"gantt-table-item\"\n [class.gantt-table-item-with-group]=\"hasGroup\"\n [class.gantt-table-item-first-level-group]=\"item.level === 0 && (item.type | isGanttRangeItem)\"\n [style.height.px]=\"gantt.styles.lineHeight\"\n [style.lineHeight.px]=\"gantt.styles.lineHeight\"\n [class.gantt-table-item-active]=\"ganttUpper.isSelected(item.id)\"\n >\n <ng-template\n [ngTemplateOutlet]=\"rowBeforeTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: item.origin, item: item.origin }\"\n ></ng-template>\n\n <div [classList]=\"column.classList\" *ngFor=\"let column of columns; let first = first\" [style.width]=\"column.columnWidth\">\n <!-- drag icon -->\n <gantt-icon\n *ngIf=\"first && draggable\"\n class=\"gantt-drag-handle\"\n iconName=\"drag\"\n cdkDragHandle\n [cdkDragHandleDisabled]=\"(draggable && item.itemDraggable === false) || !draggable\"\n ></gantt-icon>\n <!-- expand icon -->\n <div\n *ngIf=\"column?.showExpandIcon || (!hasExpandIcon && first)\"\n class=\"gantt-expand-icon\"\n [style.marginLeft.px]=\"item.level * 20\"\n >\n <ng-container *ngIf=\"item.level < gantt.maxLevel - 1 && ((gantt.async && item.expandable) || item.children?.length > 0)\">\n <gantt-icon\n *ngIf=\"!item.loading\"\n class=\"expand-icon\"\n [iconName]=\"item.expanded ? 'angle-down' : 'angle-right'\"\n (click)=\"expandChildren($event, item)\"\n >\n </gantt-icon>\n <gantt-icon *ngIf=\"item.loading\" [iconName]=\"'loading'\"></gantt-icon>\n </ng-container>\n </div>\n <!-- column content -->\n <div class=\"gantt-table-column-content\">\n <ng-template\n [ngTemplateOutlet]=\"column.templateRef\"\n [ngTemplateOutletContext]=\"{ $implicit: item.origin, item: item.origin }\"\n ></ng-template>\n </div>\n </div>\n <ng-template\n [ngTemplateOutlet]=\"rowAfterTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: item.origin, item: item.origin }\"\n ></ng-template>\n </div>\n </ng-container>\n </ng-container>\n</div>\n" }]
|
|
1975
1998
|
}], ctorParameters: function () {
|
|
1976
1999
|
return [{ type: undefined, decorators: [{
|
|
1977
2000
|
type: Inject,
|
|
@@ -1983,9 +2006,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImpor
|
|
|
1983
2006
|
type: Inject,
|
|
1984
2007
|
args: [DOCUMENT]
|
|
1985
2008
|
}] }];
|
|
1986
|
-
}, propDecorators: {
|
|
2009
|
+
}, propDecorators: { viewportItems: [{
|
|
1987
2010
|
type: Input
|
|
1988
|
-
}],
|
|
2011
|
+
}], flatItems: [{
|
|
1989
2012
|
type: Input
|
|
1990
2013
|
}], columns: [{
|
|
1991
2014
|
type: Input
|
|
@@ -2006,6 +2029,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImpor
|
|
|
2006
2029
|
type: Input
|
|
2007
2030
|
}], dragDropped: [{
|
|
2008
2031
|
type: Output
|
|
2032
|
+
}], dragStarted: [{
|
|
2033
|
+
type: Output
|
|
2034
|
+
}], dragEnded: [{
|
|
2035
|
+
type: Output
|
|
2009
2036
|
}], itemClick: [{
|
|
2010
2037
|
type: Output
|
|
2011
2038
|
}], ganttTableClass: [{
|
|
@@ -2287,7 +2314,7 @@ class GanttLinksComponent {
|
|
|
2287
2314
|
this.ngZone = ngZone;
|
|
2288
2315
|
// @Input() groups: GanttGroupInternal[] = [];
|
|
2289
2316
|
// @Input() items: GanttItemInternal[] = [];
|
|
2290
|
-
this.
|
|
2317
|
+
this.flatItems = [];
|
|
2291
2318
|
this.lineClick = new EventEmitter();
|
|
2292
2319
|
this.links = [];
|
|
2293
2320
|
this.ganttLinkTypes = GanttLinkType;
|
|
@@ -2364,7 +2391,7 @@ class GanttLinksComponent {
|
|
|
2364
2391
|
// });
|
|
2365
2392
|
// });
|
|
2366
2393
|
// }
|
|
2367
|
-
this.
|
|
2394
|
+
this.flatItems.forEach((item, itemIndex) => {
|
|
2368
2395
|
if (!item.hasOwnProperty('items')) {
|
|
2369
2396
|
const ganttItem = item;
|
|
2370
2397
|
if (ganttItem.refs) {
|
|
@@ -2444,7 +2471,7 @@ class GanttLinksComponent {
|
|
|
2444
2471
|
}
|
|
2445
2472
|
}
|
|
2446
2473
|
GanttLinksComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: GanttLinksComponent, deps: [{ token: GANTT_UPPER_TOKEN }, { token: i0.ChangeDetectorRef }, { token: i0.ElementRef }, { token: GanttDragContainer }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
|
|
2447
|
-
GanttLinksComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.4", type: GanttLinksComponent, selector: "gantt-links-overlay", inputs: {
|
|
2474
|
+
GanttLinksComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.4", type: GanttLinksComponent, selector: "gantt-links-overlay", inputs: { flatItems: "flatItems" }, outputs: { lineClick: "lineClick" }, host: { properties: { "class.gantt-links-overlay": "this.ganttLinksOverlay" } }, usesOnChanges: true, ngImport: i0, template: "<svg [attr.width]=\"ganttUpper.view.width\" class=\"gantt-links-overlay-main\">\n <ng-container *ngFor=\"let link of links; let i = index; trackBy: trackBy\">\n <path\n [attr.d]=\"link.path\"\n fill=\"transparent\"\n stroke-width=\"2\"\n [attr.stroke]=\"link.color\"\n pointer-events=\"none\"\n [attr.style]=\"link.type === ganttLinkTypes.sf ? 'marker-start: url(#triangle' + i + ')' : 'marker-end: url(#triangle' + i + ')'\"\n ></path>\n\n <g>\n <path\n class=\"link-line\"\n (click)=\"onLineClick($event, link)\"\n [attr.d]=\"link.path\"\n (mouseenter)=\"mouseEnterPath(link, i)\"\n (mouseleave)=\"mouseLeavePath(link)\"\n stroke=\"transparent\"\n stroke-width=\"9\"\n fill=\"none\"\n cursor=\"pointer\"\n ></path>\n </g>\n <defs *ngIf=\"showArrow\">\n <marker\n *ngIf=\"link.type === ganttLinkTypes.sf; else markerEnd\"\n [id]=\"'triangle' + i\"\n markerUnits=\"strokeWidth\"\n markerWidth=\"5\"\n markerHeight=\"4\"\n refX=\"5\"\n refY=\"2\"\n orient=\"180\"\n >\n <path [attr.fill]=\"link.color\" [attr.stroke]=\"link.color\" d=\"M 0 0 L 5 2 L 0 4 z\" />\n </marker>\n\n <ng-template #markerEnd>\n <marker [id]=\"'triangle' + i\" markerUnits=\"strokeWidth\" markerWidth=\"5\" markerHeight=\"4\" refX=\"5\" refY=\"2\" orient=\"auto\">\n <path [attr.fill]=\"link.color\" [attr.stroke]=\"link.color\" d=\"M 0 0 L 5 2 L 0 4 z\" />\n </marker>\n </ng-template>\n </defs>\n </ng-container>\n <line class=\"link-dragging-line\"></line>\n</svg>\n", dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
2448
2475
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: GanttLinksComponent, decorators: [{
|
|
2449
2476
|
type: Component,
|
|
2450
2477
|
args: [{ selector: 'gantt-links-overlay', template: "<svg [attr.width]=\"ganttUpper.view.width\" class=\"gantt-links-overlay-main\">\n <ng-container *ngFor=\"let link of links; let i = index; trackBy: trackBy\">\n <path\n [attr.d]=\"link.path\"\n fill=\"transparent\"\n stroke-width=\"2\"\n [attr.stroke]=\"link.color\"\n pointer-events=\"none\"\n [attr.style]=\"link.type === ganttLinkTypes.sf ? 'marker-start: url(#triangle' + i + ')' : 'marker-end: url(#triangle' + i + ')'\"\n ></path>\n\n <g>\n <path\n class=\"link-line\"\n (click)=\"onLineClick($event, link)\"\n [attr.d]=\"link.path\"\n (mouseenter)=\"mouseEnterPath(link, i)\"\n (mouseleave)=\"mouseLeavePath(link)\"\n stroke=\"transparent\"\n stroke-width=\"9\"\n fill=\"none\"\n cursor=\"pointer\"\n ></path>\n </g>\n <defs *ngIf=\"showArrow\">\n <marker\n *ngIf=\"link.type === ganttLinkTypes.sf; else markerEnd\"\n [id]=\"'triangle' + i\"\n markerUnits=\"strokeWidth\"\n markerWidth=\"5\"\n markerHeight=\"4\"\n refX=\"5\"\n refY=\"2\"\n orient=\"180\"\n >\n <path [attr.fill]=\"link.color\" [attr.stroke]=\"link.color\" d=\"M 0 0 L 5 2 L 0 4 z\" />\n </marker>\n\n <ng-template #markerEnd>\n <marker [id]=\"'triangle' + i\" markerUnits=\"strokeWidth\" markerWidth=\"5\" markerHeight=\"4\" refX=\"5\" refY=\"2\" orient=\"auto\">\n <path [attr.fill]=\"link.color\" [attr.stroke]=\"link.color\" d=\"M 0 0 L 5 2 L 0 4 z\" />\n </marker>\n </ng-template>\n </defs>\n </ng-container>\n <line class=\"link-dragging-line\"></line>\n</svg>\n" }]
|
|
@@ -2453,7 +2480,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImpor
|
|
|
2453
2480
|
type: Inject,
|
|
2454
2481
|
args: [GANTT_UPPER_TOKEN]
|
|
2455
2482
|
}] }, { type: i0.ChangeDetectorRef }, { type: i0.ElementRef }, { type: GanttDragContainer }, { type: i0.NgZone }];
|
|
2456
|
-
}, propDecorators: {
|
|
2483
|
+
}, propDecorators: { flatItems: [{
|
|
2457
2484
|
type: Input
|
|
2458
2485
|
}], lineClick: [{
|
|
2459
2486
|
type: Output
|
|
@@ -2526,6 +2553,25 @@ function isPointerNearClientRect(rect, threshold, pointerX, pointerY) {
|
|
|
2526
2553
|
const yThreshold = height * threshold;
|
|
2527
2554
|
return pointerY > top - yThreshold && pointerY < bottom + yThreshold && pointerX > left - xThreshold && pointerX < right + xThreshold;
|
|
2528
2555
|
}
|
|
2556
|
+
/**
|
|
2557
|
+
* Gets the speed rate of auto scrolling
|
|
2558
|
+
* @param clientRect Dimensions of the node.
|
|
2559
|
+
* @param pointerX Position of the user's pointer along the x axis.
|
|
2560
|
+
* @param horizontalScrollDirection The direction in which the mouse is dragged horizontally
|
|
2561
|
+
*/
|
|
2562
|
+
function getAutoScrollSpeedRates(clientRect, pointerX, horizontalScrollDirection) {
|
|
2563
|
+
let autoScrollSpeedRates = 4;
|
|
2564
|
+
const speedLevels = 4;
|
|
2565
|
+
const { left, right, width } = clientRect;
|
|
2566
|
+
const xThreshold = width * SCROLL_PROXIMITY_THRESHOLD;
|
|
2567
|
+
if (horizontalScrollDirection === 1 /* AutoScrollHorizontalDirection.LEFT */) {
|
|
2568
|
+
autoScrollSpeedRates = Math.ceil((xThreshold - (pointerX > left ? pointerX - left : 0)) / (xThreshold / speedLevels));
|
|
2569
|
+
}
|
|
2570
|
+
if (horizontalScrollDirection === 2 /* AutoScrollHorizontalDirection.RIGHT */) {
|
|
2571
|
+
autoScrollSpeedRates = Math.ceil((xThreshold - (right > pointerX ? right - pointerX : 0)) / (xThreshold / speedLevels));
|
|
2572
|
+
}
|
|
2573
|
+
return autoScrollSpeedRates;
|
|
2574
|
+
}
|
|
2529
2575
|
|
|
2530
2576
|
const scrollThreshold = 50;
|
|
2531
2577
|
var ScrollDirection;
|
|
@@ -2642,7 +2688,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImpor
|
|
|
2642
2688
|
*/
|
|
2643
2689
|
const DROP_PROXIMITY_THRESHOLD = 0.05;
|
|
2644
2690
|
const dragMinWidth = 10;
|
|
2645
|
-
const
|
|
2691
|
+
const autoScrollBaseStep = 2;
|
|
2646
2692
|
const activeClass = 'gantt-bar-active';
|
|
2647
2693
|
const dropActiveClass = 'gantt-bar-drop-active';
|
|
2648
2694
|
const singleDropActiveClass = 'gantt-bar-single-drop-active';
|
|
@@ -2658,6 +2704,12 @@ class GanttBarDrag {
|
|
|
2658
2704
|
get linkDragDisabled() {
|
|
2659
2705
|
return !this.item.linkable || !this.ganttUpper.linkable;
|
|
2660
2706
|
}
|
|
2707
|
+
get barHandleDragMoveAndScrollDistance() {
|
|
2708
|
+
return this.barHandleDragMoveDistance + this.dragScrollDistance;
|
|
2709
|
+
}
|
|
2710
|
+
get autoScrollStep() {
|
|
2711
|
+
return Math.pow(autoScrollBaseStep, this.autoScrollSpeedRates);
|
|
2712
|
+
}
|
|
2661
2713
|
constructor(dragDrop, dom, dragContainer, _ngZone) {
|
|
2662
2714
|
this.dragDrop = dragDrop;
|
|
2663
2715
|
this.dom = dom;
|
|
@@ -2677,13 +2729,15 @@ class GanttBarDrag {
|
|
|
2677
2729
|
this.dragScrollDistance = 0;
|
|
2678
2730
|
/** Horizontal direction in which the list is currently scrolling. */
|
|
2679
2731
|
this._horizontalScrollDirection = 0 /* AutoScrollHorizontalDirection.NONE */;
|
|
2732
|
+
/** Speed ratio for auto scroll */
|
|
2733
|
+
this.autoScrollSpeedRates = 1;
|
|
2680
2734
|
this.startScrollInterval = () => {
|
|
2681
2735
|
this.stopScrolling();
|
|
2682
2736
|
interval(0, animationFrameScheduler)
|
|
2683
2737
|
.pipe(takeUntil(this.stopScrollTimers$))
|
|
2684
2738
|
.subscribe(() => {
|
|
2685
2739
|
const node = this.dom.mainContainer;
|
|
2686
|
-
const scrollStep = autoScrollStep;
|
|
2740
|
+
const scrollStep = this.autoScrollStep;
|
|
2687
2741
|
if (this._horizontalScrollDirection === 1 /* AutoScrollHorizontalDirection.LEFT */) {
|
|
2688
2742
|
node.scrollBy(-scrollStep, 0);
|
|
2689
2743
|
}
|
|
@@ -2792,16 +2846,32 @@ class GanttBarDrag {
|
|
|
2792
2846
|
const dragScrollDistance = this.dom.mainContainer.scrollLeft - this.containerScrollLeft;
|
|
2793
2847
|
this.dragScrollDistance = dragScrollDistance;
|
|
2794
2848
|
dragRef['_boundaryRect'] = this.dom.mainItems.getBoundingClientRect();
|
|
2795
|
-
this.
|
|
2849
|
+
if (this.dragScrolling && this.isStartGreaterThanEndWhenBarHandleDragMove(isBefore)) {
|
|
2850
|
+
this.stopScrolling();
|
|
2851
|
+
this.dragScrolling = false;
|
|
2852
|
+
}
|
|
2853
|
+
if (isBefore) {
|
|
2854
|
+
this.barBeforeHandleDragMove();
|
|
2855
|
+
}
|
|
2856
|
+
else {
|
|
2857
|
+
this.barAfterHandleDragMove();
|
|
2858
|
+
}
|
|
2796
2859
|
}
|
|
2797
2860
|
});
|
|
2798
2861
|
this.dragContainer.dragStarted.emit({ item: this.item.origin });
|
|
2799
2862
|
});
|
|
2800
2863
|
dragRef.moved.subscribe((event) => {
|
|
2801
|
-
this.
|
|
2864
|
+
if (this.barHandleDragMoveRecordDays && this.barHandleDragMoveRecordDays > 0) {
|
|
2865
|
+
this.startScrollingIfNecessary(event.pointerPosition.x, event.pointerPosition.y);
|
|
2866
|
+
}
|
|
2802
2867
|
this.barHandleDragMoveDistance = event.distance.x;
|
|
2803
2868
|
if (!this.dragScrolling) {
|
|
2804
|
-
|
|
2869
|
+
if (isBefore) {
|
|
2870
|
+
this.barBeforeHandleDragMove();
|
|
2871
|
+
}
|
|
2872
|
+
else {
|
|
2873
|
+
this.barAfterHandleDragMove();
|
|
2874
|
+
}
|
|
2805
2875
|
}
|
|
2806
2876
|
});
|
|
2807
2877
|
dragRef.ended.subscribe((event) => {
|
|
@@ -2881,10 +2951,10 @@ class GanttBarDrag {
|
|
|
2881
2951
|
let left = dragRect.left - rootRect.left - (this.dom.side.clientWidth + 1);
|
|
2882
2952
|
if (this.dragScrolling) {
|
|
2883
2953
|
if (this._horizontalScrollDirection === 1 /* AutoScrollHorizontalDirection.LEFT */) {
|
|
2884
|
-
left += autoScrollStep;
|
|
2954
|
+
left += this.autoScrollStep;
|
|
2885
2955
|
}
|
|
2886
2956
|
else if (this._horizontalScrollDirection === 2 /* AutoScrollHorizontalDirection.RIGHT */) {
|
|
2887
|
-
left -= autoScrollStep;
|
|
2957
|
+
left -= this.autoScrollStep;
|
|
2888
2958
|
}
|
|
2889
2959
|
}
|
|
2890
2960
|
const width = dragRect.right - dragRect.left;
|
|
@@ -2934,44 +3004,51 @@ class GanttBarDrag {
|
|
|
2934
3004
|
this.item.updateDate(start, end);
|
|
2935
3005
|
this.dragContainer.dragMoved.emit({ item: this.item.origin });
|
|
2936
3006
|
}
|
|
2937
|
-
|
|
2938
|
-
const
|
|
2939
|
-
|
|
2940
|
-
|
|
2941
|
-
|
|
2942
|
-
|
|
2943
|
-
|
|
2944
|
-
|
|
2945
|
-
|
|
3007
|
+
barBeforeHandleDragMove() {
|
|
3008
|
+
const { x, start, oneDayWidth } = this.startOfBarHandle();
|
|
3009
|
+
const width = this.item.refs.width + this.barHandleDragMoveAndScrollDistance * -1;
|
|
3010
|
+
const days = differenceInDays(this.item.end.value, start.value);
|
|
3011
|
+
if (width > dragMinWidth && days > 0) {
|
|
3012
|
+
this.barElement.style.width = width + 'px';
|
|
3013
|
+
this.barElement.style.left = x + 'px';
|
|
3014
|
+
this.openDragBackdrop(this.barElement, start, this.item.end);
|
|
3015
|
+
if (!this.isStartOrEndInsideView(start, this.item.end)) {
|
|
3016
|
+
return;
|
|
3017
|
+
}
|
|
3018
|
+
this.item.updateDate(start, this.item.end);
|
|
3019
|
+
}
|
|
3020
|
+
else {
|
|
3021
|
+
if (this.barHandleDragMoveRecordDays > 0 && days <= 0) {
|
|
3022
|
+
this.barElement.style.width = oneDayWidth + 'px';
|
|
3023
|
+
const x = this.ganttUpper.view.getXPointByDate(this.item.end);
|
|
2946
3024
|
this.barElement.style.left = x + 'px';
|
|
2947
|
-
this.openDragBackdrop(this.barElement, start, this.item.end);
|
|
2948
|
-
if (!this.isStartOrEndInsideView(start, this.item.end)) {
|
|
2949
|
-
return;
|
|
2950
|
-
}
|
|
2951
|
-
this.item.updateDate(start, this.item.end);
|
|
2952
3025
|
}
|
|
2953
|
-
|
|
2954
|
-
|
|
2955
|
-
|
|
3026
|
+
this.openDragBackdrop(this.barElement, this.item.end.startOfDay(), this.item.end);
|
|
3027
|
+
this.item.updateDate(this.item.end.startOfDay(), this.item.end);
|
|
3028
|
+
}
|
|
3029
|
+
this.barHandleDragMoveRecordDays = days;
|
|
3030
|
+
this.dragContainer.dragMoved.emit({ item: this.item.origin });
|
|
3031
|
+
}
|
|
3032
|
+
barAfterHandleDragMove() {
|
|
3033
|
+
const { width, end } = this.endOfBarHandle();
|
|
3034
|
+
const days = differenceInDays(end.value, this.item.start.value);
|
|
3035
|
+
if (width > dragMinWidth && days > 0) {
|
|
3036
|
+
this.barElement.style.width = width + 'px';
|
|
3037
|
+
this.openDragBackdrop(this.barElement, this.item.start, end);
|
|
3038
|
+
if (!this.isStartOrEndInsideView(this.item.start, end)) {
|
|
3039
|
+
return;
|
|
2956
3040
|
}
|
|
3041
|
+
this.item.updateDate(this.item.start, end);
|
|
2957
3042
|
}
|
|
2958
3043
|
else {
|
|
2959
|
-
|
|
2960
|
-
|
|
2961
|
-
|
|
2962
|
-
if (width > dragMinWidth && days > 0) {
|
|
2963
|
-
this.barElement.style.width = width + 'px';
|
|
2964
|
-
this.openDragBackdrop(this.barElement, this.item.start, end);
|
|
2965
|
-
if (!this.isStartOrEndInsideView(this.item.start, end)) {
|
|
2966
|
-
return;
|
|
2967
|
-
}
|
|
2968
|
-
this.item.updateDate(this.item.start, end);
|
|
2969
|
-
}
|
|
2970
|
-
else {
|
|
2971
|
-
this.openDragBackdrop(this.barElement, this.item.start, this.item.start.endOfDay());
|
|
2972
|
-
this.item.updateDate(this.item.start, this.item.start.endOfDay());
|
|
3044
|
+
if (this.barHandleDragMoveRecordDays > 0 && days <= 0) {
|
|
3045
|
+
const oneDayWidth = this.ganttUpper.view.getDateRangeWidth(this.item.start, this.item.start.endOfDay());
|
|
3046
|
+
this.barElement.style.width = oneDayWidth + 'px';
|
|
2973
3047
|
}
|
|
3048
|
+
this.openDragBackdrop(this.barElement, this.item.start, this.item.start.endOfDay());
|
|
3049
|
+
this.item.updateDate(this.item.start, this.item.start.endOfDay());
|
|
2974
3050
|
}
|
|
3051
|
+
this.barHandleDragMoveRecordDays = days;
|
|
2975
3052
|
this.dragContainer.dragMoved.emit({ item: this.item.origin });
|
|
2976
3053
|
}
|
|
2977
3054
|
calcLinkLinePositions(target, isBefore) {
|
|
@@ -3010,6 +3087,7 @@ class GanttBarDrag {
|
|
|
3010
3087
|
(horizontalScrollDirection === 2 /* AutoScrollHorizontalDirection.RIGHT */ &&
|
|
3011
3088
|
scrollLeft < this.ganttUpper.view.width - clientRect.width)) {
|
|
3012
3089
|
this._horizontalScrollDirection = horizontalScrollDirection;
|
|
3090
|
+
this.autoScrollSpeedRates = getAutoScrollSpeedRates(clientRect, pointerX, horizontalScrollDirection);
|
|
3013
3091
|
this.dragScrolling = true;
|
|
3014
3092
|
this._ngZone.runOutsideAngular(this.startScrollInterval);
|
|
3015
3093
|
}
|
|
@@ -3019,6 +3097,44 @@ class GanttBarDrag {
|
|
|
3019
3097
|
}
|
|
3020
3098
|
}
|
|
3021
3099
|
}
|
|
3100
|
+
// Conditions to stop auto-scroll: when the start is greater than the end and the bar appears in the view
|
|
3101
|
+
isStartGreaterThanEndWhenBarHandleDragMove(isBefore) {
|
|
3102
|
+
let isStartGreaterThanEnd;
|
|
3103
|
+
let isBarAppearsInView;
|
|
3104
|
+
const scrollLeft = this.dom.mainContainer.scrollLeft;
|
|
3105
|
+
const clientWidth = this.dom.mainContainer.clientWidth;
|
|
3106
|
+
const xThreshold = clientWidth * DROP_PROXIMITY_THRESHOLD;
|
|
3107
|
+
if (isBefore) {
|
|
3108
|
+
const { start, oneDayWidth } = this.startOfBarHandle();
|
|
3109
|
+
const xPointerByEndDate = this.ganttUpper.view.getXPointByDate(this.item.end);
|
|
3110
|
+
isStartGreaterThanEnd = start.value > this.item.end.value;
|
|
3111
|
+
isBarAppearsInView = xPointerByEndDate + oneDayWidth + xThreshold <= scrollLeft + clientWidth;
|
|
3112
|
+
}
|
|
3113
|
+
else {
|
|
3114
|
+
const { end } = this.endOfBarHandle();
|
|
3115
|
+
const xPointerByStartDate = this.ganttUpper.view.getXPointByDate(this.item.start);
|
|
3116
|
+
isStartGreaterThanEnd = end.value < this.item.start.value;
|
|
3117
|
+
isBarAppearsInView = scrollLeft + xThreshold <= xPointerByStartDate;
|
|
3118
|
+
}
|
|
3119
|
+
return isStartGreaterThanEnd && isBarAppearsInView ? true : false;
|
|
3120
|
+
}
|
|
3121
|
+
// Some data information about dragging start until it is equal to or greater than end
|
|
3122
|
+
startOfBarHandle() {
|
|
3123
|
+
const x = this.item.refs.x + this.barHandleDragMoveAndScrollDistance;
|
|
3124
|
+
return {
|
|
3125
|
+
x,
|
|
3126
|
+
start: this.ganttUpper.view.getDateByXPoint(x),
|
|
3127
|
+
oneDayWidth: this.ganttUpper.view.getDateRangeWidth(this.item.end.startOfDay(), this.item.end)
|
|
3128
|
+
};
|
|
3129
|
+
}
|
|
3130
|
+
// Some data information about dragging end of bar handle
|
|
3131
|
+
endOfBarHandle() {
|
|
3132
|
+
const width = this.item.refs.width + this.barHandleDragMoveAndScrollDistance;
|
|
3133
|
+
return {
|
|
3134
|
+
width,
|
|
3135
|
+
end: this.ganttUpper.view.getDateByXPoint(this.item.refs.x + width)
|
|
3136
|
+
};
|
|
3137
|
+
}
|
|
3022
3138
|
stopScrolling() {
|
|
3023
3139
|
this.stopScrollTimers$.next();
|
|
3024
3140
|
}
|
|
@@ -3154,11 +3270,14 @@ class NgxGanttBarComponent extends GanttItemUpper {
|
|
|
3154
3270
|
});
|
|
3155
3271
|
}
|
|
3156
3272
|
ngOnChanges(changes) {
|
|
3157
|
-
var _a, _b;
|
|
3273
|
+
var _a, _b, _c, _d, _e, _f;
|
|
3158
3274
|
super.ngOnChanges(changes);
|
|
3159
3275
|
if (!this.firstChange) {
|
|
3160
3276
|
this.drag.updateItem(this.item);
|
|
3161
|
-
if (((_a = changes.item.currentValue.refs) === null || _a === void 0 ? void 0 : _a.width) !== ((_b = changes.item.previousValue.refs) === null || _b === void 0 ? void 0 : _b.width)
|
|
3277
|
+
if (((_a = changes.item.currentValue.refs) === null || _a === void 0 ? void 0 : _a.width) !== ((_b = changes.item.previousValue.refs) === null || _b === void 0 ? void 0 : _b.width) ||
|
|
3278
|
+
changes.item.currentValue.color !== changes.item.previousValue.color ||
|
|
3279
|
+
((_c = changes.item.currentValue.start) === null || _c === void 0 ? void 0 : _c.value) !== ((_d = changes.item.previousValue.start) === null || _d === void 0 ? void 0 : _d.value) ||
|
|
3280
|
+
((_e = changes.item.currentValue.end) === null || _e === void 0 ? void 0 : _e.value) !== ((_f = changes.item.previousValue.end) === null || _f === void 0 ? void 0 : _f.value)) {
|
|
3162
3281
|
this.setContentBackground();
|
|
3163
3282
|
}
|
|
3164
3283
|
}
|
|
@@ -3314,18 +3433,18 @@ class GanttMainComponent {
|
|
|
3314
3433
|
}
|
|
3315
3434
|
}
|
|
3316
3435
|
GanttMainComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: GanttMainComponent, deps: [{ token: GANTT_UPPER_TOKEN }], target: i0.ɵɵFactoryTarget.Component });
|
|
3317
|
-
GanttMainComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.4", type: GanttMainComponent, selector: "gantt-main", inputs: {
|
|
3436
|
+
GanttMainComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.4", type: GanttMainComponent, selector: "gantt-main", inputs: { viewportItems: "viewportItems", flatItems: "flatItems", groupHeaderTemplate: "groupHeaderTemplate", itemTemplate: "itemTemplate", barTemplate: "barTemplate", rangeTemplate: "rangeTemplate" }, outputs: { barClick: "barClick", lineClick: "lineClick" }, host: { properties: { "class.gantt-main-container": "this.ganttMainClass" } }, ngImport: i0, template: "<gantt-links-overlay [flatItems]=\"flatItems\" (lineClick)=\"lineClick.emit($event)\"></gantt-links-overlay>\n<div class=\"gantt-main-groups\" [style.width.px]=\"ganttUpper.view.width\">\n <ng-container *ngFor=\"let data of viewportItems; trackBy: trackBy\">\n <div class=\"gantt-group\" [ngClass]=\"data.class\" *ngIf=\"data.items\">\n <ng-template [ngTemplateOutlet]=\"groupHeaderTemplate\" [ngTemplateOutletContext]=\"{ group: data }\"></ng-template>\n </div>\n <div\n *ngIf=\"!data.items\"\n class=\"gantt-item\"\n [style.height.px]=\"ganttUpper.styles.lineHeight\"\n [class.gantt-main-item-active]=\"ganttUpper.isSelected(data.id)\"\n >\n <ng-container *ngIf=\"data.type | isGanttCustomItem\">\n <ng-template\n [ngTemplateOutlet]=\"itemTemplate\"\n [ngTemplateOutletContext]=\"{\n item: data.origin,\n refs: data.refs,\n baseline: ganttUpper.baselineItemsMap[data.id]?.origin,\n baselineRefs: ganttUpper.baselineItemsMap[data.id]?.refs\n }\"\n >\n </ng-template>\n </ng-container>\n\n <ng-container *ngIf=\"(data.type | isGanttRangeItem) || (data.type | isGanttBarItem)\">\n <gantt-range *ngIf=\"data.type | isGanttRangeItem\" [template]=\"rangeTemplate\" [item]=\"data\"></gantt-range>\n <gantt-bar *ngIf=\"data.type | isGanttBarItem\" [item]=\"data\" [template]=\"barTemplate\" (barClick)=\"barClick.emit($event)\"></gantt-bar>\n <gantt-baseline *ngIf=\"ganttUpper.baselineItemsMap[data.id]\" [baselineItem]=\"ganttUpper.baselineItemsMap[data.id]\"></gantt-baseline>\n </ng-container>\n </div>\n </ng-container>\n</div>\n", dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: GanttLinksComponent, selector: "gantt-links-overlay", inputs: ["flatItems"], outputs: ["lineClick"] }, { kind: "component", type: NgxGanttBarComponent, selector: "ngx-gantt-bar,gantt-bar", outputs: ["barClick"] }, { kind: "component", type: NgxGanttRangeComponent, selector: "ngx-gantt-range,gantt-range" }, { kind: "component", type: NgxGanttBaselineComponent, selector: "ngx-gantt-baseline,gantt-baseline", inputs: ["baselineItem"] }, { kind: "pipe", type: IsGanttRangeItemPipe, name: "isGanttRangeItem" }, { kind: "pipe", type: IsGanttBarItemPipe, name: "isGanttBarItem" }, { kind: "pipe", type: IsGanttCustomItemPipe, name: "isGanttCustomItem" }] });
|
|
3318
3437
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: GanttMainComponent, decorators: [{
|
|
3319
3438
|
type: Component,
|
|
3320
|
-
args: [{ selector: 'gantt-main', template: "
|
|
3439
|
+
args: [{ selector: 'gantt-main', template: "<gantt-links-overlay [flatItems]=\"flatItems\" (lineClick)=\"lineClick.emit($event)\"></gantt-links-overlay>\n<div class=\"gantt-main-groups\" [style.width.px]=\"ganttUpper.view.width\">\n <ng-container *ngFor=\"let data of viewportItems; trackBy: trackBy\">\n <div class=\"gantt-group\" [ngClass]=\"data.class\" *ngIf=\"data.items\">\n <ng-template [ngTemplateOutlet]=\"groupHeaderTemplate\" [ngTemplateOutletContext]=\"{ group: data }\"></ng-template>\n </div>\n <div\n *ngIf=\"!data.items\"\n class=\"gantt-item\"\n [style.height.px]=\"ganttUpper.styles.lineHeight\"\n [class.gantt-main-item-active]=\"ganttUpper.isSelected(data.id)\"\n >\n <ng-container *ngIf=\"data.type | isGanttCustomItem\">\n <ng-template\n [ngTemplateOutlet]=\"itemTemplate\"\n [ngTemplateOutletContext]=\"{\n item: data.origin,\n refs: data.refs,\n baseline: ganttUpper.baselineItemsMap[data.id]?.origin,\n baselineRefs: ganttUpper.baselineItemsMap[data.id]?.refs\n }\"\n >\n </ng-template>\n </ng-container>\n\n <ng-container *ngIf=\"(data.type | isGanttRangeItem) || (data.type | isGanttBarItem)\">\n <gantt-range *ngIf=\"data.type | isGanttRangeItem\" [template]=\"rangeTemplate\" [item]=\"data\"></gantt-range>\n <gantt-bar *ngIf=\"data.type | isGanttBarItem\" [item]=\"data\" [template]=\"barTemplate\" (barClick)=\"barClick.emit($event)\"></gantt-bar>\n <gantt-baseline *ngIf=\"ganttUpper.baselineItemsMap[data.id]\" [baselineItem]=\"ganttUpper.baselineItemsMap[data.id]\"></gantt-baseline>\n </ng-container>\n </div>\n </ng-container>\n</div>\n" }]
|
|
3321
3440
|
}], ctorParameters: function () {
|
|
3322
3441
|
return [{ type: GanttUpper, decorators: [{
|
|
3323
3442
|
type: Inject,
|
|
3324
3443
|
args: [GANTT_UPPER_TOKEN]
|
|
3325
3444
|
}] }];
|
|
3326
|
-
}, propDecorators: {
|
|
3445
|
+
}, propDecorators: { viewportItems: [{
|
|
3327
3446
|
type: Input
|
|
3328
|
-
}],
|
|
3447
|
+
}], flatItems: [{
|
|
3329
3448
|
type: Input
|
|
3330
3449
|
}], groupHeaderTemplate: [{
|
|
3331
3450
|
type: Input
|
|
@@ -3681,19 +3800,20 @@ class NgxGanttComponent extends GanttUpper {
|
|
|
3681
3800
|
super(elementRef, cdr, ngZone, config);
|
|
3682
3801
|
this.printService = printService;
|
|
3683
3802
|
this.maxLevel = 2;
|
|
3803
|
+
this.virtualScrollEnabled = true;
|
|
3684
3804
|
this.loadingDelay = 0;
|
|
3685
3805
|
this.linkDragStarted = new EventEmitter();
|
|
3686
3806
|
this.linkDragEnded = new EventEmitter();
|
|
3687
3807
|
this.lineClick = new EventEmitter();
|
|
3688
3808
|
this.selectedChange = new EventEmitter();
|
|
3689
|
-
this.
|
|
3690
|
-
this.
|
|
3809
|
+
this.flatItems = [];
|
|
3810
|
+
this.viewportItems = [];
|
|
3691
3811
|
this._loading = false;
|
|
3692
3812
|
this.computeAllRefs = false;
|
|
3693
3813
|
}
|
|
3694
3814
|
ngOnInit() {
|
|
3695
3815
|
super.ngOnInit();
|
|
3696
|
-
this.
|
|
3816
|
+
this.buildFlatItems();
|
|
3697
3817
|
// Note: the zone may be nooped through `BootstrapOptions` when bootstrapping the root module. This means
|
|
3698
3818
|
// the `onStable` will never emit any value.
|
|
3699
3819
|
const onStable$ = this.ngZone.isStable ? from(Promise.resolve()) : this.ngZone.onStable.pipe(take(1));
|
|
@@ -3715,32 +3835,38 @@ class NgxGanttComponent extends GanttUpper {
|
|
|
3715
3835
|
this.view.start$.pipe(skip(1), takeUntil(this.unsubscribe$)).subscribe(() => {
|
|
3716
3836
|
this.computeTempDataRefs();
|
|
3717
3837
|
});
|
|
3838
|
+
if (!this.virtualScrollEnabled) {
|
|
3839
|
+
this.viewportItems = this.flatItems.slice(this.rangeStart, this.rangeEnd);
|
|
3840
|
+
this.computeTempDataRefs();
|
|
3841
|
+
}
|
|
3718
3842
|
}
|
|
3719
3843
|
ngOnChanges(changes) {
|
|
3720
3844
|
super.ngOnChanges(changes);
|
|
3721
3845
|
if (!this.firstChange) {
|
|
3722
3846
|
if (changes.viewType && changes.viewType.currentValue) {
|
|
3723
|
-
this.
|
|
3847
|
+
this.viewportItems = this.flatItems.slice(this.rangeStart, this.rangeEnd);
|
|
3724
3848
|
this.computeTempDataRefs();
|
|
3725
3849
|
}
|
|
3726
3850
|
if (changes.originItems || changes.originGroups) {
|
|
3727
|
-
this.
|
|
3728
|
-
this.
|
|
3851
|
+
this.buildFlatItems();
|
|
3852
|
+
this.viewportItems = this.flatItems.slice(this.rangeStart, this.rangeEnd);
|
|
3729
3853
|
this.computeTempDataRefs();
|
|
3730
3854
|
}
|
|
3731
3855
|
}
|
|
3732
3856
|
}
|
|
3733
3857
|
ngAfterViewInit() {
|
|
3734
|
-
|
|
3735
|
-
|
|
3736
|
-
|
|
3737
|
-
|
|
3738
|
-
|
|
3739
|
-
|
|
3740
|
-
|
|
3741
|
-
|
|
3858
|
+
if (this.virtualScrollEnabled) {
|
|
3859
|
+
this.virtualScroll.renderedRangeStream.pipe(takeUntil(this.unsubscribe$)).subscribe((range) => {
|
|
3860
|
+
const linksElement = this.elementRef.nativeElement.querySelector('.gantt-links-overlay');
|
|
3861
|
+
linksElement.style.top = `${-(this.styles.lineHeight * range.start)}px`;
|
|
3862
|
+
this.rangeStart = range.start;
|
|
3863
|
+
this.rangeEnd = range.end;
|
|
3864
|
+
this.viewportItems = this.flatItems.slice(range.start, range.end);
|
|
3865
|
+
this.computeTempDataRefs();
|
|
3866
|
+
});
|
|
3867
|
+
}
|
|
3742
3868
|
}
|
|
3743
|
-
|
|
3869
|
+
buildFlatItems() {
|
|
3744
3870
|
const virtualData = [];
|
|
3745
3871
|
if (this.groups.length) {
|
|
3746
3872
|
this.groups.forEach((group) => {
|
|
@@ -3754,22 +3880,26 @@ class NgxGanttComponent extends GanttUpper {
|
|
|
3754
3880
|
if (this.items.length) {
|
|
3755
3881
|
virtualData.push(...recursiveItems(this.items));
|
|
3756
3882
|
}
|
|
3757
|
-
this.
|
|
3758
|
-
this.
|
|
3883
|
+
this.flatItems = [...virtualData];
|
|
3884
|
+
this.flatItemsMap = keyBy(this.flatItems, 'id');
|
|
3885
|
+
if (!this.virtualScrollEnabled) {
|
|
3886
|
+
this.rangeStart = 0;
|
|
3887
|
+
this.rangeEnd = this.flatItems.length - 1;
|
|
3888
|
+
}
|
|
3759
3889
|
}
|
|
3760
3890
|
afterExpand() {
|
|
3761
|
-
this.
|
|
3762
|
-
this.
|
|
3891
|
+
this.buildFlatItems();
|
|
3892
|
+
this.viewportItems = this.flatItems.slice(this.rangeStart, this.rangeEnd);
|
|
3763
3893
|
}
|
|
3764
3894
|
computeTempDataRefs() {
|
|
3765
3895
|
const tempItemData = [];
|
|
3766
|
-
this.
|
|
3896
|
+
this.viewportItems.forEach((data) => {
|
|
3767
3897
|
if (!data.hasOwnProperty('items')) {
|
|
3768
3898
|
const item = data;
|
|
3769
3899
|
if (item.links) {
|
|
3770
3900
|
item.links.forEach((link) => {
|
|
3771
|
-
if (this.
|
|
3772
|
-
tempItemData.push(this.
|
|
3901
|
+
if (this.flatItemsMap[link.link]) {
|
|
3902
|
+
tempItemData.push(this.flatItemsMap[link.link]);
|
|
3773
3903
|
}
|
|
3774
3904
|
});
|
|
3775
3905
|
}
|
|
@@ -3777,8 +3907,8 @@ class NgxGanttComponent extends GanttUpper {
|
|
|
3777
3907
|
}
|
|
3778
3908
|
});
|
|
3779
3909
|
this.computeItemsRefs(...uniqBy(tempItemData, 'id'));
|
|
3780
|
-
this.
|
|
3781
|
-
this.
|
|
3910
|
+
this.flatItems = [...this.flatItems];
|
|
3911
|
+
this.viewportItems = [...this.viewportItems];
|
|
3782
3912
|
}
|
|
3783
3913
|
expandChildren(item) {
|
|
3784
3914
|
if (!item.expanded) {
|
|
@@ -3848,7 +3978,7 @@ class NgxGanttComponent extends GanttUpper {
|
|
|
3848
3978
|
}
|
|
3849
3979
|
}
|
|
3850
3980
|
NgxGanttComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: NgxGanttComponent, deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }, { token: i0.NgZone }, { token: GanttPrintService, optional: true }, { token: GANTT_GLOBAL_CONFIG }], target: i0.ɵɵFactoryTarget.Component });
|
|
3851
|
-
NgxGanttComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.4", type: NgxGanttComponent, selector: "ngx-gantt", inputs: { maxLevel: "maxLevel", async: "async", childrenResolve: "childrenResolve", linkable: "linkable", loading: "loading", loadingDelay: "loadingDelay" }, outputs: { linkDragStarted: "linkDragStarted", linkDragEnded: "linkDragEnded", lineClick: "lineClick", selectedChange: "selectedChange" }, providers: [
|
|
3981
|
+
NgxGanttComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.4", type: NgxGanttComponent, selector: "ngx-gantt", inputs: { maxLevel: "maxLevel", async: "async", childrenResolve: "childrenResolve", linkable: "linkable", loading: "loading", virtualScrollEnabled: "virtualScrollEnabled", loadingDelay: "loadingDelay" }, outputs: { linkDragStarted: "linkDragStarted", linkDragEnded: "linkDragEnded", lineClick: "lineClick", selectedChange: "selectedChange" }, providers: [
|
|
3852
3982
|
{
|
|
3853
3983
|
provide: GANTT_UPPER_TOKEN,
|
|
3854
3984
|
useExisting: NgxGanttComponent
|
|
@@ -3857,7 +3987,10 @@ NgxGanttComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", vers
|
|
|
3857
3987
|
provide: GANTT_ABSTRACT_TOKEN,
|
|
3858
3988
|
useExisting: forwardRef(() => NgxGanttComponent)
|
|
3859
3989
|
}
|
|
3860
|
-
], queries: [{ propertyName: "table", first: true, predicate: NgxGanttTableComponent, descendants: true }, { propertyName: "tableEmptyTemplate", first: true, predicate: ["tableEmpty"], descendants: true, static: true }, { propertyName: "columns", predicate: NgxGanttTableColumnComponent, descendants: true }], viewQueries: [{ propertyName: "ganttRoot", first: true, predicate: ["ganttRoot"], descendants: true }, { propertyName: "virtualScroll", first: true, predicate: CdkVirtualScrollViewport, descendants: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<ngx-gantt-root #ganttRoot>\n <div class=\"gantt-header\">\n <gantt-table-header #tableHeader [columns]=\"columns\"></gantt-table-header>\n <div class=\"gantt-container-header\">\n <gantt-calendar-header></gantt-calendar-header>\n </div>\n </div>\n <gantt-loader *ngIf=\"loading\"></gantt-loader>\n\n <cdk-virtual-scroll-viewport\n class=\"gantt-virtual-scroll-viewport\"\n [itemSize]=\"styles.lineHeight\"\n [minBufferPx]=\"styles.lineHeight * 10\"\n [maxBufferPx]=\"styles.lineHeight * 20\"\n >\n <ng-container *cdkVirtualFor=\"let item of
|
|
3990
|
+
], queries: [{ propertyName: "table", first: true, predicate: NgxGanttTableComponent, descendants: true }, { propertyName: "tableEmptyTemplate", first: true, predicate: ["tableEmpty"], descendants: true, static: true }, { propertyName: "columns", predicate: NgxGanttTableColumnComponent, descendants: true }], viewQueries: [{ propertyName: "ganttRoot", first: true, predicate: ["ganttRoot"], descendants: true }, { propertyName: "virtualScroll", first: true, predicate: CdkVirtualScrollViewport, descendants: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<ngx-gantt-root #ganttRoot>\n <div class=\"gantt-header\">\n <gantt-table-header #tableHeader [columns]=\"columns\"></gantt-table-header>\n <div class=\"gantt-container-header\">\n <gantt-calendar-header></gantt-calendar-header>\n </div>\n </div>\n <gantt-loader *ngIf=\"loading\"></gantt-loader>\n\n <cdk-virtual-scroll-viewport\n class=\"gantt-virtual-scroll-viewport\"\n [ngClass]=\"{ 'gantt-normal-viewport': !virtualScrollEnabled }\"\n [itemSize]=\"styles.lineHeight\"\n [minBufferPx]=\"styles.lineHeight * 10\"\n [maxBufferPx]=\"styles.lineHeight * 20\"\n >\n <ng-container *cdkVirtualFor=\"let item of flatItems; trackBy: trackBy\"></ng-container>\n <div class=\"gantt-side\" [style.width.px]=\"tableHeader.tableWidth + 1\">\n <div class=\"gantt-side-container\">\n <div class=\"gantt-table\">\n <gantt-table-body\n [flatItems]=\"flatItems\"\n [viewportItems]=\"viewportItems\"\n [columns]=\"columns\"\n [groupTemplate]=\"groupTemplate\"\n [emptyTemplate]=\"tableEmptyTemplate\"\n [rowBeforeTemplate]=\"table?.rowBeforeTemplate\"\n [rowAfterTemplate]=\"table?.rowAfterTemplate\"\n [draggable]=\"table.draggable\"\n [dropEnterPredicate]=\"table.dropEnterPredicate\"\n (dragDropped)=\"table.dragDropped.emit($event)\"\n (dragStarted)=\"table.dragStarted.emit($event)\"\n (dragEnded)=\"table.dragEnded.emit($event)\"\n (itemClick)=\"selectItem($event)\"\n >\n </gantt-table-body>\n </div>\n </div>\n </div>\n <div class=\"gantt-container\">\n <gantt-calendar-grid></gantt-calendar-grid>\n <div class=\"gantt-main\">\n <gantt-main\n [flatItems]=\"flatItems\"\n [viewportItems]=\"viewportItems\"\n [groupHeaderTemplate]=\"groupHeaderTemplate\"\n [itemTemplate]=\"itemTemplate\"\n [barTemplate]=\"barTemplate\"\n [rangeTemplate]=\"rangeTemplate\"\n (barClick)=\"barClick.emit($event)\"\n (lineClick)=\"lineClick.emit($event)\"\n >\n </gantt-main>\n </div>\n </div>\n </cdk-virtual-scroll-viewport>\n\n <gantt-drag-backdrop [style.left.px]=\"tableHeader.tableWidth + 1\"></gantt-drag-backdrop>\n</ngx-gantt-root>\n", dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.CdkFixedSizeVirtualScroll, selector: "cdk-virtual-scroll-viewport[itemSize]", inputs: ["itemSize", "minBufferPx", "maxBufferPx"] }, { kind: "directive", type: i3.CdkVirtualForOf, selector: "[cdkVirtualFor][cdkVirtualForOf]", inputs: ["cdkVirtualForOf", "cdkVirtualForTrackBy", "cdkVirtualForTemplate", "cdkVirtualForTemplateCacheSize"] }, { kind: "component", type: i3.CdkVirtualScrollViewport, selector: "cdk-virtual-scroll-viewport", inputs: ["orientation", "appendOnly"], outputs: ["scrolledIndexChange"] }, { kind: "component", type: GanttTableHeaderComponent, selector: "gantt-table-header", inputs: ["columns"] }, { kind: "component", type: GanttTableBodyComponent, selector: "gantt-table-body", inputs: ["viewportItems", "flatItems", "columns", "groupTemplate", "emptyTemplate", "rowBeforeTemplate", "rowAfterTemplate", "draggable", "dropEnterPredicate"], outputs: ["dragDropped", "dragStarted", "dragEnded", "itemClick"] }, { kind: "component", type: GanttMainComponent, selector: "gantt-main", inputs: ["viewportItems", "flatItems", "groupHeaderTemplate", "itemTemplate", "barTemplate", "rangeTemplate"], outputs: ["barClick", "lineClick"] }, { kind: "component", type: GanttCalendarHeaderComponent, selector: "gantt-calendar-header" }, { kind: "component", type: GanttCalendarGridComponent, selector: "gantt-calendar-grid" }, { kind: "component", type: GanttLoaderComponent, selector: "gantt-loader" }, { kind: "component", type: GanttDragBackdropComponent, selector: "gantt-drag-backdrop" }, { kind: "component", type: NgxGanttRootComponent, selector: "ngx-gantt-root", inputs: ["sideWidth"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
3991
|
+
__decorate([
|
|
3992
|
+
InputBoolean()
|
|
3993
|
+
], NgxGanttComponent.prototype, "virtualScrollEnabled", void 0);
|
|
3861
3994
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: NgxGanttComponent, decorators: [{
|
|
3862
3995
|
type: Component,
|
|
3863
3996
|
args: [{ selector: 'ngx-gantt', changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
@@ -3869,7 +4002,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImpor
|
|
|
3869
4002
|
provide: GANTT_ABSTRACT_TOKEN,
|
|
3870
4003
|
useExisting: forwardRef(() => NgxGanttComponent)
|
|
3871
4004
|
}
|
|
3872
|
-
], template: "<ngx-gantt-root #ganttRoot>\n <div class=\"gantt-header\">\n <gantt-table-header #tableHeader [columns]=\"columns\"></gantt-table-header>\n <div class=\"gantt-container-header\">\n <gantt-calendar-header></gantt-calendar-header>\n </div>\n </div>\n <gantt-loader *ngIf=\"loading\"></gantt-loader>\n\n <cdk-virtual-scroll-viewport\n class=\"gantt-virtual-scroll-viewport\"\n [itemSize]=\"styles.lineHeight\"\n [minBufferPx]=\"styles.lineHeight * 10\"\n [maxBufferPx]=\"styles.lineHeight * 20\"\n >\n <ng-container *cdkVirtualFor=\"let item of
|
|
4005
|
+
], template: "<ngx-gantt-root #ganttRoot>\n <div class=\"gantt-header\">\n <gantt-table-header #tableHeader [columns]=\"columns\"></gantt-table-header>\n <div class=\"gantt-container-header\">\n <gantt-calendar-header></gantt-calendar-header>\n </div>\n </div>\n <gantt-loader *ngIf=\"loading\"></gantt-loader>\n\n <cdk-virtual-scroll-viewport\n class=\"gantt-virtual-scroll-viewport\"\n [ngClass]=\"{ 'gantt-normal-viewport': !virtualScrollEnabled }\"\n [itemSize]=\"styles.lineHeight\"\n [minBufferPx]=\"styles.lineHeight * 10\"\n [maxBufferPx]=\"styles.lineHeight * 20\"\n >\n <ng-container *cdkVirtualFor=\"let item of flatItems; trackBy: trackBy\"></ng-container>\n <div class=\"gantt-side\" [style.width.px]=\"tableHeader.tableWidth + 1\">\n <div class=\"gantt-side-container\">\n <div class=\"gantt-table\">\n <gantt-table-body\n [flatItems]=\"flatItems\"\n [viewportItems]=\"viewportItems\"\n [columns]=\"columns\"\n [groupTemplate]=\"groupTemplate\"\n [emptyTemplate]=\"tableEmptyTemplate\"\n [rowBeforeTemplate]=\"table?.rowBeforeTemplate\"\n [rowAfterTemplate]=\"table?.rowAfterTemplate\"\n [draggable]=\"table.draggable\"\n [dropEnterPredicate]=\"table.dropEnterPredicate\"\n (dragDropped)=\"table.dragDropped.emit($event)\"\n (dragStarted)=\"table.dragStarted.emit($event)\"\n (dragEnded)=\"table.dragEnded.emit($event)\"\n (itemClick)=\"selectItem($event)\"\n >\n </gantt-table-body>\n </div>\n </div>\n </div>\n <div class=\"gantt-container\">\n <gantt-calendar-grid></gantt-calendar-grid>\n <div class=\"gantt-main\">\n <gantt-main\n [flatItems]=\"flatItems\"\n [viewportItems]=\"viewportItems\"\n [groupHeaderTemplate]=\"groupHeaderTemplate\"\n [itemTemplate]=\"itemTemplate\"\n [barTemplate]=\"barTemplate\"\n [rangeTemplate]=\"rangeTemplate\"\n (barClick)=\"barClick.emit($event)\"\n (lineClick)=\"lineClick.emit($event)\"\n >\n </gantt-main>\n </div>\n </div>\n </cdk-virtual-scroll-viewport>\n\n <gantt-drag-backdrop [style.left.px]=\"tableHeader.tableWidth + 1\"></gantt-drag-backdrop>\n</ngx-gantt-root>\n" }]
|
|
3873
4006
|
}], ctorParameters: function () {
|
|
3874
4007
|
return [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }, { type: i0.NgZone }, { type: GanttPrintService, decorators: [{
|
|
3875
4008
|
type: Optional
|
|
@@ -3887,6 +4020,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImpor
|
|
|
3887
4020
|
type: Input
|
|
3888
4021
|
}], loading: [{
|
|
3889
4022
|
type: Input
|
|
4023
|
+
}], virtualScrollEnabled: [{
|
|
4024
|
+
type: Input
|
|
3890
4025
|
}], loadingDelay: [{
|
|
3891
4026
|
type: Input
|
|
3892
4027
|
}], linkDragStarted: [{
|
|
@@ -3920,11 +4055,9 @@ NgxGanttModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version:
|
|
|
3920
4055
|
NgxGanttModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.1.4", ngImport: i0, type: NgxGanttModule, declarations: [NgxGanttComponent,
|
|
3921
4056
|
NgxGanttTableComponent,
|
|
3922
4057
|
NgxGanttTableColumnComponent,
|
|
3923
|
-
// GanttTableComponent,
|
|
3924
4058
|
GanttTableHeaderComponent,
|
|
3925
4059
|
GanttTableBodyComponent,
|
|
3926
4060
|
GanttMainComponent,
|
|
3927
|
-
// GanttCalendarComponent,
|
|
3928
4061
|
GanttCalendarHeaderComponent,
|
|
3929
4062
|
GanttCalendarGridComponent,
|
|
3930
4063
|
GanttLinksComponent,
|
|
@@ -3971,11 +4104,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImpor
|
|
|
3971
4104
|
NgxGanttComponent,
|
|
3972
4105
|
NgxGanttTableComponent,
|
|
3973
4106
|
NgxGanttTableColumnComponent,
|
|
3974
|
-
// GanttTableComponent,
|
|
3975
4107
|
GanttTableHeaderComponent,
|
|
3976
4108
|
GanttTableBodyComponent,
|
|
3977
4109
|
GanttMainComponent,
|
|
3978
|
-
// GanttCalendarComponent,
|
|
3979
4110
|
GanttCalendarHeaderComponent,
|
|
3980
4111
|
GanttCalendarGridComponent,
|
|
3981
4112
|
GanttLinksComponent,
|
|
@@ -4009,5 +4140,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImpor
|
|
|
4009
4140
|
* Generated bundle index. Do not edit.
|
|
4010
4141
|
*/
|
|
4011
4142
|
|
|
4012
|
-
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 };
|
|
4143
|
+
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 };
|
|
4013
4144
|
//# sourceMappingURL=worktile-gantt.mjs.map
|