✨ (base) Añade ListView y ListFilter para listados

- ListView: botones, mensajes, tabla y paginador en orden fijo;
  anuncia el número de resultados a los lectores de pantalla.
- ListFilter: filtros en fila con "Filtrar" y "Limpiar", envío
  automático opcional y marcas de cambios sin aplicar.
- pagetop-htmx: hx_pager::boost() y hx_filter::boost(); cancelan
  las peticiones solapadas y atenúan el listado mientras carga,
  con estilos sólo en las páginas con listado.
- Usuarios y roles migrados al nuevo patrón.
This commit is contained in:
Manuel Cillero 2026-11-10 22:49:40 +01:00
parent 0f71eba7ab
commit d8493291e4
28 changed files with 1264 additions and 144 deletions

View file

@ -25,6 +25,8 @@
@use "basic/dropdown";
@use "basic/form";
@use "basic/image";
@use "basic/list-filter";
@use "basic/list-view";
@use "basic/messages";
@use "basic/nav";
@use "basic/navbar";

View file

@ -0,0 +1,59 @@
// List filters (ListFilter): fields and button on one row, wrapping when there is no room.
.list-filter {
display: flex;
flex-wrap: wrap;
align-items: flex-end;
gap: 0.5rem 1rem;
margin-bottom: 1rem;
}
.list-filter > .form-field {
margin-bottom: 0;
}
// Marks of changed filters not applied yet (filters with a button), set by `list-filter.js`. Only
// colors and opacity change, never sizes: the dot always takes its room, hidden, so nothing moves
// when it shows up. A vivid orange, set apart from the primary color of the button, darkened just
// enough to keep a 3:1 contrast against the background. Every changed field gets the dot by its
// label, once per field (on the title of a group); text fields and dropdowns also show a gray
// background.
.list-filter {
--list-filter-mark: color-mix(in srgb, #fd7e14 85%, black);
}
.list-filter .form-field > .form-label::after,
.list-filter .form-field.form-check > .form-check-label::after {
content: "\25CF" / "";
margin-left: 0.25em;
color: var(--list-filter-mark);
opacity: 0;
}
.list-filter .list-filter-changed > .form-label::after,
.list-filter .list-filter-changed.form-check > .form-check-label::after {
opacity: 1;
}
.list-filter .list-filter-changed .form-control,
.list-filter .list-filter-changed .form-select {
background-color: color-mix(in srgb, var(--val-color--bg--muted) 60%, #fff);
}
// Native checkboxes only take a color when checked; a switch is drawn by the theme.
.list-filter .list-filter-changed .form-check-input {
accent-color: var(--list-filter-mark);
}
.list-filter .list-filter-changed.form-switch .form-check-input:checked {
background-color: var(--list-filter-mark);
}
.list-filter-pending > button[type="submit"] {
background-color: var(--val-color--primary);
border-color: var(--val-color--primary);
}
.list-filter-pending > button[type="submit"]:hover {
background-color: color-mix(in srgb, var(--val-color--primary) 85%, black);
border-color: color-mix(in srgb, var(--val-color--primary) 85%, black);
}

View file

@ -0,0 +1,8 @@
// List view (ListView): action buttons above the table, then messages, table and pager.
.list-view {
margin: 1.5rem 0;
}
.list-view-actions {
margin-bottom: 1rem;
}

View file

@ -30,10 +30,6 @@
margin-top: 1.5rem;
}
.user-admin-table-wrapper {
margin: 1.5rem 0;
}
.user-form-error {
padding: 0.625rem 0.875rem;
margin-bottom: 1rem;