@levelcaptech/gantt-task-react-custom 0.1.0 → 0.4.1
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/README.md +90 -77
- package/dist/components/gantt/task-gantt.d.ts +1 -0
- package/dist/components/other/horizontal-scroll.d.ts +7 -3
- package/dist/components/other/tooltip.d.ts +4 -1
- package/dist/components/task-list/overlay-editor.d.ts +19 -0
- package/dist/components/task-list/task-list-header.d.ts +5 -0
- package/dist/components/task-list/task-list-table.d.ts +11 -2
- package/dist/components/task-list/task-list.d.ts +40 -4
- package/dist/constants/taskOptions.d.ts +6 -0
- package/dist/helpers/task-helper.d.ts +11 -0
- package/dist/index.css +223 -12
- package/dist/index.d.ts +3 -1
- package/dist/index.js +2057 -862
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +2045 -865
- package/dist/index.modern.js.map +1 -1
- package/dist/test/overlay-editor.test.d.ts +1 -0
- package/dist/test/split-handle.test.d.ts +1 -0
- package/dist/test/task-helper.test.d.ts +1 -0
- package/dist/test/task-list-commit.test.d.ts +1 -0
- package/dist/test/task-list-editing.test.d.ts +1 -0
- package/dist/test/task-list-table-editing.test.d.ts +1 -0
- package/dist/test/task-model.test.d.ts +1 -0
- package/dist/types/public-types.d.ts +50 -1
- package/package.json +23 -6
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "@testing-library/jest-dom";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "@testing-library/jest-dom";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "@testing-library/jest-dom";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "@testing-library/jest-dom";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "@testing-library/jest-dom";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "@testing-library/jest-dom";
|
|
@@ -1,4 +1,24 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import { TaskProcessOption, TaskStatusOption } from "../constants/taskOptions";
|
|
3
|
+
export declare type TaskProcess = TaskProcessOption;
|
|
4
|
+
export declare type TaskStatus = TaskStatusOption;
|
|
5
|
+
export declare type EffortUnit = "MH" | "MD" | "MM";
|
|
6
|
+
export declare type VisibleField = "name" | "start" | "end" | "process" | "assignee" | "plannedStart" | "plannedEnd" | "plannedEffort" | "actualEffort" | "status";
|
|
7
|
+
export declare type CellCommitTrigger = "enter";
|
|
8
|
+
export declare type CellCommitPayload = {
|
|
9
|
+
rowId: string;
|
|
10
|
+
columnId: VisibleField;
|
|
11
|
+
value: string;
|
|
12
|
+
trigger: CellCommitTrigger;
|
|
13
|
+
};
|
|
14
|
+
export declare type ColumnState = {
|
|
15
|
+
id: VisibleField;
|
|
16
|
+
label: string;
|
|
17
|
+
width: number;
|
|
18
|
+
minWidth: number;
|
|
19
|
+
visible: boolean;
|
|
20
|
+
};
|
|
21
|
+
export declare type ColumnsState = ColumnState[];
|
|
2
22
|
export declare enum ViewMode {
|
|
3
23
|
Hour = "Hour",
|
|
4
24
|
QuarterDay = "Quarter Day",
|
|
@@ -32,6 +52,13 @@ export interface Task {
|
|
|
32
52
|
dependencies?: string[];
|
|
33
53
|
hideChildren?: boolean;
|
|
34
54
|
displayOrder?: number;
|
|
55
|
+
process?: TaskProcess;
|
|
56
|
+
assignee?: string;
|
|
57
|
+
plannedStart?: Date;
|
|
58
|
+
plannedEnd?: Date;
|
|
59
|
+
plannedEffort?: number;
|
|
60
|
+
actualEffort?: number;
|
|
61
|
+
status?: TaskStatus;
|
|
35
62
|
}
|
|
36
63
|
export interface EventOption {
|
|
37
64
|
/**
|
|
@@ -66,6 +93,16 @@ export interface EventOption {
|
|
|
66
93
|
* Invokes on expander on task list
|
|
67
94
|
*/
|
|
68
95
|
onExpanderClick?: (task: Task) => void;
|
|
96
|
+
/**
|
|
97
|
+
* Invokes when task list fields are updated (process, status, planned dates, assignee, effort).
|
|
98
|
+
*/
|
|
99
|
+
onTaskUpdate?: (taskId: string, updatedFields: Partial<Task>) => void;
|
|
100
|
+
/**
|
|
101
|
+
* Invokes when a task list cell edit is committed.
|
|
102
|
+
* Notification only; the library does not update tasks or UI.
|
|
103
|
+
* Host must validate/persist, update tasks, and pass new props for rerender.
|
|
104
|
+
*/
|
|
105
|
+
onCellCommit?: (payload: CellCommitPayload) => Promise<void>;
|
|
69
106
|
}
|
|
70
107
|
export interface DisplayOption {
|
|
71
108
|
viewMode?: ViewMode;
|
|
@@ -105,23 +142,31 @@ export interface StylingOption {
|
|
|
105
142
|
arrowColor?: string;
|
|
106
143
|
arrowIndent?: number;
|
|
107
144
|
todayColor?: string;
|
|
145
|
+
visibleFields?: VisibleField[];
|
|
146
|
+
effortDisplayUnit?: EffortUnit;
|
|
147
|
+
enableColumnDrag?: boolean;
|
|
108
148
|
TooltipContent?: React.FC<{
|
|
109
149
|
task: Task;
|
|
110
150
|
fontSize: string;
|
|
111
151
|
fontFamily: string;
|
|
152
|
+
effortDisplayUnit?: EffortUnit;
|
|
112
153
|
}>;
|
|
113
154
|
TaskListHeader?: React.FC<{
|
|
114
155
|
headerHeight: number;
|
|
115
156
|
rowWidth: string;
|
|
116
157
|
fontFamily: string;
|
|
117
158
|
fontSize: string;
|
|
159
|
+
visibleFields: VisibleField[];
|
|
160
|
+
columnsState?: ColumnsState;
|
|
161
|
+
setColumnsState?: React.Dispatch<React.SetStateAction<ColumnsState>>;
|
|
162
|
+
enableColumnDrag?: boolean;
|
|
118
163
|
}>;
|
|
119
164
|
TaskListTable?: React.FC<{
|
|
120
165
|
rowHeight: number;
|
|
121
166
|
rowWidth: string;
|
|
122
167
|
fontFamily: string;
|
|
123
168
|
fontSize: string;
|
|
124
|
-
locale
|
|
169
|
+
locale?: string;
|
|
125
170
|
tasks: Task[];
|
|
126
171
|
selectedTaskId: string;
|
|
127
172
|
/**
|
|
@@ -129,6 +174,10 @@ export interface StylingOption {
|
|
|
129
174
|
*/
|
|
130
175
|
setSelectedTask: (taskId: string) => void;
|
|
131
176
|
onExpanderClick: (task: Task) => void;
|
|
177
|
+
visibleFields: VisibleField[];
|
|
178
|
+
onUpdateTask?: (taskId: string, updatedFields: Partial<Task>) => void;
|
|
179
|
+
effortDisplayUnit: EffortUnit;
|
|
180
|
+
columnsState?: ColumnsState;
|
|
132
181
|
}>;
|
|
133
182
|
}
|
|
134
183
|
export interface GanttProps extends EventOption, DisplayOption, StylingOption {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@levelcaptech/gantt-task-react-custom",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"description": "Interactive Gantt Chart for React with TypeScript.",
|
|
5
5
|
"author": "LevelCapTech <levelcaptech@gmail.com>",
|
|
6
6
|
"homepage": "https://github.com/LevelCapTech/gantt-task-react-custom",
|
|
@@ -27,9 +27,19 @@
|
|
|
27
27
|
"react-gantt",
|
|
28
28
|
"task"
|
|
29
29
|
],
|
|
30
|
+
"microbundle": {
|
|
31
|
+
"external": [
|
|
32
|
+
"react",
|
|
33
|
+
"react-dom",
|
|
34
|
+
"react/jsx-runtime",
|
|
35
|
+
"react/jsx-dev-runtime",
|
|
36
|
+
"@dnd-kit/core",
|
|
37
|
+
"@dnd-kit/utilities"
|
|
38
|
+
]
|
|
39
|
+
},
|
|
30
40
|
"scripts": {
|
|
31
|
-
"build": "microbundle-crl --no-compress --format modern,cjs",
|
|
32
|
-
"start": "microbundle-crl watch --no-compress --format modern,cjs",
|
|
41
|
+
"build": "microbundle-crl --no-compress --format modern,cjs --tsconfig tsconfig.build.json",
|
|
42
|
+
"start": "microbundle-crl watch --no-compress --format modern,cjs --tsconfig tsconfig.build.json",
|
|
33
43
|
"prepare": "run-s build",
|
|
34
44
|
"test": "run-s test:unit test:lint test:build",
|
|
35
45
|
"test:build": "run-s build",
|
|
@@ -40,12 +50,21 @@
|
|
|
40
50
|
"deploy": "gh-pages -d example/build"
|
|
41
51
|
},
|
|
42
52
|
"peerDependencies": {
|
|
43
|
-
"
|
|
53
|
+
"@dnd-kit/core": "^6.3.1",
|
|
54
|
+
"@dnd-kit/sortable": "^7.0.0",
|
|
55
|
+
"@dnd-kit/utilities": "^3.2.2",
|
|
56
|
+
"react": "^18.0.0",
|
|
57
|
+
"react-dom": "^18.0.0"
|
|
44
58
|
},
|
|
45
59
|
"devDependencies": {
|
|
60
|
+
"@babel/plugin-proposal-unicode-property-regex": "^7.18.6",
|
|
61
|
+
"@dnd-kit/core": "^6.3.1",
|
|
62
|
+
"@dnd-kit/sortable": "^7.0.0",
|
|
63
|
+
"@dnd-kit/utilities": "^3.2.2",
|
|
46
64
|
"@testing-library/jest-dom": "^5.16.4",
|
|
47
65
|
"@testing-library/react": "^13.3.0",
|
|
48
66
|
"@testing-library/user-event": "^14.2.1",
|
|
67
|
+
"@types/classnames": "^2.3.0",
|
|
49
68
|
"@types/jest": "^27.5.1",
|
|
50
69
|
"@types/node": "^15.0.1",
|
|
51
70
|
"@types/react": "^18.0.5",
|
|
@@ -59,8 +78,6 @@
|
|
|
59
78
|
"postcss-normalize": "^10.0.1",
|
|
60
79
|
"postcss-preset-env": "^7.6.0",
|
|
61
80
|
"prettier": "^2.7.1",
|
|
62
|
-
"react": "^18.2.0",
|
|
63
|
-
"react-dom": "^18.2.0",
|
|
64
81
|
"react-scripts": "^5.0.1",
|
|
65
82
|
"typescript": "^4.7.4"
|
|
66
83
|
},
|