@casoon/opengrid 0.20.2 → 0.21.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 (31) hide show
  1. package/CHANGELOG.md +154 -0
  2. package/README.md +10 -6
  3. package/collation/opengrid_collation_bg.wasm +0 -0
  4. package/engine/opengrid_wasm.d.ts +7 -0
  5. package/engine/opengrid_wasm.js +29 -2
  6. package/engine/opengrid_wasm_bg.wasm +0 -0
  7. package/engine/opengrid_wasm_bg.wasm.d.ts +1 -0
  8. package/loader.d.ts +228 -4
  9. package/loader.js +105 -2
  10. package/package.json +19 -3
  11. package/pkg/opengrid_web_components.d.ts +47 -10
  12. package/pkg/opengrid_web_components.js +185 -59
  13. package/pkg/opengrid_web_components_bg.wasm +0 -0
  14. package/pkg/opengrid_web_components_bg.wasm.d.ts +13 -10
  15. package/react/index.d.ts +6 -0
  16. package/react/index.js +10 -1
  17. package/solid/index.d.ts +149 -0
  18. package/solid/index.js +252 -0
  19. package/svelte/Opengrid.svelte +12 -0
  20. package/svelte/OpengridGrid.svelte +6 -0
  21. package/svelte/index.d.ts +13 -1
  22. package/texts/de.js +29 -0
  23. package/vue/index.d.ts +13 -1
  24. package/vue/index.js +20 -2
  25. package/worker.js +5 -0
  26. package/xlsx/opengrid_xlsx_bg.wasm +0 -0
  27. /package/pkg/snippets/{opengrid-web-components-33f835da37ee30df → opengrid-web-components-7b74e96872f41f92}/inline0.js +0 -0
  28. /package/pkg/snippets/{opengrid-web-components-33f835da37ee30df → opengrid-web-components-7b74e96872f41f92}/inline1.js +0 -0
  29. /package/pkg/snippets/{opengrid-web-core-6c69c2a1f831ba74 → opengrid-web-core-2138c846fafc77c3}/inline0.js +0 -0
  30. /package/pkg/snippets/{opengrid-web-core-6c69c2a1f831ba74 → opengrid-web-core-2138c846fafc77c3}/inline1.js +0 -0
  31. /package/pkg/snippets/{opengrid-web-core-6c69c2a1f831ba74 → opengrid-web-core-2138c846fafc77c3}/inline2.js +0 -0
package/CHANGELOG.md CHANGED
@@ -19,6 +19,160 @@ Two things belong in every release entry and are easy to leave out:
19
19
 
20
20
  ## [Unreleased]
21
21
 
