use super::{ChildWidth, FlexVerticalAlignement, Margin, Text}; use yew::{classes, function_component, html, Children, Classes, Properties}; #[allow(dead_code)] #[derive(Debug, PartialEq, Eq, Copy, Clone)] pub enum GridGapSize { Small, Medium, Large, Collapse, } impl From for Classes { fn from(gap_size: GridGapSize) -> Self { format!("uk-grid-{:?}", gap_size).to_lowercase().into() } } #[derive(Properties, PartialEq)] pub struct GridProps { #[prop_or_default] pub children: Children, #[prop_or_default] pub gap_size: Option, #[prop_or_default] pub margin: Vec, #[prop_or_default] pub height_match: bool, #[prop_or_default] pub vertical_alignement: Option, #[prop_or_default] pub child_width: Option, #[prop_or_default] pub text_style: Vec, #[prop_or_default] pub class: Classes, } #[function_component(Grid)] pub fn grid( GridProps { children, gap_size, margin, height_match, vertical_alignement, child_width, text_style, class, }: &GridProps, ) -> Html { html! {
{ for children.iter() }
} }