✨ (base): Añade componente Pager
Incluye soporte HTMX vía `sort_link()`/`hx_pager` para navegación sin recarga.
This commit is contained in:
parent
e8bba0803d
commit
3b01894024
14 changed files with 881 additions and 31 deletions
|
|
@ -73,9 +73,9 @@ impl RoutePath {
|
|||
/// Un `value` vacío no se distingue de [`with_flag()`](Self::with_flag): ambos se renderizan
|
||||
/// como `?key`, sin `=`.
|
||||
#[builder_fn]
|
||||
pub fn with_param(mut self, key: impl Into<String>, value: impl Into<String>) -> Self {
|
||||
pub fn with_param(mut self, key: impl Into<String>, value: impl AsRef<str>) -> Self {
|
||||
self.query
|
||||
.insert(key.into(), Self::encode_query_value(&value.into()));
|
||||
.insert(key.into(), Self::encode_query_value(value.as_ref()));
|
||||
self
|
||||
}
|
||||
|
||||
|
|
@ -91,6 +91,16 @@ impl RoutePath {
|
|||
&self.path
|
||||
}
|
||||
|
||||
/// Devuelve el valor de un parámetro de consulta ya almacenado, si existe.
|
||||
///
|
||||
/// El valor se devuelve tal como se almacenó, es decir, ya codificado según RFC 3986 (ver
|
||||
/// [`with_param()`](Self::with_param)). Para valores que sólo usen caracteres sin reservar
|
||||
/// (letras, dígitos, `-`, `_`, `.`, `~`), como un identificador de idioma BCP 47, no hay
|
||||
/// diferencia con el valor original.
|
||||
pub fn param(&self, key: impl AsRef<str>) -> Option<&str> {
|
||||
self.query.get(key.as_ref()).map(String::as_str)
|
||||
}
|
||||
|
||||
/// Indica si el *path* **parece** una URL externa por su prefijo (ver
|
||||
/// [`util::url_looks_external()`](crate::util::url_looks_external)).
|
||||
pub fn is_external(&self) -> bool {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue