QiTASC / hatchinq / Hatchinq.DataTable

Exposed


type alias Config item msg =
{ theme : Hatchinq.Theme.Theme
, lift : Message item msg -> msg 
}


type alias InfiniteView msg =
{ loadingTop : Maybe Basics.Int
, loadingBottom : Maybe Basics.Int
, loadExtraItems : LoadingDirection -> Maybe { loadCount : Basics.Int
, excessCount : Basics.Int
, loadMsg : msg } 
}


type LoadingDirection
    = Up
    | Down


type Message item msg


type alias State item =
{ hoveredHeader : Maybe Basics.Int
, sort : Sort item
, scrollPos : ScrollPos
, firstVisible : Maybe Basics.Int
, lastVisible : Maybe Basics.Int
, rowHeights : Dict String Basics.Int
, selectedItem : Maybe item
, hoveredItem : Maybe item 
}


type alias View item msg =
{ columns : List (Column item msg)
, items : List item
, state : State item 
}

column : Element msg -> Element.Length -> (Basics.Int -> item -> Element msg) -> Column item msg

configure : Config item msg -> List (Hatchinq.Attribute.Attribute (InternalConfig item msg)) -> View item msg -> Element msg

expansion : (item -> Basics.Bool) -> (item -> Basics.Bool -> msg) -> (item -> Element msg) -> Hatchinq.Attribute.Attribute (InternalConfig item msg)

infinite : InfiniteView msg -> Hatchinq.Attribute.Attribute (InternalConfig item msg)

init : State item

lightenOrDarkenOnHover : Basics.Float -> Hatchinq.Attribute.Attribute (InternalConfig item msg)

nonScrollable : Hatchinq.Attribute.Attribute (InternalConfig item msg)

plain : Hatchinq.Attribute.Attribute (InternalConfig item msg)

rowColor : (item -> Maybe Element.Color) -> Hatchinq.Attribute.Attribute (InternalConfig item msg)

selection : (item -> Basics.Bool) -> (item -> Basics.Bool -> msg) -> (Basics.Bool -> msg) -> Hatchinq.Attribute.Attribute (InternalConfig item msg)

sortableColumn : Element msg -> Element.Length -> (Basics.Int -> item -> Element msg) -> (List item -> List item) -> Column item msg

externalSortableColumn : Element msg -> Element.Length -> (Basics.Int -> item -> Element msg) -> (Basics.Int -> Maybe Basics.Bool -> msg) -> Column item msg

update : Message item msg -> State item -> ( State item, Platform.Cmd.Cmd msg )

calculateRowHeight : Basics.Int -> String -> Platform.Cmd.Cmd (Message item msg)

Use this to inform the table that the height of a row has changed

onClick : (item -> msg) -> Hatchinq.Attribute.Attribute (InternalConfig item msg)

selectable : Hatchinq.Attribute.Attribute (InternalConfig item msg)

onMouseEnter : (item -> msg) -> Hatchinq.Attribute.Attribute (InternalConfig item msg)

onMouseExit : (item -> msg) -> Hatchinq.Attribute.Attribute (InternalConfig item msg)