gantt-task-react-powern 0.4.69 → 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,
@@ -354,7 +364,7 @@ var TaskListHeaderDefault = function TaskListHeaderDefault(_ref) {
354
364
  }, "Planned End")));
355
365
  };
356
366
 
357
- 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"};
358
368
 
359
369
  var localeDateStringCache = {};
360
370
 
@@ -382,11 +392,15 @@ var TaskListTableDefault = function TaskListTableDefault(_ref) {
382
392
  var rowHeight = _ref.rowHeight,
383
393
  rowWidth = _ref.rowWidth,
384
394
  tasks = _ref.tasks,
395
+ scheduleType = _ref.scheduleType,
385
396
  leafTasks = _ref.leafTasks,
386
397
  fontFamily = _ref.fontFamily,
387
398
  fontSize = _ref.fontSize,
388
399
  locale = _ref.locale,
389
400
  onExpanderClick = _ref.onExpanderClick,
401
+ _ref$selectedTasks = _ref.selectedTasks,
402
+ selectedTasks = _ref$selectedTasks === void 0 ? [] : _ref$selectedTasks,
403
+ onTaskSelect = _ref.onTaskSelect,
390
404
  _ref$taskLabelRendere = _ref.taskLabelRenderer,
391
405
  taskLabelRenderer = _ref$taskLabelRendere === void 0 ? function (t) {
392
406
  return " " + t.name;
@@ -416,13 +430,36 @@ var TaskListTableDefault = function TaskListTableDefault(_ref) {
416
430
  }
417
431
  }
418
432
 
433
+ var isSelected = selectedTasks.includes(t.id);
419
434
  return React__default.createElement("div", {
420
- className: styles$1.taskListTableRow,
435
+ className: t.type === "milestone" ? styles$1.taskListMilestoneRow : scheduleType === "lookAhead" ? styles$1.taskListLookAheadRow : styles$1.taskListTableRow,
421
436
  style: {
422
437
  height: rowHeight
423
438
  },
424
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
+ }
425
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", {
426
463
  className: styles$1.taskListCell,
427
464
  style: {
428
465
  minWidth: parseInt(rowWidth) * 0.8,
@@ -648,6 +685,7 @@ var TaskList = function TaskList(_ref) {
648
685
  rowHeight = _ref.rowHeight,
649
686
  scrollY = _ref.scrollY,
650
687
  tasks = _ref.tasks,
688
+ scheduleType = _ref.scheduleType,
651
689
  leafTasks = _ref.leafTasks,
652
690
  selectedTask = _ref.selectedTask,
653
691
  setSelectedTask = _ref.setSelectedTask,
@@ -658,18 +696,61 @@ var TaskList = function TaskList(_ref) {
658
696
  horizontalContainerClass = _ref.horizontalContainerClass,
659
697
  TaskListHeader = _ref.TaskListHeader,
660
698
  TaskListTable = _ref.TaskListTable,
661
- taskLabelRenderer = _ref.taskLabelRenderer;
699
+ taskLabelRenderer = _ref.taskLabelRenderer,
700
+ onMultiSelect = _ref.onMultiSelect;
662
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([]);
663
708
  React.useEffect(function () {
664
709
  if (horizontalContainerRef.current) {
665
710
  horizontalContainerRef.current.scrollTop = scrollY;
666
711
  }
667
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
+
668
747
  var headerProps = {
669
748
  headerHeight: headerHeight,
670
749
  fontFamily: fontFamily,
671
750
  fontSize: fontSize,
672
- rowWidth: rowWidth
751
+ rowWidth: rowWidth,
752
+ allSelected: tasks.length > 0 && selectedTasks.length === tasks.length,
753
+ onSelectAll: onMultiSelect ? handleSelectAll : undefined
673
754
  };
674
755
  var selectedTaskId = selectedTask ? selectedTask.id : "";
675
756
  var tableProps = {
@@ -679,10 +760,13 @@ var TaskList = function TaskList(_ref) {
679
760
  fontSize: fontSize,
680
761
  tasks: tasks,
681
762
  leafTasks: leafTasks,
763
+ scheduleType: scheduleType,
682
764
  locale: locale,
683
765
  selectedTaskId: selectedTaskId,
684
766
  setSelectedTask: setSelectedTask,
685
767
  onExpanderClick: onExpanderClick,
768
+ selectedTasks: onMultiSelect ? selectedTasks : undefined,
769
+ onTaskSelect: onMultiSelect ? handleTaskSelect : undefined,
686
770
  taskLabelRenderer: taskLabelRenderer
687
771
  };
688
772
  return React__default.createElement("div", {
@@ -696,19 +780,23 @@ var TaskList = function TaskList(_ref) {
696
780
  }, React__default.createElement(TaskListTable, Object.assign({}, tableProps))));
697
781
  };
698
782
 
699
- var styles$4 = {"gridRow":"_2dZTy","gridRowLine":"_3rUKi","gridTick":"_RuwuK","darkerGridRow":"_2M-tt"};
700
-
701
- var GridBody = function GridBody(_ref) {
702
- var tasks = _ref.tasks,
703
- dates = _ref.dates,
704
- rowHeight = _ref.rowHeight,
705
- svgWidth = _ref.svgWidth,
706
- columnWidth = _ref.columnWidth,
707
- todayColor = _ref.todayColor,
708
- rtl = _ref.rtl;
709
- var y = 0;
710
- var gridRows = [];
711
- 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", {
712
800
  key: "RowLineFirst",
713
801
  x: "0",
714
802
  y1: 0,
@@ -717,16 +805,15 @@ var GridBody = function GridBody(_ref) {
717
805
  className: styles$4.gridRowLine
718
806
  })];
719
807
 
720
- for (var _iterator = _createForOfIteratorHelperLoose(tasks), _step; !(_step = _iterator()).done;) {
721
- var task = _step.value;
722
- var isDarkerRow = task.type === "milestone";
808
+ for (const task of tasks) {
809
+ const isDarkerRow = task.type === "milestone";
723
810
  gridRows.push(React__default.createElement("rect", {
724
811
  key: "Row" + task.id,
725
812
  x: "0",
726
813
  y: y,
727
814
  width: svgWidth,
728
815
  height: rowHeight,
729
- className: isDarkerRow ? styles$4.darkerGridRow : styles$4.gridRow
816
+ className: isDarkerRow ? styles$4.darkerGridRow : scheduleType === "lookAhead" ? styles$4.gridRowLookAhead : styles$4.gridRow
730
817
  }));
731
818
  rowLines.push(React__default.createElement("line", {
732
819
  key: "RowLine" + task.id,
@@ -739,13 +826,14 @@ var GridBody = function GridBody(_ref) {
739
826
  y += rowHeight;
740
827
  }
741
828
 
742
- var now = new Date();
743
- var tickX = 0;
744
- var ticks = [];
745
- 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 = [];
746
834
 
747
- for (var i = 0; i < dates.length; i++) {
748
- var date = dates[i];
835
+ for (let i = 0; i < dates.length; i++) {
836
+ const date = dates[i];
749
837
  ticks.push(React__default.createElement("line", {
750
838
  key: date.getTime(),
751
839
  x1: tickX,
@@ -765,6 +853,16 @@ var GridBody = function GridBody(_ref) {
765
853
  });
766
854
  }
767
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
+
768
866
  if (rtl && i + 1 !== dates.length && date.getTime() >= now.getTime() && dates[i + 1].getTime() < now.getTime()) {
769
867
  today = React__default.createElement("rect", {
770
868
  x: tickX + columnWidth,
@@ -786,12 +884,14 @@ var GridBody = function GridBody(_ref) {
786
884
  className: "rowLines"
787
885
  }, rowLines), React__default.createElement("g", {
788
886
  className: "ticks"
789
- }, ticks), React__default.createElement("g", {
887
+ }, ticks), scheduleType === "lookAhead" && React__default.createElement("g", {
888
+ className: "weekend"
889
+ }, weekend), React__default.createElement("g", {
790
890
  className: "today"
791
891
  }, today));
792
892
  };
793
893
 
794
- var Grid = function Grid(props) {
894
+ const Grid = props => {
795
895
  return React__default.createElement("g", {
796
896
  className: "grid"
797
897
  }, React__default.createElement(GridBody, Object.assign({}, props)));
@@ -799,16 +899,17 @@ var Grid = function Grid(props) {
799
899
 
800
900
  var styles$5 = {"calendarBottomText":"_9w8d5","calendarTopTick":"_1rLuZ","calendarTopText":"_2q1Kt","calendarHeader":"_35nLX","textAnchorStart":"_2Shd-","textAnchorMiddle":"_2XXW4","textAnchorEnd":"_3GdnC"};
801
901
 
802
- var TopPartOfCalendar = function TopPartOfCalendar(_ref) {
803
- var value = _ref.value,
804
- x1Line = _ref.x1Line,
805
- y1Line = _ref.y1Line,
806
- y2Line = _ref.y2Line,
807
- xText = _ref.xText,
808
- yText = _ref.yText,
809
- _ref$textAnchor = _ref.textAnchor,
810
- textAnchor = _ref$textAnchor === void 0 ? "middle" : _ref$textAnchor;
811
- 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;
812
913
  return React__default.createElement("g", {
813
914
  className: "calendarTop"
814
915
  }, React__default.createElement("line", {
@@ -822,28 +923,30 @@ var TopPartOfCalendar = function TopPartOfCalendar(_ref) {
822
923
  key: value + "text",
823
924
  y: yText,
824
925
  x: xText,
825
- className: styles$5.calendarTopText + " " + textAnchorClass
926
+ className: `${styles$5.calendarTopText} ${textAnchorClass}`
826
927
  }, value));
827
928
  };
828
929
 
829
- var Calendar = function Calendar(_ref) {
830
- var dateSetup = _ref.dateSetup,
831
- locale = _ref.locale,
832
- viewMode = _ref.viewMode,
833
- rtl = _ref.rtl,
834
- headerHeight = _ref.headerHeight,
835
- columnWidth = _ref.columnWidth,
836
- fontFamily = _ref.fontFamily,
837
- fontSize = _ref.fontSize;
838
-
839
- var getCalendarValuesForYear = function getCalendarValuesForYear() {
840
- var topValues = [];
841
- var bottomValues = [];
842
- var topDefaultHeight = headerHeight * 0.5;
843
-
844
- for (var i = 0; i < dateSetup.dates.length; i++) {
845
- var date = dateSetup.dates[i];
846
- 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();
847
950
  bottomValues.push(React__default.createElement("text", {
848
951
  key: date.getFullYear(),
849
952
  y: headerHeight * 0.8,
@@ -852,8 +955,8 @@ var Calendar = function Calendar(_ref) {
852
955
  }, bottomValue));
853
956
 
854
957
  if (i === 0 || date.getFullYear() !== dateSetup.dates[i - 1].getFullYear()) {
855
- var topValue = date.getFullYear().toString();
856
- var xText = void 0;
958
+ const topValue = date.getFullYear().toString();
959
+ let xText;
857
960
 
858
961
  if (rtl) {
859
962
  xText = (6 + i + date.getFullYear() + 1) * columnWidth;
@@ -876,25 +979,25 @@ var Calendar = function Calendar(_ref) {
876
979
  return [topValues, bottomValues];
877
980
  };
878
981
 
879
- var getCalendarValuesForQuarter = function getCalendarValuesForQuarter() {
880
- var topValues = [];
881
- var bottomValues = [];
882
- var topDefaultHeight = headerHeight * 0.5;
982
+ const getCalendarValuesForQuarter = () => {
983
+ const topValues = [];
984
+ const bottomValues = [];
985
+ const topDefaultHeight = headerHeight * 0.5;
883
986
 
884
- for (var i = 0; i < dateSetup.dates.length; i++) {
885
- var date = dateSetup.dates[i];
886
- var quarter = Math.floor(date.getMonth() / 3) + 1;
887
- 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}`;
888
991
  bottomValues.push(React__default.createElement("text", {
889
- key: bottomValue + "-" + date.getFullYear(),
992
+ key: `${bottomValue}-${date.getFullYear()}`,
890
993
  y: headerHeight * 0.8,
891
994
  x: columnWidth * i + columnWidth * 0.5,
892
995
  className: styles$5.calendarBottomText
893
996
  }, bottomValue));
894
997
 
895
998
  if (i === 0 || date.getFullYear() !== dateSetup.dates[i - 1].getFullYear()) {
896
- var topValue = date.getFullYear().toString();
897
- var xText = void 0;
999
+ const topValue = date.getFullYear().toString();
1000
+ let xText;
898
1001
 
899
1002
  if (rtl) {
900
1003
  xText = (3 + i + quarter) * columnWidth;
@@ -917,26 +1020,26 @@ var Calendar = function Calendar(_ref) {
917
1020
  return [topValues, bottomValues];
918
1021
  };
919
1022
 
920
- var getCalendarValuesForMonth = function getCalendarValuesForMonth() {
921
- var topValues = [];
922
- var bottomValues = [];
923
- var topDefaultHeight = headerHeight * 0.5;
1023
+ const getCalendarValuesForMonth = () => {
1024
+ const topValues = [];
1025
+ const bottomValues = [];
1026
+ const topDefaultHeight = headerHeight * 0.5;
924
1027
 
925
- for (var i = 0; i < dateSetup.dates.length; i++) {
926
- var date = dateSetup.dates[i];
927
- 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, {
928
1031
  month: "short"
929
1032
  });
930
1033
  bottomValues.push(React__default.createElement("text", {
931
1034
  key: bottomValue + date.getFullYear(),
932
1035
  y: headerHeight * 0.8,
933
1036
  x: columnWidth * i + columnWidth * 0.5,
934
- className: styles$5.calendarTopText + " " + styles$5.textAnchorEnd
1037
+ className: `${styles$5.calendarTopText} ${styles$5.textAnchorEnd}`
935
1038
  }, bottomValue));
936
1039
 
937
1040
  if (i === 0 || date.getFullYear() !== dateSetup.dates[i - 1].getFullYear()) {
938
- var topValue = date.getFullYear().toString();
939
- var xText = void 0;
1041
+ const topValue = date.getFullYear().toString();
1042
+ let xText;
940
1043
 
941
1044
  if (rtl) {
942
1045
  xText = (6 + i + date.getMonth() + 1) * columnWidth;
@@ -961,27 +1064,27 @@ var Calendar = function Calendar(_ref) {
961
1064
  return [topValues, bottomValues];
962
1065
  };
963
1066
 
964
- var getCalendarValuesForWeek = function getCalendarValuesForWeek() {
965
- var topValues = [];
966
- var bottomValues = [];
967
- var weeksCount = 1;
968
- var topDefaultHeight = headerHeight * 0.5;
969
- 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;
970
1073
 
971
- for (var i = dates.length - 1; i >= 0; i--) {
972
- var date = dates[i];
973
- var topValue = "";
1074
+ for (let i = dates.length - 1; i >= 0; i--) {
1075
+ const date = dates[i];
1076
+ let topValue = "";
974
1077
 
975
1078
  if (i === 0 || date.getMonth() !== dates[i - 1].getMonth()) {
976
- topValue = getLocaleMonth(date, locale) + ", " + date.getFullYear();
1079
+ topValue = `${getLocaleMonth(date, locale)}, ${date.getFullYear()}`;
977
1080
  }
978
1081
 
979
- var bottomValue = "W" + getWeekNumberISO8601(date);
1082
+ const bottomValue = `W${getWeekNumberISO8601(date)}`;
980
1083
  bottomValues.push(React__default.createElement("text", {
981
1084
  key: date.getTime(),
982
1085
  y: headerHeight * 0.8,
983
1086
  x: columnWidth * (i + +rtl),
984
- className: styles$5.calendarTopText + " " + styles$5.textAnchorStart
1087
+ className: `${styles$5.calendarTopText} ${styles$5.textAnchorStart}`
985
1088
  }, bottomValue));
986
1089
 
987
1090
  if (topValue) {
@@ -1007,24 +1110,24 @@ var Calendar = function Calendar(_ref) {
1007
1110
  return [topValues, bottomValues];
1008
1111
  };
1009
1112
 
1010
- var getCalendarValuesForDay = function getCalendarValuesForDay() {
1011
- var topValues = [];
1012
- var bottomValues = [];
1013
- var topDefaultHeight = headerHeight * 0.5;
1014
- var dates = dateSetup.dates;
1113
+ const getCalendarValuesForDay = () => {
1114
+ const topValues = [];
1115
+ const bottomValues = [];
1116
+ const topDefaultHeight = headerHeight * 0.5;
1117
+ const dates = dateSetup.dates;
1015
1118
 
1016
- for (var i = 0; i < dates.length; i++) {
1017
- var date = dates[i];
1018
- 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()}`;
1019
1122
  bottomValues.push(React__default.createElement("text", {
1020
1123
  key: date.getTime(),
1021
1124
  y: headerHeight * 0.8,
1022
1125
  x: columnWidth * i + columnWidth * 0.5,
1023
- className: styles$5.calendarTopText + " " + styles$5.textAnchorMiddle
1126
+ className: `${styles$5.calendarTopText} ${styles$5.textAnchorMiddle}`
1024
1127
  }, bottomValue));
1025
1128
 
1026
1129
  if (i + 1 !== dates.length && date.getMonth() !== dates[i + 1].getMonth()) {
1027
- var topValue = getLocaleMonth(date, locale) + " " + date.getFullYear();
1130
+ const topValue = `${getLocaleMonth(date, locale)} ${date.getFullYear()}`;
1028
1131
  topValues.push(React__default.createElement(TopPartOfCalendar, {
1029
1132
  key: topValue + date.getFullYear(),
1030
1133
  value: topValue,
@@ -1040,28 +1143,28 @@ var Calendar = function Calendar(_ref) {
1040
1143
  return [topValues, bottomValues];
1041
1144
  };
1042
1145
 
1043
- var getCalendarValuesForPartOfDay = function getCalendarValuesForPartOfDay() {
1044
- var topValues = [];
1045
- var bottomValues = [];
1046
- var ticks = viewMode === exports.ViewMode.HalfDay ? 2 : 4;
1047
- var topDefaultHeight = headerHeight * 0.5;
1048
- 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;
1049
1152
 
1050
- for (var i = 0; i < dates.length; i++) {
1051
- var date = dates[i];
1052
- var bottomValue = getCachedDateTimeFormat(locale, {
1153
+ for (let i = 0; i < dates.length; i++) {
1154
+ const date = dates[i];
1155
+ const bottomValue = getCachedDateTimeFormat(locale, {
1053
1156
  hour: "numeric"
1054
1157
  }).format(date);
1055
1158
  bottomValues.push(React__default.createElement("text", {
1056
1159
  key: date.getTime(),
1057
1160
  y: headerHeight * 0.8,
1058
1161
  x: columnWidth * (i + +rtl),
1059
- className: styles$5.calendarTopText + " " + styles$5.textAnchorMiddle,
1162
+ className: `${styles$5.calendarTopText} ${styles$5.textAnchorMiddle}`,
1060
1163
  fontFamily: fontFamily
1061
1164
  }, bottomValue));
1062
1165
 
1063
1166
  if (i === 0 || date.getDate() !== dates[i - 1].getDate()) {
1064
- var topValue = getLocalDayOfWeek(date, locale, "short") + ", " + date.getDate() + " " + getLocaleMonth(date, locale);
1167
+ const topValue = `${getLocalDayOfWeek(date, locale, "short")}, ${date.getDate()} ${getLocaleMonth(date, locale)}`;
1065
1168
  topValues.push(React__default.createElement(TopPartOfCalendar, {
1066
1169
  key: topValue + date.getFullYear(),
1067
1170
  value: topValue,
@@ -1077,15 +1180,15 @@ var Calendar = function Calendar(_ref) {
1077
1180
  return [topValues, bottomValues];
1078
1181
  };
1079
1182
 
1080
- var getCalendarValuesForHour = function getCalendarValuesForHour() {
1081
- var topValues = [];
1082
- var bottomValues = [];
1083
- var topDefaultHeight = headerHeight * 0.5;
1084
- var dates = dateSetup.dates;
1183
+ const getCalendarValuesForHour = () => {
1184
+ const topValues = [];
1185
+ const bottomValues = [];
1186
+ const topDefaultHeight = headerHeight * 0.5;
1187
+ const dates = dateSetup.dates;
1085
1188
 
1086
- for (var i = 0; i < dates.length; i++) {
1087
- var date = dates[i];
1088
- var bottomValue = getCachedDateTimeFormat(locale, {
1189
+ for (let i = 0; i < dates.length; i++) {
1190
+ const date = dates[i];
1191
+ const bottomValue = getCachedDateTimeFormat(locale, {
1089
1192
  hour: "numeric"
1090
1193
  }).format(date);
1091
1194
  bottomValues.push(React__default.createElement("text", {
@@ -1097,9 +1200,9 @@ var Calendar = function Calendar(_ref) {
1097
1200
  }, bottomValue));
1098
1201
 
1099
1202
  if (i !== 0 && date.getDate() !== dates[i - 1].getDate()) {
1100
- var displayDate = dates[i - 1];
1101
- var topValue = getLocalDayOfWeek(displayDate, locale, "long") + ", " + displayDate.getDate() + " " + getLocaleMonth(displayDate, locale);
1102
- 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;
1103
1206
  topValues.push(React__default.createElement(TopPartOfCalendar, {
1104
1207
  key: topValue + displayDate.getFullYear(),
1105
1208
  value: topValue,
@@ -1115,58 +1218,37 @@ var Calendar = function Calendar(_ref) {
1115
1218
  return [topValues, bottomValues];
1116
1219
  };
1117
1220
 
1118
- var topValues = [];
1119
- var bottomValues = [];
1221
+ let topValues = [];
1222
+ let bottomValues = [];
1120
1223
 
1121
1224
  switch (dateSetup.viewMode) {
1122
1225
  case exports.ViewMode.Year:
1123
- var _getCalendarValuesFor = getCalendarValuesForYear();
1124
-
1125
- topValues = _getCalendarValuesFor[0];
1126
- bottomValues = _getCalendarValuesFor[1];
1226
+ [topValues, bottomValues] = getCalendarValuesForYear();
1127
1227
  break;
1128
1228
 
1129
1229
  case exports.ViewMode.Quarter:
1130
- var _getCalendarValuesFor2 = getCalendarValuesForQuarter();
1131
-
1132
- topValues = _getCalendarValuesFor2[0];
1133
- bottomValues = _getCalendarValuesFor2[1];
1230
+ [topValues, bottomValues] = getCalendarValuesForQuarter();
1134
1231
  break;
1135
1232
 
1136
1233
  case exports.ViewMode.Month:
1137
- var _getCalendarValuesFor3 = getCalendarValuesForMonth();
1138
-
1139
- topValues = _getCalendarValuesFor3[0];
1140
- bottomValues = _getCalendarValuesFor3[1];
1234
+ [topValues, bottomValues] = getCalendarValuesForMonth();
1141
1235
  break;
1142
1236
 
1143
1237
  case exports.ViewMode.Week:
1144
- var _getCalendarValuesFor4 = getCalendarValuesForWeek();
1145
-
1146
- topValues = _getCalendarValuesFor4[0];
1147
- bottomValues = _getCalendarValuesFor4[1];
1238
+ [topValues, bottomValues] = getCalendarValuesForWeek();
1148
1239
  break;
1149
1240
 
1150
1241
  case exports.ViewMode.Day:
1151
- var _getCalendarValuesFor5 = getCalendarValuesForDay();
1152
-
1153
- topValues = _getCalendarValuesFor5[0];
1154
- bottomValues = _getCalendarValuesFor5[1];
1242
+ [topValues, bottomValues] = getCalendarValuesForDay();
1155
1243
  break;
1156
1244
 
1157
1245
  case exports.ViewMode.QuarterDay:
1158
1246
  case exports.ViewMode.HalfDay:
1159
- var _getCalendarValuesFor6 = getCalendarValuesForPartOfDay();
1160
-
1161
- topValues = _getCalendarValuesFor6[0];
1162
- bottomValues = _getCalendarValuesFor6[1];
1247
+ [topValues, bottomValues] = getCalendarValuesForPartOfDay();
1163
1248
  break;
1164
1249
 
1165
1250
  case exports.ViewMode.Hour:
1166
- var _getCalendarValuesFor7 = getCalendarValuesForHour();
1167
-
1168
- topValues = _getCalendarValuesFor7[0];
1169
- bottomValues = _getCalendarValuesFor7[1];
1251
+ [topValues, bottomValues] = getCalendarValuesForHour();
1170
1252
  }
1171
1253
 
1172
1254
  return React__default.createElement("g", {
@@ -1202,27 +1284,23 @@ function _catch(body, recover) {
1202
1284
  return result;
1203
1285
  }
1204
1286
 
1205
- var Arrow = function Arrow(_ref) {
1206
- var taskFrom = _ref.taskFrom,
1207
- taskTo = _ref.taskTo,
1208
- rowHeight = _ref.rowHeight,
1209
- taskHeight = _ref.taskHeight,
1210
- arrowIndent = _ref.arrowIndent,
1211
- rtl = _ref.rtl,
1212
- arrowColor = _ref.arrowColor;
1213
- var path;
1214
- 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;
1215
1299
 
1216
1300
  if (rtl) {
1217
- var _drownPathAndTriangle = drownPathAndTriangleRTL(taskFrom, taskTo, rowHeight, taskHeight, arrowIndent);
1218
-
1219
- path = _drownPathAndTriangle[0];
1220
- trianglePoints = _drownPathAndTriangle[1];
1301
+ [path, trianglePoints] = drownPathAndTriangleRTL(taskFrom, taskTo, rowHeight, taskHeight, arrowIndent);
1221
1302
  } else {
1222
- var _drownPathAndTriangle2 = drownPathAndTriangle(taskFrom, taskTo, rowHeight, taskHeight, arrowIndent);
1223
-
1224
- path = _drownPathAndTriangle2[0];
1225
- trianglePoints = _drownPathAndTriangle2[1];
1303
+ [path, trianglePoints] = drownPathAndTriangle(taskFrom, taskTo, rowHeight, taskHeight, arrowIndent);
1226
1304
  }
1227
1305
 
1228
1306
  return React__default.createElement("g", {
@@ -1238,8 +1316,8 @@ var Arrow = function Arrow(_ref) {
1238
1316
  }));
1239
1317
  };
1240
1318
 
1241
- var drownPathAndTriangle = function drownPathAndTriangle(taskFrom, taskTo, rowHeight, taskHeight, arrowIndent) {
1242
- var taskToStart, taskFromEnd;
1319
+ const drownPathAndTriangle = (taskFrom, taskTo, rowHeight, taskHeight, arrowIndent) => {
1320
+ let taskToStart, taskFromEnd;
1243
1321
 
1244
1322
  if (taskTo.x1 > 0 && taskTo.actualx1 > 0) {
1245
1323
  taskToStart = Math.min(taskTo.x1, taskTo.actualx1);
@@ -1249,24 +1327,38 @@ var drownPathAndTriangle = function drownPathAndTriangle(taskFrom, taskTo, rowHe
1249
1327
  taskFromEnd = Math.max(taskFrom.x2, taskFrom.actualx2);
1250
1328
  } else if (taskFrom.x2 > 0) taskFromEnd = taskFrom.x2;else if (taskFrom.actualx2 > 0) taskFromEnd = taskFrom.actualx2;else taskFromEnd = 0;
1251
1329
 
1252
- var indexCompare = taskFrom.index > taskTo.index ? -1 : 1;
1253
- var taskToEndPosition = taskTo.y + taskHeight / 2;
1254
- var taskFromEndPosition = taskFromEnd + arrowIndent * 2;
1255
- var taskFromHorizontalOffsetValue = taskFromEndPosition < taskToStart ? "" : "H " + (taskToStart - arrowIndent);
1256
- var taskToHorizontalOffsetValue = taskFromEndPosition > taskToStart ? arrowIndent : taskToStart - taskFromEnd - arrowIndent;
1257
- var path = "M " + taskFromEnd + " " + (taskFrom.y + taskHeight / 2) + " \n h " + arrowIndent + " \n v " + indexCompare * rowHeight / 2 + " \n " + taskFromHorizontalOffsetValue + "\n V " + taskToEndPosition + " \n h " + taskToHorizontalOffsetValue;
1258
- 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}`;
1259
1344
  return [path, trianglePoints];
1260
1345
  };
1261
1346
 
1262
- var drownPathAndTriangleRTL = function drownPathAndTriangleRTL(taskFrom, taskTo, rowHeight, taskHeight, arrowIndent) {
1263
- var indexCompare = taskFrom.index > taskTo.index ? -1 : 1;
1264
- var taskToEndPosition = taskTo.y + taskHeight / 2;
1265
- var taskFromEndPosition = taskFrom.x1 - arrowIndent * 2;
1266
- var taskFromHorizontalOffsetValue = taskFromEndPosition > taskTo.x2 ? "" : "H " + (taskTo.x2 + arrowIndent);
1267
- var taskToHorizontalOffsetValue = taskFromEndPosition < taskTo.x2 ? -arrowIndent : taskTo.x2 - taskFrom.x1 + arrowIndent;
1268
- 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;
1269
- 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}`;
1270
1362
  return [path, trianglePoints];
1271
1363
  };
1272
1364
 
@@ -1716,24 +1808,26 @@ var sortTasks = function sortTasks(taskA, taskB) {
1716
1808
  }
1717
1809
  };
1718
1810
 
1719
- var BarDisplay = function BarDisplay(_ref) {
1720
- var x = _ref.x,
1721
- y = _ref.y,
1722
- type = _ref.type,
1723
- width = _ref.width,
1724
- height = _ref.height,
1725
- isSelected = _ref.isSelected,
1726
- progressX = _ref.progressX,
1727
- progressWidth = _ref.progressWidth,
1728
- barCornerRadius = _ref.barCornerRadius,
1729
- styles = _ref.styles,
1730
- onMouseDown = _ref.onMouseDown;
1731
-
1732
- 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 = () => {
1733
1827
  return isSelected ? styles.progressSelectedColor : styles.progressColor;
1734
1828
  };
1735
1829
 
1736
- var getBarColor = function getBarColor() {
1830
+ const getBarColor = () => {
1737
1831
  return isSelected ? styles.backgroundSelectedColor : styles.backgroundColor;
1738
1832
  };
1739
1833
 
@@ -1780,13 +1874,15 @@ var BarDisplay = function BarDisplay(_ref) {
1780
1874
 
1781
1875
  var styles$6 = {"barWrapper":"_KxSXS","barHandle":"_3w_5u","barBackground":"_31ERP"};
1782
1876
 
1783
- var BarDateHandle = function BarDateHandle(_ref) {
1784
- var x = _ref.x,
1785
- y = _ref.y,
1786
- width = _ref.width,
1787
- height = _ref.height,
1788
- barCornerRadius = _ref.barCornerRadius,
1789
- onMouseDown = _ref.onMouseDown;
1877
+ const BarDateHandle = _ref => {
1878
+ let {
1879
+ x,
1880
+ y,
1881
+ width,
1882
+ height,
1883
+ barCornerRadius,
1884
+ onMouseDown
1885
+ } = _ref;
1790
1886
  return React__default.createElement("rect", {
1791
1887
  x: x,
1792
1888
  y: y,
@@ -1799,25 +1895,25 @@ var BarDateHandle = function BarDateHandle(_ref) {
1799
1895
  });
1800
1896
  };
1801
1897
 
1802
- var BarProgressHandle = function BarProgressHandle(_ref) {
1803
- _objectDestructuringEmpty(_ref);
1804
-
1898
+ const BarProgressHandle = _ref => {
1805
1899
  return React__default.createElement("div", null);
1806
1900
  };
1807
1901
 
1808
- var Bar = function Bar(_ref) {
1809
- var task = _ref.task,
1810
- isProgressChangeable = _ref.isProgressChangeable,
1811
- isDateChangeable = _ref.isDateChangeable,
1812
- rtl = _ref.rtl,
1813
- type = _ref.type,
1814
- onEventStart = _ref.onEventStart,
1815
- isSelected = _ref.isSelected;
1816
- var progressPoint = getProgressPoint(+!rtl * task.progressWidth + task.progressX, task.y, task.height);
1817
- 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;
1818
1914
 
1819
1915
  if (type == "planned") {
1820
- 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", {
1821
1917
  className: styles$6.barWrapper,
1822
1918
  tabIndex: 0
1823
1919
  }, React__default.createElement(BarDisplay, {
@@ -1833,7 +1929,7 @@ var Bar = function Bar(_ref) {
1833
1929
  barCornerRadius: task.barCornerRadius,
1834
1930
  styles: task.styles,
1835
1931
  isSelected: isSelected,
1836
- onMouseDown: function onMouseDown(e) {
1932
+ onMouseDown: e => {
1837
1933
  isDateChangeable && onEventStart("move", task, e, "planned");
1838
1934
  }
1839
1935
  }), React__default.createElement("g", {
@@ -1844,7 +1940,7 @@ var Bar = function Bar(_ref) {
1844
1940
  width: task.handleWidth,
1845
1941
  height: handleHeight,
1846
1942
  barCornerRadius: task.barCornerRadius,
1847
- onMouseDown: function onMouseDown(e) {
1943
+ onMouseDown: e => {
1848
1944
  onEventStart("start", task, e, "planned");
1849
1945
  }
1850
1946
  }), React__default.createElement(BarDateHandle, {
@@ -1853,19 +1949,19 @@ var Bar = function Bar(_ref) {
1853
1949
  width: task.handleWidth,
1854
1950
  height: handleHeight,
1855
1951
  barCornerRadius: task.barCornerRadius,
1856
- onMouseDown: function onMouseDown(e) {
1952
+ onMouseDown: e => {
1857
1953
  onEventStart("end", task, e, "planned");
1858
1954
  }
1859
1955
  })), isProgressChangeable && React__default.createElement(BarProgressHandle, {
1860
1956
  progressPoint: progressPoint,
1861
- onMouseDown: function onMouseDown(e) {
1957
+ onMouseDown: e => {
1862
1958
  onEventStart("progress", task, e, "planned");
1863
1959
  }
1864
1960
  })));else return React__default.createElement("g", {
1865
1961
  className: styles$6.barWrapper,
1866
1962
  tabIndex: 0
1867
1963
  });
1868
- } 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) {
1869
1965
  return React__default.createElement("g", {
1870
1966
  className: styles$6.barWrapper,
1871
1967
  tabIndex: 0
@@ -1882,7 +1978,7 @@ var Bar = function Bar(_ref) {
1882
1978
  barCornerRadius: task.barCornerRadius,
1883
1979
  styles: task.styles,
1884
1980
  isSelected: isSelected,
1885
- onMouseDown: function onMouseDown(e) {
1981
+ onMouseDown: e => {
1886
1982
  isDateChangeable && onEventStart("move", task, e, "actual");
1887
1983
  }
1888
1984
  }), React__default.createElement("g", {
@@ -1893,7 +1989,7 @@ var Bar = function Bar(_ref) {
1893
1989
  width: task.handleWidth,
1894
1990
  height: handleHeight,
1895
1991
  barCornerRadius: task.barCornerRadius,
1896
- onMouseDown: function onMouseDown(e) {
1992
+ onMouseDown: e => {
1897
1993
  onEventStart("start", task, e, "actual");
1898
1994
  }
1899
1995
  }), React__default.createElement(BarDateHandle, {
@@ -1902,12 +1998,12 @@ var Bar = function Bar(_ref) {
1902
1998
  width: task.handleWidth,
1903
1999
  height: handleHeight,
1904
2000
  barCornerRadius: task.barCornerRadius,
1905
- onMouseDown: function onMouseDown(e) {
2001
+ onMouseDown: e => {
1906
2002
  onEventStart("end", task, e, "actual");
1907
2003
  }
1908
2004
  })), isProgressChangeable && React__default.createElement(BarProgressHandle, {
1909
2005
  progressPoint: progressPoint,
1910
- onMouseDown: function onMouseDown(e) {
2006
+ onMouseDown: e => {
1911
2007
  onEventStart("progress", task, e, "actual");
1912
2008
  }
1913
2009
  })));
@@ -1919,14 +2015,16 @@ var Bar = function Bar(_ref) {
1919
2015
  }
1920
2016
  };
1921
2017
 
1922
- var BarSmall = function BarSmall(_ref) {
1923
- var task = _ref.task,
1924
- type = _ref.type,
1925
- isProgressChangeable = _ref.isProgressChangeable,
1926
- isDateChangeable = _ref.isDateChangeable,
1927
- onEventStart = _ref.onEventStart,
1928
- isSelected = _ref.isSelected;
1929
- 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);
1930
2028
  return React__default.createElement("g", {
1931
2029
  className: styles$6.barWrapper,
1932
2030
  tabIndex: 0
@@ -1943,14 +2041,14 @@ var BarSmall = function BarSmall(_ref) {
1943
2041
  barCornerRadius: task.barCornerRadius,
1944
2042
  styles: task.styles,
1945
2043
  isSelected: isSelected,
1946
- onMouseDown: function onMouseDown(e) {
2044
+ onMouseDown: e => {
1947
2045
  isDateChangeable && onEventStart("move", task, e);
1948
2046
  }
1949
2047
  }), React__default.createElement("g", {
1950
2048
  className: "handleGroup"
1951
2049
  }, isProgressChangeable && React__default.createElement(BarProgressHandle, {
1952
2050
  progressPoint: progressPoint,
1953
- onMouseDown: function onMouseDown(e) {
2051
+ onMouseDown: e => {
1954
2052
  onEventStart("progress", task, e);
1955
2053
  }
1956
2054
  })));
@@ -1958,14 +2056,17 @@ var BarSmall = function BarSmall(_ref) {
1958
2056
 
1959
2057
  var styles$7 = {"milestoneWrapper":"_RRr13","milestoneBackground":"_2P2B1"};
1960
2058
 
1961
- var Milestone = function Milestone(_ref) {
1962
- var task = _ref.task,
1963
- isDateChangeable = _ref.isDateChangeable,
1964
- onEventStart = _ref.onEventStart,
1965
- isSelected = _ref.isSelected;
1966
- var transform = "rotate(45 " + (task.x1 + task.height * 0.356) + " \n " + (task.y + task.height * 0.85) + ")";
1967
-
1968
- 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 = () => {
1969
2070
  return isSelected ? task.styles.backgroundSelectedColor : task.styles.backgroundColor;
1970
2071
  };
1971
2072
 
@@ -1982,7 +2083,7 @@ var Milestone = function Milestone(_ref) {
1982
2083
  ry: task.barCornerRadius,
1983
2084
  transform: transform,
1984
2085
  className: styles$7.milestoneBackground,
1985
- onMouseDown: function onMouseDown(e) {
2086
+ onMouseDown: e => {
1986
2087
  isDateChangeable && onEventStart("move", task, e);
1987
2088
  }
1988
2089
  }));
@@ -1990,14 +2091,16 @@ var Milestone = function Milestone(_ref) {
1990
2091
 
1991
2092
  var styles$8 = {"projectWrapper":"_1KJ6x","projectBackground":"_2RbVy","projectTop":"_2pZMF"};
1992
2093
 
1993
- var Project = function Project(_ref) {
1994
- var task = _ref.task,
1995
- isSelected = _ref.isSelected;
1996
- var barColor = isSelected ? task.styles.backgroundSelectedColor : task.styles.backgroundColor;
1997
- var processColor = isSelected ? task.styles.progressSelectedColor : task.styles.progressColor;
1998
- var projectWith = task.x2 - task.x1;
1999
- 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(",");
2000
- 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(",");
2001
2104
  return React__default.createElement("g", {
2002
2105
  tabIndex: 0,
2003
2106
  className: styles$8.projectWrapper
@@ -2038,25 +2141,23 @@ var Project = function Project(_ref) {
2038
2141
  }));
2039
2142
  };
2040
2143
 
2041
- var TaskItem = function TaskItem(props) {
2042
- var _props = _extends({}, props),
2043
- task = _props.task,
2044
- isDelete = _props.isDelete,
2045
- isSelected = _props.isSelected,
2046
- onEventStart = _props.onEventStart;
2047
-
2048
- var _useState = React.useState([React__default.createElement("div", null)]),
2049
- taskItem = _useState[0],
2050
- setTaskItem = _useState[1];
2051
-
2052
- 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(() => {
2053
2154
  switch (task.typeInternal) {
2054
2155
  case "milestone":
2055
- 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([]);
2056
2157
  break;
2057
2158
 
2058
2159
  case "project":
2059
- 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([]);
2060
2161
  break;
2061
2162
 
2062
2163
  case "smalltask":
@@ -2065,27 +2166,27 @@ var TaskItem = function TaskItem(props) {
2065
2166
 
2066
2167
  default:
2067
2168
  {
2068
- var _taskItem = [];
2169
+ let taskItem = [];
2069
2170
 
2070
- if (task.x1 && task.x2) {
2071
- _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, {
2072
2173
  type: "planned"
2073
2174
  })));
2074
2175
  }
2075
2176
 
2076
- if (task.actualx1 && task.actualx2) {
2077
- _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, {
2078
2179
  type: "actual"
2079
2180
  })));
2080
2181
  }
2081
2182
 
2082
- setTaskItem(_taskItem);
2183
+ setTaskItem(taskItem);
2083
2184
  }
2084
2185
  break;
2085
2186
  }
2086
2187
  }, [task, isSelected]);
2087
2188
  return React__default.createElement("g", null, React__default.createElement("g", {
2088
- onKeyDown: function onKeyDown(e) {
2189
+ onKeyDown: e => {
2089
2190
  switch (e.key) {
2090
2191
  case "Delete":
2091
2192
  {
@@ -2096,20 +2197,20 @@ var TaskItem = function TaskItem(props) {
2096
2197
 
2097
2198
  e.stopPropagation();
2098
2199
  },
2099
- onMouseEnter: function onMouseEnter(e) {
2200
+ onMouseEnter: e => {
2100
2201
  onEventStart("mouseenter", task, e, "planned");
2101
2202
  },
2102
- onMouseLeave: function onMouseLeave(e) {
2203
+ onMouseLeave: e => {
2103
2204
  onEventStart("mouseleave", task, e, "planned");
2104
2205
  },
2105
- onDoubleClick: function onDoubleClick(e) {
2206
+ onDoubleClick: e => {
2106
2207
  onEventStart("dblclick", task, e, "planned");
2107
2208
  },
2108
- onClick: function onClick(e) {
2209
+ onClick: e => {
2109
2210
  onEventStart("click", task, e, "planned");
2110
2211
  }
2111
2212
  }, taskItem[0]), React__default.createElement("g", {
2112
- onKeyDown: function onKeyDown(e) {
2213
+ onKeyDown: e => {
2113
2214
  switch (e.key) {
2114
2215
  case "Delete":
2115
2216
  {
@@ -2120,82 +2221,74 @@ var TaskItem = function TaskItem(props) {
2120
2221
 
2121
2222
  e.stopPropagation();
2122
2223
  },
2123
- onMouseEnter: function onMouseEnter(e) {
2224
+ onMouseEnter: e => {
2124
2225
  onEventStart("mouseenter", task, e, "actual");
2125
2226
  },
2126
- onMouseLeave: function onMouseLeave(e) {
2227
+ onMouseLeave: e => {
2127
2228
  onEventStart("mouseleave", task, e, "actual");
2128
2229
  },
2129
- onDoubleClick: function onDoubleClick(e) {
2230
+ onDoubleClick: e => {
2130
2231
  onEventStart("dblclick", task, e, "actual");
2131
2232
  },
2132
- onClick: function onClick(e) {
2233
+ onClick: e => {
2133
2234
  onEventStart("click", task, e, "actual");
2134
2235
  }
2135
2236
  }, taskItem[1]));
2136
2237
  };
2137
2238
 
2138
- var TaskGanttContent = function TaskGanttContent(_ref) {
2239
+ const TaskGanttContent = _ref => {
2139
2240
  var _svg$current;
2140
2241
 
2141
- var tasks = _ref.tasks,
2142
- dates = _ref.dates,
2143
- ganttEvent = _ref.ganttEvent,
2144
- selectedTask = _ref.selectedTask,
2145
- rowHeight = _ref.rowHeight,
2146
- columnWidth = _ref.columnWidth,
2147
- timeStep = _ref.timeStep,
2148
- svg = _ref.svg,
2149
- taskHeight = _ref.taskHeight,
2150
- arrowIndent = _ref.arrowIndent,
2151
- fontFamily = _ref.fontFamily,
2152
- fontSize = _ref.fontSize,
2153
- rtl = _ref.rtl,
2154
- setGanttEvent = _ref.setGanttEvent,
2155
- setFailedTask = _ref.setFailedTask,
2156
- setSelectedTask = _ref.setSelectedTask,
2157
- onDateChange = _ref.onDateChange,
2158
- onProgressChange = _ref.onProgressChange,
2159
- onDoubleClick = _ref.onDoubleClick,
2160
- onClick = _ref.onClick,
2161
- onDelete = _ref.onDelete;
2162
- var point = svg === null || svg === void 0 ? void 0 : (_svg$current = svg.current) === null || _svg$current === void 0 ? void 0 : _svg$current.createSVGPoint();
2163
-
2164
- var _useState = React.useState(0),
2165
- xStep = _useState[0],
2166
- setXStep = _useState[1];
2167
-
2168
- var _useState2 = React.useState(0),
2169
- initEventX1Delta = _useState2[0],
2170
- setInitEventX1Delta = _useState2[1];
2171
-
2172
- var _useState3 = React.useState(false),
2173
- isMoving = _useState3[0],
2174
- setIsMoving = _useState3[1];
2175
-
2176
- React.useEffect(function () {
2177
- var dateDelta = dates[1].getTime() - dates[0].getTime() - dates[1].getTimezoneOffset() * 60 * 1000 + dates[0].getTimezoneOffset() * 60 * 1000;
2178
- 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;
2179
2272
  setXStep(newXStep);
2180
2273
  }, [columnWidth, dates, timeStep]);
2181
- React.useEffect(function () {
2182
- var handleMouseMove = function handleMouseMove(event) {
2274
+ React.useEffect(() => {
2275
+ const handleMouseMove = function (event) {
2183
2276
  try {
2184
2277
  var _svg$current$getScree;
2185
2278
 
2186
2279
  if (!ganttEvent.changedTask || !point || !(svg !== null && svg !== void 0 && svg.current)) return Promise.resolve();
2187
2280
  event.preventDefault();
2188
2281
  point.x = event.clientX;
2189
- 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());
2190
-
2191
- var _handleTaskBySVGMouse = handleTaskBySVGMouseEvent(cursor.x, ganttEvent.action, ganttEvent.changedTask, ganttEvent.type, xStep, timeStep, initEventX1Delta, rtl),
2192
- isChanged = _handleTaskBySVGMouse.isChanged,
2193
- 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);
2194
2287
 
2195
2288
  if (isChanged) {
2196
2289
  setGanttEvent({
2197
2290
  action: ganttEvent.action,
2198
- changedTask: changedTask
2291
+ changedTask
2199
2292
  });
2200
2293
  }
2201
2294
 
@@ -2205,40 +2298,41 @@ var TaskGanttContent = function TaskGanttContent(_ref) {
2205
2298
  }
2206
2299
  };
2207
2300
 
2208
- var handleMouseUp = function handleMouseUp(event) {
2301
+ const handleMouseUp = function (event) {
2209
2302
  try {
2210
2303
  var _svg$current$getScree2;
2211
2304
 
2212
- var _temp6 = function _temp6() {
2305
+ function _temp5() {
2213
2306
  if (!operationSuccess) {
2214
2307
  setFailedTask(originalSelectedTask);
2215
2308
  }
2216
- };
2309
+ }
2217
2310
 
2218
- var action = ganttEvent.action,
2219
- originalSelectedTask = ganttEvent.originalSelectedTask,
2220
- changedTask = ganttEvent.changedTask,
2221
- type = ganttEvent.type;
2311
+ const {
2312
+ action,
2313
+ originalSelectedTask,
2314
+ changedTask,
2315
+ type
2316
+ } = ganttEvent;
2222
2317
  if (!changedTask || !point || !(svg !== null && svg !== void 0 && svg.current) || !originalSelectedTask) return Promise.resolve();
2223
2318
  event.preventDefault();
2224
2319
  point.x = event.clientX;
2225
- 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());
2226
-
2227
- var _handleTaskBySVGMouse2 = handleTaskBySVGMouseEvent(cursor.x, action, changedTask, type, xStep, timeStep, initEventX1Delta, rtl),
2228
- newChangedTask = _handleTaskBySVGMouse2.changedTask;
2229
-
2230
- 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;
2231
2325
  svg.current.removeEventListener("mousemove", handleMouseMove);
2232
2326
  svg.current.removeEventListener("mouseup", handleMouseUp);
2233
2327
  setGanttEvent({
2234
2328
  action: ""
2235
2329
  });
2236
2330
  setIsMoving(false);
2237
- var operationSuccess = true;
2331
+ let operationSuccess = true;
2238
2332
 
2239
- var _temp7 = function () {
2333
+ const _temp4 = function () {
2240
2334
  if ((action === "move" || action === "end" || action === "start") && onDateChange && isNotLikeOriginal) {
2241
- var _temp8 = _catch(function () {
2335
+ const _temp = _catch(function () {
2242
2336
  return Promise.resolve(onDateChange(newChangedTask, newChangedTask.barChildren)).then(function (result) {
2243
2337
  if (result !== undefined) {
2244
2338
  operationSuccess = result;
@@ -2248,11 +2342,11 @@ var TaskGanttContent = function TaskGanttContent(_ref) {
2248
2342
  operationSuccess = false;
2249
2343
  });
2250
2344
 
2251
- if (_temp8 && _temp8.then) return _temp8.then(function () {});
2345
+ if (_temp && _temp.then) return _temp.then(function () {});
2252
2346
  } else {
2253
- var _temp9 = function () {
2347
+ const _temp3 = function () {
2254
2348
  if (onProgressChange && isNotLikeOriginal) {
2255
- var _temp10 = _catch(function () {
2349
+ const _temp2 = _catch(function () {
2256
2350
  return Promise.resolve(onProgressChange(newChangedTask, newChangedTask.barChildren)).then(function (result) {
2257
2351
  if (result !== undefined) {
2258
2352
  operationSuccess = result;
@@ -2262,15 +2356,15 @@ var TaskGanttContent = function TaskGanttContent(_ref) {
2262
2356
  operationSuccess = false;
2263
2357
  });
2264
2358
 
2265
- if (_temp10 && _temp10.then) return _temp10.then(function () {});
2359
+ if (_temp2 && _temp2.then) return _temp2.then(function () {});
2266
2360
  }
2267
2361
  }();
2268
2362
 
2269
- if (_temp9 && _temp9.then) return _temp9.then(function () {});
2363
+ if (_temp3 && _temp3.then) return _temp3.then(function () {});
2270
2364
  }
2271
2365
  }();
2272
2366
 
2273
- return Promise.resolve(_temp7 && _temp7.then ? _temp7.then(_temp6) : _temp6(_temp7));
2367
+ return Promise.resolve(_temp4 && _temp4.then ? _temp4.then(_temp5) : _temp5(_temp4));
2274
2368
  } catch (e) {
2275
2369
  return Promise.reject(e);
2276
2370
  }
@@ -2283,7 +2377,7 @@ var TaskGanttContent = function TaskGanttContent(_ref) {
2283
2377
  }
2284
2378
  }, [ganttEvent, xStep, initEventX1Delta, onProgressChange, timeStep, onDateChange, svg, isMoving, point, rtl, setFailedTask, setGanttEvent]);
2285
2379
 
2286
- var handleBarEventStart = function handleBarEventStart(action, task, event, type) {
2380
+ const handleBarEventStart = function (action, task, event, type) {
2287
2381
  try {
2288
2382
  return Promise.resolve(function () {
2289
2383
  if (!event) {
@@ -2292,15 +2386,15 @@ var TaskGanttContent = function TaskGanttContent(_ref) {
2292
2386
  }
2293
2387
  } else return function () {
2294
2388
  if (isKeyboardEvent(event)) {
2295
- var _temp14 = function () {
2389
+ const _temp8 = function () {
2296
2390
  if (action === "delete") {
2297
- var _temp15 = function () {
2391
+ const _temp7 = function () {
2298
2392
  if (onDelete) {
2299
- var _temp16 = _catch(function () {
2393
+ const _temp6 = _catch(function () {
2300
2394
  return Promise.resolve(onDelete(task)).then(function (result) {
2301
2395
  if (result !== undefined && result) {
2302
2396
  setGanttEvent({
2303
- action: action,
2397
+ action,
2304
2398
  changedTask: task
2305
2399
  });
2306
2400
  }
@@ -2309,19 +2403,19 @@ var TaskGanttContent = function TaskGanttContent(_ref) {
2309
2403
  console.error("Error on Delete. " + error);
2310
2404
  });
2311
2405
 
2312
- if (_temp16 && _temp16.then) return _temp16.then(function () {});
2406
+ if (_temp6 && _temp6.then) return _temp6.then(function () {});
2313
2407
  }
2314
2408
  }();
2315
2409
 
2316
- if (_temp15 && _temp15.then) return _temp15.then(function () {});
2410
+ if (_temp7 && _temp7.then) return _temp7.then(function () {});
2317
2411
  }
2318
2412
  }();
2319
2413
 
2320
- if (_temp14 && _temp14.then) return _temp14.then(function () {});
2414
+ if (_temp8 && _temp8.then) return _temp8.then(function () {});
2321
2415
  } else if (action === "mouseenter") {
2322
2416
  if (!ganttEvent.action) {
2323
2417
  setGanttEvent({
2324
- action: action,
2418
+ action,
2325
2419
  changedTask: task,
2326
2420
  originalSelectedTask: task,
2327
2421
  type: type
@@ -2342,17 +2436,17 @@ var TaskGanttContent = function TaskGanttContent(_ref) {
2342
2436
 
2343
2437
  if (!(svg !== null && svg !== void 0 && svg.current) || !point) return;
2344
2438
  point.x = event.clientX;
2345
- 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());
2346
2440
  if (type == "planned") setInitEventX1Delta(cursor.x - task.x1);else if (type == "actual") setInitEventX1Delta(cursor.x - task.actualx1);
2347
2441
  setGanttEvent({
2348
- action: action,
2442
+ action,
2349
2443
  changedTask: task,
2350
2444
  originalSelectedTask: task,
2351
2445
  type: type
2352
2446
  });
2353
2447
  } else {
2354
2448
  setGanttEvent({
2355
- action: action,
2449
+ action,
2356
2450
  changedTask: task,
2357
2451
  originalSelectedTask: task,
2358
2452
  type: type
@@ -2369,8 +2463,8 @@ var TaskGanttContent = function TaskGanttContent(_ref) {
2369
2463
  className: "content"
2370
2464
  }, React__default.createElement("g", {
2371
2465
  className: "arrows"
2372
- }, tasks.map(function (_task) {
2373
- 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;
2374
2468
 
2375
2469
  if (!task) {
2376
2470
  return React__default.createElement("g", {
@@ -2381,28 +2475,31 @@ var TaskGanttContent = function TaskGanttContent(_ref) {
2381
2475
  });
2382
2476
  }
2383
2477
 
2384
- return task.barChildren.map(function (child) {
2478
+ return task.barChildren.map(child => {
2385
2479
  var _task$criticalPathArr, _task$criticalPathArr2;
2386
2480
 
2387
- return React__default.createElement(Arrow, {
2388
- 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}`,
2389
2483
  taskFrom: task,
2390
2484
  taskTo: tasks[child.index],
2391
2485
  rowHeight: rowHeight,
2392
2486
  taskHeight: taskHeight,
2393
2487
  arrowIndent: arrowIndent,
2394
2488
  rtl: rtl,
2395
- arrowColor: ((_task$criticalPathArr = task.criticalPathArrows) === null || _task$criticalPathArr === void 0 ? void 0 : (_task$criticalPathArr2 = _task$criticalPathArr.find(function (arrow) {
2396
- return arrow.taskId == tasks[child.index].id;
2397
- })) === 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
+ }
2398
2495
  });
2399
2496
  });
2400
2497
  })), React__default.createElement("g", {
2401
2498
  className: "bar",
2402
2499
  fontFamily: fontFamily,
2403
2500
  fontSize: fontSize
2404
- }, tasks.map(function (_task) {
2405
- 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;
2406
2503
 
2407
2504
  if (!task) {
2408
2505
  return React__default.createElement("g", {
@@ -2516,6 +2613,12 @@ var Gantt = function Gantt(_ref) {
2516
2613
  var tasks = _ref.tasks,
2517
2614
  _ref$leafTasks = _ref.leafTasks,
2518
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,
2519
2622
  _ref$headerHeight = _ref.headerHeight,
2520
2623
  headerHeight = _ref$headerHeight === void 0 ? 50 : _ref$headerHeight,
2521
2624
  _ref$columnWidth = _ref.columnWidth,
@@ -2572,6 +2675,8 @@ var Gantt = function Gantt(_ref) {
2572
2675
  arrowIndent = _ref$arrowIndent === void 0 ? 20 : _ref$arrowIndent,
2573
2676
  _ref$todayColor = _ref.todayColor,
2574
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,
2575
2680
  viewDate = _ref.viewDate,
2576
2681
  _ref$TooltipContent = _ref.TooltipContent,
2577
2682
  TooltipContent = _ref$TooltipContent === void 0 ? StandardTooltipContent : _ref$TooltipContent,
@@ -2586,18 +2691,26 @@ var Gantt = function Gantt(_ref) {
2586
2691
  onDelete = _ref.onDelete,
2587
2692
  onSelect = _ref.onSelect,
2588
2693
  onExpanderClick = _ref.onExpanderClick,
2694
+ onMultiSelect = _ref.onMultiSelect,
2589
2695
  taskLabelRenderer = _ref.taskLabelRenderer;
2590
2696
  var wrapperRef = React.useRef(null);
2591
2697
  var taskListRef = React.useRef(null);
2592
2698
 
2593
2699
  var _useState = React.useState(function () {
2594
2700
  var _ganttDateRange = ganttDateRange(tasks, viewMode, preStepsCount),
2595
- startDate = _ganttDateRange[0],
2596
- 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
+ }
2597
2710
 
2598
2711
  return {
2599
2712
  viewMode: viewMode,
2600
- dates: seedDates(startDate, endDate, viewMode)
2713
+ dates: seedDates(startDateRange, endDateRange, viewMode)
2601
2714
  };
2602
2715
  }),
2603
2716
  dateSetup = _useState[0],
@@ -2656,6 +2769,14 @@ var Gantt = function Gantt(_ref) {
2656
2769
  ignoreScrollEvent = _useState12[0],
2657
2770
  setIgnoreScrollEvent = _useState12[1];
2658
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]);
2659
2780
  React.useEffect(function () {
2660
2781
  var filteredTasks;
2661
2782
 
@@ -2668,10 +2789,14 @@ var Gantt = function Gantt(_ref) {
2668
2789
  filteredTasks = filteredTasks.sort(sortTasks);
2669
2790
 
2670
2791
  var _ganttDateRange2 = ganttDateRange(filteredTasks, viewMode, preStepsCount),
2671
- startDate = _ganttDateRange2[0],
2672
- endDate = _ganttDateRange2[1];
2792
+ startDateRange = _ganttDateRange2[0],
2793
+ endDateRange = _ganttDateRange2[1];
2794
+
2795
+ var newDates = seedDates(startDateRange, endDateRange, viewMode);
2673
2796
 
2674
- var newDates = seedDates(startDate, endDate, viewMode);
2797
+ if (scheduleType === "lookAhead") {
2798
+ newDates = seedDates(startDate, endDate, viewMode);
2799
+ }
2675
2800
 
2676
2801
  if (rtl) {
2677
2802
  newDates = newDates.reverse();
@@ -2681,10 +2806,12 @@ var Gantt = function Gantt(_ref) {
2681
2806
  }
2682
2807
  }
2683
2808
 
2684
- setDateSetup({
2685
- dates: newDates,
2686
- viewMode: viewMode
2687
- });
2809
+ if (scheduleType !== "lookAhead") {
2810
+ setDateSetup({
2811
+ dates: seedDates(startDateRange, endDateRange, viewMode),
2812
+ viewMode: viewMode
2813
+ });
2814
+ }
2688
2815
 
2689
2816
  var _getCriticalPaths = getCriticalPaths(leafTasks),
2690
2817
  primaryPath = _getCriticalPaths[0],
@@ -2911,9 +3038,11 @@ var Gantt = function Gantt(_ref) {
2911
3038
  columnWidth: columnWidth,
2912
3039
  svgWidth: svgWidth,
2913
3040
  tasks: tasks,
3041
+ scheduleType: scheduleType,
2914
3042
  rowHeight: rowHeight,
2915
3043
  dates: dateSetup.dates,
2916
3044
  todayColor: todayColor,
3045
+ weekendColor: weekendColor,
2917
3046
  rtl: rtl
2918
3047
  };
2919
3048
  var calendarProps = {
@@ -2957,6 +3086,7 @@ var Gantt = function Gantt(_ref) {
2957
3086
  fontSize: fontSize,
2958
3087
  tasks: barTasks,
2959
3088
  leafTasks: leafTasks,
3089
+ scheduleType: scheduleType,
2960
3090
  locale: locale,
2961
3091
  headerHeight: headerHeight,
2962
3092
  scrollY: scrollY,
@@ -2969,7 +3099,8 @@ var Gantt = function Gantt(_ref) {
2969
3099
  onDoubleClick: onDoubleClick,
2970
3100
  TaskListHeader: TaskListHeader,
2971
3101
  TaskListTable: TaskListTable,
2972
- taskLabelRenderer: taskLabelRenderer
3102
+ taskLabelRenderer: taskLabelRenderer,
3103
+ onMultiSelect: onMultiSelect
2973
3104
  };
2974
3105
  return React__default.createElement("div", null, React__default.createElement("div", {
2975
3106
  className: styles$9.wrapper,