Module

Polyform.Field.Html5

#check'

check' :: forall a m. Monad m => (a -> Boolean) -> Validation m (Array a) a a

#checkAndTag'

checkAndTag' :: forall a e e' m n. Monad m => Cons n a e' e => IsSymbol n => SProxy n -> (a -> Boolean) -> Validation m (Array (Variant e)) a a

#IntInputErr

type IntInputErr err = (min :: Int, max :: Int | err)

NumberInput can be used to represent type="range" and type="number" of Integer values

#_min

_min :: SProxy "min"

#_max

_max :: SProxy "max"

#NumberInputBase

type NumberInputBase (type_ :: Symbol) attrs name err value f = Input (min :: Maybe value, max :: Maybe value, step :: Maybe value, type :: SProxy type_ | attrs) name (Array (Variant err)) (f value)

I'm not sure if this type ∷ SProxy attribute is really good idea. If you find it problematic please fill an issue.

#I

type I a = a

#IntRangeInput

type IntRangeInput attrs name err = NumberInputBase "range" attrs name (IntInputErr err) Int I

#OptIntRangeInput

type OptIntRangeInput attrs name err = NumberInputBase "range" attrs name (IntInputErr err) Int Maybe

#IntInput

type IntInput attrs name err = NumberInputBase "number" attrs name (IntInputErr err) Int I

#OptIntInput

type OptIntInput attrs name err = NumberInputBase "number" attrs name (IntInputErr err) Int Maybe

#numberInputValidation

numberInputValidation :: forall attrs err m v. Monad m => Ord v => { min :: Maybe v, max :: Maybe v | attrs } -> Validation m (Array (Variant (min :: v, max :: v | err))) v v

#TextInputErr

type TextInputErr err = (maxlength :: String, minlength :: String | err)

#TextInputBase

type TextInputBase (type_ :: Symbol) attrs name err value = Input (maxlength :: Maybe Int, minlength :: Maybe Int, type :: SProxy type_ | attrs) name (Array (Variant (TextInputErr err))) value

#EmailInput

type EmailInput attrs name err = TextInputBase "email" attrs name err String

All these input types share same attributes... but email. Email has additional "multiple" attribute but this will be handled by separate field for handling list of emails.

#OptEmailInput

type OptEmailInput attrs name err = TextInputBase "email" attrs name err (Maybe String)

#SearchInput

type SearchInput attrs name err = TextInputBase "search" attrs name err String

#OptSearchInput

type OptSearchInput attrs name err = TextInputBase "search" attrs name err (Maybe String)

#PasswordInput

type PasswordInput attrs name err = TextInputBase "password" attrs name err String

#OptPasswordInput

type OptPasswordInput attrs name err = TextInputBase "password" attrs name err (Maybe String)

#TelInput

type TelInput attrs name err = TextInputBase "tel" attrs name err String

#OptTelInput

type OptTelInput attrs name err = TextInputBase "tel" attrs name err (Maybe String)

#TextInput

type TextInput attrs name err = TextInputBase "text" attrs name err String

#OptTextInput

type OptTextInput attrs name err = TextInputBase "text" attrs name err (Maybe String)

#UrlInput

type UrlInput attrs name err = TextInputBase "url" attrs name err String

#OptUrlInput

type OptUrlInput attrs name err = TextInputBase "url" attrs name err (Maybe String)

#_maxlength

_maxlength :: SProxy "maxlength"

#_minlength

_minlength :: SProxy "minlength"

#textInputValidation

textInputValidation :: forall attrs err m. Monad m => { maxlength :: Maybe Int, minlength :: Maybe Int | attrs } -> Validation m (Array (Variant (TextInputErr err))) String String

Modules