gantt-task-react-powern 0.4.63 → 0.4.65

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