@casoon/opengrid 0.14.0 → 0.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/CHANGELOG.md +621 -19
  2. package/README.md +19 -2
  3. package/engine/opengrid_wasm_bg.wasm +0 -0
  4. package/loader.d.ts +451 -24
  5. package/loader.js +584 -132
  6. package/package.json +13 -6
  7. package/pkg/opengrid_web_components.d.ts +94 -23
  8. package/pkg/opengrid_web_components.js +451 -59
  9. package/pkg/opengrid_web_components_bg.wasm +0 -0
  10. package/pkg/opengrid_web_components_bg.wasm.d.ts +15 -6
  11. package/pkg/snippets/opengrid-web-components-35ed06b453a9b215/inline0.js +8 -0
  12. package/pkg/snippets/opengrid-web-components-35ed06b453a9b215/inline1.js +58 -0
  13. package/pkg/snippets/opengrid-web-core-b41714d4e7311909/inline2.js +89 -0
  14. package/react/index.d.ts +20 -2
  15. package/react/index.js +32 -6
  16. package/svelte/Opengrid.svelte +46 -11
  17. package/svelte/OpengridGrid.svelte +20 -1
  18. package/svelte/OpengridPivot.svelte +3 -3
  19. package/svelte/OpengridTable.svelte +1 -1
  20. package/svelte/index.d.ts +57 -18
  21. package/svelte/index.js +1 -1
  22. package/texts/de.d.ts +5 -0
  23. package/texts/de.js +245 -0
  24. package/vue/index.d.ts +49 -7
  25. package/vue/index.js +41 -11
  26. package/worker.js +6 -3
  27. package/xlsx/opengrid_xlsx.d.ts +69 -0
  28. package/xlsx/opengrid_xlsx.js +375 -0
  29. package/xlsx/opengrid_xlsx_bg.wasm +0 -0
  30. package/xlsx/opengrid_xlsx_bg.wasm.d.ts +16 -0
  31. package/pkg/snippets/opengrid-web-components-56667a20e9158a6a/inline0.js +0 -17
  32. /package/pkg/snippets/{opengrid-web-core-a3505e32fee0c1ed → opengrid-web-core-b41714d4e7311909}/inline0.js +0 -0
  33. /package/pkg/snippets/{opengrid-web-core-a3505e32fee0c1ed → opengrid-web-core-b41714d4e7311909}/inline1.js +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@casoon/opengrid",
3
- "version": "0.14.0",
3
+ "version": "0.16.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": [
@@ -44,9 +44,14 @@
44
44
  "svelte": "./svelte/index.js",
45
45
  "default": "./svelte/index.js"
46
46
  },
47
+ "./texts/de": {
48
+ "types": "./texts/de.d.ts",
49
+ "default": "./texts/de.js"
50
+ },
47
51
  "./worker.js": "./worker.js",
48
52
  "./pkg/*": "./pkg/*",
49
53
  "./engine/*": "./engine/*",
54
+ "./xlsx/*": "./xlsx/*",
50
55
  "./package.json": "./package.json"
51
56
  },
52
57
  "main": "./loader.js",
@@ -61,18 +66,20 @@
61
66
  "react/",
62
67
  "vue/",
63
68
  "svelte/",
69
+ "texts/",
64
70
  "pkg/",
65
71
  "engine/",
72
+ "xlsx/",
66
73
  "LICENSE-MIT",
67
74
  "LICENSE-APACHE",
68
75
  "README.md",
69
76
  "CHANGELOG.md"
70
77
  ],
71
78
  "peerDependencies": {
72
- "@types/react": ">=18",
79
+ "@types/react": ">=18.3.0",
73
80
  "react": ">=18",
74
81
  "svelte": "^5.0.0",
75
- "vue": ">=3.3"
82
+ "vue": ">=3.4.20"
76
83
  },
