Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Web.Hyperbole.HyperView.Input
Synopsis
- button :: ViewAction (Action id) => Action id -> View id () -> View id ()
- dropdown :: ViewAction (Action id) => (opt -> Action id) -> opt -> View (Option opt id) () -> View id ()
- option :: (ViewAction (Action id), Eq opt, ToParam opt) => opt -> Text -> View (Option opt id) ()
- selected :: Attributable h => Bool -> Attributes h -> Attributes h
- data Option opt id = Option {
- defaultOption :: opt
- search :: ViewAction (Action id) => (Text -> Action id) -> DelayMs -> View id ()
- checked :: Attributable a => Bool -> Attributes a -> Attributes a
- route :: Route a => a -> View c () -> View c ()
Documentation
dropdown :: ViewAction (Action id) => (opt -> Action id) -> opt -> View (Option opt id) () -> View id () Source #
Type-safe dropdown. Sends (opt -> Action id) when selected. The default will be selected.
▶️ Filter
familyDropdown :: Filters -> View
Languages ()
familyDropdown filters =
dropdown SetFamily filters.family ~ border 1 . pad 10 $ do
option Nothing "Any"
option (Just ObjectOriented) "Object Oriented"
option (Just Functional) "Functional"
option :: (ViewAction (Action id), Eq opt, ToParam opt) => opt -> Text -> View (Option opt id) () Source #
An option for a dropdown
or select
selected :: Attributable h => Bool -> Attributes h -> Attributes h Source #
sets selected = true if the dropdown
predicate returns True
The view context for an option
Constructors
Option | |
Fields
|
checked :: Attributable a => Bool -> Attributes a -> Attributes a Source #
Set checkbox = checked via the client (VDOM doesn't work)