@worktile/gantt 18.0.3 → 18.0.5
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 +3 -1
- package/components/bar/bar-drag.d.ts +8 -2
- package/components/icon/icons.d.ts +2 -0
- package/components/main/gantt-main.component.d.ts +14 -4
- package/esm2022/class/event.mjs +4 -2
- package/esm2022/components/bar/bar-drag.mjs +130 -94
- package/esm2022/components/bar/bar.component.mjs +2 -2
- package/esm2022/components/icon/icons.mjs +6 -2
- package/esm2022/components/main/gantt-main.component.mjs +39 -9
- package/esm2022/components/table/body/gantt-table-body.component.mjs +3 -3
- package/esm2022/gantt-dom.service.mjs +18 -2
- package/esm2022/gantt-upper.mjs +5 -2
- package/esm2022/gantt.component.mjs +10 -5
- package/esm2022/root.component.mjs +2 -2
- package/esm2022/table/gantt-table.component.mjs +5 -2
- package/fesm2022/worktile-gantt.mjs +208 -112
- package/fesm2022/worktile-gantt.mjs.map +1 -1
- package/gantt-dom.service.d.ts +7 -1
- package/gantt-upper.d.ts +2 -1
- package/gantt.component.scss +53 -0
- package/package.json +1 -1
- package/table/gantt-table.component.d.ts +3 -2
|
@@ -4,10 +4,10 @@ import * as i1$1 from '@angular/cdk/scrolling';
|
|
|
4
4
|
import { CdkScrollable, CdkVirtualScrollViewport, CdkFixedSizeVirtualScroll, CdkVirtualForOf, ScrollingModule } from '@angular/cdk/scrolling';
|
|
5
5
|
import { isPlatformServer, NgIf, NgTemplateOutlet, NgFor, NgStyle, NgClass, DOCUMENT, CommonModule } from '@angular/common';
|
|
6
6
|
import * as i0 from '@angular/core';
|
|
7
|
-
import { InjectionToken, EventEmitter, Directive, Inject, Input, Output, ContentChild, HostBinding, Injectable, PLATFORM_ID, Component, ViewChild, ViewChildren, Pipe, ElementRef, Optional, HostListener, forwardRef, ChangeDetectionStrategy, ContentChildren, NgModule } from '@angular/core';
|
|
7
|
+
import { InjectionToken, EventEmitter, Directive, Inject, Input, Output, ContentChild, HostBinding, Injectable, signal, PLATFORM_ID, effect, Component, ViewChild, ViewChildren, Pipe, ElementRef, Optional, HostListener, forwardRef, ChangeDetectionStrategy, ContentChildren, NgModule } from '@angular/core';
|
|
8
8
|
import { fromUnixTime, getWeek, getDaysInMonth, differenceInCalendarDays, setDate, addSeconds, addMinutes, addHours, addDays, addWeeks, addMonths, addQuarters, addYears, startOfMinute, startOfHour, startOfDay, startOfWeek, startOfMonth, startOfQuarter, startOfYear, endOfMinute, endOfHour, endOfDay, endOfWeek, endOfMonth, endOfQuarter, endOfYear, getUnixTime, format, isWeekend, isToday, differenceInHours, differenceInMinutes, differenceInDays, differenceInCalendarQuarters, eachMonthOfInterval, eachYearOfInterval, eachWeekOfInterval, eachDayOfInterval, differenceInCalendarYears, eachHourOfInterval, setDefaultOptions } from 'date-fns';
|
|
9
9
|
export { addDays, addHours, addMinutes, addMonths, addQuarters, addSeconds, addWeeks, addYears, differenceInCalendarDays, differenceInCalendarQuarters, differenceInDays, differenceInMinutes, eachDayOfInterval, eachHourOfInterval, eachMonthOfInterval, eachWeekOfInterval, endOfDay, endOfHour, endOfMinute, endOfMonth, endOfQuarter, endOfWeek, endOfYear, format, fromUnixTime, getDaysInMonth, getUnixTime, getWeek, isToday, isWeekend, setDate, startOfDay, startOfHour, startOfMinute, startOfMonth, startOfQuarter, startOfWeek, startOfYear } from 'date-fns';
|
|
10
|
-
import { BehaviorSubject, Subject, from, fromEvent, merge, Observable, EMPTY, interval, animationFrameScheduler, takeUntil as takeUntil$1, startWith as startWith$1, auditTime as auditTime$1, filter } from 'rxjs';
|
|
10
|
+
import { BehaviorSubject, Subject, from, fromEvent, merge, Observable, EMPTY, interval, animationFrameScheduler, take as take$1, takeUntil as takeUntil$1, combineLatest, startWith as startWith$1, auditTime as auditTime$1, filter } from 'rxjs';
|
|
11
11
|
import { take, takeUntil, skip, map, pairwise, auditTime, startWith, switchMap, debounceTime, finalize } from 'rxjs/operators';
|
|
12
12
|
import { SelectionModel } from '@angular/cdk/collections';
|
|
13
13
|
import { coerceBooleanProperty, coerceCssPixelValue } from '@angular/cdk/coercion';
|
|
@@ -36,7 +36,9 @@ class GanttLineClickEvent {
|
|
|
36
36
|
}
|
|
37
37
|
class GanttBarClickEvent {
|
|
38
38
|
}
|
|
39
|
-
class
|
|
39
|
+
class GanttTableItemClickEvent {
|
|
40
|
+
}
|
|
41
|
+
class GanttSelectedEvent extends GanttTableItemClickEvent {
|
|
40
42
|
}
|
|
41
43
|
class GanttTableDragDroppedEvent {
|
|
42
44
|
}
|
|
@@ -1044,6 +1046,7 @@ class GanttUpper {
|
|
|
1044
1046
|
viewTypes: [GanttViewType.day, GanttViewType.month, GanttViewType.year]
|
|
1045
1047
|
};
|
|
1046
1048
|
this.viewOptions = {};
|
|
1049
|
+
this.quickTimeFocus = false;
|
|
1047
1050
|
this.loadOnScroll = new EventEmitter();
|
|
1048
1051
|
this.dragStarted = new EventEmitter();
|
|
1049
1052
|
this.dragMoved = new EventEmitter();
|
|
@@ -1296,7 +1299,7 @@ class GanttUpper {
|
|
|
1296
1299
|
this.changeView(this.viewType);
|
|
1297
1300
|
}
|
|
1298
1301
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: GanttUpper, deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }, { token: i0.NgZone }, { token: GANTT_GLOBAL_CONFIG }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1299
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.0", type: GanttUpper, inputs: { originItems: ["items", "originItems"], originGroups: ["groups", "originGroups"], originBaselineItems: ["baselineItems", "originBaselineItems"], viewType: "viewType", start: "start", end: "end", showTodayLine: "showTodayLine", draggable: "draggable", styles: "styles", showToolbar: "showToolbar", toolbarOptions: "toolbarOptions", viewOptions: "viewOptions", linkOptions: "linkOptions", disabledLoadOnScroll: "disabledLoadOnScroll", selectable: "selectable", multiple: "multiple" }, outputs: { loadOnScroll: "loadOnScroll", dragStarted: "dragStarted", dragMoved: "dragMoved", dragEnded: "dragEnded", barClick: "barClick", viewChange: "viewChange", expandChange: "expandChange" }, host: { properties: { "class.gantt": "this.ganttClass" } }, queries: [{ propertyName: "barTemplate", first: true, predicate: ["bar"], descendants: true, static: true }, { propertyName: "rangeTemplate", first: true, predicate: ["range"], descendants: true, static: true }, { propertyName: "itemTemplate", first: true, predicate: ["item"], descendants: true, static: true }, { propertyName: "baselineTemplate", first: true, predicate: ["baseline"], descendants: true, static: true }, { propertyName: "groupTemplate", first: true, predicate: ["group"], descendants: true, static: true }, { propertyName: "groupHeaderTemplate", first: true, predicate: ["groupHeader"], descendants: true, static: true }, { propertyName: "toolbarTemplate", first: true, predicate: ["toolbar"], descendants: true, static: true }], usesOnChanges: true, ngImport: i0 }); }
|
|
1302
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.0", type: GanttUpper, inputs: { originItems: ["items", "originItems"], originGroups: ["groups", "originGroups"], originBaselineItems: ["baselineItems", "originBaselineItems"], viewType: "viewType", start: "start", end: "end", showTodayLine: "showTodayLine", draggable: "draggable", styles: "styles", showToolbar: "showToolbar", toolbarOptions: "toolbarOptions", viewOptions: "viewOptions", linkOptions: "linkOptions", disabledLoadOnScroll: "disabledLoadOnScroll", selectable: "selectable", multiple: "multiple", quickTimeFocus: "quickTimeFocus" }, outputs: { loadOnScroll: "loadOnScroll", dragStarted: "dragStarted", dragMoved: "dragMoved", dragEnded: "dragEnded", barClick: "barClick", viewChange: "viewChange", expandChange: "expandChange" }, host: { properties: { "class.gantt": "this.ganttClass" } }, queries: [{ propertyName: "barTemplate", first: true, predicate: ["bar"], descendants: true, static: true }, { propertyName: "rangeTemplate", first: true, predicate: ["range"], descendants: true, static: true }, { propertyName: "itemTemplate", first: true, predicate: ["item"], descendants: true, static: true }, { propertyName: "baselineTemplate", first: true, predicate: ["baseline"], descendants: true, static: true }, { propertyName: "groupTemplate", first: true, predicate: ["group"], descendants: true, static: true }, { propertyName: "groupHeaderTemplate", first: true, predicate: ["groupHeader"], descendants: true, static: true }, { propertyName: "toolbarTemplate", first: true, predicate: ["toolbar"], descendants: true, static: true }], usesOnChanges: true, ngImport: i0 }); }
|
|
1300
1303
|
}
|
|
1301
1304
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: GanttUpper, decorators: [{
|
|
1302
1305
|
type: Directive
|
|
@@ -1338,6 +1341,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImpor
|
|
|
1338
1341
|
type: Input
|
|
1339
1342
|
}], multiple: [{
|
|
1340
1343
|
type: Input
|
|
1344
|
+
}], quickTimeFocus: [{
|
|
1345
|
+
type: Input
|
|
1341
1346
|
}], loadOnScroll: [{
|
|
1342
1347
|
type: Output
|
|
1343
1348
|
}], dragStarted: [{
|
|
@@ -1547,6 +1552,7 @@ class GanttDomService {
|
|
|
1547
1552
|
constructor(ngZone, platformId) {
|
|
1548
1553
|
this.ngZone = ngZone;
|
|
1549
1554
|
this.platformId = platformId;
|
|
1555
|
+
this.visibleRangeX = signal({ min: 0, max: 0 });
|
|
1550
1556
|
this.unsubscribe$ = new Subject();
|
|
1551
1557
|
}
|
|
1552
1558
|
monitorScrollChange() {
|
|
@@ -1623,6 +1629,7 @@ class GanttDomService {
|
|
|
1623
1629
|
this.mainScrollbar && scrollObservers.push(fromEvent(this.mainScrollbar, 'scroll', options));
|
|
1624
1630
|
return new Observable((subscriber) => this.ngZone.runOutsideAngular(() => merge(...scrollObservers)
|
|
1625
1631
|
.pipe(map(() => this.mainContainer.scrollLeft), pairwise(), map(([previous, current]) => {
|
|
1632
|
+
this.setVisibleRangeX();
|
|
1626
1633
|
const event = {
|
|
1627
1634
|
target: this.mainContainer,
|
|
1628
1635
|
direction: ScrollDirection.NONE
|
|
@@ -1645,6 +1652,14 @@ class GanttDomService {
|
|
|
1645
1652
|
getResize() {
|
|
1646
1653
|
return isPlatformServer(this.platformId) ? EMPTY : fromEvent(window, 'resize').pipe(auditTime(150));
|
|
1647
1654
|
}
|
|
1655
|
+
getResizeByElement(element) {
|
|
1656
|
+
return new Observable((observer) => {
|
|
1657
|
+
const resizeObserver = new ResizeObserver(() => {
|
|
1658
|
+
observer.next();
|
|
1659
|
+
});
|
|
1660
|
+
resizeObserver.observe(element);
|
|
1661
|
+
});
|
|
1662
|
+
}
|
|
1648
1663
|
scrollMainContainer(left) {
|
|
1649
1664
|
if (isNumber(left)) {
|
|
1650
1665
|
const scrollLeft = left - this.mainContainer.clientWidth / 2;
|
|
@@ -1655,6 +1670,12 @@ class GanttDomService {
|
|
|
1655
1670
|
this.mainFooter && (this.mainFooter.scrollLeft = this.mainContainer.scrollLeft);
|
|
1656
1671
|
}
|
|
1657
1672
|
}
|
|
1673
|
+
setVisibleRangeX() {
|
|
1674
|
+
this.visibleRangeX.set({
|
|
1675
|
+
min: this.mainContainer.scrollLeft,
|
|
1676
|
+
max: this.mainContainer.scrollLeft + this.mainContainer.clientWidth
|
|
1677
|
+
});
|
|
1678
|
+
}
|
|
1658
1679
|
ngOnDestroy() {
|
|
1659
1680
|
this.unsubscribe$.next();
|
|
1660
1681
|
this.unsubscribe$.complete();
|
|
@@ -1686,10 +1707,10 @@ function createSvgElement(qualifiedName, className) {
|
|
|
1686
1707
|
}
|
|
1687
1708
|
class GanttBarDrag {
|
|
1688
1709
|
get dragDisabled() {
|
|
1689
|
-
return !this.item.draggable || !this.ganttUpper.draggable;
|
|
1710
|
+
return !this.item().draggable || !this.ganttUpper.draggable;
|
|
1690
1711
|
}
|
|
1691
1712
|
get linkDragDisabled() {
|
|
1692
|
-
return !this.item.linkable || !this.ganttUpper.linkable;
|
|
1713
|
+
return !this.item().linkable || !this.ganttUpper.linkable;
|
|
1693
1714
|
}
|
|
1694
1715
|
get barHandleDragMoveAndScrollDistance() {
|
|
1695
1716
|
return this.barHandleDragMoveDistance + this.dragScrollDistance;
|
|
@@ -1702,7 +1723,9 @@ class GanttBarDrag {
|
|
|
1702
1723
|
this.dom = dom;
|
|
1703
1724
|
this.dragContainer = dragContainer;
|
|
1704
1725
|
this._ngZone = _ngZone;
|
|
1705
|
-
this.
|
|
1726
|
+
this.item = signal(null);
|
|
1727
|
+
this.linkDragRefs = [];
|
|
1728
|
+
this.barHandleDragRefs = [];
|
|
1706
1729
|
this.destroy$ = new Subject();
|
|
1707
1730
|
/** Used to signal to the current auto-scroll sequence when to stop. */
|
|
1708
1731
|
this.stopScrollTimers$ = new Subject();
|
|
@@ -1733,6 +1756,12 @@ class GanttBarDrag {
|
|
|
1733
1756
|
}
|
|
1734
1757
|
});
|
|
1735
1758
|
};
|
|
1759
|
+
effect(() => {
|
|
1760
|
+
const item = this.item();
|
|
1761
|
+
if (item) {
|
|
1762
|
+
this.createDrags();
|
|
1763
|
+
}
|
|
1764
|
+
});
|
|
1736
1765
|
}
|
|
1737
1766
|
createDragRef(element) {
|
|
1738
1767
|
const dragRef = this.dragDrop.createDrag(element);
|
|
@@ -1742,40 +1771,46 @@ class GanttBarDrag {
|
|
|
1742
1771
|
return fromEvent(this.dom.mainContainer, 'scroll', passiveListenerOptions).pipe(takeUntil(dragRef.ended));
|
|
1743
1772
|
}
|
|
1744
1773
|
createMouseEvents() {
|
|
1745
|
-
|
|
1746
|
-
this.
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
.
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
this.
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1774
|
+
if (!this.hasMonitorMouseEvent && (!this.dragDisabled || !this.linkDragDisabled)) {
|
|
1775
|
+
this.hasMonitorMouseEvent = true;
|
|
1776
|
+
const dropClass = this.ganttUpper.config.linkOptions?.dependencyTypes?.length === 1 &&
|
|
1777
|
+
this.ganttUpper.config.linkOptions?.dependencyTypes[0] === GanttLinkType.fs
|
|
1778
|
+
? singleDropActiveClass
|
|
1779
|
+
: dropActiveClass;
|
|
1780
|
+
fromEvent(this.barElement, 'mouseenter', passiveListenerOptions)
|
|
1781
|
+
.pipe(takeUntil(this.destroy$))
|
|
1782
|
+
.subscribe(() => {
|
|
1783
|
+
if (this.dragContainer.linkDraggingId && this.dragContainer.linkDraggingId !== this.item().id) {
|
|
1784
|
+
if (!this.linkDragDisabled) {
|
|
1785
|
+
this.barElement.classList.add(dropClass);
|
|
1786
|
+
this.dragContainer.emitLinkDragEntered({
|
|
1787
|
+
item: this.item(),
|
|
1788
|
+
element: this.barElement
|
|
1789
|
+
});
|
|
1790
|
+
}
|
|
1759
1791
|
}
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
this.
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1792
|
+
else {
|
|
1793
|
+
if (!this.dragDisabled || !this.linkDragDisabled) {
|
|
1794
|
+
this.barElement.classList.add(activeClass);
|
|
1795
|
+
}
|
|
1796
|
+
}
|
|
1797
|
+
});
|
|
1798
|
+
fromEvent(this.barElement, 'mouseleave', passiveListenerOptions)
|
|
1799
|
+
.pipe(takeUntil(this.destroy$))
|
|
1800
|
+
.subscribe(() => {
|
|
1801
|
+
if (!this.dragContainer.linkDraggingId) {
|
|
1802
|
+
this.barElement.classList.remove(activeClass);
|
|
1803
|
+
}
|
|
1804
|
+
else {
|
|
1805
|
+
this.dragContainer.emitLinkDragLeaved();
|
|
1806
|
+
}
|
|
1807
|
+
this.barElement.classList.remove(dropClass);
|
|
1808
|
+
});
|
|
1809
|
+
}
|
|
1776
1810
|
}
|
|
1777
1811
|
createBarDrag() {
|
|
1778
1812
|
const dragRef = this.createDragRef(this.barElement);
|
|
1813
|
+
dragRef.disabled = this.dragDisabled;
|
|
1779
1814
|
dragRef.lockAxis = 'x';
|
|
1780
1815
|
dragRef.withBoundaryElement(this.dom.mainItems);
|
|
1781
1816
|
dragRef.started.subscribe(() => {
|
|
@@ -1789,7 +1824,7 @@ class GanttBarDrag {
|
|
|
1789
1824
|
this.barDragMove();
|
|
1790
1825
|
}
|
|
1791
1826
|
});
|
|
1792
|
-
this.dragContainer.dragStarted.emit({ item: this.item.origin });
|
|
1827
|
+
this.dragContainer.dragStarted.emit({ item: this.item().origin });
|
|
1793
1828
|
});
|
|
1794
1829
|
dragRef.moved.subscribe((event) => {
|
|
1795
1830
|
this.startScrollingIfNecessary(event.pointerPosition.x, event.pointerPosition.y);
|
|
@@ -1806,14 +1841,13 @@ class GanttBarDrag {
|
|
|
1806
1841
|
this.dragScrolling = false;
|
|
1807
1842
|
this.dragScrollDistance = 0;
|
|
1808
1843
|
this.barDragMoveDistance = 0;
|
|
1809
|
-
this.item.updateRefs({
|
|
1810
|
-
width: this.ganttUpper.view.getDateRangeWidth(this.item.start, this.item.end),
|
|
1811
|
-
x: this.ganttUpper.view.getXPointByDate(this.item.start),
|
|
1844
|
+
this.item().updateRefs({
|
|
1845
|
+
width: this.ganttUpper.view.getDateRangeWidth(this.item().start, this.item().end),
|
|
1846
|
+
x: this.ganttUpper.view.getXPointByDate(this.item().start),
|
|
1812
1847
|
y: (this.ganttUpper.styles.lineHeight - this.ganttUpper.styles.barHeight) / 2 - 1
|
|
1813
1848
|
});
|
|
1814
|
-
this.dragContainer.dragEnded.emit({ item: this.item.origin });
|
|
1849
|
+
this.dragContainer.dragEnded.emit({ item: this.item().origin });
|
|
1815
1850
|
});
|
|
1816
|
-
this.barDragRef = dragRef;
|
|
1817
1851
|
return dragRef;
|
|
1818
1852
|
}
|
|
1819
1853
|
createBarHandleDrags() {
|
|
@@ -1822,6 +1856,7 @@ class GanttBarDrag {
|
|
|
1822
1856
|
handles.forEach((handle, index) => {
|
|
1823
1857
|
const isBefore = index === 0;
|
|
1824
1858
|
const dragRef = this.createDragRef(handle);
|
|
1859
|
+
dragRef.disabled = this.dragDisabled;
|
|
1825
1860
|
dragRef.lockAxis = 'x';
|
|
1826
1861
|
dragRef.withBoundaryElement(this.dom.mainItems);
|
|
1827
1862
|
dragRef.started.subscribe(() => {
|
|
@@ -1844,7 +1879,7 @@ class GanttBarDrag {
|
|
|
1844
1879
|
}
|
|
1845
1880
|
}
|
|
1846
1881
|
});
|
|
1847
|
-
this.dragContainer.dragStarted.emit({ item: this.item.origin });
|
|
1882
|
+
this.dragContainer.dragStarted.emit({ item: this.item().origin });
|
|
1848
1883
|
});
|
|
1849
1884
|
dragRef.moved.subscribe((event) => {
|
|
1850
1885
|
if (this.barHandleDragMoveRecordDiffs && this.barHandleDragMoveRecordDiffs > 0) {
|
|
@@ -1868,12 +1903,12 @@ class GanttBarDrag {
|
|
|
1868
1903
|
this.dragScrolling = false;
|
|
1869
1904
|
this.dragScrollDistance = 0;
|
|
1870
1905
|
this.barHandleDragMoveDistance = 0;
|
|
1871
|
-
this.item.updateRefs({
|
|
1872
|
-
width: this.ganttUpper.view.getDateRangeWidth(this.item.start, this.item.end),
|
|
1873
|
-
x: this.ganttUpper.view.getXPointByDate(this.item.start),
|
|
1906
|
+
this.item().updateRefs({
|
|
1907
|
+
width: this.ganttUpper.view.getDateRangeWidth(this.item().start, this.item().end),
|
|
1908
|
+
x: this.ganttUpper.view.getXPointByDate(this.item().start),
|
|
1874
1909
|
y: (this.ganttUpper.styles.lineHeight - this.ganttUpper.styles.barHeight) / 2 - 1
|
|
1875
1910
|
});
|
|
1876
|
-
this.dragContainer.dragEnded.emit({ item: this.item.origin });
|
|
1911
|
+
this.dragContainer.dragEnded.emit({ item: this.item().origin });
|
|
1877
1912
|
});
|
|
1878
1913
|
dragRefs.push(dragRef);
|
|
1879
1914
|
});
|
|
@@ -1885,6 +1920,7 @@ class GanttBarDrag {
|
|
|
1885
1920
|
handles.forEach((handle, index) => {
|
|
1886
1921
|
const isBegin = index === 0;
|
|
1887
1922
|
const dragRef = this.dragDrop.createDrag(handle);
|
|
1923
|
+
dragRef.disabled = this.linkDragDisabled;
|
|
1888
1924
|
dragRef.withBoundaryElement(this.dom.root);
|
|
1889
1925
|
dragRef.beforeStarted.subscribe(() => {
|
|
1890
1926
|
handle.style.pointerEvents = 'none';
|
|
@@ -1894,7 +1930,7 @@ class GanttBarDrag {
|
|
|
1894
1930
|
this.createLinkDraggingLine();
|
|
1895
1931
|
this.dragContainer.emitLinkDragStarted({
|
|
1896
1932
|
element: this.barElement,
|
|
1897
|
-
item: this.item,
|
|
1933
|
+
item: this.item(),
|
|
1898
1934
|
pos: isBegin ? InBarPosition.start : InBarPosition.finish
|
|
1899
1935
|
});
|
|
1900
1936
|
});
|
|
@@ -1969,10 +2005,10 @@ class GanttBarDrag {
|
|
|
1969
2005
|
this.barElement.classList.remove('gantt-bar-draggable-drag');
|
|
1970
2006
|
}
|
|
1971
2007
|
barDragMove() {
|
|
1972
|
-
const currentX = this.item.refs.x + this.barDragMoveDistance + this.dragScrollDistance;
|
|
2008
|
+
const currentX = this.item().refs.x + this.barDragMoveDistance + this.dragScrollDistance;
|
|
1973
2009
|
const currentDate = this.ganttUpper.view.getDateByXPoint(currentX);
|
|
1974
2010
|
const currentStartX = this.ganttUpper.view.getXPointByDate(currentDate);
|
|
1975
|
-
const diffs = this.ganttUpper.view.differenceByPrecisionUnit(this.item.end, this.item.start);
|
|
2011
|
+
const diffs = this.ganttUpper.view.differenceByPrecisionUnit(this.item().end, this.item().start);
|
|
1976
2012
|
let start = currentDate;
|
|
1977
2013
|
let end = currentDate.add(diffs, this.ganttUpper.view?.options?.datePrecisionUnit);
|
|
1978
2014
|
// 日视图特殊逻辑处理
|
|
@@ -1987,59 +2023,59 @@ class GanttBarDrag {
|
|
|
1987
2023
|
const left = currentX - this.barDragMoveDistance;
|
|
1988
2024
|
this.barElement.style.left = left + 'px';
|
|
1989
2025
|
}
|
|
1990
|
-
this.openDragBackdrop(this.barElement, this.ganttUpper.view.getDateByXPoint(currentX), this.ganttUpper.view.getDateByXPoint(currentX + this.item.refs.width));
|
|
2026
|
+
this.openDragBackdrop(this.barElement, this.ganttUpper.view.getDateByXPoint(currentX), this.ganttUpper.view.getDateByXPoint(currentX + this.item().refs.width));
|
|
1991
2027
|
if (!this.isStartOrEndInsideView(start, end)) {
|
|
1992
2028
|
return;
|
|
1993
2029
|
}
|
|
1994
2030
|
this.updateItemDate(start, end);
|
|
1995
|
-
this.dragContainer.dragMoved.emit({ item: this.item.origin });
|
|
2031
|
+
this.dragContainer.dragMoved.emit({ item: this.item().origin });
|
|
1996
2032
|
}
|
|
1997
2033
|
barBeforeHandleDragMove() {
|
|
1998
2034
|
const { x, start, minRangeWidthWidth } = this.startOfBarHandle();
|
|
1999
|
-
const width = this.item.refs.width + this.barHandleDragMoveAndScrollDistance * -1;
|
|
2000
|
-
const diffs = this.ganttUpper.view.differenceByPrecisionUnit(this.item.end, start);
|
|
2035
|
+
const width = this.item().refs.width + this.barHandleDragMoveAndScrollDistance * -1;
|
|
2036
|
+
const diffs = this.ganttUpper.view.differenceByPrecisionUnit(this.item().end, start);
|
|
2001
2037
|
if (width > dragMinWidth && diffs > 0) {
|
|
2002
2038
|
this.barElement.style.width = width + 'px';
|
|
2003
2039
|
this.barElement.style.left = x + 'px';
|
|
2004
|
-
this.openDragBackdrop(this.barElement, start, this.item.end);
|
|
2005
|
-
if (!this.isStartOrEndInsideView(start, this.item.end)) {
|
|
2040
|
+
this.openDragBackdrop(this.barElement, start, this.item().end);
|
|
2041
|
+
if (!this.isStartOrEndInsideView(start, this.item().end)) {
|
|
2006
2042
|
return;
|
|
2007
2043
|
}
|
|
2008
|
-
this.updateItemDate(start, this.item.end);
|
|
2044
|
+
this.updateItemDate(start, this.item().end);
|
|
2009
2045
|
}
|
|
2010
2046
|
else {
|
|
2011
2047
|
if (this.barHandleDragMoveRecordDiffs > 0 && diffs <= 0) {
|
|
2012
2048
|
this.barElement.style.width = minRangeWidthWidth + 'px';
|
|
2013
|
-
const x = this.ganttUpper.view.getXPointByDate(this.item.end);
|
|
2049
|
+
const x = this.ganttUpper.view.getXPointByDate(this.item().end);
|
|
2014
2050
|
this.barElement.style.left = x + 'px';
|
|
2015
2051
|
}
|
|
2016
|
-
this.openDragBackdrop(this.barElement, this.item.end, this.item.end);
|
|
2017
|
-
this.updateItemDate(this.item.end, this.item.end);
|
|
2052
|
+
this.openDragBackdrop(this.barElement, this.item().end, this.item().end);
|
|
2053
|
+
this.updateItemDate(this.item().end, this.item().end);
|
|
2018
2054
|
}
|
|
2019
2055
|
this.barHandleDragMoveRecordDiffs = diffs;
|
|
2020
|
-
this.dragContainer.dragMoved.emit({ item: this.item.origin });
|
|
2056
|
+
this.dragContainer.dragMoved.emit({ item: this.item().origin });
|
|
2021
2057
|
}
|
|
2022
2058
|
barAfterHandleDragMove() {
|
|
2023
2059
|
const { width, end } = this.endOfBarHandle();
|
|
2024
|
-
const diffs = this.ganttUpper.view.differenceByPrecisionUnit(end, this.item.start);
|
|
2060
|
+
const diffs = this.ganttUpper.view.differenceByPrecisionUnit(end, this.item().start);
|
|
2025
2061
|
if (width > dragMinWidth && diffs > 0) {
|
|
2026
2062
|
this.barElement.style.width = width + 'px';
|
|
2027
|
-
this.openDragBackdrop(this.barElement, this.item.start, end);
|
|
2028
|
-
if (!this.isStartOrEndInsideView(this.item.start, end)) {
|
|
2063
|
+
this.openDragBackdrop(this.barElement, this.item().start, end);
|
|
2064
|
+
if (!this.isStartOrEndInsideView(this.item().start, end)) {
|
|
2029
2065
|
return;
|
|
2030
2066
|
}
|
|
2031
|
-
this.updateItemDate(this.item.start, end);
|
|
2067
|
+
this.updateItemDate(this.item().start, end);
|
|
2032
2068
|
}
|
|
2033
2069
|
else {
|
|
2034
2070
|
if (this.barHandleDragMoveRecordDiffs > 0 && diffs <= 0) {
|
|
2035
|
-
const minRangeWidth = this.ganttUpper.view.getMinRangeWidthByPrecisionUnit(this.item.start);
|
|
2071
|
+
const minRangeWidth = this.ganttUpper.view.getMinRangeWidthByPrecisionUnit(this.item().start);
|
|
2036
2072
|
this.barElement.style.width = minRangeWidth + 'px';
|
|
2037
2073
|
}
|
|
2038
|
-
this.openDragBackdrop(this.barElement, this.item.start, this.item.start);
|
|
2039
|
-
this.updateItemDate(this.item.start, this.item.start);
|
|
2074
|
+
this.openDragBackdrop(this.barElement, this.item().start, this.item().start);
|
|
2075
|
+
this.updateItemDate(this.item().start, this.item().start);
|
|
2040
2076
|
}
|
|
2041
2077
|
this.barHandleDragMoveRecordDiffs = diffs;
|
|
2042
|
-
this.dragContainer.dragMoved.emit({ item: this.item.origin });
|
|
2078
|
+
this.dragContainer.dragMoved.emit({ item: this.item().origin });
|
|
2043
2079
|
}
|
|
2044
2080
|
calcLinkLinePositions(target, isBefore) {
|
|
2045
2081
|
const rootRect = this.dom.root.getBoundingClientRect();
|
|
@@ -2096,33 +2132,33 @@ class GanttBarDrag {
|
|
|
2096
2132
|
const xThreshold = clientWidth * DROP_PROXIMITY_THRESHOLD;
|
|
2097
2133
|
if (isBefore) {
|
|
2098
2134
|
const { start, minRangeWidthWidth } = this.startOfBarHandle();
|
|
2099
|
-
const xPointerByEndDate = this.ganttUpper.view.getXPointByDate(this.item.end);
|
|
2100
|
-
isStartGreaterThanEnd = start.value > this.item.end.value;
|
|
2135
|
+
const xPointerByEndDate = this.ganttUpper.view.getXPointByDate(this.item().end);
|
|
2136
|
+
isStartGreaterThanEnd = start.value > this.item().end.value;
|
|
2101
2137
|
isBarAppearsInView = xPointerByEndDate + minRangeWidthWidth + xThreshold <= scrollLeft + clientWidth;
|
|
2102
2138
|
}
|
|
2103
2139
|
else {
|
|
2104
2140
|
const { end } = this.endOfBarHandle();
|
|
2105
|
-
const xPointerByStartDate = this.ganttUpper.view.getXPointByDate(this.item.start);
|
|
2106
|
-
isStartGreaterThanEnd = end.value < this.item.start.value;
|
|
2141
|
+
const xPointerByStartDate = this.ganttUpper.view.getXPointByDate(this.item().start);
|
|
2142
|
+
isStartGreaterThanEnd = end.value < this.item().start.value;
|
|
2107
2143
|
isBarAppearsInView = scrollLeft + xThreshold <= xPointerByStartDate;
|
|
2108
2144
|
}
|
|
2109
2145
|
return isStartGreaterThanEnd && isBarAppearsInView ? true : false;
|
|
2110
2146
|
}
|
|
2111
2147
|
// Some data information about dragging start until it is equal to or greater than end
|
|
2112
2148
|
startOfBarHandle() {
|
|
2113
|
-
const x = this.item.refs.x + this.barHandleDragMoveAndScrollDistance;
|
|
2149
|
+
const x = this.item().refs.x + this.barHandleDragMoveAndScrollDistance;
|
|
2114
2150
|
return {
|
|
2115
2151
|
x,
|
|
2116
2152
|
start: this.ganttUpper.view.getDateByXPoint(x),
|
|
2117
|
-
minRangeWidthWidth: this.ganttUpper.view.getMinRangeWidthByPrecisionUnit(this.item.end)
|
|
2153
|
+
minRangeWidthWidth: this.ganttUpper.view.getMinRangeWidthByPrecisionUnit(this.item().end)
|
|
2118
2154
|
};
|
|
2119
2155
|
}
|
|
2120
2156
|
// Some data information about dragging end of bar handle
|
|
2121
2157
|
endOfBarHandle() {
|
|
2122
|
-
const width = this.item.refs.width + this.barHandleDragMoveAndScrollDistance;
|
|
2158
|
+
const width = this.item().refs.width + this.barHandleDragMoveAndScrollDistance;
|
|
2123
2159
|
return {
|
|
2124
2160
|
width,
|
|
2125
|
-
end: this.ganttUpper.view.getDateByXPoint(this.item.refs.x + width)
|
|
2161
|
+
end: this.ganttUpper.view.getDateByXPoint(this.item().refs.x + width)
|
|
2126
2162
|
};
|
|
2127
2163
|
}
|
|
2128
2164
|
stopScrolling() {
|
|
@@ -2141,34 +2177,55 @@ class GanttBarDrag {
|
|
|
2141
2177
|
}
|
|
2142
2178
|
}
|
|
2143
2179
|
updateItemDate(start, end) {
|
|
2144
|
-
this.item.updateDate(this.ganttUpper.view.startOfPrecision(start), this.ganttUpper.view.endOfPrecision(end));
|
|
2180
|
+
this.item().updateDate(this.ganttUpper.view.startOfPrecision(start), this.ganttUpper.view.endOfPrecision(end));
|
|
2145
2181
|
}
|
|
2146
|
-
|
|
2147
|
-
this.item = item;
|
|
2182
|
+
initialize(elementRef, item, ganttUpper) {
|
|
2148
2183
|
this.barElement = elementRef.nativeElement;
|
|
2149
2184
|
this.ganttUpper = ganttUpper;
|
|
2150
|
-
|
|
2151
|
-
|
|
2185
|
+
this.item.set(item);
|
|
2186
|
+
}
|
|
2187
|
+
createBarDragRef() {
|
|
2188
|
+
if (this.barDragRef) {
|
|
2189
|
+
this.barDragRef.disabled = this.dragDisabled;
|
|
2152
2190
|
}
|
|
2153
|
-
else {
|
|
2154
|
-
this.
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2191
|
+
else if (!this.dragDisabled) {
|
|
2192
|
+
this.barDragRef = this.createBarDrag();
|
|
2193
|
+
}
|
|
2194
|
+
}
|
|
2195
|
+
createBarHandleDragRefs() {
|
|
2196
|
+
if (this.barHandleDragRefs.length > 0) {
|
|
2197
|
+
this.barHandleDragRefs.forEach((dragRef) => {
|
|
2198
|
+
dragRef.disabled = this.dragDisabled;
|
|
2199
|
+
});
|
|
2200
|
+
}
|
|
2201
|
+
else if (!this.dragDisabled) {
|
|
2202
|
+
this.barHandleDragRefs = this.createBarHandleDrags();
|
|
2203
|
+
}
|
|
2204
|
+
}
|
|
2205
|
+
createLinkDragRefs() {
|
|
2206
|
+
if (this.linkDragRefs.length > 0) {
|
|
2207
|
+
this.linkDragRefs.forEach((dragRef) => {
|
|
2208
|
+
dragRef.disabled = this.linkDragDisabled;
|
|
2209
|
+
});
|
|
2210
|
+
}
|
|
2211
|
+
else if (!this.linkDragDisabled) {
|
|
2212
|
+
this.linkDragRefs = this.createLinkHandleDrags();
|
|
2164
2213
|
}
|
|
2165
2214
|
}
|
|
2215
|
+
createDrags() {
|
|
2216
|
+
this.createMouseEvents();
|
|
2217
|
+
this.createBarDragRef();
|
|
2218
|
+
this.createBarHandleDragRefs();
|
|
2219
|
+
this.createLinkDragRefs();
|
|
2220
|
+
}
|
|
2166
2221
|
updateItem(item) {
|
|
2167
|
-
this.item
|
|
2222
|
+
this.item.set(item);
|
|
2168
2223
|
}
|
|
2169
2224
|
ngOnDestroy() {
|
|
2170
2225
|
this.closeDragBackdrop();
|
|
2171
|
-
this.
|
|
2226
|
+
this.barDragRef?.dispose();
|
|
2227
|
+
this.linkDragRefs?.forEach((dragRef) => dragRef.dispose());
|
|
2228
|
+
this.barHandleDragRefs?.forEach((dragRef) => dragRef.dispose());
|
|
2172
2229
|
this.destroy$.next();
|
|
2173
2230
|
this.destroy$.complete();
|
|
2174
2231
|
this.stopScrolling();
|
|
@@ -2293,7 +2350,7 @@ class NgxGanttBarComponent extends GanttItemUpper {
|
|
|
2293
2350
|
// using `zone-patch-rxjs` because it'll trigger a change detection when it unsubscribes.
|
|
2294
2351
|
this.ngZone.runOutsideAngular(() => {
|
|
2295
2352
|
onStable$.pipe(takeUntil(this.unsubscribe$)).subscribe(() => {
|
|
2296
|
-
this.drag.
|
|
2353
|
+
this.drag.initialize(this.elementRef, this.item, this.ganttUpper);
|
|
2297
2354
|
});
|
|
2298
2355
|
});
|
|
2299
2356
|
this.setContentBackground();
|
|
@@ -2623,6 +2680,8 @@ xmlns:xlink="http://www.w3.org/1999/xlink"
|
|
|
2623
2680
|
</g>
|
|
2624
2681
|
</svg>`;
|
|
2625
2682
|
const dragIcon = `<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" fit="" preserveAspectRatio="xMidYMid meet" focusable="false"><g id="aijaction/drag--" stroke-width="1" fill-rule="evenodd"><g id="aij拖动" transform="translate(5 1)" fill-rule="nonzero"><path d="M1 2a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm4 0a1 1 0 1 1 0-2 1 1 0 0 1 0 2zM1 6a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm4 0a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm-4 4a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm4 0a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm-4 4a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm4 0a1 1 0 1 1 0-2 1 1 0 0 1 0 2z" id="aij形状结合"></path></g></g></svg>`;
|
|
2683
|
+
const arrowLeftIcon = `<svg viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" fit="" height="1em" width="1em" preserveAspectRatio="xMidYMid meet" focusable="false"><g id="adinavigation/arrow-left" stroke-width="1" fill-rule="evenodd"><path d="M7.4 4.15L4.438 7.315a.6.6 0 0 1-.876-.82l3.97-4.243a.598.598 0 0 1 .93-.057l3.97 4.323a.6.6 0 1 1-.885.812L8.6 4.118v9.149c0 .404-.269.733-.6.733-.332 0-.6-.329-.6-.733V4.15z" id="adi形状结合" transform="rotate(-90 7.995 8)"></path></g></svg>`;
|
|
2684
|
+
const arrowRightIcon = `<svg viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" fit="" height="1em" width="1em" preserveAspectRatio="xMidYMid meet" focusable="false"><g id="adlnavigation/arrow-right" stroke-width="1" fill-rule="evenodd"><path d="M7.4 4.15L4.438 7.315a.6.6 0 0 1-.876-.82l3.97-4.243a.598.598 0 0 1 .93-.057l3.97 4.323a.6.6 0 1 1-.885.812L8.6 4.118v9.149c0 .404-.269.733-.6.733-.332 0-.6-.329-.6-.733V4.15z" id="adl形状结合" transform="rotate(90 7.995 8)"></path></g></svg>`;
|
|
2626
2685
|
const icons = {
|
|
2627
2686
|
'angle-right': angleRight,
|
|
2628
2687
|
'angle-down': angleDown,
|
|
@@ -2630,7 +2689,9 @@ const icons = {
|
|
|
2630
2689
|
'minus-square': minusSquare,
|
|
2631
2690
|
loading: loadingIcon,
|
|
2632
2691
|
empty: emptyIcon,
|
|
2633
|
-
drag: dragIcon
|
|
2692
|
+
drag: dragIcon,
|
|
2693
|
+
'arrow-left': arrowLeftIcon,
|
|
2694
|
+
'arrow-right': arrowRightIcon
|
|
2634
2695
|
};
|
|
2635
2696
|
|
|
2636
2697
|
class GanttIconComponent {
|
|
@@ -3123,17 +3184,39 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImpor
|
|
|
3123
3184
|
}] } });
|
|
3124
3185
|
|
|
3125
3186
|
class GanttMainComponent {
|
|
3126
|
-
constructor(ganttUpper) {
|
|
3187
|
+
constructor(ganttUpper, dom, ngZone) {
|
|
3127
3188
|
this.ganttUpper = ganttUpper;
|
|
3189
|
+
this.dom = dom;
|
|
3190
|
+
this.ngZone = ngZone;
|
|
3128
3191
|
this.barClick = new EventEmitter();
|
|
3129
3192
|
this.lineClick = new EventEmitter();
|
|
3130
3193
|
this.ganttMainClass = true;
|
|
3194
|
+
this.unsubscribe$ = new Subject();
|
|
3195
|
+
}
|
|
3196
|
+
ngOnInit() {
|
|
3197
|
+
const onStable$ = this.ngZone.isStable ? from(Promise.resolve()) : this.ngZone.onStable.pipe(take$1(1));
|
|
3198
|
+
this.ngZone.runOutsideAngular(() => {
|
|
3199
|
+
onStable$.pipe(takeUntil$1(this.unsubscribe$)).subscribe(() => {
|
|
3200
|
+
this.setupResize();
|
|
3201
|
+
});
|
|
3202
|
+
});
|
|
3131
3203
|
}
|
|
3132
3204
|
trackBy(index, item) {
|
|
3133
3205
|
return item.id || index;
|
|
3134
3206
|
}
|
|
3135
|
-
|
|
3136
|
-
|
|
3207
|
+
setupResize() {
|
|
3208
|
+
combineLatest([this.dom.getResize(), this.dom.getResizeByElement(this.dom.mainContainer)])
|
|
3209
|
+
.pipe(takeUntil$1(this.unsubscribe$))
|
|
3210
|
+
.subscribe(() => {
|
|
3211
|
+
this.dom.setVisibleRangeX();
|
|
3212
|
+
});
|
|
3213
|
+
}
|
|
3214
|
+
quickTime(item, type) {
|
|
3215
|
+
const date = type === 'left' ? item.start || item.end : item.end || item.start;
|
|
3216
|
+
this.ganttRoot.scrollToDate(date);
|
|
3217
|
+
}
|
|
3218
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: GanttMainComponent, deps: [{ token: GANTT_UPPER_TOKEN }, { token: GanttDomService }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
3219
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.0", type: GanttMainComponent, isStandalone: true, selector: "gantt-main", inputs: { viewportItems: "viewportItems", flatItems: "flatItems", groupHeaderTemplate: "groupHeaderTemplate", itemTemplate: "itemTemplate", barTemplate: "barTemplate", rangeTemplate: "rangeTemplate", baselineTemplate: "baselineTemplate", ganttRoot: "ganttRoot", quickTimeFocus: "quickTimeFocus" }, outputs: { barClick: "barClick", lineClick: "lineClick" }, host: { properties: { "class.gantt-main-container": "this.ganttMainClass" } }, ngImport: i0, template: "<gantt-links-overlay [flatItems]=\"flatItems\" (lineClick)=\"lineClick.emit($event)\"></gantt-links-overlay>\n<div class=\"gantt-main-groups\" [style.width.px]=\"ganttUpper.view.width\">\n <ng-container *ngFor=\"let data of viewportItems; trackBy: trackBy\">\n <div class=\"gantt-group\" [style.height.px]=\"ganttUpper.styles.lineHeight\" [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\n *ngIf=\"ganttUpper.baselineItemsMap[data.id]\"\n [baselineItem]=\"ganttUpper.baselineItemsMap[data.id]\"\n [template]=\"baselineTemplate\"\n ></gantt-baseline>\n </ng-container>\n </div>\n </ng-container>\n</div>\n\n@if (quickTimeFocus) {\n<div class=\"gantt-quick-time-focus-container\" [style.width.px]=\"ganttUpper.view.width\">\n <div class=\"gantt-quick-time-focus\" [style.width.px]=\"dom.visibleRangeX().max - dom.visibleRangeX().min\">\n <ng-container *ngFor=\"let data of viewportItems; let i = index; trackBy: trackBy\">\n <div class=\"gantt-quick-time-focus-item\" [style.height.px]=\"ganttUpper.styles.lineHeight\">\n <span class=\"ml-2\">\n @if ((data.refs.x < dom.visibleRangeX().min ) && data.refs.width ) {\n <a class=\"gantt-quick-time-focus-item-arrow link-secondary\" href=\"javascript:;\" (click)=\"quickTime(data.origin, 'left')\">\n <gantt-icon iconName=\"arrow-left\"></gantt-icon>\n </a>\n }\n </span>\n\n <span class=\"mr-2\">\n @if((data.refs.x + data.refs.width > dom.visibleRangeX().max) && data.refs.width) {\n <a class=\"gantt-quick-time-focus-item-arrow link-secondary\" href=\"javascript:;\" (click)=\"quickTime(data.origin, 'right')\">\n <gantt-icon iconName=\"arrow-right\"></gantt-icon>\n </a>\n }\n </span>\n </div>\n </ng-container>\n </div>\n</div>\n}\n", dependencies: [{ kind: "component", type: GanttLinksComponent, selector: "gantt-links-overlay", inputs: ["flatItems"], outputs: ["lineClick"] }, { kind: "directive", type: NgFor, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: NgxGanttRangeComponent, selector: "ngx-gantt-range,gantt-range" }, { kind: "component", type: NgxGanttBarComponent, selector: "ngx-gantt-bar,gantt-bar", outputs: ["barClick"] }, { kind: "component", type: NgxGanttBaselineComponent, selector: "ngx-gantt-baseline,gantt-baseline", inputs: ["baselineItem", "template"] }, { kind: "pipe", type: IsGanttRangeItemPipe, name: "isGanttRangeItem" }, { kind: "pipe", type: IsGanttBarItemPipe, name: "isGanttBarItem" }, { kind: "pipe", type: IsGanttCustomItemPipe, name: "isGanttCustomItem" }, { kind: "component", type: GanttIconComponent, selector: "gantt-icon", inputs: ["iconName"] }] }); }
|
|
3137
3220
|
}
|
|
3138
3221
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: GanttMainComponent, decorators: [{
|
|
3139
3222
|
type: Component,
|
|
@@ -3148,12 +3231,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImpor
|
|
|
3148
3231
|
NgxGanttBaselineComponent,
|
|
3149
3232
|
IsGanttRangeItemPipe,
|
|
3150
3233
|
IsGanttBarItemPipe,
|
|
3151
|
-
IsGanttCustomItemPipe
|
|
3152
|
-
|
|
3234
|
+
IsGanttCustomItemPipe,
|
|
3235
|
+
GanttIconComponent
|
|
3236
|
+
], template: "<gantt-links-overlay [flatItems]=\"flatItems\" (lineClick)=\"lineClick.emit($event)\"></gantt-links-overlay>\n<div class=\"gantt-main-groups\" [style.width.px]=\"ganttUpper.view.width\">\n <ng-container *ngFor=\"let data of viewportItems; trackBy: trackBy\">\n <div class=\"gantt-group\" [style.height.px]=\"ganttUpper.styles.lineHeight\" [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\n *ngIf=\"ganttUpper.baselineItemsMap[data.id]\"\n [baselineItem]=\"ganttUpper.baselineItemsMap[data.id]\"\n [template]=\"baselineTemplate\"\n ></gantt-baseline>\n </ng-container>\n </div>\n </ng-container>\n</div>\n\n@if (quickTimeFocus) {\n<div class=\"gantt-quick-time-focus-container\" [style.width.px]=\"ganttUpper.view.width\">\n <div class=\"gantt-quick-time-focus\" [style.width.px]=\"dom.visibleRangeX().max - dom.visibleRangeX().min\">\n <ng-container *ngFor=\"let data of viewportItems; let i = index; trackBy: trackBy\">\n <div class=\"gantt-quick-time-focus-item\" [style.height.px]=\"ganttUpper.styles.lineHeight\">\n <span class=\"ml-2\">\n @if ((data.refs.x < dom.visibleRangeX().min ) && data.refs.width ) {\n <a class=\"gantt-quick-time-focus-item-arrow link-secondary\" href=\"javascript:;\" (click)=\"quickTime(data.origin, 'left')\">\n <gantt-icon iconName=\"arrow-left\"></gantt-icon>\n </a>\n }\n </span>\n\n <span class=\"mr-2\">\n @if((data.refs.x + data.refs.width > dom.visibleRangeX().max) && data.refs.width) {\n <a class=\"gantt-quick-time-focus-item-arrow link-secondary\" href=\"javascript:;\" (click)=\"quickTime(data.origin, 'right')\">\n <gantt-icon iconName=\"arrow-right\"></gantt-icon>\n </a>\n }\n </span>\n </div>\n </ng-container>\n </div>\n</div>\n}\n" }]
|
|
3153
3237
|
}], ctorParameters: () => [{ type: GanttUpper, decorators: [{
|
|
3154
3238
|
type: Inject,
|
|
3155
3239
|
args: [GANTT_UPPER_TOKEN]
|
|
3156
|
-
}] }], propDecorators: { viewportItems: [{
|
|
3240
|
+
}] }, { type: GanttDomService }, { type: i0.NgZone }], propDecorators: { viewportItems: [{
|
|
3157
3241
|
type: Input
|
|
3158
3242
|
}], flatItems: [{
|
|
3159
3243
|
type: Input
|
|
@@ -3167,6 +3251,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImpor
|
|
|
3167
3251
|
type: Input
|
|
3168
3252
|
}], baselineTemplate: [{
|
|
3169
3253
|
type: Input
|
|
3254
|
+
}], ganttRoot: [{
|
|
3255
|
+
type: Input
|
|
3256
|
+
}], quickTimeFocus: [{
|
|
3257
|
+
type: Input
|
|
3170
3258
|
}], barClick: [{
|
|
3171
3259
|
type: Output
|
|
3172
3260
|
}], lineClick: [{
|
|
@@ -3597,11 +3685,11 @@ class GanttTableBodyComponent {
|
|
|
3597
3685
|
this.document.querySelectorAll('.drop-position-inside').forEach((element) => element.classList.remove('drop-position-inside'));
|
|
3598
3686
|
}
|
|
3599
3687
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: GanttTableBodyComponent, deps: [{ token: GANTT_ABSTRACT_TOKEN }, { token: GANTT_UPPER_TOKEN }, { token: i0.ChangeDetectorRef }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
3600
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.0", type: GanttTableBodyComponent, isStandalone: true, selector: "gantt-table-body", inputs: { viewportItems: "viewportItems", flatItems: "flatItems", columns: "columns", groupTemplate: "groupTemplate", emptyTemplate: "emptyTemplate", rowBeforeTemplate: "rowBeforeTemplate", rowAfterTemplate: "rowAfterTemplate", draggable: "draggable", dropEnterPredicate: "dropEnterPredicate" }, outputs: { dragDropped: "dragDropped", dragStarted: "dragStarted", dragEnded: "dragEnded", itemClick: "itemClick" }, host: { properties: { "class.gantt-table-draggable": "this.draggable", "class.gantt-table-body": "this.ganttTableClass", "class.gantt-table-empty": "this.ganttTableEmptyClass", "class.gantt-table-dragging": "this.ganttTableDragging" } }, viewQueries: [{ propertyName: "cdkDrags", predicate: (CdkDrag), descendants: true }], ngImport: i0, template: "<div\n class=\"gantt-table-body-container\"\n cdkDropList\n [cdkDropListAutoScrollStep]=\"6\"\n [cdkDropListData]=\"viewportItems\"\n [cdkDropListSortingDisabled]=\"true\"\n (cdkDropListDropped)=\"onListDropped($event)\"\n>\n <ng-container *ngIf=\"!viewportItems?.length\">\n <ng-container *ngIf=\"!emptyTemplate\">\n <gantt-icon class=\"empty-icon\" iconName=\"empty\"></gantt-icon>\n <div class=\"empty-text\">\u6CA1\u6709\u6570\u636E</div>\n </ng-container>\n <ng-template [ngTemplateOutlet]=\"emptyTemplate\"></ng-template>\n </ng-container>\n\n <ng-container *ngIf=\"viewportItems && viewportItems.length > 0\">\n <ng-container *ngFor=\"let item of viewportItems; trackBy: trackBy\">\n <div class=\"gantt-table-group\" [style.height.px]=\"gantt.styles.lineHeight\" [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: CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep", "cdkDropListElementContainer"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: GanttIconComponent, selector: "gantt-icon", inputs: ["iconName"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: NgFor, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer", "cdkDragScale"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "directive", type: CdkDragHandle, selector: "[cdkDragHandle]", inputs: ["cdkDragHandleDisabled"] }, { kind: "pipe", type: IsGanttRangeItemPipe, name: "isGanttRangeItem" }] }); }
|
|
3688
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.0", type: GanttTableBodyComponent, isStandalone: true, selector: "gantt-table-body", inputs: { viewportItems: "viewportItems", flatItems: "flatItems", columns: "columns", groupTemplate: "groupTemplate", emptyTemplate: "emptyTemplate", rowBeforeTemplate: "rowBeforeTemplate", rowAfterTemplate: "rowAfterTemplate", draggable: "draggable", dropEnterPredicate: "dropEnterPredicate" }, outputs: { dragDropped: "dragDropped", dragStarted: "dragStarted", dragEnded: "dragEnded", itemClick: "itemClick" }, host: { properties: { "class.gantt-table-draggable": "this.draggable", "class.gantt-table-body": "this.ganttTableClass", "class.gantt-table-empty": "this.ganttTableEmptyClass", "class.gantt-table-dragging": "this.ganttTableDragging" } }, viewQueries: [{ propertyName: "cdkDrags", predicate: (CdkDrag), descendants: true }], ngImport: i0, template: "<div\n class=\"gantt-table-body-container\"\n cdkDropList\n [cdkDropListAutoScrollStep]=\"6\"\n [cdkDropListData]=\"viewportItems\"\n [cdkDropListSortingDisabled]=\"true\"\n (cdkDropListDropped)=\"onListDropped($event)\"\n>\n <ng-container *ngIf=\"!viewportItems?.length\">\n <ng-container *ngIf=\"!emptyTemplate\">\n <gantt-icon class=\"empty-icon\" iconName=\"empty\"></gantt-icon>\n <div class=\"empty-text\">\u6CA1\u6709\u6570\u636E</div>\n </ng-container>\n <ng-template [ngTemplateOutlet]=\"emptyTemplate\"></ng-template>\n </ng-container>\n\n <ng-container *ngIf=\"viewportItems && viewportItems.length > 0\">\n <ng-container *ngFor=\"let item of viewportItems; trackBy: trackBy\">\n <div class=\"gantt-table-group\" [style.height.px]=\"gantt.styles.lineHeight\" [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, current: item.origin, 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: CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep", "cdkDropListElementContainer"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: GanttIconComponent, selector: "gantt-icon", inputs: ["iconName"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: NgFor, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer", "cdkDragScale"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "directive", type: CdkDragHandle, selector: "[cdkDragHandle]", inputs: ["cdkDragHandleDisabled"] }, { kind: "pipe", type: IsGanttRangeItemPipe, name: "isGanttRangeItem" }] }); }
|
|
3601
3689
|
}
|
|
3602
3690
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: GanttTableBodyComponent, decorators: [{
|
|
3603
3691
|
type: Component,
|
|
3604
|
-
args: [{ selector: 'gantt-table-body', standalone: true, imports: [CdkDropList, NgIf, GanttIconComponent, NgTemplateOutlet, NgFor, NgClass, CdkDrag, CdkDragHandle, IsGanttRangeItemPipe], template: "<div\n class=\"gantt-table-body-container\"\n cdkDropList\n [cdkDropListAutoScrollStep]=\"6\"\n [cdkDropListData]=\"viewportItems\"\n [cdkDropListSortingDisabled]=\"true\"\n (cdkDropListDropped)=\"onListDropped($event)\"\n>\n <ng-container *ngIf=\"!viewportItems?.length\">\n <ng-container *ngIf=\"!emptyTemplate\">\n <gantt-icon class=\"empty-icon\" iconName=\"empty\"></gantt-icon>\n <div class=\"empty-text\">\u6CA1\u6709\u6570\u636E</div>\n </ng-container>\n <ng-template [ngTemplateOutlet]=\"emptyTemplate\"></ng-template>\n </ng-container>\n\n <ng-container *ngIf=\"viewportItems && viewportItems.length > 0\">\n <ng-container *ngFor=\"let item of viewportItems; trackBy: trackBy\">\n <div class=\"gantt-table-group\" [style.height.px]=\"gantt.styles.lineHeight\" [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" }]
|
|
3692
|
+
args: [{ selector: 'gantt-table-body', standalone: true, imports: [CdkDropList, NgIf, GanttIconComponent, NgTemplateOutlet, NgFor, NgClass, CdkDrag, CdkDragHandle, IsGanttRangeItemPipe], template: "<div\n class=\"gantt-table-body-container\"\n cdkDropList\n [cdkDropListAutoScrollStep]=\"6\"\n [cdkDropListData]=\"viewportItems\"\n [cdkDropListSortingDisabled]=\"true\"\n (cdkDropListDropped)=\"onListDropped($event)\"\n>\n <ng-container *ngIf=\"!viewportItems?.length\">\n <ng-container *ngIf=\"!emptyTemplate\">\n <gantt-icon class=\"empty-icon\" iconName=\"empty\"></gantt-icon>\n <div class=\"empty-text\">\u6CA1\u6709\u6570\u636E</div>\n </ng-container>\n <ng-template [ngTemplateOutlet]=\"emptyTemplate\"></ng-template>\n </ng-container>\n\n <ng-container *ngIf=\"viewportItems && viewportItems.length > 0\">\n <ng-container *ngFor=\"let item of viewportItems; trackBy: trackBy\">\n <div class=\"gantt-table-group\" [style.height.px]=\"gantt.styles.lineHeight\" [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, current: item.origin, 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" }]
|
|
3605
3693
|
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
3606
3694
|
type: Inject,
|
|
3607
3695
|
args: [GANTT_ABSTRACT_TOKEN]
|
|
@@ -3838,7 +3926,7 @@ class NgxGanttRootComponent {
|
|
|
3838
3926
|
this.unsubscribe$.next();
|
|
3839
3927
|
}
|
|
3840
3928
|
setupViewScroll() {
|
|
3841
|
-
if (this.ganttUpper.disabledLoadOnScroll) {
|
|
3929
|
+
if (this.ganttUpper.disabledLoadOnScroll && !this.ganttUpper.quickTimeFocus) {
|
|
3842
3930
|
return;
|
|
3843
3931
|
}
|
|
3844
3932
|
this.dom
|
|
@@ -3980,9 +4068,10 @@ class NgxGanttTableComponent {
|
|
|
3980
4068
|
this.dragStarted = new EventEmitter();
|
|
3981
4069
|
this.dragEnded = new EventEmitter();
|
|
3982
4070
|
this.columnChanges = new EventEmitter();
|
|
4071
|
+
this.itemClick = new EventEmitter();
|
|
3983
4072
|
}
|
|
3984
4073
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: NgxGanttTableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
3985
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.0", type: NgxGanttTableComponent, isStandalone: true, 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 }, { propertyName: "tableEmptyTemplate", first: true, predicate: ["tableEmpty"], descendants: true, static: true }, { propertyName: "tableFooterTemplate", first: true, predicate: ["tableFooter"], descendants: true, static: true }], ngImport: i0, template: '', isInline: true }); }
|
|
4074
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.0", type: NgxGanttTableComponent, isStandalone: true, selector: "ngx-gantt-table", inputs: { draggable: "draggable", dropEnterPredicate: "dropEnterPredicate" }, outputs: { dragDropped: "dragDropped", dragStarted: "dragStarted", dragEnded: "dragEnded", columnChanges: "columnChanges", itemClick: "itemClick" }, queries: [{ propertyName: "rowBeforeTemplate", first: true, predicate: ["rowBeforeSlot"], descendants: true, static: true }, { propertyName: "rowAfterTemplate", first: true, predicate: ["rowAfterSlot"], descendants: true, static: true }, { propertyName: "tableEmptyTemplate", first: true, predicate: ["tableEmpty"], descendants: true, static: true }, { propertyName: "tableFooterTemplate", first: true, predicate: ["tableFooter"], descendants: true, static: true }], ngImport: i0, template: '', isInline: true }); }
|
|
3986
4075
|
}
|
|
3987
4076
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: NgxGanttTableComponent, decorators: [{
|
|
3988
4077
|
type: Component,
|
|
@@ -4003,6 +4092,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImpor
|
|
|
4003
4092
|
type: Output
|
|
4004
4093
|
}], columnChanges: [{
|
|
4005
4094
|
type: Output
|
|
4095
|
+
}], itemClick: [{
|
|
4096
|
+
type: Output
|
|
4006
4097
|
}], rowBeforeTemplate: [{
|
|
4007
4098
|
type: ContentChild,
|
|
4008
4099
|
args: ['rowBeforeSlot', { static: true }]
|
|
@@ -4233,6 +4324,10 @@ class NgxGanttComponent extends GanttUpper {
|
|
|
4233
4324
|
}
|
|
4234
4325
|
}
|
|
4235
4326
|
selectItem(selectEvent) {
|
|
4327
|
+
this.table.itemClick.emit({
|
|
4328
|
+
event: selectEvent.event,
|
|
4329
|
+
current: selectEvent.current
|
|
4330
|
+
});
|
|
4236
4331
|
if (!this.selectable) {
|
|
4237
4332
|
return;
|
|
4238
4333
|
}
|
|
@@ -4296,7 +4391,7 @@ class NgxGanttComponent extends GanttUpper {
|
|
|
4296
4391
|
provide: GANTT_ABSTRACT_TOKEN,
|
|
4297
4392
|
useExisting: forwardRef(() => NgxGanttComponent)
|
|
4298
4393
|
}
|
|
4299
|
-
], queries: [{ propertyName: "table", first: true, predicate: NgxGanttTableComponent, descendants: true }, { propertyName: "tableEmptyTemplate", first: true, predicate: ["tableEmpty"], descendants: true, static: true }, { propertyName: "footerTemplate", first: true, predicate: ["footer"], 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 [style.padding-right.px]=\"ganttRoot.verticalScrollbarWidth\"></gantt-calendar-header>\n </div>\n </div>\n <gantt-loader *ngIf=\"loading\"></gantt-loader>\n\n <cdk-virtual-scroll-viewport\n class=\"gantt-virtual-scroll-viewport\"\n [ngClass]=\"{\n 'gantt-normal-viewport': !virtualScrollEnabled,\n 'gantt-scroll-container': virtualScrollEnabled,\n 'with-footer': table?.tableFooterTemplate || footerTemplate\n }\"\n [style.top.px]=\"styles.headerHeight\"\n [itemSize]=\"styles.lineHeight\"\n [minBufferPx]=\"styles.lineHeight * 10\"\n [maxBufferPx]=\"styles.lineHeight * 20\"\n (scrolledIndexChange)=\"scrolledIndexChange($event)\"\n >\n <ng-container *cdkVirtualFor=\"let item of flatItems; trackBy: trackBy\"></ng-container>\n <div class=\"gantt-side\" [style.width.px]=\"tableHeader.tableWidth + 1\" [style.padding-bottom.px]=\"ganttRoot.horizontalScrollbarHeight\">\n <div class=\"gantt-side-container\">\n <div class=\"gantt-table\">\n <gantt-table-body\n [flatItems]=\"flatItems\"\n [viewportItems]=\"viewportItems\"\n [columns]=\"columns\"\n [groupTemplate]=\"groupTemplate\"\n [emptyTemplate]=\"table.tableEmptyTemplate || 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)=\"itemDragStarted($event)\"\n (dragEnded)=\"itemDragEnded($event)\"\n (itemClick)=\"selectItem($event)\"\n >\n </gantt-table-body>\n </div>\n </div>\n </div>\n <div class=\"gantt-container\">\n <gantt-calendar-grid\n [style.padding-right.px]=\"ganttRoot.verticalScrollbarWidth\"\n [style.padding-bottom.px]=\"ganttRoot.horizontalScrollbarHeight\"\n ></gantt-calendar-grid>\n <div class=\"gantt-main\">\n <gantt-main\n [flatItems]=\"flatItems\"\n [viewportItems]=\"viewportItems\"\n [groupHeaderTemplate]=\"groupHeaderTemplate\"\n [itemTemplate]=\"itemTemplate\"\n [barTemplate]=\"barTemplate\"\n [rangeTemplate]=\"rangeTemplate\"\n [baselineTemplate]=\"baselineTemplate\"\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\n <gantt-scrollbar\n [ganttRoot]=\"ganttRoot\"\n [hasFooter]=\"!!table?.tableFooterTemplate\"\n [tableWidth]=\"tableHeader.tableWidth\"\n ></gantt-scrollbar>\n\n <div\n class=\"gantt-footer\"\n *ngIf=\"table?.tableFooterTemplate || footerTemplate\"\n [style.right.px]=\"ganttRoot.verticalScrollbarWidth\"\n [style.bottom.px]=\"ganttRoot.horizontalScrollbarHeight\"\n >\n <div class=\"gantt-table-footer\" [style.width.px]=\"tableHeader.tableWidth + 1\" *ngIf=\"table?.tableFooterTemplate\">\n <ng-template [ngTemplateOutlet]=\"table?.tableFooterTemplate\" [ngTemplateOutletContext]=\"{ columns: columns }\"> </ng-template>\n </div>\n <div class=\"gantt-container-footer\" *ngIf=\"footerTemplate\">\n <ng-template [ngTemplateOutlet]=\"footerTemplate\"> </ng-template>\n </div>\n </div>\n</ngx-gantt-root>\n", dependencies: [{ kind: "component", type: NgxGanttRootComponent, selector: "ngx-gantt-root", inputs: ["sideWidth"] }, { kind: "component", type: GanttTableHeaderComponent, selector: "gantt-table-header", inputs: ["columns"] }, { kind: "component", type: GanttCalendarHeaderComponent, selector: "gantt-calendar-header" }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: GanttLoaderComponent, selector: "gantt-loader" }, { kind: "component", type: CdkVirtualScrollViewport, selector: "cdk-virtual-scroll-viewport", inputs: ["orientation", "appendOnly"], outputs: ["scrolledIndexChange"] }, { kind: "directive", type: CdkFixedSizeVirtualScroll, selector: "cdk-virtual-scroll-viewport[itemSize]", inputs: ["itemSize", "minBufferPx", "maxBufferPx"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: CdkVirtualForOf, selector: "[cdkVirtualFor][cdkVirtualForOf]", inputs: ["cdkVirtualForOf", "cdkVirtualForTrackBy", "cdkVirtualForTemplate", "cdkVirtualForTemplateCacheSize"] }, { kind: "component", type: GanttTableBodyComponent, selector: "gantt-table-body", inputs: ["viewportItems", "flatItems", "columns", "groupTemplate", "emptyTemplate", "rowBeforeTemplate", "rowAfterTemplate", "draggable", "dropEnterPredicate"], outputs: ["dragDropped", "dragStarted", "dragEnded", "itemClick"] }, { kind: "component", type: GanttCalendarGridComponent, selector: "gantt-calendar-grid" }, { kind: "component", type: GanttMainComponent, selector: "gantt-main", inputs: ["viewportItems", "flatItems", "groupHeaderTemplate", "itemTemplate", "barTemplate", "rangeTemplate", "baselineTemplate"], outputs: ["barClick", "lineClick"] }, { kind: "component", type: GanttDragBackdropComponent, selector: "gantt-drag-backdrop" }, { kind: "component", type: GanttScrollbarComponent, selector: "gantt-scrollbar", inputs: ["hasFooter", "tableWidth", "ganttRoot"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
4394
|
+
], queries: [{ propertyName: "table", first: true, predicate: NgxGanttTableComponent, descendants: true }, { propertyName: "tableEmptyTemplate", first: true, predicate: ["tableEmpty"], descendants: true, static: true }, { propertyName: "footerTemplate", first: true, predicate: ["footer"], 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 [style.padding-right.px]=\"ganttRoot.verticalScrollbarWidth\"></gantt-calendar-header>\n </div>\n </div>\n <gantt-loader *ngIf=\"loading\"></gantt-loader>\n\n <cdk-virtual-scroll-viewport\n class=\"gantt-virtual-scroll-viewport\"\n [ngClass]=\"{\n 'gantt-normal-viewport': !virtualScrollEnabled,\n 'gantt-scroll-container': virtualScrollEnabled,\n 'with-footer': table?.tableFooterTemplate || footerTemplate\n }\"\n [style.top.px]=\"styles.headerHeight\"\n [itemSize]=\"styles.lineHeight\"\n [minBufferPx]=\"styles.lineHeight * 10\"\n [maxBufferPx]=\"styles.lineHeight * 20\"\n (scrolledIndexChange)=\"scrolledIndexChange($event)\"\n >\n <ng-container *cdkVirtualFor=\"let item of flatItems; trackBy: trackBy\"></ng-container>\n <div class=\"gantt-side\" [style.width.px]=\"tableHeader.tableWidth + 1\" [style.padding-bottom.px]=\"ganttRoot.horizontalScrollbarHeight\">\n <div class=\"gantt-side-container\">\n <div class=\"gantt-table\">\n <gantt-table-body\n [flatItems]=\"flatItems\"\n [viewportItems]=\"viewportItems\"\n [columns]=\"columns\"\n [groupTemplate]=\"groupTemplate\"\n [emptyTemplate]=\"table.tableEmptyTemplate || 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)=\"itemDragStarted($event)\"\n (dragEnded)=\"itemDragEnded($event)\"\n (itemClick)=\"selectItem($event)\"\n >\n </gantt-table-body>\n </div>\n </div>\n </div>\n <div class=\"gantt-container\">\n <gantt-calendar-grid\n [style.padding-right.px]=\"ganttRoot.verticalScrollbarWidth\"\n [style.padding-bottom.px]=\"ganttRoot.horizontalScrollbarHeight\"\n ></gantt-calendar-grid>\n <div class=\"gantt-main\">\n <gantt-main\n [ganttRoot]=\"ganttRoot\"\n [flatItems]=\"flatItems\"\n [viewportItems]=\"viewportItems\"\n [groupHeaderTemplate]=\"groupHeaderTemplate\"\n [itemTemplate]=\"itemTemplate\"\n [barTemplate]=\"barTemplate\"\n [rangeTemplate]=\"rangeTemplate\"\n [baselineTemplate]=\"baselineTemplate\"\n [quickTimeFocus]=\"quickTimeFocus\"\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\n <gantt-scrollbar\n [ganttRoot]=\"ganttRoot\"\n [hasFooter]=\"!!table?.tableFooterTemplate\"\n [tableWidth]=\"tableHeader.tableWidth\"\n ></gantt-scrollbar>\n\n <div\n class=\"gantt-footer\"\n *ngIf=\"table?.tableFooterTemplate || footerTemplate\"\n [style.right.px]=\"ganttRoot.verticalScrollbarWidth\"\n [style.bottom.px]=\"ganttRoot.horizontalScrollbarHeight\"\n >\n <div class=\"gantt-table-footer\" [style.width.px]=\"tableHeader.tableWidth + 1\" *ngIf=\"table?.tableFooterTemplate\">\n <ng-template [ngTemplateOutlet]=\"table?.tableFooterTemplate\" [ngTemplateOutletContext]=\"{ columns: columns }\"> </ng-template>\n </div>\n <div class=\"gantt-container-footer\" *ngIf=\"footerTemplate\">\n <ng-template [ngTemplateOutlet]=\"footerTemplate\"> </ng-template>\n </div>\n </div>\n</ngx-gantt-root>\n", dependencies: [{ kind: "component", type: NgxGanttRootComponent, selector: "ngx-gantt-root", inputs: ["sideWidth"] }, { kind: "component", type: GanttTableHeaderComponent, selector: "gantt-table-header", inputs: ["columns"] }, { kind: "component", type: GanttCalendarHeaderComponent, selector: "gantt-calendar-header" }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: GanttLoaderComponent, selector: "gantt-loader" }, { kind: "component", type: CdkVirtualScrollViewport, selector: "cdk-virtual-scroll-viewport", inputs: ["orientation", "appendOnly"], outputs: ["scrolledIndexChange"] }, { kind: "directive", type: CdkFixedSizeVirtualScroll, selector: "cdk-virtual-scroll-viewport[itemSize]", inputs: ["itemSize", "minBufferPx", "maxBufferPx"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: CdkVirtualForOf, selector: "[cdkVirtualFor][cdkVirtualForOf]", inputs: ["cdkVirtualForOf", "cdkVirtualForTrackBy", "cdkVirtualForTemplate", "cdkVirtualForTemplateCacheSize"] }, { kind: "component", type: GanttTableBodyComponent, selector: "gantt-table-body", inputs: ["viewportItems", "flatItems", "columns", "groupTemplate", "emptyTemplate", "rowBeforeTemplate", "rowAfterTemplate", "draggable", "dropEnterPredicate"], outputs: ["dragDropped", "dragStarted", "dragEnded", "itemClick"] }, { kind: "component", type: GanttCalendarGridComponent, selector: "gantt-calendar-grid" }, { kind: "component", type: GanttMainComponent, selector: "gantt-main", inputs: ["viewportItems", "flatItems", "groupHeaderTemplate", "itemTemplate", "barTemplate", "rangeTemplate", "baselineTemplate", "ganttRoot", "quickTimeFocus"], outputs: ["barClick", "lineClick"] }, { kind: "component", type: GanttDragBackdropComponent, selector: "gantt-drag-backdrop" }, { kind: "component", type: GanttScrollbarComponent, selector: "gantt-scrollbar", inputs: ["hasFooter", "tableWidth", "ganttRoot"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
4300
4395
|
}
|
|
4301
4396
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: NgxGanttComponent, decorators: [{
|
|
4302
4397
|
type: Component,
|
|
@@ -4324,8 +4419,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImpor
|
|
|
4324
4419
|
GanttMainComponent,
|
|
4325
4420
|
GanttDragBackdropComponent,
|
|
4326
4421
|
GanttScrollbarComponent,
|
|
4327
|
-
NgTemplateOutlet
|
|
4328
|
-
|
|
4422
|
+
NgTemplateOutlet,
|
|
4423
|
+
NgFor
|
|
4424
|
+
], 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 [style.padding-right.px]=\"ganttRoot.verticalScrollbarWidth\"></gantt-calendar-header>\n </div>\n </div>\n <gantt-loader *ngIf=\"loading\"></gantt-loader>\n\n <cdk-virtual-scroll-viewport\n class=\"gantt-virtual-scroll-viewport\"\n [ngClass]=\"{\n 'gantt-normal-viewport': !virtualScrollEnabled,\n 'gantt-scroll-container': virtualScrollEnabled,\n 'with-footer': table?.tableFooterTemplate || footerTemplate\n }\"\n [style.top.px]=\"styles.headerHeight\"\n [itemSize]=\"styles.lineHeight\"\n [minBufferPx]=\"styles.lineHeight * 10\"\n [maxBufferPx]=\"styles.lineHeight * 20\"\n (scrolledIndexChange)=\"scrolledIndexChange($event)\"\n >\n <ng-container *cdkVirtualFor=\"let item of flatItems; trackBy: trackBy\"></ng-container>\n <div class=\"gantt-side\" [style.width.px]=\"tableHeader.tableWidth + 1\" [style.padding-bottom.px]=\"ganttRoot.horizontalScrollbarHeight\">\n <div class=\"gantt-side-container\">\n <div class=\"gantt-table\">\n <gantt-table-body\n [flatItems]=\"flatItems\"\n [viewportItems]=\"viewportItems\"\n [columns]=\"columns\"\n [groupTemplate]=\"groupTemplate\"\n [emptyTemplate]=\"table.tableEmptyTemplate || 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)=\"itemDragStarted($event)\"\n (dragEnded)=\"itemDragEnded($event)\"\n (itemClick)=\"selectItem($event)\"\n >\n </gantt-table-body>\n </div>\n </div>\n </div>\n <div class=\"gantt-container\">\n <gantt-calendar-grid\n [style.padding-right.px]=\"ganttRoot.verticalScrollbarWidth\"\n [style.padding-bottom.px]=\"ganttRoot.horizontalScrollbarHeight\"\n ></gantt-calendar-grid>\n <div class=\"gantt-main\">\n <gantt-main\n [ganttRoot]=\"ganttRoot\"\n [flatItems]=\"flatItems\"\n [viewportItems]=\"viewportItems\"\n [groupHeaderTemplate]=\"groupHeaderTemplate\"\n [itemTemplate]=\"itemTemplate\"\n [barTemplate]=\"barTemplate\"\n [rangeTemplate]=\"rangeTemplate\"\n [baselineTemplate]=\"baselineTemplate\"\n [quickTimeFocus]=\"quickTimeFocus\"\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\n <gantt-scrollbar\n [ganttRoot]=\"ganttRoot\"\n [hasFooter]=\"!!table?.tableFooterTemplate\"\n [tableWidth]=\"tableHeader.tableWidth\"\n ></gantt-scrollbar>\n\n <div\n class=\"gantt-footer\"\n *ngIf=\"table?.tableFooterTemplate || footerTemplate\"\n [style.right.px]=\"ganttRoot.verticalScrollbarWidth\"\n [style.bottom.px]=\"ganttRoot.horizontalScrollbarHeight\"\n >\n <div class=\"gantt-table-footer\" [style.width.px]=\"tableHeader.tableWidth + 1\" *ngIf=\"table?.tableFooterTemplate\">\n <ng-template [ngTemplateOutlet]=\"table?.tableFooterTemplate\" [ngTemplateOutletContext]=\"{ columns: columns }\"> </ng-template>\n </div>\n <div class=\"gantt-container-footer\" *ngIf=\"footerTemplate\">\n <ng-template [ngTemplateOutlet]=\"footerTemplate\"> </ng-template>\n </div>\n </div>\n</ngx-gantt-root>\n" }]
|
|
4329
4425
|
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }, { type: i0.NgZone }, { type: i1$1.ViewportRuler }, { type: undefined, decorators: [{
|
|
4330
4426
|
type: Inject,
|
|
4331
4427
|
args: [GANTT_GLOBAL_CONFIG]
|
|
@@ -4493,5 +4589,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImpor
|
|
|
4493
4589
|
* Generated bundle index. Do not edit.
|
|
4494
4590
|
*/
|
|
4495
4591
|
|
|
4496
|
-
export { GANTT_GLOBAL_CONFIG, GANTT_UPPER_TOKEN, GanttBarClickEvent, GanttBaselineItemInternal, GanttCalendarGridComponent, GanttCalendarHeaderComponent, GanttDate, GanttDatePoint, GanttDragBackdropComponent, GanttDragEvent, GanttGroupInternal, GanttItemInternal, GanttItemType, GanttItemUpper, GanttLineClickEvent, GanttLinkDragEvent, GanttLinkLineType, GanttLinkType, GanttLoadOnScrollEvent, GanttLoaderComponent, GanttPrintService, GanttScrollbarComponent, GanttSelectedEvent, GanttTableDragDroppedEvent, GanttTableDragEndedEvent, GanttTableDragEnterPredicateContext, GanttTableDragStartedEvent, GanttTableEvent, GanttUpper, GanttView, GanttViewType, GanttVirtualScrolledIndexChangeEvent, IsGanttBarItemPipe, IsGanttCustomItemPipe, IsGanttRangeItemPipe, LinkColors, NgxGanttBarComponent, NgxGanttBaselineComponent, NgxGanttComponent, NgxGanttModule, NgxGanttRangeComponent, NgxGanttRootComponent, NgxGanttTableColumnComponent, NgxGanttTableComponent, NgxGanttToolbarComponent, defaultConfig, ganttViews, primaryDatePointTop, registerView, secondaryDatePointTop };
|
|
4592
|
+
export { GANTT_GLOBAL_CONFIG, GANTT_UPPER_TOKEN, GanttBarClickEvent, GanttBaselineItemInternal, GanttCalendarGridComponent, GanttCalendarHeaderComponent, GanttDate, GanttDatePoint, GanttDragBackdropComponent, GanttDragEvent, GanttGroupInternal, GanttItemInternal, GanttItemType, GanttItemUpper, GanttLineClickEvent, GanttLinkDragEvent, GanttLinkLineType, GanttLinkType, GanttLoadOnScrollEvent, GanttLoaderComponent, GanttPrintService, GanttScrollbarComponent, GanttSelectedEvent, GanttTableDragDroppedEvent, GanttTableDragEndedEvent, GanttTableDragEnterPredicateContext, GanttTableDragStartedEvent, GanttTableEvent, GanttTableItemClickEvent, GanttUpper, GanttView, GanttViewType, GanttVirtualScrolledIndexChangeEvent, IsGanttBarItemPipe, IsGanttCustomItemPipe, IsGanttRangeItemPipe, LinkColors, NgxGanttBarComponent, NgxGanttBaselineComponent, NgxGanttComponent, NgxGanttModule, NgxGanttRangeComponent, NgxGanttRootComponent, NgxGanttTableColumnComponent, NgxGanttTableComponent, NgxGanttToolbarComponent, defaultConfig, ganttViews, primaryDatePointTop, registerView, secondaryDatePointTop };
|
|
4497
4593
|
//# sourceMappingURL=worktile-gantt.mjs.map
|