@jaeungkim/gantt-chart 0.3.1 → 1.0.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/LICENSE +21 -0
- package/README.md +222 -124
- package/dist/Gantt.d.ts +5 -0
- package/dist/bars/components/GanttBar.d.ts +20 -0
- package/dist/bars/components/GanttBarsLayer.d.ts +24 -0
- package/dist/bars/components/GanttDragGuides.d.ts +1 -0
- package/dist/bars/hooks/useGanttBarDrag.d.ts +16 -0
- package/dist/bars/hooks/useGanttDrawCreate.d.ts +25 -0
- package/dist/bars/hooks/useGanttProgressDrag.d.ts +11 -0
- package/dist/core/calendar.d.ts +27 -0
- package/dist/core/dates.d.ts +16 -0
- package/dist/core/index.d.ts +3 -0
- package/dist/core/reorder.d.ts +55 -0
- package/dist/core/tree.d.ts +34 -0
- package/dist/core/types.d.ts +43 -0
- package/dist/dependencies/components/GanttDependencyArrows.d.ts +13 -0
- package/dist/dependencies/hooks/useGanttLinkDrag.d.ts +20 -0
- package/dist/dependencies/utils/arrowPath.d.ts +20 -0
- package/dist/dependencies/utils/link.d.ts +17 -0
- package/dist/detail/components/GanttDetailPanel.d.ts +21 -0
- package/dist/detail/hooks/useGanttDetail.d.ts +42 -0
- package/dist/detail/utils/edit.d.ts +21 -0
- package/dist/gantt-chart.css +1 -1
- package/dist/index.cjs +1 -0
- package/dist/index.d.cts +11 -0
- package/dist/index.d.ts +11 -51
- package/dist/index.js +4749 -0
- package/dist/interaction/hooks/useGanttInteraction.d.ts +2 -0
- package/dist/interaction/hooks/useGanttKeyboardNav.d.ts +33 -0
- package/dist/interaction/hooks/useGanttSelection.d.ts +12 -0
- package/dist/interaction/utils/a11y.d.ts +84 -0
- package/dist/props.d.ts +121 -0
- package/dist/rows/components/GanttRowsLayer.d.ts +13 -0
- package/dist/rows/hooks/useGanttCollapse.d.ts +18 -0
- package/dist/rows/hooks/useGanttRowModel.d.ts +19 -0
- package/dist/rows/utils/rows.d.ts +21 -0
- package/dist/shared/constants.d.ts +24 -0
- package/dist/shared/context.d.ts +4 -0
- package/dist/shared/hooks/useLatestRef.d.ts +2 -0
- package/dist/shared/hooks/useResolvedTheme.d.ts +8 -0
- package/dist/shared/store.d.ts +81 -0
- package/dist/shared/task.d.ts +55 -0
- package/dist/shared/types.d.ts +115 -0
- package/dist/shared/utils/holidays.d.ts +12 -0
- package/dist/shared/utils/i18n.d.ts +5 -0
- package/dist/shared/utils/pointerGesture.d.ts +11 -0
- package/dist/shared/virtual/axis.d.ts +13 -0
- package/dist/shared/virtual/useVirtualWindow.d.ts +16 -0
- package/dist/shared/virtual/window.d.ts +30 -0
- package/dist/task-list/components/GanttGridSplitter.d.ts +6 -0
- package/dist/task-list/components/GanttTaskAddRow.d.ts +7 -0
- package/dist/task-list/components/GanttTaskGrid.d.ts +24 -0
- package/dist/task-list/hooks/useGanttRowDrag.d.ts +17 -0
- package/dist/task-list/hooks/useGanttTaskListPane.d.ts +11 -0
- package/dist/task-list/hooks/useGanttTaskMove.d.ts +16 -0
- package/dist/timeline/components/GanttChartHeader.d.ts +10 -0
- package/dist/timeline/components/GanttHolidayLabels.d.ts +6 -0
- package/dist/timeline/components/GanttNonWorkingLayer.d.ts +6 -0
- package/dist/timeline/components/GanttTodayLine.d.ts +6 -0
- package/dist/timeline/hooks/useGanttScrollApi.d.ts +62 -0
- package/dist/timeline/hooks/useGanttViewport.d.ts +47 -0
- package/dist/timeline/hooks/useGanttVirtualization.d.ts +28 -0
- package/dist/timeline/utils/geometry.d.ts +52 -0
- package/dist/timeline/utils/header.d.ts +8 -0
- package/dist/timeline/utils/transform.d.ts +4 -0
- package/dist/timeline/utils/viewport.d.ts +31 -0
- package/dist/useGanttSelectors.d.ts +11 -0
- package/package.json +53 -38
- package/dist/index.cjs.js +0 -4
- package/dist/index.es.js +0 -2394
- package/dist/readmeImg.png +0 -0
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { GanttInteractionConfig } from '../../shared/task';
|
|
2
|
+
export declare function useGanttInteraction({ readOnly, allowMove, allowResize, allowProgressChange, allowLinkCreate, allowLinkDelete, allowTaskCreate, allowReorder, minDate, maxDate, }: GanttInteractionConfig): GanttInteractionConfig;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { ScrollAlign } from '../../shared/virtual/useVirtualWindow';
|
|
2
|
+
import { RefObject } from 'react';
|
|
3
|
+
import { GanttScrollApi } from '../../timeline/hooks/useGanttScrollApi';
|
|
4
|
+
import { GanttTaskMoveApi } from '../../task-list/hooks/useGanttTaskMove';
|
|
5
|
+
import { GanttLocaleOptions, GanttScaleKey } from '../../shared/types';
|
|
6
|
+
import { GanttInteractionConfig, Task } from '../../shared/task';
|
|
7
|
+
import { GanttFocus } from '../utils/a11y';
|
|
8
|
+
import { GanttRow } from '../../rows/utils/rows';
|
|
9
|
+
interface UseGanttKeyboardNavParams {
|
|
10
|
+
rows: GanttRow[];
|
|
11
|
+
rawTasks: Task[];
|
|
12
|
+
gridColumnCount: number;
|
|
13
|
+
hierarchy: boolean;
|
|
14
|
+
collapsedIds: ReadonlySet<string>;
|
|
15
|
+
selectedScale: GanttScaleKey;
|
|
16
|
+
localeOptions: GanttLocaleOptions | undefined;
|
|
17
|
+
interaction: GanttInteractionConfig;
|
|
18
|
+
onActivate?: (taskId: string) => void;
|
|
19
|
+
onToggleCollapse: (rowId: string) => void;
|
|
20
|
+
onTasksChange?: (updatedTasks: Task[]) => void;
|
|
21
|
+
move: GanttTaskMoveApi;
|
|
22
|
+
scrollToRow: (index: number, align?: ScrollAlign) => void;
|
|
23
|
+
scrollApi: GanttScrollApi;
|
|
24
|
+
bodyRef: RefObject<HTMLDivElement | null>;
|
|
25
|
+
}
|
|
26
|
+
interface GanttKeyboardNav {
|
|
27
|
+
focus: GanttFocus;
|
|
28
|
+
announcement: string;
|
|
29
|
+
onKeyDown: (event: React.KeyboardEvent<HTMLDivElement>) => void;
|
|
30
|
+
onFocusCapture: (event: React.FocusEvent<HTMLDivElement>) => void;
|
|
31
|
+
}
|
|
32
|
+
export declare function useGanttKeyboardNav({ rows, rawTasks, gridColumnCount, hierarchy, collapsedIds, selectedScale, localeOptions, interaction, onActivate, onToggleCollapse, onTasksChange, move, scrollToRow, scrollApi, bodyRef, }: UseGanttKeyboardNavParams): GanttKeyboardNav;
|
|
33
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { TaskTransformed } from '../../shared/task';
|
|
2
|
+
interface UseGanttSelectionParams {
|
|
3
|
+
selectable?: boolean;
|
|
4
|
+
onTaskSelect?: (task: TaskTransformed | null) => void;
|
|
5
|
+
onTaskClick?: (task: TaskTransformed, event: React.MouseEvent) => void;
|
|
6
|
+
}
|
|
7
|
+
interface GanttSelection {
|
|
8
|
+
select: (task: TaskTransformed | null) => void;
|
|
9
|
+
onTaskClick: (task: TaskTransformed, event: React.MouseEvent) => void;
|
|
10
|
+
}
|
|
11
|
+
export declare function useGanttSelection({ selectable, onTaskSelect, onTaskClick, }: UseGanttSelectionParams): GanttSelection;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { Dayjs } from 'dayjs';
|
|
2
|
+
import { GanttDragMode, GanttScaleKey } from '../../shared/types';
|
|
3
|
+
import { GanttInteractionConfig, Task, TaskTransformed } from '../../shared/task';
|
|
4
|
+
import { GanttRow } from '../../rows/utils/rows';
|
|
5
|
+
export interface GanttFocus {
|
|
6
|
+
row: number;
|
|
7
|
+
col: number;
|
|
8
|
+
}
|
|
9
|
+
export interface GanttKeyboardRow {
|
|
10
|
+
cells: number;
|
|
11
|
+
firstBarCell: number;
|
|
12
|
+
expandable: boolean;
|
|
13
|
+
expanded: boolean;
|
|
14
|
+
}
|
|
15
|
+
type GanttKeyAction = {
|
|
16
|
+
kind: "focus";
|
|
17
|
+
focus: GanttFocus;
|
|
18
|
+
} | {
|
|
19
|
+
kind: "toggle";
|
|
20
|
+
row: number;
|
|
21
|
+
col: number;
|
|
22
|
+
} | {
|
|
23
|
+
kind: "activate";
|
|
24
|
+
row: number;
|
|
25
|
+
col: number;
|
|
26
|
+
} | {
|
|
27
|
+
kind: "delete";
|
|
28
|
+
row: number;
|
|
29
|
+
col: number;
|
|
30
|
+
} | {
|
|
31
|
+
kind: "nudge";
|
|
32
|
+
row: number;
|
|
33
|
+
col: number;
|
|
34
|
+
mode: GanttDragMode;
|
|
35
|
+
steps: number;
|
|
36
|
+
} | {
|
|
37
|
+
kind: "progress";
|
|
38
|
+
row: number;
|
|
39
|
+
col: number;
|
|
40
|
+
delta: number;
|
|
41
|
+
} | {
|
|
42
|
+
kind: "reorder";
|
|
43
|
+
row: number;
|
|
44
|
+
col: number;
|
|
45
|
+
delta: -1 | 1;
|
|
46
|
+
} | {
|
|
47
|
+
kind: "reparent";
|
|
48
|
+
row: number;
|
|
49
|
+
col: number;
|
|
50
|
+
direction: -1 | 1;
|
|
51
|
+
} | {
|
|
52
|
+
kind: "zoom";
|
|
53
|
+
direction: number;
|
|
54
|
+
};
|
|
55
|
+
interface GanttKeyEvent {
|
|
56
|
+
key: string;
|
|
57
|
+
altKey?: boolean;
|
|
58
|
+
shiftKey?: boolean;
|
|
59
|
+
ctrlKey?: boolean;
|
|
60
|
+
metaKey?: boolean;
|
|
61
|
+
}
|
|
62
|
+
export declare function resolveKeyboardAction(event: GanttKeyEvent, focus: GanttFocus, rows: GanttKeyboardRow[]): GanttKeyAction | null;
|
|
63
|
+
export declare function taskAtFocus(row: GanttRow | undefined, col: number, firstBarCell: number): TaskTransformed | undefined;
|
|
64
|
+
export declare function formatTaskAriaLabel(task: Pick<TaskTransformed, "name" | "startDate" | "endDate" | "isSummary">, format: (date: Dayjs) => string, progress?: number | null): string;
|
|
65
|
+
export declare function formatMovedAnnouncement(name: string, position: number, total: number, parentName: string | null): string;
|
|
66
|
+
interface GanttRowAria {
|
|
67
|
+
role: "row";
|
|
68
|
+
"aria-level": number;
|
|
69
|
+
"aria-posinset": number;
|
|
70
|
+
"aria-setsize": number;
|
|
71
|
+
"aria-rowindex": number;
|
|
72
|
+
"aria-expanded"?: boolean;
|
|
73
|
+
"aria-owns"?: string;
|
|
74
|
+
}
|
|
75
|
+
export declare function rowAriaProps(row: GanttRow, rowIndex: number, options: {
|
|
76
|
+
headerOffset: number;
|
|
77
|
+
expandable: boolean;
|
|
78
|
+
expanded: boolean;
|
|
79
|
+
ownedIds?: string[];
|
|
80
|
+
}): GanttRowAria;
|
|
81
|
+
export declare function nudgeTaskDates(rawTasks: Task[], target: TaskTransformed, mode: GanttDragMode, steps: number, scaleKey: GanttScaleKey, interaction?: GanttInteractionConfig): Task[] | null;
|
|
82
|
+
export declare function stepTaskProgress(rawTasks: Task[], target: TaskTransformed, delta: number, interaction?: GanttInteractionConfig): Task[] | null;
|
|
83
|
+
export declare function deleteTask(rawTasks: Task[], target: TaskTransformed, interaction?: GanttInteractionConfig): Task[] | null;
|
|
84
|
+
export {};
|
package/dist/props.d.ts
ADDED
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { GanttTaskMoveChange } from './core/reorder';
|
|
2
|
+
import { GanttTaskDraft } from './bars/hooks/useGanttDrawCreate';
|
|
3
|
+
import { GanttDependencyChange } from './dependencies/hooks/useGanttLinkDrag';
|
|
4
|
+
import { GanttDateRange, GanttDetailRenderer, GanttFormatOverrides, GanttScaleKey, GanttTheme, Holiday } from './shared/types';
|
|
5
|
+
import { Task, TaskTransformed } from './shared/task';
|
|
6
|
+
export interface GanttProps {
|
|
7
|
+
/** Task data array - applied only when the contents change (a new array with equal contents is ignored); `[]` clears the chart. */
|
|
8
|
+
tasks?: Task[];
|
|
9
|
+
/** Callback invoked when tasks change */
|
|
10
|
+
onTasksChange?: (updatedTasks: Task[]) => void;
|
|
11
|
+
/** Chart height (px or a CSS value) */
|
|
12
|
+
height?: number | string;
|
|
13
|
+
/** Chart width (px or a CSS value) */
|
|
14
|
+
width?: number | string;
|
|
15
|
+
/** Theme setting - 'light', 'dark', or 'system'. Omitted, the host page's `color-scheme` decides. */
|
|
16
|
+
theme?: GanttTheme;
|
|
17
|
+
/** Scale the chart starts at (default `"month"`) - a mount-time seed; use `setScale` on the ref to change it later. */
|
|
18
|
+
defaultScale?: GanttScaleKey;
|
|
19
|
+
/** Called whenever the scale changes, from any source (ref, Ctrl/Cmd + wheel, `zoomToFit()`, keyboard) - not on mount. */
|
|
20
|
+
onScaleChange?: (scale: GanttScaleKey) => void;
|
|
21
|
+
/** Additional CSS class name */
|
|
22
|
+
className?: string;
|
|
23
|
+
/** Whether to shade non-working days (default true) - also hides holiday names */
|
|
24
|
+
showNonWorkingDays?: boolean;
|
|
25
|
+
/** Which weekdays are worked, 0 = Sunday (default Mon-Fri). Pass a stable array. */
|
|
26
|
+
workingWeekdays?: number[];
|
|
27
|
+
/** Days off beyond the weekend. A bare `YYYY-MM-DD` string is one with no label. Pass a stable array. */
|
|
28
|
+
holidays?: (string | Holiday)[];
|
|
29
|
+
/** Scroll here once after the first render - `"today"` or a date string; later data updates leave the scroll alone. */
|
|
30
|
+
initialScrollTo?: "today" | string;
|
|
31
|
+
/** Blocks moving, resizing and progress dragging on every task */
|
|
32
|
+
readOnly?: boolean;
|
|
33
|
+
/** Allows/blocks moving bars (default true) - beats `readOnly` */
|
|
34
|
+
allowMove?: boolean;
|
|
35
|
+
/** Allows/blocks resizing bars (default true) - beats `readOnly` */
|
|
36
|
+
allowResize?: boolean;
|
|
37
|
+
/** Allows/blocks dragging the progress handle (default true) - beats `readOnly` */
|
|
38
|
+
allowProgressChange?: boolean;
|
|
39
|
+
/** Earliest date any bar may be dragged to (ISO string) - a task's own `minDate` wins */
|
|
40
|
+
minDate?: string;
|
|
41
|
+
/** Latest date any bar may be dragged to (ISO string) - a task's own `maxDate` wins */
|
|
42
|
+
maxDate?: string;
|
|
43
|
+
/** Pins the timeline to start here (ISO string) instead of fitting to the tasks */
|
|
44
|
+
visibleStart?: string;
|
|
45
|
+
/** Pins the timeline to end here (ISO string) instead of fitting to the tasks */
|
|
46
|
+
visibleEnd?: string;
|
|
47
|
+
/** BCP 47 locale tag for every date label, e.g. `"ko-KR"`, via `Intl.DateTimeFormat` - omitted or unusable falls back to the built-in English labels. */
|
|
48
|
+
locale?: string;
|
|
49
|
+
/** Per-scale label overrides (`tick`, `header`, `tooltip`) - they win over `locale`, and the `Dayjs` handed in is in UTC mode. */
|
|
50
|
+
formats?: GanttFormatOverrides;
|
|
51
|
+
/** First day of the week, 0 = Sunday .. 6 = Saturday - set it to group the week scale's top header by week instead of by month (off when omitted). */
|
|
52
|
+
firstDayOfWeek?: number;
|
|
53
|
+
/** Whether to show the task list pane on the left (default false) - names only, per-task detail belongs in `renderDetail`. */
|
|
54
|
+
showTaskList?: boolean;
|
|
55
|
+
/** Whether the task list prints each row's `sequence` as a leading number column (default false). */
|
|
56
|
+
showRowNumbers?: boolean;
|
|
57
|
+
/** Whether to use the parentId hierarchy (default false) - parents become summary rows (dates and progress rolled up, dragging moves the subtree); row order still comes from `sequence`. */
|
|
58
|
+
hierarchy?: boolean;
|
|
59
|
+
/** Ids of collapsed parents (controlled - given, this value is what the chart shows) */
|
|
60
|
+
collapsedIds?: string[];
|
|
61
|
+
/** Initial collapsed list (uncontrolled seed; later changes are ignored) */
|
|
62
|
+
defaultCollapsedIds?: string[];
|
|
63
|
+
/** Called whenever the collapsed state changes - in controlled and uncontrolled mode alike */
|
|
64
|
+
onCollapsedChange?: (collapsedIds: string[]) => void;
|
|
65
|
+
/** Allows/blocks drawing dependencies between bars (default true) - beats `readOnly` */
|
|
66
|
+
allowLinkCreate?: boolean;
|
|
67
|
+
/** Allows/blocks selecting and deleting dependency arrows (default true) - beats `readOnly` */
|
|
68
|
+
allowLinkDelete?: boolean;
|
|
69
|
+
/** Allows/blocks drawing a new task below the last row (default true) - beats `readOnly` */
|
|
70
|
+
allowTaskCreate?: boolean;
|
|
71
|
+
/**
|
|
72
|
+
* Whether task-list rows can be dragged to a new position or a new parent (default false) - a
|
|
73
|
+
* task's own `allowReorder` wins, and a move rewrites `sequence` (re-parenting also `parentId`).
|
|
74
|
+
*/
|
|
75
|
+
allowReorder?: boolean;
|
|
76
|
+
/** Called with the link the user drew, before it is applied - return false to reject it; self-links, duplicates and cycles never reach it. */
|
|
77
|
+
onDependencyCreate?: (change: GanttDependencyChange) => boolean | void;
|
|
78
|
+
/** Called with the arrow the user asked to remove, before it is applied - return false to keep it */
|
|
79
|
+
onDependencyDelete?: (change: GanttDependencyChange) => boolean | void;
|
|
80
|
+
/** Called with the range drawn below the last row, snapped to the current scale - the chart adds nothing itself, the host passes a new `tasks` array back. */
|
|
81
|
+
onTaskCreate?: (draft: GanttTaskDraft) => void;
|
|
82
|
+
/**
|
|
83
|
+
* Called with the move the user made, before it is applied - return false to reject it (sync only,
|
|
84
|
+
* revert by passing the previous `tasks` back). Carries `toParentId`/`toIndex` and `afterId`/`beforeId`;
|
|
85
|
+
* moves the chart already refuses never reach it.
|
|
86
|
+
*/
|
|
87
|
+
onTaskMove?: (change: GanttTaskMoveChange) => boolean | void;
|
|
88
|
+
/** Fires when a bar or a task-list row is clicked (not after a drag) */
|
|
89
|
+
onTaskClick?: (task: TaskTransformed, event: React.MouseEvent) => void;
|
|
90
|
+
/** Fires on a double click. The two clicks that make it up still fire `onTaskClick` */
|
|
91
|
+
onTaskDoubleClick?: (task: TaskTransformed, event: React.MouseEvent) => void;
|
|
92
|
+
/** Fires when the selection changes, null when the empty timeline is clicked - passing it turns selection on. */
|
|
93
|
+
onTaskSelect?: (task: TaskTransformed | null) => void;
|
|
94
|
+
/** Whether clicking selects a row - omitted, selection is on exactly when `onTaskSelect` is given. */
|
|
95
|
+
selectable?: boolean;
|
|
96
|
+
/** Panel body shown beside the chart for one task - passing it turns the panel on, and the timeline narrows rather than being covered. The props include `update` for committing edits. */
|
|
97
|
+
renderDetail?: GanttDetailRenderer;
|
|
98
|
+
/**
|
|
99
|
+
* Whether the detail panel is available (omitted, it exists exactly when `renderDetail` is given;
|
|
100
|
+
* `true` alone shows the built-in field list, editable in place where the task's interaction
|
|
101
|
+
* flags allow). A click on a bar or row opens it, `Enter` on a focused row too. Turning it on
|
|
102
|
+
* also turns row selection on unless `selectable` says otherwise.
|
|
103
|
+
*/
|
|
104
|
+
showDetail?: boolean;
|
|
105
|
+
/** Id of the task whose detail is open, `null` for closed (controlled - given, this value is what the chart shows) */
|
|
106
|
+
detailTaskId?: string | null;
|
|
107
|
+
/** Called on every open and close - in controlled and uncontrolled mode alike */
|
|
108
|
+
onDetailChange?: (task: TaskTransformed | null) => void;
|
|
109
|
+
/** Hover and drag tooltips (default true) - `false` suppresses both */
|
|
110
|
+
showTooltip?: boolean;
|
|
111
|
+
/** Whether Ctrl/Cmd + wheel steps through the scale ladder (default false) - the date under the cursor stays put. */
|
|
112
|
+
zoomOnWheel?: boolean;
|
|
113
|
+
/** Whether scrolling or dragging past an end grows the rendered range (default false) - it extends by about a viewport at a time. */
|
|
114
|
+
infiniteScroll?: boolean;
|
|
115
|
+
/** Called whenever the rendered timeline range changes - the hook for lazy-loading tasks */
|
|
116
|
+
onRangeChange?: (range: GanttDateRange) => void;
|
|
117
|
+
/** Whether a bar drag reaching a viewport edge scrolls the timeline (default true) */
|
|
118
|
+
autoScrollOnDrag?: boolean;
|
|
119
|
+
/** Snap a drag result forward off non-working days (default false) - uses the same days that shade the timeline; bars still span them visually. */
|
|
120
|
+
workingCalendar?: boolean;
|
|
121
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { VirtualItem } from '../../shared/virtual/window';
|
|
2
|
+
import { GanttRow } from '../utils/rows';
|
|
3
|
+
interface GanttRowsLayerProps {
|
|
4
|
+
rows: GanttRow[];
|
|
5
|
+
virtualItems: VirtualItem[];
|
|
6
|
+
/** With the task list pane on screen the stripes carry no ARIA; without it they are the rows */
|
|
7
|
+
ownedByTaskList: boolean;
|
|
8
|
+
hierarchy: boolean;
|
|
9
|
+
collapsedIds: ReadonlySet<string>;
|
|
10
|
+
}
|
|
11
|
+
/** The row stripes behind the bars */
|
|
12
|
+
export default function GanttRowsLayer({ rows, virtualItems, ownedByTaskList, hierarchy, collapsedIds, }: GanttRowsLayerProps): import("react").JSX.Element;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
interface UseGanttCollapseParams {
|
|
2
|
+
/** Controlled list - given, this is what the chart shows */
|
|
3
|
+
collapsedIds?: string[];
|
|
4
|
+
/** Uncontrolled seed; later changes are ignored */
|
|
5
|
+
defaultCollapsedIds?: string[];
|
|
6
|
+
onCollapsedChange?: (collapsedIds: string[]) => void;
|
|
7
|
+
}
|
|
8
|
+
interface GanttCollapseState {
|
|
9
|
+
/** Ids of every collapsed parent and group header */
|
|
10
|
+
collapsedIds: ReadonlySet<string>;
|
|
11
|
+
/** Collapses an expanded row and expands a collapsed one */
|
|
12
|
+
toggle: (rowId: string) => void;
|
|
13
|
+
/** Expands a row, doing nothing when it is already open */
|
|
14
|
+
expand: (rowId: string) => void;
|
|
15
|
+
}
|
|
16
|
+
/** Which rows are collapsed - `collapsedIds` hands the decision to the host, otherwise the chart keeps the list */
|
|
17
|
+
export declare function useGanttCollapse({ collapsedIds, defaultCollapsedIds, onCollapsedChange, }: UseGanttCollapseParams): GanttCollapseState;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Task, TaskTransformed } from '../../shared/task';
|
|
2
|
+
import { GanttRow } from '../utils/rows';
|
|
3
|
+
interface UseGanttRowModelParams {
|
|
4
|
+
/** Raw data - the parentId tree is built from it */
|
|
5
|
+
rawTasks: Task[];
|
|
6
|
+
/** The positioned rows to lay out */
|
|
7
|
+
tasks: TaskTransformed[];
|
|
8
|
+
hierarchy: boolean;
|
|
9
|
+
collapsedIds: ReadonlySet<string>;
|
|
10
|
+
}
|
|
11
|
+
interface GanttRowModel {
|
|
12
|
+
/** What both panes render, in screen order */
|
|
13
|
+
rows: GanttRow[];
|
|
14
|
+
/** Every task on a row, flattened - what the dependency arrows are drawn between */
|
|
15
|
+
tasks: TaskTransformed[];
|
|
16
|
+
}
|
|
17
|
+
/** The rows both panes render: hierarchy, then collapsing, then lane packing */
|
|
18
|
+
export declare function useGanttRowModel({ rawTasks, tasks, hierarchy, collapsedIds, }: UseGanttRowModelParams): GanttRowModel;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { TaskTransformed } from '../../shared/task';
|
|
2
|
+
/** One rendered row: one task, or several sharing a `lane` */
|
|
3
|
+
export interface GanttRow {
|
|
4
|
+
/** Stable key - the ids on the row, joined with "+" */
|
|
5
|
+
id: string;
|
|
6
|
+
tasks: TaskTransformed[];
|
|
7
|
+
/** Indentation level, 0-based */
|
|
8
|
+
depth: number;
|
|
9
|
+
/** `aria-level`, 1-based */
|
|
10
|
+
level: number;
|
|
11
|
+
/** `aria-posinset` among the rows that share a parent */
|
|
12
|
+
posinset: number;
|
|
13
|
+
/** `aria-setsize` for that same set */
|
|
14
|
+
setsize: number;
|
|
15
|
+
}
|
|
16
|
+
/** Whether the row carries an expander: hierarchy on, and the task has children */
|
|
17
|
+
export declare function isRowExpandable(row: GanttRow, hierarchy: boolean): boolean;
|
|
18
|
+
/** Packs lane-sharing tasks onto as few rows as possible (greedy interval partitioning by start) */
|
|
19
|
+
export declare function packLanes(tasks: TaskTransformed[]): TaskTransformed[][];
|
|
20
|
+
/** The row model the chart renders; every task's `order` is rewritten to its row number */
|
|
21
|
+
export declare function buildGanttRows(tasks: TaskTransformed[]): GanttRow[];
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { GanttScaleConfig, GanttScaleKey } from './types';
|
|
2
|
+
export declare const NODE_HEIGHT = 38;
|
|
3
|
+
export declare const BAR_HEIGHT = 28;
|
|
4
|
+
export declare const SUMMARY_BAR_HEIGHT = 18;
|
|
5
|
+
export declare const HEADER_HEIGHT = 73;
|
|
6
|
+
export declare const MIN_GRID_WIDTH = 120;
|
|
7
|
+
export declare const MAX_GRID_WIDTH = 800;
|
|
8
|
+
export declare const TREE_INDENT = 16;
|
|
9
|
+
export declare const DEFAULT_GRID_WIDTH = 220;
|
|
10
|
+
export declare const TIMELINE_SHIFT_BUFFER = 5;
|
|
11
|
+
export declare const MIN_LABEL_INSIDE_WIDTH = 56;
|
|
12
|
+
export declare const EDGE_THRESHOLD = 8;
|
|
13
|
+
export declare const PROGRESS_HANDLE_INSET: number;
|
|
14
|
+
export declare const TOUCH_EDGE_THRESHOLD = 44;
|
|
15
|
+
export declare const MIN_RESIZABLE_WIDTH: number;
|
|
16
|
+
export declare const MIN_TOUCH_RESIZABLE_WIDTH: number;
|
|
17
|
+
export declare const MIN_BAR_WIDTH: number;
|
|
18
|
+
export declare const LINK_ANCHOR_ZONE = 24;
|
|
19
|
+
export declare const LINK_DRAG_SLOP = 4;
|
|
20
|
+
export declare const HOVER_CARD_DELAY_MS = 450;
|
|
21
|
+
export declare const DATE_FORMATS: Record<GanttScaleKey, string>;
|
|
22
|
+
export declare const RANGE_FORMATS: Record<GanttScaleKey, string>;
|
|
23
|
+
export declare const MIN_HOLIDAY_LABEL_PX = 44;
|
|
24
|
+
export declare const GANTT_SCALE_CONFIG: Record<GanttScaleKey, GanttScaleConfig>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { GanttState, GanttStoreApi } from './store';
|
|
2
|
+
export declare const GanttStoreContext: import('react').Context<import('zustand').StoreApi<GanttState> | null>;
|
|
3
|
+
export declare function useGanttStoreApi(): GanttStoreApi;
|
|
4
|
+
export declare function useGanttStore<T>(selector: (state: GanttState) => T): T;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { GanttTheme } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Resolves the `theme` prop to the value written to `data-theme`.
|
|
4
|
+
*
|
|
5
|
+
* 'light' / 'dark' are taken as given, 'system' asks the OS, and no prop at all follows the
|
|
6
|
+
* host page's `color-scheme`.
|
|
7
|
+
*/
|
|
8
|
+
export declare function useResolvedTheme(theme?: GanttTheme): 'light' | 'dark';
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { GanttBottomRowCell, GanttDragMode, GanttDragOffset, GanttLocaleOptions, GanttScaleKey } from './types';
|
|
2
|
+
import { Task, TaskTransformed } from './task';
|
|
3
|
+
import { GanttDropMode, GanttMoveRejection, GanttTaskMove } from '../core/reorder';
|
|
4
|
+
import { LinkAnchor, LinkRejection } from '../dependencies/utils/link';
|
|
5
|
+
interface GanttLinkDraft {
|
|
6
|
+
/** Task the drag started on - it becomes the predecessor */
|
|
7
|
+
fromTaskId: string;
|
|
8
|
+
fromAnchor: LinkAnchor;
|
|
9
|
+
/** Current pointer position */
|
|
10
|
+
toX: number;
|
|
11
|
+
toY: number;
|
|
12
|
+
/** Task under the pointer, null over empty space */
|
|
13
|
+
hoverTaskId: string | null;
|
|
14
|
+
hoverAnchor: LinkAnchor | null;
|
|
15
|
+
/** Why the hovered task cannot be linked - null when the drop would be accepted */
|
|
16
|
+
rejection: LinkRejection | null;
|
|
17
|
+
}
|
|
18
|
+
export interface GanttReorderDraft {
|
|
19
|
+
/** Row being dragged */
|
|
20
|
+
taskId: string;
|
|
21
|
+
/** Row the indicator attaches to - an index into the rendered rows */
|
|
22
|
+
rowIndex: number;
|
|
23
|
+
/** Where the drop lands relative to that row */
|
|
24
|
+
mode: GanttDropMode;
|
|
25
|
+
/** Indent the indicator is drawn at, in tree levels */
|
|
26
|
+
depth: number;
|
|
27
|
+
/** The move this drop would commit - null when there is nothing valid under the pointer */
|
|
28
|
+
move: GanttTaskMove | null;
|
|
29
|
+
/** Why the drop is refused - null when it would be accepted */
|
|
30
|
+
rejection: GanttMoveRejection | null;
|
|
31
|
+
}
|
|
32
|
+
/** Identifies one dependency: the successor that owns it and the predecessor it points at */
|
|
33
|
+
interface GanttDependencyRef {
|
|
34
|
+
sourceId: string;
|
|
35
|
+
targetId: string;
|
|
36
|
+
}
|
|
37
|
+
export interface GanttState {
|
|
38
|
+
rawTasks: Task[];
|
|
39
|
+
rowTasks: TaskTransformed[];
|
|
40
|
+
bottomRowCells: GanttBottomRowCell[];
|
|
41
|
+
selectedScale: GanttScaleKey;
|
|
42
|
+
currentTask: TaskTransformed | null;
|
|
43
|
+
/** Which gesture the running bar drag is - null when none. The readout dims the anchored end. */
|
|
44
|
+
dragMode: GanttDragMode | null;
|
|
45
|
+
dragOffsets: Record<string, GanttDragOffset>;
|
|
46
|
+
transformedTasks: TaskTransformed[];
|
|
47
|
+
/** Locale and label formats - undefined means the built-in English labels */
|
|
48
|
+
localeOptions: GanttLocaleOptions | undefined;
|
|
49
|
+
/** Dependency drag in progress - null when none is running */
|
|
50
|
+
linkDraft: GanttLinkDraft | null;
|
|
51
|
+
/** Row drag in progress - null when none is running */
|
|
52
|
+
reorderDraft: GanttReorderDraft | null;
|
|
53
|
+
/** Arrow the user clicked, so Delete knows what to remove */
|
|
54
|
+
selectedDependency: GanttDependencyRef | null;
|
|
55
|
+
/** The selected row, or null - drives the highlight on the bar and on its grid row */
|
|
56
|
+
selectedTaskId: string | null;
|
|
57
|
+
hoveredTaskId: string | null;
|
|
58
|
+
setSelectedScale: (scale: GanttScaleKey) => void;
|
|
59
|
+
setLocaleOptions: (options: GanttLocaleOptions | undefined) => void;
|
|
60
|
+
setCurrentTask: (task: TaskTransformed | null) => void;
|
|
61
|
+
setDragMode: (mode: GanttDragMode | null) => void;
|
|
62
|
+
setSelectedTaskId: (taskId: string | null) => void;
|
|
63
|
+
setHoveredTaskId: (taskId: string | null) => void;
|
|
64
|
+
setRawTasks: (rawTasks: Task[]) => void;
|
|
65
|
+
/** Applies the `tasks` prop - an echo of what the chart just wrote is ignored */
|
|
66
|
+
syncTasksFromProps: (rawTasks: Task[]) => void;
|
|
67
|
+
setBottomRowCells: (cells: GanttBottomRowCell[]) => void;
|
|
68
|
+
setTransformedTasks: (tasks: TaskTransformed[]) => void;
|
|
69
|
+
setRowTasks: (tasks: TaskTransformed[]) => void;
|
|
70
|
+
/** Update several tasks' offsets at once - dragging a summary bar moves its whole subtree */
|
|
71
|
+
setDragOffsets: (offsets: Record<string, GanttDragOffset>) => void;
|
|
72
|
+
clearDragOffsets: (ids: string[]) => void;
|
|
73
|
+
clearAllDragOffsets: () => void;
|
|
74
|
+
setLinkDraft: (draft: GanttLinkDraft | null) => void;
|
|
75
|
+
setReorderDraft: (draft: GanttReorderDraft | null) => void;
|
|
76
|
+
setSelectedDependency: (dependency: GanttDependencyRef | null) => void;
|
|
77
|
+
getTotalWidth: () => number;
|
|
78
|
+
}
|
|
79
|
+
export type GanttStoreApi = ReturnType<typeof createGanttStore>;
|
|
80
|
+
export declare function createGanttStore(initialScale?: GanttScaleKey): import('zustand').StoreApi<GanttState>;
|
|
81
|
+
export {};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { Task, TaskDependency } from '../core/types';
|
|
2
|
+
export { normalizeProgress } from '../core/types';
|
|
3
|
+
export type { DependencyType, Task, TaskDependency, } from '../core/types';
|
|
4
|
+
/** Chart-wide interaction settings - every gesture is allowed by default (task creation also needs `onTaskCreate`), and a task's own field of the same name wins. */
|
|
5
|
+
export interface GanttInteractionConfig {
|
|
6
|
+
readOnly?: boolean;
|
|
7
|
+
allowMove?: boolean;
|
|
8
|
+
allowResize?: boolean;
|
|
9
|
+
allowProgressChange?: boolean;
|
|
10
|
+
allowLinkCreate?: boolean;
|
|
11
|
+
allowLinkDelete?: boolean;
|
|
12
|
+
allowTaskCreate?: boolean;
|
|
13
|
+
/** Turns row reordering on - opt-in (default false). */
|
|
14
|
+
allowReorder?: boolean;
|
|
15
|
+
minDate?: string;
|
|
16
|
+
maxDate?: string;
|
|
17
|
+
}
|
|
18
|
+
interface ResolvedTaskInteraction {
|
|
19
|
+
canMove: boolean;
|
|
20
|
+
canResize: boolean;
|
|
21
|
+
canChangeProgress: boolean;
|
|
22
|
+
canCreateLink: boolean;
|
|
23
|
+
canDeleteLink: boolean;
|
|
24
|
+
canReorder: boolean;
|
|
25
|
+
minDate?: string;
|
|
26
|
+
maxDate?: string;
|
|
27
|
+
}
|
|
28
|
+
export declare function resolveTaskInteraction(task: Pick<Task, 'readOnly' | 'allowMove' | 'allowResize' | 'allowProgressChange' | 'allowLinkCreate' | 'allowLinkDelete' | 'allowReorder' | 'minDate' | 'maxDate'> & {
|
|
29
|
+
isSummary?: boolean;
|
|
30
|
+
}, config?: GanttInteractionConfig): ResolvedTaskInteraction;
|
|
31
|
+
export declare function canCreateTasks(config?: GanttInteractionConfig): boolean;
|
|
32
|
+
interface TaskColorVars {
|
|
33
|
+
'--gantt-bar-color'?: string;
|
|
34
|
+
'--gantt-bar-color-hover'?: string;
|
|
35
|
+
'--gantt-progress-color'?: string;
|
|
36
|
+
'--gantt-bar-text-color'?: string;
|
|
37
|
+
}
|
|
38
|
+
export declare function resolveTaskColors(color: string | undefined): TaskColorVars;
|
|
39
|
+
export interface TaskTransformed extends Task {
|
|
40
|
+
barLeft: number;
|
|
41
|
+
barWidth: number;
|
|
42
|
+
depth: number;
|
|
43
|
+
order: number;
|
|
44
|
+
originalOrder: number;
|
|
45
|
+
/** Row with children - its dates roll up, so resize and progress editing are off and dragging moves the subtree. */
|
|
46
|
+
isSummary?: boolean;
|
|
47
|
+
dependencies?: TaskDependency[];
|
|
48
|
+
}
|
|
49
|
+
export interface RenderedDependency extends TaskDependency {
|
|
50
|
+
sourceId: string;
|
|
51
|
+
fromX: number;
|
|
52
|
+
fromY: number;
|
|
53
|
+
toX: number;
|
|
54
|
+
toY: number;
|
|
55
|
+
}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { Dayjs } from 'dayjs';
|
|
2
|
+
import { MouseEvent as ReactMouseEvent, ReactNode } from 'react';
|
|
3
|
+
import { Task, TaskTransformed } from './task';
|
|
4
|
+
/** Chart theme - 'system' follows the OS setting; omit the prop to follow the host page's `color-scheme`. */
|
|
5
|
+
export type GanttTheme = 'light' | 'dark' | 'system';
|
|
6
|
+
export type GanttScaleKey = 'day' | 'week' | 'month' | 'quarter' | 'year';
|
|
7
|
+
export type GanttLabelUnit = 'hour' | 'day' | 'week' | 'month' | 'quarter' | 'year';
|
|
8
|
+
export type GanttDragMode = 'bar' | 'left' | 'right';
|
|
9
|
+
export interface GanttDragBounds {
|
|
10
|
+
min?: Dayjs;
|
|
11
|
+
max?: Dayjs;
|
|
12
|
+
}
|
|
13
|
+
export interface GanttVisibleRange {
|
|
14
|
+
start?: Dayjs;
|
|
15
|
+
end?: Dayjs;
|
|
16
|
+
}
|
|
17
|
+
export interface GanttScaleConfig {
|
|
18
|
+
labelUnit: GanttLabelUnit;
|
|
19
|
+
tickUnit: 'minute' | 'hour' | 'day' | 'week' | 'month';
|
|
20
|
+
unitPerTick: number;
|
|
21
|
+
tickAlign?: GanttLabelUnit;
|
|
22
|
+
dragStepUnit: 'minute' | 'hour' | 'day' | 'week';
|
|
23
|
+
dragStepAmount: number;
|
|
24
|
+
basePxPerDragStep: number;
|
|
25
|
+
formatTickLabel?: (date: Dayjs) => string;
|
|
26
|
+
formatHeaderLabel?: (date: Dayjs) => string;
|
|
27
|
+
}
|
|
28
|
+
/** Replaces the generated labels of one scale - whatever is left out keeps the built-in (or locale) label. */
|
|
29
|
+
export interface GanttScaleFormat {
|
|
30
|
+
/** Bottom header row - one label per tick */
|
|
31
|
+
tick?: (date: Dayjs) => string;
|
|
32
|
+
/** Top header row - one label per group */
|
|
33
|
+
header?: (date: Dayjs) => string;
|
|
34
|
+
/**
|
|
35
|
+
* Every date the chart writes as a single date: the bar's hover tooltip, its live drag readout
|
|
36
|
+
* and aria-label, the header's drag guide labels (through `edge` and `range`, which follow this
|
|
37
|
+
* slot), and the detail panel's Start and End where they are not editable - an editable date is
|
|
38
|
+
* a native `<input type="date">` and never reaches a formatter.
|
|
39
|
+
*/
|
|
40
|
+
tooltip?: (date: Dayjs) => string;
|
|
41
|
+
}
|
|
42
|
+
/** Per-scale label overrides, e.g. `{ quarter: { header: (d) => ... } }` */
|
|
43
|
+
export type GanttFormatOverrides = Partial<Record<GanttScaleKey, GanttScaleFormat>>;
|
|
44
|
+
/** Everything that decides how a date turns into a label */
|
|
45
|
+
export interface GanttLocaleOptions {
|
|
46
|
+
/** BCP 47 tag handed to `Intl.DateTimeFormat`, e.g. `'ko-KR'` (default: the built-in English labels) */
|
|
47
|
+
locale?: string;
|
|
48
|
+
/** Per-scale label overrides - win over both the locale and the built-in labels */
|
|
49
|
+
formats?: GanttFormatOverrides;
|
|
50
|
+
/** First day of the week, 0 = Sunday .. 6 = Saturday (only affects week grouping) */
|
|
51
|
+
firstDayOfWeek?: number;
|
|
52
|
+
}
|
|
53
|
+
export interface GanttFormatters {
|
|
54
|
+
tick: (date: Dayjs) => string;
|
|
55
|
+
header: (date: Dayjs) => string;
|
|
56
|
+
tooltip: (date: Dayjs) => string;
|
|
57
|
+
range: (start: Dayjs, end: Dayjs) => string;
|
|
58
|
+
/** One end of a dragged range, at the readout's precision - `range` merged both ends */
|
|
59
|
+
edge: (date: Dayjs) => string;
|
|
60
|
+
}
|
|
61
|
+
/** A day off beyond the weekend. A bare `YYYY-MM-DD` string is the same thing with no label. */
|
|
62
|
+
export interface Holiday {
|
|
63
|
+
/** UTC `YYYY-MM-DD` */
|
|
64
|
+
date: string;
|
|
65
|
+
/** Inclusive last day - omit for a single day */
|
|
66
|
+
endDate?: string;
|
|
67
|
+
/** Written in the tick row over the holiday's band, when the band is wide enough to hold it */
|
|
68
|
+
label?: string;
|
|
69
|
+
/** Any CSS colour. Tinted onto the grid at the weekend shade's weight, never painted over it. */
|
|
70
|
+
color?: string;
|
|
71
|
+
}
|
|
72
|
+
export interface GanttBottomRowCell {
|
|
73
|
+
startDate: Dayjs;
|
|
74
|
+
widthPx: number;
|
|
75
|
+
}
|
|
76
|
+
export interface GanttTopHeaderGroup {
|
|
77
|
+
startDate: Dayjs;
|
|
78
|
+
widthPx: number;
|
|
79
|
+
label: string;
|
|
80
|
+
}
|
|
81
|
+
/** The rendered timeline range, as reported by `onRangeChange` */
|
|
82
|
+
export interface GanttDateRange {
|
|
83
|
+
start: Dayjs;
|
|
84
|
+
end: Dayjs;
|
|
85
|
+
}
|
|
86
|
+
export interface GanttRangeExtension {
|
|
87
|
+
before: number;
|
|
88
|
+
after: number;
|
|
89
|
+
}
|
|
90
|
+
export interface GanttDragOffset {
|
|
91
|
+
offsetX: number;
|
|
92
|
+
offsetWidth: number;
|
|
93
|
+
offsetStartDate: Dayjs;
|
|
94
|
+
offsetEndDate: Dayjs;
|
|
95
|
+
}
|
|
96
|
+
export interface GanttBarOptions {
|
|
97
|
+
onTasksChange?: (updatedTasks: Task[]) => void;
|
|
98
|
+
onTaskClick?: (task: TaskTransformed, event: ReactMouseEvent) => void;
|
|
99
|
+
onTaskDoubleClick?: (task: TaskTransformed, event: ReactMouseEvent) => void;
|
|
100
|
+
showTooltip?: boolean;
|
|
101
|
+
}
|
|
102
|
+
/** Props handed to a `renderDetail` override */
|
|
103
|
+
export interface GanttDetailRenderProps {
|
|
104
|
+
task: TaskTransformed;
|
|
105
|
+
/** Closes the panel - wire it to your own close control */
|
|
106
|
+
close: () => void;
|
|
107
|
+
scale: GanttScaleKey;
|
|
108
|
+
/**
|
|
109
|
+
* Patches the open task through the chart's normal commit path (the store, then
|
|
110
|
+
* `onTasksChange`), so a custom body can commit edits in uncontrolled mode. Applies NO
|
|
111
|
+
* permission checks - a custom body enforces its own rules.
|
|
112
|
+
*/
|
|
113
|
+
update: (patch: Partial<Omit<Task, 'id'>>) => void;
|
|
114
|
+
}
|
|
115
|
+
export type GanttDetailRenderer = (props: GanttDetailRenderProps) => ReactNode;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Holiday } from '../types';
|
|
2
|
+
export interface HolidayIndex {
|
|
3
|
+
/** Every day a holiday covers, `YYYY-MM-DD` -> the holiday covering it */
|
|
4
|
+
byDate: Map<string, Holiday>;
|
|
5
|
+
/** The same days, flat - what `createWorkingCalendar` takes */
|
|
6
|
+
dates: string[];
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Expands `holidays` into a per-day lookup. A bare string is a holiday with no label.
|
|
10
|
+
* The first entry covering a day wins, so a later duplicate cannot rewrite its label.
|
|
11
|
+
*/
|
|
12
|
+
export declare function indexHolidays(holidays: (string | Holiday)[] | undefined): HolidayIndex;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { GanttFormatters, GanttLabelUnit, GanttLocaleOptions, GanttScaleKey } from '../types';
|
|
2
|
+
export declare function resolveLabelUnit(scale: GanttScaleKey, options?: GanttLocaleOptions): GanttLabelUnit;
|
|
3
|
+
export declare function resolveFormatters(scale: GanttScaleKey, options?: GanttLocaleOptions): GanttFormatters;
|
|
4
|
+
/** Span label shared by the hover tooltip and the detail panel - hours under a day, whole days from there */
|
|
5
|
+
export declare function formatDuration(durationMs: number): string;
|