-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | Generic widget library using glazier-react
--
-- Generic widget library using glazier-react. Please see README.md.
@package glazier-react-widget
@version 1.0.0.0
module Glazier.React.Action.KeyDownKey
data KeyDownKey
KeyDownKey :: EventTarget -> JSString -> KeyDownKey
fireKeyDownKey :: Notice -> MaybeT IO KeyDownKey
instance Control.DeepSeq.NFData Glazier.React.Action.KeyDownKey.KeyDownKey
instance GHC.Generics.Generic Glazier.React.Action.KeyDownKey.KeyDownKey
-- | Actions are things usually used in Triggers
module Glazier.React.Action
module Glazier.React.Effect.HTMLElement
type AsHTMLElement cmd = AsFacet HTMLElementCmd cmd
data HTMLElementCmd
Focus :: EventTarget -> HTMLElementCmd
Blur :: EventTarget -> HTMLElementCmd
instance GHC.Show.Show Glazier.React.Effect.HTMLElement.HTMLElementCmd
module Glazier.React.Effect.HTMLElement.Exec
execHTMLElementCmd :: (MonadIO m) => HTMLElementCmd -> m ()
js_focus :: EventTarget -> IO ()
js_blur :: EventTarget -> IO ()
module Glazier.React.Effect.JavaScript
type AsJavascript cmd = AsFacet (JavaScriptCmd cmd) cmd
data JavaScriptCmd cmd
[SetProperty] :: ToJS j => Property -> j -> JavaScriptCmd c
[GetProperty] :: ToJS j => JSString -> j -> (JSRep -> cmd) -> JavaScriptCmd cmd
maybeGetProperty :: (AsJavascript cmd, MonadCommand cmd m, FromJS a, ToJS j) => JSString -> j -> MaybeT m a
instance GHC.Show.Show (Glazier.React.Effect.JavaScript.JavaScriptCmd cmd)
module Glazier.React.Effect.JavaScript.Exec
execJavascript :: MonadIO m => (c -> m ()) -> JavaScriptCmd c -> m ()
module Glazier.React.Effect
module Glazier.React.Widgets.Collection
-- | A key where you can always create another key ordered between two
-- different keys, or another key above or below this key. Memonic: U for
-- uncountable https://en.wikipedia.org/wiki/Uncountable_set
data UKey
zeroUKey :: UKey
-- | Create a key smaller than the input key.
smallerUKey :: UKey -> UKey
-- | Create a key larger than the input key.
largerUKey :: UKey -> UKey
-- | Make a key that will fit in between the two provided keys, with no
-- guarantees on how close it is to the mid point. Except when the inputs
-- are equal, then it will return the same key.
betweenUKey :: UKey -> UKey -> UKey
-- | Collection of higher kinded data
type Collection t s f = t (HKD f s)
-- | Collection of higher kinded "higher kinded data"
type HKCollection t s f = t (HKD f (s f))
-- | Collection doesn't have an initializing gadget since the
-- Subjects in the model are all initialized via
-- addSubject.
collectionWindow :: (Functor t, Foldable t) => ReactId -> Window (t (Subject s)) ()
deleteCollectionItem :: (MonadReactor p allS cmd m, Ord k) => k -> ModelState (Map k (Subject s)) (m ())
insertCollectionItem :: (MonadReactor p allS cmd m, Ord k) => k -> Subject s -> ModelState (Map k (Subject s)) (m ())
instance GHC.Show.Show Glazier.React.Widgets.Collection.UKey
instance GHC.Generics.Generic Glazier.React.Widgets.Collection.UKey
instance GHC.Classes.Ord Glazier.React.Widgets.Collection.UKey
instance GHC.Classes.Eq Glazier.React.Widgets.Collection.UKey
module Glazier.React.Widgets.Collection.Dynamic
-- | Contains information on sorting and filtering the items in a
-- collection differerently from the native data structure.
data DynamicCollection ftr srt k a f
DynamicCollection :: ftr -> srt -> [HKD f a] -> Map k (HKD f a) -> DynamicCollection ftr srt k a f
[filterCriteria] :: DynamicCollection ftr srt k a f -> ftr
[sortCriteria] :: DynamicCollection ftr srt k a f -> srt
[visibleList] :: DynamicCollection ftr srt k a f -> [HKD f a]
[rawCollection] :: DynamicCollection ftr srt k a f -> Map k (HKD f a)
type HKDynamicCollection ftr srt k a f = DynamicCollection ftr srt k (a f) f
_filterCriteria :: forall ftr_anPY srt_anPZ k_anQ0 a_anQ1 f_anQ2 ftr_ao4L. Lens (DynamicCollection ftr_anPY srt_anPZ k_anQ0 a_anQ1 f_anQ2) (DynamicCollection ftr_ao4L srt_anPZ k_anQ0 a_anQ1 f_anQ2) ftr_anPY ftr_ao4L
_sortCriteria :: forall ftr_anPY srt_anPZ k_anQ0 a_anQ1 f_anQ2 srt_ao4N. Lens (DynamicCollection ftr_anPY srt_anPZ k_anQ0 a_anQ1 f_anQ2) (DynamicCollection ftr_anPY srt_ao4N k_anQ0 a_anQ1 f_anQ2) srt_anPZ srt_ao4N
_visibleList :: forall ftr_anPY srt_anPZ k_anQ0 a_anQ1 f_anQ2. Lens' (DynamicCollection ftr_anPY srt_anPZ k_anQ0 a_anQ1 f_anQ2) [HKD f_anQ2 a_anQ1]
_rawCollection :: forall ftr_anPY srt_anPZ k_anQ0 a_anQ1 f_anQ2 k_ao4M. Lens (DynamicCollection ftr_anPY srt_anPZ k_anQ0 a_anQ1 f_anQ2) (DynamicCollection ftr_anPY srt_anPZ k_ao4M a_anQ1 f_anQ2) (Map k_anQ0 (HKD f_anQ2 a_anQ1)) (Map k_ao4M (HKD f_anQ2 a_anQ1))
dynamicCollectionWindow :: ReactId -> Window (DynamicCollection ftr srt k s Subject) ()
updateVisibleList :: (ftr -> s -> ReadIORef Bool) -> (srt -> s -> s -> ReadIORef Ordering) -> ModelState (DynamicCollection ftr srt k s Subject) ()
deleteDynamicCollectionItem :: (MonadReactor p allS cmd m, Ord k) => k -> ModelState (DynamicCollection ftr srt k s Subject) (m ())
insertDynamicCollectionItem :: (MonadReactor p allS cmd m, Ord k) => k -> Subject s -> ModelState (DynamicCollection ftr srt k s Subject) (m ())
instance GHC.Generics.Generic (Glazier.React.Widgets.Collection.Dynamic.DynamicCollection ftr srt k a f)
module Glazier.React.Widgets.Input
-- | Text inputs dosn't interact well as a React controlled component. Eg.
-- cursor jumps if user types quickly. I think there a timing issue with
-- lazy event handlers setting the value, So this prototype uses the
-- React uncontrolled component (using defaultValue instead of value).
--
-- For input, React uses controlled input if input.value is not null.
--
-- This widget attempts to set the cursor position at the correct place
-- by using a diffing algorithm on the old and new value.
--
-- Warning: This widget listens to onChange and will update the model
-- value with the DOM input value. potentially overridding any user
-- changes. So when changing the model value, be sure that the onChange
-- handler will not be called.
textInput :: (AsReactor cmd, AsJavascript cmd) => ReactId -> Widget cmd p JSString (InputChange ())
-- | This is a 'React controlled' checkbox. For checkboxes, React uses
-- controlled checkbox if input.checked is not null
-- https://stackoverflow.com/questions/37427508/react-changing-an-uncontrolled-input
checkboxInput :: (AsReactor cmd) => ReactId -> Widget cmd p Bool (InputChange ())
data IndeterminateCheckboxInput
IndeterminateCheckboxInput :: Bool -> Bool -> IndeterminateCheckboxInput
[checked] :: IndeterminateCheckboxInput -> Bool
[indeterminate] :: IndeterminateCheckboxInput -> Bool
-- | Variation of checkboxInput supporting indeterminate state.
indeterminateCheckboxInput :: (AsReactor cmd, AsJavascript cmd) => ReactId -> Widget cmd p IndeterminateCheckboxInput (InputChange ())
instance GHC.Classes.Ord Glazier.React.Widgets.Input.IndeterminateCheckboxInput
instance GHC.Classes.Eq Glazier.React.Widgets.Input.IndeterminateCheckboxInput
instance GHC.Show.Show Glazier.React.Widgets.Input.IndeterminateCheckboxInput
instance GHC.Generics.Generic Glazier.React.Widgets.Input.IndeterminateCheckboxInput