@worktile/gantt 11.0.3 → 12.0.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 (59) hide show
  1. package/bundles/worktile-gantt.umd.js +1261 -1096
  2. package/bundles/worktile-gantt.umd.js.map +1 -1
  3. package/components/bar/bar-drag.d.ts +3 -0
  4. package/components/bar/bar.component.d.ts +3 -0
  5. package/components/calendar/calendar.component.d.ts +4 -1
  6. package/components/drag-backdrop/drag-backdrop.component.d.ts +3 -0
  7. package/components/icon/icon.component.d.ts +3 -0
  8. package/components/links/links.component.d.ts +3 -0
  9. package/components/main/gantt-main.component.d.ts +3 -0
  10. package/components/range/range.component.d.ts +3 -0
  11. package/components/table/gantt-table.component.d.ts +8 -3
  12. package/esm2015/components/bar/bar-drag.js +10 -12
  13. package/esm2015/components/bar/bar.component.js +29 -22
  14. package/esm2015/components/calendar/calendar.component.js +21 -17
  15. package/esm2015/components/drag-backdrop/drag-backdrop.component.js +14 -11
  16. package/esm2015/components/icon/icon.component.js +17 -15
  17. package/esm2015/components/links/links.component.js +28 -22
  18. package/esm2015/components/main/gantt-main.component.js +40 -22
  19. package/esm2015/components/range/range.component.js +21 -16
  20. package/esm2015/components/table/gantt-table.component.js +41 -23
  21. package/esm2015/gantt-abstract.js +3 -0
  22. package/esm2015/gantt-dom.service.js +7 -5
  23. package/esm2015/gantt-drag-container.js +7 -5
  24. package/esm2015/gantt-item-upper.js +17 -14
  25. package/esm2015/gantt-print.service.js +7 -5
  26. package/esm2015/gantt-upper.js +65 -51
  27. package/esm2015/gantt.component.js +60 -34
  28. package/esm2015/gantt.module.js +56 -25
  29. package/esm2015/gantt.pipe.js +26 -16
  30. package/esm2015/public-api.js +3 -1
  31. package/esm2015/root.component.js +37 -25
  32. package/esm2015/table/gantt-column.component.js +26 -17
  33. package/esm2015/table/gantt-table.component.js +13 -11
  34. package/esm2015/utils/helpers.js +11 -1
  35. package/esm2015/views/view.js +1 -1
  36. package/esm2015/views/year.js +3 -3
  37. package/esm2015/worktile-gantt.js +1 -12
  38. package/fesm2015/worktile-gantt.js +1342 -1205
  39. package/fesm2015/worktile-gantt.js.map +1 -1
  40. package/gantt-abstract.d.ts +12 -0
  41. package/gantt-dom.service.d.ts +3 -0
  42. package/gantt-drag-container.d.ts +3 -0
  43. package/gantt-item-upper.d.ts +3 -0
  44. package/gantt-print.service.d.ts +3 -0
  45. package/gantt-upper.d.ts +3 -1
  46. package/gantt.component.d.ts +3 -2
  47. package/gantt.module.d.ts +19 -0
  48. package/gantt.pipe.d.ts +7 -0
  49. package/{style.scss → main.bundle.scss} +63 -63
  50. package/package.json +4 -5
  51. package/public-api.d.ts +2 -0
  52. package/root.component.d.ts +3 -0
  53. package/table/gantt-column.component.d.ts +3 -0
  54. package/table/gantt-table.component.d.ts +3 -0
  55. package/utils/helpers.d.ts +2 -1
  56. package/worktile-gantt.d.ts +1 -11
  57. package/bundles/worktile-gantt.umd.min.js +0 -16
  58. package/bundles/worktile-gantt.umd.min.js.map +0 -1
  59. package/worktile-gantt.metadata.json +0 -1
@@ -2,10 +2,33 @@
2
2
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('rxjs/operators'), require('rxjs'), require('date-fns'), require('@angular/cdk/coercion'), require('@angular/cdk/drag-drop'), require('html2canvas')) :
3
3
  typeof define === 'function' && define.amd ? define('@worktile/gantt', ['exports', '@angular/core', '@angular/common', 'rxjs/operators', 'rxjs', 'date-fns', '@angular/cdk/coercion', '@angular/cdk/drag-drop', 'html2canvas'], factory) :
4
4
  (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.worktile = global.worktile || {}, global.worktile.gantt = {}), global.ng.core, global.ng.common, global.rxjs.operators, global.rxjs, global.dateFns, global.ng.cdk.coercion, global.ng.cdk.dragDrop, global.html2canvas));
5
- }(this, (function (exports, core, common, operators, rxjs, dateFns, coercion, dragDrop, html2canvas) { 'use strict';
5
+ }(this, (function (exports, i0, i2, operators, rxjs, dateFns, coercion, i1, html2canvas) { 'use strict';
6
6
 
7
7
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
8
 
9
+ function _interopNamespace(e) {
10
+ if (e && e.__esModule) return e;
11
+ var n = Object.create(null);
12
+ if (e) {
13
+ Object.keys(e).forEach(function (k) {
14
+ if (k !== 'default') {
15
+ var d = Object.getOwnPropertyDescriptor(e, k);
16
+ Object.defineProperty(n, k, d.get ? d : {
17
+ enumerable: true,
18
+ get: function () {
19
+ return e[k];
20
+ }
21
+ });
22
+ }
23
+ });
24
+ }
25
+ n['default'] = e;
26
+ return Object.freeze(n);
27
+ }
28
+
29
+ var i0__namespace = /*#__PURE__*/_interopNamespace(i0);
30
+ var i2__namespace = /*#__PURE__*/_interopNamespace(i2);
31
+ var i1__namespace = /*#__PURE__*/_interopNamespace(i1);
9
32
  var html2canvas__default = /*#__PURE__*/_interopDefaultLegacy(html2canvas);
10
33
 
11
34
  /*! *****************************************************************************
@@ -527,6 +550,7 @@
527
550
  return GanttDate;
528
551
  }());
529
552
 
553
+ exports.GanttViewType = void 0;
530
554
  (function (GanttViewType) {
531
555
  GanttViewType["day"] = "day";
532
556
  GanttViewType["quarter"] = "quarter";
@@ -535,6 +559,7 @@
535
559
  GanttViewType["week"] = "week";
536
560
  })(exports.GanttViewType || (exports.GanttViewType = {}));
537
561
 
562
+ exports.GanttItemType = void 0;
538
563
  (function (GanttItemType) {
539
564
  GanttItemType["bar"] = "bar";
540
565
  GanttItemType["range"] = "range";
@@ -610,7 +635,7 @@
610
635
  this.origin.expanded = expanded;
611
636
  };
612
637
  GanttItemInternal.prototype.addLink = function (linkId) {
613
- this.links = __spread(this.links, [linkId]);
638
+ this.links = __spreadArray(__spreadArray([], __read(this.links)), [linkId]);
614
639
  this.origin.links = this.links;
615
640
  };
616
641
  return GanttItemInternal;
@@ -636,14 +661,14 @@
636
661
 
637
662
  var primaryDatePointTop = 18;
638
663
  var secondaryDatePointTop = 36;
639
- var viewOptions = {
664
+ var viewOptions$5 = {
640
665
  min: new GanttDate().addYears(-1).startOfYear(),
641
666
  max: new GanttDate().addYears(1).endOfYear()
642
667
  };
643
668
  var GanttView = /** @class */ (function () {
644
669
  function GanttView(start, end, options) {
645
670
  this.showTimeline = true;
646
- this.options = Object.assign({}, viewOptions, options);
671
+ this.options = Object.assign({}, viewOptions$5, options);
647
672
  var startDate = start.isCustom
648
673
  ? this.startOf(start.date)
649
674
  : this.startOf(start.date.value < this.options.start.value ? start.date : this.options.start);
@@ -762,7 +787,7 @@
762
787
  return GanttView;
763
788
  }());
764
789
 
765
- var viewOptions$1 = {
790
+ var viewOptions$4 = {
766
791
  start: new GanttDate().startOfQuarter().addQuarters(-1),
767
792
  end: new GanttDate().endOfQuarter().addQuarters(2),
768
793
  cellWidth: 280,
@@ -772,7 +797,7 @@
772
797
  var GanttViewMonth = /** @class */ (function (_super) {
773
798
  __extends(GanttViewMonth, _super);
774
799
  function GanttViewMonth(start, end, options) {
775
- return _super.call(this, start, end, Object.assign({}, viewOptions$1, options)) || this;
800
+ return _super.call(this, start, end, Object.assign({}, viewOptions$4, options)) || this;
776
801
  }
777
802
  GanttViewMonth.prototype.startOf = function (date) {
778
803
  return date.startOfQuarter();
@@ -809,7 +834,7 @@
809
834
  return GanttViewMonth;
810
835
  }(GanttView));
811
836
 
812
- var viewOptions$2 = {
837
+ var viewOptions$3 = {
813
838
  start: new GanttDate().addYears(-1).startOfYear(),
814
839
  end: new GanttDate().addYears(1).endOfYear(),
815
840
  min: new GanttDate().addYears(-2).startOfYear(),
@@ -821,7 +846,7 @@
821
846
  var GanttViewQuarter = /** @class */ (function (_super) {
822
847
  __extends(GanttViewQuarter, _super);
823
848
  function GanttViewQuarter(start, end, options) {
824
- return _super.call(this, start, end, Object.assign({}, viewOptions$2, options)) || this;
849
+ return _super.call(this, start, end, Object.assign({}, viewOptions$3, options)) || this;
825
850
  }
826
851
  GanttViewQuarter.prototype.startOf = function (date) {
827
852
  return date.startOfYear();
@@ -858,7 +883,7 @@
858
883
  return GanttViewQuarter;
859
884
  }(GanttView));
860
885
 
861
- var viewOptions$3 = {
886
+ var viewOptions$2 = {
862
887
  cellWidth: 35,
863
888
  start: new GanttDate().startOfYear().startOfWeek({ weekStartsOn: 1 }),
864
889
  end: new GanttDate().endOfYear().endOfWeek({ weekStartsOn: 1 }),
@@ -868,7 +893,7 @@
868
893
  var GanttViewDay = /** @class */ (function (_super) {
869
894
  __extends(GanttViewDay, _super);
870
895
  function GanttViewDay(start, end, options) {
871
- var _this = _super.call(this, start, end, Object.assign({}, viewOptions$3, options)) || this;
896
+ var _this = _super.call(this, start, end, Object.assign({}, viewOptions$2, options)) || this;
872
897
  _this.showWeekBackdrop = true;
873
898
  _this.showTimeline = false;
874
899
  return _this;
@@ -912,7 +937,7 @@
912
937
  return GanttViewDay;
913
938
  }(GanttView));
914
939
 
915
- var viewOptions$4 = {
940
+ var viewOptions$1 = {
916
941
  cellWidth: 280,
917
942
  start: new GanttDate().startOfYear().startOfWeek({ weekStartsOn: 1 }),
918
943
  end: new GanttDate().endOfYear().endOfWeek({ weekStartsOn: 1 }),
@@ -922,7 +947,7 @@
922
947
  var GanttViewWeek = /** @class */ (function (_super) {
923
948
  __extends(GanttViewWeek, _super);
924
949
  function GanttViewWeek(start, end, options) {
925
- return _super.call(this, start, end, Object.assign({}, viewOptions$4, options)) || this;
950
+ return _super.call(this, start, end, Object.assign({}, viewOptions$1, options)) || this;
926
951
  }
927
952
  GanttViewWeek.prototype.startOf = function (date) {
928
953
  return date.startOfWeek({ weekStartsOn: 1 });
@@ -960,17 +985,17 @@
960
985
  return GanttViewWeek;
961
986
  }(GanttView));
962
987
 
963
- var viewOptions$5 = {
988
+ var viewOptions = {
964
989
  cellWidth: 480,
965
- start: new GanttDate().addYears(-1).startOfYear(),
966
- end: new GanttDate().addYears(1).endOfYear(),
990
+ start: new GanttDate().addYears(-2).startOfYear(),
991
+ end: new GanttDate().addYears(2).endOfYear(),
967
992
  addAmount: 1,
968
993
  addUnit: 'year'
969
994
  };
970
995
  var GanttViewYear = /** @class */ (function (_super) {
971
996
  __extends(GanttViewYear, _super);
972
997
  function GanttViewYear(start, end, options) {
973
- return _super.call(this, start, end, Object.assign({}, viewOptions$5, options)) || this;
998
+ return _super.call(this, start, end, Object.assign({}, viewOptions, options)) || this;
974
999
  }
975
1000
  GanttViewYear.prototype.startOf = function (date) {
976
1001
  return date.startOfYear();
@@ -1080,7 +1105,17 @@
1080
1105
  (items || []).forEach(function (item) {
1081
1106
  result.push(item);
1082
1107
  if (item.expanded && item.children) {
1083
- result.push.apply(result, __spread(recursiveItems(item.children)));
1108
+ result.push.apply(result, __spreadArray([], __read(recursiveItems(item.children))));
1109
+ }
1110
+ });
1111
+ return result;
1112
+ }
1113
+ function getFlatItems(items) {
1114
+ var result = [];
1115
+ (items || []).forEach(function (item) {
1116
+ result.push(item);
1117
+ if (item.children) {
1118
+ result.push.apply(result, __spreadArray([], __read(getFlatItems(item.children))));
1084
1119
  }
1085
1120
  });
1086
1121
  return result;
@@ -1095,18 +1130,17 @@
1095
1130
  this.originGroups = [];
1096
1131
  this.viewType = exports.GanttViewType.month;
1097
1132
  this.showTodayLine = true;
1098
- this.loadOnScroll = new core.EventEmitter();
1099
- this.dragStarted = new core.EventEmitter();
1100
- this.dragEnded = new core.EventEmitter();
1101
- this.barClick = new core.EventEmitter();
1102
- this.linkDragEnded = new core.EventEmitter();
1133
+ this.loadOnScroll = new i0.EventEmitter();
1134
+ this.dragStarted = new i0.EventEmitter();
1135
+ this.dragEnded = new i0.EventEmitter();
1136
+ this.barClick = new i0.EventEmitter();
1137
+ this.linkDragEnded = new i0.EventEmitter();
1103
1138
  this.items = [];
1104
1139
  this.groups = [];
1105
- this.viewChange = new core.EventEmitter();
1106
- this.expandChange = new core.EventEmitter();
1140
+ this.viewChange = new i0.EventEmitter();
1141
+ this.expandChange = new i0.EventEmitter();
1107
1142
  this.firstChange = true;
1108
1143
  this.unsubscribe$ = new rxjs.Subject();
1109
- this.expandedItemIds = [];
1110
1144
  this.ganttClass = true;
1111
1145
  }
1112
1146
  Object.defineProperty(GanttUpper.prototype, "element", {
@@ -1135,21 +1169,6 @@
1135
1169
  GanttUpper.prototype.setupItems = function () {
1136
1170
  var _this = this;
1137
1171
  this.originItems = uniqBy(this.originItems, 'id');
1138
- // 根据上一次数据展开状态同步新的数据展开状态
1139
- this.originItems.forEach(function (originItem) {
1140
- var _a, _b;
1141
- var oldItem = _this.items.find(function (item) {
1142
- return item.id === originItem.id;
1143
- });
1144
- if (!_this.firstChange) {
1145
- if (oldItem && !((_a = oldItem.children) === null || _a === void 0 ? void 0 : _a.length) && ((_b = originItem.children) === null || _b === void 0 ? void 0 : _b.length)) {
1146
- originItem.expanded = originItem.expanded || _this.expandedItemIds.includes(originItem.id);
1147
- }
1148
- else {
1149
- originItem.expanded = _this.expandedItemIds.includes(originItem.id);
1150
- }
1151
- }
1152
- });
1153
1172
  this.items = [];
1154
1173
  if (this.groups.length > 0) {
1155
1174
  this.originItems.forEach(function (origin) {
@@ -1168,18 +1187,23 @@
1168
1187
  }
1169
1188
  };
1170
1189
  GanttUpper.prototype.setupExpandedState = function () {
1171
- var _this = this;
1190
+ this.originItems = uniqBy(this.originItems, 'id');
1172
1191
  var items = [];
1192
+ var flatOriginItems = getFlatItems(this.originItems);
1173
1193
  if (this.items.length > 0) {
1174
1194
  items = recursiveItems(this.items);
1175
1195
  }
1176
1196
  else {
1177
1197
  items = flatten(this.groups.map(function (group) { return recursiveItems(group.items); }));
1178
1198
  }
1179
- this.expandedItemIds = [];
1180
1199
  items.forEach(function (item) {
1181
1200
  if (item.origin.expanded) {
1182
- _this.expandedItemIds.push(item.id);
1201
+ var newItem = flatOriginItems.find(function (originItem) { return originItem.id === item.id; });
1202
+ if (newItem) {
1203
+ if (newItem.expanded === undefined) {
1204
+ newItem.expanded = true;
1205
+ }
1206
+ }
1183
1207
  }
1184
1208
  });
1185
1209
  };
@@ -1212,10 +1236,10 @@
1212
1236
  var _this = this;
1213
1237
  this.groups.forEach(function (group) {
1214
1238
  var groupItems = recursiveItems(group.items);
1215
- _this.computeItemsRefs.apply(_this, __spread(groupItems));
1239
+ _this.computeItemsRefs.apply(_this, __spreadArray([], __read(groupItems)));
1216
1240
  });
1217
1241
  var items = recursiveItems(this.items);
1218
- this.computeItemsRefs.apply(this, __spread(items));
1242
+ this.computeItemsRefs.apply(this, __spreadArray([], __read(items)));
1219
1243
  };
1220
1244
  GanttUpper.prototype.expandGroups = function (expanded) {
1221
1245
  this.groups.forEach(function (group) {
@@ -1302,37 +1326,60 @@
1302
1326
  };
1303
1327
  return GanttUpper;
1304
1328
  }());
1305
- GanttUpper.decorators = [
1306
- { type: core.Directive }
1307
- ];
1308
- GanttUpper.ctorParameters = function () { return [
1309
- { type: core.ElementRef },
1310
- { type: core.ChangeDetectorRef },
1311
- { type: core.NgZone }
1312
- ]; };
1313
- GanttUpper.propDecorators = {
1314
- originItems: [{ type: core.Input, args: ['items',] }],
1315
- originGroups: [{ type: core.Input, args: ['groups',] }],
1316
- viewType: [{ type: core.Input }],
1317
- start: [{ type: core.Input }],
1318
- end: [{ type: core.Input }],
1319
- showTodayLine: [{ type: core.Input }],
1320
- draggable: [{ type: core.Input }],
1321
- styles: [{ type: core.Input }],
1322
- viewOptions: [{ type: core.Input }],
1323
- disabledLoadOnScroll: [{ type: core.Input }],
1324
- loadOnScroll: [{ type: core.Output }],
1325
- dragStarted: [{ type: core.Output }],
1326
- dragEnded: [{ type: core.Output }],
1327
- barClick: [{ type: core.Output }],
1328
- barTemplate: [{ type: core.ContentChild, args: ['bar', { static: true },] }],
1329
- rangeTemplate: [{ type: core.ContentChild, args: ['range', { static: true },] }],
1330
- itemTemplate: [{ type: core.ContentChild, args: ['item', { static: true },] }],
1331
- groupTemplate: [{ type: core.ContentChild, args: ['group', { static: true },] }],
1332
- groupHeaderTemplate: [{ type: core.ContentChild, args: ['groupHeader', { static: true },] }],
1333
- ganttClass: [{ type: core.HostBinding, args: ['class.gantt',] }]
1334
- };
1335
- var GANTT_UPPER_TOKEN = new core.InjectionToken('GANTT_UPPER_TOKEN');
1329
+ 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 }], target: i0__namespace.ɵɵFactoryTarget.Directive });
1330
+ GanttUpper.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.1.2", type: GanttUpper, inputs: { originItems: ["items", "originItems"], originGroups: ["groups", "originGroups"], viewType: "viewType", start: "start", end: "end", showTodayLine: "showTodayLine", draggable: "draggable", styles: "styles", viewOptions: "viewOptions", disabledLoadOnScroll: "disabledLoadOnScroll" }, outputs: { loadOnScroll: "loadOnScroll", dragStarted: "dragStarted", 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 });
1331
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0__namespace, type: GanttUpper, decorators: [{
1332
+ type: i0.Directive
1333
+ }], ctorParameters: function () { return [{ type: i0__namespace.ElementRef }, { type: i0__namespace.ChangeDetectorRef }, { type: i0__namespace.NgZone }]; }, propDecorators: { originItems: [{
1334
+ type: i0.Input,
1335
+ args: ['items']
1336
+ }], originGroups: [{
1337
+ type: i0.Input,
1338
+ args: ['groups']
1339
+ }], viewType: [{
1340
+ type: i0.Input
1341
+ }], start: [{
1342
+ type: i0.Input
1343
+ }], end: [{
1344
+ type: i0.Input
1345
+ }], showTodayLine: [{
1346
+ type: i0.Input
1347
+ }], draggable: [{
1348
+ type: i0.Input
1349
+ }], styles: [{
1350
+ type: i0.Input
1351
+ }], viewOptions: [{
1352
+ type: i0.Input
1353
+ }], disabledLoadOnScroll: [{
1354
+ type: i0.Input
1355
+ }], loadOnScroll: [{
1356
+ type: i0.Output
1357
+ }], dragStarted: [{
1358
+ type: i0.Output
1359
+ }], dragEnded: [{
1360
+ type: i0.Output
1361
+ }], barClick: [{
1362
+ type: i0.Output
1363
+ }], barTemplate: [{
1364
+ type: i0.ContentChild,
1365
+ args: ['bar', { static: true }]
1366
+ }], rangeTemplate: [{
1367
+ type: i0.ContentChild,
1368
+ args: ['range', { static: true }]
1369
+ }], itemTemplate: [{
1370
+ type: i0.ContentChild,
1371
+ args: ['item', { static: true }]
1372
+ }], groupTemplate: [{
1373
+ type: i0.ContentChild,
1374
+ args: ['group', { static: true }]
1375
+ }], groupHeaderTemplate: [{
1376
+ type: i0.ContentChild,
1377
+ args: ['groupHeader', { static: true }]
1378
+ }], ganttClass: [{
1379
+ type: i0.HostBinding,
1380
+ args: ['class.gantt']
1381
+ }] } });
1382
+ var GANTT_UPPER_TOKEN = new i0.InjectionToken('GANTT_UPPER_TOKEN');
1336
1383
 
1337
1384
  var NgxGanttTableColumnComponent = /** @class */ (function () {
1338
1385
  function NgxGanttTableColumnComponent(ganttUpper) {
@@ -1348,223 +1395,158 @@
1348
1395
  NgxGanttTableColumnComponent.prototype.ngOnInit = function () { };
1349
1396
  return NgxGanttTableColumnComponent;
1350
1397
  }());
1351
- NgxGanttTableColumnComponent.decorators = [
1352
- { type: core.Component, args: [{
1353
- selector: 'ngx-gantt-column',
1354
- template: ''
1355
- },] }
1356
- ];
1357
- NgxGanttTableColumnComponent.ctorParameters = function () { return [
1358
- { type: GanttUpper, decorators: [{ type: core.Inject, args: [GANTT_UPPER_TOKEN,] }] }
1359
- ]; };
1360
- NgxGanttTableColumnComponent.propDecorators = {
1361
- width: [{ type: core.Input }],
1362
- name: [{ type: core.Input }],
1363
- templateRef: [{ type: core.ContentChild, args: ['cell', { static: true },] }],
1364
- headerTemplateRef: [{ type: core.ContentChild, args: ['header', { static: true },] }]
1365
- };
1398
+ 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 });
1399
+ 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 });
1400
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0__namespace, type: NgxGanttTableColumnComponent, decorators: [{
1401
+ type: i0.Component,
1402
+ args: [{
1403
+ selector: 'ngx-gantt-column',
1404
+ template: ''
1405
+ }]
1406
+ }], ctorParameters: function () {
1407
+ return [{ type: GanttUpper, decorators: [{
1408
+ type: i0.Inject,
1409
+ args: [GANTT_UPPER_TOKEN]
1410
+ }] }];
1411
+ }, propDecorators: { width: [{
1412
+ type: i0.Input
1413
+ }], name: [{
1414
+ type: i0.Input
1415
+ }], templateRef: [{
1416
+ type: i0.ContentChild,
1417
+ args: ['cell', { static: true }]
1418
+ }], headerTemplateRef: [{
1419
+ type: i0.ContentChild,
1420
+ args: ['header', { static: true }]
1421
+ }] } });
1366
1422
 
1367
1423
  var NgxGanttTableComponent = /** @class */ (function () {
1368
1424
  function NgxGanttTableComponent() {
1369
- this.columnChanges = new core.EventEmitter();
1425
+ this.columnChanges = new i0.EventEmitter();
1370
1426
  }
1371
1427
  NgxGanttTableComponent.prototype.ngOnInit = function () { };
1372
1428
  return NgxGanttTableComponent;
1373
1429
  }());
1374
- NgxGanttTableComponent.decorators = [
1375
- { type: core.Component, args: [{
1376
- selector: 'ngx-gantt-table',
1377
- template: ''
1378
- },] }
1379
- ];
1380
- NgxGanttTableComponent.ctorParameters = function () { return []; };
1381
- NgxGanttTableComponent.propDecorators = {
1382
- columnChanges: [{ type: core.Output }]
1383
- };
1430
+ NgxGanttTableComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0__namespace, type: NgxGanttTableComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
1431
+ NgxGanttTableComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.1.2", type: NgxGanttTableComponent, selector: "ngx-gantt-table", outputs: { columnChanges: "columnChanges" }, ngImport: i0__namespace, template: '', isInline: true });
1432
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0__namespace, type: NgxGanttTableComponent, decorators: [{
1433
+ type: i0.Component,
1434
+ args: [{
1435
+ selector: 'ngx-gantt-table',
1436
+ template: ''
1437
+ }]
1438
+ }], ctorParameters: function () { return []; }, propDecorators: { columnChanges: [{
1439
+ type: i0.Output
1440
+ }] } });
1384
1441
 
1385
- var defaultColumnWidth = 100;
1386
- var minColumnWidth = 80;
1387
- var NgxGanttComponent = /** @class */ (function (_super) {
1388
- __extends(NgxGanttComponent, _super);
1389
- function NgxGanttComponent(elementRef, cdr, ngZone) {
1390
- var _this = _super.call(this, elementRef, cdr, ngZone) || this;
1391
- _this.maxLevel = 2;
1392
- _this.linkDragStarted = new core.EventEmitter();
1393
- _this.linkDragEnded = new core.EventEmitter();
1394
- _this.lineClick = new core.EventEmitter();
1395
- _this.ngUnsubscribe$ = new rxjs.Subject();
1396
- _this.sideTableWidth = sideWidth;
1397
- return _this;
1398
- }
1399
- NgxGanttComponent.prototype.ngOnInit = function () {
1400
- var _this = this;
1401
- _super.prototype.onInit.call(this);
1402
- this.ngZone.onStable.pipe(operators.take(1)).subscribe(function () {
1403
- _this.dragContainer.linkDragStarted.pipe(operators.takeUntil(_this.ngUnsubscribe$)).subscribe(function (event) {
1404
- _this.linkDragStarted.emit(event);
1405
- });
1406
- _this.dragContainer.linkDragEnded.pipe(operators.takeUntil(_this.ngUnsubscribe$)).subscribe(function (event) {
1407
- _this.linkDragEnded.emit(event);
1408
- });
1409
- });
1410
- };
1411
- NgxGanttComponent.prototype.ngAfterViewInit = function () {
1412
- var _this = this;
1413
- this.columns.changes.pipe(operators.startWith(true), operators.takeUntil(this.ngUnsubscribe$)).subscribe(function () {
1414
- _this.columns.forEach(function (column) {
1415
- if (!column.columnWidth) {
1416
- column.columnWidth = coercion.coerceCssPixelValue(defaultColumnWidth);
1417
- }
1418
- });
1419
- _this.cdr.detectChanges();
1420
- });
1421
- };
1422
- NgxGanttComponent.prototype.ngOnChanges = function (changes) {
1423
- _super.prototype.onChanges.call(this, changes);
1424
- };
1425
- NgxGanttComponent.prototype.expandChildren = function (item) {
1426
- var _this = this;
1427
- if (!item.expanded) {
1428
- item.setExpand(true);
1429
- if (this.async && this.childrenResolve && item.children.length === 0) {
1430
- item.loading = true;
1431
- this.childrenResolve(item.origin)
1432
- .pipe(operators.take(1), operators.finalize(function () {
1433
- item.loading = false;
1434
- _this.expandChange.emit();
1435
- _this.cdr.detectChanges();
1436
- }))
1437
- .subscribe(function (items) {
1438
- item.addChildren(items);
1439
- _this.computeItemsRefs.apply(_this, __spread(item.children));
1440
- });
1441
- }
1442
- else {
1443
- this.computeItemsRefs.apply(this, __spread(item.children));
1444
- this.expandChange.emit();
1445
- }
1446
- }
1447
- else {
1448
- item.setExpand(false);
1449
- this.expandChange.emit();
1450
- }
1451
- };
1452
- NgxGanttComponent.prototype.ngOnDestroy = function () {
1453
- _super.prototype.onDestroy.call(this);
1454
- };
1455
- return NgxGanttComponent;
1456
- }(GanttUpper));
1457
- NgxGanttComponent.decorators = [
1458
- { type: core.Component, args: [{
1459
- selector: 'ngx-gantt',
1460
- template: "<ngx-gantt-root>\n <ng-template #sideTemplate>\n <gantt-table [groups]=\"groups\" [items]=\"items\" [columns]=\"columns\" [groupTemplate]=\"groupTemplate\" [emptyTemplate]=\"tableEmptyTemplate\"></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",
1461
- changeDetection: core.ChangeDetectionStrategy.OnPush,
1462
- providers: [
1463
- {
1464
- provide: GANTT_UPPER_TOKEN,
1465
- useExisting: NgxGanttComponent
1466
- }
1467
- ]
1468
- },] }
1469
- ];
1470
- NgxGanttComponent.ctorParameters = function () { return [
1471
- { type: core.ElementRef },
1472
- { type: core.ChangeDetectorRef },
1473
- { type: core.NgZone }
1474
- ]; };
1475
- NgxGanttComponent.propDecorators = {
1476
- maxLevel: [{ type: core.Input }],
1477
- async: [{ type: core.Input }],
1478
- childrenResolve: [{ type: core.Input }],
1479
- linkable: [{ type: core.Input }],
1480
- linkDragStarted: [{ type: core.Output }],
1481
- linkDragEnded: [{ type: core.Output }],
1482
- lineClick: [{ type: core.Output }],
1483
- table: [{ type: core.ContentChild, args: [NgxGanttTableComponent,] }],
1484
- columns: [{ type: core.ContentChildren, args: [NgxGanttTableColumnComponent, { descendants: true },] }],
1485
- tableEmptyTemplate: [{ type: core.ContentChild, args: ['tableEmpty', { static: true },] }]
1442
+ var GANTT_ABSTRACT_TOKEN = new i0.InjectionToken('gantt-abstract-token');
1443
+
1444
+ 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>";
1445
+ 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>";
1446
+ 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>";
1447
+ var minusSquare = "<svg viewBox=\"0 0 16 16\" xmlns=\"http://www.w3.org/2000/svg\" fit=\"\" preserveAspectRatio=\"xMidYMid meet\" focusable=\"false\"><g id=\"jnaction/minus-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-.8H2zm2.8 6.2h6.5v1.2H4.8V7.4z\"></path></g></svg>";
1448
+ var loadingIcon = "<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" viewBox=\"0 0 50 50\" style=\"enable-background:new 0 0 50 50\" xml:space=\"preserve\">\n<path fill=\"#aaa\" d=\"M25.251,6.461c-10.318,0-18.683,8.365-18.683,18.683h4.068c0-8.071,6.543-14.615,14.615-14.615V6.461z\" transform=\"rotate(275.098 25 25)\">\n <animateTransform attributeType=\"xml\" attributeName=\"transform\" type=\"rotate\" from=\"0 25 25\" to=\"360 25 25\" dur=\"0.6s\" repeatCount=\"indefinite\"></animateTransform>\n</path>\n</svg>";
1449
+ var emptyIcon = "<svg\nwidth=\"148px\"\nheight=\"134px\"\nviewBox=\"0 0 148 134\"\nversion=\"1.1\"\nxmlns=\"http://www.w3.org/2000/svg\"\nxmlns:xlink=\"http://www.w3.org/1999/xlink\"\n>\n<defs>\n <filter x=\"0.0%\" y=\"0.0%\" width=\"100.0%\" height=\"100.0%\" filterUnits=\"objectBoundingBox\" id=\"filter-1\">\n <feGaussianBlur stdDeviation=\"0\" in=\"SourceGraphic\"></feGaussianBlur>\n </filter>\n</defs>\n<g id=\"148x134\" stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\">\n <g id=\"\u7F16\u7EC4-6\" transform=\"translate(1.000000, 1.000000)\">\n <ellipse\n id=\"\u692D\u5706\u5F62\"\n fill=\"#EDEEF2\"\n opacity=\"0.3\"\n filter=\"url(#filter-1)\"\n cx=\"73.0800017\"\n cy=\"115.920003\"\n rx=\"73.0800017\"\n ry=\"16.8000004\"\n ></ellipse>\n <g id=\"\u7F16\u7EC4-5\" transform=\"translate(15.120000, 0.000000)\">\n <polygon\n id=\"\u77E9\u5F62\"\n fill=\"#E2E4E9\"\n points=\"19.2789848 49.5600011 99.1200023 48.7200011 117.600003 75.9297673 117.600003 92.313049 0 92.313049 0 75.0356267\"\n ></polygon>\n <path\n d=\"M23.5200005,0 L94.0800002,0 C97.7913538,2.06413823e-16 100.8,3.00864655 100.8,6.72000015 L100.8,99.1200023 L100.8,99.1200023 L16.8000004,99.1200023 L16.8000004,6.72000015 C16.8000004,3.00864655 19.8086469,1.56994302e-15 23.5200005,0 Z\"\n id=\"\u77E9\u5F62\"\n fill=\"#F9FAFB\"\n ></path>\n <path\n d=\"M30.9200007,12.4400003 L86.6800019,12.4400003 C88.5356787,12.4400003 90.040002,13.9443236 90.040002,15.8000004 L90.040002,42.000001 C90.040002,43.8556778 88.5356787,45.360001 86.6800019,45.360001 L30.9200007,45.360001 C29.0643239,45.360001 27.5600006,43.8556778 27.5600006,42.000001 L27.5600006,15.8000004 C27.5600006,13.9443236 29.0643239,12.4400003 30.9200007,12.4400003 Z\"\n id=\"\u77E9\u5F62\"\n fill=\"#E8EAEE\"\n ></path>\n <text\n id=\"&lt;/null&gt;\"\n font-family=\"PingFangSC-Medium, PingFang SC\"\n font-size=\"15.1200003\"\n font-weight=\"400\"\n fill=\"#BCBECD\"\n >\n <tspan x=\"33.6000008\" y=\"32.8000004\">&lt;/null&gt;</tspan>\n </text>\n <rect id=\"\u77E9\u5F62\" fill=\"#E8EAEE\" x=\"27.5600006\" y=\"52.0800012\" width=\"61.4800014\" height=\"5.04000011\" rx=\"2.52000006\"></rect>\n <rect\n id=\"\u77E9\u5F62\u5907\u4EFD\"\n fill=\"#E8EAEE\"\n x=\"27.5600006\"\n y=\"63.8400014\"\n width=\"61.4800014\"\n height=\"5.04000011\"\n rx=\"2.52000006\"\n ></rect>\n <path\n d=\"M0,75.6000017 L29.280235,75.6000017 C32.0637502,75.6000017 34.3202352,77.8564866 34.3202352,80.6400018 L34.3202352,86.2591426 C34.3202352,89.0426578 36.5767201,91.2991427 39.3602353,91.2991427 L78.4136737,91.2991427 C81.1971889,91.2991427 83.4536738,89.0426578 83.4536738,86.2591426 L83.4536738,80.6400018 C83.4536738,77.8564866 85.7101587,75.6000017 88.4936739,75.6000017 L117.600003,75.6000017 L117.600003,75.6000017 L117.600003,110.880003 C117.600003,115.519195 113.839194,119.280003 109.200002,119.280003 L8.40000019,119.280003 C3.76080819,119.280003 -6.53729019e-15,115.519195 0,110.880003 L0,75.6000017 L0,75.6000017 Z\"\n id=\"\u77E9\u5F62\"\n fill=\"#EDEFF2\"\n ></path>\n </g>\n </g>\n</g>\n</svg>";
1450
+ var icons = {
1451
+ 'angle-right': angleRight,
1452
+ 'angle-down': angleDown,
1453
+ 'plus-square': plusSquare,
1454
+ 'minus-square': minusSquare,
1455
+ loading: loadingIcon,
1456
+ empty: emptyIcon
1486
1457
  };
1487
1458
 
1488
- var mainHeight = 5000;
1489
- var GanttCalendarComponent = /** @class */ (function () {
1490
- function GanttCalendarComponent(ganttUpper, ngZone, elementRef) {
1491
- this.ganttUpper = ganttUpper;
1492
- this.ngZone = ngZone;
1459
+ var GanttIconComponent = /** @class */ (function () {
1460
+ function GanttIconComponent(elementRef) {
1493
1461
  this.elementRef = elementRef;
1494
- this.unsubscribe$ = new rxjs.Subject();
1495
- this.headerHeight = headerHeight;
1496
- this.mainHeight = mainHeight;
1497
- this.todayHeight = todayHeight;
1498
- this.todayWidth = todayWidth;
1499
- this.todayBorderRadius = todayBorderRadius;
1500
- this.viewTypes = exports.GanttViewType;
1501
- this.className = true;
1462
+ this.isIcon = true;
1502
1463
  }
1503
- Object.defineProperty(GanttCalendarComponent.prototype, "view", {
1504
- get: function () {
1505
- return this.ganttUpper.view;
1464
+ Object.defineProperty(GanttIconComponent.prototype, "iconName", {
1465
+ set: function (name) {
1466
+ this.setSvg(name);
1506
1467
  },
1507
1468
  enumerable: false,
1508
1469
  configurable: true
1509
1470
  });
1510
- GanttCalendarComponent.prototype.setTodayPoint = function () {
1511
- var x = this.view.getTodayXPoint();
1512
- var today = new GanttDate().getDate();
1513
- var todayEle = this.elementRef.nativeElement.getElementsByClassName('gantt-calendar-today-overlay')[0];
1514
- var rect = this.elementRef.nativeElement.getElementsByClassName('today-rect')[0];
1515
- var line = this.elementRef.nativeElement.getElementsByClassName('today-line')[0];
1516
- if (isNumber(x)) {
1517
- if (rect) {
1518
- rect.style.left = x - todayWidth / 2 + "px";
1519
- rect.style.top = headerHeight - todayHeight + "px";
1520
- rect.innerHTML = today.toString();
1521
- }
1522
- if (line) {
1523
- line.style.left = x + "px";
1524
- line.style.top = headerHeight + "px";
1525
- line.style.bottom = -mainHeight + "px";
1526
- }
1471
+ GanttIconComponent.prototype.ngOnInit = function () { };
1472
+ GanttIconComponent.prototype.ngAfterViewInit = function () { };
1473
+ GanttIconComponent.prototype.setSvg = function (name) {
1474
+ var iconSvg = icons[name];
1475
+ if (iconSvg) {
1476
+ this.elementRef.nativeElement.innerHTML = iconSvg;
1527
1477
  }
1528
1478
  else {
1529
- todayEle.style.display = 'none';
1479
+ this.elementRef.nativeElement.innerHTML = '';
1530
1480
  }
1531
1481
  };
1532
- GanttCalendarComponent.prototype.ngOnInit = function () {
1533
- var _this = this;
1534
- this.ngZone.onStable.pipe(operators.take(1)).subscribe(function () {
1535
- rxjs.merge(_this.ganttUpper.viewChange, _this.ganttUpper.view.start$)
1536
- .pipe(operators.takeUntil(_this.unsubscribe$))
1537
- .subscribe(function () {
1538
- _this.setTodayPoint();
1539
- });
1540
- });
1482
+ return GanttIconComponent;
1483
+ }());
1484
+ 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 });
1485
+ 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 });
1486
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0__namespace, type: GanttIconComponent, decorators: [{
1487
+ type: i0.Component,
1488
+ args: [{
1489
+ selector: 'gantt-icon',
1490
+ template: ''
1491
+ }]
1492
+ }], ctorParameters: function () { return [{ type: i0__namespace.ElementRef }]; }, propDecorators: { isIcon: [{
1493
+ type: i0.HostBinding,
1494
+ args: ['class.gantt-icon']
1495
+ }], iconName: [{
1496
+ type: i0.Input
1497
+ }] } });
1498
+
1499
+ var IsGanttRangeItemPipe = /** @class */ (function () {
1500
+ function IsGanttRangeItemPipe() {
1501
+ }
1502
+ IsGanttRangeItemPipe.prototype.transform = function (value) {
1503
+ return value === exports.GanttItemType.range;
1541
1504
  };
1542
- GanttCalendarComponent.prototype.ngAfterViewInit = function () { };
1543
- GanttCalendarComponent.prototype.ngOnChanges = function (changes) { };
1544
- GanttCalendarComponent.prototype.trackBy = function (point, index) {
1545
- return point.text || index;
1505
+ return IsGanttRangeItemPipe;
1506
+ }());
1507
+ IsGanttRangeItemPipe.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0__namespace, type: IsGanttRangeItemPipe, deps: [], target: i0__namespace.ɵɵFactoryTarget.Pipe });
1508
+ IsGanttRangeItemPipe.ɵpipe = i0__namespace.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0__namespace, type: IsGanttRangeItemPipe, name: "isGanttRangeItem" });
1509
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0__namespace, type: IsGanttRangeItemPipe, decorators: [{
1510
+ type: i0.Pipe,
1511
+ args: [{
1512
+ name: 'isGanttRangeItem'
1513
+ }]
1514
+ }] });
1515
+ var IsGanttBarItemPipe = /** @class */ (function () {
1516
+ function IsGanttBarItemPipe() {
1517
+ }
1518
+ IsGanttBarItemPipe.prototype.transform = function (value) {
1519
+ return value === exports.GanttItemType.bar;
1546
1520
  };
1547
- GanttCalendarComponent.prototype.ngOnDestroy = function () {
1548
- this.unsubscribe$.next();
1549
- this.unsubscribe$.complete();
1521
+ return IsGanttBarItemPipe;
1522
+ }());
1523
+ IsGanttBarItemPipe.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0__namespace, type: IsGanttBarItemPipe, deps: [], target: i0__namespace.ɵɵFactoryTarget.Pipe });
1524
+ IsGanttBarItemPipe.ɵpipe = i0__namespace.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0__namespace, type: IsGanttBarItemPipe, name: "isGanttBarItem" });
1525
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0__namespace, type: IsGanttBarItemPipe, decorators: [{
1526
+ type: i0.Pipe,
1527
+ args: [{
1528
+ name: 'isGanttBarItem'
1529
+ }]
1530
+ }] });
1531
+ var IsGanttCustomItemPipe = /** @class */ (function () {
1532
+ function IsGanttCustomItemPipe() {
1533
+ }
1534
+ IsGanttCustomItemPipe.prototype.transform = function (value) {
1535
+ return value === exports.GanttItemType.custom;
1550
1536
  };
1551
- return GanttCalendarComponent;
1537
+ return IsGanttCustomItemPipe;
1552
1538
  }());
1553
- GanttCalendarComponent.decorators = [
1554
- { type: core.Component, args: [{
1555
- selector: 'gantt-calendar-overlay',
1556
- 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"
1557
- },] }
1558
- ];
1559
- GanttCalendarComponent.ctorParameters = function () { return [
1560
- { type: GanttUpper, decorators: [{ type: core.Inject, args: [GANTT_UPPER_TOKEN,] }] },
1561
- { type: core.NgZone },
1562
- { type: core.ElementRef }
1563
- ]; };
1564
- GanttCalendarComponent.propDecorators = {
1565
- className: [{ type: core.HostBinding, args: ['class.gantt-calendar-overlay',] }]
1566
- };
1539
+ IsGanttCustomItemPipe.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0__namespace, type: IsGanttCustomItemPipe, deps: [], target: i0__namespace.ɵɵFactoryTarget.Pipe });
1540
+ IsGanttCustomItemPipe.ɵpipe = i0__namespace.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0__namespace, type: IsGanttCustomItemPipe, name: "isGanttCustomItem" });
1541
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0__namespace, type: IsGanttCustomItemPipe, decorators: [{
1542
+ type: i0.Pipe,
1543
+ args: [{
1544
+ name: 'isGanttCustomItem'
1545
+ }]
1546
+ }] });
1567
1547
 
