iris-gantt 1.5.8 → 1.6.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/CUSTOMIZATION_GUIDE.md +392 -0
- package/DATE_FORMATTING_GUIDE.md +121 -0
- package/PACKAGE_SETUP.md +4 -1
- package/PROPS_REFERENCE.md +586 -0
- package/QUICK_START.md +29 -0
- package/README.md +28 -3
- package/RESPONSIVE_STYLING.md +261 -0
- package/USAGE.md +19 -0
- package/dist/Gantt/DragDrop.d.ts.map +1 -1
- package/dist/Gantt/Gantt.d.ts.map +1 -1
- package/dist/Gantt/TaskBar.d.ts.map +1 -1
- package/dist/Gantt/Timeline.d.ts.map +1 -1
- package/dist/gantt.css +1 -1
- package/dist/iris-gantt.js +820 -817
- package/dist/iris-gantt.umd.cjs +9 -9
- package/package.json +6 -2
|
@@ -0,0 +1,586 @@
|
|
|
1
|
+
# Iris Gantt Props and Types Reference
|
|
2
|
+
|
|
3
|
+
Version: `1.5.9`
|
|
4
|
+
Scope: Public props/types exported from:
|
|
5
|
+
- `src/components/Gantt/Gantt.tsx`
|
|
6
|
+
- `src/components/Gantt/types.ts`
|
|
7
|
+
- `src/components/Gantt/features/filterUtils.ts`
|
|
8
|
+
|
|
9
|
+
## Quick Index
|
|
10
|
+
|
|
11
|
+
- `GanttProps`
|
|
12
|
+
- `DateInput`
|
|
13
|
+
- `OnHoldPeriod`, `OnHoldPeriodInput`
|
|
14
|
+
- `Task`, `TaskInput`
|
|
15
|
+
- `TaskSegment`, `TaskSegmentInput`
|
|
16
|
+
- `Link`
|
|
17
|
+
- `TaskTooltipConfig`
|
|
18
|
+
- `Scale`, `TimelineView`, `Column`
|
|
19
|
+
- `GanttConfig`
|
|
20
|
+
- `GanttIconConfig`
|
|
21
|
+
- `GanttStyleConfig`
|
|
22
|
+
- `Marker`, `Baseline`
|
|
23
|
+
- `TaskReorderMeta`, `TaskDragUpdateMeta`, `TaskDragUpdatePayload`
|
|
24
|
+
- `ZoomLevel`
|
|
25
|
+
- `DropIndicator`
|
|
26
|
+
- `GanttUIConfig`
|
|
27
|
+
- `FilterOptions`
|
|
28
|
+
|
|
29
|
+
## `GanttProps`
|
|
30
|
+
|
|
31
|
+
```ts
|
|
32
|
+
export interface GanttProps {
|
|
33
|
+
tasks: TaskInput[];
|
|
34
|
+
links?: Link[];
|
|
35
|
+
config?: Partial<GanttConfig>;
|
|
36
|
+
uiConfig?: Partial<GanttUIConfig>;
|
|
37
|
+
styleConfig?: Partial<GanttStyleConfig>;
|
|
38
|
+
iconConfig?: Partial<GanttIconConfig>;
|
|
39
|
+
taskTooltipConfig?: Partial<TaskTooltipConfig>;
|
|
40
|
+
onHoldPeriods?: OnHoldPeriodInput[];
|
|
41
|
+
on_hold_periods?: OnHoldPeriodInput[];
|
|
42
|
+
onHold?: OnHoldPeriodInput[] | OnHoldPeriodInput;
|
|
43
|
+
on_hold?: OnHoldPeriodInput[] | OnHoldPeriodInput;
|
|
44
|
+
onhold?: OnHoldPeriodInput[] | OnHoldPeriodInput;
|
|
45
|
+
onTaskUpdate?: (task: Task, reorderMeta?: TaskReorderMeta) => void;
|
|
46
|
+
onTaskDragUpdate?: (payload: TaskDragUpdatePayload) => void | Promise<void>;
|
|
47
|
+
onTaskCreate?: (task: Task) => void;
|
|
48
|
+
onTaskDelete?: (taskId: string) => void;
|
|
49
|
+
onLinkCreate?: (link: Link) => void;
|
|
50
|
+
onLinkDelete?: (linkId: string) => void;
|
|
51
|
+
onTimelineViewChange?: (view: TimelineView) => void;
|
|
52
|
+
showMonthHeading?: boolean;
|
|
53
|
+
showRangeHeading?: boolean;
|
|
54
|
+
relativeDayNumbering?: boolean;
|
|
55
|
+
|
|
56
|
+
// Storybook helper props (ignored by component but required for build)
|
|
57
|
+
cellWidth?: number;
|
|
58
|
+
cellHeight?: number;
|
|
59
|
+
scaleHeight?: number;
|
|
60
|
+
primaryUnit?: string;
|
|
61
|
+
primaryStep?: number;
|
|
62
|
+
primaryFormat?: string;
|
|
63
|
+
secondaryUnit?: string;
|
|
64
|
+
secondaryStep?: number;
|
|
65
|
+
secondaryFormat?: string;
|
|
66
|
+
showVerticalBorders?: boolean;
|
|
67
|
+
showHorizontalBorders?: boolean;
|
|
68
|
+
borderStyle?: string;
|
|
69
|
+
borderColor?: string;
|
|
70
|
+
showStartDate?: boolean;
|
|
71
|
+
showEndDate?: boolean;
|
|
72
|
+
startDateWidth?: number;
|
|
73
|
+
endDateWidth?: number;
|
|
74
|
+
startDateFormat?: string;
|
|
75
|
+
endDateFormat?: string;
|
|
76
|
+
baselines?: Map<string, Baseline>;
|
|
77
|
+
}
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## Data Types
|
|
81
|
+
|
|
82
|
+
```ts
|
|
83
|
+
export type DateInput = Date | string | number;
|
|
84
|
+
|
|
85
|
+
export interface OnHoldPeriod {
|
|
86
|
+
start: Date;
|
|
87
|
+
end: Date;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export interface OnHoldPeriodInput {
|
|
91
|
+
start: DateInput;
|
|
92
|
+
end: DateInput;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export interface Task {
|
|
96
|
+
id: string;
|
|
97
|
+
rawId?: string | number;
|
|
98
|
+
text: string;
|
|
99
|
+
start: Date;
|
|
100
|
+
end: Date;
|
|
101
|
+
ShowHandle?: boolean;
|
|
102
|
+
plannedStart?: Date;
|
|
103
|
+
plannedEnd?: Date;
|
|
104
|
+
actualStart?: Date;
|
|
105
|
+
actualEnd?: Date;
|
|
106
|
+
duration: number;
|
|
107
|
+
progress: number;
|
|
108
|
+
type?: 'task' | 'milestone' | 'project';
|
|
109
|
+
parent?: string;
|
|
110
|
+
open?: boolean;
|
|
111
|
+
color?: string;
|
|
112
|
+
details?: string;
|
|
113
|
+
owner?: string;
|
|
114
|
+
priority?: 'low' | 'medium' | 'high';
|
|
115
|
+
status?: string;
|
|
116
|
+
onHoldPeriods?: OnHoldPeriod[];
|
|
117
|
+
dependencies?: string[];
|
|
118
|
+
dependencyRule?: string[];
|
|
119
|
+
segments?: TaskSegment[];
|
|
120
|
+
sequence_id?: number;
|
|
121
|
+
stage_id?: string | null;
|
|
122
|
+
tooltipConfig?: Partial<TaskTooltipConfig>;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
export interface TaskSegment {
|
|
126
|
+
start: Date;
|
|
127
|
+
end: Date;
|
|
128
|
+
duration: number;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export interface TaskSegmentInput {
|
|
132
|
+
start: DateInput;
|
|
133
|
+
end: DateInput;
|
|
134
|
+
duration?: number | string;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
export interface TaskInput extends Omit<
|
|
138
|
+
Task,
|
|
139
|
+
'id' | 'text' | 'start' | 'end' | 'plannedStart' | 'plannedEnd' |
|
|
140
|
+
'actualStart' | 'actualEnd' | 'duration' | 'progress' | 'parent' |
|
|
141
|
+
'onHoldPeriods' | 'dependencies' | 'dependencyRule' | 'segments'
|
|
142
|
+
> {
|
|
143
|
+
id: string | number;
|
|
144
|
+
text?: string;
|
|
145
|
+
name?: string;
|
|
146
|
+
title?: string;
|
|
147
|
+
taskName?: string;
|
|
148
|
+
task_name?: string;
|
|
149
|
+
workGroupName?: string;
|
|
150
|
+
ShowHandle?: boolean;
|
|
151
|
+
showHandle?: boolean;
|
|
152
|
+
|
|
153
|
+
start?: DateInput;
|
|
154
|
+
end?: DateInput;
|
|
155
|
+
startDate?: DateInput;
|
|
156
|
+
start_date?: DateInput;
|
|
157
|
+
endDate?: DateInput;
|
|
158
|
+
end_date?: DateInput;
|
|
159
|
+
plannedStartDate?: DateInput;
|
|
160
|
+
plannedEndDate?: DateInput;
|
|
161
|
+
|
|
162
|
+
plannedStart?: DateInput;
|
|
163
|
+
plannedEnd?: DateInput;
|
|
164
|
+
planned_start?: DateInput;
|
|
165
|
+
planned_end?: DateInput;
|
|
166
|
+
planned_start_date?: DateInput;
|
|
167
|
+
planned_end_date?: DateInput;
|
|
168
|
+
|
|
169
|
+
actualStart?: DateInput;
|
|
170
|
+
actualEnd?: DateInput;
|
|
171
|
+
actual_start?: DateInput;
|
|
172
|
+
actual_end?: DateInput;
|
|
173
|
+
actual_start_date?: DateInput;
|
|
174
|
+
actual_end_date?: DateInput;
|
|
175
|
+
|
|
176
|
+
duration?: number | string;
|
|
177
|
+
progress?: number | string;
|
|
178
|
+
progressPercentage?: number | string;
|
|
179
|
+
progress_percentage?: number | string;
|
|
180
|
+
|
|
181
|
+
parent?: string | number | null;
|
|
182
|
+
ownerName?: string;
|
|
183
|
+
owner_name?: string;
|
|
184
|
+
status?: Task['status'];
|
|
185
|
+
currentStatus?: Task['status'];
|
|
186
|
+
current_status?: Task['status'];
|
|
187
|
+
|
|
188
|
+
onHoldPeriods?: OnHoldPeriodInput[];
|
|
189
|
+
on_hold_periods?: OnHoldPeriodInput[];
|
|
190
|
+
onHold?: OnHoldPeriodInput[] | OnHoldPeriodInput;
|
|
191
|
+
on_hold?: OnHoldPeriodInput[] | OnHoldPeriodInput;
|
|
192
|
+
onhold?: OnHoldPeriodInput[] | OnHoldPeriodInput;
|
|
193
|
+
|
|
194
|
+
dependencies?: Array<string | number> | string;
|
|
195
|
+
dependsOn?: Array<string | number> | string;
|
|
196
|
+
depends_on?: Array<string | number> | string;
|
|
197
|
+
|
|
198
|
+
dependencyRule?: string[] | string;
|
|
199
|
+
dependency_rule?: string[] | string;
|
|
200
|
+
dependencyRuleDescription?: string[] | string;
|
|
201
|
+
dependency_rule_description?: string[] | string;
|
|
202
|
+
|
|
203
|
+
segments?: TaskSegmentInput[];
|
|
204
|
+
tooltipConfig?: Partial<TaskTooltipConfig>;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
export interface Link {
|
|
208
|
+
id: string;
|
|
209
|
+
source: string;
|
|
210
|
+
target: string;
|
|
211
|
+
type: 'e2s' | 's2s' | 'e2e' | 's2e';
|
|
212
|
+
lag?: number;
|
|
213
|
+
lagUnit?: 'day' | 'hour' | 'week' | 'month';
|
|
214
|
+
}
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
## Tooltip Types
|
|
218
|
+
|
|
219
|
+
```ts
|
|
220
|
+
export interface TaskTooltipConfig {
|
|
221
|
+
showTaskName?: boolean;
|
|
222
|
+
showPlannedDates?: boolean;
|
|
223
|
+
showActualDates?: boolean;
|
|
224
|
+
showStatus?: boolean;
|
|
225
|
+
showDependencyRule?: boolean;
|
|
226
|
+
showProgress?: boolean;
|
|
227
|
+
showOwner?: boolean;
|
|
228
|
+
plannedLabel?: string;
|
|
229
|
+
actualLabel?: string;
|
|
230
|
+
statusLabel?: string;
|
|
231
|
+
dependencyRuleLabel?: string;
|
|
232
|
+
progressLabel?: string;
|
|
233
|
+
ownerLabel?: string;
|
|
234
|
+
dateFormat?: string;
|
|
235
|
+
dependencySeparator?: string;
|
|
236
|
+
emptyStatusText?: string;
|
|
237
|
+
emptyOwnerText?: string;
|
|
238
|
+
emptyDependencyRuleText?: string;
|
|
239
|
+
taskNameAccessor?: (task: Task) => string | undefined;
|
|
240
|
+
plannedStartAccessor?: (task: Task) => DateInput | undefined;
|
|
241
|
+
plannedEndAccessor?: (task: Task) => DateInput | undefined;
|
|
242
|
+
actualStartAccessor?: (task: Task) => DateInput | undefined;
|
|
243
|
+
actualEndAccessor?: (task: Task) => DateInput | undefined;
|
|
244
|
+
statusAccessor?: (task: Task) => string | undefined;
|
|
245
|
+
ownerAccessor?: (task: Task) => string | undefined;
|
|
246
|
+
dependencyRuleAccessor?: (task: Task, generatedRules: string[]) => string | string[] | undefined;
|
|
247
|
+
progressAccessor?: (task: Task) => number | string | undefined;
|
|
248
|
+
taskNameFormatter?: (taskName: string, task: Task) => string;
|
|
249
|
+
plannedDatesFormatter?: (plannedStart: Date, plannedEnd: Date, task: Task) => string;
|
|
250
|
+
actualDatesFormatter?: (actualStart: Date, actualEnd: Date, task: Task) => string;
|
|
251
|
+
ownerFormatter?: (owner: string, task: Task) => string;
|
|
252
|
+
statusFormatter?: (status?: string, task?: Task) => string;
|
|
253
|
+
progressFormatter?: (progress: number, task: Task) => string;
|
|
254
|
+
dependencyRuleFormatter?: (rule: string, task: Task) => string;
|
|
255
|
+
}
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
## Timeline and Grid Types
|
|
259
|
+
|
|
260
|
+
```ts
|
|
261
|
+
export interface Scale {
|
|
262
|
+
unit: 'hour' | 'day' | 'week' | 'month' | 'quarter' | 'year';
|
|
263
|
+
step: number;
|
|
264
|
+
format?: string;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
export type TimelineView = 'day' | 'week' | 'month';
|
|
268
|
+
|
|
269
|
+
export interface Column {
|
|
270
|
+
name: string;
|
|
271
|
+
label: string;
|
|
272
|
+
width?: number;
|
|
273
|
+
align?: 'left' | 'center' | 'right';
|
|
274
|
+
resize?: boolean;
|
|
275
|
+
sort?: boolean;
|
|
276
|
+
template?: (task: Task) => React.ReactNode;
|
|
277
|
+
}
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
## Config Types
|
|
281
|
+
|
|
282
|
+
```ts
|
|
283
|
+
export interface GanttConfig {
|
|
284
|
+
columns?: Column[];
|
|
285
|
+
scales?: Scale[];
|
|
286
|
+
timelineView?: TimelineView;
|
|
287
|
+
timelineViews?: TimelineView[];
|
|
288
|
+
timelineViewScales?: Partial<Record<TimelineView, Scale[]>>;
|
|
289
|
+
readonly?: boolean;
|
|
290
|
+
editable?: boolean;
|
|
291
|
+
taskHeight?: number;
|
|
292
|
+
rowHeight?: number;
|
|
293
|
+
scaleHeight?: number;
|
|
294
|
+
columnWidth?: number;
|
|
295
|
+
minColumnWidth?: number;
|
|
296
|
+
autoSchedule?: boolean;
|
|
297
|
+
criticalPath?: boolean;
|
|
298
|
+
baselines?: boolean;
|
|
299
|
+
markers?: Marker[];
|
|
300
|
+
weekends?: boolean;
|
|
301
|
+
holidays?: Date[];
|
|
302
|
+
theme?: 'light' | 'dark';
|
|
303
|
+
locale?: string;
|
|
304
|
+
containerHeight?: string;
|
|
305
|
+
containerMinHeight?: string;
|
|
306
|
+
gridWidth?: string;
|
|
307
|
+
showTimelineHeader?: boolean;
|
|
308
|
+
showMonthHeading?: boolean;
|
|
309
|
+
showRangeHeading?: boolean;
|
|
310
|
+
relativeDayNumbering?: boolean;
|
|
311
|
+
showTodayLine?: boolean;
|
|
312
|
+
todayLineColor?: string;
|
|
313
|
+
todayLineLabel?: string;
|
|
314
|
+
todayLineWidth?: number;
|
|
315
|
+
todayLineStyle?: 'solid' | 'dashed' | 'dotted';
|
|
316
|
+
todayLineOpacity?: number;
|
|
317
|
+
showProjectStartLine?: boolean;
|
|
318
|
+
projectStartDate?: Date;
|
|
319
|
+
projectStartLineColor?: string;
|
|
320
|
+
projectStartLineLabel?: string;
|
|
321
|
+
projectStartLineWidth?: number;
|
|
322
|
+
projectStartLineStyle?: 'solid' | 'dashed' | 'dotted';
|
|
323
|
+
projectStartLineOpacity?: number;
|
|
324
|
+
todayLineLabelStyle?: React.CSSProperties;
|
|
325
|
+
projectStartLineLabelStyle?: React.CSSProperties;
|
|
326
|
+
showTodayLineMarker?: boolean;
|
|
327
|
+
todayLineMarkerSize?: number;
|
|
328
|
+
todayLineMarkerStyle?: 'triangle' | 'arrow' | 'dot';
|
|
329
|
+
showProjectStartLineMarker?: boolean;
|
|
330
|
+
projectStartLineMarkerSize?: number;
|
|
331
|
+
projectStartLineMarkerStyle?: 'triangle' | 'arrow' | 'dot';
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
export interface GanttIconConfig {
|
|
335
|
+
addTask?: React.ReactNode | string;
|
|
336
|
+
zoomIn?: React.ReactNode | string;
|
|
337
|
+
zoomOut?: React.ReactNode | string;
|
|
338
|
+
resetZoom?: React.ReactNode | string;
|
|
339
|
+
exportCSV?: React.ReactNode | string;
|
|
340
|
+
exportExcel?: React.ReactNode | string;
|
|
341
|
+
exportJSON?: React.ReactNode | string;
|
|
342
|
+
exportPDF?: React.ReactNode | string;
|
|
343
|
+
gripVertical?: React.ReactNode | string;
|
|
344
|
+
chevronRight?: React.ReactNode | string;
|
|
345
|
+
chevronDown?: React.ReactNode | string;
|
|
346
|
+
plus?: React.ReactNode | string;
|
|
347
|
+
edit?: React.ReactNode | string;
|
|
348
|
+
delete?: React.ReactNode | string;
|
|
349
|
+
copy?: React.ReactNode | string;
|
|
350
|
+
link?: React.ReactNode | string;
|
|
351
|
+
flag?: React.ReactNode | string;
|
|
352
|
+
folder?: React.ReactNode | string;
|
|
353
|
+
tasks?: React.ReactNode | string;
|
|
354
|
+
rotateLeft?: React.ReactNode | string;
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
export interface GanttStyleConfig {
|
|
358
|
+
primary?: string;
|
|
359
|
+
primarySelected?: string;
|
|
360
|
+
success?: string;
|
|
361
|
+
warning?: string;
|
|
362
|
+
danger?: string;
|
|
363
|
+
background?: string;
|
|
364
|
+
backgroundAlt?: string;
|
|
365
|
+
backgroundHover?: string;
|
|
366
|
+
selectColor?: string;
|
|
367
|
+
taskColor?: string;
|
|
368
|
+
taskFillColor?: string;
|
|
369
|
+
projectColor?: string;
|
|
370
|
+
milestoneColor?: string;
|
|
371
|
+
fontColor?: string;
|
|
372
|
+
fontColorAlt?: string;
|
|
373
|
+
iconColor?: string;
|
|
374
|
+
borderColor?: string;
|
|
375
|
+
fontFamily?: string;
|
|
376
|
+
fontMono?: string;
|
|
377
|
+
fontSize?: string;
|
|
378
|
+
fontWeight?: string | number;
|
|
379
|
+
lineHeight?: string | number;
|
|
380
|
+
spacingXS?: string;
|
|
381
|
+
spacingSM?: string;
|
|
382
|
+
spacingMD?: string;
|
|
383
|
+
spacingLG?: string;
|
|
384
|
+
popoverBackground?: string;
|
|
385
|
+
popoverBorderColor?: string;
|
|
386
|
+
popoverBorderRadius?: string;
|
|
387
|
+
popoverShadow?: string;
|
|
388
|
+
popoverPadding?: string;
|
|
389
|
+
popoverMaxWidth?: string;
|
|
390
|
+
popoverFontFamily?: string;
|
|
391
|
+
popoverFontSize?: string;
|
|
392
|
+
modalBackground?: string;
|
|
393
|
+
modalBorderColor?: string;
|
|
394
|
+
modalBorderRadius?: string;
|
|
395
|
+
modalShadow?: string;
|
|
396
|
+
modalOverlayBackground?: string;
|
|
397
|
+
buttonPrimaryBackground?: string;
|
|
398
|
+
buttonPrimaryColor?: string;
|
|
399
|
+
buttonPrimaryHoverBackground?: string;
|
|
400
|
+
buttonPrimaryBorderRadius?: string;
|
|
401
|
+
buttonPrimaryFontWeight?: string | number;
|
|
402
|
+
buttonPrimaryFontFamily?: string;
|
|
403
|
+
buttonDangerBackground?: string;
|
|
404
|
+
buttonDangerColor?: string;
|
|
405
|
+
buttonDangerHoverBackground?: string;
|
|
406
|
+
buttonSecondaryBackground?: string;
|
|
407
|
+
buttonSecondaryColor?: string;
|
|
408
|
+
buttonSecondaryBorderColor?: string;
|
|
409
|
+
inputBackground?: string;
|
|
410
|
+
inputBorderColor?: string;
|
|
411
|
+
inputBorderRadius?: string;
|
|
412
|
+
inputFocusBorderColor?: string;
|
|
413
|
+
inputFontFamily?: string;
|
|
414
|
+
inputFontSize?: string;
|
|
415
|
+
inputPadding?: string;
|
|
416
|
+
listItemHoverBackground?: string;
|
|
417
|
+
listItemSelectedBackground?: string;
|
|
418
|
+
listItemBorderColor?: string;
|
|
419
|
+
menuBackground?: string;
|
|
420
|
+
menuBorderColor?: string;
|
|
421
|
+
menuItemHoverBackground?: string;
|
|
422
|
+
badgeBackground?: string;
|
|
423
|
+
badgeBorderColor?: string;
|
|
424
|
+
badgeColor?: string;
|
|
425
|
+
badgeFontSize?: string;
|
|
426
|
+
badgePadding?: string;
|
|
427
|
+
badgeBorderRadius?: string;
|
|
428
|
+
linkColor?: string;
|
|
429
|
+
linkHoverColor?: string;
|
|
430
|
+
linkFontWeight?: string | number;
|
|
431
|
+
customCSSVariables?: Record<string, string>;
|
|
432
|
+
}
|
|
433
|
+
```
|
|
434
|
+
|
|
435
|
+
For supported date tokens and `timelineViewScales` examples, see [DATE_FORMATTING_GUIDE.md](./DATE_FORMATTING_GUIDE.md).
|
|
436
|
+
|
|
437
|
+
## Interaction and Payload Types
|
|
438
|
+
|
|
439
|
+
```ts
|
|
440
|
+
export interface Marker {
|
|
441
|
+
id: string;
|
|
442
|
+
date: Date;
|
|
443
|
+
text: string;
|
|
444
|
+
css?: string;
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
export interface Baseline {
|
|
448
|
+
taskId: string;
|
|
449
|
+
start: Date;
|
|
450
|
+
end: Date;
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
export interface TaskReorderMeta {
|
|
454
|
+
currentSequenceId: number;
|
|
455
|
+
targetSequenceId: number;
|
|
456
|
+
targetStageId: string | null;
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
export interface TaskDragUpdateMeta {
|
|
460
|
+
dragType: 'move' | 'resize-left' | 'resize-right';
|
|
461
|
+
previousStart: Date;
|
|
462
|
+
previousEnd: Date;
|
|
463
|
+
previousDuration: number;
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
export interface TaskDragUpdatePayload {
|
|
467
|
+
task: Task;
|
|
468
|
+
previousTask: Task;
|
|
469
|
+
dragType: TaskDragUpdateMeta['dragType'] | 'reorder';
|
|
470
|
+
reorderMeta?: TaskReorderMeta;
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
export type ZoomLevel = number;
|
|
474
|
+
|
|
475
|
+
export interface DropIndicator {
|
|
476
|
+
taskId: string;
|
|
477
|
+
position: 'above' | 'below' | 'inside';
|
|
478
|
+
}
|
|
479
|
+
```
|
|
480
|
+
|
|
481
|
+
## UI Text and Labels Type
|
|
482
|
+
|
|
483
|
+
```ts
|
|
484
|
+
export interface GanttUIConfig {
|
|
485
|
+
headerTitle?: string;
|
|
486
|
+
showHeader?: boolean;
|
|
487
|
+
showAddTaskButton?: boolean;
|
|
488
|
+
showBaselineButton?: boolean;
|
|
489
|
+
showZoomButtons?: boolean;
|
|
490
|
+
showExportButtons?: boolean;
|
|
491
|
+
showFilterSearch?: boolean;
|
|
492
|
+
showTimelineViewSwitcher?: boolean;
|
|
493
|
+
addTaskButtonText?: string;
|
|
494
|
+
baselineButtonText?: string;
|
|
495
|
+
baselineButtonTextActive?: string;
|
|
496
|
+
zoomOutTooltip?: string;
|
|
497
|
+
zoomInTooltip?: string;
|
|
498
|
+
resetZoomTooltip?: string;
|
|
499
|
+
exportCSVTooltip?: string;
|
|
500
|
+
exportExcelTooltip?: string;
|
|
501
|
+
exportJSONTooltip?: string;
|
|
502
|
+
exportPDFTooltip?: string;
|
|
503
|
+
hideBaselinesTooltip?: string;
|
|
504
|
+
showBaselinesTooltip?: string;
|
|
505
|
+
timelineViewLabels?: Partial<Record<TimelineView, string>>;
|
|
506
|
+
taskCreatorTitle?: string;
|
|
507
|
+
taskCreatorOkText?: string;
|
|
508
|
+
taskCreatorCancelText?: string;
|
|
509
|
+
taskNameLabel?: string;
|
|
510
|
+
taskNamePlaceholder?: string;
|
|
511
|
+
typeLabel?: string;
|
|
512
|
+
priorityLabel?: string;
|
|
513
|
+
startDateLabel?: string;
|
|
514
|
+
durationLabel?: string;
|
|
515
|
+
colorLabel?: string;
|
|
516
|
+
progressLabel?: string;
|
|
517
|
+
ownerLabel?: string;
|
|
518
|
+
ownerPlaceholder?: string;
|
|
519
|
+
detailsLabel?: string;
|
|
520
|
+
detailsPlaceholder?: string;
|
|
521
|
+
taskTypeOptions?: {
|
|
522
|
+
task?: string;
|
|
523
|
+
milestone?: string;
|
|
524
|
+
project?: string;
|
|
525
|
+
};
|
|
526
|
+
priorityOptions?: {
|
|
527
|
+
low?: string;
|
|
528
|
+
medium?: string;
|
|
529
|
+
high?: string;
|
|
530
|
+
};
|
|
531
|
+
taskEditorTitle?: string;
|
|
532
|
+
taskEditorSaveText?: string;
|
|
533
|
+
taskEditorCancelText?: string;
|
|
534
|
+
taskEditorDeleteText?: string;
|
|
535
|
+
deleteConfirmTitle?: string;
|
|
536
|
+
deleteConfirmContent?: string;
|
|
537
|
+
deleteConfirmOkText?: string;
|
|
538
|
+
deleteConfirmCancelText?: string;
|
|
539
|
+
searchPlaceholder?: string;
|
|
540
|
+
allOwnersText?: string;
|
|
541
|
+
allStatusText?: string;
|
|
542
|
+
allPriorityText?: string;
|
|
543
|
+
clearFiltersText?: string;
|
|
544
|
+
statusOptions?: {
|
|
545
|
+
all?: string;
|
|
546
|
+
notStarted?: string;
|
|
547
|
+
inProgress?: string;
|
|
548
|
+
completed?: string;
|
|
549
|
+
};
|
|
550
|
+
priorityFilterOptions?: {
|
|
551
|
+
all?: string;
|
|
552
|
+
low?: string;
|
|
553
|
+
medium?: string;
|
|
554
|
+
high?: string;
|
|
555
|
+
};
|
|
556
|
+
columnLabels?: {
|
|
557
|
+
name?: string;
|
|
558
|
+
dependsOn?: string;
|
|
559
|
+
duration?: string;
|
|
560
|
+
start?: string;
|
|
561
|
+
};
|
|
562
|
+
taskNameRequired?: string;
|
|
563
|
+
}
|
|
564
|
+
```
|
|
565
|
+
|
|
566
|
+
## Filter Type
|
|
567
|
+
|
|
568
|
+
```ts
|
|
569
|
+
export interface FilterOptions {
|
|
570
|
+
searchText: string;
|
|
571
|
+
status: 'all' | 'not-started' | 'in-progress' | 'completed';
|
|
572
|
+
priority: 'all' | 'low' | 'medium' | 'high';
|
|
573
|
+
owner: string;
|
|
574
|
+
dateRange?: { start: Date; end: Date };
|
|
575
|
+
}
|
|
576
|
+
```
|
|
577
|
+
|
|
578
|
+
## Recurring Update Process
|
|
579
|
+
|
|
580
|
+
Use this checklist every time props/types change:
|
|
581
|
+
|
|
582
|
+
1. Update source types in `src/components/Gantt/Gantt.tsx`, `src/components/Gantt/types.ts`, and/or `src/components/Gantt/features/filterUtils.ts`.
|
|
583
|
+
2. Update this file (`PROPS_REFERENCE.md`) in the same PR/commit.
|
|
584
|
+
3. Run `npm run build` (or at least `npm run build:types`).
|
|
585
|
+
4. Update version notes in `README.md` if the change is user-facing.
|
|
586
|
+
5. Publish only after docs and type checks are both green.
|
package/QUICK_START.md
CHANGED
|
@@ -157,6 +157,34 @@ export default ProjectGantt
|
|
|
157
157
|
/>
|
|
158
158
|
```
|
|
159
159
|
|
|
160
|
+
### Customize Date Formats
|
|
161
|
+
|
|
162
|
+
```tsx
|
|
163
|
+
<Gantt
|
|
164
|
+
tasks={tasks}
|
|
165
|
+
config={{
|
|
166
|
+
timelineView: 'week',
|
|
167
|
+
timelineViewScales: {
|
|
168
|
+
day: [
|
|
169
|
+
{ unit: 'month', step: 1, format: 'MMMM YYYY' },
|
|
170
|
+
{ unit: 'day', step: 1, format: 'D' },
|
|
171
|
+
],
|
|
172
|
+
week: [
|
|
173
|
+
{ unit: 'month', step: 1, format: 'MMM YYYY' },
|
|
174
|
+
{ unit: 'week', step: 1, format: 'Week W' },
|
|
175
|
+
],
|
|
176
|
+
month: [
|
|
177
|
+
{ unit: 'year', step: 1, format: 'YYYY' },
|
|
178
|
+
{ unit: 'month', step: 1, format: 'MMM' },
|
|
179
|
+
],
|
|
180
|
+
},
|
|
181
|
+
relativeDayNumbering: false,
|
|
182
|
+
}}
|
|
183
|
+
/>
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
For all supported date tokens and more examples, see [DATE_FORMATTING_GUIDE.md](./DATE_FORMATTING_GUIDE.md).
|
|
187
|
+
|
|
160
188
|
## Troubleshooting
|
|
161
189
|
|
|
162
190
|
### CSS Import Error
|
|
@@ -184,5 +212,6 @@ npm install
|
|
|
184
212
|
## Next Steps
|
|
185
213
|
|
|
186
214
|
- Read [USAGE.md](./USAGE.md) for complete documentation
|
|
215
|
+
- Read [DATE_FORMATTING_GUIDE.md](./DATE_FORMATTING_GUIDE.md) for timeline header date formats
|
|
187
216
|
- Read [RESPONSIVE_STYLING.md](./RESPONSIVE_STYLING.md) for responsive design
|
|
188
217
|
- Read [CUSTOMIZATION_GUIDE.md](./CUSTOMIZATION_GUIDE.md) for advanced customization
|
package/README.md
CHANGED
|
@@ -2,7 +2,26 @@
|
|
|
2
2
|
|
|
3
3
|
A comprehensive, production-ready Gantt chart component built with React and TypeScript. Easy to install, simple to use, fully customizable, and responsive.
|
|
4
4
|
|
|
5
|
-
## 🆕 Version 1.
|
|
5
|
+
## 🆕 Version 1.6.0 (Latest)
|
|
6
|
+
|
|
7
|
+
### Bug Fixes
|
|
8
|
+
- **Daily precision for drag/resize in Week and Month views** — Previously, resizing or moving a task bar by fewer than half a unit (e.g., 2 days in Week view) was silently ignored because snapping was tied to the full column unit. Drag operations now calculate movement in **days** regardless of the active view, so even a 1-day resize in Month view is captured and reflected.
|
|
9
|
+
- **Responsive milestone bar width** — Milestone bars no longer use a fixed `80px` min-width that looked oversized with minimal data. They now use a compact `20px` minimum and are **centered on their date point** for zero-duration milestones. Milestones that span a real date range render at their actual computed width.
|
|
10
|
+
|
|
11
|
+
### Improvements
|
|
12
|
+
- **Milestone centering logic** — Zero-duration milestones (start == end) are now visually centered on their date position in the timeline, instead of extending 80px to the right of their start date.
|
|
13
|
+
- **Smoother drag UX in broader views** — Moving or resizing tasks in Week view snaps to the nearest day (1/7th of cell width) and in Month view to the nearest day (1/30th of cell width), giving users fine-grained control without switching to Day view.
|
|
14
|
+
|
|
15
|
+
## 🔖 Version 1.5.9
|
|
16
|
+
|
|
17
|
+
### Bug Fixes
|
|
18
|
+
- **Accurate task-bar sizing across calendar views** — Task bars now keep the correct real duration when switching between `day`, `week`, and `month` views. A 2-day task will stay visually proportional instead of appearing stretched in broader views.
|
|
19
|
+
- **Timeline positioning now follows the active bottom scale** — Range alignment and task placement now use the lowest active timeline scale row, which prevents width distortion when a view uses multiple header rows.
|
|
20
|
+
|
|
21
|
+
### Documentation
|
|
22
|
+
- **Release notes now clearly show the latest updates** — The README now highlights what changed in `1.5.9` so the newest fixes are visible at the top of the project documentation.
|
|
23
|
+
|
|
24
|
+
## 🆕 Version 1.5.8
|
|
6
25
|
|
|
7
26
|
### Improvements
|
|
8
27
|
- **Strict Header Height Synchronization** — Headers on both the left (Grid) and right (Timeline) are now explicitly tethered to the same pixel height. This ensures that even when rows are hidden (like Month/Year), the "day" labels and "Name" labels stay perfectly aligned and the overall header height reduces as expected.
|
|
@@ -163,6 +182,7 @@ function MyGantt() {
|
|
|
163
182
|
- **[Complete Usage Guide](./USAGE.md)** - Comprehensive documentation with all props and examples
|
|
164
183
|
- **[API Reference](./USAGE.md#api-reference)** - Full TypeScript API
|
|
165
184
|
- **[Props and Types Reference](./PROPS_REFERENCE.md)** - Complete prop/type list from exported interfaces
|
|
185
|
+
- **[Date Formatting Guide](./DATE_FORMATTING_GUIDE.md)** - Supported date tokens and timeline header examples
|
|
166
186
|
- **[Responsive Design Guide](./RESPONSIVE_STYLING.md)** - How to make it responsive and match your project styles
|
|
167
187
|
- **[Customization Guide](./CUSTOMIZATION_GUIDE.md)** - Advanced customization options
|
|
168
188
|
|
|
@@ -255,12 +275,16 @@ Use the toolbar switcher to toggle the calendar between day, week, and month vie
|
|
|
255
275
|
|
|
256
276
|
Version 1.5.6 introduces granular control over every row in the timeline header. You can hide specific layers or switch to relative numbering using these new props:
|
|
257
277
|
|
|
278
|
+
Need custom month/day labels or `timelineViewScales` formats like `MMMM YYYY`, `MM/YYYY`, or `Week W`? See the dedicated [Date Formatting Guide](./DATE_FORMATTING_GUIDE.md).
|
|
279
|
+
|
|
258
280
|
#### 1. Hide the Entire Header
|
|
259
281
|
To completely remove the calendar header rows while keeping the actual grid and tasks:
|
|
260
282
|
```tsx
|
|
261
283
|
<Gantt
|
|
262
284
|
tasks={tasks}
|
|
263
|
-
|
|
285
|
+
config={{
|
|
286
|
+
showTimelineHeader: false,
|
|
287
|
+
}}
|
|
264
288
|
/>
|
|
265
289
|
```
|
|
266
290
|
|
|
@@ -299,7 +323,7 @@ For complete control over the labels and time units in each row, use `timelineVi
|
|
|
299
323
|
```
|
|
300
324
|
|
|
301
325
|
### Customizing the Header Levels
|
|
302
|
-
If you want to show the headers, but completely remove specific layers like the "Month" or "Week" rows (for example, showing only the "Days" row), simply customize the `timelineViewScales` arrays
|
|
326
|
+
If you want to show the headers, but completely remove specific layers like the "Month" or "Week" rows (for example, showing only the "Days" row), simply customize the `timelineViewScales` arrays:
|
|
303
327
|
|
|
304
328
|
```tsx
|
|
305
329
|
<Gantt
|
|
@@ -799,6 +823,7 @@ const styleConfig: GanttStyleConfig = {...}
|
|
|
799
823
|
## 📚 More Documentation
|
|
800
824
|
|
|
801
825
|
- **[USAGE.md](./USAGE.md)** - Complete usage guide with all props
|
|
826
|
+
- **[DATE_FORMATTING_GUIDE.md](./DATE_FORMATTING_GUIDE.md)** - Date tokens and timeline header formatting examples
|
|
802
827
|
- **[RESPONSIVE_STYLING.md](./RESPONSIVE_STYLING.md)** - Responsive design guide
|
|
803
828
|
- **[CUSTOMIZATION_GUIDE.md](./CUSTOMIZATION_GUIDE.md)** - Advanced customization
|
|
804
829
|
|