mirror of
https://github.com/dillonkearns/elm-pages-v3-beta.git
synced 2024-11-23 14:15:33 +03:00
Update docs and remove obsolete globalErrors helper.
This commit is contained in:
parent
d7a2127daf
commit
985e79922c
@ -143,7 +143,7 @@ errorsForField formState field =
|
||||
globalErrors : Form.Context String data -> Html msg
|
||||
globalErrors formState =
|
||||
formState.errors
|
||||
|> Form.globalErrors
|
||||
|> Form.errorsForField Validation.global
|
||||
|> List.map (\error -> Html.li [] [ Html.text error ])
|
||||
|> Html.ul [ Attr.style "color" "red" ]
|
||||
|
||||
|
20
src/Form.elm
20
src/Form.elm
@ -1,5 +1,6 @@
|
||||
module Form exposing
|
||||
( Form, HtmlForm, StyledHtmlForm
|
||||
( Form, HtmlForm, StyledHtmlForm, DoneForm
|
||||
, Response(..)
|
||||
, init
|
||||
, field, hiddenField, hiddenKind
|
||||
, Context
|
||||
@ -10,11 +11,7 @@ module Form exposing
|
||||
, dynamic
|
||||
, runOneOfServerSideWithServerValidations
|
||||
, AppContext
|
||||
, DoneForm
|
||||
, Response(..)
|
||||
, globalErrors
|
||||
-- subGroup
|
||||
|
||||
-- subGroup
|
||||
)
|
||||
|
||||
{-| One of the core features of elm-pages is helping you manage form data end-to-end, including
|
||||
@ -214,7 +211,9 @@ Totally customizable. Uses [`Form.FieldView`](Form-FieldView) to render all of t
|
||||
|
||||
## Building a Form Parser
|
||||
|
||||
@docs Form, HtmlForm, StyledHtmlForm
|
||||
@docs Form, HtmlForm, StyledHtmlForm, DoneForm
|
||||
|
||||
@docs Response
|
||||
|
||||
@docs init
|
||||
|
||||
@ -759,12 +758,6 @@ errorsForField field_ (Errors errorsDict) =
|
||||
|> Maybe.withDefault []
|
||||
|
||||
|
||||
{-| -}
|
||||
globalErrors : Errors error -> List error
|
||||
globalErrors errors =
|
||||
errors |> errorsForField Validation.global
|
||||
|
||||
|
||||
{-| -}
|
||||
type alias AppContext app =
|
||||
{ app
|
||||
@ -1254,6 +1247,7 @@ renderStyledHtml attrs maybe app data (FinalForm options a b c) =
|
||||
Html.Styled.Lazy.lazy6 renderStyledHelper attrs maybe options app data (FormInternal a b c)
|
||||
|
||||
|
||||
{-| -}
|
||||
type Response error
|
||||
= Response
|
||||
{ fields : List ( String, String )
|
||||
|
@ -25,6 +25,11 @@ module Form.Validation exposing
|
||||
|
||||
@docs map3, map4, map5, map6, map7, map8, map9
|
||||
|
||||
|
||||
## Global Validation
|
||||
|
||||
@docs global
|
||||
|
||||
-}
|
||||
|
||||
import Dict exposing (Dict)
|
||||
|
@ -1,7 +1,7 @@
|
||||
module Server.Request exposing
|
||||
( Parser
|
||||
, succeed, fromResult, skip
|
||||
, formData, formDataWithoutServerValidation
|
||||
, formData, formDataWithoutServerValidation, formDataWithServerValidation
|
||||
, rawFormData
|
||||
, method, rawBody, allCookies, rawHeaders, queryParams
|
||||
, requestTime, optionalHeader, expectContentType, expectJsonBody
|
||||
@ -15,7 +15,6 @@ module Server.Request exposing
|
||||
, map3, map4, map5, map6, map7, map8, map9
|
||||
, Method(..), methodToString
|
||||
, errorsToString, errorToString, getDecoder, ValidationError
|
||||
, formDataWithServerValidation
|
||||
)
|
||||
|
||||
{-|
|
||||
@ -27,7 +26,7 @@ module Server.Request exposing
|
||||
|
||||
## Forms
|
||||
|
||||
@docs formData, formDataWithoutServerValidation
|
||||
@docs formData, formDataWithoutServerValidation, formDataWithServerValidation
|
||||
|
||||
@docs rawFormData
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user