1548
+ var defaultColumnWidth = 100;
1549
+ var minColumnWidth = 80;
1568
1550
  var GanttTableComponent = /** @class */ (function () {
1569
1551
  function GanttTableComponent(gantt, elementRef) {
1570
1552
  this.gantt = gantt;
@@ -1674,26 +1656,39 @@
1674
1656
  };
1675
1657
  return GanttTableComponent;
1676
1658
  }());
1677
- GanttTableComponent.decorators = [
1678
- { type: core.Component, args: [{
1679
- selector: 'gantt-table',
1680
- 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\">\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\">\n <div\n class=\"gantt-table-item gantt-table-row\"\n [class.gantt-table-item-first-level-group]=\"level === 0 && (item.type | isGanttRangeItem)\"\n [class.gantt-table-item-with-group]=\"group\"\n [style.height.px]=\"gantt.styles.lineHeight\"\n [style.lineHeight.px]=\"gantt.styles.lineHeight\"\n >\n <div class=\"gantt-table-column\" *ngFor=\"let column of columnList; let first = first\" [style.width]=\"column.columnWidth\">\n <div *ngIf=\"first\" class=\"gantt-expand-icon\" [style.marginLeft.px]=\"level * 20\">\n <ng-container *ngIf=\"level < gantt.maxLevel - 1 && item.expandable\">\n <gantt-icon\n *ngIf=\"!item.loading\"\n class=\"expand-icon\"\n [iconName]=\"item.expanded ? 'angle-down' : 'angle-right'\"\n (click)=\"expandChildren(item)\"\n ></gantt-icon>\n <gantt-icon *ngIf=\"item.loading\" [iconName]=\"'loading'\"></gantt-icon>\n </ng-container>\n </div>\n <div class=\"gantt-table-column-content\">\n <ng-template\n [ngTemplateOutlet]=\"column.templateRef\"\n [ngTemplateOutletContext]=\"{ $implicit: item.origin, item: item.origin }\"\n ></ng-template>\n </div>\n </div>\n </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"
1681
- },] }
1682
- ];
1683
- GanttTableComponent.ctorParameters = function () { return [
1684
- { type: NgxGanttComponent },
1685
- { type: core.ElementRef }
1686
- ]; };
1687
- GanttTableComponent.propDecorators = {
1688
- groups: [{ type: core.Input }],
1689
- items: [{ type: core.Input }],
1690
- columns: [{ type: core.Input }],
1691
- groupTemplate: [{ type: core.Input }],
1692
- emptyTemplate: [{ type: core.Input }],
1693
- draglineElementRef: [{ type: core.ViewChild, args: ['dragLine', { static: true },] }],
1694
- ganttTableClass: [{ type: core.HostBinding, args: ['class.gantt-table',] }],
1695
- ganttTableEmptyClass: [{ type: core.HostBinding, args: ['class.gantt-table-empty',] }]
1696
- };
1659
+ GanttTableComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0__namespace, type: GanttTableComponent, deps: [{ token: GANTT_ABSTRACT_TOKEN }, { token: i0__namespace.ElementRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
1660
+ 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" }, 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\">\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\">\n <div\n class=\"gantt-table-item gantt-table-row\"\n [class.gantt-table-item-first-level-group]=\"level === 0 && (item.type | isGanttRangeItem)\"\n [class.gantt-table-item-with-group]=\"group\"\n [style.height.px]=\"gantt.styles.lineHeight\"\n [style.lineHeight.px]=\"gantt.styles.lineHeight\"\n >\n <div class=\"gantt-table-column\" *ngFor=\"let column of columnList; let first = first\" [style.width]=\"column.columnWidth\">\n <div *ngIf=\"first\" class=\"gantt-expand-icon\" [style.marginLeft.px]=\"level * 20\">\n <ng-container *ngIf=\"level < gantt.maxLevel - 1 && item.expandable\">\n <gantt-icon\n *ngIf=\"!item.loading\"\n class=\"expand-icon\"\n [iconName]=\"item.expanded ? 'angle-down' : 'angle-right'\"\n (click)=\"expandChildren(item)\"\n ></gantt-icon>\n <gantt-icon *ngIf=\"item.loading\" [iconName]=\"'loading'\"></gantt-icon>\n </ng-container>\n </div>\n <div class=\"gantt-table-column-content\">\n <ng-template\n [ngTemplateOutlet]=\"column.templateRef\"\n [ngTemplateOutletContext]=\"{ $implicit: item.origin, item: item.origin }\"\n ></ng-template>\n </div>\n </div>\n </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 } });
1661
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0__namespace, type: GanttTableComponent, decorators: [{
1662
+ type: i0.Component,
1663
+ args: [{
1664
+ selector: 'gantt-table',
1665
+ templateUrl: './gantt-table.component.html'
1666
+ }]
1667
+ }], ctorParameters: function () {
1668
+ return [{ type: undefined, decorators: [{
1669
+ type: i0.Inject,
1670
+ args: [GANTT_ABSTRACT_TOKEN]
1671
+ }] }, { type: i0__namespace.ElementRef }];
1672
+ }, propDecorators: { groups: [{
1673
+ type: i0.Input
1674
+ }], items: [{
1675
+ type: i0.Input
1676
+ }], columns: [{
1677
+ type: i0.Input
1678
+ }], groupTemplate: [{
1679
+ type: i0.Input
1680
+ }], emptyTemplate: [{
1681
+ type: i0.Input
1682
+ }], draglineElementRef: [{
1683
+ type: i0.ViewChild,
1684
+ args: ['dragLine', { static: true }]
1685
+ }], ganttTableClass: [{
1686
+ type: i0.HostBinding,
1687
+ args: ['class.gantt-table']
1688
+ }], ganttTableEmptyClass: [{
1689
+ type: i0.HostBinding,
1690
+ args: ['class.gantt-table-empty']
1691
+ }] } });
1697
1692
 
1698
1693
  var scrollThreshold = 50;
1699
1694
  var ScrollDirection;
@@ -1791,18 +1786,19 @@
1791
1786
  };
1792
1787
  return GanttDomService;
1793
1788
  }());
1794
- GanttDomService.decorators = [
1795
- { type: core.Injectable }
1796
- ];
1797
- GanttDomService.ctorParameters = function () { return []; };
1789
+ GanttDomService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0__namespace, type: GanttDomService, deps: [], target: i0__namespace.ɵɵFactoryTarget.Injectable });
1790
+ GanttDomService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0__namespace, type: GanttDomService });
1791
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0__namespace, type: GanttDomService, decorators: [{
1792
+ type: i0.Injectable
1793
+ }], ctorParameters: function () { return []; } });
1798
1794
 
1799
1795
  var GanttDragContainer = /** @class */ (function () {
1800
1796
  function GanttDragContainer() {
1801
- this.dragStarted = new core.EventEmitter();
1802
- this.dragEnded = new core.EventEmitter();
1803
- this.linkDragStarted = new core.EventEmitter();
1804
- this.linkDragEntered = new core.EventEmitter();
1805
- this.linkDragEnded = new core.EventEmitter();
1797
+ this.dragStarted = new i0.EventEmitter();
1798
+ this.dragEnded = new i0.EventEmitter();
1799
+ this.linkDragStarted = new i0.EventEmitter();
1800
+ this.linkDragEntered = new i0.EventEmitter();
1801
+ this.linkDragEnded = new i0.EventEmitter();
1806
1802
  }
1807
1803
  GanttDragContainer.prototype.emitLinkDragStarted = function (from, item) {
1808
1804
  this.linkDraggingId = item.id;
@@ -1848,527 +1844,360 @@
1848
1844
  };
1849
1845
  return GanttDragContainer;
1850
1846
  }());
1851
- GanttDragContainer.decorators = [
1852
- { type: core.Injectable }
1853
- ];
1854
- GanttDragContainer.ctorParameters = function () { return []; };
1847
+ GanttDragContainer.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0__namespace, type: GanttDragContainer, deps: [], target: i0__namespace.ɵɵFactoryTarget.Injectable });
1848
+ GanttDragContainer.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0__namespace, type: GanttDragContainer });
1849
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0__namespace, type: GanttDragContainer, decorators: [{
1850
+ type: i0.Injectable
1851
+ }], ctorParameters: function () { return []; } });
1855
1852
 
