@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,7 +8,7 @@ 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
13
|
import * as i2 from '@angular/cdk/drag-drop';
|
|
14
14
|
import { CdkDrag, DragDropModule } from '@angular/cdk/drag-drop';
|
|
@@ -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;
|
|
@@ -1317,98 +1317,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImpor
|
|
|
1317
1317
|
|
|
1318
1318
|
const GANTT_ABSTRACT_TOKEN = new InjectionToken('gantt-abstract-token');
|
|
1319
1319
|
|
|
1320
|
-
class GanttPrintService {
|
|
1321
|
-
constructor() { }
|
|
1322
|
-
setInlineStyles(targetElem) {
|
|
1323
|
-
const svgElements = Array.from(targetElem.getElementsByTagName('svg'));
|
|
1324
|
-
for (const svgElement of svgElements) {
|
|
1325
|
-
this.recursElementChildren(svgElement);
|
|
1326
|
-
}
|
|
1327
|
-
}
|
|
1328
|
-
recursElementChildren(node) {
|
|
1329
|
-
const transformProperties = [
|
|
1330
|
-
'fill',
|
|
1331
|
-
'color',
|
|
1332
|
-
'font-size',
|
|
1333
|
-
'stroke',
|
|
1334
|
-
'font',
|
|
1335
|
-
'text-anchor',
|
|
1336
|
-
'stroke-dasharray',
|
|
1337
|
-
'shape-rendering',
|
|
1338
|
-
'stroke-width'
|
|
1339
|
-
];
|
|
1340
|
-
if (!node.style) {
|
|
1341
|
-
return;
|
|
1342
|
-
}
|
|
1343
|
-
const styles = getComputedStyle(node);
|
|
1344
|
-
for (const transformProperty of transformProperties) {
|
|
1345
|
-
node.style[transformProperty] = styles[transformProperty];
|
|
1346
|
-
}
|
|
1347
|
-
for (const child of Array.from(node.childNodes)) {
|
|
1348
|
-
this.recursElementChildren(child);
|
|
1349
|
-
}
|
|
1350
|
-
}
|
|
1351
|
-
register(root) {
|
|
1352
|
-
this.root = root.nativeElement;
|
|
1353
|
-
this.mainContainer = this.root.getElementsByClassName('gantt-main-container')[0];
|
|
1354
|
-
}
|
|
1355
|
-
async print(name = 'download', ignoreElementClass) {
|
|
1356
|
-
const root = this.root;
|
|
1357
|
-
const mainContainer = this.mainContainer;
|
|
1358
|
-
// set print width
|
|
1359
|
-
const printWidth = root.offsetWidth;
|
|
1360
|
-
// set print height
|
|
1361
|
-
const printHeight = root.offsetHeight - mainContainer.offsetHeight + mainContainer.scrollHeight;
|
|
1362
|
-
const html2canvas = (await import(/* webpackChunkName: 'html2canvas' */ 'html2canvas')).default;
|
|
1363
|
-
html2canvas(root, {
|
|
1364
|
-
logging: false,
|
|
1365
|
-
allowTaint: true,
|
|
1366
|
-
useCORS: true,
|
|
1367
|
-
width: printWidth,
|
|
1368
|
-
height: printHeight,
|
|
1369
|
-
ignoreElements: (element) => {
|
|
1370
|
-
if (ignoreElementClass && element.classList.contains(ignoreElementClass)) {
|
|
1371
|
-
return true;
|
|
1372
|
-
}
|
|
1373
|
-
if (element.classList.contains('gantt-calendar-today-overlay')) {
|
|
1374
|
-
return true;
|
|
1375
|
-
}
|
|
1376
|
-
},
|
|
1377
|
-
onclone: (cloneDocument) => {
|
|
1378
|
-
const ganttClass = root.className;
|
|
1379
|
-
const cloneGanttDom = cloneDocument.querySelector(`.${ganttClass.replace(/\s+/g, '.')}`);
|
|
1380
|
-
const cloneGanttContainerDom = cloneDocument.querySelector('.gantt-container');
|
|
1381
|
-
const cloneCalendarOverlay = cloneDocument.querySelector('.gantt-calendar-grid-main');
|
|
1382
|
-
const cloneLinksOverlay = cloneDocument.querySelector('.gantt-links-overlay-main');
|
|
1383
|
-
// change targetDom width
|
|
1384
|
-
cloneGanttDom.style.width = `${printWidth}px`;
|
|
1385
|
-
cloneGanttDom.style.height = `${printHeight}px`;
|
|
1386
|
-
cloneGanttDom.style.overflow = `unset`;
|
|
1387
|
-
cloneGanttContainerDom.style.backgroundColor = '#fff';
|
|
1388
|
-
cloneCalendarOverlay.setAttribute('height', `${printHeight}`);
|
|
1389
|
-
cloneCalendarOverlay.setAttribute('style', `background: transparent`);
|
|
1390
|
-
if (cloneLinksOverlay) {
|
|
1391
|
-
cloneLinksOverlay.setAttribute('height', `${printHeight}`);
|
|
1392
|
-
cloneLinksOverlay.setAttribute('style', `height: ${printHeight}px`);
|
|
1393
|
-
}
|
|
1394
|
-
// setInlineStyles for svg
|
|
1395
|
-
this.setInlineStyles(cloneGanttDom);
|
|
1396
|
-
}
|
|
1397
|
-
}).then((canvas) => {
|
|
1398
|
-
const link = document.createElement('a');
|
|
1399
|
-
const dataUrl = canvas.toDataURL('image/png');
|
|
1400
|
-
link.download = `${name}.png`;
|
|
1401
|
-
link.href = dataUrl;
|
|
1402
|
-
link.click();
|
|
1403
|
-
});
|
|
1404
|
-
}
|
|
1405
|
-
}
|
|
1406
|
-
GanttPrintService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: GanttPrintService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1407
|
-
GanttPrintService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: GanttPrintService });
|
|
1408
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: GanttPrintService, decorators: [{
|
|
1409
|
-
type: Injectable
|
|
1410
|
-
}], ctorParameters: function () { return []; } });
|
|
1411
|
-
|
|
1412
1320
|
const supports = (typeof window !== 'undefined' && !!window.CSS && CSS.supports) || (() => false);
|
|
1413
1321
|
/**
|
|
1414
1322
|
* Note: we don't need to add vendor prefixes within `.scss` files since they're added automatically.
|
|
@@ -1719,16 +1627,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImpor
|
|
|
1719
1627
|
}] });
|
|
1720
1628
|
|
|
1721
1629
|
class GanttTableBodyComponent {
|
|
1722
|
-
set
|
|
1630
|
+
set viewportItems(data) {
|
|
1723
1631
|
const firstData = data[0];
|
|
1724
1632
|
if (firstData && firstData.hasOwnProperty('items')) {
|
|
1725
1633
|
this.hasGroup = true;
|
|
1726
1634
|
}
|
|
1727
1635
|
this.ganttTableEmptyClass = data?.length ? false : true;
|
|
1728
|
-
this.
|
|
1636
|
+
this._viewportItems = data;
|
|
1729
1637
|
}
|
|
1730
|
-
get
|
|
1731
|
-
return this.
|
|
1638
|
+
get viewportItems() {
|
|
1639
|
+
return this._viewportItems;
|
|
1732
1640
|
}
|
|
1733
1641
|
constructor(gantt, ganttUpper, cdr, document) {
|
|
1734
1642
|
this.gantt = gantt;
|
|
@@ -1889,13 +1797,13 @@ class GanttTableBodyComponent {
|
|
|
1889
1797
|
this.destroy$.complete();
|
|
1890
1798
|
}
|
|
1891
1799
|
removeItem(item, children) {
|
|
1892
|
-
this.
|
|
1893
|
-
this.
|
|
1800
|
+
this.viewportItems.splice(this.viewportItems.indexOf(item), 1 + children.length);
|
|
1801
|
+
this.flatItems.splice(this.flatItems.indexOf(item), 1 + children.length);
|
|
1894
1802
|
}
|
|
1895
1803
|
insertItem(target, inserted, children, position) {
|
|
1896
1804
|
if (position === 'before') {
|
|
1897
|
-
this.
|
|
1898
|
-
this.
|
|
1805
|
+
this.viewportItems.splice(this.viewportItems.indexOf(target), 0, inserted, ...children);
|
|
1806
|
+
this.flatItems.splice(this.flatItems.indexOf(target), 0, inserted, ...children);
|
|
1899
1807
|
}
|
|
1900
1808
|
else {
|
|
1901
1809
|
const dragRef = this.cdkDrags.find((drag) => drag.data === target);
|
|
@@ -1904,19 +1812,19 @@ class GanttTableBodyComponent {
|
|
|
1904
1812
|
if (target.expanded) {
|
|
1905
1813
|
childrenCount = this.getChildrenElementsByElement(dragRef.element.nativeElement)?.length || 0;
|
|
1906
1814
|
}
|
|
1907
|
-
this.
|
|
1908
|
-
this.
|
|
1815
|
+
this.viewportItems.splice(this.viewportItems.indexOf(target) + 1 + childrenCount, 0, inserted, ...children);
|
|
1816
|
+
this.flatItems.splice(this.flatItems.indexOf(target) + 1 + childrenCount, 0, inserted, ...children);
|
|
1909
1817
|
}
|
|
1910
1818
|
}
|
|
1911
1819
|
insertChildrenItem(target, inserted, children) {
|
|
1912
1820
|
if (target.expanded) {
|
|
1913
|
-
this.
|
|
1914
|
-
this.
|
|
1821
|
+
this.viewportItems.splice(this.viewportItems.indexOf(target) + target.children.length + 1, 0, inserted, ...children);
|
|
1822
|
+
this.flatItems.splice(this.flatItems.indexOf(target) + target.children.length + 1, 0, inserted, ...children);
|
|
1915
1823
|
}
|
|
1916
1824
|
target.children.push(inserted);
|
|
1917
1825
|
}
|
|
1918
1826
|
getParentByItem(item) {
|
|
1919
|
-
return (this.
|
|
1827
|
+
return (this.flatItems || []).find((n) => {
|
|
1920
1828
|
return n.children?.includes(item);
|
|
1921
1829
|
});
|
|
1922
1830
|
}
|
|
@@ -1974,10 +1882,10 @@ class GanttTableBodyComponent {
|
|
|
1974
1882
|
}
|
|
1975
1883
|
}
|
|
1976
1884
|
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 });
|
|
1977
|
-
GanttTableBodyComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.4", type: GanttTableBodyComponent, selector: "gantt-table-body", inputs: {
|
|
1885
|
+
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" }] });
|
|
1978
1886
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: GanttTableBodyComponent, decorators: [{
|
|
1979
1887
|
type: Component,
|
|
1980
|
-
args: [{ selector: 'gantt-table-body', template: "<div\n class=\"gantt-table-body-container\"\n cdkDropList\n [cdkDropListAutoScrollStep]=\"6\"\n [cdkDropListData]=\"
|
|
1888
|
+
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" }]
|
|
1981
1889
|
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
1982
1890
|
type: Inject,
|
|
1983
1891
|
args: [GANTT_ABSTRACT_TOKEN]
|
|
@@ -1987,9 +1895,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImpor
|
|
|
1987
1895
|
}] }, { type: i0.ChangeDetectorRef }, { type: Document, decorators: [{
|
|
1988
1896
|
type: Inject,
|
|
1989
1897
|
args: [DOCUMENT]
|
|
1990
|
-
}] }]; }, propDecorators: {
|
|
1898
|
+
}] }]; }, propDecorators: { viewportItems: [{
|
|
1991
1899
|
type: Input
|
|
1992
|
-
}],
|
|
1900
|
+
}], flatItems: [{
|
|
1993
1901
|
type: Input
|
|
1994
1902
|
}], columns: [{
|
|
1995
1903
|
type: Input
|
|
@@ -2291,7 +2199,7 @@ class GanttLinksComponent {
|
|
|
2291
2199
|
this.ngZone = ngZone;
|
|
2292
2200
|
// @Input() groups: GanttGroupInternal[] = [];
|
|
2293
2201
|
// @Input() items: GanttItemInternal[] = [];
|
|
2294
|
-
this.
|
|
2202
|
+
this.flatItems = [];
|
|
2295
2203
|
this.lineClick = new EventEmitter();
|
|
2296
2204
|
this.links = [];
|
|
2297
2205
|
this.ganttLinkTypes = GanttLinkType;
|
|
@@ -2368,7 +2276,7 @@ class GanttLinksComponent {
|
|
|
2368
2276
|
// });
|
|
2369
2277
|
// });
|
|
2370
2278
|
// }
|
|
2371
|
-
this.
|
|
2279
|
+
this.flatItems.forEach((item, itemIndex) => {
|
|
2372
2280
|
if (!item.hasOwnProperty('items')) {
|
|
2373
2281
|
const ganttItem = item;
|
|
2374
2282
|
if (ganttItem.refs) {
|
|
@@ -2452,14 +2360,14 @@ class GanttLinksComponent {
|
|
|
2452
2360
|
}
|
|
2453
2361
|
}
|
|
2454
2362
|
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 });
|
|
2455
|
-
GanttLinksComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.4", type: GanttLinksComponent, selector: "gantt-links-overlay", inputs: {
|
|
2363
|
+
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"] }] });
|
|
2456
2364
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: GanttLinksComponent, decorators: [{
|
|
2457
2365
|
type: Component,
|
|
2458
2366
|
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" }]
|
|
2459
2367
|
}], ctorParameters: function () { return [{ type: GanttUpper, decorators: [{
|
|
2460
2368
|
type: Inject,
|
|
2461
2369
|
args: [GANTT_UPPER_TOKEN]
|
|
2462
|
-
}] }, { type: i0.ChangeDetectorRef }, { type: i0.ElementRef }, { type: GanttDragContainer }, { type: i0.NgZone }]; }, propDecorators: {
|
|
2370
|
+
}] }, { type: i0.ChangeDetectorRef }, { type: i0.ElementRef }, { type: GanttDragContainer }, { type: i0.NgZone }]; }, propDecorators: { flatItems: [{
|
|
2463
2371
|
type: Input
|
|
2464
2372
|
}], lineClick: [{
|
|
2465
2373
|
type: Output
|
|
@@ -2532,6 +2440,25 @@ function isPointerNearClientRect(rect, threshold, pointerX, pointerY) {
|
|
|
2532
2440
|
const yThreshold = height * threshold;
|
|
2533
2441
|
return pointerY > top - yThreshold && pointerY < bottom + yThreshold && pointerX > left - xThreshold && pointerX < right + xThreshold;
|
|
2534
2442
|
}
|
|
2443
|
+
/**
|
|
2444
|
+
* Gets the speed rate of auto scrolling
|
|
2445
|
+
* @param clientRect Dimensions of the node.
|
|
2446
|
+
* @param pointerX Position of the user's pointer along the x axis.
|
|
2447
|
+
* @param horizontalScrollDirection The direction in which the mouse is dragged horizontally
|
|
2448
|
+
*/
|
|
2449
|
+
function getAutoScrollSpeedRates(clientRect, pointerX, horizontalScrollDirection) {
|
|
2450
|
+
let autoScrollSpeedRates = 4;
|
|
2451
|
+
const speedLevels = 4;
|
|
2452
|
+
const { left, right, width } = clientRect;
|
|
2453
|
+
const xThreshold = width * SCROLL_PROXIMITY_THRESHOLD;
|
|
2454
|
+
if (horizontalScrollDirection === 1 /* AutoScrollHorizontalDirection.LEFT */) {
|
|
2455
|
+
autoScrollSpeedRates = Math.ceil((xThreshold - (pointerX > left ? pointerX - left : 0)) / (xThreshold / speedLevels));
|
|
2456
|
+
}
|
|
2457
|
+
if (horizontalScrollDirection === 2 /* AutoScrollHorizontalDirection.RIGHT */) {
|
|
2458
|
+
autoScrollSpeedRates = Math.ceil((xThreshold - (right > pointerX ? right - pointerX : 0)) / (xThreshold / speedLevels));
|
|
2459
|
+
}
|
|
2460
|
+
return autoScrollSpeedRates;
|
|
2461
|
+
}
|
|
2535
2462
|
|
|
2536
2463
|
const scrollThreshold = 50;
|
|
2537
2464
|
var ScrollDirection;
|
|
@@ -2581,6 +2508,7 @@ class GanttDomService {
|
|
|
2581
2508
|
this.container = this.root.getElementsByClassName('gantt-container')[0];
|
|
2582
2509
|
this.sideContainer = this.root.getElementsByClassName('gantt-side-container')[0];
|
|
2583
2510
|
this.mainContainer = this.root.getElementsByClassName('gantt-main-container')[0];
|
|
2511
|
+
this.verticalScrollContainer = this.root.getElementsByClassName('gantt-scroll-container')[0];
|
|
2584
2512
|
const mainItems = this.mainContainer.getElementsByClassName('gantt-main-items')[0];
|
|
2585
2513
|
const mainGroups = this.mainContainer.getElementsByClassName('gantt-main-groups')[0];
|
|
2586
2514
|
this.mainItems = mainItems || mainGroups;
|
|
@@ -2646,7 +2574,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImpor
|
|
|
2646
2574
|
*/
|
|
2647
2575
|
const DROP_PROXIMITY_THRESHOLD = 0.05;
|
|
2648
2576
|
const dragMinWidth = 10;
|
|
2649
|
-
const
|
|
2577
|
+
const autoScrollBaseStep = 2;
|
|
2650
2578
|
const activeClass = 'gantt-bar-active';
|
|
2651
2579
|
const dropActiveClass = 'gantt-bar-drop-active';
|
|
2652
2580
|
const singleDropActiveClass = 'gantt-bar-single-drop-active';
|
|
@@ -2662,6 +2590,12 @@ class GanttBarDrag {
|
|
|
2662
2590
|
get linkDragDisabled() {
|
|
2663
2591
|
return !this.item.linkable || !this.ganttUpper.linkable;
|
|
2664
2592
|
}
|
|
2593
|
+
get barHandleDragMoveAndScrollDistance() {
|
|
2594
|
+
return this.barHandleDragMoveDistance + this.dragScrollDistance;
|
|
2595
|
+
}
|
|
2596
|
+
get autoScrollStep() {
|
|
2597
|
+
return Math.pow(autoScrollBaseStep, this.autoScrollSpeedRates);
|
|
2598
|
+
}
|
|
2665
2599
|
constructor(dragDrop, dom, dragContainer, _ngZone) {
|
|
2666
2600
|
this.dragDrop = dragDrop;
|
|
2667
2601
|
this.dom = dom;
|
|
@@ -2681,13 +2615,15 @@ class GanttBarDrag {
|
|
|
2681
2615
|
this.dragScrollDistance = 0;
|
|
2682
2616
|
/** Horizontal direction in which the list is currently scrolling. */
|
|
2683
2617
|
this._horizontalScrollDirection = 0 /* AutoScrollHorizontalDirection.NONE */;
|
|
2618
|
+
/** Speed ratio for auto scroll */
|
|
2619
|
+
this.autoScrollSpeedRates = 1;
|
|
2684
2620
|
this.startScrollInterval = () => {
|
|
2685
2621
|
this.stopScrolling();
|
|
2686
2622
|
interval(0, animationFrameScheduler)
|
|
2687
2623
|
.pipe(takeUntil(this.stopScrollTimers$))
|
|
2688
2624
|
.subscribe(() => {
|
|
2689
2625
|
const node = this.dom.mainContainer;
|
|
2690
|
-
const scrollStep = autoScrollStep;
|
|
2626
|
+
const scrollStep = this.autoScrollStep;
|
|
2691
2627
|
if (this._horizontalScrollDirection === 1 /* AutoScrollHorizontalDirection.LEFT */) {
|
|
2692
2628
|
node.scrollBy(-scrollStep, 0);
|
|
2693
2629
|
}
|
|
@@ -2795,16 +2731,32 @@ class GanttBarDrag {
|
|
|
2795
2731
|
const dragScrollDistance = this.dom.mainContainer.scrollLeft - this.containerScrollLeft;
|
|
2796
2732
|
this.dragScrollDistance = dragScrollDistance;
|
|
2797
2733
|
dragRef['_boundaryRect'] = this.dom.mainItems.getBoundingClientRect();
|
|
2798
|
-
this.
|
|
2734
|
+
if (this.dragScrolling && this.isStartGreaterThanEndWhenBarHandleDragMove(isBefore)) {
|
|
2735
|
+
this.stopScrolling();
|
|
2736
|
+
this.dragScrolling = false;
|
|
2737
|
+
}
|
|
2738
|
+
if (isBefore) {
|
|
2739
|
+
this.barBeforeHandleDragMove();
|
|
2740
|
+
}
|
|
2741
|
+
else {
|
|
2742
|
+
this.barAfterHandleDragMove();
|
|
2743
|
+
}
|
|
2799
2744
|
}
|
|
2800
2745
|
});
|
|
2801
2746
|
this.dragContainer.dragStarted.emit({ item: this.item.origin });
|
|
2802
2747
|
});
|
|
2803
2748
|
dragRef.moved.subscribe((event) => {
|
|
2804
|
-
this.
|
|
2749
|
+
if (this.barHandleDragMoveRecordDays && this.barHandleDragMoveRecordDays > 0) {
|
|
2750
|
+
this.startScrollingIfNecessary(event.pointerPosition.x, event.pointerPosition.y);
|
|
2751
|
+
}
|
|
2805
2752
|
this.barHandleDragMoveDistance = event.distance.x;
|
|
2806
2753
|
if (!this.dragScrolling) {
|
|
2807
|
-
|
|
2754
|
+
if (isBefore) {
|
|
2755
|
+
this.barBeforeHandleDragMove();
|
|
2756
|
+
}
|
|
2757
|
+
else {
|
|
2758
|
+
this.barAfterHandleDragMove();
|
|
2759
|
+
}
|
|
2808
2760
|
}
|
|
2809
2761
|
});
|
|
2810
2762
|
dragRef.ended.subscribe((event) => {
|
|
@@ -2887,10 +2839,10 @@ class GanttBarDrag {
|
|
|
2887
2839
|
let left = dragRect.left - rootRect.left - (this.dom.side.clientWidth + 1);
|
|
2888
2840
|
if (this.dragScrolling) {
|
|
2889
2841
|
if (this._horizontalScrollDirection === 1 /* AutoScrollHorizontalDirection.LEFT */) {
|
|
2890
|
-
left += autoScrollStep;
|
|
2842
|
+
left += this.autoScrollStep;
|
|
2891
2843
|
}
|
|
2892
2844
|
else if (this._horizontalScrollDirection === 2 /* AutoScrollHorizontalDirection.RIGHT */) {
|
|
2893
|
-
left -= autoScrollStep;
|
|
2845
|
+
left -= this.autoScrollStep;
|
|
2894
2846
|
}
|
|
2895
2847
|
}
|
|
2896
2848
|
const width = dragRect.right - dragRect.left;
|
|
@@ -2940,44 +2892,51 @@ class GanttBarDrag {
|
|
|
2940
2892
|
this.item.updateDate(start, end);
|
|
2941
2893
|
this.dragContainer.dragMoved.emit({ item: this.item.origin });
|
|
2942
2894
|
}
|
|
2943
|
-
|
|
2944
|
-
const
|
|
2945
|
-
|
|
2946
|
-
|
|
2947
|
-
|
|
2948
|
-
|
|
2949
|
-
|
|
2950
|
-
|
|
2951
|
-
|
|
2895
|
+
barBeforeHandleDragMove() {
|
|
2896
|
+
const { x, start, oneDayWidth } = this.startOfBarHandle();
|
|
2897
|
+
const width = this.item.refs.width + this.barHandleDragMoveAndScrollDistance * -1;
|
|
2898
|
+
const days = differenceInDays(this.item.end.value, start.value);
|
|
2899
|
+
if (width > dragMinWidth && days > 0) {
|
|
2900
|
+
this.barElement.style.width = width + 'px';
|
|
2901
|
+
this.barElement.style.left = x + 'px';
|
|
2902
|
+
this.openDragBackdrop(this.barElement, start, this.item.end);
|
|
2903
|
+
if (!this.isStartOrEndInsideView(start, this.item.end)) {
|
|
2904
|
+
return;
|
|
2905
|
+
}
|
|
2906
|
+
this.item.updateDate(start, this.item.end);
|
|
2907
|
+
}
|
|
2908
|
+
else {
|
|
2909
|
+
if (this.barHandleDragMoveRecordDays > 0 && days <= 0) {
|
|
2910
|
+
this.barElement.style.width = oneDayWidth + 'px';
|
|
2911
|
+
const x = this.ganttUpper.view.getXPointByDate(this.item.end);
|
|
2952
2912
|
this.barElement.style.left = x + 'px';
|
|
2953
|
-
this.openDragBackdrop(this.barElement, start, this.item.end);
|
|
2954
|
-
if (!this.isStartOrEndInsideView(start, this.item.end)) {
|
|
2955
|
-
return;
|
|
2956
|
-
}
|
|
2957
|
-
this.item.updateDate(start, this.item.end);
|
|
2958
2913
|
}
|
|
2959
|
-
|
|
2960
|
-
|
|
2961
|
-
|
|
2914
|
+
this.openDragBackdrop(this.barElement, this.item.end.startOfDay(), this.item.end);
|
|
2915
|
+
this.item.updateDate(this.item.end.startOfDay(), this.item.end);
|
|
2916
|
+
}
|
|
2917
|
+
this.barHandleDragMoveRecordDays = days;
|
|
2918
|
+
this.dragContainer.dragMoved.emit({ item: this.item.origin });
|
|
2919
|
+
}
|
|
2920
|
+
barAfterHandleDragMove() {
|
|
2921
|
+
const { width, end } = this.endOfBarHandle();
|
|
2922
|
+
const days = differenceInDays(end.value, this.item.start.value);
|
|
2923
|
+
if (width > dragMinWidth && days > 0) {
|
|
2924
|
+
this.barElement.style.width = width + 'px';
|
|
2925
|
+
this.openDragBackdrop(this.barElement, this.item.start, end);
|
|
2926
|
+
if (!this.isStartOrEndInsideView(this.item.start, end)) {
|
|
2927
|
+
return;
|
|
2962
2928
|
}
|
|
2929
|
+
this.item.updateDate(this.item.start, end);
|
|
2963
2930
|
}
|
|
2964
2931
|
else {
|
|
2965
|
-
|
|
2966
|
-
|
|
2967
|
-
|
|
2968
|
-
if (width > dragMinWidth && days > 0) {
|
|
2969
|
-
this.barElement.style.width = width + 'px';
|
|
2970
|
-
this.openDragBackdrop(this.barElement, this.item.start, end);
|
|
2971
|
-
if (!this.isStartOrEndInsideView(this.item.start, end)) {
|
|
2972
|
-
return;
|
|
2973
|
-
}
|
|
2974
|
-
this.item.updateDate(this.item.start, end);
|
|
2975
|
-
}
|
|
2976
|
-
else {
|
|
2977
|
-
this.openDragBackdrop(this.barElement, this.item.start, this.item.start.endOfDay());
|
|
2978
|
-
this.item.updateDate(this.item.start, this.item.start.endOfDay());
|
|
2932
|
+
if (this.barHandleDragMoveRecordDays > 0 && days <= 0) {
|
|
2933
|
+
const oneDayWidth = this.ganttUpper.view.getDateRangeWidth(this.item.start, this.item.start.endOfDay());
|
|
2934
|
+
this.barElement.style.width = oneDayWidth + 'px';
|
|
2979
2935
|
}
|
|
2936
|
+
this.openDragBackdrop(this.barElement, this.item.start, this.item.start.endOfDay());
|
|
2937
|
+
this.item.updateDate(this.item.start, this.item.start.endOfDay());
|
|
2980
2938
|
}
|
|
2939
|
+
this.barHandleDragMoveRecordDays = days;
|
|
2981
2940
|
this.dragContainer.dragMoved.emit({ item: this.item.origin });
|
|
2982
2941
|
}
|
|
2983
2942
|
calcLinkLinePositions(target, isBefore) {
|
|
@@ -3016,6 +2975,7 @@ class GanttBarDrag {
|
|
|
3016
2975
|
(horizontalScrollDirection === 2 /* AutoScrollHorizontalDirection.RIGHT */ &&
|
|
3017
2976
|
scrollLeft < this.ganttUpper.view.width - clientRect.width)) {
|
|
3018
2977
|
this._horizontalScrollDirection = horizontalScrollDirection;
|
|
2978
|
+
this.autoScrollSpeedRates = getAutoScrollSpeedRates(clientRect, pointerX, horizontalScrollDirection);
|
|
3019
2979
|
this.dragScrolling = true;
|
|
3020
2980
|
this._ngZone.runOutsideAngular(this.startScrollInterval);
|
|
3021
2981
|
}
|
|
@@ -3025,6 +2985,44 @@ class GanttBarDrag {
|
|
|
3025
2985
|
}
|
|
3026
2986
|
}
|
|
3027
2987
|
}
|
|
2988
|
+
// Conditions to stop auto-scroll: when the start is greater than the end and the bar appears in the view
|
|
2989
|
+
isStartGreaterThanEndWhenBarHandleDragMove(isBefore) {
|
|
2990
|
+
let isStartGreaterThanEnd;
|
|
2991
|
+
let isBarAppearsInView;
|
|
2992
|
+
const scrollLeft = this.dom.mainContainer.scrollLeft;
|
|
2993
|
+
const clientWidth = this.dom.mainContainer.clientWidth;
|
|
2994
|
+
const xThreshold = clientWidth * DROP_PROXIMITY_THRESHOLD;
|
|
2995
|
+
if (isBefore) {
|
|
2996
|
+
const { start, oneDayWidth } = this.startOfBarHandle();
|
|
2997
|
+
const xPointerByEndDate = this.ganttUpper.view.getXPointByDate(this.item.end);
|
|
2998
|
+
isStartGreaterThanEnd = start.value > this.item.end.value;
|
|
2999
|
+
isBarAppearsInView = xPointerByEndDate + oneDayWidth + xThreshold <= scrollLeft + clientWidth;
|
|
3000
|
+
}
|
|
3001
|
+
else {
|
|
3002
|
+
const { end } = this.endOfBarHandle();
|
|
3003
|
+
const xPointerByStartDate = this.ganttUpper.view.getXPointByDate(this.item.start);
|
|
3004
|
+
isStartGreaterThanEnd = end.value < this.item.start.value;
|
|
3005
|
+
isBarAppearsInView = scrollLeft + xThreshold <= xPointerByStartDate;
|
|
3006
|
+
}
|
|
3007
|
+
return isStartGreaterThanEnd && isBarAppearsInView ? true : false;
|
|
3008
|
+
}
|
|
3009
|
+
// Some data information about dragging start until it is equal to or greater than end
|
|
3010
|
+
startOfBarHandle() {
|
|
3011
|
+
const x = this.item.refs.x + this.barHandleDragMoveAndScrollDistance;
|
|
3012
|
+
return {
|
|
3013
|
+
x,
|
|
3014
|
+
start: this.ganttUpper.view.getDateByXPoint(x),
|
|
3015
|
+
oneDayWidth: this.ganttUpper.view.getDateRangeWidth(this.item.end.startOfDay(), this.item.end)
|
|
3016
|
+
};
|
|
3017
|
+
}
|
|
3018
|
+
// Some data information about dragging end of bar handle
|
|
3019
|
+
endOfBarHandle() {
|
|
3020
|
+
const width = this.item.refs.width + this.barHandleDragMoveAndScrollDistance;
|
|
3021
|
+
return {
|
|
3022
|
+
width,
|
|
3023
|
+
end: this.ganttUpper.view.getDateByXPoint(this.item.refs.x + width)
|
|
3024
|
+
};
|
|
3025
|
+
}
|
|
3028
3026
|
stopScrolling() {
|
|
3029
3027
|
this.stopScrollTimers$.next();
|
|
3030
3028
|
}
|
|
@@ -3161,7 +3159,9 @@ class NgxGanttBarComponent extends GanttItemUpper {
|
|
|
3161
3159
|
if (!this.firstChange) {
|
|
3162
3160
|
this.drag.updateItem(this.item);
|
|
3163
3161
|
if (changes.item.currentValue.refs?.width !== changes.item.previousValue.refs?.width ||
|
|
3164
|
-
changes.item.currentValue.color !== changes.item.previousValue.color
|
|
3162
|
+
changes.item.currentValue.color !== changes.item.previousValue.color ||
|
|
3163
|
+
changes.item.currentValue.start?.value !== changes.item.previousValue.start?.value ||
|
|
3164
|
+
changes.item.currentValue.end?.value !== changes.item.previousValue.end?.value) {
|
|
3165
3165
|
this.setContentBackground();
|
|
3166
3166
|
}
|
|
3167
3167
|
}
|
|
@@ -3310,16 +3310,16 @@ class GanttMainComponent {
|
|
|
3310
3310
|
}
|
|
3311
3311
|
}
|
|
3312
3312
|
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 });
|
|
3313
|
-
GanttMainComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.4", type: GanttMainComponent, selector: "gantt-main", inputs: {
|
|
3313
|
+
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" }] });
|
|
3314
3314
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: GanttMainComponent, decorators: [{
|
|
3315
3315
|
type: Component,
|
|
3316
|
-
args: [{ selector: 'gantt-main', template: "
|
|
3316
|
+
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" }]
|
|
3317
3317
|
}], ctorParameters: function () { return [{ type: GanttUpper, decorators: [{
|
|
3318
3318
|
type: Inject,
|
|
3319
3319
|
args: [GANTT_UPPER_TOKEN]
|
|
3320
|
-
}] }]; }, propDecorators: {
|
|
3320
|
+
}] }]; }, propDecorators: { viewportItems: [{
|
|
3321
3321
|
type: Input
|
|
3322
|
-
}],
|
|
3322
|
+
}], flatItems: [{
|
|
3323
3323
|
type: Input
|
|
3324
3324
|
}], groupHeaderTemplate: [{
|
|
3325
3325
|
type: Input
|
|
@@ -3493,6 +3493,98 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImpor
|
|
|
3493
3493
|
}, 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" }]
|
|
3494
3494
|
}] });
|
|
3495
3495
|
|
|
3496
|
+
class GanttPrintService {
|
|
3497
|
+
constructor() { }
|
|
3498
|
+
setInlineStyles(targetElem) {
|
|
3499
|
+
const svgElements = Array.from(targetElem.getElementsByTagName('svg'));
|
|
3500
|
+
for (const svgElement of svgElements) {
|
|
3501
|
+
this.recursElementChildren(svgElement);
|
|
3502
|
+
}
|
|
3503
|
+
}
|
|
3504
|
+
recursElementChildren(node) {
|
|
3505
|
+
const transformProperties = [
|
|
3506
|
+
'fill',
|
|
3507
|
+
'color',
|
|
3508
|
+
'font-size',
|
|
3509
|
+
'stroke',
|
|
3510
|
+
'font',
|
|
3511
|
+
'text-anchor',
|
|
3512
|
+
'stroke-dasharray',
|
|
3513
|
+
'shape-rendering',
|
|
3514
|
+
'stroke-width'
|
|
3515
|
+
];
|
|
3516
|
+
if (!node.style) {
|
|
3517
|
+
return;
|
|
3518
|
+
}
|
|
3519
|
+
const styles = getComputedStyle(node);
|
|
3520
|
+
for (const transformProperty of transformProperties) {
|
|
3521
|
+
node.style[transformProperty] = styles[transformProperty];
|
|
3522
|
+
}
|
|
3523
|
+
for (const child of Array.from(node.childNodes)) {
|
|
3524
|
+
this.recursElementChildren(child);
|
|
3525
|
+
}
|
|
3526
|
+
}
|
|
3527
|
+
register(root) {
|
|
3528
|
+
this.root = root.nativeElement;
|
|
3529
|
+
this.mainContainer = this.root.getElementsByClassName('gantt-main-container')[0];
|
|
3530
|
+
}
|
|
3531
|
+
async print(name = 'download', ignoreElementClass) {
|
|
3532
|
+
const root = this.root;
|
|
3533
|
+
const mainContainer = this.mainContainer;
|
|
3534
|
+
// set print width
|
|
3535
|
+
const printWidth = root.offsetWidth;
|
|
3536
|
+
// set print height
|
|
3537
|
+
const printHeight = root.offsetHeight - mainContainer.offsetHeight + mainContainer.scrollHeight;
|
|
3538
|
+
const html2canvas = (await import(/* webpackChunkName: 'html2canvas' */ 'html2canvas')).default;
|
|
3539
|
+
html2canvas(root, {
|
|
3540
|
+
logging: false,
|
|
3541
|
+
allowTaint: true,
|
|
3542
|
+
useCORS: true,
|
|
3543
|
+
width: printWidth,
|
|
3544
|
+
height: printHeight,
|
|
3545
|
+
ignoreElements: (element) => {
|
|
3546
|
+
if (ignoreElementClass && element.classList.contains(ignoreElementClass)) {
|
|
3547
|
+
return true;
|
|
3548
|
+
}
|
|
3549
|
+
if (element.classList.contains('gantt-calendar-today-overlay')) {
|
|
3550
|
+
return true;
|
|
3551
|
+
}
|
|
3552
|
+
},
|
|
3553
|
+
onclone: (cloneDocument) => {
|
|
3554
|
+
const ganttClass = root.className;
|
|
3555
|
+
const cloneGanttDom = cloneDocument.querySelector(`.${ganttClass.replace(/\s+/g, '.')}`);
|
|
3556
|
+
const cloneGanttContainerDom = cloneDocument.querySelector('.gantt-container');
|
|
3557
|
+
const cloneCalendarOverlay = cloneDocument.querySelector('.gantt-calendar-grid-main');
|
|
3558
|
+
const cloneLinksOverlay = cloneDocument.querySelector('.gantt-links-overlay-main');
|
|
3559
|
+
// change targetDom width
|
|
3560
|
+
cloneGanttDom.style.width = `${printWidth}px`;
|
|
3561
|
+
cloneGanttDom.style.height = `${printHeight}px`;
|
|
3562
|
+
cloneGanttDom.style.overflow = `unset`;
|
|
3563
|
+
cloneGanttContainerDom.style.backgroundColor = '#fff';
|
|
3564
|
+
cloneCalendarOverlay.setAttribute('height', `${printHeight}`);
|
|
3565
|
+
cloneCalendarOverlay.setAttribute('style', `background: transparent`);
|
|
3566
|
+
if (cloneLinksOverlay) {
|
|
3567
|
+
cloneLinksOverlay.setAttribute('height', `${printHeight}`);
|
|
3568
|
+
cloneLinksOverlay.setAttribute('style', `height: ${printHeight}px`);
|
|
3569
|
+
}
|
|
3570
|
+
// setInlineStyles for svg
|
|
3571
|
+
this.setInlineStyles(cloneGanttDom);
|
|
3572
|
+
}
|
|
3573
|
+
}).then((canvas) => {
|
|
3574
|
+
const link = document.createElement('a');
|
|
3575
|
+
const dataUrl = canvas.toDataURL('image/png');
|
|
3576
|
+
link.download = `${name}.png`;
|
|
3577
|
+
link.href = dataUrl;
|
|
3578
|
+
link.click();
|
|
3579
|
+
});
|
|
3580
|
+
}
|
|
3581
|
+
}
|
|
3582
|
+
GanttPrintService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: GanttPrintService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
3583
|
+
GanttPrintService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: GanttPrintService });
|
|
3584
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: GanttPrintService, decorators: [{
|
|
3585
|
+
type: Injectable
|
|
3586
|
+
}], ctorParameters: function () { return []; } });
|
|
3587
|
+
|
|
3496
3588
|
class NgxGanttToolbarComponent {
|
|
3497
3589
|
constructor(ganttUpper) {
|
|
3498
3590
|
this.ganttUpper = ganttUpper;
|
|
@@ -3522,6 +3614,9 @@ class NgxGanttRootComponent {
|
|
|
3522
3614
|
get view() {
|
|
3523
3615
|
return this.ganttUpper.view;
|
|
3524
3616
|
}
|
|
3617
|
+
onWindowResize() {
|
|
3618
|
+
this.computeScrollBarOffset();
|
|
3619
|
+
}
|
|
3525
3620
|
constructor(elementRef, ngZone, dom, dragContainer, ganttUpper, printService) {
|
|
3526
3621
|
this.elementRef = elementRef;
|
|
3527
3622
|
this.ngZone = ngZone;
|
|
@@ -3529,6 +3624,8 @@ class NgxGanttRootComponent {
|
|
|
3529
3624
|
this.dragContainer = dragContainer;
|
|
3530
3625
|
this.ganttUpper = ganttUpper;
|
|
3531
3626
|
this.printService = printService;
|
|
3627
|
+
this.verticalScrollbarWidth = 0;
|
|
3628
|
+
this.horizontalScrollbarHeight = 0;
|
|
3532
3629
|
this.unsubscribe$ = new Subject();
|
|
3533
3630
|
this.ganttUpper.dragContainer = dragContainer;
|
|
3534
3631
|
}
|
|
@@ -3552,9 +3649,24 @@ class NgxGanttRootComponent {
|
|
|
3552
3649
|
this.ganttUpper.viewChange.pipe(startWith$1(null), takeUntil(this.unsubscribe$)).subscribe(() => {
|
|
3553
3650
|
this.scrollToToday();
|
|
3554
3651
|
});
|
|
3652
|
+
this.computeScrollBarOffset();
|
|
3555
3653
|
});
|
|
3556
3654
|
});
|
|
3557
3655
|
}
|
|
3656
|
+
computeScrollBarOffset() {
|
|
3657
|
+
const ganttMainContainer = this.dom.mainContainer;
|
|
3658
|
+
const ganttVerticalScrollContainer = this.dom.verticalScrollContainer;
|
|
3659
|
+
let verticalScrollbarWidth = 0;
|
|
3660
|
+
if (ganttVerticalScrollContainer) {
|
|
3661
|
+
verticalScrollbarWidth = ganttVerticalScrollContainer.offsetWidth - ganttVerticalScrollContainer.clientWidth;
|
|
3662
|
+
}
|
|
3663
|
+
else {
|
|
3664
|
+
verticalScrollbarWidth = ganttMainContainer?.offsetWidth - ganttMainContainer?.clientWidth;
|
|
3665
|
+
}
|
|
3666
|
+
const horizontalScrollbarHeight = ganttMainContainer?.offsetHeight - ganttMainContainer?.clientHeight;
|
|
3667
|
+
this.verticalScrollbarWidth = verticalScrollbarWidth;
|
|
3668
|
+
this.horizontalScrollbarHeight = horizontalScrollbarHeight;
|
|
3669
|
+
}
|
|
3558
3670
|
ngOnDestroy() {
|
|
3559
3671
|
this.unsubscribe$.next();
|
|
3560
3672
|
}
|
|
@@ -3618,12 +3730,12 @@ class NgxGanttRootComponent {
|
|
|
3618
3730
|
}
|
|
3619
3731
|
}
|
|
3620
3732
|
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 });
|
|
3621
|
-
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:
|
|
3733
|
+
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"] }] });
|
|
3622
3734
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: NgxGanttRootComponent, decorators: [{
|
|
3623
3735
|
type: Component,
|
|
3624
3736
|
args: [{ selector: 'ngx-gantt-root', providers: [GanttDomService, GanttDragContainer], host: {
|
|
3625
3737
|
class: 'gantt'
|
|
3626
|
-
}, 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" }]
|
|
3738
|
+
}, 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" }]
|
|
3627
3739
|
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.NgZone }, { type: GanttDomService }, { type: GanttDragContainer }, { type: GanttUpper, decorators: [{
|
|
3628
3740
|
type: Inject,
|
|
3629
3741
|
args: [GANTT_UPPER_TOKEN]
|
|
@@ -3640,6 +3752,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImpor
|
|
|
3640
3752
|
}], backdrop: [{
|
|
3641
3753
|
type: ViewChild,
|
|
3642
3754
|
args: [GanttDragBackdropComponent, { static: true, read: ElementRef }]
|
|
3755
|
+
}], onWindowResize: [{
|
|
3756
|
+
type: HostListener,
|
|
3757
|
+
args: ['window:resize']
|
|
3643
3758
|
}] } });
|
|
3644
3759
|
|
|
3645
3760
|
class NgxGanttComponent extends GanttUpper {
|
|
@@ -3663,23 +3778,24 @@ class NgxGanttComponent extends GanttUpper {
|
|
|
3663
3778
|
get loading() {
|
|
3664
3779
|
return this._loading;
|
|
3665
3780
|
}
|
|
3666
|
-
constructor(elementRef, cdr, ngZone,
|
|
3781
|
+
constructor(elementRef, cdr, ngZone, viewportRuler, config) {
|
|
3667
3782
|
super(elementRef, cdr, ngZone, config);
|
|
3668
|
-
this.
|
|
3783
|
+
this.viewportRuler = viewportRuler;
|
|
3669
3784
|
this.maxLevel = 2;
|
|
3785
|
+
this.virtualScrollEnabled = true;
|
|
3670
3786
|
this.loadingDelay = 0;
|
|
3671
3787
|
this.linkDragStarted = new EventEmitter();
|
|
3672
3788
|
this.linkDragEnded = new EventEmitter();
|
|
3673
3789
|
this.lineClick = new EventEmitter();
|
|
3674
3790
|
this.selectedChange = new EventEmitter();
|
|
3675
|
-
this.
|
|
3676
|
-
this.
|
|
3791
|
+
this.flatItems = [];
|
|
3792
|
+
this.viewportItems = [];
|
|
3677
3793
|
this._loading = false;
|
|
3678
3794
|
this.computeAllRefs = false;
|
|
3679
3795
|
}
|
|
3680
3796
|
ngOnInit() {
|
|
3681
3797
|
super.ngOnInit();
|
|
3682
|
-
this.
|
|
3798
|
+
this.buildFlatItems();
|
|
3683
3799
|
// Note: the zone may be nooped through `BootstrapOptions` when bootstrapping the root module. This means
|
|
3684
3800
|
// the `onStable` will never emit any value.
|
|
3685
3801
|
const onStable$ = this.ngZone.isStable ? from(Promise.resolve()) : this.ngZone.onStable.pipe(take(1));
|
|
@@ -3701,32 +3817,51 @@ class NgxGanttComponent extends GanttUpper {
|
|
|
3701
3817
|
this.view.start$.pipe(skip(1), takeUntil(this.unsubscribe$)).subscribe(() => {
|
|
3702
3818
|
this.computeTempDataRefs();
|
|
3703
3819
|
});
|
|
3820
|
+
if (!this.virtualScrollEnabled) {
|
|
3821
|
+
this.viewportItems = this.flatItems.slice(this.rangeStart, this.rangeEnd);
|
|
3822
|
+
this.computeTempDataRefs();
|
|
3823
|
+
}
|
|
3704
3824
|
}
|
|
3705
3825
|
ngOnChanges(changes) {
|
|
3706
3826
|
super.ngOnChanges(changes);
|
|
3707
3827
|
if (!this.firstChange) {
|
|
3708
3828
|
if (changes.viewType && changes.viewType.currentValue) {
|
|
3709
|
-
this.
|
|
3829
|
+
this.viewportItems = this.flatItems.slice(this.rangeStart, this.rangeEnd);
|
|
3710
3830
|
this.computeTempDataRefs();
|
|
3711
3831
|
}
|
|
3712
3832
|
if (changes.originItems || changes.originGroups) {
|
|
3713
|
-
this.
|
|
3714
|
-
this.
|
|
3833
|
+
this.buildFlatItems();
|
|
3834
|
+
this.viewportItems = this.flatItems.slice(this.rangeStart, this.rangeEnd);
|
|
3715
3835
|
this.computeTempDataRefs();
|
|
3716
3836
|
}
|
|
3717
3837
|
}
|
|
3718
3838
|
}
|
|
3719
3839
|
ngAfterViewInit() {
|
|
3720
|
-
|
|
3721
|
-
|
|
3722
|
-
|
|
3723
|
-
|
|
3724
|
-
|
|
3725
|
-
|
|
3726
|
-
|
|
3727
|
-
|
|
3840
|
+
if (this.virtualScrollEnabled) {
|
|
3841
|
+
this.virtualScroll.renderedRangeStream.pipe(takeUntil(this.unsubscribe$)).subscribe((range) => {
|
|
3842
|
+
const linksElement = this.elementRef.nativeElement.querySelector('.gantt-links-overlay');
|
|
3843
|
+
linksElement.style.top = `${-(this.styles.lineHeight * range.start)}px`;
|
|
3844
|
+
this.rangeStart = range.start;
|
|
3845
|
+
this.rangeEnd = range.end;
|
|
3846
|
+
this.viewportItems = this.flatItems.slice(range.start, range.end);
|
|
3847
|
+
this.computeTempDataRefs();
|
|
3848
|
+
});
|
|
3849
|
+
}
|
|
3728
3850
|
}
|
|
3729
|
-
|
|
3851
|
+
ngAfterViewChecked() {
|
|
3852
|
+
if (this.virtualScrollEnabled && this.viewportRuler && this.virtualScroll.getRenderedRange().end > 0) {
|
|
3853
|
+
const onStable$ = this.ngZone.isStable ? from(Promise.resolve()) : this.ngZone.onStable.pipe(take(1));
|
|
3854
|
+
this.ngZone.runOutsideAngular(() => {
|
|
3855
|
+
onStable$.pipe(takeUntil(this.unsubscribe$)).subscribe(() => {
|
|
3856
|
+
if (!this.ganttRoot.verticalScrollbarWidth) {
|
|
3857
|
+
this.ganttRoot.computeScrollBarOffset();
|
|
3858
|
+
this.cdr.markForCheck();
|
|
3859
|
+
}
|
|
3860
|
+
});
|
|
3861
|
+
});
|
|
3862
|
+
}
|
|
3863
|
+
}
|
|
3864
|
+
buildFlatItems() {
|
|
3730
3865
|
const virtualData = [];
|
|
3731
3866
|
if (this.groups.length) {
|
|
3732
3867
|
this.groups.forEach((group) => {
|
|
@@ -3740,22 +3875,26 @@ class NgxGanttComponent extends GanttUpper {
|
|
|
3740
3875
|
if (this.items.length) {
|
|
3741
3876
|
virtualData.push(...recursiveItems(this.items));
|
|
3742
3877
|
}
|
|
3743
|
-
this.
|
|
3744
|
-
this.
|
|
3878
|
+
this.flatItems = [...virtualData];
|
|
3879
|
+
this.flatItemsMap = keyBy(this.flatItems, 'id');
|
|
3880
|
+
if (!this.virtualScrollEnabled) {
|
|
3881
|
+
this.rangeStart = 0;
|
|
3882
|
+
this.rangeEnd = this.flatItems.length - 1;
|
|
3883
|
+
}
|
|
3745
3884
|
}
|
|
3746
3885
|
afterExpand() {
|
|
3747
|
-
this.
|
|
3748
|
-
this.
|
|
3886
|
+
this.buildFlatItems();
|
|
3887
|
+
this.viewportItems = this.flatItems.slice(this.rangeStart, this.rangeEnd);
|
|
3749
3888
|
}
|
|
3750
3889
|
computeTempDataRefs() {
|
|
3751
3890
|
const tempItemData = [];
|
|
3752
|
-
this.
|
|
3891
|
+
this.viewportItems.forEach((data) => {
|
|
3753
3892
|
if (!data.hasOwnProperty('items')) {
|
|
3754
3893
|
const item = data;
|
|
3755
3894
|
if (item.links) {
|
|
3756
3895
|
item.links.forEach((link) => {
|
|
3757
|
-
if (this.
|
|
3758
|
-
tempItemData.push(this.
|
|
3896
|
+
if (this.flatItemsMap[link.link]) {
|
|
3897
|
+
tempItemData.push(this.flatItemsMap[link.link]);
|
|
3759
3898
|
}
|
|
3760
3899
|
});
|
|
3761
3900
|
}
|
|
@@ -3763,8 +3902,8 @@ class NgxGanttComponent extends GanttUpper {
|
|
|
3763
3902
|
}
|
|
3764
3903
|
});
|
|
3765
3904
|
this.computeItemsRefs(...uniqBy(tempItemData, 'id'));
|
|
3766
|
-
this.
|
|
3767
|
-
this.
|
|
3905
|
+
this.flatItems = [...this.flatItems];
|
|
3906
|
+
this.viewportItems = [...this.viewportItems];
|
|
3768
3907
|
}
|
|
3769
3908
|
expandChildren(item) {
|
|
3770
3909
|
if (!item.expanded) {
|
|
@@ -3832,8 +3971,8 @@ class NgxGanttComponent extends GanttUpper {
|
|
|
3832
3971
|
this.cdr.detectChanges();
|
|
3833
3972
|
}
|
|
3834
3973
|
}
|
|
3835
|
-
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:
|
|
3836
|
-
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: [
|
|
3974
|
+
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 });
|
|
3975
|
+
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: [
|
|
3837
3976
|
{
|
|
3838
3977
|
provide: GANTT_UPPER_TOKEN,
|
|
3839
3978
|
useExisting: NgxGanttComponent
|
|
@@ -3842,7 +3981,7 @@ NgxGanttComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", vers
|
|
|
3842
3981
|
provide: GANTT_ABSTRACT_TOKEN,
|
|
3843
3982
|
useExisting: forwardRef(() => NgxGanttComponent)
|
|
3844
3983
|
}
|
|
3845
|
-
], 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
|
|
3984
|
+
], 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 });
|
|
3846
3985
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: NgxGanttComponent, decorators: [{
|
|
3847
3986
|
type: Component,
|
|
3848
3987
|
args: [{ selector: 'ngx-gantt', changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
@@ -3854,10 +3993,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImpor
|
|
|
3854
3993
|
provide: GANTT_ABSTRACT_TOKEN,
|
|
3855
3994
|
useExisting: forwardRef(() => NgxGanttComponent)
|
|
3856
3995
|
}
|
|
3857
|
-
], 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
|
|
3858
|
-
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }, { type: i0.NgZone }, { type:
|
|
3859
|
-
type: Optional
|
|
3860
|
-
}] }, { type: undefined, decorators: [{
|
|
3996
|
+
], 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" }]
|
|
3997
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }, { type: i0.NgZone }, { type: i1$1.ViewportRuler }, { type: undefined, decorators: [{
|
|
3861
3998
|
type: Inject,
|
|
3862
3999
|
args: [GANTT_GLOBAL_CONFIG]
|
|
3863
4000
|
}] }]; }, propDecorators: { maxLevel: [{
|
|
@@ -3870,6 +4007,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImpor
|
|
|
3870
4007
|
type: Input
|
|
3871
4008
|
}], loading: [{
|
|
3872
4009
|
type: Input
|
|
4010
|
+
}], virtualScrollEnabled: [{
|
|
4011
|
+
type: Input
|
|
3873
4012
|
}], loadingDelay: [{
|
|
3874
4013
|
type: Input
|
|
3875
4014
|
}], linkDragStarted: [{
|
|
@@ -3903,11 +4042,9 @@ NgxGanttModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version:
|
|
|
3903
4042
|
NgxGanttModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.1.4", ngImport: i0, type: NgxGanttModule, declarations: [NgxGanttComponent,
|
|
3904
4043
|
NgxGanttTableComponent,
|
|
3905
4044
|
NgxGanttTableColumnComponent,
|
|
3906
|
-
// GanttTableComponent,
|
|
3907
4045
|
GanttTableHeaderComponent,
|
|
3908
4046
|
GanttTableBodyComponent,
|
|
3909
4047
|
GanttMainComponent,
|
|
3910
|
-
// GanttCalendarComponent,
|
|
3911
4048
|
GanttCalendarHeaderComponent,
|
|
3912
4049
|
GanttCalendarGridComponent,
|
|
3913
4050
|
GanttLinksComponent,
|
|
@@ -3954,11 +4091,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImpor
|
|
|
3954
4091
|
NgxGanttComponent,
|
|
3955
4092
|
NgxGanttTableComponent,
|
|
3956
4093
|
NgxGanttTableColumnComponent,
|
|
3957
|
-
// GanttTableComponent,
|
|
3958
4094
|
GanttTableHeaderComponent,
|
|
3959
4095
|
GanttTableBodyComponent,
|
|
3960
4096
|
GanttMainComponent,
|
|
3961
|
-
// GanttCalendarComponent,
|
|
3962
4097
|
GanttCalendarHeaderComponent,
|
|
3963
4098
|
GanttCalendarGridComponent,
|
|
3964
4099
|
GanttLinksComponent,
|