gantt-renderer 0.12.12 → 0.12.13

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 (54) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/dist/index.d.mts +29 -16
  3. package/dist/index.mjs +5 -3
  4. package/dist/index.mjs.map +1 -1
  5. package/dist/locales/all.d.mts +0 -1
  6. package/dist/locales/ar.d.mts +0 -1
  7. package/dist/locales/be.d.mts +0 -1
  8. package/dist/locales/bg.d.mts +0 -1
  9. package/dist/locales/ca.d.mts +0 -1
  10. package/dist/locales/cs.d.mts +0 -1
  11. package/dist/locales/cy.d.mts +0 -1
  12. package/dist/locales/da.d.mts +0 -1
  13. package/dist/locales/de.d.mts +0 -1
  14. package/dist/locales/el.d.mts +0 -1
  15. package/dist/locales/en.d.mts +0 -1
  16. package/dist/locales/es.d.mts +0 -1
  17. package/dist/locales/et.d.mts +0 -1
  18. package/dist/locales/eu.d.mts +0 -1
  19. package/dist/locales/fi.d.mts +0 -1
  20. package/dist/locales/fr.d.mts +0 -1
  21. package/dist/locales/ga.d.mts +0 -1
  22. package/dist/locales/hi.d.mts +0 -1
  23. package/dist/locales/hr.d.mts +0 -1
  24. package/dist/locales/hu.d.mts +0 -1
  25. package/dist/locales/id.d.mts +0 -1
  26. package/dist/locales/it.d.mts +0 -1
  27. package/dist/locales/ja.d.mts +0 -1
  28. package/dist/locales/ko.d.mts +0 -1
  29. package/dist/locales/load.d.mts +0 -1
  30. package/dist/locales/load.mjs +132 -44
  31. package/dist/locales/load.mjs.map +1 -1
  32. package/dist/locales/lt.d.mts +0 -1
  33. package/dist/locales/lv.d.mts +0 -1
  34. package/dist/locales/mk.d.mts +0 -1
  35. package/dist/locales/mt.d.mts +0 -1
  36. package/dist/locales/nb.d.mts +0 -1
  37. package/dist/locales/nl.d.mts +0 -1
  38. package/dist/locales/pl.d.mts +0 -1
  39. package/dist/locales/pt-BR.d.mts +0 -1
  40. package/dist/locales/pt-PT.d.mts +0 -1
  41. package/dist/locales/registry.d.mts +0 -1
  42. package/dist/locales/ro.d.mts +0 -1
  43. package/dist/locales/ru.d.mts +0 -1
  44. package/dist/locales/sk.d.mts +0 -1
  45. package/dist/locales/sl.d.mts +0 -1
  46. package/dist/locales/sq.d.mts +0 -1
  47. package/dist/locales/sr.d.mts +0 -1
  48. package/dist/locales/sv.d.mts +0 -1
  49. package/dist/locales/th.d.mts +0 -1
  50. package/dist/locales/tr.d.mts +0 -1
  51. package/dist/locales/uk.d.mts +0 -1
  52. package/dist/locales/zh-Hans.d.mts +0 -1
  53. package/dist/locales/zh-Hant.d.mts +0 -1
  54. package/package.json +18 -18
package/CHANGELOG.md CHANGED
@@ -1,3 +1,5 @@
1
+ ## [0.12.13](https://github.com/doberkofler/gantt-renderer/compare/v0.12.12...v0.12.13) (2026-07-15)
2
+
1
3
  ## [0.12.12](https://github.com/doberkofler/gantt-renderer/compare/v0.12.11...v0.12.12) (2026-07-01)
2
4
 
3
5
  ## [0.12.11](https://github.com/doberkofler/gantt-renderer/compare/v0.12.10...v0.12.11) (2026-06-30)
package/dist/index.d.mts CHANGED
@@ -1,6 +1,5 @@
1
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-3A5xWe8q.mjs";
2
2
  import { z } from "zod";
3
-
4
3
  //#region src/lib/validation/schemas.d.ts
5
4
  declare const TaskSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
6
5
  kind: z.ZodLiteral<"task">;
