gp-grid v0.21.0
This release adds two purely additive features: a labels prop that lets you
translate every user-visible grid string, and a wrapText column option that
wraps long cell text onto new lines instead of truncating it with an ellipsis.
Localization — the labels prop
Every string the grid renders — the filter popup, its buttons and
placeholders, the empty state, the error prefix — now comes from a single
GridLabels model. Pass a Partial<GridLabels> to the grid and only the
labels you provide are overridden; the rest keep their English defaults.
import { Grid, type GridLabels } from "@gp-grid/react";
const labels: Partial<GridLabels> = {
filterTitle: "Filtra: {column}", // {column} is the column header name
and: "E",
apply: "Applica",
emptyState: "Nessun dato",
};
<Grid columns={columns} rowData={rows} rowHeight={36} labels={labels} />;Templates support {column}, {count} and {message} tokens. The nested
operators object localizes the filter dropdown (contains, startsWith,
between, …); it is a complete GridFilterOperatorLabels, so spread the
English defaults to change a single operator:
import { defaultGridLabels } from "@gp-grid/core";
const labels: Partial<GridLabels> = {
operators: { ...defaultGridLabels.operators, contains: "Contiene" },
};The labels prop (or :labels / [labels] input) is available on the React,
Vue and Angular wrappers alike. See the framework Grid Props reference for the
full key list.
Text wrapping — wrapText
The default cell renderer now truncates overflowing text with an ellipsis and
exposes the full value through a native title tooltip. Set wrapText: true
on a column to wrap onto new lines instead:
const columns: ColumnDefinition[] = [
{ field: "bio", cellDataType: "text", width: 300, wrapText: true },
];Wrapped text is clipped to the fixed row height (rows do not auto-grow), so
pair it with the tooltip or the double-click peek overlay to read the full
value. wrapText only affects the default text renderer, not custom
cellRenderer output.
For the complete list of changes, see the GitHub release.