@worktile/gantt 12.2.0-next.1 → 12.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. package/bundles/worktile-gantt.umd.js +581 -508
  2. package/bundles/worktile-gantt.umd.js.map +1 -1
  3. package/class/event.d.ts +2 -0
  4. package/class/index.d.ts +1 -0
  5. package/class/item.d.ts +1 -1
  6. package/class/link.d.ts +12 -7
  7. package/components/bar/bar-drag.d.ts +4 -2
  8. package/components/bar/bar.component.d.ts +4 -4
  9. package/components/calendar/calendar.component.d.ts +3 -5
  10. package/components/drag-backdrop/drag-backdrop.component.d.ts +1 -5
  11. package/components/icon/icon.component.d.ts +2 -4
  12. package/components/links/{paths → lines}/curve.d.ts +2 -3
  13. package/components/links/lines/factory.d.ts +5 -0
  14. package/components/links/{paths/path.d.ts → lines/line.d.ts} +1 -4
  15. package/components/links/{paths/line.d.ts → lines/straight.d.ts} +2 -2
  16. package/components/links/links.component.d.ts +2 -2
  17. package/components/main/gantt-main.component.d.ts +2 -3
  18. package/components/range/range.component.d.ts +2 -5
  19. package/components/table/gantt-table.component.d.ts +2 -3
  20. package/esm2015/class/event.js +1 -1
  21. package/esm2015/class/index.js +2 -1
  22. package/esm2015/class/item.js +4 -3
  23. package/esm2015/class/link.js +6 -6
  24. package/esm2015/components/bar/bar-drag.js +56 -26
  25. package/esm2015/components/bar/bar.component.js +22 -15
  26. package/esm2015/components/calendar/calendar.component.js +18 -13
  27. package/esm2015/components/drag-backdrop/drag-backdrop.component.js +10 -14
  28. package/esm2015/components/icon/icon.component.js +4 -6
  29. package/esm2015/components/links/lines/curve.js +96 -0
  30. package/esm2015/components/links/lines/factory.js +14 -0
  31. package/esm2015/components/links/lines/line.js +24 -0
  32. package/esm2015/components/links/lines/straight.js +58 -0
  33. package/esm2015/components/links/links.component.js +31 -17
  34. package/esm2015/components/main/gantt-main.component.js +4 -5
  35. package/esm2015/components/range/range.component.js +4 -13
  36. package/esm2015/components/table/gantt-table.component.js +10 -6
  37. package/esm2015/gantt-dom.service.js +41 -27
  38. package/esm2015/gantt-drag-container.js +57 -40
  39. package/esm2015/gantt-item-upper.js +7 -7
  40. package/esm2015/gantt-print.service.js +53 -50
  41. package/esm2015/gantt-upper.js +37 -20
  42. package/esm2015/gantt.component.js +25 -28
  43. package/esm2015/gantt.config.js +3 -3
  44. package/esm2015/gantt.module.js +4 -4
  45. package/esm2015/gantt.pipe.js +9 -9
  46. package/esm2015/root.component.js +43 -31
  47. package/esm2015/table/gantt-column.component.js +4 -5
  48. package/esm2015/table/gantt-table.component.js +5 -6
  49. package/esm2015/utils/passive-listeners.js +30 -0
  50. package/esm2015/utils/set-style-with-vendor-prefix.js +15 -0
  51. package/esm2015/views/day.js +1 -1
  52. package/fesm2015/worktile-gantt.js +492 -386
  53. package/fesm2015/worktile-gantt.js.map +1 -1
  54. package/gantt-dom.service.d.ts +11 -4
  55. package/gantt-drag-container.d.ts +20 -8
  56. package/gantt-item-upper.d.ts +5 -5
  57. package/gantt-print.service.d.ts +1 -1
  58. package/gantt-upper.d.ts +10 -8
  59. package/gantt.component.d.ts +3 -7
  60. package/gantt.config.d.ts +2 -2
  61. package/main.bundle.scss +34 -3
  62. package/package.json +1 -1
  63. package/root.component.d.ts +5 -3
  64. package/table/gantt-column.component.d.ts +2 -3
  65. package/table/gantt-table.component.d.ts +2 -4
  66. package/utils/passive-listeners.d.ts +13 -0
  67. package/utils/set-style-with-vendor-prefix.d.ts +12 -0
  68. package/README.md +0 -24
  69. package/components/links/paths/factory.d.ts +0 -5
  70. package/esm2015/components/links/paths/curve.js +0 -118
  71. package/esm2015/components/links/paths/factory.js +0 -14
  72. package/esm2015/components/links/paths/line.js +0 -59
  73. package/esm2015/components/links/paths/path.js +0 -31
@@ -1,10 +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/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
-
7
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
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')) :
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'], 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));
5
+ })(this, (function (exports, i0, i2, operators, rxjs, dateFns, collections, coercion, i1) { 'use strict';
8
6
 
9
7
  function _interopNamespace(e) {
10
8
  if (e && e.__esModule) return e;
@@ -15,21 +13,18 @@
15
13
  var d = Object.getOwnPropertyDescriptor(e, k);
16
14
  Object.defineProperty(n, k, d.get ? d : {
17
15
  enumerable: true,
18
- get: function () {
19
- return e[k];
20
- }
16
+ get: function () { return e[k]; }
21
17
  });
22
18
  }
23
19
  });
24
20
  }
25
- n['default'] = e;
21
+ n["default"] = e;
26
22
  return Object.freeze(n);
27
23
  }
28
24
 
29
25
  var i0__namespace = /*#__PURE__*/_interopNamespace(i0);
30
26
  var i2__namespace = /*#__PURE__*/_interopNamespace(i2);
31
27
  var i1__namespace = /*#__PURE__*/_interopNamespace(i1);
32
- var html2canvas__default = /*#__PURE__*/_interopDefaultLegacy(html2canvas);
33
28
 
34
29
  /*! *****************************************************************************
35
30
  Copyright (c) Microsoft Corporation.
@@ -266,7 +261,7 @@
266
261
  ar[i] = from[i];
267
262
  }
268
263
  }
269
- return to.concat(ar || from);
264
+ return to.concat(ar || Array.prototype.slice.call(from));
270
265
  }
271
266
  function __await(v) {
272
267
  return this instanceof __await ? (this.v = v, this) : new __await(v);
@@ -564,24 +559,24 @@
564
559
  GanttViewType["week"] = "week";
565
560
  })(exports.GanttViewType || (exports.GanttViewType = {}));
566
561
 
567
- var GanttLinkType;
562
+ exports.GanttLinkType = void 0;
568
563
  (function (GanttLinkType) {
569
564
  GanttLinkType[GanttLinkType["fs"] = 1] = "fs";
570
565
  GanttLinkType[GanttLinkType["ff"] = 2] = "ff";
571
566
  GanttLinkType[GanttLinkType["ss"] = 3] = "ss";
572
567
  GanttLinkType[GanttLinkType["sf"] = 4] = "sf";
573
- })(GanttLinkType || (GanttLinkType = {}));
574
- var GanttLinkPathType;
575
- (function (GanttLinkPathType) {
576
- GanttLinkPathType["curve"] = "curve";
577
- GanttLinkPathType["line"] = "line";
578
- })(GanttLinkPathType || (GanttLinkPathType = {}));
579
- var LinkColors;
568
+ })(exports.GanttLinkType || (exports.GanttLinkType = {}));
569
+ exports.GanttLinkLineType = void 0;
570
+ (function (GanttLinkLineType) {
571
+ GanttLinkLineType["curve"] = "curve";
572
+ GanttLinkLineType["straight"] = "straight";
573
+ })(exports.GanttLinkLineType || (exports.GanttLinkLineType = {}));
574
+ exports.LinkColors = void 0;
580
575
  (function (LinkColors) {
581
576
  LinkColors["default"] = "#cacaca";
582
577
  LinkColors["blocked"] = "#FF7575";
583
578
  LinkColors["active"] = "#348FE4";
584
- })(LinkColors || (LinkColors = {}));
579
+ })(exports.LinkColors || (exports.LinkColors = {}));
585
580
 
586
581
  exports.GanttItemType = void 0;
587
582
  (function (GanttItemType) {
@@ -598,7 +593,7 @@
598
593
  this.links = (this.origin.links || []).map(function (link) {
599
594
  if (typeof link === 'string') {
600
595
  return {
601
- type: GanttLinkType.fs,
596
+ type: exports.GanttLinkType.fs,
602
597
  link: link
603
598
  };
604
599
  }
@@ -668,8 +663,9 @@
668
663
  this.expanded = expanded;
669
664
  this.origin.expanded = expanded;
670
665
  };
671
- GanttItemInternal.prototype.addLink = function (linkId) {
672
- this.links = __spreadArray(__spreadArray([], __read(this.links)), [{ type: GanttLinkType.fs, link: linkId }]);
666
+ GanttItemInternal.prototype.addLink = function (link) {
667
+ console.log(link);
668
+ this.links = __spreadArray(__spreadArray([], __read(this.links)), [link]);
673
669
  this.origin.links = this.links;
674
670
  };
675
671
  return GanttItemInternal;
@@ -703,9 +699,9 @@
703
699
  yearQuarter: 'yyyy年QQQ'
704
700
  },
705
701
  linkOptions: {
706
- dependencyTypes: [GanttLinkType.fs],
702
+ dependencyTypes: [exports.GanttLinkType.fs],
707
703
  showArrow: false,
708
- linkPathType: GanttLinkPathType.curve
704
+ lineType: exports.GanttLinkLineType.curve
709
705
  }
710
706
  };
711
707
  var GANTT_GLOBAL_CONFIG = new i0.InjectionToken('GANTT_GLOBAL_CONFIG');
@@ -1179,7 +1175,9 @@
1179
1175
  this.cdr = cdr;
1180
1176
  this.ngZone = ngZone;
1181
1177
  this.config = config;
1178
+ // eslint-disable-next-line @angular-eslint/no-input-rename
1182
1179
  this.originItems = [];
1180
+ // eslint-disable-next-line @angular-eslint/no-input-rename
1183
1181
  this.originGroups = [];
1184
1182
  this.viewType = exports.GanttViewType.month;
1185
1183
  this.showTodayLine = true;
@@ -1200,6 +1198,16 @@
1200
1198
  this._multiple = false;
1201
1199
  this.ganttClass = true;
1202
1200
  }
1201
+ Object.defineProperty(GanttUpper.prototype, "linkOptions", {
1202
+ get: function () {
1203
+ return Object.assign({}, defaultConfig.linkOptions, this.config.linkOptions, this._linkOptions);
1204
+ },
1205
+ set: function (options) {
1206
+ this._linkOptions = options;
1207
+ },
1208
+ enumerable: false,
1209
+ configurable: true
1210
+ });
1203
1211
  Object.defineProperty(GanttUpper.prototype, "selectable", {
1204
1212
  get: function () {
1205
1213
  return this._selectable;
@@ -1338,7 +1346,7 @@
1338
1346
  GanttUpper.prototype.initSelectionModel = function () {
1339
1347
  return new collections.SelectionModel(this.multiple, []);
1340
1348
  };
1341
- GanttUpper.prototype.onInit = function () {
1349
+ GanttUpper.prototype.ngOnInit = function () {
1342
1350
  var _this = this;
1343
1351
  this.styles = Object.assign({}, defaultStyles, this.styles);
1344
1352
  this.viewOptions.dateFormat = Object.assign({}, defaultConfig.dateFormat, this.config.dateFormat, this.viewOptions.dateFormat);
@@ -1348,25 +1356,32 @@
1348
1356
  this.computeRefs();
1349
1357
  this.initSelectionModel();
1350
1358
  this.firstChange = false;
1351
- this.ngZone.onStable.pipe(operators.take(1)).subscribe(function () {
1352
- _this.element.style.opacity = '1';
1353
- _this.dragContainer.dragStarted.subscribe(function (event) {
1354
- _this.dragStarted.emit(event);
1355
- });
1356
- _this.dragContainer.dragMoved.subscribe(function (event) {
1357
- _this.dragMoved.emit(event);
1358
- });
1359
- _this.dragContainer.dragEnded.subscribe(function (event) {
1360
- _this.dragEnded.emit(event);
1361
- _this.computeRefs();
1362
- _this.detectChanges();
1359
+ // Note: the zone may be nooped through `BootstrapOptions` when bootstrapping the root module. This means
1360
+ // the `onStable` will never emit any value.
1361
+ var onStable$ = this.ngZone.isStable ? rxjs.from(Promise.resolve()) : this.ngZone.onStable.pipe(operators.take(1));
1362
+ // Normally this isn't in the zone, but it can cause performance regressions for apps
1363
+ // using `zone-patch-rxjs` because it'll trigger a change detection when it unsubscribes.
1364
+ this.ngZone.runOutsideAngular(function () {
1365
+ onStable$.pipe(operators.takeUntil(_this.unsubscribe$)).subscribe(function () {
1366
+ _this.element.style.opacity = '1';
1367
+ _this.dragContainer.dragStarted.pipe(operators.takeUntil(_this.unsubscribe$)).subscribe(function (event) {
1368
+ _this.dragStarted.emit(event);
1369
+ });
1370
+ _this.dragContainer.dragMoved.pipe(operators.takeUntil(_this.unsubscribe$)).subscribe(function (event) {
1371
+ _this.dragMoved.emit(event);
1372
+ });
1373
+ _this.dragContainer.dragEnded.pipe(operators.takeUntil(_this.unsubscribe$)).subscribe(function (event) {
1374
+ _this.dragEnded.emit(event);
1375
+ _this.computeRefs();
1376
+ _this.detectChanges();
1377
+ });
1363
1378
  });
1364
1379
  });
1365
1380
  this.view.start$.pipe(operators.skip(1), operators.takeUntil(this.unsubscribe$)).subscribe(function () {
1366
1381
  _this.computeRefs();
1367
1382
  });
1368
1383
  };
1369
- GanttUpper.prototype.onChanges = function (changes) {
1384
+ GanttUpper.prototype.ngOnChanges = function (changes) {
1370
1385
  if (!this.firstChange) {
1371
1386
  if (changes.viewType && changes.viewType.currentValue) {
1372
1387
  this.createView();
@@ -1383,7 +1398,7 @@
1383
1398
  }
1384
1399
  }
1385
1400
  };
1386
- GanttUpper.prototype.onDestroy = function () {
1401
+ GanttUpper.prototype.ngOnDestroy = function () {
1387
1402
  this.unsubscribe$.next();
1388
1403
  this.unsubscribe$.complete();
1389
1404
  };
@@ -1443,9 +1458,9 @@
1443
1458
  };
1444
1459
  return GanttUpper;
1445
1460
  }());
1446
- GanttUpper.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0__namespace, type: GanttUpper, deps: [{ token: i0__namespace.ElementRef }, { token: i0__namespace.ChangeDetectorRef }, { token: i0__namespace.NgZone }, { token: GANTT_GLOBAL_CONFIG }], target: i0__namespace.ɵɵFactoryTarget.Directive });
1447
- GanttUpper.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.1.2", type: GanttUpper, inputs: { originItems: ["items", "originItems"], originGroups: ["groups", "originGroups"], viewType: "viewType", start: "start", end: "end", showTodayLine: "showTodayLine", draggable: "draggable", styles: "styles", viewOptions: "viewOptions", disabledLoadOnScroll: "disabledLoadOnScroll", selectable: "selectable", multiple: "multiple" }, outputs: { loadOnScroll: "loadOnScroll", dragStarted: "dragStarted", dragMoved: "dragMoved", dragEnded: "dragEnded", barClick: "barClick" }, host: { properties: { "class.gantt": "this.ganttClass" } }, queries: [{ propertyName: "barTemplate", first: true, predicate: ["bar"], descendants: true, static: true }, { propertyName: "rangeTemplate", first: true, predicate: ["range"], descendants: true, static: true }, { propertyName: "itemTemplate", first: true, predicate: ["item"], descendants: true, static: true }, { propertyName: "groupTemplate", first: true, predicate: ["group"], descendants: true, static: true }, { propertyName: "groupHeaderTemplate", first: true, predicate: ["groupHeader"], descendants: true, static: true }], ngImport: i0__namespace });
1448
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0__namespace, type: GanttUpper, decorators: [{
1461
+ 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 });
1462
+ 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 }], usesOnChanges: true, ngImport: i0__namespace });
1463
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: GanttUpper, decorators: [{
1449
1464
  type: i0.Directive
1450
1465
  }], ctorParameters: function () {
1451
1466
  return [{ type: i0__namespace.ElementRef }, { type: i0__namespace.ChangeDetectorRef }, { type: i0__namespace.NgZone }, { type: undefined, decorators: [{
@@ -1472,6 +1487,8 @@
1472
1487
  type: i0.Input
1473
1488
  }], viewOptions: [{
1474
1489
  type: i0.Input
1490
+ }], linkOptions: [{
1491
+ type: i0.Input
1475
1492
  }], disabledLoadOnScroll: [{
1476
1493
  type: i0.Input
1477
1494
  }], selectable: [{
@@ -1520,12 +1537,11 @@
1520
1537
  enumerable: false,
1521
1538
  configurable: true
1522
1539
  });
1523
- NgxGanttTableColumnComponent.prototype.ngOnInit = function () { };
1524
1540
  return NgxGanttTableColumnComponent;
1525
1541
  }());
1526
- NgxGanttTableColumnComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0__namespace, type: NgxGanttTableColumnComponent, deps: [{ token: GANTT_UPPER_TOKEN }], target: i0__namespace.ɵɵFactoryTarget.Component });
1527
- NgxGanttTableColumnComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.1.2", 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 });
1528
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0__namespace, type: NgxGanttTableColumnComponent, decorators: [{
1542
+ 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 });
1543
+ 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 });
1544
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: NgxGanttTableColumnComponent, decorators: [{
1529
1545
  type: i0.Component,
1530
1546
  args: [{
1531
1547
  selector: 'ngx-gantt-column',
@@ -1552,18 +1568,17 @@
1552
1568
  function NgxGanttTableComponent() {
1553
1569
  this.columnChanges = new i0.EventEmitter();
1554
1570
  }
1555
- NgxGanttTableComponent.prototype.ngOnInit = function () { };
1556
1571
  return NgxGanttTableComponent;
1557
1572
  }());
1558
- NgxGanttTableComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0__namespace, type: NgxGanttTableComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
1559
- NgxGanttTableComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.1.2", 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 });
1560
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0__namespace, type: NgxGanttTableComponent, decorators: [{
1573
+ NgxGanttTableComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: NgxGanttTableComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
1574
+ 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 });
1575
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: NgxGanttTableComponent, decorators: [{
1561
1576
  type: i0.Component,
1562
1577
  args: [{
1563
1578
  selector: 'ngx-gantt-table',
1564
1579
  template: ''
1565
1580
  }]
1566
- }], ctorParameters: function () { return []; }, propDecorators: { columnChanges: [{
1581
+ }], propDecorators: { columnChanges: [{
1567
1582
  type: i0.Output
1568
1583
  }], rowBeforeTemplate: [{
1569
1584
  type: i0.ContentChild,
@@ -1575,6 +1590,22 @@
1575
1590
 
1576
1591
  var GANTT_ABSTRACT_TOKEN = new i0.InjectionToken('gantt-abstract-token');
1577
1592
 
1593
+ var supports = (typeof window !== 'undefined' && !!window.CSS && CSS.supports) || (function () { return false; });
1594
+ /**
1595
+ * Note: we don't need to add vendor prefixes within `.scss` files since they're added automatically.
1596
+ * This function is necessary when the `element.style` is updated directly through the JavaScript.
1597
+ * This is not required to be used with CSS properties that don't require vendor prefixes (e.g. `opacity`).
1598
+ */
1599
+ function setStyleWithVendorPrefix(_a) {
1600
+ var element = _a.element, style = _a.style, value = _a.value;
1601
+ element.style[style] = value;
1602
+ if (supports("-webkit-" + style + ": " + value)) {
1603
+ // Note: some browsers still require setting `-webkit` vendor prefix. E.g. Mozilla 49 has implemented
1604
+ // the 3D support for `transform`, but it requires setting `-webkit-` prefix.
1605
+ element.style["-webkit-" + style] = value;
1606
+ }
1607
+ }
1608
+
1578
1609
  var angleRight = "<svg xmlns=\"http://www.w3.org/2000/svg\" fit=\"\" preserveAspectRatio=\"xMidYMid meet\" focusable=\"false\"><g id=\"amnavigation/angle-right\" stroke-width=\"1\" fill-rule=\"evenodd\"><path d=\"M7.978 11.498l-.005.005L2.3 5.831 3.13 5l4.848 4.848L12.826 5l.83.831-5.673 5.672-.005-.005z\" transform=\"rotate(-90 7.978 8.252)\"></path></g></svg>";
