Module

Lumi.Components.Form.Internal

Package
purescript-lumi-components
Repository
lumihq/purescript-lumi-components

#Tree Source

data Tree

Constructors

Instances

#Forest Source

#pruneTree Source

pruneTree :: Tree -> Maybe Tree

Traverse a tree bottom-up, removing all "internal" nodes (i.e. Wrapper or Node constructors) which have empty children arrays. In the case where there's nothing left in the tree after pruning, we return Nothing.

We need to perform the traversal bottom-up because, for example, a subtree such as

let
  w children = Wrapper { key: Nothing, children }
in
  w [w []]

should be pruned, but a top-down operation would not be able to identify such a subtree as prunable.

#FormBuilder' Source

newtype FormBuilder' ui props unvalidated result

An applicative functor which can be used to build forms. Forms can be turned into components using the build function.

Constructors

Instances

#FormBuilder Source

type FormBuilder props unvalidated result = FormBuilder' Forest props unvalidated result

#parallel Source

parallel :: forall value props. String -> (SeqFormBuilder props value) ~> (FormBuilder props value)

#sequential Source

sequential :: forall value props. String -> (FormBuilder props value) ~> (SeqFormBuilder props value)

#SeqFormBuilder' Source

newtype SeqFormBuilder' ui props unvalidated result

A form builder where each field depends on the validity of the previous ones. That is, every field is only displayed if all the previous ones are valid. Forms can be turned into components using the build function.

Constructors

Instances

#SeqFormBuilder Source

type SeqFormBuilder props unvalidated result = SeqFormBuilder' Forest props unvalidated result

#formBuilder Source

formBuilder :: forall a unvalidated props. (props -> unvalidated -> { edit :: ((unvalidated -> unvalidated) -> Effect Unit) -> JSX, validate :: Maybe a }) -> FormBuilder props unvalidated a

Create a FormBuilder from a function which produces a form element as JSX and a validated result.

#formBuilder_ Source

formBuilder_ :: forall a props. (props -> a -> (a -> Effect Unit) -> JSX) -> FormBuilder props a a

The simplest way to create a FormBuilder. Create a FormBuilder provided a function that, given the current value and a change callback, renders a form element as JSX.

#invalidate Source

invalidate :: forall b a unvalidated props ui. FormBuilder' ui props unvalidated a -> FormBuilder' ui props unvalidated b

Invalidate a form, keeping its user interface but discarding the result and possibly changing its type.

#revalidate Source

revalidate :: forall result unvalidated props ui. FormBuilder' ui props unvalidated result -> props -> unvalidated -> Maybe result

Revalidate the form, in order to display error messages or create a validated result.

#listen Source

listen :: forall result unvalidated props ui. (unvalidated -> Aff (unvalidated -> unvalidated)) -> FormBuilder' ui props unvalidated result -> FormBuilder' ui props unvalidated result

Listens for changes in a form's value and allows for performing asynchronous effects and additional value changes.

Modules
JSS
Lumi.Components
Lumi.Components.Badge
Lumi.Components.Border
Lumi.Components.Breadcrumb
Lumi.Components.Button
Lumi.Components.ButtonGroup
Lumi.Components.Card
Lumi.Components.CardGrid
Lumi.Components.Color
Lumi.Components.Column
Lumi.Components.Details
Lumi.Components.Divider
Lumi.Components.DropdownButton
Lumi.Components.EditableTable
Lumi.Components.FetchCache
Lumi.Components.FixedPrecisionInput
Lumi.Components.Form
Lumi.Components.Form.Defaults
Lumi.Components.Form.Internal
Lumi.Components.Form.Table
Lumi.Components.Form.Validation
Lumi.Components.Icon
Lumi.Components.Images
Lumi.Components.Input
Lumi.Components.InputGroup
Lumi.Components.LabeledField
Lumi.Components.Layouts
Lumi.Components.Layouts.Centered
Lumi.Components.Layouts.OneColumnWithHeader
Lumi.Components.Layouts.Tabs
Lumi.Components.Link
Lumi.Components.List
Lumi.Components.Loader
Lumi.Components.Lockup
Lumi.Components.Modal
Lumi.Components.NativeSelect
Lumi.Components.Navigation
Lumi.Components.Orientation
Lumi.Components.Pagination
Lumi.Components.Pill
Lumi.Components.Progress
Lumi.Components.Responsive
Lumi.Components.Row
Lumi.Components.Select
Lumi.Components.Select.Backend
Lumi.Components.Size
Lumi.Components.Slider
Lumi.Components.Spacing
Lumi.Components.Status
Lumi.Components.StatusSlat
Lumi.Components.Styles
Lumi.Components.Svg
Lumi.Components.Tab
Lumi.Components.Table
Lumi.Components.Table.FilterDropdown
Lumi.Components.Text
Lumi.Components.Textarea
Lumi.Components.Toast
Lumi.Components.Tooltip
Lumi.Components.Upload
Lumi.Components.Utility.ReactRouter
Lumi.Components.Wizard
Lumi.Components.ZIndex
Lumi.Components2.Box
Lumi.Components2.Button
Lumi.Components2.ButtonGroup
Lumi.Components2.Link
Lumi.Components2.Slat
Lumi.Styles
Lumi.Styles.Border
Lumi.Styles.Box
Lumi.Styles.Button
Lumi.Styles.Link
Lumi.Styles.Loader
Lumi.Styles.Slat
Lumi.Styles.Theme