ProGridSign in

Releases

Changelog

Every ProGrid release, newest first. One licence covers all of them — there is nothing to renew to receive the next version.

1.12.0

Minor Changes

  • The pivot field rail's field list goes two-up when the rail is wide enough. - **Two columns at 340px and up.** Like Excel's PivotTable Fields pane, the field list now reflows into two columns once the rail is at least 340px wide (`pivotOptions.fieldPanelWidth`), the same width at which the Filters / Columns / Rows / Values boxes go 2×2. At the default 280px nothing changes. Long names truncate within their column and show in full on hover, and both ticking and dragging a field work the same in either column. - **The 2×2 layout now holds in host apps that use Tailwind.** The rail's wide layout was a plain `@[340px]/pivotrail:` container variant, in the same `utilities` layer as the host app's own Tailwind. A host that also emits `.grid-cols-1` (most do) had that rule land later and win, so the drop boxes stayed in one column unless the host safelisted the variant. The rail now uses a `pivotrail-wide` variant scoped to `[data-pivotrail]` on the rail, which outranks a plain utility wherever the host's stylesheet loads. Hosts that safelisted `@[340px]/pivotrail:grid-cols-2` can drop that line.
  • Saved views fit screens that filter outside the grid. - **`views.hostFilters`: views carry your own filters.** Give it `{ value, apply, equals? }` for filters outside the grid, such as a sidebar or a date range in the page header. A view saved with `filters` also stores `value`, and applying the view's filters hands the stored value back to `apply`, including when the reader picks the active view again. When `value` changes, the active view is marked "Modified". "Keep current filters" and `keep: ["filters"]` hold these filters back too. The value is stored the way JSON reads it back, right from the first save, so a `Date` reaches `apply` as an ISO string. - **`views.onKeepFiltersChange`: the keep switch can live in your state.** With `keepFilters`, it keeps the "Keep current filters" switch in the menu, showing your value and reporting each flip. `keepFilters` on its own still fixes the behaviour and hides the switch. - **"Filters" only where there is something to filter with.** The save form and each view's part list leave `filters` out on a grid with no quick filter, no filterable column with a funnel or filter surface, no controlled `state.columnFilters`/`state.quickFilter`, and no `hostFilters`. - **`views.partText` rewords a part.** For example, `{ filters: { hint: "The sidebar's filters" } }`. The default hint for Filters is now "Which rows are shown" ("As linhas que são mostradas"), which stays true whatever does the filtering.

1.11.0

Minor Changes

  • Saved views: named layouts a reader switches between, including ones that leave their filters alone. - **`views` turns them on.** A menu beside the title shows the active view, switches between views, saves the current one, and renames or deletes it. `views` (or `views={{}}`) keeps them in `localStorage` under `persist.key`; `items` + `onChange` keep them in your own store; `presets` are views your code defines, which a reader can apply and copy but not change. `toolbar.views` places the menu as a button, in the gear (`"menu"`), or nowhere. - **A view writes only the parts it carries.** Each view lists its parts (`columns`, `sort`, `filters`, `group`, `aggregations`, `pivot`) and applying it touches nothing else. A view saved without filters is a layout: it regroups and re-aggregates whatever the reader has filtered. The save form asks which parts to include, and the menu shows each view's parts under its name. - **Keep current filters.** A switch in the menu applies any view without its filters. Set `views.keepFilters` to fix it for a screen whose filters come from elsewhere; the switch is then hidden. - **Modified, and save changes.** The menu marks the active view once the reader changes one of its parts, and offers "Save changes". Picking the view again puts it back as saved. - **Build your own picker.** The slots' context has a new `views` controller (the same one the menu uses), and the menu is exported as `ProGridViewsMenu`. The handle adds `captureView`, `applyView` and `getViews`. A view naming columns that no longer exist is reconciled like a `persist` restore. - **Aggregations are now state.** The aggregation picked in a column's menu is a `ProGridState` slice, `aggregations`. It can be controlled through `state`, is reported by `onStateChange`, and is persisted by `persist` under the new `aggregations` group, which is in the default set. Code that builds a whole `ProGridState` object needs the new key. - **Fixed: a persisted pivot was saved but never restored.** `persist` wrote `pivotConfig`/`pivotExpansion` but skipped them on load. They now restore, and a destination holding only the expansion no longer wipes the configuration.

1.10.0

