@worktile/gantt 15.1.0-next.1 → 15.1.0-next.11
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/components/bar/bar-drag.d.ts +29 -7
- package/components/bar/bar.component.scss +0 -22
- package/components/calendar/calendar.scss +1 -1
- package/components/drag-backdrop/drag-backdrop.component.scss +1 -0
- package/components/table/body/gantt-table-body.component.d.ts +6 -3
- package/esm2020/class/event.mjs +5 -1
- package/esm2020/components/bar/bar-drag.mjs +227 -76
- package/esm2020/components/bar/bar.component.mjs +33 -27
- package/esm2020/components/table/body/gantt-table-body.component.mjs +63 -35
- package/esm2020/components/table/header/gantt-table-header.component.mjs +2 -2
- package/esm2020/gantt-abstract.mjs +1 -1
- package/esm2020/gantt-item-upper.mjs +8 -6
- package/esm2020/gantt-upper.mjs +4 -3
- package/esm2020/gantt.component.mjs +3 -3
- package/esm2020/table/gantt-column.component.mjs +13 -6
- package/esm2020/table/gantt-table.component.mjs +8 -2
- package/esm2020/utils/drag-scroll.mjs +54 -0
- package/fesm2015/worktile-gantt.mjs +814 -554
- package/fesm2015/worktile-gantt.mjs.map +1 -1
- package/fesm2020/worktile-gantt.mjs +803 -544
- package/fesm2020/worktile-gantt.mjs.map +1 -1
- package/gantt-abstract.d.ts +3 -1
- package/gantt-item-upper.d.ts +1 -0
- package/package.json +1 -1
- package/table/gantt-column.component.d.ts +4 -2
- package/table/gantt-table.component.d.ts +4 -2
- package/utils/drag-scroll.d.ts +27 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { InjectionToken, EventEmitter, Directive, Inject, Input, Output, ContentChild, HostBinding, Component, Injectable, ViewChild, Pipe, ViewChildren, PLATFORM_ID, ElementRef, Optional,
|
|
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 { take, takeUntil, skip, switchMap, debounceTime
|
|
6
|
-
import { BehaviorSubject, Subject, from, takeUntil as takeUntil$1, startWith,
|
|
5
|
+
import { take, takeUntil, skip, switchMap, debounceTime, map, pairwise, auditTime as auditTime$1, startWith as startWith$1, finalize } from 'rxjs/operators';
|
|
6
|
+
import { BehaviorSubject, Subject, from, takeUntil as takeUntil$1, startWith, auditTime, filter, merge, EMPTY, fromEvent, Observable, interval, animationFrameScheduler } from 'rxjs';
|
|
7
7
|
import { fromUnixTime, getWeek, getDaysInMonth, differenceInCalendarDays, setDate, addSeconds, addMinutes, addHours, addDays, addWeeks, addMonths, addQuarters, addYears, startOfDay, startOfWeek, startOfMonth, startOfQuarter, startOfYear, endOfDay, endOfWeek, endOfMonth, endOfQuarter, endOfYear, getUnixTime, format, isWeekend, isToday, differenceInDays, differenceInCalendarQuarters, eachMonthOfInterval, eachYearOfInterval, eachWeekOfInterval, eachDayOfInterval, differenceInCalendarYears } from 'date-fns';
|
|
8
8
|
export { addDays, addHours, addMinutes, addMonths, addQuarters, addSeconds, addWeeks, addYears, differenceInCalendarDays, differenceInCalendarQuarters, differenceInDays, eachDayOfInterval, eachMonthOfInterval, eachWeekOfInterval, endOfDay, endOfMonth, endOfQuarter, endOfWeek, endOfYear, format, fromUnixTime, getDaysInMonth, getUnixTime, getWeek, isToday, isWeekend, setDate, startOfDay, startOfMonth, startOfQuarter, startOfWeek, startOfYear } from 'date-fns';
|
|
9
9
|
import { SelectionModel } from '@angular/cdk/collections';
|
|
@@ -41,6 +41,10 @@ class GanttSelectedEvent {
|
|
|
41
41
|
}
|
|
42
42
|
class GanttTableDragDroppedEvent {
|
|
43
43
|
}
|
|
44
|
+
class GanttTableDragStartedEvent {
|
|
45
|
+
}
|
|
46
|
+
class GanttTableDragEndedEvent {
|
|
47
|
+
}
|
|
44
48
|
class GanttTableDragEnterPredicateContext {
|
|
45
49
|
}
|
|
46
50
|
|
|
@@ -1049,16 +1053,17 @@ class GanttUpper {
|
|
|
1049
1053
|
this.ngZone.runOutsideAngular(() => {
|
|
1050
1054
|
onStable$.pipe(takeUntil(this.unsubscribe$)).subscribe(() => {
|
|
1051
1055
|
this.element.style.opacity = '1';
|
|
1056
|
+
const disabledLoadOnScroll = this.disabledLoadOnScroll;
|
|
1052
1057
|
this.dragContainer.dragStarted.pipe(takeUntil(this.unsubscribe$)).subscribe((event) => {
|
|
1058
|
+
this.disabledLoadOnScroll = true;
|
|
1053
1059
|
this.dragStarted.emit(event);
|
|
1054
1060
|
});
|
|
1055
1061
|
this.dragContainer.dragMoved.pipe(takeUntil(this.unsubscribe$)).subscribe((event) => {
|
|
1056
1062
|
this.dragMoved.emit(event);
|
|
1057
1063
|
});
|
|
1058
1064
|
this.dragContainer.dragEnded.pipe(takeUntil(this.unsubscribe$)).subscribe((event) => {
|
|
1065
|
+
this.disabledLoadOnScroll = disabledLoadOnScroll;
|
|
1059
1066
|
this.dragEnded.emit(event);
|
|
1060
|
-
// this.computeRefs();
|
|
1061
|
-
// this.detectChanges();
|
|
1062
1067
|
});
|
|
1063
1068
|
});
|
|
1064
1069
|
});
|
|
@@ -1237,22 +1242,29 @@ class NgxGanttTableColumnComponent {
|
|
|
1237
1242
|
set width(width) {
|
|
1238
1243
|
this.columnWidth = coerceCssPixelValue(width);
|
|
1239
1244
|
}
|
|
1240
|
-
constructor(ganttUpper) {
|
|
1245
|
+
constructor(ganttUpper, elementRef) {
|
|
1241
1246
|
this.ganttUpper = ganttUpper;
|
|
1247
|
+
this.elementRef = elementRef;
|
|
1248
|
+
}
|
|
1249
|
+
get classList() {
|
|
1250
|
+
return this.elementRef.nativeElement.classList;
|
|
1242
1251
|
}
|
|
1243
1252
|
}
|
|
1244
|
-
NgxGanttTableColumnComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: NgxGanttTableColumnComponent, deps: [{ token: GANTT_UPPER_TOKEN }], target: i0.ɵɵFactoryTarget.Component });
|
|
1245
|
-
NgxGanttTableColumnComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.4", type: NgxGanttTableColumnComponent, selector: "ngx-gantt-column", inputs: { width: "width", name: "name", showExpandIcon: "showExpandIcon" }, queries: [{ propertyName: "templateRef", first: true, predicate: ["cell"], descendants: true, static: true }, { propertyName: "headerTemplateRef", first: true, predicate: ["header"], descendants: true, static: true }], ngImport: i0, template: '', isInline: true });
|
|
1253
|
+
NgxGanttTableColumnComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: NgxGanttTableColumnComponent, deps: [{ token: GANTT_UPPER_TOKEN }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
1254
|
+
NgxGanttTableColumnComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.4", type: NgxGanttTableColumnComponent, selector: "ngx-gantt-column", inputs: { width: "width", name: "name", showExpandIcon: "showExpandIcon" }, host: { classAttribute: "gantt-table-column" }, queries: [{ propertyName: "templateRef", first: true, predicate: ["cell"], descendants: true, static: true }, { propertyName: "headerTemplateRef", first: true, predicate: ["header"], descendants: true, static: true }], ngImport: i0, template: '', isInline: true });
|
|
1246
1255
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: NgxGanttTableColumnComponent, decorators: [{
|
|
1247
1256
|
type: Component,
|
|
1248
1257
|
args: [{
|
|
1249
1258
|
selector: 'ngx-gantt-column',
|
|
1250
|
-
template: ''
|
|
1259
|
+
template: '',
|
|
1260
|
+
host: {
|
|
1261
|
+
class: 'gantt-table-column'
|
|
1262
|
+
}
|
|
1251
1263
|
}]
|
|
1252
1264
|
}], ctorParameters: function () { return [{ type: GanttUpper, decorators: [{
|
|
1253
1265
|
type: Inject,
|
|
1254
1266
|
args: [GANTT_UPPER_TOKEN]
|
|
1255
|
-
}] }]; }, propDecorators: { width: [{
|
|
1267
|
+
}] }, { type: i0.ElementRef }]; }, propDecorators: { width: [{
|
|
1256
1268
|
type: Input
|
|
1257
1269
|
}], name: [{
|
|
1258
1270
|
type: Input
|
|
@@ -1270,11 +1282,13 @@ class NgxGanttTableComponent {
|
|
|
1270
1282
|
constructor() {
|
|
1271
1283
|
this.draggable = false;
|
|
1272
1284
|
this.dragDropped = new EventEmitter();
|
|
1285
|
+
this.dragStarted = new EventEmitter();
|
|
1286
|
+
this.dragEnded = new EventEmitter();
|
|
1273
1287
|
this.columnChanges = new EventEmitter();
|
|
1274
1288
|
}
|
|
1275
1289
|
}
|
|
1276
1290
|
NgxGanttTableComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: NgxGanttTableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1277
|
-
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 });
|
|
1291
|
+
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 });
|
|
1278
1292
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: NgxGanttTableComponent, decorators: [{
|
|
1279
1293
|
type: Component,
|
|
1280
1294
|
args: [{
|
|
@@ -1287,6 +1301,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImpor
|
|
|
1287
1301
|
type: Input
|
|
1288
1302
|
}], dragDropped: [{
|
|
1289
1303
|
type: Output
|
|
1304
|
+
}], dragStarted: [{
|
|
1305
|
+
type: Output
|
|
1306
|
+
}], dragEnded: [{
|
|
1307
|
+
type: Output
|
|
1290
1308
|
}], columnChanges: [{
|
|
1291
1309
|
type: Output
|
|
1292
1310
|
}], rowBeforeTemplate: [{
|
|
@@ -1421,7 +1439,7 @@ class GanttTableHeaderComponent {
|
|
|
1421
1439
|
this.columnsChange();
|
|
1422
1440
|
this.columns.changes.pipe(takeUntil$1(this.unsubscribe$)).subscribe(() => {
|
|
1423
1441
|
this.columnsChange();
|
|
1424
|
-
this.cdr.detectChanges();
|
|
1442
|
+
this.gantt.cdr.detectChanges();
|
|
1425
1443
|
});
|
|
1426
1444
|
}
|
|
1427
1445
|
columnsChange() {
|
|
@@ -1719,13 +1737,15 @@ class GanttTableBodyComponent {
|
|
|
1719
1737
|
this.document = document;
|
|
1720
1738
|
this.draggable = false;
|
|
1721
1739
|
this.dragDropped = new EventEmitter();
|
|
1740
|
+
this.dragStarted = new EventEmitter();
|
|
1741
|
+
this.dragEnded = new EventEmitter();
|
|
1722
1742
|
this.itemClick = new EventEmitter();
|
|
1723
1743
|
this.ganttTableClass = true;
|
|
1724
1744
|
this.ganttTableEmptyClass = false;
|
|
1725
1745
|
this.ganttTableDragging = false;
|
|
1726
1746
|
this.hasExpandIcon = false;
|
|
1727
1747
|
// 缓存 Element 和 DragRef 的关系,方便在 Item 拖动时查找
|
|
1728
|
-
this.
|
|
1748
|
+
this.itemDragsMap = new Map();
|
|
1729
1749
|
this.itemDragMoved = new Subject();
|
|
1730
1750
|
this.destroy$ = new Subject();
|
|
1731
1751
|
}
|
|
@@ -1747,17 +1767,17 @@ class GanttTableBodyComponent {
|
|
|
1747
1767
|
this.cdkDrags.changes
|
|
1748
1768
|
.pipe(startWith(this.cdkDrags), takeUntil$1(this.destroy$))
|
|
1749
1769
|
.subscribe((drags) => {
|
|
1750
|
-
this.
|
|
1770
|
+
this.itemDragsMap.clear();
|
|
1751
1771
|
drags.forEach((drag) => {
|
|
1752
1772
|
if (drag.data) {
|
|
1753
1773
|
// cdkDrag 变化时,缓存 Element 与 DragRef 的关系,方便 Drag Move 时查找
|
|
1754
|
-
this.
|
|
1774
|
+
this.itemDragsMap.set(drag.element.nativeElement, drag);
|
|
1755
1775
|
}
|
|
1756
1776
|
});
|
|
1757
1777
|
});
|
|
1758
1778
|
this.itemDragMoved
|
|
1759
|
-
.pipe(
|
|
1760
|
-
//
|
|
1779
|
+
.pipe(auditTime(30),
|
|
1780
|
+
// auditTime 可能会导致拖动结束后仍然执行 moved ,所以通过判断 dragging 状态来过滤无效 moved
|
|
1761
1781
|
filter((event) => event.source._dragRef.isDragging()), takeUntil$1(this.destroy$))
|
|
1762
1782
|
.subscribe((event) => {
|
|
1763
1783
|
this.onItemDragMoved(event);
|
|
@@ -1773,10 +1793,14 @@ class GanttTableBodyComponent {
|
|
|
1773
1793
|
onItemDragStarted(event) {
|
|
1774
1794
|
this.ganttTableDragging = true;
|
|
1775
1795
|
// 拖动开始时隐藏所有的子项
|
|
1776
|
-
const children = this.getChildrenElementsByElement(event.source.
|
|
1796
|
+
const children = this.getChildrenElementsByElement(event.source.element.nativeElement);
|
|
1777
1797
|
children.forEach((element) => {
|
|
1778
1798
|
element.classList.add('drag-item-hide');
|
|
1779
1799
|
});
|
|
1800
|
+
this.dragStarted.emit({
|
|
1801
|
+
source: event.source.data?.origin,
|
|
1802
|
+
sourceParent: this.getParentByItem(event.source.data)?.origin
|
|
1803
|
+
});
|
|
1780
1804
|
}
|
|
1781
1805
|
emitItemDragMoved(event) {
|
|
1782
1806
|
this.itemDragMoved.next(event);
|
|
@@ -1797,12 +1821,12 @@ class GanttTableBodyComponent {
|
|
|
1797
1821
|
}
|
|
1798
1822
|
// 缓存放置目标Id 并计算鼠标相对应的位置
|
|
1799
1823
|
this.itemDropTarget = {
|
|
1800
|
-
id: this.
|
|
1824
|
+
id: this.itemDragsMap.get(targetElement)?.data.id,
|
|
1801
1825
|
position: this.getTargetPosition(targetElement, event)
|
|
1802
1826
|
};
|
|
1803
1827
|
// 执行外部传入的 dropEnterPredicate 判断是否允许拖入目标项
|
|
1804
1828
|
if (this.dropEnterPredicate) {
|
|
1805
|
-
const targetDragRef = this.
|
|
1829
|
+
const targetDragRef = this.itemDragsMap.get(targetElement);
|
|
1806
1830
|
if (this.dropEnterPredicate({
|
|
1807
1831
|
source: event.source.data.origin,
|
|
1808
1832
|
target: targetDragRef.data.origin,
|
|
@@ -1812,6 +1836,7 @@ class GanttTableBodyComponent {
|
|
|
1812
1836
|
}
|
|
1813
1837
|
else {
|
|
1814
1838
|
this.itemDropTarget = null;
|
|
1839
|
+
this.cleanupDragArtifacts(false);
|
|
1815
1840
|
}
|
|
1816
1841
|
}
|
|
1817
1842
|
else {
|
|
@@ -1820,31 +1845,38 @@ class GanttTableBodyComponent {
|
|
|
1820
1845
|
}
|
|
1821
1846
|
onItemDragEnded(event) {
|
|
1822
1847
|
this.ganttTableDragging = false;
|
|
1848
|
+
this.dragEnded.emit({
|
|
1849
|
+
source: event.source.data?.origin,
|
|
1850
|
+
sourceParent: this.getParentByItem(event.source.data)?.origin
|
|
1851
|
+
});
|
|
1823
1852
|
}
|
|
1824
1853
|
onListDropped(event) {
|
|
1825
1854
|
if (!this.itemDropTarget) {
|
|
1826
1855
|
return;
|
|
1827
1856
|
}
|
|
1828
|
-
const targetDragRef = this.cdkDrags.find((item) => item.data?.id === this.itemDropTarget.id);
|
|
1829
1857
|
const sourceItem = event.item.data;
|
|
1858
|
+
const sourceParent = this.getParentByItem(sourceItem);
|
|
1859
|
+
const sourceChildren = this.getExpandChildrenByDrag(event.item);
|
|
1860
|
+
const targetDragRef = this.cdkDrags.find((item) => item.data?.id === this.itemDropTarget.id);
|
|
1830
1861
|
const targetItem = targetDragRef?.data;
|
|
1831
|
-
this.
|
|
1862
|
+
const targetParent = this.getParentByItem(targetItem);
|
|
1863
|
+
this.removeItem(sourceItem, sourceChildren);
|
|
1832
1864
|
switch (this.itemDropTarget.position) {
|
|
1833
1865
|
case 'before':
|
|
1834
1866
|
case 'after':
|
|
1835
|
-
this.insertItem(targetItem, sourceItem, this.itemDropTarget.position);
|
|
1867
|
+
this.insertItem(targetItem, sourceItem, sourceChildren, this.itemDropTarget.position);
|
|
1836
1868
|
sourceItem.updateLevel(targetItem.level);
|
|
1837
1869
|
break;
|
|
1838
1870
|
case 'inside':
|
|
1839
|
-
this.insertChildrenItem(targetItem, sourceItem);
|
|
1871
|
+
this.insertChildrenItem(targetItem, sourceItem, sourceChildren);
|
|
1840
1872
|
sourceItem.updateLevel(targetItem.level + 1);
|
|
1841
1873
|
break;
|
|
1842
1874
|
}
|
|
1843
1875
|
this.dragDropped.emit({
|
|
1844
1876
|
source: sourceItem.origin,
|
|
1845
|
-
sourceParent:
|
|
1877
|
+
sourceParent: sourceParent?.origin,
|
|
1846
1878
|
target: targetItem.origin,
|
|
1847
|
-
targetParent:
|
|
1879
|
+
targetParent: targetParent?.origin,
|
|
1848
1880
|
dropPosition: this.itemDropTarget.position
|
|
1849
1881
|
});
|
|
1850
1882
|
this.cleanupDragArtifacts(true);
|
|
@@ -1856,14 +1888,14 @@ class GanttTableBodyComponent {
|
|
|
1856
1888
|
this.destroy$.next();
|
|
1857
1889
|
this.destroy$.complete();
|
|
1858
1890
|
}
|
|
1859
|
-
removeItem(item) {
|
|
1860
|
-
this.renderData.splice(this.renderData.indexOf(item), 1);
|
|
1861
|
-
this.flatData.splice(this.flatData.indexOf(item), 1);
|
|
1891
|
+
removeItem(item, children) {
|
|
1892
|
+
this.renderData.splice(this.renderData.indexOf(item), 1 + children.length);
|
|
1893
|
+
this.flatData.splice(this.flatData.indexOf(item), 1 + children.length);
|
|
1862
1894
|
}
|
|
1863
|
-
insertItem(target, inserted, position) {
|
|
1895
|
+
insertItem(target, inserted, children, position) {
|
|
1864
1896
|
if (position === 'before') {
|
|
1865
|
-
this.renderData.splice(this.renderData.indexOf(target), 0, inserted);
|
|
1866
|
-
this.flatData.splice(this.flatData.indexOf(target), 0, inserted);
|
|
1897
|
+
this.renderData.splice(this.renderData.indexOf(target), 0, inserted, ...children);
|
|
1898
|
+
this.flatData.splice(this.flatData.indexOf(target), 0, inserted, ...children);
|
|
1867
1899
|
}
|
|
1868
1900
|
else {
|
|
1869
1901
|
const dragRef = this.cdkDrags.find((drag) => drag.data === target);
|
|
@@ -1872,14 +1904,14 @@ class GanttTableBodyComponent {
|
|
|
1872
1904
|
if (target.expanded) {
|
|
1873
1905
|
childrenCount = this.getChildrenElementsByElement(dragRef.element.nativeElement)?.length || 0;
|
|
1874
1906
|
}
|
|
1875
|
-
this.renderData.splice(this.renderData.indexOf(target) + 1 + childrenCount, 0, inserted);
|
|
1876
|
-
this.flatData.splice(this.flatData.indexOf(target) + 1 + childrenCount, 0, inserted);
|
|
1907
|
+
this.renderData.splice(this.renderData.indexOf(target) + 1 + childrenCount, 0, inserted, ...children);
|
|
1908
|
+
this.flatData.splice(this.flatData.indexOf(target) + 1 + childrenCount, 0, inserted, ...children);
|
|
1877
1909
|
}
|
|
1878
1910
|
}
|
|
1879
|
-
insertChildrenItem(target, inserted) {
|
|
1911
|
+
insertChildrenItem(target, inserted, children) {
|
|
1880
1912
|
if (target.expanded) {
|
|
1881
|
-
this.renderData.splice(this.renderData.indexOf(target) + target.children.length + 1, 0, inserted);
|
|
1882
|
-
this.flatData.splice(this.flatData.indexOf(target) + target.children.length + 1, 0, inserted);
|
|
1913
|
+
this.renderData.splice(this.renderData.indexOf(target) + target.children.length + 1, 0, inserted, ...children);
|
|
1914
|
+
this.flatData.splice(this.flatData.indexOf(target) + target.children.length + 1, 0, inserted, ...children);
|
|
1883
1915
|
}
|
|
1884
1916
|
target.children.push(inserted);
|
|
1885
1917
|
}
|
|
@@ -1888,16 +1920,26 @@ class GanttTableBodyComponent {
|
|
|
1888
1920
|
return n.children?.includes(item);
|
|
1889
1921
|
});
|
|
1890
1922
|
}
|
|
1891
|
-
|
|
1923
|
+
getExpandChildrenByDrag(dragRef) {
|
|
1924
|
+
if (!dragRef.data.expanded) {
|
|
1925
|
+
return [];
|
|
1926
|
+
}
|
|
1927
|
+
else {
|
|
1928
|
+
const childrenElements = this.getChildrenElementsByElement(dragRef.element.nativeElement);
|
|
1929
|
+
return childrenElements.map((element) => this.itemDragsMap.get(element).data);
|
|
1930
|
+
}
|
|
1931
|
+
}
|
|
1932
|
+
getChildrenElementsByElement(dragElement) {
|
|
1892
1933
|
// 通过循环持续查找 next element,如果 element 的 level 小于当前 item 的 level,则为它的 children
|
|
1893
1934
|
const children = [];
|
|
1894
|
-
const dragRef = this.
|
|
1895
|
-
|
|
1896
|
-
let
|
|
1935
|
+
const dragRef = this.itemDragsMap.get(dragElement);
|
|
1936
|
+
// 如果当前的 Drag 正在拖拽,会创建 PlaceholderElement 占位,所以以 PlaceholderElement 向下查找
|
|
1937
|
+
let nextElement = (dragRef.getPlaceholderElement() || dragElement).nextElementSibling;
|
|
1938
|
+
let nextDragRef = this.itemDragsMap.get(nextElement);
|
|
1897
1939
|
while (nextDragRef && nextDragRef.data.level > dragRef.data.level) {
|
|
1898
1940
|
children.push(nextElement);
|
|
1899
1941
|
nextElement = nextElement.nextElementSibling;
|
|
1900
|
-
nextDragRef = this.
|
|
1942
|
+
nextDragRef = this.itemDragsMap.get(nextElement);
|
|
1901
1943
|
}
|
|
1902
1944
|
return children;
|
|
1903
1945
|
}
|
|
@@ -1924,18 +1966,18 @@ class GanttTableBodyComponent {
|
|
|
1924
1966
|
cleanupDragArtifacts(dropped = false) {
|
|
1925
1967
|
if (dropped) {
|
|
1926
1968
|
this.itemDropTarget = null;
|
|
1969
|
+
this.document.querySelectorAll('.drag-item-hide').forEach((element) => element.classList.remove('drag-item-hide'));
|
|
1927
1970
|
}
|
|
1928
1971
|
this.document.querySelectorAll('.drop-position-before').forEach((element) => element.classList.remove('drop-position-before'));
|
|
1929
1972
|
this.document.querySelectorAll('.drop-position-after').forEach((element) => element.classList.remove('drop-position-after'));
|
|
1930
1973
|
this.document.querySelectorAll('.drop-position-inside').forEach((element) => element.classList.remove('drop-position-inside'));
|
|
1931
|
-
this.document.querySelectorAll('.drag-item-hide').forEach((element) => element.classList.remove('drop-item-hide'));
|
|
1932
1974
|
}
|
|
1933
1975
|
}
|
|
1934
1976
|
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 });
|
|
1935
|
-
GanttTableBodyComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.4", type: GanttTableBodyComponent, selector: "gantt-table-body", inputs: { renderData: "renderData", flatData: "flatData", columns: "columns", groupTemplate: "groupTemplate", emptyTemplate: "emptyTemplate", rowBeforeTemplate: "rowBeforeTemplate", rowAfterTemplate: "rowAfterTemplate", draggable: "draggable", dropEnterPredicate: "dropEnterPredicate" }, outputs: { dragDropped: "dragDropped", itemClick: "itemClick" }, host: { properties: { "class.gantt-table-draggable": "this.draggable", "class.gantt-table-body": "this.ganttTableClass", "class.gantt-table-empty": "this.ganttTableEmptyClass", "class.gantt-table-dragging": "this.ganttTableDragging" } }, viewQueries: [{ propertyName: "cdkDrags", predicate: (CdkDrag), descendants: true }], ngImport: i0, template: "<div\n class=\"gantt-table-body-container\"\n cdkDropList\n [cdkDropListAutoScrollStep]=\"6\"\n [cdkDropListData]=\"renderData\"\n [cdkDropListSortingDisabled]=\"true\"\n (cdkDropListDropped)=\"onListDropped($event)\"\n>\n <ng-container *ngIf=\"!renderData?.length\">\n <ng-container *ngIf=\"!emptyTemplate\">\n <gantt-icon class=\"empty-icon\" iconName=\"empty\"></gantt-icon>\n <div class=\"empty-text\">\u6CA1\u6709\u6570\u636E</div>\n </ng-container>\n <ng-template [ngTemplateOutlet]=\"emptyTemplate\"></ng-template>\n </ng-container>\n\n <ng-container *ngIf=\"renderData && renderData.length > 0\">\n <ng-container *ngFor=\"let item of renderData; trackBy: trackBy\">\n <div class=\"gantt-table-group\" [ngClass]=\"item.class\" *ngIf=\"item.items\">\n <div class=\"gantt-table-group-title\" [class.expanded]=\"item.expanded\" (click)=\"expandGroup(item)\">\n <gantt-icon class=\"expand-icon\" [iconName]=\"item.expanded ? 'angle-down' : 'angle-right'\"></gantt-icon>\n <ng-container *ngIf=\"groupTemplate; else default\">\n <ng-template\n [ngTemplateOutlet]=\"groupTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: item.origin, group: item.origin }\"\n ></ng-template>\n </ng-container>\n <ng-template #default>\n <span class=\"group-title\">{{ item.title }}</span>\n </ng-template>\n </div>\n </div>\n\n <div\n *ngIf=\"!item.items\"\n (click)=\"itemClick.emit({ event: $event, selectedValue: item.origin })\"\n cdkDrag\n [cdkDragData]=\"item\"\n [cdkDragDisabled]=\"(draggable && item.itemDraggable === false) || !draggable\"\n (cdkDragStarted)=\"onItemDragStarted($event)\"\n (cdkDragEnded)=\"onItemDragEnded($event)\"\n (cdkDragMoved)=\"emitItemDragMoved($event)\"\n class=\"gantt-table-item\"\n [class.gantt-table-item-with-group]=\"hasGroup\"\n [class.gantt-table-item-first-level-group]=\"item.level === 0 && (item.type | isGanttRangeItem)\"\n [style.height.px]=\"gantt.styles.lineHeight\"\n [style.lineHeight.px]=\"gantt.styles.lineHeight\"\n [class.gantt-table-item-active]=\"ganttUpper.isSelected(item.id)\"\n >\n <ng-template\n [ngTemplateOutlet]=\"rowBeforeTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: item.origin, item: item.origin }\"\n ></ng-template>\n\n <div
|
|
1977
|
+
GanttTableBodyComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.4", type: GanttTableBodyComponent, selector: "gantt-table-body", inputs: { renderData: "renderData", flatData: "flatData", columns: "columns", groupTemplate: "groupTemplate", emptyTemplate: "emptyTemplate", rowBeforeTemplate: "rowBeforeTemplate", rowAfterTemplate: "rowAfterTemplate", draggable: "draggable", dropEnterPredicate: "dropEnterPredicate" }, outputs: { dragDropped: "dragDropped", 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]=\"renderData\"\n [cdkDropListSortingDisabled]=\"true\"\n (cdkDropListDropped)=\"onListDropped($event)\"\n>\n <ng-container *ngIf=\"!renderData?.length\">\n <ng-container *ngIf=\"!emptyTemplate\">\n <gantt-icon class=\"empty-icon\" iconName=\"empty\"></gantt-icon>\n <div class=\"empty-text\">\u6CA1\u6709\u6570\u636E</div>\n </ng-container>\n <ng-template [ngTemplateOutlet]=\"emptyTemplate\"></ng-template>\n </ng-container>\n\n <ng-container *ngIf=\"renderData && renderData.length > 0\">\n <ng-container *ngFor=\"let item of renderData; trackBy: trackBy\">\n <div class=\"gantt-table-group\" [ngClass]=\"item.class\" *ngIf=\"item.items\">\n <div class=\"gantt-table-group-title\" [class.expanded]=\"item.expanded\" (click)=\"expandGroup(item)\">\n <gantt-icon class=\"expand-icon\" [iconName]=\"item.expanded ? 'angle-down' : 'angle-right'\"></gantt-icon>\n <ng-container *ngIf=\"groupTemplate; else default\">\n <ng-template\n [ngTemplateOutlet]=\"groupTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: item.origin, group: item.origin }\"\n ></ng-template>\n </ng-container>\n <ng-template #default>\n <span class=\"group-title\">{{ item.title }}</span>\n </ng-template>\n </div>\n </div>\n\n <div\n *ngIf=\"!item.items\"\n (click)=\"itemClick.emit({ event: $event, selectedValue: item.origin })\"\n cdkDrag\n [cdkDragData]=\"item\"\n [cdkDragDisabled]=\"(draggable && item.itemDraggable === false) || !draggable\"\n (cdkDragStarted)=\"onItemDragStarted($event)\"\n (cdkDragEnded)=\"onItemDragEnded($event)\"\n (cdkDragMoved)=\"emitItemDragMoved($event)\"\n class=\"gantt-table-item\"\n [class.gantt-table-item-with-group]=\"hasGroup\"\n [class.gantt-table-item-first-level-group]=\"item.level === 0 && (item.type | isGanttRangeItem)\"\n [style.height.px]=\"gantt.styles.lineHeight\"\n [style.lineHeight.px]=\"gantt.styles.lineHeight\"\n [class.gantt-table-item-active]=\"ganttUpper.isSelected(item.id)\"\n >\n <ng-template\n [ngTemplateOutlet]=\"rowBeforeTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: item.origin, item: item.origin }\"\n ></ng-template>\n\n <div [classList]=\"column.classList\" *ngFor=\"let column of columns; let first = first\" [style.width]=\"column.columnWidth\">\n <!-- drag icon -->\n <gantt-icon\n *ngIf=\"first && draggable\"\n class=\"gantt-drag-handle\"\n iconName=\"drag\"\n cdkDragHandle\n [cdkDragHandleDisabled]=\"(draggable && item.itemDraggable === false) || !draggable\"\n ></gantt-icon>\n <!-- expand icon -->\n <div\n *ngIf=\"column?.showExpandIcon || (!hasExpandIcon && first)\"\n class=\"gantt-expand-icon\"\n [style.marginLeft.px]=\"item.level * 20\"\n >\n <ng-container *ngIf=\"item.level < gantt.maxLevel - 1 && ((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" }] });
|
|
1936
1978
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: GanttTableBodyComponent, decorators: [{
|
|
1937
1979
|
type: Component,
|
|
1938
|
-
args: [{ selector: 'gantt-table-body', template: "<div\n class=\"gantt-table-body-container\"\n cdkDropList\n [cdkDropListAutoScrollStep]=\"6\"\n [cdkDropListData]=\"renderData\"\n [cdkDropListSortingDisabled]=\"true\"\n (cdkDropListDropped)=\"onListDropped($event)\"\n>\n <ng-container *ngIf=\"!renderData?.length\">\n <ng-container *ngIf=\"!emptyTemplate\">\n <gantt-icon class=\"empty-icon\" iconName=\"empty\"></gantt-icon>\n <div class=\"empty-text\">\u6CA1\u6709\u6570\u636E</div>\n </ng-container>\n <ng-template [ngTemplateOutlet]=\"emptyTemplate\"></ng-template>\n </ng-container>\n\n <ng-container *ngIf=\"renderData && renderData.length > 0\">\n <ng-container *ngFor=\"let item of renderData; trackBy: trackBy\">\n <div class=\"gantt-table-group\" [ngClass]=\"item.class\" *ngIf=\"item.items\">\n <div class=\"gantt-table-group-title\" [class.expanded]=\"item.expanded\" (click)=\"expandGroup(item)\">\n <gantt-icon class=\"expand-icon\" [iconName]=\"item.expanded ? 'angle-down' : 'angle-right'\"></gantt-icon>\n <ng-container *ngIf=\"groupTemplate; else default\">\n <ng-template\n [ngTemplateOutlet]=\"groupTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: item.origin, group: item.origin }\"\n ></ng-template>\n </ng-container>\n <ng-template #default>\n <span class=\"group-title\">{{ item.title }}</span>\n </ng-template>\n </div>\n </div>\n\n <div\n *ngIf=\"!item.items\"\n (click)=\"itemClick.emit({ event: $event, selectedValue: item.origin })\"\n cdkDrag\n [cdkDragData]=\"item\"\n [cdkDragDisabled]=\"(draggable && item.itemDraggable === false) || !draggable\"\n (cdkDragStarted)=\"onItemDragStarted($event)\"\n (cdkDragEnded)=\"onItemDragEnded($event)\"\n (cdkDragMoved)=\"emitItemDragMoved($event)\"\n class=\"gantt-table-item\"\n [class.gantt-table-item-with-group]=\"hasGroup\"\n [class.gantt-table-item-first-level-group]=\"item.level === 0 && (item.type | isGanttRangeItem)\"\n [style.height.px]=\"gantt.styles.lineHeight\"\n [style.lineHeight.px]=\"gantt.styles.lineHeight\"\n [class.gantt-table-item-active]=\"ganttUpper.isSelected(item.id)\"\n >\n <ng-template\n [ngTemplateOutlet]=\"rowBeforeTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: item.origin, item: item.origin }\"\n ></ng-template>\n\n <div
|
|
1980
|
+
args: [{ selector: 'gantt-table-body', template: "<div\n class=\"gantt-table-body-container\"\n cdkDropList\n [cdkDropListAutoScrollStep]=\"6\"\n [cdkDropListData]=\"renderData\"\n [cdkDropListSortingDisabled]=\"true\"\n (cdkDropListDropped)=\"onListDropped($event)\"\n>\n <ng-container *ngIf=\"!renderData?.length\">\n <ng-container *ngIf=\"!emptyTemplate\">\n <gantt-icon class=\"empty-icon\" iconName=\"empty\"></gantt-icon>\n <div class=\"empty-text\">\u6CA1\u6709\u6570\u636E</div>\n </ng-container>\n <ng-template [ngTemplateOutlet]=\"emptyTemplate\"></ng-template>\n </ng-container>\n\n <ng-container *ngIf=\"renderData && renderData.length > 0\">\n <ng-container *ngFor=\"let item of renderData; trackBy: trackBy\">\n <div class=\"gantt-table-group\" [ngClass]=\"item.class\" *ngIf=\"item.items\">\n <div class=\"gantt-table-group-title\" [class.expanded]=\"item.expanded\" (click)=\"expandGroup(item)\">\n <gantt-icon class=\"expand-icon\" [iconName]=\"item.expanded ? 'angle-down' : 'angle-right'\"></gantt-icon>\n <ng-container *ngIf=\"groupTemplate; else default\">\n <ng-template\n [ngTemplateOutlet]=\"groupTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: item.origin, group: item.origin }\"\n ></ng-template>\n </ng-container>\n <ng-template #default>\n <span class=\"group-title\">{{ item.title }}</span>\n </ng-template>\n </div>\n </div>\n\n <div\n *ngIf=\"!item.items\"\n (click)=\"itemClick.emit({ event: $event, selectedValue: item.origin })\"\n cdkDrag\n [cdkDragData]=\"item\"\n [cdkDragDisabled]=\"(draggable && item.itemDraggable === false) || !draggable\"\n (cdkDragStarted)=\"onItemDragStarted($event)\"\n (cdkDragEnded)=\"onItemDragEnded($event)\"\n (cdkDragMoved)=\"emitItemDragMoved($event)\"\n class=\"gantt-table-item\"\n [class.gantt-table-item-with-group]=\"hasGroup\"\n [class.gantt-table-item-first-level-group]=\"item.level === 0 && (item.type | isGanttRangeItem)\"\n [style.height.px]=\"gantt.styles.lineHeight\"\n [style.lineHeight.px]=\"gantt.styles.lineHeight\"\n [class.gantt-table-item-active]=\"ganttUpper.isSelected(item.id)\"\n >\n <ng-template\n [ngTemplateOutlet]=\"rowBeforeTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: item.origin, item: item.origin }\"\n ></ng-template>\n\n <div [classList]=\"column.classList\" *ngFor=\"let column of columns; let first = first\" [style.width]=\"column.columnWidth\">\n <!-- drag icon -->\n <gantt-icon\n *ngIf=\"first && draggable\"\n class=\"gantt-drag-handle\"\n iconName=\"drag\"\n cdkDragHandle\n [cdkDragHandleDisabled]=\"(draggable && item.itemDraggable === false) || !draggable\"\n ></gantt-icon>\n <!-- expand icon -->\n <div\n *ngIf=\"column?.showExpandIcon || (!hasExpandIcon && first)\"\n class=\"gantt-expand-icon\"\n [style.marginLeft.px]=\"item.level * 20\"\n >\n <ng-container *ngIf=\"item.level < gantt.maxLevel - 1 && ((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" }]
|
|
1939
1981
|
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
1940
1982
|
type: Inject,
|
|
1941
1983
|
args: [GANTT_ABSTRACT_TOKEN]
|
|
@@ -1968,6 +2010,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImpor
|
|
|
1968
2010
|
type: Input
|
|
1969
2011
|
}], dragDropped: [{
|
|
1970
2012
|
type: Output
|
|
2013
|
+
}], dragStarted: [{
|
|
2014
|
+
type: Output
|
|
2015
|
+
}], dragEnded: [{
|
|
2016
|
+
type: Output
|
|
1971
2017
|
}], itemClick: [{
|
|
1972
2018
|
type: Output
|
|
1973
2019
|
}], ganttTableClass: [{
|
|
@@ -2265,7 +2311,7 @@ class GanttLinksComponent {
|
|
|
2265
2311
|
this.elementRef.nativeElement.style.visibility = 'hidden';
|
|
2266
2312
|
});
|
|
2267
2313
|
merge(this.ganttUpper.viewChange, this.ganttUpper.expandChange, this.ganttUpper.view.start$, this.ganttUpper.dragEnded, this.ganttUpper.linkDragEnded, this.ngZone.onStable.pipe(take(1)).pipe(switchMap(() => this.ganttUpper.table?.dragDropped || EMPTY)))
|
|
2268
|
-
.pipe(skip(1), debounceTime
|
|
2314
|
+
.pipe(skip(1), debounceTime(0), takeUntil(this.unsubscribe$))
|
|
2269
2315
|
.subscribe(() => {
|
|
2270
2316
|
this.elementRef.nativeElement.style.visibility = 'visible';
|
|
2271
2317
|
this.buildLinks();
|
|
@@ -2452,6 +2498,60 @@ function normalizePassiveListenerOptions(options) {
|
|
|
2452
2498
|
/** Options used to bind passive event listeners. */
|
|
2453
2499
|
const passiveListenerOptions = normalizePassiveListenerOptions({ passive: true });
|
|
2454
2500
|
|
|
2501
|
+
/**
|
|
2502
|
+
* Proximity, as a ratio to width/height at which to start auto-scrolling the drop list or the
|
|
2503
|
+
* viewport. The value comes from trying it out manually until it feels right.
|
|
2504
|
+
*/
|
|
2505
|
+
const SCROLL_PROXIMITY_THRESHOLD = 0.05;
|
|
2506
|
+
/**
|
|
2507
|
+
* Gets whether the horizontal auto-scroll direction of a node.
|
|
2508
|
+
* @param clientRect Dimensions of the node.
|
|
2509
|
+
* @param pointerX Position of the user's pointer along the x axis.
|
|
2510
|
+
*/
|
|
2511
|
+
function getHorizontalScrollDirection(clientRect, pointerX) {
|
|
2512
|
+
const { left, right, width } = clientRect;
|
|
2513
|
+
const xThreshold = width * SCROLL_PROXIMITY_THRESHOLD;
|
|
2514
|
+
if (pointerX >= left - xThreshold && pointerX <= left + xThreshold) {
|
|
2515
|
+
return 1 /* AutoScrollHorizontalDirection.LEFT */;
|
|
2516
|
+
}
|
|
2517
|
+
else if (pointerX >= right - xThreshold && pointerX <= right + xThreshold) {
|
|
2518
|
+
return 2 /* AutoScrollHorizontalDirection.RIGHT */;
|
|
2519
|
+
}
|
|
2520
|
+
return 0 /* AutoScrollHorizontalDirection.NONE */;
|
|
2521
|
+
}
|
|
2522
|
+
/**
|
|
2523
|
+
* Checks whether the pointer coordinates are close to a ClientRect.
|
|
2524
|
+
* @param rect ClientRect to check against.
|
|
2525
|
+
* @param threshold Threshold around the ClientRect.
|
|
2526
|
+
* @param pointerX Coordinates along the X axis.
|
|
2527
|
+
* @param pointerY Coordinates along the Y axis.
|
|
2528
|
+
*/
|
|
2529
|
+
function isPointerNearClientRect(rect, threshold, pointerX, pointerY) {
|
|
2530
|
+
const { top, right, bottom, left, width, height } = rect;
|
|
2531
|
+
const xThreshold = width * threshold;
|
|
2532
|
+
const yThreshold = height * threshold;
|
|
2533
|
+
return pointerY > top - yThreshold && pointerY < bottom + yThreshold && pointerX > left - xThreshold && pointerX < right + xThreshold;
|
|
2534
|
+
}
|
|
2535
|
+
/**
|
|
2536
|
+
* Gets the speed rate of auto scrolling
|
|
2537
|
+
* @param clientRect Dimensions of the node.
|
|
2538
|
+
* @param pointerX Position of the user's pointer along the x axis.
|
|
2539
|
+
* @param horizontalScrollDirection The direction in which the mouse is dragged horizontally
|
|
2540
|
+
*/
|
|
2541
|
+
function getAutoScrollSpeedRates(clientRect, pointerX, horizontalScrollDirection) {
|
|
2542
|
+
let autoScrollSpeedRates = 4;
|
|
2543
|
+
const speedLevels = 4;
|
|
2544
|
+
const { left, right, width } = clientRect;
|
|
2545
|
+
const xThreshold = width * SCROLL_PROXIMITY_THRESHOLD;
|
|
2546
|
+
if (horizontalScrollDirection === 1 /* AutoScrollHorizontalDirection.LEFT */) {
|
|
2547
|
+
autoScrollSpeedRates = Math.ceil((xThreshold - (pointerX > left ? pointerX - left : 0)) / (xThreshold / speedLevels));
|
|
2548
|
+
}
|
|
2549
|
+
if (horizontalScrollDirection === 2 /* AutoScrollHorizontalDirection.RIGHT */) {
|
|
2550
|
+
autoScrollSpeedRates = Math.ceil((xThreshold - (right > pointerX ? right - pointerX : 0)) / (xThreshold / speedLevels));
|
|
2551
|
+
}
|
|
2552
|
+
return autoScrollSpeedRates;
|
|
2553
|
+
}
|
|
2554
|
+
|
|
2455
2555
|
const scrollThreshold = 50;
|
|
2456
2556
|
var ScrollDirection;
|
|
2457
2557
|
(function (ScrollDirection) {
|
|
@@ -2535,7 +2635,7 @@ class GanttDomService {
|
|
|
2535
2635
|
.subscribe(subscriber)));
|
|
2536
2636
|
}
|
|
2537
2637
|
getResize() {
|
|
2538
|
-
return isPlatformServer(this.platformId) ? EMPTY : fromEvent(window, 'resize').pipe(auditTime(150));
|
|
2638
|
+
return isPlatformServer(this.platformId) ? EMPTY : fromEvent(window, 'resize').pipe(auditTime$1(150));
|
|
2539
2639
|
}
|
|
2540
2640
|
scrollMainContainer(left) {
|
|
2541
2641
|
if (isNumber(left)) {
|
|
@@ -2559,388 +2659,152 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImpor
|
|
|
2559
2659
|
args: [PLATFORM_ID]
|
|
2560
2660
|
}] }]; } });
|
|
2561
2661
|
|
|
2562
|
-
|
|
2662
|
+
/**
|
|
2663
|
+
* Proximity, as a ratio to width/height, at which a
|
|
2664
|
+
* dragged item will affect the drop container.
|
|
2665
|
+
*/
|
|
2666
|
+
const DROP_PROXIMITY_THRESHOLD = 0.05;
|
|
2667
|
+
const dragMinWidth = 10;
|
|
2668
|
+
const autoScrollBaseStep = 2;
|
|
2669
|
+
const activeClass = 'gantt-bar-active';
|
|
2670
|
+
const dropActiveClass = 'gantt-bar-drop-active';
|
|
2671
|
+
const singleDropActiveClass = 'gantt-bar-single-drop-active';
|
|
2672
|
+
function createSvgElement(qualifiedName, className) {
|
|
2673
|
+
const element = document.createElementNS('http://www.w3.org/2000/svg', qualifiedName);
|
|
2674
|
+
element.classList.add(className);
|
|
2675
|
+
return element;
|
|
2563
2676
|
}
|
|
2564
|
-
|
|
2565
|
-
|
|
2566
|
-
|
|
2567
|
-
type: Component,
|
|
2568
|
-
args: [{ selector: 'gantt-drag-backdrop', host: {
|
|
2569
|
-
class: 'gantt-drag-backdrop'
|
|
2570
|
-
}, template: "<div class=\"gantt-drag-mask\">\n <div class=\"date-range\">\n <span class=\"start\"></span>\n <span class=\"end\"></span>\n </div>\n</div>\n" }]
|
|
2571
|
-
}] });
|
|
2572
|
-
|
|
2573
|
-
class GanttCalendarHeaderComponent {
|
|
2574
|
-
get view() {
|
|
2575
|
-
return this.ganttUpper.view;
|
|
2677
|
+
class GanttBarDrag {
|
|
2678
|
+
get dragDisabled() {
|
|
2679
|
+
return !this.item.draggable || !this.ganttUpper.draggable;
|
|
2576
2680
|
}
|
|
2577
|
-
|
|
2578
|
-
this.
|
|
2579
|
-
this.ngZone = ngZone;
|
|
2580
|
-
this.elementRef = elementRef;
|
|
2581
|
-
this.unsubscribe$ = new Subject();
|
|
2582
|
-
this.headerHeight = headerHeight;
|
|
2583
|
-
this.viewTypes = GanttViewType;
|
|
2584
|
-
this.className = `gantt-calendar gantt-calendar-header`;
|
|
2681
|
+
get linkDragDisabled() {
|
|
2682
|
+
return !this.item.linkable || !this.ganttUpper.linkable;
|
|
2585
2683
|
}
|
|
2586
|
-
|
|
2587
|
-
this.
|
|
2588
|
-
merge(this.ganttUpper.viewChange, this.ganttUpper.view.start$)
|
|
2589
|
-
.pipe(takeUntil(this.unsubscribe$))
|
|
2590
|
-
.subscribe(() => {
|
|
2591
|
-
if (this.ganttUpper.viewType === GanttViewType.day)
|
|
2592
|
-
this.setTodayPoint();
|
|
2593
|
-
});
|
|
2594
|
-
});
|
|
2684
|
+
get barHandleDragMoveAndScrollDistance() {
|
|
2685
|
+
return this.barHandleDragMoveDistance + this.dragScrollDistance;
|
|
2595
2686
|
}
|
|
2596
|
-
|
|
2597
|
-
|
|
2598
|
-
const today = new GanttDate().getDate();
|
|
2599
|
-
const todayEle = this.elementRef.nativeElement.getElementsByClassName('gantt-calendar-today-overlay')[0];
|
|
2600
|
-
const rect = this.elementRef.nativeElement.getElementsByClassName('today-rect')[0];
|
|
2601
|
-
if (isNumber(x)) {
|
|
2602
|
-
if (rect) {
|
|
2603
|
-
rect.style.left = `${x - todayWidth / 2}px`;
|
|
2604
|
-
rect.style.top = `${headerHeight - todayHeight}px`;
|
|
2605
|
-
rect.innerHTML = today.toString();
|
|
2606
|
-
}
|
|
2607
|
-
}
|
|
2608
|
-
else {
|
|
2609
|
-
todayEle.style.display = 'none';
|
|
2610
|
-
}
|
|
2687
|
+
get autoScrollStep() {
|
|
2688
|
+
return Math.pow(autoScrollBaseStep, this.autoScrollSpeedRates);
|
|
2611
2689
|
}
|
|
2612
|
-
|
|
2613
|
-
|
|
2690
|
+
constructor(dragDrop, dom, dragContainer, _ngZone) {
|
|
2691
|
+
this.dragDrop = dragDrop;
|
|
2692
|
+
this.dom = dom;
|
|
2693
|
+
this.dragContainer = dragContainer;
|
|
2694
|
+
this._ngZone = _ngZone;
|
|
2695
|
+
this.dragRefs = [];
|
|
2696
|
+
this.destroy$ = new Subject();
|
|
2697
|
+
/** Used to signal to the current auto-scroll sequence when to stop. */
|
|
2698
|
+
this.stopScrollTimers$ = new Subject();
|
|
2699
|
+
/** move distance when drag bar */
|
|
2700
|
+
this.barDragMoveDistance = 0;
|
|
2701
|
+
/** move distance when drag bar handle */
|
|
2702
|
+
this.barHandleDragMoveDistance = 0;
|
|
2703
|
+
/** scrolling state when drag */
|
|
2704
|
+
this.dragScrolling = false;
|
|
2705
|
+
/** dragScrollDistance */
|
|
2706
|
+
this.dragScrollDistance = 0;
|
|
2707
|
+
/** Horizontal direction in which the list is currently scrolling. */
|
|
2708
|
+
this._horizontalScrollDirection = 0 /* AutoScrollHorizontalDirection.NONE */;
|
|
2709
|
+
/** Speed ratio for auto scroll */
|
|
2710
|
+
this.autoScrollSpeedRates = 1;
|
|
2711
|
+
this.startScrollInterval = () => {
|
|
2712
|
+
this.stopScrolling();
|
|
2713
|
+
interval(0, animationFrameScheduler)
|
|
2714
|
+
.pipe(takeUntil(this.stopScrollTimers$))
|
|
2715
|
+
.subscribe(() => {
|
|
2716
|
+
const node = this.dom.mainContainer;
|
|
2717
|
+
const scrollStep = this.autoScrollStep;
|
|
2718
|
+
if (this._horizontalScrollDirection === 1 /* AutoScrollHorizontalDirection.LEFT */) {
|
|
2719
|
+
node.scrollBy(-scrollStep, 0);
|
|
2720
|
+
}
|
|
2721
|
+
else if (this._horizontalScrollDirection === 2 /* AutoScrollHorizontalDirection.RIGHT */) {
|
|
2722
|
+
node.scrollBy(scrollStep, 0);
|
|
2723
|
+
}
|
|
2724
|
+
});
|
|
2725
|
+
};
|
|
2614
2726
|
}
|
|
2615
|
-
|
|
2616
|
-
|
|
2617
|
-
|
|
2618
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: GanttCalendarHeaderComponent, decorators: [{
|
|
2619
|
-
type: Component,
|
|
2620
|
-
args: [{ selector: 'gantt-calendar-header', template: "<div class=\"gantt-calendar-today-overlay\" [style.width.px]=\"view.width\">\n <span class=\"today-rect\" [hidden]=\"ganttUpper.viewType !== viewTypes.day\"> </span>\n</div>\n<svg [attr.width]=\"view.width\" [attr.height]=\"headerHeight\">\n <g>\n <text\n class=\"primary-text\"\n [ngStyle]=\"point.style\"\n [class.today]=\"point.additions?.isToday\"\n [class.weekend]=\"point.additions?.isWeekend\"\n *ngFor=\"let point of view.primaryDatePoints; trackBy: trackBy\"\n [attr.x]=\"point.x\"\n [attr.y]=\"point.y\"\n >\n {{ point.text }}\n </text>\n <ng-container *ngFor=\"let point of view.secondaryDatePoints; trackBy: trackBy\">\n <text\n class=\"secondary-text\"\n [ngStyle]=\"point.style\"\n [class.today]=\"point.additions?.isToday\"\n [class.weekend]=\"point.additions?.isWeekend\"\n [attr.x]=\"point.x\"\n [attr.y]=\"point.y\"\n >\n {{ point.text }}\n </text>\n </ng-container>\n\n <g>\n <line\n *ngFor=\"let point of view.primaryDatePoints; let i = index; trackBy: trackBy\"\n [attr.x1]=\"(i + 1) * view.primaryWidth\"\n [attr.x2]=\"(i + 1) * view.primaryWidth\"\n [attr.y1]=\"0\"\n [attr.y2]=\"headerHeight\"\n class=\"primary-line\"\n ></line>\n </g>\n\n <g>\n <line [attr.x1]=\"0\" [attr.x2]=\"view.width\" [attr.y1]=\"headerHeight\" [attr.y2]=\"headerHeight\" class=\"header-line\"></line>\n </g>\n </g>\n</svg>\n" }]
|
|
2621
|
-
}], ctorParameters: function () { return [{ type: GanttUpper, decorators: [{
|
|
2622
|
-
type: Inject,
|
|
2623
|
-
args: [GANTT_UPPER_TOKEN]
|
|
2624
|
-
}] }, { type: i0.NgZone }, { type: i0.ElementRef }]; }, propDecorators: { className: [{
|
|
2625
|
-
type: HostBinding,
|
|
2626
|
-
args: ['class']
|
|
2627
|
-
}] } });
|
|
2628
|
-
|
|
2629
|
-
const mainHeight = 5000;
|
|
2630
|
-
class GanttCalendarGridComponent {
|
|
2631
|
-
get view() {
|
|
2632
|
-
return this.ganttUpper.view;
|
|
2727
|
+
createDragRef(element) {
|
|
2728
|
+
const dragRef = this.dragDrop.createDrag(element);
|
|
2729
|
+
return dragRef;
|
|
2633
2730
|
}
|
|
2634
|
-
|
|
2635
|
-
this.
|
|
2636
|
-
this.ngZone = ngZone;
|
|
2637
|
-
this.elementRef = elementRef;
|
|
2638
|
-
this.unsubscribe$ = new Subject();
|
|
2639
|
-
this.headerHeight = headerHeight;
|
|
2640
|
-
this.mainHeight = mainHeight;
|
|
2641
|
-
this.todayBorderRadius = todayBorderRadius;
|
|
2642
|
-
this.viewTypes = GanttViewType;
|
|
2643
|
-
this.className = `gantt-calendar gantt-calendar-grid`;
|
|
2731
|
+
createDragScrollEvent(dragRef) {
|
|
2732
|
+
return fromEvent(this.dom.mainContainer, 'scroll', passiveListenerOptions).pipe(takeUntil(dragRef.ended));
|
|
2644
2733
|
}
|
|
2645
|
-
|
|
2646
|
-
const
|
|
2647
|
-
|
|
2648
|
-
|
|
2649
|
-
|
|
2650
|
-
|
|
2651
|
-
|
|
2652
|
-
|
|
2653
|
-
|
|
2734
|
+
createMouseEvents() {
|
|
2735
|
+
const dropClass = this.ganttUpper.config.linkOptions?.dependencyTypes?.length === 1 &&
|
|
2736
|
+
this.ganttUpper.config.linkOptions?.dependencyTypes[0] === GanttLinkType.fs
|
|
2737
|
+
? singleDropActiveClass
|
|
2738
|
+
: dropActiveClass;
|
|
2739
|
+
fromEvent(this.barElement, 'mouseenter', passiveListenerOptions)
|
|
2740
|
+
.pipe(takeUntil(this.destroy$))
|
|
2741
|
+
.subscribe(() => {
|
|
2742
|
+
if (this.dragContainer.linkDraggingId && this.dragContainer.linkDraggingId !== this.item.id) {
|
|
2743
|
+
if (this.item.linkable) {
|
|
2744
|
+
this.barElement.classList.add(dropClass);
|
|
2745
|
+
this.dragContainer.emitLinkDragEntered({
|
|
2746
|
+
item: this.item,
|
|
2747
|
+
element: this.barElement
|
|
2748
|
+
});
|
|
2749
|
+
}
|
|
2654
2750
|
}
|
|
2655
|
-
|
|
2656
|
-
|
|
2657
|
-
|
|
2658
|
-
}
|
|
2751
|
+
else {
|
|
2752
|
+
this.barElement.classList.add(activeClass);
|
|
2753
|
+
}
|
|
2754
|
+
});
|
|
2755
|
+
fromEvent(this.barElement, 'mouseleave', passiveListenerOptions)
|
|
2756
|
+
.pipe(takeUntil(this.destroy$))
|
|
2757
|
+
.subscribe(() => {
|
|
2758
|
+
if (!this.dragContainer.linkDraggingId) {
|
|
2759
|
+
this.barElement.classList.remove(activeClass);
|
|
2760
|
+
}
|
|
2761
|
+
else {
|
|
2762
|
+
this.dragContainer.emitLinkDragLeaved();
|
|
2763
|
+
}
|
|
2764
|
+
this.barElement.classList.remove(dropClass);
|
|
2765
|
+
});
|
|
2659
2766
|
}
|
|
2660
|
-
|
|
2661
|
-
this.
|
|
2662
|
-
|
|
2663
|
-
|
|
2664
|
-
|
|
2665
|
-
|
|
2767
|
+
createBarDrag() {
|
|
2768
|
+
const dragRef = this.createDragRef(this.barElement);
|
|
2769
|
+
dragRef.lockAxis = 'x';
|
|
2770
|
+
dragRef.withBoundaryElement(this.dom.mainItems);
|
|
2771
|
+
dragRef.started.subscribe(() => {
|
|
2772
|
+
this.setDraggingStyles();
|
|
2773
|
+
this.containerScrollLeft = this.dom.mainContainer.scrollLeft;
|
|
2774
|
+
this.createDragScrollEvent(dragRef).subscribe(() => {
|
|
2775
|
+
if (dragRef.isDragging()) {
|
|
2776
|
+
const dragScrollDistance = this.dom.mainContainer.scrollLeft - this.containerScrollLeft;
|
|
2777
|
+
this.dragScrollDistance = dragScrollDistance;
|
|
2778
|
+
dragRef['_boundaryRect'] = this.dom.mainItems.getBoundingClientRect();
|
|
2779
|
+
this.barDragMove();
|
|
2780
|
+
}
|
|
2666
2781
|
});
|
|
2782
|
+
this.dragContainer.dragStarted.emit({ item: this.item.origin });
|
|
2667
2783
|
});
|
|
2668
|
-
|
|
2669
|
-
|
|
2670
|
-
|
|
2671
|
-
|
|
2672
|
-
|
|
2673
|
-
|
|
2674
|
-
|
|
2675
|
-
|
|
2676
|
-
|
|
2677
|
-
|
|
2678
|
-
|
|
2679
|
-
|
|
2680
|
-
|
|
2681
|
-
|
|
2682
|
-
|
|
2683
|
-
|
|
2684
|
-
|
|
2685
|
-
|
|
2686
|
-
|
|
2687
|
-
|
|
2688
|
-
|
|
2689
|
-
|
|
2690
|
-
|
|
2691
|
-
|
|
2692
|
-
this.ganttUpper = ganttUpper;
|
|
2693
|
-
this.ganttItemClass = true;
|
|
2694
|
-
this.ganttViewsMap = keyBy(ganttViews, 'value');
|
|
2695
|
-
}
|
|
2696
|
-
selectView(view) {
|
|
2697
|
-
this.ganttUpper.changeView(view);
|
|
2698
|
-
}
|
|
2699
|
-
}
|
|
2700
|
-
NgxGanttToolbarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: NgxGanttToolbarComponent, deps: [{ token: GANTT_UPPER_TOKEN }], target: i0.ɵɵFactoryTarget.Component });
|
|
2701
|
-
NgxGanttToolbarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.4", type: NgxGanttToolbarComponent, selector: "ngx-gantt-toolbar,gantt-toolbar", inputs: { template: "template" }, host: { properties: { "class.gantt-toolbar": "this.ganttItemClass" } }, ngImport: i0, template: "<div class=\"toolbar-container\">\n <ng-container *ngIf=\"!template\">\n <div class=\"toolbar-views\" *ngIf=\"this.ganttUpper.toolbarOptions?.viewTypes?.length\">\n <ng-container *ngFor=\"let view of this.ganttUpper.toolbarOptions?.viewTypes\">\n <div class=\"toolbar-view\" *ngIf=\"ganttViewsMap[view]\" [class.active]=\"view === this.ganttUpper.viewType\" (click)=\"selectView(view)\">\n {{ ganttViewsMap[view].name }}\n </div>\n </ng-container>\n </div>\n </ng-container>\n <ng-template [ngTemplateOutlet]=\"template\"></ng-template>\n</div>\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"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
|
|
2702
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: NgxGanttToolbarComponent, decorators: [{
|
|
2703
|
-
type: Component,
|
|
2704
|
-
args: [{ selector: 'ngx-gantt-toolbar,gantt-toolbar', template: "<div class=\"toolbar-container\">\n <ng-container *ngIf=\"!template\">\n <div class=\"toolbar-views\" *ngIf=\"this.ganttUpper.toolbarOptions?.viewTypes?.length\">\n <ng-container *ngFor=\"let view of this.ganttUpper.toolbarOptions?.viewTypes\">\n <div class=\"toolbar-view\" *ngIf=\"ganttViewsMap[view]\" [class.active]=\"view === this.ganttUpper.viewType\" (click)=\"selectView(view)\">\n {{ ganttViewsMap[view].name }}\n </div>\n </ng-container>\n </div>\n </ng-container>\n <ng-template [ngTemplateOutlet]=\"template\"></ng-template>\n</div>\n" }]
|
|
2705
|
-
}], ctorParameters: function () { return [{ type: GanttUpper, decorators: [{
|
|
2706
|
-
type: Inject,
|
|
2707
|
-
args: [GANTT_UPPER_TOKEN]
|
|
2708
|
-
}] }]; }, propDecorators: { template: [{
|
|
2709
|
-
type: Input
|
|
2710
|
-
}], ganttItemClass: [{
|
|
2711
|
-
type: HostBinding,
|
|
2712
|
-
args: ['class.gantt-toolbar']
|
|
2713
|
-
}] } });
|
|
2714
|
-
|
|
2715
|
-
class NgxGanttRootComponent {
|
|
2716
|
-
get view() {
|
|
2717
|
-
return this.ganttUpper.view;
|
|
2718
|
-
}
|
|
2719
|
-
constructor(elementRef, ngZone, dom, dragContainer, ganttUpper, printService) {
|
|
2720
|
-
this.elementRef = elementRef;
|
|
2721
|
-
this.ngZone = ngZone;
|
|
2722
|
-
this.dom = dom;
|
|
2723
|
-
this.dragContainer = dragContainer;
|
|
2724
|
-
this.ganttUpper = ganttUpper;
|
|
2725
|
-
this.printService = printService;
|
|
2726
|
-
this.unsubscribe$ = new Subject();
|
|
2727
|
-
this.ganttUpper.dragContainer = dragContainer;
|
|
2728
|
-
}
|
|
2729
|
-
ngOnInit() {
|
|
2730
|
-
// Note: the zone may be nooped through `BootstrapOptions` when bootstrapping the root module. This means
|
|
2731
|
-
// the `onStable` will never emit any value.
|
|
2732
|
-
const onStable$ = this.ngZone.isStable ? from(Promise.resolve()) : this.ngZone.onStable.pipe(take(1));
|
|
2733
|
-
// Normally this isn't in the zone, but it can cause performance regressions for apps
|
|
2734
|
-
// using `zone-patch-rxjs` because it'll trigger a change detection when it unsubscribes.
|
|
2735
|
-
this.ngZone.runOutsideAngular(() => {
|
|
2736
|
-
onStable$.pipe(takeUntil(this.unsubscribe$)).subscribe(() => {
|
|
2737
|
-
this.dom.initialize(this.elementRef);
|
|
2738
|
-
if (this.printService) {
|
|
2739
|
-
this.printService.register(this.elementRef);
|
|
2740
|
-
}
|
|
2741
|
-
this.setupScrollClass();
|
|
2742
|
-
this.setupResize();
|
|
2743
|
-
this.setupViewScroll();
|
|
2744
|
-
// 优化初始化时Scroll滚动体验问题,通过透明度解决,默认透明度为0,滚动结束后恢复
|
|
2745
|
-
this.elementRef.nativeElement.style.opacity = '1';
|
|
2746
|
-
this.ganttUpper.viewChange.pipe(startWith$1(null), takeUntil(this.unsubscribe$)).subscribe(() => {
|
|
2747
|
-
this.scrollToToday();
|
|
2748
|
-
});
|
|
2749
|
-
});
|
|
2750
|
-
});
|
|
2751
|
-
}
|
|
2752
|
-
ngOnDestroy() {
|
|
2753
|
-
this.unsubscribe$.next();
|
|
2754
|
-
}
|
|
2755
|
-
setupViewScroll() {
|
|
2756
|
-
if (this.ganttUpper.disabledLoadOnScroll) {
|
|
2757
|
-
return;
|
|
2758
|
-
}
|
|
2759
|
-
this.dom
|
|
2760
|
-
.getViewerScroll(passiveListenerOptions)
|
|
2761
|
-
.pipe(takeUntil(this.unsubscribe$))
|
|
2762
|
-
.subscribe((event) => {
|
|
2763
|
-
if (event.direction === ScrollDirection.LEFT) {
|
|
2764
|
-
const dates = this.view.addStartDate();
|
|
2765
|
-
if (dates) {
|
|
2766
|
-
event.target.scrollLeft += this.view.getDateRangeWidth(dates.start, dates.end);
|
|
2767
|
-
if (this.ganttUpper.loadOnScroll.observers) {
|
|
2768
|
-
this.ngZone.run(() => this.ganttUpper.loadOnScroll.emit({ start: dates.start.getUnixTime(), end: dates.end.getUnixTime() }));
|
|
2769
|
-
}
|
|
2770
|
-
}
|
|
2771
|
-
}
|
|
2772
|
-
if (event.direction === ScrollDirection.RIGHT) {
|
|
2773
|
-
const dates = this.view.addEndDate();
|
|
2774
|
-
if (dates && this.ganttUpper.loadOnScroll.observers) {
|
|
2775
|
-
this.ngZone.run(() => this.ganttUpper.loadOnScroll.emit({ start: dates.start.getUnixTime(), end: dates.end.getUnixTime() }));
|
|
2776
|
-
}
|
|
2777
|
-
}
|
|
2778
|
-
});
|
|
2779
|
-
}
|
|
2780
|
-
setupResize() {
|
|
2781
|
-
this.dom
|
|
2782
|
-
.getResize()
|
|
2783
|
-
.pipe(takeUntil(this.unsubscribe$))
|
|
2784
|
-
.subscribe(() => {
|
|
2785
|
-
this.setupScrollClass();
|
|
2786
|
-
});
|
|
2787
|
-
}
|
|
2788
|
-
setupScrollClass() {
|
|
2789
|
-
const mainContainer = this.dom.mainContainer;
|
|
2790
|
-
const height = mainContainer.offsetHeight;
|
|
2791
|
-
const scrollHeight = mainContainer.scrollHeight;
|
|
2792
|
-
if (scrollHeight > height) {
|
|
2793
|
-
this.elementRef.nativeElement.className = 'gantt gantt-scroll';
|
|
2794
|
-
}
|
|
2795
|
-
else {
|
|
2796
|
-
this.elementRef.nativeElement.className = 'gantt';
|
|
2797
|
-
}
|
|
2798
|
-
}
|
|
2799
|
-
scrollToToday() {
|
|
2800
|
-
const x = this.view.getTodayXPoint();
|
|
2801
|
-
this.dom.scrollMainContainer(x);
|
|
2802
|
-
}
|
|
2803
|
-
scrollToDate(date) {
|
|
2804
|
-
let x;
|
|
2805
|
-
if (typeof date === 'number') {
|
|
2806
|
-
x = this.view.getXPointByDate(new GanttDate(date));
|
|
2807
|
-
}
|
|
2808
|
-
else {
|
|
2809
|
-
x = this.view.getXPointByDate(date);
|
|
2810
|
-
}
|
|
2811
|
-
this.dom.scrollMainContainer(x);
|
|
2812
|
-
}
|
|
2813
|
-
}
|
|
2814
|
-
NgxGanttRootComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: NgxGanttRootComponent, deps: [{ token: i0.ElementRef }, { token: i0.NgZone }, { token: GanttDomService }, { token: GanttDragContainer }, { token: GANTT_UPPER_TOKEN }, { token: GanttPrintService, optional: true }], target: i0.ɵɵFactoryTarget.Component });
|
|
2815
|
-
NgxGanttRootComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.4", type: NgxGanttRootComponent, selector: "ngx-gantt-root", inputs: { sideWidth: "sideWidth" }, host: { classAttribute: "gantt" }, providers: [GanttDomService, GanttDragContainer], queries: [{ propertyName: "sideTemplate", first: true, predicate: ["sideTemplate"], descendants: true, static: true }, { propertyName: "mainTemplate", first: true, predicate: ["mainTemplate"], descendants: true, static: true }], viewQueries: [{ propertyName: "backdrop", first: true, predicate: GanttDragBackdropComponent, descendants: true, read: ElementRef, static: true }], ngImport: i0, template: "<div class=\"gantt-side\" *ngIf=\"sideTemplate\" [style.width.px]=\"sideWidth\">\n <div class=\"gantt-side-container\" cdkScrollable>\n <ng-template [ngTemplateOutlet]=\"sideTemplate\"></ng-template>\n </div>\n</div>\n<div class=\"gantt-container\" *ngIf=\"mainTemplate\">\n <gantt-calendar-header></gantt-calendar-header>\n <gantt-calendar-grid></gantt-calendar-grid>\n <gantt-drag-backdrop></gantt-drag-backdrop>\n <div class=\"gantt-main\">\n <ng-template [ngTemplateOutlet]=\"mainTemplate\"></ng-template>\n </div>\n</div>\n<ng-content></ng-content>\n<gantt-toolbar *ngIf=\"ganttUpper.showToolbar || ganttUpper.toolbarTemplate\" [template]=\"ganttUpper.toolbarTemplate\"> </gantt-toolbar>\n", dependencies: [{ 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: i3.CdkScrollable, selector: "[cdk-scrollable], [cdkScrollable]" }, { kind: "component", type: GanttCalendarHeaderComponent, selector: "gantt-calendar-header" }, { kind: "component", type: GanttCalendarGridComponent, selector: "gantt-calendar-grid" }, { kind: "component", type: GanttDragBackdropComponent, selector: "gantt-drag-backdrop" }, { kind: "component", type: NgxGanttToolbarComponent, selector: "ngx-gantt-toolbar,gantt-toolbar", inputs: ["template"] }] });
|
|
2816
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: NgxGanttRootComponent, decorators: [{
|
|
2817
|
-
type: Component,
|
|
2818
|
-
args: [{ selector: 'ngx-gantt-root', providers: [GanttDomService, GanttDragContainer], host: {
|
|
2819
|
-
class: 'gantt'
|
|
2820
|
-
}, template: "<div class=\"gantt-side\" *ngIf=\"sideTemplate\" [style.width.px]=\"sideWidth\">\n <div class=\"gantt-side-container\" cdkScrollable>\n <ng-template [ngTemplateOutlet]=\"sideTemplate\"></ng-template>\n </div>\n</div>\n<div class=\"gantt-container\" *ngIf=\"mainTemplate\">\n <gantt-calendar-header></gantt-calendar-header>\n <gantt-calendar-grid></gantt-calendar-grid>\n <gantt-drag-backdrop></gantt-drag-backdrop>\n <div class=\"gantt-main\">\n <ng-template [ngTemplateOutlet]=\"mainTemplate\"></ng-template>\n </div>\n</div>\n<ng-content></ng-content>\n<gantt-toolbar *ngIf=\"ganttUpper.showToolbar || ganttUpper.toolbarTemplate\" [template]=\"ganttUpper.toolbarTemplate\"> </gantt-toolbar>\n" }]
|
|
2821
|
-
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.NgZone }, { type: GanttDomService }, { type: GanttDragContainer }, { type: GanttUpper, decorators: [{
|
|
2822
|
-
type: Inject,
|
|
2823
|
-
args: [GANTT_UPPER_TOKEN]
|
|
2824
|
-
}] }, { type: GanttPrintService, decorators: [{
|
|
2825
|
-
type: Optional
|
|
2826
|
-
}] }]; }, propDecorators: { sideWidth: [{
|
|
2827
|
-
type: Input
|
|
2828
|
-
}], sideTemplate: [{
|
|
2829
|
-
type: ContentChild,
|
|
2830
|
-
args: ['sideTemplate', { static: true }]
|
|
2831
|
-
}], mainTemplate: [{
|
|
2832
|
-
type: ContentChild,
|
|
2833
|
-
args: ['mainTemplate', { static: true }]
|
|
2834
|
-
}], backdrop: [{
|
|
2835
|
-
type: ViewChild,
|
|
2836
|
-
args: [GanttDragBackdropComponent, { static: true, read: ElementRef }]
|
|
2837
|
-
}] } });
|
|
2838
|
-
|
|
2839
|
-
const dragMinWidth = 10;
|
|
2840
|
-
const autoScrollStep = 10;
|
|
2841
|
-
const activeClass = 'gantt-bar-active';
|
|
2842
|
-
const dropActiveClass = 'gantt-bar-drop-active';
|
|
2843
|
-
const singleDropActiveClass = 'gantt-bar-single-drop-active';
|
|
2844
|
-
function createSvgElement(qualifiedName, className) {
|
|
2845
|
-
const element = document.createElementNS('http://www.w3.org/2000/svg', qualifiedName);
|
|
2846
|
-
element.classList.add(className);
|
|
2847
|
-
return element;
|
|
2848
|
-
}
|
|
2849
|
-
class GanttBarDrag {
|
|
2850
|
-
get dragDisabled() {
|
|
2851
|
-
return !this.item.draggable || !this.ganttUpper.draggable;
|
|
2852
|
-
}
|
|
2853
|
-
get linkDragDisabled() {
|
|
2854
|
-
return !this.item.linkable || !this.ganttUpper.linkable;
|
|
2855
|
-
}
|
|
2856
|
-
constructor(dragDrop, dom, dragContainer, root) {
|
|
2857
|
-
this.dragDrop = dragDrop;
|
|
2858
|
-
this.dom = dom;
|
|
2859
|
-
this.dragContainer = dragContainer;
|
|
2860
|
-
this.root = root;
|
|
2861
|
-
this.dragRefs = [];
|
|
2862
|
-
this.destroy$ = new Subject();
|
|
2863
|
-
// scrolling state when drag
|
|
2864
|
-
this.dragScrolling = false;
|
|
2865
|
-
}
|
|
2866
|
-
createDragRef(element) {
|
|
2867
|
-
const dragRef = this.dragDrop.createDrag(element);
|
|
2868
|
-
// dragRef.withPreviewContainer(this.dom.mainContainer as HTMLElement);
|
|
2869
|
-
return dragRef;
|
|
2870
|
-
}
|
|
2871
|
-
createDragScrollEvent(dragRef) {
|
|
2872
|
-
return fromEvent(this.dom.mainContainer, 'scroll', passiveListenerOptions).pipe(takeUntil(dragRef.ended));
|
|
2873
|
-
}
|
|
2874
|
-
createMouseEvents() {
|
|
2875
|
-
const dropClass = this.ganttUpper.config.linkOptions?.dependencyTypes?.length === 1 &&
|
|
2876
|
-
this.ganttUpper.config.linkOptions?.dependencyTypes[0] === GanttLinkType.fs
|
|
2877
|
-
? singleDropActiveClass
|
|
2878
|
-
: dropActiveClass;
|
|
2879
|
-
fromEvent(this.barElement, 'mouseenter', passiveListenerOptions)
|
|
2880
|
-
.pipe(takeUntil(this.destroy$))
|
|
2881
|
-
.subscribe(() => {
|
|
2882
|
-
if (this.dragContainer.linkDraggingId && this.dragContainer.linkDraggingId !== this.item.id) {
|
|
2883
|
-
if (this.item.linkable) {
|
|
2884
|
-
this.barElement.classList.add(dropClass);
|
|
2885
|
-
this.dragContainer.emitLinkDragEntered({
|
|
2886
|
-
item: this.item,
|
|
2887
|
-
element: this.barElement
|
|
2888
|
-
});
|
|
2889
|
-
}
|
|
2890
|
-
}
|
|
2891
|
-
else {
|
|
2892
|
-
this.barElement.classList.add(activeClass);
|
|
2893
|
-
}
|
|
2894
|
-
});
|
|
2895
|
-
fromEvent(this.barElement, 'mouseleave', passiveListenerOptions)
|
|
2896
|
-
.pipe(takeUntil(this.destroy$))
|
|
2897
|
-
.subscribe(() => {
|
|
2898
|
-
if (!this.dragContainer.linkDraggingId) {
|
|
2899
|
-
this.barElement.classList.remove(activeClass);
|
|
2900
|
-
}
|
|
2901
|
-
else {
|
|
2902
|
-
this.dragContainer.emitLinkDragLeaved();
|
|
2903
|
-
}
|
|
2904
|
-
this.barElement.classList.remove(dropClass);
|
|
2905
|
-
});
|
|
2906
|
-
}
|
|
2907
|
-
createBarDrag() {
|
|
2908
|
-
const dragRef = this.createDragRef(this.barElement);
|
|
2909
|
-
dragRef.lockAxis = 'x';
|
|
2910
|
-
dragRef.withBoundaryElement(this.dom.mainItems);
|
|
2911
|
-
dragRef.started.subscribe(() => {
|
|
2912
|
-
this.setDraggingStyles();
|
|
2913
|
-
this.containerScrollLeft = this.dom.mainContainer.scrollLeft;
|
|
2914
|
-
this.createDragScrollEvent(dragRef).subscribe(() => {
|
|
2915
|
-
if (this.dropListRef.isDragging()) {
|
|
2916
|
-
this.dragScrolling = true;
|
|
2917
|
-
const scrollDistance = this.dom.mainContainer.scrollLeft - this.containerScrollLeft;
|
|
2918
|
-
this.barDragMove(dragRef, scrollDistance + this.barDragMoveDistance);
|
|
2919
|
-
}
|
|
2920
|
-
});
|
|
2921
|
-
this.dragContainer.dragStarted.emit({ item: this.item.origin });
|
|
2922
|
-
});
|
|
2923
|
-
dragRef.moved.subscribe((event) => {
|
|
2924
|
-
this.barDragMove(dragRef, event.distance.x);
|
|
2925
|
-
if (!this.dragScrolling) {
|
|
2926
|
-
this.barDragMoveDistance = event.distance.x;
|
|
2927
|
-
}
|
|
2928
|
-
});
|
|
2929
|
-
dragRef.ended.subscribe((event) => {
|
|
2930
|
-
this.item.updateRefs({
|
|
2931
|
-
width: this.ganttUpper.view.getDateRangeWidth(this.item.start.startOfDay(), this.item.end.endOfDay()),
|
|
2932
|
-
x: this.ganttUpper.view.getXPointByDate(this.item.start),
|
|
2933
|
-
y: (this.ganttUpper.styles.lineHeight - this.ganttUpper.styles.barHeight) / 2 - 1
|
|
2934
|
-
});
|
|
2935
|
-
this.clearDraggingStyles();
|
|
2936
|
-
this.closeDragBackdrop();
|
|
2937
|
-
event.source.reset();
|
|
2938
|
-
this.dragScrolling = false;
|
|
2939
|
-
this.barDragMoveDistance = 0;
|
|
2940
|
-
this.dragContainer.dragEnded.emit({ item: this.item.origin });
|
|
2941
|
-
});
|
|
2942
|
-
this.barDragRef = dragRef;
|
|
2943
|
-
return dragRef;
|
|
2784
|
+
dragRef.moved.subscribe((event) => {
|
|
2785
|
+
this.startScrollingIfNecessary(event.pointerPosition.x, event.pointerPosition.y);
|
|
2786
|
+
this.barDragMoveDistance = event.distance.x;
|
|
2787
|
+
if (!this.dragScrolling) {
|
|
2788
|
+
this.barDragMove();
|
|
2789
|
+
}
|
|
2790
|
+
});
|
|
2791
|
+
dragRef.ended.subscribe((event) => {
|
|
2792
|
+
this.clearDraggingStyles();
|
|
2793
|
+
this.closeDragBackdrop();
|
|
2794
|
+
event.source.reset();
|
|
2795
|
+
this.stopScrolling();
|
|
2796
|
+
this.dragScrolling = false;
|
|
2797
|
+
this.dragScrollDistance = 0;
|
|
2798
|
+
this.barDragMoveDistance = 0;
|
|
2799
|
+
this.item.updateRefs({
|
|
2800
|
+
width: this.ganttUpper.view.getDateRangeWidth(this.item.start.startOfDay(), this.item.end.endOfDay()),
|
|
2801
|
+
x: this.ganttUpper.view.getXPointByDate(this.item.start),
|
|
2802
|
+
y: (this.ganttUpper.styles.lineHeight - this.ganttUpper.styles.barHeight) / 2 - 1
|
|
2803
|
+
});
|
|
2804
|
+
this.dragContainer.dragEnded.emit({ item: this.item.origin });
|
|
2805
|
+
});
|
|
2806
|
+
this.barDragRef = dragRef;
|
|
2807
|
+
return dragRef;
|
|
2944
2808
|
}
|
|
2945
2809
|
createBarHandleDrags() {
|
|
2946
2810
|
const dragRefs = [];
|
|
@@ -2954,43 +2818,51 @@ class GanttBarDrag {
|
|
|
2954
2818
|
this.setDraggingStyles();
|
|
2955
2819
|
this.containerScrollLeft = this.dom.mainContainer.scrollLeft;
|
|
2956
2820
|
this.createDragScrollEvent(dragRef).subscribe(() => {
|
|
2957
|
-
if (
|
|
2958
|
-
this.
|
|
2959
|
-
|
|
2960
|
-
|
|
2821
|
+
if (dragRef.isDragging()) {
|
|
2822
|
+
const dragScrollDistance = this.dom.mainContainer.scrollLeft - this.containerScrollLeft;
|
|
2823
|
+
this.dragScrollDistance = dragScrollDistance;
|
|
2824
|
+
dragRef['_boundaryRect'] = this.dom.mainItems.getBoundingClientRect();
|
|
2825
|
+
if (this.dragScrolling && this.isStartGreaterThanEndWhenBarHandleDragMove(isBefore)) {
|
|
2826
|
+
this.stopScrolling();
|
|
2827
|
+
this.dragScrolling = false;
|
|
2828
|
+
}
|
|
2829
|
+
if (isBefore) {
|
|
2830
|
+
this.barBeforeHandleDragMove();
|
|
2831
|
+
}
|
|
2832
|
+
else {
|
|
2833
|
+
this.barAfterHandleDragMove();
|
|
2834
|
+
}
|
|
2961
2835
|
}
|
|
2962
2836
|
});
|
|
2963
2837
|
this.dragContainer.dragStarted.emit({ item: this.item.origin });
|
|
2964
2838
|
});
|
|
2965
2839
|
dragRef.moved.subscribe((event) => {
|
|
2966
|
-
this.
|
|
2967
|
-
|
|
2968
|
-
this.barHandleDragMoveDistance = event.distance.x;
|
|
2840
|
+
if (this.barHandleDragMoveRecordDays && this.barHandleDragMoveRecordDays > 0) {
|
|
2841
|
+
this.startScrollingIfNecessary(event.pointerPosition.x, event.pointerPosition.y);
|
|
2969
2842
|
}
|
|
2970
|
-
|
|
2971
|
-
|
|
2972
|
-
|
|
2973
|
-
|
|
2974
|
-
if (width <= dragMinWidth) {
|
|
2975
|
-
this.item.updateDate(this.item.end.startOfDay(), this.item.end);
|
|
2843
|
+
this.barHandleDragMoveDistance = event.distance.x;
|
|
2844
|
+
if (!this.dragScrolling) {
|
|
2845
|
+
if (isBefore) {
|
|
2846
|
+
this.barBeforeHandleDragMove();
|
|
2976
2847
|
}
|
|
2977
|
-
|
|
2978
|
-
|
|
2979
|
-
const width = this.item.refs.width + event.distance.x;
|
|
2980
|
-
if (width <= dragMinWidth) {
|
|
2981
|
-
this.item.updateDate(this.item.start, this.item.start.endOfDay());
|
|
2848
|
+
else {
|
|
2849
|
+
this.barAfterHandleDragMove();
|
|
2982
2850
|
}
|
|
2983
2851
|
}
|
|
2984
|
-
|
|
2985
|
-
|
|
2986
|
-
x: this.ganttUpper.view.getXPointByDate(this.item.start),
|
|
2987
|
-
y: (this.ganttUpper.styles.lineHeight - this.ganttUpper.styles.barHeight) / 2 - 1
|
|
2988
|
-
});
|
|
2852
|
+
});
|
|
2853
|
+
dragRef.ended.subscribe((event) => {
|
|
2989
2854
|
this.clearDraggingStyles();
|
|
2990
2855
|
this.closeDragBackdrop();
|
|
2991
2856
|
event.source.reset();
|
|
2857
|
+
this.stopScrolling();
|
|
2992
2858
|
this.dragScrolling = false;
|
|
2859
|
+
this.dragScrollDistance = 0;
|
|
2993
2860
|
this.barHandleDragMoveDistance = 0;
|
|
2861
|
+
this.item.updateRefs({
|
|
2862
|
+
width: this.ganttUpper.view.getDateRangeWidth(this.item.start.startOfDay(), this.item.end.endOfDay()),
|
|
2863
|
+
x: this.ganttUpper.view.getXPointByDate(this.item.start),
|
|
2864
|
+
y: (this.ganttUpper.styles.lineHeight - this.ganttUpper.styles.barHeight) / 2 - 1
|
|
2865
|
+
});
|
|
2994
2866
|
this.dragContainer.dragEnded.emit({ item: this.item.origin });
|
|
2995
2867
|
});
|
|
2996
2868
|
dragRefs.push(dragRef);
|
|
@@ -3051,13 +2923,19 @@ class GanttBarDrag {
|
|
|
3051
2923
|
return dragRefs;
|
|
3052
2924
|
}
|
|
3053
2925
|
openDragBackdrop(dragElement, start, end) {
|
|
3054
|
-
// const dragBackdropElement = this.root.backdrop.nativeElement;
|
|
3055
|
-
// const dragMaskElement = dragBackdropElement.querySelector('.gantt-drag-mask') as HTMLElement;
|
|
3056
2926
|
const dragBackdropElement = this.dom.root.querySelector('.gantt-drag-backdrop');
|
|
3057
2927
|
const dragMaskElement = this.dom.root.querySelector('.gantt-drag-mask');
|
|
3058
2928
|
const rootRect = this.dom.root.getBoundingClientRect();
|
|
3059
2929
|
const dragRect = dragElement.getBoundingClientRect();
|
|
3060
|
-
|
|
2930
|
+
let left = dragRect.left - rootRect.left - (this.dom.side.clientWidth + 1);
|
|
2931
|
+
if (this.dragScrolling) {
|
|
2932
|
+
if (this._horizontalScrollDirection === 1 /* AutoScrollHorizontalDirection.LEFT */) {
|
|
2933
|
+
left += this.autoScrollStep;
|
|
2934
|
+
}
|
|
2935
|
+
else if (this._horizontalScrollDirection === 2 /* AutoScrollHorizontalDirection.RIGHT */) {
|
|
2936
|
+
left -= this.autoScrollStep;
|
|
2937
|
+
}
|
|
2938
|
+
}
|
|
3061
2939
|
const width = dragRect.right - dragRect.left;
|
|
3062
2940
|
// Note: updating styles will cause re-layout so we have to place them consistently one by one.
|
|
3063
2941
|
dragMaskElement.style.left = left + 'px';
|
|
@@ -3082,8 +2960,8 @@ class GanttBarDrag {
|
|
|
3082
2960
|
this.barElement.style.pointerEvents = '';
|
|
3083
2961
|
this.barElement.classList.remove('gantt-bar-draggable-drag');
|
|
3084
2962
|
}
|
|
3085
|
-
barDragMove(
|
|
3086
|
-
const currentX = this.item.refs.x +
|
|
2963
|
+
barDragMove() {
|
|
2964
|
+
const currentX = this.item.refs.x + this.barDragMoveDistance + this.dragScrollDistance;
|
|
3087
2965
|
const currentDate = this.ganttUpper.view.getDateByXPoint(currentX);
|
|
3088
2966
|
const currentStartX = this.ganttUpper.view.getXPointByDate(currentDate);
|
|
3089
2967
|
const dayWidth = this.ganttUpper.view.getDayOccupancyWidth(currentDate);
|
|
@@ -3094,31 +2972,62 @@ class GanttBarDrag {
|
|
|
3094
2972
|
start = start.addDays(1);
|
|
3095
2973
|
end = end.addDays(1);
|
|
3096
2974
|
}
|
|
3097
|
-
|
|
2975
|
+
if (this.dragScrolling) {
|
|
2976
|
+
const left = currentX - this.barDragMoveDistance;
|
|
2977
|
+
this.barElement.style.left = left + 'px';
|
|
2978
|
+
}
|
|
2979
|
+
this.openDragBackdrop(this.barElement, this.ganttUpper.view.getDateByXPoint(currentX), this.ganttUpper.view.getDateByXPoint(currentX + this.item.refs.width));
|
|
2980
|
+
if (!this.isStartOrEndInsideView(start, end)) {
|
|
2981
|
+
return;
|
|
2982
|
+
}
|
|
3098
2983
|
this.item.updateDate(start, end);
|
|
3099
2984
|
this.dragContainer.dragMoved.emit({ item: this.item.origin });
|
|
3100
2985
|
}
|
|
3101
|
-
|
|
3102
|
-
|
|
3103
|
-
|
|
3104
|
-
|
|
3105
|
-
|
|
3106
|
-
|
|
3107
|
-
|
|
2986
|
+
barBeforeHandleDragMove() {
|
|
2987
|
+
const { x, start, oneDayWidth } = this.startOfBarHandle();
|
|
2988
|
+
const width = this.item.refs.width + this.barHandleDragMoveAndScrollDistance * -1;
|
|
2989
|
+
const days = differenceInDays(this.item.end.value, start.value);
|
|
2990
|
+
if (width > dragMinWidth && days > 0) {
|
|
2991
|
+
this.barElement.style.width = width + 'px';
|
|
2992
|
+
this.barElement.style.left = x + 'px';
|
|
2993
|
+
this.openDragBackdrop(this.barElement, start, this.item.end);
|
|
2994
|
+
if (!this.isStartOrEndInsideView(start, this.item.end)) {
|
|
2995
|
+
return;
|
|
2996
|
+
}
|
|
2997
|
+
this.item.updateDate(start, this.item.end);
|
|
2998
|
+
}
|
|
2999
|
+
else {
|
|
3000
|
+
if (this.barHandleDragMoveRecordDays > 0 && days <= 0) {
|
|
3001
|
+
this.barElement.style.width = oneDayWidth + 'px';
|
|
3002
|
+
const x = this.ganttUpper.view.getXPointByDate(this.item.end);
|
|
3108
3003
|
this.barElement.style.left = x + 'px';
|
|
3109
|
-
this.openDragBackdrop(this.barElement, start, this.item.end);
|
|
3110
|
-
this.item.updateDate(start, this.item.end);
|
|
3111
3004
|
}
|
|
3005
|
+
this.openDragBackdrop(this.barElement, this.item.end.startOfDay(), this.item.end);
|
|
3006
|
+
this.item.updateDate(this.item.end.startOfDay(), this.item.end);
|
|
3007
|
+
}
|
|
3008
|
+
this.barHandleDragMoveRecordDays = days;
|
|
3009
|
+
this.dragContainer.dragMoved.emit({ item: this.item.origin });
|
|
3010
|
+
}
|
|
3011
|
+
barAfterHandleDragMove() {
|
|
3012
|
+
const { width, end } = this.endOfBarHandle();
|
|
3013
|
+
const days = differenceInDays(end.value, this.item.start.value);
|
|
3014
|
+
if (width > dragMinWidth && days > 0) {
|
|
3015
|
+
this.barElement.style.width = width + 'px';
|
|
3016
|
+
this.openDragBackdrop(this.barElement, this.item.start, end);
|
|
3017
|
+
if (!this.isStartOrEndInsideView(this.item.start, end)) {
|
|
3018
|
+
return;
|
|
3019
|
+
}
|
|
3020
|
+
this.item.updateDate(this.item.start, end);
|
|
3112
3021
|
}
|
|
3113
3022
|
else {
|
|
3114
|
-
|
|
3115
|
-
|
|
3116
|
-
|
|
3117
|
-
this.barElement.style.width = width + 'px';
|
|
3118
|
-
this.openDragBackdrop(this.barElement, this.item.start, end);
|
|
3119
|
-
this.item.updateDate(this.item.start, end);
|
|
3023
|
+
if (this.barHandleDragMoveRecordDays > 0 && days <= 0) {
|
|
3024
|
+
const oneDayWidth = this.ganttUpper.view.getDateRangeWidth(this.item.start, this.item.start.endOfDay());
|
|
3025
|
+
this.barElement.style.width = oneDayWidth + 'px';
|
|
3120
3026
|
}
|
|
3027
|
+
this.openDragBackdrop(this.barElement, this.item.start, this.item.start.endOfDay());
|
|
3028
|
+
this.item.updateDate(this.item.start, this.item.start.endOfDay());
|
|
3121
3029
|
}
|
|
3030
|
+
this.barHandleDragMoveRecordDays = days;
|
|
3122
3031
|
this.dragContainer.dragMoved.emit({ item: this.item.origin });
|
|
3123
3032
|
}
|
|
3124
3033
|
calcLinkLinePositions(target, isBefore) {
|
|
@@ -3148,6 +3057,78 @@ class GanttBarDrag {
|
|
|
3148
3057
|
this.linkDraggingLine = null;
|
|
3149
3058
|
}
|
|
3150
3059
|
}
|
|
3060
|
+
startScrollingIfNecessary(pointerX, pointerY) {
|
|
3061
|
+
const clientRect = this.dom.mainContainer.getBoundingClientRect();
|
|
3062
|
+
const scrollLeft = this.dom.mainContainer.scrollLeft;
|
|
3063
|
+
if (isPointerNearClientRect(clientRect, DROP_PROXIMITY_THRESHOLD, pointerX, pointerY)) {
|
|
3064
|
+
const horizontalScrollDirection = getHorizontalScrollDirection(clientRect, pointerX);
|
|
3065
|
+
if ((horizontalScrollDirection === 1 /* AutoScrollHorizontalDirection.LEFT */ && scrollLeft > 0) ||
|
|
3066
|
+
(horizontalScrollDirection === 2 /* AutoScrollHorizontalDirection.RIGHT */ &&
|
|
3067
|
+
scrollLeft < this.ganttUpper.view.width - clientRect.width)) {
|
|
3068
|
+
this._horizontalScrollDirection = horizontalScrollDirection;
|
|
3069
|
+
this.autoScrollSpeedRates = getAutoScrollSpeedRates(clientRect, pointerX, horizontalScrollDirection);
|
|
3070
|
+
this.dragScrolling = true;
|
|
3071
|
+
this._ngZone.runOutsideAngular(this.startScrollInterval);
|
|
3072
|
+
}
|
|
3073
|
+
else {
|
|
3074
|
+
this.dragScrolling = false;
|
|
3075
|
+
this.stopScrolling();
|
|
3076
|
+
}
|
|
3077
|
+
}
|
|
3078
|
+
}
|
|
3079
|
+
// Conditions to stop auto-scroll: when the start is greater than the end and the bar appears in the view
|
|
3080
|
+
isStartGreaterThanEndWhenBarHandleDragMove(isBefore) {
|
|
3081
|
+
let isStartGreaterThanEnd;
|
|
3082
|
+
let isBarAppearsInView;
|
|
3083
|
+
const scrollLeft = this.dom.mainContainer.scrollLeft;
|
|
3084
|
+
const clientWidth = this.dom.mainContainer.clientWidth;
|
|
3085
|
+
const xThreshold = clientWidth * DROP_PROXIMITY_THRESHOLD;
|
|
3086
|
+
if (isBefore) {
|
|
3087
|
+
const { start, oneDayWidth } = this.startOfBarHandle();
|
|
3088
|
+
const xPointerByEndDate = this.ganttUpper.view.getXPointByDate(this.item.end);
|
|
3089
|
+
isStartGreaterThanEnd = start.value > this.item.end.value;
|
|
3090
|
+
isBarAppearsInView = xPointerByEndDate + oneDayWidth + xThreshold <= scrollLeft + clientWidth;
|
|
3091
|
+
}
|
|
3092
|
+
else {
|
|
3093
|
+
const { end } = this.endOfBarHandle();
|
|
3094
|
+
const xPointerByStartDate = this.ganttUpper.view.getXPointByDate(this.item.start);
|
|
3095
|
+
isStartGreaterThanEnd = end.value < this.item.start.value;
|
|
3096
|
+
isBarAppearsInView = scrollLeft + xThreshold <= xPointerByStartDate;
|
|
3097
|
+
}
|
|
3098
|
+
return isStartGreaterThanEnd && isBarAppearsInView ? true : false;
|
|
3099
|
+
}
|
|
3100
|
+
// Some data information about dragging start until it is equal to or greater than end
|
|
3101
|
+
startOfBarHandle() {
|
|
3102
|
+
const x = this.item.refs.x + this.barHandleDragMoveAndScrollDistance;
|
|
3103
|
+
return {
|
|
3104
|
+
x,
|
|
3105
|
+
start: this.ganttUpper.view.getDateByXPoint(x),
|
|
3106
|
+
oneDayWidth: this.ganttUpper.view.getDateRangeWidth(this.item.end.startOfDay(), this.item.end)
|
|
3107
|
+
};
|
|
3108
|
+
}
|
|
3109
|
+
// Some data information about dragging end of bar handle
|
|
3110
|
+
endOfBarHandle() {
|
|
3111
|
+
const width = this.item.refs.width + this.barHandleDragMoveAndScrollDistance;
|
|
3112
|
+
return {
|
|
3113
|
+
width,
|
|
3114
|
+
end: this.ganttUpper.view.getDateByXPoint(this.item.refs.x + width)
|
|
3115
|
+
};
|
|
3116
|
+
}
|
|
3117
|
+
stopScrolling() {
|
|
3118
|
+
this.stopScrollTimers$.next();
|
|
3119
|
+
}
|
|
3120
|
+
isStartOrEndInsideView(start, end) {
|
|
3121
|
+
const itemStart = start.getUnixTime();
|
|
3122
|
+
const itemEnd = end.getUnixTime();
|
|
3123
|
+
const viewStart = this.ganttUpper.view.start.getUnixTime();
|
|
3124
|
+
const viewEnd = this.ganttUpper.view.end.getUnixTime();
|
|
3125
|
+
if (itemStart < viewStart || itemEnd > viewEnd) {
|
|
3126
|
+
return false;
|
|
3127
|
+
}
|
|
3128
|
+
else {
|
|
3129
|
+
return true;
|
|
3130
|
+
}
|
|
3131
|
+
}
|
|
3151
3132
|
createDrags(elementRef, item, ganttUpper) {
|
|
3152
3133
|
this.item = item;
|
|
3153
3134
|
this.barElement = elementRef.nativeElement;
|
|
@@ -3161,13 +3142,6 @@ class GanttBarDrag {
|
|
|
3161
3142
|
const dragRef = this.createBarDrag();
|
|
3162
3143
|
const dragHandlesRefs = this.createBarHandleDrags();
|
|
3163
3144
|
this.dragRefs.push(dragRef, ...dragHandlesRefs);
|
|
3164
|
-
// 创建拖拽容器并将所有元素添加到容器中,利用容器来实现自动滚动
|
|
3165
|
-
if (!this.dropListRef) {
|
|
3166
|
-
this.dropListRef = this.dragDrop.createDropList(this.dom.mainContainer);
|
|
3167
|
-
this.dropListRef.autoScrollStep = autoScrollStep;
|
|
3168
|
-
this.dropListRef.withOrientation('horizontal');
|
|
3169
|
-
}
|
|
3170
|
-
this.dropListRef.withItems([dragRef, ...dragHandlesRefs]);
|
|
3171
3145
|
}
|
|
3172
3146
|
if (!this.linkDragDisabled) {
|
|
3173
3147
|
const linkDragRefs = this.createLinkHandleDrags();
|
|
@@ -3183,15 +3157,15 @@ class GanttBarDrag {
|
|
|
3183
3157
|
this.dragRefs.forEach((dragRef) => dragRef.dispose());
|
|
3184
3158
|
this.destroy$.next();
|
|
3185
3159
|
this.destroy$.complete();
|
|
3160
|
+
this.stopScrolling();
|
|
3161
|
+
this.stopScrollTimers$.complete();
|
|
3186
3162
|
}
|
|
3187
3163
|
}
|
|
3188
|
-
GanttBarDrag.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: GanttBarDrag, deps: [{ token: i2.DragDrop }, { token: GanttDomService }, { token: GanttDragContainer }, { token:
|
|
3164
|
+
GanttBarDrag.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: GanttBarDrag, deps: [{ token: i2.DragDrop }, { token: GanttDomService }, { token: GanttDragContainer }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
3189
3165
|
GanttBarDrag.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: GanttBarDrag });
|
|
3190
3166
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: GanttBarDrag, decorators: [{
|
|
3191
3167
|
type: Injectable
|
|
3192
|
-
}], ctorParameters: function () { return [{ type: i2.DragDrop }, { type: GanttDomService }, { type: GanttDragContainer }, { type:
|
|
3193
|
-
type: SkipSelf
|
|
3194
|
-
}] }]; } });
|
|
3168
|
+
}], ctorParameters: function () { return [{ type: i2.DragDrop }, { type: GanttDomService }, { type: GanttDragContainer }, { type: i0.NgZone }]; } });
|
|
3195
3169
|
|
|
3196
3170
|
class GanttItemUpper {
|
|
3197
3171
|
constructor(elementRef, ganttUpper) {
|
|
@@ -3199,10 +3173,11 @@ class GanttItemUpper {
|
|
|
3199
3173
|
this.ganttUpper = ganttUpper;
|
|
3200
3174
|
this.firstChange = true;
|
|
3201
3175
|
this.unsubscribe$ = new Subject();
|
|
3176
|
+
this.refsUnsubscribe$ = new Subject();
|
|
3202
3177
|
}
|
|
3203
3178
|
ngOnInit() {
|
|
3204
3179
|
this.firstChange = false;
|
|
3205
|
-
this.item.refs$.pipe(takeUntil(this.
|
|
3180
|
+
this.item.refs$.pipe(takeUntil(this.refsUnsubscribe$)).subscribe(() => {
|
|
3206
3181
|
this.setPositions();
|
|
3207
3182
|
});
|
|
3208
3183
|
}
|
|
@@ -3212,11 +3187,10 @@ class GanttItemUpper {
|
|
|
3212
3187
|
}
|
|
3213
3188
|
}
|
|
3214
3189
|
itemChange(item) {
|
|
3215
|
-
this.
|
|
3216
|
-
this.
|
|
3190
|
+
this.refsUnsubscribe$.next();
|
|
3191
|
+
this.refsUnsubscribe$.complete();
|
|
3217
3192
|
this.item = item;
|
|
3218
|
-
this.
|
|
3219
|
-
this.item.refs$.pipe(takeUntil(this.unsubscribe$)).subscribe(() => {
|
|
3193
|
+
this.item.refs$.pipe(takeUntil(this.refsUnsubscribe$)).subscribe(() => {
|
|
3220
3194
|
this.setPositions();
|
|
3221
3195
|
});
|
|
3222
3196
|
}
|
|
@@ -3235,6 +3209,8 @@ class GanttItemUpper {
|
|
|
3235
3209
|
ngOnDestroy() {
|
|
3236
3210
|
this.unsubscribe$.next();
|
|
3237
3211
|
this.unsubscribe$.complete();
|
|
3212
|
+
this.refsUnsubscribe$.next();
|
|
3213
|
+
this.refsUnsubscribe$.complete();
|
|
3238
3214
|
}
|
|
3239
3215
|
}
|
|
3240
3216
|
GanttItemUpper.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: GanttItemUpper, deps: [{ token: i0.ElementRef }, { token: GANTT_UPPER_TOKEN }], target: i0.ɵɵFactoryTarget.Directive });
|
|
@@ -3273,6 +3249,10 @@ class NgxGanttBarComponent extends GanttItemUpper {
|
|
|
3273
3249
|
super.ngOnChanges(changes);
|
|
3274
3250
|
if (!this.firstChange) {
|
|
3275
3251
|
this.drag.updateItem(this.item);
|
|
3252
|
+
if (changes.item.currentValue.refs?.width !== changes.item.previousValue.refs?.width ||
|
|
3253
|
+
changes.item.currentValue.color !== changes.item.previousValue.color) {
|
|
3254
|
+
this.setContentBackground();
|
|
3255
|
+
}
|
|
3276
3256
|
}
|
|
3277
3257
|
}
|
|
3278
3258
|
ngAfterViewInit() {
|
|
@@ -3300,30 +3280,32 @@ class NgxGanttBarComponent extends GanttItemUpper {
|
|
|
3300
3280
|
this.barClick.emit({ event, item: this.item.origin });
|
|
3301
3281
|
}
|
|
3302
3282
|
setContentBackground() {
|
|
3303
|
-
|
|
3304
|
-
|
|
3305
|
-
|
|
3306
|
-
|
|
3307
|
-
|
|
3308
|
-
|
|
3309
|
-
|
|
3310
|
-
|
|
3311
|
-
|
|
3312
|
-
|
|
3313
|
-
|
|
3314
|
-
|
|
3315
|
-
|
|
3316
|
-
|
|
3317
|
-
|
|
3318
|
-
|
|
3319
|
-
|
|
3320
|
-
|
|
3321
|
-
|
|
3322
|
-
|
|
3323
|
-
|
|
3324
|
-
|
|
3325
|
-
|
|
3326
|
-
|
|
3283
|
+
if (this.item.refs?.width) {
|
|
3284
|
+
const contentElement = this.contentElementRef.nativeElement;
|
|
3285
|
+
const color = this.item.color || barBackground;
|
|
3286
|
+
const style = this.item.barStyle || {};
|
|
3287
|
+
if (this.item.origin.start && this.item.origin.end) {
|
|
3288
|
+
style.background = color;
|
|
3289
|
+
style.borderRadius = '';
|
|
3290
|
+
}
|
|
3291
|
+
if (this.item.origin.start && !this.item.origin.end) {
|
|
3292
|
+
style.background = linearGradient('to left', hexToRgb(color, 0.55), hexToRgb(color, 1));
|
|
3293
|
+
style.borderRadius = '4px 12.5px 12.5px 4px';
|
|
3294
|
+
}
|
|
3295
|
+
if (!this.item.origin.start && this.item.origin.end) {
|
|
3296
|
+
style.background = linearGradient('to right', hexToRgb(color, 0.55), hexToRgb(color, 1));
|
|
3297
|
+
style.borderRadius = '12.5px 4px 4px 12.5px';
|
|
3298
|
+
}
|
|
3299
|
+
if (this.item.progress >= 0) {
|
|
3300
|
+
const contentProgressElement = contentElement.querySelector('.gantt-bar-content-progress');
|
|
3301
|
+
style.background = hexToRgb(color, 0.3);
|
|
3302
|
+
style.borderRadius = '';
|
|
3303
|
+
contentProgressElement.style.background = color;
|
|
3304
|
+
}
|
|
3305
|
+
for (const key in style) {
|
|
3306
|
+
if (style.hasOwnProperty(key)) {
|
|
3307
|
+
contentElement.style[key] = style[key];
|
|
3308
|
+
}
|
|
3327
3309
|
}
|
|
3328
3310
|
}
|
|
3329
3311
|
}
|
|
@@ -3332,10 +3314,10 @@ class NgxGanttBarComponent extends GanttItemUpper {
|
|
|
3332
3314
|
}
|
|
3333
3315
|
}
|
|
3334
3316
|
NgxGanttBarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: NgxGanttBarComponent, deps: [{ token: GanttDragContainer }, { token: GanttBarDrag }, { token: i0.ElementRef }, { token: GANTT_UPPER_TOKEN }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
|
|
3335
|
-
NgxGanttBarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.4", type: NgxGanttBarComponent, selector: "ngx-gantt-bar,gantt-bar", outputs: { barClick: "barClick" }, host: { properties: { "class.gantt-bar": "this.ganttItemClass" } }, providers: [GanttBarDrag], viewQueries: [{ propertyName: "contentElementRef", first: true, predicate: ["content"], descendants: true }, { propertyName: "handles", predicate: ["handle"], descendants: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<div class=\"gantt-bar-layer\">\n <div class=\"drag-handles\">\n <ng-container *ngIf=\"item.draggable && ganttUpper.draggable\">\n <span class=\"handle\" #handle></span>\n <span class=\"handle\" #handle></span>\n </ng-container>\n </div>\n <div *ngIf=\"item.linkable && ganttUpper.linkable\" class=\"link-handles\">\n <span class=\"handle\"><span class=\"point\"></span></span>\n <span class=\"handle\"> <span class=\"point\"></span></span>\n </div>\n</div>\n<div class=\"gantt-bar-border\"></div>\n<div #content class=\"gantt-bar-content\" (click)=\"onBarClick($event)\">\n <div class=\"gantt-bar-content-progress\" *ngIf=\"item.progress >= 0\" [style.width.%]=\"item.progress * 100\"></div>\n <ng-template [ngTemplateOutlet]=\"template\" [ngTemplateOutletContext]=\"{ item: item.origin, refs: item.refs }\"
|
|
3317
|
+
NgxGanttBarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.4", type: NgxGanttBarComponent, selector: "ngx-gantt-bar,gantt-bar", outputs: { barClick: "barClick" }, host: { properties: { "class.gantt-bar": "this.ganttItemClass" } }, providers: [GanttBarDrag], viewQueries: [{ propertyName: "contentElementRef", first: true, predicate: ["content"], descendants: true }, { propertyName: "handles", predicate: ["handle"], descendants: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<div class=\"gantt-bar-layer\">\n <div class=\"drag-handles\">\n <ng-container *ngIf=\"item.draggable && ganttUpper.draggable\">\n <span class=\"handle\" #handle></span>\n <span class=\"handle\" #handle></span>\n </ng-container>\n </div>\n <div *ngIf=\"item.linkable && ganttUpper.linkable\" class=\"link-handles\">\n <span class=\"handle\"><span class=\"point\"></span></span>\n <span class=\"handle\"> <span class=\"point\"></span></span>\n </div>\n</div>\n<div class=\"gantt-bar-border\"></div>\n<div #content class=\"gantt-bar-content\" (click)=\"onBarClick($event)\">\n <div class=\"gantt-bar-content-progress\" *ngIf=\"item.progress >= 0\" [style.width.%]=\"item.progress * 100\"></div>\n <ng-template [ngTemplateOutlet]=\"template\" [ngTemplateOutletContext]=\"{ item: item.origin, refs: item.refs }\"> </ng-template>\n</div>\n", dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
|
|
3336
3318
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: NgxGanttBarComponent, decorators: [{
|
|
3337
3319
|
type: Component,
|
|
3338
|
-
args: [{ selector: 'ngx-gantt-bar,gantt-bar', providers: [GanttBarDrag], template: "<div class=\"gantt-bar-layer\">\n <div class=\"drag-handles\">\n <ng-container *ngIf=\"item.draggable && ganttUpper.draggable\">\n <span class=\"handle\" #handle></span>\n <span class=\"handle\" #handle></span>\n </ng-container>\n </div>\n <div *ngIf=\"item.linkable && ganttUpper.linkable\" class=\"link-handles\">\n <span class=\"handle\"><span class=\"point\"></span></span>\n <span class=\"handle\"> <span class=\"point\"></span></span>\n </div>\n</div>\n<div class=\"gantt-bar-border\"></div>\n<div #content class=\"gantt-bar-content\" (click)=\"onBarClick($event)\">\n <div class=\"gantt-bar-content-progress\" *ngIf=\"item.progress >= 0\" [style.width.%]=\"item.progress * 100\"></div>\n <ng-template [ngTemplateOutlet]=\"template\" [ngTemplateOutletContext]=\"{ item: item.origin, refs: item.refs }\"
|
|
3320
|
+
args: [{ selector: 'ngx-gantt-bar,gantt-bar', providers: [GanttBarDrag], template: "<div class=\"gantt-bar-layer\">\n <div class=\"drag-handles\">\n <ng-container *ngIf=\"item.draggable && ganttUpper.draggable\">\n <span class=\"handle\" #handle></span>\n <span class=\"handle\" #handle></span>\n </ng-container>\n </div>\n <div *ngIf=\"item.linkable && ganttUpper.linkable\" class=\"link-handles\">\n <span class=\"handle\"><span class=\"point\"></span></span>\n <span class=\"handle\"> <span class=\"point\"></span></span>\n </div>\n</div>\n<div class=\"gantt-bar-border\"></div>\n<div #content class=\"gantt-bar-content\" (click)=\"onBarClick($event)\">\n <div class=\"gantt-bar-content-progress\" *ngIf=\"item.progress >= 0\" [style.width.%]=\"item.progress * 100\"></div>\n <ng-template [ngTemplateOutlet]=\"template\" [ngTemplateOutletContext]=\"{ item: item.origin, refs: item.refs }\"> </ng-template>\n</div>\n" }]
|
|
3339
3321
|
}], ctorParameters: function () { return [{ type: GanttDragContainer }, { type: GanttBarDrag }, { type: i0.ElementRef }, { type: GanttUpper, decorators: [{
|
|
3340
3322
|
type: Inject,
|
|
3341
3323
|
args: [GANTT_UPPER_TOKEN]
|
|
@@ -3390,59 +3372,176 @@ class NgxGanttBaselineComponent {
|
|
|
3390
3372
|
itemElement.style.width = this.baselineItem.refs.width + 'px';
|
|
3391
3373
|
}
|
|
3392
3374
|
}
|
|
3393
|
-
NgxGanttBaselineComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: NgxGanttBaselineComponent, deps: [{ token: i0.ElementRef }, { token: GANTT_UPPER_TOKEN }], target: i0.ɵɵFactoryTarget.Component });
|
|
3394
|
-
NgxGanttBaselineComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.4", type: NgxGanttBaselineComponent, selector: "ngx-gantt-baseline,gantt-baseline", inputs: { baselineItem: "baselineItem" }, host: { properties: { "class.gantt-baseline": "this.ganttBaselineClass" } }, ngImport: i0, template: "<div #content *ngIf=\"baselineItem\" class=\"baseline-content\"></div>\n", dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
3395
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: NgxGanttBaselineComponent, decorators: [{
|
|
3375
|
+
NgxGanttBaselineComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: NgxGanttBaselineComponent, deps: [{ token: i0.ElementRef }, { token: GANTT_UPPER_TOKEN }], target: i0.ɵɵFactoryTarget.Component });
|
|
3376
|
+
NgxGanttBaselineComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.4", type: NgxGanttBaselineComponent, selector: "ngx-gantt-baseline,gantt-baseline", inputs: { baselineItem: "baselineItem" }, host: { properties: { "class.gantt-baseline": "this.ganttBaselineClass" } }, ngImport: i0, template: "<div #content *ngIf=\"baselineItem\" class=\"baseline-content\"></div>\n", dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
3377
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: NgxGanttBaselineComponent, decorators: [{
|
|
3378
|
+
type: Component,
|
|
3379
|
+
args: [{ selector: 'ngx-gantt-baseline,gantt-baseline', template: "<div #content *ngIf=\"baselineItem\" class=\"baseline-content\"></div>\n" }]
|
|
3380
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: GanttUpper, decorators: [{
|
|
3381
|
+
type: Inject,
|
|
3382
|
+
args: [GANTT_UPPER_TOKEN]
|
|
3383
|
+
}] }]; }, propDecorators: { baselineItem: [{
|
|
3384
|
+
type: Input
|
|
3385
|
+
}], ganttBaselineClass: [{
|
|
3386
|
+
type: HostBinding,
|
|
3387
|
+
args: ['class.gantt-baseline']
|
|
3388
|
+
}] } });
|
|
3389
|
+
|
|
3390
|
+
class GanttMainComponent {
|
|
3391
|
+
constructor(ganttUpper) {
|
|
3392
|
+
this.ganttUpper = ganttUpper;
|
|
3393
|
+
this.barClick = new EventEmitter();
|
|
3394
|
+
this.lineClick = new EventEmitter();
|
|
3395
|
+
this.ganttMainClass = true;
|
|
3396
|
+
}
|
|
3397
|
+
trackBy(index, item) {
|
|
3398
|
+
return item.id || index;
|
|
3399
|
+
}
|
|
3400
|
+
}
|
|
3401
|
+
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 });
|
|
3402
|
+
GanttMainComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.4", type: GanttMainComponent, selector: "gantt-main", inputs: { renderData: "renderData", flatData: "flatData", 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 [groups]=\"groups\" [items]=\"items\" (lineClick)=\"lineClick.emit($event)\"></gantt-links-overlay> -->\n<!-- groups -->\n<!-- <div class=\"gantt-main-groups\" *ngIf=\"groups && groups.length > 0; else itemsTemplate\" [style.width.px]=\"ganttUpper.view.width\">\n <ng-container *ngFor=\"let group of groups; trackBy: trackBy\">\n <div class=\"gantt-group\" [ngClass]=\"group.class\">\n <ng-template [ngTemplateOutlet]=\"groupHeaderTemplate\" [ngTemplateOutletContext]=\"{ group: group }\"></ng-template>\n </div>\n <div *ngIf=\"group.expanded\" class=\"gantt-items\">\n <ng-template [ngTemplateOutlet]=\"ganttItems\" [ngTemplateOutletContext]=\"{ items: group.items }\"></ng-template>\n </div>\n </ng-container>\n</div> -->\n\n<!-- items -->\n<!-- <ng-template #itemsTemplate>\n <div class=\"gantt-main-items\" [style.width.px]=\"ganttUpper.view.width\">\n <ng-template [ngTemplateOutlet]=\"ganttItems\" [ngTemplateOutletContext]=\"{ items: items }\"></ng-template>\n </div>\n</ng-template>\n\n<ng-template #ganttItems let-items=\"items\">\n <ng-container *ngFor=\"let item of items\">\n <div\n class=\"gantt-item\"\n [style.height.px]=\"ganttUpper.styles.lineHeight\"\n [class.gantt-main-item-active]=\"ganttUpper.isSelected(item.id)\"\n >\n <ng-container *ngIf=\"item.type | isGanttCustomItem\">\n <ng-template\n [ngTemplateOutlet]=\"itemTemplate\"\n [ngTemplateOutletContext]=\"{\n item: item.origin,\n refs: item.refs,\n baseline: ganttUpper.baselineItemsMap[item.id]?.origin,\n baselineRefs: ganttUpper.baselineItemsMap[item.id]?.refs\n }\"\n >\n </ng-template>\n </ng-container>\n\n <ng-container *ngIf=\"(item.type | isGanttRangeItem) || (item.type | isGanttBarItem)\">\n <gantt-range *ngIf=\"item.type | isGanttRangeItem\" [template]=\"rangeTemplate\" [item]=\"item\"></gantt-range>\n <gantt-bar *ngIf=\"item.type | isGanttBarItem\" [item]=\"item\" [template]=\"barTemplate\" (barClick)=\"barClick.emit($event)\"></gantt-bar>\n <gantt-baseline *ngIf=\"ganttUpper.baselineItemsMap[item.id]\" [baselineItem]=\"ganttUpper.baselineItemsMap[item.id]\"></gantt-baseline>\n </ng-container>\n </div>\n <ng-template\n *ngIf=\"item.children && item.expanded\"\n [ngTemplateOutlet]=\"ganttItems\"\n [ngTemplateOutletContext]=\"{ items: item.children }\"\n ></ng-template>\n </ng-container>\n</ng-template> -->\n\n<gantt-links-overlay [flatData]=\"flatData\" (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 renderData; 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: ["flatData"], 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" }] });
|
|
3403
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: GanttMainComponent, decorators: [{
|
|
3404
|
+
type: Component,
|
|
3405
|
+
args: [{ selector: 'gantt-main', template: "<!-- <gantt-links-overlay [groups]=\"groups\" [items]=\"items\" (lineClick)=\"lineClick.emit($event)\"></gantt-links-overlay> -->\n<!-- groups -->\n<!-- <div class=\"gantt-main-groups\" *ngIf=\"groups && groups.length > 0; else itemsTemplate\" [style.width.px]=\"ganttUpper.view.width\">\n <ng-container *ngFor=\"let group of groups; trackBy: trackBy\">\n <div class=\"gantt-group\" [ngClass]=\"group.class\">\n <ng-template [ngTemplateOutlet]=\"groupHeaderTemplate\" [ngTemplateOutletContext]=\"{ group: group }\"></ng-template>\n </div>\n <div *ngIf=\"group.expanded\" class=\"gantt-items\">\n <ng-template [ngTemplateOutlet]=\"ganttItems\" [ngTemplateOutletContext]=\"{ items: group.items }\"></ng-template>\n </div>\n </ng-container>\n</div> -->\n\n<!-- items -->\n<!-- <ng-template #itemsTemplate>\n <div class=\"gantt-main-items\" [style.width.px]=\"ganttUpper.view.width\">\n <ng-template [ngTemplateOutlet]=\"ganttItems\" [ngTemplateOutletContext]=\"{ items: items }\"></ng-template>\n </div>\n</ng-template>\n\n<ng-template #ganttItems let-items=\"items\">\n <ng-container *ngFor=\"let item of items\">\n <div\n class=\"gantt-item\"\n [style.height.px]=\"ganttUpper.styles.lineHeight\"\n [class.gantt-main-item-active]=\"ganttUpper.isSelected(item.id)\"\n >\n <ng-container *ngIf=\"item.type | isGanttCustomItem\">\n <ng-template\n [ngTemplateOutlet]=\"itemTemplate\"\n [ngTemplateOutletContext]=\"{\n item: item.origin,\n refs: item.refs,\n baseline: ganttUpper.baselineItemsMap[item.id]?.origin,\n baselineRefs: ganttUpper.baselineItemsMap[item.id]?.refs\n }\"\n >\n </ng-template>\n </ng-container>\n\n <ng-container *ngIf=\"(item.type | isGanttRangeItem) || (item.type | isGanttBarItem)\">\n <gantt-range *ngIf=\"item.type | isGanttRangeItem\" [template]=\"rangeTemplate\" [item]=\"item\"></gantt-range>\n <gantt-bar *ngIf=\"item.type | isGanttBarItem\" [item]=\"item\" [template]=\"barTemplate\" (barClick)=\"barClick.emit($event)\"></gantt-bar>\n <gantt-baseline *ngIf=\"ganttUpper.baselineItemsMap[item.id]\" [baselineItem]=\"ganttUpper.baselineItemsMap[item.id]\"></gantt-baseline>\n </ng-container>\n </div>\n <ng-template\n *ngIf=\"item.children && item.expanded\"\n [ngTemplateOutlet]=\"ganttItems\"\n [ngTemplateOutletContext]=\"{ items: item.children }\"\n ></ng-template>\n </ng-container>\n</ng-template> -->\n\n<gantt-links-overlay [flatData]=\"flatData\" (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 renderData; 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" }]
|
|
3406
|
+
}], ctorParameters: function () { return [{ type: GanttUpper, decorators: [{
|
|
3407
|
+
type: Inject,
|
|
3408
|
+
args: [GANTT_UPPER_TOKEN]
|
|
3409
|
+
}] }]; }, propDecorators: { renderData: [{
|
|
3410
|
+
type: Input
|
|
3411
|
+
}], flatData: [{
|
|
3412
|
+
type: Input
|
|
3413
|
+
}], groupHeaderTemplate: [{
|
|
3414
|
+
type: Input
|
|
3415
|
+
}], itemTemplate: [{
|
|
3416
|
+
type: Input
|
|
3417
|
+
}], barTemplate: [{
|
|
3418
|
+
type: Input
|
|
3419
|
+
}], rangeTemplate: [{
|
|
3420
|
+
type: Input
|
|
3421
|
+
}], barClick: [{
|
|
3422
|
+
type: Output
|
|
3423
|
+
}], lineClick: [{
|
|
3424
|
+
type: Output
|
|
3425
|
+
}], ganttMainClass: [{
|
|
3426
|
+
type: HostBinding,
|
|
3427
|
+
args: ['class.gantt-main-container']
|
|
3428
|
+
}] } });
|
|
3429
|
+
|
|
3430
|
+
class GanttCalendarHeaderComponent {
|
|
3431
|
+
get view() {
|
|
3432
|
+
return this.ganttUpper.view;
|
|
3433
|
+
}
|
|
3434
|
+
constructor(ganttUpper, ngZone, elementRef) {
|
|
3435
|
+
this.ganttUpper = ganttUpper;
|
|
3436
|
+
this.ngZone = ngZone;
|
|
3437
|
+
this.elementRef = elementRef;
|
|
3438
|
+
this.unsubscribe$ = new Subject();
|
|
3439
|
+
this.headerHeight = headerHeight;
|
|
3440
|
+
this.viewTypes = GanttViewType;
|
|
3441
|
+
this.className = `gantt-calendar gantt-calendar-header`;
|
|
3442
|
+
}
|
|
3443
|
+
ngOnInit() {
|
|
3444
|
+
this.ngZone.onStable.pipe(take(1)).subscribe(() => {
|
|
3445
|
+
merge(this.ganttUpper.viewChange, this.ganttUpper.view.start$)
|
|
3446
|
+
.pipe(takeUntil(this.unsubscribe$))
|
|
3447
|
+
.subscribe(() => {
|
|
3448
|
+
if (this.ganttUpper.viewType === GanttViewType.day)
|
|
3449
|
+
this.setTodayPoint();
|
|
3450
|
+
});
|
|
3451
|
+
});
|
|
3452
|
+
}
|
|
3453
|
+
setTodayPoint() {
|
|
3454
|
+
const x = this.view.getTodayXPoint();
|
|
3455
|
+
const today = new GanttDate().getDate();
|
|
3456
|
+
const todayEle = this.elementRef.nativeElement.getElementsByClassName('gantt-calendar-today-overlay')[0];
|
|
3457
|
+
const rect = this.elementRef.nativeElement.getElementsByClassName('today-rect')[0];
|
|
3458
|
+
if (isNumber(x)) {
|
|
3459
|
+
if (rect) {
|
|
3460
|
+
rect.style.left = `${x - todayWidth / 2}px`;
|
|
3461
|
+
rect.style.top = `${headerHeight - todayHeight}px`;
|
|
3462
|
+
rect.innerHTML = today.toString();
|
|
3463
|
+
}
|
|
3464
|
+
}
|
|
3465
|
+
else {
|
|
3466
|
+
todayEle.style.display = 'none';
|
|
3467
|
+
}
|
|
3468
|
+
}
|
|
3469
|
+
trackBy(point, index) {
|
|
3470
|
+
return point.text || index;
|
|
3471
|
+
}
|
|
3472
|
+
}
|
|
3473
|
+
GanttCalendarHeaderComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: GanttCalendarHeaderComponent, deps: [{ token: GANTT_UPPER_TOKEN }, { token: i0.NgZone }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
3474
|
+
GanttCalendarHeaderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.4", type: GanttCalendarHeaderComponent, selector: "gantt-calendar-header", host: { properties: { "class": "this.className" } }, ngImport: i0, template: "<div class=\"gantt-calendar-today-overlay\" [style.width.px]=\"view.width\">\n <span class=\"today-rect\" [hidden]=\"ganttUpper.viewType !== viewTypes.day\"> </span>\n</div>\n<svg [attr.width]=\"view.width\" [attr.height]=\"headerHeight\">\n <g>\n <text\n class=\"primary-text\"\n [ngStyle]=\"point.style\"\n [class.today]=\"point.additions?.isToday\"\n [class.weekend]=\"point.additions?.isWeekend\"\n *ngFor=\"let point of view.primaryDatePoints; trackBy: trackBy\"\n [attr.x]=\"point.x\"\n [attr.y]=\"point.y\"\n >\n {{ point.text }}\n </text>\n <ng-container *ngFor=\"let point of view.secondaryDatePoints; trackBy: trackBy\">\n <text\n class=\"secondary-text\"\n [ngStyle]=\"point.style\"\n [class.today]=\"point.additions?.isToday\"\n [class.weekend]=\"point.additions?.isWeekend\"\n [attr.x]=\"point.x\"\n [attr.y]=\"point.y\"\n >\n {{ point.text }}\n </text>\n </ng-container>\n\n <g>\n <line\n *ngFor=\"let point of view.primaryDatePoints; let i = index; trackBy: trackBy\"\n [attr.x1]=\"(i + 1) * view.primaryWidth\"\n [attr.x2]=\"(i + 1) * view.primaryWidth\"\n [attr.y1]=\"0\"\n [attr.y2]=\"headerHeight\"\n class=\"primary-line\"\n ></line>\n </g>\n\n <g>\n <line [attr.x1]=\"0\" [attr.x2]=\"view.width\" [attr.y1]=\"headerHeight\" [attr.y2]=\"headerHeight\" class=\"header-line\"></line>\n </g>\n </g>\n</svg>\n", dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }] });
|
|
3475
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: GanttCalendarHeaderComponent, decorators: [{
|
|
3396
3476
|
type: Component,
|
|
3397
|
-
args: [{ selector: '
|
|
3398
|
-
}], ctorParameters: function () { return [{ type:
|
|
3477
|
+
args: [{ selector: 'gantt-calendar-header', template: "<div class=\"gantt-calendar-today-overlay\" [style.width.px]=\"view.width\">\n <span class=\"today-rect\" [hidden]=\"ganttUpper.viewType !== viewTypes.day\"> </span>\n</div>\n<svg [attr.width]=\"view.width\" [attr.height]=\"headerHeight\">\n <g>\n <text\n class=\"primary-text\"\n [ngStyle]=\"point.style\"\n [class.today]=\"point.additions?.isToday\"\n [class.weekend]=\"point.additions?.isWeekend\"\n *ngFor=\"let point of view.primaryDatePoints; trackBy: trackBy\"\n [attr.x]=\"point.x\"\n [attr.y]=\"point.y\"\n >\n {{ point.text }}\n </text>\n <ng-container *ngFor=\"let point of view.secondaryDatePoints; trackBy: trackBy\">\n <text\n class=\"secondary-text\"\n [ngStyle]=\"point.style\"\n [class.today]=\"point.additions?.isToday\"\n [class.weekend]=\"point.additions?.isWeekend\"\n [attr.x]=\"point.x\"\n [attr.y]=\"point.y\"\n >\n {{ point.text }}\n </text>\n </ng-container>\n\n <g>\n <line\n *ngFor=\"let point of view.primaryDatePoints; let i = index; trackBy: trackBy\"\n [attr.x1]=\"(i + 1) * view.primaryWidth\"\n [attr.x2]=\"(i + 1) * view.primaryWidth\"\n [attr.y1]=\"0\"\n [attr.y2]=\"headerHeight\"\n class=\"primary-line\"\n ></line>\n </g>\n\n <g>\n <line [attr.x1]=\"0\" [attr.x2]=\"view.width\" [attr.y1]=\"headerHeight\" [attr.y2]=\"headerHeight\" class=\"header-line\"></line>\n </g>\n </g>\n</svg>\n" }]
|
|
3478
|
+
}], ctorParameters: function () { return [{ type: GanttUpper, decorators: [{
|
|
3399
3479
|
type: Inject,
|
|
3400
3480
|
args: [GANTT_UPPER_TOKEN]
|
|
3401
|
-
}] }]; }, propDecorators: {
|
|
3402
|
-
type: Input
|
|
3403
|
-
}], ganttBaselineClass: [{
|
|
3481
|
+
}] }, { type: i0.NgZone }, { type: i0.ElementRef }]; }, propDecorators: { className: [{
|
|
3404
3482
|
type: HostBinding,
|
|
3405
|
-
args: ['class
|
|
3483
|
+
args: ['class']
|
|
3406
3484
|
}] } });
|
|
3407
3485
|
|
|
3408
|
-
|
|
3409
|
-
|
|
3486
|
+
const mainHeight = 5000;
|
|
3487
|
+
class GanttCalendarGridComponent {
|
|
3488
|
+
get view() {
|
|
3489
|
+
return this.ganttUpper.view;
|
|
3490
|
+
}
|
|
3491
|
+
constructor(ganttUpper, ngZone, elementRef) {
|
|
3410
3492
|
this.ganttUpper = ganttUpper;
|
|
3411
|
-
this.
|
|
3412
|
-
this.
|
|
3413
|
-
this.
|
|
3493
|
+
this.ngZone = ngZone;
|
|
3494
|
+
this.elementRef = elementRef;
|
|
3495
|
+
this.unsubscribe$ = new Subject();
|
|
3496
|
+
this.headerHeight = headerHeight;
|
|
3497
|
+
this.mainHeight = mainHeight;
|
|
3498
|
+
this.todayBorderRadius = todayBorderRadius;
|
|
3499
|
+
this.viewTypes = GanttViewType;
|
|
3500
|
+
this.className = `gantt-calendar gantt-calendar-grid`;
|
|
3414
3501
|
}
|
|
3415
|
-
|
|
3416
|
-
|
|
3502
|
+
setTodayPoint() {
|
|
3503
|
+
const x = this.view.getTodayXPoint();
|
|
3504
|
+
const todayEle = this.elementRef.nativeElement.getElementsByClassName('gantt-calendar-today-overlay')[0];
|
|
3505
|
+
const line = this.elementRef.nativeElement.getElementsByClassName('today-line')[0];
|
|
3506
|
+
if (isNumber(x)) {
|
|
3507
|
+
if (line) {
|
|
3508
|
+
line.style.left = `${x}px`;
|
|
3509
|
+
line.style.top = `0px`;
|
|
3510
|
+
line.style.bottom = `${-mainHeight}px`;
|
|
3511
|
+
}
|
|
3512
|
+
}
|
|
3513
|
+
else {
|
|
3514
|
+
todayEle.style.display = 'none';
|
|
3515
|
+
}
|
|
3516
|
+
}
|
|
3517
|
+
ngOnInit() {
|
|
3518
|
+
this.ngZone.onStable.pipe(take(1)).subscribe(() => {
|
|
3519
|
+
merge(this.ganttUpper.viewChange, this.ganttUpper.view.start$)
|
|
3520
|
+
.pipe(takeUntil(this.unsubscribe$))
|
|
3521
|
+
.subscribe(() => {
|
|
3522
|
+
this.setTodayPoint();
|
|
3523
|
+
});
|
|
3524
|
+
});
|
|
3525
|
+
}
|
|
3526
|
+
trackBy(point, index) {
|
|
3527
|
+
return point.text || index;
|
|
3528
|
+
}
|
|
3529
|
+
ngOnDestroy() {
|
|
3530
|
+
this.unsubscribe$.next();
|
|
3531
|
+
this.unsubscribe$.complete();
|
|
3417
3532
|
}
|
|
3418
3533
|
}
|
|
3419
|
-
|
|
3420
|
-
|
|
3421
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type:
|
|
3534
|
+
GanttCalendarGridComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: GanttCalendarGridComponent, deps: [{ token: GANTT_UPPER_TOKEN }, { token: i0.NgZone }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
3535
|
+
GanttCalendarGridComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.4", type: GanttCalendarGridComponent, selector: "gantt-calendar-grid", host: { properties: { "class": "this.className" } }, ngImport: i0, template: "<div class=\"gantt-calendar-today-overlay\" [style.width.px]=\"view.width\">\n <span class=\"today-line\" *ngIf=\"ganttUpper.showTodayLine\"> </span>\n</div>\n\n<svg class=\"gantt-calendar-grid-main\" [attr.width]=\"view.width\" [attr.height]=\"headerHeight - 1\">\n <g>\n <g *ngIf=\"view.showTimeline\">\n <line\n *ngFor=\"let point of view.secondaryDatePoints; let i = index; trackBy: trackBy\"\n [attr.x1]=\"(i + 1) * view.cellWidth\"\n [attr.x2]=\"(i + 1) * view.cellWidth\"\n [attr.y1]=\"0\"\n [attr.y2]=\"mainHeight\"\n class=\"secondary-line\"\n ></line>\n </g>\n <g>\n <line\n *ngFor=\"let point of view.primaryDatePoints; let i = index; trackBy: trackBy\"\n [attr.x1]=\"(i + 1) * view.primaryWidth\"\n [attr.x2]=\"(i + 1) * view.primaryWidth\"\n [attr.y1]=\"0\"\n [attr.y2]=\"mainHeight\"\n class=\"primary-line\"\n ></line>\n </g>\n </g>\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"] }] });
|
|
3536
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: GanttCalendarGridComponent, decorators: [{
|
|
3422
3537
|
type: Component,
|
|
3423
|
-
args: [{ selector: 'gantt-
|
|
3538
|
+
args: [{ selector: 'gantt-calendar-grid', template: "<div class=\"gantt-calendar-today-overlay\" [style.width.px]=\"view.width\">\n <span class=\"today-line\" *ngIf=\"ganttUpper.showTodayLine\"> </span>\n</div>\n\n<svg class=\"gantt-calendar-grid-main\" [attr.width]=\"view.width\" [attr.height]=\"headerHeight - 1\">\n <g>\n <g *ngIf=\"view.showTimeline\">\n <line\n *ngFor=\"let point of view.secondaryDatePoints; let i = index; trackBy: trackBy\"\n [attr.x1]=\"(i + 1) * view.cellWidth\"\n [attr.x2]=\"(i + 1) * view.cellWidth\"\n [attr.y1]=\"0\"\n [attr.y2]=\"mainHeight\"\n class=\"secondary-line\"\n ></line>\n </g>\n <g>\n <line\n *ngFor=\"let point of view.primaryDatePoints; let i = index; trackBy: trackBy\"\n [attr.x1]=\"(i + 1) * view.primaryWidth\"\n [attr.x2]=\"(i + 1) * view.primaryWidth\"\n [attr.y1]=\"0\"\n [attr.y2]=\"mainHeight\"\n class=\"primary-line\"\n ></line>\n </g>\n </g>\n</svg>\n" }]
|
|
3424
3539
|
}], ctorParameters: function () { return [{ type: GanttUpper, decorators: [{
|
|
3425
3540
|
type: Inject,
|
|
3426
3541
|
args: [GANTT_UPPER_TOKEN]
|
|
3427
|
-
}] }]; }, propDecorators: {
|
|
3428
|
-
type: Input
|
|
3429
|
-
}], flatData: [{
|
|
3430
|
-
type: Input
|
|
3431
|
-
}], groupHeaderTemplate: [{
|
|
3432
|
-
type: Input
|
|
3433
|
-
}], itemTemplate: [{
|
|
3434
|
-
type: Input
|
|
3435
|
-
}], barTemplate: [{
|
|
3436
|
-
type: Input
|
|
3437
|
-
}], rangeTemplate: [{
|
|
3438
|
-
type: Input
|
|
3439
|
-
}], barClick: [{
|
|
3440
|
-
type: Output
|
|
3441
|
-
}], lineClick: [{
|
|
3442
|
-
type: Output
|
|
3443
|
-
}], ganttMainClass: [{
|
|
3542
|
+
}] }, { type: i0.NgZone }, { type: i0.ElementRef }]; }, propDecorators: { className: [{
|
|
3444
3543
|
type: HostBinding,
|
|
3445
|
-
args: ['class
|
|
3544
|
+
args: ['class']
|
|
3446
3545
|
}] } });
|
|
3447
3546
|
|
|
3448
3547
|
class GanttLoaderComponent {
|
|
@@ -3472,6 +3571,166 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImpor
|
|
|
3472
3571
|
}]
|
|
3473
3572
|
}] });
|
|
3474
3573
|
|
|
3574
|
+
class GanttDragBackdropComponent {
|
|
3575
|
+
}
|
|
3576
|
+
GanttDragBackdropComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: GanttDragBackdropComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3577
|
+
GanttDragBackdropComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.4", type: GanttDragBackdropComponent, selector: "gantt-drag-backdrop", host: { classAttribute: "gantt-drag-backdrop" }, ngImport: i0, template: "<div class=\"gantt-drag-mask\">\n <div class=\"date-range\">\n <span class=\"start\"></span>\n <span class=\"end\"></span>\n </div>\n</div>\n" });
|
|
3578
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: GanttDragBackdropComponent, decorators: [{
|
|
3579
|
+
type: Component,
|
|
3580
|
+
args: [{ selector: 'gantt-drag-backdrop', host: {
|
|
3581
|
+
class: 'gantt-drag-backdrop'
|
|
3582
|
+
}, template: "<div class=\"gantt-drag-mask\">\n <div class=\"date-range\">\n <span class=\"start\"></span>\n <span class=\"end\"></span>\n </div>\n</div>\n" }]
|
|
3583
|
+
}] });
|
|
3584
|
+
|
|
3585
|
+
class NgxGanttToolbarComponent {
|
|
3586
|
+
constructor(ganttUpper) {
|
|
3587
|
+
this.ganttUpper = ganttUpper;
|
|
3588
|
+
this.ganttItemClass = true;
|
|
3589
|
+
this.ganttViewsMap = keyBy(ganttViews, 'value');
|
|
3590
|
+
}
|
|
3591
|
+
selectView(view) {
|
|
3592
|
+
this.ganttUpper.changeView(view);
|
|
3593
|
+
}
|
|
3594
|
+
}
|
|
3595
|
+
NgxGanttToolbarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: NgxGanttToolbarComponent, deps: [{ token: GANTT_UPPER_TOKEN }], target: i0.ɵɵFactoryTarget.Component });
|
|
3596
|
+
NgxGanttToolbarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.4", type: NgxGanttToolbarComponent, selector: "ngx-gantt-toolbar,gantt-toolbar", inputs: { template: "template" }, host: { properties: { "class.gantt-toolbar": "this.ganttItemClass" } }, ngImport: i0, template: "<div class=\"toolbar-container\">\n <ng-container *ngIf=\"!template\">\n <div class=\"toolbar-views\" *ngIf=\"this.ganttUpper.toolbarOptions?.viewTypes?.length\">\n <ng-container *ngFor=\"let view of this.ganttUpper.toolbarOptions?.viewTypes\">\n <div class=\"toolbar-view\" *ngIf=\"ganttViewsMap[view]\" [class.active]=\"view === this.ganttUpper.viewType\" (click)=\"selectView(view)\">\n {{ ganttViewsMap[view].name }}\n </div>\n </ng-container>\n </div>\n </ng-container>\n <ng-template [ngTemplateOutlet]=\"template\"></ng-template>\n</div>\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"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
|
|
3597
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: NgxGanttToolbarComponent, decorators: [{
|
|
3598
|
+
type: Component,
|
|
3599
|
+
args: [{ selector: 'ngx-gantt-toolbar,gantt-toolbar', template: "<div class=\"toolbar-container\">\n <ng-container *ngIf=\"!template\">\n <div class=\"toolbar-views\" *ngIf=\"this.ganttUpper.toolbarOptions?.viewTypes?.length\">\n <ng-container *ngFor=\"let view of this.ganttUpper.toolbarOptions?.viewTypes\">\n <div class=\"toolbar-view\" *ngIf=\"ganttViewsMap[view]\" [class.active]=\"view === this.ganttUpper.viewType\" (click)=\"selectView(view)\">\n {{ ganttViewsMap[view].name }}\n </div>\n </ng-container>\n </div>\n </ng-container>\n <ng-template [ngTemplateOutlet]=\"template\"></ng-template>\n</div>\n" }]
|
|
3600
|
+
}], ctorParameters: function () { return [{ type: GanttUpper, decorators: [{
|
|
3601
|
+
type: Inject,
|
|
3602
|
+
args: [GANTT_UPPER_TOKEN]
|
|
3603
|
+
}] }]; }, propDecorators: { template: [{
|
|
3604
|
+
type: Input
|
|
3605
|
+
}], ganttItemClass: [{
|
|
3606
|
+
type: HostBinding,
|
|
3607
|
+
args: ['class.gantt-toolbar']
|
|
3608
|
+
}] } });
|
|
3609
|
+
|
|
3610
|
+
class NgxGanttRootComponent {
|
|
3611
|
+
get view() {
|
|
3612
|
+
return this.ganttUpper.view;
|
|
3613
|
+
}
|
|
3614
|
+
constructor(elementRef, ngZone, dom, dragContainer, ganttUpper, printService) {
|
|
3615
|
+
this.elementRef = elementRef;
|
|
3616
|
+
this.ngZone = ngZone;
|
|
3617
|
+
this.dom = dom;
|
|
3618
|
+
this.dragContainer = dragContainer;
|
|
3619
|
+
this.ganttUpper = ganttUpper;
|
|
3620
|
+
this.printService = printService;
|
|
3621
|
+
this.unsubscribe$ = new Subject();
|
|
3622
|
+
this.ganttUpper.dragContainer = dragContainer;
|
|
3623
|
+
}
|
|
3624
|
+
ngOnInit() {
|
|
3625
|
+
// Note: the zone may be nooped through `BootstrapOptions` when bootstrapping the root module. This means
|
|
3626
|
+
// the `onStable` will never emit any value.
|
|
3627
|
+
const onStable$ = this.ngZone.isStable ? from(Promise.resolve()) : this.ngZone.onStable.pipe(take(1));
|
|
3628
|
+
// Normally this isn't in the zone, but it can cause performance regressions for apps
|
|
3629
|
+
// using `zone-patch-rxjs` because it'll trigger a change detection when it unsubscribes.
|
|
3630
|
+
this.ngZone.runOutsideAngular(() => {
|
|
3631
|
+
onStable$.pipe(takeUntil(this.unsubscribe$)).subscribe(() => {
|
|
3632
|
+
this.dom.initialize(this.elementRef);
|
|
3633
|
+
if (this.printService) {
|
|
3634
|
+
this.printService.register(this.elementRef);
|
|
3635
|
+
}
|
|
3636
|
+
this.setupScrollClass();
|
|
3637
|
+
this.setupResize();
|
|
3638
|
+
this.setupViewScroll();
|
|
3639
|
+
// 优化初始化时Scroll滚动体验问题,通过透明度解决,默认透明度为0,滚动结束后恢复
|
|
3640
|
+
this.elementRef.nativeElement.style.opacity = '1';
|
|
3641
|
+
this.ganttUpper.viewChange.pipe(startWith$1(null), takeUntil(this.unsubscribe$)).subscribe(() => {
|
|
3642
|
+
this.scrollToToday();
|
|
3643
|
+
});
|
|
3644
|
+
});
|
|
3645
|
+
});
|
|
3646
|
+
}
|
|
3647
|
+
ngOnDestroy() {
|
|
3648
|
+
this.unsubscribe$.next();
|
|
3649
|
+
}
|
|
3650
|
+
setupViewScroll() {
|
|
3651
|
+
if (this.ganttUpper.disabledLoadOnScroll) {
|
|
3652
|
+
return;
|
|
3653
|
+
}
|
|
3654
|
+
this.dom
|
|
3655
|
+
.getViewerScroll(passiveListenerOptions)
|
|
3656
|
+
.pipe(takeUntil(this.unsubscribe$))
|
|
3657
|
+
.subscribe((event) => {
|
|
3658
|
+
if (event.direction === ScrollDirection.LEFT) {
|
|
3659
|
+
const dates = this.view.addStartDate();
|
|
3660
|
+
if (dates) {
|
|
3661
|
+
event.target.scrollLeft += this.view.getDateRangeWidth(dates.start, dates.end);
|
|
3662
|
+
if (this.ganttUpper.loadOnScroll.observers) {
|
|
3663
|
+
this.ngZone.run(() => this.ganttUpper.loadOnScroll.emit({ start: dates.start.getUnixTime(), end: dates.end.getUnixTime() }));
|
|
3664
|
+
}
|
|
3665
|
+
}
|
|
3666
|
+
}
|
|
3667
|
+
if (event.direction === ScrollDirection.RIGHT) {
|
|
3668
|
+
const dates = this.view.addEndDate();
|
|
3669
|
+
if (dates && this.ganttUpper.loadOnScroll.observers) {
|
|
3670
|
+
this.ngZone.run(() => this.ganttUpper.loadOnScroll.emit({ start: dates.start.getUnixTime(), end: dates.end.getUnixTime() }));
|
|
3671
|
+
}
|
|
3672
|
+
}
|
|
3673
|
+
});
|
|
3674
|
+
}
|
|
3675
|
+
setupResize() {
|
|
3676
|
+
this.dom
|
|
3677
|
+
.getResize()
|
|
3678
|
+
.pipe(takeUntil(this.unsubscribe$))
|
|
3679
|
+
.subscribe(() => {
|
|
3680
|
+
this.setupScrollClass();
|
|
3681
|
+
});
|
|
3682
|
+
}
|
|
3683
|
+
setupScrollClass() {
|
|
3684
|
+
const mainContainer = this.dom.mainContainer;
|
|
3685
|
+
const height = mainContainer.offsetHeight;
|
|
3686
|
+
const scrollHeight = mainContainer.scrollHeight;
|
|
3687
|
+
if (scrollHeight > height) {
|
|
3688
|
+
this.elementRef.nativeElement.className = 'gantt gantt-scroll';
|
|
3689
|
+
}
|
|
3690
|
+
else {
|
|
3691
|
+
this.elementRef.nativeElement.className = 'gantt';
|
|
3692
|
+
}
|
|
3693
|
+
}
|
|
3694
|
+
scrollToToday() {
|
|
3695
|
+
const x = this.view.getTodayXPoint();
|
|
3696
|
+
this.dom.scrollMainContainer(x);
|
|
3697
|
+
}
|
|
3698
|
+
scrollToDate(date) {
|
|
3699
|
+
let x;
|
|
3700
|
+
if (typeof date === 'number') {
|
|
3701
|
+
x = this.view.getXPointByDate(new GanttDate(date));
|
|
3702
|
+
}
|
|
3703
|
+
else {
|
|
3704
|
+
x = this.view.getXPointByDate(date);
|
|
3705
|
+
}
|
|
3706
|
+
this.dom.scrollMainContainer(x);
|
|
3707
|
+
}
|
|
3708
|
+
}
|
|
3709
|
+
NgxGanttRootComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: NgxGanttRootComponent, deps: [{ token: i0.ElementRef }, { token: i0.NgZone }, { token: GanttDomService }, { token: GanttDragContainer }, { token: GANTT_UPPER_TOKEN }, { token: GanttPrintService, optional: true }], target: i0.ɵɵFactoryTarget.Component });
|
|
3710
|
+
NgxGanttRootComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.4", type: NgxGanttRootComponent, selector: "ngx-gantt-root", inputs: { sideWidth: "sideWidth" }, host: { classAttribute: "gantt" }, providers: [GanttDomService, GanttDragContainer], queries: [{ propertyName: "sideTemplate", first: true, predicate: ["sideTemplate"], descendants: true, static: true }, { propertyName: "mainTemplate", first: true, predicate: ["mainTemplate"], descendants: true, static: true }], viewQueries: [{ propertyName: "backdrop", first: true, predicate: GanttDragBackdropComponent, descendants: true, read: ElementRef, static: true }], ngImport: i0, template: "<div class=\"gantt-side\" *ngIf=\"sideTemplate\" [style.width.px]=\"sideWidth\">\n <div class=\"gantt-side-container\" cdkScrollable>\n <ng-template [ngTemplateOutlet]=\"sideTemplate\"></ng-template>\n </div>\n</div>\n<div class=\"gantt-container\" *ngIf=\"mainTemplate\">\n <gantt-calendar-header></gantt-calendar-header>\n <gantt-calendar-grid></gantt-calendar-grid>\n <gantt-drag-backdrop></gantt-drag-backdrop>\n <div class=\"gantt-main\">\n <ng-template [ngTemplateOutlet]=\"mainTemplate\"></ng-template>\n </div>\n</div>\n<ng-content></ng-content>\n<gantt-toolbar *ngIf=\"ganttUpper.showToolbar || ganttUpper.toolbarTemplate\" [template]=\"ganttUpper.toolbarTemplate\"> </gantt-toolbar>\n", dependencies: [{ 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: i3.CdkScrollable, selector: "[cdk-scrollable], [cdkScrollable]" }, { kind: "component", type: GanttCalendarHeaderComponent, selector: "gantt-calendar-header" }, { kind: "component", type: GanttCalendarGridComponent, selector: "gantt-calendar-grid" }, { kind: "component", type: GanttDragBackdropComponent, selector: "gantt-drag-backdrop" }, { kind: "component", type: NgxGanttToolbarComponent, selector: "ngx-gantt-toolbar,gantt-toolbar", inputs: ["template"] }] });
|
|
3711
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: NgxGanttRootComponent, decorators: [{
|
|
3712
|
+
type: Component,
|
|
3713
|
+
args: [{ selector: 'ngx-gantt-root', providers: [GanttDomService, GanttDragContainer], host: {
|
|
3714
|
+
class: 'gantt'
|
|
3715
|
+
}, template: "<div class=\"gantt-side\" *ngIf=\"sideTemplate\" [style.width.px]=\"sideWidth\">\n <div class=\"gantt-side-container\" cdkScrollable>\n <ng-template [ngTemplateOutlet]=\"sideTemplate\"></ng-template>\n </div>\n</div>\n<div class=\"gantt-container\" *ngIf=\"mainTemplate\">\n <gantt-calendar-header></gantt-calendar-header>\n <gantt-calendar-grid></gantt-calendar-grid>\n <gantt-drag-backdrop></gantt-drag-backdrop>\n <div class=\"gantt-main\">\n <ng-template [ngTemplateOutlet]=\"mainTemplate\"></ng-template>\n </div>\n</div>\n<ng-content></ng-content>\n<gantt-toolbar *ngIf=\"ganttUpper.showToolbar || ganttUpper.toolbarTemplate\" [template]=\"ganttUpper.toolbarTemplate\"> </gantt-toolbar>\n" }]
|
|
3716
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.NgZone }, { type: GanttDomService }, { type: GanttDragContainer }, { type: GanttUpper, decorators: [{
|
|
3717
|
+
type: Inject,
|
|
3718
|
+
args: [GANTT_UPPER_TOKEN]
|
|
3719
|
+
}] }, { type: GanttPrintService, decorators: [{
|
|
3720
|
+
type: Optional
|
|
3721
|
+
}] }]; }, propDecorators: { sideWidth: [{
|
|
3722
|
+
type: Input
|
|
3723
|
+
}], sideTemplate: [{
|
|
3724
|
+
type: ContentChild,
|
|
3725
|
+
args: ['sideTemplate', { static: true }]
|
|
3726
|
+
}], mainTemplate: [{
|
|
3727
|
+
type: ContentChild,
|
|
3728
|
+
args: ['mainTemplate', { static: true }]
|
|
3729
|
+
}], backdrop: [{
|
|
3730
|
+
type: ViewChild,
|
|
3731
|
+
args: [GanttDragBackdropComponent, { static: true, read: ElementRef }]
|
|
3732
|
+
}] } });
|
|
3733
|
+
|
|
3475
3734
|
class NgxGanttComponent extends GanttUpper {
|
|
3476
3735
|
set loading(loading) {
|
|
3477
3736
|
if (loading) {
|
|
@@ -3672,7 +3931,7 @@ NgxGanttComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", vers
|
|
|
3672
3931
|
provide: GANTT_ABSTRACT_TOKEN,
|
|
3673
3932
|
useExisting: forwardRef(() => NgxGanttComponent)
|
|
3674
3933
|
}
|
|
3675
|
-
], queries: [{ propertyName: "table", first: true, predicate: NgxGanttTableComponent, descendants: true }, { propertyName: "tableEmptyTemplate", first: true, predicate: ["tableEmpty"], descendants: true, static: true }, { propertyName: "columns", predicate: NgxGanttTableColumnComponent, descendants: true }], viewQueries: [{ propertyName: "ganttRoot", first: true, predicate: ["ganttRoot"], descendants: true }, { propertyName: "virtualScroll", first: true, predicate: CdkVirtualScrollViewport, descendants: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<ngx-gantt-root #ganttRoot>\n <div class=\"gantt-header\">\n <gantt-table-header #tableHeader [columns]=\"columns\"></gantt-table-header>\n <div class=\"gantt-container-header\">\n <gantt-calendar-header></gantt-calendar-header>\n </div>\n </div>\n <gantt-loader *ngIf=\"loading\"></gantt-loader>\n <cdk-virtual-scroll-viewport\n class=\"gantt-virtual-scroll-viewport\"\n [itemSize]=\"styles.lineHeight\"\n [minBufferPx]=\"styles.lineHeight * 10\"\n [maxBufferPx]=\"styles.lineHeight * 20\"\n >\n <ng-container *cdkVirtualFor=\"let item of flatData; trackBy: trackBy\"></ng-container>\n <div class=\"gantt-side\" [style.width.px]=\"tableHeader.tableWidth + 1\">\n <div class=\"gantt-side-container\">\n <div class=\"gantt-table\">\n <gantt-table-body\n [flatData]=\"flatData\"\n [renderData]=\"renderData\"\n [columns]=\"columns\"\n [groupTemplate]=\"groupTemplate\"\n [emptyTemplate]=\"tableEmptyTemplate\"\n [rowBeforeTemplate]=\"table?.rowBeforeTemplate\"\n [rowAfterTemplate]=\"table?.rowAfterTemplate\"\n [draggable]=\"table.draggable\"\n [dropEnterPredicate]=\"table.dropEnterPredicate\"\n (dragDropped)=\"table.dragDropped.emit($event)\"\n (itemClick)=\"selectItem($event)\"\n ></gantt-table-body>\n </div>\n </div>\n </div>\n <div class=\"gantt-container\">\n <gantt-calendar-grid></gantt-calendar-grid>\n <div class=\"gantt-main\">\n <gantt-main\n [flatData]=\"flatData\"\n [renderData]=\"renderData\"\n [groupHeaderTemplate]=\"groupHeaderTemplate\"\n [itemTemplate]=\"itemTemplate\"\n [barTemplate]=\"barTemplate\"\n [rangeTemplate]=\"rangeTemplate\"\n (barClick)=\"barClick.emit($event)\"\n (lineClick)=\"lineClick.emit($event)\"\n >\n </gantt-main>\n </div>\n </div>\n </cdk-virtual-scroll-viewport>\n <gantt-drag-backdrop [style.left.px]=\"tableHeader.tableWidth + 1\"></gantt-drag-backdrop>\n</ngx-gantt-root>\n", dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.CdkFixedSizeVirtualScroll, selector: "cdk-virtual-scroll-viewport[itemSize]", inputs: ["itemSize", "minBufferPx", "maxBufferPx"] }, { kind: "directive", type: i3.CdkVirtualForOf, selector: "[cdkVirtualFor][cdkVirtualForOf]", inputs: ["cdkVirtualForOf", "cdkVirtualForTrackBy", "cdkVirtualForTemplate", "cdkVirtualForTemplateCacheSize"] }, { kind: "component", type: i3.CdkVirtualScrollViewport, selector: "cdk-virtual-scroll-viewport", inputs: ["orientation", "appendOnly"], outputs: ["scrolledIndexChange"] }, { kind: "component", type: GanttTableHeaderComponent, selector: "gantt-table-header", inputs: ["columns"] }, { kind: "component", type: GanttTableBodyComponent, selector: "gantt-table-body", inputs: ["renderData", "flatData", "columns", "groupTemplate", "emptyTemplate", "rowBeforeTemplate", "rowAfterTemplate", "draggable", "dropEnterPredicate"], outputs: ["dragDropped", "itemClick"] }, { kind: "component", type: GanttMainComponent, selector: "gantt-main", inputs: ["renderData", "flatData", "groupHeaderTemplate", "itemTemplate", "barTemplate", "rangeTemplate"], outputs: ["barClick", "lineClick"] }, { kind: "component", type: GanttCalendarHeaderComponent, selector: "gantt-calendar-header" }, { kind: "component", type: GanttCalendarGridComponent, selector: "gantt-calendar-grid" }, { kind: "component", type: GanttLoaderComponent, selector: "gantt-loader" }, { kind: "component", type: GanttDragBackdropComponent, selector: "gantt-drag-backdrop" }, { kind: "component", type: NgxGanttRootComponent, selector: "ngx-gantt-root", inputs: ["sideWidth"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
3934
|
+
], queries: [{ propertyName: "table", first: true, predicate: NgxGanttTableComponent, descendants: true }, { propertyName: "tableEmptyTemplate", first: true, predicate: ["tableEmpty"], descendants: true, static: true }, { propertyName: "columns", predicate: NgxGanttTableColumnComponent, descendants: true }], viewQueries: [{ propertyName: "ganttRoot", first: true, predicate: ["ganttRoot"], descendants: true }, { propertyName: "virtualScroll", first: true, predicate: CdkVirtualScrollViewport, descendants: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<ngx-gantt-root #ganttRoot>\n <div class=\"gantt-header\">\n <gantt-table-header #tableHeader [columns]=\"columns\"></gantt-table-header>\n <div class=\"gantt-container-header\">\n <gantt-calendar-header></gantt-calendar-header>\n </div>\n </div>\n <gantt-loader *ngIf=\"loading\"></gantt-loader>\n\n <cdk-virtual-scroll-viewport\n class=\"gantt-virtual-scroll-viewport\"\n [itemSize]=\"styles.lineHeight\"\n [minBufferPx]=\"styles.lineHeight * 10\"\n [maxBufferPx]=\"styles.lineHeight * 20\"\n >\n <ng-container *cdkVirtualFor=\"let item of flatData; trackBy: trackBy\"></ng-container>\n <div class=\"gantt-side\" [style.width.px]=\"tableHeader.tableWidth + 1\">\n <div class=\"gantt-side-container\">\n <div class=\"gantt-table\">\n <gantt-table-body\n [flatData]=\"flatData\"\n [renderData]=\"renderData\"\n [columns]=\"columns\"\n [groupTemplate]=\"groupTemplate\"\n [emptyTemplate]=\"tableEmptyTemplate\"\n [rowBeforeTemplate]=\"table?.rowBeforeTemplate\"\n [rowAfterTemplate]=\"table?.rowAfterTemplate\"\n [draggable]=\"table.draggable\"\n [dropEnterPredicate]=\"table.dropEnterPredicate\"\n (dragDropped)=\"table.dragDropped.emit($event)\"\n (dragStarted)=\"table.dragStarted.emit($event)\"\n (dragEnded)=\"table.dragEnded.emit($event)\"\n (itemClick)=\"selectItem($event)\"\n ></gantt-table-body>\n </div>\n </div>\n </div>\n\n <div class=\"gantt-container\">\n <gantt-calendar-grid></gantt-calendar-grid>\n <div class=\"gantt-main\">\n <gantt-main\n [flatData]=\"flatData\"\n [renderData]=\"renderData\"\n [groupHeaderTemplate]=\"groupHeaderTemplate\"\n [itemTemplate]=\"itemTemplate\"\n [barTemplate]=\"barTemplate\"\n [rangeTemplate]=\"rangeTemplate\"\n (barClick)=\"barClick.emit($event)\"\n (lineClick)=\"lineClick.emit($event)\"\n >\n </gantt-main>\n </div>\n </div>\n </cdk-virtual-scroll-viewport>\n\n <gantt-drag-backdrop [style.left.px]=\"tableHeader.tableWidth + 1\"></gantt-drag-backdrop>\n</ngx-gantt-root>\n", dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.CdkFixedSizeVirtualScroll, selector: "cdk-virtual-scroll-viewport[itemSize]", inputs: ["itemSize", "minBufferPx", "maxBufferPx"] }, { kind: "directive", type: i3.CdkVirtualForOf, selector: "[cdkVirtualFor][cdkVirtualForOf]", inputs: ["cdkVirtualForOf", "cdkVirtualForTrackBy", "cdkVirtualForTemplate", "cdkVirtualForTemplateCacheSize"] }, { kind: "component", type: i3.CdkVirtualScrollViewport, selector: "cdk-virtual-scroll-viewport", inputs: ["orientation", "appendOnly"], outputs: ["scrolledIndexChange"] }, { kind: "component", type: GanttTableHeaderComponent, selector: "gantt-table-header", inputs: ["columns"] }, { kind: "component", type: GanttTableBodyComponent, selector: "gantt-table-body", inputs: ["renderData", "flatData", "columns", "groupTemplate", "emptyTemplate", "rowBeforeTemplate", "rowAfterTemplate", "draggable", "dropEnterPredicate"], outputs: ["dragDropped", "dragStarted", "dragEnded", "itemClick"] }, { kind: "component", type: GanttMainComponent, selector: "gantt-main", inputs: ["renderData", "flatData", "groupHeaderTemplate", "itemTemplate", "barTemplate", "rangeTemplate"], outputs: ["barClick", "lineClick"] }, { kind: "component", type: GanttCalendarHeaderComponent, selector: "gantt-calendar-header" }, { kind: "component", type: GanttCalendarGridComponent, selector: "gantt-calendar-grid" }, { kind: "component", type: GanttLoaderComponent, selector: "gantt-loader" }, { kind: "component", type: GanttDragBackdropComponent, selector: "gantt-drag-backdrop" }, { kind: "component", type: NgxGanttRootComponent, selector: "ngx-gantt-root", inputs: ["sideWidth"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
3676
3935
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: NgxGanttComponent, decorators: [{
|
|
3677
3936
|
type: Component,
|
|
3678
3937
|
args: [{ selector: 'ngx-gantt', changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
@@ -3684,7 +3943,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImpor
|
|
|
3684
3943
|
provide: GANTT_ABSTRACT_TOKEN,
|
|
3685
3944
|
useExisting: forwardRef(() => NgxGanttComponent)
|
|
3686
3945
|
}
|
|
3687
|
-
], template: "<ngx-gantt-root #ganttRoot>\n <div class=\"gantt-header\">\n <gantt-table-header #tableHeader [columns]=\"columns\"></gantt-table-header>\n <div class=\"gantt-container-header\">\n <gantt-calendar-header></gantt-calendar-header>\n </div>\n </div>\n <gantt-loader *ngIf=\"loading\"></gantt-loader>\n <cdk-virtual-scroll-viewport\n class=\"gantt-virtual-scroll-viewport\"\n [itemSize]=\"styles.lineHeight\"\n [minBufferPx]=\"styles.lineHeight * 10\"\n [maxBufferPx]=\"styles.lineHeight * 20\"\n >\n <ng-container *cdkVirtualFor=\"let item of flatData; trackBy: trackBy\"></ng-container>\n <div class=\"gantt-side\" [style.width.px]=\"tableHeader.tableWidth + 1\">\n <div class=\"gantt-side-container\">\n <div class=\"gantt-table\">\n <gantt-table-body\n [flatData]=\"flatData\"\n [renderData]=\"renderData\"\n [columns]=\"columns\"\n [groupTemplate]=\"groupTemplate\"\n [emptyTemplate]=\"tableEmptyTemplate\"\n [rowBeforeTemplate]=\"table?.rowBeforeTemplate\"\n [rowAfterTemplate]=\"table?.rowAfterTemplate\"\n [draggable]=\"table.draggable\"\n [dropEnterPredicate]=\"table.dropEnterPredicate\"\n (dragDropped)=\"table.dragDropped.emit($event)\"\n (itemClick)=\"selectItem($event)\"\n ></gantt-table-body>\n </div>\n </div>\n </div>\n <div class=\"gantt-container\">\n <gantt-calendar-grid></gantt-calendar-grid>\n <div class=\"gantt-main\">\n <gantt-main\n [flatData]=\"flatData\"\n [renderData]=\"renderData\"\n [groupHeaderTemplate]=\"groupHeaderTemplate\"\n [itemTemplate]=\"itemTemplate\"\n [barTemplate]=\"barTemplate\"\n [rangeTemplate]=\"rangeTemplate\"\n (barClick)=\"barClick.emit($event)\"\n (lineClick)=\"lineClick.emit($event)\"\n >\n </gantt-main>\n </div>\n </div>\n </cdk-virtual-scroll-viewport>\n <gantt-drag-backdrop [style.left.px]=\"tableHeader.tableWidth + 1\"></gantt-drag-backdrop>\n</ngx-gantt-root>\n" }]
|
|
3946
|
+
], template: "<ngx-gantt-root #ganttRoot>\n <div class=\"gantt-header\">\n <gantt-table-header #tableHeader [columns]=\"columns\"></gantt-table-header>\n <div class=\"gantt-container-header\">\n <gantt-calendar-header></gantt-calendar-header>\n </div>\n </div>\n <gantt-loader *ngIf=\"loading\"></gantt-loader>\n\n <cdk-virtual-scroll-viewport\n class=\"gantt-virtual-scroll-viewport\"\n [itemSize]=\"styles.lineHeight\"\n [minBufferPx]=\"styles.lineHeight * 10\"\n [maxBufferPx]=\"styles.lineHeight * 20\"\n >\n <ng-container *cdkVirtualFor=\"let item of flatData; trackBy: trackBy\"></ng-container>\n <div class=\"gantt-side\" [style.width.px]=\"tableHeader.tableWidth + 1\">\n <div class=\"gantt-side-container\">\n <div class=\"gantt-table\">\n <gantt-table-body\n [flatData]=\"flatData\"\n [renderData]=\"renderData\"\n [columns]=\"columns\"\n [groupTemplate]=\"groupTemplate\"\n [emptyTemplate]=\"tableEmptyTemplate\"\n [rowBeforeTemplate]=\"table?.rowBeforeTemplate\"\n [rowAfterTemplate]=\"table?.rowAfterTemplate\"\n [draggable]=\"table.draggable\"\n [dropEnterPredicate]=\"table.dropEnterPredicate\"\n (dragDropped)=\"table.dragDropped.emit($event)\"\n (dragStarted)=\"table.dragStarted.emit($event)\"\n (dragEnded)=\"table.dragEnded.emit($event)\"\n (itemClick)=\"selectItem($event)\"\n ></gantt-table-body>\n </div>\n </div>\n </div>\n\n <div class=\"gantt-container\">\n <gantt-calendar-grid></gantt-calendar-grid>\n <div class=\"gantt-main\">\n <gantt-main\n [flatData]=\"flatData\"\n [renderData]=\"renderData\"\n [groupHeaderTemplate]=\"groupHeaderTemplate\"\n [itemTemplate]=\"itemTemplate\"\n [barTemplate]=\"barTemplate\"\n [rangeTemplate]=\"rangeTemplate\"\n (barClick)=\"barClick.emit($event)\"\n (lineClick)=\"lineClick.emit($event)\"\n >\n </gantt-main>\n </div>\n </div>\n </cdk-virtual-scroll-viewport>\n\n <gantt-drag-backdrop [style.left.px]=\"tableHeader.tableWidth + 1\"></gantt-drag-backdrop>\n</ngx-gantt-root>\n" }]
|
|
3688
3947
|
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }, { type: i0.NgZone }, { type: GanttPrintService, decorators: [{
|
|
3689
3948
|
type: Optional
|
|
3690
3949
|
}] }, { type: undefined, decorators: [{
|
|
@@ -3822,5 +4081,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImpor
|
|
|
3822
4081
|
* Generated bundle index. Do not edit.
|
|
3823
4082
|
*/
|
|
3824
4083
|
|
|
3825
|
-
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 };
|
|
4084
|
+
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 };
|
|
3826
4085
|
//# sourceMappingURL=worktile-gantt.mjs.map
|