primait/pyxis-components/9.0.0

NOTE: the latest version is 9.0.3

Prima.Pyxis.Table

Configuration

type Config msg

Represent the static configuration of the component.

type State

Represent the basic state of the component.

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 =
Int

Represent the colSpan of a column. Alias for Integer.

type Sort
= Asc
| Desc

Represents the sort algorithm

Configuration Methods

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

Creates a Table with the Base skin.

light : 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.

row : List (Column msg) -> Row msg

Create a Row

myRow : List Column -> Table.Row
myRow columns =
    Table.row columns
columnFloat : ColSpan -> 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 -> 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 : 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 <table> tag to the Config

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

Adds an entry to the classList of the <table> 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 <td> tags to the Config.

withFooterClass : String -> Config msg -> Config msg

Adds a class for the <tfoot> tag to the Config.

withHeaderClass : String -> Config msg -> Config msg

Adds a class for the <thead> tag to the Config.

withId : String -> Config msg -> Config msg

Adds an id for the <table> tag to the Config.

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

Sets the sorting algorithm for a specific column.