1579
1610
  var angleDown = "<svg xmlns=\"http://www.w3.org/2000/svg\" fit=\"\" preserveAspectRatio=\"xMidYMid meet\" focusable=\"false\"><g id=\"aknavigation/angle-down\" stroke-width=\"1\" fill-rule=\"evenodd\"><path d=\"M7.978 11.997l-.005.006L2.3 6.33l.83-.831 4.848 4.848L12.826 5.5l.83.83-5.673 5.673-.005-.006z\" ></path></g></svg>";
1580
1611
  var plusSquare = "<svg viewBox=\"0 0 16 16\" xmlns=\"http://www.w3.org/2000/svg\" fit=\"\" preserveAspectRatio=\"xMidYMid meet\" focusable=\"false\"><g id=\"kxaction/plus-square\" stroke-width=\"1\" fill-rule=\"evenodd\"><path d=\"M2 0h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V2a2 2 0 0 1 2-2zm0 1.2a.8.8 0 0 0-.8.8v12a.8.8 0 0 0 .8.8h12a.8.8 0 0 0 .8-.8V2a.8.8 0 0 0-.8-.8H2zm5.45 6.2V4.75h1.2V7.4h2.65v1.2H8.65v2.65h-1.2V8.6H4.8V7.4h2.65z\"></path></g></svg>";
@@ -1602,8 +1633,6 @@
1602
1633
  enumerable: false,
1603
1634
  configurable: true
1604
1635
  });
1605
- GanttIconComponent.prototype.ngOnInit = function () { };
1606
- GanttIconComponent.prototype.ngAfterViewInit = function () { };
1607
1636
  GanttIconComponent.prototype.setSvg = function (name) {
1608
1637
  var iconSvg = icons[name];
1609
1638
  if (iconSvg) {
@@ -1615,9 +1644,9 @@
1615
1644
  };
1616
1645
  return GanttIconComponent;
1617
1646
  }());
1618
- GanttIconComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0__namespace, type: GanttIconComponent, deps: [{ token: i0__namespace.ElementRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
1619
- GanttIconComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.1.2", type: GanttIconComponent, selector: "gantt-icon", inputs: { iconName: "iconName" }, host: { properties: { "class.gantt-icon": "this.isIcon" } }, ngImport: i0__namespace, template: '', isInline: true });
1620
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0__namespace, type: GanttIconComponent, decorators: [{
1647
+ 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 });
1648
+ 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 });
1649
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: GanttIconComponent, decorators: [{
1621
1650
  type: i0.Component,
1622
1651
  args: [{
1623
1652
  selector: 'gantt-icon',
@@ -1638,9 +1667,9 @@
1638
1667
  };
1639
1668
  return IsGanttRangeItemPipe;
1640
1669
  }());
1641
- IsGanttRangeItemPipe.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0__namespace, type: IsGanttRangeItemPipe, deps: [], target: i0__namespace.ɵɵFactoryTarget.Pipe });
1642
- IsGanttRangeItemPipe.ɵpipe = i0__namespace.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0__namespace, type: IsGanttRangeItemPipe, name: "isGanttRangeItem" });
1643
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0__namespace, type: IsGanttRangeItemPipe, decorators: [{
1670
+ IsGanttRangeItemPipe.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: IsGanttRangeItemPipe, deps: [], target: i0__namespace.ɵɵFactoryTarget.Pipe });
1671
+ IsGanttRangeItemPipe.ɵpipe = i0__namespace.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: IsGanttRangeItemPipe, name: "isGanttRangeItem" });
1672
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: IsGanttRangeItemPipe, decorators: [{
1644
1673
  type: i0.Pipe,
1645
1674
  args: [{
1646
1675
  name: 'isGanttRangeItem'
@@ -1654,9 +1683,9 @@
1654
1683
  };
1655
1684
  return IsGanttBarItemPipe;
1656
1685
  }());
1657
- IsGanttBarItemPipe.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0__namespace, type: IsGanttBarItemPipe, deps: [], target: i0__namespace.ɵɵFactoryTarget.Pipe });
1658
- IsGanttBarItemPipe.ɵpipe = i0__namespace.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0__namespace, type: IsGanttBarItemPipe, name: "isGanttBarItem" });
1659
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0__namespace, type: IsGanttBarItemPipe, decorators: [{
1686
+ IsGanttBarItemPipe.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: IsGanttBarItemPipe, deps: [], target: i0__namespace.ɵɵFactoryTarget.Pipe });
1687
+ IsGanttBarItemPipe.ɵpipe = i0__namespace.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: IsGanttBarItemPipe, name: "isGanttBarItem" });
1688
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: IsGanttBarItemPipe, decorators: [{
1660
1689
  type: i0.Pipe,
1661
1690
  args: [{
1662
1691
  name: 'isGanttBarItem'
@@ -1670,9 +1699,9 @@
1670
1699
  };
1671
1700
  return IsGanttCustomItemPipe;
1672
1701
  }());
1673
- IsGanttCustomItemPipe.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0__namespace, type: IsGanttCustomItemPipe, deps: [], target: i0__namespace.ɵɵFactoryTarget.Pipe });
1674
- IsGanttCustomItemPipe.ɵpipe = i0__namespace.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0__namespace, type: IsGanttCustomItemPipe, name: "isGanttCustomItem" });
1675
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0__namespace, type: IsGanttCustomItemPipe, decorators: [{
1702
+ IsGanttCustomItemPipe.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: IsGanttCustomItemPipe, deps: [], target: i0__namespace.ɵɵFactoryTarget.Pipe });
1703
+ IsGanttCustomItemPipe.ɵpipe = i0__namespace.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: IsGanttCustomItemPipe, name: "isGanttCustomItem" });
1704
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: IsGanttCustomItemPipe, decorators: [{
1676
1705
  type: i0.Pipe,
1677
1706
  args: [{
1678
1707
  name: 'isGanttCustomItem'
@@ -1702,7 +1731,6 @@
1702
1731
  enumerable: false,
1703
1732
  configurable: true
1704
1733
  });
1705
- GanttTableComponent.prototype.ngOnInit = function () { };
1706
1734
  GanttTableComponent.prototype.ngOnChanges = function (changes) {
1707
1735
  var _a, _b;
1708
1736
  if (!((_a = changes.groups.currentValue) === null || _a === void 0 ? void 0 : _a.length) && !((_b = changes.items.currentValue) === null || _b === void 0 ? void 0 : _b.length)) {
@@ -1714,7 +1742,11 @@
1714
1742
  };
1715
1743
  GanttTableComponent.prototype.dragFixed = function (config) {
1716
1744
  if (config.movedWidth < config.minWidth) {
1717
- config.target.style.transform = "translate3d(" + (config.minWidth - config.originWidth) + "px, 0, 0)";
1745
+ setStyleWithVendorPrefix({
1746
+ element: config.target,
1747
+ style: 'transform',
1748
+ value: "translate3d(" + (config.minWidth - config.originWidth) + "px, 0, 0)"
1749
+ });
1718
1750
  }
1719
1751
  };
1720
1752
  GanttTableComponent.prototype.expandGroup = function (group) {
@@ -1796,9 +1828,9 @@
1796
1828
  };
1797
1829
  return GanttTableComponent;
1798
1830
  }());
1799
- GanttTableComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0__namespace, type: GanttTableComponent, deps: [{ token: GANTT_ABSTRACT_TOKEN }, { token: GANTT_UPPER_TOKEN }, { token: i0__namespace.ElementRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
1800
- GanttTableComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.1.2", type: GanttTableComponent, selector: "gantt-table", inputs: { groups: "groups", items: "items", columns: "columns", groupTemplate: "groupTemplate", emptyTemplate: "emptyTemplate", rowBeforeTemplate: "rowBeforeTemplate", rowAfterTemplate: "rowAfterTemplate" }, outputs: { itemClick: "itemClick" }, host: { properties: { "class.gantt-table": "this.ganttTableClass", "class.gantt-table-empty": "this.ganttTableEmptyClass" } }, viewQueries: [{ propertyName: "draglineElementRef", first: true, predicate: ["dragLine"], descendants: true, static: true }], usesOnChanges: true, ngImport: i0__namespace, template: "<div class=\"gantt-table-header gantt-table-row\">\n <div class=\"gantt-table-column\" *ngFor=\"let column of columnList; let i = index\" [style.width]=\"column.columnWidth\">\n <ng-container *ngIf=\"column.headerTemplateRef; else default\" [ngTemplateOutlet]=\"column.headerTemplateRef\"></ng-container>\n <ng-template #default>\n {{ column.name }}\n </ng-template>\n <div\n class=\"gantt-table-drag-trigger\"\n cdkDrag\n cdkDragLockAxis=\"x\"\n cdkDragBoundary=\".gantt\"\n (cdkDragMoved)=\"dragMoved($event, column)\"\n (cdkDragStarted)=\"dragStarted($event)\"\n (cdkDragEnded)=\"columnDragEnded($event, column)\"\n ></div>\n </div>\n</div>\n<div class=\"gantt-table-body\">\n <ng-container *ngIf=\"!groups.length && !items.length\">\n <ng-container *ngIf=\"!emptyTemplate\">\n <gantt-icon class=\"empty-icon\" iconName=\"empty\"></gantt-icon>\n <div class=\"empty-text\">\u6CA1\u6709\u6570\u636E</div>\n </ng-container>\n <ng-template [ngTemplateOutlet]=\"emptyTemplate\"></ng-template>\n </ng-container>\n\n <ng-container *ngIf=\"groups && groups.length > 0; else itemsTemplate\">\n <ng-container *ngFor=\"let group of groups; trackBy: trackBy\">\n <div class=\"gantt-table-group\" [ngClass]=\"group.class\">\n <div class=\"gantt-table-group-title\" [class.expanded]=\"group.expanded\" (click)=\"expandGroup(group)\">\n <gantt-icon class=\"expand-icon\" [iconName]=\"group.expanded ? 'angle-down' : 'angle-right'\"></gantt-icon>\n <ng-container *ngIf=\"groupTemplate; else default\">\n <ng-template\n [ngTemplateOutlet]=\"groupTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: group.origin, group: group.origin }\"\n ></ng-template>\n </ng-container>\n <ng-template #default>\n <span class=\"group-title\">{{ group.title }}</span>\n </ng-template>\n </div>\n </div>\n\n <ng-container *ngIf=\"group.expanded\">\n <ng-template\n [ngTemplateOutlet]=\"ganttItems\"\n [ngTemplateOutletContext]=\"{ group: group, items: group.items, level: 0 }\"\n ></ng-template>\n </ng-container>\n </ng-container>\n </ng-container>\n</div>\n\n<div\n class=\"gantt-table-drag-trigger\"\n cdkDrag\n cdkDragLockAxis=\"x\"\n cdkDragBoundary=\".gantt\"\n (cdkDragMoved)=\"dragMoved($event)\"\n (cdkDragStarted)=\"dragStarted($event)\"\n (cdkDragEnded)=\"tableDragEnded($event)\"\n></div>\n\n<div #dragLine class=\"gantt-table-drag-auxiliary-line\"></div>\n\n<ng-template #itemsTemplate>\n <ng-template [ngTemplateOutlet]=\"ganttItems\" [ngTemplateOutletContext]=\"{ items: items, level: 0 }\"></ng-template>\n</ng-template>\n\n<ng-template #ganttItems let-group=\"group\" let-items=\"items\" let-level=\"level\">\n <ng-container *ngFor=\"let item of items; trackBy: trackBy\">\n <div\n (click)=\"itemClick.emit({ event: $event, selectedValue: this.item.origin })\"\n class=\"gantt-table-item gantt-table-row\"\n [class.gantt-table-item-first-level-group]=\"level === 0 && (item.type | isGanttRangeItem)\"\n [class.gantt-table-item-with-group]=\"group\"\n [class.gantt-table-item-active]=\"ganttUpper.isSelected(item.id)\"\n [style.height.px]=\"gantt.styles.lineHeight\"\n [style.lineHeight.px]=\"gantt.styles.lineHeight\"\n >\n <ng-template\n [ngTemplateOutlet]=\"rowBeforeTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: item.origin, item: item.origin }\"\n ></ng-template>\n <div class=\"gantt-table-column\" *ngFor=\"let column of columnList; let first = first\" [style.width]=\"column.columnWidth\">\n <div *ngIf=\"first\" class=\"gantt-expand-icon\" [style.marginLeft.px]=\"level * 20\">\n <ng-container *ngIf=\"level < gantt.maxLevel - 1 && item.expandable\">\n <gantt-icon\n *ngIf=\"!item.loading\"\n class=\"expand-icon\"\n [iconName]=\"item.expanded ? 'angle-down' : 'angle-right'\"\n (click)=\"expandChildren($event, item)\"\n ></gantt-icon>\n <gantt-icon *ngIf=\"item.loading\" [iconName]=\"'loading'\"></gantt-icon>\n </ng-container>\n </div>\n <div class=\"gantt-table-column-content\">\n <ng-template\n [ngTemplateOutlet]=\"column.templateRef\"\n [ngTemplateOutletContext]=\"{ $implicit: item.origin, item: item.origin }\"\n ></ng-template>\n </div>\n </div>\n <ng-template\n [ngTemplateOutlet]=\"rowAfterTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: item.origin, item: item.origin }\"\n ></ng-template>\n </div>\n <ng-template\n *ngIf=\"item.children && item.expanded\"\n [ngTemplateOutlet]=\"ganttItems\"\n [ngTemplateOutletContext]=\"{ items: item.children, level: level + 1, group: group }\"\n ></ng-template>\n </ng-container>\n</ng-template>\n", components: [{ type: GanttIconComponent, selector: "gantt-icon", inputs: ["iconName"] }], directives: [{ type: i2__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i2__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2__namespace.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i1__namespace.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragDisabled", "cdkDragStartDelay", "cdkDragLockAxis", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragBoundary", "cdkDragRootElement", "cdkDragData", "cdkDragFreeDragPosition"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { type: i2__namespace.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], pipes: { "isGanttRangeItem": IsGanttRangeItemPipe } });
1801
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0__namespace, type: GanttTableComponent, decorators: [{
1831
+ 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 });
1832
+ 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 } });
1833
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: GanttTableComponent, decorators: [{
1802
1834
  type: i0.Component,
1803
1835
  args: [{
1804
1836
  selector: 'gantt-table',
@@ -1839,6 +1871,36 @@
1839
1871
  args: ['class.gantt-table-empty']
1840
1872
  }] } });
