@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/react/index.js CHANGED
@@ -149,6 +149,7 @@ export const OpengridGrid = component(
149
149
  columnMenu: "column-menu",
150
150
  selection: "selection",
151
151
  density: "density",
152
+ theme: "theme",
152
153
  },
153
154
  ["search", "facets", "toolbar", "columnMenu", "selection"],
154
155
  );
@@ -156,7 +157,7 @@ export const OpengridGrid = component(
156
157
  export const OpengridTable = component(
157
158
  "opengrid-table",
158
159
  "OpengridTable",
159
- { label: "label", datasource: "datasource", columns: "columns" },
160
+ { label: "label", datasource: "datasource", columns: "columns", theme: "theme" },
160
161
  [],
161
162
  );
162
163
 
@@ -169,6 +170,7 @@ export const OpengridPivot = component(
169
170
  rows: "rows",
170
171
  columns: "columns",
171
172
  values: "values",
173
+ theme: "theme",
172
174
  },
173
175
  [],
174
176
  );
@@ -16,6 +16,7 @@
16
16
  columnMenu = false,
17
17
  selection = false,
18
18
  density,
19
+ theme,
19
20
  view = $bindable(),
20
21
  element = $bindable(),
21
22
  ...rest
@@ -42,6 +43,7 @@
42
43
  "column-menu": flag(columnMenu),
43
44
  selection: flag(selection),
44
45
  density,
46
+ theme,
45
47
  }}
46
48
  bind:view
47
49
  bind:element
@@ -2,12 +2,12 @@
2
2
  <script>
3
3
  import Opengrid from "./Opengrid.svelte";
4
4
 
5
- let { label, datasource, rows, columns, values, view = $bindable(), element = $bindable(), ...rest } = $props();
5
+ let { label, datasource, rows, columns, values, theme, view = $bindable(), element = $bindable(), ...rest } = $props();
6
6
  </script>
7
7
 
8
8
  <Opengrid
9
9
  tag="opengrid-pivot"
10
- attributes={{ label, datasource, rows, columns, values }}
10
+ attributes={{ label, datasource, rows, columns, values, theme }}
11
11
  bind:view
12
12
  bind:element
13
13
  {...rest}
@@ -2,7 +2,7 @@
2
2
  <script>
3
3
  import Opengrid from "./Opengrid.svelte";
4
4
 
5
- let { label, datasource, columns, view = $bindable(), element = $bindable(), ...rest } = $props();
5
+ let { label, datasource, columns, theme, view = $bindable(), element = $bindable(), ...rest } = $props();
6
6
  </script>
7
7
 
8
- <Opengrid tag="opengrid-table" attributes={{ label, datasource, columns }} bind:view bind:element {...rest} />
8
+ <Opengrid tag="opengrid-table" attributes={{ label, datasource, columns, theme }} bind:view bind:element {...rest} />
package/svelte/index.d.ts CHANGED
@@ -19,6 +19,7 @@ import type {
19
19
  CellChangeDetail,
20
20
  ConnectOptions,
21
21
  Density,
22
+ Theme,
22
23
  Mode,
23
24
  SelectionChangeDetail,
24
25
  View,
@@ -57,12 +58,15 @@ export interface OpengridGridProps extends Options, ElementProps {
57
58
  columnMenu?: boolean;
58
59
  selection?: boolean;
59
60
  density?: Density;
61
+ /** One of the built-in looks; Base when absent. */
62
+ theme?: Theme;
60
63
  }
61
64
 
62
65
  export interface OpengridTableProps extends Options, ElementProps {
63
66
  label?: string;
64
67
  datasource?: string;
65
68
  columns?: string;
69
+ theme?: Theme;
66
70
  }
67
71
 
68
72
  export interface OpengridPivotProps extends Options, ElementProps {
@@ -74,6 +78,7 @@ export interface OpengridPivotProps extends Options, ElementProps {
74
78
  columns?: string;
75
79
  /** The measures as the contract's JSON. */
76
80
  values?: string;
81
+ theme?: Theme;
77
82
  }
78
83
 
79
84
  export const OpengridGrid: Component<OpengridGridProps, {}, "view" | "element">;
package/vue/index.d.ts CHANGED
@@ -12,6 +12,7 @@ import type {
12
12
  CellChangeDetail,
13
13
  ConnectOptions,
14
14
  Density,
15
+ Theme,
15
16
  Mode,
16
17
  SelectionChangeDetail,
17
18
  View,
@@ -48,12 +49,15 @@ export interface OpengridGridProps extends Options {
48
49
  columnMenu?: boolean;
49
50
  selection?: boolean;
50
51
  density?: Density;
52
+ /** One of the built-in looks; Base when absent. */
53
+ theme?: Theme;
51
54
  }
52
55
 
53
56
  export interface OpengridTableProps extends Options {
54
57
  label?: string;
55
58
  datasource?: string;
56
59
  columns?: string;
60
+ theme?: Theme;
57
61
  }
58
62
 
59
63
  export interface OpengridPivotProps extends Options {
@@ -65,6 +69,7 @@ export interface OpengridPivotProps extends Options {
65
69
  columns?: string;
66
70
  /** The measures as the contract's JSON. */
67
71
  values?: string;
72
+ theme?: Theme;
68
73
  }
69
74
 
70
75
  export const OpengridGrid: DefineSetupFnComponent<OpengridGridProps, OpengridEmits>;
package/vue/index.js CHANGED
@@ -141,6 +141,7 @@ export const OpengridGrid = component(
141
141
  columnMenu: "column-menu",
142
142
  selection: "selection",
143
143
  density: "density",
144
+ theme: "theme",
144
145
  },
145
146
  ["search", "facets", "toolbar", "columnMenu", "selection"],
146
147
  );
@@ -148,7 +149,7 @@ export const OpengridGrid = component(
148
149
  export const OpengridTable = component(
149
150
  "opengrid-table",
150
151
  "OpengridTable",
151
- { label: "label", datasource: "datasource", columns: "columns" },
152
+ { label: "label", datasource: "datasource", columns: "columns", theme: "theme" },
152
153
  [],
153
154
  );
154
155
 
@@ -161,6 +162,7 @@ export const OpengridPivot = component(
161
162
  rows: "rows",
162
163
  columns: "columns",
163
164
  values: "values",
165
+ theme: "theme",
164
166
  },
165
167
  [],
166
168
  );
package/worker.js CHANGED
@@ -15,9 +15,9 @@
15
15
  * query { type:"query", id, query } -> { id, result }
16
16
  *
17
17
  * Any request that throws answers `{ id, type:"error", message }`. The `bytes`
18
- * of `load` arrive as a transferable `ArrayBuffer`; the response strings are the
19
- * wire JSON of the engine (E6/E13), so nothing engine-specific is serialised
20
- * here.
18
+ * of `load` arrive as a transferable `ArrayBuffer`; a `result` is the engine's
19
+ * binary result form (E35, `execute_columns`) and travels back the same way —
20
+ * transferred, not copied. Nothing engine-specific is serialised here.
21
21
  */
22
22
 
23
23
  /** The single engine instance, created on `init` and reused for every query. */
@@ -41,7 +41,8 @@ self.onmessage = async ({ data }) => {
41
41
  break;
42
42
  }
43
43
  case "query": {
44
- self.postMessage({ id: data.id, result: engine.execute(data.query) });
44
+ const result = engine.execute_columns(data.query);
45
+ self.postMessage({ id: data.id, result }, [result.buffer]);
45
46
  break;
46
47
  }
47
48
  default: