gantt-lib 0.83.0 → 0.84.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 +6 -1
- package/dist/index.d.ts +6 -1
- package/dist/index.js +14 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +14 -5
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -304,6 +304,7 @@ declare const progressInRange: (min: number, max: number) => TaskPredicate;
|
|
|
304
304
|
declare const nameContains: (substring: string, caseSensitive?: boolean) => TaskPredicate;
|
|
305
305
|
|
|
306
306
|
type BuiltInTaskListColumnId = 'number' | 'name' | 'startDate' | 'endDate' | 'duration' | 'progress' | 'dependencies' | 'actions';
|
|
307
|
+
type TaskListColumnId = BuiltInTaskListColumnId | (string & {});
|
|
307
308
|
type TaskListColumnAnchor = {
|
|
308
309
|
after: BuiltInTaskListColumnId | string;
|
|
309
310
|
} | {
|
|
@@ -500,6 +501,8 @@ interface GanttModeProps<TTask extends Task = Task> {
|
|
|
500
501
|
showChart?: boolean;
|
|
501
502
|
/** Additional custom columns to render in the TaskList after built-in columns */
|
|
502
503
|
additionalColumns?: TaskListColumn<TTask>[];
|
|
504
|
+
/** Built-in or custom TaskList column IDs to hide after column placement is resolved */
|
|
505
|
+
hiddenTaskListColumns?: readonly TaskListColumnId[];
|
|
503
506
|
/** Additional commands rendered in the TaskList row three-dots menu */
|
|
504
507
|
taskListMenuCommands?: TaskListMenuCommand<TTask>[];
|
|
505
508
|
}
|
|
@@ -771,6 +774,8 @@ interface TaskListProps {
|
|
|
771
774
|
isFilterActive?: boolean;
|
|
772
775
|
/** Additional columns to display after built-in columns */
|
|
773
776
|
additionalColumns?: TaskListColumn<any>[];
|
|
777
|
+
/** Built-in or custom TaskList column IDs to hide after column placement is resolved */
|
|
778
|
+
hiddenTaskListColumns?: readonly TaskListColumnId[];
|
|
774
779
|
/** Additional commands rendered in each row three-dots menu */
|
|
775
780
|
taskListMenuCommands?: TaskListMenuCommand<Task>[];
|
|
776
781
|
}
|
|
@@ -1264,4 +1269,4 @@ interface VisibleReorderPosition {
|
|
|
1264
1269
|
*/
|
|
1265
1270
|
declare function getVisibleReorderPosition(orderedTasks: TaskLike[], visibleTasks: TaskLike[], movedTaskId: string, originVisibleIndex: number, dropVisibleIndex: number): VisibleReorderPosition | null;
|
|
1266
1271
|
|
|
1267
|
-
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, type Task, type TaskDependency, TaskList, type TaskListColumn, type TaskListColumnContext, 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 };
|
|
1272
|
+
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, type Task, 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 };
|
package/dist/index.d.ts
CHANGED
|
@@ -304,6 +304,7 @@ declare const progressInRange: (min: number, max: number) => TaskPredicate;
|
|
|
304
304
|
declare const nameContains: (substring: string, caseSensitive?: boolean) => TaskPredicate;
|
|
305
305
|
|
|
306
306
|
type BuiltInTaskListColumnId = 'number' | 'name' | 'startDate' | 'endDate' | 'duration' | 'progress' | 'dependencies' | 'actions';
|
|
307
|
+
type TaskListColumnId = BuiltInTaskListColumnId | (string & {});
|
|
307
308
|
type TaskListColumnAnchor = {
|
|
308
309
|
after: BuiltInTaskListColumnId | string;
|
|
309
310
|
} | {
|
|
@@ -500,6 +501,8 @@ interface GanttModeProps<TTask extends Task = Task> {
|
|
|
500
501
|
showChart?: boolean;
|
|
501
502
|
/** Additional custom columns to render in the TaskList after built-in columns */
|
|
502
503
|
additionalColumns?: TaskListColumn<TTask>[];
|
|
504
|
+
/** Built-in or custom TaskList column IDs to hide after column placement is resolved */
|
|
505
|
+
hiddenTaskListColumns?: readonly TaskListColumnId[];
|
|
503
506
|
/** Additional commands rendered in the TaskList row three-dots menu */
|
|
504
507
|
taskListMenuCommands?: TaskListMenuCommand<TTask>[];
|
|
505
508
|
}
|
|
@@ -771,6 +774,8 @@ interface TaskListProps {
|
|
|
771
774
|
isFilterActive?: boolean;
|
|
772
775
|
/** Additional columns to display after built-in columns */
|
|
773
776
|
additionalColumns?: TaskListColumn<any>[];
|
|
777
|
+
/** Built-in or custom TaskList column IDs to hide after column placement is resolved */
|
|
778
|
+
hiddenTaskListColumns?: readonly TaskListColumnId[];
|
|
774
779
|
/** Additional commands rendered in each row three-dots menu */
|
|
775
780
|
taskListMenuCommands?: TaskListMenuCommand<Task>[];
|
|
776
781
|
}
|
|
@@ -1264,4 +1269,4 @@ interface VisibleReorderPosition {
|
|
|
1264
1269
|
*/
|
|
1265
1270
|
declare function getVisibleReorderPosition(orderedTasks: TaskLike[], visibleTasks: TaskLike[], movedTaskId: string, originVisibleIndex: number, dropVisibleIndex: number): VisibleReorderPosition | null;
|
|
1266
1271
|
|
|
1267
|
-
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, type Task, type TaskDependency, TaskList, type TaskListColumn, type TaskListColumnContext, 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 };
|
|
1272
|
+
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, type Task, 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 };
|
package/dist/index.js
CHANGED
|
@@ -6434,7 +6434,7 @@ function createBuiltInColumns(opts) {
|
|
|
6434
6434
|
}
|
|
6435
6435
|
|
|
6436
6436
|
// src/components/TaskList/columns/resolveTaskListColumns.ts
|
|
6437
|
-
function resolveTaskListColumns(builtIn, custom) {
|
|
6437
|
+
function resolveTaskListColumns(builtIn, custom, hiddenColumnIds = []) {
|
|
6438
6438
|
if (process.env.NODE_ENV !== "production") {
|
|
6439
6439
|
const ids = /* @__PURE__ */ new Set();
|
|
6440
6440
|
for (const col of [...builtIn, ...custom]) {
|
|
@@ -6444,8 +6444,10 @@ function resolveTaskListColumns(builtIn, custom) {
|
|
|
6444
6444
|
ids.add(col.id);
|
|
6445
6445
|
}
|
|
6446
6446
|
}
|
|
6447
|
+
const hiddenIds = new Set(hiddenColumnIds);
|
|
6448
|
+
const filterHiddenColumns = (columns) => hiddenIds.size === 0 ? columns : columns.filter((col) => !hiddenIds.has(col.id));
|
|
6447
6449
|
if (custom.length === 0) {
|
|
6448
|
-
return [...builtIn];
|
|
6450
|
+
return filterHiddenColumns([...builtIn]);
|
|
6449
6451
|
}
|
|
6450
6452
|
const result = [...builtIn];
|
|
6451
6453
|
const lastInsertAfter = /* @__PURE__ */ new Map();
|
|
@@ -6481,7 +6483,7 @@ function resolveTaskListColumns(builtIn, custom) {
|
|
|
6481
6483
|
}
|
|
6482
6484
|
result.splice(insertAt, 0, col);
|
|
6483
6485
|
}
|
|
6484
|
-
return result;
|
|
6486
|
+
return filterHiddenColumns(result);
|
|
6485
6487
|
}
|
|
6486
6488
|
|
|
6487
6489
|
// src/components/TaskList/TaskList.tsx
|
|
@@ -6598,6 +6600,7 @@ var TaskList = ({
|
|
|
6598
6600
|
filteredTaskIds = /* @__PURE__ */ new Set(),
|
|
6599
6601
|
isFilterActive = false,
|
|
6600
6602
|
additionalColumns,
|
|
6603
|
+
hiddenTaskListColumns,
|
|
6601
6604
|
taskListMenuCommands
|
|
6602
6605
|
}) => {
|
|
6603
6606
|
const [internalCollapsedParentIds, setInternalCollapsedParentIds] = (0, import_react12.useState)(/* @__PURE__ */ new Set());
|
|
@@ -7129,8 +7132,12 @@ var TaskList = ({
|
|
|
7129
7132
|
}, [orderedTasks, onReorder]);
|
|
7130
7133
|
const builtInColumns = (0, import_react12.useMemo)(() => createBuiltInColumns({ businessDays }), [businessDays]);
|
|
7131
7134
|
const resolvedColumns = (0, import_react12.useMemo)(
|
|
7132
|
-
() => resolveTaskListColumns(
|
|
7133
|
-
|
|
7135
|
+
() => resolveTaskListColumns(
|
|
7136
|
+
builtInColumns,
|
|
7137
|
+
additionalColumns ?? [],
|
|
7138
|
+
hiddenTaskListColumns
|
|
7139
|
+
),
|
|
7140
|
+
[builtInColumns, additionalColumns, hiddenTaskListColumns]
|
|
7134
7141
|
);
|
|
7135
7142
|
const resolvedColumnWidthTotal = (0, import_react12.useMemo)(
|
|
7136
7143
|
() => resolvedColumns.reduce((sum, col) => sum + (col.width ?? 120), 0),
|
|
@@ -9335,6 +9342,7 @@ function TaskGanttChartInner(props, ref) {
|
|
|
9335
9342
|
disableTaskDrag = false,
|
|
9336
9343
|
showChart = true,
|
|
9337
9344
|
additionalColumns,
|
|
9345
|
+
hiddenTaskListColumns,
|
|
9338
9346
|
taskListMenuCommands
|
|
9339
9347
|
} = props;
|
|
9340
9348
|
const containerRef = (0, import_react15.useRef)(null);
|
|
@@ -9867,6 +9875,7 @@ function TaskGanttChartInner(props, ref) {
|
|
|
9867
9875
|
filteredTaskIds: matchedTaskIds,
|
|
9868
9876
|
isFilterActive: !!taskFilter,
|
|
9869
9877
|
additionalColumns,
|
|
9878
|
+
hiddenTaskListColumns,
|
|
9870
9879
|
taskListMenuCommands
|
|
9871
9880
|
}
|
|
9872
9881
|
),
|