👽️ Aplica cambios de API asociados a componentes

This commit is contained in:
Manuel Cillero 2023-06-24 01:03:41 +02:00
parent a39fee9297
commit b5606f043a
16 changed files with 65 additions and 64 deletions

View file

@ -45,24 +45,25 @@ impl ComponentTrait for Button {
(self.renderable.check)(rcx)
}
fn default_render(&self, rcx: &mut RenderContext) -> Markup {
fn prepare_component(&self, rcx: &mut RenderContext) -> Markup {
let button_type = match self.button_type() {
ButtonType::Button => "button",
ButtonType::Submit => "submit",
ButtonType::Reset => "reset",
};
let id = self.name().get().map(|name| concat_string!("edit-", name));
let value = self.value().prepare(rcx);
html! {
button
type=(button_type)
id=[id]
class=[self.classes().get()]
name=[self.name().get()]
value=(self.value().render(rcx))
value=(value)
autofocus=[self.autofocus().get()]
disabled=[self.disabled().get()]
{
(self.value().render(rcx))
(value)
}
}
}