@ezraghzf/gantt-task-react 0.4.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 +152 -0
- package/dist/components/calendar/calendar.d.ts +16 -0
- package/dist/components/calendar/top-part-of-calendar.d.ts +11 -0
- package/dist/components/gantt/gantt.d.ts +3 -0
- package/dist/components/gantt/task-gantt-content.d.ts +25 -0
- package/dist/components/gantt/task-gantt.d.ts +13 -0
- package/dist/components/grid/grid-body.d.ts +12 -0
- package/dist/components/grid/grid.d.ts +4 -0
- package/dist/components/other/arrow.d.ts +12 -0
- package/dist/components/other/horizontal-scroll.d.ts +8 -0
- package/dist/components/other/tooltip.d.ts +29 -0
- package/dist/components/other/vertical-scroll.d.ts +9 -0
- package/dist/components/task-item/bar/bar-date-handle.d.ts +11 -0
- package/dist/components/task-item/bar/bar-display.d.ts +20 -0
- package/dist/components/task-item/bar/bar-progress-handle.d.ts +7 -0
- package/dist/components/task-item/bar/bar-small.d.ts +3 -0
- package/dist/components/task-item/bar/bar.d.ts +3 -0
- package/dist/components/task-item/milestone/milestone.d.ts +3 -0
- package/dist/components/task-item/project/project.d.ts +3 -0
- package/dist/components/task-item/task-item.d.ts +15 -0
- package/dist/components/task-list/task-list-header.d.ts +7 -0
- package/dist/components/task-list/task-list-table.d.ts +13 -0
- package/dist/components/task-list/task-list.d.ts +37 -0
- package/dist/helpers/bar-helper.d.ts +14 -0
- package/dist/helpers/date-helper.d.ts +21 -0
- package/dist/helpers/other-helper.d.ts +8 -0
- package/dist/index.css +312 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +2885 -0
- package/dist/index.js.map +1 -0
- package/dist/index.modern.js +2884 -0
- package/dist/index.modern.js.map +1 -0
- package/dist/setupTests.d.ts +1 -0
- package/dist/test/date-helper.test.d.ts +1 -0
- package/dist/test/gant.test.d.ts +1 -0
- package/dist/types/bar-task.d.ts +24 -0
- package/dist/types/date-setup.d.ts +5 -0
- package/dist/types/gantt-task-actions.d.ts +8 -0
- package/dist/types/public-types.d.ts +147 -0
- package/package.json +72 -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,152 @@
|
|
|
1
|
+
# @ezraghzf/gantt-task-react
|
|
2
|
+
|
|
3
|
+
## Interactive Gantt Chart for React with TypeScript.
|
|
4
|
+
|
|
5
|
+

