Module to add a file DropZone to your app
Add a DropZone.Model to your model.
type alias MyModel =
{ myDropZone : DropZone.Model
}Add a DropZone.Model to your model.
myInitialModel : MyModel
myInitialModel =
{ myDropZone = DropZone.init -- optionally pipe into State Setters
}Add a DropZone.Msg to your Msg.
type MyMsg
= UpdateMyDropZone DropZone.MsgUse in your update function.
myUpdate : Msg -> Model -> (Model, Cmd Msg)
myUpdate msg model =
case msg of
UpdateMyDropZone dropZoneMsg ->
{ model | myDropZone = DropZone.update dropZoneMsg model.myDropZone } ! []Transform an DropZone.Model into an DropZone.View, which allows us to pipe View Setters on it.
myView : Model -> Html Msg
myView model =
div
[]
[ DropZone.view model.myDropZone -- pipe view setters here, for example |> setIsLocked 'your logic here'
]Transforms an DropZone.View into Html DropZone.Msg
myView : Model -> Html Msg
myView model =
div
[]
[ DropZone.view model.myDropZone
|> DropZone.render
|> Html.map UpdateMyDropZone
]ReInitialise your DropZone.Model.
Reset your DropZone.Model.
Set the initial files of your DropZone.Model.
Change the files of your DropZone.Model.
Set whether your input is in error mode (red border).
Set whether your input is locked (disabled).
Set the label for your DropZone.
Get the current value of your DropZone. This is what you'd use to display the data somewhere outside of your DropZone, or to send the files to the backend for example etc.
Whether your DropZone was changed. Useful if you want to disable save buttons unless there were changes etc.
The result of a file reading operation