jaredramirez/elm-field/1.1.0

NOTE: the latest version is 1.1.2

Field.Int

A pre-applied Int version of the Field type, and validation functions to go along with them.

Base

type alias Field =
Field Int String

A field to hold a Int value, with an error type of String. See Field

type alias ViewConfig msg =
ViewConfig Int String msg

A view config object for Int fields. See ViewConfig

type alias ValidationFunc =
ValidationFunc Int String

A validation function for an Int Field

Validation

atLeast : Int -> ValidationFunc

Enforce that the a field is at least x digits long

atMost : Int -> ValidationFunc

Enforce that a field is at most x digits long

greaterThan : Int -> ValidationFunc

Enforce that a field is greater than x

greaterThanOrEqual : Int -> ValidationFunc

Enforce that a field is greater than or equal to x

lessThan : Int -> ValidationFunc

Enforce that a field is less than x

lessThanOrEqual : Int -> ValidationFunc

Enforce that a field is less than or equal to x