@casoon/opengrid 0.15.0 → 0.17.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 (40) hide show
  1. package/CHANGELOG.md +282 -1
  2. package/README.md +6 -4
  3. package/collation/opengrid_collation.d.ts +47 -0
  4. package/collation/opengrid_collation.js +256 -0
  5. package/collation/opengrid_collation_bg.wasm +0 -0
  6. package/collation/opengrid_collation_bg.wasm.d.ts +10 -0
  7. package/collation.js +78 -0
  8. package/engine/opengrid_wasm.d.ts +18 -1
  9. package/engine/opengrid_wasm.js +76 -0
  10. package/engine/opengrid_wasm_bg.wasm +0 -0
  11. package/engine/opengrid_wasm_bg.wasm.d.ts +5 -1
  12. package/loader.d.ts +405 -18
  13. package/loader.js +485 -95
  14. package/package.json +11 -1
  15. package/pkg/opengrid_web_components.d.ts +76 -10
  16. package/pkg/opengrid_web_components.js +346 -60
  17. package/pkg/opengrid_web_components_bg.wasm +0 -0
  18. package/pkg/opengrid_web_components_bg.wasm.d.ts +18 -9
  19. package/react/index.d.ts +10 -2
  20. package/react/index.js +10 -3
  21. package/svelte/Opengrid.svelte +7 -1
  22. package/svelte/OpengridGrid.svelte +7 -1
  23. package/svelte/OpengridPivot.svelte +3 -3
  24. package/svelte/OpengridTable.svelte +1 -1
  25. package/svelte/index.d.ts +14 -2
  26. package/svelte/index.js +1 -1
  27. package/texts/de.d.ts +5 -0
  28. package/texts/de.js +245 -0
  29. package/vue/index.d.ts +14 -2
  30. package/vue/index.js +11 -6
  31. package/worker.js +7 -3
  32. package/xlsx/opengrid_xlsx.d.ts +69 -0
  33. package/xlsx/opengrid_xlsx.js +375 -0
  34. package/xlsx/opengrid_xlsx_bg.wasm +0 -0
  35. package/xlsx/opengrid_xlsx_bg.wasm.d.ts +16 -0
  36. /package/pkg/snippets/{opengrid-web-components-ef3def04de0cb619 → opengrid-web-components-ae047af7b34e4f04}/inline0.js +0 -0
  37. /package/pkg/snippets/{opengrid-web-components-ef3def04de0cb619 → opengrid-web-components-ae047af7b34e4f04}/inline1.js +0 -0
  38. /package/pkg/snippets/{opengrid-web-core-78fdded9b8a374ed → opengrid-web-core-b158b7dd980e3998}/inline0.js +0 -0
  39. /package/pkg/snippets/{opengrid-web-core-78fdded9b8a374ed → opengrid-web-core-b158b7dd980e3998}/inline1.js +0 -0
  40. /package/pkg/snippets/{opengrid-web-core-78fdded9b8a374ed → opengrid-web-core-b158b7dd980e3998}/inline2.js +0 -0
package/CHANGELOG.md CHANGED
@@ -19,6 +19,285 @@ Two things belong in every release entry and are easy to leave out:
19
19
 
20
20
  ## [Unreleased]
21
21
 
22
+ ## [0.17.0] - 2026-11-13
23
+
24
+ Not yet verified by a screen reader: no pass with assistive technology has been recorded for this
25
+ release ([#5](https://github.com/casoon/opengrid/issues/5)). The keyboard and `axe-core` checks run on
26
+ every change.
27
+
28
+ ### Added
29
+
30
+ - **Query:** a sort key may order text by a locale: `"collation": "de"` (rule S4a). The engine,
31
+ SQLite and PostgreSQL give the same order for Latin, Greek and Cyrillic text. See
32
+ [Query semantics](docs/guides/query-semantics.mdx)
33
+ ([#391](https://github.com/casoon/opengrid/issues/391)).
34
+ - **Query:** the capability `collation`; the planner leaves a sort by a locale to the client where
35
+ a source does not declare it.
36
+ - **Grid:** `collation="de"` sorts the grid's text columns by a locale (`collation` in the
37
+ framework components). See [Sorting text by a locale](docs/api.md#sorting-text-by-a-locale).
38
+ - **Package:** the collation module, `collation/`, about 330 KiB brotli. The providers load it
39
+ when a query first sorts by a locale in the browser, and not otherwise; `Engine.set_collator`
40
+ and `Planner.set_collator` take it.
41
+ - **Crates:** `opengrid-engine` has the feature `icu` (ICU4X's collator, `collation::Icu`);
42
+ `opengrid-connector` and `opengrid-connector-sqlite` turn it on.
43
+
44
+ ### Changed
45
+
46
+ - **Crates:** `opengrid_query::Collation` has the variant `Locale` and is no longer `Copy`.
47
+ **What breaks:** a copied collation is cloned now and a `match` on it needs the new arm;
48
+ `QueryError::CollationNotText`, `ExecuteError::Collation`, `DataSourceCapabilities::collation`
49
+ and `SortKey::collated` are new and matter to code that writes these types out in full.
50
+ - **Build:** the engine module is 4.2 KiB larger and the element module 1.4 KiB; their budgets
51
+ are raised to match.
52
+ - **Pages:** the live demo's first grid sets its header, filter row and facets apart from the
53
+ page behind it, its checkboxes and fields have a darker outline and follow the site's dark
54
+ theme; the card under the hero on the start page has space above it.
55
+
56
+ ## [0.16.0] - 2026-11-12
57
+
58
+ Not yet verified by a screen reader: no pass with assistive technology has been recorded for this
59
+ release ([#5](https://github.com/casoon/opengrid/issues/5)). The keyboard and `axe-core` checks run on
60
+ every change.
61
+
62
+ ### Added
63
+
64
+ - **Grid:** detail panels under a row. `set_detail_renderer(grid, (record, key) => Node)` (`detailRenderer`
65
+ in the framework components) gives the node of a record's panel; a button in the row's first cell and
66
+ `Alt`+`↓` / `Alt`+`↑` open and close it. The panel is one more `row` with one `gridcell` across the
67
+ columns, `aria-rowcount` and the `aria-rowindex` of the rows below count it, its height is measured and
68
+ the scroll area follows. `opengrid-detail-toggle` fires; the view carries the open rows' keys
69
+ (`detail`). Needs a `row-key`; not offered grouped, as a tree or past the sizer's limit. Texts
70
+ `detailShow`, `detailHide`, `detailPanel`, `detailShown` and `detailHidden`
71
+ ([#318](https://github.com/casoon/opengrid/issues/318)).
72
+ - **Export, print:** band names in the header row. The print table writes `Address · City` over a banded
73
+ column; `exportRows(…, { headers })` does the same for CSV and XLSX with the texts
74
+ `get_export_headers(grid)` answers, and a server takes them as `header.<column>` parameters on
75
+ `POST /export/{source}`. A column without a band keeps its field name; JSON has no header row and
76
+ refuses the option ([#353](https://github.com/casoon/opengrid/issues/353),
77
+ [export guide](docs/guides/export.md#naming-the-band), [Column bands](docs/api.md#column-bands)).
78
+ - **Grid:** hide a whole band from its cell. `Delete` on a band's cell, or *Hide band* in its menu
79
+ (`Alt`+`↓`, `Shift`+`F10` or the context-menu key with `column-menu`), hides every column the band
80
+ spans in one step and names the band in the status line; the column list brings it back, and a band
81
+ that is all there is stays ([#352](https://github.com/casoon/opengrid/issues/352),
82
+ [Column bands](docs/api.md#column-bands)).
83
+ - **Export:** XLSX without a server ([#332](https://github.com/casoon/opengrid/issues/332)).
84
+ `exportRows(provider, query, { format: "xlsx" })` now writes the workbook in the tab for the
85
+ engine in the tab, a worker and the hybrid provider — the same writer and the same type rules as
86
+ the server's. It is a module of its own, `@casoon/opengrid/xlsx/` (about 245 KB brotli), that
87
+ `exportRows` loads the first time and a page that never exports to Excel does not fetch. The
88
+ workbook is held in memory, so a workbook in the tab is bounded by `maxRows` (250 000 by
89
+ default; about 120 MB at 100 000 rows) and by Excel's 1 048 575 rows
90
+ ([export guide](docs/guides/export.md#xlsx)).
91
+ - **Grid:** a whole record as a form. `Shift`+`F2` on a data cell opens the record in a native modal
92
+ dialog built from the schema — one labelled field per column, the editor its cell would open, a
93
+ column the page fills shown and not editable. Saving checks every field first (the schema, a required
94
+ column, a blocking validator) and keeps the form open with the reason under the field and the focus on
95
+ the first one; otherwise it fires one `opengrid-cell-change` per changed field and the record is **one**
96
+ undo step. A cancelable `opengrid-record-open` lets a page open its own form instead. Needs `row-key`;
97
+ off while grouped and in a tree ([#325](https://github.com/casoon/opengrid/issues/325),
98
+ [Editing a whole record](docs/api.md#editing-a-whole-record)).
99
+ - **Grid:** a block of cells, marked and copied. `Shift`+arrows, `Shift`+click and dragging mark the
100
+ rectangle between where it began and the focus, announced as a size („3 by 4 cells“) and drawn with
101
+ `data-range`; `Ctrl`/`Cmd`+`C` copies it as values, tab-separated, which a spreadsheet reads and the
102
+ grid's paste reads back unchanged. A text cell a spreadsheet would run as a formula gets the export's
103
+ guard (a leading `'`), which pasting into a text column takes off again. A copy covers the loaded
104
+ rows and says so otherwise; the row selection stays its own thing
105
+ ([#327](https://github.com/casoon/opengrid/issues/327),
106
+ [Copying a range of cells](docs/api.md#copying-a-range-of-cells)).
107
+ - **Grid:** cell templates. `set_cell_templates(host, { column: ({ value, text, row, key }) => Node })`
108
+ (and `cellTemplates` in `connect` and the React, Vue and Svelte adapters) shows a node the page builds —
109
+ a link, a badge, a small bar — instead of a cell's text. Never an HTML string; the source's value stays
110
+ what search, filters, export, copy and events read. The cell stays one stop of the grid pattern:
111
+ `Enter` goes into its controls, `Escape` comes back. Cells are drawn again when their row changes under
112
+ them ([#317](https://github.com/casoon/opengrid/issues/317), [Cell templates](docs/api.md#cell-templates)).
113
+ - **Query:** `icontains` and `istarts_with` — `contains` and `starts_with` ignoring case, both sides
114
+ folded with Unicode's lowercase mapping and no locale (`Müller` is found by `müller`; `ß` stays, a
115
+ final `Σ` becomes `ς`, a Turkish `İ` becomes `i` and a combining dot). The engine, SQLite (a function
116
+ the connector registers) and PostgreSQL (`lower` under ICU's `und-x-icu`, so the database needs ICU)
117
+ agree on the new `fold-cases` of the conformance suite. The filter row offers them
118
+ ([#323](https://github.com/casoon/opengrid/issues/323),
119
+ [query semantics](docs/guides/query-semantics.mdx)). Locale collation of sorting is
120
+ [#391](https://github.com/casoon/opengrid/issues/391).
121
+ - **Server, provider, grid:** a source that changes. `GET /watch/{source}` is an optional,
122
+ notification-only stream (Server-Sent Events, same token, no rows); the application says when data
123
+ changed with `Server::notify_changed`. `createRestProvider({ …, watch: true })` follows it and
124
+ tells the grid with a cancelable `opengrid-source-changed`. The grid moves **nothing**: the
125
+ status line says once that the data changed and a **Refresh** button (or `refresh(grid)`) runs the
126
+ query again, keeping the view, the focus by record, the selection by key and the history
127
+ ([#328](https://github.com/casoon/opengrid/issues/328),
128
+ [protocol](docs/protocol.md#watching-a-source), [A source that changes](docs/api.md#a-source-that-changes)).
129
+ - **Grid:** filters joined by `or`. The search expression takes `or` and parentheses —
130
+ `country = DE or (qty ≥ 900 and customer = Alpha)`, `and` binding tighter — and a value in double
131
+ quotes. An expression the filter row cannot hold — one with an `or`, or with two conditions on
132
+ one column — becomes the grid's one **nested filter**: one chip in words, and-ed onto the filter
133
+ row, the facets, the search and the page's `filter`, in every query the grid sends; every other
134
+ expression still writes the filter row ([#324](https://github.com/casoon/opengrid/issues/324), [Search](docs/api.md#search),
135
+ [Nested filter](docs/api.md#nested-filter)).
136
+ - **Grid:** a builder for the nested filter — a native modal `<dialog>` with conditions in groups
137
+ that match *all* or *any*. The filter's chip opens it; the new attribute `filter-builder` puts
138
+ *Advanced filter* into the toolbar to start one (`filterBuilder` in the framework components).
139
+ New parts `filter-builder`, `filter-builder-dialog` and `chip-edit` ([#324](https://github.com/casoon/opengrid/issues/324)).
140
+ - **Grid:** the view carries the nested filter as `where`, in the wire form of a query's filter
141
+ (type `ViewFilter`); `set_view` restores it and refuses one that names an unknown column, `not`
142
+ or `in` ([#324](https://github.com/casoon/opengrid/issues/324), [The view](docs/api.md#the-view)).
143
+ - **Texts:** `queryOr`, `queryUnclosed`, `queryUnopened`, `queryMissingCondition`,
144
+ `queryMissingJoin`, `filterApplied`, `filterBuilder`, `filterBuilderJoin`, `filterBuilderAll`,
145
+ `filterBuilderAny`, `filterBuilderCondition`, `filterBuilderGroup`, `filterBuilderAddCondition`,
146
+ `filterBuilderAddGroup` and `filterBuilderEdit`, with their German ([#324](https://github.com/casoon/opengrid/issues/324)).
147
+ - **Pivot:** XLSX export, written by the server ([#331](https://github.com/casoon/opengrid/issues/331)).
148
+ `exportPivot(provider, pivot, { format: "xlsx" })` answers the shown pivot as one flat sheet: the
149
+ header row and the rows of its CSV, numbers and dates as typed cells. Over `createPivotProvider`
150
+ and `createRestProvider`, from `POST /pivot/{source}?format=xlsx`
151
+ ([export guide](docs/guides/export.md#a-pivot-as-a-workbook)).
152
+ - **Elements:** right-to-left layout for `<opengrid-grid>`, `<opengrid-table>` and
153
+ `<opengrid-pivot>`, taken from `dir` on the element or an ancestor: the columns run from the
154
+ right, and in the grid `←` and `→` follow what is on the screen
155
+ ([#320](https://github.com/casoon/opengrid/issues/320), [Right to left](docs/api.md#right-to-left)).
156
+ - **Export:** a print path for paper and PDF. `prepare_print(grid)` builds a plain table of every
157
+ match of the view, shown only in `@media print` in place of the grid, and `window.print()` prints
158
+ it; a table, a pivot and a grid print black on white whatever the look
159
+ ([#334](https://github.com/casoon/opengrid/issues/334), [Printing the view](docs/api.md#printing-the-view)).
160
+ - **Grid:** pinned columns. `pin: "start"` or `pin: "end"` in `set_columns` keeps a column in
161
+ place while the others scroll sideways; the reader changes it on the header cell with
162
+ `Alt`+`Shift`+`←`/`→` or from the column menu's *Pin* group, and the view holds that choice as
163
+ `columns.pinned`. A focused cell is scrolled clear of the pinned columns, and when they would take
164
+ more than half of the grid's width they scroll with the others until there is room again. New
165
+ texts `pinGroup`, `pinNone`, `pinStart`, `pinEnd`, `columnPinnedStart`, `columnPinnedEnd`,
166
+ `columnUnpinned` and `pinsReleased`
167
+ ([#316](https://github.com/casoon/opengrid/issues/316), [Pinned columns](docs/api.md#pinned-columns)).
168
+ - **Grid:** column bands, a header above several columns. A column names its band in
169
+ `set_columns` (`band: "Address"`), and the columns that name the same one share a header cell in
170
+ a row above their own; one level. A band is always in one piece: a column moves inside its band,
171
+ `Ctrl`/`Cmd`+`←`/`→` on the band's cell moves the band with its columns, hiding its last shown
172
+ column hides it, and pinning one of its columns pins the band. The arrow keys cross the two
173
+ header rows, and a data cell names its band and its column as its headers. New part `band`
174
+ ([#319](https://github.com/casoon/opengrid/issues/319), [Column bands](docs/api.md#column-bands)).
175
+ - **Grid:** lookup columns. `lookup: { key: label }` in `set_columns` gives a `utf8` or `int64`
176
+ column that stores keys the labels a reader reads: the cell and a group's header show the label,
177
+ the editor is the combobox over the labels, the filter row and the "+ Filter" dialog offer a
178
+ choice among them, and `list` and `pills` facets list them. The value stays the key — in the
179
+ query, the view, the events and every export — and the column **sorts and groups by the key, not
180
+ by the label**; its only aggregate is `count`
181
+ ([#326](https://github.com/casoon/opengrid/issues/326), [Lookup columns](docs/api.md#lookup-columns)).
182
+ - **Grid:** `filter`, the page's filter — a wire filter as JSON, and-ed onto every query the grid
183
+ sends. It is not the reader's: no chip, not in the view, and "remove all" leaves it
184
+ ([#330](https://github.com/casoon/opengrid/issues/330), [The page's filter](docs/api.md#the-pages-filter)).
185
+ - **Pivot:** the rows behind a cell. With `drill-down`, every value is a button that fires
186
+ `opengrid-drill-down` with the cell's filter — NULL and empty-string groups apart, totals by the
187
+ dimensions they lie in, the pivot's own filter included — and the page shows the rows, in a grid
188
+ through its `filter`; `onDrillDown` in `connect` and the framework components
189
+ ([#330](https://github.com/casoon/opengrid/issues/330), [Drilling down](docs/api.md#drilling-down)).
190
+ - **Grid:** a grouped grid with `row-key` selects rows: opening and closing a group never changes
191
+ what is selected, a group header is not selected, and select-all takes every row of the filter,
192
+ open or not ([#322](https://github.com/casoon/opengrid/issues/322)).
193
+ - **Grid:** the view carries a selection by key as `selected`, and `set_view` restores it after
194
+ asking the source which of the keys still name a record; those that do not are dropped and said
195
+ (new text `selectionMissing`). Selecting fires `opengrid-selection-change` only
196
+ ([#322](https://github.com/casoon/opengrid/issues/322)).
197
+ - **Pivot:** calculated measures. A measure with `calc` is shown as its share of the row, the
198
+ column or the grand total (`sum`, `count`), or as a running total along the columns (also `avg`,
199
+ `min`, `max`) — computed by the source,
200
+ chosen from a measure's chip in the toolbar, named in the headers and the exports
201
+ ([#329](https://github.com/casoon/opengrid/issues/329),
202
+ [Calculated measures](docs/api.md#calculated-measures)).
203
+ - **Texts:** a German translation ships with the npm package as `@casoon/opengrid/texts/de` — every
204
+ text of the grid, the table and the pivot, with `lang: "de"`, to hand to `set_texts` or to the
205
+ `texts` of `connect`; a page that does not import it does not load it
206
+ ([#333](https://github.com/casoon/opengrid/issues/333), [Texts](docs/api.md#texts)).
207
+
208
+ ### Changed
209
+
210
+ - **Build:** the shipped modules are optimised with `wasm-opt -Oz --low-memory-unused`, which makes the
211
+ element module 1.4 KiB, the engine 0.8 KiB and the XLSX module 0.9 KiB smaller (brotli); the budget
212
+ bounds are lowered to match ([#366](https://github.com/casoon/opengrid/issues/366)).
213
+ - **Pages:** the project site uses the current shared theme (0.12.12).
214
+ - **Pages:** the project site uses the current shared theme (0.12.11).
215
+ - **Grid:** the free-text search ignores case. **What breaks:** it sent `contains` and now sends
216
+ `icontains`, so `de` finds `DE`; a source that does not know the new operator refuses the query.
217
+ The operator list of the filter row has two more entries after `starts_with`; `set_texts` keys by
218
+ token, so a page's translations are unaffected, but anything that picked an operator by its
219
+ position in the list has moved.
220
+ - **Pages:** the project site uses the current shared theme (0.12.10).
221
+ - **Grid:** the search expression reads `or` and parentheses. **What breaks:** ` or ` (and the
222
+ `queryOr` word) inside a value now ends it, a `)` without its `(` inside a value is refused,
223
+ and a value that starts with `"` and has a closing `"` is the text between them — write such
224
+ values in double quotes: `customer = "this or that"`. Input that starts with `(` and a condition
225
+ is a filter, no longer a text search. The pivot's filter field joins with `and` alone, as before
226
+ ([#324](https://github.com/casoon/opengrid/issues/324)).
227
+ - **Grid:** two conditions on one column are both kept. `amount > 1 and amount < 5` in the search
228
+ field left only the last one in the filter row; now the whole expression becomes the nested
229
+ filter. The same in the pivot's filter field, where both are and-ed. Expressions with one
230
+ condition per column go to the filter row as before ([#324](https://github.com/casoon/opengrid/issues/324)).
231
+ - **Grid:** every grid with `row-key` selects **by key**, grouped or not: the selection stays
232
+ through a sort, a filter, grouping and ungrouping, and select-all asks the source for the keys.
233
+ **What breaks:** with `row-key`, and in a tree, `opengrid-selection-change` is `{ count, keys }`
234
+ and has no `rows` and no `ranges` any more (`SelectionChangeDetail` is a union of
235
+ `SelectionByPosition` and `SelectionByKey`); a sort or a filter no longer drops such a selection;
236
+ `get_view` holds `selected` while something is selected, and `set_view` with a view that has no
237
+ `selected` clears it. Without `row-key` nothing changes
238
+ ([#322](https://github.com/casoon/opengrid/issues/322), `docs/api.md`: *Selecting by key*).
239
+ - **Grid:** the view's `columns` has a fourth field, `pinned`, and every column menu has the three
240
+ entries of the *Pin* group. **What breaks:** a TypeScript `View` written out in full needs
241
+ `columns.pinned` (`{}` for none; `ViewInput`, which `set_view` takes, does not); in the
242
+ `opengrid-grid` crate `ColumnLayout::effective` and `ColumnLayout::move_column` take the pins of
243
+ the page as a further argument ([#316](https://github.com/casoon/opengrid/issues/316)).
244
+ - **Grid:** in the `opengrid-grid` crate the page's part of the column arrangement is one value,
245
+ `layout::PageColumns` (its pins and its bands). **What breaks:** `ColumnLayout::effective`,
246
+ `pin`, `set_pin` and `move_column` take `&PageColumns` where they took the page's pins as a
247
+ slice. The elements and the npm package are not affected
248
+ ([#319](https://github.com/casoon/opengrid/issues/319)).
249
+ - **Grid:** setting `group-by` on a grid that selects by position now says `Selection cleared` and
250
+ fires `opengrid-selection-change` when it drops a selection; it was dropped silently
251
+ ([#322](https://github.com/casoon/opengrid/issues/322)).
252
+ - **Pivot (Rust):** a pivot's measure is `opengrid_pivot::Measure` — an `Aggregate` and its
253
+ optional `Calc`. **What breaks:** `PivotQuery::values` and `ValidatedPivotQuery::values` are
254
+ `Vec<Measure>` (they were `Vec<Aggregate>`; the aggregate is `measure.aggregate`), and
255
+ `PivotError` gained `Calc`, so an exhaustive `match` must handle it. The wire form is unchanged
256
+ for a pivot without `calc` ([#329](https://github.com/casoon/opengrid/issues/329)).
257
+ - **Grid:** `group-by`, the view's `group` and the toolbar's *+ Group* take three grouping levels; a
258
+ fourth is refused as the third was. The default wording of `groupingFull` is now
259
+ `Grouped by three columns already` ([#321](https://github.com/casoon/opengrid/issues/321)).
260
+
261
+ - **Rust:** three public items that nothing was meant to use are closed
262
+ ([#357](https://github.com/casoon/opengrid/issues/357)). **What breaks:**
263
+ `opengrid_datasource::ExecutionMode` is gone — the engine takes
264
+ `opengrid_planner::ExecutionMode`; the fields of `opengrid_server::AppState` are private, read
265
+ `registry()` and `max_concurrent_exports()` instead, so a new setting no longer breaks a caller
266
+ that builds one; the modules `opengrid_server::api` and `opengrid_server::registry` are private,
267
+ with what they offered still at the crate root (`AppState`, `ErrorReport`, `router`, `Registry`,
268
+ `RegistryError`, `RowFilter`, `SourcePolicy`); `opengrid_datasource_postgres::pg_type` is
269
+ not public any more.
270
+ - **Rust:** `opengrid-export`'s feature `xlsx` writes a workbook **in memory**, and the new feature
271
+ `xlsx-streaming` is what `xlsx` was — finished rows go to a temporary file, which the server has
272
+ and a browser has not ([#332](https://github.com/casoon/opengrid/issues/332)).
273
+ **What breaks:** a crate that enabled `opengrid-export/xlsx` for its constant memory enables
274
+ `xlsx-streaming` now (`opengrid-server` does). New: `opengrid_datasource::wire::result_from_bytes`,
275
+ the binary form of an answer read into a result — it moved there from the element module, and
276
+ `opengrid-datasource` depends on `opengrid-columns` for it.
277
+
278
+ ### Fixed
279
+
280
+ - **Grid:** copying a block of cells with `Ctrl`/`Cmd`+`C` works in Firefox and Safari, whose `copy` event does not pass through the shadow root ([#327](https://github.com/casoon/opengrid/issues/327)).
281
+ - **Grid:** pinned columns hold in Safari (WebKit)
282
+ ([#379](https://github.com/casoon/opengrid/issues/379)): the filter field of a pinned column right
283
+ to left, and the one of a pinned band, stay above their column; a filter field that takes the focus
284
+ stands clear of the pinned fields, and a pinned one no longer moves the grid; a pinned cell that
285
+ takes the focus no longer jumps the grid sideways; and the rows of a grid narrower than its table
286
+ are as wide as the table, so a pinned cell has room to stand in.
287
+ - **Grid:** in a tree with rows whose parent is missing, the sentence about them replaced a notice
288
+ that was waiting for the result — a page's `{ notice }` on `set_view` was never said. Both are
289
+ said now, the page's first ([#344](https://github.com/casoon/opengrid/issues/344)).
290
+ - **Grid:** after `group-by` changed, the focus stayed on the old cell while the grid acted on the
291
+ first header, so `Enter` and the arrow keys did nothing useful until the focus moved. A cell that
292
+ had the focus now hands focus and active cell to its column's header; a header keeps both, and
293
+ a column menu or the *+ Group* button gets the focus back where it was
294
+ ([#345](https://github.com/casoon/opengrid/issues/345)).
295
+ - **Grid:** a grouped grid, and a tree, put their window six rows short of where a key or the
296
+ scrolling asked for it: `Ctrl`+`End` stopped before the last position and `ArrowDown` at the
297
+ window's edge needed two presses ([#342](https://github.com/casoon/opengrid/issues/342)).
298
+ - **Docs:** the API reference's link to the protocol, where `where` is described, led to a
299
+ missing page on the project site.
300
+
22
301
  ## [0.15.0] - 2026-11-09
23
302
 
24
303
  **Screen-reader pairings tested: none yet** ([issue #5](https://github.com/casoon/opengrid/issues/5)).
@@ -1385,7 +1664,9 @@ tested.
1385
1664
  tested: React 18 rendering on the server, SvelteKit, Nuxt, Next.js and Astro
1386
1665
  as real applications. A Vite production build needs `loadOpengrid({ moduleUrl })`.
1387
1666
 
1388
- [Unreleased]: https://github.com/casoon/opengrid/compare/v0.15.0...HEAD
1667
+ [Unreleased]: https://github.com/casoon/opengrid/compare/v0.17.0...HEAD
1668
+ [0.17.0]: https://github.com/casoon/opengrid/compare/v0.16.0...v0.17.0
1669
+ [0.16.0]: https://github.com/casoon/opengrid/compare/v0.15.0...v0.16.0
1389
1670
  [0.15.0]: https://github.com/casoon/opengrid/compare/v0.14.0...v0.15.0
1390
1671
  [0.14.0]: https://github.com/casoon/opengrid/compare/v0.13.0...v0.14.0
1391
1672
  [0.13.0]: https://github.com/casoon/opengrid/compare/v0.12.0...v0.13.0
package/README.md CHANGED
@@ -57,9 +57,9 @@ as the npm package, so give every `opengrid-*` crate the same one:
57
57
 
58
58
  ```toml
59
59
  [dependencies]
60
- opengrid-server = "0.15" # the gateway, as a library
61
- opengrid-connector-sqlite = "0.15" # or opengrid-datasource-postgres
62
- opengrid-engine = "0.15" # the engine alone, native
60
+ opengrid-server = "0.17" # the gateway, as a library
61
+ opengrid-connector-sqlite = "0.17" # or opengrid-datasource-postgres
62
+ opengrid-engine = "0.17" # the engine alone, native
63
63
  ```
64
64
 
65
65
  While the version is 0.x, a minor bump may break the Rust API
@@ -166,7 +166,9 @@ const blob = await exportRows(provider, query, { format: "csv" });
166
166
 
167
167
  CSV per RFC 4180 with a guard against formula injection, or JSON; through
168
168
  `createRestProvider` also XLSX, written by the server (`format: "xlsx"`). A pivot exports as
169
- shown with `get_pivot`. See [Export](https://github.com/casoon/opengrid/blob/main/docs/guides/export.md).
169
+ shown with `get_pivot`, and as XLSX from a server with `exportPivot`. For paper and PDF,
170
+ `await module.prepare_print(grid)` builds a plain table of every match, and `window.print()` prints
171
+ it. See [Export](https://github.com/casoon/opengrid/blob/main/docs/guides/export.md).
170
172
 
171
173
  ## Documentation
172
174
 
@@ -0,0 +1,47 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+
4
+ /**
5
+ * The sort keys of `locale` for a batch of strings.
6
+ *
7
+ * `texts` is every string's UTF-8 one after the other and `ends` where each
8
+ * one ends in it. The answer is packed the same way round: the end of every
9
+ * key as a little-endian `u32`, then the keys' bytes — one buffer, since a
10
+ * call across two modules copies each argument once.
11
+ */
12
+ export function sort_keys(locale: string, texts: Uint8Array, ends: Uint32Array): Uint8Array;
13
+
14
+ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
15
+
16
+ export interface InitOutput {
17
+ readonly memory: WebAssembly.Memory;
18
+ readonly sort_keys: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number, number];
19
+ readonly __wbindgen_externrefs: WebAssembly.Table;
20
+ readonly __wbindgen_malloc: (a: number, b: number) => number;
21
+ readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
22
+ readonly __externref_table_dealloc: (a: number) => void;
23
+ readonly __wbindgen_free: (a: number, b: number, c: number) => void;
24
+ readonly __wbindgen_start: () => void;
25
+ }
26
+
27
+ export type SyncInitInput = BufferSource | WebAssembly.Module;
28
+
29
+ /**
30
+ * Instantiates the given `module`, which can either be bytes or
31
+ * a precompiled `WebAssembly.Module`.
32
+ *
33
+ * @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
34
+ *
35
+ * @returns {InitOutput}
36
+ */
37
+ export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;
38
+
39
+ /**
40
+ * If `module_or_path` is {RequestInfo} or {URL}, makes a request and
41
+ * for everything else, calls `WebAssembly.instantiate` directly.
42
+ *
43
+ * @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
44
+ *
45
+ * @returns {Promise<InitOutput>}
46
+ */
47
+ export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;
@@ -0,0 +1,256 @@
1
+ /* @ts-self-types="./opengrid_collation.d.ts" */
2
+
3
+ /**
4
+ * The sort keys of `locale` for a batch of strings.
5
+ *
6
+ * `texts` is every string's UTF-8 one after the other and `ends` where each
7
+ * one ends in it. The answer is packed the same way round: the end of every
8
+ * key as a little-endian `u32`, then the keys' bytes — one buffer, since a
9
+ * call across two modules copies each argument once.
10
+ * @param {string} locale
11
+ * @param {Uint8Array} texts
12
+ * @param {Uint32Array} ends
13
+ * @returns {Uint8Array}
14
+ */
15
+ export function sort_keys(locale, texts, ends) {
16
+ const ptr0 = passStringToWasm0(locale, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
17
+ const len0 = WASM_VECTOR_LEN;
18
+ const ptr1 = passArray8ToWasm0(texts, wasm.__wbindgen_malloc);
19
+ const len1 = WASM_VECTOR_LEN;
20
+ const ptr2 = passArray32ToWasm0(ends, wasm.__wbindgen_malloc);
21
+ const len2 = WASM_VECTOR_LEN;
22
+ const ret = wasm.sort_keys(ptr0, len0, ptr1, len1, ptr2, len2);
23
+ if (ret[3]) {
24
+ throw takeFromExternrefTable0(ret[2]);
25
+ }
26
+ var v4 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
27
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
28
+ return v4;
29
+ }
30
+ function __wbg_get_imports() {
31
+ const import0 = {
32
+ __proto__: null,
33
+ __wbg_Error_92b29b0548f8b746: function(arg0, arg1) {
34
+ const ret = Error(getStringFromWasm0(arg0, arg1));
35
+ return ret;
36
+ },
37
+ __wbindgen_init_externref_table: function() {
38
+ const table = wasm.__wbindgen_externrefs;
39
+ const offset = table.grow(4);
40
+ table.set(0, undefined);
41
+ table.set(offset + 0, undefined);
42
+ table.set(offset + 1, null);
43
+ table.set(offset + 2, true);
44
+ table.set(offset + 3, false);
45
+ },
46
+ };
47
+ return {
48
+ __proto__: null,
49
+ "./opengrid_collation_bg.js": import0,
50
+ };
51
+ }
52
+
53
+ function getArrayU8FromWasm0(ptr, len) {
54
+ ptr = ptr >>> 0;
55
+ return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
56
+ }
57
+
58
+ function getStringFromWasm0(ptr, len) {
59
+ return decodeText(ptr >>> 0, len);
60
+ }
61
+
62
+ let cachedUint32ArrayMemory0 = null;
63
+ function getUint32ArrayMemory0() {
64
+ if (cachedUint32ArrayMemory0 === null || cachedUint32ArrayMemory0.byteLength === 0) {
65
+ cachedUint32ArrayMemory0 = new Uint32Array(wasm.memory.buffer);
66
+ }
67
+ return cachedUint32ArrayMemory0;
68
+ }
69
+
70
+ let cachedUint8ArrayMemory0 = null;
71
+ function getUint8ArrayMemory0() {
72
+ if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
73
+ cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
74
+ }
75
+ return cachedUint8ArrayMemory0;
76
+ }
77
+
78
+ function passArray32ToWasm0(arg, malloc) {
79
+ const ptr = malloc(arg.length * 4, 4) >>> 0;
80
+ getUint32ArrayMemory0().set(arg, ptr / 4);
81
+ WASM_VECTOR_LEN = arg.length;
82
+ return ptr;
83
+ }
84
+
85
+ function passArray8ToWasm0(arg, malloc) {
86
+ const ptr = malloc(arg.length * 1, 1) >>> 0;
87
+ getUint8ArrayMemory0().set(arg, ptr / 1);
88
+ WASM_VECTOR_LEN = arg.length;
89
+ return ptr;
90
+ }
91
+
92
+ function passStringToWasm0(arg, malloc, realloc) {
93
+ if (realloc === undefined) {
94
+ const buf = cachedTextEncoder.encode(arg);
95
+ const ptr = malloc(buf.length, 1) >>> 0;
96
+ getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
97
+ WASM_VECTOR_LEN = buf.length;
98
+ return ptr;
99
+ }
100
+
101
+ let len = arg.length;
102
+ let ptr = malloc(len, 1) >>> 0;
103
+
104
+ const mem = getUint8ArrayMemory0();
105
+
106
+ let offset = 0;
107
+
108
+ for (; offset < len; offset++) {
109
+ const code = arg.charCodeAt(offset);
110
+ if (code > 0x7F) break;
111
+ mem[ptr + offset] = code;
112
+ }
113
+ if (offset !== len) {
114
+ if (offset !== 0) {
115
+ arg = arg.slice(offset);
116
+ }
117
+ ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
118
+ const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
119
+ const ret = cachedTextEncoder.encodeInto(arg, view);
120
+
121
+ offset += ret.written;
122
+ ptr = realloc(ptr, len, offset, 1) >>> 0;
123
+ }
124
+
125
+ WASM_VECTOR_LEN = offset;
126
+ return ptr;
127
+ }
128
+
129
+ function takeFromExternrefTable0(idx) {
130
+ const value = wasm.__wbindgen_externrefs.get(idx);
131
+ wasm.__externref_table_dealloc(idx);
132
+ return value;
133
+ }
134
+
135
+ let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
136
+ cachedTextDecoder.decode();
137
+ const MAX_SAFARI_DECODE_BYTES = 2146435072;
138
+ let numBytesDecoded = 0;
139
+ function decodeText(ptr, len) {
140
+ numBytesDecoded += len;
141
+ if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
142
+ cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
143
+ cachedTextDecoder.decode();
144
+ numBytesDecoded = len;
145
+ }
146
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
147
+ }
148
+
149
+ const cachedTextEncoder = new TextEncoder();
150
+
151
+ if (!('encodeInto' in cachedTextEncoder)) {
152
+ cachedTextEncoder.encodeInto = function (arg, view) {
153
+ const buf = cachedTextEncoder.encode(arg);
154
+ view.set(buf);
155
+ return {
156
+ read: arg.length,
157
+ written: buf.length
158
+ };
159
+ };
160
+ }
161
+
162
+ let WASM_VECTOR_LEN = 0;
163
+
164
+ let wasmModule, wasmInstance, wasm;
165
+ function __wbg_finalize_init(instance, module) {
166
+ wasmInstance = instance;
167
+ wasm = instance.exports;
168
+ wasmModule = module;
169
+ cachedUint32ArrayMemory0 = null;
170
+ cachedUint8ArrayMemory0 = null;
171
+ wasm.__wbindgen_start();
172
+ return wasm;
173
+ }
174
+
175
+ async function __wbg_load(module, imports) {
176
+ if (typeof Response === 'function' && module instanceof Response) {
177
+ if (typeof WebAssembly.instantiateStreaming === 'function') {
178
+ try {
179
+ return await WebAssembly.instantiateStreaming(module, imports);
180
+ } catch (e) {
181
+ const validResponse = module.ok && expectedResponseType(module.type);
182
+
183
+ if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
184
+ console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e);
185
+
186
+ } else { throw e; }
187
+ }
188
+ }
189
+
190
+ const bytes = await module.arrayBuffer();
191
+ return await WebAssembly.instantiate(bytes, imports);
192
+ } else {
193
+ const instance = await WebAssembly.instantiate(module, imports);
194
+
195
+ if (instance instanceof WebAssembly.Instance) {
196
+ return { instance, module };
197
+ } else {
198
+ return instance;
199
+ }
200
+ }
201
+
202
+ function expectedResponseType(type) {
203
+ switch (type) {
204
+ case 'basic': case 'cors': case 'default': return true;
205
+ }
206
+ return false;
207
+ }
208
+ }
209
+
210
+ function initSync(module) {
211
+ if (wasm !== undefined) return wasm;
212
+
213
+
214
+ if (module !== undefined) {
215
+ if (Object.getPrototypeOf(module) === Object.prototype) {
216
+ ({module} = module)
217
+ } else {
218
+ console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
219
+ }
220
+ }
221
+
222
+ const imports = __wbg_get_imports();
223
+ if (!(module instanceof WebAssembly.Module)) {
224
+ module = new WebAssembly.Module(module);
225
+ }
226
+ const instance = new WebAssembly.Instance(module, imports);
227
+ return __wbg_finalize_init(instance, module);
228
+ }
229
+
230
+ async function __wbg_init(module_or_path) {
231
+ if (wasm !== undefined) return wasm;
232
+
233
+
234
+ if (module_or_path !== undefined) {
235
+ if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
236
+ ({module_or_path} = module_or_path)
237
+ } else {
238
+ console.warn('using deprecated parameters for the initialization function; pass a single object instead')
239
+ }
240
+ }
241
+
242
+ if (module_or_path === undefined) {
243
+ module_or_path = new URL('opengrid_collation_bg.wasm', import.meta.url);
244
+ }
245
+ const imports = __wbg_get_imports();
246
+
247
+ if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
248
+ module_or_path = fetch(module_or_path);
249
+ }
250
+
251
+ const { instance, module } = await __wbg_load(await module_or_path, imports);
252
+
253
+ return __wbg_finalize_init(instance, module);
254
+ }
255
+
256
+ export { initSync, __wbg_init as default };
@@ -0,0 +1,10 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ export const memory: WebAssembly.Memory;
4
+ export const sort_keys: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number, number];
5
+ export const __wbindgen_externrefs: WebAssembly.Table;
6
+ export const __wbindgen_malloc: (a: number, b: number) => number;
7
+ export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
8
+ export const __externref_table_dealloc: (a: number) => void;
9
+ export const __wbindgen_free: (a: number, b: number, c: number) => void;
10
+ export const __wbindgen_start: () => void;