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
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,24 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Added

- **New Plugin**: `@object-ui/plugin-object` - ObjectQL plugin for automatic table and form generation
- `ObjectTable`: Auto-generates tables from ObjectQL object schemas
- `ObjectForm`: Auto-generates forms from ObjectQL object schemas with create/edit/view modes
- Full TypeScript support with comprehensive type definitions
- **Type Definitions**: Added `ObjectTableSchema` and `ObjectFormSchema` to `@object-ui/types`
- **ObjectQL Integration**: Enhanced `ObjectQLDataSource` with `getObjectSchema()` method using MetadataApiClient

### Changed

- Updated `@objectql/sdk` from ^1.8.3 to ^1.9.1
- Updated `@objectql/types` from ^1.8.3 to ^1.9.1

---

## [0.2.1] - 2026-01-15

### Changed
Expand Down
8 changes: 8 additions & 0 deletions examples/showcase/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,14 @@
{ "label": "Scroll Area", "path": "/complex/scroll-area", "icon": "Scroll" },
{ "label": "Chatbot", "path": "/complex/chatbot", "icon": "Bot" }
]
},
{
"label": "ObjectQL",
"icon": "Database",
"children": [
{ "label": "Object Table", "path": "/objectql/object-table", "icon": "Table" },
{ "label": "Object Form", "path": "/objectql/object-form", "icon": "FileEdit" }
]
}
],
"actions": [
Expand Down
214 changes: 214 additions & 0 deletions examples/showcase/pages/objectql/object-form.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,214 @@
{
"type": "page",
"title": "Object Form - ObjectQL Components",
"body": [
{
"type": "div",
"className": "space-y-6 container mx-auto py-6 max-w-6xl",
"children": [
{
"type": "div",
"className": "space-y-2",
"children": [
{
"type": "text",
"value": "Object Form",
"className": "text-3xl font-bold tracking-tight"
},
{
"type": "text",
"value": "Auto-generates forms from ObjectQL object schemas. Supports create, edit, and view modes with automatic field generation and validation.",
"className": "text-lg text-muted-foreground"
}
]
},
{
"type": "separator",
"className": "my-6"
},
{
"type": "div",
"className": "space-y-6",
"children": [
{
"type": "card",
"title": "Create Mode",
"description": "ObjectForm in create mode - generates form fields from object schema for creating new records.",
"children": {
"type": "div",
"className": "space-y-4",
"children": [
{
"type": "alert",
"variant": "default",
"title": "Demo Mode",
"description": "This is a simulated example. In production, ObjectForm would connect to an ObjectQL backend, fetch object metadata, and submit data to the API.",
"className": "mb-4"
},
{
"type": "div",
"className": "p-4 bg-muted/50 rounded-lg font-mono text-sm",
"children": {
"type": "text",
"value": "const dataSource = new ObjectQLDataSource({\n baseUrl: 'https://api.example.com',\n token: 'your-auth-token'\n});\n\n<ObjectForm \n schema={{\n type: 'object-form',\n objectName: 'contacts',\n mode: 'create',\n onSuccess: (data) => console.log('Created:', data)\n }}\n dataSource={dataSource}\n/>",
"className": "whitespace-pre"
}
},
{
"type": "text",
"value": "Example Output:",
"className": "text-sm font-semibold mt-4"
},
{
"type": "form",
"layout": "vertical",
"submitLabel": "Create Contact",
"showCancel": true,
"fields": [
{
"name": "name",
"label": "Full Name",
"type": "input",
"required": true,
"placeholder": "John Doe"
},
{
"name": "email",
"label": "Email",
"type": "input",
"inputType": "email",
"required": true,
"placeholder": "[email protected]"
},
{
"name": "company",
"label": "Company",
"type": "input",
"placeholder": "Acme Corp"
},
{
"name": "status",
"label": "Status",
"type": "select",
"options": [
{ "label": "Active", "value": "active" },
{ "label": "Inactive", "value": "inactive" }
]
}
]
}
]
}
},
{
"type": "card",
"title": "Edit Mode",
"description": "ObjectForm in edit mode - fetches existing record data and allows updates.",
"children": {
"type": "div",
"className": "space-y-4",
"children": [
{
"type": "div",
"className": "p-4 bg-muted/50 rounded-lg font-mono text-sm",
"children": {
"type": "text",
"value": "<ObjectForm \n schema={{\n type: 'object-form',\n objectName: 'contacts',\n mode: 'edit',\n recordId: '12345',\n onSuccess: (data) => console.log('Updated:', data)\n }}\n dataSource={dataSource}\n/>",
"className": "whitespace-pre"
}
},
{
"type": "text",
"value": "Example Output:",
"className": "text-sm font-semibold mt-4"
},
{
"type": "form",
"layout": "vertical",
"submitLabel": "Update Contact",
"showCancel": true,
"defaultValues": {
"name": "Alice Johnson",
"email": "[email protected]",
"company": "Tech Innovators",
"status": "active"
},
"fields": [
{
"name": "name",
"label": "Full Name",
"type": "input",
"required": true
},
{
"name": "email",
"label": "Email",
"type": "input",
"inputType": "email",
"required": true
},
{
"name": "company",
"label": "Company",
"type": "input"
},
{
"name": "status",
"label": "Status",
"type": "select",
"options": [
{ "label": "Active", "value": "active" },
{ "label": "Inactive", "value": "inactive" }
]
}
]
}
]
}
},
{
"type": "card",
"title": "Custom Field Configuration",
"description": "Specify which fields to include and override auto-generated configurations.",
"children": {
"type": "div",
"className": "space-y-4",
"children": [
{
"type": "div",
"className": "p-4 bg-muted/50 rounded-lg font-mono text-sm",
"children": {
"type": "text",
"value": "<ObjectForm \n schema={{\n type: 'object-form',\n objectName: 'users',\n mode: 'create',\n fields: ['username', 'email', 'role'],\n customFields: [\n {\n name: 'username',\n label: 'Username',\n placeholder: 'Choose a unique username'\n }\n ]\n }}\n dataSource={dataSource}\n/>",
"className": "whitespace-pre"
}
}
]
}
},
{
"type": "card",
"title": "Features",
"children": {
"type": "list",
"items": [
"Auto-fetches object metadata from ObjectQL using MetadataApiClient",
"Auto-generates form fields based on field definitions",
"Supports create, edit, and view modes",
"Fetches existing record data in edit/view modes",
"Handles form validation based on field schema",
"Submits data to ObjectQL backend automatically",
"Supports custom field configurations and overrides",
"Includes loading and error states",
"Full TypeScript support with ObjectFormSchema",
"Callback support for success and error handling"
]
}
}
]
}
]
}
],
"icon": "FileEdit"
}
Loading