1.0.2 • Published 3 months ago

@zohodesk/library-platform v1.0.2

Weekly downloads
-
License
ISC
Repository
-
Last release
3 months ago

Table List Library

This library provides components for rendering Table List pages in compliance with the Zoho Desk Module Framework standards. It includes functionality for table handling.

Installation

To install the library, use the following command:

npm install @zohodesk/library-platform

Usage

Creating a Table Connected Component

To create a Table Connected component, you can use the TableConnectedFactory. Here is a simple example:

import TableConnectedFactory from '@zohodesk/library-platform/TableConnectedFactory';

const myTableComponent = TableConnectedFactory.create({
  name: 'MyTableComponent',
  dataBroker: myDataBroker,
  eventHandlers: {
    onRowSelect: row => {
      console.log('Selected row:', row);
    }
  }
});

Custom Component Creation

You can create custom components using the createCustomComponent function. This function sets up the component with the necessary dependencies and lifecycle methods.

Example

import createCustomComponent from '@zohodesk/library-platform/createCustomComponent';

const MyCustomComponent = createCustomComponent({
  name: 'MyCustomComponent',
  View: MyComponentView // Your component view
});

// Usage in application
<MyCustomComponent />;

Component Registry

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

import ComponentRegistry from '@zohodesk/library-platform/ComponentRegistry';

// Register a component
ComponentRegistry.register('MyComponent', myComponentInstance);

// Retrieve a component
const myComponent = ComponentRegistry.get('MyComponent');

Props Contract

The TableConnectedFactory.create method accepts the following parameters:

  • name: string - The name of the component.
  • dataBroker: object - The data broker instance to manage data fetching and manipulation.
  • eventHandlers: object - An object containing event handler functions.
  • View: React.Component - Custom view component to render the table.

Components Overview

  • 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.
1.1.0-exp.2

3 months ago

1.1.0-exp.1

6 months ago

1.0.2

6 months ago

1.0.1

6 months ago

1.0.0

7 months ago

1.0.0-exp.6

7 months ago

1.0.0-exp.5

7 months ago

1.0.0-exp.4

7 months ago

1.0.0-exp.3

8 months ago

1.0.0-exp.2

8 months ago

1.0.0-exp.1

8 months ago