diff --git a/examples/form-controls.rs b/examples/form-controls.rs index 3e9a3f3d..29010de6 100644 --- a/examples/form-controls.rs +++ b/examples/form-controls.rs @@ -137,7 +137,11 @@ async fn form_controls(request: HttpRequest) -> Result { ), ) // Campo oculto (form::Hidden). - .with_child(form::Hidden::field("origin", "form-selections")) + .with_child( + form::Hidden::new() + .with_name("origin") + .with_value("form-selections"), + ) // Botones de acción. .with_child(Button::submit(L10n::t("btn_submit", &LOC)).with_prop( PropsOp::add_classes(class::ButtonColor::solid( @@ -257,7 +261,11 @@ async fn form_controls(request: HttpRequest) -> Result { ), ) // Campo oculto (form::Hidden). - .with_child(form::Hidden::field("origin", "form-text")) + .with_child( + form::Hidden::new() + .with_name("origin") + .with_value("form-text"), + ) // Botones de acción. .with_child(Button::submit(L10n::t("btn_submit", &LOC)).with_prop( PropsOp::add_classes(class::ButtonColor::solid( @@ -407,7 +415,11 @@ fn form_lists() -> Form { form // Campo oculto (form::Hidden). - .with_child(form::Hidden::field("origin", "form-lists")) + .with_child( + form::Hidden::new() + .with_name("origin") + .with_value("form-lists"), + ) // Botones de acción. .with_child( Button::submit(L10n::t("btn_submit", &LOC)).with_prop(PropsOp::add_classes( diff --git a/extensions/pagetop-bootsier/src/theme/bs/navbar/item.rs b/extensions/pagetop-bootsier/src/theme/bs/navbar/item.rs index 721dae8c..27e785aa 100644 --- a/extensions/pagetop-bootsier/src/theme/bs/navbar/item.rs +++ b/extensions/pagetop-bootsier/src/theme/bs/navbar/item.rs @@ -42,10 +42,10 @@ impl Component for Item { } fn setup(&mut self, _cx: &Context) { - if let Self::Nav(nav) = self - && let Some(nav) = nav.get_mut() - { - nav.alter_prop(PropsOp::prepend_classes("navbar-nav")); + if let Self::Nav(nav) = self { + if let Some(nav) = nav.get_mut() { + nav.alter_prop(PropsOp::prepend_classes("navbar-nav")); + } } } diff --git a/extensions/pagetop-bootsier/src/theme/token/layout.rs b/extensions/pagetop-bootsier/src/theme/token/layout.rs index 69401e5d..a5df6b7c 100644 --- a/extensions/pagetop-bootsier/src/theme/token/layout.rs +++ b/extensions/pagetop-bootsier/src/theme/token/layout.rs @@ -52,14 +52,14 @@ impl ScaleSize { // Añade el tamaño a la cadena de clases usando el prefijo dado. #[inline] pub(crate) fn push_to(self, classes: &mut String, prefix: &str) { - if !prefix.is_empty() - && let Some(suffix) = self.suffix() - { - if !classes.is_empty() { - classes.push(' '); + if !prefix.is_empty() { + if let Some(suffix) = self.suffix() { + if !classes.is_empty() { + classes.push(' '); + } + classes.push_str(prefix); + classes.push_str(suffix); } - classes.push_str(prefix); - classes.push_str(suffix); } } } diff --git a/extensions/pagetop-htmx/src/hx.rs b/extensions/pagetop-htmx/src/hx.rs index 2b5c08dc..fb4ae54b 100644 --- a/extensions/pagetop-htmx/src/hx.rs +++ b/extensions/pagetop-htmx/src/hx.rs @@ -490,13 +490,6 @@ pub mod swap { pub const INNER_HTML: &str = "innerHTML"; /// Reemplaza el elemento objetivo completo. pub const OUTER_HTML: &str = "outerHTML"; - /// Reemplaza el elemento objetivo completo y desplaza la vista al borde superior tras el - /// intercambio (combina [`OUTER_HTML`] con el modificador `scroll:top`). - /// - /// Pensado para listados paginados/ordenables cuyo `hx-swap` sustituye un contenedor completo - /// (tabla + paginador) al variar el número de filas entre páginas. Sin este anclaje la posición - /// del scroll tras el intercambio queda desajustada. - pub const OUTER_HTML_SCROLL_TOP: &str = "outerHTML scroll:top"; /// Inserta la respuesta antes de la etiqueta de apertura del objetivo. pub const BEFORE_BEGIN: &str = "beforebegin"; /// Inserta la respuesta al inicio del contenido del objetivo. diff --git a/extensions/pagetop-htmx/src/hx_pager.rs b/extensions/pagetop-htmx/src/hx_pager.rs deleted file mode 100644 index 7a126d17..00000000 --- a/extensions/pagetop-htmx/src/hx_pager.rs +++ /dev/null @@ -1,32 +0,0 @@ -//! Soporte HTMX al componente [`Pager`]. -//! -//! [`Pager`] no conoce HTMX ni ninguna otra librería de interactividad. Cada enlace de página ya -//! funciona como una petición normal, y el elemento `