diff --git a/pagetop/src/base/component/form/input.rs b/pagetop/src/base/component/form/input.rs index c96197e8..18a980e3 100644 --- a/pagetop/src/base/component/form/input.rs +++ b/pagetop/src/base/component/form/input.rs @@ -47,7 +47,6 @@ impl ComponentTrait for Input { classes : Classes::new_with_default("form-item"), template : "default".to_owned(), } - .with_classes("form-type-textfield", ClassesOp::AddFirst) } fn handler(&self) -> &'static str { @@ -62,13 +61,6 @@ impl ComponentTrait for Input { self.weight } - fn before_render(&mut self, _: &mut InContext) { - if let Some(name) = self.name() { - let class = concat_string!("form-item-", name); - self.alter_classes(class.as_str(), ClassesOp::AddFirst); - } - } - fn default_render(&self, _: &mut InContext) -> Markup { let type_input = match self.input_type() { InputType::Email => "email", @@ -134,36 +126,31 @@ impl Input { } pub fn password() -> Self { - let mut input = Input::new() - .with_classes("form-type-password", ClassesOp::Replace("form-type-textfield")); + let mut input = Input::new(); input.input_type = InputType::Password; input } pub fn search() -> Self { - let mut input = Input::new() - .with_classes("form-type-search", ClassesOp::Replace("form-type-textfield")); + let mut input = Input::new(); input.input_type = InputType::Search; input } pub fn email() -> Self { - let mut input = Input::new() - .with_classes("form-type-email", ClassesOp::Replace("form-type-textfield")); + let mut input = Input::new(); input.input_type = InputType::Email; input } pub fn telephone() -> Self { - let mut input = Input::new() - .with_classes("form-type-telephone", ClassesOp::Replace("form-type-textfield")); + let mut input = Input::new(); input.input_type = InputType::Telephone; input } pub fn url() -> Self { - let mut input = Input::new() - .with_classes("form-type-url", ClassesOp::Replace("form-type-textfield")); + let mut input = Input::new(); input.input_type = InputType::Url; input } diff --git a/pagetop/src/core/component/definition.rs b/pagetop/src/core/component/definition.rs index 4912214e..4b49526f 100644 --- a/pagetop/src/core/component/definition.rs +++ b/pagetop/src/core/component/definition.rs @@ -26,10 +26,6 @@ pub trait ComponentTrait: AnyComponent + Send + Sync { 0 } - #[allow(unused_variables)] - fn before_render(&mut self, context: &mut InContext) { - } - #[allow(unused_variables)] fn default_render(&self, context: &mut InContext) -> Markup { html! {} @@ -49,9 +45,6 @@ pub fn component_mut(component: &mut dyn ComponentTrait) -> &mut C { } pub fn render_component(component: &mut dyn ComponentTrait, context: &mut InContext) -> Markup { - // Acciones del componente antes de renderizar. - component.before_render(context); - // Acciones de los módulos antes de renderizar el componente. run_hooks( BEFORE_RENDER_COMPONENT_HOOK,