@open-grid/vue-ui 0.1.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Open Grid contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,57 @@
1
+ # @open-grid/vue-ui
2
+
3
+ Optional styled Vue data grid for Open Grid.
4
+
5
+ Use this package for the reference Vue grid UI, including sorting, filtering, selection, editing, grouping, tree data, virtualization, and export helpers.
6
+
7
+ `DataGrid` accepts `ariaLabel` for a product-specific accessible name and defaults to `"Data grid"`.
8
+
9
+ Use Vue's `class` attribute, `getRowClassName(row)`, `getHeaderClassName(context)`, and `getCellClassName(context)` to attach product-owned root, row, header, and cell classes for status, risk, or workflow styling without replacing the renderer. Header contexts include the grid, column, and header; cell contexts also include the row and current value.
10
+
11
+ ## Install
12
+
13
+ ```bash
14
+ npm install @open-grid/vue-ui @open-grid/theme vue
15
+ ```
16
+
17
+ ## Usage
18
+
19
+ ```ts
20
+ import "@open-grid/theme/css";
21
+ import "@open-grid/vue-ui/css";
22
+ import { defineComponent, h } from "vue";
23
+ import { createColumnHelper, createDataGrid } from "@open-grid/vue-ui";
24
+
25
+ const column = createColumnHelper<{ id: string; name: string }>();
26
+ const DataGrid = createDataGrid<{ id: string; name: string }>();
27
+
28
+ export default defineComponent({
29
+ setup: () => () => h(DataGrid, {
30
+ ariaLabel: "People",
31
+ options: {
32
+ data: [{ id: "1", name: "Mina" }],
33
+ columns: [column.accessor("name", { header: "Name" })],
34
+ getRowId: (row) => row.id,
35
+ },
36
+ }),
37
+ });
38
+ ```
39
+
40
+ Override semantic `--og-*` variables on `[data-open-grid]` to match a product design system. Set `data-og-theme="dark"` on the grid or an ancestor for the bundled dark defaults; application toolbars and surrounding panels remain product-owned.
41
+
42
+ Set `options.editHistoryLimit` to a positive number to opt into bounded edit
43
+ history. Outside an active editor, Ctrl/Meta+Z undoes and Ctrl/Meta+Shift+Z or
44
+ Ctrl+Y redoes direct edits, pastes, and fills through the same preventable
45
+ `onCellEdit` contract.
46
+
47
+ Use `onGridReady: (grid) => ...` to connect product-owned toolbar commands,
48
+ diagnostics, or subscriptions to the styled grid's live core API. The handler runs
49
+ after mount and may return a cleanup function; return the unsubscribe function from
50
+ `grid.subscribeSelector(...)` when product UI mirrors one derived API value without
51
+ reacting to unrelated grid notifications.
52
+
53
+ The package re-exports `fitColumnsToWidth(grid, width, { columnIds? })` for
54
+ proportional visible-column fitting with core-owned min/max redistribution. Products decide the
55
+ available width and command placement; the renderer does not read layout implicitly.
56
+
57
+ See the [Vue UI guide](https://goatshave.github.io/open-grid/vue-ui) for controlled state, virtualization, editing, grouping, accessibility, and server-owned workflows.