gantt-lib 0.144.0 → 0.145.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 CHANGED
@@ -594,3 +594,41 @@ activityDependencyHighlight={{
594
594
  ### Hidden system dependencies
595
595
 
596
596
  Set TaskDependency.hidden to true to omit its arrow, predecessor chip and print label. The full dependency remains available to validation, drag constraints and cascading; this is a presentation flag, not a scheduling switch.
597
+
598
+
599
+ ### Consumer-owned task controls (0.145.0)
600
+
601
+ Task callbacks no longer add implicit menu items or row buttons. `taskListMenuCommands`
602
+ continues to render explicitly configured commands (scope, visibility, disabled state,
603
+ icons, dividers and close behavior). An empty command list produces no menu trigger.
604
+ `enableAddTask` now defaults to `false`; set it to `true` with `onAdd` to show the footer.
605
+
606
+ Use `renderTaskListActions(context)` for arbitrary row buttons and
607
+ `renderTaskListMenu(context, commands)` to replace or compose the entire menu.
608
+ Return `null` to omit either surface for a row. `hideTaskListRowActions` suppresses
609
+ both slots and commands. Context contains `task`, `isParent`, `canPromote`,
610
+ `canDemote`, `closeMenu`, and optional `insertAfter`, `promote`, `demote`, `duplicate`,
611
+ `delete`, `ungroup` operations. Unsupported operations are `undefined`.
612
+ The library retains scheduling, hierarchy and inline-insert behavior; the consumer
613
+ owns labels, icons, colors, menu composition and business actions.
614
+
615
+ ```tsx
616
+ <GanttChart tasks={tasks} showTaskList onTasksChange={setChangedTasks}
617
+ onAdd={addTask} onInsertAfter={insertTask} onDelete={deleteTask}
618
+ enableAddTask
619
+ renderTaskListActions={({ insertAfter, promote, demote }) => <>
620
+ {insertAfter && <button onClick={insertAfter}>+</button>}
621
+ {promote && <button onClick={promote}>Promote</button>}
622
+ {demote && <button onClick={demote}>Demote</button>}
623
+ </>}
624
+ renderTaskListMenu={({ task, delete: remove, closeMenu }, commands) => <>
625
+ {commands}
626
+ {remove && <button onClick={() => { closeMenu(); remove(); }}>Delete {task.name}</button>}
627
+ </>}
628
+ />
629
+ ```
630
+
631
+ Migrate color selection into the application, emitting changed task copies through
632
+ `onTasksChange`. To preserve the previous parent-color behavior, include descendants.
633
+ Do not mutate the context task. Use the optional operation callbacks to preserve the
634
+ library's descendant deletion, duplication and hierarchy scheduling semantics.
@@ -1,2 +1,2 @@
1
- export { an as CascadeContext, C as CriticalPathOptions, D as DAY_MS, i as DependencyError, L as LinkType, q as ScaleTaskSubtreeAnchor, r as ScaleTaskSubtreeErrorCode, s as ScaleTaskSubtreeExternalPolicy, t as ScaleTaskSubtreeOptions, S as ScaleTaskSubtreeResult, u as ScaleTaskSubtreeWarning, ao as ScheduleCommandOptions, ap as ScheduleCommandResult, aq as ScheduleDependency, ar as ScheduleTask, as as ScheduleTaskUpdate, T as Task, at as TaskDependency, V as ValidationResult, au as addBusinessDays, x as alignToWorkingDay, y as areTasksHierarchicallyRelated, z as buildAdjacencyList, E as buildTaskRangeFromEnd, F as buildTaskRangeFromStart, H as calculateSuccessorDate, I as cascadeByLinks, av as cascadeTaskProgress, J as clampTaskRangeForIncomingFS, K as computeCriticalPath, N as computeLagFromDates, O as computeParentDates, P as computeParentProgress, aw as createCascadeContext, Q as detectCycles, U as extendCriticalIdsToParents, X as findParentId, Y as getAllDependencyEdges, Z as getAllDescendants, _ as getBusinessDayOffset, ax as getBusinessDaysCount, $ as getChildren, a0 as getDependencyLag, a1 as getSuccessorChain, a2 as getTaskDuration, a3 as getTransitiveCascadeChain, a4 as isAncestorTask, a5 as isTaskParent, a6 as moveTaskRange, a7 as moveTaskWithCascade, a8 as normalizeDependencyLag, a9 as normalizePredecessorDates, aa as normalizeTaskDependencyLags, ab as normalizeUTCDate, ac as parseDateOnly, ad as recalculateIncomingLags, ae as recalculateProjectSchedule, af as recalculateTaskFromDependencies, ag as reflowTasksOnModeSwitch, ah as removeDependenciesBetweenTasks, ai as resizeTaskWithCascade, aj as scaleTaskSubtreeDuration, ak as shiftBusinessDayOffset, ay as subtractBusinessDays, al as universalCascade, am as validateDependencies } from '../../index-Dv4I3lA6.mjs';
1
+ export { an as CascadeContext, C as CriticalPathOptions, D as DAY_MS, i as DependencyError, L as LinkType, q as ScaleTaskSubtreeAnchor, r as ScaleTaskSubtreeErrorCode, s as ScaleTaskSubtreeExternalPolicy, t as ScaleTaskSubtreeOptions, S as ScaleTaskSubtreeResult, u as ScaleTaskSubtreeWarning, ao as ScheduleCommandOptions, ap as ScheduleCommandResult, aq as ScheduleDependency, ar as ScheduleTask, as as ScheduleTaskUpdate, T as Task, at as TaskDependency, V as ValidationResult, au as addBusinessDays, x as alignToWorkingDay, y as areTasksHierarchicallyRelated, z as buildAdjacencyList, E as buildTaskRangeFromEnd, F as buildTaskRangeFromStart, H as calculateSuccessorDate, I as cascadeByLinks, av as cascadeTaskProgress, J as clampTaskRangeForIncomingFS, K as computeCriticalPath, N as computeLagFromDates, O as computeParentDates, P as computeParentProgress, aw as createCascadeContext, Q as detectCycles, U as extendCriticalIdsToParents, X as findParentId, Y as getAllDependencyEdges, Z as getAllDescendants, _ as getBusinessDayOffset, ax as getBusinessDaysCount, $ as getChildren, a0 as getDependencyLag, a1 as getSuccessorChain, a2 as getTaskDuration, a3 as getTransitiveCascadeChain, a4 as isAncestorTask, a5 as isTaskParent, a6 as moveTaskRange, a7 as moveTaskWithCascade, a8 as normalizeDependencyLag, a9 as normalizePredecessorDates, aa as normalizeTaskDependencyLags, ab as normalizeUTCDate, ac as parseDateOnly, ad as recalculateIncomingLags, ae as recalculateProjectSchedule, af as recalculateTaskFromDependencies, ag as reflowTasksOnModeSwitch, ah as removeDependenciesBetweenTasks, ai as resizeTaskWithCascade, aj as scaleTaskSubtreeDuration, ak as shiftBusinessDayOffset, ay as subtractBusinessDays, al as universalCascade, am as validateDependencies } from '../../index-Hg8BjZ_h.mjs';
2
2
  import 'react';
@@ -1,2 +1,2 @@
1
- export { an as CascadeContext, C as CriticalPathOptions, D as DAY_MS, i as DependencyError, L as LinkType, q as ScaleTaskSubtreeAnchor, r as ScaleTaskSubtreeErrorCode, s as ScaleTaskSubtreeExternalPolicy, t as ScaleTaskSubtreeOptions, S as ScaleTaskSubtreeResult, u as ScaleTaskSubtreeWarning, ao as ScheduleCommandOptions, ap as ScheduleCommandResult, aq as ScheduleDependency, ar as ScheduleTask, as as ScheduleTaskUpdate, T as Task, at as TaskDependency, V as ValidationResult, au as addBusinessDays, x as alignToWorkingDay, y as areTasksHierarchicallyRelated, z as buildAdjacencyList, E as buildTaskRangeFromEnd, F as buildTaskRangeFromStart, H as calculateSuccessorDate, I as cascadeByLinks, av as cascadeTaskProgress, J as clampTaskRangeForIncomingFS, K as computeCriticalPath, N as computeLagFromDates, O as computeParentDates, P as computeParentProgress, aw as createCascadeContext, Q as detectCycles, U as extendCriticalIdsToParents, X as findParentId, Y as getAllDependencyEdges, Z as getAllDescendants, _ as getBusinessDayOffset, ax as getBusinessDaysCount, $ as getChildren, a0 as getDependencyLag, a1 as getSuccessorChain, a2 as getTaskDuration, a3 as getTransitiveCascadeChain, a4 as isAncestorTask, a5 as isTaskParent, a6 as moveTaskRange, a7 as moveTaskWithCascade, a8 as normalizeDependencyLag, a9 as normalizePredecessorDates, aa as normalizeTaskDependencyLags, ab as normalizeUTCDate, ac as parseDateOnly, ad as recalculateIncomingLags, ae as recalculateProjectSchedule, af as recalculateTaskFromDependencies, ag as reflowTasksOnModeSwitch, ah as removeDependenciesBetweenTasks, ai as resizeTaskWithCascade, aj as scaleTaskSubtreeDuration, ak as shiftBusinessDayOffset, ay as subtractBusinessDays, al as universalCascade, am as validateDependencies } from '../../index-Dv4I3lA6.js';
1
+ export { an as CascadeContext, C as CriticalPathOptions, D as DAY_MS, i as DependencyError, L as LinkType, q as ScaleTaskSubtreeAnchor, r as ScaleTaskSubtreeErrorCode, s as ScaleTaskSubtreeExternalPolicy, t as ScaleTaskSubtreeOptions, S as ScaleTaskSubtreeResult, u as ScaleTaskSubtreeWarning, ao as ScheduleCommandOptions, ap as ScheduleCommandResult, aq as ScheduleDependency, ar as ScheduleTask, as as ScheduleTaskUpdate, T as Task, at as TaskDependency, V as ValidationResult, au as addBusinessDays, x as alignToWorkingDay, y as areTasksHierarchicallyRelated, z as buildAdjacencyList, E as buildTaskRangeFromEnd, F as buildTaskRangeFromStart, H as calculateSuccessorDate, I as cascadeByLinks, av as cascadeTaskProgress, J as clampTaskRangeForIncomingFS, K as computeCriticalPath, N as computeLagFromDates, O as computeParentDates, P as computeParentProgress, aw as createCascadeContext, Q as detectCycles, U as extendCriticalIdsToParents, X as findParentId, Y as getAllDependencyEdges, Z as getAllDescendants, _ as getBusinessDayOffset, ax as getBusinessDaysCount, $ as getChildren, a0 as getDependencyLag, a1 as getSuccessorChain, a2 as getTaskDuration, a3 as getTransitiveCascadeChain, a4 as isAncestorTask, a5 as isTaskParent, a6 as moveTaskRange, a7 as moveTaskWithCascade, a8 as normalizeDependencyLag, a9 as normalizePredecessorDates, aa as normalizeTaskDependencyLags, ab as normalizeUTCDate, ac as parseDateOnly, ad as recalculateIncomingLags, ae as recalculateProjectSchedule, af as recalculateTaskFromDependencies, ag as reflowTasksOnModeSwitch, ah as removeDependenciesBetweenTasks, ai as resizeTaskWithCascade, aj as scaleTaskSubtreeDuration, ak as shiftBusinessDayOffset, ay as subtractBusinessDays, al as universalCascade, am as validateDependencies } from '../../index-Hg8BjZ_h.js';
2
2
  import 'react';
@@ -266,6 +266,8 @@ interface Task {
266
266
  * - Progress is visual-only, no user interaction
267
267
  */
268
268
  progress?: number;
269
+ /** Preserve supplied parent progress for display-only grouping; default recomputes from child durations. */
270
+ progressAggregation?: 'manual' | 'duration-weighted';
269
271
  /**
270
272
  * Optional flag indicating if task is accepted
271
273
  * - Only meaningful when progress is 100%
@@ -266,6 +266,8 @@ interface Task {
266
266
  * - Progress is visual-only, no user interaction
267
267
  */
268
268
  progress?: number;
269
+ /** Preserve supplied parent progress for display-only grouping; default recomputes from child durations. */
270
+ progressAggregation?: 'manual' | 'duration-weighted';
269
271
  /**
270
272
  * Optional flag indicating if task is accepted
271
273
  * - Only meaningful when progress is 100%
package/dist/index.d.mts CHANGED
@@ -1,6 +1,6 @@
1
1
  import React$1, { ReactNode } from 'react';
2
- import { T as Task$1, R as ResourceTimelineItem, G as GanttScheduleIntent, V as ValidationResult, a as GanttDateRange, b as TaskActivityDependency, A as ActivityDependencyHighlight, c as ActivityTooltipContext, d as TimelineMarker, e as TaskDateChangeMode, S as ScaleTaskSubtreeResult, f as ResourcePlannerChartProps, g as TaskActivity$1, h as ResourceTimelineResource } from './index-Dv4I3lA6.mjs';
3
- export { B as BuiltInResourceTableColumnId, C as CriticalPathOptions, D as DAY_MS, i as DependencyError, j as GanttChartMode, k as GridConfig, l as GridLine, L as LinkType, M as MonthSpan, m as ResourceTableColumnId, n as ResourceTableColumnWidthMap, o as ResourceTimelineMove, p as ResourceTimelineResourceMenuCommand, q as ScaleTaskSubtreeAnchor, r as ScaleTaskSubtreeErrorCode, s as ScaleTaskSubtreeExternalPolicy, t as ScaleTaskSubtreeOptions, u as ScaleTaskSubtreeWarning, v as TaskActivityTooltipField, w as TaskBarGeometry, W as WeekendBlock, x as alignToWorkingDay, y as areTasksHierarchicallyRelated, z as buildAdjacencyList, E as buildTaskRangeFromEnd, F as buildTaskRangeFromStart, H as calculateSuccessorDate, I as cascadeByLinks, J as clampTaskRangeForIncomingFS, K as computeCriticalPath, N as computeLagFromDates, O as computeParentDates, P as computeParentProgress, Q as detectCycles, U as extendCriticalIdsToParents, X as findParentId, Y as getAllDependencyEdges, Z as getAllDescendants, _ as getBusinessDayOffset, $ as getChildren, a0 as getDependencyLag, a1 as getSuccessorChain, a2 as getTaskDuration, a3 as getTransitiveCascadeChain, a4 as isAncestorTask, a5 as isTaskParent, a6 as moveTaskRange, a7 as moveTaskWithCascade, a8 as normalizeDependencyLag, a9 as normalizePredecessorDates, aa as normalizeTaskDependencyLags, ab as normalizeUTCDate, ac as parseDateOnly, ad as recalculateIncomingLags, ae as recalculateProjectSchedule, af as recalculateTaskFromDependencies, ag as reflowTasksOnModeSwitch, ah as removeDependenciesBetweenTasks, ai as resizeTaskWithCascade, aj as scaleTaskSubtreeDuration, ak as shiftBusinessDayOffset, al as universalCascade, am as validateDependencies } from './index-Dv4I3lA6.mjs';
2
+ import { T as Task$1, R as ResourceTimelineItem, G as GanttScheduleIntent, V as ValidationResult, a as GanttDateRange, b as TaskActivityDependency, A as ActivityDependencyHighlight, c as ActivityTooltipContext, d as TimelineMarker, e as TaskDateChangeMode, S as ScaleTaskSubtreeResult, f as ResourcePlannerChartProps, g as TaskActivity$1, h as ResourceTimelineResource } from './index-Hg8BjZ_h.mjs';
3
+ export { B as BuiltInResourceTableColumnId, C as CriticalPathOptions, D as DAY_MS, i as DependencyError, j as GanttChartMode, k as GridConfig, l as GridLine, L as LinkType, M as MonthSpan, m as ResourceTableColumnId, n as ResourceTableColumnWidthMap, o as ResourceTimelineMove, p as ResourceTimelineResourceMenuCommand, q as ScaleTaskSubtreeAnchor, r as ScaleTaskSubtreeErrorCode, s as ScaleTaskSubtreeExternalPolicy, t as ScaleTaskSubtreeOptions, u as ScaleTaskSubtreeWarning, v as TaskActivityTooltipField, w as TaskBarGeometry, W as WeekendBlock, x as alignToWorkingDay, y as areTasksHierarchicallyRelated, z as buildAdjacencyList, E as buildTaskRangeFromEnd, F as buildTaskRangeFromStart, H as calculateSuccessorDate, I as cascadeByLinks, J as clampTaskRangeForIncomingFS, K as computeCriticalPath, N as computeLagFromDates, O as computeParentDates, P as computeParentProgress, Q as detectCycles, U as extendCriticalIdsToParents, X as findParentId, Y as getAllDependencyEdges, Z as getAllDescendants, _ as getBusinessDayOffset, $ as getChildren, a0 as getDependencyLag, a1 as getSuccessorChain, a2 as getTaskDuration, a3 as getTransitiveCascadeChain, a4 as isAncestorTask, a5 as isTaskParent, a6 as moveTaskRange, a7 as moveTaskWithCascade, a8 as normalizeDependencyLag, a9 as normalizePredecessorDates, aa as normalizeTaskDependencyLags, ab as normalizeUTCDate, ac as parseDateOnly, ad as recalculateIncomingLags, ae as recalculateProjectSchedule, af as recalculateTaskFromDependencies, ag as reflowTasksOnModeSwitch, ah as removeDependenciesBetweenTasks, ai as resizeTaskWithCascade, aj as scaleTaskSubtreeDuration, ak as shiftBusinessDayOffset, al as universalCascade, am as validateDependencies } from './index-Hg8BjZ_h.mjs';
4
4
  import * as react_jsx_runtime from 'react/jsx-runtime';
5
5
  import * as RadixPopover from '@radix-ui/react-popover';
6
6
 
@@ -468,6 +468,8 @@ interface Task {
468
468
  * - Progress is visual-only, no user interaction
469
469
  */
470
470
  progress?: number;
471
+ /** Preserve supplied parent readiness under display grouping; dates still roll up from children. */
472
+ progressAggregation?: 'manual' | 'duration-weighted';
471
473
  /**
472
474
  * Optional flag indicating if task is accepted
473
475
  * - Only meaningful when progress is 100%
@@ -566,6 +568,20 @@ interface TaskDependency {
566
568
  /** Lag in days */
567
569
  lag: number;
568
570
  }
571
+ /** Capability-checked operations for a consumer-owned task action surface. */
572
+ interface TaskListActionContext<TTask extends Task = Task> {
573
+ task: TTask;
574
+ isParent: boolean;
575
+ canPromote: boolean;
576
+ canDemote: boolean;
577
+ insertAfter?: () => void;
578
+ promote?: () => void;
579
+ demote?: () => void;
580
+ duplicate?: () => void;
581
+ delete?: () => void;
582
+ ungroup?: () => void;
583
+ closeMenu: () => void;
584
+ }
569
585
  interface TaskListMenuCommand<TTask extends Task = Task> {
570
586
  /** Stable command id for React keys and consumer bookkeeping */
571
587
  id: string;
@@ -717,6 +733,10 @@ interface TaskChartSharedProps<TTask extends Task = Task> {
717
733
  onTaskListColumnWidthsChange?: (widths: TaskListColumnWidthMap) => void;
718
734
  /** Additional commands rendered in the TaskList row three-dots menu */
719
735
  taskListMenuCommands?: TaskListMenuCommand<TTask>[];
736
+ /** No buttons render unless this slot is supplied. */
737
+ renderTaskListActions?: (context: TaskListActionContext<TTask>) => React$1.ReactNode;
738
+ /** Replace/compose the menu; commands contains the configured taskListMenuCommands UI. */
739
+ renderTaskListMenu?: (context: TaskListActionContext<TTask>, commands: React$1.ReactNode) => React$1.ReactNode;
720
740
  /** Hide row action controls in the TaskList for table-like read/edit presentations. */
721
741
  hideTaskListRowActions?: boolean;
722
742
  /** Returns an extra CSS class name for a TaskList row. */
@@ -1238,6 +1258,8 @@ interface TaskListProps {
1238
1258
  onTaskListColumnWidthsChange?: (widths: TaskListColumnWidthMap) => void;
1239
1259
  /** Additional commands rendered in each row three-dots menu */
1240
1260
  taskListMenuCommands?: TaskListMenuCommand<Task>[];
1261
+ renderTaskListActions?: (context: TaskListActionContext<Task>) => React$1.ReactNode;
1262
+ renderTaskListMenu?: (context: TaskListActionContext<Task>, commands: React$1.ReactNode) => React$1.ReactNode;
1241
1263
  /** Hide row action controls such as insert, hierarchy action buttons, and the context menu trigger. */
1242
1264
  hideTaskListRowActions?: boolean;
1243
1265
  /** Returns an extra CSS class name for a TaskList row. */
@@ -1848,7 +1870,7 @@ type HierarchyTask = Task$1 & {
1848
1870
  declare function flattenHierarchy<T extends HierarchyTask>(tasks: T[]): T[];
1849
1871
  /**
1850
1872
  * Normalize hierarchy-aware display fields.
1851
- * Parent task dates and progress are always recomputed from children,
1873
+ * Parent dates are recomputed from children; progress is recomputed unless manual aggregation is requested,
1852
1874
  * taking precedence over any hardcoded parent values from the input.
1853
1875
  * Also normalizes task dates to ensure startDate is always before or equal to endDate.
1854
1876
  */
@@ -1902,4 +1924,4 @@ interface ResourceTimelineLayoutResult<TItem extends ResourceTimelineItem = Reso
1902
1924
  }
1903
1925
  declare const layoutResourceTimelineItems: <TItem extends ResourceTimelineItem = ResourceTimelineItem>(resources: Array<ResourceTimelineResource<TItem>>, options: ResourceTimelineLayoutOptions) => ResourceTimelineLayoutResult<TItem>;
1904
1926
 
1905
- export { ACTIVITY_LANES_PADDING, ACTIVITY_LANE_BAR_HEIGHT, ACTIVITY_LANE_STEP, type ActivityChainPushResult, type ActivityChainShift, type ActivityChainTask, ActivityDependencyHighlight, type ActivityLanesLayout, type ActivitySegment, type ActivityStartConstraint, ActivityTooltipContext, 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, GanttDateRange, type GanttModeProps, GanttScheduleIntent, GenerationSkeletonRows, type GenerationSkeletonRowsProps, type GenerationSkeletonTaskListLayout, type GenerationSkeletonVariant, GridBackground, Input, type InputProps, MIN_EDGE_ZONE_PX, MIN_MOVE_ZONE_PX, type MonthBlock, type PlanFactCellCommitContext, type PlanFactCellKind, PlanFactMatrix, type PlanFactModeProps, 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, ScaleTaskSubtreeResult, TableMatrix, type TableMatrixCellClickContext, type TableMatrixColumn, type TableMatrixColumnGroup, type TableMatrixDateOverlay, type TableMatrixModeProps, type Task, TaskActivity$1 as TaskActivity, TaskActivityDependency, TaskDateChangeMode, type TaskDependency, TaskList, type TaskListColumn, type TaskListColumnContext, type TaskListColumnId, type TaskListColumnWidthMap, type TaskListMenuCommand, type TaskListProps, type TaskPredicate, TaskRow, TimeScaleHeader, TimelineMarker, TodayIndicator, ValidationResult, type VisibleReorderPlan, type VisibleReorderPosition, type WeekBlock, type WeekSpan, type WithoutDepsOptions, type YearSpan, activityBounds, activityChainMinStartDelta, activityLanesExtraHeight, activitySpanMs, activityStartConstraint, addBusinessDays, and, calculateBezierPath, calculateDependencyPath, calculateGridLines, calculateGridWidth, calculateMilestoneConnectionBounds, calculateMilestoneGeometry, calculateMonthGridLines, calculateOrthogonalPath, calculateTaskBar, calculateWeekGridLines, calculateWeekendBlocks, clampDateRangeForIncomingFS, computeActivityLanes, createCustomDayPredicate, createDateKey, detectEdgeZone, expired, flattenHierarchy, formatDateLabel, formatDateRangeLabel, getBusinessDaysCount, getCursorForPosition, getDateRangeDays, getDayOffset, getMonthBlocks, getMonthDays, getMonthSpans, getMultiMonthDays, getTodayLocalUtcDate, getVisibleReorderPlan, getVisibleReorderPosition, getWeekBlocks, getWeekSpans, getYearSpans, inDateRange, isTaskExpired, isToday, isWeekend, layoutResourceTimelineItems, nameContains, normalizeHierarchyTasks, normalizeTaskDates, not, or, packIntervals, parseUTCDate, pixelsToDate, progressInRange, pushActivityChain, resolveDateRangeFromPixels, resolveTaskHorizontalGeometry, shiftActivityChain, shiftActivityDate, subtractBusinessDays, useTaskDrag, withoutDeps };
1927
+ export { ACTIVITY_LANES_PADDING, ACTIVITY_LANE_BAR_HEIGHT, ACTIVITY_LANE_STEP, type ActivityChainPushResult, type ActivityChainShift, type ActivityChainTask, ActivityDependencyHighlight, type ActivityLanesLayout, type ActivitySegment, type ActivityStartConstraint, ActivityTooltipContext, 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, GanttDateRange, type GanttModeProps, GanttScheduleIntent, GenerationSkeletonRows, type GenerationSkeletonRowsProps, type GenerationSkeletonTaskListLayout, type GenerationSkeletonVariant, GridBackground, Input, type InputProps, MIN_EDGE_ZONE_PX, MIN_MOVE_ZONE_PX, type MonthBlock, type PlanFactCellCommitContext, type PlanFactCellKind, PlanFactMatrix, type PlanFactModeProps, 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, ScaleTaskSubtreeResult, TableMatrix, type TableMatrixCellClickContext, type TableMatrixColumn, type TableMatrixColumnGroup, type TableMatrixDateOverlay, type TableMatrixModeProps, type Task, TaskActivity$1 as TaskActivity, TaskActivityDependency, TaskDateChangeMode, type TaskDependency, TaskList, type TaskListActionContext, type TaskListColumn, type TaskListColumnContext, type TaskListColumnId, type TaskListColumnWidthMap, type TaskListMenuCommand, type TaskListProps, type TaskPredicate, TaskRow, TimeScaleHeader, TimelineMarker, TodayIndicator, ValidationResult, type VisibleReorderPlan, type VisibleReorderPosition, type WeekBlock, type WeekSpan, type WithoutDepsOptions, type YearSpan, activityBounds, activityChainMinStartDelta, activityLanesExtraHeight, activitySpanMs, activityStartConstraint, addBusinessDays, and, calculateBezierPath, calculateDependencyPath, calculateGridLines, calculateGridWidth, calculateMilestoneConnectionBounds, calculateMilestoneGeometry, calculateMonthGridLines, calculateOrthogonalPath, calculateTaskBar, calculateWeekGridLines, calculateWeekendBlocks, clampDateRangeForIncomingFS, computeActivityLanes, createCustomDayPredicate, createDateKey, detectEdgeZone, expired, flattenHierarchy, formatDateLabel, formatDateRangeLabel, getBusinessDaysCount, getCursorForPosition, getDateRangeDays, getDayOffset, getMonthBlocks, getMonthDays, getMonthSpans, getMultiMonthDays, getTodayLocalUtcDate, getVisibleReorderPlan, getVisibleReorderPosition, getWeekBlocks, getWeekSpans, getYearSpans, inDateRange, isTaskExpired, isToday, isWeekend, layoutResourceTimelineItems, nameContains, normalizeHierarchyTasks, normalizeTaskDates, not, or, packIntervals, parseUTCDate, pixelsToDate, progressInRange, pushActivityChain, resolveDateRangeFromPixels, resolveTaskHorizontalGeometry, shiftActivityChain, shiftActivityDate, subtractBusinessDays, useTaskDrag, withoutDeps };
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import React$1, { ReactNode } from 'react';
2
- import { T as Task$1, R as ResourceTimelineItem, G as GanttScheduleIntent, V as ValidationResult, a as GanttDateRange, b as TaskActivityDependency, A as ActivityDependencyHighlight, c as ActivityTooltipContext, d as TimelineMarker, e as TaskDateChangeMode, S as ScaleTaskSubtreeResult, f as ResourcePlannerChartProps, g as TaskActivity$1, h as ResourceTimelineResource } from './index-Dv4I3lA6.js';
3
- export { B as BuiltInResourceTableColumnId, C as CriticalPathOptions, D as DAY_MS, i as DependencyError, j as GanttChartMode, k as GridConfig, l as GridLine, L as LinkType, M as MonthSpan, m as ResourceTableColumnId, n as ResourceTableColumnWidthMap, o as ResourceTimelineMove, p as ResourceTimelineResourceMenuCommand, q as ScaleTaskSubtreeAnchor, r as ScaleTaskSubtreeErrorCode, s as ScaleTaskSubtreeExternalPolicy, t as ScaleTaskSubtreeOptions, u as ScaleTaskSubtreeWarning, v as TaskActivityTooltipField, w as TaskBarGeometry, W as WeekendBlock, x as alignToWorkingDay, y as areTasksHierarchicallyRelated, z as buildAdjacencyList, E as buildTaskRangeFromEnd, F as buildTaskRangeFromStart, H as calculateSuccessorDate, I as cascadeByLinks, J as clampTaskRangeForIncomingFS, K as computeCriticalPath, N as computeLagFromDates, O as computeParentDates, P as computeParentProgress, Q as detectCycles, U as extendCriticalIdsToParents, X as findParentId, Y as getAllDependencyEdges, Z as getAllDescendants, _ as getBusinessDayOffset, $ as getChildren, a0 as getDependencyLag, a1 as getSuccessorChain, a2 as getTaskDuration, a3 as getTransitiveCascadeChain, a4 as isAncestorTask, a5 as isTaskParent, a6 as moveTaskRange, a7 as moveTaskWithCascade, a8 as normalizeDependencyLag, a9 as normalizePredecessorDates, aa as normalizeTaskDependencyLags, ab as normalizeUTCDate, ac as parseDateOnly, ad as recalculateIncomingLags, ae as recalculateProjectSchedule, af as recalculateTaskFromDependencies, ag as reflowTasksOnModeSwitch, ah as removeDependenciesBetweenTasks, ai as resizeTaskWithCascade, aj as scaleTaskSubtreeDuration, ak as shiftBusinessDayOffset, al as universalCascade, am as validateDependencies } from './index-Dv4I3lA6.js';
2
+ import { T as Task$1, R as ResourceTimelineItem, G as GanttScheduleIntent, V as ValidationResult, a as GanttDateRange, b as TaskActivityDependency, A as ActivityDependencyHighlight, c as ActivityTooltipContext, d as TimelineMarker, e as TaskDateChangeMode, S as ScaleTaskSubtreeResult, f as ResourcePlannerChartProps, g as TaskActivity$1, h as ResourceTimelineResource } from './index-Hg8BjZ_h.js';
3
+ export { B as BuiltInResourceTableColumnId, C as CriticalPathOptions, D as DAY_MS, i as DependencyError, j as GanttChartMode, k as GridConfig, l as GridLine, L as LinkType, M as MonthSpan, m as ResourceTableColumnId, n as ResourceTableColumnWidthMap, o as ResourceTimelineMove, p as ResourceTimelineResourceMenuCommand, q as ScaleTaskSubtreeAnchor, r as ScaleTaskSubtreeErrorCode, s as ScaleTaskSubtreeExternalPolicy, t as ScaleTaskSubtreeOptions, u as ScaleTaskSubtreeWarning, v as TaskActivityTooltipField, w as TaskBarGeometry, W as WeekendBlock, x as alignToWorkingDay, y as areTasksHierarchicallyRelated, z as buildAdjacencyList, E as buildTaskRangeFromEnd, F as buildTaskRangeFromStart, H as calculateSuccessorDate, I as cascadeByLinks, J as clampTaskRangeForIncomingFS, K as computeCriticalPath, N as computeLagFromDates, O as computeParentDates, P as computeParentProgress, Q as detectCycles, U as extendCriticalIdsToParents, X as findParentId, Y as getAllDependencyEdges, Z as getAllDescendants, _ as getBusinessDayOffset, $ as getChildren, a0 as getDependencyLag, a1 as getSuccessorChain, a2 as getTaskDuration, a3 as getTransitiveCascadeChain, a4 as isAncestorTask, a5 as isTaskParent, a6 as moveTaskRange, a7 as moveTaskWithCascade, a8 as normalizeDependencyLag, a9 as normalizePredecessorDates, aa as normalizeTaskDependencyLags, ab as normalizeUTCDate, ac as parseDateOnly, ad as recalculateIncomingLags, ae as recalculateProjectSchedule, af as recalculateTaskFromDependencies, ag as reflowTasksOnModeSwitch, ah as removeDependenciesBetweenTasks, ai as resizeTaskWithCascade, aj as scaleTaskSubtreeDuration, ak as shiftBusinessDayOffset, al as universalCascade, am as validateDependencies } from './index-Hg8BjZ_h.js';
4
4
  import * as react_jsx_runtime from 'react/jsx-runtime';
5
5
  import * as RadixPopover from '@radix-ui/react-popover';
6
6
 
@@ -468,6 +468,8 @@ interface Task {
468
468
  * - Progress is visual-only, no user interaction
469
469
  */
470
470
  progress?: number;
471
+ /** Preserve supplied parent readiness under display grouping; dates still roll up from children. */
472
+ progressAggregation?: 'manual' | 'duration-weighted';
471
473
  /**
472
474
  * Optional flag indicating if task is accepted
473
475
  * - Only meaningful when progress is 100%
@@ -566,6 +568,20 @@ interface TaskDependency {
566
568
  /** Lag in days */
567
569
  lag: number;
568
570
  }
571
+ /** Capability-checked operations for a consumer-owned task action surface. */
572
+ interface TaskListActionContext<TTask extends Task = Task> {
573
+ task: TTask;
574
+ isParent: boolean;
575
+ canPromote: boolean;
576
+ canDemote: boolean;
577
+ insertAfter?: () => void;
578
+ promote?: () => void;
579
+ demote?: () => void;
580
+ duplicate?: () => void;
581
+ delete?: () => void;
582
+ ungroup?: () => void;
583
+ closeMenu: () => void;
584
+ }
569
585
  interface TaskListMenuCommand<TTask extends Task = Task> {
570
586
  /** Stable command id for React keys and consumer bookkeeping */
571
587
  id: string;
@@ -717,6 +733,10 @@ interface TaskChartSharedProps<TTask extends Task = Task> {
717
733
  onTaskListColumnWidthsChange?: (widths: TaskListColumnWidthMap) => void;
718
734
  /** Additional commands rendered in the TaskList row three-dots menu */
719
735
  taskListMenuCommands?: TaskListMenuCommand<TTask>[];
736
+ /** No buttons render unless this slot is supplied. */
737
+ renderTaskListActions?: (context: TaskListActionContext<TTask>) => React$1.ReactNode;
738
+ /** Replace/compose the menu; commands contains the configured taskListMenuCommands UI. */
739
+ renderTaskListMenu?: (context: TaskListActionContext<TTask>, commands: React$1.ReactNode) => React$1.ReactNode;
720
740
  /** Hide row action controls in the TaskList for table-like read/edit presentations. */
721
741
  hideTaskListRowActions?: boolean;
722
742
  /** Returns an extra CSS class name for a TaskList row. */
@@ -1238,6 +1258,8 @@ interface TaskListProps {
1238
1258
  onTaskListColumnWidthsChange?: (widths: TaskListColumnWidthMap) => void;
1239
1259
  /** Additional commands rendered in each row three-dots menu */
1240
1260
  taskListMenuCommands?: TaskListMenuCommand<Task>[];
1261
+ renderTaskListActions?: (context: TaskListActionContext<Task>) => React$1.ReactNode;
1262
+ renderTaskListMenu?: (context: TaskListActionContext<Task>, commands: React$1.ReactNode) => React$1.ReactNode;
1241
1263
  /** Hide row action controls such as insert, hierarchy action buttons, and the context menu trigger. */
1242
1264
  hideTaskListRowActions?: boolean;
1243
1265
  /** Returns an extra CSS class name for a TaskList row. */
@@ -1848,7 +1870,7 @@ type HierarchyTask = Task$1 & {
1848
1870
  declare function flattenHierarchy<T extends HierarchyTask>(tasks: T[]): T[];
1849
1871
  /**
1850
1872
  * Normalize hierarchy-aware display fields.
1851
- * Parent task dates and progress are always recomputed from children,
1873
+ * Parent dates are recomputed from children; progress is recomputed unless manual aggregation is requested,
1852
1874
  * taking precedence over any hardcoded parent values from the input.
1853
1875
  * Also normalizes task dates to ensure startDate is always before or equal to endDate.
1854
1876
  */
@@ -1902,4 +1924,4 @@ interface ResourceTimelineLayoutResult<TItem extends ResourceTimelineItem = Reso
1902
1924
  }
1903
1925
  declare const layoutResourceTimelineItems: <TItem extends ResourceTimelineItem = ResourceTimelineItem>(resources: Array<ResourceTimelineResource<TItem>>, options: ResourceTimelineLayoutOptions) => ResourceTimelineLayoutResult<TItem>;
1904
1926
 
1905
- export { ACTIVITY_LANES_PADDING, ACTIVITY_LANE_BAR_HEIGHT, ACTIVITY_LANE_STEP, type ActivityChainPushResult, type ActivityChainShift, type ActivityChainTask, ActivityDependencyHighlight, type ActivityLanesLayout, type ActivitySegment, type ActivityStartConstraint, ActivityTooltipContext, 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, GanttDateRange, type GanttModeProps, GanttScheduleIntent, GenerationSkeletonRows, type GenerationSkeletonRowsProps, type GenerationSkeletonTaskListLayout, type GenerationSkeletonVariant, GridBackground, Input, type InputProps, MIN_EDGE_ZONE_PX, MIN_MOVE_ZONE_PX, type MonthBlock, type PlanFactCellCommitContext, type PlanFactCellKind, PlanFactMatrix, type PlanFactModeProps, 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, ScaleTaskSubtreeResult, TableMatrix, type TableMatrixCellClickContext, type TableMatrixColumn, type TableMatrixColumnGroup, type TableMatrixDateOverlay, type TableMatrixModeProps, type Task, TaskActivity$1 as TaskActivity, TaskActivityDependency, TaskDateChangeMode, type TaskDependency, TaskList, type TaskListColumn, type TaskListColumnContext, type TaskListColumnId, type TaskListColumnWidthMap, type TaskListMenuCommand, type TaskListProps, type TaskPredicate, TaskRow, TimeScaleHeader, TimelineMarker, TodayIndicator, ValidationResult, type VisibleReorderPlan, type VisibleReorderPosition, type WeekBlock, type WeekSpan, type WithoutDepsOptions, type YearSpan, activityBounds, activityChainMinStartDelta, activityLanesExtraHeight, activitySpanMs, activityStartConstraint, addBusinessDays, and, calculateBezierPath, calculateDependencyPath, calculateGridLines, calculateGridWidth, calculateMilestoneConnectionBounds, calculateMilestoneGeometry, calculateMonthGridLines, calculateOrthogonalPath, calculateTaskBar, calculateWeekGridLines, calculateWeekendBlocks, clampDateRangeForIncomingFS, computeActivityLanes, createCustomDayPredicate, createDateKey, detectEdgeZone, expired, flattenHierarchy, formatDateLabel, formatDateRangeLabel, getBusinessDaysCount, getCursorForPosition, getDateRangeDays, getDayOffset, getMonthBlocks, getMonthDays, getMonthSpans, getMultiMonthDays, getTodayLocalUtcDate, getVisibleReorderPlan, getVisibleReorderPosition, getWeekBlocks, getWeekSpans, getYearSpans, inDateRange, isTaskExpired, isToday, isWeekend, layoutResourceTimelineItems, nameContains, normalizeHierarchyTasks, normalizeTaskDates, not, or, packIntervals, parseUTCDate, pixelsToDate, progressInRange, pushActivityChain, resolveDateRangeFromPixels, resolveTaskHorizontalGeometry, shiftActivityChain, shiftActivityDate, subtractBusinessDays, useTaskDrag, withoutDeps };
1927
+ export { ACTIVITY_LANES_PADDING, ACTIVITY_LANE_BAR_HEIGHT, ACTIVITY_LANE_STEP, type ActivityChainPushResult, type ActivityChainShift, type ActivityChainTask, ActivityDependencyHighlight, type ActivityLanesLayout, type ActivitySegment, type ActivityStartConstraint, ActivityTooltipContext, 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, GanttDateRange, type GanttModeProps, GanttScheduleIntent, GenerationSkeletonRows, type GenerationSkeletonRowsProps, type GenerationSkeletonTaskListLayout, type GenerationSkeletonVariant, GridBackground, Input, type InputProps, MIN_EDGE_ZONE_PX, MIN_MOVE_ZONE_PX, type MonthBlock, type PlanFactCellCommitContext, type PlanFactCellKind, PlanFactMatrix, type PlanFactModeProps, 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, ScaleTaskSubtreeResult, TableMatrix, type TableMatrixCellClickContext, type TableMatrixColumn, type TableMatrixColumnGroup, type TableMatrixDateOverlay, type TableMatrixModeProps, type Task, TaskActivity$1 as TaskActivity, TaskActivityDependency, TaskDateChangeMode, type TaskDependency, TaskList, type TaskListActionContext, type TaskListColumn, type TaskListColumnContext, type TaskListColumnId, type TaskListColumnWidthMap, type TaskListMenuCommand, type TaskListProps, type TaskPredicate, TaskRow, TimeScaleHeader, TimelineMarker, TodayIndicator, ValidationResult, type VisibleReorderPlan, type VisibleReorderPosition, type WeekBlock, type WeekSpan, type WithoutDepsOptions, type YearSpan, activityBounds, activityChainMinStartDelta, activityLanesExtraHeight, activitySpanMs, activityStartConstraint, addBusinessDays, and, calculateBezierPath, calculateDependencyPath, calculateGridLines, calculateGridWidth, calculateMilestoneConnectionBounds, calculateMilestoneGeometry, calculateMonthGridLines, calculateOrthogonalPath, calculateTaskBar, calculateWeekGridLines, calculateWeekendBlocks, clampDateRangeForIncomingFS, computeActivityLanes, createCustomDayPredicate, createDateKey, detectEdgeZone, expired, flattenHierarchy, formatDateLabel, formatDateRangeLabel, getBusinessDaysCount, getCursorForPosition, getDateRangeDays, getDayOffset, getMonthBlocks, getMonthDays, getMonthSpans, getMultiMonthDays, getTodayLocalUtcDate, getVisibleReorderPlan, getVisibleReorderPosition, getWeekBlocks, getWeekSpans, getYearSpans, inDateRange, isTaskExpired, isToday, isWeekend, layoutResourceTimelineItems, nameContains, normalizeHierarchyTasks, normalizeTaskDates, not, or, packIntervals, parseUTCDate, pixelsToDate, progressInRange, pushActivityChain, resolveDateRangeFromPixels, resolveTaskHorizontalGeometry, shiftActivityChain, shiftActivityDate, subtractBusinessDays, useTaskDrag, withoutDeps };