tSM-Specific Schema Extensions
In addition to standard JSON Schema capabilities, tSM introduces a number of powerful metadata extensions that allow forms to be dynamic, context-aware, and tightly integrated with the backend platform.
This document explores those extensions in depth.
Overview of Extensions
| Field | Purpose |
|---|---|
widget | Declares the Angular component to render the field or layout block |
config | Hosts all behavior: UI labels, conditions, defaults, integrations |
layout | Defines visual grouping and composition of form elements |
readonly, hidden, default | Control runtime behavior via JEXL |
validationMessages | Provide static or dynamic error feedback |
dispatchOnChange | Trigger NGRX actions on field updates |
selectFromStore | Bind widget values to NGRX selectors |
dataSource, filters, selectProperty | Configure LOVs, listings, and data-driven widgets |
Detailed Examples
1. widget
Each field (or layout block) must define its widget.type, which maps to a registered Angular component.
Examples:
"widget": { "type": "tsm-text" }
"widget": { "type": "dtl-fluent-tab" }
2. config
A deeply extensible object that controls:
- Static settings:
label,tooltip,legend,columns, etc. - Dynamic logic:
hidden,readonly,validationMessages(JEXL-based) - Data & UX behaviors:
lazyLoad,selectFirstValue,cssClasses,collapsible, etc. - Event-driven behavior: Hooks such as
dispatchOnChange,selectFromStore
Example:
"config": {
"label": "Priority",
"readonly": "${$context.user.role !== 'admin'}",
"validationMessages": { "required": "Please select a priority." }
}