|
|
6
|
+
|
|
7
|
+
## [Live Demo](https://matematuk.github.io/gantt-task-react/)
|
|
8
|
+
|
|
9
|
+
## Install
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
npm install @ezraghzf/gantt-task-react
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## How to use it
|
|
16
|
+
|
|
17
|
+
```javascript
|
|
18
|
+
import { Gantt, Task, EventOption, StylingOption, ViewMode, DisplayOption } from '@ezraghzf/gantt-task-react';
|
|
19
|
+
import "@ezraghzf/gantt-task-react/dist/index.css";
|
|
20
|
+
|
|
21
|
+
let tasks: Task[] = [
|
|
22
|
+
{
|
|
23
|
+
start: new Date(2020, 1, 1),
|
|
24
|
+
end: new Date(2020, 1, 2),
|
|
25
|
+
name: 'Idea',
|
|
26
|
+
id: 'Task 0',
|
|
27
|
+
type:'task',
|
|
28
|
+
progress: 45,
|
|
29
|
+
isDisabled: true,
|
|
30
|
+
styles: { progressColor: '#ffbb54', progressSelectedColor: '#ff9e0d' },
|
|
31
|
+
},
|
|
32
|
+
...
|
|
33
|
+
];
|
|
34
|
+
<Gantt tasks={tasks} />
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
You may handle actions
|
|
38
|
+
|
|
39
|
+
```javascript
|
|
40
|
+
<Gantt
|
|
41
|
+
tasks={tasks}
|
|
42
|
+
viewMode={view}
|
|
43
|
+
onDateChange={onTaskChange}
|
|
44
|
+
onTaskDelete={onTaskDelete}
|
|
45
|
+
onProgressChange={onProgressChange}
|
|
46
|
+
onDoubleClick={onDblClick}
|
|
47
|
+
onClick={onClick}
|
|
48
|
+
/>
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## How to run example
|
|
52
|
+
|
|
53
|
+
```
|
|
54
|
+
cd ./example
|
|
55
|
+
npm install
|
|
56
|
+
npm start
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Gantt Configuration
|
|
60
|
+
|
|
61
|
+
### GanttProps
|
|
62
|
+
|
|
63
|
+
| Parameter Name | Type | Description |
|
|
64
|
+
| :------------------------------ | :------------ | :------------------------------------------------- |
|
|
65
|
+
| tasks\* | [Task](#Task) | Tasks array. |
|
|
66
|
+
| [EventOption](#EventOption) | interface | Specifies gantt events. |
|
|
67
|
+
| [DisplayOption](#DisplayOption) | interface | Specifies view type and display timeline language. |
|
|
68
|
+
| [StylingOption](#StylingOption) | interface | Specifies chart and global tasks styles |
|
|
69
|
+
|
|
70
|
+
### EventOption
|
|
71
|
+
|
|
72
|
+
| Parameter Name | Type | Description |
|
|
73
|
+
| :----------------- | :---------------------------------------------------------------------------- | :-------------------------------------------------------------------------------------- |
|
|
74
|
+
| onSelect | (task: Task, isSelected: boolean) => void | Specifies the function to be executed on the taskbar select or unselect event. |
|
|
75
|
+
| onDoubleClick | (task: Task) => void | Specifies the function to be executed on the taskbar onDoubleClick event. |
|
|
76
|
+
| onClick | (task: Task) => void | Specifies the function to be executed on the taskbar onClick event. |
|
|
77
|
+
| onDelete\* | (task: Task) => void/boolean/Promise<void>/Promise<boolean> | Specifies the function to be executed on the taskbar on Delete button press event. |
|
|
78
|
+
| 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. |
|
|
79
|
+
| onProgressChange\* | (task: Task, children: Task[]) => void/boolean/Promise<void>/Promise<boolean> | Specifies the function to be executed when drag taskbar progress event has finished. |
|
|
80
|
+
| onExpanderClick\* | onExpanderClick: (task: Task) => void; | Specifies the function to be executed on the table expander click |
|
|
81
|
+
| timeStep | number | A time step value for onDateChange. Specify in milliseconds. |
|
|
82
|
+
|
|
83
|
+
\* Chart undoes operation if method return false or error. Parameter children returns one level deep records.
|
|
84
|
+
|
|
85
|
+
### DisplayOption
|
|
86
|
+
|
|
87
|
+
| Parameter Name | Type | Description |
|
|
88
|
+
| :------------- | :------ | :---------------------------------------------------------------------------------------------------------- |
|
|
89
|
+
| viewMode | enum | Specifies the time scale. Hour, Quarter Day, Half Day, Day, Week(ISO-8601, 1st day is Monday), Month, QuarterYear, Year. |
|
|
90
|
+
| viewDate | date | Specifies display date and time for display. |
|
|
91
|
+
| preStepsCount | number | Specifies empty space before the fist task |
|
|
92
|
+
| locale | string | Specifies the month name language. Able formats: ISO 639-2, Java Locale. |
|
|
93
|
+
| rtl | boolean | Sets rtl mode. |
|
|
94
|
+
|
|
95
|
+
### StylingOption
|
|
96
|
+
|
|
97
|
+
| Parameter Name | Type | Description |
|
|
98
|
+
| :------------------------- | :----- | :--------------------------------------------------------------------------------------------- |
|
|
99
|
+
| headerHeight | number | Specifies the header height. |
|
|
100
|
+
| ganttHeight | number | Specifies the gantt chart height without header. Default is 0. It`s mean no height limitation. |
|
|
101
|
+
| columnWidth | number | Specifies the time period width. |
|
|
102
|
+
| listCellWidth | string | Specifies the task list cell width. Empty string is mean "no display". |
|
|
103
|
+
| rowHeight | number | Specifies the task row height. |
|
|
104
|
+
| barCornerRadius | number | Specifies the taskbar corner rounding. |
|
|
105
|
+
| barFill | number | Specifies the taskbar occupation. Sets in percent from 0 to 100. |
|
|
106
|
+
| handleWidth | number | Specifies width the taskbar drag event control for start and end dates. |
|
|
107
|
+
| fontFamily | string | Specifies the application font. |
|
|
108
|
+
| fontSize | string | Specifies the application font size. |
|
|
109
|
+
| barProgressColor | string | Specifies the taskbar progress fill color globally. |
|
|
110
|
+
| barProgressSelectedColor | string | Specifies the taskbar progress fill color globally on select. |
|
|
111
|
+
| barBackgroundColor | string | Specifies the taskbar background fill color globally. |
|
|
112
|
+
| barBackgroundSelectedColor | string | Specifies the taskbar background fill color globally on select. |
|
|
113
|
+
| baselineBackgroundColor | string | Specifies the baseline bar fill color globally. |
|
|
114
|
+
| arrowColor | string | Specifies the relationship arrow fill color. |
|
|
115
|
+
| arrowIndent | number | Specifies the relationship arrow right indent. Sets in px |
|
|
116
|
+
| todayColor | string | Specifies the current period column fill color. |
|
|
117
|
+
| TooltipContent | | Specifies the Tooltip view for selected taskbar. |
|
|
118
|
+
| TaskListHeader | | Specifies the task list Header view |
|
|
119
|
+
| TaskListTable | | Specifies the task list Table view |
|
|
120
|
+
|
|
121
|
+
- TooltipContent: [`React.FC<{ task: Task; fontSize: string; fontFamily: string; }>;`](https://github.com/MaTeMaTuK/gantt-task-react/blob/main/src/components/other/tooltip.tsx#L56)
|
|
122
|
+
- TaskListHeader: `React.FC<{ headerHeight: number; rowWidth: string; fontFamily: string; fontSize: string;}>;`
|
|
123
|
+
- TaskListTable: `React.FC<{ rowHeight: number; rowWidth: string; fontFamily: string; fontSize: string; locale: string; tasks: Task[]; selectedTaskId: string; setSelectedTask: (taskId: string) => void; }>;`
|
|
124
|
+
|
|
125
|
+
### Task
|
|
126
|
+
|
|
127
|
+
| Parameter Name | Type | Description |
|
|
128
|
+
| :------------- | :------- | :---------------------------------------------------------------------------------------------------- |
|
|
129
|
+
| id\* | string | Task id. |
|
|
130
|
+
| name\* | string | Task display name. |
|
|
131
|
+
| type\* | string | Task display type: **task**, **milestone**, **project** |
|
|
132
|
+
| start\* | Date | Task start date. |
|
|
133
|
+
| end\* | Date | Task end date. |
|
|
134
|
+
| baselineStart | Date | Task baseline start date. |
|
|
135
|
+
| baselineEnd | Date | Task baseline end date. |
|
|
136
|
+
| progress\* | number | Task progress. Sets in percent from 0 to 100. |
|
|
137
|
+
| dependencies | string[] | Specifies the parent dependencies ids. |
|
|
138
|
+
| styles | object | Specifies the taskbar styling settings locally. Object is passed with the following attributes: |
|
|
139
|
+
| | | - **backgroundColor**: String. Specifies the taskbar background fill color locally. |
|
|
140
|
+
| | | - **backgroundSelectedColor**: String. Specifies the taskbar background fill color locally on select. |
|
|
141
|
+
| | | - **progressColor**: String. Specifies the taskbar progress fill color locally. |
|
|
142
|
+
| | | - **progressSelectedColor**: String. Specifies the taskbar progress fill color globally on select. |
|
|
143
|
+
| isDisabled | bool | Disables all action for current task. |
|
|
144
|
+
| fontSize | string | Specifies the taskbar font size locally. |
|
|
145
|
+
| project | string | Task project name |
|
|
146
|
+
| hideChildren | bool | Hide children items. Parameter works with project type only |
|
|
147
|
+
|
|
148
|
+
\*Required
|
|
149
|
+
|
|
150
|
+
## License
|
|
151
|
+
|
|
152
|
+
[MIT](https://oss.ninja/mit/jaredpalmer/)
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ViewMode } from "../../types/public-types";
|
|
3
|
+
import { DateSetup } from "../../types/date-setup";
|
|
4
|
+
export declare type CalendarProps = {
|
|
5
|
+
dateSetup: DateSetup;
|
|
6
|
+
locale: string;
|
|
7
|
+
viewMode: ViewMode;
|
|
8
|
+
rtl: boolean;
|
|
9
|
+
headerHeight: number;
|
|
10
|
+
columnWidth: number;
|
|
11
|
+
fontFamily: string;
|
|
12
|
+
fontSize: string;
|
|
13
|
+
headerBordered?: boolean;
|
|
14
|
+
startDate?: Date;
|
|
15
|
+
};
|
|
16
|
+
export declare const Calendar: React.FC<CalendarProps>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
declare type TopPartOfCalendarProps = {
|
|
3
|
+
value: string;
|
|
4
|
+
x1Line: number;
|
|
5
|
+
y1Line: number;
|
|
6
|
+
y2Line: number;
|
|
7
|
+
xText: number;
|
|
8
|
+
yText: number;
|
|
9
|
+
};
|
|
10
|
+
export declare const TopPartOfCalendar: React.FC<TopPartOfCalendarProps>;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { EventOption } from "../../types/public-types";
|
|
3
|
+
import { BarTask } from "../../types/bar-task";
|
|
4
|
+
import { GanttEvent } from "../../types/gantt-task-actions";
|
|
5
|
+
export declare type TaskGanttContentProps = {
|
|
6
|
+
tasks: BarTask[];
|
|
7
|
+
dates: Date[];
|
|
8
|
+
ganttEvent: GanttEvent;
|
|
9
|
+
selectedTask: BarTask | undefined;
|
|
10
|
+
rowHeight: number;
|
|
11
|
+
columnWidth: number;
|
|
12
|
+
timeStep: number;
|
|
13
|
+
svg?: React.RefObject<SVGSVGElement>;
|
|
14
|
+
svgWidth: number;
|
|
15
|
+
taskHeight: number;
|
|
16
|
+
arrowColor: string;
|
|
17
|
+
arrowIndent: number;
|
|
18
|
+
fontSize: string;
|
|
19
|
+
fontFamily: string;
|
|
20
|
+
rtl: boolean;
|
|
21
|
+
setGanttEvent: (value: GanttEvent) => void;
|
|
22
|
+
setFailedTask: (value: BarTask | null) => void;
|
|
23
|
+
setSelectedTask: (taskId: string) => void;
|
|
24
|
+
} & EventOption;
|
|
25
|
+
export declare const TaskGanttContent: React.FC<TaskGanttContentProps>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { GridProps } from "../grid/grid";
|
|
3
|
+
import { CalendarProps } from "../calendar/calendar";
|
|
4
|
+
import { TaskGanttContentProps } from "./task-gantt-content";
|
|
5
|
+
export declare type TaskGanttProps = {
|
|
6
|
+
gridProps: GridProps;
|
|
7
|
+
calendarProps: CalendarProps;
|
|
8
|
+
barProps: TaskGanttContentProps;
|
|
9
|
+
ganttHeight: number;
|
|
10
|
+
scrollY: number;
|
|
11
|
+
scrollX: number;
|
|
12
|
+
};
|
|
13
|
+
export declare const TaskGantt: React.FC<TaskGanttProps>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Task } from "../../types/public-types";
|
|
3
|
+
export declare type GridBodyProps = {
|
|
4
|
+
tasks: Task[];
|
|
5
|
+
dates: Date[];
|
|
6
|
+
svgWidth: number;
|
|
7
|
+
rowHeight: number;
|
|
8
|
+
columnWidth: number;
|
|
9
|
+
todayColor: string;
|
|
10
|
+
rtl: boolean;
|
|
11
|
+
};
|
|
12
|
+
export declare const GridBody: React.FC<GridBodyProps>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { BarTask } from "../../types/bar-task";
|
|
3
|
+
declare type ArrowProps = {
|
|
4
|
+
taskFrom: BarTask;
|
|
5
|
+
taskTo: BarTask;
|
|
6
|
+
rowHeight: number;
|
|
7
|
+
taskHeight: number;
|
|
8
|
+
arrowIndent: number;
|
|
9
|
+
rtl: boolean;
|
|
10
|
+
};
|
|
11
|
+
export declare const Arrow: React.FC<ArrowProps>;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Task } from "../../types/public-types";
|
|
3
|
+
import { BarTask } from "../../types/bar-task";
|
|
4
|
+
export declare type TooltipProps = {
|
|
5
|
+
task: BarTask;
|
|
6
|
+
arrowIndent: number;
|
|
7
|
+
rtl: boolean;
|
|
8
|
+
svgContainerHeight: number;
|
|
9
|
+
svgContainerWidth: number;
|
|
10
|
+
svgWidth: number;
|
|
11
|
+
headerHeight: number;
|
|
12
|
+
taskListWidth: number;
|
|
13
|
+
scrollX: number;
|
|
14
|
+
scrollY: number;
|
|
15
|
+
rowHeight: number;
|
|
16
|
+
fontSize: string;
|
|
17
|
+
fontFamily: string;
|
|
18
|
+
TooltipContent: React.FC<{
|
|
19
|
+
task: Task;
|
|
20
|
+
fontSize: string;
|
|
21
|
+
fontFamily: string;
|
|
22
|
+
}>;
|
|
23
|
+
};
|
|
24
|
+
export declare const Tooltip: React.FC<TooltipProps>;
|
|
25
|
+
export declare const StandardTooltipContent: React.FC<{
|
|
26
|
+
task: Task;
|
|
27
|
+
fontSize: string;
|
|
28
|
+
fontFamily: string;
|
|
29
|
+
}>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React, { SyntheticEvent } from "react";
|
|
2
|
+
export declare const VerticalScroll: React.FC<{
|
|
3
|
+
scroll: number;
|
|
4
|
+
ganttHeight: number;
|
|
5
|
+
ganttFullHeight: number;
|
|
6
|
+
headerHeight: number;
|
|
7
|
+
rtl: boolean;
|
|
8
|
+
onScroll: (event: SyntheticEvent<HTMLDivElement>) => void;
|
|
9
|
+
}>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
declare type BarDateHandleProps = {
|
|
3
|
+
x: number;
|
|
4
|
+
y: number;
|
|
5
|
+
width: number;
|
|
6
|
+
height: number;
|
|
7
|
+
barCornerRadius: number;
|
|
8
|
+
onMouseDown: (event: React.MouseEvent<SVGRectElement, MouseEvent>) => void;
|
|
9
|
+
};
|
|
10
|
+
export declare const BarDateHandle: React.FC<BarDateHandleProps>;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
declare type BarDisplayProps = {
|
|
3
|
+
x: number;
|
|
4
|
+
y: number;
|
|
5
|
+
width: number;
|
|
6
|
+
height: number;
|
|
7
|
+
isSelected: boolean;
|
|
8
|
+
progressX: number;
|
|
9
|
+
progressWidth: number;
|
|
10
|
+
barCornerRadius: number;
|
|
11
|
+
styles: {
|
|
12
|
+
backgroundColor: string;
|
|
13
|
+
backgroundSelectedColor: string;
|
|
14
|
+
progressColor: string;
|
|
15
|
+
progressSelectedColor: string;
|
|
16
|
+
};
|
|
17
|
+
onMouseDown: (event: React.MouseEvent<SVGPolygonElement, MouseEvent>) => void;
|
|
18
|
+
};
|
|
19
|
+
export declare const BarDisplay: React.FC<BarDisplayProps>;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
declare type BarProgressHandleProps = {
|
|
3
|
+
progressPoint: string;
|
|
4
|
+
onMouseDown: (event: React.MouseEvent<SVGPolygonElement, MouseEvent>) => void;
|
|
5
|
+
};
|
|
6
|
+
export declare const BarProgressHandle: React.FC<BarProgressHandleProps>;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { BarTask } from "../../types/bar-task";
|
|
3
|
+
import { GanttContentMoveAction } from "../../types/gantt-task-actions";
|
|
4
|
+
export declare type TaskItemProps = {
|
|
5
|
+
task: BarTask;
|
|
6
|
+
arrowIndent: number;
|
|
7
|
+
taskHeight: number;
|
|
8
|
+
isProgressChangeable: boolean;
|
|
9
|
+
isDateChangeable: boolean;
|
|
10
|
+
isDelete: boolean;
|
|
11
|
+
isSelected: boolean;
|
|
12
|
+
rtl: boolean;
|
|
13
|
+
onEventStart: (action: GanttContentMoveAction, selectedTask: BarTask, event?: React.MouseEvent | React.KeyboardEvent) => any;
|
|
14
|
+
};
|
|
15
|
+
export declare const TaskItem: React.FC<TaskItemProps>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Task } from "../../types/public-types";
|
|
3
|
+
export declare const TaskListTableDefault: React.FC<{
|
|
4
|
+
rowHeight: number;
|
|
5
|
+
rowWidth: string;
|
|
6
|
+
fontFamily: string;
|
|
7
|
+
fontSize: string;
|
|
8
|
+
locale: string;
|
|
9
|
+
tasks: Task[];
|
|
10
|
+
selectedTaskId: string;
|
|
11
|
+
setSelectedTask: (taskId: string) => void;
|
|
12
|
+
onExpanderClick: (task: Task) => void;
|
|
13
|
+
}>;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { BarTask } from "../../types/bar-task";
|
|
3
|
+
import { Task } from "../../types/public-types";
|
|
4
|
+
export declare type TaskListProps = {
|
|
5
|
+
headerHeight: number;
|
|
6
|
+
rowWidth: string;
|
|
7
|
+
fontFamily: string;
|
|
8
|
+
fontSize: string;
|
|
9
|
+
rowHeight: number;
|
|
10
|
+
ganttHeight: number;
|
|
11
|
+
scrollY: number;
|
|
12
|
+
locale: string;
|
|
13
|
+
tasks: Task[];
|
|
14
|
+
taskListRef: React.RefObject<HTMLDivElement>;
|
|
15
|
+
horizontalContainerClass?: string;
|
|
16
|
+
selectedTask: BarTask | undefined;
|
|
17
|
+
setSelectedTask: (task: string) => void;
|
|
18
|
+
onExpanderClick: (task: Task) => void;
|
|
19
|
+
TaskListHeader: React.FC<{
|
|
20
|
+
headerHeight: number;
|
|
21
|
+
rowWidth: string;
|
|
22
|
+
fontFamily: string;
|
|
23
|
+
fontSize: string;
|
|
24
|
+
}>;
|
|
25
|
+
TaskListTable: React.FC<{
|
|
26
|
+
rowHeight: number;
|
|
27
|
+
rowWidth: string;
|
|
28
|
+
fontFamily: string;
|
|
29
|
+
fontSize: string;
|
|
30
|
+
locale: string;
|
|
31
|
+
tasks: Task[];
|
|
32
|
+
selectedTaskId: string;
|
|
33
|
+
setSelectedTask: (taskId: string) => void;
|
|
34
|
+
onExpanderClick: (task: Task) => void;
|
|
35
|
+
}>;
|
|
36
|
+
};
|
|
37
|
+
export declare const TaskList: React.FC<TaskListProps>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Task } from "../types/public-types";
|
|
2
|
+
import { BarTask } from "../types/bar-task";
|
|
3
|
+
import { BarMoveAction } from "../types/gantt-task-actions";
|
|
4
|
+
export declare const convertToBarTasks: (tasks: Task[], dates: Date[], columnWidth: number, rowHeight: number, taskHeight: number, barCornerRadius: number, handleWidth: number, rtl: boolean, barProgressColor: string, barProgressSelectedColor: string, barBackgroundColor: string, barBackgroundSelectedColor: string, projectProgressColor: string, projectProgressSelectedColor: string, projectBackgroundColor: string, projectBackgroundSelectedColor: string, milestoneBackgroundColor: string, milestoneBackgroundSelectedColor: string, baselineBackgroundColor: string) => BarTask[];
|
|
5
|
+
export declare const progressWithByParams: (taskX1: number, taskX2: number, progress: number, rtl: boolean) => number[];
|
|
6
|
+
export declare const progressByProgressWidth: (progressWidth: number, barTask: BarTask) => number;
|
|
7
|
+
export declare const getProgressPoint: (progressX: number, taskY: number, taskHeight: number) => string;
|
|
8
|
+
/**
|
|
9
|
+
* Method handles event in real time(mousemove) and on finish(mouseup)
|
|
10
|
+
*/
|
|
11
|
+
export declare const handleTaskBySVGMouseEvent: (svgX: number, action: BarMoveAction, selectedTask: BarTask, xStep: number, timeStep: number, initEventX1Delta: number, rtl: boolean) => {
|
|
12
|
+
isChanged: boolean;
|
|
13
|
+
changedTask: BarTask;
|
|
14
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Task, ViewMode } from "../types/public-types";
|
|
2
|
+
import DateTimeFormatOptions = Intl.DateTimeFormatOptions;
|
|
3
|
+
import DateTimeFormat = Intl.DateTimeFormat;
|
|
4
|
+
declare type DateHelperScales = "year" | "month" | "day" | "hour" | "minute" | "second" | "millisecond";
|
|
5
|
+
export declare const getCachedDateTimeFormat: (locString: string | string[], opts?: DateTimeFormatOptions) => DateTimeFormat;
|
|
6
|
+
export declare const addToDate: (date: Date, quantity: number, scale: DateHelperScales) => Date;
|
|
7
|
+
export declare const startOfDate: (date: Date, scale: DateHelperScales) => Date;
|
|
8
|
+
export declare const ganttDateRange: (tasks: Task[], viewMode: ViewMode, preStepsCount: number) => Date[];
|
|
9
|
+
export declare const seedDates: (startDate: Date, endDate: Date, viewMode: ViewMode) => Date[];
|
|
10
|
+
export declare const getLocaleMonth: (date: Date, locale: string) => string;
|
|
11
|
+
export declare const getLocalDayOfWeek: (date: Date, locale: string, format?: "long" | "short" | "narrow" | undefined) => string;
|
|
12
|
+
/**
|
|
13
|
+
* Returns monday of current week
|
|
14
|
+
* @param date date for modify
|
|
15
|
+
*/
|
|
16
|
+
export declare const getMonday: (date: Date) => Date;
|
|
17
|
+
export declare const getWeekNumberFromDate: (date: Date, startDate: Date) => number;
|
|
18
|
+
export declare const getWeekNumberISO8601: (date: Date) => string;
|
|
19
|
+
export declare const getDaysInMonth: (month: number, year: number) => number;
|
|
20
|
+
export declare const getWeekNumberInMonth: (date: Date) => number;
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { BarTask } from "../types/bar-task";
|
|
3
|
+
import { Task } from "../types/public-types";
|
|
4
|
+
export declare function isKeyboardEvent(event: React.MouseEvent | React.KeyboardEvent | React.FocusEvent): event is React.KeyboardEvent;
|
|
5
|
+
export declare function isMouseEvent(event: React.MouseEvent | React.KeyboardEvent | React.FocusEvent): event is React.MouseEvent;
|
|
6
|
+
export declare function isBarTask(task: Task | BarTask): task is BarTask;
|
|
7
|
+
export declare function removeHiddenTasks(tasks: Task[]): Task[];
|
|
8
|
+
export declare const sortTasks: (taskA: Task, taskB: Task) => 0 | 1 | -1;
|