@toclocoinc/lattice-grid 1.68.1 → 1.68.2

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 (164) hide show
  1. package/README.md +26 -1
  2. package/angular/fesm2022/toclocoinc-lattice-grid-angular.mjs +1 -0
  3. package/angular/package.json +1 -1
  4. package/docs/API.html +3833 -1278
  5. package/docs/api-detail.html +101 -4
  6. package/lattice-grid.d.ts +2626 -143
  7. package/lattice-grid.esm.min.js +192 -36
  8. package/lattice-grid.min.cjs +192 -36
  9. package/lattice-grid.min.js +192 -36
  10. package/modules/ai.d.ts +111 -13
  11. package/modules/ai.esm.min.js +3 -3
  12. package/modules/ai.min.cjs +3 -3
  13. package/modules/ai.min.js +3 -3
  14. package/modules/angular.d.ts +1 -1
  15. package/modules/angular.esm.min.js +3 -3
  16. package/modules/angular.min.cjs +3 -3
  17. package/modules/angular.min.js +3 -3
  18. package/modules/chart-alluvial.d.ts +1 -1
  19. package/modules/chart-alluvial.esm.min.js +1 -1
  20. package/modules/chart-alluvial.min.cjs +1 -1
  21. package/modules/chart-alluvial.min.js +1 -1
  22. package/modules/chart-arc.d.ts +1 -1
  23. package/modules/chart-arc.esm.min.js +1 -1
  24. package/modules/chart-arc.min.cjs +1 -1
  25. package/modules/chart-arc.min.js +1 -1
  26. package/modules/chart-bubblemap.d.ts +1 -1
  27. package/modules/chart-bubblemap.esm.min.js +1 -1
  28. package/modules/chart-bubblemap.min.cjs +1 -1
  29. package/modules/chart-bubblemap.min.js +1 -1
  30. package/modules/chart-bump.d.ts +1 -1
  31. package/modules/chart-bump.esm.min.js +1 -1
  32. package/modules/chart-bump.min.cjs +1 -1
  33. package/modules/chart-bump.min.js +1 -1
  34. package/modules/chart-calendar.d.ts +1 -1
  35. package/modules/chart-calendar.esm.min.js +1 -1
  36. package/modules/chart-calendar.min.cjs +1 -1
  37. package/modules/chart-calendar.min.js +1 -1
  38. package/modules/chart-decomposition.d.ts +1 -1
  39. package/modules/chart-decomposition.esm.min.js +1 -1
  40. package/modules/chart-decomposition.min.cjs +1 -1
  41. package/modules/chart-decomposition.min.js +1 -1
  42. package/modules/chart-diverging.d.ts +1 -1
  43. package/modules/chart-diverging.esm.min.js +1 -1
  44. package/modules/chart-diverging.min.cjs +1 -1
  45. package/modules/chart-diverging.min.js +1 -1
  46. package/modules/chart-dumbbell.d.ts +1 -1
  47. package/modules/chart-dumbbell.esm.min.js +1 -1
  48. package/modules/chart-dumbbell.min.cjs +1 -1
  49. package/modules/chart-dumbbell.min.js +1 -1
  50. package/modules/chart-fan.d.ts +1 -1
  51. package/modules/chart-fan.esm.min.js +1 -1
  52. package/modules/chart-fan.min.cjs +1 -1
  53. package/modules/chart-fan.min.js +1 -1
  54. package/modules/chart-hexbin.d.ts +1 -1
  55. package/modules/chart-hexbin.esm.min.js +1 -1
  56. package/modules/chart-hexbin.min.cjs +1 -1
  57. package/modules/chart-hexbin.min.js +1 -1
  58. package/modules/chart-hexmap.d.ts +1 -1
  59. package/modules/chart-hexmap.esm.min.js +1 -1
  60. package/modules/chart-hexmap.min.cjs +1 -1
  61. package/modules/chart-hexmap.min.js +1 -1
  62. package/modules/chart-icicle.d.ts +1 -1
  63. package/modules/chart-icicle.esm.min.js +1 -1
  64. package/modules/chart-icicle.min.cjs +1 -1
  65. package/modules/chart-icicle.min.js +1 -1
  66. package/modules/chart-markermap.d.ts +1 -1
  67. package/modules/chart-markermap.esm.min.js +1 -1
  68. package/modules/chart-markermap.min.cjs +1 -1
  69. package/modules/chart-markermap.min.js +1 -1
  70. package/modules/chart-parallel.d.ts +1 -1
  71. package/modules/chart-parallel.esm.min.js +1 -1
  72. package/modules/chart-parallel.min.cjs +1 -1
  73. package/modules/chart-parallel.min.js +1 -1
  74. package/modules/chart-ridgeline.d.ts +1 -1
  75. package/modules/chart-ridgeline.esm.min.js +1 -1
  76. package/modules/chart-ridgeline.min.cjs +1 -1
  77. package/modules/chart-ridgeline.min.js +1 -1
  78. package/modules/chart-roc.d.ts +1 -1
  79. package/modules/chart-roc.esm.min.js +1 -1
  80. package/modules/chart-roc.min.cjs +1 -1
  81. package/modules/chart-roc.min.js +1 -1
  82. package/modules/chart-slope.d.ts +1 -1
  83. package/modules/chart-slope.esm.min.js +1 -1
  84. package/modules/chart-slope.min.cjs +1 -1
  85. package/modules/chart-slope.min.js +1 -1
  86. package/modules/chart-splom.d.ts +1 -1
  87. package/modules/chart-splom.esm.min.js +1 -1
  88. package/modules/chart-splom.min.cjs +1 -1
  89. package/modules/chart-splom.min.js +1 -1
  90. package/modules/chart-waffle.d.ts +1 -1
  91. package/modules/chart-waffle.esm.min.js +1 -1
  92. package/modules/chart-waffle.min.cjs +1 -1
  93. package/modules/chart-waffle.min.js +1 -1
  94. package/modules/charts.d.ts +1 -1
  95. package/modules/charts.esm.min.js +9 -9
  96. package/modules/charts.min.cjs +9 -9
  97. package/modules/charts.min.js +9 -9
  98. package/modules/data-router.d.ts +35 -5
  99. package/modules/data-router.esm.min.js +9 -4
  100. package/modules/data-router.min.cjs +9 -4
  101. package/modules/data-router.min.js +9 -4
  102. package/modules/devtools.d.ts +1 -1
  103. package/modules/devtools.esm.min.js +1 -1
  104. package/modules/devtools.min.cjs +1 -1
  105. package/modules/devtools.min.js +1 -1
  106. package/modules/dhtmlx-compat.d.ts +1 -1
  107. package/modules/dhtmlx-compat.esm.min.js +3 -3
  108. package/modules/dhtmlx-compat.min.cjs +3 -3
  109. package/modules/dhtmlx-compat.min.js +3 -3
  110. package/modules/gantt.d.ts +283 -33
  111. package/modules/gantt.esm.min.js +8 -4
  112. package/modules/gantt.min.cjs +8 -4
  113. package/modules/gantt.min.js +8 -4
  114. package/modules/geo-europe-nuts.d.ts +1 -1
  115. package/modules/geo-europe-nuts.esm.min.js +1 -1
  116. package/modules/geo-uk.d.ts +1 -1
  117. package/modules/geo-uk.esm.min.js +1 -1
  118. package/modules/geo-us-states.d.ts +1 -1
  119. package/modules/geo-us-states.esm.min.js +1 -1
  120. package/modules/geo-world-110m.d.ts +1 -1
  121. package/modules/geo-world-110m.esm.min.js +1 -1
  122. package/modules/geo-world-50m.d.ts +1 -1
  123. package/modules/geo-world-50m.esm.min.js +1 -1
  124. package/modules/htmx.d.ts +1 -1
  125. package/modules/htmx.esm.min.js +192 -36
  126. package/modules/htmx.min.cjs +192 -36
  127. package/modules/htmx.min.js +192 -36
  128. package/modules/kanban.d.ts +456 -5
  129. package/modules/kanban.esm.min.js +3 -3
  130. package/modules/kanban.min.cjs +3 -3
  131. package/modules/kanban.min.js +3 -3
  132. package/modules/kpi.d.ts +68 -4
  133. package/modules/kpi.esm.min.js +3 -3
  134. package/modules/kpi.min.cjs +3 -3
  135. package/modules/kpi.min.js +3 -3
  136. package/modules/layout.d.ts +134 -8
  137. package/modules/layout.esm.min.js +3 -3
  138. package/modules/layout.min.cjs +3 -3
  139. package/modules/layout.min.js +3 -3
  140. package/modules/mock-socket.d.ts +1 -1
  141. package/modules/mock-socket.esm.min.js +1 -1
  142. package/modules/mock-socket.min.cjs +1 -1
  143. package/modules/mock-socket.min.js +1 -1
  144. package/modules/react.d.ts +5 -1
  145. package/modules/react.esm.min.js +3 -3
  146. package/modules/react.min.cjs +3 -3
  147. package/modules/react.min.js +3 -3
  148. package/modules/svelte.d.ts +1 -1
  149. package/modules/svelte.esm.min.js +3 -3
  150. package/modules/svelte.min.cjs +3 -3
  151. package/modules/svelte.min.js +3 -3
  152. package/modules/tabs.d.ts +96 -20
  153. package/modules/tabs.esm.min.js +3 -3
  154. package/modules/tabs.min.cjs +3 -3
  155. package/modules/tabs.min.js +3 -3
  156. package/modules/vue.d.ts +5 -1
  157. package/modules/vue.esm.min.js +3 -3
  158. package/modules/vue.min.cjs +3 -3
  159. package/modules/vue.min.js +3 -3
  160. package/modules/webcomponent.d.ts +10 -39
  161. package/modules/webcomponent.esm.min.js +237 -40
  162. package/modules/webcomponent.min.cjs +237 -40
  163. package/modules/webcomponent.min.js +237 -40
  164. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Lattice Grid 1.68.1, data-router module
