@nocopypaste/vue-grid 0.7.0 → 0.9.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.
Files changed (71) hide show
  1. package/AGENTS.md +30 -25
  2. package/CHANGELOG.md +34 -0
  3. package/README.md +130 -28
  4. package/agent/api.json +36 -3
  5. package/agent/api.md +7 -3
  6. package/agent/grid-config.schema.json +31 -0
  7. package/dist/agent/api.js +31 -3
  8. package/dist/agent/requirements.js +3 -0
  9. package/dist/agent/requirements.js.map +1 -1
  10. package/dist/base.css +1 -1
  11. package/dist/components/VGrid.vue_vue_type_script_setup_true_lang.js +578 -541
  12. package/dist/components/VGrid.vue_vue_type_script_setup_true_lang.js.map +1 -1
  13. package/dist/components/VGridGroupCells.vue_vue_type_script_setup_true_lang.js +3 -3
  14. package/dist/components/VGridGroupCells.vue_vue_type_script_setup_true_lang.js.map +1 -1
  15. package/dist/components/VGridHeader.vue_vue_type_script_setup_true_lang.js +82 -53
  16. package/dist/components/VGridHeader.vue_vue_type_script_setup_true_lang.js.map +1 -1
  17. package/dist/components/VGridSortMarker.js +6 -0
  18. package/dist/components/VGridSortMarker.js.map +1 -0
  19. package/dist/components/VGridSortMarker.vue_vue_type_script_setup_true_lang.js +21 -0
  20. package/dist/components/VGridSortMarker.vue_vue_type_script_setup_true_lang.js.map +1 -0
  21. package/dist/composables/useDataSource.js +21 -19
  22. package/dist/composables/useDataSource.js.map +1 -1
  23. package/dist/composables/useGridExport.js +1 -1
  24. package/dist/composables/useGridExport.js.map +1 -1
  25. package/dist/composables/useGridKeyboard.js +5 -1
  26. package/dist/composables/useGridKeyboard.js.map +1 -1
  27. package/dist/composables/useGridMenus.js +24 -12
  28. package/dist/composables/useGridMenus.js.map +1 -1
  29. package/dist/composables/useRowGrouping.js +103 -74
  30. package/dist/composables/useRowGrouping.js.map +1 -1
  31. package/dist/composables/useServerGroups.js +106 -0
  32. package/dist/composables/useServerGroups.js.map +1 -0
  33. package/dist/composables/useSorting.js +48 -0
  34. package/dist/composables/useSorting.js.map +1 -0
  35. package/dist/core/grouping.js +41 -24
  36. package/dist/core/grouping.js.map +1 -1
  37. package/dist/core/sort.js +31 -1
  38. package/dist/core/sort.js.map +1 -1
  39. package/dist/core.css +1 -1
  40. package/dist/features/index.js +12 -10
  41. package/dist/features/index.js.map +1 -1
  42. package/dist/features/serverGrouping.js +9 -0
  43. package/dist/features/serverGrouping.js.map +1 -0
  44. package/dist/features/sorting.js +8 -4
  45. package/dist/features/sorting.js.map +1 -1
  46. package/dist/index.js +60 -59
  47. package/dist/internal/context.js.map +1 -1
  48. package/dist/internal/features.js.map +1 -1
  49. package/dist/theme.css +1 -1
  50. package/dist/types/agent/requirements.d.ts +1 -1
  51. package/dist/types/components/VGrid.vue.d.ts +20 -2
  52. package/dist/types/components/VGridHeader.vue.d.ts +4 -3
  53. package/dist/types/components/VGridSortMarker.vue.d.ts +9 -0
  54. package/dist/types/composables/useDataSource.d.ts +36 -2
  55. package/dist/types/composables/useGridExport.d.ts +2 -0
  56. package/dist/types/composables/useGridMenus.d.ts +5 -0
  57. package/dist/types/composables/useRowGrouping.d.ts +14 -2
  58. package/dist/types/composables/useServerGroups.d.ts +37 -0
  59. package/dist/types/composables/useSorting.d.ts +24 -0
  60. package/dist/types/core/grouping.d.ts +31 -2
  61. package/dist/types/core/sort.d.ts +16 -0
  62. package/dist/types/features/index.d.ts +2 -1
  63. package/dist/types/features/serverGrouping.d.ts +9 -0
  64. package/dist/types/index.d.ts +2 -2
  65. package/dist/types/internal/context.d.ts +2 -0
  66. package/dist/types/internal/features.d.ts +2 -1
  67. package/dist/types/types.d.ts +17 -1
  68. package/dist/vue-grid.css +1 -1
  69. package/llms-full.txt +167 -56
  70. package/llms.txt +1 -1
  71. package/package.json +1 -1
