gantt-lib 0.104.2 → 0.105.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/index.css.map +1 -1
- package/dist/index.d.mts +31 -17
- package/dist/index.d.ts +31 -17
- package/dist/index.js +289 -84
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +288 -84
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +85 -2
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -519,6 +519,8 @@ interface TaskChartSharedProps<TTask extends Task = Task> {
|
|
|
519
519
|
onInsertAfter?: (taskId: string, newTask: TTask) => void;
|
|
520
520
|
/** Callback when tasks are reordered via drag in the task list */
|
|
521
521
|
onReorder?: (tasks: TTask[], movedTaskId?: string, inferredParentId?: string) => void;
|
|
522
|
+
/** Disable row reorder and drag handle inside the task list (default: false) */
|
|
523
|
+
disableTaskListReorder?: boolean;
|
|
522
524
|
/** Callback when a task is promoted (parentId removed). If not provided, default internal logic is used. */
|
|
523
525
|
onPromoteTask?: (taskId: string) => void;
|
|
524
526
|
/** Callback when a task is demoted (parentId set). If not provided, default internal logic is used. */
|
|
@@ -853,6 +855,8 @@ interface TaskListProps {
|
|
|
853
855
|
onReorder?: (tasks: Task[], movedTaskId?: string, inferredParentId?: string) => void;
|
|
854
856
|
/** Disable task row drag/reorder in the task list (default: false) */
|
|
855
857
|
disableTaskDrag?: boolean;
|
|
858
|
+
/** Disable row reorder and drag handle inside the task list (default: false) */
|
|
859
|
+
disableTaskListReorder?: boolean;
|
|
856
860
|
/** ID of task that should enter edit mode on mount (for auto-edit after insert) */
|
|
857
861
|
editingTaskId?: string | null;
|
|
858
862
|
/** Enable add task button at bottom of task list (default: true) */
|
|
@@ -918,6 +922,32 @@ interface TaskListProps {
|
|
|
918
922
|
*/
|
|
919
923
|
declare const TaskList: React$1.FC<TaskListProps>;
|
|
920
924
|
|
|
925
|
+
type TaskLike = {
|
|
926
|
+
id: string;
|
|
927
|
+
parentId?: string;
|
|
928
|
+
};
|
|
929
|
+
type ReorderDropPlacement = 'before' | 'inside' | 'after' | 'end';
|
|
930
|
+
interface ReorderDropTarget {
|
|
931
|
+
index: number;
|
|
932
|
+
placement: ReorderDropPlacement;
|
|
933
|
+
}
|
|
934
|
+
interface VisibleReorderPosition {
|
|
935
|
+
originOrderedIndex: number;
|
|
936
|
+
insertIndex: number;
|
|
937
|
+
}
|
|
938
|
+
interface VisibleReorderPlan extends VisibleReorderPosition {
|
|
939
|
+
inferredParentId?: string;
|
|
940
|
+
}
|
|
941
|
+
/**
|
|
942
|
+
* Map visible drag/drop positions to indices in the full ordered task list.
|
|
943
|
+
* This keeps collapsed descendants attached to their parent row.
|
|
944
|
+
*
|
|
945
|
+
* When dragging a parent task, all its descendants are included in the move,
|
|
946
|
+
* so they are all filtered out before calculating the insert position.
|
|
947
|
+
*/
|
|
948
|
+
declare function getVisibleReorderPosition(orderedTasks: TaskLike[], visibleTasks: TaskLike[], movedTaskId: string, originVisibleIndex: number, dropVisibleIndex: number): VisibleReorderPosition | null;
|
|
949
|
+
declare function getVisibleReorderPlan(orderedTasks: TaskLike[], visibleTasks: TaskLike[], movedTaskId: string, target: ReorderDropTarget): VisibleReorderPlan | null;
|
|
950
|
+
|
|
921
951
|
interface InputProps extends React$1.InputHTMLAttributes<HTMLInputElement> {
|
|
922
952
|
/** Additional CSS class names */
|
|
923
953
|
className?: string;
|
|
@@ -1390,20 +1420,4 @@ interface ResourceTimelineLayoutResult<TItem extends ResourceTimelineItem = Reso
|
|
|
1390
1420
|
}
|
|
1391
1421
|
declare const layoutResourceTimelineItems: <TItem extends ResourceTimelineItem = ResourceTimelineItem>(resources: Array<ResourceTimelineResource<TItem>>, options: ResourceTimelineLayoutOptions) => ResourceTimelineLayoutResult<TItem>;
|
|
1392
1422
|
|
|
1393
|
-
type
|
|
1394
|
-
id: string;
|
|
1395
|
-
};
|
|
1396
|
-
interface VisibleReorderPosition {
|
|
1397
|
-
originOrderedIndex: number;
|
|
1398
|
-
insertIndex: number;
|
|
1399
|
-
}
|
|
1400
|
-
/**
|
|
1401
|
-
* Map visible drag/drop positions to indices in the full ordered task list.
|
|
1402
|
-
* This keeps collapsed descendants attached to their parent row.
|
|
1403
|
-
*
|
|
1404
|
-
* When dragging a parent task, all its descendants are included in the move,
|
|
1405
|
-
* so they are all filtered out before calculating the insert position.
|
|
1406
|
-
*/
|
|
1407
|
-
declare function getVisibleReorderPosition(orderedTasks: TaskLike[], visibleTasks: TaskLike[], movedTaskId: string, originVisibleIndex: number, dropVisibleIndex: number): VisibleReorderPosition | null;
|
|
1408
|
-
|
|
1409
|
-
export { type BuiltInTaskListColumnId, Button, type ButtonProps, Calendar, type CalendarProps, type CustomDayConfig, type CustomDayPredicateConfig, DatePicker, type DatePickerProps, DragGuideLines, type ExportToPdfHeaderOptions, type ExportToPdfOptions, GanttChart, type GanttChartHandle, type GanttChartProps, type GanttModeProps, GridBackground, Input, type InputProps, type MonthBlock, Popover, PopoverContent, type PopoverContentProps, type PopoverProps, PopoverTrigger, ResourcePlannerChartProps, ResourceTimelineChart, type ResourceTimelineConflictRange, ResourceTimelineItem, type ResourceTimelineLayoutDiagnostic, type ResourceTimelineLayoutItem, type ResourceTimelineLayoutOptions, type ResourceTimelineLayoutResult, type ResourceTimelineLayoutRow, ResourceTimelineResource, TableMatrix, type TableMatrixCellClickContext, type TableMatrixColumn, type TableMatrixColumnGroup, type TableMatrixDateOverlay, type TableMatrixModeProps, type Task, TaskDateChangeMode, type TaskDependency, TaskList, type TaskListColumn, type TaskListColumnContext, type TaskListColumnId, type TaskListColumnWidthMap, type TaskListMenuCommand, type TaskListProps, type TaskPredicate, TaskRow, TimeScaleHeader, TodayIndicator, ValidationResult, type VisibleReorderPosition, type WeekBlock, type WeekSpan, type WithoutDepsOptions, type YearSpan, addBusinessDays, and, calculateBezierPath, calculateDependencyPath, calculateGridLines, calculateGridWidth, calculateMilestoneConnectionBounds, calculateMilestoneGeometry, calculateMonthGridLines, calculateOrthogonalPath, calculateTaskBar, calculateWeekGridLines, calculateWeekendBlocks, clampDateRangeForIncomingFS, createCustomDayPredicate, createDateKey, detectEdgeZone, expired, flattenHierarchy, formatDateLabel, formatDateRangeLabel, getBusinessDaysCount, getCursorForPosition, getDayOffset, getMonthBlocks, getMonthDays, getMonthSpans, getMultiMonthDays, getVisibleReorderPosition, getWeekBlocks, getWeekSpans, getYearSpans, inDateRange, isTaskExpired, isToday, isWeekend, layoutResourceTimelineItems, nameContains, normalizeHierarchyTasks, normalizeTaskDates, not, or, parseUTCDate, pixelsToDate, progressInRange, resolveDateRangeFromPixels, resolveTaskHorizontalGeometry, subtractBusinessDays, useTaskDrag, withoutDeps };
|
|
1423
|
+
export { type BuiltInTaskListColumnId, Button, type ButtonProps, Calendar, type CalendarProps, type CustomDayConfig, type CustomDayPredicateConfig, DatePicker, type DatePickerProps, DragGuideLines, type ExportToPdfHeaderOptions, type ExportToPdfOptions, GanttChart, type GanttChartHandle, type GanttChartProps, type GanttModeProps, GridBackground, Input, type InputProps, type MonthBlock, Popover, PopoverContent, type PopoverContentProps, type PopoverProps, PopoverTrigger, type ReorderDropPlacement, type ReorderDropTarget, ResourcePlannerChartProps, ResourceTimelineChart, type ResourceTimelineConflictRange, ResourceTimelineItem, type ResourceTimelineLayoutDiagnostic, type ResourceTimelineLayoutItem, type ResourceTimelineLayoutOptions, type ResourceTimelineLayoutResult, type ResourceTimelineLayoutRow, ResourceTimelineResource, TableMatrix, type TableMatrixCellClickContext, type TableMatrixColumn, type TableMatrixColumnGroup, type TableMatrixDateOverlay, type TableMatrixModeProps, type Task, TaskDateChangeMode, type TaskDependency, TaskList, type TaskListColumn, type TaskListColumnContext, type TaskListColumnId, type TaskListColumnWidthMap, type TaskListMenuCommand, type TaskListProps, type TaskPredicate, TaskRow, TimeScaleHeader, TodayIndicator, ValidationResult, type VisibleReorderPlan, type VisibleReorderPosition, type WeekBlock, type WeekSpan, type WithoutDepsOptions, type YearSpan, addBusinessDays, and, calculateBezierPath, calculateDependencyPath, calculateGridLines, calculateGridWidth, calculateMilestoneConnectionBounds, calculateMilestoneGeometry, calculateMonthGridLines, calculateOrthogonalPath, calculateTaskBar, calculateWeekGridLines, calculateWeekendBlocks, clampDateRangeForIncomingFS, createCustomDayPredicate, createDateKey, detectEdgeZone, expired, flattenHierarchy, formatDateLabel, formatDateRangeLabel, getBusinessDaysCount, getCursorForPosition, getDayOffset, getMonthBlocks, getMonthDays, getMonthSpans, getMultiMonthDays, getVisibleReorderPlan, getVisibleReorderPosition, getWeekBlocks, getWeekSpans, getYearSpans, inDateRange, isTaskExpired, isToday, isWeekend, layoutResourceTimelineItems, nameContains, normalizeHierarchyTasks, normalizeTaskDates, not, or, parseUTCDate, pixelsToDate, progressInRange, resolveDateRangeFromPixels, resolveTaskHorizontalGeometry, subtractBusinessDays, useTaskDrag, withoutDeps };
|
package/dist/index.d.ts
CHANGED
|
@@ -519,6 +519,8 @@ interface TaskChartSharedProps<TTask extends Task = Task> {
|
|
|
519
519
|
onInsertAfter?: (taskId: string, newTask: TTask) => void;
|
|
520
520
|
/** Callback when tasks are reordered via drag in the task list */
|
|
521
521
|
onReorder?: (tasks: TTask[], movedTaskId?: string, inferredParentId?: string) => void;
|
|
522
|
+
/** Disable row reorder and drag handle inside the task list (default: false) */
|
|
523
|
+
disableTaskListReorder?: boolean;
|
|
522
524
|
/** Callback when a task is promoted (parentId removed). If not provided, default internal logic is used. */
|
|
523
525
|
onPromoteTask?: (taskId: string) => void;
|
|
524
526
|
/** Callback when a task is demoted (parentId set). If not provided, default internal logic is used. */
|
|
@@ -853,6 +855,8 @@ interface TaskListProps {
|
|
|
853
855
|
onReorder?: (tasks: Task[], movedTaskId?: string, inferredParentId?: string) => void;
|
|
854
856
|
/** Disable task row drag/reorder in the task list (default: false) */
|
|
855
857
|
disableTaskDrag?: boolean;
|
|
858
|
+
/** Disable row reorder and drag handle inside the task list (default: false) */
|
|
859
|
+
disableTaskListReorder?: boolean;
|
|
856
860
|
/** ID of task that should enter edit mode on mount (for auto-edit after insert) */
|
|
857
861
|
editingTaskId?: string | null;
|
|
858
862
|
/** Enable add task button at bottom of task list (default: true) */
|
|
@@ -918,6 +922,32 @@ interface TaskListProps {
|
|
|
918
922
|
*/
|
|
919
923
|
declare const TaskList: React$1.FC<TaskListProps>;
|
|
920
924
|
|
|
925
|
+
type TaskLike = {
|
|
926
|
+
id: string;
|
|
927
|
+
parentId?: string;
|
|
928
|
+
};
|
|
929
|
+
type ReorderDropPlacement = 'before' | 'inside' | 'after' | 'end';
|
|
930
|
+
interface ReorderDropTarget {
|
|
931
|
+
index: number;
|
|
932
|
+
placement: ReorderDropPlacement;
|
|
933
|
+
}
|
|
934
|
+
interface VisibleReorderPosition {
|
|
935
|
+
originOrderedIndex: number;
|
|
936
|
+
insertIndex: number;
|
|
937
|
+
}
|
|
938
|
+
interface VisibleReorderPlan extends VisibleReorderPosition {
|
|
939
|
+
inferredParentId?: string;
|
|
940
|
+
}
|
|
941
|
+
/**
|
|
942
|
+
* Map visible drag/drop positions to indices in the full ordered task list.
|
|
943
|
+
* This keeps collapsed descendants attached to their parent row.
|
|
944
|
+
*
|
|
945
|
+
* When dragging a parent task, all its descendants are included in the move,
|
|
946
|
+
* so they are all filtered out before calculating the insert position.
|
|
947
|
+
*/
|
|
948
|
+
declare function getVisibleReorderPosition(orderedTasks: TaskLike[], visibleTasks: TaskLike[], movedTaskId: string, originVisibleIndex: number, dropVisibleIndex: number): VisibleReorderPosition | null;
|
|
949
|
+
declare function getVisibleReorderPlan(orderedTasks: TaskLike[], visibleTasks: TaskLike[], movedTaskId: string, target: ReorderDropTarget): VisibleReorderPlan | null;
|
|
950
|
+
|
|
921
951
|
interface InputProps extends React$1.InputHTMLAttributes<HTMLInputElement> {
|
|
922
952
|
/** Additional CSS class names */
|
|
923
953
|
className?: string;
|
|
@@ -1390,20 +1420,4 @@ interface ResourceTimelineLayoutResult<TItem extends ResourceTimelineItem = Reso
|
|
|
1390
1420
|
}
|
|
1391
1421
|
declare const layoutResourceTimelineItems: <TItem extends ResourceTimelineItem = ResourceTimelineItem>(resources: Array<ResourceTimelineResource<TItem>>, options: ResourceTimelineLayoutOptions) => ResourceTimelineLayoutResult<TItem>;
|
|
1392
1422
|
|
|
1393
|
-
type
|
|
1394
|
-
id: string;
|
|
1395
|
-
};
|
|
1396
|
-
interface VisibleReorderPosition {
|
|
1397
|
-
originOrderedIndex: number;
|
|
1398
|
-
insertIndex: number;
|
|
1399
|
-
}
|
|
1400
|
-
/**
|
|
1401
|
-
* Map visible drag/drop positions to indices in the full ordered task list.
|
|
1402
|
-
* This keeps collapsed descendants attached to their parent row.
|
|
1403
|
-
*
|
|
1404
|
-
* When dragging a parent task, all its descendants are included in the move,
|
|
1405
|
-
* so they are all filtered out before calculating the insert position.
|
|
1406
|
-
*/
|
|
1407
|
-
declare function getVisibleReorderPosition(orderedTasks: TaskLike[], visibleTasks: TaskLike[], movedTaskId: string, originVisibleIndex: number, dropVisibleIndex: number): VisibleReorderPosition | null;
|
|
1408
|
-
|
|
1409
|
-
export { type BuiltInTaskListColumnId, Button, type ButtonProps, Calendar, type CalendarProps, type CustomDayConfig, type CustomDayPredicateConfig, DatePicker, type DatePickerProps, DragGuideLines, type ExportToPdfHeaderOptions, type ExportToPdfOptions, GanttChart, type GanttChartHandle, type GanttChartProps, type GanttModeProps, GridBackground, Input, type InputProps, type MonthBlock, Popover, PopoverContent, type PopoverContentProps, type PopoverProps, PopoverTrigger, ResourcePlannerChartProps, ResourceTimelineChart, type ResourceTimelineConflictRange, ResourceTimelineItem, type ResourceTimelineLayoutDiagnostic, type ResourceTimelineLayoutItem, type ResourceTimelineLayoutOptions, type ResourceTimelineLayoutResult, type ResourceTimelineLayoutRow, ResourceTimelineResource, TableMatrix, type TableMatrixCellClickContext, type TableMatrixColumn, type TableMatrixColumnGroup, type TableMatrixDateOverlay, type TableMatrixModeProps, type Task, TaskDateChangeMode, type TaskDependency, TaskList, type TaskListColumn, type TaskListColumnContext, type TaskListColumnId, type TaskListColumnWidthMap, type TaskListMenuCommand, type TaskListProps, type TaskPredicate, TaskRow, TimeScaleHeader, TodayIndicator, ValidationResult, type VisibleReorderPosition, type WeekBlock, type WeekSpan, type WithoutDepsOptions, type YearSpan, addBusinessDays, and, calculateBezierPath, calculateDependencyPath, calculateGridLines, calculateGridWidth, calculateMilestoneConnectionBounds, calculateMilestoneGeometry, calculateMonthGridLines, calculateOrthogonalPath, calculateTaskBar, calculateWeekGridLines, calculateWeekendBlocks, clampDateRangeForIncomingFS, createCustomDayPredicate, createDateKey, detectEdgeZone, expired, flattenHierarchy, formatDateLabel, formatDateRangeLabel, getBusinessDaysCount, getCursorForPosition, getDayOffset, getMonthBlocks, getMonthDays, getMonthSpans, getMultiMonthDays, getVisibleReorderPosition, getWeekBlocks, getWeekSpans, getYearSpans, inDateRange, isTaskExpired, isToday, isWeekend, layoutResourceTimelineItems, nameContains, normalizeHierarchyTasks, normalizeTaskDates, not, or, parseUTCDate, pixelsToDate, progressInRange, resolveDateRangeFromPixels, resolveTaskHorizontalGeometry, subtractBusinessDays, useTaskDrag, withoutDeps };
|
|
1423
|
+
export { type BuiltInTaskListColumnId, Button, type ButtonProps, Calendar, type CalendarProps, type CustomDayConfig, type CustomDayPredicateConfig, DatePicker, type DatePickerProps, DragGuideLines, type ExportToPdfHeaderOptions, type ExportToPdfOptions, GanttChart, type GanttChartHandle, type GanttChartProps, type GanttModeProps, GridBackground, Input, type InputProps, type MonthBlock, Popover, PopoverContent, type PopoverContentProps, type PopoverProps, PopoverTrigger, type ReorderDropPlacement, type ReorderDropTarget, ResourcePlannerChartProps, ResourceTimelineChart, type ResourceTimelineConflictRange, ResourceTimelineItem, type ResourceTimelineLayoutDiagnostic, type ResourceTimelineLayoutItem, type ResourceTimelineLayoutOptions, type ResourceTimelineLayoutResult, type ResourceTimelineLayoutRow, ResourceTimelineResource, TableMatrix, type TableMatrixCellClickContext, type TableMatrixColumn, type TableMatrixColumnGroup, type TableMatrixDateOverlay, type TableMatrixModeProps, type Task, TaskDateChangeMode, type TaskDependency, TaskList, type TaskListColumn, type TaskListColumnContext, type TaskListColumnId, type TaskListColumnWidthMap, type TaskListMenuCommand, type TaskListProps, type TaskPredicate, TaskRow, TimeScaleHeader, TodayIndicator, ValidationResult, type VisibleReorderPlan, type VisibleReorderPosition, type WeekBlock, type WeekSpan, type WithoutDepsOptions, type YearSpan, addBusinessDays, and, calculateBezierPath, calculateDependencyPath, calculateGridLines, calculateGridWidth, calculateMilestoneConnectionBounds, calculateMilestoneGeometry, calculateMonthGridLines, calculateOrthogonalPath, calculateTaskBar, calculateWeekGridLines, calculateWeekendBlocks, clampDateRangeForIncomingFS, createCustomDayPredicate, createDateKey, detectEdgeZone, expired, flattenHierarchy, formatDateLabel, formatDateRangeLabel, getBusinessDaysCount, getCursorForPosition, getDayOffset, getMonthBlocks, getMonthDays, getMonthSpans, getMultiMonthDays, getVisibleReorderPlan, getVisibleReorderPosition, getWeekBlocks, getWeekSpans, getYearSpans, inDateRange, isTaskExpired, isToday, isWeekend, layoutResourceTimelineItems, nameContains, normalizeHierarchyTasks, normalizeTaskDates, not, or, parseUTCDate, pixelsToDate, progressInRange, resolveDateRangeFromPixels, resolveTaskHorizontalGeometry, subtractBusinessDays, useTaskDrag, withoutDeps };
|