2
+ * Lattice Grid 1.68.2, data-router module
3
3
  * Copyright (c) 2026 TOCLOCO Inc. All rights reserved.
4
4
  * https://latticegrid.dev
5
5
  */
@@ -54,12 +54,12 @@ Object.defineProperty(__exports,"frameBatched",{enumerable:true,get:function(){r
54
54
  Object.defineProperty(__exports,"settleDebounce",{enumerable:true,get:function(){return settleDebounce;}});
55
55
  Object.defineProperty(__exports,"whenIdle",{enumerable:true,get:function(){return whenIdle;}});
56
56
  Object.defineProperty(__exports,"uid",{enumerable:true,get:function(){return uid;}});
57
- const STAMPED_VERSION="1.68.1";
57
+ const STAMPED_VERSION="1.68.2";
58
58
  async function resolveVersion(){
59
59
  if(STAMPED_VERSION!=='0.0.0-source')return STAMPED_VERSION;
60
60
  return STAMPED_VERSION;
61
61
  }
62
- const VERSION="1.68.1";
62
+ const VERSION="1.68.2";
63
63
  const warned=new Set();
64
64
  const WARNED_LIMIT=2000;
65
65
  function rememberWarned(key){
@@ -2325,6 +2325,11 @@ return;
2325
2325
  metricAdd('writeAccepted',1);
2326
2326
  reenterWrite(obj&&obj.row?obj.row:change.row);
2327
2327
  };
2328
+ const sourceOf=(key)=>{
2329
+ const id=String(key);
2330
+ for(const source of sources.values())if(source.live.has(id))return source.handle;
2331
+ return null;
2332
+ };
2328
2333
  const onGridEdit=(route,e)=>{
2329
2334
  if(!e||e.key===undefined||e.colId===undefined)return;
2330
2335
  if(revertingCells.has(cellId(e.key,e.colId)))return;
@@ -2348,7 +2353,7 @@ warnOnce(
2348
2353
  return;
2349
2354
  }
2350
2355
  let result;
2351
- try{result=onWrite(change,{route:route.grid,source:null});}
2356
+ try{result=onWrite(change,{route:route.grid,source:sourceOf(change.key)});}
2352
2357
  catch{revertCell(route,change);metricAdd('writeRejected',1);return;}
2353
2358
  if(result&&typeof result.then==='function'){
2354
2359
  result.then(
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Lattice Grid 1.68.1, devtools module type declarations
2
+ * Lattice Grid 1.68.2, devtools module type declarations
3
3
  * Copyright (c) 2026 TOCLOCO Inc. All rights reserved.
4
4
  * https://latticegrid.dev
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Lattice Grid 1.68.1, devtools module
2
+ * Lattice Grid 1.68.2, devtools module
3
3
  * Copyright (c) 2026 TOCLOCO Inc. All rights reserved.
4
4
  * https://latticegrid.dev
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Lattice Grid 1.68.1, devtools module
2
+ * Lattice Grid 1.68.2, devtools module
3
3
  * Copyright (c) 2026 TOCLOCO Inc. All rights reserved.
4
4
  * https://latticegrid.dev
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Lattice Grid 1.68.1, devtools module
2
+ * Lattice Grid 1.68.2, devtools module
3
3
  * Copyright (c) 2026 TOCLOCO Inc. All rights reserved.
4
4
  * https://latticegrid.dev
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Lattice Grid 1.68.1, dhtmlx-compat module type declarations
2
+ * Lattice Grid 1.68.2, dhtmlx-compat module type declarations
3
3
  * Copyright (c) 2026 TOCLOCO Inc. All rights reserved.
4
4
  * https://latticegrid.dev
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Lattice Grid 1.68.1, dhtmlx-compat module
2
+ * Lattice Grid 1.68.2, dhtmlx-compat module
3
3
  * Copyright (c) 2026 TOCLOCO Inc. All rights reserved.
4
4
  * https://latticegrid.dev
5
5
  */
@@ -62,12 +62,12 @@ Object.defineProperty(__exports,"frameBatched",{enumerable:true,get:function(){r
62
62
  Object.defineProperty(__exports,"settleDebounce",{enumerable:true,get:function(){return settleDebounce;}});
63
63
  Object.defineProperty(__exports,"whenIdle",{enumerable:true,get:function(){return whenIdle;}});
64
64
  Object.defineProperty(__exports,"uid",{enumerable:true,get:function(){return uid;}});
65
- const STAMPED_VERSION="1.68.1";
65
+ const STAMPED_VERSION="1.68.2";
66
66
  async function resolveVersion(){
67
67
  if(STAMPED_VERSION!=='0.0.0-source')return STAMPED_VERSION;
68
68
  return STAMPED_VERSION;
69
69
  }
70
- const VERSION="1.68.1";
70
+ const VERSION="1.68.2";
71
71
  const warned=new Set();
72
72
  const WARNED_LIMIT=2000;
73
73
  function rememberWarned(key){
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Lattice Grid 1.68.1, dhtmlx-compat module
2
+ * Lattice Grid 1.68.2, dhtmlx-compat module
3
3
  * Copyright (c) 2026 TOCLOCO Inc. All rights reserved.
4
4
  * https://latticegrid.dev
5
5
  */
@@ -63,12 +63,12 @@ Object.defineProperty(__exports,"frameBatched",{enumerable:true,get:function(){r
63
63
  Object.defineProperty(__exports,"settleDebounce",{enumerable:true,get:function(){return settleDebounce;}});
64
64
  Object.defineProperty(__exports,"whenIdle",{enumerable:true,get:function(){return whenIdle;}});
65
65
  Object.defineProperty(__exports,"uid",{enumerable:true,get:function(){return uid;}});
66
- const STAMPED_VERSION="1.68.1";
66
+ const STAMPED_VERSION="1.68.2";
67
67
  async function resolveVersion(){
68
68
  if(STAMPED_VERSION!=='0.0.0-source')return STAMPED_VERSION;
69
69
  return STAMPED_VERSION;
70
70
  }
71
- const VERSION="1.68.1";
71
+ const VERSION="1.68.2";
72
72
  const warned=new Set();
73
73
  const WARNED_LIMIT=2000;
74
74
  function rememberWarned(key){
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Lattice Grid 1.68.1, dhtmlx-compat module
2
+ * Lattice Grid 1.68.2, dhtmlx-compat module
3
3
  * Copyright (c) 2026 TOCLOCO Inc. All rights reserved.
4
4
  * https://latticegrid.dev
5
5
  */
@@ -63,12 +63,12 @@ Object.defineProperty(__exports,"frameBatched",{enumerable:true,get:function(){r
63
63
  Object.defineProperty(__exports,"settleDebounce",{enumerable:true,get:function(){return settleDebounce;}});
64
64
  Object.defineProperty(__exports,"whenIdle",{enumerable:true,get:function(){return whenIdle;}});
65
65
  Object.defineProperty(__exports,"uid",{enumerable:true,get:function(){return uid;}});
66
- const STAMPED_VERSION="1.68.1";
66
+ const STAMPED_VERSION="1.68.2";
67
67
  async function resolveVersion(){
68
68
  if(STAMPED_VERSION!=='0.0.0-source')return STAMPED_VERSION;
69
69
  return STAMPED_VERSION;
70
70
  }
71
- const VERSION="1.68.1";
71
+ const VERSION="1.68.2";
72
72
  const warned=new Set();
73
73
  const WARNED_LIMIT=2000;
74
74
  function rememberWarned(key){
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Lattice Grid 1.68.1, gantt module type declarations
2
+ * Lattice Grid 1.68.2, gantt module type declarations
3
3
  * Copyright (c) 2026 TOCLOCO Inc. All rights reserved.
4
4
  * https://latticegrid.dev
5
5
  */
@@ -277,11 +277,8 @@ interface GanttSchedule {
277
277
  * and the controller keeps its previous schedule.
278
278
  */
279
279
  ok: boolean;
280
- /**
281
- * Why the schedule was refused: a code such as `cycle`, `duplicate-id`, `bad-duration`,
282
- * `unknown-parent` or `parent-cycle`, a message, and for a cycle the ids that form it.
283
- */
284
- error?: { code: string; message: string; cycle?: string[] };
280
+ /** Why the schedule was refused — the same object the `error` event carries. */
281
+ error?: GanttScheduleError;
285
282
  /** Every task's computed values, keyed by id — leaves scheduled, summaries derived. */
286
283
  tasks?: Map<string, GanttScheduledTask>;
287
284
  /** Every task id in input order, which is the order a table or WBS tree walks. */
@@ -440,27 +437,13 @@ export function findViolations(tasks: GanttTask[], schedule: GanttSchedule): Gan
440
437
  export function toISODate(day: number): string | null;
441
438
 
442
439
  /** Earned-value metrics for one task or the whole project. */
443
- interface GanttEarnedValueRow {
444
- /**
445
- * The task the row is for. Absent on the `project` total, which carries only the
446
- * money fields and the two `has…` flags.
447
- */
448
- id: string;
449
- /** The task's name. Absent on the `project` total. */
450
- name: string;
451
- /**
452
- * True for a summary row, whose figures are the sums of its descendant leaves. Absent
453
- * on the `project` total.
454
- */
455
- isSummary: boolean;
456
- /** True for a zero-duration task. Absent on the `project` total. */
457
- isMilestone: boolean;
458
- /**
459
- * The task's progress, reported exactly as the task states it, or null when it states
460
- * none — which earns nothing. The earned-value multiplier clamps it to 0-100 first.
461
- * Absent on the `project` total.
462
- */
463
- percentComplete: number | null;
440
+ /**
441
+ * The earned-value figures themselves, without the task they belong to.
442
+ *
443
+ * The project total is exactly this and no more, so it has its own type
444
+ * rather than claiming to be a row with five fields it has never carried.
445
+ */
446
+ interface GanttEarnedValueTotals {
464
447
  /** Whether a baseline (not the fallback scheduled window) drove PV. */
465
448
  hasBaseline: boolean;
466
449
  /** Whether any actual cost fed AC (else AC/CV/CPI are null). */
@@ -483,6 +466,23 @@ interface GanttEarnedValueRow {
483
466
  cpi: number | null;
484
467
  }
485
468
 
469
+ /** One task's earned-value figures. */
470
+ interface GanttEarnedValueRow extends GanttEarnedValueTotals {
471
+ /** The task the row is for. */
472
+ id: string;
473
+ /** The task's name. */
474
+ name: string;
475
+ /** True for a summary row, whose figures are the sums of its descendant leaves. */
476
+ isSummary: boolean;
477
+ /** True for a zero-duration task. */
478
+ isMilestone: boolean;
479
+ /**
480
+ * The task's progress, reported exactly as the task states it, or null when it states
481
+ * none — which earns nothing. The earned-value multiplier clamps it to 0-100 first.
482
+ */
483
+ percentComplete: number | null;
484
+ }
485
+
486
486
  /** The earned-value result at a status date. */
487
487
  interface GanttEarnedValue {
488
488
  /**
@@ -498,8 +498,11 @@ interface GanttEarnedValue {
498
498
  byTask?: Map<string, GanttEarnedValueRow>;
499
499
  /** The same rows in schedule order. */
500
500
  rows?: GanttEarnedValueRow[];
501
- /** The project total, rolled up as money sums of the leaves. */
502
- project?: GanttEarnedValueRow;
501
+ /**
502
+ * The project total, rolled up as money sums of the leaves. The figures only:
503
+ * a total belongs to no task, so it carries no id, name or progress.
504
+ */
505
+ project?: GanttEarnedValueTotals;
503
506
  }
504
507
 
505
508
  /**
@@ -515,6 +518,252 @@ export function computeEarnedValue(
515
518
  options?: { statusDate?: number | string | Date; costField?: string; actualCostField?: string },
516
519
  ): GanttEarnedValue;
517
520
 
521
+ /**
522
+ * Why a schedule was refused.
523
+ *
524
+ * The payload of the `error` event — the very object the failed
525
+ * {@link GanttSchedule} carries, handed straight to the handler.
526
+ */
527
+ interface GanttScheduleError {
528
+ /**
529
+ * What was wrong: `cycle`, `duplicate-id`, `bad-duration`, `unknown-task`,
530
+ * `unknown-parent`, `parent-cycle`, `self-dependency`, `bad-link-type` or
531
+ * `dep-across-hierarchy`.
532
+ */
533
+ code: string;
534
+ /** The failure in one English sentence, naming the task or link it is about. */
535
+ message: string;
536
+ /** The ids that form the cycle, on a `cycle`. */
537
+ cycle?: string[];
538
+ /** The task the failure is about, where one task is to blame. */
539
+ id?: string;
540
+ /** A rejected dependency's predecessor, on `dep-across-hierarchy`. */
541
+ from?: string;
542
+ /** A rejected dependency's successor, on `dep-across-hierarchy`. */
543
+ to?: string;
544
+ }
545
+
546
+ /**
547
+ * What every cancellable Gantt event carries on top of its own context.
548
+ *
549
+ * The controller's bus mirrors the grid core's `emitBefore` contract exactly,
550
+ * so a host writes the same handler shape against a Gantt as against a grid: a
551
+ * handler refuses the action by calling `preventDefault(reason?)`, by returning
552
+ * `false`, or by throwing, and may be `async` — every thenable return is
553
+ * awaited before the decision, so a confirm dialog or a server check can hold
554
+ * the write. Veto wins. On a veto the matching `<action>:cancelled` fires with
555
+ * the reason and the model is untouched; an action re-validated after an await
556
+ * and no longer applicable is cancelled as `'stale'`.
557
+ *
558
+ * Only the user-initiated paths are gated. The live/router `rows.apply` path is
559
+ * remote truth and raises none of these.
560
+ */
561
+ interface GanttBeforeEvent {
562
+ /** Which event this is — `beforeTaskMove`, `beforeTaskDelete` and the rest. */
563
+ type: string;
564
+ /** True once a handler has refused the action. */
565
+ defaultPrevented: boolean;
566
+ /** The reason given to `preventDefault`, or null while nothing has refused it. */
567
+ reason: string | null;
568
+ /** Refuse the action; the optional reason is carried on the `<action>:cancelled` event. */
569
+ preventDefault(reason?: string): void;
570
+ }
571
+
572
+ /**
573
+ * An edit about to be applied to one task: the payload of `beforeTaskEdit`,
574
+ * `beforeTaskMove`, `beforeTaskResize`, `beforeProgressChange` and
575
+ * `beforeMilestoneMove`.
576
+ *
577
+ * One payload for the five, because they are one choke point — `applyEdit`
578
+ * classifies the patch and names the event, so which of the five fires says
579
+ * what kind of edit it is and the context below says what the edit is.
580
+ */
581
+ interface GanttTaskEditEvent extends GanttBeforeEvent {
582
+ /** The task being edited, by id. */
583
+ id: string;
584
+ /** The task as it stands before the edit, as a shallow copy. */
585
+ task: GanttTask;
586
+ /** The edit itself: only the fields it changes. */
587
+ patch: { id: string | number; start?: number; end?: number; duration?: number; percentComplete?: number; work?: unknown };
588
+ /** Always `user`: only the user-initiated path is gated. */
589
+ origin: string;
590
+ /** Where the task starts now, from the plan, or its computed early start when it holds no start. */
591
+ from?: number | string | Date;
592
+ /** Where the patch would move it to; absent unless the patch sets `start`. */
593
+ to?: number | string | Date;
594
+ /** The duration the patch asks for; absent unless the patch sets one. */
595
+ duration?: number;
596
+ /** The progress the patch asks for; present only on a `beforeProgressChange`. */
597
+ value?: number;
598
+ /** The progress before it; present only on a `beforeProgressChange`. */
599
+ oldValue?: number;
600
+ }
601
+
602
+ /**
603
+ * An edit that was refused: the payload of `taskEdit:cancelled`,
604
+ * `taskMove:cancelled`, `taskResize:cancelled`, `progressChange:cancelled` and
605
+ * `milestoneMove:cancelled`. The same context the before-event carried, plus
606
+ * the reason; a notification, so it carries no `preventDefault`.
607
+ */
608
+ interface GanttTaskEditCancelledEvent {
609
+ /** The task that was not edited. */
610
+ id: string;
611
+ /** The task, unchanged. */
612
+ task: GanttTask;
613
+ /** The edit that was not applied. */
614
+ patch: { id: string | number; start?: number; end?: number; duration?: number; percentComplete?: number; work?: unknown };
615
+ /** Always `user`. */
616
+ origin: string;
617
+ /** Where the task starts, still. */
618
+ from?: number | string | Date;
619
+ /** Where it would have gone. */
620
+ to?: number | string | Date;
621
+ /** The duration that was asked for. */
622
+ duration?: number;
623
+ /** The progress that was asked for. */
624
+ value?: number;
625
+ /** The progress before it. */
626
+ oldValue?: number;
627
+ /** The reason given to `preventDefault`, `'prevented'` when none was, or `'stale'` when the task had gone by the time a handler settled. */
628
+ reason: string;
629
+ }
630
+
631
+ /**
632
+ * Links about to be created: the payload of `beforeDependencyCreate`. A pure
633
+ * removal or reorder adds no link and is not gated at all.
634
+ */
635
+ interface GanttDependencyCreateEvent extends GanttBeforeEvent {
636
+ /** Only the links this call adds, normalised. */
637
+ added: GanttDependency[];
638
+ /** The whole list the call would leave behind. */
639
+ dependencies: GanttDependency[];
640
+ /** Always `user`. */
641
+ origin: string;
642
+ }
643
+
644
+ /**
645
+ * Links that were not created: the payload of `dependencyCreate:cancelled`. A
646
+ * notification, so it carries no `preventDefault`.
647
+ */
648
+ interface GanttDependencyCreateCancelledEvent {
649
+ /** The links that were not added. */
650
+ added: GanttDependency[];
651
+ /** The list that was not adopted; the controller kept the one it had. */
652
+ dependencies: GanttDependency[];
653
+ /** Always `user`. */
654
+ origin: string;
655
+ /** The reason given to `preventDefault`, or `'prevented'` when none was. */
656
+ reason: string;
657
+ }
658
+
659
+ /** A task about to be deleted, with its incident links: the payload of `beforeTaskDelete`. */
660
+ interface GanttTaskDeleteEvent extends GanttBeforeEvent {
661
+ /** The task being deleted, by id. */
662
+ id: string;
663
+ /** The task itself, as a shallow copy — the only chance a handler has to read it. */
664
+ task: GanttTask;
665
+ /** Always `user`: the live/router `rows.apply` remove is never gated. */
666
+ origin: string;
667
+ }
668
+
669
+ /**
670
+ * A task that was not deleted: the payload of `taskDelete:cancelled`. A
671
+ * notification, so it carries no `preventDefault`.
672
+ */
673
+ interface GanttTaskDeleteCancelledEvent {
674
+ /** The task that stayed. */
675
+ id: string;
676
+ /** The task itself. */
677
+ task: GanttTask;
678
+ /** Always `user`. */
679
+ origin: string;
680
+ /** The reason given to `preventDefault`, `'prevented'` when none was, or `'stale'`. */
681
+ reason: string;
682
+ }
683
+
684
+ /**
685
+ * The events a Gantt controller raises.
686
+ *
687
+ * The controller's own, not a grid's: `grid.on` takes {@link EventName} and
688
+ * knows nothing about these, and a grid-bound Gantt follows the grid's events
689
+ * itself rather than re-publishing them. `on()` takes a name and a listener and
690
+ * warns about nothing, so a misspelt name is a subscription that never fires.
691
+ *
692
+ * The seven `before…` events are cancellable ({@link GanttBeforeEvent}); each
693
+ * has a matching `<action>:cancelled` that fires when a handler refuses,
694
+ * carrying the same context plus the reason. `schedule` and `error` are the
695
+ * recompute's own pair and are raised on every recompute, whatever caused it.
696
+ */
697
+ type GanttEventName =
698
+ /** A recompute succeeded; the payload is the new schedule, resource load and over-allocations included. */
699
+ | 'schedule'
700
+ /** A recompute failed; the previous schedule is kept and the payload says what was wrong. */
701
+ | 'error'
702
+ /** A task edit that is not a move, a resize or a progress change is about to be applied; cancellable. */
703
+ | 'beforeTaskEdit'
704
+ /** A task is about to be moved — the patch sets `start` or `end`; cancellable. */
705
+ | 'beforeTaskMove'
706
+ /** A task is about to be resized — the patch sets `duration`; cancellable. */
707
+ | 'beforeTaskResize'
708
+ /** A task's progress is about to change — the patch sets `percentComplete`; cancellable. */
709
+ | 'beforeProgressChange'
710
+ /** A milestone is about to be moved — a move patch on a zero-length task; cancellable. */
711
+ | 'beforeMilestoneMove'
712
+ /** One or more dependency links are about to be created; cancellable. */
713
+ | 'beforeDependencyCreate'
714
+ /** A task is about to be deleted, along with every link touching it; cancellable. */
715
+ | 'beforeTaskDelete'
716
+ /** A `beforeTaskEdit` handler refused the edit. */
717
+ | 'taskEdit:cancelled'
718
+ /** A `beforeTaskMove` handler refused the move. */
719
+ | 'taskMove:cancelled'
720
+ /** A `beforeTaskResize` handler refused the resize. */
721
+ | 'taskResize:cancelled'
722
+ /** A `beforeProgressChange` handler refused the progress change. */
723
+ | 'progressChange:cancelled'
724
+ /** A `beforeMilestoneMove` handler refused the milestone move. */
725
+ | 'milestoneMove:cancelled'
726
+ /** A `beforeDependencyCreate` handler refused the links. */
727
+ | 'dependencyCreate:cancelled'
728
+ /** A `beforeTaskDelete` handler refused the delete. */
729
+ | 'taskDelete:cancelled';
730
+
731
+ /** What a handler receives, per Gantt event. */
732
+ interface GanttEventPayloads {
733
+ /** The recomputed schedule, exactly as `gantt.schedule` now reads. */
734
+ schedule: GanttSchedule;
735
+ /** Why the recompute failed. */
736
+ error: GanttScheduleError;
737
+ /** The edit about to be applied, with `preventDefault` to stop it. */
738
+ beforeTaskEdit: GanttTaskEditEvent;
739
+ /** The move about to be applied, with `preventDefault` to stop it. */
740
+ beforeTaskMove: GanttTaskEditEvent;
741
+ /** The resize about to be applied, with `preventDefault` to stop it. */
742
+ beforeTaskResize: GanttTaskEditEvent;
743
+ /** The progress about to be written, with `preventDefault` to stop it. */
744
+ beforeProgressChange: GanttTaskEditEvent;
745
+ /** The milestone move about to be applied, with `preventDefault` to stop it. */
746
+ beforeMilestoneMove: GanttTaskEditEvent;
747
+ /** The links about to be created, with `preventDefault` to stop them. */
748
+ beforeDependencyCreate: GanttDependencyCreateEvent;
749
+ /** The task about to be deleted, with `preventDefault` to stop it. */
750
+ beforeTaskDelete: GanttTaskDeleteEvent;
751
+ /** The edit that was not applied, and why. */
752
+ 'taskEdit:cancelled': GanttTaskEditCancelledEvent;
753
+ /** The move that was not applied, and why. */
754
+ 'taskMove:cancelled': GanttTaskEditCancelledEvent;
755
+ /** The resize that was not applied, and why. */
756
+ 'taskResize:cancelled': GanttTaskEditCancelledEvent;
757
+ /** The progress change that was not written, and why. */
758
+ 'progressChange:cancelled': GanttTaskEditCancelledEvent;
759
+ /** The milestone move that was not applied, and why. */
760
+ 'milestoneMove:cancelled': GanttTaskEditCancelledEvent;
761
+ /** The links that were not created, and why. */
762
+ 'dependencyCreate:cancelled': GanttDependencyCreateCancelledEvent;
763
+ /** The task that was not deleted, and why. */
764
+ 'taskDelete:cancelled': GanttTaskDeleteCancelledEvent;
765
+ }
766
+
518
767
  /** A headless Gantt controller: holds the model, recomputes on edits, emits changes. */
519
768
  interface Gantt {
520
769
  /**
@@ -620,12 +869,13 @@ interface Gantt {
620
869
  };
621
870
  };
622
871
  /**
623
- * Subscribe to `schedule` (a recompute succeeded, payload the schedule) or `error`
624
- * (payload the error). Returns a function that unsubscribes.
872
+ * Register an event listener; returns a function that unsubscribes. What each event
873
+ * carries is {@link GanttEventPayloads}; the listener is declared with the widest of
874
+ * them, so narrow on the name inside it.
625
875
  */
626
- on(event: 'schedule' | 'error', fn: (payload: unknown) => void): () => void;
876
+ on(event: GanttEventName, fn: (payload: GanttEventPayloads[GanttEventName]) => void): () => void;
627
877
  /** Remove a listener registered with `on`. */
628
- off(event: 'schedule' | 'error', fn: (payload: unknown) => void): void;
878
+ off(event: GanttEventName, fn: (payload: GanttEventPayloads[GanttEventName]) => void): void;
629
879
  /**
630
880
  * Render the plan into a container as an SVG timeline (bars, dependency
631
881
  * arrows, critical-path highlight, today line, non-working shading,
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Lattice Grid 1.68.1, gantt module
2
+ * Lattice Grid 1.68.2, gantt module
3
3
  * Copyright (c) 2026 TOCLOCO Inc. All rights reserved.
4
4
  * https://latticegrid.dev
5
5
  */
@@ -52,12 +52,12 @@ Object.defineProperty(__exports,"frameBatched",{enumerable:true,get:function(){r
52
52
  Object.defineProperty(__exports,"settleDebounce",{enumerable:true,get:function(){return settleDebounce;}});
53
53
  Object.defineProperty(__exports,"whenIdle",{enumerable:true,get:function(){return whenIdle;}});
54
54
  Object.defineProperty(__exports,"uid",{enumerable:true,get:function(){return uid;}});
55
- const STAMPED_VERSION="1.68.1";
55
+ const STAMPED_VERSION="1.68.2";
56
56
  async function resolveVersion(){
57
57
  if(STAMPED_VERSION!=='0.0.0-source')return STAMPED_VERSION;
58
58
  return STAMPED_VERSION;
59
59
  }
60
- const VERSION="1.68.1";
60
+ const VERSION="1.68.2";
61
61
  const warned=new Set();
62
62
  const WARNED_LIMIT=2000;
63
63
  function rememberWarned(key){
@@ -1619,7 +1619,11 @@ function exportMSPDI(model,opts={}){
1619
1619
  const hoursPerDay=opts.hoursPerDay??8;
1620
1620
  const tasks=Array.isArray(model.tasks)?model.tasks:[];
1621
1621
  const deps=Array.isArray(model.dependencies)?model.dependencies:[];
1622
- const resources=Array.isArray(model.resources)?model.resources:[];
1622
+ const resources=Array.isArray(model.resources)
1623
+ ?model.resources
1624
+ :(model.resources&&typeof model.resources==='object'
1625
+ ?Object.entries(model.resources).map(([name,capacity])=>({id:name,name,capacity}))
1626
+ :[]);
1623
1627
  const schedule=model.schedule&&model.schedule.ok?model.schedule:null;
1624
1628
  const uidOf=new Map();
1625
1629
  tasks.forEach((t,i)=>{
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Lattice Grid 1.68.1, gantt module
2
+ * Lattice Grid 1.68.2, gantt module
3
3
  * Copyright (c) 2026 TOCLOCO Inc. All rights reserved.
4
4
  * https://latticegrid.dev
5
5
  */
@@ -54,12 +54,12 @@ Object.defineProperty(__exports,"frameBatched",{enumerable:true,get:function(){r
54
54
  Object.defineProperty(__exports,"settleDebounce",{enumerable:true,get:function(){return settleDebounce;}});
55
55
  Object.defineProperty(__exports,"whenIdle",{enumerable:true,get:function(){return whenIdle;}});
56
56
  Object.defineProperty(__exports,"uid",{enumerable:true,get:function(){return uid;}});
57
- const STAMPED_VERSION="1.68.1";
57
+ const STAMPED_VERSION="1.68.2";
58
58
  async function resolveVersion(){
59
59
  if(STAMPED_VERSION!=='0.0.0-source')return STAMPED_VERSION;
60
60
  return STAMPED_VERSION;
61
61
  }
62
- const VERSION="1.68.1";
62
+ const VERSION="1.68.2";
63
63
  const warned=new Set();
64
64
  const WARNED_LIMIT=2000;
65
65
  function rememberWarned(key){
@@ -1621,7 +1621,11 @@ function exportMSPDI(model,opts={}){
1621
1621
  const hoursPerDay=opts.hoursPerDay??8;
1622
1622
  const tasks=Array.isArray(model.tasks)?model.tasks:[];
1623
1623
  const deps=Array.isArray(model.dependencies)?model.dependencies:[];
1624
- const resources=Array.isArray(model.resources)?model.resources:[];
1624
+ const resources=Array.isArray(model.resources)
1625
+ ?model.resources
1626
+ :(model.resources&&typeof model.resources==='object'
1627
+ ?Object.entries(model.resources).map(([name,capacity])=>({id:name,name,capacity}))
1628
+ :[]);
1625
1629
  const schedule=model.schedule&&model.schedule.ok?model.schedule:null;
1626
1630
  const uidOf=new Map();
1627
1631
  tasks.forEach((t,i)=>{
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Lattice Grid 1.68.1, gantt module
2
+ * Lattice Grid 1.68.2, gantt module
3
3
  * Copyright (c) 2026 TOCLOCO Inc. All rights reserved.
4
4
  * https://latticegrid.dev
5
5
  */
@@ -54,12 +54,12 @@ Object.defineProperty(__exports,"frameBatched",{enumerable:true,get:function(){r
54
54
  Object.defineProperty(__exports,"settleDebounce",{enumerable:true,get:function(){return settleDebounce;}});
55
55
  Object.defineProperty(__exports,"whenIdle",{enumerable:true,get:function(){return whenIdle;}});
56
56
  Object.defineProperty(__exports,"uid",{enumerable:true,get:function(){return uid;}});
57
- const STAMPED_VERSION="1.68.1";
57
+ const STAMPED_VERSION="1.68.2";
58
58
  async function resolveVersion(){
59
59
  if(STAMPED_VERSION!=='0.0.0-source')return STAMPED_VERSION;
60
60
  return STAMPED_VERSION;
61
61
  }
62
- const VERSION="1.68.1";
62
+ const VERSION="1.68.2";
63
63
  const warned=new Set();
64
64
  const WARNED_LIMIT=2000;
65
65
  function rememberWarned(key){
@@ -1621,7 +1621,11 @@ function exportMSPDI(model,opts={}){
1621
1621
  const hoursPerDay=opts.hoursPerDay??8;
1622
1622
  const tasks=Array.isArray(model.tasks)?model.tasks:[];
1623
1623
  const deps=Array.isArray(model.dependencies)?model.dependencies:[];
1624
- const resources=Array.isArray(model.resources)?model.resources:[];
1624
+ const resources=Array.isArray(model.resources)
1625
+ ?model.resources
1626
+ :(model.resources&&typeof model.resources==='object'
1627
+ ?Object.entries(model.resources).map(([name,capacity])=>({id:name,name,capacity}))
1628
+ :[]);
1625
1629
  const schedule=model.schedule&&model.schedule.ok?model.schedule:null;
1626
1630
  const uidOf=new Map();
1627
1631
  tasks.forEach((t,i)=>{
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Lattice Grid 1.68.1, geo-europe-nuts module type declarations
2
+ * Lattice Grid 1.68.2, geo-europe-nuts module type declarations
3
3
  * Copyright (c) 2026 TOCLOCO Inc. All rights reserved.
4
4
  * https://latticegrid.dev
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Lattice Grid 1.68.1, geo-europe-nuts module
2
+ * Lattice Grid 1.68.2, geo-europe-nuts module
3
3
  * Copyright (c) 2026 TOCLOCO Inc. All rights reserved.
4
4
  * https://latticegrid.dev
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Lattice Grid 1.68.1, geo-uk module type declarations
2
+ * Lattice Grid 1.68.2, geo-uk module type declarations
3
3
  * Copyright (c) 2026 TOCLOCO Inc. All rights reserved.
4
4
  * https://latticegrid.dev
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Lattice Grid 1.68.1, geo-uk module
2
+ * Lattice Grid 1.68.2, geo-uk module
3
3
  * Copyright (c) 2026 TOCLOCO Inc. All rights reserved.
4
4
  * https://latticegrid.dev
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Lattice Grid 1.68.1, geo-us-states module type declarations
2
+ * Lattice Grid 1.68.2, geo-us-states module type declarations
3
3
  * Copyright (c) 2026 TOCLOCO Inc. All rights reserved.
4
4
  * https://latticegrid.dev
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Lattice Grid 1.68.1, geo-us-states module
2
+ * Lattice Grid 1.68.2, geo-us-states module
3
3
  * Copyright (c) 2026 TOCLOCO Inc. All rights reserved.
4
4
  * https://latticegrid.dev
5
5
  */