@object-ui/plugin-object
v0.3.0
Published
ObjectQL plugin for Object UI - Object Table and Object Form components
Maintainers
Readme
@object-ui/plugin-object
ObjectQL plugin for Object UI, providing seamless integration with ObjectQL backends through auto-generated components.
Features
- ObjectTable: A specialized table component that automatically fetches and displays data from ObjectQL objects
- ObjectForm: A smart form component that generates forms from ObjectQL object schemas
Installation
npm install @object-ui/plugin-object @object-ui/data-objectqlUsage
ObjectTable
import { ObjectTable } from '@object-ui/plugin-object';
import { ObjectQLDataSource } from '@object-ui/data-objectql';
const dataSource = new ObjectQLDataSource({
baseUrl: 'https://api.example.com',
token: 'your-auth-token'
});
function UsersTable() {
return (
<ObjectTable
schema={{
type: 'object-table',
objectName: 'users'
}}
dataSource={dataSource}
/>
);
}ObjectForm
import { ObjectForm } from '@object-ui/plugin-object';
import { ObjectQLDataSource } from '@object-ui/data-objectql';
const dataSource = new ObjectQLDataSource({
baseUrl: 'https://api.example.com',
token: 'your-auth-token'
});
function UserForm() {
return (
<ObjectForm
schema={{
type: 'object-form',
objectName: 'users',
mode: 'create',
onSuccess: (data) => console.log('Created:', data)
}}
dataSource={dataSource}
/>
);
}Schema Integration
Both components automatically integrate with ObjectQL's schema system to:
- Display appropriate field types
- Apply field-level permissions
- Validate data according to schema rules
- Handle relationships between objects
License
MIT
