@nocopypaste/vue-grid 0.10.0 → 0.12.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 +56 -29
- package/CHANGELOG.md +31 -0
- package/README.md +114 -29
- package/agent/api.json +43 -1
- package/agent/api.md +7 -1
- package/agent/grid-config.schema.json +8 -0
- package/dist/agent/api.js +40 -1
- package/dist/agent/requirements.js +3 -1
- 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 +320 -288
- 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 +15 -8
- package/dist/components/VGridCell.vue_vue_type_script_setup_true_lang.js.map +1 -1
- 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 +29 -22
- package/dist/components/VGridStatusBar.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/composables/useCellRange.js +206 -0
- package/dist/composables/useCellRange.js.map +1 -0
- package/dist/composables/useStatusBar.js +17 -0
- package/dist/composables/useStatusBar.js.map +1 -1
- package/dist/core.css +1 -1
- package/dist/features/index.js +23 -21
- package/dist/features/index.js.map +1 -1
- package/dist/features/rangeSelection.js +9 -0
- package/dist/features/rangeSelection.js.map +1 -0
- package/dist/index.js +12 -11
- package/dist/internal/context.js.map +1 -1
- package/dist/internal/features.js.map +1 -1
- package/dist/locales/de.js +137 -0
- package/dist/locales/de.js.map +1 -0
- package/dist/locales/en.js +137 -0
- package/dist/locales/en.js.map +1 -0
- package/dist/locales/es.js +155 -0
- package/dist/locales/es.js.map +1 -0
- package/dist/locales/fr.js +155 -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 +140 -0
- package/dist/locales/sr-Latn.js.map +1 -0
- package/dist/locales/sr.js +140 -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 +14 -2
- package/dist/types/composables/useCellRange.d.ts +72 -0
- package/dist/types/composables/useStatusBar.d.ts +7 -0
- package/dist/types/features/index.d.ts +2 -1
- package/dist/types/features/rangeSelection.d.ts +9 -0
- package/dist/types/internal/context.d.ts +2 -0
- package/dist/types/internal/features.d.ts +2 -1
- package/dist/types/locales/de.d.ts +125 -0
- package/dist/types/locales/en.d.ts +128 -0
- package/dist/types/locales/es.d.ts +125 -0
- package/dist/types/locales/fr.d.ts +125 -0
- package/dist/types/locales/plural.d.ts +11 -0
- package/dist/types/locales/sr-Latn.d.ts +125 -0
- package/dist/types/locales/sr.d.ts +125 -0
- package/dist/types/types.d.ts +67 -10
- package/dist/vue-grid.css +1 -1
- package/llms-full.txt +177 -59
- package/llms.txt +1 -1
- package/package.json +5 -1
package/AGENTS.md
CHANGED
|
@@ -49,34 +49,35 @@ runs in the [live examples](https://eboye.github.io/eboye-vue-grid/), each with
|
|
|
49
49
|
|
|
50
50
|
## Which feature for what
|
|
51
51
|
|
|
52
|
-
| The user wants… | Feature(s)
|
|
53
|
-
| ------------------------------------------------- |
|
|
54
|
-
| Click a header to sort | `sortingFeature`
|
|
55
|
-
| Sort by several columns ("city, then stake") | `sortingFeature`
|
|
56
|
-
| Filters per column, a filter row, quick search | `filteringFeature`
|
|
57
|
-
| Pages | `paginationFeature`
|
|
58
|
-
| Backend sorting / filtering / paging | `serverDataFeature` (+ the above)
|
|
59
|
-
| Checkboxes / row selection, batch actions | `selectionFeature`
|
|
60
|
-
| Nested child rows aligned to the parent's columns | `subGridsFeature`
|
|
61
|
-
| An expandable panel under a row | —
|
|
62
|
-
| 10,000+ rows | `virtualScrollingFeature`
|
|
63
|
-
| Right-click menus (cells, headers) | `menusFeature`
|
|
64
|
-
| Freeze columns left / right | `columnPinningFeature`
|
|
65
|
-
| Show / hide columns | `columnVisibilityFeature`
|
|
66
|
-
| Drag columns to reorder | `columnReorderFeature`
|
|
67
|
-
| Drag column edges to resize | `columnResizingFeature`
|
|
68
|
-
| Grouped headers ("Q1" over three columns) | `columnGroupsFeature`
|
|
69
|
-
| Rows that stay on top / bottom | `rowPinningFeature`
|
|
70
|
-
| A totals row (sum, avg, …) | `aggregationFeature`
|
|
71
|
-
| Group server data across all rows (not the page) | `serverGroupingFeature` (+ `rowGroupingFeature`, `serverDataFeature`)
|
|
72
|
-
| Group rows by a column ("by status, then city") | `rowGroupingFeature`
|
|
73
|
-
| Download CSV / Excel, print, copy rows / cells | `exportFeature`
|
|
74
|
-
| Row / selection counts, sum of the selected rows | `statusBarFeature`
|
|
75
|
-
| Edit cells in place (spreadsheet-like) | `editingFeature` (+ `keyboardNavigationFeature` for typing / Enter)
|
|
76
|
-
|
|
|
77
|
-
|
|
|
78
|
-
|
|
|
79
|
-
|
|
|
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
|
+
| Select a block of cells, copy it, add it up | `rangeSelectionFeature` (+ `keyboardNavigationFeature`, `statusBarFeature`) | `range-selection`, `v-model:range="{ start: { rowKey, columnKey }, end }"`; `@copy` (`kind: 'range'`), `copyRange()`, `getRangeValues()`, `selectRange()` |
|
|
77
|
+
| 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` |
|
|
78
|
+
| Arrow-key navigation (ARIA grid) | `keyboardNavigationFeature` | — |
|
|
79
|
+
| Remember column layout | — | `storage="orders-grid"` (localStorage key) |
|
|
80
|
+
| Cell type (money, date, badge, link, …) | — | `renderer: currencyRenderer` etc. (list below) |
|
|
80
81
|
|
|
81
82
|
## Renderers (pick by data)
|
|
82
83
|
|
|
@@ -484,6 +485,24 @@ The editor comes from the renderer (number, date, datetime, select, checkbox, te
|
|
|
484
485
|
(a name or your component). Double-click / Enter / F2 / typing opens it; Enter saves, Tab moves to
|
|
485
486
|
the next editable cell, Esc cancels.
|
|
486
487
|
|
|
488
|
+
### Cell-range selection
|
|
489
|
+
|
|
490
|
+
```vue
|
|
491
|
+
<VGrid
|
|
492
|
+
v-model:range="range"
|
|
493
|
+
:rows
|
|
494
|
+
:columns
|
|
495
|
+
row-key="id"
|
|
496
|
+
range-selection
|
|
497
|
+
status-bar
|
|
498
|
+
:features="[rangeSelectionFeature, keyboardNavigationFeature, statusBarFeature]"
|
|
499
|
+
/>
|
|
500
|
+
<!-- drag / Shift+click / Shift+arrows select; Ctrl/⌘+C copies tab-separated; the bar shows sum and average -->
|
|
501
|
+
```
|
|
502
|
+
|
|
503
|
+
`range` is `{ start, end }` (each `{ rowKey, columnKey }`) or null; it is not row selection
|
|
504
|
+
(`selected`), and both can be on.
|
|
505
|
+
|
|
487
506
|
### Editable checkbox (controlled)
|
|
488
507
|
|
|
489
508
|
```ts
|
|
@@ -534,6 +553,10 @@ only sees stylesheet rules. Density:
|
|
|
534
553
|
- Nothing sorts → `sort-mode="client"` missing (or `sortingFeature` missing).
|
|
535
554
|
- An edited cell snaps back to its old value → nothing stores it: handle `@cell-edit` (or
|
|
536
555
|
`save-cell`) and write `e.value` into reactive rows (`setCellValue`); the grid never does.
|
|
556
|
+
- Dragging across cells selects text, not a range → add `range-selection` (and
|
|
557
|
+
`rangeSelectionFeature`); `selectable` only selects whole rows.
|
|
558
|
+
- Building copy-a-block by hand from `selected` rows and a column picker → `range-selection` copies
|
|
559
|
+
the block (Ctrl/⌘+C or `copyRange()`), as displayed and tab-separated.
|
|
537
560
|
- Typing / Enter on a cell doesn't start editing → cells only take focus with
|
|
538
561
|
`keyboardNavigationFeature`; without it, double-click.
|
|
539
562
|
- 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`.
|
|
@@ -553,7 +576,11 @@ only sees stylesheet rules. Density:
|
|
|
553
576
|
(or select rows first); `exportFeature` must be registered too.
|
|
554
577
|
- An exported column of `⋯` / buttons / `[object Object]` → `exportable: false`, or `exportValue: (row) => …`.
|
|
555
578
|
- Printing the page (Ctrl+P) shows only the rows on screen, clipped to the grid → use `grid.print()`.
|
|
556
|
-
- Translating by replacing components or CSS `content` → set `messages` (every built-in text has a
|
|
579
|
+
- Translating by replacing components or CSS `content` → set `messages` (every built-in text has a
|
|
580
|
+
key); for German, French, Spanish or Serbian import the ready-made pack
|
|
581
|
+
(`@nocopypaste/vue-grid/locales/de` …) instead of writing it.
|
|
582
|
+
- Text translated but money / dates still formatted in English → a pack only translates text; set
|
|
583
|
+
`locale` too (`createVueGrid({ messages: de, locale: 'de' })`).
|
|
557
584
|
- Hiding a built-in piece with CSS → `parts: { filterButtons: false, … }` leaves it out of the DOM (and the tab order).
|
|
558
585
|
- Grouped server data shows groups of one page only → add `serverGroupingFeature` and answer `query.groupBy` with `{ groups }` (`count` per group, `total` = number of groups).
|
|
559
586
|
- A batch action on a selected server group touched only loaded rows → act on `selectedGroups` (paths) with the filters on the server.
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,36 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.12.0 — 2026-11-25
|
|
4
|
+
|
|
5
|
+
**Cell-range selection** (`rangeSelectionFeature`, opt-in, with `range-selection`): select a
|
|
6
|
+
block of cells as in a spreadsheet. Drag across cells (past an edge the grid scrolls and the block
|
|
7
|
+
follows), Shift+click to stretch it from the last clicked cell, Shift+arrows from the focused cell
|
|
8
|
+
(with `keyboardNavigationFeature`), Ctrl/⌘+A for every cell, Esc to clear; a plain click is one cell
|
|
9
|
+
again, and touch drags still scroll. Ctrl/⌘+C copies it as tab-separated text as the cells show it
|
|
10
|
+
(`exportValue` wins), so it pastes into Excel or Sheets as cells, and the grid emits `copy` with
|
|
11
|
+
`kind: 'range'`. `v-model:range` holds its corners (`{ start, end }`, each `{ rowKey, columnKey }`),
|
|
12
|
+
so it follows sorting and filtering, spans rows virtual scrolling hasn't drawn, and covers expanded
|
|
13
|
+
child rows (not group or pinned rows). With `statusBarFeature` the bar shows its size and the sum and
|
|
14
|
+
average of its numbers (formatted like the cells when they come from one column; `#status-bar` gets
|
|
15
|
+
`range`). Cells in it are tinted and outlined (`--vg-color-range`, `--vg-color-range-border`) and
|
|
16
|
+
carry `aria-selected`. It works next to row selection. Methods `selectRange(range)`,
|
|
17
|
+
`getRangeValues()`, `copyRange()`; types `CellRange`, `CellRef`, `StatusBarRange`; message
|
|
18
|
+
`cellCount` (in every language pack). The feature adds 2.3 kB gzipped to a grid that uses it; a
|
|
19
|
+
plain grid grows by 0.2 kB (to 15.5).
|
|
20
|
+
|
|
21
|
+
## 0.11.0 — 2026-11-25
|
|
22
|
+
|
|
23
|
+
**Language packs**: ready-made, complete translations of every built-in text, each its own import
|
|
24
|
+
and bundled only when imported (about 2 kB gzipped): `@nocopypaste/vue-grid/locales/de` (`de`),
|
|
25
|
+
`/fr` (`fr`), `/es` (`es`), `/sr` (`sr`, Serbian Cyrillic), `/sr-Latn` (`srLatn`), and `/en`
|
|
26
|
+
(`en`, the built-in English written out, as a template). Use one as `messages` app-wide
|
|
27
|
+
(`createVueGrid({ messages: de })`) or per grid, and spread it to change a few texts
|
|
28
|
+
(`{ ...de, total: 'Gesamt' }`). Counts follow each language's plural rules (`Intl.PluralRules`:
|
|
29
|
+
`1 red`, `2 reda`, `5 redova`). Texts that take a count now also get the number, for plurals:
|
|
30
|
+
`rowCount(shown, total, count, totalCount)`, `selectedCount(count, all, amount)`, and
|
|
31
|
+
`sortPosition(position, dir, count)` gets the number of sort keys (it couldn't say “of 3” before).
|
|
32
|
+
The new arguments come last, so existing functions keep working.
|
|
33
|
+
|
|
3
34
|
## 0.10.0 — 2026-11-25
|
|
4
35
|
|
|
5
36
|
**Inline cell editing** (`editingFeature`, opt-in): mark columns `editable` (or `(row) => boolean`).
|
package/README.md
CHANGED
|
@@ -136,6 +136,7 @@ an opt-in feature:
|
|
|
136
136
|
| `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` |
|
|
137
137
|
| `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 |
|
|
138
138
|
| `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) |
|
|
139
|
+
| `rangeSelectionFeature` | `range-selection`: drag, Shift+click or Shift+arrows select a block of cells, Ctrl/⌘+C copies it (tab-separated, pastes into spreadsheets), the status bar adds it up; `v-model:range`. See [Cell-range selection](#cell-range-selection) |
|
|
139
140
|
|
|
140
141
|
```ts
|
|
141
142
|
// per grid
|
|
@@ -179,35 +180,36 @@ what you import.
|
|
|
179
180
|
|
|
180
181
|
| Import (minified / gzip, Vue excluded) | Initial chunk |
|
|
181
182
|
| ---------------------------------------------------------------------------- | ------------------ |
|
|
182
|
-
| `VGrid` (no features) |
|
|
183
|
-
| `VGrid` + `sortingFeature` |
|
|
184
|
-
| `VGrid` + `filteringFeature` |
|
|
185
|
-
| `VGrid` + `serverDataFeature` |
|
|
186
|
-
| `VGrid` + `paginationFeature` |
|
|
187
|
-
| `VGrid` + `selectionFeature` |
|
|
188
|
-
| `VGrid` + `subGridsFeature` |
|
|
189
|
-
| `VGrid` + `menusFeature` |
|
|
190
|
-
| `VGrid` + `columnReorderFeature` |
|
|
191
|
-
| `VGrid` + `columnPinningFeature` |
|
|
192
|
-
| `VGrid` + `virtualScrollingFeature` |
|
|
193
|
-
| `VGrid` + `columnVisibilityFeature` |
|
|
194
|
-
| `VGrid` + `keyboardNavigationFeature` |
|
|
195
|
-
| `VGrid` + `columnResizingFeature` |
|
|
196
|
-
| `VGrid` + `columnGroupsFeature` |
|
|
197
|
-
| `VGrid` + `rowPinningFeature` |
|
|
198
|
-
| `VGrid` + `aggregationFeature` |
|
|
199
|
-
| `VGrid` + `rowGroupingFeature` |
|
|
200
|
-
| `VGrid` + `exportFeature` |
|
|
201
|
-
| `VGrid` + `statusBarFeature` |
|
|
202
|
-
| `VGrid` + `serverGroupingFeature` |
|
|
203
|
-
| `VGrid` + `editingFeature` |
|
|
204
|
-
| `VGrid` + `
|
|
205
|
-
| `VGrid` + `
|
|
206
|
-
| `VGrid` + `
|
|
183
|
+
| `VGrid` (no features) | 45.3 kB / 15.5 kB |
|
|
184
|
+
| `VGrid` + `sortingFeature` | 48.0 kB / 16.5 kB |
|
|
185
|
+
| `VGrid` + `filteringFeature` | 56.0 kB / 19.4 kB |
|
|
186
|
+
| `VGrid` + `serverDataFeature` | 46.7 kB / 16.1 kB |
|
|
187
|
+
| `VGrid` + `paginationFeature` | 45.4 kB / 15.6 kB |
|
|
188
|
+
| `VGrid` + `selectionFeature` | 49.4 kB / 17.0 kB |
|
|
189
|
+
| `VGrid` + `subGridsFeature` | 47.6 kB / 16.3 kB |
|
|
190
|
+
| `VGrid` + `menusFeature` | 56.6 kB / 19.3 kB |
|
|
191
|
+
| `VGrid` + `columnReorderFeature` | 49.0 kB / 16.8 kB |
|
|
192
|
+
| `VGrid` + `columnPinningFeature` | 48.2 kB / 16.5 kB |
|
|
193
|
+
| `VGrid` + `virtualScrollingFeature` | 51.0 kB / 17.7 kB |
|
|
194
|
+
| `VGrid` + `columnVisibilityFeature` | 45.5 kB / 15.6 kB |
|
|
195
|
+
| `VGrid` + `keyboardNavigationFeature` | 48.1 kB / 16.5 kB |
|
|
196
|
+
| `VGrid` + `columnResizingFeature` | 48.6 kB / 16.7 kB |
|
|
197
|
+
| `VGrid` + `columnGroupsFeature` | 46.6 kB / 16.0 kB |
|
|
198
|
+
| `VGrid` + `rowPinningFeature` | 50.2 kB / 16.9 kB |
|
|
199
|
+
| `VGrid` + `aggregationFeature` | 50.4 kB / 17.0 kB |
|
|
200
|
+
| `VGrid` + `rowGroupingFeature` | 56.1 kB / 19.1 kB |
|
|
201
|
+
| `VGrid` + `exportFeature` | 50.2 kB / 17.4 kB |
|
|
202
|
+
| `VGrid` + `statusBarFeature` | 48.2 kB / 16.6 kB |
|
|
203
|
+
| `VGrid` + `serverGroupingFeature` | 48.4 kB / 16.7 kB |
|
|
204
|
+
| `VGrid` + `editingFeature` | 49.7 kB / 17.2 kB |
|
|
205
|
+
| `VGrid` + `rangeSelectionFeature` | 51.7 kB / 17.8 kB |
|
|
206
|
+
| `VGrid` + `allFeatures` + `VGridSearch` | 130.4 kB / 43.8 kB |
|
|
207
|
+
| `VGrid` + `currencyRenderer` | 46.7 kB / 16.0 kB |
|
|
208
|
+
| `VGrid` + `VGridPagination` + `VGridColumnMenu` | 52.6 kB / 18.0 kB |
|
|
207
209
|
| `sortRows` only | 0.7 kB / 0.4 kB |
|
|
208
210
|
| `toCsv` only | 1.1 kB / 0.6 kB |
|
|
209
|
-
| everything |
|
|
210
|
-
| `validateGridConfig` (`@nocopypaste/vue-grid/agent`, never in an app bundle) |
|
|
211
|
+
| everything | 184.4 kB / 59.3 kB |
|
|
212
|
+
| `validateGridConfig` (`@nocopypaste/vue-grid/agent`, never in an app bundle) | 77.4 kB / 21.1 kB |
|
|
211
213
|
|
|
212
214
|
With `filteringFeature`, the filter popover body and the filter-row editors are **on-demand
|
|
213
215
|
chunks**: they load the first time a popover opens or `filter-row` is on. With
|
|
@@ -265,6 +267,7 @@ chunks that on-demand imports share with the entry, even when nothing uses them.
|
|
|
265
267
|
| `v-model:groupBy` | `string[] \| string \| null` | `null` | Column keys to group the rows by, outermost first. Needs `rowGroupingFeature` (as does the next one). See [Row grouping](#row-grouping). |
|
|
266
268
|
| `groupsExpanded` | `boolean` | `false` | Groups start expanded. |
|
|
267
269
|
| `v-model:selectedGroups` | `GroupPath[]` | `[]` | Server-side grouping: groups selected by query, by path (`[[{ key, value }]]`), without their rows. |
|
|
270
|
+
| `v-model:range` | `CellRange \| null` | `null` | Cell-range selection: the selected block, `{ start, end }` corner cells (`{ rowKey, columnKey }`). One cell alone is no range. |
|
|
268
271
|
| `rowClickable` | `boolean` | `false` | Pointer cursor; `row-click` is always emitted. |
|
|
269
272
|
| `rowClass` | `(row, index) => ClassValue` | — | |
|
|
270
273
|
| `highlightedRows` | `RowKey[]` | — | |
|
|
@@ -277,6 +280,7 @@ chunks that on-demand imports share with the entry, even when nothing uses them.
|
|
|
277
280
|
| `ariaLabel` | `string` | — | |
|
|
278
281
|
| `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). |
|
|
279
282
|
| `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). |
|
|
283
|
+
| `rangeSelection` | `boolean` | `false` | Cell-range selection (range selection feature): drag across cells, Shift+click or Shift+arrows; Ctrl/⌘+C copies the block. `v-model:range` holds it. See [Cell-range selection](#cell-range-selection). |
|
|
280
284
|
| `messages` | `GridMessages` | — | Built-in text (translations, wording), over `createVueGrid({ messages })`. See [Text and parts](#text-and-parts). |
|
|
281
285
|
| `parts` | `GridParts` | — | Built-in parts to leave out (`{ filterButtons: false }`), over `createVueGrid({ parts })`. |
|
|
282
286
|
| `contextMenu` | `(ctx: { row, rowKey, column, value }) => MenuItem[] \| null` | — | Right-click menu for body cells. Needs `menusFeature`. |
|
|
@@ -288,7 +292,7 @@ chunks that on-demand imports share with the entry, even when nothing uses them.
|
|
|
288
292
|
`row-click(row, event)` · `cell-click({ row, rowKey, column, value, event })` (columns with `clickable: true`) ·
|
|
289
293
|
`cell-action({ name, payload, row, rowKey, column })` (from renderers) · `sub-rows-error({ row, error })` · `context-action({ name, item, row, rowKey, column, value })` · `header-action({ name, item, column })` ·
|
|
290
294
|
`query-change(query: GridQuery)` (sort + filters + page as one object, on mount and on every real change) ·
|
|
291
|
-
`copy({ kind, text, rows, columns })` (rows or a cell were copied: `exportFeature`) ·
|
|
295
|
+
`copy({ kind, text, rows, columns })` (rows or a cell were copied: `exportFeature`; a cell range: `rangeSelectionFeature`, `kind: 'range'`) ·
|
|
292
296
|
`load-error(error)` (a `dataSource` call failed) ·
|
|
293
297
|
`cell-edit({ row, rowKey, column, value, oldValue })` (an edited cell: `editingFeature`; update your data) ·
|
|
294
298
|
plus the `update:*` events of every `v-model`.
|
|
@@ -318,6 +322,11 @@ grid.value?.reloadSubRows('c2') // forget lazily loaded children (of one row, or
|
|
|
318
322
|
grid.value?.pinRow(42, 'top') // pin a row above the body ('bottom' below it, null to unpin): rowPinningFeature
|
|
319
323
|
grid.value?.exportCsv({ filename: 'orders.csv' }) / getCsv() / copyRows() // exportFeature, see Export and copy
|
|
320
324
|
grid.value?.startEdit(42, 'stake') / stopEdit() // editingFeature: open a cell's editor; save (or stopEdit(true): drop) the open one
|
|
325
|
+
grid.value?.selectRange({
|
|
326
|
+
start: { rowKey: 1, columnKey: 'stake' },
|
|
327
|
+
end: { rowKey: 9, columnKey: 'stake' },
|
|
328
|
+
}) // rangeSelectionFeature (null clears)
|
|
329
|
+
grid.value?.getRangeValues() / copyRange() // the selected block's raw values, row by row / copy it as tab-separated text
|
|
321
330
|
```
|
|
322
331
|
|
|
323
332
|
`reload()` also forgets lazily loaded children, as does passing a different `load-sub-rows`
|
|
@@ -1139,6 +1148,52 @@ editor's code loads on demand, while the browser is idle, once a grid has an edi
|
|
|
1139
1148
|
`grid.startEdit(rowKey, columnKey)` opens an editor from code, `grid.stopEdit()` closes it. Its
|
|
1140
1149
|
text (`Edit {column}`, `Enter a number.`, `Saving…`) is in `messages`.
|
|
1141
1150
|
|
|
1151
|
+
## Cell-range selection
|
|
1152
|
+
|
|
1153
|
+
`rangeSelectionFeature` selects blocks of cells, as in a spreadsheet:
|
|
1154
|
+
|
|
1155
|
+
```vue
|
|
1156
|
+
<script setup lang="ts">
|
|
1157
|
+
import { ref } from 'vue'
|
|
1158
|
+
import {
|
|
1159
|
+
VGrid,
|
|
1160
|
+
keyboardNavigationFeature,
|
|
1161
|
+
rangeSelectionFeature,
|
|
1162
|
+
statusBarFeature,
|
|
1163
|
+
type CellRange,
|
|
1164
|
+
} from '@nocopypaste/vue-grid'
|
|
1165
|
+
const range = ref<CellRange | null>(null) // { start: { rowKey, columnKey }, end: { rowKey, columnKey } }
|
|
1166
|
+
</script>
|
|
1167
|
+
|
|
1168
|
+
<template>
|
|
1169
|
+
<VGrid
|
|
1170
|
+
v-model:range="range"
|
|
1171
|
+
:rows
|
|
1172
|
+
:columns
|
|
1173
|
+
row-key="id"
|
|
1174
|
+
range-selection
|
|
1175
|
+
status-bar
|
|
1176
|
+
:features="[rangeSelectionFeature, statusBarFeature, keyboardNavigationFeature]"
|
|
1177
|
+
@copy="(e) => e.kind === 'range' && notify('Copied')"
|
|
1178
|
+
/>
|
|
1179
|
+
</template>
|
|
1180
|
+
```
|
|
1181
|
+
|
|
1182
|
+
- **Mouse**: press on a cell and drag; past an edge the grid scrolls and the block follows.
|
|
1183
|
+
Shift+click stretches it from the last clicked cell. A plain click is one cell again (no range).
|
|
1184
|
+
Touch drags still scroll.
|
|
1185
|
+
- **Keyboard** (with `keyboardNavigationFeature`): Shift+arrows extend it from the focused cell,
|
|
1186
|
+
Ctrl/⌘+A selects every cell, Esc clears it.
|
|
1187
|
+
- **Copy**: Ctrl/⌘+C copies it as tab-separated lines, as the cells show them (`exportValue` wins),
|
|
1188
|
+
so it pastes into Excel or Google Sheets as cells; the grid emits `copy` with `kind: 'range'`.
|
|
1189
|
+
`grid.copyRange()` does it from code, `grid.getRangeValues()` returns the raw values.
|
|
1190
|
+
- **Status bar** (`statusBarFeature`): the number of cells, and the sum and average of its numbers.
|
|
1191
|
+
- **What it covers**: the corner cells are kept by row key and column key, so the block follows
|
|
1192
|
+
sorting and filtering and spans rows virtual scrolling hasn't drawn; expanded child rows are in
|
|
1193
|
+
it, group rows and pinned rows are not. Row selection (`selectable`) works alongside: checkboxes
|
|
1194
|
+
select rows, dragging over cells selects a range, and Ctrl/⌘+C copies the range while there is one.
|
|
1195
|
+
- Style it with `--vg-color-range` (the cells' tint) and `--vg-color-range-border` (the outline).
|
|
1196
|
+
|
|
1142
1197
|
## Status bar
|
|
1143
1198
|
|
|
1144
1199
|
`statusBarFeature` adds a bar under the grid, like a spreadsheet's:
|
|
@@ -1164,7 +1219,10 @@ text (`Edit {column}`, `Enter a number.`, `Saving…`) is in `messages`.
|
|
|
1164
1219
|
like the column's cells. Selected child rows count too. With "select all N matching rows" on
|
|
1165
1220
|
(server data) the summary hides: only the loaded page is known.
|
|
1166
1221
|
- **Your own content**: the `#status-bar` slot gets `{ rowCount, totalRowCount, selectedCount,
|
|
1167
|
-
allSelected, filterCount, summary, clearFilters }` and replaces the default content.
|
|
1222
|
+
allSelected, filterCount, summary, range, clearFilters }` and replaces the default content.
|
|
1223
|
+
- **Cell range**: with `rangeSelectionFeature`, a selected block of cells shows its size and the
|
|
1224
|
+
`aggregates` of its numbers (`12 cells: Sum 1,135.47 Average 283.87`), formatted like the cells
|
|
1225
|
+
when they all come from one column.
|
|
1168
1226
|
- Leave items out with `rows: false`, `selected: false`, `filters: false` or `clear: false`.
|
|
1169
1227
|
- The bar is a `group` labelled "Grid status"; style it with `.vg-status-bar`. Its component loads
|
|
1170
1228
|
on demand (own chunk).
|
|
@@ -1258,6 +1316,9 @@ With `keyboardNavigationFeature` it is an ARIA `grid` (`treegrid` with sub-grids
|
|
|
1258
1316
|
`Home`/`End`, `Ctrl+Home`/`Ctrl+End`, `PageUp`/`PageDown`; `ContextMenu` / `Shift+F10` opens the context menu. `Enter` sorts a header (`Shift+Enter` adds it with `multi-sort`) or activates the
|
|
1259
1317
|
cell's control; `Space` toggles row selection; `→`/`←` on a tree cell expands/collapses; `Alt+←/→` on a
|
|
1260
1318
|
header moves the column; `Alt+Shift+←/→` on a header resizes it (with `columnResizingFeature`).
|
|
1319
|
+
With `range-selection` (`rangeSelectionFeature`), `Shift+arrows` select a block of cells from the
|
|
1320
|
+
focused one, `Ctrl/⌘+A` every cell, `Esc` clears it and `Ctrl/⌘+C` copies it; cells in it carry
|
|
1321
|
+
`aria-selected`.
|
|
1261
1322
|
|
|
1262
1323
|
## Touch, phones and tablets
|
|
1263
1324
|
|
|
@@ -1403,6 +1464,30 @@ A grid's own `:messages` win over the app's, and props that name a text (`empty-
|
|
|
1403
1464
|
`<VGridPagination>`, `<VGridSearch>`, `<VGridColumnMenu>` and `<VGridMenu>` use the app's messages on
|
|
1404
1465
|
their own too. Every key, with its English default, is in the API reference (`GridMessages`).
|
|
1405
1466
|
|
|
1467
|
+
**Language packs.** Ready-made, complete translations, each its own import (so only the ones you
|
|
1468
|
+
import are bundled, about 2 kB gzipped each):
|
|
1469
|
+
|
|
1470
|
+
| Import | Export | Language |
|
|
1471
|
+
| --------------------------------------- | -------- | ---------------------------------------------------- |
|
|
1472
|
+
| `@nocopypaste/vue-grid/locales/de` | `de` | German |
|
|
1473
|
+
| `@nocopypaste/vue-grid/locales/fr` | `fr` | French |
|
|
1474
|
+
| `@nocopypaste/vue-grid/locales/es` | `es` | Spanish |
|
|
1475
|
+
| `@nocopypaste/vue-grid/locales/sr` | `sr` | Serbian, Cyrillic |
|
|
1476
|
+
| `@nocopypaste/vue-grid/locales/sr-Latn` | `srLatn` | Serbian, Latin |
|
|
1477
|
+
| `@nocopypaste/vue-grid/locales/en` | `en` | English (the built-in text, a template for your own) |
|
|
1478
|
+
|
|
1479
|
+
```ts
|
|
1480
|
+
import { de } from '@nocopypaste/vue-grid/locales/de'
|
|
1481
|
+
|
|
1482
|
+
app.use(createVueGrid({ messages: de })) // or per grid: <VGrid :messages="de" />
|
|
1483
|
+
// change a few texts on top: { ...de, total: 'Gesamt' }
|
|
1484
|
+
```
|
|
1485
|
+
|
|
1486
|
+
Counts follow the language's plural rules (`1 red`, `2 reda`, `5 redova`). A pack only translates
|
|
1487
|
+
text: money, numbers and dates follow `locale` (`<VGrid locale="de">` or `createVueGrid({ locale })`).
|
|
1488
|
+
Text that takes a count gets the number too (`rowCount(shown, total, count, totalCount)`,
|
|
1489
|
+
`selectedCount(count, all, amount)`, `sortPosition(position, dir, count)`), for your own plurals.
|
|
1490
|
+
|
|
1406
1491
|
**Parts.** `GridParts` turns off what a feature adds, each on by default; app-wide in
|
|
1407
1492
|
`createVueGrid({ parts })`, per grid with `:parts`:
|
|
1408
1493
|
|
package/agent/api.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"package": "@nocopypaste/vue-grid",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.0",
|
|
4
4
|
"component": "VGrid",
|
|
5
5
|
"props": [
|
|
6
6
|
{
|
|
@@ -57,6 +57,13 @@
|
|
|
57
57
|
"description": "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.",
|
|
58
58
|
"feature": "editing"
|
|
59
59
|
},
|
|
60
|
+
{
|
|
61
|
+
"name": "rangeSelection",
|
|
62
|
+
"type": "boolean",
|
|
63
|
+
"required": false,
|
|
64
|
+
"description": "Cell-range selection (range selection feature), as in a spreadsheet: drag across cells or Shift+click to select a block, Shift+arrows to extend it, Ctrl/⌘+A for every cell, Esc to clear; Ctrl/⌘+C copies it. Bind `v-model:range` to read or set it.",
|
|
65
|
+
"feature": "rangeSelection"
|
|
66
|
+
},
|
|
60
67
|
{
|
|
61
68
|
"name": "messages",
|
|
62
69
|
"type": "GridMessages",
|
|
@@ -414,6 +421,13 @@
|
|
|
414
421
|
"default": "[]",
|
|
415
422
|
"description": "Server data with row grouping: groups selected by query, by their paths, without loading their rows (a group's checkbox). Act on these with `selected` and the filters. Ends when the filters or the grouping change. Needs the selection and row grouping features.",
|
|
416
423
|
"feature": "serverGrouping"
|
|
424
|
+
},
|
|
425
|
+
{
|
|
426
|
+
"name": "range",
|
|
427
|
+
"type": "CellRange | null",
|
|
428
|
+
"default": "null",
|
|
429
|
+
"description": "The selected block of cells (`range-selection`): `{ start, end }` corner cells by row key and column key, or null. One cell alone is no range. Needs the range selection feature.",
|
|
430
|
+
"feature": "rangeSelection"
|
|
417
431
|
}
|
|
418
432
|
],
|
|
419
433
|
"events": [
|
|
@@ -666,6 +680,24 @@
|
|
|
666
680
|
"type": "void",
|
|
667
681
|
"required": true,
|
|
668
682
|
"description": "Closes the open editor: saves its value, or with `cancel` drops it. Editing feature."
|
|
683
|
+
},
|
|
684
|
+
{
|
|
685
|
+
"name": "selectRange",
|
|
686
|
+
"type": "void",
|
|
687
|
+
"required": true,
|
|
688
|
+
"description": "Selects a block of cells (`null` clears it), as `v-model:range` does. Range selection feature, with `range-selection`."
|
|
689
|
+
},
|
|
690
|
+
{
|
|
691
|
+
"name": "getRangeValues",
|
|
692
|
+
"type": "unknown[][]",
|
|
693
|
+
"required": true,
|
|
694
|
+
"description": "The selected range's raw values, row by row (`[]` without a range). Range selection feature."
|
|
695
|
+
},
|
|
696
|
+
{
|
|
697
|
+
"name": "copyRange",
|
|
698
|
+
"type": "Promise<boolean>",
|
|
699
|
+
"required": true,
|
|
700
|
+
"description": "Copies the selected range as tab-separated text, as the cells show it (Ctrl/⌘+C does the same). Resolves `false` without a range. Range selection feature."
|
|
669
701
|
}
|
|
670
702
|
],
|
|
671
703
|
"column": [
|
|
@@ -1072,6 +1104,16 @@
|
|
|
1072
1104
|
],
|
|
1073
1105
|
"columnOptions": []
|
|
1074
1106
|
},
|
|
1107
|
+
{
|
|
1108
|
+
"id": "rangeSelection",
|
|
1109
|
+
"export": "rangeSelectionFeature",
|
|
1110
|
+
"description": "Cell-range selection, as in a spreadsheet (`range-selection`, `v-model:range`): drag across cells or Shift+click to select a block, Shift+arrows to extend it (with `keyboardNavigationFeature`), Ctrl/⌘+A for every cell, Esc to clear. Ctrl/⌘+C copies it as tab-separated text, as the cells show it, and the status bar (`statusBarFeature`) shows its count, sum and average. Separate from row selection (`selectable`): both can be on.",
|
|
1111
|
+
"props": [
|
|
1112
|
+
"rangeSelection",
|
|
1113
|
+
"range"
|
|
1114
|
+
],
|
|
1115
|
+
"columnOptions": []
|
|
1116
|
+
},
|
|
1075
1117
|
{
|
|
1076
1118
|
"id": "rowGrouping",
|
|
1077
1119
|
"export": "rowGroupingFeature",
|
package/agent/api.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# @nocopypaste/vue-grid 0.
|
|
1
|
+
# @nocopypaste/vue-grid 0.12.0 — API reference
|
|
2
2
|
|
|
3
3
|
> Generated from the TypeScript sources (`scripts/gen-agent.mjs`). Machine-readable: `agent/api.json`, `agent/grid-config.schema.json`.
|
|
4
4
|
|
|
@@ -20,6 +20,7 @@ Opt-in: pass them as `:features="[…]"` on `<VGrid>` or once via `createVueGrid
|
|
|
20
20
|
| `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. | | |
|
|
21
21
|
| `menusFeature` | Context menus: the built-in header menu (sort, filter, pin, move, hide, reset, your own items via `header-menu`) and body-cell menus (`context-menu`), opened by right-click, the ContextMenu key or Shift+F10. Without it the browser's own menu shows. The standalone `<VGridMenu>` and the `actions-menu` renderer don't need it. | `contextMenu` `headerMenu` | |
|
|
22
22
|
| `paginationFeature` | Built-in pagination: the `pagination` prop and `v-model:page` / `v-model:page-size`. Pages the client rows, or asks the `dataSource` for pages. The pager loads on demand (own chunk). Not needed for the standalone `<VGridPagination>` component. | `pagination` `page` `pageSize` | |
|
|
23
|
+
| `rangeSelectionFeature` | Cell-range selection, as in a spreadsheet (`range-selection`, `v-model:range`): drag across cells or Shift+click to select a block, Shift+arrows to extend it (with `keyboardNavigationFeature`), Ctrl/⌘+A for every cell, Esc to clear. Ctrl/⌘+C copies it as tab-separated text, as the cells show it, and the status bar (`statusBarFeature`) shows its count, sum and average. Separate from row selection (`selectable`): both can be on. | `rangeSelection` `range` | |
|
|
23
24
|
| `rowGroupingFeature` | Row grouping: `v-model:group-by="['region', 'status']"` groups the rows by those columns into collapsible group rows with their value, row count and the aggregates of columns with an `aggregate`. Columns with `groupable: true` get Group by / Ungroup items in the header menu. Without it, `group-by` is ignored. | `groupsExpanded` `groupBy` | `groupable` `groupValue` |
|
|
24
25
|
| `rowPinningFeature` | Pinned rows: `v-model:pinned-rows` (`{ top, bottom }` row keys), `pinned-top-rows` / `pinned-bottom-rows` (extra rows that aren't in the data) and the `pinRow()` method. Pinned rows stay in view (sticky) under the header or at the bottom while the body scrolls, and aren't filtered, sorted or paged. Without it, those options are ignored. | `pinnedTopRows` `pinnedBottomRows` `pinnedRows` | |
|
|
25
26
|
| `selectionFeature` | Row selection: the `selectable` prop (multi or single), `v-model:selected`, `selection-mode` (cascade through sub-grids), `is-row-selectable`, Space on a row, shift-click (or Shift+Space) for a range, the select-all checkbox, `prune-selection`, and with server data a "select all N matching rows" banner (`v-model:select-all-matching`; it loads on demand, its own chunk). | `selectable` `selectionMode` `isRowSelectable` `pruneSelection` `selected` `selectAllMatching` | |
|
|
@@ -42,6 +43,7 @@ Opt-in: pass them as `:features="[…]"` on `<VGrid>` or once via `createVueGrid
|
|
|
42
43
|
| `pagination` | `boolean \| PaginationOptions` | `false` | `paginationFeature` | Built-in pagination under the grid (server-side with `dataSource`, client-side otherwise). |
|
|
43
44
|
| `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. |
|
|
44
45
|
| `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. |
|
|
46
|
+
| `rangeSelection` | `boolean` | | `rangeSelectionFeature` | Cell-range selection (range selection feature), as in a spreadsheet: drag across cells or Shift+click to select a block, Shift+arrows to extend it, Ctrl/⌘+A for every cell, Esc to clear; Ctrl/⌘+C copies it. Bind `v-model:range` to read or set it. |
|
|
45
47
|
| `messages` | `GridMessages` | | | Built-in text (translations, wording), over `createVueGrid({ messages })`. |
|
|
46
48
|
| `parts` | `GridParts` | | | Built-in parts to leave out (`{ progressBar: false }`), over `createVueGrid({ parts })`. |
|
|
47
49
|
| `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`. |
|
|
@@ -99,6 +101,7 @@ Opt-in: pass them as `:features="[…]"` on `<VGrid>` or once via `createVueGrid
|
|
|
99
101
|
| `v-model:groupBy` | `readonly string[] \| string \| null` | `null` | `rowGroupingFeature` | Column keys to group the rows by, outermost first (`['region', 'status']`, or one key). Group rows show the value, the row count and the columns' aggregates. Needs the row grouping feature. |
|
|
100
102
|
| `v-model:selectAllMatching` | `boolean` | `false` | `selectionFeature` | Server data: every row matching the query is selected, not just the loaded ones (set from the "Select all N rows" banner; ends when filters change or a row is unticked). Act on the query then, not on `selected`. Needs the selection feature. |
|
|
101
103
|
| `v-model:selectedGroups` | `GroupPath[]` | `[]` | `serverGroupingFeature` | Server data with row grouping: groups selected by query, by their paths, without loading their rows (a group's checkbox). Act on these with `selected` and the filters. Ends when the filters or the grouping change. Needs the selection and row grouping features. |
|
|
104
|
+
| `v-model:range` | `CellRange \| null` | `null` | `rangeSelectionFeature` | The selected block of cells (`range-selection`): `{ start, end }` corner cells by row key and column key, or null. One cell alone is no range. Needs the range selection feature. |
|
|
102
105
|
|
|
103
106
|
## Events
|
|
104
107
|
|
|
@@ -158,6 +161,9 @@ Opt-in: pass them as `:features="[…]"` on `<VGrid>` or once via `createVueGrid
|
|
|
158
161
|
| `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. |
|
|
159
162
|
| `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. |
|
|
160
163
|
| `stopEdit` | `void` | | Closes the open editor: saves its value, or with `cancel` drops it. Editing feature. |
|
|
164
|
+
| `selectRange` | `void` | | Selects a block of cells (`null` clears it), as `v-model:range` does. Range selection feature, with `range-selection`. |
|
|
165
|
+
| `getRangeValues` | `unknown[][]` | | The selected range's raw values, row by row (`[]` without a range). Range selection feature. |
|
|
166
|
+
| `copyRange` | `Promise<boolean>` | | Copies the selected range as tab-separated text, as the cells show it (Ctrl/⌘+C does the same). Resolves `false` without a range. Range selection feature. |
|
|
161
167
|
|
|
162
168
|
## `ColumnDef<T>`
|
|
163
169
|
|
|
@@ -37,6 +37,7 @@
|
|
|
37
37
|
"keyboardNavigationFeature",
|
|
38
38
|
"menusFeature",
|
|
39
39
|
"paginationFeature",
|
|
40
|
+
"rangeSelectionFeature",
|
|
40
41
|
"rowGroupingFeature",
|
|
41
42
|
"rowPinningFeature",
|
|
42
43
|
"selectionFeature",
|
|
@@ -62,6 +63,10 @@
|
|
|
62
63
|
"saveCell": {
|
|
63
64
|
"description": "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."
|
|
64
65
|
},
|
|
66
|
+
"rangeSelection": {
|
|
67
|
+
"type": "boolean",
|
|
68
|
+
"description": "Cell-range selection (range selection feature), as in a spreadsheet: drag across cells or Shift+click to select a block, Shift+arrows to extend it, Ctrl/⌘+A for every cell, Esc to clear; Ctrl/⌘+C copies it. Bind `v-model:range` to read or set it."
|
|
69
|
+
},
|
|
65
70
|
"messages": {
|
|
66
71
|
"description": "Built-in text (translations, wording), over `createVueGrid({ messages })`."
|
|
67
72
|
},
|
|
@@ -467,6 +472,9 @@
|
|
|
467
472
|
"type": "array",
|
|
468
473
|
"items": {},
|
|
469
474
|
"description": "Server data with row grouping: groups selected by query, by their paths, without loading their rows (a group's checkbox). Act on these with `selected` and the filters. Ends when the filters or the grouping change. Needs the selection and row grouping features."
|
|
475
|
+
},
|
|
476
|
+
"range": {
|
|
477
|
+
"description": "The selected block of cells (`range-selection`): `{ start, end }` corner cells by row key and column key, or null. One cell alone is no range. Needs the range selection feature."
|
|
470
478
|
}
|
|
471
479
|
},
|
|
472
480
|
"required": [
|