Skip to content

Latest commit

 

History

History
473 lines (314 loc) · 9.09 KB

Events.md

File metadata and controls

473 lines (314 loc) · 9.09 KB

Module Pux.Html.Events

Target

type Target = { value :: String, checked :: Boolean }

ClipboardEvent

type ClipboardEvent = { target :: Target, currentTarget :: Target }

CompositionEvent

type CompositionEvent = { target :: Target, currentTarget :: Target, data :: String }

KeyboardEvent

type KeyboardEvent = { target :: Target, currentTarget :: Target, altKey :: Boolean, ctrlKey :: Boolean, charCode :: Int, key :: String, keyCode :: Int, locale :: String, location :: Int, metaKey :: Boolean, repeat :: Boolean, shiftKey :: Boolean, which :: Int }

FocusEvent

type FocusEvent = { target :: Target, currentTarget :: Target, relatedTarget :: Target }

FormEvent

type FormEvent = { target :: Target, currentTarget :: Target }

MouseEvent

type MouseEvent = { target :: Target, currentTarget :: Target, altKey :: Boolean, button :: Number, buttons :: Number, clientX :: Number, clientY :: Number, ctrlKey :: Boolean, metaKey :: Boolean, pageX :: Number, pageY :: Number, screenX :: Number, screenY :: Number, shiftKey :: Boolean }

SelectionEvent

type SelectionEvent = { target :: Target, currentTarget :: Target }

TouchEvent

type TouchEvent = { target :: Target, currentTarget :: Target, altKey :: Boolean, ctrlKey :: Boolean, metaKey :: Boolean, shiftKey :: Boolean }

UIEvent

type UIEvent = { target :: Target, currentTarget :: Target, detail :: Number }

WheelEvent

type WheelEvent = { target :: Target, currentTarget :: Target, deltaMode :: Number, deltaX :: Number, deltaY :: Number, deltaZ :: Number }

MediaEvent

type MediaEvent = { target :: Target, currentTarget :: Target }

onCopy

onCopy :: forall action. (ClipboardEvent -> action) -> Attribute action

onCut

onCut :: forall action. (ClipboardEvent -> action) -> Attribute action

onPaste

onPaste :: forall action. (ClipboardEvent -> action) -> Attribute action

onCompositionEnd

onCompositionEnd :: forall action. (CompositionEvent -> action) -> Attribute action

onCompositionStart

onCompositionStart :: forall action. (CompositionEvent -> action) -> Attribute action

onCompositionUpdate

onCompositionUpdate :: forall action. (CompositionEvent -> action) -> Attribute action

onKeyDown

onKeyDown :: forall action. (KeyboardEvent -> action) -> Attribute action

onKeyPress

onKeyPress :: forall action. (KeyboardEvent -> action) -> Attribute action

onKeyUp

onKeyUp :: forall action. (KeyboardEvent -> action) -> Attribute action

onKey

onKey :: forall action. String -> (KeyboardEvent -> action) -> Attribute action

Send action only if specified key is pressed (on key up)

onFocus

onFocus :: forall action. (FocusEvent -> action) -> Attribute action

onBlur

onBlur :: forall action. (FocusEvent -> action) -> Attribute action

onChange

onChange :: forall action. (FormEvent -> action) -> Attribute action

onInput

onInput :: forall action. (FormEvent -> action) -> Attribute action

onSubmit

onSubmit :: forall action. (FormEvent -> action) -> Attribute action

onClick

onClick :: forall action. (MouseEvent -> action) -> Attribute action

onContextMenu

onContextMenu :: forall action. (MouseEvent -> action) -> Attribute action

onDoubleClick

onDoubleClick :: forall action. (MouseEvent -> action) -> Attribute action

onDrag

onDrag :: forall action. (MouseEvent -> action) -> Attribute action

onDragEnd

onDragEnd :: forall action. (MouseEvent -> action) -> Attribute action

onDragEnter

onDragEnter :: forall action. (MouseEvent -> action) -> Attribute action

onDragExit

onDragExit :: forall action. (MouseEvent -> action) -> Attribute action

onDragLeave

