@art-tools/react-gantt 0.2.1 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +30 -8
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +27 -6
- package/dist/index.d.ts +27 -6
- package/dist/index.mjs +895 -801
- package/dist/index.mjs.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +3 -3
package/dist/index.d.cts
CHANGED
|
@@ -371,6 +371,8 @@ export declare interface DependencyLinkOwnerState {
|
|
|
371
371
|
link: DependencyLink;
|
|
372
372
|
/** Whether this link is currently selected. */
|
|
373
373
|
isSelected: boolean;
|
|
374
|
+
/** Whether this link is the binding edge of the critical path (ADR-023). */
|
|
375
|
+
isCritical: boolean;
|
|
374
376
|
}
|
|
375
377
|
|
|
376
378
|
/** State passed to the function form of the `layer` slotProps. */
|
|
@@ -458,7 +460,7 @@ export declare type DurationUnit = "day" | "hour" | "minute";
|
|
|
458
460
|
*/
|
|
459
461
|
export declare function endInstantFromDisplayDate(displayEnd: Date): Date;
|
|
460
462
|
|
|
461
|
-
export declare function Gantt({ tasks, dependencies, rowHeight, colWidth, height, scales, padDays, zoomLevels, defaultZoomIndex, onZoomChange, zoomWheel, zoomKeyboard, onTaskClick, columns: columnsProp, defaultTaskListWidth, onDependencyCreate, onDependencyDelete, onTaskCreate, onTaskDelete, onTaskEdit, onTasksChange, calendar, snapToWorking, durationUnit, readOnly, apiRef, hideTaskList, taskList, bars, dependencySlots, timeline, labels, }: GanttProps): JSX.Element;
|
|
463
|
+
export declare function Gantt({ tasks, dependencies, rowHeight, colWidth, height, scales, padDays, zoomLevels, defaultZoomIndex, onZoomChange, zoomWheel, zoomKeyboard, onTaskClick, columns: columnsProp, defaultTaskListWidth, onDependencyCreate, onDependencyDelete, onTaskCreate, onTaskDelete, onTaskEdit, onTasksChange, calendar, snapToWorking, durationUnit, readOnly, criticalPath, apiRef, hideTaskList, taskList, bars, dependencySlots, timeline, labels, }: GanttProps): JSX.Element;
|
|
462
464
|
|
|
463
465
|
/** Slots for the timeline bars and their handles. Delivered via context. */
|
|
464
466
|
export declare interface GanttBarsSlots {
|
|
@@ -593,6 +595,13 @@ export declare interface GanttEngineProps {
|
|
|
593
595
|
* ADR-021). Custom `columns` are yours to gate; read `api.readOnly` in `render`.
|
|
594
596
|
*/
|
|
595
597
|
readOnly?: boolean;
|
|
598
|
+
/**
|
|
599
|
+
* Highlight the critical path — the chain of tasks and dependency links that
|
|
600
|
+
* currently have zero working-time float before the chart's actual end date
|
|
601
|
+
* would move. Off by default; charts that do not set it render byte-identically
|
|
602
|
+
* to today (ADR-023).
|
|
603
|
+
*/
|
|
604
|
+
criticalPath?: boolean;
|
|
596
605
|
/** Receives the imperative API: `apiRef.current.createTask(...)`, `.undo()`, etc. */
|
|
597
606
|
apiRef?: default_2.Ref<GanttHandle>;
|
|
598
607
|
/**
|
|
@@ -698,7 +707,7 @@ export declare interface GanttProps extends GanttEngineProps {
|
|
|
698
707
|
|
|
699
708
|
/**
|
|
700
709
|
* The composition root: owns every piece of chart state and publishes it through
|
|
701
|
-
* the
|
|
710
|
+
* the fourteen contexts defined in `contexts.ts`.
|
|
702
711
|
*
|
|
703
712
|
* The provider nesting at the bottom is ordered stable-outermost, hottest-inside,
|
|
704
713
|
* mirroring the cadence table in `contexts.ts`. That order is not load-bearing
|
|
@@ -707,7 +716,7 @@ export declare interface GanttProps extends GanttEngineProps {
|
|
|
707
716
|
* *becomes* load-bearing the moment a layer starts reading another context. Keep
|
|
708
717
|
* it.
|
|
709
718
|
*/
|
|
710
|
-
export declare function GanttProvider({ tasks, rowHeight, colWidth, height, scales, padDays, zoomLevels, defaultZoomIndex, onZoomChange, zoomWheel, zoomKeyboard, dependencies, onTaskClick, onDependencyCreate, onDependencyDelete, onTaskCreate: onTaskCreateProp, onTaskDelete, onTaskEdit, onTasksChange, apiRef, labels, calendar, snapToWorking, durationUnit, readOnly, children, }: GanttProviderProps): JSX.Element;
|
|
719
|
+
export declare function GanttProvider({ tasks, rowHeight, colWidth, height, scales, padDays, zoomLevels, defaultZoomIndex, onZoomChange, zoomWheel, zoomKeyboard, dependencies, onTaskClick, onDependencyCreate, onDependencyDelete, onTaskCreate: onTaskCreateProp, onTaskDelete, onTaskEdit, onTasksChange, apiRef, labels, calendar, snapToWorking, durationUnit, readOnly, criticalPath: highlightCriticalPath, children, }: GanttProviderProps): JSX.Element;
|
|
711
720
|
|
|
712
721
|
/** Props of the composable `<GanttProvider>`: the engine plus its subtree. */
|
|
713
722
|
export declare interface GanttProviderProps extends GanttEngineProps {
|
|
@@ -867,11 +876,13 @@ export declare function mergeSlotProps<Props extends {
|
|
|
867
876
|
style?: CSSProperties;
|
|
868
877
|
}, OwnerState>(internalProps: Props, slotProps: SlotPropsInput<Props, OwnerState> | undefined, ownerState: OwnerState): Props;
|
|
869
878
|
|
|
870
|
-
export declare function MilestoneBar({ size, centerLeft, top, colWidth, title, a11y, onMove, onMoveEnd, tooltip, slots: slotsProp, slotProps: slotPropsProp, }: MilestoneBarProps): JSX.Element;
|
|
879
|
+
export declare function MilestoneBar({ size, centerLeft, top, colWidth, title, a11y, onMove, onMoveEnd, tooltip, isCritical, slots: slotsProp, slotProps: slotPropsProp, }: MilestoneBarProps): JSX.Element;
|
|
871
880
|
|
|
872
881
|
export declare interface MilestoneBarOwnerState {
|
|
873
882
|
size: number;
|
|
874
883
|
title: string;
|
|
884
|
+
/** Whether this bar is on the critical path (ADR-023). */
|
|
885
|
+
isCritical: boolean;
|
|
875
886
|
}
|
|
876
887
|
|
|
877
888
|
declare interface MilestoneBarProps {
|
|
@@ -889,6 +900,8 @@ declare interface MilestoneBarProps {
|
|
|
889
900
|
* verbatim; a replaced `slots.root` that ignores it simply shows no tooltip.
|
|
890
901
|
*/
|
|
891
902
|
tooltip?: BarTooltipOwnerState;
|
|
903
|
+
/** Whether this bar is on the critical path (ADR-023). Defaults to `false`. */
|
|
904
|
+
isCritical?: boolean;
|
|
892
905
|
slots?: MilestoneBarSlots;
|
|
893
906
|
slotProps?: MilestoneBarSlotProps;
|
|
894
907
|
}
|
|
@@ -915,7 +928,7 @@ export declare interface Point {
|
|
|
915
928
|
y: number;
|
|
916
929
|
}
|
|
917
930
|
|
|
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;
|
|
931
|
+
export declare function ProjectBar({ width, height, left, top, colWidth, title, a11y, progress, onProgressChange, onProgressEnd, onMove, onMoveEnd, tooltip, isCritical, slots: slotsProp, slotProps: slotPropsProp, }: ProjectBarProps): JSX.Element;
|
|
919
932
|
|
|
920
933
|
/** State passed to the function form of each ProjectBar slotProps. */
|
|
921
934
|
export declare interface ProjectBarOwnerState {
|
|
@@ -923,6 +936,8 @@ export declare interface ProjectBarOwnerState {
|
|
|
923
936
|
height: number;
|
|
924
937
|
progress: number;
|
|
925
938
|
title: string;
|
|
939
|
+
/** Whether this bar is on the critical path (ADR-023). */
|
|
940
|
+
isCritical: boolean;
|
|
926
941
|
}
|
|
927
942
|
|
|
928
943
|
declare interface ProjectBarProps {
|
|
@@ -944,6 +959,8 @@ declare interface ProjectBarProps {
|
|
|
944
959
|
* verbatim; a replaced `slots.root` that ignores it simply shows no tooltip.
|
|
945
960
|
*/
|
|
946
961
|
tooltip?: BarTooltipOwnerState;
|
|
962
|
+
/** Whether this bar is on the critical path (ADR-023). Defaults to `false`. */
|
|
963
|
+
isCritical?: boolean;
|
|
947
964
|
slots?: ProjectBarSlots;
|
|
948
965
|
slotProps?: ProjectBarSlotProps;
|
|
949
966
|
}
|
|
@@ -1004,7 +1021,7 @@ export declare interface SlotConfig<Slots, SlotProps> {
|
|
|
1004
1021
|
*/
|
|
1005
1022
|
export declare type SlotPropsInput<P, OwnerState> = Partial<P> | ((ownerState: OwnerState) => Partial<P>);
|
|
1006
1023
|
|
|
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;
|
|
1024
|
+
export declare function TaskBar({ width, height, left, top, colWidth, title, a11y, progress, onProgressChange, onProgressEnd, onResize, onResizeEnd, onMove, onMoveEnd, tooltip, isCritical, slots: slotsProp, slotProps: slotPropsProp, }: TaskBarProps): JSX.Element;
|
|
1008
1025
|
|
|
1009
1026
|
/** State passed to the function form of each TaskBar slotProps. */
|
|
1010
1027
|
export declare interface TaskBarOwnerState {
|
|
@@ -1012,6 +1029,8 @@ export declare interface TaskBarOwnerState {
|
|
|
1012
1029
|
height: number;
|
|
1013
1030
|
progress: number;
|
|
1014
1031
|
title: string;
|
|
1032
|
+
/** Whether this bar is on the critical path (ADR-023). */
|
|
1033
|
+
isCritical: boolean;
|
|
1015
1034
|
}
|
|
1016
1035
|
|
|
1017
1036
|
declare interface TaskBarProps {
|
|
@@ -1038,6 +1057,8 @@ declare interface TaskBarProps {
|
|
|
1038
1057
|
* verbatim; a replaced `slots.root` that ignores it simply shows no tooltip.
|
|
1039
1058
|
*/
|
|
1040
1059
|
tooltip?: BarTooltipOwnerState;
|
|
1060
|
+
/** Whether this bar is on the critical path (ADR-023). Defaults to `false`. */
|
|
1061
|
+
isCritical?: boolean;
|
|
1041
1062
|
slots?: TaskBarSlots;
|
|
1042
1063
|
slotProps?: TaskBarSlotProps;
|
|
1043
1064
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -371,6 +371,8 @@ export declare interface DependencyLinkOwnerState {
|
|
|
371
371
|
link: DependencyLink;
|
|
372
372
|
/** Whether this link is currently selected. */
|
|
373
373
|
isSelected: boolean;
|
|
374
|
+
/** Whether this link is the binding edge of the critical path (ADR-023). */
|
|
375
|
+
isCritical: boolean;
|
|
374
376
|
}
|
|
375
377
|
|
|
376
378
|
/** State passed to the function form of the `layer` slotProps. */
|
|
@@ -458,7 +460,7 @@ export declare type DurationUnit = "day" | "hour" | "minute";
|
|
|
458
460
|
*/
|
|
459
461
|
export declare function endInstantFromDisplayDate(displayEnd: Date): Date;
|
|
460
462
|
|
|
461
|
-
export declare function Gantt({ tasks, dependencies, rowHeight, colWidth, height, scales, padDays, zoomLevels, defaultZoomIndex, onZoomChange, zoomWheel, zoomKeyboard, onTaskClick, columns: columnsProp, defaultTaskListWidth, onDependencyCreate, onDependencyDelete, onTaskCreate, onTaskDelete, onTaskEdit, onTasksChange, calendar, snapToWorking, durationUnit, readOnly, apiRef, hideTaskList, taskList, bars, dependencySlots, timeline, labels, }: GanttProps): JSX.Element;
|
|
463
|
+
export declare function Gantt({ tasks, dependencies, rowHeight, colWidth, height, scales, padDays, zoomLevels, defaultZoomIndex, onZoomChange, zoomWheel, zoomKeyboard, onTaskClick, columns: columnsProp, defaultTaskListWidth, onDependencyCreate, onDependencyDelete, onTaskCreate, onTaskDelete, onTaskEdit, onTasksChange, calendar, snapToWorking, durationUnit, readOnly, criticalPath, apiRef, hideTaskList, taskList, bars, dependencySlots, timeline, labels, }: GanttProps): JSX.Element;
|
|
462
464
|
|
|
463
465
|
/** Slots for the timeline bars and their handles. Delivered via context. */
|
|
464
466
|
export declare interface GanttBarsSlots {
|
|
@@ -593,6 +595,13 @@ export declare interface GanttEngineProps {
|
|
|
593
595
|
* ADR-021). Custom `columns` are yours to gate; read `api.readOnly` in `render`.
|
|
594
596
|
*/
|
|
595
597
|
readOnly?: boolean;
|
|
598
|
+
/**
|
|
599
|
+
* Highlight the critical path — the chain of tasks and dependency links that
|
|
600
|
+
* currently have zero working-time float before the chart's actual end date
|
|
601
|
+
* would move. Off by default; charts that do not set it render byte-identically
|
|
602
|
+
* to today (ADR-023).
|
|
603
|
+
*/
|
|
604
|
+
criticalPath?: boolean;
|
|
596
605
|
/** Receives the imperative API: `apiRef.current.createTask(...)`, `.undo()`, etc. */
|
|
597
606
|
apiRef?: default_2.Ref<GanttHandle>;
|
|
598
607
|
/**
|
|
@@ -698,7 +707,7 @@ export declare interface GanttProps extends GanttEngineProps {
|
|
|
698
707
|
|
|
699
708
|
/**
|
|
700
709
|
* The composition root: owns every piece of chart state and publishes it through
|
|
701
|
-
* the
|
|
710
|
+
* the fourteen contexts defined in `contexts.ts`.
|
|
702
711
|
*
|
|
703
712
|
* The provider nesting at the bottom is ordered stable-outermost, hottest-inside,
|
|
704
713
|
* mirroring the cadence table in `contexts.ts`. That order is not load-bearing
|
|
@@ -707,7 +716,7 @@ export declare interface GanttProps extends GanttEngineProps {
|
|
|
707
716
|
* *becomes* load-bearing the moment a layer starts reading another context. Keep
|
|
708
717
|
* it.
|
|
709
718
|
*/
|
|
710
|
-
export declare function GanttProvider({ tasks, rowHeight, colWidth, height, scales, padDays, zoomLevels, defaultZoomIndex, onZoomChange, zoomWheel, zoomKeyboard, dependencies, onTaskClick, onDependencyCreate, onDependencyDelete, onTaskCreate: onTaskCreateProp, onTaskDelete, onTaskEdit, onTasksChange, apiRef, labels, calendar, snapToWorking, durationUnit, readOnly, children, }: GanttProviderProps): JSX.Element;
|
|
719
|
+
export declare function GanttProvider({ tasks, rowHeight, colWidth, height, scales, padDays, zoomLevels, defaultZoomIndex, onZoomChange, zoomWheel, zoomKeyboard, dependencies, onTaskClick, onDependencyCreate, onDependencyDelete, onTaskCreate: onTaskCreateProp, onTaskDelete, onTaskEdit, onTasksChange, apiRef, labels, calendar, snapToWorking, durationUnit, readOnly, criticalPath: highlightCriticalPath, children, }: GanttProviderProps): JSX.Element;
|
|
711
720
|
|
|
712
721
|
/** Props of the composable `<GanttProvider>`: the engine plus its subtree. */
|
|
713
722
|
export declare interface GanttProviderProps extends GanttEngineProps {
|
|
@@ -867,11 +876,13 @@ export declare function mergeSlotProps<Props extends {
|
|
|
867
876
|
style?: CSSProperties;
|
|
868
877
|
}, OwnerState>(internalProps: Props, slotProps: SlotPropsInput<Props, OwnerState> | undefined, ownerState: OwnerState): Props;
|
|
869
878
|
|
|
870
|
-
export declare function MilestoneBar({ size, centerLeft, top, colWidth, title, a11y, onMove, onMoveEnd, tooltip, slots: slotsProp, slotProps: slotPropsProp, }: MilestoneBarProps): JSX.Element;
|
|
879
|
+
export declare function MilestoneBar({ size, centerLeft, top, colWidth, title, a11y, onMove, onMoveEnd, tooltip, isCritical, slots: slotsProp, slotProps: slotPropsProp, }: MilestoneBarProps): JSX.Element;
|
|
871
880
|
|
|
872
881
|
export declare interface MilestoneBarOwnerState {
|
|
873
882
|
size: number;
|
|
874
883
|
title: string;
|
|
884
|
+
/** Whether this bar is on the critical path (ADR-023). */
|
|
885
|
+
isCritical: boolean;
|
|
875
886
|
}
|
|
876
887
|
|
|
877
888
|
declare interface MilestoneBarProps {
|
|
@@ -889,6 +900,8 @@ declare interface MilestoneBarProps {
|
|
|
889
900
|
* verbatim; a replaced `slots.root` that ignores it simply shows no tooltip.
|
|
890
901
|
*/
|
|
891
902
|
tooltip?: BarTooltipOwnerState;
|
|
903
|
+
/** Whether this bar is on the critical path (ADR-023). Defaults to `false`. */
|
|
904
|
+
isCritical?: boolean;
|
|
892
905
|
slots?: MilestoneBarSlots;
|
|
893
906
|
slotProps?: MilestoneBarSlotProps;
|
|
894
907
|
}
|
|
@@ -915,7 +928,7 @@ export declare interface Point {
|
|
|
915
928
|
y: number;
|
|
916
929
|
}
|
|
917
930
|
|
|
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;
|
|
931
|
+
export declare function ProjectBar({ width, height, left, top, colWidth, title, a11y, progress, onProgressChange, onProgressEnd, onMove, onMoveEnd, tooltip, isCritical, slots: slotsProp, slotProps: slotPropsProp, }: ProjectBarProps): JSX.Element;
|
|
919
932
|
|
|
920
933
|
/** State passed to the function form of each ProjectBar slotProps. */
|
|
921
934
|
export declare interface ProjectBarOwnerState {
|
|
@@ -923,6 +936,8 @@ export declare interface ProjectBarOwnerState {
|
|
|
923
936
|
height: number;
|
|
924
937
|
progress: number;
|
|
925
938
|
title: string;
|
|
939
|
+
/** Whether this bar is on the critical path (ADR-023). */
|
|
940
|
+
isCritical: boolean;
|
|
926
941
|
}
|
|
927
942
|
|
|
928
943
|
declare interface ProjectBarProps {
|
|
@@ -944,6 +959,8 @@ declare interface ProjectBarProps {
|
|
|
944
959
|
* verbatim; a replaced `slots.root` that ignores it simply shows no tooltip.
|
|
945
960
|
*/
|
|
946
961
|
tooltip?: BarTooltipOwnerState;
|
|
962
|
+
/** Whether this bar is on the critical path (ADR-023). Defaults to `false`. */
|
|
963
|
+
isCritical?: boolean;
|
|
947
964
|
slots?: ProjectBarSlots;
|
|
948
965
|
slotProps?: ProjectBarSlotProps;
|
|
949
966
|
}
|
|
@@ -1004,7 +1021,7 @@ export declare interface SlotConfig<Slots, SlotProps> {
|
|
|
1004
1021
|
*/
|
|
1005
1022
|
export declare type SlotPropsInput<P, OwnerState> = Partial<P> | ((ownerState: OwnerState) => Partial<P>);
|
|
1006
1023
|
|
|
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;
|
|
1024
|
+
export declare function TaskBar({ width, height, left, top, colWidth, title, a11y, progress, onProgressChange, onProgressEnd, onResize, onResizeEnd, onMove, onMoveEnd, tooltip, isCritical, slots: slotsProp, slotProps: slotPropsProp, }: TaskBarProps): JSX.Element;
|
|
1008
1025
|
|
|
1009
1026
|
/** State passed to the function form of each TaskBar slotProps. */
|
|
1010
1027
|
export declare interface TaskBarOwnerState {
|
|
@@ -1012,6 +1029,8 @@ export declare interface TaskBarOwnerState {
|
|
|
1012
1029
|
height: number;
|
|
1013
1030
|
progress: number;
|
|
1014
1031
|
title: string;
|
|
1032
|
+
/** Whether this bar is on the critical path (ADR-023). */
|
|
1033
|
+
isCritical: boolean;
|
|
1015
1034
|
}
|
|
1016
1035
|
|
|
1017
1036
|
declare interface TaskBarProps {
|
|
@@ -1038,6 +1057,8 @@ declare interface TaskBarProps {
|
|
|
1038
1057
|
* verbatim; a replaced `slots.root` that ignores it simply shows no tooltip.
|
|
1039
1058
|
*/
|
|
1040
1059
|
tooltip?: BarTooltipOwnerState;
|
|
1060
|
+
/** Whether this bar is on the critical path (ADR-023). Defaults to `false`. */
|
|
1061
|
+
isCritical?: boolean;
|
|
1041
1062
|
slots?: TaskBarSlots;
|
|
1042
1063
|
slotProps?: TaskBarSlotProps;
|
|
1043
1064
|
}
|