gantt-renderer 0.2.0 → 0.3.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/CHANGELOG.md +14 -0
- package/README.md +1 -1
- package/dist/index.d.mts +130 -78
- package/dist/index.mjs +832 -244
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
# [0.3.0](https://github.com/doberkofler/gantt-renderer/compare/v0.2.0...v0.3.0) (2026-05-08)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* correct link routing geometry and dependency layer rendering ([d00de8a](https://github.com/doberkofler/gantt-renderer/commit/d00de8a8b51d69b7b50ec4c6bf0ce6dd3657e1a8))
|
|
7
|
+
* **interaction:** deep-clone input in update() to prevent drag mutations leaking to consumer data ([ce814a0](https://github.com/doberkofler/gantt-renderer/commit/ce814a02bb87230108635ae663f165497f522f7e)), closes [#patchTask](https://github.com/doberkofler/gantt-renderer/issues/patchTask)
|
|
8
|
+
* **rendering:** offset multi-row link midpoint to avoid bar center slicing ([1fe09fa](https://github.com/doberkofler/gantt-renderer/commit/1fe09fa3d736cf948035c4f1619f398fa374464d))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
* **interaction:** add progress bar drag with progressDragEnabled option ([77833b5](https://github.com/doberkofler/gantt-renderer/commit/77833b50b5984158bd9a2ab3ddcc744d05ccb18f))
|
|
14
|
+
|
|
1
15
|
# [0.2.0](https://github.com/doberkofler/gantt-renderer/compare/v0.1.3...v0.2.0) (2026-05-07)
|
|
2
16
|
|
|
3
17
|
|
package/README.md
CHANGED
|
@@ -30,7 +30,7 @@ optimize timelines, resolve resource constraints, or perform planning logic itse
|
|
|
30
30
|
|
|
31
31
|
## Scope
|
|
32
32
|
|
|
33
|
-
The library is designed as a core chart component (`src/
|
|
33
|
+
The library is designed as a core chart component (`src/lib/**/*`) that your product can
|
|
34
34
|
embed. Outer-page/demo concerns (export toolbars, fullscreen shell controls, demo-only control
|
|
35
35
|
rows) are intentionally outside the core scope.
|
|
36
36
|
|
package/dist/index.d.mts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
|
|
3
|
-
//#region src/
|
|
3
|
+
//#region src/lib/validation/schemas.d.ts
|
|
4
4
|
declare const LinkTypeSchema: z.ZodEnum<{
|
|
5
5
|
FS: "FS";
|
|
6
6
|
SS: "SS";
|
|
7
7
|
FF: "FF";
|
|
8
8
|
SF: "SF";
|
|
9
9
|
}>;
|
|
10
|
-
declare const
|
|
10
|
+
declare const TaskKindSchema: z.ZodEnum<{
|
|
11
11
|
task: "task";
|
|
12
12
|
project: "project";
|
|
13
13
|
milestone: "milestone";
|
|
@@ -25,21 +25,36 @@ declare const SpecialDaySchema: z.ZodObject<{
|
|
|
25
25
|
label: z.ZodOptional<z.ZodString>;
|
|
26
26
|
className: z.ZodOptional<z.ZodString>;
|
|
27
27
|
}, z.core.$strip>;
|
|
28
|
-
declare const TaskSchema: z.ZodObject<{
|
|
28
|
+
declare const TaskSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
29
|
+
kind: z.ZodLiteral<"task">;
|
|
30
|
+
durationHours: z.ZodNumber;
|
|
31
|
+
percentComplete: z.ZodDefault<z.ZodNumber>;
|
|
29
32
|
id: z.ZodNumber;
|
|
30
33
|
text: z.ZodString;
|
|
31
34
|
startDate: z.ZodString;
|
|
32
|
-
durationHours: z.ZodNumber;
|
|
33
35
|
parent: z.ZodOptional<z.ZodNumber>;
|
|
36
|
+
color: z.ZodOptional<z.ZodString>;
|
|
37
|
+
data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
38
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
39
|
+
kind: z.ZodLiteral<"project">;
|
|
40
|
+
durationHours: z.ZodNumber;
|
|
34
41
|
percentComplete: z.ZodDefault<z.ZodNumber>;
|
|
35
|
-
type: z.ZodDefault<z.ZodEnum<{
|
|
36
|
-
task: "task";
|
|
37
|
-
project: "project";
|
|
38
|
-
milestone: "milestone";
|
|
39
|
-
}>>;
|
|
40
42
|
open: z.ZodDefault<z.ZodBoolean>;
|
|
43
|
+
id: z.ZodNumber;
|
|
44
|
+
text: z.ZodString;
|
|
45
|
+
startDate: z.ZodString;
|
|
46
|
+
parent: z.ZodOptional<z.ZodNumber>;
|
|
41
47
|
color: z.ZodOptional<z.ZodString>;
|
|
42
|
-
|
|
48
|
+
data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
49
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
50
|
+
kind: z.ZodLiteral<"milestone">;
|
|
51
|
+
id: z.ZodNumber;
|
|
52
|
+
text: z.ZodString;
|
|
53
|
+
startDate: z.ZodString;
|
|
54
|
+
parent: z.ZodOptional<z.ZodNumber>;
|
|
55
|
+
color: z.ZodOptional<z.ZodString>;
|
|
56
|
+
data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
57
|
+
}, z.core.$strip>], "kind">;
|
|
43
58
|
declare const LinkSchema: z.ZodObject<{
|
|
44
59
|
id: z.ZodNumber;
|
|
45
60
|
source: z.ZodNumber;
|
|
@@ -50,23 +65,39 @@ declare const LinkSchema: z.ZodObject<{
|
|
|
50
65
|
FF: "FF";
|
|
51
66
|
SF: "SF";
|
|
52
67
|
}>>;
|
|
68
|
+
data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
53
69
|
}, z.core.$strip>;
|
|
54
70
|
declare const GanttInputSchema: z.ZodObject<{
|
|
55
|
-
tasks: z.ZodArray<z.ZodObject<{
|
|
71
|
+
tasks: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
72
|
+
kind: z.ZodLiteral<"task">;
|
|
73
|
+
durationHours: z.ZodNumber;
|
|
74
|
+
percentComplete: z.ZodDefault<z.ZodNumber>;
|
|
56
75
|
id: z.ZodNumber;
|
|
57
76
|
text: z.ZodString;
|
|
58
77
|
startDate: z.ZodString;
|
|
59
|
-
durationHours: z.ZodNumber;
|
|
60
78
|
parent: z.ZodOptional<z.ZodNumber>;
|
|
79
|
+
color: z.ZodOptional<z.ZodString>;
|
|
80
|
+
data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
81
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
82
|
+
kind: z.ZodLiteral<"project">;
|
|
83
|
+
durationHours: z.ZodNumber;
|
|
61
84
|
percentComplete: z.ZodDefault<z.ZodNumber>;
|
|
62
|
-
type: z.ZodDefault<z.ZodEnum<{
|
|
63
|
-
task: "task";
|
|
64
|
-
project: "project";
|
|
65
|
-
milestone: "milestone";
|
|
66
|
-
}>>;
|
|
67
85
|
open: z.ZodDefault<z.ZodBoolean>;
|
|
86
|
+
id: z.ZodNumber;
|
|
87
|
+
text: z.ZodString;
|
|
88
|
+
startDate: z.ZodString;
|
|
89
|
+
parent: z.ZodOptional<z.ZodNumber>;
|
|
68
90
|
color: z.ZodOptional<z.ZodString>;
|
|
69
|
-
|
|
91
|
+
data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
92
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
93
|
+
kind: z.ZodLiteral<"milestone">;
|
|
94
|
+
id: z.ZodNumber;
|
|
95
|
+
text: z.ZodString;
|
|
96
|
+
startDate: z.ZodString;
|
|
97
|
+
parent: z.ZodOptional<z.ZodNumber>;
|
|
98
|
+
color: z.ZodOptional<z.ZodString>;
|
|
99
|
+
data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
100
|
+
}, z.core.$strip>], "kind">>;
|
|
70
101
|
links: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
71
102
|
id: z.ZodNumber;
|
|
72
103
|
source: z.ZodNumber;
|
|
@@ -77,19 +108,24 @@ declare const GanttInputSchema: z.ZodObject<{
|
|
|
77
108
|
FF: "FF";
|
|
78
109
|
SF: "SF";
|
|
79
110
|
}>>;
|
|
111
|
+
data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
80
112
|
}, z.core.$strip>>>;
|
|
81
113
|
}, z.core.$strip>;
|
|
82
114
|
/** The raw, unvalidated input shape that consumers pass to {@link parseGanttInput}. */
|
|
83
115
|
type GanttInputRaw = z.input<typeof GanttInputSchema>;
|
|
84
116
|
/** Allowed dependency link type values: `'FS'`, `'SS'`, `'FF'`, or `'SF'`. */
|
|
85
117
|
type LinkType = z.infer<typeof LinkTypeSchema>;
|
|
86
|
-
/** Allowed task
|
|
87
|
-
type
|
|
118
|
+
/** Allowed task kind values: `'task'`, `'project'`, or `'milestone'`. */
|
|
119
|
+
type TaskKind = z.infer<typeof TaskKindSchema>;
|
|
88
120
|
type SpecialDayKind = z.infer<typeof SpecialDayKindSchema>;
|
|
89
121
|
type SpecialDay = z.infer<typeof SpecialDaySchema>;
|
|
90
122
|
/**
|
|
91
|
-
* A
|
|
92
|
-
*
|
|
123
|
+
* A task in the Gantt chart — discriminated by `kind` into leaf tasks,
|
|
124
|
+
* summary projects, and milestones.
|
|
125
|
+
*
|
|
126
|
+
* - **`kind: 'task'`** — A regular task with a colored bar and duration.
|
|
127
|
+
* - **`kind: 'project'`** — A summary/group row with a colored bar and optional tree state.
|
|
128
|
+
* - **`kind: 'milestone'`** — A zero-duration marker rendered as a diamond.
|
|
93
129
|
*/
|
|
94
130
|
type Task = z.infer<typeof TaskSchema>;
|
|
95
131
|
/**
|
|
@@ -112,15 +148,8 @@ type GanttInput = z.infer<typeof GanttInputSchema>;
|
|
|
112
148
|
* @throws {import('zod').ZodError} On schema validation failure.
|
|
113
149
|
*/
|
|
114
150
|
declare function parseGanttInput(raw: GanttInputRaw): GanttInput;
|
|
115
|
-
/**
|
|
116
|
-
* Parses without throwing; returns `null` on validation failure.
|
|
117
|
-
*
|
|
118
|
-
* @param raw - The unvalidated input from the consumer.
|
|
119
|
-
* @returns The parsed {@link GanttInput} or `null` when the input is invalid.
|
|
120
|
-
*/
|
|
121
|
-
declare function safeParseGanttInput(raw: GanttInputRaw): GanttInput | null;
|
|
122
151
|
//#endregion
|
|
123
|
-
//#region src/
|
|
152
|
+
//#region src/lib/timeline/scale.d.ts
|
|
124
153
|
type TimeScale = 'hour' | 'day' | 'week' | 'month' | 'quarter' | 'year';
|
|
125
154
|
type ScaleConfig = {
|
|
126
155
|
/** Pixel width of one column unit */columnWidth: number; /** Milliseconds per column unit */
|
|
@@ -129,7 +158,7 @@ type ScaleConfig = {
|
|
|
129
158
|
};
|
|
130
159
|
declare const SCALE_CONFIGS: Record<TimeScale, ScaleConfig>;
|
|
131
160
|
//#endregion
|
|
132
|
-
//#region src/
|
|
161
|
+
//#region src/lib/domain/tree.d.ts
|
|
133
162
|
/**
|
|
134
163
|
* A task node in the render tree, combining the flat {@link Task} input data
|
|
135
164
|
* with computed hierarchy structure.
|
|
@@ -147,7 +176,9 @@ type TaskNode = Task & {
|
|
|
147
176
|
*
|
|
148
177
|
* @param tasks - The flat array of tasks to convert into a tree.
|
|
149
178
|
* @returns Root-level {@link TaskNode} instances with populated `children`.
|
|
150
|
-
* @throws {GanttError} When a task references a `parent` id that does not exist
|
|
179
|
+
* @throws {GanttError} When a task references a `parent` id that does not exist,
|
|
180
|
+
* when a parent cycle is detected, or when a `parent` points to a
|
|
181
|
+
* milestone or leaf task.
|
|
151
182
|
*/
|
|
152
183
|
declare function buildTaskTree(tasks: Task[]): TaskNode[];
|
|
153
184
|
/**
|
|
@@ -167,7 +198,7 @@ declare function flattenTree(roots: TaskNode[], expandedIds: ReadonlySet<number>
|
|
|
167
198
|
*/
|
|
168
199
|
declare function isParent(node: TaskNode): boolean;
|
|
169
200
|
//#endregion
|
|
170
|
-
//#region src/
|
|
201
|
+
//#region src/lib/timeline/pixelMapper.d.ts
|
|
171
202
|
type PixelMapper = {
|
|
172
203
|
/** Date → x pixel offset from viewport start */toX: (date: Date) => number; /** x pixel offset → Date */
|
|
173
204
|
toDate: (x: number) => Date; /** Hours → pixel width */
|
|
@@ -186,7 +217,7 @@ type PixelMapper = {
|
|
|
186
217
|
*/
|
|
187
218
|
declare function createPixelMapper(scale: TimeScale, viewportStart: Date): PixelMapper;
|
|
188
219
|
//#endregion
|
|
189
|
-
//#region src/
|
|
220
|
+
//#region src/lib/timeline/layoutEngine.d.ts
|
|
190
221
|
declare const DENSITY: {
|
|
191
222
|
readonly rowHeight: 44;
|
|
192
223
|
readonly barHeight: 28;
|
|
@@ -205,7 +236,7 @@ type BarLayout = {
|
|
|
205
236
|
width: number;
|
|
206
237
|
height: number;
|
|
207
238
|
progressWidth: number;
|
|
208
|
-
|
|
239
|
+
kind: 'task' | 'project' | 'milestone';
|
|
209
240
|
rowIndex: number; /** Center x; identical to x + width/2 or x for milestones */
|
|
210
241
|
centerX: number;
|
|
211
242
|
centerY: number;
|
|
@@ -228,7 +259,7 @@ declare function computeLayout(rows: TaskNode[], mapper: PixelMapper): Map<numbe
|
|
|
228
259
|
*/
|
|
229
260
|
declare function deriveViewport(tasks: TaskNode[], paddingHours?: number): [Date, Date];
|
|
230
261
|
//#endregion
|
|
231
|
-
//#region src/
|
|
262
|
+
//#region src/lib/locale.d.ts
|
|
232
263
|
type LocaleLabelKey = 'ariaTask' | 'ariaMilestone' | 'addSubtaskTitle' | 'columnTaskName' | 'columnStartDate' | 'columnDuration' | 'columnQuarter';
|
|
233
264
|
type ChartLocale = {
|
|
234
265
|
code: string;
|
|
@@ -293,7 +324,7 @@ declare function formatWeekNumber(date: Date, scheme: 'iso' | 'us' | 'simple'):
|
|
|
293
324
|
*/
|
|
294
325
|
declare function formatLabel(template: string, arg: string): string;
|
|
295
326
|
//#endregion
|
|
296
|
-
//#region src/
|
|
327
|
+
//#region src/lib/domain/dependencies.d.ts
|
|
297
328
|
/**
|
|
298
329
|
* Detects circular dependencies in the link graph using DFS tri-colour marking.
|
|
299
330
|
*
|
|
@@ -303,15 +334,18 @@ declare function formatLabel(template: string, arg: string): string;
|
|
|
303
334
|
*/
|
|
304
335
|
declare function detectCycles(tasks: Task[], links: Link[]): void;
|
|
305
336
|
/**
|
|
306
|
-
* Validates that every link references existing task IDs
|
|
337
|
+
* Validates that every link references existing task IDs and that no
|
|
338
|
+
* duplicate (source, target) pairs exist.
|
|
307
339
|
*
|
|
308
340
|
* @param tasks - The task list (used as the reference set of valid IDs).
|
|
309
341
|
* @param links - The dependency links to validate.
|
|
310
|
-
* @throws {GanttError} When any link references a non-existent source or target task
|
|
342
|
+
* @throws {GanttError} When any link references a non-existent source or target task,
|
|
343
|
+
* when a non-FS link connects to/from a milestone, or when duplicate
|
|
344
|
+
* (source, target) pairs exist.
|
|
311
345
|
*/
|
|
312
346
|
declare function validateLinkRefs(tasks: Task[], links: Link[]): void;
|
|
313
347
|
//#endregion
|
|
314
|
-
//#region src/
|
|
348
|
+
//#region src/lib/domain/dateMath.d.ts
|
|
315
349
|
/**
|
|
316
350
|
* Parses `YYYY-MM-DD` → UTC midnight `Date`.
|
|
317
351
|
*
|
|
@@ -353,7 +387,7 @@ declare function diffDays(a: Date, b: Date): number;
|
|
|
353
387
|
*/
|
|
354
388
|
declare function diffHours(a: Date, b: Date): number;
|
|
355
389
|
//#endregion
|
|
356
|
-
//#region src/
|
|
390
|
+
//#region src/lib/rendering/linkRouter.d.ts
|
|
357
391
|
type Point = {
|
|
358
392
|
x: number;
|
|
359
393
|
y: number;
|
|
@@ -361,7 +395,8 @@ type Point = {
|
|
|
361
395
|
type RoutedLink = {
|
|
362
396
|
linkId: number;
|
|
363
397
|
sourceTaskId: number;
|
|
364
|
-
targetTaskId: number;
|
|
398
|
+
targetTaskId: number;
|
|
399
|
+
type: LinkType; /** Ordered vertices of the orthogonal polyline (source → target). */
|
|
365
400
|
points: Point[];
|
|
366
401
|
};
|
|
367
402
|
/**
|
|
@@ -369,20 +404,26 @@ type RoutedLink = {
|
|
|
369
404
|
* Links whose source or target is not in the layout map are skipped silently
|
|
370
405
|
* (e.g. when the row is collapsed).
|
|
371
406
|
*
|
|
372
|
-
* @param links
|
|
407
|
+
* @param links - The dependency links to route.
|
|
373
408
|
* @param layouts - A map from task ID to its computed {@link BarLayout}.
|
|
374
409
|
* @returns An array of {@link RoutedLink} objects with computed vertex paths.
|
|
375
410
|
*/
|
|
376
411
|
declare function routeLinks(links: Link[], layouts: Map<number, BarLayout>): RoutedLink[];
|
|
377
412
|
//#endregion
|
|
378
|
-
//#region src/
|
|
413
|
+
//#region src/lib/vanilla/dom/gridColumns.d.ts
|
|
414
|
+
/**
|
|
415
|
+
* Union of all field names that can appear on any {@link Task} variant.
|
|
416
|
+
* Use when referencing task fields in grid column schemas that apply
|
|
417
|
+
* across a heterogeneous set of task kinds.
|
|
418
|
+
*/
|
|
419
|
+
type TaskDataField = keyof Task | 'durationHours' | 'percentComplete' | 'open';
|
|
379
420
|
type GridColumn = {
|
|
380
421
|
id: string;
|
|
381
422
|
header: string;
|
|
382
423
|
width: string;
|
|
383
424
|
align?: 'left' | 'center' | 'right';
|
|
384
425
|
visible?: boolean;
|
|
385
|
-
field?:
|
|
426
|
+
field?: TaskDataField;
|
|
386
427
|
format?: (value: unknown, task: Task, row: TaskNode, locale: ChartLocale) => string;
|
|
387
428
|
};
|
|
388
429
|
declare const DEFAULT_GRID_COLUMNS: GridColumn[];
|
|
@@ -418,42 +459,49 @@ declare const GRID_COLUMN_FR_MIN_WIDTH = 120;
|
|
|
418
459
|
*/
|
|
419
460
|
declare function gridNaturalWidth(columns: GridColumn[]): number;
|
|
420
461
|
//#endregion
|
|
421
|
-
//#region src/
|
|
422
|
-
type OnTaskSelect = (
|
|
423
|
-
|
|
424
|
-
id: number;
|
|
425
|
-
startDate: Date;
|
|
462
|
+
//#region src/lib/vanilla/gantt-chart.d.ts
|
|
463
|
+
type OnTaskSelect = (payload: {
|
|
464
|
+
task: Task;
|
|
426
465
|
}) => void;
|
|
466
|
+
type OnTaskMove = (payload: {
|
|
467
|
+
task: Task;
|
|
468
|
+
newStartDate: Date;
|
|
469
|
+
}) => boolean;
|
|
427
470
|
type OnTaskResize = (payload: {
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
}) =>
|
|
471
|
+
task: Task;
|
|
472
|
+
newDurationHours: number;
|
|
473
|
+
}) => boolean;
|
|
431
474
|
type OnTaskAdd = (payload: {
|
|
432
|
-
|
|
433
|
-
}) =>
|
|
475
|
+
parentTask: Task;
|
|
476
|
+
}) => boolean;
|
|
434
477
|
type OnTaskDoubleClick = (payload: {
|
|
435
|
-
id: number;
|
|
436
|
-
source: 'grid' | 'bar' | 'milestone';
|
|
437
|
-
}) => void;
|
|
438
|
-
type OnTaskEditIntent = (payload: {
|
|
439
|
-
id: number;
|
|
440
|
-
source: 'grid' | 'bar' | 'milestone';
|
|
441
|
-
trigger: 'doubleClick';
|
|
442
478
|
task: Task;
|
|
443
479
|
}) => void;
|
|
444
480
|
type OnLinkCreate = (payload: {
|
|
445
|
-
sourceTaskId: number;
|
|
446
|
-
targetTaskId: number;
|
|
447
481
|
type: 'FS';
|
|
482
|
+
sourceTask: Task;
|
|
483
|
+
targetTask: Task;
|
|
484
|
+
}) => boolean;
|
|
485
|
+
type OnLinkClick = (payload: {
|
|
486
|
+
link: Link;
|
|
448
487
|
}) => void;
|
|
488
|
+
type OnLinkDblClick = (payload: {
|
|
489
|
+
link: Link;
|
|
490
|
+
}) => void;
|
|
491
|
+
type OnProgressChange = (payload: {
|
|
492
|
+
task: Task;
|
|
493
|
+
newPercentComplete: number;
|
|
494
|
+
}) => boolean;
|
|
449
495
|
type GanttCallbacks = {
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
496
|
+
onTaskSelect?: OnTaskSelect;
|
|
497
|
+
onTaskMove?: OnTaskMove;
|
|
498
|
+
onTaskResize?: OnTaskResize;
|
|
499
|
+
onTaskAdd?: OnTaskAdd;
|
|
454
500
|
onTaskDoubleClick?: OnTaskDoubleClick;
|
|
455
|
-
onTaskEditIntent?: OnTaskEditIntent;
|
|
456
501
|
onLinkCreate?: OnLinkCreate;
|
|
502
|
+
onLinkClick?: OnLinkClick;
|
|
503
|
+
onLinkDblClick?: OnLinkDblClick;
|
|
504
|
+
onProgressChange?: OnProgressChange;
|
|
457
505
|
onLeftPaneWidthChange?: (width: number) => void;
|
|
458
506
|
onGridColumnsChange?: (columns: GridColumn[]) => void;
|
|
459
507
|
};
|
|
@@ -462,6 +510,7 @@ type GanttOptions = {
|
|
|
462
510
|
scale?: TimeScale;
|
|
463
511
|
highlightLinkedDependenciesOnSelect?: boolean;
|
|
464
512
|
linkCreationEnabled?: boolean;
|
|
513
|
+
progressDragEnabled?: boolean;
|
|
465
514
|
leftPaneWidth?: number;
|
|
466
515
|
responsiveSplitPane?: boolean;
|
|
467
516
|
mobileBreakpoint?: number;
|
|
@@ -477,10 +526,10 @@ type GanttOptions = {
|
|
|
477
526
|
specialDays?: SpecialDay[];
|
|
478
527
|
gridColumns?: GridColumn[];
|
|
479
528
|
theme?: ThemeMode;
|
|
480
|
-
}
|
|
529
|
+
};
|
|
481
530
|
type GanttInstance = {
|
|
482
531
|
update: (input: GanttInput) => void;
|
|
483
|
-
|
|
532
|
+
setOptions: (opts: Partial<GanttOptions>) => void;
|
|
484
533
|
select: (id: number | null) => void;
|
|
485
534
|
collapseAll: () => void;
|
|
486
535
|
expandAll: () => void;
|
|
@@ -508,7 +557,7 @@ declare class GanttChart implements GanttInstance {
|
|
|
508
557
|
* @param container - The host `HTMLElement` the chart will be appended to.
|
|
509
558
|
* @param opts - Configuration and callback options.
|
|
510
559
|
*/
|
|
511
|
-
constructor(container: HTMLElement, opts?: GanttOptions);
|
|
560
|
+
constructor(container: HTMLElement, opts?: GanttOptions, cbs?: GanttCallbacks);
|
|
512
561
|
/**
|
|
513
562
|
* Replaces the full dataset and re-renders.
|
|
514
563
|
*
|
|
@@ -517,12 +566,15 @@ declare class GanttChart implements GanttInstance {
|
|
|
517
566
|
*/
|
|
518
567
|
update(newInput: GanttInput): void;
|
|
519
568
|
/**
|
|
520
|
-
*
|
|
569
|
+
* Merges the supplied options into the current configuration and re-renders
|
|
570
|
+
* only the panes affected by the changed options.
|
|
521
571
|
*
|
|
522
|
-
* @param
|
|
572
|
+
* @param opts - A partial {@link GanttOptions} object. Only the keys present
|
|
573
|
+
* in this parameter are updated; missing keys keep their
|
|
574
|
+
* previous values.
|
|
523
575
|
* @throws {GanttError} When the instance has been destroyed.
|
|
524
576
|
*/
|
|
525
|
-
|
|
577
|
+
setOptions(opts: Partial<GanttOptions>): void;
|
|
526
578
|
/**
|
|
527
579
|
* Programmatically selects or deselects a task.
|
|
528
580
|
*
|
|
@@ -549,8 +601,8 @@ declare class GanttChart implements GanttInstance {
|
|
|
549
601
|
destroy(): void;
|
|
550
602
|
}
|
|
551
603
|
//#endregion
|
|
552
|
-
//#region src/
|
|
553
|
-
type GanttErrorCode = 'PARENT_REFERENCE' | 'LINK_REFERENCE' | 'DEPENDENCY_CYCLE' | 'INSTANCE_DESTROYED';
|
|
604
|
+
//#region src/lib/errors.d.ts
|
|
605
|
+
type GanttErrorCode = 'PARENT_REFERENCE' | 'PARENT_CYCLE' | 'LINK_REFERENCE' | 'DEPENDENCY_CYCLE' | 'MILESTONE_LINK_TYPE' | 'DUPLICATE_LINK_PAIR' | 'INSTANCE_DESTROYED';
|
|
554
606
|
/**
|
|
555
607
|
* Domain-specific error with a machine-readable {@link GanttErrorCode}.
|
|
556
608
|
*/
|
|
@@ -563,5 +615,5 @@ declare class GanttError extends Error {
|
|
|
563
615
|
constructor(code: GanttErrorCode, message: string);
|
|
564
616
|
}
|
|
565
617
|
//#endregion
|
|
566
|
-
export { BAR_HEIGHT, BAR_Y_OFFSET, type BarLayout, CHART_LOCALE_EN_US, type ChartLocale, DEFAULT_GRID_COLUMNS, DENSITY, EN_US_LABELS, GRID_COLUMN_FR_MIN_WIDTH, type GanttCallbacks, GanttChart, GanttError, type GanttErrorCode, type GanttInput, type GanttInputRaw, GanttInputSchema, type GanttInstance, type GanttOptions, type GridColumn, type Link, LinkSchema, type LinkType, LinkTypeSchema, type LocaleLabelKey, MILESTONE_HALF, MILESTONE_SIZE, type OnLinkCreate, type
|
|
618
|
+
export { BAR_HEIGHT, BAR_Y_OFFSET, type BarLayout, CHART_LOCALE_EN_US, type ChartLocale, DEFAULT_GRID_COLUMNS, DENSITY, EN_US_LABELS, GRID_COLUMN_FR_MIN_WIDTH, type GanttCallbacks, GanttChart, GanttError, type GanttErrorCode, type GanttInput, type GanttInputRaw, GanttInputSchema, type GanttInstance, type GanttOptions, type GridColumn, type Link, LinkSchema, type LinkType, LinkTypeSchema, type LocaleLabelKey, MILESTONE_HALF, MILESTONE_SIZE, type OnLinkClick, type OnLinkCreate, type OnLinkDblClick, type OnProgressChange, type OnTaskAdd, type OnTaskDoubleClick, type OnTaskMove, type OnTaskResize, type OnTaskSelect, type PixelMapper, type Point, ROW_HEIGHT, type RoutedLink, SCALE_CONFIGS, type ScaleConfig, type SpecialDay, type SpecialDayKind, SpecialDayKindSchema, SpecialDaySchema, type Task, type TaskDataField, type TaskKind, TaskKindSchema, type TaskNode, TaskSchema, type ThemeMode, type TimeScale, addDays, addHours, buildTaskTree, computeLayout, createPixelMapper, deriveViewport, deriveWeekNumbering, deriveWeekStartsOn, deriveWeekendDays, detectCycles, diffDays, diffHours, flattenTree, formatLabel, formatWeekNumber, gridColumnDefaults, gridNaturalWidth, gridTemplateColumns, isParent, parseDate, parseGanttInput, resolveChartLocale, routeLinks, validateLinkRefs, visibleColumns };
|
|
567
619
|
//# sourceMappingURL=index.d.mts.map
|