Skip to main content

Module layout_tree

Module layout_tree 

Source
Expand description

The LAYOUT tree: the normalized UiNode tree (macros already expanded) becomes a flat pre-order list of layout nodes the engine and the painters work on. Here the core adds what painters must not invent: the BIND pass (bindings, calls and $string.<id> copy resolved in props, styles and recipe props; a node whose visible resolves falsy is dropped with its subtree), template children instantiated per item (ids <template>.<key> with the template key, else <template>.<i>), natives with structure of their own get synthetic PART nodes (ids <owner>.<part>, recipes keyed on the owner’s component so a theme styles them), overlay natives and every popup (Select, the pickers, menus and submenus, tooltips, hover cards, toasts) put their content into LAYERS with their own roots, and extension natives arrive as Extension leaves.

The builder numbers nodes in pre-order; the surface maps them onto STABLE SLOTS by id afterwards (surface::reconcile), so a re-windowed list or an opened overlay keeps every other node’s index.

Modules§

fields
The form controls (a themed surface expands each into its recipe parts): Input/Textarea, Select (the combobox, its popup a LAYER), DatePicker and DateRangePicker (one calendar layer), TimePicker (a list layer), NumberField (steppers), ChipInput (chips + suggestions layer), FileUpload (drop zone + files), Checkbox/Switch, Radio, Slider and the Form that collects them. A field’s failed checks (after a refused submit) show under it as <field id>.error and put its parts in the invalid state.
search
EXP-1259 (the UI batch): the low-level pieces the app settled on, built from the natives every painter already draws.

Structs§

BuildContext
BuildSeed
What a SUBTREE rebuild inherits from the full build: the enclosing Forms’ flags and the literal Table rows.
Built
FieldErrors
A form field’s validation state after a submit: its failed messages.
LNode
One layout node. style keeps tokens UNRESOLVED and conditions NESTED; the surface resolves them per theme/mode and flattens per pass.
LayerSpec
ListSpec
A windowed list’s state for one build.
ListView
A list’s viewport on its axis, recorded after each pass.
LocalState
Local UI state the core owns (never sent to the producer unless bound).
SourceRef
The source of an instance node: the source node’s id and the template component whose reduced tree holds it (None = the surface’s tree).
ToastSpec
An open Toast the host times (duration 0 = sticky).

Enums§

LayerClass
Which band a layer stacks in: base < overlay < toast.
LayerPlacement
How an overlay layer is placed.
ListViewSource
Round 2 (§5): where a windowed list’s viewport comes from.
NodeKind

Constants§

FORM_FIELDS
The form fields a Form collects (when they carry a name).
OVERLAYS
The overlay natives whose content lives in a layer.

Functions§

build
Build the layout tree for a normalized root. Unknown nodes become leaves the painter renders as the placeholder.
build_subtree
Rebuild ONE subtree (a re-windowed List/Table) under an existing parent: node 0 of the result is a stub of parent (the caller keeps the real one), the rest is the subtree in pre-order. seed = what the full build knew above it (the enclosing Forms’ disabled/busy, literal Table rows), so the subtree comes out exactly as a full rebuild would build it.
builtin_icon
The builtin glyph of a part (core.catalog.json builtinIcons).
is_context_menu
True for a Menu opened by a right click / long press (openOn: contextmenu): its ONE child is the target region.
row_scope_root
/$row/<table>/<i>[/…] → /$row/<table>/<i> (a literal Table row’s scope root).