@casoon/opengrid 0.8.1 → 0.10.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,121 @@ Two things belong in every release entry and are easy to leave out:
18
18
 
19
19
  ## [Unreleased]
20
20
 
21
+ ## [0.10.0] — 2026-10-02
22
+
23
+ **Screen-reader pairings tested: none yet** ([issue #5](https://github.com/casoon/opengrid/issues/5)).
24
+ **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.
25
+
26
+ The grid shows a tree: rows that name their parent, loaded a level at a time, with the treegrid's
27
+ keys and a selection by key. Beside it, the query of a view without an element, a sentence of the
28
+ page said with a new view, and Intl formats under a strict Content Security Policy.
29
+
30
+ **What breaks:**
31
+ - Rust: `Query` and `QueryResult` have a new public field, `tree`; struct literals need it
32
+ (`tree: None`). `DataSourceCapabilities` has a new field, `tree`.
33
+
34
+ **Module sizes** (brotli, `just measure-modules`): the elements 224.8 → 239.8 KiB, the engine
35
+ 118.8 → 133.8 KiB — both past their bounds, which this release raises (`scripts/module-budget.txt`):
36
+ the tree in the grid and in the engine is most of it; `view_query`'s share is 5.3 KiB raw.
37
+
38
+ ### Added
39
+
40
+ - **A tree in `<opengrid-grid>`** ([#135](https://github.com/casoon/opengrid/issues/135), E38).
41
+ `tree="parent_id"` (and `tree-key`, `id` when absent) shows the rows as a `treegrid`, loaded a
42
+ level at a time with each node's child count, so a leaf offers nothing to open. Rows carry
43
+ `aria-level`, `aria-posinset`/`aria-setsize`, `aria-expanded` where something opens and
44
+ `aria-busy` while it loads; the first column is indented by depth. On a node's first cell `→`
45
+ opens it or goes to its first child, `←` closes it or goes to its parent; a click on the first
46
+ cell opens or closes it. A filter keeps the path to a match as muted context; the status line
47
+ counts matches and names orphans once. Open nodes travel in the view's `expanded`, each `[key]`.
48
+ `page-size` refuses a tree; `group-by` is not used in one and + Group says why. React, Vue and
49
+ Svelte take `tree` and `treeKey`.
50
+ - **A tree's selection names nodes by key** ([#135](https://github.com/casoon/opengrid/issues/135)).
51
+ It stays when nodes close over it and when the grid is sorted or filtered;
52
+ `opengrid-selection-change` carries `keys`, and `count` counts every selected node. Select-all
53
+ takes the nodes shown. Editing is off in a tree.
54
+ - **The query of a view without an element** ([#144](https://github.com/casoon/opengrid/issues/144)).
55
+ `engine.view_query(source, columns, view)` answers what `get_query()` answers on a grid with
56
+ these columns once the view is applied — so a server can count or export a saved view without a
57
+ browser. A view naming an unknown column, or a value its column cannot hold, is refused with every
58
+ problem named.
59
+ - **`set_view(host, view, { notice })`** ([#146](https://github.com/casoon/opengrid/issues/146)).
60
+ The page's sentence — "Saved view Q3 applied" — is said once, with the result:
61
+ `52 matches · Saved view Q3 applied`. A view the element already has says nothing, notice or not.
62
+ The pivot takes it too.
63
+ - **One level of a tree, in the engine** ([#129](https://github.com/casoon/opengrid/issues/129), E38).
64
+ A query takes `tree: { key?, parent, under? }` and answers the children of `under` (or the
65
+ roots) with `tree: { children, match, matches, orphans }` beside the rows: orphans are roots,
66
+ a key twice or a cycle is an error with a sentence, a filter shows matches with their
67
+ ancestors as context, a sort orders siblings. The local engine answers it in the tab and the
68
+ worker, the planner keeps a tree with its filter on one side, and sources say whether they can
69
+ with the new capability `tree` (written only when true). The server refuses a tree query for
70
+ sources without it. Nine conformance cases (T2–T6) pass natively and in the browser.
71
+ - **The tree on the server, and the tenant rule** ([#131](https://github.com/casoon/opengrid/issues/131), plan point 122).
72
+ The tree part takes `scope`, a filter that decides which rows the tree consists of; the server
73
+ puts its mandatory row filter there, so another tenant's row is never a match, context or child
74
+ and a node under one becomes an orphan. Every connector answers a tree: the file and rows tiers
75
+ through the engine, SQLite, PostgreSQL and any other through `Connector::tree`, which asks for
76
+ the rows of the scope and lets the engine answer the level. `GET /source` reports `tree` for
77
+ every source. The tree conformance cases (now twelve, three on `scope`) pass against a file,
78
+ the rows tier, SQLite and PostgreSQL through `POST /query`.
79
+ - **A tree's level in the binary result form** ([#135](https://github.com/casoon/opengrid/issues/135)).
80
+ Kind `2`: the result, then the tree part (matches, orphans, the child count per row, matches
81
+ as a bitmap). The engine's `execute_columns` — what the worker and the local provider call —
82
+ and the server answer a tree in it; a reader of plain results refuses it instead of losing the
83
+ part. Before, the worker could not answer a tree at all, and the server fell back to JSON.
84
+
85
+ ### Fixed
86
+
87
+ - **Intl formats work under a strict Content Security Policy** ([#139](https://github.com/casoon/opengrid/issues/139)).
88
+ `set_formats` built its formatters with `new Function`, which throws without `'unsafe-eval'`. They
89
+ come from a static snippet now; no code is built at run time.
90
+
91
+ ## [0.9.0] — 2026-10-01
92
+
93
+ **Screen-reader pairings tested: none yet** ([issue #5](https://github.com/casoon/opengrid/issues/5)).
94
+ **Browsers:** Chromium (the whole e2e suite, 1053 passed) and WebKit (Playwright's, not Safari:
95
+ 519 passed, 10 skipped). Firefox: **not run**.
96
+
97
+ The pivot grows: two column dimensions with a named header, and limits set by a measurement of
98
+ what a browser draws as a table in about a second.
99
+
100
+ **What breaks:**
101
+ - A pivot over the new budget of 131 072 cells is an error now, though its rows and columns are
102
+ each inside their limits — 2 000 rows × 256 columns was allowed before (E39).
103
+ - Rust: `PivotLimits` has a new field, `max_cells`.
104
+
105
+ **Module sizes** (brotli, `just measure-modules`): the elements 224.0 → 224.8 KiB, the engine
106
+ 118.8 KiB, both inside their bounds.
107
+
108
+ ### Fixed
109
+
110
+ - **An answer no longer takes the focus away in `<opengrid-pivot>`** ([#124](https://github.com/casoon/opengrid/issues/124)).
111
+ Every answer redraws the pivot; a reader on a toolbar control, a sort or fold button, or
112
+ typing into the filter field lost the focus and the typed text. The focused control is found
113
+ again after a redraw, and the field keeps its text — until the expression is added.
114
+
115
+ ### Changed
116
+
117
+ - **The pivot's limits follow a measurement** ([#122](https://github.com/casoon/opengrid/issues/122), E39).
118
+ A browser draws a native table in time proportional to its cells, whatever their shape
119
+ (`just measure-pivot`: 128 000 cells in 0.7 s in Chromium, 1.0 s in WebKit; 512 000 in 3.1 s
120
+ and 4.7 s). So a pivot now has a budget of **131 072 cells** (rows × generated columns,
121
+ `PivotLimits::max_cells`, reported by `GET /source`), the row limit rises from 2 000 to
122
+ **10 000** and the column limit stays 256. **What breaks:** a pivot wider than the budget —
123
+ 2 000 rows × 256 columns was allowed — is an error with a sentence now. Rust: `PivotLimits` has
124
+ a new field.
125
+
126
+ ### Added
127
+
128
+ - **Two column dimensions in `<opengrid-pivot>`** ([#120](https://github.com/casoon/opengrid/issues/120)).
129
+ `columns="ordered_year,status"` gives a header row per dimension, the outer value spanning its
130
+ inner ones, then the measures. With two, the pivot is a complex table: every header cell has an
131
+ `id` and every value cell `headers` naming its row and column headers. The engine's limit
132
+ (`PivotLimits::max_column_dimensions`, reported by `GET /source`) is 2 now; three is an error
133
+ with a sentence. The toolbar offers "+ Column" until there are two; `columnFull` reads "Two
134
+ column fields already". Conformance cases with two column dimensions run on every path.
135
+
21
136
  ## [0.8.1] — 2026-09-30
22
137
 
23
138
  **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
  /**
@@ -221,6 +224,12 @@ export interface Engine {
221
224
  pivot(pivotJson: string): string;
222
225
  /** The same pivot in the binary form — what the tab and worker providers answer. */
223
226
  pivot_columns(pivotJson: string): Uint8Array;
227
+ /**
228
+ * The query of a view on a grid with these `columns` (a JSON array), as
229
+ * JSON — what `get_query()` answers once the view is applied (issue #144).
230
+ * Throws for a view naming an unknown column or a value its column cannot hold.
231
+ */
232
+ view_query(source: string, columnsJson: string, viewJson: string): string;
224
233
  }
225
234
 
226
235
  /** What a server says a source is. */
@@ -566,6 +575,16 @@ export interface PivotSort {
566
575
  direction: "asc" | "desc";
567
576
  }
568
577
 
578
+ /** The second argument of `set_view` (issue #146). */
579
+ export interface SetViewOptions {
580
+ /**
581
+ * A sentence of the page — "Saved view Q3 applied", "Filtered by the
582
+ * assistant" — said once in the status line together with the result that
583
+ * follows. A view the element already has says nothing, notice or not.
584
+ */
585
+ notice?: string;
586
+ }
587
+
569
588
  /** What `set_view` takes for a pivot: a part left out is empty. */
570
589
  export type PivotViewInput = Partial<PivotView>;
571
590
 
@@ -684,6 +703,11 @@ export type TextKey =
684
703
  | "pivotFilters"
685
704
  | "pivotFilterLabel"
686
705
  | "pivotFilterHint"
706
+ | "treeContext"
707
+ | "treeOrphans"
708
+ | "treeLevelTooLarge"
709
+ | "treeRefused"
710
+ | "treeGroupIgnored"
687
711
  | "filterAny"
688
712
  | "booleanTrue"
689
713
  | "booleanFalse"
@@ -743,10 +767,16 @@ export type Texts = Partial<Record<TextKey, string>> & {
743
767
  // Events
744
768
  // ---------------------------------------------------------------------------
745
769
 
746
- /** `opengrid-selection-change`: logical row numbers, ascending. */
770
+ /**
771
+ * `opengrid-selection-change`: logical row numbers, ascending. In a tree
772
+ * (`tree` set) `rows` are the display positions of the selected nodes shown,
773
+ * `keys` names every selected node by its key and `count` counts them.
774
+ */
747
775
  export interface SelectionChangeDetail {
748
776
  rows: number[];
749
777
  count: number;
778
+ /** In a tree only: the selected nodes' keys, the shown ones first. */
779
+ keys?: unknown[];
750
780
  }
751
781
 
752
782
  /** `opengrid-cell-change`: everything a page needs to persist an edit. */
@@ -805,6 +835,10 @@ export interface OpengridGridAttributes {
805
835
  "page-size"?: string;
806
836
  mode?: Mode;
807
837
  "group-by"?: string;
838
+ /** The field holding a row's parent key: the rows show as a tree. */
839
+ tree?: string;
840
+ /** The field the parent key refers to; `id` when absent. */
841
+ "tree-key"?: string;
808
842
  search?: string;
809
843
  facets?: string;
810
844
  toolbar?: string;
@@ -827,7 +861,7 @@ export interface OpengridPivotAttributes {
827
861
  datasource?: string;
828
862
  /** Comma-separated row dimensions, outermost first. */
829
863
  rows?: string;
830
- /** Comma-separated column dimensions; V1 allows one. */
864
+ /** Comma-separated column dimensions, outermost first; V1 allows two. */
831
865
  columns?: string;
832
866
  /** The measures as the contract's JSON: `[{"field":"qty","fn":"sum","as":"total"}]`. */
833
867
  values?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@casoon/opengrid",
3
- "version": "0.8.1",
3
+ "version": "0.10.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": [
@@ -168,8 +168,13 @@ export function set_texts(host: HTMLElement, values: any): void;
168
168
  *
169
169
  * A pivot takes `{ rows, columns, values }` and writes them to its attributes
170
170
  * at once (issue #106).
171
+ *
172
+ * `options.notice` is a sentence of the page — "Saved view Q3 applied",
173
+ * "Filtered by the assistant" — said once, together with the result that
174
+ * follows (issue #146). A view the element already has says nothing, notice
175
+ * or not.
171
176
  */
172
- export function set_view(host: HTMLElement, view: any): void;
177
+ export function set_view(host: HTMLElement, view: any, options: any): void;
173
178
 
174
179
  export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
175
180
 
@@ -186,20 +191,20 @@ export interface InitOutput {
186
191
  readonly set_formats: (a: any, b: any) => void;
187
192
  readonly set_provider: (a: any, b: any) => void;
188
193
  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;
194
+ readonly set_view: (a: any, b: any, c: any) => void;
195
+ 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;
196
+ 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];
197
+ readonly wasm_bindgen_6af9200f0870d488___convert__closures_____invoke___js_sys_9485a4494ece8a82___Array______true_: (a: number, b: number, c: any) => void;
198
+ readonly wasm_bindgen_6af9200f0870d488___convert__closures_____invoke___js_sys_9485a4494ece8a82___Array______true__2: (a: number, b: number, c: any) => void;
199
+ readonly wasm_bindgen_6af9200f0870d488___convert__closures_____invoke___js_sys_9485a4494ece8a82___Array______true__4: (a: number, b: number, c: any) => void;
200
+ readonly wasm_bindgen_6af9200f0870d488___convert__closures_____invoke___js_sys_9485a4494ece8a82___Array______true__5: (a: number, b: number, c: any) => void;
201
+ readonly wasm_bindgen_6af9200f0870d488___convert__closures_____invoke___u32______true_: (a: number, b: number, c: number) => void;
202
+ readonly wasm_bindgen_6af9200f0870d488___convert__closures_____invoke_______true_: (a: number, b: number) => void;
203
+ readonly __wbindgen_exn_store: (a: number) => void;
200
204
  readonly __externref_table_alloc: () => number;
201
205
  readonly __wbindgen_externrefs: WebAssembly.Table;
202
- readonly __wbindgen_exn_store: (a: number) => void;
206
+ readonly __wbindgen_malloc: (a: number, b: number) => number;
207
+ readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
203
208
  readonly __wbindgen_destroy_closure: (a: number, b: number) => void;
204
209
  readonly __externref_table_dealloc: (a: number) => void;
205
210
  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-df12892104a61710/inline1.js';
3
- import * as import1 from "./snippets/opengrid-web-core-df12892104a61710/inline0.js"
4
- import * as import2 from "./snippets/opengrid-web-core-df12892104a61710/inline0.js"
5
- import * as import3 from "./snippets/opengrid-web-core-df12892104a61710/inline0.js"
2
+ import { __opengrid_intl_formatter } from './snippets/opengrid-web-components-cfa74f7f54f9c66d/inline0.js';
3
+ import { __opengrid_define_element } from './snippets/opengrid-web-core-8e0e8a7cacb9d3df/inline1.js';
4
+ import * as import1 from "./snippets/opengrid-web-core-8e0e8a7cacb9d3df/inline0.js"
5
+ import * as import2 from "./snippets/opengrid-web-core-8e0e8a7cacb9d3df/inline0.js"
6
+ import * as import3 from "./snippets/opengrid-web-core-8e0e8a7cacb9d3df/inline0.js"
6
7
 
7
8
 
8
9
  /**
@@ -259,11 +260,17 @@ export function set_texts(host, values) {
259
260
  *
260
261
  * A pivot takes `{ rows, columns, values }` and writes them to its attributes
261
262
  * at once (issue #106).
263
+ *
264
+ * `options.notice` is a sentence of the page — "Saved view Q3 applied",
265
+ * "Filtered by the assistant" — said once, together with the result that
266
+ * follows (issue #146). A view the element already has says nothing, notice
267
+ * or not.
262
268
  * @param {HTMLElement} host
263
269
  * @param {any} view
270
+ * @param {any} options
264
271
  */
265
- export function set_view(host, view) {
266
- wasm.set_view(host, view);
272
+ export function set_view(host, view, options) {
273
+ wasm.set_view(host, view, options);
267
274
  }
268
275
  function __wbg_get_imports() {
269
276
  const import0 = {
@@ -272,9 +279,13 @@ function __wbg_get_imports() {
272
279
  const ret = Error(getStringFromWasm0(arg0, arg1));
273
280
  return ret;
274
281
  },
275
- __wbg___opengrid_define_element_904842d97080c84a: function(arg0, arg1, arg2, arg3, arg4, arg5) {
282
+ __wbg___opengrid_define_element_7231be6371bb9dcb: function(arg0, arg1, arg2, arg3, arg4, arg5) {
276
283
  __opengrid_define_element(getStringFromWasm0(arg0, arg1), arg2, arg3, arg4, arg5);
277
284
  },
285
+ __wbg___opengrid_intl_formatter_9b6d5f011d93dec7: function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
286
+ const ret = __opengrid_intl_formatter(getStringFromWasm0(arg0, arg1), getStringFromWasm0(arg2, arg3), arg4);
287
+ return ret;
288
+ }, arguments); },
278
289
  __wbg___wbindgen_boolean_get_fa956cfa2d1bd751: function(arg0) {
279
290
  const v = arg0;
280
291
  const ret = typeof(v) === 'boolean' ? v : undefined;
@@ -350,10 +361,6 @@ function __wbg_get_imports() {
350
361
  const ret = arg0.bottom;
351
362
  return ret;
352
363
  },
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
364
  __wbg_call_8a2dd23819f8a60a: function() { return handleError(function (arg0, arg1) {
358
365
  const ret = arg0.call(arg1);
359
366
  return ret;
@@ -686,10 +693,6 @@ function __wbg_get_imports() {
686
693
  const ret = new CSSStyleSheet();
687
694
  return ret;
688
695
  }, 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
696
  __wbg_new_with_event_init_dict_b7d5fa264299bcfa: function() { return handleError(function (arg0, arg1, arg2) {
694
697
  const ret = new CustomEvent(getStringFromWasm0(arg0, arg1), arg2);
695
698
  return ret;
@@ -952,43 +955,43 @@ function __wbg_get_imports() {
952
955
  return ret;
953
956
  },
954
957
  __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_);
958
+ // 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`.
959
+ 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
960
  return ret;
958
961
  },
959
962
  __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_);
963
+ // 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`.
964
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen_6af9200f0870d488___convert__closures_____invoke___js_sys_9485a4494ece8a82___Array______true_);
962
965
  return ret;
963
966
  },
964
967
  __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);
968
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("Event")], shim_idx: 18, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
969
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen_6af9200f0870d488___convert__closures_____invoke___js_sys_9485a4494ece8a82___Array______true__2);
967
970
  return ret;
968
971
  },
969
972
  __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_);
973
+ // 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`.
974
+ 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
975
  return ret;
973
976
  },
974
977
  __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);
978
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("HTMLElement")], shim_idx: 18, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
979
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen_6af9200f0870d488___convert__closures_____invoke___js_sys_9485a4494ece8a82___Array______true__4);
977
980
  return ret;
978
981
  },
979
982
  __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);
983
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("KeyboardEvent")], shim_idx: 18, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
984
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen_6af9200f0870d488___convert__closures_____invoke___js_sys_9485a4494ece8a82___Array______true__5);
982
985
  return ret;
983
986
  },
984
987
  __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_);
988
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [U32], shim_idx: 195, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
989
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen_6af9200f0870d488___convert__closures_____invoke___u32______true_);
987
990
  return ret;
988
991
  },
989
992
  __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_);
993
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 17, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
994
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen_6af9200f0870d488___convert__closures_____invoke_______true_);
992
995
  return ret;
993
996
  },
994
997
  __wbindgen_cast_0000000000000009: function(arg0) {
@@ -1014,51 +1017,51 @@ function __wbg_get_imports() {
1014
1017
  return {
1015
1018
  __proto__: null,
1016
1019
  "./opengrid_web_components_bg.js": import0,
1017
- "./snippets/opengrid-web-core-df12892104a61710/inline0.js": import1,
1018
- "./snippets/opengrid-web-core-df12892104a61710/inline0.js": import2,
1019
- "./snippets/opengrid-web-core-df12892104a61710/inline0.js": import3,
1020
+ "./snippets/opengrid-web-core-8e0e8a7cacb9d3df/inline0.js": import1,
1021
+ "./snippets/opengrid-web-core-8e0e8a7cacb9d3df/inline0.js": import2,
1022
+ "./snippets/opengrid-web-core-8e0e8a7cacb9d3df/inline0.js": import3,
1020
1023
  };
1021
1024
  }
1022
1025
 
1023
- function wasm_bindgen_66404d18cc2edcc2___convert__closures_____invoke_______true_(arg0, arg1) {
1024
- wasm.wasm_bindgen_66404d18cc2edcc2___convert__closures_____invoke_______true_(arg0, arg1);
1026
+ function wasm_bindgen_6af9200f0870d488___convert__closures_____invoke_______true_(arg0, arg1) {
1027
+ wasm.wasm_bindgen_6af9200f0870d488___convert__closures_____invoke_______true_(arg0, arg1);
1025
1028
  }
1026
1029
 
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);
1030
+ function wasm_bindgen_6af9200f0870d488___convert__closures_____invoke___js_sys_9485a4494ece8a82___Array______true_(arg0, arg1, arg2) {
1031
+ wasm.wasm_bindgen_6af9200f0870d488___convert__closures_____invoke___js_sys_9485a4494ece8a82___Array______true_(arg0, arg1, arg2);
1029
1032
  }
1030
1033
 
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);
1034
+ function wasm_bindgen_6af9200f0870d488___convert__closures_____invoke___js_sys_9485a4494ece8a82___Array______true__2(arg0, arg1, arg2) {
1035
+ wasm.wasm_bindgen_6af9200f0870d488___convert__closures_____invoke___js_sys_9485a4494ece8a82___Array______true__2(arg0, arg1, arg2);
1033
1036
  }
1034
1037
 
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);
1038
+ function wasm_bindgen_6af9200f0870d488___convert__closures_____invoke___js_sys_9485a4494ece8a82___Array______true__4(arg0, arg1, arg2) {
1039
+ wasm.wasm_bindgen_6af9200f0870d488___convert__closures_____invoke___js_sys_9485a4494ece8a82___Array______true__4(arg0, arg1, arg2);
1037
1040
  }
1038
1041
 
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);
1042
+ function wasm_bindgen_6af9200f0870d488___convert__closures_____invoke___js_sys_9485a4494ece8a82___Array______true__5(arg0, arg1, arg2) {
1043
+ wasm.wasm_bindgen_6af9200f0870d488___convert__closures_____invoke___js_sys_9485a4494ece8a82___Array______true__5(arg0, arg1, arg2);
1041
1044
  }
1042
1045
 
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);
1046
+ function wasm_bindgen_6af9200f0870d488___convert__closures_____invoke___wasm_bindgen_6af9200f0870d488___JsValue__core_608f92abc48d28da___result__Result_____wasm_bindgen_6af9200f0870d488___JsError___true_(arg0, arg1, arg2) {
1047
+ 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
1048
  if (ret[1]) {
1046
1049
  throw takeFromExternrefTable0(ret[0]);
1047
1050
  }
1048
1051
  }
1049
1052
 
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) {
1053
+ 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
1054
  const ptr0 = passStringToWasm0(arg3, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1052
1055
  const len0 = WASM_VECTOR_LEN;
1053
1056
  var ptr1 = isLikeNone(arg4) ? 0 : passStringToWasm0(arg4, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1054
1057
  var len1 = WASM_VECTOR_LEN;
1055
1058
  var ptr2 = isLikeNone(arg5) ? 0 : passStringToWasm0(arg5, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1056
1059
  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);
1060
+ 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
1061
  }
1059
1062
 
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);
1063
+ function wasm_bindgen_6af9200f0870d488___convert__closures_____invoke___u32______true_(arg0, arg1, arg2) {
1064
+ wasm.wasm_bindgen_6af9200f0870d488___convert__closures_____invoke___u32______true_(arg0, arg1, arg2);
1062
1065
  }
1063
1066
 
1064
1067
 
Binary file
@@ -12,20 +12,20 @@ export const set_columns: (a: any, b: any) => void;
12
12
  export const set_formats: (a: any, b: any) => void;
13
13
  export const set_provider: (a: any, b: any) => void;
14
14
  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;
15
+ export const set_view: (a: any, b: any, c: any) => void;
16
+ 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;
17
+ 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];
18
+ export const wasm_bindgen_6af9200f0870d488___convert__closures_____invoke___js_sys_9485a4494ece8a82___Array______true_: (a: number, b: number, c: any) => void;
19
+ export const wasm_bindgen_6af9200f0870d488___convert__closures_____invoke___js_sys_9485a4494ece8a82___Array______true__2: (a: number, b: number, c: any) => void;
20
+ export const wasm_bindgen_6af9200f0870d488___convert__closures_____invoke___js_sys_9485a4494ece8a82___Array______true__4: (a: number, b: number, c: any) => void;
21
+ export const wasm_bindgen_6af9200f0870d488___convert__closures_____invoke___js_sys_9485a4494ece8a82___Array______true__5: (a: number, b: number, c: any) => void;
22
+ export const wasm_bindgen_6af9200f0870d488___convert__closures_____invoke___u32______true_: (a: number, b: number, c: number) => void;
23
+ export const wasm_bindgen_6af9200f0870d488___convert__closures_____invoke_______true_: (a: number, b: number) => void;
24
+ export const __wbindgen_exn_store: (a: number) => void;
26
25
  export const __externref_table_alloc: () => number;
27
26
  export const __wbindgen_externrefs: WebAssembly.Table;
28
- export const __wbindgen_exn_store: (a: number) => void;
27
+ export const __wbindgen_malloc: (a: number, b: number) => number;
28
+ export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
29
29
  export const __wbindgen_destroy_closure: (a: number, b: number) => void;
30
30
  export const __externref_table_dealloc: (a: number) => void;
31
31
  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;
@@ -73,7 +77,7 @@ export interface OpengridPivotProps extends PivotConnectOptions, ElementProps {
73
77
  datasource?: string;
74
78
  /** Comma-separated row dimensions, outermost first. */
75
79
  rows?: string;
76
- /** Comma-separated column dimensions; V1 allows one. */
80
+ /** Comma-separated column dimensions, outermost first; V1 allows two. */
77
81
  columns?: string;
78
82
  /** The measures as the contract's JSON. */
79
83
  values?: string;
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;
@@ -87,7 +91,7 @@ export interface OpengridPivotProps extends PivotOptions, ElementProps {
87
91
  datasource?: string;
88
92
  /** Comma-separated row dimensions, outermost first. */
89
93
  rows?: string;
90
- /** Comma-separated column dimensions; V1 allows one. */
94
+ /** Comma-separated column dimensions, outermost first; V1 allows two. */
91
95
  columns?: string;
92
96
  /** The measures as the contract's JSON. */
93
97
  values?: string;
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;
@@ -73,7 +77,7 @@ export interface OpengridPivotProps
73
77
  datasource?: string;
74
78
  /** Comma-separated row dimensions, outermost first. */
75
79
  rows?: string;
76
- /** Comma-separated column dimensions; V1 allows one. */
80
+ /** Comma-separated column dimensions, outermost first; V1 allows two. */
77
81
  columns?: string;
78
82
  /** The measures as the contract's JSON. */
79
83
  values?: string;
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",