[{"name":"Widget","comment":" This module contains functions for displaying data.\n\n@docs select, multiSelect, collapsable, carousel, dialog, tab\n\n","unions":[],"aliases":[],"values":[{"name":"carousel","comment":" A Carousel circles through a non empty list of contents.\n\n```\n    Widget.carousel\n        {content = (\"Blue\",[\"Yellow\", \"Green\" , \"Red\" ]|> Array.fromList)\n        ,current = model.carousel\n        , label = \\c ->\n            [ Input.button [Element.centerY]\n                { onPress = Just <|\n                     SetCarousel <|\n                        (\\x -> if x < 0 then 0 else x) <|\n                            model.carousel - 1\n                , label = \"<\" |> Element.text\n                }\n            , c |> Element.text\n            , Input.button [Element.centerY]\n                { onPress = Just <|\n                    SetCarousel <|\n                        (\\x -> if x > 3 then 3 else x) <|\n                        model.carousel + 1\n                , label = \">\" |> Element.text\n                }\n            ]\n            |> Element.row [Element.centerX, Element.width<| Element.shrink]\n        }\n```\n\n","type":"{ content : ( a, Array.Array a ), current : Basics.Int, label : a -> Element.Element msg } -> Element.Element msg"},{"name":"collapsable","comment":" Some collapsable content.\n\n```\n    Widget.collapsable\n        {onToggle = ToggleCollapsable\n        ,isCollapsed = model.isCollapsed\n        ,label = Element.row Grid.compact\n            [ Element.html <|\n                if model.isCollapsed then\n                    Heroicons.cheveronRight  [ Attributes.width 20]\n                else\n                    Heroicons.cheveronDown [ Attributes.width 20]\n            , Element.el Heading.h4 <|Element.text <| \"Title\"\n            ]\n        ,content = Element.text <| \"Hello World\"\n        }\n```\n\n","type":"{ onToggle : Basics.Bool -> msg, isCollapsed : Basics.Bool, label : Element.Element msg, content : Element.Element msg } -> Element.Element msg"},{"name":"dialog","comment":" A dialog element displaying important information.\n\n```\n    Framework.Layout\n        [ Element.inFront <|\n            if model.displayDialog then\n                Widget.dialog\n                    { onDismiss = Just <| ToggleDialog False\n                    , content =\n                        [ \"This is a dialog window\"\n                            |> Element.text\n                        , Input.button []\n                            {onPress = Just <| ToggleDialog False\n                            , label = Element.text \"Ok\"\n                            }\n                        ]\n                        |> Element.column []\n                    }\n            else Element.none\n        ] <|\n            Element.text \"some Content\"\n```\n\n","type":"{ onDismiss : Maybe.Maybe msg, content : Element.Element msg } -> Element.Element msg"},{"name":"multiSelect","comment":" Selects multible options. This can be used for checkboxes.\n","type":"{ selected : Set.Set comparable, options : List.List comparable, label : comparable -> Element.Element msg, onChange : comparable -> msg, attributes : Basics.Bool -> List.List (Element.Attribute msg) } -> List.List (Element.Element msg)"},{"name":"select","comment":" Selects one out of multiple options. This can be used for radio buttons or Menus.\n","type":"{ selected : Maybe.Maybe a, options : List.List a, label : a -> Element.Element msg, onChange : a -> msg, attributes : Basics.Bool -> List.List (Element.Attribute msg) } -> List.List (Element.Element msg)"},{"name":"tab","comment":" Displayes a list of contents in a tab\n","type":"List.List (Element.Attribute msg) -> { selected : a, options : List.List a, onChange : a -> msg, label : a -> Element.Element msg, content : a -> Element.Element msg, attributes : Basics.Bool -> List.List (Element.Attribute msg) } -> Element.Element msg"}],"binops":[]},{"name":"Widget.FilterSelect","comment":"\n\n@docs Model, Msg, init, update, viewInput, viewOptions\n\n","unions":[{"name":"Msg","comment":" The Msg is exposed by design. You can unselect by sending `Selected Nothing`.\n","args":[],"cases":[["ChangedRaw",["String.String"]],["Selected",["Maybe.Maybe String.String"]]]}],"aliases":[{"name":"Model","comment":" The Model containing the raw value, the selected value and all the possible options.\n","args":[],"type":"{ raw : String.String, selected : Maybe.Maybe String.String, options : Set.Set String.String }"}],"values":[{"name":"init","comment":" The initial state contains the set of possible options.\n","type":"Set.Set String.String -> Widget.FilterSelect.Model"},{"name":"update","comment":" Updates the Model\n","type":"Widget.FilterSelect.Msg -> Widget.FilterSelect.Model -> Widget.FilterSelect.Model"},{"name":"viewInput","comment":" A wrapper around Input.text.\n","type":"List.List (Element.Attribute msg) -> Widget.FilterSelect.Model -> { msgMapper : Widget.FilterSelect.Msg -> msg, placeholder : Maybe.Maybe (Element.Input.Placeholder msg), label : String.String } -> Element.Element msg"},{"name":"viewOptions","comment":" Returns a List of all options that matches the filter.\n","type":"Widget.FilterSelect.Model -> List.List String.String"}],"binops":[]},{"name":"Widget.ScrollingNav","comment":" The Scrolling Nav is a navigation bar thats updates while you scroll through\nthe page. Clicking on a navigation button will scroll directly to that section.\n\n\n# Basics\n\n@docs Model, Msg, init, update, subscriptions, view, viewSections\n\n\n# Operations\n\n@docs jumpTo, syncPositions\n\n","unions":[{"name":"Msg","comment":" ","args":["section"],"cases":[]}],"aliases":[{"name":"Model","comment":" ","args":["section"],"type":"{ labels : section -> String.String, positions : IntDict.IntDict String.String, arrangement : List.List section, scrollPos : Basics.Int }"}],"values":[{"name":"init","comment":" The intial state include the labels and the arrangement of the sections\n","type":"{ labels : section -> String.String, arrangement : List.List section } -> ( Widget.ScrollingNav.Model section, Platform.Cmd.Cmd (Widget.ScrollingNav.Msg section) )"},{"name":"jumpTo","comment":" scrolls the screen to the respective section\n","type":"section -> Widget.ScrollingNav.Model section -> Platform.Cmd.Cmd (Widget.ScrollingNav.Msg msg)"},{"name":"subscriptions","comment":" ","type":"Platform.Sub.Sub (Widget.ScrollingNav.Msg msg)"},{"name":"syncPositions","comment":" ","type":"Widget.ScrollingNav.Model section -> Platform.Cmd.Cmd (Widget.ScrollingNav.Msg section)"},{"name":"update","comment":" ","type":"Widget.ScrollingNav.Msg section -> Widget.ScrollingNav.Model section -> ( Widget.ScrollingNav.Model section, Platform.Cmd.Cmd (Widget.ScrollingNav.Msg section) )"},{"name":"view","comment":" ","type":"(section -> Element.Element msg) -> Widget.ScrollingNav.Model section -> Element.Element msg"},{"name":"viewSections","comment":" ","type":"{ label : String.String -> Element.Element msg, fromString : String.String -> Maybe.Maybe section, msgMapper : Widget.ScrollingNav.Msg section -> msg, attributes : Basics.Bool -> List.List (Element.Attribute msg) } -> Widget.ScrollingNav.Model section -> { selected : Maybe.Maybe section, options : List.List section, label : section -> Element.Element msg, onChange : section -> msg, attributes : Basics.Bool -> List.List (Element.Attribute msg) }"}],"binops":[]},{"name":"Widget.Snackbar","comment":" A [snackbar](https://material.io/components/snackbars/) shows notification, one at a time.\n\n\n# Basics\n\n@docs Model, init, current, timePassed\n\n\n# Operations\n\n@docs insert, insertFor, dismiss\n\n","unions":[],"aliases":[{"name":"Model","comment":" A snackbar has a queue of Notifications, each with the amount of ms the message should be displayed\n","args":["a"],"type":"{ queue : Queue.Queue ( a, Basics.Int ), current : Maybe.Maybe ( a, Basics.Int ) }"}],"values":[{"name":"current","comment":" Returns the current element.\n","type":"Widget.Snackbar.Model a -> Maybe.Maybe a"},{"name":"dismiss","comment":" Dismiss the current message.\n","type":"Widget.Snackbar.Model a -> Widget.Snackbar.Model a"},{"name":"init","comment":" Inital state\n","type":"Widget.Snackbar.Model a"},{"name":"insert","comment":" Insert a message that will last for 10 seconds.\n","type":"a -> Widget.Snackbar.Model a -> Widget.Snackbar.Model a"},{"name":"insertFor","comment":" Insert a message for a specific amount of milli seconds.\n","type":"Basics.Int -> a -> Widget.Snackbar.Model a -> Widget.Snackbar.Model a"},{"name":"timePassed","comment":" Updates the model. This functions should be called regularly.\nThe first argument is the milli seconds that passed since the last time the function was called.\n","type":"Basics.Int -> Widget.Snackbar.Model a -> Widget.Snackbar.Model a"}],"binops":[]},{"name":"Widget.SortTable","comment":" A Sortable list allows you to sort coulmn.\n\n```\n    SortTable.view\n        { content =\n            [ {id = 1, name = \"Antonio\", rating = 2.456}\n            , {id = 2, name = \"Ana\", rating = 1.34}\n            , {id = 3, name = \"Alfred\", rating = 4.22}\n            , {id = 4, name = \"Thomas\", rating = 3 }\n            ]\n        , columns =\n            [ SortTable.intColumn\n                { title = \"Id\"\n                , value = .id\n                , toString = \\int -> \"#\" ++ String.fromInt int\n                }\n            , SortTable.stringColumn\n                { title = \"Name\"\n                , value = .name\n                , toString = identity\n                }\n            , SortTable.floatColumn\n                { title = \"rating\"\n                , value = .rating\n                , toString = String.fromFloat\n                }\n            ]\n        , model = model\n        }\n        |> (\\{data,columns} ->\n            {data = data\n            ,columns = columns\n                |> List.map (\\config->\n                        { header =\n                            Input.button [Font.bold]\n                                { onPress =\n                                    { title = config.header\n                                    , asc =\n                                        if config.header == model.title then\n                                            not model.asc\n                                        else\n                                            True\n                                    }\n                                        |> SortBy\n                                        |> Just\n                                , label =\n                                    if config.header == model.title then\n                                        [ config.header |> Element.text\n                                        , Element.text <|\n                                            if model.asc then\n                                                \"/\\\"\n                                            else\n                                                \"\\/\"\n                                        ]\n                                            |> Element.row [Font.bold]\n                                    else\n                                        config.header  |> Element.text\n                                }\n                        , view = config.view >> Element.text\n                        , width = Element.fill\n                        }\n                    )\n            })\n        |> Element.table []\n```\n\n\n# Basics\n\n@docs Model, init, view, sortBy\n\n\n# Columns\n\n@docs intColumn, floatColumn, stringColumn\n\n","unions":[],"aliases":[{"name":"Model","comment":" The Model contains the sorting column name and if ascending or descending.\n","args":[],"type":"{ title : String.String, asc : Basics.Bool }"}],"values":[{"name":"floatColumn","comment":" A Column containing a Float\n","type":"{ title : String.String, value : a -> Basics.Float, toString : Basics.Float -> String.String } -> Widget.SortTable.Column a"},{"name":"init","comment":" The initial State setting the sorting column name to the empty string.\n","type":"Widget.SortTable.Model"},{"name":"intColumn","comment":" A Column containing a Int\n","type":"{ title : String.String, value : a -> Basics.Int, toString : Basics.Int -> String.String } -> Widget.SortTable.Column a"},{"name":"sortBy","comment":" Change the sorting criteras.\n\n```\n    sortBy =\n        identity\n```\n\n","type":"{ title : String.String, asc : Basics.Bool } -> Widget.SortTable.Model"},{"name":"stringColumn","comment":" A Column containing a String\n","type":"{ title : String.String, value : a -> String.String, toString : String.String -> String.String } -> Widget.SortTable.Column a"},{"name":"view","comment":" The View\n","type":"{ content : List.List a, columns : List.List (Widget.SortTable.Column a), model : Widget.SortTable.Model } -> { data : List.List a, columns : List.List { header : String.String, view : a -> String.String } }"}],"binops":[]},{"name":"Widget.ValidatedInput","comment":" The validated Input is a wrapper around `Input.text`.\nThey can validate the input and return an error if nessarry.\n\n\n# Basics\n\n@docs Model, Msg, init, update, view\n\n\n# Access the Model\n\n@docs getError, getRaw, getValue\n\n","unions":[{"name":"Model","comment":" ","args":["err","a"],"cases":[]},{"name":"Msg","comment":" ","args":[],"cases":[]}],"aliases":[],"values":[{"name":"getError","comment":" returns the error (if one exists)\n","type":"Widget.ValidatedInput.Model err a -> Maybe.Maybe err"},{"name":"getRaw","comment":" returns the raw value (the value that the user currently sees)\n","type":"Widget.ValidatedInput.Model err a -> String.String"},{"name":"getValue","comment":" returns the value (the value that has been last successfully validated)\n","type":"Widget.ValidatedInput.Model err a -> a"},{"name":"init","comment":" The initial state contains\n\n  - `value`: starting value\n  - `validator`: a vaidation function (a decoder)\n  - `toString`: a function that returns a string representation\n\n","type":"{ value : a, validator : String.String -> Result.Result err a, toString : a -> String.String } -> Widget.ValidatedInput.Model err a"},{"name":"update","comment":" ","type":"Widget.ValidatedInput.Msg -> Widget.ValidatedInput.Model err a -> Widget.ValidatedInput.Model err a"},{"name":"view","comment":" the view function, the parameters include\n\n  - `msgMapper`: A function wrapping the `Msg` into a `msg`\n  - `placeholder`: See Element.text for more information\n  - `label`: The (hidden) label of the input (needed for screen readers)\n  - `readOnly`: a representation of the validated value\n    (clicking on the element will turn on edit mode)\n\n","type":"List.List (Element.Attribute msg) -> Widget.ValidatedInput.Model err a -> { msgMapper : Widget.ValidatedInput.Msg -> msg, placeholder : Maybe.Maybe (Element.Input.Placeholder msg), label : String.String, readOnly : a -> Element.Element msg } -> Element.Element msg"}],"binops":[]}]