Fixed bugs on master

This commit is contained in:
Lucas Payr 2021-12-19 14:50:37 +01:00
parent 53e4d7c3f1
commit 76da2e9e36
3 changed files with 106 additions and 39 deletions

View File

@ -1,6 +1,6 @@
module Internal.Material.TextInput exposing (textInputAttributes,searchInput, textInput, textInputBase)
module Internal.Material.TextInput exposing (searchInput, textInput, textInputAttributes, textInputBase)
import Element
import Element exposing (Attribute)
import Element.Border as Border
import Internal.Material.Chip as Chip
import Internal.Material.Palette exposing (Palette)
@ -8,9 +8,11 @@ import Internal.TextInput exposing (TextInputStyle)
import Widget.Customize as Customize
import Widget.Material.Color as MaterialColor
textInputAttributes : Palette -> List (Attribute msg)
textInputAttributes palette =
(textInput palette).content.text
(textInput palette).content.text.elementTextInput
textInput : Palette -> TextInputStyle msg
textInput palette =

View File

@ -1,8 +1,15 @@
module Internal.TextInput exposing (TextInput, TextInputStyle, usernameInput,textInput
, emailInput,searchInput,spellCheckedInput)
module Internal.TextInput exposing
( TextInput
, TextInputStyle
, emailInput
, searchInput
, spellCheckedInput
, textInput
, usernameInput
)
import Element exposing (Attribute, Element)
import Element.Input as Input exposing (Placeholder)
import Element.Input as Input exposing (Label, Placeholder)
import Internal.Button as Button exposing (Button, ButtonStyle)
@ -29,33 +36,45 @@ type alias TextInput msg =
, onChange : String -> msg
}
spellCheckedInput : TextInputStyle msg -> TextInput msg -> Element msg
spellCheckedInput =
internal Input.spellChecked
searchInput : TextInputStyle msg -> TextInput msg -> Element msg
searchInput =
internal Input.search
emailInput : TextInputStyle msg -> TextInput msg -> Element msg
emailInput =
internal Input.email
usernameInput : TextInputStyle msg -> TextInput msg -> Element msg
usernameInput =
internal Input.username
textInput : TextInputStyle msg -> TextInput msg -> Element msg
textInput =
internal Input.text
internal : (List (Attribute msg)
-> { onChange : String -> msg
internal :
(List (Attribute msg)
->
{ onChange : String -> msg
, text : String
, placeholder : Maybe (Placeholder msg)
, label : Label msg
}
-> Element msg) -> TextInputStyle msg -> TextInput msg -> Element msg
-> Element msg
)
-> TextInputStyle msg
-> TextInput msg
-> Element msg
internal fun style { chips, placeholder, label, text, onChange } =
Element.row style.elementRow
[ if chips |> List.isEmpty then

View File

@ -19,12 +19,11 @@ module Widget exposing
, itemList
, AppBarStyle, menuBar, tabBar
, SortTableStyle, SortTable, Column, sortTable, floatColumn, intColumn, stringColumn, unsortableColumn
, TextInputStyle, TextInput, textInput
, PasswordInputStyle, PasswordInput, newPasswordInput, currentPasswordInput
, TextInputStyle, TextInput, textInput, usernameInput, emailInput, searchInput, spellCheckedInput
, PasswordInputStyle, PasswordInput
, TabStyle, Tab, tab
, ProgressIndicatorStyle, ProgressIndicator, circularProgressIndicator
, usernameInput
, emailInput,searchInput,spellCheckedInput
, newPasswordInput, currentPasswordInput
)
{-| This module contains different stateless view functions. No wiring required.
@ -153,6 +152,7 @@ You can create you own widgets by sticking widgets types together.
@docs ProgressIndicatorStyle, ProgressIndicator, circularProgressIndicator
# DEPRECATED
@docs newPasswordInput, currentPasswordInput
@ -858,12 +858,16 @@ type alias PasswordInput msg =
{-| An input field that supports auto filling the current password
-}
currentPasswordInputV2 : PasswordInputStyle msg -> { text : String
currentPasswordInputV2 :
PasswordInputStyle msg
->
{ text : String
, placeholder : Maybe (Placeholder msg)
, label : String
, onChange : String -> msg
, show : Bool
} -> Element msg
}
-> Element msg
currentPasswordInputV2 =
let
fun : PasswordInputStyle msg -> PasswordInput msg -> Element msg
@ -875,12 +879,16 @@ currentPasswordInputV2 =
{-| An input field that supports auto filling the new password
-}
newPasswordInputV2 : PasswordInputStyle msg -> { text : String
newPasswordInputV2 :
PasswordInputStyle msg
->
{ text : String
, placeholder : Maybe (Placeholder msg)
, label : String
, onChange : String -> msg
, show : Bool
} -> Element msg
}
-> Element msg
newPasswordInputV2 =
let
fun : PasswordInputStyle msg -> PasswordInput msg -> Element msg
@ -889,9 +897,19 @@ newPasswordInputV2 =
in
fun
{-| An input field that supports auto filling the username
-}
usernameInput : Palette -> TextInputStyle msg
usernameInput :
TextInputStyle msg
->
{ chips : List (Button msg)
, text : String
, placeholder : Maybe (Placeholder msg)
, label : String
, onChange : String -> msg
}
-> Element msg
usernameInput =
let
fun : TextInputStyle msg -> TextInput msg -> Element msg
@ -900,9 +918,19 @@ usernameInput =
in
fun
{-| An input field that supports auto filling the email
-}
emailInput : Palette -> TextInputStyle msg
emailInput :
TextInputStyle msg
->
{ chips : List (Button msg)
, text : String
, placeholder : Maybe (Placeholder msg)
, label : String
, onChange : String -> msg
}
-> Element msg
emailInput =
let
fun : TextInputStyle msg -> TextInput msg -> Element msg
@ -911,9 +939,19 @@ emailInput =
in
fun
{-| An input field that supports searching
-}
searchInput : Palette -> TextInputStyle msg
searchInput :
TextInputStyle msg
->
{ chips : List (Button msg)
, text : String
, placeholder : Maybe (Placeholder msg)
, label : String
, onChange : String -> msg
}
-> Element msg
searchInput =
let
fun : TextInputStyle msg -> TextInput msg -> Element msg
@ -922,9 +960,19 @@ searchInput =
in
fun
{-| An input field that supports spell checking
-}
spellCheckedInput : Palette -> TextInputStyle msg
spellCheckedInput :
TextInputStyle msg
->
{ chips : List (Button msg)
, text : String
, placeholder : Maybe (Placeholder msg)
, label : String
, onChange : String -> msg
}
-> Element msg
spellCheckedInput =
let
fun : TextInputStyle msg -> TextInput msg -> Element msg
@ -934,6 +982,7 @@ spellCheckedInput =
fun
{----------------------------------------------------------
- LIST
----------------------------------------------------------}
@ -2134,8 +2183,6 @@ circularProgressIndicator =
----------------------------------------------------------}
{-| An input field that supports auto filling the current password
-}
currentPasswordInput : PasswordInputStyle msg -> PasswordInput msg -> Element msg
@ -2148,4 +2195,3 @@ currentPasswordInput =
newPasswordInput : PasswordInputStyle msg -> PasswordInput msg -> Element msg
newPasswordInput =
PasswordInput.newPasswordInput