Expand description
The open field-type registry: the framework and plugins add form field types.
A field descriptor (crate::form::FormField) is serde data (name, label,
type key, options, rules); a field type is behaviour keyed by that type.
Rendering splits so an override can present the same data the built-in does:
FieldType::view_model builds a serde FieldVm, FieldType::render_default
is the Askama presenter over it, and an OverrideResolver (default
NoOverrides) may swap in a runtime template. Load/parse/save/assets/action
join as defaulted methods when a type first needs them (backward-compatible).
Structs§
- Adornment
- A control placed beside the input (a copy button, a currency symbol): data in the view-model, never HTML, so an override re-presents it. The text template renders it into the input group.
- FieldCx
- The resolved per-field state a field type renders from.
- Field
Type Reg - A field type a module contributes, so a form can offer an input the framework has no built-in for (a colour picker, a money amount, a map point).
- FieldVm
- The serialisable payload both the built-in template and an override render,
so an override never re-derives data.
datais per-type data, never HTML. - NoOverrides
- The default resolver: no overrides, so the compiled path always runs at zero cost. The theme layer injects a real resolver when it is built.
- Options
Error - A field type failed to type its options blob at boot.
- Override
Error - A runtime override failed to render.
- Override
Scope - Where a render is happening, for override resolution (most-specific first:
resource.fieldthenview_keythen the compiled default). - Resolved
Options - Per-type options, resolved once at boot from the descriptor’s options blob into a typed value cached for rendering (the text field resolves its input variant, select its option list; textarea carries none).
- Submitted
Field - A field type: behaviour registered once per string key. What a field sees of the submission when it produces its stored value.
Enums§
- Chrome
- Whether the framework wraps a field in standard chrome (label, required marker, error list) or the type renders bare (a hidden field, a heading).
- Field
Value - A field’s value, general enough for scalar and (later) structured types. Serde so it rides in the view-model and a failed-validation re-render.
- Placement
- Where an adornment sits relative to the input.
- Repeater
Display - How a repeater’s rows are laid out.
- Surface
- The surface being rendered, for override resolution.
Constants§
- REPEATER_
LIST_ PAST - Past this many fields a row, a repeater with no stated
displayis a list. - SELECT_
SEARCH_ PAST - A dropdown turns searchable past this many choices.
Traits§
- Field
Type - Input
Type - An input variant of the text field: its HTML
type, the rules it contributes, and how it parameterises the one text control (extra attributes, adjacent adornments). The extension point a plugin builds on (a currency input, say) instead of reimplementing a field. An input parameterises the single text control; anything needing different control markup is aFieldType. - Override
Resolver - The seam a theme/CMS layer backs with a runtime template engine (MiniJinja)
to let users override a field’s presentation from outside the plugin.
laterite-adminstays engine-agnostic; the default isNoOverrides.
Type Aliases§
- Field
Registry - The field-type registry: type key to behaviour, built once at boot.
- Input
Registry - The registry the text field resolves its
inputoption against.