@thepocman/gantt-task-react 1.0.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/LICENSE +21 -0
- package/README.md +197 -0
- package/dist/change-metadata/get-dependent-tasks.d.ts +3 -0
- package/dist/change-metadata/get-task-indexes.d.ts +9 -0
- package/dist/components/calendar/calendar.d.ts +19 -0
- package/dist/components/calendar/default-render-bottom-header.d.ts +3 -0
- package/dist/components/calendar/default-render-top-header.d.ts +2 -0
- package/dist/components/calendar/top-part-of-calendar.d.ts +14 -0
- package/dist/components/context-menu/index.d.ts +14 -0
- package/dist/components/context-menu/menu-option.d.ts +10 -0
- package/dist/components/gantt/default-check-is-holiday.d.ts +2 -0
- package/dist/components/gantt/default-get-copied-task-id.d.ts +2 -0
- package/dist/components/gantt/default-round-date.d.ts +2 -0
- package/dist/components/gantt/default-round-end-date.d.ts +2 -0
- package/dist/components/gantt/default-round-start-date.d.ts +2 -0
- package/dist/components/gantt/gantt.d.ts +3 -0
- package/dist/components/gantt/task-gantt-content.d.ts +49 -0
- package/dist/components/gantt/task-gantt.d.ts +23 -0
- package/dist/components/gantt/use-context-menu.d.ts +7 -0
- package/dist/components/gantt/use-create-relation.d.ts +16 -0
- package/dist/components/gantt/use-get-task-current-state.d.ts +14 -0
- package/dist/components/gantt/use-handle-action.d.ts +20 -0
- package/dist/components/gantt/use-holidays.d.ts +14 -0
- package/dist/components/gantt/use-horizontal-scrollbars.d.ts +2 -0
- package/dist/components/gantt/use-selection.d.ts +18 -0
- package/dist/components/gantt/use-tablelist-resize.d.ts +2 -0
- package/dist/components/gantt/use-task-drag.d.ts +25 -0
- package/dist/components/gantt/use-vertical-scrollbars.d.ts +2 -0
- package/dist/components/grid/grid-body.d.ts +19 -0
- package/dist/components/grid/grid.d.ts +4 -0
- package/dist/components/other/arrow.d.ts +27 -0
- package/dist/components/other/bar-fix-width.d.ts +13 -0
- package/dist/components/other/fix-dependency-position.d.ts +14 -0
- package/dist/components/other/relation-line.d.ts +9 -0
- package/dist/components/other/tooltip.d.ts +24 -0
- package/dist/components/task-item/bar/bar-date-handle.d.ts +12 -0
- package/dist/components/task-item/bar/bar-display.d.ts +19 -0
- package/dist/components/task-item/bar/bar-progress-handle.d.ts +8 -0
- package/dist/components/task-item/bar/bar-relation-handle.d.ts +11 -0
- package/dist/components/task-item/bar/bar-small.d.ts +6 -0
- package/dist/components/task-item/bar/bar.d.ts +6 -0
- package/dist/components/task-item/milestone/milestone.d.ts +6 -0
- package/dist/components/task-item/project/project-display.d.ts +21 -0
- package/dist/components/task-item/task-item.d.ts +41 -0
- package/dist/components/task-item/task-warning.d.ts +14 -0
- package/dist/components/task-list/TaskListHeaderActions.d.ts +9 -0
- package/dist/components/task-list/columns/add-column.d.ts +3 -0
- package/dist/components/task-list/columns/date-end-column.d.ts +3 -0
- package/dist/components/task-list/columns/date-start-column.d.ts +3 -0
- package/dist/components/task-list/columns/delete-column.d.ts +3 -0
- package/dist/components/task-list/columns/dependencies-column.d.ts +3 -0
- package/dist/components/task-list/columns/edit-column.d.ts +3 -0
- package/dist/components/task-list/columns/title-column.d.ts +3 -0
- package/dist/components/task-list/task-list-header.d.ts +4 -0
- package/dist/components/task-list/task-list-table-row.d.ts +40 -0
- package/dist/components/task-list/task-list-table.d.ts +3 -0
- package/dist/components/task-list/task-list.d.ts +84 -0
- package/dist/constants.d.ts +2 -0
- package/dist/context-menu-options/copy.d.ts +2 -0
- package/dist/context-menu-options/cut.d.ts +2 -0
- package/dist/context-menu-options/delete.d.ts +2 -0
- package/dist/context-menu-options/index.d.ts +4 -0
- package/dist/context-menu-options/paste.d.ts +2 -0
- package/dist/gantt-task-react.es.js +13077 -0
- package/dist/gantt-task-react.umd.js +13090 -0
- package/dist/helpers/adjust-task-to-working-dates.d.ts +12 -0
- package/dist/helpers/bar-helper.d.ts +11 -0
- package/dist/helpers/check-has-children.d.ts +2 -0
- package/dist/helpers/check-is-descendant.d.ts +2 -0
- package/dist/helpers/check-is-real-task.d.ts +2 -0
- package/dist/helpers/check-task-has-dependency-warning.d.ts +2 -0
- package/dist/helpers/collect-parents.d.ts +2 -0
- package/dist/helpers/collect-visible-tasks.d.ts +2 -0
- package/dist/helpers/compare-dates.d.ts +1 -0
- package/dist/helpers/copy-tasks.d.ts +2 -0
- package/dist/helpers/count-holidays.d.ts +2 -0
- package/dist/helpers/date-helper.d.ts +4 -0
- package/dist/helpers/generate-triangle-points.d.ts +1 -0
- package/dist/helpers/get-all-descendants.d.ts +2 -0
- package/dist/helpers/get-change-task-metadata.d.ts +13 -0
- package/dist/helpers/get-child-out-of-parent-warnings.d.ts +2 -0
- package/dist/helpers/get-childs-and-roots.d.ts +5 -0
- package/dist/helpers/get-critical-path.d.ts +2 -0
- package/dist/helpers/get-date-by-offset.d.ts +2 -0
- package/dist/helpers/get-dates-diff.d.ts +2 -0
- package/dist/helpers/get-dependency-map-and-warnings.d.ts +2 -0
- package/dist/helpers/get-initial-closed-tasks.d.ts +2 -0
- package/dist/helpers/get-map-task-to-coordinates.d.ts +7 -0
- package/dist/helpers/get-map-task-to-global-index.d.ts +5 -0
- package/dist/helpers/get-map-task-to-nested-index.d.ts +2 -0
- package/dist/helpers/get-map-task-to-row-index-with-grouping.d.ts +7 -0
- package/dist/helpers/get-map-task-to-row-index.d.ts +10 -0
- package/dist/helpers/get-previous-next-working-date.d.ts +3 -0
- package/dist/helpers/get-relation-circle-by-coordinates.d.ts +2 -0
- package/dist/helpers/get-task-coordinates.d.ts +4 -0
- package/dist/helpers/get-task-row-index.d.ts +2 -0
- package/dist/helpers/get-task-to-has-dependency-warning-map.d.ts +2 -0
- package/dist/helpers/get-tasks-map.d.ts +5 -0
- package/dist/helpers/round-task-dates.d.ts +7 -0
- package/dist/helpers/sort-tasks.d.ts +2 -0
- package/dist/helpers/sort-visible-tasks.d.ts +2 -0
- package/dist/helpers/use-optimized-list.d.ts +24 -0
- package/dist/helpers/use-task-tooltip.d.ts +12 -0
- package/dist/index.d.ts +13 -0
- package/dist/selected-tasks/get-parent-tasks.d.ts +2 -0
- package/dist/selected-tasks/get-selected-tasks.d.ts +2 -0
- package/dist/selected-tasks/get-tasks-with-descendants.d.ts +2 -0
- package/dist/style.css +563 -0
- package/dist/suggestions/change-start-and-end-descendants.d.ts +10 -0
- package/dist/test/date-helper.test.d.ts +1 -0
- package/dist/test/gant.test.d.ts +1 -0
- package/dist/types/gantt-task-actions.d.ts +9 -0
- package/dist/types/public-types.d.ts +860 -0
- package/package.json +133 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { BarMoveAction, DateExtremity, GanttDateRounding, Task } from "../types/public-types";
|
|
2
|
+
type AdjustTaskToWorkingDatesParams = {
|
|
3
|
+
action: BarMoveAction;
|
|
4
|
+
changedTask: Task;
|
|
5
|
+
checkIsHoliday: (date: Date, dateExtremity: DateExtremity) => boolean;
|
|
6
|
+
getNextWorkingDate: (date: Date, action: BarMoveAction, dateExtremity: DateExtremity) => Date;
|
|
7
|
+
getPreviousWorkingDate: (date: Date, action: BarMoveAction, dateExtremity: DateExtremity) => Date;
|
|
8
|
+
originalTask: Task;
|
|
9
|
+
dateMoveStep: GanttDateRounding;
|
|
10
|
+
};
|
|
11
|
+
export declare const adjustTaskToWorkingDates: ({ action, changedTask, checkIsHoliday, getNextWorkingDate, getPreviousWorkingDate, originalTask, dateMoveStep, }: AdjustTaskToWorkingDatesParams) => Task;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { BarMoveAction, Task, TaskCoordinates, ViewMode } from "../types/public-types";
|
|
2
|
+
export declare const taskXCoordinate: (xDate: Date, startDate: Date, viewMode: ViewMode, columnWidth: number) => number;
|
|
3
|
+
export declare const progressWithByParams: (taskX1: number, taskX2: number, progress: number, rtl: boolean) => [number, number];
|
|
4
|
+
export declare const getProgressPoint: (progressX: number, taskY: number, taskHeight: number) => string;
|
|
5
|
+
/**
|
|
6
|
+
* Method handles event in real time(mousemove) and on finish(mouseup)
|
|
7
|
+
*/
|
|
8
|
+
export declare const handleTaskBySVGMouseEvent: (action: BarMoveAction, selectedTask: Task, initialCoordinates: TaskCoordinates, coordinates: TaskCoordinates, xStep: number, timeStep: number, rtl: boolean) => {
|
|
9
|
+
isChanged: boolean;
|
|
10
|
+
changedTask: Task;
|
|
11
|
+
};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { ChildByLevelMap, RootMapByLevel, TaskOrEmpty } from "../types/public-types";
|
|
2
|
+
export declare const collectVisibleTasks: (childTasksMap: ChildByLevelMap, rootTasksMap: RootMapByLevel, enableTaskGrouping: boolean) => [readonly TaskOrEmpty[], Readonly<Record<string, true>>];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const compareDates: (date1: Date, date2: Date) => number;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { TaskOrEmpty, ViewMode } from "../types/public-types";
|
|
2
|
+
export declare const ganttDateRange: (tasks: readonly TaskOrEmpty[], viewMode: ViewMode, preStepsCount: number) => [Date, Date, number];
|
|
3
|
+
export declare const getWeekNumberISO8601: (date: Date) => string;
|
|
4
|
+
export declare const getDaysInMonth: (month: number, year: number) => number;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const generateTrianglePoints: (x: number, y: number, width: number, isLeftDirected: boolean) => string;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import type { ChildByLevelMap, Task, TaskOrEmpty } from "../types/public-types";
|
|
2
|
+
export declare const getAllDescendants: <IsCollectEmpty extends boolean, ResultItem extends TaskOrEmpty = IsCollectEmpty extends true ? TaskOrEmpty : Task>(task: Task, childTasksMap: ChildByLevelMap, isCollectEmpty: IsCollectEmpty) => readonly ResultItem[];
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { AdjustTaskToWorkingDatesParams, ChangeAction, ChangeMetadata, ChildByLevelMap, DependentMap, Task, TaskMapByLevel, TaskToGlobalIndexMap } from "../types/public-types";
|
|
2
|
+
type GetChangeTaskMetadataParams = {
|
|
3
|
+
adjustTaskToWorkingDates: (params: AdjustTaskToWorkingDatesParams) => Task;
|
|
4
|
+
changeAction: ChangeAction;
|
|
5
|
+
childTasksMap: ChildByLevelMap;
|
|
6
|
+
dependentMap: DependentMap;
|
|
7
|
+
isMoveChildsWithParent: boolean;
|
|
8
|
+
isUpdateDisabledParentsOnChange: boolean;
|
|
9
|
+
mapTaskToGlobalIndex: TaskToGlobalIndexMap;
|
|
10
|
+
tasksMap: TaskMapByLevel;
|
|
11
|
+
};
|
|
12
|
+
export declare const getChangeTaskMetadata: ({ adjustTaskToWorkingDates, changeAction, childTasksMap, dependentMap, isMoveChildsWithParent, isUpdateDisabledParentsOnChange, mapTaskToGlobalIndex, tasksMap, }: GetChangeTaskMetadataParams) => ChangeMetadata;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ChildByLevelMap, RootMapByLevel, TaskOrEmpty } from "../types/public-types";
|
|
2
|
+
/**
|
|
3
|
+
* @param tasks List of tasks
|
|
4
|
+
*/
|
|
5
|
+
export declare const getChildsAndRoots: (tasks: readonly TaskOrEmpty[], checkIsRoot: (task: TaskOrEmpty) => boolean) => [ChildByLevelMap, RootMapByLevel];
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { ChildByLevelMap, CriticalPaths, DependencyMap, DependencyMargins, RootMapByLevel, TaskMapByLevel } from "../types/public-types";
|
|
2
|
+
export declare const getCriticalPath: (rootTasksMap: RootMapByLevel, childTasksMap: ChildByLevelMap, tasksMap: TaskMapByLevel, dependencyMarginsMap: DependencyMargins, dependencyMap: DependencyMap) => CriticalPaths;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import type { DependencyMap, DependencyMargins, DependentMap, MapTaskToCoordinates, TaskMapByLevel, TaskOrEmpty } from "../types/public-types";
|
|
2
|
+
export declare const getDependencyMapAndWarnings: (tasks: readonly TaskOrEmpty[], visibleTasksMirror: Readonly<Record<string, true>>, tasksMap: TaskMapByLevel, mapTaskToCoordinates: MapTaskToCoordinates, fullRowHeight: number, isShowDependencyWarnings: boolean, isShowCriticalPath: boolean) => [DependencyMap, DependentMap, DependencyMargins];
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Distances, MapTaskToCoordinates, Task, TaskCoordinates, TaskOrEmpty, TaskToRowIndexMap, ViewMode } from "../types/public-types";
|
|
2
|
+
export declare const countTaskCoordinates: (task: Task, taskToRowIndexMap: TaskToRowIndexMap, startDate: Date, viewMode: ViewMode, rtl: boolean, fullRowHeight: number, taskHeight: number, taskYOffset: number, distances: Distances, svgWidth: number, sequentialOffset?: number) => TaskCoordinates;
|
|
3
|
+
/**
|
|
4
|
+
* @param tasks List of tasks
|
|
5
|
+
*/
|
|
6
|
+
export declare const getMapTaskToCoordinates: (tasks: readonly TaskOrEmpty[], visibleTasksMirror: Readonly<Record<string, true>>, taskToRowIndexMap: TaskToRowIndexMap, startDate: Date, viewMode: ViewMode, rtl: boolean, fullRowHeight: number, taskHeight: number, taskYOffset: number, distances: Distances, svgWidth: number) => MapTaskToCoordinates;
|
|
7
|
+
export declare const countTaskCoordinatesWithGrouping: (task: Task, taskToRowIndexMap: TaskToRowIndexMap, startDate: Date, viewMode: ViewMode, rtl: boolean, fullRowHeight: number, taskHeight: number, taskYOffset: number, distances: Distances, svgWidth: number, sequentialOffset?: number) => TaskCoordinates;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { GlobalRowIndexToTaskMap, RowIndexToTaskMap, RowIndexToTasksMap, TaskOrEmpty, TaskToRowIndexMap } from "../types/public-types";
|
|
2
|
+
export declare const getMapTaskToRowIndexWithGrouping: (tasks: readonly TaskOrEmpty[], comparisonLevels: number, isGrouped?: boolean) => [
|
|
3
|
+
TaskToRowIndexMap,
|
|
4
|
+
RowIndexToTaskMap,
|
|
5
|
+
GlobalRowIndexToTaskMap,
|
|
6
|
+
RowIndexToTasksMap
|
|
7
|
+
];
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { GlobalRowIndexToTaskMap, RowIndexToTaskMap, TaskOrEmpty, TaskToRowIndexMap } from "../types/public-types";
|
|
2
|
+
/**
|
|
3
|
+
* @param sortedTasks Sorted list of visible tasks
|
|
4
|
+
* @param comparisonLevels Number of comparison levels
|
|
5
|
+
*/
|
|
6
|
+
export declare const getMapTaskToRowIndex: (visibleTasks: readonly TaskOrEmpty[], comparisonLevels: number) => [
|
|
7
|
+
TaskToRowIndexMap,
|
|
8
|
+
RowIndexToTaskMap,
|
|
9
|
+
GlobalRowIndexToTaskMap
|
|
10
|
+
];
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { BarMoveAction, DateExtremity, GanttDateRounding } from "../types/public-types";
|
|
2
|
+
export declare const getNextWorkingDate: (date: Date, action: BarMoveAction, roundDate: (date: Date, action: BarMoveAction, dateExtremity: DateExtremity) => Date, dateExtremity: DateExtremity, checkIsHoliday: (date: Date, dateExtremity: DateExtremity) => boolean, dateMoveStep: GanttDateRounding) => Date;
|
|
3
|
+
export declare const getPreviousWorkingDate: (date: Date, action: BarMoveAction, roundDate: (date: Date, action: BarMoveAction, dateExtremity: DateExtremity) => Date, dateExtremity: DateExtremity, checkIsHoliday: (date: Date, dateExtremity: DateExtremity) => boolean, dateMoveStep: GanttDateRounding) => Date;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { DateExtremity, Task, TaskCoordinates, TaskOrEmpty } from "../types/public-types";
|
|
2
|
+
export declare const getRelationCircleByCoordinates: (svgP: DOMPoint, tasks: readonly TaskOrEmpty[], taskHalfHeight: number, relationCircleOffset: number, relationCircleRadius: number, rtl: boolean, mapTaskToCoordinatesOnLevel: Map<string, TaskCoordinates>) => [Task, DateExtremity] | null;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { MapTaskToCoordinates, Task, TaskCoordinates } from "../types/public-types";
|
|
2
|
+
export declare const getMapTaskToCoordinatesOnLevel: (task: Task, mapTaskToCoordinates: MapTaskToCoordinates) => Map<string, TaskCoordinates>;
|
|
3
|
+
export declare const getCoordinatesOnLevel: (taskId: string, mapTaskToCoordinatesOnLevel: Map<string, TaskCoordinates>) => TaskCoordinates;
|
|
4
|
+
export declare const getTaskCoordinates: (task: Task, mapTaskToCoordinates: MapTaskToCoordinates) => TaskCoordinates;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type BarMoveAction, type DateExtremity, type GanttDateRounding, type Task } from "../types/public-types";
|
|
2
|
+
export declare const ONE_HOUR_DURATION: number;
|
|
3
|
+
export declare const ONE_DAY_DURATION: number;
|
|
4
|
+
export declare const roundTaskDates: (task: Task, roundDate: (date: Date, action: BarMoveAction, dateExtremity: DateExtremity) => Date, action: BarMoveAction, dateMoveStep: GanttDateRounding) => Task;
|
|
5
|
+
export declare const incrementDate: (date: Date, action: BarMoveAction, roundDate: (date: Date, action: BarMoveAction, dateExtremity: DateExtremity) => Date, dateExtremity: DateExtremity, dateMoveStep: GanttDateRounding, limitDateMoveToOneDay: boolean) => Date;
|
|
6
|
+
export declare const decrementDate: (date: Date, action: BarMoveAction, roundDate: (date: Date, action: BarMoveAction, dateExtremity: DateExtremity) => Date, dateExtremity: DateExtremity, dateMoveStep: GanttDateRounding, limitDateMoveToOneDay: boolean) => Date;
|
|
7
|
+
export declare const getStepTime: (dateMoveStep: GanttDateRounding) => number;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { RefObject } from 'react';
|
|
2
|
+
export type OptimizedListParams = [
|
|
3
|
+
/**
|
|
4
|
+
* start index
|
|
5
|
+
*/
|
|
6
|
+
number,
|
|
7
|
+
/**
|
|
8
|
+
* end index
|
|
9
|
+
*/
|
|
10
|
+
number,
|
|
11
|
+
/**
|
|
12
|
+
* is scrolled to start
|
|
13
|
+
*/
|
|
14
|
+
boolean,
|
|
15
|
+
/**
|
|
16
|
+
* is scrolled to end
|
|
17
|
+
*/
|
|
18
|
+
boolean,
|
|
19
|
+
/**
|
|
20
|
+
* client width/height of element
|
|
21
|
+
*/
|
|
22
|
+
number
|
|
23
|
+
];
|
|
24
|
+
export declare const useOptimizedList: (containerRef: RefObject<Element>, property: 'scrollTop' | 'scrollLeft', cellSize: number) => OptimizedListParams;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { ChangeInProgress, Task } from "../types/public-types";
|
|
3
|
+
export declare const useTaskTooltip: (changeInProgress: ChangeInProgress | null) => {
|
|
4
|
+
tooltipTask: Task;
|
|
5
|
+
tooltipX: number;
|
|
6
|
+
tooltipY: number;
|
|
7
|
+
tooltipStrategy: import("@floating-ui/utils").Strategy;
|
|
8
|
+
setFloatingRef: (node: HTMLElement) => void;
|
|
9
|
+
getReferenceProps: (userProps?: import("react").HTMLProps<Element>) => Record<string, unknown>;
|
|
10
|
+
getFloatingProps: (userProps?: import("react").HTMLProps<HTMLElement>) => Record<string, unknown>;
|
|
11
|
+
onChangeTooltipTask: (nextTask: Task | null, element: Element | null) => void;
|
|
12
|
+
};
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export { Gantt } from "./components/gantt/gantt";
|
|
2
|
+
export { defaultRenderBottomHeader } from "./components/calendar/default-render-bottom-header";
|
|
3
|
+
export { AddColumn } from "./components/task-list/columns/add-column";
|
|
4
|
+
export { EditColumn } from "./components/task-list/columns/edit-column";
|
|
5
|
+
export { DateEndColumn } from "./components/task-list/columns/date-end-column";
|
|
6
|
+
export { DateStartColumn } from "./components/task-list/columns/date-start-column";
|
|
7
|
+
export { DeleteColumn } from "./components/task-list/columns/delete-column";
|
|
8
|
+
export { DependenciesColumn } from "./components/task-list/columns/dependencies-column";
|
|
9
|
+
export { TitleColumn } from "./components/task-list/columns/title-column";
|
|
10
|
+
export * from "./context-menu-options";
|
|
11
|
+
export * from "./constants";
|
|
12
|
+
export { ViewMode } from "./types/public-types";
|
|
13
|
+
export * from "./types/public-types";
|