gantt-lib 0.146.1 → 0.146.3

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.
@@ -245,6 +245,9 @@ interface Task {
245
245
  startDate: string | Date;
246
246
  /** Task end date (ISO string or Date object) */
247
247
  endDate: string | Date;
248
+ /** Optional fixed date-only boundaries; null or absence leaves the boundary automatic. */
249
+ fixedStartDate?: string | null;
250
+ fixedEndDate?: string | null;
248
251
  /** Optional baseline start date for planned schedule visualization */
249
252
  baselineStartDate?: string | Date;
250
253
  /** Optional baseline end date for planned schedule visualization */
@@ -599,7 +602,7 @@ declare function getTransitiveCascadeChain(changedTaskId: string, allTasks: Task
599
602
  * Universal cascade engine that propagates a moved task's new position through
600
603
  * the entire dependency+hierarchy graph using BFS with change detection.
601
604
  */
602
- declare function universalCascade(movedTask: Task, newStart: Date, newEnd: Date, allTasks: Task[], businessDays?: boolean, weekendPredicate?: (date: Date) => boolean, context?: CascadeContext): Task[];
605
+ declare function universalCascade(movedTask: Task, newStart: Date, newEnd: Date, allTasks: Task[], businessDays?: boolean, weekendPredicate?: (date: Date) => boolean, context?: CascadeContext, rootIsRollup?: boolean): Task[];
603
606
 
604
607
  /**
605
608
  * Recalculate all task dates when switching between business/calendar day modes.
@@ -728,7 +731,7 @@ declare function isTaskParent(taskId: string, tasks: Task[]): boolean;
728
731
  * - startDate = min(children.startDate) or own startDate if no children
729
732
  * - endDate = max(children.endDate) or own endDate if no children
730
733
  */
731
- declare function computeParentDates(parentId: string, tasks: Task[]): {
734
+ declare function computeParentDates(parentId: string, tasks: Task[], businessDays?: boolean, weekendPredicate?: (date: Date) => boolean): {
732
735
  startDate: Date;
733
736
  endDate: Date;
734
737
  };
@@ -838,7 +841,7 @@ type ScaleTaskSubtreeWarning = {
838
841
  requestedDuration: number;
839
842
  minimumDuration: number;
840
843
  };
841
- type ScaleTaskSubtreeErrorCode = 'INVALID_TARGET_DURATION' | 'TASK_NOT_FOUND' | 'NOT_A_PARENT' | 'INVALID_HIERARCHY' | 'INVALID_DEPENDENCIES' | 'INVALID_DATES' | 'INVALID_MINIMUM' | 'EXTERNAL_DEPENDENCY_CONFLICT';
844
+ type ScaleTaskSubtreeErrorCode = 'INVALID_TARGET_DURATION' | 'TASK_NOT_FOUND' | 'NOT_A_PARENT' | 'INVALID_HIERARCHY' | 'INVALID_DEPENDENCIES' | 'INVALID_DATES' | 'INVALID_MINIMUM' | 'FIXED_DATE_CONFLICT' | 'EXTERNAL_DEPENDENCY_CONFLICT';
842
845
  type ScaleTaskSubtreeResult = {
843
846
  ok: true;
844
847
  changedTasks: Task[];
@@ -245,6 +245,9 @@ interface Task {
245
245
  startDate: string | Date;
246
246
  /** Task end date (ISO string or Date object) */
247
247
  endDate: string | Date;
248
+ /** Optional fixed date-only boundaries; null or absence leaves the boundary automatic. */
249
+ fixedStartDate?: string | null;
250
+ fixedEndDate?: string | null;
248
251
  /** Optional baseline start date for planned schedule visualization */
249
252
  baselineStartDate?: string | Date;
250
253
  /** Optional baseline end date for planned schedule visualization */
@@ -599,7 +602,7 @@ declare function getTransitiveCascadeChain(changedTaskId: string, allTasks: Task
599
602
  * Universal cascade engine that propagates a moved task's new position through
600
603
  * the entire dependency+hierarchy graph using BFS with change detection.
601
604
  */
602
- declare function universalCascade(movedTask: Task, newStart: Date, newEnd: Date, allTasks: Task[], businessDays?: boolean, weekendPredicate?: (date: Date) => boolean, context?: CascadeContext): Task[];
605
+ declare function universalCascade(movedTask: Task, newStart: Date, newEnd: Date, allTasks: Task[], businessDays?: boolean, weekendPredicate?: (date: Date) => boolean, context?: CascadeContext, rootIsRollup?: boolean): Task[];
603
606
 
604
607
  /**
605
608
  * Recalculate all task dates when switching between business/calendar day modes.
@@ -728,7 +731,7 @@ declare function isTaskParent(taskId: string, tasks: Task[]): boolean;
728
731
  * - startDate = min(children.startDate) or own startDate if no children
729
732
  * - endDate = max(children.endDate) or own endDate if no children
730
733
  */
731
- declare function computeParentDates(parentId: string, tasks: Task[]): {
734
+ declare function computeParentDates(parentId: string, tasks: Task[], businessDays?: boolean, weekendPredicate?: (date: Date) => boolean): {
732
735
  startDate: Date;
733
736
  endDate: Date;
734
737
  };
@@ -838,7 +841,7 @@ type ScaleTaskSubtreeWarning = {
838
841
  requestedDuration: number;
839
842
  minimumDuration: number;
840
843
  };
841
- type ScaleTaskSubtreeErrorCode = 'INVALID_TARGET_DURATION' | 'TASK_NOT_FOUND' | 'NOT_A_PARENT' | 'INVALID_HIERARCHY' | 'INVALID_DEPENDENCIES' | 'INVALID_DATES' | 'INVALID_MINIMUM' | 'EXTERNAL_DEPENDENCY_CONFLICT';
844
+ type ScaleTaskSubtreeErrorCode = 'INVALID_TARGET_DURATION' | 'TASK_NOT_FOUND' | 'NOT_A_PARENT' | 'INVALID_HIERARCHY' | 'INVALID_DEPENDENCIES' | 'INVALID_DATES' | 'INVALID_MINIMUM' | 'FIXED_DATE_CONFLICT' | 'EXTERNAL_DEPENDENCY_CONFLICT';
842
845
  type ScaleTaskSubtreeResult = {
843
846
  ok: true;
844
847
  changedTasks: Task[];
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-Cue-aV4x.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-Cue-aV4x.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-r9kDy05N.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-r9kDy05N.mjs';
4
4
  import * as react_jsx_runtime from 'react/jsx-runtime';
5
5
  import * as RadixPopover from '@radix-ui/react-popover';
6
6
 
@@ -445,6 +445,9 @@ interface Task {
445
445
  startDate: string | Date;
446
446
  /** Task end date (ISO string or Date object) */
447
447
  endDate: string | Date;
448
+ /** Optional fixed date-only boundaries; null or absence leaves the boundary automatic. */
449
+ fixedStartDate?: string | null;
450
+ fixedEndDate?: string | null;
448
451
  /** Optional baseline start date for planned schedule visualization */
449
452
  baselineStartDate?: string | Date;
450
453
  /** Optional baseline end date for planned schedule visualization */
@@ -739,6 +742,8 @@ interface TaskChartSharedProps<TTask extends Task = Task> {
739
742
  renderTaskListActions?: (context: TaskListActionContext<TTask>) => React$1.ReactNode;
740
743
  /** Replace/compose the menu; commands contains the configured taskListMenuCommands UI. */
741
744
  renderTaskListMenu?: (context: TaskListActionContext<TTask>, commands: React$1.ReactNode) => React$1.ReactNode;
745
+ /** Optional consumer-owned action beside each task date. */
746
+ renderTaskDateAction?: (task: TTask, boundary: 'start' | 'end') => React$1.ReactNode;
742
747
  /** Hide row action controls in the TaskList for table-like read/edit presentations. */
743
748
  hideTaskListRowActions?: boolean;
744
749
  /** Returns an extra CSS class name for a TaskList row. */
@@ -1262,6 +1267,7 @@ interface TaskListProps {
1262
1267
  taskListMenuCommands?: TaskListMenuCommand<Task>[];
1263
1268
  renderTaskListActions?: (context: TaskListActionContext<Task>) => React$1.ReactNode;
1264
1269
  renderTaskListMenu?: (context: TaskListActionContext<Task>, commands: React$1.ReactNode) => React$1.ReactNode;
1270
+ renderTaskDateAction?: (task: Task, boundary: 'start' | 'end') => React$1.ReactNode;
1265
1271
  /** Hide row action controls such as insert, hierarchy action buttons, and the context menu trigger. */
1266
1272
  hideTaskListRowActions?: boolean;
1267
1273
  /** Returns an extra CSS class name for a TaskList row. */
@@ -1876,7 +1882,7 @@ declare function flattenHierarchy<T extends HierarchyTask>(tasks: T[]): T[];
1876
1882
  * taking precedence over any hardcoded parent values from the input.
1877
1883
  * Also normalizes task dates to ensure startDate is always before or equal to endDate.
1878
1884
  */
1879
- declare function normalizeHierarchyTasks<T extends HierarchyTask>(tasks: T[]): T[];
1885
+ declare function normalizeHierarchyTasks<T extends HierarchyTask>(tasks: T[], businessDays?: boolean, weekendPredicate?: (date: Date) => boolean): T[];
1880
1886
 
1881
1887
  interface ResourceTimelineLayoutOptions {
1882
1888
  monthStart: Date;
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-Cue-aV4x.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-Cue-aV4x.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-r9kDy05N.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-r9kDy05N.js';
4
4
  import * as react_jsx_runtime from 'react/jsx-runtime';
5
5
  import * as RadixPopover from '@radix-ui/react-popover';
6
6
 
@@ -445,6 +445,9 @@ interface Task {
445
445
  startDate: string | Date;
446
446
  /** Task end date (ISO string or Date object) */
447
447
  endDate: string | Date;
448
+ /** Optional fixed date-only boundaries; null or absence leaves the boundary automatic. */
449
+ fixedStartDate?: string | null;
450
+ fixedEndDate?: string | null;
448
451
  /** Optional baseline start date for planned schedule visualization */
449
452
  baselineStartDate?: string | Date;
450
453
  /** Optional baseline end date for planned schedule visualization */
@@ -739,6 +742,8 @@ interface TaskChartSharedProps<TTask extends Task = Task> {
739
742
  renderTaskListActions?: (context: TaskListActionContext<TTask>) => React$1.ReactNode;
740
743
  /** Replace/compose the menu; commands contains the configured taskListMenuCommands UI. */
741
744
  renderTaskListMenu?: (context: TaskListActionContext<TTask>, commands: React$1.ReactNode) => React$1.ReactNode;
745
+ /** Optional consumer-owned action beside each task date. */
746
+ renderTaskDateAction?: (task: TTask, boundary: 'start' | 'end') => React$1.ReactNode;
742
747
  /** Hide row action controls in the TaskList for table-like read/edit presentations. */
743
748
  hideTaskListRowActions?: boolean;
744
749
  /** Returns an extra CSS class name for a TaskList row. */
@@ -1262,6 +1267,7 @@ interface TaskListProps {
1262
1267
  taskListMenuCommands?: TaskListMenuCommand<Task>[];
1263
1268
  renderTaskListActions?: (context: TaskListActionContext<Task>) => React$1.ReactNode;
1264
1269
  renderTaskListMenu?: (context: TaskListActionContext<Task>, commands: React$1.ReactNode) => React$1.ReactNode;
1270
+ renderTaskDateAction?: (task: Task, boundary: 'start' | 'end') => React$1.ReactNode;
1265
1271
  /** Hide row action controls such as insert, hierarchy action buttons, and the context menu trigger. */
1266
1272
  hideTaskListRowActions?: boolean;
1267
1273
  /** Returns an extra CSS class name for a TaskList row. */
@@ -1876,7 +1882,7 @@ declare function flattenHierarchy<T extends HierarchyTask>(tasks: T[]): T[];
1876
1882
  * taking precedence over any hardcoded parent values from the input.
1877
1883
  * Also normalizes task dates to ensure startDate is always before or equal to endDate.
1878
1884
  */
1879
- declare function normalizeHierarchyTasks<T extends HierarchyTask>(tasks: T[]): T[];
1885
+ declare function normalizeHierarchyTasks<T extends HierarchyTask>(tasks: T[], businessDays?: boolean, weekendPredicate?: (date: Date) => boolean): T[];
1880
1886
 
1881
1887
  interface ResourceTimelineLayoutOptions {
1882
1888
  monthStart: Date;