georgesboris/elm-widgets-alpha/3.4.0

NOTE: the latest version is 4.18.3

W.Table

view : List (Attribute msg a) -> List (Column msg a) -> List a -> Html msg
type alias Attribute msg a =
Attr (Attributes msg a)

Columns

List (ColumnAttribute msg a)
-> { label : String
, content : a -> Html msg
}
-> Column msg a
List (ColumnAttribute msg a)
-> { label : String
, value : a -> String
}
-> Column msg a
int :
List (ColumnAttribute msg a)
-> { label : String
, value : a -> Int
}
-> Column msg a
List (ColumnAttribute msg a)
-> { label : String
, value : a -> Float
}
-> Column msg a
List (ColumnAttribute msg a)
-> { label : String
, value : a -> Bool
}
-> Column msg a
type Column msg a
type alias ColumnAttribute msg a =
Attr (ColumnAttributes 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 : Int -> ColumnAttribute msg a
relativeWidth : Float -> ColumnAttribute msg a
largeScreenOnly : 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
(( String, a, List a ) -> ( String, a, List a ) -> Order)
-> Attribute msg a
groupCollapsed : (a -> String -> 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 -> Bool) -> Attribute msg a
maxHeight : Float -> Attribute msg a

Max height in "rem".