Expand description
CRUDUI form compilation, instance data, binding and HTML rendering.
Modules§
- text
- Input text of the generator operations over JSON text (docs/spec/input-text.md).
Structs§
- Action
Input - The values a button declares: its action, collection path and row key (CURT-081). An absent or empty member is absent from the target.
- Action
Result - The outcome of an action that ran.
- Action
Target - The operation, collection path and row key that an action button targets.
- AddRow
Options - Values, identity and insertion position for an added or copied row.
- Bind
Options - Per-instance input names, content language and presentation.
- Compile
Options - Inputs used only during structure compilation.
- Field
Template - One data-independent field definition.
- Focus
Target - The row that receives focus after an action, or the collection itself when
keyis absent. - Form
- An independent editable form instance using a compiled structure.
- Form
Error - A failed form compilation, binding or instance operation.
- Form
Template - A JSON-serializable form structure without record data.
- History
- The undo history of a form: the records before earlier changes and the records after undone changes, oldest first. The functions of the module take it by reference and return new values.
- History
Result - The history after an undo or a redo and the record that it restored.
- List
Options - Composition, language, display context and pagination inputs for a list.
- View
State - The row paths
{collection}.{key}rendered collapsed, in the order the rows were collapsed and without duplicates. It is never submitted with the data.
Enums§
- Action
Name - The eleven operations that an action button can request (CURT-081).
Constants§
- HISTORY_
LIMIT - The number of records an undo history keeps in each direction (CURT-062).
Functions§
- bind_
buttons - Evaluate the template’s form buttons for a record.
- bind_
form - Evaluate the node grammar using a compiled template and independent record data. The template specification is read in member order; the data keeps its own order.
- build_
detail - Build one read-only detail model from a supplied record.
- build_
list - Compose a list and bind display rows without modifying the inputs.
- build_
outline - Build the structure map: the form’s rows, nested as in the form. Collections, counts and empty collections are not rows.
- can_
redo - Whether the history has a record to restore in the forward direction (CURT-078).
- can_
undo - Whether the history has a record to restore (CURT-078).
- collapsible_
rows - The row paths of every collapsible row of the evaluated nodes, depth first in node order.
- compile_
form - Compile a complete form structure before record data is available.
- create_
row_ key - Generate a random 13-character hexadecimal row key using the OS random source.
- empty_
history - The history with no record (CURT-076).
- form_
buttons_ html - Markup of buttons evaluated by
bind_buttons, identical to the form footer buttons. - initial_
view - The view with no collapsed row. Replacing the record returns to it.
- list_
rows - Read decoded JSON list rows: absent means no rows, and any value other than an array fails.
- record_
change - Appends the record before a change to the entries unless
pathequals the path of the last value edit, keeps the lastHISTORY_LIMITentries, clears the redo entries and sets the path of the history topath(CURT-077, CURT-063). - redo_
change - The history with
currentappended to the entries and without its last redo entry, and that redo entry as the record (CURT-080); it fails when the history has no redo entry. - rekey_
row_ view - Move the collapsed state of a rekeyed row and of the rows inside it to the new row path.
- remove_
row_ view - Drop the collapsed state of a removed row and of the rows inside it.
- render_
detail - Render one read-only detail: image preload links, the actions when the detail has any, and the definition list.
- render_
form - Render an instance as the complete form without executing scripts or browser operations
(form-runtime.md, “Complete form”).
optionsisNoneor an object with the optional membersaction,hidden,formErrorsanderrors;Nonewrites thecrudui-formblock alone. - render_
list - Render a list with supplied display rows in table or card layout.
- resolve_
action - Resolve the target of the values a button declares;
Nonewhen the action is none of the eleven actions. - run_
action - Run a resolved action on the form.
Nonewhen the target lacks the path or key that the action needs; a failing operation returns its error and leaves the form unchanged (CURT-090). - sequence_
row_ key - Format a nonnegative sequence containing at most 13 decimal digits.
- set_
all_ expanded_ view - The view with no collapsed row when
expandedis true, and otherwise the view that collapses every collapsible row of the evaluated nodes. - toggle_
row_ view - Expand a collapsed row or collapse an expanded one, appending a collapsed row last.
- undo_
change - The history without its last entry, with
currentappended to the redo entries, and the last entry as the record (CURT-079); it fails when the history has no entry.
Type Aliases§
- Detail
Options - Detail options use the same composition, language and data inputs as lists; the list-only
layout,pageandtotalare ignored. - Form
Result - Result of a form operation.