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

View File

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