✨ (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:
parent
0f71eba7ab
commit
d8493291e4
28 changed files with 1264 additions and 144 deletions
|
|
@ -133,6 +133,68 @@ fieldset > legend {
|
|||
opacity: 1;
|
||||
}
|
||||
|
||||
// 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: ($spacer * .5) $spacer;
|
||||
margin-bottom: $spacer;
|
||||
|
||||
> .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. Floating labels are left out: Bootstrap draws their background with `::after`.
|
||||
.list-filter {
|
||||
--list-filter-mark: #{mix(#000, $orange, 15%)};
|
||||
}
|
||||
|
||||
.list-filter .form-field:not(.form-floating) > .form-label::after,
|
||||
.list-filter .form-field.form-check > .form-check-label::after {
|
||||
content: "\25CF" / "";
|
||||
margin-left: .25em;
|
||||
color: var(--list-filter-mark);
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.list-filter .list-filter-changed {
|
||||
&:not(.form-floating) > .form-label::after,
|
||||
&.form-check > .form-check-label::after {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.form-control,
|
||||
.form-select,
|
||||
.form-check-input {
|
||||
background-color: var(--bs-secondary-bg);
|
||||
}
|
||||
|
||||
.form-check-input:checked {
|
||||
background-color: var(--list-filter-mark);
|
||||
border-color: var(--list-filter-mark);
|
||||
}
|
||||
}
|
||||
|
||||
.list-filter-pending > .btn-secondary[type="submit"] {
|
||||
@extend .btn-primary;
|
||||
}
|
||||
|
||||
// List view (ListView): action buttons above the table.
|
||||
.list-view {
|
||||
margin-block: $spacer * 1.5;
|
||||
}
|
||||
|
||||
.list-view-actions {
|
||||
margin-bottom: $spacer;
|
||||
}
|
||||
|
||||
// Pager component.
|
||||
// `.pagination`, `.page-item`, `.page-link`, `.active` and `.disabled` already come styled by
|
||||
// Bootstrap, since Pager reuses that same markup (the ellipsis is a disabled `.page-link` span,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue