react-kd.ui
===

This is the code repository for the react karmadata ui components, this is a node module that developers can import and use in their projects to use the karmadata widgets to build custom apps.

Installation
---

```jsx
npm install react-kd.ui --save
```


Importing the library as a node dependency
---

```jsx
import * as KdUi from 'react-kd.ui';
```

List of Components
---

####KdSelectDate

This components is used when the developer want's the user to select a value from one of the karmadata entities, the user can do a search using an autocomplete input that make suggestions based on the input.

Example of usage:

```jsx

import { KdSelectDate, themes } from 'react-kd.ui';
import { FilterItem } from 'karmadata';


const mainSelectorOptionsDate = {
  visible: true,
  selected: '',
  optionValues: { // visiblity true by default
    anyOption: { visible: true, label: 'Any Date' },
    beforeOption: { visible: true, label: 'Antes'},
    betweenOption: { visible: true, label: 'Entre'},
    afterOption: { visible: true, label: 'Despues'},
    todayOption: { visible: false },
  },
};

const initialDates = [
  { "value": "7/27/2017 18:00", operator: "Gt" , "EntityType": null }, // After
  { "value": "9/27/2017 18:00", operator: "Lt", "EntityType": null }, // Before
  { "value": ["3/1/2017 07:00", "9/25/2016 9:00"], operator: "Between", "EntityType": null }
]

kdFilterModelDate = FilterItem("KdInvestigator", "ClinicalTrialsLastDate", "Date");

<KdSelectDate
  kdFilterModel={kdFilterModelDate}
  mainSelector={mainSelectorOptionsDate}
  selectedValuesInitial={initialDates}
/>

```
##Developers
- use yarn or npm link to test it locally,
  - yarn link /react-kd.ui folder (Recommend: you may want to change name of the lib in package.json to react-kd.ui-dev to use both npm and locally)
  - yarn link 'react-kd.ui(-dev)' in your app folder
  - yarn run watch in library folder
