mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-06-23 10:58:26 +00:00
Copy/paste form together
This commit is contained in:
22
modules/webapp/src/main/elm/Util/Tag.elm
Normal file
22
modules/webapp/src/main/elm/Util/Tag.elm
Normal file
@ -0,0 +1,22 @@
|
||||
module Util.Tag exposing (makeDropdownModel)
|
||||
|
||||
import Api.Model.Tag exposing (Tag)
|
||||
import Comp.Dropdown
|
||||
import Util.Maybe
|
||||
|
||||
|
||||
makeDropdownModel : Comp.Dropdown.Model Tag
|
||||
makeDropdownModel =
|
||||
Comp.Dropdown.makeModel
|
||||
{ multiple = True
|
||||
, searchable = \n -> n > 4
|
||||
, makeOption = \tag -> { value = tag.id, text = tag.name }
|
||||
, labelColor =
|
||||
\tag ->
|
||||
if Util.Maybe.nonEmpty tag.category then
|
||||
"basic blue"
|
||||
|
||||
else
|
||||
""
|
||||
, placeholder = "Choose a tag…"
|
||||
}
|
Reference in New Issue
Block a user