required label attribute at the begininning, in keeping with other APIs

This commit is contained in:
Alex Perkins 2021-11-18 18:18:50 -05:00
parent 83486fbf2f
commit 710576115b
2 changed files with 8 additions and 14 deletions

View File

@ -120,8 +120,7 @@ emptyEventsAndValues =
{-| This is private. The public API only exposes `Attribute`.
-}
type alias Config =
{ label : Maybe String
, name : Maybe String
{ name : Maybe String
, isLocked : Bool
, isDisabled : Bool
, showPennant : Bool
@ -130,8 +129,7 @@ type alias Config =
emptyConfig : Config
emptyConfig =
{ label = Nothing
, name = Nothing
{ name = Nothing
, isLocked = False
, isDisabled = False
, showPennant = False
@ -173,13 +171,12 @@ applyEvents =
If used in a group, all radio buttons in the group should have the same name attribute.
-}
view :
{ label : String
}
String
-> List (Attribute value msg)
-> Html msg
view config =
view label =
internalView
{ label = config.label
{ label = label
, isLocked = False
, premiumMsg = Nothing
, showPennant = False

View File

@ -86,8 +86,7 @@ viewVanilla : State -> Html Msg
viewVanilla state =
div []
[ RadioButton.view
{ label = selectionToString Dogs
}
(selectionToString Dogs)
[ RadioButton.enabled
, RadioButton.value Dogs
, RadioButton.name "pets"
@ -96,8 +95,7 @@ viewVanilla state =
, RadioButton.valueToString selectionToString
]
, RadioButton.view
{ label = selectionToString Cats
}
(selectionToString Cats)
[ RadioButton.enabled
, RadioButton.value Cats
, RadioButton.name "pets"
@ -106,8 +104,7 @@ viewVanilla state =
, RadioButton.valueToString selectionToString
]
, RadioButton.view
{ label = selectionToString Robots
}
(selectionToString Robots)
[ RadioButton.disabled
, RadioButton.value Robots
, RadioButton.name "pets"