Module

FPO.Components.TableHead

Generic table head component.

#Order

data Order

Constructors

#Output

data Output

Output type for the component, which emits the clicked column title and its sorting state.

Constructors

#SortingStyle

data SortingStyle

Constructors

#Title

type Title = String

#component

component :: forall query m. Component query Input Output m

#createTableColumns

createTableColumns :: Array { style :: Maybe SortingStyle, title :: Title } -> Array Column

Creates the initial columns for the table head, with all columns set to ascending order by default.

#sortByF

sortByF :: forall a. Order -> (a -> a -> Ordering) -> Array a -> Array a

Sorts arrays based on the provided sorting order and sorting function.

#toggleSorting

toggleSorting :: Order -> Order

Switches the sorting direction.

Modules