georgesboris/elm-widgets-alpha/4.18.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
groupLabel : ColumnAttribute msg a
alignRight : ColumnAttribute msg a
alignCenter : ColumnAttribute msg a
colBorders : ColumnAttribute msg a
width : Int -> ColumnAttribute msg a
relativeWidth : Float -> ColumnAttribute msg a
minWidth : Int -> ColumnAttribute msg a
colGroupAlignTop : ColumnAttribute msg a
colGroupAlignBottom : ColumnAttribute msg a
colHeaderAlignTop : ColumnAttribute msg a
colHeaderAlignBottom : ColumnAttribute msg a
mediumContainerOnly : ColumnAttribute msg a
largeContainerOnly : ColumnAttribute msg a
largeScreenOnly : ColumnAttribute msg a

@deprecated

Please use largeContainerOnly.

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
groupAlignTop : Attribute msg a
groupAlignBottom : Attribute msg a
groupIndent : Attribute msg a
groupIndentCustom : (a -> Html msg) -> Attribute msg a
groupIndentWidth : Float -> Attribute msg a
onGroupClick : (a -> msg) -> Attribute msg a
onGroupMouseEnter : (a -> msg) -> Attribute msg a
onGroupMouseLeave : msg -> Attribute msg a

Table Attributes

highlight : (a -> Bool) -> Attribute msg a
maxHeight : Float -> Attribute msg a

Max height in "rem".

noHeader : Attribute msg a
labelBaseClass : String -> Attribute msg a
headerAlignTop : Attribute msg a
headerAlignBottom : Attribute msg a
subtle : Attribute msg a
card : Attribute msg a
borders : Attribute msg a
striped : Attribute msg a
noDividers : Attribute msg a
noHeaderBackground : Attribute msg a
extraHeader : List (Html msg) -> Attribute msg a
extraHeaderNoPadding : Attribute msg a
extraHeaderNoDivider : Attribute msg a
rowDetails : (a -> Maybe (List (Html msg))) -> Attribute msg a
rowDetailsNoPadding : Attribute msg a
xPadding : Spacing -> Attribute msg a
yPadding : Spacing -> Attribute msg a
yHeaderPadding : Spacing -> Attribute msg a
yFooterPadding : Spacing -> Attribute msg a
yGroupPadding : Spacing -> Attribute msg a
topGroupPadding : Spacing -> Attribute msg a
id : String -> Attribute msg a
keyed : (a -> String) -> Attribute msg a