gantt-task-react-powern 0.4.61 → 0.4.63

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,10 +21,6 @@ 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
-
28
24
  function _unsupportedIterableToArray(o, minLen) {
29
25
  if (!o) return;
30
26
  if (typeof o === "string") return _arrayLikeToArray(o, minLen);
@@ -281,11 +277,13 @@ var getDaysInMonth = function getDaysInMonth(month, year) {
281
277
 
282
278
  var styles = {"ganttTable":"_3_ygE","ganttTable_Header":"_1nBOt","ganttTable_HeaderSeparator":"_2eZzQ","ganttTable_HeaderItem":"_WuQ0f"};
283
279
 
284
- var TaskListHeaderDefault = function TaskListHeaderDefault(_ref) {
285
- var headerHeight = _ref.headerHeight,
286
- fontFamily = _ref.fontFamily,
287
- fontSize = _ref.fontSize,
288
- rowWidth = _ref.rowWidth;
280
+ const TaskListHeaderDefault = _ref => {
281
+ let {
282
+ headerHeight,
283
+ fontFamily,
284
+ fontSize,
285
+ rowWidth
286
+ } = _ref;
289
287
  return React__default.createElement("div", {
290
288
  className: styles.ganttTable,
291
289
  style: {
@@ -342,59 +340,59 @@ var TaskListHeaderDefault = function TaskListHeaderDefault(_ref) {
342
340
  }, "Planned End")));
343
341
  };
344
342
 
345
- var styles$1 = {"taskListWrapper":"_3ZbQT","taskListTableRow":"_34SS0","taskListCell":"_3lLk3","taskListNameWrapper":"_nI1Xw","taskListExpander":"_2QjE6","taskListExpanderPlaceholder":"_1fnLB","taskListEmptyExpander":"_2TfEi","taskListText":"_2ZvXU"};
343
+ var styles$1 = {"taskListWrapper":"_3ZbQT","taskListTableRow":"_34SS0","taskListCell":"_3lLk3","taskListNameWrapper":"_nI1Xw","taskListExpander":"_2QjE6","taskListExpanderPlaceholder":"_1fnLB","taskListEmptyExpander":"_2TfEi","taskListText":"_2ZvXU","taskListCheckbox":"_1KIaF"};
346
344
 
347
- var localeDateStringCache = {};
345
+ const localeDateStringCache = {};
348
346
 
349
- var toLocaleDateStringFactory = function toLocaleDateStringFactory(locale) {
350
- return function (date, dateTimeOptions) {
351
- if (!date || date.getTime() === 0) return "";
352
- var key = date.toString();
353
- var lds = localeDateStringCache[key];
347
+ const toLocaleDateStringFactory = locale => (date, dateTimeOptions) => {
348
+ if (!date || date.getTime() === 0) return "";
349
+ const key = date.toString();
350
+ let lds = localeDateStringCache[key];
354
351
 
355
- if (!lds) {
356
- lds = date.toLocaleDateString(locale, dateTimeOptions);
357
- localeDateStringCache[key] = lds;
358
- }
352
+ if (!lds) {
353
+ lds = date.toLocaleDateString(locale, dateTimeOptions);
354
+ localeDateStringCache[key] = lds;
355
+ }
359
356
 
360
- return lds;
361
- };
357
+ return lds;
362
358
  };
363
359
 
364
- var dateTimeOptions = {
360
+ const dateTimeOptions = {
365
361
  year: "numeric",
366
362
  month: "numeric",
367
363
  day: "numeric"
368
364
  };
369
- var TaskListTableDefault = function TaskListTableDefault(_ref) {
370
- var rowHeight = _ref.rowHeight,
371
- rowWidth = _ref.rowWidth,
372
- tasks = _ref.tasks,
373
- leafTasks = _ref.leafTasks,
374
- fontFamily = _ref.fontFamily,
375
- fontSize = _ref.fontSize,
376
- locale = _ref.locale,
377
- onExpanderClick = _ref.onExpanderClick,
378
- _ref$taskLabelRendere = _ref.taskLabelRenderer,
379
- taskLabelRenderer = _ref$taskLabelRendere === void 0 ? function (t) {
380
- return " " + t.name;
381
- } : _ref$taskLabelRendere;
382
- var toLocaleDateString = React.useMemo(function () {
383
- return toLocaleDateStringFactory(locale);
384
- }, [locale]);
385
- var leafTaskIds = React.useMemo(function () {
386
- return new Set(leafTasks.map(function (t) {
387
- return t.id;
388
- }));
389
- }, [leafTasks]);
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]);
390
388
  return React__default.createElement("div", {
391
389
  className: styles$1.taskListWrapper,
392
390
  style: {
393
391
  fontFamily: fontFamily,
394
392
  fontSize: fontSize
395
393
  }
396
- }, tasks.map(function (t) {
397
- var expanderSymbol = "";
394
+ }, tasks.map(t => {
395
+ let expanderSymbol = "";
398
396
 
399
397
  if (!leafTaskIds.has(t.id)) {
400
398
  if (t.hideChildren === false) {
@@ -404,13 +402,27 @@ var TaskListTableDefault = function TaskListTableDefault(_ref) {
404
402
  }
405
403
  }
406
404
 
405
+ const isChecked = selectedTaskIds.includes(t.id);
407
406
  return React__default.createElement("div", {
408
407
  className: styles$1.taskListTableRow,
409
408
  style: {
410
409
  height: rowHeight
411
410
  },
412
- key: t.id + "row"
411
+ key: `${t.id}row`
413
412
  }, React__default.createElement("div", {
413
+ className: styles$1.taskListCell,
414
+ style: {
415
+ minWidth: "40px",
416
+ maxWidth: "40px"
417
+ }
418
+ }, React__default.createElement("div", {
419
+ className: styles$1.taskListCheckbox
420
+ }, React__default.createElement("input", {
421
+ type: "checkbox",
422
+ checked: isChecked,
423
+ onChange: e => handleCheckboxChange(t.id, e.target.checked),
424
+ onClick: e => e.stopPropagation()
425
+ }))), React__default.createElement("div", {
414
426
  className: styles$1.taskListCell,
415
427
  style: {
416
428
  minWidth: parseInt(rowWidth) * 0.8,
@@ -420,18 +432,17 @@ var TaskListTableDefault = function TaskListTableDefault(_ref) {
420
432
  }, React__default.createElement("div", {
421
433
  className: styles$1.taskListNameWrapper,
422
434
  style: {
423
- paddingLeft: t.depth * 4 + "px"
435
+ paddingLeft: `${t.depth * 4}px`
424
436
  }
425
437
  }, !leafTaskIds.has(t.id) ? React__default.createElement("div", {
426
438
  className: styles$1.taskListExpander,
427
- onClick: function onClick() {
428
- return onExpanderClick(t);
429
- }
439
+ onClick: () => onExpanderClick(t)
430
440
  }, expanderSymbol) : React__default.createElement("div", {
431
441
  className: styles$1.taskListExpanderPlaceholder
432
442
  }), React__default.createElement("div", {
433
443
  className: styles$1.taskListText
434
444
  }, t.id, " ", t.actualEnd.getTime() > 0 && t.actualEnd.getTime() < Date.now() ? React__default.createElement("span", {
445
+ title: "Task Complete",
435
446
  style: {
436
447
  color: "limegreen",
437
448
  fontSize: "16px"
@@ -453,7 +464,7 @@ var TaskListTableDefault = function TaskListTableDefault(_ref) {
453
464
  }
454
465
  }, React__default.createElement("div", {
455
466
  className: styles$1.taskListText
456
- }, "\xA0", toLocaleDateString(t.start, dateTimeOptions))), React__default.createElement("div", {
467
+ }, "\u00A0", toLocaleDateString(t.start, dateTimeOptions))), React__default.createElement("div", {
457
468
  className: styles$1.taskListCell,
458
469
  style: {
459
470
  minWidth: parseInt(rowWidth) * 0.6,
@@ -461,43 +472,38 @@ var TaskListTableDefault = function TaskListTableDefault(_ref) {
461
472
  }
462
473
  }, React__default.createElement("div", {
463
474
  className: styles$1.taskListText
464
- }, "\xA0", toLocaleDateString(t.end, dateTimeOptions))));
475
+ }, "\u00A0", toLocaleDateString(t.end, dateTimeOptions))));
465
476
  }));
466
477
  };
467
478
 
468
479
  var styles$2 = {"tooltipDefaultContainer":"_3T42e","tooltipDefaultContainerParagraph":"_29NTg","tooltipDetailsContainer":"_25P-K","tooltipDetailsContainerHidden":"_3gVAq"};
469
480
 
470
- var Tooltip = function Tooltip(_ref) {
471
- var task = _ref.task,
472
- type = _ref.type,
473
- rowHeight = _ref.rowHeight,
474
- rtl = _ref.rtl,
475
- svgContainerHeight = _ref.svgContainerHeight,
476
- svgContainerWidth = _ref.svgContainerWidth,
477
- scrollX = _ref.scrollX,
478
- scrollY = _ref.scrollY,
479
- arrowIndent = _ref.arrowIndent,
480
- fontSize = _ref.fontSize,
481
- fontFamily = _ref.fontFamily,
482
- headerHeight = _ref.headerHeight,
483
- taskListWidth = _ref.taskListWidth,
484
- TooltipContent = _ref.TooltipContent;
485
- var tooltipRef = React.useRef(null);
486
-
487
- var _useState = React.useState(0),
488
- relatedY = _useState[0],
489
- setRelatedY = _useState[1];
490
-
491
- var _useState2 = React.useState(0),
492
- relatedX = _useState2[0],
493
- setRelatedX = _useState2[1];
494
-
495
- React.useEffect(function () {
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(() => {
496
502
  if (tooltipRef.current) {
497
- var tooltipHeight = tooltipRef.current.offsetHeight * 1.1;
498
- var tooltipWidth = tooltipRef.current.offsetWidth * 1.1;
499
- var newRelatedY = task.index * rowHeight - scrollY + headerHeight;
500
- var newRelatedX;
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;
501
507
 
502
508
  if (rtl) {
503
509
  newRelatedX = task.x1 - arrowIndent * 1.5 - tooltipWidth - scrollX;
@@ -506,7 +512,7 @@ var Tooltip = function Tooltip(_ref) {
506
512
  newRelatedX = task.x2 + arrowIndent * 1.5 - scrollX;
507
513
  }
508
514
 
509
- var tooltipLeftmostPoint = tooltipWidth + newRelatedX;
515
+ const tooltipLeftmostPoint = tooltipWidth + newRelatedX;
510
516
 
511
517
  if (tooltipLeftmostPoint > svgContainerWidth) {
512
518
  newRelatedX = svgContainerWidth - tooltipWidth;
@@ -514,12 +520,10 @@ var Tooltip = function Tooltip(_ref) {
514
520
  }
515
521
  } else {
516
522
  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;
517
525
 
518
- var _tooltipLeftmostPoint = tooltipWidth + newRelatedX;
519
-
520
- var fullChartWidth = taskListWidth + svgContainerWidth;
521
-
522
- if (_tooltipLeftmostPoint > fullChartWidth) {
526
+ if (tooltipLeftmostPoint > fullChartWidth) {
523
527
  newRelatedX = type == "planned" ? task.x1 + taskListWidth - arrowIndent * 1.5 - scrollX - tooltipWidth : task.actualx1 + taskListWidth - arrowIndent * 1.5 - scrollX - tooltipWidth;
524
528
  }
525
529
 
@@ -529,7 +533,7 @@ var Tooltip = function Tooltip(_ref) {
529
533
  }
530
534
  }
531
535
 
532
- var tooltipLowerPoint = tooltipHeight + newRelatedY - scrollY;
536
+ const tooltipLowerPoint = tooltipHeight + newRelatedY - scrollY;
533
537
 
534
538
  if (tooltipLowerPoint > svgContainerHeight - scrollY) {
535
539
  newRelatedY = svgContainerHeight - tooltipHeight;
@@ -553,14 +557,16 @@ var Tooltip = function Tooltip(_ref) {
553
557
  type: type
554
558
  }));
555
559
  };
556
- var StandardTooltipContent = function StandardTooltipContent(_ref2) {
557
- var task = _ref2.task,
558
- fontSize = _ref2.fontSize,
559
- fontFamily = _ref2.fontFamily,
560
- type = _ref2.type;
561
- var style = {
562
- fontSize: fontSize,
563
- fontFamily: fontFamily
560
+ const StandardTooltipContent = _ref2 => {
561
+ let {
562
+ task,
563
+ fontSize,
564
+ fontFamily,
565
+ type
566
+ } = _ref2;
567
+ const style = {
568
+ fontSize,
569
+ fontFamily
564
570
  };
565
571
  if (type == "planned") return React__default.createElement("div", {
566
572
  className: styles$2.tooltipDefaultContainer,
@@ -569,35 +575,37 @@ var StandardTooltipContent = function StandardTooltipContent(_ref2) {
569
575
  style: {
570
576
  fontSize: fontSize + 6
571
577
  }
572
- }, 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", {
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", {
573
579
  className: styles$2.tooltipDefaultContainerParagraph
574
- }, "Duration: " + ~~((task.end.getTime() - task.start.getTime()) / (1000 * 60 * 60 * 24)) + " day(s)"), React__default.createElement("p", {
580
+ }, `Duration: ${~~((task.end.getTime() - task.start.getTime()) / (1000 * 60 * 60 * 24))} day(s)`), React__default.createElement("p", {
575
581
  className: styles$2.tooltipDefaultContainerParagraph
576
- }, !!task.progress && "Progress: " + task.progress + " %"));else return React__default.createElement("div", {
582
+ }, !!task.progress && `Progress: ${task.progress} %`));else return React__default.createElement("div", {
577
583
  className: styles$2.tooltipDefaultContainer,
578
584
  style: style
579
585
  }, React__default.createElement("b", {
580
586
  style: {
581
587
  fontSize: fontSize + 6
582
588
  }
583
- }, 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", {
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", {
584
590
  className: styles$2.tooltipDefaultContainerParagraph
585
- }, "Duration: " + ~~((task.actualEnd.getTime() - task.actualStart.getTime()) / (1000 * 60 * 60 * 24)) + " day(s)"), React__default.createElement("p", {
591
+ }, `Duration: ${~~((task.actualEnd.getTime() - task.actualStart.getTime()) / (1000 * 60 * 60 * 24))} day(s)`), React__default.createElement("p", {
586
592
  className: styles$2.tooltipDefaultContainerParagraph
587
- }, !!task.progress && "Progress: " + task.progress + " %"));
593
+ }, !!task.progress && `Progress: ${task.progress} %`));
588
594
  };
589
595
 
590
596
  var styles$3 = {"scroll":"_1eT-t"};
591
597
 
592
- var VerticalScroll = function VerticalScroll(_ref) {
593
- var scroll = _ref.scroll,
594
- ganttHeight = _ref.ganttHeight,
595
- ganttFullHeight = _ref.ganttFullHeight,
596
- headerHeight = _ref.headerHeight,
597
- rtl = _ref.rtl,
598
- onScroll = _ref.onScroll;
599
- var scrollRef = React.useRef(null);
600
- React.useEffect(function () {
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(() => {
601
609
  if (scrollRef.current) {
602
610
  scrollRef.current.scrollTop = scroll;
603
611
  }
@@ -620,50 +628,56 @@ var VerticalScroll = function VerticalScroll(_ref) {
620
628
  }));
621
629
  };
622
630
 
623
- var TaskList = function TaskList(_ref) {
624
- var headerHeight = _ref.headerHeight,
625
- fontFamily = _ref.fontFamily,
626
- fontSize = _ref.fontSize,
627
- rowWidth = _ref.rowWidth,
628
- rowHeight = _ref.rowHeight,
629
- scrollY = _ref.scrollY,
630
- tasks = _ref.tasks,
631
- leafTasks = _ref.leafTasks,
632
- selectedTask = _ref.selectedTask,
633
- setSelectedTask = _ref.setSelectedTask,
634
- onExpanderClick = _ref.onExpanderClick,
635
- locale = _ref.locale,
636
- ganttHeight = _ref.ganttHeight,
637
- taskListRef = _ref.taskListRef,
638
- horizontalContainerClass = _ref.horizontalContainerClass,
639
- TaskListHeader = _ref.TaskListHeader,
640
- TaskListTable = _ref.TaskListTable,
641
- taskLabelRenderer = _ref.taskLabelRenderer;
642
- var horizontalContainerRef = React.useRef(null);
643
- React.useEffect(function () {
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(() => {
644
656
  if (horizontalContainerRef.current) {
645
657
  horizontalContainerRef.current.scrollTop = scrollY;
646
658
  }
647
659
  }, [scrollY]);
648
- var headerProps = {
649
- headerHeight: headerHeight,
650
- fontFamily: fontFamily,
651
- fontSize: fontSize,
652
- rowWidth: rowWidth
660
+ const headerProps = {
661
+ headerHeight,
662
+ fontFamily,
663
+ fontSize,
664
+ rowWidth
653
665
  };
654
- var selectedTaskId = selectedTask ? selectedTask.id : "";
655
- var tableProps = {
656
- rowHeight: rowHeight,
657
- rowWidth: rowWidth,
658
- fontFamily: fontFamily,
659
- fontSize: fontSize,
660
- tasks: tasks,
661
- leafTasks: leafTasks,
662
- locale: locale,
666
+ const selectedTaskId = selectedTask ? selectedTask.id : "";
667
+ const tableProps = {
668
+ rowHeight,
669
+ rowWidth,
670
+ fontFamily,
671
+ fontSize,
672
+ tasks,
673
+ leafTasks,
674
+ locale,
663
675
  selectedTaskId: selectedTaskId,
664
- setSelectedTask: setSelectedTask,
665
- onExpanderClick: onExpanderClick,
666
- taskLabelRenderer: taskLabelRenderer
676
+ setSelectedTask,
677
+ onExpanderClick,
678
+ taskLabelRenderer,
679
+ selectedTaskIds,
680
+ onTaskSelectionChange
667
681
  };
668
682
  return React__default.createElement("div", {
669
683
  ref: taskListRef
@@ -678,17 +692,19 @@ var TaskList = function TaskList(_ref) {
678
692
 
679
693
  var styles$4 = {"gridRow":"_2dZTy","gridRowLine":"_3rUKi","gridTick":"_RuwuK","darkerGridRow":"_2M-tt"};
680
694
 
681
- var GridBody = function GridBody(_ref) {
682
- var tasks = _ref.tasks,
683
- dates = _ref.dates,
684
- rowHeight = _ref.rowHeight,
685
- svgWidth = _ref.svgWidth,
686
- columnWidth = _ref.columnWidth,
687
- todayColor = _ref.todayColor,
688
- rtl = _ref.rtl;
689
- var y = 0;
690
- var gridRows = [];
691
- var rowLines = [React__default.createElement("line", {
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", {
692
708
  key: "RowLineFirst",
693
709
  x: "0",
694
710
  y1: 0,
@@ -697,9 +713,8 @@ var GridBody = function GridBody(_ref) {
697
713
  className: styles$4.gridRowLine
698
714
  })];
699
715
 
700
- for (var _iterator = _createForOfIteratorHelperLoose(tasks), _step; !(_step = _iterator()).done;) {
701
- var task = _step.value;
702
- var isDarkerRow = task.type === "milestone";
716
+ for (const task of tasks) {
717
+ const isDarkerRow = task.type === "milestone";
703
718
  gridRows.push(React__default.createElement("rect", {
704
719
  key: "Row" + task.id,
705
720
  x: "0",
@@ -719,13 +734,13 @@ var GridBody = function GridBody(_ref) {
719
734
  y += rowHeight;
720
735
  }
721
736
 
722
- var now = new Date();
723
- var tickX = 0;
724
- var ticks = [];
725
- var today = React__default.createElement("rect", null);
737
+ const now = new Date();
738
+ let tickX = 0;
739
+ const ticks = [];
740
+ let today = React__default.createElement("rect", null);
726
741
 
727
- for (var i = 0; i < dates.length; i++) {
728
- var date = dates[i];
742
+ for (let i = 0; i < dates.length; i++) {
743
+ const date = dates[i];
729
744
  ticks.push(React__default.createElement("line", {
730
745
  key: date.getTime(),
731
746
  x1: tickX,
@@ -771,7 +786,7 @@ var GridBody = function GridBody(_ref) {
771
786
  }, today));
772
787
  };
773
788
 
774
- var Grid = function Grid(props) {
789
+ const Grid = props => {
775
790
  return React__default.createElement("g", {
776
791
  className: "grid"
777
792
  }, React__default.createElement(GridBody, Object.assign({}, props)));
@@ -779,16 +794,17 @@ var Grid = function Grid(props) {
779
794
 
780
795
  var styles$5 = {"calendarBottomText":"_9w8d5","calendarTopTick":"_1rLuZ","calendarTopText":"_2q1Kt","calendarHeader":"_35nLX","textAnchorStart":"_2Shd-","textAnchorMiddle":"_2XXW4","textAnchorEnd":"_3GdnC"};
781
796
 
782
- var TopPartOfCalendar = function TopPartOfCalendar(_ref) {
783
- var value = _ref.value,
784
- x1Line = _ref.x1Line,
785
- y1Line = _ref.y1Line,
786
- y2Line = _ref.y2Line,
787
- xText = _ref.xText,
788
- yText = _ref.yText,
789
- _ref$textAnchor = _ref.textAnchor,
790
- textAnchor = _ref$textAnchor === void 0 ? "middle" : _ref$textAnchor;
791
- var textAnchorClass = textAnchor === "start" ? styles$5.textAnchorStart : textAnchor === "middle" ? styles$5.textAnchorMiddle : styles$5.textAnchorEnd;
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;
792
808
  return React__default.createElement("g", {
793
809
  className: "calendarTop"
794
810
  }, React__default.createElement("line", {
@@ -802,28 +818,30 @@ var TopPartOfCalendar = function TopPartOfCalendar(_ref) {
802
818
  key: value + "text",
803
819
  y: yText,
804
820
  x: xText,
805
- className: styles$5.calendarTopText + " " + textAnchorClass
821
+ className: `${styles$5.calendarTopText} ${textAnchorClass}`
806
822
  }, value));
807
823
  };
808
824
 
809
- var Calendar = function Calendar(_ref) {
810
- var dateSetup = _ref.dateSetup,
811
- locale = _ref.locale,
812
- viewMode = _ref.viewMode,
813
- rtl = _ref.rtl,
814
- headerHeight = _ref.headerHeight,
815
- columnWidth = _ref.columnWidth,
816
- fontFamily = _ref.fontFamily,
817
- fontSize = _ref.fontSize;
818
-
819
- var getCalendarValuesForYear = function getCalendarValuesForYear() {
820
- var topValues = [];
821
- var bottomValues = [];
822
- var topDefaultHeight = headerHeight * 0.5;
823
-
824
- for (var i = 0; i < dateSetup.dates.length; i++) {
825
- var date = dateSetup.dates[i];
826
- var bottomValue = date.getFullYear();
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();
827
845
  bottomValues.push(React__default.createElement("text", {
828
846
  key: date.getFullYear(),
829
847
  y: headerHeight * 0.8,
@@ -832,8 +850,8 @@ var Calendar = function Calendar(_ref) {
832
850
  }, bottomValue));
833
851
 
834
852
  if (i === 0 || date.getFullYear() !== dateSetup.dates[i - 1].getFullYear()) {
835
- var topValue = date.getFullYear().toString();
836
- var xText = void 0;
853
+ const topValue = date.getFullYear().toString();
854
+ let xText;
837
855
 
838
856
  if (rtl) {
839
857
  xText = (6 + i + date.getFullYear() + 1) * columnWidth;
@@ -856,25 +874,25 @@ var Calendar = function Calendar(_ref) {
856
874
  return [topValues, bottomValues];
857
875
  };
858
876
 
859
- var getCalendarValuesForQuarter = function getCalendarValuesForQuarter() {
860
- var topValues = [];
861
- var bottomValues = [];
862
- var topDefaultHeight = headerHeight * 0.5;
877
+ const getCalendarValuesForQuarter = () => {
878
+ const topValues = [];
879
+ const bottomValues = [];
880
+ const topDefaultHeight = headerHeight * 0.5;
863
881
 
864
- for (var i = 0; i < dateSetup.dates.length; i++) {
865
- var date = dateSetup.dates[i];
866
- var quarter = Math.floor(date.getMonth() / 3) + 1;
867
- var bottomValue = "Q" + quarter;
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}`;
868
886
  bottomValues.push(React__default.createElement("text", {
869
- key: bottomValue + "-" + date.getFullYear(),
887
+ key: `${bottomValue}-${date.getFullYear()}`,
870
888
  y: headerHeight * 0.8,
871
889
  x: columnWidth * i + columnWidth * 0.5,
872
890
  className: styles$5.calendarBottomText
873
891
  }, bottomValue));
874
892
 
875
893
  if (i === 0 || date.getFullYear() !== dateSetup.dates[i - 1].getFullYear()) {
876
- var topValue = date.getFullYear().toString();
877
- var xText = void 0;
894
+ const topValue = date.getFullYear().toString();
895
+ let xText;
878
896
 
879
897
  if (rtl) {
880
898
  xText = (3 + i + quarter) * columnWidth;
@@ -897,26 +915,26 @@ var Calendar = function Calendar(_ref) {
897
915
  return [topValues, bottomValues];
898
916
  };
899
917
 
900
- var getCalendarValuesForMonth = function getCalendarValuesForMonth() {
901
- var topValues = [];
902
- var bottomValues = [];
903
- var topDefaultHeight = headerHeight * 0.5;
918
+ const getCalendarValuesForMonth = () => {
919
+ const topValues = [];
920
+ const bottomValues = [];
921
+ const topDefaultHeight = headerHeight * 0.5;
904
922
 
905
- for (var i = 0; i < dateSetup.dates.length; i++) {
906
- var date = dateSetup.dates[i];
907
- var bottomValue = date.toLocaleString(locale, {
923
+ for (let i = 0; i < dateSetup.dates.length; i++) {
924
+ const date = dateSetup.dates[i];
925
+ const bottomValue = date.toLocaleString(locale, {
908
926
  month: "short"
909
927
  });
910
928
  bottomValues.push(React__default.createElement("text", {
911
929
  key: bottomValue + date.getFullYear(),
912
930
  y: headerHeight * 0.8,
913
931
  x: columnWidth * i + columnWidth * 0.5,
914
- className: styles$5.calendarTopText + " " + styles$5.textAnchorEnd
932
+ className: `${styles$5.calendarTopText} ${styles$5.textAnchorEnd}`
915
933
  }, bottomValue));
916
934
 
917
935
  if (i === 0 || date.getFullYear() !== dateSetup.dates[i - 1].getFullYear()) {
918
- var topValue = date.getFullYear().toString();
919
- var xText = void 0;
936
+ const topValue = date.getFullYear().toString();
937
+ let xText;
920
938
 
921
939
  if (rtl) {
922
940
  xText = (6 + i + date.getMonth() + 1) * columnWidth;
@@ -941,27 +959,27 @@ var Calendar = function Calendar(_ref) {
941
959
  return [topValues, bottomValues];
942
960
  };
943
961
 
944
- var getCalendarValuesForWeek = function getCalendarValuesForWeek() {
945
- var topValues = [];
946
- var bottomValues = [];
947
- var weeksCount = 1;
948
- var topDefaultHeight = headerHeight * 0.5;
949
- var dates = dateSetup.dates;
962
+ const getCalendarValuesForWeek = () => {
963
+ const topValues = [];
964
+ const bottomValues = [];
965
+ let weeksCount = 1;
966
+ const topDefaultHeight = headerHeight * 0.5;
967
+ const dates = dateSetup.dates;
950
968
 
951
- for (var i = dates.length - 1; i >= 0; i--) {
952
- var date = dates[i];
953
- var topValue = "";
969
+ for (let i = dates.length - 1; i >= 0; i--) {
970
+ const date = dates[i];
971
+ let topValue = "";
954
972
 
955
973
  if (i === 0 || date.getMonth() !== dates[i - 1].getMonth()) {
956
- topValue = getLocaleMonth(date, locale) + ", " + date.getFullYear();
974
+ topValue = `${getLocaleMonth(date, locale)}, ${date.getFullYear()}`;
957
975
  }
958
976
 
959
- var bottomValue = "W" + getWeekNumberISO8601(date);
977
+ const bottomValue = `W${getWeekNumberISO8601(date)}`;
960
978
  bottomValues.push(React__default.createElement("text", {
961
979
  key: date.getTime(),
962
980
  y: headerHeight * 0.8,
963
981
  x: columnWidth * (i + +rtl),
964
- className: styles$5.calendarTopText + " " + styles$5.textAnchorStart
982
+ className: `${styles$5.calendarTopText} ${styles$5.textAnchorStart}`
965
983
  }, bottomValue));
966
984
 
967
985
  if (topValue) {
@@ -987,24 +1005,24 @@ var Calendar = function Calendar(_ref) {
987
1005
  return [topValues, bottomValues];
988
1006
  };
989
1007
 
990
- var getCalendarValuesForDay = function getCalendarValuesForDay() {
991
- var topValues = [];
992
- var bottomValues = [];
993
- var topDefaultHeight = headerHeight * 0.5;
994
- var dates = dateSetup.dates;
1008
+ const getCalendarValuesForDay = () => {
1009
+ const topValues = [];
1010
+ const bottomValues = [];
1011
+ const topDefaultHeight = headerHeight * 0.5;
1012
+ const dates = dateSetup.dates;
995
1013
 
996
- for (var i = 0; i < dates.length; i++) {
997
- var date = dates[i];
998
- var bottomValue = getLocalDayOfWeek(date, locale, "short") + ", " + date.getDate().toString();
1014
+ for (let i = 0; i < dates.length; i++) {
1015
+ const date = dates[i];
1016
+ const bottomValue = `${getLocalDayOfWeek(date, locale, "short")}, ${date.getDate().toString()}`;
999
1017
  bottomValues.push(React__default.createElement("text", {
1000
1018
  key: date.getTime(),
1001
1019
  y: headerHeight * 0.8,
1002
1020
  x: columnWidth * i + columnWidth * 0.5,
1003
- className: styles$5.calendarTopText + " " + styles$5.textAnchorMiddle
1021
+ className: `${styles$5.calendarTopText} ${styles$5.textAnchorMiddle}`
1004
1022
  }, bottomValue));
1005
1023
 
1006
1024
  if (i + 1 !== dates.length && date.getMonth() !== dates[i + 1].getMonth()) {
1007
- var topValue = getLocaleMonth(date, locale) + " " + date.getFullYear();
1025
+ const topValue = `${getLocaleMonth(date, locale)} ${date.getFullYear()}`;
1008
1026
  topValues.push(React__default.createElement(TopPartOfCalendar, {
1009
1027
  key: topValue + date.getFullYear(),
1010
1028
  value: topValue,
@@ -1020,28 +1038,28 @@ var Calendar = function Calendar(_ref) {
1020
1038
  return [topValues, bottomValues];
1021
1039
  };
1022
1040
 
1023
- var getCalendarValuesForPartOfDay = function getCalendarValuesForPartOfDay() {
1024
- var topValues = [];
1025
- var bottomValues = [];
1026
- var ticks = viewMode === exports.ViewMode.HalfDay ? 2 : 4;
1027
- var topDefaultHeight = headerHeight * 0.5;
1028
- var dates = dateSetup.dates;
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;
1029
1047
 
1030
- for (var i = 0; i < dates.length; i++) {
1031
- var date = dates[i];
1032
- var bottomValue = getCachedDateTimeFormat(locale, {
1048
+ for (let i = 0; i < dates.length; i++) {
1049
+ const date = dates[i];
1050
+ const bottomValue = getCachedDateTimeFormat(locale, {
1033
1051
  hour: "numeric"
1034
1052
  }).format(date);
1035
1053
  bottomValues.push(React__default.createElement("text", {
1036
1054
  key: date.getTime(),
1037
1055
  y: headerHeight * 0.8,
1038
1056
  x: columnWidth * (i + +rtl),
1039
- className: styles$5.calendarTopText + " " + styles$5.textAnchorMiddle,
1057
+ className: `${styles$5.calendarTopText} ${styles$5.textAnchorMiddle}`,
1040
1058
  fontFamily: fontFamily
1041
1059
  }, bottomValue));
1042
1060
 
1043
1061
  if (i === 0 || date.getDate() !== dates[i - 1].getDate()) {
1044
- var topValue = getLocalDayOfWeek(date, locale, "short") + ", " + date.getDate() + " " + getLocaleMonth(date, locale);
1062
+ const topValue = `${getLocalDayOfWeek(date, locale, "short")}, ${date.getDate()} ${getLocaleMonth(date, locale)}`;
1045
1063
  topValues.push(React__default.createElement(TopPartOfCalendar, {
1046
1064
  key: topValue + date.getFullYear(),
1047
1065
  value: topValue,
@@ -1057,15 +1075,15 @@ var Calendar = function Calendar(_ref) {
1057
1075
  return [topValues, bottomValues];
1058
1076
  };
1059
1077
 
1060
- var getCalendarValuesForHour = function getCalendarValuesForHour() {
1061
- var topValues = [];
1062
- var bottomValues = [];
1063
- var topDefaultHeight = headerHeight * 0.5;
1064
- var dates = dateSetup.dates;
1078
+ const getCalendarValuesForHour = () => {
1079
+ const topValues = [];
1080
+ const bottomValues = [];
1081
+ const topDefaultHeight = headerHeight * 0.5;
1082
+ const dates = dateSetup.dates;
1065
1083
 
1066
- for (var i = 0; i < dates.length; i++) {
1067
- var date = dates[i];
1068
- var bottomValue = getCachedDateTimeFormat(locale, {
1084
+ for (let i = 0; i < dates.length; i++) {
1085
+ const date = dates[i];
1086
+ const bottomValue = getCachedDateTimeFormat(locale, {
1069
1087
  hour: "numeric"
1070
1088
  }).format(date);
1071
1089
  bottomValues.push(React__default.createElement("text", {
@@ -1077,9 +1095,9 @@ var Calendar = function Calendar(_ref) {
1077
1095
  }, bottomValue));
1078
1096
 
1079
1097
  if (i !== 0 && date.getDate() !== dates[i - 1].getDate()) {
1080
- var displayDate = dates[i - 1];
1081
- var topValue = getLocalDayOfWeek(displayDate, locale, "long") + ", " + displayDate.getDate() + " " + getLocaleMonth(displayDate, locale);
1082
- var topPosition = (date.getHours() - 24) / 2;
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;
1083
1101
  topValues.push(React__default.createElement(TopPartOfCalendar, {
1084
1102
  key: topValue + displayDate.getFullYear(),
1085
1103
  value: topValue,
@@ -1095,58 +1113,37 @@ var Calendar = function Calendar(_ref) {
1095
1113
  return [topValues, bottomValues];
1096
1114
  };
1097
1115
 
1098
- var topValues = [];
1099
- var bottomValues = [];
1116
+ let topValues = [];
1117
+ let bottomValues = [];
1100
1118
 
1101
1119
  switch (dateSetup.viewMode) {
1102
1120
  case exports.ViewMode.Year:
1103
- var _getCalendarValuesFor = getCalendarValuesForYear();
1104
-
1105
- topValues = _getCalendarValuesFor[0];
1106
- bottomValues = _getCalendarValuesFor[1];
1121
+ [topValues, bottomValues] = getCalendarValuesForYear();
1107
1122
  break;
1108
1123
 
1109
1124
  case exports.ViewMode.Quarter:
1110
- var _getCalendarValuesFor2 = getCalendarValuesForQuarter();
1111
-
1112
- topValues = _getCalendarValuesFor2[0];
1113
- bottomValues = _getCalendarValuesFor2[1];
1125
+ [topValues, bottomValues] = getCalendarValuesForQuarter();
1114
1126
  break;
1115
1127
 
1116
1128
  case exports.ViewMode.Month:
1117
- var _getCalendarValuesFor3 = getCalendarValuesForMonth();
1118
-
1119
- topValues = _getCalendarValuesFor3[0];
1120
- bottomValues = _getCalendarValuesFor3[1];
1129
+ [topValues, bottomValues] = getCalendarValuesForMonth();
1121
1130
  break;
1122
1131
 
1123
1132
  case exports.ViewMode.Week:
1124
- var _getCalendarValuesFor4 = getCalendarValuesForWeek();
1125
-
1126
- topValues = _getCalendarValuesFor4[0];
1127
- bottomValues = _getCalendarValuesFor4[1];
1133
+ [topValues, bottomValues] = getCalendarValuesForWeek();
1128
1134
  break;
1129
1135
 
1130
1136
  case exports.ViewMode.Day:
1131
- var _getCalendarValuesFor5 = getCalendarValuesForDay();
1132
-
1133
- topValues = _getCalendarValuesFor5[0];
1134
- bottomValues = _getCalendarValuesFor5[1];
1137
+ [topValues, bottomValues] = getCalendarValuesForDay();
1135
1138
  break;
1136
1139
 
1137
1140
  case exports.ViewMode.QuarterDay:
1138
1141
  case exports.ViewMode.HalfDay:
1139
- var _getCalendarValuesFor6 = getCalendarValuesForPartOfDay();
1140
-
1141
- topValues = _getCalendarValuesFor6[0];
1142
- bottomValues = _getCalendarValuesFor6[1];
1142
+ [topValues, bottomValues] = getCalendarValuesForPartOfDay();
1143
1143
  break;
1144
1144
 
1145
1145
  case exports.ViewMode.Hour:
1146
- var _getCalendarValuesFor7 = getCalendarValuesForHour();
1147
-
1148
- topValues = _getCalendarValuesFor7[0];
1149
- bottomValues = _getCalendarValuesFor7[1];
1146
+ [topValues, bottomValues] = getCalendarValuesForHour();
1150
1147
  }
1151
1148
 
1152
1149
  return React__default.createElement("g", {
@@ -1182,27 +1179,23 @@ function _catch(body, recover) {
1182
1179
  return result;
1183
1180
  }
1184
1181
 
1185
- var Arrow = function Arrow(_ref) {
1186
- var taskFrom = _ref.taskFrom,
1187
- taskTo = _ref.taskTo,
1188
- rowHeight = _ref.rowHeight,
1189
- taskHeight = _ref.taskHeight,
1190
- arrowIndent = _ref.arrowIndent,
1191
- rtl = _ref.rtl,
1192
- arrowColor = _ref.arrowColor;
1193
- var path;
1194
- var trianglePoints;
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;
1195
1194
 
1196
1195
  if (rtl) {
1197
- var _drownPathAndTriangle = drownPathAndTriangleRTL(taskFrom, taskTo, rowHeight, taskHeight, arrowIndent);
1198
-
1199
- path = _drownPathAndTriangle[0];
1200
- trianglePoints = _drownPathAndTriangle[1];
1196
+ [path, trianglePoints] = drownPathAndTriangleRTL(taskFrom, taskTo, rowHeight, taskHeight, arrowIndent);
1201
1197
  } else {
1202
- var _drownPathAndTriangle2 = drownPathAndTriangle(taskFrom, taskTo, rowHeight, taskHeight, arrowIndent);
1203
-
1204
- path = _drownPathAndTriangle2[0];
1205
- trianglePoints = _drownPathAndTriangle2[1];
1198
+ [path, trianglePoints] = drownPathAndTriangle(taskFrom, taskTo, rowHeight, taskHeight, arrowIndent);
1206
1199
  }
1207
1200
 
1208
1201
  return React__default.createElement("g", {
@@ -1218,8 +1211,8 @@ var Arrow = function Arrow(_ref) {
1218
1211
  }));
1219
1212
  };
1220
1213
 
1221
- var drownPathAndTriangle = function drownPathAndTriangle(taskFrom, taskTo, rowHeight, taskHeight, arrowIndent) {
1222
- var taskToStart, taskFromEnd;
1214
+ const drownPathAndTriangle = (taskFrom, taskTo, rowHeight, taskHeight, arrowIndent) => {
1215
+ let taskToStart, taskFromEnd;
1223
1216
 
1224
1217
  if (taskTo.x1 > 0 && taskTo.actualx1 > 0) {
1225
1218
  taskToStart = Math.min(taskTo.x1, taskTo.actualx1);
@@ -1229,43 +1222,51 @@ var drownPathAndTriangle = function drownPathAndTriangle(taskFrom, taskTo, rowHe
1229
1222
  taskFromEnd = Math.max(taskFrom.x2, taskFrom.actualx2);
1230
1223
  } else if (taskFrom.x2 > 0) taskFromEnd = taskFrom.x2;else if (taskFrom.actualx2 > 0) taskFromEnd = taskFrom.actualx2;else taskFromEnd = 0;
1231
1224
 
1232
- var indexCompare = taskFrom.index > taskTo.index ? -1 : 1;
1233
- var taskToEndPosition = taskTo.y + taskHeight / 2;
1234
- var taskFromEndPosition = taskFromEnd + arrowIndent * 2;
1235
- var taskFromHorizontalOffsetValue = taskFromEndPosition < taskToStart ? "" : "H " + (taskToStart - arrowIndent);
1236
- var taskToHorizontalOffsetValue = taskFromEndPosition > taskToStart ? arrowIndent : taskToStart - taskFromEnd - arrowIndent;
1237
- var path = "M " + taskFromEnd + " " + (taskFrom.y + taskHeight / 2) + " \n h " + arrowIndent + " \n v " + indexCompare * rowHeight / 2 + " \n " + taskFromHorizontalOffsetValue + "\n V " + taskToEndPosition + " \n h " + taskToHorizontalOffsetValue;
1238
- var trianglePoints = taskToStart + "," + taskToEndPosition + " \n " + (taskToStart - 5) + "," + (taskToEndPosition - 5) + " \n " + (taskToStart - 5) + "," + (taskToEndPosition + 5);
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}`;
1239
1239
  return [path, trianglePoints];
1240
1240
  };
1241
1241
 
1242
- var drownPathAndTriangleRTL = function drownPathAndTriangleRTL(taskFrom, taskTo, rowHeight, taskHeight, arrowIndent) {
1243
- var indexCompare = taskFrom.index > taskTo.index ? -1 : 1;
1244
- var taskToEndPosition = taskTo.y + taskHeight / 2;
1245
- var taskFromEndPosition = taskFrom.x1 - arrowIndent * 2;
1246
- var taskFromHorizontalOffsetValue = taskFromEndPosition > taskTo.x2 ? "" : "H " + (taskTo.x2 + arrowIndent);
1247
- var taskToHorizontalOffsetValue = taskFromEndPosition < taskTo.x2 ? -arrowIndent : taskTo.x2 - taskFrom.x1 + arrowIndent;
1248
- 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;
1249
- var trianglePoints = taskTo.x2 + "," + taskToEndPosition + " \n " + (taskTo.x2 + 5) + "," + (taskToEndPosition + 5) + " \n " + (taskTo.x2 + 5) + "," + (taskToEndPosition - 5);
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}`;
1250
1257
  return [path, trianglePoints];
1251
1258
  };
1252
1259
 
1253
- var convertToBarTasks = function convertToBarTasks(tasks, dates, columnWidth, rowHeight, taskHeight, barCornerRadius, handleWidth, rtl, barProgressColor, barProgressSelectedColor, barBackgroundColor, barBackgroundSelectedColor, projectProgressColor, projectProgressSelectedColor, projectBackgroundColor, projectBackgroundSelectedColor, milestoneBackgroundColor, milestoneBackgroundSelectedColor) {
1254
- var barTasks = tasks.map(function (t, i) {
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) => {
1255
1262
  return convertToBarTask(t, i, dates, columnWidth, rowHeight, taskHeight, barCornerRadius, handleWidth, rtl, barProgressColor, barProgressSelectedColor, barBackgroundColor, barBackgroundSelectedColor, projectProgressColor, projectProgressSelectedColor, projectBackgroundColor, projectBackgroundSelectedColor, milestoneBackgroundColor, milestoneBackgroundSelectedColor);
1256
1263
  });
1257
- barTasks = barTasks.map(function (task) {
1258
- var dependencies = task.dependencies || [];
1264
+ barTasks = barTasks.map(task => {
1265
+ const dependencies = task.dependencies || [];
1259
1266
 
1260
- var _loop = function _loop(j) {
1261
- var dependence = barTasks.findIndex(function (value) {
1262
- return value.id === dependencies[j];
1263
- });
1267
+ for (let j = 0; j < dependencies.length; j++) {
1268
+ const dependence = barTasks.findIndex(value => value.id === dependencies[j]);
1264
1269
  if (dependence !== -1 && task.start.getTime() > 0 && task.end.getTime() > 0) barTasks[dependence].barChildren.push(task);
1265
- };
1266
-
1267
- for (var j = 0; j < dependencies.length; j++) {
1268
- _loop(j);
1269
1270
  }
1270
1271
 
1271
1272
  return task;
@@ -1273,8 +1274,8 @@ var convertToBarTasks = function convertToBarTasks(tasks, dates, columnWidth, ro
1273
1274
  return barTasks;
1274
1275
  };
1275
1276
 
1276
- var convertToBarTask = function convertToBarTask(task, index, dates, columnWidth, rowHeight, taskHeight, barCornerRadius, handleWidth, rtl, barProgressColor, barProgressSelectedColor, barBackgroundColor, barBackgroundSelectedColor, projectProgressColor, projectProgressSelectedColor, projectBackgroundColor, projectBackgroundSelectedColor, milestoneBackgroundColor, milestoneBackgroundSelectedColor) {
1277
- var barTask;
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;
1278
1279
 
1279
1280
  switch (task.type) {
1280
1281
  case "milestone":
@@ -1293,13 +1294,13 @@ var convertToBarTask = function convertToBarTask(task, index, dates, columnWidth
1293
1294
  return barTask;
1294
1295
  };
1295
1296
 
1296
- var convertToBar = function convertToBar(task, index, dates, columnWidth, rowHeight, taskHeight, barCornerRadius, handleWidth, rtl, barProgressColor, barProgressSelectedColor, barBackgroundColor, barBackgroundSelectedColor) {
1297
- var x1;
1298
- var x2;
1299
- var actualx1;
1300
- var actualx2;
1301
- var progressStartWidth;
1302
- var progressEndWidth;
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;
1303
1304
 
1304
1305
  if (rtl) {
1305
1306
  x2 = task.start ? taskXCoordinateRTL(task.start, dates, columnWidth) : -1;
@@ -1315,108 +1316,100 @@ var convertToBar = function convertToBar(task, index, dates, columnWidth, rowHei
1315
1316
 
1316
1317
  progressStartWidth = actualx1 && x1 ? Math.abs(actualx1 - x1) : -1;
1317
1318
  progressEndWidth = actualx2 && x2 ? Math.abs(actualx2 - x2) : -1;
1318
- var typeInternal = task.type;
1319
-
1320
- var _progressWithByParams = progressWithByParams(actualx1, actualx2, task.progress, rtl),
1321
- progressWidth = _progressWithByParams[0],
1322
- progressX = _progressWithByParams[1];
1323
-
1324
- var y = taskYCoordinate(index, rowHeight, taskHeight);
1325
- var hideChildren = task.hideChildren || false;
1326
-
1327
- var styles = _extends({
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 = {
1328
1324
  backgroundColor: barBackgroundColor,
1329
1325
  backgroundSelectedColor: barBackgroundSelectedColor,
1330
1326
  progressColor: barProgressColor,
1331
- progressSelectedColor: barProgressSelectedColor
1332
- }, task.styles);
1333
-
1334
- return _extends({}, task, {
1335
- typeInternal: typeInternal,
1336
- x1: x1,
1337
- x2: x2,
1338
- actualx1: actualx1,
1339
- actualx2: actualx2,
1340
- progressStartWidth: progressStartWidth,
1341
- progressEndWidth: progressEndWidth,
1342
- y: y,
1343
- index: index,
1344
- progressX: progressX,
1345
- progressWidth: progressWidth,
1346
- barCornerRadius: barCornerRadius,
1347
- handleWidth: handleWidth,
1348
- hideChildren: hideChildren,
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,
1349
1345
  height: taskHeight,
1350
1346
  barChildren: [],
1351
- styles: styles
1352
- });
1347
+ styles
1348
+ };
1353
1349
  };
1354
1350
 
1355
- var convertToMilestone = function convertToMilestone(task, index, dates, columnWidth, rowHeight, taskHeight, barCornerRadius, handleWidth, milestoneBackgroundColor, milestoneBackgroundSelectedColor) {
1356
- var x = task.start && task.end ? taskXCoordinate(task.start, dates, columnWidth) : 0;
1357
- var y = taskYCoordinate(index, rowHeight, taskHeight);
1358
- var x1 = task.start && task.end ? x - taskHeight * 0.5 : 0;
1359
- var x2 = task.start && task.end ? x + taskHeight * 0.5 : 0;
1360
- var rotatedHeight = taskHeight / 1.414;
1361
-
1362
- var styles = _extends({
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 = {
1363
1358
  backgroundColor: milestoneBackgroundColor,
1364
1359
  backgroundSelectedColor: milestoneBackgroundSelectedColor,
1365
1360
  progressColor: "",
1366
- progressSelectedColor: ""
1367
- }, task.styles);
1368
-
1369
- return _extends({}, task, {
1370
- x1: x1,
1371
- x2: x2,
1361
+ progressSelectedColor: "",
1362
+ ...task.styles
1363
+ };
1364
+ return { ...task,
1365
+ x1,
1366
+ x2,
1372
1367
  actualx1: x1,
1373
1368
  actualx2: x2,
1374
1369
  progressStartWidth: 0,
1375
1370
  progressEndWidth: 0,
1376
- y: y,
1377
- index: index,
1371
+ y,
1372
+ index,
1378
1373
  progressX: 0,
1379
1374
  progressWidth: 0,
1380
- barCornerRadius: barCornerRadius,
1381
- handleWidth: handleWidth,
1375
+ barCornerRadius,
1376
+ handleWidth,
1382
1377
  typeInternal: task.type,
1383
1378
  progress: 0,
1384
1379
  height: rotatedHeight,
1385
1380
  hideChildren: undefined,
1386
1381
  barChildren: [],
1387
- styles: styles
1388
- });
1382
+ styles
1383
+ };
1389
1384
  };
1390
1385
 
1391
- var taskXCoordinate = function taskXCoordinate(xDate, dates, columnWidth) {
1392
- var index = dates.findIndex(function (d) {
1393
- return d.getTime() >= xDate.getTime();
1394
- }) - 1;
1386
+ const taskXCoordinate = (xDate, dates, columnWidth) => {
1387
+ const index = dates.findIndex(d => d.getTime() >= xDate.getTime()) - 1;
1395
1388
 
1396
1389
  if (index < 0) {
1397
1390
  return 0;
1398
1391
  }
1399
1392
 
1400
- var remainderMillis = xDate.getTime() - dates[index].getTime();
1401
- var percentOfInterval = remainderMillis / (dates[index + 1].getTime() - dates[index].getTime());
1402
- var x = index * columnWidth + percentOfInterval * columnWidth;
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;
1403
1396
  return x;
1404
1397
  };
1405
1398
 
1406
- var taskXCoordinateRTL = function taskXCoordinateRTL(xDate, dates, columnWidth) {
1407
- var x = taskXCoordinate(xDate, dates, columnWidth);
1399
+ const taskXCoordinateRTL = (xDate, dates, columnWidth) => {
1400
+ let x = taskXCoordinate(xDate, dates, columnWidth);
1408
1401
  x += columnWidth;
1409
1402
  return x;
1410
1403
  };
1411
1404
 
1412
- var taskYCoordinate = function taskYCoordinate(index, rowHeight, taskHeight) {
1413
- var y = index * rowHeight + (rowHeight - taskHeight) / 2;
1405
+ const taskYCoordinate = (index, rowHeight, taskHeight) => {
1406
+ const y = index * rowHeight + (rowHeight - taskHeight) / 2;
1414
1407
  return y;
1415
1408
  };
1416
1409
 
1417
- var progressWithByParams = function progressWithByParams(taskX1, taskX2, progress, rtl) {
1418
- var progressWidth = taskX2 > 0 && taskX1 > 0 ? (taskX2 - taskX1) * progress * 0.01 : 0;
1419
- var progressX;
1410
+ const progressWithByParams = (taskX1, taskX2, progress, rtl) => {
1411
+ const progressWidth = taskX2 > 0 && taskX1 > 0 ? (taskX2 - taskX1) * progress * 0.01 : 0;
1412
+ let progressX;
1420
1413
 
1421
1414
  if (rtl) {
1422
1415
  progressX = taskX2 > 0 ? taskX2 - progressWidth : 0;
@@ -1426,79 +1419,79 @@ var progressWithByParams = function progressWithByParams(taskX1, taskX2, progres
1426
1419
 
1427
1420
  return [progressWidth, progressX];
1428
1421
  };
1429
- var getProgressPoint = function getProgressPoint(progressX, taskY, taskHeight) {
1430
- var point = [progressX - 5, taskY + taskHeight, progressX + 5, taskY + taskHeight, progressX, taskY + taskHeight - 8.66];
1422
+ const getProgressPoint = (progressX, taskY, taskHeight) => {
1423
+ const point = [progressX - 5, taskY + taskHeight, progressX + 5, taskY + taskHeight, progressX, taskY + taskHeight - 8.66];
1431
1424
  return point.join(",");
1432
1425
  };
1433
1426
 
1434
- var startByX = function startByX(x, xStep, task) {
1427
+ const startByX = (x, xStep, task) => {
1435
1428
  if (x >= task.x2 - task.handleWidth * 2) {
1436
1429
  x = task.x2 - task.handleWidth * 2;
1437
1430
  }
1438
1431
 
1439
- var steps = Math.round((x - task.x1) / xStep);
1440
- var additionalXValue = steps * xStep;
1441
- var newX = task.x1 + additionalXValue;
1432
+ const steps = Math.round((x - task.x1) / xStep);
1433
+ const additionalXValue = steps * xStep;
1434
+ const newX = task.x1 + additionalXValue;
1442
1435
  return newX;
1443
1436
  };
1444
1437
 
1445
- var startByActualX = function startByActualX(x, xStep, task) {
1438
+ const startByActualX = (x, xStep, task) => {
1446
1439
  if (x >= task.actualx2 - task.handleWidth * 2) {
1447
1440
  x = task.actualx2 - task.handleWidth * 2;
1448
1441
  }
1449
1442
 
1450
- var steps = Math.round((x - task.actualx1) / xStep);
1451
- var additionalXValue = steps * xStep;
1452
- var newX = task.actualx1 + additionalXValue;
1443
+ const steps = Math.round((x - task.actualx1) / xStep);
1444
+ const additionalXValue = steps * xStep;
1445
+ const newX = task.actualx1 + additionalXValue;
1453
1446
  return newX;
1454
1447
  };
1455
1448
 
1456
- var endByX = function endByX(x, xStep, task) {
1449
+ const endByX = (x, xStep, task) => {
1457
1450
  if (x <= task.x1 + task.handleWidth * 2) {
1458
1451
  x = task.x1 + task.handleWidth * 2;
1459
1452
  }
1460
1453
 
1461
- var steps = Math.round((x - task.x2) / xStep);
1462
- var additionalXValue = steps * xStep;
1463
- var newX = task.x2 + additionalXValue;
1454
+ const steps = Math.round((x - task.x2) / xStep);
1455
+ const additionalXValue = steps * xStep;
1456
+ const newX = task.x2 + additionalXValue;
1464
1457
  return newX;
1465
1458
  };
1466
1459
 
1467
- var endByActualX = function endByActualX(x, xStep, task) {
1460
+ const endByActualX = (x, xStep, task) => {
1468
1461
  if (x <= task.actualx1 + task.handleWidth * 2) {
1469
1462
  x = task.actualx1 + task.handleWidth * 2;
1470
1463
  }
1471
1464
 
1472
- var steps = Math.round((x - task.actualx2) / xStep);
1473
- var additionalXValue = steps * xStep;
1474
- var newX = task.actualx2 + additionalXValue;
1465
+ const steps = Math.round((x - task.actualx2) / xStep);
1466
+ const additionalXValue = steps * xStep;
1467
+ const newX = task.actualx2 + additionalXValue;
1475
1468
  return newX;
1476
1469
  };
1477
1470
 
1478
- var moveByX = function moveByX(x, xStep, task) {
1479
- var steps = Math.round((x - task.x1) / xStep);
1480
- var additionalXValue = steps * xStep;
1481
- var newX1 = task.x1 + additionalXValue;
1482
- var newX2 = newX1 + task.x2 - task.x1;
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;
1483
1476
  return [newX1, newX2];
1484
1477
  };
1485
1478
 
1486
- var moveByActualX = function moveByActualX(x, xStep, task) {
1487
- var steps = Math.round((x - task.actualx1) / xStep);
1488
- var additionalXValue = steps * xStep;
1489
- var newX1 = task.actualx1 + additionalXValue;
1490
- var newX2 = newX1 + task.actualx2 - task.actualx1;
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;
1491
1484
  return [newX1, newX2];
1492
1485
  };
1493
1486
 
1494
- var dateByX = function dateByX(x, taskX, taskDate, xStep, timeStep) {
1495
- var newDate = new Date((x - taskX) / xStep * timeStep + taskDate.getTime());
1487
+ const dateByX = (x, taskX, taskDate, xStep, timeStep) => {
1488
+ let newDate = new Date((x - taskX) / xStep * timeStep + taskDate.getTime());
1496
1489
  newDate = new Date(newDate.getTime() + (newDate.getTimezoneOffset() - taskDate.getTimezoneOffset()) * 60000);
1497
1490
  return newDate;
1498
1491
  };
1499
1492
 
1500
- var handleTaskBySVGMouseEvent = function handleTaskBySVGMouseEvent(svgX, action, selectedTask, type, xStep, timeStep, initEventX1Delta, rtl) {
1501
- var result;
1493
+ const handleTaskBySVGMouseEvent = (svgX, action, selectedTask, type, xStep, timeStep, initEventX1Delta, rtl) => {
1494
+ let result;
1502
1495
 
1503
1496
  switch (selectedTask.type) {
1504
1497
  case "milestone":
@@ -1513,15 +1506,15 @@ var handleTaskBySVGMouseEvent = function handleTaskBySVGMouseEvent(svgX, action,
1513
1506
  return result;
1514
1507
  };
1515
1508
 
1516
- var handleTaskBySVGMouseEventForBar = function handleTaskBySVGMouseEventForBar(svgX, action, selectedTask, type, xStep, timeStep, initEventX1Delta, rtl) {
1517
- var changedTask = _extends({}, selectedTask);
1518
-
1519
- var isChanged = false;
1509
+ const handleTaskBySVGMouseEventForBar = (svgX, action, selectedTask, type, xStep, timeStep, initEventX1Delta, rtl) => {
1510
+ const changedTask = { ...selectedTask
1511
+ };
1512
+ let isChanged = false;
1520
1513
 
1521
1514
  switch (action) {
1522
1515
  case "start":
1523
1516
  {
1524
- var newX1 = type == "planned" ? startByX(svgX, xStep, selectedTask) : startByActualX(svgX, xStep, selectedTask);
1517
+ const newX1 = type == "planned" ? startByX(svgX, xStep, selectedTask) : startByActualX(svgX, xStep, selectedTask);
1525
1518
  if (type == "planned") changedTask.x1 = newX1;else if (type == "actual") changedTask.actualx1 = newX1;
1526
1519
  isChanged = changedTask.x1 !== selectedTask.x1 || changedTask.actualx1 !== selectedTask.actualx1;
1527
1520
 
@@ -1534,10 +1527,7 @@ var handleTaskBySVGMouseEventForBar = function handleTaskBySVGMouseEventForBar(s
1534
1527
  if (type == "actual") changedTask.actualStart = dateByX(newX1, selectedTask.actualx1, selectedTask.actualStart, xStep, timeStep);
1535
1528
  }
1536
1529
 
1537
- var _progressWithByParams2 = progressWithByParams(changedTask.x1, changedTask.x2, changedTask.progress, rtl),
1538
- progressWidth = _progressWithByParams2[0],
1539
- progressX = _progressWithByParams2[1];
1540
-
1530
+ const [progressWidth, progressX] = progressWithByParams(changedTask.x1, changedTask.x2, changedTask.progress, rtl);
1541
1531
  changedTask.progressWidth = progressWidth;
1542
1532
  changedTask.progressX = progressX;
1543
1533
  }
@@ -1547,7 +1537,7 @@ var handleTaskBySVGMouseEventForBar = function handleTaskBySVGMouseEventForBar(s
1547
1537
 
1548
1538
  case "end":
1549
1539
  {
1550
- var newX2 = type == "planned" ? endByX(svgX, xStep, selectedTask) : endByActualX(svgX, xStep, selectedTask);
1540
+ const newX2 = type == "planned" ? endByX(svgX, xStep, selectedTask) : endByActualX(svgX, xStep, selectedTask);
1551
1541
  if (type == "planned") changedTask.x2 = newX2;else if (type == "actual") changedTask.actualx2 = newX2;
1552
1542
  isChanged = changedTask.x2 !== selectedTask.x2 || changedTask.actualx2 !== selectedTask.actualx2;
1553
1543
 
@@ -1560,12 +1550,9 @@ var handleTaskBySVGMouseEventForBar = function handleTaskBySVGMouseEventForBar(s
1560
1550
  if (type == "actual") changedTask.actualEnd = dateByX(newX2, selectedTask.actualx2, selectedTask.actualEnd, xStep, timeStep);
1561
1551
  }
1562
1552
 
1563
- var _progressWithByParams3 = progressWithByParams(changedTask.x1, changedTask.x2, changedTask.progress, rtl),
1564
- _progressWidth = _progressWithByParams3[0],
1565
- _progressX = _progressWithByParams3[1];
1566
-
1567
- changedTask.progressWidth = _progressWidth;
1568
- changedTask.progressX = _progressX;
1553
+ const [progressWidth, progressX] = progressWithByParams(changedTask.x1, changedTask.x2, changedTask.progress, rtl);
1554
+ changedTask.progressWidth = progressWidth;
1555
+ changedTask.progressX = progressX;
1569
1556
  }
1570
1557
 
1571
1558
  break;
@@ -1573,10 +1560,7 @@ var handleTaskBySVGMouseEventForBar = function handleTaskBySVGMouseEventForBar(s
1573
1560
 
1574
1561
  case "move":
1575
1562
  {
1576
- var _ref = type == "planned" ? moveByX(svgX - initEventX1Delta, xStep, selectedTask) : moveByActualX(svgX - initEventX1Delta, xStep, selectedTask),
1577
- newMoveX1 = _ref[0],
1578
- newMoveX2 = _ref[1];
1579
-
1563
+ const [newMoveX1, newMoveX2] = type == "planned" ? moveByX(svgX - initEventX1Delta, xStep, selectedTask) : moveByActualX(svgX - initEventX1Delta, xStep, selectedTask);
1580
1564
  if (type == "planned") isChanged = newMoveX1 !== selectedTask.x1;
1581
1565
  if (type == "actual") isChanged = newMoveX1 !== selectedTask.actualx1;
1582
1566
 
@@ -1601,23 +1585,20 @@ var handleTaskBySVGMouseEventForBar = function handleTaskBySVGMouseEventForBar(s
1601
1585
  }
1602
1586
 
1603
1587
  return {
1604
- isChanged: isChanged,
1605
- changedTask: changedTask
1588
+ isChanged,
1589
+ changedTask
1606
1590
  };
1607
1591
  };
1608
1592
 
1609
- var handleTaskBySVGMouseEventForMilestone = function handleTaskBySVGMouseEventForMilestone(svgX, action, selectedTask, xStep, timeStep, initEventX1Delta) {
1610
- var changedTask = _extends({}, selectedTask);
1611
-
1612
- var isChanged = false;
1593
+ const handleTaskBySVGMouseEventForMilestone = (svgX, action, selectedTask, xStep, timeStep, initEventX1Delta) => {
1594
+ const changedTask = { ...selectedTask
1595
+ };
1596
+ let isChanged = false;
1613
1597
 
1614
1598
  switch (action) {
1615
1599
  case "move":
1616
1600
  {
1617
- var _moveByX = moveByX(svgX - initEventX1Delta, xStep, selectedTask),
1618
- newMoveX1 = _moveByX[0],
1619
- newMoveX2 = _moveByX[1];
1620
-
1601
+ const [newMoveX1, newMoveX2] = moveByX(svgX - initEventX1Delta, xStep, selectedTask);
1621
1602
  isChanged = newMoveX1 !== selectedTask.x1;
1622
1603
 
1623
1604
  if (isChanged) {
@@ -1632,8 +1613,8 @@ var handleTaskBySVGMouseEventForMilestone = function handleTaskBySVGMouseEventFo
1632
1613
  }
1633
1614
 
1634
1615
  return {
1635
- isChanged: isChanged,
1636
- changedTask: changedTask
1616
+ isChanged,
1617
+ changedTask
1637
1618
  };
1638
1619
  };
1639
1620
 
@@ -1641,21 +1622,13 @@ function isKeyboardEvent(event) {
1641
1622
  return event.key !== undefined;
1642
1623
  }
1643
1624
  function removeHiddenTasks(tasks) {
1644
- var groupedTasks = tasks.filter(function (t) {
1645
- return t.hideChildren && t.type === "project";
1646
- });
1625
+ const groupedTasks = tasks.filter(t => t.hideChildren && t.type === "project");
1647
1626
 
1648
1627
  if (groupedTasks.length > 0) {
1649
- var _loop = function _loop(i) {
1650
- var groupedTask = groupedTasks[i];
1651
- var children = getChildren(tasks, groupedTask);
1652
- tasks = tasks.filter(function (t) {
1653
- return children.indexOf(t) === -1;
1654
- });
1655
- };
1656
-
1657
- for (var i = 0; groupedTasks.length > i; i++) {
1658
- _loop(i);
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);
1659
1632
  }
1660
1633
  }
1661
1634
 
@@ -1663,29 +1636,25 @@ function removeHiddenTasks(tasks) {
1663
1636
  }
1664
1637
 
1665
1638
  function getChildren(taskList, task) {
1666
- var tasks = [];
1639
+ let tasks = [];
1667
1640
 
1668
1641
  if (task.type !== "project") {
1669
- tasks = taskList.filter(function (t) {
1670
- return t.dependencies && t.dependencies.indexOf(task.id) !== -1;
1671
- });
1642
+ tasks = taskList.filter(t => t.dependencies && t.dependencies.indexOf(task.id) !== -1);
1672
1643
  } else {
1673
- tasks = taskList.filter(function (t) {
1674
- return t.project && t.project === task.id;
1675
- });
1644
+ tasks = taskList.filter(t => t.project && t.project === task.id);
1676
1645
  }
1677
1646
 
1678
1647
  var taskChildren = [];
1679
- tasks.forEach(function (t) {
1680
- taskChildren.push.apply(taskChildren, getChildren(taskList, t));
1648
+ tasks.forEach(t => {
1649
+ taskChildren.push(...getChildren(taskList, t));
1681
1650
  });
1682
1651
  tasks = tasks.concat(tasks, taskChildren);
1683
1652
  return tasks;
1684
1653
  }
1685
1654
 
1686
- var sortTasks = function sortTasks(taskA, taskB) {
1687
- var orderA = taskA.displayOrder || Number.MAX_VALUE;
1688
- var orderB = taskB.displayOrder || Number.MAX_VALUE;
1655
+ const sortTasks = (taskA, taskB) => {
1656
+ const orderA = taskA.displayOrder || Number.MAX_VALUE;
1657
+ const orderB = taskB.displayOrder || Number.MAX_VALUE;
1689
1658
 
1690
1659
  if (orderA > orderB) {
1691
1660
  return 1;
@@ -1696,24 +1665,26 @@ var sortTasks = function sortTasks(taskA, taskB) {
1696
1665
  }
1697
1666
  };
1698
1667
 
1699
- var BarDisplay = function BarDisplay(_ref) {
1700
- var x = _ref.x,
1701
- y = _ref.y,
1702
- type = _ref.type,
1703
- width = _ref.width,
1704
- height = _ref.height,
1705
- isSelected = _ref.isSelected,
1706
- progressX = _ref.progressX,
1707
- progressWidth = _ref.progressWidth,
1708
- barCornerRadius = _ref.barCornerRadius,
1709
- styles = _ref.styles,
1710
- onMouseDown = _ref.onMouseDown;
1711
-
1712
- var getProcessColor = function getProcessColor() {
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 = () => {
1713
1684
  return isSelected ? styles.progressSelectedColor : styles.progressColor;
1714
1685
  };
1715
1686
 
1716
- var getBarColor = function getBarColor() {
1687
+ const getBarColor = () => {
1717
1688
  return isSelected ? styles.backgroundSelectedColor : styles.backgroundColor;
1718
1689
  };
1719
1690
 
@@ -1760,13 +1731,15 @@ var BarDisplay = function BarDisplay(_ref) {
1760
1731
 
1761
1732
  var styles$6 = {"barWrapper":"_KxSXS","barHandle":"_3w_5u","barBackground":"_31ERP"};
1762
1733
 
1763
- var BarDateHandle = function BarDateHandle(_ref) {
1764
- var x = _ref.x,
1765
- y = _ref.y,
1766
- width = _ref.width,
1767
- height = _ref.height,
1768
- barCornerRadius = _ref.barCornerRadius,
1769
- onMouseDown = _ref.onMouseDown;
1734
+ const BarDateHandle = _ref => {
1735
+ let {
1736
+ x,
1737
+ y,
1738
+ width,
1739
+ height,
1740
+ barCornerRadius,
1741
+ onMouseDown
1742
+ } = _ref;
1770
1743
  return React__default.createElement("rect", {
1771
1744
  x: x,
1772
1745
  y: y,
@@ -1779,22 +1752,22 @@ var BarDateHandle = function BarDateHandle(_ref) {
1779
1752
  });
1780
1753
  };
1781
1754
 
1782
- var BarProgressHandle = function BarProgressHandle(_ref) {
1783
- _objectDestructuringEmpty(_ref);
1784
-
1755
+ const BarProgressHandle = _ref => {
1785
1756
  return React__default.createElement("div", null);
1786
1757
  };
1787
1758
 
1788
- var Bar = function Bar(_ref) {
1789
- var task = _ref.task,
1790
- isProgressChangeable = _ref.isProgressChangeable,
1791
- isDateChangeable = _ref.isDateChangeable,
1792
- rtl = _ref.rtl,
1793
- type = _ref.type,
1794
- onEventStart = _ref.onEventStart,
1795
- isSelected = _ref.isSelected;
1796
- var progressPoint = getProgressPoint(+!rtl * task.progressWidth + task.progressX, task.y, task.height);
1797
- var handleHeight = task.height / 2 - 1;
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;
1798
1771
 
1799
1772
  if (type == "planned") {
1800
1773
  if (task.x1 && task.x2) return React__default.createElement("g", {
@@ -1813,7 +1786,7 @@ var Bar = function Bar(_ref) {
1813
1786
  barCornerRadius: task.barCornerRadius,
1814
1787
  styles: task.styles,
1815
1788
  isSelected: isSelected,
1816
- onMouseDown: function onMouseDown(e) {
1789
+ onMouseDown: e => {
1817
1790
  isDateChangeable && onEventStart("move", task, e, "planned");
1818
1791
  }
1819
1792
  }), React__default.createElement("g", {
@@ -1824,7 +1797,7 @@ var Bar = function Bar(_ref) {
1824
1797
  width: task.handleWidth,
1825
1798
  height: handleHeight,
1826
1799
  barCornerRadius: task.barCornerRadius,
1827
- onMouseDown: function onMouseDown(e) {
1800
+ onMouseDown: e => {
1828
1801
  onEventStart("start", task, e, "planned");
1829
1802
  }
1830
1803
  }), React__default.createElement(BarDateHandle, {
@@ -1833,12 +1806,12 @@ var Bar = function Bar(_ref) {
1833
1806
  width: task.handleWidth,
1834
1807
  height: handleHeight,
1835
1808
  barCornerRadius: task.barCornerRadius,
1836
- onMouseDown: function onMouseDown(e) {
1809
+ onMouseDown: e => {
1837
1810
  onEventStart("end", task, e, "planned");
1838
1811
  }
1839
1812
  })), isProgressChangeable && React__default.createElement(BarProgressHandle, {
1840
1813
  progressPoint: progressPoint,
1841
- onMouseDown: function onMouseDown(e) {
1814
+ onMouseDown: e => {
1842
1815
  onEventStart("progress", task, e, "planned");
1843
1816
  }
1844
1817
  })));else return React__default.createElement("g", {
@@ -1862,7 +1835,7 @@ var Bar = function Bar(_ref) {
1862
1835
  barCornerRadius: task.barCornerRadius,
1863
1836
  styles: task.styles,
1864
1837
  isSelected: isSelected,
1865
- onMouseDown: function onMouseDown(e) {
1838
+ onMouseDown: e => {
1866
1839
  isDateChangeable && onEventStart("move", task, e, "actual");
1867
1840
  }
1868
1841
  }), React__default.createElement("g", {
@@ -1873,7 +1846,7 @@ var Bar = function Bar(_ref) {
1873
1846
  width: task.handleWidth,
1874
1847
  height: handleHeight,
1875
1848
  barCornerRadius: task.barCornerRadius,
1876
- onMouseDown: function onMouseDown(e) {
1849
+ onMouseDown: e => {
1877
1850
  onEventStart("start", task, e, "actual");
1878
1851
  }
1879
1852
  }), React__default.createElement(BarDateHandle, {
@@ -1882,12 +1855,12 @@ var Bar = function Bar(_ref) {
1882
1855
  width: task.handleWidth,
1883
1856
  height: handleHeight,
1884
1857
  barCornerRadius: task.barCornerRadius,
1885
- onMouseDown: function onMouseDown(e) {
1858
+ onMouseDown: e => {
1886
1859
  onEventStart("end", task, e, "actual");
1887
1860
  }
1888
1861
  })), isProgressChangeable && React__default.createElement(BarProgressHandle, {
1889
1862
  progressPoint: progressPoint,
1890
- onMouseDown: function onMouseDown(e) {
1863
+ onMouseDown: e => {
1891
1864
  onEventStart("progress", task, e, "actual");
1892
1865
  }
1893
1866
  })));
@@ -1899,14 +1872,16 @@ var Bar = function Bar(_ref) {
1899
1872
  }
1900
1873
  };
1901
1874
 
1902
- var BarSmall = function BarSmall(_ref) {
1903
- var task = _ref.task,
1904
- type = _ref.type,
1905
- isProgressChangeable = _ref.isProgressChangeable,
1906
- isDateChangeable = _ref.isDateChangeable,
1907
- onEventStart = _ref.onEventStart,
1908
- isSelected = _ref.isSelected;
1909
- var progressPoint = getProgressPoint(task.progressWidth + task.x1, task.y, task.height);
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);
1910
1885
  return React__default.createElement("g", {
1911
1886
  className: styles$6.barWrapper,
1912
1887
  tabIndex: 0
@@ -1923,14 +1898,14 @@ var BarSmall = function BarSmall(_ref) {
1923
1898
  barCornerRadius: task.barCornerRadius,
1924
1899
  styles: task.styles,
1925
1900
  isSelected: isSelected,
1926
- onMouseDown: function onMouseDown(e) {
1901
+ onMouseDown: e => {
1927
1902
  isDateChangeable && onEventStart("move", task, e);
1928
1903
  }
1929
1904
  }), React__default.createElement("g", {
1930
1905
  className: "handleGroup"
1931
1906
  }, isProgressChangeable && React__default.createElement(BarProgressHandle, {
1932
1907
  progressPoint: progressPoint,
1933
- onMouseDown: function onMouseDown(e) {
1908
+ onMouseDown: e => {
1934
1909
  onEventStart("progress", task, e);
1935
1910
  }
1936
1911
  })));
@@ -1938,14 +1913,17 @@ var BarSmall = function BarSmall(_ref) {
1938
1913
 
1939
1914
  var styles$7 = {"milestoneWrapper":"_RRr13","milestoneBackground":"_2P2B1"};
1940
1915
 
1941
- var Milestone = function Milestone(_ref) {
1942
- var task = _ref.task,
1943
- isDateChangeable = _ref.isDateChangeable,
1944
- onEventStart = _ref.onEventStart,
1945
- isSelected = _ref.isSelected;
1946
- var transform = "rotate(45 " + (task.x1 + task.height * 0.356) + " \n " + (task.y + task.height * 0.85) + ")";
1947
-
1948
- var getBarColor = function getBarColor() {
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 = () => {
1949
1927
  return isSelected ? task.styles.backgroundSelectedColor : task.styles.backgroundColor;
1950
1928
  };
1951
1929
 
@@ -1962,7 +1940,7 @@ var Milestone = function Milestone(_ref) {
1962
1940
  ry: task.barCornerRadius,
1963
1941
  transform: transform,
1964
1942
  className: styles$7.milestoneBackground,
1965
- onMouseDown: function onMouseDown(e) {
1943
+ onMouseDown: e => {
1966
1944
  isDateChangeable && onEventStart("move", task, e);
1967
1945
  }
1968
1946
  }));
@@ -1970,14 +1948,16 @@ var Milestone = function Milestone(_ref) {
1970
1948
 
1971
1949
  var styles$8 = {"projectWrapper":"_1KJ6x","projectBackground":"_2RbVy","projectTop":"_2pZMF"};
1972
1950
 
1973
- var Project = function Project(_ref) {
1974
- var task = _ref.task,
1975
- isSelected = _ref.isSelected;
1976
- var barColor = isSelected ? task.styles.backgroundSelectedColor : task.styles.backgroundColor;
1977
- var processColor = isSelected ? task.styles.progressSelectedColor : task.styles.progressColor;
1978
- var projectWith = task.x2 - task.x1;
1979
- 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(",");
1980
- 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(",");
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(",");
1981
1961
  return React__default.createElement("g", {
1982
1962
  tabIndex: 0,
1983
1963
  className: styles$8.projectWrapper
@@ -2018,18 +1998,16 @@ var Project = function Project(_ref) {
2018
1998
  }));
2019
1999
  };
2020
2000
 
2021
- var TaskItem = function TaskItem(props) {
2022
- var _props = _extends({}, props),
2023
- task = _props.task,
2024
- isDelete = _props.isDelete,
2025
- isSelected = _props.isSelected,
2026
- onEventStart = _props.onEventStart;
2027
-
2028
- var _useState = React.useState([React__default.createElement("div", null)]),
2029
- taskItem = _useState[0],
2030
- setTaskItem = _useState[1];
2031
-
2032
- React.useEffect(function () {
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(() => {
2033
2011
  switch (task.typeInternal) {
2034
2012
  case "milestone":
2035
2013
  setTaskItem([React__default.createElement(Milestone, Object.assign({}, props))]);
@@ -2045,27 +2023,27 @@ var TaskItem = function TaskItem(props) {
2045
2023
 
2046
2024
  default:
2047
2025
  {
2048
- var _taskItem = [];
2026
+ let taskItem = [];
2049
2027
 
2050
2028
  if (task.x1 && task.x2) {
2051
- _taskItem.push(React__default.createElement(Bar, Object.assign({}, props, {
2029
+ taskItem.push(React__default.createElement(Bar, Object.assign({}, props, {
2052
2030
  type: "planned"
2053
2031
  })));
2054
2032
  }
2055
2033
 
2056
2034
  if (task.actualx1 && task.actualx2) {
2057
- _taskItem.push(React__default.createElement(Bar, Object.assign({}, props, {
2035
+ taskItem.push(React__default.createElement(Bar, Object.assign({}, props, {
2058
2036
  type: "actual"
2059
2037
  })));
2060
2038
  }
2061
2039
 
2062
- setTaskItem(_taskItem);
2040
+ setTaskItem(taskItem);
2063
2041
  }
2064
2042
  break;
2065
2043
  }
2066
2044
  }, [task, isSelected]);
2067
2045
  return React__default.createElement("g", null, React__default.createElement("g", {
2068
- onKeyDown: function onKeyDown(e) {
2046
+ onKeyDown: e => {
2069
2047
  switch (e.key) {
2070
2048
  case "Delete":
2071
2049
  {
@@ -2076,20 +2054,20 @@ var TaskItem = function TaskItem(props) {
2076
2054
 
2077
2055
  e.stopPropagation();
2078
2056
  },
2079
- onMouseEnter: function onMouseEnter(e) {
2057
+ onMouseEnter: e => {
2080
2058
  onEventStart("mouseenter", task, e, "planned");
2081
2059
  },
2082
- onMouseLeave: function onMouseLeave(e) {
2060
+ onMouseLeave: e => {
2083
2061
  onEventStart("mouseleave", task, e, "planned");
2084
2062
  },
2085
- onDoubleClick: function onDoubleClick(e) {
2063
+ onDoubleClick: e => {
2086
2064
  onEventStart("dblclick", task, e, "planned");
2087
2065
  },
2088
- onClick: function onClick(e) {
2066
+ onClick: e => {
2089
2067
  onEventStart("click", task, e, "planned");
2090
2068
  }
2091
2069
  }, taskItem[0]), React__default.createElement("g", {
2092
- onKeyDown: function onKeyDown(e) {
2070
+ onKeyDown: e => {
2093
2071
  switch (e.key) {
2094
2072
  case "Delete":
2095
2073
  {
@@ -2100,82 +2078,74 @@ var TaskItem = function TaskItem(props) {
2100
2078
 
2101
2079
  e.stopPropagation();
2102
2080
  },
2103
- onMouseEnter: function onMouseEnter(e) {
2081
+ onMouseEnter: e => {
2104
2082
  onEventStart("mouseenter", task, e, "actual");
2105
2083
  },
2106
- onMouseLeave: function onMouseLeave(e) {
2084
+ onMouseLeave: e => {
2107
2085
  onEventStart("mouseleave", task, e, "actual");
2108
2086
  },
2109
- onDoubleClick: function onDoubleClick(e) {
2087
+ onDoubleClick: e => {
2110
2088
  onEventStart("dblclick", task, e, "actual");
2111
2089
  },
2112
- onClick: function onClick(e) {
2090
+ onClick: e => {
2113
2091
  onEventStart("click", task, e, "actual");
2114
2092
  }
2115
2093
  }, taskItem[1]));
2116
2094
  };
2117
2095
 
2118
- var TaskGanttContent = function TaskGanttContent(_ref) {
2096
+ const TaskGanttContent = _ref => {
2119
2097
  var _svg$current;
2120
2098
 
2121
- var tasks = _ref.tasks,
2122
- dates = _ref.dates,
2123
- ganttEvent = _ref.ganttEvent,
2124
- selectedTask = _ref.selectedTask,
2125
- rowHeight = _ref.rowHeight,
2126
- columnWidth = _ref.columnWidth,
2127
- timeStep = _ref.timeStep,
2128
- svg = _ref.svg,
2129
- taskHeight = _ref.taskHeight,
2130
- arrowIndent = _ref.arrowIndent,
2131
- fontFamily = _ref.fontFamily,
2132
- fontSize = _ref.fontSize,
2133
- rtl = _ref.rtl,
2134
- setGanttEvent = _ref.setGanttEvent,
2135
- setFailedTask = _ref.setFailedTask,
2136
- setSelectedTask = _ref.setSelectedTask,
2137
- onDateChange = _ref.onDateChange,
2138
- onProgressChange = _ref.onProgressChange,
2139
- onDoubleClick = _ref.onDoubleClick,
2140
- onClick = _ref.onClick,
2141
- onDelete = _ref.onDelete;
2142
- var point = svg === null || svg === void 0 ? void 0 : (_svg$current = svg.current) === null || _svg$current === void 0 ? void 0 : _svg$current.createSVGPoint();
2143
-
2144
- var _useState = React.useState(0),
2145
- xStep = _useState[0],
2146
- setXStep = _useState[1];
2147
-
2148
- var _useState2 = React.useState(0),
2149
- initEventX1Delta = _useState2[0],
2150
- setInitEventX1Delta = _useState2[1];
2151
-
2152
- var _useState3 = React.useState(false),
2153
- isMoving = _useState3[0],
2154
- setIsMoving = _useState3[1];
2155
-
2156
- React.useEffect(function () {
2157
- var dateDelta = dates[1].getTime() - dates[0].getTime() - dates[1].getTimezoneOffset() * 60 * 1000 + dates[0].getTimezoneOffset() * 60 * 1000;
2158
- var newXStep = timeStep * columnWidth / dateDelta;
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;
2159
2129
  setXStep(newXStep);
2160
2130
  }, [columnWidth, dates, timeStep]);
2161
- React.useEffect(function () {
2162
- var handleMouseMove = function handleMouseMove(event) {
2131
+ React.useEffect(() => {
2132
+ const handleMouseMove = function (event) {
2163
2133
  try {
2164
2134
  var _svg$current$getScree;
2165
2135
 
2166
2136
  if (!ganttEvent.changedTask || !point || !(svg !== null && svg !== void 0 && svg.current)) return Promise.resolve();
2167
2137
  event.preventDefault();
2168
2138
  point.x = event.clientX;
2169
- 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());
2170
-
2171
- var _handleTaskBySVGMouse = handleTaskBySVGMouseEvent(cursor.x, ganttEvent.action, ganttEvent.changedTask, ganttEvent.type, xStep, timeStep, initEventX1Delta, rtl),
2172
- isChanged = _handleTaskBySVGMouse.isChanged,
2173
- changedTask = _handleTaskBySVGMouse.changedTask;
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);
2174
2144
 
2175
2145
  if (isChanged) {
2176
2146
  setGanttEvent({
2177
2147
  action: ganttEvent.action,
2178
- changedTask: changedTask
2148
+ changedTask
2179
2149
  });
2180
2150
  }
2181
2151
 
@@ -2185,40 +2155,41 @@ var TaskGanttContent = function TaskGanttContent(_ref) {
2185
2155
  }
2186
2156
  };
2187
2157
 
2188
- var handleMouseUp = function handleMouseUp(event) {
2158
+ const handleMouseUp = function (event) {
2189
2159
  try {
2190
2160
  var _svg$current$getScree2;
2191
2161
 
2192
- var _temp6 = function _temp6() {
2162
+ function _temp5() {
2193
2163
  if (!operationSuccess) {
2194
2164
  setFailedTask(originalSelectedTask);
2195
2165
  }
2196
- };
2166
+ }
2197
2167
 
2198
- var action = ganttEvent.action,
2199
- originalSelectedTask = ganttEvent.originalSelectedTask,
2200
- changedTask = ganttEvent.changedTask,
2201
- type = ganttEvent.type;
2168
+ const {
2169
+ action,
2170
+ originalSelectedTask,
2171
+ changedTask,
2172
+ type
2173
+ } = ganttEvent;
2202
2174
  if (!changedTask || !point || !(svg !== null && svg !== void 0 && svg.current) || !originalSelectedTask) return Promise.resolve();
2203
2175
  event.preventDefault();
2204
2176
  point.x = event.clientX;
2205
- 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());
2206
-
2207
- var _handleTaskBySVGMouse2 = handleTaskBySVGMouseEvent(cursor.x, action, changedTask, type, xStep, timeStep, initEventX1Delta, rtl),
2208
- newChangedTask = _handleTaskBySVGMouse2.changedTask;
2209
-
2210
- var isNotLikeOriginal = originalSelectedTask.start !== newChangedTask.start || originalSelectedTask.end !== newChangedTask.end || originalSelectedTask.actualStart !== newChangedTask.actualStart || originalSelectedTask.actualEnd !== newChangedTask.actualEnd || originalSelectedTask.progress !== newChangedTask.progress;
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;
2211
2182
  svg.current.removeEventListener("mousemove", handleMouseMove);
2212
2183
  svg.current.removeEventListener("mouseup", handleMouseUp);
2213
2184
  setGanttEvent({
2214
2185
  action: ""
2215
2186
  });
2216
2187
  setIsMoving(false);
2217
- var operationSuccess = true;
2188
+ let operationSuccess = true;
2218
2189
 
2219
- var _temp7 = function () {
2190
+ const _temp4 = function () {
2220
2191
  if ((action === "move" || action === "end" || action === "start") && onDateChange && isNotLikeOriginal) {
2221
- var _temp8 = _catch(function () {
2192
+ const _temp = _catch(function () {
2222
2193
  return Promise.resolve(onDateChange(newChangedTask, newChangedTask.barChildren)).then(function (result) {
2223
2194
  if (result !== undefined) {
2224
2195
  operationSuccess = result;
@@ -2228,11 +2199,11 @@ var TaskGanttContent = function TaskGanttContent(_ref) {
2228
2199
  operationSuccess = false;
2229
2200
  });
2230
2201
 
2231
- if (_temp8 && _temp8.then) return _temp8.then(function () {});
2202
+ if (_temp && _temp.then) return _temp.then(function () {});
2232
2203
  } else {
2233
- var _temp9 = function () {
2204
+ const _temp3 = function () {
2234
2205
  if (onProgressChange && isNotLikeOriginal) {
2235
- var _temp10 = _catch(function () {
2206
+ const _temp2 = _catch(function () {
2236
2207
  return Promise.resolve(onProgressChange(newChangedTask, newChangedTask.barChildren)).then(function (result) {
2237
2208
  if (result !== undefined) {
2238
2209
  operationSuccess = result;
@@ -2242,15 +2213,15 @@ var TaskGanttContent = function TaskGanttContent(_ref) {
2242
2213
  operationSuccess = false;
2243
2214
  });
2244
2215
 
2245
- if (_temp10 && _temp10.then) return _temp10.then(function () {});
2216
+ if (_temp2 && _temp2.then) return _temp2.then(function () {});
2246
2217
  }
2247
2218
  }();
2248
2219
 
2249
- if (_temp9 && _temp9.then) return _temp9.then(function () {});
2220
+ if (_temp3 && _temp3.then) return _temp3.then(function () {});
2250
2221
  }
2251
2222
  }();
2252
2223
 
2253
- return Promise.resolve(_temp7 && _temp7.then ? _temp7.then(_temp6) : _temp6(_temp7));
2224
+ return Promise.resolve(_temp4 && _temp4.then ? _temp4.then(_temp5) : _temp5(_temp4));
2254
2225
  } catch (e) {
2255
2226
  return Promise.reject(e);
2256
2227
  }
@@ -2263,7 +2234,7 @@ var TaskGanttContent = function TaskGanttContent(_ref) {
2263
2234
  }
2264
2235
  }, [ganttEvent, xStep, initEventX1Delta, onProgressChange, timeStep, onDateChange, svg, isMoving, point, rtl, setFailedTask, setGanttEvent]);
2265
2236
 
2266
- var handleBarEventStart = function handleBarEventStart(action, task, event, type) {
2237
+ const handleBarEventStart = function (action, task, event, type) {
2267
2238
  try {
2268
2239
  return Promise.resolve(function () {
2269
2240
  if (!event) {
@@ -2272,15 +2243,15 @@ var TaskGanttContent = function TaskGanttContent(_ref) {
2272
2243
  }
2273
2244
  } else return function () {
2274
2245
  if (isKeyboardEvent(event)) {
2275
- var _temp14 = function () {
2246
+ const _temp8 = function () {
2276
2247
  if (action === "delete") {
2277
- var _temp15 = function () {
2248
+ const _temp7 = function () {
2278
2249
  if (onDelete) {
2279
- var _temp16 = _catch(function () {
2250
+ const _temp6 = _catch(function () {
2280
2251
  return Promise.resolve(onDelete(task)).then(function (result) {
2281
2252
  if (result !== undefined && result) {
2282
2253
  setGanttEvent({
2283
- action: action,
2254
+ action,
2284
2255
  changedTask: task
2285
2256
  });
2286
2257
  }
@@ -2289,19 +2260,19 @@ var TaskGanttContent = function TaskGanttContent(_ref) {
2289
2260
  console.error("Error on Delete. " + error);
2290
2261
  });
2291
2262
 
2292
- if (_temp16 && _temp16.then) return _temp16.then(function () {});
2263
+ if (_temp6 && _temp6.then) return _temp6.then(function () {});
2293
2264
  }
2294
2265
  }();
2295
2266
 
2296
- if (_temp15 && _temp15.then) return _temp15.then(function () {});
2267
+ if (_temp7 && _temp7.then) return _temp7.then(function () {});
2297
2268
  }
2298
2269
  }();
2299
2270
 
2300
- if (_temp14 && _temp14.then) return _temp14.then(function () {});
2271
+ if (_temp8 && _temp8.then) return _temp8.then(function () {});
2301
2272
  } else if (action === "mouseenter") {
2302
2273
  if (!ganttEvent.action) {
2303
2274
  setGanttEvent({
2304
- action: action,
2275
+ action,
2305
2276
  changedTask: task,
2306
2277
  originalSelectedTask: task,
2307
2278
  type: type
@@ -2322,17 +2293,17 @@ var TaskGanttContent = function TaskGanttContent(_ref) {
2322
2293
 
2323
2294
  if (!(svg !== null && svg !== void 0 && svg.current) || !point) return;
2324
2295
  point.x = event.clientX;
2325
- var cursor = point.matrixTransform((_svg$current$getScree3 = svg.current.getScreenCTM()) === null || _svg$current$getScree3 === void 0 ? void 0 : _svg$current$getScree3.inverse());
2296
+ const cursor = point.matrixTransform((_svg$current$getScree3 = svg.current.getScreenCTM()) === null || _svg$current$getScree3 === void 0 ? void 0 : _svg$current$getScree3.inverse());
2326
2297
  if (type == "planned") setInitEventX1Delta(cursor.x - task.x1);else if (type == "actual") setInitEventX1Delta(cursor.x - task.actualx1);
2327
2298
  setGanttEvent({
2328
- action: action,
2299
+ action,
2329
2300
  changedTask: task,
2330
2301
  originalSelectedTask: task,
2331
2302
  type: type
2332
2303
  });
2333
2304
  } else {
2334
2305
  setGanttEvent({
2335
- action: action,
2306
+ action,
2336
2307
  changedTask: task,
2337
2308
  originalSelectedTask: task,
2338
2309
  type: type
@@ -2349,8 +2320,8 @@ var TaskGanttContent = function TaskGanttContent(_ref) {
2349
2320
  className: "content"
2350
2321
  }, React__default.createElement("g", {
2351
2322
  className: "arrows"
2352
- }, tasks.map(function (_task) {
2353
- var task = _task.start.getTime() > 0 && _task.end.getTime() > 0 ? _task : undefined;
2323
+ }, tasks.map(_task => {
2324
+ const task = _task.start.getTime() > 0 && _task.end.getTime() > 0 ? _task : undefined;
2354
2325
 
2355
2326
  if (!task) {
2356
2327
  return React__default.createElement("g", {
@@ -2361,28 +2332,26 @@ var TaskGanttContent = function TaskGanttContent(_ref) {
2361
2332
  });
2362
2333
  }
2363
2334
 
2364
- return task.barChildren.map(function (child) {
2335
+ return task.barChildren.map(child => {
2365
2336
  var _task$criticalPathArr, _task$criticalPathArr2;
2366
2337
 
2367
2338
  return React__default.createElement(Arrow, {
2368
- key: "Arrow from " + task.id + " to " + tasks[child.index].id,
2339
+ key: `Arrow from ${task.id} to ${tasks[child.index].id}`,
2369
2340
  taskFrom: task,
2370
2341
  taskTo: tasks[child.index],
2371
2342
  rowHeight: rowHeight,
2372
2343
  taskHeight: taskHeight,
2373
2344
  arrowIndent: arrowIndent,
2374
2345
  rtl: rtl,
2375
- arrowColor: ((_task$criticalPathArr = task.criticalPathArrows) === null || _task$criticalPathArr === void 0 ? void 0 : (_task$criticalPathArr2 = _task$criticalPathArr.find(function (arrow) {
2376
- return arrow.taskId == tasks[child.index].id;
2377
- })) === null || _task$criticalPathArr2 === void 0 ? void 0 : _task$criticalPathArr2.arrowColor) || "#808080"
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"
2378
2347
  });
2379
2348
  });
2380
2349
  })), React__default.createElement("g", {
2381
2350
  className: "bar",
2382
2351
  fontFamily: fontFamily,
2383
2352
  fontSize: fontSize
2384
- }, tasks.map(function (_task) {
2385
- var task = _task.start.getTime() > 0 && _task.end.getTime() > 0 ? _task : undefined;
2353
+ }, tasks.map(_task => {
2354
+ const task = _task.start.getTime() > 0 && _task.end.getTime() > 0 ? _task : undefined;
2386
2355
 
2387
2356
  if (!task) {
2388
2357
  return React__default.createElement("g", {
@@ -2410,27 +2379,27 @@ var TaskGanttContent = function TaskGanttContent(_ref) {
2410
2379
 
2411
2380
  var styles$9 = {"ganttVerticalContainer":"_CZjuD","horizontalContainer":"_2B2zv","wrapper":"_3eULf"};
2412
2381
 
2413
- var TaskGantt = function TaskGantt(_ref) {
2414
- var gridProps = _ref.gridProps,
2415
- calendarProps = _ref.calendarProps,
2416
- barProps = _ref.barProps,
2417
- ganttHeight = _ref.ganttHeight,
2418
- scrollY = _ref.scrollY,
2419
- scrollX = _ref.scrollX;
2420
- var ganttSVGRef = React.useRef(null);
2421
- var horizontalContainerRef = React.useRef(null);
2422
- var verticalGanttContainerRef = React.useRef(null);
2423
-
2424
- var newBarProps = _extends({}, barProps, {
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,
2425
2395
  svg: ganttSVGRef
2426
- });
2427
-
2428
- React.useEffect(function () {
2396
+ };
2397
+ React.useEffect(() => {
2429
2398
  if (horizontalContainerRef.current) {
2430
2399
  horizontalContainerRef.current.scrollTop = scrollY;
2431
2400
  }
2432
2401
  }, [scrollY]);
2433
- React.useEffect(function () {
2402
+ React.useEffect(() => {
2434
2403
  if (verticalGanttContainerRef.current) {
2435
2404
  verticalGanttContainerRef.current.scrollLeft = scrollX;
2436
2405
  }
@@ -2464,14 +2433,16 @@ var TaskGantt = function TaskGantt(_ref) {
2464
2433
 
2465
2434
  var styles$a = {"scrollWrapper":"_2k9Ys","scroll":"_19jgW"};
2466
2435
 
2467
- var HorizontalScroll = function HorizontalScroll(_ref) {
2468
- var scroll = _ref.scroll,
2469
- svgWidth = _ref.svgWidth,
2470
- taskListWidth = _ref.taskListWidth,
2471
- rtl = _ref.rtl,
2472
- onScroll = _ref.onScroll;
2473
- var scrollRef = React.useRef(null);
2474
- React.useEffect(function () {
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(() => {
2475
2446
  if (scrollRef.current) {
2476
2447
  scrollRef.current.scrollLeft = scroll;
2477
2448
  }
@@ -2479,7 +2450,7 @@ var HorizontalScroll = function HorizontalScroll(_ref) {
2479
2450
  return React__default.createElement("div", {
2480
2451
  dir: "ltr",
2481
2452
  style: {
2482
- margin: rtl ? "0px " + taskListWidth + "px 0px 0px" : "0px 0px 0px " + taskListWidth + "px"
2453
+ margin: rtl ? `0px ${taskListWidth}px 0px 0px` : `0px 0px 0px ${taskListWidth}px`
2483
2454
  },
2484
2455
  className: styles$a.scrollWrapper,
2485
2456
  onScroll: onScroll,
@@ -2566,7 +2537,9 @@ var Gantt = function Gantt(_ref) {
2566
2537
  onDelete = _ref.onDelete,
2567
2538
  onSelect = _ref.onSelect,
2568
2539
  onExpanderClick = _ref.onExpanderClick,
2569
- taskLabelRenderer = _ref.taskLabelRenderer;
2540
+ taskLabelRenderer = _ref.taskLabelRenderer,
2541
+ selectedTaskIds = _ref.selectedTaskIds,
2542
+ onTaskSelectionChange = _ref.onTaskSelectionChange;
2570
2543
  var wrapperRef = React.useRef(null);
2571
2544
  var taskListRef = React.useRef(null);
2572
2545
 
@@ -2949,7 +2922,9 @@ var Gantt = function Gantt(_ref) {
2949
2922
  onDoubleClick: onDoubleClick,
2950
2923
  TaskListHeader: TaskListHeader,
2951
2924
  TaskListTable: TaskListTable,
2952
- taskLabelRenderer: taskLabelRenderer
2925
+ taskLabelRenderer: taskLabelRenderer,
2926
+ selectedTaskIds: selectedTaskIds,
2927
+ onTaskSelectionChange: onTaskSelectionChange
2953
2928
  };
2954
2929
  return React__default.createElement("div", null, React__default.createElement("div", {
2955
2930
  className: styles$9.wrapper,