Lumi.Components.Form.Validation
- Package
- purescript-lumi-components
- Repository
- lumihq/purescript-lumi-components
#nonEmpty Source
nonEmpty :: String -> Validator String NonEmptyString
A Validator
which verifies that an input string is non-empty.
#nonEmptyArray Source
nonEmptyArray :: forall a. String -> Validator (Array a) (NonEmptyArray a)
A Validator
which verifies that an input array is non-empty.
#validNumber Source
validNumber :: String -> Validator String Number
A Validator
which verifies that its input can be parsed as a number.
#Validated Source
data Validated a
The Validated
type describes the state of a validated form field. This
state may be used to modify the way this form field or its validation
messages are displayed.
TODO: maybe convert this type to a record? Possible extensions to this
type (as a record) could be a field valid :: Boolean
to display an
indicator that the field is valid, or a field
validating :: Maybe (Canceler a)
to control form fields with asynchronous
validation.
Constructors
Instances
#_Validated Source
_Validated :: forall b a. Lens (Validated a) (Validated b) a b
Lens for viewing and modifying Validated
values.
#setFresh Source
setFresh :: forall value. Mapping ModifyValidated value value => value -> value
Sets all Validated
fields in a record to Fresh
, hiding all validation
messages.
#setModified Source
setModified :: forall value. Mapping ModifyValidated value value => value -> value
Sets all Validated
fields in a record to Modified
, showing all
validation messages.
#ModifyValidated Source
newtype ModifyValidated
Internal utility type for modifying the validated state of fields in
records containing Validated
values.
Constructors
Instances
(Mapping ModifyValidated a a) => Mapping ModifyValidated (Validated a) (Validated a)
(RowToList r xs, MapRecordWithIndex xs (ConstMapping ModifyValidated) r r) => Mapping ModifyValidated (Record r) (Record r)
(Mapping ModifyValidated a a) => Mapping ModifyValidated (Array a) (Array a)
Mapping ModifyValidated a a
#CanValidate Source
class CanValidate u v | u -> v where
Internal utility type class used to flatten repeated applications of
Validated
to a type.
Members
Instances
CanValidate (Validated a) a
CanValidate a a
#validated Source
validated :: forall result_ result validated unvalidated props. CanValidate unvalidated validated => Validator result_ result -> FormBuilder { readonly :: Boolean | props } unvalidated result_ -> FormBuilder { readonly :: Boolean | props } (Validated validated) result
Attach a validation function to a FormBuilder p u a
, producing a new
FormBuilder
that takes a Validated u
as form state and displays an
error message if its form data is invalid.
This Validated
data type describes a form field as either Fresh
or
Modified
, so that validation messages are only displayed if the field
is Modified
.
#warn Source
warn :: forall result validated unvalidated props. CanValidate unvalidated validated => WarningValidator result -> FormBuilder { readonly :: Boolean | props } unvalidated result -> FormBuilder { readonly :: Boolean | props } (Validated validated) result
Attach a validation function to a FormBuilder p u a
, producing a new
FormBuilder
that takes a Validated u
as form state and displays a
warning message if its form data triggers a warning, while still allowing
the form to proceed.
- 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