gantt-lib 0.102.0 → 0.104.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.d.mts CHANGED
@@ -305,6 +305,7 @@ declare const nameContains: (substring: string, caseSensitive?: boolean) => Task
305
305
 
306
306
  type BuiltInTaskListColumnId = 'selection' | 'number' | 'name' | 'startDate' | 'endDate' | 'duration' | 'progress' | 'dependencies' | 'actions';
307
307
  type TaskListColumnId = BuiltInTaskListColumnId | (string & {});
308
+ type TaskListColumnWidthMap = Partial<Record<TaskListColumnId, number>>;
308
309
  type TaskListColumnAnchor = {
309
310
  after: BuiltInTaskListColumnId | string;
310
311
  } | {
@@ -343,6 +344,8 @@ interface TableMatrixColumn<TTask extends Task = Task> {
343
344
  width?: number | 'auto';
344
345
  minWidth?: number;
345
346
  maxWidth?: number;
347
+ periodStartDate?: string | Date;
348
+ periodEndDate?: string | Date;
346
349
  groupId?: string;
347
350
  align?: 'left' | 'center' | 'right';
348
351
  className?: string;
@@ -357,6 +360,18 @@ interface TableMatrixCellClickContext<TTask extends Task = Task> {
357
360
  columnIndex: number;
358
361
  event: React$1.MouseEvent<HTMLDivElement>;
359
362
  }
363
+ interface TableMatrixDateOverlay<TTask extends Task = Task> {
364
+ date: string | Date;
365
+ className?: string;
366
+ color?: string;
367
+ edgeColor?: string;
368
+ shouldRender?: (context: {
369
+ task: TTask;
370
+ column: TableMatrixColumn<TTask>;
371
+ rowIndex: number;
372
+ columnIndex: number;
373
+ }) => boolean;
374
+ }
360
375
  interface TableMatrixProps<TTask extends Task = Task> {
361
376
  tasks: TTask[];
362
377
  allTasks?: TTask[];
@@ -368,10 +383,11 @@ interface TableMatrixProps<TTask extends Task = Task> {
368
383
  selectedTaskId?: string | null;
369
384
  onTaskSelect?: (taskId: string | null) => void;
370
385
  onCellClick?: (context: TableMatrixCellClickContext<TTask>) => void;
386
+ dateOverlay?: TableMatrixDateOverlay<TTask> | false;
371
387
  highlightedTaskIds?: Set<string>;
372
388
  filterMode?: 'highlight' | 'hide';
373
389
  }
374
- declare function TableMatrix<TTask extends Task = Task>({ tasks, allTasks, columns, columnGroups, rowHeight, headerHeight, bodyMinHeight, selectedTaskId, onTaskSelect, onCellClick, highlightedTaskIds, filterMode, }: TableMatrixProps<TTask>): react_jsx_runtime.JSX.Element;
390
+ declare function TableMatrix<TTask extends Task = Task>({ tasks, allTasks, columns, columnGroups, rowHeight, headerHeight, bodyMinHeight, selectedTaskId, onTaskSelect, onCellClick, dateOverlay, highlightedTaskIds, filterMode, }: TableMatrixProps<TTask>): react_jsx_runtime.JSX.Element;
375
391
 
376
392
  /**
377
393
  * Task data structure for Gantt chart
@@ -549,6 +565,10 @@ interface TaskChartSharedProps<TTask extends Task = Task> {
549
565
  additionalColumns?: TaskListColumn<TTask>[];
550
566
  /** Built-in or custom TaskList column IDs to hide after column placement is resolved */
551
567
  hiddenTaskListColumns?: readonly TaskListColumnId[];
568
+ /** Initial or controlled TaskList column widths keyed by built-in/custom column id. */
569
+ taskListColumnWidths?: TaskListColumnWidthMap;
570
+ /** Called when the user resizes TaskList columns. */
571
+ onTaskListColumnWidthsChange?: (widths: TaskListColumnWidthMap) => void;
552
572
  /** Additional commands rendered in the TaskList row three-dots menu */
553
573
  taskListMenuCommands?: TaskListMenuCommand<TTask>[];
554
574
  /** Hide row action controls in the TaskList for table-like read/edit presentations. */
@@ -582,6 +602,8 @@ interface TableMatrixModeProps<TTask extends Task = Task> extends TaskChartShare
582
602
  matrixColumnGroups?: Array<TableMatrixColumnGroup>;
583
603
  /** Called when any data cell in the right-side matrix is clicked. */
584
604
  onMatrixCellClick?: (context: TableMatrixCellClickContext<TTask>) => void;
605
+ /** Optional actual-date overlay rendered under matrix cell content for date-ranged columns. */
606
+ matrixDateOverlay?: TableMatrixDateOverlay<TTask> | false;
585
607
  }
586
608
  type GanttChartProps<TTask extends Task = Task, TItem extends ResourceTimelineItem = ResourceTimelineItem> = GanttModeProps<TTask> | TableMatrixModeProps<TTask> | ResourcePlannerChartProps<TItem>;
587
609
  interface ExportToPdfOptions {
@@ -871,6 +893,10 @@ interface TaskListProps {
871
893
  additionalColumns?: TaskListColumn<any>[];
872
894
  /** Built-in or custom TaskList column IDs to hide after column placement is resolved */
873
895
  hiddenTaskListColumns?: readonly TaskListColumnId[];
896
+ /** Initial or controlled TaskList column widths keyed by built-in/custom column id. */
897
+ taskListColumnWidths?: TaskListColumnWidthMap;
898
+ /** Called when the user resizes TaskList columns. */
899
+ onTaskListColumnWidthsChange?: (widths: TaskListColumnWidthMap) => void;
874
900
  /** Additional commands rendered in each row three-dots menu */
875
901
  taskListMenuCommands?: TaskListMenuCommand<Task>[];
876
902
  /** Hide row action controls such as insert, hierarchy action buttons, and the context menu trigger. */
@@ -1380,4 +1406,4 @@ interface VisibleReorderPosition {
1380
1406
  */
1381
1407
  declare function getVisibleReorderPosition(orderedTasks: TaskLike[], visibleTasks: TaskLike[], movedTaskId: string, originVisibleIndex: number, dropVisibleIndex: number): VisibleReorderPosition | null;
1382
1408
 
1383
- 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 TableMatrixModeProps, type Task, TaskDateChangeMode, type TaskDependency, TaskList, type TaskListColumn, type TaskListColumnContext, type TaskListColumnId, 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 };
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 };
package/dist/index.d.ts CHANGED
@@ -305,6 +305,7 @@ declare const nameContains: (substring: string, caseSensitive?: boolean) => Task
305
305
 
306
306
  type BuiltInTaskListColumnId = 'selection' | 'number' | 'name' | 'startDate' | 'endDate' | 'duration' | 'progress' | 'dependencies' | 'actions';
307
307
  type TaskListColumnId = BuiltInTaskListColumnId | (string & {});
308
+ type TaskListColumnWidthMap = Partial<Record<TaskListColumnId, number>>;
308
309
  type TaskListColumnAnchor = {
309
310
  after: BuiltInTaskListColumnId | string;
310
311
  } | {
@@ -343,6 +344,8 @@ interface TableMatrixColumn<TTask extends Task = Task> {
343
344
  width?: number | 'auto';
344
345
  minWidth?: number;
345
346
  maxWidth?: number;
347
+ periodStartDate?: string | Date;
348
+ periodEndDate?: string | Date;
346
349
  groupId?: string;
347
350
  align?: 'left' | 'center' | 'right';
348
351
  className?: string;
@@ -357,6 +360,18 @@ interface TableMatrixCellClickContext<TTask extends Task = Task> {
357
360
  columnIndex: number;
358
361
  event: React$1.MouseEvent<HTMLDivElement>;
359
362
  }
363
+ interface TableMatrixDateOverlay<TTask extends Task = Task> {
364
+ date: string | Date;
365
+ className?: string;
366
+ color?: string;
367
+ edgeColor?: string;
368
+ shouldRender?: (context: {
369
+ task: TTask;
370
+ column: TableMatrixColumn<TTask>;
371
+ rowIndex: number;
372
+ columnIndex: number;
373
+ }) => boolean;
374
+ }
360
375
  interface TableMatrixProps<TTask extends Task = Task> {
361
376
  tasks: TTask[];
362
377
  allTasks?: TTask[];
@@ -368,10 +383,11 @@ interface TableMatrixProps<TTask extends Task = Task> {
368
383
  selectedTaskId?: string | null;
369
384
  onTaskSelect?: (taskId: string | null) => void;
370
385
  onCellClick?: (context: TableMatrixCellClickContext<TTask>) => void;
386
+ dateOverlay?: TableMatrixDateOverlay<TTask> | false;
371
387
  highlightedTaskIds?: Set<string>;
372
388
  filterMode?: 'highlight' | 'hide';
373
389
  }
374
- declare function TableMatrix<TTask extends Task = Task>({ tasks, allTasks, columns, columnGroups, rowHeight, headerHeight, bodyMinHeight, selectedTaskId, onTaskSelect, onCellClick, highlightedTaskIds, filterMode, }: TableMatrixProps<TTask>): react_jsx_runtime.JSX.Element;
390
+ declare function TableMatrix<TTask extends Task = Task>({ tasks, allTasks, columns, columnGroups, rowHeight, headerHeight, bodyMinHeight, selectedTaskId, onTaskSelect, onCellClick, dateOverlay, highlightedTaskIds, filterMode, }: TableMatrixProps<TTask>): react_jsx_runtime.JSX.Element;
375
391
 
376
392
  /**
377
393
  * Task data structure for Gantt chart
@@ -549,6 +565,10 @@ interface TaskChartSharedProps<TTask extends Task = Task> {
549
565
  additionalColumns?: TaskListColumn<TTask>[];
550
566
  /** Built-in or custom TaskList column IDs to hide after column placement is resolved */
551
567
  hiddenTaskListColumns?: readonly TaskListColumnId[];
568
+ /** Initial or controlled TaskList column widths keyed by built-in/custom column id. */
569
+ taskListColumnWidths?: TaskListColumnWidthMap;
570
+ /** Called when the user resizes TaskList columns. */
571
+ onTaskListColumnWidthsChange?: (widths: TaskListColumnWidthMap) => void;
552
572
  /** Additional commands rendered in the TaskList row three-dots menu */
553
573
  taskListMenuCommands?: TaskListMenuCommand<TTask>[];
554
574
  /** Hide row action controls in the TaskList for table-like read/edit presentations. */
@@ -582,6 +602,8 @@ interface TableMatrixModeProps<TTask extends Task = Task> extends TaskChartShare
582
602
  matrixColumnGroups?: Array<TableMatrixColumnGroup>;
583
603
  /** Called when any data cell in the right-side matrix is clicked. */
584
604
  onMatrixCellClick?: (context: TableMatrixCellClickContext<TTask>) => void;
605
+ /** Optional actual-date overlay rendered under matrix cell content for date-ranged columns. */
606
+ matrixDateOverlay?: TableMatrixDateOverlay<TTask> | false;
585
607
  }
586
608
  type GanttChartProps<TTask extends Task = Task, TItem extends ResourceTimelineItem = ResourceTimelineItem> = GanttModeProps<TTask> | TableMatrixModeProps<TTask> | ResourcePlannerChartProps<TItem>;
587
609
  interface ExportToPdfOptions {
@@ -871,6 +893,10 @@ interface TaskListProps {
871
893
  additionalColumns?: TaskListColumn<any>[];
872
894
  /** Built-in or custom TaskList column IDs to hide after column placement is resolved */
873
895
  hiddenTaskListColumns?: readonly TaskListColumnId[];
896
+ /** Initial or controlled TaskList column widths keyed by built-in/custom column id. */
897
+ taskListColumnWidths?: TaskListColumnWidthMap;
898
+ /** Called when the user resizes TaskList columns. */
899
+ onTaskListColumnWidthsChange?: (widths: TaskListColumnWidthMap) => void;
874
900
  /** Additional commands rendered in each row three-dots menu */
875
901
  taskListMenuCommands?: TaskListMenuCommand<Task>[];
876
902
  /** Hide row action controls such as insert, hierarchy action buttons, and the context menu trigger. */
@@ -1380,4 +1406,4 @@ interface VisibleReorderPosition {
1380
1406
  */
1381
1407
  declare function getVisibleReorderPosition(orderedTasks: TaskLike[], visibleTasks: TaskLike[], movedTaskId: string, originVisibleIndex: number, dropVisibleIndex: number): VisibleReorderPosition | null;
1382
1408
 
1383
- 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 TableMatrixModeProps, type Task, TaskDateChangeMode, type TaskDependency, TaskList, type TaskListColumn, type TaskListColumnContext, type TaskListColumnId, 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 };
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 };