Module

Pux.Form

Package
purescript-pux-form
Repository
b123400/purescript-pux-form

#FieldsF Source

data FieldsF s e a a2

#Fields Source

type Fields s e a = Exists (FieldsF s e a)

#field Source

field :: forall a e s. Render a => Lens s s a a -> Fields s e a

Wraps a lens into a field, without HTML label

#andField Source

andField :: forall a2 a1 e s. Fields s e a1 -> Fields s e a2 -> Fields s e a2

Combine 2 fields

#(.+) Source

Operator alias for Pux.Form.andField (left-associative / precedence 4)

#fieldWrapped Source

fieldWrapped :: forall a e s. Render a => Lens s s a a -> (HTML e -> HTML e) -> Fields s e a

Create a field with a lens and a function that wraps around the <input> element. For example typical form would wrap <input> with a <label> tag. See fieldWithLabel for example.

#fieldWithLabel Source

fieldWithLabel :: forall a e s. Render a => Lens s s a a -> HTML e -> Fields s e a

Create a field with a lens and a HTML element. The element will be added in front of the <input> element, inside the <label> tag.

#fieldWithText Source

fieldWithText :: forall a e s. Render a => Lens s s a a -> String -> Fields s e a

Create a field with a lens and a String that is used as the label.

#(.|) Source

Operator alias for Pux.Form.fieldWrapped (left-associative / precedence 5)

#(./) Source

Operator alias for Pux.Form.fieldWithLabel (left-associative / precedence 5)

#(.\) Source

Operator alias for Pux.Form.fieldWithText (left-associative / precedence 5)

#withPred Source

withPred :: forall e a s. Fields s e a -> (a -> Boolean) -> Fields s e a

Add a condition to the field. If the condition does not match, the field won't be updated.

#(.?) Source

Operator alias for Pux.Form.withPred (left-associative / precedence 5)

#form Source

form :: forall a1 e s. s -> Fields s e a1 -> (s -> e) -> HTML e

Turns fields into the form HTML.

Re-exports from Pux.Form.Render