1841
1873
 
1874
+ /** Cached result of whether the user's browser supports passive event listeners. */
1875
+ var supportsPassiveEvents;
1876
+ /**
1877
+ * Checks whether the user's browser supports passive event listeners.
1878
+ * See: https://github.com/WICG/EventListenerOptions/blob/gh-pages/explainer.md
1879
+ */
1880
+ function supportsPassiveEventListeners() {
1881
+ if (supportsPassiveEvents == null && typeof window !== 'undefined') {
1882
+ try {
1883
+ window.addEventListener('test', null, Object.defineProperty({}, 'passive', {
1884
+ get: function () { return (supportsPassiveEvents = true); }
1885
+ }));
1886
+ }
1887
+ finally {
1888
+ supportsPassiveEvents = supportsPassiveEvents || false;
1889
+ }
1890
+ }
1891
+ return supportsPassiveEvents;
1892
+ }
1893
+ /**
1894
+ * Normalizes an `AddEventListener` object to something that can be passed
1895
+ * to `addEventListener` on any browser, no matter whether it supports the
1896
+ * `options` parameter.
1897
+ */
1898
+ function normalizePassiveListenerOptions(options) {
1899
+ return supportsPassiveEventListeners() ? options : !!options.capture;
1900
+ }
1901
+ /** Options used to bind passive event listeners. */
1902
+ var passiveListenerOptions = normalizePassiveListenerOptions({ passive: true });
1903
+
1842
1904
  var scrollThreshold = 50;
1843
1905
  var ScrollDirection;
1844
1906
  (function (ScrollDirection) {
@@ -1847,25 +1909,27 @@
1847
1909
  ScrollDirection[ScrollDirection["RIGHT"] = 2] = "RIGHT";
1848
1910
  })(ScrollDirection || (ScrollDirection = {}));
1849
1911
  var GanttDomService = /** @class */ (function () {
1850
- function GanttDomService() {
1912
+ function GanttDomService(ngZone, platformId) {
1913
+ this.ngZone = ngZone;
1914
+ this.platformId = platformId;
1851
1915
  this.unsubscribe$ = new rxjs.Subject();
1852
1916
  }
1853
1917
  GanttDomService.prototype.monitorScrollChange = function () {
1854
1918
  var _this = this;
1855
- rxjs.merge(rxjs.fromEvent(this.mainContainer, 'scroll'), rxjs.fromEvent(this.sideContainer, 'scroll'))
1856
- .pipe(operators.takeUntil(this.unsubscribe$))
1919
+ this.ngZone.runOutsideAngular(function () { return rxjs.merge(rxjs.fromEvent(_this.mainContainer, 'scroll', passiveListenerOptions), rxjs.fromEvent(_this.sideContainer, 'scroll', passiveListenerOptions))
1920
+ .pipe(operators.takeUntil(_this.unsubscribe$))
1857
1921
  .subscribe(function (event) {
1858
1922
  _this.syncScroll(event);
1859
- });
1860
- rxjs.fromEvent(this.mainContainer, 'scroll')
1861
- .pipe(operators.startWith(), operators.takeUntil(this.unsubscribe$))
1862
- .subscribe(function (event) {
1863
- // if (this.mainContainer.scrollLeft > 0) {
1864
- // this.side.classList.add('gantt-side-has-shadow');
1865
- // } else {
1866
- // this.side.classList.remove('gantt-side-has-shadow');
1867
- // }
1868
- });
1923
+ }); });
1924
+ // fromEvent(this.mainContainer, 'scroll')
1925
+ // .pipe(startWith(), takeUntil(this.unsubscribe$))
1926
+ // .subscribe((event) => {
1927
+ // // if (this.mainContainer.scrollLeft > 0) {
1928
+ // // this.side.classList.add('gantt-side-has-shadow');
1929
+ // // } else {
1930
+ // // this.side.classList.remove('gantt-side-has-shadow');
1931
+ // // }
1932
+ // });
1869
1933
  };
1870
1934
  GanttDomService.prototype.syncScroll = function (event) {
1871
1935
  var target = event.currentTarget;
@@ -1874,9 +1938,10 @@
1874
1938
  this.mainContainer.scrollTop = target.scrollTop;
1875
1939
  };
1876
1940
  GanttDomService.prototype.disableBrowserWheelEvent = function () {
1941
+ var _this = this;
1877
1942
  var container = this.mainContainer;
1878
- rxjs.fromEvent(container, 'wheel')
1879
- .pipe(operators.takeUntil(this.unsubscribe$))
1943
+ this.ngZone.runOutsideAngular(function () { return rxjs.fromEvent(container, 'wheel')
1944
+ .pipe(operators.takeUntil(_this.unsubscribe$))
1880
1945
  .subscribe(function (event) {
1881
1946
  var delta = event.deltaX;
1882
1947
  if (!delta) {
@@ -1886,7 +1951,7 @@
1886
1951
  (container.scrollLeft === 0 && delta < 0)) {
1887
1952
  event.preventDefault();
1888
1953
  }
1889
- });
1954
+ }); });
1890
1955
  };
1891
1956
  GanttDomService.prototype.initialize = function (root) {
1892
1957
  this.root = root.nativeElement;
@@ -1898,9 +1963,14 @@
1898
1963
  this.monitorScrollChange();
1899
1964
  this.disableBrowserWheelEvent();
1900
1965
  };
1901
- GanttDomService.prototype.getViewerScroll = function () {
1966
+ /**
1967
+ * @returns An observable that will emit outside the Angular zone. Note, consumers should re-enter the Angular zone
1968
+ * to run the change detection if needed.
1969
+ */
1970
+ GanttDomService.prototype.getViewerScroll = function (options) {
1902
1971
  var _this = this;
1903
- return rxjs.fromEvent(this.mainContainer, 'scroll').pipe(operators.map(function () { return _this.mainContainer.scrollLeft; }), operators.pairwise(), operators.map(function (_a) {
1972
+ return new rxjs.Observable(function (subscriber) { return _this.ngZone.runOutsideAngular(function () { return rxjs.fromEvent(_this.mainContainer, 'scroll', options)
1973
+ .pipe(operators.map(function () { return _this.mainContainer.scrollLeft; }), operators.pairwise(), operators.map(function (_a) {
1904
1974
  var _b = __read(_a, 2), previous = _b[0], current = _b[1];
1905
1975
  var event = {
1906
1976
  target: _this.mainContainer,
@@ -1912,15 +1982,17 @@
1912
1982
  }
1913
1983
  }
1914
1984
  if (current - previous > 0) {
1915
- if (_this.mainContainer.scrollWidth - _this.mainContainer.clientWidth - _this.mainContainer.scrollLeft < scrollThreshold) {
1985
+ if (_this.mainContainer.scrollWidth - _this.mainContainer.clientWidth - _this.mainContainer.scrollLeft <
1986
+ scrollThreshold) {
1916
1987
  event.direction = ScrollDirection.RIGHT;
1917
1988
  }
1918
1989
  }
1919
1990
  return event;
1920
- }));
1991
+ }))
1992
+ .subscribe(subscriber); }); });
1921
1993
  };
1922
1994
  GanttDomService.prototype.getResize = function () {
1923
- return rxjs.fromEvent(window, 'resize').pipe(operators.auditTime(150));
1995
+ return i2.isPlatformServer(this.platformId) ? rxjs.EMPTY : rxjs.fromEvent(window, 'resize').pipe(operators.auditTime(150));
1924
1996
  };
1925
1997
  GanttDomService.prototype.scrollMainContainer = function (left) {
1926
1998
  if (isNumber(left)) {
@@ -1935,70 +2007,109 @@
1935
2007
  };
1936
2008
  return GanttDomService;
1937
2009
  }());
1938
- GanttDomService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0__namespace, type: GanttDomService, deps: [], target: i0__namespace.ɵɵFactoryTarget.Injectable });
1939
- GanttDomService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0__namespace, type: GanttDomService });
1940
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0__namespace, type: GanttDomService, decorators: [{
2010
+ GanttDomService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: GanttDomService, deps: [{ token: i0__namespace.NgZone }, { token: i0.PLATFORM_ID }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
2011
+ GanttDomService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: GanttDomService });
2012
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: GanttDomService, decorators: [{
1941
2013
  type: i0.Injectable
1942
- }], ctorParameters: function () { return []; } });
2014
+ }], ctorParameters: function () {
2015
+ return [{ type: i0__namespace.NgZone }, { type: undefined, decorators: [{
2016
+ type: i0.Inject,
2017
+ args: [i0.PLATFORM_ID]
2018
+ }] }];
2019
+ } });
1943
2020
 
2021
+ function getDependencyType(path, dependencyTypes) {
2022
+ if (dependencyTypes.includes(exports.GanttLinkType.ss) && path.from.pos === InBarPosition.start && path.to.pos === InBarPosition.start) {
2023
+ return exports.GanttLinkType.ss;
2024
+ }
2025
+ if (dependencyTypes.includes(exports.GanttLinkType.ff) && path.from.pos === InBarPosition.finish && path.to.pos === InBarPosition.finish) {
2026
+ return exports.GanttLinkType.ff;
2027
+ }
2028
+ if (dependencyTypes.includes(exports.GanttLinkType.sf) && path.from.pos === InBarPosition.start && path.to.pos === InBarPosition.finish) {
2029
+ return exports.GanttLinkType.sf;
2030
+ }
2031
+ return exports.GanttLinkType.fs;
2032
+ }
2033
+ var InBarPosition;
2034
+ (function (InBarPosition) {
2035
+ InBarPosition["start"] = "start";
2036
+ InBarPosition["finish"] = "finish";
2037
+ })(InBarPosition || (InBarPosition = {}));
1944
2038
  var GanttDragContainer = /** @class */ (function () {
1945
- function GanttDragContainer() {
2039
+ function GanttDragContainer(ganttUpper) {
2040
+ this.ganttUpper = ganttUpper;
1946
2041
  this.dragStarted = new i0.EventEmitter();
1947
2042
  this.dragMoved = new i0.EventEmitter();
1948
2043
  this.dragEnded = new i0.EventEmitter();
1949
2044
  this.linkDragStarted = new i0.EventEmitter();
1950
2045
  this.linkDragEntered = new i0.EventEmitter();
1951
2046
  this.linkDragEnded = new i0.EventEmitter();
2047
+ this.linkDragPath = { from: null, to: null };
1952
2048
  }
1953
- GanttDragContainer.prototype.emitLinkDragStarted = function (from, item) {
1954
- this.linkDraggingId = item.id;
1955
- this.linkDragFrom = from;
1956
- this.linkDragSource = this.linkDragFrom === 'source' ? item : null;
1957
- this.linkDragTarget = this.linkDragFrom === 'target' ? item : null;
2049
+ GanttDragContainer.prototype.emitLinkDragStarted = function (from) {
2050
+ this.linkDraggingId = from.item.id;
2051
+ this.linkDragPath.from = from;
1958
2052
  this.linkDragStarted.emit({
1959
- source: this.linkDragSource && this.linkDragSource.origin,
1960
- target: this.linkDragTarget && this.linkDragTarget.origin
2053
+ source: from.item.origin,
2054
+ target: null
1961
2055
  });
1962
2056
  };
1963
- GanttDragContainer.prototype.emitLinkDragEntered = function (item) {
1964
- if (this.linkDragFrom === 'source') {
1965
- this.linkDragTarget = item;
1966
- }
1967
- else {
1968
- this.linkDragSource = item;
1969
- }
2057
+ GanttDragContainer.prototype.emitLinkDragEntered = function (to) {
2058
+ this.linkDragPath.to = to;
1970
2059
  this.linkDragEntered.emit({
1971
- source: this.linkDragSource.origin,
1972
- target: this.linkDragTarget.origin
2060
+ source: this.linkDragPath.from.item.origin,
2061
+ target: to.item.origin
1973
2062
  });
1974
2063
  };
1975
2064
  GanttDragContainer.prototype.emitLinkDragLeaved = function () {
1976
- if (this.linkDragFrom === 'source') {
1977
- this.linkDragTarget = null;
1978
- }
1979
- else {
1980
- this.linkDragSource = null;
1981
- }
2065
+ this.linkDragPath.to = null;
1982
2066
  };
1983
- GanttDragContainer.prototype.emitLinkDragEnded = function () {
2067
+ GanttDragContainer.prototype.emitLinkDragEnded = function (to) {
2068
+ var _a;
2069
+ this.linkDragPath.to = to;
2070
+ var dependencyType = getDependencyType(this.linkDragPath, (_a = this.ganttUpper.linkOptions) === null || _a === void 0 ? void 0 : _a.dependencyTypes);
2071
+ this.linkDragPath.from.item.addLink({
2072
+ link: this.linkDragPath.to.item.id,
2073
+ type: dependencyType
2074
+ });
2075
+ this.linkDragEnded.emit({
2076
+ source: this.linkDragPath.from.item.origin,
2077
+ target: this.linkDragPath.to.item.origin,
2078
+ type: dependencyType
2079
+ });
1984
2080
  this.linkDraggingId = null;
1985
- if (this.linkDragSource && this.linkDragTarget) {
1986
- this.linkDragSource.addLink(this.linkDragTarget.id);
1987
- this.linkDragEnded.emit({
1988
- source: this.linkDragSource.origin,
1989
- target: this.linkDragTarget.origin
1990
- });
1991
- }
1992
- this.linkDragSource = null;
1993
- this.linkDragTarget = null;
2081
+ this.linkDragPath = { from: null, to: null };
1994
2082
  };
1995
2083
  return GanttDragContainer;
1996
2084
  }());
1997
- GanttDragContainer.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0__namespace, type: GanttDragContainer, deps: [], target: i0__namespace.ɵɵFactoryTarget.Injectable });
1998
- GanttDragContainer.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0__namespace, type: GanttDragContainer });
1999
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0__namespace, type: GanttDragContainer, decorators: [{
2085
+ 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 });
2086
+ GanttDragContainer.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: GanttDragContainer });
2087
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: GanttDragContainer, decorators: [{
2000
2088
  type: i0.Injectable
2001
- }], ctorParameters: function () { return []; } });
2089
+ }], ctorParameters: function () {
2090
+ return [{ type: GanttUpper, decorators: [{
2091
+ type: i0.Inject,
2092
+ args: [GANTT_UPPER_TOKEN]
2093
+ }] }];
2094
+ } });
2095
+
2096
+ var GanttDragBackdropComponent = /** @class */ (function () {
2097
+ function GanttDragBackdropComponent() {
2098
+ }
2099
+ return GanttDragBackdropComponent;
2100
+ }());
2101
+ GanttDragBackdropComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: GanttDragBackdropComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
2102
+ GanttDragBackdropComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.1.5", type: GanttDragBackdropComponent, selector: "gantt-drag-backdrop", host: { classAttribute: "gantt-drag-backdrop" }, 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" });
2103
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: GanttDragBackdropComponent, decorators: [{
2104
+ type: i0.Component,
2105
+ args: [{
2106
+ selector: 'gantt-drag-backdrop',
2107
+ templateUrl: "./drag-backdrop.component.html",
2108
+ host: {
2109
+ class: 'gantt-drag-backdrop'
2110
+ }
2111
+ }]
2112
+ }] });
2002
2113
 
