@worktile/gantt 15.1.0-next.0 → 15.1.0-next.10
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 +26 -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/loader/loader.component.d.ts +5 -0
- package/components/loader/loader.component.scss +90 -0
- package/components/table/body/gantt-table-body.component.d.ts +7 -4
- package/esm2020/class/event.mjs +5 -1
- package/esm2020/components/bar/bar-drag.mjs +221 -76
- package/esm2020/components/bar/bar.component.mjs +33 -27
- package/esm2020/components/loader/loader.component.mjs +29 -0
- package/esm2020/components/table/body/gantt-table-body.component.mjs +73 -33
- 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 +40 -12
- package/esm2020/gantt.module.mjs +4 -1
- package/esm2020/public-api.mjs +2 -1
- package/esm2020/table/gantt-column.component.mjs +13 -6
- package/esm2020/table/gantt-table.component.mjs +8 -2
- package/esm2020/utils/drag-scroll.mjs +35 -0
- package/fesm2015/worktile-gantt.mjs +917 -614
- package/fesm2015/worktile-gantt.mjs.map +1 -1
- package/fesm2020/worktile-gantt.mjs +898 -597
- package/fesm2020/worktile-gantt.mjs.map +1 -1
- package/gantt-abstract.d.ts +3 -1
- package/gantt-item-upper.d.ts +1 -0
- package/gantt.component.d.ts +6 -1
- package/gantt.component.scss +4 -0
- package/gantt.module.d.ts +13 -12
- package/package.json +1 -1
- package/public-api.d.ts +1 -0
- package/styles/index.scss +1 -0
- package/styles/variables.scss +3 -0
- package/table/gantt-column.component.d.ts +4 -2
- package/table/gantt-table.component.d.ts +4 -2
- package/utils/drag-scroll.d.ts +20 -0
|
@@ -1,14 +1,14 @@
|
|
|
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';
|
|
10
10
|
import { coerceBooleanProperty, coerceCssPixelValue } from '@angular/cdk/coercion';
|
|
11
|
-
import * as
|
|
11
|
+
import * as i3 from '@angular/cdk/scrolling';
|
|
12
12
|
import { CdkVirtualScrollViewport, ScrollingModule } from '@angular/cdk/scrolling';
|
|
13
13
|
import { __awaiter, __decorate, __param } from 'tslib';
|
|
14
14
|
import * as i2 from '@angular/cdk/drag-drop';
|
|
@@ -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
|
|
|
@@ -1052,16 +1056,17 @@ class GanttUpper {
|
|
|
1052
1056
|
this.ngZone.runOutsideAngular(() => {
|
|
1053
1057
|
onStable$.pipe(takeUntil(this.unsubscribe$)).subscribe(() => {
|
|
1054
1058
|
this.element.style.opacity = '1';
|
|
1059
|
+
const disabledLoadOnScroll = this.disabledLoadOnScroll;
|
|
1055
1060
|
this.dragContainer.dragStarted.pipe(takeUntil(this.unsubscribe$)).subscribe((event) => {
|
|
1061
|
+
this.disabledLoadOnScroll = true;
|
|
1056
1062
|
this.dragStarted.emit(event);
|
|
1057
1063
|
});
|
|
1058
1064
|
this.dragContainer.dragMoved.pipe(takeUntil(this.unsubscribe$)).subscribe((event) => {
|
|
1059
1065
|
this.dragMoved.emit(event);
|
|
1060
1066
|
});
|
|
1061
1067
|
this.dragContainer.dragEnded.pipe(takeUntil(this.unsubscribe$)).subscribe((event) => {
|
|
1068
|
+
this.disabledLoadOnScroll = disabledLoadOnScroll;
|
|
1062
1069
|
this.dragEnded.emit(event);
|
|
1063
|
-
// this.computeRefs();
|
|
1064
|
-
// this.detectChanges();
|
|
1065
1070
|
});
|
|
1066
1071
|
});
|
|
1067
1072
|
});
|
|
@@ -1242,23 +1247,30 @@ class NgxGanttTableColumnComponent {
|
|
|
1242
1247
|
set width(width) {
|
|
1243
1248
|
this.columnWidth = coerceCssPixelValue(width);
|
|
1244
1249
|
}
|
|
1245
|
-
constructor(ganttUpper) {
|
|
1250
|
+
constructor(ganttUpper, elementRef) {
|
|
1246
1251
|
this.ganttUpper = ganttUpper;
|
|
1252
|
+
this.elementRef = elementRef;
|
|
1253
|
+
}
|
|
1254
|
+
get classList() {
|
|
1255
|
+
return this.elementRef.nativeElement.classList;
|
|
1247
1256
|
}
|
|
1248
1257
|
}
|
|
1249
|
-
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 });
|
|
1250
|
-
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 });
|
|
1258
|
+
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 });
|
|
1259
|
+
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 });
|
|
1251
1260
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: NgxGanttTableColumnComponent, decorators: [{
|
|
1252
1261
|
type: Component,
|
|
1253
1262
|
args: [{
|
|
1254
1263
|
selector: 'ngx-gantt-column',
|
|
1255
|
-
template: ''
|
|
1264
|
+
template: '',
|
|
1265
|
+
host: {
|
|
1266
|
+
class: 'gantt-table-column'
|
|
1267
|
+
}
|
|
1256
1268
|
}]
|
|
1257
1269
|
}], ctorParameters: function () {
|
|
1258
1270
|
return [{ type: GanttUpper, decorators: [{
|
|
1259
1271
|
type: Inject,
|
|
1260
1272
|
args: [GANTT_UPPER_TOKEN]
|
|
1261
|
-
}] }];
|
|
1273
|
+
}] }, { type: i0.ElementRef }];
|
|
1262
1274
|
}, propDecorators: { width: [{
|
|
1263
1275
|
type: Input
|
|
1264
1276
|
}], name: [{
|
|
@@ -1277,11 +1289,13 @@ class NgxGanttTableComponent {
|
|
|
1277
1289
|
constructor() {
|
|
1278
1290
|
this.draggable = false;
|
|
1279
1291
|
this.dragDropped = new EventEmitter();
|
|
1292
|
+
this.dragStarted = new EventEmitter();
|
|
1293
|
+
this.dragEnded = new EventEmitter();
|
|
1280
1294
|
this.columnChanges = new EventEmitter();
|
|
1281
1295
|
}
|
|
1282
1296
|
}
|
|
1283
1297
|
NgxGanttTableComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: NgxGanttTableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1284
|
-
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 });
|
|
1298
|
+
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 });
|
|
1285
1299
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: NgxGanttTableComponent, decorators: [{
|
|
1286
1300
|
type: Component,
|
|
1287
1301
|
args: [{
|
|
@@ -1294,6 +1308,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImpor
|
|
|
1294
1308
|
type: Input
|
|
1295
1309
|
}], dragDropped: [{
|
|
1296
1310
|
type: Output
|
|
1311
|
+
}], dragStarted: [{
|
|
1312
|
+
type: Output
|
|
1313
|
+
}], dragEnded: [{
|
|
1314
|
+
type: Output
|
|
1297
1315
|
}], columnChanges: [{
|
|
1298
1316
|
type: Output
|
|
1299
1317
|
}], rowBeforeTemplate: [{
|
|
@@ -1430,7 +1448,7 @@ class GanttTableHeaderComponent {
|
|
|
1430
1448
|
this.columnsChange();
|
|
1431
1449
|
this.columns.changes.pipe(takeUntil$1(this.unsubscribe$)).subscribe(() => {
|
|
1432
1450
|
this.columnsChange();
|
|
1433
|
-
this.cdr.detectChanges();
|
|
1451
|
+
this.gantt.cdr.detectChanges();
|
|
1434
1452
|
});
|
|
1435
1453
|
}
|
|
1436
1454
|
columnsChange() {
|
|
@@ -1730,13 +1748,15 @@ class GanttTableBodyComponent {
|
|
|
1730
1748
|
this.document = document;
|
|
1731
1749
|
this.draggable = false;
|
|
1732
1750
|
this.dragDropped = new EventEmitter();
|
|
1751
|
+
this.dragStarted = new EventEmitter();
|
|
1752
|
+
this.dragEnded = new EventEmitter();
|
|
1733
1753
|
this.itemClick = new EventEmitter();
|
|
1734
1754
|
this.ganttTableClass = true;
|
|
1735
1755
|
this.ganttTableEmptyClass = false;
|
|
1736
1756
|
this.ganttTableDragging = false;
|
|
1737
1757
|
this.hasExpandIcon = false;
|
|
1738
1758
|
// 缓存 Element 和 DragRef 的关系,方便在 Item 拖动时查找
|
|
1739
|
-
this.
|
|
1759
|
+
this.itemDragsMap = new Map();
|
|
1740
1760
|
this.itemDragMoved = new Subject();
|
|
1741
1761
|
this.destroy$ = new Subject();
|
|
1742
1762
|
}
|
|
@@ -1758,17 +1778,17 @@ class GanttTableBodyComponent {
|
|
|
1758
1778
|
this.cdkDrags.changes
|
|
1759
1779
|
.pipe(startWith(this.cdkDrags), takeUntil$1(this.destroy$))
|
|
1760
1780
|
.subscribe((drags) => {
|
|
1761
|
-
this.
|
|
1781
|
+
this.itemDragsMap.clear();
|
|
1762
1782
|
drags.forEach((drag) => {
|
|
1763
1783
|
if (drag.data) {
|
|
1764
1784
|
// cdkDrag 变化时,缓存 Element 与 DragRef 的关系,方便 Drag Move 时查找
|
|
1765
|
-
this.
|
|
1785
|
+
this.itemDragsMap.set(drag.element.nativeElement, drag);
|
|
1766
1786
|
}
|
|
1767
1787
|
});
|
|
1768
1788
|
});
|
|
1769
1789
|
this.itemDragMoved
|
|
1770
|
-
.pipe(
|
|
1771
|
-
//
|
|
1790
|
+
.pipe(auditTime(30),
|
|
1791
|
+
// auditTime 可能会导致拖动结束后仍然执行 moved ,所以通过判断 dragging 状态来过滤无效 moved
|
|
1772
1792
|
filter((event) => event.source._dragRef.isDragging()), takeUntil$1(this.destroy$))
|
|
1773
1793
|
.subscribe((event) => {
|
|
1774
1794
|
this.onItemDragMoved(event);
|
|
@@ -1782,12 +1802,17 @@ class GanttTableBodyComponent {
|
|
|
1782
1802
|
this.gantt.expandChildren(item);
|
|
1783
1803
|
}
|
|
1784
1804
|
onItemDragStarted(event) {
|
|
1805
|
+
var _a, _b;
|
|
1785
1806
|
this.ganttTableDragging = true;
|
|
1786
1807
|
// 拖动开始时隐藏所有的子项
|
|
1787
|
-
const children = this.
|
|
1808
|
+
const children = this.getChildrenElementsByElement(event.source.element.nativeElement);
|
|
1788
1809
|
children.forEach((element) => {
|
|
1789
1810
|
element.classList.add('drag-item-hide');
|
|
1790
1811
|
});
|
|
1812
|
+
this.dragStarted.emit({
|
|
1813
|
+
source: (_a = event.source.data) === null || _a === void 0 ? void 0 : _a.origin,
|
|
1814
|
+
sourceParent: (_b = this.getParentByItem(event.source.data)) === null || _b === void 0 ? void 0 : _b.origin
|
|
1815
|
+
});
|
|
1791
1816
|
}
|
|
1792
1817
|
emitItemDragMoved(event) {
|
|
1793
1818
|
this.itemDragMoved.next(event);
|
|
@@ -1809,12 +1834,12 @@ class GanttTableBodyComponent {
|
|
|
1809
1834
|
}
|
|
1810
1835
|
// 缓存放置目标Id 并计算鼠标相对应的位置
|
|
1811
1836
|
this.itemDropTarget = {
|
|
1812
|
-
id: (_a = this.
|
|
1837
|
+
id: (_a = this.itemDragsMap.get(targetElement)) === null || _a === void 0 ? void 0 : _a.data.id,
|
|
1813
1838
|
position: this.getTargetPosition(targetElement, event)
|
|
1814
1839
|
};
|
|
1815
1840
|
// 执行外部传入的 dropEnterPredicate 判断是否允许拖入目标项
|
|
1816
1841
|
if (this.dropEnterPredicate) {
|
|
1817
|
-
const targetDragRef = this.
|
|
1842
|
+
const targetDragRef = this.itemDragsMap.get(targetElement);
|
|
1818
1843
|
if (this.dropEnterPredicate({
|
|
1819
1844
|
source: event.source.data.origin,
|
|
1820
1845
|
target: targetDragRef.data.origin,
|
|
@@ -1824,6 +1849,7 @@ class GanttTableBodyComponent {
|
|
|
1824
1849
|
}
|
|
1825
1850
|
else {
|
|
1826
1851
|
this.itemDropTarget = null;
|
|
1852
|
+
this.cleanupDragArtifacts(false);
|
|
1827
1853
|
}
|
|
1828
1854
|
}
|
|
1829
1855
|
else {
|
|
@@ -1831,33 +1857,40 @@ class GanttTableBodyComponent {
|
|
|
1831
1857
|
}
|
|
1832
1858
|
}
|
|
1833
1859
|
onItemDragEnded(event) {
|
|
1860
|
+
var _a, _b;
|
|
1834
1861
|
this.ganttTableDragging = false;
|
|
1862
|
+
this.dragEnded.emit({
|
|
1863
|
+
source: (_a = event.source.data) === null || _a === void 0 ? void 0 : _a.origin,
|
|
1864
|
+
sourceParent: (_b = this.getParentByItem(event.source.data)) === null || _b === void 0 ? void 0 : _b.origin
|
|
1865
|
+
});
|
|
1835
1866
|
}
|
|
1836
1867
|
onListDropped(event) {
|
|
1837
|
-
var _a, _b;
|
|
1838
1868
|
if (!this.itemDropTarget) {
|
|
1839
1869
|
return;
|
|
1840
1870
|
}
|
|
1841
|
-
const targetDragRef = this.cdkDrags.find((item) => { var _a; return ((_a = item.data) === null || _a === void 0 ? void 0 : _a.id) === this.itemDropTarget.id; });
|
|
1842
1871
|
const sourceItem = event.item.data;
|
|
1872
|
+
const sourceParent = this.getParentByItem(sourceItem);
|
|
1873
|
+
const sourceChildren = this.getExpandChildrenByDrag(event.item);
|
|
1874
|
+
const targetDragRef = this.cdkDrags.find((item) => { var _a; return ((_a = item.data) === null || _a === void 0 ? void 0 : _a.id) === this.itemDropTarget.id; });
|
|
1843
1875
|
const targetItem = targetDragRef === null || targetDragRef === void 0 ? void 0 : targetDragRef.data;
|
|
1844
|
-
this.
|
|
1876
|
+
const targetParent = this.getParentByItem(targetItem);
|
|
1877
|
+
this.removeItem(sourceItem, sourceChildren);
|
|
1845
1878
|
switch (this.itemDropTarget.position) {
|
|
1846
1879
|
case 'before':
|
|
1847
1880
|
case 'after':
|
|
1848
|
-
this.insertItem(targetItem, sourceItem, this.itemDropTarget.position);
|
|
1881
|
+
this.insertItem(targetItem, sourceItem, sourceChildren, this.itemDropTarget.position);
|
|
1849
1882
|
sourceItem.updateLevel(targetItem.level);
|
|
1850
1883
|
break;
|
|
1851
1884
|
case 'inside':
|
|
1852
|
-
this.insertChildrenItem(targetItem, sourceItem);
|
|
1885
|
+
this.insertChildrenItem(targetItem, sourceItem, sourceChildren);
|
|
1853
1886
|
sourceItem.updateLevel(targetItem.level + 1);
|
|
1854
1887
|
break;
|
|
1855
1888
|
}
|
|
1856
1889
|
this.dragDropped.emit({
|
|
1857
1890
|
source: sourceItem.origin,
|
|
1858
|
-
sourceParent:
|
|
1891
|
+
sourceParent: sourceParent === null || sourceParent === void 0 ? void 0 : sourceParent.origin,
|
|
1859
1892
|
target: targetItem.origin,
|
|
1860
|
-
targetParent:
|
|
1893
|
+
targetParent: targetParent === null || targetParent === void 0 ? void 0 : targetParent.origin,
|
|
1861
1894
|
dropPosition: this.itemDropTarget.position
|
|
1862
1895
|
});
|
|
1863
1896
|
this.cleanupDragArtifacts(true);
|
|
@@ -1869,19 +1902,31 @@ class GanttTableBodyComponent {
|
|
|
1869
1902
|
this.destroy$.next();
|
|
1870
1903
|
this.destroy$.complete();
|
|
1871
1904
|
}
|
|
1872
|
-
removeItem(item) {
|
|
1873
|
-
this.renderData.splice(this.renderData.indexOf(item), 1);
|
|
1874
|
-
this.flatData.splice(this.flatData.indexOf(item), 1);
|
|
1905
|
+
removeItem(item, children) {
|
|
1906
|
+
this.renderData.splice(this.renderData.indexOf(item), 1 + children.length);
|
|
1907
|
+
this.flatData.splice(this.flatData.indexOf(item), 1 + children.length);
|
|
1875
1908
|
}
|
|
1876
|
-
insertItem(target, inserted, position) {
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1909
|
+
insertItem(target, inserted, children, position) {
|
|
1910
|
+
var _a;
|
|
1911
|
+
if (position === 'before') {
|
|
1912
|
+
this.renderData.splice(this.renderData.indexOf(target), 0, inserted, ...children);
|
|
1913
|
+
this.flatData.splice(this.flatData.indexOf(target), 0, inserted, ...children);
|
|
1914
|
+
}
|
|
1915
|
+
else {
|
|
1916
|
+
const dragRef = this.cdkDrags.find((drag) => drag.data === target);
|
|
1917
|
+
// 如果目标项是展开的,插入的 index 位置需要考虑子项的数量
|
|
1918
|
+
let childrenCount = 0;
|
|
1919
|
+
if (target.expanded) {
|
|
1920
|
+
childrenCount = ((_a = this.getChildrenElementsByElement(dragRef.element.nativeElement)) === null || _a === void 0 ? void 0 : _a.length) || 0;
|
|
1921
|
+
}
|
|
1922
|
+
this.renderData.splice(this.renderData.indexOf(target) + 1 + childrenCount, 0, inserted, ...children);
|
|
1923
|
+
this.flatData.splice(this.flatData.indexOf(target) + 1 + childrenCount, 0, inserted, ...children);
|
|
1924
|
+
}
|
|
1880
1925
|
}
|
|
1881
|
-
insertChildrenItem(target, inserted) {
|
|
1926
|
+
insertChildrenItem(target, inserted, children) {
|
|
1882
1927
|
if (target.expanded) {
|
|
1883
|
-
this.renderData.splice(this.renderData.indexOf(target) + target.children.length + 1, 0, inserted);
|
|
1884
|
-
this.flatData.splice(this.flatData.indexOf(target) + target.children.length + 1, 0, inserted);
|
|
1928
|
+
this.renderData.splice(this.renderData.indexOf(target) + target.children.length + 1, 0, inserted, ...children);
|
|
1929
|
+
this.flatData.splice(this.flatData.indexOf(target) + target.children.length + 1, 0, inserted, ...children);
|
|
1885
1930
|
}
|
|
1886
1931
|
target.children.push(inserted);
|
|
1887
1932
|
}
|
|
@@ -1891,15 +1936,26 @@ class GanttTableBodyComponent {
|
|
|
1891
1936
|
return (_a = n.children) === null || _a === void 0 ? void 0 : _a.includes(item);
|
|
1892
1937
|
});
|
|
1893
1938
|
}
|
|
1894
|
-
|
|
1939
|
+
getExpandChildrenByDrag(dragRef) {
|
|
1940
|
+
if (!dragRef.data.expanded) {
|
|
1941
|
+
return [];
|
|
1942
|
+
}
|
|
1943
|
+
else {
|
|
1944
|
+
const childrenElements = this.getChildrenElementsByElement(dragRef.element.nativeElement);
|
|
1945
|
+
return childrenElements.map((element) => this.itemDragsMap.get(element).data);
|
|
1946
|
+
}
|
|
1947
|
+
}
|
|
1948
|
+
getChildrenElementsByElement(dragElement) {
|
|
1895
1949
|
// 通过循环持续查找 next element,如果 element 的 level 小于当前 item 的 level,则为它的 children
|
|
1896
1950
|
const children = [];
|
|
1897
|
-
|
|
1898
|
-
|
|
1951
|
+
const dragRef = this.itemDragsMap.get(dragElement);
|
|
1952
|
+
// 如果当前的 Drag 正在拖拽,会创建 PlaceholderElement 占位,所以以 PlaceholderElement 向下查找
|
|
1953
|
+
let nextElement = (dragRef.getPlaceholderElement() || dragElement).nextElementSibling;
|
|
1954
|
+
let nextDragRef = this.itemDragsMap.get(nextElement);
|
|
1899
1955
|
while (nextDragRef && nextDragRef.data.level > dragRef.data.level) {
|
|
1900
1956
|
children.push(nextElement);
|
|
1901
1957
|
nextElement = nextElement.nextElementSibling;
|
|
1902
|
-
nextDragRef = this.
|
|
1958
|
+
nextDragRef = this.itemDragsMap.get(nextElement);
|
|
1903
1959
|
}
|
|
1904
1960
|
return children;
|
|
1905
1961
|
}
|
|
@@ -1926,18 +1982,18 @@ class GanttTableBodyComponent {
|
|
|
1926
1982
|
cleanupDragArtifacts(dropped = false) {
|
|
1927
1983
|
if (dropped) {
|
|
1928
1984
|
this.itemDropTarget = null;
|
|
1985
|
+
this.document.querySelectorAll('.drag-item-hide').forEach((element) => element.classList.remove('drag-item-hide'));
|
|
1929
1986
|
}
|
|
1930
1987
|
this.document.querySelectorAll('.drop-position-before').forEach((element) => element.classList.remove('drop-position-before'));
|
|
1931
1988
|
this.document.querySelectorAll('.drop-position-after').forEach((element) => element.classList.remove('drop-position-after'));
|
|
1932
1989
|
this.document.querySelectorAll('.drop-position-inside').forEach((element) => element.classList.remove('drop-position-inside'));
|
|
1933
|
-
this.document.querySelectorAll('.drag-item-hide').forEach((element) => element.classList.remove('drop-item-hide'));
|
|
1934
1990
|
}
|
|
1935
1991
|
}
|
|
1936
1992
|
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 });
|
|
1937
|
-
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
|
|
1993
|
+
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" }] });
|
|
1938
1994
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: GanttTableBodyComponent, decorators: [{
|
|
1939
1995
|
type: Component,
|
|
1940
|
-
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
|
|
1996
|
+
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" }]
|
|
1941
1997
|
}], ctorParameters: function () {
|
|
1942
1998
|
return [{ type: undefined, decorators: [{
|
|
1943
1999
|
type: Inject,
|
|
@@ -1972,6 +2028,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImpor
|
|
|
1972
2028
|
type: Input
|
|
1973
2029
|
}], dragDropped: [{
|
|
1974
2030
|
type: Output
|
|
2031
|
+
}], dragStarted: [{
|
|
2032
|
+
type: Output
|
|
2033
|
+
}], dragEnded: [{
|
|
2034
|
+
type: Output
|
|
1975
2035
|
}], itemClick: [{
|
|
1976
2036
|
type: Output
|
|
1977
2037
|
}], ganttTableClass: [{
|
|
@@ -2273,7 +2333,7 @@ class GanttLinksComponent {
|
|
|
2273
2333
|
this.elementRef.nativeElement.style.visibility = 'hidden';
|
|
2274
2334
|
});
|
|
2275
2335
|
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(() => { var _a; return ((_a = this.ganttUpper.table) === null || _a === void 0 ? void 0 : _a.dragDropped) || EMPTY; })))
|
|
2276
|
-
.pipe(skip(1), debounceTime
|
|
2336
|
+
.pipe(skip(1), debounceTime(0), takeUntil(this.unsubscribe$))
|
|
2277
2337
|
.subscribe(() => {
|
|
2278
2338
|
this.elementRef.nativeElement.style.visibility = 'visible';
|
|
2279
2339
|
this.buildLinks();
|
|
@@ -2458,6 +2518,41 @@ function normalizePassiveListenerOptions(options) {
|
|
|
2458
2518
|
/** Options used to bind passive event listeners. */
|
|
2459
2519
|
const passiveListenerOptions = normalizePassiveListenerOptions({ passive: true });
|
|
2460
2520
|
|
|
2521
|
+
/**
|
|
2522
|
+
* Proximity, as a ratio to width/height at which to start auto-scrolling the drop list or the
|
|
2523
|
+
* viewport. The value comes from trying it out manually until it feels right.
|
|
2524
|
+
*/
|
|
2525
|
+
const SCROLL_PROXIMITY_THRESHOLD = 0.05;
|
|
2526
|
+
/**
|
|
2527
|
+
* Gets whether the horizontal auto-scroll direction of a node.
|
|
2528
|
+
* @param clientRect Dimensions of the node.
|
|
2529
|
+
* @param pointerX Position of the user's pointer along the x axis.
|
|
2530
|
+
*/
|
|
2531
|
+
function getHorizontalScrollDirection(clientRect, pointerX) {
|
|
2532
|
+
const { left, right, width } = clientRect;
|
|
2533
|
+
const xThreshold = width * SCROLL_PROXIMITY_THRESHOLD;
|
|
2534
|
+
if (pointerX >= left - xThreshold && pointerX <= left + xThreshold) {
|
|
2535
|
+
return 1 /* AutoScrollHorizontalDirection.LEFT */;
|
|
2536
|
+
}
|
|
2537
|
+
else if (pointerX >= right - xThreshold && pointerX <= right + xThreshold) {
|
|
2538
|
+
return 2 /* AutoScrollHorizontalDirection.RIGHT */;
|
|
2539
|
+
}
|
|
2540
|
+
return 0 /* AutoScrollHorizontalDirection.NONE */;
|
|
2541
|
+
}
|
|
2542
|
+
/**
|
|
2543
|
+
* Checks whether the pointer coordinates are close to a ClientRect.
|
|
2544
|
+
* @param rect ClientRect to check against.
|
|
2545
|
+
* @param threshold Threshold around the ClientRect.
|
|
2546
|
+
* @param pointerX Coordinates along the X axis.
|
|
2547
|
+
* @param pointerY Coordinates along the Y axis.
|
|
2548
|
+
*/
|
|
2549
|
+
function isPointerNearClientRect(rect, threshold, pointerX, pointerY) {
|
|
2550
|
+
const { top, right, bottom, left, width, height } = rect;
|
|
2551
|
+
const xThreshold = width * threshold;
|
|
2552
|
+
const yThreshold = height * threshold;
|
|
2553
|
+
return pointerY > top - yThreshold && pointerY < bottom + yThreshold && pointerX > left - xThreshold && pointerX < right + xThreshold;
|
|
2554
|
+
}
|
|
2555
|
+
|
|
2461
2556
|
const scrollThreshold = 50;
|
|
2462
2557
|
var ScrollDirection;
|
|
2463
2558
|
(function (ScrollDirection) {
|
|
@@ -2541,7 +2636,7 @@ class GanttDomService {
|
|
|
2541
2636
|
.subscribe(subscriber)));
|
|
2542
2637
|
}
|
|
2543
2638
|
getResize() {
|
|
2544
|
-
return isPlatformServer(this.platformId) ? EMPTY : fromEvent(window, 'resize').pipe(auditTime(150));
|
|
2639
|
+
return isPlatformServer(this.platformId) ? EMPTY : fromEvent(window, 'resize').pipe(auditTime$1(150));
|
|
2545
2640
|
}
|
|
2546
2641
|
scrollMainContainer(left) {
|
|
2547
2642
|
if (isNumber(left)) {
|
|
@@ -2567,397 +2662,148 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImpor
|
|
|
2567
2662
|
}] }];
|
|
2568
2663
|
} });
|
|
2569
2664
|
|
|
2570
|
-
|
|
2665
|
+
/**
|
|
2666
|
+
* Proximity, as a ratio to width/height, at which a
|
|
2667
|
+
* dragged item will affect the drop container.
|
|
2668
|
+
*/
|
|
2669
|
+
const DROP_PROXIMITY_THRESHOLD = 0.05;
|
|
2670
|
+
const dragMinWidth = 10;
|
|
2671
|
+
const autoScrollStep = 5;
|
|
2672
|
+
const activeClass = 'gantt-bar-active';
|
|
2673
|
+
const dropActiveClass = 'gantt-bar-drop-active';
|
|
2674
|
+
const singleDropActiveClass = 'gantt-bar-single-drop-active';
|
|
2675
|
+
function createSvgElement(qualifiedName, className) {
|
|
2676
|
+
const element = document.createElementNS('http://www.w3.org/2000/svg', qualifiedName);
|
|
2677
|
+
element.classList.add(className);
|
|
2678
|
+
return element;
|
|
2571
2679
|
}
|
|
2572
|
-
|
|
2573
|
-
|
|
2574
|
-
|
|
2575
|
-
type: Component,
|
|
2576
|
-
args: [{ selector: 'gantt-drag-backdrop', host: {
|
|
2577
|
-
class: 'gantt-drag-backdrop'
|
|
2578
|
-
}, 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" }]
|
|
2579
|
-
}] });
|
|
2580
|
-
|
|
2581
|
-
class GanttCalendarHeaderComponent {
|
|
2582
|
-
get view() {
|
|
2583
|
-
return this.ganttUpper.view;
|
|
2680
|
+
class GanttBarDrag {
|
|
2681
|
+
get dragDisabled() {
|
|
2682
|
+
return !this.item.draggable || !this.ganttUpper.draggable;
|
|
2584
2683
|
}
|
|
2585
|
-
|
|
2586
|
-
this.
|
|
2587
|
-
this.ngZone = ngZone;
|
|
2588
|
-
this.elementRef = elementRef;
|
|
2589
|
-
this.unsubscribe$ = new Subject();
|
|
2590
|
-
this.headerHeight = headerHeight;
|
|
2591
|
-
this.viewTypes = GanttViewType;
|
|
2592
|
-
this.className = `gantt-calendar gantt-calendar-header`;
|
|
2684
|
+
get linkDragDisabled() {
|
|
2685
|
+
return !this.item.linkable || !this.ganttUpper.linkable;
|
|
2593
2686
|
}
|
|
2594
|
-
|
|
2595
|
-
this.
|
|
2596
|
-
|
|
2597
|
-
|
|
2687
|
+
get barHandleDragMoveAndScrollDistance() {
|
|
2688
|
+
return this.barHandleDragMoveDistance + this.dragScrollDistance;
|
|
2689
|
+
}
|
|
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
|
+
this.startScrollInterval = () => {
|
|
2710
|
+
this.stopScrolling();
|
|
2711
|
+
interval(0, animationFrameScheduler)
|
|
2712
|
+
.pipe(takeUntil(this.stopScrollTimers$))
|
|
2598
2713
|
.subscribe(() => {
|
|
2599
|
-
|
|
2600
|
-
|
|
2714
|
+
const node = this.dom.mainContainer;
|
|
2715
|
+
const scrollStep = autoScrollStep;
|
|
2716
|
+
if (this._horizontalScrollDirection === 1 /* AutoScrollHorizontalDirection.LEFT */) {
|
|
2717
|
+
node.scrollBy(-scrollStep, 0);
|
|
2718
|
+
}
|
|
2719
|
+
else if (this._horizontalScrollDirection === 2 /* AutoScrollHorizontalDirection.RIGHT */) {
|
|
2720
|
+
node.scrollBy(scrollStep, 0);
|
|
2721
|
+
}
|
|
2601
2722
|
});
|
|
2602
|
-
}
|
|
2603
|
-
}
|
|
2604
|
-
setTodayPoint() {
|
|
2605
|
-
const x = this.view.getTodayXPoint();
|
|
2606
|
-
const today = new GanttDate().getDate();
|
|
2607
|
-
const todayEle = this.elementRef.nativeElement.getElementsByClassName('gantt-calendar-today-overlay')[0];
|
|
2608
|
-
const rect = this.elementRef.nativeElement.getElementsByClassName('today-rect')[0];
|
|
2609
|
-
if (isNumber(x)) {
|
|
2610
|
-
if (rect) {
|
|
2611
|
-
rect.style.left = `${x - todayWidth / 2}px`;
|
|
2612
|
-
rect.style.top = `${headerHeight - todayHeight}px`;
|
|
2613
|
-
rect.innerHTML = today.toString();
|
|
2614
|
-
}
|
|
2615
|
-
}
|
|
2616
|
-
else {
|
|
2617
|
-
todayEle.style.display = 'none';
|
|
2618
|
-
}
|
|
2619
|
-
}
|
|
2620
|
-
trackBy(point, index) {
|
|
2621
|
-
return point.text || index;
|
|
2723
|
+
};
|
|
2622
2724
|
}
|
|
2623
|
-
|
|
2624
|
-
|
|
2625
|
-
|
|
2626
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: GanttCalendarHeaderComponent, decorators: [{
|
|
2627
|
-
type: Component,
|
|
2628
|
-
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" }]
|
|
2629
|
-
}], ctorParameters: function () {
|
|
2630
|
-
return [{ type: GanttUpper, decorators: [{
|
|
2631
|
-
type: Inject,
|
|
2632
|
-
args: [GANTT_UPPER_TOKEN]
|
|
2633
|
-
}] }, { type: i0.NgZone }, { type: i0.ElementRef }];
|
|
2634
|
-
}, propDecorators: { className: [{
|
|
2635
|
-
type: HostBinding,
|
|
2636
|
-
args: ['class']
|
|
2637
|
-
}] } });
|
|
2638
|
-
|
|
2639
|
-
const mainHeight = 5000;
|
|
2640
|
-
class GanttCalendarGridComponent {
|
|
2641
|
-
get view() {
|
|
2642
|
-
return this.ganttUpper.view;
|
|
2725
|
+
createDragRef(element) {
|
|
2726
|
+
const dragRef = this.dragDrop.createDrag(element);
|
|
2727
|
+
return dragRef;
|
|
2643
2728
|
}
|
|
2644
|
-
|
|
2645
|
-
this.
|
|
2646
|
-
this.ngZone = ngZone;
|
|
2647
|
-
this.elementRef = elementRef;
|
|
2648
|
-
this.unsubscribe$ = new Subject();
|
|
2649
|
-
this.headerHeight = headerHeight;
|
|
2650
|
-
this.mainHeight = mainHeight;
|
|
2651
|
-
this.todayBorderRadius = todayBorderRadius;
|
|
2652
|
-
this.viewTypes = GanttViewType;
|
|
2653
|
-
this.className = `gantt-calendar gantt-calendar-grid`;
|
|
2729
|
+
createDragScrollEvent(dragRef) {
|
|
2730
|
+
return fromEvent(this.dom.mainContainer, 'scroll', passiveListenerOptions).pipe(takeUntil(dragRef.ended));
|
|
2654
2731
|
}
|
|
2655
|
-
|
|
2656
|
-
|
|
2657
|
-
const
|
|
2658
|
-
|
|
2659
|
-
|
|
2660
|
-
|
|
2661
|
-
|
|
2662
|
-
|
|
2663
|
-
|
|
2732
|
+
createMouseEvents() {
|
|
2733
|
+
var _a, _b, _c;
|
|
2734
|
+
const dropClass = ((_b = (_a = this.ganttUpper.config.linkOptions) === null || _a === void 0 ? void 0 : _a.dependencyTypes) === null || _b === void 0 ? void 0 : _b.length) === 1 &&
|
|
2735
|
+
((_c = this.ganttUpper.config.linkOptions) === null || _c === void 0 ? void 0 : _c.dependencyTypes[0]) === GanttLinkType.fs
|
|
2736
|
+
? singleDropActiveClass
|
|
2737
|
+
: dropActiveClass;
|
|
2738
|
+
fromEvent(this.barElement, 'mouseenter', passiveListenerOptions)
|
|
2739
|
+
.pipe(takeUntil(this.destroy$))
|
|
2740
|
+
.subscribe(() => {
|
|
2741
|
+
if (this.dragContainer.linkDraggingId && this.dragContainer.linkDraggingId !== this.item.id) {
|
|
2742
|
+
if (this.item.linkable) {
|
|
2743
|
+
this.barElement.classList.add(dropClass);
|
|
2744
|
+
this.dragContainer.emitLinkDragEntered({
|
|
2745
|
+
item: this.item,
|
|
2746
|
+
element: this.barElement
|
|
2747
|
+
});
|
|
2748
|
+
}
|
|
2664
2749
|
}
|
|
2665
|
-
|
|
2666
|
-
|
|
2667
|
-
|
|
2668
|
-
}
|
|
2750
|
+
else {
|
|
2751
|
+
this.barElement.classList.add(activeClass);
|
|
2752
|
+
}
|
|
2753
|
+
});
|
|
2754
|
+
fromEvent(this.barElement, 'mouseleave', passiveListenerOptions)
|
|
2755
|
+
.pipe(takeUntil(this.destroy$))
|
|
2756
|
+
.subscribe(() => {
|
|
2757
|
+
if (!this.dragContainer.linkDraggingId) {
|
|
2758
|
+
this.barElement.classList.remove(activeClass);
|
|
2759
|
+
}
|
|
2760
|
+
else {
|
|
2761
|
+
this.dragContainer.emitLinkDragLeaved();
|
|
2762
|
+
}
|
|
2763
|
+
this.barElement.classList.remove(dropClass);
|
|
2764
|
+
});
|
|
2669
2765
|
}
|
|
2670
|
-
|
|
2671
|
-
this.
|
|
2672
|
-
|
|
2673
|
-
|
|
2674
|
-
|
|
2675
|
-
|
|
2766
|
+
createBarDrag() {
|
|
2767
|
+
const dragRef = this.createDragRef(this.barElement);
|
|
2768
|
+
dragRef.lockAxis = 'x';
|
|
2769
|
+
dragRef.withBoundaryElement(this.dom.mainItems);
|
|
2770
|
+
dragRef.started.subscribe(() => {
|
|
2771
|
+
this.setDraggingStyles();
|
|
2772
|
+
this.containerScrollLeft = this.dom.mainContainer.scrollLeft;
|
|
2773
|
+
this.createDragScrollEvent(dragRef).subscribe(() => {
|
|
2774
|
+
if (dragRef.isDragging()) {
|
|
2775
|
+
const dragScrollDistance = this.dom.mainContainer.scrollLeft - this.containerScrollLeft;
|
|
2776
|
+
this.dragScrollDistance = dragScrollDistance;
|
|
2777
|
+
dragRef['_boundaryRect'] = this.dom.mainItems.getBoundingClientRect();
|
|
2778
|
+
this.barDragMove();
|
|
2779
|
+
}
|
|
2676
2780
|
});
|
|
2781
|
+
this.dragContainer.dragStarted.emit({ item: this.item.origin });
|
|
2677
2782
|
});
|
|
2678
|
-
|
|
2679
|
-
|
|
2680
|
-
|
|
2681
|
-
|
|
2682
|
-
|
|
2683
|
-
|
|
2684
|
-
|
|
2685
|
-
|
|
2686
|
-
|
|
2687
|
-
|
|
2688
|
-
|
|
2689
|
-
|
|
2690
|
-
|
|
2691
|
-
|
|
2692
|
-
|
|
2693
|
-
|
|
2694
|
-
|
|
2695
|
-
|
|
2696
|
-
|
|
2697
|
-
|
|
2698
|
-
|
|
2699
|
-
|
|
2700
|
-
|
|
2701
|
-
|
|
2702
|
-
class NgxGanttToolbarComponent {
|
|
2703
|
-
constructor(ganttUpper) {
|
|
2704
|
-
this.ganttUpper = ganttUpper;
|
|
2705
|
-
this.ganttItemClass = true;
|
|
2706
|
-
this.ganttViewsMap = keyBy(ganttViews, 'value');
|
|
2707
|
-
}
|
|
2708
|
-
selectView(view) {
|
|
2709
|
-
this.ganttUpper.changeView(view);
|
|
2710
|
-
}
|
|
2711
|
-
}
|
|
2712
|
-
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 });
|
|
2713
|
-
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"] }] });
|
|
2714
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: NgxGanttToolbarComponent, decorators: [{
|
|
2715
|
-
type: Component,
|
|
2716
|
-
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" }]
|
|
2717
|
-
}], ctorParameters: function () {
|
|
2718
|
-
return [{ type: GanttUpper, decorators: [{
|
|
2719
|
-
type: Inject,
|
|
2720
|
-
args: [GANTT_UPPER_TOKEN]
|
|
2721
|
-
}] }];
|
|
2722
|
-
}, propDecorators: { template: [{
|
|
2723
|
-
type: Input
|
|
2724
|
-
}], ganttItemClass: [{
|
|
2725
|
-
type: HostBinding,
|
|
2726
|
-
args: ['class.gantt-toolbar']
|
|
2727
|
-
}] } });
|
|
2728
|
-
|
|
2729
|
-
class NgxGanttRootComponent {
|
|
2730
|
-
get view() {
|
|
2731
|
-
return this.ganttUpper.view;
|
|
2732
|
-
}
|
|
2733
|
-
constructor(elementRef, ngZone, dom, dragContainer, ganttUpper, printService) {
|
|
2734
|
-
this.elementRef = elementRef;
|
|
2735
|
-
this.ngZone = ngZone;
|
|
2736
|
-
this.dom = dom;
|
|
2737
|
-
this.dragContainer = dragContainer;
|
|
2738
|
-
this.ganttUpper = ganttUpper;
|
|
2739
|
-
this.printService = printService;
|
|
2740
|
-
this.unsubscribe$ = new Subject();
|
|
2741
|
-
this.ganttUpper.dragContainer = dragContainer;
|
|
2742
|
-
}
|
|
2743
|
-
ngOnInit() {
|
|
2744
|
-
// Note: the zone may be nooped through `BootstrapOptions` when bootstrapping the root module. This means
|
|
2745
|
-
// the `onStable` will never emit any value.
|
|
2746
|
-
const onStable$ = this.ngZone.isStable ? from(Promise.resolve()) : this.ngZone.onStable.pipe(take(1));
|
|
2747
|
-
// Normally this isn't in the zone, but it can cause performance regressions for apps
|
|
2748
|
-
// using `zone-patch-rxjs` because it'll trigger a change detection when it unsubscribes.
|
|
2749
|
-
this.ngZone.runOutsideAngular(() => {
|
|
2750
|
-
onStable$.pipe(takeUntil(this.unsubscribe$)).subscribe(() => {
|
|
2751
|
-
this.dom.initialize(this.elementRef);
|
|
2752
|
-
if (this.printService) {
|
|
2753
|
-
this.printService.register(this.elementRef);
|
|
2754
|
-
}
|
|
2755
|
-
this.setupScrollClass();
|
|
2756
|
-
this.setupResize();
|
|
2757
|
-
this.setupViewScroll();
|
|
2758
|
-
// 优化初始化时Scroll滚动体验问题,通过透明度解决,默认透明度为0,滚动结束后恢复
|
|
2759
|
-
this.elementRef.nativeElement.style.opacity = '1';
|
|
2760
|
-
this.ganttUpper.viewChange.pipe(startWith$1(null), takeUntil(this.unsubscribe$)).subscribe(() => {
|
|
2761
|
-
this.scrollToToday();
|
|
2762
|
-
});
|
|
2763
|
-
});
|
|
2764
|
-
});
|
|
2765
|
-
}
|
|
2766
|
-
ngOnDestroy() {
|
|
2767
|
-
this.unsubscribe$.next();
|
|
2768
|
-
}
|
|
2769
|
-
setupViewScroll() {
|
|
2770
|
-
if (this.ganttUpper.disabledLoadOnScroll) {
|
|
2771
|
-
return;
|
|
2772
|
-
}
|
|
2773
|
-
this.dom
|
|
2774
|
-
.getViewerScroll(passiveListenerOptions)
|
|
2775
|
-
.pipe(takeUntil(this.unsubscribe$))
|
|
2776
|
-
.subscribe((event) => {
|
|
2777
|
-
if (event.direction === ScrollDirection.LEFT) {
|
|
2778
|
-
const dates = this.view.addStartDate();
|
|
2779
|
-
if (dates) {
|
|
2780
|
-
event.target.scrollLeft += this.view.getDateRangeWidth(dates.start, dates.end);
|
|
2781
|
-
if (this.ganttUpper.loadOnScroll.observers) {
|
|
2782
|
-
this.ngZone.run(() => this.ganttUpper.loadOnScroll.emit({ start: dates.start.getUnixTime(), end: dates.end.getUnixTime() }));
|
|
2783
|
-
}
|
|
2784
|
-
}
|
|
2785
|
-
}
|
|
2786
|
-
if (event.direction === ScrollDirection.RIGHT) {
|
|
2787
|
-
const dates = this.view.addEndDate();
|
|
2788
|
-
if (dates && this.ganttUpper.loadOnScroll.observers) {
|
|
2789
|
-
this.ngZone.run(() => this.ganttUpper.loadOnScroll.emit({ start: dates.start.getUnixTime(), end: dates.end.getUnixTime() }));
|
|
2790
|
-
}
|
|
2791
|
-
}
|
|
2792
|
-
});
|
|
2793
|
-
}
|
|
2794
|
-
setupResize() {
|
|
2795
|
-
this.dom
|
|
2796
|
-
.getResize()
|
|
2797
|
-
.pipe(takeUntil(this.unsubscribe$))
|
|
2798
|
-
.subscribe(() => {
|
|
2799
|
-
this.setupScrollClass();
|
|
2800
|
-
});
|
|
2801
|
-
}
|
|
2802
|
-
setupScrollClass() {
|
|
2803
|
-
const mainContainer = this.dom.mainContainer;
|
|
2804
|
-
const height = mainContainer.offsetHeight;
|
|
2805
|
-
const scrollHeight = mainContainer.scrollHeight;
|
|
2806
|
-
if (scrollHeight > height) {
|
|
2807
|
-
this.elementRef.nativeElement.className = 'gantt gantt-scroll';
|
|
2808
|
-
}
|
|
2809
|
-
else {
|
|
2810
|
-
this.elementRef.nativeElement.className = 'gantt';
|
|
2811
|
-
}
|
|
2812
|
-
}
|
|
2813
|
-
scrollToToday() {
|
|
2814
|
-
const x = this.view.getTodayXPoint();
|
|
2815
|
-
this.dom.scrollMainContainer(x);
|
|
2816
|
-
}
|
|
2817
|
-
scrollToDate(date) {
|
|
2818
|
-
let x;
|
|
2819
|
-
if (typeof date === 'number') {
|
|
2820
|
-
x = this.view.getXPointByDate(new GanttDate(date));
|
|
2821
|
-
}
|
|
2822
|
-
else {
|
|
2823
|
-
x = this.view.getXPointByDate(date);
|
|
2824
|
-
}
|
|
2825
|
-
this.dom.scrollMainContainer(x);
|
|
2826
|
-
}
|
|
2827
|
-
}
|
|
2828
|
-
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 });
|
|
2829
|
-
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: i2$1.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"] }] });
|
|
2830
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: NgxGanttRootComponent, decorators: [{
|
|
2831
|
-
type: Component,
|
|
2832
|
-
args: [{ selector: 'ngx-gantt-root', providers: [GanttDomService, GanttDragContainer], host: {
|
|
2833
|
-
class: 'gantt'
|
|
2834
|
-
}, 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" }]
|
|
2835
|
-
}], ctorParameters: function () {
|
|
2836
|
-
return [{ type: i0.ElementRef }, { type: i0.NgZone }, { type: GanttDomService }, { type: GanttDragContainer }, { type: GanttUpper, decorators: [{
|
|
2837
|
-
type: Inject,
|
|
2838
|
-
args: [GANTT_UPPER_TOKEN]
|
|
2839
|
-
}] }, { type: GanttPrintService, decorators: [{
|
|
2840
|
-
type: Optional
|
|
2841
|
-
}] }];
|
|
2842
|
-
}, propDecorators: { sideWidth: [{
|
|
2843
|
-
type: Input
|
|
2844
|
-
}], sideTemplate: [{
|
|
2845
|
-
type: ContentChild,
|
|
2846
|
-
args: ['sideTemplate', { static: true }]
|
|
2847
|
-
}], mainTemplate: [{
|
|
2848
|
-
type: ContentChild,
|
|
2849
|
-
args: ['mainTemplate', { static: true }]
|
|
2850
|
-
}], backdrop: [{
|
|
2851
|
-
type: ViewChild,
|
|
2852
|
-
args: [GanttDragBackdropComponent, { static: true, read: ElementRef }]
|
|
2853
|
-
}] } });
|
|
2854
|
-
|
|
2855
|
-
const dragMinWidth = 10;
|
|
2856
|
-
const autoScrollStep = 10;
|
|
2857
|
-
const activeClass = 'gantt-bar-active';
|
|
2858
|
-
const dropActiveClass = 'gantt-bar-drop-active';
|
|
2859
|
-
const singleDropActiveClass = 'gantt-bar-single-drop-active';
|
|
2860
|
-
function createSvgElement(qualifiedName, className) {
|
|
2861
|
-
const element = document.createElementNS('http://www.w3.org/2000/svg', qualifiedName);
|
|
2862
|
-
element.classList.add(className);
|
|
2863
|
-
return element;
|
|
2864
|
-
}
|
|
2865
|
-
class GanttBarDrag {
|
|
2866
|
-
get dragDisabled() {
|
|
2867
|
-
return !this.item.draggable || !this.ganttUpper.draggable;
|
|
2868
|
-
}
|
|
2869
|
-
get linkDragDisabled() {
|
|
2870
|
-
return !this.item.linkable || !this.ganttUpper.linkable;
|
|
2871
|
-
}
|
|
2872
|
-
constructor(dragDrop, dom, dragContainer, root) {
|
|
2873
|
-
this.dragDrop = dragDrop;
|
|
2874
|
-
this.dom = dom;
|
|
2875
|
-
this.dragContainer = dragContainer;
|
|
2876
|
-
this.root = root;
|
|
2877
|
-
this.dragRefs = [];
|
|
2878
|
-
this.destroy$ = new Subject();
|
|
2879
|
-
// scrolling state when drag
|
|
2880
|
-
this.dragScrolling = false;
|
|
2881
|
-
}
|
|
2882
|
-
createDragRef(element) {
|
|
2883
|
-
const dragRef = this.dragDrop.createDrag(element);
|
|
2884
|
-
// dragRef.withPreviewContainer(this.dom.mainContainer as HTMLElement);
|
|
2885
|
-
return dragRef;
|
|
2886
|
-
}
|
|
2887
|
-
createDragScrollEvent(dragRef) {
|
|
2888
|
-
return fromEvent(this.dom.mainContainer, 'scroll', passiveListenerOptions).pipe(takeUntil(dragRef.ended));
|
|
2889
|
-
}
|
|
2890
|
-
createMouseEvents() {
|
|
2891
|
-
var _a, _b, _c;
|
|
2892
|
-
const dropClass = ((_b = (_a = this.ganttUpper.config.linkOptions) === null || _a === void 0 ? void 0 : _a.dependencyTypes) === null || _b === void 0 ? void 0 : _b.length) === 1 &&
|
|
2893
|
-
((_c = this.ganttUpper.config.linkOptions) === null || _c === void 0 ? void 0 : _c.dependencyTypes[0]) === GanttLinkType.fs
|
|
2894
|
-
? singleDropActiveClass
|
|
2895
|
-
: dropActiveClass;
|
|
2896
|
-
fromEvent(this.barElement, 'mouseenter', passiveListenerOptions)
|
|
2897
|
-
.pipe(takeUntil(this.destroy$))
|
|
2898
|
-
.subscribe(() => {
|
|
2899
|
-
if (this.dragContainer.linkDraggingId && this.dragContainer.linkDraggingId !== this.item.id) {
|
|
2900
|
-
if (this.item.linkable) {
|
|
2901
|
-
this.barElement.classList.add(dropClass);
|
|
2902
|
-
this.dragContainer.emitLinkDragEntered({
|
|
2903
|
-
item: this.item,
|
|
2904
|
-
element: this.barElement
|
|
2905
|
-
});
|
|
2906
|
-
}
|
|
2907
|
-
}
|
|
2908
|
-
else {
|
|
2909
|
-
this.barElement.classList.add(activeClass);
|
|
2910
|
-
}
|
|
2911
|
-
});
|
|
2912
|
-
fromEvent(this.barElement, 'mouseleave', passiveListenerOptions)
|
|
2913
|
-
.pipe(takeUntil(this.destroy$))
|
|
2914
|
-
.subscribe(() => {
|
|
2915
|
-
if (!this.dragContainer.linkDraggingId) {
|
|
2916
|
-
this.barElement.classList.remove(activeClass);
|
|
2917
|
-
}
|
|
2918
|
-
else {
|
|
2919
|
-
this.dragContainer.emitLinkDragLeaved();
|
|
2920
|
-
}
|
|
2921
|
-
this.barElement.classList.remove(dropClass);
|
|
2922
|
-
});
|
|
2923
|
-
}
|
|
2924
|
-
createBarDrag() {
|
|
2925
|
-
const dragRef = this.createDragRef(this.barElement);
|
|
2926
|
-
dragRef.lockAxis = 'x';
|
|
2927
|
-
dragRef.withBoundaryElement(this.dom.mainItems);
|
|
2928
|
-
dragRef.started.subscribe(() => {
|
|
2929
|
-
this.setDraggingStyles();
|
|
2930
|
-
this.containerScrollLeft = this.dom.mainContainer.scrollLeft;
|
|
2931
|
-
this.createDragScrollEvent(dragRef).subscribe(() => {
|
|
2932
|
-
if (this.dropListRef.isDragging()) {
|
|
2933
|
-
this.dragScrolling = true;
|
|
2934
|
-
const scrollDistance = this.dom.mainContainer.scrollLeft - this.containerScrollLeft;
|
|
2935
|
-
this.barDragMove(dragRef, scrollDistance + this.barDragMoveDistance);
|
|
2936
|
-
}
|
|
2937
|
-
});
|
|
2938
|
-
this.dragContainer.dragStarted.emit({ item: this.item.origin });
|
|
2939
|
-
});
|
|
2940
|
-
dragRef.moved.subscribe((event) => {
|
|
2941
|
-
this.barDragMove(dragRef, event.distance.x);
|
|
2942
|
-
if (!this.dragScrolling) {
|
|
2943
|
-
this.barDragMoveDistance = event.distance.x;
|
|
2944
|
-
}
|
|
2945
|
-
});
|
|
2946
|
-
dragRef.ended.subscribe((event) => {
|
|
2947
|
-
this.item.updateRefs({
|
|
2948
|
-
width: this.ganttUpper.view.getDateRangeWidth(this.item.start.startOfDay(), this.item.end.endOfDay()),
|
|
2949
|
-
x: this.ganttUpper.view.getXPointByDate(this.item.start),
|
|
2950
|
-
y: (this.ganttUpper.styles.lineHeight - this.ganttUpper.styles.barHeight) / 2 - 1
|
|
2951
|
-
});
|
|
2952
|
-
this.clearDraggingStyles();
|
|
2953
|
-
this.closeDragBackdrop();
|
|
2954
|
-
event.source.reset();
|
|
2955
|
-
this.dragScrolling = false;
|
|
2956
|
-
this.barDragMoveDistance = 0;
|
|
2957
|
-
this.dragContainer.dragEnded.emit({ item: this.item.origin });
|
|
2958
|
-
});
|
|
2959
|
-
this.barDragRef = dragRef;
|
|
2960
|
-
return dragRef;
|
|
2783
|
+
dragRef.moved.subscribe((event) => {
|
|
2784
|
+
this.startScrollingIfNecessary(event.pointerPosition.x, event.pointerPosition.y);
|
|
2785
|
+
this.barDragMoveDistance = event.distance.x;
|
|
2786
|
+
if (!this.dragScrolling) {
|
|
2787
|
+
this.barDragMove();
|
|
2788
|
+
}
|
|
2789
|
+
});
|
|
2790
|
+
dragRef.ended.subscribe((event) => {
|
|
2791
|
+
this.clearDraggingStyles();
|
|
2792
|
+
this.closeDragBackdrop();
|
|
2793
|
+
event.source.reset();
|
|
2794
|
+
this.stopScrolling();
|
|
2795
|
+
this.dragScrolling = false;
|
|
2796
|
+
this.dragScrollDistance = 0;
|
|
2797
|
+
this.barDragMoveDistance = 0;
|
|
2798
|
+
this.item.updateRefs({
|
|
2799
|
+
width: this.ganttUpper.view.getDateRangeWidth(this.item.start.startOfDay(), this.item.end.endOfDay()),
|
|
2800
|
+
x: this.ganttUpper.view.getXPointByDate(this.item.start),
|
|
2801
|
+
y: (this.ganttUpper.styles.lineHeight - this.ganttUpper.styles.barHeight) / 2 - 1
|
|
2802
|
+
});
|
|
2803
|
+
this.dragContainer.dragEnded.emit({ item: this.item.origin });
|
|
2804
|
+
});
|
|
2805
|
+
this.barDragRef = dragRef;
|
|
2806
|
+
return dragRef;
|
|
2961
2807
|
}
|
|
2962
2808
|
createBarHandleDrags() {
|
|
2963
2809
|
const dragRefs = [];
|
|
@@ -2971,43 +2817,51 @@ class GanttBarDrag {
|
|
|
2971
2817
|
this.setDraggingStyles();
|
|
2972
2818
|
this.containerScrollLeft = this.dom.mainContainer.scrollLeft;
|
|
2973
2819
|
this.createDragScrollEvent(dragRef).subscribe(() => {
|
|
2974
|
-
if (
|
|
2975
|
-
this.
|
|
2976
|
-
|
|
2977
|
-
|
|
2820
|
+
if (dragRef.isDragging()) {
|
|
2821
|
+
const dragScrollDistance = this.dom.mainContainer.scrollLeft - this.containerScrollLeft;
|
|
2822
|
+
this.dragScrollDistance = dragScrollDistance;
|
|
2823
|
+
dragRef['_boundaryRect'] = this.dom.mainItems.getBoundingClientRect();
|
|
2824
|
+
if (this.dragScrolling && this.isStartGreaterThanEndWhenBarHandleDragMove(isBefore)) {
|
|
2825
|
+
this.stopScrolling();
|
|
2826
|
+
this.dragScrolling = false;
|
|
2827
|
+
}
|
|
2828
|
+
if (isBefore) {
|
|
2829
|
+
this.barBeforeHandleDragMove();
|
|
2830
|
+
}
|
|
2831
|
+
else {
|
|
2832
|
+
this.barAfterHandleDragMove();
|
|
2833
|
+
}
|
|
2978
2834
|
}
|
|
2979
2835
|
});
|
|
2980
2836
|
this.dragContainer.dragStarted.emit({ item: this.item.origin });
|
|
2981
2837
|
});
|
|
2982
2838
|
dragRef.moved.subscribe((event) => {
|
|
2983
|
-
this.
|
|
2984
|
-
|
|
2985
|
-
this.barHandleDragMoveDistance = event.distance.x;
|
|
2839
|
+
if (this.barHandleDragMoveRecordDays && this.barHandleDragMoveRecordDays > 0) {
|
|
2840
|
+
this.startScrollingIfNecessary(event.pointerPosition.x, event.pointerPosition.y);
|
|
2986
2841
|
}
|
|
2987
|
-
|
|
2988
|
-
|
|
2989
|
-
|
|
2990
|
-
|
|
2991
|
-
if (width <= dragMinWidth) {
|
|
2992
|
-
this.item.updateDate(this.item.end.startOfDay(), this.item.end);
|
|
2842
|
+
this.barHandleDragMoveDistance = event.distance.x;
|
|
2843
|
+
if (!this.dragScrolling) {
|
|
2844
|
+
if (isBefore) {
|
|
2845
|
+
this.barBeforeHandleDragMove();
|
|
2993
2846
|
}
|
|
2994
|
-
|
|
2995
|
-
|
|
2996
|
-
const width = this.item.refs.width + event.distance.x;
|
|
2997
|
-
if (width <= dragMinWidth) {
|
|
2998
|
-
this.item.updateDate(this.item.start, this.item.start.endOfDay());
|
|
2847
|
+
else {
|
|
2848
|
+
this.barAfterHandleDragMove();
|
|
2999
2849
|
}
|
|
3000
2850
|
}
|
|
3001
|
-
|
|
3002
|
-
|
|
3003
|
-
x: this.ganttUpper.view.getXPointByDate(this.item.start),
|
|
3004
|
-
y: (this.ganttUpper.styles.lineHeight - this.ganttUpper.styles.barHeight) / 2 - 1
|
|
3005
|
-
});
|
|
2851
|
+
});
|
|
2852
|
+
dragRef.ended.subscribe((event) => {
|
|
3006
2853
|
this.clearDraggingStyles();
|
|
3007
2854
|
this.closeDragBackdrop();
|
|
3008
2855
|
event.source.reset();
|
|
2856
|
+
this.stopScrolling();
|
|
3009
2857
|
this.dragScrolling = false;
|
|
2858
|
+
this.dragScrollDistance = 0;
|
|
3010
2859
|
this.barHandleDragMoveDistance = 0;
|
|
2860
|
+
this.item.updateRefs({
|
|
2861
|
+
width: this.ganttUpper.view.getDateRangeWidth(this.item.start.startOfDay(), this.item.end.endOfDay()),
|
|
2862
|
+
x: this.ganttUpper.view.getXPointByDate(this.item.start),
|
|
2863
|
+
y: (this.ganttUpper.styles.lineHeight - this.ganttUpper.styles.barHeight) / 2 - 1
|
|
2864
|
+
});
|
|
3011
2865
|
this.dragContainer.dragEnded.emit({ item: this.item.origin });
|
|
3012
2866
|
});
|
|
3013
2867
|
dragRefs.push(dragRef);
|
|
@@ -3065,13 +2919,19 @@ class GanttBarDrag {
|
|
|
3065
2919
|
return dragRefs;
|
|
3066
2920
|
}
|
|
3067
2921
|
openDragBackdrop(dragElement, start, end) {
|
|
3068
|
-
// const dragBackdropElement = this.root.backdrop.nativeElement;
|
|
3069
|
-
// const dragMaskElement = dragBackdropElement.querySelector('.gantt-drag-mask') as HTMLElement;
|
|
3070
2922
|
const dragBackdropElement = this.dom.root.querySelector('.gantt-drag-backdrop');
|
|
3071
2923
|
const dragMaskElement = this.dom.root.querySelector('.gantt-drag-mask');
|
|
3072
2924
|
const rootRect = this.dom.root.getBoundingClientRect();
|
|
3073
2925
|
const dragRect = dragElement.getBoundingClientRect();
|
|
3074
|
-
|
|
2926
|
+
let left = dragRect.left - rootRect.left - (this.dom.side.clientWidth + 1);
|
|
2927
|
+
if (this.dragScrolling) {
|
|
2928
|
+
if (this._horizontalScrollDirection === 1 /* AutoScrollHorizontalDirection.LEFT */) {
|
|
2929
|
+
left += autoScrollStep;
|
|
2930
|
+
}
|
|
2931
|
+
else if (this._horizontalScrollDirection === 2 /* AutoScrollHorizontalDirection.RIGHT */) {
|
|
2932
|
+
left -= autoScrollStep;
|
|
2933
|
+
}
|
|
2934
|
+
}
|
|
3075
2935
|
const width = dragRect.right - dragRect.left;
|
|
3076
2936
|
// Note: updating styles will cause re-layout so we have to place them consistently one by one.
|
|
3077
2937
|
dragMaskElement.style.left = left + 'px';
|
|
@@ -3096,8 +2956,8 @@ class GanttBarDrag {
|
|
|
3096
2956
|
this.barElement.style.pointerEvents = '';
|
|
3097
2957
|
this.barElement.classList.remove('gantt-bar-draggable-drag');
|
|
3098
2958
|
}
|
|
3099
|
-
barDragMove(
|
|
3100
|
-
const currentX = this.item.refs.x +
|
|
2959
|
+
barDragMove() {
|
|
2960
|
+
const currentX = this.item.refs.x + this.barDragMoveDistance + this.dragScrollDistance;
|
|
3101
2961
|
const currentDate = this.ganttUpper.view.getDateByXPoint(currentX);
|
|
3102
2962
|
const currentStartX = this.ganttUpper.view.getXPointByDate(currentDate);
|
|
3103
2963
|
const dayWidth = this.ganttUpper.view.getDayOccupancyWidth(currentDate);
|
|
@@ -3108,31 +2968,62 @@ class GanttBarDrag {
|
|
|
3108
2968
|
start = start.addDays(1);
|
|
3109
2969
|
end = end.addDays(1);
|
|
3110
2970
|
}
|
|
3111
|
-
|
|
2971
|
+
if (this.dragScrolling) {
|
|
2972
|
+
const left = currentX - this.barDragMoveDistance;
|
|
2973
|
+
this.barElement.style.left = left + 'px';
|
|
2974
|
+
}
|
|
2975
|
+
this.openDragBackdrop(this.barElement, this.ganttUpper.view.getDateByXPoint(currentX), this.ganttUpper.view.getDateByXPoint(currentX + this.item.refs.width));
|
|
2976
|
+
if (!this.isStartOrEndInsideView(start, end)) {
|
|
2977
|
+
return;
|
|
2978
|
+
}
|
|
3112
2979
|
this.item.updateDate(start, end);
|
|
3113
2980
|
this.dragContainer.dragMoved.emit({ item: this.item.origin });
|
|
3114
2981
|
}
|
|
3115
|
-
|
|
3116
|
-
|
|
3117
|
-
|
|
3118
|
-
|
|
3119
|
-
|
|
3120
|
-
|
|
3121
|
-
|
|
2982
|
+
barBeforeHandleDragMove() {
|
|
2983
|
+
const { x, start, oneDayWidth } = this.startOfBarHandle();
|
|
2984
|
+
const width = this.item.refs.width + this.barHandleDragMoveAndScrollDistance * -1;
|
|
2985
|
+
const days = differenceInDays(this.item.end.value, start.value);
|
|
2986
|
+
if (width > dragMinWidth && days > 0) {
|
|
2987
|
+
this.barElement.style.width = width + 'px';
|
|
2988
|
+
this.barElement.style.left = x + 'px';
|
|
2989
|
+
this.openDragBackdrop(this.barElement, start, this.item.end);
|
|
2990
|
+
if (!this.isStartOrEndInsideView(start, this.item.end)) {
|
|
2991
|
+
return;
|
|
2992
|
+
}
|
|
2993
|
+
this.item.updateDate(start, this.item.end);
|
|
2994
|
+
}
|
|
2995
|
+
else {
|
|
2996
|
+
if (this.barHandleDragMoveRecordDays > 0 && days <= 0) {
|
|
2997
|
+
this.barElement.style.width = oneDayWidth + 'px';
|
|
2998
|
+
const x = this.ganttUpper.view.getXPointByDate(this.item.end);
|
|
3122
2999
|
this.barElement.style.left = x + 'px';
|
|
3123
|
-
this.openDragBackdrop(this.barElement, start, this.item.end);
|
|
3124
|
-
this.item.updateDate(start, this.item.end);
|
|
3125
3000
|
}
|
|
3001
|
+
this.openDragBackdrop(this.barElement, this.item.end.startOfDay(), this.item.end);
|
|
3002
|
+
this.item.updateDate(this.item.end.startOfDay(), this.item.end);
|
|
3003
|
+
}
|
|
3004
|
+
this.barHandleDragMoveRecordDays = days;
|
|
3005
|
+
this.dragContainer.dragMoved.emit({ item: this.item.origin });
|
|
3006
|
+
}
|
|
3007
|
+
barAfterHandleDragMove() {
|
|
3008
|
+
const { width, end } = this.endOfBarHandle();
|
|
3009
|
+
const days = differenceInDays(end.value, this.item.start.value);
|
|
3010
|
+
if (width > dragMinWidth && days > 0) {
|
|
3011
|
+
this.barElement.style.width = width + 'px';
|
|
3012
|
+
this.openDragBackdrop(this.barElement, this.item.start, end);
|
|
3013
|
+
if (!this.isStartOrEndInsideView(this.item.start, end)) {
|
|
3014
|
+
return;
|
|
3015
|
+
}
|
|
3016
|
+
this.item.updateDate(this.item.start, end);
|
|
3126
3017
|
}
|
|
3127
3018
|
else {
|
|
3128
|
-
|
|
3129
|
-
|
|
3130
|
-
|
|
3131
|
-
this.barElement.style.width = width + 'px';
|
|
3132
|
-
this.openDragBackdrop(this.barElement, this.item.start, end);
|
|
3133
|
-
this.item.updateDate(this.item.start, end);
|
|
3019
|
+
if (this.barHandleDragMoveRecordDays > 0 && days <= 0) {
|
|
3020
|
+
const oneDayWidth = this.ganttUpper.view.getDateRangeWidth(this.item.start, this.item.start.endOfDay());
|
|
3021
|
+
this.barElement.style.width = oneDayWidth + 'px';
|
|
3134
3022
|
}
|
|
3023
|
+
this.openDragBackdrop(this.barElement, this.item.start, this.item.start.endOfDay());
|
|
3024
|
+
this.item.updateDate(this.item.start, this.item.start.endOfDay());
|
|
3135
3025
|
}
|
|
3026
|
+
this.barHandleDragMoveRecordDays = days;
|
|
3136
3027
|
this.dragContainer.dragMoved.emit({ item: this.item.origin });
|
|
3137
3028
|
}
|
|
3138
3029
|
calcLinkLinePositions(target, isBefore) {
|
|
@@ -3156,10 +3047,81 @@ class GanttBarDrag {
|
|
|
3156
3047
|
this.linkDraggingLine = linElement;
|
|
3157
3048
|
}
|
|
3158
3049
|
}
|
|
3159
|
-
destroyLinkDraggingLine() {
|
|
3160
|
-
if (this.linkDraggingLine) {
|
|
3161
|
-
this.linkDraggingLine.parentElement.remove();
|
|
3162
|
-
this.linkDraggingLine = null;
|
|
3050
|
+
destroyLinkDraggingLine() {
|
|
3051
|
+
if (this.linkDraggingLine) {
|
|
3052
|
+
this.linkDraggingLine.parentElement.remove();
|
|
3053
|
+
this.linkDraggingLine = null;
|
|
3054
|
+
}
|
|
3055
|
+
}
|
|
3056
|
+
startScrollingIfNecessary(pointerX, pointerY) {
|
|
3057
|
+
const clientRect = this.dom.mainContainer.getBoundingClientRect();
|
|
3058
|
+
const scrollLeft = this.dom.mainContainer.scrollLeft;
|
|
3059
|
+
if (isPointerNearClientRect(clientRect, DROP_PROXIMITY_THRESHOLD, pointerX, pointerY)) {
|
|
3060
|
+
const horizontalScrollDirection = getHorizontalScrollDirection(clientRect, pointerX);
|
|
3061
|
+
if ((horizontalScrollDirection === 1 /* AutoScrollHorizontalDirection.LEFT */ && scrollLeft > 0) ||
|
|
3062
|
+
(horizontalScrollDirection === 2 /* AutoScrollHorizontalDirection.RIGHT */ &&
|
|
3063
|
+
scrollLeft < this.ganttUpper.view.width - clientRect.width)) {
|
|
3064
|
+
this._horizontalScrollDirection = horizontalScrollDirection;
|
|
3065
|
+
this.dragScrolling = true;
|
|
3066
|
+
this._ngZone.runOutsideAngular(this.startScrollInterval);
|
|
3067
|
+
}
|
|
3068
|
+
else {
|
|
3069
|
+
this.dragScrolling = false;
|
|
3070
|
+
this.stopScrolling();
|
|
3071
|
+
}
|
|
3072
|
+
}
|
|
3073
|
+
}
|
|
3074
|
+
// Conditions to stop auto-scroll: when the start is greater than the end and the bar appears in the view
|
|
3075
|
+
isStartGreaterThanEndWhenBarHandleDragMove(isBefore) {
|
|
3076
|
+
let isStartGreaterThanEnd;
|
|
3077
|
+
let isBarAppearsInView;
|
|
3078
|
+
const scrollLeft = this.dom.mainContainer.scrollLeft;
|
|
3079
|
+
const clientWidth = this.dom.mainContainer.clientWidth;
|
|
3080
|
+
const xThreshold = clientWidth * DROP_PROXIMITY_THRESHOLD;
|
|
3081
|
+
if (isBefore) {
|
|
3082
|
+
const { start, oneDayWidth } = this.startOfBarHandle();
|
|
3083
|
+
const xPointerByEndDate = this.ganttUpper.view.getXPointByDate(this.item.end);
|
|
3084
|
+
isStartGreaterThanEnd = start.value > this.item.end.value;
|
|
3085
|
+
isBarAppearsInView = xPointerByEndDate + oneDayWidth + xThreshold <= scrollLeft + clientWidth;
|
|
3086
|
+
}
|
|
3087
|
+
else {
|
|
3088
|
+
const { end } = this.endOfBarHandle();
|
|
3089
|
+
const xPointerByStartDate = this.ganttUpper.view.getXPointByDate(this.item.start);
|
|
3090
|
+
isStartGreaterThanEnd = end.value < this.item.start.value;
|
|
3091
|
+
isBarAppearsInView = scrollLeft + xThreshold <= xPointerByStartDate;
|
|
3092
|
+
}
|
|
3093
|
+
return isStartGreaterThanEnd && isBarAppearsInView ? true : false;
|
|
3094
|
+
}
|
|
3095
|
+
// Some data information about dragging start until it is equal to or greater than end
|
|
3096
|
+
startOfBarHandle() {
|
|
3097
|
+
const x = this.item.refs.x + this.barHandleDragMoveAndScrollDistance;
|
|
3098
|
+
return {
|
|
3099
|
+
x,
|
|
3100
|
+
start: this.ganttUpper.view.getDateByXPoint(x),
|
|
3101
|
+
oneDayWidth: this.ganttUpper.view.getDateRangeWidth(this.item.end.startOfDay(), this.item.end)
|
|
3102
|
+
};
|
|
3103
|
+
}
|
|
3104
|
+
// Some data information about dragging end of bar handle
|
|
3105
|
+
endOfBarHandle() {
|
|
3106
|
+
const width = this.item.refs.width + this.barHandleDragMoveAndScrollDistance;
|
|
3107
|
+
return {
|
|
3108
|
+
width,
|
|
3109
|
+
end: this.ganttUpper.view.getDateByXPoint(this.item.refs.x + width)
|
|
3110
|
+
};
|
|
3111
|
+
}
|
|
3112
|
+
stopScrolling() {
|
|
3113
|
+
this.stopScrollTimers$.next();
|
|
3114
|
+
}
|
|
3115
|
+
isStartOrEndInsideView(start, end) {
|
|
3116
|
+
const itemStart = start.getUnixTime();
|
|
3117
|
+
const itemEnd = end.getUnixTime();
|
|
3118
|
+
const viewStart = this.ganttUpper.view.start.getUnixTime();
|
|
3119
|
+
const viewEnd = this.ganttUpper.view.end.getUnixTime();
|
|
3120
|
+
if (itemStart < viewStart || itemEnd > viewEnd) {
|
|
3121
|
+
return false;
|
|
3122
|
+
}
|
|
3123
|
+
else {
|
|
3124
|
+
return true;
|
|
3163
3125
|
}
|
|
3164
3126
|
}
|
|
3165
3127
|
createDrags(elementRef, item, ganttUpper) {
|
|
@@ -3175,13 +3137,6 @@ class GanttBarDrag {
|
|
|
3175
3137
|
const dragRef = this.createBarDrag();
|
|
3176
3138
|
const dragHandlesRefs = this.createBarHandleDrags();
|
|
3177
3139
|
this.dragRefs.push(dragRef, ...dragHandlesRefs);
|
|
3178
|
-
// 创建拖拽容器并将所有元素添加到容器中,利用容器来实现自动滚动
|
|
3179
|
-
if (!this.dropListRef) {
|
|
3180
|
-
this.dropListRef = this.dragDrop.createDropList(this.dom.mainContainer);
|
|
3181
|
-
this.dropListRef.autoScrollStep = autoScrollStep;
|
|
3182
|
-
this.dropListRef.withOrientation('horizontal');
|
|
3183
|
-
}
|
|
3184
|
-
this.dropListRef.withItems([dragRef, ...dragHandlesRefs]);
|
|
3185
3140
|
}
|
|
3186
3141
|
if (!this.linkDragDisabled) {
|
|
3187
3142
|
const linkDragRefs = this.createLinkHandleDrags();
|
|
@@ -3197,17 +3152,15 @@ class GanttBarDrag {
|
|
|
3197
3152
|
this.dragRefs.forEach((dragRef) => dragRef.dispose());
|
|
3198
3153
|
this.destroy$.next();
|
|
3199
3154
|
this.destroy$.complete();
|
|
3155
|
+
this.stopScrolling();
|
|
3156
|
+
this.stopScrollTimers$.complete();
|
|
3200
3157
|
}
|
|
3201
3158
|
}
|
|
3202
|
-
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:
|
|
3159
|
+
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 });
|
|
3203
3160
|
GanttBarDrag.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: GanttBarDrag });
|
|
3204
3161
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: GanttBarDrag, decorators: [{
|
|
3205
3162
|
type: Injectable
|
|
3206
|
-
}], ctorParameters: function () {
|
|
3207
|
-
return [{ type: i2.DragDrop }, { type: GanttDomService }, { type: GanttDragContainer }, { type: NgxGanttRootComponent, decorators: [{
|
|
3208
|
-
type: SkipSelf
|
|
3209
|
-
}] }];
|
|
3210
|
-
} });
|
|
3163
|
+
}], ctorParameters: function () { return [{ type: i2.DragDrop }, { type: GanttDomService }, { type: GanttDragContainer }, { type: i0.NgZone }]; } });
|
|
3211
3164
|
|
|
3212
3165
|
class GanttItemUpper {
|
|
3213
3166
|
constructor(elementRef, ganttUpper) {
|
|
@@ -3215,10 +3168,11 @@ class GanttItemUpper {
|
|
|
3215
3168
|
this.ganttUpper = ganttUpper;
|
|
3216
3169
|
this.firstChange = true;
|
|
3217
3170
|
this.unsubscribe$ = new Subject();
|
|
3171
|
+
this.refsUnsubscribe$ = new Subject();
|
|
3218
3172
|
}
|
|
3219
3173
|
ngOnInit() {
|
|
3220
3174
|
this.firstChange = false;
|
|
3221
|
-
this.item.refs$.pipe(takeUntil(this.
|
|
3175
|
+
this.item.refs$.pipe(takeUntil(this.refsUnsubscribe$)).subscribe(() => {
|
|
3222
3176
|
this.setPositions();
|
|
3223
3177
|
});
|
|
3224
3178
|
}
|
|
@@ -3228,11 +3182,10 @@ class GanttItemUpper {
|
|
|
3228
3182
|
}
|
|
3229
3183
|
}
|
|
3230
3184
|
itemChange(item) {
|
|
3231
|
-
this.
|
|
3232
|
-
this.
|
|
3185
|
+
this.refsUnsubscribe$.next();
|
|
3186
|
+
this.refsUnsubscribe$.complete();
|
|
3233
3187
|
this.item = item;
|
|
3234
|
-
this.
|
|
3235
|
-
this.item.refs$.pipe(takeUntil(this.unsubscribe$)).subscribe(() => {
|
|
3188
|
+
this.item.refs$.pipe(takeUntil(this.refsUnsubscribe$)).subscribe(() => {
|
|
3236
3189
|
this.setPositions();
|
|
3237
3190
|
});
|
|
3238
3191
|
}
|
|
@@ -3252,6 +3205,8 @@ class GanttItemUpper {
|
|
|
3252
3205
|
ngOnDestroy() {
|
|
3253
3206
|
this.unsubscribe$.next();
|
|
3254
3207
|
this.unsubscribe$.complete();
|
|
3208
|
+
this.refsUnsubscribe$.next();
|
|
3209
|
+
this.refsUnsubscribe$.complete();
|
|
3255
3210
|
}
|
|
3256
3211
|
}
|
|
3257
3212
|
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 });
|
|
@@ -3289,9 +3244,14 @@ class NgxGanttBarComponent extends GanttItemUpper {
|
|
|
3289
3244
|
});
|
|
3290
3245
|
}
|
|
3291
3246
|
ngOnChanges(changes) {
|
|
3247
|
+
var _a, _b;
|
|
3292
3248
|
super.ngOnChanges(changes);
|
|
3293
3249
|
if (!this.firstChange) {
|
|
3294
3250
|
this.drag.updateItem(this.item);
|
|
3251
|
+
if (((_a = changes.item.currentValue.refs) === null || _a === void 0 ? void 0 : _a.width) !== ((_b = changes.item.previousValue.refs) === null || _b === void 0 ? void 0 : _b.width) ||
|
|
3252
|
+
changes.item.currentValue.color !== changes.item.previousValue.color) {
|
|
3253
|
+
this.setContentBackground();
|
|
3254
|
+
}
|
|
3295
3255
|
}
|
|
3296
3256
|
}
|
|
3297
3257
|
ngAfterViewInit() {
|
|
@@ -3315,174 +3275,511 @@ class NgxGanttBarComponent extends GanttItemUpper {
|
|
|
3315
3275
|
event.stopPropagation();
|
|
3316
3276
|
});
|
|
3317
3277
|
}
|
|
3318
|
-
onBarClick(event) {
|
|
3319
|
-
this.barClick.emit({ event, item: this.item.origin });
|
|
3320
|
-
}
|
|
3321
|
-
setContentBackground() {
|
|
3322
|
-
|
|
3323
|
-
|
|
3324
|
-
|
|
3325
|
-
|
|
3326
|
-
style
|
|
3327
|
-
|
|
3328
|
-
|
|
3329
|
-
|
|
3330
|
-
|
|
3331
|
-
|
|
3332
|
-
|
|
3333
|
-
|
|
3334
|
-
|
|
3335
|
-
|
|
3336
|
-
|
|
3337
|
-
|
|
3338
|
-
|
|
3339
|
-
|
|
3340
|
-
|
|
3341
|
-
|
|
3342
|
-
|
|
3343
|
-
|
|
3344
|
-
|
|
3345
|
-
|
|
3346
|
-
|
|
3347
|
-
|
|
3278
|
+
onBarClick(event) {
|
|
3279
|
+
this.barClick.emit({ event, item: this.item.origin });
|
|
3280
|
+
}
|
|
3281
|
+
setContentBackground() {
|
|
3282
|
+
var _a;
|
|
3283
|
+
if ((_a = this.item.refs) === null || _a === void 0 ? void 0 : _a.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
|
+
}
|
|
3309
|
+
}
|
|
3310
|
+
}
|
|
3311
|
+
}
|
|
3312
|
+
stopPropagation(event) {
|
|
3313
|
+
event.stopPropagation();
|
|
3314
|
+
}
|
|
3315
|
+
}
|
|
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 });
|
|
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"] }] });
|
|
3318
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: NgxGanttBarComponent, decorators: [{
|
|
3319
|
+
type: Component,
|
|
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" }]
|
|
3321
|
+
}], ctorParameters: function () {
|
|
3322
|
+
return [{ type: GanttDragContainer }, { type: GanttBarDrag }, { type: i0.ElementRef }, { type: GanttUpper, decorators: [{
|
|
3323
|
+
type: Inject,
|
|
3324
|
+
args: [GANTT_UPPER_TOKEN]
|
|
3325
|
+
}] }, { type: i0.NgZone }];
|
|
3326
|
+
}, propDecorators: { barClick: [{
|
|
3327
|
+
type: Output
|
|
3328
|
+
}], contentElementRef: [{
|
|
3329
|
+
type: ViewChild,
|
|
3330
|
+
args: ['content']
|
|
3331
|
+
}], ganttItemClass: [{
|
|
3332
|
+
type: HostBinding,
|
|
3333
|
+
args: ['class.gantt-bar']
|
|
3334
|
+
}], handles: [{
|
|
3335
|
+
type: ViewChildren,
|
|
3336
|
+
args: ['handle']
|
|
3337
|
+
}] } });
|
|
3338
|
+
|
|
3339
|
+
class NgxGanttRangeComponent extends GanttItemUpper {
|
|
3340
|
+
constructor(elementRef, ganttUpper) {
|
|
3341
|
+
super(elementRef, ganttUpper);
|
|
3342
|
+
this.ganttRangeClass = true;
|
|
3343
|
+
}
|
|
3344
|
+
}
|
|
3345
|
+
NgxGanttRangeComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: NgxGanttRangeComponent, deps: [{ token: i0.ElementRef }, { token: GANTT_UPPER_TOKEN }], target: i0.ɵɵFactoryTarget.Component });
|
|
3346
|
+
NgxGanttRangeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.4", type: NgxGanttRangeComponent, selector: "ngx-gantt-range,gantt-range", host: { properties: { "class.gantt-range": "this.ganttRangeClass" } }, usesInheritance: true, ngImport: i0, template: "<ng-container *ngIf=\"item.start && item.end\">\n <div class=\"gantt-range-main\">\n <div class=\"gantt-range-main-progress\" *ngIf=\"item.progress >= 0\" [style.width.%]=\"item.progress * 100\"></div>\n </div>\n <div class=\"gantt-range-triangle left\"></div>\n <div class=\"gantt-range-triangle right\"></div>\n <ng-template [ngTemplateOutlet]=\"template\" [ngTemplateOutletContext]=\"{ item: item.origin, refs: item.refs }\"></ng-template>\n</ng-container>\n", dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
|
|
3347
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: NgxGanttRangeComponent, decorators: [{
|
|
3348
|
+
type: Component,
|
|
3349
|
+
args: [{ selector: 'ngx-gantt-range,gantt-range', template: "<ng-container *ngIf=\"item.start && item.end\">\n <div class=\"gantt-range-main\">\n <div class=\"gantt-range-main-progress\" *ngIf=\"item.progress >= 0\" [style.width.%]=\"item.progress * 100\"></div>\n </div>\n <div class=\"gantt-range-triangle left\"></div>\n <div class=\"gantt-range-triangle right\"></div>\n <ng-template [ngTemplateOutlet]=\"template\" [ngTemplateOutletContext]=\"{ item: item.origin, refs: item.refs }\"></ng-template>\n</ng-container>\n" }]
|
|
3350
|
+
}], ctorParameters: function () {
|
|
3351
|
+
return [{ type: i0.ElementRef }, { type: GanttUpper, decorators: [{
|
|
3352
|
+
type: Inject,
|
|
3353
|
+
args: [GANTT_UPPER_TOKEN]
|
|
3354
|
+
}] }];
|
|
3355
|
+
}, propDecorators: { ganttRangeClass: [{
|
|
3356
|
+
type: HostBinding,
|
|
3357
|
+
args: ['class.gantt-range']
|
|
3358
|
+
}] } });
|
|
3359
|
+
|
|
3360
|
+
class NgxGanttBaselineComponent {
|
|
3361
|
+
constructor(elementRef, ganttUpper) {
|
|
3362
|
+
this.elementRef = elementRef;
|
|
3363
|
+
this.ganttUpper = ganttUpper;
|
|
3364
|
+
this.unsubscribe$ = new Subject();
|
|
3365
|
+
this.ganttBaselineClass = true;
|
|
3366
|
+
}
|
|
3367
|
+
ngOnInit() {
|
|
3368
|
+
this.baselineItem.refs$.pipe(takeUntil(this.unsubscribe$)).subscribe(() => {
|
|
3369
|
+
this.setPositions();
|
|
3370
|
+
});
|
|
3371
|
+
}
|
|
3372
|
+
setPositions() {
|
|
3373
|
+
const itemElement = this.elementRef.nativeElement;
|
|
3374
|
+
itemElement.style.left = this.baselineItem.refs.x + 'px';
|
|
3375
|
+
itemElement.style.bottom = '2px';
|
|
3376
|
+
itemElement.style.width = this.baselineItem.refs.width + 'px';
|
|
3377
|
+
}
|
|
3378
|
+
}
|
|
3379
|
+
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 });
|
|
3380
|
+
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"] }] });
|
|
3381
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: NgxGanttBaselineComponent, decorators: [{
|
|
3382
|
+
type: Component,
|
|
3383
|
+
args: [{ selector: 'ngx-gantt-baseline,gantt-baseline', template: "<div #content *ngIf=\"baselineItem\" class=\"baseline-content\"></div>\n" }]
|
|
3384
|
+
}], ctorParameters: function () {
|
|
3385
|
+
return [{ type: i0.ElementRef }, { type: GanttUpper, decorators: [{
|
|
3386
|
+
type: Inject,
|
|
3387
|
+
args: [GANTT_UPPER_TOKEN]
|
|
3388
|
+
}] }];
|
|
3389
|
+
}, propDecorators: { baselineItem: [{
|
|
3390
|
+
type: Input
|
|
3391
|
+
}], ganttBaselineClass: [{
|
|
3392
|
+
type: HostBinding,
|
|
3393
|
+
args: ['class.gantt-baseline']
|
|
3394
|
+
}] } });
|
|
3395
|
+
|
|
3396
|
+
class GanttMainComponent {
|
|
3397
|
+
constructor(ganttUpper) {
|
|
3398
|
+
this.ganttUpper = ganttUpper;
|
|
3399
|
+
this.barClick = new EventEmitter();
|
|
3400
|
+
this.lineClick = new EventEmitter();
|
|
3401
|
+
this.ganttMainClass = true;
|
|
3402
|
+
}
|
|
3403
|
+
trackBy(index, item) {
|
|
3404
|
+
return item.id || index;
|
|
3405
|
+
}
|
|
3406
|
+
}
|
|
3407
|
+
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 });
|
|
3408
|
+
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" }] });
|
|
3409
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: GanttMainComponent, decorators: [{
|
|
3410
|
+
type: Component,
|
|
3411
|
+
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" }]
|
|
3412
|
+
}], ctorParameters: function () {
|
|
3413
|
+
return [{ type: GanttUpper, decorators: [{
|
|
3414
|
+
type: Inject,
|
|
3415
|
+
args: [GANTT_UPPER_TOKEN]
|
|
3416
|
+
}] }];
|
|
3417
|
+
}, propDecorators: { renderData: [{
|
|
3418
|
+
type: Input
|
|
3419
|
+
}], flatData: [{
|
|
3420
|
+
type: Input
|
|
3421
|
+
}], groupHeaderTemplate: [{
|
|
3422
|
+
type: Input
|
|
3423
|
+
}], itemTemplate: [{
|
|
3424
|
+
type: Input
|
|
3425
|
+
}], barTemplate: [{
|
|
3426
|
+
type: Input
|
|
3427
|
+
}], rangeTemplate: [{
|
|
3428
|
+
type: Input
|
|
3429
|
+
}], barClick: [{
|
|
3430
|
+
type: Output
|
|
3431
|
+
}], lineClick: [{
|
|
3432
|
+
type: Output
|
|
3433
|
+
}], ganttMainClass: [{
|
|
3434
|
+
type: HostBinding,
|
|
3435
|
+
args: ['class.gantt-main-container']
|
|
3436
|
+
}] } });
|
|
3437
|
+
|
|
3438
|
+
class GanttCalendarHeaderComponent {
|
|
3439
|
+
get view() {
|
|
3440
|
+
return this.ganttUpper.view;
|
|
3441
|
+
}
|
|
3442
|
+
constructor(ganttUpper, ngZone, elementRef) {
|
|
3443
|
+
this.ganttUpper = ganttUpper;
|
|
3444
|
+
this.ngZone = ngZone;
|
|
3445
|
+
this.elementRef = elementRef;
|
|
3446
|
+
this.unsubscribe$ = new Subject();
|
|
3447
|
+
this.headerHeight = headerHeight;
|
|
3448
|
+
this.viewTypes = GanttViewType;
|
|
3449
|
+
this.className = `gantt-calendar gantt-calendar-header`;
|
|
3450
|
+
}
|
|
3451
|
+
ngOnInit() {
|
|
3452
|
+
this.ngZone.onStable.pipe(take(1)).subscribe(() => {
|
|
3453
|
+
merge(this.ganttUpper.viewChange, this.ganttUpper.view.start$)
|
|
3454
|
+
.pipe(takeUntil(this.unsubscribe$))
|
|
3455
|
+
.subscribe(() => {
|
|
3456
|
+
if (this.ganttUpper.viewType === GanttViewType.day)
|
|
3457
|
+
this.setTodayPoint();
|
|
3458
|
+
});
|
|
3459
|
+
});
|
|
3460
|
+
}
|
|
3461
|
+
setTodayPoint() {
|
|
3462
|
+
const x = this.view.getTodayXPoint();
|
|
3463
|
+
const today = new GanttDate().getDate();
|
|
3464
|
+
const todayEle = this.elementRef.nativeElement.getElementsByClassName('gantt-calendar-today-overlay')[0];
|
|
3465
|
+
const rect = this.elementRef.nativeElement.getElementsByClassName('today-rect')[0];
|
|
3466
|
+
if (isNumber(x)) {
|
|
3467
|
+
if (rect) {
|
|
3468
|
+
rect.style.left = `${x - todayWidth / 2}px`;
|
|
3469
|
+
rect.style.top = `${headerHeight - todayHeight}px`;
|
|
3470
|
+
rect.innerHTML = today.toString();
|
|
3471
|
+
}
|
|
3472
|
+
}
|
|
3473
|
+
else {
|
|
3474
|
+
todayEle.style.display = 'none';
|
|
3475
|
+
}
|
|
3476
|
+
}
|
|
3477
|
+
trackBy(point, index) {
|
|
3478
|
+
return point.text || index;
|
|
3479
|
+
}
|
|
3480
|
+
}
|
|
3481
|
+
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 });
|
|
3482
|
+
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"] }] });
|
|
3483
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: GanttCalendarHeaderComponent, decorators: [{
|
|
3484
|
+
type: Component,
|
|
3485
|
+
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" }]
|
|
3486
|
+
}], ctorParameters: function () {
|
|
3487
|
+
return [{ type: GanttUpper, decorators: [{
|
|
3488
|
+
type: Inject,
|
|
3489
|
+
args: [GANTT_UPPER_TOKEN]
|
|
3490
|
+
}] }, { type: i0.NgZone }, { type: i0.ElementRef }];
|
|
3491
|
+
}, propDecorators: { className: [{
|
|
3492
|
+
type: HostBinding,
|
|
3493
|
+
args: ['class']
|
|
3494
|
+
}] } });
|
|
3495
|
+
|
|
3496
|
+
const mainHeight = 5000;
|
|
3497
|
+
class GanttCalendarGridComponent {
|
|
3498
|
+
get view() {
|
|
3499
|
+
return this.ganttUpper.view;
|
|
3500
|
+
}
|
|
3501
|
+
constructor(ganttUpper, ngZone, elementRef) {
|
|
3502
|
+
this.ganttUpper = ganttUpper;
|
|
3503
|
+
this.ngZone = ngZone;
|
|
3504
|
+
this.elementRef = elementRef;
|
|
3505
|
+
this.unsubscribe$ = new Subject();
|
|
3506
|
+
this.headerHeight = headerHeight;
|
|
3507
|
+
this.mainHeight = mainHeight;
|
|
3508
|
+
this.todayBorderRadius = todayBorderRadius;
|
|
3509
|
+
this.viewTypes = GanttViewType;
|
|
3510
|
+
this.className = `gantt-calendar gantt-calendar-grid`;
|
|
3511
|
+
}
|
|
3512
|
+
setTodayPoint() {
|
|
3513
|
+
const x = this.view.getTodayXPoint();
|
|
3514
|
+
const todayEle = this.elementRef.nativeElement.getElementsByClassName('gantt-calendar-today-overlay')[0];
|
|
3515
|
+
const line = this.elementRef.nativeElement.getElementsByClassName('today-line')[0];
|
|
3516
|
+
if (isNumber(x)) {
|
|
3517
|
+
if (line) {
|
|
3518
|
+
line.style.left = `${x}px`;
|
|
3519
|
+
line.style.top = `0px`;
|
|
3520
|
+
line.style.bottom = `${-mainHeight}px`;
|
|
3521
|
+
}
|
|
3522
|
+
}
|
|
3523
|
+
else {
|
|
3524
|
+
todayEle.style.display = 'none';
|
|
3525
|
+
}
|
|
3526
|
+
}
|
|
3527
|
+
ngOnInit() {
|
|
3528
|
+
this.ngZone.onStable.pipe(take(1)).subscribe(() => {
|
|
3529
|
+
merge(this.ganttUpper.viewChange, this.ganttUpper.view.start$)
|
|
3530
|
+
.pipe(takeUntil(this.unsubscribe$))
|
|
3531
|
+
.subscribe(() => {
|
|
3532
|
+
this.setTodayPoint();
|
|
3533
|
+
});
|
|
3534
|
+
});
|
|
3535
|
+
}
|
|
3536
|
+
trackBy(point, index) {
|
|
3537
|
+
return point.text || index;
|
|
3348
3538
|
}
|
|
3349
|
-
|
|
3350
|
-
|
|
3539
|
+
ngOnDestroy() {
|
|
3540
|
+
this.unsubscribe$.next();
|
|
3541
|
+
this.unsubscribe$.complete();
|
|
3351
3542
|
}
|
|
3352
3543
|
}
|
|
3353
|
-
|
|
3354
|
-
|
|
3355
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type:
|
|
3544
|
+
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 });
|
|
3545
|
+
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"] }] });
|
|
3546
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: GanttCalendarGridComponent, decorators: [{
|
|
3356
3547
|
type: Component,
|
|
3357
|
-
args: [{ selector: '
|
|
3548
|
+
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" }]
|
|
3358
3549
|
}], ctorParameters: function () {
|
|
3359
|
-
return [{ type:
|
|
3550
|
+
return [{ type: GanttUpper, decorators: [{
|
|
3360
3551
|
type: Inject,
|
|
3361
3552
|
args: [GANTT_UPPER_TOKEN]
|
|
3362
|
-
}] }, { type: i0.NgZone }];
|
|
3363
|
-
}, propDecorators: {
|
|
3364
|
-
type: Output
|
|
3365
|
-
}], contentElementRef: [{
|
|
3366
|
-
type: ViewChild,
|
|
3367
|
-
args: ['content']
|
|
3368
|
-
}], ganttItemClass: [{
|
|
3553
|
+
}] }, { type: i0.NgZone }, { type: i0.ElementRef }];
|
|
3554
|
+
}, propDecorators: { className: [{
|
|
3369
3555
|
type: HostBinding,
|
|
3370
|
-
args: ['class
|
|
3371
|
-
}], handles: [{
|
|
3372
|
-
type: ViewChildren,
|
|
3373
|
-
args: ['handle']
|
|
3556
|
+
args: ['class']
|
|
3374
3557
|
}] } });
|
|
3375
3558
|
|
|
3376
|
-
class
|
|
3377
|
-
|
|
3378
|
-
|
|
3379
|
-
|
|
3559
|
+
class GanttLoaderComponent {
|
|
3560
|
+
}
|
|
3561
|
+
GanttLoaderComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: GanttLoaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3562
|
+
GanttLoaderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.4", type: GanttLoaderComponent, selector: "gantt-loader", host: { classAttribute: "gantt-loader gantt-loader-overlay" }, ngImport: i0, template: `
|
|
3563
|
+
<div class="gantt-loader-wrapper">
|
|
3564
|
+
<div class="gantt-loader-loading">
|
|
3565
|
+
<span class="gantt-loader-loading-spot"></span>
|
|
3566
|
+
</div>
|
|
3567
|
+
</div>
|
|
3568
|
+
`, isInline: true });
|
|
3569
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: GanttLoaderComponent, decorators: [{
|
|
3570
|
+
type: Component,
|
|
3571
|
+
args: [{
|
|
3572
|
+
selector: 'gantt-loader',
|
|
3573
|
+
template: `
|
|
3574
|
+
<div class="gantt-loader-wrapper">
|
|
3575
|
+
<div class="gantt-loader-loading">
|
|
3576
|
+
<span class="gantt-loader-loading-spot"></span>
|
|
3577
|
+
</div>
|
|
3578
|
+
</div>
|
|
3579
|
+
`,
|
|
3580
|
+
host: {
|
|
3581
|
+
class: 'gantt-loader gantt-loader-overlay'
|
|
3582
|
+
}
|
|
3583
|
+
}]
|
|
3584
|
+
}] });
|
|
3585
|
+
|
|
3586
|
+
class GanttDragBackdropComponent {
|
|
3587
|
+
}
|
|
3588
|
+
GanttDragBackdropComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: GanttDragBackdropComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3589
|
+
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" });
|
|
3590
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: GanttDragBackdropComponent, decorators: [{
|
|
3591
|
+
type: Component,
|
|
3592
|
+
args: [{ selector: 'gantt-drag-backdrop', host: {
|
|
3593
|
+
class: 'gantt-drag-backdrop'
|
|
3594
|
+
}, 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" }]
|
|
3595
|
+
}] });
|
|
3596
|
+
|
|
3597
|
+
class NgxGanttToolbarComponent {
|
|
3598
|
+
constructor(ganttUpper) {
|
|
3599
|
+
this.ganttUpper = ganttUpper;
|
|
3600
|
+
this.ganttItemClass = true;
|
|
3601
|
+
this.ganttViewsMap = keyBy(ganttViews, 'value');
|
|
3602
|
+
}
|
|
3603
|
+
selectView(view) {
|
|
3604
|
+
this.ganttUpper.changeView(view);
|
|
3380
3605
|
}
|
|
3381
3606
|
}
|
|
3382
|
-
|
|
3383
|
-
|
|
3384
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type:
|
|
3607
|
+
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 });
|
|
3608
|
+
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"] }] });
|
|
3609
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: NgxGanttToolbarComponent, decorators: [{
|
|
3385
3610
|
type: Component,
|
|
3386
|
-
args: [{ selector: 'ngx-gantt-
|
|
3611
|
+
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" }]
|
|
3387
3612
|
}], ctorParameters: function () {
|
|
3388
|
-
return [{ type:
|
|
3613
|
+
return [{ type: GanttUpper, decorators: [{
|
|
3389
3614
|
type: Inject,
|
|
3390
3615
|
args: [GANTT_UPPER_TOKEN]
|
|
3391
3616
|
}] }];
|
|
3392
|
-
}, propDecorators: {
|
|
3617
|
+
}, propDecorators: { template: [{
|
|
3618
|
+
type: Input
|
|
3619
|
+
}], ganttItemClass: [{
|
|
3393
3620
|
type: HostBinding,
|
|
3394
|
-
args: ['class.gantt-
|
|
3621
|
+
args: ['class.gantt-toolbar']
|
|
3395
3622
|
}] } });
|
|
3396
3623
|
|
|
3397
|
-
class
|
|
3398
|
-
|
|
3624
|
+
class NgxGanttRootComponent {
|
|
3625
|
+
get view() {
|
|
3626
|
+
return this.ganttUpper.view;
|
|
3627
|
+
}
|
|
3628
|
+
constructor(elementRef, ngZone, dom, dragContainer, ganttUpper, printService) {
|
|
3399
3629
|
this.elementRef = elementRef;
|
|
3630
|
+
this.ngZone = ngZone;
|
|
3631
|
+
this.dom = dom;
|
|
3632
|
+
this.dragContainer = dragContainer;
|
|
3400
3633
|
this.ganttUpper = ganttUpper;
|
|
3634
|
+
this.printService = printService;
|
|
3401
3635
|
this.unsubscribe$ = new Subject();
|
|
3402
|
-
this.
|
|
3636
|
+
this.ganttUpper.dragContainer = dragContainer;
|
|
3403
3637
|
}
|
|
3404
3638
|
ngOnInit() {
|
|
3405
|
-
|
|
3406
|
-
|
|
3639
|
+
// Note: the zone may be nooped through `BootstrapOptions` when bootstrapping the root module. This means
|
|
3640
|
+
// the `onStable` will never emit any value.
|
|
3641
|
+
const onStable$ = this.ngZone.isStable ? from(Promise.resolve()) : this.ngZone.onStable.pipe(take(1));
|
|
3642
|
+
// Normally this isn't in the zone, but it can cause performance regressions for apps
|
|
3643
|
+
// using `zone-patch-rxjs` because it'll trigger a change detection when it unsubscribes.
|
|
3644
|
+
this.ngZone.runOutsideAngular(() => {
|
|
3645
|
+
onStable$.pipe(takeUntil(this.unsubscribe$)).subscribe(() => {
|
|
3646
|
+
this.dom.initialize(this.elementRef);
|
|
3647
|
+
if (this.printService) {
|
|
3648
|
+
this.printService.register(this.elementRef);
|
|
3649
|
+
}
|
|
3650
|
+
this.setupScrollClass();
|
|
3651
|
+
this.setupResize();
|
|
3652
|
+
this.setupViewScroll();
|
|
3653
|
+
// 优化初始化时Scroll滚动体验问题,通过透明度解决,默认透明度为0,滚动结束后恢复
|
|
3654
|
+
this.elementRef.nativeElement.style.opacity = '1';
|
|
3655
|
+
this.ganttUpper.viewChange.pipe(startWith$1(null), takeUntil(this.unsubscribe$)).subscribe(() => {
|
|
3656
|
+
this.scrollToToday();
|
|
3657
|
+
});
|
|
3658
|
+
});
|
|
3407
3659
|
});
|
|
3408
3660
|
}
|
|
3409
|
-
|
|
3410
|
-
|
|
3411
|
-
itemElement.style.left = this.baselineItem.refs.x + 'px';
|
|
3412
|
-
itemElement.style.bottom = '2px';
|
|
3413
|
-
itemElement.style.width = this.baselineItem.refs.width + 'px';
|
|
3661
|
+
ngOnDestroy() {
|
|
3662
|
+
this.unsubscribe$.next();
|
|
3414
3663
|
}
|
|
3415
|
-
|
|
3416
|
-
|
|
3417
|
-
|
|
3418
|
-
|
|
3419
|
-
|
|
3420
|
-
|
|
3421
|
-
|
|
3422
|
-
|
|
3423
|
-
|
|
3424
|
-
|
|
3425
|
-
|
|
3426
|
-
|
|
3427
|
-
|
|
3428
|
-
|
|
3429
|
-
|
|
3430
|
-
|
|
3431
|
-
}
|
|
3432
|
-
|
|
3433
|
-
|
|
3434
|
-
|
|
3435
|
-
|
|
3436
|
-
|
|
3437
|
-
|
|
3438
|
-
|
|
3664
|
+
setupViewScroll() {
|
|
3665
|
+
if (this.ganttUpper.disabledLoadOnScroll) {
|
|
3666
|
+
return;
|
|
3667
|
+
}
|
|
3668
|
+
this.dom
|
|
3669
|
+
.getViewerScroll(passiveListenerOptions)
|
|
3670
|
+
.pipe(takeUntil(this.unsubscribe$))
|
|
3671
|
+
.subscribe((event) => {
|
|
3672
|
+
if (event.direction === ScrollDirection.LEFT) {
|
|
3673
|
+
const dates = this.view.addStartDate();
|
|
3674
|
+
if (dates) {
|
|
3675
|
+
event.target.scrollLeft += this.view.getDateRangeWidth(dates.start, dates.end);
|
|
3676
|
+
if (this.ganttUpper.loadOnScroll.observers) {
|
|
3677
|
+
this.ngZone.run(() => this.ganttUpper.loadOnScroll.emit({ start: dates.start.getUnixTime(), end: dates.end.getUnixTime() }));
|
|
3678
|
+
}
|
|
3679
|
+
}
|
|
3680
|
+
}
|
|
3681
|
+
if (event.direction === ScrollDirection.RIGHT) {
|
|
3682
|
+
const dates = this.view.addEndDate();
|
|
3683
|
+
if (dates && this.ganttUpper.loadOnScroll.observers) {
|
|
3684
|
+
this.ngZone.run(() => this.ganttUpper.loadOnScroll.emit({ start: dates.start.getUnixTime(), end: dates.end.getUnixTime() }));
|
|
3685
|
+
}
|
|
3686
|
+
}
|
|
3687
|
+
});
|
|
3439
3688
|
}
|
|
3440
|
-
|
|
3441
|
-
|
|
3689
|
+
setupResize() {
|
|
3690
|
+
this.dom
|
|
3691
|
+
.getResize()
|
|
3692
|
+
.pipe(takeUntil(this.unsubscribe$))
|
|
3693
|
+
.subscribe(() => {
|
|
3694
|
+
this.setupScrollClass();
|
|
3695
|
+
});
|
|
3696
|
+
}
|
|
3697
|
+
setupScrollClass() {
|
|
3698
|
+
const mainContainer = this.dom.mainContainer;
|
|
3699
|
+
const height = mainContainer.offsetHeight;
|
|
3700
|
+
const scrollHeight = mainContainer.scrollHeight;
|
|
3701
|
+
if (scrollHeight > height) {
|
|
3702
|
+
this.elementRef.nativeElement.className = 'gantt gantt-scroll';
|
|
3703
|
+
}
|
|
3704
|
+
else {
|
|
3705
|
+
this.elementRef.nativeElement.className = 'gantt';
|
|
3706
|
+
}
|
|
3707
|
+
}
|
|
3708
|
+
scrollToToday() {
|
|
3709
|
+
const x = this.view.getTodayXPoint();
|
|
3710
|
+
this.dom.scrollMainContainer(x);
|
|
3711
|
+
}
|
|
3712
|
+
scrollToDate(date) {
|
|
3713
|
+
let x;
|
|
3714
|
+
if (typeof date === 'number') {
|
|
3715
|
+
x = this.view.getXPointByDate(new GanttDate(date));
|
|
3716
|
+
}
|
|
3717
|
+
else {
|
|
3718
|
+
x = this.view.getXPointByDate(date);
|
|
3719
|
+
}
|
|
3720
|
+
this.dom.scrollMainContainer(x);
|
|
3442
3721
|
}
|
|
3443
3722
|
}
|
|
3444
|
-
|
|
3445
|
-
|
|
3446
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type:
|
|
3723
|
+
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 });
|
|
3724
|
+
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"] }] });
|
|
3725
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: NgxGanttRootComponent, decorators: [{
|
|
3447
3726
|
type: Component,
|
|
3448
|
-
args: [{ selector: 'gantt-
|
|
3727
|
+
args: [{ selector: 'ngx-gantt-root', providers: [GanttDomService, GanttDragContainer], host: {
|
|
3728
|
+
class: 'gantt'
|
|
3729
|
+
}, 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" }]
|
|
3449
3730
|
}], ctorParameters: function () {
|
|
3450
|
-
return [{ type: GanttUpper, decorators: [{
|
|
3731
|
+
return [{ type: i0.ElementRef }, { type: i0.NgZone }, { type: GanttDomService }, { type: GanttDragContainer }, { type: GanttUpper, decorators: [{
|
|
3451
3732
|
type: Inject,
|
|
3452
3733
|
args: [GANTT_UPPER_TOKEN]
|
|
3734
|
+
}] }, { type: GanttPrintService, decorators: [{
|
|
3735
|
+
type: Optional
|
|
3453
3736
|
}] }];
|
|
3454
|
-
}, propDecorators: {
|
|
3455
|
-
type: Input
|
|
3456
|
-
}], flatData: [{
|
|
3457
|
-
type: Input
|
|
3458
|
-
}], groupHeaderTemplate: [{
|
|
3459
|
-
type: Input
|
|
3460
|
-
}], itemTemplate: [{
|
|
3461
|
-
type: Input
|
|
3462
|
-
}], barTemplate: [{
|
|
3463
|
-
type: Input
|
|
3464
|
-
}], rangeTemplate: [{
|
|
3737
|
+
}, propDecorators: { sideWidth: [{
|
|
3465
3738
|
type: Input
|
|
3466
|
-
}],
|
|
3467
|
-
type:
|
|
3468
|
-
|
|
3469
|
-
|
|
3470
|
-
|
|
3471
|
-
|
|
3472
|
-
|
|
3739
|
+
}], sideTemplate: [{
|
|
3740
|
+
type: ContentChild,
|
|
3741
|
+
args: ['sideTemplate', { static: true }]
|
|
3742
|
+
}], mainTemplate: [{
|
|
3743
|
+
type: ContentChild,
|
|
3744
|
+
args: ['mainTemplate', { static: true }]
|
|
3745
|
+
}], backdrop: [{
|
|
3746
|
+
type: ViewChild,
|
|
3747
|
+
args: [GanttDragBackdropComponent, { static: true, read: ElementRef }]
|
|
3473
3748
|
}] } });
|
|
3474
3749
|
|
|
3475
3750
|
class NgxGanttComponent extends GanttUpper {
|
|
3751
|
+
set loading(loading) {
|
|
3752
|
+
if (loading) {
|
|
3753
|
+
if (this.loadingDelay > 0) {
|
|
3754
|
+
this.loadingTimer = setTimeout(() => {
|
|
3755
|
+
this._loading = loading;
|
|
3756
|
+
this.cdr.markForCheck();
|
|
3757
|
+
}, this.loadingDelay);
|
|
3758
|
+
}
|
|
3759
|
+
else {
|
|
3760
|
+
this._loading = loading;
|
|
3761
|
+
}
|
|
3762
|
+
}
|
|
3763
|
+
else {
|
|
3764
|
+
clearTimeout(this.loadingTimer);
|
|
3765
|
+
this._loading = loading;
|
|
3766
|
+
}
|
|
3767
|
+
}
|
|
3768
|
+
get loading() {
|
|
3769
|
+
return this._loading;
|
|
3770
|
+
}
|
|
3476
3771
|
constructor(elementRef, cdr, ngZone, printService, config) {
|
|
3477
3772
|
super(elementRef, cdr, ngZone, config);
|
|
3478
3773
|
this.printService = printService;
|
|
3479
3774
|
this.maxLevel = 2;
|
|
3775
|
+
this.loadingDelay = 0;
|
|
3480
3776
|
this.linkDragStarted = new EventEmitter();
|
|
3481
3777
|
this.linkDragEnded = new EventEmitter();
|
|
3482
3778
|
this.lineClick = new EventEmitter();
|
|
3483
3779
|
this.selectedChange = new EventEmitter();
|
|
3484
3780
|
this.flatData = [];
|
|
3485
3781
|
this.renderData = [];
|
|
3782
|
+
this._loading = false;
|
|
3486
3783
|
this.computeAllRefs = false;
|
|
3487
3784
|
}
|
|
3488
3785
|
ngOnInit() {
|
|
@@ -3642,7 +3939,7 @@ class NgxGanttComponent extends GanttUpper {
|
|
|
3642
3939
|
}
|
|
3643
3940
|
}
|
|
3644
3941
|
NgxGanttComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: NgxGanttComponent, deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }, { token: i0.NgZone }, { token: GanttPrintService, optional: true }, { token: GANTT_GLOBAL_CONFIG }], target: i0.ɵɵFactoryTarget.Component });
|
|
3645
|
-
NgxGanttComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.4", type: NgxGanttComponent, selector: "ngx-gantt", inputs: { maxLevel: "maxLevel", async: "async", childrenResolve: "childrenResolve", linkable: "linkable" }, outputs: { linkDragStarted: "linkDragStarted", linkDragEnded: "linkDragEnded", lineClick: "lineClick", selectedChange: "selectedChange" }, providers: [
|
|
3942
|
+
NgxGanttComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.4", type: NgxGanttComponent, selector: "ngx-gantt", inputs: { maxLevel: "maxLevel", async: "async", childrenResolve: "childrenResolve", linkable: "linkable", loading: "loading", loadingDelay: "loadingDelay" }, outputs: { linkDragStarted: "linkDragStarted", linkDragEnded: "linkDragEnded", lineClick: "lineClick", selectedChange: "selectedChange" }, providers: [
|
|
3646
3943
|
{
|
|
3647
3944
|
provide: GANTT_UPPER_TOKEN,
|
|
3648
3945
|
useExisting: NgxGanttComponent
|
|
@@ -3651,7 +3948,7 @@ NgxGanttComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", vers
|
|
|
3651
3948
|
provide: GANTT_ABSTRACT_TOKEN,
|
|
3652
3949
|
useExisting: forwardRef(() => NgxGanttComponent)
|
|
3653
3950
|
}
|
|
3654
|
-
], 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\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\">\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:
|
|
3951
|
+
], 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 });
|
|
3655
3952
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: NgxGanttComponent, decorators: [{
|
|
3656
3953
|
type: Component,
|
|
3657
3954
|
args: [{ selector: 'ngx-gantt', changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
@@ -3663,7 +3960,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImpor
|
|
|
3663
3960
|
provide: GANTT_ABSTRACT_TOKEN,
|
|
3664
3961
|
useExisting: forwardRef(() => NgxGanttComponent)
|
|
3665
3962
|
}
|
|
3666
|
-
], 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\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\">\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" }]
|
|
3963
|
+
], template: "<ngx-gantt-root #ganttRoot>\n <div class=\"gantt-header\">\n <gantt-table-header #tableHeader [columns]=\"columns\"></gantt-table-header>\n <div class=\"gantt-container-header\">\n <gantt-calendar-header></gantt-calendar-header>\n </div>\n </div>\n <gantt-loader *ngIf=\"loading\"></gantt-loader>\n\n <cdk-virtual-scroll-viewport\n class=\"gantt-virtual-scroll-viewport\"\n [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" }]
|
|
3667
3964
|
}], ctorParameters: function () {
|
|
3668
3965
|
return [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }, { type: i0.NgZone }, { type: GanttPrintService, decorators: [{
|
|
3669
3966
|
type: Optional
|
|
@@ -3679,6 +3976,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImpor
|
|
|
3679
3976
|
type: Input
|
|
3680
3977
|
}], linkable: [{
|
|
3681
3978
|
type: Input
|
|
3979
|
+
}], loading: [{
|
|
3980
|
+
type: Input
|
|
3981
|
+
}], loadingDelay: [{
|
|
3982
|
+
type: Input
|
|
3682
3983
|
}], linkDragStarted: [{
|
|
3683
3984
|
type: Output
|
|
3684
3985
|
}], linkDragEnded: [{
|
|
@@ -3718,6 +4019,7 @@ NgxGanttModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version:
|
|
|
3718
4019
|
GanttCalendarHeaderComponent,
|
|
3719
4020
|
GanttCalendarGridComponent,
|
|
3720
4021
|
GanttLinksComponent,
|
|
4022
|
+
GanttLoaderComponent,
|
|
3721
4023
|
NgxGanttBarComponent,
|
|
3722
4024
|
GanttIconComponent,
|
|
3723
4025
|
GanttDragBackdropComponent,
|
|
@@ -3768,6 +4070,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImpor
|
|
|
3768
4070
|
GanttCalendarHeaderComponent,
|
|
3769
4071
|
GanttCalendarGridComponent,
|
|
3770
4072
|
GanttLinksComponent,
|
|
4073
|
+
GanttLoaderComponent,
|
|
3771
4074
|
NgxGanttBarComponent,
|
|
3772
4075
|
GanttIconComponent,
|
|
3773
4076
|
GanttDragBackdropComponent,
|
|
@@ -3797,5 +4100,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImpor
|
|
|
3797
4100
|
* Generated bundle index. Do not edit.
|
|
3798
4101
|
*/
|
|
3799
4102
|
|
|
3800
|
-
export { GANTT_GLOBAL_CONFIG, GANTT_UPPER_TOKEN, GanttBarClickEvent, GanttBaselineItemInternal, GanttDate, GanttDatePoint, GanttDragEvent, GanttGroupInternal, GanttItemInternal, GanttItemType, GanttItemUpper, GanttLineClickEvent, GanttLinkDragEvent, GanttLinkLineType, GanttLinkType, GanttLoadOnScrollEvent, 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 };
|
|
4103
|
+
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 };
|
|
3801
4104
|
//# sourceMappingURL=worktile-gantt.mjs.map
|