💥 Agrupa componentes en packs en lugar de bundles

This commit is contained in:
Manuel Cillero 2023-06-24 14:00:22 +02:00
parent f1f6f495bb
commit 9a63cacd8f
11 changed files with 67 additions and 67 deletions

View file

@ -23,7 +23,7 @@ pub struct Container {
classes : Classes,
inner_classes : Classes,
container_type: ContainerType,
components : ComponentsBundle,
components : PackComponents,
template : String,
}
@ -159,12 +159,12 @@ impl Container {
}
pub fn with_component(mut self, component: impl ComponentTrait) -> Self {
self.components.alter_bundle(BundleOp::Add, component);
self.components.alter_pack(PackOp::Add, component);
self
}
pub fn alter_components(&mut self, op: BundleOp, component: impl ComponentTrait) -> &mut Self {
self.components.alter_bundle(op, component);
pub fn alter_components(&mut self, op: PackOp, component: impl ComponentTrait) -> &mut Self {
self.components.alter_pack(op, component);
self
}
@ -188,7 +188,7 @@ impl Container {
&self.container_type
}
pub fn components(&self) -> &ComponentsBundle {
pub fn components(&self) -> &PackComponents {
&self.components
}

View file

@ -21,7 +21,7 @@ pub struct Form {
action : AttributeValue,
charset : AttributeValue,
method : FormMethod,
elements : ComponentsBundle,
elements : PackComponents,
template : String,
}
@ -125,12 +125,12 @@ impl Form {
}
pub fn with_element(mut self, element: impl ComponentTrait) -> Self {
self.elements.alter_bundle(BundleOp::Add, element);
self.elements.alter_pack(PackOp::Add, element);
self
}
pub fn alter_elements(&mut self, op: BundleOp, element: impl ComponentTrait) -> &mut Self {
self.elements.alter_bundle(op, element);
pub fn alter_elements(&mut self, op: PackOp, element: impl ComponentTrait) -> &mut Self {
self.elements.alter_pack(op, element);
self
}
@ -158,7 +158,7 @@ impl Form {
&self.method
}
pub fn elements(&self) -> &ComponentsBundle {
pub fn elements(&self) -> &PackComponents {
&self.elements
}

View file

@ -44,7 +44,7 @@ pub struct Column {
id : IdentifierValue,
classes : Classes,
size : ColumnSize,
components: ComponentsBundle,
components: PackComponents,
template : String,
}
@ -140,12 +140,12 @@ impl Column {
}
pub fn with_component(mut self, component: impl ComponentTrait) -> Self {
self.components.alter_bundle(BundleOp::Add, component);
self.components.alter_pack(PackOp::Add, component);
self
}
pub fn alter_components(&mut self, op: BundleOp, component: impl ComponentTrait) -> &mut Self {
self.components.alter_bundle(op, component);
pub fn alter_components(&mut self, op: PackOp, component: impl ComponentTrait) -> &mut Self {
self.components.alter_pack(op, component);
self
}
@ -165,7 +165,7 @@ impl Column {
&self.size
}
pub fn components(&self) -> &ComponentsBundle {
pub fn components(&self) -> &PackComponents {
&self.components
}

View file

@ -13,7 +13,7 @@ pub struct Row {
renderable: Renderable,
id : IdentifierValue,
classes : Classes,
columns : ComponentsBundle,
columns : PackComponents,
template : String,
}
@ -87,12 +87,12 @@ impl Row {
}
pub fn with_column(mut self, column: grid::Column) -> Self {
self.columns.alter_bundle(BundleOp::Add, column);
self.columns.alter_pack(PackOp::Add, column);
self
}
pub fn alter_columns(&mut self, op: BundleOp, column: grid::Column) -> &mut Self {
self.columns.alter_bundle(op, column);
pub fn alter_columns(&mut self, op: PackOp, column: grid::Column) -> &mut Self {
self.columns.alter_pack(op, column);
self
}
@ -108,7 +108,7 @@ impl Row {
&self.classes
}
pub fn columns(&self) -> &ComponentsBundle {
pub fn columns(&self) -> &PackComponents {
&self.columns
}

View file

@ -20,7 +20,7 @@ pub struct Paragraph {
renderable: Renderable,
id : IdentifierValue,
classes : Classes,
components: ComponentsBundle,
components: PackComponents,
display : ParagraphDisplay,
template : String,
}
@ -98,12 +98,12 @@ impl Paragraph {
}
pub fn with_component(mut self, component: impl ComponentTrait) -> Self {
self.components.alter_bundle(BundleOp::Add, component);
self.components.alter_pack(PackOp::Add, component);
self
}
pub fn alter_components(&mut self, op: BundleOp, component: impl ComponentTrait) -> &mut Self {
self.components.alter_bundle(op, component);
pub fn alter_components(&mut self, op: PackOp, component: impl ComponentTrait) -> &mut Self {
self.components.alter_pack(op, component);
self
}
@ -137,7 +137,7 @@ impl Paragraph {
&self.classes
}
pub fn components(&self) -> &ComponentsBundle {
pub fn components(&self) -> &PackComponents {
&self.components
}