carboncloud/ui-library/4.1.0

NOTE: the latest version is 9.1.0

Ui.MillerColumns

This module defines a component of a miller column layout

type alias Model v =
{ treeZipper : Zipper ( ListItemId, v )
, state : State v
}

Model of the component

treeZipper the data displayed in the miller columns. The zipper has a single focus at any time. state internal state of the component. - If the state is in Focus it will show the zipper in miller columns - If the state is in Search it will list all the values that contains the searched value

type alias Content a =
{ leftAlignedText : a -> String
, mRightAlignedText : Maybe (a -> String)
}

The content of each list item

leftAlignedText Takes a value of a and gives back a String that is shown to the left of each list item

mRightAlignedText Takes a value of a and gives back a String that is shown to the right of each list item

type Msg

Internal messages to update the state of the component

init : Tree ( String, v ) -> Model v

Initializes a model given a Tree of a

setFocus : Model v -> Model v

Focus on the zipper tree

setSearch : String -> (v -> String) -> Model v -> Model v

Display the search results of the values in the zipper searchValue the value we are searching for in the tree structure searchOn given a value in the tree it returns the string we want to search on with the searchValue

view : { liftMsg : Msg -> msg } -> Model v -> Content v -> Html msg

View the Miller Columns

update : Msg -> Model v -> ( Model v, Cmd Msg )

Update the model of the Miller Columns