@@ -49,7 +48,6 @@ declare const LinkSchema: z.ZodObject<{
49
48
  data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
50
49
  }, z.core.$strip>;
51
50
  /** @internal */
52
- /** @internal */
53
51
  type ZodTaskInferred = z.infer<typeof TaskSchema>;
54
52
  /** @internal */
55
53
  type ZodLinkInferred = z.infer<typeof LinkSchema>;
@@ -106,7 +104,7 @@ type Task<TData = never> = {
106
104
  readonly?: boolean | undefined;
107
105
  data?: unknown;
108
106
  kind: 'milestone';
109
- } extends infer _U ? _U extends unknown ? Omit<_U, 'data'> & ([TData] extends [never] ? Record<never, never> : {
107
+ } extends (infer _U) ? _U extends unknown ? Omit<_U, 'data'> & ([TData] extends [never] ? Record<never, never> : {
110
108
  data?: TData | undefined;
111
109
  }) : never : never;
112
110
  /**
@@ -174,7 +172,7 @@ type GanttInputRaw<TTaskData = never, TLinkData = never> = {
174
172
  readonly?: boolean | undefined;
175
173
  data?: unknown;
176
174
  kind: 'milestone';
177
- } extends infer _RU ? _RU extends unknown ? Omit<_RU, 'data'> & ([TTaskData] extends [never] ? Record<never, never> : {
175
+ } extends (infer _RU) ? _RU extends unknown ? Omit<_RU, 'data'> & ([TTaskData] extends [never] ? Record<never, never> : {
178
176
  data?: TTaskData | undefined;
179
177
  }) : never : never)[];
180
178
  links?: readonly ({
@@ -193,7 +191,8 @@ type LinkType = 'FS' | 'SS' | 'FF' | 'SF';
193
191
  type TaskKind = 'task' | 'project' | 'milestone';
194
192
  type SpecialDayKind = 'holiday' | 'custom';
195
193
  type SpecialDay = {
196
- /** ISO date: YYYY-MM-DD */date: string;
194
+ /** ISO date: YYYY-MM-DD */
195
+ date: string;
197
196
  kind: SpecialDayKind;
198
197
  label?: string | undefined;
199
198
  className?: string | undefined;
@@ -202,7 +201,9 @@ type SpecialDay = {
202
201
  //#region src/lib/timeline/scale.d.ts
203
202
  type TimeScale = 'hour' | 'day' | 'week' | 'month' | 'quarter' | 'year';
204
203
  type ScaleConfig = {
205
- /** Pixel width of one column unit */columnWidth: number; /** Milliseconds per column unit */
204
+ /** Pixel width of one column unit */
205
+ columnWidth: number;
206
+ /** Milliseconds per column unit */
206
207
  msPerColumn: number;
207
208
  headerFormat: TimeScale;
208
209
  };
@@ -217,7 +218,9 @@ declare const SCALE_CONFIGS: Record<TimeScale, ScaleConfig>;
217
218
  * and the timeline layout engine.
218
219
  */
219
220
  type TaskNode = Task<Record<string, unknown>> & {
220
- /** Array of child task nodes in the tree hierarchy. */children: TaskNode[]; /** 0 = root */
221
+ /** Array of child task nodes in the tree hierarchy. */
222
+ children: TaskNode[];
223
+ /** 0 = root */
221
224
  depth: number;
222
225
  };
223
226
  /**
@@ -250,11 +253,17 @@ declare function isParent(node: TaskNode): boolean;
250
253
  //#endregion
251
254
  //#region src/lib/timeline/pixelMapper.d.ts
252
255
  type PixelMapper = {
253
- /** Date → x pixel offset from viewport start */toX: (date: Date) => number; /** x pixel offset → Date */
254
- toDate: (x: number) => Date; /** Days → pixel width */
255
- durationDaysToWidth: (days: number) => number; /** Pixel width days (float) */
256
- widthToDurationDays: (px: number) => number; /** The origin timestamp used for this mapper */
257
- originMs: number; /** Pixel width of one column unit */
256
+ /** Date → x pixel offset from viewport start */
257
+ toX: (date: Date) => number;
258
+ /** x pixel offsetDate */
259
+ toDate: (x: number) => Date;
260
+ /** Days pixel width */
261
+ durationDaysToWidth: (days: number) => number;
262
+ /** Pixel width → days (float) */
263
+ widthToDurationDays: (px: number) => number;
264
+ /** The origin timestamp used for this mapper */
265
+ originMs: number;
266
+ /** Pixel width of one column unit */
258
267
  columnWidth: number;
259
268
  };
260
269
  /**
@@ -280,14 +289,17 @@ declare const MILESTONE_SIZE: 20;
280
289
  /** Half-width of a milestone diamond */
281
290
  declare const MILESTONE_HALF: number;
282
291
  type BarLayout = {
283
- taskId: number; /** Left edge x in timeline coordinates */
284
- x: number; /** Top edge y in content coordinates */
292
+ taskId: number;
293
+ /** Left edge x in timeline coordinates */
294
+ x: number;
295
+ /** Top edge y in content coordinates */
285
296
  y: number;
286
297
  width: number;
287
298
  height: number;
288
299
  progressWidth: number;
289
300
  kind: 'task' | 'project' | 'milestone';
290
- rowIndex: number; /** Center x; identical to x + width/2 or x for milestones */
301
+ rowIndex: number;
302
+ /** Center x; identical to x + width/2 or x for milestones */
291
303
  centerX: number;
292
304
  centerY: number;
293
305
  };
@@ -381,7 +393,8 @@ type RoutedLink = {
381
393
  linkId: number;
382
394
  sourceTaskId: number;
383
395
  targetTaskId: number;
384
- type: LinkType; /** Ordered vertices of the orthogonal polyline (source → target). */
396
+ type: LinkType;
397
+ /** Ordered vertices of the orthogonal polyline (source → target). */
385
398
  points: Point[];
386
399
  };
387
400
  /**
package/dist/index.mjs CHANGED
@@ -1702,7 +1702,7 @@ function buildDataCell(row, column, locale) {
1702
1702
  if (column.field !== void 0) {
1703
1703
  const rawValue = getTaskField(task, column.field);
1704
1704
  if (column.format !== void 0) cell.textContent = column.format(rawValue, task, row, locale);
1705
- else cell.textContent = rawValue !== null && rawValue !== void 0 ? typeof rawValue === "object" ? JSON.stringify(rawValue) : String(rawValue) : "";
1705
+ else cell.textContent = rawValue !== null && rawValue !== void 0 ? typeof rawValue === "object" ? JSON.stringify(rawValue) : typeof rawValue === "string" || typeof rawValue === "number" || typeof rawValue === "boolean" ? String(rawValue) : "" : "";
1706
1706
  }
1707
1707
  return cell;
1708
1708
  }
@@ -2211,7 +2211,8 @@ function attachDrag(barEl, resizeHandleEl, task, getMapper, cbs) {
2211
2211
  let lastEnd = origEnd;
2212
2212
  function onMove(me) {
2213
2213
  const dx = me.clientX - startX;
2214
- lastEnd = addDays(origEnd, Math.round(mapper.widthToDurationDays(dx)));
2214
+ const daysDelta = Math.round(mapper.widthToDurationDays(dx));
2215
+ lastEnd = addDays(origEnd, daysDelta);
2215
2216
  cbs.onTaskResize?.({
2216
2217
  id: task.id,
2217
2218
  endDate: lastEnd.toISOString().slice(0, 10)
@@ -2932,7 +2933,8 @@ function attachSplitter(splitterHandle, leftPane, container, timelineMinWidth, o
2932
2933
  const startX = e.clientX;
2933
2934
  const startWidth = Number.parseFloat(leftPane.style.width) || 0;
2934
2935
  function onMove(me) {
2935
- let newWidth = startWidth + (me.clientX - startX);
2936
+ const dx = me.clientX - startX;
2937
+ let newWidth = startWidth + dx;
2936
2938
  const hostWidth = container.clientWidth;
2937
2939
  if (hostWidth > 0) newWidth = Math.max(MIN_PANE_WIDTH$1, Math.min(newWidth, hostWidth - timelineMinWidth));
2938
2940
  newWidth = Math.max(MIN_PANE_WIDTH$1, newWidth);