leptos_struct_table/components/
mod.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
mod cell;
mod renderer_fn;
mod row;
mod table_content;
mod tbody;
mod thead;

pub use cell::*;
pub use row::*;
pub use table_content::*;
pub use tbody::*;
pub use thead::*;

#[macro_export]
macro_rules! wrapper_render_fn {
    (
        #[$doc_name:meta]
        $name:ident,
        $tag:ident,
        $(#[$additional_doc:meta])*
    ) => {
        /// Default
        #[$doc_name]
        /// renderer. Please note that this is **NOT** a `#[component]`.
        ///
        /// # Arguments
        ///
        /// * `content` - The content of the renderer. It's like the children of this view.
        /// * `class` - The class attribute that is passed to the root element
        $(#[$additional_doc])*
        #[allow(non_snake_case)]
        pub fn $name(content: AnyView, class: Signal<String>) -> impl IntoView {
            view! {
                <$tag class=class>
                    {content}
                </$tag>
            }
        }
    };
}