Minor Changes

  • Pivot in server mode, as an opt-in. - **`toolbar.pivot` turns it on.** Server grids (`dataSource`, `serverSide`, `rowCount`) still offer no pivot by default. Set `toolbar.pivot` explicitly (`true` or `"menu"`) and the toggle appears; the pivot then covers the loaded rows only — the current page — like row grouping already does. - **It says so.** The pivot's summary strip shows the same scope note as the group panel ("this page only — 10 of 240 rows"). - **The server is never asked about the pivot.** Its sort ids (`pvr:0`, measure columns) stay out of `onQueryChange` / `dataSource`: while pivoting, the query keeps the table's sort, and leaving pivot mode hands that sort back, so toggling costs no refetch. Column filters and the quick filter are not re-applied to rows the server already filtered.

Patch Changes

  • The pivot reads values through the columns' accessors. The pivot engine works on raw records, before any TanStack row exists, and read each value as `row[colId]`. That only holds for a column whose id is its field: a dotted `accessorKey` (`account.name`), an `accessorKey` under a different `id`, or an `accessorFn` read `undefined`, so every member landed in "(blank)" and every measure was empty. Dimensions, measures, report filters, the members list and the pivot's column filters and quick filter now resolve values the way TanStack's accessors do. The records themselves still reach `aggFns`, so a rule that reads another field of the record keeps working. - **`columnReader(columns)`**, with the `ColumnReader` type and `plainReader`, is exported from both entry points. Pass `read: columnReader(columns)` to `buildPivotModel` to get the same behaviour server-side; without it the engine keeps reading `row[colId]`.

1.9.0

Minor Changes

  • `meta.filterOperators`: choose which operators a column's filter offers. - **`meta.filterOperators`.** A list of operators, in menu order. The first one starts every new condition on the column. `serverOperators` still narrows it, and operators the column's `type` doesn't have are ignored. - **One operator, no picker.** With a single operator, the filter editors (the header funnel, the filter bar chip and the filter panel row) hide the operator dropdown. - **One list operator, one condition.** With a single list operator (`["in"]`, for example a status picked from its `filterOptions`), the second condition is hidden as well, so the filter is one checkbox list. - **Default operator.** `GridFilterField` has a new `defaultOperator`, and `emptyCondition(type, operator?)` and `withCondition(..., operator?)` accept it. When `serverOperators` removes a type's default operator, a new condition now starts on the first operator the menu offers.

Patch Changes

  • The empty-state message ("No rows", or `emptyMessage`) now stays in view on wide grids. It was sized to the full width of all the columns, so with many columns the centred text was off-screen. It now matches the visible width of the grid body and stays centred when the body is scrolled sideways.

1.8.0

Minor Changes

  • `exportFilename`: name exported files without depending on the toolbar title. - **`exportFilename` prop.** A string, or a function called at export time (so a date-stamped name is the day of the export). Used by every export from the toolbar, settings and context menus, and passed to custom `exportFormats` destinations as `filename`. Falls back to `title`, then `"pivot"` / `"grid"`, as before. - `exportGrid({ filename })` on the handle still overrides it for that one call.

1.7.0

Minor Changes

  • Ships an agent skill for coding assistants. - **`skills/pro-grid/`** is now included in the package. It has a `SKILL.md` and on-demand reference files covering setup, column `meta`, server data (`dataSource`, `createRestDataSource`), grouping and pivot, state and `persist`, editing, live updates, tree data, layout, theming, the ref handle and export. - To install it into your assistant (Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, OpenCode), run `npx skills add ./node_modules/@andreisaac/pro-grid/skills`, or copy the folder by hand. The README lists each assistant's folder.

1.6.0

Minor Changes

  • "Reset settings": one control that puts the grid back exactly as it opened. - **`toolbar.reset`.** A new `ToolbarControl`, defaulting to `"menu"`: the last entry in the settings (gear) dropdown, in a section of its own. It asks for a second click ("Confirm reset?") before it acts, with the mouse or the keyboard. `true` gives it its own button (same two-step confirm), `false` removes it, and `settings: false` falls it back to a button like every other key. Since it defaults to the menu, grids with a toolbar now show this entry in the gear unless they opt out. - **`resetToDefaults()` on the handle.** Erases what `persist` saved for the current key (local, session and adapter alike), then restores every slice from the props the grid started with: column widths, order, visibility and pinning; sorting and column filters to `initialState` (not to empty); the quick filter; row grouping and expanded groups; pivot mode, config and expansion; per-column aggregations; header-funnel visibility and the filter surface / pivot field panel; page 0 at the starting `pagination.pageSize`. Row selection is kept. Everything lands in one render, so a server grid issues a single `onQueryChange` / `dataSource` call, and nothing is written back to storage until the reader changes something again. - **`onResetSettings`.** A new prop, fired after the reset, so a host can reset the state it keeps beside the grid. - **i18n.** New `resetSettings` and `confirmResetSettings` messages (en, pt). `clearPersistedState`, `reset` and `resetLayout` are unchanged.

