gantt-task-react-powern 0.4.63 → 0.4.64

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,6 +18,10 @@ 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
+
21
25
  function _unsupportedIterableToArray(o, minLen) {
22
26
  if (!o) return;
23
27
  if (typeof o === "string") return _arrayLikeToArray(o, minLen);
@@ -276,13 +280,11 @@ var getDaysInMonth = function getDaysInMonth(month, year) {
276
280
 
277
281
  var styles = {"ganttTable":"_3_ygE","ganttTable_Header":"_1nBOt","ganttTable_HeaderSeparator":"_2eZzQ","ganttTable_HeaderItem":"_WuQ0f"};
278
282
 
279
- const TaskListHeaderDefault = _ref => {
280
- let {
281
- headerHeight,
282
- fontFamily,
283
- fontSize,
284
- rowWidth
285
- } = _ref;
283
+ var TaskListHeaderDefault = function TaskListHeaderDefault(_ref) {
284
+ var headerHeight = _ref.headerHeight,
285
+ fontFamily = _ref.fontFamily,
286
+ fontSize = _ref.fontSize,
287
+ rowWidth = _ref.rowWidth;
286
288
  return React.createElement("div", {
287
289
  className: styles.ganttTable,
288
290
  style: {
@@ -339,59 +341,60 @@ const TaskListHeaderDefault = _ref => {
339
341
  }, "Planned End")));
340
342
  };
341
343
 
342
- var styles$1 = {"taskListWrapper":"_3ZbQT","taskListTableRow":"_34SS0","taskListCell":"_3lLk3","taskListNameWrapper":"_nI1Xw","taskListExpander":"_2QjE6","taskListExpanderPlaceholder":"_1fnLB","taskListEmptyExpander":"_2TfEi","taskListText":"_2ZvXU","taskListCheckbox":"_1KIaF"};
344
+ var styles$1 = {"taskListWrapper":"_3ZbQT","taskListTableRow":"_34SS0","taskListLookAheadRow":"_GzvG4","taskListMilestoneRow":"_3Ykml","taskListCell":"_3lLk3","taskListNameWrapper":"_nI1Xw","taskListExpander":"_2QjE6","taskListExpanderPlaceholder":"_1fnLB","taskListEmptyExpander":"_2TfEi","taskListText":"_2ZvXU"};
343
345
 
344
- const localeDateStringCache = {};
346
+ var localeDateStringCache = {};
345
347
 
346
- const toLocaleDateStringFactory = locale => (date, dateTimeOptions) => {
347
- if (!date || date.getTime() === 0) return "";
348
- const key = date.toString();
349
- let lds = localeDateStringCache[key];
348
+ var toLocaleDateStringFactory = function toLocaleDateStringFactory(locale) {
349
+ return function (date, dateTimeOptions) {
350
+ if (!date || date.getTime() === 0) return "";
351
+ var key = date.toString();
352
+ var lds = localeDateStringCache[key];
350
353
 
351
- if (!lds) {
352
- lds = date.toLocaleDateString(locale, dateTimeOptions);
353
- localeDateStringCache[key] = lds;
354
- }
354
+ if (!lds) {
355
+ lds = date.toLocaleDateString(locale, dateTimeOptions);
356
+ localeDateStringCache[key] = lds;
357
+ }
355
358
 
356
- return lds;
359
+ return lds;
360
+ };
357
361
  };
358
362
 
359
- const dateTimeOptions = {
363
+ var dateTimeOptions = {
360
364
  year: "numeric",
361
365
  month: "numeric",
362
366
  day: "numeric"
363
367
  };
364
- const TaskListTableDefault = _ref => {
365
- let {
366
- rowHeight,
367
- rowWidth,
368
- tasks,
369
- leafTasks,
370
- fontFamily,
371
- fontSize,
372
- locale,
373
- onExpanderClick,
374
- taskLabelRenderer = t => " " + t.name,
375
- selectedTaskIds = [],
376
- onTaskSelectionChange
377
- } = _ref;
378
- const toLocaleDateString = useMemo(() => toLocaleDateStringFactory(locale), [locale]);
379
-
380
- const handleCheckboxChange = (taskId, isChecked) => {
381
- if (!onTaskSelectionChange) return;
382
- const newSelectedIds = isChecked ? [...selectedTaskIds, taskId] : selectedTaskIds.filter(id => id !== taskId);
383
- onTaskSelectionChange(newSelectedIds);
384
- };
385
-
386
- const leafTaskIds = useMemo(() => new Set(leafTasks.map(t => t.id)), [leafTasks]);
368
+ var TaskListTableDefault = function TaskListTableDefault(_ref) {
369
+ var rowHeight = _ref.rowHeight,
370
+ rowWidth = _ref.rowWidth,
371
+ tasks = _ref.tasks,
372
+ scheduleType = _ref.scheduleType,
373
+ leafTasks = _ref.leafTasks,
374
+ fontFamily = _ref.fontFamily,
375
+ fontSize = _ref.fontSize,
376
+ locale = _ref.locale,
377
+ onExpanderClick = _ref.onExpanderClick,
378
+ _ref$taskLabelRendere = _ref.taskLabelRenderer,
379
+ taskLabelRenderer = _ref$taskLabelRendere === void 0 ? function (t) {
380
+ return " " + t.name;
381
+ } : _ref$taskLabelRendere;
382
+ var toLocaleDateString = useMemo(function () {
383
+ return toLocaleDateStringFactory(locale);
384
+ }, [locale]);
385
+ var leafTaskIds = useMemo(function () {
386
+ return new Set(leafTasks.map(function (t) {
387
+ return t.id;
388
+ }));
389
+ }, [leafTasks]);
387
390
  return React.createElement("div", {
388
391
  className: styles$1.taskListWrapper,
389
392
  style: {
390
393
  fontFamily: fontFamily,
391
394
  fontSize: fontSize
392
395
  }
393
- }, tasks.map(t => {
394
- let expanderSymbol = "";
396
+ }, tasks.map(function (t) {
397
+ var expanderSymbol = "";
395
398
 
396
399
  if (!leafTaskIds.has(t.id)) {
397
400
  if (t.hideChildren === false) {
@@ -401,27 +404,13 @@ const TaskListTableDefault = _ref => {
401
404
  }
402
405
  }
403
406
 
404
- const isChecked = selectedTaskIds.includes(t.id);
405
407
  return React.createElement("div", {
406
- className: styles$1.taskListTableRow,
408
+ className: t.type === "milestone" ? styles$1.taskListMilestoneRow : scheduleType === "lookAhead" ? styles$1.taskListLookAheadRow : styles$1.taskListTableRow,
407
409
  style: {
408
410
  height: rowHeight
409
411
  },
410
- key: `${t.id}row`
412
+ key: t.id + "row"
411
413
  }, React.createElement("div", {
412
- className: styles$1.taskListCell,
413
- style: {
414
- minWidth: "40px",
415
- maxWidth: "40px"
416
- }
417
- }, React.createElement("div", {
418
- className: styles$1.taskListCheckbox
419
- }, React.createElement("input", {
420
- type: "checkbox",
421
- checked: isChecked,
422
- onChange: e => handleCheckboxChange(t.id, e.target.checked),
423
- onClick: e => e.stopPropagation()
424
- }))), React.createElement("div", {
425
414
  className: styles$1.taskListCell,
426
415
  style: {
427
416
  minWidth: parseInt(rowWidth) * 0.8,
@@ -431,11 +420,13 @@ const TaskListTableDefault = _ref => {
431
420
  }, React.createElement("div", {
432
421
  className: styles$1.taskListNameWrapper,
433
422
  style: {
434
- paddingLeft: `${t.depth * 4}px`
423
+ paddingLeft: t.depth * 4 + "px"
435
424
  }
436
425
  }, !leafTaskIds.has(t.id) ? React.createElement("div", {
437
426
  className: styles$1.taskListExpander,
438
- onClick: () => onExpanderClick(t)
427
+ onClick: function onClick() {
428
+ return onExpanderClick(t);
429
+ }
439
430
  }, expanderSymbol) : React.createElement("div", {
440
431
  className: styles$1.taskListExpanderPlaceholder
441
432
  }), React.createElement("div", {
@@ -463,7 +454,7 @@ const TaskListTableDefault = _ref => {
463
454
  }
464
455
  }, React.createElement("div", {
465
456
  className: styles$1.taskListText
466
- }, "\u00A0", toLocaleDateString(t.start, dateTimeOptions))), React.createElement("div", {
457
+ }, "\xA0", toLocaleDateString(t.start, dateTimeOptions))), React.createElement("div", {
467
458
  className: styles$1.taskListCell,
468
459
  style: {
469
460
  minWidth: parseInt(rowWidth) * 0.6,
@@ -471,38 +462,43 @@ const TaskListTableDefault = _ref => {
471
462
  }
472
463
  }, React.createElement("div", {
473
464
  className: styles$1.taskListText
474
- }, "\u00A0", toLocaleDateString(t.end, dateTimeOptions))));
465
+ }, "\xA0", toLocaleDateString(t.end, dateTimeOptions))));
475
466
  }));
476
467
  };
477
468
 
478
469
  var styles$2 = {"tooltipDefaultContainer":"_3T42e","tooltipDefaultContainerParagraph":"_29NTg","tooltipDetailsContainer":"_25P-K","tooltipDetailsContainerHidden":"_3gVAq"};
479
470
 
480
- const Tooltip = _ref => {
481
- let {
482
- task,
483
- type,
484
- rowHeight,
485
- rtl,
486
- svgContainerHeight,
487
- svgContainerWidth,
488
- scrollX,
489
- scrollY,
490
- arrowIndent,
491
- fontSize,
492
- fontFamily,
493
- headerHeight,
494
- taskListWidth,
495
- TooltipContent
496
- } = _ref;
497
- const tooltipRef = useRef(null);
498
- const [relatedY, setRelatedY] = useState(0);
499
- const [relatedX, setRelatedX] = useState(0);
500
- useEffect(() => {
471
+ var Tooltip = function Tooltip(_ref) {
472
+ var task = _ref.task,
473
+ type = _ref.type,
474
+ rowHeight = _ref.rowHeight,
475
+ rtl = _ref.rtl,
476
+ svgContainerHeight = _ref.svgContainerHeight,
477
+ svgContainerWidth = _ref.svgContainerWidth,
478
+ scrollX = _ref.scrollX,
479
+ scrollY = _ref.scrollY,
480
+ arrowIndent = _ref.arrowIndent,
481
+ fontSize = _ref.fontSize,
482
+ fontFamily = _ref.fontFamily,
483
+ headerHeight = _ref.headerHeight,
484
+ taskListWidth = _ref.taskListWidth,
485
+ TooltipContent = _ref.TooltipContent;
486
+ var tooltipRef = useRef(null);
487
+
488
+ var _useState = useState(0),
489
+ relatedY = _useState[0],
490
+ setRelatedY = _useState[1];
491
+
492
+ var _useState2 = useState(0),
493
+ relatedX = _useState2[0],
494
+ setRelatedX = _useState2[1];
495
+
496
+ useEffect(function () {
501
497
  if (tooltipRef.current) {
502
- const tooltipHeight = tooltipRef.current.offsetHeight * 1.1;
503
- const tooltipWidth = tooltipRef.current.offsetWidth * 1.1;
504
- let newRelatedY = task.index * rowHeight - scrollY + headerHeight;
505
- let newRelatedX;
498
+ var tooltipHeight = tooltipRef.current.offsetHeight * 1.1;
499
+ var tooltipWidth = tooltipRef.current.offsetWidth * 1.1;
500
+ var newRelatedY = task.index * rowHeight - scrollY + headerHeight;
501
+ var newRelatedX;
506
502
 
507
503
  if (rtl) {
508
504
  newRelatedX = task.x1 - arrowIndent * 1.5 - tooltipWidth - scrollX;
@@ -511,7 +507,7 @@ const Tooltip = _ref => {
511
507
  newRelatedX = task.x2 + arrowIndent * 1.5 - scrollX;
512
508
  }
513
509
 
514
- const tooltipLeftmostPoint = tooltipWidth + newRelatedX;
510
+ var tooltipLeftmostPoint = tooltipWidth + newRelatedX;
515
511
 
516
512
  if (tooltipLeftmostPoint > svgContainerWidth) {
517
513
  newRelatedX = svgContainerWidth - tooltipWidth;
@@ -519,10 +515,12 @@ const Tooltip = _ref => {
519
515
  }
520
516
  } else {
521
517
  newRelatedX = type == "planned" ? task.x2 + arrowIndent * 1.5 + taskListWidth - scrollX : task.actualx2 + arrowIndent * 1.5 + taskListWidth - scrollX;
522
- const tooltipLeftmostPoint = tooltipWidth + newRelatedX;
523
- const fullChartWidth = taskListWidth + svgContainerWidth;
524
518
 
525
- if (tooltipLeftmostPoint > fullChartWidth) {
519
+ var _tooltipLeftmostPoint = tooltipWidth + newRelatedX;
520
+
521
+ var fullChartWidth = taskListWidth + svgContainerWidth;
522
+
523
+ if (_tooltipLeftmostPoint > fullChartWidth) {
526
524
  newRelatedX = type == "planned" ? task.x1 + taskListWidth - arrowIndent * 1.5 - scrollX - tooltipWidth : task.actualx1 + taskListWidth - arrowIndent * 1.5 - scrollX - tooltipWidth;
527
525
  }
528
526
 
@@ -532,7 +530,7 @@ const Tooltip = _ref => {
532
530
  }
533
531
  }
534
532
 
535
- const tooltipLowerPoint = tooltipHeight + newRelatedY - scrollY;
533
+ var tooltipLowerPoint = tooltipHeight + newRelatedY - scrollY;
536
534
 
537
535
  if (tooltipLowerPoint > svgContainerHeight - scrollY) {
538
536
  newRelatedY = svgContainerHeight - tooltipHeight;
@@ -556,16 +554,14 @@ const Tooltip = _ref => {
556
554
  type: type
557
555
  }));
558
556
  };
559
- const StandardTooltipContent = _ref2 => {
560
- let {
561
- task,
562
- fontSize,
563
- fontFamily,
564
- type
565
- } = _ref2;
566
- const style = {
567
- fontSize,
568
- fontFamily
557
+ var StandardTooltipContent = function StandardTooltipContent(_ref2) {
558
+ var task = _ref2.task,
559
+ fontSize = _ref2.fontSize,
560
+ fontFamily = _ref2.fontFamily,
561
+ type = _ref2.type;
562
+ var style = {
563
+ fontSize: fontSize,
564
+ fontFamily: fontFamily
569
565
  };
570
566
  if (type == "planned") return React.createElement("div", {
571
567
  className: styles$2.tooltipDefaultContainer,
@@ -574,37 +570,35 @@ const StandardTooltipContent = _ref2 => {
574
570
  style: {
575
571
  fontSize: fontSize + 6
576
572
  }
577
- }, `${task.name}: Planned dates: `), React.createElement("b", null, `${task.start.getMonth() + 1}/${task.start.getDate()}/${task.start.getFullYear()} - ${task.end.getMonth() + 1}/${task.end.getDate()}/${task.end.getFullYear()}`), task.end.getTime() - task.start.getTime() !== 0 && React.createElement("p", {
573
+ }, task.name + ": Planned dates: "), React.createElement("b", null, task.start.getMonth() + 1 + "/" + task.start.getDate() + "/" + task.start.getFullYear() + " - " + (task.end.getMonth() + 1) + "/" + task.end.getDate() + "/" + task.end.getFullYear()), task.end.getTime() - task.start.getTime() !== 0 && React.createElement("p", {
578
574
  className: styles$2.tooltipDefaultContainerParagraph
579
- }, `Duration: ${~~((task.end.getTime() - task.start.getTime()) / (1000 * 60 * 60 * 24))} day(s)`), React.createElement("p", {
575
+ }, "Duration: " + ~~((task.end.getTime() - task.start.getTime()) / (1000 * 60 * 60 * 24)) + " day(s)"), React.createElement("p", {
580
576
  className: styles$2.tooltipDefaultContainerParagraph
581
- }, !!task.progress && `Progress: ${task.progress} %`));else return React.createElement("div", {
577
+ }, !!task.progress && "Progress: " + task.progress + " %"));else return React.createElement("div", {
582
578
  className: styles$2.tooltipDefaultContainer,
583
579
  style: style
584
580
  }, React.createElement("b", {
585
581
  style: {
586
582
  fontSize: fontSize + 6
587
583
  }
588
- }, `${task.name}: Actual dates: `), React.createElement("b", null, `${task.actualStart.getMonth() + 1}/${task.actualStart.getDate()}/${task.actualStart.getFullYear()} - ${task.actualEnd.getMonth() + 1}/${task.actualEnd.getDate()}/${task.actualEnd.getFullYear()}`), task.actualEnd.getTime() - task.actualStart.getTime() !== 0 && React.createElement("p", {
584
+ }, task.name + ": Actual dates: "), React.createElement("b", null, task.actualStart.getMonth() + 1 + "/" + task.actualStart.getDate() + "/" + task.actualStart.getFullYear() + " - " + (task.actualEnd.getMonth() + 1) + "/" + task.actualEnd.getDate() + "/" + task.actualEnd.getFullYear()), task.actualEnd.getTime() - task.actualStart.getTime() !== 0 && React.createElement("p", {
589
585
  className: styles$2.tooltipDefaultContainerParagraph
590
- }, `Duration: ${~~((task.actualEnd.getTime() - task.actualStart.getTime()) / (1000 * 60 * 60 * 24))} day(s)`), React.createElement("p", {
586
+ }, "Duration: " + ~~((task.actualEnd.getTime() - task.actualStart.getTime()) / (1000 * 60 * 60 * 24)) + " day(s)"), React.createElement("p", {
591
587
  className: styles$2.tooltipDefaultContainerParagraph
592
- }, !!task.progress && `Progress: ${task.progress} %`));
588
+ }, !!task.progress && "Progress: " + task.progress + " %"));
593
589
  };
594
590
 
595
591
  var styles$3 = {"scroll":"_1eT-t"};
596
592
 
597
- const VerticalScroll = _ref => {
598
- let {
599
- scroll,
600
- ganttHeight,
601
- ganttFullHeight,
602
- headerHeight,
603
- rtl,
604
- onScroll
605
- } = _ref;
606
- const scrollRef = useRef(null);
607
- useEffect(() => {
593
+ var VerticalScroll = function VerticalScroll(_ref) {
594
+ var scroll = _ref.scroll,
595
+ ganttHeight = _ref.ganttHeight,
596
+ ganttFullHeight = _ref.ganttFullHeight,
597
+ headerHeight = _ref.headerHeight,
598
+ rtl = _ref.rtl,
599
+ onScroll = _ref.onScroll;
600
+ var scrollRef = useRef(null);
601
+ useEffect(function () {
608
602
  if (scrollRef.current) {
609
603
  scrollRef.current.scrollTop = scroll;
610
604
  }
@@ -627,56 +621,52 @@ const VerticalScroll = _ref => {
627
621
  }));
628
622
  };
629
623
 
630
- const TaskList = _ref => {
631
- let {
632
- headerHeight,
633
- fontFamily,
634
- fontSize,
635
- rowWidth,
636
- rowHeight,
637
- scrollY,
638
- tasks,
639
- leafTasks,
640
- selectedTask,
641
- setSelectedTask,
642
- onExpanderClick,
643
- locale,
644
- ganttHeight,
645
- taskListRef,
646
- horizontalContainerClass,
647
- TaskListHeader,
648
- TaskListTable,
649
- taskLabelRenderer,
650
- selectedTaskIds,
651
- onTaskSelectionChange
652
- } = _ref;
653
- const horizontalContainerRef = useRef(null);
654
- useEffect(() => {
624
+ var TaskList = function TaskList(_ref) {
625
+ var headerHeight = _ref.headerHeight,
626
+ fontFamily = _ref.fontFamily,
627
+ fontSize = _ref.fontSize,
628
+ rowWidth = _ref.rowWidth,
629
+ rowHeight = _ref.rowHeight,
630
+ scrollY = _ref.scrollY,
631
+ tasks = _ref.tasks,
632
+ scheduleType = _ref.scheduleType,
633
+ leafTasks = _ref.leafTasks,
634
+ selectedTask = _ref.selectedTask,
635
+ setSelectedTask = _ref.setSelectedTask,
636
+ onExpanderClick = _ref.onExpanderClick,
637
+ locale = _ref.locale,
638
+ ganttHeight = _ref.ganttHeight,
639
+ taskListRef = _ref.taskListRef,
640
+ horizontalContainerClass = _ref.horizontalContainerClass,
641
+ TaskListHeader = _ref.TaskListHeader,
642
+ TaskListTable = _ref.TaskListTable,
643
+ taskLabelRenderer = _ref.taskLabelRenderer;
644
+ var horizontalContainerRef = useRef(null);
645
+ useEffect(function () {
655
646
  if (horizontalContainerRef.current) {
656
647
  horizontalContainerRef.current.scrollTop = scrollY;
657
648
  }
658
649
  }, [scrollY]);
659
- const headerProps = {
660
- headerHeight,
661
- fontFamily,
662
- fontSize,
663
- rowWidth
650
+ var headerProps = {
651
+ headerHeight: headerHeight,
652
+ fontFamily: fontFamily,
653
+ fontSize: fontSize,
654
+ rowWidth: rowWidth
664
655
  };
665
- const selectedTaskId = selectedTask ? selectedTask.id : "";
666
- const tableProps = {
667
- rowHeight,
668
- rowWidth,
669
- fontFamily,
670
- fontSize,
671
- tasks,
672
- leafTasks,
673
- locale,
656
+ var selectedTaskId = selectedTask ? selectedTask.id : "";
657
+ var tableProps = {
658
+ rowHeight: rowHeight,
659
+ rowWidth: rowWidth,
660
+ fontFamily: fontFamily,
661
+ fontSize: fontSize,
662
+ tasks: tasks,
663
+ leafTasks: leafTasks,
664
+ scheduleType: scheduleType,
665
+ locale: locale,
674
666
  selectedTaskId: selectedTaskId,
675
- setSelectedTask,
676
- onExpanderClick,
677
- taskLabelRenderer,
678
- selectedTaskIds,
679
- onTaskSelectionChange
667
+ setSelectedTask: setSelectedTask,
668
+ onExpanderClick: onExpanderClick,
669
+ taskLabelRenderer: taskLabelRenderer
680
670
  };
681
671
  return React.createElement("div", {
682
672
  ref: taskListRef
@@ -689,21 +679,21 @@ const TaskList = _ref => {
689
679
  }, React.createElement(TaskListTable, Object.assign({}, tableProps))));
690
680
  };
691
681
 
692
- var styles$4 = {"gridRow":"_2dZTy","gridRowLine":"_3rUKi","gridTick":"_RuwuK","darkerGridRow":"_2M-tt"};
693
-
694
- const GridBody = _ref => {
695
- let {
696
- tasks,
697
- dates,
698
- rowHeight,
699
- svgWidth,
700
- columnWidth,
701
- todayColor,
702
- rtl
703
- } = _ref;
704
- let y = 0;
705
- const gridRows = [];
706
- const rowLines = [React.createElement("line", {
682
+ var styles$4 = {"gridRow":"_2dZTy","gridRowLookAhead":"_2RRca","gridRowLine":"_3rUKi","gridTick":"_RuwuK","darkerGridRow":"_2M-tt"};
683
+
684
+ var GridBody = function GridBody(_ref) {
685
+ var tasks = _ref.tasks,
686
+ scheduleType = _ref.scheduleType,
687
+ dates = _ref.dates,
688
+ rowHeight = _ref.rowHeight,
689
+ svgWidth = _ref.svgWidth,
690
+ columnWidth = _ref.columnWidth,
691
+ todayColor = _ref.todayColor,
692
+ weekendColor = _ref.weekendColor,
693
+ rtl = _ref.rtl;
694
+ var y = 0;
695
+ var gridRows = [];
696
+ var rowLines = [React.createElement("line", {
707
697
  key: "RowLineFirst",
708
698
  x: "0",
709
699
  y1: 0,
@@ -712,15 +702,16 @@ const GridBody = _ref => {
712
702
  className: styles$4.gridRowLine
713
703
  })];
714
704
 
715
- for (const task of tasks) {
716
- const isDarkerRow = task.type === "milestone";
705
+ for (var _iterator = _createForOfIteratorHelperLoose(tasks), _step; !(_step = _iterator()).done;) {
706
+ var task = _step.value;
707
+ var isDarkerRow = task.type === "milestone";
717
708
  gridRows.push(React.createElement("rect", {
718
709
  key: "Row" + task.id,
719
710
  x: "0",
720
711
  y: y,
721
712
  width: svgWidth,
722
713
  height: rowHeight,
723
- className: isDarkerRow ? styles$4.darkerGridRow : styles$4.gridRow
714
+ className: isDarkerRow ? styles$4.darkerGridRow : scheduleType === "lookAhead" ? styles$4.gridRowLookAhead : styles$4.gridRow
724
715
  }));
725
716
  rowLines.push(React.createElement("line", {
726
717
  key: "RowLine" + task.id,
@@ -733,13 +724,14 @@ const GridBody = _ref => {
733
724
  y += rowHeight;
734
725
  }
735
726
 
736
- const now = new Date();
737
- let tickX = 0;
738
- const ticks = [];
739
- let today = React.createElement("rect", null);
727
+ var now = new Date();
728
+ var tickX = 0;
729
+ var ticks = [];
730
+ var today = React.createElement("rect", null);
731
+ var weekend = [];
740
732
 
741
- for (let i = 0; i < dates.length; i++) {
742
- const date = dates[i];
733
+ for (var i = 0; i < dates.length; i++) {
734
+ var date = dates[i];
743
735
  ticks.push(React.createElement("line", {
744
736
  key: date.getTime(),
745
737
  x1: tickX,
@@ -759,6 +751,16 @@ const GridBody = _ref => {
759
751
  });
760
752
  }
761
753
 
754
+ if (date.getDay() === 6 || date.getDay() === 0) {
755
+ weekend.push(React.createElement("rect", {
756
+ x: tickX,
757
+ y: 0,
758
+ width: columnWidth,
759
+ height: y,
760
+ fill: weekendColor
761
+ }));
762
+ }
763
+
762
764
  if (rtl && i + 1 !== dates.length && date.getTime() >= now.getTime() && dates[i + 1].getTime() < now.getTime()) {
763
765
  today = React.createElement("rect", {
764
766
  x: tickX + columnWidth,
@@ -780,12 +782,14 @@ const GridBody = _ref => {
780
782
  className: "rowLines"
781
783
  }, rowLines), React.createElement("g", {
782
784
  className: "ticks"
783
- }, ticks), React.createElement("g", {
785
+ }, ticks), scheduleType === "lookAhead" && React.createElement("g", {
786
+ className: "weekend"
787
+ }, weekend), React.createElement("g", {
784
788
  className: "today"
785
789
  }, today));
786
790
  };
787
791
 
788
- const Grid = props => {
792
+ var Grid = function Grid(props) {
789
793
  return React.createElement("g", {
790
794
  className: "grid"
791
795
  }, React.createElement(GridBody, Object.assign({}, props)));
@@ -793,17 +797,16 @@ const Grid = props => {
793
797
 
794
798
  var styles$5 = {"calendarBottomText":"_9w8d5","calendarTopTick":"_1rLuZ","calendarTopText":"_2q1Kt","calendarHeader":"_35nLX","textAnchorStart":"_2Shd-","textAnchorMiddle":"_2XXW4","textAnchorEnd":"_3GdnC"};
795
799
 
796
- const TopPartOfCalendar = _ref => {
797
- let {
798
- value,
799
- x1Line,
800
- y1Line,
801
- y2Line,
802
- xText,
803
- yText,
804
- textAnchor = "middle"
805
- } = _ref;
806
- const textAnchorClass = textAnchor === "start" ? styles$5.textAnchorStart : textAnchor === "middle" ? styles$5.textAnchorMiddle : styles$5.textAnchorEnd;
800
+ var TopPartOfCalendar = function TopPartOfCalendar(_ref) {
801
+ var value = _ref.value,
802
+ x1Line = _ref.x1Line,
803
+ y1Line = _ref.y1Line,
804
+ y2Line = _ref.y2Line,
805
+ xText = _ref.xText,
806
+ yText = _ref.yText,
807
+ _ref$textAnchor = _ref.textAnchor,
808
+ textAnchor = _ref$textAnchor === void 0 ? "middle" : _ref$textAnchor;
809
+ var textAnchorClass = textAnchor === "start" ? styles$5.textAnchorStart : textAnchor === "middle" ? styles$5.textAnchorMiddle : styles$5.textAnchorEnd;
807
810
  return React.createElement("g", {
808
811
  className: "calendarTop"
809
812
  }, React.createElement("line", {
@@ -817,30 +820,28 @@ const TopPartOfCalendar = _ref => {
817
820
  key: value + "text",
818
821
  y: yText,
819
822
  x: xText,
820
- className: `${styles$5.calendarTopText} ${textAnchorClass}`
823
+ className: styles$5.calendarTopText + " " + textAnchorClass
821
824
  }, value));
822
825
  };
823
826
 
824
- const Calendar = _ref => {
825
- let {
826
- dateSetup,
827
- locale,
828
- viewMode,
829
- rtl,
830
- headerHeight,
831
- columnWidth,
832
- fontFamily,
833
- fontSize
834
- } = _ref;
835
-
836
- const getCalendarValuesForYear = () => {
837
- const topValues = [];
838
- const bottomValues = [];
839
- const topDefaultHeight = headerHeight * 0.5;
840
-
841
- for (let i = 0; i < dateSetup.dates.length; i++) {
842
- const date = dateSetup.dates[i];
843
- const bottomValue = date.getFullYear();
827
+ var Calendar = function Calendar(_ref) {
828
+ var dateSetup = _ref.dateSetup,
829
+ locale = _ref.locale,
830
+ viewMode = _ref.viewMode,
831
+ rtl = _ref.rtl,
832
+ headerHeight = _ref.headerHeight,
833
+ columnWidth = _ref.columnWidth,
834
+ fontFamily = _ref.fontFamily,
835
+ fontSize = _ref.fontSize;
836
+
837
+ var getCalendarValuesForYear = function getCalendarValuesForYear() {
838
+ var topValues = [];
839
+ var bottomValues = [];
840
+ var topDefaultHeight = headerHeight * 0.5;
841
+
842
+ for (var i = 0; i < dateSetup.dates.length; i++) {
843
+ var date = dateSetup.dates[i];
844
+ var bottomValue = date.getFullYear();
844
845
  bottomValues.push(React.createElement("text", {
845
846
  key: date.getFullYear(),
846
847
  y: headerHeight * 0.8,
@@ -849,8 +850,8 @@ const Calendar = _ref => {
849
850
  }, bottomValue));
850
851
 
851
852
  if (i === 0 || date.getFullYear() !== dateSetup.dates[i - 1].getFullYear()) {
852
- const topValue = date.getFullYear().toString();
853
- let xText;
853
+ var topValue = date.getFullYear().toString();
854
+ var xText = void 0;
854
855
 
855
856
  if (rtl) {
856
857
  xText = (6 + i + date.getFullYear() + 1) * columnWidth;
@@ -873,25 +874,25 @@ const Calendar = _ref => {
873
874
  return [topValues, bottomValues];
874
875
  };
875
876
 
876
- const getCalendarValuesForQuarter = () => {
877
- const topValues = [];
878
- const bottomValues = [];
879
- const topDefaultHeight = headerHeight * 0.5;
877
+ var getCalendarValuesForQuarter = function getCalendarValuesForQuarter() {
878
+ var topValues = [];
879
+ var bottomValues = [];
880
+ var topDefaultHeight = headerHeight * 0.5;
880
881
 
881
- for (let i = 0; i < dateSetup.dates.length; i++) {
882
- const date = dateSetup.dates[i];
883
- const quarter = Math.floor(date.getMonth() / 3) + 1;
884
- const bottomValue = `Q${quarter}`;
882
+ for (var i = 0; i < dateSetup.dates.length; i++) {
883
+ var date = dateSetup.dates[i];
884
+ var quarter = Math.floor(date.getMonth() / 3) + 1;
885
+ var bottomValue = "Q" + quarter;
885
886
  bottomValues.push(React.createElement("text", {
886
- key: `${bottomValue}-${date.getFullYear()}`,
887
+ key: bottomValue + "-" + date.getFullYear(),
887
888
  y: headerHeight * 0.8,
888
889
  x: columnWidth * i + columnWidth * 0.5,
889
890
  className: styles$5.calendarBottomText
890
891
  }, bottomValue));
891
892
 
892
893
  if (i === 0 || date.getFullYear() !== dateSetup.dates[i - 1].getFullYear()) {
893
- const topValue = date.getFullYear().toString();
894
- let xText;
894
+ var topValue = date.getFullYear().toString();
895
+ var xText = void 0;
895
896
 
896
897
  if (rtl) {
897
898
  xText = (3 + i + quarter) * columnWidth;
@@ -914,26 +915,26 @@ const Calendar = _ref => {
914
915
  return [topValues, bottomValues];
915
916
  };
916
917
 
917
- const getCalendarValuesForMonth = () => {
918
- const topValues = [];
919
- const bottomValues = [];
920
- const topDefaultHeight = headerHeight * 0.5;
918
+ var getCalendarValuesForMonth = function getCalendarValuesForMonth() {
919
+ var topValues = [];
920
+ var bottomValues = [];
921
+ var topDefaultHeight = headerHeight * 0.5;
921
922
 
922
- for (let i = 0; i < dateSetup.dates.length; i++) {
923
- const date = dateSetup.dates[i];
924
- const bottomValue = date.toLocaleString(locale, {
923
+ for (var i = 0; i < dateSetup.dates.length; i++) {
924
+ var date = dateSetup.dates[i];
925
+ var bottomValue = date.toLocaleString(locale, {
925
926
  month: "short"
926
927
  });
927
928
  bottomValues.push(React.createElement("text", {
928
929
  key: bottomValue + date.getFullYear(),
929
930
  y: headerHeight * 0.8,
930
931
  x: columnWidth * i + columnWidth * 0.5,
931
- className: `${styles$5.calendarTopText} ${styles$5.textAnchorEnd}`
932
+ className: styles$5.calendarTopText + " " + styles$5.textAnchorEnd
932
933
  }, bottomValue));
933
934
 
934
935
  if (i === 0 || date.getFullYear() !== dateSetup.dates[i - 1].getFullYear()) {
935
- const topValue = date.getFullYear().toString();
936
- let xText;
936
+ var topValue = date.getFullYear().toString();
937
+ var xText = void 0;
937
938
 
938
939
  if (rtl) {
939
940
  xText = (6 + i + date.getMonth() + 1) * columnWidth;
@@ -958,27 +959,27 @@ const Calendar = _ref => {
958
959
  return [topValues, bottomValues];
959
960
  };
960
961
 
961
- const getCalendarValuesForWeek = () => {
962
- const topValues = [];
963
- const bottomValues = [];
964
- let weeksCount = 1;
965
- const topDefaultHeight = headerHeight * 0.5;
966
- const dates = dateSetup.dates;
962
+ var getCalendarValuesForWeek = function getCalendarValuesForWeek() {
963
+ var topValues = [];
964
+ var bottomValues = [];
965
+ var weeksCount = 1;
966
+ var topDefaultHeight = headerHeight * 0.5;
967
+ var dates = dateSetup.dates;
967
968
 
968
- for (let i = dates.length - 1; i >= 0; i--) {
969
- const date = dates[i];
970
- let topValue = "";
969
+ for (var i = dates.length - 1; i >= 0; i--) {
970
+ var date = dates[i];
971
+ var topValue = "";
971
972
 
972
973
  if (i === 0 || date.getMonth() !== dates[i - 1].getMonth()) {
973
- topValue = `${getLocaleMonth(date, locale)}, ${date.getFullYear()}`;
974
+ topValue = getLocaleMonth(date, locale) + ", " + date.getFullYear();
974
975
  }
975
976
 
976
- const bottomValue = `W${getWeekNumberISO8601(date)}`;
977
+ var bottomValue = "W" + getWeekNumberISO8601(date);
977
978
  bottomValues.push(React.createElement("text", {
978
979
  key: date.getTime(),
979
980
  y: headerHeight * 0.8,
980
981
  x: columnWidth * (i + +rtl),
981
- className: `${styles$5.calendarTopText} ${styles$5.textAnchorStart}`
982
+ className: styles$5.calendarTopText + " " + styles$5.textAnchorStart
982
983
  }, bottomValue));
983
984
 
984
985
  if (topValue) {
@@ -1004,24 +1005,24 @@ const Calendar = _ref => {
1004
1005
  return [topValues, bottomValues];
1005
1006
  };
1006
1007
 
1007
- const getCalendarValuesForDay = () => {
1008
- const topValues = [];
1009
- const bottomValues = [];
1010
- const topDefaultHeight = headerHeight * 0.5;
1011
- const dates = dateSetup.dates;
1008
+ var getCalendarValuesForDay = function getCalendarValuesForDay() {
1009
+ var topValues = [];
1010
+ var bottomValues = [];
1011
+ var topDefaultHeight = headerHeight * 0.5;
1012
+ var dates = dateSetup.dates;
1012
1013
 
1013
- for (let i = 0; i < dates.length; i++) {
1014
- const date = dates[i];
1015
- const bottomValue = `${getLocalDayOfWeek(date, locale, "short")}, ${date.getDate().toString()}`;
1014
+ for (var i = 0; i < dates.length; i++) {
1015
+ var date = dates[i];
1016
+ var bottomValue = getLocalDayOfWeek(date, locale, "short") + ", " + date.getDate().toString();
1016
1017
  bottomValues.push(React.createElement("text", {
1017
1018
  key: date.getTime(),
1018
1019
  y: headerHeight * 0.8,
1019
1020
  x: columnWidth * i + columnWidth * 0.5,
1020
- className: `${styles$5.calendarTopText} ${styles$5.textAnchorMiddle}`
1021
+ className: styles$5.calendarTopText + " " + styles$5.textAnchorMiddle
1021
1022
  }, bottomValue));
1022
1023
 
1023
1024
  if (i + 1 !== dates.length && date.getMonth() !== dates[i + 1].getMonth()) {
1024
- const topValue = `${getLocaleMonth(date, locale)} ${date.getFullYear()}`;
1025
+ var topValue = getLocaleMonth(date, locale) + " " + date.getFullYear();
1025
1026
  topValues.push(React.createElement(TopPartOfCalendar, {
1026
1027
  key: topValue + date.getFullYear(),
1027
1028
  value: topValue,
@@ -1037,28 +1038,28 @@ const Calendar = _ref => {
1037
1038
  return [topValues, bottomValues];
1038
1039
  };
1039
1040
 
1040
- const getCalendarValuesForPartOfDay = () => {
1041
- const topValues = [];
1042
- const bottomValues = [];
1043
- const ticks = viewMode === ViewMode.HalfDay ? 2 : 4;
1044
- const topDefaultHeight = headerHeight * 0.5;
1045
- const dates = dateSetup.dates;
1041
+ var getCalendarValuesForPartOfDay = function getCalendarValuesForPartOfDay() {
1042
+ var topValues = [];
1043
+ var bottomValues = [];
1044
+ var ticks = viewMode === ViewMode.HalfDay ? 2 : 4;
1045
+ var topDefaultHeight = headerHeight * 0.5;
1046
+ var dates = dateSetup.dates;
1046
1047
 
1047
- for (let i = 0; i < dates.length; i++) {
1048
- const date = dates[i];
1049
- const bottomValue = getCachedDateTimeFormat(locale, {
1048
+ for (var i = 0; i < dates.length; i++) {
1049
+ var date = dates[i];
1050
+ var bottomValue = getCachedDateTimeFormat(locale, {
1050
1051
  hour: "numeric"
1051
1052
  }).format(date);
1052
1053
  bottomValues.push(React.createElement("text", {
1053
1054
  key: date.getTime(),
1054
1055
  y: headerHeight * 0.8,
1055
1056
  x: columnWidth * (i + +rtl),
1056
- className: `${styles$5.calendarTopText} ${styles$5.textAnchorMiddle}`,
1057
+ className: styles$5.calendarTopText + " " + styles$5.textAnchorMiddle,
1057
1058
  fontFamily: fontFamily
1058
1059
  }, bottomValue));
1059
1060
 
1060
1061
  if (i === 0 || date.getDate() !== dates[i - 1].getDate()) {
1061
- const topValue = `${getLocalDayOfWeek(date, locale, "short")}, ${date.getDate()} ${getLocaleMonth(date, locale)}`;
1062
+ var topValue = getLocalDayOfWeek(date, locale, "short") + ", " + date.getDate() + " " + getLocaleMonth(date, locale);
1062
1063
  topValues.push(React.createElement(TopPartOfCalendar, {
1063
1064
  key: topValue + date.getFullYear(),
1064
1065
  value: topValue,
@@ -1074,15 +1075,15 @@ const Calendar = _ref => {
1074
1075
  return [topValues, bottomValues];
1075
1076
  };
1076
1077
 
1077
- const getCalendarValuesForHour = () => {
1078
- const topValues = [];
1079
- const bottomValues = [];
1080
- const topDefaultHeight = headerHeight * 0.5;
1081
- const dates = dateSetup.dates;
1078
+ var getCalendarValuesForHour = function getCalendarValuesForHour() {
1079
+ var topValues = [];
1080
+ var bottomValues = [];
1081
+ var topDefaultHeight = headerHeight * 0.5;
1082
+ var dates = dateSetup.dates;
1082
1083
 
1083
- for (let i = 0; i < dates.length; i++) {
1084
- const date = dates[i];
1085
- const bottomValue = getCachedDateTimeFormat(locale, {
1084
+ for (var i = 0; i < dates.length; i++) {
1085
+ var date = dates[i];
1086
+ var bottomValue = getCachedDateTimeFormat(locale, {
1086
1087
  hour: "numeric"
1087
1088
  }).format(date);
1088
1089
  bottomValues.push(React.createElement("text", {
@@ -1094,9 +1095,9 @@ const Calendar = _ref => {
1094
1095
  }, bottomValue));
1095
1096
 
1096
1097
  if (i !== 0 && date.getDate() !== dates[i - 1].getDate()) {
1097
- const displayDate = dates[i - 1];
1098
- const topValue = `${getLocalDayOfWeek(displayDate, locale, "long")}, ${displayDate.getDate()} ${getLocaleMonth(displayDate, locale)}`;
1099
- const topPosition = (date.getHours() - 24) / 2;
1098
+ var displayDate = dates[i - 1];
1099
+ var topValue = getLocalDayOfWeek(displayDate, locale, "long") + ", " + displayDate.getDate() + " " + getLocaleMonth(displayDate, locale);
1100
+ var topPosition = (date.getHours() - 24) / 2;
1100
1101
  topValues.push(React.createElement(TopPartOfCalendar, {
1101
1102
  key: topValue + displayDate.getFullYear(),
1102
1103
  value: topValue,
@@ -1112,37 +1113,58 @@ const Calendar = _ref => {
1112
1113
  return [topValues, bottomValues];
1113
1114
  };
1114
1115
 
1115
- let topValues = [];
1116
- let bottomValues = [];
1116
+ var topValues = [];
1117
+ var bottomValues = [];
1117
1118
 
1118
1119
  switch (dateSetup.viewMode) {
1119
1120
  case ViewMode.Year:
1120
- [topValues, bottomValues] = getCalendarValuesForYear();
1121
+ var _getCalendarValuesFor = getCalendarValuesForYear();
1122
+
1123
+ topValues = _getCalendarValuesFor[0];
1124
+ bottomValues = _getCalendarValuesFor[1];
1121
1125
  break;
1122
1126
 
1123
1127
  case ViewMode.Quarter:
1124
- [topValues, bottomValues] = getCalendarValuesForQuarter();
1128
+ var _getCalendarValuesFor2 = getCalendarValuesForQuarter();
1129
+
1130
+ topValues = _getCalendarValuesFor2[0];
1131
+ bottomValues = _getCalendarValuesFor2[1];
1125
1132
  break;
1126
1133
 
1127
1134
  case ViewMode.Month:
1128
- [topValues, bottomValues] = getCalendarValuesForMonth();
1135
+ var _getCalendarValuesFor3 = getCalendarValuesForMonth();
1136
+
1137
+ topValues = _getCalendarValuesFor3[0];
1138
+ bottomValues = _getCalendarValuesFor3[1];
1129
1139
  break;
1130
1140
 
1131
1141
  case ViewMode.Week:
1132
- [topValues, bottomValues] = getCalendarValuesForWeek();
1142
+ var _getCalendarValuesFor4 = getCalendarValuesForWeek();
1143
+
1144
+ topValues = _getCalendarValuesFor4[0];
1145
+ bottomValues = _getCalendarValuesFor4[1];
1133
1146
  break;
1134
1147
 
1135
1148
  case ViewMode.Day:
1136
- [topValues, bottomValues] = getCalendarValuesForDay();
1149
+ var _getCalendarValuesFor5 = getCalendarValuesForDay();
1150
+
1151
+ topValues = _getCalendarValuesFor5[0];
1152
+ bottomValues = _getCalendarValuesFor5[1];
1137
1153
  break;
1138
1154
 
1139
1155
  case ViewMode.QuarterDay:
1140
1156
  case ViewMode.HalfDay:
1141
- [topValues, bottomValues] = getCalendarValuesForPartOfDay();
1157
+ var _getCalendarValuesFor6 = getCalendarValuesForPartOfDay();
1158
+
1159
+ topValues = _getCalendarValuesFor6[0];
1160
+ bottomValues = _getCalendarValuesFor6[1];
1142
1161
  break;
1143
1162
 
1144
1163
  case ViewMode.Hour:
1145
- [topValues, bottomValues] = getCalendarValuesForHour();
1164
+ var _getCalendarValuesFor7 = getCalendarValuesForHour();
1165
+
1166
+ topValues = _getCalendarValuesFor7[0];
1167
+ bottomValues = _getCalendarValuesFor7[1];
1146
1168
  }
1147
1169
 
1148
1170
  return React.createElement("g", {
@@ -1178,23 +1200,27 @@ function _catch(body, recover) {
1178
1200
  return result;
1179
1201
  }
1180
1202
 
1181
- const Arrow = _ref => {
1182
- let {
1183
- taskFrom,
1184
- taskTo,
1185
- rowHeight,
1186
- taskHeight,
1187
- arrowIndent,
1188
- rtl,
1189
- arrowColor
1190
- } = _ref;
1191
- let path;
1192
- let trianglePoints;
1203
+ var Arrow = function Arrow(_ref) {
1204
+ var taskFrom = _ref.taskFrom,
1205
+ taskTo = _ref.taskTo,
1206
+ rowHeight = _ref.rowHeight,
1207
+ taskHeight = _ref.taskHeight,
1208
+ arrowIndent = _ref.arrowIndent,
1209
+ rtl = _ref.rtl,
1210
+ arrowColor = _ref.arrowColor;
1211
+ var path;
1212
+ var trianglePoints;
1193
1213
 
1194
1214
  if (rtl) {
1195
- [path, trianglePoints] = drownPathAndTriangleRTL(taskFrom, taskTo, rowHeight, taskHeight, arrowIndent);
1215
+ var _drownPathAndTriangle = drownPathAndTriangleRTL(taskFrom, taskTo, rowHeight, taskHeight, arrowIndent);
1216
+
1217
+ path = _drownPathAndTriangle[0];
1218
+ trianglePoints = _drownPathAndTriangle[1];
1196
1219
  } else {
1197
- [path, trianglePoints] = drownPathAndTriangle(taskFrom, taskTo, rowHeight, taskHeight, arrowIndent);
1220
+ var _drownPathAndTriangle2 = drownPathAndTriangle(taskFrom, taskTo, rowHeight, taskHeight, arrowIndent);
1221
+
1222
+ path = _drownPathAndTriangle2[0];
1223
+ trianglePoints = _drownPathAndTriangle2[1];
1198
1224
  }
1199
1225
 
1200
1226
  return React.createElement("g", {
@@ -1210,8 +1236,8 @@ const Arrow = _ref => {
1210
1236
  }));
1211
1237
  };
1212
1238
 
1213
- const drownPathAndTriangle = (taskFrom, taskTo, rowHeight, taskHeight, arrowIndent) => {
1214
- let taskToStart, taskFromEnd;
1239
+ var drownPathAndTriangle = function drownPathAndTriangle(taskFrom, taskTo, rowHeight, taskHeight, arrowIndent) {
1240
+ var taskToStart, taskFromEnd;
1215
1241
 
1216
1242
  if (taskTo.x1 > 0 && taskTo.actualx1 > 0) {
1217
1243
  taskToStart = Math.min(taskTo.x1, taskTo.actualx1);
@@ -1221,51 +1247,43 @@ const drownPathAndTriangle = (taskFrom, taskTo, rowHeight, taskHeight, arrowInde
1221
1247
  taskFromEnd = Math.max(taskFrom.x2, taskFrom.actualx2);
1222
1248
  } else if (taskFrom.x2 > 0) taskFromEnd = taskFrom.x2;else if (taskFrom.actualx2 > 0) taskFromEnd = taskFrom.actualx2;else taskFromEnd = 0;
1223
1249
 
1224
- const indexCompare = taskFrom.index > taskTo.index ? -1 : 1;
1225
- const taskToEndPosition = taskTo.y + taskHeight / 2;
1226
- const taskFromEndPosition = taskFromEnd + arrowIndent * 2;
1227
- const taskFromHorizontalOffsetValue = taskFromEndPosition < taskToStart ? "" : `H ${taskToStart - arrowIndent}`;
1228
- const taskToHorizontalOffsetValue = taskFromEndPosition > taskToStart ? arrowIndent : taskToStart - taskFromEnd - arrowIndent;
1229
- const path = `M ${taskFromEnd} ${taskFrom.y + taskHeight / 2}
1230
- h ${arrowIndent}
1231
- v ${indexCompare * rowHeight / 2}
1232
- ${taskFromHorizontalOffsetValue}
1233
- V ${taskToEndPosition}
1234
- h ${taskToHorizontalOffsetValue}`;
1235
- const trianglePoints = `${taskToStart},${taskToEndPosition}
1236
- ${taskToStart - 5},${taskToEndPosition - 5}
1237
- ${taskToStart - 5},${taskToEndPosition + 5}`;
1250
+ var indexCompare = taskFrom.index > taskTo.index ? -1 : 1;
1251
+ var taskToEndPosition = taskTo.y + taskHeight / 2;
1252
+ var taskFromEndPosition = taskFromEnd + arrowIndent * 2;
1253
+ var taskFromHorizontalOffsetValue = taskFromEndPosition < taskToStart ? "" : "H " + (taskToStart - arrowIndent);
1254
+ var taskToHorizontalOffsetValue = taskFromEndPosition > taskToStart ? arrowIndent : taskToStart - taskFromEnd - arrowIndent;
1255
+ var path = "M " + taskFromEnd + " " + (taskFrom.y + taskHeight / 2) + " \n h " + arrowIndent + " \n v " + indexCompare * rowHeight / 2 + " \n " + taskFromHorizontalOffsetValue + "\n V " + taskToEndPosition + " \n h " + taskToHorizontalOffsetValue;
1256
+ var trianglePoints = taskToStart + "," + taskToEndPosition + " \n " + (taskToStart - 5) + "," + (taskToEndPosition - 5) + " \n " + (taskToStart - 5) + "," + (taskToEndPosition + 5);
1238
1257
  return [path, trianglePoints];
1239
1258
  };
1240
1259
 
1241
- const drownPathAndTriangleRTL = (taskFrom, taskTo, rowHeight, taskHeight, arrowIndent) => {
1242
- const indexCompare = taskFrom.index > taskTo.index ? -1 : 1;
1243
- const taskToEndPosition = taskTo.y + taskHeight / 2;
1244
- const taskFromEndPosition = taskFrom.x1 - arrowIndent * 2;
1245
- const taskFromHorizontalOffsetValue = taskFromEndPosition > taskTo.x2 ? "" : `H ${taskTo.x2 + arrowIndent}`;
1246
- const taskToHorizontalOffsetValue = taskFromEndPosition < taskTo.x2 ? -arrowIndent : taskTo.x2 - taskFrom.x1 + arrowIndent;
1247
- const path = `M ${taskFrom.x1} ${taskFrom.y + taskHeight / 2}
1248
- h ${-arrowIndent}
1249
- v ${indexCompare * rowHeight / 2}
1250
- ${taskFromHorizontalOffsetValue}
1251
- V ${taskToEndPosition}
1252
- h ${taskToHorizontalOffsetValue}`;
1253
- const trianglePoints = `${taskTo.x2},${taskToEndPosition}
1254
- ${taskTo.x2 + 5},${taskToEndPosition + 5}
1255
- ${taskTo.x2 + 5},${taskToEndPosition - 5}`;
1260
+ var drownPathAndTriangleRTL = function drownPathAndTriangleRTL(taskFrom, taskTo, rowHeight, taskHeight, arrowIndent) {
1261
+ var indexCompare = taskFrom.index > taskTo.index ? -1 : 1;
1262
+ var taskToEndPosition = taskTo.y + taskHeight / 2;
1263
+ var taskFromEndPosition = taskFrom.x1 - arrowIndent * 2;
1264
+ var taskFromHorizontalOffsetValue = taskFromEndPosition > taskTo.x2 ? "" : "H " + (taskTo.x2 + arrowIndent);
1265
+ var taskToHorizontalOffsetValue = taskFromEndPosition < taskTo.x2 ? -arrowIndent : taskTo.x2 - taskFrom.x1 + arrowIndent;
1266
+ 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;
1267
+ var trianglePoints = taskTo.x2 + "," + taskToEndPosition + " \n " + (taskTo.x2 + 5) + "," + (taskToEndPosition + 5) + " \n " + (taskTo.x2 + 5) + "," + (taskToEndPosition - 5);
1256
1268
  return [path, trianglePoints];
1257
1269
  };
1258
1270
 
1259
- const convertToBarTasks = (tasks, dates, columnWidth, rowHeight, taskHeight, barCornerRadius, handleWidth, rtl, barProgressColor, barProgressSelectedColor, barBackgroundColor, barBackgroundSelectedColor, projectProgressColor, projectProgressSelectedColor, projectBackgroundColor, projectBackgroundSelectedColor, milestoneBackgroundColor, milestoneBackgroundSelectedColor) => {
1260
- let barTasks = tasks.map((t, i) => {
1271
+ var convertToBarTasks = function convertToBarTasks(tasks, dates, columnWidth, rowHeight, taskHeight, barCornerRadius, handleWidth, rtl, barProgressColor, barProgressSelectedColor, barBackgroundColor, barBackgroundSelectedColor, projectProgressColor, projectProgressSelectedColor, projectBackgroundColor, projectBackgroundSelectedColor, milestoneBackgroundColor, milestoneBackgroundSelectedColor) {
1272
+ var barTasks = tasks.map(function (t, i) {
1261
1273
  return convertToBarTask(t, i, dates, columnWidth, rowHeight, taskHeight, barCornerRadius, handleWidth, rtl, barProgressColor, barProgressSelectedColor, barBackgroundColor, barBackgroundSelectedColor, projectProgressColor, projectProgressSelectedColor, projectBackgroundColor, projectBackgroundSelectedColor, milestoneBackgroundColor, milestoneBackgroundSelectedColor);
1262
1274
  });
1263
- barTasks = barTasks.map(task => {
1264
- const dependencies = task.dependencies || [];
1275
+ barTasks = barTasks.map(function (task) {
1276
+ var dependencies = task.dependencies || [];
1265
1277
 
1266
- for (let j = 0; j < dependencies.length; j++) {
1267
- const dependence = barTasks.findIndex(value => value.id === dependencies[j]);
1278
+ var _loop = function _loop(j) {
1279
+ var dependence = barTasks.findIndex(function (value) {
1280
+ return value.id === dependencies[j];
1281
+ });
1268
1282
  if (dependence !== -1 && task.start.getTime() > 0 && task.end.getTime() > 0) barTasks[dependence].barChildren.push(task);
1283
+ };
1284
+
1285
+ for (var j = 0; j < dependencies.length; j++) {
1286
+ _loop(j);
1269
1287
  }
1270
1288
 
1271
1289
  return task;
@@ -1273,8 +1291,8 @@ const convertToBarTasks = (tasks, dates, columnWidth, rowHeight, taskHeight, bar
1273
1291
  return barTasks;
1274
1292
  };
1275
1293
 
1276
- const convertToBarTask = (task, index, dates, columnWidth, rowHeight, taskHeight, barCornerRadius, handleWidth, rtl, barProgressColor, barProgressSelectedColor, barBackgroundColor, barBackgroundSelectedColor, projectProgressColor, projectProgressSelectedColor, projectBackgroundColor, projectBackgroundSelectedColor, milestoneBackgroundColor, milestoneBackgroundSelectedColor) => {
1277
- let barTask;
1294
+ var convertToBarTask = function convertToBarTask(task, index, dates, columnWidth, rowHeight, taskHeight, barCornerRadius, handleWidth, rtl, barProgressColor, barProgressSelectedColor, barBackgroundColor, barBackgroundSelectedColor, projectProgressColor, projectProgressSelectedColor, projectBackgroundColor, projectBackgroundSelectedColor, milestoneBackgroundColor, milestoneBackgroundSelectedColor) {
1295
+ var barTask;
1278
1296
 
1279
1297
  switch (task.type) {
1280
1298
  case "milestone":
@@ -1293,13 +1311,13 @@ const convertToBarTask = (task, index, dates, columnWidth, rowHeight, taskHeight
1293
1311
  return barTask;
1294
1312
  };
1295
1313
 
1296
- const convertToBar = (task, index, dates, columnWidth, rowHeight, taskHeight, barCornerRadius, handleWidth, rtl, barProgressColor, barProgressSelectedColor, barBackgroundColor, barBackgroundSelectedColor) => {
1297
- let x1;
1298
- let x2;
1299
- let actualx1;
1300
- let actualx2;
1301
- let progressStartWidth;
1302
- let progressEndWidth;
1314
+ var convertToBar = function convertToBar(task, index, dates, columnWidth, rowHeight, taskHeight, barCornerRadius, handleWidth, rtl, barProgressColor, barProgressSelectedColor, barBackgroundColor, barBackgroundSelectedColor) {
1315
+ var x1;
1316
+ var x2;
1317
+ var actualx1;
1318
+ var actualx2;
1319
+ var progressStartWidth;
1320
+ var progressEndWidth;
1303
1321
 
1304
1322
  if (rtl) {
1305
1323
  x2 = task.start ? taskXCoordinateRTL(task.start, dates, columnWidth) : -1;
@@ -1315,100 +1333,108 @@ const convertToBar = (task, index, dates, columnWidth, rowHeight, taskHeight, ba
1315
1333
 
1316
1334
  progressStartWidth = actualx1 && x1 ? Math.abs(actualx1 - x1) : -1;
1317
1335
  progressEndWidth = actualx2 && x2 ? Math.abs(actualx2 - x2) : -1;
1318
- let typeInternal = task.type;
1319
- const [progressWidth, progressX] = progressWithByParams(actualx1, actualx2, task.progress, rtl);
1320
- const y = taskYCoordinate(index, rowHeight, taskHeight);
1321
- const hideChildren = task.hideChildren || false;
1322
- const styles = {
1336
+ var typeInternal = task.type;
1337
+
1338
+ var _progressWithByParams = progressWithByParams(actualx1, actualx2, task.progress, rtl),
1339
+ progressWidth = _progressWithByParams[0],
1340
+ progressX = _progressWithByParams[1];
1341
+
1342
+ var y = taskYCoordinate(index, rowHeight, taskHeight);
1343
+ var hideChildren = task.hideChildren || false;
1344
+
1345
+ var styles = _extends({
1323
1346
  backgroundColor: barBackgroundColor,
1324
1347
  backgroundSelectedColor: barBackgroundSelectedColor,
1325
1348
  progressColor: barProgressColor,
1326
- progressSelectedColor: barProgressSelectedColor,
1327
- ...task.styles
1328
- };
1329
- return { ...task,
1330
- typeInternal,
1331
- x1,
1332
- x2,
1333
- actualx1,
1334
- actualx2,
1335
- progressStartWidth,
1336
- progressEndWidth,
1337
- y,
1338
- index,
1339
- progressX,
1340
- progressWidth,
1341
- barCornerRadius,
1342
- handleWidth,
1343
- hideChildren,
1349
+ progressSelectedColor: barProgressSelectedColor
1350
+ }, task.styles);
1351
+
1352
+ return _extends({}, task, {
1353
+ typeInternal: typeInternal,
1354
+ x1: x1,
1355
+ x2: x2,
1356
+ actualx1: actualx1,
1357
+ actualx2: actualx2,
1358
+ progressStartWidth: progressStartWidth,
1359
+ progressEndWidth: progressEndWidth,
1360
+ y: y,
1361
+ index: index,
1362
+ progressX: progressX,
1363
+ progressWidth: progressWidth,
1364
+ barCornerRadius: barCornerRadius,
1365
+ handleWidth: handleWidth,
1366
+ hideChildren: hideChildren,
1344
1367
  height: taskHeight,
1345
1368
  barChildren: [],
1346
- styles
1347
- };
1369
+ styles: styles
1370
+ });
1348
1371
  };
1349
1372
 
1350
- const convertToMilestone = (task, index, dates, columnWidth, rowHeight, taskHeight, barCornerRadius, handleWidth, milestoneBackgroundColor, milestoneBackgroundSelectedColor) => {
1351
- const x = task.start && task.end ? taskXCoordinate(task.start, dates, columnWidth) : 0;
1352
- const y = taskYCoordinate(index, rowHeight, taskHeight);
1353
- const x1 = task.start && task.end ? x - taskHeight * 0.5 : 0;
1354
- const x2 = task.start && task.end ? x + taskHeight * 0.5 : 0;
1355
- const rotatedHeight = taskHeight / 1.414;
1356
- const styles = {
1373
+ var convertToMilestone = function convertToMilestone(task, index, dates, columnWidth, rowHeight, taskHeight, barCornerRadius, handleWidth, milestoneBackgroundColor, milestoneBackgroundSelectedColor) {
1374
+ var x = task.start && task.end ? taskXCoordinate(task.start, dates, columnWidth) : 0;
1375
+ var y = taskYCoordinate(index, rowHeight, taskHeight);
1376
+ var x1 = task.start && task.end ? x - taskHeight * 0.5 : 0;
1377
+ var x2 = task.start && task.end ? x + taskHeight * 0.5 : 0;
1378
+ var rotatedHeight = taskHeight / 1.414;
1379
+
1380
+ var styles = _extends({
1357
1381
  backgroundColor: milestoneBackgroundColor,
1358
1382
  backgroundSelectedColor: milestoneBackgroundSelectedColor,
1359
1383
  progressColor: "",
1360
- progressSelectedColor: "",
1361
- ...task.styles
1362
- };
1363
- return { ...task,
1364
- x1,
1365
- x2,
1384
+ progressSelectedColor: ""
1385
+ }, task.styles);
1386
+
1387
+ return _extends({}, task, {
1388
+ x1: x1,
1389
+ x2: x2,
1366
1390
  actualx1: x1,
1367
1391
  actualx2: x2,
1368
1392
  progressStartWidth: 0,
1369
1393
  progressEndWidth: 0,
1370
- y,
1371
- index,
1394
+ y: y,
1395
+ index: index,
1372
1396
  progressX: 0,
1373
1397
  progressWidth: 0,
1374
- barCornerRadius,
1375
- handleWidth,
1398
+ barCornerRadius: barCornerRadius,
1399
+ handleWidth: handleWidth,
1376
1400
  typeInternal: task.type,
1377
1401
  progress: 0,
1378
1402
  height: rotatedHeight,
1379
1403
  hideChildren: undefined,
1380
1404
  barChildren: [],
1381
- styles
1382
- };
1405
+ styles: styles
1406
+ });
1383
1407
  };
1384
1408
 
1385
- const taskXCoordinate = (xDate, dates, columnWidth) => {
1386
- const index = dates.findIndex(d => d.getTime() >= xDate.getTime()) - 1;
1409
+ var taskXCoordinate = function taskXCoordinate(xDate, dates, columnWidth) {
1410
+ var index = dates.findIndex(function (d) {
1411
+ return d.getTime() >= xDate.getTime();
1412
+ }) - 1;
1387
1413
 
1388
1414
  if (index < 0) {
1389
1415
  return 0;
1390
1416
  }
1391
1417
 
1392
- const remainderMillis = xDate.getTime() - dates[index].getTime();
1393
- const percentOfInterval = remainderMillis / (dates[index + 1].getTime() - dates[index].getTime());
1394
- const x = index * columnWidth + percentOfInterval * columnWidth;
1418
+ var remainderMillis = xDate.getTime() - dates[index].getTime();
1419
+ var percentOfInterval = remainderMillis / (dates[index + 1].getTime() - dates[index].getTime());
1420
+ var x = index * columnWidth + percentOfInterval * columnWidth;
1395
1421
  return x;
1396
1422
  };
1397
1423
 
1398
- const taskXCoordinateRTL = (xDate, dates, columnWidth) => {
1399
- let x = taskXCoordinate(xDate, dates, columnWidth);
1424
+ var taskXCoordinateRTL = function taskXCoordinateRTL(xDate, dates, columnWidth) {
1425
+ var x = taskXCoordinate(xDate, dates, columnWidth);
1400
1426
  x += columnWidth;
1401
1427
  return x;
1402
1428
  };
1403
1429
 
1404
- const taskYCoordinate = (index, rowHeight, taskHeight) => {
1405
- const y = index * rowHeight + (rowHeight - taskHeight) / 2;
1430
+ var taskYCoordinate = function taskYCoordinate(index, rowHeight, taskHeight) {
1431
+ var y = index * rowHeight + (rowHeight - taskHeight) / 2;
1406
1432
  return y;
1407
1433
  };
1408
1434
 
1409
- const progressWithByParams = (taskX1, taskX2, progress, rtl) => {
1410
- const progressWidth = taskX2 > 0 && taskX1 > 0 ? (taskX2 - taskX1) * progress * 0.01 : 0;
1411
- let progressX;
1435
+ var progressWithByParams = function progressWithByParams(taskX1, taskX2, progress, rtl) {
1436
+ var progressWidth = taskX2 > 0 && taskX1 > 0 ? (taskX2 - taskX1) * progress * 0.01 : 0;
1437
+ var progressX;
1412
1438
 
1413
1439
  if (rtl) {
1414
1440
  progressX = taskX2 > 0 ? taskX2 - progressWidth : 0;
@@ -1418,79 +1444,79 @@ const progressWithByParams = (taskX1, taskX2, progress, rtl) => {
1418
1444
 
1419
1445
  return [progressWidth, progressX];
1420
1446
  };
1421
- const getProgressPoint = (progressX, taskY, taskHeight) => {
1422
- const point = [progressX - 5, taskY + taskHeight, progressX + 5, taskY + taskHeight, progressX, taskY + taskHeight - 8.66];
1447
+ var getProgressPoint = function getProgressPoint(progressX, taskY, taskHeight) {
1448
+ var point = [progressX - 5, taskY + taskHeight, progressX + 5, taskY + taskHeight, progressX, taskY + taskHeight - 8.66];
1423
1449
  return point.join(",");
1424
1450
  };
1425
1451
 
1426
- const startByX = (x, xStep, task) => {
1452
+ var startByX = function startByX(x, xStep, task) {
1427
1453
  if (x >= task.x2 - task.handleWidth * 2) {
1428
1454
  x = task.x2 - task.handleWidth * 2;
1429
1455
  }
1430
1456
 
1431
- const steps = Math.round((x - task.x1) / xStep);
1432
- const additionalXValue = steps * xStep;
1433
- const newX = task.x1 + additionalXValue;
1457
+ var steps = Math.round((x - task.x1) / xStep);
1458
+ var additionalXValue = steps * xStep;
1459
+ var newX = task.x1 + additionalXValue;
1434
1460
  return newX;
1435
1461
  };
1436
1462
 
1437
- const startByActualX = (x, xStep, task) => {
1463
+ var startByActualX = function startByActualX(x, xStep, task) {
1438
1464
  if (x >= task.actualx2 - task.handleWidth * 2) {
1439
1465
  x = task.actualx2 - task.handleWidth * 2;
1440
1466
  }
1441
1467
 
1442
- const steps = Math.round((x - task.actualx1) / xStep);
1443
- const additionalXValue = steps * xStep;
1444
- const newX = task.actualx1 + additionalXValue;
1468
+ var steps = Math.round((x - task.actualx1) / xStep);
1469
+ var additionalXValue = steps * xStep;
1470
+ var newX = task.actualx1 + additionalXValue;
1445
1471
  return newX;
1446
1472
  };
1447
1473
 
1448
- const endByX = (x, xStep, task) => {
1474
+ var endByX = function endByX(x, xStep, task) {
1449
1475
  if (x <= task.x1 + task.handleWidth * 2) {
1450
1476
  x = task.x1 + task.handleWidth * 2;
1451
1477
  }
1452
1478
 
1453
- const steps = Math.round((x - task.x2) / xStep);
1454
- const additionalXValue = steps * xStep;
1455
- const newX = task.x2 + additionalXValue;
1479
+ var steps = Math.round((x - task.x2) / xStep);
1480
+ var additionalXValue = steps * xStep;
1481
+ var newX = task.x2 + additionalXValue;
1456
1482
  return newX;
1457
1483
  };
1458
1484
 
1459
- const endByActualX = (x, xStep, task) => {
1485
+ var endByActualX = function endByActualX(x, xStep, task) {
1460
1486
  if (x <= task.actualx1 + task.handleWidth * 2) {
1461
1487
  x = task.actualx1 + task.handleWidth * 2;
1462
1488
  }
1463
1489
 
1464
- const steps = Math.round((x - task.actualx2) / xStep);
1465
- const additionalXValue = steps * xStep;
1466
- const newX = task.actualx2 + additionalXValue;
1490
+ var steps = Math.round((x - task.actualx2) / xStep);
1491
+ var additionalXValue = steps * xStep;
1492
+ var newX = task.actualx2 + additionalXValue;
1467
1493
  return newX;
1468
1494
  };
1469
1495
 
1470
- const moveByX = (x, xStep, task) => {
1471
- const steps = Math.round((x - task.x1) / xStep);
1472
- const additionalXValue = steps * xStep;
1473
- const newX1 = task.x1 + additionalXValue;
1474
- const newX2 = newX1 + task.x2 - task.x1;
1496
+ var moveByX = function moveByX(x, xStep, task) {
1497
+ var steps = Math.round((x - task.x1) / xStep);
1498
+ var additionalXValue = steps * xStep;
1499
+ var newX1 = task.x1 + additionalXValue;
1500
+ var newX2 = newX1 + task.x2 - task.x1;
1475
1501
  return [newX1, newX2];
1476
1502
  };
1477
1503
 
1478
- const moveByActualX = (x, xStep, task) => {
1479
- const steps = Math.round((x - task.actualx1) / xStep);
1480
- const additionalXValue = steps * xStep;
1481
- const newX1 = task.actualx1 + additionalXValue;
1482
- const newX2 = newX1 + task.actualx2 - task.actualx1;
1504
+ var moveByActualX = function moveByActualX(x, xStep, task) {
1505
+ var steps = Math.round((x - task.actualx1) / xStep);
1506
+ var additionalXValue = steps * xStep;
1507
+ var newX1 = task.actualx1 + additionalXValue;
1508
+ var newX2 = newX1 + task.actualx2 - task.actualx1;
1483
1509
  return [newX1, newX2];
1484
1510
  };
1485
1511
 
1486
- const dateByX = (x, taskX, taskDate, xStep, timeStep) => {
1487
- let newDate = new Date((x - taskX) / xStep * timeStep + taskDate.getTime());
1512
+ var dateByX = function dateByX(x, taskX, taskDate, xStep, timeStep) {
1513
+ var newDate = new Date((x - taskX) / xStep * timeStep + taskDate.getTime());
1488
1514
  newDate = new Date(newDate.getTime() + (newDate.getTimezoneOffset() - taskDate.getTimezoneOffset()) * 60000);
1489
1515
  return newDate;
1490
1516
  };
1491
1517
 
1492
- const handleTaskBySVGMouseEvent = (svgX, action, selectedTask, type, xStep, timeStep, initEventX1Delta, rtl) => {
1493
- let result;
1518
+ var handleTaskBySVGMouseEvent = function handleTaskBySVGMouseEvent(svgX, action, selectedTask, type, xStep, timeStep, initEventX1Delta, rtl) {
1519
+ var result;
1494
1520
 
1495
1521
  switch (selectedTask.type) {
1496
1522
  case "milestone":
@@ -1505,15 +1531,15 @@ const handleTaskBySVGMouseEvent = (svgX, action, selectedTask, type, xStep, time
1505
1531
  return result;
1506
1532
  };
1507
1533
 
1508
- const handleTaskBySVGMouseEventForBar = (svgX, action, selectedTask, type, xStep, timeStep, initEventX1Delta, rtl) => {
1509
- const changedTask = { ...selectedTask
1510
- };
1511
- let isChanged = false;
1534
+ var handleTaskBySVGMouseEventForBar = function handleTaskBySVGMouseEventForBar(svgX, action, selectedTask, type, xStep, timeStep, initEventX1Delta, rtl) {
1535
+ var changedTask = _extends({}, selectedTask);
1536
+
1537
+ var isChanged = false;
1512
1538
 
1513
1539
  switch (action) {
1514
1540
  case "start":
1515
1541
  {
1516
- const newX1 = type == "planned" ? startByX(svgX, xStep, selectedTask) : startByActualX(svgX, xStep, selectedTask);
1542
+ var newX1 = type == "planned" ? startByX(svgX, xStep, selectedTask) : startByActualX(svgX, xStep, selectedTask);
1517
1543
  if (type == "planned") changedTask.x1 = newX1;else if (type == "actual") changedTask.actualx1 = newX1;
1518
1544
  isChanged = changedTask.x1 !== selectedTask.x1 || changedTask.actualx1 !== selectedTask.actualx1;
1519
1545
 
@@ -1526,7 +1552,10 @@ const handleTaskBySVGMouseEventForBar = (svgX, action, selectedTask, type, xStep
1526
1552
  if (type == "actual") changedTask.actualStart = dateByX(newX1, selectedTask.actualx1, selectedTask.actualStart, xStep, timeStep);
1527
1553
  }
1528
1554
 
1529
- const [progressWidth, progressX] = progressWithByParams(changedTask.x1, changedTask.x2, changedTask.progress, rtl);
1555
+ var _progressWithByParams2 = progressWithByParams(changedTask.x1, changedTask.x2, changedTask.progress, rtl),
1556
+ progressWidth = _progressWithByParams2[0],
1557
+ progressX = _progressWithByParams2[1];
1558
+
1530
1559
  changedTask.progressWidth = progressWidth;
1531
1560
  changedTask.progressX = progressX;
1532
1561
  }
@@ -1536,7 +1565,7 @@ const handleTaskBySVGMouseEventForBar = (svgX, action, selectedTask, type, xStep
1536
1565
 
1537
1566
  case "end":
1538
1567
  {
1539
- const newX2 = type == "planned" ? endByX(svgX, xStep, selectedTask) : endByActualX(svgX, xStep, selectedTask);
1568
+ var newX2 = type == "planned" ? endByX(svgX, xStep, selectedTask) : endByActualX(svgX, xStep, selectedTask);
1540
1569
  if (type == "planned") changedTask.x2 = newX2;else if (type == "actual") changedTask.actualx2 = newX2;
1541
1570
  isChanged = changedTask.x2 !== selectedTask.x2 || changedTask.actualx2 !== selectedTask.actualx2;
1542
1571
 
@@ -1549,9 +1578,12 @@ const handleTaskBySVGMouseEventForBar = (svgX, action, selectedTask, type, xStep
1549
1578
  if (type == "actual") changedTask.actualEnd = dateByX(newX2, selectedTask.actualx2, selectedTask.actualEnd, xStep, timeStep);
1550
1579
  }
1551
1580
 
1552
- const [progressWidth, progressX] = progressWithByParams(changedTask.x1, changedTask.x2, changedTask.progress, rtl);
1553
- changedTask.progressWidth = progressWidth;
1554
- changedTask.progressX = progressX;
1581
+ var _progressWithByParams3 = progressWithByParams(changedTask.x1, changedTask.x2, changedTask.progress, rtl),
1582
+ _progressWidth = _progressWithByParams3[0],
1583
+ _progressX = _progressWithByParams3[1];
1584
+
1585
+ changedTask.progressWidth = _progressWidth;
1586
+ changedTask.progressX = _progressX;
1555
1587
  }
1556
1588
 
1557
1589
  break;
@@ -1559,7 +1591,10 @@ const handleTaskBySVGMouseEventForBar = (svgX, action, selectedTask, type, xStep
1559
1591
 
1560
1592
  case "move":
1561
1593
  {
1562
- const [newMoveX1, newMoveX2] = type == "planned" ? moveByX(svgX - initEventX1Delta, xStep, selectedTask) : moveByActualX(svgX - initEventX1Delta, xStep, selectedTask);
1594
+ var _ref = type == "planned" ? moveByX(svgX - initEventX1Delta, xStep, selectedTask) : moveByActualX(svgX - initEventX1Delta, xStep, selectedTask),
1595
+ newMoveX1 = _ref[0],
1596
+ newMoveX2 = _ref[1];
1597
+
1563
1598
  if (type == "planned") isChanged = newMoveX1 !== selectedTask.x1;
1564
1599
  if (type == "actual") isChanged = newMoveX1 !== selectedTask.actualx1;
1565
1600
 
@@ -1584,20 +1619,23 @@ const handleTaskBySVGMouseEventForBar = (svgX, action, selectedTask, type, xStep
1584
1619
  }
1585
1620
 
1586
1621
  return {
1587
- isChanged,
1588
- changedTask
1622
+ isChanged: isChanged,
1623
+ changedTask: changedTask
1589
1624
  };
1590
1625
  };
1591
1626
 
1592
- const handleTaskBySVGMouseEventForMilestone = (svgX, action, selectedTask, xStep, timeStep, initEventX1Delta) => {
1593
- const changedTask = { ...selectedTask
1594
- };
1595
- let isChanged = false;
1627
+ var handleTaskBySVGMouseEventForMilestone = function handleTaskBySVGMouseEventForMilestone(svgX, action, selectedTask, xStep, timeStep, initEventX1Delta) {
1628
+ var changedTask = _extends({}, selectedTask);
1629
+
1630
+ var isChanged = false;
1596
1631
 
1597
1632
  switch (action) {
1598
1633
  case "move":
1599
1634
  {
1600
- const [newMoveX1, newMoveX2] = moveByX(svgX - initEventX1Delta, xStep, selectedTask);
1635
+ var _moveByX = moveByX(svgX - initEventX1Delta, xStep, selectedTask),
1636
+ newMoveX1 = _moveByX[0],
1637
+ newMoveX2 = _moveByX[1];
1638
+
1601
1639
  isChanged = newMoveX1 !== selectedTask.x1;
1602
1640
 
1603
1641
  if (isChanged) {
@@ -1612,8 +1650,8 @@ const handleTaskBySVGMouseEventForMilestone = (svgX, action, selectedTask, xStep
1612
1650
  }
1613
1651
 
1614
1652
  return {
1615
- isChanged,
1616
- changedTask
1653
+ isChanged: isChanged,
1654
+ changedTask: changedTask
1617
1655
  };
1618
1656
  };
1619
1657
 
@@ -1621,13 +1659,21 @@ function isKeyboardEvent(event) {
1621
1659
  return event.key !== undefined;
1622
1660
  }
1623
1661
  function removeHiddenTasks(tasks) {
1624
- const groupedTasks = tasks.filter(t => t.hideChildren && t.type === "project");
1662
+ var groupedTasks = tasks.filter(function (t) {
1663
+ return t.hideChildren && t.type === "project";
1664
+ });
1625
1665
 
1626
1666
  if (groupedTasks.length > 0) {
1627
- for (let i = 0; groupedTasks.length > i; i++) {
1628
- const groupedTask = groupedTasks[i];
1629
- const children = getChildren(tasks, groupedTask);
1630
- tasks = tasks.filter(t => children.indexOf(t) === -1);
1667
+ var _loop = function _loop(i) {
1668
+ var groupedTask = groupedTasks[i];
1669
+ var children = getChildren(tasks, groupedTask);
1670
+ tasks = tasks.filter(function (t) {
1671
+ return children.indexOf(t) === -1;
1672
+ });
1673
+ };
1674
+
1675
+ for (var i = 0; groupedTasks.length > i; i++) {
1676
+ _loop(i);
1631
1677
  }
1632
1678
  }
1633
1679
 
@@ -1635,25 +1681,29 @@ function removeHiddenTasks(tasks) {
1635
1681
  }
1636
1682
 
1637
1683
  function getChildren(taskList, task) {
1638
- let tasks = [];
1684
+ var tasks = [];
1639
1685
 
1640
1686
  if (task.type !== "project") {
1641
- tasks = taskList.filter(t => t.dependencies && t.dependencies.indexOf(task.id) !== -1);
1687
+ tasks = taskList.filter(function (t) {
1688
+ return t.dependencies && t.dependencies.indexOf(task.id) !== -1;
1689
+ });
1642
1690
  } else {
1643
- tasks = taskList.filter(t => t.project && t.project === task.id);
1691
+ tasks = taskList.filter(function (t) {
1692
+ return t.project && t.project === task.id;
1693
+ });
1644
1694
  }
1645
1695
 
1646
1696
  var taskChildren = [];
1647
- tasks.forEach(t => {
1648
- taskChildren.push(...getChildren(taskList, t));
1697
+ tasks.forEach(function (t) {
1698
+ taskChildren.push.apply(taskChildren, getChildren(taskList, t));
1649
1699
  });
1650
1700
  tasks = tasks.concat(tasks, taskChildren);
1651
1701
  return tasks;
1652
1702
  }
1653
1703
 
1654
- const sortTasks = (taskA, taskB) => {
1655
- const orderA = taskA.displayOrder || Number.MAX_VALUE;
1656
- const orderB = taskB.displayOrder || Number.MAX_VALUE;
1704
+ var sortTasks = function sortTasks(taskA, taskB) {
1705
+ var orderA = taskA.displayOrder || Number.MAX_VALUE;
1706
+ var orderB = taskB.displayOrder || Number.MAX_VALUE;
1657
1707
 
1658
1708
  if (orderA > orderB) {
1659
1709
  return 1;
@@ -1664,26 +1714,24 @@ const sortTasks = (taskA, taskB) => {
1664
1714
  }
1665
1715
  };
1666
1716
 
1667
- const BarDisplay = _ref => {
1668
- let {
1669
- x,
1670
- y,
1671
- type,
1672
- width,
1673
- height,
1674
- isSelected,
1675
- progressX,
1676
- progressWidth,
1677
- barCornerRadius,
1678
- styles,
1679
- onMouseDown
1680
- } = _ref;
1681
-
1682
- const getProcessColor = () => {
1717
+ var BarDisplay = function BarDisplay(_ref) {
1718
+ var x = _ref.x,
1719
+ y = _ref.y,
1720
+ type = _ref.type,
1721
+ width = _ref.width,
1722
+ height = _ref.height,
1723
+ isSelected = _ref.isSelected,
1724
+ progressX = _ref.progressX,
1725
+ progressWidth = _ref.progressWidth,
1726
+ barCornerRadius = _ref.barCornerRadius,
1727
+ styles = _ref.styles,
1728
+ onMouseDown = _ref.onMouseDown;
1729
+
1730
+ var getProcessColor = function getProcessColor() {
1683
1731
  return isSelected ? styles.progressSelectedColor : styles.progressColor;
1684
1732
  };
1685
1733
 
1686
- const getBarColor = () => {
1734
+ var getBarColor = function getBarColor() {
1687
1735
  return isSelected ? styles.backgroundSelectedColor : styles.backgroundColor;
1688
1736
  };
1689
1737
 
@@ -1730,15 +1778,13 @@ const BarDisplay = _ref => {
1730
1778
 
1731
1779
  var styles$6 = {"barWrapper":"_KxSXS","barHandle":"_3w_5u","barBackground":"_31ERP"};
1732
1780
 
1733
- const BarDateHandle = _ref => {
1734
- let {
1735
- x,
1736
- y,
1737
- width,
1738
- height,
1739
- barCornerRadius,
1740
- onMouseDown
1741
- } = _ref;
1781
+ var BarDateHandle = function BarDateHandle(_ref) {
1782
+ var x = _ref.x,
1783
+ y = _ref.y,
1784
+ width = _ref.width,
1785
+ height = _ref.height,
1786
+ barCornerRadius = _ref.barCornerRadius,
1787
+ onMouseDown = _ref.onMouseDown;
1742
1788
  return React.createElement("rect", {
1743
1789
  x: x,
1744
1790
  y: y,
@@ -1751,25 +1797,25 @@ const BarDateHandle = _ref => {
1751
1797
  });
1752
1798
  };
1753
1799
 
1754
- const BarProgressHandle = _ref => {
1800
+ var BarProgressHandle = function BarProgressHandle(_ref) {
1801
+ _objectDestructuringEmpty(_ref);
1802
+
1755
1803
  return React.createElement("div", null);
1756
1804
  };
1757
1805
 
1758
- const Bar = _ref => {
1759
- let {
1760
- task,
1761
- isProgressChangeable,
1762
- isDateChangeable,
1763
- rtl,
1764
- type,
1765
- onEventStart,
1766
- isSelected
1767
- } = _ref;
1768
- const progressPoint = getProgressPoint(+!rtl * task.progressWidth + task.progressX, task.y, task.height);
1769
- const handleHeight = task.height / 2 - 1;
1806
+ var Bar = function Bar(_ref) {
1807
+ var task = _ref.task,
1808
+ isProgressChangeable = _ref.isProgressChangeable,
1809
+ isDateChangeable = _ref.isDateChangeable,
1810
+ rtl = _ref.rtl,
1811
+ type = _ref.type,
1812
+ onEventStart = _ref.onEventStart,
1813
+ isSelected = _ref.isSelected;
1814
+ var progressPoint = getProgressPoint(+!rtl * task.progressWidth + task.progressX, task.y, task.height);
1815
+ var handleHeight = task.height / 2 - 1;
1770
1816
 
1771
1817
  if (type == "planned") {
1772
- if (task.x1 && task.x2) return React.createElement("g", {
1818
+ 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", {
1773
1819
  className: styles$6.barWrapper,
1774
1820
  tabIndex: 0
1775
1821
  }, React.createElement(BarDisplay, {
@@ -1785,7 +1831,7 @@ const Bar = _ref => {
1785
1831
  barCornerRadius: task.barCornerRadius,
1786
1832
  styles: task.styles,
1787
1833
  isSelected: isSelected,
1788
- onMouseDown: e => {
1834
+ onMouseDown: function onMouseDown(e) {
1789
1835
  isDateChangeable && onEventStart("move", task, e, "planned");
1790
1836
  }
1791
1837
  }), React.createElement("g", {
@@ -1796,7 +1842,7 @@ const Bar = _ref => {
1796
1842
  width: task.handleWidth,
1797
1843
  height: handleHeight,
1798
1844
  barCornerRadius: task.barCornerRadius,
1799
- onMouseDown: e => {
1845
+ onMouseDown: function onMouseDown(e) {
1800
1846
  onEventStart("start", task, e, "planned");
1801
1847
  }
1802
1848
  }), React.createElement(BarDateHandle, {
@@ -1805,19 +1851,19 @@ const Bar = _ref => {
1805
1851
  width: task.handleWidth,
1806
1852
  height: handleHeight,
1807
1853
  barCornerRadius: task.barCornerRadius,
1808
- onMouseDown: e => {
1854
+ onMouseDown: function onMouseDown(e) {
1809
1855
  onEventStart("end", task, e, "planned");
1810
1856
  }
1811
1857
  })), isProgressChangeable && React.createElement(BarProgressHandle, {
1812
1858
  progressPoint: progressPoint,
1813
- onMouseDown: e => {
1859
+ onMouseDown: function onMouseDown(e) {
1814
1860
  onEventStart("progress", task, e, "planned");
1815
1861
  }
1816
1862
  })));else return React.createElement("g", {
1817
1863
  className: styles$6.barWrapper,
1818
1864
  tabIndex: 0
1819
1865
  });
1820
- } else if (task.actualx1 && task.actualx2) {
1866
+ } else if ((task === null || task === void 0 ? void 0 : task.actualx1) >= 0 && (task === null || task === void 0 ? void 0 : task.actualx2) >= 0) {
1821
1867
  return React.createElement("g", {
1822
1868
  className: styles$6.barWrapper,
1823
1869
  tabIndex: 0
@@ -1834,7 +1880,7 @@ const Bar = _ref => {
1834
1880
  barCornerRadius: task.barCornerRadius,
1835
1881
  styles: task.styles,
1836
1882
  isSelected: isSelected,
1837
- onMouseDown: e => {
1883
+ onMouseDown: function onMouseDown(e) {
1838
1884
  isDateChangeable && onEventStart("move", task, e, "actual");
1839
1885
  }
1840
1886
  }), React.createElement("g", {
@@ -1845,7 +1891,7 @@ const Bar = _ref => {
1845
1891
  width: task.handleWidth,
1846
1892
  height: handleHeight,
1847
1893
  barCornerRadius: task.barCornerRadius,
1848
- onMouseDown: e => {
1894
+ onMouseDown: function onMouseDown(e) {
1849
1895
  onEventStart("start", task, e, "actual");
1850
1896
  }
1851
1897
  }), React.createElement(BarDateHandle, {
@@ -1854,12 +1900,12 @@ const Bar = _ref => {
1854
1900
  width: task.handleWidth,
1855
1901
  height: handleHeight,
1856
1902
  barCornerRadius: task.barCornerRadius,
1857
- onMouseDown: e => {
1903
+ onMouseDown: function onMouseDown(e) {
1858
1904
  onEventStart("end", task, e, "actual");
1859
1905
  }
1860
1906
  })), isProgressChangeable && React.createElement(BarProgressHandle, {
1861
1907
  progressPoint: progressPoint,
1862
- onMouseDown: e => {
1908
+ onMouseDown: function onMouseDown(e) {
1863
1909
  onEventStart("progress", task, e, "actual");
1864
1910
  }
1865
1911
  })));
@@ -1871,16 +1917,14 @@ const Bar = _ref => {
1871
1917
  }
1872
1918
  };
1873
1919
 
1874
- const BarSmall = _ref => {
1875
- let {
1876
- task,
1877
- type,
1878
- isProgressChangeable,
1879
- isDateChangeable,
1880
- onEventStart,
1881
- isSelected
1882
- } = _ref;
1883
- const progressPoint = getProgressPoint(task.progressWidth + task.x1, task.y, task.height);
1920
+ var BarSmall = function BarSmall(_ref) {
1921
+ var task = _ref.task,
1922
+ type = _ref.type,
1923
+ isProgressChangeable = _ref.isProgressChangeable,
1924
+ isDateChangeable = _ref.isDateChangeable,
1925
+ onEventStart = _ref.onEventStart,
1926
+ isSelected = _ref.isSelected;
1927
+ var progressPoint = getProgressPoint(task.progressWidth + task.x1, task.y, task.height);
1884
1928
  return React.createElement("g", {
1885
1929
  className: styles$6.barWrapper,
1886
1930
  tabIndex: 0
@@ -1897,14 +1941,14 @@ const BarSmall = _ref => {
1897
1941
  barCornerRadius: task.barCornerRadius,
1898
1942
  styles: task.styles,
1899
1943
  isSelected: isSelected,
1900
- onMouseDown: e => {
1944
+ onMouseDown: function onMouseDown(e) {
1901
1945
  isDateChangeable && onEventStart("move", task, e);
1902
1946
  }
1903
1947
  }), React.createElement("g", {
1904
1948
  className: "handleGroup"
1905
1949
  }, isProgressChangeable && React.createElement(BarProgressHandle, {
1906
1950
  progressPoint: progressPoint,
1907
- onMouseDown: e => {
1951
+ onMouseDown: function onMouseDown(e) {
1908
1952
  onEventStart("progress", task, e);
1909
1953
  }
1910
1954
  })));
@@ -1912,17 +1956,14 @@ const BarSmall = _ref => {
1912
1956
 
1913
1957
  var styles$7 = {"milestoneWrapper":"_RRr13","milestoneBackground":"_2P2B1"};
1914
1958
 
1915
- const Milestone = _ref => {
1916
- let {
1917
- task,
1918
- isDateChangeable,
1919
- onEventStart,
1920
- isSelected
1921
- } = _ref;
1922
- const transform = `rotate(45 ${task.x1 + task.height * 0.356}
1923
- ${task.y + task.height * 0.85})`;
1924
-
1925
- const getBarColor = () => {
1959
+ var Milestone = function Milestone(_ref) {
1960
+ var task = _ref.task,
1961
+ isDateChangeable = _ref.isDateChangeable,
1962
+ onEventStart = _ref.onEventStart,
1963
+ isSelected = _ref.isSelected;
1964
+ var transform = "rotate(45 " + (task.x1 + task.height * 0.356) + " \n " + (task.y + task.height * 0.85) + ")";
1965
+
1966
+ var getBarColor = function getBarColor() {
1926
1967
  return isSelected ? task.styles.backgroundSelectedColor : task.styles.backgroundColor;
1927
1968
  };
1928
1969
 
@@ -1939,7 +1980,7 @@ const Milestone = _ref => {
1939
1980
  ry: task.barCornerRadius,
1940
1981
  transform: transform,
1941
1982
  className: styles$7.milestoneBackground,
1942
- onMouseDown: e => {
1983
+ onMouseDown: function onMouseDown(e) {
1943
1984
  isDateChangeable && onEventStart("move", task, e);
1944
1985
  }
1945
1986
  }));
@@ -1947,16 +1988,14 @@ const Milestone = _ref => {
1947
1988
 
1948
1989
  var styles$8 = {"projectWrapper":"_1KJ6x","projectBackground":"_2RbVy","projectTop":"_2pZMF"};
1949
1990
 
1950
- const Project = _ref => {
1951
- let {
1952
- task,
1953
- isSelected
1954
- } = _ref;
1955
- const barColor = isSelected ? task.styles.backgroundSelectedColor : task.styles.backgroundColor;
1956
- const processColor = isSelected ? task.styles.progressSelectedColor : task.styles.progressColor;
1957
- const projectWith = task.x2 - task.x1;
1958
- 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(",");
1959
- 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(",");
1991
+ var Project = function Project(_ref) {
1992
+ var task = _ref.task,
1993
+ isSelected = _ref.isSelected;
1994
+ var barColor = isSelected ? task.styles.backgroundSelectedColor : task.styles.backgroundColor;
1995
+ var processColor = isSelected ? task.styles.progressSelectedColor : task.styles.progressColor;
1996
+ var projectWith = task.x2 - task.x1;
1997
+ 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(",");
1998
+ 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(",");
1960
1999
  return React.createElement("g", {
1961
2000
  tabIndex: 0,
1962
2001
  className: styles$8.projectWrapper
@@ -1997,23 +2036,25 @@ const Project = _ref => {
1997
2036
  }));
1998
2037
  };
1999
2038
 
2000
- const TaskItem = props => {
2001
- const {
2002
- task,
2003
- isDelete,
2004
- isSelected,
2005
- onEventStart
2006
- } = { ...props
2007
- };
2008
- const [taskItem, setTaskItem] = useState([React.createElement("div", null)]);
2009
- useEffect(() => {
2039
+ var TaskItem = function TaskItem(props) {
2040
+ var _props = _extends({}, props),
2041
+ task = _props.task,
2042
+ isDelete = _props.isDelete,
2043
+ isSelected = _props.isSelected,
2044
+ onEventStart = _props.onEventStart;
2045
+
2046
+ var _useState = useState([React.createElement("div", null)]),
2047
+ taskItem = _useState[0],
2048
+ setTaskItem = _useState[1];
2049
+
2050
+ useEffect(function () {
2010
2051
  switch (task.typeInternal) {
2011
2052
  case "milestone":
2012
- setTaskItem([React.createElement(Milestone, Object.assign({}, props))]);
2053
+ if (task.x1 >= 0 && task.actualx1 >= 0) setTaskItem([React.createElement(Milestone, Object.assign({}, props))]);else setTaskItem([]);
2013
2054
  break;
2014
2055
 
2015
2056
  case "project":
2016
- setTaskItem([React.createElement(Project, Object.assign({}, props))]);
2057
+ 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([]);
2017
2058
  break;
2018
2059
 
2019
2060
  case "smalltask":
@@ -2022,27 +2063,27 @@ const TaskItem = props => {
2022
2063
 
2023
2064
  default:
2024
2065
  {
2025
- let taskItem = [];
2066
+ var _taskItem = [];
2026
2067
 
2027
- if (task.x1 && task.x2) {
2028
- taskItem.push(React.createElement(Bar, Object.assign({}, props, {
2068
+ if ((task === null || task === void 0 ? void 0 : task.x1) >= 0 && (task === null || task === void 0 ? void 0 : task.x2) >= 0) {
2069
+ _taskItem.push(React.createElement(Bar, Object.assign({}, props, {
2029
2070
  type: "planned"
2030
2071
  })));
2031
2072
  }
2032
2073
 
2033
- if (task.actualx1 && task.actualx2) {
2034
- taskItem.push(React.createElement(Bar, Object.assign({}, props, {
2074
+ if ((task === null || task === void 0 ? void 0 : task.actualx1) >= 0 && (task === null || task === void 0 ? void 0 : task.actualx2) >= 0) {
2075
+ _taskItem.push(React.createElement(Bar, Object.assign({}, props, {
2035
2076
  type: "actual"
2036
2077
  })));
2037
2078
  }
2038
2079
 
2039
- setTaskItem(taskItem);
2080
+ setTaskItem(_taskItem);
2040
2081
  }
2041
2082
  break;
2042
2083
  }
2043
2084
  }, [task, isSelected]);
2044
2085
  return React.createElement("g", null, React.createElement("g", {
2045
- onKeyDown: e => {
2086
+ onKeyDown: function onKeyDown(e) {
2046
2087
  switch (e.key) {
2047
2088
  case "Delete":
2048
2089
  {
@@ -2053,20 +2094,20 @@ const TaskItem = props => {
2053
2094
 
2054
2095
  e.stopPropagation();
2055
2096
  },
2056
- onMouseEnter: e => {
2097
+ onMouseEnter: function onMouseEnter(e) {
2057
2098
  onEventStart("mouseenter", task, e, "planned");
2058
2099
  },
2059
- onMouseLeave: e => {
2100
+ onMouseLeave: function onMouseLeave(e) {
2060
2101
  onEventStart("mouseleave", task, e, "planned");
2061
2102
  },
2062
- onDoubleClick: e => {
2103
+ onDoubleClick: function onDoubleClick(e) {
2063
2104
  onEventStart("dblclick", task, e, "planned");
2064
2105
  },
2065
- onClick: e => {
2106
+ onClick: function onClick(e) {
2066
2107
  onEventStart("click", task, e, "planned");
2067
2108
  }
2068
2109
  }, taskItem[0]), React.createElement("g", {
2069
- onKeyDown: e => {
2110
+ onKeyDown: function onKeyDown(e) {
2070
2111
  switch (e.key) {
2071
2112
  case "Delete":
2072
2113
  {
@@ -2077,74 +2118,82 @@ const TaskItem = props => {
2077
2118
 
2078
2119
  e.stopPropagation();
2079
2120
  },
2080
- onMouseEnter: e => {
2121
+ onMouseEnter: function onMouseEnter(e) {
2081
2122
  onEventStart("mouseenter", task, e, "actual");
2082
2123
  },
2083
- onMouseLeave: e => {
2124
+ onMouseLeave: function onMouseLeave(e) {
2084
2125
  onEventStart("mouseleave", task, e, "actual");
2085
2126
  },
2086
- onDoubleClick: e => {
2127
+ onDoubleClick: function onDoubleClick(e) {
2087
2128
  onEventStart("dblclick", task, e, "actual");
2088
2129
  },
2089
- onClick: e => {
2130
+ onClick: function onClick(e) {
2090
2131
  onEventStart("click", task, e, "actual");
2091
2132
  }
2092
2133
  }, taskItem[1]));
2093
2134
  };
2094
2135
 
2095
- const TaskGanttContent = _ref => {
2136
+ var TaskGanttContent = function TaskGanttContent(_ref) {
2096
2137
  var _svg$current;
2097
2138
 
2098
- let {
2099
- tasks,
2100
- dates,
2101
- ganttEvent,
2102
- selectedTask,
2103
- rowHeight,
2104
- columnWidth,
2105
- timeStep,
2106
- svg,
2107
- taskHeight,
2108
- arrowIndent,
2109
- fontFamily,
2110
- fontSize,
2111
- rtl,
2112
- setGanttEvent,
2113
- setFailedTask,
2114
- setSelectedTask,
2115
- onDateChange,
2116
- onProgressChange,
2117
- onDoubleClick,
2118
- onClick,
2119
- onDelete
2120
- } = _ref;
2121
- const point = svg === null || svg === void 0 ? void 0 : (_svg$current = svg.current) === null || _svg$current === void 0 ? void 0 : _svg$current.createSVGPoint();
2122
- const [xStep, setXStep] = useState(0);
2123
- const [initEventX1Delta, setInitEventX1Delta] = useState(0);
2124
- const [isMoving, setIsMoving] = useState(false);
2125
- useEffect(() => {
2126
- const dateDelta = dates[1].getTime() - dates[0].getTime() - dates[1].getTimezoneOffset() * 60 * 1000 + dates[0].getTimezoneOffset() * 60 * 1000;
2127
- const newXStep = timeStep * columnWidth / dateDelta;
2139
+ var tasks = _ref.tasks,
2140
+ dates = _ref.dates,
2141
+ ganttEvent = _ref.ganttEvent,
2142
+ selectedTask = _ref.selectedTask,
2143
+ rowHeight = _ref.rowHeight,
2144
+ columnWidth = _ref.columnWidth,
2145
+ timeStep = _ref.timeStep,
2146
+ svg = _ref.svg,
2147
+ taskHeight = _ref.taskHeight,
2148
+ arrowIndent = _ref.arrowIndent,
2149
+ fontFamily = _ref.fontFamily,
2150
+ fontSize = _ref.fontSize,
2151
+ rtl = _ref.rtl,
2152
+ setGanttEvent = _ref.setGanttEvent,
2153
+ setFailedTask = _ref.setFailedTask,
2154
+ setSelectedTask = _ref.setSelectedTask,
2155
+ onDateChange = _ref.onDateChange,
2156
+ onProgressChange = _ref.onProgressChange,
2157
+ onDoubleClick = _ref.onDoubleClick,
2158
+ onClick = _ref.onClick,
2159
+ onDelete = _ref.onDelete;
2160
+ var point = svg === null || svg === void 0 ? void 0 : (_svg$current = svg.current) === null || _svg$current === void 0 ? void 0 : _svg$current.createSVGPoint();
2161
+
2162
+ var _useState = useState(0),
2163
+ xStep = _useState[0],
2164
+ setXStep = _useState[1];
2165
+
2166
+ var _useState2 = useState(0),
2167
+ initEventX1Delta = _useState2[0],
2168
+ setInitEventX1Delta = _useState2[1];
2169
+
2170
+ var _useState3 = useState(false),
2171
+ isMoving = _useState3[0],
2172
+ setIsMoving = _useState3[1];
2173
+
2174
+ useEffect(function () {
2175
+ var dateDelta = dates[1].getTime() - dates[0].getTime() - dates[1].getTimezoneOffset() * 60 * 1000 + dates[0].getTimezoneOffset() * 60 * 1000;
2176
+ var newXStep = timeStep * columnWidth / dateDelta;
2128
2177
  setXStep(newXStep);
2129
2178
  }, [columnWidth, dates, timeStep]);
2130
- useEffect(() => {
2131
- const handleMouseMove = function (event) {
2179
+ useEffect(function () {
2180
+ var handleMouseMove = function handleMouseMove(event) {
2132
2181
  try {
2133
2182
  var _svg$current$getScree;
2134
2183
 
2135
2184
  if (!ganttEvent.changedTask || !point || !(svg !== null && svg !== void 0 && svg.current)) return Promise.resolve();
2136
2185
  event.preventDefault();
2137
2186
  point.x = event.clientX;
2138
- 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());
2139
- const {
2140
- isChanged,
2141
- changedTask
2142
- } = handleTaskBySVGMouseEvent(cursor.x, ganttEvent.action, ganttEvent.changedTask, ganttEvent.type, xStep, timeStep, initEventX1Delta, rtl);
2187
+ 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());
2188
+
2189
+ var _handleTaskBySVGMouse = handleTaskBySVGMouseEvent(cursor.x, ganttEvent.action, ganttEvent.changedTask, ganttEvent.type, xStep, timeStep, initEventX1Delta, rtl),
2190
+ isChanged = _handleTaskBySVGMouse.isChanged,
2191
+ changedTask = _handleTaskBySVGMouse.changedTask;
2143
2192
 
2144
2193
  if (isChanged) {
2145
2194
  setGanttEvent({
2146
2195
  action: ganttEvent.action,
2147
- changedTask
2196
+ changedTask: changedTask
2148
2197
  });
2149
2198
  }
2150
2199
 
@@ -2154,41 +2203,40 @@ const TaskGanttContent = _ref => {
2154
2203
  }
2155
2204
  };
2156
2205
 
2157
- const handleMouseUp = function (event) {
2206
+ var handleMouseUp = function handleMouseUp(event) {
2158
2207
  try {
2159
2208
  var _svg$current$getScree2;
2160
2209
 
2161
- function _temp5() {
2210
+ var _temp6 = function _temp6() {
2162
2211
  if (!operationSuccess) {
2163
2212
  setFailedTask(originalSelectedTask);
2164
2213
  }
2165
- }
2214
+ };
2166
2215
 
2167
- const {
2168
- action,
2169
- originalSelectedTask,
2170
- changedTask,
2171
- type
2172
- } = ganttEvent;
2216
+ var action = ganttEvent.action,
2217
+ originalSelectedTask = ganttEvent.originalSelectedTask,
2218
+ changedTask = ganttEvent.changedTask,
2219
+ type = ganttEvent.type;
2173
2220
  if (!changedTask || !point || !(svg !== null && svg !== void 0 && svg.current) || !originalSelectedTask) return Promise.resolve();
2174
2221
  event.preventDefault();
2175
2222
  point.x = event.clientX;
2176
- 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());
2177
- const {
2178
- changedTask: newChangedTask
2179
- } = handleTaskBySVGMouseEvent(cursor.x, action, changedTask, type, xStep, timeStep, initEventX1Delta, rtl);
2180
- const isNotLikeOriginal = originalSelectedTask.start !== newChangedTask.start || originalSelectedTask.end !== newChangedTask.end || originalSelectedTask.actualStart !== newChangedTask.actualStart || originalSelectedTask.actualEnd !== newChangedTask.actualEnd || originalSelectedTask.progress !== newChangedTask.progress;
2223
+ 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());
2224
+
2225
+ var _handleTaskBySVGMouse2 = handleTaskBySVGMouseEvent(cursor.x, action, changedTask, type, xStep, timeStep, initEventX1Delta, rtl),
2226
+ newChangedTask = _handleTaskBySVGMouse2.changedTask;
2227
+
2228
+ var isNotLikeOriginal = originalSelectedTask.start !== newChangedTask.start || originalSelectedTask.end !== newChangedTask.end || originalSelectedTask.actualStart !== newChangedTask.actualStart || originalSelectedTask.actualEnd !== newChangedTask.actualEnd || originalSelectedTask.progress !== newChangedTask.progress;
2181
2229
  svg.current.removeEventListener("mousemove", handleMouseMove);
2182
2230
  svg.current.removeEventListener("mouseup", handleMouseUp);
2183
2231
  setGanttEvent({
2184
2232
  action: ""
2185
2233
  });
2186
2234
  setIsMoving(false);
2187
- let operationSuccess = true;
2235
+ var operationSuccess = true;
2188
2236
 
2189
- const _temp4 = function () {
2237
+ var _temp7 = function () {
2190
2238
  if ((action === "move" || action === "end" || action === "start") && onDateChange && isNotLikeOriginal) {
2191
- const _temp = _catch(function () {
2239
+ var _temp8 = _catch(function () {
2192
2240
  return Promise.resolve(onDateChange(newChangedTask, newChangedTask.barChildren)).then(function (result) {
2193
2241
  if (result !== undefined) {
2194
2242
  operationSuccess = result;
@@ -2198,11 +2246,11 @@ const TaskGanttContent = _ref => {
2198
2246
  operationSuccess = false;
2199
2247
  });
2200
2248
 
2201
- if (_temp && _temp.then) return _temp.then(function () {});
2249
+ if (_temp8 && _temp8.then) return _temp8.then(function () {});
2202
2250
  } else {
2203
- const _temp3 = function () {
2251
+ var _temp9 = function () {
2204
2252
  if (onProgressChange && isNotLikeOriginal) {
2205
- const _temp2 = _catch(function () {
2253
+ var _temp10 = _catch(function () {
2206
2254
  return Promise.resolve(onProgressChange(newChangedTask, newChangedTask.barChildren)).then(function (result) {
2207
2255
  if (result !== undefined) {
2208
2256
  operationSuccess = result;
@@ -2212,15 +2260,15 @@ const TaskGanttContent = _ref => {
2212
2260
  operationSuccess = false;
2213
2261
  });
2214
2262
 
2215
- if (_temp2 && _temp2.then) return _temp2.then(function () {});
2263
+ if (_temp10 && _temp10.then) return _temp10.then(function () {});
2216
2264
  }
2217
2265
  }();
2218
2266
 
2219
- if (_temp3 && _temp3.then) return _temp3.then(function () {});
2267
+ if (_temp9 && _temp9.then) return _temp9.then(function () {});
2220
2268
  }
2221
2269
  }();
2222
2270
 
2223
- return Promise.resolve(_temp4 && _temp4.then ? _temp4.then(_temp5) : _temp5(_temp4));
2271
+ return Promise.resolve(_temp7 && _temp7.then ? _temp7.then(_temp6) : _temp6(_temp7));
2224
2272
  } catch (e) {
2225
2273
  return Promise.reject(e);
2226
2274
  }
@@ -2233,7 +2281,7 @@ const TaskGanttContent = _ref => {
2233
2281
  }
2234
2282
  }, [ganttEvent, xStep, initEventX1Delta, onProgressChange, timeStep, onDateChange, svg, isMoving, point, rtl, setFailedTask, setGanttEvent]);
2235
2283
 
2236
- const handleBarEventStart = function (action, task, event, type) {
2284
+ var handleBarEventStart = function handleBarEventStart(action, task, event, type) {
2237
2285
  try {
2238
2286
  return Promise.resolve(function () {
2239
2287
  if (!event) {
@@ -2242,15 +2290,15 @@ const TaskGanttContent = _ref => {
2242
2290
  }
2243
2291
  } else return function () {
2244
2292
  if (isKeyboardEvent(event)) {
2245
- const _temp8 = function () {
2293
+ var _temp14 = function () {
2246
2294
  if (action === "delete") {
2247
- const _temp7 = function () {
2295
+ var _temp15 = function () {
2248
2296
  if (onDelete) {
2249
- const _temp6 = _catch(function () {
2297
+ var _temp16 = _catch(function () {
2250
2298
  return Promise.resolve(onDelete(task)).then(function (result) {
2251
2299
  if (result !== undefined && result) {
2252
2300
  setGanttEvent({
2253
- action,
2301
+ action: action,
2254
2302
  changedTask: task
2255
2303
  });
2256
2304
  }
@@ -2259,19 +2307,19 @@ const TaskGanttContent = _ref => {
2259
2307
  console.error("Error on Delete. " + error);
2260
2308
  });
2261
2309
 
2262
- if (_temp6 && _temp6.then) return _temp6.then(function () {});
2310
+ if (_temp16 && _temp16.then) return _temp16.then(function () {});
2263
2311
  }
2264
2312
  }();
2265
2313
 
2266
- if (_temp7 && _temp7.then) return _temp7.then(function () {});
2314
+ if (_temp15 && _temp15.then) return _temp15.then(function () {});
2267
2315
  }
2268
2316
  }();
2269
2317
 
2270
- if (_temp8 && _temp8.then) return _temp8.then(function () {});
2318
+ if (_temp14 && _temp14.then) return _temp14.then(function () {});
2271
2319
  } else if (action === "mouseenter") {
2272
2320
  if (!ganttEvent.action) {
2273
2321
  setGanttEvent({
2274
- action,
2322
+ action: action,
2275
2323
  changedTask: task,
2276
2324
  originalSelectedTask: task,
2277
2325
  type: type
@@ -2292,17 +2340,17 @@ const TaskGanttContent = _ref => {
2292
2340
 
2293
2341
  if (!(svg !== null && svg !== void 0 && svg.current) || !point) return;
2294
2342
  point.x = event.clientX;
2295
- const cursor = point.matrixTransform((_svg$current$getScree3 = svg.current.getScreenCTM()) === null || _svg$current$getScree3 === void 0 ? void 0 : _svg$current$getScree3.inverse());
2343
+ var cursor = point.matrixTransform((_svg$current$getScree3 = svg.current.getScreenCTM()) === null || _svg$current$getScree3 === void 0 ? void 0 : _svg$current$getScree3.inverse());
2296
2344
  if (type == "planned") setInitEventX1Delta(cursor.x - task.x1);else if (type == "actual") setInitEventX1Delta(cursor.x - task.actualx1);
2297
2345
  setGanttEvent({
2298
- action,
2346
+ action: action,
2299
2347
  changedTask: task,
2300
2348
  originalSelectedTask: task,
2301
2349
  type: type
2302
2350
  });
2303
2351
  } else {
2304
2352
  setGanttEvent({
2305
- action,
2353
+ action: action,
2306
2354
  changedTask: task,
2307
2355
  originalSelectedTask: task,
2308
2356
  type: type
@@ -2319,8 +2367,8 @@ const TaskGanttContent = _ref => {
2319
2367
  className: "content"
2320
2368
  }, React.createElement("g", {
2321
2369
  className: "arrows"
2322
- }, tasks.map(_task => {
2323
- const task = _task.start.getTime() > 0 && _task.end.getTime() > 0 ? _task : undefined;
2370
+ }, tasks.map(function (_task) {
2371
+ var task = _task.start.getTime() > 0 && _task.end.getTime() > 0 ? _task : undefined;
2324
2372
 
2325
2373
  if (!task) {
2326
2374
  return React.createElement("g", {
@@ -2331,26 +2379,33 @@ const TaskGanttContent = _ref => {
2331
2379
  });
2332
2380
  }
2333
2381
 
2334
- return task.barChildren.map(child => {
2382
+ return task.barChildren.map(function (child) {
2335
2383
  var _task$criticalPathArr, _task$criticalPathArr2;
2336
2384
 
2337
- return React.createElement(Arrow, {
2338
- key: `Arrow from ${task.id} to ${tasks[child.index].id}`,
2385
+ if (task.x2 > task.x1 || task.actualx2 > task.actualx1) return React.createElement(Arrow, {
2386
+ key: "Arrow from " + task.id + " to " + tasks[child.index].id,
2339
2387
  taskFrom: task,
2340
2388
  taskTo: tasks[child.index],
2341
2389
  rowHeight: rowHeight,
2342
2390
  taskHeight: taskHeight,
2343
2391
  arrowIndent: arrowIndent,
2344
2392
  rtl: rtl,
2345
- 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"
2393
+ arrowColor: ((_task$criticalPathArr = task.criticalPathArrows) === null || _task$criticalPathArr === void 0 ? void 0 : (_task$criticalPathArr2 = _task$criticalPathArr.find(function (arrow) {
2394
+ return arrow.taskId == tasks[child.index].id;
2395
+ })) === null || _task$criticalPathArr2 === void 0 ? void 0 : _task$criticalPathArr2.arrowColor) || "#808080"
2396
+ });else return React.createElement("g", {
2397
+ key: _task.id,
2398
+ style: {
2399
+ height: taskHeight
2400
+ }
2346
2401
  });
2347
2402
  });
2348
2403
  })), React.createElement("g", {
2349
2404
  className: "bar",
2350
2405
  fontFamily: fontFamily,
2351
2406
  fontSize: fontSize
2352
- }, tasks.map(_task => {
2353
- const task = _task.start.getTime() > 0 && _task.end.getTime() > 0 ? _task : undefined;
2407
+ }, tasks.map(function (_task) {
2408
+ var task = _task.start.getTime() > 0 && _task.end.getTime() > 0 ? _task : undefined;
2354
2409
 
2355
2410
  if (!task) {
2356
2411
  return React.createElement("g", {
@@ -2378,27 +2433,27 @@ const TaskGanttContent = _ref => {
2378
2433
 
2379
2434
  var styles$9 = {"ganttVerticalContainer":"_CZjuD","horizontalContainer":"_2B2zv","wrapper":"_3eULf"};
2380
2435
 
2381
- const TaskGantt = _ref => {
2382
- let {
2383
- gridProps,
2384
- calendarProps,
2385
- barProps,
2386
- ganttHeight,
2387
- scrollY,
2388
- scrollX
2389
- } = _ref;
2390
- const ganttSVGRef = useRef(null);
2391
- const horizontalContainerRef = useRef(null);
2392
- const verticalGanttContainerRef = useRef(null);
2393
- const newBarProps = { ...barProps,
2436
+ var TaskGantt = function TaskGantt(_ref) {
2437
+ var gridProps = _ref.gridProps,
2438
+ calendarProps = _ref.calendarProps,
2439
+ barProps = _ref.barProps,
2440
+ ganttHeight = _ref.ganttHeight,
2441
+ scrollY = _ref.scrollY,
2442
+ scrollX = _ref.scrollX;
2443
+ var ganttSVGRef = useRef(null);
2444
+ var horizontalContainerRef = useRef(null);
2445
+ var verticalGanttContainerRef = useRef(null);
2446
+
2447
+ var newBarProps = _extends({}, barProps, {
2394
2448
  svg: ganttSVGRef
2395
- };
2396
- useEffect(() => {
2449
+ });
2450
+
2451
+ useEffect(function () {
2397
2452
  if (horizontalContainerRef.current) {
2398
2453
  horizontalContainerRef.current.scrollTop = scrollY;
2399
2454
  }
2400
2455
  }, [scrollY]);
2401
- useEffect(() => {
2456
+ useEffect(function () {
2402
2457
  if (verticalGanttContainerRef.current) {
2403
2458
  verticalGanttContainerRef.current.scrollLeft = scrollX;
2404
2459
  }
@@ -2432,16 +2487,14 @@ const TaskGantt = _ref => {
2432
2487
 
2433
2488
  var styles$a = {"scrollWrapper":"_2k9Ys","scroll":"_19jgW"};
2434
2489
 
2435
- const HorizontalScroll = _ref => {
2436
- let {
2437
- scroll,
2438
- svgWidth,
2439
- taskListWidth,
2440
- rtl,
2441
- onScroll
2442
- } = _ref;
2443
- const scrollRef = useRef(null);
2444
- useEffect(() => {
2490
+ var HorizontalScroll = function HorizontalScroll(_ref) {
2491
+ var scroll = _ref.scroll,
2492
+ svgWidth = _ref.svgWidth,
2493
+ taskListWidth = _ref.taskListWidth,
2494
+ rtl = _ref.rtl,
2495
+ onScroll = _ref.onScroll;
2496
+ var scrollRef = useRef(null);
2497
+ useEffect(function () {
2445
2498
  if (scrollRef.current) {
2446
2499
  scrollRef.current.scrollLeft = scroll;
2447
2500
  }
@@ -2449,7 +2502,7 @@ const HorizontalScroll = _ref => {
2449
2502
  return React.createElement("div", {
2450
2503
  dir: "ltr",
2451
2504
  style: {
2452
- margin: rtl ? `0px ${taskListWidth}px 0px 0px` : `0px 0px 0px ${taskListWidth}px`
2505
+ margin: rtl ? "0px " + taskListWidth + "px 0px 0px" : "0px 0px 0px " + taskListWidth + "px"
2453
2506
  },
2454
2507
  className: styles$a.scrollWrapper,
2455
2508
  onScroll: onScroll,
@@ -2466,6 +2519,12 @@ var Gantt = function Gantt(_ref) {
2466
2519
  var tasks = _ref.tasks,
2467
2520
  _ref$leafTasks = _ref.leafTasks,
2468
2521
  leafTasks = _ref$leafTasks === void 0 ? [] : _ref$leafTasks,
2522
+ _ref$scheduleType = _ref.scheduleType,
2523
+ scheduleType = _ref$scheduleType === void 0 ? "main" : _ref$scheduleType,
2524
+ _ref$startDate = _ref.startDate,
2525
+ startDate = _ref$startDate === void 0 ? new Date() : _ref$startDate,
2526
+ _ref$endDate = _ref.endDate,
2527
+ endDate = _ref$endDate === void 0 ? new Date() : _ref$endDate,
2469
2528
  _ref$headerHeight = _ref.headerHeight,
2470
2529
  headerHeight = _ref$headerHeight === void 0 ? 50 : _ref$headerHeight,
2471
2530
  _ref$columnWidth = _ref.columnWidth,
@@ -2522,6 +2581,8 @@ var Gantt = function Gantt(_ref) {
2522
2581
  arrowIndent = _ref$arrowIndent === void 0 ? 20 : _ref$arrowIndent,
2523
2582
  _ref$todayColor = _ref.todayColor,
2524
2583
  todayColor = _ref$todayColor === void 0 ? "rgba(252, 248, 227, 0.5)" : _ref$todayColor,
2584
+ _ref$weekendColor = _ref.weekendColor,
2585
+ weekendColor = _ref$weekendColor === void 0 ? "#f5f5f5" : _ref$weekendColor,
2525
2586
  viewDate = _ref.viewDate,
2526
2587
  _ref$TooltipContent = _ref.TooltipContent,
2527
2588
  TooltipContent = _ref$TooltipContent === void 0 ? StandardTooltipContent : _ref$TooltipContent,
@@ -2536,20 +2597,25 @@ var Gantt = function Gantt(_ref) {
2536
2597
  onDelete = _ref.onDelete,
2537
2598
  onSelect = _ref.onSelect,
2538
2599
  onExpanderClick = _ref.onExpanderClick,
2539
- taskLabelRenderer = _ref.taskLabelRenderer,
2540
- selectedTaskIds = _ref.selectedTaskIds,
2541
- onTaskSelectionChange = _ref.onTaskSelectionChange;
2600
+ taskLabelRenderer = _ref.taskLabelRenderer;
2542
2601
  var wrapperRef = useRef(null);
2543
2602
  var taskListRef = useRef(null);
2544
2603
 
2545
2604
  var _useState = useState(function () {
2546
2605
  var _ganttDateRange = ganttDateRange(tasks, viewMode, preStepsCount),
2547
- startDate = _ganttDateRange[0],
2548
- endDate = _ganttDateRange[1];
2606
+ startDateRange = _ganttDateRange[0],
2607
+ endDateRange = _ganttDateRange[1];
2608
+
2609
+ if (scheduleType === "lookAhead") {
2610
+ return {
2611
+ viewMode: viewMode,
2612
+ dates: seedDates(startDate, endDate, viewMode)
2613
+ };
2614
+ }
2549
2615
 
2550
2616
  return {
2551
2617
  viewMode: viewMode,
2552
- dates: seedDates(startDate, endDate, viewMode)
2618
+ dates: seedDates(startDateRange, endDateRange, viewMode)
2553
2619
  };
2554
2620
  }),
2555
2621
  dateSetup = _useState[0],
@@ -2608,6 +2674,14 @@ var Gantt = function Gantt(_ref) {
2608
2674
  ignoreScrollEvent = _useState12[0],
2609
2675
  setIgnoreScrollEvent = _useState12[1];
2610
2676
 
2677
+ useEffect(function () {
2678
+ if (scheduleType === "lookAhead" && startDate && endDate) {
2679
+ setDateSetup({
2680
+ viewMode: viewMode,
2681
+ dates: seedDates(startDate, endDate, viewMode)
2682
+ });
2683
+ }
2684
+ }, [startDate, endDate]);
2611
2685
  useEffect(function () {
2612
2686
  var filteredTasks;
2613
2687
 
@@ -2620,10 +2694,14 @@ var Gantt = function Gantt(_ref) {
2620
2694
  filteredTasks = filteredTasks.sort(sortTasks);
2621
2695
 
2622
2696
  var _ganttDateRange2 = ganttDateRange(filteredTasks, viewMode, preStepsCount),
2623
- startDate = _ganttDateRange2[0],
2624
- endDate = _ganttDateRange2[1];
2697
+ startDateRange = _ganttDateRange2[0],
2698
+ endDateRange = _ganttDateRange2[1];
2699
+
2700
+ var newDates = seedDates(startDateRange, endDateRange, viewMode);
2625
2701
 
2626
- var newDates = seedDates(startDate, endDate, viewMode);
2702
+ if (scheduleType === "lookAhead") {
2703
+ newDates = seedDates(startDate, endDate, viewMode);
2704
+ }
2627
2705
 
2628
2706
  if (rtl) {
2629
2707
  newDates = newDates.reverse();
@@ -2633,10 +2711,12 @@ var Gantt = function Gantt(_ref) {
2633
2711
  }
2634
2712
  }
2635
2713
 
2636
- setDateSetup({
2637
- dates: newDates,
2638
- viewMode: viewMode
2639
- });
2714
+ if (scheduleType !== "lookAhead") {
2715
+ setDateSetup({
2716
+ dates: seedDates(startDateRange, endDateRange, viewMode),
2717
+ viewMode: viewMode
2718
+ });
2719
+ }
2640
2720
 
2641
2721
  var _getCriticalPaths = getCriticalPaths(leafTasks),
2642
2722
  primaryPath = _getCriticalPaths[0],
@@ -2863,9 +2943,11 @@ var Gantt = function Gantt(_ref) {
2863
2943
  columnWidth: columnWidth,
2864
2944
  svgWidth: svgWidth,
2865
2945
  tasks: tasks,
2946
+ scheduleType: scheduleType,
2866
2947
  rowHeight: rowHeight,
2867
2948
  dates: dateSetup.dates,
2868
2949
  todayColor: todayColor,
2950
+ weekendColor: weekendColor,
2869
2951
  rtl: rtl
2870
2952
  };
2871
2953
  var calendarProps = {
@@ -2909,6 +2991,7 @@ var Gantt = function Gantt(_ref) {
2909
2991
  fontSize: fontSize,
2910
2992
  tasks: barTasks,
2911
2993
  leafTasks: leafTasks,
2994
+ scheduleType: scheduleType,
2912
2995
  locale: locale,
2913
2996
  headerHeight: headerHeight,
2914
2997
  scrollY: scrollY,
@@ -2921,9 +3004,7 @@ var Gantt = function Gantt(_ref) {
2921
3004
  onDoubleClick: onDoubleClick,
2922
3005
  TaskListHeader: TaskListHeader,
2923
3006
  TaskListTable: TaskListTable,
2924
- taskLabelRenderer: taskLabelRenderer,
2925
- selectedTaskIds: selectedTaskIds,
2926
- onTaskSelectionChange: onTaskSelectionChange
3007
+ taskLabelRenderer: taskLabelRenderer
2927
3008
  };
2928
3009
  return React.createElement("div", null, React.createElement("div", {
2929
3010
  className: styles$9.wrapper,