2003
2114
  var GanttPrintService = /** @class */ (function () {
2004
2115
  function GanttPrintService() {
@@ -2069,61 +2180,71 @@
2069
2180
  this.mainContainer = this.root.getElementsByClassName('gantt-main-container')[0];
2070
2181
  };
2071
2182
  GanttPrintService.prototype.print = function (name, ignoreElementClass) {
2072
- var _this = this;
2073
2183
  if (name === void 0) { name = 'download'; }
2074
- var root = this.root;
2075
- var mainContainer = this.mainContainer;
2076
- // set print width
2077
- var printWidth = root.offsetWidth;
2078
- // set print height
2079
- var printHeight = root.offsetHeight - mainContainer.offsetHeight + mainContainer.scrollHeight;
2080
- html2canvas__default['default'](root, {
2081
- logging: false,
2082
- allowTaint: true,
2083
- useCORS: true,
2084
- width: printWidth,
2085
- height: printHeight,
2086
- ignoreElements: function (element) {
2087
- if (ignoreElementClass && element.classList.contains(ignoreElementClass)) {
2088
- return true;
2089
- }
2090
- if (element.classList.contains('gantt-calendar-today-overlay')) {
2091
- return true;
2092
- }
2093
- },
2094
- onclone: function (cloneDocument) {
2095
- var ganttClass = root.className;
2096
- var cloneGanttDom = cloneDocument.querySelector("." + ganttClass.replace(/\s+/g, '.'));
2097
- var cloneGanttContainerDom = cloneDocument.querySelector('.gantt-container');
2098
- var cloneCalendarOverlay = cloneDocument.querySelector('.gantt-calendar-overlay-main');
2099
- var cloneLinksOverlay = cloneDocument.querySelector('.gantt-links-overlay-main');
2100
- // change targetDom width
2101
- cloneGanttDom.style.width = printWidth + "px";
2102
- cloneGanttDom.style.height = printHeight + "px";
2103
- cloneGanttDom.style.overflow = "unset";
2104
- cloneGanttContainerDom.style.backgroundColor = '#fff';
2105
- cloneCalendarOverlay.setAttribute('height', "" + printHeight);
2106
- cloneCalendarOverlay.setAttribute('style', "background: transparent");
2107
- if (cloneLinksOverlay) {
2108
- cloneLinksOverlay.setAttribute('height', "" + printHeight);
2109
- cloneLinksOverlay.setAttribute('style', "height: " + printHeight + "px");
2184
+ return __awaiter(this, void 0, void 0, function () {
2185
+ var root, mainContainer, printWidth, printHeight, html2canvas;
2186
+ var _this = this;
2187
+ return __generator(this, function (_a) {
2188
+ switch (_a.label) {
2189
+ case 0:
2190
+ root = this.root;
2191
+ mainContainer = this.mainContainer;
2192
+ printWidth = root.offsetWidth;
2193
+ printHeight = root.offsetHeight - mainContainer.offsetHeight + mainContainer.scrollHeight;
2194
+ return [4 /*yield*/, import(/* webpackChunkName: 'html2canvas' */ 'html2canvas')];
2195
+ case 1:
2196
+ html2canvas = (_a.sent()).default;
2197
+ html2canvas(root, {
2198
+ logging: false,
2199
+ allowTaint: true,
2200
+ useCORS: true,
2201
+ width: printWidth,
2202
+ height: printHeight,
2203
+ ignoreElements: function (element) {
2204
+ if (ignoreElementClass && element.classList.contains(ignoreElementClass)) {
2205
+ return true;
2206
+ }
2207
+ if (element.classList.contains('gantt-calendar-today-overlay')) {
2208
+ return true;
2209
+ }
2210
+ },
2211
+ onclone: function (cloneDocument) {
2212
+ var ganttClass = root.className;
2213
+ var cloneGanttDom = cloneDocument.querySelector("." + ganttClass.replace(/\s+/g, '.'));
2214
+ var cloneGanttContainerDom = cloneDocument.querySelector('.gantt-container');
2215
+ var cloneCalendarOverlay = cloneDocument.querySelector('.gantt-calendar-overlay-main');
2216
+ var cloneLinksOverlay = cloneDocument.querySelector('.gantt-links-overlay-main');
2217
+ // change targetDom width
2218
+ cloneGanttDom.style.width = printWidth + "px";
2219
+ cloneGanttDom.style.height = printHeight + "px";
2220
+ cloneGanttDom.style.overflow = "unset";
2221
+ cloneGanttContainerDom.style.backgroundColor = '#fff';
2222
+ cloneCalendarOverlay.setAttribute('height', "" + printHeight);
2223
+ cloneCalendarOverlay.setAttribute('style', "background: transparent");
2224
+ if (cloneLinksOverlay) {
2225
+ cloneLinksOverlay.setAttribute('height', "" + printHeight);
2226
+ cloneLinksOverlay.setAttribute('style', "height: " + printHeight + "px");
2227
+ }
2228
+ // setInlineStyles for svg
2229
+ _this.setInlineStyles(cloneGanttDom);
2230
+ }
2231
+ }).then(function (canvas) {
2232
+ var link = document.createElement('a');
2233
+ var dataUrl = canvas.toDataURL('image/png');
2234
+ link.download = name + ".png";
2235
+ link.href = dataUrl;
2236
+ link.click();
2237
+ });
2238
+ return [2 /*return*/];
2110
2239
  }
2111
- // setInlineStyles for svg
2112
- _this.setInlineStyles(cloneGanttDom);
2113
- }
2114
- }).then(function (canvas) {
2115
- var link = document.createElement('a');
2116
- var dataUrl = canvas.toDataURL('image/png');
2117
- link.download = name + ".png";
2118
- link.href = dataUrl;
2119
- link.click();
2240
+ });
2120
2241
  });
2121
2242
  };
2122
2243
  return GanttPrintService;
2123
2244
  }());
2124
- GanttPrintService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0__namespace, type: GanttPrintService, deps: [], target: i0__namespace.ɵɵFactoryTarget.Injectable });
2125
- GanttPrintService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0__namespace, type: GanttPrintService });
2126
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0__namespace, type: GanttPrintService, decorators: [{
2245
+ GanttPrintService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: GanttPrintService, deps: [], target: i0__namespace.ɵɵFactoryTarget.Injectable });
2246
+ GanttPrintService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: GanttPrintService });
2247
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: GanttPrintService, decorators: [{
2127
2248
  type: i0.Injectable
2128
2249
  }], ctorParameters: function () { return []; } });
2129
2250
 
@@ -2133,7 +2254,6 @@
2133
2254
  this.ganttUpper = ganttUpper;
2134
2255
  this.ngZone = ngZone;
2135
2256
  this.elementRef = elementRef;
2136
- this.unsubscribe$ = new rxjs.Subject();
2137
2257
  this.headerHeight = headerHeight;
2138
2258
  this.mainHeight = mainHeight;
2139
2259
  this.todayHeight = todayHeight;
@@ -2141,6 +2261,7 @@
2141
2261
  this.todayBorderRadius = todayBorderRadius;
2142
2262
  this.viewTypes = exports.GanttViewType;
2143
2263
  this.className = true;
2264
+ this.unsubscribe$ = new rxjs.Subject();
2144
2265
  }
2145
2266
  Object.defineProperty(GanttCalendarComponent.prototype, "view", {
2146
2267
  get: function () {
@@ -2173,16 +2294,21 @@
2173
2294
  };
2174
2295
  GanttCalendarComponent.prototype.ngOnInit = function () {
2175
2296
  var _this = this;
2176
- this.ngZone.onStable.pipe(operators.take(1)).subscribe(function () {
2177
- rxjs.merge(_this.ganttUpper.viewChange, _this.ganttUpper.view.start$)
2178
- .pipe(operators.takeUntil(_this.unsubscribe$))
2179
- .subscribe(function () {
2180
- _this.setTodayPoint();
2297
+ // Note: the zone may be nooped through `BootstrapOptions` when bootstrapping the root module. This means
2298
+ // the `onStable` will never emit any value.
2299
+ var onStable$ = this.ngZone.isStable ? rxjs.from(Promise.resolve()) : this.ngZone.onStable.pipe(operators.take(1));
2300
+ // Normally this isn't in the zone, but it can cause performance regressions for apps
2301
+ // using `zone-patch-rxjs` because it'll trigger a change detection when it unsubscribes.
2302
+ this.ngZone.runOutsideAngular(function () {
2303
+ onStable$.pipe(operators.takeUntil(_this.unsubscribe$)).subscribe(function () {
2304
+ rxjs.merge(_this.ganttUpper.viewChange, _this.ganttUpper.view.start$)
2305
+ .pipe(operators.takeUntil(_this.unsubscribe$))
2306
+ .subscribe(function () {
2307
+ _this.setTodayPoint();
2308
+ });
2181
2309
  });
2182
2310
  });
2183
2311
  };
2184
- GanttCalendarComponent.prototype.ngAfterViewInit = function () { };
2185
- GanttCalendarComponent.prototype.ngOnChanges = function (changes) { };
2186
2312
  GanttCalendarComponent.prototype.trackBy = function (index, point) {
2187
2313
  return point.text || index;
2188
2314
  };
@@ -2192,9 +2318,9 @@
2192
2318
  };
2193
2319
  return GanttCalendarComponent;
2194
2320
  }());
2195
- GanttCalendarComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0__namespace, type: GanttCalendarComponent, deps: [{ token: GANTT_UPPER_TOKEN }, { token: i0__namespace.NgZone }, { token: i0__namespace.ElementRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
2196
- GanttCalendarComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.1.2", 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"] }] });
2197
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0__namespace, type: GanttCalendarComponent, decorators: [{
2321
+ 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 });
2322
+ 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" } }, 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"] }] });
2323
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: GanttCalendarComponent, decorators: [{
2198
2324
  type: i0.Component,
2199
2325
  args: [{
2200
2326
  selector: 'gantt-calendar-overlay',
@@ -2210,26 +2336,6 @@
2210
2336
  args: ['class.gantt-calendar-overlay']
2211
2337
  }] } });
2212
2338
 
2213
- var GanttDragBackdropComponent = /** @class */ (function () {
2214
- function GanttDragBackdropComponent() {
2215
- this.backdropClass = true;
2216
- }
2217
- GanttDragBackdropComponent.prototype.ngOnInit = function () { };
2218
- return GanttDragBackdropComponent;
2219
- }());
2220
- GanttDragBackdropComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0__namespace, type: GanttDragBackdropComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
2221
- GanttDragBackdropComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.1.2", 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" });
2222
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0__namespace, type: GanttDragBackdropComponent, decorators: [{
2223
- type: i0.Component,
2224
- args: [{
2225
- selector: 'gantt-drag-backdrop',
2226
- templateUrl: "./drag-backdrop.component.html"
2227
- }]
2228
- }], ctorParameters: function () { return []; }, propDecorators: { backdropClass: [{
2229
- type: i0.HostBinding,
2230
- args: ['class.gantt-drag-backdrop']
2231
- }] } });
2232
-
2233
2339
  var NgxGanttRootComponent = /** @class */ (function () {
2234
2340
  function NgxGanttRootComponent(elementRef, ngZone, dom, dragContainer, ganttUpper, printService) {
2235
2341
  this.elementRef = elementRef;
@@ -2238,7 +2344,6 @@
2238
2344
  this.dragContainer = dragContainer;
2239
2345
  this.ganttUpper = ganttUpper;
2240
2346
  this.printService = printService;
2241
- this.ganttClass = true;
2242
2347
  this.unsubscribe$ = new rxjs.Subject();
2243
2348
  this.ganttUpper.dragContainer = dragContainer;
2244
2349
  }
@@ -2251,45 +2356,53 @@
2251
2356
  });
2252
2357
  NgxGanttRootComponent.prototype.ngOnInit = function () {
2253
2358
  var _this = this;
2254
- this.ngZone.onStable.pipe(operators.take(1)).subscribe(function () {
2255
- _this.dom.initialize(_this.elementRef);
2256
- if (_this.printService) {
2257
- _this.printService.register(_this.elementRef);
2258
- }
2259
- _this.setupScrollClass();
2260
- _this.setupResize();
2261
- _this.setupViewScroll();
2262
- // 优化初始化时Scroll滚动体验问题,通过透明度解决,默认透明度为0,滚动结束后恢复
2263
- _this.elementRef.nativeElement.style.opacity = '1';
2264
- _this.ganttUpper.viewChange.pipe(operators.startWith(null)).subscribe(function () {
2265
- _this.scrollToToday();
2359
+ // Note: the zone may be nooped through `BootstrapOptions` when bootstrapping the root module. This means
2360
+ // the `onStable` will never emit any value.
2361
+ var onStable$ = this.ngZone.isStable ? rxjs.from(Promise.resolve()) : this.ngZone.onStable.pipe(operators.take(1));
2362
+ // Normally this isn't in the zone, but it can cause performance regressions for apps
2363
+ // using `zone-patch-rxjs` because it'll trigger a change detection when it unsubscribes.
2364
+ this.ngZone.runOutsideAngular(function () {
2365
+ onStable$.pipe(operators.takeUntil(_this.unsubscribe$)).subscribe(function () {
2366
+ _this.dom.initialize(_this.elementRef);
2367
+ if (_this.printService) {
2368
+ _this.printService.register(_this.elementRef);
2369
+ }
2370
+ _this.setupScrollClass();
2371
+ _this.setupResize();
2372
+ _this.setupViewScroll();
2373
+ // 优化初始化时Scroll滚动体验问题,通过透明度解决,默认透明度为0,滚动结束后恢复
2374
+ _this.elementRef.nativeElement.style.opacity = '1';
2375
+ _this.ganttUpper.viewChange.pipe(operators.startWith(null), operators.takeUntil(_this.unsubscribe$)).subscribe(function () {
2376
+ _this.scrollToToday();
2377
+ });
2266
2378
  });
2267
2379
  });
2268
2380
  };
2381
+ NgxGanttRootComponent.prototype.ngOnDestroy = function () {
2382
+ this.unsubscribe$.next();
2383
+ };
2269
2384
  NgxGanttRootComponent.prototype.setupViewScroll = function () {
2270
2385
  var _this = this;
2271
2386
  if (this.ganttUpper.disabledLoadOnScroll) {
2272
2387
  return;
2273
2388
  }
2274
2389
  this.dom
2275
- .getViewerScroll()
2390
+ .getViewerScroll(passiveListenerOptions)
2276
2391
  .pipe(operators.takeUntil(this.unsubscribe$))
2277
2392
  .subscribe(function (event) {
2278
2393
  if (event.direction === ScrollDirection.LEFT) {
2279
2394
  var dates_1 = _this.view.addStartDate();
2280
2395
  if (dates_1) {
2281
2396
  event.target.scrollLeft += _this.view.getDateRangeWidth(dates_1.start, dates_1.end);
2282
- _this.ngZone.run(function () {
2283
- _this.ganttUpper.loadOnScroll.emit({ start: dates_1.start.getUnixTime(), end: dates_1.end.getUnixTime() });
2284
- });
2397
+ if (_this.ganttUpper.loadOnScroll.observers) {
2398
+ _this.ngZone.run(function () { return _this.ganttUpper.loadOnScroll.emit({ start: dates_1.start.getUnixTime(), end: dates_1.end.getUnixTime() }); });
2399
+ }
2285
2400
  }
2286
2401
  }
2287
2402
  if (event.direction === ScrollDirection.RIGHT) {
2288
2403
  var dates_2 = _this.view.addEndDate();
2289
- if (dates_2) {
2290
- _this.ngZone.run(function () {
2291
- _this.ganttUpper.loadOnScroll.emit({ start: dates_2.start.getUnixTime(), end: dates_2.end.getUnixTime() });
2292
- });
2404
+ if (dates_2 && _this.ganttUpper.loadOnScroll.observers) {
2405
+ _this.ngZone.run(function () { return _this.ganttUpper.loadOnScroll.emit({ start: dates_2.start.getUnixTime(), end: dates_2.end.getUnixTime() }); });
2293
2406
  }
2294
2407
  }
2295
2408
  });
@@ -2320,14 +2433,17 @@
2320
2433
  };
2321
2434
  return NgxGanttRootComponent;
2322
2435
  }());
2323
- NgxGanttRootComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.2", 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 });
2324
- NgxGanttRootComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.1.2", 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"] }] });
2325
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0__namespace, type: NgxGanttRootComponent, decorators: [{
2436
+ 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 });
2437
+ NgxGanttRootComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.1.5", type: NgxGanttRootComponent, selector: "ngx-gantt-root", inputs: { sideWidth: "sideWidth" }, host: { classAttribute: "gantt" }, providers: [GanttDomService, GanttDragContainer], queries: [{ propertyName: "sideTemplate", first: true, predicate: ["sideTemplate"], descendants: true, static: true }, { propertyName: "mainTemplate", first: true, predicate: ["mainTemplate"], descendants: true, static: true }], viewQueries: [{ propertyName: "backdrop", first: true, predicate: GanttDragBackdropComponent, descendants: true, read: i0.ElementRef, 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"] }] });
2438
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: NgxGanttRootComponent, decorators: [{
2326
2439
  type: i0.Component,
2327
2440
  args: [{
2328
2441
  selector: 'ngx-gantt-root',
2329
2442
  templateUrl: './root.component.html',
2330
- providers: [GanttDomService, GanttDragContainer]
2443
+ providers: [GanttDomService, GanttDragContainer],
2444
+ host: {
2445
+ class: 'gantt'
2446
+ }
2331
2447
  }]
2332
2448
  }], ctorParameters: function () {
2333
2449
  return [{ type: i0__namespace.ElementRef }, { type: i0__namespace.NgZone }, { type: GanttDomService }, { type: GanttDragContainer }, { type: GanttUpper, decorators: [{
@@ -2338,31 +2454,31 @@
2338
2454
  }] }];
2339
2455
  }, propDecorators: { sideWidth: [{
2340
2456
  type: i0.Input
2341
- }], ganttClass: [{
2342
- type: i0.HostBinding,
2343
- args: ['class.gantt']
2344
2457
  }], sideTemplate: [{
2345
2458
  type: i0.ContentChild,
2346
2459
  args: ['sideTemplate', { static: true }]
2347
2460
  }], mainTemplate: [{
2348
2461
  type: i0.ContentChild,
2349
2462
  args: ['mainTemplate', { static: true }]
2463
+ }], backdrop: [{
2464
+ type: i0.ViewChild,
2465
+ args: [GanttDragBackdropComponent, { static: true, read: i0.ElementRef }]
2350
2466
  }] } });