1.5.0

Minor Changes

  • Your own aggregation functions, grid-wide or per column. - **`aggFns`.** A map of aggregation functions by name, called per row as `(value, row, skip)`. Under a built-in name (`sum`, `avg`, `count`, …) it adjusts that built-in: return the value, a different one (a credit note stored positive, counted negative), or `skip` to leave the row out (a cancelled order — `count` doesn't see it either). Under a new name it defines a function whose results are summed, offered in the column menu, the pivot's Summarize by menu and the chart, and valid as `defaultAgg` and in a restored pivot. The object form, `{ value, aggregate, label, server }`, adds `aggregate(values, rows)` for a reduction of its own (a range, a weighted average). Every level reads the rows beneath it, never a child's result. - **`meta.aggFns`.** The same map on a column applies to that column only and wins over a grid entry of the same name. - **Everywhere the grid aggregates:** the totals row, group subtotals, pivot cells and the chart's aggregated series. Cells, sorting, filters and export keep the stored value. - **Server mode.** Custom and adjusted functions run client-side, so their totals are page-scoped; `server: true` on an adjusted server-capable built-in keeps delegating grand totals to the `dataSource`. - **`isRowAggregable` is deprecated** in favour of returning `skip` from an `aggFns` entry. It keeps working: a record it rejects reaches no aggregate. Unlike 1.3.0, such records now stay in the pivot's member lists and drill-through. - **Types.** `AggFn` is now `BuiltInAggFn | (string & {})`; the closed union is exported as `BuiltInAggFn`. New exports: `createAggRuntime`, `DEFAULT_AGG_RUNTIME`, `isBuiltInAggFn`, and the `AggFns`, `AggFnDef`, `AggValueFn`, `AggReduceFn`, `AggSkip`, `AggRuntime` types. `createAccumulator` now returns a blank accumulator for an unknown name instead of silently summing.

1.4.0

Minor Changes

  • Host control over aggregation. - **`aggregateValue`.** One hook, called per record and aggregated column before any aggregation function runs. It returns the value to count, a different value (a credit note stored positive, counted negative), or the new `AGG_SKIP` sentinel to leave the record out entirely (a cancelled order — `count` included). It applies to the totals row, group subtotals, pivot cells and the chart's aggregated series; cells, sorting, filters and export keep the stored value. - **`aggFuncs`.** Custom aggregation functions by name, AG Grid style: `({ values, rows, columnId }) => number | null`, or `{ aggFunc, label, server }`. A new name joins the column menu, the pivot's Summarize by menu and the chart's cycle, and is valid as `defaultAgg` and in a restored pivot. A built-in name (`sum`, `avg`, …) replaces that built-in everywhere. Values always come from the leaf rows, at every level. - **`isRowAggregable` is deprecated** in favour of `aggregateValue` returning `AGG_SKIP`. It keeps working: a record it rejects is skipped before `aggregateValue` runs. Unlike 1.3.0, such records now stay in the pivot's member lists and drill-through, since only the aggregates skip them. - **Server mode.** Custom and overridden functions run client-side, so their totals are page-scoped; `server: true` on an override of a server-capable built-in keeps delegating grand totals to the `dataSource`. - **Types.** `AggFn` is now `BuiltInAggFn | (string & {})`; the closed union is exported as `BuiltInAggFn`. New exports: `AGG_SKIP`, `createAggRuntime`, `DEFAULT_AGG_RUNTIME`, `isBuiltInAggFn`, and the `AggFunc`, `AggFuncDef`, `AggFuncParams`, `AggregateValueParams`, `AggRuntime` types. `createAccumulator` now returns a blank accumulator for an unknown name instead of silently summing.

Patch Changes

  • Chart fixes for values that are recombined rather than aggregated from rows. - **"Other" bar with `product`.** The categories rolled into "Other" were summed whatever the aggregation; a product is now multiplied (and min/max no longer spread the whole tail into `Math.min`/`Math.max`). - **Charting a pivot `count`.** A pivot measure charted by a coarser category was re-aggregated with its own function, so a count counted the pivot lines instead of totalling their counts. Pivot cells now recombine the way their function does (a count of counts is their sum), while a different function picked on the chip still applies as chosen. They also bypass `aggregateValue`, which already ran when the pivot computed them.

1.3.0

Minor Changes

  • Leave rows out of aggregates. - **`isRowAggregable`.** A predicate over the record: rows it returns `false` for stay in the grid — rendered, filtered, sorted, selectable — but are skipped by the totals row, group subtotals, pivot cells and the chart's aggregated series. For cancelled orders, voided invoices, drafts. Server-computed grand totals are the server's, so apply the same rule in the query that produces `aggregates`.

1.2.0

Minor Changes

  • The header's `⋮` column-options button is now hidden by default — right-clicking the header already opens the same menu, so the button was pure clutter for the common case. `meta.options` brings it back per column: `"visible"` keeps it shown at all times, `"auto"` reveals it only while the header is hovered (the same treatment the drag grip already gets).
  • Four features toward the enterprise data-grid checklist: - **Keyboard navigation and clipboard.** Once a cell is clicked, the arrows, Home/End, Page Up/Down move the active cell; Shift extends the range from its anchor; Ctrl+A selects every cell; Ctrl+C copies (Ctrl+Shift+C with headers); Esc clears. The active cell draws a ring. - **Export, in open formats as well as Excel's.** `exportGrid` / `getExportText` on the handle, an Export control in the toolbar (`toolbar.export`, in the gear by default) and an Export submenu in the body context menu write **CSV**, **TSV**, **Excel (`.xlsx`)** or **OpenDocument (`.ods`)** — the rows on view, laid out under their group summaries while grouped, or the pivot as arranged. Both workbook writers are the grid's own: numbers stay numbers, booleans stay booleans, the header is bold and held at the top, and column widths carry over, with no spreadsheet dependency added. `exportFormats` chooses which formats are offered and in what order (`["csv", "ods"]` for an open-formats-only deployment, `[]` to remove the control), and an entry can be a **destination of your own** — a Google Sheets upload, a reporting service — handed the same `ExportMatrix` a file export would have written, reachable from the handle as `exportGrid({ destination })`. `matrixToFile`, `buildXlsx`, `buildOds` and `gridToMatrix` are exported, the first three from the server entry too. - **Cell editing.** `meta.editable` opts a column in; the editor follows the column type (text, number, date, select, boolean) or is a component of your own via `meta.editor`. Double-click, Enter, F2 or a keystroke opens it; Enter commits and moves down, Tab moves right, Esc cancels, Delete clears the range, Ctrl+V pastes a block. Every commit reaches `onCellEdit` (or `onBatchEdit` for a paste/clear) as a `CellEditChange`; with `liveUpdates` the change shows at once and is reversed if declined. **Cells changed in the session are tinted** so a reader can review their own work before saving: the mark is keyed by row id so it follows the record through sorting, filtering and paging, it lifts by itself when a cell is edited back to the value it started with, and a declined edit leaves none. `getEditedCells()` is the pending set for a Save button and `clearEditedCells()` drops the marks once the save lands; the colour is the `--pro-edited` token (amber, with a softer dark-mode value), every marked cell carries `data-edited="true"` for hosts that want to style it themselves, and `editing={{ highlightEdits: false }}` turns the built-in tint off. - **Tree data.** `treeData.getSubRows` renders hierarchical rows with an indent and chevron per level in the tree column, filters that keep the parents of a match, sorting within siblings, `initialExpandDepth`, and `expandTree` / `collapseTree` on the handle. `nestByPath` nests flat rows that carry a path. Also: `pivotToDelimited` is now built on `pivotToMatrix`; the zip and XML plumbing the two workbook writers share lives in `office.ts`, whose `SheetInput` replaces `XlsxInput`; the settings menu's "Export pivot to CSV" item is replaced by the general Export submenu, and the `exportCsv` / `exportExcel` / `pivotExportCsv` messages are replaced by `exportFormat`, a label per format.
  • Row actions in the utility column. - **`rowActions`.** A `⋮` menu of record-level actions, and the same menu in the column header running over the current selection. The actions belong to the host: the grid renders the trigger and the popup and calls back. `items` takes an array, or a function of the row when the menu has to vary — `hidden` drops an item, `disabled` greys it. `bulkItems` covers the header menu, and defaults to `items` when that is an array; a function form takes one row, so it has nothing to be called with there. - **Two positions.** `position: "leading"` (the default) shares the existing checkbox/chevron column, so the actions cost no extra gutter — the lead column's width now follows the affordances it carries instead of a fixed ternary, and the widths it shipped with (30, 42, 64) are unchanged. `position: "trailing"` gives the actions their own column, pinned to the right edge. That is the grid's first column it pins right itself, so `withBasePinned` now takes a side and `reconcileOrder` a `trailing` list: like the checkbox column, it is re-derived from the props on every render rather than restored, and a layout saved before the feature existed cannot resurrect it. - **`variant`.** `default`, `primary`, `warning` or `destructive`. Styling only — a destructive action that needs confirming should ask in its own `onSelect`, with whatever the host already uses for that. `warning` adds a `--pro-warning` token (amber, and deliberately distinct from `--pro-edited`, so a warning action and an edited cell do not read as the same signal). - **`renderCell` / `renderHeader`.** When a menu is the wrong shape — a single button, a dropdown of the host's own, a dialog trigger — these replace the cell or the header outright. They still receive the resolved `items` and a `run` that binds them to the row, so the config stays the one description of what the actions are. Group and aggregate rows never get a trigger: they stand for a bucket rather than a record. `isRowActionable` narrows it further, and pivot mode withholds the column entirely. Also: a column could previously be dropped _onto_ one of the grid's own columns, landing outside the checkbox until the next reconcile tidied it — drag-reorder now rejects a grid-owned drop target, which is what keeps a trailing actions column at the end. The three internal column ids had drifted into separate literals in `pro-grid.tsx`, `header-cell.tsx` and `clipboard.ts`; they now come from one list.

1.1.0

Minor Changes

  • Four features toward the enterprise data-grid checklist: - **Keyboard navigation and clipboard.** Once a cell is clicked, the arrows, Home/End, Page Up/Down move the active cell; Shift extends the range from its anchor; Ctrl+A selects every cell; Ctrl+C copies (Ctrl+Shift+C with headers); Esc clears. The active cell draws a ring. - **Export, in open formats as well as Excel's.** `exportGrid` / `getExportText` on the handle, an Export control in the toolbar (`toolbar.export`, in the gear by default) and an Export submenu in the body context menu write **CSV**, **TSV**, **Excel (`.xlsx`)** or **OpenDocument (`.ods`)** — the rows on view, laid out under their group summaries while grouped, or the pivot as arranged. Both workbook writers are the grid's own: numbers stay numbers, booleans stay booleans, the header is bold and held at the top, and column widths carry over, with no spreadsheet dependency added. `exportFormats` chooses which formats are offered and in what order (`["csv", "ods"]` for an open-formats-only deployment, `[]` to remove the control), and an entry can be a **destination of your own** — a Google Sheets upload, a reporting service — handed the same `ExportMatrix` a file export would have written, reachable from the handle as `exportGrid({ destination })`. `matrixToFile`, `buildXlsx`, `buildOds` and `gridToMatrix` are exported, the first three from the server entry too. - **Cell editing.** `meta.editable` opts a column in; the editor follows the column type (text, number, date, select, boolean) or is a component of your own via `meta.editor`. Double-click, Enter, F2 or a keystroke opens it; Enter commits and moves down, Tab moves right, Esc cancels, Delete clears the range, Ctrl+V pastes a block. Every commit reaches `onCellEdit` (or `onBatchEdit` for a paste/clear) as a `CellEditChange`; with `liveUpdates` the change shows at once and is reversed if declined. - **Tree data.** `treeData.getSubRows` renders hierarchical rows with an indent and chevron per level in the tree column, filters that keep the parents of a match, sorting within siblings, `initialExpandDepth`, and `expandTree` / `collapseTree` on the handle. `nestByPath` nests flat rows that carry a path. Also: `pivotToDelimited` is now built on `pivotToMatrix`; the zip and XML plumbing the two workbook writers share lives in `office.ts`, whose `SheetInput` replaces `XlsxInput`; the settings menu's "Export pivot to CSV" item is replaced by the general Export submenu, and the `exportCsv` / `exportExcel` / `pivotExportCsv` messages are replaced by `exportFormat`, a label per format.

1.0.0

Major Changes

  • Base react/shadcn version
  • Ready for production

0.1.0

  • Initial private release: `<ProGrid>` packaged as a standalone, self-contained npm module with a prebuilt stylesheet (`@andreisaac/pro-grid/styles.css`). The custom UI primitives are bundled — consumers do not run `shadcn`.

Install the current version from the private registry — see installation — or read what a licence covers on the pricing page.