diff --git a/CHANGELOG.md b/CHANGELOG.md index 16a8efd..b8286e4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ This changelog follows the patterns described here: https://keepachangelog.com/e ## Unreleased +## 0.1.7 +### added +- Added field `id` to compenents missing the field. + ## 0.1.6 ### changed - Updates to the `Navbar` component: diff --git a/Cargo.toml b/Cargo.toml index 4701c76..5900727 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ybc" -version = "0.1.6" +version = "0.1.7" description = "A Yew component library based on the Bulma CSS framework." authors = ["Anthony Dodd "] edition = "2018" diff --git a/src/columns/mod.rs b/src/columns/mod.rs index 9364425..6b99dd8 100644 --- a/src/columns/mod.rs +++ b/src/columns/mod.rs @@ -7,6 +7,8 @@ pub struct ColumnsProps { pub children: Children, #[prop_or_default] pub classes: Option, + #[prop_or_default] + pub id: String, /// Align child columns vertically. #[prop_or_default] pub vcentered: bool, @@ -55,15 +57,15 @@ impl Component for Columns { if self.props.centered { classes.push("is-centered"); } + let id = &self.props.id; html! { -
+
{self.props.children.clone()}
} } } -////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// #[derive(Clone, Debug, Properties, PartialEq)] @@ -72,6 +74,8 @@ pub struct ColumnProps { pub children: Children, #[prop_or_default] pub classes: Option, + #[prop_or_default] + pub id: String, } /// A flexbox-based responsive column. @@ -106,8 +110,9 @@ impl Component for Column { if let Some(extra) = &self.props.classes { classes = classes.extend(extra); } + let id = &self.props.id; html! { -
+
{self.props.children.clone()}
} diff --git a/src/components/breadcrumb.rs b/src/components/breadcrumb.rs index 32d39c4..acc81d1 100644 --- a/src/components/breadcrumb.rs +++ b/src/components/breadcrumb.rs @@ -11,6 +11,8 @@ pub struct BreadcrumbProps { pub children: Children, #[prop_or_default] pub classes: Option, + #[prop_or_default] + pub id: String, /// The size of this component. #[prop_or_default] pub size: Option, @@ -59,8 +61,9 @@ impl Component for Breadcrumb { if let Some(separator) = &self.props.separator { classes.push(&separator.to_string()); } + let id = &self.props.id; html! { -