22
+ ## [0.21.0] - 2026-11-27
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. The new toolbar items, presets and the number editor's decimal keypad were not tried by
27
+ hand on a touch device, and no MCP host was tried against this version's view.
28
+
29
+ **What breaks:** the `row-key` column is read-only now, so a page that maintains its keys in the grid
30
+ sets `readonly: false` on that column in `set_columns`; see the first entry below. Nothing else in
31
+ the npm package changes an existing call. The Rust crates change no public API.
32
+
33
+ ### Breaking
34
+
35
+ - **Grid:** the `row-key` column is read-only — no editor, no paste, no bulk value, no input in the
36
+ record form, in the new row neither. A page that maintains keys opens
37
+ the key column with `readonly: false` in `set_columns`. A read-only column is no longer required
38
+ in the new row ([#523](https://github.com/casoon/opengrid/issues/523);
39
+ [What can be edited](https://casoon.github.io/opengrid/docs/api/#what-can-be-edited)).
40
+
41
+ ### Added
42
+
43
+ - **Grid:** `row-muted="<field>"` draws the rows whose boolean field is `true` in the muted ink — for
44
+ inactive, archived or context rows. The row also carries the part `row-muted` and `data-muted`, is
45
+ described with the page's word (`rowMuted` in `set_texts`), and stays selectable and editable; its
46
+ selection, hover and focus still show. The field may be left out of `columns`. Exports and print are
47
+ unchanged ([#534](https://github.com/casoon/opengrid/issues/534);
48
+ [Muted rows](https://casoon.github.io/opengrid/docs/api/#muted-rows)).
49
+ - **Grid:** a column that cannot be edited shows a lock in its header and its values in the muted
50
+ ink; a column the page gives `editable: true` is tinted (`--og-editable`), with a pencil in its
51
+ header on a touch screen. The footer says how the focused cell opens (`editHint`) and that
52
+ editing is locked (`editLockedHint`), outside the live region
53
+ ([#523](https://github.com/casoon/opengrid/issues/523)).
54
+ - **Grid:** `row-key` may name a field left out of `columns`, so a page hides the ID by not listing
55
+ it: the key is fetched with every query that names records but shown nowhere, and events,
56
+ saving, the selection, undo and the detail panel name records by it as before
57
+ ([#529](https://github.com/casoon/opengrid/issues/529)). Details:
58
+ [Saving edits](https://casoon.github.io/opengrid/docs/api/#saving-edits).
59
+ - **Grid:** the pointer reaches what the keys reach: a double-click, a double-tap or a tap on the
60
+ focused cell opens the editor, with the phone's keyboard; a long-press, a right click,
61
+ `Shift`+`F10` or the context-menu key opens a cell menu (edit, copy, select the row, open the
62
+ record, the column menu); a long-press and a drag mark a range, a swipe scrolls. Under a finger
63
+ rows and buttons are 44 px tall ([#524](https://github.com/casoon/opengrid/issues/524)). Details:
64
+ [Pointer and touch](https://casoon.github.io/opengrid/docs/api/#pointer-and-touch).
65
+ - **Grid:** the page's own items in the cell menu, `set_cell_actions` (`cellActions` in `connect`),
66
+ fire `opengrid-cell-action` (`onCellAction`) with the cell's column and record key
67
+ ([#524](https://github.com/casoon/opengrid/issues/524)). Details:
68
+ [The cell menu](https://casoon.github.io/opengrid/docs/api/#the-cell-menu).
69
+ - **Grid:** the page's own items in the toolbar: `set_toolbar` (`toolbarItems` in `connect`) draws
70
+ buttons, menu buttons with the column menu's keys, and disabled items that say why, after the
71
+ grid's own controls, and `opengrid-toolbar-action` (`onToolbarAction`) fires with the item's
72
+ `id` and the selection — by key where the grid selects by key. A call is checked like
73
+ `set_columns` and applies none of it on a problem. The `toolbar-end` slot takes the page's own
74
+ controls, outside `role="grid"`, so a date field keeps its keys. Both show with `toolbar`; new
75
+ parts `toolbar-item` and `toolbar-menu` and the text `toolbarRefused`
76
+ ([#531](https://github.com/casoon/opengrid/issues/531)). Details:
77
+ [The page's own items](https://casoon.github.io/opengrid/docs/api/#the-pages-own-items).
78
+ - **Grid:** where the focus is shows: its row and its column's header take a light tint, the
79
+ footer says `Row 1,234 of 5,000 · customer` (`positionCell`) or a range's size with its count,
80
+ sum and average — summed by the source when the range reaches past the loaded rows — a fling
81
+ shows the rows in sight beside the scroll bar, and an edge with columns past it shows a shadow
82
+ ([#525](https://github.com/casoon/opengrid/issues/525)). Details:
83
+ [Where am I](https://casoon.github.io/opengrid/docs/api/#where-am-i).
84
+ - **Grid:** under 560 px of its own width the grid pins the `row-key` column at the start, so a row
85
+ keeps its name while the others scroll. `pinNarrow` in `set_columns` sets a column's pin for
86
+ narrow grids (`none` keeps the key column loose), the column menu offers *Only on narrow
87
+ screens*, and the view holds the reader's choice as `columns.pinnedNarrow`
88
+ ([#525](https://github.com/casoon/opengrid/issues/525)). Details:
89
+ [Pinned columns](https://casoon.github.io/opengrid/docs/api/#pinned-columns).
90
+ - **Grid:** a swipe sideways past the grid's left edge no longer triggers the browser's back gesture
91
+ (`overscroll-behavior-x: contain`); the page still scrolls on at the grid's end. New docs section
92
+ for pages on a phone ([#526](https://github.com/casoon/opengrid/issues/526)). Details:
93
+ [On a phone](https://casoon.github.io/opengrid/docs/api/#on-a-phone).
94
+ - **Grid:** who may edit is decided in three layers, each narrowing the one before: `edit-locked`
95
+ for the whole grid, with the new `edit-toggle` (an *Edit* switch in the toolbar, adapters:
96
+ `editToggle`); the columns the page marked `editable: true` — once one is marked, only those edit —
97
+ and the reader's *Lock column* / *Unlock column* in the column menu, kept in the view as `locked`
98
+ ([#527](https://github.com/casoon/opengrid/issues/527)). Details:
99
+ [Locking edits](https://casoon.github.io/opengrid/docs/api/#locking-edits).
100
+ - **Grid:** a derived field — the year or month of a date — is read-only, with no opt-in: no editor,
101
+ no paste, no bulk value, no record-form input, and `editable: true` on it is reported. The grid
102
+ learns which fields are derived from its provider's `describe(source)`, once per `datasource`
103
+ ([#528](https://github.com/casoon/opengrid/issues/528)). Details:
104
+ [What can be edited](https://casoon.github.io/opengrid/docs/api/#what-can-be-edited).
105
+ - **Grid:** presets, `set_presets(host, [{ id, label, filter? }], { counts? })` (`presets` and
106
+ `presetOptions` in `connect` and the components): the page's named views as a segmented control
107
+ in the toolbar — a `radiogroup`, one tab stop, the arrows choose — the first the default, one
108
+ without a filter an *All*. The chosen preset is and-ed into every query the grid sends, is the
109
+ view's `preset`, is not a chip ("Remove all" leaves it), and is named by the empty state and the
110
+ print caption. `counts: true` puts each preset's rows in its label, one query per preset
111
+ ([#532](https://github.com/casoon/opengrid/issues/532)). Details:
112
+ [Presets](https://casoon.github.io/opengrid/docs/api/#presets).
113
+ - **Loader:** the local and the worker provider have `describe(name)`, answering `{ name, schema }`
114
+ with the schema a source was loaded with, derivations included; the hybrid provider passes its
115
+ remote half's through. A provider of your own without `describe` keeps every field as the result
116
+ says ([#528](https://github.com/casoon/opengrid/issues/528)).
117
+ - **Loader:** `suggestColumns(schema, { rowKey, distinct })` turns a schema into `{ columns, formats }`,
118
+ the two objects `set_columns` and `set_formats` take: the key read-only, mono, muted and narrow;
119
+ numbers aligned at the end and summed; dates formatted; a list facet where the caller says a field
120
+ has few values ([#527](https://github.com/casoon/opengrid/issues/527)). Details:
121
+ [Presentation from the schema](https://casoon.github.io/opengrid/docs/guides/data-you-have/#presentation-from-the-schema).
122
+ - **Grid:** `enter-moves="down"` types a column of values without the arrow key: an `Enter` that
123
+ commits an editor moves the focus to the same column of the next data row — past group headers and
124
+ the total — and opens nothing; a second `Enter` opens it. `Shift`+`Enter` moves up. At the last row
125
+ the focus stays, and a validator that blocks the commit means no move. A page setting, not part of
126
+ the view; adapters: `enterMoves`
127
+ ([#536](https://github.com/casoon/opengrid/issues/536)). Details:
128
+ [Typing a column of values](https://casoon.github.io/opengrid/docs/api/#typing-a-column-of-values).
129
+ - **Grid:** `scale` in `set_columns` makes an `int64` column a scaled integer — money as cents:
130
+ `{ scale: 2 }` stores `612` and shows, edits, filters, pastes and sums `6,12`, in the page's
131
+ notation, with `set_formats` applied to the scaled number. More decimals than the scale are
132
+ refused with the reason, never rounded. The query, the events, the view's filters and the exports
133
+ keep the stored integer; a validator gets it too. Any other type and a lookup column report it
134
+ like every mistake in the call ([#537](https://github.com/casoon/opengrid/issues/537)). Details:
135
+ [Scaled integer columns](https://casoon.github.io/opengrid/docs/api/#scaled-integer-columns).
136
+ - **Grid:** `<opengrid-table>` takes `scale` too and shows the scaled number in its cells, in the
137
+ page's notation and through the column's format; its query and an export keep the stored integer
138
+ ([#537](https://github.com/casoon/opengrid/issues/537)).
139
+ - **Solid:** `@casoon/opengrid/solid` — `OpengridGrid`, `OpengridTable` and `OpengridPivot` for
140
+ Solid 2, built on `connect` like the other adapters: the view is `view` with `onViewChange`, or
141
+ `defaultView`, and the components render on the server and hydrate. `solid-js` and `@solidjs/web`,
142
+ from 2.0.0, are optional peers ([#510](https://github.com/casoon/opengrid/issues/510)). Details:
143
+ [Solid](https://casoon.github.io/opengrid/docs/guides/frameworks/#solid).
144
+
145
+ ### Changed
146
+
147
+ - **Pages:** the project site uses the current shared theme (0.19.0).
148
+ - **Contributors:** the bench tool reports the jumps over 33 ms apart from the wheel steps, and the
149
+ long animation frames of both: time in forced style and layout and in rendering
150
+ ([#518](https://github.com/casoon/opengrid/issues/518)).
151
+ - **Grid:** the editor of a number column is a text field with `inputmode="decimal"` (`"numeric"`
152
+ for integers) instead of `type="number"`. It reads the page's notation — `1,10` and `1.234,50`
153
+ on a German page, the wire notation too — with the reader paste uses, and opens with the value
154
+ written that way. What cannot be read is refused under the editor with the reason, in the cell,
155
+ the record form and the bulk panel, and is no longer committed as NULL; more decimals than the
156
+ scale are refused, never rounded. New texts: `numberInvalid`, `integerInvalid`,
157
+ `numberDecimals`, `numberTooLarge` ([#535](https://github.com/casoon/opengrid/issues/535);
158
+ [Numbers](https://casoon.github.io/opengrid/docs/api/#numbers)).
159
+
160
+ ### Fixed
161
+
162
+ - **Grid:** cell templates draw in a grouped grid: the data rows get their node as in a flat grid,
163
+ the group headers and the total stay untemplated, and `Enter` goes into a control there too. The code dropped every column's template while
164
+ grouped, though the docs said only a grouped column is not templated
165
+ ([#533](https://github.com/casoon/opengrid/issues/533),
166
+ [Cell templates](https://casoon.github.io/opengrid/docs/api/#cell-templates)).
167
+ - **Grid:** a column menu with room neither below nor above its header scrolls inside the window instead of running past its edge.
168
+ - **Grid:** a jump over a result taller than the browser lets an element be (dragging the scroll
169
+ bar over a million rows) placed the old window's rows under the new shift before the new
170
+ window's, two passes over the window in one frame; it now places them once
171
+ ([#518](https://github.com/casoon/opengrid/issues/518)).
172
+ - **Grid:** a `page-size` set or changed after the grid was built kept the old number of row
173
+ slots: the page showed empty rows a screen reader counted, or was cut short; the grid now
174
+ draws exactly the page ([#539](https://github.com/casoon/opengrid/issues/539)).
175
+
22
176
 
23
177
  ## [0.20.2] - 2026-11-23
24
178
 
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.20" # the gateway, as a library
61
- opengrid-connector-sqlite = "0.20" # or opengrid-datasource-postgres
62
- opengrid-engine = "0.20" # the engine alone, native
60
+ opengrid-server = "0.21" # the gateway, as a library
61
+ opengrid-connector-sqlite = "0.21" # or opengrid-datasource-postgres
62
+ opengrid-engine = "0.21" # the engine alone, native
63
63
  ```
64
64
 
65
65
  While the version is 0.x, a minor bump may break the Rust API
@@ -131,16 +131,16 @@ connect(document.querySelector("opengrid-grid"), {
131
131
 
132
132
  See [Where queries run](https://github.com/casoon/opengrid/blob/main/docs/guides/where-queries-run.mdx).
133
133
 
134
- ## React, Vue, Svelte
134
+ ## React, Vue, Svelte, Solid
135
135
 
136
136
  One package: the components are its subpaths, and the framework is an optional peer.
137
137
 
138
138
  ```sh
139
- npm install @casoon/opengrid react # or vue, svelte
139
+ npm install @casoon/opengrid react # or vue, svelte, or solid-js @solidjs/web
140
140
  ```
141
141
 
142
142
  ```jsx
143
- import { OpengridGrid } from "@casoon/opengrid/react"; // or /vue, /svelte
143
+ import { OpengridGrid } from "@casoon/opengrid/react"; // or /vue, /svelte, /solid
144
144
 
145
145
  <OpengridGrid label="Orders" datasource="orders" columns="id,customer,amount"
146
146
  provider={provider} view={view} onViewChange={setView} />
@@ -221,6 +221,10 @@ is tested and what is not: [Accessibility](https://github.com/casoon/opengrid/bl
221
221
  Pre-1.0: a minor version may change the API, a patch version does not
222
222
  ([CHANGELOG](https://github.com/casoon/opengrid/blob/main/CHANGELOG.md)).
223
223
 
224
+ ## Author
225
+
226
+ Built and maintained by [Jörn Seidel](https://www.casoon.de/joern-seidel/) ([CASOON](https://www.casoon.de/)). Background and design decisions are described in an article on Insights (in German): [opengrid und MCP: Ein Data Grid für Modell und Mensch](https://insights.casoon.de/artikel/opengrid-mcp-data-grid-fuer-modell-und-mensch/).
227
+
224
228
  ## Licence
225
229
 
226
230
  MIT OR Apache-2.0.
@@ -36,6 +36,12 @@ export class Engine {
36
36
  * sizes the columns. A file begun before and not ended is dropped.
37
37
  */
38
38
  begin_csv(name: string, schema_json: string, size_hint: number): void;
39
+ /**
40
+ * The schema of the source `name`, as JSON — `{ "fields": [{ "name", "type",
41
+ * "nullable", "from"? }] }`, with the derivation of a derived field (issue
42
+ * #528). What a query's result never says: a result column is never derived.
43
+ */
44
+ describe(name: string): string;
39
45
  /**
40
46
  * The end of the rows: registers the source, replacing one of that name.
41
47
  */
@@ -208,6 +214,7 @@ export interface InitOutput {
208
214
  readonly engine_abort_csv: (a: number) => void;
209
215
  readonly engine_begin_columns: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number];
210
216
  readonly engine_begin_csv: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number];
217
+ readonly engine_describe: (a: number, b: number, c: number) => [number, number, number, number];
211
218
  readonly engine_end_columns: (a: number) => [number, number];
212
219
  readonly engine_end_csv: (a: number) => [number, number];
213
220
  readonly engine_execute: (a: number, b: number, c: number) => [number, number, number, number];
@@ -71,6 +71,33 @@ export class Engine {
71
71
  throw takeFromExternrefTable0(ret[0]);
72
72
  }
73
73
  }
74
+ /**
75
+ * The schema of the source `name`, as JSON — `{ "fields": [{ "name", "type",
76
+ * "nullable", "from"? }] }`, with the derivation of a derived field (issue
77
+ * #528). What a query's result never says: a result column is never derived.
78
+ * @param {string} name
79
+ * @returns {string}
80
+ */
81
+ describe(name) {
82
+ let deferred3_0;
83
+ let deferred3_1;
84
+ try {
85
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
86
+ const len0 = WASM_VECTOR_LEN;
87
+ const ret = wasm.engine_describe(this.__wbg_ptr, ptr0, len0);
88
+ var ptr2 = ret[0];
89
+ var len2 = ret[1];
90
+ if (ret[3]) {
91
+ ptr2 = 0; len2 = 0;
92
+ throw takeFromExternrefTable0(ret[2]);
93
+ }
94
+ deferred3_0 = ptr2;
95
+ deferred3_1 = len2;
96
+ return getStringFromWasm0(ptr2, len2);
97
+ } finally {
98
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
99
+ }
100
+ }
74
101
  /**
75
102
  * The end of the rows: registers the source, replacing one of that name.
76
103
  */
@@ -528,14 +555,14 @@ function __wbg_get_imports() {
528
555
  __wbg___wbindgen_throw_344f42d3211c4765: function(arg0, arg1) {
529
556
  throw new Error(getStringFromWasm0(arg0, arg1));
530
557
  },
531
- __wbg_call_49996a65ff5d60f3: function() { return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) {
558
+ __wbg_call_1ea5c9ef078cfcbc: function() { return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) {
532
559
  const ret = arg1.call(arg2, getStringFromWasm0(arg3, arg4), getArrayU8FromWasm0(arg5, arg6), getArrayU32FromWasm0(arg7, arg8));
533
560
  const ptr1 = passArray8ToWasm0(ret, wasm.__wbindgen_malloc);
534
561
  const len1 = WASM_VECTOR_LEN;
535
562
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
536
563
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
537
564
  }, arguments); },
538
- __wbg_message_4d4230fb6661220d: function(arg0) {
565
+ __wbg_message_8273c3302f11f31d: function(arg0) {
539
566
  const ret = arg0.message;
540
567
  return ret;
541
568
  },
Binary file
@@ -7,6 +7,7 @@ export const engine_abort_columns: (a: number) => void;
7
7
  export const engine_abort_csv: (a: number) => void;
8
8
  export const engine_begin_columns: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number];
9
9
  export const engine_begin_csv: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number];
10
+ export const engine_describe: (a: number, b: number, c: number) => [number, number, number, number];
10
11
  export const engine_end_columns: (a: number) => [number, number];
11
12
  export const engine_end_csv: (a: number) => [number, number];
12
13
  export const engine_execute: (a: number, b: number, c: number) => [number, number, number, number];