gantt-task-react-powern 0.4.68 → 0.4.70

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -21,10 +21,6 @@ function _extends() {
21
21
  return _extends.apply(this, arguments);
22
22
  }
23
23
 
24
- function _objectDestructuringEmpty(obj) {
25
- if (obj == null) throw new TypeError("Cannot destructure undefined");
26
- }
27
-
28
24
  function _unsupportedIterableToArray(o, minLen) {
29
25
  if (!o) return;
30
26
  if (typeof o === "string") return _arrayLikeToArray(o, minLen);
@@ -285,7 +281,9 @@ var TaskListHeaderDefault = function TaskListHeaderDefault(_ref) {
285
281
  var headerHeight = _ref.headerHeight,
286
282
  fontFamily = _ref.fontFamily,
287
283
  fontSize = _ref.fontSize,
288
- rowWidth = _ref.rowWidth;
284
+ rowWidth = _ref.rowWidth,
285
+ allSelected = _ref.allSelected,
286
+ onSelectAll = _ref.onSelectAll;
289
287
  return React__default.createElement("div", {
290
288
  className: styles.ganttTable,
291
289
  style: {
@@ -297,7 +295,19 @@ var TaskListHeaderDefault = function TaskListHeaderDefault(_ref) {
297
295
  style: {
298
296
  height: headerHeight - 2
299
297
  }
300
- }, React__default.createElement("div", {
298
+ }, onSelectAll && React__default.createElement("div", null, React__default.createElement("div", {
299
+ className: styles.ganttTable_HeaderItem,
300
+ style: {
301
+ minWidth: parseInt(rowWidth) * 0.3,
302
+ maxWidth: parseInt(rowWidth) * 0.3
303
+ }
304
+ }, React__default.createElement("input", {
305
+ type: "checkbox",
306
+ checked: allSelected,
307
+ onChange: function onChange(e) {
308
+ return onSelectAll(e.target.checked);
309
+ }
310
+ }))), React__default.createElement("div", {
301
311
  className: styles.ganttTable_HeaderItem,
302
312
  style: {
303
313
  minWidth: parseInt(rowWidth) * 0.8,
@@ -309,6 +319,18 @@ var TaskListHeaderDefault = function TaskListHeaderDefault(_ref) {
309
319
  height: headerHeight * 0.5,
310
320
  marginTop: headerHeight * 0.2
311
321
  }
322
+ }), React__default.createElement("div", {
323
+ className: styles.ganttTable_HeaderItem,
324
+ style: {
325
+ minWidth: parseInt(rowWidth) * 0.8,
326
+ maxWidth: parseInt(rowWidth) * 0.8
327
+ }
328
+ }, "ID"), React__default.createElement("div", {
329
+ className: styles.ganttTable_HeaderSeparator,
330
+ style: {
331
+ height: headerHeight * 0.5,
332
+ marginTop: headerHeight * 0.2
333
+ }
312
334
  }), React__default.createElement("div", {
313
335
  className: styles.ganttTable_HeaderItem,
314
336
  style: {
@@ -342,7 +364,7 @@ var TaskListHeaderDefault = function TaskListHeaderDefault(_ref) {
342
364
  }, "Planned End")));
343
365
  };
344
366
 
345
- var styles$1 = {"taskListWrapper":"_3ZbQT","taskListTableRow":"_34SS0","taskListCell":"_3lLk3","taskListNameWrapper":"_nI1Xw","taskListExpander":"_2QjE6","taskListExpanderPlaceholder":"_1fnLB","taskListEmptyExpander":"_2TfEi","taskListText":"_2ZvXU"};
367
+ var styles$1 = {"taskListWrapper":"_3ZbQT","taskListTableRow":"_34SS0","taskListLookAheadRow":"_GzvG4","taskListMilestoneRow":"_3Ykml","taskListCell":"_3lLk3","taskListNameWrapper":"_nI1Xw","taskListExpander":"_2QjE6","taskListExpanderPlaceholder":"_1fnLB","taskListEmptyExpander":"_2TfEi","taskListText":"_2ZvXU"};
346
368
 
347
369
  var localeDateStringCache = {};
348
370
 
@@ -370,11 +392,15 @@ var TaskListTableDefault = function TaskListTableDefault(_ref) {
370
392
  var rowHeight = _ref.rowHeight,
371
393
  rowWidth = _ref.rowWidth,
372
394
  tasks = _ref.tasks,
395
+ scheduleType = _ref.scheduleType,
373
396
  leafTasks = _ref.leafTasks,
374
397
  fontFamily = _ref.fontFamily,
375
398
  fontSize = _ref.fontSize,
376
399
  locale = _ref.locale,
377
400
  onExpanderClick = _ref.onExpanderClick,
401
+ _ref$selectedTasks = _ref.selectedTasks,
402
+ selectedTasks = _ref$selectedTasks === void 0 ? [] : _ref$selectedTasks,
403
+ onTaskSelect = _ref.onTaskSelect,
378
404
  _ref$taskLabelRendere = _ref.taskLabelRenderer,
379
405
  taskLabelRenderer = _ref$taskLabelRendere === void 0 ? function (t) {
380
406
  return " " + t.name;
@@ -404,13 +430,36 @@ var TaskListTableDefault = function TaskListTableDefault(_ref) {
404
430
  }
405
431
  }
406
432
 
433
+ var isSelected = selectedTasks.includes(t.id);
407
434
  return React__default.createElement("div", {
408
- className: styles$1.taskListTableRow,
435
+ className: t.type === "milestone" ? styles$1.taskListMilestoneRow : scheduleType === "lookAhead" ? styles$1.taskListLookAheadRow : styles$1.taskListTableRow,
409
436
  style: {
410
437
  height: rowHeight
411
438
  },
412
439
  key: t.id + "row"
440
+ }, onTaskSelect && React__default.createElement("div", {
441
+ className: styles$1.taskListCell,
442
+ style: {
443
+ minWidth: parseInt(rowWidth) * 0.3,
444
+ maxWidth: parseInt(rowWidth) * 0.3
445
+ }
413
446
  }, React__default.createElement("div", {
447
+ className: styles$1.taskListText,
448
+ style: {
449
+ display: "flex",
450
+ justifyContent: "center",
451
+ alignItems: "center",
452
+ height: "100%",
453
+ paddingLeft: "0",
454
+ paddingRight: "0"
455
+ }
456
+ }, React__default.createElement("input", {
457
+ type: "checkbox",
458
+ checked: isSelected,
459
+ onChange: function onChange(e) {
460
+ return onTaskSelect(t.id, e.target.checked);
461
+ }
462
+ }))), React__default.createElement("div", {
414
463
  className: styles$1.taskListCell,
415
464
  style: {
416
465
  minWidth: parseInt(rowWidth) * 0.8,
@@ -438,6 +487,13 @@ var TaskListTableDefault = function TaskListTableDefault(_ref) {
438
487
  fontSize: "16px"
439
488
  }
440
489
  }, "\u2714") : ""))), React__default.createElement("div", {
490
+ className: styles$1.taskListCell,
491
+ style: {
492
+ minWidth: parseInt(rowWidth) * 0.8,
493
+ maxWidth: parseInt(rowWidth) * 0.8
494
+ },
495
+ title: t.optionalId ? t.optionalId : ""
496
+ }, t.optionalId), React__default.createElement("div", {
441
497
  className: styles$1.taskListCell,
442
498
  style: {
443
499
  minWidth: parseInt(rowWidth) * 2,
@@ -629,6 +685,7 @@ var TaskList = function TaskList(_ref) {
629
685
  rowHeight = _ref.rowHeight,
630
686
  scrollY = _ref.scrollY,
631
687
  tasks = _ref.tasks,
688
+ scheduleType = _ref.scheduleType,
632
689
  leafTasks = _ref.leafTasks,
633
690
  selectedTask = _ref.selectedTask,
634
691
  setSelectedTask = _ref.setSelectedTask,
@@ -639,18 +696,61 @@ var TaskList = function TaskList(_ref) {
639
696
  horizontalContainerClass = _ref.horizontalContainerClass,
640
697
  TaskListHeader = _ref.TaskListHeader,
641
698
  TaskListTable = _ref.TaskListTable,
642
- taskLabelRenderer = _ref.taskLabelRenderer;
699
+ taskLabelRenderer = _ref.taskLabelRenderer,
700
+ onMultiSelect = _ref.onMultiSelect;
643
701
  var horizontalContainerRef = React.useRef(null);
702
+
703
+ var _useState = React.useState([]),
704
+ selectedTasks = _useState[0],
705
+ setSelectedTasks = _useState[1];
706
+
707
+ var prevSelectedTasksRef = React.useRef([]);
644
708
  React.useEffect(function () {
645
709
  if (horizontalContainerRef.current) {
646
710
  horizontalContainerRef.current.scrollTop = scrollY;
647
711
  }
648
712
  }, [scrollY]);
713
+ React.useEffect(function () {
714
+ if (onMultiSelect && JSON.stringify(prevSelectedTasksRef.current) !== JSON.stringify(selectedTasks)) {
715
+ var selectedTaskObjects = tasks.filter(function (task) {
716
+ return selectedTasks.includes(task.id);
717
+ });
718
+ prevSelectedTasksRef.current = [].concat(selectedTasks);
719
+ onMultiSelect(selectedTaskObjects);
720
+ }
721
+ }, [selectedTasks, tasks, onMultiSelect]);
722
+
723
+ var handleTaskSelect = function handleTaskSelect(taskId, selected) {
724
+ if (selected) {
725
+ setSelectedTasks(function (prev) {
726
+ return [].concat(prev, [taskId]);
727
+ });
728
+ } else {
729
+ setSelectedTasks(function (prev) {
730
+ return prev.filter(function (id) {
731
+ return id !== taskId;
732
+ });
733
+ });
734
+ }
735
+ };
736
+
737
+ var handleSelectAll = function handleSelectAll(selected) {
738
+ if (selected) {
739
+ setSelectedTasks(tasks.map(function (task) {
740
+ return task.id;
741
+ }));
742
+ } else {
743
+ setSelectedTasks([]);
744
+ }
745
+ };
746
+
649
747
  var headerProps = {
650
748
  headerHeight: headerHeight,
651
749
  fontFamily: fontFamily,
652
750
  fontSize: fontSize,
653
- rowWidth: rowWidth
751
+ rowWidth: rowWidth,
752
+ allSelected: tasks.length > 0 && selectedTasks.length === tasks.length,
753
+ onSelectAll: onMultiSelect ? handleSelectAll : undefined
654
754
  };
655
755
  var selectedTaskId = selectedTask ? selectedTask.id : "";
656
756
  var tableProps = {
@@ -660,10 +760,13 @@ var TaskList = function TaskList(_ref) {
660
760
  fontSize: fontSize,
661
761
  tasks: tasks,
662
762
  leafTasks: leafTasks,
763
+ scheduleType: scheduleType,
663
764
  locale: locale,
664
765
  selectedTaskId: selectedTaskId,
665
766
  setSelectedTask: setSelectedTask,
666
767
  onExpanderClick: onExpanderClick,
768
+ selectedTasks: onMultiSelect ? selectedTasks : undefined,
769
+ onTaskSelect: onMultiSelect ? handleTaskSelect : undefined,
667
770
  taskLabelRenderer: taskLabelRenderer
668
771
  };
669
772
  return React__default.createElement("div", {
@@ -677,19 +780,23 @@ var TaskList = function TaskList(_ref) {
677
780
  }, React__default.createElement(TaskListTable, Object.assign({}, tableProps))));
678
781
  };
679
782
 
680
- var styles$4 = {"gridRow":"_2dZTy","gridRowLine":"_3rUKi","gridTick":"_RuwuK","darkerGridRow":"_2M-tt"};
681
-
682
- var GridBody = function GridBody(_ref) {
683
- var tasks = _ref.tasks,
684
- dates = _ref.dates,
685
- rowHeight = _ref.rowHeight,
686
- svgWidth = _ref.svgWidth,
687
- columnWidth = _ref.columnWidth,
688
- todayColor = _ref.todayColor,
689
- rtl = _ref.rtl;
690
- var y = 0;
691
- var gridRows = [];
692
- var rowLines = [React__default.createElement("line", {
783
+ var styles$4 = {"gridRow":"_2dZTy","gridRowLookAhead":"_2RRca","gridRowLine":"_3rUKi","gridTick":"_RuwuK","darkerGridRow":"_2M-tt"};
784
+
785
+ const GridBody = _ref => {
786
+ let {
787
+ tasks,
788
+ scheduleType,
789
+ dates,
790
+ rowHeight,
791
+ svgWidth,
792
+ columnWidth,
793
+ todayColor,
794
+ weekendColor,
795
+ rtl
796
+ } = _ref;
797
+ let y = 0;
798
+ const gridRows = [];
799
+ const rowLines = [React__default.createElement("line", {
693
800
  key: "RowLineFirst",
694
801
  x: "0",
695
802
  y1: 0,
@@ -698,16 +805,15 @@ var GridBody = function GridBody(_ref) {
698
805
  className: styles$4.gridRowLine
699
806
  })];
700
807
 
701
- for (var _iterator = _createForOfIteratorHelperLoose(tasks), _step; !(_step = _iterator()).done;) {
702
- var task = _step.value;
703
- var isDarkerRow = task.type === "milestone";
808
+ for (const task of tasks) {
809
+ const isDarkerRow = task.type === "milestone";
704
810
  gridRows.push(React__default.createElement("rect", {
705
811
  key: "Row" + task.id,
706
812
  x: "0",
707
813
  y: y,
708
814
  width: svgWidth,
709
815
  height: rowHeight,
710
- className: isDarkerRow ? styles$4.darkerGridRow : styles$4.gridRow
816
+ className: isDarkerRow ? styles$4.darkerGridRow : scheduleType === "lookAhead" ? styles$4.gridRowLookAhead : styles$4.gridRow
711
817
  }));
712
818
  rowLines.push(React__default.createElement("line", {
713
819
  key: "RowLine" + task.id,
@@ -720,13 +826,14 @@ var GridBody = function GridBody(_ref) {
720
826
  y += rowHeight;
721
827
  }
722
828
 
723
- var now = new Date();
724
- var tickX = 0;
725
- var ticks = [];
726
- var today = React__default.createElement("rect", null);
829
+ const now = new Date();
830
+ let tickX = 0;
831
+ const ticks = [];
832
+ let today = React__default.createElement("rect", null);
833
+ let weekend = [];
727
834
 
728
- for (var i = 0; i < dates.length; i++) {
729
- var date = dates[i];
835
+ for (let i = 0; i < dates.length; i++) {
836
+ const date = dates[i];
730
837
  ticks.push(React__default.createElement("line", {
731
838
  key: date.getTime(),
732
839
  x1: tickX,
@@ -746,6 +853,16 @@ var GridBody = function GridBody(_ref) {
746
853
  });
747
854
  }
748
855
 
856
+ if (date.getDay() === 6 || date.getDay() === 0) {
857
+ weekend.push(React__default.createElement("rect", {
858
+ x: tickX,
859
+ y: 0,
860
+ width: columnWidth,
861
+ height: y,
862
+ fill: weekendColor
863
+ }));
864
+ }
865
+
749
866
  if (rtl && i + 1 !== dates.length && date.getTime() >= now.getTime() && dates[i + 1].getTime() < now.getTime()) {
750
867
  today = React__default.createElement("rect", {
751
868
  x: tickX + columnWidth,
@@ -767,12 +884,14 @@ var GridBody = function GridBody(_ref) {
767
884
  className: "rowLines"
768
885
  }, rowLines), React__default.createElement("g", {
769
886
  className: "ticks"
770
- }, ticks), React__default.createElement("g", {
887
+ }, ticks), scheduleType === "lookAhead" && React__default.createElement("g", {
888
+ className: "weekend"
889
+ }, weekend), React__default.createElement("g", {
771
890
  className: "today"
772
891
  }, today));
773
892
  };
774
893
 
775
- var Grid = function Grid(props) {
894
+ const Grid = props => {
776
895
  return React__default.createElement("g", {
777
896
  className: "grid"
778
897
  }, React__default.createElement(GridBody, Object.assign({}, props)));
@@ -780,16 +899,17 @@ var Grid = function Grid(props) {
780
899
 
781
900
  var styles$5 = {"calendarBottomText":"_9w8d5","calendarTopTick":"_1rLuZ","calendarTopText":"_2q1Kt","calendarHeader":"_35nLX","textAnchorStart":"_2Shd-","textAnchorMiddle":"_2XXW4","textAnchorEnd":"_3GdnC"};
782
901
 
783
- var TopPartOfCalendar = function TopPartOfCalendar(_ref) {
784
- var value = _ref.value,
785
- x1Line = _ref.x1Line,
786
- y1Line = _ref.y1Line,
787
- y2Line = _ref.y2Line,
788
- xText = _ref.xText,
789
- yText = _ref.yText,
790
- _ref$textAnchor = _ref.textAnchor,
791
- textAnchor = _ref$textAnchor === void 0 ? "middle" : _ref$textAnchor;
792
- var textAnchorClass = textAnchor === "start" ? styles$5.textAnchorStart : textAnchor === "middle" ? styles$5.textAnchorMiddle : styles$5.textAnchorEnd;
902
+ const TopPartOfCalendar = _ref => {
903
+ let {
904
+ value,
905
+ x1Line,
906
+ y1Line,
907
+ y2Line,
908
+ xText,
909
+ yText,
910
+ textAnchor = "middle"
911
+ } = _ref;
912
+ const textAnchorClass = textAnchor === "start" ? styles$5.textAnchorStart : textAnchor === "middle" ? styles$5.textAnchorMiddle : styles$5.textAnchorEnd;
793
913
  return React__default.createElement("g", {
794
914
  className: "calendarTop"
795
915
  }, React__default.createElement("line", {
@@ -803,28 +923,30 @@ var TopPartOfCalendar = function TopPartOfCalendar(_ref) {
803
923
  key: value + "text",
804
924
  y: yText,
805
925
  x: xText,
806
- className: styles$5.calendarTopText + " " + textAnchorClass
926
+ className: `${styles$5.calendarTopText} ${textAnchorClass}`
807
927
  }, value));
808
928
  };
809
929
 
810
- var Calendar = function Calendar(_ref) {
811
- var dateSetup = _ref.dateSetup,
812
- locale = _ref.locale,
813
- viewMode = _ref.viewMode,
814
- rtl = _ref.rtl,
815
- headerHeight = _ref.headerHeight,
816
- columnWidth = _ref.columnWidth,
817
- fontFamily = _ref.fontFamily,
818
- fontSize = _ref.fontSize;
819
-
820
- var getCalendarValuesForYear = function getCalendarValuesForYear() {
821
- var topValues = [];
822
- var bottomValues = [];
823
- var topDefaultHeight = headerHeight * 0.5;
824
-
825
- for (var i = 0; i < dateSetup.dates.length; i++) {
826
- var date = dateSetup.dates[i];
827
- var bottomValue = date.getFullYear();
930
+ const Calendar = _ref => {
931
+ let {
932
+ dateSetup,
933
+ locale,
934
+ viewMode,
935
+ rtl,
936
+ headerHeight,
937
+ columnWidth,
938
+ fontFamily,
939
+ fontSize
940
+ } = _ref;
941
+
942
+ const getCalendarValuesForYear = () => {
943
+ const topValues = [];
944
+ const bottomValues = [];
945
+ const topDefaultHeight = headerHeight * 0.5;
946
+
947
+ for (let i = 0; i < dateSetup.dates.length; i++) {
948
+ const date = dateSetup.dates[i];
949
+ const bottomValue = date.getFullYear();
828
950
  bottomValues.push(React__default.createElement("text", {
829
951
  key: date.getFullYear(),
830
952
  y: headerHeight * 0.8,
@@ -833,8 +955,8 @@ var Calendar = function Calendar(_ref) {
833
955
  }, bottomValue));
834
956
 
835
957
  if (i === 0 || date.getFullYear() !== dateSetup.dates[i - 1].getFullYear()) {
836
- var topValue = date.getFullYear().toString();
837
- var xText = void 0;
958
+ const topValue = date.getFullYear().toString();
959
+ let xText;
838
960
 
839
961
  if (rtl) {
840
962
  xText = (6 + i + date.getFullYear() + 1) * columnWidth;
@@ -857,25 +979,25 @@ var Calendar = function Calendar(_ref) {
857
979
  return [topValues, bottomValues];
858
980
  };
859
981
 
860
- var getCalendarValuesForQuarter = function getCalendarValuesForQuarter() {
861
- var topValues = [];
862
- var bottomValues = [];
863
- var topDefaultHeight = headerHeight * 0.5;
982
+ const getCalendarValuesForQuarter = () => {
983
+ const topValues = [];
984
+ const bottomValues = [];
985
+ const topDefaultHeight = headerHeight * 0.5;
864
986
 
865
- for (var i = 0; i < dateSetup.dates.length; i++) {
866
- var date = dateSetup.dates[i];
867
- var quarter = Math.floor(date.getMonth() / 3) + 1;
868
- var bottomValue = "Q" + quarter;
987
+ for (let i = 0; i < dateSetup.dates.length; i++) {
988
+ const date = dateSetup.dates[i];
989
+ const quarter = Math.floor(date.getMonth() / 3) + 1;
990
+ const bottomValue = `Q${quarter}`;
869
991
  bottomValues.push(React__default.createElement("text", {
870
- key: bottomValue + "-" + date.getFullYear(),
992
+ key: `${bottomValue}-${date.getFullYear()}`,
871
993
  y: headerHeight * 0.8,
872
994
  x: columnWidth * i + columnWidth * 0.5,
873
995
  className: styles$5.calendarBottomText
874
996
  }, bottomValue));
875
997
 
876
998
  if (i === 0 || date.getFullYear() !== dateSetup.dates[i - 1].getFullYear()) {
877
- var topValue = date.getFullYear().toString();
878
- var xText = void 0;
999
+ const topValue = date.getFullYear().toString();
1000
+ let xText;
879
1001
 
880
1002
  if (rtl) {
881
1003
  xText = (3 + i + quarter) * columnWidth;
@@ -898,26 +1020,26 @@ var Calendar = function Calendar(_ref) {
898
1020
  return [topValues, bottomValues];
899
1021
  };
900
1022
 
901
- var getCalendarValuesForMonth = function getCalendarValuesForMonth() {
902
- var topValues = [];
903
- var bottomValues = [];
904
- var topDefaultHeight = headerHeight * 0.5;
1023
+ const getCalendarValuesForMonth = () => {
1024
+ const topValues = [];
1025
+ const bottomValues = [];
1026
+ const topDefaultHeight = headerHeight * 0.5;
905
1027
 
906
- for (var i = 0; i < dateSetup.dates.length; i++) {
907
- var date = dateSetup.dates[i];
908
- var bottomValue = date.toLocaleString(locale, {
1028
+ for (let i = 0; i < dateSetup.dates.length; i++) {
1029
+ const date = dateSetup.dates[i];
1030
+ const bottomValue = date.toLocaleString(locale, {
909
1031
  month: "short"
910
1032
  });
911
1033
  bottomValues.push(React__default.createElement("text", {
912
1034
  key: bottomValue + date.getFullYear(),
913
1035
  y: headerHeight * 0.8,
914
1036
  x: columnWidth * i + columnWidth * 0.5,
915
- className: styles$5.calendarTopText + " " + styles$5.textAnchorEnd
1037
+ className: `${styles$5.calendarTopText} ${styles$5.textAnchorEnd}`
916
1038
  }, bottomValue));
917
1039
 
918
1040
  if (i === 0 || date.getFullYear() !== dateSetup.dates[i - 1].getFullYear()) {
919
- var topValue = date.getFullYear().toString();
920
- var xText = void 0;
1041
+ const topValue = date.getFullYear().toString();
1042
+ let xText;
921
1043
 
922
1044
  if (rtl) {
923
1045
  xText = (6 + i + date.getMonth() + 1) * columnWidth;
@@ -942,27 +1064,27 @@ var Calendar = function Calendar(_ref) {
942
1064
  return [topValues, bottomValues];
943
1065
  };
944
1066
 
945
- var getCalendarValuesForWeek = function getCalendarValuesForWeek() {
946
- var topValues = [];
947
- var bottomValues = [];
948
- var weeksCount = 1;
949
- var topDefaultHeight = headerHeight * 0.5;
950
- var dates = dateSetup.dates;
1067
+ const getCalendarValuesForWeek = () => {
1068
+ const topValues = [];
1069
+ const bottomValues = [];
1070
+ let weeksCount = 1;
1071
+ const topDefaultHeight = headerHeight * 0.5;
1072
+ const dates = dateSetup.dates;
951
1073
 
952
- for (var i = dates.length - 1; i >= 0; i--) {
953
- var date = dates[i];
954
- var topValue = "";
1074
+ for (let i = dates.length - 1; i >= 0; i--) {
1075
+ const date = dates[i];
1076
+ let topValue = "";
955
1077
 
956
1078
  if (i === 0 || date.getMonth() !== dates[i - 1].getMonth()) {
957
- topValue = getLocaleMonth(date, locale) + ", " + date.getFullYear();
1079
+ topValue = `${getLocaleMonth(date, locale)}, ${date.getFullYear()}`;
958
1080
  }
959
1081
 
960
- var bottomValue = "W" + getWeekNumberISO8601(date);
1082
+ const bottomValue = `W${getWeekNumberISO8601(date)}`;
961
1083
  bottomValues.push(React__default.createElement("text", {
962
1084
  key: date.getTime(),
963
1085
  y: headerHeight * 0.8,
964
1086
  x: columnWidth * (i + +rtl),
965
- className: styles$5.calendarTopText + " " + styles$5.textAnchorStart
1087
+ className: `${styles$5.calendarTopText} ${styles$5.textAnchorStart}`
966
1088
  }, bottomValue));
967
1089
 
968
1090
  if (topValue) {
@@ -988,24 +1110,24 @@ var Calendar = function Calendar(_ref) {
988
1110
  return [topValues, bottomValues];
989
1111
  };
990
1112
 
991
- var getCalendarValuesForDay = function getCalendarValuesForDay() {
992
- var topValues = [];
993
- var bottomValues = [];
994
- var topDefaultHeight = headerHeight * 0.5;
995
- var dates = dateSetup.dates;
1113
+ const getCalendarValuesForDay = () => {
1114
+ const topValues = [];
1115
+ const bottomValues = [];
1116
+ const topDefaultHeight = headerHeight * 0.5;
1117
+ const dates = dateSetup.dates;
996
1118
 
997
- for (var i = 0; i < dates.length; i++) {
998
- var date = dates[i];
999
- var bottomValue = getLocalDayOfWeek(date, locale, "short") + ", " + date.getDate().toString();
1119
+ for (let i = 0; i < dates.length; i++) {
1120
+ const date = dates[i];
1121
+ const bottomValue = `${getLocalDayOfWeek(date, locale, "short")}, ${date.getDate().toString()}`;
1000
1122
  bottomValues.push(React__default.createElement("text", {
1001
1123
  key: date.getTime(),
1002
1124
  y: headerHeight * 0.8,
1003
1125
  x: columnWidth * i + columnWidth * 0.5,
1004
- className: styles$5.calendarTopText + " " + styles$5.textAnchorMiddle
1126
+ className: `${styles$5.calendarTopText} ${styles$5.textAnchorMiddle}`
1005
1127
  }, bottomValue));
1006
1128
 
1007
1129
  if (i + 1 !== dates.length && date.getMonth() !== dates[i + 1].getMonth()) {
1008
- var topValue = getLocaleMonth(date, locale) + " " + date.getFullYear();
1130
+ const topValue = `${getLocaleMonth(date, locale)} ${date.getFullYear()}`;
1009
1131
  topValues.push(React__default.createElement(TopPartOfCalendar, {
1010
1132
  key: topValue + date.getFullYear(),
1011
1133
  value: topValue,
@@ -1021,28 +1143,28 @@ var Calendar = function Calendar(_ref) {
1021
1143
  return [topValues, bottomValues];
1022
1144
  };
1023
1145
 
1024
- var getCalendarValuesForPartOfDay = function getCalendarValuesForPartOfDay() {
1025
- var topValues = [];
1026
- var bottomValues = [];
1027
- var ticks = viewMode === exports.ViewMode.HalfDay ? 2 : 4;
1028
- var topDefaultHeight = headerHeight * 0.5;
1029
- var dates = dateSetup.dates;
1146
+ const getCalendarValuesForPartOfDay = () => {
1147
+ const topValues = [];
1148
+ const bottomValues = [];
1149
+ const ticks = viewMode === exports.ViewMode.HalfDay ? 2 : 4;
1150
+ const topDefaultHeight = headerHeight * 0.5;
1151
+ const dates = dateSetup.dates;
1030
1152
 
1031
- for (var i = 0; i < dates.length; i++) {
1032
- var date = dates[i];
1033
- var bottomValue = getCachedDateTimeFormat(locale, {
1153
+ for (let i = 0; i < dates.length; i++) {
1154
+ const date = dates[i];
1155
+ const bottomValue = getCachedDateTimeFormat(locale, {
1034
1156
  hour: "numeric"
1035
1157
  }).format(date);
1036
1158
  bottomValues.push(React__default.createElement("text", {
1037
1159
  key: date.getTime(),
1038
1160
  y: headerHeight * 0.8,
1039
1161
  x: columnWidth * (i + +rtl),
1040
- className: styles$5.calendarTopText + " " + styles$5.textAnchorMiddle,
1162
+ className: `${styles$5.calendarTopText} ${styles$5.textAnchorMiddle}`,
1041
1163
  fontFamily: fontFamily
1042
1164
  }, bottomValue));
1043
1165
 
1044
1166
  if (i === 0 || date.getDate() !== dates[i - 1].getDate()) {
1045
- var topValue = getLocalDayOfWeek(date, locale, "short") + ", " + date.getDate() + " " + getLocaleMonth(date, locale);
1167
+ const topValue = `${getLocalDayOfWeek(date, locale, "short")}, ${date.getDate()} ${getLocaleMonth(date, locale)}`;
1046
1168
  topValues.push(React__default.createElement(TopPartOfCalendar, {
1047
1169
  key: topValue + date.getFullYear(),
1048
1170
  value: topValue,
@@ -1058,15 +1180,15 @@ var Calendar = function Calendar(_ref) {
1058
1180
  return [topValues, bottomValues];
1059
1181
  };
1060
1182
 
1061
- var getCalendarValuesForHour = function getCalendarValuesForHour() {
1062
- var topValues = [];
1063
- var bottomValues = [];
1064
- var topDefaultHeight = headerHeight * 0.5;
1065
- var dates = dateSetup.dates;
1183
+ const getCalendarValuesForHour = () => {
1184
+ const topValues = [];
1185
+ const bottomValues = [];
1186
+ const topDefaultHeight = headerHeight * 0.5;
1187
+ const dates = dateSetup.dates;
1066
1188
 
1067
- for (var i = 0; i < dates.length; i++) {
1068
- var date = dates[i];
1069
- var bottomValue = getCachedDateTimeFormat(locale, {
1189
+ for (let i = 0; i < dates.length; i++) {
1190
+ const date = dates[i];
1191
+ const bottomValue = getCachedDateTimeFormat(locale, {
1070
1192
  hour: "numeric"
1071
1193
  }).format(date);
1072
1194
  bottomValues.push(React__default.createElement("text", {
@@ -1078,9 +1200,9 @@ var Calendar = function Calendar(_ref) {
1078
1200
  }, bottomValue));
1079
1201
 
1080
1202
  if (i !== 0 && date.getDate() !== dates[i - 1].getDate()) {
1081
- var displayDate = dates[i - 1];
1082
- var topValue = getLocalDayOfWeek(displayDate, locale, "long") + ", " + displayDate.getDate() + " " + getLocaleMonth(displayDate, locale);
1083
- var topPosition = (date.getHours() - 24) / 2;
1203
+ const displayDate = dates[i - 1];
1204
+ const topValue = `${getLocalDayOfWeek(displayDate, locale, "long")}, ${displayDate.getDate()} ${getLocaleMonth(displayDate, locale)}`;
1205
+ const topPosition = (date.getHours() - 24) / 2;
1084
1206
  topValues.push(React__default.createElement(TopPartOfCalendar, {
1085
1207
  key: topValue + displayDate.getFullYear(),
1086
1208
  value: topValue,
@@ -1096,58 +1218,37 @@ var Calendar = function Calendar(_ref) {
1096
1218
  return [topValues, bottomValues];
1097
1219
  };
1098
1220
 
1099
- var topValues = [];
1100
- var bottomValues = [];
1221
+ let topValues = [];
1222
+ let bottomValues = [];
1101
1223
 
1102
1224
  switch (dateSetup.viewMode) {
1103
1225
  case exports.ViewMode.Year:
1104
- var _getCalendarValuesFor = getCalendarValuesForYear();
1105
-
1106
- topValues = _getCalendarValuesFor[0];
1107
- bottomValues = _getCalendarValuesFor[1];
1226
+ [topValues, bottomValues] = getCalendarValuesForYear();
1108
1227
  break;
1109
1228
 
1110
1229
  case exports.ViewMode.Quarter:
1111
- var _getCalendarValuesFor2 = getCalendarValuesForQuarter();
1112
-
1113
- topValues = _getCalendarValuesFor2[0];
1114
- bottomValues = _getCalendarValuesFor2[1];
1230
+ [topValues, bottomValues] = getCalendarValuesForQuarter();
1115
1231
  break;
1116
1232
 
1117
1233
  case exports.ViewMode.Month:
1118
- var _getCalendarValuesFor3 = getCalendarValuesForMonth();
1119
-
1120
- topValues = _getCalendarValuesFor3[0];
1121
- bottomValues = _getCalendarValuesFor3[1];
1234
+ [topValues, bottomValues] = getCalendarValuesForMonth();
1122
1235
  break;
1123
1236
 
1124
1237
  case exports.ViewMode.Week:
1125
- var _getCalendarValuesFor4 = getCalendarValuesForWeek();
1126
-
1127
- topValues = _getCalendarValuesFor4[0];
1128
- bottomValues = _getCalendarValuesFor4[1];
1238
+ [topValues, bottomValues] = getCalendarValuesForWeek();
1129
1239
  break;
1130
1240
 
1131
1241
  case exports.ViewMode.Day:
1132
- var _getCalendarValuesFor5 = getCalendarValuesForDay();
1133
-
1134
- topValues = _getCalendarValuesFor5[0];
1135
- bottomValues = _getCalendarValuesFor5[1];
1242
+ [topValues, bottomValues] = getCalendarValuesForDay();
1136
1243
  break;
1137
1244
 
1138
1245
  case exports.ViewMode.QuarterDay:
1139
1246
  case exports.ViewMode.HalfDay:
1140
- var _getCalendarValuesFor6 = getCalendarValuesForPartOfDay();
1141
-
1142
- topValues = _getCalendarValuesFor6[0];
1143
- bottomValues = _getCalendarValuesFor6[1];
1247
+ [topValues, bottomValues] = getCalendarValuesForPartOfDay();
1144
1248
  break;
1145
1249
 
1146
1250
  case exports.ViewMode.Hour:
1147
- var _getCalendarValuesFor7 = getCalendarValuesForHour();
1148
-
1149
- topValues = _getCalendarValuesFor7[0];
1150
- bottomValues = _getCalendarValuesFor7[1];
1251
+ [topValues, bottomValues] = getCalendarValuesForHour();
1151
1252
  }
1152
1253
 
1153
1254
  return React__default.createElement("g", {
@@ -1183,27 +1284,23 @@ function _catch(body, recover) {
1183
1284
  return result;
1184
1285
  }
1185
1286
 
1186
- var Arrow = function Arrow(_ref) {
1187
- var taskFrom = _ref.taskFrom,
1188
- taskTo = _ref.taskTo,
1189
- rowHeight = _ref.rowHeight,
1190
- taskHeight = _ref.taskHeight,
1191
- arrowIndent = _ref.arrowIndent,
1192
- rtl = _ref.rtl,
1193
- arrowColor = _ref.arrowColor;
1194
- var path;
1195
- var trianglePoints;
1287
+ const Arrow = _ref => {
1288
+ let {
1289
+ taskFrom,
1290
+ taskTo,
1291
+ rowHeight,
1292
+ taskHeight,
1293
+ arrowIndent,
1294
+ rtl,
1295
+ arrowColor
1296
+ } = _ref;
1297
+ let path;
1298
+ let trianglePoints;
1196
1299
 
1197
1300
  if (rtl) {
1198
- var _drownPathAndTriangle = drownPathAndTriangleRTL(taskFrom, taskTo, rowHeight, taskHeight, arrowIndent);
1199
-
1200
- path = _drownPathAndTriangle[0];
1201
- trianglePoints = _drownPathAndTriangle[1];
1301
+ [path, trianglePoints] = drownPathAndTriangleRTL(taskFrom, taskTo, rowHeight, taskHeight, arrowIndent);
1202
1302
  } else {
1203
- var _drownPathAndTriangle2 = drownPathAndTriangle(taskFrom, taskTo, rowHeight, taskHeight, arrowIndent);
1204
-
1205
- path = _drownPathAndTriangle2[0];
1206
- trianglePoints = _drownPathAndTriangle2[1];
1303
+ [path, trianglePoints] = drownPathAndTriangle(taskFrom, taskTo, rowHeight, taskHeight, arrowIndent);
1207
1304
  }
1208
1305
 
1209
1306
  return React__default.createElement("g", {
@@ -1219,8 +1316,8 @@ var Arrow = function Arrow(_ref) {
1219
1316
  }));
1220
1317
  };
1221
1318
 
1222
- var drownPathAndTriangle = function drownPathAndTriangle(taskFrom, taskTo, rowHeight, taskHeight, arrowIndent) {
1223
- var taskToStart, taskFromEnd;
1319
+ const drownPathAndTriangle = (taskFrom, taskTo, rowHeight, taskHeight, arrowIndent) => {
1320
+ let taskToStart, taskFromEnd;
1224
1321
 
1225
1322
  if (taskTo.x1 > 0 && taskTo.actualx1 > 0) {
1226
1323
  taskToStart = Math.min(taskTo.x1, taskTo.actualx1);
@@ -1230,24 +1327,38 @@ var drownPathAndTriangle = function drownPathAndTriangle(taskFrom, taskTo, rowHe
1230
1327
  taskFromEnd = Math.max(taskFrom.x2, taskFrom.actualx2);
1231
1328
  } else if (taskFrom.x2 > 0) taskFromEnd = taskFrom.x2;else if (taskFrom.actualx2 > 0) taskFromEnd = taskFrom.actualx2;else taskFromEnd = 0;
1232
1329
 
1233
- var indexCompare = taskFrom.index > taskTo.index ? -1 : 1;
1234
- var taskToEndPosition = taskTo.y + taskHeight / 2;
1235
- var taskFromEndPosition = taskFromEnd + arrowIndent * 2;
1236
- var taskFromHorizontalOffsetValue = taskFromEndPosition < taskToStart ? "" : "H " + (taskToStart - arrowIndent);
1237
- var taskToHorizontalOffsetValue = taskFromEndPosition > taskToStart ? arrowIndent : taskToStart - taskFromEnd - arrowIndent;
1238
- var path = "M " + taskFromEnd + " " + (taskFrom.y + taskHeight / 2) + " \n h " + arrowIndent + " \n v " + indexCompare * rowHeight / 2 + " \n " + taskFromHorizontalOffsetValue + "\n V " + taskToEndPosition + " \n h " + taskToHorizontalOffsetValue;
1239
- var trianglePoints = taskToStart + "," + taskToEndPosition + " \n " + (taskToStart - 5) + "," + (taskToEndPosition - 5) + " \n " + (taskToStart - 5) + "," + (taskToEndPosition + 5);
1330
+ const indexCompare = taskFrom.index > taskTo.index ? -1 : 1;
1331
+ const taskToEndPosition = taskTo.y + taskHeight / 2;
1332
+ const taskFromEndPosition = taskFromEnd + arrowIndent * 2;
1333
+ const taskFromHorizontalOffsetValue = taskFromEndPosition < taskToStart ? "" : `H ${taskToStart - arrowIndent}`;
1334
+ const taskToHorizontalOffsetValue = taskFromEndPosition > taskToStart ? arrowIndent : taskToStart - taskFromEnd - arrowIndent;
1335
+ const path = `M ${taskFromEnd} ${taskFrom.y + taskHeight / 2}
1336
+ h ${arrowIndent}
1337
+ v ${indexCompare * rowHeight / 2}
1338
+ ${taskFromHorizontalOffsetValue}
1339
+ V ${taskToEndPosition}
1340
+ h ${taskToHorizontalOffsetValue}`;
1341
+ const trianglePoints = `${taskToStart},${taskToEndPosition}
1342
+ ${taskToStart - 5},${taskToEndPosition - 5}
1343
+ ${taskToStart - 5},${taskToEndPosition + 5}`;
1240
1344
  return [path, trianglePoints];
1241
1345
  };
1242
1346
 
1243
- var drownPathAndTriangleRTL = function drownPathAndTriangleRTL(taskFrom, taskTo, rowHeight, taskHeight, arrowIndent) {
1244
- var indexCompare = taskFrom.index > taskTo.index ? -1 : 1;
1245
- var taskToEndPosition = taskTo.y + taskHeight / 2;
1246
- var taskFromEndPosition = taskFrom.x1 - arrowIndent * 2;
1247
- var taskFromHorizontalOffsetValue = taskFromEndPosition > taskTo.x2 ? "" : "H " + (taskTo.x2 + arrowIndent);
1248
- var taskToHorizontalOffsetValue = taskFromEndPosition < taskTo.x2 ? -arrowIndent : taskTo.x2 - taskFrom.x1 + arrowIndent;
1249
- var path = "M " + taskFrom.x1 + " " + (taskFrom.y + taskHeight / 2) + " \n h " + -arrowIndent + " \n v " + indexCompare * rowHeight / 2 + " \n " + taskFromHorizontalOffsetValue + "\n V " + taskToEndPosition + " \n h " + taskToHorizontalOffsetValue;
1250
- var trianglePoints = taskTo.x2 + "," + taskToEndPosition + " \n " + (taskTo.x2 + 5) + "," + (taskToEndPosition + 5) + " \n " + (taskTo.x2 + 5) + "," + (taskToEndPosition - 5);
1347
+ const drownPathAndTriangleRTL = (taskFrom, taskTo, rowHeight, taskHeight, arrowIndent) => {
1348
+ const indexCompare = taskFrom.index > taskTo.index ? -1 : 1;
1349
+ const taskToEndPosition = taskTo.y + taskHeight / 2;
1350
+ const taskFromEndPosition = taskFrom.x1 - arrowIndent * 2;
1351
+ const taskFromHorizontalOffsetValue = taskFromEndPosition > taskTo.x2 ? "" : `H ${taskTo.x2 + arrowIndent}`;
1352
+ const taskToHorizontalOffsetValue = taskFromEndPosition < taskTo.x2 ? -arrowIndent : taskTo.x2 - taskFrom.x1 + arrowIndent;
1353
+ const path = `M ${taskFrom.x1} ${taskFrom.y + taskHeight / 2}
1354
+ h ${-arrowIndent}
1355
+ v ${indexCompare * rowHeight / 2}
1356
+ ${taskFromHorizontalOffsetValue}
1357
+ V ${taskToEndPosition}
1358
+ h ${taskToHorizontalOffsetValue}`;
1359
+ const trianglePoints = `${taskTo.x2},${taskToEndPosition}
1360
+ ${taskTo.x2 + 5},${taskToEndPosition + 5}
1361
+ ${taskTo.x2 + 5},${taskToEndPosition - 5}`;
1251
1362
  return [path, trianglePoints];
1252
1363
  };
1253
1364
 
@@ -1697,24 +1808,26 @@ var sortTasks = function sortTasks(taskA, taskB) {
1697
1808
  }
1698
1809
  };
1699
1810
 
1700
- var BarDisplay = function BarDisplay(_ref) {
1701
- var x = _ref.x,
1702
- y = _ref.y,
1703
- type = _ref.type,
1704
- width = _ref.width,
1705
- height = _ref.height,
1706
- isSelected = _ref.isSelected,
1707
- progressX = _ref.progressX,
1708
- progressWidth = _ref.progressWidth,
1709
- barCornerRadius = _ref.barCornerRadius,
1710
- styles = _ref.styles,
1711
- onMouseDown = _ref.onMouseDown;
1712
-
1713
- var getProcessColor = function getProcessColor() {
1811
+ const BarDisplay = _ref => {
1812
+ let {
1813
+ x,
1814
+ y,
1815
+ type,
1816
+ width,
1817
+ height,
1818
+ isSelected,
1819
+ progressX,
1820
+ progressWidth,
1821
+ barCornerRadius,
1822
+ styles,
1823
+ onMouseDown
1824
+ } = _ref;
1825
+
1826
+ const getProcessColor = () => {
1714
1827
  return isSelected ? styles.progressSelectedColor : styles.progressColor;
1715
1828
  };
1716
1829
 
1717
- var getBarColor = function getBarColor() {
1830
+ const getBarColor = () => {
1718
1831
  return isSelected ? styles.backgroundSelectedColor : styles.backgroundColor;
1719
1832
  };
1720
1833
 
@@ -1761,13 +1874,15 @@ var BarDisplay = function BarDisplay(_ref) {
1761
1874
 
1762
1875
  var styles$6 = {"barWrapper":"_KxSXS","barHandle":"_3w_5u","barBackground":"_31ERP"};
1763
1876
 
1764
- var BarDateHandle = function BarDateHandle(_ref) {
1765
- var x = _ref.x,
1766
- y = _ref.y,
1767
- width = _ref.width,
1768
- height = _ref.height,
1769
- barCornerRadius = _ref.barCornerRadius,
1770
- onMouseDown = _ref.onMouseDown;
1877
+ const BarDateHandle = _ref => {
1878
+ let {
1879
+ x,
1880
+ y,
1881
+ width,
1882
+ height,
1883
+ barCornerRadius,
1884
+ onMouseDown
1885
+ } = _ref;
1771
1886
  return React__default.createElement("rect", {
1772
1887
  x: x,
1773
1888
  y: y,
@@ -1780,25 +1895,25 @@ var BarDateHandle = function BarDateHandle(_ref) {
1780
1895
  });
1781
1896
  };
1782
1897
 
1783
- var BarProgressHandle = function BarProgressHandle(_ref) {
1784
- _objectDestructuringEmpty(_ref);
1785
-
1898
+ const BarProgressHandle = _ref => {
1786
1899
  return React__default.createElement("div", null);
1787
1900
  };
1788
1901
 
1789
- var Bar = function Bar(_ref) {
1790
- var task = _ref.task,
1791
- isProgressChangeable = _ref.isProgressChangeable,
1792
- isDateChangeable = _ref.isDateChangeable,
1793
- rtl = _ref.rtl,
1794
- type = _ref.type,
1795
- onEventStart = _ref.onEventStart,
1796
- isSelected = _ref.isSelected;
1797
- var progressPoint = getProgressPoint(+!rtl * task.progressWidth + task.progressX, task.y, task.height);
1798
- var handleHeight = task.height / 2 - 1;
1902
+ const Bar = _ref => {
1903
+ let {
1904
+ task,
1905
+ isProgressChangeable,
1906
+ isDateChangeable,
1907
+ rtl,
1908
+ type,
1909
+ onEventStart,
1910
+ isSelected
1911
+ } = _ref;
1912
+ const progressPoint = getProgressPoint(+!rtl * task.progressWidth + task.progressX, task.y, task.height);
1913
+ const handleHeight = task.height / 2 - 1;
1799
1914
 
1800
1915
  if (type == "planned") {
1801
- if (task.x1 && task.x2) return React__default.createElement("g", {
1916
+ if ((task === null || task === void 0 ? void 0 : task.x1) >= 0 && (task === null || task === void 0 ? void 0 : task.x2) >= 0) return React__default.createElement("g", {
1802
1917
  className: styles$6.barWrapper,
1803
1918
  tabIndex: 0
1804
1919
  }, React__default.createElement(BarDisplay, {
@@ -1814,7 +1929,7 @@ var Bar = function Bar(_ref) {
1814
1929
  barCornerRadius: task.barCornerRadius,
1815
1930
  styles: task.styles,
1816
1931
  isSelected: isSelected,
1817
- onMouseDown: function onMouseDown(e) {
1932
+ onMouseDown: e => {
1818
1933
  isDateChangeable && onEventStart("move", task, e, "planned");
1819
1934
  }
1820
1935
  }), React__default.createElement("g", {
@@ -1825,7 +1940,7 @@ var Bar = function Bar(_ref) {
1825
1940
  width: task.handleWidth,
1826
1941
  height: handleHeight,
1827
1942
  barCornerRadius: task.barCornerRadius,
1828
- onMouseDown: function onMouseDown(e) {
1943
+ onMouseDown: e => {
1829
1944
  onEventStart("start", task, e, "planned");
1830
1945
  }
1831
1946
  }), React__default.createElement(BarDateHandle, {
@@ -1834,19 +1949,19 @@ var Bar = function Bar(_ref) {
1834
1949
  width: task.handleWidth,
1835
1950
  height: handleHeight,
1836
1951
  barCornerRadius: task.barCornerRadius,
1837
- onMouseDown: function onMouseDown(e) {
1952
+ onMouseDown: e => {
1838
1953
  onEventStart("end", task, e, "planned");
1839
1954
  }
1840
1955
  })), isProgressChangeable && React__default.createElement(BarProgressHandle, {
1841
1956
  progressPoint: progressPoint,
1842
- onMouseDown: function onMouseDown(e) {
1957
+ onMouseDown: e => {
1843
1958
  onEventStart("progress", task, e, "planned");
1844
1959
  }
1845
1960
  })));else return React__default.createElement("g", {
1846
1961
  className: styles$6.barWrapper,
1847
1962
  tabIndex: 0
1848
1963
  });
1849
- } else if (task.actualx1 && task.actualx2) {
1964
+ } else if ((task === null || task === void 0 ? void 0 : task.actualx1) >= 0 && (task === null || task === void 0 ? void 0 : task.actualx2) >= 0) {
1850
1965
  return React__default.createElement("g", {
1851
1966
  className: styles$6.barWrapper,
1852
1967
  tabIndex: 0
@@ -1863,7 +1978,7 @@ var Bar = function Bar(_ref) {
1863
1978
  barCornerRadius: task.barCornerRadius,
1864
1979
  styles: task.styles,
1865
1980
  isSelected: isSelected,
1866
- onMouseDown: function onMouseDown(e) {
1981
+ onMouseDown: e => {
1867
1982
  isDateChangeable && onEventStart("move", task, e, "actual");
1868
1983
  }
1869
1984
  }), React__default.createElement("g", {
@@ -1874,7 +1989,7 @@ var Bar = function Bar(_ref) {
1874
1989
  width: task.handleWidth,
1875
1990
  height: handleHeight,
1876
1991
  barCornerRadius: task.barCornerRadius,
1877
- onMouseDown: function onMouseDown(e) {
1992
+ onMouseDown: e => {
1878
1993
  onEventStart("start", task, e, "actual");
1879
1994
  }
1880
1995
  }), React__default.createElement(BarDateHandle, {
@@ -1883,12 +1998,12 @@ var Bar = function Bar(_ref) {
1883
1998
  width: task.handleWidth,
1884
1999
  height: handleHeight,
1885
2000
  barCornerRadius: task.barCornerRadius,
1886
- onMouseDown: function onMouseDown(e) {
2001
+ onMouseDown: e => {
1887
2002
  onEventStart("end", task, e, "actual");
1888
2003
  }
1889
2004
  })), isProgressChangeable && React__default.createElement(BarProgressHandle, {
1890
2005
  progressPoint: progressPoint,
1891
- onMouseDown: function onMouseDown(e) {
2006
+ onMouseDown: e => {
1892
2007
  onEventStart("progress", task, e, "actual");
1893
2008
  }
1894
2009
  })));
@@ -1900,14 +2015,16 @@ var Bar = function Bar(_ref) {
1900
2015
  }
1901
2016
  };
1902
2017
 
1903
- var BarSmall = function BarSmall(_ref) {
1904
- var task = _ref.task,
1905
- type = _ref.type,
1906
- isProgressChangeable = _ref.isProgressChangeable,
1907
- isDateChangeable = _ref.isDateChangeable,
1908
- onEventStart = _ref.onEventStart,
1909
- isSelected = _ref.isSelected;
1910
- var progressPoint = getProgressPoint(task.progressWidth + task.x1, task.y, task.height);
2018
+ const BarSmall = _ref => {
2019
+ let {
2020
+ task,
2021
+ type,
2022
+ isProgressChangeable,
2023
+ isDateChangeable,
2024
+ onEventStart,
2025
+ isSelected
2026
+ } = _ref;
2027
+ const progressPoint = getProgressPoint(task.progressWidth + task.x1, task.y, task.height);
1911
2028
  return React__default.createElement("g", {
1912
2029
  className: styles$6.barWrapper,
1913
2030
  tabIndex: 0
@@ -1924,14 +2041,14 @@ var BarSmall = function BarSmall(_ref) {
1924
2041
  barCornerRadius: task.barCornerRadius,
1925
2042
  styles: task.styles,
1926
2043
  isSelected: isSelected,
1927
- onMouseDown: function onMouseDown(e) {
2044
+ onMouseDown: e => {
1928
2045
  isDateChangeable && onEventStart("move", task, e);
1929
2046
  }
1930
2047
  }), React__default.createElement("g", {
1931
2048
  className: "handleGroup"
1932
2049
  }, isProgressChangeable && React__default.createElement(BarProgressHandle, {
1933
2050
  progressPoint: progressPoint,
1934
- onMouseDown: function onMouseDown(e) {
2051
+ onMouseDown: e => {
1935
2052
  onEventStart("progress", task, e);
1936
2053
  }
1937
2054
  })));
@@ -1939,14 +2056,17 @@ var BarSmall = function BarSmall(_ref) {
1939
2056
 
1940
2057
  var styles$7 = {"milestoneWrapper":"_RRr13","milestoneBackground":"_2P2B1"};
1941
2058
 
1942
- var Milestone = function Milestone(_ref) {
1943
- var task = _ref.task,
1944
- isDateChangeable = _ref.isDateChangeable,
1945
- onEventStart = _ref.onEventStart,
1946
- isSelected = _ref.isSelected;
1947
- var transform = "rotate(45 " + (task.x1 + task.height * 0.356) + " \n " + (task.y + task.height * 0.85) + ")";
1948
-
1949
- var getBarColor = function getBarColor() {
2059
+ const Milestone = _ref => {
2060
+ let {
2061
+ task,
2062
+ isDateChangeable,
2063
+ onEventStart,
2064
+ isSelected
2065
+ } = _ref;
2066
+ const transform = `rotate(45 ${task.x1 + task.height * 0.356}
2067
+ ${task.y + task.height * 0.85})`;
2068
+
2069
+ const getBarColor = () => {
1950
2070
  return isSelected ? task.styles.backgroundSelectedColor : task.styles.backgroundColor;
1951
2071
  };
1952
2072
 
@@ -1963,7 +2083,7 @@ var Milestone = function Milestone(_ref) {
1963
2083
  ry: task.barCornerRadius,
1964
2084
  transform: transform,
1965
2085
  className: styles$7.milestoneBackground,
1966
- onMouseDown: function onMouseDown(e) {
2086
+ onMouseDown: e => {
1967
2087
  isDateChangeable && onEventStart("move", task, e);
1968
2088
  }
1969
2089
  }));
@@ -1971,14 +2091,16 @@ var Milestone = function Milestone(_ref) {
1971
2091
 
1972
2092
  var styles$8 = {"projectWrapper":"_1KJ6x","projectBackground":"_2RbVy","projectTop":"_2pZMF"};
1973
2093
 
1974
- var Project = function Project(_ref) {
1975
- var task = _ref.task,
1976
- isSelected = _ref.isSelected;
1977
- var barColor = isSelected ? task.styles.backgroundSelectedColor : task.styles.backgroundColor;
1978
- var processColor = isSelected ? task.styles.progressSelectedColor : task.styles.progressColor;
1979
- var projectWith = task.x2 - task.x1;
1980
- var projectLeftTriangle = [task.x1, task.y + task.height / 2 - 1, task.x1, task.y + task.height, task.x1 + 15, task.y + task.height / 2 - 1].join(",");
1981
- var projectRightTriangle = [task.x2, task.y + task.height / 2 - 1, task.x2, task.y + task.height, task.x2 - 15, task.y + task.height / 2 - 1].join(",");
2094
+ const Project = _ref => {
2095
+ let {
2096
+ task,
2097
+ isSelected
2098
+ } = _ref;
2099
+ const barColor = isSelected ? task.styles.backgroundSelectedColor : task.styles.backgroundColor;
2100
+ const processColor = isSelected ? task.styles.progressSelectedColor : task.styles.progressColor;
2101
+ const projectWith = task.x2 - task.x1;
2102
+ const projectLeftTriangle = [task.x1, task.y + task.height / 2 - 1, task.x1, task.y + task.height, task.x1 + 15, task.y + task.height / 2 - 1].join(",");
2103
+ const projectRightTriangle = [task.x2, task.y + task.height / 2 - 1, task.x2, task.y + task.height, task.x2 - 15, task.y + task.height / 2 - 1].join(",");
1982
2104
  return React__default.createElement("g", {
1983
2105
  tabIndex: 0,
1984
2106
  className: styles$8.projectWrapper
@@ -2019,25 +2141,23 @@ var Project = function Project(_ref) {
2019
2141
  }));
2020
2142
  };
2021
2143
 
2022
- var TaskItem = function TaskItem(props) {
2023
- var _props = _extends({}, props),
2024
- task = _props.task,
2025
- isDelete = _props.isDelete,
2026
- isSelected = _props.isSelected,
2027
- onEventStart = _props.onEventStart;
2028
-
2029
- var _useState = React.useState([React__default.createElement("div", null)]),
2030
- taskItem = _useState[0],
2031
- setTaskItem = _useState[1];
2032
-
2033
- React.useEffect(function () {
2144
+ const TaskItem = props => {
2145
+ const {
2146
+ task,
2147
+ isDelete,
2148
+ isSelected,
2149
+ onEventStart
2150
+ } = { ...props
2151
+ };
2152
+ const [taskItem, setTaskItem] = React.useState([React__default.createElement("div", null)]);
2153
+ React.useEffect(() => {
2034
2154
  switch (task.typeInternal) {
2035
2155
  case "milestone":
2036
- setTaskItem([React__default.createElement(Milestone, Object.assign({}, props))]);
2156
+ if (task.x1 >= 0 && task.actualx1 >= 0) setTaskItem([React__default.createElement(Milestone, Object.assign({}, props))]);else setTaskItem([]);
2037
2157
  break;
2038
2158
 
2039
2159
  case "project":
2040
- setTaskItem([React__default.createElement(Project, Object.assign({}, props))]);
2160
+ if ((task === null || task === void 0 ? void 0 : task.x1) >= 0 && (task === null || task === void 0 ? void 0 : task.x2) >= 0 && task.x2 > task.x1 && (task === null || task === void 0 ? void 0 : task.actualx1) >= 0 && (task === null || task === void 0 ? void 0 : task.actualx2) >= 0 && task.actualx2 > task.actualx1) setTaskItem([React__default.createElement(Project, Object.assign({}, props))]);else setTaskItem([]);
2041
2161
  break;
2042
2162
 
2043
2163
  case "smalltask":
@@ -2046,27 +2166,27 @@ var TaskItem = function TaskItem(props) {
2046
2166
 
2047
2167
  default:
2048
2168
  {
2049
- var _taskItem = [];
2169
+ let taskItem = [];
2050
2170
 
2051
- if (task.x1 && task.x2) {
2052
- _taskItem.push(React__default.createElement(Bar, Object.assign({}, props, {
2171
+ if ((task === null || task === void 0 ? void 0 : task.x1) >= 0 && (task === null || task === void 0 ? void 0 : task.x2) >= 0) {
2172
+ taskItem.push(React__default.createElement(Bar, Object.assign({}, props, {
2053
2173
  type: "planned"
2054
2174
  })));
2055
2175
  }
2056
2176
 
2057
- if (task.actualx1 && task.actualx2) {
2058
- _taskItem.push(React__default.createElement(Bar, Object.assign({}, props, {
2177
+ if ((task === null || task === void 0 ? void 0 : task.actualx1) >= 0 && (task === null || task === void 0 ? void 0 : task.actualx2) >= 0) {
2178
+ taskItem.push(React__default.createElement(Bar, Object.assign({}, props, {
2059
2179
  type: "actual"
2060
2180
  })));
2061
2181
  }
2062
2182
 
2063
- setTaskItem(_taskItem);
2183
+ setTaskItem(taskItem);
2064
2184
  }
2065
2185
  break;
2066
2186
  }
2067
2187
  }, [task, isSelected]);
2068
2188
  return React__default.createElement("g", null, React__default.createElement("g", {
2069
- onKeyDown: function onKeyDown(e) {
2189
+ onKeyDown: e => {
2070
2190
  switch (e.key) {
2071
2191
  case "Delete":
2072
2192
  {
@@ -2077,20 +2197,20 @@ var TaskItem = function TaskItem(props) {
2077
2197
 
2078
2198
  e.stopPropagation();
2079
2199
  },
2080
- onMouseEnter: function onMouseEnter(e) {
2200
+ onMouseEnter: e => {
2081
2201
  onEventStart("mouseenter", task, e, "planned");
2082
2202
  },
2083
- onMouseLeave: function onMouseLeave(e) {
2203
+ onMouseLeave: e => {
2084
2204
  onEventStart("mouseleave", task, e, "planned");
2085
2205
  },
2086
- onDoubleClick: function onDoubleClick(e) {
2206
+ onDoubleClick: e => {
2087
2207
  onEventStart("dblclick", task, e, "planned");
2088
2208
  },
2089
- onClick: function onClick(e) {
2209
+ onClick: e => {
2090
2210
  onEventStart("click", task, e, "planned");
2091
2211
  }
2092
2212
  }, taskItem[0]), React__default.createElement("g", {
2093
- onKeyDown: function onKeyDown(e) {
2213
+ onKeyDown: e => {
2094
2214
  switch (e.key) {
2095
2215
  case "Delete":
2096
2216
  {
@@ -2101,82 +2221,74 @@ var TaskItem = function TaskItem(props) {
2101
2221
 
2102
2222
  e.stopPropagation();
2103
2223
  },
2104
- onMouseEnter: function onMouseEnter(e) {
2224
+ onMouseEnter: e => {
2105
2225
  onEventStart("mouseenter", task, e, "actual");
2106
2226
  },
2107
- onMouseLeave: function onMouseLeave(e) {
2227
+ onMouseLeave: e => {
2108
2228
  onEventStart("mouseleave", task, e, "actual");
2109
2229
  },
2110
- onDoubleClick: function onDoubleClick(e) {
2230
+ onDoubleClick: e => {
2111
2231
  onEventStart("dblclick", task, e, "actual");
2112
2232
  },
2113
- onClick: function onClick(e) {
2233
+ onClick: e => {
2114
2234
  onEventStart("click", task, e, "actual");
2115
2235
  }
2116
2236
  }, taskItem[1]));
2117
2237
  };
2118
2238
 
2119
- var TaskGanttContent = function TaskGanttContent(_ref) {
2239
+ const TaskGanttContent = _ref => {
2120
2240
  var _svg$current;
2121
2241
 
2122
- var tasks = _ref.tasks,
2123
- dates = _ref.dates,
2124
- ganttEvent = _ref.ganttEvent,
2125
- selectedTask = _ref.selectedTask,
2126
- rowHeight = _ref.rowHeight,
2127
- columnWidth = _ref.columnWidth,
2128
- timeStep = _ref.timeStep,
2129
- svg = _ref.svg,
2130
- taskHeight = _ref.taskHeight,
2131
- arrowIndent = _ref.arrowIndent,
2132
- fontFamily = _ref.fontFamily,
2133
- fontSize = _ref.fontSize,
2134
- rtl = _ref.rtl,
2135
- setGanttEvent = _ref.setGanttEvent,
2136
- setFailedTask = _ref.setFailedTask,
2137
- setSelectedTask = _ref.setSelectedTask,
2138
- onDateChange = _ref.onDateChange,
2139
- onProgressChange = _ref.onProgressChange,
2140
- onDoubleClick = _ref.onDoubleClick,
2141
- onClick = _ref.onClick,
2142
- onDelete = _ref.onDelete;
2143
- var point = svg === null || svg === void 0 ? void 0 : (_svg$current = svg.current) === null || _svg$current === void 0 ? void 0 : _svg$current.createSVGPoint();
2144
-
2145
- var _useState = React.useState(0),
2146
- xStep = _useState[0],
2147
- setXStep = _useState[1];
2148
-
2149
- var _useState2 = React.useState(0),
2150
- initEventX1Delta = _useState2[0],
2151
- setInitEventX1Delta = _useState2[1];
2152
-
2153
- var _useState3 = React.useState(false),
2154
- isMoving = _useState3[0],
2155
- setIsMoving = _useState3[1];
2156
-
2157
- React.useEffect(function () {
2158
- var dateDelta = dates[1].getTime() - dates[0].getTime() - dates[1].getTimezoneOffset() * 60 * 1000 + dates[0].getTimezoneOffset() * 60 * 1000;
2159
- var newXStep = timeStep * columnWidth / dateDelta;
2242
+ let {
2243
+ tasks,
2244
+ dates,
2245
+ ganttEvent,
2246
+ selectedTask,
2247
+ rowHeight,
2248
+ columnWidth,
2249
+ timeStep,
2250
+ svg,
2251
+ taskHeight,
2252
+ arrowIndent,
2253
+ fontFamily,
2254
+ fontSize,
2255
+ rtl,
2256
+ setGanttEvent,
2257
+ setFailedTask,
2258
+ setSelectedTask,
2259
+ onDateChange,
2260
+ onProgressChange,
2261
+ onDoubleClick,
2262
+ onClick,
2263
+ onDelete
2264
+ } = _ref;
2265
+ const point = svg === null || svg === void 0 ? void 0 : (_svg$current = svg.current) === null || _svg$current === void 0 ? void 0 : _svg$current.createSVGPoint();
2266
+ const [xStep, setXStep] = React.useState(0);
2267
+ const [initEventX1Delta, setInitEventX1Delta] = React.useState(0);
2268
+ const [isMoving, setIsMoving] = React.useState(false);
2269
+ React.useEffect(() => {
2270
+ const dateDelta = dates[1].getTime() - dates[0].getTime() - dates[1].getTimezoneOffset() * 60 * 1000 + dates[0].getTimezoneOffset() * 60 * 1000;
2271
+ const newXStep = timeStep * columnWidth / dateDelta;
2160
2272
  setXStep(newXStep);
2161
2273
  }, [columnWidth, dates, timeStep]);
2162
- React.useEffect(function () {
2163
- var handleMouseMove = function handleMouseMove(event) {
2274
+ React.useEffect(() => {
2275
+ const handleMouseMove = function (event) {
2164
2276
  try {
2165
2277
  var _svg$current$getScree;
2166
2278
 
2167
2279
  if (!ganttEvent.changedTask || !point || !(svg !== null && svg !== void 0 && svg.current)) return Promise.resolve();
2168
2280
  event.preventDefault();
2169
2281
  point.x = event.clientX;
2170
- var cursor = point.matrixTransform(svg === null || svg === void 0 ? void 0 : (_svg$current$getScree = svg.current.getScreenCTM()) === null || _svg$current$getScree === void 0 ? void 0 : _svg$current$getScree.inverse());
2171
-
2172
- var _handleTaskBySVGMouse = handleTaskBySVGMouseEvent(cursor.x, ganttEvent.action, ganttEvent.changedTask, ganttEvent.type, xStep, timeStep, initEventX1Delta, rtl),
2173
- isChanged = _handleTaskBySVGMouse.isChanged,
2174
- changedTask = _handleTaskBySVGMouse.changedTask;
2282
+ const cursor = point.matrixTransform(svg === null || svg === void 0 ? void 0 : (_svg$current$getScree = svg.current.getScreenCTM()) === null || _svg$current$getScree === void 0 ? void 0 : _svg$current$getScree.inverse());
2283
+ const {
2284
+ isChanged,
2285
+ changedTask
2286
+ } = handleTaskBySVGMouseEvent(cursor.x, ganttEvent.action, ganttEvent.changedTask, ganttEvent.type, xStep, timeStep, initEventX1Delta, rtl);
2175
2287
 
2176
2288
  if (isChanged) {
2177
2289
  setGanttEvent({
2178
2290
  action: ganttEvent.action,
2179
- changedTask: changedTask
2291
+ changedTask
2180
2292
  });
2181
2293
  }
2182
2294
 
@@ -2186,40 +2298,41 @@ var TaskGanttContent = function TaskGanttContent(_ref) {
2186
2298
  }
2187
2299
  };
2188
2300
 
2189
- var handleMouseUp = function handleMouseUp(event) {
2301
+ const handleMouseUp = function (event) {
2190
2302
  try {
2191
2303
  var _svg$current$getScree2;
2192
2304
 
2193
- var _temp6 = function _temp6() {
2305
+ function _temp5() {
2194
2306
  if (!operationSuccess) {
2195
2307
  setFailedTask(originalSelectedTask);
2196
2308
  }
2197
- };
2309
+ }
2198
2310
 
2199
- var action = ganttEvent.action,
2200
- originalSelectedTask = ganttEvent.originalSelectedTask,
2201
- changedTask = ganttEvent.changedTask,
2202
- type = ganttEvent.type;
2311
+ const {
2312
+ action,
2313
+ originalSelectedTask,
2314
+ changedTask,
2315
+ type
2316
+ } = ganttEvent;
2203
2317
  if (!changedTask || !point || !(svg !== null && svg !== void 0 && svg.current) || !originalSelectedTask) return Promise.resolve();
2204
2318
  event.preventDefault();
2205
2319
  point.x = event.clientX;
2206
- var cursor = point.matrixTransform(svg === null || svg === void 0 ? void 0 : (_svg$current$getScree2 = svg.current.getScreenCTM()) === null || _svg$current$getScree2 === void 0 ? void 0 : _svg$current$getScree2.inverse());
2207
-
2208
- var _handleTaskBySVGMouse2 = handleTaskBySVGMouseEvent(cursor.x, action, changedTask, type, xStep, timeStep, initEventX1Delta, rtl),
2209
- newChangedTask = _handleTaskBySVGMouse2.changedTask;
2210
-
2211
- var isNotLikeOriginal = originalSelectedTask.start !== newChangedTask.start || originalSelectedTask.end !== newChangedTask.end || originalSelectedTask.actualStart !== newChangedTask.actualStart || originalSelectedTask.actualEnd !== newChangedTask.actualEnd || originalSelectedTask.progress !== newChangedTask.progress;
2320
+ const cursor = point.matrixTransform(svg === null || svg === void 0 ? void 0 : (_svg$current$getScree2 = svg.current.getScreenCTM()) === null || _svg$current$getScree2 === void 0 ? void 0 : _svg$current$getScree2.inverse());
2321
+ const {
2322
+ changedTask: newChangedTask
2323
+ } = handleTaskBySVGMouseEvent(cursor.x, action, changedTask, type, xStep, timeStep, initEventX1Delta, rtl);
2324
+ const isNotLikeOriginal = originalSelectedTask.start !== newChangedTask.start || originalSelectedTask.end !== newChangedTask.end || originalSelectedTask.actualStart !== newChangedTask.actualStart || originalSelectedTask.actualEnd !== newChangedTask.actualEnd || originalSelectedTask.progress !== newChangedTask.progress;
2212
2325
  svg.current.removeEventListener("mousemove", handleMouseMove);
2213
2326
  svg.current.removeEventListener("mouseup", handleMouseUp);
2214
2327
  setGanttEvent({
2215
2328
  action: ""
2216
2329
  });
2217
2330
  setIsMoving(false);
2218
- var operationSuccess = true;
2331
+ let operationSuccess = true;
2219
2332
 
2220
- var _temp7 = function () {
2333
+ const _temp4 = function () {
2221
2334
  if ((action === "move" || action === "end" || action === "start") && onDateChange && isNotLikeOriginal) {
2222
- var _temp8 = _catch(function () {
2335
+ const _temp = _catch(function () {
2223
2336
  return Promise.resolve(onDateChange(newChangedTask, newChangedTask.barChildren)).then(function (result) {
2224
2337
  if (result !== undefined) {
2225
2338
  operationSuccess = result;
@@ -2229,11 +2342,11 @@ var TaskGanttContent = function TaskGanttContent(_ref) {
2229
2342
  operationSuccess = false;
2230
2343
  });
2231
2344
 
2232
- if (_temp8 && _temp8.then) return _temp8.then(function () {});
2345
+ if (_temp && _temp.then) return _temp.then(function () {});
2233
2346
  } else {
2234
- var _temp9 = function () {
2347
+ const _temp3 = function () {
2235
2348
  if (onProgressChange && isNotLikeOriginal) {
2236
- var _temp10 = _catch(function () {
2349
+ const _temp2 = _catch(function () {
2237
2350
  return Promise.resolve(onProgressChange(newChangedTask, newChangedTask.barChildren)).then(function (result) {
2238
2351
  if (result !== undefined) {
2239
2352
  operationSuccess = result;
@@ -2243,15 +2356,15 @@ var TaskGanttContent = function TaskGanttContent(_ref) {
2243
2356
  operationSuccess = false;
2244
2357
  });
2245
2358
 
2246
- if (_temp10 && _temp10.then) return _temp10.then(function () {});
2359
+ if (_temp2 && _temp2.then) return _temp2.then(function () {});
2247
2360
  }
2248
2361
  }();
2249
2362
 
2250
- if (_temp9 && _temp9.then) return _temp9.then(function () {});
2363
+ if (_temp3 && _temp3.then) return _temp3.then(function () {});
2251
2364
  }
2252
2365
  }();
2253
2366
 
2254
- return Promise.resolve(_temp7 && _temp7.then ? _temp7.then(_temp6) : _temp6(_temp7));
2367
+ return Promise.resolve(_temp4 && _temp4.then ? _temp4.then(_temp5) : _temp5(_temp4));
2255
2368
  } catch (e) {
2256
2369
  return Promise.reject(e);
2257
2370
  }
@@ -2264,7 +2377,7 @@ var TaskGanttContent = function TaskGanttContent(_ref) {
2264
2377
  }
2265
2378
  }, [ganttEvent, xStep, initEventX1Delta, onProgressChange, timeStep, onDateChange, svg, isMoving, point, rtl, setFailedTask, setGanttEvent]);
2266
2379
 
2267
- var handleBarEventStart = function handleBarEventStart(action, task, event, type) {
2380
+ const handleBarEventStart = function (action, task, event, type) {
2268
2381
  try {
2269
2382
  return Promise.resolve(function () {
2270
2383
  if (!event) {
@@ -2273,15 +2386,15 @@ var TaskGanttContent = function TaskGanttContent(_ref) {
2273
2386
  }
2274
2387
  } else return function () {
2275
2388
  if (isKeyboardEvent(event)) {
2276
- var _temp14 = function () {
2389
+ const _temp8 = function () {
2277
2390
  if (action === "delete") {
2278
- var _temp15 = function () {
2391
+ const _temp7 = function () {
2279
2392
  if (onDelete) {
2280
- var _temp16 = _catch(function () {
2393
+ const _temp6 = _catch(function () {
2281
2394
  return Promise.resolve(onDelete(task)).then(function (result) {
2282
2395
  if (result !== undefined && result) {
2283
2396
  setGanttEvent({
2284
- action: action,
2397
+ action,
2285
2398
  changedTask: task
2286
2399
  });
2287
2400
  }
@@ -2290,19 +2403,19 @@ var TaskGanttContent = function TaskGanttContent(_ref) {
2290
2403
  console.error("Error on Delete. " + error);
2291
2404
  });
2292
2405
 
2293
- if (_temp16 && _temp16.then) return _temp16.then(function () {});
2406
+ if (_temp6 && _temp6.then) return _temp6.then(function () {});
2294
2407
  }
2295
2408
  }();
2296
2409
 
2297
- if (_temp15 && _temp15.then) return _temp15.then(function () {});
2410
+ if (_temp7 && _temp7.then) return _temp7.then(function () {});
2298
2411
  }
2299
2412
  }();
2300
2413
 
2301
- if (_temp14 && _temp14.then) return _temp14.then(function () {});
2414
+ if (_temp8 && _temp8.then) return _temp8.then(function () {});
2302
2415
  } else if (action === "mouseenter") {
2303
2416
  if (!ganttEvent.action) {
2304
2417
  setGanttEvent({
2305
- action: action,
2418
+ action,
2306
2419
  changedTask: task,
2307
2420
  originalSelectedTask: task,
2308
2421
  type: type
@@ -2323,17 +2436,17 @@ var TaskGanttContent = function TaskGanttContent(_ref) {
2323
2436
 
2324
2437
  if (!(svg !== null && svg !== void 0 && svg.current) || !point) return;
2325
2438
  point.x = event.clientX;
2326
- var cursor = point.matrixTransform((_svg$current$getScree3 = svg.current.getScreenCTM()) === null || _svg$current$getScree3 === void 0 ? void 0 : _svg$current$getScree3.inverse());
2439
+ const cursor = point.matrixTransform((_svg$current$getScree3 = svg.current.getScreenCTM()) === null || _svg$current$getScree3 === void 0 ? void 0 : _svg$current$getScree3.inverse());
2327
2440
  if (type == "planned") setInitEventX1Delta(cursor.x - task.x1);else if (type == "actual") setInitEventX1Delta(cursor.x - task.actualx1);
2328
2441
  setGanttEvent({
2329
- action: action,
2442
+ action,
2330
2443
  changedTask: task,
2331
2444
  originalSelectedTask: task,
2332
2445
  type: type
2333
2446
  });
2334
2447
  } else {
2335
2448
  setGanttEvent({
2336
- action: action,
2449
+ action,
2337
2450
  changedTask: task,
2338
2451
  originalSelectedTask: task,
2339
2452
  type: type
@@ -2350,8 +2463,8 @@ var TaskGanttContent = function TaskGanttContent(_ref) {
2350
2463
  className: "content"
2351
2464
  }, React__default.createElement("g", {
2352
2465
  className: "arrows"
2353
- }, tasks.map(function (_task) {
2354
- var task = _task.start.getTime() > 0 && _task.end.getTime() > 0 ? _task : undefined;
2466
+ }, tasks.map(_task => {
2467
+ const task = _task.start.getTime() > 0 && _task.end.getTime() > 0 ? _task : undefined;
2355
2468
 
2356
2469
  if (!task) {
2357
2470
  return React__default.createElement("g", {
@@ -2362,28 +2475,31 @@ var TaskGanttContent = function TaskGanttContent(_ref) {
2362
2475
  });
2363
2476
  }
2364
2477
 
2365
- return task.barChildren.map(function (child) {
2478
+ return task.barChildren.map(child => {
2366
2479
  var _task$criticalPathArr, _task$criticalPathArr2;
2367
2480
 
2368
- return React__default.createElement(Arrow, {
2369
- key: "Arrow from " + task.id + " to " + tasks[child.index].id,
2481
+ if (task.x2 > task.x1 || task.actualx2 > task.actualx1) return React__default.createElement(Arrow, {
2482
+ key: `Arrow from ${task.id} to ${tasks[child.index].id}`,
2370
2483
  taskFrom: task,
2371
2484
  taskTo: tasks[child.index],
2372
2485
  rowHeight: rowHeight,
2373
2486
  taskHeight: taskHeight,
2374
2487
  arrowIndent: arrowIndent,
2375
2488
  rtl: rtl,
2376
- arrowColor: ((_task$criticalPathArr = task.criticalPathArrows) === null || _task$criticalPathArr === void 0 ? void 0 : (_task$criticalPathArr2 = _task$criticalPathArr.find(function (arrow) {
2377
- return arrow.taskId == tasks[child.index].id;
2378
- })) === null || _task$criticalPathArr2 === void 0 ? void 0 : _task$criticalPathArr2.arrowColor) || "#808080"
2489
+ arrowColor: ((_task$criticalPathArr = task.criticalPathArrows) === null || _task$criticalPathArr === void 0 ? void 0 : (_task$criticalPathArr2 = _task$criticalPathArr.find(arrow => arrow.taskId == tasks[child.index].id)) === null || _task$criticalPathArr2 === void 0 ? void 0 : _task$criticalPathArr2.arrowColor) || "#808080"
2490
+ });else return React__default.createElement("g", {
2491
+ key: _task.id,
2492
+ style: {
2493
+ height: taskHeight
2494
+ }
2379
2495
  });
2380
2496
  });
2381
2497
  })), React__default.createElement("g", {
2382
2498
  className: "bar",
2383
2499
  fontFamily: fontFamily,
2384
2500
  fontSize: fontSize
2385
- }, tasks.map(function (_task) {
2386
- var task = _task.start.getTime() > 0 && _task.end.getTime() > 0 ? _task : undefined;
2501
+ }, tasks.map(_task => {
2502
+ const task = _task.start.getTime() > 0 && _task.end.getTime() > 0 ? _task : undefined;
2387
2503
 
2388
2504
  if (!task) {
2389
2505
  return React__default.createElement("g", {
@@ -2497,6 +2613,12 @@ var Gantt = function Gantt(_ref) {
2497
2613
  var tasks = _ref.tasks,
2498
2614
  _ref$leafTasks = _ref.leafTasks,
2499
2615
  leafTasks = _ref$leafTasks === void 0 ? [] : _ref$leafTasks,
2616
+ _ref$scheduleType = _ref.scheduleType,
2617
+ scheduleType = _ref$scheduleType === void 0 ? "main" : _ref$scheduleType,
2618
+ _ref$startDate = _ref.startDate,
2619
+ startDate = _ref$startDate === void 0 ? new Date() : _ref$startDate,
2620
+ _ref$endDate = _ref.endDate,
2621
+ endDate = _ref$endDate === void 0 ? new Date() : _ref$endDate,
2500
2622
  _ref$headerHeight = _ref.headerHeight,
2501
2623
  headerHeight = _ref$headerHeight === void 0 ? 50 : _ref$headerHeight,
2502
2624
  _ref$columnWidth = _ref.columnWidth,
@@ -2553,6 +2675,8 @@ var Gantt = function Gantt(_ref) {
2553
2675
  arrowIndent = _ref$arrowIndent === void 0 ? 20 : _ref$arrowIndent,
2554
2676
  _ref$todayColor = _ref.todayColor,
2555
2677
  todayColor = _ref$todayColor === void 0 ? "rgba(252, 248, 227, 0.5)" : _ref$todayColor,
2678
+ _ref$weekendColor = _ref.weekendColor,
2679
+ weekendColor = _ref$weekendColor === void 0 ? "#f5f5f5" : _ref$weekendColor,
2556
2680
  viewDate = _ref.viewDate,
2557
2681
  _ref$TooltipContent = _ref.TooltipContent,
2558
2682
  TooltipContent = _ref$TooltipContent === void 0 ? StandardTooltipContent : _ref$TooltipContent,
@@ -2567,18 +2691,26 @@ var Gantt = function Gantt(_ref) {
2567
2691
  onDelete = _ref.onDelete,
2568
2692
  onSelect = _ref.onSelect,
2569
2693
  onExpanderClick = _ref.onExpanderClick,
2694
+ onMultiSelect = _ref.onMultiSelect,
2570
2695
  taskLabelRenderer = _ref.taskLabelRenderer;
2571
2696
  var wrapperRef = React.useRef(null);
2572
2697
  var taskListRef = React.useRef(null);
2573
2698
 
2574
2699
  var _useState = React.useState(function () {
2575
2700
  var _ganttDateRange = ganttDateRange(tasks, viewMode, preStepsCount),
2576
- startDate = _ganttDateRange[0],
2577
- endDate = _ganttDateRange[1];
2701
+ startDateRange = _ganttDateRange[0],
2702
+ endDateRange = _ganttDateRange[1];
2703
+
2704
+ if (scheduleType === "lookAhead") {
2705
+ return {
2706
+ viewMode: viewMode,
2707
+ dates: seedDates(startDate, endDate, viewMode)
2708
+ };
2709
+ }
2578
2710
 
2579
2711
  return {
2580
2712
  viewMode: viewMode,
2581
- dates: seedDates(startDate, endDate, viewMode)
2713
+ dates: seedDates(startDateRange, endDateRange, viewMode)
2582
2714
  };
2583
2715
  }),
2584
2716
  dateSetup = _useState[0],
@@ -2637,6 +2769,14 @@ var Gantt = function Gantt(_ref) {
2637
2769
  ignoreScrollEvent = _useState12[0],
2638
2770
  setIgnoreScrollEvent = _useState12[1];
2639
2771
 
2772
+ React.useEffect(function () {
2773
+ if (scheduleType === "lookAhead" && startDate && endDate) {
2774
+ setDateSetup({
2775
+ viewMode: viewMode,
2776
+ dates: seedDates(startDate, endDate, viewMode)
2777
+ });
2778
+ }
2779
+ }, [startDate, endDate]);
2640
2780
  React.useEffect(function () {
2641
2781
  var filteredTasks;
2642
2782
 
@@ -2649,10 +2789,14 @@ var Gantt = function Gantt(_ref) {
2649
2789
  filteredTasks = filteredTasks.sort(sortTasks);
2650
2790
 
2651
2791
  var _ganttDateRange2 = ganttDateRange(filteredTasks, viewMode, preStepsCount),
2652
- startDate = _ganttDateRange2[0],
2653
- endDate = _ganttDateRange2[1];
2792
+ startDateRange = _ganttDateRange2[0],
2793
+ endDateRange = _ganttDateRange2[1];
2654
2794
 
2655
- var newDates = seedDates(startDate, endDate, viewMode);
2795
+ var newDates = seedDates(startDateRange, endDateRange, viewMode);
2796
+
2797
+ if (scheduleType === "lookAhead") {
2798
+ newDates = seedDates(startDate, endDate, viewMode);
2799
+ }
2656
2800
 
2657
2801
  if (rtl) {
2658
2802
  newDates = newDates.reverse();
@@ -2662,10 +2806,12 @@ var Gantt = function Gantt(_ref) {
2662
2806
  }
2663
2807
  }
2664
2808
 
2665
- setDateSetup({
2666
- dates: newDates,
2667
- viewMode: viewMode
2668
- });
2809
+ if (scheduleType !== "lookAhead") {
2810
+ setDateSetup({
2811
+ dates: seedDates(startDateRange, endDateRange, viewMode),
2812
+ viewMode: viewMode
2813
+ });
2814
+ }
2669
2815
 
2670
2816
  var _getCriticalPaths = getCriticalPaths(leafTasks),
2671
2817
  primaryPath = _getCriticalPaths[0],
@@ -2892,9 +3038,11 @@ var Gantt = function Gantt(_ref) {
2892
3038
  columnWidth: columnWidth,
2893
3039
  svgWidth: svgWidth,
2894
3040
  tasks: tasks,
3041
+ scheduleType: scheduleType,
2895
3042
  rowHeight: rowHeight,
2896
3043
  dates: dateSetup.dates,
2897
3044
  todayColor: todayColor,
3045
+ weekendColor: weekendColor,
2898
3046
  rtl: rtl
2899
3047
  };
2900
3048
  var calendarProps = {
@@ -2938,6 +3086,7 @@ var Gantt = function Gantt(_ref) {
2938
3086
  fontSize: fontSize,
2939
3087
  tasks: barTasks,
2940
3088
  leafTasks: leafTasks,
3089
+ scheduleType: scheduleType,
2941
3090
  locale: locale,
2942
3091
  headerHeight: headerHeight,
2943
3092
  scrollY: scrollY,
@@ -2950,7 +3099,8 @@ var Gantt = function Gantt(_ref) {
2950
3099
  onDoubleClick: onDoubleClick,
2951
3100
  TaskListHeader: TaskListHeader,
2952
3101
  TaskListTable: TaskListTable,
2953
- taskLabelRenderer: taskLabelRenderer
3102
+ taskLabelRenderer: taskLabelRenderer,
3103
+ onMultiSelect: onMultiSelect
2954
3104
  };
2955
3105
  return React__default.createElement("div", null, React__default.createElement("div", {
2956
3106
  className: styles$9.wrapper,