From e5b71fde06366da69b316e4d18fbe8565648a073 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Debois?= Date: Sun, 10 Apr 2016 21:52:21 +0200 Subject: [PATCH] Re-named State -> Container --- src/Material/Button.elm | 22 ++++++++++------------ src/Material/Textfield.elm | 16 ++++++++-------- 2 files changed, 18 insertions(+), 20 deletions(-) diff --git a/src/Material/Button.elm b/src/Material/Button.elm index 25f1553..b31a605 100644 --- a/src/Material/Button.elm +++ b/src/Material/Button.elm @@ -2,7 +2,7 @@ module Material.Button ( Model, model, Action(Click), update , flat, raised, fab, minifab, icon , colored, primary, accent - , View, State, Instance, instance, fwdClick + , View, Container, Observer, Instance, instance, fwdClick ) where {-| From the [Material Design Lite documentation](http://www.getmdl.io/components/#buttons-section): @@ -40,7 +40,7 @@ for details about what type of buttons are appropriate for which situations. @docs flat, raised, fab, minifab, icon # Component -@docs State, Instance, instance, fwdClick +@docs Container, Observer, Instance, instance, fwdClick -} @@ -261,34 +261,32 @@ icon = view "mdl-button--icon" {-| -} -type alias State s = - { s | button : Indexed Model } +type alias Container c = + { c | button : Indexed Model } +{-| +-} type alias Observer obs = Component.Observer Action obs {-| -} -type alias Instance state obs = +type alias Instance container obs = Component.Instance - Model - state - Action - obs - (List Style -> List Html -> Html) + Model container Action obs (List Style -> List Html -> Html) {-| Component instance. -} instance : Int - -> (Component.Action (State state) obs -> obs) + -> (Component.Action (Container c) obs -> obs) -> (Address Action -> Model -> List Style -> List Html -> Html) -> Model -> List (Observer obs) - -> Instance (State state) obs + -> Instance (Container c) obs instance id lift view model0 observers = Component.instance diff --git a/src/Material/Textfield.elm b/src/Material/Textfield.elm index 47e758c..40b85de 100644 --- a/src/Material/Textfield.elm +++ b/src/Material/Textfield.elm @@ -30,7 +30,7 @@ This implementation provides only single-line. @docs Action, Model, model, update, view # Component -@docs State, Instance +@docs Container, Instance @docs instance, fwdInput, fwdBlur, fwdFocus -} @@ -76,7 +76,7 @@ type Kind -} -{-| Model. The textfield is in its error-state if `error` is not `Nothing`. +{-| Model. The textfield is in its error-container if `error` is not `Nothing`. The contents of the field is `value`. -} type alias Model = @@ -179,24 +179,24 @@ view addr model = {-| -} -type alias State state = - { state | textfield : Indexed Model } +type alias Container c = + { c | textfield : Indexed Model } {-| -} -type alias Instance state obs = - Component.Instance Model state Action obs Html +type alias Instance container obs = + Component.Instance Model container Action obs Html {-| Component constructor. See module `Material`. -} instance : Int - -> (Component.Action (State state) obs -> obs) + -> (Component.Action (Container c) obs -> obs) -> Model -> List (Component.Observer Action obs) - -> Instance (State state) obs + -> Instance (Container c) obs instance = let