2351
2467
 
2352
- var GanttLinkPath = /** @class */ (function () {
2353
- function GanttLinkPath() {
2468
+ var GanttLinkLine = /** @class */ (function () {
2469
+ function GanttLinkLine() {
2354
2470
  }
2355
- GanttLinkPath.prototype.generatePath = function (source, target, type) {
2471
+ GanttLinkLine.prototype.generatePath = function (source, target, type) {
2356
2472
  if (source.before && source.after && target.before && target.after) {
2357
2473
  var path = '';
2358
2474
  switch (type) {
2359
- case GanttLinkType.ss:
2475
+ case exports.GanttLinkType.ss:
2360
2476
  path = this.generateSSPath(source, target);
2361
2477
  break;
2362
- case GanttLinkType.ff:
2478
+ case exports.GanttLinkType.ff:
2363
2479
  path = this.generateFFPath(source, target);
2364
2480
  break;
2365
- case GanttLinkType.sf:
2481
+ case exports.GanttLinkType.sf:
2366
2482
  path = this.generateFSAndSFPath(source, target, type);
2367
2483
  break;
2368
2484
  default:
@@ -2371,23 +2487,17 @@
2371
2487
  return path;
2372
2488
  }
2373
2489
  };
2374
- return GanttLinkPath;
2490
+ return GanttLinkLine;
2375
2491
  }());
2376
- GanttLinkPath.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0__namespace, type: GanttLinkPath, deps: [], target: i0__namespace.ɵɵFactoryTarget.Injectable });
2377
- GanttLinkPath.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0__namespace, type: GanttLinkPath });
2378
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0__namespace, type: GanttLinkPath, decorators: [{
2379
- type: i0.Injectable
2380
- }], ctorParameters: function () { return []; } });
2381
2492
 
