leonardanyer/elm-combox/1.0.0

Renamed to AR3ON/elm-combox. It is published under that name, and new versions come out there.

Versions published as leonardanyer/elm-combox still install under that name. 1 version of 1 come from the new location (see their notes).

Rerouted (renamed, verified). The GitHub user or repository was renamed. The tag is still there, at the new name. The Lamdera package server serves a copy recovered from https://github.com/AR3ON/elm-combox.

What we checked: The repo moved to github.com/AR3ON/elm-combox. Rebuilt with git archive from commit fbbbdb2b6353 of https://github.com/AR3ON/elm-combox (zip prefix leonardanyer-elm-combox-fbbbdb2/, America/Los_Angeles times): the zip is byte-identical to the one package.elm-lang.org recorded, SHA-1 1d22f4f6c43a8e9625e51b4571a1eba8b38235d5.

The Lamdera compiler uses this copy and prints a one-line notice saying so. elm itself fails to download this version.

Details · package.elm-lang.org's zip: https://github.com/leonardanyer/elm-combox/zipball/1.0.0/

Combox

This is a custom dropdown based on elm-selectize.

type alias Model =
    { language : Combox.Model }


init : ( Model, Cmd Msg )
init =
    ( { language = Accordion.empty }, Cmd.none )


type Msg
    = ComboxMsg String Combox.Msg


update : Msg -> Model -> ( Model, Cmd Msg )
update msg model =
    case msg of
        ComboxMsg selectizeMsg ->
            let
                ( language, cmd ) =
                    Combox.update msg model.combox
            in
            ( { model | language = language }, Cmd.map ComboxMsg cmd )


view : Model -> Html Msg
view model =
    Html.div []
        [ Html.h3 [] [ Html.text "Dropdown Menus" ]
        , Combox.config ComboxMsg
            |> Combox.clear False
            |> Combox.view model.language
        ]
type alias Model =
{ name : String
, selection : Maybe String
, menu : State String
}

Define the dropdown identifier and basic elm-selectize model

type Msg
= MenuMsg (Msg String)
| Select (Maybe String)

The custom dropdown menu produces these messages.

config : (Msg -> msg) -> Config msg

Create an initial configuration by calling the config function

  • The title function defines the title that goes in the header
  • The placeholder function defines the placeholder of selector
  • The clear function defines if the delete selection icon appears
  • The options function defines the attributes html option list
  • The disabled function defines if the selector is disabled or not
view : Model -> Config msg -> Html msg

Create the view configuration, for example

view : Model -> Html Msg
view model =
    Html.div []
        [ Html.h3 [] [ Html.text "Dropdown Menus" ]
        , Combox.config ComboxMsg
            |> Combox.view model.language
        ]
update : Msg -> Model -> ( Model, Cmd Msg )

Update the status of the drop-down menu.

initial : String -> Maybe String -> List String -> Model

Initialize model with data

empty : Model

Initialize empty model

title : String -> Config msg -> Config msg

change the current settings of the title

placeholder : String -> Config msg -> Config msg

change the current settings of the placeholder

clear : Bool -> Config msg -> Config msg

change the current settings of clear

options : List (Attribute Msg) -> Config msg -> Config msg

Change the current settings of the options

disabled : Bool -> Config msg -> Config msg

change the current settings of disabled