gantt-renderer 0.7.0 → 0.9.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.
Files changed (148) hide show
  1. package/CHANGELOG.md +38 -1
  2. package/README.md +3 -4
  3. package/dist/index.d.mts +107 -192
  4. package/dist/index.mjs +191 -327
  5. package/dist/index.mjs.map +1 -1
  6. package/dist/locale-BQKHOEOx.d.mts +66 -0
  7. package/dist/locales/all.d.mts +7 -0
  8. package/dist/locales/all.mjs +95 -0
  9. package/dist/locales/all.mjs.map +1 -0
  10. package/dist/locales/ar.d.mts +7 -0
  11. package/dist/locales/ar.mjs +21 -0
  12. package/dist/locales/ar.mjs.map +1 -0
  13. package/dist/locales/be.d.mts +7 -0
  14. package/dist/locales/be.mjs +21 -0
  15. package/dist/locales/be.mjs.map +1 -0
  16. package/dist/locales/bg.d.mts +7 -0
  17. package/dist/locales/bg.mjs +21 -0
  18. package/dist/locales/bg.mjs.map +1 -0
  19. package/dist/locales/ca.d.mts +7 -0
  20. package/dist/locales/ca.mjs +21 -0
  21. package/dist/locales/ca.mjs.map +1 -0
  22. package/dist/locales/cs.d.mts +7 -0
  23. package/dist/locales/cs.mjs +21 -0
  24. package/dist/locales/cs.mjs.map +1 -0
  25. package/dist/locales/cy.d.mts +7 -0
  26. package/dist/locales/cy.mjs +21 -0
  27. package/dist/locales/cy.mjs.map +1 -0
  28. package/dist/locales/da.d.mts +7 -0
  29. package/dist/locales/da.mjs +21 -0
  30. package/dist/locales/da.mjs.map +1 -0
  31. package/dist/locales/de.d.mts +7 -0
  32. package/dist/locales/de.mjs +21 -0
  33. package/dist/locales/de.mjs.map +1 -0
  34. package/dist/locales/el.d.mts +7 -0
  35. package/dist/locales/el.mjs +21 -0
  36. package/dist/locales/el.mjs.map +1 -0
  37. package/dist/locales/en.d.mts +7 -0
  38. package/dist/locales/en.mjs +21 -0
  39. package/dist/locales/en.mjs.map +1 -0
  40. package/dist/locales/es.d.mts +7 -0
  41. package/dist/locales/es.mjs +21 -0
  42. package/dist/locales/es.mjs.map +1 -0
  43. package/dist/locales/et.d.mts +7 -0
  44. package/dist/locales/et.mjs +21 -0
  45. package/dist/locales/et.mjs.map +1 -0
  46. package/dist/locales/eu.d.mts +7 -0
  47. package/dist/locales/eu.mjs +21 -0
  48. package/dist/locales/eu.mjs.map +1 -0
  49. package/dist/locales/fi.d.mts +7 -0
  50. package/dist/locales/fi.mjs +21 -0
  51. package/dist/locales/fi.mjs.map +1 -0
  52. package/dist/locales/fr.d.mts +7 -0
  53. package/dist/locales/fr.mjs +21 -0
  54. package/dist/locales/fr.mjs.map +1 -0
  55. package/dist/locales/ga.d.mts +7 -0
  56. package/dist/locales/ga.mjs +21 -0
  57. package/dist/locales/ga.mjs.map +1 -0
  58. package/dist/locales/hi.d.mts +7 -0
  59. package/dist/locales/hi.mjs +21 -0
  60. package/dist/locales/hi.mjs.map +1 -0
  61. package/dist/locales/hr.d.mts +7 -0
  62. package/dist/locales/hr.mjs +21 -0
  63. package/dist/locales/hr.mjs.map +1 -0
  64. package/dist/locales/hu.d.mts +7 -0
  65. package/dist/locales/hu.mjs +21 -0
  66. package/dist/locales/hu.mjs.map +1 -0
  67. package/dist/locales/id.d.mts +7 -0
  68. package/dist/locales/id.mjs +21 -0
  69. package/dist/locales/id.mjs.map +1 -0
  70. package/dist/locales/it.d.mts +7 -0
  71. package/dist/locales/it.mjs +21 -0
  72. package/dist/locales/it.mjs.map +1 -0
  73. package/dist/locales/ja.d.mts +7 -0
  74. package/dist/locales/ja.mjs +21 -0
  75. package/dist/locales/ja.mjs.map +1 -0
  76. package/dist/locales/ko.d.mts +7 -0
  77. package/dist/locales/ko.mjs +21 -0
  78. package/dist/locales/ko.mjs.map +1 -0
  79. package/dist/locales/load.d.mts +8 -0
  80. package/dist/locales/load.mjs +57 -0
  81. package/dist/locales/load.mjs.map +1 -0
  82. package/dist/locales/lt.d.mts +7 -0
  83. package/dist/locales/lt.mjs +21 -0
  84. package/dist/locales/lt.mjs.map +1 -0
  85. package/dist/locales/lv.d.mts +7 -0
  86. package/dist/locales/lv.mjs +21 -0
  87. package/dist/locales/lv.mjs.map +1 -0
  88. package/dist/locales/mk.d.mts +7 -0
  89. package/dist/locales/mk.mjs +21 -0
  90. package/dist/locales/mk.mjs.map +1 -0
  91. package/dist/locales/mt.d.mts +7 -0
  92. package/dist/locales/mt.mjs +21 -0
  93. package/dist/locales/mt.mjs.map +1 -0
  94. package/dist/locales/nb.d.mts +7 -0
  95. package/dist/locales/nb.mjs +21 -0
  96. package/dist/locales/nb.mjs.map +1 -0
  97. package/dist/locales/nl.d.mts +7 -0
  98. package/dist/locales/nl.mjs +21 -0
  99. package/dist/locales/nl.mjs.map +1 -0
  100. package/dist/locales/pl.d.mts +7 -0
  101. package/dist/locales/pl.mjs +21 -0
  102. package/dist/locales/pl.mjs.map +1 -0
  103. package/dist/locales/pt-BR.d.mts +7 -0
  104. package/dist/locales/pt-BR.mjs +21 -0
  105. package/dist/locales/pt-BR.mjs.map +1 -0
  106. package/dist/locales/pt-PT.d.mts +7 -0
  107. package/dist/locales/pt-PT.mjs +21 -0
  108. package/dist/locales/pt-PT.mjs.map +1 -0
  109. package/dist/locales/registry.d.mts +9 -0
  110. package/dist/locales/registry.mjs +15 -0
  111. package/dist/locales/registry.mjs.map +1 -0
  112. package/dist/locales/ro.d.mts +7 -0
  113. package/dist/locales/ro.mjs +21 -0
  114. package/dist/locales/ro.mjs.map +1 -0
  115. package/dist/locales/ru.d.mts +7 -0
  116. package/dist/locales/ru.mjs +21 -0
  117. package/dist/locales/ru.mjs.map +1 -0
  118. package/dist/locales/sk.d.mts +7 -0
  119. package/dist/locales/sk.mjs +21 -0
  120. package/dist/locales/sk.mjs.map +1 -0
  121. package/dist/locales/sl.d.mts +7 -0
  122. package/dist/locales/sl.mjs +21 -0
  123. package/dist/locales/sl.mjs.map +1 -0
  124. package/dist/locales/sq.d.mts +7 -0
  125. package/dist/locales/sq.mjs +21 -0
  126. package/dist/locales/sq.mjs.map +1 -0
  127. package/dist/locales/sr.d.mts +7 -0
  128. package/dist/locales/sr.mjs +21 -0
  129. package/dist/locales/sr.mjs.map +1 -0
  130. package/dist/locales/sv.d.mts +7 -0
  131. package/dist/locales/sv.mjs +21 -0
  132. package/dist/locales/sv.mjs.map +1 -0
  133. package/dist/locales/th.d.mts +7 -0
  134. package/dist/locales/th.mjs +21 -0
  135. package/dist/locales/th.mjs.map +1 -0
  136. package/dist/locales/tr.d.mts +7 -0
  137. package/dist/locales/tr.mjs +21 -0
  138. package/dist/locales/tr.mjs.map +1 -0
  139. package/dist/locales/uk.d.mts +7 -0
  140. package/dist/locales/uk.mjs +21 -0
  141. package/dist/locales/uk.mjs.map +1 -0
  142. package/dist/locales/zh-Hans.d.mts +7 -0
  143. package/dist/locales/zh-Hans.mjs +21 -0
  144. package/dist/locales/zh-Hans.mjs.map +1 -0
  145. package/dist/locales/zh-Hant.d.mts +7 -0
  146. package/dist/locales/zh-Hant.mjs +21 -0
  147. package/dist/locales/zh-Hant.mjs.map +1 -0
  148. package/package.json +201 -15
