vastgrid 0.1.1 → 0.2.1
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/README.md +175 -13
- package/dist/canvas/geometry.d.ts +92 -0
- package/dist/canvas/geometry.d.ts.map +1 -0
- package/dist/canvas/geometry.js +197 -0
- package/dist/canvas/geometry.js.map +1 -0
- package/dist/canvas/grid-canvas.d.ts +161 -0
- package/dist/canvas/grid-canvas.d.ts.map +1 -0
- package/dist/canvas/grid-canvas.js +1146 -0
- package/dist/canvas/grid-canvas.js.map +1 -0
- package/dist/canvas/hooks.d.ts +61 -0
- package/dist/canvas/hooks.d.ts.map +1 -0
- package/dist/canvas/hooks.js +2 -0
- package/dist/canvas/hooks.js.map +1 -0
- package/dist/canvas/keys.d.ts +26 -0
- package/dist/canvas/keys.d.ts.map +1 -0
- package/dist/canvas/keys.js +133 -0
- package/dist/canvas/keys.js.map +1 -0
- package/dist/canvas/layout.d.ts +26 -0
- package/dist/canvas/layout.d.ts.map +1 -0
- package/dist/canvas/layout.js +73 -0
- package/dist/canvas/layout.js.map +1 -0
- package/dist/canvas/scroll.d.ts +31 -0
- package/dist/canvas/scroll.d.ts.map +1 -0
- package/dist/canvas/scroll.js +111 -0
- package/dist/canvas/scroll.js.map +1 -0
- package/dist/canvas/text.d.ts +23 -0
- package/dist/canvas/text.d.ts.map +1 -0
- package/dist/canvas/text.js +142 -0
- package/dist/canvas/text.js.map +1 -0
- package/dist/{theme.d.ts → canvas/theme.d.ts} +8 -0
- package/dist/canvas/theme.d.ts.map +1 -0
- package/dist/canvas/theme.js +62 -0
- package/dist/canvas/theme.js.map +1 -0
- package/dist/core/cache.d.ts +48 -0
- package/dist/core/cache.d.ts.map +1 -0
- package/dist/core/cache.js +222 -0
- package/dist/core/cache.js.map +1 -0
- package/dist/core/checked.d.ts +20 -0
- package/dist/core/checked.d.ts.map +1 -0
- package/dist/core/checked.js +61 -0
- package/dist/core/checked.js.map +1 -0
- package/dist/core/client.d.ts +33 -0
- package/dist/core/client.d.ts.map +1 -0
- package/dist/core/client.js +103 -0
- package/dist/core/client.js.map +1 -0
- package/dist/core/conditions.d.ts +48 -0
- package/dist/core/conditions.d.ts.map +1 -0
- package/dist/core/conditions.js +105 -0
- package/dist/core/conditions.js.map +1 -0
- package/dist/core/evaluate.d.ts +20 -0
- package/dist/core/evaluate.d.ts.map +1 -0
- package/dist/core/evaluate.js +210 -0
- package/dist/core/evaluate.js.map +1 -0
- package/dist/core/filters.d.ts +51 -0
- package/dist/core/filters.d.ts.map +1 -0
- package/dist/core/filters.js +303 -0
- package/dist/core/filters.js.map +1 -0
- package/dist/core/format.d.ts +14 -0
- package/dist/core/format.d.ts.map +1 -0
- package/dist/core/format.js +303 -0
- package/dist/core/format.js.map +1 -0
- package/dist/core/measures.d.ts +26 -0
- package/dist/core/measures.d.ts.map +1 -0
- package/dist/core/measures.js +105 -0
- package/dist/core/measures.js.map +1 -0
- package/dist/core/request-ids.d.ts +20 -0
- package/dist/core/request-ids.d.ts.map +1 -0
- package/dist/core/request-ids.js +55 -0
- package/dist/core/request-ids.js.map +1 -0
- package/dist/core/rows.d.ts +79 -0
- package/dist/core/rows.d.ts.map +1 -0
- package/dist/core/rows.js +173 -0
- package/dist/core/rows.js.map +1 -0
- package/dist/core/store.d.ts +233 -0
- package/dist/core/store.d.ts.map +1 -0
- package/dist/core/store.js +1162 -0
- package/dist/core/store.js.map +1 -0
- package/dist/core/totals.d.ts +24 -0
- package/dist/core/totals.d.ts.map +1 -0
- package/dist/core/totals.js +49 -0
- package/dist/core/totals.js.map +1 -0
- package/dist/core/trace.d.ts +7 -0
- package/dist/core/trace.d.ts.map +1 -0
- package/dist/core/trace.js +26 -0
- package/dist/core/trace.js.map +1 -0
- package/dist/core/transports.d.ts +50 -0
- package/dist/core/transports.d.ts.map +1 -0
- package/dist/core/transports.js +160 -0
- package/dist/core/transports.js.map +1 -0
- package/dist/core/types.d.ts +151 -0
- package/dist/core/types.d.ts.map +1 -0
- package/dist/core/types.js +45 -0
- package/dist/core/types.js.map +1 -0
- package/dist/core.d.ts +12 -0
- package/dist/core.d.ts.map +1 -0
- package/dist/core.js +11 -0
- package/dist/core.js.map +1 -0
- package/dist/index.d.ts +15 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +13 -7
- package/dist/index.js.map +1 -1
- package/dist/react/accessible-rows.d.ts +13 -0
- package/dist/react/accessible-rows.d.ts.map +1 -0
- package/dist/react/accessible-rows.js +320 -0
- package/dist/react/accessible-rows.js.map +1 -0
- package/dist/react/cell-editor.d.ts +22 -0
- package/dist/react/cell-editor.d.ts.map +1 -0
- package/dist/react/cell-editor.js +431 -0
- package/dist/react/cell-editor.js.map +1 -0
- package/dist/react/cell-menu.d.ts +18 -0
- package/dist/react/cell-menu.d.ts.map +1 -0
- package/dist/react/cell-menu.js +299 -0
- package/dist/react/cell-menu.js.map +1 -0
- package/dist/react/column-menu.d.ts +16 -0
- package/dist/react/column-menu.d.ts.map +1 -0
- package/dist/react/column-menu.js +1311 -0
- package/dist/react/column-menu.js.map +1 -0
- package/dist/react/columns-menu.d.ts +7 -0
- package/dist/react/columns-menu.d.ts.map +1 -0
- package/dist/react/columns-menu.js +249 -0
- package/dist/react/columns-menu.js.map +1 -0
- package/dist/react/conditions-menu.d.ts +10 -0
- package/dist/react/conditions-menu.d.ts.map +1 -0
- package/dist/react/conditions-menu.js +795 -0
- package/dist/react/conditions-menu.js.map +1 -0
- package/dist/react/context.d.ts +29 -0
- package/dist/react/context.d.ts.map +1 -0
- package/dist/react/context.js +18 -0
- package/dist/react/context.js.map +1 -0
- package/dist/react/data-grid.d.ts +79 -0
- package/dist/react/data-grid.d.ts.map +1 -0
- package/dist/react/data-grid.js +653 -0
- package/dist/react/data-grid.js.map +1 -0
- package/dist/react/detail-panel.d.ts +22 -0
- package/dist/react/detail-panel.d.ts.map +1 -0
- package/dist/react/detail-panel.js +242 -0
- package/dist/react/detail-panel.js.map +1 -0
- package/dist/react/export-menu.d.ts +11 -0
- package/dist/react/export-menu.d.ts.map +1 -0
- package/dist/react/export-menu.js +304 -0
- package/dist/react/export-menu.js.map +1 -0
- package/dist/react/find-bar.d.ts +11 -0
- package/dist/react/find-bar.d.ts.map +1 -0
- package/dist/react/find-bar.js +303 -0
- package/dist/react/find-bar.js.map +1 -0
- package/dist/react/format-form.d.ts +12 -0
- package/dist/react/format-form.d.ts.map +1 -0
- package/dist/react/format-form.js +863 -0
- package/dist/react/format-form.js.map +1 -0
- package/dist/react/formula-menu.d.ts +6 -0
- package/dist/react/formula-menu.d.ts.map +1 -0
- package/dist/react/formula-menu.js +343 -0
- package/dist/react/formula-menu.js.map +1 -0
- package/dist/react/grid-body.d.ts +33 -0
- package/dist/react/grid-body.d.ts.map +1 -0
- package/dist/react/grid-body.js +1389 -0
- package/dist/react/grid-body.js.map +1 -0
- package/dist/react/group-menu.d.ts +7 -0
- package/dist/react/group-menu.d.ts.map +1 -0
- package/dist/react/group-menu.js +508 -0
- package/dist/react/group-menu.js.map +1 -0
- package/dist/react/hooks.d.ts +33 -0
- package/dist/react/hooks.d.ts.map +1 -0
- package/dist/react/hooks.js +161 -0
- package/dist/react/hooks.js.map +1 -0
- package/dist/react/messages.d.ts +180 -0
- package/dist/react/messages.d.ts.map +1 -0
- package/dist/react/messages.js +414 -0
- package/dist/react/messages.js.map +1 -0
- package/dist/react/save.d.ts +9 -0
- package/dist/react/save.d.ts.map +1 -0
- package/dist/react/save.js +102 -0
- package/dist/react/save.js.map +1 -0
- package/dist/react/static-rows.d.ts +9 -0
- package/dist/react/static-rows.d.ts.map +1 -0
- package/dist/react/static-rows.js +176 -0
- package/dist/react/static-rows.js.map +1 -0
- package/dist/react/status-bar.d.ts +12 -0
- package/dist/react/status-bar.d.ts.map +1 -0
- package/dist/react/status-bar.js +413 -0
- package/dist/react/status-bar.js.map +1 -0
- package/dist/react/toolbar-popover.d.ts +14 -0
- package/dist/react/toolbar-popover.d.ts.map +1 -0
- package/dist/react/toolbar-popover.js +143 -0
- package/dist/react/toolbar-popover.js.map +1 -0
- package/dist/react/toolbar.d.ts +13 -0
- package/dist/react/toolbar.d.ts.map +1 -0
- package/dist/react/toolbar.js +344 -0
- package/dist/react/toolbar.js.map +1 -0
- package/dist/server.d.ts +22 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +45 -0
- package/dist/server.js.map +1 -0
- package/dist/styles.css +496 -316
- package/package.json +42 -17
- package/src/canvas/geometry.ts +197 -0
- package/src/canvas/grid-canvas.ts +1222 -0
- package/src/canvas/hooks.ts +61 -0
- package/src/canvas/keys.ts +96 -0
- package/src/canvas/layout.ts +77 -0
- package/src/canvas/scroll.ts +120 -0
- package/src/canvas/text.ts +155 -0
- package/src/{theme.ts → canvas/theme.ts} +14 -1
- package/src/core/cache.ts +247 -0
- package/src/core/checked.ts +64 -0
- package/src/core/client.ts +103 -0
- package/src/core/conditions.ts +89 -0
- package/src/core/evaluate.ts +221 -0
- package/src/core/filters.ts +268 -0
- package/src/core/format.ts +309 -0
- package/src/core/measures.ts +99 -0
- package/src/core/request-ids.ts +54 -0
- package/src/core/rows.ts +213 -0
- package/src/core/store.ts +1122 -0
- package/src/core/totals.ts +59 -0
- package/src/core/trace.ts +44 -0
- package/src/core/transports.ts +177 -0
- package/src/core/types.ts +169 -0
- package/src/core.ts +39 -0
- package/src/index.ts +24 -12
- package/src/react/accessible-rows.tsx +242 -0
- package/src/react/cell-editor.tsx +216 -0
- package/src/react/cell-menu.tsx +166 -0
- package/src/react/column-menu.tsx +619 -0
- package/src/react/columns-menu.tsx +116 -0
- package/src/react/conditions-menu.tsx +289 -0
- package/src/react/context.ts +33 -0
- package/src/react/data-grid.tsx +286 -0
- package/src/react/detail-panel.tsx +92 -0
- package/src/react/export-menu.tsx +112 -0
- package/src/react/find-bar.tsx +112 -0
- package/src/react/format-form.tsx +421 -0
- package/src/react/formula-menu.tsx +163 -0
- package/src/react/grid-body.tsx +744 -0
- package/src/react/group-menu.tsx +214 -0
- package/src/react/hooks.ts +104 -0
- package/src/react/messages.ts +556 -0
- package/src/react/save.ts +42 -0
- package/src/react/static-rows.tsx +59 -0
- package/src/react/status-bar.tsx +175 -0
- package/src/react/toolbar-popover.tsx +69 -0
- package/src/react/toolbar.tsx +152 -0
- package/src/server.ts +58 -0
- package/src/styles.css +496 -316
- package/dist/components/bars.d.ts +0 -14
- package/dist/components/bars.d.ts.map +0 -1
- package/dist/components/bars.js +0 -68
- package/dist/components/bars.js.map +0 -1
- package/dist/components/cell-inspector.d.ts +0 -11
- package/dist/components/cell-inspector.d.ts.map +0 -1
- package/dist/components/cell-inspector.js +0 -37
- package/dist/components/cell-inspector.js.map +0 -1
- package/dist/components/columns-panel.d.ts +0 -12
- package/dist/components/columns-panel.d.ts.map +0 -1
- package/dist/components/columns-panel.js +0 -11
- package/dist/components/columns-panel.js.map +0 -1
- package/dist/components/filter-panel.d.ts +0 -22
- package/dist/components/filter-panel.d.ts.map +0 -1
- package/dist/components/filter-panel.js +0 -169
- package/dist/components/filter-panel.js.map +0 -1
- package/dist/components/find-bar.d.ts +0 -9
- package/dist/components/find-bar.d.ts.map +0 -1
- package/dist/components/find-bar.js +0 -46
- package/dist/components/find-bar.js.map +0 -1
- package/dist/components/popover.d.ts +0 -38
- package/dist/components/popover.d.ts.map +0 -1
- package/dist/components/popover.js +0 -104
- package/dist/components/popover.js.map +0 -1
- package/dist/components/stats-panel.d.ts +0 -12
- package/dist/components/stats-panel.d.ts.map +0 -1
- package/dist/components/stats-panel.js +0 -40
- package/dist/components/stats-panel.js.map +0 -1
- package/dist/controller.d.ts +0 -227
- package/dist/controller.d.ts.map +0 -1
- package/dist/controller.js +0 -845
- package/dist/controller.js.map +0 -1
- package/dist/data-grid.d.ts +0 -51
- package/dist/data-grid.d.ts.map +0 -1
- package/dist/data-grid.js +0 -704
- package/dist/data-grid.js.map +0 -1
- package/dist/labels.d.ts +0 -9
- package/dist/labels.d.ts.map +0 -1
- package/dist/labels.js +0 -38
- package/dist/labels.js.map +0 -1
- package/dist/messages.d.ts +0 -99
- package/dist/messages.d.ts.map +0 -1
- package/dist/messages.js +0 -276
- package/dist/messages.js.map +0 -1
- package/dist/renderer.d.ts +0 -52
- package/dist/renderer.d.ts.map +0 -1
- package/dist/renderer.js +0 -522
- package/dist/renderer.js.map +0 -1
- package/dist/text.d.ts +0 -14
- package/dist/text.d.ts.map +0 -1
- package/dist/text.js +0 -63
- package/dist/text.js.map +0 -1
- package/dist/theme.d.ts.map +0 -1
- package/dist/theme.js +0 -54
- package/dist/theme.js.map +0 -1
- package/src/components/bars.tsx +0 -180
- package/src/components/cell-inspector.tsx +0 -70
- package/src/components/columns-panel.tsx +0 -59
- package/src/components/filter-panel.tsx +0 -293
- package/src/components/find-bar.tsx +0 -104
- package/src/components/popover.tsx +0 -194
- package/src/components/stats-panel.tsx +0 -153
- package/src/controller.ts +0 -945
- package/src/data-grid.tsx +0 -1035
- package/src/labels.ts +0 -46
- package/src/messages.ts +0 -390
- package/src/renderer.ts +0 -535
- package/src/text.ts +0 -55
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import { c as _c } from "react/compiler-runtime";
|
|
2
|
+
import { use, useEffect, useState, useSyncExternalStore } from "react";
|
|
3
|
+
import { createGridStore } from "../core/store.js";
|
|
4
|
+
import { GridContext } from "./context.js";
|
|
5
|
+
|
|
6
|
+
/** The store of the nearest `DataGrid` or `GridProvider`. */
|
|
7
|
+
export function useGridStore() {
|
|
8
|
+
const store = use(GridContext);
|
|
9
|
+
if (!store) throw new Error("useGridStore needs a DataGrid or a GridProvider around it.");
|
|
10
|
+
return store;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/** Whether two values are the same, or objects or arrays whose members are the same (`Object.is`). */
|
|
14
|
+
export function shallowEqual(a, b) {
|
|
15
|
+
if (Object.is(a, b)) return true;
|
|
16
|
+
if (typeof a !== "object" || typeof b !== "object" || a === null || b === null) return false;
|
|
17
|
+
if (Array.isArray(a) !== Array.isArray(b)) return false;
|
|
18
|
+
const keys = Object.keys(a);
|
|
19
|
+
if (keys.length !== Object.keys(b).length) return false;
|
|
20
|
+
return keys.every(key => Object.hasOwn(b, key) && Object.is(a[key], b[key]));
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/** The last value a selector gave, kept while the snapshot stays or the next value is equal. */
|
|
24
|
+
class Selection {
|
|
25
|
+
read(snapshot, selector, isEqual) {
|
|
26
|
+
if (snapshot === this.snapshot && selector === this.selector) return this.value;
|
|
27
|
+
const next = selector(snapshot);
|
|
28
|
+
if (this.snapshot === undefined || !isEqual(this.value, next)) this.value = next;
|
|
29
|
+
this.snapshot = snapshot;
|
|
30
|
+
this.selector = selector;
|
|
31
|
+
return this.value;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* A part of the store's snapshot (§5.3 of react.md). The component renders again only when the selected value
|
|
37
|
+
* changes by `isEqual` (`Object.is` by default). Selectors run on every change of the store: they are cheap and
|
|
38
|
+
* make no new objects unless `isEqual` compares them (`shallowEqual`).
|
|
39
|
+
*/
|
|
40
|
+
export function useGridSelector(selector, t0) {
|
|
41
|
+
const $ = _c(5);
|
|
42
|
+
const isEqual = t0 === undefined ? Object.is : t0;
|
|
43
|
+
const store = useGridStore();
|
|
44
|
+
const [selection] = useState(_temp);
|
|
45
|
+
let t1;
|
|
46
|
+
if ($[0] !== isEqual || $[1] !== selection || $[2] !== selector || $[3] !== store) {
|
|
47
|
+
t1 = () => selection.read(store.getSnapshot(), selector, isEqual);
|
|
48
|
+
$[0] = isEqual;
|
|
49
|
+
$[1] = selection;
|
|
50
|
+
$[2] = selector;
|
|
51
|
+
$[3] = store;
|
|
52
|
+
$[4] = t1;
|
|
53
|
+
} else {
|
|
54
|
+
t1 = $[4];
|
|
55
|
+
}
|
|
56
|
+
const read = t1;
|
|
57
|
+
return useSyncExternalStore(store.subscribe, read, read);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/** The store's `dispatch`: the same function on every render. */
|
|
61
|
+
function _temp() {
|
|
62
|
+
return new Selection();
|
|
63
|
+
}
|
|
64
|
+
export function useGridDispatch() {
|
|
65
|
+
return useGridStore().dispatch;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/** A store for the life of the component: made once from the first options, connected while it is mounted. */
|
|
69
|
+
export function useCreateGridStore(options) {
|
|
70
|
+
const $ = _c(5);
|
|
71
|
+
let t0;
|
|
72
|
+
if ($[0] !== options) {
|
|
73
|
+
t0 = () => createGridStore(options);
|
|
74
|
+
$[0] = options;
|
|
75
|
+
$[1] = t0;
|
|
76
|
+
} else {
|
|
77
|
+
t0 = $[1];
|
|
78
|
+
}
|
|
79
|
+
const [store] = useState(t0);
|
|
80
|
+
let t1;
|
|
81
|
+
let t2;
|
|
82
|
+
if ($[2] !== store) {
|
|
83
|
+
t1 = () => store.connect();
|
|
84
|
+
t2 = [store];
|
|
85
|
+
$[2] = store;
|
|
86
|
+
$[3] = t1;
|
|
87
|
+
$[4] = t2;
|
|
88
|
+
} else {
|
|
89
|
+
t1 = $[3];
|
|
90
|
+
t2 = $[4];
|
|
91
|
+
}
|
|
92
|
+
useEffect(t1, t2);
|
|
93
|
+
return store;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Values of rows `[start, end)` of the view on screen, for cells that React renders (a detail panel, an overlay):
|
|
98
|
+
* one array per row, with undefined for values not read yet. Reads them when they are missing, and renders again
|
|
99
|
+
* when rows arrive.
|
|
100
|
+
*/
|
|
101
|
+
export function useGridRows(range) {
|
|
102
|
+
const $ = _c(14);
|
|
103
|
+
const store = useGridStore();
|
|
104
|
+
const version = useSyncExternalStore(store.subscribeRows, store.getRowsVersion, store.getRowsVersion);
|
|
105
|
+
const {
|
|
106
|
+
start,
|
|
107
|
+
end,
|
|
108
|
+
columns
|
|
109
|
+
} = range;
|
|
110
|
+
let t0;
|
|
111
|
+
if ($[0] !== columns) {
|
|
112
|
+
t0 = columns.join("\0");
|
|
113
|
+
$[0] = columns;
|
|
114
|
+
$[1] = t0;
|
|
115
|
+
} else {
|
|
116
|
+
t0 = $[1];
|
|
117
|
+
}
|
|
118
|
+
const names = t0;
|
|
119
|
+
let t1;
|
|
120
|
+
let t2;
|
|
121
|
+
if ($[2] !== end || $[3] !== names || $[4] !== start || $[5] !== store) {
|
|
122
|
+
t1 = () => {
|
|
123
|
+
store.ensure(start, end, names === "" ? [] : names.split("\0"));
|
|
124
|
+
};
|
|
125
|
+
t2 = [store, start, end, names];
|
|
126
|
+
$[2] = end;
|
|
127
|
+
$[3] = names;
|
|
128
|
+
$[4] = start;
|
|
129
|
+
$[5] = store;
|
|
130
|
+
$[6] = t1;
|
|
131
|
+
$[7] = t2;
|
|
132
|
+
} else {
|
|
133
|
+
t1 = $[6];
|
|
134
|
+
t2 = $[7];
|
|
135
|
+
}
|
|
136
|
+
useEffect(t1, t2);
|
|
137
|
+
let t3;
|
|
138
|
+
if ($[8] !== columns || $[9] !== end || $[10] !== start || $[11] !== store || $[12] !== version) {
|
|
139
|
+
t3 = readRows(store, version, start, end, columns);
|
|
140
|
+
$[8] = columns;
|
|
141
|
+
$[9] = end;
|
|
142
|
+
$[10] = start;
|
|
143
|
+
$[11] = store;
|
|
144
|
+
$[12] = version;
|
|
145
|
+
$[13] = t3;
|
|
146
|
+
} else {
|
|
147
|
+
t3 = $[13];
|
|
148
|
+
}
|
|
149
|
+
return t3;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* Reads rows of the store's cache. The cache changes inside the store, so the version of its rows is an argument:
|
|
154
|
+
* memoization (React Compiler's included) reads them again when it changes.
|
|
155
|
+
*/
|
|
156
|
+
export function readRows(store, _version, start, end, columns) {
|
|
157
|
+
const rows = [];
|
|
158
|
+
for (let row = start; row < end; row++) rows.push(columns.map(column => store.cell(row, column)));
|
|
159
|
+
return rows;
|
|
160
|
+
}
|
|
161
|
+
//# sourceMappingURL=hooks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["use","useEffect","useState","useSyncExternalStore","createGridStore","GridContext","useGridStore","store","Error","shallowEqual","a","b","Object","is","Array","isArray","keys","length","every","key","hasOwn","Selection","read","snapshot","selector","isEqual","value","next","undefined","useGridSelector","t0","$","_c","selection","_temp","t1","getSnapshot","subscribe","useGridDispatch","dispatch","useCreateGridStore","options","t2","connect","useGridRows","range","version","subscribeRows","getRowsVersion","start","end","columns","join","names","ensure","split","t3","readRows","_version","rows","row","push","map","column","cell"],"sources":["hooks.ts"],"sourcesContent":["import { use, useEffect, useState, useSyncExternalStore } from \"react\";\nimport type { JsonValue } from \"vastgrid-spec\";\nimport { createGridStore, type GridStore, type GridStoreOptions } from \"../core/store.js\";\nimport type { GridSnapshot } from \"../core/types.js\";\nimport { GridContext } from \"./context.js\";\n\n/** The store of the nearest `DataGrid` or `GridProvider`. */\nexport function useGridStore(): GridStore {\n const store = use(GridContext);\n if (!store) throw new Error(\"useGridStore needs a DataGrid or a GridProvider around it.\");\n return store;\n}\n\n/** Whether two values are the same, or objects or arrays whose members are the same (`Object.is`). */\nexport function shallowEqual<T>(a: T, b: T): boolean {\n if (Object.is(a, b)) return true;\n if (typeof a !== \"object\" || typeof b !== \"object\" || a === null || b === null) return false;\n if (Array.isArray(a) !== Array.isArray(b)) return false;\n const keys = Object.keys(a);\n if (keys.length !== Object.keys(b).length) return false;\n return keys.every(\n (key) =>\n Object.hasOwn(b, key) && Object.is((a as Record<string, unknown>)[key], (b as Record<string, unknown>)[key]),\n );\n}\n\n/** The last value a selector gave, kept while the snapshot stays or the next value is equal. */\nclass Selection<T> {\n private snapshot: GridSnapshot | undefined;\n private selector: ((snapshot: GridSnapshot) => T) | undefined;\n private value: T | undefined;\n\n read(snapshot: GridSnapshot, selector: (snapshot: GridSnapshot) => T, isEqual: (a: T, b: T) => boolean): T {\n if (snapshot === this.snapshot && selector === this.selector) return this.value as T;\n const next = selector(snapshot);\n if (this.snapshot === undefined || !isEqual(this.value as T, next)) this.value = next;\n this.snapshot = snapshot;\n this.selector = selector;\n return this.value as T;\n }\n}\n\n/**\n * A part of the store's snapshot (§5.3 of react.md). The component renders again only when the selected value\n * changes by `isEqual` (`Object.is` by default). Selectors run on every change of the store: they are cheap and\n * make no new objects unless `isEqual` compares them (`shallowEqual`).\n */\nexport function useGridSelector<T>(\n selector: (snapshot: GridSnapshot) => T,\n isEqual: (a: T, b: T) => boolean = Object.is,\n): T {\n const store = useGridStore();\n const [selection] = useState(() => new Selection<T>());\n const read = () => selection.read(store.getSnapshot(), selector, isEqual);\n return useSyncExternalStore(store.subscribe, read, read);\n}\n\n/** The store's `dispatch`: the same function on every render. */\nexport function useGridDispatch(): GridStore[\"dispatch\"] {\n return useGridStore().dispatch;\n}\n\n/** A store for the life of the component: made once from the first options, connected while it is mounted. */\nexport function useCreateGridStore(options: GridStoreOptions): GridStore {\n const [store] = useState(() => createGridStore(options));\n useEffect(() => store.connect(), [store]);\n return store;\n}\n\n/**\n * Values of rows `[start, end)` of the view on screen, for cells that React renders (a detail panel, an overlay):\n * one array per row, with undefined for values not read yet. Reads them when they are missing, and renders again\n * when rows arrive.\n */\nexport function useGridRows(range: {\n start: number;\n end: number;\n columns: readonly string[];\n}): (JsonValue | undefined)[][] {\n const store = useGridStore();\n const version = useSyncExternalStore(store.subscribeRows, store.getRowsVersion, store.getRowsVersion);\n const { start, end, columns } = range;\n const names = columns.join(\"\\u0000\");\n useEffect(() => {\n store.ensure(start, end, names === \"\" ? [] : names.split(\"\\u0000\"));\n }, [store, start, end, names]);\n return readRows(store, version, start, end, columns);\n}\n\n/**\n * Reads rows of the store's cache. The cache changes inside the store, so the version of its rows is an argument:\n * memoization (React Compiler's included) reads them again when it changes.\n */\nexport function readRows(\n store: GridStore,\n _version: number,\n start: number,\n end: number,\n columns: readonly string[],\n): (JsonValue | undefined)[][] {\n const rows: (JsonValue | undefined)[][] = [];\n for (let row = start; row < end; row++) rows.push(columns.map((column) => store.cell(row, column)));\n return rows;\n}\n"],"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AAO,CAAC;IAAApB,CAAA,MAAAoB,OAAA;IAAApB,CAAA,MAAAmB,GAAA;IAAAnB,CAAA,OAAAkB,KAAA;IAAAlB,CAAA,OAAAxB,KAAA;IAAAwB,CAAA,OAAAe,OAAA;IAAAf,CAAA,OAAAyB,EAAA;EAAA;IAAAA,EAAA,GAAAzB,CAAA;EAAA;EAAA,OAA7CyB,EAA6C;AAAA;;AAGtD;AACA;AACA;AACA;AACA,OAAO,SAASC,QAAQA,CACtBlD,KAAgB,EAChBmD,QAAgB,EAChBT,KAAa,EACbC,GAAW,EACXC,OAA0B,EACG;EAC7B,MAAMQ,IAAiC,GAAG,EAAE;EAC5C,KAAK,IAAIC,GAAG,GAAGX,KAAK,EAAEW,GAAG,GAAGV,GAAG,EAAEU,GAAG,EAAE,EAAED,IAAI,CAACE,IAAI,CAACV,OAAO,CAACW,GAAG,CAAEC,MAAM,IAAKxD,KAAK,CAACyD,IAAI,CAACJ,GAAG,EAAEG,MAAM,CAAC,CAAC,CAAC;EACnG,OAAOJ,IAAI;AACb","ignoreList":[]}
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
import type { MeasureName } from "vastgrid-spec";
|
|
2
|
+
import type { FilterOperator } from "../core/filters.js";
|
|
3
|
+
import type { Statistic } from "../core/measures.js";
|
|
4
|
+
/** The texts of the grid's UI. Hosts replace any of them with the `messages` prop. */
|
|
5
|
+
export interface GridMessages {
|
|
6
|
+
grid: string;
|
|
7
|
+
rows: (count: string) => string;
|
|
8
|
+
loading: string;
|
|
9
|
+
reading: string;
|
|
10
|
+
failed: (message: string) => string;
|
|
11
|
+
cell: (row: string, column: string) => string;
|
|
12
|
+
count: (count: string) => string;
|
|
13
|
+
sum: (sum: string) => string;
|
|
14
|
+
average: (average: string) => string;
|
|
15
|
+
copied: (cells: string) => string;
|
|
16
|
+
search: string;
|
|
17
|
+
/** The cell editor's label. */
|
|
18
|
+
editing: (row: string, column: string) => string;
|
|
19
|
+
/** How the editor saves and leaves, for screen readers. */
|
|
20
|
+
editorHint: string;
|
|
21
|
+
readOnly: string;
|
|
22
|
+
invalidValue: (column: string) => string;
|
|
23
|
+
/** The button that saves the written cells into the file. */
|
|
24
|
+
save: string;
|
|
25
|
+
saving: string;
|
|
26
|
+
saved: (records: string) => string;
|
|
27
|
+
/** Written cells that the file does not hold yet. */
|
|
28
|
+
unsaved: (cells: string) => string;
|
|
29
|
+
/** The file changed on disk since it was read: the save was refused, and the written cells are kept. */
|
|
30
|
+
fileChanged: string;
|
|
31
|
+
saveUnsupported: string;
|
|
32
|
+
/** The file changed on disk while cells were written: they are kept, and the file is not read again. */
|
|
33
|
+
changedOnDisk: string;
|
|
34
|
+
reload: string;
|
|
35
|
+
/** Reading the file again drops the cells written into the table as it was read. */
|
|
36
|
+
discardAndReload: string;
|
|
37
|
+
/** A write that failed (§6.6): why, and the buttons that send it again, write over the cells or forget it. */
|
|
38
|
+
writeFailed: (message: string) => string;
|
|
39
|
+
writeConflict: string;
|
|
40
|
+
writeRevisionChanged: string;
|
|
41
|
+
retry: string;
|
|
42
|
+
overwrite: string;
|
|
43
|
+
discard: string;
|
|
44
|
+
/** The menu that exports the view (§6.6), its choices, and what an export did. */
|
|
45
|
+
export: string;
|
|
46
|
+
exportFormats: Record<string, string>;
|
|
47
|
+
exportView: string;
|
|
48
|
+
exportTable: string;
|
|
49
|
+
exportAllColumns: string;
|
|
50
|
+
exporting: string;
|
|
51
|
+
exported: (rows: string) => string;
|
|
52
|
+
/** The menu of derived columns written as formulas (§4.11), and its fields and buttons. */
|
|
53
|
+
formulas: string;
|
|
54
|
+
newFormula: string;
|
|
55
|
+
formulaName: string;
|
|
56
|
+
formula: string;
|
|
57
|
+
formulaExample: string;
|
|
58
|
+
addFormula: string;
|
|
59
|
+
applyFormula: string;
|
|
60
|
+
removeFormula: string;
|
|
61
|
+
/** The menu of a column (§6.2, §6.3): its label, sorting, filtering, pins, width and hiding. */
|
|
62
|
+
columnMenu: (column: string) => string;
|
|
63
|
+
sortAscending: string;
|
|
64
|
+
sortDescending: string;
|
|
65
|
+
thenSortAscending: string;
|
|
66
|
+
thenSortDescending: string;
|
|
67
|
+
clearSort: string;
|
|
68
|
+
filter: string;
|
|
69
|
+
filterBy: (column: string) => string;
|
|
70
|
+
clearFilter: string;
|
|
71
|
+
pinLeft: string;
|
|
72
|
+
pinRight: string;
|
|
73
|
+
unpin: string;
|
|
74
|
+
autoFit: string;
|
|
75
|
+
hideColumn: string;
|
|
76
|
+
showAllColumns: string;
|
|
77
|
+
/** The filter of a column: a list of its values with check boxes, or a condition. */
|
|
78
|
+
valuesSearch: string;
|
|
79
|
+
selectAll: string;
|
|
80
|
+
blank: string;
|
|
81
|
+
valuesTruncated: (shown: string) => string;
|
|
82
|
+
condition: string;
|
|
83
|
+
conditionNone: string;
|
|
84
|
+
operators: Record<FilterOperator, string>;
|
|
85
|
+
value: string;
|
|
86
|
+
minimum: string;
|
|
87
|
+
maximum: string;
|
|
88
|
+
/** The column has conditions that the menu does not show; applying the menu's filter replaces them. */
|
|
89
|
+
otherConditions: string;
|
|
90
|
+
back: string;
|
|
91
|
+
apply: string;
|
|
92
|
+
/** The statistics of a column, over the rows of the view. */
|
|
93
|
+
statistics: string;
|
|
94
|
+
statisticsOf: (column: string) => string;
|
|
95
|
+
statisticNames: Record<Statistic["kind"] | "nulls", string>;
|
|
96
|
+
/** The total of a column in the totals row (§5.1), and the names of the measures (§4.5). */
|
|
97
|
+
total: string;
|
|
98
|
+
noTotal: string;
|
|
99
|
+
measureNames: Record<MeasureName, string>;
|
|
100
|
+
/** Grouping rows (§6.2): from a column's menu, and the toolbar's menu of keys and measures. */
|
|
101
|
+
groupByColumn: string;
|
|
102
|
+
removeFromGroups: string;
|
|
103
|
+
ungroup: string;
|
|
104
|
+
groups: string;
|
|
105
|
+
groupKeys: string;
|
|
106
|
+
addKey: string;
|
|
107
|
+
measures: string;
|
|
108
|
+
addMeasure: string;
|
|
109
|
+
measureColumn: string;
|
|
110
|
+
allRows: string;
|
|
111
|
+
remove: (item: string) => string;
|
|
112
|
+
/** The pivot of the groups (§4.6): the columns whose values become columns. */
|
|
113
|
+
pivotBy: string;
|
|
114
|
+
addPivot: string;
|
|
115
|
+
/** The conditions menu (§6.2.1): groups of conditions across columns. */
|
|
116
|
+
conditions: string;
|
|
117
|
+
conditionsCount: (count: string) => string;
|
|
118
|
+
conditionsTitle: string;
|
|
119
|
+
conditionColumn: string;
|
|
120
|
+
matchLabel: string;
|
|
121
|
+
matchAll: string;
|
|
122
|
+
matchAny: string;
|
|
123
|
+
noConditions: string;
|
|
124
|
+
addCondition: string;
|
|
125
|
+
addGroup: string;
|
|
126
|
+
removeGroup: string;
|
|
127
|
+
removeCondition: string;
|
|
128
|
+
invalidCondition: string;
|
|
129
|
+
clearConditions: string;
|
|
130
|
+
/** The columns menu (§6.3): every column of the view, shown or hidden, in order. */
|
|
131
|
+
columns: string;
|
|
132
|
+
findColumn: string;
|
|
133
|
+
moveUp: (column: string) => string;
|
|
134
|
+
moveDown: (column: string) => string;
|
|
135
|
+
pinned: Record<"left" | "right", string>;
|
|
136
|
+
/** A column's format (§5.1): label, alignment, wrapping, number and date formats, and conditional colors. */
|
|
137
|
+
format: string;
|
|
138
|
+
formatOf: (column: string) => string;
|
|
139
|
+
columnLabel: string;
|
|
140
|
+
alignment: string;
|
|
141
|
+
alignments: Record<"auto" | "left" | "center" | "right", string>;
|
|
142
|
+
wrapText: string;
|
|
143
|
+
numberFormat: string;
|
|
144
|
+
numberStyles: Record<"none" | "decimal" | "percent" | "currency", string>;
|
|
145
|
+
currency: string;
|
|
146
|
+
invalidCurrency: string;
|
|
147
|
+
fractionDigits: string;
|
|
148
|
+
grouping: string;
|
|
149
|
+
datePattern: string;
|
|
150
|
+
conditionalColors: string;
|
|
151
|
+
textColor: string;
|
|
152
|
+
backgroundColor: string;
|
|
153
|
+
ruleDescription: string;
|
|
154
|
+
addRule: string;
|
|
155
|
+
removeRule: string;
|
|
156
|
+
clearFormat: string;
|
|
157
|
+
/** The detail panel of the active row (§5.2). */
|
|
158
|
+
details: string;
|
|
159
|
+
detailOf: (row: string) => string;
|
|
160
|
+
closeDetails: string;
|
|
161
|
+
/** Checked rows (§5.2.1): how many, or that the view may not match them. */
|
|
162
|
+
checkedRows: (count: string) => string;
|
|
163
|
+
checkedUnknown: string;
|
|
164
|
+
/** The find bar (⌘F) and the cell menu. */
|
|
165
|
+
find: string;
|
|
166
|
+
matchCase: string;
|
|
167
|
+
findNext: string;
|
|
168
|
+
findPrevious: string;
|
|
169
|
+
closeFind: string;
|
|
170
|
+
noMatches: string;
|
|
171
|
+
cellMenu: string;
|
|
172
|
+
copy: string;
|
|
173
|
+
filterToValue: string;
|
|
174
|
+
excludeValue: string;
|
|
175
|
+
fullValue: string;
|
|
176
|
+
close: string;
|
|
177
|
+
}
|
|
178
|
+
/** The built-in texts for a language tag: Japanese for `ja`, English otherwise. */
|
|
179
|
+
export declare function messagesFor(locale: string | undefined): GridMessages;
|
|
180
|
+
//# sourceMappingURL=messages.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../src/react/messages.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAErD,sFAAsF;AACtF,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,MAAM,CAAC;IACpC,IAAI,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,MAAM,CAAC;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