Draft checkbox, switch, radio.

This commit is contained in:
Søren Debois 2016-04-21 17:15:50 +02:00
parent 923256cffe
commit 103c74b880
2 changed files with 11 additions and 0 deletions

View file

@ -27,6 +27,7 @@ import Demo.Textfields
import Demo.Snackbar import Demo.Snackbar
import Demo.Badges import Demo.Badges
import Demo.Elevation import Demo.Elevation
import Demo.Toggles
--import Demo.Template --import Demo.Template
@ -76,6 +77,7 @@ type alias Model =
, routing : Routing , routing : Routing
, buttons : Demo.Buttons.Model , buttons : Demo.Buttons.Model
, textfields : Demo.Textfields.Model , textfields : Demo.Textfields.Model
, toggles : Demo.Toggles.Model
, snackbar : Demo.Snackbar.Model , snackbar : Demo.Snackbar.Model
--, template : Demo.Template.Model --, template : Demo.Template.Model
} }
@ -87,6 +89,7 @@ model =
, routing = route0 , routing = route0
, buttons = Demo.Buttons.model , buttons = Demo.Buttons.model
, textfields = Demo.Textfields.model , textfields = Demo.Textfields.model
, toggles = Demo.Toggles.model
, snackbar = Demo.Snackbar.model , snackbar = Demo.Snackbar.model
--, template = Demo.Template.model --, template = Demo.Template.model
} }
@ -105,6 +108,7 @@ type Action
| ButtonsAction Demo.Buttons.Action | ButtonsAction Demo.Buttons.Action
| TextfieldAction Demo.Textfields.Action | TextfieldAction Demo.Textfields.Action
| SnackbarAction Demo.Snackbar.Action | SnackbarAction Demo.Snackbar.Action
| TogglesAction Demo.Toggles.Action
-- | TemplateAction Demo.Template.Action -- | TemplateAction Demo.Template.Action
@ -148,6 +152,8 @@ update action model =
SnackbarAction a -> lift .snackbar (\m x->{m|snackbar =x}) SnackbarAction Demo.Snackbar.update a model SnackbarAction a -> lift .snackbar (\m x->{m|snackbar =x}) SnackbarAction Demo.Snackbar.update a model
TogglesAction a -> lift .toggles (\m x->{m|toggles =x}) TogglesAction Demo.Toggles.update a model
--TemplateAction a -> lift .template (\m x->{m|template =x}) TemplateAction Demo.Template.update a model --TemplateAction a -> lift .template (\m x->{m|template =x}) TemplateAction Demo.Template.update a model
@ -207,6 +213,8 @@ tabs =
Demo.Snackbar.view (Signal.forwardTo addr SnackbarAction) model.snackbar) Demo.Snackbar.view (Signal.forwardTo addr SnackbarAction) model.snackbar)
, ("Textfields", "textfields", \addr model -> , ("Textfields", "textfields", \addr model ->
Demo.Textfields.view (Signal.forwardTo addr TextfieldAction) model.textfields) Demo.Textfields.view (Signal.forwardTo addr TextfieldAction) model.textfields)
, ("Toggles", "toggles", \addr model ->
Demo.Toggles.view (Signal.forwardTo addr TogglesAction) model.toggles)
--, ("Template", "tempate", \addr model -> --, ("Template", "tempate", \addr model ->
-- Demo.Template.view (Signal.forwardTo addr TemplateAction) model.template) -- Demo.Template.view (Signal.forwardTo addr TemplateAction) model.template)
] ]

View file

@ -170,6 +170,7 @@ import Effects exposing (Effects)
import Material.Button as Button import Material.Button as Button
import Material.Textfield as Textfield import Material.Textfield as Textfield
import Material.Snackbar as Snackbar import Material.Snackbar as Snackbar
import Material.Toggles as Toggles
import Material.Component as Component exposing (Indexed) import Material.Component as Component exposing (Indexed)
--import Material.Template as Template --import Material.Template as Template
@ -181,6 +182,7 @@ type alias Model =
{ button : Indexed Button.Model { button : Indexed Button.Model
, textfield : Indexed Textfield.Model , textfield : Indexed Textfield.Model
, snackbar : Maybe (Snackbar.Model Int) , snackbar : Maybe (Snackbar.Model Int)
, toggles : Indexed Toggles.Model
-- , template : Indexed Template.Model -- , template : Indexed Template.Model
} }
@ -192,6 +194,7 @@ model =
{ button = Dict.empty { button = Dict.empty
, textfield = Dict.empty , textfield = Dict.empty
, snackbar = Nothing , snackbar = Nothing
, toggles = Dict.empty
--, template = Dict.empty --, template = Dict.empty
} }