@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
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare enum ViewMode {
|
|
3
|
+
Hour = "Hour",
|
|
4
|
+
QuarterDay = "Quarter Day",
|
|
5
|
+
HalfDay = "Half Day",
|
|
6
|
+
Day = "Day",
|
|
7
|
+
/** ISO-8601 week */
|
|
8
|
+
Week = "Week",
|
|
9
|
+
Month = "Month",
|
|
10
|
+
WeeklyMonth = "WeeklyMonth",
|
|
11
|
+
QuarterYear = "QuarterYear",
|
|
12
|
+
Year = "Year"
|
|
13
|
+
}
|
|
14
|
+
export declare type TaskType = "task" | "milestone" | "project";
|
|
15
|
+
export interface Task {
|
|
16
|
+
id: string;
|
|
17
|
+
type: TaskType;
|
|
18
|
+
name: string;
|
|
19
|
+
start: Date;
|
|
20
|
+
end: Date;
|
|
21
|
+
/**
|
|
22
|
+
* Optional baseline start date
|
|
23
|
+
*/
|
|
24
|
+
baselineStart?: Date;
|
|
25
|
+
/**
|
|
26
|
+
* Optional baseline end date
|
|
27
|
+
*/
|
|
28
|
+
baselineEnd?: Date;
|
|
29
|
+
/**
|
|
30
|
+
* From 0 to 100
|
|
31
|
+
*/
|
|
32
|
+
progress: number;
|
|
33
|
+
styles?: {
|
|
34
|
+
backgroundColor?: string;
|
|
35
|
+
backgroundSelectedColor?: string;
|
|
36
|
+
progressColor?: string;
|
|
37
|
+
progressSelectedColor?: string;
|
|
38
|
+
};
|
|
39
|
+
isDisabled?: boolean;
|
|
40
|
+
project?: string;
|
|
41
|
+
dependencies?: string[];
|
|
42
|
+
hideChildren?: boolean;
|
|
43
|
+
displayOrder?: number;
|
|
44
|
+
}
|
|
45
|
+
export interface EventOption {
|
|
46
|
+
/**
|
|
47
|
+
* Time step value for date changes.
|
|
48
|
+
*/
|
|
49
|
+
timeStep?: number;
|
|
50
|
+
/**
|
|
51
|
+
* Invokes on bar select on unselect.
|
|
52
|
+
*/
|
|
53
|
+
onSelect?: (task: Task, isSelected: boolean) => void;
|
|
54
|
+
/**
|
|
55
|
+
* Invokes on bar double click.
|
|
56
|
+
*/
|
|
57
|
+
onDoubleClick?: (task: Task) => void;
|
|
58
|
+
/**
|
|
59
|
+
* Invokes on bar click.
|
|
60
|
+
*/
|
|
61
|
+
onClick?: (task: Task) => void;
|
|
62
|
+
/**
|
|
63
|
+
* Invokes on end and start time change. Chart undoes operation if method return false or error.
|
|
64
|
+
*/
|
|
65
|
+
onDateChange?: (task: Task, children: Task[]) => void | boolean | Promise<void> | Promise<boolean>;
|
|
66
|
+
/**
|
|
67
|
+
* Invokes on progress change. Chart undoes operation if method return false or error.
|
|
68
|
+
*/
|
|
69
|
+
onProgressChange?: (task: Task, children: Task[]) => void | boolean | Promise<void> | Promise<boolean>;
|
|
70
|
+
/**
|
|
71
|
+
* Invokes on delete selected task. Chart undoes operation if method return false or error.
|
|
72
|
+
*/
|
|
73
|
+
onDelete?: (task: Task) => void | boolean | Promise<void> | Promise<boolean>;
|
|
74
|
+
/**
|
|
75
|
+
* Invokes on expander on task list
|
|
76
|
+
*/
|
|
77
|
+
onExpanderClick?: (task: Task) => void;
|
|
78
|
+
}
|
|
79
|
+
export interface DisplayOption {
|
|
80
|
+
viewMode?: ViewMode;
|
|
81
|
+
viewDate?: Date;
|
|
82
|
+
preStepsCount?: number;
|
|
83
|
+
/**
|
|
84
|
+
* Specifies the month name language. Able formats: ISO 639-2, Java Locale
|
|
85
|
+
*/
|
|
86
|
+
locale?: string;
|
|
87
|
+
rtl?: boolean;
|
|
88
|
+
}
|
|
89
|
+
export interface StylingOption {
|
|
90
|
+
headerHeight?: number;
|
|
91
|
+
headerBordered?: boolean;
|
|
92
|
+
columnWidth?: number;
|
|
93
|
+
listCellWidth?: string;
|
|
94
|
+
rowHeight?: number;
|
|
95
|
+
ganttHeight?: number;
|
|
96
|
+
barCornerRadius?: number;
|
|
97
|
+
handleWidth?: number;
|
|
98
|
+
fontFamily?: string;
|
|
99
|
+
fontSize?: string;
|
|
100
|
+
/**
|
|
101
|
+
* How many of row width can be taken by task.
|
|
102
|
+
* From 0 to 100
|
|
103
|
+
*/
|
|
104
|
+
barFill?: number;
|
|
105
|
+
barProgressColor?: string;
|
|
106
|
+
barProgressSelectedColor?: string;
|
|
107
|
+
barBackgroundColor?: string;
|
|
108
|
+
barBackgroundSelectedColor?: string;
|
|
109
|
+
baselineBackgroundColor?: string;
|
|
110
|
+
projectProgressColor?: string;
|
|
111
|
+
projectProgressSelectedColor?: string;
|
|
112
|
+
projectBackgroundColor?: string;
|
|
113
|
+
projectBackgroundSelectedColor?: string;
|
|
114
|
+
milestoneBackgroundColor?: string;
|
|
115
|
+
milestoneBackgroundSelectedColor?: string;
|
|
116
|
+
arrowColor?: string;
|
|
117
|
+
arrowIndent?: number;
|
|
118
|
+
todayColor?: string;
|
|
119
|
+
TooltipContent?: React.FC<{
|
|
120
|
+
task: Task;
|
|
121
|
+
fontSize: string;
|
|
122
|
+
fontFamily: string;
|
|
123
|
+
}>;
|
|
124
|
+
TaskListHeader?: React.FC<{
|
|
125
|
+
headerHeight: number;
|
|
126
|
+
rowWidth: string;
|
|
127
|
+
fontFamily: string;
|
|
128
|
+
fontSize: string;
|
|
129
|
+
}>;
|
|
130
|
+
TaskListTable?: React.FC<{
|
|
131
|
+
rowHeight: number;
|
|
132
|
+
rowWidth: string;
|
|
133
|
+
fontFamily: string;
|
|
134
|
+
fontSize: string;
|
|
135
|
+
locale: string;
|
|
136
|
+
tasks: Task[];
|
|
137
|
+
selectedTaskId: string;
|
|
138
|
+
/**
|
|
139
|
+
* Sets selected task by id
|
|
140
|
+
*/
|
|
141
|
+
setSelectedTask: (taskId: string) => void;
|
|
142
|
+
onExpanderClick: (task: Task) => void;
|
|
143
|
+
}>;
|
|
144
|
+
}
|
|
145
|
+
export interface GanttProps extends EventOption, DisplayOption, StylingOption {
|
|
146
|
+
tasks: Task[];
|
|
147
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@ezraghzf/gantt-task-react",
|
|
3
|
+
"version": "0.4.0",
|
|
4
|
+
"description": "Interactive Gantt Chart for React with TypeScript.",
|
|
5
|
+
"author": "Ezra G <ezraghzf@gmail.com>",
|
|
6
|
+
"homepage": "https://github.com/ezraghzf/gantt-task-react",
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"contributors": [
|
|
9
|
+
{
|
|
10
|
+
"name": "MaTeMaTuK",
|
|
11
|
+
"url": "https://github.com/MaTeMaTuK"
|
|
12
|
+
}
|
|
13
|
+
],
|
|
14
|
+
"repository": "ezraghzf/gantt-task-react",
|
|
15
|
+
"main": "dist/index.js",
|
|
16
|
+
"module": "dist/index.modern.js",
|
|
17
|
+
"source": "src/index.tsx",
|
|
18
|
+
"engines": {
|
|
19
|
+
"node": ">=10"
|
|
20
|
+
},
|
|
21
|
+
"keywords": [
|
|
22
|
+
"react",
|
|
23
|
+
"gantt",
|
|
24
|
+
"typescript",
|
|
25
|
+
"chart",
|
|
26
|
+
"svg",
|
|
27
|
+
"gantt-chart",
|
|
28
|
+
"gantt chart",
|
|
29
|
+
"react-gantt",
|
|
30
|
+
"task"
|
|
31
|
+
],
|
|
32
|
+
"scripts": {
|
|
33
|
+
"build": "microbundle-crl --no-compress --format modern,cjs",
|
|
34
|
+
"start": "microbundle-crl watch --no-compress --format modern,cjs",
|
|
35
|
+
"prepare": "run-s build",
|
|
36
|
+
"test": "run-s test:unit test:lint test:build",
|
|
37
|
+
"test:build": "run-s build",
|
|
38
|
+
"test:lint": "eslint --ext .tsx src/**/*",
|
|
39
|
+
"test:unit": "cross-env CI=1 react-scripts test --env=jsdom",
|
|
40
|
+
"test:watch": "react-scripts test --env=jsdom",
|
|
41
|
+
"predeploy": "cd example && npm install && npm run build",
|
|
42
|
+
"deploy": "gh-pages -d example/build"
|
|
43
|
+
},
|
|
44
|
+
"peerDependencies": {
|
|
45
|
+
"react": "^18.0.0"
|
|
46
|
+
},
|
|
47
|
+
"devDependencies": {
|
|
48
|
+
"@testing-library/jest-dom": "^5.16.4",
|
|
49
|
+
"@testing-library/react": "^13.3.0",
|
|
50
|
+
"@testing-library/user-event": "^14.2.1",
|
|
51
|
+
"@types/jest": "^27.5.1",
|
|
52
|
+
"@types/node": "^15.0.1",
|
|
53
|
+
"@types/react": "^18.0.5",
|
|
54
|
+
"@types/react-dom": "^18.0.5",
|
|
55
|
+
"cross-env": "^7.0.3",
|
|
56
|
+
"gh-pages": "^3.1.0",
|
|
57
|
+
"microbundle-crl": "^0.13.11",
|
|
58
|
+
"mini-css-extract-plugin": "^2.5.1",
|
|
59
|
+
"npm-run-all": "^4.1.5",
|
|
60
|
+
"postcss-flexbugs-fixes": "^5.0.2",
|
|
61
|
+
"postcss-normalize": "^10.0.1",
|
|
62
|
+
"postcss-preset-env": "^7.6.0",
|
|
63
|
+
"prettier": "^2.7.1",
|
|
64
|
+
"react": "^18.2.0",
|
|
65
|
+
"react-dom": "^18.2.0",
|
|
66
|
+
"react-scripts": "^5.0.1",
|
|
67
|
+
"typescript": "^4.7.4"
|
|
68
|
+
},
|
|
69
|
+
"files": [
|
|
70
|
+
"dist"
|
|
71
|
+
]
|
|
72
|
+
}
|