| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
Web.Hyperbole.HyperView.Input
Synopsis
- button :: ViewAction (Action id) => Action id -> View id () -> View id ()
- dropdown :: forall opt id. (ViewAction (Action id), FromJSON opt) => Action id -> opt -> View (Option id opt) () -> View id ()
- option :: forall opt id. (ViewAction (Action id), Eq opt, ToJSON opt) => opt -> Text -> View (Option id opt) ()
- encodeOption :: ToJSON opt => opt -> Text
- selected :: Attributable h => Bool -> Attributes h -> Attributes h
- data Option id opt = Option {
- id :: id
- defaultOption :: opt
- search :: ViewAction (Action id) => Action id -> DelayMs -> View id ()
- checked :: Attributable a => Bool -> Attributes a -> Attributes a
- route :: Route a => a -> View c () -> View c ()
- class InputValue a where
- parseInputValue :: Text -> Either String a
Documentation
dropdown :: forall opt id. (ViewAction (Action id), FromJSON opt) => Action id -> opt -> View (Option id opt) () -> View id () Source #
Type-safe dropdown. Sends the action when selected. The default will be selected on load.
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 :: forall opt id. (ViewAction (Action id), Eq opt, ToJSON opt) => opt -> Text -> View (Option id opt) () Source #
An option for a dropdown or select
encodeOption :: ToJSON opt => opt -> Text Source #
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
| |
Instances
checked :: Attributable a => Bool -> Attributes a -> Attributes a Source #
Set checkbox = checked via the client (VDOM doesn't work)
route :: Route a => a -> View c () -> View c () Source #
A hyperlink to another route
>>>route (User 100) id "View User"<a href="/user/100">View User</a>
class InputValue a where Source #
Minimal complete definition
Nothing
Methods
Instances
| InputValue Text Source # | |
Defined in Web.Hyperbole.HyperView.Input | |
| InputValue Integer Source # | |
Defined in Web.Hyperbole.HyperView.Input | |
| InputValue Double Source # | |
Defined in Web.Hyperbole.HyperView.Input | |
| InputValue Float Source # | |
Defined in Web.Hyperbole.HyperView.Input | |
| InputValue Int Source # | |
Defined in Web.Hyperbole.HyperView.Input | |
| InputValue (Maybe Text) Source # | |
Defined in Web.Hyperbole.HyperView.Input | |
| InputValue (Maybe String) Source # | |
Defined in Web.Hyperbole.HyperView.Input | |
| InputValue a => InputValue (Maybe a) Source # | |
Defined in Web.Hyperbole.HyperView.Input | |