Copyright | (c) 2018 Francisco Vallarino |
---|---|
License | BSD-3-Clause (see the LICENSE file) |
Maintainer | fjvallarino@gmail.com |
Stability | experimental |
Portability | non-portable |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Dropdown widget, allowing selection of a single item from a collapsable list. Both header and list content are text based.
textDropdown textLens ["Option 1", "Option 2", "Option 3"]
In case a customizable version is needed, to display rich content in the header or list items, Monomer.Widgets.Containers.Dropdown can be used.
Synopsis
- type TextDropdownItem a = DropdownItem a
- textDropdown :: (WidgetModel s, WidgetEvent e, Traversable t, TextDropdownItem a, TextShow a) => ALens' s a -> t a -> WidgetNode s e
- textDropdown_ :: (WidgetModel s, WidgetEvent e, Traversable t, TextDropdownItem a) => ALens' s a -> t a -> (a -> Text) -> [DropdownCfg s e a] -> WidgetNode s e
- textDropdownV :: (WidgetModel s, WidgetEvent e, Traversable t, TextDropdownItem a, TextShow a) => a -> (a -> e) -> t a -> WidgetNode s e
- textDropdownV_ :: (WidgetModel s, WidgetEvent e, Traversable t, TextDropdownItem a) => a -> (a -> e) -> t a -> (a -> Text) -> [DropdownCfg s e a] -> WidgetNode s e
- textDropdownS :: (WidgetModel s, WidgetEvent e, Traversable t, TextDropdownItem a, Show a) => ALens' s a -> t a -> WidgetNode s e
- textDropdownS_ :: (WidgetModel s, WidgetEvent e, Traversable t, TextDropdownItem a, Show a) => ALens' s a -> t a -> [DropdownCfg s e a] -> WidgetNode s e
- textDropdownSV :: (WidgetModel s, WidgetEvent e, Traversable t, TextDropdownItem a, Show a) => a -> (a -> e) -> t a -> WidgetNode s e
- textDropdownSV_ :: (WidgetModel s, WidgetEvent e, Traversable t, TextDropdownItem a, Show a) => a -> (a -> e) -> t a -> [DropdownCfg s e a] -> WidgetNode s e
Configuration
type TextDropdownItem a = DropdownItem a Source #
Constraints for an item handled by textDropdown.
Constructors
:: (WidgetModel s, WidgetEvent e, Traversable t, TextDropdownItem a, TextShow a) | |
=> ALens' s a | The lens into the model. |
-> t a | The list of items. |
-> WidgetNode s e | The created text dropdown. |
Creates a text dropdown using the given lens. The type must have a TextShow
instance.
:: (WidgetModel s, WidgetEvent e, Traversable t, TextDropdownItem a) | |
=> ALens' s a | The lens into the model. |
-> t a | The list of items. |
-> (a -> Text) | The function for converting to Text. |
-> [DropdownCfg s e a] | The config options. |
-> WidgetNode s e | The created text dropdown. |
Creates a text dropdown using the given lens. Takes a function for converting the type to Text. Accepts config.
:: (WidgetModel s, WidgetEvent e, Traversable t, TextDropdownItem a, TextShow a) | |
=> a | The current value. |
-> (a -> e) | The event to raise on change. |
-> t a | The list of items. |
-> WidgetNode s e | The created text dropdown. |
Creates a text dropdown using the given value and onChange
event handler.
:: (WidgetModel s, WidgetEvent e, Traversable t, TextDropdownItem a) | |
=> a | The current value. |
-> (a -> e) | The event to raise on change. |
-> t a | The list of items. |
-> (a -> Text) | The function for converting to Text. |
-> [DropdownCfg s e a] | The config options. |
-> WidgetNode s e | The created text dropdown. |
Creates a text dropdown using the given value and onChange
event handler.
Takes a function for converting the type to Text. Accepts config.
:: (WidgetModel s, WidgetEvent e, Traversable t, TextDropdownItem a, Show a) | |
=> ALens' s a | The lens into the model. |
-> t a | The list of items. |
-> WidgetNode s e | The created text dropdown. |
Creates a text dropdown using the given lens. The type must have a Show
instance.
:: (WidgetModel s, WidgetEvent e, Traversable t, TextDropdownItem a, Show a) | |
=> ALens' s a | The lens into the model. |
-> t a | The list of items. |
-> [DropdownCfg s e a] | The config options. |
-> WidgetNode s e | The created text dropdown. |
Creates a text dropdown using the given lens. The type must have a Show
instance. Accepts config.
:: (WidgetModel s, WidgetEvent e, Traversable t, TextDropdownItem a, Show a) | |
=> a | The current value. |
-> (a -> e) | The event to raise on change. |
-> t a | The list of items. |
-> WidgetNode s e | The created text dropdown. |
:: (WidgetModel s, WidgetEvent e, Traversable t, TextDropdownItem a, Show a) | |
=> a | The current value. |
-> (a -> e) | The event to raise on change. |
-> t a | The list of items. |
-> [DropdownCfg s e a] | The config options. |
-> WidgetNode s e | The created text dropdown. |