Repository navigation
v1.5.0 — Gridory
·
84 commits
to main
since this release
Minor release of Gridory: a card view, per-module stylesheets, a kanban whose search, filters and sort the
app can own, and three pieces that download only when they are used. Everything new is opt-in: without the new
component, props or stylesheets, the table and the kanban look and behave as in 1.4.2; only the moment some
pieces download changes (see Good to know).
English
Upgrade
npm install gridory@1.5.0New
- Card view.
CardGrid(fromgridory/card-gridandgridory) shows the rows as a responsive grid of cards,
with the search, filters, sort and pagination of the table. Its props:columns,data,normalizeRow,
getRowId,features(search,sorting,filtering,pagination,rowActions,createButton),
renderCard(row),onRowClick,getRowHref,pageSizeOptions,defaultPageSize(25),pageIndex,
pageSize,onPaginationChange,onVisibleRowsChange,labels,classNameandclassNames(root,
toolbar,filterRow,list,card,pagination,empty), plus the controlledsearch,sortingand
columnFiltersand the toolbar props ofDataTableandKanbanBoard, withoutviewSwitch. The default card is
the kanban card, without dragging. Types:CardGridProps,CardGridLabels,CardGridClassNames,
CardGridFeatures,CardClickEvent. Classes.gdy-card-grid,-list,-card(withdata-clickable),
-loading,-skeleton; tokens--gdy-card-grid-min,-gap,-padding,-focus-ring. A switch built with
toggleGroupscan alternateDataTable,CardGridandKanbanBoard(see the guide). - Kanban: controlled search, filters and sort.
KanbanBoardtakessearch/onSearchChange,sorting/
onSortChangeandcolumnFilters/onFiltersChange, with the same types and rules asDataTable.
gridory/kanbanalso exportsColumnFiltersStateandColumnSortingState. - Per-module stylesheets. Besides
gridory/styles.css, which still holds every module,gridory/base.cssand
one sheet per module:ai.css,auth.css,card-grid.css,country-select.css,table.css,kanban.css,
segmented-control.css,phone-input.css,sidebar.cssandmarkdown-editor.css. Importbase.cssfirst and
then the sheets of the modules you render, in this order; all of them together are exactlystyles.css. An app
with the table and the kanban goes from 18.4 to 8.9 KB of gzipped CSS. - New
labelsand their default:dateLoadError"No se pudo cargar el calendario. Si sigue sin aparecer,
recarga la página.",dateLoadRetry"Reintentar".
Good to know
- Three pieces download when they are used, not with the page. The calendar of the date filter downloads
when a date menu opens; until it arrives, the "Fechas" section shows boxes of the same size, witharia-busy
anddata-loading. The tooltip ofheaderTooltipand the checkbox ofrowSelectiondownload right after the
first render of a table that uses them; the checkbox already toggles, and a press on the "?" opens the tooltip
on arrival. Nothing moves meanwhile. An app with the table and the kanban ships about 26.5 KB less of gzipped
JavaScript (174.2 → 147.7 KB). - If the calendar cannot be downloaded (for example, the app was redeployed and the old file is gone), the date
menu says so, with a "Reintentar" button and a hint to reload the page: some browsers keep a failed download
until the page reloads. The library never reloads the page itself. - Tests that open a date menu must wait for the date inputs:
await screen.findByRole("button", { name: "Seleccionar fecha" })instead ofgetByRole. - An app that types a full
DataTableLabels,KanbanBoardLabelsorDataViewLabels(notPartial) must add
the two new keys. - With per-module sheets:
CardGridalso needstable.cssandkanban.css, and the auth forms with atelfield
needphone-input.css. Do not importstyles.csstogether with them. - A rule of your app on
.gdy-kanban-cardalso reaches the cards ofCardGrid; use.gdy-card-grid-cardto style
only the grid.
See the card view guide and
Per-module stylesheets;
every guide is linked from the README.
Español
Actualizar
npm install gridory@1.5.0Novedades
- Vista de tarjetas.
CardGrid(desdegridory/card-gridygridory) muestra las filas como una cuadrícula de
tarjetas que se adapta al ancho, con la búsqueda, los filtros, el orden y la paginación de la tabla. Sus props:
columns,data,normalizeRow,getRowId,features(search,sorting,filtering,pagination,
rowActions,createButton),renderCard(row),onRowClick,getRowHref,pageSizeOptions,
defaultPageSize(25),pageIndex,pageSize,onPaginationChange,onVisibleRowsChange,labels,
classNameyclassNames(root,toolbar,filterRow,list,card,pagination,empty), más
search,sortingycolumnFilterscontrolados y las props de la barra deDataTableyKanbanBoard, sin
viewSwitch. La tarjeta por defecto es la del kanban, sin arrastre. Tipos:CardGridProps,CardGridLabels,
CardGridClassNames,CardGridFeatures,CardClickEvent. Clases.gdy-card-grid,-list,-card(con
data-clickable),-loading,-skeleton; tokens--gdy-card-grid-min,-gap,-padding,-focus-ring. Un
selector creado contoggleGroupspuede alternarDataTable,CardGridyKanbanBoard(ver la guía). - Kanban: búsqueda, filtros y orden controlados.
KanbanBoardaceptasearch/onSearchChange,
sorting/onSortChangeycolumnFilters/onFiltersChange, con los mismos tipos y reglas que
DataTable.gridory/kanbantambién exportaColumnFiltersStateyColumnSortingState. - Hojas de estilo por módulo. Además de
gridory/styles.css, que sigue incluyendo todos los módulos,
gridory/base.cssy una hoja por módulo:ai.css,auth.css,card-grid.css,country-select.css,
table.css,kanban.css,segmented-control.css,phone-input.css,sidebar.cssymarkdown-editor.css.
Importa primerobase.cssy después las de los módulos que usas, en este orden; todas juntas son exactamente
styles.css. Una app con la tabla y el kanban pasa de 18,4 a 8,9 KB de CSS gzip. labelsnuevos y su valor por defecto:dateLoadError"No se pudo cargar el calendario. Si sigue sin
aparecer, recarga la página.",dateLoadRetry"Reintentar".
Para tener en cuenta
- Tres piezas se descargan cuando se usan, no con la página. El calendario del filtro de fecha se descarga al
abrir un menú de fecha; mientras llega, la sección "Fechas" muestra cajas del mismo tamaño, conaria-busyy
data-loading. El tooltip deheaderTooltipy la casilla derowSelectionse descargan justo después del
primer render de una tabla que los usa; la casilla ya funciona, y pulsar el "?" abre el tooltip en cuanto
llega. Nada se mueve mientras tanto. Una app con la tabla y el kanban carga unos 26,5 KB menos de JavaScript gzip
(174,2 → 147,7 KB). - Si el calendario no se puede descargar (por ejemplo, la app se volvió a publicar y el archivo viejo ya no está),
el menú de fecha lo avisa, con un botón "Reintentar" y la sugerencia de recargar la página: algunos navegadores
recuerdan una descarga fallida hasta que se recarga. La librería nunca recarga la página por su cuenta. - Los tests que abren un menú de fecha tienen que esperar los inputs de fecha:
await screen.findByRole( "button", { name: "Seleccionar fecha" })en lugar degetByRole. - Una app que tipa un
DataTableLabels,KanbanBoardLabelsoDataViewLabelscompleto (noPartial) tiene que
agregar las dos claves nuevas. - Con hojas por módulo:
CardGridnecesita tambiéntable.cssykanban.css, y los formularios de acceso con un
campotel,phone-input.css. No importesstyles.cssjunto con ellas. - Una regla de tu app sobre
.gdy-kanban-cardtambién alcanza a las tarjetas deCardGrid; para dar estilo
solo a la vista de tarjetas, usa.gdy-card-grid-card.
Ver la guía de la vista de tarjetas
y Hojas por módulo;
todas las guías están enlazadas desde el README.