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