🚚 Rename Any ops to ChildComponent for Children

This commit is contained in:
Manuel Cillero 2024-12-01 08:53:37 +01:00
parent 556c9159d3
commit 0a61270f22
10 changed files with 75 additions and 140 deletions

View file

@ -4,8 +4,8 @@ pub use error::ErrorPage;
pub use actix_web::Result as ResultPage;
use crate::base::action;
use crate::core::component::{AnyComponent, AnyOp, ComponentTrait};
use crate::core::component::{AssetsOp, Context};
use crate::core::component::{ChildComponent, ChildOp, ComponentTrait};
use crate::fn_builder;
use crate::html::{html, Markup, DOCTYPE};
use crate::html::{ClassesOp, OptionClasses, OptionId, OptionTranslated};
@ -98,14 +98,14 @@ impl Page {
}
#[fn_builder]
pub fn set_in_region(&mut self, region: &'static str, op: AnyOp) -> &mut Self {
pub fn set_in_region(&mut self, region: &'static str, op: ChildOp) -> &mut Self {
self.context.set_in_region(region, op);
self
}
pub fn with_component(mut self, component: impl ComponentTrait) -> Self {
self.context
.set_in_region("content", AnyOp::Add(AnyComponent::with(component)));
.set_in_region("content", ChildOp::Add(ChildComponent::with(component)));
self
}
@ -115,7 +115,7 @@ impl Page {
component: impl ComponentTrait,
) -> Self {
self.context
.set_in_region(region, AnyOp::Add(AnyComponent::with(component)));
.set_in_region(region, ChildOp::Add(ChildComponent::with(component)));
self
}