@toclocoinc/lattice-grid 1.60.0 → 1.62.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 (113) hide show
  1. package/README.md +1 -1
  2. package/docs/API.html +21 -17
  3. package/docs/api-detail.html +863 -17
  4. package/lattice-grid.d.ts +22 -11
  5. package/lattice-grid.esm.min.js +614 -49
  6. package/lattice-grid.min.cjs +614 -49
  7. package/lattice-grid.min.css +1 -1
  8. package/lattice-grid.min.js +614 -49
  9. package/modules/ai.d.ts +11 -2
  10. package/modules/ai.esm.min.js +24 -4
  11. package/modules/ai.min.cjs +24 -4
  12. package/modules/ai.min.js +24 -4
  13. package/modules/angular.d.ts +1 -1
  14. package/modules/angular.esm.min.js +2 -2
  15. package/modules/angular.min.cjs +2 -2
  16. package/modules/angular.min.js +2 -2
  17. package/modules/chart-alluvial.d.ts +1 -1
  18. package/modules/chart-alluvial.esm.min.js +1 -1
  19. package/modules/chart-arc.d.ts +1 -1
  20. package/modules/chart-arc.esm.min.js +1 -1
  21. package/modules/chart-bubblemap.d.ts +1 -1
  22. package/modules/chart-bubblemap.esm.min.js +1 -1
  23. package/modules/chart-bump.d.ts +1 -1
  24. package/modules/chart-bump.esm.min.js +1 -1
  25. package/modules/chart-calendar.d.ts +1 -1
  26. package/modules/chart-calendar.esm.min.js +1 -1
  27. package/modules/chart-decomposition.d.ts +1 -1
  28. package/modules/chart-decomposition.esm.min.js +1 -1
  29. package/modules/chart-diverging.d.ts +1 -1
  30. package/modules/chart-diverging.esm.min.js +1 -1
  31. package/modules/chart-dumbbell.d.ts +1 -1
  32. package/modules/chart-dumbbell.esm.min.js +1 -1
  33. package/modules/chart-fan.d.ts +1 -1
  34. package/modules/chart-fan.esm.min.js +1 -1
  35. package/modules/chart-hexbin.d.ts +1 -1
  36. package/modules/chart-hexbin.esm.min.js +1 -1
  37. package/modules/chart-hexmap.d.ts +1 -1
  38. package/modules/chart-hexmap.esm.min.js +1 -1
  39. package/modules/chart-icicle.d.ts +1 -1
  40. package/modules/chart-icicle.esm.min.js +1 -1
  41. package/modules/chart-parallel.d.ts +1 -1
  42. package/modules/chart-parallel.esm.min.js +1 -1
  43. package/modules/chart-ridgeline.d.ts +1 -1
  44. package/modules/chart-ridgeline.esm.min.js +1 -1
  45. package/modules/chart-roc.d.ts +1 -1
  46. package/modules/chart-roc.esm.min.js +1 -1
  47. package/modules/chart-slope.d.ts +1 -1
  48. package/modules/chart-slope.esm.min.js +1 -1
  49. package/modules/chart-splom.d.ts +1 -1
  50. package/modules/chart-splom.esm.min.js +1 -1
  51. package/modules/chart-waffle.d.ts +1 -1
  52. package/modules/chart-waffle.esm.min.js +1 -1
  53. package/modules/charts.d.ts +1 -1
  54. package/modules/charts.esm.min.js +48 -15
  55. package/modules/charts.min.cjs +48 -15
  56. package/modules/charts.min.js +48 -15
  57. package/modules/data-router.d.ts +1 -1
  58. package/modules/data-router.esm.min.js +4 -4
  59. package/modules/data-router.min.cjs +4 -4
  60. package/modules/data-router.min.js +4 -4
  61. package/modules/devtools.d.ts +1 -1
  62. package/modules/devtools.esm.min.js +2 -2
  63. package/modules/devtools.min.cjs +2 -2
  64. package/modules/devtools.min.js +2 -2
  65. package/modules/dhtmlx-compat.d.ts +1 -1
  66. package/modules/dhtmlx-compat.esm.min.js +4 -4
  67. package/modules/dhtmlx-compat.min.cjs +4 -4
  68. package/modules/dhtmlx-compat.min.js +4 -4
  69. package/modules/gantt.d.ts +144 -12
  70. package/modules/gantt.esm.min.js +1070 -201
  71. package/modules/gantt.min.cjs +1070 -201
  72. package/modules/gantt.min.js +1070 -201
  73. package/modules/htmx.d.ts +1 -1
  74. package/modules/htmx.esm.min.js +614 -49
  75. package/modules/htmx.min.cjs +614 -49
  76. package/modules/htmx.min.js +614 -49
  77. package/modules/kanban.d.ts +1 -1
  78. package/modules/kanban.esm.min.js +4 -4
  79. package/modules/kanban.min.cjs +4 -4
  80. package/modules/kanban.min.js +4 -4
  81. package/modules/kpi.d.ts +1 -1
  82. package/modules/kpi.esm.min.js +19 -6
  83. package/modules/kpi.min.cjs +19 -6
  84. package/modules/kpi.min.js +19 -6
  85. package/modules/layout.d.ts +1 -1
  86. package/modules/layout.esm.min.js +4 -4
  87. package/modules/layout.min.cjs +4 -4
  88. package/modules/layout.min.js +4 -4
  89. package/modules/mock-socket.d.ts +1 -1
  90. package/modules/mock-socket.esm.min.js +2 -2
  91. package/modules/mock-socket.min.cjs +2 -2
  92. package/modules/mock-socket.min.js +2 -2
  93. package/modules/react.d.ts +1 -1
  94. package/modules/react.esm.min.js +2 -2
  95. package/modules/react.min.cjs +2 -2
  96. package/modules/react.min.js +2 -2
  97. package/modules/svelte.d.ts +1 -1
  98. package/modules/svelte.esm.min.js +2 -2
  99. package/modules/svelte.min.cjs +2 -2
  100. package/modules/svelte.min.js +2 -2
  101. package/modules/tabs.d.ts +1 -1
  102. package/modules/tabs.esm.min.js +11 -4
  103. package/modules/tabs.min.cjs +11 -4
  104. package/modules/tabs.min.js +11 -4
  105. package/modules/vue.d.ts +1 -1
  106. package/modules/vue.esm.min.js +2 -2
  107. package/modules/vue.min.cjs +2 -2
  108. package/modules/vue.min.js +2 -2
  109. package/modules/webcomponent.d.ts +1 -1
  110. package/modules/webcomponent.esm.min.js +614 -49
  111. package/modules/webcomponent.min.cjs +614 -49
  112. package/modules/webcomponent.min.js +614 -49
  113. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Lattice Grid 1.60.0, gantt module type declarations
