@toclocoinc/lattice-grid 1.47.0 → 1.49.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 (72) hide show
  1. package/README.md +1 -1
  2. package/docs/API.html +137 -5
  3. package/docs/api-detail.html +186 -2
  4. package/lattice-grid.d.ts +165 -3
  5. package/lattice-grid.esm.min.js +1665 -154
  6. package/lattice-grid.min.cjs +1665 -154
  7. package/lattice-grid.min.css +1 -1
  8. package/lattice-grid.min.js +1665 -154
  9. package/modules/ai.esm.min.js +29 -4
  10. package/modules/ai.min.cjs +29 -4
  11. package/modules/ai.min.js +29 -4
  12. package/modules/angular.esm.min.js +3 -3
  13. package/modules/angular.min.cjs +3 -3
  14. package/modules/angular.min.js +3 -3
  15. package/modules/chart-alluvial.esm.min.js +1 -1
  16. package/modules/chart-arc.esm.min.js +1 -1
  17. package/modules/chart-bubblemap.esm.min.js +1 -1
  18. package/modules/chart-bump.esm.min.js +1 -1
  19. package/modules/chart-calendar.esm.min.js +1 -1
  20. package/modules/chart-decomposition.esm.min.js +1 -1
  21. package/modules/chart-diverging.esm.min.js +1 -1
  22. package/modules/chart-dumbbell.esm.min.js +1 -1
  23. package/modules/chart-fan.esm.min.js +1 -1
  24. package/modules/chart-hexbin.esm.min.js +1 -1
  25. package/modules/chart-hexmap.esm.min.js +1 -1
  26. package/modules/chart-icicle.esm.min.js +1 -1
  27. package/modules/chart-parallel.esm.min.js +1 -1
  28. package/modules/chart-ridgeline.esm.min.js +1 -1
  29. package/modules/chart-roc.esm.min.js +1 -1
  30. package/modules/chart-slope.esm.min.js +1 -1
  31. package/modules/chart-splom.esm.min.js +1 -1
  32. package/modules/chart-waffle.esm.min.js +1 -1
  33. package/modules/charts.esm.min.js +1368 -1237
  34. package/modules/charts.min.cjs +1368 -1237
  35. package/modules/charts.min.js +1368 -1237
  36. package/modules/data-router.esm.min.js +4 -4
  37. package/modules/data-router.min.cjs +4 -4
  38. package/modules/data-router.min.js +4 -4
  39. package/modules/devtools.esm.min.js +2 -2
  40. package/modules/devtools.min.cjs +2 -2
  41. package/modules/devtools.min.js +2 -2
  42. package/modules/dhtmlx-compat.esm.min.js +4 -4
  43. package/modules/dhtmlx-compat.min.cjs +4 -4
  44. package/modules/dhtmlx-compat.min.js +4 -4
  45. package/modules/gantt.esm.min.js +4 -4
  46. package/modules/gantt.min.cjs +4 -4
  47. package/modules/gantt.min.js +4 -4
  48. package/modules/htmx.esm.min.js +1665 -154
  49. package/modules/htmx.min.cjs +1665 -154
  50. package/modules/htmx.min.js +1665 -154
  51. package/modules/kanban.esm.min.js +4 -4
  52. package/modules/kanban.min.cjs +4 -4
  53. package/modules/kanban.min.js +4 -4
  54. package/modules/kpi.esm.min.js +4 -4
  55. package/modules/kpi.min.cjs +4 -4
  56. package/modules/kpi.min.js +4 -4
  57. package/modules/mock-socket.esm.min.js +2 -2
  58. package/modules/mock-socket.min.cjs +2 -2
  59. package/modules/mock-socket.min.js +2 -2
  60. package/modules/react.esm.min.js +3 -3
  61. package/modules/react.min.cjs +3 -3
  62. package/modules/react.min.js +3 -3
  63. package/modules/svelte.esm.min.js +3 -3
  64. package/modules/svelte.min.cjs +3 -3
  65. package/modules/svelte.min.js +3 -3
  66. package/modules/vue.esm.min.js +3 -3
  67. package/modules/vue.min.cjs +3 -3
  68. package/modules/vue.min.js +3 -3
  69. package/modules/webcomponent.esm.min.js +1665 -154
  70. package/modules/webcomponent.min.cjs +1665 -154
  71. package/modules/webcomponent.min.js +1665 -154
  72. package/package.json +1 -1
