Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions packages/spec/react-conformance.baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,11 @@
"missing": false
},
"ListView": {
"frontendOnly": [
"fields",
"options"
],
"frontendOnly": [],
"missing": false
},
"ObjectChart": {
"frontendOnly": [
"data"
],
"frontendOnly": [],
"missing": false
},
"RecordDetails": {
Expand Down
3 changes: 3 additions & 0 deletions packages/spec/src/ui/react-blocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ export const REACT_BLOCKS: ReactBlockDef[] = [
{ name: 'navigation', type: "{ mode: 'page' | 'drawer' | 'modal' | 'split' | 'none' }", kind: 'binding', description: 'What a row click does. Use { mode: \"none\" } when you handle clicks via onRowClick.' },
{ name: 'onRowClick', type: '(record) => void', kind: 'callback', description: "Called with the clicked row's record — the hook for master/detail." },
{ name: 'onNavigate', type: "(recordId, action: 'view' | 'edit') => void", kind: 'callback', description: 'Called for page-level navigation.' },
{ name: 'fields', type: 'string[]', kind: 'binding', description: 'Limit/order the columns shown (defaults to the object list fields).' },
{ name: 'options', type: 'Record<string, any>', kind: 'binding', description: 'View-type-specific options bag (kanban/calendar/gantt extras); prefer the typed spec props where they exist.' },
],
},
{
Expand All @@ -108,6 +110,7 @@ export const REACT_BLOCKS: ReactBlockDef[] = [
OBJECT_NAME,
{ name: 'filter', type: 'FilterArray', kind: 'controlled', description: 'ObjectQL filter scoping the data; drive from React state.' },
{ name: 'aggregate', type: '{ field, function, groupBy }', kind: 'binding', description: 'Aggregation: function (sum/avg/count) over field, grouped by groupBy.' },
{ name: 'data', type: 'any[]', kind: 'binding', description: 'Static/precomputed data to chart directly instead of binding via objectName + aggregate.' },
],
},
{
Expand Down
21 changes: 21 additions & 0 deletions skills/objectstack-ui/contracts/react-blocks.contract.json
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,20 @@
"required": false,
"description": "What a row click does. Use { mode: \"none\" } when you handle clicks via onRowClick."
},
{
"name": "fields",
"type": "string[]",
"kind": "binding",
"required": false,
"description": "Limit/order the columns shown (defaults to the object list fields)."
},
{
"name": "options",
"type": "Record<string, any>",
"kind": "binding",
"required": false,
"description": "View-type-specific options bag (kanban/calendar/gantt extras); prefer the typed spec props where they exist."
},
{
"name": "filters",
"type": "FilterArray e.g. ['status','=','active']",
Expand Down Expand Up @@ -292,6 +306,13 @@
"required": false,
"description": "Aggregation: function (sum/avg/count) over field, grouped by groupBy."
},
{
"name": "data",
"type": "any[]",
"kind": "binding",
"required": false,
"description": "Static/precomputed data to chart directly instead of binding via objectName + aggregate."
},
{
"name": "filter",
"type": "FilterArray",
Expand Down
3 changes: 3 additions & 0 deletions skills/objectstack-ui/references/react-blocks.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ Server-connected object table with toolbar and switchable visualizations (grid/k
| `objectName` | `string` | binding | ✓ | The object this block binds to (server-connected). |
| `viewType` | `'grid' \| 'kanban' \| 'gallery' \| 'calendar' \| 'timeline' \| 'gantt' \| 'map'` | binding | | Which visualization to render (default grid). How you get a kanban/calendar/gantt of the object. |
| `navigation` | `{ mode: 'page' \| 'drawer' \| 'modal' \| 'split' \| 'none' }` | binding | | What a row click does. Use { mode: "none" } when you handle clicks via onRowClick. |
| `fields` | `string[]` | binding | | Limit/order the columns shown (defaults to the object list fields). |
| `options` | `Record<string, any>` | binding | | View-type-specific options bag (kanban/calendar/gantt extras); prefer the typed spec props where they exist. |
| `filters` | `FilterArray e.g. ['status','=','active']` | controlled | | ObjectQL base filter; drive from React state for tabbed/searched lists. ([field, op, value]; ops =, !=, >, <, contains, in; compound: ["and", […], […]]). |
| `onRowClick` | `(record) => void` | callback | | Called with the clicked row's record — the hook for master/detail. |
| `onNavigate` | `(recordId, action: 'view' \| 'edit') => void` | callback | | Called for page-level navigation. |
Expand All @@ -69,6 +71,7 @@ Chart over an object’s aggregated data. Config props come from the spec Chart
|------|------|------|:--------:|-------------|
| `objectName` | `string` | binding | ✓ | The object this block binds to (server-connected). |
| `aggregate` | `{ field, function, groupBy }` | binding | | Aggregation: function (sum/avg/count) over field, grouped by groupBy. |
| `data` | `any[]` | binding | | Static/precomputed data to chart directly instead of binding via objectName + aggregate. |
| `filter` | `FilterArray` | controlled | | ObjectQL filter scoping the data; drive from React state. |
| `showLegend` | `boolean` | data | ✓ | Display legend |
| `title` | `string` | data | | Chart title |
Expand Down