@matsu1321/react-gantt-chart 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/dist/style.css ADDED
@@ -0,0 +1,235 @@
1
+ /* Main Gantt Canvas Container Styles */
2
+ .ganttOuterWrapper {
3
+ overflow: hidden;
4
+ position: relative;
5
+ border: 1px solid #ebebeb;
6
+ border-radius: 8px;
7
+ box-shadow: 0 4px 18px rgba(0, 0, 0, 0.04);
8
+ background-color: #ffffff;
9
+ }
10
+
11
+ .ganttWrapper {
12
+ display: flex;
13
+ position: relative;
14
+ width: 100%;
15
+ border-bottom: 1px solid #ebebeb;
16
+ }
17
+
18
+ .ganttResizer {
19
+ background-color: transparent;
20
+ }
21
+
22
+ .ganttResizer:hover {
23
+ background-color: #2563eb;
24
+ }
25
+
26
+ /* Scroll Sync Selectors */
27
+ .verticalScrollbar {
28
+ position: absolute;
29
+ width: 17px;
30
+ overflow-y: scroll;
31
+ z-index: 100;
32
+ border-left: 1px solid #ebebeb;
33
+ background-color: #fafafa;
34
+ }
35
+
36
+ .horizontalScrollbar {
37
+ overflow-x: scroll;
38
+ height: 17px;
39
+ width: auto;
40
+ border-top: 1px solid #ebebeb;
41
+ background-color: #fafafa;
42
+ }
43
+
44
+ /* 細いプレミアムスクロールバー */
45
+ .verticalScrollbar::-webkit-scrollbar,
46
+ .horizontalScrollbar::-webkit-scrollbar,
47
+ .ganttTimelineContainer::-webkit-scrollbar {
48
+ width: 8px;
49
+ height: 8px;
50
+ }
51
+
52
+ .verticalScrollbar::-webkit-scrollbar-track,
53
+ .horizontalScrollbar::-webkit-scrollbar-track,
54
+ .ganttTimelineContainer::-webkit-scrollbar-track {
55
+ background: #f7f7f7;
56
+ }
57
+
58
+ .verticalScrollbar::-webkit-scrollbar-thumb,
59
+ .horizontalScrollbar::-webkit-scrollbar-thumb,
60
+ .ganttTimelineContainer::-webkit-scrollbar-thumb {
61
+ background: #d4d4d8;
62
+ border-radius: 4px;
63
+ }
64
+
65
+ .verticalScrollbar::-webkit-scrollbar-thumb:hover,
66
+ .horizontalScrollbar::-webkit-scrollbar-thumb:hover,
67
+ .ganttTimelineContainer::-webkit-scrollbar-thumb:hover {
68
+ background: #a1a1aa;
69
+ }
70
+
71
+ /* Left panel: Task List Styles */
72
+ .taskListWrapper {
73
+ border-right: 1px solid #ebebeb;
74
+ background-color: #ffffff;
75
+ display: flex;
76
+ flex-direction: column;
77
+ }
78
+
79
+ .taskListHeader {
80
+ display: flex;
81
+ align-items: center;
82
+ border-bottom: 1px solid #e0e0e0;
83
+ background-color: #fafafa;
84
+ color: #3f3f46;
85
+ text-transform: uppercase;
86
+ font-size: 11px;
87
+ letter-spacing: 0.05em;
88
+ box-sizing: border-box;
89
+ }
90
+
91
+ .taskListHeaderCell {
92
+ padding: 0 12px;
93
+ display: flex;
94
+ align-items: center;
95
+ height: 100%;
96
+ }
97
+
98
+ .taskListContainer {
99
+ overflow-y: hidden;
100
+ }
101
+
102
+ .taskListTableRow {
103
+ transition:
104
+ background-color 0.15s ease,
105
+ border-left-color 0.15s ease;
106
+ border-left: 3px solid transparent;
107
+ }
108
+
109
+ .taskListTableRow:hover {
110
+ background-color: #f7fee7; /* Subtle light green-yellow hint on hover */
111
+ }
112
+
113
+ .taskListTableRowSelected {
114
+ background-color: #eff6ff !important; /* Premium light blue highlight */
115
+ border-left-color: #3b82f6 !important; /* Distinct blue marker */
116
+ }
117
+
118
+ .taskListExpander {
119
+ display: flex;
120
+ align-items: center;
121
+ justify-content: center;
122
+ transition: transform 0.15s ease;
123
+ }
124
+
125
+ .taskListExpander:hover {
126
+ transform: scale(1.15);
127
+ }
128
+
129
+ /* Right panel: Timeline Styles */
130
+ .ganttTimeline {
131
+ display: flex;
132
+ flex-direction: column;
133
+ }
134
+
135
+ .ganttTimelineContainer {
136
+ flex-grow: 1;
137
+ }
138
+
139
+ .calendarSvg {
140
+ display: block;
141
+ }
142
+
143
+ .ganttSvg {
144
+ display: block;
145
+ }
146
+
147
+ /* Background grid ticks & rows */
148
+ .gridRow {
149
+ transition: fill 0.1s ease;
150
+ }
151
+
152
+ .gridRow:hover {
153
+ fill: #fafafa;
154
+ }
155
+
156
+ .gridRowLine {
157
+ stroke: #ebebeb;
158
+ stroke-width: 1;
159
+ }
160
+
161
+ .gridTick {
162
+ stroke: #ebebeb;
163
+ stroke-width: 1;
164
+ }
165
+
166
+ .gridTodayHighlight {
167
+ opacity: 0.15;
168
+ pointer-events: none;
169
+ }
170
+
171
+ /* Calendar Timeline labels */
172
+ .calendarHeaderLine {
173
+ stroke: #e6e6e6;
174
+ stroke-width: 1;
175
+ }
176
+
177
+ .calendarHeaderText {
178
+ font-family: inherit;
179
+ font-size: 11px;
180
+ }
181
+
182
+ /* Arrows dependencies connecting lines */
183
+ .arrowPath,
184
+ .dependencyArrow .arrowPath {
185
+ transition:
186
+ stroke-width 0.15s ease,
187
+ stroke 0.15s ease;
188
+ }
189
+
190
+ .arrow:hover .arrowPath,
191
+ .dependencyArrow:hover .arrowPath {
192
+ stroke: #f59e0b !important;
193
+ stroke-width: 2.2 !important;
194
+ }
195
+
196
+ .arrow:hover .arrowHead,
197
+ .dependencyArrow:hover .arrowHead {
198
+ fill: #f59e0b !important;
199
+ }
200
+
201
+ /* Task bars, milestones and labels */
202
+ .barBackground,
203
+ .barProgress,
204
+ .projectBackground,
205
+ .projectProgress,
206
+ .milestoneBackground {
207
+ transition: filter 0.15s ease;
208
+ }
209
+
210
+ .taskItemWrapper:hover .barBackground,
211
+ .taskItemWrapper:hover .projectBackground,
212
+ .taskItemWrapper:hover .milestoneBackground {
213
+ filter: brightness(0.96);
214
+ }
215
+
216
+ .taskItemWrapper:hover .barProgress,
217
+ .taskItemWrapper:hover .projectProgress {
218
+ filter: brightness(0.92);
219
+ }
220
+
221
+ .barLabel,
222
+ .projectLabel,
223
+ .milestoneLabel {
224
+ font-family: inherit;
225
+ font-size: 12px;
226
+ user-select: none;
227
+ }
228
+
229
+ .barProgressHandle {
230
+ transition: fill 0.15s ease;
231
+ }
232
+
233
+ .barProgressHandle:hover {
234
+ fill: #000000 !important;
235
+ }
@@ -0,0 +1,7 @@
1
+ import { ViewMode } from './public-types';
2
+
3
+ /** カレンダー描画に必要なセットアップ情報 */
4
+ export interface CalendarSetup {
5
+ dates: Date[];
6
+ viewMode: ViewMode;
7
+ }
@@ -0,0 +1,12 @@
1
+ import { RenderedTask } from './rendered-task';
2
+
3
+ /** ドラッグ操作の種類 */
4
+ export type DragAction = "progress" | "end" | "start" | "move";
5
+ /** チャート内で発生するインタラクション全種 */
6
+ export type ChartInteraction = "mouseenter" | "mouseleave" | "delete" | "dblclick" | "click" | "select" | "" | DragAction;
7
+ /** 現在進行中のガントインタラクション状態 */
8
+ export interface GanttInteractionState {
9
+ changedTask?: RenderedTask;
10
+ originalSelectedTask?: RenderedTask;
11
+ action: ChartInteraction;
12
+ }
@@ -0,0 +1,144 @@
1
+ import { default as React } from 'react';
2
+
3
+ export declare enum ViewMode {
4
+ Hour = "Hour",
5
+ QuarterDay = "Quarter Day",
6
+ HalfDay = "Half Day",
7
+ Day = "Day",
8
+ /** ISO-8601 week */
9
+ Week = "Week",
10
+ Month = "Month",
11
+ Year = "Year"
12
+ }
13
+ export type TaskType = "task" | "milestone" | "project";
14
+ export interface Task {
15
+ id: string;
16
+ type: TaskType;
17
+ name: string;
18
+ start: Date;
19
+ end: Date;
20
+ /**
21
+ * From 0 to 100
22
+ */
23
+ progress: number;
24
+ styles?: {
25
+ backgroundColor?: string;
26
+ backgroundSelectedColor?: string;
27
+ progressColor?: string;
28
+ progressSelectedColor?: string;
29
+ };
30
+ isDisabled?: boolean;
31
+ project?: string;
32
+ dependencies?: string[];
33
+ hideChildren?: boolean;
34
+ displayOrder?: number;
35
+ }
36
+ export interface EventOption {
37
+ /**
38
+ * Time step value for date changes in milliseconds (default: 1 hour / day / etc).
39
+ */
40
+ timeStep?: number;
41
+ /**
42
+ * Invokes on bar select/unselect.
43
+ */
44
+ onSelect?: (task: Task, isSelected: boolean) => void;
45
+ /**
46
+ * Invokes on bar double click.
47
+ */
48
+ onDoubleClick?: (task: Task) => void;
49
+ /**
50
+ * Invokes on bar click.
51
+ */
52
+ onClick?: (task: Task) => void;
53
+ /**
54
+ * Invokes on end and start time change. Chart undoes operation if method returns false or throws error.
55
+ */
56
+ onDateChange?: (task: Task, children: Task[]) => void | boolean | Promise<void> | Promise<boolean>;
57
+ /**
58
+ * Invokes on progress change. Chart undoes operation if method returns false or throws error.
59
+ */
60
+ onProgressChange?: (task: Task, children: Task[]) => void | boolean | Promise<void> | Promise<boolean>;
61
+ /**
62
+ * Invokes on delete selected task. Chart undoes operation if method returns false or throws error.
63
+ */
64
+ onDelete?: (task: Task) => void | boolean | Promise<void> | Promise<boolean>;
65
+ /**
66
+ * Invokes on expander on task list
67
+ */
68
+ onExpanderClick?: (task: Task) => void;
69
+ }
70
+ export interface DisplayOption {
71
+ viewMode?: ViewMode;
72
+ viewDate?: Date;
73
+ preStepsCount?: number;
74
+ /**
75
+ * Specifies the month name language. Able formats: ISO 639-2, Java Locale
76
+ */
77
+ locale?: string;
78
+ rtl?: boolean;
79
+ /**
80
+ * Custom formatter for the top header of the calendar.
81
+ */
82
+ calendarTopHeaderFormat?: (date: Date, viewMode: ViewMode) => string;
83
+ /**
84
+ * Custom formatter for the bottom header of the calendar.
85
+ */
86
+ calendarBottomHeaderFormat?: (date: Date, viewMode: ViewMode) => string;
87
+ }
88
+ export interface StylingOption {
89
+ headerHeight?: number;
90
+ columnWidth?: number;
91
+ listCellWidth?: string;
92
+ rowHeight?: number;
93
+ ganttHeight?: number;
94
+ barCornerRadius?: number;
95
+ handleWidth?: number;
96
+ fontFamily?: string;
97
+ fontSize?: string;
98
+ /**
99
+ * How much of row height can be taken by task.
100
+ * From 0 to 100
101
+ */
102
+ barFill?: number;
103
+ barProgressColor?: string;
104
+ barProgressSelectedColor?: string;
105
+ barBackgroundColor?: string;
106
+ barBackgroundSelectedColor?: string;
107
+ projectProgressColor?: string;
108
+ projectProgressSelectedColor?: string;
109
+ projectBackgroundColor?: string;
110
+ projectBackgroundSelectedColor?: string;
111
+ milestoneBackgroundColor?: string;
112
+ milestoneBackgroundSelectedColor?: string;
113
+ arrowColor?: string;
114
+ arrowIndent?: number;
115
+ todayColor?: string;
116
+ TooltipContent?: React.FC<{
117
+ task: Task;
118
+ fontSize: string;
119
+ fontFamily: string;
120
+ }>;
121
+ TaskListHeader?: React.FC<{
122
+ headerHeight: number;
123
+ rowWidth: string;
124
+ fontFamily: string;
125
+ fontSize: string;
126
+ }>;
127
+ TaskListTable?: React.FC<{
128
+ rowHeight: number;
129
+ rowWidth: string;
130
+ fontFamily: string;
131
+ fontSize: string;
132
+ locale: string;
133
+ tasks: Task[];
134
+ selectedTaskId: string;
135
+ /**
136
+ * Sets selected task by id
137
+ */
138
+ setSelectedTask: (taskId: string) => void;
139
+ onExpanderClick: (task: Task) => void;
140
+ }>;
141
+ }
142
+ export interface GanttProps extends EventOption, DisplayOption, StylingOption {
143
+ tasks: Task[];
144
+ }
@@ -0,0 +1,25 @@
1
+ import { Task, TaskType } from './public-types';
2
+
3
+ export type TaskTypeInternal = TaskType | "smalltask";
4
+ /**
5
+ * レンダリング時のタスク情報(ピクセル座標・スタイルを含む拡張型)
6
+ */
7
+ export interface RenderedTask extends Task {
8
+ index: number;
9
+ typeInternal: TaskTypeInternal;
10
+ x1: number;
11
+ x2: number;
12
+ y: number;
13
+ height: number;
14
+ progressX: number;
15
+ progressWidth: number;
16
+ barCornerRadius: number;
17
+ handleWidth: number;
18
+ barChildren: RenderedTask[];
19
+ styles: {
20
+ backgroundColor: string;
21
+ backgroundSelectedColor: string;
22
+ progressColor: string;
23
+ progressSelectedColor: string;
24
+ };
25
+ }
package/package.json ADDED
@@ -0,0 +1,45 @@
1
+ {
2
+ "name": "@matsu1321/react-gantt-chart",
3
+ "version": "1.0.0",
4
+ "description": "Highly performant, interactive Gantt Chart component for React with virtual scrolling support.",
5
+ "main": "dist/index.js",
6
+ "module": "dist/index.modern.js",
7
+ "types": "dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "import": "./dist/index.modern.js",
11
+ "require": "./dist/index.js",
12
+ "types": "./dist/index.d.ts"
13
+ },
14
+ "./dist/style.css": "./dist/style.css"
15
+ },
16
+ "files": [
17
+ "dist"
18
+ ],
19
+ "scripts": {},
20
+ "peerDependencies": {
21
+ "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
22
+ "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0"
23
+ },
24
+
25
+ "keywords": [
26
+ "react",
27
+ "gantt",
28
+ "gantt-chart",
29
+ "react-gantt",
30
+ "timeline",
31
+ "virtual-scrolling",
32
+ "performance",
33
+ "typescript"
34
+ ],
35
+ "author": "Matsu132",
36
+ "license": "MIT",
37
+ "repository": {
38
+ "type": "git",
39
+ "url": "https://github.com/Matsu132/react-gantt-chart.git"
40
+ },
41
+ "bugs": {
42
+ "url": "https://github.com/Matsu132/react-gantt-chart/issues"
43
+ },
44
+ "homepage": "https://github.com/Matsu132/react-gantt-chart#readme"
45
+ }