package/AGENTS.md CHANGED
@@ -45,31 +45,33 @@ runs in the [live examples](https://eboye.github.io/eboye-vue-grid/), each with
45
45
 
46
46
  ## Which feature for what
47
47
 
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
- | Filters per column, a filter row, quick search | `filteringFeature` | column `filterable: true` (`filter: 'text' \| 'number' \| 'date' \| 'boolean' \| 'set'`); `filter-row`; `<VGridSearch />` in `#toolbar` |
52
- | Pages | `paginationFeature` | `pagination` (or `{ pageSizes: [10, 25, 50] }`), `v-model:page`, `v-model:page-size` |
53
- | Backend sorting / filtering / paging | `serverDataFeature` (+ the above) | `:data-source="(query, { signal }) => Promise<{ rows, total }>"` |
54
- | 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` |
55
- | Nested child rows aligned to the parent's columns | `subGridsFeature` | `:sub-rows="(row) => row.children"` or `:load-sub-rows` + `:has-sub-rows` |
56
- | An expandable panel under a row | — | `#detail="{ row }"` slot (`row-expandable` to limit it) |
57
- | 10,000+ rows | `virtualScrollingFeature` | `:virtual="{ rowHeight: 40 }"` + bounded height |
58
- | Right-click menus (cells, headers) | `menusFeature` | `:context-menu="(ctx) => MenuItem[]"` + `@context-action`; header menu is on by default |
59
- | Freeze columns left / right | `columnPinningFeature` | column `pinned: 'left' \| 'right'`; on narrow grids they scroll unless `pinned-max-share` allows (default half the width) |
60
- | Show / hide columns | `columnVisibilityFeature` | column `hidden: true`; `<VGridColumnMenu>` in `#toolbar` |
61
- | Drag columns to reorder | `columnReorderFeature` | column `reorderable: false` to lock one |
62
- | Drag column edges to resize | `columnResizingFeature` | `minWidth` / `maxWidth`, `resizable: false` |
63
- | Grouped headers ("Q1" over three columns) | `columnGroupsFeature` | column `group: 'Q1'` |
64
- | Rows that stay on top / bottom | `rowPinningFeature` | `v-model:pinned-rows="{ top: [id], bottom: [] }"`, `pinRow()`, `pinned-top-rows` |
65
- | A totals row (sum, avg, …) | `aggregationFeature` | column `aggregate: 'sum' \| 'avg' \| 'min' \| 'max' \| 'count' \| fn`; `totals` (or `'top'`) |
66
- | 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 |
67
- | Download CSV / Excel, print, copy rows / cells | `exportFeature` | `grid.exportCsv()`, `getCsv()`, `exportXlsx()`, `getXlsx()`, `print()`, `copyRows()`, `@copy`; column `exportValue`, `exportable: false` |
68
- | Row / selection counts, sum of the selected rows | `statusBarFeature` | `status-bar` (or `{ summary: ['total'], aggregates?: ['sum', 'avg'] }`); `#status-bar="{ rowCount, selectedCount, summary, … }"` |
69
- | Translate / reword the grid, drop built-in pieces | — | `messages` (`GridMessages`), `parts` (`GridParts`): app-wide in `createVueGrid` or per grid; slots `#load-error`, `#no-match`, `#select-all-banner` |
70
- | Arrow-key navigation (ARIA grid) | `keyboardNavigationFeature` | — |
71
- | Remember column layout | — | `storage="orders-grid"` (localStorage key) |
72
- | Cell type (money, date, badge, link, …) | — | `renderer: currencyRenderer` etc. (list below) |
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
+ | Translate / reword the grid, drop built-in pieces | — | `messages` (`GridMessages`), `parts` (`GridParts`): app-wide in `createVueGrid` or per grid; slots `#load-error`, `#no-match`, `#select-all-banner` |
72
+ | Arrow-key navigation (ARIA grid) | `keyboardNavigationFeature` | — |
73
+ | Remember column layout | — | `storage="orders-grid"` (localStorage key) |
74
+ | Cell type (money, date, badge, link, …) | — | `renderer: currencyRenderer` etc. (list below) |
73
75
 
74
76
  ## Renderers (pick by data)
75
77
 
@@ -500,6 +502,7 @@ only sees stylesheet rules. Density:
500
502
  ## Pitfalls
501
503
 
502
504
  - Nothing sorts → `sort-mode="client"` missing (or `sortingFeature` missing).
505
+ - 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`.
503
506
  - Columns are squeezed / the page scrolls sideways → give `width`s (`minmax(8rem, 1fr)`); the grid
504
507
  scrolls horizontally inside itself when columns are wider than it.
505
508
  - Grid grows forever / no sticky header → no bounded height.
@@ -518,6 +521,8 @@ only sees stylesheet rules. Density:
518
521
  - Printing the page (Ctrl+P) shows only the rows on screen, clipped to the grid → use `grid.print()`.
519
522
  - Translating by replacing components or CSS `content` → set `messages` (every built-in text has a key).
520
523
  - Hiding a built-in piece with CSS → `parts: { filterButtons: false, … }` leaves it out of the DOM (and the tab order).
524
+ - 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
+ - A batch action on a selected server group touched only loaded rows → act on `selectedGroups` (paths) with the filters on the server.
521
526
  - Copied numbers come out as `€1,234.50` → copying uses displayed values; pass `{ values: 'raw' }`
522
527
  (CSV exports are raw by default).
523
528
  - `group-by` names a field, not a column → it takes column `key`s; add a (hidden) column for it.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,39 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.9.0 — 2026-11-24
4
+
5
+ **Multi-column sort** (`sortingFeature`): with `multi-sort`, Shift-click a header (Shift+Enter on
6
+ a focused one) to sort by it after the others: ascending, descending, then removed; a plain click
7
+ still sorts by that column alone. `v-model:sorts` holds every key (`sort` stays the first, and
8
+ setting it from outside makes it the only one). Headers show each column's number; `aria-sort` stays
9
+ on the first key and screen readers hear “sorted 2 of 3, descending” for the others. The header
10
+ menu gains **Then sort ascending / descending**, and its Clear sort drops only that column. A
11
+ `dataSource` gets every key in `query.sorts` (only with `multi-sort`). Row groups follow their own
12
+ column's key wherever it is in the list. New exports: `sortRowsBy(rows, keys)`, `nextSorts(sorts,
13
+ key)`, `type SortKey`; `GridQuery.sorts`; messages `thenSortAscending`, `thenSortDescending`,
14
+ `sortPosition(position, dir)`. The logic lives in `sortingFeature`: a plain grid grows by 0.2 kB
15
+ gzip (to 15.0), a grid with sorting by 0.9 kB (to 16.0).
16
+
17
+ ## 0.8.0 — 2026-11-24
18
+
19
+ **Server-side row grouping** (`serverGroupingFeature`, with `rowGroupingFeature` and
20
+ `serverDataFeature`): a grouped grid with a `data-source` asks the server for groups instead of
21
+ grouping only the rows it has loaded. The query gains `groupBy` and `groupPath`; the source
22
+ answers with `groups: [{ value, count, aggregates }]` (or `rows` at the last level). Only the
23
+ top-level groups load first; expanding a group loads its sub-groups or rows, once, with the
24
+ loading row and error / Retry of lazy sub-grids. `pagination` pages the top-level groups;
25
+ `rowTotal` feeds the status bar. A group's checkbox selects it by query, without loading its
26
+ rows (`v-model:selected-groups`, paths like `[[{ key: 'status', value: 'Won' }]]`); rows inside
27
+ show ticked and locked, the header checkbox selects every top-level group, and the selected groups
28
+ end with a new filter or grouping. Exports cover the loaded rows. Works with virtual scrolling and
29
+ keyboard navigation. New exported types `GroupPath`, `ServerGroup`; group rows gain `count` and
30
+ `path`; `DataSourceResult` gains `groups` and `rowTotal` (`rows` is optional). Without the
31
+ feature, grouped server grids work as before, with a dev hint. Grids without it grow by 0.3 kB
32
+ gzip (the `selected-groups` model and the grouped query), grids with row grouping by 0.6 kB more.
33
+
34
+ Docs: the bundle sizes are measured again. 0.7.0's table was not updated for its own changes:
35
+ a plain grid was 14.5 kB gzip there, not 14.1 (now 14.8).
36
+
3
37
  ## 0.7.0 — 2026-11-24
4
38
 
5
39
  **Text and parts are configurable.** `messages` (`GridMessages`) replaces any built-in text: menus,
package/README.md CHANGED
@@ -132,6 +132,7 @@ an opt-in feature:
132
132
  | `rowPinningFeature` | `v-model:pinned-rows` / `pinRow()`: rows that stay in view above or below the body, plus `pinned-top-rows` / `pinned-bottom-rows` for rows that aren't in the data |
133
133
  | `aggregationFeature` | Column `aggregate` (`sum`, `avg`, `min`, `max`, `count`, a function) and `totals`: a sticky totals row over the filtered rows |
134
134
  | `rowGroupingFeature` | `v-model:group-by`: rows grouped by one or more columns into collapsible group rows with the value, row count and aggregates; Group by / Ungroup in the header menu for `groupable` columns |
135
+ | `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) |
135
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` |
136
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 |
137
138
 
@@ -177,33 +178,34 @@ what you import.
177
178
 
178
179
  | Import (minified / gzip, Vue excluded) | Initial chunk |
179
180
  | ---------------------------------------------------------------------------- | ------------------ |
180
- | `VGrid` (no features) | 40.5 kB / 14.1 kB |
181
- | `VGrid` + `sortingFeature` | 41.2 kB / 14.4 kB |
182
- | `VGrid` + `filteringFeature` | 51.1 kB / 17.8 kB |
183
- | `VGrid` + `serverDataFeature` | 41.8 kB / 14.7 kB |
184
- | `VGrid` + `paginationFeature` | 40.6 kB / 14.1 kB |
185
- | `VGrid` + `selectionFeature` | 44.6 kB / 15.5 kB |
186
- | `VGrid` + `subGridsFeature` | 42.8 kB / 14.9 kB |
187
- | `VGrid` + `menusFeature` | 50.9 kB / 17.6 kB |
188
- | `VGrid` + `columnReorderFeature` | 44.2 kB / 15.3 kB |
189
- | `VGrid` + `columnPinningFeature` | 43.4 kB / 15.1 kB |
190
- | `VGrid` + `virtualScrollingFeature` | 46.2 kB / 16.3 kB |
191
- | `VGrid` + `columnVisibilityFeature` | 40.6 kB / 14.1 kB |
192
- | `VGrid` + `keyboardNavigationFeature` | 43.2 kB / 15.1 kB |
193
- | `VGrid` + `columnResizingFeature` | 43.7 kB / 15.3 kB |
194
- | `VGrid` + `columnGroupsFeature` | 41.8 kB / 14.5 kB |
195
- | `VGrid` + `rowPinningFeature` | 45.4 kB / 15.4 kB |
196
- | `VGrid` + `aggregationFeature` | 45.6 kB / 15.5 kB |
197
- | `VGrid` + `rowGroupingFeature` | 50.2 kB / 16.9 kB |
198
- | `VGrid` + `exportFeature` | 45.4 kB / 16.0 kB |
199
- | `VGrid` + `statusBarFeature` | 42.8 kB / 15.0 kB |
200
- | `VGrid` + `allFeatures` + `VGridSearch` | 108.1 kB / 36.5 kB |
201
- | `VGrid` + `currencyRenderer` | 41.9 kB / 14.5 kB |
202
- | `VGrid` + `VGridPagination` + `VGridColumnMenu` | 47.2 kB / 16.3 kB |
181
+ | `VGrid` (no features) | 43.7 kB / 15.0 kB |
182
+ | `VGrid` + `sortingFeature` | 46.4 kB / 16.0 kB |
183
+ | `VGrid` + `filteringFeature` | 54.5 kB / 18.9 kB |
184
+ | `VGrid` + `serverDataFeature` | 45.2 kB / 15.6 kB |
185
+ | `VGrid` + `paginationFeature` | 43.9 kB / 15.1 kB |
186
+ | `VGrid` + `selectionFeature` | 47.9 kB / 16.5 kB |
187
+ | `VGrid` + `subGridsFeature` | 46.1 kB / 15.8 kB |
188
+ | `VGrid` + `menusFeature` | 55.0 kB / 18.8 kB |
189
+ | `VGrid` + `columnReorderFeature` | 47.4 kB / 16.3 kB |
190
+ | `VGrid` + `columnPinningFeature` | 46.7 kB / 16.1 kB |
191
+ | `VGrid` + `virtualScrollingFeature` | 49.5 kB / 17.2 kB |
192
+ | `VGrid` + `columnVisibilityFeature` | 43.9 kB / 15.1 kB |
193
+ | `VGrid` + `keyboardNavigationFeature` | 46.5 kB / 16.0 kB |
194
+ | `VGrid` + `columnResizingFeature` | 47.0 kB / 16.3 kB |
195
+ | `VGrid` + `columnGroupsFeature` | 45.0 kB / 15.5 kB |
196
+ | `VGrid` + `rowPinningFeature` | 48.7 kB / 16.3 kB |
197
+ | `VGrid` + `aggregationFeature` | 48.9 kB / 16.5 kB |
198
+ | `VGrid` + `rowGroupingFeature` | 54.6 kB / 18.6 kB |
199
+ | `VGrid` + `exportFeature` | 48.7 kB / 16.9 kB |
200
+ | `VGrid` + `statusBarFeature` | 46.2 kB / 16.0 kB |
201
+ | `VGrid` + `serverGroupingFeature` | 46.8 kB / 16.2 kB |
202
+ | `VGrid` + `allFeatures` + `VGridSearch` | 118.3 kB / 39.8 kB |
203
+ | `VGrid` + `currencyRenderer` | 45.1 kB / 15.5 kB |
204
+ | `VGrid` + `VGridPagination` + `VGridColumnMenu` | 51.0 kB / 17.5 kB |
203
205
  | `sortRows` only | 0.7 kB / 0.4 kB |
204
206
  | `toCsv` only | 1.1 kB / 0.6 kB |
205
- | everything | 160.7 kB / 51.5 kB |
206
- | `validateGridConfig` (`@nocopypaste/vue-grid/agent`, never in an app bundle) | 70.5 kB / 19.2 kB |
207
+ | everything | 171.9 kB / 55.2 kB |
208
+ | `validateGridConfig` (`@nocopypaste/vue-grid/agent`, never in an app bundle) | 73.4 kB / 20.0 kB |
207
209
 
208
210
  With `filteringFeature`, the filter popover body and the filter-row editors are **on-demand
209
211
  chunks**: they load the first time a popover opens or `filter-row` is on. With
@@ -228,6 +230,8 @@ chunks that on-demand imports share with the entry, even when nothing uses them.
228
230
  | `columns` | `ColumnDef<T>[]` | — | See below. |
229
231
  | `rowKey` | `keyof T \| (row) => string \| number` | — | Stable unique id; all row state is keyed by it. |
230
232
  | `v-model:sort` | `{ key, dir: 'asc' \| 'desc' } \| null` | `null` | Header click cycles asc → desc → none. Needs `sortingFeature` for the header UI. |
233
+ | `multiSort` | `boolean` | `false` | Shift-click (Shift+Enter) a header to sort by it next; `v-model:sorts` holds every key. See [Sorting](#sorting). |
234
+ | `v-model:sorts` | `SortState[]` | `[]` | Every sort key, the first one first (with `multiSort`). `sort` follows its first key. |
231
235
  | `sortMode` | `'controlled' \| 'client'` | `'controlled'` | `controlled` only emits (server-side sorting). Ignored with `dataSource`. |
232
236
  | `v-model:filters` | `FilterState \| null` | `null` | `{ columns: Record<key, ColumnFilter>, search }`. Needs `filteringFeature` (as do the next four). See [Filtering](#filtering). |
233
237
  | `filterMode` | `'client' \| 'controlled'` | `'client'` | `controlled` only emits (server-side filtering). Ignored with `dataSource`. |
@@ -258,6 +262,7 @@ chunks that on-demand imports share with the entry, even when nothing uses them.
258
262
  | `aggregates` | `Record<string, unknown>` | — | Totals by column key, used instead of computing them (e.g. from a server). |
259
263
  | `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). |
