@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';
|
|
@@ -1242,11 +1242,15 @@ class NgxGanttTableColumnComponent {
|
|
|
1242
1242
|
set width(width) {
|
|
1243
1243
|
this.columnWidth = coerceCssPixelValue(width);
|
|
1244
1244
|
}
|
|
1245
|
-
constructor(ganttUpper) {
|
|
1245
|
+
constructor(ganttUpper, elementRef) {
|
|
1246
1246
|
this.ganttUpper = ganttUpper;
|
|
1247
|
+
this.elementRef = elementRef;
|
|
1248
|
+
}
|
|
1249
|
+
get classList() {
|
|
1250
|
+
return this.elementRef.nativeElement.classList;
|
|
1247
1251
|
}
|
|
1248
1252
|
}
|
|
1249
|
-
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 });
|
|
1253
|
+
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 });
|
|
1250
1254
|
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 });
|
|
1251
1255
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: NgxGanttTableColumnComponent, decorators: [{
|
|
1252
1256
|
type: Component,
|
|
@@ -1258,7 +1262,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImpor
|
|
|
1258
1262
|
return [{ type: GanttUpper, decorators: [{
|
|
1259
1263
|
type: Inject,
|
|
1260
1264
|
args: [GANTT_UPPER_TOKEN]
|
|
1261
|
-
}] }];
|
|
1265
|
+
}] }, { type: i0.ElementRef }];
|
|
1262
1266
|
}, propDecorators: { width: [{
|
|
1263
1267
|
type: Input
|
|
1264
1268
|
}], name: [{
|
|
@@ -1430,7 +1434,7 @@ class GanttTableHeaderComponent {
|
|
|
1430
1434
|
this.columnsChange();
|
|
1431
1435
|
this.columns.changes.pipe(takeUntil$1(this.unsubscribe$)).subscribe(() => {
|
|
1432
1436
|
this.columnsChange();
|
|
1433
|
-
this.cdr.detectChanges();
|
|
1437
|
+
this.gantt.cdr.detectChanges();
|
|
1434
1438
|
});
|
|
1435
1439
|
}
|
|
1436
1440
|
columnsChange() {
|
|
@@ -1744,6 +1748,7 @@ class GanttTableBodyComponent {
|
|
|
1744
1748
|
this.columns.changes.pipe(startWith(this.columns), takeUntil$1(this.destroy$)).subscribe(() => {
|
|
1745
1749
|
this.hasExpandIcon = false;
|
|
1746
1750
|
this.columns.forEach((column) => {
|
|
1751
|
+
column.classList.add('gantt-table-column');
|
|
1747
1752
|
if (!column.columnWidth) {
|
|
1748
1753
|
column.columnWidth = coerceCssPixelValue(defaultColumnWidth);
|
|
1749
1754
|
}
|
|
@@ -1947,10 +1952,10 @@ class GanttTableBodyComponent {
|
|
|
1947
1952
|
}
|
|
1948
1953
|
}
|
|
1949
1954
|
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 });
|
|
1950
|
-
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
|
|
1955
|
+
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" }] });
|
|
1951
1956
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: GanttTableBodyComponent, decorators: [{
|
|
1952
1957
|
type: Component,
|
|
1953
|
-
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
|
|
1958
|
+
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" }]
|
|
1954
1959
|
}], ctorParameters: function () {
|
|
1955
1960
|
return [{ type: undefined, decorators: [{
|
|
1956
1961
|
type: Inject,
|
|
@@ -2471,6 +2476,41 @@ function normalizePassiveListenerOptions(options) {
|
|
|
2471
2476
|
/** Options used to bind passive event listeners. */
|
|
2472
2477
|
const passiveListenerOptions = normalizePassiveListenerOptions({ passive: true });
|
|
2473
2478
|
|
|
2479
|
+
/**
|
|
2480
|
+
* Proximity, as a ratio to width/height at which to start auto-scrolling the drop list or the
|
|
2481
|
+
* viewport. The value comes from trying it out manually until it feels right.
|
|
2482
|
+
*/
|
|
2483
|
+
const SCROLL_PROXIMITY_THRESHOLD = 0.05;
|
|
2484
|
+
/**
|
|
2485
|
+
* Gets whether the horizontal auto-scroll direction of a node.
|
|
2486
|
+
* @param clientRect Dimensions of the node.
|
|
2487
|
+
* @param pointerX Position of the user's pointer along the x axis.
|
|
2488
|
+
*/
|
|
2489
|
+
function getHorizontalScrollDirection(clientRect, pointerX) {
|
|
2490
|
+
const { left, right, width } = clientRect;
|
|
2491
|
+
const xThreshold = width * SCROLL_PROXIMITY_THRESHOLD;
|
|
2492
|
+
if (pointerX >= left - xThreshold && pointerX <= left + xThreshold) {
|
|
2493
|
+
return 1 /* AutoScrollHorizontalDirection.LEFT */;
|
|
2494
|
+
}
|
|
2495
|
+
else if (pointerX >= right - xThreshold && pointerX <= right + xThreshold) {
|
|
2496
|
+
return 2 /* AutoScrollHorizontalDirection.RIGHT */;
|
|
2497
|
+
}
|
|
2498
|
+
return 0 /* AutoScrollHorizontalDirection.NONE */;
|
|
2499
|
+
}
|
|
2500
|
+
/**
|
|
2501
|
+
* Checks whether the pointer coordinates are close to a ClientRect.
|
|
2502
|
+
* @param rect ClientRect to check against.
|
|
2503
|
+
* @param threshold Threshold around the ClientRect.
|
|
2504
|
+
* @param pointerX Coordinates along the X axis.
|
|
2505
|
+
* @param pointerY Coordinates along the Y axis.
|
|
2506
|
+
*/
|
|
2507
|
+
function isPointerNearClientRect(rect, threshold, pointerX, pointerY) {
|
|
2508
|
+
const { top, right, bottom, left, width, height } = rect;
|
|
2509
|
+
const xThreshold = width * threshold;
|
|
2510
|
+
const yThreshold = height * threshold;
|
|
2511
|
+
return pointerY > top - yThreshold && pointerY < bottom + yThreshold && pointerX > left - xThreshold && pointerX < right + xThreshold;
|
|
2512
|
+
}
|
|
2513
|
+
|
|
2474
2514
|
const scrollThreshold = 50;
|
|
2475
2515
|
var ScrollDirection;
|
|
2476
2516
|
(function (ScrollDirection) {
|
|
@@ -2865,8 +2905,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImpor
|
|
|
2865
2905
|
args: [GanttDragBackdropComponent, { static: true, read: ElementRef }]
|
|
2866
2906
|
}] } });
|
|
2867
2907
|
|
|
2908
|
+
/**
|
|
2909
|
+
* Proximity, as a ratio to width/height, at which a
|
|
2910
|
+
* dragged item will affect the drop container.
|
|
2911
|
+
*/
|
|
2912
|
+
const DROP_PROXIMITY_THRESHOLD = 0.05;
|
|
2868
2913
|
const dragMinWidth = 10;
|
|
2869
|
-
const autoScrollStep =
|
|
2914
|
+
const autoScrollStep = 5;
|
|
2870
2915
|
const activeClass = 'gantt-bar-active';
|
|
2871
2916
|
const dropActiveClass = 'gantt-bar-drop-active';
|
|
2872
2917
|
const singleDropActiveClass = 'gantt-bar-single-drop-active';
|
|
@@ -2882,19 +2927,44 @@ class GanttBarDrag {
|
|
|
2882
2927
|
get linkDragDisabled() {
|
|
2883
2928
|
return !this.item.linkable || !this.ganttUpper.linkable;
|
|
2884
2929
|
}
|
|
2885
|
-
constructor(dragDrop, dom, dragContainer, root) {
|
|
2930
|
+
constructor(dragDrop, dom, dragContainer, _ngZone, root) {
|
|
2886
2931
|
this.dragDrop = dragDrop;
|
|
2887
2932
|
this.dom = dom;
|
|
2888
2933
|
this.dragContainer = dragContainer;
|
|
2934
|
+
this._ngZone = _ngZone;
|
|
2889
2935
|
this.root = root;
|
|
2890
2936
|
this.dragRefs = [];
|
|
2891
2937
|
this.destroy$ = new Subject();
|
|
2892
|
-
|
|
2938
|
+
/** Used to signal to the current auto-scroll sequence when to stop. */
|
|
2939
|
+
this.stopScrollTimers$ = new Subject();
|
|
2940
|
+
/** move distance when drag bar */
|
|
2941
|
+
this.barDragMoveDistance = 0;
|
|
2942
|
+
/** move distance when drag bar handle */
|
|
2943
|
+
this.barHandleDragMoveDistance = 0;
|
|
2944
|
+
/** scrolling state when drag */
|
|
2893
2945
|
this.dragScrolling = false;
|
|
2946
|
+
/** dragScrollDistance */
|
|
2947
|
+
this.dragScrollDistance = 0;
|
|
2948
|
+
/** Horizontal direction in which the list is currently scrolling. */
|
|
2949
|
+
this._horizontalScrollDirection = 0 /* AutoScrollHorizontalDirection.NONE */;
|
|
2950
|
+
this.startScrollInterval = () => {
|
|
2951
|
+
this.stopScrolling();
|
|
2952
|
+
interval(0, animationFrameScheduler)
|
|
2953
|
+
.pipe(takeUntil(this.stopScrollTimers$))
|
|
2954
|
+
.subscribe(() => {
|
|
2955
|
+
const node = this.dom.mainContainer;
|
|
2956
|
+
const scrollStep = autoScrollStep;
|
|
2957
|
+
if (this._horizontalScrollDirection === 1 /* AutoScrollHorizontalDirection.LEFT */) {
|
|
2958
|
+
node.scrollBy(-scrollStep, 0);
|
|
2959
|
+
}
|
|
2960
|
+
else if (this._horizontalScrollDirection === 2 /* AutoScrollHorizontalDirection.RIGHT */) {
|
|
2961
|
+
node.scrollBy(scrollStep, 0);
|
|
2962
|
+
}
|
|
2963
|
+
});
|
|
2964
|
+
};
|
|
2894
2965
|
}
|
|
2895
2966
|
createDragRef(element) {
|
|
2896
2967
|
const dragRef = this.dragDrop.createDrag(element);
|
|
2897
|
-
// dragRef.withPreviewContainer(this.dom.mainContainer as HTMLElement);
|
|
2898
2968
|
return dragRef;
|
|
2899
2969
|
}
|
|
2900
2970
|
createDragScrollEvent(dragRef) {
|
|
@@ -2942,18 +3012,19 @@ class GanttBarDrag {
|
|
|
2942
3012
|
this.setDraggingStyles();
|
|
2943
3013
|
this.containerScrollLeft = this.dom.mainContainer.scrollLeft;
|
|
2944
3014
|
this.createDragScrollEvent(dragRef).subscribe(() => {
|
|
2945
|
-
if (
|
|
2946
|
-
this.
|
|
2947
|
-
|
|
2948
|
-
this.barDragMove(
|
|
3015
|
+
if (dragRef.isDragging()) {
|
|
3016
|
+
const dragScrollDistance = this.dom.mainContainer.scrollLeft - this.containerScrollLeft;
|
|
3017
|
+
this.dragScrollDistance = dragScrollDistance;
|
|
3018
|
+
this.barDragMove();
|
|
2949
3019
|
}
|
|
2950
3020
|
});
|
|
2951
3021
|
this.dragContainer.dragStarted.emit({ item: this.item.origin });
|
|
2952
3022
|
});
|
|
2953
3023
|
dragRef.moved.subscribe((event) => {
|
|
2954
|
-
this.
|
|
3024
|
+
this.startScrollingIfNecessary(event.pointerPosition.x, event.pointerPosition.y);
|
|
3025
|
+
this.barDragMoveDistance = event.distance.x;
|
|
2955
3026
|
if (!this.dragScrolling) {
|
|
2956
|
-
this.
|
|
3027
|
+
this.barDragMove();
|
|
2957
3028
|
}
|
|
2958
3029
|
});
|
|
2959
3030
|
dragRef.ended.subscribe((event) => {
|
|
@@ -2965,7 +3036,9 @@ class GanttBarDrag {
|
|
|
2965
3036
|
this.clearDraggingStyles();
|
|
2966
3037
|
this.closeDragBackdrop();
|
|
2967
3038
|
event.source.reset();
|
|
3039
|
+
this.stopScrolling();
|
|
2968
3040
|
this.dragScrolling = false;
|
|
3041
|
+
this.dragScrollDistance = 0;
|
|
2969
3042
|
this.barDragMoveDistance = 0;
|
|
2970
3043
|
this.dragContainer.dragEnded.emit({ item: this.item.origin });
|
|
2971
3044
|
});
|
|
@@ -2984,18 +3057,19 @@ class GanttBarDrag {
|
|
|
2984
3057
|
this.setDraggingStyles();
|
|
2985
3058
|
this.containerScrollLeft = this.dom.mainContainer.scrollLeft;
|
|
2986
3059
|
this.createDragScrollEvent(dragRef).subscribe(() => {
|
|
2987
|
-
if (
|
|
2988
|
-
this.
|
|
2989
|
-
|
|
2990
|
-
this.barHandleDragMove(
|
|
3060
|
+
if (dragRef.isDragging()) {
|
|
3061
|
+
const dragScrollDistance = this.dom.mainContainer.scrollLeft - this.containerScrollLeft;
|
|
3062
|
+
this.dragScrollDistance = dragScrollDistance;
|
|
3063
|
+
this.barHandleDragMove(isBefore);
|
|
2991
3064
|
}
|
|
2992
3065
|
});
|
|
2993
3066
|
this.dragContainer.dragStarted.emit({ item: this.item.origin });
|
|
2994
3067
|
});
|
|
2995
3068
|
dragRef.moved.subscribe((event) => {
|
|
2996
|
-
this.
|
|
3069
|
+
this.startScrollingIfNecessary(event.pointerPosition.x, event.pointerPosition.y);
|
|
3070
|
+
this.barHandleDragMoveDistance = event.distance.x;
|
|
2997
3071
|
if (!this.dragScrolling) {
|
|
2998
|
-
this.
|
|
3072
|
+
this.barHandleDragMove(isBefore);
|
|
2999
3073
|
}
|
|
3000
3074
|
});
|
|
3001
3075
|
dragRef.ended.subscribe((event) => {
|
|
@@ -3019,7 +3093,9 @@ class GanttBarDrag {
|
|
|
3019
3093
|
this.clearDraggingStyles();
|
|
3020
3094
|
this.closeDragBackdrop();
|
|
3021
3095
|
event.source.reset();
|
|
3096
|
+
this.stopScrolling();
|
|
3022
3097
|
this.dragScrolling = false;
|
|
3098
|
+
this.dragScrollDistance = 0;
|
|
3023
3099
|
this.barHandleDragMoveDistance = 0;
|
|
3024
3100
|
this.dragContainer.dragEnded.emit({ item: this.item.origin });
|
|
3025
3101
|
});
|
|
@@ -3109,8 +3185,8 @@ class GanttBarDrag {
|
|
|
3109
3185
|
this.barElement.style.pointerEvents = '';
|
|
3110
3186
|
this.barElement.classList.remove('gantt-bar-draggable-drag');
|
|
3111
3187
|
}
|
|
3112
|
-
barDragMove(
|
|
3113
|
-
const currentX = this.item.refs.x +
|
|
3188
|
+
barDragMove() {
|
|
3189
|
+
const currentX = this.item.refs.x + this.barDragMoveDistance + this.dragScrollDistance;
|
|
3114
3190
|
const currentDate = this.ganttUpper.view.getDateByXPoint(currentX);
|
|
3115
3191
|
const currentStartX = this.ganttUpper.view.getXPointByDate(currentDate);
|
|
3116
3192
|
const dayWidth = this.ganttUpper.view.getDayOccupancyWidth(currentDate);
|
|
@@ -3121,11 +3197,18 @@ class GanttBarDrag {
|
|
|
3121
3197
|
start = start.addDays(1);
|
|
3122
3198
|
end = end.addDays(1);
|
|
3123
3199
|
}
|
|
3124
|
-
|
|
3200
|
+
if (this.dragScrolling) {
|
|
3201
|
+
this.barElement.style.left = currentX - this.barDragMoveDistance + 'px';
|
|
3202
|
+
}
|
|
3203
|
+
this.openDragBackdrop(this.barElement, this.ganttUpper.view.getDateByXPoint(currentX), this.ganttUpper.view.getDateByXPoint(currentX + this.item.refs.width));
|
|
3204
|
+
if (!this.isStartOrEndInsideView(start, end)) {
|
|
3205
|
+
return;
|
|
3206
|
+
}
|
|
3125
3207
|
this.item.updateDate(start, end);
|
|
3126
3208
|
this.dragContainer.dragMoved.emit({ item: this.item.origin });
|
|
3127
3209
|
}
|
|
3128
|
-
barHandleDragMove(
|
|
3210
|
+
barHandleDragMove(isBefore) {
|
|
3211
|
+
const distance = this.barHandleDragMoveDistance + this.dragScrollDistance;
|
|
3129
3212
|
if (isBefore) {
|
|
3130
3213
|
const x = this.item.refs.x + distance;
|
|
3131
3214
|
const width = this.item.refs.width + distance * -1;
|
|
@@ -3134,6 +3217,9 @@ class GanttBarDrag {
|
|
|
3134
3217
|
this.barElement.style.width = width + 'px';
|
|
3135
3218
|
this.barElement.style.left = x + 'px';
|
|
3136
3219
|
this.openDragBackdrop(this.barElement, start, this.item.end);
|
|
3220
|
+
if (!this.isStartOrEndInsideView(start, this.item.end)) {
|
|
3221
|
+
return;
|
|
3222
|
+
}
|
|
3137
3223
|
this.item.updateDate(start, this.item.end);
|
|
3138
3224
|
}
|
|
3139
3225
|
}
|
|
@@ -3143,6 +3229,9 @@ class GanttBarDrag {
|
|
|
3143
3229
|
if (width > dragMinWidth) {
|
|
3144
3230
|
this.barElement.style.width = width + 'px';
|
|
3145
3231
|
this.openDragBackdrop(this.barElement, this.item.start, end);
|
|
3232
|
+
if (!this.isStartOrEndInsideView(this.item.start, end)) {
|
|
3233
|
+
return;
|
|
3234
|
+
}
|
|
3146
3235
|
this.item.updateDate(this.item.start, end);
|
|
3147
3236
|
}
|
|
3148
3237
|
}
|
|
@@ -3175,6 +3264,36 @@ class GanttBarDrag {
|
|
|
3175
3264
|
this.linkDraggingLine = null;
|
|
3176
3265
|
}
|
|
3177
3266
|
}
|
|
3267
|
+
startScrollingIfNecessary(pointerX, pointerY) {
|
|
3268
|
+
const clientRect = this.dom.mainContainer.getBoundingClientRect();
|
|
3269
|
+
if (isPointerNearClientRect(clientRect, DROP_PROXIMITY_THRESHOLD, pointerX, pointerY)) {
|
|
3270
|
+
const horizontalScrollDirection = getHorizontalScrollDirection(clientRect, pointerX);
|
|
3271
|
+
if (horizontalScrollDirection) {
|
|
3272
|
+
this._horizontalScrollDirection = horizontalScrollDirection;
|
|
3273
|
+
this.dragScrolling = true;
|
|
3274
|
+
this._ngZone.runOutsideAngular(this.startScrollInterval);
|
|
3275
|
+
}
|
|
3276
|
+
else {
|
|
3277
|
+
this.dragScrolling = false;
|
|
3278
|
+
this.stopScrolling();
|
|
3279
|
+
}
|
|
3280
|
+
}
|
|
3281
|
+
}
|
|
3282
|
+
stopScrolling() {
|
|
3283
|
+
this.stopScrollTimers$.next();
|
|
3284
|
+
}
|
|
3285
|
+
isStartOrEndInsideView(start, end) {
|
|
3286
|
+
const itemStart = start.getUnixTime();
|
|
3287
|
+
const itemEnd = end.getUnixTime();
|
|
3288
|
+
const viewStart = this.ganttUpper.view.start.getUnixTime();
|
|
3289
|
+
const viewEnd = this.ganttUpper.view.end.getUnixTime();
|
|
3290
|
+
if (itemStart < viewStart || itemEnd > viewEnd) {
|
|
3291
|
+
return false;
|
|
3292
|
+
}
|
|
3293
|
+
else {
|
|
3294
|
+
return true;
|
|
3295
|
+
}
|
|
3296
|
+
}
|
|
3178
3297
|
createDrags(elementRef, item, ganttUpper) {
|
|
3179
3298
|
this.item = item;
|
|
3180
3299
|
this.barElement = elementRef.nativeElement;
|
|
@@ -3188,13 +3307,6 @@ class GanttBarDrag {
|
|
|
3188
3307
|
const dragRef = this.createBarDrag();
|
|
3189
3308
|
const dragHandlesRefs = this.createBarHandleDrags();
|
|
3190
3309
|
this.dragRefs.push(dragRef, ...dragHandlesRefs);
|
|
3191
|
-
// 创建拖拽容器并将所有元素添加到容器中,利用容器来实现自动滚动
|
|
3192
|
-
if (!this.dropListRef) {
|
|
3193
|
-
this.dropListRef = this.dragDrop.createDropList(this.dom.mainContainer);
|
|
3194
|
-
this.dropListRef.autoScrollStep = autoScrollStep;
|
|
3195
|
-
this.dropListRef.withOrientation('horizontal');
|
|
3196
|
-
}
|
|
3197
|
-
this.dropListRef.withItems([dragRef, ...dragHandlesRefs]);
|
|
3198
3310
|
}
|
|
3199
3311
|
if (!this.linkDragDisabled) {
|
|
3200
3312
|
const linkDragRefs = this.createLinkHandleDrags();
|
|
@@ -3210,14 +3322,16 @@ class GanttBarDrag {
|
|
|
3210
3322
|
this.dragRefs.forEach((dragRef) => dragRef.dispose());
|
|
3211
3323
|
this.destroy$.next();
|
|
3212
3324
|
this.destroy$.complete();
|
|
3325
|
+
this.stopScrolling();
|
|
3326
|
+
this.stopScrollTimers$.complete();
|
|
3213
3327
|
}
|
|
3214
3328
|
}
|
|
3215
|
-
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 });
|
|
3329
|
+
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 });
|
|
3216
3330
|
GanttBarDrag.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: GanttBarDrag });
|
|
3217
3331
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: GanttBarDrag, decorators: [{
|
|
3218
3332
|
type: Injectable
|
|
3219
3333
|
}], ctorParameters: function () {
|
|
3220
|
-
return [{ type: i2.DragDrop }, { type: GanttDomService }, { type: GanttDragContainer }, { type: NgxGanttRootComponent, decorators: [{
|
|
3334
|
+
return [{ type: i2.DragDrop }, { type: GanttDomService }, { type: GanttDragContainer }, { type: i0.NgZone }, { type: NgxGanttRootComponent, decorators: [{
|
|
3221
3335
|
type: SkipSelf
|
|
3222
3336
|
}] }];
|
|
3223
3337
|
} });
|
|
@@ -3228,10 +3342,11 @@ class GanttItemUpper {
|
|
|
3228
3342
|
this.ganttUpper = ganttUpper;
|
|
3229
3343
|
this.firstChange = true;
|
|
3230
3344
|
this.unsubscribe$ = new Subject();
|
|
3345
|
+
this.refsUnsubscribe$ = new Subject();
|
|
3231
3346
|
}
|
|
3232
3347
|
ngOnInit() {
|
|
3233
3348
|
this.firstChange = false;
|
|
3234
|
-
this.item.refs$.pipe(takeUntil(this.
|
|
3349
|
+
this.item.refs$.pipe(takeUntil(this.refsUnsubscribe$)).subscribe(() => {
|
|
3235
3350
|
this.setPositions();
|
|
3236
3351
|
});
|
|
3237
3352
|
}
|
|
@@ -3241,11 +3356,11 @@ class GanttItemUpper {
|
|
|
3241
3356
|
}
|
|
3242
3357
|
}
|
|
3243
3358
|
itemChange(item) {
|
|
3244
|
-
this.
|
|
3245
|
-
this.
|
|
3359
|
+
this.refsUnsubscribe$.next();
|
|
3360
|
+
this.refsUnsubscribe$.complete();
|
|
3246
3361
|
this.item = item;
|
|
3247
3362
|
this.setPositions();
|
|
3248
|
-
this.item.refs$.pipe(takeUntil(this.
|
|
3363
|
+
this.item.refs$.pipe(takeUntil(this.refsUnsubscribe$)).subscribe(() => {
|
|
3249
3364
|
this.setPositions();
|
|
3250
3365
|
});
|
|
3251
3366
|
}
|
|
@@ -3265,6 +3380,8 @@ class GanttItemUpper {
|
|
|
3265
3380
|
ngOnDestroy() {
|
|
3266
3381
|
this.unsubscribe$.next();
|
|
3267
3382
|
this.unsubscribe$.complete();
|
|
3383
|
+
this.refsUnsubscribe$.next();
|
|
3384
|
+
this.refsUnsubscribe$.complete();
|
|
3268
3385
|
}
|
|
3269
3386
|
}
|
|
3270
3387
|
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 });
|
|
@@ -3302,9 +3419,13 @@ class NgxGanttBarComponent extends GanttItemUpper {
|
|
|
3302
3419
|
});
|
|
3303
3420
|
}
|
|
3304
3421
|
ngOnChanges(changes) {
|
|
3422
|
+
var _a, _b;
|
|
3305
3423
|
super.ngOnChanges(changes);
|
|
3306
3424
|
if (!this.firstChange) {
|
|
3307
3425
|
this.drag.updateItem(this.item);
|
|
3426
|
+
if (((_a = changes.item.currentValue.refs) === null || _a === void 0 ? void 0 : _a.width) !== ((_b = changes.item.previousValue.refs) === null || _b === void 0 ? void 0 : _b.width)) {
|
|
3427
|
+
this.setContentBackground();
|
|
3428
|
+
}
|
|
3308
3429
|
}
|
|
3309
3430
|
}
|
|
3310
3431
|
ngAfterViewInit() {
|
|
@@ -3332,30 +3453,33 @@ class NgxGanttBarComponent extends GanttItemUpper {
|
|
|
3332
3453
|
this.barClick.emit({ event, item: this.item.origin });
|
|
3333
3454
|
}
|
|
3334
3455
|
setContentBackground() {
|
|
3335
|
-
|
|
3336
|
-
|
|
3337
|
-
|
|
3338
|
-
|
|
3339
|
-
style
|
|
3340
|
-
|
|
3341
|
-
|
|
3342
|
-
|
|
3343
|
-
|
|
3344
|
-
|
|
3345
|
-
|
|
3346
|
-
|
|
3347
|
-
|
|
3348
|
-
|
|
3349
|
-
|
|
3350
|
-
|
|
3351
|
-
|
|
3352
|
-
|
|
3353
|
-
|
|
3354
|
-
|
|
3355
|
-
|
|
3356
|
-
|
|
3357
|
-
|
|
3358
|
-
|
|
3456
|
+
var _a;
|
|
3457
|
+
if ((_a = this.item.refs) === null || _a === void 0 ? void 0 : _a.width) {
|
|
3458
|
+
const contentElement = this.contentElementRef.nativeElement;
|
|
3459
|
+
const color = this.item.color || barBackground;
|
|
3460
|
+
const style = this.item.barStyle || {};
|
|
3461
|
+
if (this.item.origin.start && this.item.origin.end) {
|
|
3462
|
+
style.background = color;
|
|
3463
|
+
style.borderRadius = '';
|
|
3464
|
+
}
|
|
3465
|
+
if (this.item.origin.start && !this.item.origin.end) {
|
|
3466
|
+
style.background = linearGradient('to left', hexToRgb(color, 0.55), hexToRgb(color, 1));
|
|
3467
|
+
style.borderRadius = '4px 12.5px 12.5px 4px';
|
|
3468
|
+
}
|
|
3469
|
+
if (!this.item.origin.start && this.item.origin.end) {
|
|
3470
|
+
style.background = linearGradient('to right', hexToRgb(color, 0.55), hexToRgb(color, 1));
|
|
3471
|
+
style.borderRadius = '12.5px 4px 4px 12.5px';
|
|
3472
|
+
}
|
|
3473
|
+
if (this.item.progress >= 0) {
|
|
3474
|
+
const contentProgressElement = contentElement.querySelector('.gantt-bar-content-progress');
|
|
3475
|
+
style.background = hexToRgb(color, 0.3);
|
|
3476
|
+
style.borderRadius = '';
|
|
3477
|
+
contentProgressElement.style.background = color;
|
|
3478
|
+
}
|
|
3479
|
+
for (const key in style) {
|
|
3480
|
+
if (style.hasOwnProperty(key)) {
|
|
3481
|
+
contentElement.style[key] = style[key];
|
|
3482
|
+
}
|
|
3359
3483
|
}
|
|
3360
3484
|
}
|
|
3361
3485
|
}
|
|
@@ -3364,10 +3488,10 @@ class NgxGanttBarComponent extends GanttItemUpper {
|
|
|
3364
3488
|
}
|
|
3365
3489
|
}
|
|
3366
3490
|
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 });
|
|
3367
|
-
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 }\"
|
|
3491
|
+
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"] }] });
|
|
3368
3492
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: NgxGanttBarComponent, decorators: [{
|
|
3369
3493
|
type: Component,
|
|
3370
|
-
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 }\"
|
|
3494
|
+
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" }]
|
|
3371
3495
|
}], ctorParameters: function () {
|
|
3372
3496
|
return [{ type: GanttDragContainer }, { type: GanttBarDrag }, { type: i0.ElementRef }, { type: GanttUpper, decorators: [{
|
|
3373
3497
|
type: Inject,
|
|
@@ -3713,7 +3837,7 @@ NgxGanttComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", vers
|
|
|
3713
3837
|
provide: GANTT_ABSTRACT_TOKEN,
|
|
3714
3838
|
useExisting: forwardRef(() => NgxGanttComponent)
|
|
3715
3839
|
}
|
|
3716
|
-
], 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 });
|
|
3840
|
+
], 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 });
|
|
3717
3841
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: NgxGanttComponent, decorators: [{
|
|
3718
3842
|
type: Component,
|
|
3719
3843
|
args: [{ selector: 'ngx-gantt', changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
@@ -3725,7 +3849,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImpor
|
|
|
3725
3849
|
provide: GANTT_ABSTRACT_TOKEN,
|
|
3726
3850
|
useExisting: forwardRef(() => NgxGanttComponent)
|
|
3727
3851
|
}
|
|
3728
|
-
], 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" }]
|
|
3852
|
+
], 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" }]
|
|
3729
3853
|
}], ctorParameters: function () {
|
|
3730
3854
|
return [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }, { type: i0.NgZone }, { type: GanttPrintService, decorators: [{
|
|
3731
3855
|
type: Optional
|