zegantt 1.1.3 → 1.1.5
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 +260 -260
- package/dist/zegantt.cjs +4 -7
- package/dist/zegantt.css +1 -1
- package/dist/zegantt.js +3759 -3768
- package/package.json +69 -69
package/README.md
CHANGED
|
@@ -1,260 +1,260 @@
|
|
|
1
|
-
# ZeGantt
|
|
2
|
-
|
|
3
|
-
ZeGantt is a React Gantt chart library focused on construction and project planning workflows.
|
|
4
|
-
|
|
5
|
-
## Highlights
|
|
6
|
-
|
|
7
|
-
- Virtualized rows and day-columns for large datasets (thousands of tasks)
|
|
8
|
-
- Drag, resize and dependency creation with mouse and touch support
|
|
9
|
-
- Keyboard navigation and accessibility attributes for enterprise use
|
|
10
|
-
- Theme tokens via CSS variables
|
|
11
|
-
- i18n with robust English fallback
|
|
12
|
-
- ESM + CJS builds with TypeScript declarations
|
|
13
|
-
|
|
14
|
-
## Install
|
|
15
|
-
|
|
16
|
-
```bash
|
|
17
|
-
npm install zegantt
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
### Required peer dependencies
|
|
21
|
-
|
|
22
|
-
```bash
|
|
23
|
-
npm install react react-dom lucide-react
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
## Minimal usage
|
|
27
|
-
|
|
28
|
-
```tsx
|
|
29
|
-
import { ProjectGantt, ptBR, type GanttStep } from 'zegantt';
|
|
30
|
-
import 'zegantt/style.css';
|
|
31
|
-
|
|
32
|
-
const steps: GanttStep[] = [
|
|
33
|
-
{
|
|
34
|
-
id: 's1',
|
|
35
|
-
name: 'Foundation',
|
|
36
|
-
startDate: '2026-01-10',
|
|
37
|
-
finishDate: '2026-01-20',
|
|
38
|
-
conclusionPercent: 45,
|
|
39
|
-
projectId: 'p1',
|
|
40
|
-
projectTitle: 'Residential Tower',
|
|
41
|
-
},
|
|
42
|
-
];
|
|
43
|
-
|
|
44
|
-
export function Example() {
|
|
45
|
-
return (
|
|
46
|
-
<ProjectGantt
|
|
47
|
-
steps={steps}
|
|
48
|
-
locale="pt-BR"
|
|
49
|
-
translations={ptBR}
|
|
50
|
-
groupByProject
|
|
51
|
-
onTaskChange={(task) => console.log('Task updated', task)}
|
|
52
|
-
/>
|
|
53
|
-
);
|
|
54
|
-
}
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
## Data contracts
|
|
58
|
-
|
|
59
|
-
### Steps
|
|
60
|
-
|
|
61
|
-
```ts
|
|
62
|
-
interface GanttStep {
|
|
63
|
-
id: string;
|
|
64
|
-
name: string;
|
|
65
|
-
startDate?: Date | string;
|
|
66
|
-
finishDate?: Date | string;
|
|
67
|
-
previsionStartDate?: Date | string;
|
|
68
|
-
previsionFinishDate?: Date | string;
|
|
69
|
-
conclusionPercent?: number | string;
|
|
70
|
-
projectId?: string;
|
|
71
|
-
projectTitle?: string;
|
|
72
|
-
}
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
### Milestones
|
|
76
|
-
|
|
77
|
-
```ts
|
|
78
|
-
interface GanttMilestone {
|
|
79
|
-
id: string;
|
|
80
|
-
name: string;
|
|
81
|
-
date?: Date | string;
|
|
82
|
-
finished?: boolean;
|
|
83
|
-
projectId?: string;
|
|
84
|
-
projectTitle?: string;
|
|
85
|
-
}
|
|
86
|
-
```
|
|
87
|
-
|
|
88
|
-
### Events
|
|
89
|
-
|
|
90
|
-
```ts
|
|
91
|
-
interface GanttEvent {
|
|
92
|
-
id: string;
|
|
93
|
-
title: string;
|
|
94
|
-
date?: Date | string;
|
|
95
|
-
finished?: boolean;
|
|
96
|
-
projectId?: string;
|
|
97
|
-
projectTitle?: string;
|
|
98
|
-
}
|
|
99
|
-
```
|
|
100
|
-
|
|
101
|
-
### Notes
|
|
102
|
-
|
|
103
|
-
```ts
|
|
104
|
-
interface GanttNote {
|
|
105
|
-
id: string;
|
|
106
|
-
title: string;
|
|
107
|
-
targetId?: string;
|
|
108
|
-
predecessorId?: string;
|
|
109
|
-
description?: string;
|
|
110
|
-
author?: string;
|
|
111
|
-
date?: Date | string;
|
|
112
|
-
color?: string;
|
|
113
|
-
filesCount?: number;
|
|
114
|
-
projectId?: string;
|
|
115
|
-
projectTitle?: string;
|
|
116
|
-
}
|
|
117
|
-
```
|
|
118
|
-
|
|
119
|
-
### Dependencies
|
|
120
|
-
|
|
121
|
-
```ts
|
|
122
|
-
type PredecessorType = 'STEP' | 'MILESTONE';
|
|
123
|
-
type DependencyType = 'FS' | 'SS' | 'FF' | 'SF';
|
|
124
|
-
|
|
125
|
-
interface GanttDependency {
|
|
126
|
-
id: string;
|
|
127
|
-
predecessorId: string;
|
|
128
|
-
predecessorType: PredecessorType;
|
|
129
|
-
successorId: string;
|
|
130
|
-
successorType: PredecessorType;
|
|
131
|
-
type: DependencyType;
|
|
132
|
-
lag: number;
|
|
133
|
-
}
|
|
134
|
-
```
|
|
135
|
-
|
|
136
|
-
## Main props
|
|
137
|
-
|
|
138
|
-
```ts
|
|
139
|
-
interface ProjectGanttProps {
|
|
140
|
-
steps: GanttStep[];
|
|
141
|
-
milestones?: GanttMilestone[];
|
|
142
|
-
events?: GanttEvent[];
|
|
143
|
-
notes?: GanttNote[];
|
|
144
|
-
dependencies?: GanttDependency[];
|
|
145
|
-
|
|
146
|
-
loading?: boolean;
|
|
147
|
-
locale?: string;
|
|
148
|
-
groupByProject?: boolean;
|
|
149
|
-
translations?: Record<string, string> | ((key: string, fallback?: string) => string);
|
|
150
|
-
|
|
151
|
-
onTaskChange?: (task: GanttTask) => void;
|
|
152
|
-
onTaskClick?: (task: GanttTask) => void;
|
|
153
|
-
onCreateDependency?: (params: CreateDependencyParams) => Promise<void>;
|
|
154
|
-
onDeleteDependency?: (dependencyId: string) => Promise<void>;
|
|
155
|
-
onDependencyError?: (error: DependencyValidationError) => void;
|
|
156
|
-
|
|
157
|
-
onAddNewStage?: (date?: Date, projectId?: string) => void;
|
|
158
|
-
onAddMilestone?: (date?: Date, projectId?: string) => void;
|
|
159
|
-
onAddEvent?: (date?: Date, projectId?: string) => void;
|
|
160
|
-
onAddNote?: (date?: Date, projectId?: string) => void;
|
|
161
|
-
}
|
|
162
|
-
```
|
|
163
|
-
|
|
164
|
-
## Dependency cycle protection
|
|
165
|
-
|
|
166
|
-
ZeGantt blocks creation of circular dependencies (for example A -> B -> C -> A).
|
|
167
|
-
|
|
168
|
-
- If `onDependencyError` is provided, it receives a `CYCLIC_DEPENDENCY` error payload.
|
|
169
|
-
- If not provided, ZeGantt shows a default alert message.
|
|
170
|
-
|
|
171
|
-
## Accessibility and keyboard
|
|
172
|
-
|
|
173
|
-
- Interactive rows include semantic roles and keyboard handling
|
|
174
|
-
- Row navigation with arrow keys
|
|
175
|
-
- `Enter` opens task details (when callback exists)
|
|
176
|
-
- Focus-visible ring is provided by default CSS
|
|
177
|
-
|
|
178
|
-
## Mobile and touch
|
|
179
|
-
|
|
180
|
-
The library supports touch interactions for:
|
|
181
|
-
|
|
182
|
-
- Bar dragging
|
|
183
|
-
- Bar resizing
|
|
184
|
-
- Dependency connection handles
|
|
185
|
-
- Timeline panning
|
|
186
|
-
|
|
187
|
-
## Theming
|
|
188
|
-
|
|
189
|
-
ZeGantt exposes CSS variables that can be overridden globally or in a wrapper:
|
|
190
|
-
|
|
191
|
-
```css
|
|
192
|
-
.my-gantt-theme {
|
|
193
|
-
--zg-surface: #ffffff;
|
|
194
|
-
--zg-surface-alt: #f4f7f6;
|
|
195
|
-
--zg-header-bg: #e9efec;
|
|
196
|
-
--zg-border: #c9d2ce;
|
|
197
|
-
--zg-border-light: #dbe3df;
|
|
198
|
-
--zg-primary-color: #0f3d2f;
|
|
199
|
-
--zg-note-color: #ffd44d;
|
|
200
|
-
--zg-shadow-panel: 0 10px 30px rgba(0, 0, 0, 0.08);
|
|
201
|
-
}
|
|
202
|
-
```
|
|
203
|
-
|
|
204
|
-
Apply theme:
|
|
205
|
-
|
|
206
|
-
```tsx
|
|
207
|
-
<div className="my-gantt-theme">
|
|
208
|
-
<ProjectGantt steps={steps} />
|
|
209
|
-
</div>
|
|
210
|
-
```
|
|
211
|
-
|
|
212
|
-
## i18n
|
|
213
|
-
|
|
214
|
-
- Use `locale` (BCP 47, ex: `en-US`, `pt-BR`) to format dates and month labels.
|
|
215
|
-
- Provide `translations` as object or function.
|
|
216
|
-
- Missing keys fall back to English automatically.
|
|
217
|
-
|
|
218
|
-
Built-in helper export:
|
|
219
|
-
|
|
220
|
-
```ts
|
|
221
|
-
import { ptBR } from 'zegantt';
|
|
222
|
-
```
|
|
223
|
-
|
|
224
|
-
## Testing
|
|
225
|
-
|
|
226
|
-
Included scripts:
|
|
227
|
-
|
|
228
|
-
```bash
|
|
229
|
-
npm run test
|
|
230
|
-
npm run test:watch
|
|
231
|
-
```
|
|
232
|
-
|
|
233
|
-
Current suite includes:
|
|
234
|
-
|
|
235
|
-
- Unit tests for `utils/date.ts`, `utils/timeline.ts`, `utils/criticalPath.ts`, `utils/dependencies.ts`
|
|
236
|
-
- Component tests for context menu and task bar rendering behavior
|
|
237
|
-
|
|
238
|
-
## Build and publish
|
|
239
|
-
|
|
240
|
-
Build outputs:
|
|
241
|
-
|
|
242
|
-
- ESM: `dist/zegantt.js`
|
|
243
|
-
- CJS: `dist/zegantt.cjs`
|
|
244
|
-
- Types: `dist/index.d.ts`
|
|
245
|
-
- Styles: `dist/zegantt.css`
|
|
246
|
-
|
|
247
|
-
Before publishing:
|
|
248
|
-
|
|
249
|
-
1. Run `npm run test`
|
|
250
|
-
2. Run `npm run build`
|
|
251
|
-
3. Verify `peerDependencies` resolution in consuming projects
|
|
252
|
-
|
|
253
|
-
## Storybook recommendation
|
|
254
|
-
|
|
255
|
-
For consumer-facing documentation, Storybook is strongly recommended to demonstrate:
|
|
256
|
-
|
|
257
|
-
- Large dataset performance scenarios
|
|
258
|
-
- Interaction flows (drag, resize, dependency creation)
|
|
259
|
-
- Theme variants
|
|
260
|
-
- Locale variants
|
|
1
|
+
# ZeGantt
|
|
2
|
+
|
|
3
|
+
ZeGantt is a React Gantt chart library focused on construction and project planning workflows.
|
|
4
|
+
|
|
5
|
+
## Highlights
|
|
6
|
+
|
|
7
|
+
- Virtualized rows and day-columns for large datasets (thousands of tasks)
|
|
8
|
+
- Drag, resize and dependency creation with mouse and touch support
|
|
9
|
+
- Keyboard navigation and accessibility attributes for enterprise use
|
|
10
|
+
- Theme tokens via CSS variables
|
|
11
|
+
- i18n with robust English fallback
|
|
12
|
+
- ESM + CJS builds with TypeScript declarations
|
|
13
|
+
|
|
14
|
+
## Install
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
npm install zegantt
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
### Required peer dependencies
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
npm install react react-dom lucide-react
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Minimal usage
|
|
27
|
+
|
|
28
|
+
```tsx
|
|
29
|
+
import { ProjectGantt, ptBR, type GanttStep } from 'zegantt';
|
|
30
|
+
import 'zegantt/style.css';
|
|
31
|
+
|
|
32
|
+
const steps: GanttStep[] = [
|
|
33
|
+
{
|
|
34
|
+
id: 's1',
|
|
35
|
+
name: 'Foundation',
|
|
36
|
+
startDate: '2026-01-10',
|
|
37
|
+
finishDate: '2026-01-20',
|
|
38
|
+
conclusionPercent: 45,
|
|
39
|
+
projectId: 'p1',
|
|
40
|
+
projectTitle: 'Residential Tower',
|
|
41
|
+
},
|
|
42
|
+
];
|
|
43
|
+
|
|
44
|
+
export function Example() {
|
|
45
|
+
return (
|
|
46
|
+
<ProjectGantt
|
|
47
|
+
steps={steps}
|
|
48
|
+
locale="pt-BR"
|
|
49
|
+
translations={ptBR}
|
|
50
|
+
groupByProject
|
|
51
|
+
onTaskChange={(task) => console.log('Task updated', task)}
|
|
52
|
+
/>
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## Data contracts
|
|
58
|
+
|
|
59
|
+
### Steps
|
|
60
|
+
|
|
61
|
+
```ts
|
|
62
|
+
interface GanttStep {
|
|
63
|
+
id: string;
|
|
64
|
+
name: string;
|
|
65
|
+
startDate?: Date | string;
|
|
66
|
+
finishDate?: Date | string;
|
|
67
|
+
previsionStartDate?: Date | string;
|
|
68
|
+
previsionFinishDate?: Date | string;
|
|
69
|
+
conclusionPercent?: number | string;
|
|
70
|
+
projectId?: string;
|
|
71
|
+
projectTitle?: string;
|
|
72
|
+
}
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### Milestones
|
|
76
|
+
|
|
77
|
+
```ts
|
|
78
|
+
interface GanttMilestone {
|
|
79
|
+
id: string;
|
|
80
|
+
name: string;
|
|
81
|
+
date?: Date | string;
|
|
82
|
+
finished?: boolean;
|
|
83
|
+
projectId?: string;
|
|
84
|
+
projectTitle?: string;
|
|
85
|
+
}
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### Events
|
|
89
|
+
|
|
90
|
+
```ts
|
|
91
|
+
interface GanttEvent {
|
|
92
|
+
id: string;
|
|
93
|
+
title: string;
|
|
94
|
+
date?: Date | string;
|
|
95
|
+
finished?: boolean;
|
|
96
|
+
projectId?: string;
|
|
97
|
+
projectTitle?: string;
|
|
98
|
+
}
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
### Notes
|
|
102
|
+
|
|
103
|
+
```ts
|
|
104
|
+
interface GanttNote {
|
|
105
|
+
id: string;
|
|
106
|
+
title: string;
|
|
107
|
+
targetId?: string;
|
|
108
|
+
predecessorId?: string;
|
|
109
|
+
description?: string;
|
|
110
|
+
author?: string;
|
|
111
|
+
date?: Date | string;
|
|
112
|
+
color?: string;
|
|
113
|
+
filesCount?: number;
|
|
114
|
+
projectId?: string;
|
|
115
|
+
projectTitle?: string;
|
|
116
|
+
}
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
### Dependencies
|
|
120
|
+
|
|
121
|
+
```ts
|
|
122
|
+
type PredecessorType = 'STEP' | 'MILESTONE';
|
|
123
|
+
type DependencyType = 'FS' | 'SS' | 'FF' | 'SF';
|
|
124
|
+
|
|
125
|
+
interface GanttDependency {
|
|
126
|
+
id: string;
|
|
127
|
+
predecessorId: string;
|
|
128
|
+
predecessorType: PredecessorType;
|
|
129
|
+
successorId: string;
|
|
130
|
+
successorType: PredecessorType;
|
|
131
|
+
type: DependencyType;
|
|
132
|
+
lag: number;
|
|
133
|
+
}
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
## Main props
|
|
137
|
+
|
|
138
|
+
```ts
|
|
139
|
+
interface ProjectGanttProps {
|
|
140
|
+
steps: GanttStep[];
|
|
141
|
+
milestones?: GanttMilestone[];
|
|
142
|
+
events?: GanttEvent[];
|
|
143
|
+
notes?: GanttNote[];
|
|
144
|
+
dependencies?: GanttDependency[];
|
|
145
|
+
|
|
146
|
+
loading?: boolean;
|
|
147
|
+
locale?: string;
|
|
148
|
+
groupByProject?: boolean;
|
|
149
|
+
translations?: Record<string, string> | ((key: string, fallback?: string) => string);
|
|
150
|
+
|
|
151
|
+
onTaskChange?: (task: GanttTask) => void;
|
|
152
|
+
onTaskClick?: (task: GanttTask) => void;
|
|
153
|
+
onCreateDependency?: (params: CreateDependencyParams) => Promise<void>;
|
|
154
|
+
onDeleteDependency?: (dependencyId: string) => Promise<void>;
|
|
155
|
+
onDependencyError?: (error: DependencyValidationError) => void;
|
|
156
|
+
|
|
157
|
+
onAddNewStage?: (date?: Date, projectId?: string) => void;
|
|
158
|
+
onAddMilestone?: (date?: Date, projectId?: string) => void;
|
|
159
|
+
onAddEvent?: (date?: Date, projectId?: string) => void;
|
|
160
|
+
onAddNote?: (date?: Date, projectId?: string) => void;
|
|
161
|
+
}
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
## Dependency cycle protection
|
|
165
|
+
|
|
166
|
+
ZeGantt blocks creation of circular dependencies (for example A -> B -> C -> A).
|
|
167
|
+
|
|
168
|
+
- If `onDependencyError` is provided, it receives a `CYCLIC_DEPENDENCY` error payload.
|
|
169
|
+
- If not provided, ZeGantt shows a default alert message.
|
|
170
|
+
|
|
171
|
+
## Accessibility and keyboard
|
|
172
|
+
|
|
173
|
+
- Interactive rows include semantic roles and keyboard handling
|
|
174
|
+
- Row navigation with arrow keys
|
|
175
|
+
- `Enter` opens task details (when callback exists)
|
|
176
|
+
- Focus-visible ring is provided by default CSS
|
|
177
|
+
|
|
178
|
+
## Mobile and touch
|
|
179
|
+
|
|
180
|
+
The library supports touch interactions for:
|
|
181
|
+
|
|
182
|
+
- Bar dragging
|
|
183
|
+
- Bar resizing
|
|
184
|
+
- Dependency connection handles
|
|
185
|
+
- Timeline panning
|
|
186
|
+
|
|
187
|
+
## Theming
|
|
188
|
+
|
|
189
|
+
ZeGantt exposes CSS variables that can be overridden globally or in a wrapper:
|
|
190
|
+
|
|
191
|
+
```css
|
|
192
|
+
.my-gantt-theme {
|
|
193
|
+
--zg-surface: #ffffff;
|
|
194
|
+
--zg-surface-alt: #f4f7f6;
|
|
195
|
+
--zg-header-bg: #e9efec;
|
|
196
|
+
--zg-border: #c9d2ce;
|
|
197
|
+
--zg-border-light: #dbe3df;
|
|
198
|
+
--zg-primary-color: #0f3d2f;
|
|
199
|
+
--zg-note-color: #ffd44d;
|
|
200
|
+
--zg-shadow-panel: 0 10px 30px rgba(0, 0, 0, 0.08);
|
|
201
|
+
}
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
Apply theme:
|
|
205
|
+
|
|
206
|
+
```tsx
|
|
207
|
+
<div className="my-gantt-theme">
|
|
208
|
+
<ProjectGantt steps={steps} />
|
|
209
|
+
</div>
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
## i18n
|
|
213
|
+
|
|
214
|
+
- Use `locale` (BCP 47, ex: `en-US`, `pt-BR`) to format dates and month labels.
|
|
215
|
+
- Provide `translations` as object or function.
|
|
216
|
+
- Missing keys fall back to English automatically.
|
|
217
|
+
|
|
218
|
+
Built-in helper export:
|
|
219
|
+
|
|
220
|
+
```ts
|
|
221
|
+
import { ptBR } from 'zegantt';
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
## Testing
|
|
225
|
+
|
|
226
|
+
Included scripts:
|
|
227
|
+
|
|
228
|
+
```bash
|
|
229
|
+
npm run test
|
|
230
|
+
npm run test:watch
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
Current suite includes:
|
|
234
|
+
|
|
235
|
+
- Unit tests for `utils/date.ts`, `utils/timeline.ts`, `utils/criticalPath.ts`, `utils/dependencies.ts`
|
|
236
|
+
- Component tests for context menu and task bar rendering behavior
|
|
237
|
+
|
|
238
|
+
## Build and publish
|
|
239
|
+
|
|
240
|
+
Build outputs:
|
|
241
|
+
|
|
242
|
+
- ESM: `dist/zegantt.js`
|
|
243
|
+
- CJS: `dist/zegantt.cjs`
|
|
244
|
+
- Types: `dist/index.d.ts`
|
|
245
|
+
- Styles: `dist/zegantt.css`
|
|
246
|
+
|
|
247
|
+
Before publishing:
|
|
248
|
+
|
|
249
|
+
1. Run `npm run test`
|
|
250
|
+
2. Run `npm run build`
|
|
251
|
+
3. Verify `peerDependencies` resolution in consuming projects
|
|
252
|
+
|
|
253
|
+
## Storybook recommendation
|
|
254
|
+
|
|
255
|
+
For consumer-facing documentation, Storybook is strongly recommended to demonstrate:
|
|
256
|
+
|
|
257
|
+
- Large dataset performance scenarios
|
|
258
|
+
- Interaction flows (drag, resize, dependency creation)
|
|
259
|
+
- Theme variants
|
|
260
|
+
- Locale variants
|