leptos-struct-table 0.18.0

Generate a complete batteries included leptos data table component from a struct definition.
Documentation
#![allow(unused_variables)]

use crate::CellValue;
use std::marker::PhantomData;

use leptos::prelude::*;

/// The default cell renderer. Uses the `<td>` element.
#[component]
pub fn DefaultTableCellRenderer<Row, Column, T, M>(
    /// The class attribute for the cell element. Generated by the classes provider.
    class: String,
    /// The value to display.
    value: Signal<T>,
    /// Event handler called when the cell is changed. In this default renderer this will never happen.
    row: RwSignal<Row>,
    /// The index of the column.
    index: Column,
    options: T::RenderOptions,
    #[prop(optional)] _marker: PhantomData<M>,
) -> impl IntoView
where
    Row: Send + Sync + 'static,
    T: CellValue<M> + Send + Sync + Clone + 'static,
    M: 'static,
{
    view! {
        <td class=class>{move || value.get().render_value(options.clone())}</td>
    }
}