diff --git a/.gitignore b/.gitignore index e1acdaf..3909f2f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ # directory ignores dist target +.idea # file ignores Cargo.lock diff --git a/CHANGELOG.md b/CHANGELOG.md index 16a8efd..7ffbc97 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,9 @@ This changelog follows the patterns described here: https://keepachangelog.com/e ## Unreleased +## 0.2.0 +- Added support for yew `0.18.x` + ## 0.1.6 ### changed - Updates to the `Navbar` component: diff --git a/Cargo.toml b/Cargo.toml index 4701c76..fbc386c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ybc" -version = "0.1.6" +version = "0.2.0" description = "A Yew component library based on the Bulma CSS framework." authors = ["Anthony Dodd "] edition = "2018" @@ -13,9 +13,9 @@ keywords = ["wasm", "web", "bulma", "sass", "yew"] [dependencies] derive_more = "0.99.9" web-sys = { version="0.3", features=["Element", "File", "HtmlCollection", "HtmlSelectElement"] } -yew = { version="0.17.3", features=["web_sys"] } -yewtil = { version="0.3.2", features=["neq"] } -yew-router = { version="0.14.0", features=["web_sys"], optional=true } +yew = { version="0.18.0", features=["web_sys"] } +yewtil = { version="0.4.0", features=["neq"] } +yew-router = { version="0.15.0", features=["web_sys"], optional=true } [features] default = ["router"] diff --git a/src/columns/mod.rs b/src/columns/mod.rs index 9364425..289d784 100644 --- a/src/columns/mod.rs +++ b/src/columns/mod.rs @@ -44,7 +44,7 @@ impl Component for Columns { fn view(&self) -> Html { let mut classes = Classes::from("columns"); if let Some(extra) = &self.props.classes { - classes = classes.extend(extra); + classes.push(extra); } if self.props.vcentered { classes.push("is-vcentered"); @@ -104,7 +104,7 @@ impl Component for Column { fn view(&self) -> Html { let mut classes = Classes::from("column"); if let Some(extra) = &self.props.classes { - classes = classes.extend(extra); + classes.push(extra); } html! {
diff --git a/src/common.rs b/src/common.rs index a4fb763..5b2e815 100644 --- a/src/common.rs +++ b/src/common.rs @@ -1,4 +1,6 @@ use derive_more::Display; +use std::borrow::Cow; +use yew::html::IntoOptPropValue; /// Common alignment classes. #[derive(Clone, Debug, Display, PartialEq)] @@ -25,3 +27,9 @@ pub enum Size { #[display(fmt = "large")] Large, } + +impl IntoOptPropValue> for Size { + fn into_opt_prop_value(self) -> Option> { + Some(Cow::from(self.to_string())) + } +} diff --git a/src/components/breadcrumb.rs b/src/components/breadcrumb.rs index 32d39c4..42b85d1 100644 --- a/src/components/breadcrumb.rs +++ b/src/components/breadcrumb.rs @@ -48,7 +48,7 @@ impl Component for Breadcrumb { fn view(&self) -> Html { let mut classes = Classes::from("breadcrumb"); if let Some(extra) = &self.props.classes { - classes = classes.extend(extra); + classes.push(extra); } if let Some(size) = &self.props.size { classes.push(&size.to_string()); diff --git a/src/components/card.rs b/src/components/card.rs index 7571e25..1932444 100644 --- a/src/components/card.rs +++ b/src/components/card.rs @@ -35,7 +35,7 @@ impl Component for Card { fn view(&self) -> Html { let mut classes = Classes::from("card"); if let Some(extra) = &self.props.classes { - classes = classes.extend(extra); + classes.push(extra); } html! {
@@ -82,7 +82,7 @@ impl Component for CardHeader { fn view(&self) -> Html { let mut classes = Classes::from("card-header"); if let Some(extra) = &self.props.classes { - classes = classes.extend(extra); + classes.push(extra); } html! {
@@ -129,7 +129,7 @@ impl Component for CardImage { fn view(&self) -> Html { let mut classes = Classes::from("card-image"); if let Some(extra) = &self.props.classes { - classes = classes.extend(extra); + classes.push(extra); } html! {
@@ -176,7 +176,7 @@ impl Component for CardContent { fn view(&self) -> Html { let mut classes = Classes::from("card-content"); if let Some(extra) = &self.props.classes { - classes = classes.extend(extra); + classes.push(extra); } html! {
@@ -223,7 +223,7 @@ impl Component for CardFooter { fn view(&self) -> Html { let mut classes = Classes::from("card-footer"); if let Some(extra) = &self.props.classes { - classes = classes.extend(extra); + classes.push(extra); } html! {