@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
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('rxjs/operators'), require('rxjs'), require('date-fns'), require('@angular/cdk/coercion'), require('@angular/cdk/drag-drop'), require('html2canvas')) :
|
|
3
|
-
typeof define === 'function' && define.amd ? define('@worktile/gantt', ['exports', '@angular/core', '@angular/common', 'rxjs/operators', 'rxjs', 'date-fns', '@angular/cdk/coercion', '@angular/cdk/drag-drop', 'html2canvas'], factory) :
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.worktile = global.worktile || {}, global.worktile.gantt = {}), global.ng.core, global.ng.common, global.rxjs.operators, global.rxjs, global.dateFns, global.ng.cdk.coercion, global.ng.cdk.dragDrop, global.html2canvas));
|
|
5
|
-
}(this, (function (exports, i0, i2, operators, rxjs, dateFns, coercion, i1, html2canvas) { 'use strict';
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('rxjs/operators'), require('rxjs'), require('date-fns'), require('@angular/cdk/collections'), require('@angular/cdk/coercion'), require('@angular/cdk/drag-drop'), require('html2canvas')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define('@worktile/gantt', ['exports', '@angular/core', '@angular/common', 'rxjs/operators', 'rxjs', 'date-fns', '@angular/cdk/collections', '@angular/cdk/coercion', '@angular/cdk/drag-drop', 'html2canvas'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.worktile = global.worktile || {}, global.worktile.gantt = {}), global.ng.core, global.ng.common, global.rxjs.operators, global.rxjs, global.dateFns, global.ng.cdk.collections, global.ng.cdk.coercion, global.ng.cdk.dragDrop, global.html2canvas));
|
|
5
|
+
}(this, (function (exports, i0, i2, operators, rxjs, dateFns, collections, coercion, i1, html2canvas) { 'use strict';
|
|
6
6
|
|
|
7
7
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
8
|
|
|
@@ -390,6 +390,11 @@
|
|
|
390
390
|
}
|
|
391
391
|
return GanttBarClickEvent;
|
|
392
392
|
}());
|
|
393
|
+
var GanttSelectedEvent = /** @class */ (function () {
|
|
394
|
+
function GanttSelectedEvent() {
|
|
395
|
+
}
|
|
396
|
+
return GanttSelectedEvent;
|
|
397
|
+
}());
|
|
393
398
|
|
|
394
399
|
var GanttDate = /** @class */ (function () {
|
|
395
400
|
function GanttDate(date) {
|
|
@@ -561,11 +566,16 @@
|
|
|
561
566
|
|
|
562
567
|
var GanttLinkType;
|
|
563
568
|
(function (GanttLinkType) {
|
|
564
|
-
GanttLinkType[GanttLinkType["fs"] =
|
|
565
|
-
GanttLinkType[GanttLinkType["ss"] = 1] = "ss";
|
|
569
|
+
GanttLinkType[GanttLinkType["fs"] = 1] = "fs";
|
|
566
570
|
GanttLinkType[GanttLinkType["ff"] = 2] = "ff";
|
|
567
|
-
GanttLinkType[GanttLinkType["
|
|
571
|
+
GanttLinkType[GanttLinkType["ss"] = 3] = "ss";
|
|
572
|
+
GanttLinkType[GanttLinkType["sf"] = 4] = "sf";
|
|
568
573
|
})(GanttLinkType || (GanttLinkType = {}));
|
|
574
|
+
var GanttLinkPathType;
|
|
575
|
+
(function (GanttLinkPathType) {
|
|
576
|
+
GanttLinkPathType["curve"] = "curve";
|
|
577
|
+
GanttLinkPathType["line"] = "line";
|
|
578
|
+
})(GanttLinkPathType || (GanttLinkPathType = {}));
|
|
569
579
|
var LinkColors;
|
|
570
580
|
(function (LinkColors) {
|
|
571
581
|
LinkColors["default"] = "#cacaca";
|
|
@@ -690,7 +700,12 @@
|
|
|
690
700
|
quarter: 'QQQ',
|
|
691
701
|
year: 'yyyy年',
|
|
692
702
|
yearMonth: 'yyyy年MM月',
|
|
693
|
-
yearQuarter: 'yyyy年QQQ'
|
|
703
|
+
yearQuarter: 'yyyy年QQQ'
|
|
704
|
+
},
|
|
705
|
+
linkOptions: {
|
|
706
|
+
dependencyTypes: [GanttLinkType.fs],
|
|
707
|
+
showArrow: false,
|
|
708
|
+
linkPathType: GanttLinkPathType.curve
|
|
694
709
|
}
|
|
695
710
|
};
|
|
696
711
|
var GANTT_GLOBAL_CONFIG = new i0.InjectionToken('GANTT_GLOBAL_CONFIG');
|
|
@@ -1181,8 +1196,40 @@
|
|
|
1181
1196
|
this.expandChange = new i0.EventEmitter();
|
|
1182
1197
|
this.firstChange = true;
|
|
1183
1198
|
this.unsubscribe$ = new rxjs.Subject();
|
|
1199
|
+
this._selectable = false;
|
|
1200
|
+
this._multiple = false;
|
|
1184
1201
|
this.ganttClass = true;
|
|
1185
1202
|
}
|
|
1203
|
+
Object.defineProperty(GanttUpper.prototype, "selectable", {
|
|
1204
|
+
get: function () {
|
|
1205
|
+
return this._selectable;
|
|
1206
|
+
},
|
|
1207
|
+
set: function (value) {
|
|
1208
|
+
var _a;
|
|
1209
|
+
this._selectable = coercion.coerceBooleanProperty(value);
|
|
1210
|
+
if (this._selectable) {
|
|
1211
|
+
this.selectionModel = this.initSelectionModel();
|
|
1212
|
+
}
|
|
1213
|
+
else {
|
|
1214
|
+
(_a = this.selectionModel) === null || _a === void 0 ? void 0 : _a.clear();
|
|
1215
|
+
}
|
|
1216
|
+
},
|
|
1217
|
+
enumerable: false,
|
|
1218
|
+
configurable: true
|
|
1219
|
+
});
|
|
1220
|
+
Object.defineProperty(GanttUpper.prototype, "multiple", {
|
|
1221
|
+
get: function () {
|
|
1222
|
+
return this._multiple;
|
|
1223
|
+
},
|
|
1224
|
+
set: function (value) {
|
|
1225
|
+
this._multiple = coercion.coerceBooleanProperty(value);
|
|
1226
|
+
if (this.selectable) {
|
|
1227
|
+
this.selectionModel = this.initSelectionModel();
|
|
1228
|
+
}
|
|
1229
|
+
},
|
|
1230
|
+
enumerable: false,
|
|
1231
|
+
configurable: true
|
|
1232
|
+
});
|
|
1186
1233
|
Object.defineProperty(GanttUpper.prototype, "element", {
|
|
1187
1234
|
get: function () {
|
|
1188
1235
|
return this.elementRef.nativeElement;
|
|
@@ -1288,6 +1335,9 @@
|
|
|
1288
1335
|
this.expandChange.next();
|
|
1289
1336
|
this.cdr.detectChanges();
|
|
1290
1337
|
};
|
|
1338
|
+
GanttUpper.prototype.initSelectionModel = function () {
|
|
1339
|
+
return new collections.SelectionModel(this.multiple, []);
|
|
1340
|
+
};
|
|
1291
1341
|
GanttUpper.prototype.onInit = function () {
|
|
1292
1342
|
var _this = this;
|
|
1293
1343
|
this.styles = Object.assign({}, defaultStyles, this.styles);
|
|
@@ -1296,6 +1346,7 @@
|
|
|
1296
1346
|
this.setupGroups();
|
|
1297
1347
|
this.setupItems();
|
|
1298
1348
|
this.computeRefs();
|
|
1349
|
+
this.initSelectionModel();
|
|
1299
1350
|
this.firstChange = false;
|
|
1300
1351
|
this.ngZone.onStable.pipe(operators.take(1)).subscribe(function () {
|
|
1301
1352
|
_this.element.style.opacity = '1';
|
|
@@ -1381,10 +1432,19 @@
|
|
|
1381
1432
|
}
|
|
1382
1433
|
return items.filter(function (item) { return ids.includes(item.id); });
|
|
1383
1434
|
};
|
|
1435
|
+
GanttUpper.prototype.isSelected = function (id) {
|
|
1436
|
+
if (!this.selectable) {
|
|
1437
|
+
return false;
|
|
1438
|
+
}
|
|
1439
|
+
if (!this.selectionModel.hasValue()) {
|
|
1440
|
+
return false;
|
|
1441
|
+
}
|
|
1442
|
+
return this.selectionModel.isSelected(id);
|
|
1443
|
+
};
|
|
1384
1444
|
return GanttUpper;
|
|
1385
1445
|
}());
|
|
1386
1446
|
GanttUpper.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0__namespace, type: GanttUpper, deps: [{ token: i0__namespace.ElementRef }, { token: i0__namespace.ChangeDetectorRef }, { token: i0__namespace.NgZone }, { token: GANTT_GLOBAL_CONFIG }], target: i0__namespace.ɵɵFactoryTarget.Directive });
|
|
1387
|
-
GanttUpper.ɵdir = i0__namespace.ɵɵ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__namespace });
|
|
1447
|
+
GanttUpper.ɵdir = i0__namespace.ɵɵ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__namespace });
|
|
1388
1448
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0__namespace, type: GanttUpper, decorators: [{
|
|
1389
1449
|
type: i0.Directive
|
|
1390
1450
|
}], ctorParameters: function () {
|
|
@@ -1414,6 +1474,10 @@
|
|
|
1414
1474
|
type: i0.Input
|
|
1415
1475
|
}], disabledLoadOnScroll: [{
|
|
1416
1476
|
type: i0.Input
|
|
1477
|
+
}], selectable: [{
|
|
1478
|
+
type: i0.Input
|
|
1479
|
+
}], multiple: [{
|
|
1480
|
+
type: i0.Input
|
|
1417
1481
|
}], loadOnScroll: [{
|
|
1418
1482
|
type: i0.Output
|
|
1419
1483
|
}], dragStarted: [{
|
|
@@ -1618,9 +1682,11 @@
|
|
|
1618
1682
|
var defaultColumnWidth = 100;
|
|
1619
1683
|
var minColumnWidth = 80;
|
|
1620
1684
|
var GanttTableComponent = /** @class */ (function () {
|
|
1621
|
-
function GanttTableComponent(gantt, elementRef) {
|
|
1685
|
+
function GanttTableComponent(gantt, ganttUpper, elementRef) {
|
|
1622
1686
|
this.gantt = gantt;
|
|
1687
|
+
this.ganttUpper = ganttUpper;
|
|
1623
1688
|
this.elementRef = elementRef;
|
|
1689
|
+
this.itemClick = new i0.EventEmitter();
|
|
1624
1690
|
this.ganttTableClass = true;
|
|
1625
1691
|
this.ganttTableEmptyClass = false;
|
|
1626
1692
|
}
|
|
@@ -1654,7 +1720,8 @@
|
|
|
1654
1720
|
GanttTableComponent.prototype.expandGroup = function (group) {
|
|
1655
1721
|
this.gantt.expandGroup(group);
|
|
1656
1722
|
};
|
|
1657
|
-
GanttTableComponent.prototype.expandChildren = function (item) {
|
|
1723
|
+
GanttTableComponent.prototype.expandChildren = function (event, item) {
|
|
1724
|
+
event.stopPropagation();
|
|
1658
1725
|
this.gantt.expandChildren(item);
|
|
1659
1726
|
};
|
|
1660
1727
|
GanttTableComponent.prototype.dragStarted = function (event) {
|
|
@@ -1729,8 +1796,8 @@
|
|
|
1729
1796
|
};
|
|
1730
1797
|
return GanttTableComponent;
|
|
1731
1798
|
}());
|
|
1732
|
-
GanttTableComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0__namespace, type: GanttTableComponent, deps: [{ token: GANTT_ABSTRACT_TOKEN }, { token: i0__namespace.ElementRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
1733
|
-
GanttTableComponent.ɵcmp = i0__namespace.ɵɵ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__namespace, 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
|
|
1799
|
+
GanttTableComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0__namespace, type: GanttTableComponent, deps: [{ token: GANTT_ABSTRACT_TOKEN }, { token: GANTT_UPPER_TOKEN }, { token: i0__namespace.ElementRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
1800
|
+
GanttTableComponent.ɵcmp = i0__namespace.ɵɵ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__namespace, 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__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i2__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2__namespace.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i1__namespace.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__namespace.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], pipes: { "isGanttRangeItem": IsGanttRangeItemPipe } });
|
|
1734
1801
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0__namespace, type: GanttTableComponent, decorators: [{
|
|
1735
1802
|
type: i0.Component,
|
|
1736
1803
|
args: [{
|
|
@@ -1741,6 +1808,9 @@
|
|
|
1741
1808
|
return [{ type: undefined, decorators: [{
|
|
1742
1809
|
type: i0.Inject,
|
|
1743
1810
|
args: [GANTT_ABSTRACT_TOKEN]
|
|
1811
|
+
}] }, { type: GanttUpper, decorators: [{
|
|
1812
|
+
type: i0.Inject,
|
|
1813
|
+
args: [GANTT_UPPER_TOKEN]
|
|
1744
1814
|
}] }, { type: i0__namespace.ElementRef }];
|
|
1745
1815
|
}, propDecorators: { groups: [{
|
|
1746
1816
|
type: i0.Input
|
|
@@ -1756,6 +1826,8 @@
|
|
|
1756
1826
|
type: i0.Input
|
|
1757
1827
|
}], rowAfterTemplate: [{
|
|
1758
1828
|
type: i0.Input
|
|
1829
|
+
}], itemClick: [{
|
|
1830
|
+
type: i0.Output
|
|
1759
1831
|
}], draglineElementRef: [{
|
|
1760
1832
|
type: i0.ViewChild,
|
|
1761
1833
|
args: ['dragLine', { static: true }]
|
|
@@ -2277,6 +2349,181 @@
|
|
|
2277
2349
|
args: ['mainTemplate', { static: true }]
|
|
2278
2350
|
}] } });
|
|
2279
2351
|
|
|
2352
|
+
var GanttLinkPath = /** @class */ (function () {
|
|
2353
|
+
function GanttLinkPath() {
|
|
2354
|
+
}
|
|
2355
|
+
GanttLinkPath.prototype.generatePath = function (source, target, type) {
|
|
2356
|
+
if (source.before && source.after && target.before && target.after) {
|
|
2357
|
+
var path = '';
|
|
2358
|
+
switch (type) {
|
|
2359
|
+
case GanttLinkType.ss:
|
|
2360
|
+
path = this.generateSSPath(source, target);
|
|
2361
|
+
break;
|
|
2362
|
+
case GanttLinkType.ff:
|
|
2363
|
+
path = this.generateFFPath(source, target);
|
|
2364
|
+
break;
|
|
2365
|
+
case GanttLinkType.sf:
|
|
2366
|
+
path = this.generateFSAndSFPath(source, target, type);
|
|
2367
|
+
break;
|
|
2368
|
+
default:
|
|
2369
|
+
path = this.generateFSAndSFPath(source, target);
|
|
2370
|
+
}
|
|
2371
|
+
return path;
|
|
2372
|
+
}
|
|
2373
|
+
};
|
|
2374
|
+
return GanttLinkPath;
|
|
2375
|
+
}());
|
|
2376
|
+
GanttLinkPath.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0__namespace, type: GanttLinkPath, deps: [], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
2377
|
+
GanttLinkPath.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0__namespace, type: GanttLinkPath });
|
|
2378
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0__namespace, type: GanttLinkPath, decorators: [{
|
|
2379
|
+
type: i0.Injectable
|
|
2380
|
+
}], ctorParameters: function () { return []; } });
|
|
2381
|
+
|
|
2382
|
+
var GanttLinkPathCurve = /** @class */ (function (_super) {
|
|
2383
|
+
__extends(GanttLinkPathCurve, _super);
|
|
2384
|
+
function GanttLinkPathCurve(ganttUpper) {
|
|
2385
|
+
var _this = _super.call(this) || this;
|
|
2386
|
+
_this.ganttUpper = ganttUpper;
|
|
2387
|
+
_this.bezierWeight = -0.5;
|
|
2388
|
+
return _this;
|
|
2389
|
+
}
|
|
2390
|
+
GanttLinkPathCurve.prototype.generateSSPath = function (source, target) {
|
|
2391
|
+
var x1 = source.before.x;
|
|
2392
|
+
var y1 = source.before.y;
|
|
2393
|
+
var x4 = target.before.x;
|
|
2394
|
+
var y4 = target.before.y;
|
|
2395
|
+
var isMirror = y4 > y1 ? 0 : 1;
|
|
2396
|
+
var radius = Math.abs(y4 - y1) / 2;
|
|
2397
|
+
if (x4 > x1) {
|
|
2398
|
+
return "M " + x1 + " " + y1 + "\n A " + radius + " " + radius + " 0 1 " + isMirror + " " + x1 + " " + y4 + "\n L " + x4 + " " + y4;
|
|
2399
|
+
}
|
|
2400
|
+
else {
|
|
2401
|
+
return "M " + x1 + " " + y1 + "\n L " + x4 + " " + y1 + "\n A " + radius + " " + radius + " 0 1 " + isMirror + " " + x4 + " " + y4;
|
|
2402
|
+
}
|
|
2403
|
+
};
|
|
2404
|
+
GanttLinkPathCurve.prototype.generateFFPath = function (source, target) {
|
|
2405
|
+
var x1 = source.after.x;
|
|
2406
|
+
var y1 = source.after.y;
|
|
2407
|
+
var x4 = target.after.x;
|
|
2408
|
+
var y4 = target.after.y;
|
|
2409
|
+
var isMirror = y4 > y1 ? 1 : 0;
|
|
2410
|
+
var radius = Math.abs(y4 - y1) / 2;
|
|
2411
|
+
if (x4 > x1) {
|
|
2412
|
+
return "M " + x1 + " " + y1 + "\n L " + x4 + " " + y1 + "\n A " + radius + " " + radius + " 0 1 " + isMirror + " " + x4 + " " + y4;
|
|
2413
|
+
}
|
|
2414
|
+
else {
|
|
2415
|
+
return "M " + x1 + " " + y1 + "\n A " + radius + " " + radius + " 0 1 " + isMirror + " " + x1 + " " + y4 + "\n L " + x4 + " " + y4;
|
|
2416
|
+
}
|
|
2417
|
+
};
|
|
2418
|
+
GanttLinkPathCurve.prototype.generateFSAndSFPath = function (source, target, type) {
|
|
2419
|
+
var x1 = source.after.x;
|
|
2420
|
+
var y1 = source.after.y;
|
|
2421
|
+
var x4 = target.before.x;
|
|
2422
|
+
var y4 = target.before.y;
|
|
2423
|
+
if (type === GanttLinkType.sf) {
|
|
2424
|
+
x1 = target.after.x;
|
|
2425
|
+
y1 = target.after.y;
|
|
2426
|
+
x4 = source.before.x;
|
|
2427
|
+
y4 = source.before.y;
|
|
2428
|
+
}
|
|
2429
|
+
var dx = Math.abs(x4 - x1) * this.bezierWeight;
|
|
2430
|
+
var x2 = x1 - dx;
|
|
2431
|
+
var x3 = x4 + dx;
|
|
2432
|
+
var centerX = (x1 + x4) / 2;
|
|
2433
|
+
var centerY = (y1 + y4) / 2;
|
|
2434
|
+
var controlX = this.ganttUpper.styles.lineHeight / 2;
|
|
2435
|
+
var controlY = this.ganttUpper.styles.lineHeight / 2;
|
|
2436
|
+
if (x1 >= x4) {
|
|
2437
|
+
if (y4 > y1) {
|
|
2438
|
+
if (Math.abs(y4 - y1) <= this.ganttUpper.styles.lineHeight) {
|
|
2439
|
+
return "M " + x1 + " " + y1 + "\n C " + (x1 + controlX) + " " + y1 + " " + (x1 + controlX) + " " + (y1 + controlX) + " " + x1 + " " + (y1 + controlY) + "\n L " + x4 + " " + (y4 - controlY) + "\n C " + (x4 - controlY) + " " + (y4 - controlY) + " " + (x4 - controlX) + " " + y4 + " " + x4 + " " + y4;
|
|
2440
|
+
}
|
|
2441
|
+
else {
|
|
2442
|
+
controlX = this.ganttUpper.styles.lineHeight;
|
|
2443
|
+
return "M " + x1 + " " + y1 + "\n C " + (x1 + controlX) + " " + y1 + " " + (x1 + controlX) + " " + (y1 + controlX) + " " + centerX + " " + centerY + "\n C " + (x4 - controlX) + " " + (y4 - controlX) + " " + (x4 - controlX) + " " + y4 + " " + x4 + " " + y4 + "\n ";
|
|
2444
|
+
}
|
|
2445
|
+
}
|
|
2446
|
+
else {
|
|
2447
|
+
if (Math.abs(y4 - y1) <= this.ganttUpper.styles.lineHeight) {
|
|
2448
|
+
return "M " + x1 + " " + y1 + "\n C " + (x1 + controlX) + " " + y1 + " " + (x1 + controlX) + " " + (y1 - controlX) + " " + x1 + " " + (y1 - controlY) + "\n L " + x4 + " " + (y4 + controlY) + "\n C " + (x4 - controlY) + " " + (y4 + controlY) + " " + (x4 - controlX) + " " + y4 + " " + x4 + " " + y4 + "\n ";
|
|
2449
|
+
}
|
|
2450
|
+
else {
|
|
2451
|
+
controlX = this.ganttUpper.styles.lineHeight;
|
|
2452
|
+
return "M " + x1 + " " + y1 + "\n C " + (x1 + controlX) + " " + y1 + " " + (x1 + controlX) + " " + (y1 - controlX) + " " + centerX + " " + centerY + "\n C " + (x4 - controlX) + " " + (y4 + controlX) + " " + (x4 - controlX) + " " + y4 + " " + x4 + " " + y4 + "\n ";
|
|
2453
|
+
}
|
|
2454
|
+
}
|
|
2455
|
+
}
|
|
2456
|
+
else if (x4 - x1 < 100) {
|
|
2457
|
+
var radius = Math.abs(y4 - y1) / 4;
|
|
2458
|
+
var lindWidth = x4 - x1 - radius;
|
|
2459
|
+
lindWidth = Math.max(lindWidth, radius);
|
|
2460
|
+
return "M " + x1 + " " + y1 + "\n L " + (x1 + lindWidth) + " " + y1 + "\n A " + radius + " " + radius + " 0 1 " + (y4 > y1 ? 1 : 0) + " " + (x1 + lindWidth) + " " + (y4 > y1 ? y1 + 2 * radius : y1 - 2 * radius) + "\n L " + (x4 - lindWidth) + " " + (y4 > y1 ? y1 + 2 * radius : y1 - 2 * radius) + "\n A " + radius + " " + radius + " 0 1 " + (y4 > y1 ? 0 : 1) + " " + (x4 - lindWidth) + " " + y4 + "\n L " + x4 + " " + y4 + "\n ";
|
|
2461
|
+
}
|
|
2462
|
+
return "M " + x1 + " " + y1 + " C " + x2 + " " + y1 + " " + x3 + " " + y4 + " " + x4 + " " + y4;
|
|
2463
|
+
};
|
|
2464
|
+
return GanttLinkPathCurve;
|
|
2465
|
+
}(GanttLinkPath));
|
|
2466
|
+
GanttLinkPathCurve = __decorate([
|
|
2467
|
+
__param(0, i0.Inject(GANTT_UPPER_TOKEN))
|
|
2468
|
+
], GanttLinkPathCurve);
|
|
2469
|
+
|
|
2470
|
+
var GanttLinkPathLine = /** @class */ (function (_super) {
|
|
2471
|
+
__extends(GanttLinkPathLine, _super);
|
|
2472
|
+
function GanttLinkPathLine() {
|
|
2473
|
+
var _this = _super.call(this) || this;
|
|
2474
|
+
_this.pathControl = 20;
|
|
2475
|
+
return _this;
|
|
2476
|
+
}
|
|
2477
|
+
GanttLinkPathLine.prototype.generateSSPath = function (source, target) {
|
|
2478
|
+
var x1 = source.before.x;
|
|
2479
|
+
var y1 = source.before.y;
|
|
2480
|
+
var x4 = target.before.x;
|
|
2481
|
+
var y4 = target.before.y;
|
|
2482
|
+
var control = this.pathControl;
|
|
2483
|
+
var centerY = (y1 + y4) / 2;
|
|
2484
|
+
return "M " + x1 + " " + y1 + "\n L " + (x4 > x1 ? x1 - control : x4 - control) + " " + y1 + "\n L " + (x4 > x1 ? x1 - control : x4 - control) + " " + y4 + "\n L " + x4 + " " + y4;
|
|
2485
|
+
};
|
|
2486
|
+
GanttLinkPathLine.prototype.generateFFPath = function (source, target) {
|
|
2487
|
+
var x1 = source.after.x;
|
|
2488
|
+
var y1 = source.after.y;
|
|
2489
|
+
var x4 = target.after.x;
|
|
2490
|
+
var y4 = target.after.y;
|
|
2491
|
+
var control = this.pathControl;
|
|
2492
|
+
return "M " + x1 + " " + y1 + "\n L " + (x4 > x1 ? x4 + control : x1 + control) + " " + y1 + "\n L " + (x4 > x1 ? x4 + control : x1 + control) + " " + y4 + "\n L " + x4 + " " + y4;
|
|
2493
|
+
};
|
|
2494
|
+
GanttLinkPathLine.prototype.generateFSAndSFPath = function (source, target, type) {
|
|
2495
|
+
var x1 = source.after.x;
|
|
2496
|
+
var y1 = source.after.y;
|
|
2497
|
+
var x4 = target.before.x;
|
|
2498
|
+
var y4 = target.before.y;
|
|
2499
|
+
var control = this.pathControl;
|
|
2500
|
+
if (type === GanttLinkType.sf) {
|
|
2501
|
+
x1 = target.after.x;
|
|
2502
|
+
y1 = target.after.y;
|
|
2503
|
+
x4 = source.before.x;
|
|
2504
|
+
y4 = source.before.y;
|
|
2505
|
+
}
|
|
2506
|
+
if (x4 - x1 >= 40) {
|
|
2507
|
+
return "M " + x1 + " " + y1 + "\n L " + (x1 + control) + " " + y1 + "\n L " + (x1 + control) + " " + y4 + "\n L " + x4 + " " + y4;
|
|
2508
|
+
}
|
|
2509
|
+
else {
|
|
2510
|
+
return "M " + x1 + " " + y1 + "\n L " + (x1 + control) + " " + y1 + "\n L " + (x1 + control) + " " + (y4 > y1 ? y1 + control : y1 - control) + "\n L " + (x4 - control) + " " + (y4 > y1 ? y1 + control : y1 - control) + "\n L " + (x4 - control) + " " + y4 + "\n L " + x4 + " " + y4;
|
|
2511
|
+
}
|
|
2512
|
+
};
|
|
2513
|
+
return GanttLinkPathLine;
|
|
2514
|
+
}(GanttLinkPath));
|
|
2515
|
+
|
|
2516
|
+
function generatePathFactory(type, ganttUpper) {
|
|
2517
|
+
switch (type) {
|
|
2518
|
+
case GanttLinkPathType.curve:
|
|
2519
|
+
return new GanttLinkPathCurve(ganttUpper);
|
|
2520
|
+
case GanttLinkPathType.line:
|
|
2521
|
+
return new GanttLinkPathLine();
|
|
2522
|
+
default:
|
|
2523
|
+
throw new Error('gantt link path type invalid');
|
|
2524
|
+
}
|
|
2525
|
+
}
|
|
2526
|
+
|
|
2280
2527
|
var GanttLinksComponent = /** @class */ (function () {
|
|
2281
2528
|
function GanttLinksComponent(ganttUpper, cdr, elementRef, ganttDragContainer) {
|
|
2282
2529
|
this.ganttUpper = ganttUpper;
|
|
@@ -2287,21 +2534,24 @@
|
|
|
2287
2534
|
this.items = [];
|
|
2288
2535
|
this.lineClick = new i0.EventEmitter();
|
|
2289
2536
|
this.links = [];
|
|
2537
|
+
this.ganttLinkTypes = GanttLinkType;
|
|
2538
|
+
this.showArrow = false;
|
|
2290
2539
|
this.linkItems = [];
|
|
2291
|
-
this.bezierWeight = -0.5;
|
|
2292
2540
|
this.firstChange = true;
|
|
2293
2541
|
this.unsubscribe$ = new rxjs.Subject();
|
|
2294
2542
|
this.ganttLinksOverlay = true;
|
|
2295
2543
|
}
|
|
2296
2544
|
GanttLinksComponent.prototype.ngOnInit = function () {
|
|
2297
2545
|
var _this = this;
|
|
2546
|
+
this.linkPath = generatePathFactory(this.ganttUpper.linkOptions.linkPathType, this.ganttUpper);
|
|
2547
|
+
this.showArrow = this.ganttUpper.linkOptions.showArrow;
|
|
2298
2548
|
this.buildLinks();
|
|
2299
2549
|
this.firstChange = false;
|
|
2300
2550
|
this.ganttDragContainer.dragStarted.pipe(operators.takeUntil(this.unsubscribe$)).subscribe(function () {
|
|
2301
2551
|
_this.elementRef.nativeElement.style.visibility = 'hidden';
|
|
2302
2552
|
});
|
|
2303
2553
|
rxjs.merge(this.ganttUpper.viewChange, this.ganttUpper.expandChange, this.ganttUpper.view.start$, this.ganttUpper.dragEnded, this.ganttUpper.linkDragEnded)
|
|
2304
|
-
.pipe(operators.takeUntil(this.unsubscribe$), operators.skip(1))
|
|
2554
|
+
.pipe(operators.takeUntil(this.unsubscribe$), operators.skip(1), operators.debounceTime(0))
|
|
2305
2555
|
.subscribe(function () {
|
|
2306
2556
|
_this.elementRef.nativeElement.style.visibility = 'visible';
|
|
2307
2557
|
_this.buildLinks();
|
|
@@ -2353,75 +2603,6 @@
|
|
|
2353
2603
|
});
|
|
2354
2604
|
}
|
|
2355
2605
|
};
|
|
2356
|
-
GanttLinksComponent.prototype.generatePath = function (source, target, type) {
|
|
2357
|
-
if (source.before && source.after && target.before && target.after) {
|
|
2358
|
-
var x1 = source.after.x;
|
|
2359
|
-
var y1 = source.after.y;
|
|
2360
|
-
var x4 = target.before.x;
|
|
2361
|
-
var y4 = target.before.y;
|
|
2362
|
-
var isMirror = void 0;
|
|
2363
|
-
var control = Math.abs(y4 - y1) / 2;
|
|
2364
|
-
switch (type) {
|
|
2365
|
-
case GanttLinkType.ss:
|
|
2366
|
-
x1 = source.before.x;
|
|
2367
|
-
y1 = source.before.y;
|
|
2368
|
-
x4 = target.before.x;
|
|
2369
|
-
y4 = target.before.y;
|
|
2370
|
-
isMirror = y4 > y1 ? 0 : 1;
|
|
2371
|
-
if (x4 > x1) {
|
|
2372
|
-
return "M " + x1 + " " + y1 + "\n A " + control + " " + control + " 0 1 " + isMirror + " " + x1 + " " + y4 + "\n L " + x1 + " " + y4 + " " + x4 + " " + y4;
|
|
2373
|
-
}
|
|
2374
|
-
else {
|
|
2375
|
-
return "M " + x1 + " " + y1 + "\n L " + x1 + " " + y1 + " " + x4 + " " + y1 + "\n A " + control + " " + control + " 0 1 " + isMirror + " " + x4 + " " + y4;
|
|
2376
|
-
}
|
|
2377
|
-
case GanttLinkType.ff:
|
|
2378
|
-
x1 = source.after.x;
|
|
2379
|
-
y1 = source.after.y;
|
|
2380
|
-
x4 = target.after.x;
|
|
2381
|
-
y4 = target.after.y;
|
|
2382
|
-
isMirror = y4 > y1 ? 1 : 0;
|
|
2383
|
-
if (x4 > x1) {
|
|
2384
|
-
return "M " + x1 + " " + y1 + "\n L " + x1 + " " + y1 + " " + x4 + " " + y1 + "\n A " + control + " " + control + " 0 1 " + isMirror + " " + x4 + " " + y4;
|
|
2385
|
-
}
|
|
2386
|
-
else {
|
|
2387
|
-
return "M " + x1 + " " + y1 + "\n A " + control + " " + control + " 0 1 " + isMirror + " " + x1 + " " + y4 + "\n L " + x1 + " " + y4 + " " + x4 + " " + y4;
|
|
2388
|
-
}
|
|
2389
|
-
case GanttLinkType.sf:
|
|
2390
|
-
x1 = target.after.x;
|
|
2391
|
-
y1 = target.after.y;
|
|
2392
|
-
x4 = source.before.x;
|
|
2393
|
-
y4 = source.before.y;
|
|
2394
|
-
}
|
|
2395
|
-
var dx = Math.abs(x4 - x1) * this.bezierWeight;
|
|
2396
|
-
var x2 = x1 - dx;
|
|
2397
|
-
var x3 = x4 + dx;
|
|
2398
|
-
var centerX = (x1 + x4) / 2;
|
|
2399
|
-
var centerY = (y1 + y4) / 2;
|
|
2400
|
-
var controlX = this.ganttUpper.styles.lineHeight / 2;
|
|
2401
|
-
var controlY = this.ganttUpper.styles.lineHeight / 2;
|
|
2402
|
-
if (x1 >= x4) {
|
|
2403
|
-
if (y4 > y1) {
|
|
2404
|
-
if (Math.abs(y4 - y1) <= this.ganttUpper.styles.lineHeight) {
|
|
2405
|
-
return "M " + x1 + " " + y1 + "\n C " + (x1 + controlX) + " " + y1 + " " + (x1 + controlX) + " " + (y1 + controlX) + " " + x1 + " " + (y1 + controlY) + "\n L " + x1 + " " + (y1 + controlY) + " " + centerX + " " + centerY + "\n\n M " + x4 + " " + y4 + "\n C " + (x4 - controlX) + " " + y4 + " " + (x4 - controlX) + " " + (y4 - controlX) + " " + x4 + " " + (y4 - controlY) + "\n L " + x4 + " " + (y4 - controlY) + " " + centerX + " " + centerY;
|
|
2406
|
-
}
|
|
2407
|
-
else {
|
|
2408
|
-
controlX = this.ganttUpper.styles.lineHeight;
|
|
2409
|
-
return "M " + x1 + " " + y1 + "\n C " + (x1 + controlX) + " " + y1 + " " + (x1 + controlX) + " " + (y1 + controlX) + " " + centerX + " " + centerY + "\n\n\n M " + x4 + " " + y4 + "\n C " + (x4 - controlX) + " " + y4 + " " + (x4 - controlX) + " " + (y4 - controlX) + " " + centerX + " " + centerY;
|
|
2410
|
-
}
|
|
2411
|
-
}
|
|
2412
|
-
else {
|
|
2413
|
-
if (Math.abs(y4 - y1) <= this.ganttUpper.styles.lineHeight) {
|
|
2414
|
-
return "M " + x1 + " " + y1 + "\n C " + (x1 + controlX) + " " + y1 + " " + (x1 + controlX) + " " + (y1 - controlX) + " " + x1 + " " + (y1 - controlY) + "\n L " + x1 + " " + (y1 - controlY) + " " + centerX + " " + centerY + "\n\n M " + x4 + " " + y4 + "\n C " + (x4 - controlX) + " " + y4 + " " + (x4 - controlX) + " " + (y4 + controlX) + " " + x4 + " " + (y4 + controlY) + "\n L " + x4 + " " + (y4 + controlY) + " " + centerX + " " + centerY + "\n ";
|
|
2415
|
-
}
|
|
2416
|
-
else {
|
|
2417
|
-
controlX = this.ganttUpper.styles.lineHeight;
|
|
2418
|
-
return "M " + x1 + " " + y1 + "\n C " + (x1 + controlX) + " " + y1 + " " + (x1 + controlX) + " " + (y1 - controlX) + " " + centerX + " " + centerY + "\n\n M " + x4 + " " + y4 + "\n C " + (x4 - controlX) + " " + y4 + " " + (x4 - controlX) + " " + (y4 + controlX) + " " + centerX + " " + centerY;
|
|
2419
|
-
}
|
|
2420
|
-
}
|
|
2421
|
-
}
|
|
2422
|
-
return "M " + x1 + " " + y1 + " C " + x2 + " " + y1 + " " + x3 + " " + y4 + " " + x4 + " " + y4;
|
|
2423
|
-
}
|
|
2424
|
-
};
|
|
2425
2606
|
GanttLinksComponent.prototype.buildLinks = function () {
|
|
2426
2607
|
var _this = this;
|
|
2427
2608
|
this.computeItemPosition();
|
|
@@ -2431,12 +2612,16 @@
|
|
|
2431
2612
|
source.links.forEach(function (link) {
|
|
2432
2613
|
var target = _this.linkItems.find(function (item) { return item.id === link.link; });
|
|
2433
2614
|
if (target && (target.origin.start || target.origin.end)) {
|
|
2615
|
+
var color = LinkColors.default;
|
|
2616
|
+
if (link.type === GanttLinkType.fs && source.end.getTime() > target.start.getTime()) {
|
|
2617
|
+
color = LinkColors.blocked;
|
|
2618
|
+
}
|
|
2434
2619
|
_this.links.push({
|
|
2435
|
-
path: _this.generatePath(source, target, link.type),
|
|
2620
|
+
path: _this.linkPath.generatePath(source, target, link.type),
|
|
2436
2621
|
source: source.origin,
|
|
2437
2622
|
target: target.origin,
|
|
2438
2623
|
type: link.type,
|
|
2439
|
-
color:
|
|
2624
|
+
color: link.color || color
|
|
2440
2625
|
});
|
|
2441
2626
|
}
|
|
2442
2627
|
});
|
|
@@ -2470,7 +2655,7 @@
|
|
|
2470
2655
|
return GanttLinksComponent;
|
|
2471
2656
|
}());
|
|
2472
2657
|
GanttLinksComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0__namespace, type: GanttLinksComponent, deps: [{ token: GANTT_UPPER_TOKEN }, { token: i0__namespace.ChangeDetectorRef }, { token: i0__namespace.ElementRef }, { token: GanttDragContainer }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
2473
|
-
GanttLinksComponent.ɵcmp = i0__namespace.ɵɵ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__namespace, 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
|
|
2658
|
+
GanttLinksComponent.ɵcmp = i0__namespace.ɵɵ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__namespace, 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__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i2__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
2474
2659
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0__namespace, type: GanttLinksComponent, decorators: [{
|
|
2475
2660
|
type: i0.Component,
|
|
2476
2661
|
args: [{
|
|
@@ -2649,19 +2834,22 @@
|
|
|
2649
2834
|
_this.dragContainer.dragStarted.emit({ item: _this.item.origin });
|
|
2650
2835
|
});
|
|
2651
2836
|
dragRef.moved.subscribe(function (event) {
|
|
2652
|
-
var
|
|
2653
|
-
var
|
|
2654
|
-
var
|
|
2655
|
-
var
|
|
2656
|
-
|
|
2837
|
+
var currentX = _this.item.refs.x + event.distance.x;
|
|
2838
|
+
var currentDate = _this.ganttUpper.view.getDateByXPoint(currentX);
|
|
2839
|
+
var currentStartX = _this.ganttUpper.view.getXPointByDate(currentDate);
|
|
2840
|
+
var dayWidth = _this.ganttUpper.view.getDayOccupancyWidth(currentDate);
|
|
2841
|
+
var diffDays = dateFns.differenceInCalendarDays(_this.item.end.value, _this.item.start.value);
|
|
2842
|
+
var start = currentDate;
|
|
2843
|
+
var end = currentDate.addDays(diffDays);
|
|
2844
|
+
if (currentX > currentStartX + dayWidth / 2) {
|
|
2845
|
+
start = start.addDays(1);
|
|
2846
|
+
end = end.addDays(1);
|
|
2847
|
+
}
|
|
2848
|
+
_this.openDragBackdrop(_this.barElement, start, end);
|
|
2657
2849
|
_this.item.updateDate(start, end);
|
|
2658
2850
|
_this.dragContainer.dragMoved.emit({ item: _this.item.origin });
|
|
2659
2851
|
});
|
|
2660
2852
|
dragRef.ended.subscribe(function (event) {
|
|
2661
|
-
var days = dateFns.differenceInCalendarDays(_this.item.end.value, _this.item.start.value);
|
|
2662
|
-
var start = _this.ganttUpper.view.getDateByXPoint(_this.item.refs.x + event.distance.x);
|
|
2663
|
-
var end = start.addDays(days);
|
|
2664
|
-
_this.item.updateDate(start, end);
|
|
2665
2853
|
_this.clearDraggingStyles();
|
|
2666
2854
|
_this.closeDragBackdrop();
|
|
2667
2855
|
event.source.reset();
|
|
@@ -2964,7 +3152,7 @@
|
|
|
2964
3152
|
return GanttMainComponent;
|
|
2965
3153
|
}());
|
|
2966
3154
|
GanttMainComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0__namespace, type: GanttMainComponent, deps: [{ token: GANTT_UPPER_TOKEN }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
2967
|
-
GanttMainComponent.ɵcmp = i0__namespace.ɵɵ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__namespace, 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
|
|
3155
|
+
GanttMainComponent.ɵcmp = i0__namespace.ɵɵ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__namespace, 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__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i2__namespace.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i2__namespace.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }], pipes: { "isGanttCustomItem": IsGanttCustomItemPipe, "isGanttRangeItem": IsGanttRangeItemPipe, "isGanttBarItem": IsGanttBarItemPipe } });
|
|
2968
3156
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0__namespace, type: GanttMainComponent, decorators: [{
|
|
2969
3157
|
type: i0.Component,
|
|
2970
3158
|
args: [{
|
|
@@ -3005,13 +3193,16 @@
|
|
|
3005
3193
|
_this.linkDragStarted = new i0.EventEmitter();
|
|
3006
3194
|
_this.linkDragEnded = new i0.EventEmitter();
|
|
3007
3195
|
_this.lineClick = new i0.EventEmitter();
|
|
3196
|
+
_this.selectedChange = new i0.EventEmitter();
|
|
3008
3197
|
_this.ngUnsubscribe$ = new rxjs.Subject();
|
|
3009
3198
|
_this.sideTableWidth = sideWidth;
|
|
3010
3199
|
return _this;
|
|
3011
3200
|
}
|
|
3012
3201
|
NgxGanttComponent.prototype.ngOnInit = function () {
|
|
3013
3202
|
var _this = this;
|
|
3203
|
+
var _a;
|
|
3014
3204
|
_super.prototype.onInit.call(this);
|
|
3205
|
+
this.linkOptions = Object.assign({}, defaultConfig.linkOptions, (_a = this.config) === null || _a === void 0 ? void 0 : _a.linkOptions, this.linkOptions);
|
|
3015
3206
|
this.ngZone.onStable.pipe(operators.take(1)).subscribe(function () {
|
|
3016
3207
|
_this.dragContainer.linkDragStarted.pipe(operators.takeUntil(_this.ngUnsubscribe$)).subscribe(function (event) {
|
|
3017
3208
|
_this.linkDragStarted.emit(event);
|
|
@@ -3062,13 +3253,30 @@
|
|
|
3062
3253
|
this.expandChange.emit();
|
|
3063
3254
|
}
|
|
3064
3255
|
};
|
|
3256
|
+
NgxGanttComponent.prototype.selectItem = function (selectEvent) {
|
|
3257
|
+
var _a;
|
|
3258
|
+
if (!this.selectable) {
|
|
3259
|
+
return;
|
|
3260
|
+
}
|
|
3261
|
+
var event = selectEvent.event, selectedValue = selectEvent.selectedValue;
|
|
3262
|
+
this.selectionModel.toggle(selectedValue.id);
|
|
3263
|
+
var selectedIds = this.selectionModel.selected;
|
|
3264
|
+
if (this.multiple) {
|
|
3265
|
+
var selectedValue_1 = this.getGanttItems(selectedIds).map(function (item) { return item.origin; });
|
|
3266
|
+
this.selectedChange.emit({ event: event, selectedValue: selectedValue_1 });
|
|
3267
|
+
}
|
|
3268
|
+
else {
|
|
3269
|
+
var selectedValue_2 = (_a = this.getGanttItem(selectedIds[0])) === null || _a === void 0 ? void 0 : _a.origin;
|
|
3270
|
+
this.selectedChange.emit({ event: event, selectedValue: selectedValue_2 });
|
|
3271
|
+
}
|
|
3272
|
+
};
|
|
3065
3273
|
NgxGanttComponent.prototype.ngOnDestroy = function () {
|
|
3066
3274
|
_super.prototype.onDestroy.call(this);
|
|
3067
3275
|
};
|
|
3068
3276
|
return NgxGanttComponent;
|
|
3069
3277
|
}(GanttUpper));
|
|
3070
3278
|
NgxGanttComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0__namespace, type: NgxGanttComponent, deps: [{ token: i0__namespace.ElementRef }, { token: i0__namespace.ChangeDetectorRef }, { token: i0__namespace.NgZone }, { token: GANTT_GLOBAL_CONFIG }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
3071
|
-
NgxGanttComponent.ɵcmp = i0__namespace.ɵɵ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: [
|
|
3279
|
+
NgxGanttComponent.ɵcmp = i0__namespace.ɵɵ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: [
|
|
3072
3280
|
{
|
|
3073
3281
|
provide: GANTT_UPPER_TOKEN,
|
|
3074
3282
|
useExisting: NgxGanttComponent
|
|
@@ -3077,7 +3285,7 @@
|
|
|
3077
3285
|
provide: GANTT_ABSTRACT_TOKEN,
|
|
3078
3286
|
useExisting: i0.forwardRef(function () { return NgxGanttComponent; })
|
|
3079
3287
|
}
|
|
3080
|
-
], 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__namespace, 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__namespace.ChangeDetectionStrategy.OnPush });
|
|
3288
|
+
], 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__namespace, 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__namespace.ChangeDetectionStrategy.OnPush });
|
|
3081
3289
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0__namespace, type: NgxGanttComponent, decorators: [{
|
|
3082
3290
|
type: i0.Component,
|
|
3083
3291
|
args: [{
|
|
@@ -3108,12 +3316,16 @@
|
|
|
3108
3316
|
type: i0.Input
|
|
3109
3317
|
}], linkable: [{
|
|
3110
3318
|
type: i0.Input
|
|
3319
|
+
}], linkOptions: [{
|
|
3320
|
+
type: i0.Input
|
|
3111
3321
|
}], linkDragStarted: [{
|
|
3112
3322
|
type: i0.Output
|
|
3113
3323
|
}], linkDragEnded: [{
|
|
3114
3324
|
type: i0.Output
|
|
3115
3325
|
}], lineClick: [{
|
|
3116
3326
|
type: i0.Output
|
|
3327
|
+
}], selectedChange: [{
|
|
3328
|
+
type: i0.Output
|
|
3117
3329
|
}], table: [{
|
|
3118
3330
|
type: i0.ContentChild,
|
|
3119
3331
|
args: [NgxGanttTableComponent]
|
|
@@ -3408,6 +3620,7 @@
|
|
|
3408
3620
|
exports.GanttLinkDragEvent = GanttLinkDragEvent;
|
|
3409
3621
|
exports.GanttLoadOnScrollEvent = GanttLoadOnScrollEvent;
|
|
3410
3622
|
exports.GanttPrintService = GanttPrintService;
|
|
3623
|
+
exports.GanttSelectedEvent = GanttSelectedEvent;
|
|
3411
3624
|
exports.GanttTableEvent = GanttTableEvent;
|
|
3412
3625
|
exports.GanttUpper = GanttUpper;
|
|
3413
3626
|
exports.GanttView = GanttView;
|