mantine-gantt 0.1.0 → 0.2.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/dist/cjs/Gantt/DependencyLinks.cjs +14 -3
- package/dist/cjs/Gantt/DependencyLinks.cjs.map +1 -1
- package/dist/cjs/Gantt/Gantt.cjs +100 -230
- package/dist/cjs/Gantt/Gantt.cjs.map +1 -1
- package/dist/cjs/Gantt/TaskBar.cjs +35 -97
- package/dist/cjs/Gantt/TaskBar.cjs.map +1 -1
- package/dist/cjs/Gantt/TaskList.cjs +30 -2
- package/dist/cjs/Gantt/TaskList.cjs.map +1 -1
- package/dist/cjs/Gantt/use-gantt-drag.cjs +243 -0
- package/dist/cjs/Gantt/use-gantt-drag.cjs.map +1 -0
- package/dist/esm/Gantt/DependencyLinks.mjs +14 -3
- package/dist/esm/Gantt/DependencyLinks.mjs.map +1 -1
- package/dist/esm/Gantt/Gantt.mjs +102 -232
- package/dist/esm/Gantt/Gantt.mjs.map +1 -1
- package/dist/esm/Gantt/TaskBar.mjs +36 -98
- package/dist/esm/Gantt/TaskBar.mjs.map +1 -1
- package/dist/esm/Gantt/TaskList.mjs +30 -2
- package/dist/esm/Gantt/TaskList.mjs.map +1 -1
- package/dist/esm/Gantt/use-gantt-drag.mjs +241 -0
- package/dist/esm/Gantt/use-gantt-drag.mjs.map +1 -0
- package/dist/styles.css +1 -1
- package/dist/styles.layer.css +1 -1
- package/dist/types/Gantt/DependencyLinks.d.ts +9 -1
- package/dist/types/Gantt/TaskBar.d.ts +11 -7
- package/dist/types/Gantt/TaskList.d.ts +3 -2
- package/dist/types/Gantt/index.d.ts +1 -1
- package/dist/types/Gantt/types.d.ts +13 -7
- package/dist/types/Gantt/use-gantt-drag.d.ts +46 -0
- package/dist/types/index.d.mts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/package.json +1 -3
package/dist/styles.layer.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@layer mantine {.me_d2025adb{border:1px solid var(--mantine-color-default-border);border-radius:var(--mantine-radius-md);font-size:var(--mantine-font-size-sm);height:100%;min-height:400px;overflow:hidden}.me_d2025adb,.me_f2f7453c{background-color:var(--mantine-color-body);display:flex}.me_f2f7453c{border-right:1px solid var(--mantine-color-default-border);flex-direction:column;min-width:var(--gantt-task-list-width,320px);width:var(--gantt-task-list-width,320px)}.me_923f36e9{background-color:var(--mantine-color-gray-0);display:grid;
|
|
1
|
+
@layer mantine {.me_d2025adb{border:1px solid var(--mantine-color-default-border);border-radius:var(--mantine-radius-md);font-size:var(--mantine-font-size-sm);height:100%;min-height:400px;overflow:hidden}.me_d2025adb,.me_f2f7453c{background-color:var(--mantine-color-body);display:flex}.me_f2f7453c{border-right:1px solid var(--mantine-color-default-border);flex-direction:column;min-width:var(--gantt-task-list-width,320px);width:var(--gantt-task-list-width,320px)}.me_923f36e9{background-color:var(--mantine-color-gray-0);display:grid;height:var(--gantt-header-height,50px)}[data-mantine-color-scheme=dark] .me_923f36e9{background-color:var(--mantine-color-dark-6)}.me_923f36e9{border-bottom:1px solid var(--mantine-color-default-border);font-weight:600;position:sticky;top:0;z-index:10}.me_60a797eb{align-items:center;border-right:1px solid var(--mantine-color-default-border);color:var(--mantine-color-gray-7);display:flex;padding:0 var(--mantine-spacing-sm)}[data-mantine-color-scheme=dark] .me_60a797eb{color:var(--mantine-color-dark-1)}.me_60a797eb:last-child{border-right:none}.me_6f39f4fe{flex:1;overflow-y:auto;scrollbar-width:none}.me_6f39f4fe::-webkit-scrollbar{display:none}.me_352322fe{border-bottom:1px solid var(--mantine-color-default-border);display:grid;height:var(--gantt-row-height,44px);transition:background-color .15s ease}.me_352322fe:hover{background-color:var(--mantine-color-gray-0)}[data-mantine-color-scheme=dark] .me_352322fe:hover{background-color:var(--mantine-color-dark-6)}.me_6f3a44be{align-items:center;border-right:1px solid var(--mantine-color-default-border);display:flex;overflow:hidden;padding:0 var(--mantine-spacing-sm);text-overflow:ellipsis;white-space:nowrap}.me_6f3a44be:last-child{border-right:none}.me_6f3a44be:first-child{color:var(--mantine-color-gray-8);font-weight:500}[data-mantine-color-scheme=dark] .me_6f3a44be:first-child{color:var(--mantine-color-dark-0)}.me_6f3a44be:not(:first-child){color:var(--mantine-color-gray-6);font-size:var(--mantine-font-size-xs)}[data-mantine-color-scheme=dark] .me_6f3a44be:not(:first-child){color:var(--mantine-color-dark-2)}.me_8fa609ba{display:flex;flex:1;flex-direction:column;overflow:hidden;position:relative}.me_c31c24e7{background-color:var(--mantine-color-gray-0);height:var(--gantt-header-height,50px)}[data-mantine-color-scheme=dark] .me_c31c24e7{background-color:var(--mantine-color-dark-6)}.me_c31c24e7{border-bottom:1px solid var(--mantine-color-default-border);flex-shrink:0;overflow-x:hidden;overflow-y:hidden}.me_cb4231af{display:flex;flex-direction:column;height:100%}.me_282b9f73{display:flex;flex:1}.me_dd4156e9{align-items:center;border-right:1px solid var(--mantine-color-default-border);color:var(--mantine-color-gray-6);display:flex;font-size:var(--mantine-font-size-xs);font-weight:500;justify-content:center;min-width:var(--gantt-column-width,40px);width:var(--gantt-column-width,40px)}[data-mantine-color-scheme=dark] .me_dd4156e9{color:var(--mantine-color-dark-2)}.me_dd4156e9:last-child{border-right:none}.me_dd4156e9[data-weekend]{background-color:var(--mantine-color-gray-1)}[data-mantine-color-scheme=dark] .me_dd4156e9[data-weekend]{background-color:var(--mantine-color-dark-7)}.me_dd4156e9[data-today],[data-mantine-color-scheme=dark] .me_dd4156e9[data-today]{background-color:var(--mantine-primary-color-light)}.me_dd4156e9[data-today]{color:var(--mantine-primary-color-filled);font-weight:600}.me_8ac462da{background-color:var(--mantine-color-gray-1);border-bottom:1px solid var(--mantine-color-default-border);display:flex}[data-mantine-color-scheme=dark] .me_8ac462da{background-color:var(--mantine-color-dark-7)}.me_f9e3635c{align-items:center;border-right:1px solid var(--mantine-color-default-border);color:var(--mantine-color-gray-7);display:flex;font-size:var(--mantine-font-size-xs);font-weight:600;justify-content:center}[data-mantine-color-scheme=dark] .me_f9e3635c{color:var(--mantine-color-dark-1)}.me_f9e3635c{min-width:0;overflow:hidden;padding:2px var(--mantine-spacing-xs);text-overflow:ellipsis;white-space:nowrap}.me_f9e3635c:last-child{border-right:none}.me_d5d64a7c{cursor:grab;flex:1;overflow-x:auto;overflow-y:scroll;position:relative;scrollbar-width:none}.me_d5d64a7c::-webkit-scrollbar{height:12px;width:0}.me_d5d64a7c::-webkit-scrollbar-track{background:var(--mantine-color-gray-1)}[data-mantine-color-scheme=dark] .me_d5d64a7c::-webkit-scrollbar-track{background:var(--mantine-color-dark-6)}.me_d5d64a7c::-webkit-scrollbar-thumb{background:var(--mantine-color-gray-4)}[data-mantine-color-scheme=dark] .me_d5d64a7c::-webkit-scrollbar-thumb{background:var(--mantine-color-dark-4)}.me_d5d64a7c::-webkit-scrollbar-thumb{border-radius:6px}.me_d5d64a7c::-webkit-scrollbar-thumb:hover{background:var(--mantine-color-gray-5)}[data-mantine-color-scheme=dark] .me_d5d64a7c::-webkit-scrollbar-thumb:hover{background:var(--mantine-color-dark-3)}.me_a9b83d5f{min-height:100%;position:relative}.me_d5d89c20{left:0;overflow:hidden;pointer-events:none;position:absolute;right:0;top:0}.me_3be2739c{background-color:rgba(0,0,0,.03);position:absolute;top:0}[data-mantine-color-scheme=dark] .me_3be2739c{background-color:hsla(0,0%,100%,.02)}.me_1e5ed1d3{background-color:rgba(0,0,0,.08);position:absolute;top:0;width:1px}[data-mantine-color-scheme=dark] .me_1e5ed1d3{background-color:hsla(0,0%,100%,.08)}.me_77ef3b5a{background-color:rgba(0,0,0,.2);position:absolute;top:0;width:1px}[data-mantine-color-scheme=dark] .me_77ef3b5a{background-color:hsla(0,0%,100%,.15)}.me_6b1855{background-color:var(--mantine-color-default-border);height:1px}.me_6b1855,.me_8b0725c0{left:0;position:absolute;right:0}.me_8b0725c0{border-bottom:1px solid var(--mantine-color-default-border);height:var(--gantt-row-height,44px)}.me_8b0725c0:last-child{border-bottom:none}.me_5228dbb5{align-items:center;background-color:var(--task-bar-color,var(--mantine-primary-color-filled));border-radius:var(--mantine-radius-sm);box-shadow:var(--mantine-shadow-xs);cursor:grab;display:flex;height:calc(var(--gantt-row-height) - 16px);overflow:visible;position:absolute;top:8px;touch-action:none;user-select:none;will-change:left,width,transform;z-index:10}.me_5228dbb5:hover{box-shadow:var(--mantine-shadow-sm)}.me_5228dbb5:focus-visible{outline:2px solid var(--mantine-primary-color-filled);outline-offset:2px}.me_5228dbb5[data-dragging]{box-shadow:var(--mantine-shadow-md);cursor:grabbing;opacity:.9;transition:box-shadow .15s ease;z-index:100}.me_d1af7d02{background-color:rgba(0,0,0,.15);border-radius:var(--mantine-radius-sm) 0 0 var(--mantine-radius-sm);height:100%;left:0;pointer-events:none;position:absolute;top:0}.me_b561bc3f{color:var(--mantine-color-white);font-size:var(--mantine-font-size-xs);font-weight:500;overflow:hidden;padding:0 var(--mantine-spacing-xs);position:relative;text-overflow:ellipsis;white-space:nowrap;z-index:1}.me_176570f5{align-items:center;background:linear-gradient(90deg,transparent,rgba(0,0,0,.1));cursor:ew-resize;display:flex;height:100%;justify-content:center;opacity:0;position:absolute;right:0;top:0;touch-action:none;transition:opacity .15s ease;width:10px}.me_5228dbb5:hover .me_176570f5{opacity:1}.me_176570f5:after{border-left:1px solid hsla(0,0%,100%,.5);border-right:1px solid hsla(0,0%,100%,.5);content:"";height:14px;width:3px}.me_14ce029c{align-items:center;background:linear-gradient(270deg,transparent,rgba(0,0,0,.1));cursor:ew-resize;display:flex;height:100%;justify-content:center;left:0;opacity:0;position:absolute;top:0;touch-action:none;transition:opacity .15s ease;width:10px;z-index:2}.me_5228dbb5:hover .me_14ce029c{opacity:1}.me_14ce029c:after{border-left:1px solid hsla(0,0%,100%,.5);border-right:1px solid hsla(0,0%,100%,.5);content:"";height:14px;width:3px}.me_810d0b9a{background-color:var(--mantine-primary-color-filled);border:2px solid var(--mantine-color-white);border-radius:50%;height:14px;position:absolute;right:-18px;top:50%;transform:translateY(-50%);width:14px}[data-mantine-color-scheme=dark] .me_810d0b9a{border:2px solid var(--mantine-color-dark-6)}.me_810d0b9a{cursor:crosshair;opacity:0;touch-action:none;transition:opacity .15s ease,transform .15s ease;z-index:30}.me_5228dbb5:hover .me_810d0b9a{opacity:1}.me_810d0b9a:hover{background-color:var(--mantine-primary-color-filled);transform:translateY(-50%) scale(1.2)}.me_5228dbb5[data-link-target]{outline:2px dashed var(--mantine-primary-color-filled);outline-offset:2px}.me_f220b47c{bottom:0;pointer-events:none;width:2px;z-index:50}.me_f220b47c,.me_f220b47c:before{background-color:var(--mantine-color-red-6);position:absolute;top:0}.me_f220b47c:before{border-radius:50%;content:"";height:10px;left:-4px;width:10px}.me_d0e44395{height:100%;left:0;overflow:visible;pointer-events:none;position:absolute;top:0;width:100%;z-index:1}.me_69d5d098{fill:none;stroke:var(--mantine-color-gray-6)}[data-mantine-color-scheme=dark] .me_69d5d098{stroke:var(--mantine-color-gray-5)}.me_69d5d098{stroke-width:1.5;pointer-events:stroke}.me_69d5d098:hover{stroke:var(--mantine-color-gray-8)}[data-mantine-color-scheme=dark] .me_69d5d098:hover{stroke:var(--mantine-color-gray-3)}.me_ffc139d6{fill:var(--mantine-color-gray-6)}[data-mantine-color-scheme=dark] .me_ffc139d6{fill:var(--mantine-color-gray-5)}}
|
|
@@ -10,9 +10,17 @@ interface DependencyLinksProps {
|
|
|
10
10
|
getStyles: GetStylesApi<GanttFactory>;
|
|
11
11
|
activeDragId?: string | null;
|
|
12
12
|
activeDragType?: GanttDragType | null;
|
|
13
|
+
/** Continuous, scroll-adjusted px delta of the active move/resize drag. */
|
|
13
14
|
dragDelta?: number;
|
|
15
|
+
/** Live link-creation line, in timelineContent coordinates. */
|
|
16
|
+
linkPreview?: {
|
|
17
|
+
x1: number;
|
|
18
|
+
y1: number;
|
|
19
|
+
x2: number;
|
|
20
|
+
y2: number;
|
|
21
|
+
} | null;
|
|
14
22
|
}
|
|
15
|
-
export declare function DependencyLinks({ tasks, startDate, columnWidth, rowHeight, getStyles, activeDragId, activeDragType, dragDelta, }: DependencyLinksProps): React.JSX.Element;
|
|
23
|
+
export declare function DependencyLinks({ tasks, startDate, columnWidth, rowHeight, getStyles, activeDragId, activeDragType, dragDelta, linkPreview, }: DependencyLinksProps): React.JSX.Element;
|
|
16
24
|
export declare namespace DependencyLinks {
|
|
17
25
|
var displayName: string;
|
|
18
26
|
}
|
|
@@ -1,20 +1,24 @@
|
|
|
1
1
|
import type { Dayjs } from 'dayjs';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { type GetStylesApi } from '@mantine/core';
|
|
4
|
-
import type { GanttFactory, GanttTask } from './types';
|
|
4
|
+
import type { GanttDragType, GanttFactory, GanttTask } from './types';
|
|
5
5
|
interface TaskBarProps {
|
|
6
6
|
task: GanttTask;
|
|
7
7
|
startDate: Dayjs;
|
|
8
8
|
columnWidth: number;
|
|
9
9
|
getStyles: GetStylesApi<GanttFactory>;
|
|
10
10
|
isDragging?: boolean;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
/** True when this bar is the current link drop target (highlight it). */
|
|
12
|
+
isLinkTarget?: boolean;
|
|
13
|
+
/** Active drag type when THIS bar is the one being dragged, else null. */
|
|
14
|
+
dragType?: GanttDragType | null;
|
|
15
|
+
/** Continuous, scroll-adjusted px delta for the active drag of THIS bar. */
|
|
16
|
+
dragDeltaX?: number;
|
|
17
|
+
startDrag: (type: GanttDragType, taskId: string, event: React.PointerEvent) => void;
|
|
18
|
+
didDrag: () => boolean;
|
|
19
|
+
nudge: (taskId: string, action: 'move' | 'resize', days: number) => void;
|
|
16
20
|
onClick?: () => void;
|
|
17
21
|
}
|
|
18
|
-
declare function TaskBarComponent({ task, startDate, columnWidth, getStyles, isDragging,
|
|
22
|
+
declare function TaskBarComponent({ task, startDate, columnWidth, getStyles, isDragging, isLinkTarget, dragType, dragDeltaX, startDrag, didDrag, nudge, onClick, }: TaskBarProps): React.JSX.Element;
|
|
19
23
|
export declare const TaskBar: React.MemoExoticComponent<typeof TaskBarComponent>;
|
|
20
24
|
export {};
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { GetStylesApi } from '@mantine/core';
|
|
3
|
-
import type { GanttFactory, GanttTask } from './types';
|
|
3
|
+
import type { GanttColumn, GanttFactory, GanttTask } from './types';
|
|
4
4
|
interface TaskListProps {
|
|
5
5
|
tasks: GanttTask[];
|
|
6
|
+
columns?: GanttColumn[];
|
|
6
7
|
getStyles: GetStylesApi<GanttFactory>;
|
|
7
8
|
bodyRef: React.RefObject<HTMLDivElement | null>;
|
|
8
9
|
onScroll: () => void;
|
|
9
10
|
}
|
|
10
|
-
export declare function TaskList({ tasks, getStyles, bodyRef, onScroll }: TaskListProps): React.JSX.Element;
|
|
11
|
+
export declare function TaskList({ tasks, columns, getStyles, bodyRef, onScroll, }: TaskListProps): React.JSX.Element;
|
|
11
12
|
export declare namespace TaskList {
|
|
12
13
|
var displayName: string;
|
|
13
14
|
}
|
|
@@ -3,5 +3,5 @@ export { TaskBar } from './TaskBar';
|
|
|
3
3
|
export { TaskList } from './TaskList';
|
|
4
4
|
export { TimelineGrid } from './TimelineGrid';
|
|
5
5
|
export { TimelineHeader } from './TimelineHeader';
|
|
6
|
-
export type { GanttProps, GanttTask, GanttStylesNames, GanttCssVariables, GanttFactory,
|
|
6
|
+
export type { GanttProps, GanttTask, GanttColumn, GanttStylesNames, GanttCssVariables, GanttFactory, GanttDragType, } from './types';
|
|
7
7
|
export { dateToPixel, pixelToDate, snapToGrid, durationToPixels, pixelsToDuration, formatTaskDate, getTaskEndDate, calculateTimelineBounds, generateDayHeaders, generateWeekHeaders, } from './utils';
|
|
@@ -1,4 +1,14 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
1
2
|
import type { BoxProps, ElementProps, Factory, MantineColor, StylesApiProps } from '@mantine/core';
|
|
3
|
+
/** A column in the left-hand task list */
|
|
4
|
+
export interface GanttColumn {
|
|
5
|
+
/** Header label */
|
|
6
|
+
header: ReactNode;
|
|
7
|
+
/** Cell content for a given task */
|
|
8
|
+
render: (task: GanttTask) => ReactNode;
|
|
9
|
+
/** Fixed column width in px; omit to flex (1fr) */
|
|
10
|
+
width?: number;
|
|
11
|
+
}
|
|
2
12
|
/** Represents a single task in the Gantt chart */
|
|
3
13
|
export interface GanttTask {
|
|
4
14
|
/** Unique identifier for the task */
|
|
@@ -23,6 +33,8 @@ export type GanttCssVariables = {
|
|
|
23
33
|
export interface GanttBaseProps {
|
|
24
34
|
/** Array of tasks to display */
|
|
25
35
|
tasks: GanttTask[];
|
|
36
|
+
/** Columns shown in the left task list. Defaults to Name / Start / End / Duration. */
|
|
37
|
+
columns?: GanttColumn[];
|
|
26
38
|
/** Callback when a task is updated (moved or resized) */
|
|
27
39
|
onTaskUpdate?: (task: GanttTask) => void;
|
|
28
40
|
/** Callback when a task is clicked */
|
|
@@ -54,11 +66,5 @@ export type GanttFactory = Factory<{
|
|
|
54
66
|
}>;
|
|
55
67
|
export interface GanttProps extends BoxProps, StylesApiProps<GanttFactory>, ElementProps<'div', 'onChange'>, GanttBaseProps {
|
|
56
68
|
}
|
|
57
|
-
/** Kind of drag interaction
|
|
69
|
+
/** Kind of drag interaction driven by useGanttDrag */
|
|
58
70
|
export type GanttDragType = 'move' | 'resize-end' | 'resize-start' | 'link';
|
|
59
|
-
/** Context for drag operations */
|
|
60
|
-
export interface DragContext {
|
|
61
|
-
type: GanttDragType;
|
|
62
|
-
taskId: string;
|
|
63
|
-
initialX: number;
|
|
64
|
-
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { GanttDragType, GanttTask } from './types';
|
|
2
|
+
/** Live drag state, shared with TaskBar (bar geometry) and DependencyLinks (arrows + link line). */
|
|
3
|
+
export interface GanttDragState {
|
|
4
|
+
type: GanttDragType;
|
|
5
|
+
taskId: string;
|
|
6
|
+
/** Scroll-adjusted continuous px delta since drag start (not snapped until release). */
|
|
7
|
+
deltaX: number;
|
|
8
|
+
/** For a `link` drag: cursor position in timelineContent coordinates. */
|
|
9
|
+
linkCursor: {
|
|
10
|
+
x: number;
|
|
11
|
+
y: number;
|
|
12
|
+
} | null;
|
|
13
|
+
/** For a `link` drag: id of the task currently under the cursor (never the source). */
|
|
14
|
+
dropTargetId: string | null;
|
|
15
|
+
}
|
|
16
|
+
export interface UseGanttDragOptions {
|
|
17
|
+
tasks: GanttTask[];
|
|
18
|
+
setTasks: React.Dispatch<React.SetStateAction<GanttTask[]>>;
|
|
19
|
+
/** Effective column width in px (already adjusted for viewMode). */
|
|
20
|
+
columnWidth: number;
|
|
21
|
+
/** Scroll container — drives scroll-adjusted delta and auto-scroll. */
|
|
22
|
+
bodyRef: React.RefObject<HTMLDivElement | null>;
|
|
23
|
+
/** Positioned content — its rect maps client coords to timeline pixels. */
|
|
24
|
+
contentRef: React.RefObject<HTMLDivElement | null>;
|
|
25
|
+
onTaskUpdate?: (task: GanttTask) => void;
|
|
26
|
+
onLinkCreate?: (fromTaskId: string, toTaskId: string) => void;
|
|
27
|
+
/** Push a message to the aria-live region (drag/keyboard commits). */
|
|
28
|
+
announce?: (message: string) => void;
|
|
29
|
+
}
|
|
30
|
+
export interface UseGanttDragReturn {
|
|
31
|
+
state: GanttDragState | null;
|
|
32
|
+
/** Begin a drag from a pointerdown on the bar / a resize handle / the link connector. */
|
|
33
|
+
startDrag: (type: GanttDragType, taskId: string, event: React.PointerEvent) => void;
|
|
34
|
+
/** True for one frame after a real drag, so the trailing click doesn't fire onTaskClick. */
|
|
35
|
+
didDrag: () => boolean;
|
|
36
|
+
/** Keyboard nudge: move / resize a task by whole days and announce it. */
|
|
37
|
+
nudge: (taskId: string, action: 'move' | 'resize', days: number) => void;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Owns every drag interaction (move / resize-start / resize-end / link) on plain pointer
|
|
41
|
+
* events — no @dnd-kit. pointerdown → document pointermove → pointerup, snapping to whole
|
|
42
|
+
* days only on release. Auto-scrolls the viewport near its edges and keeps delta correct
|
|
43
|
+
* across that scroll, so the bar follows the cursor. Modeled on @mantine/schedule's
|
|
44
|
+
* use-horizontal-event-resize + use-auto-scroll-on-drag.
|
|
45
|
+
*/
|
|
46
|
+
export declare function useGanttDrag(options: UseGanttDragOptions): UseGanttDragReturn;
|
package/dist/types/index.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { Gantt } from './Gantt';
|
|
2
|
-
export type { GanttProps, GanttTask, GanttStylesNames, GanttFactory, GanttCssVariables, } from './Gantt';
|
|
2
|
+
export type { GanttProps, GanttTask, GanttColumn, GanttStylesNames, GanttFactory, GanttCssVariables, } from './Gantt';
|
|
3
3
|
export { dateToPixel, pixelToDate, snapToGrid, durationToPixels, formatTaskDate, getTaskEndDate, calculateTimelineBounds, } from './Gantt';
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { Gantt } from './Gantt';
|
|
2
|
-
export type { GanttProps, GanttTask, GanttStylesNames, GanttFactory, GanttCssVariables, } from './Gantt';
|
|
2
|
+
export type { GanttProps, GanttTask, GanttColumn, GanttStylesNames, GanttFactory, GanttCssVariables, } from './Gantt';
|
|
3
3
|
export { dateToPixel, pixelToDate, snapToGrid, durationToPixels, formatTaskDate, getTaskEndDate, calculateTimelineBounds, } from './Gantt';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mantine-gantt",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "A gantt chart component for mantine",
|
|
5
5
|
"homepage": "https://wojakgra.github.io/mantine-gantt",
|
|
6
6
|
"packageManager": "yarn@4.0.1",
|
|
@@ -30,8 +30,6 @@
|
|
|
30
30
|
},
|
|
31
31
|
"repository": "https://github.com/WojakGra/mantine-gantt.git",
|
|
32
32
|
"peerDependencies": {
|
|
33
|
-
"@dnd-kit/core": "^6.1.0",
|
|
34
|
-
"@dnd-kit/utilities": "^3.2.2",
|
|
35
33
|
"@mantine/core": ">=7.0.0",
|
|
36
34
|
"@mantine/hooks": ">=7.0.0",
|
|
37
35
|
"dayjs": "^1.11.10",
|