package/lattice-grid.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Lattice Grid 1.47.0, type declarations
2
+ * Lattice Grid 1.49.0, type declarations
3
3
  * Copyright (c) 2026 TOCLOCO Inc. All rights reserved.
4
4
  * https://latticegrid.dev
5
5
  */
@@ -1145,6 +1145,41 @@ export interface StreamSourceConfig {
1145
1145
  * rather than what the producer sends.
1146
1146
  */
1147
1147
  maxRows?: number;
1148
+ /**
1149
+ * The longest a row is kept, in milliseconds — a rolling *time* window, sitting
1150
+ * beside `maxRows` as a second, independent bound (BACKLOG-0001036). Rows older
1151
+ * than the span are evicted through the same path, the same `evicted` counters
1152
+ * and the same `stream:evicted` event as the count bound, so an existing
1153
+ * readout keeps working. Set both and whichever bites first applies. Eviction
1154
+ * continues on a low-frequency timer while the feed is idle, so "the last five
1155
+ * minutes" keeps shrinking through a silent period rather than freezing —
1156
+ * which is the thing `maxRows` cannot do.
1157
+ *
1158
+ * Retention is a *bound, not a guillotine*: rows live a little past the span
1159
+ * before a block is dropped. Two things add to it. First the eviction slack,
1160
+ * ten per cent of the span, exactly as `maxRows` overshoots its count, so the
1161
+ * row permutation is rebuilt once per block rather than once per row. Second,
1162
+ * when the feed is idle, up to one tick of the eviction timer, which runs at a
1163
+ * quarter of the span clamped to between 50 ms and one second. So the real
1164
+ * ceiling is roughly `span * 1.1 + tick`, and because the tick has a floor it
1165
+ * is proportionally larger the shorter the window: negligible at a five-minute
1166
+ * window (about 10%), around 1.25x at ten seconds, and as much as ~1.35x at
1167
+ * three. That is the deliberate trade for an idle grid that costs no CPU.
1168
+ *
1169
+ * Omit for no age limit.
1170
+ */
1171
+ maxAge?: number;
1172
+ /**
1173
+ * Which clock `maxAge` reads: a column id (or dotted path), or a function of
1174
+ * the row returning a `Date`, epoch milliseconds, or an ISO string
1175
+ * (BACKLOG-0001036). Given, the window follows the **data's own** clock, so it
1176
+ * means what the producer means — and inherits the producer's clock skew.
1177
+ * Omitted, `maxAge` falls back to **arrival time**: when the row reached this
1178
+ * source. Arrival time needs no timestamp column and cannot be skewed, but it
1179
+ * is not event time — a row delayed in transit counts as young. A row whose
1180
+ * time value cannot be read is never aged out.
1181
+ */
1182
+ ageBy?: string | ((row: unknown) => unknown);
1148
1183
  promoteToMemoryBelow?: number;
1149
1184
  coalesceMs?: number;
1150
1185
  }
