🚚 Simplifica Child[Component] y Typed[Component]

This commit is contained in:
Manuel Cillero 2025-01-05 09:32:49 +01:00
parent db13a6ab8b
commit ee84c219cc
12 changed files with 57 additions and 59 deletions

View file

@ -142,7 +142,7 @@ impl Container {
}
pub fn with_child(mut self, child: impl ComponentTrait) -> Self {
self.children.add(ChildComponent::with(child));
self.children.add(Child::with(child));
self
}

View file

@ -73,7 +73,7 @@ impl Grid {
}
pub fn with_item(mut self, item: grid::Item) -> Self {
self.items.add(ChildComponent::with(item));
self.items.add(Child::with(item));
self
}

View file

@ -85,7 +85,7 @@ impl Item {
}
pub fn with_child(mut self, child: impl ComponentTrait) -> Self {
self.children.add(ChildComponent::with(child));
self.children.add(Child::with(child));
self
}

View file

@ -9,7 +9,7 @@ pub enum NavbarType {
#[default]
Default,
Basic,
Offcanvas(TypedComponent<Offcanvas>),
Offcanvas(Typed<Offcanvas>),
}
#[rustfmt::skip]
@ -52,7 +52,7 @@ impl ComponentTrait for Navbar {
let (output, id_content) = if let NavbarType::Offcanvas(oc) = self.navbar_type() {
(
oc.writable()
.alter_children(ChildOp::Prepend(ChildComponent::with(Html::with(elements))))
.alter_children(ChildOp::Prepend(Child::with(Html::with(elements))))
.render(cx),
cx.required_id::<Offcanvas>(oc.id()),
)

View file

@ -53,7 +53,7 @@ impl Nav {
}
pub fn with_item(mut self, item: navbar::Item) -> Self {
self.items.add(ChildComponent::with(item));
self.items.add(Child::with(item));
self
}

View file

@ -142,7 +142,7 @@ impl Offcanvas {
}
pub fn with_child(mut self, child: impl ComponentTrait) -> Self {
self.children.add(ChildComponent::with(child));
self.children.add(Child::with(child));
self
}