@jaeungkim/gantt-chart 1.2.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.
@@ -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 '../utils/link';
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,5 +1,5 @@
1
1
  import { RenderedDependency, TaskTransformed } from '../../shared/task';
2
- import { LinkAnchor } from './link';
2
+ import { LinkAnchor } from '../../shared/types';
3
3
  interface DragOffset {
4
4
  offsetX: number;
5
5
  offsetWidth: number;
@@ -1,6 +1,5 @@
1
1
  import { DependencyType, Task, TaskDependency, TaskTransformed } from '../../shared/task';
2
- export type LinkAnchor = "start" | "end";
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
- onTaskClick?: TaskMouseHandler;
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
- onTaskClick: TaskMouseHandler;
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, onTaskClick, }: UseGanttDetailParams): GanttDetail;
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;