1.0.26 • Published 2 years ago

xlork v1.0.26

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

xlork

We’ve made it really simple for you to get started with xlork with our new xlorkClient Component. Here’s what you’ll need to know to get started.

React adapter for xlork.com

NPM JavaScript Style Guide

Installation / Import

First, install the dependency via npm:

import { XLorkClient } from 'xlork'

Usage

<XLorkClient
  licenseKey='805d720b-d78a-4936-ab4f-ca7999cccd4c'
  user={{
    id: 'xxx',
    email: 'xxx@gmail.com',
    name: 'name'
  }}
  settings={{
    title: 'Stops',
    description: 'Stops',
    allowInvalidSubmit: true,
    allowCustom: false,
    columns: [
      {
        label: 'Notes',
        key: 'notes',
        type: 'list',
        description: 'only list values are acceptable',
        options: [
          { value: 'bad', label: 'Bad' },
          {
            value: 'good',
            label: 'Good',
            alternates: ['great', 'wonderful']
          }
        ]
      },

      {
        label: 'Customer Mobile',
        key: 'customer_mobile_number',
        validators: [
          {
            type: 'regex_matches',
            regex: '^[0-9]{10}$',
            error: '10 digit'
          }
        ]
      },
      {
        label: 'Customer Name',
        key: 'customer_name',
        validators: [
          {
            type: 'required',
            error: 'Name can not be blank'
          }
        ]
      },
      {
        label: 'Date',
        key: 'date',
        type: 'date',
        validators: [
          {
            format: 'YYYY-MM-DD',
            error: 'date field'
          }
        ]
      },
      {
        label: 'Email',
        key: 'email',
        type: 'email'
      }
    ],
    // theme: 'SUNFLOWER', //GRAPFRUIT,FLATRED,FLATORANGE, AQUA, MINT, LIME,FLATMINT,BLUEJEANS,SKYBLUE, GRASS, SUNFLOWER, BITTERSWEET,PINKROSE,LIGHTPINK, DARKGRAY,FLATGRAY
    maxRecords: 2000,
    sampleUrl:
      'https://xlark-project-test.s3.ap-south-1.amazonaws.com/fleet_owner%20%282%29.csv'
  }}
  onComplete={async (response) => {
    console.log(response)
  }}
  onCancel={() => {
    console.log('onCancel - ----')
  }}
  loadOnDemand={(init) => {
    return (
      <button className='btn btn-primary extra_margin' onClick={init}>
        Upload Stops via XL File
      </button>
    )
  }}
/>

Try our example in CodeSandbox.

Readme

For usage see the guide here - https://xlork.com/getting-started#2-install-code

License

MIT © xlork

1.0.26

2 years ago

1.0.25

2 years ago

1.0.24

2 years ago

1.0.23

2 years ago

1.0.22

2 years ago

1.0.21

2 years ago

1.0.20

2 years ago

1.0.19

2 years ago

1.0.18

2 years ago

1.0.17

2 years ago

1.0.16

2 years ago

1.0.15

2 years ago

1.0.14

2 years ago

1.0.13

2 years ago

1.0.12

2 years ago

1.0.11

2 years ago

1.0.10

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago