🚧 Mejora la estructura de las acciones

This commit is contained in:
Manuel Cillero 2023-07-09 19:21:47 +02:00
parent 1a32db1974
commit a05355c4d1
15 changed files with 192 additions and 180 deletions

View file

@ -2,7 +2,7 @@ use pagetop::prelude::*;
use_handle!(COMPONENT_CONTAINER);
action_before_prepare_component!(ACTION_BEFORE_PREPARE_CONTAINER for Container);
actions_for_component!(Container);
#[derive(Default)]
pub enum ContainerType {
@ -51,7 +51,7 @@ impl ComponentTrait for Container {
}
fn before_prepare_component(&mut self, cx: &mut Context) {
run_actions_before_prepare_component(self, cx);
run_actions_before_prepare_container(self, cx);
}
fn prepare_component(&self, cx: &mut Context) -> PrepareMarkup {
@ -92,6 +92,10 @@ impl ComponentTrait for Container {
}
}
fn after_prepare_component(&mut self, cx: &mut Context) {
run_actions_after_prepare_container(self, cx);
}
fn as_ref_any(&self) -> &dyn AnyComponent {
self
}

View file

@ -2,7 +2,7 @@ use pagetop::prelude::*;
use_handle!(COMPONENT_FORM);
action_before_prepare_component!(ACTION_BEFORE_PREPARE_FORM for Form);
actions_for_component!(Form);
#[derive(Default)]
pub enum FormMethod {
@ -49,7 +49,7 @@ impl ComponentTrait for Form {
}
fn before_prepare_component(&mut self, cx: &mut Context) {
run_actions_before_prepare_component(self, cx);
run_actions_before_prepare_form(self, cx);
}
fn prepare_component(&self, cx: &mut Context) -> PrepareMarkup {
@ -70,6 +70,10 @@ impl ComponentTrait for Form {
})
}
fn after_prepare_component(&mut self, cx: &mut Context) {
run_actions_after_prepare_form(self, cx);
}
fn as_ref_any(&self) -> &dyn AnyComponent {
self
}

View file

@ -2,7 +2,7 @@ use pagetop::prelude::*;
use_handle!(COMPONENT_COLUMN);
action_before_prepare_component!(ACTION_BEFORE_PREPARE_COLUMN for Column);
actions_for_component!(Column);
const SIZE__DEFAULT: &str = "col-md";
const SIZE__1_OF_12: &str = "col-md-1";
@ -70,7 +70,7 @@ impl ComponentTrait for Column {
}
fn before_prepare_component(&mut self, cx: &mut Context) {
run_actions_before_prepare_component(self, cx);
run_actions_before_prepare_column(self, cx);
}
fn prepare_component(&self, cx: &mut Context) -> PrepareMarkup {
@ -81,6 +81,10 @@ impl ComponentTrait for Column {
})
}
fn after_prepare_component(&mut self, cx: &mut Context) {
run_actions_after_prepare_column(self, cx);
}
fn as_ref_any(&self) -> &dyn AnyComponent {
self
}

View file

@ -4,7 +4,7 @@ use crate::component::grid;
use_handle!(COMPONENT_ROW);
action_before_prepare_component!(ACTION_BEFORE_PREPARE_ROW for Row);
actions_for_component!(Row);
#[rustfmt::skip]
#[derive(Default)]
@ -39,7 +39,7 @@ impl ComponentTrait for Row {
}
fn before_prepare_component(&mut self, cx: &mut Context) {
run_actions_before_prepare_component(self, cx);
run_actions_before_prepare_row(self, cx);
}
fn prepare_component(&self, cx: &mut Context) -> PrepareMarkup {
@ -50,6 +50,10 @@ impl ComponentTrait for Row {
})
}
fn after_prepare_component(&mut self, cx: &mut Context) {
run_actions_after_prepare_row(self, cx);
}
fn as_ref_any(&self) -> &dyn AnyComponent {
self
}