diff --git a/thaw/src/accordion/accordion_item.rs b/thaw/src/accordion/accordion_item.rs index 2e48534..afc5a3a 100644 --- a/thaw/src/accordion/accordion_item.rs +++ b/thaw/src/accordion/accordion_item.rs @@ -50,23 +50,25 @@ pub fn AccordionItem( type="button" on:click=on_click > - } } diff --git a/thaw/src/radio/radio_group.rs b/thaw/src/radio/radio_group.rs index eb2e2ed..41a7ed5 100644 --- a/thaw/src/radio/radio_group.rs +++ b/thaw/src/radio/radio_group.rs @@ -5,7 +5,8 @@ use thaw_utils::{class_list, OptionModel}; pub fn RadioGroup( #[prop(optional, into)] class: MaybeProp, /// The selected Radio item in this group. - #[prop(optional, into)] value: OptionModel, + #[prop(optional, into)] + value: OptionModel, /// The name of this radio group. #[prop(optional, into)] name: Option, @@ -14,8 +15,12 @@ pub fn RadioGroup( let name = name.unwrap_or_else(|| uuid::Uuid::new_v4().to_string()); view! { - -
+ +
{children()}
diff --git a/thaw/src/scrollbar/mod.rs b/thaw/src/scrollbar/mod.rs index 5852329..6d4b37b 100644 --- a/thaw/src/scrollbar/mod.rs +++ b/thaw/src/scrollbar/mod.rs @@ -6,11 +6,14 @@ pub fn Scrollbar( #[prop(optional, into)] class: MaybeProp, #[prop(optional, into)] style: MaybeProp, /// Class name of content div. - #[prop(optional, into)] content_class: MaybeProp, + #[prop(optional, into)] + content_class: MaybeProp, /// Style of content div. - #[prop(optional, into)] content_style: MaybeProp, + #[prop(optional, into)] + content_style: MaybeProp, /// Size of scrollbar. - #[prop(default = 8)] size: u8, + #[prop(default = 8)] + size: u8, #[prop(optional)] comp_ref: Option>, children: Children, ) -> impl IntoView { @@ -299,15 +302,10 @@ pub fn Scrollbar(
impl IntoView { view! { -
+
{children()}
} diff --git a/thaw/src/skeleton/skeleton_item.rs b/thaw/src/skeleton/skeleton_item.rs index 5337941..ce56d2a 100644 --- a/thaw/src/skeleton/skeleton_item.rs +++ b/thaw/src/skeleton/skeleton_item.rs @@ -5,8 +5,5 @@ use thaw_utils::{class_list, mount_style}; pub fn SkeletonItem(#[prop(optional, into)] class: MaybeProp) -> impl IntoView { mount_style("skeleton-item", include_str!("./skeleton-item.css")); - view! { -
-
- } + view! {
} } diff --git a/thaw/src/slider/mod.rs b/thaw/src/slider/mod.rs index 7b6825d..f7ebf8f 100644 --- a/thaw/src/slider/mod.rs +++ b/thaw/src/slider/mod.rs @@ -76,10 +76,7 @@ pub fn Slider( view! { -
+
-
-
-
-
+
+
{children()} diff --git a/thaw/src/slider/slider_label.rs b/thaw/src/slider/slider_label.rs index 256db5a..248b149 100644 --- a/thaw/src/slider/slider_label.rs +++ b/thaw/src/slider/slider_label.rs @@ -20,11 +20,7 @@ pub fn SliderLabel( }; view! { - diff --git a/thaw/src/space/mod.rs b/thaw/src/space/mod.rs index 71242f3..eb2dd9a 100644 --- a/thaw/src/space/mod.rs +++ b/thaw/src/space/mod.rs @@ -16,13 +16,17 @@ pub enum SpaceGap { pub fn Space( #[prop(optional, into)] class: MaybeProp, /// Space's gap. - #[prop(optional)] gap: SpaceGap, + #[prop(optional)] + gap: SpaceGap, /// Whether to lay out vertically. - #[prop(optional)] vertical: bool, + #[prop(optional)] + vertical: bool, /// Vertical arrangement. - #[prop(optional, into)] align: MaybeProp, + #[prop(optional, into)] + align: MaybeProp, /// Horizontal arrangement. - #[prop(optional, into)] justify: MaybeProp, + #[prop(optional, into)] + justify: MaybeProp, children: ChildrenFragment, ) -> impl IntoView { mount_style("space", include_str!("./space.css")); diff --git a/thaw/src/spin_button/mod.rs b/thaw/src/spin_button/mod.rs index 44446fc..24099b5 100644 --- a/thaw/src/spin_button/mod.rs +++ b/thaw/src/spin_button/mod.rs @@ -78,9 +78,11 @@ where }; view! { - + - diff --git a/thaw/src/spinner/mod.rs b/thaw/src/spinner/mod.rs index c7a8171..ea1e23c 100644 --- a/thaw/src/spinner/mod.rs +++ b/thaw/src/spinner/mod.rs @@ -55,26 +55,29 @@ pub fn Spinner( view! {
- { - move || { - if let Some(label) = label.get() { - view! { - - }.into() - } else { - None + {move || { + if let Some(label) = label.get() { + view! { + } + .into() + } else { + None } - } + }}
} } diff --git a/thaw/src/switch/mod.rs b/thaw/src/switch/mod.rs index dc52834..3ecc704 100644 --- a/thaw/src/switch/mod.rs +++ b/thaw/src/switch/mod.rs @@ -5,9 +5,11 @@ use thaw_utils::{class_list, mount_style, Model}; pub fn Switch( #[prop(optional, into)] class: MaybeProp, /// Defines the controlled checked state of the Switch. - #[prop(optional, into)] checked: Model, + #[prop(optional, into)] + checked: Model, /// The Switch's label. - #[prop(optional, into)] label: MaybeProp, + #[prop(optional, into)] + label: MaybeProp, ) -> impl IntoView { mount_style("switch", include_str!("./switch.css")); @@ -30,19 +32,28 @@ pub fn Switch( on:change=on_change /> - { - move || if let Some(label) = label.get() { + {move || { + if let Some(label) = label.get() { view! { - - }.into() + + } + .into() } else { None } - } + }}
} } diff --git a/thaw/src/tab_list/mod.rs b/thaw/src/tab_list/mod.rs index 3ed89de..b0a4893 100644 --- a/thaw/src/tab_list/mod.rs +++ b/thaw/src/tab_list/mod.rs @@ -24,10 +24,7 @@ pub fn TabList( selected_value, registered_tabs, }> -
+
{children()}
diff --git a/thaw/src/tab_list/tab.rs b/thaw/src/tab_list/tab.rs index 3eba81e..767b47b 100644 --- a/thaw/src/tab_list/tab.rs +++ b/thaw/src/tab_list/tab.rs @@ -7,7 +7,8 @@ use thaw_utils::{class_list, mount_style}; pub fn Tab( #[prop(optional, into)] class: MaybeProp, /// The indentifier of the tab. - #[prop(into)] value: String, + #[prop(into)] + value: String, children: Children, ) -> impl IntoView { mount_style("tab", include_str!("./tab.css")); @@ -62,17 +63,13 @@ pub fn Tab( view! { } } diff --git a/thaw/src/table/mod.rs b/thaw/src/table/mod.rs index 92a34ba..e965f84 100644 --- a/thaw/src/table/mod.rs +++ b/thaw/src/table/mod.rs @@ -8,11 +8,7 @@ pub fn Table( ) -> impl IntoView { mount_style("table", include_str!("./table.css")); - view! { - - {children()} -
- } + view! { {children()}
} } #[component] @@ -20,11 +16,7 @@ pub fn TableHeader( #[prop(optional, into)] class: MaybeProp, children: Children, ) -> impl IntoView { - view! { - - {children()} - - } + view! { {children()} } } #[component] @@ -35,13 +27,11 @@ pub fn TableHeaderCell( view! { } @@ -52,11 +42,7 @@ pub fn TableBody( #[prop(optional, into)] class: MaybeProp, children: Children, ) -> impl IntoView { - view! { - - {children()} - - } + view! { {children()} } } #[component] @@ -64,11 +50,7 @@ pub fn TableRow( #[prop(optional, into)] class: MaybeProp, children: Children, ) -> impl IntoView { - view! { - - {children()} - - } + view! { {children()} } } #[component] @@ -77,14 +59,14 @@ pub fn TableCell( #[prop(optional)] children: Option, ) -> impl IntoView { view! { - - { - if let Some(children) = children { - Either::Left(children()) - } else { - Either::Right(()) - } - } + + {if let Some(children) = children { + Either::Left(children()) + } else { + Either::Right(()) + }} } } @@ -94,9 +76,5 @@ pub fn TableCellLayout( #[prop(optional, into)] class: MaybeProp, children: Children, ) -> impl IntoView { - view! { -
- {children()} -
- } + view! {
{children()}
} } diff --git a/thaw/src/tag/mod.rs b/thaw/src/tag/mod.rs index 41be517..f0edb14 100644 --- a/thaw/src/tag/mod.rs +++ b/thaw/src/tag/mod.rs @@ -15,10 +15,8 @@ pub fn Tag( mount_style("tag", include_str!("./tag.css")); view! { - - > {children()} {move || { @@ -30,13 +28,24 @@ pub fn Tag( on_close(event); }; if closable.get() { - Either::Left(view! { - - }) + Either::Left( + view! { + + }, + ) } else { Either::Right(()) } diff --git a/thaw/src/text/mod.rs b/thaw/src/text/mod.rs index 2cbd262..b4722a8 100644 --- a/thaw/src/text/mod.rs +++ b/thaw/src/text/mod.rs @@ -11,9 +11,7 @@ pub fn Caption1( let class = Signal::derive(move || format!("thaw-caption-1 {}", class.get().unwrap_or_default())); - view! { - - } + view! { } } #[component] @@ -27,9 +25,7 @@ pub fn Caption1Strong( format!("thaw-caption-1-strong {}", class.get().unwrap_or_default()) }); - view! { - - } + view! { } } #[component] @@ -41,9 +37,7 @@ pub fn Body1( ) -> impl IntoView { let class = Signal::derive(move || format!("thaw-body-1 {}", class.get().unwrap_or_default())); - view! { - - } + view! { } } #[component] diff --git a/thaw/src/textarea/mod.rs b/thaw/src/textarea/mod.rs index 1577c97..e992fb3 100644 --- a/thaw/src/textarea/mod.rs +++ b/thaw/src/textarea/mod.rs @@ -72,14 +72,12 @@ pub fn Textarea( // } view! { - +