Copyright | (C) 2016-2018 David M. Johnson |
---|---|
License | BSD3-style (see the file LICENSE) |
Maintainer | David M. Johnson <djohnson.m@gmail.com> |
Stability | experimental |
Portability | non-portable |
Safe Haskell | None |
Language | Haskell2010 |
Synopsis
- on :: MisoString -> Decoder r -> (r -> action) -> Attribute action
- onWithOptions :: Options -> MisoString -> Decoder r -> (r -> action) -> Attribute action
- data Options = Options {}
- defaultOptions :: Options
- onClick :: action -> Attribute action
- onDoubleClick :: action -> Attribute action
- onMouseDown :: action -> Attribute action
- onMouseUp :: action -> Attribute action
- onMouseEnter :: action -> Attribute action
- onMouseLeave :: action -> Attribute action
- onMouseOver :: action -> Attribute action
- onMouseOut :: action -> Attribute action
- onKeyDown :: (KeyCode -> action) -> Attribute action
- onKeyPress :: (KeyCode -> action) -> Attribute action
- onKeyUp :: (KeyCode -> action) -> Attribute action
- onInput :: (MisoString -> action) -> Attribute action
- onChange :: (MisoString -> action) -> Attribute action
- onChecked :: (Checked -> action) -> Attribute action
- onSubmit :: action -> Attribute action
- onBlur :: action -> Attribute action
- onFocus :: action -> Attribute action
- onDrag :: action -> Attribute action
- onDragLeave :: action -> Attribute action
- onDragEnter :: action -> Attribute action
- onDragEnd :: action -> Attribute action
- onDragStart :: action -> Attribute action
- onDragOver :: action -> Attribute action
- onDrop :: AllowDrop -> action -> Attribute action
Custom event handlers
on :: MisoString -> Decoder r -> (r -> action) -> Attribute action Source #
For defining delegated events
let clickHandler = on "click" emptyDecoder $ \() -> Action in button_ [ clickHandler, class_ "add" ] [ text_ "+" ]
onWithOptions :: Options -> MisoString -> Decoder r -> (r -> action) -> Attribute action Source #
For defining delegated events with options
let clickHandler = onWithOptions defaultOptions "click" emptyDecoder $ \() -> Action in button_ [ clickHandler, class_ "add" ] [ text_ "+" ]
Options for handling event propagation.
Instances
Eq Options Source # | |
Show Options Source # | |
Generic Options Source # | |
type Rep Options Source # | |
Defined in Miso.Event.Types type Rep Options = D1 (MetaData "Options" "Miso.Event.Types" "miso-0.21.2.0-JYUNYHsQW6M2capj3LsrOE" False) (C1 (MetaCons "Options" PrefixI True) (S1 (MetaSel (Just "preventDefault") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Bool) :*: S1 (MetaSel (Just "stopPropagation") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Bool))) |
defaultOptions :: Options Source #
Default value for Options
.
defaultOptions = Options { preventDefault = False, stopPropagation = False }
Mouse events
onDoubleClick :: action -> Attribute action Source #
onMouseDown :: action -> Attribute action Source #
onMouseEnter :: action -> Attribute action Source #
onMouseLeave :: action -> Attribute action Source #
onMouseOver :: action -> Attribute action Source #
onMouseOut :: action -> Attribute action Source #
Keyboard events
onKeyPress :: (KeyCode -> action) -> Attribute action Source #
Form events
onInput :: (MisoString -> action) -> Attribute action Source #
onChange :: (MisoString -> action) -> Attribute action Source #
Focus events
Drag events
onDragLeave :: action -> Attribute action Source #
onDragEnter :: action -> Attribute action Source #
onDragStart :: action -> Attribute action Source #
onDragOver :: action -> Attribute action Source #