module JSDOM.Generated.HTMLInputElement
(stepUp, stepDown, checkValidity, checkValidity_, reportValidity,
reportValidity_, setCustomValidity, select, setRangeText,
setRangeText4, setSelectionRange, setAccept, getAccept, setAlt,
getAlt, setAutocomplete, getAutocomplete, setAutofocus,
getAutofocus, setDefaultChecked, getDefaultChecked, setChecked,
getChecked, setDirName, getDirName, setDisabled, getDisabled,
getForm, setFiles, getFiles, getFilesUnsafe, getFilesUnchecked,
setFormAction, getFormAction, setFormEnctype, getFormEnctype,
setFormMethod, getFormMethod, setFormNoValidate, getFormNoValidate,
setFormTarget, getFormTarget, setHeight, getHeight,
setIndeterminate, getIndeterminate, getList, setMax, getMax,
setMinLength, getMinLength, setMaxLength, getMaxLength, setMin,
getMin, setMultiple, getMultiple, setName, getName, setPattern,
getPattern, setPlaceholder, getPlaceholder, setReadOnly,
getReadOnly, setRequired, getRequired, setSize, getSize, setSrc,
getSrc, setStep, getStep, setType, getType, setDefaultValue,
getDefaultValue, setValue, getValue, setValueAsDate,
getValueAsDate, getValueAsDateUnsafe, getValueAsDateUnchecked,
setValueAsNumber, getValueAsNumber, setWidth, getWidth,
getWillValidate, getValidity, getValidationMessage, getLabels,
setSelectionStart, getSelectionStart, setSelectionEnd,
getSelectionEnd, setSelectionDirection, getSelectionDirection,
setAlign, getAlign, setUseMap, getUseMap, setIncremental,
getIncremental, setCapture, getCapture, HTMLInputElement(..),
gTypeHTMLInputElement)
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)
import JSDOM.Enums
stepUp :: (MonadDOM m) => HTMLInputElement -> Maybe Int -> m ()
stepUp self n = liftDOM (void (self ^. jsf "stepUp" [toJSVal n]))
stepDown :: (MonadDOM m) => HTMLInputElement -> Maybe Int -> m ()
stepDown self n
= liftDOM (void (self ^. jsf "stepDown" [toJSVal n]))
checkValidity :: (MonadDOM m) => HTMLInputElement -> m Bool
checkValidity self
= liftDOM ((self ^. jsf "checkValidity" ()) >>= valToBool)
checkValidity_ :: (MonadDOM m) => HTMLInputElement -> m ()
checkValidity_ self
= liftDOM (void (self ^. jsf "checkValidity" ()))
reportValidity :: (MonadDOM m) => HTMLInputElement -> m Bool
reportValidity self
= liftDOM ((self ^. jsf "reportValidity" ()) >>= valToBool)
reportValidity_ :: (MonadDOM m) => HTMLInputElement -> m ()
reportValidity_ self
= liftDOM (void (self ^. jsf "reportValidity" ()))
setCustomValidity ::
(MonadDOM m, ToJSString error) => HTMLInputElement -> error -> m ()
setCustomValidity self error
= liftDOM (void (self ^. jsf "setCustomValidity" [toJSVal error]))
select :: (MonadDOM m) => HTMLInputElement -> m ()
select self = liftDOM (void (self ^. jsf "select" ()))
setRangeText ::
(MonadDOM m, ToJSString replacement) =>
HTMLInputElement -> replacement -> m ()
setRangeText self replacement
= liftDOM (void (self ^. jsf "setRangeText" [toJSVal replacement]))
setRangeText4 ::
(MonadDOM m, ToJSString replacement, ToJSString selectionMode) =>
HTMLInputElement ->
replacement -> Word -> Word -> Maybe selectionMode -> m ()
setRangeText4 self replacement start end selectionMode
= liftDOM
(void
(self ^. jsf "setRangeText"
[toJSVal replacement, toJSVal start, toJSVal end,
toJSVal selectionMode]))
setSelectionRange ::
(MonadDOM m, ToJSString direction) =>
HTMLInputElement -> Int -> Int -> Maybe direction -> m ()
setSelectionRange self start end direction
= liftDOM
(void
(self ^. jsf "setSelectionRange"
[toJSVal start, toJSVal end, toJSVal direction]))
setAccept ::
(MonadDOM m, ToJSString val) => HTMLInputElement -> val -> m ()
setAccept self val = liftDOM (self ^. jss "accept" (toJSVal val))
getAccept ::
(MonadDOM m, FromJSString result) => HTMLInputElement -> m result
getAccept self
= liftDOM ((self ^. js "accept") >>= fromJSValUnchecked)
setAlt ::
(MonadDOM m, ToJSString val) => HTMLInputElement -> val -> m ()
setAlt self val = liftDOM (self ^. jss "alt" (toJSVal val))
getAlt ::
(MonadDOM m, FromJSString result) => HTMLInputElement -> m result
getAlt self = liftDOM ((self ^. js "alt") >>= fromJSValUnchecked)
setAutocomplete ::
(MonadDOM m, ToJSString val) => HTMLInputElement -> val -> m ()
setAutocomplete self val
= liftDOM (self ^. jss "autocomplete" (toJSVal val))
getAutocomplete ::
(MonadDOM m, FromJSString result) => HTMLInputElement -> m result
getAutocomplete self
= liftDOM ((self ^. js "autocomplete") >>= fromJSValUnchecked)
setAutofocus :: (MonadDOM m) => HTMLInputElement -> Bool -> m ()
setAutofocus self val
= liftDOM (self ^. jss "autofocus" (toJSVal val))
getAutofocus :: (MonadDOM m) => HTMLInputElement -> m Bool
getAutofocus self
= liftDOM ((self ^. js "autofocus") >>= valToBool)
setDefaultChecked ::
(MonadDOM m) => HTMLInputElement -> Bool -> m ()
setDefaultChecked self val
= liftDOM (self ^. jss "defaultChecked" (toJSVal val))
getDefaultChecked :: (MonadDOM m) => HTMLInputElement -> m Bool
getDefaultChecked self
= liftDOM ((self ^. js "defaultChecked") >>= valToBool)
setChecked :: (MonadDOM m) => HTMLInputElement -> Bool -> m ()
setChecked self val = liftDOM (self ^. jss "checked" (toJSVal val))
getChecked :: (MonadDOM m) => HTMLInputElement -> m Bool
getChecked self = liftDOM ((self ^. js "checked") >>= valToBool)
setDirName ::
(MonadDOM m, ToJSString val) => HTMLInputElement -> val -> m ()
setDirName self val = liftDOM (self ^. jss "dirName" (toJSVal val))
getDirName ::
(MonadDOM m, FromJSString result) => HTMLInputElement -> m result
getDirName self
= liftDOM ((self ^. js "dirName") >>= fromJSValUnchecked)
setDisabled :: (MonadDOM m) => HTMLInputElement -> Bool -> m ()
setDisabled self val
= liftDOM (self ^. jss "disabled" (toJSVal val))
getDisabled :: (MonadDOM m) => HTMLInputElement -> m Bool
getDisabled self = liftDOM ((self ^. js "disabled") >>= valToBool)
getForm :: (MonadDOM m) => HTMLInputElement -> m HTMLFormElement
getForm self = liftDOM ((self ^. js "form") >>= fromJSValUnchecked)
setFiles ::
(MonadDOM m) => HTMLInputElement -> Maybe FileList -> m ()
setFiles self val = liftDOM (self ^. jss "files" (toJSVal val))
getFiles :: (MonadDOM m) => HTMLInputElement -> m (Maybe FileList)
getFiles self = liftDOM ((self ^. js "files") >>= fromJSVal)
getFilesUnsafe ::
(MonadDOM m, HasCallStack) => HTMLInputElement -> m FileList
getFilesUnsafe self
= liftDOM
(((self ^. js "files") >>= fromJSVal) >>=
maybe (Prelude.error "Nothing to return") return)
getFilesUnchecked :: (MonadDOM m) => HTMLInputElement -> m FileList
getFilesUnchecked self
= liftDOM ((self ^. js "files") >>= fromJSValUnchecked)
setFormAction ::
(MonadDOM m, ToJSString val) => HTMLInputElement -> val -> m ()
setFormAction self val
= liftDOM (self ^. jss "formAction" (toJSVal val))
getFormAction ::
(MonadDOM m, FromJSString result) => HTMLInputElement -> m result
getFormAction self
= liftDOM ((self ^. js "formAction") >>= fromJSValUnchecked)
setFormEnctype ::
(MonadDOM m, ToJSString val) => HTMLInputElement -> val -> m ()
setFormEnctype self val
= liftDOM (self ^. jss "formEnctype" (toJSVal val))
getFormEnctype ::
(MonadDOM m, FromJSString result) => HTMLInputElement -> m result
getFormEnctype self
= liftDOM ((self ^. js "formEnctype") >>= fromJSValUnchecked)
setFormMethod ::
(MonadDOM m, ToJSString val) => HTMLInputElement -> val -> m ()
setFormMethod self val
= liftDOM (self ^. jss "formMethod" (toJSVal val))
getFormMethod ::
(MonadDOM m, FromJSString result) => HTMLInputElement -> m result
getFormMethod self
= liftDOM ((self ^. js "formMethod") >>= fromJSValUnchecked)
setFormNoValidate ::
(MonadDOM m) => HTMLInputElement -> Bool -> m ()
setFormNoValidate self val
= liftDOM (self ^. jss "formNoValidate" (toJSVal val))
getFormNoValidate :: (MonadDOM m) => HTMLInputElement -> m Bool
getFormNoValidate self
= liftDOM ((self ^. js "formNoValidate") >>= valToBool)
setFormTarget ::
(MonadDOM m, ToJSString val) => HTMLInputElement -> val -> m ()
setFormTarget self val
= liftDOM (self ^. jss "formTarget" (toJSVal val))
getFormTarget ::
(MonadDOM m, FromJSString result) => HTMLInputElement -> m result
getFormTarget self
= liftDOM ((self ^. js "formTarget") >>= fromJSValUnchecked)
setHeight :: (MonadDOM m) => HTMLInputElement -> Word -> m ()
setHeight self val = liftDOM (self ^. jss "height" (toJSVal val))
getHeight :: (MonadDOM m) => HTMLInputElement -> m Word
getHeight self
= liftDOM (round <$> ((self ^. js "height") >>= valToNumber))
setIndeterminate ::
(MonadDOM m) => HTMLInputElement -> Bool -> m ()
setIndeterminate self val
= liftDOM (self ^. jss "indeterminate" (toJSVal val))
getIndeterminate :: (MonadDOM m) => HTMLInputElement -> m Bool
getIndeterminate self
= liftDOM ((self ^. js "indeterminate") >>= valToBool)
getList :: (MonadDOM m) => HTMLInputElement -> m HTMLElement
getList self = liftDOM ((self ^. js "list") >>= fromJSValUnchecked)
setMax ::
(MonadDOM m, ToJSString val) => HTMLInputElement -> val -> m ()
setMax self val = liftDOM (self ^. jss "max" (toJSVal val))
getMax ::
(MonadDOM m, FromJSString result) => HTMLInputElement -> m result
getMax self = liftDOM ((self ^. js "max") >>= fromJSValUnchecked)
setMinLength :: (MonadDOM m) => HTMLInputElement -> Int -> m ()
setMinLength self val
= liftDOM (self ^. jss "minLength" (toJSVal val))
getMinLength :: (MonadDOM m) => HTMLInputElement -> m Int
getMinLength self
= liftDOM (round <$> ((self ^. js "minLength") >>= valToNumber))
setMaxLength :: (MonadDOM m) => HTMLInputElement -> Int -> m ()
setMaxLength self val
= liftDOM (self ^. jss "maxLength" (toJSVal val))
getMaxLength :: (MonadDOM m) => HTMLInputElement -> m Int
getMaxLength self
= liftDOM (round <$> ((self ^. js "maxLength") >>= valToNumber))
setMin ::
(MonadDOM m, ToJSString val) => HTMLInputElement -> val -> m ()
setMin self val = liftDOM (self ^. jss "min" (toJSVal val))
getMin ::
(MonadDOM m, FromJSString result) => HTMLInputElement -> m result
getMin self = liftDOM ((self ^. js "min") >>= fromJSValUnchecked)
setMultiple :: (MonadDOM m) => HTMLInputElement -> Bool -> m ()
setMultiple self val
= liftDOM (self ^. jss "multiple" (toJSVal val))
getMultiple :: (MonadDOM m) => HTMLInputElement -> m Bool
getMultiple self = liftDOM ((self ^. js "multiple") >>= valToBool)
setName ::
(MonadDOM m, ToJSString val) => HTMLInputElement -> val -> m ()
setName self val = liftDOM (self ^. jss "name" (toJSVal val))
getName ::
(MonadDOM m, FromJSString result) => HTMLInputElement -> m result
getName self = liftDOM ((self ^. js "name") >>= fromJSValUnchecked)
setPattern ::
(MonadDOM m, ToJSString val) => HTMLInputElement -> val -> m ()
setPattern self val = liftDOM (self ^. jss "pattern" (toJSVal val))
getPattern ::
(MonadDOM m, FromJSString result) => HTMLInputElement -> m result
getPattern self
= liftDOM ((self ^. js "pattern") >>= fromJSValUnchecked)
setPlaceholder ::
(MonadDOM m, ToJSString val) => HTMLInputElement -> val -> m ()
setPlaceholder self val
= liftDOM (self ^. jss "placeholder" (toJSVal val))
getPlaceholder ::
(MonadDOM m, FromJSString result) => HTMLInputElement -> m result
getPlaceholder self
= liftDOM ((self ^. js "placeholder") >>= fromJSValUnchecked)
setReadOnly :: (MonadDOM m) => HTMLInputElement -> Bool -> m ()
setReadOnly self val
= liftDOM (self ^. jss "readOnly" (toJSVal val))
getReadOnly :: (MonadDOM m) => HTMLInputElement -> m Bool
getReadOnly self = liftDOM ((self ^. js "readOnly") >>= valToBool)
setRequired :: (MonadDOM m) => HTMLInputElement -> Bool -> m ()
setRequired self val
= liftDOM (self ^. jss "required" (toJSVal val))
getRequired :: (MonadDOM m) => HTMLInputElement -> m Bool
getRequired self = liftDOM ((self ^. js "required") >>= valToBool)
setSize :: (MonadDOM m) => HTMLInputElement -> Word -> m ()
setSize self val = liftDOM (self ^. jss "size" (toJSVal val))
getSize :: (MonadDOM m) => HTMLInputElement -> m Word
getSize self
= liftDOM (round <$> ((self ^. js "size") >>= valToNumber))
setSrc ::
(MonadDOM m, ToJSString val) => HTMLInputElement -> val -> m ()
setSrc self val = liftDOM (self ^. jss "src" (toJSVal val))
getSrc ::
(MonadDOM m, FromJSString result) => HTMLInputElement -> m result
getSrc self = liftDOM ((self ^. js "src") >>= fromJSValUnchecked)
setStep ::
(MonadDOM m, ToJSString val) => HTMLInputElement -> val -> m ()
setStep self val = liftDOM (self ^. jss "step" (toJSVal val))
getStep ::
(MonadDOM m, FromJSString result) => HTMLInputElement -> m result
getStep self = liftDOM ((self ^. js "step") >>= fromJSValUnchecked)
setType ::
(MonadDOM m, ToJSString val) => HTMLInputElement -> val -> m ()
setType self val = liftDOM (self ^. jss "type" (toJSVal val))
getType ::
(MonadDOM m, FromJSString result) => HTMLInputElement -> m result
getType self = liftDOM ((self ^. js "type") >>= fromJSValUnchecked)
setDefaultValue ::
(MonadDOM m, ToJSString val) => HTMLInputElement -> val -> m ()
setDefaultValue self val
= liftDOM (self ^. jss "defaultValue" (toJSVal val))
getDefaultValue ::
(MonadDOM m, FromJSString result) => HTMLInputElement -> m result
getDefaultValue self
= liftDOM ((self ^. js "defaultValue") >>= fromJSValUnchecked)
setValue ::
(MonadDOM m, ToJSString val) => HTMLInputElement -> val -> m ()
setValue self val = liftDOM (self ^. jss "value" (toJSVal val))
getValue ::
(MonadDOM m, FromJSString result) => HTMLInputElement -> m result
getValue self
= liftDOM ((self ^. js "value") >>= fromJSValUnchecked)
setValueAsDate ::
(MonadDOM m, IsDate val) => HTMLInputElement -> Maybe val -> m ()
setValueAsDate self val
= liftDOM (self ^. jss "valueAsDate" (toJSVal val))
getValueAsDate ::
(MonadDOM m) => HTMLInputElement -> m (Maybe Date)
getValueAsDate self
= liftDOM ((self ^. js "valueAsDate") >>= fromJSVal)
getValueAsDateUnsafe ::
(MonadDOM m, HasCallStack) => HTMLInputElement -> m Date
getValueAsDateUnsafe self
= liftDOM
(((self ^. js "valueAsDate") >>= fromJSVal) >>=
maybe (Prelude.error "Nothing to return") return)
getValueAsDateUnchecked ::
(MonadDOM m) => HTMLInputElement -> m Date
getValueAsDateUnchecked self
= liftDOM ((self ^. js "valueAsDate") >>= fromJSValUnchecked)
setValueAsNumber ::
(MonadDOM m) => HTMLInputElement -> Double -> m ()
setValueAsNumber self val
= liftDOM (self ^. jss "valueAsNumber" (toJSVal val))
getValueAsNumber :: (MonadDOM m) => HTMLInputElement -> m Double
getValueAsNumber self
= liftDOM ((self ^. js "valueAsNumber") >>= valToNumber)
setWidth :: (MonadDOM m) => HTMLInputElement -> Word -> m ()
setWidth self val = liftDOM (self ^. jss "width" (toJSVal val))
getWidth :: (MonadDOM m) => HTMLInputElement -> m Word
getWidth self
= liftDOM (round <$> ((self ^. js "width") >>= valToNumber))
getWillValidate :: (MonadDOM m) => HTMLInputElement -> m Bool
getWillValidate self
= liftDOM ((self ^. js "willValidate") >>= valToBool)
getValidity :: (MonadDOM m) => HTMLInputElement -> m ValidityState
getValidity self
= liftDOM ((self ^. js "validity") >>= fromJSValUnchecked)
getValidationMessage ::
(MonadDOM m, FromJSString result) => HTMLInputElement -> m result
getValidationMessage self
= liftDOM ((self ^. js "validationMessage") >>= fromJSValUnchecked)
getLabels :: (MonadDOM m) => HTMLInputElement -> m NodeList
getLabels self
= liftDOM ((self ^. js "labels") >>= fromJSValUnchecked)
setSelectionStart ::
(MonadDOM m) => HTMLInputElement -> Int -> m ()
setSelectionStart self val
= liftDOM (self ^. jss "selectionStart" (toJSVal val))
getSelectionStart :: (MonadDOM m) => HTMLInputElement -> m Int
getSelectionStart self
= liftDOM
(round <$> ((self ^. js "selectionStart") >>= valToNumber))
setSelectionEnd :: (MonadDOM m) => HTMLInputElement -> Int -> m ()
setSelectionEnd self val
= liftDOM (self ^. jss "selectionEnd" (toJSVal val))
getSelectionEnd :: (MonadDOM m) => HTMLInputElement -> m Int
getSelectionEnd self
= liftDOM (round <$> ((self ^. js "selectionEnd") >>= valToNumber))
setSelectionDirection ::
(MonadDOM m, ToJSString val) => HTMLInputElement -> val -> m ()
setSelectionDirection self val
= liftDOM (self ^. jss "selectionDirection" (toJSVal val))
getSelectionDirection ::
(MonadDOM m, FromJSString result) => HTMLInputElement -> m result
getSelectionDirection self
= liftDOM
((self ^. js "selectionDirection") >>= fromJSValUnchecked)
setAlign ::
(MonadDOM m, ToJSString val) => HTMLInputElement -> val -> m ()
setAlign self val = liftDOM (self ^. jss "align" (toJSVal val))
getAlign ::
(MonadDOM m, FromJSString result) => HTMLInputElement -> m result
getAlign self
= liftDOM ((self ^. js "align") >>= fromJSValUnchecked)
setUseMap ::
(MonadDOM m, ToJSString val) => HTMLInputElement -> val -> m ()
setUseMap self val = liftDOM (self ^. jss "useMap" (toJSVal val))
getUseMap ::
(MonadDOM m, FromJSString result) => HTMLInputElement -> m result
getUseMap self
= liftDOM ((self ^. js "useMap") >>= fromJSValUnchecked)
setIncremental :: (MonadDOM m) => HTMLInputElement -> Bool -> m ()
setIncremental self val
= liftDOM (self ^. jss "incremental" (toJSVal val))
getIncremental :: (MonadDOM m) => HTMLInputElement -> m Bool
getIncremental self
= liftDOM ((self ^. js "incremental") >>= valToBool)
setCapture ::
(MonadDOM m, ToJSString val) => HTMLInputElement -> val -> m ()
setCapture self val = liftDOM (self ^. jss "capture" (toJSVal val))
getCapture ::
(MonadDOM m, FromJSString result) => HTMLInputElement -> m result
getCapture self
= liftDOM ((self ^. js "capture") >>= fromJSValUnchecked)