2382
- var GanttLinkPathCurve = /** @class */ (function (_super) {
2383
- __extends(GanttLinkPathCurve, _super);
2384
- function GanttLinkPathCurve(ganttUpper) {
2493
+ var GanttLinkLineCurve = /** @class */ (function (_super) {
2494
+ __extends(GanttLinkLineCurve, _super);
2495
+ function GanttLinkLineCurve(ganttUpper) {
2385
2496
  var _this = _super.call(this) || this;
2386
2497
  _this.ganttUpper = ganttUpper;
2387
- _this.bezierWeight = -0.5;
2388
2498
  return _this;
2389
2499
  }
2390
- GanttLinkPathCurve.prototype.generateSSPath = function (source, target) {
2500
+ GanttLinkLineCurve.prototype.generateSSPath = function (source, target) {
2391
2501
  var x1 = source.before.x;
2392
2502
  var y1 = source.before.y;
2393
2503
  var x4 = target.before.x;
@@ -2401,7 +2511,7 @@
2401
2511
  return "M " + x1 + " " + y1 + "\n L " + x4 + " " + y1 + "\n A " + radius + " " + radius + " 0 1 " + isMirror + " " + x4 + " " + y4;
2402
2512
  }
2403
2513
  };
2404
- GanttLinkPathCurve.prototype.generateFFPath = function (source, target) {
2514
+ GanttLinkLineCurve.prototype.generateFFPath = function (source, target) {
2405
2515
  var x1 = source.after.x;
2406
2516
  var y1 = source.after.y;
2407
2517
  var x4 = target.after.x;
@@ -2415,75 +2525,65 @@
2415
2525
  return "M " + x1 + " " + y1 + "\n A " + radius + " " + radius + " 0 1 " + isMirror + " " + x1 + " " + y4 + "\n L " + x4 + " " + y4;
2416
2526
  }
2417
2527
  };
2418
- GanttLinkPathCurve.prototype.generateFSAndSFPath = function (source, target, type) {
2528
+ GanttLinkLineCurve.prototype.generateFSAndSFPath = function (source, target, type) {
2529
+ var _a;
2419
2530
  var x1 = source.after.x;
2420
2531
  var y1 = source.after.y;
2421
2532
  var x4 = target.before.x;
2422
2533
  var y4 = target.before.y;
2423
- if (type === GanttLinkType.sf) {
2534
+ var bezierWeight = 0.5;
2535
+ if (type === exports.GanttLinkType.sf) {
2424
2536
  x1 = target.after.x;
2425
2537
  y1 = target.after.y;
2426
2538
  x4 = source.before.x;
2427
2539
  y4 = source.before.y;
2428
2540
  }
2429
- var dx = Math.abs(x4 - x1) * this.bezierWeight;
2430
- var x2 = x1 - dx;
2431
- var x3 = x4 + dx;
2541
+ var dx = Math.abs(x4 - x1) * bezierWeight;
2542
+ var x2 = x1 + dx;
2543
+ var x3 = x4 - dx;
2432
2544
  var centerX = (x1 + x4) / 2;
2433
2545
  var centerY = (y1 + y4) / 2;
2434
2546
  var controlX = this.ganttUpper.styles.lineHeight / 2;
2435
2547
  var controlY = this.ganttUpper.styles.lineHeight / 2;
2436
2548
  if (x1 >= x4) {
2437
- if (y4 > y1) {
2438
- if (Math.abs(y4 - y1) <= this.ganttUpper.styles.lineHeight) {
2439
- return "M " + x1 + " " + y1 + "\n C " + (x1 + controlX) + " " + y1 + " " + (x1 + controlX) + " " + (y1 + controlX) + " " + x1 + " " + (y1 + controlY) + "\n L " + x4 + " " + (y4 - controlY) + "\n C " + (x4 - controlY) + " " + (y4 - controlY) + " " + (x4 - controlX) + " " + y4 + " " + x4 + " " + y4;
2440
- }
2441
- else {
2442
- controlX = this.ganttUpper.styles.lineHeight;
2443
- return "M " + x1 + " " + y1 + "\n C " + (x1 + controlX) + " " + y1 + " " + (x1 + controlX) + " " + (y1 + controlX) + " " + centerX + " " + centerY + "\n C " + (x4 - controlX) + " " + (y4 - controlX) + " " + (x4 - controlX) + " " + y4 + " " + x4 + " " + y4 + "\n ";
2444
- }
2549
+ if (Math.abs(y4 - y1) <= this.ganttUpper.styles.lineHeight) {
2550
+ 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 ";
2445
2551
  }
2446
2552
  else {
2447
- if (Math.abs(y4 - y1) <= this.ganttUpper.styles.lineHeight) {
2448
- return "M " + x1 + " " + y1 + "\n C " + (x1 + controlX) + " " + y1 + " " + (x1 + controlX) + " " + (y1 - controlX) + " " + x1 + " " + (y1 - controlY) + "\n L " + x4 + " " + (y4 + controlY) + "\n C " + (x4 - controlY) + " " + (y4 + controlY) + " " + (x4 - controlX) + " " + y4 + " " + x4 + " " + y4 + "\n ";
2449
- }
2450
- else {
2451
- controlX = this.ganttUpper.styles.lineHeight;
2452
- return "M " + x1 + " " + y1 + "\n C " + (x1 + controlX) + " " + y1 + " " + (x1 + controlX) + " " + (y1 - controlX) + " " + centerX + " " + centerY + "\n C " + (x4 - controlX) + " " + (y4 + controlX) + " " + (x4 - controlX) + " " + y4 + " " + x4 + " " + y4 + "\n ";
2453
- }
2553
+ controlX = this.ganttUpper.styles.lineHeight;
2554
+ 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 ";
2454
2555
  }
2455
2556
  }
2456
- else if (x4 - x1 < 100) {
2457
- var radius = Math.abs(y4 - y1) / 4;
2458
- var lindWidth = x4 - x1 - radius;
2459
- lindWidth = Math.max(lindWidth, radius);
2460
- return "M " + x1 + " " + y1 + "\n L " + (x1 + lindWidth) + " " + y1 + "\n A " + radius + " " + radius + " 0 1 " + (y4 > y1 ? 1 : 0) + " " + (x1 + lindWidth) + " " + (y4 > y1 ? y1 + 2 * radius : y1 - 2 * radius) + "\n L " + (x4 - lindWidth) + " " + (y4 > y1 ? y1 + 2 * radius : y1 - 2 * radius) + "\n A " + radius + " " + radius + " 0 1 " + (y4 > y1 ? 0 : 1) + " " + (x4 - lindWidth) + " " + y4 + "\n L " + x4 + " " + y4 + "\n ";
2557
+ else if (((_a = this.ganttUpper.linkOptions) === null || _a === void 0 ? void 0 : _a.showArrow) && x4 - x1 < 200) {
2558
+ dx = Math.max(Math.abs(y4 - y1) * bezierWeight, 60);
2559
+ x2 = x1 + dx;
2560
+ x3 = x4 - dx;
2561
+ return "M " + x1 + " " + y1 + " C " + x2 + " " + y1 + " " + x3 + " " + y4 + " " + x4 + " " + y4;
2461
2562
  }
2462
2563
  return "M " + x1 + " " + y1 + " C " + x2 + " " + y1 + " " + x3 + " " + y4 + " " + x4 + " " + y4;
2463
2564
  };
2464
- return GanttLinkPathCurve;
2465
- }(GanttLinkPath));
2466
- GanttLinkPathCurve = __decorate([
2565
+ return GanttLinkLineCurve;
2566
+ }(GanttLinkLine));
2567
+ GanttLinkLineCurve = __decorate([
2467
2568
  __param(0, i0.Inject(GANTT_UPPER_TOKEN))
2468
- ], GanttLinkPathCurve);
2569
+ ], GanttLinkLineCurve);
2469
2570
 
2470
- var GanttLinkPathLine = /** @class */ (function (_super) {
2471
- __extends(GanttLinkPathLine, _super);
2472
- function GanttLinkPathLine() {
2571
+ var GanttLinkLineStraight = /** @class */ (function (_super) {
2572
+ __extends(GanttLinkLineStraight, _super);
2573
+ function GanttLinkLineStraight() {
2473
2574
  var _this = _super.call(this) || this;
2474
2575
  _this.pathControl = 20;
2475
2576
  return _this;
2476
2577
  }
2477
- GanttLinkPathLine.prototype.generateSSPath = function (source, target) {
2578
+ GanttLinkLineStraight.prototype.generateSSPath = function (source, target) {
2478
2579
  var x1 = source.before.x;
2479
2580
  var y1 = source.before.y;
2480
2581
  var x4 = target.before.x;
2481
2582
  var y4 = target.before.y;
2482
2583
  var control = this.pathControl;
2483
- var centerY = (y1 + y4) / 2;
2484
2584
  return "M " + x1 + " " + y1 + "\n L " + (x4 > x1 ? x1 - control : x4 - control) + " " + y1 + "\n L " + (x4 > x1 ? x1 - control : x4 - control) + " " + y4 + "\n L " + x4 + " " + y4;
2485
2585
  };
2486
- GanttLinkPathLine.prototype.generateFFPath = function (source, target) {
2586
+ GanttLinkLineStraight.prototype.generateFFPath = function (source, target) {
2487
2587
  var x1 = source.after.x;
2488
2588
  var y1 = source.after.y;
2489
2589
  var x4 = target.after.x;
@@ -2491,13 +2591,13 @@
2491
2591
  var control = this.pathControl;
2492
2592
  return "M " + x1 + " " + y1 + "\n L " + (x4 > x1 ? x4 + control : x1 + control) + " " + y1 + "\n L " + (x4 > x1 ? x4 + control : x1 + control) + " " + y4 + "\n L " + x4 + " " + y4;
2493
2593
  };
2494
- GanttLinkPathLine.prototype.generateFSAndSFPath = function (source, target, type) {
2594
+ GanttLinkLineStraight.prototype.generateFSAndSFPath = function (source, target, type) {
2495
2595
  var x1 = source.after.x;
2496
2596
  var y1 = source.after.y;
2497
2597
  var x4 = target.before.x;
2498
2598
  var y4 = target.before.y;
2499
2599
  var control = this.pathControl;
2500
- if (type === GanttLinkType.sf) {
2600
+ if (type === exports.GanttLinkType.sf) {
2501
2601
  x1 = target.after.x;
2502
2602
  y1 = target.after.y;
2503
2603
  x4 = source.before.x;
@@ -2510,15 +2610,15 @@
2510
2610
  return "M " + x1 + " " + y1 + "\n L " + (x1 + control) + " " + y1 + "\n L " + (x1 + control) + " " + (y4 > y1 ? y1 + control : y1 - control) + "\n L " + (x4 - control) + " " + (y4 > y1 ? y1 + control : y1 - control) + "\n L " + (x4 - control) + " " + y4 + "\n L " + x4 + " " + y4;
2511
2611
  }
2512
2612
  };
2513
- return GanttLinkPathLine;
2514
- }(GanttLinkPath));
2613
+ return GanttLinkLineStraight;
2614
+ }(GanttLinkLine));
2515
2615
 
2516
- function generatePathFactory(type, ganttUpper) {
2616
+ function createLineGenerator(type, ganttUpper) {
2517
2617
  switch (type) {
2518
- case GanttLinkPathType.curve:
2519
- return new GanttLinkPathCurve(ganttUpper);
2520
- case GanttLinkPathType.line:
2521
- return new GanttLinkPathLine();
2618
+ case exports.GanttLinkLineType.curve:
2619
+ return new GanttLinkLineCurve(ganttUpper);
2620
+ case exports.GanttLinkLineType.straight:
2621
+ return new GanttLinkLineStraight();
2522
2622
  default:
2523
2623
  throw new Error('gantt link path type invalid');
2524
2624
  }
@@ -2534,7 +2634,7 @@
2534
2634
  this.items = [];
2535
2635
  this.lineClick = new i0.EventEmitter();
2536
2636
  this.links = [];
2537
- this.ganttLinkTypes = GanttLinkType;
2637
+ this.ganttLinkTypes = exports.GanttLinkType;
2538
2638
  this.showArrow = false;
2539
2639
  this.linkItems = [];
2540
2640
  this.firstChange = true;
@@ -2543,7 +2643,7 @@
2543
2643
  }
2544
2644
  GanttLinksComponent.prototype.ngOnInit = function () {
2545
2645
  var _this = this;
2546
- this.linkPath = generatePathFactory(this.ganttUpper.linkOptions.linkPathType, this.ganttUpper);
2646
+ this.linkLine = createLineGenerator(this.ganttUpper.linkOptions.lineType, this.ganttUpper);
2547
2647
  this.showArrow = this.ganttUpper.linkOptions.showArrow;
2548
2648
  this.buildLinks();
2549
2649
  this.firstChange = false;
@@ -2551,7 +2651,7 @@
2551
2651
  _this.elementRef.nativeElement.style.visibility = 'hidden';
2552
2652
  });
2553
2653
  rxjs.merge(this.ganttUpper.viewChange, this.ganttUpper.expandChange, this.ganttUpper.view.start$, this.ganttUpper.dragEnded, this.ganttUpper.linkDragEnded)
2554
- .pipe(operators.takeUntil(this.unsubscribe$), operators.skip(1), operators.debounceTime(0))
2654
+ .pipe(operators.skip(1), operators.debounceTime(0), operators.takeUntil(this.unsubscribe$))
2555
2655
  .subscribe(function () {
2556
2656
  _this.elementRef.nativeElement.style.visibility = 'visible';
2557
2657
  _this.buildLinks();
@@ -2612,16 +2712,30 @@
2612
2712
  source.links.forEach(function (link) {
2613
2713
  var target = _this.linkItems.find(function (item) { return item.id === link.link; });
2614
2714
  if (target && (target.origin.start || target.origin.end)) {
2615
- var color = LinkColors.default;
2616
- if (link.type === GanttLinkType.fs && source.end.getTime() > target.start.getTime()) {
2617
- color = LinkColors.blocked;
2715
+ var defaultColor = exports.LinkColors.default;
2716
+ var activeColor = exports.LinkColors.active;
2717
+ if (link.type === exports.GanttLinkType.fs && source.end.getTime() > target.start.getTime()) {
2718
+ defaultColor = exports.LinkColors.blocked;
2719
+ activeColor = exports.LinkColors.blocked;
2720
+ }
2721
+ if (link.color) {
2722
+ if (typeof link.color === 'string') {
2723
+ defaultColor = link.color;
2724
+ activeColor = link.color;
2725
+ }
2726
+ else {
2727
+ defaultColor = link.color.default;
2728
+ activeColor = link.color.active;
2729
+ }
2618
2730
  }
2619
2731
  _this.links.push({
2620
- path: _this.linkPath.generatePath(source, target, link.type),
2732
+ path: _this.linkLine.generatePath(source, target, link.type),
2621
2733
  source: source.origin,
2622
2734
  target: target.origin,
2623
2735
  type: link.type,
2624
- color: link.color || color
2736
+ color: defaultColor,
2737
+ defaultColor: defaultColor,
2738
+ activeColor: activeColor
2625
2739
  });
2626
2740
  }
2627
2741
  });
@@ -2638,15 +2752,15 @@
2638
2752
  target: link.target
2639
2753
  });
2640
2754
  };
2641
- GanttLinksComponent.prototype.mouseEnterPath = function (link) {
2642
- if (link.color === LinkColors.default) {
2643
- link.color = LinkColors.active;
2755
+ GanttLinksComponent.prototype.mouseEnterPath = function (link, index) {
2756
+ link.color = link.activeColor || link.defaultColor;
2757
+ if (index < this.links.length - 1) {
2758
+ this.links.splice(index, 1);
2759
+ this.links.push(link);
2644
2760
  }
2645
2761
  };
2646
2762
  GanttLinksComponent.prototype.mouseLeavePath = function (link) {
2647
- if (link.color === LinkColors.active) {
2648
- link.color = LinkColors.default;
2649
- }
2763
+ link.color = link.defaultColor;
2650
2764
  };
2651
2765
  GanttLinksComponent.prototype.ngOnDestroy = function () {
2652
2766
  this.unsubscribe$.next();
@@ -2654,9 +2768,9 @@
2654
2768
  };
2655
2769
  return GanttLinksComponent;
2656
2770
  }());
2657
- GanttLinksComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0__namespace, type: GanttLinksComponent, deps: [{ token: GANTT_UPPER_TOKEN }, { token: i0__namespace.ChangeDetectorRef }, { token: i0__namespace.ElementRef }, { token: GanttDragContainer }], target: i0__namespace.ɵɵFactoryTarget.Component });
2658
- GanttLinksComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.1.2", type: GanttLinksComponent, selector: "gantt-links-overlay", inputs: { groups: "groups", items: "items" }, outputs: { lineClick: "lineClick" }, host: { properties: { "class.gantt-links-overlay": "this.ganttLinksOverlay" } }, usesOnChanges: true, ngImport: i0__namespace, template: "<svg [attr.width]=\"ganttUpper.view.width\" class=\"gantt-links-overlay-main\">\n <ng-container *ngFor=\"let link of links; let i = index; trackBy: trackBy\">\n <path\n [attr.d]=\"link.path\"\n fill=\"transparent\"\n stroke-width=\"2\"\n [attr.stroke]=\"link.color\"\n pointer-events=\"none\"\n [attr.style]=\"link.type === ganttLinkTypes.sf ? 'marker-start: url(#triangle' + i + ')' : 'marker-end: url(#triangle' + i + ')'\"\n ></path>\n <g>\n <path\n class=\"link-line\"\n (click)=\"onLineClick($event, link)\"\n (mouseenter)=\"mouseEnterPath(link)\"\n (mouseleave)=\"mouseLeavePath(link)\"\n [attr.d]=\"link.path\"\n stroke=\"transparent\"\n stroke-width=\"9\"\n fill=\"none\"\n cursor=\"pointer\"\n ></path>\n </g>\n <defs *ngIf=\"showArrow\">\n <marker\n *ngIf=\"link.type === ganttLinkTypes.sf; else markerEnd\"\n [id]=\"'triangle' + i\"\n markerUnits=\"strokeWidth\"\n markerWidth=\"5\"\n markerHeight=\"4\"\n refX=\"5\"\n refY=\"2\"\n orient=\"180\"\n >\n <path [attr.fill]=\"link.color\" [attr.stroke]=\"link.color\" d=\"M 0 0 L 5 2 L 0 4 z\" />\n </marker>\n\n <ng-template #markerEnd>\n <marker [id]=\"'triangle' + i\" markerUnits=\"strokeWidth\" markerWidth=\"5\" markerHeight=\"4\" refX=\"5\" refY=\"2\" orient=\"auto\">\n <path [attr.fill]=\"link.color\" [attr.stroke]=\"link.color\" d=\"M 0 0 L 5 2 L 0 4 z\" />\n </marker>\n </ng-template>\n </defs>\n </ng-container>\n <line class=\"link-dragging-line\"></line>\n</svg>\n", directives: [{ type: i2__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i2__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
2659
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0__namespace, type: GanttLinksComponent, decorators: [{
2771
+ 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 });
2772
+ 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"] }] });
2773
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: GanttLinksComponent, decorators: [{
2660
2774
  type: i0.Component,
2661
2775
  args: [{
2662
2776
  selector: 'gantt-links-overlay',
@@ -2685,14 +2799,14 @@
2685
2799
  this.firstChange = true;
2686
2800
  this.unsubscribe$ = new rxjs.Subject();
2687
2801
  }
2688
- GanttItemUpper.prototype.onInit = function () {
2802
+ GanttItemUpper.prototype.ngOnInit = function () {
2689
2803
  var _this = this;
2690
2804
  this.firstChange = false;
2691
2805
  this.item.refs$.pipe(operators.takeUntil(this.unsubscribe$)).subscribe(function () {
2692
2806
  _this.setPositions();
2693
2807
  });
2694
2808
  };
2695
- GanttItemUpper.prototype.onChanges = function () {
2809
+ GanttItemUpper.prototype.ngOnChanges = function () {
2696
2810
  if (!this.firstChange) {
2697
2811
  this.setPositions();
2698
2812
  }
@@ -2711,15 +2825,15 @@
2711
2825
  else {
2712
2826
  }
2713
2827
  };
2714
- GanttItemUpper.prototype.onDestroy = function () {
2828
+ GanttItemUpper.prototype.ngOnDestroy = function () {
2715
2829
  this.unsubscribe$.next();
2716
2830
  this.unsubscribe$.complete();
2717
2831
  };
2718
2832
  return GanttItemUpper;
2719
2833
  }());
2720
- GanttItemUpper.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0__namespace, type: GanttItemUpper, deps: [{ token: i0__namespace.ElementRef }, { token: GANTT_UPPER_TOKEN }], target: i0__namespace.ɵɵFactoryTarget.Directive });
2721
- GanttItemUpper.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.1.2", type: GanttItemUpper, inputs: { template: "template", item: "item" }, ngImport: i0__namespace });
2722
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0__namespace, type: GanttItemUpper, decorators: [{
2834
+ 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 });
2835
+ GanttItemUpper.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.1.5", type: GanttItemUpper, inputs: { template: "template", item: "item" }, usesOnChanges: true, ngImport: i0__namespace });
2836
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: GanttItemUpper, decorators: [{
2723
2837
  type: i0.Directive
2724
2838
  }], ctorParameters: function () {
2725
2839
  return [{ type: i0__namespace.ElementRef }, { type: GanttUpper, decorators: [{
@@ -2739,20 +2853,11 @@
2739
2853
  _this.ganttRangeClass = true;
2740
2854
  return _this;
2741
2855
  }
2742
- NgxGanttRangeComponent.prototype.ngOnInit = function () {
2743
- _super.prototype.onInit.call(this);
2744
- };
2745
- NgxGanttRangeComponent.prototype.ngOnChanges = function () {
2746
- _super.prototype.onChanges.call(this);
2747
- };
2748
- NgxGanttRangeComponent.prototype.ngOnDestroy = function () {
2749
- _super.prototype.onDestroy.call(this);
2750
- };
2751
2856
  return NgxGanttRangeComponent;
2752
2857
  }(GanttItemUpper));
2753
- NgxGanttRangeComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0__namespace, type: NgxGanttRangeComponent, deps: [{ token: i0__namespace.ElementRef }, { token: GANTT_UPPER_TOKEN }], target: i0__namespace.ɵɵFactoryTarget.Component });
2754
- NgxGanttRangeComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.1.2", 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"] }] });
2755
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0__namespace, type: NgxGanttRangeComponent, decorators: [{
2858
+ 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 });
2859
+ 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, 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"] }] });
2860
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: NgxGanttRangeComponent, decorators: [{
2756
2861
  type: i0.Component,
2757
2862
  args: [{
2758
2863
  selector: 'ngx-gantt-range,gantt-range',
@@ -2770,17 +2875,19 @@
2770
2875
 
2771
2876
  var dragMinWidth = 10;
2772
2877
  var activeClass = 'gantt-bar-active';
2773
- var linkDropClass = 'gantt-bar-link-drop';
2878
+ var dropActiveClass = 'gantt-bar-drop-active';
2879
+ var singleDropActiveClass = 'gantt-bar-single-drop-active';
2774
2880
  function createSvgElement(qualifiedName, className) {
2775
2881
  var element = document.createElementNS('http://www.w3.org/2000/svg', qualifiedName);
2776
2882
  element.classList.add(className);
2777
2883
  return element;
2778
2884
  }
2779
2885
  var GanttBarDrag = /** @class */ (function () {
2780
- function GanttBarDrag(dragDrop, dom, dragContainer) {
2886
+ function GanttBarDrag(dragDrop, dom, dragContainer, root) {
2781
2887
  this.dragDrop = dragDrop;
2782
2888
  this.dom = dom;
2783
2889
  this.dragContainer = dragContainer;
2890
+ this.root = root;
2784
2891
  this.dragRefs = [];
2785
2892
  this.destroy$ = new rxjs.Subject();
2786
2893
  }
@@ -2800,20 +2907,28 @@
2800
2907
  });
2801
2908
  GanttBarDrag.prototype.createMouseEvents = function () {
2802
2909
  var _this = this;
2803
- rxjs.fromEvent(this.barElement, 'mouseenter')
2910
+ var _a, _b, _c;
2911
+ 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 &&
2912
+ ((_c = this.ganttUpper.config.linkOptions) === null || _c === void 0 ? void 0 : _c.dependencyTypes[0]) === exports.GanttLinkType.fs
2913
+ ? singleDropActiveClass
2914
+ : dropActiveClass;
2915
+ rxjs.fromEvent(this.barElement, 'mouseenter', passiveListenerOptions)
2804
2916
  .pipe(operators.takeUntil(this.destroy$))
2805
2917
  .subscribe(function () {
2806
2918
  if (_this.dragContainer.linkDraggingId && _this.dragContainer.linkDraggingId !== _this.item.id) {
2807
2919
  if (_this.item.linkable) {
2808
- _this.barElement.classList.add(linkDropClass);
2809
- _this.dragContainer.emitLinkDragEntered(_this.item);
2920
+ _this.barElement.classList.add(dropClass);
2921
+ _this.dragContainer.emitLinkDragEntered({
2922
+ item: _this.item,
2923
+ element: _this.barElement
2924
+ });
2810
2925
  }
2811
2926
  }
2812
2927
  else {
2813
2928
  _this.barElement.classList.add(activeClass);
2814
2929
  }
2815
2930
  });
2816
- rxjs.fromEvent(this.barElement, 'mouseleave')
2931
+ rxjs.fromEvent(this.barElement, 'mouseleave', passiveListenerOptions)
2817
2932
  .pipe(operators.takeUntil(this.destroy$))
2818
2933
  .subscribe(function () {
2819
2934
  if (!_this.dragContainer.linkDraggingId) {
@@ -2822,7 +2937,7 @@
2822
2937
  else {
2823
2938
  _this.dragContainer.emitLinkDragLeaved();
2824
2939
  }
2825
- _this.barElement.classList.remove(linkDropClass);
2940
+ _this.barElement.classList.remove(dropClass);
2826
2941
  });
2827
2942
  };
2828
2943
  GanttBarDrag.prototype.createBarDrag = function () {
@@ -2878,7 +2993,7 @@
2878
2993
  if (width > dragMinWidth) {
2879
2994
  _this.barElement.style.width = width + 'px';
2880
2995
  _this.barElement.style.left = x + 'px';
2881
- _this.openDragBackdrop(_this.barElement, _this.ganttUpper.view.getDateByXPoint(x), _this.ganttUpper.view.getDateByXPoint(x + width));
2996
+ _this.openDragBackdrop(_this.barElement, _this.ganttUpper.view.getDateByXPoint(x), _this.item.end);
2882
2997
  _this.item.updateDate(_this.ganttUpper.view.getDateByXPoint(x), _this.item.end);
2883
2998
  }
2884
2999
  }
@@ -2886,7 +3001,7 @@
2886
3001
  var width = _this.item.refs.width + event.distance.x;
2887
3002
  if (width > dragMinWidth) {
2888
3003
  _this.barElement.style.width = width + 'px';
2889
- _this.openDragBackdrop(_this.barElement, _this.ganttUpper.view.getDateByXPoint(_this.item.refs.x), _this.ganttUpper.view.getDateByXPoint(_this.item.refs.x + width));
3004
+ _this.openDragBackdrop(_this.barElement, _this.item.start, _this.ganttUpper.view.getDateByXPoint(_this.item.refs.x + width));
2890
3005
  }
2891
3006
  _this.item.updateDate(_this.item.start, _this.ganttUpper.view.getDateByXPoint(_this.item.refs.x + width));
2892
3007
  }
@@ -2925,7 +3040,7 @@
2925
3040
  var dragRefs = [];
2926
3041
  var handles = this.barElement.querySelectorAll('.link-handles .handle');
2927
3042
  handles.forEach(function (handle, index) {
2928
- var isBefore = index === 0;
3043
+ var isBegin = index === 0;
2929
3044
  var dragRef = _this.dragDrop.createDrag(handle);
2930
3045
  dragRef.withBoundaryElement(_this.dom.root);
2931
3046
  dragRef.beforeStarted.subscribe(function () {
@@ -2934,46 +3049,59 @@
2934
3049
  _this.barDragRef.disabled = true;
2935
3050
  }
2936
3051
  _this.createLinkDraggingLine();
2937
- _this.dragContainer.emitLinkDragStarted(isBefore ? 'target' : 'source', _this.item);
3052
+ _this.dragContainer.emitLinkDragStarted({
3053
+ element: _this.barElement,
3054
+ item: _this.item,
3055
+ pos: isBegin ? InBarPosition.start : InBarPosition.finish
3056
+ });
2938
3057
  });
2939
3058
  dragRef.moved.subscribe(function () {
2940
- var positions = _this.calcLinkLinePositions(handle, isBefore);
3059
+ var positions = _this.calcLinkLinePositions(handle, isBegin);
2941
3060
  _this.linkDraggingLine.setAttribute('x1', positions.x1.toString());
2942
3061
  _this.linkDraggingLine.setAttribute('y1', positions.y1.toString());
2943
3062
  _this.linkDraggingLine.setAttribute('x2', positions.x2.toString());
2944
3063
  _this.linkDraggingLine.setAttribute('y2', positions.y2.toString());
2945
3064
  });
2946
3065
  dragRef.ended.subscribe(function (event) {
2947
- event.source.reset();
2948
3066
  handle.style.pointerEvents = '';
2949
3067
  if (_this.barDragRef) {
2950
3068
  _this.barDragRef.disabled = false;
2951
3069
  }
3070
+ // 计算line拖动的落点位于目标Bar的值,如果值大于Bar宽度的一半,说明是拖动到Begin位置,否则则为拖动到End位置
3071
+ if (_this.dragContainer.linkDragPath.to) {
3072
+ var placePointX = event.source.getRootElement().getBoundingClientRect().x -
3073
+ _this.dragContainer.linkDragPath.to.element.getBoundingClientRect().x;
3074
+ _this.dragContainer.emitLinkDragEnded(Object.assign(Object.assign({}, _this.dragContainer.linkDragPath.to), { pos: placePointX < _this.dragContainer.linkDragPath.to.item.refs.width / 2
3075
+ ? InBarPosition.start
3076
+ : InBarPosition.finish }));
3077
+ }
3078
+ event.source.reset();
2952
3079
  _this.barElement.classList.remove(activeClass);
2953
3080
  _this.destroyLinkDraggingLine();
2954
- _this.dragContainer.emitLinkDragEnded();
2955
3081
  });
2956
3082
  dragRefs.push(dragRef);
2957
3083
  });
2958
3084
  return dragRefs;
2959
3085
  };
2960
3086
  GanttBarDrag.prototype.openDragBackdrop = function (dragElement, start, end) {
2961
- var dragMaskElement = this.dom.root.querySelector('.gantt-drag-mask');
2962
- var dragBackdropElement = this.dom.root.querySelector('.gantt-drag-backdrop');
3087
+ var dragBackdropElement = this.root.backdrop.nativeElement;
3088
+ var dragMaskElement = dragBackdropElement.querySelector('.gantt-drag-mask');
2963
3089
  var rootRect = this.dom.root.getBoundingClientRect();
2964
3090
  var dragRect = dragElement.getBoundingClientRect();
2965
3091
  var left = dragRect.left - rootRect.left - this.dom.side.clientWidth;
2966
3092
  var width = dragRect.right - dragRect.left;
3093
+ // Note: updating styles will cause re-layout so we have to place them consistently one by one.
2967
3094
  dragMaskElement.style.left = left + 'px';
2968
3095
  dragMaskElement.style.width = width + 'px';
2969
- dragMaskElement.querySelector('.start').innerHTML = start.format('MM-dd');
2970
- dragMaskElement.querySelector('.end').innerHTML = end.format('MM-dd');
2971
3096
  dragMaskElement.style.display = 'block';
2972
3097
  dragBackdropElement.style.display = 'block';
3098
+ // This will invalidate the layout, but we won't need re-layout, because we set styles previously.
3099
+ dragMaskElement.querySelector('.start').innerHTML = start.format('MM-dd');
3100
+ dragMaskElement.querySelector('.end').innerHTML = end.format('MM-dd');
2973
3101
  };
2974
3102
  GanttBarDrag.prototype.closeDragBackdrop = function () {
2975
- var dragMaskElement = this.dom.root.querySelector('.gantt-drag-mask');
2976
- var dragBackdropElement = this.dom.root.querySelector('.gantt-drag-backdrop');
3103
+ var dragBackdropElement = this.root.backdrop.nativeElement;
3104
+ var dragMaskElement = dragBackdropElement.querySelector('.gantt-drag-mask');
2977
3105
  dragMaskElement.style.display = 'none';
2978
3106
  dragBackdropElement.style.display = 'none';
2979
3107
  };
@@ -3000,6 +3128,7 @@
3000
3128
  if (!this.linkDraggingLine) {
3001
3129
  var svgElement = createSvgElement('svg', 'gantt-link-drag-container');
3002
3130
  var linElement = createSvgElement('line', 'link-dragging-line');
3131
+ linElement.style.pointerEvents = 'none';
3003
3132
  svgElement.appendChild(linElement);
3004
3133
  this.dom.root.appendChild(svgElement);
3005
3134
  this.linkDraggingLine = linElement;
@@ -3012,7 +3141,7 @@
3012
3141
  }
3013
3142
  };
3014
3143
  GanttBarDrag.prototype.createDrags = function (elementRef, item, ganttUpper) {
3015
- var _a, _b;
3144
+ var _d, _e;
3016
3145
  this.item = item;
3017
3146
  this.barElement = elementRef.nativeElement;
3018
3147
  this.ganttUpper = ganttUpper;
@@ -3024,11 +3153,11 @@
3024
3153
  if (!this.dragDisabled) {
3025
3154
  var dragRef = this.createBarDrag();
3026
3155
  var dragHandlesRefs = this.createBarHandleDrags();
3027
- (_a = this.dragRefs).push.apply(_a, __spreadArray([dragRef], __read(dragHandlesRefs)));
3156
+ (_d = this.dragRefs).push.apply(_d, __spreadArray([dragRef], __read(dragHandlesRefs)));
3028
3157
  }
3029
3158
  if (!this.linkDragDisabled) {
3030
3159
  var linkDragRefs = this.createLinkHandleDrags();
3031
- (_b = this.dragRefs).push.apply(_b, __spreadArray([], __read(linkDragRefs)));
3160
+ (_e = this.dragRefs).push.apply(_e, __spreadArray([], __read(linkDragRefs)));
3032
3161
  }
3033
3162
  }
3034
3163
  };
@@ -3040,22 +3169,27 @@
3040
3169
  };
3041
3170
  return GanttBarDrag;
3042
3171
  }());
3043
- GanttBarDrag.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0__namespace, type: GanttBarDrag, deps: [{ token: i1__namespace.DragDrop }, { token: GanttDomService }, { token: GanttDragContainer }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
3044
- GanttBarDrag.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0__namespace, type: GanttBarDrag });
3045
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0__namespace, type: GanttBarDrag, decorators: [{
3172
+ 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 }, { token: NgxGanttRootComponent, skipSelf: true }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
3173
+ GanttBarDrag.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: GanttBarDrag });
3174
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: GanttBarDrag, decorators: [{
3046
3175
  type: i0.Injectable
3047
- }], ctorParameters: function () { return [{ type: i1__namespace.DragDrop }, { type: GanttDomService }, { type: GanttDragContainer }]; } });
3176
+ }], ctorParameters: function () {
3177
+ return [{ type: i1__namespace.DragDrop }, { type: GanttDomService }, { type: GanttDragContainer }, { type: NgxGanttRootComponent, decorators: [{
3178
+ type: i0.SkipSelf
3179
+ }] }];
3180
+ } });
3048
3181
 
