diff --git a/content/docs/data-modeling/field-types.mdx b/content/docs/data-modeling/field-types.mdx index 93fe74728cc..b556e982bb5 100644 --- a/content/docs/data-modeling/field-types.mdx +++ b/content/docs/data-modeling/field-types.mdx @@ -21,7 +21,7 @@ Single-line plain text input. |:---|:---|:---|:---| | `maxLength` | `number` | — | Maximum character length | | `minLength` | `number` | — | Minimum character length | -| `format` | `string` | — | Validation format pattern | +| `format` | `string` | — | Display hint, **not validation** — the server runs no check from it. The UI's cell-renderer resolver reads a small set of words and renders the cell as the richer type: `phone` / `tel` / `telephone` (a `tel:` link), `email` (a `mailto:` link), `url` / `uri` / `link` (a clickable link), `currency` / `money`, `percent` / `percentage`; any other word renders as plain text. To reject a malformed email, URL or phone number, use that field `type` instead, or a [`format` validation rule](/docs/data-modeling/validation#format-validation) | | `valueDomain` | `'iana_time_zone' \| 'iso_4217_currency' \| 'iso_3166_alpha2'` | — | Standard the written value must be a member of (IANA time zone, ISO 4217 currency code, ISO 3166-1 alpha-2 country code); `text` only | ```typescript @@ -68,7 +68,6 @@ Phone number field. | Property | Type | Default | Description | |:---|:---|:---|:---| | `maxLength` | `number` | — | Maximum character length | -| `format` | `string` | — | Phone format pattern | ```typescript { name: 'phone', label: 'Phone', type: 'phone' } diff --git a/content/docs/data-modeling/validation-rules.mdx b/content/docs/data-modeling/validation-rules.mdx index b2d1f90ecd0..bdee401b986 100644 --- a/content/docs/data-modeling/validation-rules.mdx +++ b/content/docs/data-modeling/validation-rules.mdx @@ -43,7 +43,7 @@ These properties apply to **all** field types and are validated by the base `Fie |:---|:---|:---|:---| | `maxLength` | `number` | — | Rejects values exceeding character count | | `minLength` | `number` | — | Rejects values below character count | -| `format` | `string` | — | Validates against format pattern (e.g., regex) | +| `format` | `string` | — | **Not validated.** No write-time check reads it — a regex here is accepted and ignored. On `text` it is a display hint only (a small set of words such as `phone`, `email` or `url` promote the cell to a richer renderer; see the [Field Type Gallery](/docs/data-modeling/field-types)). To constrain the value's shape, use the `email` / `url` / `phone` field type or a [`format` validation rule](/docs/data-modeling/validation#format-validation) | | `valueDomain` | `'iana_time_zone' \| 'iso_4217_currency' \| 'iso_3166_alpha2'` | — | Constrains the written value to a published standard — an IANA time zone (judged by the `Intl.DateTimeFormat` probe, so `UTC` and `Asia/Kolkata` are members and `Europe/Munich` is not), an ISO 4217 currency code or an ISO 3166-1 alpha-2 country code (both exact uppercase). Membership, not shape: a pattern such as `^[A-Z]{2}$` admits `ZZ`; the domain does not. The same closed vocabulary and the same membership test as a settings specifier's `valueDomain`; a non-member is refused on the write path with the field error code `value_domain`. `text` only — declaring it on any other type is refused at parse. | **Default constraints:** None. Unbounded text unless `maxLength` is set. @@ -61,25 +61,28 @@ These properties apply to **all** field types and are validated by the base `Fie | Property | Type | Default | Validation Behavior | |:---|:---|:---|:---| -| `format` | `string` | `email` | Validates a basic `local@domain` shape | +| `maxLength` | `number` | — | Rejects values exceeding character count | +| `minLength` | `number` | — | Rejects values below character count | -**Default constraints:** Must contain an `@` and a domain with a dot — a lightweight pattern check, not full RFC 5322 validation. +**Default constraints:** Must contain an `@` and a domain with a dot — a lightweight pattern check, not full RFC 5322 validation. The check is keyed on `type: 'email'` itself and has nothing to configure; a field-level `format` key is not read. ### `url` | Property | Type | Default | Validation Behavior | |:---|:---|:---|:---| -| `format` | `string` | `url` | Validates URL format (protocol required) | +| `maxLength` | `number` | — | Rejects values exceeding character count | +| `minLength` | `number` | — | Rejects values below character count | -**Default constraints:** Must be a valid URL with protocol prefix. +**Default constraints:** Must be a valid URL with protocol prefix. The check is keyed on `type: 'url'` itself and has nothing to configure; a field-level `format` key is not read. ### `phone` | Property | Type | Default | Validation Behavior | |:---|:---|:---|:---| -| `format` | `string` | `phone` | Validates a permissive phone-number character set | +| `maxLength` | `number` | — | Rejects values exceeding character count | +| `minLength` | `number` | — | Rejects values below character count | -**Default constraints:** Accepts digits, `+ ( ) - .` and spaces (minimum 5 characters) — a lenient character-set check, not strict E.164 structural validation. +**Default constraints:** Accepts digits, `+ ( ) - .` and spaces (minimum 5 characters) — a lenient character-set check, not strict E.164 structural validation. The check is keyed on `type: 'phone'` itself and has nothing to configure; a field-level `format` key is not read. For a stricter shape, add a [`format` validation rule](/docs/data-modeling/validation#format-validation) with a `regex`. ### `password` @@ -515,7 +518,7 @@ section above). See the | Field Type | Required Props | Key Constraints | |:---|:---|:---| -| `text` | — | `maxLength`, `minLength`, `format`, `valueDomain` | +| `text` | — | `maxLength`, `minLength`, `valueDomain` (`format` is a display hint, not a constraint) | | `textarea` | — | `maxLength`, `minLength` | | `email` | — | Basic `local@domain` shape (not full RFC 5322) | | `url` | — | Valid URL with protocol |