gantt-lib 0.100.0 → 0.101.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 +4 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.js +105 -79
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +105 -79
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -362,13 +362,14 @@ interface TableMatrixProps<TTask extends Task = Task> {
|
|
|
362
362
|
columnGroups?: Array<TableMatrixColumnGroup>;
|
|
363
363
|
rowHeight: number;
|
|
364
364
|
headerHeight: number;
|
|
365
|
+
bodyMinHeight?: number | string;
|
|
365
366
|
selectedTaskId?: string | null;
|
|
366
367
|
onTaskSelect?: (taskId: string | null) => void;
|
|
367
368
|
onCellClick?: (context: TableMatrixCellClickContext<TTask>) => void;
|
|
368
369
|
highlightedTaskIds?: Set<string>;
|
|
369
370
|
filterMode?: 'highlight' | 'hide';
|
|
370
371
|
}
|
|
371
|
-
declare function TableMatrix<TTask extends Task = Task>({ tasks, allTasks, columns, columnGroups, rowHeight, headerHeight, selectedTaskId, onTaskSelect, onCellClick, highlightedTaskIds, filterMode, }: TableMatrixProps<TTask>): react_jsx_runtime.JSX.Element;
|
|
372
|
+
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;
|
|
372
373
|
|
|
373
374
|
/**
|
|
374
375
|
* Task data structure for Gantt chart
|
|
@@ -874,6 +875,8 @@ interface TaskListProps {
|
|
|
874
875
|
hideTaskListRowActions?: boolean;
|
|
875
876
|
/** Global number of visible content lines used to size every row consistently. */
|
|
876
877
|
rowContentLines?: number;
|
|
878
|
+
/** Optional minimum height for the data body area below the sticky header. */
|
|
879
|
+
bodyMinHeight?: number | string;
|
|
877
880
|
/** How task-list date pickers apply start/end edits */
|
|
878
881
|
taskDateChangeMode?: TaskDateChangeMode;
|
|
879
882
|
/** Controlled callback for task-list date picker mode changes */
|
package/dist/index.d.ts
CHANGED
|
@@ -362,13 +362,14 @@ interface TableMatrixProps<TTask extends Task = Task> {
|
|
|
362
362
|
columnGroups?: Array<TableMatrixColumnGroup>;
|
|
363
363
|
rowHeight: number;
|
|
364
364
|
headerHeight: number;
|
|
365
|
+
bodyMinHeight?: number | string;
|
|
365
366
|
selectedTaskId?: string | null;
|
|
366
367
|
onTaskSelect?: (taskId: string | null) => void;
|
|
367
368
|
onCellClick?: (context: TableMatrixCellClickContext<TTask>) => void;
|
|
368
369
|
highlightedTaskIds?: Set<string>;
|
|
369
370
|
filterMode?: 'highlight' | 'hide';
|
|
370
371
|
}
|
|
371
|
-
declare function TableMatrix<TTask extends Task = Task>({ tasks, allTasks, columns, columnGroups, rowHeight, headerHeight, selectedTaskId, onTaskSelect, onCellClick, highlightedTaskIds, filterMode, }: TableMatrixProps<TTask>): react_jsx_runtime.JSX.Element;
|
|
372
|
+
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;
|
|
372
373
|
|
|
373
374
|
/**
|
|
374
375
|
* Task data structure for Gantt chart
|
|
@@ -874,6 +875,8 @@ interface TaskListProps {
|
|
|
874
875
|
hideTaskListRowActions?: boolean;
|
|
875
876
|
/** Global number of visible content lines used to size every row consistently. */
|
|
876
877
|
rowContentLines?: number;
|
|
878
|
+
/** Optional minimum height for the data body area below the sticky header. */
|
|
879
|
+
bodyMinHeight?: number | string;
|
|
877
880
|
/** How task-list date pickers apply start/end edits */
|
|
878
881
|
taskDateChangeMode?: TaskDateChangeMode;
|
|
879
882
|
/** Controlled callback for task-list date picker mode changes */
|
package/dist/index.js
CHANGED
|
@@ -6892,6 +6892,7 @@ var TaskList = ({
|
|
|
6892
6892
|
taskListMenuCommands,
|
|
6893
6893
|
hideTaskListRowActions = false,
|
|
6894
6894
|
rowContentLines = 1,
|
|
6895
|
+
bodyMinHeight,
|
|
6895
6896
|
taskDateChangeMode = "preserve-duration",
|
|
6896
6897
|
onTaskDateChangeModeChange
|
|
6897
6898
|
}) => {
|
|
@@ -7581,84 +7582,94 @@ var TaskList = ({
|
|
|
7581
7582
|
col.id
|
|
7582
7583
|
);
|
|
7583
7584
|
}) }),
|
|
7584
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
7585
|
-
|
|
7586
|
-
|
|
7587
|
-
|
|
7588
|
-
|
|
7589
|
-
|
|
7590
|
-
|
|
7591
|
-
|
|
7592
|
-
|
|
7593
|
-
|
|
7594
|
-
|
|
7595
|
-
|
|
7596
|
-
|
|
7597
|
-
|
|
7598
|
-
|
|
7599
|
-
|
|
7600
|
-
|
|
7601
|
-
|
|
7602
|
-
|
|
7603
|
-
|
|
7604
|
-
|
|
7605
|
-
|
|
7606
|
-
|
|
7607
|
-
|
|
7608
|
-
|
|
7609
|
-
|
|
7610
|
-
|
|
7611
|
-
|
|
7612
|
-
|
|
7613
|
-
|
|
7614
|
-
|
|
7615
|
-
|
|
7616
|
-
|
|
7617
|
-
|
|
7618
|
-
|
|
7619
|
-
|
|
7620
|
-
|
|
7621
|
-
|
|
7622
|
-
|
|
7623
|
-
|
|
7624
|
-
|
|
7625
|
-
|
|
7626
|
-
|
|
7627
|
-
|
|
7628
|
-
|
|
7629
|
-
|
|
7630
|
-
|
|
7631
|
-
|
|
7632
|
-
|
|
7633
|
-
|
|
7634
|
-
|
|
7635
|
-
|
|
7636
|
-
|
|
7637
|
-
|
|
7638
|
-
|
|
7639
|
-
|
|
7640
|
-
|
|
7641
|
-
|
|
7642
|
-
|
|
7643
|
-
|
|
7644
|
-
|
|
7645
|
-
|
|
7646
|
-
|
|
7647
|
-
|
|
7648
|
-
|
|
7649
|
-
|
|
7650
|
-
|
|
7651
|
-
|
|
7652
|
-
|
|
7653
|
-
|
|
7654
|
-
|
|
7655
|
-
|
|
7656
|
-
|
|
7657
|
-
|
|
7658
|
-
|
|
7659
|
-
|
|
7660
|
-
|
|
7661
|
-
|
|
7585
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
7586
|
+
"div",
|
|
7587
|
+
{
|
|
7588
|
+
className: "gantt-tl-body",
|
|
7589
|
+
style: {
|
|
7590
|
+
height: `${totalHeight}px`,
|
|
7591
|
+
minHeight: bodyMinHeight
|
|
7592
|
+
},
|
|
7593
|
+
children: visibleTasks.map((task, index) => {
|
|
7594
|
+
const previousVisibleTask = index > 0 ? visibleTasks[index - 1] : void 0;
|
|
7595
|
+
const canDemoteTask = index === 0 || !task.parentId || previousVisibleTask?.id !== task.parentId;
|
|
7596
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_react12.default.Fragment, { children: [
|
|
7597
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
7598
|
+
TaskListRow,
|
|
7599
|
+
{
|
|
7600
|
+
task,
|
|
7601
|
+
rowIndex: index,
|
|
7602
|
+
taskNumber: originalTaskNumberMap[task.id] || "",
|
|
7603
|
+
taskNumberMap: originalTaskNumberMap,
|
|
7604
|
+
rowHeight,
|
|
7605
|
+
onTasksChange,
|
|
7606
|
+
selectedTaskId,
|
|
7607
|
+
onRowClick: handleRowClick,
|
|
7608
|
+
disableTaskNameEditing,
|
|
7609
|
+
disableDependencyEditing,
|
|
7610
|
+
allTasks: tasks,
|
|
7611
|
+
activeLinkType,
|
|
7612
|
+
onSetActiveLinkType: setActiveLinkType,
|
|
7613
|
+
selectingPredecessorFor,
|
|
7614
|
+
dependencyPickMode,
|
|
7615
|
+
onSetDependencyPickMode: setDependencyPickMode,
|
|
7616
|
+
onSetSelectingPredecessorFor: setSelectingPredecessorFor,
|
|
7617
|
+
onAddDependency: handleAddDependency,
|
|
7618
|
+
onRemoveDependency: handleRemoveDependency,
|
|
7619
|
+
selectedChip,
|
|
7620
|
+
onChipSelect: handleChipSelect,
|
|
7621
|
+
onScrollToTask,
|
|
7622
|
+
onDelete,
|
|
7623
|
+
onAdd,
|
|
7624
|
+
onInsertAfter: handleStartInsertAfter,
|
|
7625
|
+
editingTaskId: propEditingTaskId,
|
|
7626
|
+
isDragging: !disableTaskDrag && draggingIndex === index,
|
|
7627
|
+
isDragOver: !disableTaskDrag && dragOverIndex === index,
|
|
7628
|
+
onDragStart: disableTaskDrag ? void 0 : handleDragStart,
|
|
7629
|
+
onDragOver: disableTaskDrag ? void 0 : handleDragOver,
|
|
7630
|
+
onDrop: disableTaskDrag ? void 0 : handleDrop,
|
|
7631
|
+
onDragEnd: disableTaskDrag ? void 0 : handleDragEnd,
|
|
7632
|
+
collapsedParentIds,
|
|
7633
|
+
onToggleCollapse: handleToggleCollapse,
|
|
7634
|
+
onPromoteTask,
|
|
7635
|
+
onDemoteTask: onDemoteTask ? handleDemoteWrapper : void 0,
|
|
7636
|
+
onUngroupTask,
|
|
7637
|
+
onDuplicateTask: onReorder ? handleDuplicateTask : void 0,
|
|
7638
|
+
canDemoteTask,
|
|
7639
|
+
isLastChild: lastChildIds.has(task.id),
|
|
7640
|
+
nestingDepth: nestingDepthMap.get(task.id) ?? 0,
|
|
7641
|
+
hasVisibleChildren: visibleParentIds.has(task.id),
|
|
7642
|
+
ancestorLineModes: ancestorLineModesMap.get(task.id) ?? [],
|
|
7643
|
+
customDays,
|
|
7644
|
+
isWeekend: isWeekend3,
|
|
7645
|
+
businessDays,
|
|
7646
|
+
defaultTaskDurationDays,
|
|
7647
|
+
isFilterMatch: filterMode === "highlight" ? highlightedTaskIds.has(task.id) : false,
|
|
7648
|
+
isFilterHideMode: filterMode === "hide" && isFilterActive,
|
|
7649
|
+
resolvedColumns,
|
|
7650
|
+
isTaskSelected: effectiveSelectedTaskIds.has(task.id),
|
|
7651
|
+
onTaskSelectionChange: handleToggleTaskSelection,
|
|
7652
|
+
activeCustomCell,
|
|
7653
|
+
onActiveCustomCellChange: setActiveCustomCell,
|
|
7654
|
+
taskListMenuCommands,
|
|
7655
|
+
hideTaskListRowActions,
|
|
7656
|
+
taskDateChangeMode,
|
|
7657
|
+
onTaskDateChangeModeChange
|
|
7658
|
+
}
|
|
7659
|
+
),
|
|
7660
|
+
pendingInsertDisplayTaskId === task.id && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
7661
|
+
NewTaskRow,
|
|
7662
|
+
{
|
|
7663
|
+
rowHeight,
|
|
7664
|
+
onConfirm: handleConfirmInsertedTask,
|
|
7665
|
+
onCancel: handleCancelInsertedTask,
|
|
7666
|
+
nestingDepth: pendingInsert?.nestingDepth ?? 0
|
|
7667
|
+
}
|
|
7668
|
+
)
|
|
7669
|
+
] }, task.id);
|
|
7670
|
+
})
|
|
7671
|
+
}
|
|
7672
|
+
),
|
|
7662
7673
|
isCreating && !pendingInsert && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
7663
7674
|
NewTaskRow,
|
|
7664
7675
|
{
|
|
@@ -9395,6 +9406,7 @@ function TableMatrix({
|
|
|
9395
9406
|
columnGroups,
|
|
9396
9407
|
rowHeight,
|
|
9397
9408
|
headerHeight,
|
|
9409
|
+
bodyMinHeight,
|
|
9398
9410
|
selectedTaskId,
|
|
9399
9411
|
onTaskSelect,
|
|
9400
9412
|
onCellClick,
|
|
@@ -9511,7 +9523,10 @@ function TableMatrix({
|
|
|
9511
9523
|
"div",
|
|
9512
9524
|
{
|
|
9513
9525
|
className: "gantt-mx-body",
|
|
9514
|
-
style: {
|
|
9526
|
+
style: {
|
|
9527
|
+
height: `${tasks.length * rowHeight}px`,
|
|
9528
|
+
minHeight: bodyMinHeight
|
|
9529
|
+
},
|
|
9515
9530
|
children: tasks.map((task, index) => {
|
|
9516
9531
|
const isHighlighted = filterMode === "highlight" && !!highlightedTaskIds?.has(task.id);
|
|
9517
9532
|
const isParent = parentTaskIds.has(task.id);
|
|
@@ -10051,6 +10066,15 @@ function TaskGanttChartInner(props, ref) {
|
|
|
10051
10066
|
[effectiveRowHeight, visibleTasks.length]
|
|
10052
10067
|
);
|
|
10053
10068
|
const timelineHeaderHeight = headerHeight + 1;
|
|
10069
|
+
const tableBodyMinHeight = (0, import_react16.useMemo)(() => {
|
|
10070
|
+
if (!isTableMatrixMode || containerHeight === void 0) {
|
|
10071
|
+
return void 0;
|
|
10072
|
+
}
|
|
10073
|
+
if (typeof containerHeight === "number") {
|
|
10074
|
+
return Math.max(0, containerHeight - timelineHeaderHeight);
|
|
10075
|
+
}
|
|
10076
|
+
return `calc(${containerHeight} - ${timelineHeaderHeight}px)`;
|
|
10077
|
+
}, [containerHeight, isTableMatrixMode, timelineHeaderHeight]);
|
|
10054
10078
|
const monthStart = (0, import_react16.useMemo)(() => {
|
|
10055
10079
|
if (dateRange.length === 0) {
|
|
10056
10080
|
return new Date(Date.UTC((/* @__PURE__ */ new Date()).getUTCFullYear(), (/* @__PURE__ */ new Date()).getUTCMonth(), 1));
|
|
@@ -10613,6 +10637,7 @@ function TaskGanttChartInner(props, ref) {
|
|
|
10613
10637
|
taskListMenuCommands,
|
|
10614
10638
|
hideTaskListRowActions,
|
|
10615
10639
|
rowContentLines: resolvedRowContentLines,
|
|
10640
|
+
bodyMinHeight: tableBodyMinHeight,
|
|
10616
10641
|
taskDateChangeMode,
|
|
10617
10642
|
onTaskDateChangeModeChange: handleTaskDateChangeMode
|
|
10618
10643
|
}
|
|
@@ -10635,6 +10660,7 @@ function TaskGanttChartInner(props, ref) {
|
|
|
10635
10660
|
columnGroups: matrixColumnGroups,
|
|
10636
10661
|
rowHeight: effectiveRowHeight,
|
|
10637
10662
|
headerHeight: timelineHeaderHeight,
|
|
10663
|
+
bodyMinHeight: tableBodyMinHeight,
|
|
10638
10664
|
selectedTaskId,
|
|
10639
10665
|
onTaskSelect: handleTaskSelect,
|
|
10640
10666
|
onCellClick: onMatrixCellClick,
|