@toclocoinc/lattice-grid 1.58.0 → 1.60.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 +3 -3
  2. package/docs/API.html +1773 -73
  3. package/docs/api-detail.html +321 -5
  4. package/lattice-grid.d.ts +281 -2842
  5. package/lattice-grid.esm.min.js +879 -148
  6. package/lattice-grid.min.cjs +879 -148
  7. package/lattice-grid.min.css +1 -1
  8. package/lattice-grid.min.js +879 -148
  9. package/modules/ai.d.ts +401 -0
  10. package/modules/ai.esm.min.js +25 -6
  11. package/modules/ai.min.cjs +25 -6
  12. package/modules/ai.min.js +25 -6
  13. package/modules/angular.d.ts +31 -0
  14. package/modules/angular.esm.min.js +3 -2
  15. package/modules/angular.min.cjs +3 -2
  16. package/modules/angular.min.js +3 -2
  17. package/modules/chart-alluvial.d.ts +18 -0
  18. package/modules/chart-alluvial.esm.min.js +1 -1
  19. package/modules/chart-arc.d.ts +18 -0
  20. package/modules/chart-arc.esm.min.js +1 -1
  21. package/modules/chart-bubblemap.d.ts +18 -0
  22. package/modules/chart-bubblemap.esm.min.js +1 -1
  23. package/modules/chart-bump.d.ts +12 -0
  24. package/modules/chart-bump.esm.min.js +1 -1
  25. package/modules/chart-calendar.d.ts +12 -0
  26. package/modules/chart-calendar.esm.min.js +1 -1
  27. package/modules/chart-decomposition.d.ts +20 -0
  28. package/modules/chart-decomposition.esm.min.js +1 -1
  29. package/modules/chart-diverging.d.ts +12 -0
  30. package/modules/chart-diverging.esm.min.js +1 -1
  31. package/modules/chart-dumbbell.d.ts +18 -0
  32. package/modules/chart-dumbbell.esm.min.js +1 -1
  33. package/modules/chart-fan.d.ts +18 -0
  34. package/modules/chart-fan.esm.min.js +1 -1
  35. package/modules/chart-hexbin.d.ts +18 -0
  36. package/modules/chart-hexbin.esm.min.js +1 -1
  37. package/modules/chart-hexmap.d.ts +18 -0
  38. package/modules/chart-hexmap.esm.min.js +1 -1
  39. package/modules/chart-icicle.d.ts +12 -0
  40. package/modules/chart-icicle.esm.min.js +1 -1
  41. package/modules/chart-parallel.d.ts +19 -0
  42. package/modules/chart-parallel.esm.min.js +1 -1
  43. package/modules/chart-ridgeline.d.ts +14 -0
  44. package/modules/chart-ridgeline.esm.min.js +1 -1
  45. package/modules/chart-roc.d.ts +20 -0
  46. package/modules/chart-roc.esm.min.js +1 -1
  47. package/modules/chart-slope.d.ts +12 -0
  48. package/modules/chart-slope.esm.min.js +1 -1
  49. package/modules/chart-splom.d.ts +19 -0
  50. package/modules/chart-splom.esm.min.js +1 -1
  51. package/modules/chart-waffle.d.ts +12 -0
  52. package/modules/chart-waffle.esm.min.js +1 -1
  53. package/modules/charts.d.ts +122 -0
  54. package/modules/charts.esm.min.js +4 -4
  55. package/modules/charts.min.cjs +4 -4
  56. package/modules/charts.min.js +4 -4
  57. package/modules/data-router.d.ts +91 -0
  58. package/modules/data-router.esm.min.js +109 -17
  59. package/modules/data-router.min.cjs +109 -17
  60. package/modules/data-router.min.js +109 -17
  61. package/modules/devtools.d.ts +28 -0
  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 +19 -0
  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 +515 -0
  70. package/modules/gantt.esm.min.js +109 -33
  71. package/modules/gantt.min.cjs +109 -33
  72. package/modules/gantt.min.js +109 -33
  73. package/modules/htmx.d.ts +176 -0
  74. package/modules/htmx.esm.min.js +879 -148
  75. package/modules/htmx.min.cjs +879 -148
  76. package/modules/htmx.min.js +879 -148
  77. package/modules/kanban.d.ts +492 -0
  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 +255 -0
  82. package/modules/kpi.esm.min.js +40 -7
  83. package/modules/kpi.min.cjs +40 -7
  84. package/modules/kpi.min.js +40 -7
  85. package/modules/layout.d.ts +332 -0
  86. package/modules/layout.esm.min.js +59 -6
  87. package/modules/layout.min.cjs +59 -6
  88. package/modules/layout.min.js +59 -6
  89. package/modules/mock-socket.d.ts +114 -0
  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 +25 -0
  94. package/modules/react.esm.min.js +3 -2
  95. package/modules/react.min.cjs +3 -2
  96. package/modules/react.min.js +3 -2
  97. package/modules/svelte.d.ts +26 -0
  98. package/modules/svelte.esm.min.js +3 -2
  99. package/modules/svelte.min.cjs +3 -2
  100. package/modules/svelte.min.js +3 -2
  101. package/modules/tabs.d.ts +133 -0
  102. package/modules/tabs.esm.min.js +411 -9
  103. package/modules/tabs.min.cjs +411 -9
  104. package/modules/tabs.min.js +411 -9
  105. package/modules/vue.d.ts +24 -0
  106. package/modules/vue.esm.min.js +3 -2
  107. package/modules/vue.min.cjs +3 -2
  108. package/modules/vue.min.js +3 -2
  109. package/modules/webcomponent.d.ts +47 -0
  110. package/modules/webcomponent.esm.min.js +879 -148
  111. package/modules/webcomponent.min.cjs +879 -148
  112. package/modules/webcomponent.min.js +879 -148
  113. package/package.json +2 -2
