mirror of
https://github.com/NoRedInk/noredink-ui.git
synced 2024-12-18 19:21:29 +03:00
Adds radio example
This commit is contained in:
parent
4a8fbbe5be
commit
3ce976c4a9
@ -73,11 +73,11 @@ example =
|
||||
, { sectionName = "viewRadioGroup"
|
||||
, code =
|
||||
[ "viewRadioGroup"
|
||||
, " { onSelect : a -> msg"
|
||||
, " , options : List (Radio a msg)"
|
||||
, " , selected : Maybe a"
|
||||
, " , positioning : Positioning"
|
||||
, " , legend : String"
|
||||
, " { onSelect = SelectRadio"
|
||||
, " , options = " ++ ControlView.codeFromList radioOptions
|
||||
, " , selected = " ++ Debug.toString state.optionallySelected
|
||||
, " , positioning = " ++ Tuple.first options.positioning
|
||||
, " , legend = \"SegmentedControls 'viewSelectRadio' example\""
|
||||
, " }"
|
||||
]
|
||||
|> String.join "\n"
|
||||
@ -257,27 +257,20 @@ buildRadioOptions options currentlyHovered content =
|
||||
icon
|
||||
("Source " ++ Debug.toString (value + 1))
|
||||
in
|
||||
( [ "{ icon = icon_"
|
||||
, ", label = Html.text label"
|
||||
, ", value = value"
|
||||
, ", idString = String.fromInt value"
|
||||
, ", tooltip = []"
|
||||
( [ "{ icon = " ++ Debug.toString (Maybe.map (\_ -> "UiIcon." ++ toLower label) icon_)
|
||||
, ", label = Html.text " ++ label
|
||||
, ", value = " ++ String.fromInt value
|
||||
, ", idString = String.fromInt " ++ String.fromInt value
|
||||
, ", tooltip = "
|
||||
++ (if options.tooltips then
|
||||
("\n\t\t[ Tooltip.plaintext " ++ String.fromInt value)
|
||||
++ ("\n\t\t, Tooltip.onHover (OpenTooltip " ++ String.fromInt value ++ ")")
|
||||
++ ("\n\t\t, Tooltip.open (openTooltip == Just " ++ String.fromInt value ++ ")")
|
||||
++ "\n\t\t]"
|
||||
|
||||
--, if options.tooltips then
|
||||
-- [ Tooltip.plaintext text
|
||||
-- , Tooltip.open (currentlyHovered == Just value)
|
||||
-- , Tooltip.fitToContent
|
||||
-- , Tooltip.onHover
|
||||
-- (\hovered ->
|
||||
-- HoverRadio
|
||||
-- (if hovered then
|
||||
-- Just value
|
||||
-- else
|
||||
-- Nothing
|
||||
-- )
|
||||
-- )
|
||||
-- ]
|
||||
-- else []
|
||||
else
|
||||
"[]"
|
||||
)
|
||||
, ", attributes = []"
|
||||
, "}"
|
||||
]
|
||||
|
Loading…
Reference in New Issue
Block a user