@casoon/opengrid 0.2.0 → 0.4.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 +136 -0
- package/README.md +45 -3
- package/engine/opengrid_wasm.d.ts +15 -1
- package/engine/opengrid_wasm.js +45 -1
- package/engine/opengrid_wasm_bg.wasm +0 -0
- package/engine/opengrid_wasm_bg.wasm.d.ts +2 -0
- package/loader.d.ts +50 -4
- package/loader.js +76 -18
- package/package.json +1 -1
- package/pkg/opengrid_web_components.d.ts +8 -8
- package/pkg/opengrid_web_components.js +99 -50
- package/pkg/opengrid_web_components_bg.wasm +0 -0
- package/pkg/opengrid_web_components_bg.wasm.d.ts +6 -6
- package/react/index.d.ts +5 -0
- package/react/index.js +3 -1
- package/svelte/OpengridGrid.svelte +2 -0
- package/svelte/OpengridPivot.svelte +2 -2
- package/svelte/OpengridTable.svelte +2 -2
- package/svelte/index.d.ts +5 -0
- package/vue/index.d.ts +5 -0
- package/vue/index.js +3 -1
- package/worker.js +5 -4
- /package/pkg/snippets/{opengrid-web-core-13b0d2b2f5d74a24 → opengrid-web-core-cf7d8c1a6d317e41}/inline0.js +0 -0
- /package/pkg/snippets/{opengrid-web-core-13b0d2b2f5d74a24 → opengrid-web-core-cf7d8c1a6d317e41}/inline1.js +0 -0
package/loader.js
CHANGED
|
@@ -21,6 +21,12 @@
|
|
|
21
21
|
* createLocalProvider(engine) engine on the main thread
|
|
22
22
|
* createRestProvider({ url, source, token }) opengrid-server über HTTP (point 27)
|
|
23
23
|
*
|
|
24
|
+
* A provider's `execute` answers the result JSON **or** the binary result form
|
|
25
|
+
* (decision E35, a `Uint8Array`): the elements and `exportRows` read both. The
|
|
26
|
+
* tab and worker providers answer bytes — the worker hands them over without a
|
|
27
|
+
* copy — and the REST providers ask the server for them and fall back to JSON
|
|
28
|
+
* when it answers JSON.
|
|
29
|
+
*
|
|
24
30
|
* Every provider's `execute(queryJson, mode, { signal })` may take an
|
|
25
31
|
* `AbortSignal` as its third argument (point 84). The providers that talk HTTP
|
|
26
32
|
* hand it to `fetch`, so an aborted export leaves no request running; the tab
|
|
@@ -189,6 +195,8 @@ export function createWorkerProvider({
|
|
|
189
195
|
}
|
|
190
196
|
|
|
191
197
|
return {
|
|
198
|
+
/** Where the queries run; the grid names it in its footer (issue #33). */
|
|
199
|
+
kind: "worker",
|
|
192
200
|
/** Loads CSV bytes against a schema, starting the worker on first use. */
|
|
193
201
|
async load(name, bytes, schema) {
|
|
194
202
|
await start();
|
|
@@ -196,7 +204,7 @@ export function createWorkerProvider({
|
|
|
196
204
|
await request({ type: "load", name, bytes: buffer, schema }, [buffer]);
|
|
197
205
|
},
|
|
198
206
|
|
|
199
|
-
/** Runs a query JSON and resolves with the result
|
|
207
|
+
/** Runs a query JSON and resolves with the result in the binary form. */
|
|
200
208
|
async execute(queryJson) {
|
|
201
209
|
await start();
|
|
202
210
|
return request({ type: "query", query: queryJson });
|
|
@@ -230,6 +238,8 @@ export function createWorkerProvider({
|
|
|
230
238
|
*/
|
|
231
239
|
export function createLocalProvider(engine) {
|
|
232
240
|
return {
|
|
241
|
+
/** Where the queries run; the grid names it in its footer (issue #33). */
|
|
242
|
+
kind: "local",
|
|
233
243
|
async load(name, bytes, schema) {
|
|
234
244
|
engine.load_csv(
|
|
235
245
|
name,
|
|
@@ -238,7 +248,7 @@ export function createLocalProvider(engine) {
|
|
|
238
248
|
);
|
|
239
249
|
},
|
|
240
250
|
execute(queryJson) {
|
|
241
|
-
return engine.
|
|
251
|
+
return engine.execute_columns(queryJson);
|
|
242
252
|
},
|
|
243
253
|
terminate() {},
|
|
244
254
|
};
|
|
@@ -271,12 +281,16 @@ export function createLocalProvider(engine) {
|
|
|
271
281
|
export function createRestProvider({ url, source, token } = {}) {
|
|
272
282
|
const base = String(url).replace(/\/$/, "");
|
|
273
283
|
const endpoint = `${base}/query/${encodeURIComponent(source)}`;
|
|
274
|
-
const headers = { "Content-Type": "application/json" };
|
|
284
|
+
const headers = { "Content-Type": "application/json", Accept: ACCEPT_ANSWER };
|
|
275
285
|
if (token) {
|
|
276
286
|
headers.Authorization = `Bearer ${token}`;
|
|
277
287
|
}
|
|
288
|
+
// The export answers a file, CSV or JSON, whatever a query would.
|
|
289
|
+
const { Accept: _answer, ...exportHeaders } = headers;
|
|
278
290
|
|
|
279
291
|
return {
|
|
292
|
+
/** Where the queries run; the grid names it in its footer (issue #33). */
|
|
293
|
+
kind: "remote",
|
|
280
294
|
/**
|
|
281
295
|
* What the server says this source is: `{ name, schema, capabilities }`.
|
|
282
296
|
*
|
|
@@ -304,11 +318,7 @@ export function createRestProvider({ url, source, token } = {}) {
|
|
|
304
318
|
signal,
|
|
305
319
|
redirect: "error",
|
|
306
320
|
});
|
|
307
|
-
|
|
308
|
-
if (response.ok) {
|
|
309
|
-
return text;
|
|
310
|
-
}
|
|
311
|
-
throw refusal(text, response.status);
|
|
321
|
+
return answerOf(response);
|
|
312
322
|
},
|
|
313
323
|
|
|
314
324
|
/**
|
|
@@ -347,7 +357,7 @@ export function createRestProvider({ url, source, token } = {}) {
|
|
|
347
357
|
}
|
|
348
358
|
const response = await fetch(`${base}/export/${encodeURIComponent(source)}?${parameters}`, {
|
|
349
359
|
method: "POST",
|
|
350
|
-
headers,
|
|
360
|
+
headers: exportHeaders,
|
|
351
361
|
body: JSON.stringify(query),
|
|
352
362
|
signal,
|
|
353
363
|
redirect: "error",
|
|
@@ -382,6 +392,29 @@ export function createRestProvider({ url, source, token } = {}) {
|
|
|
382
392
|
};
|
|
383
393
|
}
|
|
384
394
|
|
|
395
|
+
/**
|
|
396
|
+
* What a provider asks the server for: the binary result form (E35), JSON as
|
|
397
|
+
* the fallback — a server that does not know the form answers JSON, and
|
|
398
|
+
* `answerOf` takes that too.
|
|
399
|
+
*/
|
|
400
|
+
const COLUMNS_TYPE = "application/vnd.opengrid.columns";
|
|
401
|
+
const ACCEPT_ANSWER = `${COLUMNS_TYPE}, application/json;q=0.9`;
|
|
402
|
+
|
|
403
|
+
/**
|
|
404
|
+
* A response as a provider's answer: the bytes of the binary form, the result
|
|
405
|
+
* JSON otherwise, the server's refusal as an `Error`.
|
|
406
|
+
*/
|
|
407
|
+
async function answerOf(response) {
|
|
408
|
+
if (!response.ok) {
|
|
409
|
+
throw refusal(await response.text(), response.status);
|
|
410
|
+
}
|
|
411
|
+
const type = response.headers.get("Content-Type") ?? "";
|
|
412
|
+
if (type.split(";")[0].trim().toLowerCase() === COLUMNS_TYPE) {
|
|
413
|
+
return new Uint8Array(await response.arrayBuffer());
|
|
414
|
+
}
|
|
415
|
+
return response.text();
|
|
416
|
+
}
|
|
417
|
+
|
|
385
418
|
/**
|
|
386
419
|
* A failed request as the `Error` it rejects with (issue #16). The message is
|
|
387
420
|
* the server's own sentence, or the status when the body is not the error
|
|
@@ -440,12 +473,14 @@ function coded(code, message) {
|
|
|
440
473
|
*/
|
|
441
474
|
export function createPivotProvider({ url, source, token } = {}) {
|
|
442
475
|
const endpoint = `${String(url).replace(/\/$/, "")}/pivot/${encodeURIComponent(source)}`;
|
|
443
|
-
const headers = { "Content-Type": "application/json" };
|
|
476
|
+
const headers = { "Content-Type": "application/json", Accept: ACCEPT_ANSWER };
|
|
444
477
|
if (token) {
|
|
445
478
|
headers.Authorization = `Bearer ${token}`;
|
|
446
479
|
}
|
|
447
480
|
|
|
448
481
|
return {
|
|
482
|
+
/** Where the queries run; the grid names it in its footer (issue #33). */
|
|
483
|
+
kind: "remote",
|
|
449
484
|
async execute(pivotJson, _mode, { signal } = {}) {
|
|
450
485
|
const response = await fetch(endpoint, {
|
|
451
486
|
method: "POST",
|
|
@@ -454,11 +489,7 @@ export function createPivotProvider({ url, source, token } = {}) {
|
|
|
454
489
|
signal,
|
|
455
490
|
redirect: "error",
|
|
456
491
|
});
|
|
457
|
-
|
|
458
|
-
if (response.ok) {
|
|
459
|
-
return text;
|
|
460
|
-
}
|
|
461
|
-
throw refusal(text, response.status);
|
|
492
|
+
return answerOf(response);
|
|
462
493
|
},
|
|
463
494
|
};
|
|
464
495
|
}
|
|
@@ -493,6 +524,8 @@ export function createPivotProvider({ url, source, token } = {}) {
|
|
|
493
524
|
*/
|
|
494
525
|
export function createHybridProvider({ remote, planner, mode = "auto", onPlan } = {}) {
|
|
495
526
|
return {
|
|
527
|
+
/** Where the queries run; the grid names it in its footer (issue #33). */
|
|
528
|
+
kind: "hybrid",
|
|
496
529
|
async execute(queryJson, elementMode, { signal } = {}) {
|
|
497
530
|
// The element's attribute wins when it has one: the page sets the default,
|
|
498
531
|
// the markup can override it per grid.
|
|
@@ -507,7 +540,10 @@ export function createHybridProvider({ remote, planner, mode = "auto", onPlan }
|
|
|
507
540
|
if (!plan.client) {
|
|
508
541
|
return partial;
|
|
509
542
|
}
|
|
510
|
-
|
|
543
|
+
// The engine finishes in the form the source answered in.
|
|
544
|
+
return typeof partial === "string"
|
|
545
|
+
? planner.finish(JSON.stringify(plan.client), partial)
|
|
546
|
+
: planner.finish_columns(JSON.stringify(plan.client), partial);
|
|
511
547
|
},
|
|
512
548
|
};
|
|
513
549
|
}
|
|
@@ -678,8 +714,8 @@ export async function exportRows(provider, query, options = {}) {
|
|
|
678
714
|
const limit = total === undefined ? chunkSize : Math.min(chunkSize, total - rows);
|
|
679
715
|
const piece = JSON.stringify({ ...query, sort, offset: rows, limit });
|
|
680
716
|
const answer = await unlessAborted(ask(provider, piece, signal), signal);
|
|
681
|
-
const result =
|
|
682
|
-
const count = result.
|
|
717
|
+
const result = countsOf(answer);
|
|
718
|
+
const count = result.rows;
|
|
683
719
|
const first = total === undefined;
|
|
684
720
|
if (first) {
|
|
685
721
|
total = result.total_count;
|
|
@@ -722,6 +758,28 @@ export async function exportRows(provider, query, options = {}) {
|
|
|
722
758
|
});
|
|
723
759
|
}
|
|
724
760
|
|
|
761
|
+
/**
|
|
762
|
+
* `total_count` and the rows of an answer, whichever form it came in: from the
|
|
763
|
+
* JSON, or from the header of the binary form (E35) — `total_count` at byte 8,
|
|
764
|
+
* the row count at byte 16, both little-endian `u64`.
|
|
765
|
+
*/
|
|
766
|
+
function countsOf(answer) {
|
|
767
|
+
if (typeof answer === "string") {
|
|
768
|
+
const result = JSON.parse(answer);
|
|
769
|
+
return { total_count: result.total_count, rows: result.columns[0]?.values.length ?? 0 };
|
|
770
|
+
}
|
|
771
|
+
const bytes = answer instanceof ArrayBuffer ? new Uint8Array(answer) : answer;
|
|
772
|
+
if (bytes.byteLength < 24) {
|
|
773
|
+
throw new TypeError("exportRows: the provider answered neither JSON nor the binary form");
|
|
774
|
+
}
|
|
775
|
+
const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
|
|
776
|
+
const columns = view.getUint32(24, true);
|
|
777
|
+
return {
|
|
778
|
+
total_count: Number(view.getBigUint64(8, true)),
|
|
779
|
+
rows: columns === 0 ? 0 : Number(view.getBigUint64(16, true)),
|
|
780
|
+
};
|
|
781
|
+
}
|
|
782
|
+
|
|
725
783
|
/** One piece from the provider; a synchronous throw becomes a rejection. */
|
|
726
784
|
async function ask(provider, queryJson, signal) {
|
|
727
785
|
return provider.execute(queryJson, "", { signal });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@casoon/opengrid",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.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": [
|
|
@@ -6,14 +6,14 @@
|
|
|
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(
|
|
9
|
+
export function export_csv(answer: any, options: any, header: boolean): string;
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* One piece of a JSON array: the rows as objects, joined by commas. `first`:
|
|
13
13
|
* no row has been written yet (not "the first piece" — after an empty first
|
|
14
14
|
* piece it is still true), so no comma leads. `loader.js` writes the brackets.
|
|
15
15
|
*/
|
|
16
|
-
export function export_json(
|
|
16
|
+
export function export_json(answer: any, first: boolean): string;
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
19
|
* The pivot as it is shown, as CSV (issue #3).
|
|
@@ -169,8 +169,8 @@ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembl
|
|
|
169
169
|
|
|
170
170
|
export interface InitOutput {
|
|
171
171
|
readonly memory: WebAssembly.Memory;
|
|
172
|
-
readonly export_csv: (a:
|
|
173
|
-
readonly export_json: (a:
|
|
172
|
+
readonly export_csv: (a: any, b: any, c: number) => [number, number, number, number];
|
|
173
|
+
readonly export_json: (a: any, b: number) => [number, number, number, number];
|
|
174
174
|
readonly get_pivot: (a: any, b: any) => [number, number, number];
|
|
175
175
|
readonly get_query: (a: any) => any;
|
|
176
176
|
readonly get_view: (a: any) => any;
|
|
@@ -181,11 +181,11 @@ export interface InitOutput {
|
|
|
181
181
|
readonly set_provider: (a: any, b: any) => void;
|
|
182
182
|
readonly set_texts: (a: any, b: any) => void;
|
|
183
183
|
readonly set_view: (a: any, b: any) => void;
|
|
184
|
-
readonly
|
|
184
|
+
readonly wasm_bindgen_66404d18cc2edcc2___convert__closures_____invoke___web_sys_c43fef36ea7eb37c___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;
|
|
185
185
|
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];
|
|
186
|
-
readonly
|
|
187
|
-
readonly
|
|
188
|
-
readonly
|
|
186
|
+
readonly wasm_bindgen_66404d18cc2edcc2___convert__closures_____invoke___web_sys_c43fef36ea7eb37c___features__gen_HtmlElement__HtmlElement______true_: (a: number, b: number, c: any) => void;
|
|
187
|
+
readonly wasm_bindgen_66404d18cc2edcc2___convert__closures_____invoke___web_sys_c43fef36ea7eb37c___features__gen_HtmlElement__HtmlElement______true__3: (a: number, b: number, c: any) => void;
|
|
188
|
+
readonly wasm_bindgen_66404d18cc2edcc2___convert__closures_____invoke___web_sys_c43fef36ea7eb37c___features__gen_HtmlElement__HtmlElement______true__4: (a: number, b: number, c: any) => void;
|
|
189
189
|
readonly wasm_bindgen_66404d18cc2edcc2___convert__closures_____invoke___u32______true_: (a: number, b: number, c: number) => void;
|
|
190
190
|
readonly wasm_bindgen_66404d18cc2edcc2___convert__closures_____invoke_______true_: (a: number, b: number) => void;
|
|
191
191
|
readonly __wbindgen_malloc: (a: number, b: number) => number;
|
|
@@ -1,37 +1,35 @@
|
|
|
1
1
|
/* @ts-self-types="./opengrid_web_components.d.ts" */
|
|
2
|
-
import { __opengrid_define_element } from './snippets/opengrid-web-core-
|
|
3
|
-
import * as import1 from "./snippets/opengrid-web-core-
|
|
4
|
-
import * as import2 from "./snippets/opengrid-web-core-
|
|
5
|
-
import * as import3 from "./snippets/opengrid-web-core-
|
|
2
|
+
import { __opengrid_define_element } from './snippets/opengrid-web-core-cf7d8c1a6d317e41/inline1.js';
|
|
3
|
+
import * as import1 from "./snippets/opengrid-web-core-cf7d8c1a6d317e41/inline0.js"
|
|
4
|
+
import * as import2 from "./snippets/opengrid-web-core-cf7d8c1a6d317e41/inline0.js"
|
|
5
|
+
import * as import3 from "./snippets/opengrid-web-core-cf7d8c1a6d317e41/inline0.js"
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* One piece of a CSV: with `header`, the header line (and the byte order
|
|
10
10
|
* mark) first. `options`: `{ delimiter, bom, protectFormulas, null }`, each
|
|
11
11
|
* optional (docs/guides/export.md, point 87).
|
|
12
|
-
* @param {
|
|
12
|
+
* @param {any} answer
|
|
13
13
|
* @param {any} options
|
|
14
14
|
* @param {boolean} header
|
|
15
15
|
* @returns {string}
|
|
16
16
|
*/
|
|
17
|
-
export function export_csv(
|
|
18
|
-
let
|
|
19
|
-
let
|
|
17
|
+
export function export_csv(answer, options, header) {
|
|
18
|
+
let deferred2_0;
|
|
19
|
+
let deferred2_1;
|
|
20
20
|
try {
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
var ptr2 = ret[0];
|
|
25
|
-
var len2 = ret[1];
|
|
21
|
+
const ret = wasm.export_csv(answer, options, header);
|
|
22
|
+
var ptr1 = ret[0];
|
|
23
|
+
var len1 = ret[1];
|
|
26
24
|
if (ret[3]) {
|
|
27
|
-
|
|
25
|
+
ptr1 = 0; len1 = 0;
|
|
28
26
|
throw takeFromExternrefTable0(ret[2]);
|
|
29
27
|
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
return getStringFromWasm0(
|
|
28
|
+
deferred2_0 = ptr1;
|
|
29
|
+
deferred2_1 = len1;
|
|
30
|
+
return getStringFromWasm0(ptr1, len1);
|
|
33
31
|
} finally {
|
|
34
|
-
wasm.__wbindgen_free(
|
|
32
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
35
33
|
}
|
|
36
34
|
}
|
|
37
35
|
|
|
@@ -39,28 +37,26 @@ export function export_csv(result_json, options, header) {
|
|
|
39
37
|
* One piece of a JSON array: the rows as objects, joined by commas. `first`:
|
|
40
38
|
* no row has been written yet (not "the first piece" — after an empty first
|
|
41
39
|
* piece it is still true), so no comma leads. `loader.js` writes the brackets.
|
|
42
|
-
* @param {
|
|
40
|
+
* @param {any} answer
|
|
43
41
|
* @param {boolean} first
|
|
44
42
|
* @returns {string}
|
|
45
43
|
*/
|
|
46
|
-
export function export_json(
|
|
47
|
-
let
|
|
48
|
-
let
|
|
44
|
+
export function export_json(answer, first) {
|
|
45
|
+
let deferred2_0;
|
|
46
|
+
let deferred2_1;
|
|
49
47
|
try {
|
|
50
|
-
const
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
var ptr2 = ret[0];
|
|
54
|
-
var len2 = ret[1];
|
|
48
|
+
const ret = wasm.export_json(answer, first);
|
|
49
|
+
var ptr1 = ret[0];
|
|
50
|
+
var len1 = ret[1];
|
|
55
51
|
if (ret[3]) {
|
|
56
|
-
|
|
52
|
+
ptr1 = 0; len1 = 0;
|
|
57
53
|
throw takeFromExternrefTable0(ret[2]);
|
|
58
54
|
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
return getStringFromWasm0(
|
|
55
|
+
deferred2_0 = ptr1;
|
|
56
|
+
deferred2_1 = len1;
|
|
57
|
+
return getStringFromWasm0(ptr1, len1);
|
|
62
58
|
} finally {
|
|
63
|
-
wasm.__wbindgen_free(
|
|
59
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
64
60
|
}
|
|
65
61
|
}
|
|
66
62
|
|
|
@@ -270,7 +266,7 @@ function __wbg_get_imports() {
|
|
|
270
266
|
const ret = Error(getStringFromWasm0(arg0, arg1));
|
|
271
267
|
return ret;
|
|
272
268
|
},
|
|
273
|
-
|
|
269
|
+
__wbg___opengrid_define_element_9fe4767b320e082c: function(arg0, arg1, arg2, arg3, arg4, arg5) {
|
|
274
270
|
__opengrid_define_element(getStringFromWasm0(arg0, arg1), arg2, arg3, arg4, arg5);
|
|
275
271
|
},
|
|
276
272
|
__wbg___wbindgen_boolean_get_fa956cfa2d1bd751: function(arg0) {
|
|
@@ -471,6 +467,16 @@ function __wbg_get_imports() {
|
|
|
471
467
|
const ret = arg0.innerWidth;
|
|
472
468
|
return ret;
|
|
473
469
|
}, arguments); },
|
|
470
|
+
__wbg_instanceof_ArrayBuffer_4480b9e0068a8adb: function(arg0) {
|
|
471
|
+
let result;
|
|
472
|
+
try {
|
|
473
|
+
result = arg0 instanceof ArrayBuffer;
|
|
474
|
+
} catch (_) {
|
|
475
|
+
result = false;
|
|
476
|
+
}
|
|
477
|
+
const ret = result;
|
|
478
|
+
return ret;
|
|
479
|
+
},
|
|
474
480
|
__wbg_instanceof_Element_beebfaab75d12d9d: function(arg0) {
|
|
475
481
|
let result;
|
|
476
482
|
try {
|
|
@@ -541,6 +547,16 @@ function __wbg_get_imports() {
|
|
|
541
547
|
const ret = result;
|
|
542
548
|
return ret;
|
|
543
549
|
},
|
|
550
|
+
__wbg_instanceof_Uint8Array_309b927aaf7a3fc7: function(arg0) {
|
|
551
|
+
let result;
|
|
552
|
+
try {
|
|
553
|
+
result = arg0 instanceof Uint8Array;
|
|
554
|
+
} catch (_) {
|
|
555
|
+
result = false;
|
|
556
|
+
}
|
|
557
|
+
const ret = result;
|
|
558
|
+
return ret;
|
|
559
|
+
},
|
|
544
560
|
__wbg_instanceof_Window_05ba1ee4f6781663: function(arg0) {
|
|
545
561
|
let result;
|
|
546
562
|
try {
|
|
@@ -586,6 +602,10 @@ function __wbg_get_imports() {
|
|
|
586
602
|
const ret = arg0.left;
|
|
587
603
|
return ret;
|
|
588
604
|
},
|
|
605
|
+
__wbg_length_1f0964f4a5e2c6d8: function(arg0) {
|
|
606
|
+
const ret = arg0.length;
|
|
607
|
+
return ret;
|
|
608
|
+
},
|
|
589
609
|
__wbg_length_370319915dc99107: function(arg0) {
|
|
590
610
|
const ret = arg0.length;
|
|
591
611
|
return ret;
|
|
@@ -606,10 +626,18 @@ function __wbg_get_imports() {
|
|
|
606
626
|
const ret = new Array();
|
|
607
627
|
return ret;
|
|
608
628
|
},
|
|
629
|
+
__wbg_new_cd45aabdf6073e84: function(arg0) {
|
|
630
|
+
const ret = new Uint8Array(arg0);
|
|
631
|
+
return ret;
|
|
632
|
+
},
|
|
609
633
|
__wbg_new_da52cf8fe3429cb2: function() {
|
|
610
634
|
const ret = new Object();
|
|
611
635
|
return ret;
|
|
612
636
|
},
|
|
637
|
+
__wbg_new_ff9311947c25f0ab: function() { return handleError(function () {
|
|
638
|
+
const ret = new CSSStyleSheet();
|
|
639
|
+
return ret;
|
|
640
|
+
}, arguments); },
|
|
613
641
|
__wbg_new_with_args_200d82645b6544eb: function(arg0, arg1, arg2, arg3) {
|
|
614
642
|
const ret = new Function(getStringFromWasm0(arg0, arg1), getStringFromWasm0(arg2, arg3));
|
|
615
643
|
return ret;
|
|
@@ -618,6 +646,10 @@ function __wbg_get_imports() {
|
|
|
618
646
|
const ret = new CustomEvent(getStringFromWasm0(arg0, arg1), arg2);
|
|
619
647
|
return ret;
|
|
620
648
|
}, arguments); },
|
|
649
|
+
__wbg_of_85f52f8b6491a7ca: function(arg0) {
|
|
650
|
+
const ret = Array.of(arg0);
|
|
651
|
+
return ret;
|
|
652
|
+
},
|
|
621
653
|
__wbg_ownerDocument_5a7a5473f8709b3e: function(arg0) {
|
|
622
654
|
const ret = arg0.ownerDocument;
|
|
623
655
|
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
@@ -629,6 +661,9 @@ function __wbg_get_imports() {
|
|
|
629
661
|
__wbg_preventDefault_b64888c857500682: function(arg0) {
|
|
630
662
|
arg0.preventDefault();
|
|
631
663
|
},
|
|
664
|
+
__wbg_prototypesetcall_4770620bbe4688a0: function(arg0, arg1, arg2) {
|
|
665
|
+
Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
|
|
666
|
+
},
|
|
632
667
|
__wbg_push_d2ae3af0c1217ae6: function(arg0, arg1) {
|
|
633
668
|
const ret = arg0.push(arg1);
|
|
634
669
|
return ret;
|
|
@@ -670,6 +705,9 @@ function __wbg_get_imports() {
|
|
|
670
705
|
__wbg_remove_ce1b54059317fe8a: function(arg0) {
|
|
671
706
|
arg0.remove();
|
|
672
707
|
},
|
|
708
|
+
__wbg_replaceSync_4449064c4c827515: function() { return handleError(function (arg0, arg1, arg2) {
|
|
709
|
+
arg0.replaceSync(getStringFromWasm0(arg1, arg2));
|
|
710
|
+
}, arguments); },
|
|
673
711
|
__wbg_requestAnimationFrame_1a85deeab66448c2: function() { return handleError(function (arg0, arg1) {
|
|
674
712
|
const ret = arg0.requestAnimationFrame(arg1);
|
|
675
713
|
return ret;
|
|
@@ -703,6 +741,9 @@ function __wbg_get_imports() {
|
|
|
703
741
|
const ret = Reflect.set(arg0, arg1, arg2);
|
|
704
742
|
return ret;
|
|
705
743
|
}, arguments); },
|
|
744
|
+
__wbg_set_adoptedStyleSheets_5f0e5fd87d2f8755: function(arg0, arg1) {
|
|
745
|
+
arg0.adoptedStyleSheets = arg1;
|
|
746
|
+
},
|
|
706
747
|
__wbg_set_block_8135b3acafa1ca88: function(arg0, arg1) {
|
|
707
748
|
arg0.block = __wbindgen_enum_ScrollLogicalPosition[arg1];
|
|
708
749
|
},
|
|
@@ -742,6 +783,9 @@ function __wbg_get_imports() {
|
|
|
742
783
|
__wbg_set_textContent_54dcad83ae15772d: function(arg0, arg1, arg2) {
|
|
743
784
|
arg0.textContent = arg1 === 0 ? undefined : getStringFromWasm0(arg1, arg2);
|
|
744
785
|
},
|
|
786
|
+
__wbg_set_type_d2a9a3c584ce2f9a: function(arg0, arg1, arg2) {
|
|
787
|
+
arg0.type = getStringFromWasm0(arg1, arg2);
|
|
788
|
+
},
|
|
745
789
|
__wbg_set_value_e0caa78ebf9917a8: function(arg0, arg1, arg2) {
|
|
746
790
|
arg0.value = getStringFromWasm0(arg1, arg2);
|
|
747
791
|
},
|
|
@@ -839,32 +883,32 @@ function __wbg_get_imports() {
|
|
|
839
883
|
return ret;
|
|
840
884
|
},
|
|
841
885
|
__wbindgen_cast_0000000000000001: function(arg0, arg1) {
|
|
842
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx:
|
|
886
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 201, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
843
887
|
const ret = makeMutClosure(arg0, arg1, wasm_bindgen_66404d18cc2edcc2___convert__closures_____invoke___wasm_bindgen_66404d18cc2edcc2___JsValue__core_ed718c3d60ebd546___result__Result_____wasm_bindgen_66404d18cc2edcc2___JsError___true_);
|
|
844
888
|
return ret;
|
|
845
889
|
},
|
|
846
890
|
__wbindgen_cast_0000000000000002: function(arg0, arg1) {
|
|
847
891
|
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("Event")], shim_idx: 17, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
848
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
892
|
+
const ret = makeMutClosure(arg0, arg1, wasm_bindgen_66404d18cc2edcc2___convert__closures_____invoke___web_sys_c43fef36ea7eb37c___features__gen_HtmlElement__HtmlElement______true_);
|
|
849
893
|
return ret;
|
|
850
894
|
},
|
|
851
895
|
__wbindgen_cast_0000000000000003: function(arg0, arg1) {
|
|
852
896
|
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("HTMLElement"), String, Option(String), Option(String)], shim_idx: 18, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
853
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
897
|
+
const ret = makeMutClosure(arg0, arg1, wasm_bindgen_66404d18cc2edcc2___convert__closures_____invoke___web_sys_c43fef36ea7eb37c___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_);
|
|
854
898
|
return ret;
|
|
855
899
|
},
|
|
856
900
|
__wbindgen_cast_0000000000000004: function(arg0, arg1) {
|
|
857
901
|
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("HTMLElement")], shim_idx: 17, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
858
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
902
|
+
const ret = makeMutClosure(arg0, arg1, wasm_bindgen_66404d18cc2edcc2___convert__closures_____invoke___web_sys_c43fef36ea7eb37c___features__gen_HtmlElement__HtmlElement______true__3);
|
|
859
903
|
return ret;
|
|
860
904
|
},
|
|
861
905
|
__wbindgen_cast_0000000000000005: function(arg0, arg1) {
|
|
862
906
|
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("KeyboardEvent")], shim_idx: 17, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
863
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
907
|
+
const ret = makeMutClosure(arg0, arg1, wasm_bindgen_66404d18cc2edcc2___convert__closures_____invoke___web_sys_c43fef36ea7eb37c___features__gen_HtmlElement__HtmlElement______true__4);
|
|
864
908
|
return ret;
|
|
865
909
|
},
|
|
866
910
|
__wbindgen_cast_0000000000000006: function(arg0, arg1) {
|
|
867
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [U32], shim_idx:
|
|
911
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [U32], shim_idx: 188, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
868
912
|
const ret = makeMutClosure(arg0, arg1, wasm_bindgen_66404d18cc2edcc2___convert__closures_____invoke___u32______true_);
|
|
869
913
|
return ret;
|
|
870
914
|
},
|
|
@@ -896,9 +940,9 @@ function __wbg_get_imports() {
|
|
|
896
940
|
return {
|
|
897
941
|
__proto__: null,
|
|
898
942
|
"./opengrid_web_components_bg.js": import0,
|
|
899
|
-
"./snippets/opengrid-web-core-
|
|
900
|
-
"./snippets/opengrid-web-core-
|
|
901
|
-
"./snippets/opengrid-web-core-
|
|
943
|
+
"./snippets/opengrid-web-core-cf7d8c1a6d317e41/inline0.js": import1,
|
|
944
|
+
"./snippets/opengrid-web-core-cf7d8c1a6d317e41/inline0.js": import2,
|
|
945
|
+
"./snippets/opengrid-web-core-cf7d8c1a6d317e41/inline0.js": import3,
|
|
902
946
|
};
|
|
903
947
|
}
|
|
904
948
|
|
|
@@ -906,16 +950,16 @@ function wasm_bindgen_66404d18cc2edcc2___convert__closures_____invoke_______true
|
|
|
906
950
|
wasm.wasm_bindgen_66404d18cc2edcc2___convert__closures_____invoke_______true_(arg0, arg1);
|
|
907
951
|
}
|
|
908
952
|
|
|
909
|
-
function
|
|
910
|
-
wasm.
|
|
953
|
+
function wasm_bindgen_66404d18cc2edcc2___convert__closures_____invoke___web_sys_c43fef36ea7eb37c___features__gen_HtmlElement__HtmlElement______true_(arg0, arg1, arg2) {
|
|
954
|
+
wasm.wasm_bindgen_66404d18cc2edcc2___convert__closures_____invoke___web_sys_c43fef36ea7eb37c___features__gen_HtmlElement__HtmlElement______true_(arg0, arg1, arg2);
|
|
911
955
|
}
|
|
912
956
|
|
|
913
|
-
function
|
|
914
|
-
wasm.
|
|
957
|
+
function wasm_bindgen_66404d18cc2edcc2___convert__closures_____invoke___web_sys_c43fef36ea7eb37c___features__gen_HtmlElement__HtmlElement______true__3(arg0, arg1, arg2) {
|
|
958
|
+
wasm.wasm_bindgen_66404d18cc2edcc2___convert__closures_____invoke___web_sys_c43fef36ea7eb37c___features__gen_HtmlElement__HtmlElement______true__3(arg0, arg1, arg2);
|
|
915
959
|
}
|
|
916
960
|
|
|
917
|
-
function
|
|
918
|
-
wasm.
|
|
961
|
+
function wasm_bindgen_66404d18cc2edcc2___convert__closures_____invoke___web_sys_c43fef36ea7eb37c___features__gen_HtmlElement__HtmlElement______true__4(arg0, arg1, arg2) {
|
|
962
|
+
wasm.wasm_bindgen_66404d18cc2edcc2___convert__closures_____invoke___web_sys_c43fef36ea7eb37c___features__gen_HtmlElement__HtmlElement______true__4(arg0, arg1, arg2);
|
|
919
963
|
}
|
|
920
964
|
|
|
921
965
|
function wasm_bindgen_66404d18cc2edcc2___convert__closures_____invoke___wasm_bindgen_66404d18cc2edcc2___JsValue__core_ed718c3d60ebd546___result__Result_____wasm_bindgen_66404d18cc2edcc2___JsError___true_(arg0, arg1, arg2) {
|
|
@@ -925,14 +969,14 @@ function wasm_bindgen_66404d18cc2edcc2___convert__closures_____invoke___wasm_bin
|
|
|
925
969
|
}
|
|
926
970
|
}
|
|
927
971
|
|
|
928
|
-
function
|
|
972
|
+
function wasm_bindgen_66404d18cc2edcc2___convert__closures_____invoke___web_sys_c43fef36ea7eb37c___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) {
|
|
929
973
|
const ptr0 = passStringToWasm0(arg3, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
930
974
|
const len0 = WASM_VECTOR_LEN;
|
|
931
975
|
var ptr1 = isLikeNone(arg4) ? 0 : passStringToWasm0(arg4, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
932
976
|
var len1 = WASM_VECTOR_LEN;
|
|
933
977
|
var ptr2 = isLikeNone(arg5) ? 0 : passStringToWasm0(arg5, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
934
978
|
var len2 = WASM_VECTOR_LEN;
|
|
935
|
-
wasm.
|
|
979
|
+
wasm.wasm_bindgen_66404d18cc2edcc2___convert__closures_____invoke___web_sys_c43fef36ea7eb37c___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);
|
|
936
980
|
}
|
|
937
981
|
|
|
938
982
|
function wasm_bindgen_66404d18cc2edcc2___convert__closures_____invoke___u32______true_(arg0, arg1, arg2) {
|
|
@@ -1020,6 +1064,11 @@ function debugString(val) {
|
|
|
1020
1064
|
return className;
|
|
1021
1065
|
}
|
|
1022
1066
|
|
|
1067
|
+
function getArrayU8FromWasm0(ptr, len) {
|
|
1068
|
+
ptr = ptr >>> 0;
|
|
1069
|
+
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
1070
|
+
}
|
|
1071
|
+
|
|
1023
1072
|
let cachedDataViewMemory0 = null;
|
|
1024
1073
|
function getDataViewMemory0() {
|
|
1025
1074
|
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
|
|
Binary file
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
export const memory: WebAssembly.Memory;
|
|
4
|
-
export const export_csv: (a:
|
|
5
|
-
export const export_json: (a:
|
|
4
|
+
export const export_csv: (a: any, b: any, c: number) => [number, number, number, number];
|
|
5
|
+
export const export_json: (a: any, b: number) => [number, number, number, number];
|
|
6
6
|
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;
|
|
@@ -13,11 +13,11 @@ 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
15
|
export const set_view: (a: any, b: any) => void;
|
|
16
|
-
export const
|
|
16
|
+
export const wasm_bindgen_66404d18cc2edcc2___convert__closures_____invoke___web_sys_c43fef36ea7eb37c___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
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
|
|
19
|
-
export const
|
|
20
|
-
export const
|
|
18
|
+
export const wasm_bindgen_66404d18cc2edcc2___convert__closures_____invoke___web_sys_c43fef36ea7eb37c___features__gen_HtmlElement__HtmlElement______true_: (a: number, b: number, c: any) => void;
|
|
19
|
+
export const wasm_bindgen_66404d18cc2edcc2___convert__closures_____invoke___web_sys_c43fef36ea7eb37c___features__gen_HtmlElement__HtmlElement______true__3: (a: number, b: number, c: any) => void;
|
|
20
|
+
export const wasm_bindgen_66404d18cc2edcc2___convert__closures_____invoke___web_sys_c43fef36ea7eb37c___features__gen_HtmlElement__HtmlElement______true__4: (a: number, b: number, c: any) => void;
|
|
21
21
|
export const wasm_bindgen_66404d18cc2edcc2___convert__closures_____invoke___u32______true_: (a: number, b: number, c: number) => void;
|
|
22
22
|
export const wasm_bindgen_66404d18cc2edcc2___convert__closures_____invoke_______true_: (a: number, b: number) => void;
|
|
23
23
|
export const __wbindgen_malloc: (a: number, b: number) => number;
|
package/react/index.d.ts
CHANGED
|
@@ -22,6 +22,7 @@ import type { ForwardRefExoticComponent, HTMLAttributes, RefAttributes } from "r
|
|
|
22
22
|
import type {
|
|
23
23
|
ConnectOptions,
|
|
24
24
|
Density,
|
|
25
|
+
Theme,
|
|
25
26
|
Mode,
|
|
26
27
|
OpengridGridElement,
|
|
27
28
|
OpengridPivotElement,
|
|
@@ -54,12 +55,15 @@ export interface OpengridGridProps extends ConnectOptions, ElementProps {
|
|
|
54
55
|
columnMenu?: boolean;
|
|
55
56
|
selection?: boolean;
|
|
56
57
|
density?: Density;
|
|
58
|
+
/** One of the built-in looks; Base when absent. */
|
|
59
|
+
theme?: Theme;
|
|
57
60
|
}
|
|
58
61
|
|
|
59
62
|
export interface OpengridTableProps extends ConnectOptions, ElementProps {
|
|
60
63
|
label?: string;
|
|
61
64
|
datasource?: string;
|
|
62
65
|
columns?: string;
|
|
66
|
+
theme?: Theme;
|
|
63
67
|
}
|
|
64
68
|
|
|
65
69
|
export interface OpengridPivotProps extends ConnectOptions, ElementProps {
|
|
@@ -71,6 +75,7 @@ export interface OpengridPivotProps extends ConnectOptions, ElementProps {
|
|
|
71
75
|
columns?: string;
|
|
72
76
|
/** The measures as the contract's JSON. */
|
|
73
77
|
values?: string;
|
|
78
|
+
theme?: Theme;
|
|
74
79
|
}
|
|
75
80
|
|
|
76
81
|
export const OpengridGrid: ForwardRefExoticComponent<
|