2
+ * Lattice Grid 1.62.0, gantt module type declarations
3
3
  * Copyright (c) 2026 TOCLOCO Inc. All rights reserved.
4
4
  * https://latticegrid.dev
5
5
  */
@@ -48,6 +48,26 @@ export interface GanttTask {
48
48
  * `units: 1`.
49
49
  */
50
50
  assignments?: Array<{ resource?: string; name?: string; id?: string; units?: number }>;
51
+ /**
52
+ * The task's effort, in one of two forms (BACKLOG-0001281/1282).
53
+ *
54
+ * A **number** is the task's TOTAL hours; the workload band divides it
55
+ * between the assignments in proportion to their units and spreads each
56
+ * share evenly over the working days the task spans. (`hours` is accepted
57
+ * as the same field under its other common name.)
58
+ *
59
+ * An **array** is an explicit per-day contour — what a planner types into a
60
+ * workload cell — and states each day's hours itself: the task's total is
61
+ * the sum of the entries, nothing is spread, and the contour is
62
+ * authoritative for the span, so `applyEdit` derives the task's `start` and
63
+ * `duration` from its first and last day. An EMPTY array means "no hours
64
+ * booked", which is how clearing every bucket is expressed without reviving
65
+ * the even spread. A bar move re-times the contour onto the new days
66
+ * unchanged; a resize stretches it across the new span at the same daily
67
+ * levels. `date` is an ISO date, a `Date` or a plan day-number; the module
68
+ * writes ISO dates back.
69
+ */
70
+ work?: number | Array<{ date: number | string | Date; hours: number }>;
51
71
  /** Leveling priority: a higher value is delayed last (default 0). */
52
72
  priority?: number;
53
73
  /** An explicit row height (px) for the split view; applied to both panels. */
@@ -281,7 +301,19 @@ interface Gantt {
281
301
  readonly resourceLoad: GanttResourceLoad | null;
282
302
  setTasks(tasks: GanttTask[]): GanttSchedule;
283
303
  setDependencies(deps: GanttDependency[]): GanttSchedule;
284
- applyEdit(patch: { id: string | number; start?: number; end?: number; duration?: number }, editOpts?: { writeBack?: boolean }): GanttSchedule;
304
+ /**
305
+ * Apply one task edit and recompute — the single gated choke point every
306
+ * drag, keypress, table cell and workload cell commits through.
307
+ *
308
+ * A `work` ARRAY is the task's per-day contour (BACKLOG-0001282). Given
309
+ * without an explicit `start`/`end`/`duration` it SETS the span: the task
310
+ * starts on the contour's first day and runs through its last, so booking
311
+ * hours beyond the bar extends it and clearing an edge bucket pulls it
312
+ * back. Conversely, a `start` or `duration` in the patch re-times an
313
+ * existing contour rather than discarding it — a move keeps its shape, a
314
+ * resize stretches it across the new span at the same daily levels.
315
+ */
316
+ applyEdit(patch: { id: string | number; start?: number; end?: number; duration?: number; percentComplete?: number; work?: number | Array<{ date: number | string | Date; hours: number }> }, editOpts?: { writeBack?: boolean }): GanttSchedule;
285
317
  compute(): GanttSchedule;
286
318
  findViolations(): GanttViolation[];
287
319
  /**
@@ -383,11 +415,30 @@ interface Gantt {
383
415
  }): unknown;
384
416
  /**
385
417
  * Mount the JOINED split view (BACKLOG-0000938): one continuous, row-aligned
386
- * surface with a left task-grid panel (Task Name tree with expand/collapse,
387
- * assignee avatars, a circular % ring, plus any host columns) and the right
388
- * timeline, sharing a single vertical scroll so every grid row lines up
389
- * exactly with its bar row. The timeline scrolls horizontally on its own.
390
- * Composes the controller's schedule; makes no change to grid core.
418
+ * surface with a left task-grid panel — by default the Task Name tree with
419
+ * expand/collapse, start, finish, duration, assignee avatars and a circular
420
+ * % ring (BACKLOG-0001285), plus any host columns — and the right timeline,
421
+ * sharing a single vertical scroll so every grid row lines up exactly with
422
+ * its bar row. The timeline scrolls horizontally on its own. Composes the
423
+ * controller's schedule; makes no change to grid core.
424
+ *
425
+ * The plan is editable from BOTH panes (BACKLOG-0001280): every gesture
426
+ * `mount` has — pointer drag to move, drag on the right edge to resize,
427
+ * arrow-key move, Shift+arrow resize, `l` to link, Delete — works on the
428
+ * timeline here, and a `start`/`end`/`duration`/`progress`/`name` column in
429
+ * the left panel is inline-editable on a double-click. Both routes commit
430
+ * through the same `applyEdit` choke point, so `beforeTaskMove`,
431
+ * `beforeTaskResize`, `beforeProgressChange` and `beforeTaskEdit` stay the
432
+ * single veto whichever pane the edit came from.
433
+ *
434
+ * The three switches that govern it carry the same meaning and the same
435
+ * defaults as `mount`'s: `editable` (default true) turns every edit on or
436
+ * off, both panes at once; `keyboard` (default true) turns off the
437
+ * focusable bars, the arrow-key gestures and the ARIA announcements while
438
+ * leaving pointer editing alone; and `resizeZone` (default 6) is how many
439
+ * pixels in from a bar's right edge begin a resize rather than a move.
440
+ * `workload` adds the resource band beneath the plan (BACKLOG-0001281),
441
+ * which is display-only — it reports hours, it does not accept them.
391
442
  */
392
443
  mountSplit(container: unknown, options?: {
393
444
  height?: number;
@@ -409,7 +460,85 @@ interface Gantt {
409
460
  * overrides the status date and the cost field names.
410
461
  */
411
462
  evm?: boolean | { statusDate?: number | string | Date; costField?: string; actualCostField?: string };
412
- columns?: Array<{ key: string; title?: string; width?: number; kind?: 'name' | 'assignee' | 'progress' | 'evm'; metric?: 'bac' | 'pv' | 'ev' | 'ac' | 'sv' | 'cv' | 'spi' | 'cpi'; digits?: number; render?: (task: GanttScheduledTask, ctx: { rawTask: GanttTask; depth: number }) => unknown }>;
463
+ /**
464
+ * Whether the plan can be edited: pointer drags on the timeline and the
465
+ * left panel's inline cell editors (default true). Same meaning and
466
+ * default as `mount`'s.
467
+ */
468
+ editable?: boolean;
469
+ /**
470
+ * Keyboard editing + focusable bars + ARIA announcements on the timeline
471
+ * (default true). Same meaning and default as `mount`'s.
472
+ */
473
+ keyboard?: boolean;
474
+ /**
475
+ * Pixels from a bar's right edge that begin a resize rather than a move
476
+ * (default 6). Same meaning and default as `mount`'s.
477
+ */
478
+ resizeZone?: number;
479
+ /**
480
+ * A `{ t(key, params) }` resolver for the view's own text — the live
481
+ * region's edit announcements. Omit it and a gantt bound to a grid borrows
482
+ * that grid's catalogue; a standalone plan falls back to English.
483
+ */
484
+ messages?: { t: (key: string, params?: Record<string, unknown>) => string };
485
+ /**
486
+ * The left panel's columns. `kind` decides what the cell shows and what a
487
+ * double-click edits: `'name'` the WBS tree (edits the name), `'assignee'`
488
+ * the avatars, `'progress'` the % ring (edits `percentComplete`), `'evm'`
489
+ * an earned-value `metric`, and `'start'`/`'end'`/`'duration'` the
490
+ * scheduled window — an ISO date, an ISO date, and a whole number of days,
491
+ * each of which edits the plan through the same path a bar drag takes
492
+ * (BACKLOG-0001280). A column with no `kind` shows the raw task's `key`
493
+ * and edits it only with `editable: true`.
494
+ */
495
+ columns?: Array<{ key: string; title?: string; width?: number; kind?: 'name' | 'assignee' | 'progress' | 'evm' | 'start' | 'end' | 'duration' | 'number'; metric?: 'bac' | 'pv' | 'ev' | 'ac' | 'sv' | 'cv' | 'spi' | 'cpi'; digits?: number; editable?: boolean; editField?: string; render?: (task: GanttScheduledTask, ctx: { rawTask: GanttTask; depth: number }) => unknown }>;
496
+ /**
497
+ * A resource workload band beneath the split view (BACKLOG-0001281):
498
+ * one row per resource on the left and, on the right, that resource's
499
+ * hours per time bucket — aligned column-for-column with the timeline's
500
+ * scale header, scroll-locked to it horizontally (vertically it scrolls
501
+ * on its own), and redrawn in the same paint as the bars whenever the
502
+ * plan changes. `true` takes the defaults below; an object overrides
503
+ * them; omitted, no band is drawn.
504
+ *
505
+ * **Editing (BACKLOG-0001282).** A resource row expands (a disclosure
506
+ * button, `aria-expanded`) into one sub-row per task it carries. The
507
+ * resource's own cell is the read-only aggregate; a SUB-ROW cell accepts
508
+ * a typed number of hours on a double-click whenever the view's
509
+ * `editable` is on. What is typed is written to that task's `work`
510
+ * contour through the same `applyEdit` choke point (and the same
511
+ * `beforeTaskEdit` veto) a bar drag uses, so the bar, the table row and
512
+ * the band all move in one paint — including the span, which follows the
513
+ * contour: type into a column beyond the bar and the bar grows to reach
514
+ * it. A bucket containing no working day declines the edit and says so.
515
+ *
516
+ * **Where the hours come from.** They are DERIVED from the tasks, never
517
+ * supplied: a task's own `work` (or `hours`) field when it carries a
518
+ * finite one, otherwise `working days × hoursPerDay × units`, divided
519
+ * between the task's assignments in proportion to their units and spread
520
+ * evenly over the working days the task spans. Working days are the days
521
+ * this view already shades — pass the `calendar`/`nonWorking` option the
522
+ * plan is scheduled with. Resources, units and capacities are the gantt's
523
+ * existing vocabulary (`assignee`/`assignees`/`owner`/`assignments` on a
524
+ * task; `resources`/`defaultCapacity` on `createGantt`); a task naming no
525
+ * resource is carried on an "Unassigned" row rather than dropped. An
526
+ * empty bucket is blank, not `0`, and a bucket over
527
+ * `capacity × hoursPerDay × the bucket's working days` is marked with a
528
+ * class and an accessible label.
529
+ */
530
+ workload?: boolean | {
531
+ /** Hours a full-time (`units: 1`) resource works in a working day; default 8. */
532
+ hoursPerDay?: number;
533
+ /** The band's height in pixels, taken from the view's own `height`; default 160. */
534
+ height?: number;
535
+ /** A band row's height in pixels; default 28. */
536
+ rowHeight?: number;
537
+ /** Maximum decimal places in a cell, trailing zeros dropped; default 1. */
538
+ decimals?: number;
539
+ /** Draw the totals row and totals column; default true. */
540
+ totals?: boolean;
541
+ };
413
542
  }): unknown;
414
543
  /**
415
544
  * Capture a baseline (planned) snapshot of the current schedule as HOST data
@@ -471,10 +600,13 @@ export function createGantt(opts?: {
471
600
  * such a plan was keyed correctly by `rows.apply` and then refused to
472
601
  * schedule.
473
602
  *
474
- * This is a READ mapping. `applyEdit` and `level()` write the canonical
475
- * property, so each says so rather than writing where nothing reads;
476
- * `assignee`, `cost` and `actualCost` belong to the resource and
477
- * earned-value layers and are not mapped.
603
+ * A mapping to a field NAME is two-way: `applyEdit` writes back to that
604
+ * name, so an edit on a mapped plan lands instead of springing back
605
+ * (BACKLOG-0001280). A mapping to a READER FUNCTION has no inverse, so an
606
+ * edit to such a field writes the canonical property and says so once, and
607
+ * `level()` refuses a mapped `start` outright rather than writing where
608
+ * nothing reads. `assignee`, `cost` and `actualCost` belong to the resource
609
+ * and earned-value layers and are not mapped.
478
610
  */
479
611
  fields?: Record<string, string | ((row: GanttTask) => unknown)>;
480
612
  /** Auto-mount into this element at construction. */