@@ -0,0 +1,91 @@
1
+ /*!
2
+ * Lattice Grid 1.60.0, data-router module type declarations
3
+ * Copyright (c) 2026 TOCLOCO Inc. All rights reserved.
4
+ * https://latticegrid.dev
5
+ */
6
+ /**
7
+ * A record routed through a data router: any object. Its partition comes from
8
+ * the router's `key` and its identity within a grid from `rowKey`.
9
+ */
10
+ type RouterRecord = Record<string, unknown>;
11
+
12
+ /** A per-route diff summary returned by `load`. */
13
+ interface RouteDiff { added: number; updated: number; removed: number }
14
+
15
+ /** A predicate: a property value (`row[key] === value`) or a `fn(row)`. */
16
+ type RoutePredicate = unknown | ((row: RouterRecord) => boolean);
17
+
18
+ /**
19
+ * Per-route reshaping options (v3, BACKLOG-0000887): `transform` maps/renames/
20
+ * derives each row before the grid sees it; `filter` gives the grid only the
21
+ * rows it admits; `sort` (a comparator or `{ key, dir }`) orders what the grid
22
+ * receives. `rowKey` overrides the router default. All optional.
23
+ */
24
+ interface RouteOptions {
25
+ rowKey?: (string | ((row: RouterRecord) => unknown));
26
+ transform?: (row: RouterRecord) => RouterRecord;
27
+ filter?: (row: RouterRecord) => boolean;
28
+ sort?: (((a: RouterRecord, b: RouterRecord) => number) | { key: string; dir?: 'asc' | 'desc' });
29
+ }
30
+
31
+ /**
32
+ * A cross-grid selection relation (v2, BACKLOG-0000880): a key map (target
33
+ * rows whose `to` value is among the selected source rows' `from` values — an
34
+ * IN set), or a function handed the selected source rows that returns a
35
+ * target-row predicate.
36
+ */
37
+ type SelectionRelation =
38
+ | { from: string; to: string }
39
+ | ((selected: RouterRecord[]) => ((row: RouterRecord) => boolean));
40
+
41
+ /**
42
+ * A data router: one arriving stream, partitioned by a property (or composite
43
+ * predicate), fanned out to a grid per partition (BACKLOG-0000879). Each grid
44
+ * sees only its slice, updated by keyed diff through the public
45
+ * `grid.rows.apply` path — no grid-core change, no cross-references between
46
+ * grids. Snapshots apply keyed diffs (unchanged rows never repaint); deltas add,
47
+ * update or remove in place by `rowKey`, preserving selection and scroll.
48
+ */
49
+ interface DataRouter {
50
+ /** Attach a grid behind a predicate; `opts` may reshape/filter/sort the route (v3). */
51
+ attach(grid: unknown, predicate: RoutePredicate, opts?: RouteOptions): DataRouter;
52
+ /** Attach the "rest" sink for records no explicit route matched. */
53
+ attachDefault(grid: unknown, opts?: RouteOptions): DataRouter;
54
+ /** Detach a grid; the host still owns and destroys it. */
55
+ detach(grid: unknown): DataRouter;
56
+ /** Apply a full snapshot as a keyed diff per grid; returns per-route counts. */
57
+ load(snapshot: RouterRecord[]): RouteDiff[];
58
+ /** Apply incremental deltas, routed and applied in place by `rowKey`. */
59
+ apply(deltas: { op: 'upsert' | 'delete'; row: RouterRecord }[]): void;
60
+ /**
61
+ * Link a source grid's selection to what a target grid receives (v2,
62
+ * BACKLOG-0000880): the target shows the subset of its partition the
63
+ * `relation` admits, re-pushed through the keyed-diff path. No selection
64
+ * shows the full partition; changes are debounced.
65
+ */
66
+ link(source: unknown, target: unknown, relation: SelectionRelation): DataRouter;
67
+ /** Apply any debounced selection refilter synchronously (for tests/determinism). */
68
+ flush(): DataRouter;
69
+ /** How many records matched no route. */
70
+ readonly unrouted: number;
71
+ /** Detach every grid and drop every link (the host destroys the grids themselves). */
72
+ destroy(): void;
73
+ }
74
+
75
+ /**
76
+ * Create a data router that partitions one stream to many grids.
77
+ *
78
+ * `key` is the partition property or `fn(row)`; `rowKey` is the identity within
79
+ * a grid; `overlap` fans a record to every matching route (default: first match
80
+ * wins); `onUnrouted` receives records that match none; `selectionDebounce` is
81
+ * the debounce in ms for cross-grid selection refilters (default 16; `0` is
82
+ * synchronous).
83
+ */
84
+ export function createDataRouter(opts: {
85
+ key: (string | ((row: RouterRecord) => unknown));
86
+ rowKey?: (string | ((row: RouterRecord) => unknown));
87
+ overlap?: boolean;
88
+ onUnrouted?: (item: unknown) => void;
89
+ selectionDebounce?: number;
90
+ }): DataRouter;
91
+ export default createDataRouter;