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