gantt-task-react-v 1.4.7 → 1.4.9
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/gantt/task-gantt-content.d.ts +1 -0
- package/dist/components/other/gantt-drawer.d.ts +1 -0
- package/dist/components/task-list/column-visibility-toggle/index.d.ts +8 -0
- package/dist/components/task-list/index.d.ts +3 -1
- package/dist/gantt-task-react.es.js +316 -30
- package/dist/gantt-task-react.umd.js +316 -30
- package/dist/index.d.ts +2 -1
- package/dist/style.css +151 -8
- package/dist/types/internal-types.d.ts +3 -0
- package/dist/types/public-types.d.ts +13 -0
- package/package.json +1 -1
|
@@ -4606,7 +4606,7 @@
|
|
|
4606
4606
|
const tooltipDefaultContainerParagraph = "_tooltipDefaultContainerParagraph_16o9s_31";
|
|
4607
4607
|
const tooltipDetailsContainer = "_tooltipDetailsContainer_16o9s_47";
|
|
4608
4608
|
const tooltipDetailsContainerHidden = "_tooltipDetailsContainerHidden_16o9s_71";
|
|
4609
|
-
const styles$
|
|
4609
|
+
const styles$n = {
|
|
4610
4610
|
tooltipDefaultContainer,
|
|
4611
4611
|
tooltipDefaultContainerTexts,
|
|
4612
4612
|
tooltipDefaultContainerParagraph,
|
|
@@ -4649,26 +4649,26 @@
|
|
|
4649
4649
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4650
4650
|
"div",
|
|
4651
4651
|
{
|
|
4652
|
-
className: styles$
|
|
4652
|
+
className: styles$n.tooltipDefaultContainer,
|
|
4653
4653
|
style: { fontSize: "var(--gantt-font-size)" },
|
|
4654
4654
|
children: [
|
|
4655
4655
|
/* @__PURE__ */ jsxRuntime.jsx("b", { style: { fontSize: "var(--gantt-font-size)" }, children: `${task.name}: ${task.start.getDate()}-${task.start.getMonth() + 1}-${task.start.getFullYear()} - ${task.end.getDate()}-${task.end.getMonth() + 1}-${task.end.getFullYear()}` }),
|
|
4656
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles$
|
|
4656
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles$n.tooltipDefaultContainerTexts, children: [
|
|
4657
4657
|
task.end.getTime() - task.start.getTime() !== 0 && /* @__PURE__ */ jsxRuntime.jsx(
|
|
4658
4658
|
"p",
|
|
4659
4659
|
{
|
|
4660
|
-
className: styles$
|
|
4660
|
+
className: styles$n.tooltipDefaultContainerParagraph,
|
|
4661
4661
|
children: `${locale.tooltip.duration},: ${~~((task.end.getTime() - task.start.getTime()) / (1e3 * 60 * 60 * 24))} ${locale.suffix.days}`
|
|
4662
4662
|
}
|
|
4663
4663
|
),
|
|
4664
|
-
!!locale.tooltip.progress && /* @__PURE__ */ jsxRuntime.jsx("p", { className: styles$
|
|
4664
|
+
!!locale.tooltip.progress && /* @__PURE__ */ jsxRuntime.jsx("p", { className: styles$n.tooltipDefaultContainerParagraph, children: !!task.progress && `${locale.tooltip.progress}: ${task.progress} %` })
|
|
4665
4665
|
] })
|
|
4666
4666
|
]
|
|
4667
4667
|
}
|
|
4668
4668
|
);
|
|
4669
4669
|
};
|
|
4670
4670
|
const scroll = "_scroll_hp3qb_1";
|
|
4671
|
-
const styles$
|
|
4671
|
+
const styles$m = {
|
|
4672
4672
|
scroll
|
|
4673
4673
|
};
|
|
4674
4674
|
const VerticalScroll = ({
|
|
@@ -4689,7 +4689,7 @@
|
|
|
4689
4689
|
marginLeft: rtl ? void 0 : "-1rem",
|
|
4690
4690
|
pointerEvents: isChangeInProgress ? "none" : void 0
|
|
4691
4691
|
},
|
|
4692
|
-
className: styles$
|
|
4692
|
+
className: styles$m.scroll,
|
|
4693
4693
|
onScroll,
|
|
4694
4694
|
ref: verticalScrollbarRef,
|
|
4695
4695
|
children: /* @__PURE__ */ jsxRuntime.jsx("div", { style: { height: ganttFullHeight, width: 1 } })
|
|
@@ -4767,7 +4767,7 @@
|
|
|
4767
4767
|
const taskListExpander = "_taskListExpander_16z6n_23";
|
|
4768
4768
|
const taskListEmptyExpander = "_taskListEmptyExpander_16z6n_45";
|
|
4769
4769
|
const taskName = "_taskName_16z6n_55";
|
|
4770
|
-
const styles$
|
|
4770
|
+
const styles$l = {
|
|
4771
4771
|
taskListNameWrapper,
|
|
4772
4772
|
dragging,
|
|
4773
4773
|
taskListExpander,
|
|
@@ -4844,7 +4844,7 @@
|
|
|
4844
4844
|
"div",
|
|
4845
4845
|
{
|
|
4846
4846
|
"data-testid": `title-table-cell-${name}`,
|
|
4847
|
-
className: `${styles$
|
|
4847
|
+
className: `${styles$l.taskListNameWrapper}`,
|
|
4848
4848
|
style: {
|
|
4849
4849
|
paddingLeft: depth * nestedTaskNameOffset
|
|
4850
4850
|
},
|
|
@@ -4853,7 +4853,7 @@
|
|
|
4853
4853
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4854
4854
|
"div",
|
|
4855
4855
|
{
|
|
4856
|
-
className: `gantt-expander ${styles$
|
|
4856
|
+
className: `gantt-expander ${styles$l.taskListExpander} ${!hasChildren ? styles$l.taskListEmptyExpander : ""}`,
|
|
4857
4857
|
style: {
|
|
4858
4858
|
left: depth * nestedTaskNameOffset
|
|
4859
4859
|
},
|
|
@@ -4864,7 +4864,7 @@
|
|
|
4864
4864
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
4865
4865
|
"div",
|
|
4866
4866
|
{
|
|
4867
|
-
className: styles$
|
|
4867
|
+
className: styles$l.taskName,
|
|
4868
4868
|
style: { fontWeight: isProject ? "bold" : "regular" },
|
|
4869
4869
|
children: [
|
|
4870
4870
|
isShowTaskNumbers && /* @__PURE__ */ jsxRuntime.jsxs("b", { children: [
|
|
@@ -4919,7 +4919,7 @@
|
|
|
4919
4919
|
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: dependencies.map(({ name }) => name).join(", ") });
|
|
4920
4920
|
};
|
|
4921
4921
|
const button = "_button_l55x0_1";
|
|
4922
|
-
const styles$
|
|
4922
|
+
const styles$k = {
|
|
4923
4923
|
button
|
|
4924
4924
|
};
|
|
4925
4925
|
const DeleteIcon = (props) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -4953,7 +4953,7 @@
|
|
|
4953
4953
|
e.stopPropagation();
|
|
4954
4954
|
},
|
|
4955
4955
|
onClick,
|
|
4956
|
-
className: styles$
|
|
4956
|
+
className: styles$k.button,
|
|
4957
4957
|
children: (icons == null ? void 0 : icons.renderDeleteIcon) ? icons.renderDeleteIcon() : /* @__PURE__ */ jsxRuntime.jsx(DeleteIcon, {})
|
|
4958
4958
|
}
|
|
4959
4959
|
);
|
|
@@ -4988,7 +4988,7 @@
|
|
|
4988
4988
|
e.stopPropagation();
|
|
4989
4989
|
},
|
|
4990
4990
|
onClick,
|
|
4991
|
-
className: styles$
|
|
4991
|
+
className: styles$k.button,
|
|
4992
4992
|
children: (icons == null ? void 0 : icons.renderEditIcon) ? icons.renderEditIcon() : /* @__PURE__ */ jsxRuntime.jsx(EditIcon, {})
|
|
4993
4993
|
}
|
|
4994
4994
|
);
|
|
@@ -5029,7 +5029,7 @@
|
|
|
5029
5029
|
e.stopPropagation();
|
|
5030
5030
|
},
|
|
5031
5031
|
onClick,
|
|
5032
|
-
className: styles$
|
|
5032
|
+
className: styles$k.button,
|
|
5033
5033
|
children: (icons == null ? void 0 : icons.renderAddIcon) ? icons.renderAddIcon() : /* @__PURE__ */ jsxRuntime.jsx(AddIcon, {})
|
|
5034
5034
|
}
|
|
5035
5035
|
);
|
|
@@ -5532,6 +5532,131 @@
|
|
|
5532
5532
|
onColumnResizeStart
|
|
5533
5533
|
];
|
|
5534
5534
|
};
|
|
5535
|
+
const toggleWrapper = "_toggleWrapper_rjfhl_1";
|
|
5536
|
+
const toggleButton = "_toggleButton_rjfhl_15";
|
|
5537
|
+
const dropdown = "_dropdown_rjfhl_51";
|
|
5538
|
+
const dropdownItem = "_dropdownItem_rjfhl_85";
|
|
5539
|
+
const checkbox = "_checkbox_rjfhl_141";
|
|
5540
|
+
const columnLabel = "_columnLabel_rjfhl_157";
|
|
5541
|
+
const dropdownTitle = "_dropdownTitle_rjfhl_169";
|
|
5542
|
+
const divider = "_divider_rjfhl_211";
|
|
5543
|
+
const styles$j = {
|
|
5544
|
+
toggleWrapper,
|
|
5545
|
+
toggleButton,
|
|
5546
|
+
dropdown,
|
|
5547
|
+
dropdownItem,
|
|
5548
|
+
checkbox,
|
|
5549
|
+
columnLabel,
|
|
5550
|
+
dropdownTitle,
|
|
5551
|
+
divider
|
|
5552
|
+
};
|
|
5553
|
+
const ColumnsIcon = ({ className }) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5554
|
+
"svg",
|
|
5555
|
+
{
|
|
5556
|
+
className,
|
|
5557
|
+
width: "16",
|
|
5558
|
+
height: "16",
|
|
5559
|
+
viewBox: "0 0 16 16",
|
|
5560
|
+
fill: "none",
|
|
5561
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
5562
|
+
children: [
|
|
5563
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5564
|
+
"path",
|
|
5565
|
+
{
|
|
5566
|
+
d: "M2 3.5h12M2 8h12M2 12.5h12",
|
|
5567
|
+
stroke: "currentColor",
|
|
5568
|
+
strokeWidth: "1.5",
|
|
5569
|
+
strokeLinecap: "round"
|
|
5570
|
+
}
|
|
5571
|
+
),
|
|
5572
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5573
|
+
"path",
|
|
5574
|
+
{
|
|
5575
|
+
d: "M5 3.5v9M11 3.5v9",
|
|
5576
|
+
stroke: "currentColor",
|
|
5577
|
+
strokeWidth: "1.5",
|
|
5578
|
+
strokeLinecap: "round",
|
|
5579
|
+
strokeDasharray: "1 2"
|
|
5580
|
+
}
|
|
5581
|
+
)
|
|
5582
|
+
]
|
|
5583
|
+
}
|
|
5584
|
+
);
|
|
5585
|
+
const ColumnVisibilityToggleInner = ({
|
|
5586
|
+
allColumns,
|
|
5587
|
+
onColumnVisibilityChange
|
|
5588
|
+
}) => {
|
|
5589
|
+
const [isOpen, setIsOpen] = React.useState(false);
|
|
5590
|
+
const wrapperRef = React.useRef(null);
|
|
5591
|
+
const toggleDropdown = React.useCallback(() => {
|
|
5592
|
+
setIsOpen((prev) => !prev);
|
|
5593
|
+
}, []);
|
|
5594
|
+
const handleToggle = React.useCallback(
|
|
5595
|
+
(columnId, currentlyHidden) => {
|
|
5596
|
+
if (onColumnVisibilityChange) {
|
|
5597
|
+
onColumnVisibilityChange(columnId, !currentlyHidden);
|
|
5598
|
+
}
|
|
5599
|
+
},
|
|
5600
|
+
[onColumnVisibilityChange]
|
|
5601
|
+
);
|
|
5602
|
+
React.useEffect(() => {
|
|
5603
|
+
if (!isOpen)
|
|
5604
|
+
return void 0;
|
|
5605
|
+
const handleClickOutside = (event) => {
|
|
5606
|
+
if (wrapperRef.current && !wrapperRef.current.contains(event.target)) {
|
|
5607
|
+
setIsOpen(false);
|
|
5608
|
+
}
|
|
5609
|
+
};
|
|
5610
|
+
document.addEventListener("mousedown", handleClickOutside);
|
|
5611
|
+
return () => {
|
|
5612
|
+
document.removeEventListener("mousedown", handleClickOutside);
|
|
5613
|
+
};
|
|
5614
|
+
}, [isOpen]);
|
|
5615
|
+
const toggleableColumns = allColumns.filter((col) => col.title);
|
|
5616
|
+
if (toggleableColumns.length === 0) {
|
|
5617
|
+
return null;
|
|
5618
|
+
}
|
|
5619
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles$j.toggleWrapper, ref: wrapperRef, children: [
|
|
5620
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5621
|
+
"button",
|
|
5622
|
+
{
|
|
5623
|
+
className: styles$j.toggleButton,
|
|
5624
|
+
onClick: toggleDropdown,
|
|
5625
|
+
title: "Toggle column visibility",
|
|
5626
|
+
type: "button",
|
|
5627
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(ColumnsIcon, {})
|
|
5628
|
+
}
|
|
5629
|
+
),
|
|
5630
|
+
isOpen && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles$j.dropdown, children: [
|
|
5631
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: styles$j.dropdownTitle, children: "Columns" }),
|
|
5632
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: styles$j.divider }),
|
|
5633
|
+
toggleableColumns.map((column) => {
|
|
5634
|
+
const isVisible = !column.hidden;
|
|
5635
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5636
|
+
"label",
|
|
5637
|
+
{
|
|
5638
|
+
className: styles$j.dropdownItem,
|
|
5639
|
+
onClick: (e) => e.stopPropagation(),
|
|
5640
|
+
children: [
|
|
5641
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5642
|
+
"input",
|
|
5643
|
+
{
|
|
5644
|
+
type: "checkbox",
|
|
5645
|
+
className: styles$j.checkbox,
|
|
5646
|
+
checked: isVisible,
|
|
5647
|
+
onChange: () => handleToggle(column.id, !!column.hidden)
|
|
5648
|
+
}
|
|
5649
|
+
),
|
|
5650
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: styles$j.columnLabel, children: column.title || column.id })
|
|
5651
|
+
]
|
|
5652
|
+
},
|
|
5653
|
+
column.id
|
|
5654
|
+
);
|
|
5655
|
+
})
|
|
5656
|
+
] })
|
|
5657
|
+
] });
|
|
5658
|
+
};
|
|
5659
|
+
const ColumnVisibilityToggle = React.memo(ColumnVisibilityToggleInner);
|
|
5535
5660
|
const ganttTable = "_ganttTable_5goa0_3";
|
|
5536
5661
|
const ganttTable_Header = "_ganttTable_Header_5goa0_15";
|
|
5537
5662
|
const ganttTable_HeaderMoveTask = "_ganttTable_HeaderMoveTask_5goa0_27";
|
|
@@ -5549,9 +5674,12 @@
|
|
|
5549
5674
|
const TaskListTableHeadersDefaultInner = ({
|
|
5550
5675
|
headerHeight,
|
|
5551
5676
|
columns,
|
|
5677
|
+
allColumns,
|
|
5552
5678
|
canResizeColumns,
|
|
5553
5679
|
canMoveTasks,
|
|
5554
|
-
|
|
5680
|
+
canToggleColumns,
|
|
5681
|
+
onColumnResizeStart,
|
|
5682
|
+
onColumnVisibilityChange
|
|
5555
5683
|
}) => {
|
|
5556
5684
|
const pinnedStyles = React.useMemo(() => {
|
|
5557
5685
|
const result = {};
|
|
@@ -5645,7 +5773,21 @@
|
|
|
5645
5773
|
}
|
|
5646
5774
|
)
|
|
5647
5775
|
] }, index2);
|
|
5648
|
-
})
|
|
5776
|
+
}),
|
|
5777
|
+
canToggleColumns && /* @__PURE__ */ jsxRuntime.jsx(
|
|
5778
|
+
"div",
|
|
5779
|
+
{
|
|
5780
|
+
className: styles$i.ganttTable_HeaderItem,
|
|
5781
|
+
style: { minWidth: 28, maxWidth: 28 },
|
|
5782
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5783
|
+
ColumnVisibilityToggle,
|
|
5784
|
+
{
|
|
5785
|
+
allColumns,
|
|
5786
|
+
onColumnVisibilityChange
|
|
5787
|
+
}
|
|
5788
|
+
)
|
|
5789
|
+
}
|
|
5790
|
+
)
|
|
5649
5791
|
]
|
|
5650
5792
|
}
|
|
5651
5793
|
)
|
|
@@ -10804,10 +10946,12 @@
|
|
|
10804
10946
|
tasks,
|
|
10805
10947
|
onResizeColumn,
|
|
10806
10948
|
canReorderTasks,
|
|
10949
|
+
canToggleColumns,
|
|
10950
|
+
onColumnVisibilityChange,
|
|
10807
10951
|
tableBottom
|
|
10808
10952
|
}) => {
|
|
10809
10953
|
const [
|
|
10810
|
-
|
|
10954
|
+
allColumns,
|
|
10811
10955
|
taskListWidth,
|
|
10812
10956
|
tableWidth,
|
|
10813
10957
|
onTableResizeStart,
|
|
@@ -10818,6 +10962,10 @@
|
|
|
10818
10962
|
onResizeColumn,
|
|
10819
10963
|
ganttRef
|
|
10820
10964
|
);
|
|
10965
|
+
const columns = React.useMemo(
|
|
10966
|
+
() => allColumns.filter((col) => !col.hidden),
|
|
10967
|
+
[allColumns]
|
|
10968
|
+
);
|
|
10821
10969
|
const renderedIndexes = useOptimizedList(
|
|
10822
10970
|
taskListContainerRef,
|
|
10823
10971
|
"scrollTop",
|
|
@@ -10902,7 +11050,10 @@
|
|
|
10902
11050
|
canMoveTasks: canReorderTasks,
|
|
10903
11051
|
headerHeight: distances.headerHeight,
|
|
10904
11052
|
columns,
|
|
11053
|
+
allColumns,
|
|
11054
|
+
canToggleColumns: !!canToggleColumns,
|
|
10905
11055
|
onColumnResizeStart,
|
|
11056
|
+
onColumnVisibilityChange,
|
|
10906
11057
|
canResizeColumns
|
|
10907
11058
|
}
|
|
10908
11059
|
),
|
|
@@ -13178,6 +13329,7 @@
|
|
|
13178
13329
|
onArrowDoubleClick,
|
|
13179
13330
|
onArrowClick,
|
|
13180
13331
|
activeArrowKey,
|
|
13332
|
+
activeTaskId,
|
|
13181
13333
|
onDoubleClick,
|
|
13182
13334
|
onClick,
|
|
13183
13335
|
renderedRowIndexes,
|
|
@@ -13482,7 +13634,7 @@
|
|
|
13482
13634
|
rtl,
|
|
13483
13635
|
onArrowDoubleClick,
|
|
13484
13636
|
onArrowClick,
|
|
13485
|
-
isActive: activeArrowKey === `${source.id}|${taskId}
|
|
13637
|
+
isActive: activeArrowKey === `${source.id}|${taskId}` || activeTaskId === source.id || activeTaskId === taskId,
|
|
13486
13638
|
fromConnectionIndex: getConnectionIndex(
|
|
13487
13639
|
`${source.id}|${sourceTarget}|out`
|
|
13488
13640
|
),
|
|
@@ -13568,7 +13720,7 @@
|
|
|
13568
13720
|
rtl,
|
|
13569
13721
|
onArrowDoubleClick,
|
|
13570
13722
|
onArrowClick,
|
|
13571
|
-
isActive: activeArrowKey === `${taskId}|${dependent.id}
|
|
13723
|
+
isActive: activeArrowKey === `${taskId}|${dependent.id}` || activeTaskId === taskId || activeTaskId === dependent.id,
|
|
13572
13724
|
fromConnectionIndex: getConnectionIndex(
|
|
13573
13725
|
`${taskId}|${ownTarget}|out`
|
|
13574
13726
|
),
|
|
@@ -13667,7 +13819,7 @@
|
|
|
13667
13819
|
rtl,
|
|
13668
13820
|
onArrowDoubleClick,
|
|
13669
13821
|
onArrowClick,
|
|
13670
|
-
isActive: activeArrowKey === `${source.id}|${taskId}
|
|
13822
|
+
isActive: activeArrowKey === `${source.id}|${taskId}` || activeTaskId === source.id || activeTaskId === taskId,
|
|
13671
13823
|
fromConnectionIndex: getConnectionIndex(
|
|
13672
13824
|
`${source.id}|${sourceTarget}|out`
|
|
13673
13825
|
),
|
|
@@ -13727,6 +13879,7 @@
|
|
|
13727
13879
|
onArrowDoubleClick,
|
|
13728
13880
|
onArrowClick,
|
|
13729
13881
|
activeArrowKey,
|
|
13882
|
+
activeTaskId,
|
|
13730
13883
|
showProgress,
|
|
13731
13884
|
progressColor
|
|
13732
13885
|
]);
|
|
@@ -19347,13 +19500,15 @@
|
|
|
19347
19500
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: `${styles$1.loader} ${loading ? "" : styles$1.loaderHidden}` });
|
|
19348
19501
|
};
|
|
19349
19502
|
const GanttLoader = React.memo(GanttLoaderInner);
|
|
19350
|
-
const overlay = "
|
|
19351
|
-
const drawer = "
|
|
19352
|
-
const drawer_open = "
|
|
19353
|
-
const header = "
|
|
19354
|
-
const title = "
|
|
19355
|
-
const closeButton = "
|
|
19356
|
-
const body = "
|
|
19503
|
+
const overlay = "_overlay_hyem8_1";
|
|
19504
|
+
const drawer = "_drawer_hyem8_19";
|
|
19505
|
+
const drawer_open = "_drawer_open_hyem8_51";
|
|
19506
|
+
const header = "_header_hyem8_59";
|
|
19507
|
+
const title = "_title_hyem8_77";
|
|
19508
|
+
const closeButton = "_closeButton_hyem8_97";
|
|
19509
|
+
const body = "_body_hyem8_131";
|
|
19510
|
+
const goToTaskBar = "_goToTaskBar_hyem8_145";
|
|
19511
|
+
const goToTaskButton = "_goToTaskButton_hyem8_159";
|
|
19357
19512
|
const styles = {
|
|
19358
19513
|
overlay,
|
|
19359
19514
|
drawer,
|
|
@@ -19361,12 +19516,15 @@
|
|
|
19361
19516
|
header,
|
|
19362
19517
|
title,
|
|
19363
19518
|
closeButton,
|
|
19364
|
-
body
|
|
19519
|
+
body,
|
|
19520
|
+
goToTaskBar,
|
|
19521
|
+
goToTaskButton
|
|
19365
19522
|
};
|
|
19366
19523
|
const GanttDrawerInner = ({
|
|
19367
19524
|
data,
|
|
19368
19525
|
width,
|
|
19369
19526
|
onClose,
|
|
19527
|
+
onGoToTask,
|
|
19370
19528
|
renderContent
|
|
19371
19529
|
}) => {
|
|
19372
19530
|
const handleOverlayClick = React.useCallback(
|
|
@@ -19377,6 +19535,12 @@
|
|
|
19377
19535
|
[onClose]
|
|
19378
19536
|
);
|
|
19379
19537
|
const title2 = (data == null ? void 0 : data.type) === "task" ? data.task.name : (data == null ? void 0 : data.type) === "arrow" ? `${data.taskFrom.name} → ${data.taskTo.name}` : "";
|
|
19538
|
+
const goToTaskIds = [];
|
|
19539
|
+
if ((data == null ? void 0 : data.type) === "task") {
|
|
19540
|
+
goToTaskIds.push(data.task.id);
|
|
19541
|
+
} else if ((data == null ? void 0 : data.type) === "arrow") {
|
|
19542
|
+
goToTaskIds.push(data.taskFrom.id, data.taskTo.id);
|
|
19543
|
+
}
|
|
19380
19544
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
19381
19545
|
data && /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles.overlay, onClick: handleOverlayClick }),
|
|
19382
19546
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -19406,7 +19570,78 @@
|
|
|
19406
19570
|
}
|
|
19407
19571
|
)
|
|
19408
19572
|
] }),
|
|
19409
|
-
/* @__PURE__ */ jsxRuntime.
|
|
19573
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles.body, children: [
|
|
19574
|
+
data && onGoToTask && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles.goToTaskBar, children: [
|
|
19575
|
+
data.type === "task" && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
19576
|
+
"button",
|
|
19577
|
+
{
|
|
19578
|
+
className: styles.goToTaskButton,
|
|
19579
|
+
onClick: () => onGoToTask(data.task.id),
|
|
19580
|
+
type: "button",
|
|
19581
|
+
children: [
|
|
19582
|
+
/* @__PURE__ */ jsxRuntime.jsx("svg", { width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
19583
|
+
"path",
|
|
19584
|
+
{
|
|
19585
|
+
d: "M2 7h10M8 3l4 4-4 4",
|
|
19586
|
+
stroke: "currentColor",
|
|
19587
|
+
strokeWidth: "1.5",
|
|
19588
|
+
strokeLinecap: "round",
|
|
19589
|
+
strokeLinejoin: "round"
|
|
19590
|
+
}
|
|
19591
|
+
) }),
|
|
19592
|
+
"Go to Task"
|
|
19593
|
+
]
|
|
19594
|
+
}
|
|
19595
|
+
),
|
|
19596
|
+
data.type === "arrow" && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
19597
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
19598
|
+
"button",
|
|
19599
|
+
{
|
|
19600
|
+
className: styles.goToTaskButton,
|
|
19601
|
+
onClick: () => onGoToTask(data.taskFrom.id),
|
|
19602
|
+
type: "button",
|
|
19603
|
+
children: [
|
|
19604
|
+
/* @__PURE__ */ jsxRuntime.jsx("svg", { width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
19605
|
+
"path",
|
|
19606
|
+
{
|
|
19607
|
+
d: "M2 7h10M8 3l4 4-4 4",
|
|
19608
|
+
stroke: "currentColor",
|
|
19609
|
+
strokeWidth: "1.5",
|
|
19610
|
+
strokeLinecap: "round",
|
|
19611
|
+
strokeLinejoin: "round"
|
|
19612
|
+
}
|
|
19613
|
+
) }),
|
|
19614
|
+
"Go to ",
|
|
19615
|
+
data.taskFrom.name
|
|
19616
|
+
]
|
|
19617
|
+
}
|
|
19618
|
+
),
|
|
19619
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
19620
|
+
"button",
|
|
19621
|
+
{
|
|
19622
|
+
className: styles.goToTaskButton,
|
|
19623
|
+
onClick: () => onGoToTask(data.taskTo.id),
|
|
19624
|
+
type: "button",
|
|
19625
|
+
children: [
|
|
19626
|
+
/* @__PURE__ */ jsxRuntime.jsx("svg", { width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
19627
|
+
"path",
|
|
19628
|
+
{
|
|
19629
|
+
d: "M2 7h10M8 3l4 4-4 4",
|
|
19630
|
+
stroke: "currentColor",
|
|
19631
|
+
strokeWidth: "1.5",
|
|
19632
|
+
strokeLinecap: "round",
|
|
19633
|
+
strokeLinejoin: "round"
|
|
19634
|
+
}
|
|
19635
|
+
) }),
|
|
19636
|
+
"Go to ",
|
|
19637
|
+
data.taskTo.name
|
|
19638
|
+
]
|
|
19639
|
+
}
|
|
19640
|
+
)
|
|
19641
|
+
] })
|
|
19642
|
+
] }),
|
|
19643
|
+
data && renderContent ? renderContent(data) : null
|
|
19644
|
+
] })
|
|
19410
19645
|
]
|
|
19411
19646
|
}
|
|
19412
19647
|
)
|
|
@@ -19481,6 +19716,7 @@
|
|
|
19481
19716
|
const renderDrawerContent = drawerProps == null ? void 0 : drawerProps.renderDrawerContent;
|
|
19482
19717
|
const [drawerData, setDrawerData] = React.useState(null);
|
|
19483
19718
|
const [activeArrowKey, setActiveArrowKey] = React.useState(null);
|
|
19719
|
+
const [activeTaskId, setActiveTaskId] = React.useState(null);
|
|
19484
19720
|
const taskBar = React.useMemo(() => {
|
|
19485
19721
|
return mergeDeepObj(
|
|
19486
19722
|
{},
|
|
@@ -20574,6 +20810,7 @@
|
|
|
20574
20810
|
(taskFrom, taskTo) => {
|
|
20575
20811
|
if (enableDrawer) {
|
|
20576
20812
|
setActiveArrowKey(`${taskFrom.id}|${taskTo.id}`);
|
|
20813
|
+
setActiveTaskId(null);
|
|
20577
20814
|
setDrawerData({ type: "arrow", taskFrom, taskTo });
|
|
20578
20815
|
}
|
|
20579
20816
|
if (taskBar.onArrowClick) {
|
|
@@ -20586,6 +20823,7 @@
|
|
|
20586
20823
|
(task, _event) => {
|
|
20587
20824
|
if (enableDrawer) {
|
|
20588
20825
|
setActiveArrowKey(null);
|
|
20826
|
+
setActiveTaskId(task.id);
|
|
20589
20827
|
setDrawerData({ type: "task", task });
|
|
20590
20828
|
}
|
|
20591
20829
|
if (taskBar.onClick) {
|
|
@@ -20597,7 +20835,51 @@
|
|
|
20597
20835
|
const handleDrawerClose = React.useCallback(() => {
|
|
20598
20836
|
setDrawerData(null);
|
|
20599
20837
|
setActiveArrowKey(null);
|
|
20838
|
+
setActiveTaskId(null);
|
|
20600
20839
|
}, []);
|
|
20840
|
+
const handleGoToTask = React.useCallback(
|
|
20841
|
+
(taskId) => {
|
|
20842
|
+
for (const [comparisonLevel, levelMap] of tasksMap) {
|
|
20843
|
+
const task = levelMap.get(taskId);
|
|
20844
|
+
if (!task || task.type === "empty")
|
|
20845
|
+
continue;
|
|
20846
|
+
const { x1 } = getTaskCoordinates(task, mapTaskToCoordinates);
|
|
20847
|
+
setScrollXProgrammatically(Math.max(0, x1 - 100));
|
|
20848
|
+
const rowIndexMap = taskToRowIndexMap.get(comparisonLevel);
|
|
20849
|
+
if (rowIndexMap) {
|
|
20850
|
+
const rowIndex = rowIndexMap.get(taskId);
|
|
20851
|
+
if (typeof rowIndex === "number") {
|
|
20852
|
+
const targetScrollY = rowIndex * fullRowHeight - ganttHeight / 2 + fullRowHeight / 2;
|
|
20853
|
+
setScrollYProgrammatically(
|
|
20854
|
+
Math.max(
|
|
20855
|
+
0,
|
|
20856
|
+
Math.min(targetScrollY, ganttFullHeight - ganttHeight)
|
|
20857
|
+
)
|
|
20858
|
+
);
|
|
20859
|
+
}
|
|
20860
|
+
}
|
|
20861
|
+
selectTask(taskId);
|
|
20862
|
+
if (onSelectTaskIds) {
|
|
20863
|
+
onSelectTaskIds([taskId]);
|
|
20864
|
+
}
|
|
20865
|
+
break;
|
|
20866
|
+
}
|
|
20867
|
+
handleDrawerClose();
|
|
20868
|
+
},
|
|
20869
|
+
[
|
|
20870
|
+
tasksMap,
|
|
20871
|
+
mapTaskToCoordinates,
|
|
20872
|
+
taskToRowIndexMap,
|
|
20873
|
+
fullRowHeight,
|
|
20874
|
+
ganttHeight,
|
|
20875
|
+
ganttFullHeight,
|
|
20876
|
+
setScrollXProgrammatically,
|
|
20877
|
+
setScrollYProgrammatically,
|
|
20878
|
+
selectTask,
|
|
20879
|
+
onSelectTaskIds,
|
|
20880
|
+
handleDrawerClose
|
|
20881
|
+
]
|
|
20882
|
+
);
|
|
20601
20883
|
const handleAction = useHandleAction({
|
|
20602
20884
|
checkTaskIdExists,
|
|
20603
20885
|
childTasksMap,
|
|
@@ -20813,6 +21095,7 @@
|
|
|
20813
21095
|
onArrowDoubleClick,
|
|
20814
21096
|
onArrowClick: enableDrawer ? onArrowClick : taskBar.onArrowClick,
|
|
20815
21097
|
activeArrowKey,
|
|
21098
|
+
activeTaskId,
|
|
20816
21099
|
renderedRowIndexes,
|
|
20817
21100
|
rtl,
|
|
20818
21101
|
selectTaskOnMouseDown,
|
|
@@ -20852,6 +21135,7 @@
|
|
|
20852
21135
|
onArrowDoubleClick,
|
|
20853
21136
|
onArrowClick,
|
|
20854
21137
|
activeArrowKey,
|
|
21138
|
+
activeTaskId,
|
|
20855
21139
|
enableDrawer,
|
|
20856
21140
|
handleTaskClick,
|
|
20857
21141
|
renderedRowIndexes,
|
|
@@ -21027,6 +21311,7 @@
|
|
|
21027
21311
|
data: drawerData,
|
|
21028
21312
|
width: drawerWidth,
|
|
21029
21313
|
onClose: handleDrawerClose,
|
|
21314
|
+
onGoToTask: handleGoToTask,
|
|
21030
21315
|
renderContent: renderDrawerContent
|
|
21031
21316
|
}
|
|
21032
21317
|
)
|
|
@@ -21035,6 +21320,7 @@
|
|
|
21035
21320
|
) }) });
|
|
21036
21321
|
};
|
|
21037
21322
|
exports2.AddColumn = AddColumn;
|
|
21323
|
+
exports2.ColumnVisibilityToggle = ColumnVisibilityToggle;
|
|
21038
21324
|
exports2.DateEndColumn = DateEndColumn;
|
|
21039
21325
|
exports2.DateStartColumn = DateStartColumn;
|
|
21040
21326
|
exports2.DeleteColumn = DeleteColumn;
|
package/dist/index.d.ts
CHANGED
|
@@ -7,8 +7,9 @@ export { DateStartColumn } from "./components/task-list/task-list-table-columns/
|
|
|
7
7
|
export { DeleteColumn } from "./components/task-list/task-list-table-columns/delete-column";
|
|
8
8
|
export { DependenciesColumn } from "./components/task-list/task-list-table-columns/dependencies-column";
|
|
9
9
|
export { TitleColumn } from "./components/task-list/task-list-table-columns/title-column";
|
|
10
|
-
export { TaskResponsiveLabel, TaskCenterLabel, TaskOutlineLabel } from "./components/task-item/task-label";
|
|
10
|
+
export { TaskResponsiveLabel, TaskCenterLabel, TaskOutlineLabel, } from "./components/task-item/task-label";
|
|
11
11
|
export { useTaskListColumnsBuilder } from "./components/task-list/task-list-table-columns/use-task-list-columns-builder";
|
|
12
|
+
export { ColumnVisibilityToggle } from "./components/task-list/column-visibility-toggle";
|
|
12
13
|
export * from "./components/context-menu-options";
|
|
13
14
|
export * from "./constants";
|
|
14
15
|
export * from "./types";
|