uncover-co / elm-widgets / W.Table

view : List (Attribute msg a) -> List (Column msg a) -> List a -> Html msg

Columns

column : List (ColumnAttribute msg a) -> { label : String, content : a -> Html msg } -> Column msg a

string : List (ColumnAttribute msg a) -> { label : String, value : a -> String } -> Column msg a

int : List (ColumnAttribute msg a) -> { label : String, value : a -> Basics.Int } -> Column msg a

float : List (ColumnAttribute msg a) -> { label : String, value : a -> Basics.Float } -> Column msg a

bool : List (ColumnAttribute msg a) -> { label : String, value : a -> Basics.Bool } -> Column msg a


type Column msg a

Column Attributes

customLabel : List (Html msg) -> ColumnAttribute msg a

labelClass : String -> ColumnAttribute msg a

Pass in extra classes for a column label. This can be useful for when you want to conditionally hide sorting icons unless the user is hovering a table header.

An example using tailwindcss:

W.Table.string
    [ W.Table.labelClass "group"
    , W.Table.labelRight
        [ div
            [ class "opacity-0 group-hover:opacity-100" ]
            [ .. ]
        ]
    ]
    { .. }

labelLeft : List (Html msg) -> ColumnAttribute msg a

labelRight : List (Html msg) -> ColumnAttribute msg a

alignRight : ColumnAttribute msg a

alignCenter : ColumnAttribute msg a

width : Basics.Int -> ColumnAttribute msg a

relativeWidth : Basics.Float -> ColumnAttribute msg a

largeScreenOnly : ColumnAttribute msg a

columnHtmlAttrs : List (Html.Attribute msg) -> ColumnAttribute msg a


type ColumnAttribute msg a

Actions

onClick : (a -> msg) -> Attribute msg a

onMouseEnter : (a -> msg) -> Attribute msg a

onMouseLeave : msg -> Attribute msg a

Groups

groupBy : (a -> String) -> Attribute msg a

groupValue : (String -> List a -> Html msg) -> ColumnAttribute msg a

groupValueCustom : (a -> List a -> Html msg) -> ColumnAttribute msg a

groupSortBy : (a -> String -> comparable) -> Attribute msg a

groupSortByDesc : (a -> String -> comparable) -> Attribute msg a

groupSortWith : (( String, a, List a ) -> ( String, a, List a ) -> Basics.Order) -> Attribute msg a

groupCollapsed : (a -> String -> Basics.Bool) -> Attribute msg a

groupLabel : ColumnAttribute msg a

onGroupClick : (a -> msg) -> Attribute msg a

onGroupMouseEnter : (a -> msg) -> Attribute msg a

onGroupMouseLeave : msg -> Attribute msg a

Table Attributes

noHeader : Attribute msg a

highlight : (a -> Basics.Bool) -> Attribute msg a

Html

htmlAttrs : List (Html.Attribute msg) -> Attribute msg a

noAttr : Attribute msg a


type Attribute msg a