matken11235/html-styled-extra/1.0.0

NOTE: the latest version is 1.0.2

Renamed to ken-matsui/html-styled-extra. It is published under that name, and new versions come out there.

Versions published as matken11235/html-styled-extra still install under that name. 2 versions of 3 come from the new location (see their notes). 1 version could not be recovered and cannot be installed.

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/ken-matsui/html-styled-extra.

What we checked: The repo moved to github.com/ken-matsui/html-styled-extra. Rebuilt with git archive from commit 24da6cf8c6a2 of https://github.com/ken-matsui/html-styled-extra (zip prefix matken11235-html-styled-extra-24da6cf/, America/Los_Angeles times): the zip is byte-identical to the one package.elm-lang.org recorded, SHA-1 c591713a5f08be2e49c9056829d292eef6b4953e.

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/matken11235/html-styled-extra/zipball/1.0.0/

Html.Styled.Events.Extra

Additional decoders for use with event handlers in html.

Event decoders

  • TODO: key

  • TODO: code

  • TODO: KeyEvent, keyEvent

charCode : Decoder (Maybe Char)

Character code for key board events. This is being deprecated, but support for DOM3 Keyboard events is not yet present in most browsers.

Typed event decoders

targetValueFloat : Decoder Float

Floating-point target value.

targetValueInt : Decoder Int

Integer target value.

targetValueMaybe : Decoder (Maybe String)

String or empty target value.

targetValueMaybeFloat : Decoder (Maybe Float)

Floating-point or empty target value.

targetValueMaybeInt : Decoder (Maybe Int)

Integer or empty target value.

targetValueFloatParse : Decoder Float

Parse a floating-point value from the input instead of using valueAsNumber. Use this with inputs that do not have a number type.

targetValueIntParse : Decoder Int

Parse an integer value from the input instead of using valueAsNumber. Use this with inputs that do not have a number type.

targetValueMaybeFloatParse : Decoder (Maybe Float)

Parse an optional floating-point value from the input instead of using valueAsNumber. Use this with inputs that do not have a number type.

targetValueMaybeIntParse : Decoder (Maybe Int)

Parse an optional integer value from the input instead of using valueAsNumber. Use this with inputs that do not have a number type.

targetSelectedIndex : Decoder (Maybe Int)

Parse the index of the selected option of a select. Returns Nothing in place of the spec's magic value -1.

targetSelectedOptions : Decoder (List String)

Parse event.target.selectedOptions and return option values.

Event Handlers

onClickPreventDefault : msg -> Attribute msg

Always send msg upon click, preventing the browser's default behavior.

onClickStopPropagation : msg -> Attribute msg

Always send msg upon click, preventing click propagation.

Always send msg upon click, preventing the browser's default behavior and propagation

onEnter : msg -> Attribute msg

When the enter key is released, send the msg. Otherwise, do nothing.

onChange : (String -> msg) -> Attribute msg

An HTML Event attribute that passes the event.target.value to a msg constructor when an input, select, or textarea element has changed.

onMultiSelect : (List String -> msg) -> Attribute msg

Detect change events on multi-choice select elements.

It will grab the string values of event.target.selectedOptions on any change event.

Check out targetSelectedOptions for more details on how this works.

Note: onChange parses event.target.value that doesn't work with multi-choice select elements.

Note 2: selectedOptions is not supported by Internet Explorer.