@worktile/gantt 12.2.0-next.0 → 12.2.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 +516 -325
- package/bundles/worktile-gantt.umd.js.map +1 -1
- package/class/event.d.ts +6 -0
- package/class/index.d.ts +1 -0
- package/class/item.d.ts +1 -1
- package/class/link.d.ts +19 -4
- package/components/links/lines/curve.d.ts +10 -0
- package/components/links/lines/factory.d.ts +5 -0
- package/components/links/lines/line.d.ts +8 -0
- package/components/links/lines/straight.d.ts +9 -0
- package/components/links/links.component.d.ts +5 -4
- package/components/table/gantt-table.component.d.ts +8 -5
- package/esm2015/class/event.js +3 -1
- package/esm2015/class/index.js +2 -1
- package/esm2015/class/item.js +4 -3
- package/esm2015/class/link.js +9 -4
- package/esm2015/components/bar/bar-drag.js +50 -24
- package/esm2015/components/bar/bar.component.js +4 -4
- package/esm2015/components/calendar/calendar.component.js +3 -3
- package/esm2015/components/drag-backdrop/drag-backdrop.component.js +3 -3
- package/esm2015/components/icon/icon.component.js +3 -3
- package/esm2015/components/links/lines/curve.js +96 -0
- package/esm2015/components/links/lines/factory.js +14 -0
- package/esm2015/components/links/lines/line.js +24 -0
- package/esm2015/components/links/lines/straight.js +58 -0
- package/esm2015/components/links/links.component.js +37 -114
- package/esm2015/components/main/gantt-main.component.js +4 -4
- package/esm2015/components/range/range.component.js +3 -3
- package/esm2015/components/table/gantt-table.component.js +17 -7
- package/esm2015/gantt-dom.service.js +3 -3
- package/esm2015/gantt-drag-container.js +57 -40
- package/esm2015/gantt-item-upper.js +3 -3
- package/esm2015/gantt-print.service.js +3 -3
- package/esm2015/gantt-upper.js +55 -4
- package/esm2015/gantt.component.js +25 -5
- package/esm2015/gantt.config.js +8 -2
- package/esm2015/gantt.module.js +4 -4
- package/esm2015/gantt.pipe.js +9 -9
- package/esm2015/root.component.js +3 -3
- package/esm2015/table/gantt-column.component.js +3 -3
- package/esm2015/table/gantt-table.component.js +3 -3
- package/fesm2015/worktile-gantt.js +475 -243
- package/fesm2015/worktile-gantt.js.map +1 -1
- package/gantt-drag-container.d.ts +20 -8
- package/gantt-upper.d.ts +17 -2
- package/gantt.component.d.ts +4 -2
- package/gantt.config.d.ts +7 -0
- package/main.bundle.scss +43 -1
- 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
|
|
|
@@ -15,14 +15,12 @@
|
|
|
15
15
|
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
16
16
|
Object.defineProperty(n, k, d.get ? d : {
|
|
17
17
|
enumerable: true,
|
|
18
|
-
get: function () {
|
|
19
|
-
return e[k];
|
|
20
|
-
}
|
|
18
|
+
get: function () { return e[k]; }
|
|
21
19
|
});
|
|
22
20
|
}
|
|
23
21
|
});
|
|
24
22
|
}
|
|
25
|
-
n[
|
|
23
|
+
n["default"] = e;
|
|
26
24
|
return Object.freeze(n);
|
|
27
25
|
}
|
|
28
26
|
|
|
@@ -266,7 +264,7 @@
|
|
|
266
264
|
ar[i] = from[i];
|
|
267
265
|
}
|
|
268
266
|
}
|
|
269
|
-
return to.concat(ar || from);
|
|
267
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
270
268
|
}
|
|
271
269
|
function __await(v) {
|
|
272
270
|
return this instanceof __await ? (this.v = v, this) : new __await(v);
|
|
@@ -390,6 +388,11 @@
|
|
|
390
388
|
}
|
|
391
389
|
return GanttBarClickEvent;
|
|
392
390
|
}());
|
|
391
|
+
var GanttSelectedEvent = /** @class */ (function () {
|
|
392
|
+
function GanttSelectedEvent() {
|
|
393
|
+
}
|
|
394
|
+
return GanttSelectedEvent;
|
|
395
|
+
}());
|
|
393
396
|
|
|
394
397
|
var GanttDate = /** @class */ (function () {
|
|
395
398
|
function GanttDate(date) {
|
|
@@ -559,19 +562,24 @@
|
|
|
559
562
|
GanttViewType["week"] = "week";
|
|
560
563
|
})(exports.GanttViewType || (exports.GanttViewType = {}));
|
|
561
564
|
|
|
562
|
-
|
|
565
|
+
exports.GanttLinkType = void 0;
|
|
563
566
|
(function (GanttLinkType) {
|
|
564
|
-
GanttLinkType[GanttLinkType["fs"] =
|
|
565
|
-
GanttLinkType[GanttLinkType["ss"] = 1] = "ss";
|
|
567
|
+
GanttLinkType[GanttLinkType["fs"] = 1] = "fs";
|
|
566
568
|
GanttLinkType[GanttLinkType["ff"] = 2] = "ff";
|
|
567
|
-
GanttLinkType[GanttLinkType["
|
|
568
|
-
|
|
569
|
-
|
|
569
|
+
GanttLinkType[GanttLinkType["ss"] = 3] = "ss";
|
|
570
|
+
GanttLinkType[GanttLinkType["sf"] = 4] = "sf";
|
|
571
|
+
})(exports.GanttLinkType || (exports.GanttLinkType = {}));
|
|
572
|
+
exports.GanttLinkLineType = void 0;
|
|
573
|
+
(function (GanttLinkLineType) {
|
|
574
|
+
GanttLinkLineType["curve"] = "curve";
|
|
575
|
+
GanttLinkLineType["straight"] = "straight";
|
|
576
|
+
})(exports.GanttLinkLineType || (exports.GanttLinkLineType = {}));
|
|
577
|
+
exports.LinkColors = void 0;
|
|
570
578
|
(function (LinkColors) {
|
|
571
579
|
LinkColors["default"] = "#cacaca";
|
|
572
580
|
LinkColors["blocked"] = "#FF7575";
|
|
573
581
|
LinkColors["active"] = "#348FE4";
|
|
574
|
-
})(LinkColors || (LinkColors = {}));
|
|
582
|
+
})(exports.LinkColors || (exports.LinkColors = {}));
|
|
575
583
|
|
|
576
584
|
exports.GanttItemType = void 0;
|
|
577
585
|
(function (GanttItemType) {
|
|
@@ -588,7 +596,7 @@
|
|
|
588
596
|
this.links = (this.origin.links || []).map(function (link) {
|
|
589
597
|
if (typeof link === 'string') {
|
|
590
598
|
return {
|
|
591
|
-
type: GanttLinkType.fs,
|
|
599
|
+
type: exports.GanttLinkType.fs,
|
|
592
600
|
link: link
|
|
593
601
|
};
|
|
594
602
|
}
|
|
@@ -658,8 +666,9 @@
|
|
|
658
666
|
this.expanded = expanded;
|
|
659
667
|
this.origin.expanded = expanded;
|
|
660
668
|
};
|
|
661
|
-
GanttItemInternal.prototype.addLink = function (
|
|
662
|
-
|
|
669
|
+
GanttItemInternal.prototype.addLink = function (link) {
|
|
670
|
+
console.log(link);
|
|
671
|
+
this.links = __spreadArray(__spreadArray([], __read(this.links)), [link]);
|
|
663
672
|
this.origin.links = this.links;
|
|
664
673
|
};
|
|
665
674
|
return GanttItemInternal;
|
|
@@ -690,7 +699,12 @@
|
|
|
690
699
|
quarter: 'QQQ',
|
|
691
700
|
year: 'yyyy年',
|
|
692
701
|
yearMonth: 'yyyy年MM月',
|
|
693
|
-
yearQuarter: 'yyyy年QQQ'
|
|
702
|
+
yearQuarter: 'yyyy年QQQ'
|
|
703
|
+
},
|
|
704
|
+
linkOptions: {
|
|
705
|
+
dependencyTypes: [exports.GanttLinkType.fs],
|
|
706
|
+
showArrow: false,
|
|
707
|
+
lineType: exports.GanttLinkLineType.curve
|
|
694
708
|
}
|
|
695
709
|
};
|
|
696
710
|
var GANTT_GLOBAL_CONFIG = new i0.InjectionToken('GANTT_GLOBAL_CONFIG');
|
|
@@ -1181,8 +1195,50 @@
|
|
|
1181
1195
|
this.expandChange = new i0.EventEmitter();
|
|
1182
1196
|
this.firstChange = true;
|
|
1183
1197
|
this.unsubscribe$ = new rxjs.Subject();
|
|
1198
|
+
this._selectable = false;
|
|
1199
|
+
this._multiple = false;
|
|
1184
1200
|
this.ganttClass = true;
|
|
1185
1201
|
}
|
|
1202
|
+
Object.defineProperty(GanttUpper.prototype, "linkOptions", {
|
|
1203
|
+
get: function () {
|
|
1204
|
+
return Object.assign({}, defaultConfig.linkOptions, this.config.linkOptions, this._linkOptions);
|
|
1205
|
+
},
|
|
1206
|
+
set: function (options) {
|
|
1207
|
+
this._linkOptions = options;
|
|
1208
|
+
},
|
|
1209
|
+
enumerable: false,
|
|
1210
|
+
configurable: true
|
|
1211
|
+
});
|
|
1212
|
+
Object.defineProperty(GanttUpper.prototype, "selectable", {
|
|
1213
|
+
get: function () {
|
|
1214
|
+
return this._selectable;
|
|
1215
|
+
},
|
|
1216
|
+
set: function (value) {
|
|
1217
|
+
var _a;
|
|
1218
|
+
this._selectable = coercion.coerceBooleanProperty(value);
|
|
1219
|
+
if (this._selectable) {
|
|
1220
|
+
this.selectionModel = this.initSelectionModel();
|
|
1221
|
+
}
|
|
1222
|
+
else {
|
|
1223
|
+
(_a = this.selectionModel) === null || _a === void 0 ? void 0 : _a.clear();
|
|
1224
|
+
}
|
|
1225
|
+
},
|
|
1226
|
+
enumerable: false,
|
|
1227
|
+
configurable: true
|
|
1228
|
+
});
|
|
1229
|
+
Object.defineProperty(GanttUpper.prototype, "multiple", {
|
|
1230
|
+
get: function () {
|
|
1231
|
+
return this._multiple;
|
|
1232
|
+
},
|
|
1233
|
+
set: function (value) {
|
|
1234
|
+
this._multiple = coercion.coerceBooleanProperty(value);
|
|
1235
|
+
if (this.selectable) {
|
|
1236
|
+
this.selectionModel = this.initSelectionModel();
|
|
1237
|
+
}
|
|
1238
|
+
},
|
|
1239
|
+
enumerable: false,
|
|
1240
|
+
configurable: true
|
|
1241
|
+
});
|
|
1186
1242
|
Object.defineProperty(GanttUpper.prototype, "element", {
|
|
1187
1243
|
get: function () {
|
|
1188
1244
|
return this.elementRef.nativeElement;
|
|
@@ -1288,6 +1344,9 @@
|
|
|
1288
1344
|
this.expandChange.next();
|
|
1289
1345
|
this.cdr.detectChanges();
|
|
1290
1346
|
};
|
|
1347
|
+
GanttUpper.prototype.initSelectionModel = function () {
|
|
1348
|
+
return new collections.SelectionModel(this.multiple, []);
|
|
1349
|
+
};
|
|
1291
1350
|
GanttUpper.prototype.onInit = function () {
|
|
1292
1351
|
var _this = this;
|
|
1293
1352
|
this.styles = Object.assign({}, defaultStyles, this.styles);
|
|
@@ -1296,6 +1355,7 @@
|
|
|
1296
1355
|
this.setupGroups();
|
|
1297
1356
|
this.setupItems();
|
|
1298
1357
|
this.computeRefs();
|
|
1358
|
+
this.initSelectionModel();
|
|
1299
1359
|
this.firstChange = false;
|
|
1300
1360
|
this.ngZone.onStable.pipe(operators.take(1)).subscribe(function () {
|
|
1301
1361
|
_this.element.style.opacity = '1';
|
|
@@ -1381,11 +1441,20 @@
|
|
|
1381
1441
|
}
|
|
1382
1442
|
return items.filter(function (item) { return ids.includes(item.id); });
|
|
1383
1443
|
};
|
|
1444
|
+
GanttUpper.prototype.isSelected = function (id) {
|
|
1445
|
+
if (!this.selectable) {
|
|
1446
|
+
return false;
|
|
1447
|
+
}
|
|
1448
|
+
if (!this.selectionModel.hasValue()) {
|
|
1449
|
+
return false;
|
|
1450
|
+
}
|
|
1451
|
+
return this.selectionModel.isSelected(id);
|
|
1452
|
+
};
|
|
1384
1453
|
return GanttUpper;
|
|
1385
1454
|
}());
|
|
1386
|
-
GanttUpper.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.
|
|
1387
|
-
GanttUpper.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.1.
|
|
1388
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.
|
|
1455
|
+
GanttUpper.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.5", 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 });
|
|
1456
|
+
GanttUpper.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.1.5", type: GanttUpper, inputs: { originItems: ["items", "originItems"], originGroups: ["groups", "originGroups"], viewType: "viewType", start: "start", end: "end", showTodayLine: "showTodayLine", draggable: "draggable", styles: "styles", viewOptions: "viewOptions", linkOptions: "linkOptions", 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 });
|
|
1457
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: GanttUpper, decorators: [{
|
|
1389
1458
|
type: i0.Directive
|
|
1390
1459
|
}], ctorParameters: function () {
|
|
1391
1460
|
return [{ type: i0__namespace.ElementRef }, { type: i0__namespace.ChangeDetectorRef }, { type: i0__namespace.NgZone }, { type: undefined, decorators: [{
|
|
@@ -1412,8 +1481,14 @@
|
|
|
1412
1481
|
type: i0.Input
|
|
1413
1482
|
}], viewOptions: [{
|
|
1414
1483
|
type: i0.Input
|
|
1484
|
+
}], linkOptions: [{
|
|
1485
|
+
type: i0.Input
|
|
1415
1486
|
}], disabledLoadOnScroll: [{
|
|
1416
1487
|
type: i0.Input
|
|
1488
|
+
}], selectable: [{
|
|
1489
|
+
type: i0.Input
|
|
1490
|
+
}], multiple: [{
|
|
1491
|
+
type: i0.Input
|
|
1417
1492
|
}], loadOnScroll: [{
|
|
1418
1493
|
type: i0.Output
|
|
1419
1494
|
}], dragStarted: [{
|
|
@@ -1459,9 +1534,9 @@
|
|
|
1459
1534
|
NgxGanttTableColumnComponent.prototype.ngOnInit = function () { };
|
|
1460
1535
|
return NgxGanttTableColumnComponent;
|
|
1461
1536
|
}());
|
|
1462
|
-
NgxGanttTableColumnComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.
|
|
1463
|
-
NgxGanttTableColumnComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.1.
|
|
1464
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.
|
|
1537
|
+
NgxGanttTableColumnComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: NgxGanttTableColumnComponent, deps: [{ token: GANTT_UPPER_TOKEN }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
1538
|
+
NgxGanttTableColumnComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.1.5", type: NgxGanttTableColumnComponent, selector: "ngx-gantt-column", inputs: { width: "width", name: "name" }, queries: [{ propertyName: "templateRef", first: true, predicate: ["cell"], descendants: true, static: true }, { propertyName: "headerTemplateRef", first: true, predicate: ["header"], descendants: true, static: true }], ngImport: i0__namespace, template: '', isInline: true });
|
|
1539
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: NgxGanttTableColumnComponent, decorators: [{
|
|
1465
1540
|
type: i0.Component,
|
|
1466
1541
|
args: [{
|
|
1467
1542
|
selector: 'ngx-gantt-column',
|
|
@@ -1491,9 +1566,9 @@
|
|
|
1491
1566
|
NgxGanttTableComponent.prototype.ngOnInit = function () { };
|
|
1492
1567
|
return NgxGanttTableComponent;
|
|
1493
1568
|
}());
|
|
1494
|
-
NgxGanttTableComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.
|
|
1495
|
-
NgxGanttTableComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.1.
|
|
1496
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.
|
|
1569
|
+
NgxGanttTableComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: NgxGanttTableComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
1570
|
+
NgxGanttTableComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.1.5", type: NgxGanttTableComponent, selector: "ngx-gantt-table", outputs: { columnChanges: "columnChanges" }, queries: [{ propertyName: "rowBeforeTemplate", first: true, predicate: ["rowBeforeSlot"], descendants: true, static: true }, { propertyName: "rowAfterTemplate", first: true, predicate: ["rowAfterSlot"], descendants: true, static: true }], ngImport: i0__namespace, template: '', isInline: true });
|
|
1571
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: NgxGanttTableComponent, decorators: [{
|
|
1497
1572
|
type: i0.Component,
|
|
1498
1573
|
args: [{
|
|
1499
1574
|
selector: 'ngx-gantt-table',
|
|
@@ -1551,9 +1626,9 @@
|
|
|
1551
1626
|
};
|
|
1552
1627
|
return GanttIconComponent;
|
|
1553
1628
|
}());
|
|
1554
|
-
GanttIconComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.
|
|
1555
|
-
GanttIconComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.1.
|
|
1556
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.
|
|
1629
|
+
GanttIconComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: GanttIconComponent, deps: [{ token: i0__namespace.ElementRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
1630
|
+
GanttIconComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.1.5", type: GanttIconComponent, selector: "gantt-icon", inputs: { iconName: "iconName" }, host: { properties: { "class.gantt-icon": "this.isIcon" } }, ngImport: i0__namespace, template: '', isInline: true });
|
|
1631
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: GanttIconComponent, decorators: [{
|
|
1557
1632
|
type: i0.Component,
|
|
1558
1633
|
args: [{
|
|
1559
1634
|
selector: 'gantt-icon',
|
|
@@ -1574,9 +1649,9 @@
|
|
|
1574
1649
|
};
|
|
1575
1650
|
return IsGanttRangeItemPipe;
|
|
1576
1651
|
}());
|
|
1577
|
-
IsGanttRangeItemPipe.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.
|
|
1578
|
-
IsGanttRangeItemPipe.ɵpipe = i0__namespace.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.1.
|
|
1579
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.
|
|
1652
|
+
IsGanttRangeItemPipe.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: IsGanttRangeItemPipe, deps: [], target: i0__namespace.ɵɵFactoryTarget.Pipe });
|
|
1653
|
+
IsGanttRangeItemPipe.ɵpipe = i0__namespace.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: IsGanttRangeItemPipe, name: "isGanttRangeItem" });
|
|
1654
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: IsGanttRangeItemPipe, decorators: [{
|
|
1580
1655
|
type: i0.Pipe,
|
|
1581
1656
|
args: [{
|
|
1582
1657
|
name: 'isGanttRangeItem'
|
|
@@ -1590,9 +1665,9 @@
|
|
|
1590
1665
|
};
|
|
1591
1666
|
return IsGanttBarItemPipe;
|
|
1592
1667
|
}());
|
|
1593
|
-
IsGanttBarItemPipe.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.
|
|
1594
|
-
IsGanttBarItemPipe.ɵpipe = i0__namespace.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.1.
|
|
1595
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.
|
|
1668
|
+
IsGanttBarItemPipe.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: IsGanttBarItemPipe, deps: [], target: i0__namespace.ɵɵFactoryTarget.Pipe });
|
|
1669
|
+
IsGanttBarItemPipe.ɵpipe = i0__namespace.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: IsGanttBarItemPipe, name: "isGanttBarItem" });
|
|
1670
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: IsGanttBarItemPipe, decorators: [{
|
|
1596
1671
|
type: i0.Pipe,
|
|
1597
1672
|
args: [{
|
|
1598
1673
|
name: 'isGanttBarItem'
|
|
@@ -1606,9 +1681,9 @@
|
|
|
1606
1681
|
};
|
|
1607
1682
|
return IsGanttCustomItemPipe;
|
|
1608
1683
|
}());
|
|
1609
|
-
IsGanttCustomItemPipe.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.
|
|
1610
|
-
IsGanttCustomItemPipe.ɵpipe = i0__namespace.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.1.
|
|
1611
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.
|
|
1684
|
+
IsGanttCustomItemPipe.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: IsGanttCustomItemPipe, deps: [], target: i0__namespace.ɵɵFactoryTarget.Pipe });
|
|
1685
|
+
IsGanttCustomItemPipe.ɵpipe = i0__namespace.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: IsGanttCustomItemPipe, name: "isGanttCustomItem" });
|
|
1686
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: IsGanttCustomItemPipe, decorators: [{
|
|
1612
1687
|
type: i0.Pipe,
|
|
1613
1688
|
args: [{
|
|
1614
1689
|
name: 'isGanttCustomItem'
|
|
@@ -1618,9 +1693,11 @@
|
|
|
1618
1693
|
var defaultColumnWidth = 100;
|
|
1619
1694
|
var minColumnWidth = 80;
|
|
1620
1695
|
var GanttTableComponent = /** @class */ (function () {
|
|
1621
|
-
function GanttTableComponent(gantt, elementRef) {
|
|
1696
|
+
function GanttTableComponent(gantt, ganttUpper, elementRef) {
|
|
1622
1697
|
this.gantt = gantt;
|
|
1698
|
+
this.ganttUpper = ganttUpper;
|
|
1623
1699
|
this.elementRef = elementRef;
|
|
1700
|
+
this.itemClick = new i0.EventEmitter();
|
|
1624
1701
|
this.ganttTableClass = true;
|
|
1625
1702
|
this.ganttTableEmptyClass = false;
|
|
1626
1703
|
}
|
|
@@ -1654,7 +1731,8 @@
|
|
|
1654
1731
|
GanttTableComponent.prototype.expandGroup = function (group) {
|
|
1655
1732
|
this.gantt.expandGroup(group);
|
|
1656
1733
|
};
|
|
1657
|
-
GanttTableComponent.prototype.expandChildren = function (item) {
|
|
1734
|
+
GanttTableComponent.prototype.expandChildren = function (event, item) {
|
|
1735
|
+
event.stopPropagation();
|
|
1658
1736
|
this.gantt.expandChildren(item);
|
|
1659
1737
|
};
|
|
1660
1738
|
GanttTableComponent.prototype.dragStarted = function (event) {
|
|
@@ -1729,9 +1807,9 @@
|
|
|
1729
1807
|
};
|
|
1730
1808
|
return GanttTableComponent;
|
|
1731
1809
|
}());
|
|
1732
|
-
GanttTableComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.
|
|
1733
|
-
GanttTableComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.1.
|
|
1734
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.
|
|
1810
|
+
GanttTableComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: GanttTableComponent, deps: [{ token: GANTT_ABSTRACT_TOKEN }, { token: GANTT_UPPER_TOKEN }, { token: i0__namespace.ElementRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
1811
|
+
GanttTableComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.1.5", 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 } });
|
|
1812
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: GanttTableComponent, decorators: [{
|
|
1735
1813
|
type: i0.Component,
|
|
1736
1814
|
args: [{
|
|
1737
1815
|
selector: 'gantt-table',
|
|
@@ -1741,6 +1819,9 @@
|
|
|
1741
1819
|
return [{ type: undefined, decorators: [{
|
|
1742
1820
|
type: i0.Inject,
|
|
1743
1821
|
args: [GANTT_ABSTRACT_TOKEN]
|
|
1822
|
+
}] }, { type: GanttUpper, decorators: [{
|
|
1823
|
+
type: i0.Inject,
|
|
1824
|
+
args: [GANTT_UPPER_TOKEN]
|
|
1744
1825
|
}] }, { type: i0__namespace.ElementRef }];
|
|
1745
1826
|
}, propDecorators: { groups: [{
|
|
1746
1827
|
type: i0.Input
|
|
@@ -1756,6 +1837,8 @@
|
|
|
1756
1837
|
type: i0.Input
|
|
1757
1838
|
}], rowAfterTemplate: [{
|
|
1758
1839
|
type: i0.Input
|
|
1840
|
+
}], itemClick: [{
|
|
1841
|
+
type: i0.Output
|
|
1759
1842
|
}], draglineElementRef: [{
|
|
1760
1843
|
type: i0.ViewChild,
|
|
1761
1844
|
args: ['dragLine', { static: true }]
|
|
@@ -1863,70 +1946,86 @@
|
|
|
1863
1946
|
};
|
|
1864
1947
|
return GanttDomService;
|
|
1865
1948
|
}());
|
|
1866
|
-
GanttDomService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.
|
|
1867
|
-
GanttDomService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.1.
|
|
1868
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.
|
|
1949
|
+
GanttDomService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: GanttDomService, deps: [], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
1950
|
+
GanttDomService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: GanttDomService });
|
|
1951
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: GanttDomService, decorators: [{
|
|
1869
1952
|
type: i0.Injectable
|
|
1870
1953
|
}], ctorParameters: function () { return []; } });
|
|
1871
1954
|
|
|
1955
|
+
function getDependencyType(path, dependencyTypes) {
|
|
1956
|
+
if (dependencyTypes.includes(exports.GanttLinkType.ss) && path.from.pos === InBarPosition.start && path.to.pos === InBarPosition.start) {
|
|
1957
|
+
return exports.GanttLinkType.ss;
|
|
1958
|
+
}
|
|
1959
|
+
if (dependencyTypes.includes(exports.GanttLinkType.ff) && path.from.pos === InBarPosition.finish && path.to.pos === InBarPosition.finish) {
|
|
1960
|
+
return exports.GanttLinkType.ff;
|
|
1961
|
+
}
|
|
1962
|
+
if (dependencyTypes.includes(exports.GanttLinkType.sf) && path.from.pos === InBarPosition.start && path.to.pos === InBarPosition.finish) {
|
|
1963
|
+
return exports.GanttLinkType.sf;
|
|
1964
|
+
}
|
|
1965
|
+
return exports.GanttLinkType.fs;
|
|
1966
|
+
}
|
|
1967
|
+
var InBarPosition;
|
|
1968
|
+
(function (InBarPosition) {
|
|
1969
|
+
InBarPosition["start"] = "start";
|
|
1970
|
+
InBarPosition["finish"] = "finish";
|
|
1971
|
+
})(InBarPosition || (InBarPosition = {}));
|
|
1872
1972
|
var GanttDragContainer = /** @class */ (function () {
|
|
1873
|
-
function GanttDragContainer() {
|
|
1973
|
+
function GanttDragContainer(ganttUpper) {
|
|
1974
|
+
this.ganttUpper = ganttUpper;
|
|
1874
1975
|
this.dragStarted = new i0.EventEmitter();
|
|
1875
1976
|
this.dragMoved = new i0.EventEmitter();
|
|
1876
1977
|
this.dragEnded = new i0.EventEmitter();
|
|
1877
1978
|
this.linkDragStarted = new i0.EventEmitter();
|
|
1878
1979
|
this.linkDragEntered = new i0.EventEmitter();
|
|
1879
1980
|
this.linkDragEnded = new i0.EventEmitter();
|
|
1981
|
+
this.linkDragPath = { from: null, to: null };
|
|
1880
1982
|
}
|
|
1881
|
-
GanttDragContainer.prototype.emitLinkDragStarted = function (from
|
|
1882
|
-
this.linkDraggingId = item.id;
|
|
1883
|
-
this.
|
|
1884
|
-
this.linkDragSource = this.linkDragFrom === 'source' ? item : null;
|
|
1885
|
-
this.linkDragTarget = this.linkDragFrom === 'target' ? item : null;
|
|
1983
|
+
GanttDragContainer.prototype.emitLinkDragStarted = function (from) {
|
|
1984
|
+
this.linkDraggingId = from.item.id;
|
|
1985
|
+
this.linkDragPath.from = from;
|
|
1886
1986
|
this.linkDragStarted.emit({
|
|
1887
|
-
source:
|
|
1888
|
-
target:
|
|
1987
|
+
source: from.item.origin,
|
|
1988
|
+
target: null
|
|
1889
1989
|
});
|
|
1890
1990
|
};
|
|
1891
|
-
GanttDragContainer.prototype.emitLinkDragEntered = function (
|
|
1892
|
-
|
|
1893
|
-
this.linkDragTarget = item;
|
|
1894
|
-
}
|
|
1895
|
-
else {
|
|
1896
|
-
this.linkDragSource = item;
|
|
1897
|
-
}
|
|
1991
|
+
GanttDragContainer.prototype.emitLinkDragEntered = function (to) {
|
|
1992
|
+
this.linkDragPath.to = to;
|
|
1898
1993
|
this.linkDragEntered.emit({
|
|
1899
|
-
source: this.
|
|
1900
|
-
target:
|
|
1994
|
+
source: this.linkDragPath.from.item.origin,
|
|
1995
|
+
target: to.item.origin
|
|
1901
1996
|
});
|
|
1902
1997
|
};
|
|
1903
1998
|
GanttDragContainer.prototype.emitLinkDragLeaved = function () {
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1999
|
+
this.linkDragPath.to = null;
|
|
2000
|
+
};
|
|
2001
|
+
GanttDragContainer.prototype.emitLinkDragEnded = function (to) {
|
|
2002
|
+
var _a;
|
|
2003
|
+
this.linkDragPath.to = to;
|
|
2004
|
+
var dependencyType = getDependencyType(this.linkDragPath, (_a = this.ganttUpper.linkOptions) === null || _a === void 0 ? void 0 : _a.dependencyTypes);
|
|
2005
|
+
this.linkDragPath.from.item.addLink({
|
|
2006
|
+
link: this.linkDragPath.to.item.id,
|
|
2007
|
+
type: dependencyType
|
|
2008
|
+
});
|
|
2009
|
+
this.linkDragEnded.emit({
|
|
2010
|
+
source: this.linkDragPath.from.item.origin,
|
|
2011
|
+
target: this.linkDragPath.to.item.origin,
|
|
2012
|
+
type: dependencyType
|
|
2013
|
+
});
|
|
1912
2014
|
this.linkDraggingId = null;
|
|
1913
|
-
|
|
1914
|
-
this.linkDragSource.addLink(this.linkDragTarget.id);
|
|
1915
|
-
this.linkDragEnded.emit({
|
|
1916
|
-
source: this.linkDragSource.origin,
|
|
1917
|
-
target: this.linkDragTarget.origin
|
|
1918
|
-
});
|
|
1919
|
-
}
|
|
1920
|
-
this.linkDragSource = null;
|
|
1921
|
-
this.linkDragTarget = null;
|
|
2015
|
+
this.linkDragPath = { from: null, to: null };
|
|
1922
2016
|
};
|
|
1923
2017
|
return GanttDragContainer;
|
|
1924
2018
|
}());
|
|
1925
|
-
GanttDragContainer.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.
|
|
1926
|
-
GanttDragContainer.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.1.
|
|
1927
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.
|
|
2019
|
+
GanttDragContainer.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: GanttDragContainer, deps: [{ token: GANTT_UPPER_TOKEN }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
2020
|
+
GanttDragContainer.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: GanttDragContainer });
|
|
2021
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: GanttDragContainer, decorators: [{
|
|
1928
2022
|
type: i0.Injectable
|
|
1929
|
-
}], ctorParameters: function () {
|
|
2023
|
+
}], ctorParameters: function () {
|
|
2024
|
+
return [{ type: GanttUpper, decorators: [{
|
|
2025
|
+
type: i0.Inject,
|
|
2026
|
+
args: [GANTT_UPPER_TOKEN]
|
|
2027
|
+
}] }];
|
|
2028
|
+
} });
|
|
1930
2029
|
|
|
1931
2030
|
var GanttPrintService = /** @class */ (function () {
|
|
1932
2031
|
function GanttPrintService() {
|
|
@@ -2005,7 +2104,7 @@
|
|
|
2005
2104
|
var printWidth = root.offsetWidth;
|
|
2006
2105
|
// set print height
|
|
2007
2106
|
var printHeight = root.offsetHeight - mainContainer.offsetHeight + mainContainer.scrollHeight;
|
|
2008
|
-
html2canvas__default[
|
|
2107
|
+
html2canvas__default["default"](root, {
|
|
2009
2108
|
logging: false,
|
|
2010
2109
|
allowTaint: true,
|
|
2011
2110
|
useCORS: true,
|
|
@@ -2049,9 +2148,9 @@
|
|
|
2049
2148
|
};
|
|
2050
2149
|
return GanttPrintService;
|
|
2051
2150
|
}());
|
|
2052
|
-
GanttPrintService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.
|
|
2053
|
-
GanttPrintService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.1.
|
|
2054
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.
|
|
2151
|
+
GanttPrintService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: GanttPrintService, deps: [], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
2152
|
+
GanttPrintService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: GanttPrintService });
|
|
2153
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: GanttPrintService, decorators: [{
|
|
2055
2154
|
type: i0.Injectable
|
|
2056
2155
|
}], ctorParameters: function () { return []; } });
|
|
2057
2156
|
|
|
@@ -2120,9 +2219,9 @@
|
|
|
2120
2219
|
};
|
|
2121
2220
|
return GanttCalendarComponent;
|
|
2122
2221
|
}());
|
|
2123
|
-
GanttCalendarComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.
|
|
2124
|
-
GanttCalendarComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.1.
|
|
2125
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.
|
|
2222
|
+
GanttCalendarComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: GanttCalendarComponent, deps: [{ token: GANTT_UPPER_TOKEN }, { token: i0__namespace.NgZone }, { token: i0__namespace.ElementRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
2223
|
+
GanttCalendarComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.1.5", type: GanttCalendarComponent, selector: "gantt-calendar-overlay", host: { properties: { "class.gantt-calendar-overlay": "this.className" } }, usesOnChanges: true, ngImport: i0__namespace, template: "<div class=\"gantt-calendar-today-overlay\" [style.width.px]=\"view.width\">\n <span class=\"today-rect\" [hidden]=\"ganttUpper.viewType !== viewTypes.day\"> </span>\n <span class=\"today-line\" *ngIf=\"ganttUpper.showTodayLine\"> </span>\n</div>\n\n<svg class=\"gantt-calendar-overlay-main\" [attr.width]=\"view.width\" [attr.height]=\"headerHeight\">\n <g>\n <text class=\"primary-text\" *ngFor=\"let point of view.primaryDatePoints; trackBy: trackBy\" [attr.x]=\"point.x\" [attr.y]=\"point.y\">\n {{ point.text }}\n </text>\n <ng-container *ngFor=\"let point of view.secondaryDatePoints; trackBy: trackBy\">\n <text class=\"secondary-text\" [class.secondary-text-weekend]=\"point.additions?.isWeekend\" [attr.x]=\"point.x\" [attr.y]=\"point.y\">\n {{ point.text }}\n </text>\n </ng-container>\n\n <g>\n <line\n *ngFor=\"let point of view.primaryDatePoints; let i = index; trackBy: trackBy\"\n [attr.x1]=\"(i + 1) * view.primaryWidth\"\n [attr.x2]=\"(i + 1) * view.primaryWidth\"\n [attr.y1]=\"0\"\n [attr.y2]=\"mainHeight\"\n class=\"primary-line\"\n ></line>\n </g>\n\n <g>\n <line [attr.x1]=\"0\" [attr.x2]=\"view.width\" [attr.y1]=\"headerHeight\" [attr.y2]=\"headerHeight\" class=\"header-line\"></line>\n </g>\n </g>\n <g>\n <g *ngIf=\"view.showTimeline\">\n <line\n *ngFor=\"let point of view.secondaryDatePoints; let i = index; trackBy: trackBy\"\n [attr.x1]=\"(i + 1) * view.cellWidth\"\n [attr.x2]=\"(i + 1) * view.cellWidth\"\n [attr.y1]=\"headerHeight\"\n [attr.y2]=\"mainHeight\"\n class=\"secondary-line\"\n ></line>\n <line\n *ngFor=\"let point of view.primaryDatePoints; let i = index; trackBy: trackBy\"\n [attr.x1]=\"(i + 1) * view.primaryWidth\"\n [attr.x2]=\"(i + 1) * view.primaryWidth\"\n [attr.y1]=\"0\"\n [attr.y2]=\"mainHeight\"\n class=\"primary-line\"\n ></line>\n </g>\n </g>\n</svg>\n", directives: [{ type: i2__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
|
|
2224
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: GanttCalendarComponent, decorators: [{
|
|
2126
2225
|
type: i0.Component,
|
|
2127
2226
|
args: [{
|
|
2128
2227
|
selector: 'gantt-calendar-overlay',
|
|
@@ -2145,9 +2244,9 @@
|
|
|
2145
2244
|
GanttDragBackdropComponent.prototype.ngOnInit = function () { };
|
|
2146
2245
|
return GanttDragBackdropComponent;
|
|
2147
2246
|
}());
|
|
2148
|
-
GanttDragBackdropComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.
|
|
2149
|
-
GanttDragBackdropComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.1.
|
|
2150
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.
|
|
2247
|
+
GanttDragBackdropComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: GanttDragBackdropComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
2248
|
+
GanttDragBackdropComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.1.5", type: GanttDragBackdropComponent, selector: "gantt-drag-backdrop", host: { properties: { "class.gantt-drag-backdrop": "this.backdropClass" } }, ngImport: i0__namespace, template: "<div class=\"gantt-drag-mask\">\n <div class=\"date-range\">\n <span class=\"start\"></span>\n <span class=\"end\"></span>\n </div>\n</div>\n" });
|
|
2249
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: GanttDragBackdropComponent, decorators: [{
|
|
2151
2250
|
type: i0.Component,
|
|
2152
2251
|
args: [{
|
|
2153
2252
|
selector: 'gantt-drag-backdrop',
|
|
@@ -2248,9 +2347,9 @@
|
|
|
2248
2347
|
};
|
|
2249
2348
|
return NgxGanttRootComponent;
|
|
2250
2349
|
}());
|
|
2251
|
-
NgxGanttRootComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.
|
|
2252
|
-
NgxGanttRootComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.1.
|
|
2253
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.
|
|
2350
|
+
NgxGanttRootComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: NgxGanttRootComponent, deps: [{ token: i0__namespace.ElementRef }, { token: i0__namespace.NgZone }, { token: GanttDomService }, { token: GanttDragContainer }, { token: GANTT_UPPER_TOKEN }, { token: GanttPrintService, optional: true }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
2351
|
+
NgxGanttRootComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.1.5", type: NgxGanttRootComponent, selector: "ngx-gantt-root", inputs: { sideWidth: "sideWidth" }, host: { properties: { "class.gantt": "this.ganttClass" } }, providers: [GanttDomService, GanttDragContainer], queries: [{ propertyName: "sideTemplate", first: true, predicate: ["sideTemplate"], descendants: true, static: true }, { propertyName: "mainTemplate", first: true, predicate: ["mainTemplate"], descendants: true, static: true }], ngImport: i0__namespace, template: "<div class=\"gantt-side\" [style.width.px]=\"sideWidth\">\n <div class=\"gantt-side-container\">\n <ng-template [ngTemplateOutlet]=\"sideTemplate\"></ng-template>\n </div>\n</div>\n<div class=\"gantt-container\">\n <gantt-calendar-overlay></gantt-calendar-overlay>\n <gantt-drag-backdrop></gantt-drag-backdrop>\n <div class=\"gantt-main\">\n <ng-template [ngTemplateOutlet]=\"mainTemplate\"></ng-template>\n </div>\n</div>\n", components: [{ type: GanttCalendarComponent, selector: "gantt-calendar-overlay" }, { type: GanttDragBackdropComponent, selector: "gantt-drag-backdrop" }], directives: [{ type: i2__namespace.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }] });
|
|
2352
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: NgxGanttRootComponent, decorators: [{
|
|
2254
2353
|
type: i0.Component,
|
|
2255
2354
|
args: [{
|
|
2256
2355
|
selector: 'ngx-gantt-root',
|
|
@@ -2277,6 +2376,165 @@
|
|
|
2277
2376
|
args: ['mainTemplate', { static: true }]
|
|
2278
2377
|
}] } });
|
|
2279
2378
|
|
|
2379
|
+
var GanttLinkLine = /** @class */ (function () {
|
|
2380
|
+
function GanttLinkLine() {
|
|
2381
|
+
}
|
|
2382
|
+
GanttLinkLine.prototype.generatePath = function (source, target, type) {
|
|
2383
|
+
if (source.before && source.after && target.before && target.after) {
|
|
2384
|
+
var path = '';
|
|
2385
|
+
switch (type) {
|
|
2386
|
+
case exports.GanttLinkType.ss:
|
|
2387
|
+
path = this.generateSSPath(source, target);
|
|
2388
|
+
break;
|
|
2389
|
+
case exports.GanttLinkType.ff:
|
|
2390
|
+
path = this.generateFFPath(source, target);
|
|
2391
|
+
break;
|
|
2392
|
+
case exports.GanttLinkType.sf:
|
|
2393
|
+
path = this.generateFSAndSFPath(source, target, type);
|
|
2394
|
+
break;
|
|
2395
|
+
default:
|
|
2396
|
+
path = this.generateFSAndSFPath(source, target);
|
|
2397
|
+
}
|
|
2398
|
+
return path;
|
|
2399
|
+
}
|
|
2400
|
+
};
|
|
2401
|
+
return GanttLinkLine;
|
|
2402
|
+
}());
|
|
2403
|
+
|
|
2404
|
+
var GanttLinkLineCurve = /** @class */ (function (_super) {
|
|
2405
|
+
__extends(GanttLinkLineCurve, _super);
|
|
2406
|
+
function GanttLinkLineCurve(ganttUpper) {
|
|
2407
|
+
var _this = _super.call(this) || this;
|
|
2408
|
+
_this.ganttUpper = ganttUpper;
|
|
2409
|
+
return _this;
|
|
2410
|
+
}
|
|
2411
|
+
GanttLinkLineCurve.prototype.generateSSPath = function (source, target) {
|
|
2412
|
+
var x1 = source.before.x;
|
|
2413
|
+
var y1 = source.before.y;
|
|
2414
|
+
var x4 = target.before.x;
|
|
2415
|
+
var y4 = target.before.y;
|
|
2416
|
+
var isMirror = y4 > y1 ? 0 : 1;
|
|
2417
|
+
var radius = Math.abs(y4 - y1) / 2;
|
|
2418
|
+
if (x4 > x1) {
|
|
2419
|
+
return "M " + x1 + " " + y1 + "\n A " + radius + " " + radius + " 0 1 " + isMirror + " " + x1 + " " + y4 + "\n L " + x4 + " " + y4;
|
|
2420
|
+
}
|
|
2421
|
+
else {
|
|
2422
|
+
return "M " + x1 + " " + y1 + "\n L " + x4 + " " + y1 + "\n A " + radius + " " + radius + " 0 1 " + isMirror + " " + x4 + " " + y4;
|
|
2423
|
+
}
|
|
2424
|
+
};
|
|
2425
|
+
GanttLinkLineCurve.prototype.generateFFPath = function (source, target) {
|
|
2426
|
+
var x1 = source.after.x;
|
|
2427
|
+
var y1 = source.after.y;
|
|
2428
|
+
var x4 = target.after.x;
|
|
2429
|
+
var y4 = target.after.y;
|
|
2430
|
+
var isMirror = y4 > y1 ? 1 : 0;
|
|
2431
|
+
var radius = Math.abs(y4 - y1) / 2;
|
|
2432
|
+
if (x4 > x1) {
|
|
2433
|
+
return "M " + x1 + " " + y1 + "\n L " + x4 + " " + y1 + "\n A " + radius + " " + radius + " 0 1 " + isMirror + " " + x4 + " " + y4;
|
|
2434
|
+
}
|
|
2435
|
+
else {
|
|
2436
|
+
return "M " + x1 + " " + y1 + "\n A " + radius + " " + radius + " 0 1 " + isMirror + " " + x1 + " " + y4 + "\n L " + x4 + " " + y4;
|
|
2437
|
+
}
|
|
2438
|
+
};
|
|
2439
|
+
GanttLinkLineCurve.prototype.generateFSAndSFPath = function (source, target, type) {
|
|
2440
|
+
var _a;
|
|
2441
|
+
var x1 = source.after.x;
|
|
2442
|
+
var y1 = source.after.y;
|
|
2443
|
+
var x4 = target.before.x;
|
|
2444
|
+
var y4 = target.before.y;
|
|
2445
|
+
var bezierWeight = 0.5;
|
|
2446
|
+
if (type === exports.GanttLinkType.sf) {
|
|
2447
|
+
x1 = target.after.x;
|
|
2448
|
+
y1 = target.after.y;
|
|
2449
|
+
x4 = source.before.x;
|
|
2450
|
+
y4 = source.before.y;
|
|
2451
|
+
}
|
|
2452
|
+
var dx = Math.abs(x4 - x1) * bezierWeight;
|
|
2453
|
+
var x2 = x1 + dx;
|
|
2454
|
+
var x3 = x4 - dx;
|
|
2455
|
+
var centerX = (x1 + x4) / 2;
|
|
2456
|
+
var centerY = (y1 + y4) / 2;
|
|
2457
|
+
var controlX = this.ganttUpper.styles.lineHeight / 2;
|
|
2458
|
+
var controlY = this.ganttUpper.styles.lineHeight / 2;
|
|
2459
|
+
if (x1 >= x4) {
|
|
2460
|
+
if (Math.abs(y4 - y1) <= this.ganttUpper.styles.lineHeight) {
|
|
2461
|
+
return "M " + x1 + " " + y1 + "\n C " + (x1 + controlX) + " " + y1 + " " + (x1 + controlX) + " " + (y4 > y1 ? y1 + controlX : y1 - controlX) + " " + x1 + " " + (y4 > y1 ? y1 + controlY : y1 - controlY) + "\n L " + x4 + " " + (y4 > y1 ? y4 - controlY : y4 + controlY) + "\n C " + (x4 - controlY) + " " + (y4 > y1 ? y4 - controlY : y4 + controlY) + " " + (x4 - controlX) + " " + y4 + " " + x4 + " " + y4 + "\n ";
|
|
2462
|
+
}
|
|
2463
|
+
else {
|
|
2464
|
+
controlX = this.ganttUpper.styles.lineHeight;
|
|
2465
|
+
return "M " + x1 + " " + y1 + "\n C " + (x1 + controlX) + " " + y1 + " " + (x1 + controlX) + " " + (y4 > y1 ? y1 + controlX : y1 - controlX) + " " + centerX + " " + centerY + "\n C " + (x4 - controlX) + " " + (y4 > y1 ? y4 - controlX : y4 + controlX) + " " + (x4 - controlX) + " " + y4 + " " + x4 + " " + y4 + "\n ";
|
|
2466
|
+
}
|
|
2467
|
+
}
|
|
2468
|
+
else if (((_a = this.ganttUpper.linkOptions) === null || _a === void 0 ? void 0 : _a.showArrow) && x4 - x1 < 200) {
|
|
2469
|
+
dx = Math.max(Math.abs(y4 - y1) * bezierWeight, 60);
|
|
2470
|
+
x2 = x1 + dx;
|
|
2471
|
+
x3 = x4 - dx;
|
|
2472
|
+
return "M " + x1 + " " + y1 + " C " + x2 + " " + y1 + " " + x3 + " " + y4 + " " + x4 + " " + y4;
|
|
2473
|
+
}
|
|
2474
|
+
return "M " + x1 + " " + y1 + " C " + x2 + " " + y1 + " " + x3 + " " + y4 + " " + x4 + " " + y4;
|
|
2475
|
+
};
|
|
2476
|
+
return GanttLinkLineCurve;
|
|
2477
|
+
}(GanttLinkLine));
|
|
2478
|
+
GanttLinkLineCurve = __decorate([
|
|
2479
|
+
__param(0, i0.Inject(GANTT_UPPER_TOKEN))
|
|
2480
|
+
], GanttLinkLineCurve);
|
|
2481
|
+
|
|
2482
|
+
var GanttLinkLineStraight = /** @class */ (function (_super) {
|
|
2483
|
+
__extends(GanttLinkLineStraight, _super);
|
|
2484
|
+
function GanttLinkLineStraight() {
|
|
2485
|
+
var _this = _super.call(this) || this;
|
|
2486
|
+
_this.pathControl = 20;
|
|
2487
|
+
return _this;
|
|
2488
|
+
}
|
|
2489
|
+
GanttLinkLineStraight.prototype.generateSSPath = function (source, target) {
|
|
2490
|
+
var x1 = source.before.x;
|
|
2491
|
+
var y1 = source.before.y;
|
|
2492
|
+
var x4 = target.before.x;
|
|
2493
|
+
var y4 = target.before.y;
|
|
2494
|
+
var control = this.pathControl;
|
|
2495
|
+
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;
|
|
2496
|
+
};
|
|
2497
|
+
GanttLinkLineStraight.prototype.generateFFPath = function (source, target) {
|
|
2498
|
+
var x1 = source.after.x;
|
|
2499
|
+
var y1 = source.after.y;
|
|
2500
|
+
var x4 = target.after.x;
|
|
2501
|
+
var y4 = target.after.y;
|
|
2502
|
+
var control = this.pathControl;
|
|
2503
|
+
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;
|
|
2504
|
+
};
|
|
2505
|
+
GanttLinkLineStraight.prototype.generateFSAndSFPath = function (source, target, type) {
|
|
2506
|
+
var x1 = source.after.x;
|
|
2507
|
+
var y1 = source.after.y;
|
|
2508
|
+
var x4 = target.before.x;
|
|
2509
|
+
var y4 = target.before.y;
|
|
2510
|
+
var control = this.pathControl;
|
|
2511
|
+
if (type === exports.GanttLinkType.sf) {
|
|
2512
|
+
x1 = target.after.x;
|
|
2513
|
+
y1 = target.after.y;
|
|
2514
|
+
x4 = source.before.x;
|
|
2515
|
+
y4 = source.before.y;
|
|
2516
|
+
}
|
|
2517
|
+
if (x4 - x1 >= 40) {
|
|
2518
|
+
return "M " + x1 + " " + y1 + "\n L " + (x1 + control) + " " + y1 + "\n L " + (x1 + control) + " " + y4 + "\n L " + x4 + " " + y4;
|
|
2519
|
+
}
|
|
2520
|
+
else {
|
|
2521
|
+
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;
|
|
2522
|
+
}
|
|
2523
|
+
};
|
|
2524
|
+
return GanttLinkLineStraight;
|
|
2525
|
+
}(GanttLinkLine));
|
|
2526
|
+
|
|
2527
|
+
function createLineGenerator(type, ganttUpper) {
|
|
2528
|
+
switch (type) {
|
|
2529
|
+
case exports.GanttLinkLineType.curve:
|
|
2530
|
+
return new GanttLinkLineCurve(ganttUpper);
|
|
2531
|
+
case exports.GanttLinkLineType.straight:
|
|
2532
|
+
return new GanttLinkLineStraight();
|
|
2533
|
+
default:
|
|
2534
|
+
throw new Error('gantt link path type invalid');
|
|
2535
|
+
}
|
|
2536
|
+
}
|
|
2537
|
+
|
|
2280
2538
|
var GanttLinksComponent = /** @class */ (function () {
|
|
2281
2539
|
function GanttLinksComponent(ganttUpper, cdr, elementRef, ganttDragContainer) {
|
|
2282
2540
|
this.ganttUpper = ganttUpper;
|
|
@@ -2287,21 +2545,24 @@
|
|
|
2287
2545
|
this.items = [];
|
|
2288
2546
|
this.lineClick = new i0.EventEmitter();
|
|
2289
2547
|
this.links = [];
|
|
2548
|
+
this.ganttLinkTypes = exports.GanttLinkType;
|
|
2549
|
+
this.showArrow = false;
|
|
2290
2550
|
this.linkItems = [];
|
|
2291
|
-
this.bezierWeight = -0.5;
|
|
2292
2551
|
this.firstChange = true;
|
|
2293
2552
|
this.unsubscribe$ = new rxjs.Subject();
|
|
2294
2553
|
this.ganttLinksOverlay = true;
|
|
2295
2554
|
}
|
|
2296
2555
|
GanttLinksComponent.prototype.ngOnInit = function () {
|
|
2297
2556
|
var _this = this;
|
|
2557
|
+
this.linkLine = createLineGenerator(this.ganttUpper.linkOptions.lineType, this.ganttUpper);
|
|
2558
|
+
this.showArrow = this.ganttUpper.linkOptions.showArrow;
|
|
2298
2559
|
this.buildLinks();
|
|
2299
2560
|
this.firstChange = false;
|
|
2300
2561
|
this.ganttDragContainer.dragStarted.pipe(operators.takeUntil(this.unsubscribe$)).subscribe(function () {
|
|
2301
2562
|
_this.elementRef.nativeElement.style.visibility = 'hidden';
|
|
2302
2563
|
});
|
|
2303
2564
|
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))
|
|
2565
|
+
.pipe(operators.takeUntil(this.unsubscribe$), operators.skip(1), operators.debounceTime(0))
|
|
2305
2566
|
.subscribe(function () {
|
|
2306
2567
|
_this.elementRef.nativeElement.style.visibility = 'visible';
|
|
2307
2568
|
_this.buildLinks();
|
|
@@ -2353,75 +2614,6 @@
|
|
|
2353
2614
|
});
|
|
2354
2615
|
}
|
|
2355
2616
|
};
|
|
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
2617
|
GanttLinksComponent.prototype.buildLinks = function () {
|
|
2426
2618
|
var _this = this;
|
|
2427
2619
|
this.computeItemPosition();
|
|
@@ -2431,12 +2623,30 @@
|
|
|
2431
2623
|
source.links.forEach(function (link) {
|
|
2432
2624
|
var target = _this.linkItems.find(function (item) { return item.id === link.link; });
|
|
2433
2625
|
if (target && (target.origin.start || target.origin.end)) {
|
|
2626
|
+
var defaultColor = exports.LinkColors.default;
|
|
2627
|
+
var activeColor = exports.LinkColors.active;
|
|
2628
|
+
if (link.type === exports.GanttLinkType.fs && source.end.getTime() > target.start.getTime()) {
|
|
2629
|
+
defaultColor = exports.LinkColors.blocked;
|
|
2630
|
+
activeColor = exports.LinkColors.blocked;
|
|
2631
|
+
}
|
|
2632
|
+
if (link.color) {
|
|
2633
|
+
if (typeof link.color === 'string') {
|
|
2634
|
+
defaultColor = link.color;
|
|
2635
|
+
activeColor = link.color;
|
|
2636
|
+
}
|
|
2637
|
+
else {
|
|
2638
|
+
defaultColor = link.color.default;
|
|
2639
|
+
activeColor = link.color.active;
|
|
2640
|
+
}
|
|
2641
|
+
}
|
|
2434
2642
|
_this.links.push({
|
|
2435
|
-
path: _this.generatePath(source, target, link.type),
|
|
2643
|
+
path: _this.linkLine.generatePath(source, target, link.type),
|
|
2436
2644
|
source: source.origin,
|
|
2437
2645
|
target: target.origin,
|
|
2438
2646
|
type: link.type,
|
|
2439
|
-
color:
|
|
2647
|
+
color: defaultColor,
|
|
2648
|
+
defaultColor: defaultColor,
|
|
2649
|
+
activeColor: activeColor
|
|
2440
2650
|
});
|
|
2441
2651
|
}
|
|
2442
2652
|
});
|
|
@@ -2453,15 +2663,15 @@
|
|
|
2453
2663
|
target: link.target
|
|
2454
2664
|
});
|
|
2455
2665
|
};
|
|
2456
|
-
GanttLinksComponent.prototype.mouseEnterPath = function (link) {
|
|
2457
|
-
|
|
2458
|
-
|
|
2666
|
+
GanttLinksComponent.prototype.mouseEnterPath = function (link, index) {
|
|
2667
|
+
link.color = link.activeColor || link.defaultColor;
|
|
2668
|
+
if (index < this.links.length - 1) {
|
|
2669
|
+
this.links.splice(index, 1);
|
|
2670
|
+
this.links.push(link);
|
|
2459
2671
|
}
|
|
2460
2672
|
};
|
|
2461
2673
|
GanttLinksComponent.prototype.mouseLeavePath = function (link) {
|
|
2462
|
-
|
|
2463
|
-
link.color = LinkColors.default;
|
|
2464
|
-
}
|
|
2674
|
+
link.color = link.defaultColor;
|
|
2465
2675
|
};
|
|
2466
2676
|
GanttLinksComponent.prototype.ngOnDestroy = function () {
|
|
2467
2677
|
this.unsubscribe$.next();
|
|
@@ -2469,9 +2679,9 @@
|
|
|
2469
2679
|
};
|
|
2470
2680
|
return GanttLinksComponent;
|
|
2471
2681
|
}());
|
|
2472
|
-
GanttLinksComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.
|
|
2473
|
-
GanttLinksComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.1.
|
|
2474
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.
|
|
2682
|
+
GanttLinksComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.5", 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 });
|
|
2683
|
+
GanttLinksComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.1.5", 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\n <g>\n <path\n class=\"link-line\"\n (click)=\"onLineClick($event, link)\"\n [attr.d]=\"link.path\"\n (mouseenter)=\"mouseEnterPath(link, i)\"\n (mouseleave)=\"mouseLeavePath(link)\"\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"] }] });
|
|
2684
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: GanttLinksComponent, decorators: [{
|
|
2475
2685
|
type: i0.Component,
|
|
2476
2686
|
args: [{
|
|
2477
2687
|
selector: 'gantt-links-overlay',
|
|
@@ -2532,9 +2742,9 @@
|
|
|
2532
2742
|
};
|
|
2533
2743
|
return GanttItemUpper;
|
|
2534
2744
|
}());
|
|
2535
|
-
GanttItemUpper.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.
|
|
2536
|
-
GanttItemUpper.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.1.
|
|
2537
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.
|
|
2745
|
+
GanttItemUpper.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: GanttItemUpper, deps: [{ token: i0__namespace.ElementRef }, { token: GANTT_UPPER_TOKEN }], target: i0__namespace.ɵɵFactoryTarget.Directive });
|
|
2746
|
+
GanttItemUpper.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.1.5", type: GanttItemUpper, inputs: { template: "template", item: "item" }, ngImport: i0__namespace });
|
|
2747
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: GanttItemUpper, decorators: [{
|
|
2538
2748
|
type: i0.Directive
|
|
2539
2749
|
}], ctorParameters: function () {
|
|
2540
2750
|
return [{ type: i0__namespace.ElementRef }, { type: GanttUpper, decorators: [{
|
|
@@ -2565,9 +2775,9 @@
|
|
|
2565
2775
|
};
|
|
2566
2776
|
return NgxGanttRangeComponent;
|
|
2567
2777
|
}(GanttItemUpper));
|
|
2568
|
-
NgxGanttRangeComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.
|
|
2569
|
-
NgxGanttRangeComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.1.
|
|
2570
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.
|
|
2778
|
+
NgxGanttRangeComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: NgxGanttRangeComponent, deps: [{ token: i0__namespace.ElementRef }, { token: GANTT_UPPER_TOKEN }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
2779
|
+
NgxGanttRangeComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.1.5", type: NgxGanttRangeComponent, selector: "ngx-gantt-range,gantt-range", host: { properties: { "class.gantt-range": "this.ganttRangeClass" } }, usesInheritance: true, usesOnChanges: true, ngImport: i0__namespace, template: "<ng-container *ngIf=\"item.start && item.end\">\n <div class=\"gantt-range-main\">\n <div class=\"gantt-range-main-progress\" *ngIf=\"item.progress >= 0\" [style.width.%]=\"item.progress * 100\"></div>\n </div>\n <div class=\"gantt-range-triangle left\"></div>\n <div class=\"gantt-range-triangle right\"></div>\n <ng-template [ngTemplateOutlet]=\"template\" [ngTemplateOutletContext]=\"{ item: item.origin, refs: item.refs }\"></ng-template>\n</ng-container>\n", directives: [{ type: i2__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2__namespace.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }] });
|
|
2780
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: NgxGanttRangeComponent, decorators: [{
|
|
2571
2781
|
type: i0.Component,
|
|
2572
2782
|
args: [{
|
|
2573
2783
|
selector: 'ngx-gantt-range,gantt-range',
|
|
@@ -2585,7 +2795,8 @@
|
|
|
2585
2795
|
|
|
2586
2796
|
var dragMinWidth = 10;
|
|
2587
2797
|
var activeClass = 'gantt-bar-active';
|
|
2588
|
-
var
|
|
2798
|
+
var dropActiveClass = 'gantt-bar-drop-active';
|
|
2799
|
+
var singleDropActiveClass = 'gantt-bar-single-drop-active';
|
|
2589
2800
|
function createSvgElement(qualifiedName, className) {
|
|
2590
2801
|
var element = document.createElementNS('http://www.w3.org/2000/svg', qualifiedName);
|
|
2591
2802
|
element.classList.add(className);
|
|
@@ -2615,13 +2826,21 @@
|
|
|
2615
2826
|
});
|
|
2616
2827
|
GanttBarDrag.prototype.createMouseEvents = function () {
|
|
2617
2828
|
var _this = this;
|
|
2829
|
+
var _a, _b, _c;
|
|
2830
|
+
var dropClass = ((_b = (_a = this.ganttUpper.config.linkOptions) === null || _a === void 0 ? void 0 : _a.dependencyTypes) === null || _b === void 0 ? void 0 : _b.length) === 1 &&
|
|
2831
|
+
((_c = this.ganttUpper.config.linkOptions) === null || _c === void 0 ? void 0 : _c.dependencyTypes[0]) === exports.GanttLinkType.fs
|
|
2832
|
+
? singleDropActiveClass
|
|
2833
|
+
: dropActiveClass;
|
|
2618
2834
|
rxjs.fromEvent(this.barElement, 'mouseenter')
|
|
2619
2835
|
.pipe(operators.takeUntil(this.destroy$))
|
|
2620
|
-
.subscribe(function () {
|
|
2836
|
+
.subscribe(function (event) {
|
|
2621
2837
|
if (_this.dragContainer.linkDraggingId && _this.dragContainer.linkDraggingId !== _this.item.id) {
|
|
2622
2838
|
if (_this.item.linkable) {
|
|
2623
|
-
_this.barElement.classList.add(
|
|
2624
|
-
_this.dragContainer.emitLinkDragEntered(
|
|
2839
|
+
_this.barElement.classList.add(dropClass);
|
|
2840
|
+
_this.dragContainer.emitLinkDragEntered({
|
|
2841
|
+
item: _this.item,
|
|
2842
|
+
element: _this.barElement
|
|
2843
|
+
});
|
|
2625
2844
|
}
|
|
2626
2845
|
}
|
|
2627
2846
|
else {
|
|
@@ -2630,14 +2849,14 @@
|
|
|
2630
2849
|
});
|
|
2631
2850
|
rxjs.fromEvent(this.barElement, 'mouseleave')
|
|
2632
2851
|
.pipe(operators.takeUntil(this.destroy$))
|
|
2633
|
-
.subscribe(function () {
|
|
2852
|
+
.subscribe(function (event) {
|
|
2634
2853
|
if (!_this.dragContainer.linkDraggingId) {
|
|
2635
2854
|
_this.barElement.classList.remove(activeClass);
|
|
2636
2855
|
}
|
|
2637
2856
|
else {
|
|
2638
2857
|
_this.dragContainer.emitLinkDragLeaved();
|
|
2639
2858
|
}
|
|
2640
|
-
_this.barElement.classList.remove(
|
|
2859
|
+
_this.barElement.classList.remove(dropClass);
|
|
2641
2860
|
});
|
|
2642
2861
|
};
|
|
2643
2862
|
GanttBarDrag.prototype.createBarDrag = function () {
|
|
@@ -2649,19 +2868,22 @@
|
|
|
2649
2868
|
_this.dragContainer.dragStarted.emit({ item: _this.item.origin });
|
|
2650
2869
|
});
|
|
2651
2870
|
dragRef.moved.subscribe(function (event) {
|
|
2652
|
-
var
|
|
2653
|
-
var
|
|
2654
|
-
var
|
|
2655
|
-
var
|
|
2656
|
-
|
|
2871
|
+
var currentX = _this.item.refs.x + event.distance.x;
|
|
2872
|
+
var currentDate = _this.ganttUpper.view.getDateByXPoint(currentX);
|
|
2873
|
+
var currentStartX = _this.ganttUpper.view.getXPointByDate(currentDate);
|
|
2874
|
+
var dayWidth = _this.ganttUpper.view.getDayOccupancyWidth(currentDate);
|
|
2875
|
+
var diffDays = dateFns.differenceInCalendarDays(_this.item.end.value, _this.item.start.value);
|
|
2876
|
+
var start = currentDate;
|
|
2877
|
+
var end = currentDate.addDays(diffDays);
|
|
2878
|
+
if (currentX > currentStartX + dayWidth / 2) {
|
|
2879
|
+
start = start.addDays(1);
|
|
2880
|
+
end = end.addDays(1);
|
|
2881
|
+
}
|
|
2882
|
+
_this.openDragBackdrop(_this.barElement, start, end);
|
|
2657
2883
|
_this.item.updateDate(start, end);
|
|
2658
2884
|
_this.dragContainer.dragMoved.emit({ item: _this.item.origin });
|
|
2659
2885
|
});
|
|
2660
2886
|
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
2887
|
_this.clearDraggingStyles();
|
|
2666
2888
|
_this.closeDragBackdrop();
|
|
2667
2889
|
event.source.reset();
|
|
@@ -2737,7 +2959,7 @@
|
|
|
2737
2959
|
var dragRefs = [];
|
|
2738
2960
|
var handles = this.barElement.querySelectorAll('.link-handles .handle');
|
|
2739
2961
|
handles.forEach(function (handle, index) {
|
|
2740
|
-
var
|
|
2962
|
+
var isBegin = index === 0;
|
|
2741
2963
|
var dragRef = _this.dragDrop.createDrag(handle);
|
|
2742
2964
|
dragRef.withBoundaryElement(_this.dom.root);
|
|
2743
2965
|
dragRef.beforeStarted.subscribe(function () {
|
|
@@ -2746,24 +2968,35 @@
|
|
|
2746
2968
|
_this.barDragRef.disabled = true;
|
|
2747
2969
|
}
|
|
2748
2970
|
_this.createLinkDraggingLine();
|
|
2749
|
-
_this.dragContainer.emitLinkDragStarted(
|
|
2971
|
+
_this.dragContainer.emitLinkDragStarted({
|
|
2972
|
+
element: _this.barElement,
|
|
2973
|
+
item: _this.item,
|
|
2974
|
+
pos: isBegin ? InBarPosition.start : InBarPosition.finish
|
|
2975
|
+
});
|
|
2750
2976
|
});
|
|
2751
2977
|
dragRef.moved.subscribe(function () {
|
|
2752
|
-
var positions = _this.calcLinkLinePositions(handle,
|
|
2978
|
+
var positions = _this.calcLinkLinePositions(handle, isBegin);
|
|
2753
2979
|
_this.linkDraggingLine.setAttribute('x1', positions.x1.toString());
|
|
2754
2980
|
_this.linkDraggingLine.setAttribute('y1', positions.y1.toString());
|
|
2755
2981
|
_this.linkDraggingLine.setAttribute('x2', positions.x2.toString());
|
|
2756
2982
|
_this.linkDraggingLine.setAttribute('y2', positions.y2.toString());
|
|
2757
2983
|
});
|
|
2758
2984
|
dragRef.ended.subscribe(function (event) {
|
|
2759
|
-
event.source.reset();
|
|
2760
2985
|
handle.style.pointerEvents = '';
|
|
2761
2986
|
if (_this.barDragRef) {
|
|
2762
2987
|
_this.barDragRef.disabled = false;
|
|
2763
2988
|
}
|
|
2989
|
+
// 计算line拖动的落点位于目标Bar的值,如果值大于Bar宽度的一半,说明是拖动到Begin位置,否则则为拖动到End位置
|
|
2990
|
+
if (_this.dragContainer.linkDragPath.to) {
|
|
2991
|
+
var placePointX = event.source.getRootElement().getBoundingClientRect().x -
|
|
2992
|
+
_this.dragContainer.linkDragPath.to.element.getBoundingClientRect().x;
|
|
2993
|
+
_this.dragContainer.emitLinkDragEnded(Object.assign(Object.assign({}, _this.dragContainer.linkDragPath.to), { pos: placePointX < _this.dragContainer.linkDragPath.to.item.refs.width / 2
|
|
2994
|
+
? InBarPosition.start
|
|
2995
|
+
: InBarPosition.finish }));
|
|
2996
|
+
}
|
|
2997
|
+
event.source.reset();
|
|
2764
2998
|
_this.barElement.classList.remove(activeClass);
|
|
2765
2999
|
_this.destroyLinkDraggingLine();
|
|
2766
|
-
_this.dragContainer.emitLinkDragEnded();
|
|
2767
3000
|
});
|
|
2768
3001
|
dragRefs.push(dragRef);
|
|
2769
3002
|
});
|
|
@@ -2812,6 +3045,7 @@
|
|
|
2812
3045
|
if (!this.linkDraggingLine) {
|
|
2813
3046
|
var svgElement = createSvgElement('svg', 'gantt-link-drag-container');
|
|
2814
3047
|
var linElement = createSvgElement('line', 'link-dragging-line');
|
|
3048
|
+
linElement.style.pointerEvents = 'none';
|
|
2815
3049
|
svgElement.appendChild(linElement);
|
|
2816
3050
|
this.dom.root.appendChild(svgElement);
|
|
2817
3051
|
this.linkDraggingLine = linElement;
|
|
@@ -2824,7 +3058,7 @@
|
|
|
2824
3058
|
}
|
|
2825
3059
|
};
|
|
2826
3060
|
GanttBarDrag.prototype.createDrags = function (elementRef, item, ganttUpper) {
|
|
2827
|
-
var
|
|
3061
|
+
var _d, _e;
|
|
2828
3062
|
this.item = item;
|
|
2829
3063
|
this.barElement = elementRef.nativeElement;
|
|
2830
3064
|
this.ganttUpper = ganttUpper;
|
|
@@ -2836,11 +3070,11 @@
|
|
|
2836
3070
|
if (!this.dragDisabled) {
|
|
2837
3071
|
var dragRef = this.createBarDrag();
|
|
2838
3072
|
var dragHandlesRefs = this.createBarHandleDrags();
|
|
2839
|
-
(
|
|
3073
|
+
(_d = this.dragRefs).push.apply(_d, __spreadArray([dragRef], __read(dragHandlesRefs)));
|
|
2840
3074
|
}
|
|
2841
3075
|
if (!this.linkDragDisabled) {
|
|
2842
3076
|
var linkDragRefs = this.createLinkHandleDrags();
|
|
2843
|
-
(
|
|
3077
|
+
(_e = this.dragRefs).push.apply(_e, __spreadArray([], __read(linkDragRefs)));
|
|
2844
3078
|
}
|
|
2845
3079
|
}
|
|
2846
3080
|
};
|
|
@@ -2852,9 +3086,9 @@
|
|
|
2852
3086
|
};
|
|
2853
3087
|
return GanttBarDrag;
|
|
2854
3088
|
}());
|
|
2855
|
-
GanttBarDrag.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.
|
|
2856
|
-
GanttBarDrag.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.1.
|
|
2857
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.
|
|
3089
|
+
GanttBarDrag.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: GanttBarDrag, deps: [{ token: i1__namespace.DragDrop }, { token: GanttDomService }, { token: GanttDragContainer }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
3090
|
+
GanttBarDrag.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: GanttBarDrag });
|
|
3091
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: GanttBarDrag, decorators: [{
|
|
2858
3092
|
type: i0.Injectable
|
|
2859
3093
|
}], ctorParameters: function () { return [{ type: i1__namespace.DragDrop }, { type: GanttDomService }, { type: GanttDragContainer }]; } });
|
|
2860
3094
|
|
|
@@ -2926,9 +3160,9 @@
|
|
|
2926
3160
|
};
|
|
2927
3161
|
return NgxGanttBarComponent;
|
|
2928
3162
|
}(GanttItemUpper));
|
|
2929
|
-
NgxGanttBarComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.
|
|
2930
|
-
NgxGanttBarComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.1.
|
|
2931
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.
|
|
3163
|
+
NgxGanttBarComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: NgxGanttBarComponent, deps: [{ token: GanttDragContainer }, { token: GanttBarDrag }, { token: i0__namespace.ElementRef }, { token: GANTT_UPPER_TOKEN }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
3164
|
+
NgxGanttBarComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.1.5", type: NgxGanttBarComponent, selector: "ngx-gantt-bar,gantt-bar", outputs: { barClick: "barClick" }, host: { properties: { "class.gantt-bar": "this.ganttItemClass" } }, providers: [GanttBarDrag], viewQueries: [{ propertyName: "contentElementRef", first: true, predicate: ["content"], descendants: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0__namespace, template: "<div class=\"gantt-bar-layer\">\n <div *ngIf=\"item.draggable && ganttUpper.draggable\" class=\"drag-handles\">\n <ng-container>\n <span class=\"handle\" (mousedown)=\"stopPropagation($event)\"></span>\n <span class=\"handle\" (mousedown)=\"stopPropagation($event)\"></span>\n </ng-container>\n </div>\n <div *ngIf=\"item.linkable && ganttUpper.linkable\" class=\"link-handles\">\n <span class=\"handle\"><span class=\"point\"></span></span>\n <span class=\"handle\"> <span class=\"point\"></span></span>\n </div>\n</div>\n<div class=\"gantt-bar-border\"></div>\n<div #content class=\"gantt-bar-content\" (click)=\"onBarClick($event)\">\n <div class=\"gantt-bar-content-progress\" *ngIf=\"item.progress >= 0\" [style.width.%]=\"item.progress * 100\"></div>\n <ng-template [ngTemplateOutlet]=\"template\" [ngTemplateOutletContext]=\"{ item: item.origin, refs: item.refs }\"></ng-template>\n</div>\n", directives: [{ type: i2__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2__namespace.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }] });
|
|
3165
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: NgxGanttBarComponent, decorators: [{
|
|
2932
3166
|
type: i0.Component,
|
|
2933
3167
|
args: [{
|
|
2934
3168
|
selector: 'ngx-gantt-bar,gantt-bar',
|
|
@@ -2963,9 +3197,9 @@
|
|
|
2963
3197
|
};
|
|
2964
3198
|
return GanttMainComponent;
|
|
2965
3199
|
}());
|
|
2966
|
-
GanttMainComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.
|
|
2967
|
-
GanttMainComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.1.
|
|
2968
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.
|
|
3200
|
+
GanttMainComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: GanttMainComponent, deps: [{ token: GANTT_UPPER_TOKEN }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
3201
|
+
GanttMainComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.1.5", 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 } });
|
|
3202
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: GanttMainComponent, decorators: [{
|
|
2969
3203
|
type: i0.Component,
|
|
2970
3204
|
args: [{
|
|
2971
3205
|
selector: 'gantt-main',
|
|
@@ -3005,6 +3239,7 @@
|
|
|
3005
3239
|
_this.linkDragStarted = new i0.EventEmitter();
|
|
3006
3240
|
_this.linkDragEnded = new i0.EventEmitter();
|
|
3007
3241
|
_this.lineClick = new i0.EventEmitter();
|
|
3242
|
+
_this.selectedChange = new i0.EventEmitter();
|
|
3008
3243
|
_this.ngUnsubscribe$ = new rxjs.Subject();
|
|
3009
3244
|
_this.sideTableWidth = sideWidth;
|
|
3010
3245
|
return _this;
|
|
@@ -3062,13 +3297,30 @@
|
|
|
3062
3297
|
this.expandChange.emit();
|
|
3063
3298
|
}
|
|
3064
3299
|
};
|
|
3300
|
+
NgxGanttComponent.prototype.selectItem = function (selectEvent) {
|
|
3301
|
+
var _a;
|
|
3302
|
+
if (!this.selectable) {
|
|
3303
|
+
return;
|
|
3304
|
+
}
|
|
3305
|
+
var event = selectEvent.event, selectedValue = selectEvent.selectedValue;
|
|
3306
|
+
this.selectionModel.toggle(selectedValue.id);
|
|
3307
|
+
var selectedIds = this.selectionModel.selected;
|
|
3308
|
+
if (this.multiple) {
|
|
3309
|
+
var _selectedValue = this.getGanttItems(selectedIds).map(function (item) { return item.origin; });
|
|
3310
|
+
this.selectedChange.emit({ event: event, selectedValue: _selectedValue });
|
|
3311
|
+
}
|
|
3312
|
+
else {
|
|
3313
|
+
var _selectedValue = (_a = this.getGanttItem(selectedIds[0])) === null || _a === void 0 ? void 0 : _a.origin;
|
|
3314
|
+
this.selectedChange.emit({ event: event, selectedValue: _selectedValue });
|
|
3315
|
+
}
|
|
3316
|
+
};
|
|
3065
3317
|
NgxGanttComponent.prototype.ngOnDestroy = function () {
|
|
3066
3318
|
_super.prototype.onDestroy.call(this);
|
|
3067
3319
|
};
|
|
3068
3320
|
return NgxGanttComponent;
|
|
3069
3321
|
}(GanttUpper));
|
|
3070
|
-
NgxGanttComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.
|
|
3071
|
-
NgxGanttComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.1.
|
|
3322
|
+
NgxGanttComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.5", 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 });
|
|
3323
|
+
NgxGanttComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.1.5", type: NgxGanttComponent, selector: "ngx-gantt", inputs: { maxLevel: "maxLevel", async: "async", childrenResolve: "childrenResolve", linkable: "linkable" }, outputs: { linkDragStarted: "linkDragStarted", linkDragEnded: "linkDragEnded", lineClick: "lineClick", selectedChange: "selectedChange" }, providers: [
|
|
3072
3324
|
{
|
|
3073
3325
|
provide: GANTT_UPPER_TOKEN,
|
|
3074
3326
|
useExisting: NgxGanttComponent
|
|
@@ -3077,8 +3329,8 @@
|
|
|
3077
3329
|
provide: GANTT_ABSTRACT_TOKEN,
|
|
3078
3330
|
useExisting: i0.forwardRef(function () { return NgxGanttComponent; })
|
|
3079
3331
|
}
|
|
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 });
|
|
3081
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.
|
|
3332
|
+
], 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 });
|
|
3333
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: NgxGanttComponent, decorators: [{
|
|
3082
3334
|
type: i0.Component,
|
|
3083
3335
|
args: [{
|
|
3084
3336
|
selector: 'ngx-gantt',
|
|
@@ -3114,6 +3366,8 @@
|
|
|
3114
3366
|
type: i0.Output
|
|
3115
3367
|
}], lineClick: [{
|
|
3116
3368
|
type: i0.Output
|
|
3369
|
+
}], selectedChange: [{
|
|
3370
|
+
type: i0.Output
|
|
3117
3371
|
}], table: [{
|
|
3118
3372
|
type: i0.ContentChild,
|
|
3119
3373
|
args: [NgxGanttTableComponent]
|
|
@@ -3130,8 +3384,8 @@
|
|
|
3130
3384
|
}
|
|
3131
3385
|
return NgxGanttModule;
|
|
3132
3386
|
}());
|
|
3133
|
-
NgxGanttModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.
|
|
3134
|
-
NgxGanttModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.1.
|
|
3387
|
+
NgxGanttModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: NgxGanttModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
|
|
3388
|
+
NgxGanttModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: NgxGanttModule, declarations: [NgxGanttComponent,
|
|
3135
3389
|
NgxGanttTableComponent,
|
|
3136
3390
|
NgxGanttTableColumnComponent,
|
|
3137
3391
|
GanttTableComponent,
|
|
@@ -3151,13 +3405,13 @@
|
|
|
3151
3405
|
NgxGanttRootComponent,
|
|
3152
3406
|
NgxGanttBarComponent,
|
|
3153
3407
|
NgxGanttRangeComponent] });
|
|
3154
|
-
NgxGanttModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.1.
|
|
3408
|
+
NgxGanttModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: NgxGanttModule, providers: [
|
|
3155
3409
|
{
|
|
3156
3410
|
provide: GANTT_GLOBAL_CONFIG,
|
|
3157
3411
|
useValue: defaultConfig
|
|
3158
3412
|
}
|
|
3159
3413
|
], imports: [[i2.CommonModule, i1.DragDropModule]] });
|
|
3160
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.
|
|
3414
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: NgxGanttModule, decorators: [{
|
|
3161
3415
|
type: i0.NgModule,
|
|
3162
3416
|
args: [{
|
|
3163
3417
|
imports: [i2.CommonModule, i1.DragDropModule],
|
|
@@ -3205,195 +3459,131 @@
|
|
|
3205
3459
|
|
|
3206
3460
|
Object.defineProperty(exports, 'addDays', {
|
|
3207
3461
|
enumerable: true,
|
|
3208
|
-
get: function () {
|
|
3209
|
-
return dateFns.addDays;
|
|
3210
|
-
}
|
|
3462
|
+
get: function () { return dateFns.addDays; }
|
|
3211
3463
|
});
|
|
3212
3464
|
Object.defineProperty(exports, 'addHours', {
|
|
3213
3465
|
enumerable: true,
|
|
3214
|
-
get: function () {
|
|
3215
|
-
return dateFns.addHours;
|
|
3216
|
-
}
|
|
3466
|
+
get: function () { return dateFns.addHours; }
|
|
3217
3467
|
});
|
|
3218
3468
|
Object.defineProperty(exports, 'addMinutes', {
|
|
3219
3469
|
enumerable: true,
|
|
3220
|
-
get: function () {
|
|
3221
|
-
return dateFns.addMinutes;
|
|
3222
|
-
}
|
|
3470
|
+
get: function () { return dateFns.addMinutes; }
|
|
3223
3471
|
});
|
|
3224
3472
|
Object.defineProperty(exports, 'addMonths', {
|
|
3225
3473
|
enumerable: true,
|
|
3226
|
-
get: function () {
|
|
3227
|
-
return dateFns.addMonths;
|
|
3228
|
-
}
|
|
3474
|
+
get: function () { return dateFns.addMonths; }
|
|
3229
3475
|
});
|
|
3230
3476
|
Object.defineProperty(exports, 'addQuarters', {
|
|
3231
3477
|
enumerable: true,
|
|
3232
|
-
get: function () {
|
|
3233
|
-
return dateFns.addQuarters;
|
|
3234
|
-
}
|
|
3478
|
+
get: function () { return dateFns.addQuarters; }
|
|
3235
3479
|
});
|
|
3236
3480
|
Object.defineProperty(exports, 'addSeconds', {
|
|
3237
3481
|
enumerable: true,
|
|
3238
|
-
get: function () {
|
|
3239
|
-
return dateFns.addSeconds;
|
|
3240
|
-
}
|
|
3482
|
+
get: function () { return dateFns.addSeconds; }
|
|
3241
3483
|
});
|
|
3242
3484
|
Object.defineProperty(exports, 'addWeeks', {
|
|
3243
3485
|
enumerable: true,
|
|
3244
|
-
get: function () {
|
|
3245
|
-
return dateFns.addWeeks;
|
|
3246
|
-
}
|
|
3486
|
+
get: function () { return dateFns.addWeeks; }
|
|
3247
3487
|
});
|
|
3248
3488
|
Object.defineProperty(exports, 'addYears', {
|
|
3249
3489
|
enumerable: true,
|
|
3250
|
-
get: function () {
|
|
3251
|
-
return dateFns.addYears;
|
|
3252
|
-
}
|
|
3490
|
+
get: function () { return dateFns.addYears; }
|
|
3253
3491
|
});
|
|
3254
3492
|
Object.defineProperty(exports, 'differenceInCalendarDays', {
|
|
3255
3493
|
enumerable: true,
|
|
3256
|
-
get: function () {
|
|
3257
|
-
return dateFns.differenceInCalendarDays;
|
|
3258
|
-
}
|
|
3494
|
+
get: function () { return dateFns.differenceInCalendarDays; }
|
|
3259
3495
|
});
|
|
3260
3496
|
Object.defineProperty(exports, 'differenceInCalendarQuarters', {
|
|
3261
3497
|
enumerable: true,
|
|
3262
|
-
get: function () {
|
|
3263
|
-
return dateFns.differenceInCalendarQuarters;
|
|
3264
|
-
}
|
|
3498
|
+
get: function () { return dateFns.differenceInCalendarQuarters; }
|
|
3265
3499
|
});
|
|
3266
3500
|
Object.defineProperty(exports, 'differenceInDays', {
|
|
3267
3501
|
enumerable: true,
|
|
3268
|
-
get: function () {
|
|
3269
|
-
return dateFns.differenceInDays;
|
|
3270
|
-
}
|
|
3502
|
+
get: function () { return dateFns.differenceInDays; }
|
|
3271
3503
|
});
|
|
3272
3504
|
Object.defineProperty(exports, 'eachDayOfInterval', {
|
|
3273
3505
|
enumerable: true,
|
|
3274
|
-
get: function () {
|
|
3275
|
-
return dateFns.eachDayOfInterval;
|
|
3276
|
-
}
|
|
3506
|
+
get: function () { return dateFns.eachDayOfInterval; }
|
|
3277
3507
|
});
|
|
3278
3508
|
Object.defineProperty(exports, 'eachMonthOfInterval', {
|
|
3279
3509
|
enumerable: true,
|
|
3280
|
-
get: function () {
|
|
3281
|
-
return dateFns.eachMonthOfInterval;
|
|
3282
|
-
}
|
|
3510
|
+
get: function () { return dateFns.eachMonthOfInterval; }
|
|
3283
3511
|
});
|
|
3284
3512
|
Object.defineProperty(exports, 'eachWeekOfInterval', {
|
|
3285
3513
|
enumerable: true,
|
|
3286
|
-
get: function () {
|
|
3287
|
-
return dateFns.eachWeekOfInterval;
|
|
3288
|
-
}
|
|
3514
|
+
get: function () { return dateFns.eachWeekOfInterval; }
|
|
3289
3515
|
});
|
|
3290
3516
|
Object.defineProperty(exports, 'endOfDay', {
|
|
3291
3517
|
enumerable: true,
|
|
3292
|
-
get: function () {
|
|
3293
|
-
return dateFns.endOfDay;
|
|
3294
|
-
}
|
|
3518
|
+
get: function () { return dateFns.endOfDay; }
|
|
3295
3519
|
});
|
|
3296
3520
|
Object.defineProperty(exports, 'endOfMonth', {
|
|
3297
3521
|
enumerable: true,
|
|
3298
|
-
get: function () {
|
|
3299
|
-
return dateFns.endOfMonth;
|
|
3300
|
-
}
|
|
3522
|
+
get: function () { return dateFns.endOfMonth; }
|
|
3301
3523
|
});
|
|
3302
3524
|
Object.defineProperty(exports, 'endOfQuarter', {
|
|
3303
3525
|
enumerable: true,
|
|
3304
|
-
get: function () {
|
|
3305
|
-
return dateFns.endOfQuarter;
|
|
3306
|
-
}
|
|
3526
|
+
get: function () { return dateFns.endOfQuarter; }
|
|
3307
3527
|
});
|
|
3308
3528
|
Object.defineProperty(exports, 'endOfWeek', {
|
|
3309
3529
|
enumerable: true,
|
|
3310
|
-
get: function () {
|
|
3311
|
-
return dateFns.endOfWeek;
|
|
3312
|
-
}
|
|
3530
|
+
get: function () { return dateFns.endOfWeek; }
|
|
3313
3531
|
});
|
|
3314
3532
|
Object.defineProperty(exports, 'endOfYear', {
|
|
3315
3533
|
enumerable: true,
|
|
3316
|
-
get: function () {
|
|
3317
|
-
return dateFns.endOfYear;
|
|
3318
|
-
}
|
|
3534
|
+
get: function () { return dateFns.endOfYear; }
|
|
3319
3535
|
});
|
|
3320
3536
|
Object.defineProperty(exports, 'format', {
|
|
3321
3537
|
enumerable: true,
|
|
3322
|
-
get: function () {
|
|
3323
|
-
return dateFns.format;
|
|
3324
|
-
}
|
|
3538
|
+
get: function () { return dateFns.format; }
|
|
3325
3539
|
});
|
|
3326
3540
|
Object.defineProperty(exports, 'fromUnixTime', {
|
|
3327
3541
|
enumerable: true,
|
|
3328
|
-
get: function () {
|
|
3329
|
-
return dateFns.fromUnixTime;
|
|
3330
|
-
}
|
|
3542
|
+
get: function () { return dateFns.fromUnixTime; }
|
|
3331
3543
|
});
|
|
3332
3544
|
Object.defineProperty(exports, 'getDaysInMonth', {
|
|
3333
3545
|
enumerable: true,
|
|
3334
|
-
get: function () {
|
|
3335
|
-
return dateFns.getDaysInMonth;
|
|
3336
|
-
}
|
|
3546
|
+
get: function () { return dateFns.getDaysInMonth; }
|
|
3337
3547
|
});
|
|
3338
3548
|
Object.defineProperty(exports, 'getUnixTime', {
|
|
3339
3549
|
enumerable: true,
|
|
3340
|
-
get: function () {
|
|
3341
|
-
return dateFns.getUnixTime;
|
|
3342
|
-
}
|
|
3550
|
+
get: function () { return dateFns.getUnixTime; }
|
|
3343
3551
|
});
|
|
3344
3552
|
Object.defineProperty(exports, 'getWeek', {
|
|
3345
3553
|
enumerable: true,
|
|
3346
|
-
get: function () {
|
|
3347
|
-
return dateFns.getWeek;
|
|
3348
|
-
}
|
|
3554
|
+
get: function () { return dateFns.getWeek; }
|
|
3349
3555
|
});
|
|
3350
3556
|
Object.defineProperty(exports, 'isToday', {
|
|
3351
3557
|
enumerable: true,
|
|
3352
|
-
get: function () {
|
|
3353
|
-
return dateFns.isToday;
|
|
3354
|
-
}
|
|
3558
|
+
get: function () { return dateFns.isToday; }
|
|
3355
3559
|
});
|
|
3356
3560
|
Object.defineProperty(exports, 'isWeekend', {
|
|
3357
3561
|
enumerable: true,
|
|
3358
|
-
get: function () {
|
|
3359
|
-
return dateFns.isWeekend;
|
|
3360
|
-
}
|
|
3562
|
+
get: function () { return dateFns.isWeekend; }
|
|
3361
3563
|
});
|
|
3362
3564
|
Object.defineProperty(exports, 'setDate', {
|
|
3363
3565
|
enumerable: true,
|
|
3364
|
-
get: function () {
|
|
3365
|
-
return dateFns.setDate;
|
|
3366
|
-
}
|
|
3566
|
+
get: function () { return dateFns.setDate; }
|
|
3367
3567
|
});
|
|
3368
3568
|
Object.defineProperty(exports, 'startOfDay', {
|
|
3369
3569
|
enumerable: true,
|
|
3370
|
-
get: function () {
|
|
3371
|
-
return dateFns.startOfDay;
|
|
3372
|
-
}
|
|
3570
|
+
get: function () { return dateFns.startOfDay; }
|
|
3373
3571
|
});
|
|
3374
3572
|
Object.defineProperty(exports, 'startOfMonth', {
|
|
3375
3573
|
enumerable: true,
|
|
3376
|
-
get: function () {
|
|
3377
|
-
return dateFns.startOfMonth;
|
|
3378
|
-
}
|
|
3574
|
+
get: function () { return dateFns.startOfMonth; }
|
|
3379
3575
|
});
|
|
3380
3576
|
Object.defineProperty(exports, 'startOfQuarter', {
|
|
3381
3577
|
enumerable: true,
|
|
3382
|
-
get: function () {
|
|
3383
|
-
return dateFns.startOfQuarter;
|
|
3384
|
-
}
|
|
3578
|
+
get: function () { return dateFns.startOfQuarter; }
|
|
3385
3579
|
});
|
|
3386
3580
|
Object.defineProperty(exports, 'startOfWeek', {
|
|
3387
3581
|
enumerable: true,
|
|
3388
|
-
get: function () {
|
|
3389
|
-
return dateFns.startOfWeek;
|
|
3390
|
-
}
|
|
3582
|
+
get: function () { return dateFns.startOfWeek; }
|
|
3391
3583
|
});
|
|
3392
3584
|
Object.defineProperty(exports, 'startOfYear', {
|
|
3393
3585
|
enumerable: true,
|
|
3394
|
-
get: function () {
|
|
3395
|
-
return dateFns.startOfYear;
|
|
3396
|
-
}
|
|
3586
|
+
get: function () { return dateFns.startOfYear; }
|
|
3397
3587
|
});
|
|
3398
3588
|
exports.GANTT_GLOBAL_CONFIG = GANTT_GLOBAL_CONFIG;
|
|
3399
3589
|
exports.GANTT_UPPER_TOKEN = GANTT_UPPER_TOKEN;
|
|
@@ -3408,6 +3598,7 @@
|
|
|
3408
3598
|
exports.GanttLinkDragEvent = GanttLinkDragEvent;
|
|
3409
3599
|
exports.GanttLoadOnScrollEvent = GanttLoadOnScrollEvent;
|
|
3410
3600
|
exports.GanttPrintService = GanttPrintService;
|
|
3601
|
+
exports.GanttSelectedEvent = GanttSelectedEvent;
|
|
3411
3602
|
exports.GanttTableEvent = GanttTableEvent;
|
|
3412
3603
|
exports.GanttUpper = GanttUpper;
|
|
3413
3604
|
exports.GanttView = GanttView;
|
|
@@ -3427,5 +3618,5 @@
|
|
|
3427
3618
|
|
|
3428
3619
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
3429
3620
|
|
|
3430
|
-
}))
|
|
3621
|
+
}));
|
|
3431
3622
|
//# sourceMappingURL=worktile-gantt.umd.js.map
|