@xlork/core
Advanced tools
Comparing version 1.0.0 to 1.0.1
{ | ||
"name": "@xlork/core", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "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.", | ||
@@ -5,0 +5,0 @@ "author": "Shavron", |
@@ -5,12 +5,10 @@ # xlork | ||
> React adapter for xlork.com | ||
> React pure javascript adapter for xlork importer. | ||
[![NPM](https://img.shields.io/npm/v/@csvbox/react.svg)](https://www.npmjs.com/package/@csvbox/react) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com) | ||
[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com) [![](https://data.jsdelivr.com/v1/package/npm/@xlork/core/badge)](https://www.jsdelivr.com/package/npm/@xlork/core) [![Rate this package](https://badges.openbase.com/js/rating/@xlork/core.svg?style=openbase&token=xiok8JvOhgNpIwlueBu6IAFQBYM8hnfytyg/aUj+mu0=)](https://openbase.com/js/@xlork/core?utm_source=embedded&utm_medium=badge&utm_campaign=rate-badge) | ||
## Installation / Import | ||
First, install the dependency via npm: | ||
```js | ||
import { XLorkClient } from '@xlork/react'; | ||
<script src="https://cdn.jsdelivr.net/npm/@xlork/core/dist/xlork.min.js"></script> | ||
``` | ||
@@ -21,61 +19,43 @@ | ||
```javascript | ||
<XLorkClient | ||
licenseKey="XXXX-XXXX-XXXX-XXXX" | ||
preload={false} | ||
user={{ | ||
email: 'example@xlork.com', | ||
name: 'xlork-demo', | ||
}} | ||
settings={{ | ||
title: 'Upload data', | ||
const config = { | ||
licenseKey: 'U264Y-OQDB2-QRZJB-ZTL1P-I21FF', | ||
user: { | ||
email: 'example@xlork.in', | ||
name: 'Jhon', | ||
}, | ||
settings: { | ||
title: 'Upload Address', | ||
columns: [ | ||
{ | ||
label: 'Customer Name', | ||
key: 'customer_name', | ||
type: 'text', | ||
validators: { | ||
type: 'required', | ||
regexMatches: '^[0-9]{10}$', | ||
error: 'Name can not be blank', | ||
}, | ||
label: 'Invoice date', | ||
key: 'address', | ||
}, | ||
{ | ||
label: 'Customer Mobile', | ||
key: 'customer_mobile_number', | ||
type: 'numeric', | ||
validators: { | ||
regexMatches: '^[0-9]{10}$', | ||
error: 'Please input 10 digit no.', | ||
}, | ||
label: 'Retailer Code', | ||
key: 'latitude', | ||
}, | ||
{ | ||
label: 'Email', | ||
key: 'email', | ||
type: 'email', | ||
label: 'SKU Code', | ||
key: 'longitude', | ||
}, | ||
{ | ||
label: 'Date', | ||
key: 'date', | ||
type: 'date', | ||
dateFormat: 'DD-MM-YYYY', | ||
label: 'Product Quantity (CFC)', | ||
key: 'state', | ||
}, | ||
], | ||
theme: 'SUNFLOWER', | ||
maxRecords: 20, | ||
theme: 'AQUA', | ||
allowInvalidSubmit: true, | ||
}} | ||
onComplete={async (response) => { | ||
console.log(response); | ||
}} | ||
onCancel={() => { | ||
console.log('onCancel - ----'); | ||
}} | ||
loadOnDemand={(init) => { | ||
return ( | ||
<button className="btn btn-primary extra_margin" onClick={init}> | ||
Upload Data | ||
</button> | ||
); | ||
}} | ||
/> | ||
maxRecords: 50, | ||
}, | ||
onComplete: (response) => { | ||
console.log('[onComplete]', response); | ||
}, | ||
onCancel: () => { | ||
console.log('[onCancel]'); | ||
}, | ||
}; | ||
const XLork = new xLorkClient(config); | ||
Xlork.init(); | ||
``` | ||
@@ -82,0 +62,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
7576
70