3049
3182
  function linearGradient(sideOrCorner, color, stop) {
3050
3183
  return "linear-gradient(" + sideOrCorner + "," + color + " 0%," + stop + " 40%)";
3051
3184
  }
3052
3185
  var NgxGanttBarComponent = /** @class */ (function (_super) {
3053
3186
  __extends(NgxGanttBarComponent, _super);
3054
- function NgxGanttBarComponent(dragContainer, drag, elementRef, ganttUpper) {
3187
+ function NgxGanttBarComponent(dragContainer, drag, elementRef, ganttUpper, ngZone) {
3055
3188
  var _this = _super.call(this, elementRef, ganttUpper) || this;
3056
3189
  _this.dragContainer = dragContainer;
3057
3190
  _this.drag = drag;
3058
3191
  _this.ganttUpper = ganttUpper;
3192
+ _this.ngZone = ngZone;
3059
3193
  _this.barClick = new i0.EventEmitter();
3060
3194
  _this.ganttItemClass = true;
3061
3195
  _this.color = 'red';
@@ -3063,17 +3197,24 @@
3063
3197
  }
3064
3198
  NgxGanttBarComponent.prototype.ngOnInit = function () {
3065
3199
  var _this = this;
3066
- _super.prototype.onInit.call(this);
3200
+ _super.prototype.ngOnInit.call(this);
3067
3201
  this.dragContainer.dragEnded.pipe(operators.takeUntil(this.unsubscribe$)).subscribe(function () {
3068
3202
  _this.setContentBackground();
3069
3203
  });
3070
3204
  };
3071
3205
  NgxGanttBarComponent.prototype.ngAfterViewInit = function () {
3206
+ var _this = this;
3072
3207
  this.drag.createDrags(this.elementRef, this.item, this.ganttUpper);
3073
3208
  this.setContentBackground();
3074
- };
3075
- NgxGanttBarComponent.prototype.ngOnChanges = function () {
3076
- _super.prototype.onChanges.call(this);
3209
+ this.handles.changes
3210
+ .pipe(operators.startWith(this.handles), operators.switchMap(function () {
3211
+ // Note: we need to explicitly subscribe outside of the Angular zone since `addEventListener`
3212
+ // is called when the `fromEvent` is subscribed.
3213
+ return new rxjs.Observable(function (subscriber) { return _this.ngZone.runOutsideAngular(function () { return rxjs.merge.apply(void 0, __spreadArray([], __read(_this.handles.toArray().map(function (handle) { return rxjs.fromEvent(handle.nativeElement, 'mousedown'); })))).subscribe(subscriber); }); });
3214
+ }), operators.takeUntil(this.unsubscribe$))
3215
+ .subscribe(function (event) {
3216
+ event.stopPropagation();
3217
+ });
3077
3218
  };
3078
3219
  NgxGanttBarComponent.prototype.onBarClick = function (event) {
3079
3220
  this.barClick.emit({ event: event, item: this.item.origin });
@@ -3109,14 +3250,11 @@
3109
3250
  NgxGanttBarComponent.prototype.stopPropagation = function (event) {
3110
3251
  event.stopPropagation();
3111
3252
  };
3112
- NgxGanttBarComponent.prototype.ngOnDestroy = function () {
3113
- _super.prototype.onDestroy.call(this);
3114
- };
3115
3253
  return NgxGanttBarComponent;
3116
3254
  }(GanttItemUpper));
3117
- NgxGanttBarComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0__namespace, type: NgxGanttBarComponent, deps: [{ token: GanttDragContainer }, { token: GanttBarDrag }, { token: i0__namespace.ElementRef }, { token: GANTT_UPPER_TOKEN }], target: i0__namespace.ɵɵFactoryTarget.Component });
3118
- NgxGanttBarComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.1.2", 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"] }] });
3119
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0__namespace, type: NgxGanttBarComponent, decorators: [{
3255
+ 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 }, { token: i0__namespace.NgZone }], target: i0__namespace.ɵɵFactoryTarget.Component });
3256
+ 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 }, { propertyName: "handles", predicate: ["handle"], descendants: true }], usesInheritance: 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\" #handle></span>\n <span class=\"handle\" #handle></span>\n </ng-container>\n </div>\n <div *ngIf=\"item.linkable && ganttUpper.linkable\" class=\"link-handles\">\n <span class=\"handle\"><span class=\"point\"></span></span>\n <span class=\"handle\"> <span class=\"point\"></span></span>\n </div>\n</div>\n<div class=\"gantt-bar-border\"></div>\n<div #content class=\"gantt-bar-content\" (click)=\"onBarClick($event)\">\n <div class=\"gantt-bar-content-progress\" *ngIf=\"item.progress >= 0\" [style.width.%]=\"item.progress * 100\"></div>\n <ng-template [ngTemplateOutlet]=\"template\" [ngTemplateOutletContext]=\"{ item: item.origin, refs: item.refs }\"></ng-template>\n</div>\n", directives: [{ type: i2__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2__namespace.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }] });
3257
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: NgxGanttBarComponent, decorators: [{
3120
3258
  type: i0.Component,
3121
3259
  args: [{
3122
3260
  selector: 'ngx-gantt-bar,gantt-bar',
@@ -3127,7 +3265,7 @@
3127
3265
  return [{ type: GanttDragContainer }, { type: GanttBarDrag }, { type: i0__namespace.ElementRef }, { type: GanttUpper, decorators: [{
3128
3266
  type: i0.Inject,
3129
3267
  args: [GANTT_UPPER_TOKEN]
3130
- }] }];
3268
+ }] }, { type: i0__namespace.NgZone }];
3131
3269
  }, propDecorators: { barClick: [{
3132
3270
  type: i0.Output
3133
3271
  }], contentElementRef: [{
@@ -3136,6 +3274,9 @@
3136
3274
  }], ganttItemClass: [{
3137
3275
  type: i0.HostBinding,
3138
3276
  args: ['class.gantt-bar']
3277
+ }], handles: [{
3278
+ type: i0.ViewChildren,
3279
+ args: ['handle']
3139
3280
  }] } });
3140
3281
 
3141
3282
  var GanttMainComponent = /** @class */ (function () {
@@ -3145,15 +3286,14 @@
3145
3286
  this.lineClick = new i0.EventEmitter();
3146
3287
  this.ganttMainClass = true;
3147
3288
  }
3148
- GanttMainComponent.prototype.ngOnInit = function () { };
3149
3289
  GanttMainComponent.prototype.trackBy = function (index, item) {
3150
3290
  return item.id || index;
3151
3291
  };
3152
3292
  return GanttMainComponent;
3153
3293
  }());
