NoRedInk/noredink-ui/9.5.1

NOTE: the latest version is 35.9.3

Unavailable. Nobody can download this version any more, with elm or with the Lamdera compiler: Software Heritage not asked yet (this run's --swh-calls were used up); no fork with tag 9.5.1 found (15 same-name repos checked); no cached copy. Use another version.

Details

Nri.Ui.SortableTable.V2

type Column id entry msg
type alias Config id entry msg =
{ updateMsg : State id -> msg
, columns : List (Column id entry msg)
}
type alias Sorter a =
SortDirection -> a -> a -> Order
type alias State id =
{ column : id
, sortDirection : SortDirection
}
init : id -> State id
initDescending : id -> State id
{ id : id
, header : Html msg
, view : entry -> Html msg
, sorter : Sorter entry
, width : Int
, cellStyles : entry -> List Style
}
-> Column id entry msg
{ id : id
, header : String
, value : entry -> String
, width : Int
, cellStyles : entry -> List Style
}
-> Column id entry msg
view : Config id entry msg -> State id -> List entry -> Html msg
viewLoading : Config id entry msg -> State id -> Html msg
invariantSort : (entry -> comparable) -> Sorter entry

Create a sorter function that always orders the entries in the same order. For example, this is useful when we want to resolve ties and sort the tied entries by name, no matter of the sort direction set on the table.

simpleSort : (entry -> comparable) -> Sorter entry

Create a simple sorter function that orders entries by mapping a function over the collection. It will also reverse it when the sort direction is descending.

combineSorters : List (Sorter entry) -> Sorter entry