🎨 (bootsier): Normaliza id's y revisa Checkbox
Renombra los sufijos de `id` de los controles internos para que cada
tipo tenga su propio identificador: `-checkbox`, `-check-{n}` y
`-radio-{n}`. Elimina además el atributo booleano `switch` inválido en
HTML (basta con `role="switch"` y `class="form-switch"`).
This commit is contained in:
parent
2fbafce0e7
commit
8717d24ea3
4 changed files with 40 additions and 12 deletions
|
|
@ -3,6 +3,24 @@ use pagetop::prelude::*;
|
|||
use std::borrow::Cow;
|
||||
use std::fmt;
|
||||
|
||||
// **< CheckboxKind >*******************************************************************************
|
||||
|
||||
/// Variante visual para [`form::Checkbox`](crate::theme::form::Checkbox) en un formulario.
|
||||
///
|
||||
/// Determina si el control se renderiza como una casilla de verificación estándar o como un
|
||||
/// interruptor (*toggle switch*).
|
||||
#[derive(AutoDefault, Clone, Copy, Debug, PartialEq)]
|
||||
pub enum CheckboxKind {
|
||||
/// Casilla de verificación estándar. Es el tipo por defecto.
|
||||
#[default]
|
||||
Check,
|
||||
/// Interruptor de encendido/apagado.
|
||||
Switch,
|
||||
// TODO: Añadir variante `NativeSwitch` cuando el atributo `switch` de la propuesta WHATWG
|
||||
// (https://github.com/whatwg/html/issues/9546) sea estándar y tenga soporte amplio. Safari ya
|
||||
// lo soporta. También se añadiría el constructor `Checkbox::native_switch()`.
|
||||
}
|
||||
|
||||
// **< Autocomplete >*******************************************************************************
|
||||
|
||||
/// Valor del atributo HTML `autocomplete`.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue