gantt-task-react-v 1.0.0 → 1.0.4
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/README.md
CHANGED
|
@@ -1,26 +1,20 @@
|
|
|
1
|
-
# gantt-task-react
|
|
1
|
+
# kvandake-gantt-task-react
|
|
2
2
|
|
|
3
|
-
## Interactive Gantt Chart for React with TypeScript
|
|
3
|
+
## Interactive Gantt Chart for React with TypeScript.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
## Key Features
|
|
8
|
-
|
|
9
|
-
- **Flexible Height**: No more fixed 600px height limitation - automatically adapts to content
|
|
10
|
-
- **Responsive Design**: Works better with different screen sizes and containers
|
|
11
|
-
- **All Original Features**: Maintains all functionality from the original package
|
|
5
|
+
## [Live Demo In Storybook](https://661071b076b50cb537c16c19-yrsukdfefs.chromatic.com/)
|
|
12
6
|
|
|
13
7
|
## Install
|
|
14
8
|
|
|
15
9
|
```
|
|
16
|
-
npm install gantt-task-react
|
|
10
|
+
npm install webagility-gantt-task-react
|
|
17
11
|
```
|
|
18
12
|
|
|
19
13
|
## How to use it
|
|
20
14
|
|
|
21
15
|
```ts
|
|
22
|
-
import { Gantt, Task, EventOption, StylingOption, ViewMode, DisplayOption } from 'gantt-task-react
|
|
23
|
-
import "gantt-task-react
|
|
16
|
+
import { Gantt, Task, EventOption, StylingOption, ViewMode, DisplayOption } from 'gantt-task-react';
|
|
17
|
+
import "gantt-task-react/dist/index.css";
|
|
24
18
|
|
|
25
19
|
let tasks: Task[] = [
|
|
26
20
|
{
|
|
@@ -10,7 +10,6 @@ export interface TaskGanttProps extends GanttTaskBarActions {
|
|
|
10
10
|
fullRowHeight: number;
|
|
11
11
|
fullSvgWidth: number;
|
|
12
12
|
ganttFullHeight: number;
|
|
13
|
-
ganttHeight: number;
|
|
14
13
|
ganttSVGRef: RefObject<SVGSVGElement>;
|
|
15
14
|
ganttTodayProps: GanttTodayProps;
|
|
16
15
|
horizontalContainerRef: RefObject<HTMLDivElement>;
|
|
@@ -14,7 +14,6 @@ export type TaskListProps = {
|
|
|
14
14
|
distances: Distances;
|
|
15
15
|
fullRowHeight: number;
|
|
16
16
|
ganttFullHeight: number;
|
|
17
|
-
ganttHeight: number;
|
|
18
17
|
getTaskCurrentState: (task: Task) => Task;
|
|
19
18
|
handleAddTask: (task: Task | null) => void;
|
|
20
19
|
handleDeleteTasks: (task: RenderTask[]) => void;
|
|
@@ -5181,8 +5181,7 @@ const DEFAULT_THEME = {
|
|
|
5181
5181
|
expandIconWidth: 20,
|
|
5182
5182
|
handleWidth: 8,
|
|
5183
5183
|
headerHeight: 50,
|
|
5184
|
-
ganttHeight:
|
|
5185
|
-
// Flexible height - will use container or screen height
|
|
5184
|
+
ganttHeight: 600,
|
|
5186
5185
|
minimumRowDisplayed: 4,
|
|
5187
5186
|
nestedTaskNameOffset: 20,
|
|
5188
5187
|
relationCircleOffset: 10,
|
|
@@ -10699,7 +10698,6 @@ const TaskListInner = ({
|
|
|
10699
10698
|
distances,
|
|
10700
10699
|
fullRowHeight,
|
|
10701
10700
|
ganttFullHeight,
|
|
10702
|
-
ganttHeight,
|
|
10703
10701
|
getTaskCurrentState,
|
|
10704
10702
|
handleAddTask,
|
|
10705
10703
|
handleDeleteTasks,
|
|
@@ -10830,8 +10828,8 @@ const TaskListInner = ({
|
|
|
10830
10828
|
ref: taskListContainerRef,
|
|
10831
10829
|
className: styles$d.horizontalContainer,
|
|
10832
10830
|
style: {
|
|
10833
|
-
height: Math.
|
|
10834
|
-
|
|
10831
|
+
height: Math.min(
|
|
10832
|
+
ganttFullHeight,
|
|
10835
10833
|
distances.minimumRowDisplayed * distances.rowHeight
|
|
10836
10834
|
),
|
|
10837
10835
|
width: taskListWidth
|
|
@@ -13174,7 +13172,6 @@ const TaskGanttInner = (props) => {
|
|
|
13174
13172
|
fullRowHeight,
|
|
13175
13173
|
fullSvgWidth,
|
|
13176
13174
|
ganttFullHeight,
|
|
13177
|
-
ganttHeight,
|
|
13178
13175
|
ganttSVGRef,
|
|
13179
13176
|
ganttTodayProps,
|
|
13180
13177
|
ganttTodayProps: {
|
|
@@ -13191,10 +13188,10 @@ const TaskGanttInner = (props) => {
|
|
|
13191
13188
|
const moveStateScrollRef = useRef(null);
|
|
13192
13189
|
const containerStyle = useMemo(
|
|
13193
13190
|
() => ({
|
|
13194
|
-
height: Math.
|
|
13191
|
+
height: Math.min(ganttFullHeight, minimumRowDisplayed * rowHeight),
|
|
13195
13192
|
width: fullSvgWidth
|
|
13196
13193
|
}),
|
|
13197
|
-
[
|
|
13194
|
+
[ganttFullHeight, minimumRowDisplayed, rowHeight, fullSvgWidth]
|
|
13198
13195
|
);
|
|
13199
13196
|
const gridStyle = useMemo(
|
|
13200
13197
|
() => ({
|
|
@@ -13324,7 +13321,15 @@ const TaskGanttInner = (props) => {
|
|
|
13324
13321
|
ref: ganttSVGRef,
|
|
13325
13322
|
children: [
|
|
13326
13323
|
/* @__PURE__ */ jsx(GanttToday, { ...ganttTodayProps }),
|
|
13327
|
-
/* @__PURE__ */ jsx(
|
|
13324
|
+
/* @__PURE__ */ jsx(
|
|
13325
|
+
"rect",
|
|
13326
|
+
{
|
|
13327
|
+
ref: contentRef,
|
|
13328
|
+
width: "100%",
|
|
13329
|
+
height: "100%",
|
|
13330
|
+
fill: "transparent"
|
|
13331
|
+
}
|
|
13332
|
+
),
|
|
13328
13333
|
/* @__PURE__ */ jsx(TaskGanttContent, { ...barProps })
|
|
13329
13334
|
]
|
|
13330
13335
|
}
|
|
@@ -19334,7 +19339,13 @@ const Gantt = (props) => {
|
|
|
19334
19339
|
}
|
|
19335
19340
|
});
|
|
19336
19341
|
},
|
|
19337
|
-
[
|
|
19342
|
+
[
|
|
19343
|
+
getMetadata,
|
|
19344
|
+
handleCommitInternal,
|
|
19345
|
+
mapTaskToGlobalIndex,
|
|
19346
|
+
onChangeTooltipTask,
|
|
19347
|
+
prepareSuggestions
|
|
19348
|
+
]
|
|
19338
19349
|
);
|
|
19339
19350
|
const handleMoveTaskBefore = useCallback(
|
|
19340
19351
|
(target, taskForMove) => {
|
|
@@ -19664,7 +19675,20 @@ const Gantt = (props) => {
|
|
|
19664
19675
|
startColumnIndex,
|
|
19665
19676
|
language
|
|
19666
19677
|
}),
|
|
19667
|
-
[
|
|
19678
|
+
[
|
|
19679
|
+
additionalLeftSpace,
|
|
19680
|
+
dateSetup,
|
|
19681
|
+
distances,
|
|
19682
|
+
endColumnIndex,
|
|
19683
|
+
fullSvgWidth,
|
|
19684
|
+
getDate,
|
|
19685
|
+
isUnknownDates,
|
|
19686
|
+
taskBar.renderBottomHeader,
|
|
19687
|
+
taskBar.renderTopHeader,
|
|
19688
|
+
rtl,
|
|
19689
|
+
startColumnIndex,
|
|
19690
|
+
language
|
|
19691
|
+
]
|
|
19668
19692
|
);
|
|
19669
19693
|
const renderTaskBarProps = useMemo(
|
|
19670
19694
|
() => ({
|
|
@@ -19755,7 +19779,6 @@ const Gantt = (props) => {
|
|
|
19755
19779
|
distances,
|
|
19756
19780
|
fullRowHeight,
|
|
19757
19781
|
ganttFullHeight,
|
|
19758
|
-
ganttHeight,
|
|
19759
19782
|
getTaskCurrentState,
|
|
19760
19783
|
handleAddTask,
|
|
19761
19784
|
handleDeleteTasks,
|
|
@@ -19785,7 +19808,6 @@ const Gantt = (props) => {
|
|
|
19785
19808
|
distances,
|
|
19786
19809
|
fullRowHeight,
|
|
19787
19810
|
ganttFullHeight,
|
|
19788
|
-
ganttHeight,
|
|
19789
19811
|
getTaskCurrentState,
|
|
19790
19812
|
handleAddTask,
|
|
19791
19813
|
handleDeleteTasks,
|
|
@@ -19826,7 +19848,6 @@ const Gantt = (props) => {
|
|
|
19826
19848
|
fullRowHeight,
|
|
19827
19849
|
fullSvgWidth,
|
|
19828
19850
|
ganttFullHeight,
|
|
19829
|
-
ganttHeight,
|
|
19830
19851
|
ganttSVGRef,
|
|
19831
19852
|
ganttTodayProps: gridProps,
|
|
19832
19853
|
horizontalContainerRef,
|
|
@@ -5198,8 +5198,7 @@
|
|
|
5198
5198
|
expandIconWidth: 20,
|
|
5199
5199
|
handleWidth: 8,
|
|
5200
5200
|
headerHeight: 50,
|
|
5201
|
-
ganttHeight:
|
|
5202
|
-
// Flexible height - will use container or screen height
|
|
5201
|
+
ganttHeight: 600,
|
|
5203
5202
|
minimumRowDisplayed: 4,
|
|
5204
5203
|
nestedTaskNameOffset: 20,
|
|
5205
5204
|
relationCircleOffset: 10,
|
|
@@ -10716,7 +10715,6 @@
|
|
|
10716
10715
|
distances,
|
|
10717
10716
|
fullRowHeight,
|
|
10718
10717
|
ganttFullHeight,
|
|
10719
|
-
ganttHeight,
|
|
10720
10718
|
getTaskCurrentState,
|
|
10721
10719
|
handleAddTask,
|
|
10722
10720
|
handleDeleteTasks,
|
|
@@ -10847,8 +10845,8 @@
|
|
|
10847
10845
|
ref: taskListContainerRef,
|
|
10848
10846
|
className: styles$d.horizontalContainer,
|
|
10849
10847
|
style: {
|
|
10850
|
-
height: Math.
|
|
10851
|
-
|
|
10848
|
+
height: Math.min(
|
|
10849
|
+
ganttFullHeight,
|
|
10852
10850
|
distances.minimumRowDisplayed * distances.rowHeight
|
|
10853
10851
|
),
|
|
10854
10852
|
width: taskListWidth
|
|
@@ -13191,7 +13189,6 @@
|
|
|
13191
13189
|
fullRowHeight,
|
|
13192
13190
|
fullSvgWidth,
|
|
13193
13191
|
ganttFullHeight,
|
|
13194
|
-
ganttHeight,
|
|
13195
13192
|
ganttSVGRef,
|
|
13196
13193
|
ganttTodayProps,
|
|
13197
13194
|
ganttTodayProps: {
|
|
@@ -13208,10 +13205,10 @@
|
|
|
13208
13205
|
const moveStateScrollRef = React.useRef(null);
|
|
13209
13206
|
const containerStyle = React.useMemo(
|
|
13210
13207
|
() => ({
|
|
13211
|
-
height: Math.
|
|
13208
|
+
height: Math.min(ganttFullHeight, minimumRowDisplayed * rowHeight),
|
|
13212
13209
|
width: fullSvgWidth
|
|
13213
13210
|
}),
|
|
13214
|
-
[
|
|
13211
|
+
[ganttFullHeight, minimumRowDisplayed, rowHeight, fullSvgWidth]
|
|
13215
13212
|
);
|
|
13216
13213
|
const gridStyle = React.useMemo(
|
|
13217
13214
|
() => ({
|
|
@@ -13341,7 +13338,15 @@
|
|
|
13341
13338
|
ref: ganttSVGRef,
|
|
13342
13339
|
children: [
|
|
13343
13340
|
/* @__PURE__ */ jsxRuntime.jsx(GanttToday, { ...ganttTodayProps }),
|
|
13344
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
13341
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
13342
|
+
"rect",
|
|
13343
|
+
{
|
|
13344
|
+
ref: contentRef,
|
|
13345
|
+
width: "100%",
|
|
13346
|
+
height: "100%",
|
|
13347
|
+
fill: "transparent"
|
|
13348
|
+
}
|
|
13349
|
+
),
|
|
13345
13350
|
/* @__PURE__ */ jsxRuntime.jsx(TaskGanttContent, { ...barProps })
|
|
13346
13351
|
]
|
|
13347
13352
|
}
|
|
@@ -19351,7 +19356,13 @@
|
|
|
19351
19356
|
}
|
|
19352
19357
|
});
|
|
19353
19358
|
},
|
|
19354
|
-
[
|
|
19359
|
+
[
|
|
19360
|
+
getMetadata,
|
|
19361
|
+
handleCommitInternal,
|
|
19362
|
+
mapTaskToGlobalIndex,
|
|
19363
|
+
onChangeTooltipTask,
|
|
19364
|
+
prepareSuggestions
|
|
19365
|
+
]
|
|
19355
19366
|
);
|
|
19356
19367
|
const handleMoveTaskBefore = React.useCallback(
|
|
19357
19368
|
(target, taskForMove) => {
|
|
@@ -19681,7 +19692,20 @@
|
|
|
19681
19692
|
startColumnIndex,
|
|
19682
19693
|
language
|
|
19683
19694
|
}),
|
|
19684
|
-
[
|
|
19695
|
+
[
|
|
19696
|
+
additionalLeftSpace,
|
|
19697
|
+
dateSetup,
|
|
19698
|
+
distances,
|
|
19699
|
+
endColumnIndex,
|
|
19700
|
+
fullSvgWidth,
|
|
19701
|
+
getDate,
|
|
19702
|
+
isUnknownDates,
|
|
19703
|
+
taskBar.renderBottomHeader,
|
|
19704
|
+
taskBar.renderTopHeader,
|
|
19705
|
+
rtl,
|
|
19706
|
+
startColumnIndex,
|
|
19707
|
+
language
|
|
19708
|
+
]
|
|
19685
19709
|
);
|
|
19686
19710
|
const renderTaskBarProps = React.useMemo(
|
|
19687
19711
|
() => ({
|
|
@@ -19772,7 +19796,6 @@
|
|
|
19772
19796
|
distances,
|
|
19773
19797
|
fullRowHeight,
|
|
19774
19798
|
ganttFullHeight,
|
|
19775
|
-
ganttHeight,
|
|
19776
19799
|
getTaskCurrentState,
|
|
19777
19800
|
handleAddTask,
|
|
19778
19801
|
handleDeleteTasks,
|
|
@@ -19802,7 +19825,6 @@
|
|
|
19802
19825
|
distances,
|
|
19803
19826
|
fullRowHeight,
|
|
19804
19827
|
ganttFullHeight,
|
|
19805
|
-
ganttHeight,
|
|
19806
19828
|
getTaskCurrentState,
|
|
19807
19829
|
handleAddTask,
|
|
19808
19830
|
handleDeleteTasks,
|
|
@@ -19843,7 +19865,6 @@
|
|
|
19843
19865
|
fullRowHeight,
|
|
19844
19866
|
fullSvgWidth,
|
|
19845
19867
|
ganttFullHeight,
|
|
19846
|
-
ganttHeight,
|
|
19847
19868
|
ganttSVGRef,
|
|
19848
19869
|
ganttTodayProps: gridProps,
|
|
19849
19870
|
horizontalContainerRef,
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gantt-task-react-v",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
4
4
|
"description": "Interactive Gantt Chart for React with TypeScript.",
|
|
5
|
-
"author": "aguilanbon
|
|
5
|
+
"author": "aguilanbon",
|
|
6
6
|
"homepage": "https://github.com/aguilanbon/gantt-task-react-v",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"repository": "https://github.com/aguilanbon/gantt-task-react-v",
|