Merge pull request #1530 from pythonissam/expose-selectFieldHelper
Expose select field helper
This commit is contained in:
commit
df5ad82a90
@ -1,3 +1,7 @@
|
|||||||
|
## 1.6.4
|
||||||
|
|
||||||
|
* Expose `selectFieldHelper` [#1530](https://github.com/yesodweb/yesod/pull/1530)
|
||||||
|
|
||||||
## 1.6.3
|
## 1.6.3
|
||||||
|
|
||||||
* Changed `Textarea` to derive `IsString` [#1514](https://github.com/yesodweb/yesod/pull/1514)
|
* Changed `Textarea` to derive `IsString` [#1514](https://github.com/yesodweb/yesod/pull/1514)
|
||||||
|
|||||||
@ -42,6 +42,7 @@ module Yesod.Form.Fields
|
|||||||
, fileAFormOpt
|
, fileAFormOpt
|
||||||
-- * Options
|
-- * Options
|
||||||
-- $optionsOverview
|
-- $optionsOverview
|
||||||
|
, selectFieldHelper
|
||||||
, selectField
|
, selectField
|
||||||
, selectFieldList
|
, selectFieldList
|
||||||
, radioField
|
, radioField
|
||||||
@ -729,11 +730,15 @@ optionsPersistKey filts ords toDisplay = fmap mkOptionList $ do
|
|||||||
, optionExternalValue = toPathPiece key
|
, optionExternalValue = toPathPiece key
|
||||||
}) pairs
|
}) pairs
|
||||||
|
|
||||||
|
-- |
|
||||||
|
-- A helper function for constucting 'selectField's. You may want to use this when you define your custom 'selectField's or 'radioField's.
|
||||||
|
--
|
||||||
|
-- Since 1.6.4
|
||||||
selectFieldHelper
|
selectFieldHelper
|
||||||
:: (Eq a, RenderMessage site FormMessage)
|
:: (Eq a, RenderMessage site FormMessage)
|
||||||
=> (Text -> Text -> [(Text, Text)] -> WidgetFor site () -> WidgetFor site ())
|
=> (Text -> Text -> [(Text, Text)] -> WidgetFor site () -> WidgetFor site ()) -- ^ Outermost part of the field
|
||||||
-> (Text -> Text -> Bool -> WidgetFor site ())
|
-> (Text -> Text -> Bool -> WidgetFor site ()) -- ^ An option for None if the field is optional
|
||||||
-> (Text -> Text -> [(Text, Text)] -> Text -> Bool -> Text -> WidgetFor site ())
|
-> (Text -> Text -> [(Text, Text)] -> Text -> Bool -> Text -> WidgetFor site ()) -- ^ Other options
|
||||||
-> HandlerFor site (OptionList a)
|
-> HandlerFor site (OptionList a)
|
||||||
-> Field (HandlerFor site) a
|
-> Field (HandlerFor site) a
|
||||||
selectFieldHelper outside onOpt inside opts' = Field
|
selectFieldHelper outside onOpt inside opts' = Field
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
name: yesod-form
|
name: yesod-form
|
||||||
version: 1.6.3
|
version: 1.6.4
|
||||||
license: MIT
|
license: MIT
|
||||||
license-file: LICENSE
|
license-file: LICENSE
|
||||||
author: Michael Snoyman <michael@snoyman.com>
|
author: Michael Snoyman <michael@snoyman.com>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user