@nocopypaste/vue-grid 0.9.0 → 0.11.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/AGENTS.md +72 -34
- package/CHANGELOG.md +34 -0
- package/README.md +118 -26
- package/agent/api.json +67 -1
- package/agent/api.md +10 -1
- package/agent/grid-config.schema.json +16 -0
- package/dist/agent/api.js +65 -1
- package/dist/agent/requirements.js +7 -2
- package/dist/agent/requirements.js.map +1 -1
- package/dist/base.css +1 -1
- package/dist/components/VGrid.vue_vue_type_script_setup_true_lang.js +102 -84
- package/dist/components/VGrid.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VGridCell.vue_vue_type_script_setup_true_lang.js +78 -56
- package/dist/components/VGridCell.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VGridCellEditor.js +6 -0
- package/dist/components/VGridCellEditor.js.map +1 -0
- package/dist/components/VGridCellEditor.vue_vue_type_script_setup_true_lang.js +208 -0
- package/dist/components/VGridCellEditor.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/VGridSortMarker.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/VGridSortMarker.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VGridStatusBar.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/components/VGridStatusBar.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/composables/useEditing.js +202 -0
- package/dist/composables/useEditing.js.map +1 -0
- package/dist/core/value.js +18 -2
- package/dist/core/value.js.map +1 -1
- package/dist/core.css +1 -1
- package/dist/features/editing.js +12 -0
- package/dist/features/editing.js.map +1 -0
- package/dist/features/index.js +30 -28
- package/dist/features/index.js.map +1 -1
- package/dist/index.js +63 -62
- package/dist/internal/context.js.map +1 -1
- package/dist/internal/features.js.map +1 -1
- package/dist/locales/de.js +133 -0
- package/dist/locales/de.js.map +1 -0
- package/dist/locales/en.js +133 -0
- package/dist/locales/en.js.map +1 -0
- package/dist/locales/es.js +151 -0
- package/dist/locales/es.js.map +1 -0
- package/dist/locales/fr.js +151 -0
- package/dist/locales/fr.js.map +1 -0
- package/dist/locales/plural.js +11 -0
- package/dist/locales/plural.js.map +1 -0
- package/dist/locales/sr-Latn.js +135 -0
- package/dist/locales/sr-Latn.js.map +1 -0
- package/dist/locales/sr.js +135 -0
- package/dist/locales/sr.js.map +1 -0
- package/dist/theme.css +1 -1
- package/dist/types/agent/requirements.d.ts +1 -1
- package/dist/types/components/VGrid.vue.d.ts +10 -3
- package/dist/types/components/VGridCellEditor.vue.d.ts +11 -0
- package/dist/types/composables/useEditing.d.ts +73 -0
- package/dist/types/core/value.d.ts +6 -0
- package/dist/types/features/editing.d.ts +2 -0
- package/dist/types/features/index.d.ts +2 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/internal/context.d.ts +4 -0
- package/dist/types/internal/features.d.ts +2 -1
- package/dist/types/locales/de.d.ts +124 -0
- package/dist/types/locales/en.d.ts +127 -0
- package/dist/types/locales/es.d.ts +124 -0
- package/dist/types/locales/fr.d.ts +124 -0
- package/dist/types/locales/plural.d.ts +11 -0
- package/dist/types/locales/sr-Latn.d.ts +124 -0
- package/dist/types/locales/sr.d.ts +124 -0
- package/dist/types/types.d.ts +113 -8
- package/dist/vue-grid.css +1 -1
- package/llms-full.txt +200 -61
- package/llms.txt +1 -1
- package/package.json +5 -1
package/llms-full.txt
CHANGED
|
@@ -33,45 +33,50 @@ runs in the [live examples](https://eboye.github.io/eboye-vue-grid/), each with
|
|
|
33
33
|
row that height, px) and a bounded height. `pagination` is ignored while `virtual` is on.
|
|
34
34
|
8. **Rows are never mutated** by the grid. To change a cell: assign the field on a reactive row, or
|
|
35
35
|
replace rows (`patchRows(rows, patches, rowKey)` keeps unchanged rows' identity).
|
|
36
|
-
9. **
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
36
|
+
9. **Inline editing is controlled too** (`editingFeature`, `editable` columns): the grid emits
|
|
37
|
+
`@cell-edit="{ row, rowKey, column, value, oldValue }"` and never writes the value; store it
|
|
38
|
+
(`setCellValue(e.row, e.column, e.value)` on reactive rows), or do it in `:save-cell` (may return a
|
|
39
|
+
Promise; a rejection keeps the editor open with the message).
|
|
40
|
+
10. **Editable renderers are controlled** (`checkbox`, `switch`, `radio`, `icon-toggle`, `edit`,
|
|
41
|
+
buttons, menus): they emit `@cell-action="{ name, payload, row, rowKey, column }"`; your handler
|
|
42
|
+
updates the data.
|
|
43
|
+
11. **Type columns** with `const col = createColumnHelper<Row>()` → `col({ ... })`: `rendererOptions`
|
|
40
44
|
are then checked against the chosen renderer.
|
|
41
|
-
|
|
45
|
+
12. **Server data** (`:data-source` + `serverDataFeature`): don't also pass `rows`; pass the
|
|
42
46
|
`signal` to `fetch`; return `{ rows, total }` (`total` drives the pager).
|
|
43
|
-
|
|
47
|
+
13. Width is any CSS grid track as a **string**: `'8rem'`, `'1fr'`, `'minmax(10rem, 2fr)'`,
|
|
44
48
|
`'min-content'` (default `auto`). Numbers are not accepted.
|
|
45
49
|
|
|
46
50
|
## Which feature for what
|
|
47
51
|
|
|
48
|
-
| The user wants… | Feature(s) | Props / column options
|
|
49
|
-
| ------------------------------------------------- | --------------------------------------------------------------------- |
|
|
50
|
-
| Click a header to sort | `sortingFeature` | column `sortable: true`; `sort-mode="client"` (or handle `v-model:sort`)
|
|
51
|
-
| Sort by several columns ("city, then stake") | `sortingFeature` | `multi-sort`, `v-model:sorts="[{ key, dir }, …]"`; Shift-click adds a column; server: `query.sorts`
|
|
52
|
-
| Filters per column, a filter row, quick search | `filteringFeature` | column `filterable: true` (`filter: 'text' \| 'number' \| 'date' \| 'boolean' \| 'set'`); `filter-row`; `<VGridSearch />` in `#toolbar`
|
|
53
|
-
| Pages | `paginationFeature` | `pagination` (or `{ pageSizes: [10, 25, 50] }`), `v-model:page`, `v-model:page-size`
|
|
54
|
-
| Backend sorting / filtering / paging | `serverDataFeature` (+ the above) | `:data-source="(query, { signal }) => Promise<{ rows, total }>"`
|
|
55
|
-
| Checkboxes / row selection, batch actions | `selectionFeature` | `selectable` (or `'single'`), `v-model:selected`, `is-row-selectable`, `prune-selection`; `#toolbar="{ selected, selectedCount, clearSelection }"`; server data: `v-model:select-all-matching`
|
|
56
|
-
| Nested child rows aligned to the parent's columns | `subGridsFeature` | `:sub-rows="(row) => row.children"` or `:load-sub-rows` + `:has-sub-rows`
|
|
57
|
-
| An expandable panel under a row | — | `#detail="{ row }"` slot (`row-expandable` to limit it)
|
|
58
|
-
| 10,000+ rows | `virtualScrollingFeature` | `:virtual="{ rowHeight: 40 }"` + bounded height
|
|
59
|
-
| Right-click menus (cells, headers) | `menusFeature` | `:context-menu="(ctx) => MenuItem[]"` + `@context-action`; header menu is on by default
|
|
60
|
-
| Freeze columns left / right | `columnPinningFeature` | column `pinned: 'left' \| 'right'`; on narrow grids they scroll unless `pinned-max-share` allows (default half the width)
|
|
61
|
-
| Show / hide columns | `columnVisibilityFeature` | column `hidden: true`; `<VGridColumnMenu>` in `#toolbar`
|
|
62
|
-
| Drag columns to reorder | `columnReorderFeature` | column `reorderable: false` to lock one
|
|
63
|
-
| Drag column edges to resize | `columnResizingFeature` | `minWidth` / `maxWidth`, `resizable: false`
|
|
64
|
-
| Grouped headers ("Q1" over three columns) | `columnGroupsFeature` | column `group: 'Q1'`
|
|
65
|
-
| Rows that stay on top / bottom | `rowPinningFeature` | `v-model:pinned-rows="{ top: [id], bottom: [] }"`, `pinRow()`, `pinned-top-rows`
|
|
66
|
-
| A totals row (sum, avg, …) | `aggregationFeature` | column `aggregate: 'sum' \| 'avg' \| 'min' \| 'max' \| 'count' \| fn`; `totals` (or `'top'`)
|
|
67
|
-
| Group server data across all rows (not the page) | `serverGroupingFeature` (+ `rowGroupingFeature`, `serverDataFeature`) | return `{ groups: [{ value, count, aggregates }], total }` for `query.groupBy` / `query.groupPath`, `{ rows }` at the last level; `v-model:selected-groups`
|
|
68
|
-
| Group rows by a column ("by status, then city") | `rowGroupingFeature` | `v-model:group-by="['status', 'city']"`, `groups-expanded`; column `groupable: true` (header menu), `groupValue: (row) => …` (e.g. month); `aggregate` shows per group
|
|
69
|
-
| Download CSV / Excel, print, copy rows / cells | `exportFeature` | `grid.exportCsv()`, `getCsv()`, `exportXlsx()`, `getXlsx()`, `print()`, `copyRows()`, `@copy`; column `exportValue`, `exportable: false`
|
|
70
|
-
| Row / selection counts, sum of the selected rows | `statusBarFeature` | `status-bar` (or `{ summary: ['total'], aggregates?: ['sum', 'avg'] }`); `#status-bar="{ rowCount, selectedCount, summary, … }"`
|
|
71
|
-
|
|
|
72
|
-
|
|
|
73
|
-
|
|
|
74
|
-
|
|
|
52
|
+
| The user wants… | Feature(s) | Props / column options |
|
|
53
|
+
| ------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
54
|
+
| Click a header to sort | `sortingFeature` | column `sortable: true`; `sort-mode="client"` (or handle `v-model:sort`) |
|
|
55
|
+
| Sort by several columns ("city, then stake") | `sortingFeature` | `multi-sort`, `v-model:sorts="[{ key, dir }, …]"`; Shift-click adds a column; server: `query.sorts` |
|
|
56
|
+
| Filters per column, a filter row, quick search | `filteringFeature` | column `filterable: true` (`filter: 'text' \| 'number' \| 'date' \| 'boolean' \| 'set'`); `filter-row`; `<VGridSearch />` in `#toolbar` |
|
|
57
|
+
| Pages | `paginationFeature` | `pagination` (or `{ pageSizes: [10, 25, 50] }`), `v-model:page`, `v-model:page-size` |
|
|
58
|
+
| Backend sorting / filtering / paging | `serverDataFeature` (+ the above) | `:data-source="(query, { signal }) => Promise<{ rows, total }>"` |
|
|
59
|
+
| Checkboxes / row selection, batch actions | `selectionFeature` | `selectable` (or `'single'`), `v-model:selected`, `is-row-selectable`, `prune-selection`; `#toolbar="{ selected, selectedCount, clearSelection }"`; server data: `v-model:select-all-matching` |
|
|
60
|
+
| Nested child rows aligned to the parent's columns | `subGridsFeature` | `:sub-rows="(row) => row.children"` or `:load-sub-rows` + `:has-sub-rows` |
|
|
61
|
+
| An expandable panel under a row | — | `#detail="{ row }"` slot (`row-expandable` to limit it) |
|
|
62
|
+
| 10,000+ rows | `virtualScrollingFeature` | `:virtual="{ rowHeight: 40 }"` + bounded height |
|
|
63
|
+
| Right-click menus (cells, headers) | `menusFeature` | `:context-menu="(ctx) => MenuItem[]"` + `@context-action`; header menu is on by default |
|
|
64
|
+
| Freeze columns left / right | `columnPinningFeature` | column `pinned: 'left' \| 'right'`; on narrow grids they scroll unless `pinned-max-share` allows (default half the width) |
|
|
65
|
+
| Show / hide columns | `columnVisibilityFeature` | column `hidden: true`; `<VGridColumnMenu>` in `#toolbar` |
|
|
66
|
+
| Drag columns to reorder | `columnReorderFeature` | column `reorderable: false` to lock one |
|
|
67
|
+
| Drag column edges to resize | `columnResizingFeature` | `minWidth` / `maxWidth`, `resizable: false` |
|
|
68
|
+
| Grouped headers ("Q1" over three columns) | `columnGroupsFeature` | column `group: 'Q1'` |
|
|
69
|
+
| Rows that stay on top / bottom | `rowPinningFeature` | `v-model:pinned-rows="{ top: [id], bottom: [] }"`, `pinRow()`, `pinned-top-rows` |
|
|
70
|
+
| A totals row (sum, avg, …) | `aggregationFeature` | column `aggregate: 'sum' \| 'avg' \| 'min' \| 'max' \| 'count' \| fn`; `totals` (or `'top'`) |
|
|
71
|
+
| Group server data across all rows (not the page) | `serverGroupingFeature` (+ `rowGroupingFeature`, `serverDataFeature`) | return `{ groups: [{ value, count, aggregates }], total }` for `query.groupBy` / `query.groupPath`, `{ rows }` at the last level; `v-model:selected-groups` |
|
|
72
|
+
| Group rows by a column ("by status, then city") | `rowGroupingFeature` | `v-model:group-by="['status', 'city']"`, `groups-expanded`; column `groupable: true` (header menu), `groupValue: (row) => …` (e.g. month); `aggregate` shows per group |
|
|
73
|
+
| Download CSV / Excel, print, copy rows / cells | `exportFeature` | `grid.exportCsv()`, `getCsv()`, `exportXlsx()`, `getXlsx()`, `print()`, `copyRows()`, `@copy`; column `exportValue`, `exportable: false` |
|
|
74
|
+
| Row / selection counts, sum of the selected rows | `statusBarFeature` | `status-bar` (or `{ summary: ['total'], aggregates?: ['sum', 'avg'] }`); `#status-bar="{ rowCount, selectedCount, summary, … }"` |
|
|
75
|
+
| Edit cells in place (spreadsheet-like) | `editingFeature` (+ `keyboardNavigationFeature` for typing / Enter) | column `editable: true \| (row) => boolean`, `editor`, `editorOptions`, `validate`; `@cell-edit` (store `value`: `setCellValue(e.row, e.column, e.value)`), `:save-cell` (async, rejection = error) |
|
|
76
|
+
| Translate / reword the grid, drop built-in pieces | — | a language pack (`import { de } from '@nocopypaste/vue-grid/locales/de'`; also `fr`, `es`, `sr`, `sr-Latn`) or your own `messages` (`GridMessages`), `parts` (`GridParts`): app-wide in `createVueGrid` or per grid; slots `#load-error`, `#no-match`, `#select-all-banner` |
|
|
77
|
+
| Arrow-key navigation (ARIA grid) | `keyboardNavigationFeature` | — |
|
|
78
|
+
| Remember column layout | — | `storage="orders-grid"` (localStorage key) |
|
|
79
|
+
| Cell type (money, date, badge, link, …) | — | `renderer: currencyRenderer` etc. (list below) |
|
|
75
80
|
|
|
76
81
|
## Renderers (pick by data)
|
|
77
82
|
|
|
@@ -454,6 +459,31 @@ function onAction(e: CellActionEvent<Order>) {
|
|
|
454
459
|
</template>
|
|
455
460
|
```
|
|
456
461
|
|
|
462
|
+
### Inline editing
|
|
463
|
+
|
|
464
|
+
```ts
|
|
465
|
+
import { editingFeature, keyboardNavigationFeature, setCellValue } from '@nocopypaste/vue-grid'
|
|
466
|
+
const rows = reactive(bets) // the handler writes into them
|
|
467
|
+
const columns = [
|
|
468
|
+
col({
|
|
469
|
+
key: 'player',
|
|
470
|
+
field: 'player.name',
|
|
471
|
+
editable: true,
|
|
472
|
+
validate: (v) => (String(v).trim() ? undefined : 'Required'),
|
|
473
|
+
}),
|
|
474
|
+
col({ key: 'stake', renderer: currencyRenderer, editable: true, editorOptions: { min: 0 } }), // number
|
|
475
|
+
col({ key: 'status', renderer: statusRenderer, editable: (b) => b.status !== 'Void' }), // select
|
|
476
|
+
col({ key: 'verified', renderer: booleanRenderer, editable: true }), // flips at once
|
|
477
|
+
]
|
|
478
|
+
// <VGrid :rows :columns row-key="id" :features="[editingFeature, keyboardNavigationFeature]"
|
|
479
|
+
// @cell-edit="(e) => setCellValue(e.row, e.column, e.value)" />
|
|
480
|
+
// async: :save-cell="async (e) => { await api.save(e); setCellValue(e.row, e.column, e.value) }"
|
|
481
|
+
```
|
|
482
|
+
|
|
483
|
+
The editor comes from the renderer (number, date, datetime, select, checkbox, text) or `editor`
|
|
484
|
+
(a name or your component). Double-click / Enter / F2 / typing opens it; Enter saves, Tab moves to
|
|
485
|
+
the next editable cell, Esc cancels.
|
|
486
|
+
|
|
457
487
|
### Editable checkbox (controlled)
|
|
458
488
|
|
|
459
489
|
```ts
|
|
@@ -502,6 +532,10 @@ only sees stylesheet rules. Density:
|
|
|
502
532
|
## Pitfalls
|
|
503
533
|
|
|
504
534
|
- Nothing sorts → `sort-mode="client"` missing (or `sortingFeature` missing).
|
|
535
|
+
- An edited cell snaps back to its old value → nothing stores it: handle `@cell-edit` (or
|
|
536
|
+
`save-cell`) and write `e.value` into reactive rows (`setCellValue`); the grid never does.
|
|
537
|
+
- Typing / Enter on a cell doesn't start editing → cells only take focus with
|
|
538
|
+
`keyboardNavigationFeature`; without it, double-click.
|
|
505
539
|
- Shift-click sorts by one column only → add `multi-sort`, and bind `v-model:sorts` (not `sort`) to read every key; a `dataSource` reads `query.sorts`.
|
|
506
540
|
- Columns are squeezed / the page scrolls sideways → give `width`s (`minmax(8rem, 1fr)`); the grid
|
|
507
541
|
scrolls horizontally inside itself when columns are wider than it.
|
|
@@ -519,7 +553,11 @@ only sees stylesheet rules. Density:
|
|
|
519
553
|
(or select rows first); `exportFeature` must be registered too.
|
|
520
554
|
- An exported column of `⋯` / buttons / `[object Object]` → `exportable: false`, or `exportValue: (row) => …`.
|
|
521
555
|
- Printing the page (Ctrl+P) shows only the rows on screen, clipped to the grid → use `grid.print()`.
|
|
522
|
-
- Translating by replacing components or CSS `content` → set `messages` (every built-in text has a
|
|
556
|
+
- Translating by replacing components or CSS `content` → set `messages` (every built-in text has a
|
|
557
|
+
key); for German, French, Spanish or Serbian import the ready-made pack
|
|
558
|
+
(`@nocopypaste/vue-grid/locales/de` …) instead of writing it.
|
|
559
|
+
- Text translated but money / dates still formatted in English → a pack only translates text; set
|
|
560
|
+
`locale` too (`createVueGrid({ messages: de, locale: 'de' })`).
|
|
523
561
|
- Hiding a built-in piece with CSS → `parts: { filterButtons: false, … }` leaves it out of the DOM (and the tab order).
|
|
524
562
|
- Grouped server data shows groups of one page only → add `serverGroupingFeature` and answer `query.groupBy` with `{ groups }` (`count` per group, `total` = number of groups).
|
|
525
563
|
- A batch action on a selected server group touched only loaded rows → act on `selectedGroups` (paths) with the filters on the server.
|
|
@@ -533,7 +571,7 @@ only sees stylesheet rules. Density:
|
|
|
533
571
|
|
|
534
572
|
---
|
|
535
573
|
|
|
536
|
-
# @nocopypaste/vue-grid 0.
|
|
574
|
+
# @nocopypaste/vue-grid 0.11.0 — API reference
|
|
537
575
|
|
|
538
576
|
> Generated from the TypeScript sources (`scripts/gen-agent.mjs`). Machine-readable: `agent/api.json`, `agent/grid-config.schema.json`.
|
|
539
577
|
|
|
@@ -549,6 +587,7 @@ Opt-in: pass them as `:features="[…]"` on `<VGrid>` or once via `createVueGrid
|
|
|
549
587
|
| `columnReorderFeature` | Column reordering: drag a header (mouse, pen, touch), Alt+←/→ on a focused header, and the header menu's Move left / Move right. Columns opt out with `reorderable: false`. The order is part of `v-model:column-state` and persisted with `storage`; `<VGridColumnMenu>` works without it. | | `reorderable` |
|
|
550
588
|
| `columnResizingFeature` | Column resizing: drag a header's edge (mouse, pen, touch), use ←/→ on the focused edge (Alt+Shift+←/→ on a header with keyboard navigation), or double-click the edge to fit the content. `minWidth` / `maxWidth` bound it; columns opt out with `resizable: false`. Widths are kept in `columnState.widths` and persisted with `storage`. The header menu gains Fit width / Reset width. | | `maxWidth` `resizable` |
|
|
551
589
|
| `columnVisibilityFeature` | Column visibility: `hidden: true` columns, `columnState.hidden` (persisted with `storage`), the header menu's Hide column item and `<VGridColumnMenu>`'s checkboxes. Columns opt out with `hideable: false`. Without it, every column shows. | | `hidden` `hideable` |
|
|
590
|
+
| `editingFeature` | | `saveCell` | `editable` `editor` `editorOptions` `validate` |
|
|
552
591
|
| `exportFeature` | CSV and Excel export and copying: `grid.exportCsv()` downloads the filtered, sorted rows as a CSV file, `grid.getCsv()` returns the text, `grid.exportXlsx()` / `grid.getXlsx()` write an Excel workbook with typed cells (the writer loads on demand), `grid.print()` prints every matching row as a table with the header on each page, `grid.copyRows()` copies rows as tab-separated text, and Ctrl/⌘+C copies the selected rows, else the focused cell, as displayed. Columns can set `exportValue` and `exportable: false`. Without it those methods only warn. | | `exportValue` `exportable` |
|
|
553
592
|
| `filteringFeature` | Filtering: header funnels with typed filter popovers on `filterable` columns, the filter row, `<VGridSearch>`, the filter items of the header menu, `v-model:filters` and filter persistence. The popover body and the filter-row editors load on demand (own chunks). | `filterMode` `filterRow` `filterStorage` `noMatchText` `filters` | `filterable` `filter` `filterValue` `filterFn` `filterComponent` `searchable` |
|
|
554
593
|
| `keyboardNavigationFeature` | Keyboard navigation (the ARIA grid pattern): the grid is one tab stop, arrow keys / Home / End / PageUp / PageDown move between cells, Enter activates a cell's control, Space selects a row, →/← expand and collapse, Alt+←/→ move a column, ContextMenu / Shift+F10 open the cell menu. Without it the grid is an ARIA `table`: its own controls (sort buttons, expanders, checkboxes, filter buttons) sit in the normal Tab order instead. | | |
|
|
@@ -575,6 +614,7 @@ Opt-in: pass them as `:features="[…]"` on `<VGrid>` or once via `createVueGrid
|
|
|
575
614
|
| `dataSource` | `DataSource<T>` | | `serverDataFeature` | Server data: called with the current query (sort, filters, search, page) whenever it changes. The grid cancels superseded requests, shows loading and errors, and sorts / filters / pages nothing itself. |
|
|
576
615
|
| `pagination` | `boolean \| PaginationOptions` | `false` | `paginationFeature` | Built-in pagination under the grid (server-side with `dataSource`, client-side otherwise). |
|
|
577
616
|
| `statusBar` | `boolean \| StatusBarOptions` | | `statusBarFeature` | A status bar under the grid (status bar feature): rows that pass the filters ("84 of 200 rows"), selected rows, active filters with Clear; `{ summary: ['total'] }` adds the sum and average of those columns over the selected rows. `#status-bar` replaces its content. |
|
|
617
|
+
| `saveCell` | `(event: CellEditEvent<T>) => unknown` | | `editingFeature` | Saves an edited cell (editing feature), after `cell-edit`: return a Promise and the cell shows it saving; a rejection keeps the editor open with the error's message. Without it, `cell-edit` alone carries the change. |
|
|
578
618
|
| `messages` | `GridMessages` | | | Built-in text (translations, wording), over `createVueGrid({ messages })`. |
|
|
579
619
|
| `parts` | `GridParts` | | | Built-in parts to leave out (`{ progressBar: false }`), over `createVueGrid({ parts })`. |
|
|
580
620
|
| `sortMode` | `'controlled' \| 'client'` | `'controlled'` | | `controlled` (default): a header click only updates `v-model:sort` (sort on the server or in your own code). `client`: the grid sorts the rows itself. Ignored with `dataSource`. |
|
|
@@ -642,6 +682,7 @@ Opt-in: pass them as `:features="[…]"` on `<VGrid>` or once via `createVueGrid
|
|
|
642
682
|
| `row-click` | `[row: T, event: MouseEvent \| KeyboardEvent]` | A row was clicked (not on a link, button or input inside it, nor a `clickable` column). |
|
|
643
683
|
| `cell-click` | `[event: CellClickEvent<T>]` | A cell of a `clickable: true` column was clicked. |
|
|
644
684
|
| `cell-action` | `[event: CellActionEvent<T>]` | A renderer emitted an action (buttons, toggles, menus, edit, copy). |
|
|
685
|
+
| `cell-edit` | `[event: CellEditEvent<T>]` | A cell was edited (editing feature): update your data with `value`. The grid doesn't. |
|
|
645
686
|
| `sub-rows-error` | `[event: { row: T; error: unknown }]` | `loadSubRows` rejected for a row. |
|
|
646
687
|
| `context-action` | `[event: ContextActionEvent<T>]` | An item of the body-cell context menu was chosen. |
|
|
647
688
|
| `header-action` | `[event: HeaderActionEvent<T>]` | A custom item of the header menu was chosen (built-in items act by themselves). |
|
|
@@ -688,6 +729,8 @@ Opt-in: pass them as `:features="[…]"` on `<VGrid>` or once via `createVueGrid
|
|
|
688
729
|
| `exportXlsx` | `Promise<void>` | | Downloads the rows as an Excel file (`filename`, default `export.xlsx`). Export feature. |
|
|
689
730
|
| `print` | `Promise<void>` | | Prints the rows as a table (the browser's print dialog): the filtered, sorted rows on every page (not just those in view), as the cells show them, the header repeated on each printed page, numbers right-aligned, the totals in bold. Resolves when printing is over. Export feature. |
|
|
690
731
|
| `copyRows` | `Promise<boolean>` | | Copies rows to the clipboard as tab-separated text (pastes as cells into spreadsheets): the selected rows by default, as displayed, no header. Resolves `false` if nothing was copied. Export feature. |
|
|
732
|
+
| `startEdit` | `boolean` | | Opens the editor of a cell (editing feature), if the column is `editable` for that row and the row is on screen. Returns whether it opened. |
|
|
733
|
+
| `stopEdit` | `void` | | Closes the open editor: saves its value, or with `cancel` drops it. Editing feature. |
|
|
691
734
|
|
|
692
735
|
## `ColumnDef<T>`
|
|
693
736
|
|
|
@@ -727,6 +770,10 @@ Opt-in: pass them as `:features="[…]"` on `<VGrid>` or once via `createVueGrid
|
|
|
727
770
|
| `groupValue` | `(row: T) => unknown` | `rowGroupingFeature` | The value rows are grouped by (row grouping feature), e.g. `(row) => row.placedAt.slice(0, 7)` for months. Default: the cell value, shown with the column's renderer; a `groupValue` is shown as text (or with the `#group-<key>` slot). |
|
|
728
771
|
| `exportValue` | `(row: T) => unknown` | `exportFeature` | The value exports and copying use (export feature), e.g. a plain id for a link or an object. Wins over the cell value and the renderer's text. |
|
|
729
772
|
| `exportable` | `boolean` | `exportFeature` | Included in CSV exports and copied rows (export feature)? Default `true`; set `false` on action columns. |
|
|
773
|
+
| `editable` | `boolean \| ((row: T) => boolean)` | `editingFeature` | Cells can be edited in place (editing feature): `true`, or per row. Double-click, Enter or F2 on a focused cell, or typing, opens the editor; the grid emits `cell-edit` and your handler updates the data (the grid never changes rows itself). |
|
|
774
|
+
| `editor` | `EditorName \| Component` | `editingFeature` | The editor (editing feature): `text`, `number`, `date`, `datetime`, `select`, `checkbox`, or your own component (`CellEditorProps`). Default from the renderer: numbers and money → number, dates → date, booleans → checkbox, status / chip → select, else text. |
|
|
775
|
+
| `editorOptions` | `EditorOptions` | `editingFeature` | Options of the editor: the choices of a select, a number's `min` / `max`, a `placeholder`. |
|
|
776
|
+
| `validate` | `(value: unknown, row: T) => string \| null \| undefined \| void` | `editingFeature` | Checks an edited value before it is saved (editing feature): return an error message to keep the editor open with it, or nothing to accept the value. |
|
|
730
777
|
| `cellClass` | `ClassValue \| ((row: T) => ClassValue)` | | Extra classes for the column's body cells (or a function of the row). |
|
|
731
778
|
| `headerClass` | `ClassValue` | | Extra classes for the column's header cell. |
|
|
732
779
|
|
|
@@ -1340,6 +1387,7 @@ an opt-in feature:
|
|
|
1340
1387
|
| `serverGroupingFeature` | With a `data-source`: groups from the server (`query.groupBy` / `groupPath`), each one's contents loaded on expand, groups selected by query (`v-model:selected-groups`). See [Server-side grouping](#server-side-grouping) |
|
|
1341
1388
|
| `exportFeature` | `exportCsv()` / `getCsv()`, `exportXlsx()` / `getXlsx()` (Excel, typed cells), `print()` (every row, header on each page), `copyRows()`, Ctrl/⌘+C for the selected rows or the focused cell, the `copy` event; column `exportValue` / `exportable` |
|
|
1342
1389
|
| `statusBarFeature` | `status-bar`: a bar under the grid with the rows that pass the filters, the selected rows, the active filters (with Clear), and `{ summary: [keys] }` columns' sum and average over the selected rows; the `#status-bar` slot |
|
|
1390
|
+
| `editingFeature` | `editable` columns: an editor in the cell (text, number, date, select, checkbox, or your own) on double-click, Enter / F2 or typing; `cell-edit`, and `save-cell` for async saves. See [Inline editing](#inline-editing) |
|
|
1343
1391
|
|
|
1344
1392
|
```ts
|
|
1345
1393
|
// per grid
|
|
@@ -1383,34 +1431,35 @@ what you import.
|
|
|
1383
1431
|
|
|
1384
1432
|
| Import (minified / gzip, Vue excluded) | Initial chunk |
|
|
1385
1433
|
| ---------------------------------------------------------------------------- | ------------------ |
|
|
1386
|
-
| `VGrid` (no features) |
|
|
1387
|
-
| `VGrid` + `sortingFeature` |
|
|
1388
|
-
| `VGrid` + `filteringFeature` |
|
|
1389
|
-
| `VGrid` + `serverDataFeature` | 45.
|
|
1390
|
-
| `VGrid` + `paginationFeature` |
|
|
1391
|
-
| `VGrid` + `selectionFeature` |
|
|
1392
|
-
| `VGrid` + `subGridsFeature` | 46.
|
|
1393
|
-
| `VGrid` + `menusFeature` | 55.
|
|
1394
|
-
| `VGrid` + `columnReorderFeature` |
|
|
1395
|
-
| `VGrid` + `columnPinningFeature` |
|
|
1396
|
-
| `VGrid` + `virtualScrollingFeature` |
|
|
1397
|
-
| `VGrid` + `columnVisibilityFeature` |
|
|
1398
|
-
| `VGrid` + `keyboardNavigationFeature` |
|
|
1399
|
-
| `VGrid` + `columnResizingFeature` | 47.
|
|
1400
|
-
| `VGrid` + `columnGroupsFeature` | 45.
|
|
1401
|
-
| `VGrid` + `rowPinningFeature` |
|
|
1402
|
-
| `VGrid` + `aggregationFeature` |
|
|
1403
|
-
| `VGrid` + `rowGroupingFeature` |
|
|
1404
|
-
| `VGrid` + `exportFeature` |
|
|
1405
|
-
| `VGrid` + `statusBarFeature` | 46.
|
|
1406
|
-
| `VGrid` + `serverGroupingFeature` |
|
|
1407
|
-
| `VGrid` + `
|
|
1408
|
-
| `VGrid` + `
|
|
1409
|
-
| `VGrid` + `
|
|
1434
|
+
| `VGrid` (no features) | 44.5 kB / 15.3 kB |
|
|
1435
|
+
| `VGrid` + `sortingFeature` | 47.2 kB / 16.3 kB |
|
|
1436
|
+
| `VGrid` + `filteringFeature` | 55.2 kB / 19.1 kB |
|
|
1437
|
+
| `VGrid` + `serverDataFeature` | 45.9 kB / 15.9 kB |
|
|
1438
|
+
| `VGrid` + `paginationFeature` | 44.6 kB / 15.3 kB |
|
|
1439
|
+
| `VGrid` + `selectionFeature` | 48.6 kB / 16.7 kB |
|
|
1440
|
+
| `VGrid` + `subGridsFeature` | 46.8 kB / 16.1 kB |
|
|
1441
|
+
| `VGrid` + `menusFeature` | 55.7 kB / 19.1 kB |
|
|
1442
|
+
| `VGrid` + `columnReorderFeature` | 48.1 kB / 16.5 kB |
|
|
1443
|
+
| `VGrid` + `columnPinningFeature` | 47.4 kB / 16.3 kB |
|
|
1444
|
+
| `VGrid` + `virtualScrollingFeature` | 50.2 kB / 17.5 kB |
|
|
1445
|
+
| `VGrid` + `columnVisibilityFeature` | 44.6 kB / 15.3 kB |
|
|
1446
|
+
| `VGrid` + `keyboardNavigationFeature` | 47.2 kB / 16.3 kB |
|
|
1447
|
+
| `VGrid` + `columnResizingFeature` | 47.7 kB / 16.5 kB |
|
|
1448
|
+
| `VGrid` + `columnGroupsFeature` | 45.8 kB / 15.7 kB |
|
|
1449
|
+
| `VGrid` + `rowPinningFeature` | 49.4 kB / 16.6 kB |
|
|
1450
|
+
| `VGrid` + `aggregationFeature` | 49.6 kB / 16.7 kB |
|
|
1451
|
+
| `VGrid` + `rowGroupingFeature` | 55.3 kB / 18.8 kB |
|
|
1452
|
+
| `VGrid` + `exportFeature` | 49.4 kB / 17.2 kB |
|
|
1453
|
+
| `VGrid` + `statusBarFeature` | 46.9 kB / 16.2 kB |
|
|
1454
|
+
| `VGrid` + `serverGroupingFeature` | 47.6 kB / 16.4 kB |
|
|
1455
|
+
| `VGrid` + `editingFeature` | 48.8 kB / 17.0 kB |
|
|
1456
|
+
| `VGrid` + `allFeatures` + `VGridSearch` | 123.4 kB / 41.7 kB |
|
|
1457
|
+
| `VGrid` + `currencyRenderer` | 45.8 kB / 15.7 kB |
|
|
1458
|
+
| `VGrid` + `VGridPagination` + `VGridColumnMenu` | 51.7 kB / 17.7 kB |
|
|
1410
1459
|
| `sortRows` only | 0.7 kB / 0.4 kB |
|
|
1411
1460
|
| `toCsv` only | 1.1 kB / 0.6 kB |
|
|
1412
|
-
| everything |
|
|
1413
|
-
| `validateGridConfig` (`@nocopypaste/vue-grid/agent`, never in an app bundle) |
|
|
1461
|
+
| everything | 177.3 kB / 57.2 kB |
|
|
1462
|
+
| `validateGridConfig` (`@nocopypaste/vue-grid/agent`, never in an app bundle) | 75.6 kB / 20.7 kB |
|
|
1414
1463
|
|
|
1415
1464
|
With `filteringFeature`, the filter popover body and the filter-row editors are **on-demand
|
|
1416
1465
|
chunks**: they load the first time a popover opens or `filter-row` is on. With
|
|
@@ -1479,6 +1528,7 @@ chunks that on-demand imports share with the entry, even when nothing uses them.
|
|
|
1479
1528
|
| `emptyText` | `string` | `messages.empty` | Shown when there are no rows (`No data to show.`). |
|
|
1480
1529
|
| `ariaLabel` | `string` | — | |
|
|
1481
1530
|
| `statusBar` | `boolean \| StatusBarOptions` | `false` | A status bar under the grid (status bar feature): counts, and `{ summary: [keys] }` sums of the selected rows. See [Status bar](#status-bar). |
|
|
1531
|
+
| `saveCell` | `(event: CellEditEvent) => unknown` | — | Saves an edited cell (editing feature): return a Promise and the cell shows it saving; a rejection keeps the editor open with its message. See [Inline editing](#inline-editing). |
|
|
1482
1532
|
| `messages` | `GridMessages` | — | Built-in text (translations, wording), over `createVueGrid({ messages })`. See [Text and parts](#text-and-parts). |
|
|
1483
1533
|
| `parts` | `GridParts` | — | Built-in parts to leave out (`{ filterButtons: false }`), over `createVueGrid({ parts })`. |
|
|
1484
1534
|
| `contextMenu` | `(ctx: { row, rowKey, column, value }) => MenuItem[] \| null` | — | Right-click menu for body cells. Needs `menusFeature`. |
|
|
@@ -1492,6 +1542,7 @@ chunks that on-demand imports share with the entry, even when nothing uses them.
|
|
|
1492
1542
|
`query-change(query: GridQuery)` (sort + filters + page as one object, on mount and on every real change) ·
|
|
1493
1543
|
`copy({ kind, text, rows, columns })` (rows or a cell were copied: `exportFeature`) ·
|
|
1494
1544
|
`load-error(error)` (a `dataSource` call failed) ·
|
|
1545
|
+
`cell-edit({ row, rowKey, column, value, oldValue })` (an edited cell: `editingFeature`; update your data) ·
|
|
1495
1546
|
plus the `update:*` events of every `v-model`.
|
|
1496
1547
|
|
|
1497
1548
|
Clicks on links, buttons and inputs inside a cell never trigger `row-click`.
|
|
@@ -1518,6 +1569,7 @@ grid.value?.clearSelection() // selectionFeature: clears the selection, "all mat
|
|
|
1518
1569
|
grid.value?.reloadSubRows('c2') // forget lazily loaded children (of one row, or all): they load again
|
|
1519
1570
|
grid.value?.pinRow(42, 'top') // pin a row above the body ('bottom' below it, null to unpin): rowPinningFeature
|
|
1520
1571
|
grid.value?.exportCsv({ filename: 'orders.csv' }) / getCsv() / copyRows() // exportFeature, see Export and copy
|
|
1572
|
+
grid.value?.startEdit(42, 'stake') / stopEdit() // editingFeature: open a cell's editor; save (or stopEdit(true): drop) the open one
|
|
1521
1573
|
```
|
|
1522
1574
|
|
|
1523
1575
|
`reload()` also forgets lazily loaded children, as does passing a different `load-sub-rows`
|
|
@@ -1582,6 +1634,10 @@ animate on the compositor (GPU): a busy live feed costs the main thread about a
|
|
|
1582
1634
|
groupValue?: (row) => unknown // what rows are grouped by (default: the cell value), e.g. the month of a date
|
|
1583
1635
|
exportValue?: (row) => unknown // what CSV exports and copying use (exportFeature), e.g. an id instead of a link
|
|
1584
1636
|
exportable?: boolean // in exports and copied rows (default true); false for action columns
|
|
1637
|
+
editable?: boolean | ((row) => boolean) // edit cells in place (editingFeature)
|
|
1638
|
+
editor?: 'text' | 'number' | 'date' | 'datetime' | 'select' | 'checkbox' | Component // default from the renderer
|
|
1639
|
+
editorOptions?: { options?, min?, max?, placeholder?, maxLength? } // a select's choices, a number's range…
|
|
1640
|
+
validate?: (value, row) => string | void // an error message keeps the editor open
|
|
1585
1641
|
cellClass?: ClassValue | ((row) => ClassValue); headerClass?: ClassValue
|
|
1586
1642
|
}
|
|
1587
1643
|
```
|
|
@@ -2276,6 +2332,65 @@ await grid.value?.print({ title: 'Orders', totals: true, landscape: true })
|
|
|
2276
2332
|
(a heading, also the document title) and `landscape`.
|
|
2277
2333
|
- It resolves when printing is over. The printing code (1.1 kB gzip) loads on first use.
|
|
2278
2334
|
|
|
2335
|
+
## Inline editing
|
|
2336
|
+
|
|
2337
|
+
`editingFeature` edits cells in place. Mark columns `editable` (or `(row) => boolean`). A cell opens
|
|
2338
|
+
its editor on double-click, on Enter or F2 when focused, or when you start typing on it (the
|
|
2339
|
+
keys replace the value). **Enter** saves, **Tab** / **Shift+Tab** save and edit the next / previous
|
|
2340
|
+
editable cell, **Esc** cancels, and clicking elsewhere saves.
|
|
2341
|
+
|
|
2342
|
+
The editor follows the column's renderer: numbers and money → a number input, `date` → a date
|
|
2343
|
+
picker, `datetime` → date and time, `boolean` → it flips at once (no editor), `status` / `chip`
|
|
2344
|
+
→ a select of the column's values, anything else → text. `editor` picks another, or your own
|
|
2345
|
+
component (`CellEditorProps`: `v-model`, emit `commit` / `cancel`; Enter, Tab and Esc work around it).
|
|
2346
|
+
|
|
2347
|
+
The grid never changes your rows: it emits `cell-edit` with the typed `value` (a number, a date
|
|
2348
|
+
string in the cell's own format, a select's value) and `oldValue`, and your handler stores it.
|
|
2349
|
+
`setCellValue(row, column, value)` writes along the column's `field` path.
|
|
2350
|
+
|
|
2351
|
+
```vue
|
|
2352
|
+
<script setup lang="ts">
|
|
2353
|
+
import { VGrid, editingFeature, setCellValue, type CellEditEvent } from '@nocopypaste/vue-grid'
|
|
2354
|
+
|
|
2355
|
+
const rows = reactive(await loadBets())
|
|
2356
|
+
const columns = [
|
|
2357
|
+
col({
|
|
2358
|
+
key: 'player',
|
|
2359
|
+
field: 'player.name',
|
|
2360
|
+
editable: true,
|
|
2361
|
+
validate: (v) => (String(v).trim() ? undefined : 'A player needs a name.'),
|
|
2362
|
+
}),
|
|
2363
|
+
col({ key: 'stake', renderer: currencyRenderer, editable: true, editorOptions: { min: 0 } }),
|
|
2364
|
+
col({
|
|
2365
|
+
key: 'status',
|
|
2366
|
+
renderer: statusRenderer,
|
|
2367
|
+
editable: (bet) => bet.status !== 'Void',
|
|
2368
|
+
editorOptions: { options: ['Open', 'Won', 'Lost', 'Void'] },
|
|
2369
|
+
}),
|
|
2370
|
+
col({ key: 'verified', renderer: booleanRenderer, editable: true }),
|
|
2371
|
+
]
|
|
2372
|
+
|
|
2373
|
+
// optional: an async save. The cell shows it saving; a rejection keeps the editor open with the message.
|
|
2374
|
+
async function saveCell(e: CellEditEvent<Bet>) {
|
|
2375
|
+
await api.patch(`/bets/${e.rowKey}`, { [e.column.key]: e.value }) // throws on a 4xx
|
|
2376
|
+
setCellValue(e.row, e.column, e.value)
|
|
2377
|
+
}
|
|
2378
|
+
</script>
|
|
2379
|
+
|
|
2380
|
+
<template>
|
|
2381
|
+
<VGrid :rows :columns row-key="id" :save-cell="saveCell" :features="[editingFeature]" />
|
|
2382
|
+
<!-- or without a save function: @cell-edit="(e) => setCellValue(e.row, e.column, e.value)" -->
|
|
2383
|
+
</template>
|
|
2384
|
+
```
|
|
2385
|
+
|
|
2386
|
+
`validate` returns a message to keep the editor open with it (shown below the cell, and as the
|
|
2387
|
+
input's description for screen readers); a number outside `min` / `max` or not a number is refused
|
|
2388
|
+
the same way. One cell edits at a time. With `keyboardNavigationFeature` cells take focus, so typing
|
|
2389
|
+
and Enter / F2 work; without it, double-click. Pinned rows and group rows aren't editable. The
|
|
2390
|
+
editor's code loads on demand, while the browser is idle, once a grid has an editable column.
|
|
2391
|
+
`grid.startEdit(rowKey, columnKey)` opens an editor from code, `grid.stopEdit()` closes it. Its
|
|
2392
|
+
text (`Edit {column}`, `Enter a number.`, `Saving…`) is in `messages`.
|
|
2393
|
+
|
|
2279
2394
|
## Status bar
|
|
2280
2395
|
|
|
2281
2396
|
`statusBarFeature` adds a bar under the grid, like a spreadsheet's:
|
|
@@ -2540,6 +2655,30 @@ A grid's own `:messages` win over the app's, and props that name a text (`empty-
|
|
|
2540
2655
|
`<VGridPagination>`, `<VGridSearch>`, `<VGridColumnMenu>` and `<VGridMenu>` use the app's messages on
|
|
2541
2656
|
their own too. Every key, with its English default, is in the API reference (`GridMessages`).
|
|
2542
2657
|
|
|
2658
|
+
**Language packs.** Ready-made, complete translations, each its own import (so only the ones you
|
|
2659
|
+
import are bundled, about 2 kB gzipped each):
|
|
2660
|
+
|
|
2661
|
+
| Import | Export | Language |
|
|
2662
|
+
| --------------------------------------- | -------- | ---------------------------------------------------- |
|
|
2663
|
+
| `@nocopypaste/vue-grid/locales/de` | `de` | German |
|
|
2664
|
+
| `@nocopypaste/vue-grid/locales/fr` | `fr` | French |
|
|
2665
|
+
| `@nocopypaste/vue-grid/locales/es` | `es` | Spanish |
|
|
2666
|
+
| `@nocopypaste/vue-grid/locales/sr` | `sr` | Serbian, Cyrillic |
|
|
2667
|
+
| `@nocopypaste/vue-grid/locales/sr-Latn` | `srLatn` | Serbian, Latin |
|
|
2668
|
+
| `@nocopypaste/vue-grid/locales/en` | `en` | English (the built-in text, a template for your own) |
|
|
2669
|
+
|
|
2670
|
+
```ts
|
|
2671
|
+
import { de } from '@nocopypaste/vue-grid/locales/de'
|
|
2672
|
+
|
|
2673
|
+
app.use(createVueGrid({ messages: de })) // or per grid: <VGrid :messages="de" />
|
|
2674
|
+
// change a few texts on top: { ...de, total: 'Gesamt' }
|
|
2675
|
+
```
|
|
2676
|
+
|
|
2677
|
+
Counts follow the language's plural rules (`1 red`, `2 reda`, `5 redova`). A pack only translates
|
|
2678
|
+
text: money, numbers and dates follow `locale` (`<VGrid locale="de">` or `createVueGrid({ locale })`).
|
|
2679
|
+
Text that takes a count gets the number too (`rowCount(shown, total, count, totalCount)`,
|
|
2680
|
+
`selectedCount(count, all, amount)`, `sortPosition(position, dir, count)`), for your own plurals.
|
|
2681
|
+
|
|
2543
2682
|
**Parts.** `GridParts` turns off what a feature adds, each on by default; app-wide in
|
|
2544
2683
|
`createVueGrid({ parts })`, per grid with `:parts`:
|
|
2545
2684
|
|
package/llms.txt
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @nocopypaste/vue-grid
|
|
2
2
|
|
|
3
|
-
> A Vue 3 data grid laid out with CSS Grid and `subgrid`. A plain grid is a read-only table (15.
|
|
3
|
+
> A Vue 3 data grid laid out with CSS Grid and `subgrid`. A plain grid is a read-only table (15.3 kB gzip); sorting, filtering, server data, pagination, selection, sub-grids, menus, column pinning / reordering / resizing / visibility / groups, pinned rows, totals, row grouping (also on the server), inline cell editing, CSV and Excel export, printing, copying, a status bar, virtual scrolling and keyboard navigation are opt-in features, and 29 cell renderers are opt-in imports. Every built-in text is translatable (`messages`), with ready-made language packs (`@nocopypaste/vue-grid/locales/de`, `fr`, `es`, `sr`, `sr-Latn`), with ready-made language packs (`@nocopypaste/vue-grid/locales/de`, `fr`, `es`, `sr`, `sr-Latn`) and every piece a feature adds can be turned off (`parts`). Typed end to end, accessible, themeable with CSS variables, mobile and touch ready.
|
|
4
4
|
|
|
5
5
|
Read AGENTS.md first: it lists the rules that cause silent bugs when skipped (register features, pass renderer definitions, `sort-mode="client"`, bounded height), a "which feature for what" table and copy-paste recipes. Validate a grid config with `validateGridConfig()` from `@nocopypaste/vue-grid/agent`.
|
|
6
6
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nocopypaste/vue-grid",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"description": "CSS-Grid based data grid for Vue 3 with opt-in features, pluggable cell renderers, sub-grids and CSS-variable theming — documented for coding agents (AGENTS.md, llms.txt, JSON Schema, validator).",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -43,6 +43,10 @@
|
|
|
43
43
|
"types": "./dist/types/agent/index.d.ts",
|
|
44
44
|
"import": "./dist/agent/index.js"
|
|
45
45
|
},
|
|
46
|
+
"./locales/*": {
|
|
47
|
+
"types": "./dist/types/locales/*.d.ts",
|
|
48
|
+
"import": "./dist/locales/*.js"
|
|
49
|
+
},
|
|
46
50
|
"./agent/api.json": "./agent/api.json",
|
|
47
51
|
"./agent/grid-config.schema.json": "./agent/grid-config.schema.json",
|
|
48
52
|
"./AGENTS.md": "./AGENTS.md",
|