260
264
  | `groupsExpanded` | `boolean` | `false` | Groups start expanded. |
265
+ | `v-model:selectedGroups` | `GroupPath[]` | `[]` | Server-side grouping: groups selected by query, by path (`[[{ key, value }]]`), without their rows. |
261
266
  | `rowClickable` | `boolean` | `false` | Pointer cursor; `row-click` is always emitted. |
262
267
  | `rowClass` | `(row, index) => ClassValue` | — | |
263
268
  | `highlightedRows` | `RowKey[]` | — | |
@@ -499,7 +504,7 @@ typeahead move through items; focus returns to the cell on close.
499
504
  ### Column headers
500
505
 
501
506
  Right-clicking a header opens a built-in menu: **Sort ascending / descending / Clear sort** (sortable
502
- columns), **Pin left / Pin right / Unpin**, **Move left / right**, **Hide column**, **Reset columns**.
507
+ columns; with `multi-sort` also **Then sort ascending / descending**, and Clear sort drops only that column), **Pin left / Pin right / Unpin**, **Move left / right**, **Hide column**, **Reset columns**.
503
508
  Pin items need `columnPinningFeature`, move items `columnReorderFeature`, Hide column `columnVisibilityFeature`. Runtime pins are stored in column state (`columnState.pinned`) and persisted with `storage`.
