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