@jaeungkim/gantt-chart 1.1.0 → 1.3.0
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 +5 -4
- package/dist/bars/components/GanttBar.d.ts +1 -1
- package/dist/bars/components/GanttBarsLayer.d.ts +1 -1
- package/dist/bars/hooks/useGanttBarDrag.d.ts +1 -2
- package/dist/dependencies/hooks/useGanttLinkDrag.d.ts +1 -1
- package/dist/dependencies/utils/arrowPath.d.ts +1 -1
- package/dist/dependencies/utils/link.d.ts +1 -2
- package/dist/detail/hooks/useGanttDetail.d.ts +3 -3
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +3 -2
- package/dist/index.d.ts +3 -2
- package/dist/index.js +2053 -2076
- package/dist/interaction/hooks/useGanttSelection.d.ts +1 -1
- package/dist/shared/store.d.ts +1 -2
- package/dist/shared/types.d.ts +3 -1
- package/dist/shared/virtual/window.d.ts +1 -0
- package/dist/timeline/utils/geometry.d.ts +1 -4
- package/dist/timeline/utils/transform.d.ts +5 -0
- package/package.json +2 -2
- package/dist/core/index.d.ts +0 -3
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
[](https://github.com/jaeungkim/gantt-chart/actions/workflows/ci.yml)
|
|
7
7
|
[](LICENSE)
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
A Gantt chart for React that behaves like a controlled input.
|
|
10
10
|
|
|
11
11
|
[Quick start](https://gantt.jaeungkim.com/docs/quick-start) |
|
|
12
12
|
[Playground](https://gantt.jaeungkim.com/playground) |
|
|
@@ -15,7 +15,8 @@ An editable Gantt chart for React.
|
|
|
15
15
|
|
|
16
16
|
## Features
|
|
17
17
|
|
|
18
|
-
- Bar drags
|
|
18
|
+
- One controlled `tasks` prop. Bar drags move a task, resize it from either edge and set its
|
|
19
|
+
progress, and every commit returns the complete next array through `onTasksChange`.
|
|
19
20
|
- Dependency arrows for `FS`, `SS`, `FF` and `SF`, drawn between bars and removed with Delete or Backspace.
|
|
20
21
|
- A task list pane with the `parentId` tree, summary roll-up and row reordering.
|
|
21
22
|
- A docked detail panel that narrows the timeline and edits the task in place.
|
|
@@ -88,8 +89,8 @@ export default function ProjectChart() {
|
|
|
88
89
|
}
|
|
89
90
|
```
|
|
90
91
|
|
|
91
|
-
|
|
92
|
-
next array
|
|
92
|
+
Your app holds the `tasks` array. Every committed gesture ends in one `onTasksChange` call with the
|
|
93
|
+
complete next array, and the chart persists nothing, including the scale.
|
|
93
94
|
|
|
94
95
|
## Documentation
|
|
95
96
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { GanttDependencyChange } from '../../dependencies/hooks/useGanttLinkDrag';
|
|
2
2
|
import { GanttBarOptions } from '../../shared/types';
|
|
3
3
|
import { GanttInteractionConfig, TaskTransformed } from '../../shared/task';
|
|
4
|
-
import { WorkingCalendar } from '../../core';
|
|
4
|
+
import { WorkingCalendar } from '../../core/calendar';
|
|
5
5
|
interface GanttBarProps {
|
|
6
6
|
currentTask: TaskTransformed;
|
|
7
7
|
options: GanttBarOptions;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { VirtualItem } from '../../shared/virtual/window';
|
|
2
2
|
import { GanttDependencyChange } from '../../dependencies/hooks/useGanttLinkDrag';
|
|
3
3
|
import { GanttBarOptions } from '../../shared/types';
|
|
4
|
-
import { WorkingCalendar } from '../../core';
|
|
4
|
+
import { WorkingCalendar } from '../../core/calendar';
|
|
5
5
|
import { GanttInteractionConfig } from '../../shared/task';
|
|
6
6
|
import { GanttFocus } from '../../interaction/utils/a11y';
|
|
7
7
|
import { GanttRow } from '../../rows/utils/rows';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { GanttDragMode } from '../../shared/types';
|
|
2
2
|
import { GanttInteractionConfig, Task, TaskTransformed } from '../../shared/task';
|
|
3
|
-
import { WorkingCalendar } from '../../core';
|
|
3
|
+
import { WorkingCalendar } from '../../core/calendar';
|
|
4
4
|
export type DragMode = GanttDragMode;
|
|
5
5
|
interface GanttBarDragOptions {
|
|
6
6
|
onTasksChange?: (updatedTasks: Task[]) => void;
|
|
@@ -10,7 +10,6 @@ interface GanttBarDragOptions {
|
|
|
10
10
|
/** Gantt bar drag behavior; `autoScroll` (default true) scrolls the timeline at a viewport edge. */
|
|
11
11
|
export declare function useGanttBarDrag(task: TaskTransformed, options?: GanttBarDragOptions, interaction?: GanttInteractionConfig, calendar?: WorkingCalendar): {
|
|
12
12
|
onPointerDown: import('react').PointerEventHandler<HTMLDivElement>;
|
|
13
|
-
dragMode: GanttDragMode | null;
|
|
14
13
|
consumeDragClick: () => boolean;
|
|
15
14
|
};
|
|
16
15
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DependencyType, GanttInteractionConfig, Task, TaskTransformed } from '../../shared/task';
|
|
2
|
-
import { LinkAnchor } from '
|
|
2
|
+
import { LinkAnchor } from '../../shared/types';
|
|
3
3
|
/** The link the user drew, handed to `onDependencyCreate` before anything is committed */
|
|
4
4
|
export interface GanttDependencyChange {
|
|
5
5
|
/** Task the drag started on */
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { DependencyType, Task, TaskDependency, TaskTransformed } from '../../shared/task';
|
|
2
|
-
|
|
3
|
-
export type LinkRejection = "self" | "duplicate" | "cycle";
|
|
2
|
+
import { LinkAnchor, LinkRejection } from '../../shared/types';
|
|
4
3
|
type DependencyNode = Pick<Task, "id"> & {
|
|
5
4
|
dependencies?: TaskDependency[];
|
|
6
5
|
};
|
|
@@ -20,16 +20,16 @@ interface UseGanttDetailParams {
|
|
|
20
20
|
tasks: TaskTransformed[];
|
|
21
21
|
detailTaskId?: string | null;
|
|
22
22
|
onDetailChange?: (task: TaskTransformed | null) => void;
|
|
23
|
-
|
|
23
|
+
onTaskActivate?: TaskMouseHandler;
|
|
24
24
|
}
|
|
25
25
|
interface GanttDetail {
|
|
26
26
|
task: TaskTransformed | null;
|
|
27
27
|
open: (taskId: string) => void;
|
|
28
28
|
close: () => void;
|
|
29
|
-
|
|
29
|
+
onTaskActivate: TaskMouseHandler;
|
|
30
30
|
}
|
|
31
31
|
/** Controlled by `detailTaskId`, uncontrolled without it; `onDetailChange` fires in both modes */
|
|
32
|
-
export declare function useGanttDetail({ enabled, tasks, detailTaskId, onDetailChange,
|
|
32
|
+
export declare function useGanttDetail({ enabled, tasks, detailTaskId, onDetailChange, onTaskActivate, }: UseGanttDetailParams): GanttDetail;
|
|
33
33
|
interface GanttDetailSlide {
|
|
34
34
|
/** The task to keep rendered - the open one, or the last one while the panel slides shut */
|
|
35
35
|
task: TaskTransformed | null;
|