@worktile/gantt 15.1.0-next.1 → 15.1.0-next.3
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/components/bar/bar-drag.d.ts +18 -4
- package/components/bar/bar.component.scss +0 -22
- package/components/drag-backdrop/drag-backdrop.component.scss +1 -0
- package/esm2020/components/bar/bar-drag.mjs +106 -31
- package/esm2020/components/bar/bar.component.mjs +32 -27
- package/esm2020/components/table/body/gantt-table-body.component.mjs +9 -7
- package/esm2020/components/table/header/gantt-table-header.component.mjs +2 -2
- package/esm2020/gantt-abstract.mjs +1 -1
- package/esm2020/gantt-item-upper.mjs +8 -5
- package/esm2020/gantt.component.mjs +3 -3
- package/esm2020/table/gantt-column.component.mjs +8 -4
- package/esm2020/utils/drag-scroll.mjs +35 -0
- package/fesm2015/worktile-gantt.mjs +197 -72
- package/fesm2015/worktile-gantt.mjs.map +1 -1
- package/fesm2020/worktile-gantt.mjs +195 -72
- package/fesm2020/worktile-gantt.mjs.map +1 -1
- package/gantt-abstract.d.ts +2 -1
- package/gantt-item-upper.d.ts +1 -0
- package/package.json +1 -1
- package/table/gantt-column.component.d.ts +4 -2
- package/utils/drag-scroll.d.ts +20 -0
|
@@ -3,7 +3,7 @@ import { InjectionToken, EventEmitter, Directive, Inject, Input, Output, Content
|
|
|
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 as debounceTime$1, map, pairwise, auditTime, startWith as startWith$1, finalize } from 'rxjs/operators';
|
|
6
|
-
import { BehaviorSubject, Subject, from, takeUntil as takeUntil$1, startWith, debounceTime, filter, merge, EMPTY, fromEvent, Observable } from 'rxjs';
|
|
6
|
+
import { BehaviorSubject, Subject, from, takeUntil as takeUntil$1, startWith, debounceTime, filter, merge, EMPTY, fromEvent, Observable, interval, animationFrameScheduler } from 'rxjs';
|
|
7
7
|
import { fromUnixTime, getWeek, getDaysInMonth, differenceInCalendarDays, setDate, addSeconds, addMinutes, addHours, addDays, addWeeks, addMonths, addQuarters, addYears, startOfDay, startOfWeek, startOfMonth, startOfQuarter, startOfYear, endOfDay, endOfWeek, endOfMonth, endOfQuarter, endOfYear, getUnixTime, format, isWeekend, isToday, differenceInDays, differenceInCalendarQuarters, eachMonthOfInterval, eachYearOfInterval, eachWeekOfInterval, eachDayOfInterval, differenceInCalendarYears } from 'date-fns';
|
|
8
8
|
export { addDays, addHours, addMinutes, addMonths, addQuarters, addSeconds, addWeeks, addYears, differenceInCalendarDays, differenceInCalendarQuarters, differenceInDays, eachDayOfInterval, eachMonthOfInterval, eachWeekOfInterval, endOfDay, endOfMonth, endOfQuarter, endOfWeek, endOfYear, format, fromUnixTime, getDaysInMonth, getUnixTime, getWeek, isToday, isWeekend, setDate, startOfDay, startOfMonth, startOfQuarter, startOfWeek, startOfYear } from 'date-fns';
|
|
9
9
|
import { SelectionModel } from '@angular/cdk/collections';
|
|
@@ -1237,11 +1237,15 @@ class NgxGanttTableColumnComponent {
|
|
|
1237
1237
|
set width(width) {
|
|
1238
1238
|
this.columnWidth = coerceCssPixelValue(width);
|
|
1239
1239
|
}
|
|
1240
|
-
constructor(ganttUpper) {
|
|
1240
|
+
constructor(ganttUpper, elementRef) {
|
|
1241
1241
|
this.ganttUpper = ganttUpper;
|
|
1242
|
+
this.elementRef = elementRef;
|
|
1243
|
+
}
|
|
1244
|
+
get classList() {
|
|
1245
|
+
return this.elementRef.nativeElement.classList;
|
|
1242
1246
|
}
|
|
1243
1247
|
}
|
|
1244
|
-
NgxGanttTableColumnComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: NgxGanttTableColumnComponent, deps: [{ token: GANTT_UPPER_TOKEN }], target: i0.ɵɵFactoryTarget.Component });
|
|
1248
|
+
NgxGanttTableColumnComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: NgxGanttTableColumnComponent, deps: [{ token: GANTT_UPPER_TOKEN }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
1245
1249
|
NgxGanttTableColumnComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.4", type: NgxGanttTableColumnComponent, selector: "ngx-gantt-column", inputs: { width: "width", name: "name", showExpandIcon: "showExpandIcon" }, queries: [{ propertyName: "templateRef", first: true, predicate: ["cell"], descendants: true, static: true }, { propertyName: "headerTemplateRef", first: true, predicate: ["header"], descendants: true, static: true }], ngImport: i0, template: '', isInline: true });
|
|
1246
1250
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: NgxGanttTableColumnComponent, decorators: [{
|
|
1247
1251
|
type: Component,
|
|
@@ -1252,7 +1256,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImpor
|
|
|
1252
1256
|
}], ctorParameters: function () { return [{ type: GanttUpper, decorators: [{
|
|
1253
1257
|
type: Inject,
|
|
1254
1258
|
args: [GANTT_UPPER_TOKEN]
|
|
1255
|
-
}] }]; }, propDecorators: { width: [{
|
|
1259
|
+
}] }, { type: i0.ElementRef }]; }, propDecorators: { width: [{
|
|
1256
1260
|
type: Input
|
|
1257
1261
|
}], name: [{
|
|
1258
1262
|
type: Input
|
|
@@ -1421,7 +1425,7 @@ class GanttTableHeaderComponent {
|
|
|
1421
1425
|
this.columnsChange();
|
|
1422
1426
|
this.columns.changes.pipe(takeUntil$1(this.unsubscribe$)).subscribe(() => {
|
|
1423
1427
|
this.columnsChange();
|
|
1424
|
-
this.cdr.detectChanges();
|
|
1428
|
+
this.gantt.cdr.detectChanges();
|
|
1425
1429
|
});
|
|
1426
1430
|
}
|
|
1427
1431
|
columnsChange() {
|
|
@@ -1733,6 +1737,7 @@ class GanttTableBodyComponent {
|
|
|
1733
1737
|
this.columns.changes.pipe(startWith(this.columns), takeUntil$1(this.destroy$)).subscribe(() => {
|
|
1734
1738
|
this.hasExpandIcon = false;
|
|
1735
1739
|
this.columns.forEach((column) => {
|
|
1740
|
+
column.classList.add('gantt-table-column');
|
|
1736
1741
|
if (!column.columnWidth) {
|
|
1737
1742
|
column.columnWidth = coerceCssPixelValue(defaultColumnWidth);
|
|
1738
1743
|
}
|
|
@@ -1773,7 +1778,7 @@ class GanttTableBodyComponent {
|
|
|
1773
1778
|
onItemDragStarted(event) {
|
|
1774
1779
|
this.ganttTableDragging = true;
|
|
1775
1780
|
// 拖动开始时隐藏所有的子项
|
|
1776
|
-
const children = this.getChildrenElementsByElement(event.source.
|
|
1781
|
+
const children = this.getChildrenElementsByElement(event.source.element.nativeElement);
|
|
1777
1782
|
children.forEach((element) => {
|
|
1778
1783
|
element.classList.add('drag-item-hide');
|
|
1779
1784
|
});
|
|
@@ -1888,11 +1893,12 @@ class GanttTableBodyComponent {
|
|
|
1888
1893
|
return n.children?.includes(item);
|
|
1889
1894
|
});
|
|
1890
1895
|
}
|
|
1891
|
-
getChildrenElementsByElement(
|
|
1896
|
+
getChildrenElementsByElement(dragElement) {
|
|
1892
1897
|
// 通过循环持续查找 next element,如果 element 的 level 小于当前 item 的 level,则为它的 children
|
|
1893
1898
|
const children = [];
|
|
1894
|
-
const dragRef = this.itemDragRefMap.get(
|
|
1895
|
-
|
|
1899
|
+
const dragRef = this.itemDragRefMap.get(dragElement);
|
|
1900
|
+
// 如果当前的 Drag 正在拖拽,会创建 PlaceholderElement 占位,所以以 PlaceholderElement 向下查找
|
|
1901
|
+
let nextElement = (dragRef.getPlaceholderElement() || dragElement).nextElementSibling;
|
|
1896
1902
|
let nextDragRef = this.itemDragRefMap.get(nextElement);
|
|
1897
1903
|
while (nextDragRef && nextDragRef.data.level > dragRef.data.level) {
|
|
1898
1904
|
children.push(nextElement);
|
|
@@ -1932,10 +1938,10 @@ class GanttTableBodyComponent {
|
|
|
1932
1938
|
}
|
|
1933
1939
|
}
|
|
1934
1940
|
GanttTableBodyComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: GanttTableBodyComponent, deps: [{ token: GANTT_ABSTRACT_TOKEN }, { token: GANTT_UPPER_TOKEN }, { token: i0.ChangeDetectorRef }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Component });
|
|
1935
|
-
GanttTableBodyComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.4", type: GanttTableBodyComponent, selector: "gantt-table-body", inputs: { renderData: "renderData", flatData: "flatData", columns: "columns", groupTemplate: "groupTemplate", emptyTemplate: "emptyTemplate", rowBeforeTemplate: "rowBeforeTemplate", rowAfterTemplate: "rowAfterTemplate", draggable: "draggable", dropEnterPredicate: "dropEnterPredicate" }, outputs: { dragDropped: "dragDropped", itemClick: "itemClick" }, host: { properties: { "class.gantt-table-draggable": "this.draggable", "class.gantt-table-body": "this.ganttTableClass", "class.gantt-table-empty": "this.ganttTableEmptyClass", "class.gantt-table-dragging": "this.ganttTableDragging" } }, viewQueries: [{ propertyName: "cdkDrags", predicate: (CdkDrag), descendants: true }], ngImport: i0, template: "<div\n class=\"gantt-table-body-container\"\n cdkDropList\n [cdkDropListAutoScrollStep]=\"6\"\n [cdkDropListData]=\"renderData\"\n [cdkDropListSortingDisabled]=\"true\"\n (cdkDropListDropped)=\"onListDropped($event)\"\n>\n <ng-container *ngIf=\"!renderData?.length\">\n <ng-container *ngIf=\"!emptyTemplate\">\n <gantt-icon class=\"empty-icon\" iconName=\"empty\"></gantt-icon>\n <div class=\"empty-text\">\u6CA1\u6709\u6570\u636E</div>\n </ng-container>\n <ng-template [ngTemplateOutlet]=\"emptyTemplate\"></ng-template>\n </ng-container>\n\n <ng-container *ngIf=\"renderData && renderData.length > 0\">\n <ng-container *ngFor=\"let item of renderData; trackBy: trackBy\">\n <div class=\"gantt-table-group\" [ngClass]=\"item.class\" *ngIf=\"item.items\">\n <div class=\"gantt-table-group-title\" [class.expanded]=\"item.expanded\" (click)=\"expandGroup(item)\">\n <gantt-icon class=\"expand-icon\" [iconName]=\"item.expanded ? 'angle-down' : 'angle-right'\"></gantt-icon>\n <ng-container *ngIf=\"groupTemplate; else default\">\n <ng-template\n [ngTemplateOutlet]=\"groupTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: item.origin, group: item.origin }\"\n ></ng-template>\n </ng-container>\n <ng-template #default>\n <span class=\"group-title\">{{ item.title }}</span>\n </ng-template>\n </div>\n </div>\n\n <div\n *ngIf=\"!item.items\"\n (click)=\"itemClick.emit({ event: $event, selectedValue: item.origin })\"\n cdkDrag\n [cdkDragData]=\"item\"\n [cdkDragDisabled]=\"(draggable && item.itemDraggable === false) || !draggable\"\n (cdkDragStarted)=\"onItemDragStarted($event)\"\n (cdkDragEnded)=\"onItemDragEnded($event)\"\n (cdkDragMoved)=\"emitItemDragMoved($event)\"\n class=\"gantt-table-item\"\n [class.gantt-table-item-with-group]=\"hasGroup\"\n [class.gantt-table-item-first-level-group]=\"item.level === 0 && (item.type | isGanttRangeItem)\"\n [style.height.px]=\"gantt.styles.lineHeight\"\n [style.lineHeight.px]=\"gantt.styles.lineHeight\"\n [class.gantt-table-item-active]=\"ganttUpper.isSelected(item.id)\"\n >\n <ng-template\n [ngTemplateOutlet]=\"rowBeforeTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: item.origin, item: item.origin }\"\n ></ng-template>\n\n <div
|
|
1941
|
+
GanttTableBodyComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.4", type: GanttTableBodyComponent, selector: "gantt-table-body", inputs: { renderData: "renderData", flatData: "flatData", columns: "columns", groupTemplate: "groupTemplate", emptyTemplate: "emptyTemplate", rowBeforeTemplate: "rowBeforeTemplate", rowAfterTemplate: "rowAfterTemplate", draggable: "draggable", dropEnterPredicate: "dropEnterPredicate" }, outputs: { dragDropped: "dragDropped", itemClick: "itemClick" }, host: { properties: { "class.gantt-table-draggable": "this.draggable", "class.gantt-table-body": "this.ganttTableClass", "class.gantt-table-empty": "this.ganttTableEmptyClass", "class.gantt-table-dragging": "this.ganttTableDragging" } }, viewQueries: [{ propertyName: "cdkDrags", predicate: (CdkDrag), descendants: true }], ngImport: i0, template: "<div\n class=\"gantt-table-body-container\"\n cdkDropList\n [cdkDropListAutoScrollStep]=\"6\"\n [cdkDropListData]=\"renderData\"\n [cdkDropListSortingDisabled]=\"true\"\n (cdkDropListDropped)=\"onListDropped($event)\"\n>\n <ng-container *ngIf=\"!renderData?.length\">\n <ng-container *ngIf=\"!emptyTemplate\">\n <gantt-icon class=\"empty-icon\" iconName=\"empty\"></gantt-icon>\n <div class=\"empty-text\">\u6CA1\u6709\u6570\u636E</div>\n </ng-container>\n <ng-template [ngTemplateOutlet]=\"emptyTemplate\"></ng-template>\n </ng-container>\n\n <ng-container *ngIf=\"renderData && renderData.length > 0\">\n <ng-container *ngFor=\"let item of renderData; trackBy: trackBy\">\n <div class=\"gantt-table-group\" [ngClass]=\"item.class\" *ngIf=\"item.items\">\n <div class=\"gantt-table-group-title\" [class.expanded]=\"item.expanded\" (click)=\"expandGroup(item)\">\n <gantt-icon class=\"expand-icon\" [iconName]=\"item.expanded ? 'angle-down' : 'angle-right'\"></gantt-icon>\n <ng-container *ngIf=\"groupTemplate; else default\">\n <ng-template\n [ngTemplateOutlet]=\"groupTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: item.origin, group: item.origin }\"\n ></ng-template>\n </ng-container>\n <ng-template #default>\n <span class=\"group-title\">{{ item.title }}</span>\n </ng-template>\n </div>\n </div>\n\n <div\n *ngIf=\"!item.items\"\n (click)=\"itemClick.emit({ event: $event, selectedValue: item.origin })\"\n cdkDrag\n [cdkDragData]=\"item\"\n [cdkDragDisabled]=\"(draggable && item.itemDraggable === false) || !draggable\"\n (cdkDragStarted)=\"onItemDragStarted($event)\"\n (cdkDragEnded)=\"onItemDragEnded($event)\"\n (cdkDragMoved)=\"emitItemDragMoved($event)\"\n class=\"gantt-table-item\"\n [class.gantt-table-item-with-group]=\"hasGroup\"\n [class.gantt-table-item-first-level-group]=\"item.level === 0 && (item.type | isGanttRangeItem)\"\n [style.height.px]=\"gantt.styles.lineHeight\"\n [style.lineHeight.px]=\"gantt.styles.lineHeight\"\n [class.gantt-table-item-active]=\"ganttUpper.isSelected(item.id)\"\n >\n <ng-template\n [ngTemplateOutlet]=\"rowBeforeTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: item.origin, item: item.origin }\"\n ></ng-template>\n\n <div [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 && item.expandable\">\n <gantt-icon\n *ngIf=\"!item.loading\"\n class=\"expand-icon\"\n [iconName]=\"item.expanded ? 'angle-down' : 'angle-right'\"\n (click)=\"expandChildren($event, item)\"\n >\n </gantt-icon>\n <gantt-icon *ngIf=\"item.loading\" [iconName]=\"'loading'\"></gantt-icon>\n </ng-container>\n </div>\n <!-- column content -->\n <div class=\"gantt-table-column-content\">\n <ng-template\n [ngTemplateOutlet]=\"column.templateRef\"\n [ngTemplateOutletContext]=\"{ $implicit: item.origin, item: item.origin }\"\n ></ng-template>\n </div>\n </div>\n <ng-template\n [ngTemplateOutlet]=\"rowAfterTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: item.origin, item: item.origin }\"\n ></ng-template>\n </div>\n </ng-container>\n </ng-container>\n</div>\n", dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i2.CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "directive", type: i2.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "directive", type: i2.CdkDragHandle, selector: "[cdkDragHandle]", inputs: ["cdkDragHandleDisabled"] }, { kind: "component", type: GanttIconComponent, selector: "gantt-icon", inputs: ["iconName"] }, { kind: "pipe", type: IsGanttRangeItemPipe, name: "isGanttRangeItem" }] });
|
|
1936
1942
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: GanttTableBodyComponent, decorators: [{
|
|
1937
1943
|
type: Component,
|
|
1938
|
-
args: [{ selector: 'gantt-table-body', template: "<div\n class=\"gantt-table-body-container\"\n cdkDropList\n [cdkDropListAutoScrollStep]=\"6\"\n [cdkDropListData]=\"renderData\"\n [cdkDropListSortingDisabled]=\"true\"\n (cdkDropListDropped)=\"onListDropped($event)\"\n>\n <ng-container *ngIf=\"!renderData?.length\">\n <ng-container *ngIf=\"!emptyTemplate\">\n <gantt-icon class=\"empty-icon\" iconName=\"empty\"></gantt-icon>\n <div class=\"empty-text\">\u6CA1\u6709\u6570\u636E</div>\n </ng-container>\n <ng-template [ngTemplateOutlet]=\"emptyTemplate\"></ng-template>\n </ng-container>\n\n <ng-container *ngIf=\"renderData && renderData.length > 0\">\n <ng-container *ngFor=\"let item of renderData; trackBy: trackBy\">\n <div class=\"gantt-table-group\" [ngClass]=\"item.class\" *ngIf=\"item.items\">\n <div class=\"gantt-table-group-title\" [class.expanded]=\"item.expanded\" (click)=\"expandGroup(item)\">\n <gantt-icon class=\"expand-icon\" [iconName]=\"item.expanded ? 'angle-down' : 'angle-right'\"></gantt-icon>\n <ng-container *ngIf=\"groupTemplate; else default\">\n <ng-template\n [ngTemplateOutlet]=\"groupTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: item.origin, group: item.origin }\"\n ></ng-template>\n </ng-container>\n <ng-template #default>\n <span class=\"group-title\">{{ item.title }}</span>\n </ng-template>\n </div>\n </div>\n\n <div\n *ngIf=\"!item.items\"\n (click)=\"itemClick.emit({ event: $event, selectedValue: item.origin })\"\n cdkDrag\n [cdkDragData]=\"item\"\n [cdkDragDisabled]=\"(draggable && item.itemDraggable === false) || !draggable\"\n (cdkDragStarted)=\"onItemDragStarted($event)\"\n (cdkDragEnded)=\"onItemDragEnded($event)\"\n (cdkDragMoved)=\"emitItemDragMoved($event)\"\n class=\"gantt-table-item\"\n [class.gantt-table-item-with-group]=\"hasGroup\"\n [class.gantt-table-item-first-level-group]=\"item.level === 0 && (item.type | isGanttRangeItem)\"\n [style.height.px]=\"gantt.styles.lineHeight\"\n [style.lineHeight.px]=\"gantt.styles.lineHeight\"\n [class.gantt-table-item-active]=\"ganttUpper.isSelected(item.id)\"\n >\n <ng-template\n [ngTemplateOutlet]=\"rowBeforeTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: item.origin, item: item.origin }\"\n ></ng-template>\n\n <div
|
|
1944
|
+
args: [{ selector: 'gantt-table-body', template: "<div\n class=\"gantt-table-body-container\"\n cdkDropList\n [cdkDropListAutoScrollStep]=\"6\"\n [cdkDropListData]=\"renderData\"\n [cdkDropListSortingDisabled]=\"true\"\n (cdkDropListDropped)=\"onListDropped($event)\"\n>\n <ng-container *ngIf=\"!renderData?.length\">\n <ng-container *ngIf=\"!emptyTemplate\">\n <gantt-icon class=\"empty-icon\" iconName=\"empty\"></gantt-icon>\n <div class=\"empty-text\">\u6CA1\u6709\u6570\u636E</div>\n </ng-container>\n <ng-template [ngTemplateOutlet]=\"emptyTemplate\"></ng-template>\n </ng-container>\n\n <ng-container *ngIf=\"renderData && renderData.length > 0\">\n <ng-container *ngFor=\"let item of renderData; trackBy: trackBy\">\n <div class=\"gantt-table-group\" [ngClass]=\"item.class\" *ngIf=\"item.items\">\n <div class=\"gantt-table-group-title\" [class.expanded]=\"item.expanded\" (click)=\"expandGroup(item)\">\n <gantt-icon class=\"expand-icon\" [iconName]=\"item.expanded ? 'angle-down' : 'angle-right'\"></gantt-icon>\n <ng-container *ngIf=\"groupTemplate; else default\">\n <ng-template\n [ngTemplateOutlet]=\"groupTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: item.origin, group: item.origin }\"\n ></ng-template>\n </ng-container>\n <ng-template #default>\n <span class=\"group-title\">{{ item.title }}</span>\n </ng-template>\n </div>\n </div>\n\n <div\n *ngIf=\"!item.items\"\n (click)=\"itemClick.emit({ event: $event, selectedValue: item.origin })\"\n cdkDrag\n [cdkDragData]=\"item\"\n [cdkDragDisabled]=\"(draggable && item.itemDraggable === false) || !draggable\"\n (cdkDragStarted)=\"onItemDragStarted($event)\"\n (cdkDragEnded)=\"onItemDragEnded($event)\"\n (cdkDragMoved)=\"emitItemDragMoved($event)\"\n class=\"gantt-table-item\"\n [class.gantt-table-item-with-group]=\"hasGroup\"\n [class.gantt-table-item-first-level-group]=\"item.level === 0 && (item.type | isGanttRangeItem)\"\n [style.height.px]=\"gantt.styles.lineHeight\"\n [style.lineHeight.px]=\"gantt.styles.lineHeight\"\n [class.gantt-table-item-active]=\"ganttUpper.isSelected(item.id)\"\n >\n <ng-template\n [ngTemplateOutlet]=\"rowBeforeTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: item.origin, item: item.origin }\"\n ></ng-template>\n\n <div [classList]=\"column.classList\" *ngFor=\"let column of columns; let first = first\" [style.width]=\"column.columnWidth\">\n <!-- drag icon -->\n <gantt-icon\n *ngIf=\"first && draggable\"\n class=\"gantt-drag-handle\"\n iconName=\"drag\"\n cdkDragHandle\n [cdkDragHandleDisabled]=\"(draggable && item.itemDraggable === false) || !draggable\"\n ></gantt-icon>\n <!-- expand icon -->\n <div\n *ngIf=\"column?.showExpandIcon || (!hasExpandIcon && first)\"\n class=\"gantt-expand-icon\"\n [style.marginLeft.px]=\"item.level * 20\"\n >\n <ng-container *ngIf=\"item.level < gantt.maxLevel - 1 && item.expandable\">\n <gantt-icon\n *ngIf=\"!item.loading\"\n class=\"expand-icon\"\n [iconName]=\"item.expanded ? 'angle-down' : 'angle-right'\"\n (click)=\"expandChildren($event, item)\"\n >\n </gantt-icon>\n <gantt-icon *ngIf=\"item.loading\" [iconName]=\"'loading'\"></gantt-icon>\n </ng-container>\n </div>\n <!-- column content -->\n <div class=\"gantt-table-column-content\">\n <ng-template\n [ngTemplateOutlet]=\"column.templateRef\"\n [ngTemplateOutletContext]=\"{ $implicit: item.origin, item: item.origin }\"\n ></ng-template>\n </div>\n </div>\n <ng-template\n [ngTemplateOutlet]=\"rowAfterTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: item.origin, item: item.origin }\"\n ></ng-template>\n </div>\n </ng-container>\n </ng-container>\n</div>\n" }]
|
|
1939
1945
|
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
1940
1946
|
type: Inject,
|
|
1941
1947
|
args: [GANTT_ABSTRACT_TOKEN]
|
|
@@ -2452,6 +2458,41 @@ function normalizePassiveListenerOptions(options) {
|
|
|
2452
2458
|
/** Options used to bind passive event listeners. */
|
|
2453
2459
|
const passiveListenerOptions = normalizePassiveListenerOptions({ passive: true });
|
|
2454
2460
|
|
|
2461
|
+
/**
|
|
2462
|
+
* Proximity, as a ratio to width/height at which to start auto-scrolling the drop list or the
|
|
2463
|
+
* viewport. The value comes from trying it out manually until it feels right.
|
|
2464
|
+
*/
|
|
2465
|
+
const SCROLL_PROXIMITY_THRESHOLD = 0.05;
|
|
2466
|
+
/**
|
|
2467
|
+
* Gets whether the horizontal auto-scroll direction of a node.
|
|
2468
|
+
* @param clientRect Dimensions of the node.
|
|
2469
|
+
* @param pointerX Position of the user's pointer along the x axis.
|
|
2470
|
+
*/
|
|
2471
|
+
function getHorizontalScrollDirection(clientRect, pointerX) {
|
|
2472
|
+
const { left, right, width } = clientRect;
|
|
2473
|
+
const xThreshold = width * SCROLL_PROXIMITY_THRESHOLD;
|
|
2474
|
+
if (pointerX >= left - xThreshold && pointerX <= left + xThreshold) {
|
|
2475
|
+
return 1 /* AutoScrollHorizontalDirection.LEFT */;
|
|
2476
|
+
}
|
|
2477
|
+
else if (pointerX >= right - xThreshold && pointerX <= right + xThreshold) {
|
|
2478
|
+
return 2 /* AutoScrollHorizontalDirection.RIGHT */;
|
|
2479
|
+
}
|
|
2480
|
+
return 0 /* AutoScrollHorizontalDirection.NONE */;
|
|
2481
|
+
}
|
|
2482
|
+
/**
|
|
2483
|
+
* Checks whether the pointer coordinates are close to a ClientRect.
|
|
2484
|
+
* @param rect ClientRect to check against.
|
|
2485
|
+
* @param threshold Threshold around the ClientRect.
|
|
2486
|
+
* @param pointerX Coordinates along the X axis.
|
|
2487
|
+
* @param pointerY Coordinates along the Y axis.
|
|
2488
|
+
*/
|
|
2489
|
+
function isPointerNearClientRect(rect, threshold, pointerX, pointerY) {
|
|
2490
|
+
const { top, right, bottom, left, width, height } = rect;
|
|
2491
|
+
const xThreshold = width * threshold;
|
|
2492
|
+
const yThreshold = height * threshold;
|
|
2493
|
+
return pointerY > top - yThreshold && pointerY < bottom + yThreshold && pointerX > left - xThreshold && pointerX < right + xThreshold;
|
|
2494
|
+
}
|
|
2495
|
+
|
|
2455
2496
|
const scrollThreshold = 50;
|
|
2456
2497
|
var ScrollDirection;
|
|
2457
2498
|
(function (ScrollDirection) {
|
|
@@ -2836,8 +2877,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImpor
|
|
|
2836
2877
|
args: [GanttDragBackdropComponent, { static: true, read: ElementRef }]
|
|
2837
2878
|
}] } });
|
|
2838
2879
|
|
|
2880
|
+
/**
|
|
2881
|
+
* Proximity, as a ratio to width/height, at which a
|
|
2882
|
+
* dragged item will affect the drop container.
|
|
2883
|
+
*/
|
|
2884
|
+
const DROP_PROXIMITY_THRESHOLD = 0.05;
|
|
2839
2885
|
const dragMinWidth = 10;
|
|
2840
|
-
const autoScrollStep =
|
|
2886
|
+
const autoScrollStep = 5;
|
|
2841
2887
|
const activeClass = 'gantt-bar-active';
|
|
2842
2888
|
const dropActiveClass = 'gantt-bar-drop-active';
|
|
2843
2889
|
const singleDropActiveClass = 'gantt-bar-single-drop-active';
|
|
@@ -2853,19 +2899,44 @@ class GanttBarDrag {
|
|
|
2853
2899
|
get linkDragDisabled() {
|
|
2854
2900
|
return !this.item.linkable || !this.ganttUpper.linkable;
|
|
2855
2901
|
}
|
|
2856
|
-
constructor(dragDrop, dom, dragContainer, root) {
|
|
2902
|
+
constructor(dragDrop, dom, dragContainer, _ngZone, root) {
|
|
2857
2903
|
this.dragDrop = dragDrop;
|
|
2858
2904
|
this.dom = dom;
|
|
2859
2905
|
this.dragContainer = dragContainer;
|
|
2906
|
+
this._ngZone = _ngZone;
|
|
2860
2907
|
this.root = root;
|
|
2861
2908
|
this.dragRefs = [];
|
|
2862
2909
|
this.destroy$ = new Subject();
|
|
2863
|
-
|
|
2910
|
+
/** Used to signal to the current auto-scroll sequence when to stop. */
|
|
2911
|
+
this.stopScrollTimers$ = new Subject();
|
|
2912
|
+
/** move distance when drag bar */
|
|
2913
|
+
this.barDragMoveDistance = 0;
|
|
2914
|
+
/** move distance when drag bar handle */
|
|
2915
|
+
this.barHandleDragMoveDistance = 0;
|
|
2916
|
+
/** scrolling state when drag */
|
|
2864
2917
|
this.dragScrolling = false;
|
|
2918
|
+
/** dragScrollDistance */
|
|
2919
|
+
this.dragScrollDistance = 0;
|
|
2920
|
+
/** Horizontal direction in which the list is currently scrolling. */
|
|
2921
|
+
this._horizontalScrollDirection = 0 /* AutoScrollHorizontalDirection.NONE */;
|
|
2922
|
+
this.startScrollInterval = () => {
|
|
2923
|
+
this.stopScrolling();
|
|
2924
|
+
interval(0, animationFrameScheduler)
|
|
2925
|
+
.pipe(takeUntil(this.stopScrollTimers$))
|
|
2926
|
+
.subscribe(() => {
|
|
2927
|
+
const node = this.dom.mainContainer;
|
|
2928
|
+
const scrollStep = autoScrollStep;
|
|
2929
|
+
if (this._horizontalScrollDirection === 1 /* AutoScrollHorizontalDirection.LEFT */) {
|
|
2930
|
+
node.scrollBy(-scrollStep, 0);
|
|
2931
|
+
}
|
|
2932
|
+
else if (this._horizontalScrollDirection === 2 /* AutoScrollHorizontalDirection.RIGHT */) {
|
|
2933
|
+
node.scrollBy(scrollStep, 0);
|
|
2934
|
+
}
|
|
2935
|
+
});
|
|
2936
|
+
};
|
|
2865
2937
|
}
|
|
2866
2938
|
createDragRef(element) {
|
|
2867
2939
|
const dragRef = this.dragDrop.createDrag(element);
|
|
2868
|
-
// dragRef.withPreviewContainer(this.dom.mainContainer as HTMLElement);
|
|
2869
2940
|
return dragRef;
|
|
2870
2941
|
}
|
|
2871
2942
|
createDragScrollEvent(dragRef) {
|
|
@@ -2912,18 +2983,19 @@ class GanttBarDrag {
|
|
|
2912
2983
|
this.setDraggingStyles();
|
|
2913
2984
|
this.containerScrollLeft = this.dom.mainContainer.scrollLeft;
|
|
2914
2985
|
this.createDragScrollEvent(dragRef).subscribe(() => {
|
|
2915
|
-
if (
|
|
2916
|
-
this.
|
|
2917
|
-
|
|
2918
|
-
this.barDragMove(
|
|
2986
|
+
if (dragRef.isDragging()) {
|
|
2987
|
+
const dragScrollDistance = this.dom.mainContainer.scrollLeft - this.containerScrollLeft;
|
|
2988
|
+
this.dragScrollDistance = dragScrollDistance;
|
|
2989
|
+
this.barDragMove();
|
|
2919
2990
|
}
|
|
2920
2991
|
});
|
|
2921
2992
|
this.dragContainer.dragStarted.emit({ item: this.item.origin });
|
|
2922
2993
|
});
|
|
2923
2994
|
dragRef.moved.subscribe((event) => {
|
|
2924
|
-
this.
|
|
2995
|
+
this.startScrollingIfNecessary(event.pointerPosition.x, event.pointerPosition.y);
|
|
2996
|
+
this.barDragMoveDistance = event.distance.x;
|
|
2925
2997
|
if (!this.dragScrolling) {
|
|
2926
|
-
this.
|
|
2998
|
+
this.barDragMove();
|
|
2927
2999
|
}
|
|
2928
3000
|
});
|
|
2929
3001
|
dragRef.ended.subscribe((event) => {
|
|
@@ -2935,7 +3007,9 @@ class GanttBarDrag {
|
|
|
2935
3007
|
this.clearDraggingStyles();
|
|
2936
3008
|
this.closeDragBackdrop();
|
|
2937
3009
|
event.source.reset();
|
|
3010
|
+
this.stopScrolling();
|
|
2938
3011
|
this.dragScrolling = false;
|
|
3012
|
+
this.dragScrollDistance = 0;
|
|
2939
3013
|
this.barDragMoveDistance = 0;
|
|
2940
3014
|
this.dragContainer.dragEnded.emit({ item: this.item.origin });
|
|
2941
3015
|
});
|
|
@@ -2954,18 +3028,19 @@ class GanttBarDrag {
|
|
|
2954
3028
|
this.setDraggingStyles();
|
|
2955
3029
|
this.containerScrollLeft = this.dom.mainContainer.scrollLeft;
|
|
2956
3030
|
this.createDragScrollEvent(dragRef).subscribe(() => {
|
|
2957
|
-
if (
|
|
2958
|
-
this.
|
|
2959
|
-
|
|
2960
|
-
this.barHandleDragMove(
|
|
3031
|
+
if (dragRef.isDragging()) {
|
|
3032
|
+
const dragScrollDistance = this.dom.mainContainer.scrollLeft - this.containerScrollLeft;
|
|
3033
|
+
this.dragScrollDistance = dragScrollDistance;
|
|
3034
|
+
this.barHandleDragMove(isBefore);
|
|
2961
3035
|
}
|
|
2962
3036
|
});
|
|
2963
3037
|
this.dragContainer.dragStarted.emit({ item: this.item.origin });
|
|
2964
3038
|
});
|
|
2965
3039
|
dragRef.moved.subscribe((event) => {
|
|
2966
|
-
this.
|
|
3040
|
+
this.startScrollingIfNecessary(event.pointerPosition.x, event.pointerPosition.y);
|
|
3041
|
+
this.barHandleDragMoveDistance = event.distance.x;
|
|
2967
3042
|
if (!this.dragScrolling) {
|
|
2968
|
-
this.
|
|
3043
|
+
this.barHandleDragMove(isBefore);
|
|
2969
3044
|
}
|
|
2970
3045
|
});
|
|
2971
3046
|
dragRef.ended.subscribe((event) => {
|
|
@@ -2989,7 +3064,9 @@ class GanttBarDrag {
|
|
|
2989
3064
|
this.clearDraggingStyles();
|
|
2990
3065
|
this.closeDragBackdrop();
|
|
2991
3066
|
event.source.reset();
|
|
3067
|
+
this.stopScrolling();
|
|
2992
3068
|
this.dragScrolling = false;
|
|
3069
|
+
this.dragScrollDistance = 0;
|
|
2993
3070
|
this.barHandleDragMoveDistance = 0;
|
|
2994
3071
|
this.dragContainer.dragEnded.emit({ item: this.item.origin });
|
|
2995
3072
|
});
|
|
@@ -3082,8 +3159,8 @@ class GanttBarDrag {
|
|
|
3082
3159
|
this.barElement.style.pointerEvents = '';
|
|
3083
3160
|
this.barElement.classList.remove('gantt-bar-draggable-drag');
|
|
3084
3161
|
}
|
|
3085
|
-
barDragMove(
|
|
3086
|
-
const currentX = this.item.refs.x +
|
|
3162
|
+
barDragMove() {
|
|
3163
|
+
const currentX = this.item.refs.x + this.barDragMoveDistance + this.dragScrollDistance;
|
|
3087
3164
|
const currentDate = this.ganttUpper.view.getDateByXPoint(currentX);
|
|
3088
3165
|
const currentStartX = this.ganttUpper.view.getXPointByDate(currentDate);
|
|
3089
3166
|
const dayWidth = this.ganttUpper.view.getDayOccupancyWidth(currentDate);
|
|
@@ -3094,11 +3171,18 @@ class GanttBarDrag {
|
|
|
3094
3171
|
start = start.addDays(1);
|
|
3095
3172
|
end = end.addDays(1);
|
|
3096
3173
|
}
|
|
3097
|
-
|
|
3174
|
+
if (this.dragScrolling) {
|
|
3175
|
+
this.barElement.style.left = currentX - this.barDragMoveDistance + 'px';
|
|
3176
|
+
}
|
|
3177
|
+
this.openDragBackdrop(this.barElement, this.ganttUpper.view.getDateByXPoint(currentX), this.ganttUpper.view.getDateByXPoint(currentX + this.item.refs.width));
|
|
3178
|
+
if (!this.isStartOrEndInsideView(start, end)) {
|
|
3179
|
+
return;
|
|
3180
|
+
}
|
|
3098
3181
|
this.item.updateDate(start, end);
|
|
3099
3182
|
this.dragContainer.dragMoved.emit({ item: this.item.origin });
|
|
3100
3183
|
}
|
|
3101
|
-
barHandleDragMove(
|
|
3184
|
+
barHandleDragMove(isBefore) {
|
|
3185
|
+
const distance = this.barHandleDragMoveDistance + this.dragScrollDistance;
|
|
3102
3186
|
if (isBefore) {
|
|
3103
3187
|
const x = this.item.refs.x + distance;
|
|
3104
3188
|
const width = this.item.refs.width + distance * -1;
|
|
@@ -3107,6 +3191,9 @@ class GanttBarDrag {
|
|
|
3107
3191
|
this.barElement.style.width = width + 'px';
|
|
3108
3192
|
this.barElement.style.left = x + 'px';
|
|
3109
3193
|
this.openDragBackdrop(this.barElement, start, this.item.end);
|
|
3194
|
+
if (!this.isStartOrEndInsideView(start, this.item.end)) {
|
|
3195
|
+
return;
|
|
3196
|
+
}
|
|
3110
3197
|
this.item.updateDate(start, this.item.end);
|
|
3111
3198
|
}
|
|
3112
3199
|
}
|
|
@@ -3116,6 +3203,9 @@ class GanttBarDrag {
|
|
|
3116
3203
|
if (width > dragMinWidth) {
|
|
3117
3204
|
this.barElement.style.width = width + 'px';
|
|
3118
3205
|
this.openDragBackdrop(this.barElement, this.item.start, end);
|
|
3206
|
+
if (!this.isStartOrEndInsideView(this.item.start, end)) {
|
|
3207
|
+
return;
|
|
3208
|
+
}
|
|
3119
3209
|
this.item.updateDate(this.item.start, end);
|
|
3120
3210
|
}
|
|
3121
3211
|
}
|
|
@@ -3148,6 +3238,36 @@ class GanttBarDrag {
|
|
|
3148
3238
|
this.linkDraggingLine = null;
|
|
3149
3239
|
}
|
|
3150
3240
|
}
|
|
3241
|
+
startScrollingIfNecessary(pointerX, pointerY) {
|
|
3242
|
+
const clientRect = this.dom.mainContainer.getBoundingClientRect();
|
|
3243
|
+
if (isPointerNearClientRect(clientRect, DROP_PROXIMITY_THRESHOLD, pointerX, pointerY)) {
|
|
3244
|
+
const horizontalScrollDirection = getHorizontalScrollDirection(clientRect, pointerX);
|
|
3245
|
+
if (horizontalScrollDirection) {
|
|
3246
|
+
this._horizontalScrollDirection = horizontalScrollDirection;
|
|
3247
|
+
this.dragScrolling = true;
|
|
3248
|
+
this._ngZone.runOutsideAngular(this.startScrollInterval);
|
|
3249
|
+
}
|
|
3250
|
+
else {
|
|
3251
|
+
this.dragScrolling = false;
|
|
3252
|
+
this.stopScrolling();
|
|
3253
|
+
}
|
|
3254
|
+
}
|
|
3255
|
+
}
|
|
3256
|
+
stopScrolling() {
|
|
3257
|
+
this.stopScrollTimers$.next();
|
|
3258
|
+
}
|
|
3259
|
+
isStartOrEndInsideView(start, end) {
|
|
3260
|
+
const itemStart = start.getUnixTime();
|
|
3261
|
+
const itemEnd = end.getUnixTime();
|
|
3262
|
+
const viewStart = this.ganttUpper.view.start.getUnixTime();
|
|
3263
|
+
const viewEnd = this.ganttUpper.view.end.getUnixTime();
|
|
3264
|
+
if (itemStart < viewStart || itemEnd > viewEnd) {
|
|
3265
|
+
return false;
|
|
3266
|
+
}
|
|
3267
|
+
else {
|
|
3268
|
+
return true;
|
|
3269
|
+
}
|
|
3270
|
+
}
|
|
3151
3271
|
createDrags(elementRef, item, ganttUpper) {
|
|
3152
3272
|
this.item = item;
|
|
3153
3273
|
this.barElement = elementRef.nativeElement;
|
|
@@ -3161,13 +3281,6 @@ class GanttBarDrag {
|
|
|
3161
3281
|
const dragRef = this.createBarDrag();
|
|
3162
3282
|
const dragHandlesRefs = this.createBarHandleDrags();
|
|
3163
3283
|
this.dragRefs.push(dragRef, ...dragHandlesRefs);
|
|
3164
|
-
// 创建拖拽容器并将所有元素添加到容器中,利用容器来实现自动滚动
|
|
3165
|
-
if (!this.dropListRef) {
|
|
3166
|
-
this.dropListRef = this.dragDrop.createDropList(this.dom.mainContainer);
|
|
3167
|
-
this.dropListRef.autoScrollStep = autoScrollStep;
|
|
3168
|
-
this.dropListRef.withOrientation('horizontal');
|
|
3169
|
-
}
|
|
3170
|
-
this.dropListRef.withItems([dragRef, ...dragHandlesRefs]);
|
|
3171
3284
|
}
|
|
3172
3285
|
if (!this.linkDragDisabled) {
|
|
3173
3286
|
const linkDragRefs = this.createLinkHandleDrags();
|
|
@@ -3183,13 +3296,15 @@ class GanttBarDrag {
|
|
|
3183
3296
|
this.dragRefs.forEach((dragRef) => dragRef.dispose());
|
|
3184
3297
|
this.destroy$.next();
|
|
3185
3298
|
this.destroy$.complete();
|
|
3299
|
+
this.stopScrolling();
|
|
3300
|
+
this.stopScrollTimers$.complete();
|
|
3186
3301
|
}
|
|
3187
3302
|
}
|
|
3188
|
-
GanttBarDrag.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: GanttBarDrag, deps: [{ token: i2.DragDrop }, { token: GanttDomService }, { token: GanttDragContainer }, { token: NgxGanttRootComponent, skipSelf: true }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
3303
|
+
GanttBarDrag.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: GanttBarDrag, deps: [{ token: i2.DragDrop }, { token: GanttDomService }, { token: GanttDragContainer }, { token: i0.NgZone }, { token: NgxGanttRootComponent, skipSelf: true }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
3189
3304
|
GanttBarDrag.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: GanttBarDrag });
|
|
3190
3305
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: GanttBarDrag, decorators: [{
|
|
3191
3306
|
type: Injectable
|
|
3192
|
-
}], ctorParameters: function () { return [{ type: i2.DragDrop }, { type: GanttDomService }, { type: GanttDragContainer }, { type: NgxGanttRootComponent, decorators: [{
|
|
3307
|
+
}], ctorParameters: function () { return [{ type: i2.DragDrop }, { type: GanttDomService }, { type: GanttDragContainer }, { type: i0.NgZone }, { type: NgxGanttRootComponent, decorators: [{
|
|
3193
3308
|
type: SkipSelf
|
|
3194
3309
|
}] }]; } });
|
|
3195
3310
|
|
|
@@ -3199,10 +3314,11 @@ class GanttItemUpper {
|
|
|
3199
3314
|
this.ganttUpper = ganttUpper;
|
|
3200
3315
|
this.firstChange = true;
|
|
3201
3316
|
this.unsubscribe$ = new Subject();
|
|
3317
|
+
this.refsUnsubscribe$ = new Subject();
|
|
3202
3318
|
}
|
|
3203
3319
|
ngOnInit() {
|
|
3204
3320
|
this.firstChange = false;
|
|
3205
|
-
this.item.refs$.pipe(takeUntil(this.
|
|
3321
|
+
this.item.refs$.pipe(takeUntil(this.refsUnsubscribe$)).subscribe(() => {
|
|
3206
3322
|
this.setPositions();
|
|
3207
3323
|
});
|
|
3208
3324
|
}
|
|
@@ -3212,11 +3328,11 @@ class GanttItemUpper {
|
|
|
3212
3328
|
}
|
|
3213
3329
|
}
|
|
3214
3330
|
itemChange(item) {
|
|
3215
|
-
this.
|
|
3216
|
-
this.
|
|
3331
|
+
this.refsUnsubscribe$.next();
|
|
3332
|
+
this.refsUnsubscribe$.complete();
|
|
3217
3333
|
this.item = item;
|
|
3218
3334
|
this.setPositions();
|
|
3219
|
-
this.item.refs$.pipe(takeUntil(this.
|
|
3335
|
+
this.item.refs$.pipe(takeUntil(this.refsUnsubscribe$)).subscribe(() => {
|
|
3220
3336
|
this.setPositions();
|
|
3221
3337
|
});
|
|
3222
3338
|
}
|
|
@@ -3235,6 +3351,8 @@ class GanttItemUpper {
|
|
|
3235
3351
|
ngOnDestroy() {
|
|
3236
3352
|
this.unsubscribe$.next();
|
|
3237
3353
|
this.unsubscribe$.complete();
|
|
3354
|
+
this.refsUnsubscribe$.next();
|
|
3355
|
+
this.refsUnsubscribe$.complete();
|
|
3238
3356
|
}
|
|
3239
3357
|
}
|
|
3240
3358
|
GanttItemUpper.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: GanttItemUpper, deps: [{ token: i0.ElementRef }, { token: GANTT_UPPER_TOKEN }], target: i0.ɵɵFactoryTarget.Directive });
|
|
@@ -3273,6 +3391,9 @@ class NgxGanttBarComponent extends GanttItemUpper {
|
|
|
3273
3391
|
super.ngOnChanges(changes);
|
|
3274
3392
|
if (!this.firstChange) {
|
|
3275
3393
|
this.drag.updateItem(this.item);
|
|
3394
|
+
if (changes.item.currentValue.refs?.width !== changes.item.previousValue.refs?.width) {
|
|
3395
|
+
this.setContentBackground();
|
|
3396
|
+
}
|
|
3276
3397
|
}
|
|
3277
3398
|
}
|
|
3278
3399
|
ngAfterViewInit() {
|
|
@@ -3300,30 +3421,32 @@ class NgxGanttBarComponent extends GanttItemUpper {
|
|
|
3300
3421
|
this.barClick.emit({ event, item: this.item.origin });
|
|
3301
3422
|
}
|
|
3302
3423
|
setContentBackground() {
|
|
3303
|
-
|
|
3304
|
-
|
|
3305
|
-
|
|
3306
|
-
|
|
3307
|
-
|
|
3308
|
-
|
|
3309
|
-
|
|
3310
|
-
|
|
3311
|
-
|
|
3312
|
-
|
|
3313
|
-
|
|
3314
|
-
|
|
3315
|
-
|
|
3316
|
-
|
|
3317
|
-
|
|
3318
|
-
|
|
3319
|
-
|
|
3320
|
-
|
|
3321
|
-
|
|
3322
|
-
|
|
3323
|
-
|
|
3324
|
-
|
|
3325
|
-
|
|
3326
|
-
|
|
3424
|
+
if (this.item.refs?.width) {
|
|
3425
|
+
const contentElement = this.contentElementRef.nativeElement;
|
|
3426
|
+
const color = this.item.color || barBackground;
|
|
3427
|
+
const style = this.item.barStyle || {};
|
|
3428
|
+
if (this.item.origin.start && this.item.origin.end) {
|
|
3429
|
+
style.background = color;
|
|
3430
|
+
style.borderRadius = '';
|
|
3431
|
+
}
|
|
3432
|
+
if (this.item.origin.start && !this.item.origin.end) {
|
|
3433
|
+
style.background = linearGradient('to left', hexToRgb(color, 0.55), hexToRgb(color, 1));
|
|
3434
|
+
style.borderRadius = '4px 12.5px 12.5px 4px';
|
|
3435
|
+
}
|
|
3436
|
+
if (!this.item.origin.start && this.item.origin.end) {
|
|
3437
|
+
style.background = linearGradient('to right', hexToRgb(color, 0.55), hexToRgb(color, 1));
|
|
3438
|
+
style.borderRadius = '12.5px 4px 4px 12.5px';
|
|
3439
|
+
}
|
|
3440
|
+
if (this.item.progress >= 0) {
|
|
3441
|
+
const contentProgressElement = contentElement.querySelector('.gantt-bar-content-progress');
|
|
3442
|
+
style.background = hexToRgb(color, 0.3);
|
|
3443
|
+
style.borderRadius = '';
|
|
3444
|
+
contentProgressElement.style.background = color;
|
|
3445
|
+
}
|
|
3446
|
+
for (const key in style) {
|
|
3447
|
+
if (style.hasOwnProperty(key)) {
|
|
3448
|
+
contentElement.style[key] = style[key];
|
|
3449
|
+
}
|
|
3327
3450
|
}
|
|
3328
3451
|
}
|
|
3329
3452
|
}
|
|
@@ -3332,10 +3455,10 @@ class NgxGanttBarComponent extends GanttItemUpper {
|
|
|
3332
3455
|
}
|
|
3333
3456
|
}
|
|
3334
3457
|
NgxGanttBarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: NgxGanttBarComponent, deps: [{ token: GanttDragContainer }, { token: GanttBarDrag }, { token: i0.ElementRef }, { token: GANTT_UPPER_TOKEN }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
|
|
3335
|
-
NgxGanttBarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.4", type: NgxGanttBarComponent, selector: "ngx-gantt-bar,gantt-bar", outputs: { barClick: "barClick" }, host: { properties: { "class.gantt-bar": "this.ganttItemClass" } }, providers: [GanttBarDrag], viewQueries: [{ propertyName: "contentElementRef", first: true, predicate: ["content"], descendants: true }, { propertyName: "handles", predicate: ["handle"], descendants: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<div class=\"gantt-bar-layer\">\n <div class=\"drag-handles\">\n <ng-container *ngIf=\"item.draggable && ganttUpper.draggable\">\n <span class=\"handle\" #handle></span>\n <span class=\"handle\" #handle></span>\n </ng-container>\n </div>\n <div *ngIf=\"item.linkable && ganttUpper.linkable\" class=\"link-handles\">\n <span class=\"handle\"><span class=\"point\"></span></span>\n <span class=\"handle\"> <span class=\"point\"></span></span>\n </div>\n</div>\n<div class=\"gantt-bar-border\"></div>\n<div #content class=\"gantt-bar-content\" (click)=\"onBarClick($event)\">\n <div class=\"gantt-bar-content-progress\" *ngIf=\"item.progress >= 0\" [style.width.%]=\"item.progress * 100\"></div>\n <ng-template [ngTemplateOutlet]=\"template\" [ngTemplateOutletContext]=\"{ item: item.origin, refs: item.refs }\"
|
|
3458
|
+
NgxGanttBarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.4", type: NgxGanttBarComponent, selector: "ngx-gantt-bar,gantt-bar", outputs: { barClick: "barClick" }, host: { properties: { "class.gantt-bar": "this.ganttItemClass" } }, providers: [GanttBarDrag], viewQueries: [{ propertyName: "contentElementRef", first: true, predicate: ["content"], descendants: true }, { propertyName: "handles", predicate: ["handle"], descendants: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<div class=\"gantt-bar-layer\">\n <div class=\"drag-handles\">\n <ng-container *ngIf=\"item.draggable && ganttUpper.draggable\">\n <span class=\"handle\" #handle></span>\n <span class=\"handle\" #handle></span>\n </ng-container>\n </div>\n <div *ngIf=\"item.linkable && ganttUpper.linkable\" class=\"link-handles\">\n <span class=\"handle\"><span class=\"point\"></span></span>\n <span class=\"handle\"> <span class=\"point\"></span></span>\n </div>\n</div>\n<div class=\"gantt-bar-border\"></div>\n<div #content class=\"gantt-bar-content\" (click)=\"onBarClick($event)\">\n <div class=\"gantt-bar-content-progress\" *ngIf=\"item.progress >= 0\" [style.width.%]=\"item.progress * 100\"></div>\n <ng-template [ngTemplateOutlet]=\"template\" [ngTemplateOutletContext]=\"{ item: item.origin, refs: item.refs }\"> </ng-template>\n</div>\n", dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
|
|
3336
3459
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: NgxGanttBarComponent, decorators: [{
|
|
3337
3460
|
type: Component,
|
|
3338
|
-
args: [{ selector: 'ngx-gantt-bar,gantt-bar', providers: [GanttBarDrag], template: "<div class=\"gantt-bar-layer\">\n <div class=\"drag-handles\">\n <ng-container *ngIf=\"item.draggable && ganttUpper.draggable\">\n <span class=\"handle\" #handle></span>\n <span class=\"handle\" #handle></span>\n </ng-container>\n </div>\n <div *ngIf=\"item.linkable && ganttUpper.linkable\" class=\"link-handles\">\n <span class=\"handle\"><span class=\"point\"></span></span>\n <span class=\"handle\"> <span class=\"point\"></span></span>\n </div>\n</div>\n<div class=\"gantt-bar-border\"></div>\n<div #content class=\"gantt-bar-content\" (click)=\"onBarClick($event)\">\n <div class=\"gantt-bar-content-progress\" *ngIf=\"item.progress >= 0\" [style.width.%]=\"item.progress * 100\"></div>\n <ng-template [ngTemplateOutlet]=\"template\" [ngTemplateOutletContext]=\"{ item: item.origin, refs: item.refs }\"
|
|
3461
|
+
args: [{ selector: 'ngx-gantt-bar,gantt-bar', providers: [GanttBarDrag], template: "<div class=\"gantt-bar-layer\">\n <div class=\"drag-handles\">\n <ng-container *ngIf=\"item.draggable && ganttUpper.draggable\">\n <span class=\"handle\" #handle></span>\n <span class=\"handle\" #handle></span>\n </ng-container>\n </div>\n <div *ngIf=\"item.linkable && ganttUpper.linkable\" class=\"link-handles\">\n <span class=\"handle\"><span class=\"point\"></span></span>\n <span class=\"handle\"> <span class=\"point\"></span></span>\n </div>\n</div>\n<div class=\"gantt-bar-border\"></div>\n<div #content class=\"gantt-bar-content\" (click)=\"onBarClick($event)\">\n <div class=\"gantt-bar-content-progress\" *ngIf=\"item.progress >= 0\" [style.width.%]=\"item.progress * 100\"></div>\n <ng-template [ngTemplateOutlet]=\"template\" [ngTemplateOutletContext]=\"{ item: item.origin, refs: item.refs }\"> </ng-template>\n</div>\n" }]
|
|
3339
3462
|
}], ctorParameters: function () { return [{ type: GanttDragContainer }, { type: GanttBarDrag }, { type: i0.ElementRef }, { type: GanttUpper, decorators: [{
|
|
3340
3463
|
type: Inject,
|
|
3341
3464
|
args: [GANTT_UPPER_TOKEN]
|
|
@@ -3672,7 +3795,7 @@ NgxGanttComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", vers
|
|
|
3672
3795
|
provide: GANTT_ABSTRACT_TOKEN,
|
|
3673
3796
|
useExisting: forwardRef(() => NgxGanttComponent)
|
|
3674
3797
|
}
|
|
3675
|
-
], queries: [{ propertyName: "table", first: true, predicate: NgxGanttTableComponent, descendants: true }, { propertyName: "tableEmptyTemplate", first: true, predicate: ["tableEmpty"], descendants: true, static: true }, { propertyName: "columns", predicate: NgxGanttTableColumnComponent, descendants: true }], viewQueries: [{ propertyName: "ganttRoot", first: true, predicate: ["ganttRoot"], descendants: true }, { propertyName: "virtualScroll", first: true, predicate: CdkVirtualScrollViewport, descendants: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<ngx-gantt-root #ganttRoot>\n <div class=\"gantt-header\">\n <gantt-table-header #tableHeader [columns]=\"columns\"></gantt-table-header>\n <div class=\"gantt-container-header\">\n <gantt-calendar-header></gantt-calendar-header>\n </div>\n </div>\n <gantt-loader *ngIf=\"loading\"></gantt-loader>\n <cdk-virtual-scroll-viewport\n class=\"gantt-virtual-scroll-viewport\"\n [itemSize]=\"styles.lineHeight\"\n [minBufferPx]=\"styles.lineHeight * 10\"\n [maxBufferPx]=\"styles.lineHeight * 20\"\n >\n <ng-container *cdkVirtualFor=\"let item of flatData; trackBy: trackBy\"></ng-container>\n <div class=\"gantt-side\" [style.width.px]=\"tableHeader.tableWidth + 1\">\n <div class=\"gantt-side-container\">\n <div class=\"gantt-table\">\n <gantt-table-body\n [flatData]=\"flatData\"\n [renderData]=\"renderData\"\n [columns]=\"columns\"\n [groupTemplate]=\"groupTemplate\"\n [emptyTemplate]=\"tableEmptyTemplate\"\n [rowBeforeTemplate]=\"table?.rowBeforeTemplate\"\n [rowAfterTemplate]=\"table?.rowAfterTemplate\"\n [draggable]=\"table.draggable\"\n [dropEnterPredicate]=\"table.dropEnterPredicate\"\n (dragDropped)=\"table.dragDropped.emit($event)\"\n (itemClick)=\"selectItem($event)\"\n ></gantt-table-body>\n </div>\n </div>\n </div>\n <div class=\"gantt-container\">\n <gantt-calendar-grid></gantt-calendar-grid>\n <div class=\"gantt-main\">\n <gantt-main\n [flatData]=\"flatData\"\n [renderData]=\"renderData\"\n [groupHeaderTemplate]=\"groupHeaderTemplate\"\n [itemTemplate]=\"itemTemplate\"\n [barTemplate]=\"barTemplate\"\n [rangeTemplate]=\"rangeTemplate\"\n (barClick)=\"barClick.emit($event)\"\n (lineClick)=\"lineClick.emit($event)\"\n >\n </gantt-main>\n </div>\n </div>\n </cdk-virtual-scroll-viewport>\n <gantt-drag-backdrop [style.left.px]=\"tableHeader.tableWidth + 1\"></gantt-drag-backdrop>\n</ngx-gantt-root>\n", dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.CdkFixedSizeVirtualScroll, selector: "cdk-virtual-scroll-viewport[itemSize]", inputs: ["itemSize", "minBufferPx", "maxBufferPx"] }, { kind: "directive", type: i3.CdkVirtualForOf, selector: "[cdkVirtualFor][cdkVirtualForOf]", inputs: ["cdkVirtualForOf", "cdkVirtualForTrackBy", "cdkVirtualForTemplate", "cdkVirtualForTemplateCacheSize"] }, { kind: "component", type: i3.CdkVirtualScrollViewport, selector: "cdk-virtual-scroll-viewport", inputs: ["orientation", "appendOnly"], outputs: ["scrolledIndexChange"] }, { kind: "component", type: GanttTableHeaderComponent, selector: "gantt-table-header", inputs: ["columns"] }, { kind: "component", type: GanttTableBodyComponent, selector: "gantt-table-body", inputs: ["renderData", "flatData", "columns", "groupTemplate", "emptyTemplate", "rowBeforeTemplate", "rowAfterTemplate", "draggable", "dropEnterPredicate"], outputs: ["dragDropped", "itemClick"] }, { kind: "component", type: GanttMainComponent, selector: "gantt-main", inputs: ["renderData", "flatData", "groupHeaderTemplate", "itemTemplate", "barTemplate", "rangeTemplate"], outputs: ["barClick", "lineClick"] }, { kind: "component", type: GanttCalendarHeaderComponent, selector: "gantt-calendar-header" }, { kind: "component", type: GanttCalendarGridComponent, selector: "gantt-calendar-grid" }, { kind: "component", type: GanttLoaderComponent, selector: "gantt-loader" }, { kind: "component", type: GanttDragBackdropComponent, selector: "gantt-drag-backdrop" }, { kind: "component", type: NgxGanttRootComponent, selector: "ngx-gantt-root", inputs: ["sideWidth"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
3798
|
+
], queries: [{ propertyName: "table", first: true, predicate: NgxGanttTableComponent, descendants: true }, { propertyName: "tableEmptyTemplate", first: true, predicate: ["tableEmpty"], descendants: true, static: true }, { propertyName: "columns", predicate: NgxGanttTableColumnComponent, descendants: true }], viewQueries: [{ propertyName: "ganttRoot", first: true, predicate: ["ganttRoot"], descendants: true }, { propertyName: "virtualScroll", first: true, predicate: CdkVirtualScrollViewport, descendants: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<ngx-gantt-root #ganttRoot>\n <div class=\"gantt-header\">\n <gantt-table-header #tableHeader [columns]=\"columns\"></gantt-table-header>\n <div class=\"gantt-container-header\">\n <gantt-calendar-header></gantt-calendar-header>\n </div>\n </div>\n <gantt-loader *ngIf=\"loading\"></gantt-loader>\n\n <cdk-virtual-scroll-viewport\n class=\"gantt-virtual-scroll-viewport\"\n [itemSize]=\"styles.lineHeight\"\n [minBufferPx]=\"styles.lineHeight * 10\"\n [maxBufferPx]=\"styles.lineHeight * 20\"\n >\n <ng-container *cdkVirtualFor=\"let item of flatData; trackBy: trackBy\"></ng-container>\n <div class=\"gantt-side\" [style.width.px]=\"tableHeader.tableWidth + 1\">\n <div class=\"gantt-side-container\">\n <div class=\"gantt-table\">\n <gantt-table-body\n [flatData]=\"flatData\"\n [renderData]=\"renderData\"\n [columns]=\"columns\"\n [groupTemplate]=\"groupTemplate\"\n [emptyTemplate]=\"tableEmptyTemplate\"\n [rowBeforeTemplate]=\"table?.rowBeforeTemplate\"\n [rowAfterTemplate]=\"table?.rowAfterTemplate\"\n [draggable]=\"table.draggable\"\n [dropEnterPredicate]=\"table.dropEnterPredicate\"\n (dragDropped)=\"table.dragDropped.emit($event)\"\n (itemClick)=\"selectItem($event)\"\n ></gantt-table-body>\n </div>\n </div>\n </div>\n\n <div class=\"gantt-container\">\n <gantt-calendar-grid></gantt-calendar-grid>\n <div class=\"gantt-main\">\n <gantt-main\n [flatData]=\"flatData\"\n [renderData]=\"renderData\"\n [groupHeaderTemplate]=\"groupHeaderTemplate\"\n [itemTemplate]=\"itemTemplate\"\n [barTemplate]=\"barTemplate\"\n [rangeTemplate]=\"rangeTemplate\"\n (barClick)=\"barClick.emit($event)\"\n (lineClick)=\"lineClick.emit($event)\"\n >\n </gantt-main>\n </div>\n </div>\n </cdk-virtual-scroll-viewport>\n\n <gantt-drag-backdrop [style.left.px]=\"tableHeader.tableWidth + 1\"></gantt-drag-backdrop>\n</ngx-gantt-root>\n", dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.CdkFixedSizeVirtualScroll, selector: "cdk-virtual-scroll-viewport[itemSize]", inputs: ["itemSize", "minBufferPx", "maxBufferPx"] }, { kind: "directive", type: i3.CdkVirtualForOf, selector: "[cdkVirtualFor][cdkVirtualForOf]", inputs: ["cdkVirtualForOf", "cdkVirtualForTrackBy", "cdkVirtualForTemplate", "cdkVirtualForTemplateCacheSize"] }, { kind: "component", type: i3.CdkVirtualScrollViewport, selector: "cdk-virtual-scroll-viewport", inputs: ["orientation", "appendOnly"], outputs: ["scrolledIndexChange"] }, { kind: "component", type: GanttTableHeaderComponent, selector: "gantt-table-header", inputs: ["columns"] }, { kind: "component", type: GanttTableBodyComponent, selector: "gantt-table-body", inputs: ["renderData", "flatData", "columns", "groupTemplate", "emptyTemplate", "rowBeforeTemplate", "rowAfterTemplate", "draggable", "dropEnterPredicate"], outputs: ["dragDropped", "itemClick"] }, { kind: "component", type: GanttMainComponent, selector: "gantt-main", inputs: ["renderData", "flatData", "groupHeaderTemplate", "itemTemplate", "barTemplate", "rangeTemplate"], outputs: ["barClick", "lineClick"] }, { kind: "component", type: GanttCalendarHeaderComponent, selector: "gantt-calendar-header" }, { kind: "component", type: GanttCalendarGridComponent, selector: "gantt-calendar-grid" }, { kind: "component", type: GanttLoaderComponent, selector: "gantt-loader" }, { kind: "component", type: GanttDragBackdropComponent, selector: "gantt-drag-backdrop" }, { kind: "component", type: NgxGanttRootComponent, selector: "ngx-gantt-root", inputs: ["sideWidth"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
3676
3799
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: NgxGanttComponent, decorators: [{
|
|
3677
3800
|
type: Component,
|
|
3678
3801
|
args: [{ selector: 'ngx-gantt', changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
@@ -3684,7 +3807,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImpor
|
|
|
3684
3807
|
provide: GANTT_ABSTRACT_TOKEN,
|
|
3685
3808
|
useExisting: forwardRef(() => NgxGanttComponent)
|
|
3686
3809
|
}
|
|
3687
|
-
], template: "<ngx-gantt-root #ganttRoot>\n <div class=\"gantt-header\">\n <gantt-table-header #tableHeader [columns]=\"columns\"></gantt-table-header>\n <div class=\"gantt-container-header\">\n <gantt-calendar-header></gantt-calendar-header>\n </div>\n </div>\n <gantt-loader *ngIf=\"loading\"></gantt-loader>\n <cdk-virtual-scroll-viewport\n class=\"gantt-virtual-scroll-viewport\"\n [itemSize]=\"styles.lineHeight\"\n [minBufferPx]=\"styles.lineHeight * 10\"\n [maxBufferPx]=\"styles.lineHeight * 20\"\n >\n <ng-container *cdkVirtualFor=\"let item of flatData; trackBy: trackBy\"></ng-container>\n <div class=\"gantt-side\" [style.width.px]=\"tableHeader.tableWidth + 1\">\n <div class=\"gantt-side-container\">\n <div class=\"gantt-table\">\n <gantt-table-body\n [flatData]=\"flatData\"\n [renderData]=\"renderData\"\n [columns]=\"columns\"\n [groupTemplate]=\"groupTemplate\"\n [emptyTemplate]=\"tableEmptyTemplate\"\n [rowBeforeTemplate]=\"table?.rowBeforeTemplate\"\n [rowAfterTemplate]=\"table?.rowAfterTemplate\"\n [draggable]=\"table.draggable\"\n [dropEnterPredicate]=\"table.dropEnterPredicate\"\n (dragDropped)=\"table.dragDropped.emit($event)\"\n (itemClick)=\"selectItem($event)\"\n ></gantt-table-body>\n </div>\n </div>\n </div>\n <div class=\"gantt-container\">\n <gantt-calendar-grid></gantt-calendar-grid>\n <div class=\"gantt-main\">\n <gantt-main\n [flatData]=\"flatData\"\n [renderData]=\"renderData\"\n [groupHeaderTemplate]=\"groupHeaderTemplate\"\n [itemTemplate]=\"itemTemplate\"\n [barTemplate]=\"barTemplate\"\n [rangeTemplate]=\"rangeTemplate\"\n (barClick)=\"barClick.emit($event)\"\n (lineClick)=\"lineClick.emit($event)\"\n >\n </gantt-main>\n </div>\n </div>\n </cdk-virtual-scroll-viewport>\n <gantt-drag-backdrop [style.left.px]=\"tableHeader.tableWidth + 1\"></gantt-drag-backdrop>\n</ngx-gantt-root>\n" }]
|
|
3810
|
+
], template: "<ngx-gantt-root #ganttRoot>\n <div class=\"gantt-header\">\n <gantt-table-header #tableHeader [columns]=\"columns\"></gantt-table-header>\n <div class=\"gantt-container-header\">\n <gantt-calendar-header></gantt-calendar-header>\n </div>\n </div>\n <gantt-loader *ngIf=\"loading\"></gantt-loader>\n\n <cdk-virtual-scroll-viewport\n class=\"gantt-virtual-scroll-viewport\"\n [itemSize]=\"styles.lineHeight\"\n [minBufferPx]=\"styles.lineHeight * 10\"\n [maxBufferPx]=\"styles.lineHeight * 20\"\n >\n <ng-container *cdkVirtualFor=\"let item of flatData; trackBy: trackBy\"></ng-container>\n <div class=\"gantt-side\" [style.width.px]=\"tableHeader.tableWidth + 1\">\n <div class=\"gantt-side-container\">\n <div class=\"gantt-table\">\n <gantt-table-body\n [flatData]=\"flatData\"\n [renderData]=\"renderData\"\n [columns]=\"columns\"\n [groupTemplate]=\"groupTemplate\"\n [emptyTemplate]=\"tableEmptyTemplate\"\n [rowBeforeTemplate]=\"table?.rowBeforeTemplate\"\n [rowAfterTemplate]=\"table?.rowAfterTemplate\"\n [draggable]=\"table.draggable\"\n [dropEnterPredicate]=\"table.dropEnterPredicate\"\n (dragDropped)=\"table.dragDropped.emit($event)\"\n (itemClick)=\"selectItem($event)\"\n ></gantt-table-body>\n </div>\n </div>\n </div>\n\n <div class=\"gantt-container\">\n <gantt-calendar-grid></gantt-calendar-grid>\n <div class=\"gantt-main\">\n <gantt-main\n [flatData]=\"flatData\"\n [renderData]=\"renderData\"\n [groupHeaderTemplate]=\"groupHeaderTemplate\"\n [itemTemplate]=\"itemTemplate\"\n [barTemplate]=\"barTemplate\"\n [rangeTemplate]=\"rangeTemplate\"\n (barClick)=\"barClick.emit($event)\"\n (lineClick)=\"lineClick.emit($event)\"\n >\n </gantt-main>\n </div>\n </div>\n </cdk-virtual-scroll-viewport>\n\n <gantt-drag-backdrop [style.left.px]=\"tableHeader.tableWidth + 1\"></gantt-drag-backdrop>\n</ngx-gantt-root>\n" }]
|
|
3688
3811
|
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }, { type: i0.NgZone }, { type: GanttPrintService, decorators: [{
|
|
3689
3812
|
type: Optional
|
|
3690
3813
|
}] }, { type: undefined, decorators: [{
|