xdelph/elm-slick-grid/1.1.0

Grid.Filters

Helper functions for filtering the grid content

Data type

type alias Item a =
{ a | selected : Bool, index : Int }

The data to be displayed in the grid It must be records with at least two fields: selected et index

items =
    [ { index = 0
      , name = "item0"
      , selected = False
      }
    , { index = 1
      , name = "item1"
      , selected = False
      }
    ]

Helpers

boolFilter : (Item a -> Bool) -> TypedFilter a Bool

Filters booleans. The lambda function to be provided as a parameter returns the value of the field to be filtered.

filters =
    BoolFilter <| boolFilter (\item -> item.even)
floatFilter : (Item a -> Float) -> TypedFilter a Float

Filters floating point numbers. The lambda function to be provided as a parameter returns the value of the field to be filtered.

filters =
    FloatFilter <| floatFilter (\item -> item.value)
intFilter : (Item a -> Int) -> TypedFilter a Int

Filters integers. The lambda function to be provided as a parameter returns the value of the field to be filtered.

filters =
    IntFilter <| intFilter (\\item -> item.id)
stringFilter : (Item a -> String) -> TypedFilter a String

Filters strings. The lambda function to be provided as a parameter returns the value of the field to be filtered.

filters =
    StringFilter <| stringFilter (\item -> item.name)

Others

It seems that Filter(..) does not have any docs. The module's documentation names it in an @docs line, but the package does not expose it.
parseFilteringString : Maybe String -> Filter a -> Maybe (Item a -> Bool)

TODO some docs