iris-gantt 1.5.7 → 1.5.9
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 +20 -5
- package/RESPONSIVE_STYLING.md +261 -0
- package/USAGE.md +19 -0
- package/dist/Gantt/Chart.d.ts +1 -0
- package/dist/Gantt/Chart.d.ts.map +1 -1
- package/dist/Gantt/Gantt.d.ts.map +1 -1
- package/dist/Gantt/Grid.d.ts +1 -0
- package/dist/Gantt/Grid.d.ts.map +1 -1
- package/dist/Gantt/Timeline.d.ts +2 -1
- package/dist/Gantt/Timeline.d.ts.map +1 -1
- package/dist/iris-gantt.js +1785 -1791
- package/dist/iris-gantt.umd.cjs +13 -13
- package/package.json +6 -2
|
@@ -0,0 +1,392 @@
|
|
|
1
|
+
# UI Customization Guide
|
|
2
|
+
|
|
3
|
+
Complete guide to customizing all text, labels, and buttons in the Gantt component.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
The `uiConfig` prop allows you to:
|
|
8
|
+
- ✅ Customize all text labels and placeholders
|
|
9
|
+
- ✅ Show/hide any button with boolean props
|
|
10
|
+
- ✅ Customize tooltips
|
|
11
|
+
- ✅ Customize modal titles and button text
|
|
12
|
+
- ✅ Customize form labels and validation messages
|
|
13
|
+
|
|
14
|
+
## Basic Usage
|
|
15
|
+
|
|
16
|
+
```tsx
|
|
17
|
+
import { Gantt } from 'iris-gantt'
|
|
18
|
+
import 'iris-gantt/gantt.css'
|
|
19
|
+
import type { GanttUIConfig } from 'iris-gantt'
|
|
20
|
+
|
|
21
|
+
const uiConfig: Partial<GanttUIConfig> = {
|
|
22
|
+
headerTitle: 'My Project Timeline',
|
|
23
|
+
showHeader: true,
|
|
24
|
+
showAddTaskButton: true,
|
|
25
|
+
showBaselineButton: false,
|
|
26
|
+
addTaskButtonText: 'Add New Task',
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function App() {
|
|
30
|
+
return (
|
|
31
|
+
<Gantt
|
|
32
|
+
tasks={tasks}
|
|
33
|
+
uiConfig={uiConfig}
|
|
34
|
+
/>
|
|
35
|
+
)
|
|
36
|
+
}
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Complete UI Configuration
|
|
40
|
+
|
|
41
|
+
### Header
|
|
42
|
+
|
|
43
|
+
```tsx
|
|
44
|
+
{
|
|
45
|
+
headerTitle?: string // Default: 'Iris Gantt'
|
|
46
|
+
showHeader?: boolean // Default: true
|
|
47
|
+
}
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### Toolbar Buttons (Show/Hide)
|
|
51
|
+
|
|
52
|
+
```tsx
|
|
53
|
+
{
|
|
54
|
+
showAddTaskButton?: boolean // Default: true
|
|
55
|
+
showBaselineButton?: boolean // Default: true
|
|
56
|
+
showZoomButtons?: boolean // Default: true
|
|
57
|
+
showExportButtons?: boolean // Default: true
|
|
58
|
+
showFilterSearch?: boolean // Default: true
|
|
59
|
+
}
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### Toolbar Button Labels
|
|
63
|
+
|
|
64
|
+
```tsx
|
|
65
|
+
{
|
|
66
|
+
addTaskButtonText?: string // Default: 'New Task'
|
|
67
|
+
baselineButtonText?: string // Default: 'Set Baseline'
|
|
68
|
+
baselineButtonTextActive?: string // Default: 'Baselines'
|
|
69
|
+
zoomOutTooltip?: string // Default: 'Zoom Out'
|
|
70
|
+
zoomInTooltip?: string // Default: 'Zoom In'
|
|
71
|
+
resetZoomTooltip?: string // Default: 'Reset Zoom'
|
|
72
|
+
exportCSVTooltip?: string // Default: 'Export to CSV'
|
|
73
|
+
exportExcelTooltip?: string // Default: 'Export to Excel'
|
|
74
|
+
exportJSONTooltip?: string // Default: 'Export to JSON'
|
|
75
|
+
exportPDFTooltip?: string // Default: 'Export to PDF'
|
|
76
|
+
hideBaselinesTooltip?: string // Default: 'Hide Baselines'
|
|
77
|
+
showBaselinesTooltip?: string // Default: 'Show Baselines'
|
|
78
|
+
}
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### Task Creator Modal
|
|
82
|
+
|
|
83
|
+
```tsx
|
|
84
|
+
{
|
|
85
|
+
taskCreatorTitle?: string // Default: 'Create New Task'
|
|
86
|
+
taskCreatorOkText?: string // Default: 'Create Task'
|
|
87
|
+
taskCreatorCancelText?: string // Default: 'Cancel'
|
|
88
|
+
taskNameLabel?: string // Default: 'Task Name'
|
|
89
|
+
taskNamePlaceholder?: string // Default: 'Enter task name'
|
|
90
|
+
typeLabel?: string // Default: 'Type'
|
|
91
|
+
priorityLabel?: string // Default: 'Priority'
|
|
92
|
+
startDateLabel?: string // Default: 'Start Date'
|
|
93
|
+
durationLabel?: string // Default: 'Duration (days)'
|
|
94
|
+
colorLabel?: string // Default: 'Color'
|
|
95
|
+
progressLabel?: string // Default: 'Progress (%)'
|
|
96
|
+
ownerLabel?: string // Default: 'Owner'
|
|
97
|
+
ownerPlaceholder?: string // Default: 'Assign to...'
|
|
98
|
+
detailsLabel?: string // Default: 'Details'
|
|
99
|
+
detailsPlaceholder?: string // Default: 'Add task description...'
|
|
100
|
+
taskNameRequired?: string // Default: 'Please enter task name'
|
|
101
|
+
}
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### Task Type & Priority Options
|
|
105
|
+
|
|
106
|
+
```tsx
|
|
107
|
+
{
|
|
108
|
+
taskTypeOptions?: {
|
|
109
|
+
task?: string // Default: 'Task'
|
|
110
|
+
milestone?: string // Default: 'Milestone'
|
|
111
|
+
project?: string // Default: 'Project'
|
|
112
|
+
},
|
|
113
|
+
priorityOptions?: {
|
|
114
|
+
low?: string // Default: 'Low'
|
|
115
|
+
medium?: string // Default: 'Medium'
|
|
116
|
+
high?: string // Default: 'High'
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
### Task Editor Modal
|
|
122
|
+
|
|
123
|
+
```tsx
|
|
124
|
+
{
|
|
125
|
+
taskEditorTitle?: string // Default: 'Edit Task'
|
|
126
|
+
taskEditorSaveText?: string // Default: 'Save Changes'
|
|
127
|
+
taskEditorCancelText?: string // Default: 'Cancel'
|
|
128
|
+
taskEditorDeleteText?: string // Default: 'Delete'
|
|
129
|
+
deleteConfirmTitle?: string // Default: 'Delete Task'
|
|
130
|
+
deleteConfirmContent?: string // Default: 'This action cannot be undone.'
|
|
131
|
+
deleteConfirmOkText?: string // Default: 'Yes, Delete'
|
|
132
|
+
deleteConfirmCancelText?: string // Default: 'No'
|
|
133
|
+
}
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
### Filter Search
|
|
137
|
+
|
|
138
|
+
```tsx
|
|
139
|
+
{
|
|
140
|
+
searchPlaceholder?: string // Default: 'Search tasks...'
|
|
141
|
+
allOwnersText?: string // Default: 'All Owners'
|
|
142
|
+
allStatusText?: string // Default: 'All Status'
|
|
143
|
+
allPriorityText?: string // Default: 'All Priority'
|
|
144
|
+
clearFiltersText?: string // Default: 'Clear'
|
|
145
|
+
statusOptions?: {
|
|
146
|
+
all?: string // Default: 'All Status'
|
|
147
|
+
notStarted?: string // Default: 'Not Started'
|
|
148
|
+
inProgress?: string // Default: 'In Progress'
|
|
149
|
+
completed?: string // Default: 'Completed'
|
|
150
|
+
},
|
|
151
|
+
priorityFilterOptions?: {
|
|
152
|
+
all?: string // Default: 'All Priority'
|
|
153
|
+
low?: string // Default: 'Low'
|
|
154
|
+
medium?: string // Default: 'Medium'
|
|
155
|
+
high?: string // Default: 'High'
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
### Column Labels
|
|
161
|
+
|
|
162
|
+
```tsx
|
|
163
|
+
{
|
|
164
|
+
columnLabels?: {
|
|
165
|
+
name?: string // Default: 'Name'
|
|
166
|
+
dependsOn?: string // Default: 'Depends on'
|
|
167
|
+
duration?: string // Default: 'Duration'
|
|
168
|
+
start?: string // Default: 'Start'
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
## Examples
|
|
174
|
+
|
|
175
|
+
### Example 1: Hide All Buttons Except Add Task
|
|
176
|
+
|
|
177
|
+
```tsx
|
|
178
|
+
<Gantt
|
|
179
|
+
tasks={tasks}
|
|
180
|
+
uiConfig={{
|
|
181
|
+
showBaselineButton: false,
|
|
182
|
+
showZoomButtons: false,
|
|
183
|
+
showExportButtons: false,
|
|
184
|
+
showFilterSearch: false,
|
|
185
|
+
addTaskButtonText: 'Add Task',
|
|
186
|
+
}}
|
|
187
|
+
/>
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
### Example 2: Customize All Text
|
|
191
|
+
|
|
192
|
+
```tsx
|
|
193
|
+
<Gantt
|
|
194
|
+
tasks={tasks}
|
|
195
|
+
uiConfig={{
|
|
196
|
+
headerTitle: 'Project Timeline',
|
|
197
|
+
addTaskButtonText: 'Create Task',
|
|
198
|
+
baselineButtonText: 'Save Baseline',
|
|
199
|
+
taskCreatorTitle: 'New Task',
|
|
200
|
+
taskNameLabel: 'Task Title',
|
|
201
|
+
taskNamePlaceholder: 'Enter task title',
|
|
202
|
+
typeLabel: 'Task Type',
|
|
203
|
+
priorityLabel: 'Priority Level',
|
|
204
|
+
}}
|
|
205
|
+
/>
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
### Example 3: Internationalization (i18n)
|
|
209
|
+
|
|
210
|
+
```tsx
|
|
211
|
+
const frenchUIConfig: Partial<GanttUIConfig> = {
|
|
212
|
+
headerTitle: 'Diagramme de Gantt',
|
|
213
|
+
addTaskButtonText: 'Nouvelle Tâche',
|
|
214
|
+
baselineButtonText: 'Définir la Baseline',
|
|
215
|
+
taskCreatorTitle: 'Créer une Nouvelle Tâche',
|
|
216
|
+
taskNameLabel: 'Nom de la Tâche',
|
|
217
|
+
taskNamePlaceholder: 'Entrez le nom de la tâche',
|
|
218
|
+
typeLabel: 'Type',
|
|
219
|
+
priorityLabel: 'Priorité',
|
|
220
|
+
startDateLabel: 'Date de Début',
|
|
221
|
+
durationLabel: 'Durée (jours)',
|
|
222
|
+
progressLabel: 'Progression (%)',
|
|
223
|
+
ownerLabel: 'Responsable',
|
|
224
|
+
detailsLabel: 'Détails',
|
|
225
|
+
taskTypeOptions: {
|
|
226
|
+
task: 'Tâche',
|
|
227
|
+
milestone: 'Jalon',
|
|
228
|
+
project: 'Projet',
|
|
229
|
+
},
|
|
230
|
+
priorityOptions: {
|
|
231
|
+
low: 'Faible',
|
|
232
|
+
medium: 'Moyenne',
|
|
233
|
+
high: 'Élevée',
|
|
234
|
+
},
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
<Gantt tasks={tasks} uiConfig={frenchUIConfig} />
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
### Example 4: Minimal UI (Hide Everything)
|
|
241
|
+
|
|
242
|
+
```tsx
|
|
243
|
+
<Gantt
|
|
244
|
+
tasks={tasks}
|
|
245
|
+
uiConfig={{
|
|
246
|
+
showHeader: false,
|
|
247
|
+
showAddTaskButton: false,
|
|
248
|
+
showBaselineButton: false,
|
|
249
|
+
showZoomButtons: false,
|
|
250
|
+
showExportButtons: false,
|
|
251
|
+
showFilterSearch: false,
|
|
252
|
+
}}
|
|
253
|
+
/>
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
### Example 5: Custom Button Text Only
|
|
257
|
+
|
|
258
|
+
```tsx
|
|
259
|
+
<Gantt
|
|
260
|
+
tasks={tasks}
|
|
261
|
+
uiConfig={{
|
|
262
|
+
addTaskButtonText: '➕ Add',
|
|
263
|
+
baselineButtonText: '📅 Baseline',
|
|
264
|
+
zoomOutTooltip: 'Zoomer',
|
|
265
|
+
zoomInTooltip: 'Dézoomer',
|
|
266
|
+
}}
|
|
267
|
+
/>
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
## Complete Example
|
|
271
|
+
|
|
272
|
+
```tsx
|
|
273
|
+
import { Gantt } from 'iris-gantt'
|
|
274
|
+
import 'iris-gantt/gantt.css'
|
|
275
|
+
import type { GanttUIConfig } from 'iris-gantt'
|
|
276
|
+
|
|
277
|
+
function MyGantt() {
|
|
278
|
+
const uiConfig: Partial<GanttUIConfig> = {
|
|
279
|
+
// Header
|
|
280
|
+
headerTitle: 'My Project',
|
|
281
|
+
showHeader: true,
|
|
282
|
+
|
|
283
|
+
// Buttons visibility
|
|
284
|
+
showAddTaskButton: true,
|
|
285
|
+
showBaselineButton: true,
|
|
286
|
+
showZoomButtons: true,
|
|
287
|
+
showExportButtons: true,
|
|
288
|
+
showFilterSearch: true,
|
|
289
|
+
|
|
290
|
+
// Button labels
|
|
291
|
+
addTaskButtonText: 'Add Task',
|
|
292
|
+
baselineButtonText: 'Baseline',
|
|
293
|
+
baselineButtonTextActive: 'Hide Baseline',
|
|
294
|
+
|
|
295
|
+
// Tooltips
|
|
296
|
+
zoomOutTooltip: 'Zoom Out',
|
|
297
|
+
zoomInTooltip: 'Zoom In',
|
|
298
|
+
resetZoomTooltip: 'Reset',
|
|
299
|
+
exportCSVTooltip: 'Export CSV',
|
|
300
|
+
exportExcelTooltip: 'Export Excel',
|
|
301
|
+
exportJSONTooltip: 'Export JSON',
|
|
302
|
+
exportPDFTooltip: 'Export PDF',
|
|
303
|
+
|
|
304
|
+
// Task Creator
|
|
305
|
+
taskCreatorTitle: 'Create Task',
|
|
306
|
+
taskCreatorOkText: 'Create',
|
|
307
|
+
taskCreatorCancelText: 'Cancel',
|
|
308
|
+
taskNameLabel: 'Task Name',
|
|
309
|
+
taskNamePlaceholder: 'Enter name',
|
|
310
|
+
typeLabel: 'Type',
|
|
311
|
+
priorityLabel: 'Priority',
|
|
312
|
+
startDateLabel: 'Start',
|
|
313
|
+
durationLabel: 'Duration',
|
|
314
|
+
colorLabel: 'Color',
|
|
315
|
+
progressLabel: 'Progress',
|
|
316
|
+
ownerLabel: 'Owner',
|
|
317
|
+
ownerPlaceholder: 'Assign to',
|
|
318
|
+
detailsLabel: 'Description',
|
|
319
|
+
detailsPlaceholder: 'Add description',
|
|
320
|
+
|
|
321
|
+
// Options
|
|
322
|
+
taskTypeOptions: {
|
|
323
|
+
task: 'Task',
|
|
324
|
+
milestone: 'Milestone',
|
|
325
|
+
project: 'Project',
|
|
326
|
+
},
|
|
327
|
+
priorityOptions: {
|
|
328
|
+
low: 'Low',
|
|
329
|
+
medium: 'Medium',
|
|
330
|
+
high: 'High',
|
|
331
|
+
},
|
|
332
|
+
|
|
333
|
+
// Task Editor
|
|
334
|
+
taskEditorTitle: 'Edit Task',
|
|
335
|
+
taskEditorSaveText: 'Save',
|
|
336
|
+
taskEditorCancelText: 'Cancel',
|
|
337
|
+
taskEditorDeleteText: 'Delete',
|
|
338
|
+
deleteConfirmTitle: 'Confirm Delete',
|
|
339
|
+
deleteConfirmContent: 'Are you sure?',
|
|
340
|
+
deleteConfirmOkText: 'Delete',
|
|
341
|
+
deleteConfirmCancelText: 'Cancel',
|
|
342
|
+
|
|
343
|
+
// Filters
|
|
344
|
+
searchPlaceholder: 'Search...',
|
|
345
|
+
allOwnersText: 'All',
|
|
346
|
+
clearFiltersText: 'Clear',
|
|
347
|
+
statusOptions: {
|
|
348
|
+
all: 'All',
|
|
349
|
+
notStarted: 'Not Started',
|
|
350
|
+
inProgress: 'In Progress',
|
|
351
|
+
completed: 'Done',
|
|
352
|
+
},
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
return (
|
|
356
|
+
<Gantt
|
|
357
|
+
tasks={tasks}
|
|
358
|
+
links={links}
|
|
359
|
+
uiConfig={uiConfig}
|
|
360
|
+
onTaskUpdate={(task) => console.log('Updated:', task)}
|
|
361
|
+
/>
|
|
362
|
+
)
|
|
363
|
+
}
|
|
364
|
+
```
|
|
365
|
+
|
|
366
|
+
## TypeScript Support
|
|
367
|
+
|
|
368
|
+
All UI config options are fully typed:
|
|
369
|
+
|
|
370
|
+
```tsx
|
|
371
|
+
import type { GanttUIConfig } from 'iris-gantt'
|
|
372
|
+
|
|
373
|
+
const uiConfig: Partial<GanttUIConfig> = {
|
|
374
|
+
// TypeScript will autocomplete all available options
|
|
375
|
+
headerTitle: 'My Gantt',
|
|
376
|
+
showAddTaskButton: true,
|
|
377
|
+
// ...
|
|
378
|
+
}
|
|
379
|
+
```
|
|
380
|
+
|
|
381
|
+
## Notes
|
|
382
|
+
|
|
383
|
+
- All props are **optional** - if not provided, defaults are used
|
|
384
|
+
- Use `Partial<GanttUIConfig>` to only specify what you need
|
|
385
|
+
- Boolean props default to `true` (buttons shown by default)
|
|
386
|
+
- Text props default to English labels
|
|
387
|
+
- You can mix and match - only customize what you need
|
|
388
|
+
|
|
389
|
+
## See Also
|
|
390
|
+
|
|
391
|
+
- [USAGE.md](./USAGE.md) - Complete usage documentation
|
|
392
|
+
- [README.md](./README.md) - Quick start guide
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
# Date Formatting Guide - Iris Gantt
|
|
2
|
+
|
|
3
|
+
You can customize the date formats in the timeline header (calendar header) using the `scales` property within the `config` object.
|
|
4
|
+
|
|
5
|
+
For multi-view calendars, use `config.timelineViewScales` to define separate formats for `day`, `week`, and `month` views.
|
|
6
|
+
|
|
7
|
+
Related header controls:
|
|
8
|
+
- `config.showTimelineHeader` hides the entire timeline header.
|
|
9
|
+
- `showMonthHeading` and `showRangeHeading` can be passed as top-level props or inside `config`.
|
|
10
|
+
- `relativeDayNumbering` can be passed as a top-level prop or inside `config`.
|
|
11
|
+
|
|
12
|
+
## Available Date Tokens
|
|
13
|
+
These tokens can be used in your format strings:
|
|
14
|
+
|
|
15
|
+
| Token | Description | Example |
|
|
16
|
+
| :--- | :--- | :--- |
|
|
17
|
+
| `MMMM` | Full Month Name | January, February... |
|
|
18
|
+
| `MMM` | Short Month Name | Jan, Feb... |
|
|
19
|
+
| `MM` | Padded Month Number | 01, 02... |
|
|
20
|
+
| `M` | Month Number | 1, 2... |
|
|
21
|
+
| `DD` | Padded Day Number | 01, 02... |
|
|
22
|
+
| `D` | Day Number | 1, 2... |
|
|
23
|
+
| `YYYY` | Full Year | 2024, 2025... |
|
|
24
|
+
| `YY` | Two-digit Year | 24, 25... |
|
|
25
|
+
| `dddd` | Full Day of Week | Monday, Tuesday... |
|
|
26
|
+
| `HH` | Padded Hour (24h) | 09, 13... |
|
|
27
|
+
| `mm` | Padded Minutes | 05, 30... |
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## Implementation Examples
|
|
32
|
+
|
|
33
|
+
### 1. Using Full Month Names
|
|
34
|
+
If you want the top row to show the full month name:
|
|
35
|
+
|
|
36
|
+
```tsx
|
|
37
|
+
<Gantt
|
|
38
|
+
tasks={tasks}
|
|
39
|
+
config={{
|
|
40
|
+
scales: [
|
|
41
|
+
{ unit: 'month', step: 1, format: 'MMMM YYYY' }, // Output: "January 2024"
|
|
42
|
+
{ unit: 'day', step: 1, format: 'D' } // Output: "1", "2", "3"...
|
|
43
|
+
]
|
|
44
|
+
}}
|
|
45
|
+
/>
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### 2. Using Month Numbers
|
|
49
|
+
If you prefer numbers for the months instead of names:
|
|
50
|
+
|
|
51
|
+
```tsx
|
|
52
|
+
<Gantt
|
|
53
|
+
tasks={tasks}
|
|
54
|
+
config={{
|
|
55
|
+
scales: [
|
|
56
|
+
{ unit: 'month', step: 1, format: 'MM/YYYY' }, // Output: "01/2024"
|
|
57
|
+
{ unit: 'day', step: 1, format: 'D' }
|
|
58
|
+
]
|
|
59
|
+
}}
|
|
60
|
+
/>
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### 3. Relative Day Numbering
|
|
64
|
+
If you want relative numbers (e.g., Day 1, Day 2, Day 3 starting from the project start), use the `relativeDayNumbering` flag:
|
|
65
|
+
|
|
66
|
+
```tsx
|
|
67
|
+
<Gantt
|
|
68
|
+
tasks={tasks}
|
|
69
|
+
config={{
|
|
70
|
+
relativeDayNumbering: true, // This overrides the 'day' unit format to 1, 2, 3...
|
|
71
|
+
scales: [
|
|
72
|
+
{ unit: 'month', step: 1, format: 'MMMM' },
|
|
73
|
+
{ unit: 'day', step: 1 }
|
|
74
|
+
]
|
|
75
|
+
}}
|
|
76
|
+
/>
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### 4. Customizing per View
|
|
80
|
+
If you are using the Timeline View Switcher, you can customize formats for each view (Day, Week, Month):
|
|
81
|
+
|
|
82
|
+
```tsx
|
|
83
|
+
<Gantt
|
|
84
|
+
tasks={tasks}
|
|
85
|
+
config={{
|
|
86
|
+
timelineViewScales: {
|
|
87
|
+
day: [
|
|
88
|
+
{ unit: 'month', step: 1, format: 'MMMM' },
|
|
89
|
+
{ unit: 'day', step: 1, format: 'D' }
|
|
90
|
+
],
|
|
91
|
+
week: [
|
|
92
|
+
{ unit: 'month', step: 1, format: 'MMM' },
|
|
93
|
+
{ unit: 'week', step: 1, format: 'Week W' } // 'W' is a special token for Week of Month
|
|
94
|
+
],
|
|
95
|
+
month: [
|
|
96
|
+
{ unit: 'year', step: 1, format: 'YYYY' },
|
|
97
|
+
{ unit: 'month', step: 1, format: 'MMM' }
|
|
98
|
+
]
|
|
99
|
+
}
|
|
100
|
+
}}
|
|
101
|
+
/>
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### 5. Hiding Header Rows
|
|
105
|
+
If you want to keep custom date formats but hide specific header rows:
|
|
106
|
+
|
|
107
|
+
```tsx
|
|
108
|
+
<Gantt
|
|
109
|
+
tasks={tasks}
|
|
110
|
+
showMonthHeading={false}
|
|
111
|
+
showRangeHeading={false}
|
|
112
|
+
config={{
|
|
113
|
+
showTimelineHeader: true,
|
|
114
|
+
timelineViewScales: {
|
|
115
|
+
day: [{ unit: 'day', step: 1, format: 'D' }],
|
|
116
|
+
week: [{ unit: 'week', step: 1, format: 'Week W' }],
|
|
117
|
+
month: [{ unit: 'month', step: 1, format: 'MMM YYYY' }]
|
|
118
|
+
}
|
|
119
|
+
}}
|
|
120
|
+
/>
|
|
121
|
+
```
|
package/PACKAGE_SETUP.md
CHANGED
|
@@ -128,6 +128,8 @@ import 'iris-gantt/gantt.css'
|
|
|
128
128
|
- **[README.md](./README.md)** - Main documentation
|
|
129
129
|
- **[USAGE.md](./USAGE.md)** - Complete usage guide with all props
|
|
130
130
|
- **[QUICK_START.md](./QUICK_START.md)** - Quick start guide
|
|
131
|
+
- **[PROPS_REFERENCE.md](./PROPS_REFERENCE.md)** - Exported props and TypeScript types
|
|
132
|
+
- **[DATE_FORMATTING_GUIDE.md](./DATE_FORMATTING_GUIDE.md)** - Timeline header date tokens and formatting examples
|
|
131
133
|
- **[RESPONSIVE_STYLING.md](./RESPONSIVE_STYLING.md)** - Responsive design guide
|
|
132
134
|
- **[CUSTOMIZATION_GUIDE.md](./CUSTOMIZATION_GUIDE.md)** - Advanced customization
|
|
133
135
|
|
|
@@ -194,4 +196,5 @@ The package is now:
|
|
|
194
196
|
|
|
195
197
|
1. Build the package: `npm run build`
|
|
196
198
|
2. Test locally: `npm link` in package, `npm link iris-gantt` in your project
|
|
197
|
-
3.
|
|
199
|
+
3. Review packaged docs including `DATE_FORMATTING_GUIDE.md` and `PROPS_REFERENCE.md`
|
|
200
|
+
4. Publish to npm: `npm publish`
|