@nocopypaste/vue-grid 0.3.2 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/AGENTS.md +1 -1
  2. package/CHANGELOG.md +23 -0
  3. package/README.md +61 -51
  4. package/agent/api.json +13 -3
  5. package/agent/api.md +3 -2
  6. package/agent/grid-config.schema.json +11 -0
  7. package/dist/agent/api.js +11 -3
  8. package/dist/agent/requirements.js +3 -1
  9. package/dist/agent/requirements.js.map +1 -1
  10. package/dist/components/VGrid.vue_vue_type_script_setup_true_lang.js +195 -182
  11. package/dist/components/VGrid.vue_vue_type_script_setup_true_lang.js.map +1 -1
  12. package/dist/components/VGridResizeHandle.vue_vue_type_script_setup_true_lang.js +31 -14
  13. package/dist/components/VGridResizeHandle.vue_vue_type_script_setup_true_lang.js.map +1 -1
  14. package/dist/components/VGridRows.vue_vue_type_script_setup_true_lang.js +7 -3
  15. package/dist/components/VGridRows.vue_vue_type_script_setup_true_lang.js.map +1 -1
  16. package/dist/composables/usePinFit.js +41 -0
  17. package/dist/composables/usePinFit.js.map +1 -0
  18. package/dist/core.css +1 -1
  19. package/dist/features/columnPinning.js +8 -6
  20. package/dist/features/columnPinning.js.map +1 -1
  21. package/dist/renderers/ToggleTextCell.vue_vue_type_script_setup_true_lang.js +2 -1
  22. package/dist/renderers/ToggleTextCell.vue_vue_type_script_setup_true_lang.js.map +1 -1
  23. package/dist/renderers.css +1 -1
  24. package/dist/theme.css +1 -1
  25. package/dist/types/components/VGrid.vue.d.ts +6 -0
  26. package/dist/types/composables/usePinFit.d.ts +17 -0
  27. package/dist/types/features/columnPinning.d.ts +3 -1
  28. package/dist/types/types.d.ts +1 -0
  29. package/dist/vue-grid.css +1 -1
  30. package/llms-full.txt +65 -54
  31. package/package.json +1 -1
package/AGENTS.md CHANGED
@@ -55,7 +55,7 @@ JSON Schema. The `@nocopypaste/vue-grid-mcp` MCP server serves all of this as to
55
55
  | An expandable panel under a row | — | `#detail="{ row }"` slot (`row-expandable` to limit it) |
56
56
  | 10,000+ rows | `virtualScrollingFeature` | `:virtual="{ rowHeight: 40 }"` + bounded height |
57
57
  | Right-click menus (cells, headers) | `menusFeature` | `:context-menu="(ctx) => MenuItem[]"` + `@context-action`; header menu is on by default |
58
- | Freeze columns left / right | `columnPinningFeature` | column `pinned: 'left' \| 'right'` |
58
+ | Freeze columns left / right | `columnPinningFeature` | column `pinned: 'left' \| 'right'`; on narrow grids they scroll unless `pinned-max-share` allows (default half the width) |
59
59
  | Show / hide columns | `columnVisibilityFeature` | column `hidden: true`; `<VGridColumnMenu>` in `#toolbar` |
60
60
  | Drag columns to reorder | `columnReorderFeature` | column `reorderable: false` to lock one |
61
61
  | Drag column edges to resize | `columnResizingFeature` | `minWidth` / `maxWidth`, `resizable: false` |
package/CHANGELOG.md CHANGED
@@ -1,5 +1,28 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.4.1 — 2026-11-24
4
+
5
+ **Accessibility**, found by a new axe-core check (WCAG 2.1 A / AA) of every story, light and dark,
6
+ now run in CI:
7
+
8
+ - The column resize grip (a focusable `separator`) announces the column's width
9
+ (`aria-valuenow`, `aria-valuetext`).
10
+ - Nested sub-grids no longer put a `rowgroup` inside a `rowgroup`.
11
+ - Rows carry `aria-expanded` only in a `treegrid`; in a plain grid or table the expander button
12
+ already does, and on a row it isn't valid ARIA.
13
+ - A `toggle-text` button with no text is named after its column.
14
+ - Soft status badges (`status`, `details`) and the group row count meet the 4.5:1 contrast
15
+ ratio: the tone text is a little darker (light) or lighter (dark).
16
+
17
+ ## 0.4.0 — 2026-11-24
18
+
19
+ **Pinned columns on phones** (column pinning feature): while the pinned columns together would
20
+ take more than half of the grid's width (a phone, a narrow side panel), they scroll like the
21
+ others, so the rest of the row stays readable; they pin again once the grid is wide enough. The
22
+ pins stay in the column state and the header menu. `pinned-max-share` sets the share (default
23
+ `0.5`); `false` keeps the old behaviour, always pinned. The grid has the `vg-pins-dropped` class
24
+ meanwhile.
25
+
3
26
  ## 0.3.2 — 2026-11-24
4
27
 
5
28
  Row grouping fixes:
