CRUDUI

Home > @polyspec/crudui-validator > FieldSpec

FieldSpec interface

CRUDUI field specification. Top level holds only first-class keys (SPEC §3 B): structure/identity, content, and the four role slots. All non-first-class detail is pushed under its dependency target (§3 C). A schema layer closes the top level (additionalProperties: false) and rejects every FORBIDDEN_META_KEYS entry here and one level below every slot/bucket.

Signature:

export interface FieldSpec 

Properties

Property

Modifiers

Type

Description

$patch?

PatchDirective

(Optional) Change directive (add/remove/replace, JSON Patch style). Supports deep-path set, e.g. 'field.validate.required': '.other'.

$ref?

Reference

(Optional) Base inheritance (file/path). The parser expands it first — an unresolved $ref cannot be loaded.

action?

FormAction

(Optional) Submission target kept unchanged in the template. Honored on the form root only.

append?

LocalizedText

(Optional) Content — text rendered after the input.

behavior?

Slot<BehaviorSlot>

(Optional) Role slot — behavior (opaque script, NOT routed through the expression engine). false nullifies composed inheritance.

buttons?

FormButton[]

(Optional) Form buttons rendered in the form footer. Honored on the form root only.

content?

LocalizedText

(Optional) Content — control text of a button or action field (may be multilingual).

default?

unknown

(Optional) Structure — default value. The evaluator references it when a path does not resolve (expressions.md §5 Path).

description?

LocalizedText

(Optional) Content — description (may be multilingual).

design?

Slot<FieldDesignSlot>

(Optional) Role slot — appearance = visibility + per-node external appearance map, with the attributes the field declares for its control and node root.

help?

LocalizedText

(Optional) Content — help text (may be multilingual).

items?

Items

(Optional) Structure — option source. Static array, or a dynamic { model, method, table, relations } source. A dependency-isolation bucket and first-class.

label?

LocalizedText

(Optional) Content — field label (LangMap when multilingual, G3).

lang?

Lang

(Optional) Structure — input multilingual dimension (the field value is per-language, G3). A dependency-isolation bucket and first-class.

messages?

MessagesSpec

(Optional) Error message overrides by rule name, beside the rules they belong to.

multiple?

Multiple

(Optional) Structure — repeated rows (true = on). A dependency-isolation bucket and first-class. Row identity at RUNTIME is a server PK carried in the submitted data, not a build-time spec field — MultipleSettings has no id key. See Multiple.

name?

string

(Optional) Structure / identity — field name (serialization key).

options?

Slot<OptionsSlot>

(Optional) Role slot — type-dependent settings (the type defines and validates them; the core stays uninvolved).

placeholder?

LocalizedText

(Optional) Content — placeholder (may be multilingual).

prepend?

LocalizedText

(Optional) Content — text rendered before the input.

properties?

Properties

(Optional) Structure — child field map (group/object). Entry point for $ref/$patch composition.

type

string

Identity — the field type (e.g. email, group, multiple). The type is the definer/validator of the options slot.

validate?

Slot<ValidateSlot>

(Optional) Role slot — validation (SPEC §3 common-role distribution).