77
84
  "peerDependenciesMeta": {
78
85
  "@types/react": {
@@ -90,11 +97,11 @@
90
97
  },
91
98
  "devDependencies": {
92
99
  "@types/react": "19.3.0",
93
- "svelte": "5.57.1",
94
- "vue": "3.5.43"
100
+ "svelte": "5.57.3",
101
+ "vue": "3.5.45"
95
102
  },
96
103
  "engines": {
97
- "node": ">=18"
104
+ "node": ">=22.12.0"
98
105
  },
99
106
  "publishConfig": {
100
107
  "access": "public"
@@ -6,7 +6,7 @@
6
6
  * mark) first. `options`: `{ delimiter, bom, protectFormulas, null }`, each
7
7
  * optional (docs/guides/export.md, point 87).
8
8
  */
9
- export function export_csv(answer: any, options: any, header: boolean): string;
9
+ export function export_csv(answer: any, options: any, header: boolean, headers: any): string;
10
10
 
11
11
  /**
12
12
  * One piece of a JSON array: the rows as objects, joined by commas. `first`:
@@ -15,6 +15,14 @@ export function export_csv(answer: any, options: any, header: boolean): string;
15
15
  */
16
16
  export function export_json(answer: any, first: boolean): string;
17
17
 
18
+ /**
19
+ * The header texts of the banded columns shown, `{ column: "Band · Title" }`
20
+ * (issue #353): pass it to `exportRows` as `headers` and a file names the band
21
+ * of a banded column. Columns without a band are not in it and keep their
22
+ * field name.
23
+ */
24
+ export function get_export_headers(host: HTMLElement): any;
25
+
18
26
  /**
19
27
  * The pivot as it is shown, as CSV (issue #3).
20
28
  *
@@ -71,6 +79,42 @@ export function get_query(host: HTMLElement): any;
71
79
  */
72
80
  export function get_view(host: HTMLElement): any;
73
81
 
82
+ /**
83
+ * The words a pivot's export has no data for, as `host` has them now: the
84
+ * texts for a NULL and for an empty dimension value, for the grand total and
85
+ * for a subtotal (with its `{value}`), then what a calculated measure is
86
+ * shown as — a share of the row, the column, the total, a running total
87
+ * (issue #329) — in that order.
88
+ *
89
+ * For `exportPivot` in `loader.js` (issue #331), which hands them to the
90
+ * server that writes the workbook; in the order of `PIVOT_TEXTS` there. Like
91
+ * [`export_csv`], exported for the loader and not part of the documented API.
92
+ */
93
+ export function pivot_words(host: HTMLElement): string[];
94
+
95
+ /**
96
+ * Every match of the grid's view as a plain table for paper (issue #334).
97
+ *
98
+ * A virtualized grid holds a window of rows, so a stylesheet alone cannot
99
+ * print it, and `beforeprint` cannot wait for a query. The page calls this,
100
+ * awaits it and then prints: the grid asks for every match of its view — the
101
+ * query of `get_query` — and builds a native table that only `@media print`
102
+ * shows, in place of the grid. `afterprint` removes it.
103
+ *
104
+ * Resolves with the number of rows in the table; with `null` where
105
+ * `get_query` answers `null`, and for the table and the pivot, which print
106
+ * whole as they are. Rejects with the provider's error, and with the code
107
+ * `too_many_rows` for more than 10 000 matches.
108
+ */
109
+ export function prepare_print(host: HTMLElement): Promise<any>;
110
+
111
+ /**
112
+ * Runs the grid's query again over a source that changed (issue #328), keeping
113
+ * the view, the focus by record, the selection by key and the history. What the
114
+ * "Refresh" button does; a page that took `opengrid-source-changed` over calls it.
115
+ */
116
+ export function refresh(host: HTMLElement): void;
117
+
74
118
  /**
75
119
  * Registers `<opengrid-table>` and `<opengrid-grid>`; safe to call more than
76
120
  * once.
@@ -101,6 +145,13 @@ export function set_actions(host: HTMLElement, actions: any): void;
101
145
  */
102
146
  export function set_cell_state(host: HTMLElement, key: any, column: string, state: string, message?: string | null): void;
103
147
 
148
+ /**
149
+ * Gives columns a template (issue #317): `{ column: ({ value, text, row, key }) => Node }`,
150
+ * the DOM node a cell shows instead of its text. Never an HTML string; the
151
+ * source's value stays what search, export and the events read.
152
+ */
153
+ export function set_cell_templates(host: HTMLElement, templates: any): void;
154
+
104
155
  /**
105
156
  * Sets the choices a column's editor offers (plan point 37).
106
157
  *
@@ -135,22 +186,12 @@ export function set_choices(host: HTMLElement, choices: any): void;
135
186
  export function set_columns(host: HTMLElement, columns: any): void;
136
187
 
137
188
  /**
138
- * Overrides the texts a component writes itself (point 48).
139
- *
140
- * `texts` is a plain JS object with any subset of the keys `lang`, `loading`,
141
- * `matchesOne`, `matchesOther`, `empty`, `error`, `errorUnknown`,
142
- * `filterGroup`, `operatorLabel`, `valueLabel`, `clear` and `operators`; every
143
- * key left out keeps its English default. `{count}`, `{column}` and `{cause}`
144
- * are the placeholders. A `lang` is written onto the elements that carry these
145
- * texts — the grid's filter row and status line, the table's error paragraph —
146
- * so they are announced in the language they are written in. Never onto the
147
- * data: the cells are the page's, in the page's language.
148
- *
149
- * Exported as `set_texts` beside `set_provider`, and like it, it takes effect
150
- * immediately: the grid rebuilds, because its labels are part of the one-time
151
- * skeleton (the filter row, the scroll offset and the focus are carried
152
- * across). Call it **before** wiring the provider and the component renders the
153
- * right words from its first paint.
189
+ * The function that builds the panel under an open row (issue #318): `(record,
190
+ * key) => Node`. The grid only.
191
+ */
192
+ export function set_detail_renderer(host: HTMLElement, renderer: any): void;
193
+
194
+ /**
154
195
  * Sets the per-column display formats (plan point 42).
155
196
  *
156
197
  * `formats` is a plain JS object keyed by column name. A value is either a
@@ -183,6 +224,27 @@ export function set_provider(host: HTMLElement, provider: any): void;
183
224
  */
184
225
  export function set_row_state(host: HTMLElement, provisional_key: string, state: string, detail: any): void;
185
226
 
227
+ /**
228
+ * Overrides the texts a component writes itself (point 48).
229
+ *
230
+ * `texts` is a plain JS object with any subset of the keys `lang`, `loading`,
231
+ * `matchesOne`, `matchesOther`, `empty`, `error`, `errorUnknown`,
232
+ * `filterGroup`, `operatorLabel`, `valueLabel`, `clear` and `operators`; every
233
+ * key left out keeps its English default. `{count}`, `{column}` and `{cause}`
234
+ * are the placeholders. A `lang` is written onto the elements that carry these
235
+ * texts — the grid's filter row and status line, the table's error paragraph —
236
+ * so they are announced in the language they are written in. Never onto the
237
+ * data: the cells are the page's, in the page's language.
238
+ *
239
+ * A call adds to the texts an earlier one set; a key left out keeps what it was.
240
+ * `set_texts(host, null)` takes them all back to the English defaults.
241
+ *
242
+ * Exported as `set_texts` beside `set_provider`, and like it, it takes effect
243
+ * immediately: the grid rebuilds, because its labels are part of the one-time
244
+ * skeleton (the filter row, the scroll offset and the focus are carried
245
+ * across). Call it **before** wiring the provider and the component renders the
246
+ * right words from its first paint.
247
+ */
186
248
  export function set_texts(host: HTMLElement, values: any): void;
187
249
 
188
250
  /**
@@ -228,16 +290,22 @@ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembl
228
290
 
229
291
  export interface InitOutput {
230
292
  readonly memory: WebAssembly.Memory;
231
- readonly export_csv: (a: any, b: any, c: number) => [number, number, number, number];
293
+ readonly export_csv: (a: any, b: any, c: number, d: any) => [number, number, number, number];
232
294
  readonly export_json: (a: any, b: number) => [number, number, number, number];
295
+ readonly get_export_headers: (a: any) => any;
233
296
  readonly get_pivot: (a: any, b: any) => [number, number, number];
234
297
  readonly get_query: (a: any) => any;
235
298
  readonly get_view: (a: any) => any;
299
+ readonly pivot_words: (a: any) => [number, number];
300
+ readonly prepare_print: (a: any) => any;
301
+ readonly refresh: (a: any) => void;
236
302
  readonly register: () => [number, number];
237
303
  readonly set_actions: (a: any, b: any) => void;
238
304
  readonly set_cell_state: (a: any, b: any, c: number, d: number, e: number, f: number, g: number, h: number) => void;
305
+ readonly set_cell_templates: (a: any, b: any) => void;
239
306
  readonly set_choices: (a: any, b: any) => void;
240
307
  readonly set_columns: (a: any, b: any) => void;
308
+ readonly set_detail_renderer: (a: any, b: any) => void;
241
309
  readonly set_formats: (a: any, b: any) => void;
242
310
  readonly set_provider: (a: any, b: any) => void;
243
311
  readonly set_row_state: (a: any, b: number, c: number, d: number, e: number, f: any) => void;
@@ -245,12 +313,14 @@ export interface InitOutput {
245
313
  readonly set_validators: (a: any, b: any) => void;
246
314
  readonly set_values: (a: any, b: any) => void;
247
315
  readonly set_view: (a: any, b: any, c: any) => void;
248
- readonly wasm_bindgen_4cfd459b66780f67___convert__closures_____invoke___web_sys_b5c30633085262f3___features__gen_HtmlElement__HtmlElement__alloc_42d2b33bd937efdb___string__String__core_37ee0ce0c4cd57d5___option__Option_alloc_42d2b33bd937efdb___string__String___core_37ee0ce0c4cd57d5___option__Option_alloc_42d2b33bd937efdb___string__String_______true_: (a: number, b: number, c: any, d: number, e: number, f: number, g: number, h: number, i: number) => void;
316
+ readonly wasm_bindgen_4cfd459b66780f67___convert__closures_____invoke___web_sys_a82a67fb9e0c1518___features__gen_HtmlElement__HtmlElement__alloc_42d2b33bd937efdb___string__String__core_37ee0ce0c4cd57d5___option__Option_alloc_42d2b33bd937efdb___string__String___core_37ee0ce0c4cd57d5___option__Option_alloc_42d2b33bd937efdb___string__String_______true_: (a: number, b: number, c: any, d: number, e: number, f: number, g: number, h: number, i: number) => void;
249
317
  readonly wasm_bindgen_4cfd459b66780f67___convert__closures_____invoke___wasm_bindgen_4cfd459b66780f67___JsValue__core_37ee0ce0c4cd57d5___result__Result_____wasm_bindgen_4cfd459b66780f67___JsError___true_: (a: number, b: number, c: any) => [number, number];
250
- readonly wasm_bindgen_4cfd459b66780f67___convert__closures_____invoke___js_sys_167d7a02263935a1___Array______true_: (a: number, b: number, c: any) => void;
251
- readonly wasm_bindgen_4cfd459b66780f67___convert__closures_____invoke___js_sys_167d7a02263935a1___Array______true__2: (a: number, b: number, c: any) => void;
252
- readonly wasm_bindgen_4cfd459b66780f67___convert__closures_____invoke___js_sys_167d7a02263935a1___Array______true__4: (a: number, b: number, c: any) => void;
253
- readonly wasm_bindgen_4cfd459b66780f67___convert__closures_____invoke___js_sys_167d7a02263935a1___Array______true__5: (a: number, b: number, c: any) => void;
318
+ readonly wasm_bindgen_4cfd459b66780f67___convert__closures_____invoke___js_sys_167d7a02263935a1___Function_fn_wasm_bindgen_4cfd459b66780f67___JsValue_____wasm_bindgen_4cfd459b66780f67___sys__Undefined___js_sys_167d7a02263935a1___Function_fn_wasm_bindgen_4cfd459b66780f67___JsValue_____wasm_bindgen_4cfd459b66780f67___sys__Undefined_______true_: (a: number, b: number, c: any, d: any) => void;
319
+ readonly wasm_bindgen_4cfd459b66780f67___convert__closures_____invoke___wasm_bindgen_4cfd459b66780f67___JsValue______true_: (a: number, b: number, c: any) => void;
320
+ readonly wasm_bindgen_4cfd459b66780f67___convert__closures_____invoke___wasm_bindgen_4cfd459b66780f67___JsValue______true__2: (a: number, b: number, c: any) => void;
321
+ readonly wasm_bindgen_4cfd459b66780f67___convert__closures_____invoke___wasm_bindgen_4cfd459b66780f67___JsValue______true__3: (a: number, b: number, c: any) => void;
322
+ readonly wasm_bindgen_4cfd459b66780f67___convert__closures_____invoke___wasm_bindgen_4cfd459b66780f67___JsValue______true__5: (a: number, b: number, c: any) => void;
323
+ readonly wasm_bindgen_4cfd459b66780f67___convert__closures_____invoke___wasm_bindgen_4cfd459b66780f67___JsValue______true__6: (a: number, b: number, c: any) => void;
254
324
  readonly wasm_bindgen_4cfd459b66780f67___convert__closures_____invoke___u32______true_: (a: number, b: number, c: number) => void;
255
325
  readonly wasm_bindgen_4cfd459b66780f67___convert__closures_____invoke_______true_: (a: number, b: number) => void;
256
326
  readonly __wbindgen_exn_store: (a: number) => void;
@@ -261,6 +331,7 @@ export interface InitOutput {
261
331
  readonly __wbindgen_destroy_closure: (a: number, b: number) => void;
262
332
  readonly __externref_table_dealloc: (a: number) => void;
263
333
  readonly __wbindgen_free: (a: number, b: number, c: number) => void;
334
+ readonly __externref_drop_slice: (a: number, b: number) => void;
264
335
  readonly __wbindgen_start: () => void;
265
336
  }
266
337