✨ (bootsier): Añade componente Nav
- Adapta `Dropdown` para poder integrarlo en los menús `Nav`. - Actualiza `Children` para soportar operaciones múltiples.
This commit is contained in:
parent
c3fd566025
commit
80b18cc380
12 changed files with 602 additions and 226 deletions
|
|
@ -41,7 +41,7 @@ pub enum ItemKind {
|
|||
/// [`ItemKind`].
|
||||
///
|
||||
/// Permite definir identificador, clases de estilo adicionales o tipo de interacción asociada,
|
||||
/// manteniendo una interfaz común para renderizar todos los ítems del menú.
|
||||
/// manteniendo una interfaz común para renderizar todos los elementos del menú.
|
||||
#[rustfmt::skip]
|
||||
#[derive(AutoDefault)]
|
||||
pub struct Item {
|
||||
|
|
@ -79,7 +79,7 @@ impl Component for Item {
|
|||
} => {
|
||||
let path = path(cx);
|
||||
let current_path = cx.request().map(|request| request.path());
|
||||
let is_current = !*disabled && current_path.map(|p| p == path).unwrap_or(false);
|
||||
let is_current = !*disabled && current_path.map_or(false, |p| p == path);
|
||||
|
||||
let mut classes = "dropdown-item".to_string();
|
||||
if is_current {
|
||||
|
|
@ -200,7 +200,7 @@ impl Item {
|
|||
}
|
||||
}
|
||||
|
||||
/// Crea un enlace deshabilitado que se abriría en una nueva ventana.
|
||||
/// Crea un enlace inicialmente deshabilitado que se abriría en una nueva ventana.
|
||||
pub fn link_blank_disabled(label: L10n, path: FnPathByContext) -> Self {
|
||||
Item {
|
||||
item_kind: ItemKind::Link {
|
||||
|
|
@ -274,7 +274,7 @@ impl Item {
|
|||
&self.classes
|
||||
}
|
||||
|
||||
/// Devuelve el tipo de elemento representado por este ítem.
|
||||
/// Devuelve el tipo de elemento representado por este elemento.
|
||||
pub fn item_kind(&self) -> &ItemKind {
|
||||
&self.item_kind
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue