Safe Haskell | None |
---|---|
Language | Haskell98 |
- type AttributeMap = Map String String
- data ElConfig attrs = ElConfig {
- _elConfig_namespace :: Maybe String
- _elConfig_attributes :: attrs
- elConfig_namespace :: forall attrs. Lens' (ElConfig attrs) (Maybe String)
- elConfig_attributes :: forall attrs attrs. Lens (ElConfig attrs) (ElConfig attrs) attrs attrs
- data El t = El {}
- class Attributes m a where
- addAttributes :: IsElement e => a -> e -> m ()
- buildEmptyElementNS :: (MonadWidget t m, Attributes m attrs) => Maybe String -> String -> attrs -> m Element
- buildEmptyElement :: (MonadWidget t m, Attributes m attrs) => String -> attrs -> m Element
- buildElementNS :: (MonadWidget t m, Attributes m attrs) => Maybe String -> String -> attrs -> m a -> m (Element, a)
- buildElement :: (MonadWidget t m, Attributes m attrs) => String -> attrs -> m a -> m (Element, a)
- namedNodeMapGetNames :: NamedNodeMap -> IO (Set String)
- text :: MonadWidget t m => String -> m ()
- text' :: MonadWidget t m => String -> m Text
- dynText :: MonadWidget t m => Dynamic t String -> m ()
- display :: (MonadWidget t m, Show a) => Dynamic t a -> m ()
- dyn :: MonadWidget t m => Dynamic t (m a) -> m (Event t a)
- widgetHold :: MonadWidget t m => m a -> Event t (m a) -> m (Dynamic t a)
- widgetHoldInternal :: MonadWidget t m => m a -> Event t (m b) -> m (a, Event t b)
- diffMapNoEq :: Ord k => Map k v -> Map k v -> Map k (Maybe v)
- applyMap :: Ord k => Map k v -> Map k (Maybe v) -> Map k v
- listWithKey :: forall t k v m a. (Ord k, MonadWidget t m) => Dynamic t (Map k v) -> (k -> Dynamic t v -> m a) -> m (Dynamic t (Map k a))
- listWithKey' :: (Ord k, MonadWidget t m) => Map k v -> Event t (Map k (Maybe v)) -> (k -> v -> Event t v -> m a) -> m (Dynamic t (Map k a))
- listWithKeyShallowDiff :: (Ord k, MonadWidget t m) => Map k v -> Event t (Map k (Maybe v)) -> (k -> v -> Event t v -> m a) -> m (Dynamic t (Map k a))
- listHoldWithKey :: (Ord k, MonadWidget t m) => Map k v -> Event t (Map k (Maybe v)) -> (k -> v -> m a) -> m (Dynamic t (Map k a))
- listViewWithKey :: (Ord k, MonadWidget t m) => Dynamic t (Map k v) -> (k -> Dynamic t v -> m (Event t a)) -> m (Event t (Map k a))
- listViewWithKey' :: (Ord k, MonadWidget t m) => Dynamic t (Map k v) -> (k -> Dynamic t v -> m a) -> m (Behavior t (Map k a))
- selectViewListWithKey :: forall t m k v a. (MonadWidget t m, Ord k) => Dynamic t k -> Dynamic t (Map k v) -> (k -> Dynamic t v -> Dynamic t Bool -> m (Event t a)) -> m (Event t (k, a))
- selectViewListWithKey_ :: forall t m k v a. (MonadWidget t m, Ord k) => Dynamic t k -> Dynamic t (Map k v) -> (k -> Dynamic t v -> Dynamic t Bool -> m (Event t a)) -> m (Event t k)
- deleteBetweenExclusive :: (IsNode start, IsNode end) => start -> end -> IO ()
- deleteBetweenInclusive :: (IsNode start, IsNode end) => start -> end -> IO ()
- nodeClear :: IsNode self => self -> IO ()
- wrapDomEvent :: (Functor (Event t), MonadIO m, MonadSample t m, MonadReflexCreateTrigger t m, Reflex t, HasPostGui t h m) => e -> (e -> EventM e event () -> IO (IO ())) -> EventM e event a -> m (Event t a)
- wrapDomEventMaybe :: (Functor (Event t), MonadIO m, MonadSample t m, MonadReflexCreateTrigger t m, Reflex t, HasPostGui t h m) => e -> (e -> EventM e event () -> IO (IO ())) -> EventM e event (Maybe a) -> m (Event t a)
- data EventTag
- = AbortTag
- | BlurTag
- | ChangeTag
- | ClickTag
- | ContextmenuTag
- | DblclickTag
- | DragTag
- | DragendTag
- | DragenterTag
- | DragleaveTag
- | DragoverTag
- | DragstartTag
- | DropTag
- | ErrorTag
- | FocusTag
- | InputTag
- | InvalidTag
- | KeydownTag
- | KeypressTag
- | KeyupTag
- | LoadTag
- | MousedownTag
- | MouseenterTag
- | MouseleaveTag
- | MousemoveTag
- | MouseoutTag
- | MouseoverTag
- | MouseupTag
- | MousewheelTag
- | ScrollTag
- | SelectTag
- | SubmitTag
- | WheelTag
- | BeforecutTag
- | CutTag
- | BeforecopyTag
- | CopyTag
- | BeforepasteTag
- | PasteTag
- | ResetTag
- | SearchTag
- | SelectstartTag
- | TouchstartTag
- | TouchmoveTag
- | TouchendTag
- | TouchcancelTag
- data EventName :: EventTag -> * where
- Abort :: EventName AbortTag
- Blur :: EventName BlurTag
- Change :: EventName ChangeTag
- Click :: EventName ClickTag
- Contextmenu :: EventName ContextmenuTag
- Dblclick :: EventName DblclickTag
- Drag :: EventName DragTag
- Dragend :: EventName DragendTag
- Dragenter :: EventName DragenterTag
- Dragleave :: EventName DragleaveTag
- Dragover :: EventName DragoverTag
- Dragstart :: EventName DragstartTag
- Drop :: EventName DropTag
- Error :: EventName ErrorTag
- Focus :: EventName FocusTag
- Input :: EventName InputTag
- Invalid :: EventName InvalidTag
- Keydown :: EventName KeydownTag
- Keypress :: EventName KeypressTag
- Keyup :: EventName KeyupTag
- Load :: EventName LoadTag
- Mousedown :: EventName MousedownTag
- Mouseenter :: EventName MouseenterTag
- Mouseleave :: EventName MouseleaveTag
- Mousemove :: EventName MousemoveTag
- Mouseout :: EventName MouseoutTag
- Mouseover :: EventName MouseoverTag
- Mouseup :: EventName MouseupTag
- Mousewheel :: EventName MousewheelTag
- Scroll :: EventName ScrollTag
- Select :: EventName SelectTag
- Submit :: EventName SubmitTag
- Wheel :: EventName WheelTag
- Beforecut :: EventName BeforecutTag
- Cut :: EventName CutTag
- Beforecopy :: EventName BeforecopyTag
- Copy :: EventName CopyTag
- Beforepaste :: EventName BeforepasteTag
- Paste :: EventName PasteTag
- Reset :: EventName ResetTag
- Search :: EventName SearchTag
- Selectstart :: EventName SelectstartTag
- Touchstart :: EventName TouchstartTag
- Touchmove :: EventName TouchmoveTag
- Touchend :: EventName TouchendTag
- Touchcancel :: EventName TouchcancelTag
- type family EventType en
- onEventName :: IsElement e => EventName en -> e -> EventM e (EventType en) () -> IO (IO ())
- newtype EventResult en = EventResult {
- unEventResult :: EventResultType en
- type family EventResultType en :: *
- wrapDomEventsMaybe :: (Functor (Event t), IsElement e, MonadIO m, MonadSample t m, MonadReflexCreateTrigger t m, Reflex t, HasPostGui t h m) => e -> (forall en. EventName en -> EventM e (EventType en) (Maybe (f en))) -> m (EventSelector t (WrapArg f EventName))
- getKeyEvent :: EventM e KeyboardEvent Int
- getMouseEventCoords :: EventM e MouseEvent (Int, Int)
- defaultDomEventHandler :: IsElement e => e -> EventName en -> EventM e (EventType en) (Maybe (EventResult en))
- wrapElement :: forall t h m. (Functor (Event t), MonadIO m, MonadSample t m, MonadReflexCreateTrigger t m, Reflex t, HasPostGui t h m) => (forall en. Element -> EventName en -> EventM Element (EventType en) (Maybe (EventResult en))) -> Element -> m (El t)
- elStopPropagationNS :: (MonadWidget t m, IsEvent (EventType en)) => Maybe String -> String -> EventName en -> m a -> m a
- elWith :: (MonadWidget t m, Attributes m attrs) => String -> ElConfig attrs -> m a -> m a
- elWith' :: (MonadWidget t m, Attributes m attrs) => String -> ElConfig attrs -> m a -> m (El t, a)
- emptyElWith :: (MonadWidget t m, Attributes m attrs) => String -> ElConfig attrs -> m ()
- emptyElWith' :: (MonadWidget t m, Attributes m attrs) => String -> ElConfig attrs -> m (El t)
- elDynAttrNS' :: forall t m a. MonadWidget t m => Maybe String -> String -> Dynamic t (Map String String) -> m a -> m (El t, a)
- elDynAttr' :: forall t m a. MonadWidget t m => String -> Dynamic t (Map String String) -> m a -> m (El t, a)
- elAttr :: forall t m a. MonadWidget t m => String -> Map String String -> m a -> m a
- el' :: forall t m a. MonadWidget t m => String -> m a -> m (El t, a)
- elAttr' :: forall t m a. MonadWidget t m => String -> Map String String -> m a -> m (El t, a)
- elDynAttr :: forall t m a. MonadWidget t m => String -> Dynamic t (Map String String) -> m a -> m a
- el :: forall t m a. MonadWidget t m => String -> m a -> m a
- elClass :: forall t m a. MonadWidget t m => String -> String -> m a -> m a
- list :: (MonadWidget t m, Ord k) => Dynamic t (Map k v) -> (Dynamic t v -> m a) -> m (Dynamic t (Map k a))
- simpleList :: MonadWidget t m => Dynamic t [v] -> (Dynamic t v -> m a) -> m (Dynamic t [a])
- elDynHtml' :: MonadWidget t m => String -> Dynamic t String -> m (El t)
- elDynHtmlAttr' :: MonadWidget t m => String -> Map String String -> Dynamic t String -> m (El t)
- data Link t = Link {
- _link_clicked :: Event t ()
- class HasAttributes a where
- type Attrs a :: *
- attributes :: Lens' a (Attrs a)
- class HasNamespace a where
- class HasDomEvent t a where
- domEvent :: EventName en -> a -> Event t (EventResultType en)
- linkClass :: MonadWidget t m => String -> String -> m (Link t)
- link :: MonadWidget t m => String -> m (Link t)
- button :: MonadWidget t m => String -> m (Event t ())
- newtype Workflow t m a = Workflow {
- unWorkflow :: m (a, Event t (Workflow t m a))
- workflow :: forall t m a. MonadWidget t m => Workflow t m a -> m (Dynamic t a)
- workflowView :: forall t m a. MonadWidget t m => Workflow t m a -> m (Event t a)
- mapWorkflow :: MonadWidget t m => (a -> b) -> Workflow t m a -> Workflow t m b
- divClass :: forall t m a. MonadWidget t m => String -> m a -> m a
- dtdd :: forall t m a. MonadWidget t m => String -> m a -> m a
- blank :: forall t m. MonadWidget t m => m ()
- tableDynAttr :: forall t m r k v. (MonadWidget t m, Show k, Ord k) => String -> [(String, k -> Dynamic t r -> m v)] -> Dynamic t (Map k r) -> (k -> m (Dynamic t (Map String String))) -> m (Dynamic t (Map k (El t, [v])))
- tabDisplay :: forall t m k. (MonadFix m, MonadWidget t m, Show k, Ord k) => String -> String -> Map k (String, m ()) -> m ()
- unsafePlaceElement :: MonadWidget t m => Element -> m (El t)
- _el_clicked :: Reflex t => El t -> Event t ()
- _el_keypress :: Reflex t => El t -> Event t Int
- _el_scrolled :: Reflex t => El t -> Event t Int
Documentation
type AttributeMap = Map String String Source
ElConfig | |
|
elConfig_attributes :: forall attrs attrs. Lens (ElConfig attrs) (ElConfig attrs) attrs attrs Source
Reflex t => HasDomEvent t (El t) Source |
class Attributes m a where Source
addAttributes :: IsElement e => a -> e -> m () Source
MonadIO m => Attributes m AttributeMap Source | |
MonadWidget t m => Attributes m (Dynamic t AttributeMap) Source |
buildEmptyElementNS :: (MonadWidget t m, Attributes m attrs) => Maybe String -> String -> attrs -> m Element Source
buildEmptyElement :: (MonadWidget t m, Attributes m attrs) => String -> attrs -> m Element Source
buildElementNS :: (MonadWidget t m, Attributes m attrs) => Maybe String -> String -> attrs -> m a -> m (Element, a) Source
buildElement :: (MonadWidget t m, Attributes m attrs) => String -> attrs -> m a -> m (Element, a) Source
namedNodeMapGetNames :: NamedNodeMap -> IO (Set String) Source
text :: MonadWidget t m => String -> m () Source
text' :: MonadWidget t m => String -> m Text Source
dynText :: MonadWidget t m => Dynamic t String -> m () Source
display :: (MonadWidget t m, Show a) => Dynamic t a -> m () Source
dyn :: MonadWidget t m => Dynamic t (m a) -> m (Event t a) Source
Given a Dynamic of widget-creating actions, create a widget that is recreated whenever the Dynamic updates.
The returned Event of widget results occurs when the Dynamic does.
Note: Often, the type a
is an Event, in which case the return value is an Event-of-Events that would typically be flattened.
widgetHold :: MonadWidget t m => m a -> Event t (m a) -> m (Dynamic t a) Source
Given an initial widget and an Event of widget-creating actions, create a widget that is recreated whenever the Event fires.
The returned Dynamic of widget results occurs when the Event does.
Note: Often, the type a
is an Event, in which case the return value is a Dynamic-of-Events that would typically be flattened.
widgetHoldInternal :: MonadWidget t m => m a -> Event t (m b) -> m (a, Event t b) Source
listWithKey :: forall t k v m a. (Ord k, MonadWidget t m) => Dynamic t (Map k v) -> (k -> Dynamic t v -> m a) -> m (Dynamic t (Map k a)) Source
listWithKey' :: (Ord k, MonadWidget t m) => Map k v -> Event t (Map k (Maybe v)) -> (k -> v -> Event t v -> m a) -> m (Dynamic t (Map k a)) Source
Deprecated: listWithKey' has been renamed to listWithKeyShallowDiff; also, its behavior has changed to fix a bug where children were always rebuilt (never updated)
listWithKeyShallowDiff :: (Ord k, MonadWidget t m) => Map k v -> Event t (Map k (Maybe v)) -> (k -> v -> Event t v -> m a) -> m (Dynamic t (Map k a)) Source
listHoldWithKey :: (Ord k, MonadWidget t m) => Map k v -> Event t (Map k (Maybe v)) -> (k -> v -> m a) -> m (Dynamic t (Map k a)) Source
Display the given map of items using the builder function provided, and update it with the given event. Nothing
entries will delete the corresponding children, and Just
entries will create or replace them. Since child events do not take any signal arguments, they are always rebuilt. To update a child without rebuilding, either embed signals in the map's values, or refer to them directly in the builder function.
listViewWithKey :: (Ord k, MonadWidget t m) => Dynamic t (Map k v) -> (k -> Dynamic t v -> m (Event t a)) -> m (Event t (Map k a)) Source
Create a dynamically-changing set of Event-valued widgets.
This is like listWithKey, specialized for widgets returning (Event t a). listWithKey would return 'Dynamic t (Map k (Event t a))' in this scenario, but listViewWithKey flattens this to 'Event t (Map k a)' via switch
.
listViewWithKey' :: (Ord k, MonadWidget t m) => Dynamic t (Map k v) -> (k -> Dynamic t v -> m a) -> m (Behavior t (Map k a)) Source
:: (MonadWidget t m, Ord k) | |
=> Dynamic t k | Current selection key |
-> Dynamic t (Map k v) | Dynamic key/value map |
-> (k -> Dynamic t v -> Dynamic t Bool -> m (Event t a)) | Function to create a widget for a given key from Dynamic value and Dynamic Bool indicating if this widget is currently selected |
-> m (Event t (k, a)) | Event that fires when any child's return Event fires. Contains key of an arbitrary firing widget. |
Create a dynamically-changing set of widgets, one of which is selected at any time.
:: (MonadWidget t m, Ord k) | |
=> Dynamic t k | Current selection key |
-> Dynamic t (Map k v) | Dynamic key/value map |
-> (k -> Dynamic t v -> Dynamic t Bool -> m (Event t a)) | Function to create a widget for a given key from Dynamic value and Dynamic Bool indicating if this widget is currently selected |
-> m (Event t k) | Event that fires when any child's return Event fires. Contains key of an arbitrary firing widget. |
deleteBetweenExclusive :: (IsNode start, IsNode end) => start -> end -> IO () Source
s and e must both be children of the same node and s must precede e
deleteBetweenInclusive :: (IsNode start, IsNode end) => start -> end -> IO () Source
s and e must both be children of the same node and s must precede e
wrapDomEvent :: (Functor (Event t), MonadIO m, MonadSample t m, MonadReflexCreateTrigger t m, Reflex t, HasPostGui t h m) => e -> (e -> EventM e event () -> IO (IO ())) -> EventM e event a -> m (Event t a) Source
wrapDomEventMaybe :: (Functor (Event t), MonadIO m, MonadSample t m, MonadReflexCreateTrigger t m, Reflex t, HasPostGui t h m) => e -> (e -> EventM e event () -> IO (IO ())) -> EventM e event (Maybe a) -> m (Event t a) Source
data EventName :: EventTag -> * where Source
type family EventType en Source
newtype EventResult en Source
type family EventResultType en :: * Source
wrapDomEventsMaybe :: (Functor (Event t), IsElement e, MonadIO m, MonadSample t m, MonadReflexCreateTrigger t m, Reflex t, HasPostGui t h m) => e -> (forall en. EventName en -> EventM e (EventType en) (Maybe (f en))) -> m (EventSelector t (WrapArg f EventName)) Source
getMouseEventCoords :: EventM e MouseEvent (Int, Int) Source
defaultDomEventHandler :: IsElement e => e -> EventName en -> EventM e (EventType en) (Maybe (EventResult en)) Source
wrapElement :: forall t h m. (Functor (Event t), MonadIO m, MonadSample t m, MonadReflexCreateTrigger t m, Reflex t, HasPostGui t h m) => (forall en. Element -> EventName en -> EventM Element (EventType en) (Maybe (EventResult en))) -> Element -> m (El t) Source
elStopPropagationNS :: (MonadWidget t m, IsEvent (EventType en)) => Maybe String -> String -> EventName en -> m a -> m a Source
elWith :: (MonadWidget t m, Attributes m attrs) => String -> ElConfig attrs -> m a -> m a Source
elWith' :: (MonadWidget t m, Attributes m attrs) => String -> ElConfig attrs -> m a -> m (El t, a) Source
emptyElWith :: (MonadWidget t m, Attributes m attrs) => String -> ElConfig attrs -> m () Source
emptyElWith' :: (MonadWidget t m, Attributes m attrs) => String -> ElConfig attrs -> m (El t) Source
elDynAttrNS' :: forall t m a. MonadWidget t m => Maybe String -> String -> Dynamic t (Map String String) -> m a -> m (El t, a) Source
elDynAttr' :: forall t m a. MonadWidget t m => String -> Dynamic t (Map String String) -> m a -> m (El t, a) Source
el' :: forall t m a. MonadWidget t m => String -> m a -> m (El t, a) Source
elAttr' :: forall t m a. MonadWidget t m => String -> Map String String -> m a -> m (El t, a) Source
elDynAttr :: forall t m a. MonadWidget t m => String -> Dynamic t (Map String String) -> m a -> m a Source
el :: forall t m a. MonadWidget t m => String -> m a -> m a Source
elClass :: forall t m a. MonadWidget t m => String -> String -> m a -> m a Source
list :: (MonadWidget t m, Ord k) => Dynamic t (Map k v) -> (Dynamic t v -> m a) -> m (Dynamic t (Map k a)) Source
Create a dynamically-changing set of widgets from a Dynamic key/value map.
Unlike the withKey
variants, the child widgets are insensitive to which key they're associated with.
simpleList :: MonadWidget t m => Dynamic t [v] -> (Dynamic t v -> m a) -> m (Dynamic t [a]) Source
Create a dynamically-changing set of widgets from a Dynamic list.
elDynHtml' :: MonadWidget t m => String -> Dynamic t String -> m (El t) Source
elDynHtmlAttr' :: MonadWidget t m => String -> Map String String -> Dynamic t String -> m (El t) Source
Link | |
|
class HasAttributes a where Source
attributes :: Lens' a (Attrs a) Source
HasAttributes (ElConfig attrs) Source | |
HasAttributes (CheckboxConfig t) Source | |
HasAttributes (TextAreaConfig t) Source | |
HasAttributes (TextInputConfig t) Source | |
HasAttributes (DropdownConfig t k) Source |
class HasNamespace a where Source
HasNamespace (ElConfig attrs) Source |
class HasDomEvent t a where Source
domEvent :: EventName en -> a -> Event t (EventResultType en) Source
Reflex t => HasDomEvent t (El t) Source |
link :: MonadWidget t m => String -> m (Link t) Source
button :: MonadWidget t m => String -> m (Event t ()) Source
workflow :: forall t m a. MonadWidget t m => Workflow t m a -> m (Dynamic t a) Source
workflowView :: forall t m a. MonadWidget t m => Workflow t m a -> m (Event t a) Source
mapWorkflow :: MonadWidget t m => (a -> b) -> Workflow t m a -> Workflow t m b Source
divClass :: forall t m a. MonadWidget t m => String -> m a -> m a Source
dtdd :: forall t m a. MonadWidget t m => String -> m a -> m a Source
blank :: forall t m. MonadWidget t m => m () Source
:: (MonadWidget t m, Show k, Ord k) | |
=> String | Class applied to table element |
-> [(String, k -> Dynamic t r -> m v)] | Columns of (header, row key -> row value -> child widget) |
-> Dynamic t (Map k r) | Map from row key to row value |
-> (k -> m (Dynamic t (Map String String))) | Function to compute tr element attributes from row key |
-> m (Dynamic t (Map k (El t, [v]))) | Map from row key to (El, list of widget return values) |
A widget to display a table with static columns and dynamic rows.
unsafePlaceElement :: MonadWidget t m => Element -> m (El t) Source
Place an element into the DOM and wrap it with Reflex event handlers. Note: undefined behavior may result if the element is placed multiple times, removed from the DOM after being placed, or in other situations. Don't use this unless you understand the internals of MonadWidget.
_el_clicked :: Reflex t => El t -> Event t () Source
Deprecated: Use `domEvent Click` instead