mirror of
https://github.com/correl/elm-mdl.git
synced 2024-12-18 03:00:11 +00:00
Moved the demo into a separate folder to avoid bloating elm-mdl package imports
This commit is contained in:
parent
e5b71fde06
commit
f0a8591265
12 changed files with 22 additions and 16 deletions
6
Makefile
6
Makefile
|
@ -4,7 +4,7 @@ comp:
|
|||
elm-make examples/Component.elm --warn --output elm.js
|
||||
|
||||
demo:
|
||||
elm-make examples/Demo.elm --warn --output elm.js
|
||||
(cd demo; elm-make Demo.elm --warn --output ../elm.js)
|
||||
|
||||
wip-pages :
|
||||
elm-make examples/Demo.elm --output $(PAGES)/wip.js
|
||||
|
@ -18,10 +18,10 @@ cleanish :
|
|||
rm -f elm.js index.html
|
||||
|
||||
clean :
|
||||
rm -rf elm-stuff/build-artifacts
|
||||
rm -rf elm-stuff/build-artifacts demo/elm-stuff/build-artifacts
|
||||
|
||||
distclean : clean
|
||||
rm -rf elm-stuff
|
||||
|
||||
|
||||
.PHONY : pages elm.js clean cleanish distclean
|
||||
.PHONY : pages elm.js clean cleanish distclean demo
|
||||
|
|
|
@ -16,7 +16,9 @@
|
|||
"Material.Textfield",
|
||||
"Material.Layout",
|
||||
"Material.Grid",
|
||||
"Material.Component"
|
||||
"Material.Component",
|
||||
"Material.Elevation",
|
||||
"Material.Snackbar"
|
||||
],
|
||||
"dependencies": {
|
||||
"debois/elm-dom": "1.0.0 <= v < 2.0.0",
|
||||
|
@ -24,8 +26,7 @@
|
|||
"evancz/elm-effects": "2.0.1 <= v < 3.0.0",
|
||||
"evancz/elm-html": "4.0.2 <= v < 5.0.0",
|
||||
"evancz/elm-markdown": "2.0.1 <= v < 3.0.0",
|
||||
"evancz/start-app": "2.0.2 <= v < 3.0.0",
|
||||
"sporto/hop": "3.0.0 <= v < 4.0.0"
|
||||
"evancz/start-app": "2.0.2 <= v < 3.0.0"
|
||||
},
|
||||
"elm-version": "0.16.0 <= v < 0.17.0"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,13 +8,16 @@ module Material.Snackbar
|
|||
{-| TODO
|
||||
|
||||
# Model
|
||||
@ docs Contents, Model, model, toast, snackbar
|
||||
@docs Contents, Model, model, toast, snackbar, isActive, activeAction
|
||||
|
||||
# Action, Update
|
||||
@docs Action, update
|
||||
|
||||
# View
|
||||
@docs view
|
||||
|
||||
# Component support
|
||||
@docs Instance, add, instance
|
||||
-}
|
||||
|
||||
import Html exposing (..)
|
||||
|
@ -230,6 +233,8 @@ update action model =
|
|||
-- VIEW
|
||||
|
||||
|
||||
{-|
|
||||
-}
|
||||
view : Signal.Address (Action a) -> Model a -> Html
|
||||
view addr model =
|
||||
let
|
||||
|
@ -283,14 +288,14 @@ view addr model =
|
|||
|
||||
{-|
|
||||
-}
|
||||
type alias State s obs =
|
||||
type alias Container s obs =
|
||||
{ s | snackbar : Maybe (Model obs) }
|
||||
|
||||
|
||||
{-|
|
||||
-}
|
||||
type alias Instance state obs =
|
||||
Component.Instance (Model obs) state (Action obs) obs Html
|
||||
type alias Instance container obs =
|
||||
Component.Instance (Model obs) container (Action obs) obs Html
|
||||
|
||||
|
||||
{-|
|
||||
|
@ -312,9 +317,9 @@ actionObserver action =
|
|||
{-| Component instance.
|
||||
-}
|
||||
instance
|
||||
: (Component.Action (State state obs) obs -> obs)
|
||||
: (Component.Action (Container c obs) obs -> obs)
|
||||
-> (Model obs)
|
||||
-> Instance (State state obs) obs
|
||||
-> Instance (Container c obs) obs
|
||||
|
||||
instance lift model0 =
|
||||
Component.instance1
|
||||
|
@ -325,9 +330,9 @@ instance lift model0 =
|
|||
-}
|
||||
add :
|
||||
Contents obs
|
||||
-> Instance (State state obs) obs
|
||||
-> (State state obs)
|
||||
-> (State state obs, Effects obs)
|
||||
-> Instance (Container c obs) obs
|
||||
-> (Container c obs)
|
||||
-> (Container c obs, Effects obs)
|
||||
add contents inst model =
|
||||
let
|
||||
(sb, fx) =
|
||||
|
|
Loading…
Reference in a new issue