package/README.md CHANGED
@@ -120,7 +120,7 @@ an opt-in feature:
120
120
  | `subGridsFeature` | `sub-rows` / `load-sub-rows` / `has-sub-rows`: nested rows in a CSS `subgrid` (detail rows don't need it) |
121
121
  | `menusFeature` | The header right-click menu (`header-menu`) and body-cell menus (`context-menu`); without it the browser's menu shows. The standalone `<VGridMenu>` and the `actions-menu` renderer don't need it |
122
122
  | `columnReorderFeature` | Dragging headers to reorder (mouse and pen; on touch, hold the header first), Alt+←/→ on a header, the header menu's Move items |
123
- | `columnPinningFeature` | Sticky `pinned: 'left' \| 'right'` columns with edge shadows, the header menu's Pin items; without it pins are ignored |
123
+ | `columnPinningFeature` | Sticky `pinned: 'left' \| 'right'` columns with edge shadows, the header menu's Pin items; while they'd take more than `pinned-max-share` of the grid (half), they scroll like the others; without it pins are ignored |
124
124
  | `virtualScrollingFeature` | `virtual: { rowHeight, overscan?, detailHeight? }`: only the rows in view render, sub-grids and detail rows included; without it every row renders |
125
125
  | `columnVisibilityFeature` | `hidden: true` columns, `columnState.hidden`, the header menu's Hide column item; without it every column shows |
126
126
  | `keyboardNavigationFeature` | The ARIA grid pattern: one Tab stop, arrow keys / Home / End / PageUp / PageDown between cells, Enter, Space to select, →/← to expand, Alt+←/→ to move a column. Without it the grid is an ARIA `table` with its controls in the Tab order |
@@ -215,56 +215,57 @@ chunks that on-demand imports share with the entry, even when nothing uses them.
215
215
 
216
216
  ### Props
217
217
 
218
- | Prop | Type | Default | |
219
- | ------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------- | -------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
220
- | `rows` | `T[]` | `[]` | Your data objects, used as-is (never mutated). Not needed with `dataSource`. |
221
- | `features` | `GridFeature[]` | — | Opt-in features for this grid, added to the app-wide ones. See [Features](#features-everything-optional). |
222
- | `dataSource` | `(query, { signal }) => Promise<{ rows, total? }>` | — | Server rows: the grid calls it whenever sort, filters or page change. Needs `serverDataFeature`. See [Server data](#server-data). |
223
- | `columns` | `ColumnDef<T>[]` | — | See below. |
224
- | `rowKey` | `keyof T \| (row) => string \| number` | — | Stable unique id; all row state is keyed by it. |
225
- | `v-model:sort` | `{ key, dir: 'asc' \| 'desc' } \| null` | `null` | Header click cycles asc → desc → none. Needs `sortingFeature` for the header UI. |
226
- | `sortMode` | `'controlled' \| 'client'` | `'controlled'` | `controlled` only emits (server-side sorting). Ignored with `dataSource`. |
227
- | `v-model:filters` | `FilterState \| null` | `null` | `{ columns: Record<key, ColumnFilter>, search }`. Needs `filteringFeature` (as do the next four). See [Filtering](#filtering). |
228
- | `filterMode` | `'client' \| 'controlled'` | `'client'` | `controlled` only emits (server-side filtering). Ignored with `dataSource`. |
229
- | `filterRow` | `boolean` | `false` | A row of inline filter inputs under the headers. |
230
- | `filterStorage` | `string \| FilterStateStorage` | — | Persist filters (`string` = localStorage key). |
231
- | `noMatchText` | `string` | `'No rows match the current filters.'` | Shown, with a _Clear filters_ button, when filters hide every row. |
232
- | `pagination` | `boolean \| { pageSizes?: number[] }` | `false` | Built-in pagination bar: slices client rows, or asks the `dataSource` for pages. Needs `paginationFeature`. |
233
- | `v-model:page` / `v-model:pageSize` | `number` | `1` / `25` | Reset to page 1 when sort or filters change. |
234
- | `v-model:columnState` | `{ order: string[]; hidden: string[]; pinned?: Record<string, "left" \| "right" \| null>; widths?: Record<string, string> }` | derived | Column order, visibility and runtime pins. |
235
- | `storage` | `string \| ColumnStateStorage` | — | Persist column state (`string` = localStorage key). |
236
- | `v-model:expanded` | `RowKey[]` | `[]` | Expanded rows (sub-grids and detail rows). |
237
- | `subRows` | `(row) => T[] \| undefined` | — | Synchronous children → sub-grid. Needs `subGridsFeature` (as do the next two). |
238
- | `loadSubRows` | `(row) => Promise<T[]>` | — | Lazy children (cached, loading/error/retry). |
239
- | `hasSubRows` | `(row) => boolean` | — | Which rows get an expander when lazy. |
240
- | `rowExpandable` | `(row) => boolean` | — | Which rows can open the `#detail` slot. |
241
- | `selectable` | `boolean \| 'single'` | `false` | Adds a selection column. Needs `selectionFeature` (as do the next five). See [Selection and batch actions](#selection-and-batch-actions). |
242
- | `v-model:selected` | `RowKey[]` | `[]` | |
243
- | `selectionMode` | `'cascade' \| 'independent'` | `'cascade'` | Whether selecting a parent selects its children. |
244
- | `isRowSelectable` | `(row) => boolean` | — | |
245
- | `pruneSelection` | `boolean` | `false` | Drop selected keys whose rows left the data (reload, delete, another server page). |
246
- | `v-model:selectAllMatching` | `boolean` | `false` | Server data: every row matching the query is selected (from the banner). |
247
- | `virtual` | `{ rowHeight: number; overscan?: number; detailHeight?: number } \| false` | `false` | Virtual scrolling (fixed-height rows; sub-grids and measured detail rows included). Needs `virtualScrollingFeature`. |
248
- | `v-model:pinnedRows` | `{ top?: RowKey[]; bottom?: RowKey[] } \| null` | `null` | Top-level rows pinned above / below the body. Needs `rowPinningFeature` (as do the next two). See [Pinned rows and totals](#pinned-rows-and-totals). |
249
- | `pinnedTopRows` / `pinnedBottomRows` | `T[]` | — | Extra pinned rows that aren't part of `rows` (a target, last year's figures). |
250
- | `totals` | `boolean \| 'top' \| 'bottom'` | `false` | A totals row with each column's `aggregate`; `true` = `'bottom'`. Needs `aggregationFeature` (as do the next two). |
251
- | `totalsLabel` | `string` | `'Total'` | Shown in the totals row's first column (unless that column has an aggregate). |
252
- | `aggregates` | `Record<string, unknown>` | — | Totals by column key, used instead of computing them (e.g. from a server). |
253
- | `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). |
254
- | `groupsExpanded` | `boolean` | `false` | Groups start expanded. |
255
- | `rowClickable` | `boolean` | `false` | Pointer cursor; `row-click` is always emitted. |
256
- | `rowClass` | `(row, index) => ClassValue` | — | |
257
- | `highlightedRows` | `RowKey[]` | — | |
258
- | `flash` | `boolean \| 'direction'` | `false` | Briefly highlight cells whose value changes; `'direction'` = green up / red down. Columns override with `flash`. |
259
- | `renderers` | `CellRendererDefinition[]` | — | Renderers usable by name in this grid (override plugin ones). |
260
- | `locale` / `currency` / `timeZone` | `string` | plugin → browser | Formatting context for renderers. |
261
- | `density` | `'compact' \| 'cozy' \| 'comfortable'` | `'cozy'` | Scales cell padding. |
262
- | `loading` | `boolean` | `false` | Progress bar + `aria-busy`. |
263
- | `emptyText` | `string` | `'No data to show.'` | |
264
- | `ariaLabel` | `string` | — | |
265
- | `contextMenu` | `(ctx: { row, rowKey, column, value }) => MenuItem[] \| null` | — | Right-click menu for body cells. Needs `menusFeature`. |
266
- | `headerMenu` | `boolean \| ({ column, items }) => MenuItem[] \| null` | `true` | Built-in header menu (sort, pin, move, hide, reset). Needs `menusFeature`. |
267
- | `ui` | `Partial<Record<'root' \| 'header' \| 'headerCell' \| 'row' \| 'cell' \| 'subgrid' \| 'detail' \| 'empty', ClassValue>>` | — | Extra classes per part (Tailwind-friendly). |
218
+ | Prop | Type | Default | |
219
+ | ------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------- | -------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
220
+ | `rows` | `T[]` | `[]` | Your data objects, used as-is (never mutated). Not needed with `dataSource`. |
221
+ | `features` | `GridFeature[]` | — | Opt-in features for this grid, added to the app-wide ones. See [Features](#features-everything-optional). |
222
+ | `dataSource` | `(query, { signal }) => Promise<{ rows, total? }>` | — | Server rows: the grid calls it whenever sort, filters or page change. Needs `serverDataFeature`. See [Server data](#server-data). |
223
+ | `columns` | `ColumnDef<T>[]` | — | See below. |
224
+ | `rowKey` | `keyof T \| (row) => string \| number` | — | Stable unique id; all row state is keyed by it. |
225
+ | `v-model:sort` | `{ key, dir: 'asc' \| 'desc' } \| null` | `null` | Header click cycles asc → desc → none. Needs `sortingFeature` for the header UI. |
226
+ | `sortMode` | `'controlled' \| 'client'` | `'controlled'` | `controlled` only emits (server-side sorting). Ignored with `dataSource`. |
227
+ | `v-model:filters` | `FilterState \| null` | `null` | `{ columns: Record<key, ColumnFilter>, search }`. Needs `filteringFeature` (as do the next four). See [Filtering](#filtering). |
228
+ | `filterMode` | `'client' \| 'controlled'` | `'client'` | `controlled` only emits (server-side filtering). Ignored with `dataSource`. |
229
+ | `filterRow` | `boolean` | `false` | A row of inline filter inputs under the headers. |
230
+ | `filterStorage` | `string \| FilterStateStorage` | — | Persist filters (`string` = localStorage key). |
231
+ | `noMatchText` | `string` | `'No rows match the current filters.'` | Shown, with a _Clear filters_ button, when filters hide every row. |
232
+ | `pagination` | `boolean \| { pageSizes?: number[] }` | `false` | Built-in pagination bar: slices client rows, or asks the `dataSource` for pages. Needs `paginationFeature`. |
233
+ | `v-model:page` / `v-model:pageSize` | `number` | `1` / `25` | Reset to page 1 when sort or filters change. |
234
+ | `v-model:columnState` | `{ order: string[]; hidden: string[]; pinned?: Record<string, "left" \| "right" \| null>; widths?: Record<string, string> }` | derived | Column order, visibility and runtime pins. |
235
+ | `storage` | `string \| ColumnStateStorage` | — | Persist column state (`string` = localStorage key). |
236
+ | `pinnedMaxShare` | `number \| false` | `0.5` | Pinned columns scroll like the others while together they'd take more than this share of the grid's width (a phone, a narrow panel), and pin again once there's room. `false`: always pinned. Needs `columnPinningFeature`. |
237
+ | `v-model:expanded` | `RowKey[]` | `[]` | Expanded rows (sub-grids and detail rows). |
238
+ | `subRows` | `(row) => T[] \| undefined` | — | Synchronous children → sub-grid. Needs `subGridsFeature` (as do the next two). |
239
+ | `loadSubRows` | `(row) => Promise<T[]>` | — | Lazy children (cached, loading/error/retry). |
240
+ | `hasSubRows` | `(row) => boolean` | — | Which rows get an expander when lazy. |
241
+ | `rowExpandable` | `(row) => boolean` | — | Which rows can open the `#detail` slot. |
242
+ | `selectable` | `boolean \| 'single'` | `false` | Adds a selection column. Needs `selectionFeature` (as do the next five). See [Selection and batch actions](#selection-and-batch-actions). |
243
+ | `v-model:selected` | `RowKey[]` | `[]` | |
244
+ | `selectionMode` | `'cascade' \| 'independent'` | `'cascade'` | Whether selecting a parent selects its children. |
245
+ | `isRowSelectable` | `(row) => boolean` | — | |
246
+ | `pruneSelection` | `boolean` | `false` | Drop selected keys whose rows left the data (reload, delete, another server page). |
247
+ | `v-model:selectAllMatching` | `boolean` | `false` | Server data: every row matching the query is selected (from the banner). |
248
+ | `virtual` | `{ rowHeight: number; overscan?: number; detailHeight?: number } \| false` | `false` | Virtual scrolling (fixed-height rows; sub-grids and measured detail rows included). Needs `virtualScrollingFeature`. |
249
+ | `v-model:pinnedRows` | `{ top?: RowKey[]; bottom?: RowKey[] } \| null` | `null` | Top-level rows pinned above / below the body. Needs `rowPinningFeature` (as do the next two). See [Pinned rows and totals](#pinned-rows-and-totals). |
250
+ | `pinnedTopRows` / `pinnedBottomRows` | `T[]` | — | Extra pinned rows that aren't part of `rows` (a target, last year's figures). |
251
+ | `totals` | `boolean \| 'top' \| 'bottom'` | `false` | A totals row with each column's `aggregate`; `true` = `'bottom'`. Needs `aggregationFeature` (as do the next two). |
252
+ | `totalsLabel` | `string` | `'Total'` | Shown in the totals row's first column (unless that column has an aggregate). |
253
+ | `aggregates` | `Record<string, unknown>` | — | Totals by column key, used instead of computing them (e.g. from a server). |
254
+ | `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). |
255
+ | `groupsExpanded` | `boolean` | `false` | Groups start expanded. |
256
+ | `rowClickable` | `boolean` | `false` | Pointer cursor; `row-click` is always emitted. |
257
+ | `rowClass` | `(row, index) => ClassValue` | — | |
258
+ | `highlightedRows` | `RowKey[]` | — | |
259
+ | `flash` | `boolean \| 'direction'` | `false` | Briefly highlight cells whose value changes; `'direction'` = green up / red down. Columns override with `flash`. |
260
+ | `renderers` | `CellRendererDefinition[]` | — | Renderers usable by name in this grid (override plugin ones). |
261
+ | `locale` / `currency` / `timeZone` | `string` | plugin → browser | Formatting context for renderers. |
262
+ | `density` | `'compact' \| 'cozy' \| 'comfortable'` | `'cozy'` | Scales cell padding. |
263
+ | `loading` | `boolean` | `false` | Progress bar + `aria-busy`. |
264
+ | `emptyText` | `string` | `'No data to show.'` | |
265
+ | `ariaLabel` | `string` | — | |
266
+ | `contextMenu` | `(ctx: { row, rowKey, column, value }) => MenuItem[] \| null` | — | Right-click menu for body cells. Needs `menusFeature`. |
267
+ | `headerMenu` | `boolean \| ({ column, items }) => MenuItem[] \| null` | `true` | Built-in header menu (sort, pin, move, hide, reset). Needs `menusFeature`. |
268
+ | `ui` | `Partial<Record<'root' \| 'header' \| 'headerCell' \| 'row' \| 'cell' \| 'subgrid' \| 'detail' \| 'empty', ClassValue>>` | — | Extra classes per part (Tailwind-friendly). |
268
269
 
269
270
  ### Events
270
271
 
@@ -992,6 +993,11 @@ the filter popover, filter-row editors and pager are separate chunks loaded on f
992
993
 
993
994
  ## Keyboard
994
995
 
996
+ Every Storybook story is checked with axe-core against WCAG 2.1 A / AA, in light and dark mode,
997
+ in CI (`e2e/a11y.storybook.spec.ts`). Rows expose `aria-expanded` and `aria-level` in a `treegrid`;
998
+ in a plain `grid` or `table` the expander button carries `aria-expanded`. A column's resize grip is
999
+ a focusable `separator` whose value is the column's width.
1000
+
995
1001
  Without `keyboardNavigationFeature` the grid is an ARIA `table`. The scroll area is one Tab stop,
996
1002
  and the grid's own controls (sort buttons, expanders, checkboxes, filter buttons) follow in the
997
1003
  normal Tab order.
@@ -1008,6 +1014,10 @@ header moves the column; `Alt+Shift+←/→` on a header resizes it (with `colum
1008
1014
  your own element inside a flex or grid layout, give that element `min-width: 0` too, or it
1009
1015
  grows to the columns' width. The toolbar wraps, and on narrow screens the pager drops its
1010
1016
  « / » buttons (page 1 and the last page stay).
1017
+ - **Pinned columns** that would take more than half of a narrow grid (`pinned-max-share`)
1018
+ scroll like the others there, so the rest of the row stays readable; they pin again once the
1019
+ grid is wide enough. The pins stay in the column state; `pinned-max-share="false"` keeps them
1020
+ pinned at any width.
1011
1021
  - **Swipes scroll** the grid, also when they start on a header (except on a column's narrow
1012
1022
  resize edge).
1013
1023
  - **Hold a header** (about half a second) to pick the column up, then drag it to reorder
package/agent/api.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "package": "@nocopypaste/vue-grid",
3
- "version": "0.3.2",
3
+ "version": "0.4.1",
4
4
  "component": "VGrid",
5
5
  "props": [
6
6
  {
@@ -178,6 +178,14 @@
178
178
  "required": false,
179
179
  "description": "Persist column state (order, hidden, pins, widths): a localStorage key or your own storage."
180
180
  },
181
+ {
182
+ "name": "pinnedMaxShare",
183
+ "type": "number | false",
184
+ "required": false,
185
+ "default": "0.5",
186
+ "description": "Pinned columns scroll like the others while together they'd take more than this share of the grid's width (a phone, a narrow panel); pinned again once there's room. `false`: always pinned. Column pinning feature.",
187
+ "feature": "columnPinning"
188
+ },
181
189
  {
182
190
  "name": "renderers",
183
191
  "type": "CellRendererDefinition[]",
@@ -827,8 +835,10 @@
827
835
  {
828
836
  "id": "columnPinning",
829
837
  "export": "columnPinningFeature",
830
- "description": "Pinned columns: `pinned: 'left' | 'right'` columns stay put (sticky) while the grid scrolls sideways, with edge shadows; runtime pins from the header menu (Pin left / Pin right / Unpin) are kept in `v-model:column-state` and persisted with `storage`. Without it, pins are ignored.",
831
- "props": [],
838
+ "description": "Pinned columns: `pinned: 'left' | 'right'` columns stay put (sticky) while the grid scrolls sideways, with edge shadows; runtime pins from the header menu (Pin left / Pin right / Unpin) are kept in `v-model:column-state` and persisted with `storage`. While the pinned columns would take more than `pinned-max-share` of the grid's width (half, by default), they scroll like the others. Without it, pins are ignored.",
839
+ "props": [
840
+ "pinnedMaxShare"
841
+ ],
832
842
  "columnOptions": [
833
843
  "pinned",
834
844
  "pinnable"
package/agent/api.md CHANGED
@@ -1,4 +1,4 @@
1
- # @nocopypaste/vue-grid 0.3.2 — API reference
1
+ # @nocopypaste/vue-grid 0.4.1 — 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
 
@@ -10,7 +10,7 @@ Opt-in: pass them as `:features="[…]"` on `<VGrid>` or once via `createVueGrid
10
10
  |---|---|---|---|
11
11
  | `aggregationFeature` | Aggregates and the totals row: columns with an `aggregate` (`sum`, `avg`, `min`, `max`, `count` or a function) and `totals` (`true` / `'bottom'` or `'top'`) show a sticky totals row over the rows that pass the filters, on every page. `aggregates` supplies the values instead (e.g. from a server). Without it, `aggregate` and `totals` are ignored. | `totals` `totalsLabel` `aggregates` | `aggregate` |
12
12
  | `columnGroupsFeature` | Grouped column headers: give columns a `group` and adjacent visible columns of the same group get one header cell spanning them, in a sticky row above the column headers. Groups follow reordering, hiding and pinning (a pin boundary splits a group). Without it, `group` is ignored. | | `group` |
13
- | `columnPinningFeature` | Pinned columns: `pinned: 'left' \| 'right'` columns stay put (sticky) while the grid scrolls sideways, with edge shadows; runtime pins from the header menu (Pin left / Pin right / Unpin) are kept in `v-model:column-state` and persisted with `storage`. Without it, pins are ignored. | | `pinned` `pinnable` |
13
+ | `columnPinningFeature` | Pinned columns: `pinned: 'left' \| 'right'` columns stay put (sticky) while the grid scrolls sideways, with edge shadows; runtime pins from the header menu (Pin left / Pin right / Unpin) are kept in `v-model:column-state` and persisted with `storage`. While the pinned columns would take more than `pinned-max-share` of the grid's width (half, by default), they scroll like the others. Without it, pins are ignored. | `pinnedMaxShare` | `pinned` `pinnable` |
14
14
  | `columnReorderFeature` | Column reordering: drag a header (mouse, pen, touch), Alt+←/→ on a focused header, and the header menu's Move left / Move right. Columns opt out with `reorderable: false`. The order is part of `v-model:column-state` and persisted with `storage`; `<VGridColumnMenu>` works without it. | | `reorderable` |
15
15
  | `columnResizingFeature` | Column resizing: drag a header's edge (mouse, pen, touch), use ←/→ on the focused edge (Alt+Shift+←/→ on a header with keyboard navigation), or double-click the edge to fit the content. `minWidth` / `maxWidth` bound it; columns opt out with `resizable: false`. Widths are kept in `columnState.widths` and persisted with `storage`. The header menu gains Fit width / Reset width. | | `maxWidth` `resizable` |
16
16
  | `columnVisibilityFeature` | Column visibility: `hidden: true` columns, `columnState.hidden` (persisted with `storage`), the header menu's Hide column item and `<VGridColumnMenu>`'s checkboxes. Columns opt out with `hideable: false`. Without it, every column shows. | | `hidden` `hideable` |
@@ -56,6 +56,7 @@ Opt-in: pass them as `:features="[…]"` on `<VGrid>` or once via `createVueGrid
56
56
  | `flash` | `FlashMode` | | | Briefly highlight cells whose value changes (live data, enrichment). Columns can override. |
57
57
  | `virtual` | `VirtualOptions \| false` | `false` | `virtualScrollingFeature` | Virtual scrolling: only the rows in view render. Rows share one height (`rowHeight`, px) and the grid needs a bounded height. Needs the virtual scrolling feature. |
58
58
  | `storage` | `ColumnStateStorage \| string` | | | Persist column state (order, hidden, pins, widths): a localStorage key or your own storage. |
59
+ | `pinnedMaxShare` | `number \| false` | `0.5` | `columnPinningFeature` | Pinned columns scroll like the others while together they'd take more than this share of the grid's width (a phone, a narrow panel); pinned again once there's room. `false`: always pinned. Column pinning feature. |
59
60
  | `renderers` | `CellRendererDefinition[]` | | | Renderers usable by name in this grid (merged over the app-wide ones). |
60
61
  | `locale` | `string` | | | Locale for number / date renderers (default: the plugin's, else the browser's). |
61
62
  | `currency` | `string` | | | Default ISO 4217 currency for currency renderers. |
@@ -185,6 +185,17 @@
185
185
  "storage": {
186
186
  "description": "Persist column state (order, hidden, pins, widths): a localStorage key or your own storage."
187
187
  },
188
+ "pinnedMaxShare": {
189
+ "anyOf": [
190
+ {
191
+ "type": "number"
192
+ },
193
+ {
194
+ "const": false
195
+ }
196
+ ],
197
+ "description": "Pinned columns scroll like the others while together they'd take more than this share of the grid's width (a phone, a narrow panel); pinned again once there's room. `false`: always pinned. Column pinning feature."
198
+ },
188
199
  "renderers": {
189
200
  "type": "array",
190
201
  "items": {},
package/dist/agent/api.js CHANGED
@@ -1,5 +1,5 @@
1
1
  // src/agent/api.json
2
- var e = "0.3.2", t = "VGrid", n = [
2
+ var e = "0.4.1", t = "VGrid", n = [
3
3
  {
4
4
  name: "rows",
5
5
  type: "readonly T[]",
@@ -175,6 +175,14 @@ var e = "0.3.2", t = "VGrid", n = [
175
175
  required: !1,
176
176
  description: "Persist column state (order, hidden, pins, widths): a localStorage key or your own storage."
177
177
  },
178
+ {
179
+ name: "pinnedMaxShare",
180
+ type: "number | false",
181
+ required: !1,
182
+ default: "0.5",
183
+ description: "Pinned columns scroll like the others while together they'd take more than this share of the grid's width (a phone, a narrow panel); pinned again once there's room. `false`: always pinned. Column pinning feature.",
184
+ feature: "columnPinning"
185
+ },
178
186
  {
179
187
  name: "renderers",
180
188
  type: "CellRendererDefinition[]",
@@ -814,8 +822,8 @@ var e = "0.3.2", t = "VGrid", n = [
814
822
  {
815
823
  id: "columnPinning",
816
824
  export: "columnPinningFeature",
817
- description: "Pinned columns: `pinned: 'left' | 'right'` columns stay put (sticky) while the grid scrolls sideways, with edge shadows; runtime pins from the header menu (Pin left / Pin right / Unpin) are kept in `v-model:column-state` and persisted with `storage`. Without it, pins are ignored.",
818
- props: [],
825
+ description: "Pinned columns: `pinned: 'left' | 'right'` columns stay put (sticky) while the grid scrolls sideways, with edge shadows; runtime pins from the header menu (Pin left / Pin right / Unpin) are kept in `v-model:column-state` and persisted with `storage`. While the pinned columns would take more than `pinned-max-share` of the grid's width (half, by default), they scroll like the others. Without it, pins are ignored.",
826
+ props: ["pinnedMaxShare"],
819
827
  columnOptions: ["pinned", "pinnable"]
820
828
  },
821
829
  {
@@ -9,6 +9,7 @@ var e = {
9
9
  pruneSelection: "selection",
10
10
  selectAllMatching: "selection",
11
11
  selectionMode: "selection",
12
+ pinnedMaxShare: "columnPinning",
12
13
  isRowSelectable: "selection",
13
14
  subRows: "subGrids",
14
15
  loadSubRows: "subGrids",
@@ -59,7 +60,8 @@ var e = {
59
60
  "resizable",
60
61
  "searchable",
61
62
  "headerMenu",
62
- "exportable"
63
+ "exportable",
64
+ "pinnedMaxShare"
63
65
  ]), r = (e) => `${e}Feature`;
64
66
  export { t as columnFeatures, r as featureExport, n as optOuts, e as propFeatures };
65
67
 
@@ -1 +1 @@
1
- {"version":3,"file":"requirements.js","names":["propFeatures","columnFeatures","optOuts","featureExport","id"],"sources":["../../src/agent/requirements.ts"],"sourcesContent":["/**\n * Which feature each grid prop and column option needs (without it the option does nothing). The\n * one fact about the API the types don't carry: the agent API reference (`api.json`), the JSON\n * Schema and `validateGridConfig()` all read it from here.\n */\nexport type FeatureId =\n | 'sorting'\n | 'filtering'\n | 'serverData'\n | 'pagination'\n | 'selection'\n | 'subGrids'\n | 'menus'\n | 'columnReorder'\n | 'columnPinning'\n | 'virtualScrolling'\n | 'columnVisibility'\n | 'keyboardNavigation'\n | 'columnResizing'\n | 'columnGroups'\n | 'rowPinning'\n | 'aggregation'\n | 'rowGrouping'\n | 'export'\n\n/** Grid props (and `v-model`s) that need a feature. */\nexport const propFeatures: Readonly<Record<string, FeatureId>> = {\n dataSource: 'serverData',\n pagination: 'pagination',\n page: 'pagination',\n pageSize: 'pagination',\n selectable: 'selection',\n selected: 'selection',\n pruneSelection: 'selection',\n selectAllMatching: 'selection',\n selectionMode: 'selection',\n isRowSelectable: 'selection',\n subRows: 'subGrids',\n loadSubRows: 'subGrids',\n hasSubRows: 'subGrids',\n virtual: 'virtualScrolling',\n contextMenu: 'menus',\n headerMenu: 'menus',\n filters: 'filtering',\n filterMode: 'filtering',\n filterRow: 'filtering',\n filterStorage: 'filtering',\n noMatchText: 'filtering',\n pinnedRows: 'rowPinning',\n pinnedTopRows: 'rowPinning',\n pinnedBottomRows: 'rowPinning',\n totals: 'aggregation',\n totalsLabel: 'aggregation',\n aggregates: 'aggregation',\n groupBy: 'rowGrouping',\n groupsExpanded: 'rowGrouping',\n}\n\n/** Column options that need a feature. */\nexport const columnFeatures: Readonly<Record<string, FeatureId>> = {\n sortable: 'sorting',\n sortValue: 'sorting',\n sortFn: 'sorting',\n filterable: 'filtering',\n filter: 'filtering',\n filterValue: 'filtering',\n filterFn: 'filtering',\n filterComponent: 'filtering',\n searchable: 'filtering',\n pinned: 'columnPinning',\n pinnable: 'columnPinning',\n hidden: 'columnVisibility',\n hideable: 'columnVisibility',\n reorderable: 'columnReorder',\n resizable: 'columnResizing',\n maxWidth: 'columnResizing',\n group: 'columnGroups',\n aggregate: 'aggregation',\n groupable: 'rowGrouping',\n groupValue: 'rowGrouping',\n exportValue: 'export',\n exportable: 'export',\n}\n\n/**\n * Options whose default is \"on\" and that only opt *out*: setting them without the feature changes\n * nothing worth a warning (`pinnable: false` on a grid without pinning is fine).\n */\nexport const optOuts: ReadonlySet<string> = new Set([\n 'pinnable',\n 'hideable',\n 'reorderable',\n 'resizable',\n 'searchable',\n 'headerMenu',\n 'exportable',\n])\n\n/** The export name of a feature: `sorting` → `sortingFeature`. */\nexport const featureExport = (id: FeatureId) => `${id}Feature`\n"],"mappings":";AA0BA,IAAaA,IAAoD;CAC/D,YAAY;CACZ,YAAY;CACZ,MAAM;CACN,UAAU;CACV,YAAY;CACZ,UAAU;CACV,gBAAgB;CAChB,mBAAmB;CACnB,eAAe;CACf,iBAAiB;CACjB,SAAS;CACT,aAAa;CACb,YAAY;CACZ,SAAS;CACT,aAAa;CACb,YAAY;CACZ,SAAS;CACT,YAAY;CACZ,WAAW;CACX,eAAe;CACf,aAAa;CACb,YAAY;CACZ,eAAe;CACf,kBAAkB;CAClB,QAAQ;CACR,aAAa;CACb,YAAY;CACZ,SAAS;CACT,gBAAgB;AAClB,GAGaC,IAAsD;CACjE,UAAU;CACV,WAAW;CACX,QAAQ;CACR,YAAY;CACZ,QAAQ;CACR,aAAa;CACb,UAAU;CACV,iBAAiB;CACjB,YAAY;CACZ,QAAQ;CACR,UAAU;CACV,QAAQ;CACR,UAAU;CACV,aAAa;CACb,WAAW;CACX,UAAU;CACV,OAAO;CACP,WAAW;CACX,WAAW;CACX,YAAY;CACZ,aAAa;CACb,YAAY;AACd,GAMaC,oBAA+B,IAAI,IAAI;CAClD;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC,GAGYC,KAAiB,MAAkB,GAAGC,EAAG"}
1
+ {"version":3,"file":"requirements.js","names":["propFeatures","columnFeatures","optOuts","featureExport","id"],"sources":["../../src/agent/requirements.ts"],"sourcesContent":["/**\n * Which feature each grid prop and column option needs (without it the option does nothing). The\n * one fact about the API the types don't carry: the agent API reference (`api.json`), the JSON\n * Schema and `validateGridConfig()` all read it from here.\n */\nexport type FeatureId =\n | 'sorting'\n | 'filtering'\n | 'serverData'\n | 'pagination'\n | 'selection'\n | 'subGrids'\n | 'menus'\n | 'columnReorder'\n | 'columnPinning'\n | 'virtualScrolling'\n | 'columnVisibility'\n | 'keyboardNavigation'\n | 'columnResizing'\n | 'columnGroups'\n | 'rowPinning'\n | 'aggregation'\n | 'rowGrouping'\n | 'export'\n\n/** Grid props (and `v-model`s) that need a feature. */\nexport const propFeatures: Readonly<Record<string, FeatureId>> = {\n dataSource: 'serverData',\n pagination: 'pagination',\n page: 'pagination',\n pageSize: 'pagination',\n selectable: 'selection',\n selected: 'selection',\n pruneSelection: 'selection',\n selectAllMatching: 'selection',\n selectionMode: 'selection',\n pinnedMaxShare: 'columnPinning',\n isRowSelectable: 'selection',\n subRows: 'subGrids',\n loadSubRows: 'subGrids',\n hasSubRows: 'subGrids',\n virtual: 'virtualScrolling',\n contextMenu: 'menus',\n headerMenu: 'menus',\n filters: 'filtering',\n filterMode: 'filtering',\n filterRow: 'filtering',\n filterStorage: 'filtering',\n noMatchText: 'filtering',\n pinnedRows: 'rowPinning',\n pinnedTopRows: 'rowPinning',\n pinnedBottomRows: 'rowPinning',\n totals: 'aggregation',\n totalsLabel: 'aggregation',\n aggregates: 'aggregation',\n groupBy: 'rowGrouping',\n groupsExpanded: 'rowGrouping',\n}\n\n/** Column options that need a feature. */\nexport const columnFeatures: Readonly<Record<string, FeatureId>> = {\n sortable: 'sorting',\n sortValue: 'sorting',\n sortFn: 'sorting',\n filterable: 'filtering',\n filter: 'filtering',\n filterValue: 'filtering',\n filterFn: 'filtering',\n filterComponent: 'filtering',\n searchable: 'filtering',\n pinned: 'columnPinning',\n pinnable: 'columnPinning',\n hidden: 'columnVisibility',\n hideable: 'columnVisibility',\n reorderable: 'columnReorder',\n resizable: 'columnResizing',\n maxWidth: 'columnResizing',\n group: 'columnGroups',\n aggregate: 'aggregation',\n groupable: 'rowGrouping',\n groupValue: 'rowGrouping',\n exportValue: 'export',\n exportable: 'export',\n}\n\n/**\n * Options whose default is \"on\" and that only opt *out*: setting them without the feature changes\n * nothing worth a warning (`pinnable: false` on a grid without pinning is fine).\n */\nexport const optOuts: ReadonlySet<string> = new Set([\n 'pinnable',\n 'hideable',\n 'reorderable',\n 'resizable',\n 'searchable',\n 'headerMenu',\n 'exportable',\n 'pinnedMaxShare',\n])\n\n/** The export name of a feature: `sorting` → `sortingFeature`. */\nexport const featureExport = (id: FeatureId) => `${id}Feature`\n"],"mappings":";AA0BA,IAAaA,IAAoD;CAC/D,YAAY;CACZ,YAAY;CACZ,MAAM;CACN,UAAU;CACV,YAAY;CACZ,UAAU;CACV,gBAAgB;CAChB,mBAAmB;CACnB,eAAe;CACf,gBAAgB;CAChB,iBAAiB;CACjB,SAAS;CACT,aAAa;CACb,YAAY;CACZ,SAAS;CACT,aAAa;CACb,YAAY;CACZ,SAAS;CACT,YAAY;CACZ,WAAW;CACX,eAAe;CACf,aAAa;CACb,YAAY;CACZ,eAAe;CACf,kBAAkB;CAClB,QAAQ;CACR,aAAa;CACb,YAAY;CACZ,SAAS;CACT,gBAAgB;AAClB,GAGaC,IAAsD;CACjE,UAAU;CACV,WAAW;CACX,QAAQ;CACR,YAAY;CACZ,QAAQ;CACR,aAAa;CACb,UAAU;CACV,iBAAiB;CACjB,YAAY;CACZ,QAAQ;CACR,UAAU;CACV,QAAQ;CACR,UAAU;CACV,aAAa;CACb,WAAW;CACX,UAAU;CACV,OAAO;CACP,WAAW;CACX,WAAW;CACX,YAAY;CACZ,aAAa;CACb,YAAY;AACd,GAMaC,oBAA+B,IAAI,IAAI;CAClD;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC,GAGYC,KAAiB,MAAkB,GAAGC,EAAG"}