Skip to content

v1.3.0 — Gridory

Choose a tag to compare

@VictorDiazJauregui VictorDiazJauregui released this 28 Oct 14:45
· 191 commits to main since this release
92b6631

Minor release of Gridory, focused on the kanban: per-column styling, header and footer content, drop
rules, reverting a rejected move, a "Move to" menu for phones, keyboard and screen readers, and
collapsible columns. Row and card menus gain per-row texts and submenus. Everything is opt-in: without the
new props the table and the kanban look and behave as in 1.2.0, except for the changes listed under
Visible changes.

English · Español

English

Upgrade

npm install gridory@1.3.0

Kanban

  • Per-column styling. Every column carries data-column-value; getColumnClassName and
    getColumnAttributes (KanbanColumnAttributes) add a class or data-* / aria-* attributes to one.
  • Rejecting a move. onCardMove can return false or a promise; the card waits with data-pending
    and goes back if it resolves to false or rejects. onCardMoveError receives the error.
  • Visible cards. onVisibleCardsChange({ cards, byColumn }) (KanbanVisibleCardsState).
  • Column header and footer. renderColumnHeaderExtra (KanbanColumnHeaderContext) and
    renderColumnFooter (KanbanColumnFooterContext) render your own content, in
    .gdy-kanban-column-extra and .gdy-kanban-column-footer.
  • Drop rules. canDrop (KanbanDropContext) marks the columns a card cannot go to with
    data-drop-disabled when a drag starts, and validates the drop again.
  • Move without dragging. moveMenu ("auto" | "always" | "never", KanbanMoveMenuMode) adds "Mover
    a…" first in the card menu; "auto" follows moveMenuMediaQuery ("(pointer: coarse)"). It uses
    canDrop and onCardMove, shows the optional getDropDisabledReason and announces in
    .gdy-kanban-live.
  • Collapsible columns. collapsibleColumns, collapsedColumns, defaultCollapsedColumns and
    onCollapsedColumnsChange; the button is .gdy-kanban-column-toggle and the column gets
    data-collapsed.
  • New labels: moveTo, cardMovedTo, cardMoveReverted, collapseColumn and expandColumn.
  • New tokens: --gdy-kanban-card-pending-opacity, --gdy-kanban-drop-disabled-outline,
    --gdy-kanban-drop-disabled-bg and --gdy-kanban-column-collapsed-width.

Table and kanban

  • Per-row texts. A RowAction's label and icon can be a function of the row.
  • Submenus. RowActionSubmenu (items instead of onClick) in customActions and menuActions.
    New classes: .gdy-menu-sub-trigger, .gdy-menu-sub-content, .gdy-menu-sub-chevron and
    .gdy-menu-item-description.

Fixes

  • Narrow screens. The toolbar wraps instead of widening the page, which also broke menus and the
    calendar on phones; filter panels stay inside the screen (data-align="end").

Visible changes

  • Every kanban column carries data-column-value. The pixels do not change.
  • On touch screens every card menu starts with "Mover a…", and a card without menu shows ⋯ with that
    action alone. moveMenu="never" keeps the 1.2.0 card.
  • Where the controls do not fit (a phone, or a narrow window or container on any screen), the toolbar
    wraps to more rows and a filter panel opens to the left.

Good to know

  • Typed widenings that matter only to code reading these fields: RowAction label / icon can be
    functions, customActions is RowActionEntry[] and onCardMove may return boolean or a promise.
  • Memoize data and normalizeRow if the parent re-renders while a move is pending: new data wins over
    the revert.

Workarounds you can remove

Workaround Replaced by
Styling a column with nth-child data-column-value or getColumnClassName
Forcing new data or remounting with key to undo a rejected move onCardMove returning false or a promise
Reading the DOM or repeating the filters to know the visible cards onVisibleCardsChange
A portal into a column header found by its title renderColumnHeaderExtra
Two actions with opposite hidden for a toggle label as a function of the row
Rejecting a move only after the drop canDrop

See the kanban guide; every
guide is linked from the README.

Español

Actualizar

npm install gridory@1.3.0

Kanban

  • Estilo por columna. Cada columna lleva data-column-value; getColumnClassName y
    getColumnAttributes (KanbanColumnAttributes) le suman una clase o atributos data-* / aria-*.
  • Rechazar un movimiento. onCardMove puede devolver false o una promesa; la tarjeta espera con
    data-pending y vuelve si se resuelve en false o se rechaza. onCardMoveError recibe el error.
  • Tarjetas visibles. onVisibleCardsChange({ cards, byColumn }) (KanbanVisibleCardsState).
  • Cabecera y pie de columna. renderColumnHeaderExtra (KanbanColumnHeaderContext) y
    renderColumnFooter (KanbanColumnFooterContext) pintan contenido propio, en
    .gdy-kanban-column-extra y .gdy-kanban-column-footer.
  • Reglas al soltar. canDrop (KanbanDropContext) marca con data-drop-disabled las columnas a las
    que la tarjeta no puede ir al empezar el arrastre, y vuelve a validar al soltar.
  • Mover sin arrastrar. moveMenu ("auto" | "always" | "never", KanbanMoveMenuMode) agrega "Mover
    a…" primero en el menú de la tarjeta; "auto" sigue a moveMenuMediaQuery ("(pointer: coarse)").
    Usa canDrop y onCardMove, muestra el opcional getDropDisabledReason y anuncia en
    .gdy-kanban-live.
  • Columnas colapsables. collapsibleColumns, collapsedColumns, defaultCollapsedColumns y
    onCollapsedColumnsChange; el botón es .gdy-kanban-column-toggle y la columna lleva
    data-collapsed.
  • labels nuevos: moveTo, cardMovedTo, cardMoveReverted, collapseColumn y expandColumn.
  • Tokens nuevos: --gdy-kanban-card-pending-opacity, --gdy-kanban-drop-disabled-outline,
    --gdy-kanban-drop-disabled-bg y --gdy-kanban-column-collapsed-width.

Tabla y kanban

  • Textos por fila. El label y el icon de una RowAction pueden ser una función de la fila.
  • Submenús. RowActionSubmenu (items en lugar de onClick) en customActions y menuActions.
    Clases nuevas: .gdy-menu-sub-trigger, .gdy-menu-sub-content, .gdy-menu-sub-chevron y
    .gdy-menu-item-description.

Arreglos

  • Pantallas angostas. La toolbar pasa a más filas en lugar de ensanchar la página, lo que además
    rompía los menús y el calendario en los celulares; los paneles de filtro quedan dentro de la pantalla
    (data-align="end").

Cambios visibles

  • Cada columna del kanban lleva data-column-value. Los píxeles no cambian.
  • En pantallas táctiles el menú de cada tarjeta empieza con "Mover a…", y una tarjeta sin menú muestra ⋯
    con esa sola acción. moveMenu="never" conserva la tarjeta de la 1.2.0.
  • Donde los controles no entran (un celular, o una ventana o un contenedor angosto en cualquier
    pantalla), la toolbar pasa a más filas y un panel de filtro se abre hacia la izquierda.

Para tener en cuenta

  • Tipos ampliados que solo afectan al código que lee estos campos: el label / icon de RowAction
    pueden ser funciones, customActions es RowActionEntry[] y onCardMove puede devolver boolean o
    una promesa.
  • Memoriza data y normalizeRow si el padre se vuelve a renderizar con un movimiento pendiente: un dato
    nuevo gana sobre la reversión.

Parches que puedes quitar

Parche Lo reemplaza
Pintar una columna con nth-child data-column-value o getColumnClassName
Forzar un data nuevo o remontar con key para deshacer un movimiento rechazado onCardMove que devuelve false o una promesa
Leer el DOM o repetir los filtros para saber qué tarjetas se ven onVisibleCardsChange
Un portal en la cabecera de columna buscada por su título renderColumnHeaderExtra
Dos acciones con hidden opuestos para alternar label como función de la fila
Rechazar un movimiento recién después de soltar canDrop

Ver la guía del kanban; todas
las guías están enlazadas desde el README.