@lims.io/connector-control-panel

Connector for LIMS Control Panel

Usage no npm install needed!

<script type="module">
  import limsIoConnectorControlPanel from 'https://cdn.skypack.dev/@lims.io/connector-control-panel';
</script>

README

LIMS Connector for Control Panel

Injects Control Panel to the web page and allows communication with the related API.

Getting started

import ControlPanel from "lims-connector-control-panel";

// The name of the node that will hold the control panel
const node = '#container';
// Url to control panel api
const url = 'http://control-panel.lims.io';
// Permatoken
const permatoken = '... load from db ...';

const controlPanel = ControlPanel(node, url, {
    permatoken,
    onLoad() {
        
    },
    // Other API calls
});

Drivers

The library can be also used as a part of the following frameworks.

React

import React from "react";
import ReactDOM from "react-dom";
import {createReactComponent} from "lims-connector-control-panel";

// Create panel component
const ControlPanel = createReactComponent(React, ReactDOM);

const View = ({url, permatoken, onLoad}) => (   
    <div>
        <ControlPanel url={url} permatoken={permatoken} onLoad={onLoad}/>
    </div>
);

Scripts

  • yarn build - produces production version of your library under the dist folder
  • yarn test - runs the tests
  • yarn test:watch - same as above but in a watch mode