0.12.0 • Published 26 days ago

@harmonyorg/importer-js v0.12.0

Weekly downloads
-
License
UNLICENSED
Repository
-
Last release
26 days ago

@rowslint/importer-js

The Rowslint JavaScript script provides access to the prebuilt importer component. The package interacts directly with the Rowslint APIs using your API key.

Usage

Call the launch() method with the organizatio API key and the template key parameters to display the importer UI.

<button onclick="launch()">Launch</button>

<script src="https://cdn.jsdelivr.net/npm/@rowslint/importer-js/dist/rowslint.js"></script>
<script>
  function launch() {
    rowslint.launch({
      // Your organization API key here.
      apiKey: "ORGANIZATION_API_KEY",
      config: {
        // Your template key here.
        templateKey: "TEMPLATE_KEY"
      }
    });
  }
</script>

Headless UI

You can also use your custom upload UI and then use Rowslint importer only to format and validate data. To do so, call the launch() method with the uploaded file (in file type).

rowslint.launch({
  apiKey: 'ORGANIZATION_API_KEY',
  config: {
    templateKey: 'TEMPLATE_KEY',
    // `currentFile` in `file` type.
    file: currentFile,
  },
});

Events

The launch() method provide a callback parameter which is triggered on the importer closes. You can use it to handle the closing of the importer after the import has been completed.

rowslint.launch({
  apiKey: 'ORGANIZATION_API_KEY',
  config: { templateKey: 'TEMPLATE_KEY' },
  onImport: (result) => {
    switch (result.status) {
      case 'success':
        // Handle spreadsheet import success.
        break;
      case 'error':
        // Handle spreadsheet import error.
        break;
      case 'cancelled':
        // Handle spreadsheet import cancel.
        break;
    }
  },
});
0.11.0

26 days ago

0.12.0

26 days ago

0.10.0

26 days ago

0.1.16

1 month ago

0.1.14

3 months ago

0.1.15

3 months ago

0.1.13

4 months ago

0.1.12

4 months ago

0.1.11

5 months ago

0.1.10

5 months ago

0.1.9

6 months ago

0.1.8

6 months ago

0.1.7

6 months ago

0.1.5

6 months ago

0.1.3

6 months ago

0.1.2

6 months ago

0.1.1

6 months ago

0.1.0

6 months ago

0.0.13

6 months ago

0.0.12

6 months ago

0.0.11

6 months ago

0.0.10

6 months ago

0.0.9

6 months ago

0.0.8

6 months ago

0.0.7

7 months ago

0.0.6

7 months ago

0.0.5

7 months ago