👽️ Aplica cambios de API asociados a componentes
This commit is contained in:
parent
a39fee9297
commit
b5606f043a
16 changed files with 65 additions and 64 deletions
|
|
@ -134,18 +134,18 @@ impl ThemeTrait for Bootsier {
|
||||||
div class="media-body" {
|
div class="media-body" {
|
||||||
h1 class="display-4" { ("RESOURCE NOT FOUND") }
|
h1 class="display-4" { ("RESOURCE NOT FOUND") }
|
||||||
p class="lead" {
|
p class="lead" {
|
||||||
(L10n::t("e404-description", &LOCALE_BOOTSIER).render(rcx))
|
(L10n::t("e404-description", &LOCALE_BOOTSIER).prepare(rcx))
|
||||||
}
|
}
|
||||||
hr class="my-4";
|
hr class="my-4";
|
||||||
p {
|
p {
|
||||||
(L10n::t("e404-description", &LOCALE_BOOTSIER).render(rcx))
|
(L10n::t("e404-description", &LOCALE_BOOTSIER).prepare(rcx))
|
||||||
}
|
}
|
||||||
a
|
a
|
||||||
class="btn btn-primary btn-lg"
|
class="btn btn-primary btn-lg"
|
||||||
href="/"
|
href="/"
|
||||||
role="button"
|
role="button"
|
||||||
{
|
{
|
||||||
(L10n::t("back-homepage", &LOCALE_BOOTSIER).render(rcx))
|
(L10n::t("back-homepage", &LOCALE_BOOTSIER).prepare(rcx))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,7 @@ impl ThemeTrait for Bulmix {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[rustfmt::skip]
|
#[rustfmt::skip]
|
||||||
fn before_render_component(
|
fn before_prepare_component(
|
||||||
&self,
|
&self,
|
||||||
component: &mut dyn ComponentTrait,
|
component: &mut dyn ComponentTrait,
|
||||||
_rcx: &mut RenderContext,
|
_rcx: &mut RenderContext,
|
||||||
|
|
|
||||||
|
|
@ -44,29 +44,29 @@ impl ComponentTrait for MegaMenuItem {
|
||||||
(self.renderable.check)(rcx)
|
(self.renderable.check)(rcx)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn default_render(&self, rcx: &mut RenderContext) -> Markup {
|
fn prepare_component(&self, rcx: &mut RenderContext) -> Markup {
|
||||||
match self.item_type() {
|
match self.item_type() {
|
||||||
MegaMenuItemType::Void => html! {},
|
MegaMenuItemType::Void => html! {},
|
||||||
|
|
||||||
MegaMenuItemType::Label(label) => html! {
|
MegaMenuItemType::Label(label) => html! {
|
||||||
li class="label" { a href="#" { (label.render(rcx)) } }
|
li class="label" { a href="#" { (label.prepare(rcx)) } }
|
||||||
},
|
},
|
||||||
MegaMenuItemType::Link(label, path) => html! {
|
MegaMenuItemType::Link(label, path) => html! {
|
||||||
li class="link" { a href=(path) { (label.render(rcx)) } }
|
li class="link" { a href=(path) { (label.prepare(rcx)) } }
|
||||||
},
|
},
|
||||||
MegaMenuItemType::LinkBlank(label, path) => html! {
|
MegaMenuItemType::LinkBlank(label, path) => html! {
|
||||||
li class="link_blank" {
|
li class="link_blank" {
|
||||||
a href=(path) target="_blank" { (label.render(rcx)) }
|
a href=(path) target="_blank" { (label.prepare(rcx)) }
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
MegaMenuItemType::Html(content) => html! {
|
MegaMenuItemType::Html(content) => html! {
|
||||||
li class="html" { (content.render(rcx)) }
|
li class="html" { (content.prepare(rcx)) }
|
||||||
},
|
},
|
||||||
MegaMenuItemType::Submenu(label, menu) => html! {
|
MegaMenuItemType::Submenu(label, menu) => html! {
|
||||||
li class="submenu" {
|
li class="submenu" {
|
||||||
a href="#" { (label.render(rcx)) }
|
a href="#" { (label.prepare(rcx)) }
|
||||||
ul {
|
ul {
|
||||||
(menu.items().render(rcx))
|
(menu.items().prepare(rcx))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
@ -153,7 +153,7 @@ impl MegaMenuItem {
|
||||||
|
|
||||||
use_handle!(COMPONENT_MEGAMENU);
|
use_handle!(COMPONENT_MEGAMENU);
|
||||||
|
|
||||||
action_before_render_component!(ACTION_BEFORE_RENDER_MENU for MegaMenu);
|
action_before_prepare_component!(ACTION_BEFORE_PREPARE_MENU for MegaMenu);
|
||||||
|
|
||||||
#[rustfmt::skip]
|
#[rustfmt::skip]
|
||||||
#[derive(Default)]
|
#[derive(Default)]
|
||||||
|
|
@ -187,11 +187,11 @@ impl ComponentTrait for MegaMenu {
|
||||||
(self.renderable.check)(rcx)
|
(self.renderable.check)(rcx)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn before_render(&mut self, rcx: &mut RenderContext) {
|
fn before_prepare(&mut self, rcx: &mut RenderContext) {
|
||||||
run_actions_before_render_component(self, rcx);
|
run_actions_before_prepare_component(self, rcx);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn default_render(&self, rcx: &mut RenderContext) -> Markup {
|
fn prepare_component(&self, rcx: &mut RenderContext) -> Markup {
|
||||||
rcx.alter(ContextOp::AddStyleSheet(
|
rcx.alter(ContextOp::AddStyleSheet(
|
||||||
StyleSheet::located("/megamenu/css/menu.css").with_version("1.1.1"),
|
StyleSheet::located("/megamenu/css/menu.css").with_version("1.1.1"),
|
||||||
))
|
))
|
||||||
|
|
@ -207,7 +207,7 @@ impl ComponentTrait for MegaMenu {
|
||||||
|
|
||||||
html! {
|
html! {
|
||||||
ul id=(id) class=[self.classes().get()] {
|
ul id=(id) class=[self.classes().get()] {
|
||||||
(self.items().render(rcx))
|
(self.items().prepare(rcx))
|
||||||
}
|
}
|
||||||
script type="text/javascript" defer {
|
script type="text/javascript" defer {
|
||||||
"jQuery(function(){jQuery('#" (id) "').smartmenus({"
|
"jQuery(function(){jQuery('#" (id) "').smartmenus({"
|
||||||
|
|
|
||||||
|
|
@ -63,7 +63,7 @@ impl ComponentTrait for Anchor {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[rustfmt::skip]
|
#[rustfmt::skip]
|
||||||
fn default_render(&self, rcx: &mut RenderContext) -> Markup {
|
fn prepare_component(&self, rcx: &mut RenderContext) -> Markup {
|
||||||
let target = match &self.target() {
|
let target = match &self.target() {
|
||||||
AnchorTarget::Blank => Some("_blank"),
|
AnchorTarget::Blank => Some("_blank"),
|
||||||
AnchorTarget::Parent => Some("_parent"),
|
AnchorTarget::Parent => Some("_parent"),
|
||||||
|
|
@ -78,9 +78,9 @@ impl ComponentTrait for Anchor {
|
||||||
href=[self.href().get()]
|
href=[self.href().get()]
|
||||||
target=[target]
|
target=[target]
|
||||||
{
|
{
|
||||||
(self.left_icon().render(rcx))
|
(self.left_icon().prepare(rcx))
|
||||||
(" ") span { (self.html().render(rcx)) } (" ")
|
(" ") span { (self.html().prepare(rcx)) } (" ")
|
||||||
(self.right_icon().render(rcx))
|
(self.right_icon().prepare(rcx))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ use pagetop::prelude::*;
|
||||||
|
|
||||||
use_handle!(COMPONENT_CONTAINER);
|
use_handle!(COMPONENT_CONTAINER);
|
||||||
|
|
||||||
action_before_render_component!(ACTION_BEFORE_RENDER_CONTAINER for Container);
|
action_before_prepare_component!(ACTION_BEFORE_PREPARE_CONTAINER for Container);
|
||||||
|
|
||||||
#[derive(Default)]
|
#[derive(Default)]
|
||||||
pub enum ContainerType {
|
pub enum ContainerType {
|
||||||
|
|
@ -50,43 +50,43 @@ impl ComponentTrait for Container {
|
||||||
(self.renderable.check)(rcx)
|
(self.renderable.check)(rcx)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn before_render(&mut self, rcx: &mut RenderContext) {
|
fn before_prepare(&mut self, rcx: &mut RenderContext) {
|
||||||
run_actions_before_render_component(self, rcx);
|
run_actions_before_prepare_component(self, rcx);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn default_render(&self, rcx: &mut RenderContext) -> Markup {
|
fn prepare_component(&self, rcx: &mut RenderContext) -> Markup {
|
||||||
match self.container_type() {
|
match self.container_type() {
|
||||||
ContainerType::Header => html! {
|
ContainerType::Header => html! {
|
||||||
header id=[self.id()] class=[self.classes().get()] {
|
header id=[self.id()] class=[self.classes().get()] {
|
||||||
div class=[self.inner_classes().get()] {
|
div class=[self.inner_classes().get()] {
|
||||||
(self.components().render(rcx))
|
(self.components().prepare(rcx))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
ContainerType::Footer => html! {
|
ContainerType::Footer => html! {
|
||||||
footer id=[self.id()] class=[self.classes().get()] {
|
footer id=[self.id()] class=[self.classes().get()] {
|
||||||
div class=[self.inner_classes().get()] {
|
div class=[self.inner_classes().get()] {
|
||||||
(self.components().render(rcx))
|
(self.components().prepare(rcx))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
ContainerType::Main => html! {
|
ContainerType::Main => html! {
|
||||||
main id=[self.id()] class=[self.classes().get()] {
|
main id=[self.id()] class=[self.classes().get()] {
|
||||||
div class=[self.inner_classes().get()] {
|
div class=[self.inner_classes().get()] {
|
||||||
(self.components().render(rcx))
|
(self.components().prepare(rcx))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
ContainerType::Section => html! {
|
ContainerType::Section => html! {
|
||||||
section id=[self.id()] class=[self.classes().get()] {
|
section id=[self.id()] class=[self.classes().get()] {
|
||||||
div class=[self.inner_classes().get()] {
|
div class=[self.inner_classes().get()] {
|
||||||
(self.components().render(rcx))
|
(self.components().prepare(rcx))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
_ => html! {
|
_ => html! {
|
||||||
div id=[self.id()] class=[self.classes().get()] {
|
div id=[self.id()] class=[self.classes().get()] {
|
||||||
(self.components().render(rcx))
|
(self.components().prepare(rcx))
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -45,24 +45,25 @@ impl ComponentTrait for Button {
|
||||||
(self.renderable.check)(rcx)
|
(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() {
|
let button_type = match self.button_type() {
|
||||||
ButtonType::Button => "button",
|
ButtonType::Button => "button",
|
||||||
ButtonType::Submit => "submit",
|
ButtonType::Submit => "submit",
|
||||||
ButtonType::Reset => "reset",
|
ButtonType::Reset => "reset",
|
||||||
};
|
};
|
||||||
let id = self.name().get().map(|name| concat_string!("edit-", name));
|
let id = self.name().get().map(|name| concat_string!("edit-", name));
|
||||||
|
let value = self.value().prepare(rcx);
|
||||||
html! {
|
html! {
|
||||||
button
|
button
|
||||||
type=(button_type)
|
type=(button_type)
|
||||||
id=[id]
|
id=[id]
|
||||||
class=[self.classes().get()]
|
class=[self.classes().get()]
|
||||||
name=[self.name().get()]
|
name=[self.name().get()]
|
||||||
value=(self.value().render(rcx))
|
value=(value)
|
||||||
autofocus=[self.autofocus().get()]
|
autofocus=[self.autofocus().get()]
|
||||||
disabled=[self.disabled().get()]
|
disabled=[self.disabled().get()]
|
||||||
{
|
{
|
||||||
(self.value().render(rcx))
|
(value)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@ impl ComponentTrait for Date {
|
||||||
(self.renderable.check)(rcx)
|
(self.renderable.check)(rcx)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn default_render(&self, _: &mut RenderContext) -> Markup {
|
fn prepare_component(&self, _: &mut RenderContext) -> Markup {
|
||||||
let id = self.name().get().map(|name| concat_string!("edit-", name));
|
let id = self.name().get().map(|name| concat_string!("edit-", name));
|
||||||
html! {
|
html! {
|
||||||
div class=[self.classes().get()] {
|
div class=[self.classes().get()] {
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ use pagetop::prelude::*;
|
||||||
|
|
||||||
use_handle!(COMPONENT_FORM);
|
use_handle!(COMPONENT_FORM);
|
||||||
|
|
||||||
action_before_render_component!(ACTION_BEFORE_RENDER_FORM for Form);
|
action_before_prepare_component!(ACTION_BEFORE_PREPARE_FORM for Form);
|
||||||
|
|
||||||
#[derive(Default)]
|
#[derive(Default)]
|
||||||
pub enum FormMethod {
|
pub enum FormMethod {
|
||||||
|
|
@ -48,11 +48,11 @@ impl ComponentTrait for Form {
|
||||||
(self.renderable.check)(rcx)
|
(self.renderable.check)(rcx)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn before_render(&mut self, rcx: &mut RenderContext) {
|
fn before_prepare(&mut self, rcx: &mut RenderContext) {
|
||||||
run_actions_before_render_component(self, rcx);
|
run_actions_before_prepare_component(self, rcx);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn default_render(&self, rcx: &mut RenderContext) -> Markup {
|
fn prepare_component(&self, rcx: &mut RenderContext) -> Markup {
|
||||||
let method = match self.method() {
|
let method = match self.method() {
|
||||||
FormMethod::Post => Some("post".to_owned()),
|
FormMethod::Post => Some("post".to_owned()),
|
||||||
FormMethod::Get => None,
|
FormMethod::Get => None,
|
||||||
|
|
@ -65,7 +65,7 @@ impl ComponentTrait for Form {
|
||||||
method=[method]
|
method=[method]
|
||||||
accept-charset=[self.charset().get()]
|
accept-charset=[self.charset().get()]
|
||||||
{
|
{
|
||||||
div { (self.elements().render(rcx)) }
|
div { (self.elements().prepare(rcx)) }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ impl ComponentTrait for Hidden {
|
||||||
self.weight
|
self.weight
|
||||||
}
|
}
|
||||||
|
|
||||||
fn default_render(&self, _: &mut RenderContext) -> Markup {
|
fn prepare_component(&self, _: &mut RenderContext) -> Markup {
|
||||||
let id = self.name().get().map(|name| concat_string!("value-", name));
|
let id = self.name().get().map(|name| concat_string!("value-", name));
|
||||||
html! {
|
html! {
|
||||||
input type="hidden" id=[id] name=[self.name().get()] value=[self.value().get()];
|
input type="hidden" id=[id] name=[self.name().get()] value=[self.value().get()];
|
||||||
|
|
|
||||||
|
|
@ -61,7 +61,7 @@ impl ComponentTrait for Input {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[rustfmt::skip]
|
#[rustfmt::skip]
|
||||||
fn default_render(&self, rcx: &mut RenderContext) -> Markup {
|
fn prepare_component(&self, rcx: &mut RenderContext) -> Markup {
|
||||||
let type_input = match self.input_type() {
|
let type_input = match self.input_type() {
|
||||||
InputType::Textfield => "text",
|
InputType::Textfield => "text",
|
||||||
InputType::Password => "password",
|
InputType::Password => "password",
|
||||||
|
|
@ -73,7 +73,7 @@ impl ComponentTrait for Input {
|
||||||
let id = self.name().get().map(|name| concat_string!("edit-", name));
|
let id = self.name().get().map(|name| concat_string!("edit-", name));
|
||||||
html! {
|
html! {
|
||||||
div class=[self.classes().get()] {
|
div class=[self.classes().get()] {
|
||||||
@if let Some(label) = self.label().optional_render(rcx) {
|
@if let Some(label) = self.label().prepare_optional(rcx) {
|
||||||
label class="form-label" for=[&id] {
|
label class="form-label" for=[&id] {
|
||||||
(label) " "
|
(label) " "
|
||||||
@if self.required().get().is_some() {
|
@if self.required().get().is_some() {
|
||||||
|
|
@ -98,7 +98,7 @@ impl ComponentTrait for Input {
|
||||||
readonly=[self.readonly().get()]
|
readonly=[self.readonly().get()]
|
||||||
required=[self.required().get()]
|
required=[self.required().get()]
|
||||||
disabled=[self.disabled().get()];
|
disabled=[self.disabled().get()];
|
||||||
@if let Some(description) = self.help_text().optional_render(rcx) {
|
@if let Some(description) = self.help_text().prepare_optional(rcx) {
|
||||||
div class="form-text" { (description) }
|
div class="form-text" { (description) }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ use pagetop::prelude::*;
|
||||||
|
|
||||||
use_handle!(COMPONENT_COLUMN);
|
use_handle!(COMPONENT_COLUMN);
|
||||||
|
|
||||||
action_before_render_component!(ACTION_BEFORE_RENDER_COLUMN for Column);
|
action_before_prepare_component!(ACTION_BEFORE_PREPARE_COLUMN for Column);
|
||||||
|
|
||||||
const SIZE__DEFAULT: &str = "col-md";
|
const SIZE__DEFAULT: &str = "col-md";
|
||||||
const SIZE__1_OF_12: &str = "col-md-1";
|
const SIZE__1_OF_12: &str = "col-md-1";
|
||||||
|
|
@ -69,14 +69,14 @@ impl ComponentTrait for Column {
|
||||||
(self.renderable.check)(rcx)
|
(self.renderable.check)(rcx)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn before_render(&mut self, rcx: &mut RenderContext) {
|
fn before_prepare(&mut self, rcx: &mut RenderContext) {
|
||||||
run_actions_before_render_component(self, rcx);
|
run_actions_before_prepare_component(self, rcx);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn default_render(&self, rcx: &mut RenderContext) -> Markup {
|
fn prepare_component(&self, rcx: &mut RenderContext) -> Markup {
|
||||||
html! {
|
html! {
|
||||||
div id=[self.id()] class=[self.classes().get()] {
|
div id=[self.id()] class=[self.classes().get()] {
|
||||||
(self.components().render(rcx))
|
(self.components().prepare(rcx))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ use crate::component::grid;
|
||||||
|
|
||||||
use_handle!(COMPONENT_ROW);
|
use_handle!(COMPONENT_ROW);
|
||||||
|
|
||||||
action_before_render_component!(ACTION_BEFORE_RENDER_ROW for Row);
|
action_before_prepare_component!(ACTION_BEFORE_PREPARE_ROW for Row);
|
||||||
|
|
||||||
#[rustfmt::skip]
|
#[rustfmt::skip]
|
||||||
#[derive(Default)]
|
#[derive(Default)]
|
||||||
|
|
@ -38,14 +38,14 @@ impl ComponentTrait for Row {
|
||||||
(self.renderable.check)(rcx)
|
(self.renderable.check)(rcx)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn before_render(&mut self, rcx: &mut RenderContext) {
|
fn before_prepare(&mut self, rcx: &mut RenderContext) {
|
||||||
run_actions_before_render_component(self, rcx);
|
run_actions_before_prepare_component(self, rcx);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn default_render(&self, rcx: &mut RenderContext) -> Markup {
|
fn prepare_component(&self, rcx: &mut RenderContext) -> Markup {
|
||||||
html! {
|
html! {
|
||||||
div id=[self.id()] class=[self.classes().get()] {
|
div id=[self.id()] class=[self.classes().get()] {
|
||||||
(self.columns().render(rcx))
|
(self.columns().prepare(rcx))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -61,16 +61,16 @@ impl ComponentTrait for Heading {
|
||||||
(self.renderable.check)(rcx)
|
(self.renderable.check)(rcx)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn default_render(&self, rcx: &mut RenderContext) -> Markup {
|
fn prepare_component(&self, rcx: &mut RenderContext) -> Markup {
|
||||||
let id = self.id();
|
let id = self.id();
|
||||||
let classes = self.classes().get();
|
let classes = self.classes().get();
|
||||||
html! { @match &self.heading_type() {
|
html! { @match &self.heading_type() {
|
||||||
HeadingType::H1 => h1 id=[id] class=[classes] { (self.text().render(rcx)) },
|
HeadingType::H1 => h1 id=[id] class=[classes] { (self.text().prepare(rcx)) },
|
||||||
HeadingType::H2 => h2 id=[id] class=[classes] { (self.text().render(rcx)) },
|
HeadingType::H2 => h2 id=[id] class=[classes] { (self.text().prepare(rcx)) },
|
||||||
HeadingType::H3 => h3 id=[id] class=[classes] { (self.text().render(rcx)) },
|
HeadingType::H3 => h3 id=[id] class=[classes] { (self.text().prepare(rcx)) },
|
||||||
HeadingType::H4 => h4 id=[id] class=[classes] { (self.text().render(rcx)) },
|
HeadingType::H4 => h4 id=[id] class=[classes] { (self.text().prepare(rcx)) },
|
||||||
HeadingType::H5 => h5 id=[id] class=[classes] { (self.text().render(rcx)) },
|
HeadingType::H5 => h5 id=[id] class=[classes] { (self.text().prepare(rcx)) },
|
||||||
HeadingType::H6 => h6 id=[id] class=[classes] { (self.text().render(rcx)) },
|
HeadingType::H6 => h6 id=[id] class=[classes] { (self.text().prepare(rcx)) },
|
||||||
}}
|
}}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -28,13 +28,13 @@ impl ComponentTrait for Icon {
|
||||||
(self.renderable.check)(rcx)
|
(self.renderable.check)(rcx)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn before_render(&mut self, rcx: &mut RenderContext) {
|
fn before_prepare(&mut self, rcx: &mut RenderContext) {
|
||||||
rcx.alter(ContextOp::AddStyleSheet(
|
rcx.alter(ContextOp::AddStyleSheet(
|
||||||
StyleSheet::located("/minimal/icons/bootstrap-icons.css").with_version("1.8.2"),
|
StyleSheet::located("/minimal/icons/bootstrap-icons.css").with_version("1.8.2"),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
fn default_render(&self, _: &mut RenderContext) -> Markup {
|
fn prepare_component(&self, _: &mut RenderContext) -> Markup {
|
||||||
html! { i class=[self.classes().get()] {}; }
|
html! { i class=[self.classes().get()] {}; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ impl ComponentTrait for Image {
|
||||||
(self.renderable.check)(rcx)
|
(self.renderable.check)(rcx)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn default_render(&self, _: &mut RenderContext) -> Markup {
|
fn prepare_component(&self, _: &mut RenderContext) -> Markup {
|
||||||
html! {
|
html! {
|
||||||
img
|
img
|
||||||
src=[self.source().get()]
|
src=[self.source().get()]
|
||||||
|
|
|
||||||
|
|
@ -46,13 +46,13 @@ impl ComponentTrait for Paragraph {
|
||||||
(self.renderable.check)(rcx)
|
(self.renderable.check)(rcx)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn default_render(&self, rcx: &mut RenderContext) -> Markup {
|
fn prepare_component(&self, rcx: &mut RenderContext) -> Markup {
|
||||||
html! {
|
html! {
|
||||||
p
|
p
|
||||||
id=[self.id()]
|
id=[self.id()]
|
||||||
class=[self.classes().get()]
|
class=[self.classes().get()]
|
||||||
{
|
{
|
||||||
(self.components().render(rcx))
|
(self.components().prepare(rcx))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue