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.
#nonEmpty' Source
nonEmpty' :: String -> Validator String NonEmptyString
nonEmpty
, but the argument is the entire validation message.
#nonEmptyArray' Source
nonEmptyArray' :: forall a. String -> Validator (Array a) (NonEmptyArray a)
nonEmptyArray
, but the argument is the entire validation message.
#validNumber Source
validNumber :: String -> Validator String Number
A Validator
which verifies that its input can be parsed as a number.
#validNumber' Source
validNumber' :: String -> Validator String Number
validNumber
, but the argument is the entire validation message.
#validDate' Source
validDate' :: String -> Validator String Date
validDate
, but the argument is the entire validation message.
#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
(Eq a) => Eq (Validated a)
Eq1 Validated
(Ord a) => Ord (Validated a)
Ord1 Validated
Functor Validated
Apply Validated
Applicative Validated
(Generic value rep) => Generic (Validated value) rep
(Decode value) => Decode (Validated value)
(Encode value) => Encode (Validated value)
(Mapping ModifyValidated a a) => Mapping ModifyValidated (Validated a) (Validated a)
CanValidate (Validated a) a
#_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) => Mapping ModifyValidated (Maybe a) (Maybe a)
(CustomModifyValidated a, Mapping ModifyValidated a a) => Mapping ModifyValidated (ModifyValidatedProxy a) (ModifyValidatedProxy a)
Mapping ModifyValidated a a
#ModifyValidatedProxy Source
newtype ModifyValidatedProxy a
Constructors
Instances
Newtype (ModifyValidatedProxy a) _
(Eq value) => Eq (ModifyValidatedProxy value)
(Ord value) => Ord (ModifyValidatedProxy value)
(Generic value rep) => Generic (ModifyValidatedProxy value) rep
(Decode value) => Decode (ModifyValidatedProxy value)
(Encode value) => Encode (ModifyValidatedProxy value)
(CustomModifyValidated a, Mapping ModifyValidated a a) => Mapping ModifyValidated (ModifyValidatedProxy a) (ModifyValidatedProxy 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. Clip - Lumi.
Components2. Image - Lumi.
Components2. Link - Lumi.
Components2. QRCode - Lumi.
Components2. ScrollObserver - Lumi.
Components2. Slat - Lumi.
Components2. Text - Lumi.
Styles - Lumi.
Styles. Border - Lumi.
Styles. Box - Lumi.
Styles. Clip - Lumi.
Styles. Link - Lumi.
Styles. Loader - Lumi.
Styles. Responsive - Lumi.
Styles. Slat - Lumi.
Styles. Theme