onDragLeave :: forall action. (MouseEvent -> action) -> Attribute action

onDragOver

onDragOver :: forall action. (MouseEvent -> action) -> Attribute action

onDragStart

onDragStart :: forall action. (MouseEvent -> action) -> Attribute action

onDrop

onDrop :: forall action. (MouseEvent -> action) -> Attribute action

onMouseDown

onMouseDown :: forall action. (MouseEvent -> action) -> Attribute action

onMouseEnter

onMouseEnter :: forall action. (MouseEvent -> action) -> Attribute action

onMouseLeave

onMouseLeave :: forall action. (MouseEvent -> action) -> Attribute action

onMouseMove

onMouseMove :: forall action. (MouseEvent -> action) -> Attribute action

onMouseOut

onMouseOut :: forall action. (MouseEvent -> action) -> Attribute action

onMouseOver

onMouseOver :: forall action. (MouseEvent -> action) -> Attribute action

onMouseUp

onMouseUp :: forall action. (MouseEvent -> action) -> Attribute action

onSelect

onSelect :: forall action. (SelectionEvent -> action) -> Attribute action

onTouchCancel

onTouchCancel :: forall action. (TouchEvent -> action) -> Attribute action

onTouchEnd

onTouchEnd :: forall action. (TouchEvent -> action) -> Attribute action

onTouchMove

onTouchMove :: forall action. (TouchEvent -> action) -> Attribute action

onTouchStart

onTouchStart :: forall action. (TouchEvent -> action) -> Attribute action

onScroll

onScroll :: forall action. (UIEvent -> action) -> Attribute action

onWheel

onWheel :: forall action. (WheelEvent -> action) -> Attribute action

onAbort

onAbort :: forall action. (MediaEvent -> action) -> Attribute action

onCanPlay

onCanPlay :: forall action. (MediaEvent -> action) -> Attribute action

onCanPlayThrough

onCanPlayThrough :: forall action. (MediaEvent -> action) -> Attribute action

onDurationChange

onDurationChange :: forall action. (MediaEvent -> action) -> Attribute action

onEmptied

onEmptied :: forall action. (MediaEvent -> action) -> Attribute action

onEncrypted

onEncrypted :: forall action. (MediaEvent -> action) -> Attribute action

onEnded

onEnded :: forall action. (MediaEvent -> action) -> Attribute action

onError

onError :: forall action. (MediaEvent -> action) -> Attribute action

onLoad

onLoad :: forall action. (MediaEvent -> action) -> Attribute action

onLoadedData

onLoadedData :: forall action. (MediaEvent -> action) -> Attribute action

onLoadedMetadata

onLoadedMetadata :: forall action. (MediaEvent -> action) -> Attribute action

onLoadStart

onLoadStart :: forall action. (MediaEvent -> action) -> Attribute action

onPause

onPause :: forall action. (MediaEvent -> action) -> Attribute action

onPlay

onPlay :: forall action. (MediaEvent -> action) -> Attribute action

onPlaying

onPlaying :: forall action. (MediaEvent -> action) -> Attribute action

onProgress

onProgress :: forall action. (MediaEvent -> action) -> Attribute action

onRateChange

onRateChange :: forall action. (MediaEvent -> action) -> Attribute action

onSeeked

onSeeked :: forall action. (MediaEvent -> action) -> Attribute action

onSeeking

onSeeking :: forall action. (MediaEvent -> action) -> Attribute action

onStalled

onStalled :: forall action. (MediaEvent -> action) -> Attribute action

onSuspend

onSuspend :: forall action. (MediaEvent -> action) -> Attribute action

onTimeUpdate

onTimeUpdate :: forall action. (MediaEvent -> action) -> Attribute action

onVolumeChange

onVolumeChange :: forall action. (MediaEvent -> action) -> Attribute action

onWaiting

onWaiting :: forall action. (MediaEvent -> action) -> Attribute action

handler

handler :: forall ev a. Fn2 String (ev -> a) (Attribute a)

onKeyHandler

onKeyHandler :: forall ev a. Fn2 String (ev -> a) (Attribute a)