FieldErrorReason type alias

Module @runic-artifex/views in @runic-artifex/views 0.23.0

type FieldErrorReason = "required" | "not-a-number" | "not-a-whole-number" | "too-many-fraction-digits" | "out-of-range" | "not-a-boolean" | "not-a-choice" | "not-a-date" | "not-a-time" | "not-a-date-time" | "offset-out-of-range" | "no-text-form";

Why a text does not parse (invalid-text), for an application that shows its own text: the error's FieldError carry the parts of the message, and message stays the English text. | Reason | English message | Arguments | | --- | --- | --- | | required | Enter a number. | expected | | not-a-number | 1e is not a number. | text | | not-a-whole-number | 1.5 is not a whole number. | text | | too-many-fraction-digits | 1.234 has more than 2 digits after the decimal separator. | text, scale | | out-of-range | …9 is too large. (a decimal of 2⁹⁶ or more) | text | | not-a-boolean | yes is not true or false. | text | | not-a-choice | Large is not one of Small, Medium. | text, choices | | not-a-date | 31.02.2026 is not a date., x is not a date (DD.MM.YYYY or YYYY-MM-DD). | text, patterns? | | not-a-time | 25:00 is not a time., x is not a time (hh:mm or hh:mm:ss). | text, patterns? | | not-a-date-time | x is not a date and time (YYYY-MM-DDThh:mm). | text, patterns | | offset-out-of-range | …+15:00 has an offset beyond ±14:00. | text | | no-text-form | This field has no text form. | none | not-a-date and not-a-time without patterns are a text of the right form that names no day or time, such as 31 February. Open: a later release may add reasons; show message for one you do not know.