Trait leptos_struct_table::TableClassesProvider

source ·
pub trait TableClassesProvider {
    // Required method
    fn new() -> Self;

    // Provided methods
    fn thead(&self, prop_class: &str) -> String { ... }
    fn thead_row(&self, prop_class: &str) -> String { ... }
    fn thead_cell(&self, sort: ColumnSort, macro_class: &str) -> String { ... }
    fn thead_cell_inner(&self) -> String { ... }
    fn tbody(&self, prop_class: &str) -> String { ... }
    fn row(&self, row_index: usize, selected: bool, prop_class: &str) -> String { ... }
    fn loading_cell(
        &self,
        row_index: usize,
        col_index: usize,
        prop_class: &str,
    ) -> String { ... }
    fn loading_cell_inner(
        &self,
        row_index: usize,
        col_index: usize,
        prop_class: &str,
    ) -> String { ... }
    fn cell(&self, macro_class: &str) -> String { ... }
}
Expand description

A trait for providing classes for the table.

Required Methods§

source

fn new() -> Self

Create a new instance of the class provider.

Provided Methods§

source

fn thead(&self, prop_class: &str) -> String

Get the class attribute for the thead. The prop_class parameter contains the classes specified in the thead_class prop of the [TableContent] component.

source

fn thead_row(&self, prop_class: &str) -> String

Get the classes for the thead row. The prop_class parameter contains the classes specified in the thead_row_class prop of the [TableContent] component.

source

fn thead_cell(&self, sort: ColumnSort, macro_class: &str) -> String

Get the classes for the thead cells. The sort parameter contains the sort state of the column. The macro_class parameter contains the classes specified in the head_class macro attribute of the field.

source

fn thead_cell_inner(&self) -> String

Get the classes for the thead cells’ inner element.

source

fn tbody(&self, prop_class: &str) -> String

Get the classes for the tbody. The prop_class parameter contains the classes specified in the tbody_class prop of the [TableContent] component.

source

fn row(&self, row_index: usize, selected: bool, prop_class: &str) -> String

Get the classes for the body rows. The row_index parameter contains the index of the row. The first row has index 0. The selected parameter indicates whether the row is selected. The prop_class parameter contains the classes specified in the row_class prop of the [TableContent] component.

source

fn loading_cell( &self, row_index: usize, col_index: usize, prop_class: &str, ) -> String

Get the classes for the elements inside of the cells of rows that are currently being loaded. The prop_class parameter contains the classes specified in the loading_cell_class prop of the [TableContent] component.

source

fn loading_cell_inner( &self, row_index: usize, col_index: usize, prop_class: &str, ) -> String

Get the classes for the elements inside of the cells of rows that are currently being loaded. Usually this will be some loading indicator like a sceleton bar. The prop_class parameter contains the classes specified in the loading_cell_inner_class prop of the [TableContent] component.

source

fn cell(&self, macro_class: &str) -> String

Get the classes for the body cells. The macro_class parameter contains the classes specified in the class macro attribute of the field.

Object Safety§

This trait is not object safe.

Implementors§