@worktile/gantt 15.1.0-next.9 → 15.1.1
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/link.d.ts +1 -1
- package/components/bar/bar-drag.d.ts +11 -1
- package/components/bar/bar.component.scss +2 -2
- package/components/links/links.component.d.ts +2 -2
- package/components/main/gantt-main.component.d.ts +3 -3
- package/components/table/body/gantt-table-body.component.d.ts +5 -5
- package/esm2020/class/link.mjs +2 -2
- package/esm2020/components/bar/bar-drag.mjs +110 -40
- package/esm2020/components/bar/bar.component.mjs +4 -2
- package/esm2020/components/links/links.component.mjs +5 -5
- package/esm2020/components/main/gantt-main.component.mjs +5 -5
- package/esm2020/components/table/body/gantt-table-body.component.mjs +18 -18
- package/esm2020/gantt-dom.service.mjs +2 -1
- package/esm2020/gantt.component.mjs +68 -45
- package/esm2020/gantt.module.mjs +1 -7
- package/esm2020/gantt.styles.mjs +2 -2
- package/esm2020/root.component.mjs +27 -4
- package/esm2020/utils/drag-scroll.mjs +20 -1
- package/fesm2015/worktile-gantt.mjs +338 -203
- package/fesm2015/worktile-gantt.mjs.map +1 -1
- package/fesm2020/worktile-gantt.mjs +334 -199
- package/fesm2020/worktile-gantt.mjs.map +1 -1
- package/gantt-dom.service.d.ts +1 -0
- package/gantt.component.d.ts +14 -13
- package/gantt.component.scss +19 -2
- package/gantt.styles.d.ts +1 -1
- package/package.json +1 -1
- package/root.component.d.ts +4 -0
- package/styles/variables.scss +3 -2
- package/utils/drag-scroll.d.ts +7 -0
- package/components/calendar/calendar.component.scss +0 -79
- package/components/table/gantt-table.component.scss +0 -237
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { InjectionToken, EventEmitter, Directive, Inject, Input, Output, ContentChild, HostBinding, Component,
|
|
2
|
+
import { InjectionToken, EventEmitter, Directive, Inject, Input, Output, ContentChild, HostBinding, Component, ViewChild, Pipe, ViewChildren, Injectable, PLATFORM_ID, ElementRef, Optional, HostListener, 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
5
|
import { take, takeUntil, skip, switchMap, debounceTime, map, pairwise, auditTime as auditTime$1, startWith as startWith$1, finalize } from 'rxjs/operators';
|
|
@@ -8,11 +8,11 @@ import { fromUnixTime, getWeek, getDaysInMonth, differenceInCalendarDays, setDat
|
|
|
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 i1$1 from '@angular/cdk/scrolling';
|
|
12
12
|
import { CdkVirtualScrollViewport, ScrollingModule } from '@angular/cdk/scrolling';
|
|
13
|
-
import { __awaiter, __decorate, __param } from 'tslib';
|
|
14
13
|
import * as i2 from '@angular/cdk/drag-drop';
|
|
15
14
|
import { CdkDrag, DragDropModule } from '@angular/cdk/drag-drop';
|
|
15
|
+
import { __decorate, __param, __awaiter } from 'tslib';
|
|
16
16
|
|
|
17
17
|
class GanttDatePoint {
|
|
18
18
|
constructor(start, text, x, y, additions, style) {
|
|
@@ -222,7 +222,7 @@ var LinkColors;
|
|
|
222
222
|
(function (LinkColors) {
|
|
223
223
|
LinkColors["default"] = "#cacaca";
|
|
224
224
|
LinkColors["blocked"] = "#FF7575";
|
|
225
|
-
LinkColors["active"] = "#
|
|
225
|
+
LinkColors["active"] = "#6698ff";
|
|
226
226
|
})(LinkColors || (LinkColors = {}));
|
|
227
227
|
|
|
228
228
|
var GanttItemType;
|
|
@@ -778,7 +778,7 @@ const sideWidth = 400;
|
|
|
778
778
|
const sideMiddleWidth = 500;
|
|
779
779
|
const sideMaxWidth = 600;
|
|
780
780
|
const sideMinWidth = 400;
|
|
781
|
-
const barBackground = '#
|
|
781
|
+
const barBackground = '#6698ff';
|
|
782
782
|
const rangeHeight = 17;
|
|
783
783
|
const todayHeight = 24;
|
|
784
784
|
const todayWidth = 35;
|
|
@@ -1324,100 +1324,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImpor
|
|
|
1324
1324
|
|
|
1325
1325
|
const GANTT_ABSTRACT_TOKEN = new InjectionToken('gantt-abstract-token');
|
|
1326
1326
|
|
|
1327
|
-
class GanttPrintService {
|
|
1328
|
-
constructor() { }
|
|
1329
|
-
setInlineStyles(targetElem) {
|
|
1330
|
-
const svgElements = Array.from(targetElem.getElementsByTagName('svg'));
|
|
1331
|
-
for (const svgElement of svgElements) {
|
|
1332
|
-
this.recursElementChildren(svgElement);
|
|
1333
|
-
}
|
|
1334
|
-
}
|
|
1335
|
-
recursElementChildren(node) {
|
|
1336
|
-
const transformProperties = [
|
|
1337
|
-
'fill',
|
|
1338
|
-
'color',
|
|
1339
|
-
'font-size',
|
|
1340
|
-
'stroke',
|
|
1341
|
-
'font',
|
|
1342
|
-
'text-anchor',
|
|
1343
|
-
'stroke-dasharray',
|
|
1344
|
-
'shape-rendering',
|
|
1345
|
-
'stroke-width'
|
|
1346
|
-
];
|
|
1347
|
-
if (!node.style) {
|
|
1348
|
-
return;
|
|
1349
|
-
}
|
|
1350
|
-
const styles = getComputedStyle(node);
|
|
1351
|
-
for (const transformProperty of transformProperties) {
|
|
1352
|
-
node.style[transformProperty] = styles[transformProperty];
|
|
1353
|
-
}
|
|
1354
|
-
for (const child of Array.from(node.childNodes)) {
|
|
1355
|
-
this.recursElementChildren(child);
|
|
1356
|
-
}
|
|
1357
|
-
}
|
|
1358
|
-
register(root) {
|
|
1359
|
-
this.root = root.nativeElement;
|
|
1360
|
-
this.mainContainer = this.root.getElementsByClassName('gantt-main-container')[0];
|
|
1361
|
-
}
|
|
1362
|
-
print(name = 'download', ignoreElementClass) {
|
|
1363
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
1364
|
-
const root = this.root;
|
|
1365
|
-
const mainContainer = this.mainContainer;
|
|
1366
|
-
// set print width
|
|
1367
|
-
const printWidth = root.offsetWidth;
|
|
1368
|
-
// set print height
|
|
1369
|
-
const printHeight = root.offsetHeight - mainContainer.offsetHeight + mainContainer.scrollHeight;
|
|
1370
|
-
const html2canvas = (yield import(/* webpackChunkName: 'html2canvas' */ 'html2canvas')).default;
|
|
1371
|
-
html2canvas(root, {
|
|
1372
|
-
logging: false,
|
|
1373
|
-
allowTaint: true,
|
|
1374
|
-
useCORS: true,
|
|
1375
|
-
width: printWidth,
|
|
1376
|
-
height: printHeight,
|
|
1377
|
-
ignoreElements: (element) => {
|
|
1378
|
-
if (ignoreElementClass && element.classList.contains(ignoreElementClass)) {
|
|
1379
|
-
return true;
|
|
1380
|
-
}
|
|
1381
|
-
if (element.classList.contains('gantt-calendar-today-overlay')) {
|
|
1382
|
-
return true;
|
|
1383
|
-
}
|
|
1384
|
-
},
|
|
1385
|
-
onclone: (cloneDocument) => {
|
|
1386
|
-
const ganttClass = root.className;
|
|
1387
|
-
const cloneGanttDom = cloneDocument.querySelector(`.${ganttClass.replace(/\s+/g, '.')}`);
|
|
1388
|
-
const cloneGanttContainerDom = cloneDocument.querySelector('.gantt-container');
|
|
1389
|
-
const cloneCalendarOverlay = cloneDocument.querySelector('.gantt-calendar-grid-main');
|
|
1390
|
-
const cloneLinksOverlay = cloneDocument.querySelector('.gantt-links-overlay-main');
|
|
1391
|
-
// change targetDom width
|
|
1392
|
-
cloneGanttDom.style.width = `${printWidth}px`;
|
|
1393
|
-
cloneGanttDom.style.height = `${printHeight}px`;
|
|
1394
|
-
cloneGanttDom.style.overflow = `unset`;
|
|
1395
|
-
cloneGanttContainerDom.style.backgroundColor = '#fff';
|
|
1396
|
-
cloneCalendarOverlay.setAttribute('height', `${printHeight}`);
|
|
1397
|
-
cloneCalendarOverlay.setAttribute('style', `background: transparent`);
|
|
1398
|
-
if (cloneLinksOverlay) {
|
|
1399
|
-
cloneLinksOverlay.setAttribute('height', `${printHeight}`);
|
|
1400
|
-
cloneLinksOverlay.setAttribute('style', `height: ${printHeight}px`);
|
|
1401
|
-
}
|
|
1402
|
-
// setInlineStyles for svg
|
|
1403
|
-
this.setInlineStyles(cloneGanttDom);
|
|
1404
|
-
}
|
|
1405
|
-
}).then((canvas) => {
|
|
1406
|
-
const link = document.createElement('a');
|
|
1407
|
-
const dataUrl = canvas.toDataURL('image/png');
|
|
1408
|
-
link.download = `${name}.png`;
|
|
1409
|
-
link.href = dataUrl;
|
|
1410
|
-
link.click();
|
|
1411
|
-
});
|
|
1412
|
-
});
|
|
1413
|
-
}
|
|
1414
|
-
}
|
|
1415
|
-
GanttPrintService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: GanttPrintService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1416
|
-
GanttPrintService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: GanttPrintService });
|
|
1417
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: GanttPrintService, decorators: [{
|
|
1418
|
-
type: Injectable
|
|
1419
|
-
}], ctorParameters: function () { return []; } });
|
|
1420
|
-
|
|
1421
1327
|
const supports = (typeof window !== 'undefined' && !!window.CSS && CSS.supports) || (() => false);
|
|
1422
1328
|
/**
|
|
1423
1329
|
* Note: we don't need to add vendor prefixes within `.scss` files since they're added automatically.
|
|
@@ -1730,16 +1636,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImpor
|
|
|
1730
1636
|
}] });
|
|
1731
1637
|
|
|
1732
1638
|
class GanttTableBodyComponent {
|
|
1733
|
-
set
|
|
1639
|
+
set viewportItems(data) {
|
|
1734
1640
|
const firstData = data[0];
|
|
1735
1641
|
if (firstData && firstData.hasOwnProperty('items')) {
|
|
1736
1642
|
this.hasGroup = true;
|
|
1737
1643
|
}
|
|
1738
1644
|
this.ganttTableEmptyClass = (data === null || data === void 0 ? void 0 : data.length) ? false : true;
|
|
1739
|
-
this.
|
|
1645
|
+
this._viewportItems = data;
|
|
1740
1646
|
}
|
|
1741
|
-
get
|
|
1742
|
-
return this.
|
|
1647
|
+
get viewportItems() {
|
|
1648
|
+
return this._viewportItems;
|
|
1743
1649
|
}
|
|
1744
1650
|
constructor(gantt, ganttUpper, cdr, document) {
|
|
1745
1651
|
this.gantt = gantt;
|
|
@@ -1903,14 +1809,14 @@ class GanttTableBodyComponent {
|
|
|
1903
1809
|
this.destroy$.complete();
|
|
1904
1810
|
}
|
|
1905
1811
|
removeItem(item, children) {
|
|
1906
|
-
this.
|
|
1907
|
-
this.
|
|
1812
|
+
this.viewportItems.splice(this.viewportItems.indexOf(item), 1 + children.length);
|
|
1813
|
+
this.flatItems.splice(this.flatItems.indexOf(item), 1 + children.length);
|
|
1908
1814
|
}
|
|
1909
1815
|
insertItem(target, inserted, children, position) {
|
|
1910
1816
|
var _a;
|
|
1911
1817
|
if (position === 'before') {
|
|
1912
|
-
this.
|
|
1913
|
-
this.
|
|
1818
|
+
this.viewportItems.splice(this.viewportItems.indexOf(target), 0, inserted, ...children);
|
|
1819
|
+
this.flatItems.splice(this.flatItems.indexOf(target), 0, inserted, ...children);
|
|
1914
1820
|
}
|
|
1915
1821
|
else {
|
|
1916
1822
|
const dragRef = this.cdkDrags.find((drag) => drag.data === target);
|
|
@@ -1919,19 +1825,19 @@ class GanttTableBodyComponent {
|
|
|
1919
1825
|
if (target.expanded) {
|
|
1920
1826
|
childrenCount = ((_a = this.getChildrenElementsByElement(dragRef.element.nativeElement)) === null || _a === void 0 ? void 0 : _a.length) || 0;
|
|
1921
1827
|
}
|
|
1922
|
-
this.
|
|
1923
|
-
this.
|
|
1828
|
+
this.viewportItems.splice(this.viewportItems.indexOf(target) + 1 + childrenCount, 0, inserted, ...children);
|
|
1829
|
+
this.flatItems.splice(this.flatItems.indexOf(target) + 1 + childrenCount, 0, inserted, ...children);
|
|
1924
1830
|
}
|
|
1925
1831
|
}
|
|
1926
1832
|
insertChildrenItem(target, inserted, children) {
|
|
1927
1833
|
if (target.expanded) {
|
|
1928
|
-
this.
|
|
1929
|
-
this.
|
|
1834
|
+
this.viewportItems.splice(this.viewportItems.indexOf(target) + target.children.length + 1, 0, inserted, ...children);
|
|
1835
|
+
this.flatItems.splice(this.flatItems.indexOf(target) + target.children.length + 1, 0, inserted, ...children);
|
|
1930
1836
|
}
|
|
1931
1837
|
target.children.push(inserted);
|
|
1932
1838
|
}
|
|
1933
1839
|
getParentByItem(item) {
|
|
1934
|
-
return (this.
|
|
1840
|
+
return (this.flatItems || []).find((n) => {
|
|
1935
1841
|
var _a;
|
|
1936
1842
|
return (_a = n.children) === null || _a === void 0 ? void 0 : _a.includes(item);
|
|
1937
1843
|
});
|
|
@@ -1990,10 +1896,10 @@ class GanttTableBodyComponent {
|
|
|
1990
1896
|
}
|
|
1991
1897
|
}
|
|
1992
1898
|
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 });
|
|
1993
|
-
GanttTableBodyComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.4", type: GanttTableBodyComponent, selector: "gantt-table-body", inputs: {
|
|
1899
|
+
GanttTableBodyComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.4", type: GanttTableBodyComponent, selector: "gantt-table-body", inputs: { viewportItems: "viewportItems", flatItems: "flatItems", columns: "columns", groupTemplate: "groupTemplate", emptyTemplate: "emptyTemplate", rowBeforeTemplate: "rowBeforeTemplate", rowAfterTemplate: "rowAfterTemplate", draggable: "draggable", dropEnterPredicate: "dropEnterPredicate" }, outputs: { dragDropped: "dragDropped", dragStarted: "dragStarted", dragEnded: "dragEnded", itemClick: "itemClick" }, host: { properties: { "class.gantt-table-draggable": "this.draggable", "class.gantt-table-body": "this.ganttTableClass", "class.gantt-table-empty": "this.ganttTableEmptyClass", "class.gantt-table-dragging": "this.ganttTableDragging" } }, viewQueries: [{ propertyName: "cdkDrags", predicate: (CdkDrag), descendants: true }], ngImport: i0, template: "<div\n class=\"gantt-table-body-container\"\n cdkDropList\n [cdkDropListAutoScrollStep]=\"6\"\n [cdkDropListData]=\"viewportItems\"\n [cdkDropListSortingDisabled]=\"true\"\n (cdkDropListDropped)=\"onListDropped($event)\"\n>\n <ng-container *ngIf=\"!viewportItems?.length\">\n <ng-container *ngIf=\"!emptyTemplate\">\n <gantt-icon class=\"empty-icon\" iconName=\"empty\"></gantt-icon>\n <div class=\"empty-text\">\u6CA1\u6709\u6570\u636E</div>\n </ng-container>\n <ng-template [ngTemplateOutlet]=\"emptyTemplate\"></ng-template>\n </ng-container>\n\n <ng-container *ngIf=\"viewportItems && viewportItems.length > 0\">\n <ng-container *ngFor=\"let item of viewportItems; trackBy: trackBy\">\n <div class=\"gantt-table-group\" [ngClass]=\"item.class\" *ngIf=\"item.items\">\n <div class=\"gantt-table-group-title\" [class.expanded]=\"item.expanded\" (click)=\"expandGroup(item)\">\n <gantt-icon class=\"expand-icon\" [iconName]=\"item.expanded ? 'angle-down' : 'angle-right'\"></gantt-icon>\n <ng-container *ngIf=\"groupTemplate; else default\">\n <ng-template\n [ngTemplateOutlet]=\"groupTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: item.origin, group: item.origin }\"\n ></ng-template>\n </ng-container>\n <ng-template #default>\n <span class=\"group-title\">{{ item.title }}</span>\n </ng-template>\n </div>\n </div>\n\n <div\n *ngIf=\"!item.items\"\n (click)=\"itemClick.emit({ event: $event, selectedValue: item.origin })\"\n cdkDrag\n [cdkDragData]=\"item\"\n [cdkDragDisabled]=\"(draggable && item.itemDraggable === false) || !draggable\"\n (cdkDragStarted)=\"onItemDragStarted($event)\"\n (cdkDragEnded)=\"onItemDragEnded($event)\"\n (cdkDragMoved)=\"emitItemDragMoved($event)\"\n class=\"gantt-table-item\"\n [class.gantt-table-item-with-group]=\"hasGroup\"\n [class.gantt-table-item-first-level-group]=\"item.level === 0 && (item.type | isGanttRangeItem)\"\n [style.height.px]=\"gantt.styles.lineHeight\"\n [style.lineHeight.px]=\"gantt.styles.lineHeight\"\n [class.gantt-table-item-active]=\"ganttUpper.isSelected(item.id)\"\n >\n <ng-template\n [ngTemplateOutlet]=\"rowBeforeTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: item.origin, item: item.origin }\"\n ></ng-template>\n\n <div [classList]=\"column.classList\" *ngFor=\"let column of columns; let first = first\" [style.width]=\"column.columnWidth\">\n <!-- drag icon -->\n <gantt-icon\n *ngIf=\"first && draggable\"\n class=\"gantt-drag-handle\"\n iconName=\"drag\"\n cdkDragHandle\n [cdkDragHandleDisabled]=\"(draggable && item.itemDraggable === false) || !draggable\"\n ></gantt-icon>\n <!-- expand icon -->\n <div\n *ngIf=\"column?.showExpandIcon || (!hasExpandIcon && first)\"\n class=\"gantt-expand-icon\"\n [style.marginLeft.px]=\"item.level * 20\"\n >\n <ng-container *ngIf=\"item.level < gantt.maxLevel - 1 && ((gantt.async && item.expandable) || item.children?.length > 0)\">\n <gantt-icon\n *ngIf=\"!item.loading\"\n class=\"expand-icon\"\n [iconName]=\"item.expanded ? 'angle-down' : 'angle-right'\"\n (click)=\"expandChildren($event, item)\"\n >\n </gantt-icon>\n <gantt-icon *ngIf=\"item.loading\" [iconName]=\"'loading'\"></gantt-icon>\n </ng-container>\n </div>\n <!-- column content -->\n <div class=\"gantt-table-column-content\">\n <ng-template\n [ngTemplateOutlet]=\"column.templateRef\"\n [ngTemplateOutletContext]=\"{ $implicit: item.origin, item: item.origin }\"\n ></ng-template>\n </div>\n </div>\n <ng-template\n [ngTemplateOutlet]=\"rowAfterTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: item.origin, item: item.origin }\"\n ></ng-template>\n </div>\n </ng-container>\n </ng-container>\n</div>\n", dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i2.CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "directive", type: i2.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "directive", type: i2.CdkDragHandle, selector: "[cdkDragHandle]", inputs: ["cdkDragHandleDisabled"] }, { kind: "component", type: GanttIconComponent, selector: "gantt-icon", inputs: ["iconName"] }, { kind: "pipe", type: IsGanttRangeItemPipe, name: "isGanttRangeItem" }] });
|
|
1994
1900
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: GanttTableBodyComponent, decorators: [{
|
|
1995
1901
|
type: Component,
|
|
1996
|
-
args: [{ selector: 'gantt-table-body', template: "<div\n class=\"gantt-table-body-container\"\n cdkDropList\n [cdkDropListAutoScrollStep]=\"6\"\n [cdkDropListData]=\"
|
|
1902
|
+
args: [{ selector: 'gantt-table-body', template: "<div\n class=\"gantt-table-body-container\"\n cdkDropList\n [cdkDropListAutoScrollStep]=\"6\"\n [cdkDropListData]=\"viewportItems\"\n [cdkDropListSortingDisabled]=\"true\"\n (cdkDropListDropped)=\"onListDropped($event)\"\n>\n <ng-container *ngIf=\"!viewportItems?.length\">\n <ng-container *ngIf=\"!emptyTemplate\">\n <gantt-icon class=\"empty-icon\" iconName=\"empty\"></gantt-icon>\n <div class=\"empty-text\">\u6CA1\u6709\u6570\u636E</div>\n </ng-container>\n <ng-template [ngTemplateOutlet]=\"emptyTemplate\"></ng-template>\n </ng-container>\n\n <ng-container *ngIf=\"viewportItems && viewportItems.length > 0\">\n <ng-container *ngFor=\"let item of viewportItems; trackBy: trackBy\">\n <div class=\"gantt-table-group\" [ngClass]=\"item.class\" *ngIf=\"item.items\">\n <div class=\"gantt-table-group-title\" [class.expanded]=\"item.expanded\" (click)=\"expandGroup(item)\">\n <gantt-icon class=\"expand-icon\" [iconName]=\"item.expanded ? 'angle-down' : 'angle-right'\"></gantt-icon>\n <ng-container *ngIf=\"groupTemplate; else default\">\n <ng-template\n [ngTemplateOutlet]=\"groupTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: item.origin, group: item.origin }\"\n ></ng-template>\n </ng-container>\n <ng-template #default>\n <span class=\"group-title\">{{ item.title }}</span>\n </ng-template>\n </div>\n </div>\n\n <div\n *ngIf=\"!item.items\"\n (click)=\"itemClick.emit({ event: $event, selectedValue: item.origin })\"\n cdkDrag\n [cdkDragData]=\"item\"\n [cdkDragDisabled]=\"(draggable && item.itemDraggable === false) || !draggable\"\n (cdkDragStarted)=\"onItemDragStarted($event)\"\n (cdkDragEnded)=\"onItemDragEnded($event)\"\n (cdkDragMoved)=\"emitItemDragMoved($event)\"\n class=\"gantt-table-item\"\n [class.gantt-table-item-with-group]=\"hasGroup\"\n [class.gantt-table-item-first-level-group]=\"item.level === 0 && (item.type | isGanttRangeItem)\"\n [style.height.px]=\"gantt.styles.lineHeight\"\n [style.lineHeight.px]=\"gantt.styles.lineHeight\"\n [class.gantt-table-item-active]=\"ganttUpper.isSelected(item.id)\"\n >\n <ng-template\n [ngTemplateOutlet]=\"rowBeforeTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: item.origin, item: item.origin }\"\n ></ng-template>\n\n <div [classList]=\"column.classList\" *ngFor=\"let column of columns; let first = first\" [style.width]=\"column.columnWidth\">\n <!-- drag icon -->\n <gantt-icon\n *ngIf=\"first && draggable\"\n class=\"gantt-drag-handle\"\n iconName=\"drag\"\n cdkDragHandle\n [cdkDragHandleDisabled]=\"(draggable && item.itemDraggable === false) || !draggable\"\n ></gantt-icon>\n <!-- expand icon -->\n <div\n *ngIf=\"column?.showExpandIcon || (!hasExpandIcon && first)\"\n class=\"gantt-expand-icon\"\n [style.marginLeft.px]=\"item.level * 20\"\n >\n <ng-container *ngIf=\"item.level < gantt.maxLevel - 1 && ((gantt.async && item.expandable) || item.children?.length > 0)\">\n <gantt-icon\n *ngIf=\"!item.loading\"\n class=\"expand-icon\"\n [iconName]=\"item.expanded ? 'angle-down' : 'angle-right'\"\n (click)=\"expandChildren($event, item)\"\n >\n </gantt-icon>\n <gantt-icon *ngIf=\"item.loading\" [iconName]=\"'loading'\"></gantt-icon>\n </ng-container>\n </div>\n <!-- column content -->\n <div class=\"gantt-table-column-content\">\n <ng-template\n [ngTemplateOutlet]=\"column.templateRef\"\n [ngTemplateOutletContext]=\"{ $implicit: item.origin, item: item.origin }\"\n ></ng-template>\n </div>\n </div>\n <ng-template\n [ngTemplateOutlet]=\"rowAfterTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: item.origin, item: item.origin }\"\n ></ng-template>\n </div>\n </ng-container>\n </ng-container>\n</div>\n" }]
|
|
1997
1903
|
}], ctorParameters: function () {
|
|
1998
1904
|
return [{ type: undefined, decorators: [{
|
|
1999
1905
|
type: Inject,
|
|
@@ -2005,9 +1911,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImpor
|
|
|
2005
1911
|
type: Inject,
|
|
2006
1912
|
args: [DOCUMENT]
|
|
2007
1913
|
}] }];
|
|
2008
|
-
}, propDecorators: {
|
|
1914
|
+
}, propDecorators: { viewportItems: [{
|
|
2009
1915
|
type: Input
|
|
2010
|
-
}],
|
|
1916
|
+
}], flatItems: [{
|
|
2011
1917
|
type: Input
|
|
2012
1918
|
}], columns: [{
|
|
2013
1919
|
type: Input
|
|
@@ -2313,7 +2219,7 @@ class GanttLinksComponent {
|
|
|
2313
2219
|
this.ngZone = ngZone;
|
|
2314
2220
|
// @Input() groups: GanttGroupInternal[] = [];
|
|
2315
2221
|
// @Input() items: GanttItemInternal[] = [];
|
|
2316
|
-
this.
|
|
2222
|
+
this.flatItems = [];
|
|
2317
2223
|
this.lineClick = new EventEmitter();
|
|
2318
2224
|
this.links = [];
|
|
2319
2225
|
this.ganttLinkTypes = GanttLinkType;
|
|
@@ -2390,7 +2296,7 @@ class GanttLinksComponent {
|
|
|
2390
2296
|
// });
|
|
2391
2297
|
// });
|
|
2392
2298
|
// }
|
|
2393
|
-
this.
|
|
2299
|
+
this.flatItems.forEach((item, itemIndex) => {
|
|
2394
2300
|
if (!item.hasOwnProperty('items')) {
|
|
2395
2301
|
const ganttItem = item;
|
|
2396
2302
|
if (ganttItem.refs) {
|
|
@@ -2470,7 +2376,7 @@ class GanttLinksComponent {
|
|
|
2470
2376
|
}
|
|
2471
2377
|
}
|
|
2472
2378
|
GanttLinksComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: GanttLinksComponent, deps: [{ token: GANTT_UPPER_TOKEN }, { token: i0.ChangeDetectorRef }, { token: i0.ElementRef }, { token: GanttDragContainer }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
|
|
2473
|
-
GanttLinksComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.4", type: GanttLinksComponent, selector: "gantt-links-overlay", inputs: {
|
|
2379
|
+
GanttLinksComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.4", type: GanttLinksComponent, selector: "gantt-links-overlay", inputs: { flatItems: "flatItems" }, outputs: { lineClick: "lineClick" }, host: { properties: { "class.gantt-links-overlay": "this.ganttLinksOverlay" } }, usesOnChanges: true, ngImport: i0, template: "<svg [attr.width]=\"ganttUpper.view.width\" class=\"gantt-links-overlay-main\">\n <ng-container *ngFor=\"let link of links; let i = index; trackBy: trackBy\">\n <path\n [attr.d]=\"link.path\"\n fill=\"transparent\"\n stroke-width=\"2\"\n [attr.stroke]=\"link.color\"\n pointer-events=\"none\"\n [attr.style]=\"link.type === ganttLinkTypes.sf ? 'marker-start: url(#triangle' + i + ')' : 'marker-end: url(#triangle' + i + ')'\"\n ></path>\n\n <g>\n <path\n class=\"link-line\"\n (click)=\"onLineClick($event, link)\"\n [attr.d]=\"link.path\"\n (mouseenter)=\"mouseEnterPath(link, i)\"\n (mouseleave)=\"mouseLeavePath(link)\"\n stroke=\"transparent\"\n stroke-width=\"9\"\n fill=\"none\"\n cursor=\"pointer\"\n ></path>\n </g>\n <defs *ngIf=\"showArrow\">\n <marker\n *ngIf=\"link.type === ganttLinkTypes.sf; else markerEnd\"\n [id]=\"'triangle' + i\"\n markerUnits=\"strokeWidth\"\n markerWidth=\"5\"\n markerHeight=\"4\"\n refX=\"5\"\n refY=\"2\"\n orient=\"180\"\n >\n <path [attr.fill]=\"link.color\" [attr.stroke]=\"link.color\" d=\"M 0 0 L 5 2 L 0 4 z\" />\n </marker>\n\n <ng-template #markerEnd>\n <marker [id]=\"'triangle' + i\" markerUnits=\"strokeWidth\" markerWidth=\"5\" markerHeight=\"4\" refX=\"5\" refY=\"2\" orient=\"auto\">\n <path [attr.fill]=\"link.color\" [attr.stroke]=\"link.color\" d=\"M 0 0 L 5 2 L 0 4 z\" />\n </marker>\n </ng-template>\n </defs>\n </ng-container>\n <line class=\"link-dragging-line\"></line>\n</svg>\n", dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
2474
2380
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: GanttLinksComponent, decorators: [{
|
|
2475
2381
|
type: Component,
|
|
2476
2382
|
args: [{ selector: 'gantt-links-overlay', template: "<svg [attr.width]=\"ganttUpper.view.width\" class=\"gantt-links-overlay-main\">\n <ng-container *ngFor=\"let link of links; let i = index; trackBy: trackBy\">\n <path\n [attr.d]=\"link.path\"\n fill=\"transparent\"\n stroke-width=\"2\"\n [attr.stroke]=\"link.color\"\n pointer-events=\"none\"\n [attr.style]=\"link.type === ganttLinkTypes.sf ? 'marker-start: url(#triangle' + i + ')' : 'marker-end: url(#triangle' + i + ')'\"\n ></path>\n\n <g>\n <path\n class=\"link-line\"\n (click)=\"onLineClick($event, link)\"\n [attr.d]=\"link.path\"\n (mouseenter)=\"mouseEnterPath(link, i)\"\n (mouseleave)=\"mouseLeavePath(link)\"\n stroke=\"transparent\"\n stroke-width=\"9\"\n fill=\"none\"\n cursor=\"pointer\"\n ></path>\n </g>\n <defs *ngIf=\"showArrow\">\n <marker\n *ngIf=\"link.type === ganttLinkTypes.sf; else markerEnd\"\n [id]=\"'triangle' + i\"\n markerUnits=\"strokeWidth\"\n markerWidth=\"5\"\n markerHeight=\"4\"\n refX=\"5\"\n refY=\"2\"\n orient=\"180\"\n >\n <path [attr.fill]=\"link.color\" [attr.stroke]=\"link.color\" d=\"M 0 0 L 5 2 L 0 4 z\" />\n </marker>\n\n <ng-template #markerEnd>\n <marker [id]=\"'triangle' + i\" markerUnits=\"strokeWidth\" markerWidth=\"5\" markerHeight=\"4\" refX=\"5\" refY=\"2\" orient=\"auto\">\n <path [attr.fill]=\"link.color\" [attr.stroke]=\"link.color\" d=\"M 0 0 L 5 2 L 0 4 z\" />\n </marker>\n </ng-template>\n </defs>\n </ng-container>\n <line class=\"link-dragging-line\"></line>\n</svg>\n" }]
|
|
@@ -2479,7 +2385,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImpor
|
|
|
2479
2385
|
type: Inject,
|
|
2480
2386
|
args: [GANTT_UPPER_TOKEN]
|
|
2481
2387
|
}] }, { type: i0.ChangeDetectorRef }, { type: i0.ElementRef }, { type: GanttDragContainer }, { type: i0.NgZone }];
|
|
2482
|
-
}, propDecorators: {
|
|
2388
|
+
}, propDecorators: { flatItems: [{
|
|
2483
2389
|
type: Input
|
|
2484
2390
|
}], lineClick: [{
|
|
2485
2391
|
type: Output
|
|
@@ -2552,6 +2458,25 @@ function isPointerNearClientRect(rect, threshold, pointerX, pointerY) {
|
|
|
2552
2458
|
const yThreshold = height * threshold;
|
|
2553
2459
|
return pointerY > top - yThreshold && pointerY < bottom + yThreshold && pointerX > left - xThreshold && pointerX < right + xThreshold;
|
|
2554
2460
|
}
|
|
2461
|
+
/**
|
|
2462
|
+
* Gets the speed rate of auto scrolling
|
|
2463
|
+
* @param clientRect Dimensions of the node.
|
|
2464
|
+
* @param pointerX Position of the user's pointer along the x axis.
|
|
2465
|
+
* @param horizontalScrollDirection The direction in which the mouse is dragged horizontally
|
|
2466
|
+
*/
|
|
2467
|
+
function getAutoScrollSpeedRates(clientRect, pointerX, horizontalScrollDirection) {
|
|
2468
|
+
let autoScrollSpeedRates = 4;
|
|
2469
|
+
const speedLevels = 4;
|
|
2470
|
+
const { left, right, width } = clientRect;
|
|
2471
|
+
const xThreshold = width * SCROLL_PROXIMITY_THRESHOLD;
|
|
2472
|
+
if (horizontalScrollDirection === 1 /* AutoScrollHorizontalDirection.LEFT */) {
|
|
2473
|
+
autoScrollSpeedRates = Math.ceil((xThreshold - (pointerX > left ? pointerX - left : 0)) / (xThreshold / speedLevels));
|
|
2474
|
+
}
|
|
2475
|
+
if (horizontalScrollDirection === 2 /* AutoScrollHorizontalDirection.RIGHT */) {
|
|
2476
|
+
autoScrollSpeedRates = Math.ceil((xThreshold - (right > pointerX ? right - pointerX : 0)) / (xThreshold / speedLevels));
|
|
2477
|
+
}
|
|
2478
|
+
return autoScrollSpeedRates;
|
|
2479
|
+
}
|
|
2555
2480
|
|
|
2556
2481
|
const scrollThreshold = 50;
|
|
2557
2482
|
var ScrollDirection;
|
|
@@ -2601,6 +2526,7 @@ class GanttDomService {
|
|
|
2601
2526
|
this.container = this.root.getElementsByClassName('gantt-container')[0];
|
|
2602
2527
|
this.sideContainer = this.root.getElementsByClassName('gantt-side-container')[0];
|
|
2603
2528
|
this.mainContainer = this.root.getElementsByClassName('gantt-main-container')[0];
|
|
2529
|
+
this.verticalScrollContainer = this.root.getElementsByClassName('gantt-scroll-container')[0];
|
|
2604
2530
|
const mainItems = this.mainContainer.getElementsByClassName('gantt-main-items')[0];
|
|
2605
2531
|
const mainGroups = this.mainContainer.getElementsByClassName('gantt-main-groups')[0];
|
|
2606
2532
|
this.mainItems = mainItems || mainGroups;
|
|
@@ -2668,7 +2594,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImpor
|
|
|
2668
2594
|
*/
|
|
2669
2595
|
const DROP_PROXIMITY_THRESHOLD = 0.05;
|
|
2670
2596
|
const dragMinWidth = 10;
|
|
2671
|
-
const
|
|
2597
|
+
const autoScrollBaseStep = 2;
|
|
2672
2598
|
const activeClass = 'gantt-bar-active';
|
|
2673
2599
|
const dropActiveClass = 'gantt-bar-drop-active';
|
|
2674
2600
|
const singleDropActiveClass = 'gantt-bar-single-drop-active';
|
|
@@ -2684,6 +2610,12 @@ class GanttBarDrag {
|
|
|
2684
2610
|
get linkDragDisabled() {
|
|
2685
2611
|
return !this.item.linkable || !this.ganttUpper.linkable;
|
|
2686
2612
|
}
|
|
2613
|
+
get barHandleDragMoveAndScrollDistance() {
|
|
2614
|
+
return this.barHandleDragMoveDistance + this.dragScrollDistance;
|
|
2615
|
+
}
|
|
2616
|
+
get autoScrollStep() {
|
|
2617
|
+
return Math.pow(autoScrollBaseStep, this.autoScrollSpeedRates);
|
|
2618
|
+
}
|
|
2687
2619
|
constructor(dragDrop, dom, dragContainer, _ngZone) {
|
|
2688
2620
|
this.dragDrop = dragDrop;
|
|
2689
2621
|
this.dom = dom;
|
|
@@ -2703,13 +2635,15 @@ class GanttBarDrag {
|
|
|
2703
2635
|
this.dragScrollDistance = 0;
|
|
2704
2636
|
/** Horizontal direction in which the list is currently scrolling. */
|
|
2705
2637
|
this._horizontalScrollDirection = 0 /* AutoScrollHorizontalDirection.NONE */;
|
|
2638
|
+
/** Speed ratio for auto scroll */
|
|
2639
|
+
this.autoScrollSpeedRates = 1;
|
|
2706
2640
|
this.startScrollInterval = () => {
|
|
2707
2641
|
this.stopScrolling();
|
|
2708
2642
|
interval(0, animationFrameScheduler)
|
|
2709
2643
|
.pipe(takeUntil(this.stopScrollTimers$))
|
|
2710
2644
|
.subscribe(() => {
|
|
2711
2645
|
const node = this.dom.mainContainer;
|
|
2712
|
-
const scrollStep = autoScrollStep;
|
|
2646
|
+
const scrollStep = this.autoScrollStep;
|
|
2713
2647
|
if (this._horizontalScrollDirection === 1 /* AutoScrollHorizontalDirection.LEFT */) {
|
|
2714
2648
|
node.scrollBy(-scrollStep, 0);
|
|
2715
2649
|
}
|
|
@@ -2818,16 +2752,32 @@ class GanttBarDrag {
|
|
|
2818
2752
|
const dragScrollDistance = this.dom.mainContainer.scrollLeft - this.containerScrollLeft;
|
|
2819
2753
|
this.dragScrollDistance = dragScrollDistance;
|
|
2820
2754
|
dragRef['_boundaryRect'] = this.dom.mainItems.getBoundingClientRect();
|
|
2821
|
-
this.
|
|
2755
|
+
if (this.dragScrolling && this.isStartGreaterThanEndWhenBarHandleDragMove(isBefore)) {
|
|
2756
|
+
this.stopScrolling();
|
|
2757
|
+
this.dragScrolling = false;
|
|
2758
|
+
}
|
|
2759
|
+
if (isBefore) {
|
|
2760
|
+
this.barBeforeHandleDragMove();
|
|
2761
|
+
}
|
|
2762
|
+
else {
|
|
2763
|
+
this.barAfterHandleDragMove();
|
|
2764
|
+
}
|
|
2822
2765
|
}
|
|
2823
2766
|
});
|
|
2824
2767
|
this.dragContainer.dragStarted.emit({ item: this.item.origin });
|
|
2825
2768
|
});
|
|
2826
2769
|
dragRef.moved.subscribe((event) => {
|
|
2827
|
-
this.
|
|
2770
|
+
if (this.barHandleDragMoveRecordDays && this.barHandleDragMoveRecordDays > 0) {
|
|
2771
|
+
this.startScrollingIfNecessary(event.pointerPosition.x, event.pointerPosition.y);
|
|
2772
|
+
}
|
|
2828
2773
|
this.barHandleDragMoveDistance = event.distance.x;
|
|
2829
2774
|
if (!this.dragScrolling) {
|
|
2830
|
-
|
|
2775
|
+
if (isBefore) {
|
|
2776
|
+
this.barBeforeHandleDragMove();
|
|
2777
|
+
}
|
|
2778
|
+
else {
|
|
2779
|
+
this.barAfterHandleDragMove();
|
|
2780
|
+
}
|
|
2831
2781
|
}
|
|
2832
2782
|
});
|
|
2833
2783
|
dragRef.ended.subscribe((event) => {
|
|
@@ -2907,10 +2857,10 @@ class GanttBarDrag {
|
|
|
2907
2857
|
let left = dragRect.left - rootRect.left - (this.dom.side.clientWidth + 1);
|
|
2908
2858
|
if (this.dragScrolling) {
|
|
2909
2859
|
if (this._horizontalScrollDirection === 1 /* AutoScrollHorizontalDirection.LEFT */) {
|
|
2910
|
-
left += autoScrollStep;
|
|
2860
|
+
left += this.autoScrollStep;
|
|
2911
2861
|
}
|
|
2912
2862
|
else if (this._horizontalScrollDirection === 2 /* AutoScrollHorizontalDirection.RIGHT */) {
|
|
2913
|
-
left -= autoScrollStep;
|
|
2863
|
+
left -= this.autoScrollStep;
|
|
2914
2864
|
}
|
|
2915
2865
|
}
|
|
2916
2866
|
const width = dragRect.right - dragRect.left;
|
|
@@ -2960,44 +2910,51 @@ class GanttBarDrag {
|
|
|
2960
2910
|
this.item.updateDate(start, end);
|
|
2961
2911
|
this.dragContainer.dragMoved.emit({ item: this.item.origin });
|
|
2962
2912
|
}
|
|
2963
|
-
|
|
2964
|
-
const
|
|
2965
|
-
|
|
2966
|
-
|
|
2967
|
-
|
|
2968
|
-
|
|
2969
|
-
|
|
2970
|
-
|
|
2971
|
-
|
|
2913
|
+
barBeforeHandleDragMove() {
|
|
2914
|
+
const { x, start, oneDayWidth } = this.startOfBarHandle();
|
|
2915
|
+
const width = this.item.refs.width + this.barHandleDragMoveAndScrollDistance * -1;
|
|
2916
|
+
const days = differenceInDays(this.item.end.value, start.value);
|
|
2917
|
+
if (width > dragMinWidth && days > 0) {
|
|
2918
|
+
this.barElement.style.width = width + 'px';
|
|
2919
|
+
this.barElement.style.left = x + 'px';
|
|
2920
|
+
this.openDragBackdrop(this.barElement, start, this.item.end);
|
|
2921
|
+
if (!this.isStartOrEndInsideView(start, this.item.end)) {
|
|
2922
|
+
return;
|
|
2923
|
+
}
|
|
2924
|
+
this.item.updateDate(start, this.item.end);
|
|
2925
|
+
}
|
|
2926
|
+
else {
|
|
2927
|
+
if (this.barHandleDragMoveRecordDays > 0 && days <= 0) {
|
|
2928
|
+
this.barElement.style.width = oneDayWidth + 'px';
|
|
2929
|
+
const x = this.ganttUpper.view.getXPointByDate(this.item.end);
|
|
2972
2930
|
this.barElement.style.left = x + 'px';
|
|
2973
|
-
this.openDragBackdrop(this.barElement, start, this.item.end);
|
|
2974
|
-
if (!this.isStartOrEndInsideView(start, this.item.end)) {
|
|
2975
|
-
return;
|
|
2976
|
-
}
|
|
2977
|
-
this.item.updateDate(start, this.item.end);
|
|
2978
2931
|
}
|
|
2979
|
-
|
|
2980
|
-
|
|
2981
|
-
|
|
2932
|
+
this.openDragBackdrop(this.barElement, this.item.end.startOfDay(), this.item.end);
|
|
2933
|
+
this.item.updateDate(this.item.end.startOfDay(), this.item.end);
|
|
2934
|
+
}
|
|
2935
|
+
this.barHandleDragMoveRecordDays = days;
|
|
2936
|
+
this.dragContainer.dragMoved.emit({ item: this.item.origin });
|
|
2937
|
+
}
|
|
2938
|
+
barAfterHandleDragMove() {
|
|
2939
|
+
const { width, end } = this.endOfBarHandle();
|
|
2940
|
+
const days = differenceInDays(end.value, this.item.start.value);
|
|
2941
|
+
if (width > dragMinWidth && days > 0) {
|
|
2942
|
+
this.barElement.style.width = width + 'px';
|
|
2943
|
+
this.openDragBackdrop(this.barElement, this.item.start, end);
|
|
2944
|
+
if (!this.isStartOrEndInsideView(this.item.start, end)) {
|
|
2945
|
+
return;
|
|
2982
2946
|
}
|
|
2947
|
+
this.item.updateDate(this.item.start, end);
|
|
2983
2948
|
}
|
|
2984
2949
|
else {
|
|
2985
|
-
|
|
2986
|
-
|
|
2987
|
-
|
|
2988
|
-
if (width > dragMinWidth && days > 0) {
|
|
2989
|
-
this.barElement.style.width = width + 'px';
|
|
2990
|
-
this.openDragBackdrop(this.barElement, this.item.start, end);
|
|
2991
|
-
if (!this.isStartOrEndInsideView(this.item.start, end)) {
|
|
2992
|
-
return;
|
|
2993
|
-
}
|
|
2994
|
-
this.item.updateDate(this.item.start, end);
|
|
2995
|
-
}
|
|
2996
|
-
else {
|
|
2997
|
-
this.openDragBackdrop(this.barElement, this.item.start, this.item.start.endOfDay());
|
|
2998
|
-
this.item.updateDate(this.item.start, this.item.start.endOfDay());
|
|
2950
|
+
if (this.barHandleDragMoveRecordDays > 0 && days <= 0) {
|
|
2951
|
+
const oneDayWidth = this.ganttUpper.view.getDateRangeWidth(this.item.start, this.item.start.endOfDay());
|
|
2952
|
+
this.barElement.style.width = oneDayWidth + 'px';
|
|
2999
2953
|
}
|
|
2954
|
+
this.openDragBackdrop(this.barElement, this.item.start, this.item.start.endOfDay());
|
|
2955
|
+
this.item.updateDate(this.item.start, this.item.start.endOfDay());
|
|
3000
2956
|
}
|
|
2957
|
+
this.barHandleDragMoveRecordDays = days;
|
|
3001
2958
|
this.dragContainer.dragMoved.emit({ item: this.item.origin });
|
|
3002
2959
|
}
|
|
3003
2960
|
calcLinkLinePositions(target, isBefore) {
|
|
@@ -3036,6 +2993,7 @@ class GanttBarDrag {
|
|
|
3036
2993
|
(horizontalScrollDirection === 2 /* AutoScrollHorizontalDirection.RIGHT */ &&
|
|
3037
2994
|
scrollLeft < this.ganttUpper.view.width - clientRect.width)) {
|
|
3038
2995
|
this._horizontalScrollDirection = horizontalScrollDirection;
|
|
2996
|
+
this.autoScrollSpeedRates = getAutoScrollSpeedRates(clientRect, pointerX, horizontalScrollDirection);
|
|
3039
2997
|
this.dragScrolling = true;
|
|
3040
2998
|
this._ngZone.runOutsideAngular(this.startScrollInterval);
|
|
3041
2999
|
}
|
|
@@ -3045,6 +3003,44 @@ class GanttBarDrag {
|
|
|
3045
3003
|
}
|
|
3046
3004
|
}
|
|
3047
3005
|
}
|
|
3006
|
+
// Conditions to stop auto-scroll: when the start is greater than the end and the bar appears in the view
|
|
3007
|
+
isStartGreaterThanEndWhenBarHandleDragMove(isBefore) {
|
|
3008
|
+
let isStartGreaterThanEnd;
|
|
3009
|
+
let isBarAppearsInView;
|
|
3010
|
+
const scrollLeft = this.dom.mainContainer.scrollLeft;
|
|
3011
|
+
const clientWidth = this.dom.mainContainer.clientWidth;
|
|
3012
|
+
const xThreshold = clientWidth * DROP_PROXIMITY_THRESHOLD;
|
|
3013
|
+
if (isBefore) {
|
|
3014
|
+
const { start, oneDayWidth } = this.startOfBarHandle();
|
|
3015
|
+
const xPointerByEndDate = this.ganttUpper.view.getXPointByDate(this.item.end);
|
|
3016
|
+
isStartGreaterThanEnd = start.value > this.item.end.value;
|
|
3017
|
+
isBarAppearsInView = xPointerByEndDate + oneDayWidth + xThreshold <= scrollLeft + clientWidth;
|
|
3018
|
+
}
|
|
3019
|
+
else {
|
|
3020
|
+
const { end } = this.endOfBarHandle();
|
|
3021
|
+
const xPointerByStartDate = this.ganttUpper.view.getXPointByDate(this.item.start);
|
|
3022
|
+
isStartGreaterThanEnd = end.value < this.item.start.value;
|
|
3023
|
+
isBarAppearsInView = scrollLeft + xThreshold <= xPointerByStartDate;
|
|
3024
|
+
}
|
|
3025
|
+
return isStartGreaterThanEnd && isBarAppearsInView ? true : false;
|
|
3026
|
+
}
|
|
3027
|
+
// Some data information about dragging start until it is equal to or greater than end
|
|
3028
|
+
startOfBarHandle() {
|
|
3029
|
+
const x = this.item.refs.x + this.barHandleDragMoveAndScrollDistance;
|
|
3030
|
+
return {
|
|
3031
|
+
x,
|
|
3032
|
+
start: this.ganttUpper.view.getDateByXPoint(x),
|
|
3033
|
+
oneDayWidth: this.ganttUpper.view.getDateRangeWidth(this.item.end.startOfDay(), this.item.end)
|
|
3034
|
+
};
|
|
3035
|
+
}
|
|
3036
|
+
// Some data information about dragging end of bar handle
|
|
3037
|
+
endOfBarHandle() {
|
|
3038
|
+
const width = this.item.refs.width + this.barHandleDragMoveAndScrollDistance;
|
|
3039
|
+
return {
|
|
3040
|
+
width,
|
|
3041
|
+
end: this.ganttUpper.view.getDateByXPoint(this.item.refs.x + width)
|
|
3042
|
+
};
|
|
3043
|
+
}
|
|
3048
3044
|
stopScrolling() {
|
|
3049
3045
|
this.stopScrollTimers$.next();
|
|
3050
3046
|
}
|
|
@@ -3180,12 +3176,14 @@ class NgxGanttBarComponent extends GanttItemUpper {
|
|
|
3180
3176
|
});
|
|
3181
3177
|
}
|
|
3182
3178
|
ngOnChanges(changes) {
|
|
3183
|
-
var _a, _b;
|
|
3179
|
+
var _a, _b, _c, _d, _e, _f;
|
|
3184
3180
|
super.ngOnChanges(changes);
|
|
3185
3181
|
if (!this.firstChange) {
|
|
3186
3182
|
this.drag.updateItem(this.item);
|
|
3187
3183
|
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) ||
|
|
3188
|
-
changes.item.currentValue.color !== changes.item.previousValue.color
|
|
3184
|
+
changes.item.currentValue.color !== changes.item.previousValue.color ||
|
|
3185
|
+
((_c = changes.item.currentValue.start) === null || _c === void 0 ? void 0 : _c.value) !== ((_d = changes.item.previousValue.start) === null || _d === void 0 ? void 0 : _d.value) ||
|
|
3186
|
+
((_e = changes.item.currentValue.end) === null || _e === void 0 ? void 0 : _e.value) !== ((_f = changes.item.previousValue.end) === null || _f === void 0 ? void 0 : _f.value)) {
|
|
3189
3187
|
this.setContentBackground();
|
|
3190
3188
|
}
|
|
3191
3189
|
}
|
|
@@ -3341,18 +3339,18 @@ class GanttMainComponent {
|
|
|
3341
3339
|
}
|
|
3342
3340
|
}
|
|
3343
3341
|
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 });
|
|
3344
|
-
GanttMainComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.4", type: GanttMainComponent, selector: "gantt-main", inputs: {
|
|
3342
|
+
GanttMainComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.4", type: GanttMainComponent, selector: "gantt-main", inputs: { viewportItems: "viewportItems", flatItems: "flatItems", groupHeaderTemplate: "groupHeaderTemplate", itemTemplate: "itemTemplate", barTemplate: "barTemplate", rangeTemplate: "rangeTemplate" }, outputs: { barClick: "barClick", lineClick: "lineClick" }, host: { properties: { "class.gantt-main-container": "this.ganttMainClass" } }, ngImport: i0, template: "<gantt-links-overlay [flatItems]=\"flatItems\" (lineClick)=\"lineClick.emit($event)\"></gantt-links-overlay>\n<div class=\"gantt-main-groups\" [style.width.px]=\"ganttUpper.view.width\">\n <ng-container *ngFor=\"let data of viewportItems; trackBy: trackBy\">\n <div class=\"gantt-group\" [ngClass]=\"data.class\" *ngIf=\"data.items\">\n <ng-template [ngTemplateOutlet]=\"groupHeaderTemplate\" [ngTemplateOutletContext]=\"{ group: data }\"></ng-template>\n </div>\n <div\n *ngIf=\"!data.items\"\n class=\"gantt-item\"\n [style.height.px]=\"ganttUpper.styles.lineHeight\"\n [class.gantt-main-item-active]=\"ganttUpper.isSelected(data.id)\"\n >\n <ng-container *ngIf=\"data.type | isGanttCustomItem\">\n <ng-template\n [ngTemplateOutlet]=\"itemTemplate\"\n [ngTemplateOutletContext]=\"{\n item: data.origin,\n refs: data.refs,\n baseline: ganttUpper.baselineItemsMap[data.id]?.origin,\n baselineRefs: ganttUpper.baselineItemsMap[data.id]?.refs\n }\"\n >\n </ng-template>\n </ng-container>\n\n <ng-container *ngIf=\"(data.type | isGanttRangeItem) || (data.type | isGanttBarItem)\">\n <gantt-range *ngIf=\"data.type | isGanttRangeItem\" [template]=\"rangeTemplate\" [item]=\"data\"></gantt-range>\n <gantt-bar *ngIf=\"data.type | isGanttBarItem\" [item]=\"data\" [template]=\"barTemplate\" (barClick)=\"barClick.emit($event)\"></gantt-bar>\n <gantt-baseline *ngIf=\"ganttUpper.baselineItemsMap[data.id]\" [baselineItem]=\"ganttUpper.baselineItemsMap[data.id]\"></gantt-baseline>\n </ng-container>\n </div>\n </ng-container>\n</div>\n", dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: GanttLinksComponent, selector: "gantt-links-overlay", inputs: ["flatItems"], outputs: ["lineClick"] }, { kind: "component", type: NgxGanttBarComponent, selector: "ngx-gantt-bar,gantt-bar", outputs: ["barClick"] }, { kind: "component", type: NgxGanttRangeComponent, selector: "ngx-gantt-range,gantt-range" }, { kind: "component", type: NgxGanttBaselineComponent, selector: "ngx-gantt-baseline,gantt-baseline", inputs: ["baselineItem"] }, { kind: "pipe", type: IsGanttRangeItemPipe, name: "isGanttRangeItem" }, { kind: "pipe", type: IsGanttBarItemPipe, name: "isGanttBarItem" }, { kind: "pipe", type: IsGanttCustomItemPipe, name: "isGanttCustomItem" }] });
|
|
3345
3343
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: GanttMainComponent, decorators: [{
|
|
3346
3344
|
type: Component,
|
|
3347
|
-
args: [{ selector: 'gantt-main', template: "
|
|
3345
|
+
args: [{ selector: 'gantt-main', template: "<gantt-links-overlay [flatItems]=\"flatItems\" (lineClick)=\"lineClick.emit($event)\"></gantt-links-overlay>\n<div class=\"gantt-main-groups\" [style.width.px]=\"ganttUpper.view.width\">\n <ng-container *ngFor=\"let data of viewportItems; trackBy: trackBy\">\n <div class=\"gantt-group\" [ngClass]=\"data.class\" *ngIf=\"data.items\">\n <ng-template [ngTemplateOutlet]=\"groupHeaderTemplate\" [ngTemplateOutletContext]=\"{ group: data }\"></ng-template>\n </div>\n <div\n *ngIf=\"!data.items\"\n class=\"gantt-item\"\n [style.height.px]=\"ganttUpper.styles.lineHeight\"\n [class.gantt-main-item-active]=\"ganttUpper.isSelected(data.id)\"\n >\n <ng-container *ngIf=\"data.type | isGanttCustomItem\">\n <ng-template\n [ngTemplateOutlet]=\"itemTemplate\"\n [ngTemplateOutletContext]=\"{\n item: data.origin,\n refs: data.refs,\n baseline: ganttUpper.baselineItemsMap[data.id]?.origin,\n baselineRefs: ganttUpper.baselineItemsMap[data.id]?.refs\n }\"\n >\n </ng-template>\n </ng-container>\n\n <ng-container *ngIf=\"(data.type | isGanttRangeItem) || (data.type | isGanttBarItem)\">\n <gantt-range *ngIf=\"data.type | isGanttRangeItem\" [template]=\"rangeTemplate\" [item]=\"data\"></gantt-range>\n <gantt-bar *ngIf=\"data.type | isGanttBarItem\" [item]=\"data\" [template]=\"barTemplate\" (barClick)=\"barClick.emit($event)\"></gantt-bar>\n <gantt-baseline *ngIf=\"ganttUpper.baselineItemsMap[data.id]\" [baselineItem]=\"ganttUpper.baselineItemsMap[data.id]\"></gantt-baseline>\n </ng-container>\n </div>\n </ng-container>\n</div>\n" }]
|
|
3348
3346
|
}], ctorParameters: function () {
|
|
3349
3347
|
return [{ type: GanttUpper, decorators: [{
|
|
3350
3348
|
type: Inject,
|
|
3351
3349
|
args: [GANTT_UPPER_TOKEN]
|
|
3352
3350
|
}] }];
|
|
3353
|
-
}, propDecorators: {
|
|
3351
|
+
}, propDecorators: { viewportItems: [{
|
|
3354
3352
|
type: Input
|
|
3355
|
-
}],
|
|
3353
|
+
}], flatItems: [{
|
|
3356
3354
|
type: Input
|
|
3357
3355
|
}], groupHeaderTemplate: [{
|
|
3358
3356
|
type: Input
|
|
@@ -3530,6 +3528,100 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImpor
|
|
|
3530
3528
|
}, 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" }]
|
|
3531
3529
|
}] });
|
|
3532
3530
|
|
|
3531
|
+
class GanttPrintService {
|
|
3532
|
+
constructor() { }
|
|
3533
|
+
setInlineStyles(targetElem) {
|
|
3534
|
+
const svgElements = Array.from(targetElem.getElementsByTagName('svg'));
|
|
3535
|
+
for (const svgElement of svgElements) {
|
|
3536
|
+
this.recursElementChildren(svgElement);
|
|
3537
|
+
}
|
|
3538
|
+
}
|
|
3539
|
+
recursElementChildren(node) {
|
|
3540
|
+
const transformProperties = [
|
|
3541
|
+
'fill',
|
|
3542
|
+
'color',
|
|
3543
|
+
'font-size',
|
|
3544
|
+
'stroke',
|
|
3545
|
+
'font',
|
|
3546
|
+
'text-anchor',
|
|
3547
|
+
'stroke-dasharray',
|
|
3548
|
+
'shape-rendering',
|
|
3549
|
+
'stroke-width'
|
|
3550
|
+
];
|
|
3551
|
+
if (!node.style) {
|
|
3552
|
+
return;
|
|
3553
|
+
}
|
|
3554
|
+
const styles = getComputedStyle(node);
|
|
3555
|
+
for (const transformProperty of transformProperties) {
|
|
3556
|
+
node.style[transformProperty] = styles[transformProperty];
|
|
3557
|
+
}
|
|
3558
|
+
for (const child of Array.from(node.childNodes)) {
|
|
3559
|
+
this.recursElementChildren(child);
|
|
3560
|
+
}
|
|
3561
|
+
}
|
|
3562
|
+
register(root) {
|
|
3563
|
+
this.root = root.nativeElement;
|
|
3564
|
+
this.mainContainer = this.root.getElementsByClassName('gantt-main-container')[0];
|
|
3565
|
+
}
|
|
3566
|
+
print(name = 'download', ignoreElementClass) {
|
|
3567
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
3568
|
+
const root = this.root;
|
|
3569
|
+
const mainContainer = this.mainContainer;
|
|
3570
|
+
// set print width
|
|
3571
|
+
const printWidth = root.offsetWidth;
|
|
3572
|
+
// set print height
|
|
3573
|
+
const printHeight = root.offsetHeight - mainContainer.offsetHeight + mainContainer.scrollHeight;
|
|
3574
|
+
const html2canvas = (yield import(/* webpackChunkName: 'html2canvas' */ 'html2canvas')).default;
|
|
3575
|
+
html2canvas(root, {
|
|
3576
|
+
logging: false,
|
|
3577
|
+
allowTaint: true,
|
|
3578
|
+
useCORS: true,
|
|
3579
|
+
width: printWidth,
|
|
3580
|
+
height: printHeight,
|
|
3581
|
+
ignoreElements: (element) => {
|
|
3582
|
+
if (ignoreElementClass && element.classList.contains(ignoreElementClass)) {
|
|
3583
|
+
return true;
|
|
3584
|
+
}
|
|
3585
|
+
if (element.classList.contains('gantt-calendar-today-overlay')) {
|
|
3586
|
+
return true;
|
|
3587
|
+
}
|
|
3588
|
+
},
|
|
3589
|
+
onclone: (cloneDocument) => {
|
|
3590
|
+
const ganttClass = root.className;
|
|
3591
|
+
const cloneGanttDom = cloneDocument.querySelector(`.${ganttClass.replace(/\s+/g, '.')}`);
|
|
3592
|
+
const cloneGanttContainerDom = cloneDocument.querySelector('.gantt-container');
|
|
3593
|
+
const cloneCalendarOverlay = cloneDocument.querySelector('.gantt-calendar-grid-main');
|
|
3594
|
+
const cloneLinksOverlay = cloneDocument.querySelector('.gantt-links-overlay-main');
|
|
3595
|
+
// change targetDom width
|
|
3596
|
+
cloneGanttDom.style.width = `${printWidth}px`;
|
|
3597
|
+
cloneGanttDom.style.height = `${printHeight}px`;
|
|
3598
|
+
cloneGanttDom.style.overflow = `unset`;
|
|
3599
|
+
cloneGanttContainerDom.style.backgroundColor = '#fff';
|
|
3600
|
+
cloneCalendarOverlay.setAttribute('height', `${printHeight}`);
|
|
3601
|
+
cloneCalendarOverlay.setAttribute('style', `background: transparent`);
|
|
3602
|
+
if (cloneLinksOverlay) {
|
|
3603
|
+
cloneLinksOverlay.setAttribute('height', `${printHeight}`);
|
|
3604
|
+
cloneLinksOverlay.setAttribute('style', `height: ${printHeight}px`);
|
|
3605
|
+
}
|
|
3606
|
+
// setInlineStyles for svg
|
|
3607
|
+
this.setInlineStyles(cloneGanttDom);
|
|
3608
|
+
}
|
|
3609
|
+
}).then((canvas) => {
|
|
3610
|
+
const link = document.createElement('a');
|
|
3611
|
+
const dataUrl = canvas.toDataURL('image/png');
|
|
3612
|
+
link.download = `${name}.png`;
|
|
3613
|
+
link.href = dataUrl;
|
|
3614
|
+
link.click();
|
|
3615
|
+
});
|
|
3616
|
+
});
|
|
3617
|
+
}
|
|
3618
|
+
}
|
|
3619
|
+
GanttPrintService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: GanttPrintService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
3620
|
+
GanttPrintService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: GanttPrintService });
|
|
3621
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: GanttPrintService, decorators: [{
|
|
3622
|
+
type: Injectable
|
|
3623
|
+
}], ctorParameters: function () { return []; } });
|
|
3624
|
+
|
|
3533
3625
|
class NgxGanttToolbarComponent {
|
|
3534
3626
|
constructor(ganttUpper) {
|
|
3535
3627
|
this.ganttUpper = ganttUpper;
|
|
@@ -3561,6 +3653,9 @@ class NgxGanttRootComponent {
|
|
|
3561
3653
|
get view() {
|
|
3562
3654
|
return this.ganttUpper.view;
|
|
3563
3655
|
}
|
|
3656
|
+
onWindowResize() {
|
|
3657
|
+
this.computeScrollBarOffset();
|
|
3658
|
+
}
|
|
3564
3659
|
constructor(elementRef, ngZone, dom, dragContainer, ganttUpper, printService) {
|
|
3565
3660
|
this.elementRef = elementRef;
|
|
3566
3661
|
this.ngZone = ngZone;
|
|
@@ -3568,6 +3663,8 @@ class NgxGanttRootComponent {
|
|
|
3568
3663
|
this.dragContainer = dragContainer;
|
|
3569
3664
|
this.ganttUpper = ganttUpper;
|
|
3570
3665
|
this.printService = printService;
|
|
3666
|
+
this.verticalScrollbarWidth = 0;
|
|
3667
|
+
this.horizontalScrollbarHeight = 0;
|
|
3571
3668
|
this.unsubscribe$ = new Subject();
|
|
3572
3669
|
this.ganttUpper.dragContainer = dragContainer;
|
|
3573
3670
|
}
|
|
@@ -3591,9 +3688,24 @@ class NgxGanttRootComponent {
|
|
|
3591
3688
|
this.ganttUpper.viewChange.pipe(startWith$1(null), takeUntil(this.unsubscribe$)).subscribe(() => {
|
|
3592
3689
|
this.scrollToToday();
|
|
3593
3690
|
});
|
|
3691
|
+
this.computeScrollBarOffset();
|
|
3594
3692
|
});
|
|
3595
3693
|
});
|
|
3596
3694
|
}
|
|
3695
|
+
computeScrollBarOffset() {
|
|
3696
|
+
const ganttMainContainer = this.dom.mainContainer;
|
|
3697
|
+
const ganttVerticalScrollContainer = this.dom.verticalScrollContainer;
|
|
3698
|
+
let verticalScrollbarWidth = 0;
|
|
3699
|
+
if (ganttVerticalScrollContainer) {
|
|
3700
|
+
verticalScrollbarWidth = ganttVerticalScrollContainer.offsetWidth - ganttVerticalScrollContainer.clientWidth;
|
|
3701
|
+
}
|
|
3702
|
+
else {
|
|
3703
|
+
verticalScrollbarWidth = (ganttMainContainer === null || ganttMainContainer === void 0 ? void 0 : ganttMainContainer.offsetWidth) - (ganttMainContainer === null || ganttMainContainer === void 0 ? void 0 : ganttMainContainer.clientWidth);
|
|
3704
|
+
}
|
|
3705
|
+
const horizontalScrollbarHeight = (ganttMainContainer === null || ganttMainContainer === void 0 ? void 0 : ganttMainContainer.offsetHeight) - (ganttMainContainer === null || ganttMainContainer === void 0 ? void 0 : ganttMainContainer.clientHeight);
|
|
3706
|
+
this.verticalScrollbarWidth = verticalScrollbarWidth;
|
|
3707
|
+
this.horizontalScrollbarHeight = horizontalScrollbarHeight;
|
|
3708
|
+
}
|
|
3597
3709
|
ngOnDestroy() {
|
|
3598
3710
|
this.unsubscribe$.next();
|
|
3599
3711
|
}
|
|
@@ -3657,12 +3769,12 @@ class NgxGanttRootComponent {
|
|
|
3657
3769
|
}
|
|
3658
3770
|
}
|
|
3659
3771
|
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 });
|
|
3660
|
-
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:
|
|
3772
|
+
NgxGanttRootComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.4", type: NgxGanttRootComponent, selector: "ngx-gantt-root", inputs: { sideWidth: "sideWidth" }, host: { listeners: { "window:resize": "onWindowResize()" }, 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\" [style.padding-bottom.px]=\"horizontalScrollbarHeight\">\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 [style.padding-right.px]=\"verticalScrollbarWidth\"></gantt-calendar-header>\n <gantt-calendar-grid\n [style.padding-right.px]=\"verticalScrollbarWidth\"\n [style.padding-bottom.px]=\"horizontalScrollbarHeight\"\n ></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: i1$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"] }] });
|
|
3661
3773
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: NgxGanttRootComponent, decorators: [{
|
|
3662
3774
|
type: Component,
|
|
3663
3775
|
args: [{ selector: 'ngx-gantt-root', providers: [GanttDomService, GanttDragContainer], host: {
|
|
3664
3776
|
class: 'gantt'
|
|
3665
|
-
}, 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" }]
|
|
3777
|
+
}, template: "<div class=\"gantt-side\" *ngIf=\"sideTemplate\" [style.width.px]=\"sideWidth\" [style.padding-bottom.px]=\"horizontalScrollbarHeight\">\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 [style.padding-right.px]=\"verticalScrollbarWidth\"></gantt-calendar-header>\n <gantt-calendar-grid\n [style.padding-right.px]=\"verticalScrollbarWidth\"\n [style.padding-bottom.px]=\"horizontalScrollbarHeight\"\n ></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" }]
|
|
3666
3778
|
}], ctorParameters: function () {
|
|
3667
3779
|
return [{ type: i0.ElementRef }, { type: i0.NgZone }, { type: GanttDomService }, { type: GanttDragContainer }, { type: GanttUpper, decorators: [{
|
|
3668
3780
|
type: Inject,
|
|
@@ -3681,6 +3793,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImpor
|
|
|
3681
3793
|
}], backdrop: [{
|
|
3682
3794
|
type: ViewChild,
|
|
3683
3795
|
args: [GanttDragBackdropComponent, { static: true, read: ElementRef }]
|
|
3796
|
+
}], onWindowResize: [{
|
|
3797
|
+
type: HostListener,
|
|
3798
|
+
args: ['window:resize']
|
|
3684
3799
|
}] } });
|
|
3685
3800
|
|
|
3686
3801
|
class NgxGanttComponent extends GanttUpper {
|
|
@@ -3704,23 +3819,24 @@ class NgxGanttComponent extends GanttUpper {
|
|
|
3704
3819
|
get loading() {
|
|
3705
3820
|
return this._loading;
|
|
3706
3821
|
}
|
|
3707
|
-
constructor(elementRef, cdr, ngZone,
|
|
3822
|
+
constructor(elementRef, cdr, ngZone, viewportRuler, config) {
|
|
3708
3823
|
super(elementRef, cdr, ngZone, config);
|
|
3709
|
-
this.
|
|
3824
|
+
this.viewportRuler = viewportRuler;
|
|
3710
3825
|
this.maxLevel = 2;
|
|
3826
|
+
this.virtualScrollEnabled = true;
|
|
3711
3827
|
this.loadingDelay = 0;
|
|
3712
3828
|
this.linkDragStarted = new EventEmitter();
|
|
3713
3829
|
this.linkDragEnded = new EventEmitter();
|
|
3714
3830
|
this.lineClick = new EventEmitter();
|
|
3715
3831
|
this.selectedChange = new EventEmitter();
|
|
3716
|
-
this.
|
|
3717
|
-
this.
|
|
3832
|
+
this.flatItems = [];
|
|
3833
|
+
this.viewportItems = [];
|
|
3718
3834
|
this._loading = false;
|
|
3719
3835
|
this.computeAllRefs = false;
|
|
3720
3836
|
}
|
|
3721
3837
|
ngOnInit() {
|
|
3722
3838
|
super.ngOnInit();
|
|
3723
|
-
this.
|
|
3839
|
+
this.buildFlatItems();
|
|
3724
3840
|
// Note: the zone may be nooped through `BootstrapOptions` when bootstrapping the root module. This means
|
|
3725
3841
|
// the `onStable` will never emit any value.
|
|
3726
3842
|
const onStable$ = this.ngZone.isStable ? from(Promise.resolve()) : this.ngZone.onStable.pipe(take(1));
|
|
@@ -3742,32 +3858,51 @@ class NgxGanttComponent extends GanttUpper {
|
|
|
3742
3858
|
this.view.start$.pipe(skip(1), takeUntil(this.unsubscribe$)).subscribe(() => {
|
|
3743
3859
|
this.computeTempDataRefs();
|
|
3744
3860
|
});
|
|
3861
|
+
if (!this.virtualScrollEnabled) {
|
|
3862
|
+
this.viewportItems = this.flatItems.slice(this.rangeStart, this.rangeEnd);
|
|
3863
|
+
this.computeTempDataRefs();
|
|
3864
|
+
}
|
|
3745
3865
|
}
|
|
3746
3866
|
ngOnChanges(changes) {
|
|
3747
3867
|
super.ngOnChanges(changes);
|
|
3748
3868
|
if (!this.firstChange) {
|
|
3749
3869
|
if (changes.viewType && changes.viewType.currentValue) {
|
|
3750
|
-
this.
|
|
3870
|
+
this.viewportItems = this.flatItems.slice(this.rangeStart, this.rangeEnd);
|
|
3751
3871
|
this.computeTempDataRefs();
|
|
3752
3872
|
}
|
|
3753
3873
|
if (changes.originItems || changes.originGroups) {
|
|
3754
|
-
this.
|
|
3755
|
-
this.
|
|
3874
|
+
this.buildFlatItems();
|
|
3875
|
+
this.viewportItems = this.flatItems.slice(this.rangeStart, this.rangeEnd);
|
|
3756
3876
|
this.computeTempDataRefs();
|
|
3757
3877
|
}
|
|
3758
3878
|
}
|
|
3759
3879
|
}
|
|
3760
3880
|
ngAfterViewInit() {
|
|
3761
|
-
|
|
3762
|
-
|
|
3763
|
-
|
|
3764
|
-
|
|
3765
|
-
|
|
3766
|
-
|
|
3767
|
-
|
|
3768
|
-
|
|
3881
|
+
if (this.virtualScrollEnabled) {
|
|
3882
|
+
this.virtualScroll.renderedRangeStream.pipe(takeUntil(this.unsubscribe$)).subscribe((range) => {
|
|
3883
|
+
const linksElement = this.elementRef.nativeElement.querySelector('.gantt-links-overlay');
|
|
3884
|
+
linksElement.style.top = `${-(this.styles.lineHeight * range.start)}px`;
|
|
3885
|
+
this.rangeStart = range.start;
|
|
3886
|
+
this.rangeEnd = range.end;
|
|
3887
|
+
this.viewportItems = this.flatItems.slice(range.start, range.end);
|
|
3888
|
+
this.computeTempDataRefs();
|
|
3889
|
+
});
|
|
3890
|
+
}
|
|
3769
3891
|
}
|
|
3770
|
-
|
|
3892
|
+
ngAfterViewChecked() {
|
|
3893
|
+
if (this.virtualScrollEnabled && this.viewportRuler && this.virtualScroll.getRenderedRange().end > 0) {
|
|
3894
|
+
const onStable$ = this.ngZone.isStable ? from(Promise.resolve()) : this.ngZone.onStable.pipe(take(1));
|
|
3895
|
+
this.ngZone.runOutsideAngular(() => {
|
|
3896
|
+
onStable$.pipe(takeUntil(this.unsubscribe$)).subscribe(() => {
|
|
3897
|
+
if (!this.ganttRoot.verticalScrollbarWidth) {
|
|
3898
|
+
this.ganttRoot.computeScrollBarOffset();
|
|
3899
|
+
this.cdr.markForCheck();
|
|
3900
|
+
}
|
|
3901
|
+
});
|
|
3902
|
+
});
|
|
3903
|
+
}
|
|
3904
|
+
}
|
|
3905
|
+
buildFlatItems() {
|
|
3771
3906
|
const virtualData = [];
|
|
3772
3907
|
if (this.groups.length) {
|
|
3773
3908
|
this.groups.forEach((group) => {
|
|
@@ -3781,22 +3916,26 @@ class NgxGanttComponent extends GanttUpper {
|
|
|
3781
3916
|
if (this.items.length) {
|
|
3782
3917
|
virtualData.push(...recursiveItems(this.items));
|
|
3783
3918
|
}
|
|
3784
|
-
this.
|
|
3785
|
-
this.
|
|
3919
|
+
this.flatItems = [...virtualData];
|
|
3920
|
+
this.flatItemsMap = keyBy(this.flatItems, 'id');
|
|
3921
|
+
if (!this.virtualScrollEnabled) {
|
|
3922
|
+
this.rangeStart = 0;
|
|
3923
|
+
this.rangeEnd = this.flatItems.length - 1;
|
|
3924
|
+
}
|
|
3786
3925
|
}
|
|
3787
3926
|
afterExpand() {
|
|
3788
|
-
this.
|
|
3789
|
-
this.
|
|
3927
|
+
this.buildFlatItems();
|
|
3928
|
+
this.viewportItems = this.flatItems.slice(this.rangeStart, this.rangeEnd);
|
|
3790
3929
|
}
|
|
3791
3930
|
computeTempDataRefs() {
|
|
3792
3931
|
const tempItemData = [];
|
|
3793
|
-
this.
|
|
3932
|
+
this.viewportItems.forEach((data) => {
|
|
3794
3933
|
if (!data.hasOwnProperty('items')) {
|
|
3795
3934
|
const item = data;
|
|
3796
3935
|
if (item.links) {
|
|
3797
3936
|
item.links.forEach((link) => {
|
|
3798
|
-
if (this.
|
|
3799
|
-
tempItemData.push(this.
|
|
3937
|
+
if (this.flatItemsMap[link.link]) {
|
|
3938
|
+
tempItemData.push(this.flatItemsMap[link.link]);
|
|
3800
3939
|
}
|
|
3801
3940
|
});
|
|
3802
3941
|
}
|
|
@@ -3804,8 +3943,8 @@ class NgxGanttComponent extends GanttUpper {
|
|
|
3804
3943
|
}
|
|
3805
3944
|
});
|
|
3806
3945
|
this.computeItemsRefs(...uniqBy(tempItemData, 'id'));
|
|
3807
|
-
this.
|
|
3808
|
-
this.
|
|
3946
|
+
this.flatItems = [...this.flatItems];
|
|
3947
|
+
this.viewportItems = [...this.viewportItems];
|
|
3809
3948
|
}
|
|
3810
3949
|
expandChildren(item) {
|
|
3811
3950
|
if (!item.expanded) {
|
|
@@ -3874,8 +4013,8 @@ class NgxGanttComponent extends GanttUpper {
|
|
|
3874
4013
|
this.cdr.detectChanges();
|
|
3875
4014
|
}
|
|
3876
4015
|
}
|
|
3877
|
-
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:
|
|
3878
|
-
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: [
|
|
4016
|
+
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: i1$1.ViewportRuler }, { token: GANTT_GLOBAL_CONFIG }], target: i0.ɵɵFactoryTarget.Component });
|
|
4017
|
+
NgxGanttComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.4", type: NgxGanttComponent, selector: "ngx-gantt", inputs: { maxLevel: "maxLevel", async: "async", childrenResolve: "childrenResolve", linkable: "linkable", loading: "loading", virtualScrollEnabled: "virtualScrollEnabled", loadingDelay: "loadingDelay" }, outputs: { linkDragStarted: "linkDragStarted", linkDragEnded: "linkDragEnded", lineClick: "lineClick", selectedChange: "selectedChange" }, providers: [
|
|
3879
4018
|
{
|
|
3880
4019
|
provide: GANTT_UPPER_TOKEN,
|
|
3881
4020
|
useExisting: NgxGanttComponent
|
|
@@ -3884,7 +4023,7 @@ NgxGanttComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", vers
|
|
|
3884
4023
|
provide: GANTT_ABSTRACT_TOKEN,
|
|
3885
4024
|
useExisting: forwardRef(() => NgxGanttComponent)
|
|
3886
4025
|
}
|
|
3887
|
-
], 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
|
|
4026
|
+
], 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 [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]=\"{ 'gantt-normal-viewport': !virtualScrollEnabled, 'gantt-scroll-container': virtualScrollEnabled }\"\n [itemSize]=\"styles.lineHeight\"\n [minBufferPx]=\"styles.lineHeight * 10\"\n [maxBufferPx]=\"styles.lineHeight * 20\"\n >\n <ng-container *cdkVirtualFor=\"let item of flatItems; trackBy: trackBy\"></ng-container>\n <div class=\"gantt-side\" [style.width.px]=\"tableHeader.tableWidth + 1\" [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]=\"tableEmptyTemplate\"\n [rowBeforeTemplate]=\"table?.rowBeforeTemplate\"\n [rowAfterTemplate]=\"table?.rowAfterTemplate\"\n [draggable]=\"table.draggable\"\n [dropEnterPredicate]=\"table.dropEnterPredicate\"\n (dragDropped)=\"table.dragDropped.emit($event)\"\n (dragStarted)=\"table.dragStarted.emit($event)\"\n (dragEnded)=\"table.dragEnded.emit($event)\"\n (itemClick)=\"selectItem($event)\"\n >\n </gantt-table-body>\n </div>\n </div>\n </div>\n <div class=\"gantt-container\">\n <gantt-calendar-grid\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 (barClick)=\"barClick.emit($event)\"\n (lineClick)=\"lineClick.emit($event)\"\n >\n </gantt-main>\n </div>\n </div>\n </cdk-virtual-scroll-viewport>\n\n <gantt-drag-backdrop [style.left.px]=\"tableHeader.tableWidth + 1\"></gantt-drag-backdrop>\n</ngx-gantt-root>\n", dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.CdkFixedSizeVirtualScroll, selector: "cdk-virtual-scroll-viewport[itemSize]", inputs: ["itemSize", "minBufferPx", "maxBufferPx"] }, { kind: "directive", type: i1$1.CdkVirtualForOf, selector: "[cdkVirtualFor][cdkVirtualForOf]", inputs: ["cdkVirtualForOf", "cdkVirtualForTrackBy", "cdkVirtualForTemplate", "cdkVirtualForTemplateCacheSize"] }, { kind: "component", type: i1$1.CdkVirtualScrollViewport, selector: "cdk-virtual-scroll-viewport", inputs: ["orientation", "appendOnly"], outputs: ["scrolledIndexChange"] }, { kind: "component", type: GanttTableHeaderComponent, selector: "gantt-table-header", inputs: ["columns"] }, { kind: "component", type: GanttTableBodyComponent, selector: "gantt-table-body", inputs: ["viewportItems", "flatItems", "columns", "groupTemplate", "emptyTemplate", "rowBeforeTemplate", "rowAfterTemplate", "draggable", "dropEnterPredicate"], outputs: ["dragDropped", "dragStarted", "dragEnded", "itemClick"] }, { kind: "component", type: GanttMainComponent, selector: "gantt-main", inputs: ["viewportItems", "flatItems", "groupHeaderTemplate", "itemTemplate", "barTemplate", "rangeTemplate"], outputs: ["barClick", "lineClick"] }, { kind: "component", type: GanttCalendarHeaderComponent, selector: "gantt-calendar-header" }, { kind: "component", type: GanttCalendarGridComponent, selector: "gantt-calendar-grid" }, { kind: "component", type: GanttLoaderComponent, selector: "gantt-loader" }, { kind: "component", type: GanttDragBackdropComponent, selector: "gantt-drag-backdrop" }, { kind: "component", type: NgxGanttRootComponent, selector: "ngx-gantt-root", inputs: ["sideWidth"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
3888
4027
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: NgxGanttComponent, decorators: [{
|
|
3889
4028
|
type: Component,
|
|
3890
4029
|
args: [{ selector: 'ngx-gantt', changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
@@ -3896,11 +4035,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImpor
|
|
|
3896
4035
|
provide: GANTT_ABSTRACT_TOKEN,
|
|
3897
4036
|
useExisting: forwardRef(() => NgxGanttComponent)
|
|
3898
4037
|
}
|
|
3899
|
-
], 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
|
|
4038
|
+
], 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]=\"{ 'gantt-normal-viewport': !virtualScrollEnabled, 'gantt-scroll-container': virtualScrollEnabled }\"\n [itemSize]=\"styles.lineHeight\"\n [minBufferPx]=\"styles.lineHeight * 10\"\n [maxBufferPx]=\"styles.lineHeight * 20\"\n >\n <ng-container *cdkVirtualFor=\"let item of flatItems; trackBy: trackBy\"></ng-container>\n <div class=\"gantt-side\" [style.width.px]=\"tableHeader.tableWidth + 1\" [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]=\"tableEmptyTemplate\"\n [rowBeforeTemplate]=\"table?.rowBeforeTemplate\"\n [rowAfterTemplate]=\"table?.rowAfterTemplate\"\n [draggable]=\"table.draggable\"\n [dropEnterPredicate]=\"table.dropEnterPredicate\"\n (dragDropped)=\"table.dragDropped.emit($event)\"\n (dragStarted)=\"table.dragStarted.emit($event)\"\n (dragEnded)=\"table.dragEnded.emit($event)\"\n (itemClick)=\"selectItem($event)\"\n >\n </gantt-table-body>\n </div>\n </div>\n </div>\n <div class=\"gantt-container\">\n <gantt-calendar-grid\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 (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" }]
|
|
3900
4039
|
}], ctorParameters: function () {
|
|
3901
|
-
return [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }, { type: i0.NgZone }, { type:
|
|
3902
|
-
type: Optional
|
|
3903
|
-
}] }, { type: undefined, decorators: [{
|
|
4040
|
+
return [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }, { type: i0.NgZone }, { type: i1$1.ViewportRuler }, { type: undefined, decorators: [{
|
|
3904
4041
|
type: Inject,
|
|
3905
4042
|
args: [GANTT_GLOBAL_CONFIG]
|
|
3906
4043
|
}] }];
|
|
@@ -3914,6 +4051,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImpor
|
|
|
3914
4051
|
type: Input
|
|
3915
4052
|
}], loading: [{
|
|
3916
4053
|
type: Input
|
|
4054
|
+
}], virtualScrollEnabled: [{
|
|
4055
|
+
type: Input
|
|
3917
4056
|
}], loadingDelay: [{
|
|
3918
4057
|
type: Input
|
|
3919
4058
|
}], linkDragStarted: [{
|
|
@@ -3947,11 +4086,9 @@ NgxGanttModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version:
|
|
|
3947
4086
|
NgxGanttModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.1.4", ngImport: i0, type: NgxGanttModule, declarations: [NgxGanttComponent,
|
|
3948
4087
|
NgxGanttTableComponent,
|
|
3949
4088
|
NgxGanttTableColumnComponent,
|
|
3950
|
-
// GanttTableComponent,
|
|
3951
4089
|
GanttTableHeaderComponent,
|
|
3952
4090
|
GanttTableBodyComponent,
|
|
3953
4091
|
GanttMainComponent,
|
|
3954
|
-
// GanttCalendarComponent,
|
|
3955
4092
|
GanttCalendarHeaderComponent,
|
|
3956
4093
|
GanttCalendarGridComponent,
|
|
3957
4094
|
GanttLinksComponent,
|
|
@@ -3998,11 +4135,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImpor
|
|
|
3998
4135
|
NgxGanttComponent,
|
|
3999
4136
|
NgxGanttTableComponent,
|
|
4000
4137
|
NgxGanttTableColumnComponent,
|
|
4001
|
-
// GanttTableComponent,
|
|
4002
4138
|
GanttTableHeaderComponent,
|
|
4003
4139
|
GanttTableBodyComponent,
|
|
4004
4140
|
GanttMainComponent,
|
|
4005
|
-
// GanttCalendarComponent,
|
|
4006
4141
|
GanttCalendarHeaderComponent,
|
|
4007
4142
|
GanttCalendarGridComponent,
|
|
4008
4143
|
GanttLinksComponent,
|