@worktile/gantt 12.2.0-next.0 → 12.2.0-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/worktile-gantt.umd.js +312 -99
- package/bundles/worktile-gantt.umd.js.map +1 -1
- package/class/event.d.ts +4 -0
- package/class/link.d.ts +14 -4
- package/components/links/links.component.d.ts +4 -3
- package/components/links/paths/curve.d.ts +11 -0
- package/components/links/paths/factory.d.ts +5 -0
- package/components/links/paths/line.d.ts +9 -0
- package/components/links/paths/path.d.ts +11 -0
- package/components/table/gantt-table.component.d.ts +8 -5
- package/esm2015/class/event.js +3 -1
- package/esm2015/class/link.js +9 -4
- package/esm2015/components/bar/bar-drag.js +13 -10
- package/esm2015/components/links/links.component.js +15 -106
- package/esm2015/components/links/paths/curve.js +118 -0
- package/esm2015/components/links/paths/factory.js +14 -0
- package/esm2015/components/links/paths/line.js +59 -0
- package/esm2015/components/links/paths/path.js +31 -0
- package/esm2015/components/main/gantt-main.component.js +2 -2
- package/esm2015/components/table/gantt-table.component.js +16 -6
- package/esm2015/gantt-upper.js +45 -2
- package/esm2015/gantt.component.js +28 -4
- package/esm2015/gantt.config.js +8 -2
- package/fesm2015/worktile-gantt.js +334 -128
- package/fesm2015/worktile-gantt.js.map +1 -1
- package/gantt-upper.d.ts +14 -1
- package/gantt.component.d.ts +6 -2
- package/gantt.config.d.ts +7 -0
- package/main.bundle.scss +12 -0
- package/package.json +1 -1
|
@@ -2,14 +2,16 @@ import * as i0 from '@angular/core';
|
|
|
2
2
|
import { InjectionToken, EventEmitter, Directive, Inject, Input, Output, ContentChild, HostBinding, Component, Pipe, ViewChild, Injectable, Optional, forwardRef, ChangeDetectionStrategy, ContentChildren, NgModule } from '@angular/core';
|
|
3
3
|
import * as i2 from '@angular/common';
|
|
4
4
|
import { CommonModule } from '@angular/common';
|
|
5
|
-
import { take, skip, takeUntil, startWith, map, pairwise, auditTime, finalize } from 'rxjs/operators';
|
|
5
|
+
import { take, skip, takeUntil, startWith, map, pairwise, auditTime, debounceTime, finalize } from 'rxjs/operators';
|
|
6
6
|
import { BehaviorSubject, Subject, merge, fromEvent } 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
|
-
import {
|
|
9
|
+
import { SelectionModel } from '@angular/cdk/collections';
|
|
10
|
+
import { coerceBooleanProperty, coerceCssPixelValue } from '@angular/cdk/coercion';
|
|
10
11
|
import * as i1 from '@angular/cdk/drag-drop';
|
|
11
12
|
import { DragDropModule } from '@angular/cdk/drag-drop';
|
|
12
13
|
import html2canvas from 'html2canvas';
|
|
14
|
+
import { __decorate, __param } from 'tslib';
|
|
13
15
|
|
|
14
16
|
class GanttDatePoint {
|
|
15
17
|
constructor(start, text, x, y, additions) {
|
|
@@ -33,6 +35,8 @@ class GanttLineClickEvent {
|
|
|
33
35
|
}
|
|
34
36
|
class GanttBarClickEvent {
|
|
35
37
|
}
|
|
38
|
+
class GanttSelectedEvent {
|
|
39
|
+
}
|
|
36
40
|
|
|
37
41
|
class GanttDate {
|
|
38
42
|
constructor(date) {
|
|
@@ -203,11 +207,16 @@ var GanttViewType;
|
|
|
203
207
|
|
|
204
208
|
var GanttLinkType;
|
|
205
209
|
(function (GanttLinkType) {
|
|
206
|
-
GanttLinkType[GanttLinkType["fs"] =
|
|
207
|
-
GanttLinkType[GanttLinkType["ss"] = 1] = "ss";
|
|
210
|
+
GanttLinkType[GanttLinkType["fs"] = 1] = "fs";
|
|
208
211
|
GanttLinkType[GanttLinkType["ff"] = 2] = "ff";
|
|
209
|
-
GanttLinkType[GanttLinkType["
|
|
212
|
+
GanttLinkType[GanttLinkType["ss"] = 3] = "ss";
|
|
213
|
+
GanttLinkType[GanttLinkType["sf"] = 4] = "sf";
|
|
210
214
|
})(GanttLinkType || (GanttLinkType = {}));
|
|
215
|
+
var GanttLinkPathType;
|
|
216
|
+
(function (GanttLinkPathType) {
|
|
217
|
+
GanttLinkPathType["curve"] = "curve";
|
|
218
|
+
GanttLinkPathType["line"] = "line";
|
|
219
|
+
})(GanttLinkPathType || (GanttLinkPathType = {}));
|
|
211
220
|
var LinkColors;
|
|
212
221
|
(function (LinkColors) {
|
|
213
222
|
LinkColors["default"] = "#cacaca";
|
|
@@ -324,7 +333,12 @@ const defaultConfig = {
|
|
|
324
333
|
quarter: 'QQQ',
|
|
325
334
|
year: 'yyyy年',
|
|
326
335
|
yearMonth: 'yyyy年MM月',
|
|
327
|
-
yearQuarter: 'yyyy年QQQ'
|
|
336
|
+
yearQuarter: 'yyyy年QQQ'
|
|
337
|
+
},
|
|
338
|
+
linkOptions: {
|
|
339
|
+
dependencyTypes: [GanttLinkType.fs],
|
|
340
|
+
showArrow: false,
|
|
341
|
+
linkPathType: GanttLinkPathType.curve
|
|
328
342
|
}
|
|
329
343
|
};
|
|
330
344
|
const GANTT_GLOBAL_CONFIG = new InjectionToken('GANTT_GLOBAL_CONFIG');
|
|
@@ -794,8 +808,32 @@ class GanttUpper {
|
|
|
794
808
|
this.expandChange = new EventEmitter();
|
|
795
809
|
this.firstChange = true;
|
|
796
810
|
this.unsubscribe$ = new Subject();
|
|
811
|
+
this._selectable = false;
|
|
812
|
+
this._multiple = false;
|
|
797
813
|
this.ganttClass = true;
|
|
798
814
|
}
|
|
815
|
+
set selectable(value) {
|
|
816
|
+
var _a;
|
|
817
|
+
this._selectable = coerceBooleanProperty(value);
|
|
818
|
+
if (this._selectable) {
|
|
819
|
+
this.selectionModel = this.initSelectionModel();
|
|
820
|
+
}
|
|
821
|
+
else {
|
|
822
|
+
(_a = this.selectionModel) === null || _a === void 0 ? void 0 : _a.clear();
|
|
823
|
+
}
|
|
824
|
+
}
|
|
825
|
+
get selectable() {
|
|
826
|
+
return this._selectable;
|
|
827
|
+
}
|
|
828
|
+
set multiple(value) {
|
|
829
|
+
this._multiple = coerceBooleanProperty(value);
|
|
830
|
+
if (this.selectable) {
|
|
831
|
+
this.selectionModel = this.initSelectionModel();
|
|
832
|
+
}
|
|
833
|
+
}
|
|
834
|
+
get multiple() {
|
|
835
|
+
return this._multiple;
|
|
836
|
+
}
|
|
799
837
|
get element() {
|
|
800
838
|
return this.elementRef.nativeElement;
|
|
801
839
|
}
|
|
@@ -893,6 +931,9 @@ class GanttUpper {
|
|
|
893
931
|
this.expandChange.next();
|
|
894
932
|
this.cdr.detectChanges();
|
|
895
933
|
}
|
|
934
|
+
initSelectionModel() {
|
|
935
|
+
return new SelectionModel(this.multiple, []);
|
|
936
|
+
}
|
|
896
937
|
onInit() {
|
|
897
938
|
this.styles = Object.assign({}, defaultStyles, this.styles);
|
|
898
939
|
this.viewOptions.dateFormat = Object.assign({}, defaultConfig.dateFormat, this.config.dateFormat, this.viewOptions.dateFormat);
|
|
@@ -900,6 +941,7 @@ class GanttUpper {
|
|
|
900
941
|
this.setupGroups();
|
|
901
942
|
this.setupItems();
|
|
902
943
|
this.computeRefs();
|
|
944
|
+
this.initSelectionModel();
|
|
903
945
|
this.firstChange = false;
|
|
904
946
|
this.ngZone.onStable.pipe(take(1)).subscribe(() => {
|
|
905
947
|
this.element.style.opacity = '1';
|
|
@@ -980,9 +1022,18 @@ class GanttUpper {
|
|
|
980
1022
|
}
|
|
981
1023
|
return items.filter((item) => ids.includes(item.id));
|
|
982
1024
|
}
|
|
1025
|
+
isSelected(id) {
|
|
1026
|
+
if (!this.selectable) {
|
|
1027
|
+
return false;
|
|
1028
|
+
}
|
|
1029
|
+
if (!this.selectionModel.hasValue()) {
|
|
1030
|
+
return false;
|
|
1031
|
+
}
|
|
1032
|
+
return this.selectionModel.isSelected(id);
|
|
1033
|
+
}
|
|
983
1034
|
}
|
|
984
1035
|
GanttUpper.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0, type: GanttUpper, deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }, { token: i0.NgZone }, { token: GANTT_GLOBAL_CONFIG }], target: i0.ɵɵFactoryTarget.Directive });
|
|
985
|
-
GanttUpper.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.1.2", type: GanttUpper, inputs: { originItems: ["items", "originItems"], originGroups: ["groups", "originGroups"], viewType: "viewType", start: "start", end: "end", showTodayLine: "showTodayLine", draggable: "draggable", styles: "styles", viewOptions: "viewOptions", disabledLoadOnScroll: "disabledLoadOnScroll" }, outputs: { loadOnScroll: "loadOnScroll", dragStarted: "dragStarted", dragMoved: "dragMoved", dragEnded: "dragEnded", barClick: "barClick" }, host: { properties: { "class.gantt": "this.ganttClass" } }, queries: [{ propertyName: "barTemplate", first: true, predicate: ["bar"], descendants: true, static: true }, { propertyName: "rangeTemplate", first: true, predicate: ["range"], descendants: true, static: true }, { propertyName: "itemTemplate", first: true, predicate: ["item"], descendants: true, static: true }, { propertyName: "groupTemplate", first: true, predicate: ["group"], descendants: true, static: true }, { propertyName: "groupHeaderTemplate", first: true, predicate: ["groupHeader"], descendants: true, static: true }], ngImport: i0 });
|
|
1036
|
+
GanttUpper.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.1.2", type: GanttUpper, inputs: { originItems: ["items", "originItems"], originGroups: ["groups", "originGroups"], viewType: "viewType", start: "start", end: "end", showTodayLine: "showTodayLine", draggable: "draggable", styles: "styles", viewOptions: "viewOptions", disabledLoadOnScroll: "disabledLoadOnScroll", selectable: "selectable", multiple: "multiple" }, outputs: { loadOnScroll: "loadOnScroll", dragStarted: "dragStarted", dragMoved: "dragMoved", dragEnded: "dragEnded", barClick: "barClick" }, host: { properties: { "class.gantt": "this.ganttClass" } }, queries: [{ propertyName: "barTemplate", first: true, predicate: ["bar"], descendants: true, static: true }, { propertyName: "rangeTemplate", first: true, predicate: ["range"], descendants: true, static: true }, { propertyName: "itemTemplate", first: true, predicate: ["item"], descendants: true, static: true }, { propertyName: "groupTemplate", first: true, predicate: ["group"], descendants: true, static: true }, { propertyName: "groupHeaderTemplate", first: true, predicate: ["groupHeader"], descendants: true, static: true }], ngImport: i0 });
|
|
986
1037
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0, type: GanttUpper, decorators: [{
|
|
987
1038
|
type: Directive
|
|
988
1039
|
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }, { type: i0.NgZone }, { type: undefined, decorators: [{
|
|
@@ -1010,6 +1061,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.2", ngImpor
|
|
|
1010
1061
|
type: Input
|
|
1011
1062
|
}], disabledLoadOnScroll: [{
|
|
1012
1063
|
type: Input
|
|
1064
|
+
}], selectable: [{
|
|
1065
|
+
type: Input
|
|
1066
|
+
}], multiple: [{
|
|
1067
|
+
type: Input
|
|
1013
1068
|
}], loadOnScroll: [{
|
|
1014
1069
|
type: Output
|
|
1015
1070
|
}], dragStarted: [{
|
|
@@ -1264,9 +1319,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.2", ngImpor
|
|
|
1264
1319
|
const defaultColumnWidth = 100;
|
|
1265
1320
|
const minColumnWidth = 80;
|
|
1266
1321
|
class GanttTableComponent {
|
|
1267
|
-
constructor(gantt, elementRef) {
|
|
1322
|
+
constructor(gantt, ganttUpper, elementRef) {
|
|
1268
1323
|
this.gantt = gantt;
|
|
1324
|
+
this.ganttUpper = ganttUpper;
|
|
1269
1325
|
this.elementRef = elementRef;
|
|
1326
|
+
this.itemClick = new EventEmitter();
|
|
1270
1327
|
this.ganttTableClass = true;
|
|
1271
1328
|
this.ganttTableEmptyClass = false;
|
|
1272
1329
|
}
|
|
@@ -1296,7 +1353,8 @@ class GanttTableComponent {
|
|
|
1296
1353
|
expandGroup(group) {
|
|
1297
1354
|
this.gantt.expandGroup(group);
|
|
1298
1355
|
}
|
|
1299
|
-
expandChildren(item) {
|
|
1356
|
+
expandChildren(event, item) {
|
|
1357
|
+
event.stopPropagation();
|
|
1300
1358
|
this.gantt.expandChildren(item);
|
|
1301
1359
|
}
|
|
1302
1360
|
dragStarted(event) {
|
|
@@ -1370,8 +1428,8 @@ class GanttTableComponent {
|
|
|
1370
1428
|
return item.id || index;
|
|
1371
1429
|
}
|
|
1372
1430
|
}
|
|
1373
|
-
GanttTableComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0, type: GanttTableComponent, deps: [{ token: GANTT_ABSTRACT_TOKEN }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
1374
|
-
GanttTableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.1.2", type: GanttTableComponent, selector: "gantt-table", inputs: { groups: "groups", items: "items", columns: "columns", groupTemplate: "groupTemplate", emptyTemplate: "emptyTemplate", rowBeforeTemplate: "rowBeforeTemplate", rowAfterTemplate: "rowAfterTemplate" }, host: { properties: { "class.gantt-table": "this.ganttTableClass", "class.gantt-table-empty": "this.ganttTableEmptyClass" } }, viewQueries: [{ propertyName: "draglineElementRef", first: true, predicate: ["dragLine"], descendants: true, static: true }], usesOnChanges: true, ngImport: i0, template: "<div class=\"gantt-table-header gantt-table-row\">\n <div class=\"gantt-table-column\" *ngFor=\"let column of columnList; let i = index\" [style.width]=\"column.columnWidth\">\n <ng-container *ngIf=\"column.headerTemplateRef; else default\" [ngTemplateOutlet]=\"column.headerTemplateRef\"></ng-container>\n <ng-template #default>\n {{ column.name }}\n </ng-template>\n <div\n class=\"gantt-table-drag-trigger\"\n cdkDrag\n cdkDragLockAxis=\"x\"\n cdkDragBoundary=\".gantt\"\n (cdkDragMoved)=\"dragMoved($event, column)\"\n (cdkDragStarted)=\"dragStarted($event)\"\n (cdkDragEnded)=\"columnDragEnded($event, column)\"\n ></div>\n </div>\n</div>\n<div class=\"gantt-table-body\">\n <ng-container *ngIf=\"!groups.length && !items.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=\"groups && groups.length > 0; else itemsTemplate\">\n <ng-container *ngFor=\"let group of groups; trackBy: trackBy\">\n <div class=\"gantt-table-group\" [ngClass]=\"group.class\">\n <div class=\"gantt-table-group-title\" [class.expanded]=\"group.expanded\" (click)=\"expandGroup(group)\">\n <gantt-icon class=\"expand-icon\" [iconName]=\"group.expanded ? 'angle-down' : 'angle-right'\"></gantt-icon>\n <ng-container *ngIf=\"groupTemplate; else default\">\n <ng-template\n [ngTemplateOutlet]=\"groupTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: group.origin, group: group.origin }\"\n ></ng-template>\n </ng-container>\n <ng-template #default>\n <span class=\"group-title\">{{ group.title }}</span>\n </ng-template>\n </div>\n </div>\n\n <ng-container *ngIf=\"group.expanded\">\n <ng-template\n [ngTemplateOutlet]=\"ganttItems\"\n [ngTemplateOutletContext]=\"{ group: group, items: group.items, level: 0 }\"\n ></ng-template>\n </ng-container>\n </ng-container>\n </ng-container>\n</div>\n\n<div\n class=\"gantt-table-drag-trigger\"\n cdkDrag\n cdkDragLockAxis=\"x\"\n cdkDragBoundary=\".gantt\"\n (cdkDragMoved)=\"dragMoved($event)\"\n (cdkDragStarted)=\"dragStarted($event)\"\n (cdkDragEnded)=\"tableDragEnded($event)\"\n></div>\n\n<div #dragLine class=\"gantt-table-drag-auxiliary-line\"></div>\n\n<ng-template #itemsTemplate>\n <ng-template [ngTemplateOutlet]=\"ganttItems\" [ngTemplateOutletContext]=\"{ items: items, level: 0 }\"></ng-template>\n</ng-template>\n\n<ng-template #ganttItems let-group=\"group\" let-items=\"items\" let-level=\"level\">\n <ng-container *ngFor=\"let item of items; trackBy: trackBy\">\n <div\n class=\"gantt-table-item gantt-table-row\"\n [class.gantt-table-item-first-level-group]=\"level === 0 && (item.type | isGanttRangeItem)\"\n [class.gantt-table-item-with-group]=\"group\"\n [style.height.px]=\"gantt.styles.lineHeight\"\n [style.lineHeight.px]=\"gantt.styles.lineHeight\"\n >\n <ng-template\n [ngTemplateOutlet]=\"rowBeforeTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: item.origin, item: item.origin }\"\n ></ng-template>\n <div class=\"gantt-table-column\" *ngFor=\"let column of columnList; let first = first\" [style.width]=\"column.columnWidth\">\n <div *ngIf=\"first\" class=\"gantt-expand-icon\" [style.marginLeft.px]=\"level * 20\">\n <ng-container *ngIf=\"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(item)\"\n ></gantt-icon>\n <gantt-icon *ngIf=\"item.loading\" [iconName]=\"'loading'\"></gantt-icon>\n </ng-container>\n </div>\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
|
|
1431
|
+
GanttTableComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0, type: GanttTableComponent, deps: [{ token: GANTT_ABSTRACT_TOKEN }, { token: GANTT_UPPER_TOKEN }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
1432
|
+
GanttTableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.1.2", type: GanttTableComponent, selector: "gantt-table", inputs: { groups: "groups", items: "items", columns: "columns", groupTemplate: "groupTemplate", emptyTemplate: "emptyTemplate", rowBeforeTemplate: "rowBeforeTemplate", rowAfterTemplate: "rowAfterTemplate" }, outputs: { itemClick: "itemClick" }, host: { properties: { "class.gantt-table": "this.ganttTableClass", "class.gantt-table-empty": "this.ganttTableEmptyClass" } }, viewQueries: [{ propertyName: "draglineElementRef", first: true, predicate: ["dragLine"], descendants: true, static: true }], usesOnChanges: true, ngImport: i0, template: "<div class=\"gantt-table-header gantt-table-row\">\n <div class=\"gantt-table-column\" *ngFor=\"let column of columnList; let i = index\" [style.width]=\"column.columnWidth\">\n <ng-container *ngIf=\"column.headerTemplateRef; else default\" [ngTemplateOutlet]=\"column.headerTemplateRef\"></ng-container>\n <ng-template #default>\n {{ column.name }}\n </ng-template>\n <div\n class=\"gantt-table-drag-trigger\"\n cdkDrag\n cdkDragLockAxis=\"x\"\n cdkDragBoundary=\".gantt\"\n (cdkDragMoved)=\"dragMoved($event, column)\"\n (cdkDragStarted)=\"dragStarted($event)\"\n (cdkDragEnded)=\"columnDragEnded($event, column)\"\n ></div>\n </div>\n</div>\n<div class=\"gantt-table-body\">\n <ng-container *ngIf=\"!groups.length && !items.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=\"groups && groups.length > 0; else itemsTemplate\">\n <ng-container *ngFor=\"let group of groups; trackBy: trackBy\">\n <div class=\"gantt-table-group\" [ngClass]=\"group.class\">\n <div class=\"gantt-table-group-title\" [class.expanded]=\"group.expanded\" (click)=\"expandGroup(group)\">\n <gantt-icon class=\"expand-icon\" [iconName]=\"group.expanded ? 'angle-down' : 'angle-right'\"></gantt-icon>\n <ng-container *ngIf=\"groupTemplate; else default\">\n <ng-template\n [ngTemplateOutlet]=\"groupTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: group.origin, group: group.origin }\"\n ></ng-template>\n </ng-container>\n <ng-template #default>\n <span class=\"group-title\">{{ group.title }}</span>\n </ng-template>\n </div>\n </div>\n\n <ng-container *ngIf=\"group.expanded\">\n <ng-template\n [ngTemplateOutlet]=\"ganttItems\"\n [ngTemplateOutletContext]=\"{ group: group, items: group.items, level: 0 }\"\n ></ng-template>\n </ng-container>\n </ng-container>\n </ng-container>\n</div>\n\n<div\n class=\"gantt-table-drag-trigger\"\n cdkDrag\n cdkDragLockAxis=\"x\"\n cdkDragBoundary=\".gantt\"\n (cdkDragMoved)=\"dragMoved($event)\"\n (cdkDragStarted)=\"dragStarted($event)\"\n (cdkDragEnded)=\"tableDragEnded($event)\"\n></div>\n\n<div #dragLine class=\"gantt-table-drag-auxiliary-line\"></div>\n\n<ng-template #itemsTemplate>\n <ng-template [ngTemplateOutlet]=\"ganttItems\" [ngTemplateOutletContext]=\"{ items: items, level: 0 }\"></ng-template>\n</ng-template>\n\n<ng-template #ganttItems let-group=\"group\" let-items=\"items\" let-level=\"level\">\n <ng-container *ngFor=\"let item of items; trackBy: trackBy\">\n <div\n (click)=\"itemClick.emit({ event: $event, selectedValue: this.item.origin })\"\n class=\"gantt-table-item gantt-table-row\"\n [class.gantt-table-item-first-level-group]=\"level === 0 && (item.type | isGanttRangeItem)\"\n [class.gantt-table-item-with-group]=\"group\"\n [class.gantt-table-item-active]=\"ganttUpper.isSelected(item.id)\"\n [style.height.px]=\"gantt.styles.lineHeight\"\n [style.lineHeight.px]=\"gantt.styles.lineHeight\"\n >\n <ng-template\n [ngTemplateOutlet]=\"rowBeforeTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: item.origin, item: item.origin }\"\n ></ng-template>\n <div class=\"gantt-table-column\" *ngFor=\"let column of columnList; let first = first\" [style.width]=\"column.columnWidth\">\n <div *ngIf=\"first\" class=\"gantt-expand-icon\" [style.marginLeft.px]=\"level * 20\">\n <ng-container *ngIf=\"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 ></gantt-icon>\n <gantt-icon *ngIf=\"item.loading\" [iconName]=\"'loading'\"></gantt-icon>\n </ng-container>\n </div>\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-template\n *ngIf=\"item.children && item.expanded\"\n [ngTemplateOutlet]=\"ganttItems\"\n [ngTemplateOutletContext]=\"{ items: item.children, level: level + 1, group: group }\"\n ></ng-template>\n </ng-container>\n</ng-template>\n", components: [{ type: GanttIconComponent, selector: "gantt-icon", inputs: ["iconName"] }], directives: [{ type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i1.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragDisabled", "cdkDragStartDelay", "cdkDragLockAxis", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragBoundary", "cdkDragRootElement", "cdkDragData", "cdkDragFreeDragPosition"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], pipes: { "isGanttRangeItem": IsGanttRangeItemPipe } });
|
|
1375
1433
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0, type: GanttTableComponent, decorators: [{
|
|
1376
1434
|
type: Component,
|
|
1377
1435
|
args: [{
|
|
@@ -1381,6 +1439,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.2", ngImpor
|
|
|
1381
1439
|
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
1382
1440
|
type: Inject,
|
|
1383
1441
|
args: [GANTT_ABSTRACT_TOKEN]
|
|
1442
|
+
}] }, { type: GanttUpper, decorators: [{
|
|
1443
|
+
type: Inject,
|
|
1444
|
+
args: [GANTT_UPPER_TOKEN]
|
|
1384
1445
|
}] }, { type: i0.ElementRef }]; }, propDecorators: { groups: [{
|
|
1385
1446
|
type: Input
|
|
1386
1447
|
}], items: [{
|
|
@@ -1395,6 +1456,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.2", ngImpor
|
|
|
1395
1456
|
type: Input
|
|
1396
1457
|
}], rowAfterTemplate: [{
|
|
1397
1458
|
type: Input
|
|
1459
|
+
}], itemClick: [{
|
|
1460
|
+
type: Output
|
|
1398
1461
|
}], draglineElementRef: [{
|
|
1399
1462
|
type: ViewChild,
|
|
1400
1463
|
args: ['dragLine', { static: true }]
|
|
@@ -1856,6 +1919,214 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.2", ngImpor
|
|
|
1856
1919
|
args: ['mainTemplate', { static: true }]
|
|
1857
1920
|
}] } });
|
|
1858
1921
|
|
|
1922
|
+
class GanttLinkPath {
|
|
1923
|
+
constructor() { }
|
|
1924
|
+
generatePath(source, target, type) {
|
|
1925
|
+
if (source.before && source.after && target.before && target.after) {
|
|
1926
|
+
let path = '';
|
|
1927
|
+
switch (type) {
|
|
1928
|
+
case GanttLinkType.ss:
|
|
1929
|
+
path = this.generateSSPath(source, target);
|
|
1930
|
+
break;
|
|
1931
|
+
case GanttLinkType.ff:
|
|
1932
|
+
path = this.generateFFPath(source, target);
|
|
1933
|
+
break;
|
|
1934
|
+
case GanttLinkType.sf:
|
|
1935
|
+
path = this.generateFSAndSFPath(source, target, type);
|
|
1936
|
+
break;
|
|
1937
|
+
default:
|
|
1938
|
+
path = this.generateFSAndSFPath(source, target);
|
|
1939
|
+
}
|
|
1940
|
+
return path;
|
|
1941
|
+
}
|
|
1942
|
+
}
|
|
1943
|
+
}
|
|
1944
|
+
GanttLinkPath.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0, type: GanttLinkPath, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1945
|
+
GanttLinkPath.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0, type: GanttLinkPath });
|
|
1946
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0, type: GanttLinkPath, decorators: [{
|
|
1947
|
+
type: Injectable
|
|
1948
|
+
}], ctorParameters: function () { return []; } });
|
|
1949
|
+
|
|
1950
|
+
let GanttLinkPathCurve = class GanttLinkPathCurve extends GanttLinkPath {
|
|
1951
|
+
constructor(ganttUpper) {
|
|
1952
|
+
super();
|
|
1953
|
+
this.ganttUpper = ganttUpper;
|
|
1954
|
+
this.bezierWeight = -0.5;
|
|
1955
|
+
}
|
|
1956
|
+
generateSSPath(source, target) {
|
|
1957
|
+
const x1 = source.before.x;
|
|
1958
|
+
const y1 = source.before.y;
|
|
1959
|
+
const x4 = target.before.x;
|
|
1960
|
+
const y4 = target.before.y;
|
|
1961
|
+
const isMirror = y4 > y1 ? 0 : 1;
|
|
1962
|
+
const radius = Math.abs(y4 - y1) / 2;
|
|
1963
|
+
if (x4 > x1) {
|
|
1964
|
+
return `M ${x1} ${y1}
|
|
1965
|
+
A ${radius} ${radius} 0 1 ${isMirror} ${x1} ${y4}
|
|
1966
|
+
L ${x4} ${y4}`;
|
|
1967
|
+
}
|
|
1968
|
+
else {
|
|
1969
|
+
return `M ${x1} ${y1}
|
|
1970
|
+
L ${x4} ${y1}
|
|
1971
|
+
A ${radius} ${radius} 0 1 ${isMirror} ${x4} ${y4}`;
|
|
1972
|
+
}
|
|
1973
|
+
}
|
|
1974
|
+
generateFFPath(source, target) {
|
|
1975
|
+
const x1 = source.after.x;
|
|
1976
|
+
const y1 = source.after.y;
|
|
1977
|
+
const x4 = target.after.x;
|
|
1978
|
+
const y4 = target.after.y;
|
|
1979
|
+
const isMirror = y4 > y1 ? 1 : 0;
|
|
1980
|
+
const radius = Math.abs(y4 - y1) / 2;
|
|
1981
|
+
if (x4 > x1) {
|
|
1982
|
+
return `M ${x1} ${y1}
|
|
1983
|
+
L ${x4} ${y1}
|
|
1984
|
+
A ${radius} ${radius} 0 1 ${isMirror} ${x4} ${y4}`;
|
|
1985
|
+
}
|
|
1986
|
+
else {
|
|
1987
|
+
return `M ${x1} ${y1}
|
|
1988
|
+
A ${radius} ${radius} 0 1 ${isMirror} ${x1} ${y4}
|
|
1989
|
+
L ${x4} ${y4}`;
|
|
1990
|
+
}
|
|
1991
|
+
}
|
|
1992
|
+
generateFSAndSFPath(source, target, type) {
|
|
1993
|
+
let x1 = source.after.x;
|
|
1994
|
+
let y1 = source.after.y;
|
|
1995
|
+
let x4 = target.before.x;
|
|
1996
|
+
let y4 = target.before.y;
|
|
1997
|
+
if (type === GanttLinkType.sf) {
|
|
1998
|
+
x1 = target.after.x;
|
|
1999
|
+
y1 = target.after.y;
|
|
2000
|
+
x4 = source.before.x;
|
|
2001
|
+
y4 = source.before.y;
|
|
2002
|
+
}
|
|
2003
|
+
const dx = Math.abs(x4 - x1) * this.bezierWeight;
|
|
2004
|
+
const x2 = x1 - dx;
|
|
2005
|
+
const x3 = x4 + dx;
|
|
2006
|
+
const centerX = (x1 + x4) / 2;
|
|
2007
|
+
const centerY = (y1 + y4) / 2;
|
|
2008
|
+
let controlX = this.ganttUpper.styles.lineHeight / 2;
|
|
2009
|
+
const controlY = this.ganttUpper.styles.lineHeight / 2;
|
|
2010
|
+
if (x1 >= x4) {
|
|
2011
|
+
if (y4 > y1) {
|
|
2012
|
+
if (Math.abs(y4 - y1) <= this.ganttUpper.styles.lineHeight) {
|
|
2013
|
+
return `M ${x1} ${y1}
|
|
2014
|
+
C ${x1 + controlX} ${y1} ${x1 + controlX} ${y1 + controlX} ${x1} ${y1 + controlY}
|
|
2015
|
+
L ${x4} ${y4 - controlY}
|
|
2016
|
+
C ${x4 - controlY} ${y4 - controlY} ${x4 - controlX} ${y4} ${x4} ${y4}`;
|
|
2017
|
+
}
|
|
2018
|
+
else {
|
|
2019
|
+
controlX = this.ganttUpper.styles.lineHeight;
|
|
2020
|
+
return `M ${x1} ${y1}
|
|
2021
|
+
C ${x1 + controlX} ${y1} ${x1 + controlX} ${y1 + controlX} ${centerX} ${centerY}
|
|
2022
|
+
C ${x4 - controlX} ${y4 - controlX} ${x4 - controlX} ${y4} ${x4} ${y4}
|
|
2023
|
+
`;
|
|
2024
|
+
}
|
|
2025
|
+
}
|
|
2026
|
+
else {
|
|
2027
|
+
if (Math.abs(y4 - y1) <= this.ganttUpper.styles.lineHeight) {
|
|
2028
|
+
return `M ${x1} ${y1}
|
|
2029
|
+
C ${x1 + controlX} ${y1} ${x1 + controlX} ${y1 - controlX} ${x1} ${y1 - controlY}
|
|
2030
|
+
L ${x4} ${y4 + controlY}
|
|
2031
|
+
C ${x4 - controlY} ${y4 + controlY} ${x4 - controlX} ${y4} ${x4} ${y4}
|
|
2032
|
+
`;
|
|
2033
|
+
}
|
|
2034
|
+
else {
|
|
2035
|
+
controlX = this.ganttUpper.styles.lineHeight;
|
|
2036
|
+
return `M ${x1} ${y1}
|
|
2037
|
+
C ${x1 + controlX} ${y1} ${x1 + controlX} ${y1 - controlX} ${centerX} ${centerY}
|
|
2038
|
+
C ${x4 - controlX} ${y4 + controlX} ${x4 - controlX} ${y4} ${x4} ${y4}
|
|
2039
|
+
`;
|
|
2040
|
+
}
|
|
2041
|
+
}
|
|
2042
|
+
}
|
|
2043
|
+
else if (x4 - x1 < 100) {
|
|
2044
|
+
const radius = Math.abs(y4 - y1) / 4;
|
|
2045
|
+
let lindWidth = x4 - x1 - radius;
|
|
2046
|
+
lindWidth = Math.max(lindWidth, radius);
|
|
2047
|
+
return `M ${x1} ${y1}
|
|
2048
|
+
L ${x1 + lindWidth} ${y1}
|
|
2049
|
+
A ${radius} ${radius} 0 1 ${y4 > y1 ? 1 : 0} ${x1 + lindWidth} ${y4 > y1 ? y1 + 2 * radius : y1 - 2 * radius}
|
|
2050
|
+
L ${x4 - lindWidth} ${y4 > y1 ? y1 + 2 * radius : y1 - 2 * radius}
|
|
2051
|
+
A ${radius} ${radius} 0 1 ${y4 > y1 ? 0 : 1} ${x4 - lindWidth} ${y4}
|
|
2052
|
+
L ${x4} ${y4}
|
|
2053
|
+
`;
|
|
2054
|
+
}
|
|
2055
|
+
return `M ${x1} ${y1} C ${x2} ${y1} ${x3} ${y4} ${x4} ${y4}`;
|
|
2056
|
+
}
|
|
2057
|
+
};
|
|
2058
|
+
GanttLinkPathCurve = __decorate([
|
|
2059
|
+
__param(0, Inject(GANTT_UPPER_TOKEN))
|
|
2060
|
+
], GanttLinkPathCurve);
|
|
2061
|
+
|
|
2062
|
+
class GanttLinkPathLine extends GanttLinkPath {
|
|
2063
|
+
constructor() {
|
|
2064
|
+
super();
|
|
2065
|
+
this.pathControl = 20;
|
|
2066
|
+
}
|
|
2067
|
+
generateSSPath(source, target) {
|
|
2068
|
+
const x1 = source.before.x;
|
|
2069
|
+
const y1 = source.before.y;
|
|
2070
|
+
const x4 = target.before.x;
|
|
2071
|
+
const y4 = target.before.y;
|
|
2072
|
+
const control = this.pathControl;
|
|
2073
|
+
const centerY = (y1 + y4) / 2;
|
|
2074
|
+
return `M ${x1} ${y1}
|
|
2075
|
+
L ${x4 > x1 ? x1 - control : x4 - control} ${y1}
|
|
2076
|
+
L ${x4 > x1 ? x1 - control : x4 - control} ${y4}
|
|
2077
|
+
L ${x4} ${y4}`;
|
|
2078
|
+
}
|
|
2079
|
+
generateFFPath(source, target) {
|
|
2080
|
+
const x1 = source.after.x;
|
|
2081
|
+
const y1 = source.after.y;
|
|
2082
|
+
const x4 = target.after.x;
|
|
2083
|
+
const y4 = target.after.y;
|
|
2084
|
+
const control = this.pathControl;
|
|
2085
|
+
return `M ${x1} ${y1}
|
|
2086
|
+
L ${x4 > x1 ? x4 + control : x1 + control} ${y1}
|
|
2087
|
+
L ${x4 > x1 ? x4 + control : x1 + control} ${y4}
|
|
2088
|
+
L ${x4} ${y4}`;
|
|
2089
|
+
}
|
|
2090
|
+
generateFSAndSFPath(source, target, type) {
|
|
2091
|
+
let x1 = source.after.x;
|
|
2092
|
+
let y1 = source.after.y;
|
|
2093
|
+
let x4 = target.before.x;
|
|
2094
|
+
let y4 = target.before.y;
|
|
2095
|
+
const control = this.pathControl;
|
|
2096
|
+
if (type === GanttLinkType.sf) {
|
|
2097
|
+
x1 = target.after.x;
|
|
2098
|
+
y1 = target.after.y;
|
|
2099
|
+
x4 = source.before.x;
|
|
2100
|
+
y4 = source.before.y;
|
|
2101
|
+
}
|
|
2102
|
+
if (x4 - x1 >= 40) {
|
|
2103
|
+
return `M ${x1} ${y1}
|
|
2104
|
+
L ${x1 + control} ${y1}
|
|
2105
|
+
L ${x1 + control} ${y4}
|
|
2106
|
+
L ${x4} ${y4}`;
|
|
2107
|
+
}
|
|
2108
|
+
else {
|
|
2109
|
+
return `M ${x1} ${y1}
|
|
2110
|
+
L ${x1 + control} ${y1}
|
|
2111
|
+
L ${x1 + control} ${y4 > y1 ? y1 + control : y1 - control}
|
|
2112
|
+
L ${x4 - control} ${y4 > y1 ? y1 + control : y1 - control}
|
|
2113
|
+
L ${x4 - control} ${y4}
|
|
2114
|
+
L ${x4} ${y4}`;
|
|
2115
|
+
}
|
|
2116
|
+
}
|
|
2117
|
+
}
|
|
2118
|
+
|
|
2119
|
+
function generatePathFactory(type, ganttUpper) {
|
|
2120
|
+
switch (type) {
|
|
2121
|
+
case GanttLinkPathType.curve:
|
|
2122
|
+
return new GanttLinkPathCurve(ganttUpper);
|
|
2123
|
+
case GanttLinkPathType.line:
|
|
2124
|
+
return new GanttLinkPathLine();
|
|
2125
|
+
default:
|
|
2126
|
+
throw new Error('gantt link path type invalid');
|
|
2127
|
+
}
|
|
2128
|
+
}
|
|
2129
|
+
|
|
1859
2130
|
class GanttLinksComponent {
|
|
1860
2131
|
constructor(ganttUpper, cdr, elementRef, ganttDragContainer) {
|
|
1861
2132
|
this.ganttUpper = ganttUpper;
|
|
@@ -1866,20 +2137,23 @@ class GanttLinksComponent {
|
|
|
1866
2137
|
this.items = [];
|
|
1867
2138
|
this.lineClick = new EventEmitter();
|
|
1868
2139
|
this.links = [];
|
|
2140
|
+
this.ganttLinkTypes = GanttLinkType;
|
|
2141
|
+
this.showArrow = false;
|
|
1869
2142
|
this.linkItems = [];
|
|
1870
|
-
this.bezierWeight = -0.5;
|
|
1871
2143
|
this.firstChange = true;
|
|
1872
2144
|
this.unsubscribe$ = new Subject();
|
|
1873
2145
|
this.ganttLinksOverlay = true;
|
|
1874
2146
|
}
|
|
1875
2147
|
ngOnInit() {
|
|
2148
|
+
this.linkPath = generatePathFactory(this.ganttUpper.linkOptions.linkPathType, this.ganttUpper);
|
|
2149
|
+
this.showArrow = this.ganttUpper.linkOptions.showArrow;
|
|
1876
2150
|
this.buildLinks();
|
|
1877
2151
|
this.firstChange = false;
|
|
1878
2152
|
this.ganttDragContainer.dragStarted.pipe(takeUntil(this.unsubscribe$)).subscribe(() => {
|
|
1879
2153
|
this.elementRef.nativeElement.style.visibility = 'hidden';
|
|
1880
2154
|
});
|
|
1881
2155
|
merge(this.ganttUpper.viewChange, this.ganttUpper.expandChange, this.ganttUpper.view.start$, this.ganttUpper.dragEnded, this.ganttUpper.linkDragEnded)
|
|
1882
|
-
.pipe(takeUntil(this.unsubscribe$), skip(1))
|
|
2156
|
+
.pipe(takeUntil(this.unsubscribe$), skip(1), debounceTime(0))
|
|
1883
2157
|
.subscribe(() => {
|
|
1884
2158
|
this.elementRef.nativeElement.style.visibility = 'visible';
|
|
1885
2159
|
this.buildLinks();
|
|
@@ -1930,105 +2204,6 @@ class GanttLinksComponent {
|
|
|
1930
2204
|
});
|
|
1931
2205
|
}
|
|
1932
2206
|
}
|
|
1933
|
-
generatePath(source, target, type) {
|
|
1934
|
-
if (source.before && source.after && target.before && target.after) {
|
|
1935
|
-
let x1 = source.after.x;
|
|
1936
|
-
let y1 = source.after.y;
|
|
1937
|
-
let x4 = target.before.x;
|
|
1938
|
-
let y4 = target.before.y;
|
|
1939
|
-
let isMirror;
|
|
1940
|
-
const control = Math.abs(y4 - y1) / 2;
|
|
1941
|
-
switch (type) {
|
|
1942
|
-
case GanttLinkType.ss:
|
|
1943
|
-
x1 = source.before.x;
|
|
1944
|
-
y1 = source.before.y;
|
|
1945
|
-
x4 = target.before.x;
|
|
1946
|
-
y4 = target.before.y;
|
|
1947
|
-
isMirror = y4 > y1 ? 0 : 1;
|
|
1948
|
-
if (x4 > x1) {
|
|
1949
|
-
return `M ${x1} ${y1}
|
|
1950
|
-
A ${control} ${control} 0 1 ${isMirror} ${x1} ${y4}
|
|
1951
|
-
L ${x1} ${y4} ${x4} ${y4}`;
|
|
1952
|
-
}
|
|
1953
|
-
else {
|
|
1954
|
-
return `M ${x1} ${y1}
|
|
1955
|
-
L ${x1} ${y1} ${x4} ${y1}
|
|
1956
|
-
A ${control} ${control} 0 1 ${isMirror} ${x4} ${y4}`;
|
|
1957
|
-
}
|
|
1958
|
-
case GanttLinkType.ff:
|
|
1959
|
-
x1 = source.after.x;
|
|
1960
|
-
y1 = source.after.y;
|
|
1961
|
-
x4 = target.after.x;
|
|
1962
|
-
y4 = target.after.y;
|
|
1963
|
-
isMirror = y4 > y1 ? 1 : 0;
|
|
1964
|
-
if (x4 > x1) {
|
|
1965
|
-
return `M ${x1} ${y1}
|
|
1966
|
-
L ${x1} ${y1} ${x4} ${y1}
|
|
1967
|
-
A ${control} ${control} 0 1 ${isMirror} ${x4} ${y4}`;
|
|
1968
|
-
}
|
|
1969
|
-
else {
|
|
1970
|
-
return `M ${x1} ${y1}
|
|
1971
|
-
A ${control} ${control} 0 1 ${isMirror} ${x1} ${y4}
|
|
1972
|
-
L ${x1} ${y4} ${x4} ${y4}`;
|
|
1973
|
-
}
|
|
1974
|
-
case GanttLinkType.sf:
|
|
1975
|
-
x1 = target.after.x;
|
|
1976
|
-
y1 = target.after.y;
|
|
1977
|
-
x4 = source.before.x;
|
|
1978
|
-
y4 = source.before.y;
|
|
1979
|
-
}
|
|
1980
|
-
const dx = Math.abs(x4 - x1) * this.bezierWeight;
|
|
1981
|
-
const x2 = x1 - dx;
|
|
1982
|
-
const x3 = x4 + dx;
|
|
1983
|
-
const centerX = (x1 + x4) / 2;
|
|
1984
|
-
const centerY = (y1 + y4) / 2;
|
|
1985
|
-
let controlX = this.ganttUpper.styles.lineHeight / 2;
|
|
1986
|
-
const controlY = this.ganttUpper.styles.lineHeight / 2;
|
|
1987
|
-
if (x1 >= x4) {
|
|
1988
|
-
if (y4 > y1) {
|
|
1989
|
-
if (Math.abs(y4 - y1) <= this.ganttUpper.styles.lineHeight) {
|
|
1990
|
-
return `M ${x1} ${y1}
|
|
1991
|
-
C ${x1 + controlX} ${y1} ${x1 + controlX} ${y1 + controlX} ${x1} ${y1 + controlY}
|
|
1992
|
-
L ${x1} ${y1 + controlY} ${centerX} ${centerY}
|
|
1993
|
-
|
|
1994
|
-
M ${x4} ${y4}
|
|
1995
|
-
C ${x4 - controlX} ${y4} ${x4 - controlX} ${y4 - controlX} ${x4} ${y4 - controlY}
|
|
1996
|
-
L ${x4} ${y4 - controlY} ${centerX} ${centerY}`;
|
|
1997
|
-
}
|
|
1998
|
-
else {
|
|
1999
|
-
controlX = this.ganttUpper.styles.lineHeight;
|
|
2000
|
-
return `M ${x1} ${y1}
|
|
2001
|
-
C ${x1 + controlX} ${y1} ${x1 + controlX} ${y1 + controlX} ${centerX} ${centerY}
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
M ${x4} ${y4}
|
|
2005
|
-
C ${x4 - controlX} ${y4} ${x4 - controlX} ${y4 - controlX} ${centerX} ${centerY}`;
|
|
2006
|
-
}
|
|
2007
|
-
}
|
|
2008
|
-
else {
|
|
2009
|
-
if (Math.abs(y4 - y1) <= this.ganttUpper.styles.lineHeight) {
|
|
2010
|
-
return `M ${x1} ${y1}
|
|
2011
|
-
C ${x1 + controlX} ${y1} ${x1 + controlX} ${y1 - controlX} ${x1} ${y1 - controlY}
|
|
2012
|
-
L ${x1} ${y1 - controlY} ${centerX} ${centerY}
|
|
2013
|
-
|
|
2014
|
-
M ${x4} ${y4}
|
|
2015
|
-
C ${x4 - controlX} ${y4} ${x4 - controlX} ${y4 + controlX} ${x4} ${y4 + controlY}
|
|
2016
|
-
L ${x4} ${y4 + controlY} ${centerX} ${centerY}
|
|
2017
|
-
`;
|
|
2018
|
-
}
|
|
2019
|
-
else {
|
|
2020
|
-
controlX = this.ganttUpper.styles.lineHeight;
|
|
2021
|
-
return `M ${x1} ${y1}
|
|
2022
|
-
C ${x1 + controlX} ${y1} ${x1 + controlX} ${y1 - controlX} ${centerX} ${centerY}
|
|
2023
|
-
|
|
2024
|
-
M ${x4} ${y4}
|
|
2025
|
-
C ${x4 - controlX} ${y4} ${x4 - controlX} ${y4 + controlX} ${centerX} ${centerY}`;
|
|
2026
|
-
}
|
|
2027
|
-
}
|
|
2028
|
-
}
|
|
2029
|
-
return `M ${x1} ${y1} C ${x2} ${y1} ${x3} ${y4} ${x4} ${y4}`;
|
|
2030
|
-
}
|
|
2031
|
-
}
|
|
2032
2207
|
buildLinks() {
|
|
2033
2208
|
this.computeItemPosition();
|
|
2034
2209
|
this.links = [];
|
|
@@ -2037,12 +2212,16 @@ class GanttLinksComponent {
|
|
|
2037
2212
|
source.links.forEach((link) => {
|
|
2038
2213
|
const target = this.linkItems.find((item) => item.id === link.link);
|
|
2039
2214
|
if (target && (target.origin.start || target.origin.end)) {
|
|
2215
|
+
let color = LinkColors.default;
|
|
2216
|
+
if (link.type === GanttLinkType.fs && source.end.getTime() > target.start.getTime()) {
|
|
2217
|
+
color = LinkColors.blocked;
|
|
2218
|
+
}
|
|
2040
2219
|
this.links.push({
|
|
2041
|
-
path: this.generatePath(source, target, link.type),
|
|
2220
|
+
path: this.linkPath.generatePath(source, target, link.type),
|
|
2042
2221
|
source: source.origin,
|
|
2043
2222
|
target: target.origin,
|
|
2044
2223
|
type: link.type,
|
|
2045
|
-
color:
|
|
2224
|
+
color: link.color || color
|
|
2046
2225
|
});
|
|
2047
2226
|
}
|
|
2048
2227
|
});
|
|
@@ -2075,7 +2254,7 @@ class GanttLinksComponent {
|
|
|
2075
2254
|
}
|
|
2076
2255
|
}
|
|
2077
2256
|
GanttLinksComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0, type: GanttLinksComponent, deps: [{ token: GANTT_UPPER_TOKEN }, { token: i0.ChangeDetectorRef }, { token: i0.ElementRef }, { token: GanttDragContainer }], target: i0.ɵɵFactoryTarget.Component });
|
|
2078
|
-
GanttLinksComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.1.2", type: GanttLinksComponent, selector: "gantt-links-overlay", inputs: { groups: "groups", items: "items" }, outputs: { lineClick: "lineClick" }, host: { properties: { "class.gantt-links-overlay": "this.ganttLinksOverlay" } }, usesOnChanges: true, ngImport: i0, template: "<svg [attr.width]=\"ganttUpper.view.width\" class=\"gantt-links-overlay-main\">\n <ng-container *ngFor=\"let link of links; let i = index; trackBy: trackBy\">\n <path\n [attr.d]=\"link.path\"\n fill=\"transparent\"\n stroke-width=\"2\"\n [attr.stroke]=\"link.color\"\n pointer-events=\"none\"\n [style]=\"'marker-end: url(#triangle' + i + ')'\"\n ></path>\n <g>\n <path\n class=\"link-line\"\n (click)=\"onLineClick($event, link)\"\n (mouseenter)=\"mouseEnterPath(link)\"\n (mouseleave)=\"mouseLeavePath(link)\"\n [attr.d]=\"link.path\"\n stroke=\"transparent\"\n stroke-width=\"9\"\n fill=\"none\"\n cursor=\"pointer\"\n ></path>\n </g>\n
|
|
2257
|
+
GanttLinksComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.1.2", type: GanttLinksComponent, selector: "gantt-links-overlay", inputs: { groups: "groups", items: "items" }, outputs: { lineClick: "lineClick" }, host: { properties: { "class.gantt-links-overlay": "this.ganttLinksOverlay" } }, usesOnChanges: true, ngImport: i0, template: "<svg [attr.width]=\"ganttUpper.view.width\" class=\"gantt-links-overlay-main\">\n <ng-container *ngFor=\"let link of links; let i = index; trackBy: trackBy\">\n <path\n [attr.d]=\"link.path\"\n fill=\"transparent\"\n stroke-width=\"2\"\n [attr.stroke]=\"link.color\"\n pointer-events=\"none\"\n [attr.style]=\"link.type === ganttLinkTypes.sf ? 'marker-start: url(#triangle' + i + ')' : 'marker-end: url(#triangle' + i + ')'\"\n ></path>\n <g>\n <path\n class=\"link-line\"\n (click)=\"onLineClick($event, link)\"\n (mouseenter)=\"mouseEnterPath(link)\"\n (mouseleave)=\"mouseLeavePath(link)\"\n [attr.d]=\"link.path\"\n stroke=\"transparent\"\n stroke-width=\"9\"\n fill=\"none\"\n cursor=\"pointer\"\n ></path>\n </g>\n <defs *ngIf=\"showArrow\">\n <marker\n *ngIf=\"link.type === ganttLinkTypes.sf; else markerEnd\"\n [id]=\"'triangle' + i\"\n markerUnits=\"strokeWidth\"\n markerWidth=\"5\"\n markerHeight=\"4\"\n refX=\"5\"\n refY=\"2\"\n orient=\"180\"\n >\n <path [attr.fill]=\"link.color\" [attr.stroke]=\"link.color\" d=\"M 0 0 L 5 2 L 0 4 z\" />\n </marker>\n\n <ng-template #markerEnd>\n <marker [id]=\"'triangle' + i\" markerUnits=\"strokeWidth\" markerWidth=\"5\" markerHeight=\"4\" refX=\"5\" refY=\"2\" orient=\"auto\">\n <path [attr.fill]=\"link.color\" [attr.stroke]=\"link.color\" d=\"M 0 0 L 5 2 L 0 4 z\" />\n </marker>\n </ng-template>\n </defs>\n </ng-container>\n <line class=\"link-dragging-line\"></line>\n</svg>\n", directives: [{ type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
2079
2258
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0, type: GanttLinksComponent, decorators: [{
|
|
2080
2259
|
type: Component,
|
|
2081
2260
|
args: [{
|
|
@@ -2233,19 +2412,22 @@ class GanttBarDrag {
|
|
|
2233
2412
|
this.dragContainer.dragStarted.emit({ item: this.item.origin });
|
|
2234
2413
|
});
|
|
2235
2414
|
dragRef.moved.subscribe((event) => {
|
|
2236
|
-
const
|
|
2237
|
-
const
|
|
2238
|
-
const
|
|
2239
|
-
const
|
|
2240
|
-
|
|
2415
|
+
const currentX = this.item.refs.x + event.distance.x;
|
|
2416
|
+
const currentDate = this.ganttUpper.view.getDateByXPoint(currentX);
|
|
2417
|
+
const currentStartX = this.ganttUpper.view.getXPointByDate(currentDate);
|
|
2418
|
+
const dayWidth = this.ganttUpper.view.getDayOccupancyWidth(currentDate);
|
|
2419
|
+
const diffDays = differenceInCalendarDays(this.item.end.value, this.item.start.value);
|
|
2420
|
+
let start = currentDate;
|
|
2421
|
+
let end = currentDate.addDays(diffDays);
|
|
2422
|
+
if (currentX > currentStartX + dayWidth / 2) {
|
|
2423
|
+
start = start.addDays(1);
|
|
2424
|
+
end = end.addDays(1);
|
|
2425
|
+
}
|
|
2426
|
+
this.openDragBackdrop(this.barElement, start, end);
|
|
2241
2427
|
this.item.updateDate(start, end);
|
|
2242
2428
|
this.dragContainer.dragMoved.emit({ item: this.item.origin });
|
|
2243
2429
|
});
|
|
2244
2430
|
dragRef.ended.subscribe((event) => {
|
|
2245
|
-
const days = differenceInCalendarDays(this.item.end.value, this.item.start.value);
|
|
2246
|
-
const start = this.ganttUpper.view.getDateByXPoint(this.item.refs.x + event.distance.x);
|
|
2247
|
-
const end = start.addDays(days);
|
|
2248
|
-
this.item.updateDate(start, end);
|
|
2249
2431
|
this.clearDraggingStyles();
|
|
2250
2432
|
this.closeDragBackdrop();
|
|
2251
2433
|
event.source.reset();
|
|
@@ -2537,7 +2719,7 @@ class GanttMainComponent {
|
|
|
2537
2719
|
}
|
|
2538
2720
|
}
|
|
2539
2721
|
GanttMainComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0, type: GanttMainComponent, deps: [{ token: GANTT_UPPER_TOKEN }], target: i0.ɵɵFactoryTarget.Component });
|
|
2540
|
-
GanttMainComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.1.2", type: GanttMainComponent, selector: "gantt-main", inputs: { groups: "groups", items: "items", groupHeaderTemplate: "groupHeaderTemplate", itemTemplate: "itemTemplate", barTemplate: "barTemplate", rangeTemplate: "rangeTemplate" }, outputs: { barClick: "barClick", lineClick: "lineClick" }, host: { properties: { "class.gantt-main-container": "this.ganttMainClass" } }, ngImport: i0, template: "<gantt-links-overlay [groups]=\"groups\" [items]=\"items\" (lineClick)=\"lineClick.emit($event)\"></gantt-links-overlay>\n<!-- groups -->\n<div class=\"gantt-main-groups\" *ngIf=\"groups && groups.length > 0; else itemsTemplate\" [style.width.px]=\"ganttUpper.view.width\">\n <ng-container *ngFor=\"let group of groups; trackBy: trackBy\">\n <div class=\"gantt-group\" [ngClass]=\"group.class\">\n <ng-template [ngTemplateOutlet]=\"groupHeaderTemplate\" [ngTemplateOutletContext]=\"{ group: group }\"></ng-template>\n </div>\n <div *ngIf=\"group.expanded\" class=\"gantt-items\">\n <ng-template [ngTemplateOutlet]=\"ganttItems\" [ngTemplateOutletContext]=\"{ items: group.items }\"></ng-template>\n </div>\n </ng-container>\n</div>\n<!-- items -->\n<ng-template #itemsTemplate>\n <div class=\"gantt-main-items\" [style.width.px]=\"ganttUpper.view.width\">\n <ng-template [ngTemplateOutlet]=\"ganttItems\" [ngTemplateOutletContext]=\"{ items: items }\"></ng-template>\n </div>\n</ng-template>\n\n<ng-template #ganttItems let-items=\"items\">\n <ng-container *ngFor=\"let item of items
|
|
2722
|
+
GanttMainComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.1.2", type: GanttMainComponent, selector: "gantt-main", inputs: { groups: "groups", items: "items", groupHeaderTemplate: "groupHeaderTemplate", itemTemplate: "itemTemplate", barTemplate: "barTemplate", rangeTemplate: "rangeTemplate" }, outputs: { barClick: "barClick", lineClick: "lineClick" }, host: { properties: { "class.gantt-main-container": "this.ganttMainClass" } }, ngImport: i0, template: "<gantt-links-overlay [groups]=\"groups\" [items]=\"items\" (lineClick)=\"lineClick.emit($event)\"></gantt-links-overlay>\n<!-- groups -->\n<div class=\"gantt-main-groups\" *ngIf=\"groups && groups.length > 0; else itemsTemplate\" [style.width.px]=\"ganttUpper.view.width\">\n <ng-container *ngFor=\"let group of groups; trackBy: trackBy\">\n <div class=\"gantt-group\" [ngClass]=\"group.class\">\n <ng-template [ngTemplateOutlet]=\"groupHeaderTemplate\" [ngTemplateOutletContext]=\"{ group: group }\"></ng-template>\n </div>\n <div *ngIf=\"group.expanded\" class=\"gantt-items\">\n <ng-template [ngTemplateOutlet]=\"ganttItems\" [ngTemplateOutletContext]=\"{ items: group.items }\"></ng-template>\n </div>\n </ng-container>\n</div>\n<!-- items -->\n<ng-template #itemsTemplate>\n <div class=\"gantt-main-items\" [style.width.px]=\"ganttUpper.view.width\">\n <ng-template [ngTemplateOutlet]=\"ganttItems\" [ngTemplateOutletContext]=\"{ items: items }\"></ng-template>\n </div>\n</ng-template>\n\n<ng-template #ganttItems let-items=\"items\">\n <ng-container *ngFor=\"let item of items;\">\n <div\n class=\"gantt-item\"\n [style.height.px]=\"ganttUpper.styles.lineHeight\"\n [class.gantt-main-item-active]=\"ganttUpper.isSelected(item.id)\"\n >\n <ng-container *ngIf=\"item.type | isGanttCustomItem\">\n <ng-template [ngTemplateOutlet]=\"itemTemplate\" [ngTemplateOutletContext]=\"{ item: item.origin, refs: item.refs }\"></ng-template>\n </ng-container>\n <gantt-range *ngIf=\"item.type | isGanttRangeItem\" [template]=\"rangeTemplate\" [item]=\"item\"></gantt-range>\n <gantt-bar *ngIf=\"item.type | isGanttBarItem\" [item]=\"item\" [template]=\"barTemplate\" (barClick)=\"barClick.emit($event)\"></gantt-bar>\n </div>\n <ng-template\n *ngIf=\"item.children && item.expanded\"\n [ngTemplateOutlet]=\"ganttItems\"\n [ngTemplateOutletContext]=\"{ items: item.children }\"\n ></ng-template>\n </ng-container>\n</ng-template>\n", components: [{ type: GanttLinksComponent, selector: "gantt-links-overlay", inputs: ["groups", "items"], outputs: ["lineClick"] }, { type: NgxGanttRangeComponent, selector: "ngx-gantt-range,gantt-range" }, { type: NgxGanttBarComponent, selector: "ngx-gantt-bar,gantt-bar", outputs: ["barClick"] }], directives: [{ type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }], pipes: { "isGanttCustomItem": IsGanttCustomItemPipe, "isGanttRangeItem": IsGanttRangeItemPipe, "isGanttBarItem": IsGanttBarItemPipe } });
|
|
2541
2723
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0, type: GanttMainComponent, decorators: [{
|
|
2542
2724
|
type: Component,
|
|
2543
2725
|
args: [{
|
|
@@ -2575,11 +2757,14 @@ class NgxGanttComponent extends GanttUpper {
|
|
|
2575
2757
|
this.linkDragStarted = new EventEmitter();
|
|
2576
2758
|
this.linkDragEnded = new EventEmitter();
|
|
2577
2759
|
this.lineClick = new EventEmitter();
|
|
2760
|
+
this.selectedChange = new EventEmitter();
|
|
2578
2761
|
this.ngUnsubscribe$ = new Subject();
|
|
2579
2762
|
this.sideTableWidth = sideWidth;
|
|
2580
2763
|
}
|
|
2581
2764
|
ngOnInit() {
|
|
2765
|
+
var _a;
|
|
2582
2766
|
super.onInit();
|
|
2767
|
+
this.linkOptions = Object.assign({}, defaultConfig.linkOptions, (_a = this.config) === null || _a === void 0 ? void 0 : _a.linkOptions, this.linkOptions);
|
|
2583
2768
|
this.ngZone.onStable.pipe(take(1)).subscribe(() => {
|
|
2584
2769
|
this.dragContainer.linkDragStarted.pipe(takeUntil(this.ngUnsubscribe$)).subscribe((event) => {
|
|
2585
2770
|
this.linkDragStarted.emit(event);
|
|
@@ -2628,12 +2813,29 @@ class NgxGanttComponent extends GanttUpper {
|
|
|
2628
2813
|
this.expandChange.emit();
|
|
2629
2814
|
}
|
|
2630
2815
|
}
|
|
2816
|
+
selectItem(selectEvent) {
|
|
2817
|
+
var _a;
|
|
2818
|
+
if (!this.selectable) {
|
|
2819
|
+
return;
|
|
2820
|
+
}
|
|
2821
|
+
const { event, selectedValue } = selectEvent;
|
|
2822
|
+
this.selectionModel.toggle(selectedValue.id);
|
|
2823
|
+
const selectedIds = this.selectionModel.selected;
|
|
2824
|
+
if (this.multiple) {
|
|
2825
|
+
const selectedValue = this.getGanttItems(selectedIds).map((item) => item.origin);
|
|
2826
|
+
this.selectedChange.emit({ event, selectedValue });
|
|
2827
|
+
}
|
|
2828
|
+
else {
|
|
2829
|
+
const selectedValue = (_a = this.getGanttItem(selectedIds[0])) === null || _a === void 0 ? void 0 : _a.origin;
|
|
2830
|
+
this.selectedChange.emit({ event, selectedValue });
|
|
2831
|
+
}
|
|
2832
|
+
}
|
|
2631
2833
|
ngOnDestroy() {
|
|
2632
2834
|
super.onDestroy();
|
|
2633
2835
|
}
|
|
2634
2836
|
}
|
|
2635
2837
|
NgxGanttComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0, type: NgxGanttComponent, deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }, { token: i0.NgZone }, { token: GANTT_GLOBAL_CONFIG }], target: i0.ɵɵFactoryTarget.Component });
|
|
2636
|
-
NgxGanttComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.1.2", type: NgxGanttComponent, selector: "ngx-gantt", inputs: { maxLevel: "maxLevel", async: "async", childrenResolve: "childrenResolve", linkable: "linkable" }, outputs: { linkDragStarted: "linkDragStarted", linkDragEnded: "linkDragEnded", lineClick: "lineClick" }, providers: [
|
|
2838
|
+
NgxGanttComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.1.2", type: NgxGanttComponent, selector: "ngx-gantt", inputs: { maxLevel: "maxLevel", async: "async", childrenResolve: "childrenResolve", linkable: "linkable", linkOptions: "linkOptions" }, outputs: { linkDragStarted: "linkDragStarted", linkDragEnded: "linkDragEnded", lineClick: "lineClick", selectedChange: "selectedChange" }, providers: [
|
|
2637
2839
|
{
|
|
2638
2840
|
provide: GANTT_UPPER_TOKEN,
|
|
2639
2841
|
useExisting: NgxGanttComponent
|
|
@@ -2642,7 +2844,7 @@ NgxGanttComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", vers
|
|
|
2642
2844
|
provide: GANTT_ABSTRACT_TOKEN,
|
|
2643
2845
|
useExisting: forwardRef(() => NgxGanttComponent)
|
|
2644
2846
|
}
|
|
2645
|
-
], 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 }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<ngx-gantt-root>\n <ng-template #sideTemplate>\n <gantt-table\n [groups]=\"groups\"\n [items]=\"items\"\n [columns]=\"columns\"\n [groupTemplate]=\"groupTemplate\"\n [emptyTemplate]=\"tableEmptyTemplate\"\n [rowBeforeTemplate]=\"table?.rowBeforeTemplate\"\n [rowAfterTemplate]=\"table?.rowAfterTemplate\"\n ></gantt-table>\n </ng-template>\n <ng-template #mainTemplate>\n <gantt-main\n [groups]=\"groups\"\n [items]=\"items\"\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 </ng-template>\n</ngx-gantt-root>\n", components: [{ type: NgxGanttRootComponent, selector: "ngx-gantt-root", inputs: ["sideWidth"] }, { type: GanttTableComponent, selector: "gantt-table", inputs: ["groups", "items", "columns", "groupTemplate", "emptyTemplate", "rowBeforeTemplate", "rowAfterTemplate"] }, { type: GanttMainComponent, selector: "gantt-main", inputs: ["groups", "items", "groupHeaderTemplate", "itemTemplate", "barTemplate", "rangeTemplate"], outputs: ["barClick", "lineClick"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2847
|
+
], 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 }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<ngx-gantt-root>\n <ng-template #sideTemplate>\n <gantt-table\n [groups]=\"groups\"\n [items]=\"items\"\n [columns]=\"columns\"\n [groupTemplate]=\"groupTemplate\"\n [emptyTemplate]=\"tableEmptyTemplate\"\n [rowBeforeTemplate]=\"table?.rowBeforeTemplate\"\n [rowAfterTemplate]=\"table?.rowAfterTemplate\"\n (itemClick)=\"selectItem($event)\"\n ></gantt-table>\n </ng-template>\n <ng-template #mainTemplate>\n <gantt-main\n [groups]=\"groups\"\n [items]=\"items\"\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 </ng-template>\n</ngx-gantt-root>\n", components: [{ type: NgxGanttRootComponent, selector: "ngx-gantt-root", inputs: ["sideWidth"] }, { type: GanttTableComponent, selector: "gantt-table", inputs: ["groups", "items", "columns", "groupTemplate", "emptyTemplate", "rowBeforeTemplate", "rowAfterTemplate"], outputs: ["itemClick"] }, { type: GanttMainComponent, selector: "gantt-main", inputs: ["groups", "items", "groupHeaderTemplate", "itemTemplate", "barTemplate", "rangeTemplate"], outputs: ["barClick", "lineClick"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2646
2848
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0, type: NgxGanttComponent, decorators: [{
|
|
2647
2849
|
type: Component,
|
|
2648
2850
|
args: [{
|
|
@@ -2671,12 +2873,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.2", ngImpor
|
|
|
2671
2873
|
type: Input
|
|
2672
2874
|
}], linkable: [{
|
|
2673
2875
|
type: Input
|
|
2876
|
+
}], linkOptions: [{
|
|
2877
|
+
type: Input
|
|
2674
2878
|
}], linkDragStarted: [{
|
|
2675
2879
|
type: Output
|
|
2676
2880
|
}], linkDragEnded: [{
|
|
2677
2881
|
type: Output
|
|
2678
2882
|
}], lineClick: [{
|
|
2679
2883
|
type: Output
|
|
2884
|
+
}], selectedChange: [{
|
|
2885
|
+
type: Output
|
|
2680
2886
|
}], table: [{
|
|
2681
2887
|
type: ContentChild,
|
|
2682
2888
|
args: [NgxGanttTableComponent]
|
|
@@ -2763,5 +2969,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.2", ngImpor
|
|
|
2763
2969
|
* Generated bundle index. Do not edit.
|
|
2764
2970
|
*/
|
|
2765
2971
|
|
|
2766
|
-
export { GANTT_GLOBAL_CONFIG, GANTT_UPPER_TOKEN, GanttBarClickEvent, GanttDate, GanttDatePoint, GanttDragEvent, GanttGroupInternal, GanttItemInternal, GanttItemType, GanttItemUpper, GanttLineClickEvent, GanttLinkDragEvent, GanttLoadOnScrollEvent, GanttPrintService, GanttTableEvent, GanttUpper, GanttView, GanttViewType, IsGanttBarItemPipe, IsGanttCustomItemPipe, IsGanttRangeItemPipe, NgxGanttBarComponent, NgxGanttComponent, NgxGanttModule, NgxGanttRangeComponent, NgxGanttRootComponent, NgxGanttTableColumnComponent, NgxGanttTableComponent, defaultConfig, primaryDatePointTop, secondaryDatePointTop };
|
|
2972
|
+
export { GANTT_GLOBAL_CONFIG, GANTT_UPPER_TOKEN, GanttBarClickEvent, GanttDate, GanttDatePoint, GanttDragEvent, GanttGroupInternal, GanttItemInternal, GanttItemType, GanttItemUpper, GanttLineClickEvent, GanttLinkDragEvent, GanttLoadOnScrollEvent, GanttPrintService, GanttSelectedEvent, GanttTableEvent, GanttUpper, GanttView, GanttViewType, IsGanttBarItemPipe, IsGanttCustomItemPipe, IsGanttRangeItemPipe, NgxGanttBarComponent, NgxGanttComponent, NgxGanttModule, NgxGanttRangeComponent, NgxGanttRootComponent, NgxGanttTableColumnComponent, NgxGanttTableComponent, defaultConfig, primaryDatePointTop, secondaryDatePointTop };
|
|
2767
2973
|
//# sourceMappingURL=worktile-gantt.js.map
|