@toclocoinc/lattice-grid 1.65.0 → 1.67.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 (177) hide show
  1. package/README.md +6 -4
  2. package/angular/LICENSE +111 -0
  3. package/angular/README.md +78 -0
  4. package/angular/fesm2022/toclocoinc-lattice-grid-angular.mjs +2843 -0
  5. package/angular/package.json +16 -0
  6. package/angular/types/toclocoinc-lattice-grid-angular.d.ts +1366 -0
  7. package/docs/API.html +741 -27
  8. package/docs/api-detail.html +137 -4
  9. package/lattice-grid.d.ts +9 -6
  10. package/lattice-grid.esm.min.js +26 -10
  11. package/lattice-grid.min.cjs +26 -10
  12. package/lattice-grid.min.css +1 -1
  13. package/lattice-grid.min.js +26 -10
  14. package/modules/ai.d.ts +1 -1
  15. package/modules/ai.esm.min.js +3 -3
  16. package/modules/ai.min.cjs +3 -3
  17. package/modules/ai.min.js +3 -3
  18. package/modules/angular.d.ts +1 -1
  19. package/modules/angular.esm.min.js +7 -7
  20. package/modules/angular.min.cjs +7 -7
  21. package/modules/angular.min.js +7 -7
  22. package/modules/chart-alluvial.d.ts +1 -1
  23. package/modules/chart-alluvial.esm.min.js +1 -1
  24. package/modules/chart-alluvial.min.cjs +1 -1
  25. package/modules/chart-alluvial.min.js +1 -1
  26. package/modules/chart-arc.d.ts +1 -1
  27. package/modules/chart-arc.esm.min.js +1 -1
  28. package/modules/chart-arc.min.cjs +1 -1
  29. package/modules/chart-arc.min.js +1 -1
  30. package/modules/chart-bubblemap.d.ts +1 -1
  31. package/modules/chart-bubblemap.esm.min.js +1 -1
  32. package/modules/chart-bubblemap.min.cjs +1 -1
  33. package/modules/chart-bubblemap.min.js +1 -1
  34. package/modules/chart-bump.d.ts +1 -1
  35. package/modules/chart-bump.esm.min.js +1 -1
  36. package/modules/chart-bump.min.cjs +1 -1
  37. package/modules/chart-bump.min.js +1 -1
  38. package/modules/chart-calendar.d.ts +1 -1
  39. package/modules/chart-calendar.esm.min.js +1 -1
  40. package/modules/chart-calendar.min.cjs +1 -1
  41. package/modules/chart-calendar.min.js +1 -1
  42. package/modules/chart-decomposition.d.ts +1 -1
  43. package/modules/chart-decomposition.esm.min.js +1 -1
  44. package/modules/chart-decomposition.min.cjs +1 -1
  45. package/modules/chart-decomposition.min.js +1 -1
  46. package/modules/chart-diverging.d.ts +1 -1
  47. package/modules/chart-diverging.esm.min.js +1 -1
  48. package/modules/chart-diverging.min.cjs +1 -1
  49. package/modules/chart-diverging.min.js +1 -1
  50. package/modules/chart-dumbbell.d.ts +1 -1
  51. package/modules/chart-dumbbell.esm.min.js +1 -1
  52. package/modules/chart-dumbbell.min.cjs +1 -1
  53. package/modules/chart-dumbbell.min.js +1 -1
  54. package/modules/chart-fan.d.ts +1 -1
  55. package/modules/chart-fan.esm.min.js +1 -1
  56. package/modules/chart-fan.min.cjs +1 -1
  57. package/modules/chart-fan.min.js +1 -1
  58. package/modules/chart-hexbin.d.ts +1 -1
  59. package/modules/chart-hexbin.esm.min.js +1 -1
  60. package/modules/chart-hexbin.min.cjs +1 -1
  61. package/modules/chart-hexbin.min.js +1 -1
  62. package/modules/chart-hexmap.d.ts +1 -1
  63. package/modules/chart-hexmap.esm.min.js +1 -1
  64. package/modules/chart-hexmap.min.cjs +1 -1
  65. package/modules/chart-hexmap.min.js +1 -1
  66. package/modules/chart-icicle.d.ts +1 -1
  67. package/modules/chart-icicle.esm.min.js +1 -1
  68. package/modules/chart-icicle.min.cjs +1 -1
  69. package/modules/chart-icicle.min.js +1 -1
  70. package/modules/chart-markermap.d.ts +1 -1
  71. package/modules/chart-markermap.esm.min.js +1 -1
  72. package/modules/chart-markermap.min.cjs +1 -1
  73. package/modules/chart-markermap.min.js +1 -1
  74. package/modules/chart-parallel.d.ts +1 -1
  75. package/modules/chart-parallel.esm.min.js +1 -1
  76. package/modules/chart-parallel.min.cjs +1 -1
  77. package/modules/chart-parallel.min.js +1 -1
  78. package/modules/chart-ridgeline.d.ts +1 -1
  79. package/modules/chart-ridgeline.esm.min.js +1 -1
  80. package/modules/chart-ridgeline.min.cjs +1 -1
  81. package/modules/chart-ridgeline.min.js +1 -1
  82. package/modules/chart-roc.d.ts +1 -1
  83. package/modules/chart-roc.esm.min.js +1 -1
  84. package/modules/chart-roc.min.cjs +1 -1
  85. package/modules/chart-roc.min.js +1 -1
  86. package/modules/chart-slope.d.ts +1 -1
  87. package/modules/chart-slope.esm.min.js +1 -1
  88. package/modules/chart-slope.min.cjs +1 -1
  89. package/modules/chart-slope.min.js +1 -1
  90. package/modules/chart-splom.d.ts +1 -1
  91. package/modules/chart-splom.esm.min.js +1 -1
  92. package/modules/chart-splom.min.cjs +1 -1
  93. package/modules/chart-splom.min.js +1 -1
  94. package/modules/chart-waffle.d.ts +1 -1
  95. package/modules/chart-waffle.esm.min.js +1 -1
  96. package/modules/chart-waffle.min.cjs +1 -1
  97. package/modules/chart-waffle.min.js +1 -1
  98. package/modules/charts.d.ts +1 -1
  99. package/modules/charts.esm.min.js +261 -48
  100. package/modules/charts.min.cjs +261 -48
  101. package/modules/charts.min.js +261 -48
  102. package/modules/data-router.d.ts +8 -3
  103. package/modules/data-router.esm.min.js +28 -6
  104. package/modules/data-router.min.cjs +28 -6
  105. package/modules/data-router.min.js +28 -6
  106. package/modules/devtools.d.ts +1 -1
  107. package/modules/devtools.esm.min.js +1 -1
  108. package/modules/devtools.min.cjs +1 -1
  109. package/modules/devtools.min.js +1 -1
  110. package/modules/dhtmlx-compat.d.ts +1 -1
  111. package/modules/dhtmlx-compat.esm.min.js +3 -3
  112. package/modules/dhtmlx-compat.min.cjs +3 -3
  113. package/modules/dhtmlx-compat.min.js +3 -3
  114. package/modules/gantt.d.ts +8 -3
  115. package/modules/gantt.esm.min.js +27 -4
  116. package/modules/gantt.min.cjs +27 -4
  117. package/modules/gantt.min.js +27 -4
  118. package/modules/geo-europe-nuts.d.ts +1 -1
  119. package/modules/geo-europe-nuts.esm.min.js +1 -1
  120. package/modules/geo-uk.d.ts +1 -1
  121. package/modules/geo-uk.esm.min.js +1 -1
  122. package/modules/geo-us-states.d.ts +1 -1
  123. package/modules/geo-us-states.esm.min.js +1 -1
  124. package/modules/geo-world-110m.d.ts +1 -1
  125. package/modules/geo-world-110m.esm.min.js +1 -1
  126. package/modules/geo-world-50m.d.ts +1 -1
  127. package/modules/geo-world-50m.esm.min.js +1 -1
  128. package/modules/htmx.d.ts +1 -1
  129. package/modules/htmx.esm.min.js +26 -10
  130. package/modules/htmx.min.cjs +26 -10
  131. package/modules/htmx.min.js +26 -10
  132. package/modules/kanban.d.ts +10 -3
  133. package/modules/kanban.esm.min.js +24 -4
  134. package/modules/kanban.min.cjs +24 -4
  135. package/modules/kanban.min.js +24 -4
  136. package/modules/kpi.d.ts +10 -3
  137. package/modules/kpi.esm.min.js +27 -4
  138. package/modules/kpi.min.cjs +27 -4
  139. package/modules/kpi.min.js +27 -4
  140. package/modules/layout.d.ts +1 -1
  141. package/modules/layout.esm.min.js +3 -3
  142. package/modules/layout.min.cjs +3 -3
  143. package/modules/layout.min.js +3 -3
  144. package/modules/mock-socket.d.ts +1 -1
  145. package/modules/mock-socket.esm.min.js +1 -1
  146. package/modules/mock-socket.min.cjs +1 -1
  147. package/modules/mock-socket.min.js +1 -1
  148. package/modules/react.d.ts +1 -1
  149. package/modules/react.esm.min.js +3 -3
  150. package/modules/react.min.cjs +3 -3
  151. package/modules/react.min.js +3 -3
  152. package/modules/svelte.d.ts +251 -2
  153. package/modules/svelte.esm.min.js +960 -6
  154. package/modules/svelte.min.cjs +942 -5
  155. package/modules/svelte.min.js +942 -5
  156. package/modules/tabs.d.ts +1 -1
  157. package/modules/tabs.esm.min.js +3 -3
  158. package/modules/tabs.min.cjs +3 -3
  159. package/modules/tabs.min.js +3 -3
  160. package/modules/vue.d.ts +398 -9
  161. package/modules/vue.esm.min.js +1163 -31
  162. package/modules/vue.min.cjs +1147 -30
  163. package/modules/vue.min.js +1147 -30
  164. package/modules/webcomponent.d.ts +233 -1
  165. package/modules/webcomponent.esm.min.js +1274 -41
  166. package/modules/webcomponent.min.cjs +1256 -41
  167. package/modules/webcomponent.min.js +1256 -41
  168. package/package.json +27 -2
  169. package/svelte/Chart.svelte +34 -0
  170. package/svelte/Gantt.svelte +34 -0
  171. package/svelte/Grid.svelte +30 -0
  172. package/svelte/GridProvider.svelte +13 -0
  173. package/svelte/KPI.svelte +34 -0
  174. package/svelte/Kanban.svelte +34 -0
  175. package/svelte/Layout.svelte +34 -0
  176. package/svelte/Router.svelte +16 -0
  177. package/svelte/Tabs.svelte +53 -0
