primait / pyxis-components / Prima.Pyxis.Table

Configuration


type Config msg

Represent the static configuration of the component.


type State

Represent the basic state of the component.


type Header msg

Represent an Header of the table. It's gonna be rendered as a tag.


type Row msg

Represent a Row which contains a list of Columns.


type Column msg

Represent a Column which can manage a specific kind of data.


type alias ColSpan =
Basics.Int

Represent the colSpan of a column. Alias for Integer.


type Sort
    = Asc
    | Desc

Represents the sort algorithm

Configuration Methods

base : Basics.Bool -> (State -> msg) -> Config msg

Creates a Table with the Base skin.

light : Basics.Bool -> (State -> msg) -> Config msg

Creates a Table with the Light skin.

init : Maybe Sort -> Maybe String -> State

Create an initial State defined by Sort and Column.

header : Slug -> List (Html msg) -> Header msg

Create the Header.

myHeader : String -> String -> Table.Header
myHeader slug content =
    Table.header slug content

row : List (Column msg) -> Row msg

Create a Row

myRow : List Column -> Table.Row
myRow columns =
    Table.row columns

columnFloat : ColSpan -> Basics.Float -> Column msg

Create a Column which content is Float primitive.

columnHtml : ColSpan -> List (Html msg) -> Column msg

Create a Column which content is Html, that can be sorted using compareFunction.

columnInteger : ColSpan -> Basics.Int -> Column msg

Create a Column which content is Integer primitive.

columnString : ColSpan -> String -> Column msg

Create a Column which content is String primitive.

addHeaders : List (Header msg) -> Config msg -> Config msg

Sets the header columns of the table.

addRows : List (Row msg) -> Config msg -> Config msg

Sets the content of the rows of the table.

addFooters : List (Row msg) -> Config msg -> Config msg

Sets the footer columns of the table.

Rendering

render : State -> Config msg -> Html msg

Renders a Table by receiving a State and a Config

Options

withAlternateRows : Basics.Bool -> Config msg -> Config msg

Sets the alternate rows option for the Table component to Config.

withClass : String -> Config msg -> Config msg

Adds a class for the

tag to the Config

withClassList : List ( String, Basics.Bool ) -> Config msg -> Config msg

Adds an entry to the classList of the

tag.

withComparableHtml : (List (Html msg) -> String) -> Config msg -> Config msg

Sets the function to convert HTML content to string to be compared in sorting.

withElementClass : String -> Config msg -> Config msg

Adds a class for the

tag to the Config.

withHeaderClass : String -> Config msg -> Config msg

Adds a class for the

tag to the Config.

withId : String -> Config msg -> Config msg

Adds an id for the

tags to the Config.

withFooterClass : String -> Config msg -> Config msg

Adds a class for the

tag to the Config.

withSort : Slug -> Sort -> State -> State

Sets the sorting algorithm for a specific column.