@@ -2072,6 +2107,15 @@ export interface GridConfig {
2072
2107
  */
2073
2108
  shortcuts?: boolean;
2074
2109
 
2110
+ /**
2111
+ * The in-grid find bar (BACKLOG-0001018): Ctrl+F / Cmd+F with focus in the
2112
+ * grid opens it; typing highlights every matching cell in place without
2113
+ * filtering a row away; Enter and Shift+Enter step through the matches.
2114
+ * `false` removes the bar and its shortcut; the `grid.find` API still works.
2115
+ * Default true.
2116
+ */
2117
+ find?: boolean | FindConfig;
2118
+
2075
2119
  /**
2076
2120
  * Let a user reorder rows by dragging a handle, or with
2077
2121
  * Alt+Shift+Up/Down.
@@ -3815,7 +3859,7 @@ export type EventName =
3815
3859
  /* Selection and view */
3816
3860
  | 'selection:changed' | 'range:changed' | 'clipboard:copy'
3817
3861
  | 'page:changed' | 'scroll' | 'scroll:end' | 'size:changed'
3818
- | 'detail:toggled' | 'toolpanel:focus' | 'highlight:changed'
3862
+ | 'detail:toggled' | 'toolpanel:focus' | 'highlight:changed' | 'find:changed'
3819
3863
  /* Tree data */
3820
3864
  | 'tree:loading' | 'tree:loaded' | 'tree:loadFailed' | 'tree:loadAborted'
3821
3865
  /* State, history and views */
@@ -4322,7 +4366,10 @@ export interface ScrollApi {
4322
4366
  /**
4323
4367
  * A row key, or a display index. A key survives a sort and is usually what a
4324
4368
  * caller holds; resolving one scans the display order, so prefer an index
4325
- * when scrolling a very large grid repeatedly.
4369
+ * when scrolling a very large grid repeatedly. The row lands fully visible in
4370
+ * the part of the body the pinned strips (pinned rows, sticky group
4371
+ * headings, a bottom grand total) do not cover: `end` puts it just above the
4372
+ * bottom strip, `start` just below the top one.
4326
4373
  */
4327
4374
  toRow(row: string | number, align?: 'start' | 'center' | 'end' | 'auto'): void;
4328
4375
  toColumn(id: string): void;
@@ -4960,6 +5007,106 @@ export interface HighlightApi {
4960
5007
  colourFor(key: string, colId: string): string | null;
4961
5008
  }
4962
5009
 
5010
+ /**
5011
+ * The in-grid find bar's settings (BACKLOG-0001018). `find: true` or an
5012
+ * omitted key mounts the bar with these defaults; `find: false` removes the
5013
+ * bar and its shortcut while `grid.find` keeps working programmatically.
5014
+ */
5015
+ export interface FindConfig {
5016
+ /**
5017
+ * Bind Ctrl+F (Cmd+F on a Mac) while focus is in the grid. The browser's
5018
+ * own find is untouched while focus is anywhere else on the page. Default
5019
+ * true.
5020
+ */
5021
+ shortcut?: boolean;
5022
+ /** Milliseconds of typing quiet before the bar searches. Default 120. */
5023
+ debounce?: number;
5024
+ }
5025
+
5026
+ /**
5027
+ * How `grid.find(text, opts)` matches. Defaults: case-insensitive, substring,
5028
+ * every visible column, starting from the first row. Find matches the
5029
+ * **formatted display text** — what the cell shows, a column `format`
5030
+ * included — never a raw value; there is no regular-expression mode.
5031
+ */
5032
+ export interface FindQuery {
5033
+ /** Match letter case exactly. Default false. */
5034
+ caseSensitive?: boolean;
5035
+ /** The whole cell text must equal the search text rather than contain it. Default false. */
5036
+ wholeCell?: boolean;
5037
+ /** Search only these column ids. Omitted searches every visible column. */
5038
+ columns?: string[] | string | null;
5039
+ /** The display index to start from: the first match at or after it becomes current. Default 0. */
5040
+ from?: number;
5041
+ }
5042
+
5043
+ /** One matching cell. */
5044
+ export interface FindMatch {
5045
+ key: string;
5046
+ colId: string;
5047
+ /** The display index, or -1 for a row pinned to an edge. */
5048
+ index: number;
5049
+ /** Which sticky strip a pinned row is in; null for a body row. */
5050
+ pinned: 'top' | 'bottom' | null;
5051
+ }
5052
+
5053
+ /**
5054
+ * How many matches there are and which is current. `windowed` is the honest
5055
+ * scope flag: over a paged pushdown source only the loaded rows are searched,
5056
+ * so `total` counts matches in `loaded` rows out of the `rows` the source
5057
+ * reports for the whole matching set.
5058
+ */
5059
+ export interface FindCount {
5060
+ /** 1-based position of the current match; 0 when there is none. */
5061
+ current: number;
5062
+ total: number;
5063
+ /** False while the bar's sliced scan is still running, so a partial count is never read as final. */
5064
+ complete: boolean;
5065
+ windowed: boolean;
5066
+ /** Rows the search actually read; a windowed source's not-yet-fetched placeholders are not counted. */
5067
+ loaded: number;
5068
+ /** The rows the source reports for the whole matching set, when it can say. */
5069
+ rows: number;
5070
+ }
5071
+
5072
+ /** The current query and whether the bar is showing. */
5073
+ export interface FindState {
5074
+ text: string;
5075
+ caseSensitive: boolean;
5076
+ wholeCell: boolean;
5077
+ columns: string[] | null;
5078
+ open: boolean;
5079
+ }
5080
+
5081
+ /**
5082
+ * In-grid find (BACKLOG-0001018): locate text and step through where it
5083
+ * occurs without filtering anything away. Matches are a visual overlay — no
5084
+ * row is reordered, removed or edited — and coexist with the quick filter.
5085
+ */
5086
+ export interface FindApi {
5087
+ /** Search now, scanning every loaded row before returning; an empty text clears. */
5088
+ (text: string, opts?: FindQuery): FindCount;
5089
+ /** Show the bar with focus in its input, optionally seeding the text. */
5090
+ open(text?: string): void;
5091
+ /** Hide the bar and clear every match. */
5092
+ close(): void;
5093
+ /** Clear the query and the highlights, leaving the bar as it is. */
5094
+ clear(): void;
5095
+ /** The next match, wrapping from the last to the first, scrolled into view and made the active cell unless an edit is open. */
5096
+ next(): FindMatch | null;
5097
+ /** The previous match, wrapping from the first to the last. */
5098
+ prev(): FindMatch | null;
5099
+ /** Make the match at a position in `matches()` current. */
5100
+ goTo(index: number): FindMatch | null;
5101
+ /** Every match, in display order: pinned-top rows, then the body, then pinned-bottom rows. */
5102
+ matches(): FindMatch[];
5103
+ count(): FindCount;
5104
+ current(): FindMatch | null;
5105
+ state(): FindState;
5106
+ /** How a cell is painted: the current match, another match, or nothing. */
5107
+ stateFor(key: string, colId: string): 'current' | 'match' | null;
5108
+ }
5109
+
4963
5110
  export interface StateApi {
4964
5111
  get(): GridState;
4965
5112
  apply(state: GridState, opts?: { skip?: (keyof GridState)[] }): StateApplyReport;
@@ -5245,6 +5392,8 @@ export interface Grid {
5245
5392
  readonly pagination: PaginationApi;
5246
5393
  /** Transient emphasis on a row, column or cell. */
5247
5394
  readonly highlight: HighlightApi;
5395
+ /** In-grid find: locate text without filtering, and step through the matches. */
5396
+ readonly find: FindApi;
5248
5397
  /** Values hidden from view and from export. */
5249
5398
  readonly redaction: RedactionApi;
5250
5399
  /** An image of the grid as drawn, where the module is installed. */
@@ -6124,6 +6273,19 @@ export interface ChartAxis {
6124
6273
  every?: number;
6125
6274
  /** Force the category labels' rotation rather than deciding it. */
6126
6275
  rotate?: boolean | 'auto';
6276
+ /**
6277
+ * A rolling window for the axis domain (BACKLOG-0001036), in the shipped
6278
+ * `WindowSpec` vocabulary that rolling statistics already use. Only
6279
+ * `{ kind: 'time', span }` applies to an axis: the domain becomes the last
6280
+ * `span` milliseconds ending **now**, so the chart keeps scrolling left while
6281
+ * the feed is silent — the thing a count window cannot do, because with no
6282
+ * rows arriving nothing changes. Advanced on a low-frequency clock (a quarter
6283
+ * of the window, between 50 ms and 1 s), never per frame, and stopped when the
6284
+ * chart is destroyed or its document is hidden. Needs a continuous x axis
6285
+ * carrying wall-clock times; `{ kind: 'count' }` is the source's `maxRows` and
6286
+ * is refused here rather than given a second meaning.
6287
+ */
6288
+ window?: Pick<WindowSpec, 'kind' | 'span'>;
6127
6289
  }
6128
6290
 
6129
6291
  /**