3154
- GanttMainComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0__namespace, type: GanttMainComponent, deps: [{ token: GANTT_UPPER_TOKEN }], target: i0__namespace.ɵɵFactoryTarget.Component });
3155
- GanttMainComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.1.2", type: GanttMainComponent, selector: "gantt-main", inputs: { groups: "groups", items: "items", groupHeaderTemplate: "groupHeaderTemplate", itemTemplate: "itemTemplate", barTemplate: "barTemplate", rangeTemplate: "rangeTemplate" }, outputs: { barClick: "barClick", lineClick: "lineClick" }, host: { properties: { "class.gantt-main-container": "this.ganttMainClass" } }, ngImport: i0__namespace, template: "<gantt-links-overlay [groups]=\"groups\" [items]=\"items\" (lineClick)=\"lineClick.emit($event)\"></gantt-links-overlay>\n<!-- groups -->\n<div class=\"gantt-main-groups\" *ngIf=\"groups && groups.length > 0; else itemsTemplate\" [style.width.px]=\"ganttUpper.view.width\">\n <ng-container *ngFor=\"let group of groups; trackBy: trackBy\">\n <div class=\"gantt-group\" [ngClass]=\"group.class\">\n <ng-template [ngTemplateOutlet]=\"groupHeaderTemplate\" [ngTemplateOutletContext]=\"{ group: group }\"></ng-template>\n </div>\n <div *ngIf=\"group.expanded\" class=\"gantt-items\">\n <ng-template [ngTemplateOutlet]=\"ganttItems\" [ngTemplateOutletContext]=\"{ items: group.items }\"></ng-template>\n </div>\n </ng-container>\n</div>\n<!-- items -->\n<ng-template #itemsTemplate>\n <div class=\"gantt-main-items\" [style.width.px]=\"ganttUpper.view.width\">\n <ng-template [ngTemplateOutlet]=\"ganttItems\" [ngTemplateOutletContext]=\"{ items: items }\"></ng-template>\n </div>\n</ng-template>\n\n<ng-template #ganttItems let-items=\"items\">\n <ng-container *ngFor=\"let item of items;\">\n <div\n class=\"gantt-item\"\n [style.height.px]=\"ganttUpper.styles.lineHeight\"\n [class.gantt-main-item-active]=\"ganttUpper.isSelected(item.id)\"\n >\n <ng-container *ngIf=\"item.type | isGanttCustomItem\">\n <ng-template [ngTemplateOutlet]=\"itemTemplate\" [ngTemplateOutletContext]=\"{ item: item.origin, refs: item.refs }\"></ng-template>\n </ng-container>\n <gantt-range *ngIf=\"item.type | isGanttRangeItem\" [template]=\"rangeTemplate\" [item]=\"item\"></gantt-range>\n <gantt-bar *ngIf=\"item.type | isGanttBarItem\" [item]=\"item\" [template]=\"barTemplate\" (barClick)=\"barClick.emit($event)\"></gantt-bar>\n </div>\n <ng-template\n *ngIf=\"item.children && item.expanded\"\n [ngTemplateOutlet]=\"ganttItems\"\n [ngTemplateOutletContext]=\"{ items: item.children }\"\n ></ng-template>\n </ng-container>\n</ng-template>\n", components: [{ type: GanttLinksComponent, selector: "gantt-links-overlay", inputs: ["groups", "items"], outputs: ["lineClick"] }, { type: NgxGanttRangeComponent, selector: "ngx-gantt-range,gantt-range" }, { type: NgxGanttBarComponent, selector: "ngx-gantt-bar,gantt-bar", outputs: ["barClick"] }], directives: [{ type: i2__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i2__namespace.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i2__namespace.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }], pipes: { "isGanttCustomItem": IsGanttCustomItemPipe, "isGanttRangeItem": IsGanttRangeItemPipe, "isGanttBarItem": IsGanttBarItemPipe } });
3156
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0__namespace, type: GanttMainComponent, decorators: [{
3294
+ 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 });
3295
+ 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 } });
3296
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: GanttMainComponent, decorators: [{
3157
3297
  type: i0.Component,
3158
3298
  args: [{
3159
3299
  selector: 'gantt-main',
@@ -3200,15 +3340,20 @@
3200
3340
  }
3201
3341
  NgxGanttComponent.prototype.ngOnInit = function () {
3202
3342
  var _this = this;
3203
- var _a;
3204
- _super.prototype.onInit.call(this);
3205
- this.linkOptions = Object.assign({}, defaultConfig.linkOptions, (_a = this.config) === null || _a === void 0 ? void 0 : _a.linkOptions, this.linkOptions);
3206
- this.ngZone.onStable.pipe(operators.take(1)).subscribe(function () {
3207
- _this.dragContainer.linkDragStarted.pipe(operators.takeUntil(_this.ngUnsubscribe$)).subscribe(function (event) {
3208
- _this.linkDragStarted.emit(event);
3209
- });
3210
- _this.dragContainer.linkDragEnded.pipe(operators.takeUntil(_this.ngUnsubscribe$)).subscribe(function (event) {
3211
- _this.linkDragEnded.emit(event);
3343
+ _super.prototype.ngOnInit.call(this);
3344
+ // Note: the zone may be nooped through `BootstrapOptions` when bootstrapping the root module. This means
3345
+ // the `onStable` will never emit any value.
3346
+ var onStable$ = this.ngZone.isStable ? rxjs.from(Promise.resolve()) : this.ngZone.onStable.pipe(operators.take(1));
3347
+ // Normally this isn't in the zone, but it can cause performance regressions for apps
3348
+ // using `zone-patch-rxjs` because it'll trigger a change detection when it unsubscribes.
3349
+ this.ngZone.runOutsideAngular(function () {
3350
+ onStable$.pipe(operators.takeUntil(_this.unsubscribe$)).subscribe(function () {
3351
+ _this.dragContainer.linkDragStarted.pipe(operators.takeUntil(_this.ngUnsubscribe$)).subscribe(function (event) {
3352
+ _this.linkDragStarted.emit(event);
3353
+ });
3354
+ _this.dragContainer.linkDragEnded.pipe(operators.takeUntil(_this.ngUnsubscribe$)).subscribe(function (event) {
3355
+ _this.linkDragEnded.emit(event);
3356
+ });
3212
3357
  });
3213
3358
  });
3214
3359
  };
@@ -3223,9 +3368,6 @@
3223
3368
  _this.cdr.detectChanges();
3224
3369
  });
3225
3370
  };
3226
- NgxGanttComponent.prototype.ngOnChanges = function (changes) {
3227
- _super.prototype.onChanges.call(this, changes);
3228
- };
3229
3371
  NgxGanttComponent.prototype.expandChildren = function (item) {
3230
3372
  var _this = this;
3231
3373
  if (!item.expanded) {
@@ -3262,21 +3404,18 @@
3262
3404
  this.selectionModel.toggle(selectedValue.id);
3263
3405
  var selectedIds = this.selectionModel.selected;
3264
3406
  if (this.multiple) {
3265
- var selectedValue_1 = this.getGanttItems(selectedIds).map(function (item) { return item.origin; });
3266
- this.selectedChange.emit({ event: event, selectedValue: selectedValue_1 });
3407
+ var _selectedValue = this.getGanttItems(selectedIds).map(function (item) { return item.origin; });
3408
+ this.selectedChange.emit({ event: event, selectedValue: _selectedValue });
3267
3409
  }
3268
3410
  else {
3269
- var selectedValue_2 = (_a = this.getGanttItem(selectedIds[0])) === null || _a === void 0 ? void 0 : _a.origin;
3270
- this.selectedChange.emit({ event: event, selectedValue: selectedValue_2 });
3411
+ var _selectedValue = (_a = this.getGanttItem(selectedIds[0])) === null || _a === void 0 ? void 0 : _a.origin;
3412
+ this.selectedChange.emit({ event: event, selectedValue: _selectedValue });
3271
3413
  }
3272
3414
  };
3273
- NgxGanttComponent.prototype.ngOnDestroy = function () {
3274
- _super.prototype.onDestroy.call(this);
3275
- };
3276
3415
  return NgxGanttComponent;
3277
3416
  }(GanttUpper));
3278
- NgxGanttComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0__namespace, type: NgxGanttComponent, deps: [{ token: i0__namespace.ElementRef }, { token: i0__namespace.ChangeDetectorRef }, { token: i0__namespace.NgZone }, { token: GANTT_GLOBAL_CONFIG }], target: i0__namespace.ɵɵFactoryTarget.Component });
3279
- NgxGanttComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.1.2", type: NgxGanttComponent, selector: "ngx-gantt", inputs: { maxLevel: "maxLevel", async: "async", childrenResolve: "childrenResolve", linkable: "linkable", linkOptions: "linkOptions" }, outputs: { linkDragStarted: "linkDragStarted", linkDragEnded: "linkDragEnded", lineClick: "lineClick", selectedChange: "selectedChange" }, providers: [
3417
+ 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 });
3418
+ 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: [
3280
3419
  {
3281
3420
  provide: GANTT_UPPER_TOKEN,
3282
3421
  useExisting: NgxGanttComponent
@@ -3285,8 +3424,8 @@
3285
3424
  provide: GANTT_ABSTRACT_TOKEN,
3286
3425
  useExisting: i0.forwardRef(function () { return NgxGanttComponent; })
3287
3426
  }
3288
- ], queries: [{ propertyName: "table", first: true, predicate: NgxGanttTableComponent, descendants: true }, { propertyName: "tableEmptyTemplate", first: true, predicate: ["tableEmpty"], descendants: true, static: true }, { propertyName: "columns", predicate: NgxGanttTableColumnComponent, descendants: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0__namespace, template: "<ngx-gantt-root>\n <ng-template #sideTemplate>\n <gantt-table\n [groups]=\"groups\"\n [items]=\"items\"\n [columns]=\"columns\"\n [groupTemplate]=\"groupTemplate\"\n [emptyTemplate]=\"tableEmptyTemplate\"\n [rowBeforeTemplate]=\"table?.rowBeforeTemplate\"\n [rowAfterTemplate]=\"table?.rowAfterTemplate\"\n (itemClick)=\"selectItem($event)\"\n ></gantt-table>\n </ng-template>\n <ng-template #mainTemplate>\n <gantt-main\n [groups]=\"groups\"\n [items]=\"items\"\n [groupHeaderTemplate]=\"groupHeaderTemplate\"\n [itemTemplate]=\"itemTemplate\"\n [barTemplate]=\"barTemplate\"\n [rangeTemplate]=\"rangeTemplate\"\n (barClick)=\"barClick.emit($event)\"\n (lineClick)=\"lineClick.emit($event)\"\n >\n </gantt-main>\n </ng-template>\n</ngx-gantt-root>\n", components: [{ type: NgxGanttRootComponent, selector: "ngx-gantt-root", inputs: ["sideWidth"] }, { type: GanttTableComponent, selector: "gantt-table", inputs: ["groups", "items", "columns", "groupTemplate", "emptyTemplate", "rowBeforeTemplate", "rowAfterTemplate"], outputs: ["itemClick"] }, { type: GanttMainComponent, selector: "gantt-main", inputs: ["groups", "items", "groupHeaderTemplate", "itemTemplate", "barTemplate", "rangeTemplate"], outputs: ["barClick", "lineClick"] }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
3289
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0__namespace, type: NgxGanttComponent, decorators: [{
3427
+ ], 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, 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 });
3428
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: NgxGanttComponent, decorators: [{
3290
3429
  type: i0.Component,
3291
3430
  args: [{
3292
3431
  selector: 'ngx-gantt',
@@ -3316,8 +3455,6 @@
3316
3455
  type: i0.Input
3317
3456
  }], linkable: [{
3318
3457
  type: i0.Input
3319
- }], linkOptions: [{
3320
- type: i0.Input
3321
3458
  }], linkDragStarted: [{
3322
3459
  type: i0.Output
3323
3460
  }], linkDragEnded: [{
@@ -3342,8 +3479,8 @@
3342
3479
  }
3343
3480
  return NgxGanttModule;
3344
3481
  }());
3345
- NgxGanttModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0__namespace, type: NgxGanttModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
3346
- NgxGanttModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0__namespace, type: NgxGanttModule, declarations: [NgxGanttComponent,
3482
+ NgxGanttModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: NgxGanttModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
3483
+ NgxGanttModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: NgxGanttModule, declarations: [NgxGanttComponent,
3347
3484
  NgxGanttTableComponent,
3348
3485
  NgxGanttTableColumnComponent,
3349
3486
  GanttTableComponent,
@@ -3363,13 +3500,13 @@
3363
3500
  NgxGanttRootComponent,
3364
3501
  NgxGanttBarComponent,
3365
3502
  NgxGanttRangeComponent] });
3366
- NgxGanttModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0__namespace, type: NgxGanttModule, providers: [
3503
+ NgxGanttModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: NgxGanttModule, providers: [
3367
3504
  {
3368
3505
  provide: GANTT_GLOBAL_CONFIG,
3369
3506
  useValue: defaultConfig
3370
3507
  }
3371
3508
  ], imports: [[i2.CommonModule, i1.DragDropModule]] });
3372
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0__namespace, type: NgxGanttModule, decorators: [{
3509
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: NgxGanttModule, decorators: [{
3373
3510
  type: i0.NgModule,
3374
3511
  args: [{
3375
3512
  imports: [i2.CommonModule, i1.DragDropModule],
@@ -3417,195 +3554,131 @@
3417
3554
 
3418
3555
  Object.defineProperty(exports, 'addDays', {
3419
3556
  enumerable: true,
3420
- get: function () {
3421
- return dateFns.addDays;
3422
- }
3557
+ get: function () { return dateFns.addDays; }
3423
3558
  });
3424
3559
  Object.defineProperty(exports, 'addHours', {
3425
3560
  enumerable: true,
3426
- get: function () {
3427
- return dateFns.addHours;
3428
- }
3561
+ get: function () { return dateFns.addHours; }
3429
3562
  });
3430
3563
  Object.defineProperty(exports, 'addMinutes', {
3431
3564
  enumerable: true,
3432
- get: function () {
3433
- return dateFns.addMinutes;
3434
- }
3565
+ get: function () { return dateFns.addMinutes; }
3435
3566
  });
3436
3567
  Object.defineProperty(exports, 'addMonths', {
3437
3568
  enumerable: true,
3438
- get: function () {
3439
- return dateFns.addMonths;
3440
- }
3569
+ get: function () { return dateFns.addMonths; }
3441
3570
  });
3442
3571
  Object.defineProperty(exports, 'addQuarters', {
3443
3572
  enumerable: true,
3444
- get: function () {
3445
- return dateFns.addQuarters;
3446
- }
3573
+ get: function () { return dateFns.addQuarters; }
3447
3574
  });
3448
3575
  Object.defineProperty(exports, 'addSeconds', {
3449
3576
  enumerable: true,
3450
- get: function () {
3451
- return dateFns.addSeconds;
3452
- }
3577
+ get: function () { return dateFns.addSeconds; }
3453
3578
  });
3454
3579
  Object.defineProperty(exports, 'addWeeks', {
3455
3580
  enumerable: true,
3456
- get: function () {
3457
- return dateFns.addWeeks;
3458
- }
3581
+ get: function () { return dateFns.addWeeks; }
3459
3582
  });
3460
3583
  Object.defineProperty(exports, 'addYears', {
3461
3584
  enumerable: true,
3462
- get: function () {
3463
- return dateFns.addYears;
3464
- }
3585
+ get: function () { return dateFns.addYears; }
3465
3586
  });
3466
3587
  Object.defineProperty(exports, 'differenceInCalendarDays', {
3467
3588
  enumerable: true,
3468
- get: function () {
3469
- return dateFns.differenceInCalendarDays;
3470
- }
3589
+ get: function () { return dateFns.differenceInCalendarDays; }
3471
3590
  });
3472
3591
  Object.defineProperty(exports, 'differenceInCalendarQuarters', {
3473
3592
  enumerable: true,
3474
- get: function () {
3475
- return dateFns.differenceInCalendarQuarters;
3476
- }
3593
+ get: function () { return dateFns.differenceInCalendarQuarters; }
3477
3594
  });
3478
3595
  Object.defineProperty(exports, 'differenceInDays', {
3479
3596
  enumerable: true,
3480
- get: function () {
3481
- return dateFns.differenceInDays;
3482
- }
3597
+ get: function () { return dateFns.differenceInDays; }
3483
3598
  });
3484
3599
  Object.defineProperty(exports, 'eachDayOfInterval', {
3485
3600
  enumerable: true,
3486
- get: function () {
3487
- return dateFns.eachDayOfInterval;
3488
- }
3601
+ get: function () { return dateFns.eachDayOfInterval; }
3489
3602
  });
3490
3603
  Object.defineProperty(exports, 'eachMonthOfInterval', {
3491
3604
  enumerable: true,
3492
- get: function () {
3493
- return dateFns.eachMonthOfInterval;
3494
- }
3605
+ get: function () { return dateFns.eachMonthOfInterval; }
3495
3606
  });
3496
3607
  Object.defineProperty(exports, 'eachWeekOfInterval', {
3497
3608
  enumerable: true,
3498
- get: function () {
3499
- return dateFns.eachWeekOfInterval;
3500
- }
3609
+ get: function () { return dateFns.eachWeekOfInterval; }
3501
3610
  });
3502
3611
  Object.defineProperty(exports, 'endOfDay', {
3503
3612
  enumerable: true,
3504
- get: function () {
3505
- return dateFns.endOfDay;
3506
- }
3613
+ get: function () { return dateFns.endOfDay; }
3507
3614
  });
3508
3615
  Object.defineProperty(exports, 'endOfMonth', {
3509
3616
  enumerable: true,
3510
- get: function () {
3511
- return dateFns.endOfMonth;
3512
- }
3617
+ get: function () { return dateFns.endOfMonth; }
3513
3618
  });
3514
3619
  Object.defineProperty(exports, 'endOfQuarter', {
3515
3620
  enumerable: true,
3516
- get: function () {
3517
- return dateFns.endOfQuarter;
3518
- }
3621
+ get: function () { return dateFns.endOfQuarter; }
3519
3622
  });
3520
3623
  Object.defineProperty(exports, 'endOfWeek', {
3521
3624
  enumerable: true,
3522
- get: function () {
3523
- return dateFns.endOfWeek;
3524
- }
3625
+ get: function () { return dateFns.endOfWeek; }
3525
3626
  });
3526
3627
  Object.defineProperty(exports, 'endOfYear', {
3527
3628
  enumerable: true,
3528
- get: function () {
3529
- return dateFns.endOfYear;
3530
- }
3629
+ get: function () { return dateFns.endOfYear; }
3531
3630
  });
3532
3631
  Object.defineProperty(exports, 'format', {
3533
3632
  enumerable: true,
3534
- get: function () {
3535
- return dateFns.format;
3536
- }
3633
+ get: function () { return dateFns.format; }
3537
3634
  });
3538
3635
  Object.defineProperty(exports, 'fromUnixTime', {
3539
3636
  enumerable: true,
3540
- get: function () {
3541
- return dateFns.fromUnixTime;
3542
- }
3637
+ get: function () { return dateFns.fromUnixTime; }
3543
3638
  });
3544
3639
  Object.defineProperty(exports, 'getDaysInMonth', {
3545
3640
  enumerable: true,
3546
- get: function () {
3547
- return dateFns.getDaysInMonth;
3548
- }
3641
+ get: function () { return dateFns.getDaysInMonth; }
3549
3642
  });
3550
3643
  Object.defineProperty(exports, 'getUnixTime', {
3551
3644
  enumerable: true,
3552
- get: function () {
3553
- return dateFns.getUnixTime;
3554
- }
3645
+ get: function () { return dateFns.getUnixTime; }
3555
3646
  });
3556
3647
  Object.defineProperty(exports, 'getWeek', {
3557
3648
  enumerable: true,
3558
- get: function () {
3559
- return dateFns.getWeek;
3560
- }
3649
+ get: function () { return dateFns.getWeek; }
3561
3650
  });
3562
3651
  Object.defineProperty(exports, 'isToday', {
3563
3652
  enumerable: true,
3564
- get: function () {
3565
- return dateFns.isToday;
3566
- }
3653
+ get: function () { return dateFns.isToday; }
3567
3654
  });
3568
3655
  Object.defineProperty(exports, 'isWeekend', {
3569
3656
  enumerable: true,
3570
- get: function () {
3571
- return dateFns.isWeekend;
3572
- }
3657
+ get: function () { return dateFns.isWeekend; }
3573
3658
  });
3574
3659
  Object.defineProperty(exports, 'setDate', {
3575
3660
  enumerable: true,
3576
- get: function () {
3577
- return dateFns.setDate;
3578
- }
3661
+ get: function () { return dateFns.setDate; }
3579
3662
  });
3580
3663
  Object.defineProperty(exports, 'startOfDay', {
3581
3664
  enumerable: true,
3582
- get: function () {
3583
- return dateFns.startOfDay;
3584
- }
3665
+ get: function () { return dateFns.startOfDay; }
3585
3666
  });
3586
3667
  Object.defineProperty(exports, 'startOfMonth', {
3587
3668
  enumerable: true,
3588
- get: function () {
3589
- return dateFns.startOfMonth;
3590
- }
3669
+ get: function () { return dateFns.startOfMonth; }
3591
3670
  });
3592
3671
  Object.defineProperty(exports, 'startOfQuarter', {
3593
3672
  enumerable: true,
3594
- get: function () {
3595
- return dateFns.startOfQuarter;
3596
- }
3673
+ get: function () { return dateFns.startOfQuarter; }
3597
3674
  });
3598
3675
  Object.defineProperty(exports, 'startOfWeek', {
3599
3676
  enumerable: true,
3600
- get: function () {
3601
- return dateFns.startOfWeek;
3602
- }
3677
+ get: function () { return dateFns.startOfWeek; }
3603
3678
  });
3604
3679
  Object.defineProperty(exports, 'startOfYear', {
3605
3680
  enumerable: true,
3606
- get: function () {
3607
- return dateFns.startOfYear;
3608
- }
3681
+ get: function () { return dateFns.startOfYear; }
3609
3682
  });
3610
3683
  exports.GANTT_GLOBAL_CONFIG = GANTT_GLOBAL_CONFIG;
3611
3684
  exports.GANTT_UPPER_TOKEN = GANTT_UPPER_TOKEN;
@@ -3640,5 +3713,5 @@
3640
3713
 
3641
3714
  Object.defineProperty(exports, '__esModule', { value: true });
3642
3715
 
3643
- })));
3716
+ }));
3644
3717
  //# sourceMappingURL=worktile-gantt.umd.js.map