Remove old ui code in frontend

This commit is contained in:
Eike Kettner
2021-03-09 20:16:05 +01:00
parent ee694dc719
commit b95338e744
90 changed files with 50 additions and 11038 deletions

View File

@ -7,7 +7,6 @@ module Comp.CustomFieldInput exposing
, initWith
, update
, updateSearch
, view
, view2
)
@ -329,118 +328,6 @@ hasWildCards msg =
--- View
removeButton : String -> Html Msg
removeButton classes =
a
[ class "ui icon button"
, class classes
, href "#"
, title "Remove this value"
, onClick Remove
]
[ i [ class "trash alternate outline icon" ] []
]
view : String -> Maybe String -> Model -> Html Msg
view classes icon model =
let
error =
errorMsg model
in
div
[ class classes
, classList
[ ( "error", error /= Nothing )
]
]
[ label []
[ mkLabel model |> text
]
, makeInput icon model
, div
[ class "ui red pointing basic label"
, classList
[ ( "invisible hidden", error == Nothing )
]
]
[ Maybe.withDefault "" error |> text
]
]
makeInput : Maybe String -> Model -> Html Msg
makeInput icon model =
let
iconOr c =
Maybe.withDefault c icon
in
case model.fieldModel of
TextField v ->
div [ class "ui action left icon input" ]
[ input
[ type_ "text"
, Maybe.withDefault "" v |> value
, onInput SetText
]
[]
, removeButton ""
, i [ class (iconOr <| Icons.customFieldType Data.CustomFieldType.Text) ] []
]
NumberField nm ->
div [ class "ui action left icon input" ]
[ input
[ type_ "text"
, value nm.input
, onInput NumberMsg
]
[]
, removeButton ""
, i [ class (iconOr <| Icons.customFieldType Data.CustomFieldType.Numeric) ] []
]
MoneyField nm ->
div [ class "ui action left icon input" ]
[ input
[ type_ "text"
, value nm.input
, onInput MoneyMsg
]
[]
, removeButton ""
, i [ class (iconOr <| Icons.customFieldType Data.CustomFieldType.Money) ] []
]
BoolField b ->
div [ class "ui container" ]
[ div [ class "ui checkbox" ]
[ input
[ type_ "checkbox"
, onCheck (\_ -> ToggleBool)
, checked b
]
[]
, label []
[ text (mkLabel model)
]
]
, removeButton "right floated"
]
DateField v dp ->
div [ class "ui action left icon input" ]
[ Html.map DateMsg
(Comp.DatePicker.view v Comp.DatePicker.defaultSettings dp)
, removeButton ""
, i [ class (iconOr <| Icons.customFieldType Data.CustomFieldType.Date) ] []
]
--- View2