504
509
 
505
510
  ```vue
@@ -526,6 +531,47 @@ The same component powers the `actions-menu` renderer and is exported for add-on
526
531
  <!-- or imperatively: menuRef.value.openAt(element | { x, y }) -->
527
532
  ```
528
533
 
534
+ ## Sorting
535
+
536
+ A `sortable` column (with `sortingFeature`) sorts on a header click: ascending, descending, none.
537
+ `v-model:sort` holds `{ key, dir }`. The grid sorts the rows itself with `sort-mode="client"`;
538
+ otherwise it only updates `sort` (or asks the `dataSource`). Values sort by type (numbers, dates,
539
+ text with `localeCompare`), a renderer can define its sort value, and a column can override it with
540
+ `sortValue: (row) => …` or `sortFn: (a, b) => …`. Empty values sort last in both directions.
541
+
542
+ **Several columns.** With `multi-sort`, Shift-click a header (Shift+Enter on a focused one) to sort
543
+ by it after the others: ascending, then descending, then removed. A plain click still sorts by that
544
+ column alone. The headers show each column's number (1, 2, …); `aria-sort` stays on the first key, as
545
+ the ARIA grid pattern has it, and screen readers hear the rest as “sorted 2 of 3, descending”. The
546
+ header menu adds **Then sort ascending / descending**.
547
+
548
+ ```vue
549
+ <script setup lang="ts">
550
+ import { VGrid, sortingFeature, type SortState } from '@nocopypaste/vue-grid'
551
+ const sorts = ref<SortState[]>([
552
+ { key: 'city', dir: 'asc' },
553
+ { key: 'stake', dir: 'desc' },
554
+ ])
555
+ </script>
556
+
557
+ <template>
558
+ <VGrid
559
+ v-model:sorts="sorts"
560
+ multi-sort
561
+ sort-mode="client"
562
+ :rows
563
+ :columns
564
+ row-key="id"
565
+ :features="[sortingFeature]"
566
+ />
567
+ </template>
568
+ ```
569
+
570
+ `v-model:sort` keeps working beside it: it is the first key, and setting it from outside makes it
571
+ the only one. A `dataSource` gets every key in `query.sorts` (only with `multi-sort`; `query.sort`
572
+ is still the first). Row groups follow their own column's key wherever it is in the list.
573
+ `sortRowsBy(rows, keys)` and `nextSorts(sorts, key)` sort and cycle without a grid.
574
+
529
575
  ## Filtering
