@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.
Files changed (114) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +197 -0
  3. package/dist/change-metadata/get-dependent-tasks.d.ts +3 -0
  4. package/dist/change-metadata/get-task-indexes.d.ts +9 -0
  5. package/dist/components/calendar/calendar.d.ts +19 -0
  6. package/dist/components/calendar/default-render-bottom-header.d.ts +3 -0
  7. package/dist/components/calendar/default-render-top-header.d.ts +2 -0
  8. package/dist/components/calendar/top-part-of-calendar.d.ts +14 -0
  9. package/dist/components/context-menu/index.d.ts +14 -0
  10. package/dist/components/context-menu/menu-option.d.ts +10 -0
  11. package/dist/components/gantt/default-check-is-holiday.d.ts +2 -0
  12. package/dist/components/gantt/default-get-copied-task-id.d.ts +2 -0
  13. package/dist/components/gantt/default-round-date.d.ts +2 -0
  14. package/dist/components/gantt/default-round-end-date.d.ts +2 -0
  15. package/dist/components/gantt/default-round-start-date.d.ts +2 -0
  16. package/dist/components/gantt/gantt.d.ts +3 -0
  17. package/dist/components/gantt/task-gantt-content.d.ts +49 -0
  18. package/dist/components/gantt/task-gantt.d.ts +23 -0
  19. package/dist/components/gantt/use-context-menu.d.ts +7 -0
  20. package/dist/components/gantt/use-create-relation.d.ts +16 -0
  21. package/dist/components/gantt/use-get-task-current-state.d.ts +14 -0
  22. package/dist/components/gantt/use-handle-action.d.ts +20 -0
  23. package/dist/components/gantt/use-holidays.d.ts +14 -0
  24. package/dist/components/gantt/use-horizontal-scrollbars.d.ts +2 -0
  25. package/dist/components/gantt/use-selection.d.ts +18 -0
  26. package/dist/components/gantt/use-tablelist-resize.d.ts +2 -0
  27. package/dist/components/gantt/use-task-drag.d.ts +25 -0
  28. package/dist/components/gantt/use-vertical-scrollbars.d.ts +2 -0
  29. package/dist/components/grid/grid-body.d.ts +19 -0
  30. package/dist/components/grid/grid.d.ts +4 -0
  31. package/dist/components/other/arrow.d.ts +27 -0
  32. package/dist/components/other/bar-fix-width.d.ts +13 -0
  33. package/dist/components/other/fix-dependency-position.d.ts +14 -0
  34. package/dist/components/other/relation-line.d.ts +9 -0
  35. package/dist/components/other/tooltip.d.ts +24 -0
  36. package/dist/components/task-item/bar/bar-date-handle.d.ts +12 -0
  37. package/dist/components/task-item/bar/bar-display.d.ts +19 -0
  38. package/dist/components/task-item/bar/bar-progress-handle.d.ts +8 -0
  39. package/dist/components/task-item/bar/bar-relation-handle.d.ts +11 -0
  40. package/dist/components/task-item/bar/bar-small.d.ts +6 -0
  41. package/dist/components/task-item/bar/bar.d.ts +6 -0
  42. package/dist/components/task-item/milestone/milestone.d.ts +6 -0
  43. package/dist/components/task-item/project/project-display.d.ts +21 -0
  44. package/dist/components/task-item/task-item.d.ts +41 -0
  45. package/dist/components/task-item/task-warning.d.ts +14 -0
  46. package/dist/components/task-list/TaskListHeaderActions.d.ts +9 -0
  47. package/dist/components/task-list/columns/add-column.d.ts +3 -0
  48. package/dist/components/task-list/columns/date-end-column.d.ts +3 -0
  49. package/dist/components/task-list/columns/date-start-column.d.ts +3 -0
  50. package/dist/components/task-list/columns/delete-column.d.ts +3 -0
  51. package/dist/components/task-list/columns/dependencies-column.d.ts +3 -0
  52. package/dist/components/task-list/columns/edit-column.d.ts +3 -0
  53. package/dist/components/task-list/columns/title-column.d.ts +3 -0
  54. package/dist/components/task-list/task-list-header.d.ts +4 -0
  55. package/dist/components/task-list/task-list-table-row.d.ts +40 -0
  56. package/dist/components/task-list/task-list-table.d.ts +3 -0
  57. package/dist/components/task-list/task-list.d.ts +84 -0
  58. package/dist/constants.d.ts +2 -0
  59. package/dist/context-menu-options/copy.d.ts +2 -0
  60. package/dist/context-menu-options/cut.d.ts +2 -0
  61. package/dist/context-menu-options/delete.d.ts +2 -0
  62. package/dist/context-menu-options/index.d.ts +4 -0
  63. package/dist/context-menu-options/paste.d.ts +2 -0
  64. package/dist/gantt-task-react.es.js +13077 -0
  65. package/dist/gantt-task-react.umd.js +13090 -0
  66. package/dist/helpers/adjust-task-to-working-dates.d.ts +12 -0
  67. package/dist/helpers/bar-helper.d.ts +11 -0
  68. package/dist/helpers/check-has-children.d.ts +2 -0
  69. package/dist/helpers/check-is-descendant.d.ts +2 -0
  70. package/dist/helpers/check-is-real-task.d.ts +2 -0
  71. package/dist/helpers/check-task-has-dependency-warning.d.ts +2 -0
  72. package/dist/helpers/collect-parents.d.ts +2 -0
  73. package/dist/helpers/collect-visible-tasks.d.ts +2 -0
  74. package/dist/helpers/compare-dates.d.ts +1 -0
  75. package/dist/helpers/copy-tasks.d.ts +2 -0
  76. package/dist/helpers/count-holidays.d.ts +2 -0
  77. package/dist/helpers/date-helper.d.ts +4 -0
  78. package/dist/helpers/generate-triangle-points.d.ts +1 -0
  79. package/dist/helpers/get-all-descendants.d.ts +2 -0
  80. package/dist/helpers/get-change-task-metadata.d.ts +13 -0
  81. package/dist/helpers/get-child-out-of-parent-warnings.d.ts +2 -0
  82. package/dist/helpers/get-childs-and-roots.d.ts +5 -0
  83. package/dist/helpers/get-critical-path.d.ts +2 -0
  84. package/dist/helpers/get-date-by-offset.d.ts +2 -0
  85. package/dist/helpers/get-dates-diff.d.ts +2 -0
  86. package/dist/helpers/get-dependency-map-and-warnings.d.ts +2 -0
  87. package/dist/helpers/get-initial-closed-tasks.d.ts +2 -0
  88. package/dist/helpers/get-map-task-to-coordinates.d.ts +7 -0
  89. package/dist/helpers/get-map-task-to-global-index.d.ts +5 -0
  90. package/dist/helpers/get-map-task-to-nested-index.d.ts +2 -0
  91. package/dist/helpers/get-map-task-to-row-index-with-grouping.d.ts +7 -0
  92. package/dist/helpers/get-map-task-to-row-index.d.ts +10 -0
  93. package/dist/helpers/get-previous-next-working-date.d.ts +3 -0
  94. package/dist/helpers/get-relation-circle-by-coordinates.d.ts +2 -0
  95. package/dist/helpers/get-task-coordinates.d.ts +4 -0
  96. package/dist/helpers/get-task-row-index.d.ts +2 -0
  97. package/dist/helpers/get-task-to-has-dependency-warning-map.d.ts +2 -0
  98. package/dist/helpers/get-tasks-map.d.ts +5 -0
  99. package/dist/helpers/round-task-dates.d.ts +7 -0
  100. package/dist/helpers/sort-tasks.d.ts +2 -0
  101. package/dist/helpers/sort-visible-tasks.d.ts +2 -0
  102. package/dist/helpers/use-optimized-list.d.ts +24 -0
  103. package/dist/helpers/use-task-tooltip.d.ts +12 -0
  104. package/dist/index.d.ts +13 -0
  105. package/dist/selected-tasks/get-parent-tasks.d.ts +2 -0
  106. package/dist/selected-tasks/get-selected-tasks.d.ts +2 -0
  107. package/dist/selected-tasks/get-tasks-with-descendants.d.ts +2 -0
  108. package/dist/style.css +563 -0
  109. package/dist/suggestions/change-start-and-end-descendants.d.ts +10 -0
  110. package/dist/test/date-helper.test.d.ts +1 -0
  111. package/dist/test/gant.test.d.ts +1 -0
  112. package/dist/types/gantt-task-actions.d.ts +9 -0
  113. package/dist/types/public-types.d.ts +860 -0
  114. package/package.json +133 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2020 Maksym Vikarii https://github.com/MaTeMaTuK
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,197 @@
1
+ # gantt-task-react
2
+
3
+ ## Interactive Gantt Chart for React with TypeScript.
4
+
5
+ A highly customizable and interactive Gantt chart component for React with TypeScript support. This repository
6
+ integrates features and enhancements from the
7
+ original [`MaTeMaTuK/gantt-task-react`](https://github.com/MaTeMaTuK/gantt-task-react) ,
8
+ the [`ObeoNetwork/gantt-task-react`](https://github.com/ObeoNetwork/gantt-task-react) fork, and our current development,
9
+ creating a comprehensive solution for managing Gantt charts.
10
+
11
+ ![multi-hierarchy.png](multi-hierarchy.gif)
12
+
13
+ ## Key Features
14
+
15
+ - **Performance Improvements**: Optimized rendering to handle large datasets efficiently, ensuring smooth user
16
+ interactions.
17
+ - **Enhanced Customization**: Allows for more extensive task styling options to match brand-specific requirements.
18
+ - **TypeScript Integration**: Improved type definitions for safer and more efficient development workflows.
19
+ - **Responsive Design**: Improved mobile and tablet support for better usability across different devices.
20
+ - **Dependency Management**: Enhanced task dependency features, allowing for more complex project planning scenarios.
21
+ - **Advanced Timeline Navigation**: Features smooth navigation across different timeframes like months and weeks.
22
+ - **Localization Support**: Offers localization for various languages and date formats.
23
+ - **Event Handling**: Supports comprehensive event handling for interactive features.
24
+ - **QuarterYear View Mode**: Supports viewing tasks in quarterly segments, providing a flexible timeline view.
25
+
26
+ ### Enhancement Summary
27
+
28
+ This repository combines the foundational work of `MaTeMaTuK/gantt-task-react` with enhancements from `ObeoNetwork`,
29
+ including better integration with TypeScript, improved rendering performance for large datasets, and new customization
30
+ options for task styling. The project is further developed in this fork, focusing on additional usability improvements
31
+ and feature expansions.
32
+
33
+ ## Installation
34
+
35
+ Install the package using npm:
36
+
37
+ ```bash
38
+ npm install @wamra/gantt-task-react
39
+ ```
40
+
41
+ ## How to use it
42
+
43
+ ```javascript
44
+ import { Gantt, Task, EventOption, StylingOption, ViewMode, DisplayOption } from '@wamra/gantt-task-react';
45
+ import "@wamra/gantt-task-react/dist/style.css";
46
+
47
+ let tasks: Task[] = [
48
+ {
49
+ start: new Date(2020, 1, 1),
50
+ end: new Date(2020, 1, 2),
51
+ name: 'Idea',
52
+ id: 'Task 0',
53
+ type: 'task',
54
+ progress: 45,
55
+ isDisabled: true,
56
+ styles: { progressColor: '#ffbb54', progressSelectedColor: '#ff9e0d' },
57
+ },
58
+ ...
59
+ ];
60
+ <Gantt tasks={tasks}/>
61
+ ```
62
+
63
+ You may handle actions
64
+
65
+ ```javascript
66
+ <Gantt
67
+ tasks={tasks}
68
+ viewMode={view}
69
+ onDateChange={onTaskChange}
70
+ onTaskDelete={onTaskDelete}
71
+ onProgressChange={onProgressChange}
72
+ onDoubleClick={onDblClick}
73
+ onClick={onClick}
74
+ />
75
+ ```
76
+
77
+ ## How to run example
78
+
79
+ ```
80
+ cd ./example
81
+ npm install
82
+ npm start
83
+ ```
84
+
85
+ ## Gantt Configuration
86
+
87
+ ### GanttProps
88
+
89
+ | Parameter Name | Type | Description |
90
+ | :------------------------------ | :------------ | :------------------------------------------------- |
91
+ | tasks\* | [Task](#Task) | An array of tasks to display in the Gantt chart. |
92
+ | viewMode | ViewMode | Specifies the time scale for the chart. |
93
+ | onDateChange | function | Callback when a task's start or end date changes. |
94
+ | onProgressChange | function | Callback when a task's progress changes. |
95
+ | onDoubleClick | function | Callback when a task is double-clicked. |
96
+ | onClick | function | Callback when a task is clicked. |
97
+ | rtl | boolean | Right-to-left display mode. |
98
+ | locale | Locale | Localization for date and time formatting. |
99
+ | barBackgroundColor | string | Background color of task bars. |
100
+ | barProgressColor | string | Color of the task bar's progress indicator. |
101
+ | projectBackgroundColor | string | Background color for project tasks. |
102
+ | milestoneBackgroundColor | string | Background color for milestone tasks. |
103
+ | todayColor | string | Color of the "today" indicator line. |
104
+ | arrowColor | string | Color of dependency arrows. |
105
+ | fontFamily | string | Font family for the chart. |
106
+ | fontSize | string | Font size for text within the chart. |
107
+ | rowHeight | number | Height of each row. |
108
+ | columnWidth | number | Width of each time unit column. |
109
+ | ganttHeight | number | Total height of the Gantt chart. |
110
+ | ganttWidth | number | Total width of the Gantt chart. |
111
+ | taskHeight | number | Height of task bars within each row. |
112
+ | dependencies | boolean | Display task dependencies as arrows. |
113
+ | taskListCellWidth | string | Width of the task list cell. Empty to hide. |
114
+ | dragStep | number | Time step for dragging actions, in milliseconds. |
115
+
116
+ ### EventOption
117
+
118
+ | Parameter Name | Type | Description |
119
+ | :----------------- | :---------------------------------------------------------------------------- | :-------------------------------------------------------------------------------------- |
120
+ | onSelect | (task: Task, isSelected: boolean) => void | Function to execute on taskbar select/unselect event. |
121
+ | onDoubleClick | (task: Task) => void | Function to execute on taskbar double-click event. |
122
+ | onClick | (task: Task) => void | Function to execute on taskbar click event. |
123
+ | onDelete\* | (task: Task) => void/boolean/Promise<void>/Promise<boolean> | Function to execute on taskbar delete button press event. |
124
+ | onDateChange\* | (task: Task, children: Task[]) => void/boolean/Promise<void>/Promise<boolean> | Function to execute when dragging taskbar event on timeline finishes. |
125
+ | onProgressChange\* | (task: Task, children: Task[]) => void/boolean/Promise<void>/Promise<boolean> | Function to execute when dragging taskbar progress event finishes. |
126
+ | onExpanderClick\* | onExpanderClick: (task: Task) => void; | Function to execute on the table expander click. |
127
+ | onWheel\* | onWheel: (wheelEvent: WheelEvent) => void; | Function to execute when the mouse wheel is used. |
128
+ | timeStep | number | Time step value for onDateChange. Specify in milliseconds. |
129
+
130
+ > > Chart undoes operation if method returns false or error. Parameter children returns one-level deep records.
131
+
132
+ ### DisplayOption
133
+
134
+ | Parameter Name | Type | Description |
135
+ | :------------------ | :------ | :---------------------------------------------------------------------------------------------------------------------------------------|
136
+ | viewMode | enum | Specifies the time scale. Options: Hour, Quarter Day, Half Day, Day, Week(ISO-8601, 1st day is Monday), Month, QuarterYear, Year. |
137
+ | viewDate | date | Specifies display date and time for display. |
138
+ | preStepsCount | number | Specifies empty space before the first task. |
139
+ | locale | string | Specifies the month name language. Able formats: ISO 639-2, Java Locale. |
140
+ | monthCalendarFormat | string | Specifies the month display on the calendar. |
141
+ | monthTaskListFormat | string | Specifies the month display on the list. |
142
+ | rtl | boolean | Sets rtl mode. |
143
+ | roundDate | | Allows customizing the way the date start/end are rounded. |
144
+ | checkIsHoliday | | Tells if a date is a holiday. Impacts the style of the day and the way the date is adjusted to working days. |
145
+ | dateMoveStep | | An object corresponding to a duration. Gives the step to adjust to the working day when moving the date allowing smooth feedback. |
146
+
147
+ ### StylingOption
148
+
149
+ | Parameter Name | Type | Description |
150
+ |----------------------------|--------|----------------------------------------------------------------------------------------------------------|
151
+ | headerHeight | number | Specifies the header height. |
152
+ | columnWidth | number | Specifies the time period width. |
153
+ | listCellWidth | string | Specifies the task list cell width. Empty string means "no display". |
154
+ | rowHeight | number | Specifies the task row height. |
155
+ | barCornerRadius | number | Specifies the taskbar corner rounding. |
156
+ | barFill | number | Specifies the taskbar occupation, in percent from 0 to 100. |
157
+ | handleWidth | number | Specifies the width of the taskbar drag control for start and end dates. |
158
+ | fontFamily | string | Specifies the font family for the application. |
159
+ | fontSize | string | Specifies the font size for the application. |
160
+ | barProgressColor | string | Specifies the taskbar progress fill color globally. |
161
+ | barProgressSelectedColor | string | Specifies the taskbar progress fill color globally when selected. |
162
+ | barBackgroundColor | string | Specifies the taskbar background fill color globally. |
163
+ | barBackgroundSelectedColor | string | Specifies the taskbar background fill color globally when selected. |
164
+ | arrowColor | string | Specifies the relationship arrow fill color. |
165
+ | arrowIndent | number | Specifies the relationship arrow right indent, in px. |
166
+ | todayColor | string | Specifies the current period column fill color. |
167
+ | TooltipContent | `React.FC<{ task: Task; fontSize: string; fontFamily: string; }>;` | Specifies the Tooltip view for selected taskbar. |
168
+ | TaskListHeader | `React.FC<{ headerHeight: number; rowWidth: string; fontFamily: string; fontSize: string;}>;` | Specifies the task list Header view |
169
+ | TaskListTable | `React.FC<{ rowHeight: number; rowWidth: string; fontFamily: string; fontSize: string; locale: string; tasks: Task[]; selectedTaskId: string; setSelectedTask: (taskId: string) => void; }>;` | Specifies the task list Table view |
170
+
171
+ ### Task
172
+
173
+ | Parameter Name | Type | Description |
174
+ | :------------- | :------- | :---------------------------------------------------------------------------------------------------- |
175
+ | id\* | string | Task id. |
176
+ | name\* | string | Task display name. |
177
+ | type\* | string | Task display type: **task**, **milestone**, **project** |
178
+ | start\* | Date | Task start date. |
179
+ | end\* | Date | Task end date. |
180
+ | progress\* | number | Task progress. Sets in percent from 0 to 100. |
181
+ | assignees\* | string[] | List of people assigned to the task |
182
+ | dependencies | string[] | Specifies the parent dependencies ids. |
183
+ | styles | object | Specifies the taskbar styling settings locally. Object is passed with the following attributes: |
184
+ | | | - **backgroundColor**: String. Specifies the taskbar background fill color locally. |
185
+ | | | - **backgroundSelectedColor**: String. Specifies the taskbar background fill color locally on select. |
186
+ | | | - **progressColor**: String. Specifies the taskbar progress fill color locally. |
187
+ | | | - **progressSelectedColor**: String. Specifies the taskbar progress fill color globally on select. |
188
+ | isDisabled | bool | Disables all action for current task. |
189
+ | fontSize | string | Specifies the taskbar font size locally. |
190
+ | project | string | Task project name |
191
+ | hideChildren | bool | Hide children items. Parameter works with project type only |
192
+
193
+ > > *Required
194
+
195
+ ## License
196
+
197
+ [MIT](https://oss.ninja/mit/jaredpalmer/)
@@ -0,0 +1,3 @@
1
+ import type { ChangeAction, DependentMap, Task, TaskOrEmpty } from "../types/public-types";
2
+ export declare const fillDependentTasksForTask: (resSet: Set<Task>, task: TaskOrEmpty, dependentMap: DependentMap) => void;
3
+ export declare const getDependentTasks: (changeAction: ChangeAction, dependentMap: DependentMap) => Task[];
@@ -0,0 +1,9 @@
1
+ import type { ChangeAction, TaskOrEmpty, TaskToGlobalIndexMap } from "../types/public-types";
2
+ export declare const getTaskIndex: (task: TaskOrEmpty, mapTaskToGlobalIndex: TaskToGlobalIndexMap) => {
3
+ task: TaskOrEmpty;
4
+ index: number;
5
+ };
6
+ export declare const getTaskIndexes: (changeAction: ChangeAction, mapTaskToGlobalIndex: TaskToGlobalIndexMap) => {
7
+ task: TaskOrEmpty;
8
+ index: number;
9
+ }[];
@@ -0,0 +1,19 @@
1
+ import React from "react";
2
+ import { DateSetup, RenderTopHeader, RenderBottomHeader, Distances, ColorStyles } from "../../types/public-types";
3
+ export type CalendarProps = {
4
+ additionalLeftSpace: number;
5
+ dateSetup: DateSetup;
6
+ distances: Distances;
7
+ endColumnIndex: number;
8
+ fontFamily: string;
9
+ fontSize: string;
10
+ fullSvgWidth: number;
11
+ getDate: (index: number) => Date;
12
+ isUnknownDates: boolean;
13
+ renderBottomHeader?: RenderBottomHeader;
14
+ renderTopHeader?: RenderTopHeader;
15
+ rtl: boolean;
16
+ startColumnIndex: number;
17
+ colors: Partial<ColorStyles>;
18
+ };
19
+ export declare const Calendar: React.FC<CalendarProps>;
@@ -0,0 +1,3 @@
1
+ import type { ReactNode } from "react";
2
+ import { DateSetup, ViewMode } from "../../types/public-types";
3
+ export declare const defaultRenderBottomHeader: (date: Date, viewMode: ViewMode, dateSetup: DateSetup, index: number, isUnknownDates: boolean) => ReactNode;
@@ -0,0 +1,2 @@
1
+ import { DateSetup, ViewMode } from "../../types/public-types";
2
+ export declare const defaultRenderTopHeader: (date: Date, viewMode: ViewMode, dateSetup: DateSetup) => string;
@@ -0,0 +1,14 @@
1
+ import React from "react";
2
+ import type { ReactNode } from "react";
3
+ import { ColorStyles } from "../../types/public-types";
4
+ type TopPartOfCalendarProps = {
5
+ value: ReactNode | null;
6
+ x1Line: number;
7
+ y1Line: number;
8
+ y2Line: number;
9
+ xText: number;
10
+ yText: number;
11
+ colors: Partial<ColorStyles>;
12
+ };
13
+ export declare const TopPartOfCalendar: React.FC<TopPartOfCalendarProps>;
14
+ export {};
@@ -0,0 +1,14 @@
1
+ import type { ReactElement } from "react";
2
+ import type { ActionMetaType, ColorStyles, ContextMenuOptionType, ContextMenuType, Distances, TaskOrEmpty } from "../../types/public-types";
3
+ type ContextMenuProps = {
4
+ checkHasCopyTasks: () => boolean;
5
+ checkHasCutTasks: () => boolean;
6
+ contextMenu: ContextMenuType;
7
+ colors: ColorStyles;
8
+ distances: Distances;
9
+ handleAction: (task: TaskOrEmpty, action: (meta: ActionMetaType) => void) => void;
10
+ handleCloseContextMenu: () => void;
11
+ options: ContextMenuOptionType[];
12
+ };
13
+ export declare function ContextMenu({ checkHasCopyTasks, checkHasCutTasks, colors, colors: { contextMenuBgColor, contextMenuBoxShadow }, contextMenu: { task, x, y }, distances, handleAction, handleCloseContextMenu, options, }: ContextMenuProps): ReactElement;
14
+ export {};
@@ -0,0 +1,10 @@
1
+ import type { ReactElement } from "react";
2
+ import type { ColorStyles, ContextMenuOptionType, Distances } from "../../types/public-types";
3
+ type MenuOptionProps = {
4
+ colors: ColorStyles;
5
+ distances: Distances;
6
+ handleAction: (option: ContextMenuOptionType) => void;
7
+ option: ContextMenuOptionType;
8
+ };
9
+ export declare function MenuOption({ colors: { contextMenuTextColor }, distances: { contextMenuIconWidth, contextMenuOptionHeight, contextMenuSidePadding, }, handleAction, option, option: { icon, label }, }: MenuOptionProps): ReactElement;
10
+ export {};
@@ -0,0 +1,2 @@
1
+ import { DateSetup } from '../../types/public-types';
2
+ export declare const defaultCheckIsHoliday: (date: Date, minTaskDate: Date, dateSetup: DateSetup) => boolean;
@@ -0,0 +1,2 @@
1
+ import type { GetCopiedTaskId } from "../../types/public-types";
2
+ export declare const defaultGetCopiedTaskId: GetCopiedTaskId;
@@ -0,0 +1,2 @@
1
+ import { DateExtremity, ViewMode } from "../../types/public-types";
2
+ export declare const defaultRoundDate: (date: Date, viewMode: ViewMode, dateExtremity: DateExtremity) => Date;
@@ -0,0 +1,2 @@
1
+ import { ViewMode } from "../../types/public-types";
2
+ export declare const defaultRoundEndDate: (date: Date, viewMode: ViewMode) => Date;
@@ -0,0 +1,2 @@
1
+ import { ViewMode } from "../../types/public-types";
2
+ export declare const defaultRoundStartDate: (date: Date, viewMode: ViewMode) => Date;
@@ -0,0 +1,3 @@
1
+ import React from "react";
2
+ import { GanttProps } from "../../types/public-types";
3
+ export declare const Gantt: React.FC<GanttProps>;
@@ -0,0 +1,49 @@
1
+ import type { MouseEvent } from "react";
2
+ import React from "react";
3
+ import type { OptimizedListParams } from "../../helpers/use-optimized-list";
4
+ import { GanttRelationEvent } from "../../types/gantt-task-actions";
5
+ import { BarMoveAction, ChildByLevelMap, ChildOutOfParentWarnings, ColorStyles, CriticalPaths, DateExtremity, DependencyMap, DependentMap, Distances, FixPosition, GlobalRowIndexToTaskMap, RelationKind, Task, TaskContextualPaletteProps, TaskCoordinates, TaskDependencyContextualPaletteProps, TaskOrEmpty, TaskToHasDependencyWarningMap } from "../../types/public-types";
6
+ export type TaskGanttContentProps = {
7
+ authorizedRelations: RelationKind[];
8
+ additionalLeftSpace: number;
9
+ additionalRightSpace: number;
10
+ childOutOfParentWarnings: ChildOutOfParentWarnings | null;
11
+ childTasksMap: ChildByLevelMap;
12
+ colorStyles: ColorStyles;
13
+ comparisonLevels: number;
14
+ criticalPaths: CriticalPaths | null;
15
+ dependencyMap: DependencyMap;
16
+ dependentMap: DependentMap;
17
+ distances: Distances;
18
+ fixEndPosition?: FixPosition;
19
+ fixStartPosition?: FixPosition;
20
+ fontFamily: string;
21
+ fontSize: string;
22
+ fullRowHeight: number;
23
+ ganttRelationEvent: GanttRelationEvent | null;
24
+ getTaskCoordinates: (task: Task) => TaskCoordinates;
25
+ getTaskGlobalIndexByRef: (task: Task) => number;
26
+ handleBarRelationStart: (target: DateExtremity, task: Task) => void;
27
+ handleDeleteTasks: (task: TaskOrEmpty[]) => void;
28
+ handleFixDependency: (task: Task, delta: number) => void;
29
+ handleTaskDragStart: (action: BarMoveAction, task: Task, clientX: number, taskRootNode: Element) => void;
30
+ isShowDependencyWarnings: boolean;
31
+ mapGlobalRowIndexToTask: GlobalRowIndexToTaskMap;
32
+ onArrowClick?: (taskFrom: Task, extremityFrom: DateExtremity, taskTo: Task, extremityTo: DateExtremity, event: React.MouseEvent<SVGElement>) => void;
33
+ onArrowDoubleClick: (taskFrom: Task, taskTo: Task) => void;
34
+ onClick?: (task: Task, event: React.MouseEvent<SVGElement>) => void;
35
+ onDoubleClick?: (task: Task) => void;
36
+ renderedRowIndexes: OptimizedListParams | null;
37
+ rtl: boolean;
38
+ selectTaskOnMouseDown: (taskId: string, event: MouseEvent) => void;
39
+ selectedIdsMirror: Readonly<Record<string, true>>;
40
+ setTooltipTask: (task: Task | null, element: Element | null) => void;
41
+ taskToHasDependencyWarningMap: TaskToHasDependencyWarningMap | null;
42
+ taskYOffset: number;
43
+ visibleTasksMirror: Readonly<Record<string, true>>;
44
+ taskHeight: number;
45
+ taskHalfHeight: number;
46
+ ContextualPalette?: React.FC<TaskContextualPaletteProps>;
47
+ TaskDependencyContextualPalette?: React.FC<TaskDependencyContextualPaletteProps>;
48
+ };
49
+ export declare const TaskGanttContent: React.FC<TaskGanttContentProps>;
@@ -0,0 +1,23 @@
1
+ import type { RefObject } from "react";
2
+ import React, { SyntheticEvent } from "react";
3
+ import { ColorStyles, Distances } from "../../types/public-types";
4
+ import { CalendarProps } from "../calendar/calendar";
5
+ import { GridProps } from "../grid/grid";
6
+ import { TaskGanttContentProps } from "./task-gantt-content";
7
+ export type TaskGanttProps = {
8
+ barProps: TaskGanttContentProps;
9
+ calendarProps: CalendarProps;
10
+ enableTaskGrouping?: boolean;
11
+ gridProps: GridProps;
12
+ distances: Distances;
13
+ fullRowHeight: number;
14
+ fullSvgWidth: number;
15
+ ganttFullHeight: number;
16
+ ganttSVGRef: RefObject<SVGSVGElement>;
17
+ ganttTaskContentRef: RefObject<HTMLDivElement>;
18
+ onVerticalScrollbarScrollX: (event: SyntheticEvent<HTMLDivElement>) => void;
19
+ ganttTaskRootRef: RefObject<HTMLDivElement>;
20
+ onScrollGanttContentVertically: (event: SyntheticEvent<HTMLDivElement>) => void;
21
+ colors: Partial<ColorStyles>;
22
+ };
23
+ export declare const TaskGantt: React.NamedExoticComponent<TaskGanttProps>;
@@ -0,0 +1,7 @@
1
+ import type { RefObject } from 'react';
2
+ import type { ContextMenuType, TaskOrEmpty } from '../../types/public-types';
3
+ export declare const useContextMenu: (wrapperRef: RefObject<HTMLDivElement>) => {
4
+ contextMenu: ContextMenuType;
5
+ handleCloseContextMenu: () => void;
6
+ handleOpenContextMenu: (task: TaskOrEmpty, clientX: number, clientY: number) => void;
7
+ };
@@ -0,0 +1,16 @@
1
+ import type { RefObject } from "react";
2
+ import { GanttRelationEvent } from "../../types/gantt-task-actions";
3
+ import { DateExtremity, Distances, MapTaskToCoordinates, OnRelationChange, Task, TaskMapByLevel, TaskOrEmpty, TaskToGlobalIndexMap } from "../../types/public-types";
4
+ type UseCreateRelationParams = {
5
+ distances: Distances;
6
+ ganttSVGRef: RefObject<SVGSVGElement>;
7
+ mapTaskToCoordinates: MapTaskToCoordinates;
8
+ mapTaskToGlobalIndex: TaskToGlobalIndexMap;
9
+ onRelationChange?: OnRelationChange;
10
+ rtl: boolean;
11
+ taskHalfHeight: number;
12
+ tasksMap: TaskMapByLevel;
13
+ visibleTasks: readonly TaskOrEmpty[];
14
+ };
15
+ export declare const useCreateRelation: ({ distances: { relationCircleOffset, relationCircleRadius }, ganttSVGRef, mapTaskToCoordinates, mapTaskToGlobalIndex, onRelationChange, rtl, taskHalfHeight, tasksMap, visibleTasks, }: UseCreateRelationParams) => [GanttRelationEvent, (extremity: DateExtremity, task: Task) => void];
16
+ export {};
@@ -0,0 +1,14 @@
1
+ import type { AdjustTaskToWorkingDatesParams, BarMoveAction, ChangeInProgress, DateExtremity, GanttDateRounding, MapTaskToCoordinates, Task, TaskMapByLevel } from "../../types/public-types";
2
+ type UseGetTaskCurrentStateParams = {
3
+ adjustTaskToWorkingDates: (params: AdjustTaskToWorkingDatesParams) => Task;
4
+ changeInProgress: ChangeInProgress | null;
5
+ isAdjustToWorkingDates: boolean;
6
+ isMoveChildsWithParent: boolean;
7
+ isUpdateDisabledParentsOnChange: boolean;
8
+ mapTaskToCoordinates: MapTaskToCoordinates;
9
+ roundDate: (date: Date, action: BarMoveAction, dateExtremity: DateExtremity) => Date;
10
+ tasksMap: TaskMapByLevel;
11
+ dateMoveStep: GanttDateRounding;
12
+ };
13
+ export declare const useGetTaskCurrentState: ({ adjustTaskToWorkingDates, changeInProgress, isAdjustToWorkingDates, isMoveChildsWithParent, isUpdateDisabledParentsOnChange, mapTaskToCoordinates, roundDate, tasksMap, dateMoveStep, }: UseGetTaskCurrentStateParams) => (currentOriginalTask: Task) => Task;
14
+ export {};
@@ -0,0 +1,20 @@
1
+ import type { ActionMetaType, CheckTaskIdExistsAtLevel, ChildByLevelMap, Task, TaskMapByLevel, TaskOrEmpty } from "../../types/public-types";
2
+ type UseHandleActionParams = {
3
+ checkTaskIdExists: CheckTaskIdExistsAtLevel;
4
+ childTasksMap: ChildByLevelMap;
5
+ copyIdsMirror: Readonly<Record<string, true>>;
6
+ copySelectedTasks: () => void;
7
+ copyTask: (task: TaskOrEmpty) => void;
8
+ cutIdsMirror: Readonly<Record<string, true>>;
9
+ cutSelectedTasks: () => void;
10
+ cutTask: (task: TaskOrEmpty) => void;
11
+ handleAddChilds: (parent: Task, descendants: readonly TaskOrEmpty[]) => void;
12
+ handleDeleteTasks: (tasksForDelete: readonly TaskOrEmpty[]) => void;
13
+ handleMoveTasksInside: (parent: Task, childs: readonly TaskOrEmpty[]) => void;
14
+ makeCopies: (tasksForCopy: readonly TaskOrEmpty[]) => readonly TaskOrEmpty[];
15
+ resetSelectedTasks: () => void;
16
+ selectedIdsMirror: Readonly<Record<string, true>>;
17
+ tasksMap: TaskMapByLevel;
18
+ };
19
+ export declare const useHandleAction: ({ checkTaskIdExists, childTasksMap, copyIdsMirror, copySelectedTasks, copyTask, cutIdsMirror, cutSelectedTasks, cutTask, handleAddChilds, handleDeleteTasks, handleMoveTasksInside, makeCopies, resetSelectedTasks, selectedIdsMirror, tasksMap, }: UseHandleActionParams) => (task: TaskOrEmpty, action: (meta: ActionMetaType) => void) => void;
20
+ export {};
@@ -0,0 +1,14 @@
1
+ import { AdjustTaskToWorkingDatesParams, BarMoveAction, DateExtremity, DateSetup, GanttDateRounding } from "../../types/public-types";
2
+ type UseHolidaysParams = {
3
+ checkIsHolidayProp: (date: Date, minTaskDate: Date, dateSetup: DateSetup, dateExtremity: DateExtremity) => boolean;
4
+ dateSetup: DateSetup;
5
+ isAdjustToWorkingDates: boolean;
6
+ minTaskDate: Date;
7
+ roundDate: (date: Date, action: BarMoveAction, dateExtremity: DateExtremity) => Date;
8
+ dateMoveStep: GanttDateRounding;
9
+ };
10
+ export declare const useHolidays: ({ checkIsHolidayProp, dateSetup, isAdjustToWorkingDates, minTaskDate, roundDate, dateMoveStep, }: UseHolidaysParams) => {
11
+ checkIsHoliday: (date: Date, dateExtremity: DateExtremity) => boolean;
12
+ adjustTaskToWorkingDates: ({ action, changedTask, originalTask, }: AdjustTaskToWorkingDatesParams) => import("../../types/public-types").Task;
13
+ };
14
+ export {};
@@ -0,0 +1,2 @@
1
+ import type { RefObject, SyntheticEvent } from "react";
2
+ export declare const useHorizontalScrollbars: () => [RefObject<HTMLDivElement>, number, (nextScrollX: number) => void, (event: SyntheticEvent<HTMLDivElement>) => void, () => void, () => void];
@@ -0,0 +1,18 @@
1
+ import type { MouseEvent } from "react";
2
+ import type { CheckTaskIdExistsAtLevel, RowIndexToTaskMap, TaskOrEmpty, TaskToRowIndexMap } from "../../types/public-types";
3
+ export declare const useSelection: (taskToRowIndexMap: TaskToRowIndexMap, rowIndexToTaskMap: RowIndexToTaskMap, checkTaskIdExists: CheckTaskIdExistsAtLevel) => {
4
+ checkHasCopyTasks: () => boolean;
5
+ checkHasCutTasks: () => boolean;
6
+ copyIdsMirror: Readonly<Record<string, true>>;
7
+ copySelectedTasks: () => void;
8
+ copyTask: (task: TaskOrEmpty) => void;
9
+ cutIdsMirror: Readonly<Record<string, true>>;
10
+ cutSelectedTasks: () => void;
11
+ cutTask: (task: TaskOrEmpty) => void;
12
+ resetSelectedTasks: () => void;
13
+ selectTask: (taskId: string) => void;
14
+ selectTaskOnMouseDown: (taskId: string, event: MouseEvent) => void;
15
+ selectTasksFromLastSelected: (taskId: string) => void;
16
+ selectedIdsMirror: Readonly<Record<string, true>>;
17
+ toggleTask: (taskId: string) => void;
18
+ };
@@ -0,0 +1,2 @@
1
+ import { Column, Distances, OnResizeColumn } from "../../types/public-types";
2
+ export declare const useTableListResize: (columnsProp: readonly Column[], distances: Distances, onResizeColumn: OnResizeColumn) => [columns: readonly Column[], taskListWidth: number, tableWidth: number, onTableResizeStart: (clientX: number) => void, onColumnResizeStart: (columnIndex: number, clientX: number) => void];
@@ -0,0 +1,25 @@
1
+ import { RefObject } from "react";
2
+ import { ChangeInProgress, ChildByLevelMap, DependentMap, MapTaskToCoordinates, TaskToGlobalIndexMap, Task, TaskMapByLevel, DateExtremity, BarMoveAction, GanttDateRounding } from "../../types/public-types";
3
+ type UseTaskDragParams = {
4
+ childTasksMap: ChildByLevelMap;
5
+ dependentMap: DependentMap;
6
+ ganttSVGRef: RefObject<SVGSVGElement>;
7
+ mapTaskToCoordinates: MapTaskToCoordinates;
8
+ mapTaskToGlobalIndex: TaskToGlobalIndexMap;
9
+ onDateChange: (action: BarMoveAction, changedTask: Task, originalTask: Task) => void;
10
+ onProgressChange: (task: Task) => void;
11
+ roundDate: (date: Date, action: BarMoveAction, dateExtremity: DateExtremity) => Date;
12
+ dateMoveStep: GanttDateRounding;
13
+ rtl: boolean;
14
+ scrollToLeftStep: () => void;
15
+ scrollToRightStep: () => void;
16
+ scrollX: number;
17
+ setScrollXProgrammatically: (nextScrollX: number) => void;
18
+ svgClientWidth: number | null;
19
+ svgWidth: number;
20
+ tasksMap: TaskMapByLevel;
21
+ timeStep: number;
22
+ xStep: number;
23
+ };
24
+ export declare const useTaskDrag: ({ childTasksMap, dependentMap, ganttSVGRef, mapTaskToCoordinates, mapTaskToGlobalIndex, onDateChange, onProgressChange, roundDate, dateMoveStep, rtl, scrollToLeftStep, scrollToRightStep, scrollX, setScrollXProgrammatically, svgClientWidth, svgWidth, tasksMap, timeStep, xStep, }: UseTaskDragParams) => [ChangeInProgress, (action: BarMoveAction, task: Task, clientX: number, taskRootNode: Element) => void];
25
+ export {};
@@ -0,0 +1,2 @@
1
+ import type { RefObject, SyntheticEvent } from "react";
2
+ export declare const useVerticalScrollbars: () => [RefObject<HTMLDivElement>, RefObject<HTMLDivElement>, (nextScrollY: number) => void, (event: SyntheticEvent<HTMLDivElement>) => void];
@@ -0,0 +1,19 @@
1
+ import React from "react";
2
+ import type { DateExtremity, ViewMode } from "../../types/public-types";
3
+ export type GridBodyProps = {
4
+ additionalLeftSpace: number;
5
+ columnWidth: number;
6
+ ganttFullHeight: number;
7
+ isUnknownDates: boolean;
8
+ startDate: Date;
9
+ todayColor: string;
10
+ holidayBackgroundColor: string;
11
+ rtl: boolean;
12
+ viewMode: ViewMode;
13
+ startColumnIndex: number;
14
+ endColumnIndex: number;
15
+ checkIsHoliday: (date: Date, dateExtremity: DateExtremity) => boolean;
16
+ getDate: (index: number) => Date;
17
+ minTaskDate: Date;
18
+ };
19
+ export declare const GridBody: React.NamedExoticComponent<GridBodyProps>;
@@ -0,0 +1,4 @@
1
+ import React from "react";
2
+ import { GridBodyProps } from "./grid-body";
3
+ export type GridProps = GridBodyProps;
4
+ export declare const Grid: React.FC<GridProps>;
@@ -0,0 +1,27 @@
1
+ import React from "react";
2
+ import { ColorStyles, Distances, DateExtremity, Task } from "../../types/public-types";
3
+ type ArrowProps = {
4
+ colorStyles: ColorStyles;
5
+ distances: Distances;
6
+ taskFrom: Task;
7
+ extremityFrom: DateExtremity;
8
+ fromX1: number;
9
+ fromX2: number;
10
+ fromY: number;
11
+ taskTo: Task;
12
+ extremityTo: DateExtremity;
13
+ toX1: number;
14
+ toX2: number;
15
+ toY: number;
16
+ marginBetweenTasks?: number | null;
17
+ fullRowHeight: number;
18
+ taskHeight: number;
19
+ isShowDependencyWarnings: boolean;
20
+ isCritical: boolean;
21
+ rtl: boolean;
22
+ onArrowDoubleClick?: (taskFrom: Task, taskTo: Task) => void;
23
+ onArrowClick?: (taskFrom: Task, extremityFrom: DateExtremity, taskTo: Task, extremityTo: DateExtremity, event: React.MouseEvent<SVGElement>) => void;
24
+ handleFixDependency: (task: Task, delta: number) => void;
25
+ };
26
+ export declare const Arrow: React.NamedExoticComponent<ArrowProps>;
27
+ export {};
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ export declare const fixWidthContainerClass: string;
3
+ type BarFixWidthProps = {
4
+ x: number;
5
+ y: number;
6
+ width: number;
7
+ height: number;
8
+ isLeft: boolean;
9
+ color: string;
10
+ handleFixWidth: () => void;
11
+ };
12
+ export declare const BarFixWidth: React.NamedExoticComponent<BarFixWidthProps>;
13
+ export {};