package/modules/tabs.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Lattice Grid 1.65.0, tabs module type declarations
2
+ * Lattice Grid 1.67.0, tabs 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.65.0, tabs module
2
+ * Lattice Grid 1.67.0, tabs 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.65.0";
55
+ const STAMPED_VERSION="1.67.0";
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.65.0";
60
+ const VERSION="1.67.0";
61
61
  const warned=new Set();
62
62
  const WARNED_LIMIT=2000;
63
63
  function rememberWarned(key){
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Lattice Grid 1.65.0, tabs module
2
+ * Lattice Grid 1.67.0, tabs 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.65.0";
57
+ const STAMPED_VERSION="1.67.0";
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.65.0";
62
+ const VERSION="1.67.0";
63
63
  const warned=new Set();
64
64
  const WARNED_LIMIT=2000;
65
65
  function rememberWarned(key){
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Lattice Grid 1.65.0, tabs module
2
+ * Lattice Grid 1.67.0, tabs 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.65.0";
57
+ const STAMPED_VERSION="1.67.0";
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.65.0";
62
+ const VERSION="1.67.0";
63
63
  const warned=new Set();
64
64
  const WARNED_LIMIT=2000;
65
65
  function rememberWarned(key){
package/modules/vue.d.ts CHANGED
@@ -1,24 +1,413 @@
1
1
  /*!
2
- * Lattice Grid 1.65.0, vue module type declarations
2
+ * Lattice Grid 1.67.0, vue module type declarations
3
3
  * Copyright (c) 2026 TOCLOCO Inc. All rights reserved.
4
4
  * https://latticegrid.dev
5
5
  */
6
6
  import type {
7
+ EventName,
8
+ FilterSet,
9
+ Grid,
10
+ GridConfig,
11
+ GridEvent,
12
+ Row,
13
+ RowChange,
14
+ SortEntry,
7
15
  createGrid,
8
16
  } from '../lattice-grid.js';
9
17
 
10
18
  /**
11
- * Build the Vue 3 component.
19
+ * The event name a Vue template binds, as a type: `'cell:changed'` becomes
20
+ * `'cell-changed'`.
12
21
  *
13
- * The Vue runtime and `createGrid` are passed in, for the same reason as the
14
- * React adapter: the package ships no dependencies and cannot import either.
15
- * The dependency key is lowercase `vue` — `createLatticeGrid({ vue, createGrid })`.
22
+ * Recursive over the `:` segments, so a three-part name like
23
+ * `'cell:edit:start'` becomes `'cell-edit-start'` — the same rule
24
+ * `dashedName` applies at runtime, stated once so the props type and the
25
+ * implementation cannot disagree. A colon cannot appear in a Vue binding,
26
+ * which is why the adapter renames at all.
27
+ */
28
+ export type DashJoin<E extends string> =
29
+ E extends `${infer Head}:${infer Tail}` ? `${Head}-${DashJoin<Tail>}` : E;
30
+
31
+ /**
32
+ * One dashed event, as the listener prop Vue's template compiler produces:
33
+ * `'cell-changed'` becomes `'onCell-changed'`.
34
+ *
35
+ * Vue resolves `@cell-changed` to that prop name, so listing them is what
36
+ * makes a template binding type-check.
37
+ */
38
+ export type ListenerProp<E extends string> = `on${Capitalize<E>}`;
39
+
40
+ /** Every event of a set, as the optional listener props a caller may bind. */
41
+ export type LatticeVueListeners<Events extends string, Payload> = {
42
+ [E in Events as ListenerProp<E>]?: (payload: Payload) => void;
43
+ };
44
+
45
+ /**
46
+ * A Vue component, in the shape `defineComponent` produces.
47
+ *
48
+ * Declared here rather than imported from `vue` because the package ships no
49
+ * dependencies: `import type { DefineComponent } from 'vue'` in these
50
+ * declarations would fail to resolve for anyone who has not installed Vue,
51
+ * and every other adapter's types make the same trade. The construct
52
+ * signature is the same convenient fiction Vue's own `DefineComponent` uses —
53
+ * the runtime value is an options object, and the `new ()` is what lets a
54
+ * type checker read `$props` off a component used in a template.
55
+ */
56
+ export type LatticeVueComponent<
57
+ Props = Record<string, unknown>,
58
+ Emit = (event: string, ...args: unknown[]) => void,
59
+ Exposed = unknown,
60
+ > = {
61
+ new (): { $props: Props; $emit: Emit; $slots: Record<string, unknown> } & Exposed;
62
+ readonly name: string;
63
+ readonly emits: readonly string[];
64
+ readonly inheritAttrs: boolean;
65
+ };
66
+
67
+ /** Host-element bindings every component here forwards to its wrapper `div`. */
68
+ export type LatticeVueHostProps = {
69
+ /** Applied to the host element rather than to the viewer. */
70
+ class?: unknown;
71
+ /** Applied to the host element rather than to the viewer. */
72
+ style?: unknown;
73
+ /** Applied to the host element rather than to the viewer. */
74
+ id?: string;
75
+ };
76
+
77
+ /**
78
+ * What `<LatticeGrid>` takes.
79
+ *
80
+ * Generic over the row type so `rows`, `predicates` and the keyed-diff prop
81
+ * are checked against the host's own record shape rather than `unknown`.
82
+ *
83
+ * Every **grid configuration key** is accepted as a binding and diffed with
84
+ * `Object.is` — an inline `:columns="[{ field: 'a' }]"` is a new array on
85
+ * every render and reconfigures the grid on every render, so hoist it or put
86
+ * it behind a `computed`. `sort`, `filters`, `quickFilter` and `selectedKeys`
87
+ * are query/selection state rather than configuration and go through their
88
+ * own setters.
89
+ */
90
+ export type LatticeVueGridProps<Row = unknown> =
91
+ Omit<GridConfig, 'rows'> & LatticeVueHostProps
92
+ & LatticeVueListeners<DashJoin<EventName>, GridEvent> & {
93
+ /** The rows, copied on ingest so two grids may share one array. */
94
+ rows?: Row[];
95
+ /** Applied through `grid.sort.set`, not as configuration. */
96
+ sort?: SortEntry[];
97
+ /** Applied through `grid.filters.set` — replaces the whole tree; see `predicates`. */
98
+ filters?: FilterSet | null;
99
+ /** Applied through `grid.filters.quick`. */
100
+ quickFilter?: string | { text: string; mode?: string };
101
+ /** Applied through `grid.selection.set`. */
102
+ selectedKeys?: string[];
103
+ /**
104
+ * Named row predicates through `grid.filters.where(name, fn)`, diffed by
105
+ * name and removed when a name goes. These **compose** with whatever
106
+ * filter the reader set in the tool panel; `filters` does not.
107
+ */
108
+ predicates?: Record<string, ((row: Row) => boolean) | null>;
109
+ /**
110
+ * A keyed diff handed to `grid.rows.apply()`, applied when the object's
111
+ * identity changes — a feed produces a new change object per batch.
112
+ */
113
+ rowUpdates?: RowChange;
114
+ /** The name this grid publishes itself under in the provided registry. */
115
+ name?: string;
116
+ /** The route value to `attach` to the router in scope, if any. */
117
+ route?: unknown;
118
+ /** Per-route options for that `attach`. */
119
+ routeOptions?: Record<string, unknown>;
120
+ /**
121
+ * Told when the grid exists, for a parent that cannot use a template
122
+ * ref. A template binds it as `@grid-ready`; Vue resolves that to this
123
+ * prop name. It is not one of `EventName`, so the mapped listener type
124
+ * above does not produce it.
125
+ */
126
+ 'onGrid-ready'?: (grid: Grid) => void;
127
+ /** Told just before the grid is destroyed; bound as `@grid-destroyed`. */
128
+ 'onGrid-destroyed'?: () => void;
129
+ };
130
+
131
+ /**
132
+ * What `<LatticeGrid>` emits.
16
133
  *
17
- * The live grid is reached through the component's exposed `grid()` method:
18
- * with `ref="grid"` on the element, `this.$refs.grid.grid()` returns the same
19
- * `Grid` the vanilla `createGrid` returns, or null before mount.
134
+ * `grid-ready` and `grid-destroyed` are named that way because `ready` and
135
+ * `destroy` are **grid event names** already re-emitted here, and React and
136
+ * Angular name their lifecycle pair the same.
20
137
  */
21
- export function createLatticeGrid(deps: { vue: unknown; createGrid: unknown }): unknown;
138
+ export type LatticeVueGridEmit = {
139
+ (event: DashJoin<EventName>, payload: GridEvent): void;
140
+ (event: 'grid-ready', grid: Grid): void;
141
+ (event: 'grid-destroyed'): void;
142
+ };
143
+
144
+ /** What a `<LatticeGrid>` template ref exposes; `grid()` is null before mount. */
145
+ export interface LatticeVueGridExposed {
146
+ grid(): Grid | null;
147
+ }
148
+
149
+ /** The Vue grid component, as the factory returns it. */
150
+ export type LatticeGridComponent<Row = unknown> =
151
+ LatticeVueComponent<LatticeVueGridProps<Row>, LatticeVueGridEmit, LatticeVueGridExposed>;
152
+
153
+ /**
154
+ * Build the Vue 3 grid component.
155
+ *
156
+ * A factory rather than a component, because the adapter imports neither Vue
157
+ * nor the grid: you pass both in. That is what keeps the package's promise of
158
+ * no runtime dependencies, and what stops an adapter disagreeing with the
159
+ * grid version already loaded. The dependency key is lowercase `vue` —
160
+ * `createLatticeGrid({ vue, createGrid })`.
161
+ *
162
+ * The component is built with `defineComponent` and a render function, so it
163
+ * needs no template compiler in your build and runs on `vue.runtime.*`.
164
+ *
165
+ * One grid is created in `onMounted` and destroyed in `onBeforeUnmount`; a
166
+ * prop change is pushed into the live grid and never rebuilds it, so a `v-if`
167
+ * toggled twice leaves exactly one grid alive.
168
+ *
169
+ * The live grid is reached through the exposed `grid()` method on a template
170
+ * ref — `gridRef.value.grid()`, or `this.$refs.grid.grid()` in an options
171
+ * component — which returns the same `Grid` the vanilla `createGrid` returns,
172
+ * or null before mount.
173
+ */
174
+ export function createLatticeGrid<Row = unknown>(deps: {
175
+ vue: unknown;
176
+ createGrid: (el: unknown, config: GridConfig) => Grid;
177
+ }): LatticeGridComponent<Row>;
178
+
179
+ /** What every viewer component takes beyond its own configuration. */
180
+ export type LatticeVueViewerCommonProps = LatticeVueHostProps & {
181
+ /** The grid this viewer is built against; taken from the registry when absent. */
182
+ grid?: Grid | null;
183
+ /** Which published grid to take from the registry; `'default'` when absent. */
184
+ gridName?: string;
185
+ /** Told when the viewer exists, with the instance. */
186
+ onReady?: (instance: unknown) => void;
187
+ /** Told just before it is destroyed. */
188
+ onDestroyed?: () => void;
189
+ };
190
+
191
+ /** What a viewer's template ref exposes; `instance()` is null before mount. */
192
+ export interface LatticeVueViewerExposed<Instance = unknown> {
193
+ instance(): Instance | null;
194
+ }
195
+
196
+ /** A viewer's emitter: its own events under dashed names, plus the lifecycle pair. */
197
+ export type LatticeVueViewerEmit<Events extends string> = {
198
+ (event: Events, payload: unknown): void;
199
+ (event: 'ready', instance: unknown): void;
200
+ (event: 'destroyed'): void;
201
+ };
202
+
203
+ /** The KPI panel's Vue props: its own config, the common ones, and its events. */
204
+ export type LatticeVueKPIProps<Row = unknown> =
205
+ Record<string, unknown> & LatticeVueViewerCommonProps & {
206
+ rows?: Row[];
207
+ } & LatticeVueListeners<
208
+ 'tile-click' | 'tile-dblclick' | 'tile-contextmenu' | 'node-toggle' | 'change', unknown>;
209
+
210
+ /** A chart's Vue props: the spec, the common ones, and its five events. */
211
+ export type LatticeVueChartProps = Record<string, unknown> & LatticeVueViewerCommonProps
212
+ & LatticeVueListeners<'click' | 'hover' | 'leave' | 'draw' | 'legend', unknown>;
213
+
214
+ /** The board's Vue props. */
215
+ export type LatticeVueKanbanProps<Row = unknown> =
216
+ Record<string, unknown> & LatticeVueViewerCommonProps & {
217
+ rows?: Row[];
218
+ quickFilter?: string;
219
+ sprint?: unknown;
220
+ epic?: unknown;
221
+ loading?: boolean;
222
+ error?: string | null;
223
+ };
224
+
225
+ /** The Gantt's Vue props. */
226
+ export type LatticeVueGanttProps = Record<string, unknown> & LatticeVueViewerCommonProps & {
227
+ tasks?: unknown[];
228
+ dependencies?: unknown[];
229
+ } & LatticeVueListeners<'schedule' | 'error', unknown>;
230
+
231
+ /** The layout's Vue props. */
232
+ export type LatticeVueLayoutProps = Record<string, unknown> & LatticeVueViewerCommonProps;
233
+
234
+ /** One tab of a `<LatticeTabs>`; a slot named for its `id` makes it Vue's. */
235
+ export interface LatticeVueTabSpec {
236
+ id: string;
237
+ label?: string;
238
+ [key: string]: unknown;
239
+ }
240
+
241
+ /** The tab strip's Vue props. */
242
+ export type LatticeVueTabsProps = Record<string, unknown> & LatticeVueHostProps & {
243
+ tabs: LatticeVueTabSpec[];
244
+ /** The open tab; changing it calls `activate`. Everything else in `tabs` is mount-time. */
245
+ active?: string;
246
+ /** Told when the strip exists, with it; bound as `@ready`. */
247
+ onReady?: (strip: unknown) => void;
248
+ /** Told just before the strip is destroyed; bound as `@destroyed`. */
249
+ onDestroyed?: () => void;
250
+ } & LatticeVueListeners<'before-tab-change' | 'tab-changed' | 'tab-change-cancelled', unknown>;
251
+
252
+ /**
253
+ * Build a Vue component around any Lattice viewer factory.
254
+ *
255
+ * `viewer` selects the event and live-prop tables; `requires` names the props
256
+ * the viewer cannot be built without (and which rebuild it when their
257
+ * identity changes); `fromContext` names the prop filled from the provided
258
+ * grid registry.
259
+ */
260
+ export function createLatticeViewer(options: {
261
+ vue: unknown;
262
+ viewer: 'kpi' | 'kanban' | 'tabs' | 'chart' | 'gantt' | 'layout' | 'router';
263
+ mount: (el: unknown, config: Record<string, unknown>) => unknown;
264
+ name?: string;
265
+ requires?: string[];
266
+ fromContext?: string;
267
+ }): LatticeVueComponent<Record<string, unknown>, LatticeVueViewerEmit<string>,
268
+ LatticeVueViewerExposed>;
269
+
270
+ /** The KPI panel as a Vue component. Grid-bound through the registry by default. */
271
+ export function createLatticeKPI<Row = unknown>(deps: {
272
+ vue: unknown; createKPI: (el: unknown, config: Record<string, unknown>) => unknown;
273
+ }): LatticeVueComponent<LatticeVueKPIProps<Row>, LatticeVueViewerEmit<string>,
274
+ LatticeVueViewerExposed>;
275
+
276
+ /** A chart as a Vue component. Requires a grid; a new grid rebuilds the chart. */
277
+ export function createLatticeChart(deps: {
278
+ vue: unknown; createChart: (opts: Record<string, unknown>) => unknown;
279
+ }): LatticeVueComponent<LatticeVueChartProps, LatticeVueViewerEmit<string>,
280
+ LatticeVueViewerExposed>;
281
+
282
+ /** The kanban board as a Vue component. */
283
+ export function createLatticeKanban<Row = unknown>(deps: {
284
+ vue: unknown; createKanban: (el: unknown, config: Record<string, unknown>) => unknown;
285
+ }): LatticeVueComponent<LatticeVueKanbanProps<Row>, LatticeVueViewerEmit<string>,
286
+ LatticeVueViewerExposed>;
287
+
288
+ /** The Gantt as a Vue component. */
289
+ export function createLatticeGantt(deps: {
290
+ vue: unknown; createGantt: (opts: Record<string, unknown>) => unknown;
291
+ }): LatticeVueComponent<LatticeVueGanttProps, LatticeVueViewerEmit<string>,
292
+ LatticeVueViewerExposed>;
293
+
294
+ /** The layout as a Vue component. */
295
+ export function createLatticeLayout(deps: {
296
+ vue: unknown; createLayout: (el: unknown, config: Record<string, unknown>) => unknown;
297
+ }): LatticeVueComponent<LatticeVueLayoutProps, LatticeVueViewerEmit<string>,
298
+ LatticeVueViewerExposed>;
299
+
300
+ /**
301
+ * The tab strip, with Vue-rendered tab content.
302
+ *
303
+ * A tab declares its content as a **named slot** — `<template #overview>` for
304
+ * a tab with `id: 'overview'`, or `<template #tab-overview>` — and the slot is
305
+ * rendered into the panel element the module created through a `<Teleport>`,
306
+ * so a tab's grid is a real `<LatticeGrid>` with props, a ref and the
307
+ * surrounding `provide`s. A tab with no slot is left to the module, so
308
+ * configuration-driven grid tabs still work and the two kinds mix on one strip.
309
+ */
310
+ export function createLatticeTabs(deps: {
311
+ vue: unknown;
312
+ createTabs: (el: unknown, config: Record<string, unknown>) => unknown;
313
+ createGrid?: (el: unknown, config: GridConfig) => Grid;
314
+ }): LatticeVueComponent<LatticeVueTabsProps, LatticeVueViewerEmit<string>,
315
+ LatticeVueViewerExposed>;
316
+
317
+ /** Where grids publish themselves so the viewers around them can find one. */
318
+ export interface LatticeVueGridRegistry {
319
+ /** A shallow ref of name → grid; replaced, never mutated, on each change. */
320
+ grids: { value: Readonly<Record<string, Grid>> };
321
+ /** Publish a grid under a name, or withdraw it with `null`. */
322
+ publish(name: string, grid: Grid | null): void;
323
+ }
324
+
325
+ /**
326
+ * The provider component and the composables that write and read the grid
327
+ * registry.
328
+ *
329
+ * A grid-bound viewer needs the grid *instance*, which appears after the
330
+ * first render; a template ref cannot help, because assigning to one
331
+ * re-renders nobody. `provide`/`inject` over a `shallowRef` can.
332
+ */
333
+ export function createLatticeGridContext(deps: { vue: unknown }): {
334
+ LatticeGridProvider: LatticeVueComponent<Record<string, never>>;
335
+ provideLatticeGrids: () => LatticeVueGridRegistry;
336
+ useLatticeGrid: (name?: string) => { value: Grid | null };
337
+ };
338
+
339
+ /** The Data Router handle a `provideLatticeRouter` puts in scope. */
340
+ export interface LatticeVueRouterHandle {
341
+ /** The live router, built the first time anything asks for it. */
342
+ readonly router: unknown;
343
+ /** Attach a grid to a route. */
344
+ attach(grid: Grid, route: unknown, opts?: Record<string, unknown>): void;
345
+ /** Detach a grid, before it is destroyed. */
346
+ detach(grid: Grid): void;
347
+ /** Destroy the router; called for you when the providing scope is disposed. */
348
+ destroy(): void;
349
+ }
350
+
351
+ /**
352
+ * The Data Router composables and the provider component.
353
+ *
354
+ * `provideLatticeRouter(config)` is called in a component's `setup`. The
355
+ * router is built by the first routed grid beneath it and destroyed when that
356
+ * component's scope is, and the config is read **once** — rebuilding would
357
+ * drop every attached grid and every row the router holds.
358
+ */
359
+ export function createLatticeRouter(deps: {
360
+ vue: unknown; createDataRouter: (opts: Record<string, unknown>) => unknown;
361
+ }): {
362
+ provideLatticeRouter: (config?: Record<string, unknown>) => LatticeVueRouterHandle;
363
+ useLatticeRouter: () => LatticeVueRouterHandle | null;
364
+ LatticeRouterProvider: LatticeVueComponent<{ config?: Record<string, unknown> }>;
365
+ };
366
+
367
+ /**
368
+ * Every Vue binding this package ships, from one call.
369
+ *
370
+ * Pass the factories the application uses and it builds those components,
371
+ * leaving the rest undefined. Nothing is imported, so an application that
372
+ * never uses the board never loads the board.
373
+ */
374
+ export function createLatticeVue(deps: {
375
+ vue: unknown;
376
+ createGrid?: (el: unknown, config: GridConfig) => Grid;
377
+ createKPI?: (el: unknown, config: Record<string, unknown>) => unknown;
378
+ createChart?: (opts: Record<string, unknown>) => unknown;
379
+ createKanban?: (el: unknown, config: Record<string, unknown>) => unknown;
380
+ createGantt?: (opts: Record<string, unknown>) => unknown;
381
+ createLayout?: (el: unknown, config: Record<string, unknown>) => unknown;
382
+ createTabs?: (el: unknown, config: Record<string, unknown>) => unknown;
383
+ createDataRouter?: (opts: Record<string, unknown>) => unknown;
384
+ }): Record<string, unknown>;
385
+
386
+ /** Every grid event, as the name a Vue caller binds after `dashedName`. */
22
387
  export const EVENT_NAMES: readonly string[];
388
+ /** `cell:changed` → `cell-changed`: a colon cannot appear in a Vue binding. */
23
389
  export function dashedName(event: string): string;
390
+ /** Every event each non-grid viewer emits, keyed by viewer name. */
391
+ export const VIEWER_EVENTS: Readonly<Record<string, readonly string[]>>;
392
+ /** The props each viewer can take live, and the instance call each becomes. */
393
+ export const VIEWER_APPLY: Readonly<Record<string, Readonly<Record<string, unknown>>>>;
394
+ /** `card:move` → `onCardMove`, the handler key the shared controller dispatches on. */
395
+ export function viewerHandlerName(event: string): string;
396
+ /**
397
+ * The framework-free viewer lifecycle every adapter drives an instance
398
+ * through: mount once, push changed props into the live instance, destroy.
399
+ */
400
+ export function createViewerController(opts: {
401
+ viewer: string;
402
+ mount: (el: unknown, config: Record<string, unknown>) => unknown;
403
+ element: unknown;
404
+ props?: Record<string, unknown>;
405
+ name?: string;
406
+ }): {
407
+ instance: unknown;
408
+ update: (next: Record<string, unknown>) => void;
409
+ destroy: () => void;
410
+ };
411
+ /** The name a grid publishes itself under when the host does not choose one. */
412
+ export const DEFAULT_GRID_NAME: string;
24
413
  export default createLatticeGrid;