package/CHANGELOG.md CHANGED
@@ -1,12 +1,49 @@
1
+ # [0.9.0](https://github.com/doberkofler/gantt-renderer/compare/v0.8.0...v0.9.0) (2026-05-13)
2
+
3
+
4
+ ### Features
5
+
6
+ * **locales:** modular locale system with 43 languages via subpath exports ([4866724](https://github.com/doberkofler/gantt-renderer/commit/48667247005c245fd55b9421012e03ec13d82ba1))
7
+ * **vanilla:** add showTodayMarker option to toggle current-date line ([49ddc0f](https://github.com/doberkofler/gantt-renderer/commit/49ddc0fa1e00356403df286e99df71242cca0b01))
8
+
9
+ # [0.8.0](https://github.com/doberkofler/gantt-renderer/compare/v0.7.0...v0.8.0) (2026-05-12)
10
+
11
+
12
+ ### Bug Fixes
13
+
14
+ * **gantt:** free actions column space when showAddTaskButton is disabled ([464c5cd](https://github.com/doberkofler/gantt-renderer/commit/464c5cda446828c7a0a8ca2b6e5f6a226f37aef4))
15
+ * **interaction:** remove duplicate dblclick handler causing double callback fire ([df6500a](https://github.com/doberkofler/gantt-renderer/commit/df6500a9be31818f8a79cc94a33326a81793e7e3))
16
+
17
+
18
+ ### Features
19
+
20
+ * **api:** inline zod validation into update(), remove parseGanttInput ([6136fe9](https://github.com/doberkofler/gantt-renderer/commit/6136fe9c732d4d919bfee592633be68eab0e05ef))
21
+ * **demo:** add HTML tooltip with typed custom data to demo app ([401bebc](https://github.com/doberkofler/gantt-renderer/commit/401bebc190145cf30dd96e6e67e0c76867028114))
22
+
23
+
24
+ ### BREAKING CHANGES
25
+
26
+ * **api:** Remove the public parseGanttInput() function and all
27
+ zod schema exports. Pass raw data directly to GanttChart.update() —
28
+ validation, defaults, and duplicate detection now happen internally.
29
+ GanttInputRaw uses readonly arrays so as const data is accepted
30
+ without casts.
31
+
1
32
  # [0.7.0](https://github.com/doberkofler/gantt-renderer/compare/v0.6.0...v0.7.0) (2026-05-11)
2
33
 
3
34
 
35
+ ### Features
36
+
37
+ * **types:** make GanttInputRaw and parseGanttInput generic ([e665221](https://github.com/doberkofler/gantt-renderer/commit/e665221cd13ed58138770365079884cfcc5067fe))
38
+
39
+ # [0.6.0](https://github.com/doberkofler/gantt-renderer/compare/v0.5.0...v0.6.0) (2026-05-11)
40
+
41
+
4
42
  ### Features
5
43
 
6
44
  * **gantt:** simplify default grid columns and add showAddTaskButton option ([800c3cd](https://github.com/doberkofler/gantt-renderer/commit/800c3cdb02d42dfc266823e1d56c0c6cd0eaf009))
7
45
  * **locale:** add built-in locale constants for 9 languages ([712254a](https://github.com/doberkofler/gantt-renderer/commit/712254acecc4110ad53de9de14833b2feb1ef16f))
8
46
  * **types:** add generic type params to Task, Link, GanttInput, GanttChart ([561ebcf](https://github.com/doberkofler/gantt-renderer/commit/561ebcf01dd1610f0f80739bd29509a05e7848c5))
9
- * **types:** make GanttInputRaw and parseGanttInput generic ([e665221](https://github.com/doberkofler/gantt-renderer/commit/e665221cd13ed58138770365079884cfcc5067fe))
10
47
 
11
48
  # [0.5.0](https://github.com/doberkofler/gantt-renderer/compare/v0.4.0...v0.5.0) (2026-05-09)
12
49
 
package/README.md CHANGED
@@ -63,20 +63,19 @@ npm install gantt-renderer
63
63
  ```
64
64
 
65
65
  ```ts
66
- import {GanttChart, parseGanttInput} from 'gantt-renderer';
66
+ import {GanttChart} from 'gantt-renderer';
67
67
  import 'gantt-renderer/styles/gantt.css';
68
68
 
69
- const input = parseGanttInput(yourData);
70
69
  const instance = new GanttChart(document.getElementById('chart')!, {
71
70
  scale: 'day',
72
71
  });
73
- instance.update(input);
72
+ instance.update(yourData);
74
73
  ```
75
74
 
76
75
  ## Integration Pattern
77
76
 
78
77
  1. Compute/plan project data in your domain layer or backend.
79
- 2. Validate the result with `parseGanttInput(yourData)`.
78
+ 2. Pass it directly to `instance.update(yourData)` — the chart validates and renders in one call.
80
79
  3. Render with `new GanttChart(container, options)` followed by `instance.update(input)` and react to interaction callbacks.
81
80
  4. Persist user edits through your own business logic, then update with `instance.update(newInput)`.
82
81
 
package/dist/index.d.mts CHANGED
@@ -1,30 +1,7 @@
1
+ import { a as deriveWeekStartsOn, c as formatWeekNumber, i as deriveWeekNumbering, l as resolveChartLocale, n as EN_US_LABELS, o as deriveWeekendDays, r as LocaleLabelKey, s as formatLabel, t as ChartLocale } from "./locale-BQKHOEOx.mjs";
1
2
  import { z } from "zod";
2
3
 
3
4
  //#region src/lib/validation/schemas.d.ts
4
- declare const LinkTypeSchema: z.ZodEnum<{
5
- FS: "FS";
6
- SS: "SS";
7
- FF: "FF";
8
- SF: "SF";
9
- }>;
10
- declare const TaskKindSchema: z.ZodEnum<{
11
- task: "task";
12
- project: "project";
13
- milestone: "milestone";
14
- }>;
15
- declare const SpecialDayKindSchema: z.ZodEnum<{
16
- holiday: "holiday";
17
- custom: "custom";
18
- }>;
19
- declare const SpecialDaySchema: z.ZodObject<{
20
- date: z.ZodString;
21
- kind: z.ZodEnum<{
22
- holiday: "holiday";
23
- custom: "custom";
24
- }>;
25
- label: z.ZodOptional<z.ZodString>;
26
- className: z.ZodOptional<z.ZodString>;
27
- }, z.core.$strip>;
28
5
  declare const TaskSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
29
6
  kind: z.ZodLiteral<"task">;
30
7
  endDate: z.ZodString;
@@ -71,78 +48,11 @@ declare const LinkSchema: z.ZodObject<{
71
48
  readonly: z.ZodOptional<z.ZodBoolean>;
72
49
  data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
73
50
  }, z.core.$strip>;
74
- declare const GanttInputSchema: z.ZodObject<{
75
- tasks: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
76
- kind: z.ZodLiteral<"task">;
77
- endDate: z.ZodString;
78
- percentComplete: z.ZodDefault<z.ZodNumber>;
79
- id: z.ZodNumber;
80
- text: z.ZodString;
81
- startDate: z.ZodString;
82
- parent: z.ZodOptional<z.ZodNumber>;
83
- color: z.ZodOptional<z.ZodString>;
84
- readonly: z.ZodOptional<z.ZodBoolean>;
85
- data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
86
- }, z.core.$strip>, z.ZodObject<{
87
- kind: z.ZodLiteral<"project">;
88
- endDate: z.ZodString;
89
- percentComplete: z.ZodDefault<z.ZodNumber>;
90
- open: z.ZodDefault<z.ZodBoolean>;
91
- id: z.ZodNumber;
92
- text: z.ZodString;
93
- startDate: z.ZodString;
94
- parent: z.ZodOptional<z.ZodNumber>;
95
- color: z.ZodOptional<z.ZodString>;
96
- readonly: z.ZodOptional<z.ZodBoolean>;
97
- data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
98
- }, z.core.$strip>, z.ZodObject<{
99
- kind: z.ZodLiteral<"milestone">;
100
- id: z.ZodNumber;
101
- text: z.ZodString;
102
- startDate: z.ZodString;
103
- parent: z.ZodOptional<z.ZodNumber>;
104
- color: z.ZodOptional<z.ZodString>;
105
- readonly: z.ZodOptional<z.ZodBoolean>;
106
- data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
107
- }, z.core.$strip>], "kind">>;
108
- links: z.ZodDefault<z.ZodArray<z.ZodObject<{
109
- id: z.ZodNumber;
110
- source: z.ZodNumber;
111
- target: z.ZodNumber;
112
- type: z.ZodDefault<z.ZodEnum<{
113
- FS: "FS";
114
- SS: "SS";
115
- FF: "FF";
116
- SF: "SF";
117
- }>>;
118
- readonly: z.ZodOptional<z.ZodBoolean>;
119
- data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
120
- }, z.core.$strip>>>;
121
- }, z.core.$strip>;
51
+ /** @internal */
122
52
  /** @internal */
123
53
  type ZodTaskInferred = z.infer<typeof TaskSchema>;
124
54
  /** @internal */
125
55
  type ZodLinkInferred = z.infer<typeof LinkSchema>;
126
- /** @internal */
127
- type ZodTaskInput = z.input<typeof TaskSchema>;
128
- /** @internal */
129
- type ZodLinkInput = z.input<typeof LinkSchema>;
130
- /** Raw input version of a task — uses zod's input shape where fields with defaults are optional. */
131
- type TaskRaw<TData = never> = WithoutData<ZodTaskInput> & WithData<TData>;
132
- /** Raw input version of a link — uses zod's input shape where fields with defaults are optional. */
133
- type LinkRaw<TData = never> = WithoutData<ZodLinkInput> & WithData<TData>;
134
- /**
135
- * Conditional data property helper.
136
- * When `T` is `never`, adds nothing. Otherwise adds `{data?: T | undefined}`.
137
- */
138
- type WithData<T> = [T] extends [never] ? Record<never, never> : {
139
- data?: T | undefined;
140
- };
141
- /**
142
- * Distributes `Omit` over union members so variant-specific properties
143
- * (e.g. `endDate`, `percentComplete`, `open`) are preserved in discriminated unions.
144
- */
145
- type WithoutData<T> = T extends unknown ? Omit<T, 'data'> : never;
146
56
  /**
147
57
  * A task in the Gantt chart &mdash; discriminated by `kind` into leaf tasks,
148
58
  * summary projects, and milestones.
@@ -164,13 +74,55 @@ type WithoutData<T> = T extends unknown ? Omit<T, 'data'> : never;
164
74
  * };
165
75
  * ```
166
76
  */
167
- type Task<TData = never> = WithoutData<ZodTaskInferred> & WithData<TData>;
77
+ type Task<TData = never> = {
78
+ id: number;
79
+ text: string;
80
+ startDate: string;
81
+ parent?: number | undefined;
82
+ color?: string | undefined;
83
+ readonly?: boolean | undefined;
84
+ data?: unknown;
85
+ kind: 'task';
86
+ endDate: string;
87
+ percentComplete: number;
88
+ } | {
89
+ id: number;
90
+ text: string;
91
+ startDate: string;
92
+ parent?: number | undefined;
93
+ color?: string | undefined;
94
+ readonly?: boolean | undefined;
95
+ data?: unknown;
96
+ kind: 'project';
97
+ endDate: string;
98
+ percentComplete: number;
99
+ open: boolean;
100
+ } | {
101
+ id: number;
102
+ text: string;
103
+ startDate: string;
104
+ parent?: number | undefined;
105
+ color?: string | undefined;
106
+ readonly?: boolean | undefined;
107
+ data?: unknown;
108
+ kind: 'milestone';
109
+ } extends infer _U ? _U extends unknown ? Omit<_U, 'data'> & ([TData] extends [never] ? Record<never, never> : {
110
+ data?: TData | undefined;
111
+ }) : never : never;
168
112
  /**
169
113
  * A dependency link between two tasks.
170
114
  *
171
115
  * @param TData - The type of the optional `data` property. Defaults to `never`.
172
116
  */
173
- type Link<TData = never> = WithoutData<ZodLinkInferred> & WithData<TData>;
117
+ type Link<TData = never> = {
118
+ id: number;
119
+ source: number;
120
+ target: number;
121
+ type: LinkType;
122
+ readonly?: boolean | undefined;
123
+ } & ([TData] extends [never] ? Record<never, never> : {
124
+ data?: TData | undefined;
125
+ });
174
126
  /**
175
127
  * The complete input data for the chart.
176
128
  *
@@ -182,7 +134,7 @@ type GanttInput<TTaskData = never, TLinkData = never> = {
182
134
  links: Link<TLinkData>[];
183
135
  };
184
136
  /**
185
- * The raw, unvalidated input shape that consumers pass to {@link parseGanttInput}.
137
+ * The raw input shape that consumers pass to {@link GanttChart.update}.
186
138
  *
187
139
  * Fields with defaults in the schema (e.g. `percentComplete`, `type`) remain optional here.
188
140
  *
@@ -190,27 +142,62 @@ type GanttInput<TTaskData = never, TLinkData = never> = {
190
142
  * @param TLinkData - The type of the `data` property on links. Defaults to `never`.
191
143
  */
192
144
  type GanttInputRaw<TTaskData = never, TLinkData = never> = {
193
- tasks: TaskRaw<TTaskData>[];
194
- links?: LinkRaw<TLinkData>[];
145
+ tasks: readonly ({
146
+ id: number;
147
+ text: string;
148
+ startDate: string;
149
+ parent?: number | undefined;
150
+ color?: string | undefined;
151
+ readonly?: boolean | undefined;
152
+ data?: unknown;
153
+ kind: 'task';
154
+ endDate: string;
155
+ percentComplete?: number | undefined;
156
+ } | {
157
+ id: number;
158
+ text: string;
159
+ startDate: string;
160
+ parent?: number | undefined;
161
+ color?: string | undefined;
162
+ readonly?: boolean | undefined;
163
+ data?: unknown;
164
+ kind: 'project';
165
+ endDate: string;
166
+ percentComplete?: number | undefined;
167
+ open?: boolean | undefined;
168
+ } | {
169
+ id: number;
170
+ text: string;
171
+ startDate: string;
172
+ parent?: number | undefined;
173
+ color?: string | undefined;
174
+ readonly?: boolean | undefined;
175
+ data?: unknown;
176
+ kind: 'milestone';
177
+ } extends infer _RU ? _RU extends unknown ? Omit<_RU, 'data'> & ([TTaskData] extends [never] ? Record<never, never> : {
178
+ data?: TTaskData | undefined;
179
+ }) : never : never)[];
180
+ links?: readonly ({
181
+ id: number;
182
+ source: number;
183
+ target: number;
184
+ type?: LinkType | undefined;
185
+ readonly?: boolean | undefined;
186
+ } & ([TLinkData] extends [never] ? Record<never, never> : {
187
+ data?: TLinkData | undefined;
188
+ }))[];
195
189
  };
196
190
  /** Allowed dependency link type values: `'FS'`, `'SS'`, `'FF'`, or `'SF'`. */
197
- type LinkType = z.infer<typeof LinkTypeSchema>;
191
+ type LinkType = 'FS' | 'SS' | 'FF' | 'SF';
198
192
  /** Allowed task kind values: `'task'`, `'project'`, or `'milestone'`. */
199
- type TaskKind = z.infer<typeof TaskKindSchema>;
200
- type SpecialDayKind = z.infer<typeof SpecialDayKindSchema>;
201
- type SpecialDay = z.infer<typeof SpecialDaySchema>;
202
- /**
203
- * Parses raw external data.
204
- *
205
- * Compile-time generics enforce the `data` shape on tasks and links.
206
- * Runtime validation is done by the zod schemas; the `data` field is
207
- * validated as a generic object at runtime regardless of the type parameter.
208
- *
209
- * @param raw - The unvalidated input from the consumer.
210
- * @returns The parsed and validated input with `data` typed per the type parameters.
211
- * @throws {import('zod').ZodError} On schema validation failure.
212
- */
213
- declare function parseGanttInput<TTaskData = never, TLinkData = never>(raw: GanttInputRaw<TTaskData, TLinkData>): GanttInput<TTaskData, TLinkData>;
193
+ type TaskKind = 'task' | 'project' | 'milestone';
194
+ type SpecialDayKind = 'holiday' | 'custom';
195
+ type SpecialDay = {
196
+ /** ISO date: YYYY-MM-DD */date: string;
197
+ kind: SpecialDayKind;
198
+ label?: string | undefined;
199
+ className?: string | undefined;
200
+ };
214
201
  //#endregion
215
202
  //#region src/lib/timeline/scale.d.ts
216
203
  type TimeScale = 'hour' | 'day' | 'week' | 'month' | 'quarter' | 'year';
@@ -229,7 +216,7 @@ declare const SCALE_CONFIGS: Record<TimeScale, ScaleConfig>;
229
216
  * Produced by {@link buildTaskTree}; consumed by virtualized row rendering
230
217
  * and the timeline layout engine.
231
218
  */
232
- type TaskNode = ZodTaskInferred & {
219
+ type TaskNode = Task<Record<string, unknown>> & {
233
220
  /** Array of child task nodes in the tree hierarchy. */children: TaskNode[]; /** 0 = root */
234
221
  depth: number;
235
222
  };
@@ -322,79 +309,6 @@ declare function computeLayout(rows: TaskNode[], mapper: PixelMapper): Map<numbe
322
309
  */
323
310
  declare function deriveViewport(tasks: TaskNode[], paddingHours?: number): [Date, Date];
324
311
  //#endregion
325
- //#region src/lib/locale.d.ts
326
- type LocaleLabelKey = 'ariaTask' | 'ariaMilestone' | 'addSubtaskTitle' | 'columnTaskName' | 'columnStartDate' | 'columnEndDate' | 'columnDuration' | 'columnQuarter';
327
- type ChartLocale = {
328
- code: string;
329
- labels?: Partial<Record<LocaleLabelKey, string>>;
330
- weekStartsOn?: 0 | 1 | 6;
331
- weekNumbering?: 'iso' | 'us' | 'simple';
332
- weekendDays?: number[];
333
- };
334
- declare const EN_US_LABELS: Record<LocaleLabelKey, string>;
335
- declare const CHART_LOCALE_EN_US: ChartLocale;
336
- declare const CHART_LOCALE_EN_GB: ChartLocale;
337
- declare const CHART_LOCALE_DE_DE: ChartLocale;
338
- declare const CHART_LOCALE_FR_FR: ChartLocale;
339
- declare const CHART_LOCALE_ES_ES: ChartLocale;
340
- declare const CHART_LOCALE_IT_IT: ChartLocale;
341
- declare const CHART_LOCALE_PT_PT: ChartLocale;
342
- declare const CHART_LOCALE_ZH_CN: ChartLocale;
343
- declare const CHART_LOCALE_JA_JP: ChartLocale;
344
- /**
345
- * Derives the first day of week (0=Sun, 1=Mon, 6=Sat) from a BCP 47 code.
346
- * Uses `Intl.Locale.getWeekInfo()` where available (Chromium, Safari 15.4+),
347
- * with a CLDR-based fallback table for Firefox and older runtimes.
348
- *
349
- * @param code - A BCP 47 language tag (e.g. `'en-US'`, `'de-DE'`).
350
- * @returns The first day of the week: `0` (Sunday), `1` (Monday), or `6` (Saturday).
351
- */
352
- declare function deriveWeekStartsOn(code: string): 0 | 1 | 6;
353
- /**
354
- * Derives the week numbering scheme from a BCP 47 code.
355
- * Europe and ISO-aligned regions default to `'iso'`; Americas and others to `'us'`.
356
- *
357
- * @param code - A BCP 47 language tag (e.g. `'en-US'`, `'de-DE'`).
358
- * @returns The week numbering scheme: `'iso'`, `'us'`, or `'simple'`.
359
- */
360
- declare function deriveWeekNumbering(code: string): 'iso' | 'us' | 'simple';
361
- /**
362
- * Derives weekend days (0=Sun … 6=Sat) from a BCP 47 code.
363
- * Uses `Intl.Locale.getWeekInfo()` where available, with a CLDR-based fallback table.
364
- *
365
- * @param code - A BCP 47 language tag (e.g. `'en-US'`, `'de-DE'`).
366
- * @returns An array of weekend day indices (sorted ascending).
367
- */
368
- declare function deriveWeekendDays(code: string): number[];
369
- /**
370
- * Resolves a {@link ChartLocale} from either a full `ChartLocale` object or a BCP 47 string.
371
- * When given a string, derives `weekStartsOn`, `weekNumbering`, and `weekendDays` from CLDR conventions.
372
- *
373
- * @param raw - A {@link ChartLocale} object, a BCP 47 language tag string, or `undefined`.
374
- * @returns A fully resolved {@link ChartLocale} with defaults applied.
375
- */
376
- declare function resolveChartLocale(raw: ChartLocale | string | undefined): ChartLocale;
377
- /**
378
- * Formats a week number according to the specified scheme.
379
- *
380
- * - `'iso'`: ISO 8601 (week 1 contains the first Thursday; Monday start).
381
- * - `'us'`: Week 1 contains January 1; Sunday start.
382
- * - `'simple'`: `Math.ceil(dayOfYear / 7)`.
383
- *
384
- * @param date - The date to compute the week number for.
385
- * @param scheme - The week numbering scheme: `'iso'`, `'us'`, or `'simple'`.
386
- * @returns The week number as a positive integer.
387
- */
388
- declare function formatWeekNumber(date: Date, scheme: 'iso' | 'us' | 'simple'): number;
389
- /**
390
- * Formats a label template by replacing `{0}` with the given argument.
391
- *
392
- * @param template - The template string containing `{0}` as placeholder.
393
- * @param arg - The value to substitute for `{0}`.
394
- * @returns The formatted string with the placeholder replaced.
395
- */
396
- declare function formatLabel(template: string, arg: string): string;
397
- //#endregion
398
312
  //#region src/lib/domain/dependencies.d.ts
399
313
  /**
400
314
  * Detects circular dependencies in the link graph using DFS tri-colour marking.
@@ -487,7 +401,7 @@ declare function routeLinks(links: ZodLinkInferred[], layouts: Map<number, BarLa
487
401
  * Use when referencing task fields in grid column schemas that apply
488
402
  * across a heterogeneous set of task kinds.
489
403
  */
490
- type TaskDataField = keyof ZodTaskInferred | 'endDate' | 'percentComplete' | 'open';
404
+ type TaskDataField = keyof Task | 'endDate' | 'percentComplete' | 'open';
491
405
  type GridColumn = {
492
406
  id: string;
493
407
  header: string;
@@ -495,7 +409,7 @@ type GridColumn = {
495
409
  align?: 'left' | 'center' | 'right';
496
410
  visible?: boolean;
497
411
  field?: TaskDataField;
498
- format?: (value: unknown, task: ZodTaskInferred, row: TaskNode, locale: ChartLocale) => string;
412
+ format?: (value: unknown, task: Task<Record<string, unknown>>, row: TaskNode, locale: ChartLocale) => string;
499
413
  };
500
414
  declare const DEFAULT_GRID_COLUMNS: GridColumn[];
501
415
  /**
@@ -621,9 +535,10 @@ type GanttOptions = {
621
535
  gridColumns?: GridColumn[];
622
536
  theme?: ThemeMode;
623
537
  showAddTaskButton?: boolean;
538
+ showTodayMarker?: boolean;
624
539
  };
625
540
  type GanttInstance<TTaskData = never, TLinkData = never> = {
626
- update: (input: GanttInput<TTaskData, TLinkData>) => void;
541
+ update: (input: GanttInputRaw<TTaskData, TLinkData>) => void;
627
542
  setOptions: (opts: Partial<GanttOptions>) => void;
628
543
  setCallbacks: (cbs: GanttCallbacks<TTaskData, TLinkData>) => void;
629
544
  select: (id: number | null, fireCallback?: boolean) => void;
@@ -672,7 +587,7 @@ declare class GanttChart<TTaskData = never, TLinkData = never> implements GanttI
672
587
  * @param newInput - The new {@link GanttInput} to apply.
673
588
  * @throws {GanttError} When the instance has been destroyed.
674
589
  */
675
- update(newInput: GanttInput<TTaskData, TLinkData>): void;
590
+ update(newInput: GanttInputRaw<TTaskData, TLinkData>): void;
676
591
  /**
677
592
  * Merges the supplied options into the current configuration and re-renders
678
593
  * only the panes affected by the changed options.
@@ -724,5 +639,5 @@ declare class GanttError extends Error {
724
639
  constructor(code: GanttErrorCode, message: string);
725
640
  }
726
641
  //#endregion
727
- export { BAR_HEIGHT, BAR_Y_OFFSET, type BarLayout, CHART_LOCALE_DE_DE, CHART_LOCALE_EN_GB, CHART_LOCALE_EN_US, CHART_LOCALE_ES_ES, CHART_LOCALE_FR_FR, CHART_LOCALE_IT_IT, CHART_LOCALE_JA_JP, CHART_LOCALE_PT_PT, CHART_LOCALE_ZH_CN, 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 OnTaskClick, type OnTaskDoubleClick, type OnTaskMove, type OnTaskResize, type OnTooltipText, 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 };
642
+ export { BAR_HEIGHT, BAR_Y_OFFSET, type BarLayout, type ChartLocale, DEFAULT_GRID_COLUMNS, DENSITY, EN_US_LABELS, GRID_COLUMN_FR_MIN_WIDTH, type GanttCallbacks, GanttChart, GanttError, type GanttErrorCode, type GanttInput, type GanttInputRaw, type GanttInstance, type GanttOptions, type GridColumn, type Link, type LinkType, type LocaleLabelKey, MILESTONE_HALF, MILESTONE_SIZE, type OnLinkClick, type OnLinkCreate, type OnLinkDblClick, type OnProgressChange, type OnTaskAdd, type OnTaskClick, type OnTaskDoubleClick, type OnTaskMove, type OnTaskResize, type OnTooltipText, type PixelMapper, type Point, ROW_HEIGHT, type RoutedLink, SCALE_CONFIGS, type ScaleConfig, type SpecialDay, type SpecialDayKind, type Task, type TaskDataField, type TaskKind, type TaskNode, type ThemeMode, type TimeScale, addDays, addHours, buildTaskTree, computeLayout, createPixelMapper, deriveViewport, deriveWeekNumbering, deriveWeekStartsOn, deriveWeekendDays, detectCycles, diffDays, diffHours, flattenTree, formatLabel, formatWeekNumber, gridColumnDefaults, gridNaturalWidth, gridTemplateColumns, isParent, parseDate, resolveChartLocale, routeLinks, validateLinkRefs, visibleColumns };
728
643
  //# sourceMappingURL=index.d.mts.map