diff --git a/packages/yew-bootstrap/Cargo.toml b/packages/yew-bootstrap/Cargo.toml index cc57312..586a654 100644 --- a/packages/yew-bootstrap/Cargo.toml +++ b/packages/yew-bootstrap/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "yew-bootstrap" -version = "0.5.14" +version = "0.5.15" authors = ["Matthew Scheffel ", "Foorack "] edition = "2021" license = "MIT" diff --git a/packages/yew-bootstrap/src/component/badge.rs b/packages/yew-bootstrap/src/component/badge.rs index 394cb69..1979c08 100644 --- a/packages/yew-bootstrap/src/component/badge.rs +++ b/packages/yew-bootstrap/src/component/badge.rs @@ -63,10 +63,10 @@ impl Component for Badge { let mut classes = Classes::new(); match &props.position { Some(position) => { - classes.push(format!("position-absolute")); + classes.push("position-absolute".to_string()); classes.push(format!("{}", position.0)); classes.push(format!("{}", position.1)); - classes.push(format!("translate-middle")); + classes.push("translate-middle".to_string()); } None => {} } diff --git a/packages/yew-bootstrap/src/component/column.rs b/packages/yew-bootstrap/src/component/column.rs index 01a8be1..3aba577 100644 --- a/packages/yew-bootstrap/src/component/column.rs +++ b/packages/yew-bootstrap/src/component/column.rs @@ -3,9 +3,9 @@ use yew::prelude::*; /// # Column container /// Used with [crate::component::Row] to create grids -/// +/// /// See [crate::component::ColumnProps] for a listing of properties -/// +/// /// ## Example /// ```rust /// use yew::prelude::*; @@ -55,6 +55,10 @@ pub struct ColumnProps { /// Size (out of 12) for very very large screens #[prop_or_default] pub xxl: Option, + + /// Event called when the element is clicked + #[prop_or_default] + pub onclick: Callback, } impl Component for Column { @@ -113,6 +117,7 @@ impl Component for Column { html! {
{ for props.children.iter() }
diff --git a/packages/yew-bootstrap/src/component/row.rs b/packages/yew-bootstrap/src/component/row.rs index 1fb680e..4f01a75 100644 --- a/packages/yew-bootstrap/src/component/row.rs +++ b/packages/yew-bootstrap/src/component/row.rs @@ -3,9 +3,9 @@ use yew::prelude::*; /// # Row container /// Used alongside [crate::component::Column] to create grids -/// +/// /// See [crate::component::RowProps] for a listing of properties -/// +/// /// ## Example /// ```rust /// use yew::prelude::*; @@ -28,6 +28,10 @@ pub struct RowProps { #[prop_or_default] pub class: String, + /// Event called when the element is clicked + #[prop_or_default] + pub onclick: Callback, + /// Children of type [crate::component::Column] #[prop_or_default] pub children: ChildrenWithProps, @@ -50,6 +54,7 @@ impl Component for Row { html! {
{ for props.children.iter() }