Safe Haskell | None |
---|---|
Language | Haskell2010 |
this program based on Yesod.Form.Bootstrap3 of yesod-form yesod-form under MIT license, author is Michael Snoyman michael@snoyman.com
Synopsis
- renderBootstrap4 :: Monad m => BootstrapFormLayout -> FormRender m a
- data BootstrapFormLayout
- data BootstrapGridOptions
- bfs :: RenderMessage site msg => msg -> FieldSettings site
- withPlaceholder :: Text -> FieldSettings site -> FieldSettings site
- withAutofocus :: FieldSettings site -> FieldSettings site
- withLargeInput :: FieldSettings site -> FieldSettings site
- withSmallInput :: FieldSettings site -> FieldSettings site
- bootstrapSubmit :: (RenderMessage site msg, HandlerSite m ~ site, MonadHandler m) => BootstrapSubmit msg -> AForm m ()
- mbootstrapSubmit :: (RenderMessage site msg, HandlerSite m ~ site, MonadHandler m) => BootstrapSubmit msg -> MForm m (FormResult (), FieldView site)
- data BootstrapSubmit msg = BootstrapSubmit {}
Documentation
renderBootstrap4 :: Monad m => BootstrapFormLayout -> FormRender m a Source #
Render the given form using Bootstrap v3 conventions.
data BootstrapFormLayout Source #
The layout used for the bootstrap form.
Instances
Eq BootstrapFormLayout Source # | |
Defined in Yesod.Form.Bootstrap4 (==) :: BootstrapFormLayout -> BootstrapFormLayout -> Bool # (/=) :: BootstrapFormLayout -> BootstrapFormLayout -> Bool # | |
Ord BootstrapFormLayout Source # | |
Defined in Yesod.Form.Bootstrap4 compare :: BootstrapFormLayout -> BootstrapFormLayout -> Ordering # (<) :: BootstrapFormLayout -> BootstrapFormLayout -> Bool # (<=) :: BootstrapFormLayout -> BootstrapFormLayout -> Bool # (>) :: BootstrapFormLayout -> BootstrapFormLayout -> Bool # (>=) :: BootstrapFormLayout -> BootstrapFormLayout -> Bool # max :: BootstrapFormLayout -> BootstrapFormLayout -> BootstrapFormLayout # min :: BootstrapFormLayout -> BootstrapFormLayout -> BootstrapFormLayout # | |
Read BootstrapFormLayout Source # | |
Defined in Yesod.Form.Bootstrap4 | |
Show BootstrapFormLayout Source # | |
Defined in Yesod.Form.Bootstrap4 showsPrec :: Int -> BootstrapFormLayout -> ShowS # show :: BootstrapFormLayout -> String # showList :: [BootstrapFormLayout] -> ShowS # |
data BootstrapGridOptions Source #
Instances
bfs :: RenderMessage site msg => msg -> FieldSettings site Source #
withPlaceholder :: Text -> FieldSettings site -> FieldSettings site Source #
withAutofocus :: FieldSettings site -> FieldSettings site Source #
Add an autofocus attribute to a field.
withLargeInput :: FieldSettings site -> FieldSettings site Source #
Add the input-lg
CSS class to a field.
withSmallInput :: FieldSettings site -> FieldSettings site Source #
Add the input-sm
CSS class to a field.
bootstrapSubmit :: (RenderMessage site msg, HandlerSite m ~ site, MonadHandler m) => BootstrapSubmit msg -> AForm m () Source #
A Bootstrap v4 submit button disguised as a field for convenience. For example, if your form currently is:
Person <$> areq textField "Name" Nothing <*> areq textField "Surname" Nothing
Then just change it to:
Person <$> areq textField "Name" Nothing <*> areq textField "Surname" Nothing <* bootstrapSubmit ("Register" :: BootstrapSubmit Text)
(Note that <*
is not a typo.)
Alternatively, you may also just create the submit button manually as well in order to have more control over its layout.
mbootstrapSubmit :: (RenderMessage site msg, HandlerSite m ~ site, MonadHandler m) => BootstrapSubmit msg -> MForm m (FormResult (), FieldView site) Source #
Same as bootstrapSubmit
but for monadic forms. This isn't
as useful since you're not going to use renderBootstrap4
anyway.
data BootstrapSubmit msg Source #
How the bootstrapSubmit
button should be rendered.