@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,860 @@
|
|
|
1
|
+
import type { ComponentType, MouseEvent, ReactNode } from "react";
|
|
2
|
+
import type { Locale as DateLocale } from "date-fns";
|
|
3
|
+
import { TaskListHeaderActionsProps } from "../components/task-list/TaskListHeaderActions";
|
|
4
|
+
import { OptimizedListParams } from "../helpers/use-optimized-list";
|
|
5
|
+
export declare enum ViewMode {
|
|
6
|
+
Hour = "Hour",
|
|
7
|
+
QuarterDay = "Quarter Day",
|
|
8
|
+
HalfDay = "Half Day",
|
|
9
|
+
Day = "Day",
|
|
10
|
+
TwoDays = "Two Days",
|
|
11
|
+
/** ISO-8601 week */
|
|
12
|
+
Week = "Week",
|
|
13
|
+
Month = "Month",
|
|
14
|
+
QuarterYear = "QuarterYear",
|
|
15
|
+
Year = "Year"
|
|
16
|
+
}
|
|
17
|
+
export interface DateSetup {
|
|
18
|
+
dateFormats: DateFormats;
|
|
19
|
+
dateLocale: DateLocale;
|
|
20
|
+
isUnknownDates: boolean;
|
|
21
|
+
preStepsCount: number;
|
|
22
|
+
viewMode: ViewMode;
|
|
23
|
+
}
|
|
24
|
+
export type RenderTopHeader = (date: Date, viewMode: ViewMode, dateSetup: DateSetup) => ReactNode;
|
|
25
|
+
export type RenderBottomHeader = (date: Date, viewMode: ViewMode, dateSetup: DateSetup, index: number, isUnknownDates: boolean) => ReactNode;
|
|
26
|
+
export interface Dependency {
|
|
27
|
+
sourceId: string;
|
|
28
|
+
sourceTarget: DateExtremity;
|
|
29
|
+
ownTarget: DateExtremity;
|
|
30
|
+
}
|
|
31
|
+
export interface ExpandedDependency {
|
|
32
|
+
containerHeight: number;
|
|
33
|
+
containerY: number;
|
|
34
|
+
innerFromY: number;
|
|
35
|
+
innerToY: number;
|
|
36
|
+
marginBetweenTasks: number | null;
|
|
37
|
+
ownTarget: DateExtremity;
|
|
38
|
+
source: Task;
|
|
39
|
+
sourceTarget: DateExtremity;
|
|
40
|
+
}
|
|
41
|
+
export interface ExpandedDependent {
|
|
42
|
+
containerHeight: number;
|
|
43
|
+
containerY: number;
|
|
44
|
+
innerFromY: number;
|
|
45
|
+
innerToY: number;
|
|
46
|
+
marginBetweenTasks: number | null;
|
|
47
|
+
dependent: Task;
|
|
48
|
+
dependentTarget: DateExtremity;
|
|
49
|
+
ownTarget: DateExtremity;
|
|
50
|
+
}
|
|
51
|
+
export interface ColorStyles {
|
|
52
|
+
arrowColor: string;
|
|
53
|
+
arrowCriticalColor: string;
|
|
54
|
+
arrowWarningColor: string;
|
|
55
|
+
barLabelColor: string;
|
|
56
|
+
barLabelWhenOutsideColor: string;
|
|
57
|
+
barProgressColor: string;
|
|
58
|
+
barProgressCriticalColor: string;
|
|
59
|
+
barProgressSelectedColor: string;
|
|
60
|
+
barProgressSelectedCriticalColor: string;
|
|
61
|
+
barBackgroundColor: string;
|
|
62
|
+
barBackgroundCriticalColor: string;
|
|
63
|
+
barBackgroundSelectedColor: string;
|
|
64
|
+
barBackgroundSelectedCriticalColor: string;
|
|
65
|
+
groupProgressColor: string;
|
|
66
|
+
groupProgressCriticalColor: string;
|
|
67
|
+
groupProgressSelectedColor: string;
|
|
68
|
+
groupProgressSelectedCriticalColor: string;
|
|
69
|
+
groupBackgroundColor: string;
|
|
70
|
+
groupBackgroundCriticalColor: string;
|
|
71
|
+
groupBackgroundSelectedColor: string;
|
|
72
|
+
groupBackgroundSelectedCriticalColor: string;
|
|
73
|
+
projectProgressColor: string;
|
|
74
|
+
projectProgressCriticalColor: string;
|
|
75
|
+
projectProgressSelectedColor: string;
|
|
76
|
+
projectProgressSelectedCriticalColor: string;
|
|
77
|
+
projectBackgroundColor: string;
|
|
78
|
+
projectBackgroundCriticalColor: string;
|
|
79
|
+
projectBackgroundSelectedColor: string;
|
|
80
|
+
projectBackgroundSelectedCriticalColor: string;
|
|
81
|
+
milestoneBackgroundColor: string;
|
|
82
|
+
milestoneBackgroundCriticalColor: string;
|
|
83
|
+
milestoneBackgroundSelectedColor: string;
|
|
84
|
+
milestoneBackgroundSelectedCriticalColor: string;
|
|
85
|
+
evenTaskBackgroundColor: string;
|
|
86
|
+
oddTaskBackgroundColor: string;
|
|
87
|
+
holidayBackgroundColor: string;
|
|
88
|
+
taskDragColor: string;
|
|
89
|
+
selectedTaskBackgroundColor: string;
|
|
90
|
+
todayColor: string;
|
|
91
|
+
contextMenuBoxShadow: string;
|
|
92
|
+
contextMenuBgColor: string;
|
|
93
|
+
contextMenuTextColor: string;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* date-fns formats
|
|
97
|
+
*/
|
|
98
|
+
export interface DateFormats {
|
|
99
|
+
dateColumnFormat: string;
|
|
100
|
+
dayBottomHeaderFormat: string;
|
|
101
|
+
dayTopHeaderFormat: string;
|
|
102
|
+
hourBottomHeaderFormat: string;
|
|
103
|
+
monthBottomHeaderFormat: string;
|
|
104
|
+
monthTopHeaderFormat: string;
|
|
105
|
+
}
|
|
106
|
+
export interface Distances {
|
|
107
|
+
actionColumnWidth: number;
|
|
108
|
+
arrowIndent: number;
|
|
109
|
+
barCornerRadius: number;
|
|
110
|
+
/**
|
|
111
|
+
* How many of row width can be taken by task.
|
|
112
|
+
* From 0 to 100
|
|
113
|
+
*/
|
|
114
|
+
barFill: number;
|
|
115
|
+
columnWidth: number;
|
|
116
|
+
contextMenuIconWidth: number;
|
|
117
|
+
contextMenuOptionHeight: number;
|
|
118
|
+
contextMenuSidePadding: number;
|
|
119
|
+
dateCellWidth: number;
|
|
120
|
+
dependenciesCellWidth: number;
|
|
121
|
+
dependencyFixHeight: number;
|
|
122
|
+
dependencyFixIndent: number;
|
|
123
|
+
dependencyFixWidth: number;
|
|
124
|
+
expandIconWidth: number;
|
|
125
|
+
handleWidth: number;
|
|
126
|
+
headerHeight: number;
|
|
127
|
+
minimumRowDisplayed: number;
|
|
128
|
+
nestedTaskNameOffset: number;
|
|
129
|
+
relationCircleOffset: number;
|
|
130
|
+
relationCircleRadius: number;
|
|
131
|
+
rowHeight: number;
|
|
132
|
+
tableWidth?: number;
|
|
133
|
+
taskWarningOffset: number;
|
|
134
|
+
titleCellWidth: number;
|
|
135
|
+
}
|
|
136
|
+
export type TaskType = "task" | "milestone" | "project";
|
|
137
|
+
export interface Task {
|
|
138
|
+
id: string;
|
|
139
|
+
type: TaskType;
|
|
140
|
+
name: string;
|
|
141
|
+
start: Date;
|
|
142
|
+
end: Date;
|
|
143
|
+
/**
|
|
144
|
+
* From 0 to 100
|
|
145
|
+
*/
|
|
146
|
+
progress: number;
|
|
147
|
+
assignees?: string[];
|
|
148
|
+
styles?: Partial<ColorStyles>;
|
|
149
|
+
isDisabled?: boolean;
|
|
150
|
+
isRelationDisabled?: boolean;
|
|
151
|
+
/**
|
|
152
|
+
* Project or task
|
|
153
|
+
*/
|
|
154
|
+
parent?: string;
|
|
155
|
+
dependencies?: Dependency[];
|
|
156
|
+
hideChildren?: boolean;
|
|
157
|
+
displayOrder?: number;
|
|
158
|
+
comparisonLevel?: number;
|
|
159
|
+
}
|
|
160
|
+
export interface EmptyTask {
|
|
161
|
+
id: string;
|
|
162
|
+
type: "empty";
|
|
163
|
+
name: string;
|
|
164
|
+
parent?: string;
|
|
165
|
+
comparisonLevel?: number;
|
|
166
|
+
displayOrder?: number;
|
|
167
|
+
isDisabled?: boolean;
|
|
168
|
+
styles?: Partial<ColorStyles>;
|
|
169
|
+
hideChildren?: boolean;
|
|
170
|
+
}
|
|
171
|
+
export interface UserTask {
|
|
172
|
+
id: string;
|
|
173
|
+
type: "user";
|
|
174
|
+
name: string;
|
|
175
|
+
parent?: string;
|
|
176
|
+
comparisonLevel?: number;
|
|
177
|
+
displayOrder?: number;
|
|
178
|
+
isDisabled?: boolean;
|
|
179
|
+
styles?: Partial<ColorStyles>;
|
|
180
|
+
hideChildren?: boolean;
|
|
181
|
+
}
|
|
182
|
+
export type TaskOrEmpty = Task | EmptyTask | UserTask;
|
|
183
|
+
export type OnArrowDoubleClick = (taskFrom: Task, taskFromIndex: number, taskTo: Task, taskToIndex: number) => void;
|
|
184
|
+
export type OnRelationChange = (
|
|
185
|
+
/**
|
|
186
|
+
* Task, target, index
|
|
187
|
+
*/
|
|
188
|
+
from: [Task, DateExtremity, number],
|
|
189
|
+
/**
|
|
190
|
+
* Task, target, index
|
|
191
|
+
*/
|
|
192
|
+
to: [Task, DateExtremity, number],
|
|
193
|
+
/**
|
|
194
|
+
* One of tasks is descendant of other task
|
|
195
|
+
*/
|
|
196
|
+
isOneDescendant: boolean) => void;
|
|
197
|
+
export type OnDateChangeSuggestionType = [
|
|
198
|
+
/**
|
|
199
|
+
* Start date
|
|
200
|
+
*/
|
|
201
|
+
Date,
|
|
202
|
+
/**
|
|
203
|
+
* End date
|
|
204
|
+
*/
|
|
205
|
+
Date,
|
|
206
|
+
/**
|
|
207
|
+
* Suggested task
|
|
208
|
+
*/
|
|
209
|
+
Task,
|
|
210
|
+
/**
|
|
211
|
+
* Index in array of tasks
|
|
212
|
+
*/
|
|
213
|
+
number
|
|
214
|
+
];
|
|
215
|
+
export type OnDateChange = (task: TaskOrEmpty, dependentTasks: readonly Task[], index: number, parents: readonly Task[], suggestions: readonly OnDateChangeSuggestionType[]) => void;
|
|
216
|
+
export type OnProgressChange = (task: Task, children: readonly Task[], index: number) => void;
|
|
217
|
+
export type OnEditTask = (task: TaskOrEmpty, index: number, getMetadata: GetMetadata) => void;
|
|
218
|
+
export type OnMoveTaskBeforeAfter = (task: TaskOrEmpty, taskForMove: TaskOrEmpty, dependentTasks: readonly Task[], taskIndex: number, taskForMoveIndex: number, parents: readonly Task[], suggestions: readonly OnDateChangeSuggestionType[]) => void;
|
|
219
|
+
export type OnMoveTaskInside = (parent: Task, childs: readonly TaskOrEmpty[], dependentTasks: readonly Task[], parentIndex: number, childIndexes: readonly number[], parents: readonly Task[], suggestions: readonly OnDateChangeSuggestionType[]) => void;
|
|
220
|
+
export type OnAddTask = (parentTask: Task, getMetadata: GetMetadata) => void;
|
|
221
|
+
export type FixPosition = (task: Task, date: Date,
|
|
222
|
+
/**
|
|
223
|
+
* index in the array of tasks
|
|
224
|
+
*/
|
|
225
|
+
index: number) => void;
|
|
226
|
+
export type OnChangeTasksAction = {
|
|
227
|
+
type: "add_tasks";
|
|
228
|
+
} | {
|
|
229
|
+
type: "date_change";
|
|
230
|
+
} | {
|
|
231
|
+
type: "delete_relation";
|
|
232
|
+
payload: {
|
|
233
|
+
taskFrom: Task;
|
|
234
|
+
taskFromIndex: number;
|
|
235
|
+
taskTo: Task;
|
|
236
|
+
taskToIndex: number;
|
|
237
|
+
};
|
|
238
|
+
} | {
|
|
239
|
+
type: "delete_task";
|
|
240
|
+
payload: {
|
|
241
|
+
tasks: readonly TaskOrEmpty[];
|
|
242
|
+
taskIndexes: readonly number[];
|
|
243
|
+
};
|
|
244
|
+
} | {
|
|
245
|
+
type: "edit_task";
|
|
246
|
+
} | {
|
|
247
|
+
type: "fix_dependency_position";
|
|
248
|
+
} | {
|
|
249
|
+
type: "fix_end_position";
|
|
250
|
+
} | {
|
|
251
|
+
type: "fix_start_position";
|
|
252
|
+
} | {
|
|
253
|
+
type: "move_task_before";
|
|
254
|
+
} | {
|
|
255
|
+
type: "move_task_after";
|
|
256
|
+
} | {
|
|
257
|
+
type: "move_task_inside";
|
|
258
|
+
} | {
|
|
259
|
+
type: "progress_change";
|
|
260
|
+
} | {
|
|
261
|
+
type: "relation_change";
|
|
262
|
+
} | {
|
|
263
|
+
type: "expandState_change";
|
|
264
|
+
payload: {
|
|
265
|
+
changedTask: Task;
|
|
266
|
+
};
|
|
267
|
+
};
|
|
268
|
+
export type RelationKind = "startToStart" | "startToEnd" | "endToStart" | "endToEnd";
|
|
269
|
+
export type OnChangeTasks = (nextTasks: readonly TaskOrEmpty[], action: OnChangeTasksAction) => void;
|
|
270
|
+
export interface EventOption {
|
|
271
|
+
/**
|
|
272
|
+
* Time step value for date changes.
|
|
273
|
+
*/
|
|
274
|
+
timeStep?: number;
|
|
275
|
+
/**
|
|
276
|
+
* Invokes on bar double click.
|
|
277
|
+
*/
|
|
278
|
+
onDoubleClick?: (task: Task) => void;
|
|
279
|
+
/**
|
|
280
|
+
* Invokes on bar click.
|
|
281
|
+
*/
|
|
282
|
+
onClick?: (task: TaskOrEmpty) => void;
|
|
283
|
+
/**
|
|
284
|
+
* Recount descedents of a group task when moving
|
|
285
|
+
*/
|
|
286
|
+
isMoveChildsWithParent?: boolean;
|
|
287
|
+
/**
|
|
288
|
+
* Recount parents of tasks in callback `onChangeTasks`
|
|
289
|
+
*/
|
|
290
|
+
isUpdateDisabledParentsOnChange?: boolean;
|
|
291
|
+
/**
|
|
292
|
+
* Invokes when the task expand status changed(task.hideChildren)
|
|
293
|
+
*/
|
|
294
|
+
onChangeExpandState?: (changedTask: Task) => void;
|
|
295
|
+
/**
|
|
296
|
+
* Invokes on every change of the list of tasks
|
|
297
|
+
*/
|
|
298
|
+
onChangeTasks?: OnChangeTasks;
|
|
299
|
+
/**
|
|
300
|
+
* Invokes on end and start time change. Chart undoes operation if method return false or error.
|
|
301
|
+
*/
|
|
302
|
+
onDateChange?: OnDateChange;
|
|
303
|
+
authorizedRelations?: RelationKind[];
|
|
304
|
+
/**
|
|
305
|
+
* Invokes on click on fix element next to relation arrow
|
|
306
|
+
*/
|
|
307
|
+
onFixDependencyPosition?: OnDateChange;
|
|
308
|
+
/**
|
|
309
|
+
* Invokes new relation between tasks
|
|
310
|
+
*/
|
|
311
|
+
onRelationChange?: OnRelationChange;
|
|
312
|
+
/**
|
|
313
|
+
* Invokes on progress change
|
|
314
|
+
*/
|
|
315
|
+
onProgressChange?: OnProgressChange;
|
|
316
|
+
/**
|
|
317
|
+
* Callback for getting data of the added task
|
|
318
|
+
*/
|
|
319
|
+
onAddTask?: (task: Task) => Promise<TaskOrEmpty | null>;
|
|
320
|
+
/**
|
|
321
|
+
* Invokes on edit button click
|
|
322
|
+
*/
|
|
323
|
+
onAddTaskClick?: OnAddTask;
|
|
324
|
+
/**
|
|
325
|
+
* Invokes on delete selected task
|
|
326
|
+
*/
|
|
327
|
+
onDelete?: (tasks: readonly TaskOrEmpty[], dependentTasks: readonly Task[], indexes: Array<{
|
|
328
|
+
task: TaskOrEmpty;
|
|
329
|
+
index: number;
|
|
330
|
+
}>, parents: readonly Task[], suggestions: readonly OnDateChangeSuggestionType[]) => void;
|
|
331
|
+
/**
|
|
332
|
+
* Callback for getting new data of the edited task
|
|
333
|
+
*/
|
|
334
|
+
onEditTask?: (task: TaskOrEmpty) => Promise<TaskOrEmpty | null>;
|
|
335
|
+
/**
|
|
336
|
+
* Invokes on edit button click
|
|
337
|
+
*/
|
|
338
|
+
onEditTaskClick?: OnEditTask;
|
|
339
|
+
/**
|
|
340
|
+
* Invokes on move task after other task
|
|
341
|
+
*/
|
|
342
|
+
onMoveTaskBefore?: OnMoveTaskBeforeAfter;
|
|
343
|
+
/**
|
|
344
|
+
* Invokes on move task after other task
|
|
345
|
+
*/
|
|
346
|
+
onMoveTaskAfter?: OnMoveTaskBeforeAfter;
|
|
347
|
+
/**
|
|
348
|
+
* Invokes on move task inside other task
|
|
349
|
+
*/
|
|
350
|
+
onMoveTaskInside?: OnMoveTaskInside;
|
|
351
|
+
/**
|
|
352
|
+
* Invokes on double click on the relation arrow between tasks
|
|
353
|
+
*/
|
|
354
|
+
onArrowDoubleClick?: OnArrowDoubleClick;
|
|
355
|
+
/**
|
|
356
|
+
* Invokes on click on fix element on the start of task
|
|
357
|
+
*/
|
|
358
|
+
fixStartPosition?: FixPosition;
|
|
359
|
+
/**
|
|
360
|
+
* Invokes on click on fix element on the end of task
|
|
361
|
+
*/
|
|
362
|
+
fixEndPosition?: FixPosition;
|
|
363
|
+
onWheel?: (wheelEvent: WheelEvent) => void;
|
|
364
|
+
}
|
|
365
|
+
export interface DisplayOption {
|
|
366
|
+
viewMode?: ViewMode;
|
|
367
|
+
isDeleteDependencyOnDoubleClick?: boolean;
|
|
368
|
+
/**
|
|
369
|
+
* Display offsets from start on timeline instead of dates
|
|
370
|
+
*/
|
|
371
|
+
isUnknownDates?: boolean;
|
|
372
|
+
/**
|
|
373
|
+
* Locale of date-fns
|
|
374
|
+
*/
|
|
375
|
+
dateLocale?: DateLocale;
|
|
376
|
+
viewDate?: Date;
|
|
377
|
+
preStepsCount?: number;
|
|
378
|
+
rtl?: boolean;
|
|
379
|
+
/**
|
|
380
|
+
* Show an warning icon next to task
|
|
381
|
+
* if some childs aren't within the time interval of the task
|
|
382
|
+
* and show elements to fix these warnings
|
|
383
|
+
*/
|
|
384
|
+
isShowChildOutOfParentWarnings?: boolean;
|
|
385
|
+
/**
|
|
386
|
+
* Show an warning icon next to task
|
|
387
|
+
* if some dependencies are conflicting
|
|
388
|
+
* and show elements to fix these warnings
|
|
389
|
+
*/
|
|
390
|
+
isShowDependencyWarnings?: boolean;
|
|
391
|
+
/**
|
|
392
|
+
* Show critical path
|
|
393
|
+
*/
|
|
394
|
+
isShowCriticalPath?: boolean;
|
|
395
|
+
/**
|
|
396
|
+
* Show numbers of tasks next to tasks
|
|
397
|
+
*/
|
|
398
|
+
isShowTaskNumbers?: boolean;
|
|
399
|
+
}
|
|
400
|
+
export interface Icons {
|
|
401
|
+
renderAddIcon: (task: TaskOrEmpty) => ReactNode;
|
|
402
|
+
renderClosedIcon: (task: TaskOrEmpty) => ReactNode;
|
|
403
|
+
renderDeleteIcon: (task: TaskOrEmpty) => ReactNode;
|
|
404
|
+
renderEditIcon: (task: TaskOrEmpty) => ReactNode;
|
|
405
|
+
renderOpenedIcon: (task: TaskOrEmpty) => ReactNode;
|
|
406
|
+
renderNoChildrenIcon: (task: TaskOrEmpty) => ReactNode;
|
|
407
|
+
}
|
|
408
|
+
export type BarMoveAction = "progress" | "end" | "start" | "move";
|
|
409
|
+
export interface StylingOption {
|
|
410
|
+
/**
|
|
411
|
+
* Allow drag-n-drop of tasks in the table
|
|
412
|
+
*/
|
|
413
|
+
canMoveTasks?: boolean;
|
|
414
|
+
canResizeColumns?: boolean;
|
|
415
|
+
colors?: Partial<ColorStyles>;
|
|
416
|
+
dateFormats?: Partial<DateFormats>;
|
|
417
|
+
distances?: Partial<Distances>;
|
|
418
|
+
icons?: Partial<Icons>;
|
|
419
|
+
columns?: readonly Column[];
|
|
420
|
+
onResizeColumn?: OnResizeColumn;
|
|
421
|
+
fontFamily?: string;
|
|
422
|
+
fontSize?: string;
|
|
423
|
+
TooltipContent?: ComponentType<{
|
|
424
|
+
task: Task;
|
|
425
|
+
fontSize: string;
|
|
426
|
+
fontFamily: string;
|
|
427
|
+
}>;
|
|
428
|
+
TaskListHeader?: ComponentType<TaskListHeaderProps>;
|
|
429
|
+
TaskListTable?: ComponentType<TaskListTableProps>;
|
|
430
|
+
/**
|
|
431
|
+
* Render function of bottom part of header above chart
|
|
432
|
+
*/
|
|
433
|
+
renderBottomHeader?: RenderBottomHeader;
|
|
434
|
+
/**
|
|
435
|
+
* Render function of top part of header above chart
|
|
436
|
+
*/
|
|
437
|
+
renderTopHeader?: RenderTopHeader;
|
|
438
|
+
/**
|
|
439
|
+
* Check is current date is a holiday
|
|
440
|
+
* @param date the date
|
|
441
|
+
* @param minTaskDate lower date of all tasks
|
|
442
|
+
* @param dateSetup
|
|
443
|
+
* @param dateExtremity start or end date
|
|
444
|
+
*/
|
|
445
|
+
checkIsHoliday?: (date: Date, minTaskDate: Date, dateSetup: DateSetup, dateExtremity: DateExtremity) => boolean;
|
|
446
|
+
/**
|
|
447
|
+
* Round the date of task after move or resize
|
|
448
|
+
* @param date Date after move
|
|
449
|
+
* @param viewMode current date unit
|
|
450
|
+
* @param dateExtremity start or end date
|
|
451
|
+
* @param action current user action
|
|
452
|
+
* @returns rounded date
|
|
453
|
+
*/
|
|
454
|
+
roundDate?: (date: Date, viewMode: ViewMode, dateExtremity: DateExtremity, action: BarMoveAction) => Date;
|
|
455
|
+
dateMoveStep?: GanttDateRounding;
|
|
456
|
+
ContextualPalette?: React.FC<TaskContextualPaletteProps>;
|
|
457
|
+
TaskDependencyContextualPalette?: React.FC<TaskDependencyContextualPaletteProps>;
|
|
458
|
+
}
|
|
459
|
+
export interface GanttDateRounding {
|
|
460
|
+
value: number;
|
|
461
|
+
timeUnit: GanttDateRoundingTimeUnit;
|
|
462
|
+
}
|
|
463
|
+
export declare enum GanttDateRoundingTimeUnit {
|
|
464
|
+
MINUTE = 0,
|
|
465
|
+
HOUR = 1,
|
|
466
|
+
DAY = 2
|
|
467
|
+
}
|
|
468
|
+
export interface TaskContextualPaletteProps {
|
|
469
|
+
selectedTask: Task;
|
|
470
|
+
onClosePalette: () => void;
|
|
471
|
+
}
|
|
472
|
+
export interface TaskDependencyContextualPaletteProps {
|
|
473
|
+
taskFrom: Task;
|
|
474
|
+
extremityFrom: DateExtremity;
|
|
475
|
+
taskTo: Task;
|
|
476
|
+
extremityTo: DateExtremity;
|
|
477
|
+
onClosePalette: () => void;
|
|
478
|
+
}
|
|
479
|
+
export type DateExtremity = "startOfTask" | "endOfTask";
|
|
480
|
+
export interface GanttProps extends EventOption, DisplayOption, StylingOption {
|
|
481
|
+
/**
|
|
482
|
+
* Can be used to compare multiple graphs. This prop is the number of graps being compared
|
|
483
|
+
*/
|
|
484
|
+
enableTaskGrouping?: boolean;
|
|
485
|
+
comparisonLevels?: number;
|
|
486
|
+
contextMenuOptions?: ContextMenuOptionType[];
|
|
487
|
+
enableTableListContextMenu?: number;
|
|
488
|
+
/**
|
|
489
|
+
* Get new id for task after using copy-paste
|
|
490
|
+
*/
|
|
491
|
+
getCopiedTaskId?: GetCopiedTaskId;
|
|
492
|
+
/**
|
|
493
|
+
* Move dates of tasks to working days during change
|
|
494
|
+
*/
|
|
495
|
+
isAdjustToWorkingDates?: boolean;
|
|
496
|
+
tasks: readonly TaskOrEmpty[];
|
|
497
|
+
}
|
|
498
|
+
export interface TaskListTableProps {
|
|
499
|
+
canMoveTasks: boolean;
|
|
500
|
+
enableTaskGrouping?: boolean;
|
|
501
|
+
childTasksMap: ChildByLevelMap;
|
|
502
|
+
colors: ColorStyles;
|
|
503
|
+
columns: readonly Column[];
|
|
504
|
+
cutIdsMirror: Readonly<Record<string, true>>;
|
|
505
|
+
dateSetup: DateSetup;
|
|
506
|
+
dependencyMap: DependencyMap;
|
|
507
|
+
distances: Distances;
|
|
508
|
+
fontFamily: string;
|
|
509
|
+
fontSize: string;
|
|
510
|
+
fullRowHeight: number;
|
|
511
|
+
ganttFullHeight: number;
|
|
512
|
+
getTaskCurrentState: (task: Task) => Task;
|
|
513
|
+
handleAddTask: (task: Task) => void;
|
|
514
|
+
handleDeleteTasks: (task: TaskOrEmpty[]) => void;
|
|
515
|
+
handleEditTask: (task: TaskOrEmpty) => void;
|
|
516
|
+
handleMoveTaskBefore: (target: TaskOrEmpty, taskForMove: TaskOrEmpty) => void;
|
|
517
|
+
handleMoveTaskAfter: (target: TaskOrEmpty, taskForMove: TaskOrEmpty) => void;
|
|
518
|
+
handleMoveTasksInside: (parent: Task, childs: readonly TaskOrEmpty[]) => void;
|
|
519
|
+
handleOpenContextMenu: (task: TaskOrEmpty, clientX: number, clientY: number) => void;
|
|
520
|
+
icons?: Partial<Icons>;
|
|
521
|
+
isShowTaskNumbers: boolean;
|
|
522
|
+
mapTaskToNestedIndex: MapTaskToNestedIndex;
|
|
523
|
+
onClick: (task: TaskOrEmpty) => void;
|
|
524
|
+
onExpanderClick: (task: Task) => void;
|
|
525
|
+
renderedIndexes: OptimizedListParams | null;
|
|
526
|
+
scrollToTask: (task: Task) => void;
|
|
527
|
+
selectTaskOnMouseDown: (taskId: string, event: MouseEvent) => void;
|
|
528
|
+
selectedIdsMirror: Readonly<Record<string, true>>;
|
|
529
|
+
taskListWidth: number;
|
|
530
|
+
tasks: readonly TaskOrEmpty[];
|
|
531
|
+
}
|
|
532
|
+
export interface TaskListHeaderProps extends TaskListHeaderActionsProps {
|
|
533
|
+
headerHeight: number;
|
|
534
|
+
columns: readonly Column[];
|
|
535
|
+
fontFamily: string;
|
|
536
|
+
fontSize: string;
|
|
537
|
+
canResizeColumns: boolean;
|
|
538
|
+
onColumnResizeStart: (columnIndex: number, clientX: number) => void;
|
|
539
|
+
colors: ColorStyles;
|
|
540
|
+
}
|
|
541
|
+
export type TaskToGlobalIndexMap = Map<number, Map<string, number>>;
|
|
542
|
+
export type TaskToRowIndexMap = Map<number, Map<string, number>>;
|
|
543
|
+
export type RowIndexToTaskMap = Map<number, Map<number, TaskOrEmpty>>;
|
|
544
|
+
export type RowIndexToTasksMap = Map<number, Map<number, TaskOrEmpty[]>>;
|
|
545
|
+
export type GlobalRowIndexToTaskMap = Map<number, TaskOrEmpty>;
|
|
546
|
+
export type ChildByLevelMap = Map<number, Map<string, TaskOrEmpty[]>>;
|
|
547
|
+
export type RootMapByLevel = Map<number, TaskOrEmpty[]>;
|
|
548
|
+
export type TaskMapByLevel = Map<number, Map<string, TaskOrEmpty>>;
|
|
549
|
+
export type MapTaskToNestedIndex = Map<number, Map<string, [number, string]>>;
|
|
550
|
+
export interface TaskOutOfParentWarning {
|
|
551
|
+
isOutside: boolean;
|
|
552
|
+
date: Date;
|
|
553
|
+
}
|
|
554
|
+
export interface TaskOutOfParentWarnings {
|
|
555
|
+
start?: TaskOutOfParentWarning;
|
|
556
|
+
end?: TaskOutOfParentWarning;
|
|
557
|
+
}
|
|
558
|
+
/**
|
|
559
|
+
* comparison level -> task id -> {
|
|
560
|
+
* start: {
|
|
561
|
+
* isOutsie: false,
|
|
562
|
+
* date: Date,
|
|
563
|
+
* },
|
|
564
|
+
*
|
|
565
|
+
* end: {
|
|
566
|
+
* isOutsie: false,
|
|
567
|
+
* date: Date,
|
|
568
|
+
* },
|
|
569
|
+
* }
|
|
570
|
+
*/
|
|
571
|
+
export type ChildOutOfParentWarnings = Map<number, Map<string, TaskOutOfParentWarnings>>;
|
|
572
|
+
export type DependencyMap = Map<number, Map<string, ExpandedDependency[]>>;
|
|
573
|
+
export type DependentMap = Map<number, Map<string, ExpandedDependent[]>>;
|
|
574
|
+
export type DependencyMargins = Map<number, Map<string, Map<string, number>>>;
|
|
575
|
+
export type TaskToHasDependencyWarningMap = Map<number, Set<string>>;
|
|
576
|
+
export type CriticalPath = {
|
|
577
|
+
tasks: Set<string>;
|
|
578
|
+
dependencies: Map<string, Set<string>>;
|
|
579
|
+
};
|
|
580
|
+
export type CriticalPaths = Map<number, CriticalPath>;
|
|
581
|
+
export type TaskCoordinates = {
|
|
582
|
+
/**
|
|
583
|
+
* Width of inner svg wrapper
|
|
584
|
+
*/
|
|
585
|
+
containerWidth: number;
|
|
586
|
+
/**
|
|
587
|
+
* Left border of inner svg wrapper relative to the root svg
|
|
588
|
+
*/
|
|
589
|
+
containerX: number;
|
|
590
|
+
/**
|
|
591
|
+
* Left border relative to the wrapper svg
|
|
592
|
+
*/
|
|
593
|
+
innerX1: number;
|
|
594
|
+
/**
|
|
595
|
+
* Right border relative to the wrapper svg
|
|
596
|
+
*/
|
|
597
|
+
innerX2: number;
|
|
598
|
+
/**
|
|
599
|
+
* Top border of inner svg wrapper relative to the root svg
|
|
600
|
+
*/
|
|
601
|
+
levelY: number;
|
|
602
|
+
/**
|
|
603
|
+
* Width of the progress bar
|
|
604
|
+
*/
|
|
605
|
+
progressWidth: number;
|
|
606
|
+
/**
|
|
607
|
+
* Left border of the progress bar relative to the root svg
|
|
608
|
+
*/
|
|
609
|
+
progressX: number;
|
|
610
|
+
/**
|
|
611
|
+
* Width of the task
|
|
612
|
+
*/
|
|
613
|
+
width: number;
|
|
614
|
+
/**
|
|
615
|
+
* Left border of the task relative to the root svg
|
|
616
|
+
*/
|
|
617
|
+
x1: number;
|
|
618
|
+
/**
|
|
619
|
+
* Right border of the task relative to the root svg
|
|
620
|
+
*/
|
|
621
|
+
x2: number;
|
|
622
|
+
/**
|
|
623
|
+
* Top border of the task relative to the root svg
|
|
624
|
+
*/
|
|
625
|
+
y: number;
|
|
626
|
+
};
|
|
627
|
+
/**
|
|
628
|
+
* comparison level -> task id -> {
|
|
629
|
+
* x1: number;
|
|
630
|
+
* x2: number;
|
|
631
|
+
* y: number;
|
|
632
|
+
* }
|
|
633
|
+
*/
|
|
634
|
+
export type MapTaskToCoordinates = Map<number, Map<string, TaskCoordinates>>;
|
|
635
|
+
export type ChangeInProgress = {
|
|
636
|
+
action: BarMoveAction;
|
|
637
|
+
additionalLeftSpace: number;
|
|
638
|
+
additionalRightSpace: number;
|
|
639
|
+
changedTask: Task;
|
|
640
|
+
coordinates: TaskCoordinates;
|
|
641
|
+
coordinatesDiff: number;
|
|
642
|
+
initialCoordinates: TaskCoordinates;
|
|
643
|
+
lastClientX: number;
|
|
644
|
+
startX: number;
|
|
645
|
+
originalTask: Task;
|
|
646
|
+
taskRootNode: Element;
|
|
647
|
+
tsDiff: number;
|
|
648
|
+
};
|
|
649
|
+
export type GetMetadata = (task: TaskOrEmpty) => ChangeMetadata;
|
|
650
|
+
export type ColumnData = {
|
|
651
|
+
canMoveTasks: boolean;
|
|
652
|
+
dateSetup: DateSetup;
|
|
653
|
+
depth: number;
|
|
654
|
+
dependencies: Task[];
|
|
655
|
+
distances: Distances;
|
|
656
|
+
handleAddTask: (task: Task) => void;
|
|
657
|
+
handleDeleteTasks: (task: TaskOrEmpty[]) => void;
|
|
658
|
+
handleEditTask: (task: TaskOrEmpty) => void;
|
|
659
|
+
hasChildren: boolean;
|
|
660
|
+
icons?: Partial<Icons>;
|
|
661
|
+
indexStr: string;
|
|
662
|
+
isClosed: boolean;
|
|
663
|
+
isShowTaskNumbers: boolean;
|
|
664
|
+
onExpanderClick: (task: Task) => void;
|
|
665
|
+
task: TaskOrEmpty;
|
|
666
|
+
colors: Partial<ColorStyles>;
|
|
667
|
+
};
|
|
668
|
+
export type ColumnProps = {
|
|
669
|
+
data: ColumnData;
|
|
670
|
+
};
|
|
671
|
+
export type Column = {
|
|
672
|
+
id: string;
|
|
673
|
+
Cell: ComponentType<ColumnProps>;
|
|
674
|
+
width: number;
|
|
675
|
+
title?: ReactNode;
|
|
676
|
+
canResize?: boolean;
|
|
677
|
+
};
|
|
678
|
+
export type OnResizeColumn = (nextColumns: readonly Column[], columnIndex: number, deltaWidth: number) => void;
|
|
679
|
+
export type ChangeAction = {
|
|
680
|
+
type: "add-childs";
|
|
681
|
+
parent: Task;
|
|
682
|
+
addedIdsMap: Map<number, Set<string>>;
|
|
683
|
+
addedChildsByLevelMap: ChildByLevelMap;
|
|
684
|
+
addedRootsByLevelMap: RootMapByLevel;
|
|
685
|
+
descendants: readonly TaskOrEmpty[];
|
|
686
|
+
} | {
|
|
687
|
+
type: "change";
|
|
688
|
+
task: TaskOrEmpty;
|
|
689
|
+
} | {
|
|
690
|
+
type: "change_start_and_end";
|
|
691
|
+
task: Task;
|
|
692
|
+
changedTask: Task;
|
|
693
|
+
originalTask: Task;
|
|
694
|
+
} | {
|
|
695
|
+
type: "delete";
|
|
696
|
+
tasks: readonly TaskOrEmpty[];
|
|
697
|
+
deletedIdsMap: Map<number, Set<string>>;
|
|
698
|
+
} | {
|
|
699
|
+
type: "move-before";
|
|
700
|
+
target: TaskOrEmpty;
|
|
701
|
+
taskForMove: TaskOrEmpty;
|
|
702
|
+
} | {
|
|
703
|
+
type: "move-after";
|
|
704
|
+
target: TaskOrEmpty;
|
|
705
|
+
taskForMove: TaskOrEmpty;
|
|
706
|
+
} | {
|
|
707
|
+
type: "move-inside";
|
|
708
|
+
parent: Task;
|
|
709
|
+
childs: readonly TaskOrEmpty[];
|
|
710
|
+
movedIdsMap: Map<number, Set<string>>;
|
|
711
|
+
};
|
|
712
|
+
export type ChangeMetadata = [
|
|
713
|
+
/**
|
|
714
|
+
* dependent tasks
|
|
715
|
+
*/
|
|
716
|
+
Task[],
|
|
717
|
+
/**
|
|
718
|
+
* indexes in list of tasks
|
|
719
|
+
*/
|
|
720
|
+
Array<{
|
|
721
|
+
task: TaskOrEmpty;
|
|
722
|
+
index: number;
|
|
723
|
+
}>,
|
|
724
|
+
/**
|
|
725
|
+
* array of parents of the task
|
|
726
|
+
*/
|
|
727
|
+
Task[],
|
|
728
|
+
/**
|
|
729
|
+
* array of suggesgions for change parent
|
|
730
|
+
*/
|
|
731
|
+
OnDateChangeSuggestionType[]
|
|
732
|
+
];
|
|
733
|
+
export type ContextMenuType = {
|
|
734
|
+
task: TaskOrEmpty | null;
|
|
735
|
+
x: number;
|
|
736
|
+
y: number;
|
|
737
|
+
};
|
|
738
|
+
export type ActionMetaType = {
|
|
739
|
+
/**
|
|
740
|
+
* Check is task id exists at current level (1 by default)
|
|
741
|
+
*/
|
|
742
|
+
checkTaskIdExists: CheckTaskIdExistsAtLevel;
|
|
743
|
+
/**
|
|
744
|
+
* Copy all selected tasks
|
|
745
|
+
*/
|
|
746
|
+
copySelectedTasks: () => void;
|
|
747
|
+
/**
|
|
748
|
+
* Copy single task
|
|
749
|
+
* @param task the task
|
|
750
|
+
*/
|
|
751
|
+
copyTask: (task: TaskOrEmpty) => void;
|
|
752
|
+
/**
|
|
753
|
+
* Cut all selected tasks
|
|
754
|
+
*/
|
|
755
|
+
cutSelectedTasks: () => void;
|
|
756
|
+
/**
|
|
757
|
+
* Cut single task
|
|
758
|
+
* @param task the task
|
|
759
|
+
*/
|
|
760
|
+
cutTask: (task: TaskOrEmpty) => void;
|
|
761
|
+
/**
|
|
762
|
+
* @returns List of parent tasks under copy action
|
|
763
|
+
*/
|
|
764
|
+
getCopyParentTasks: () => readonly TaskOrEmpty[];
|
|
765
|
+
/**
|
|
766
|
+
* @returns List of tasks under copy action
|
|
767
|
+
*/
|
|
768
|
+
getCopyTasks: () => readonly TaskOrEmpty[];
|
|
769
|
+
/**
|
|
770
|
+
* @returns List of tasks with all their descendants under copy action
|
|
771
|
+
*/
|
|
772
|
+
getCopyTasksWithDescendants: () => readonly TaskOrEmpty[];
|
|
773
|
+
/**
|
|
774
|
+
* @returns List of parent tasks under cut action
|
|
775
|
+
*/
|
|
776
|
+
getCutParentTasks: () => readonly TaskOrEmpty[];
|
|
777
|
+
/**
|
|
778
|
+
* @returns List of tasks under cut action
|
|
779
|
+
*/
|
|
780
|
+
getCutTasks: () => readonly TaskOrEmpty[];
|
|
781
|
+
/**
|
|
782
|
+
* @returns List of parent tasks
|
|
783
|
+
*/
|
|
784
|
+
getParentTasks: () => readonly TaskOrEmpty[];
|
|
785
|
+
/**
|
|
786
|
+
* @returns List of selected tasks
|
|
787
|
+
*/
|
|
788
|
+
getSelectedTasks: () => readonly TaskOrEmpty[];
|
|
789
|
+
/**
|
|
790
|
+
* @returns List of tasks with all their descendants
|
|
791
|
+
*/
|
|
792
|
+
getTasksWithDescendants: () => readonly TaskOrEmpty[];
|
|
793
|
+
/**
|
|
794
|
+
* Add childs to the container task
|
|
795
|
+
* @param parent the container task
|
|
796
|
+
* @param descendants list of added childs with their descendants
|
|
797
|
+
*/
|
|
798
|
+
handleAddChilds: (parent: Task, descendants: readonly TaskOrEmpty[]) => void;
|
|
799
|
+
/**
|
|
800
|
+
* Delete tasks
|
|
801
|
+
* @param tasksForDelete list of tasks for delete
|
|
802
|
+
*/
|
|
803
|
+
handleDeleteTasks: (tasksForDelete: readonly TaskOrEmpty[]) => void;
|
|
804
|
+
/**
|
|
805
|
+
* Move tasks to the container task
|
|
806
|
+
* @param parent the container task
|
|
807
|
+
* @param childs list of moved tasks
|
|
808
|
+
*/
|
|
809
|
+
handleMoveTasksInside: (parent: Task, childs: readonly TaskOrEmpty[]) => void;
|
|
810
|
+
/**
|
|
811
|
+
* Make copies of the list of tasks
|
|
812
|
+
*/
|
|
813
|
+
makeCopies: (tasks: readonly TaskOrEmpty[]) => readonly TaskOrEmpty[];
|
|
814
|
+
/**
|
|
815
|
+
* Reset selection
|
|
816
|
+
*/
|
|
817
|
+
resetSelectedTasks: () => void;
|
|
818
|
+
/**
|
|
819
|
+
* Task that triggered context menu
|
|
820
|
+
*/
|
|
821
|
+
task: TaskOrEmpty;
|
|
822
|
+
};
|
|
823
|
+
export type CheckIsAvailableMetaType = {
|
|
824
|
+
/**
|
|
825
|
+
*
|
|
826
|
+
* @returns Check are there tasks under the copy action
|
|
827
|
+
*/
|
|
828
|
+
checkHasCopyTasks: () => boolean;
|
|
829
|
+
/**
|
|
830
|
+
*
|
|
831
|
+
* @returns Check are there tasks under the cut action
|
|
832
|
+
*/
|
|
833
|
+
checkHasCutTasks: () => boolean;
|
|
834
|
+
/**
|
|
835
|
+
* Context menu trigger task
|
|
836
|
+
*/
|
|
837
|
+
task: TaskOrEmpty;
|
|
838
|
+
};
|
|
839
|
+
export type ContextMenuOptionType = {
|
|
840
|
+
/**
|
|
841
|
+
* Invokes on click on menu option
|
|
842
|
+
* @param meta Metadata for the action
|
|
843
|
+
*/
|
|
844
|
+
action: (meta: ActionMetaType) => void;
|
|
845
|
+
/**
|
|
846
|
+
* Check is the current action available. Available by default
|
|
847
|
+
* @param meta Metadata for checking
|
|
848
|
+
*/
|
|
849
|
+
checkIsAvailable?: (meta: CheckIsAvailableMetaType) => void;
|
|
850
|
+
label: ReactNode;
|
|
851
|
+
icon?: ReactNode;
|
|
852
|
+
};
|
|
853
|
+
export type CheckTaskIdExistsAtLevel = (newId: string, comparisonLevel?: number) => boolean;
|
|
854
|
+
export type GetCopiedTaskId = (task: TaskOrEmpty, checkExists: (newId: string) => boolean) => string;
|
|
855
|
+
export type AdjustTaskToWorkingDatesParams = {
|
|
856
|
+
action: BarMoveAction;
|
|
857
|
+
changedTask: Task;
|
|
858
|
+
originalTask: Task;
|
|
859
|
+
roundDate: (date: Date, action: BarMoveAction, dateExtremity: DateExtremity) => Date;
|
|
860
|
+
};
|