@worktile/gantt 15.1.0-next.1 → 15.1.0-next.2
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 +4 -3
- 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 +192 -68
- package/fesm2015/worktile-gantt.mjs.map +1 -1
- package/fesm2020/worktile-gantt.mjs +190 -68
- 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
|
}
|
|
@@ -1932,10 +1937,10 @@ class GanttTableBodyComponent {
|
|
|
1932
1937
|
}
|
|
1933
1938
|
}
|
|
1934
1939
|
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
|
|
1940
|
+
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
1941
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: GanttTableBodyComponent, decorators: [{
|
|
1937
1942
|
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
|
|
1943
|
+
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
1944
|
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
1940
1945
|
type: Inject,
|
|
1941
1946
|
args: [GANTT_ABSTRACT_TOKEN]
|
|
@@ -2452,6 +2457,41 @@ function normalizePassiveListenerOptions(options) {
|
|
|
2452
2457
|
/** Options used to bind passive event listeners. */
|
|
2453
2458
|
const passiveListenerOptions = normalizePassiveListenerOptions({ passive: true });
|
|
2454
2459
|
|
|
2460
|
+
/**
|
|
2461
|
+
* Proximity, as a ratio to width/height at which to start auto-scrolling the drop list or the
|
|
2462
|
+
* viewport. The value comes from trying it out manually until it feels right.
|
|
2463
|
+
*/
|
|
2464
|
+
const SCROLL_PROXIMITY_THRESHOLD = 0.05;
|
|
2465
|
+
/**
|
|
2466
|
+
* Gets whether the horizontal auto-scroll direction of a node.
|
|
2467
|
+
* @param clientRect Dimensions of the node.
|
|
2468
|
+
* @param pointerX Position of the user's pointer along the x axis.
|
|
2469
|
+
*/
|
|
2470
|
+
function getHorizontalScrollDirection(clientRect, pointerX) {
|
|
2471
|
+
const { left, right, width } = clientRect;
|
|
2472
|
+
const xThreshold = width * SCROLL_PROXIMITY_THRESHOLD;
|
|
2473
|
+
if (pointerX >= left - xThreshold && pointerX <= left + xThreshold) {
|
|
2474
|
+
return 1 /* AutoScrollHorizontalDirection.LEFT */;
|
|
2475
|
+
}
|
|
2476
|
+
else if (pointerX >= right - xThreshold && pointerX <= right + xThreshold) {
|
|
2477
|
+
return 2 /* AutoScrollHorizontalDirection.RIGHT */;
|
|
2478
|
+
}
|
|
2479
|
+
return 0 /* AutoScrollHorizontalDirection.NONE */;
|
|
2480
|
+
}
|
|
2481
|
+
/**
|
|
2482
|
+
* Checks whether the pointer coordinates are close to a ClientRect.
|
|
2483
|
+
* @param rect ClientRect to check against.
|
|
2484
|
+
* @param threshold Threshold around the ClientRect.
|
|
2485
|
+
* @param pointerX Coordinates along the X axis.
|
|
2486
|
+
* @param pointerY Coordinates along the Y axis.
|
|
2487
|
+
*/
|
|
2488
|
+
function isPointerNearClientRect(rect, threshold, pointerX, pointerY) {
|
|
2489
|
+
const { top, right, bottom, left, width, height } = rect;
|
|
2490
|
+
const xThreshold = width * threshold;
|
|
2491
|
+
const yThreshold = height * threshold;
|
|
2492
|
+
return pointerY > top - yThreshold && pointerY < bottom + yThreshold && pointerX > left - xThreshold && pointerX < right + xThreshold;
|
|
2493
|
+
}
|
|
2494
|
+
|
|
2455
2495
|
const scrollThreshold = 50;
|
|
2456
2496
|
var ScrollDirection;
|
|
2457
2497
|
(function (ScrollDirection) {
|
|
@@ -2836,8 +2876,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImpor
|
|
|
2836
2876
|
args: [GanttDragBackdropComponent, { static: true, read: ElementRef }]
|
|
2837
2877
|
}] } });
|
|
2838
2878
|
|
|
2879
|
+
/**
|
|
2880
|
+
* Proximity, as a ratio to width/height, at which a
|
|
2881
|
+
* dragged item will affect the drop container.
|
|
2882
|
+
*/
|
|
2883
|
+
const DROP_PROXIMITY_THRESHOLD = 0.05;
|
|
2839
2884
|
const dragMinWidth = 10;
|
|
2840
|
-
const autoScrollStep =
|
|
2885
|
+
const autoScrollStep = 5;
|
|
2841
2886
|
const activeClass = 'gantt-bar-active';
|
|
2842
2887
|
const dropActiveClass = 'gantt-bar-drop-active';
|
|
2843
2888
|
const singleDropActiveClass = 'gantt-bar-single-drop-active';
|
|
@@ -2853,19 +2898,44 @@ class GanttBarDrag {
|
|
|
2853
2898
|
get linkDragDisabled() {
|
|
2854
2899
|
return !this.item.linkable || !this.ganttUpper.linkable;
|
|
2855
2900
|
}
|
|
2856
|
-
constructor(dragDrop, dom, dragContainer, root) {
|
|
2901
|
+
constructor(dragDrop, dom, dragContainer, _ngZone, root) {
|
|
2857
2902
|
this.dragDrop = dragDrop;
|
|
2858
2903
|
this.dom = dom;
|
|
2859
2904
|
this.dragContainer = dragContainer;
|
|
2905
|
+
this._ngZone = _ngZone;
|
|
2860
2906
|
this.root = root;
|
|
2861
2907
|
this.dragRefs = [];
|
|
2862
2908
|
this.destroy$ = new Subject();
|
|
2863
|
-
|
|
2909
|
+
/** Used to signal to the current auto-scroll sequence when to stop. */
|
|
2910
|
+
this.stopScrollTimers$ = new Subject();
|
|
2911
|
+
/** move distance when drag bar */
|
|
2912
|
+
this.barDragMoveDistance = 0;
|
|
2913
|
+
/** move distance when drag bar handle */
|
|
2914
|
+
this.barHandleDragMoveDistance = 0;
|
|
2915
|
+
/** scrolling state when drag */
|
|
2864
2916
|
this.dragScrolling = false;
|
|
2917
|
+
/** dragScrollDistance */
|
|
2918
|
+
this.dragScrollDistance = 0;
|
|
2919
|
+
/** Horizontal direction in which the list is currently scrolling. */
|
|
2920
|
+
this._horizontalScrollDirection = 0 /* AutoScrollHorizontalDirection.NONE */;
|
|
2921
|
+
this.startScrollInterval = () => {
|
|
2922
|
+
this.stopScrolling();
|
|
2923
|
+
interval(0, animationFrameScheduler)
|
|
2924
|
+
.pipe(takeUntil(this.stopScrollTimers$))
|
|
2925
|
+
.subscribe(() => {
|
|
2926
|
+
const node = this.dom.mainContainer;
|
|
2927
|
+
const scrollStep = autoScrollStep;
|
|
2928
|
+
if (this._horizontalScrollDirection === 1 /* AutoScrollHorizontalDirection.LEFT */) {
|
|
2929
|
+
node.scrollBy(-scrollStep, 0);
|
|
2930
|
+
}
|
|
2931
|
+
else if (this._horizontalScrollDirection === 2 /* AutoScrollHorizontalDirection.RIGHT */) {
|
|
2932
|
+
node.scrollBy(scrollStep, 0);
|
|
2933
|
+
}
|
|
2934
|
+
});
|
|
2935
|
+
};
|
|
2865
2936
|
}
|
|
2866
2937
|
createDragRef(element) {
|
|
2867
2938
|
const dragRef = this.dragDrop.createDrag(element);
|
|
2868
|
-
// dragRef.withPreviewContainer(this.dom.mainContainer as HTMLElement);
|
|
2869
2939
|
return dragRef;
|
|
2870
2940
|
}
|
|
2871
2941
|
createDragScrollEvent(dragRef) {
|
|
@@ -2912,18 +2982,19 @@ class GanttBarDrag {
|
|
|
2912
2982
|
this.setDraggingStyles();
|
|
2913
2983
|
this.containerScrollLeft = this.dom.mainContainer.scrollLeft;
|
|
2914
2984
|
this.createDragScrollEvent(dragRef).subscribe(() => {
|
|
2915
|
-
if (
|
|
2916
|
-
this.
|
|
2917
|
-
|
|
2918
|
-
this.barDragMove(
|
|
2985
|
+
if (dragRef.isDragging()) {
|
|
2986
|
+
const dragScrollDistance = this.dom.mainContainer.scrollLeft - this.containerScrollLeft;
|
|
2987
|
+
this.dragScrollDistance = dragScrollDistance;
|
|
2988
|
+
this.barDragMove();
|
|
2919
2989
|
}
|
|
2920
2990
|
});
|
|
2921
2991
|
this.dragContainer.dragStarted.emit({ item: this.item.origin });
|
|
2922
2992
|
});
|
|
2923
2993
|
dragRef.moved.subscribe((event) => {
|
|
2924
|
-
this.
|
|
2994
|
+
this.startScrollingIfNecessary(event.pointerPosition.x, event.pointerPosition.y);
|
|
2995
|
+
this.barDragMoveDistance = event.distance.x;
|
|
2925
2996
|
if (!this.dragScrolling) {
|
|
2926
|
-
this.
|
|
2997
|
+
this.barDragMove();
|
|
2927
2998
|
}
|
|
2928
2999
|
});
|
|
2929
3000
|
dragRef.ended.subscribe((event) => {
|
|
@@ -2935,7 +3006,9 @@ class GanttBarDrag {
|
|
|
2935
3006
|
this.clearDraggingStyles();
|
|
2936
3007
|
this.closeDragBackdrop();
|
|
2937
3008
|
event.source.reset();
|
|
3009
|
+
this.stopScrolling();
|
|
2938
3010
|
this.dragScrolling = false;
|
|
3011
|
+
this.dragScrollDistance = 0;
|
|
2939
3012
|
this.barDragMoveDistance = 0;
|
|
2940
3013
|
this.dragContainer.dragEnded.emit({ item: this.item.origin });
|
|
2941
3014
|
});
|
|
@@ -2954,18 +3027,19 @@ class GanttBarDrag {
|
|
|
2954
3027
|
this.setDraggingStyles();
|
|
2955
3028
|
this.containerScrollLeft = this.dom.mainContainer.scrollLeft;
|
|
2956
3029
|
this.createDragScrollEvent(dragRef).subscribe(() => {
|
|
2957
|
-
if (
|
|
2958
|
-
this.
|
|
2959
|
-
|
|
2960
|
-
this.barHandleDragMove(
|
|
3030
|
+
if (dragRef.isDragging()) {
|
|
3031
|
+
const dragScrollDistance = this.dom.mainContainer.scrollLeft - this.containerScrollLeft;
|
|
3032
|
+
this.dragScrollDistance = dragScrollDistance;
|
|
3033
|
+
this.barHandleDragMove(isBefore);
|
|
2961
3034
|
}
|
|
2962
3035
|
});
|
|
2963
3036
|
this.dragContainer.dragStarted.emit({ item: this.item.origin });
|
|
2964
3037
|
});
|
|
2965
3038
|
dragRef.moved.subscribe((event) => {
|
|
2966
|
-
this.
|
|
3039
|
+
this.startScrollingIfNecessary(event.pointerPosition.x, event.pointerPosition.y);
|
|
3040
|
+
this.barHandleDragMoveDistance = event.distance.x;
|
|
2967
3041
|
if (!this.dragScrolling) {
|
|
2968
|
-
this.
|
|
3042
|
+
this.barHandleDragMove(isBefore);
|
|
2969
3043
|
}
|
|
2970
3044
|
});
|
|
2971
3045
|
dragRef.ended.subscribe((event) => {
|
|
@@ -2989,7 +3063,9 @@ class GanttBarDrag {
|
|
|
2989
3063
|
this.clearDraggingStyles();
|
|
2990
3064
|
this.closeDragBackdrop();
|
|
2991
3065
|
event.source.reset();
|
|
3066
|
+
this.stopScrolling();
|
|
2992
3067
|
this.dragScrolling = false;
|
|
3068
|
+
this.dragScrollDistance = 0;
|
|
2993
3069
|
this.barHandleDragMoveDistance = 0;
|
|
2994
3070
|
this.dragContainer.dragEnded.emit({ item: this.item.origin });
|
|
2995
3071
|
});
|
|
@@ -3082,8 +3158,8 @@ class GanttBarDrag {
|
|
|
3082
3158
|
this.barElement.style.pointerEvents = '';
|
|
3083
3159
|
this.barElement.classList.remove('gantt-bar-draggable-drag');
|
|
3084
3160
|
}
|
|
3085
|
-
barDragMove(
|
|
3086
|
-
const currentX = this.item.refs.x +
|
|
3161
|
+
barDragMove() {
|
|
3162
|
+
const currentX = this.item.refs.x + this.barDragMoveDistance + this.dragScrollDistance;
|
|
3087
3163
|
const currentDate = this.ganttUpper.view.getDateByXPoint(currentX);
|
|
3088
3164
|
const currentStartX = this.ganttUpper.view.getXPointByDate(currentDate);
|
|
3089
3165
|
const dayWidth = this.ganttUpper.view.getDayOccupancyWidth(currentDate);
|
|
@@ -3094,11 +3170,18 @@ class GanttBarDrag {
|
|
|
3094
3170
|
start = start.addDays(1);
|
|
3095
3171
|
end = end.addDays(1);
|
|
3096
3172
|
}
|
|
3097
|
-
|
|
3173
|
+
if (this.dragScrolling) {
|
|
3174
|
+
this.barElement.style.left = currentX - this.barDragMoveDistance + 'px';
|
|
3175
|
+
}
|
|
3176
|
+
this.openDragBackdrop(this.barElement, this.ganttUpper.view.getDateByXPoint(currentX), this.ganttUpper.view.getDateByXPoint(currentX + this.item.refs.width));
|
|
3177
|
+
if (!this.isStartOrEndInsideView(start, end)) {
|
|
3178
|
+
return;
|
|
3179
|
+
}
|
|
3098
3180
|
this.item.updateDate(start, end);
|
|
3099
3181
|
this.dragContainer.dragMoved.emit({ item: this.item.origin });
|
|
3100
3182
|
}
|
|
3101
|
-
barHandleDragMove(
|
|
3183
|
+
barHandleDragMove(isBefore) {
|
|
3184
|
+
const distance = this.barHandleDragMoveDistance + this.dragScrollDistance;
|
|
3102
3185
|
if (isBefore) {
|
|
3103
3186
|
const x = this.item.refs.x + distance;
|
|
3104
3187
|
const width = this.item.refs.width + distance * -1;
|
|
@@ -3107,6 +3190,9 @@ class GanttBarDrag {
|
|
|
3107
3190
|
this.barElement.style.width = width + 'px';
|
|
3108
3191
|
this.barElement.style.left = x + 'px';
|
|
3109
3192
|
this.openDragBackdrop(this.barElement, start, this.item.end);
|
|
3193
|
+
if (!this.isStartOrEndInsideView(start, this.item.end)) {
|
|
3194
|
+
return;
|
|
3195
|
+
}
|
|
3110
3196
|
this.item.updateDate(start, this.item.end);
|
|
3111
3197
|
}
|
|
3112
3198
|
}
|
|
@@ -3116,6 +3202,9 @@ class GanttBarDrag {
|
|
|
3116
3202
|
if (width > dragMinWidth) {
|
|
3117
3203
|
this.barElement.style.width = width + 'px';
|
|
3118
3204
|
this.openDragBackdrop(this.barElement, this.item.start, end);
|
|
3205
|
+
if (!this.isStartOrEndInsideView(this.item.start, end)) {
|
|
3206
|
+
return;
|
|
3207
|
+
}
|
|
3119
3208
|
this.item.updateDate(this.item.start, end);
|
|
3120
3209
|
}
|
|
3121
3210
|
}
|
|
@@ -3148,6 +3237,36 @@ class GanttBarDrag {
|
|
|
3148
3237
|
this.linkDraggingLine = null;
|
|
3149
3238
|
}
|
|
3150
3239
|
}
|
|
3240
|
+
startScrollingIfNecessary(pointerX, pointerY) {
|
|
3241
|
+
const clientRect = this.dom.mainContainer.getBoundingClientRect();
|
|
3242
|
+
if (isPointerNearClientRect(clientRect, DROP_PROXIMITY_THRESHOLD, pointerX, pointerY)) {
|
|
3243
|
+
const horizontalScrollDirection = getHorizontalScrollDirection(clientRect, pointerX);
|
|
3244
|
+
if (horizontalScrollDirection) {
|
|
3245
|
+
this._horizontalScrollDirection = horizontalScrollDirection;
|
|
3246
|
+
this.dragScrolling = true;
|
|
3247
|
+
this._ngZone.runOutsideAngular(this.startScrollInterval);
|
|
3248
|
+
}
|
|
3249
|
+
else {
|
|
3250
|
+
this.dragScrolling = false;
|
|
3251
|
+
this.stopScrolling();
|
|
3252
|
+
}
|
|
3253
|
+
}
|
|
3254
|
+
}
|
|
3255
|
+
stopScrolling() {
|
|
3256
|
+
this.stopScrollTimers$.next();
|
|
3257
|
+
}
|
|
3258
|
+
isStartOrEndInsideView(start, end) {
|
|
3259
|
+
const itemStart = start.getUnixTime();
|
|
3260
|
+
const itemEnd = end.getUnixTime();
|
|
3261
|
+
const viewStart = this.ganttUpper.view.start.getUnixTime();
|
|
3262
|
+
const viewEnd = this.ganttUpper.view.end.getUnixTime();
|
|
3263
|
+
if (itemStart < viewStart || itemEnd > viewEnd) {
|
|
3264
|
+
return false;
|
|
3265
|
+
}
|
|
3266
|
+
else {
|
|
3267
|
+
return true;
|
|
3268
|
+
}
|
|
3269
|
+
}
|
|
3151
3270
|
createDrags(elementRef, item, ganttUpper) {
|
|
3152
3271
|
this.item = item;
|
|
3153
3272
|
this.barElement = elementRef.nativeElement;
|
|
@@ -3161,13 +3280,6 @@ class GanttBarDrag {
|
|
|
3161
3280
|
const dragRef = this.createBarDrag();
|
|
3162
3281
|
const dragHandlesRefs = this.createBarHandleDrags();
|
|
3163
3282
|
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
3283
|
}
|
|
3172
3284
|
if (!this.linkDragDisabled) {
|
|
3173
3285
|
const linkDragRefs = this.createLinkHandleDrags();
|
|
@@ -3183,13 +3295,15 @@ class GanttBarDrag {
|
|
|
3183
3295
|
this.dragRefs.forEach((dragRef) => dragRef.dispose());
|
|
3184
3296
|
this.destroy$.next();
|
|
3185
3297
|
this.destroy$.complete();
|
|
3298
|
+
this.stopScrolling();
|
|
3299
|
+
this.stopScrollTimers$.complete();
|
|
3186
3300
|
}
|
|
3187
3301
|
}
|
|
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 });
|
|
3302
|
+
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
3303
|
GanttBarDrag.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: GanttBarDrag });
|
|
3190
3304
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: GanttBarDrag, decorators: [{
|
|
3191
3305
|
type: Injectable
|
|
3192
|
-
}], ctorParameters: function () { return [{ type: i2.DragDrop }, { type: GanttDomService }, { type: GanttDragContainer }, { type: NgxGanttRootComponent, decorators: [{
|
|
3306
|
+
}], ctorParameters: function () { return [{ type: i2.DragDrop }, { type: GanttDomService }, { type: GanttDragContainer }, { type: i0.NgZone }, { type: NgxGanttRootComponent, decorators: [{
|
|
3193
3307
|
type: SkipSelf
|
|
3194
3308
|
}] }]; } });
|
|
3195
3309
|
|
|
@@ -3199,10 +3313,11 @@ class GanttItemUpper {
|
|
|
3199
3313
|
this.ganttUpper = ganttUpper;
|
|
3200
3314
|
this.firstChange = true;
|
|
3201
3315
|
this.unsubscribe$ = new Subject();
|
|
3316
|
+
this.refsUnsubscribe$ = new Subject();
|
|
3202
3317
|
}
|
|
3203
3318
|
ngOnInit() {
|
|
3204
3319
|
this.firstChange = false;
|
|
3205
|
-
this.item.refs$.pipe(takeUntil(this.
|
|
3320
|
+
this.item.refs$.pipe(takeUntil(this.refsUnsubscribe$)).subscribe(() => {
|
|
3206
3321
|
this.setPositions();
|
|
3207
3322
|
});
|
|
3208
3323
|
}
|
|
@@ -3212,11 +3327,11 @@ class GanttItemUpper {
|
|
|
3212
3327
|
}
|
|
3213
3328
|
}
|
|
3214
3329
|
itemChange(item) {
|
|
3215
|
-
this.
|
|
3216
|
-
this.
|
|
3330
|
+
this.refsUnsubscribe$.next();
|
|
3331
|
+
this.refsUnsubscribe$.complete();
|
|
3217
3332
|
this.item = item;
|
|
3218
3333
|
this.setPositions();
|
|
3219
|
-
this.item.refs$.pipe(takeUntil(this.
|
|
3334
|
+
this.item.refs$.pipe(takeUntil(this.refsUnsubscribe$)).subscribe(() => {
|
|
3220
3335
|
this.setPositions();
|
|
3221
3336
|
});
|
|
3222
3337
|
}
|
|
@@ -3235,6 +3350,8 @@ class GanttItemUpper {
|
|
|
3235
3350
|
ngOnDestroy() {
|
|
3236
3351
|
this.unsubscribe$.next();
|
|
3237
3352
|
this.unsubscribe$.complete();
|
|
3353
|
+
this.refsUnsubscribe$.next();
|
|
3354
|
+
this.refsUnsubscribe$.complete();
|
|
3238
3355
|
}
|
|
3239
3356
|
}
|
|
3240
3357
|
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 +3390,9 @@ class NgxGanttBarComponent extends GanttItemUpper {
|
|
|
3273
3390
|
super.ngOnChanges(changes);
|
|
3274
3391
|
if (!this.firstChange) {
|
|
3275
3392
|
this.drag.updateItem(this.item);
|
|
3393
|
+
if (changes.item.currentValue.refs?.width !== changes.item.previousValue.refs?.width) {
|
|
3394
|
+
this.setContentBackground();
|
|
3395
|
+
}
|
|
3276
3396
|
}
|
|
3277
3397
|
}
|
|
3278
3398
|
ngAfterViewInit() {
|
|
@@ -3300,30 +3420,32 @@ class NgxGanttBarComponent extends GanttItemUpper {
|
|
|
3300
3420
|
this.barClick.emit({ event, item: this.item.origin });
|
|
3301
3421
|
}
|
|
3302
3422
|
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
|
-
|
|
3423
|
+
if (this.item.refs?.width) {
|
|
3424
|
+
const contentElement = this.contentElementRef.nativeElement;
|
|
3425
|
+
const color = this.item.color || barBackground;
|
|
3426
|
+
const style = this.item.barStyle || {};
|
|
3427
|
+
if (this.item.origin.start && this.item.origin.end) {
|
|
3428
|
+
style.background = color;
|
|
3429
|
+
style.borderRadius = '';
|
|
3430
|
+
}
|
|
3431
|
+
if (this.item.origin.start && !this.item.origin.end) {
|
|
3432
|
+
style.background = linearGradient('to left', hexToRgb(color, 0.55), hexToRgb(color, 1));
|
|
3433
|
+
style.borderRadius = '4px 12.5px 12.5px 4px';
|
|
3434
|
+
}
|
|
3435
|
+
if (!this.item.origin.start && this.item.origin.end) {
|
|
3436
|
+
style.background = linearGradient('to right', hexToRgb(color, 0.55), hexToRgb(color, 1));
|
|
3437
|
+
style.borderRadius = '12.5px 4px 4px 12.5px';
|
|
3438
|
+
}
|
|
3439
|
+
if (this.item.progress >= 0) {
|
|
3440
|
+
const contentProgressElement = contentElement.querySelector('.gantt-bar-content-progress');
|
|
3441
|
+
style.background = hexToRgb(color, 0.3);
|
|
3442
|
+
style.borderRadius = '';
|
|
3443
|
+
contentProgressElement.style.background = color;
|
|
3444
|
+
}
|
|
3445
|
+
for (const key in style) {
|
|
3446
|
+
if (style.hasOwnProperty(key)) {
|
|
3447
|
+
contentElement.style[key] = style[key];
|
|
3448
|
+
}
|
|
3327
3449
|
}
|
|
3328
3450
|
}
|
|
3329
3451
|
}
|
|
@@ -3332,10 +3454,10 @@ class NgxGanttBarComponent extends GanttItemUpper {
|
|
|
3332
3454
|
}
|
|
3333
3455
|
}
|
|
3334
3456
|
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 }\"
|
|
3457
|
+
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
3458
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: NgxGanttBarComponent, decorators: [{
|
|
3337
3459
|
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 }\"
|
|
3460
|
+
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
3461
|
}], ctorParameters: function () { return [{ type: GanttDragContainer }, { type: GanttBarDrag }, { type: i0.ElementRef }, { type: GanttUpper, decorators: [{
|
|
3340
3462
|
type: Inject,
|
|
3341
3463
|
args: [GANTT_UPPER_TOKEN]
|
|
@@ -3672,7 +3794,7 @@ NgxGanttComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", vers
|
|
|
3672
3794
|
provide: GANTT_ABSTRACT_TOKEN,
|
|
3673
3795
|
useExisting: forwardRef(() => NgxGanttComponent)
|
|
3674
3796
|
}
|
|
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 });
|
|
3797
|
+
], 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
3798
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: NgxGanttComponent, decorators: [{
|
|
3677
3799
|
type: Component,
|
|
3678
3800
|
args: [{ selector: 'ngx-gantt', changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
@@ -3684,7 +3806,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImpor
|
|
|
3684
3806
|
provide: GANTT_ABSTRACT_TOKEN,
|
|
3685
3807
|
useExisting: forwardRef(() => NgxGanttComponent)
|
|
3686
3808
|
}
|
|
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" }]
|
|
3809
|
+
], 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
3810
|
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }, { type: i0.NgZone }, { type: GanttPrintService, decorators: [{
|
|
3689
3811
|
type: Optional
|
|
3690
3812
|
}] }, { type: undefined, decorators: [{
|