mirror of
https://github.com/Orasund/elm-ui-widgets.git
synced 2024-11-22 04:58:49 +03:00
refactor ProgressIndicator from singleton record to Maybe Float
This commit is contained in:
parent
103df0bf4e
commit
b1d75d259b
@ -52,9 +52,7 @@ subscriptions _ =
|
||||
-}
|
||||
view : (Msg -> msg) -> Style style msg -> Model -> Element msg
|
||||
view msgMapper style (MaybeProgress maybeProgress) =
|
||||
Widget.circularProgressIndicator style.progressIndicator
|
||||
{ maybeProgress = maybeProgress
|
||||
}
|
||||
Widget.circularProgressIndicator style.progressIndicator maybeProgress
|
||||
|
||||
|
||||
main : Program () Model Msg
|
||||
|
@ -521,12 +521,12 @@ progressIndicator _ style =
|
||||
|> List.map
|
||||
(\completeness ->
|
||||
( "Determinate Progress Indicator, completeness " ++ String.fromFloat completeness
|
||||
, Widget.circularProgressIndicator style.progressIndicator { maybeProgress = Just completeness }
|
||||
, Widget.circularProgressIndicator style.progressIndicator (Just completeness)
|
||||
)
|
||||
)
|
||||
in
|
||||
[ ( "Indeterminate Progress Indicator"
|
||||
, Widget.circularProgressIndicator style.progressIndicator { maybeProgress = Nothing }
|
||||
, Widget.circularProgressIndicator style.progressIndicator Nothing
|
||||
)
|
||||
]
|
||||
++ determinateIndicators
|
||||
|
@ -6,7 +6,7 @@ import Widget.Style exposing (ProgressIndicatorStyle)
|
||||
|
||||
circularProgressIndicator :
|
||||
ProgressIndicatorStyle msg
|
||||
-> { maybeProgress : Maybe Float }
|
||||
-> Maybe Float
|
||||
-> Element msg
|
||||
circularProgressIndicator style { maybeProgress } =
|
||||
circularProgressIndicator style maybeProgress =
|
||||
style.icon maybeProgress
|
||||
|
@ -641,14 +641,14 @@ If `maybeProgress` is set to `Just Float` (where the `Float` is proportion of co
|
||||
|
||||
-}
|
||||
type alias ProgressIndicator =
|
||||
{ maybeProgress : Maybe Float }
|
||||
Maybe Float
|
||||
|
||||
|
||||
{-| Displays a circular progress indicator
|
||||
-}
|
||||
circularProgressIndicator :
|
||||
ProgressIndicatorStyle msg
|
||||
-> { maybeProgress : Maybe Float }
|
||||
-> Maybe Float
|
||||
-> Element msg
|
||||
circularProgressIndicator =
|
||||
ProgressIndicator.circularProgressIndicator
|
||||
|
Loading…
Reference in New Issue
Block a user