mirror of
https://github.com/NoRedInk/noredink-ui.git
synced 2024-11-30 14:48:09 +03:00
🎨 clean up uses of TextIntput.view_
This commit is contained in:
parent
15a3cb407f
commit
ca240968f0
@ -83,17 +83,17 @@ number =
|
|||||||
{-| -}
|
{-| -}
|
||||||
view : Model value msg -> Html msg
|
view : Model value msg -> Html msg
|
||||||
view model =
|
view model =
|
||||||
view_ OverlappingLabel [] model
|
view_ [ styles.class [ OverlappingLabel ] ] model
|
||||||
|
|
||||||
|
|
||||||
{-| -}
|
{-| -}
|
||||||
withInvisibleLabel : Model value msg -> Html msg
|
withInvisibleLabel : Model value msg -> Html msg
|
||||||
withInvisibleLabel model =
|
withInvisibleLabel model =
|
||||||
view_ InvisibleLabel [ Accessibility.Style.invisible ] model
|
view_ [ Accessibility.Style.invisible ] model
|
||||||
|
|
||||||
|
|
||||||
view_ : CssClasses -> List (Html.Attribute msg) -> Model value msg -> Html msg
|
view_ : List (Html.Attribute msg) -> Model value msg -> Html msg
|
||||||
view_ labelClass attributes model =
|
view_ attributes model =
|
||||||
let
|
let
|
||||||
idValue =
|
idValue =
|
||||||
"Nri-Ui-TextInput-" ++ dashify model.label
|
"Nri-Ui-TextInput-" ++ dashify model.label
|
||||||
@ -113,18 +113,13 @@ view_ labelClass attributes model =
|
|||||||
]
|
]
|
||||||
[]
|
[]
|
||||||
, label
|
, label
|
||||||
([ for idValue
|
(for idValue :: attributes)
|
||||||
, styles.class [ labelClass ]
|
|
||||||
]
|
|
||||||
++ attributes
|
|
||||||
)
|
|
||||||
[ Html.text model.label ]
|
[ Html.text model.label ]
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
type CssClasses
|
type CssClasses
|
||||||
= InvisibleLabel
|
= OverlappingLabel
|
||||||
| OverlappingLabel
|
|
||||||
| Input
|
| Input
|
||||||
| OverlappingLabelInput
|
| OverlappingLabelInput
|
||||||
| IsInError
|
| IsInError
|
||||||
|
Loading…
Reference in New Issue
Block a user