👽️ 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
|
|
@ -63,7 +63,7 @@ impl ComponentTrait for Anchor {
|
|||
}
|
||||
|
||||
#[rustfmt::skip]
|
||||
fn prepare_component(&self, rcx: &mut RenderContext) -> Markup {
|
||||
fn prepare_component(&self, rcx: &mut RenderContext) -> PrepareMarkup {
|
||||
let target = match &self.target() {
|
||||
AnchorTarget::Blank => Some("_blank"),
|
||||
AnchorTarget::Parent => Some("_parent"),
|
||||
|
|
@ -71,7 +71,7 @@ impl ComponentTrait for Anchor {
|
|||
AnchorTarget::Context(name) => Some(name.as_str()),
|
||||
_ => None,
|
||||
};
|
||||
html! {
|
||||
PrepareMarkup::With(html! {
|
||||
a
|
||||
id=[self.id()]
|
||||
class=[self.classes().get()]
|
||||
|
|
@ -82,7 +82,7 @@ impl ComponentTrait for Anchor {
|
|||
(" ") span { (self.html().prepare(rcx)) } (" ")
|
||||
(self.right_icon().prepare(rcx))
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
fn as_ref_any(&self) -> &dyn AnyComponent {
|
||||
|
|
|
|||
|
|
@ -54,41 +54,41 @@ impl ComponentTrait for Container {
|
|||
run_actions_before_prepare_component(self, rcx);
|
||||
}
|
||||
|
||||
fn prepare_component(&self, rcx: &mut RenderContext) -> Markup {
|
||||
fn prepare_component(&self, rcx: &mut RenderContext) -> PrepareMarkup {
|
||||
match self.container_type() {
|
||||
ContainerType::Header => html! {
|
||||
ContainerType::Header => PrepareMarkup::With(html! {
|
||||
header id=[self.id()] class=[self.classes().get()] {
|
||||
div class=[self.inner_classes().get()] {
|
||||
(self.components().prepare(rcx))
|
||||
}
|
||||
}
|
||||
},
|
||||
ContainerType::Footer => html! {
|
||||
}),
|
||||
ContainerType::Footer => PrepareMarkup::With(html! {
|
||||
footer id=[self.id()] class=[self.classes().get()] {
|
||||
div class=[self.inner_classes().get()] {
|
||||
(self.components().prepare(rcx))
|
||||
}
|
||||
}
|
||||
},
|
||||
ContainerType::Main => html! {
|
||||
}),
|
||||
ContainerType::Main => PrepareMarkup::With(html! {
|
||||
main id=[self.id()] class=[self.classes().get()] {
|
||||
div class=[self.inner_classes().get()] {
|
||||
(self.components().prepare(rcx))
|
||||
}
|
||||
}
|
||||
},
|
||||
ContainerType::Section => html! {
|
||||
}),
|
||||
ContainerType::Section => PrepareMarkup::With(html! {
|
||||
section id=[self.id()] class=[self.classes().get()] {
|
||||
div class=[self.inner_classes().get()] {
|
||||
(self.components().prepare(rcx))
|
||||
}
|
||||
}
|
||||
},
|
||||
_ => html! {
|
||||
}),
|
||||
_ => PrepareMarkup::With(html! {
|
||||
div id=[self.id()] class=[self.classes().get()] {
|
||||
(self.components().prepare(rcx))
|
||||
}
|
||||
},
|
||||
}),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -73,12 +73,12 @@ impl ComponentTrait for Column {
|
|||
run_actions_before_prepare_component(self, rcx);
|
||||
}
|
||||
|
||||
fn prepare_component(&self, rcx: &mut RenderContext) -> Markup {
|
||||
html! {
|
||||
fn prepare_component(&self, rcx: &mut RenderContext) -> PrepareMarkup {
|
||||
PrepareMarkup::With(html! {
|
||||
div id=[self.id()] class=[self.classes().get()] {
|
||||
(self.components().prepare(rcx))
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
fn as_ref_any(&self) -> &dyn AnyComponent {
|
||||
|
|
|
|||
|
|
@ -42,12 +42,12 @@ impl ComponentTrait for Row {
|
|||
run_actions_before_prepare_component(self, rcx);
|
||||
}
|
||||
|
||||
fn prepare_component(&self, rcx: &mut RenderContext) -> Markup {
|
||||
html! {
|
||||
fn prepare_component(&self, rcx: &mut RenderContext) -> PrepareMarkup {
|
||||
PrepareMarkup::With(html! {
|
||||
div id=[self.id()] class=[self.classes().get()] {
|
||||
(self.columns().prepare(rcx))
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
fn as_ref_any(&self) -> &dyn AnyComponent {
|
||||
|
|
|
|||
|
|
@ -61,17 +61,17 @@ impl ComponentTrait for Heading {
|
|||
(self.renderable.check)(rcx)
|
||||
}
|
||||
|
||||
fn prepare_component(&self, rcx: &mut RenderContext) -> Markup {
|
||||
fn prepare_component(&self, rcx: &mut RenderContext) -> PrepareMarkup {
|
||||
let id = self.id();
|
||||
let classes = self.classes().get();
|
||||
html! { @match &self.heading_type() {
|
||||
PrepareMarkup::With(html! { @match &self.heading_type() {
|
||||
HeadingType::H1 => h1 id=[id] class=[classes] { (self.text().prepare(rcx)) },
|
||||
HeadingType::H2 => h2 id=[id] class=[classes] { (self.text().prepare(rcx)) },
|
||||
HeadingType::H3 => h3 id=[id] class=[classes] { (self.text().prepare(rcx)) },
|
||||
HeadingType::H4 => h4 id=[id] class=[classes] { (self.text().prepare(rcx)) },
|
||||
HeadingType::H5 => h5 id=[id] class=[classes] { (self.text().prepare(rcx)) },
|
||||
HeadingType::H6 => h6 id=[id] class=[classes] { (self.text().prepare(rcx)) },
|
||||
}}
|
||||
}})
|
||||
}
|
||||
|
||||
fn as_ref_any(&self) -> &dyn AnyComponent {
|
||||
|
|
|
|||
|
|
@ -34,8 +34,8 @@ impl ComponentTrait for Icon {
|
|||
));
|
||||
}
|
||||
|
||||
fn prepare_component(&self, _: &mut RenderContext) -> Markup {
|
||||
html! { i class=[self.classes().get()] {}; }
|
||||
fn prepare_component(&self, _: &mut RenderContext) -> PrepareMarkup {
|
||||
PrepareMarkup::With(html! { i class=[self.classes().get()] {}; })
|
||||
}
|
||||
|
||||
fn as_ref_any(&self) -> &dyn AnyComponent {
|
||||
|
|
|
|||
|
|
@ -34,13 +34,13 @@ impl ComponentTrait for Image {
|
|||
(self.renderable.check)(rcx)
|
||||
}
|
||||
|
||||
fn prepare_component(&self, _: &mut RenderContext) -> Markup {
|
||||
html! {
|
||||
fn prepare_component(&self, _: &mut RenderContext) -> PrepareMarkup {
|
||||
PrepareMarkup::With(html! {
|
||||
img
|
||||
src=[self.source().get()]
|
||||
id=[self.id()]
|
||||
class=[self.classes().get()];
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
fn as_ref_any(&self) -> &dyn AnyComponent {
|
||||
|
|
|
|||
|
|
@ -46,15 +46,15 @@ impl ComponentTrait for Paragraph {
|
|||
(self.renderable.check)(rcx)
|
||||
}
|
||||
|
||||
fn prepare_component(&self, rcx: &mut RenderContext) -> Markup {
|
||||
html! {
|
||||
fn prepare_component(&self, rcx: &mut RenderContext) -> PrepareMarkup {
|
||||
PrepareMarkup::With(html! {
|
||||
p
|
||||
id=[self.id()]
|
||||
class=[self.classes().get()]
|
||||
{
|
||||
(self.components().prepare(rcx))
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
fn as_ref_any(&self) -> &dyn AnyComponent {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue