{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
module JSDOM.Generated.HTMLFormElement
(getAt, getAt_, getAtUnsafe, getAtUnchecked, get, get_, getUnsafe,
getUnchecked, submit, reset, checkValidity, checkValidity_,
reportValidity, reportValidity_, requestAutocomplete,
setAcceptCharset, getAcceptCharset, setAction, getAction,
setAutocomplete, getAutocomplete, setEnctype, getEnctype,
setEncoding, getEncoding, setMethod, getMethod, setName, getName,
setNoValidate, getNoValidate, setTarget, getTarget, getElements,
getLength, HTMLFormElement(..), gTypeHTMLFormElement)
where
import Prelude ((.), (==), (>>=), return, IO, Int, Float, Double, Bool(..), Maybe, maybe, fromIntegral, round, realToFrac, fmap, Show, Read, Eq, Ord, Maybe(..))
import qualified Prelude (error)
import Data.Typeable (Typeable)
import Data.Traversable (mapM)
import Language.Javascript.JSaddle (JSM(..), JSVal(..), JSString, strictEqual, toJSVal, valToStr, valToNumber, valToBool, js, jss, jsf, jsg, function, asyncFunction, new, array, jsUndefined, (!), (!!))
import Data.Int (Int64)
import Data.Word (Word, Word64)
import JSDOM.Types
import Control.Applicative ((<$>))
import Control.Monad (void)
import Control.Lens.Operators ((^.))
import JSDOM.EventTargetClosures (EventName, unsafeEventName, unsafeEventNameAsync)
import JSDOM.Enums
getAt ::
(MonadDOM m) => HTMLFormElement -> Word -> m (Maybe Element)
getAt self index
= liftDOM ((self ^. jsf "get" [toJSVal index]) >>= fromJSVal)
getAt_ :: (MonadDOM m) => HTMLFormElement -> Word -> m ()
getAt_ self index
= liftDOM (void (self ^. jsf "get" [toJSVal index]))
getAtUnsafe ::
(MonadDOM m, HasCallStack) => HTMLFormElement -> Word -> m Element
getAtUnsafe self index
= liftDOM
(((self ^. jsf "get" [toJSVal index]) >>= fromJSVal) >>=
maybe (Prelude.error "Nothing to return") return)
getAtUnchecked ::
(MonadDOM m) => HTMLFormElement -> Word -> m Element
getAtUnchecked self index
= liftDOM
((self ^. jsf "get" [toJSVal index]) >>= fromJSValUnchecked)
get ::
(MonadDOM m, ToJSString name) =>
HTMLFormElement -> name -> m (Maybe RadioNodeListOrElement)
get self name = liftDOM ((self ! name) >>= fromJSVal)
get_ ::
(MonadDOM m, ToJSString name) => HTMLFormElement -> name -> m ()
get_ self name = liftDOM (void (self ! name))
getUnsafe ::
(MonadDOM m, ToJSString name, HasCallStack) =>
HTMLFormElement -> name -> m RadioNodeListOrElement
getUnsafe self name
= liftDOM
(((self ! name) >>= fromJSVal) >>=
maybe (Prelude.error "Nothing to return") return)
getUnchecked ::
(MonadDOM m, ToJSString name) =>
HTMLFormElement -> name -> m RadioNodeListOrElement
getUnchecked self name
= liftDOM ((self ! name) >>= fromJSValUnchecked)
submit :: (MonadDOM m) => HTMLFormElement -> m ()
submit self = liftDOM (void (self ^. jsf "submit" ()))
reset :: (MonadDOM m) => HTMLFormElement -> m ()
reset self = liftDOM (void (self ^. jsf "reset" ()))
checkValidity :: (MonadDOM m) => HTMLFormElement -> m Bool
checkValidity self
= liftDOM ((self ^. jsf "checkValidity" ()) >>= valToBool)
checkValidity_ :: (MonadDOM m) => HTMLFormElement -> m ()
checkValidity_ self
= liftDOM (void (self ^. jsf "checkValidity" ()))
reportValidity :: (MonadDOM m) => HTMLFormElement -> m Bool
reportValidity self
= liftDOM ((self ^. jsf "reportValidity" ()) >>= valToBool)
reportValidity_ :: (MonadDOM m) => HTMLFormElement -> m ()
reportValidity_ self
= liftDOM (void (self ^. jsf "reportValidity" ()))
requestAutocomplete :: (MonadDOM m) => HTMLFormElement -> m ()
requestAutocomplete self
= liftDOM (void (self ^. jsf "requestAutocomplete" ()))
setAcceptCharset ::
(MonadDOM m, ToJSString val) => HTMLFormElement -> val -> m ()
setAcceptCharset self val
= liftDOM (self ^. jss "acceptCharset" (toJSVal val))
getAcceptCharset ::
(MonadDOM m, FromJSString result) => HTMLFormElement -> m result
getAcceptCharset self
= liftDOM ((self ^. js "acceptCharset") >>= fromJSValUnchecked)
setAction ::
(MonadDOM m, ToJSString val) => HTMLFormElement -> val -> m ()
setAction self val = liftDOM (self ^. jss "action" (toJSVal val))
getAction ::
(MonadDOM m, FromJSString result) => HTMLFormElement -> m result
getAction self
= liftDOM ((self ^. js "action") >>= fromJSValUnchecked)
setAutocomplete ::
(MonadDOM m, ToJSString val) => HTMLFormElement -> val -> m ()
setAutocomplete self val
= liftDOM (self ^. jss "autocomplete" (toJSVal val))
getAutocomplete ::
(MonadDOM m, FromJSString result) => HTMLFormElement -> m result
getAutocomplete self
= liftDOM ((self ^. js "autocomplete") >>= fromJSValUnchecked)
setEnctype ::
(MonadDOM m, ToJSString val) => HTMLFormElement -> val -> m ()
setEnctype self val = liftDOM (self ^. jss "enctype" (toJSVal val))
getEnctype ::
(MonadDOM m, FromJSString result) => HTMLFormElement -> m result
getEnctype self
= liftDOM ((self ^. js "enctype") >>= fromJSValUnchecked)
setEncoding ::
(MonadDOM m, ToJSString val) => HTMLFormElement -> val -> m ()
setEncoding self val
= liftDOM (self ^. jss "encoding" (toJSVal val))
getEncoding ::
(MonadDOM m, FromJSString result) => HTMLFormElement -> m result
getEncoding self
= liftDOM ((self ^. js "encoding") >>= fromJSValUnchecked)
setMethod ::
(MonadDOM m, ToJSString val) => HTMLFormElement -> val -> m ()
setMethod self val = liftDOM (self ^. jss "method" (toJSVal val))
getMethod ::
(MonadDOM m, FromJSString result) => HTMLFormElement -> m result
getMethod self
= liftDOM ((self ^. js "method") >>= fromJSValUnchecked)
setName ::
(MonadDOM m, ToJSString val) => HTMLFormElement -> val -> m ()
setName self val = liftDOM (self ^. jss "name" (toJSVal val))
getName ::
(MonadDOM m, FromJSString result) => HTMLFormElement -> m result
getName self = liftDOM ((self ^. js "name") >>= fromJSValUnchecked)
setNoValidate :: (MonadDOM m) => HTMLFormElement -> Bool -> m ()
setNoValidate self val
= liftDOM (self ^. jss "noValidate" (toJSVal val))
getNoValidate :: (MonadDOM m) => HTMLFormElement -> m Bool
getNoValidate self
= liftDOM ((self ^. js "noValidate") >>= valToBool)
setTarget ::
(MonadDOM m, ToJSString val) => HTMLFormElement -> val -> m ()
setTarget self val = liftDOM (self ^. jss "target" (toJSVal val))
getTarget ::
(MonadDOM m, FromJSString result) => HTMLFormElement -> m result
getTarget self
= liftDOM ((self ^. js "target") >>= fromJSValUnchecked)
getElements ::
(MonadDOM m) => HTMLFormElement -> m HTMLFormControlsCollection
getElements self
= liftDOM ((self ^. js "elements") >>= fromJSValUnchecked)
getLength :: (MonadDOM m) => HTMLFormElement -> m Word
getLength self
= liftDOM (round <$> ((self ^. js "length") >>= valToNumber))