Skip to main content

Crate polyspec_crudui_generator

Crate polyspec_crudui_generator 

Source
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§

ActionInput
The values a button declares: its action, collection path and row key (CURT-081). An absent or empty member is absent from the target.
ActionResult
The outcome of an action that ran.
ActionTarget
The operation, collection path and row key that an action button targets.
AddRowOptions
Values, identity and insertion position for an added or copied row.
BindOptions
Per-instance input names, content language and presentation.
CompileOptions
Inputs used only during structure compilation.
FieldTemplate
One data-independent field definition.
FocusTarget
The row that receives focus after an action, or the collection itself when key is absent.
Form
An independent editable form instance using a compiled structure.
FormError
A failed form compilation, binding or instance operation.
FormTemplate
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.
HistoryResult
The history after an undo or a redo and the record that it restored.
ListOptions
Composition, language, display context and pagination inputs for a list.
ViewState
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§

ActionName
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 path equals the path of the last value edit, keeps the last HISTORY_LIMIT entries, clears the redo entries and sets the path of the history to path (CURT-077, CURT-063).
redo_change
The history with current appended 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”). options is None or an object with the optional members action, hidden, formErrors and errors; None writes the crudui-form block 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; None when the action is none of the eleven actions.
run_action
Run a resolved action on the form. None when 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 expanded is 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 current appended to the redo entries, and the last entry as the record (CURT-079); it fails when the history has no entry.

Type Aliases§

DetailOptions
Detail options use the same composition, language and data inputs as lists; the list-only layout, page and total are ignored.
FormResult
Result of a form operation.