👽️ Aplica cambios de API asociados a componentes
This commit is contained in:
parent
9993b5975b
commit
297d1fc338
14 changed files with 63 additions and 63 deletions
|
|
@ -45,7 +45,7 @@ impl ComponentTrait for Button {
|
|||
(self.renderable.check)(rcx)
|
||||
}
|
||||
|
||||
fn prepare_component(&self, rcx: &mut RenderContext) -> Markup {
|
||||
fn prepare_component(&self, rcx: &mut RenderContext) -> PrepareMarkup {
|
||||
let button_type = match self.button_type() {
|
||||
ButtonType::Button => "button",
|
||||
ButtonType::Submit => "submit",
|
||||
|
|
@ -53,7 +53,7 @@ impl ComponentTrait for Button {
|
|||
};
|
||||
let id = self.name().get().map(|name| concat_string!("edit-", name));
|
||||
let value = self.value().prepare(rcx);
|
||||
html! {
|
||||
PrepareMarkup::With(html! {
|
||||
button
|
||||
type=(button_type)
|
||||
id=[id]
|
||||
|
|
@ -65,7 +65,7 @@ impl ComponentTrait for Button {
|
|||
{
|
||||
(value)
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
fn as_ref_any(&self) -> &dyn AnyComponent {
|
||||
|
|
|
|||
|
|
@ -40,9 +40,9 @@ impl ComponentTrait for Date {
|
|||
(self.renderable.check)(rcx)
|
||||
}
|
||||
|
||||
fn prepare_component(&self, _: &mut RenderContext) -> Markup {
|
||||
fn prepare_component(&self, _: &mut RenderContext) -> PrepareMarkup {
|
||||
let id = self.name().get().map(|name| concat_string!("edit-", name));
|
||||
html! {
|
||||
PrepareMarkup::With(html! {
|
||||
div class=[self.classes().get()] {
|
||||
@if let Some(label) = self.label().get() {
|
||||
label class="form-label" for=[&id] {
|
||||
|
|
@ -70,7 +70,7 @@ impl ComponentTrait for Date {
|
|||
div class="form-text" { (help_text) }
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
fn as_ref_any(&self) -> &dyn AnyComponent {
|
||||
|
|
|
|||
|
|
@ -52,12 +52,12 @@ impl ComponentTrait for Form {
|
|||
run_actions_before_prepare_component(self, rcx);
|
||||
}
|
||||
|
||||
fn prepare_component(&self, rcx: &mut RenderContext) -> Markup {
|
||||
fn prepare_component(&self, rcx: &mut RenderContext) -> PrepareMarkup {
|
||||
let method = match self.method() {
|
||||
FormMethod::Post => Some("post".to_owned()),
|
||||
FormMethod::Get => None,
|
||||
};
|
||||
html! {
|
||||
PrepareMarkup::With(html! {
|
||||
form
|
||||
id=[self.id()]
|
||||
class=[self.classes().get()]
|
||||
|
|
@ -67,7 +67,7 @@ impl ComponentTrait for Form {
|
|||
{
|
||||
div { (self.elements().prepare(rcx)) }
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
fn as_ref_any(&self) -> &dyn AnyComponent {
|
||||
|
|
|
|||
|
|
@ -23,11 +23,11 @@ impl ComponentTrait for Hidden {
|
|||
self.weight
|
||||
}
|
||||
|
||||
fn prepare_component(&self, _: &mut RenderContext) -> Markup {
|
||||
fn prepare_component(&self, _: &mut RenderContext) -> PrepareMarkup {
|
||||
let id = self.name().get().map(|name| concat_string!("value-", name));
|
||||
html! {
|
||||
PrepareMarkup::With(html! {
|
||||
input type="hidden" id=[id] name=[self.name().get()] value=[self.value().get()];
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
fn as_ref_any(&self) -> &dyn AnyComponent {
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ impl ComponentTrait for Input {
|
|||
}
|
||||
|
||||
#[rustfmt::skip]
|
||||
fn prepare_component(&self, rcx: &mut RenderContext) -> Markup {
|
||||
fn prepare_component(&self, rcx: &mut RenderContext) -> PrepareMarkup {
|
||||
let type_input = match self.input_type() {
|
||||
InputType::Textfield => "text",
|
||||
InputType::Password => "password",
|
||||
|
|
@ -71,7 +71,7 @@ impl ComponentTrait for Input {
|
|||
InputType::Url => "url",
|
||||
};
|
||||
let id = self.name().get().map(|name| concat_string!("edit-", name));
|
||||
html! {
|
||||
PrepareMarkup::With(html! {
|
||||
div class=[self.classes().get()] {
|
||||
@if let Some(label) = self.label().prepare_optional(rcx) {
|
||||
label class="form-label" for=[&id] {
|
||||
|
|
@ -102,7 +102,7 @@ impl ComponentTrait for Input {
|
|||
div class="form-text" { (description) }
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
fn as_ref_any(&self) -> &dyn AnyComponent {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue