preludes / viewspec.lisp
viewspec
Ontology-aware views. Entity browsers, pickers, query consoles, and action buttons for hosted ViewSpec UI.
From the source
Purpose: Ontology-aware UI components and hosted layout aliases. Requires: ui.lisp; ontology.lisp supplies enclosing view declarations. Used by: Ontology view layouts and downstream host renderers.
Forms 6
Keywords this prelude adds. Each is a form descriptor: its slots, their types, and the IR it produces.
(entity-browser {:keys [title visible bind]})viewspec.lisp:8
Builds an ontology entity-browser node with optional title and binding, and an on-row-click event mapping.
| Slot | Type |
|---|---|
| title | (Option (Expr a)) |
| visible | (Option (Expr Bool)) |
| bind | (Option (Expr a)) |
Produces ComponentIR
Example
(view Example
:state {:items []}
:layout (entity-browser :title "People" :bind $state.items))(action-button {:keys [label variant action-ref entity-id parameters visible]})viewspec.lisp:31
Builds an action-button configuration with an action reference, optional entity identifier and parameters, and click and success event mappings.
| Slot | Type |
|---|---|
| label | (Option (Expr a)) |
| variant | (Option (Union "default" "destructive" "outline" "secondary" "ghost")) |
| action-ref | (Option String) |
| entity-id | (Option (Expr a)) |
| parameters | (Option Json) |
| visible | (Option (Expr Bool)) |
Produces ComponentIR
Example
(view Example
:layout
(action-button :label "Save" :action-ref "save" :parameters {}))(create-entity-button {:keys [label entity-type variant visible]})viewspec.lisp:66
Builds a create-entity-button configuration for a required entity-type string, with optional label and variant.
| Slot | Type |
|---|---|
| label | (Option (Expr a)) |
| entity-type | String |
| variant | (Option (Union "default" "destructive" "outline" "secondary" "ghost")) |
| visible | (Option (Expr Bool)) |
Produces ComponentIR
Example
(view Example
:layout
(create-entity-button :entity-type "Person" :label "New person"))(entity-picker {:keys [name label description placeholder entity-type visible]})viewspec.lisp:93
Builds a named entity-picker configuration with optional labels, placeholder, and entity-type filter.
| Slot | Type |
|---|---|
| name | String |
| label | (Option (Expr a)) |
| description | (Option (Expr a)) |
| placeholder | (Option String) |
| entity-type | (Option String) |
| visible | (Option (Expr Bool)) |
Produces ComponentIR
Example
(view Example
:layout (entity-picker :name "person" :entity-type "Person"))(query-console {:keys [title visible]})viewspec.lisp:122
Builds a query-console configuration node with optional title and visibility expressions.
| Slot | Type |
|---|---|
| title | (Option (Expr a)) |
| visible | (Option (Expr Bool)) |
Produces ComponentIR
Example
(view Example :layout (query-console :title "Explore"))(view-ref name {:keys [input visible]})viewspec.lisp:135
Builds a reference to a view by string name, with optional JSON input and visibility.
| Slot | Type |
|---|---|
| name | String |
| input | (Option Json) |
| visible | (Option (Expr Bool)) |
Produces ComponentIR
Example
(view Example :layout (view-ref "People" :input {:page 1}))Functions 16
Ordinary typed definitions that programs and elaboration hooks can call.
action-formviewspec.lisp:157
Constant host layout alias; the target component is interpreted downstream.
(define action-form …)
entity-tableviewspec.lisp:161
Constant host layout alias; the target component is interpreted downstream.
(define entity-table …)
entity-detailviewspec.lisp:169
Constant host layout alias; the target component is interpreted downstream.
(define entity-detail …)
entity-formviewspec.lisp:177
Constant host layout alias; the target component is interpreted downstream.
(define entity-form …)
task-queueviewspec.lisp:185
Constant host layout alias; the target component is interpreted downstream.
(define task-queue …)
task-detailviewspec.lisp:193
Constant host layout alias; the target component is interpreted downstream.
(define task-detail …)
task-summaryviewspec.lisp:201
Constant host layout alias; the target component is interpreted downstream.
(define task-summary …)
task-status-editorviewspec.lisp:209
Constant host layout alias; the target component is interpreted downstream.
(define task-status-editor …)
task-document-linksviewspec.lisp:219
Constant host layout alias; the target component is interpreted downstream.
(define task-document-links …)
task-metadataviewspec.lisp:229
Constant host layout alias; the target component is interpreted downstream.
(define task-metadata …)
violation-listviewspec.lisp:237
Constant host layout alias; the target component is interpreted downstream.
(define violation-list …)
violation-detailviewspec.lisp:245
Constant host layout alias; the target component is interpreted downstream.
(define violation-detail …)
violation-summaryviewspec.lisp:253
Constant host layout alias; the target component is interpreted downstream.
(define violation-summary …)
violation-status-editorviewspec.lisp:263
Constant host layout alias; the target component is interpreted downstream.
(define violation-status-editor …)
violation-related-recordsviewspec.lisp:273
Constant host layout alias; the target component is interpreted downstream.
(define violation-related-records …)
violation-timelineviewspec.lisp:283
Constant host layout alias; the target component is interpreted downstream.
(define violation-timeline …)