@art-tools/react-gantt 0.1.0 → 0.2.1
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 +90 -8
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +157 -4
- package/dist/index.d.ts +157 -4
- package/dist/index.mjs +1286 -1098
- package/dist/index.mjs.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -4,6 +4,7 @@ import { default as default_2 } from 'react';
|
|
|
4
4
|
import { ElementType } from 'react';
|
|
5
5
|
import { JSX } from 'react/jsx-runtime';
|
|
6
6
|
import { ReactNode } from 'react';
|
|
7
|
+
import { RefObject } from 'react';
|
|
7
8
|
|
|
8
9
|
/**
|
|
9
10
|
* Key of the built-in edit/add/delete column, dropped when `readOnly` is set.
|
|
@@ -19,7 +20,12 @@ declare interface BarA11yProps {
|
|
|
19
20
|
"aria-colspan": number;
|
|
20
21
|
"aria-label": string;
|
|
21
22
|
"aria-selected": boolean | undefined;
|
|
22
|
-
|
|
23
|
+
/**
|
|
24
|
+
* The native browser tooltip. Optional because a chart with a tooltip slot
|
|
25
|
+
* suppresses it — two tooltips would stack. `aria-label` is unaffected, so
|
|
26
|
+
* the accessible name survives either way.
|
|
27
|
+
*/
|
|
28
|
+
title?: string;
|
|
23
29
|
}
|
|
24
30
|
|
|
25
31
|
/** State passed to the function form of each BarProgress slotProps. */
|
|
@@ -58,6 +64,113 @@ export declare interface BarProgressSlots {
|
|
|
58
64
|
root?: ElementType;
|
|
59
65
|
}
|
|
60
66
|
|
|
67
|
+
/**
|
|
68
|
+
* Open state shared *within one tooltip slot*, owned by `BarTooltipRoot` and read
|
|
69
|
+
* by `BarTooltipTrigger` and the popup.
|
|
70
|
+
*
|
|
71
|
+
* It sits inside the slot rather than in `BarTooltipConsumer` so that nothing
|
|
72
|
+
* outside the slot has an opinion about open state (ADR-022).
|
|
73
|
+
*
|
|
74
|
+
* `null` means there is no root above, which is why `BarTooltipTrigger` is a
|
|
75
|
+
* no-op rather than an error: `TaskBar`/`ProjectBar`/`MilestoneBar` are public
|
|
76
|
+
* exports that render standalone.
|
|
77
|
+
*/
|
|
78
|
+
export declare interface BarTooltipContextValue {
|
|
79
|
+
open: boolean;
|
|
80
|
+
setOpen: (open: boolean) => void;
|
|
81
|
+
/** The bar's DOM node, used to verify the pointer really did leave it. */
|
|
82
|
+
anchorRef: RefObject<HTMLDivElement | null>;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* State passed to the function form of the tooltip slotProps, and to the slot
|
|
87
|
+
* component itself.
|
|
88
|
+
*
|
|
89
|
+
* `displayEnd` is resolved by `Row` rather than left to the consumer because
|
|
90
|
+
* `task.endDate` is an *exclusive* instant (ADR-014): a Mon–Fri task stores
|
|
91
|
+
* Saturday midnight, so rendering it raw reads as ending on Saturday. Handing
|
|
92
|
+
* over the already-inclusive date is what stops every tooltip from reintroducing
|
|
93
|
+
* that bug.
|
|
94
|
+
*/
|
|
95
|
+
export declare interface BarTooltipOwnerState {
|
|
96
|
+
task: GanttTask;
|
|
97
|
+
/** Resolved progress, override-aware during a drag — not `task.progress`. */
|
|
98
|
+
progress: number;
|
|
99
|
+
/** Inclusive, user-facing end date. `undefined` for an instant (a milestone). */
|
|
100
|
+
displayEnd: Date | undefined;
|
|
101
|
+
/**
|
|
102
|
+
* The bar itself. The slot is a *wrapper*: it has to render this, and has to
|
|
103
|
+
* decide for itself when to show a popup beside it — there is no `open` prop,
|
|
104
|
+
* because the chart holds no open state (ADR-022). Use `BarTooltipRoot` +
|
|
105
|
+
* `BarTooltipTrigger` for the built-in hover behaviour, or a third-party
|
|
106
|
+
* tooltip's own root and trigger.
|
|
107
|
+
*/
|
|
108
|
+
children?: ReactNode;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export declare interface BarTooltipProps extends BarTooltipOwnerState {
|
|
112
|
+
/**
|
|
113
|
+
* The bar's DOM node, for a custom tooltip that wants to position against the
|
|
114
|
+
* bar rather than the cursor. `null` until the bar mounts, and also when a
|
|
115
|
+
* consumer has replaced `slots.root` with a component that does not forward
|
|
116
|
+
* refs.
|
|
117
|
+
*
|
|
118
|
+
* The built-in tooltip ignores it — it places from the cursor (ADR-022).
|
|
119
|
+
*/
|
|
120
|
+
anchorRef: RefObject<HTMLDivElement | null>;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Owns one bar tooltip's open state and publishes it to `BarTooltipTrigger` and
|
|
125
|
+
* whatever renders the popup.
|
|
126
|
+
*
|
|
127
|
+
* Belongs *inside* the tooltip slot, and a slot is free to skip it entirely and
|
|
128
|
+
* use a third-party tooltip's root instead (ADR-022).
|
|
129
|
+
*
|
|
130
|
+
* Exported for the middle case: a custom tooltip that wants the library's hover
|
|
131
|
+
* and closing behaviour with different markup. Compose it with
|
|
132
|
+
* `BarTooltipTrigger` and `useBarTooltip`.
|
|
133
|
+
*/
|
|
134
|
+
export declare function BarTooltipRoot({ anchorRef, children, }: {
|
|
135
|
+
anchorRef: RefObject<HTMLDivElement | null>;
|
|
136
|
+
children: ReactNode;
|
|
137
|
+
}): JSX.Element;
|
|
138
|
+
|
|
139
|
+
/** Slot config for the bar tooltip. */
|
|
140
|
+
export declare type BarTooltipSlotConfig = SlotConfig<BarTooltipSlots, BarTooltipSlotProps>;
|
|
141
|
+
|
|
142
|
+
export declare interface BarTooltipSlotProps {
|
|
143
|
+
tooltip?: SlotPropsInput<ComponentProps<"div">, BarTooltipOwnerState>;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
export declare interface BarTooltipSlots {
|
|
147
|
+
/**
|
|
148
|
+
* The tooltip. Default: none — nothing is rendered and the bar keeps its
|
|
149
|
+
* native `title`. Pass `GanttBarTooltip` for the built-in one, or any component
|
|
150
|
+
* accepting {@link BarTooltipProps}.
|
|
151
|
+
*/
|
|
152
|
+
tooltip?: ElementType;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* Turns the element it is given into the tooltip's trigger. Belongs inside the
|
|
157
|
+
* tooltip slot, under a `BarTooltipRoot` and wrapped around the slot's
|
|
158
|
+
* `children`: that is what makes hover behaviour the slot's own business rather
|
|
159
|
+
* than the bar's.
|
|
160
|
+
*
|
|
161
|
+
* It **merges** onto that element rather than wrapping it, which is not a style
|
|
162
|
+
* preference: the bar contains `<button>` resize and connector handles, so a
|
|
163
|
+
* wrapping trigger — Base UI's default renders a `<button>` — would nest buttons
|
|
164
|
+
* and produce invalid HTML that breaks those controls. `cloneElement` adds no DOM
|
|
165
|
+
* at all.
|
|
166
|
+
*
|
|
167
|
+
* Handlers are composed with whatever the element already has, so a consumer's
|
|
168
|
+
* `slotProps.root` handlers and the a11y payload keep firing.
|
|
169
|
+
*/
|
|
170
|
+
export declare function BarTooltipTrigger({ children }: {
|
|
171
|
+
children: ReactNode;
|
|
172
|
+
}): ReactNode;
|
|
173
|
+
|
|
61
174
|
/** Axis-aligned pixel bounds. */
|
|
62
175
|
export declare interface Bounds {
|
|
63
176
|
minX: number;
|
|
@@ -356,8 +469,30 @@ export declare interface GanttBarsSlots {
|
|
|
356
469
|
barProgressResizeHandle?: BarProgressResizeHandleSlotConfig;
|
|
357
470
|
taskResizer?: TaskResizerSlotConfig;
|
|
358
471
|
connectorHandles?: ConnectorHandlesSlotConfig;
|
|
472
|
+
/**
|
|
473
|
+
* One slot for all three bar types, rendered by `DraggableBar` so it is
|
|
474
|
+
* scoped to the bar's own hover. Empty by default: no tooltip is rendered and
|
|
475
|
+
* the bar keeps its native `title`. Note it is lost if `slots.root` is
|
|
476
|
+
* replaced, since `DraggableBar` is only the default root (ADR-022).
|
|
477
|
+
*/
|
|
478
|
+
tooltip?: BarTooltipSlotConfig;
|
|
359
479
|
}
|
|
360
480
|
|
|
481
|
+
/**
|
|
482
|
+
* The built-in bar tooltip. Opt in with `slots={{ tooltip: GanttBarTooltip }}`;
|
|
483
|
+
* it is never rendered by default.
|
|
484
|
+
*
|
|
485
|
+
* A wrapper, not a sibling: it renders the bar it is handed and mounts its own
|
|
486
|
+
* root and trigger around it, so it holds no privileged position over any other
|
|
487
|
+
* slot (ADR-022).
|
|
488
|
+
*
|
|
489
|
+
* Placed from the cursor in JS, not with CSS anchor positioning: anchoring to the
|
|
490
|
+
* bar puts the tooltip at the midpoint of a bar that can be wider than the
|
|
491
|
+
* viewport. It follows the pointer for as long as it is open; there is no dwell
|
|
492
|
+
* delay.
|
|
493
|
+
*/
|
|
494
|
+
export declare function GanttBarTooltip({ task, progress, displayEnd, anchorRef, className, style, children, ...divProps }: BarTooltipProps & ComponentProps<"div">): JSX.Element;
|
|
495
|
+
|
|
361
496
|
/**
|
|
362
497
|
* The chart's working-time calendar. Three scopes resolve in the order
|
|
363
498
|
* `dates` → `days` → `hours`, so a specific date beats a weekday rule, which
|
|
@@ -732,7 +867,7 @@ export declare function mergeSlotProps<Props extends {
|
|
|
732
867
|
style?: CSSProperties;
|
|
733
868
|
}, OwnerState>(internalProps: Props, slotProps: SlotPropsInput<Props, OwnerState> | undefined, ownerState: OwnerState): Props;
|
|
734
869
|
|
|
735
|
-
export declare function MilestoneBar({ size, centerLeft, top, colWidth, title, a11y, onMove, onMoveEnd, slots: slotsProp, slotProps: slotPropsProp, }: MilestoneBarProps): JSX.Element;
|
|
870
|
+
export declare function MilestoneBar({ size, centerLeft, top, colWidth, title, a11y, onMove, onMoveEnd, tooltip, slots: slotsProp, slotProps: slotPropsProp, }: MilestoneBarProps): JSX.Element;
|
|
736
871
|
|
|
737
872
|
export declare interface MilestoneBarOwnerState {
|
|
738
873
|
size: number;
|
|
@@ -749,6 +884,11 @@ declare interface MilestoneBarProps {
|
|
|
749
884
|
/** Editing handlers; omitted on a read-only chart (see `TaskBar`). */
|
|
750
885
|
onMove?: (newCenterLeft: number) => void;
|
|
751
886
|
onMoveEnd?: (newCenterLeft: number) => void;
|
|
887
|
+
/**
|
|
888
|
+
* Task data handed to the root so it can render the tooltip slot. Forwarded
|
|
889
|
+
* verbatim; a replaced `slots.root` that ignores it simply shows no tooltip.
|
|
890
|
+
*/
|
|
891
|
+
tooltip?: BarTooltipOwnerState;
|
|
752
892
|
slots?: MilestoneBarSlots;
|
|
753
893
|
slotProps?: MilestoneBarSlotProps;
|
|
754
894
|
}
|
|
@@ -775,7 +915,7 @@ export declare interface Point {
|
|
|
775
915
|
y: number;
|
|
776
916
|
}
|
|
777
917
|
|
|
778
|
-
export declare function ProjectBar({ width, height, left, top, colWidth, title, a11y, progress, onProgressChange, onProgressEnd, onMove, onMoveEnd, slots: slotsProp, slotProps: slotPropsProp, }: ProjectBarProps): JSX.Element;
|
|
918
|
+
export declare function ProjectBar({ width, height, left, top, colWidth, title, a11y, progress, onProgressChange, onProgressEnd, onMove, onMoveEnd, tooltip, slots: slotsProp, slotProps: slotPropsProp, }: ProjectBarProps): JSX.Element;
|
|
779
919
|
|
|
780
920
|
/** State passed to the function form of each ProjectBar slotProps. */
|
|
781
921
|
export declare interface ProjectBarOwnerState {
|
|
@@ -799,6 +939,11 @@ declare interface ProjectBarProps {
|
|
|
799
939
|
onProgressEnd?: (newProgress: number) => void;
|
|
800
940
|
onMove?: (newLeft: number) => void;
|
|
801
941
|
onMoveEnd?: (newLeft: number) => void;
|
|
942
|
+
/**
|
|
943
|
+
* Task data handed to the root so it can render the tooltip slot. Forwarded
|
|
944
|
+
* verbatim; a replaced `slots.root` that ignores it simply shows no tooltip.
|
|
945
|
+
*/
|
|
946
|
+
tooltip?: BarTooltipOwnerState;
|
|
802
947
|
slots?: ProjectBarSlots;
|
|
803
948
|
slotProps?: ProjectBarSlotProps;
|
|
804
949
|
}
|
|
@@ -859,7 +1004,7 @@ export declare interface SlotConfig<Slots, SlotProps> {
|
|
|
859
1004
|
*/
|
|
860
1005
|
export declare type SlotPropsInput<P, OwnerState> = Partial<P> | ((ownerState: OwnerState) => Partial<P>);
|
|
861
1006
|
|
|
862
|
-
export declare function TaskBar({ width, height, left, top, colWidth, title, a11y, progress, onProgressChange, onProgressEnd, onResize, onResizeEnd, onMove, onMoveEnd, slots: slotsProp, slotProps: slotPropsProp, }: TaskBarProps): JSX.Element;
|
|
1007
|
+
export declare function TaskBar({ width, height, left, top, colWidth, title, a11y, progress, onProgressChange, onProgressEnd, onResize, onResizeEnd, onMove, onMoveEnd, tooltip, slots: slotsProp, slotProps: slotPropsProp, }: TaskBarProps): JSX.Element;
|
|
863
1008
|
|
|
864
1009
|
/** State passed to the function form of each TaskBar slotProps. */
|
|
865
1010
|
export declare interface TaskBarOwnerState {
|
|
@@ -888,6 +1033,11 @@ declare interface TaskBarProps {
|
|
|
888
1033
|
onResizeEnd?: (edge: "start" | "end", edgePx: number) => void;
|
|
889
1034
|
onMove?: (newLeft: number) => void;
|
|
890
1035
|
onMoveEnd?: (newLeft: number) => void;
|
|
1036
|
+
/**
|
|
1037
|
+
* Task data handed to the root so it can render the tooltip slot. Forwarded
|
|
1038
|
+
* verbatim; a replaced `slots.root` that ignores it simply shows no tooltip.
|
|
1039
|
+
*/
|
|
1040
|
+
tooltip?: BarTooltipOwnerState;
|
|
891
1041
|
slots?: TaskBarSlots;
|
|
892
1042
|
slotProps?: TaskBarSlotProps;
|
|
893
1043
|
}
|
|
@@ -1015,6 +1165,9 @@ export declare interface TreeCellSlots {
|
|
|
1015
1165
|
placeholder?: ElementType;
|
|
1016
1166
|
}
|
|
1017
1167
|
|
|
1168
|
+
/** The enclosing `BarTooltipRoot`'s state, or `null` when there is none. */
|
|
1169
|
+
export declare const useBarTooltip: () => BarTooltipContextValue | null;
|
|
1170
|
+
|
|
1018
1171
|
export declare function useGanttReadOnly(): boolean;
|
|
1019
1172
|
|
|
1020
1173
|
/** Read the grid-side slot groups. Returns `{}` outside a provider. */
|
package/dist/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ import { default as default_2 } from 'react';
|
|
|
4
4
|
import { ElementType } from 'react';
|
|
5
5
|
import { JSX } from 'react/jsx-runtime';
|
|
6
6
|
import { ReactNode } from 'react';
|
|
7
|
+
import { RefObject } from 'react';
|
|
7
8
|
|
|
8
9
|
/**
|
|
9
10
|
* Key of the built-in edit/add/delete column, dropped when `readOnly` is set.
|
|
@@ -19,7 +20,12 @@ declare interface BarA11yProps {
|
|
|
19
20
|
"aria-colspan": number;
|
|
20
21
|
"aria-label": string;
|
|
21
22
|
"aria-selected": boolean | undefined;
|
|
22
|
-
|
|
23
|
+
/**
|
|
24
|
+
* The native browser tooltip. Optional because a chart with a tooltip slot
|
|
25
|
+
* suppresses it — two tooltips would stack. `aria-label` is unaffected, so
|
|
26
|
+
* the accessible name survives either way.
|
|
27
|
+
*/
|
|
28
|
+
title?: string;
|
|
23
29
|
}
|
|
24
30
|
|
|
25
31
|
/** State passed to the function form of each BarProgress slotProps. */
|
|
@@ -58,6 +64,113 @@ export declare interface BarProgressSlots {
|
|
|
58
64
|
root?: ElementType;
|
|
59
65
|
}
|
|
60
66
|
|
|
67
|
+
/**
|
|
68
|
+
* Open state shared *within one tooltip slot*, owned by `BarTooltipRoot` and read
|
|
69
|
+
* by `BarTooltipTrigger` and the popup.
|
|
70
|
+
*
|
|
71
|
+
* It sits inside the slot rather than in `BarTooltipConsumer` so that nothing
|
|
72
|
+
* outside the slot has an opinion about open state (ADR-022).
|
|
73
|
+
*
|
|
74
|
+
* `null` means there is no root above, which is why `BarTooltipTrigger` is a
|
|
75
|
+
* no-op rather than an error: `TaskBar`/`ProjectBar`/`MilestoneBar` are public
|
|
76
|
+
* exports that render standalone.
|
|
77
|
+
*/
|
|
78
|
+
export declare interface BarTooltipContextValue {
|
|
79
|
+
open: boolean;
|
|
80
|
+
setOpen: (open: boolean) => void;
|
|
81
|
+
/** The bar's DOM node, used to verify the pointer really did leave it. */
|
|
82
|
+
anchorRef: RefObject<HTMLDivElement | null>;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* State passed to the function form of the tooltip slotProps, and to the slot
|
|
87
|
+
* component itself.
|
|
88
|
+
*
|
|
89
|
+
* `displayEnd` is resolved by `Row` rather than left to the consumer because
|
|
90
|
+
* `task.endDate` is an *exclusive* instant (ADR-014): a Mon–Fri task stores
|
|
91
|
+
* Saturday midnight, so rendering it raw reads as ending on Saturday. Handing
|
|
92
|
+
* over the already-inclusive date is what stops every tooltip from reintroducing
|
|
93
|
+
* that bug.
|
|
94
|
+
*/
|
|
95
|
+
export declare interface BarTooltipOwnerState {
|
|
96
|
+
task: GanttTask;
|
|
97
|
+
/** Resolved progress, override-aware during a drag — not `task.progress`. */
|
|
98
|
+
progress: number;
|
|
99
|
+
/** Inclusive, user-facing end date. `undefined` for an instant (a milestone). */
|
|
100
|
+
displayEnd: Date | undefined;
|
|
101
|
+
/**
|
|
102
|
+
* The bar itself. The slot is a *wrapper*: it has to render this, and has to
|
|
103
|
+
* decide for itself when to show a popup beside it — there is no `open` prop,
|
|
104
|
+
* because the chart holds no open state (ADR-022). Use `BarTooltipRoot` +
|
|
105
|
+
* `BarTooltipTrigger` for the built-in hover behaviour, or a third-party
|
|
106
|
+
* tooltip's own root and trigger.
|
|
107
|
+
*/
|
|
108
|
+
children?: ReactNode;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export declare interface BarTooltipProps extends BarTooltipOwnerState {
|
|
112
|
+
/**
|
|
113
|
+
* The bar's DOM node, for a custom tooltip that wants to position against the
|
|
114
|
+
* bar rather than the cursor. `null` until the bar mounts, and also when a
|
|
115
|
+
* consumer has replaced `slots.root` with a component that does not forward
|
|
116
|
+
* refs.
|
|
117
|
+
*
|
|
118
|
+
* The built-in tooltip ignores it — it places from the cursor (ADR-022).
|
|
119
|
+
*/
|
|
120
|
+
anchorRef: RefObject<HTMLDivElement | null>;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Owns one bar tooltip's open state and publishes it to `BarTooltipTrigger` and
|
|
125
|
+
* whatever renders the popup.
|
|
126
|
+
*
|
|
127
|
+
* Belongs *inside* the tooltip slot, and a slot is free to skip it entirely and
|
|
128
|
+
* use a third-party tooltip's root instead (ADR-022).
|
|
129
|
+
*
|
|
130
|
+
* Exported for the middle case: a custom tooltip that wants the library's hover
|
|
131
|
+
* and closing behaviour with different markup. Compose it with
|
|
132
|
+
* `BarTooltipTrigger` and `useBarTooltip`.
|
|
133
|
+
*/
|
|
134
|
+
export declare function BarTooltipRoot({ anchorRef, children, }: {
|
|
135
|
+
anchorRef: RefObject<HTMLDivElement | null>;
|
|
136
|
+
children: ReactNode;
|
|
137
|
+
}): JSX.Element;
|
|
138
|
+
|
|
139
|
+
/** Slot config for the bar tooltip. */
|
|
140
|
+
export declare type BarTooltipSlotConfig = SlotConfig<BarTooltipSlots, BarTooltipSlotProps>;
|
|
141
|
+
|
|
142
|
+
export declare interface BarTooltipSlotProps {
|
|
143
|
+
tooltip?: SlotPropsInput<ComponentProps<"div">, BarTooltipOwnerState>;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
export declare interface BarTooltipSlots {
|
|
147
|
+
/**
|
|
148
|
+
* The tooltip. Default: none — nothing is rendered and the bar keeps its
|
|
149
|
+
* native `title`. Pass `GanttBarTooltip` for the built-in one, or any component
|
|
150
|
+
* accepting {@link BarTooltipProps}.
|
|
151
|
+
*/
|
|
152
|
+
tooltip?: ElementType;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* Turns the element it is given into the tooltip's trigger. Belongs inside the
|
|
157
|
+
* tooltip slot, under a `BarTooltipRoot` and wrapped around the slot's
|
|
158
|
+
* `children`: that is what makes hover behaviour the slot's own business rather
|
|
159
|
+
* than the bar's.
|
|
160
|
+
*
|
|
161
|
+
* It **merges** onto that element rather than wrapping it, which is not a style
|
|
162
|
+
* preference: the bar contains `<button>` resize and connector handles, so a
|
|
163
|
+
* wrapping trigger — Base UI's default renders a `<button>` — would nest buttons
|
|
164
|
+
* and produce invalid HTML that breaks those controls. `cloneElement` adds no DOM
|
|
165
|
+
* at all.
|
|
166
|
+
*
|
|
167
|
+
* Handlers are composed with whatever the element already has, so a consumer's
|
|
168
|
+
* `slotProps.root` handlers and the a11y payload keep firing.
|
|
169
|
+
*/
|
|
170
|
+
export declare function BarTooltipTrigger({ children }: {
|
|
171
|
+
children: ReactNode;
|
|
172
|
+
}): ReactNode;
|
|
173
|
+
|
|
61
174
|
/** Axis-aligned pixel bounds. */
|
|
62
175
|
export declare interface Bounds {
|
|
63
176
|
minX: number;
|
|
@@ -356,8 +469,30 @@ export declare interface GanttBarsSlots {
|
|
|
356
469
|
barProgressResizeHandle?: BarProgressResizeHandleSlotConfig;
|
|
357
470
|
taskResizer?: TaskResizerSlotConfig;
|
|
358
471
|
connectorHandles?: ConnectorHandlesSlotConfig;
|
|
472
|
+
/**
|
|
473
|
+
* One slot for all three bar types, rendered by `DraggableBar` so it is
|
|
474
|
+
* scoped to the bar's own hover. Empty by default: no tooltip is rendered and
|
|
475
|
+
* the bar keeps its native `title`. Note it is lost if `slots.root` is
|
|
476
|
+
* replaced, since `DraggableBar` is only the default root (ADR-022).
|
|
477
|
+
*/
|
|
478
|
+
tooltip?: BarTooltipSlotConfig;
|
|
359
479
|
}
|
|
360
480
|
|
|
481
|
+
/**
|
|
482
|
+
* The built-in bar tooltip. Opt in with `slots={{ tooltip: GanttBarTooltip }}`;
|
|
483
|
+
* it is never rendered by default.
|
|
484
|
+
*
|
|
485
|
+
* A wrapper, not a sibling: it renders the bar it is handed and mounts its own
|
|
486
|
+
* root and trigger around it, so it holds no privileged position over any other
|
|
487
|
+
* slot (ADR-022).
|
|
488
|
+
*
|
|
489
|
+
* Placed from the cursor in JS, not with CSS anchor positioning: anchoring to the
|
|
490
|
+
* bar puts the tooltip at the midpoint of a bar that can be wider than the
|
|
491
|
+
* viewport. It follows the pointer for as long as it is open; there is no dwell
|
|
492
|
+
* delay.
|
|
493
|
+
*/
|
|
494
|
+
export declare function GanttBarTooltip({ task, progress, displayEnd, anchorRef, className, style, children, ...divProps }: BarTooltipProps & ComponentProps<"div">): JSX.Element;
|
|
495
|
+
|
|
361
496
|
/**
|
|
362
497
|
* The chart's working-time calendar. Three scopes resolve in the order
|
|
363
498
|
* `dates` → `days` → `hours`, so a specific date beats a weekday rule, which
|
|
@@ -732,7 +867,7 @@ export declare function mergeSlotProps<Props extends {
|
|
|
732
867
|
style?: CSSProperties;
|
|
733
868
|
}, OwnerState>(internalProps: Props, slotProps: SlotPropsInput<Props, OwnerState> | undefined, ownerState: OwnerState): Props;
|
|
734
869
|
|
|
735
|
-
export declare function MilestoneBar({ size, centerLeft, top, colWidth, title, a11y, onMove, onMoveEnd, slots: slotsProp, slotProps: slotPropsProp, }: MilestoneBarProps): JSX.Element;
|
|
870
|
+
export declare function MilestoneBar({ size, centerLeft, top, colWidth, title, a11y, onMove, onMoveEnd, tooltip, slots: slotsProp, slotProps: slotPropsProp, }: MilestoneBarProps): JSX.Element;
|
|
736
871
|
|
|
737
872
|
export declare interface MilestoneBarOwnerState {
|
|
738
873
|
size: number;
|
|
@@ -749,6 +884,11 @@ declare interface MilestoneBarProps {
|
|
|
749
884
|
/** Editing handlers; omitted on a read-only chart (see `TaskBar`). */
|
|
750
885
|
onMove?: (newCenterLeft: number) => void;
|
|
751
886
|
onMoveEnd?: (newCenterLeft: number) => void;
|
|
887
|
+
/**
|
|
888
|
+
* Task data handed to the root so it can render the tooltip slot. Forwarded
|
|
889
|
+
* verbatim; a replaced `slots.root` that ignores it simply shows no tooltip.
|
|
890
|
+
*/
|
|
891
|
+
tooltip?: BarTooltipOwnerState;
|
|
752
892
|
slots?: MilestoneBarSlots;
|
|
753
893
|
slotProps?: MilestoneBarSlotProps;
|
|
754
894
|
}
|
|
@@ -775,7 +915,7 @@ export declare interface Point {
|
|
|
775
915
|
y: number;
|
|
776
916
|
}
|
|
777
917
|
|
|
778
|
-
export declare function ProjectBar({ width, height, left, top, colWidth, title, a11y, progress, onProgressChange, onProgressEnd, onMove, onMoveEnd, slots: slotsProp, slotProps: slotPropsProp, }: ProjectBarProps): JSX.Element;
|
|
918
|
+
export declare function ProjectBar({ width, height, left, top, colWidth, title, a11y, progress, onProgressChange, onProgressEnd, onMove, onMoveEnd, tooltip, slots: slotsProp, slotProps: slotPropsProp, }: ProjectBarProps): JSX.Element;
|
|
779
919
|
|
|
780
920
|
/** State passed to the function form of each ProjectBar slotProps. */
|
|
781
921
|
export declare interface ProjectBarOwnerState {
|
|
@@ -799,6 +939,11 @@ declare interface ProjectBarProps {
|
|
|
799
939
|
onProgressEnd?: (newProgress: number) => void;
|
|
800
940
|
onMove?: (newLeft: number) => void;
|
|
801
941
|
onMoveEnd?: (newLeft: number) => void;
|
|
942
|
+
/**
|
|
943
|
+
* Task data handed to the root so it can render the tooltip slot. Forwarded
|
|
944
|
+
* verbatim; a replaced `slots.root` that ignores it simply shows no tooltip.
|
|
945
|
+
*/
|
|
946
|
+
tooltip?: BarTooltipOwnerState;
|
|
802
947
|
slots?: ProjectBarSlots;
|
|
803
948
|
slotProps?: ProjectBarSlotProps;
|
|
804
949
|
}
|
|
@@ -859,7 +1004,7 @@ export declare interface SlotConfig<Slots, SlotProps> {
|
|
|
859
1004
|
*/
|
|
860
1005
|
export declare type SlotPropsInput<P, OwnerState> = Partial<P> | ((ownerState: OwnerState) => Partial<P>);
|
|
861
1006
|
|
|
862
|
-
export declare function TaskBar({ width, height, left, top, colWidth, title, a11y, progress, onProgressChange, onProgressEnd, onResize, onResizeEnd, onMove, onMoveEnd, slots: slotsProp, slotProps: slotPropsProp, }: TaskBarProps): JSX.Element;
|
|
1007
|
+
export declare function TaskBar({ width, height, left, top, colWidth, title, a11y, progress, onProgressChange, onProgressEnd, onResize, onResizeEnd, onMove, onMoveEnd, tooltip, slots: slotsProp, slotProps: slotPropsProp, }: TaskBarProps): JSX.Element;
|
|
863
1008
|
|
|
864
1009
|
/** State passed to the function form of each TaskBar slotProps. */
|
|
865
1010
|
export declare interface TaskBarOwnerState {
|
|
@@ -888,6 +1033,11 @@ declare interface TaskBarProps {
|
|
|
888
1033
|
onResizeEnd?: (edge: "start" | "end", edgePx: number) => void;
|
|
889
1034
|
onMove?: (newLeft: number) => void;
|
|
890
1035
|
onMoveEnd?: (newLeft: number) => void;
|
|
1036
|
+
/**
|
|
1037
|
+
* Task data handed to the root so it can render the tooltip slot. Forwarded
|
|
1038
|
+
* verbatim; a replaced `slots.root` that ignores it simply shows no tooltip.
|
|
1039
|
+
*/
|
|
1040
|
+
tooltip?: BarTooltipOwnerState;
|
|
891
1041
|
slots?: TaskBarSlots;
|
|
892
1042
|
slotProps?: TaskBarSlotProps;
|
|
893
1043
|
}
|
|
@@ -1015,6 +1165,9 @@ export declare interface TreeCellSlots {
|
|
|
1015
1165
|
placeholder?: ElementType;
|
|
1016
1166
|
}
|
|
1017
1167
|
|
|
1168
|
+
/** The enclosing `BarTooltipRoot`'s state, or `null` when there is none. */
|
|
1169
|
+
export declare const useBarTooltip: () => BarTooltipContextValue | null;
|
|
1170
|
+
|
|
1018
1171
|
export declare function useGanttReadOnly(): boolean;
|
|
1019
1172
|
|
|
1020
1173
|
/** Read the grid-side slot groups. Returns `{}` outside a provider. */
|