Skip to content

v1.5.0 — Gridory

Choose a tag to compare

@VictorDiazJauregui VictorDiazJauregui released this 06 Nov 04:40
· 84 commits to main since this release
67bed21

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 · Español

English

Upgrade

npm install gridory@1.5.0

New

  • Card view. CardGrid (from gridory/card-grid and gridory) 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, className and classNames (root,
    toolbar, filterRow, list, card, pagination, empty), plus the controlled search, sorting and
    columnFilters and the toolbar props of DataTable and KanbanBoard, without viewSwitch. The default card is
    the kanban card, without dragging. Types: CardGridProps, CardGridLabels, CardGridClassNames,
    CardGridFeatures, CardClickEvent. Classes .gdy-card-grid, -list, -card (with data-clickable),
    -loading, -skeleton; tokens --gdy-card-grid-min, -gap, -padding, -focus-ring. A switch built with
    toggleGroups can alternate DataTable, CardGrid and KanbanBoard (see the guide).
  • Kanban: controlled search, filters and sort. KanbanBoard takes search / onSearchChange, sorting /
    onSortChange and columnFilters / onFiltersChange, with the same types and rules as DataTable.
    gridory/kanban also exports ColumnFiltersState and ColumnSortingState.
  • Per-module stylesheets. Besides gridory/styles.css, which still holds every module, gridory/base.css and
    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.css and markdown-editor.css. Import base.css first and
    then the sheets of the modules you render, in this order; all of them together are exactly styles.css. An app
    with the table and the kanban goes from 18.4 to 8.9 KB of gzipped CSS.
  • New labels and 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, with aria-busy
    and data-loading. The tooltip of headerTooltip and the checkbox of rowSelection download 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 of getByRole.
  • An app that types a full DataTableLabels, KanbanBoardLabels or DataViewLabels (not Partial) must add
    the two new keys.
  • With per-module sheets: CardGrid also needs table.css and kanban.css, and the auth forms with a tel field
    need phone-input.css. Do not import styles.css together with them.
  • A rule of your app on .gdy-kanban-card also reaches the cards of CardGrid; use .gdy-card-grid-card to 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.0

Novedades

  • Vista de tarjetas. CardGrid (desde gridory/card-grid y gridory) 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,
    className y classNames (root, toolbar, filterRow, list, card, pagination, empty), más
    search, sorting y columnFilters controlados y las props de la barra de DataTable y KanbanBoard, 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 con toggleGroups puede alternar DataTable, CardGrid y KanbanBoard (ver la guía).
  • Kanban: búsqueda, filtros y orden controlados. KanbanBoard acepta search / onSearchChange,
    sorting / onSortChange y columnFilters / onFiltersChange, con los mismos tipos y reglas que
    DataTable. gridory/kanban también exporta ColumnFiltersState y ColumnSortingState.
  • Hojas de estilo por módulo. Además de gridory/styles.css, que sigue incluyendo todos los módulos,
    gridory/base.css y 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.css y markdown-editor.css.
    Importa primero base.css y 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.
  • labels nuevos 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, con aria-busy y
    data-loading. El tooltip de headerTooltip y la casilla de rowSelection se 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 de getByRole.
  • Una app que tipa un DataTableLabels, KanbanBoardLabels o DataViewLabels completo (no Partial) tiene que
    agregar las dos claves nuevas.
  • Con hojas por módulo: CardGrid necesita también table.css y kanban.css, y los formularios de acceso con un
    campo tel, phone-input.css. No importes styles.css junto con ellas.
  • Una regla de tu app sobre .gdy-kanban-card también alcanza a las tarjetas de CardGrid; 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.