This library provides components for rendering Table List pages in compliance with the Zoho Desk Module Framework standards. It includes functionality for table handling.
npm install @zohodesk/library-platformThis library provides components for rendering Table List pages in compliance with the Zoho Desk Module Framework standards. It includes functionality for table handling.
To install the library, use the following command:
``bash`
npm install @zohodesk/library-platform
To create a Table Connected component, you can use the TableConnectedFactory. Here is a simple example:
`javascript
import {TableConnectedFactory} from '@zohodesk/library-platform';
const myTableComponent = TableConnectedFactory.create({
name: 'MyTableComponent',
dataSource: myDataSource,
eventHandlers: {
onRowSelect: row => {
console.log('Selected row:', row);
}
}
});
`
You can create custom components using the createCustomComponent function. This function sets up the component with the necessary dependencies and lifecycle methods.
#### Example
`javascript
import {createCustomComponent} from '@zohodesk/library-platform';
const MyCustomComponent = createCustomComponent({
name: 'MyCustomComponent',
View: MyComponentView // Your component view
});
// Usage in application
`
The ComponentRegistry class is a singleton that allows you to register and retrieve components by name. This can be useful for managing component instances throughout your application.
#### Example
`javascript
import {ComponentRegistry} from '@zohodesk/library-platform';
// Register a component
ComponentRegistry.register('MyComponent', myComponentInstance);
// Retrieve a component
const myComponent = ComponentRegistry.get('MyComponent');
`
The TableConnectedFactory.create method accepts the following parameters:
- name: string - The name of the component.object
- dataSource: - The data broker instance to manage data fetching and manipulation.object
- eventHandlers: - An object containing event handler functions.React.Component` - Custom view component to render the table.
- View:
- Properties: Defines the props contract for the Table Connected component.
- TableConnectedView: The default view component for rendering the table.
- EventHandlersFactory: Factory to manage event handlers for the component.
- Behaviour Factories: Include various behaviours such as HTTP requests, field management, and list rendering.
- ComponentRegistry: Singleton for managing component instances across your application.
- createCustomComponent: Function to create custom components with necessary dependencies and lifecycle methods.