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