{-# LANGUAGE CPP #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE UndecidableInstances #-}
module Reflex.Dom.Builder.InputDisabled where
import Control.Monad.Fix
import Control.Monad.Primitive
import Control.Monad.Ref
import Control.Monad.Trans
import Control.Monad.Trans.Control
import Data.Coerce
import qualified Data.Map as Map
import Foreign.JavaScript.TH
#ifndef ghcjs_HOST_OS
import GHCJS.DOM.Types (MonadJSM (..))
#endif
import Reflex
import Reflex.Dom.Builder.Class
import Reflex.Dom.Builder.Immediate (HasDocument (..))
import Reflex.Host.Class
newtype InputDisabledT m a = InputDisabledT { InputDisabledT m a -> m a
runInputDisabledT :: m a } deriving (a -> InputDisabledT m b -> InputDisabledT m a
(a -> b) -> InputDisabledT m a -> InputDisabledT m b
(forall a b. (a -> b) -> InputDisabledT m a -> InputDisabledT m b)
-> (forall a b. a -> InputDisabledT m b -> InputDisabledT m a)
-> Functor (InputDisabledT m)
forall a b. a -> InputDisabledT m b -> InputDisabledT m a
forall a b. (a -> b) -> InputDisabledT m a -> InputDisabledT m b
forall (m :: * -> *) a b.
Functor m =>
a -> InputDisabledT m b -> InputDisabledT m a
forall (m :: * -> *) a b.
Functor m =>
(a -> b) -> InputDisabledT m a -> InputDisabledT m b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
<$ :: a -> InputDisabledT m b -> InputDisabledT m a
$c<$ :: forall (m :: * -> *) a b.
Functor m =>
a -> InputDisabledT m b -> InputDisabledT m a
fmap :: (a -> b) -> InputDisabledT m a -> InputDisabledT m b
$cfmap :: forall (m :: * -> *) a b.
Functor m =>
(a -> b) -> InputDisabledT m a -> InputDisabledT m b
Functor, Functor (InputDisabledT m)
a -> InputDisabledT m a
Functor (InputDisabledT m) =>
(forall a. a -> InputDisabledT m a)
-> (forall a b.
InputDisabledT m (a -> b)
-> InputDisabledT m a -> InputDisabledT m b)
-> (forall a b c.
(a -> b -> c)
-> InputDisabledT m a -> InputDisabledT m b -> InputDisabledT m c)
-> (forall a b.
InputDisabledT m a -> InputDisabledT m b -> InputDisabledT m b)
-> (forall a b.
InputDisabledT m a -> InputDisabledT m b -> InputDisabledT m a)
-> Applicative (InputDisabledT m)
InputDisabledT m a -> InputDisabledT m b -> InputDisabledT m b
InputDisabledT m a -> InputDisabledT m b -> InputDisabledT m a
InputDisabledT m (a -> b)
-> InputDisabledT m a -> InputDisabledT m b
(a -> b -> c)
-> InputDisabledT m a -> InputDisabledT m b -> InputDisabledT m c
forall a. a -> InputDisabledT m a
forall a b.
InputDisabledT m a -> InputDisabledT m b -> InputDisabledT m a
forall a b.
InputDisabledT m a -> InputDisabledT m b -> InputDisabledT m b
forall a b.
InputDisabledT m (a -> b)
-> InputDisabledT m a -> InputDisabledT m b
forall a b c.
(a -> b -> c)
-> InputDisabledT m a -> InputDisabledT m b -> InputDisabledT m c
forall (f :: * -> *).
Functor f =>
(forall a. a -> f a)
-> (forall a b. f (a -> b) -> f a -> f b)
-> (forall a b c. (a -> b -> c) -> f a -> f b -> f c)
-> (forall a b. f a -> f b -> f b)
-> (forall a b. f a -> f b -> f a)
-> Applicative f
forall (m :: * -> *). Applicative m => Functor (InputDisabledT m)
forall (m :: * -> *) a. Applicative m => a -> InputDisabledT m a
forall (m :: * -> *) a b.
Applicative m =>
InputDisabledT m a -> InputDisabledT m b -> InputDisabledT m a
forall (m :: * -> *) a b.
Applicative m =>
InputDisabledT m a -> InputDisabledT m b -> InputDisabledT m b
forall (m :: * -> *) a b.
Applicative m =>
InputDisabledT m (a -> b)
-> InputDisabledT m a -> InputDisabledT m b
forall (m :: * -> *) a b c.
Applicative m =>
(a -> b -> c)
-> InputDisabledT m a -> InputDisabledT m b -> InputDisabledT m c
<* :: InputDisabledT m a -> InputDisabledT m b -> InputDisabledT m a
$c<* :: forall (m :: * -> *) a b.
Applicative m =>
InputDisabledT m a -> InputDisabledT m b -> InputDisabledT m a
*> :: InputDisabledT m a -> InputDisabledT m b -> InputDisabledT m b
$c*> :: forall (m :: * -> *) a b.
Applicative m =>
InputDisabledT m a -> InputDisabledT m b -> InputDisabledT m b
liftA2 :: (a -> b -> c)
-> InputDisabledT m a -> InputDisabledT m b -> InputDisabledT m c
$cliftA2 :: forall (m :: * -> *) a b c.
Applicative m =>
(a -> b -> c)
-> InputDisabledT m a -> InputDisabledT m b -> InputDisabledT m c
<*> :: InputDisabledT m (a -> b)
-> InputDisabledT m a -> InputDisabledT m b
$c<*> :: forall (m :: * -> *) a b.
Applicative m =>
InputDisabledT m (a -> b)
-> InputDisabledT m a -> InputDisabledT m b
pure :: a -> InputDisabledT m a
$cpure :: forall (m :: * -> *) a. Applicative m => a -> InputDisabledT m a
$cp1Applicative :: forall (m :: * -> *). Applicative m => Functor (InputDisabledT m)
Applicative, Applicative (InputDisabledT m)
a -> InputDisabledT m a
Applicative (InputDisabledT m) =>
(forall a b.
InputDisabledT m a
-> (a -> InputDisabledT m b) -> InputDisabledT m b)
-> (forall a b.
InputDisabledT m a -> InputDisabledT m b -> InputDisabledT m b)
-> (forall a. a -> InputDisabledT m a)
-> Monad (InputDisabledT m)
InputDisabledT m a
-> (a -> InputDisabledT m b) -> InputDisabledT m b
InputDisabledT m a -> InputDisabledT m b -> InputDisabledT m b
forall a. a -> InputDisabledT m a
forall a b.
InputDisabledT m a -> InputDisabledT m b -> InputDisabledT m b
forall a b.
InputDisabledT m a
-> (a -> InputDisabledT m b) -> InputDisabledT m b
forall (m :: * -> *). Monad m => Applicative (InputDisabledT m)
forall (m :: * -> *) a. Monad m => a -> InputDisabledT m a
forall (m :: * -> *) a b.
Monad m =>
InputDisabledT m a -> InputDisabledT m b -> InputDisabledT m b
forall (m :: * -> *) a b.
Monad m =>
InputDisabledT m a
-> (a -> InputDisabledT m b) -> InputDisabledT m b
forall (m :: * -> *).
Applicative m =>
(forall a b. m a -> (a -> m b) -> m b)
-> (forall a b. m a -> m b -> m b)
-> (forall a. a -> m a)
-> Monad m
return :: a -> InputDisabledT m a
$creturn :: forall (m :: * -> *) a. Monad m => a -> InputDisabledT m a
>> :: InputDisabledT m a -> InputDisabledT m b -> InputDisabledT m b
$c>> :: forall (m :: * -> *) a b.
Monad m =>
InputDisabledT m a -> InputDisabledT m b -> InputDisabledT m b
>>= :: InputDisabledT m a
-> (a -> InputDisabledT m b) -> InputDisabledT m b
$c>>= :: forall (m :: * -> *) a b.
Monad m =>
InputDisabledT m a
-> (a -> InputDisabledT m b) -> InputDisabledT m b
$cp1Monad :: forall (m :: * -> *). Monad m => Applicative (InputDisabledT m)
Monad, MonadRef (InputDisabledT m)
Ref (InputDisabledT m) a -> (a -> (a, b)) -> InputDisabledT m b
Ref (InputDisabledT m) a -> (a -> (a, b)) -> InputDisabledT m b
MonadRef (InputDisabledT m) =>
(forall a b.
Ref (InputDisabledT m) a -> (a -> (a, b)) -> InputDisabledT m b)
-> (forall a b.
Ref (InputDisabledT m) a -> (a -> (a, b)) -> InputDisabledT m b)
-> MonadAtomicRef (InputDisabledT m)
forall a b.
Ref (InputDisabledT m) a -> (a -> (a, b)) -> InputDisabledT m b
forall (m :: * -> *).
MonadRef m =>
(forall a b. Ref m a -> (a -> (a, b)) -> m b)
-> (forall a b. Ref m a -> (a -> (a, b)) -> m b)
-> MonadAtomicRef m
forall (m :: * -> *).
MonadAtomicRef m =>
MonadRef (InputDisabledT m)
forall (m :: * -> *) a b.
MonadAtomicRef m =>
Ref (InputDisabledT m) a -> (a -> (a, b)) -> InputDisabledT m b
atomicModifyRef' :: Ref (InputDisabledT m) a -> (a -> (a, b)) -> InputDisabledT m b
$catomicModifyRef' :: forall (m :: * -> *) a b.
MonadAtomicRef m =>
Ref (InputDisabledT m) a -> (a -> (a, b)) -> InputDisabledT m b
atomicModifyRef :: Ref (InputDisabledT m) a -> (a -> (a, b)) -> InputDisabledT m b
$catomicModifyRef :: forall (m :: * -> *) a b.
MonadAtomicRef m =>
Ref (InputDisabledT m) a -> (a -> (a, b)) -> InputDisabledT m b
$cp1MonadAtomicRef :: forall (m :: * -> *).
MonadAtomicRef m =>
MonadRef (InputDisabledT m)
MonadAtomicRef, Monad (InputDisabledT m)
Monad (InputDisabledT m) =>
(forall a. (a -> InputDisabledT m a) -> InputDisabledT m a)
-> MonadFix (InputDisabledT m)
(a -> InputDisabledT m a) -> InputDisabledT m a
forall a. (a -> InputDisabledT m a) -> InputDisabledT m a
forall (m :: * -> *).
Monad m =>
(forall a. (a -> m a) -> m a) -> MonadFix m
forall (m :: * -> *). MonadFix m => Monad (InputDisabledT m)
forall (m :: * -> *) a.
MonadFix m =>
(a -> InputDisabledT m a) -> InputDisabledT m a
mfix :: (a -> InputDisabledT m a) -> InputDisabledT m a
$cmfix :: forall (m :: * -> *) a.
MonadFix m =>
(a -> InputDisabledT m a) -> InputDisabledT m a
$cp1MonadFix :: forall (m :: * -> *). MonadFix m => Monad (InputDisabledT m)
MonadFix, Monad (InputDisabledT m)
Monad (InputDisabledT m) =>
(forall a. IO a -> InputDisabledT m a)
-> MonadIO (InputDisabledT m)
IO a -> InputDisabledT m a
forall a. IO a -> InputDisabledT m a
forall (m :: * -> *).
Monad m =>
(forall a. IO a -> m a) -> MonadIO m
forall (m :: * -> *). MonadIO m => Monad (InputDisabledT m)
forall (m :: * -> *) a. MonadIO m => IO a -> InputDisabledT m a
liftIO :: IO a -> InputDisabledT m a
$cliftIO :: forall (m :: * -> *) a. MonadIO m => IO a -> InputDisabledT m a
$cp1MonadIO :: forall (m :: * -> *). MonadIO m => Monad (InputDisabledT m)
MonadIO)
#ifndef ghcjs_HOST_OS
instance MonadJSM m => MonadJSM (InputDisabledT m) where
liftJSM' :: JSM a -> InputDisabledT m a
liftJSM' = m a -> InputDisabledT m a
forall (m :: * -> *) a. m a -> InputDisabledT m a
InputDisabledT (m a -> InputDisabledT m a)
-> (JSM a -> m a) -> JSM a -> InputDisabledT m a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. JSM a -> m a
forall (m :: * -> *) a. MonadJSM m => JSM a -> m a
liftJSM'
#endif
deriving instance MonadSample t m => MonadSample t (InputDisabledT m)
deriving instance MonadHold t m => MonadHold t (InputDisabledT m)
instance MonadTrans InputDisabledT where
lift :: m a -> InputDisabledT m a
lift = m a -> InputDisabledT m a
forall (m :: * -> *) a. m a -> InputDisabledT m a
InputDisabledT
instance MonadTransControl InputDisabledT where
type StT InputDisabledT a = a
liftWith :: (Run InputDisabledT -> m a) -> InputDisabledT m a
liftWith f :: Run InputDisabledT -> m a
f = m a -> InputDisabledT m a
forall (m :: * -> *) a. m a -> InputDisabledT m a
InputDisabledT (m a -> InputDisabledT m a) -> m a -> InputDisabledT m a
forall a b. (a -> b) -> a -> b
$ Run InputDisabledT -> m a
f Run InputDisabledT
forall (m :: * -> *) a. InputDisabledT m a -> m a
runInputDisabledT
restoreT :: m (StT InputDisabledT a) -> InputDisabledT m a
restoreT = m (StT InputDisabledT a) -> InputDisabledT m a
forall (m :: * -> *) a. m a -> InputDisabledT m a
InputDisabledT
instance MonadRef m => MonadRef (InputDisabledT m) where
type Ref (InputDisabledT m) = Ref m
newRef :: a -> InputDisabledT m (Ref (InputDisabledT m) a)
newRef = m (Ref m a) -> InputDisabledT m (Ref m a)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (m (Ref m a) -> InputDisabledT m (Ref m a))
-> (a -> m (Ref m a)) -> a -> InputDisabledT m (Ref m a)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. a -> m (Ref m a)
forall (m :: * -> *) a. MonadRef m => a -> m (Ref m a)
newRef
readRef :: Ref (InputDisabledT m) a -> InputDisabledT m a
readRef = m a -> InputDisabledT m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (m a -> InputDisabledT m a)
-> (Ref m a -> m a) -> Ref m a -> InputDisabledT m a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Ref m a -> m a
forall (m :: * -> *) a. MonadRef m => Ref m a -> m a
readRef
writeRef :: Ref (InputDisabledT m) a -> a -> InputDisabledT m ()
writeRef ref :: Ref (InputDisabledT m) a
ref = m () -> InputDisabledT m ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (m () -> InputDisabledT m ())
-> (a -> m ()) -> a -> InputDisabledT m ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Ref m a -> a -> m ()
forall (m :: * -> *) a. MonadRef m => Ref m a -> a -> m ()
writeRef Ref m a
Ref (InputDisabledT m) a
ref
instance PerformEvent t m => PerformEvent t (InputDisabledT m) where
type Performable (InputDisabledT m) = Performable m
performEvent_ :: Event t (Performable (InputDisabledT m) ()) -> InputDisabledT m ()
performEvent_ = m () -> InputDisabledT m ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (m () -> InputDisabledT m ())
-> (Event t (Performable m ()) -> m ())
-> Event t (Performable m ())
-> InputDisabledT m ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Event t (Performable m ()) -> m ()
forall t (m :: * -> *).
PerformEvent t m =>
Event t (Performable m ()) -> m ()
performEvent_
performEvent :: Event t (Performable (InputDisabledT m) a)
-> InputDisabledT m (Event t a)
performEvent = m (Event t a) -> InputDisabledT m (Event t a)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (m (Event t a) -> InputDisabledT m (Event t a))
-> (Event t (Performable m a) -> m (Event t a))
-> Event t (Performable m a)
-> InputDisabledT m (Event t a)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Event t (Performable m a) -> m (Event t a)
forall t (m :: * -> *) a.
PerformEvent t m =>
Event t (Performable m a) -> m (Event t a)
performEvent
instance PrimMonad m => PrimMonad (InputDisabledT m) where
type PrimState (InputDisabledT m) = PrimState m
primitive :: (State# (PrimState (InputDisabledT m))
-> (# State# (PrimState (InputDisabledT m)), a #))
-> InputDisabledT m a
primitive = m a -> InputDisabledT m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (m a -> InputDisabledT m a)
-> ((State# (PrimState m) -> (# State# (PrimState m), a #)) -> m a)
-> (State# (PrimState m) -> (# State# (PrimState m), a #))
-> InputDisabledT m a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (State# (PrimState m) -> (# State# (PrimState m), a #)) -> m a
forall (m :: * -> *) a.
PrimMonad m =>
(State# (PrimState m) -> (# State# (PrimState m), a #)) -> m a
primitive
disableElementConfig :: Reflex t => ElementConfig er t m -> ElementConfig er t m
disableElementConfig :: ElementConfig er t m -> ElementConfig er t m
disableElementConfig cfg :: ElementConfig er t m
cfg = ElementConfig er t m
cfg
{ _elementConfig_initialAttributes :: Map AttributeName Text
_elementConfig_initialAttributes = AttributeName
-> Text -> Map AttributeName Text -> Map AttributeName Text
forall k a. Ord k => k -> a -> Map k a -> Map k a
Map.insert "disabled" "disabled" (Map AttributeName Text -> Map AttributeName Text)
-> Map AttributeName Text -> Map AttributeName Text
forall a b. (a -> b) -> a -> b
$ ElementConfig er t m -> Map AttributeName Text
forall (er :: EventTag -> *) k1 (t :: k1) k2 (s :: k2).
ElementConfig er t s -> Map AttributeName Text
_elementConfig_initialAttributes ElementConfig er t m
cfg
, _elementConfig_modifyAttributes :: Maybe (Event t (Map AttributeName (Maybe Text)))
_elementConfig_modifyAttributes = (Map AttributeName (Maybe Text) -> Map AttributeName (Maybe Text))
-> Event t (Map AttributeName (Maybe Text))
-> Event t (Map AttributeName (Maybe Text))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (AttributeName
-> Map AttributeName (Maybe Text) -> Map AttributeName (Maybe Text)
forall k a. Ord k => k -> Map k a -> Map k a
Map.delete "disabled") (Event t (Map AttributeName (Maybe Text))
-> Event t (Map AttributeName (Maybe Text)))
-> Maybe (Event t (Map AttributeName (Maybe Text)))
-> Maybe (Event t (Map AttributeName (Maybe Text)))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ElementConfig er t m
-> Maybe (Event t (Map AttributeName (Maybe Text)))
forall (er :: EventTag -> *) k1 (t :: k1) k2 (s :: k2).
ElementConfig er t s
-> Maybe (Event t (Map AttributeName (Maybe Text)))
_elementConfig_modifyAttributes ElementConfig er t m
cfg
}
instance PostBuild t m => PostBuild t (InputDisabledT m) where
getPostBuild :: InputDisabledT m (Event t ())
getPostBuild = m (Event t ()) -> InputDisabledT m (Event t ())
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift m (Event t ())
forall t (m :: * -> *). PostBuild t m => m (Event t ())
getPostBuild
deriving instance TriggerEvent t m => TriggerEvent t (InputDisabledT m)
instance MonadReflexCreateTrigger t m => MonadReflexCreateTrigger t (InputDisabledT m) where
newEventWithTrigger :: (EventTrigger t a -> IO (IO ())) -> InputDisabledT m (Event t a)
newEventWithTrigger = m (Event t a) -> InputDisabledT m (Event t a)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (m (Event t a) -> InputDisabledT m (Event t a))
-> ((EventTrigger t a -> IO (IO ())) -> m (Event t a))
-> (EventTrigger t a -> IO (IO ()))
-> InputDisabledT m (Event t a)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (EventTrigger t a -> IO (IO ())) -> m (Event t a)
forall t (m :: * -> *) a.
MonadReflexCreateTrigger t m =>
(EventTrigger t a -> IO (IO ())) -> m (Event t a)
newEventWithTrigger
newFanEventWithTrigger :: (forall a. k a -> EventTrigger t a -> IO (IO ()))
-> InputDisabledT m (EventSelector t k)
newFanEventWithTrigger f :: forall a. k a -> EventTrigger t a -> IO (IO ())
f = m (EventSelector t k) -> InputDisabledT m (EventSelector t k)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (m (EventSelector t k) -> InputDisabledT m (EventSelector t k))
-> m (EventSelector t k) -> InputDisabledT m (EventSelector t k)
forall a b. (a -> b) -> a -> b
$ (forall a. k a -> EventTrigger t a -> IO (IO ()))
-> m (EventSelector t k)
forall t (m :: * -> *) (k :: * -> *).
(MonadReflexCreateTrigger t m, GCompare k) =>
(forall a. k a -> EventTrigger t a -> IO (IO ()))
-> m (EventSelector t k)
newFanEventWithTrigger forall a. k a -> EventTrigger t a -> IO (IO ())
f
instance Adjustable t m => Adjustable t (InputDisabledT m) where
runWithReplace :: InputDisabledT m a
-> Event t (InputDisabledT m b) -> InputDisabledT m (a, Event t b)
runWithReplace a0 :: InputDisabledT m a
a0 a' :: Event t (InputDisabledT m b)
a' = m (a, Event t b) -> InputDisabledT m (a, Event t b)
forall (m :: * -> *) a. m a -> InputDisabledT m a
InputDisabledT (m (a, Event t b) -> InputDisabledT m (a, Event t b))
-> m (a, Event t b) -> InputDisabledT m (a, Event t b)
forall a b. (a -> b) -> a -> b
$ m a -> Event t (m b) -> m (a, Event t b)
forall t (m :: * -> *) a b.
Adjustable t m =>
m a -> Event t (m b) -> m (a, Event t b)
runWithReplace (InputDisabledT m a -> m a
forall a b. Coercible a b => a -> b
coerce InputDisabledT m a
a0) (Event t (InputDisabledT m b) -> Event t (m b)
forall k (t :: k) a b.
(Reflex t, Coercible a b) =>
Event t a -> Event t b
coerceEvent Event t (InputDisabledT m b)
a')
traverseDMapWithKeyWithAdjust :: (forall a. k a -> v a -> InputDisabledT m (v' a))
-> DMap k v
-> Event t (PatchDMap k v)
-> InputDisabledT m (DMap k v', Event t (PatchDMap k v'))
traverseDMapWithKeyWithAdjust f :: forall a. k a -> v a -> InputDisabledT m (v' a)
f dm0 :: DMap k v
dm0 dm' :: Event t (PatchDMap k v)
dm' = m (DMap k v', Event t (PatchDMap k v'))
-> InputDisabledT m (DMap k v', Event t (PatchDMap k v'))
forall (m :: * -> *) a. m a -> InputDisabledT m a
InputDisabledT (m (DMap k v', Event t (PatchDMap k v'))
-> InputDisabledT m (DMap k v', Event t (PatchDMap k v')))
-> m (DMap k v', Event t (PatchDMap k v'))
-> InputDisabledT m (DMap k v', Event t (PatchDMap k v'))
forall a b. (a -> b) -> a -> b
$ (forall a. k a -> v a -> m (v' a))
-> DMap k v
-> Event t (PatchDMap k v)
-> m (DMap k v', Event t (PatchDMap k v'))
forall t (m :: * -> *) (k :: * -> *) (v :: * -> *) (v' :: * -> *).
(Adjustable t m, GCompare k) =>
(forall a. k a -> v a -> m (v' a))
-> DMap k v
-> Event t (PatchDMap k v)
-> m (DMap k v', Event t (PatchDMap k v'))
traverseDMapWithKeyWithAdjust (\k :: k a
k v :: v a
v -> InputDisabledT m (v' a) -> m (v' a)
forall (m :: * -> *) a. InputDisabledT m a -> m a
runInputDisabledT (InputDisabledT m (v' a) -> m (v' a))
-> InputDisabledT m (v' a) -> m (v' a)
forall a b. (a -> b) -> a -> b
$ k a -> v a -> InputDisabledT m (v' a)
forall a. k a -> v a -> InputDisabledT m (v' a)
f k a
k v a
v) (DMap k v -> DMap k v
forall a b. Coercible a b => a -> b
coerce DMap k v
dm0) (Event t (PatchDMap k v) -> Event t (PatchDMap k v)
forall k (t :: k) a b.
(Reflex t, Coercible a b) =>
Event t a -> Event t b
coerceEvent Event t (PatchDMap k v)
dm')
traverseDMapWithKeyWithAdjustWithMove :: (forall a. k a -> v a -> InputDisabledT m (v' a))
-> DMap k v
-> Event t (PatchDMapWithMove k v)
-> InputDisabledT m (DMap k v', Event t (PatchDMapWithMove k v'))
traverseDMapWithKeyWithAdjustWithMove f :: forall a. k a -> v a -> InputDisabledT m (v' a)
f dm0 :: DMap k v
dm0 dm' :: Event t (PatchDMapWithMove k v)
dm' = m (DMap k v', Event t (PatchDMapWithMove k v'))
-> InputDisabledT m (DMap k v', Event t (PatchDMapWithMove k v'))
forall (m :: * -> *) a. m a -> InputDisabledT m a
InputDisabledT (m (DMap k v', Event t (PatchDMapWithMove k v'))
-> InputDisabledT m (DMap k v', Event t (PatchDMapWithMove k v')))
-> m (DMap k v', Event t (PatchDMapWithMove k v'))
-> InputDisabledT m (DMap k v', Event t (PatchDMapWithMove k v'))
forall a b. (a -> b) -> a -> b
$ (forall a. k a -> v a -> m (v' a))
-> DMap k v
-> Event t (PatchDMapWithMove k v)
-> m (DMap k v', Event t (PatchDMapWithMove k v'))
forall t (m :: * -> *) (k :: * -> *) (v :: * -> *) (v' :: * -> *).
(Adjustable t m, GCompare k) =>
(forall a. k a -> v a -> m (v' a))
-> DMap k v
-> Event t (PatchDMapWithMove k v)
-> m (DMap k v', Event t (PatchDMapWithMove k v'))
traverseDMapWithKeyWithAdjustWithMove (\k :: k a
k v :: v a
v -> InputDisabledT m (v' a) -> m (v' a)
forall (m :: * -> *) a. InputDisabledT m a -> m a
runInputDisabledT (InputDisabledT m (v' a) -> m (v' a))
-> InputDisabledT m (v' a) -> m (v' a)
forall a b. (a -> b) -> a -> b
$ k a -> v a -> InputDisabledT m (v' a)
forall a. k a -> v a -> InputDisabledT m (v' a)
f k a
k v a
v) (DMap k v -> DMap k v
forall a b. Coercible a b => a -> b
coerce DMap k v
dm0) (Event t (PatchDMapWithMove k v) -> Event t (PatchDMapWithMove k v)
forall k (t :: k) a b.
(Reflex t, Coercible a b) =>
Event t a -> Event t b
coerceEvent Event t (PatchDMapWithMove k v)
dm')
traverseIntMapWithKeyWithAdjust :: (Key -> v -> InputDisabledT m v')
-> IntMap v
-> Event t (PatchIntMap v)
-> InputDisabledT m (IntMap v', Event t (PatchIntMap v'))
traverseIntMapWithKeyWithAdjust f :: Key -> v -> InputDisabledT m v'
f m0 :: IntMap v
m0 m' :: Event t (PatchIntMap v)
m' = m (IntMap v', Event t (PatchIntMap v'))
-> InputDisabledT m (IntMap v', Event t (PatchIntMap v'))
forall (m :: * -> *) a. m a -> InputDisabledT m a
InputDisabledT (m (IntMap v', Event t (PatchIntMap v'))
-> InputDisabledT m (IntMap v', Event t (PatchIntMap v')))
-> m (IntMap v', Event t (PatchIntMap v'))
-> InputDisabledT m (IntMap v', Event t (PatchIntMap v'))
forall a b. (a -> b) -> a -> b
$ (Key -> v -> m v')
-> IntMap v
-> Event t (PatchIntMap v)
-> m (IntMap v', Event t (PatchIntMap v'))
forall t (m :: * -> *) v v'.
Adjustable t m =>
(Key -> v -> m v')
-> IntMap v
-> Event t (PatchIntMap v)
-> m (IntMap v', Event t (PatchIntMap v'))
traverseIntMapWithKeyWithAdjust (\k :: Key
k v :: v
v -> InputDisabledT m v' -> m v'
forall (m :: * -> *) a. InputDisabledT m a -> m a
runInputDisabledT (InputDisabledT m v' -> m v') -> InputDisabledT m v' -> m v'
forall a b. (a -> b) -> a -> b
$ Key -> v -> InputDisabledT m v'
f Key
k v
v) (IntMap v -> IntMap v
forall a b. Coercible a b => a -> b
coerce IntMap v
m0) (Event t (PatchIntMap v) -> Event t (PatchIntMap v)
forall k (t :: k) a b.
(Reflex t, Coercible a b) =>
Event t a -> Event t b
coerceEvent Event t (PatchIntMap v)
m')
instance NotReady t m => NotReady t (InputDisabledT m) where
notReadyUntil :: Event t a -> InputDisabledT m ()
notReadyUntil = m () -> InputDisabledT m ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (m () -> InputDisabledT m ())
-> (Event t a -> m ()) -> Event t a -> InputDisabledT m ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Event t a -> m ()
forall t (m :: * -> *) a. NotReady t m => Event t a -> m ()
notReadyUntil
notReady :: InputDisabledT m ()
notReady = m () -> InputDisabledT m ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift m ()
forall t (m :: * -> *). NotReady t m => m ()
notReady
instance DomBuilder t m => DomBuilder t (InputDisabledT m) where
type DomBuilderSpace (InputDisabledT m) = DomBuilderSpace m
inputElement :: InputElementConfig er t (DomBuilderSpace (InputDisabledT m))
-> InputDisabledT
m (InputElement er (DomBuilderSpace (InputDisabledT m)) t)
inputElement cfg :: InputElementConfig er t (DomBuilderSpace (InputDisabledT m))
cfg = m (InputElement er (DomBuilderSpace m) t)
-> InputDisabledT
m (InputElement er (DomBuilderSpace (InputDisabledT m)) t)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (m (InputElement er (DomBuilderSpace m) t)
-> InputDisabledT
m (InputElement er (DomBuilderSpace (InputDisabledT m)) t))
-> m (InputElement er (DomBuilderSpace m) t)
-> InputDisabledT
m (InputElement er (DomBuilderSpace (InputDisabledT m)) t)
forall a b. (a -> b) -> a -> b
$ InputElementConfig er t (DomBuilderSpace m)
-> m (InputElement er (DomBuilderSpace m) t)
forall t (m :: * -> *) (er :: EventTag -> *).
DomBuilder t m =>
InputElementConfig er t (DomBuilderSpace m)
-> m (InputElement er (DomBuilderSpace m) t)
inputElement (InputElementConfig er t (DomBuilderSpace m)
-> m (InputElement er (DomBuilderSpace m) t))
-> InputElementConfig er t (DomBuilderSpace m)
-> m (InputElement er (DomBuilderSpace m) t)
forall a b. (a -> b) -> a -> b
$ InputElementConfig er t (DomBuilderSpace m)
InputElementConfig er t (DomBuilderSpace (InputDisabledT m))
cfg
{ _inputElementConfig_elementConfig :: ElementConfig er t (DomBuilderSpace m)
_inputElementConfig_elementConfig = ElementConfig er t (DomBuilderSpace m)
-> ElementConfig er t (DomBuilderSpace m)
forall t (er :: EventTag -> *) m.
Reflex t =>
ElementConfig er t m -> ElementConfig er t m
disableElementConfig (ElementConfig er t (DomBuilderSpace m)
-> ElementConfig er t (DomBuilderSpace m))
-> ElementConfig er t (DomBuilderSpace m)
-> ElementConfig er t (DomBuilderSpace m)
forall a b. (a -> b) -> a -> b
$ InputElementConfig er t (DomBuilderSpace m)
-> ElementConfig er t (DomBuilderSpace m)
forall (er :: EventTag -> *) k1 (t :: k1) k2 (s :: k2).
InputElementConfig er t s -> ElementConfig er t s
_inputElementConfig_elementConfig InputElementConfig er t (DomBuilderSpace m)
InputElementConfig er t (DomBuilderSpace (InputDisabledT m))
cfg
}
textAreaElement :: TextAreaElementConfig er t (DomBuilderSpace (InputDisabledT m))
-> InputDisabledT
m (TextAreaElement er (DomBuilderSpace (InputDisabledT m)) t)
textAreaElement cfg :: TextAreaElementConfig er t (DomBuilderSpace (InputDisabledT m))
cfg = m (TextAreaElement er (DomBuilderSpace m) t)
-> InputDisabledT
m (TextAreaElement er (DomBuilderSpace (InputDisabledT m)) t)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (m (TextAreaElement er (DomBuilderSpace m) t)
-> InputDisabledT
m (TextAreaElement er (DomBuilderSpace (InputDisabledT m)) t))
-> m (TextAreaElement er (DomBuilderSpace m) t)
-> InputDisabledT
m (TextAreaElement er (DomBuilderSpace (InputDisabledT m)) t)
forall a b. (a -> b) -> a -> b
$ TextAreaElementConfig er t (DomBuilderSpace m)
-> m (TextAreaElement er (DomBuilderSpace m) t)
forall t (m :: * -> *) (er :: EventTag -> *).
DomBuilder t m =>
TextAreaElementConfig er t (DomBuilderSpace m)
-> m (TextAreaElement er (DomBuilderSpace m) t)
textAreaElement (TextAreaElementConfig er t (DomBuilderSpace m)
-> m (TextAreaElement er (DomBuilderSpace m) t))
-> TextAreaElementConfig er t (DomBuilderSpace m)
-> m (TextAreaElement er (DomBuilderSpace m) t)
forall a b. (a -> b) -> a -> b
$ TextAreaElementConfig er t (DomBuilderSpace m)
TextAreaElementConfig er t (DomBuilderSpace (InputDisabledT m))
cfg
{ _textAreaElementConfig_elementConfig :: ElementConfig er t (DomBuilderSpace m)
_textAreaElementConfig_elementConfig = ElementConfig er t (DomBuilderSpace m)
-> ElementConfig er t (DomBuilderSpace m)
forall t (er :: EventTag -> *) m.
Reflex t =>
ElementConfig er t m -> ElementConfig er t m
disableElementConfig (ElementConfig er t (DomBuilderSpace m)
-> ElementConfig er t (DomBuilderSpace m))
-> ElementConfig er t (DomBuilderSpace m)
-> ElementConfig er t (DomBuilderSpace m)
forall a b. (a -> b) -> a -> b
$ TextAreaElementConfig er t (DomBuilderSpace m)
-> ElementConfig er t (DomBuilderSpace m)
forall (er :: EventTag -> *) k1 (t :: k1) k2 (m :: k2).
TextAreaElementConfig er t m -> ElementConfig er t m
_textAreaElementConfig_elementConfig TextAreaElementConfig er t (DomBuilderSpace m)
TextAreaElementConfig er t (DomBuilderSpace (InputDisabledT m))
cfg
}
selectElement :: SelectElementConfig er t (DomBuilderSpace (InputDisabledT m))
-> InputDisabledT m a
-> InputDisabledT
m (SelectElement er (DomBuilderSpace (InputDisabledT m)) t, a)
selectElement cfg :: SelectElementConfig er t (DomBuilderSpace (InputDisabledT m))
cfg child :: InputDisabledT m a
child = do
let cfg' :: SelectElementConfig er t (DomBuilderSpace m)
cfg' = SelectElementConfig er t (DomBuilderSpace m)
SelectElementConfig er t (DomBuilderSpace (InputDisabledT m))
cfg
{ _selectElementConfig_elementConfig :: ElementConfig er t (DomBuilderSpace m)
_selectElementConfig_elementConfig = ElementConfig er t (DomBuilderSpace m)
-> ElementConfig er t (DomBuilderSpace m)
forall t (er :: EventTag -> *) m.
Reflex t =>
ElementConfig er t m -> ElementConfig er t m
disableElementConfig (ElementConfig er t (DomBuilderSpace m)
-> ElementConfig er t (DomBuilderSpace m))
-> ElementConfig er t (DomBuilderSpace m)
-> ElementConfig er t (DomBuilderSpace m)
forall a b. (a -> b) -> a -> b
$ SelectElementConfig er t (DomBuilderSpace m)
-> ElementConfig er t (DomBuilderSpace m)
forall (er :: EventTag -> *) k1 (t :: k1) k2 (m :: k2).
SelectElementConfig er t m -> ElementConfig er t m
_selectElementConfig_elementConfig SelectElementConfig er t (DomBuilderSpace m)
SelectElementConfig er t (DomBuilderSpace (InputDisabledT m))
cfg
}
m (SelectElement er (DomBuilderSpace m) t, a)
-> InputDisabledT
m (SelectElement er (DomBuilderSpace (InputDisabledT m)) t, a)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (m (SelectElement er (DomBuilderSpace m) t, a)
-> InputDisabledT
m (SelectElement er (DomBuilderSpace (InputDisabledT m)) t, a))
-> m (SelectElement er (DomBuilderSpace m) t, a)
-> InputDisabledT
m (SelectElement er (DomBuilderSpace (InputDisabledT m)) t, a)
forall a b. (a -> b) -> a -> b
$ SelectElementConfig er t (DomBuilderSpace m)
-> m a -> m (SelectElement er (DomBuilderSpace m) t, a)
forall t (m :: * -> *) (er :: EventTag -> *) a.
DomBuilder t m =>
SelectElementConfig er t (DomBuilderSpace m)
-> m a -> m (SelectElement er (DomBuilderSpace m) t, a)
selectElement SelectElementConfig er t (DomBuilderSpace m)
cfg' (m a -> m (SelectElement er (DomBuilderSpace m) t, a))
-> m a -> m (SelectElement er (DomBuilderSpace m) t, a)
forall a b. (a -> b) -> a -> b
$ InputDisabledT m a -> m a
forall (m :: * -> *) a. InputDisabledT m a -> m a
runInputDisabledT InputDisabledT m a
child
instance HasDocument m => HasDocument (InputDisabledT m)
instance HasJSContext m => HasJSContext (InputDisabledT m) where
type JSContextPhantom (InputDisabledT m) = JSContextPhantom m
askJSContext :: InputDisabledT
m (JSContextSingleton (JSContextPhantom (InputDisabledT m)))
askJSContext = m (JSContextSingleton (JSContextPhantom m))
-> InputDisabledT m (JSContextSingleton (JSContextPhantom m))
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift m (JSContextSingleton (JSContextPhantom m))
forall (m :: * -> *).
HasJSContext m =>
m (JSContextSingleton (JSContextPhantom m))
askJSContext
instance HasJS js m => HasJS js (InputDisabledT m) where
type JSX (InputDisabledT m) = JSX m
liftJS :: JSX (InputDisabledT m) a -> InputDisabledT m a
liftJS = m a -> InputDisabledT m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (m a -> InputDisabledT m a)
-> (JSX m a -> m a) -> JSX m a -> InputDisabledT m a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. JSX m a -> m a
forall x (m :: * -> *) a. HasJS x m => JSX m a -> m a
liftJS
instance DomRenderHook t m => DomRenderHook t (InputDisabledT m) where
withRenderHook :: (forall x. JSM x -> JSM x)
-> InputDisabledT m a -> InputDisabledT m a
withRenderHook f :: forall x. JSM x -> JSM x
f = m a -> InputDisabledT m a
forall (m :: * -> *) a. m a -> InputDisabledT m a
InputDisabledT (m a -> InputDisabledT m a)
-> (InputDisabledT m a -> m a)
-> InputDisabledT m a
-> InputDisabledT m a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (forall x. JSM x -> JSM x) -> m a -> m a
forall k (t :: k) (m :: * -> *) a.
DomRenderHook t m =>
(forall x. JSM x -> JSM x) -> m a -> m a
withRenderHook forall x. JSM x -> JSM x
f (m a -> m a)
-> (InputDisabledT m a -> m a) -> InputDisabledT m a -> m a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. InputDisabledT m a -> m a
forall (m :: * -> *) a. InputDisabledT m a -> m a
runInputDisabledT
requestDomAction :: Event t (JSM a) -> InputDisabledT m (Event t a)
requestDomAction = m (Event t a) -> InputDisabledT m (Event t a)
forall (m :: * -> *) a. m a -> InputDisabledT m a
InputDisabledT (m (Event t a) -> InputDisabledT m (Event t a))
-> (Event t (JSM a) -> m (Event t a))
-> Event t (JSM a)
-> InputDisabledT m (Event t a)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Event t (JSM a) -> m (Event t a)
forall k (t :: k) (m :: * -> *) a.
DomRenderHook t m =>
Event t (JSM a) -> m (Event t a)
requestDomAction
requestDomAction_ :: Event t (JSM a) -> InputDisabledT m ()
requestDomAction_ = m () -> InputDisabledT m ()
forall (m :: * -> *) a. m a -> InputDisabledT m a
InputDisabledT (m () -> InputDisabledT m ())
-> (Event t (JSM a) -> m ())
-> Event t (JSM a)
-> InputDisabledT m ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Event t (JSM a) -> m ()
forall k (t :: k) (m :: * -> *) a.
DomRenderHook t m =>
Event t (JSM a) -> m ()
requestDomAction_