gantt-task-react-v 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 +155 -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 +18 -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 +13 -0
- package/dist/components/context-menu/index.d.ts +13 -0
- package/dist/components/context-menu/menu-option.d.ts +10 -0
- package/dist/components/context-menu-options/copy.d.ts +3 -0
- package/dist/components/context-menu-options/cut.d.ts +2 -0
- package/dist/components/context-menu-options/delete.d.ts +2 -0
- package/dist/components/context-menu-options/edit.d.ts +2 -0
- package/dist/components/context-menu-options/index.d.ts +5 -0
- package/dist/components/context-menu-options/paste.d.ts +2 -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-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 +4 -0
- package/dist/components/gantt/task-gantt-content.d.ts +45 -0
- package/dist/components/gantt/task-gantt.d.ts +21 -0
- package/dist/components/gantt/use-context-menu.d.ts +7 -0
- package/dist/components/gantt/use-create-relation.d.ts +18 -0
- package/dist/components/gantt/use-get-task-current-state.d.ts +15 -0
- package/dist/components/gantt/use-handle-action.d.ts +21 -0
- package/dist/components/gantt/use-holidays.d.ts +12 -0
- package/dist/components/gantt/use-horizontal-scrollbars.d.ts +9 -0
- package/dist/components/gantt/use-selection.d.ts +18 -0
- package/dist/components/gantt/use-tablelist-resize.d.ts +9 -0
- package/dist/components/gantt/use-task-drag.d.ts +28 -0
- package/dist/components/gantt/use-vertical-scrollbars.d.ts +11 -0
- package/dist/components/gantt-loader/index.d.ts +6 -0
- package/dist/components/gantt-locale/index.d.ts +8 -0
- package/dist/components/gantt-theme/default-theme.d.ts +2 -0
- package/dist/components/gantt-theme/gantt-theme-builder.d.ts +2 -0
- package/dist/components/gantt-theme/index.d.ts +9 -0
- package/dist/components/gantt-today/index.d.ts +12 -0
- package/dist/components/icons/add-icon.d.ts +2 -0
- package/dist/components/icons/copy-icon.d.ts +2 -0
- package/dist/components/icons/cut-icon.d.ts +2 -0
- package/dist/components/icons/delete-icon.d.ts +2 -0
- package/dist/components/icons/drag-indicator-icon.d.ts +2 -0
- package/dist/components/icons/edit-icon.d.ts +2 -0
- package/dist/components/icons/expand-less-icon.d.ts +2 -0
- package/dist/components/icons/expand-more-icon.d.ts +2 -0
- package/dist/components/icons/paste-icon.d.ts +2 -0
- package/dist/components/other/arrow.d.ts +22 -0
- package/dist/components/other/relation-line.d.ts +9 -0
- package/dist/components/other/tooltip.d.ts +18 -0
- package/dist/components/other/vertical-scroll.d.ts +11 -0
- package/dist/components/task-item/bar/bar-content-small.d.ts +6 -0
- package/dist/components/task-item/bar/bar-date-handle/index.d.ts +13 -0
- package/dist/components/task-item/bar/bar-default.d.ts +1 -0
- package/dist/components/task-item/bar/bar-display.d.ts +19 -0
- package/dist/components/task-item/bar/bar-progress-handle/index.d.ts +10 -0
- package/dist/components/task-item/bar/index.d.ts +3 -0
- package/dist/components/task-item/bar/types.d.ts +8 -0
- package/dist/components/task-item/bar-comparison/index.d.ts +13 -0
- package/dist/components/task-item/bar-relation/bar-relation-handle.d.ts +11 -0
- package/dist/components/task-item/bar-relation/index.d.ts +6 -0
- package/dist/components/task-item/milestone/index.d.ts +8 -0
- package/dist/components/task-item/project/project-display.d.ts +20 -0
- package/dist/components/task-item/task-item.d.ts +36 -0
- package/dist/components/task-item/task-label/index.d.ts +3 -0
- package/dist/components/task-item/task-label/task-center-label.d.ts +7 -0
- package/dist/components/task-item/task-label/task-outline-label.d.ts +3 -0
- package/dist/components/task-item/task-label/task-responsive-label.d.ts +7 -0
- package/dist/components/task-item/task-label/types.d.ts +11 -0
- package/dist/components/task-list/index.d.ts +42 -0
- package/dist/components/task-list/task-list-sortable-table/index.d.ts +3 -0
- package/dist/components/task-list/task-list-sortable-table/keyboardCoordinates.d.ts +3 -0
- package/dist/components/task-list/task-list-sortable-table/types.d.ts +6 -0
- package/dist/components/task-list/task-list-sortable-table/utilities.d.ts +8 -0
- package/dist/components/task-list/task-list-sortable-table-row/index.d.ts +3 -0
- package/dist/components/task-list/task-list-table/index.d.ts +3 -0
- package/dist/components/task-list/task-list-table-columns/add-column.d.ts +3 -0
- package/dist/components/task-list/task-list-table-columns/date-end-column.d.ts +3 -0
- package/dist/components/task-list/task-list-table-columns/date-start-column.d.ts +3 -0
- package/dist/components/task-list/task-list-table-columns/delete-column.d.ts +3 -0
- package/dist/components/task-list/task-list-table-columns/dependencies-column.d.ts +3 -0
- package/dist/components/task-list/task-list-table-columns/edit-column.d.ts +3 -0
- package/dist/components/task-list/task-list-table-columns/title-column.d.ts +3 -0
- package/dist/components/task-list/task-list-table-columns/use-task-list-columns-builder.d.ts +45 -0
- package/dist/components/task-list/task-list-table-headers/index.d.ts +3 -0
- package/dist/components/task-list/task-list-table-row/index.d.ts +3 -0
- package/dist/constants.d.ts +1 -0
- package/dist/gantt-task-react.es.js +19900 -0
- package/dist/gantt-task-react.umd.js +19917 -0
- package/dist/helpers/adjust-task-to-working-dates.d.ts +12 -0
- package/dist/helpers/bar-helper.d.ts +12 -0
- package/dist/helpers/check-has-children.d.ts +2 -0
- package/dist/helpers/check-is-descendant.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-childs-and-roots.d.ts +2 -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.d.ts +2 -0
- package/dist/helpers/get-map-task-to-coordinates.d.ts +3 -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.d.ts +6 -0
- package/dist/helpers/get-min-and-max-childs-map.d.ts +2 -0
- package/dist/helpers/get-next-working-date.d.ts +2 -0
- package/dist/helpers/get-previous-working-date.d.ts +2 -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-tasks-map.d.ts +5 -0
- package/dist/helpers/move-helper.d.ts +4 -0
- package/dist/helpers/obj-helper.d.ts +1 -0
- package/dist/helpers/round-task-dates.d.ts +2 -0
- package/dist/helpers/sort-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/i18n.d.ts +2 -0
- package/dist/index.d.ts +14 -0
- package/dist/locales/en.d.ts +2 -0
- package/dist/locales/index.d.ts +1 -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 +686 -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/common-types.d.ts +114 -0
- package/dist/types/gantt-task-actions.d.ts +9 -0
- package/dist/types/index.d.ts +6 -0
- package/dist/types/internal-types.d.ts +222 -0
- package/dist/types/public-types.d.ts +538 -0
- package/dist/types/theme-locale.d.ts +30 -0
- package/dist/types/theme-types.d.ts +84 -0
- package/package.json +113 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 kvandake https://github.com/kvandake (based on 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,155 @@
|
|
|
1
|
+
# gantt-task-react-v
|
|
2
|
+
|
|
3
|
+
## Interactive Gantt Chart for React with TypeScript - Enhanced with Flexible Height
|
|
4
|
+
|
|
5
|
+
A fork of webagility-gantt-task-react with improvements including flexible height that adapts to content instead of fixed 600px height.
|
|
6
|
+
|
|
7
|
+
## Key Features
|
|
8
|
+
|
|
9
|
+
- **Flexible Height**: No more fixed 600px height limitation - automatically adapts to content
|
|
10
|
+
- **Responsive Design**: Works better with different screen sizes and containers
|
|
11
|
+
- **All Original Features**: Maintains all functionality from the original package
|
|
12
|
+
|
|
13
|
+
## Install
|
|
14
|
+
|
|
15
|
+
```
|
|
16
|
+
npm install gantt-task-react-v
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## How to use it
|
|
20
|
+
|
|
21
|
+
```ts
|
|
22
|
+
import { Gantt, Task, EventOption, StylingOption, ViewMode, DisplayOption } from 'gantt-task-react-v';
|
|
23
|
+
import "gantt-task-react-v/dist/style.css";
|
|
24
|
+
|
|
25
|
+
let tasks: Task[] = [
|
|
26
|
+
{
|
|
27
|
+
start: new Date(2020, 1, 1),
|
|
28
|
+
end: new Date(2020, 1, 2),
|
|
29
|
+
name: 'Idea',
|
|
30
|
+
id: 'Task 0',
|
|
31
|
+
type:'task',
|
|
32
|
+
progress: 45,
|
|
33
|
+
isDisabled: true,
|
|
34
|
+
styles: { progressColor: '#ffbb54', progressSelectedColor: '#ff9e0d' },
|
|
35
|
+
},
|
|
36
|
+
...
|
|
37
|
+
];
|
|
38
|
+
<Gantt tasks={tasks} />
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
You may handle actions
|
|
42
|
+
|
|
43
|
+
```ts
|
|
44
|
+
<Gantt
|
|
45
|
+
tasks={tasks}
|
|
46
|
+
viewMode={view}
|
|
47
|
+
onDateChange={onTaskChange}
|
|
48
|
+
onTaskDelete={onTaskDelete}
|
|
49
|
+
onProgressChange={onProgressChange}
|
|
50
|
+
onDoubleClick={onDblClick}
|
|
51
|
+
onClick={onClick}
|
|
52
|
+
/>
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## How to run example
|
|
56
|
+
|
|
57
|
+
```shell
|
|
58
|
+
yarn storebook
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## Gantt Configuration
|
|
62
|
+
|
|
63
|
+
### GanttProps
|
|
64
|
+
|
|
65
|
+
| Parameter Name | Type | Description |
|
|
66
|
+
| :------------------------------ | :------------ | :------------------------------------------------- |
|
|
67
|
+
| tasks\* | [Task](#Task) | Tasks array. |
|
|
68
|
+
| [EventOption](#EventOption) | interface | Specifies gantt events. |
|
|
69
|
+
| [DisplayOption](#DisplayOption) | interface | Specifies view type and display timeline language. |
|
|
70
|
+
| [StylingOption](#StylingOption) | interface | Specifies chart and global tasks styles |
|
|
71
|
+
|
|
72
|
+
### EventOption
|
|
73
|
+
|
|
74
|
+
| Parameter Name | Type | Description |
|
|
75
|
+
| :----------------- | :---------------------------------------------------------------------------- | :-------------------------------------------------------------------------------------- |
|
|
76
|
+
| onSelect | (task: Task, isSelected: boolean) => void | Specifies the function to be executed on the taskbar select or unselect event. |
|
|
77
|
+
| onDoubleClick | (task: Task) => void | Specifies the function to be executed on the taskbar onDoubleClick event. |
|
|
78
|
+
| onClick | (task: Task) => void | Specifies the function to be executed on the taskbar onClick event. |
|
|
79
|
+
| onDelete\* | (task: Task) => void/boolean/Promise<void>/Promise<boolean> | Specifies the function to be executed on the taskbar on Delete button press event. |
|
|
80
|
+
| onDateChange\* | (task: Task, children: Task[]) => void/boolean/Promise<void>/Promise<boolean> | Specifies the function to be executed when drag taskbar event on timeline has finished. |
|
|
81
|
+
| onProgressChange\* | (task: Task, children: Task[]) => void/boolean/Promise<void>/Promise<boolean> | Specifies the function to be executed when drag taskbar progress event has finished. |
|
|
82
|
+
| onExpanderClick\* | onExpanderClick: (task: Task) => void; | Specifies the function to be executed on the table expander click |
|
|
83
|
+
| onWheel\* | onWheel: (wheelEvent: WheelEvent) => void; | Specifies the function to be executed when the mouse wheel is used |
|
|
84
|
+
| timeStep | number | A time step value for onDateChange. Specify in milliseconds. |
|
|
85
|
+
|
|
86
|
+
\* Chart undoes operation if method return false or error. Parameter children returns one level deep records.
|
|
87
|
+
|
|
88
|
+
### DisplayOption
|
|
89
|
+
|
|
90
|
+
| Parameter Name | Type | Description |
|
|
91
|
+
| :------------------ | :------ | :---------------------------------------------------------------------------------------------------------- |
|
|
92
|
+
| viewMode | enum | Specifies the time scale. Hour, Quarter Day, Half Day, Day, Week(ISO-8601, 1st day is Monday), Month, Year. |
|
|
93
|
+
| viewDate | date | Specifies display date and time for display. |
|
|
94
|
+
| preStepsCount | number | Specifies empty space before the fist task |
|
|
95
|
+
| locale | string | Specifies the month name language. Able formats: ISO 639-2, Java Locale. |
|
|
96
|
+
| monthCalendarFormat | string | Specifies the month display on calendar |
|
|
97
|
+
| monthTaskListFormat | string | Specifies the month display on list. |
|
|
98
|
+
| rtl | boolean | Sets rtl mode. |
|
|
99
|
+
|
|
100
|
+
### StylingOption
|
|
101
|
+
|
|
102
|
+
| Parameter Name | Type | Description |
|
|
103
|
+
| :------------------------- | :----- | :--------------------------------------------------------------------------------------------- |
|
|
104
|
+
| headerHeight | number | Specifies the header height. |
|
|
105
|
+
| ganttHeight | number | Specifies the gantt chart height without header. Default is 0. It`s mean no height limitation. |
|
|
106
|
+
| columnWidth | number | Specifies the time period width. |
|
|
107
|
+
| listCellWidth | string | Specifies the task list cell width. Empty string is mean "no display". |
|
|
108
|
+
| rowHeight | number | Specifies the task row height. |
|
|
109
|
+
| barCornerRadius | number | Specifies the taskbar corner rounding. |
|
|
110
|
+
| barFill | number | Specifies the taskbar occupation. Sets in percent from 0 to 100. |
|
|
111
|
+
| handleWidth | number | Specifies width the taskbar drag event control for start and end dates. |
|
|
112
|
+
| fontFamily | string | Specifies the application font. |
|
|
113
|
+
| fontSize | string | Specifies the application font size. |
|
|
114
|
+
| barProgressColor | string | Specifies the taskbar progress fill color globally. |
|
|
115
|
+
| barProgressSelectedColor | string | Specifies the taskbar progress fill color globally on select. |
|
|
116
|
+
| barBackgroundColor | string | Specifies the taskbar background fill color globally. |
|
|
117
|
+
| barBackgroundSelectedColor | string | Specifies the taskbar background fill color globally on select. |
|
|
118
|
+
| arrowColor | string | Specifies the relationship arrow fill color. |
|
|
119
|
+
| arrowIndent | number | Specifies the relationship arrow right indent. Sets in px |
|
|
120
|
+
| todayColor | string | Specifies the current period column fill color. |
|
|
121
|
+
| TooltipContent | | Specifies the Tooltip view for selected taskbar. |
|
|
122
|
+
| TaskListHeader | | Specifies the task list Header view |
|
|
123
|
+
| TaskListTable | | Specifies the task list Table view |
|
|
124
|
+
|
|
125
|
+
- TooltipContent: [`React.FC<{ task: Task; fontSize: string; fontFamily: string; }>;`](https://github.com/MaTeMaTuK/gantt-task-react/blob/main/src/components/other/tooltip.tsx#L56)
|
|
126
|
+
- TaskListHeader: `React.FC<{ headerHeight: number; rowWidth: string; fontFamily: string; fontSize: string;}>;`
|
|
127
|
+
- TaskListTable: `React.FC<{ rowHeight: number; rowWidth: string; fontFamily: string; fontSize: string; locale: string; tasks: Task[]; selectedTaskId: string; setSelectedTask: (taskId: string) => void; }>;`
|
|
128
|
+
|
|
129
|
+
### Task
|
|
130
|
+
|
|
131
|
+
| Parameter Name | Type | Description |
|
|
132
|
+
| :------------- | :------- | :---------------------------------------------------------------------------------------------------- |
|
|
133
|
+
| id\* | string | Task id. |
|
|
134
|
+
| name\* | string | Task display name. |
|
|
135
|
+
| type\* | string | Task display type: **task**, **milestone**, **project** |
|
|
136
|
+
| start\* | Date | Task start date. |
|
|
137
|
+
| end\* | Date | Task end date. |
|
|
138
|
+
| progress\* | number | Task progress. Sets in percent from 0 to 100. |
|
|
139
|
+
| assignees\* | string[] | List of people assigned to the task |
|
|
140
|
+
| dependencies | string[] | Specifies the parent dependencies ids. |
|
|
141
|
+
| styles | object | Specifies the taskbar styling settings locally. Object is passed with the following attributes: |
|
|
142
|
+
| | | - **backgroundColor**: String. Specifies the taskbar background fill color locally. |
|
|
143
|
+
| | | - **backgroundSelectedColor**: String. Specifies the taskbar background fill color locally on select. |
|
|
144
|
+
| | | - **progressColor**: String. Specifies the taskbar progress fill color locally. |
|
|
145
|
+
| | | - **progressSelectedColor**: String. Specifies the taskbar progress fill color globally on select. |
|
|
146
|
+
| isDisabled | bool | Disables all action for current task. |
|
|
147
|
+
| fontSize | string | Specifies the taskbar font size locally. |
|
|
148
|
+
| project | string | Task project name |
|
|
149
|
+
| hideChildren | bool | Hide children items. Parameter works with project type only |
|
|
150
|
+
|
|
151
|
+
\*Required
|
|
152
|
+
|
|
153
|
+
## License
|
|
154
|
+
|
|
155
|
+
[MIT](./LICENSE)
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { ChangeAction, DependentMap, Task, RenderTask } from "../types";
|
|
2
|
+
export declare const fillDependentTasksForTask: (resSet: Set<Task>, task: RenderTask, dependentMap: DependentMap) => void;
|
|
3
|
+
export declare const getDependentTasks: (changeAction: ChangeAction, dependentMap: DependentMap) => Task[];
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ChangeAction, RenderTask, TaskToGlobalIndexMap } from "../types";
|
|
2
|
+
export declare const getTaskIndex: (task: RenderTask, mapTaskToGlobalIndex: TaskToGlobalIndexMap) => {
|
|
3
|
+
task: RenderTask;
|
|
4
|
+
index: number;
|
|
5
|
+
};
|
|
6
|
+
export declare const getTaskIndexes: (changeAction: ChangeAction, mapTaskToGlobalIndex: TaskToGlobalIndexMap) => {
|
|
7
|
+
task: RenderTask;
|
|
8
|
+
index: number;
|
|
9
|
+
}[];
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React, { RefObject } from "react";
|
|
2
|
+
import { DateSetup, RenderTopHeader, RenderBottomHeader, Distances } from "../../types";
|
|
3
|
+
export type CalendarProps = {
|
|
4
|
+
scrollRef: RefObject<HTMLDivElement>;
|
|
5
|
+
additionalLeftSpace: number;
|
|
6
|
+
dateSetup: DateSetup;
|
|
7
|
+
distances: Distances;
|
|
8
|
+
endColumnIndex: number;
|
|
9
|
+
fullSvgWidth: number;
|
|
10
|
+
getDate: (index: number) => Date;
|
|
11
|
+
isUnknownDates: boolean;
|
|
12
|
+
renderBottomHeader?: RenderBottomHeader;
|
|
13
|
+
renderTopHeader?: RenderTopHeader;
|
|
14
|
+
rtl: boolean;
|
|
15
|
+
startColumnIndex: number;
|
|
16
|
+
language: string;
|
|
17
|
+
};
|
|
18
|
+
export declare const Calendar: React.FC<CalendarProps>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { ReactNode } from "react";
|
|
3
|
+
type TopPartOfCalendarProps = {
|
|
4
|
+
value: ReactNode | null;
|
|
5
|
+
x1Line: number;
|
|
6
|
+
y1Line: number;
|
|
7
|
+
y2Line: number;
|
|
8
|
+
xText: number;
|
|
9
|
+
yText: number;
|
|
10
|
+
language: string;
|
|
11
|
+
};
|
|
12
|
+
export declare const TopPartOfCalendar: React.FC<TopPartOfCalendarProps>;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ReactElement } from "react";
|
|
2
|
+
import type { ActionMetaType, ContextMenuOptionType, ContextMenuType, Distances, RenderTask } from "../../types";
|
|
3
|
+
type ContextMenuProps = {
|
|
4
|
+
checkHasCopyTasks: () => boolean;
|
|
5
|
+
checkHasCutTasks: () => boolean;
|
|
6
|
+
contextMenu: ContextMenuType;
|
|
7
|
+
distances: Distances;
|
|
8
|
+
handleAction: (task: RenderTask, action: (meta: ActionMetaType) => void) => void;
|
|
9
|
+
handleCloseContextMenu: () => void;
|
|
10
|
+
options: ContextMenuOptionType[];
|
|
11
|
+
};
|
|
12
|
+
export declare function ContextMenu(props: ContextMenuProps): ReactElement;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ReactElement } from "react";
|
|
2
|
+
import type { ContextMenuOptionType, Distances } from "../../types";
|
|
3
|
+
type MenuOptionProps = {
|
|
4
|
+
distances: Distances;
|
|
5
|
+
handleAction: (option: ContextMenuOptionType) => void;
|
|
6
|
+
option: ContextMenuOptionType;
|
|
7
|
+
onClose?: () => void;
|
|
8
|
+
};
|
|
9
|
+
export declare function MenuOption(props: MenuOptionProps): ReactElement;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import React, { MouseEvent } from "react";
|
|
2
|
+
import { ChildByLevelMap, CriticalPaths, DependencyMap, DependentMap, Distances, GanttRelationEvent, GanttTaskBarActions, GlobalRowIndexToTaskMap, RelationKind, RelationMoveTarget, RenderCustomLabel, RenderTask, Task, TaskBarMoveAction, TaskCoordinates, ViewMode } from "../../types";
|
|
3
|
+
import type { OptimizedListParams } from "../../helpers/use-optimized-list";
|
|
4
|
+
export interface TaskGanttContentProps extends GanttTaskBarActions {
|
|
5
|
+
authorizedRelations: RelationKind[];
|
|
6
|
+
additionalLeftSpace: number;
|
|
7
|
+
additionalRightSpace: number;
|
|
8
|
+
checkIsHoliday: (date: Date) => boolean;
|
|
9
|
+
childTasksMap: ChildByLevelMap;
|
|
10
|
+
comparisonLevels: number;
|
|
11
|
+
criticalPaths: CriticalPaths | null;
|
|
12
|
+
dependencyMap: DependencyMap;
|
|
13
|
+
dependentMap: DependentMap;
|
|
14
|
+
distances: Distances;
|
|
15
|
+
endColumnIndex: number;
|
|
16
|
+
fullRowHeight: number;
|
|
17
|
+
ganttRelationEvent: GanttRelationEvent | null;
|
|
18
|
+
getDate: (index: number) => Date;
|
|
19
|
+
getTaskCoordinates: (task: Task) => TaskCoordinates;
|
|
20
|
+
onTaskBarRelationStart: (target: RelationMoveTarget, task: Task) => void;
|
|
21
|
+
onDeleteTask: (task: RenderTask) => void;
|
|
22
|
+
onTaskBarDragStart: (action: TaskBarMoveAction, task: Task, clientX: number, taskRootNode: Element) => void;
|
|
23
|
+
mapGlobalRowIndexToTask: GlobalRowIndexToTaskMap;
|
|
24
|
+
onArrowDoubleClick: (taskFrom: Task, taskTo: Task) => void;
|
|
25
|
+
onClick?: (task: Task, event: React.MouseEvent<SVGElement>) => void;
|
|
26
|
+
onDoubleClick?: (task: Task) => void;
|
|
27
|
+
renderedRowIndexes: OptimizedListParams | null;
|
|
28
|
+
rtl: boolean;
|
|
29
|
+
waitCommitTasks?: boolean;
|
|
30
|
+
selectTaskOnMouseDown: (taskId: string, event: MouseEvent) => void;
|
|
31
|
+
selectedIdsMirror: Readonly<Record<string, true>>;
|
|
32
|
+
onTooltipTask: (task: Task | null, element: Element | null) => void;
|
|
33
|
+
startColumnIndex: number;
|
|
34
|
+
taskYOffset: number;
|
|
35
|
+
visibleTasksMirror: Readonly<Record<string, true>>;
|
|
36
|
+
taskHeight: number;
|
|
37
|
+
taskHalfHeight: number;
|
|
38
|
+
renderCustomLabel?: RenderCustomLabel;
|
|
39
|
+
isProgressChangeable?: (task: Task) => boolean;
|
|
40
|
+
isDateChangeable?: (task: Task) => boolean;
|
|
41
|
+
isRelationChangeable?: (task: Task) => boolean;
|
|
42
|
+
taskBarMovingAction: (task: RenderTask) => TaskBarMoveAction | null;
|
|
43
|
+
viewMode: ViewMode;
|
|
44
|
+
}
|
|
45
|
+
export declare const TaskGanttContent: React.NamedExoticComponent<TaskGanttContentProps>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { RefObject } from "react";
|
|
2
|
+
import React, { SyntheticEvent } from "react";
|
|
3
|
+
import { GanttTodayProps } from "../gantt-today";
|
|
4
|
+
import { CalendarProps } from "../calendar/calendar";
|
|
5
|
+
import { TaskGanttContentProps } from "./task-gantt-content";
|
|
6
|
+
import { GanttTaskBarActions } from "../../types";
|
|
7
|
+
export interface TaskGanttProps extends GanttTaskBarActions {
|
|
8
|
+
barProps: TaskGanttContentProps;
|
|
9
|
+
calendarProps: Omit<CalendarProps, "scrollRef">;
|
|
10
|
+
fullRowHeight: number;
|
|
11
|
+
fullSvgWidth: number;
|
|
12
|
+
ganttFullHeight: number;
|
|
13
|
+
ganttHeight: number;
|
|
14
|
+
ganttSVGRef: RefObject<SVGSVGElement>;
|
|
15
|
+
ganttTodayProps: GanttTodayProps;
|
|
16
|
+
horizontalContainerRef: RefObject<HTMLDivElement>;
|
|
17
|
+
verticalScrollbarRef: RefObject<HTMLDivElement>;
|
|
18
|
+
onVerticalScrollbarScrollX: (event: SyntheticEvent<HTMLDivElement>) => void;
|
|
19
|
+
verticalGanttContainerRef: RefObject<HTMLDivElement>;
|
|
20
|
+
}
|
|
21
|
+
export declare const TaskGantt: React.NamedExoticComponent<TaskGanttProps>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { RefObject } from "react";
|
|
2
|
+
import { ContextMenuType, Task, RenderTask } from "../../types";
|
|
3
|
+
export declare const useContextMenu: (wrapperRef: RefObject<HTMLDivElement>, scrollToTask: (task: Task) => void) => {
|
|
4
|
+
contextMenu: ContextMenuType;
|
|
5
|
+
handleCloseContextMenu: () => void;
|
|
6
|
+
handleOpenContextMenu: (task: RenderTask, clientX: number, clientY: number) => void;
|
|
7
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { RefObject } from "react";
|
|
2
|
+
import { Distances, GanttRelationEvent, MapTaskToCoordinates, OnRelationChange, RelationMoveTarget, Task, TaskMapByLevel, RenderTask, TaskToGlobalIndexMap } from "../../types";
|
|
3
|
+
type UseCreateRelationParams = {
|
|
4
|
+
distances: Distances;
|
|
5
|
+
ganttSVGRef: RefObject<SVGSVGElement>;
|
|
6
|
+
mapTaskToCoordinates: MapTaskToCoordinates;
|
|
7
|
+
mapTaskToGlobalIndex: TaskToGlobalIndexMap;
|
|
8
|
+
onRelationChange?: OnRelationChange;
|
|
9
|
+
rtl: boolean;
|
|
10
|
+
taskHalfHeight: number;
|
|
11
|
+
tasksMap: TaskMapByLevel;
|
|
12
|
+
visibleTasks: readonly RenderTask[];
|
|
13
|
+
};
|
|
14
|
+
export declare const useCreateRelation: ({ distances: { relationCircleOffset, relationCircleRadius }, ganttSVGRef, mapTaskToCoordinates, mapTaskToGlobalIndex, onRelationChange, rtl, taskHalfHeight, tasksMap, visibleTasks, }: UseCreateRelationParams) => [
|
|
15
|
+
GanttRelationEvent | null,
|
|
16
|
+
(target: RelationMoveTarget, task: Task) => void
|
|
17
|
+
];
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { AdjustTaskToWorkingDatesParams, ChangeInProgress, MapTaskToCoordinates, MinAndMaxChildsMap, Task, TaskMapByLevel } from "../../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
|
+
minAndMaxChildsMap: MinAndMaxChildsMap;
|
|
10
|
+
roundEndDate: (date: Date) => Date;
|
|
11
|
+
roundStartDate: (date: Date) => Date;
|
|
12
|
+
tasksMap: TaskMapByLevel;
|
|
13
|
+
};
|
|
14
|
+
export declare const useGetTaskCurrentState: ({ adjustTaskToWorkingDates, changeInProgress, isAdjustToWorkingDates, isMoveChildsWithParent, isUpdateDisabledParentsOnChange, minAndMaxChildsMap, roundEndDate, roundStartDate, tasksMap, }: UseGetTaskCurrentStateParams) => (dirtyTask: Task) => Task;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { ActionMetaType, CheckTaskIdExistsAtLevel, ChildByLevelMap, Task, TaskMapByLevel, RenderTask } from "../../types";
|
|
2
|
+
type UseHandleActionParams = {
|
|
3
|
+
checkTaskIdExists: CheckTaskIdExistsAtLevel;
|
|
4
|
+
childTasksMap: ChildByLevelMap;
|
|
5
|
+
copyIdsMirror: Readonly<Record<string, true>>;
|
|
6
|
+
copySelectedTasks: () => void;
|
|
7
|
+
copyTask: (task: RenderTask) => void;
|
|
8
|
+
cutIdsMirror: Readonly<Record<string, true>>;
|
|
9
|
+
cutSelectedTasks: () => void;
|
|
10
|
+
cutTask: (task: RenderTask) => void;
|
|
11
|
+
handleAddChilds: (parent: Task, descendants: readonly RenderTask[]) => void;
|
|
12
|
+
handleDeleteTasks: (tasksForDelete: readonly RenderTask[]) => void;
|
|
13
|
+
handleEditTask: (taskForEdit: RenderTask) => void;
|
|
14
|
+
handleMoveTasksInside: (parent: Task, childs: readonly RenderTask[]) => void;
|
|
15
|
+
makeCopies: (tasksForCopy: readonly RenderTask[]) => readonly RenderTask[];
|
|
16
|
+
resetSelectedTasks: () => void;
|
|
17
|
+
selectedIdsMirror: Readonly<Record<string, true>>;
|
|
18
|
+
tasksMap: TaskMapByLevel;
|
|
19
|
+
};
|
|
20
|
+
export declare const useHandleAction: ({ checkTaskIdExists, childTasksMap, copyIdsMirror, copySelectedTasks, copyTask, cutIdsMirror, cutSelectedTasks, cutTask, handleAddChilds, handleDeleteTasks, handleMoveTasksInside, makeCopies, resetSelectedTasks, selectedIdsMirror, handleEditTask, tasksMap, }: UseHandleActionParams) => (task: RenderTask, action: (meta: ActionMetaType) => void) => void;
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { AdjustTaskToWorkingDatesParams, DateSetup } from "../../types";
|
|
2
|
+
type UseHolidaysParams = {
|
|
3
|
+
checkIsHolidayProp: (date: Date, minTaskDate: Date, dateSetup: DateSetup) => boolean;
|
|
4
|
+
dateSetup: DateSetup;
|
|
5
|
+
isAdjustToWorkingDates: boolean;
|
|
6
|
+
minTaskDate: Date;
|
|
7
|
+
};
|
|
8
|
+
export declare const useHolidays: ({ checkIsHolidayProp, dateSetup, isAdjustToWorkingDates, minTaskDate, }: UseHolidaysParams) => {
|
|
9
|
+
checkIsHoliday: (date: Date) => boolean;
|
|
10
|
+
adjustTaskToWorkingDates: ({ action, changedTask, originalTask }: AdjustTaskToWorkingDatesParams) => import("../../types").Task;
|
|
11
|
+
};
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { RefObject, SyntheticEvent } from "react";
|
|
2
|
+
export declare const useHorizontalScrollbars: () => [
|
|
3
|
+
RefObject<HTMLDivElement>,
|
|
4
|
+
number,
|
|
5
|
+
(nextScrollX: number) => void,
|
|
6
|
+
(event: SyntheticEvent<HTMLDivElement>) => void,
|
|
7
|
+
() => void,
|
|
8
|
+
() => void
|
|
9
|
+
];
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { MouseEvent } from "react";
|
|
2
|
+
import { CheckTaskIdExistsAtLevel, RowIndexToTaskMap, RenderTask, TaskToRowIndexMap, TaskId } from "../../types";
|
|
3
|
+
export declare const useSelection: (taskToRowIndexMap: TaskToRowIndexMap, rowIndexToTaskMap: RowIndexToTaskMap, checkTaskIdExists: CheckTaskIdExistsAtLevel, onSelectTaskIds?: (taskIds: TaskId[]) => void) => {
|
|
4
|
+
checkHasCopyTasks: () => boolean;
|
|
5
|
+
checkHasCutTasks: () => boolean;
|
|
6
|
+
copyIdsMirror: Readonly<Record<string, true>>;
|
|
7
|
+
copySelectedTasks: () => void;
|
|
8
|
+
copyTask: (task: RenderTask) => void;
|
|
9
|
+
cutIdsMirror: Readonly<Record<string, true>>;
|
|
10
|
+
cutSelectedTasks: () => void;
|
|
11
|
+
cutTask: (task: RenderTask) => 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 | null, singleMode?: boolean) => void;
|
|
18
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { RefObject } from "react";
|
|
2
|
+
import { Column, OnResizeColumn } from "../../types";
|
|
3
|
+
export declare const useTableListResize: (clientColumns: readonly Column[] | undefined | null, canMoveTasks: boolean, onResizeColumn: OnResizeColumn, ganttRef: RefObject<HTMLDivElement>) => [
|
|
4
|
+
columns: readonly Column[],
|
|
5
|
+
taskListWidth: number,
|
|
6
|
+
tableWidth: number,
|
|
7
|
+
onTableResizeStart: (clientX: number) => void,
|
|
8
|
+
onColumnResizeStart: (columnIndex: number, clientX: number) => void
|
|
9
|
+
];
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { RefObject } from "react";
|
|
2
|
+
import { ChangeInProgress, ChildByLevelMap, DependentMap, MapTaskToCoordinates, Task, TaskBarMoveAction, TaskMapByLevel, TaskToGlobalIndexMap } from "../../types";
|
|
3
|
+
type UseTaskDragParams = {
|
|
4
|
+
childTasksMap: ChildByLevelMap;
|
|
5
|
+
dependentMap: DependentMap;
|
|
6
|
+
ganttSVGRef: RefObject<SVGSVGElement>;
|
|
7
|
+
mapTaskToCoordinates: MapTaskToCoordinates;
|
|
8
|
+
mapTaskToGlobalIndex: TaskToGlobalIndexMap;
|
|
9
|
+
onDateChange: (action: TaskBarMoveAction, changedTask: Task, originalTask: Task) => void;
|
|
10
|
+
onProgressChange: (task: Task) => void;
|
|
11
|
+
roundEndDate: (date: Date) => Date;
|
|
12
|
+
roundStartDate: (date: Date) => Date;
|
|
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: ({ ganttSVGRef, mapTaskToCoordinates, onDateChange, onProgressChange, roundEndDate, roundStartDate, rtl, scrollToLeftStep, scrollToRightStep, scrollX, setScrollXProgrammatically, svgClientWidth, svgWidth, timeStep, xStep, }: UseTaskDragParams) => [
|
|
25
|
+
ChangeInProgress | null,
|
|
26
|
+
(action: TaskBarMoveAction, task: Task, clientX: number, taskRootNode: Element) => void
|
|
27
|
+
];
|
|
28
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { RefObject, SyntheticEvent } from "react";
|
|
2
|
+
export declare const useVerticalScrollbars: () => [
|
|
3
|
+
RefObject<HTMLDivElement>,
|
|
4
|
+
RefObject<HTMLDivElement>,
|
|
5
|
+
RefObject<HTMLDivElement>,
|
|
6
|
+
number,
|
|
7
|
+
(nextScrollY: number) => void,
|
|
8
|
+
(event: SyntheticEvent<HTMLDivElement>) => void,
|
|
9
|
+
() => void,
|
|
10
|
+
() => void
|
|
11
|
+
];
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { FC, PropsWithChildren } from "react";
|
|
2
|
+
import { GanttLocale } from "../../types";
|
|
3
|
+
interface Props extends PropsWithChildren {
|
|
4
|
+
locale: GanttLocale;
|
|
5
|
+
}
|
|
6
|
+
export declare const GanttLocaleProvider: FC<Props>;
|
|
7
|
+
export declare const useGanttLocale: () => GanttLocale;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React, { CSSProperties } from "react";
|
|
2
|
+
import { GanttTheme } from "../../types";
|
|
3
|
+
export interface GanttThemeProps {
|
|
4
|
+
theme: GanttTheme;
|
|
5
|
+
children: (cssVars: CSSProperties) => React.ReactNode;
|
|
6
|
+
}
|
|
7
|
+
export declare const GanttThemeProvider: React.FC<GanttThemeProps>;
|
|
8
|
+
export * from "./gantt-theme-builder";
|
|
9
|
+
export declare const useGanttTheme: () => GanttTheme;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Distances, ViewMode } from "../../types";
|
|
3
|
+
export type GanttTodayProps = {
|
|
4
|
+
additionalLeftSpace: number;
|
|
5
|
+
distances: Distances;
|
|
6
|
+
ganttFullHeight: number;
|
|
7
|
+
isUnknownDates: boolean;
|
|
8
|
+
startDate: Date;
|
|
9
|
+
rtl: boolean;
|
|
10
|
+
viewMode: ViewMode;
|
|
11
|
+
};
|
|
12
|
+
export declare const GanttToday: React.NamedExoticComponent<GanttTodayProps>;
|