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