carboncloud / ui-library / Ui.MillerColumns

This module defines a component of a miller column layout


type alias Config msg a =
{ liftMsg : Msg -> msg
, nodeContent : a -> Content 
}

liftMsg "lifts" the internal messages of the component to the parent nodeContent returns some Content base on a


type alias Model v =
{ treeZipper : Tree.Zipper.Zipper ( NodeId
, 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.


type alias Content =
{ leftAlignedText : String
, mTooltip : Maybe String
, mRightAlignedText : Maybe 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 : List (Tree ( NodeId, v )) -> 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 : Config msg v -> Model v -> Html.Styled.Html msg

View the Miller Columns liftMsg lifts the MillerColumns message to another msg type Model v the model of the MillerColumns component

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

Update the model of the Miller Columns


type NodeId

The id of a node in the tree

unwrapNodeId : NodeId -> String

Get the value of a NodeId

root : Model v -> ( NodeId, v )

Get the value of the root

focus : Model v -> ( NodeId, v )

Get the value of the current focus

select : String -> Model v -> Model v

Select the node with the given nodeId