@humany/widget-types-agent-portal
TypeScript icon, indicating that this package has built-in type declarations

1.0.0-beta.57 • Public • Published

Humany Agent Portal Widget

General commands

The following commands are part of the Webprovisions widget definition and are available for all widget types.

initialize(): Promise

Gets the widget config from the ServiceClient and maps it to $settings on the Container.
Creates and registers a new TextManager on the Container.
Finally removes any found triggerElements.

activate(widgetActivationOptions?: { widgetDOMElement?: HTMLElement }): Promise

Uses the passed widgetDOMElement or creates new widgetDOMElement, appends to document.body and adds it to the Container.
Initializes the widget router.
Connects the widget data source.
Finally renders the widget inside the widgetDOMElement.

deactivate(): Promise

Deactivates the widget router and removes the widgetDOMElement from the DOM.

Services

Both asynchronous and synchronous services are available on the Container:

Async services:

// ES stage 3 syntax
const theService = await container.getAsync('theService');

// ES6 syntax
container.getAsync('theService').then((theService) => {

});

Sync services:

const theService = container.get('theService');

The following service is registered when an Agent Portal widget is created.

data: DataSource: Data source containing a stream of entries used to display data.
writer: DataWriter: Writer used to write and/or update entries on the data source.
router: RoutingService: Router used to handle routing.
storage: StorageProvider: Storage service used to store things in the browser, i.e cookies, session and local storage.
matchingClient: ServiceClient: Simple HTTP-client used to get data from the Humany Service.
texts: TextManager: Simple handler for localized and translated texts.

Readme

Keywords

Package Sidebar

Install

npm i @humany/widget-types-agent-portal

Weekly Downloads

0

Version

1.0.0-beta.57

License

SEE LICENSE IN LICENSE.txt

Unpacked Size

1.3 MB

Total Files

891

Last publish

Collaborators

  • anderslindvalltelia
  • donami
  • bratn
  • totte