@casoon/opengrid 0.9.0 → 0.11.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.
package/CHANGELOG.md CHANGED
@@ -18,6 +18,111 @@ Two things belong in every release entry and are easy to leave out:
18
18
 
19
19
  ## [Unreleased]
20
20
 
21
+ ## [0.11.0] — 2026-10-08
22
+
23
+ **Screen-reader pairings tested: none yet** ([issue #5](https://github.com/casoon/opengrid/issues/5)).
24
+ **Browsers:** Chromium (the whole e2e suite: 1127 passed), WebKit (`just e2e-browsers` on macOS:
25
+ 556 passed, 10 skipped by design). Firefox, on Linux (`gh workflow run ci.yml -f browsers=true`,
26
+ since Playwright's Firefox does not start on the release machine): **two failures** — an unnamed
27
+ tab stop in the narrow toolbar and a scroll area 1 px short after unfolding a cell
28
+ ([#157](https://github.com/casoon/opengrid/issues/157)); everything else passed.
29
+
30
+ The grid as an editing surface a page saves cell by cell: the edit names its record, the page says
31
+ what became of it, and fills columns of its own. Asked for by a grade entry grid.
32
+
33
+ **What breaks:** nothing. Every change is an addition.
34
+
35
+ **Module sizes** (brotli, `just measure-modules`): the elements 239.8 → 243.5 KiB, past their bound,
36
+ which this release raises (`scripts/module-budget.txt`); the engine is unchanged to the byte.
37
+
38
+ ### Added
39
+
40
+ - **Saving edits from the page** ([#153](https://github.com/casoon/opengrid/issues/153)).
41
+ - `row-key="<field>"` names the record: `opengrid-cell-change` carries `key`, the edited row's
42
+ value of that field, next to `row` — which holds only until something sorts or reloads.
43
+ - `set_cell_state(host, key, column, state, message?)` with `saving`, `saved` or `error`.
44
+ `saved` takes the unsaved mark off without a reload; `error` keeps the value and the mark,
45
+ sets `aria-invalid` and says `message` in the grid's one polite live region. The focus never
46
+ moves.
47
+ - Each state is a part of its own next to `cell` — `cell-saving`, `cell-saved`, `cell-error` —
48
+ so a page styles it with `::part(cell-error)`.
49
+ - `set_values(host, [{ key, column, value }])` shows values the page computes. Not edits: no
50
+ unsaved mark, no event.
51
+ - `readonly: true` in `set_columns`: the column never opens an editor and its cells say
52
+ `aria-readonly`. `<opengrid-table>` refuses the option.
53
+ - States and values name records, so they outlive sorting, filtering and reloading; another
54
+ `row-key` or `datasource` forgets them. A guide: *Saving edits from the page*.
55
+
56
+ ## [0.10.0] — 2026-10-02
57
+
58
+ **Screen-reader pairings tested: none yet** ([issue #5](https://github.com/casoon/opengrid/issues/5)).
59
+ **Browsers:** Chromium (the whole e2e suite: 1116 passed; the 480 px filter test, a known flake, passed on its own rerun). WebKit and Firefox: **not run** for this release.
60
+
61
+ The grid shows a tree: rows that name their parent, loaded a level at a time, with the treegrid's
62
+ keys and a selection by key. Beside it, the query of a view without an element, a sentence of the
63
+ page said with a new view, and Intl formats under a strict Content Security Policy.
64
+
65
+ **What breaks:**
66
+ - Rust: `Query` and `QueryResult` have a new public field, `tree`; struct literals need it
67
+ (`tree: None`). `DataSourceCapabilities` has a new field, `tree`.
68
+
69
+ **Module sizes** (brotli, `just measure-modules`): the elements 224.8 → 239.8 KiB, the engine
70
+ 118.8 → 133.8 KiB — both past their bounds, which this release raises (`scripts/module-budget.txt`):
71
+ the tree in the grid and in the engine is most of it; `view_query`'s share is 5.3 KiB raw.
72
+
73
+ ### Added
74
+
75
+ - **A tree in `<opengrid-grid>`** ([#135](https://github.com/casoon/opengrid/issues/135), E38).
76
+ `tree="parent_id"` (and `tree-key`, `id` when absent) shows the rows as a `treegrid`, loaded a
77
+ level at a time with each node's child count, so a leaf offers nothing to open. Rows carry
78
+ `aria-level`, `aria-posinset`/`aria-setsize`, `aria-expanded` where something opens and
79
+ `aria-busy` while it loads; the first column is indented by depth. On a node's first cell `→`
80
+ opens it or goes to its first child, `←` closes it or goes to its parent; a click on the first
81
+ cell opens or closes it. A filter keeps the path to a match as muted context; the status line
82
+ counts matches and names orphans once. Open nodes travel in the view's `expanded`, each `[key]`.
83
+ `page-size` refuses a tree; `group-by` is not used in one and + Group says why. React, Vue and
84
+ Svelte take `tree` and `treeKey`.
85
+ - **A tree's selection names nodes by key** ([#135](https://github.com/casoon/opengrid/issues/135)).
86
+ It stays when nodes close over it and when the grid is sorted or filtered;
87
+ `opengrid-selection-change` carries `keys`, and `count` counts every selected node. Select-all
88
+ takes the nodes shown. Editing is off in a tree.
89
+ - **The query of a view without an element** ([#144](https://github.com/casoon/opengrid/issues/144)).
90
+ `engine.view_query(source, columns, view)` answers what `get_query()` answers on a grid with
91
+ these columns once the view is applied — so a server can count or export a saved view without a
92
+ browser. A view naming an unknown column, or a value its column cannot hold, is refused with every
93
+ problem named.
94
+ - **`set_view(host, view, { notice })`** ([#146](https://github.com/casoon/opengrid/issues/146)).
95
+ The page's sentence — "Saved view Q3 applied" — is said once, with the result:
96
+ `52 matches · Saved view Q3 applied`. A view the element already has says nothing, notice or not.
97
+ The pivot takes it too.
98
+ - **One level of a tree, in the engine** ([#129](https://github.com/casoon/opengrid/issues/129), E38).
99
+ A query takes `tree: { key?, parent, under? }` and answers the children of `under` (or the
100
+ roots) with `tree: { children, match, matches, orphans }` beside the rows: orphans are roots,
101
+ a key twice or a cycle is an error with a sentence, a filter shows matches with their
102
+ ancestors as context, a sort orders siblings. The local engine answers it in the tab and the
103
+ worker, the planner keeps a tree with its filter on one side, and sources say whether they can
104
+ with the new capability `tree` (written only when true). The server refuses a tree query for
105
+ sources without it. Nine conformance cases (T2–T6) pass natively and in the browser.
106
+ - **The tree on the server, and the tenant rule** ([#131](https://github.com/casoon/opengrid/issues/131), plan point 122).
107
+ The tree part takes `scope`, a filter that decides which rows the tree consists of; the server
108
+ puts its mandatory row filter there, so another tenant's row is never a match, context or child
109
+ and a node under one becomes an orphan. Every connector answers a tree: the file and rows tiers
110
+ through the engine, SQLite, PostgreSQL and any other through `Connector::tree`, which asks for
111
+ the rows of the scope and lets the engine answer the level. `GET /source` reports `tree` for
112
+ every source. The tree conformance cases (now twelve, three on `scope`) pass against a file,
113
+ the rows tier, SQLite and PostgreSQL through `POST /query`.
114
+ - **A tree's level in the binary result form** ([#135](https://github.com/casoon/opengrid/issues/135)).
115
+ Kind `2`: the result, then the tree part (matches, orphans, the child count per row, matches
116
+ as a bitmap). The engine's `execute_columns` — what the worker and the local provider call —
117
+ and the server answer a tree in it; a reader of plain results refuses it instead of losing the
118
+ part. Before, the worker could not answer a tree at all, and the server fell back to JSON.
119
+
120
+ ### Fixed
121
+
122
+ - **Intl formats work under a strict Content Security Policy** ([#139](https://github.com/casoon/opengrid/issues/139)).
123
+ `set_formats` built its formatters with `new Function`, which throws without `'unsafe-eval'`. They
124
+ come from a static snippet now; no code is built at run time.
125
+
21
126
  ## [0.9.0] — 2026-10-01
22
127
 
23
128
  **Screen-reader pairings tested: none yet** ([issue #5](https://github.com/casoon/opengrid/issues/5)).
package/README.md CHANGED
@@ -159,6 +159,8 @@ shown with `get_pivot`. See [Export](https://github.com/casoon/opengrid/blob/mai
159
159
  attributes, events, the view, styling, texts, errors
160
160
  - [Guides](https://github.com/casoon/opengrid/tree/main/docs/guides) and the
161
161
  [project page](https://casoon.github.io/opengrid/)
162
+ - [In a chat client](https://github.com/casoon/opengrid/blob/main/docs/guides/mcp.md) —
163
+ the grid as an MCP App, `@casoon/opengrid-mcp` (not released yet)
162
164
 
163
165
  ## Accessible and machine-readable: the aim
164
166
 
@@ -61,6 +61,17 @@ export class Engine {
61
61
  * it. Sources by name.
62
62
  */
63
63
  stats(): string;
64
+ /**
65
+ * The query of a view (issue #144): what `get_query()` answers on an
66
+ * `<opengrid-grid datasource=source columns=…>` once `view_json` is
67
+ * applied — without an element, so a server can count or export a saved
68
+ * view. `columns` is the grid's `columns` attribute, as a JSON array.
69
+ *
70
+ * A view naming a column the grid does not have is refused as a whole,
71
+ * every problem named; so is a filter value that is not a value of its
72
+ * column.
73
+ */
74
+ view_query(source: string, columns_json: string, view_json: string): string;
64
75
  }
65
76
 
66
77
  /**
@@ -130,6 +141,7 @@ export interface InitOutput {
130
141
  readonly engine_pivot_columns: (a: number, b: number, c: number) => [number, number, number, number];
131
142
  readonly engine_source_names: (a: number) => [number, number];
132
143
  readonly engine_stats: (a: number) => [number, number];
144
+ readonly engine_view_query: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => [number, number, number, number];
133
145
  readonly planner_finish: (a: number, b: number, c: number, d: number, e: number) => [number, number, number, number];
134
146
  readonly planner_finish_columns: (a: number, b: number, c: number, d: number, e: number) => [number, number, number, number];
135
147
  readonly planner_new: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number];
@@ -171,6 +171,44 @@ export class Engine {
171
171
  wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
172
172
  }
173
173
  }
174
+ /**
175
+ * The query of a view (issue #144): what `get_query()` answers on an
176
+ * `<opengrid-grid datasource=source columns=…>` once `view_json` is
177
+ * applied — without an element, so a server can count or export a saved
178
+ * view. `columns` is the grid's `columns` attribute, as a JSON array.
179
+ *
180
+ * A view naming a column the grid does not have is refused as a whole,
181
+ * every problem named; so is a filter value that is not a value of its
182
+ * column.
183
+ * @param {string} source
184
+ * @param {string} columns_json
185
+ * @param {string} view_json
186
+ * @returns {string}
187
+ */
188
+ view_query(source, columns_json, view_json) {
189
+ let deferred5_0;
190
+ let deferred5_1;
191
+ try {
192
+ const ptr0 = passStringToWasm0(source, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
193
+ const len0 = WASM_VECTOR_LEN;
194
+ const ptr1 = passStringToWasm0(columns_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
195
+ const len1 = WASM_VECTOR_LEN;
196
+ const ptr2 = passStringToWasm0(view_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
197
+ const len2 = WASM_VECTOR_LEN;
198
+ const ret = wasm.engine_view_query(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2);
199
+ var ptr4 = ret[0];
200
+ var len4 = ret[1];
201
+ if (ret[3]) {
202
+ ptr4 = 0; len4 = 0;
203
+ throw takeFromExternrefTable0(ret[2]);
204
+ }
205
+ deferred5_0 = ptr4;
206
+ deferred5_1 = len4;
207
+ return getStringFromWasm0(ptr4, len4);
208
+ } finally {
209
+ wasm.__wbindgen_free(deferred5_0, deferred5_1, 1);
210
+ }
211
+ }
174
212
  }
175
213
  if (Symbol.dispose) Engine.prototype[Symbol.dispose] = Engine.prototype.free;
176
214
 
Binary file
@@ -11,6 +11,7 @@ export const engine_pivot: (a: number, b: number, c: number) => [number, number,
11
11
  export const engine_pivot_columns: (a: number, b: number, c: number) => [number, number, number, number];
12
12
  export const engine_source_names: (a: number) => [number, number];
13
13
  export const engine_stats: (a: number) => [number, number];
14
+ export const engine_view_query: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => [number, number, number, number];
14
15
  export const planner_finish: (a: number, b: number, c: number, d: number, e: number) => [number, number, number, number];
15
16
  export const planner_finish_columns: (a: number, b: number, c: number, d: number, e: number) => [number, number, number, number];
16
17
  export const planner_new: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number];
package/loader.d.ts CHANGED
@@ -51,10 +51,13 @@ export interface OpengridModule {
51
51
  * a grid's view is never widened to either kind.
52
52
  */
53
53
  get_view<V extends PivotView>(host: HTMLElement): V | null;
54
- /** Applies a view in one step and one query. Parts left out keep their default. */
55
- set_view(host: HTMLElement, view: ViewInput): void;
54
+ /**
55
+ * Applies a view in one step and one query. Parts left out keep their default.
56
+ * `options.notice` is said once, with the result (issue #146).
57
+ */
58
+ set_view(host: HTMLElement, view: ViewInput, options?: SetViewOptions): void;
56
59
  /** A pivot's view: `rows`, `columns` and `values` at once, one query. */
57
- set_view(host: HTMLElement, view: PivotViewInput): void;
60
+ set_view(host: HTMLElement, view: PivotViewInput, options?: SetViewOptions): void;
58
61
  /** Per-column presentation; narrows what the schema allows, never widens it. */
59
62
  set_columns(host: HTMLElement, columns: Columns): void;
60
63
  /**
@@ -72,6 +75,27 @@ export interface OpengridModule {
72
75
  * Values are in the canonical wire notation: a float `2` reads `2.0`.
73
76
  */
74
77
  get_pivot(host: HTMLElement, options?: CsvOptions): string | null;
78
+ /**
79
+ * What became of an edit the page saves (issue #153). `key` is the record's
80
+ * `row-key` value as `opengrid-cell-change` gave it. `saved` clears the
81
+ * unsaved mark; `error` keeps the value and says `message` in the live
82
+ * region. The cell's part is then `cell cell-<state>` (`::part(cell-error)`);
83
+ * the focus never moves.
84
+ * Requires `row-key`.
85
+ */
86
+ set_cell_state(
87
+ host: HTMLElement,
88
+ key: WireValue,
89
+ column: string,
90
+ state: CellState,
91
+ message?: string,
92
+ ): void;
93
+ /**
94
+ * Values the page computes, shown in place of the source's — not edits: no
95
+ * unsaved mark, no event. The column is `readonly` in `set_columns`.
96
+ * Requires `row-key`.
97
+ */
98
+ set_values(host: HTMLElement, values: CellValue[]): void;
75
99
  /** Defines the three elements. `loadOpengrid()` calls it. */
76
100
  register(): void;
77
101
  }
@@ -221,6 +245,12 @@ export interface Engine {
221
245
  pivot(pivotJson: string): string;
222
246
  /** The same pivot in the binary form — what the tab and worker providers answer. */
223
247
  pivot_columns(pivotJson: string): Uint8Array;
248
+ /**
249
+ * The query of a view on a grid with these `columns` (a JSON array), as
250
+ * JSON — what `get_query()` answers once the view is applied (issue #144).
251
+ * Throws for a view naming an unknown column or a value its column cannot hold.
252
+ */
253
+ view_query(source: string, columnsJson: string, viewJson: string): string;
224
254
  }
225
255
 
226
256
  /** What a server says a source is. */
@@ -462,6 +492,21 @@ export interface ColumnConfig {
462
492
  muted?: boolean;
463
493
  aggregate?: Aggregate;
464
494
  facet?: FacetKind;
495
+ /**
496
+ * The page fills this column (`set_values`): it never opens an editor and
497
+ * its cells are announced as read-only. The grid only.
498
+ */
499
+ readonly?: boolean;
500
+ }
501
+
502
+ /** What `set_cell_state` says became of an edit. */
503
+ export type CellState = "saving" | "saved" | "error";
504
+
505
+ /** One value for `set_values`: the record by its `row-key`, the column, the value. */
506
+ export interface CellValue {
507
+ key: WireValue;
508
+ column: string;
509
+ value: WireValue;
465
510
  }
466
511
 
467
512
  export type Columns = Record<string, ColumnConfig>;
@@ -566,6 +611,16 @@ export interface PivotSort {
566
611
  direction: "asc" | "desc";
567
612
  }
568
613
 
614
+ /** The second argument of `set_view` (issue #146). */
615
+ export interface SetViewOptions {
616
+ /**
617
+ * A sentence of the page — "Saved view Q3 applied", "Filtered by the
618
+ * assistant" — said once in the status line together with the result that
619
+ * follows. A view the element already has says nothing, notice or not.
620
+ */
621
+ notice?: string;
622
+ }
623
+
569
624
  /** What `set_view` takes for a pivot: a part left out is empty. */
570
625
  export type PivotViewInput = Partial<PivotView>;
571
626
 
@@ -684,6 +739,11 @@ export type TextKey =
684
739
  | "pivotFilters"
685
740
  | "pivotFilterLabel"
686
741
  | "pivotFilterHint"
742
+ | "treeContext"
743
+ | "treeOrphans"
744
+ | "treeLevelTooLarge"
745
+ | "treeRefused"
746
+ | "treeGroupIgnored"
687
747
  | "filterAny"
688
748
  | "booleanTrue"
689
749
  | "booleanFalse"
@@ -743,15 +803,26 @@ export type Texts = Partial<Record<TextKey, string>> & {
743
803
  // Events
744
804
  // ---------------------------------------------------------------------------
745
805
 
746
- /** `opengrid-selection-change`: logical row numbers, ascending. */
806
+ /**
807
+ * `opengrid-selection-change`: logical row numbers, ascending. In a tree
808
+ * (`tree` set) `rows` are the display positions of the selected nodes shown,
809
+ * `keys` names every selected node by its key and `count` counts them.
810
+ */
747
811
  export interface SelectionChangeDetail {
748
812
  rows: number[];
749
813
  count: number;
814
+ /** In a tree only: the selected nodes' keys, the shown ones first. */
815
+ keys?: unknown[];
750
816
  }
751
817
 
752
818
  /** `opengrid-cell-change`: everything a page needs to persist an edit. */
753
819
  export interface CellChangeDetail {
754
820
  row: number;
821
+ /**
822
+ * With `row-key` only: the edited row's value of that field — `null` when
823
+ * the result does not carry it. The record, where `row` is a position.
824
+ */
825
+ key?: WireValue;
755
826
  column: string;
756
827
  value: string;
757
828
  previous: string;
@@ -805,6 +876,12 @@ export interface OpengridGridAttributes {
805
876
  "page-size"?: string;
806
877
  mode?: Mode;
807
878
  "group-by"?: string;
879
+ /** The field holding a row's parent key: the rows show as a tree. */
880
+ tree?: string;
881
+ /** The field the parent key refers to; `id` when absent. */
882
+ "tree-key"?: string;
883
+ /** The field that names a record: `key` in `opengrid-cell-change`. */
884
+ "row-key"?: string;
808
885
  search?: string;
809
886
  facets?: string;
810
887
  toolbar?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@casoon/opengrid",
3
- "version": "0.9.0",
3
+ "version": "0.11.0",
4
4
  "type": "module",
5
5
  "description": "Accessible data grid, table and pivot as web components, driven by a portable Rust/WASM query engine — with React, Vue and Svelte components.",
6
6
  "keywords": [
@@ -80,6 +80,18 @@ export function get_view(host: HTMLElement): any;
80
80
  */
81
81
  export function register(): void;
82
82
 
83
+ /**
84
+ * Says what became of an edit the page saves (issue #153).
85
+ *
86
+ * `key` is the record's `row-key` value, as `opengrid-cell-change` gave it;
87
+ * `state` is `saving`, `saved` or `error`. `saved` takes the unsaved mark
88
+ * off; `error` keeps the value and the mark and says `message` in the live
89
+ * region. The state shows on the cell as `data-state`, stays with the record
90
+ * through sorting and reloading, and never moves the focus. Nothing happens
91
+ * without `row-key`, or for a key, column or state the grid does not know.
92
+ */
93
+ export function set_cell_state(host: HTMLElement, key: any, column: string, state: string, message?: string | null): void;
94
+
83
95
  /**
84
96
  * Sets the choices a column's editor offers (plan point 37).
85
97
  *
@@ -155,6 +167,15 @@ export function set_provider(host: HTMLElement, provider: any): void;
155
167
 
156
168
  export function set_texts(host: HTMLElement, values: any): void;
157
169
 
170
+ /**
171
+ * Shows values the page computes (issue #153): `[{ key, column, value }]`.
172
+ *
173
+ * Not edits: no unsaved mark, no `opengrid-cell-change`. They stand over the
174
+ * source's value for that record until the page sets another. A column the
175
+ * page fills is `readonly` in `set_columns`. Requires `row-key`.
176
+ */
177
+ export function set_values(host: HTMLElement, values: any): void;
178
+
158
179
  /**
159
180
  * Applies a whole view at once (plan point 59).
160
181
  *
@@ -168,8 +189,13 @@ export function set_texts(host: HTMLElement, values: any): void;
168
189
  *
169
190
  * A pivot takes `{ rows, columns, values }` and writes them to its attributes
170
191
  * at once (issue #106).
192
+ *
193
+ * `options.notice` is a sentence of the page — "Saved view Q3 applied",
194
+ * "Filtered by the assistant" — said once, together with the result that
195
+ * follows (issue #146). A view the element already has says nothing, notice
196
+ * or not.
171
197
  */
172
- export function set_view(host: HTMLElement, view: any): void;
198
+ export function set_view(host: HTMLElement, view: any, options: any): void;
173
199
 
174
200
  export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
175
201
 
@@ -181,25 +207,27 @@ export interface InitOutput {
181
207
  readonly get_query: (a: any) => any;
182
208
  readonly get_view: (a: any) => any;
183
209
  readonly register: () => [number, number];
210
+ readonly set_cell_state: (a: any, b: any, c: number, d: number, e: number, f: number, g: number, h: number) => void;
184
211
  readonly set_choices: (a: any, b: any) => void;
185
212
  readonly set_columns: (a: any, b: any) => void;
186
213
  readonly set_formats: (a: any, b: any) => void;
187
214
  readonly set_provider: (a: any, b: any) => void;
188
215
  readonly set_texts: (a: any, b: any) => void;
189
- readonly set_view: (a: any, b: any) => void;
190
- readonly wasm_bindgen_66404d18cc2edcc2___convert__closures_____invoke___web_sys_90ed3bea5014610e___features__gen_HtmlElement__HtmlElement__alloc_508e33bd5656020b___string__String__core_ed718c3d60ebd546___option__Option_alloc_508e33bd5656020b___string__String___core_ed718c3d60ebd546___option__Option_alloc_508e33bd5656020b___string__String_______true_: (a: number, b: number, c: any, d: number, e: number, f: number, g: number, h: number, i: number) => void;
191
- readonly wasm_bindgen_66404d18cc2edcc2___convert__closures_____invoke___wasm_bindgen_66404d18cc2edcc2___JsValue__core_ed718c3d60ebd546___result__Result_____wasm_bindgen_66404d18cc2edcc2___JsError___true_: (a: number, b: number, c: any) => [number, number];
192
- readonly wasm_bindgen_66404d18cc2edcc2___convert__closures_____invoke___js_sys_f6d81f9cdcf4f83___Array______true_: (a: number, b: number, c: any) => void;
193
- readonly wasm_bindgen_66404d18cc2edcc2___convert__closures_____invoke___js_sys_f6d81f9cdcf4f83___Array______true__2: (a: number, b: number, c: any) => void;
194
- readonly wasm_bindgen_66404d18cc2edcc2___convert__closures_____invoke___js_sys_f6d81f9cdcf4f83___Array______true__4: (a: number, b: number, c: any) => void;
195
- readonly wasm_bindgen_66404d18cc2edcc2___convert__closures_____invoke___js_sys_f6d81f9cdcf4f83___Array______true__5: (a: number, b: number, c: any) => void;
196
- readonly wasm_bindgen_66404d18cc2edcc2___convert__closures_____invoke___u32______true_: (a: number, b: number, c: number) => void;
197
- readonly wasm_bindgen_66404d18cc2edcc2___convert__closures_____invoke_______true_: (a: number, b: number) => void;
198
- readonly __wbindgen_malloc: (a: number, b: number) => number;
199
- readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
216
+ readonly set_values: (a: any, b: any) => void;
217
+ readonly set_view: (a: any, b: any, c: any) => void;
218
+ readonly wasm_bindgen_6af9200f0870d488___convert__closures_____invoke___web_sys_390d3ac0468b6516___features__gen_HtmlElement__HtmlElement__alloc_cb2b8d99256f33df___string__String__core_608f92abc48d28da___option__Option_alloc_cb2b8d99256f33df___string__String___core_608f92abc48d28da___option__Option_alloc_cb2b8d99256f33df___string__String_______true_: (a: number, b: number, c: any, d: number, e: number, f: number, g: number, h: number, i: number) => void;
219
+ readonly wasm_bindgen_6af9200f0870d488___convert__closures_____invoke___wasm_bindgen_6af9200f0870d488___JsValue__core_608f92abc48d28da___result__Result_____wasm_bindgen_6af9200f0870d488___JsError___true_: (a: number, b: number, c: any) => [number, number];
220
+ readonly wasm_bindgen_6af9200f0870d488___convert__closures_____invoke___js_sys_9485a4494ece8a82___Array______true_: (a: number, b: number, c: any) => void;
221
+ readonly wasm_bindgen_6af9200f0870d488___convert__closures_____invoke___js_sys_9485a4494ece8a82___Array______true__2: (a: number, b: number, c: any) => void;
222
+ readonly wasm_bindgen_6af9200f0870d488___convert__closures_____invoke___js_sys_9485a4494ece8a82___Array______true__4: (a: number, b: number, c: any) => void;
223
+ readonly wasm_bindgen_6af9200f0870d488___convert__closures_____invoke___js_sys_9485a4494ece8a82___Array______true__5: (a: number, b: number, c: any) => void;
224
+ readonly wasm_bindgen_6af9200f0870d488___convert__closures_____invoke___u32______true_: (a: number, b: number, c: number) => void;
225
+ readonly wasm_bindgen_6af9200f0870d488___convert__closures_____invoke_______true_: (a: number, b: number) => void;
226
+ readonly __wbindgen_exn_store: (a: number) => void;
200
227
  readonly __externref_table_alloc: () => number;
201
228
  readonly __wbindgen_externrefs: WebAssembly.Table;
202
- readonly __wbindgen_exn_store: (a: number) => void;
229
+ readonly __wbindgen_malloc: (a: number, b: number) => number;
230
+ readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
203
231
  readonly __wbindgen_destroy_closure: (a: number, b: number) => void;
204
232
  readonly __externref_table_dealloc: (a: number) => void;
205
233
  readonly __wbindgen_free: (a: number, b: number, c: number) => void;
@@ -1,8 +1,9 @@
1
1
  /* @ts-self-types="./opengrid_web_components.d.ts" */
2
- import { __opengrid_define_element } from './snippets/opengrid-web-core-d5d58f1d0dc955ad/inline1.js';
3
- import * as import1 from "./snippets/opengrid-web-core-d5d58f1d0dc955ad/inline0.js"
4
- import * as import2 from "./snippets/opengrid-web-core-d5d58f1d0dc955ad/inline0.js"
5
- import * as import3 from "./snippets/opengrid-web-core-d5d58f1d0dc955ad/inline0.js"
2
+ import { __opengrid_intl_formatter } from './snippets/opengrid-web-components-04a0bde4d39568d3/inline0.js';
3
+ import { __opengrid_define_element } from './snippets/opengrid-web-core-8c4306a3e0319748/inline1.js';
4
+ import * as import1 from "./snippets/opengrid-web-core-8c4306a3e0319748/inline0.js"
5
+ import * as import2 from "./snippets/opengrid-web-core-8c4306a3e0319748/inline0.js"
6
+ import * as import3 from "./snippets/opengrid-web-core-8c4306a3e0319748/inline0.js"
6
7
 
7
8
 
8
9
  /**
@@ -149,6 +150,31 @@ export function register() {
149
150
  }
150
151
  }
151
152
 
153
+ /**
154
+ * Says what became of an edit the page saves (issue #153).
155
+ *
156
+ * `key` is the record's `row-key` value, as `opengrid-cell-change` gave it;
157
+ * `state` is `saving`, `saved` or `error`. `saved` takes the unsaved mark
158
+ * off; `error` keeps the value and the mark and says `message` in the live
159
+ * region. The state shows on the cell as `data-state`, stays with the record
160
+ * through sorting and reloading, and never moves the focus. Nothing happens
161
+ * without `row-key`, or for a key, column or state the grid does not know.
162
+ * @param {HTMLElement} host
163
+ * @param {any} key
164
+ * @param {string} column
165
+ * @param {string} state
166
+ * @param {string | null} [message]
167
+ */
168
+ export function set_cell_state(host, key, column, state, message) {
169
+ const ptr0 = passStringToWasm0(column, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
170
+ const len0 = WASM_VECTOR_LEN;
171
+ const ptr1 = passStringToWasm0(state, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
172
+ const len1 = WASM_VECTOR_LEN;
173
+ var ptr2 = isLikeNone(message) ? 0 : passStringToWasm0(message, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
174
+ var len2 = WASM_VECTOR_LEN;
175
+ wasm.set_cell_state(host, key, ptr0, len0, ptr1, len1, ptr2, len2);
176
+ }
177
+
152
178
  /**
153
179
  * Sets the choices a column's editor offers (plan point 37).
154
180
  *
@@ -246,6 +272,19 @@ export function set_texts(host, values) {
246
272
  wasm.set_texts(host, values);
247
273
  }
248
274
 
275
+ /**
276
+ * Shows values the page computes (issue #153): `[{ key, column, value }]`.
277
+ *
278
+ * Not edits: no unsaved mark, no `opengrid-cell-change`. They stand over the
279
+ * source's value for that record until the page sets another. A column the
280
+ * page fills is `readonly` in `set_columns`. Requires `row-key`.
281
+ * @param {HTMLElement} host
282
+ * @param {any} values
283
+ */
284
+ export function set_values(host, values) {
285
+ wasm.set_values(host, values);
286
+ }
287
+
249
288
  /**
250
289
  * Applies a whole view at once (plan point 59).
251
290
  *
@@ -259,11 +298,17 @@ export function set_texts(host, values) {
259
298
  *
260
299
  * A pivot takes `{ rows, columns, values }` and writes them to its attributes
261
300
  * at once (issue #106).
301
+ *
302
+ * `options.notice` is a sentence of the page — "Saved view Q3 applied",
303
+ * "Filtered by the assistant" — said once, together with the result that
304
+ * follows (issue #146). A view the element already has says nothing, notice
305
+ * or not.
262
306
  * @param {HTMLElement} host
263
307
  * @param {any} view
308
+ * @param {any} options
264
309
  */
265
- export function set_view(host, view) {
266
- wasm.set_view(host, view);
310
+ export function set_view(host, view, options) {
311
+ wasm.set_view(host, view, options);
267
312
  }
268
313
  function __wbg_get_imports() {
269
314
  const import0 = {
@@ -272,9 +317,13 @@ function __wbg_get_imports() {
272
317
  const ret = Error(getStringFromWasm0(arg0, arg1));
273
318
  return ret;
274
319
  },
275
- __wbg___opengrid_define_element_60dafd856d3181c6: function(arg0, arg1, arg2, arg3, arg4, arg5) {
320
+ __wbg___opengrid_define_element_1a8e6a7af087e9e4: function(arg0, arg1, arg2, arg3, arg4, arg5) {
276
321
  __opengrid_define_element(getStringFromWasm0(arg0, arg1), arg2, arg3, arg4, arg5);
277
322
  },
323
+ __wbg___opengrid_intl_formatter_8256df1502ec6039: function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
324
+ const ret = __opengrid_intl_formatter(getStringFromWasm0(arg0, arg1), getStringFromWasm0(arg2, arg3), arg4);
325
+ return ret;
326
+ }, arguments); },
278
327
  __wbg___wbindgen_boolean_get_fa956cfa2d1bd751: function(arg0) {
279
328
  const v = arg0;
280
329
  const ret = typeof(v) === 'boolean' ? v : undefined;
@@ -350,10 +399,6 @@ function __wbg_get_imports() {
350
399
  const ret = arg0.bottom;
351
400
  return ret;
352
401
  },
353
- __wbg_call_44b7209e1e252e6a: function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
354
- const ret = arg0.call(arg1, arg2, arg3, arg4);
355
- return ret;
356
- }, arguments); },
357
402
  __wbg_call_8a2dd23819f8a60a: function() { return handleError(function (arg0, arg1) {
358
403
  const ret = arg0.call(arg1);
359
404
  return ret;
@@ -686,10 +731,6 @@ function __wbg_get_imports() {
686
731
  const ret = new CSSStyleSheet();
687
732
  return ret;
688
733
  }, arguments); },
689
- __wbg_new_with_args_200d82645b6544eb: function(arg0, arg1, arg2, arg3) {
690
- const ret = new Function(getStringFromWasm0(arg0, arg1), getStringFromWasm0(arg2, arg3));
691
- return ret;
692
- },
693
734
  __wbg_new_with_event_init_dict_b7d5fa264299bcfa: function() { return handleError(function (arg0, arg1, arg2) {
694
735
  const ret = new CustomEvent(getStringFromWasm0(arg0, arg1), arg2);
695
736
  return ret;
@@ -952,43 +993,43 @@ function __wbg_get_imports() {
952
993
  return ret;
953
994
  },
954
995
  __wbindgen_cast_0000000000000001: function(arg0, arg1) {
955
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 214, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
956
- const ret = makeMutClosure(arg0, arg1, wasm_bindgen_66404d18cc2edcc2___convert__closures_____invoke___wasm_bindgen_66404d18cc2edcc2___JsValue__core_ed718c3d60ebd546___result__Result_____wasm_bindgen_66404d18cc2edcc2___JsError___true_);
996
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 209, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
997
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen_6af9200f0870d488___convert__closures_____invoke___wasm_bindgen_6af9200f0870d488___JsValue__core_608f92abc48d28da___result__Result_____wasm_bindgen_6af9200f0870d488___JsError___true_);
957
998
  return ret;
958
999
  },
959
1000
  __wbindgen_cast_0000000000000002: function(arg0, arg1) {
960
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("Array<any>")], shim_idx: 16, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
961
- const ret = makeMutClosure(arg0, arg1, wasm_bindgen_66404d18cc2edcc2___convert__closures_____invoke___js_sys_f6d81f9cdcf4f83___Array______true_);
1001
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("Array<any>")], shim_idx: 18, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1002
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen_6af9200f0870d488___convert__closures_____invoke___js_sys_9485a4494ece8a82___Array______true_);
962
1003
  return ret;
963
1004
  },
964
1005
  __wbindgen_cast_0000000000000003: function(arg0, arg1) {
965
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("Event")], shim_idx: 16, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
966
- const ret = makeMutClosure(arg0, arg1, wasm_bindgen_66404d18cc2edcc2___convert__closures_____invoke___js_sys_f6d81f9cdcf4f83___Array______true__2);
1006
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("Event")], shim_idx: 18, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1007
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen_6af9200f0870d488___convert__closures_____invoke___js_sys_9485a4494ece8a82___Array______true__2);
967
1008
  return ret;
968
1009
  },
969
1010
  __wbindgen_cast_0000000000000004: function(arg0, arg1) {
970
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("HTMLElement"), String, Option(String), Option(String)], shim_idx: 17, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
971
- const ret = makeMutClosure(arg0, arg1, wasm_bindgen_66404d18cc2edcc2___convert__closures_____invoke___web_sys_90ed3bea5014610e___features__gen_HtmlElement__HtmlElement__alloc_508e33bd5656020b___string__String__core_ed718c3d60ebd546___option__Option_alloc_508e33bd5656020b___string__String___core_ed718c3d60ebd546___option__Option_alloc_508e33bd5656020b___string__String_______true_);
1011
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("HTMLElement"), String, Option(String), Option(String)], shim_idx: 19, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1012
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen_6af9200f0870d488___convert__closures_____invoke___web_sys_390d3ac0468b6516___features__gen_HtmlElement__HtmlElement__alloc_cb2b8d99256f33df___string__String__core_608f92abc48d28da___option__Option_alloc_cb2b8d99256f33df___string__String___core_608f92abc48d28da___option__Option_alloc_cb2b8d99256f33df___string__String_______true_);
972
1013
  return ret;
973
1014
  },
974
1015
  __wbindgen_cast_0000000000000005: function(arg0, arg1) {
975
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("HTMLElement")], shim_idx: 16, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
976
- const ret = makeMutClosure(arg0, arg1, wasm_bindgen_66404d18cc2edcc2___convert__closures_____invoke___js_sys_f6d81f9cdcf4f83___Array______true__4);
1016
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("HTMLElement")], shim_idx: 18, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1017
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen_6af9200f0870d488___convert__closures_____invoke___js_sys_9485a4494ece8a82___Array______true__4);
977
1018
  return ret;
978
1019
  },
979
1020
  __wbindgen_cast_0000000000000006: function(arg0, arg1) {
980
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("KeyboardEvent")], shim_idx: 16, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
981
- const ret = makeMutClosure(arg0, arg1, wasm_bindgen_66404d18cc2edcc2___convert__closures_____invoke___js_sys_f6d81f9cdcf4f83___Array______true__5);
1021
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("KeyboardEvent")], shim_idx: 18, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1022
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen_6af9200f0870d488___convert__closures_____invoke___js_sys_9485a4494ece8a82___Array______true__5);
982
1023
  return ret;
983
1024
  },
984
1025
  __wbindgen_cast_0000000000000007: function(arg0, arg1) {
985
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [U32], shim_idx: 200, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
986
- const ret = makeMutClosure(arg0, arg1, wasm_bindgen_66404d18cc2edcc2___convert__closures_____invoke___u32______true_);
1026
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [U32], shim_idx: 195, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1027
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen_6af9200f0870d488___convert__closures_____invoke___u32______true_);
987
1028
  return ret;
988
1029
  },
989
1030
  __wbindgen_cast_0000000000000008: function(arg0, arg1) {
990
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 15, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
991
- const ret = makeMutClosure(arg0, arg1, wasm_bindgen_66404d18cc2edcc2___convert__closures_____invoke_______true_);
1031
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 17, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1032
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen_6af9200f0870d488___convert__closures_____invoke_______true_);
992
1033
  return ret;
993
1034
  },
994
1035
  __wbindgen_cast_0000000000000009: function(arg0) {
@@ -1014,51 +1055,51 @@ function __wbg_get_imports() {
1014
1055
  return {
1015
1056
  __proto__: null,
1016
1057
  "./opengrid_web_components_bg.js": import0,
1017
- "./snippets/opengrid-web-core-d5d58f1d0dc955ad/inline0.js": import1,
1018
- "./snippets/opengrid-web-core-d5d58f1d0dc955ad/inline0.js": import2,
1019
- "./snippets/opengrid-web-core-d5d58f1d0dc955ad/inline0.js": import3,
1058
+ "./snippets/opengrid-web-core-8c4306a3e0319748/inline0.js": import1,
1059
+ "./snippets/opengrid-web-core-8c4306a3e0319748/inline0.js": import2,
1060
+ "./snippets/opengrid-web-core-8c4306a3e0319748/inline0.js": import3,
1020
1061
  };
1021
1062
  }
1022
1063
 
1023
- function wasm_bindgen_66404d18cc2edcc2___convert__closures_____invoke_______true_(arg0, arg1) {
1024
- wasm.wasm_bindgen_66404d18cc2edcc2___convert__closures_____invoke_______true_(arg0, arg1);
1064
+ function wasm_bindgen_6af9200f0870d488___convert__closures_____invoke_______true_(arg0, arg1) {
1065
+ wasm.wasm_bindgen_6af9200f0870d488___convert__closures_____invoke_______true_(arg0, arg1);
1025
1066
  }
1026
1067
 
1027
- function wasm_bindgen_66404d18cc2edcc2___convert__closures_____invoke___js_sys_f6d81f9cdcf4f83___Array______true_(arg0, arg1, arg2) {
1028
- wasm.wasm_bindgen_66404d18cc2edcc2___convert__closures_____invoke___js_sys_f6d81f9cdcf4f83___Array______true_(arg0, arg1, arg2);
1068
+ function wasm_bindgen_6af9200f0870d488___convert__closures_____invoke___js_sys_9485a4494ece8a82___Array______true_(arg0, arg1, arg2) {
1069
+ wasm.wasm_bindgen_6af9200f0870d488___convert__closures_____invoke___js_sys_9485a4494ece8a82___Array______true_(arg0, arg1, arg2);
1029
1070
  }
1030
1071
 
1031
- function wasm_bindgen_66404d18cc2edcc2___convert__closures_____invoke___js_sys_f6d81f9cdcf4f83___Array______true__2(arg0, arg1, arg2) {
1032
- wasm.wasm_bindgen_66404d18cc2edcc2___convert__closures_____invoke___js_sys_f6d81f9cdcf4f83___Array______true__2(arg0, arg1, arg2);
1072
+ function wasm_bindgen_6af9200f0870d488___convert__closures_____invoke___js_sys_9485a4494ece8a82___Array______true__2(arg0, arg1, arg2) {
1073
+ wasm.wasm_bindgen_6af9200f0870d488___convert__closures_____invoke___js_sys_9485a4494ece8a82___Array______true__2(arg0, arg1, arg2);
1033
1074
  }
1034
1075
 
1035
- function wasm_bindgen_66404d18cc2edcc2___convert__closures_____invoke___js_sys_f6d81f9cdcf4f83___Array______true__4(arg0, arg1, arg2) {
1036
- wasm.wasm_bindgen_66404d18cc2edcc2___convert__closures_____invoke___js_sys_f6d81f9cdcf4f83___Array______true__4(arg0, arg1, arg2);
1076
+ function wasm_bindgen_6af9200f0870d488___convert__closures_____invoke___js_sys_9485a4494ece8a82___Array______true__4(arg0, arg1, arg2) {
1077
+ wasm.wasm_bindgen_6af9200f0870d488___convert__closures_____invoke___js_sys_9485a4494ece8a82___Array______true__4(arg0, arg1, arg2);
1037
1078
  }
1038
1079
 
1039
- function wasm_bindgen_66404d18cc2edcc2___convert__closures_____invoke___js_sys_f6d81f9cdcf4f83___Array______true__5(arg0, arg1, arg2) {
1040
- wasm.wasm_bindgen_66404d18cc2edcc2___convert__closures_____invoke___js_sys_f6d81f9cdcf4f83___Array______true__5(arg0, arg1, arg2);
1080
+ function wasm_bindgen_6af9200f0870d488___convert__closures_____invoke___js_sys_9485a4494ece8a82___Array______true__5(arg0, arg1, arg2) {
1081
+ wasm.wasm_bindgen_6af9200f0870d488___convert__closures_____invoke___js_sys_9485a4494ece8a82___Array______true__5(arg0, arg1, arg2);
1041
1082
  }
1042
1083
 
1043
- function wasm_bindgen_66404d18cc2edcc2___convert__closures_____invoke___wasm_bindgen_66404d18cc2edcc2___JsValue__core_ed718c3d60ebd546___result__Result_____wasm_bindgen_66404d18cc2edcc2___JsError___true_(arg0, arg1, arg2) {
1044
- const ret = wasm.wasm_bindgen_66404d18cc2edcc2___convert__closures_____invoke___wasm_bindgen_66404d18cc2edcc2___JsValue__core_ed718c3d60ebd546___result__Result_____wasm_bindgen_66404d18cc2edcc2___JsError___true_(arg0, arg1, arg2);
1084
+ function wasm_bindgen_6af9200f0870d488___convert__closures_____invoke___wasm_bindgen_6af9200f0870d488___JsValue__core_608f92abc48d28da___result__Result_____wasm_bindgen_6af9200f0870d488___JsError___true_(arg0, arg1, arg2) {
1085
+ const ret = wasm.wasm_bindgen_6af9200f0870d488___convert__closures_____invoke___wasm_bindgen_6af9200f0870d488___JsValue__core_608f92abc48d28da___result__Result_____wasm_bindgen_6af9200f0870d488___JsError___true_(arg0, arg1, arg2);
1045
1086
  if (ret[1]) {
1046
1087
  throw takeFromExternrefTable0(ret[0]);
1047
1088
  }
1048
1089
  }
1049
1090
 
1050
- function wasm_bindgen_66404d18cc2edcc2___convert__closures_____invoke___web_sys_90ed3bea5014610e___features__gen_HtmlElement__HtmlElement__alloc_508e33bd5656020b___string__String__core_ed718c3d60ebd546___option__Option_alloc_508e33bd5656020b___string__String___core_ed718c3d60ebd546___option__Option_alloc_508e33bd5656020b___string__String_______true_(arg0, arg1, arg2, arg3, arg4, arg5) {
1091
+ function wasm_bindgen_6af9200f0870d488___convert__closures_____invoke___web_sys_390d3ac0468b6516___features__gen_HtmlElement__HtmlElement__alloc_cb2b8d99256f33df___string__String__core_608f92abc48d28da___option__Option_alloc_cb2b8d99256f33df___string__String___core_608f92abc48d28da___option__Option_alloc_cb2b8d99256f33df___string__String_______true_(arg0, arg1, arg2, arg3, arg4, arg5) {
1051
1092
  const ptr0 = passStringToWasm0(arg3, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1052
1093
  const len0 = WASM_VECTOR_LEN;
1053
1094
  var ptr1 = isLikeNone(arg4) ? 0 : passStringToWasm0(arg4, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1054
1095
  var len1 = WASM_VECTOR_LEN;
1055
1096
  var ptr2 = isLikeNone(arg5) ? 0 : passStringToWasm0(arg5, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1056
1097
  var len2 = WASM_VECTOR_LEN;
1057
- wasm.wasm_bindgen_66404d18cc2edcc2___convert__closures_____invoke___web_sys_90ed3bea5014610e___features__gen_HtmlElement__HtmlElement__alloc_508e33bd5656020b___string__String__core_ed718c3d60ebd546___option__Option_alloc_508e33bd5656020b___string__String___core_ed718c3d60ebd546___option__Option_alloc_508e33bd5656020b___string__String_______true_(arg0, arg1, arg2, ptr0, len0, ptr1, len1, ptr2, len2);
1098
+ wasm.wasm_bindgen_6af9200f0870d488___convert__closures_____invoke___web_sys_390d3ac0468b6516___features__gen_HtmlElement__HtmlElement__alloc_cb2b8d99256f33df___string__String__core_608f92abc48d28da___option__Option_alloc_cb2b8d99256f33df___string__String___core_608f92abc48d28da___option__Option_alloc_cb2b8d99256f33df___string__String_______true_(arg0, arg1, arg2, ptr0, len0, ptr1, len1, ptr2, len2);
1058
1099
  }
1059
1100
 
1060
- function wasm_bindgen_66404d18cc2edcc2___convert__closures_____invoke___u32______true_(arg0, arg1, arg2) {
1061
- wasm.wasm_bindgen_66404d18cc2edcc2___convert__closures_____invoke___u32______true_(arg0, arg1, arg2);
1101
+ function wasm_bindgen_6af9200f0870d488___convert__closures_____invoke___u32______true_(arg0, arg1, arg2) {
1102
+ wasm.wasm_bindgen_6af9200f0870d488___convert__closures_____invoke___u32______true_(arg0, arg1, arg2);
1062
1103
  }
1063
1104
 
1064
1105
 
Binary file
@@ -7,25 +7,27 @@ export const get_pivot: (a: any, b: any) => [number, number, number];
7
7
  export const get_query: (a: any) => any;
8
8
  export const get_view: (a: any) => any;
9
9
  export const register: () => [number, number];
10
+ export const set_cell_state: (a: any, b: any, c: number, d: number, e: number, f: number, g: number, h: number) => void;
10
11
  export const set_choices: (a: any, b: any) => void;
11
12
  export const set_columns: (a: any, b: any) => void;
12
13
  export const set_formats: (a: any, b: any) => void;
13
14
  export const set_provider: (a: any, b: any) => void;
14
15
  export const set_texts: (a: any, b: any) => void;
15
- export const set_view: (a: any, b: any) => void;
16
- export const wasm_bindgen_66404d18cc2edcc2___convert__closures_____invoke___web_sys_90ed3bea5014610e___features__gen_HtmlElement__HtmlElement__alloc_508e33bd5656020b___string__String__core_ed718c3d60ebd546___option__Option_alloc_508e33bd5656020b___string__String___core_ed718c3d60ebd546___option__Option_alloc_508e33bd5656020b___string__String_______true_: (a: number, b: number, c: any, d: number, e: number, f: number, g: number, h: number, i: number) => void;
17
- export const wasm_bindgen_66404d18cc2edcc2___convert__closures_____invoke___wasm_bindgen_66404d18cc2edcc2___JsValue__core_ed718c3d60ebd546___result__Result_____wasm_bindgen_66404d18cc2edcc2___JsError___true_: (a: number, b: number, c: any) => [number, number];
18
- export const wasm_bindgen_66404d18cc2edcc2___convert__closures_____invoke___js_sys_f6d81f9cdcf4f83___Array______true_: (a: number, b: number, c: any) => void;
19
- export const wasm_bindgen_66404d18cc2edcc2___convert__closures_____invoke___js_sys_f6d81f9cdcf4f83___Array______true__2: (a: number, b: number, c: any) => void;
20
- export const wasm_bindgen_66404d18cc2edcc2___convert__closures_____invoke___js_sys_f6d81f9cdcf4f83___Array______true__4: (a: number, b: number, c: any) => void;
21
- export const wasm_bindgen_66404d18cc2edcc2___convert__closures_____invoke___js_sys_f6d81f9cdcf4f83___Array______true__5: (a: number, b: number, c: any) => void;
22
- export const wasm_bindgen_66404d18cc2edcc2___convert__closures_____invoke___u32______true_: (a: number, b: number, c: number) => void;
23
- export const wasm_bindgen_66404d18cc2edcc2___convert__closures_____invoke_______true_: (a: number, b: number) => void;
24
- export const __wbindgen_malloc: (a: number, b: number) => number;
25
- export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
16
+ export const set_values: (a: any, b: any) => void;
17
+ export const set_view: (a: any, b: any, c: any) => void;
18
+ export const wasm_bindgen_6af9200f0870d488___convert__closures_____invoke___web_sys_390d3ac0468b6516___features__gen_HtmlElement__HtmlElement__alloc_cb2b8d99256f33df___string__String__core_608f92abc48d28da___option__Option_alloc_cb2b8d99256f33df___string__String___core_608f92abc48d28da___option__Option_alloc_cb2b8d99256f33df___string__String_______true_: (a: number, b: number, c: any, d: number, e: number, f: number, g: number, h: number, i: number) => void;
19
+ export const wasm_bindgen_6af9200f0870d488___convert__closures_____invoke___wasm_bindgen_6af9200f0870d488___JsValue__core_608f92abc48d28da___result__Result_____wasm_bindgen_6af9200f0870d488___JsError___true_: (a: number, b: number, c: any) => [number, number];
20
+ export const wasm_bindgen_6af9200f0870d488___convert__closures_____invoke___js_sys_9485a4494ece8a82___Array______true_: (a: number, b: number, c: any) => void;
21
+ export const wasm_bindgen_6af9200f0870d488___convert__closures_____invoke___js_sys_9485a4494ece8a82___Array______true__2: (a: number, b: number, c: any) => void;
22
+ export const wasm_bindgen_6af9200f0870d488___convert__closures_____invoke___js_sys_9485a4494ece8a82___Array______true__4: (a: number, b: number, c: any) => void;
23
+ export const wasm_bindgen_6af9200f0870d488___convert__closures_____invoke___js_sys_9485a4494ece8a82___Array______true__5: (a: number, b: number, c: any) => void;
24
+ export const wasm_bindgen_6af9200f0870d488___convert__closures_____invoke___u32______true_: (a: number, b: number, c: number) => void;
25
+ export const wasm_bindgen_6af9200f0870d488___convert__closures_____invoke_______true_: (a: number, b: number) => void;
26
+ export const __wbindgen_exn_store: (a: number) => void;
26
27
  export const __externref_table_alloc: () => number;
27
28
  export const __wbindgen_externrefs: WebAssembly.Table;
28
- export const __wbindgen_exn_store: (a: number) => void;
29
+ export const __wbindgen_malloc: (a: number, b: number) => number;
30
+ export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
29
31
  export const __wbindgen_destroy_closure: (a: number, b: number) => void;
30
32
  export const __externref_table_dealloc: (a: number) => void;
31
33
  export const __wbindgen_free: (a: number, b: number, c: number) => void;
@@ -0,0 +1,17 @@
1
+
2
+ export function __opengrid_intl_formatter(kind, locale, options) {
3
+ const loc = locale || undefined;
4
+ const format = kind === 'date'
5
+ ? new Intl.DateTimeFormat(loc, options)
6
+ : new Intl.NumberFormat(loc, options);
7
+ return (text, value) => {
8
+ if (value === null || value === undefined) return '';
9
+ if (kind === 'date') {
10
+ const at = Date.parse(typeof value === 'string' && value.length === 10
11
+ ? value + 'T00:00:00Z' : value);
12
+ return Number.isNaN(at) ? text : format.format(new Date(at));
13
+ }
14
+ const number = Number(value);
15
+ return Number.isFinite(number) ? format.format(number) : text;
16
+ };
17
+ }
package/react/index.d.ts CHANGED
@@ -50,6 +50,10 @@ export interface OpengridGridProps extends ConnectOptions, ElementProps {
50
50
  mode?: Mode;
51
51
  /** Up to two columns, outermost first: `"country,customer"`. */
52
52
  groupBy?: string;
53
+ /** The field holding a row's parent key: the rows show as a tree. */
54
+ tree?: string;
55
+ /** The field the parent key refers to; `id` when absent. */
56
+ treeKey?: string;
53
57
  search?: boolean;
54
58
  facets?: boolean;
55
59
  toolbar?: boolean;
package/react/index.js CHANGED
@@ -143,6 +143,8 @@ export const OpengridGrid = component(
143
143
  pageSize: "page-size",
144
144
  mode: "mode",
145
145
  groupBy: "group-by",
146
+ tree: "tree",
147
+ treeKey: "tree-key",
146
148
  search: "search",
147
149
  facets: "facets",
148
150
  toolbar: "toolbar",
@@ -10,6 +10,8 @@
10
10
  pageSize,
11
11
  mode,
12
12
  groupBy,
13
+ tree,
14
+ treeKey,
13
15
  search = false,
14
16
  facets = false,
15
17
  toolbar = false,
@@ -37,6 +39,8 @@
37
39
  "page-size": text(pageSize),
38
40
  mode,
39
41
  "group-by": groupBy,
42
+ tree,
43
+ "tree-key": treeKey,
40
44
  search: flag(search),
41
45
  facets: flag(facets),
42
46
  toolbar: flag(toolbar),
package/svelte/index.d.ts CHANGED
@@ -54,6 +54,10 @@ export interface OpengridGridProps extends Options, ElementProps {
54
54
  mode?: Mode;
55
55
  /** Up to two columns, outermost first: `"country,customer"`. */
56
56
  groupBy?: string;
57
+ /** The field holding a row's parent key: the rows show as a tree. */
58
+ tree?: string;
59
+ /** The field the parent key refers to; `id` when absent. */
60
+ treeKey?: string;
57
61
  search?: boolean;
58
62
  facets?: boolean;
59
63
  toolbar?: boolean;
package/vue/index.d.ts CHANGED
@@ -45,6 +45,10 @@ export interface OpengridGridProps extends Options {
45
45
  mode?: Mode;
46
46
  /** Up to two columns, outermost first: `"country,customer"`. */
47
47
  groupBy?: string;
48
+ /** The field holding a row's parent key: the rows show as a tree. */
49
+ tree?: string;
50
+ /** The field the parent key refers to; `id` when absent. */
51
+ treeKey?: string;
48
52
  search?: boolean;
49
53
  facets?: boolean;
50
54
  toolbar?: boolean;
package/vue/index.js CHANGED
@@ -135,6 +135,8 @@ export const OpengridGrid = component(
135
135
  pageSize: "page-size",
136
136
  mode: "mode",
137
137
  groupBy: "group-by",
138
+ tree: "tree",
139
+ treeKey: "tree-key",
138
140
  search: "search",
139
141
  facets: "facets",
140
142
  toolbar: "toolbar",