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