Methods
# hidden() → {function}
Makes a property invisible in all CRUD operations This decorator is a convenience wrapper around hideOn that hides a property during all CRUD operations (CREATE, READ, UPDATE, DELETE).
Decorator that completely hides a property in all UI operations
A property decorator function
function
Example
// Completely hide the internalId field in the UI
class Product {
# hideOn(operations) → {function}
Controls property visibility based on operation type This decorator allows you to specify which CRUD operations should hide a property in the UI. The property will only be visible during operations not specified.
Decorator that hides a property during specific CRUD operations
Parameters:
Name | Type | Description |
---|---|---|
operations |
The CRUD operations during which the property should be hidden |
A property decorator function
function
Example
// Hide the password field during READ operations
class User {
# renderedBy(engine) → {function}
Associates a model with a specific rendering engine implementation This decorator allows you to override the default rendering engine for a specific model class, enabling different rendering strategies for different models.
Decorator that specifies which rendering engine to use for a model
Parameters:
Name | Type | Description |
---|---|---|
engine |
string
|
The name of the rendering engine to use |
A class decorator function
function
Example
// Specify a custom rendering engine for a model
# uichild(clazz, tag, propsopt, serializeopt) → {function}
Defines how a parent component should render the child model when nested.
This decorator is used to decorate properties that are nested models. When applied, it allows overriding the default tag of the child model with the provided one, enabling different rendering behavior when the model acts as a child (nested) compared to when it is rendered as the parent model.
It requires the class to be decorated with @uimodel
.
Decorator that maps a nested model property to a UI component property.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
clazz |
string
|
The model class name to pass to the component (defaults to the property key). |
||
tag |
string
|
The HTML element or component tag name to override the UI tag of the nested model |
||
props |
Record.<string, any>
|
<optional> |
Additional properties to pass to the element |
|
serialize |
boolean
|
<optional> |
false | Whether the property should be serialized |
A property decorator function.
function
Example
// Map a nested model to a component property with a different tag when nested
# uielement(tag, propsopt, serializeopt) → {function}
Maps a model property to a specific UI element with custom properties This decorator allows you to define which HTML element or component should be used to render a specific property, along with any additional properties to pass to that element.
Decorator that specifies how a property should be rendered as a UI element
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
tag |
string
|
The HTML element or component tag name to use for rendering |
||
props |
Record.<string, any>
|
<optional> |
Additional properties to pass to the element |
|
serialize |
boolean
|
<optional> |
false | Whether the property should be serialized |
A property decorator function
function
Example
// Render a property as a text input
class LoginForm {
# uilistitem(tagopt, propsopt) → {function}
Specifies how a model should be rendered when displayed in a list context This decorator applies metadata to the class that enables it to be rendered as a list item by the UI rendering engine. The model will be rendered with the specified tag and properties when it appears in a list.
Decorator that tags a model as a list item for UI rendering
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
tag |
string
|
<optional> |
The HTML tag to use when rendering this model as a list item (defaults to class name) |
props |
Record.<string, any>
|
<optional> |
Additional properties to pass to the rendered list item element |
A class decorator function
function
Example
// Basic usage with default tag (class name)
# uilistprop(propNameopt, propsopt) → {function}
Specifies how a property should be rendered in a list context This decorator allows you to define how a model property containing a list should be rendered. It requires the class to be decorated with @uilistitem.
Decorator that maps a model property to a list item component
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
propName |
string
|
<optional> |
The name of the property to pass to the list component (defaults to the property key) |
props |
Record.<string, any>
|
<optional> |
Additional properties to pass to the list container |
A property decorator function
function
Example
// Define a list property with custom rendering
# uimodel(tagopt, propsopt) → {function}
Adds rendering capabilities to a model class by providing a render method This decorator applies metadata to the class that enables it to be rendered by the UI rendering engine. The model will be rendered with the specified tag and properties.
Decorator that tags a class as a UI model
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
tag |
string
|
<optional> |
The HTML tag to use when rendering this model (defaults to class name) |
props |
Record.<string, any>
|
<optional> |
Additional properties to pass to the rendered element |
A class decorator function
function
Example
// Basic usage with default tag (class name)
# uiprop(propNameopt, stringifyopt) → {function}
Specifies how a property should be passed to a UI component This decorator allows you to define how a model property should be mapped to a property of the UI component when rendering. It requires the class to be decorated with @uimodel.
Decorator that maps a model property to a UI component property
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
propName |
string
|
<optional> |
The name of the property to pass to the component (defaults to the property key) |
|
stringify |
boolean
|
<optional> |
false | Whether to stringify the property value |
A property decorator function
function
Example
// Map model properties to component properties