@worktile/gantt 12.1.2 → 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 +338 -73
- package/bundles/worktile-gantt.umd.js.map +1 -1
- package/class/event.d.ts +4 -0
- package/class/item.d.ts +3 -2
- package/class/link.d.ts +49 -0
- package/components/links/links.component.d.ts +5 -15
- 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/item.js +14 -3
- package/esm2015/class/link.js +19 -0
- package/esm2015/components/bar/bar-drag.js +13 -10
- package/esm2015/components/links/links.component.js +19 -73
- 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 +360 -94
- 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) {
|
|
@@ -559,6 +564,25 @@
|
|
|
559
564
|
GanttViewType["week"] = "week";
|
|
560
565
|
})(exports.GanttViewType || (exports.GanttViewType = {}));
|
|
561
566
|
|
|
567
|
+
var GanttLinkType;
|
|
568
|
+
(function (GanttLinkType) {
|
|
569
|
+
GanttLinkType[GanttLinkType["fs"] = 1] = "fs";
|
|
570
|
+
GanttLinkType[GanttLinkType["ff"] = 2] = "ff";
|
|
571
|
+
GanttLinkType[GanttLinkType["ss"] = 3] = "ss";
|
|
572
|
+
GanttLinkType[GanttLinkType["sf"] = 4] = "sf";
|
|
573
|
+
})(GanttLinkType || (GanttLinkType = {}));
|
|
574
|
+
var GanttLinkPathType;
|
|
575
|
+
(function (GanttLinkPathType) {
|
|
576
|
+
GanttLinkPathType["curve"] = "curve";
|
|
577
|
+
GanttLinkPathType["line"] = "line";
|
|
578
|
+
})(GanttLinkPathType || (GanttLinkPathType = {}));
|
|
579
|
+
var LinkColors;
|
|
580
|
+
(function (LinkColors) {
|
|
581
|
+
LinkColors["default"] = "#cacaca";
|
|
582
|
+
LinkColors["blocked"] = "#FF7575";
|
|
583
|
+
LinkColors["active"] = "#348FE4";
|
|
584
|
+
})(LinkColors || (LinkColors = {}));
|
|
585
|
+
|
|
562
586
|
exports.GanttItemType = void 0;
|
|
563
587
|
(function (GanttItemType) {
|
|
564
588
|
GanttItemType["bar"] = "bar";
|
|
@@ -571,7 +595,17 @@
|
|
|
571
595
|
this.refs$ = new rxjs.BehaviorSubject(null);
|
|
572
596
|
this.origin = item;
|
|
573
597
|
this.id = this.origin.id;
|
|
574
|
-
this.links = this.origin.links || []
|
|
598
|
+
this.links = (this.origin.links || []).map(function (link) {
|
|
599
|
+
if (typeof link === 'string') {
|
|
600
|
+
return {
|
|
601
|
+
type: GanttLinkType.fs,
|
|
602
|
+
link: link
|
|
603
|
+
};
|
|
604
|
+
}
|
|
605
|
+
else {
|
|
606
|
+
return link;
|
|
607
|
+
}
|
|
608
|
+
});
|
|
575
609
|
this.color = this.origin.color;
|
|
576
610
|
this.barStyle = this.origin.barStyle;
|
|
577
611
|
this.linkable = this.origin.linkable === undefined ? true : this.origin.linkable;
|
|
@@ -635,7 +669,7 @@
|
|
|
635
669
|
this.origin.expanded = expanded;
|
|
636
670
|
};
|
|
637
671
|
GanttItemInternal.prototype.addLink = function (linkId) {
|
|
638
|
-
this.links = __spreadArray(__spreadArray([], __read(this.links)), [linkId]);
|
|
672
|
+
this.links = __spreadArray(__spreadArray([], __read(this.links)), [{ type: GanttLinkType.fs, link: linkId }]);
|
|
639
673
|
this.origin.links = this.links;
|
|
640
674
|
};
|
|
641
675
|
return GanttItemInternal;
|
|
@@ -666,7 +700,12 @@
|
|
|
666
700
|
quarter: 'QQQ',
|
|
667
701
|
year: 'yyyy年',
|
|
668
702
|
yearMonth: 'yyyy年MM月',
|
|
669
|
-
yearQuarter: 'yyyy年QQQ'
|
|
703
|
+
yearQuarter: 'yyyy年QQQ'
|
|
704
|
+
},
|
|
705
|
+
linkOptions: {
|
|
706
|
+
dependencyTypes: [GanttLinkType.fs],
|
|
707
|
+
showArrow: false,
|
|
708
|
+
linkPathType: GanttLinkPathType.curve
|
|
670
709
|
}
|
|
671
710
|
};
|
|
672
711
|
var GANTT_GLOBAL_CONFIG = new i0.InjectionToken('GANTT_GLOBAL_CONFIG');
|
|
@@ -1157,8 +1196,40 @@
|
|
|
1157
1196
|
this.expandChange = new i0.EventEmitter();
|
|
1158
1197
|
this.firstChange = true;
|
|
1159
1198
|
this.unsubscribe$ = new rxjs.Subject();
|
|
1199
|
+
this._selectable = false;
|
|
1200
|
+
this._multiple = false;
|
|
1160
1201
|
this.ganttClass = true;
|
|
1161
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
|
+
});
|
|
1162
1233
|
Object.defineProperty(GanttUpper.prototype, "element", {
|
|
1163
1234
|
get: function () {
|
|
1164
1235
|
return this.elementRef.nativeElement;
|
|
@@ -1264,6 +1335,9 @@
|
|
|
1264
1335
|
this.expandChange.next();
|
|
1265
1336
|
this.cdr.detectChanges();
|
|
1266
1337
|
};
|
|
1338
|
+
GanttUpper.prototype.initSelectionModel = function () {
|
|
1339
|
+
return new collections.SelectionModel(this.multiple, []);
|
|
1340
|
+
};
|
|
1267
1341
|
GanttUpper.prototype.onInit = function () {
|
|
1268
1342
|
var _this = this;
|
|
1269
1343
|
this.styles = Object.assign({}, defaultStyles, this.styles);
|
|
@@ -1272,6 +1346,7 @@
|
|
|
1272
1346
|
this.setupGroups();
|
|
1273
1347
|
this.setupItems();
|
|
1274
1348
|
this.computeRefs();
|
|
1349
|
+
this.initSelectionModel();
|
|
1275
1350
|
this.firstChange = false;
|
|
1276
1351
|
this.ngZone.onStable.pipe(operators.take(1)).subscribe(function () {
|
|
1277
1352
|
_this.element.style.opacity = '1';
|
|
@@ -1357,10 +1432,19 @@
|
|
|
1357
1432
|
}
|
|
1358
1433
|
return items.filter(function (item) { return ids.includes(item.id); });
|
|
1359
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
|
+
};
|
|
1360
1444
|
return GanttUpper;
|
|
1361
1445
|
}());
|
|
1362
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 });
|
|
1363
|
-
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 });
|
|
1364
1448
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0__namespace, type: GanttUpper, decorators: [{
|
|
1365
1449
|
type: i0.Directive
|
|
1366
1450
|
}], ctorParameters: function () {
|
|
@@ -1390,6 +1474,10 @@
|
|
|
1390
1474
|
type: i0.Input
|
|
1391
1475
|
}], disabledLoadOnScroll: [{
|
|
1392
1476
|
type: i0.Input
|
|
1477
|
+
}], selectable: [{
|
|
1478
|
+
type: i0.Input
|
|
1479
|
+
}], multiple: [{
|
|
1480
|
+
type: i0.Input
|
|
1393
1481
|
}], loadOnScroll: [{
|
|
1394
1482
|
type: i0.Output
|
|
1395
1483
|
}], dragStarted: [{
|
|
@@ -1594,9 +1682,11 @@
|
|
|
1594
1682
|
var defaultColumnWidth = 100;
|
|
1595
1683
|
var minColumnWidth = 80;
|
|
1596
1684
|
var GanttTableComponent = /** @class */ (function () {
|
|
1597
|
-
function GanttTableComponent(gantt, elementRef) {
|
|
1685
|
+
function GanttTableComponent(gantt, ganttUpper, elementRef) {
|
|
1598
1686
|
this.gantt = gantt;
|
|
1687
|
+
this.ganttUpper = ganttUpper;
|
|
1599
1688
|
this.elementRef = elementRef;
|
|
1689
|
+
this.itemClick = new i0.EventEmitter();
|
|
1600
1690
|
this.ganttTableClass = true;
|
|
1601
1691
|
this.ganttTableEmptyClass = false;
|
|
1602
1692
|
}
|
|
@@ -1630,7 +1720,8 @@
|
|
|
1630
1720
|
GanttTableComponent.prototype.expandGroup = function (group) {
|
|
1631
1721
|
this.gantt.expandGroup(group);
|
|
1632
1722
|
};
|
|
1633
|
-
GanttTableComponent.prototype.expandChildren = function (item) {
|
|
1723
|
+
GanttTableComponent.prototype.expandChildren = function (event, item) {
|
|
1724
|
+
event.stopPropagation();
|
|
1634
1725
|
this.gantt.expandChildren(item);
|
|
1635
1726
|
};
|
|
1636
1727
|
GanttTableComponent.prototype.dragStarted = function (event) {
|
|
@@ -1705,8 +1796,8 @@
|
|
|
1705
1796
|
};
|
|
1706
1797
|
return GanttTableComponent;
|
|
1707
1798
|
}());
|
|
1708
|
-
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 });
|
|
1709
|
-
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 } });
|
|
1710
1801
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0__namespace, type: GanttTableComponent, decorators: [{
|
|
1711
1802
|
type: i0.Component,
|
|
1712
1803
|
args: [{
|
|
@@ -1717,6 +1808,9 @@
|
|
|
1717
1808
|
return [{ type: undefined, decorators: [{
|
|
1718
1809
|
type: i0.Inject,
|
|
1719
1810
|
args: [GANTT_ABSTRACT_TOKEN]
|
|
1811
|
+
}] }, { type: GanttUpper, decorators: [{
|
|
1812
|
+
type: i0.Inject,
|
|
1813
|
+
args: [GANTT_UPPER_TOKEN]
|
|
1720
1814
|
}] }, { type: i0__namespace.ElementRef }];
|
|
1721
1815
|
}, propDecorators: { groups: [{
|
|
1722
1816
|
type: i0.Input
|
|
@@ -1732,6 +1826,8 @@
|
|
|
1732
1826
|
type: i0.Input
|
|
1733
1827
|
}], rowAfterTemplate: [{
|
|
1734
1828
|
type: i0.Input
|
|
1829
|
+
}], itemClick: [{
|
|
1830
|
+
type: i0.Output
|
|
1735
1831
|
}], draglineElementRef: [{
|
|
1736
1832
|
type: i0.ViewChild,
|
|
1737
1833
|
args: ['dragLine', { static: true }]
|
|
@@ -2253,12 +2349,181 @@
|
|
|
2253
2349
|
args: ['mainTemplate', { static: true }]
|
|
2254
2350
|
}] } });
|
|
2255
2351
|
|
|
2256
|
-
var
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
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
|
+
|
|
2262
2527
|
var GanttLinksComponent = /** @class */ (function () {
|
|
2263
2528
|
function GanttLinksComponent(ganttUpper, cdr, elementRef, ganttDragContainer) {
|
|
2264
2529
|
this.ganttUpper = ganttUpper;
|
|
@@ -2269,21 +2534,24 @@
|
|
|
2269
2534
|
this.items = [];
|
|
2270
2535
|
this.lineClick = new i0.EventEmitter();
|
|
2271
2536
|
this.links = [];
|
|
2537
|
+
this.ganttLinkTypes = GanttLinkType;
|
|
2538
|
+
this.showArrow = false;
|
|
2272
2539
|
this.linkItems = [];
|
|
2273
|
-
this.bezierWeight = -0.5;
|
|
2274
2540
|
this.firstChange = true;
|
|
2275
2541
|
this.unsubscribe$ = new rxjs.Subject();
|
|
2276
2542
|
this.ganttLinksOverlay = true;
|
|
2277
2543
|
}
|
|
2278
2544
|
GanttLinksComponent.prototype.ngOnInit = function () {
|
|
2279
2545
|
var _this = this;
|
|
2546
|
+
this.linkPath = generatePathFactory(this.ganttUpper.linkOptions.linkPathType, this.ganttUpper);
|
|
2547
|
+
this.showArrow = this.ganttUpper.linkOptions.showArrow;
|
|
2280
2548
|
this.buildLinks();
|
|
2281
2549
|
this.firstChange = false;
|
|
2282
2550
|
this.ganttDragContainer.dragStarted.pipe(operators.takeUntil(this.unsubscribe$)).subscribe(function () {
|
|
2283
2551
|
_this.elementRef.nativeElement.style.visibility = 'hidden';
|
|
2284
2552
|
});
|
|
2285
2553
|
rxjs.merge(this.ganttUpper.viewChange, this.ganttUpper.expandChange, this.ganttUpper.view.start$, this.ganttUpper.dragEnded, this.ganttUpper.linkDragEnded)
|
|
2286
|
-
.pipe(operators.takeUntil(this.unsubscribe$), operators.skip(1))
|
|
2554
|
+
.pipe(operators.takeUntil(this.unsubscribe$), operators.skip(1), operators.debounceTime(0))
|
|
2287
2555
|
.subscribe(function () {
|
|
2288
2556
|
_this.elementRef.nativeElement.style.visibility = 'visible';
|
|
2289
2557
|
_this.buildLinks();
|
|
@@ -2335,56 +2603,25 @@
|
|
|
2335
2603
|
});
|
|
2336
2604
|
}
|
|
2337
2605
|
};
|
|
2338
|
-
GanttLinksComponent.prototype.generatePath = function (source, target) {
|
|
2339
|
-
if (source.before && source.after && target.before && target.after) {
|
|
2340
|
-
var x1 = source.after.x;
|
|
2341
|
-
var y1 = source.after.y;
|
|
2342
|
-
var x4 = target.before.x;
|
|
2343
|
-
var y4 = target.before.y;
|
|
2344
|
-
var dx = Math.abs(x4 - x1) * this.bezierWeight;
|
|
2345
|
-
var x2 = x1 - dx;
|
|
2346
|
-
var x3 = x4 + dx;
|
|
2347
|
-
var centerX = (x1 + x4) / 2;
|
|
2348
|
-
var centerY = (y1 + y4) / 2;
|
|
2349
|
-
var controlX = this.ganttUpper.styles.lineHeight / 2;
|
|
2350
|
-
var controlY = this.ganttUpper.styles.lineHeight / 2;
|
|
2351
|
-
if (x1 >= x4) {
|
|
2352
|
-
if (y4 > y1) {
|
|
2353
|
-
if (Math.abs(y4 - y1) <= this.ganttUpper.styles.lineHeight) {
|
|
2354
|
-
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;
|
|
2355
|
-
}
|
|
2356
|
-
else {
|
|
2357
|
-
controlX = this.ganttUpper.styles.lineHeight;
|
|
2358
|
-
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;
|
|
2359
|
-
}
|
|
2360
|
-
}
|
|
2361
|
-
else {
|
|
2362
|
-
if (Math.abs(y4 - y1) <= this.ganttUpper.styles.lineHeight) {
|
|
2363
|
-
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 ";
|
|
2364
|
-
}
|
|
2365
|
-
else {
|
|
2366
|
-
controlX = this.ganttUpper.styles.lineHeight;
|
|
2367
|
-
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;
|
|
2368
|
-
}
|
|
2369
|
-
}
|
|
2370
|
-
}
|
|
2371
|
-
return "M " + x1 + " " + y1 + " C " + x2 + " " + y1 + " " + x3 + " " + y4 + " " + x4 + " " + y4;
|
|
2372
|
-
}
|
|
2373
|
-
};
|
|
2374
2606
|
GanttLinksComponent.prototype.buildLinks = function () {
|
|
2375
2607
|
var _this = this;
|
|
2376
2608
|
this.computeItemPosition();
|
|
2377
2609
|
this.links = [];
|
|
2378
2610
|
this.linkItems.forEach(function (source) {
|
|
2379
2611
|
if (source.origin.start || source.origin.end) {
|
|
2380
|
-
source.links.forEach(function (
|
|
2381
|
-
var target = _this.linkItems.find(function (item) { return item.id ===
|
|
2612
|
+
source.links.forEach(function (link) {
|
|
2613
|
+
var target = _this.linkItems.find(function (item) { return item.id === link.link; });
|
|
2382
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
|
+
}
|
|
2383
2619
|
_this.links.push({
|
|
2384
|
-
path: _this.generatePath(source, target),
|
|
2620
|
+
path: _this.linkPath.generatePath(source, target, link.type),
|
|
2385
2621
|
source: source.origin,
|
|
2386
2622
|
target: target.origin,
|
|
2387
|
-
|
|
2623
|
+
type: link.type,
|
|
2624
|
+
color: link.color || color
|
|
2388
2625
|
});
|
|
2389
2626
|
}
|
|
2390
2627
|
});
|
|
@@ -2418,7 +2655,7 @@
|
|
|
2418
2655
|
return GanttLinksComponent;
|
|
2419
2656
|
}());
|
|
2420
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 });
|
|
2421
|
-
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
|
|
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"] }] });
|
|
2422
2659
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0__namespace, type: GanttLinksComponent, decorators: [{
|
|
2423
2660
|
type: i0.Component,
|
|
2424
2661
|
args: [{
|
|
@@ -2597,19 +2834,22 @@
|
|
|
2597
2834
|
_this.dragContainer.dragStarted.emit({ item: _this.item.origin });
|
|
2598
2835
|
});
|
|
2599
2836
|
dragRef.moved.subscribe(function (event) {
|
|
2600
|
-
var
|
|
2601
|
-
var
|
|
2602
|
-
var
|
|
2603
|
-
var
|
|
2604
|
-
|
|
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);
|
|
2605
2849
|
_this.item.updateDate(start, end);
|
|
2606
2850
|
_this.dragContainer.dragMoved.emit({ item: _this.item.origin });
|
|
2607
2851
|
});
|
|
2608
2852
|
dragRef.ended.subscribe(function (event) {
|
|
2609
|
-
var days = dateFns.differenceInCalendarDays(_this.item.end.value, _this.item.start.value);
|
|
2610
|
-
var start = _this.ganttUpper.view.getDateByXPoint(_this.item.refs.x + event.distance.x);
|
|
2611
|
-
var end = start.addDays(days);
|
|
2612
|
-
_this.item.updateDate(start, end);
|
|
2613
2853
|
_this.clearDraggingStyles();
|
|
2614
2854
|
_this.closeDragBackdrop();
|
|
2615
2855
|
event.source.reset();
|
|
@@ -2912,7 +3152,7 @@
|
|
|
2912
3152
|
return GanttMainComponent;
|
|
2913
3153
|
}());
|
|
2914
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 });
|
|
2915
|
-
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 } });
|
|
2916
3156
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0__namespace, type: GanttMainComponent, decorators: [{
|
|
2917
3157
|
type: i0.Component,
|
|
2918
3158
|
args: [{
|
|
@@ -2953,13 +3193,16 @@
|
|
|
2953
3193
|
_this.linkDragStarted = new i0.EventEmitter();
|
|
2954
3194
|
_this.linkDragEnded = new i0.EventEmitter();
|
|
2955
3195
|
_this.lineClick = new i0.EventEmitter();
|
|
3196
|
+
_this.selectedChange = new i0.EventEmitter();
|
|
2956
3197
|
_this.ngUnsubscribe$ = new rxjs.Subject();
|
|
2957
3198
|
_this.sideTableWidth = sideWidth;
|
|
2958
3199
|
return _this;
|
|
2959
3200
|
}
|
|
2960
3201
|
NgxGanttComponent.prototype.ngOnInit = function () {
|
|
2961
3202
|
var _this = this;
|
|
3203
|
+
var _a;
|
|
2962
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);
|
|
2963
3206
|
this.ngZone.onStable.pipe(operators.take(1)).subscribe(function () {
|
|
2964
3207
|
_this.dragContainer.linkDragStarted.pipe(operators.takeUntil(_this.ngUnsubscribe$)).subscribe(function (event) {
|
|
2965
3208
|
_this.linkDragStarted.emit(event);
|
|
@@ -3010,13 +3253,30 @@
|
|
|
3010
3253
|
this.expandChange.emit();
|
|
3011
3254
|
}
|
|
3012
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
|
+
};
|
|
3013
3273
|
NgxGanttComponent.prototype.ngOnDestroy = function () {
|
|
3014
3274
|
_super.prototype.onDestroy.call(this);
|
|
3015
3275
|
};
|
|
3016
3276
|
return NgxGanttComponent;
|
|
3017
3277
|
}(GanttUpper));
|
|
3018
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 });
|
|
3019
|
-
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: [
|
|
3020
3280
|
{
|
|
3021
3281
|
provide: GANTT_UPPER_TOKEN,
|
|
3022
3282
|
useExisting: NgxGanttComponent
|
|
@@ -3025,7 +3285,7 @@
|
|
|
3025
3285
|
provide: GANTT_ABSTRACT_TOKEN,
|
|
3026
3286
|
useExisting: i0.forwardRef(function () { return NgxGanttComponent; })
|
|
3027
3287
|
}
|
|
3028
|
-
], 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 });
|
|
3029
3289
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0__namespace, type: NgxGanttComponent, decorators: [{
|
|
3030
3290
|
type: i0.Component,
|
|
3031
3291
|
args: [{
|
|
@@ -3056,12 +3316,16 @@
|
|
|
3056
3316
|
type: i0.Input
|
|
3057
3317
|
}], linkable: [{
|
|
3058
3318
|
type: i0.Input
|
|
3319
|
+
}], linkOptions: [{
|
|
3320
|
+
type: i0.Input
|
|
3059
3321
|
}], linkDragStarted: [{
|
|
3060
3322
|
type: i0.Output
|
|
3061
3323
|
}], linkDragEnded: [{
|
|
3062
3324
|
type: i0.Output
|
|
3063
3325
|
}], lineClick: [{
|
|
3064
3326
|
type: i0.Output
|
|
3327
|
+
}], selectedChange: [{
|
|
3328
|
+
type: i0.Output
|
|
3065
3329
|
}], table: [{
|
|
3066
3330
|
type: i0.ContentChild,
|
|
3067
3331
|
args: [NgxGanttTableComponent]
|
|
@@ -3356,6 +3620,7 @@
|
|
|
3356
3620
|
exports.GanttLinkDragEvent = GanttLinkDragEvent;
|
|
3357
3621
|
exports.GanttLoadOnScrollEvent = GanttLoadOnScrollEvent;
|
|
3358
3622
|
exports.GanttPrintService = GanttPrintService;
|
|
3623
|
+
exports.GanttSelectedEvent = GanttSelectedEvent;
|
|
3359
3624
|
exports.GanttTableEvent = GanttTableEvent;
|
|
3360
3625
|
exports.GanttUpper = GanttUpper;
|
|
3361
3626
|
exports.GanttView = GanttView;
|