WIP: integrating autocomplete web browser features.

caa
Philippe Pittoli 2024-11-16 06:21:52 +01:00
parent a349c6463d
commit 61f7ef65bd
2 changed files with 19 additions and 6 deletions

View File

@ -109,11 +109,7 @@ render { registrationForm }
password_input <> password_error <>
legal_mentions <> validation_btn)
login_input
= [ Bulma.box_input "loginREGISTER" "Login" "login" -- title, placeholder
(HandleRegisterInput <<< REG_INP_login) -- action
registrationForm.login -- value
]
login_input = [ Bulma.login_input "Login" registrationForm.login (HandleRegisterInput <<< REG_INP_login) ]
login_error
= case between 0 1 (S.length registrationForm.login), L.login registrationForm.login of

View File

@ -1,6 +1,6 @@
-- | The `Bulma` module is a wrapper around the BULMA css framework.
module Bulma where
import Prelude
import Prelude (class Show, map, show, ($), (<>), (==))
import Data.Maybe (Maybe, fromMaybe)
import Data.Tuple (Tuple, fst, snd)
@ -10,6 +10,7 @@ import Halogen.HTML.Properties as HP
import Halogen.HTML.Events as HE
import MissingHTMLProperties as MissingProperties
import DOM.HTML.Indexed.AutocompleteType (AutocompleteType(..))
import CSSClasses as C
import Halogen.HTML.Core (AttrName(..))
@ -542,6 +543,22 @@ box_password_ = field_inner true
box_input :: forall w i. String -> String -> String -> (String -> i) -> String -> HH.HTML w i
box_input = box_input_ (HP.enabled true)
login_input :: forall w i. String -> String -> (String -> i) -> HH.HTML w i
login_input title value action
= div_field []
[ div_field_label "username" title
, div_field_content $ HH.input
[ HE.onValueInput action
, MissingProperties.ty "text"
, HP.value value
, HP.name "username"
, HP.autocomplete AutocompleteUsername
, HP.placeholder "Username"
, HP.id "username"
, HP.classes input_classes
]
]
box_password :: forall w i. String -> String -> String -> (String -> i) -> String -> HH.HTML w i
box_password = box_password_ (HP.enabled true)