1856
- var dragMinWidth = 10;
1857
- var activeClass = 'gantt-bar-active';
1858
- var linkDropClass = 'gantt-bar-link-drop';
1859
- function createSvgElement(qualifiedName, className) {
1860
- var element = document.createElementNS('http://www.w3.org/2000/svg', qualifiedName);
1861
- element.classList.add(className);
1862
- return element;
1863
- }
1864
- var GanttBarDrag = /** @class */ (function () {
1865
- function GanttBarDrag(dragDrop, dom, dragContainer) {
1866
- this.dragDrop = dragDrop;
1867
- this.dom = dom;
1868
- this.dragContainer = dragContainer;
1869
- this.dragRefs = [];
1870
- this.destroy$ = new rxjs.Subject();
1853
+ var GanttPrintService = /** @class */ (function () {
1854
+ function GanttPrintService() {
1871
1855
  }
1872
- Object.defineProperty(GanttBarDrag.prototype, "dragDisabled", {
1873
- get: function () {
1874
- return !this.item.draggable || !this.ganttUpper.draggable;
1875
- },
1876
- enumerable: false,
1877
- configurable: true
1878
- });
1879
- Object.defineProperty(GanttBarDrag.prototype, "linkDragDisabled", {
1880
- get: function () {
1881
- return !this.item.linkable || !this.ganttUpper.linkable;
1882
- },
1883
- enumerable: false,
1884
- configurable: true
1885
- });
1886
- GanttBarDrag.prototype.createMouseEvents = function () {
1887
- var _this = this;
1888
- rxjs.fromEvent(this.barElement, 'mouseenter')
1889
- .pipe(operators.takeUntil(this.destroy$))
1890
- .subscribe(function () {
1891
- if (_this.dragContainer.linkDraggingId && _this.dragContainer.linkDraggingId !== _this.item.id) {
1892
- if (_this.item.linkable) {
1893
- _this.barElement.classList.add(linkDropClass);
1894
- _this.dragContainer.emitLinkDragEntered(_this.item);
1895
- }
1856
+ GanttPrintService.prototype.setInlineStyles = function (targetElem) {
1857
+ var e_1, _a;
1858
+ var svgElements = Array.from(targetElem.getElementsByTagName('svg'));
1859
+ try {
1860
+ for (var svgElements_1 = __values(svgElements), svgElements_1_1 = svgElements_1.next(); !svgElements_1_1.done; svgElements_1_1 = svgElements_1.next()) {
1861
+ var svgElement = svgElements_1_1.value;
1862
+ this.recursElementChildren(svgElement);
1896
1863
  }
1897
- else {
1898
- _this.barElement.classList.add(activeClass);
1864
+ }
1865
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
1866
+ finally {
1867
+ try {
1868
+ if (svgElements_1_1 && !svgElements_1_1.done && (_a = svgElements_1.return)) _a.call(svgElements_1);
1899
1869
  }
1900
- });
1901
- rxjs.fromEvent(this.barElement, 'mouseleave')
1902
- .pipe(operators.takeUntil(this.destroy$))
1903
- .subscribe(function () {
1904
- if (!_this.dragContainer.linkDraggingId) {
1905
- _this.barElement.classList.remove(activeClass);
1870
+ finally { if (e_1) throw e_1.error; }
1871
+ }
1872
+ };
1873
+ GanttPrintService.prototype.recursElementChildren = function (node) {
1874
+ var e_2, _a, e_3, _b;
1875
+ var transformProperties = [
1876
+ 'fill',
1877
+ 'color',
1878
+ 'font-size',
1879
+ 'stroke',
1880
+ 'font',
1881
+ 'text-anchor',
1882
+ 'stroke-dasharray',
1883
+ 'shape-rendering',
1884
+ 'stroke-width'
1885
+ ];
1886
+ if (!node.style) {
1887
+ return;
1888
+ }
1889
+ var styles = getComputedStyle(node);
1890
+ try {
1891
+ for (var transformProperties_1 = __values(transformProperties), transformProperties_1_1 = transformProperties_1.next(); !transformProperties_1_1.done; transformProperties_1_1 = transformProperties_1.next()) {
1892
+ var transformProperty = transformProperties_1_1.value;
1893
+ node.style[transformProperty] = styles[transformProperty];
1906
1894
  }
1907
- else {
1908
- _this.dragContainer.emitLinkDragLeaved();
1895
+ }
1896
+ catch (e_2_1) { e_2 = { error: e_2_1 }; }
1897
+ finally {
1898
+ try {
1899
+ if (transformProperties_1_1 && !transformProperties_1_1.done && (_a = transformProperties_1.return)) _a.call(transformProperties_1);
1909
1900
  }
1910
- _this.barElement.classList.remove(linkDropClass);
1911
- });
1901
+ finally { if (e_2) throw e_2.error; }
1902
+ }
1903
+ try {
1904
+ for (var _c = __values(Array.from(node.childNodes)), _d = _c.next(); !_d.done; _d = _c.next()) {
1905
+ var child = _d.value;
1906
+ this.recursElementChildren(child);
1907
+ }
1908
+ }
1909
+ catch (e_3_1) { e_3 = { error: e_3_1 }; }
1910
+ finally {
1911
+ try {
1912
+ if (_d && !_d.done && (_b = _c.return)) _b.call(_c);
1913
+ }
1914
+ finally { if (e_3) throw e_3.error; }
1915
+ }
1912
1916
  };
1913
- GanttBarDrag.prototype.createBarDrag = function () {
1914
- var _this = this;
1915
- var dragRef = this.dragDrop.createDrag(this.barElement);
1916
- dragRef.lockAxis = 'x';
1917
- dragRef.started.subscribe(function () {
1918
- _this.setDraggingStyles();
1919
- _this.dragContainer.dragStarted.emit({ item: _this.item.origin });
1920
- });
1921
- dragRef.moved.subscribe(function (event) {
1922
- var x = _this.item.refs.x + event.distance.x;
1923
- var days = dateFns.differenceInCalendarDays(_this.item.end.value, _this.item.start.value);
1924
- var start = _this.ganttUpper.view.getDateByXPoint(x);
1925
- var end = start.addDays(days);
1926
- _this.openDragBackdrop(_this.barElement, _this.ganttUpper.view.getDateByXPoint(x), end);
1927
- });
1928
- dragRef.ended.subscribe(function (event) {
1929
- var days = dateFns.differenceInCalendarDays(_this.item.end.value, _this.item.start.value);
1930
- var start = _this.ganttUpper.view.getDateByXPoint(_this.item.refs.x + event.distance.x);
1931
- var end = start.addDays(days);
1932
- _this.item.updateDate(start, end);
1933
- _this.clearDraggingStyles();
1934
- _this.closeDragBackdrop();
1935
- event.source.reset();
1936
- _this.dragContainer.dragEnded.emit({ item: _this.item.origin });
1937
- });
1938
- this.barDragRef = dragRef;
1939
- return dragRef;
1917
+ GanttPrintService.prototype.register = function (root) {
1918
+ this.root = root.nativeElement;
1919
+ this.mainContainer = this.root.getElementsByClassName('gantt-main-container')[0];
1940
1920
  };
1941
- GanttBarDrag.prototype.createBarHandleDrags = function () {
1921
+ GanttPrintService.prototype.print = function (name, ignoreElementClass) {
1942
1922
  var _this = this;
1943
- var dragRefs = [];
1944
- var handles = this.barElement.querySelectorAll('.drag-handles .handle');
1945
- handles.forEach(function (handle, index) {
1946
- var isBefore = index === 0;
1947
- var dragRef = _this.dragDrop.createDrag(handle);
1948
- dragRef.lockAxis = 'x';
1949
- dragRef.withBoundaryElement(_this.dom.root);
1950
- dragRef.started.subscribe(function () {
1951
- _this.setDraggingStyles();
1952
- _this.dragContainer.dragStarted.emit({ item: _this.item.origin });
1953
- });
1954
- dragRef.moved.subscribe(function (event) {
1955
- if (isBefore) {
1956
- var x = _this.item.refs.x + event.distance.x;
1957
- var width = _this.item.refs.width + event.distance.x * -1;
1958
- if (width > dragMinWidth) {
1959
- _this.barElement.style.width = width + 'px';
1960
- _this.barElement.style.left = x + 'px';
1961
- _this.openDragBackdrop(_this.barElement, _this.ganttUpper.view.getDateByXPoint(x), _this.ganttUpper.view.getDateByXPoint(x + width));
1962
- }
1963
- }
1964
- else {
1965
- var width = _this.item.refs.width + event.distance.x;
1966
- if (width > dragMinWidth) {
1967
- _this.barElement.style.width = width + 'px';
1968
- _this.openDragBackdrop(_this.barElement, _this.ganttUpper.view.getDateByXPoint(_this.item.refs.x), _this.ganttUpper.view.getDateByXPoint(_this.item.refs.x + width));
1969
- }
1970
- }
1971
- event.source.reset();
1972
- });
1973
- dragRef.ended.subscribe(function (event) {
1974
- if (isBefore) {
1975
- var width = _this.item.refs.width + event.distance.x * -1;
1976
- if (width > dragMinWidth) {
1977
- _this.item.updateDate(_this.ganttUpper.view.getDateByXPoint(_this.item.refs.x + event.distance.x), _this.item.end);
1978
- }
1979
- else {
1980
- _this.item.updateDate(_this.item.end.startOfDay(), _this.item.end);
1981
- }
1982
- }
1983
- else {
1984
- var width = _this.item.refs.width + event.distance.x;
1985
- if (width > dragMinWidth) {
1986
- _this.item.updateDate(_this.item.start, _this.ganttUpper.view.getDateByXPoint(_this.item.refs.x + _this.item.refs.width + event.distance.x));
1987
- }
1988
- else {
1989
- _this.item.updateDate(_this.item.start, _this.item.start.endOfDay());
1990
- }
1923
+ if (name === void 0) { name = 'download'; }
1924
+ var root = this.root;
1925
+ var mainContainer = this.mainContainer;
1926
+ // set print width
1927
+ var printWidth = root.offsetWidth;
1928
+ // set print height
1929
+ var printHeight = root.offsetHeight - mainContainer.offsetHeight + mainContainer.scrollHeight;
1930
+ html2canvas__default['default'](root, {
1931
+ logging: false,
1932
+ allowTaint: true,
1933
+ useCORS: true,
1934
+ width: printWidth,
1935
+ height: printHeight,
1936
+ ignoreElements: function (element) {
1937
+ if (ignoreElementClass && element.classList.contains(ignoreElementClass)) {
1938
+ return true;
1991
1939
  }
1992
- _this.clearDraggingStyles();
1993
- _this.closeDragBackdrop();
1994
- _this.dragContainer.dragEnded.emit({ item: _this.item.origin });
1995
- });
1996
- dragRefs.push(dragRef);
1997
- });
1998
- return dragRefs;
1999
- };
2000
- GanttBarDrag.prototype.createLinkHandleDrags = function () {
2001
- var _this = this;
2002
- var dragRefs = [];
2003
- var handles = this.barElement.querySelectorAll('.link-handles .handle');
2004
- handles.forEach(function (handle, index) {
2005
- var isBefore = index === 0;
2006
- var dragRef = _this.dragDrop.createDrag(handle);
2007
- dragRef.withBoundaryElement(_this.dom.root);
2008
- dragRef.beforeStarted.subscribe(function () {
2009
- handle.style.pointerEvents = 'none';
2010
- if (_this.barDragRef) {
2011
- _this.barDragRef.disabled = true;
1940
+ if (element.classList.contains('gantt-calendar-today-overlay')) {
1941
+ return true;
2012
1942
  }
2013
- _this.createLinkDraggingLine();
2014
- _this.dragContainer.emitLinkDragStarted(isBefore ? 'target' : 'source', _this.item);
2015
- });
2016
- dragRef.moved.subscribe(function () {
2017
- var positions = _this.calcLinkLinePositions(handle, isBefore);
2018
- _this.linkDraggingLine.setAttribute('x1', positions.x1.toString());
2019
- _this.linkDraggingLine.setAttribute('y1', positions.y1.toString());
2020
- _this.linkDraggingLine.setAttribute('x2', positions.x2.toString());
2021
- _this.linkDraggingLine.setAttribute('y2', positions.y2.toString());
2022
- });
2023
- dragRef.ended.subscribe(function (event) {
2024
- event.source.reset();
2025
- handle.style.pointerEvents = '';
2026
- if (_this.barDragRef) {
2027
- _this.barDragRef.disabled = false;
1943
+ },
1944
+ onclone: function (cloneDocument) {
1945
+ var ganttClass = root.className;
1946
+ var cloneGanttDom = cloneDocument.querySelector("." + ganttClass.replace(/\s+/g, '.'));
1947
+ var cloneGanttContainerDom = cloneDocument.querySelector('.gantt-container');
1948
+ var cloneCalendarOverlay = cloneDocument.querySelector('.gantt-calendar-overlay-main');
1949
+ var cloneLinksOverlay = cloneDocument.querySelector('.gantt-links-overlay-main');
1950
+ // change targetDom width
1951
+ cloneGanttDom.style.width = printWidth + "px";
1952
+ cloneGanttDom.style.height = printHeight + "px";
1953
+ cloneGanttDom.style.overflow = "unset";
1954
+ cloneGanttContainerDom.style.backgroundColor = '#fff';
1955
+ cloneCalendarOverlay.setAttribute('height', "" + printHeight);
1956
+ cloneCalendarOverlay.setAttribute('style', "background: transparent");
1957
+ if (cloneLinksOverlay) {
1958
+ cloneLinksOverlay.setAttribute('height', "" + printHeight);
1959
+ cloneLinksOverlay.setAttribute('style', "height: " + printHeight + "px");
2028
1960
  }
2029
- _this.barElement.classList.remove(activeClass);
2030
- _this.destroyLinkDraggingLine();
2031
- _this.dragContainer.emitLinkDragEnded();
2032
- });
2033
- dragRefs.push(dragRef);
2034
- });
2035
- return dragRefs;
2036
- };
2037
- GanttBarDrag.prototype.openDragBackdrop = function (dragElement, start, end) {
2038
- var dragMaskElement = this.dom.root.querySelector('.gantt-drag-mask');
2039
- var dragBackdropElement = this.dom.root.querySelector('.gantt-drag-backdrop');
2040
- var rootRect = this.dom.root.getBoundingClientRect();
2041
- var dragRect = dragElement.getBoundingClientRect();
2042
- var left = dragRect.left - rootRect.left - this.dom.side.clientWidth;
2043
- var width = dragRect.right - dragRect.left;
2044
- dragMaskElement.style.left = left + 'px';
2045
- dragMaskElement.style.width = width + 'px';
2046
- dragMaskElement.querySelector('.start').innerHTML = start.format('MM-dd');
2047
- dragMaskElement.querySelector('.end').innerHTML = end.format('MM-dd');
2048
- dragMaskElement.style.display = 'block';
2049
- dragBackdropElement.style.display = 'block';
2050
- };
2051
- GanttBarDrag.prototype.closeDragBackdrop = function () {
2052
- var dragMaskElement = this.dom.root.querySelector('.gantt-drag-mask');
2053
- var dragBackdropElement = this.dom.root.querySelector('.gantt-drag-backdrop');
2054
- dragMaskElement.style.display = 'none';
2055
- dragBackdropElement.style.display = 'none';
2056
- };
2057
- GanttBarDrag.prototype.setDraggingStyles = function () {
2058
- this.barElement.style.pointerEvents = 'none';
2059
- this.barElement.classList.add('gantt-bar-draggable-drag');
2060
- };
2061
- GanttBarDrag.prototype.clearDraggingStyles = function () {
2062
- this.barElement.style.pointerEvents = '';
2063
- this.barElement.classList.remove('gantt-bar-draggable-drag');
2064
- };
2065
- GanttBarDrag.prototype.calcLinkLinePositions = function (target, isBefore) {
2066
- var rootRect = this.dom.root.getBoundingClientRect();
2067
- var targetRect = target.getBoundingClientRect();
2068
- var layerRect = target.parentElement.parentElement.getBoundingClientRect();
2069
- return {
2070
- x1: layerRect.left + (isBefore ? 0 : layerRect.width) - rootRect.left,
2071
- y1: layerRect.top + layerRect.height / 2 - rootRect.top,
2072
- x2: targetRect.left - rootRect.left + targetRect.width / 2,
2073
- y2: targetRect.top - rootRect.top + targetRect.height / 2
2074
- };
2075
- };
2076
- GanttBarDrag.prototype.createLinkDraggingLine = function () {
2077
- if (!this.linkDraggingLine) {
2078
- var svgElement = createSvgElement('svg', 'gantt-link-drag-container');
2079
- var linElement = createSvgElement('line', 'link-dragging-line');
2080
- svgElement.appendChild(linElement);
2081
- this.dom.root.appendChild(svgElement);
2082
- this.linkDraggingLine = linElement;
2083
- }
2084
- };
2085
- GanttBarDrag.prototype.destroyLinkDraggingLine = function () {
2086
- if (this.linkDraggingLine) {
2087
- this.linkDraggingLine.parentElement.remove();
2088
- this.linkDraggingLine = null;
2089
- }
2090
- };
2091
- GanttBarDrag.prototype.createDrags = function (elementRef, item, ganttUpper) {
2092
- var _a, _b;
2093
- this.item = item;
2094
- this.barElement = elementRef.nativeElement;
2095
- this.ganttUpper = ganttUpper;
2096
- if (!item.draggable || (this.dragDisabled && this.linkDragDisabled)) {
2097
- return;
2098
- }
2099
- else {
2100
- this.createMouseEvents();
2101
- if (!this.dragDisabled) {
2102
- var dragRef = this.createBarDrag();
2103
- var dragHandlesRefs = this.createBarHandleDrags();
2104
- (_a = this.dragRefs).push.apply(_a, __spread([dragRef], dragHandlesRefs));
2105
- }
2106
- if (!this.linkDragDisabled) {
2107
- var linkDragRefs = this.createLinkHandleDrags();
2108
- (_b = this.dragRefs).push.apply(_b, __spread(linkDragRefs));
1961
+ // setInlineStyles for svg
1962
+ _this.setInlineStyles(cloneGanttDom);
2109
1963
  }
2110
- }
2111
- };
2112
- GanttBarDrag.prototype.ngOnDestroy = function () {
2113
- this.closeDragBackdrop();
2114
- this.dragRefs.forEach(function (dragRef) { return dragRef.dispose(); });
2115
- this.destroy$.next();
2116
- this.destroy$.complete();
1964
+ }).then(function (canvas) {
1965
+ var link = document.createElement('a');
1966
+ var dataUrl = canvas.toDataURL('image/png');
1967
+ link.download = name + ".png";
1968
+ link.href = dataUrl;
1969
+ link.click();
1970
+ });
2117
1971
  };
2118
- return GanttBarDrag;
1972
+ return GanttPrintService;
2119
1973
  }());
2120
- GanttBarDrag.decorators = [
2121
- { type: core.Injectable }
2122
- ];
2123
- GanttBarDrag.ctorParameters = function () { return [
2124
- { type: dragDrop.DragDrop },
2125
- { type: GanttDomService },
2126
- { type: GanttDragContainer }
2127
- ]; };
1974
+ GanttPrintService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0__namespace, type: GanttPrintService, deps: [], target: i0__namespace.ɵɵFactoryTarget.Injectable });
1975
+ GanttPrintService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0__namespace, type: GanttPrintService });
1976
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0__namespace, type: GanttPrintService, decorators: [{
1977
+ type: i0.Injectable
1978
+ }], ctorParameters: function () { return []; } });
2128
1979
 
2129
- var GanttItemUpper = /** @class */ (function () {
2130
- function GanttItemUpper(elementRef, ganttUpper) {
2131
- this.elementRef = elementRef;
1980
+ var mainHeight = 5000;
1981
+ var GanttCalendarComponent = /** @class */ (function () {
1982
+ function GanttCalendarComponent(ganttUpper, ngZone, elementRef) {
2132
1983
  this.ganttUpper = ganttUpper;
2133
- this.firstChange = true;
1984
+ this.ngZone = ngZone;
1985
+ this.elementRef = elementRef;
2134
1986
  this.unsubscribe$ = new rxjs.Subject();
1987
+ this.headerHeight = headerHeight;
1988
+ this.mainHeight = mainHeight;
1989
+ this.todayHeight = todayHeight;
1990
+ this.todayWidth = todayWidth;
1991
+ this.todayBorderRadius = todayBorderRadius;
1992
+ this.viewTypes = exports.GanttViewType;
1993
+ this.className = true;
2135
1994
  }
2136
- GanttItemUpper.prototype.onInit = function () {
2137
- var _this = this;
2138
- this.firstChange = false;
2139
- this.item.refs$.pipe(operators.takeUntil(this.unsubscribe$)).subscribe(function () {
2140
- _this.setPositions();
2141
- });
2142
- };
2143
- GanttItemUpper.prototype.onChanges = function () {
2144
- if (!this.firstChange) {
2145
- this.setPositions();
2146
- }
2147
- };
2148
- GanttItemUpper.prototype.setPositions = function () {
2149
- var itemElement = this.elementRef.nativeElement;
2150
- itemElement.style.left = this.item.refs.x + 'px';
2151
- itemElement.style.top = this.item.refs.y + 'px';
2152
- itemElement.style.width = this.item.refs.width + 'px';
2153
- if (this.item.type === exports.GanttItemType.bar) {
2154
- itemElement.style.height = this.ganttUpper.styles.barHeight + 'px';
2155
- }
2156
- else if (this.item.type === exports.GanttItemType.range) {
2157
- itemElement.style.height = rangeHeight + 'px';
1995
+ Object.defineProperty(GanttCalendarComponent.prototype, "view", {
1996
+ get: function () {
1997
+ return this.ganttUpper.view;
1998
+ },
1999
+ enumerable: false,
2000
+ configurable: true
2001
+ });
2002
+ GanttCalendarComponent.prototype.setTodayPoint = function () {
2003
+ var x = this.view.getTodayXPoint();
2004
+ var today = new GanttDate().getDate();
2005
+ var todayEle = this.elementRef.nativeElement.getElementsByClassName('gantt-calendar-today-overlay')[0];
2006
+ var rect = this.elementRef.nativeElement.getElementsByClassName('today-rect')[0];
2007
+ var line = this.elementRef.nativeElement.getElementsByClassName('today-line')[0];
2008
+ if (isNumber(x)) {
2009
+ if (rect) {
2010
+ rect.style.left = x - todayWidth / 2 + "px";
2011
+ rect.style.top = headerHeight - todayHeight + "px";
2012
+ rect.innerHTML = today.toString();
2013
+ }
2014
+ if (line) {
2015
+ line.style.left = x + "px";
2016
+ line.style.top = headerHeight + "px";
2017
+ line.style.bottom = -mainHeight + "px";
2018
+ }
2158
2019
  }
2159
2020
  else {
2021
+ todayEle.style.display = 'none';
2160
2022
  }
2161
2023
  };
2162
- GanttItemUpper.prototype.onDestroy = function () {
2163
- this.unsubscribe$.next();
2164
- this.unsubscribe$.complete();
2165
- };
2166
- return GanttItemUpper;
2167
- }());
2168
- GanttItemUpper.decorators = [
2169
- { type: core.Directive }
2170
- ];
2171
- GanttItemUpper.ctorParameters = function () { return [
2172
- { type: core.ElementRef },
2173
- { type: GanttUpper, decorators: [{ type: core.Inject, args: [GANTT_UPPER_TOKEN,] }] }
2174
- ]; };
2175
- GanttItemUpper.propDecorators = {
2176
- template: [{ type: core.Input }],
2177
- item: [{ type: core.Input }]
2178
- };
2179
-
2180
- function linearGradient(sideOrCorner, color, stop) {
2181
- return "linear-gradient(" + sideOrCorner + "," + color + " 0%," + stop + " 40%)";
2182
- }
2183
- var NgxGanttBarComponent = /** @class */ (function (_super) {
2184
- __extends(NgxGanttBarComponent, _super);
2185
- function NgxGanttBarComponent(dragContainer, drag, elementRef, ganttUpper) {
2186
- var _this = _super.call(this, elementRef, ganttUpper) || this;
2187
- _this.dragContainer = dragContainer;
2188
- _this.drag = drag;
2189
- _this.ganttUpper = ganttUpper;
2190
- _this.barClick = new core.EventEmitter();
2191
- _this.ganttItemClass = true;
2192
- _this.color = 'red';
2193
- return _this;
2194
- }
2195
- NgxGanttBarComponent.prototype.ngOnInit = function () {
2024
+ GanttCalendarComponent.prototype.ngOnInit = function () {
2196
2025
  var _this = this;
2197
- _super.prototype.onInit.call(this);
2198
- this.dragContainer.dragEnded.pipe(operators.takeUntil(this.unsubscribe$)).subscribe(function () {
2199
- _this.setContentBackground();
2026
+ this.ngZone.onStable.pipe(operators.take(1)).subscribe(function () {
2027
+ rxjs.merge(_this.ganttUpper.viewChange, _this.ganttUpper.view.start$)
2028
+ .pipe(operators.takeUntil(_this.unsubscribe$))
2029
+ .subscribe(function () {
2030
+ _this.setTodayPoint();
2031
+ });
2200
2032
  });
2201
2033
  };
2202
- NgxGanttBarComponent.prototype.ngAfterViewInit = function () {
2203
- this.drag.createDrags(this.elementRef, this.item, this.ganttUpper);
2204
- this.setContentBackground();
2205
- };
2206
- NgxGanttBarComponent.prototype.ngOnChanges = function () {
2207
- _super.prototype.onChanges.call(this);
2208
- };
2209
- NgxGanttBarComponent.prototype.onBarClick = function (event) {
2210
- this.barClick.emit({ event: event, item: this.item.origin });
2211
- };
2212
- NgxGanttBarComponent.prototype.setContentBackground = function () {
2213
- var contentElement = this.contentElementRef.nativeElement;
2214
- var color = this.item.color || barBackground;
2215
- var style = this.item.barStyle || {};
2216
- if (this.item.origin.start && this.item.origin.end) {
2217
- style.background = color;
2218
- style.borderRadius = '';
2219
- }
2220
- if (this.item.origin.start && !this.item.origin.end) {
2221
- style.background = linearGradient('to left', hexToRgb(color, 0.55), hexToRgb(color, 1));
2222
- style.borderRadius = '4px 12.5px 12.5px 4px';
2223
- }
2224
- if (!this.item.origin.start && this.item.origin.end) {
2225
- style.background = linearGradient('to right', hexToRgb(color, 0.55), hexToRgb(color, 1));
2226
- style.borderRadius = '12.5px 4px 4px 12.5px';
2227
- }
2228
- if (this.item.progress >= 0) {
2229
- var contentProgressElement = contentElement.querySelector('.gantt-bar-content-progress');
2230
- style.background = hexToRgb(color, 0.3);
2231
- style.borderRadius = '';
2232
- contentProgressElement.style.background = color;
2233
- }
2234
- for (var key in style) {
2235
- if (style.hasOwnProperty(key)) {
2236
- contentElement.style[key] = style[key];
2237
- }
2238
- }
2239
- };
2240
- NgxGanttBarComponent.prototype.stopPropagation = function (event) {
2241
- event.stopPropagation();
2242
- };
2243
- NgxGanttBarComponent.prototype.ngOnDestroy = function () {
2244
- _super.prototype.onDestroy.call(this);
2245
- };
2246
- return NgxGanttBarComponent;
2247
- }(GanttItemUpper));
2248
- NgxGanttBarComponent.decorators = [
2249
- { type: core.Component, args: [{
2250
- selector: 'ngx-gantt-bar,gantt-bar',
2251
- 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",
2252
- providers: [GanttBarDrag]
2253
- },] }
2254
- ];
2255
- NgxGanttBarComponent.ctorParameters = function () { return [
2256
- { type: GanttDragContainer },
2257
- { type: GanttBarDrag },
2258
- { type: core.ElementRef },
2259
- { type: GanttUpper, decorators: [{ type: core.Inject, args: [GANTT_UPPER_TOKEN,] }] }
2260
- ]; };
2261
- NgxGanttBarComponent.propDecorators = {
2262
- barClick: [{ type: core.Output }],
2263
- contentElementRef: [{ type: core.ViewChild, args: ['content',] }],
2264
- ganttItemClass: [{ type: core.HostBinding, args: ['class.gantt-bar',] }]
2265
- };
2266
-
2267
- var GanttMainComponent = /** @class */ (function () {
2268
- function GanttMainComponent(ganttUpper) {
2269
- this.ganttUpper = ganttUpper;
2270
- this.barClick = new core.EventEmitter();
2271
- this.lineClick = new core.EventEmitter();
2272
- this.ganttMainClass = true;
2273
- }
2274
- GanttMainComponent.prototype.ngOnInit = function () { };
2275
- GanttMainComponent.prototype.trackBy = function (item, index) {
2276
- return item.id || index;
2034
+ GanttCalendarComponent.prototype.ngAfterViewInit = function () { };
2035
+ GanttCalendarComponent.prototype.ngOnChanges = function (changes) { };
2036
+ GanttCalendarComponent.prototype.trackBy = function (point, index) {
2037
+ return point.text || index;
2277
2038
  };
2278
- return GanttMainComponent;
2039
+ GanttCalendarComponent.prototype.ngOnDestroy = function () {
2040
+ this.unsubscribe$.next();
2041
+ this.unsubscribe$.complete();
2042
+ };
2043
+ return GanttCalendarComponent;
2279
2044
  }());
2280
- GanttMainComponent.decorators = [
2281
- { type: core.Component, args: [{
2282
- selector: 'gantt-main',
2283
- 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; trackBy: trackBy\">\n <div class=\"gantt-item\" [style.height.px]=\"ganttUpper.styles.lineHeight\">\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"
2284
- },] }
2285
- ];
2286
- GanttMainComponent.ctorParameters = function () { return [
2287
- { type: GanttUpper, decorators: [{ type: core.Inject, args: [GANTT_UPPER_TOKEN,] }] }
2288
- ]; };
2289
- GanttMainComponent.propDecorators = {
2290
- groups: [{ type: core.Input }],
2291
- items: [{ type: core.Input }],
2292
- groupHeaderTemplate: [{ type: core.Input }],
2293
- itemTemplate: [{ type: core.Input }],
2294
- barTemplate: [{ type: core.Input }],
2295
- rangeTemplate: [{ type: core.Input }],
2296
- barClick: [{ type: core.Output }],
2297
- lineClick: [{ type: core.Output }],
2298
- ganttMainClass: [{ type: core.HostBinding, args: ['class.gantt-main-container',] }]
2299
- };
2045
+ 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 });
2046
+ 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"] }] });
2047
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0__namespace, type: GanttCalendarComponent, decorators: [{
2048
+ type: i0.Component,
2049
+ args: [{
2050
+ selector: 'gantt-calendar-overlay',
2051
+ templateUrl: './calendar.component.html'
2052
+ }]
2053
+ }], ctorParameters: function () {
2054
+ return [{ type: GanttUpper, decorators: [{
2055
+ type: i0.Inject,
2056
+ args: [GANTT_UPPER_TOKEN]
2057
+ }] }, { type: i0__namespace.NgZone }, { type: i0__namespace.ElementRef }];
2058
+ }, propDecorators: { className: [{
2059
+ type: i0.HostBinding,
2060
+ args: ['class.gantt-calendar-overlay']
2061
+ }] } });
2300
2062
 
2301
- 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>";
2302
- 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>";
2303
- 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>";
2304
- var minusSquare = "<svg viewBox=\"0 0 16 16\" xmlns=\"http://www.w3.org/2000/svg\" fit=\"\" preserveAspectRatio=\"xMidYMid meet\" focusable=\"false\"><g id=\"jnaction/minus-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-.8H2zm2.8 6.2h6.5v1.2H4.8V7.4z\"></path></g></svg>";
2305
- var loadingIcon = "<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" viewBox=\"0 0 50 50\" style=\"enable-background:new 0 0 50 50\" xml:space=\"preserve\">\n<path fill=\"#aaa\" d=\"M25.251,6.461c-10.318,0-18.683,8.365-18.683,18.683h4.068c0-8.071,6.543-14.615,14.615-14.615V6.461z\" transform=\"rotate(275.098 25 25)\">\n <animateTransform attributeType=\"xml\" attributeName=\"transform\" type=\"rotate\" from=\"0 25 25\" to=\"360 25 25\" dur=\"0.6s\" repeatCount=\"indefinite\"></animateTransform>\n</path>\n</svg>";
2306
- var emptyIcon = "<svg\nwidth=\"148px\"\nheight=\"134px\"\nviewBox=\"0 0 148 134\"\nversion=\"1.1\"\nxmlns=\"http://www.w3.org/2000/svg\"\nxmlns:xlink=\"http://www.w3.org/1999/xlink\"\n>\n<defs>\n <filter x=\"0.0%\" y=\"0.0%\" width=\"100.0%\" height=\"100.0%\" filterUnits=\"objectBoundingBox\" id=\"filter-1\">\n <feGaussianBlur stdDeviation=\"0\" in=\"SourceGraphic\"></feGaussianBlur>\n </filter>\n</defs>\n<g id=\"148x134\" stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\">\n <g id=\"\u7F16\u7EC4-6\" transform=\"translate(1.000000, 1.000000)\">\n <ellipse\n id=\"\u692D\u5706\u5F62\"\n fill=\"#EDEEF2\"\n opacity=\"0.3\"\n filter=\"url(#filter-1)\"\n cx=\"73.0800017\"\n cy=\"115.920003\"\n rx=\"73.0800017\"\n ry=\"16.8000004\"\n ></ellipse>\n <g id=\"\u7F16\u7EC4-5\" transform=\"translate(15.120000, 0.000000)\">\n <polygon\n id=\"\u77E9\u5F62\"\n fill=\"#E2E4E9\"\n points=\"19.2789848 49.5600011 99.1200023 48.7200011 117.600003 75.9297673 117.600003 92.313049 0 92.313049 0 75.0356267\"\n ></polygon>\n <path\n d=\"M23.5200005,0 L94.0800002,0 C97.7913538,2.06413823e-16 100.8,3.00864655 100.8,6.72000015 L100.8,99.1200023 L100.8,99.1200023 L16.8000004,99.1200023 L16.8000004,6.72000015 C16.8000004,3.00864655 19.8086469,1.56994302e-15 23.5200005,0 Z\"\n id=\"\u77E9\u5F62\"\n fill=\"#F9FAFB\"\n ></path>\n <path\n d=\"M30.9200007,12.4400003 L86.6800019,12.4400003 C88.5356787,12.4400003 90.040002,13.9443236 90.040002,15.8000004 L90.040002,42.000001 C90.040002,43.8556778 88.5356787,45.360001 86.6800019,45.360001 L30.9200007,45.360001 C29.0643239,45.360001 27.5600006,43.8556778 27.5600006,42.000001 L27.5600006,15.8000004 C27.5600006,13.9443236 29.0643239,12.4400003 30.9200007,12.4400003 Z\"\n id=\"\u77E9\u5F62\"\n fill=\"#E8EAEE\"\n ></path>\n <text\n id=\"&lt;/null&gt;\"\n font-family=\"PingFangSC-Medium, PingFang SC\"\n font-size=\"15.1200003\"\n font-weight=\"400\"\n fill=\"#BCBECD\"\n >\n <tspan x=\"33.6000008\" y=\"32.8000004\">&lt;/null&gt;</tspan>\n </text>\n <rect id=\"\u77E9\u5F62\" fill=\"#E8EAEE\" x=\"27.5600006\" y=\"52.0800012\" width=\"61.4800014\" height=\"5.04000011\" rx=\"2.52000006\"></rect>\n <rect\n id=\"\u77E9\u5F62\u5907\u4EFD\"\n fill=\"#E8EAEE\"\n x=\"27.5600006\"\n y=\"63.8400014\"\n width=\"61.4800014\"\n height=\"5.04000011\"\n rx=\"2.52000006\"\n ></rect>\n <path\n d=\"M0,75.6000017 L29.280235,75.6000017 C32.0637502,75.6000017 34.3202352,77.8564866 34.3202352,80.6400018 L34.3202352,86.2591426 C34.3202352,89.0426578 36.5767201,91.2991427 39.3602353,91.2991427 L78.4136737,91.2991427 C81.1971889,91.2991427 83.4536738,89.0426578 83.4536738,86.2591426 L83.4536738,80.6400018 C83.4536738,77.8564866 85.7101587,75.6000017 88.4936739,75.6000017 L117.600003,75.6000017 L117.600003,75.6000017 L117.600003,110.880003 C117.600003,115.519195 113.839194,119.280003 109.200002,119.280003 L8.40000019,119.280003 C3.76080819,119.280003 -6.53729019e-15,115.519195 0,110.880003 L0,75.6000017 L0,75.6000017 Z\"\n id=\"\u77E9\u5F62\"\n fill=\"#EDEFF2\"\n ></path>\n </g>\n </g>\n</g>\n</svg>";
2307
- var icons = {
2308
- 'angle-right': angleRight,
2309
- 'angle-down': angleDown,
2310
- 'plus-square': plusSquare,
2311
- 'minus-square': minusSquare,
2312
- loading: loadingIcon,
2313
- empty: emptyIcon
2314
- };
2063
+ var GanttDragBackdropComponent = /** @class */ (function () {
2064
+ function GanttDragBackdropComponent() {
2065
+ this.backdropClass = true;
2066
+ }
2067
+ GanttDragBackdropComponent.prototype.ngOnInit = function () { };
2068
+ return GanttDragBackdropComponent;
2069
+ }());
2070
+ GanttDragBackdropComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0__namespace, type: GanttDragBackdropComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
2071
+ 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" });
2072
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0__namespace, type: GanttDragBackdropComponent, decorators: [{
2073
+ type: i0.Component,
2074
+ args: [{
2075
+ selector: 'gantt-drag-backdrop',
2076
+ templateUrl: "./drag-backdrop.component.html"
2077
+ }]
2078
+ }], ctorParameters: function () { return []; }, propDecorators: { backdropClass: [{
2079
+ type: i0.HostBinding,
2080
+ args: ['class.gantt-drag-backdrop']
2081
+ }] } });
2315
2082
 
2316
- var GanttIconComponent = /** @class */ (function () {
2317
- function GanttIconComponent(elementRef) {
2083
+ var NgxGanttRootComponent = /** @class */ (function () {
2084
+ function NgxGanttRootComponent(elementRef, ngZone, dom, dragContainer, ganttUpper, printService) {
2318
2085
  this.elementRef = elementRef;
2319
- this.isIcon = true;
2086
+ this.ngZone = ngZone;
2087
+ this.dom = dom;
2088
+ this.dragContainer = dragContainer;
2089
+ this.ganttUpper = ganttUpper;
2090
+ this.printService = printService;
2091
+ this.ganttClass = true;
2092
+ this.unsubscribe$ = new rxjs.Subject();
2093
+ this.ganttUpper.dragContainer = dragContainer;
2320
2094
  }
2321
- Object.defineProperty(GanttIconComponent.prototype, "iconName", {
2322
- set: function (name) {
2323
- this.setSvg(name);
2095
+ Object.defineProperty(NgxGanttRootComponent.prototype, "view", {
2096
+ get: function () {
2097
+ return this.ganttUpper.view;
2324
2098
  },
2325
2099
  enumerable: false,
2326
2100
  configurable: true
2327
2101
  });
2328
- GanttIconComponent.prototype.ngOnInit = function () { };
2329
- GanttIconComponent.prototype.ngAfterViewInit = function () { };
2330
- GanttIconComponent.prototype.setSvg = function (name) {
2331
- var iconSvg = icons[name];
2332
- if (iconSvg) {
2333
- this.elementRef.nativeElement.innerHTML = iconSvg;
2102
+ NgxGanttRootComponent.prototype.ngOnInit = function () {
2103
+ var _this = this;
2104
+ this.ngZone.onStable.pipe(operators.take(1)).subscribe(function () {
2105
+ _this.dom.initialize(_this.elementRef);
2106
+ if (_this.printService) {
2107
+ _this.printService.register(_this.elementRef);
2108
+ }
2109
+ _this.setupScrollClass();
2110
+ _this.setupResize();
2111
+ _this.setupViewScroll();
2112
+ // 优化初始化时Scroll滚动体验问题,通过透明度解决,默认透明度为0,滚动结束后恢复
2113
+ _this.elementRef.nativeElement.style.opacity = '1';
2114
+ _this.ganttUpper.viewChange.pipe(operators.startWith(null)).subscribe(function () {
2115
+ _this.scrollToToday();
2116
+ });
2117
+ });
2118
+ };
2119
+ NgxGanttRootComponent.prototype.setupViewScroll = function () {
2120
+ var _this = this;
2121
+ if (this.ganttUpper.disabledLoadOnScroll) {
2122
+ return;
2123
+ }
2124
+ this.dom
2125
+ .getViewerScroll()
2126
+ .pipe(operators.takeUntil(this.unsubscribe$))
2127
+ .subscribe(function (event) {
2128
+ if (event.direction === ScrollDirection.LEFT) {
2129
+ var dates_1 = _this.view.addStartDate();
2130
+ if (dates_1) {
2131
+ event.target.scrollLeft += _this.view.getDateRangeWidth(dates_1.start, dates_1.end);
2132
+ _this.ngZone.run(function () {
2133
+ _this.ganttUpper.loadOnScroll.emit({ start: dates_1.start.getUnixTime(), end: dates_1.end.getUnixTime() });
2134
+ });
2135
+ }
2136
+ }
2137
+ if (event.direction === ScrollDirection.RIGHT) {
2138
+ var dates_2 = _this.view.addEndDate();
2139
+ if (dates_2) {
2140
+ _this.ngZone.run(function () {
2141
+ _this.ganttUpper.loadOnScroll.emit({ start: dates_2.start.getUnixTime(), end: dates_2.end.getUnixTime() });
2142
+ });
2143
+ }
2144
+ }
2145
+ });
2146
+ };
2147
+ NgxGanttRootComponent.prototype.setupResize = function () {
2148
+ var _this = this;
2149
+ this.dom
2150
+ .getResize()
2151
+ .pipe(operators.takeUntil(this.unsubscribe$))
2152
+ .subscribe(function () {
2153
+ _this.setupScrollClass();
2154
+ });
2155
+ };
2156
+ NgxGanttRootComponent.prototype.setupScrollClass = function () {
2157
+ var mainContainer = this.dom.mainContainer;
2158
+ var height = mainContainer.offsetHeight;
2159
+ var scrollHeight = mainContainer.scrollHeight;
2160
+ if (scrollHeight > height) {
2161
+ this.elementRef.nativeElement.className = 'gantt gantt-scroll';
2334
2162
  }
2335
2163
  else {
2336
- this.elementRef.nativeElement.innerHTML = '';
2164
+ this.elementRef.nativeElement.className = 'gantt';
2337
2165
  }
2338
2166
  };
2339
- return GanttIconComponent;
2340
- }());
2341
- GanttIconComponent.decorators = [
2342
- { type: core.Component, args: [{
2343
- selector: 'gantt-icon',
2344
- template: ''
2345
- },] }
2346
- ];
2347
- GanttIconComponent.ctorParameters = function () { return [
2348
- { type: core.ElementRef }
2349
- ]; };
2350
- GanttIconComponent.propDecorators = {
2351
- isIcon: [{ type: core.HostBinding, args: ['class.gantt-icon',] }],
2352
- iconName: [{ type: core.Input }]
2353
- };
2354
-
2355
- var GanttDragBackdropComponent = /** @class */ (function () {
2356
- function GanttDragBackdropComponent() {
2357
- this.backdropClass = true;
2358
- }
2359
- GanttDragBackdropComponent.prototype.ngOnInit = function () { };
2360
- return GanttDragBackdropComponent;
2167
+ NgxGanttRootComponent.prototype.scrollToToday = function () {
2168
+ var x = this.view.getTodayXPoint();
2169
+ this.dom.scrollMainContainer(x);
2170
+ };
2171
+ return NgxGanttRootComponent;
2361
2172
  }());
2362
- GanttDragBackdropComponent.decorators = [
2363
- { type: core.Component, args: [{
2364
- selector: 'gantt-drag-backdrop',
2365
- 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"
2366
- },] }
2367
- ];
2368
- GanttDragBackdropComponent.ctorParameters = function () { return []; };
2369
- GanttDragBackdropComponent.propDecorators = {
2370
- backdropClass: [{ type: core.HostBinding, args: ['class.gantt-drag-backdrop',] }]
2371
- };
2173
+ 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 });
2174
+ 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"] }] });
2175
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0__namespace, type: NgxGanttRootComponent, decorators: [{
2176
+ type: i0.Component,
2177
+ args: [{
2178
+ selector: 'ngx-gantt-root',
2179
+ templateUrl: './root.component.html',
2180
+ providers: [GanttDomService, GanttDragContainer]
2181
+ }]
2182
+ }], ctorParameters: function () {
2183
+ return [{ type: i0__namespace.ElementRef }, { type: i0__namespace.NgZone }, { type: GanttDomService }, { type: GanttDragContainer }, { type: GanttUpper, decorators: [{
2184
+ type: i0.Inject,
2185
+ args: [GANTT_UPPER_TOKEN]
2186
+ }] }, { type: GanttPrintService, decorators: [{
2187
+ type: i0.Optional
2188
+ }] }];
2189
+ }, propDecorators: { sideWidth: [{
2190
+ type: i0.Input
2191
+ }], ganttClass: [{
2192
+ type: i0.HostBinding,
2193
+ args: ['class.gantt']
2194
+ }], sideTemplate: [{
2195
+ type: i0.ContentChild,
2196
+ args: ['sideTemplate', { static: true }]
2197
+ }], mainTemplate: [{
2198
+ type: i0.ContentChild,
2199
+ args: ['mainTemplate', { static: true }]
2200
+ }] } });
2372
2201
 
2373
2202
  var LinkColors;
2374
2203
  (function (LinkColors) {
@@ -2384,7 +2213,7 @@
2384
2213
  this.ganttDragContainer = ganttDragContainer;
2385
2214
  this.groups = [];
2386
2215
  this.items = [];
2387
- this.lineClick = new core.EventEmitter();
2216
+ this.lineClick = new i0.EventEmitter();
2388
2217
  this.links = [];
2389
2218
  this.linkItems = [];
2390
2219
  this.bezierWeight = -0.5;
@@ -2534,364 +2363,711 @@
2534
2363
  };
2535
2364
  return GanttLinksComponent;
2536
2365
  }());
2537
- GanttLinksComponent.decorators = [
2538
- { type: core.Component, args: [{
2539
- selector: 'gantt-links-overlay',
2540
- 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 [attr.d]=\"link.path\" fill=\"transparent\" stroke-width=\"2\" [attr.stroke]=\"link.color\" pointer-events=\"none\"></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 </ng-container>\n <line class=\"link-dragging-line\"></line>\n</svg>\n"
2541
- },] }
2542
- ];
2543
- GanttLinksComponent.ctorParameters = function () { return [
2544
- { type: GanttUpper, decorators: [{ type: core.Inject, args: [GANTT_UPPER_TOKEN,] }] },
2545
- { type: core.ChangeDetectorRef },
2546
- { type: core.ElementRef },
2547
- { type: GanttDragContainer }
2548
- ]; };
2549
- GanttLinksComponent.propDecorators = {
2550
- groups: [{ type: core.Input }],
2551
- items: [{ type: core.Input }],
2552
- lineClick: [{ type: core.Output }],
2553
- ganttLinksOverlay: [{ type: core.HostBinding, args: ['class.gantt-links-overlay',] }]
2554
- };
2366
+ 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 });
2367
+ 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 [attr.d]=\"link.path\" fill=\"transparent\" stroke-width=\"2\" [attr.stroke]=\"link.color\" pointer-events=\"none\"></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 </ng-container>\n <line class=\"link-dragging-line\"></line>\n</svg>\n", directives: [{ type: i2__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
2368
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0__namespace, type: GanttLinksComponent, decorators: [{
2369
+ type: i0.Component,
2370
+ args: [{
2371
+ selector: 'gantt-links-overlay',
2372
+ templateUrl: './links.component.html'
2373
+ }]
2374
+ }], ctorParameters: function () {
2375
+ return [{ type: GanttUpper, decorators: [{
2376
+ type: i0.Inject,
2377
+ args: [GANTT_UPPER_TOKEN]
2378
+ }] }, { type: i0__namespace.ChangeDetectorRef }, { type: i0__namespace.ElementRef }, { type: GanttDragContainer }];
2379
+ }, propDecorators: { groups: [{
2380
+ type: i0.Input
2381
+ }], items: [{
2382
+ type: i0.Input
2383
+ }], lineClick: [{
2384
+ type: i0.Output
2385
+ }], ganttLinksOverlay: [{
2386
+ type: i0.HostBinding,
2387
+ args: ['class.gantt-links-overlay']
2388
+ }] } });
2555
2389
 
2556
- var GanttPrintService = /** @class */ (function () {
2557
- function GanttPrintService() {
2390
+ var GanttItemUpper = /** @class */ (function () {
2391
+ function GanttItemUpper(elementRef, ganttUpper) {
2392
+ this.elementRef = elementRef;
2393
+ this.ganttUpper = ganttUpper;
2394
+ this.firstChange = true;
2395
+ this.unsubscribe$ = new rxjs.Subject();
2558
2396
  }
2559
- GanttPrintService.prototype.setInlineStyles = function (targetElem) {
2560
- var e_1, _a;
2561
- var svgElements = Array.from(targetElem.getElementsByTagName('svg'));
2562
- try {
2563
- for (var svgElements_1 = __values(svgElements), svgElements_1_1 = svgElements_1.next(); !svgElements_1_1.done; svgElements_1_1 = svgElements_1.next()) {
2564
- var svgElement = svgElements_1_1.value;
2565
- this.recursElementChildren(svgElement);
2566
- }
2567
- }
2568
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
2569
- finally {
2570
- try {
2571
- if (svgElements_1_1 && !svgElements_1_1.done && (_a = svgElements_1.return)) _a.call(svgElements_1);
2572
- }
2573
- finally { if (e_1) throw e_1.error; }
2574
- }
2575
- };
2576
- GanttPrintService.prototype.recursElementChildren = function (node) {
2577
- var e_2, _a, e_3, _b;
2578
- var transformProperties = [
2579
- 'fill',
2580
- 'color',
2581
- 'font-size',
2582
- 'stroke',
2583
- 'font',
2584
- 'text-anchor',
2585
- 'stroke-dasharray',
2586
- 'shape-rendering',
2587
- 'stroke-width'
2588
- ];
2589
- if (!node.style) {
2590
- return;
2591
- }
2592
- var styles = getComputedStyle(node);
2593
- try {
2594
- for (var transformProperties_1 = __values(transformProperties), transformProperties_1_1 = transformProperties_1.next(); !transformProperties_1_1.done; transformProperties_1_1 = transformProperties_1.next()) {
2595
- var transformProperty = transformProperties_1_1.value;
2596
- node.style[transformProperty] = styles[transformProperty];
2597
- }
2598
- }
2599
- catch (e_2_1) { e_2 = { error: e_2_1 }; }
2600
- finally {
2601
- try {
2602
- if (transformProperties_1_1 && !transformProperties_1_1.done && (_a = transformProperties_1.return)) _a.call(transformProperties_1);
2603
- }
2604
- finally { if (e_2) throw e_2.error; }
2605
- }
2606
- try {
2607
- for (var _c = __values(Array.from(node.childNodes)), _d = _c.next(); !_d.done; _d = _c.next()) {
2608
- var child = _d.value;
2609
- this.recursElementChildren(child);
2610
- }
2611
- }
2612
- catch (e_3_1) { e_3 = { error: e_3_1 }; }
2613
- finally {
2614
- try {
2615
- if (_d && !_d.done && (_b = _c.return)) _b.call(_c);
2616
- }
2617
- finally { if (e_3) throw e_3.error; }
2618
- }
2619
- };
2620
- GanttPrintService.prototype.register = function (root) {
2621
- this.root = root.nativeElement;
2622
- this.mainContainer = this.root.getElementsByClassName('gantt-main-container')[0];
2623
- };
2624
- GanttPrintService.prototype.print = function (name, ignoreElementClass) {
2397
+ GanttItemUpper.prototype.onInit = function () {
2625
2398
  var _this = this;
2626
- if (name === void 0) { name = 'download'; }
2627
- var root = this.root;
2628
- var mainContainer = this.mainContainer;
2629
- // set print width
2630
- var printWidth = root.offsetWidth;
2631
- // set print height
2632
- var printHeight = root.offsetHeight - mainContainer.offsetHeight + mainContainer.scrollHeight;
2633
- html2canvas__default['default'](root, {
2634
- logging: false,
2635
- allowTaint: true,
2636
- useCORS: true,
2637
- width: printWidth,
2638
- height: printHeight,
2639
- ignoreElements: function (element) {
2640
- if (ignoreElementClass && element.classList.contains(ignoreElementClass)) {
2641
- return true;
2642
- }
2643
- if (element.classList.contains('gantt-calendar-today-overlay')) {
2644
- return true;
2645
- }
2646
- },
2647
- onclone: function (cloneDocument) {
2648
- var ganttClass = root.className;
2649
- var cloneGanttDom = cloneDocument.querySelector("." + ganttClass.replace(/\s+/g, '.'));
2650
- var cloneGanttContainerDom = cloneDocument.querySelector('.gantt-container');
2651
- var cloneCalendarOverlay = cloneDocument.querySelector('.gantt-calendar-overlay-main');
2652
- var cloneLinksOverlay = cloneDocument.querySelector('.gantt-links-overlay-main');
2653
- // change targetDom width
2654
- cloneGanttDom.style.width = printWidth + "px";
2655
- cloneGanttDom.style.height = printHeight + "px";
2656
- cloneGanttDom.style.overflow = "unset";
2657
- cloneGanttContainerDom.style.backgroundColor = '#fff';
2658
- cloneCalendarOverlay.setAttribute('height', "" + printHeight);
2659
- cloneCalendarOverlay.setAttribute('style', "background: transparent");
2660
- if (cloneLinksOverlay) {
2661
- cloneLinksOverlay.setAttribute('height', "" + printHeight);
2662
- cloneLinksOverlay.setAttribute('style', "height: " + printHeight + "px");
2663
- }
2664
- // setInlineStyles for svg
2665
- _this.setInlineStyles(cloneGanttDom);
2666
- }
2667
- }).then(function (canvas) {
2668
- var link = document.createElement('a');
2669
- var dataUrl = canvas.toDataURL('image/png');
2670
- link.download = name + ".png";
2671
- link.href = dataUrl;
2672
- link.click();
2399
+ this.firstChange = false;
2400
+ this.item.refs$.pipe(operators.takeUntil(this.unsubscribe$)).subscribe(function () {
2401
+ _this.setPositions();
2673
2402
  });
2674
2403
  };
2675
- return GanttPrintService;
2404
+ GanttItemUpper.prototype.onChanges = function () {
2405
+ if (!this.firstChange) {
2406
+ this.setPositions();
2407
+ }
2408
+ };
2409
+ GanttItemUpper.prototype.setPositions = function () {
2410
+ var itemElement = this.elementRef.nativeElement;
2411
+ itemElement.style.left = this.item.refs.x + 'px';
2412
+ itemElement.style.top = this.item.refs.y + 'px';
2413
+ itemElement.style.width = this.item.refs.width + 'px';
2414
+ if (this.item.type === exports.GanttItemType.bar) {
2415
+ itemElement.style.height = this.ganttUpper.styles.barHeight + 'px';
2416
+ }
2417
+ else if (this.item.type === exports.GanttItemType.range) {
2418
+ itemElement.style.height = rangeHeight + 'px';
2419
+ }
2420
+ else {
2421
+ }
2422
+ };
2423
+ GanttItemUpper.prototype.onDestroy = function () {
2424
+ this.unsubscribe$.next();
2425
+ this.unsubscribe$.complete();
2426
+ };
2427
+ return GanttItemUpper;
2676
2428
  }());
2677
- GanttPrintService.decorators = [
2678
- { type: core.Injectable }
2679
- ];
2680
- GanttPrintService.ctorParameters = function () { return []; };
2429
+ 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 });
2430
+ GanttItemUpper.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.1.2", type: GanttItemUpper, inputs: { template: "template", item: "item" }, ngImport: i0__namespace });
2431
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0__namespace, type: GanttItemUpper, decorators: [{
2432
+ type: i0.Directive
2433
+ }], ctorParameters: function () {
2434
+ return [{ type: i0__namespace.ElementRef }, { type: GanttUpper, decorators: [{
2435
+ type: i0.Inject,
2436
+ args: [GANTT_UPPER_TOKEN]
2437
+ }] }];
2438
+ }, propDecorators: { template: [{
2439
+ type: i0.Input
2440
+ }], item: [{
2441
+ type: i0.Input
2442
+ }] } });
2681
2443
 
2682
- var NgxGanttRootComponent = /** @class */ (function () {
2683
- function NgxGanttRootComponent(elementRef, ngZone, dom, dragContainer, ganttUpper, printService) {
2684
- this.elementRef = elementRef;
2685
- this.ngZone = ngZone;
2444
+ var NgxGanttRangeComponent = /** @class */ (function (_super) {
2445
+ __extends(NgxGanttRangeComponent, _super);
2446
+ function NgxGanttRangeComponent(elementRef, ganttUpper) {
2447
+ var _this = _super.call(this, elementRef, ganttUpper) || this;
2448
+ _this.ganttRangeClass = true;
2449
+ return _this;
2450
+ }
2451
+ NgxGanttRangeComponent.prototype.ngOnInit = function () {
2452
+ _super.prototype.onInit.call(this);
2453
+ };
2454
+ NgxGanttRangeComponent.prototype.ngOnChanges = function () {
2455
+ _super.prototype.onChanges.call(this);
2456
+ };
2457
+ NgxGanttRangeComponent.prototype.ngOnDestroy = function () {
2458
+ _super.prototype.onDestroy.call(this);
2459
+ };
2460
+ return NgxGanttRangeComponent;
2461
+ }(GanttItemUpper));
2462
+ 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 });
2463
+ 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"] }] });
2464
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0__namespace, type: NgxGanttRangeComponent, decorators: [{
2465
+ type: i0.Component,
2466
+ args: [{
2467
+ selector: 'ngx-gantt-range,gantt-range',
2468
+ templateUrl: './range.component.html'
2469
+ }]
2470
+ }], ctorParameters: function () {
2471
+ return [{ type: i0__namespace.ElementRef }, { type: GanttUpper, decorators: [{
2472
+ type: i0.Inject,
2473
+ args: [GANTT_UPPER_TOKEN]
2474
+ }] }];
2475
+ }, propDecorators: { ganttRangeClass: [{
2476
+ type: i0.HostBinding,
2477
+ args: ['class.gantt-range']
2478
+ }] } });
2479
+
2480
+ var dragMinWidth = 10;
2481
+ var activeClass = 'gantt-bar-active';
2482
+ var linkDropClass = 'gantt-bar-link-drop';
2483
+ function createSvgElement(qualifiedName, className) {
2484
+ var element = document.createElementNS('http://www.w3.org/2000/svg', qualifiedName);
2485
+ element.classList.add(className);
2486
+ return element;
2487
+ }
2488
+ var GanttBarDrag = /** @class */ (function () {
2489
+ function GanttBarDrag(dragDrop, dom, dragContainer) {
2490
+ this.dragDrop = dragDrop;
2686
2491
  this.dom = dom;
2687
2492
  this.dragContainer = dragContainer;
2688
- this.ganttUpper = ganttUpper;
2689
- this.printService = printService;
2690
- this.ganttClass = true;
2691
- this.unsubscribe$ = new rxjs.Subject();
2692
- this.ganttUpper.dragContainer = dragContainer;
2493
+ this.dragRefs = [];
2494
+ this.destroy$ = new rxjs.Subject();
2693
2495
  }
2694
- Object.defineProperty(NgxGanttRootComponent.prototype, "view", {
2496
+ Object.defineProperty(GanttBarDrag.prototype, "dragDisabled", {
2695
2497
  get: function () {
2696
- return this.ganttUpper.view;
2498
+ return !this.item.draggable || !this.ganttUpper.draggable;
2697
2499
  },
2698
2500
  enumerable: false,
2699
2501
  configurable: true
2700
2502
  });
2701
- NgxGanttRootComponent.prototype.ngOnInit = function () {
2503
+ Object.defineProperty(GanttBarDrag.prototype, "linkDragDisabled", {
2504
+ get: function () {
2505
+ return !this.item.linkable || !this.ganttUpper.linkable;
2506
+ },
2507
+ enumerable: false,
2508
+ configurable: true
2509
+ });
2510
+ GanttBarDrag.prototype.createMouseEvents = function () {
2702
2511
  var _this = this;
2703
- this.ngZone.onStable.pipe(operators.take(1)).subscribe(function () {
2704
- _this.dom.initialize(_this.elementRef);
2705
- if (_this.printService) {
2706
- _this.printService.register(_this.elementRef);
2512
+ rxjs.fromEvent(this.barElement, 'mouseenter')
2513
+ .pipe(operators.takeUntil(this.destroy$))
2514
+ .subscribe(function () {
2515
+ if (_this.dragContainer.linkDraggingId && _this.dragContainer.linkDraggingId !== _this.item.id) {
2516
+ if (_this.item.linkable) {
2517
+ _this.barElement.classList.add(linkDropClass);
2518
+ _this.dragContainer.emitLinkDragEntered(_this.item);
2519
+ }
2707
2520
  }
2708
- _this.setupScrollClass();
2709
- _this.setupResize();
2710
- _this.setupViewScroll();
2711
- // 优化初始化时Scroll滚动体验问题,通过透明度解决,默认透明度为0,滚动结束后恢复
2712
- _this.elementRef.nativeElement.style.opacity = '1';
2713
- _this.ganttUpper.viewChange.pipe(operators.startWith(null)).subscribe(function () {
2714
- _this.scrollToToday();
2521
+ else {
2522
+ _this.barElement.classList.add(activeClass);
2523
+ }
2524
+ });
2525
+ rxjs.fromEvent(this.barElement, 'mouseleave')
2526
+ .pipe(operators.takeUntil(this.destroy$))
2527
+ .subscribe(function () {
2528
+ if (!_this.dragContainer.linkDraggingId) {
2529
+ _this.barElement.classList.remove(activeClass);
2530
+ }
2531
+ else {
2532
+ _this.dragContainer.emitLinkDragLeaved();
2533
+ }
2534
+ _this.barElement.classList.remove(linkDropClass);
2535
+ });
2536
+ };
2537
+ GanttBarDrag.prototype.createBarDrag = function () {
2538
+ var _this = this;
2539
+ var dragRef = this.dragDrop.createDrag(this.barElement);
2540
+ dragRef.lockAxis = 'x';
2541
+ dragRef.started.subscribe(function () {
2542
+ _this.setDraggingStyles();
2543
+ _this.dragContainer.dragStarted.emit({ item: _this.item.origin });
2544
+ });
2545
+ dragRef.moved.subscribe(function (event) {
2546
+ var x = _this.item.refs.x + event.distance.x;
2547
+ var days = dateFns.differenceInCalendarDays(_this.item.end.value, _this.item.start.value);
2548
+ var start = _this.ganttUpper.view.getDateByXPoint(x);
2549
+ var end = start.addDays(days);
2550
+ _this.openDragBackdrop(_this.barElement, _this.ganttUpper.view.getDateByXPoint(x), end);
2551
+ });
2552
+ dragRef.ended.subscribe(function (event) {
2553
+ var days = dateFns.differenceInCalendarDays(_this.item.end.value, _this.item.start.value);
2554
+ var start = _this.ganttUpper.view.getDateByXPoint(_this.item.refs.x + event.distance.x);
2555
+ var end = start.addDays(days);
2556
+ _this.item.updateDate(start, end);
2557
+ _this.clearDraggingStyles();
2558
+ _this.closeDragBackdrop();
2559
+ event.source.reset();
2560
+ _this.dragContainer.dragEnded.emit({ item: _this.item.origin });
2561
+ });
2562
+ this.barDragRef = dragRef;
2563
+ return dragRef;
2564
+ };
2565
+ GanttBarDrag.prototype.createBarHandleDrags = function () {
2566
+ var _this = this;
2567
+ var dragRefs = [];
2568
+ var handles = this.barElement.querySelectorAll('.drag-handles .handle');
2569
+ handles.forEach(function (handle, index) {
2570
+ var isBefore = index === 0;
2571
+ var dragRef = _this.dragDrop.createDrag(handle);
2572
+ dragRef.lockAxis = 'x';
2573
+ dragRef.withBoundaryElement(_this.dom.root);
2574
+ dragRef.started.subscribe(function () {
2575
+ _this.setDraggingStyles();
2576
+ _this.dragContainer.dragStarted.emit({ item: _this.item.origin });
2577
+ });
2578
+ dragRef.moved.subscribe(function (event) {
2579
+ if (isBefore) {
2580
+ var x = _this.item.refs.x + event.distance.x;
2581
+ var width = _this.item.refs.width + event.distance.x * -1;
2582
+ if (width > dragMinWidth) {
2583
+ _this.barElement.style.width = width + 'px';
2584
+ _this.barElement.style.left = x + 'px';
2585
+ _this.openDragBackdrop(_this.barElement, _this.ganttUpper.view.getDateByXPoint(x), _this.ganttUpper.view.getDateByXPoint(x + width));
2586
+ }
2587
+ }
2588
+ else {
2589
+ var width = _this.item.refs.width + event.distance.x;
2590
+ if (width > dragMinWidth) {
2591
+ _this.barElement.style.width = width + 'px';
2592
+ _this.openDragBackdrop(_this.barElement, _this.ganttUpper.view.getDateByXPoint(_this.item.refs.x), _this.ganttUpper.view.getDateByXPoint(_this.item.refs.x + width));
2593
+ }
2594
+ }
2595
+ event.source.reset();
2596
+ });
2597
+ dragRef.ended.subscribe(function (event) {
2598
+ if (isBefore) {
2599
+ var width = _this.item.refs.width + event.distance.x * -1;
2600
+ if (width > dragMinWidth) {
2601
+ _this.item.updateDate(_this.ganttUpper.view.getDateByXPoint(_this.item.refs.x + event.distance.x), _this.item.end);
2602
+ }
2603
+ else {
2604
+ _this.item.updateDate(_this.item.end.startOfDay(), _this.item.end);
2605
+ }
2606
+ }
2607
+ else {
2608
+ var width = _this.item.refs.width + event.distance.x;
2609
+ if (width > dragMinWidth) {
2610
+ _this.item.updateDate(_this.item.start, _this.ganttUpper.view.getDateByXPoint(_this.item.refs.x + _this.item.refs.width + event.distance.x));
2611
+ }
2612
+ else {
2613
+ _this.item.updateDate(_this.item.start, _this.item.start.endOfDay());
2614
+ }
2615
+ }
2616
+ _this.clearDraggingStyles();
2617
+ _this.closeDragBackdrop();
2618
+ _this.dragContainer.dragEnded.emit({ item: _this.item.origin });
2619
+ });
2620
+ dragRefs.push(dragRef);
2621
+ });
2622
+ return dragRefs;
2623
+ };
2624
+ GanttBarDrag.prototype.createLinkHandleDrags = function () {
2625
+ var _this = this;
2626
+ var dragRefs = [];
2627
+ var handles = this.barElement.querySelectorAll('.link-handles .handle');
2628
+ handles.forEach(function (handle, index) {
2629
+ var isBefore = index === 0;
2630
+ var dragRef = _this.dragDrop.createDrag(handle);
2631
+ dragRef.withBoundaryElement(_this.dom.root);
2632
+ dragRef.beforeStarted.subscribe(function () {
2633
+ handle.style.pointerEvents = 'none';
2634
+ if (_this.barDragRef) {
2635
+ _this.barDragRef.disabled = true;
2636
+ }
2637
+ _this.createLinkDraggingLine();
2638
+ _this.dragContainer.emitLinkDragStarted(isBefore ? 'target' : 'source', _this.item);
2639
+ });
2640
+ dragRef.moved.subscribe(function () {
2641
+ var positions = _this.calcLinkLinePositions(handle, isBefore);
2642
+ _this.linkDraggingLine.setAttribute('x1', positions.x1.toString());
2643
+ _this.linkDraggingLine.setAttribute('y1', positions.y1.toString());
2644
+ _this.linkDraggingLine.setAttribute('x2', positions.x2.toString());
2645
+ _this.linkDraggingLine.setAttribute('y2', positions.y2.toString());
2646
+ });
2647
+ dragRef.ended.subscribe(function (event) {
2648
+ event.source.reset();
2649
+ handle.style.pointerEvents = '';
2650
+ if (_this.barDragRef) {
2651
+ _this.barDragRef.disabled = false;
2652
+ }
2653
+ _this.barElement.classList.remove(activeClass);
2654
+ _this.destroyLinkDraggingLine();
2655
+ _this.dragContainer.emitLinkDragEnded();
2715
2656
  });
2657
+ dragRefs.push(dragRef);
2716
2658
  });
2659
+ return dragRefs;
2660
+ };
2661
+ GanttBarDrag.prototype.openDragBackdrop = function (dragElement, start, end) {
2662
+ var dragMaskElement = this.dom.root.querySelector('.gantt-drag-mask');
2663
+ var dragBackdropElement = this.dom.root.querySelector('.gantt-drag-backdrop');
2664
+ var rootRect = this.dom.root.getBoundingClientRect();
2665
+ var dragRect = dragElement.getBoundingClientRect();
2666
+ var left = dragRect.left - rootRect.left - this.dom.side.clientWidth;
2667
+ var width = dragRect.right - dragRect.left;
2668
+ dragMaskElement.style.left = left + 'px';
2669
+ dragMaskElement.style.width = width + 'px';
2670
+ dragMaskElement.querySelector('.start').innerHTML = start.format('MM-dd');
2671
+ dragMaskElement.querySelector('.end').innerHTML = end.format('MM-dd');
2672
+ dragMaskElement.style.display = 'block';
2673
+ dragBackdropElement.style.display = 'block';
2674
+ };
2675
+ GanttBarDrag.prototype.closeDragBackdrop = function () {
2676
+ var dragMaskElement = this.dom.root.querySelector('.gantt-drag-mask');
2677
+ var dragBackdropElement = this.dom.root.querySelector('.gantt-drag-backdrop');
2678
+ dragMaskElement.style.display = 'none';
2679
+ dragBackdropElement.style.display = 'none';
2717
2680
  };
2718
- NgxGanttRootComponent.prototype.setupViewScroll = function () {
2719
- var _this = this;
2720
- if (this.ganttUpper.disabledLoadOnScroll) {
2721
- return;
2681
+ GanttBarDrag.prototype.setDraggingStyles = function () {
2682
+ this.barElement.style.pointerEvents = 'none';
2683
+ this.barElement.classList.add('gantt-bar-draggable-drag');
2684
+ };
2685
+ GanttBarDrag.prototype.clearDraggingStyles = function () {
2686
+ this.barElement.style.pointerEvents = '';
2687
+ this.barElement.classList.remove('gantt-bar-draggable-drag');
2688
+ };
2689
+ GanttBarDrag.prototype.calcLinkLinePositions = function (target, isBefore) {
2690
+ var rootRect = this.dom.root.getBoundingClientRect();
2691
+ var targetRect = target.getBoundingClientRect();
2692
+ var layerRect = target.parentElement.parentElement.getBoundingClientRect();
2693
+ return {
2694
+ x1: layerRect.left + (isBefore ? 0 : layerRect.width) - rootRect.left,
2695
+ y1: layerRect.top + layerRect.height / 2 - rootRect.top,
2696
+ x2: targetRect.left - rootRect.left + targetRect.width / 2,
2697
+ y2: targetRect.top - rootRect.top + targetRect.height / 2
2698
+ };
2699
+ };
2700
+ GanttBarDrag.prototype.createLinkDraggingLine = function () {
2701
+ if (!this.linkDraggingLine) {
2702
+ var svgElement = createSvgElement('svg', 'gantt-link-drag-container');
2703
+ var linElement = createSvgElement('line', 'link-dragging-line');
2704
+ svgElement.appendChild(linElement);
2705
+ this.dom.root.appendChild(svgElement);
2706
+ this.linkDraggingLine = linElement;
2722
2707
  }
2723
- this.dom
2724
- .getViewerScroll()
2725
- .pipe(operators.takeUntil(this.unsubscribe$))
2726
- .subscribe(function (event) {
2727
- if (event.direction === ScrollDirection.LEFT) {
2728
- var dates_1 = _this.view.addStartDate();
2729
- if (dates_1) {
2730
- event.target.scrollLeft += _this.view.getDateRangeWidth(dates_1.start, dates_1.end);
2731
- _this.ngZone.run(function () {
2732
- _this.ganttUpper.loadOnScroll.emit({ start: dates_1.start.getUnixTime(), end: dates_1.end.getUnixTime() });
2733
- });
2734
- }
2735
- }
2736
- if (event.direction === ScrollDirection.RIGHT) {
2737
- var dates_2 = _this.view.addEndDate();
2738
- if (dates_2) {
2739
- _this.ngZone.run(function () {
2740
- _this.ganttUpper.loadOnScroll.emit({ start: dates_2.start.getUnixTime(), end: dates_2.end.getUnixTime() });
2741
- });
2742
- }
2743
- }
2744
- });
2745
2708
  };
2746
- NgxGanttRootComponent.prototype.setupResize = function () {
2747
- var _this = this;
2748
- this.dom
2749
- .getResize()
2750
- .pipe(operators.takeUntil(this.unsubscribe$))
2751
- .subscribe(function () {
2752
- _this.setupScrollClass();
2753
- });
2709
+ GanttBarDrag.prototype.destroyLinkDraggingLine = function () {
2710
+ if (this.linkDraggingLine) {
2711
+ this.linkDraggingLine.parentElement.remove();
2712
+ this.linkDraggingLine = null;
2713
+ }
2754
2714
  };
2755
- NgxGanttRootComponent.prototype.setupScrollClass = function () {
2756
- var mainContainer = this.dom.mainContainer;
2757
- var height = mainContainer.offsetHeight;
2758
- var scrollHeight = mainContainer.scrollHeight;
2759
- if (scrollHeight > height) {
2760
- this.elementRef.nativeElement.className = 'gantt gantt-scroll';
2715
+ GanttBarDrag.prototype.createDrags = function (elementRef, item, ganttUpper) {
2716
+ var _a, _b;
2717
+ this.item = item;
2718
+ this.barElement = elementRef.nativeElement;
2719
+ this.ganttUpper = ganttUpper;
2720
+ if (!item.draggable || (this.dragDisabled && this.linkDragDisabled)) {
2721
+ return;
2761
2722
  }
2762
2723
  else {
2763
- this.elementRef.nativeElement.className = 'gantt';
2724
+ this.createMouseEvents();
2725
+ if (!this.dragDisabled) {
2726
+ var dragRef = this.createBarDrag();
2727
+ var dragHandlesRefs = this.createBarHandleDrags();
2728
+ (_a = this.dragRefs).push.apply(_a, __spreadArray([dragRef], __read(dragHandlesRefs)));
2729
+ }
2730
+ if (!this.linkDragDisabled) {
2731
+ var linkDragRefs = this.createLinkHandleDrags();
2732
+ (_b = this.dragRefs).push.apply(_b, __spreadArray([], __read(linkDragRefs)));
2733
+ }
2764
2734
  }
2765
2735
  };
2766
- NgxGanttRootComponent.prototype.scrollToToday = function () {
2767
- var x = this.view.getTodayXPoint();
2768
- this.dom.scrollMainContainer(x);
2736
+ GanttBarDrag.prototype.ngOnDestroy = function () {
2737
+ this.closeDragBackdrop();
2738
+ this.dragRefs.forEach(function (dragRef) { return dragRef.dispose(); });
2739
+ this.destroy$.next();
2740
+ this.destroy$.complete();
2769
2741
  };
2770
- return NgxGanttRootComponent;
2742
+ return GanttBarDrag;
2771
2743
  }());
2772
- NgxGanttRootComponent.decorators = [
2773
- { type: core.Component, args: [{
2774
- selector: 'ngx-gantt-root',
2775
- 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",
2776
- providers: [GanttDomService, GanttDragContainer]
2777
- },] }
2778
- ];
2779
- NgxGanttRootComponent.ctorParameters = function () { return [
2780
- { type: core.ElementRef },
2781
- { type: core.NgZone },
2782
- { type: GanttDomService },
2783
- { type: GanttDragContainer },
2784
- { type: GanttUpper, decorators: [{ type: core.Inject, args: [GANTT_UPPER_TOKEN,] }] },
2785
- { type: GanttPrintService, decorators: [{ type: core.Optional }] }
2786
- ]; };
2787
- NgxGanttRootComponent.propDecorators = {
2788
- sideWidth: [{ type: core.Input }],
2789
- ganttClass: [{ type: core.HostBinding, args: ['class.gantt',] }],
2790
- sideTemplate: [{ type: core.ContentChild, args: ['sideTemplate', { static: true },] }],
2791
- mainTemplate: [{ type: core.ContentChild, args: ['mainTemplate', { static: true },] }]
2792
- };
2744
+ 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 });
2745
+ GanttBarDrag.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0__namespace, type: GanttBarDrag });
2746
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0__namespace, type: GanttBarDrag, decorators: [{
2747
+ type: i0.Injectable
2748
+ }], ctorParameters: function () { return [{ type: i1__namespace.DragDrop }, { type: GanttDomService }, { type: GanttDragContainer }]; } });
2793
2749
 
2794
- var NgxGanttRangeComponent = /** @class */ (function (_super) {
2795
- __extends(NgxGanttRangeComponent, _super);
2796
- function NgxGanttRangeComponent(elementRef, ganttUpper) {
2750
+ function linearGradient(sideOrCorner, color, stop) {
2751
+ return "linear-gradient(" + sideOrCorner + "," + color + " 0%," + stop + " 40%)";
2752
+ }
2753
+ var NgxGanttBarComponent = /** @class */ (function (_super) {
2754
+ __extends(NgxGanttBarComponent, _super);
2755
+ function NgxGanttBarComponent(dragContainer, drag, elementRef, ganttUpper) {
2797
2756
  var _this = _super.call(this, elementRef, ganttUpper) || this;
2798
- _this.ganttRangeClass = true;
2757
+ _this.dragContainer = dragContainer;
2758
+ _this.drag = drag;
2759
+ _this.ganttUpper = ganttUpper;
2760
+ _this.barClick = new i0.EventEmitter();
2761
+ _this.ganttItemClass = true;
2762
+ _this.color = 'red';
2799
2763
  return _this;
2800
2764
  }
2801
- NgxGanttRangeComponent.prototype.ngOnInit = function () {
2765
+ NgxGanttBarComponent.prototype.ngOnInit = function () {
2766
+ var _this = this;
2802
2767
  _super.prototype.onInit.call(this);
2768
+ this.dragContainer.dragEnded.pipe(operators.takeUntil(this.unsubscribe$)).subscribe(function () {
2769
+ _this.setContentBackground();
2770
+ });
2803
2771
  };
2804
- NgxGanttRangeComponent.prototype.ngOnChanges = function () {
2772
+ NgxGanttBarComponent.prototype.ngAfterViewInit = function () {
2773
+ this.drag.createDrags(this.elementRef, this.item, this.ganttUpper);
2774
+ this.setContentBackground();
2775
+ };
2776
+ NgxGanttBarComponent.prototype.ngOnChanges = function () {
2805
2777
  _super.prototype.onChanges.call(this);
2806
2778
  };
2807
- NgxGanttRangeComponent.prototype.ngOnDestroy = function () {
2779
+ NgxGanttBarComponent.prototype.onBarClick = function (event) {
2780
+ this.barClick.emit({ event: event, item: this.item.origin });
2781
+ };
2782
+ NgxGanttBarComponent.prototype.setContentBackground = function () {
2783
+ var contentElement = this.contentElementRef.nativeElement;
2784
+ var color = this.item.color || barBackground;
2785
+ var style = this.item.barStyle || {};
2786
+ if (this.item.origin.start && this.item.origin.end) {
2787
+ style.background = color;
2788
+ style.borderRadius = '';
2789
+ }
2790
+ if (this.item.origin.start && !this.item.origin.end) {
2791
+ style.background = linearGradient('to left', hexToRgb(color, 0.55), hexToRgb(color, 1));
2792
+ style.borderRadius = '4px 12.5px 12.5px 4px';
2793
+ }
2794
+ if (!this.item.origin.start && this.item.origin.end) {
2795
+ style.background = linearGradient('to right', hexToRgb(color, 0.55), hexToRgb(color, 1));
2796
+ style.borderRadius = '12.5px 4px 4px 12.5px';
2797
+ }
2798
+ if (this.item.progress >= 0) {
2799
+ var contentProgressElement = contentElement.querySelector('.gantt-bar-content-progress');
2800
+ style.background = hexToRgb(color, 0.3);
2801
+ style.borderRadius = '';
2802
+ contentProgressElement.style.background = color;
2803
+ }
2804
+ for (var key in style) {
2805
+ if (style.hasOwnProperty(key)) {
2806
+ contentElement.style[key] = style[key];
2807
+ }
2808
+ }
2809
+ };
2810
+ NgxGanttBarComponent.prototype.stopPropagation = function (event) {
2811
+ event.stopPropagation();
2812
+ };
2813
+ NgxGanttBarComponent.prototype.ngOnDestroy = function () {
2808
2814
  _super.prototype.onDestroy.call(this);
2809
2815
  };
2810
- return NgxGanttRangeComponent;
2816
+ return NgxGanttBarComponent;
2811
2817
  }(GanttItemUpper));
2812
- NgxGanttRangeComponent.decorators = [
2813
- { type: core.Component, args: [{
2814
- selector: 'ngx-gantt-range,gantt-range',
2815
- 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"
2816
- },] }
2817
- ];
2818
- NgxGanttRangeComponent.ctorParameters = function () { return [
2819
- { type: core.ElementRef },
2820
- { type: GanttUpper, decorators: [{ type: core.Inject, args: [GANTT_UPPER_TOKEN,] }] }
2821
- ]; };
2822
- NgxGanttRangeComponent.propDecorators = {
2823
- ganttRangeClass: [{ type: core.HostBinding, args: ['class.gantt-range',] }]
2824
- };
2818
+ 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 });
2819
+ 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"] }] });
2820
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0__namespace, type: NgxGanttBarComponent, decorators: [{
2821
+ type: i0.Component,
2822
+ args: [{
2823
+ selector: 'ngx-gantt-bar,gantt-bar',
2824
+ templateUrl: './bar.component.html',
2825
+ providers: [GanttBarDrag]
2826
+ }]
2827
+ }], ctorParameters: function () {
2828
+ return [{ type: GanttDragContainer }, { type: GanttBarDrag }, { type: i0__namespace.ElementRef }, { type: GanttUpper, decorators: [{
2829
+ type: i0.Inject,
2830
+ args: [GANTT_UPPER_TOKEN]
2831
+ }] }];
2832
+ }, propDecorators: { barClick: [{
2833
+ type: i0.Output
2834
+ }], contentElementRef: [{
2835
+ type: i0.ViewChild,
2836
+ args: ['content']
2837
+ }], ganttItemClass: [{
2838
+ type: i0.HostBinding,
2839
+ args: ['class.gantt-bar']
2840
+ }] } });
2825
2841
 
2826
- var IsGanttRangeItemPipe = /** @class */ (function () {
2827
- function IsGanttRangeItemPipe() {
2842
+ var GanttMainComponent = /** @class */ (function () {
2843
+ function GanttMainComponent(ganttUpper) {
2844
+ this.ganttUpper = ganttUpper;
2845
+ this.barClick = new i0.EventEmitter();
2846
+ this.lineClick = new i0.EventEmitter();
2847
+ this.ganttMainClass = true;
2828
2848
  }
2829
- IsGanttRangeItemPipe.prototype.transform = function (value) {
2830
- return value === exports.GanttItemType.range;
2849
+ GanttMainComponent.prototype.ngOnInit = function () { };
2850
+ GanttMainComponent.prototype.trackBy = function (item, index) {
2851
+ return item.id || index;
2831
2852
  };
2832
- return IsGanttRangeItemPipe;
2853
+ return GanttMainComponent;
2833
2854
  }());
2834
- IsGanttRangeItemPipe.decorators = [
2835
- { type: core.Pipe, args: [{
2836
- name: 'isGanttRangeItem'
2837
- },] }
2838
- ];
2839
- var IsGanttBarItemPipe = /** @class */ (function () {
2840
- function IsGanttBarItemPipe() {
2855
+ 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 });
2856
+ 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; trackBy: trackBy\">\n <div class=\"gantt-item\" [style.height.px]=\"ganttUpper.styles.lineHeight\">\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 } });
2857
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0__namespace, type: GanttMainComponent, decorators: [{
2858
+ type: i0.Component,
2859
+ args: [{
2860
+ selector: 'gantt-main',
2861
+ templateUrl: './gantt-main.component.html'
2862
+ }]
2863
+ }], ctorParameters: function () {
2864
+ return [{ type: GanttUpper, decorators: [{
2865
+ type: i0.Inject,
2866
+ args: [GANTT_UPPER_TOKEN]
2867
+ }] }];
2868
+ }, propDecorators: { groups: [{
2869
+ type: i0.Input
2870
+ }], items: [{
2871
+ type: i0.Input
2872
+ }], groupHeaderTemplate: [{
2873
+ type: i0.Input
2874
+ }], itemTemplate: [{
2875
+ type: i0.Input
2876
+ }], barTemplate: [{
2877
+ type: i0.Input
2878
+ }], rangeTemplate: [{
2879
+ type: i0.Input
2880
+ }], barClick: [{
2881
+ type: i0.Output
2882
+ }], lineClick: [{
2883
+ type: i0.Output
2884
+ }], ganttMainClass: [{
2885
+ type: i0.HostBinding,
2886
+ args: ['class.gantt-main-container']
2887
+ }] } });
2888
+
2889
+ var NgxGanttComponent = /** @class */ (function (_super) {
2890
+ __extends(NgxGanttComponent, _super);
2891
+ function NgxGanttComponent(elementRef, cdr, ngZone) {
2892
+ var _this = _super.call(this, elementRef, cdr, ngZone) || this;
2893
+ _this.maxLevel = 2;
2894
+ _this.linkDragStarted = new i0.EventEmitter();
2895
+ _this.linkDragEnded = new i0.EventEmitter();
2896
+ _this.lineClick = new i0.EventEmitter();
2897
+ _this.ngUnsubscribe$ = new rxjs.Subject();
2898
+ _this.sideTableWidth = sideWidth;
2899
+ return _this;
2841
2900
  }
2842
- IsGanttBarItemPipe.prototype.transform = function (value) {
2843
- return value === exports.GanttItemType.bar;
2901
+ NgxGanttComponent.prototype.ngOnInit = function () {
2902
+ var _this = this;
2903
+ _super.prototype.onInit.call(this);
2904
+ this.ngZone.onStable.pipe(operators.take(1)).subscribe(function () {
2905
+ _this.dragContainer.linkDragStarted.pipe(operators.takeUntil(_this.ngUnsubscribe$)).subscribe(function (event) {
2906
+ _this.linkDragStarted.emit(event);
2907
+ });
2908
+ _this.dragContainer.linkDragEnded.pipe(operators.takeUntil(_this.ngUnsubscribe$)).subscribe(function (event) {
2909
+ _this.linkDragEnded.emit(event);
2910
+ });
2911
+ });
2844
2912
  };
2845
- return IsGanttBarItemPipe;
2846
- }());
2847
- IsGanttBarItemPipe.decorators = [
2848
- { type: core.Pipe, args: [{
2849
- name: 'isGanttBarItem'
2850
- },] }
2851
- ];
2852
- var IsGanttCustomItemPipe = /** @class */ (function () {
2853
- function IsGanttCustomItemPipe() {
2854
- }
2855
- IsGanttCustomItemPipe.prototype.transform = function (value) {
2856
- return value === exports.GanttItemType.custom;
2913
+ NgxGanttComponent.prototype.ngAfterViewInit = function () {
2914
+ var _this = this;
2915
+ this.columns.changes.pipe(operators.startWith(true), operators.takeUntil(this.ngUnsubscribe$)).subscribe(function () {
2916
+ _this.columns.forEach(function (column) {
2917
+ if (!column.columnWidth) {
2918
+ column.columnWidth = coercion.coerceCssPixelValue(defaultColumnWidth);
2919
+ }
2920
+ });
2921
+ _this.cdr.detectChanges();
2922
+ });
2857
2923
  };
2858
- return IsGanttCustomItemPipe;
2859
- }());
2860
- IsGanttCustomItemPipe.decorators = [
2861
- { type: core.Pipe, args: [{
2862
- name: 'isGanttCustomItem'
2863
- },] }
2864
- ];
2924
+ NgxGanttComponent.prototype.ngOnChanges = function (changes) {
2925
+ _super.prototype.onChanges.call(this, changes);
2926
+ };
2927
+ NgxGanttComponent.prototype.expandChildren = function (item) {
2928
+ var _this = this;
2929
+ if (!item.expanded) {
2930
+ item.setExpand(true);
2931
+ if (this.async && this.childrenResolve && item.children.length === 0) {
2932
+ item.loading = true;
2933
+ this.childrenResolve(item.origin)
2934
+ .pipe(operators.take(1), operators.finalize(function () {
2935
+ item.loading = false;
2936
+ _this.expandChange.emit();
2937
+ _this.cdr.detectChanges();
2938
+ }))
2939
+ .subscribe(function (items) {
2940
+ item.addChildren(items);
2941
+ _this.computeItemsRefs.apply(_this, __spreadArray([], __read(item.children)));
2942
+ });
2943
+ }
2944
+ else {
2945
+ this.computeItemsRefs.apply(this, __spreadArray([], __read(item.children)));
2946
+ this.expandChange.emit();
2947
+ }
2948
+ }
2949
+ else {
2950
+ item.setExpand(false);
2951
+ this.expandChange.emit();
2952
+ }
2953
+ };
2954
+ NgxGanttComponent.prototype.ngOnDestroy = function () {
2955
+ _super.prototype.onDestroy.call(this);
2956
+ };
2957
+ return NgxGanttComponent;
2958
+ }(GanttUpper));
2959
+ 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 }], target: i0__namespace.ɵɵFactoryTarget.Component });
2960
+ NgxGanttComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.1.2", type: NgxGanttComponent, selector: "ngx-gantt", inputs: { maxLevel: "maxLevel", async: "async", childrenResolve: "childrenResolve", linkable: "linkable" }, outputs: { linkDragStarted: "linkDragStarted", linkDragEnded: "linkDragEnded", lineClick: "lineClick" }, providers: [
2961
+ {
2962
+ provide: GANTT_UPPER_TOKEN,
2963
+ useExisting: NgxGanttComponent
2964
+ },
2965
+ {
2966
+ provide: GANTT_ABSTRACT_TOKEN,
2967
+ useExisting: i0.forwardRef(function () { return NgxGanttComponent; })
2968
+ }
2969
+ ], 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 [groups]=\"groups\" [items]=\"items\" [columns]=\"columns\" [groupTemplate]=\"groupTemplate\" [emptyTemplate]=\"tableEmptyTemplate\"></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"] }, { type: GanttMainComponent, selector: "gantt-main", inputs: ["groups", "items", "groupHeaderTemplate", "itemTemplate", "barTemplate", "rangeTemplate"], outputs: ["barClick", "lineClick"] }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
2970
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0__namespace, type: NgxGanttComponent, decorators: [{
2971
+ type: i0.Component,
2972
+ args: [{
2973
+ selector: 'ngx-gantt',
2974
+ templateUrl: './gantt.component.html',
2975
+ changeDetection: i0.ChangeDetectionStrategy.OnPush,
2976
+ providers: [
2977
+ {
2978
+ provide: GANTT_UPPER_TOKEN,
2979
+ useExisting: NgxGanttComponent
2980
+ },
2981
+ {
2982
+ provide: GANTT_ABSTRACT_TOKEN,
2983
+ useExisting: i0.forwardRef(function () { return NgxGanttComponent; })
2984
+ }
2985
+ ]
2986
+ }]
2987
+ }], ctorParameters: function () { return [{ type: i0__namespace.ElementRef }, { type: i0__namespace.ChangeDetectorRef }, { type: i0__namespace.NgZone }]; }, propDecorators: { maxLevel: [{
2988
+ type: i0.Input
2989
+ }], async: [{
2990
+ type: i0.Input
2991
+ }], childrenResolve: [{
2992
+ type: i0.Input
2993
+ }], linkable: [{
2994
+ type: i0.Input
2995
+ }], linkDragStarted: [{
2996
+ type: i0.Output
2997
+ }], linkDragEnded: [{
2998
+ type: i0.Output
2999
+ }], lineClick: [{
3000
+ type: i0.Output
3001
+ }], table: [{
3002
+ type: i0.ContentChild,
3003
+ args: [NgxGanttTableComponent]
3004
+ }], columns: [{
3005
+ type: i0.ContentChildren,
3006
+ args: [NgxGanttTableColumnComponent, { descendants: true }]
3007
+ }], tableEmptyTemplate: [{
3008
+ type: i0.ContentChild,
3009
+ args: ['tableEmpty', { static: true }]
3010
+ }] } });
2865
3011
 
2866
3012
  var NgxGanttModule = /** @class */ (function () {
2867
3013
  function NgxGanttModule() {
2868
3014
  }
2869
3015
  return NgxGanttModule;
2870
3016
  }());
2871
- NgxGanttModule.decorators = [
2872
- { type: core.NgModule, args: [{
2873
- imports: [common.CommonModule, dragDrop.DragDropModule],
2874
- exports: [NgxGanttComponent, NgxGanttTableComponent, NgxGanttTableColumnComponent, NgxGanttRootComponent, NgxGanttBarComponent],
2875
- declarations: [
2876
- NgxGanttComponent,
2877
- NgxGanttTableComponent,
2878
- NgxGanttTableColumnComponent,
2879
- GanttTableComponent,
2880
- GanttMainComponent,
2881
- GanttCalendarComponent,
2882
- GanttLinksComponent,
2883
- NgxGanttBarComponent,
2884
- GanttIconComponent,
2885
- GanttDragBackdropComponent,
2886
- NgxGanttRangeComponent,
2887
- NgxGanttRootComponent,
2888
- IsGanttRangeItemPipe,
2889
- IsGanttBarItemPipe,
2890
- IsGanttCustomItemPipe
2891
- ],
2892
- providers: []
2893
- },] }
2894
- ];
3017
+ NgxGanttModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0__namespace, type: NgxGanttModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
3018
+ NgxGanttModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0__namespace, type: NgxGanttModule, declarations: [NgxGanttComponent,
3019
+ NgxGanttTableComponent,
3020
+ NgxGanttTableColumnComponent,
3021
+ GanttTableComponent,
3022
+ GanttMainComponent,
3023
+ GanttCalendarComponent,
3024
+ GanttLinksComponent,
3025
+ NgxGanttBarComponent,
3026
+ GanttIconComponent,
3027
+ GanttDragBackdropComponent,
3028
+ NgxGanttRangeComponent,
3029
+ NgxGanttRootComponent,
3030
+ IsGanttRangeItemPipe,
3031
+ IsGanttBarItemPipe,
3032
+ IsGanttCustomItemPipe], imports: [i2.CommonModule, i1.DragDropModule], exports: [NgxGanttComponent,
3033
+ NgxGanttTableComponent,
3034
+ NgxGanttTableColumnComponent,
3035
+ NgxGanttRootComponent,
3036
+ NgxGanttBarComponent,
3037
+ NgxGanttRangeComponent] });
3038
+ NgxGanttModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0__namespace, type: NgxGanttModule, providers: [], imports: [[i2.CommonModule, i1.DragDropModule]] });
3039
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0__namespace, type: NgxGanttModule, decorators: [{
3040
+ type: i0.NgModule,
3041
+ args: [{
3042
+ imports: [i2.CommonModule, i1.DragDropModule],
3043
+ exports: [
3044
+ NgxGanttComponent,
3045
+ NgxGanttTableComponent,
3046
+ NgxGanttTableColumnComponent,
3047
+ NgxGanttRootComponent,
3048
+ NgxGanttBarComponent,
3049
+ NgxGanttRangeComponent
3050
+ ],
3051
+ declarations: [
3052
+ NgxGanttComponent,
3053
+ NgxGanttTableComponent,
3054
+ NgxGanttTableColumnComponent,
3055
+ GanttTableComponent,
3056
+ GanttMainComponent,
3057
+ GanttCalendarComponent,
3058
+ GanttLinksComponent,
3059
+ NgxGanttBarComponent,
3060
+ GanttIconComponent,
3061
+ GanttDragBackdropComponent,
3062
+ NgxGanttRangeComponent,
3063
+ NgxGanttRootComponent,
3064
+ IsGanttRangeItemPipe,
3065
+ IsGanttBarItemPipe,
3066
+ IsGanttCustomItemPipe
3067
+ ],
3068
+ providers: []
3069
+ }]
3070
+ }] });
2895
3071
 
2896
3072
  /*
2897
3073
  * Public API Surface of gantt
@@ -3111,26 +3287,15 @@
3111
3287
  exports.IsGanttBarItemPipe = IsGanttBarItemPipe;
3112
3288
  exports.IsGanttCustomItemPipe = IsGanttCustomItemPipe;
3113
3289
  exports.IsGanttRangeItemPipe = IsGanttRangeItemPipe;
3290
+ exports.NgxGanttBarComponent = NgxGanttBarComponent;
3114
3291
  exports.NgxGanttComponent = NgxGanttComponent;
3115
3292
  exports.NgxGanttModule = NgxGanttModule;
3293
+ exports.NgxGanttRangeComponent = NgxGanttRangeComponent;
3116
3294
  exports.NgxGanttRootComponent = NgxGanttRootComponent;
3117
3295
  exports.NgxGanttTableColumnComponent = NgxGanttTableColumnComponent;
3118
3296
  exports.NgxGanttTableComponent = NgxGanttTableComponent;
3119
- exports.defaultColumnWidth = defaultColumnWidth;
3120
- exports.minColumnWidth = minColumnWidth;
3121
3297
  exports.primaryDatePointTop = primaryDatePointTop;
3122
3298
  exports.secondaryDatePointTop = secondaryDatePointTop;
3123
- exports.ɵa = GanttDomService;
3124
- exports.ɵb = GanttDragContainer;
3125
- exports.ɵc = NgxGanttBarComponent;
3126
- exports.ɵd = GanttBarDrag;
3127
- exports.ɵe = GanttTableComponent;
3128
- exports.ɵf = GanttMainComponent;
3129
- exports.ɵg = GanttCalendarComponent;
3130
- exports.ɵh = GanttLinksComponent;
3131
- exports.ɵi = GanttIconComponent;
3132
- exports.ɵj = GanttDragBackdropComponent;
3133
- exports.ɵk = NgxGanttRangeComponent;
3134
3299
 
3135
3300
  Object.defineProperty(exports, '__esModule', { value: true });
3136
3301