530
576
 
531
577
  ```vue
@@ -671,7 +717,7 @@ import {
671
717
  } from '@nocopypaste/vue-grid'
672
718
 
673
719
  const fetchBets: DataSource<Bet> = async (query, { signal }) => {
674
- // query: { sort: { key, dir } | null, filters: FilterState, page: number, pageSize: number | null }
720
+ // query: { sort: { key, dir } | null, sorts?: SortState[] (multi-sort), filters: FilterState, page: number, pageSize: number | null }
675
721
  const res = await fetch('/api/bets', { method: 'POST', body: JSON.stringify(query), signal })
676
722
  if (!res.ok) throw new Error(res.statusText)
677
723
  return res.json() // { rows: Bet[], total?: number }
@@ -868,6 +914,62 @@ Style group rows with `.vg-rowgroup` (and `[data-group-level]`), `.vg-rowgroup-n
868
914
  `--vg-rowgroup-font-weight` tokens. `groupRows()` and `isRowGroup()` are exported for using the
869
915
  same grouping elsewhere.
870
916
 
917
+ ### Server-side grouping
918
+
919
+ With a `data-source`, `serverGroupingFeature` groups across all the data on the server instead of
920
+ only the rows the grid has loaded. The query then carries `groupBy` and `groupPath`, and your source
921
+ answers with **groups** instead of rows:
922
+
923
+ ```ts
924
+ const source: DataSource<Bet> = async (query, { signal }) => {
925
+ const res = await fetch('/api/bets/search', {
926
+ method: 'POST',
927
+ body: JSON.stringify(query),
928
+ signal,
929
+ })
930
+ return res.json()
931
+ }
932
+ // query.groupBy = ['status', 'city'], query.groupPath = [] → the top-level groups
933
+ // { groups: [{ value: 'Won', count: 1204, aggregates: { stake: 98211.5 } }, …], total: 4 }
934
+ // query.groupPath = [{ key: 'status', value: 'Won' }] → the groups inside "Won"
935
+ // { groups: [{ value: 'Niš', count: 310, aggregates: { … } }, …] }
936
+ // query.groupPath = [{ key: 'status', value: 'Won' }, { key: 'city', value: 'Niš' }]
937
+ // → the last level: { rows: [ …310 rows… ] }
938
+ ```
939
+
940
+ ```vue
941
+ <VGrid
942
+ v-model:group-by="groupBy"
943
+ v-model:selected="selected"
944
+ v-model:selected-groups="selectedGroups"
945
+ :data-source="source"
946
+ :columns="columns"
947
+ row-key="id"
948
+ selectable
949
+ :features="[serverDataFeature, rowGroupingFeature, serverGroupingFeature, selectionFeature]"
950
+ />
951
+ ```
952
+
953
+ - **Lazy.** The first request returns only the top-level groups (`value`, `count`, `aggregates`).
954
+ Expanding a group asks for its sub-groups, or at the last level all its rows; a level loads
955
+ once, with a loading row meanwhile and the error and Retry of lazy sub-grids when it fails
956
+ (`load-error` fires). Requests for a group carry the current sort and filters, `page: 1`,
957
+ `pageSize: null`.
958
+ - **Paging.** `pagination` pages the top-level groups: return their number as `total`. Return
959
+ `rowTotal` (every matching row) for the status bar; without it the groups' counts are added up.
960
+ - **Sort, filters, page.** A new query asks for the top-level groups again; open groups load their
961
+ contents again.
962
+ - **Selection by query.** A group's checkbox selects it by its path in `v-model:selected-groups`
963
+ (`[[{ key: 'status', value: 'Won' }]]`), without loading its rows; rows and sub-groups inside a
964
+ selected group show ticked and locked. The header checkbox selects every top-level group. Act on
965
+ `selectedGroups` + `selected` + the filters on the server. The selected groups end when the
966
+ filters or the grouping change, or with `clearSelection()`; the status bar and the toolbar's
967
+ `selectedCount` add their counts.
968
+ - **Export, print, totals.** `exportCsv()`, `print()` and the others cover the rows that are loaded.
969
+ For the totals row pass `aggregates` (the server's totals).
970
+ - Without the feature, a grouped grid with a data source groups only the rows it has loaded (with
971
+ a dev warning). A source that returns `rows` to a grouped query gets the same.
972
+
871
973
  ## Export and copy
872
974
 
873
975
  `exportFeature` turns the grid's rows into CSV or an Excel workbook, prints them, and copies them to
@@ -1085,7 +1187,7 @@ and the grid's own controls (sort buttons, expanders, checkboxes, filter buttons
1085
1187
  normal Tab order.
1086
1188
 
1087
1189
  With `keyboardNavigationFeature` it is an ARIA `grid` (`treegrid` with sub-grids). The grid is one tab stop. Arrow keys move between cells (header, rows, sub-grid rows, detail rows),
1088
- `Home`/`End`, `Ctrl+Home`/`Ctrl+End`, `PageUp`/`PageDown`; `ContextMenu` / `Shift+F10` opens the context menu. `Enter` sorts a header or activates the
1190
+ `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
1089
1191
  cell's control; `Space` toggles row selection; `→`/`←` on a tree cell expands/collapses; `Alt+←/→` on a
1090
1192
  header moves the column; `Alt+Shift+←/→` on a header resizes it (with `columnResizingFeature`).
1091
1193
 
package/agent/api.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "package": "@nocopypaste/vue-grid",
3
- "version": "0.7.0",
3
+ "version": "0.9.0",
4
4
  "component": "VGrid",
5
5
  "props": [
6
6
  {
@@ -317,6 +317,13 @@
317
317
  "default": "false",
318
318
  "description": "Groups start expanded (row grouping feature). Default: collapsed.",
319
319
  "feature": "rowGrouping"
320
+ },
321
+ {
322
+ "name": "multiSort",
323
+ "type": "boolean",
324
+ "required": false,
325
+ "description": "Multi-column sort (sorting feature): Shift-click (or Shift+Enter) on a header adds it as the next key, Shift-click again turns it descending, then removes it. `v-model:sorts` holds every key, `v-model:sort` the first; server queries get `sorts` too.",
326
+ "feature": "sorting"
320
327
  }
321
328
  ],
322
329
  "models": [
@@ -326,6 +333,13 @@
326
333
  "default": "null",
327
334
  "description": "Sort state: a header click cycles asc → desc → none. Header UI needs the sorting feature."
328
335
  },
336
+ {
337
+ "name": "sorts",
338
+ "type": "SortState[]",
339
+ "default": "[]",
340
+ "description": "Every sort key, the first one first (`multi-sort`). `sort` is the first of them.",
341
+ "feature": "sorting"
342
+ },
329
343
  {
330
344
  "name": "columnState",
331
345
  "type": "ColumnState | undefined",
@@ -386,6 +400,13 @@
386
400
  "default": "false",
387
401
  "description": "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.",
388
402
  "feature": "selection"
403
+ },
404
+ {
405
+ "name": "selectedGroups",
406
+ "type": "GroupPath[]",
407
+ "default": "[]",
408
+ "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.",
409
+ "feature": "serverGrouping"
389
410
  }
390
411
  ],
391
412
  "events": [
@@ -498,7 +519,7 @@
498
519
  },
499
520
  {
500
521
  "name": "toolbar",
501
- "scope": "{ columns: readonly ColumnDef<T>[]; columnState: ColumnState; setColumnState: (state: ColumnState) => void; filters: FilterState; setFilters: (state: FilterState) => void; clearFilters: () => void; activeFilterCount: number; selected: readonly RowKey[]; selectedCount: number; selectAllMatching: boolean; clearSelection: () => void }",
522
+ "scope": "{ columns: readonly ColumnDef<T>[]; columnState: ColumnState; setColumnState: (state: ColumnState) => void; filters: FilterState; setFilters: (state: FilterState) => void; clearFilters: () => void; activeFilterCount: number; selected: readonly RowKey[]; selectedCount: number; selectedGroups: GroupPath[]; selectAllMatching: boolean; clearSelection: () => void }",
502
523
  "description": "Above the grid: put a search box, column menu, filter summary or batch actions here."
503
524
  }
504
525
  ],
@@ -1032,11 +1053,23 @@
1032
1053
  ],
1033
1054
  "columnOptions": []
1034
1055
  },
1056
+ {
1057
+ "id": "serverGrouping",
1058
+ "export": "serverGroupingFeature",
1059
+ "description": "Row grouping with server data: with `group-by` and a `data-source`, the query carries `groupBy` and `groupPath`, the server answers with groups (value, count, aggregates), and each group's contents load when it expands. A group's checkbox selects it by query (`v-model:selected-groups`), without loading its rows. Needs the row grouping and server data features too. Without it, a grouped server grid groups only the rows it has loaded.",
1060
+ "props": [
1061
+ "selectedGroups"
1062
+ ],
1063
+ "columnOptions": []
1064
+ },
1035
1065
  {
1036
1066
  "id": "sorting",
1037
1067
  "export": "sortingFeature",
1038
1068
  "description": "Sorting: the sort button on `sortable` column headers, the sort items of the header menu and, with `sort-mode=\"client\"`, sorting the rows in the browser.",
1039
- "props": [],
1069
+ "props": [
1070
+ "multiSort",
1071
+ "sorts"
1072
+ ],
1040
1073
  "columnOptions": [
1041
1074
  "sortable",
1042
1075
  "sortValue",
package/agent/api.md CHANGED
@@ -1,4 +1,4 @@
1
- # @nocopypaste/vue-grid 0.7.0 — API reference
1
+ # @nocopypaste/vue-grid 0.9.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
 
@@ -23,7 +23,8 @@ Opt-in: pass them as `:features="[…]"` on `<VGrid>` or once via `createVueGrid
23
23
  | `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` | |
24
24
  | `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` | |
25
25
  | `serverDataFeature` | Server data: the `dataSource` prop. The grid sends sort, filters and page to your function, cancels superseded requests, and shows loading, error and retry states. | `dataSource` | |
26
- | `sortingFeature` | Sorting: the sort button on `sortable` column headers, the sort items of the header menu and, with `sort-mode="client"`, sorting the rows in the browser. | | `sortable` `sortValue` `sortFn` |
26
+ | `serverGroupingFeature` | Row grouping with server data: with `group-by` and a `data-source`, the query carries `groupBy` and `groupPath`, the server answers with groups (value, count, aggregates), and each group's contents load when it expands. A group's checkbox selects it by query (`v-model:selected-groups`), without loading its rows. Needs the row grouping and server data features too. Without it, a grouped server grid groups only the rows it has loaded. | `selectedGroups` | |
27
+ | `sortingFeature` | Sorting: the sort button on `sortable` column headers, the sort items of the header menu and, with `sort-mode="client"`, sorting the rows in the browser. | `multiSort` `sorts` | `sortable` `sortValue` `sortFn` |
27
28
  | `statusBarFeature` | A status bar under the grid (`status-bar`): how many rows pass the filters ("84 of 200 rows"), how many are selected, how many filters are on (with Clear), and with `{ summary: ['total'] }` the sum and average of those columns over the selected rows, as the cells show them. The `#status-bar` slot replaces its content. Its component loads on demand (own chunk). | `statusBar` | |
28
29
  | `subGridsFeature` | Sub-grids: nested child rows in a CSS `subgrid`, from `sub-rows` (synchronous) or `load-sub-rows` (lazy, cached, with loading / error / retry). Detail rows (`#detail` slot) don't need it. | `subRows` `loadSubRows` `hasSubRows` | |
29
30
  | `virtualScrollingFeature` | Virtual scrolling: `:virtual="{ rowHeight, overscan?, detailHeight? }"` renders only the rows in view (plus `overscan`), so tens of thousands of rows stay fast — sub-grids and detail rows included, inside the same CSS grid / subgrid layout. Without it, `virtual` is ignored and every row renders. | `virtual` | |
@@ -78,12 +79,14 @@ Opt-in: pass them as `:features="[…]"` on `<VGrid>` or once via `createVueGrid
78
79
  | `totalsLabel` | `string` | | `aggregationFeature` | The totals row's label, in its first column (unless that column has an aggregate). Default: `messages.total`, else `Total`. |
79
80
  | `aggregates` | `Record<string, unknown>` | | `aggregationFeature` | Totals row values by column key, instead of computing them (e.g. totals from a server). |
80
81
  | `groupsExpanded` | `boolean` | `false` | `rowGroupingFeature` | Groups start expanded (row grouping feature). Default: collapsed. |
82
+ | `multiSort` | `boolean` | | `sortingFeature` | Multi-column sort (sorting feature): Shift-click (or Shift+Enter) on a header adds it as the next key, Shift-click again turns it descending, then removes it. `v-model:sorts` holds every key, `v-model:sort` the first; server queries get `sorts` too. |
81
83
 
82
84
  ## `v-model`s
83
85
 
84
86
  | Model | Type | Default | Needs | Description |
85
87
  |---|---|---|---|---|
86
88
  | `v-model:sort` | `SortState \| null` | `null` | | Sort state: a header click cycles asc → desc → none. Header UI needs the sorting feature. |
89
+ | `v-model:sorts` | `SortState[]` | `[]` | `sortingFeature` | Every sort key, the first one first (`multi-sort`). `sort` is the first of them. |
87
90
  | `v-model:columnState` | `ColumnState \| undefined` | `undefined` | | Column order, hidden columns, runtime pins and resized widths (persisted with `storage`). |
88
91
  | `v-model:expanded` | `RowKey[]` | `[]` | | Keys of expanded rows (sub-grids and detail rows). |
89
92
  | `v-model:selected` | `RowKey[]` | `[]` | `selectionFeature` | Keys of selected rows. Needs the selection feature. |
@@ -93,6 +96,7 @@ Opt-in: pass them as `:features="[…]"` on `<VGrid>` or once via `createVueGrid
93
96
  | `v-model:pinnedRows` | `PinnedRowsState \| null` | `null` | `rowPinningFeature` | Top-level rows pinned above / below the body, by key: `{ top, bottom }`. Needs the row pinning feature. |
94
97
  | `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. |
95
98
  | `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. |
99
+ | `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. |
96
100
 
97
101
  ## Events
98
102
 
@@ -124,7 +128,7 @@ Opt-in: pass them as `:features="[…]"` on `<VGrid>` or once via `createVueGrid
124
128
  | `status-bar` | `StatusBarScope` | The status bar's content (status bar feature): replaces the counts and the summary. |
125
129
  | `loading` | | Shown while loading with no rows yet. |
126
130
  | `sub-rows-loading` | `{ row: T }` | Shown while a row's lazy children load. |
127
- | `toolbar` | `{ columns: readonly ColumnDef<T>[]; columnState: ColumnState; setColumnState: (state: ColumnState) => void; filters: FilterState; setFilters: (state: FilterState) => void; clearFilters: () => void; activeFilterCount: number; selected: readonly RowKey[]; selectedCount: number; selectAllMatching: boolean; clearSelection: () => void }` | Above the grid: put a search box, column menu, filter summary or batch actions here. |
131
+ | `toolbar` | `{ columns: readonly ColumnDef<T>[]; columnState: ColumnState; setColumnState: (state: ColumnState) => void; filters: FilterState; setFilters: (state: FilterState) => void; clearFilters: () => void; activeFilterCount: number; selected: readonly RowKey[]; selectedCount: number; selectedGroups: GroupPath[]; selectAllMatching: boolean; clearSelection: () => void }` | Above the grid: put a search box, column menu, filter summary or batch actions here. |
128
132
 
129
133
  ## Exposed methods (`ref<VGridExposed>()`)
130
134
 
@@ -40,6 +40,7 @@
40
40
  "rowPinningFeature",
41
41
  "selectionFeature",
42
42
  "serverDataFeature",
43
+ "serverGroupingFeature",
43
44
  "sortingFeature",
44
45
  "statusBarFeature",
45
46
  "subGridsFeature",
@@ -281,6 +282,10 @@
281
282
  "type": "boolean",
282
283
  "description": "Groups start expanded (row grouping feature). Default: collapsed."
283
284
  },
285
+ "multiSort": {
286
+ "type": "boolean",
287
+ "description": "Multi-column sort (sorting feature): Shift-click (or Shift+Enter) on a header adds it as the next key, Shift-click again turns it descending, then removes it. `v-model:sorts` holds every key, `v-model:sort` the first; server queries get `sorts` too."
288
+ },
284
289
  "sort": {
285
290
  "anyOf": [
286
291
  {
@@ -306,6 +311,27 @@
306
311
  ],
307
312
  "description": "Sort state: a header click cycles asc → desc → none. Header UI needs the sorting feature."
308
313
  },
314
+ "sorts": {
315
+ "type": "array",
316
+ "items": {
317
+ "type": "object",
318
+ "properties": {
319
+ "key": {
320
+ "type": "string",
321
+ "description": "The sorted column’s `key`."
322
+ },
323
+ "dir": {
324
+ "description": "`asc` or `desc`."
325
+ }
326
+ },
327
+ "required": [
328
+ "key",
329
+ "dir"
330
+ ],
331
+ "additionalProperties": false
332
+ },
333
+ "description": "Every sort key, the first one first (`multi-sort`). `sort` is the first of them."
334
+ },
309
335
  "columnState": {
310
336
  "anyOf": [
311
337
  {
@@ -432,6 +458,11 @@
432
458
  "selectAllMatching": {
433
459
  "type": "boolean",
434
460
  "description": "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."
461
+ },
462
+ "selectedGroups": {
463
+ "type": "array",
464
+ "items": {},
465
+ "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."
435
466
  }
436
467
  },
437
468
  "required": [