mirror of
https://github.com/dillonkearns/elm-pages-v3-beta.git
synced 2024-11-28 23:12:22 +03:00
Expose toString helper.
This commit is contained in:
parent
86890804e4
commit
8a7313516a
@ -1,4 +1,4 @@
|
||||
module Pages.FormState exposing (Event(..), FieldEvent, FieldState, FieldStatus(..), FormState, PageFormState, init, listeners, setField, setSubmitAttempted, update)
|
||||
module Pages.FormState exposing (Event(..), FieldEvent, FieldState, FieldStatus(..), FormState, PageFormState, fieldStatusToString, init, listeners, setField, setSubmitAttempted, update)
|
||||
|
||||
import Dict exposing (Dict)
|
||||
import Html exposing (Attribute)
|
||||
@ -215,6 +215,22 @@ type FieldStatus
|
||||
| Blurred
|
||||
|
||||
|
||||
fieldStatusToString : FieldStatus -> String
|
||||
fieldStatusToString fieldStatus =
|
||||
case fieldStatus of
|
||||
NotVisited ->
|
||||
"NotVisited"
|
||||
|
||||
Focused ->
|
||||
"Focused"
|
||||
|
||||
Changed ->
|
||||
"Changed"
|
||||
|
||||
Blurred ->
|
||||
"Blurred"
|
||||
|
||||
|
||||
increaseStatusTo : FieldStatus -> FieldStatus -> FieldStatus
|
||||
increaseStatusTo increaseTo currentStatus =
|
||||
if statusRank increaseTo > statusRank currentStatus then
|
||||
|
Loading…
Reference in New Issue
Block a user