DocSpace-buildtools/web/ASC.Web.Storybook/stories/advanced-selector/README.md

45 lines
1.6 KiB
Markdown
Raw Normal View History

2019-08-26 08:51:36 +00:00
# AdvancedSelector
## Usage
```js
import { AdvancedSelector } from 'asc-web-components';
```
#### Description
Required to select some advanced data.
#### Usage
```js
let options = [{key: "self", label: "Me"}];
options = [...options, ...[...Array(100).keys()].map(
index => {
return { key: `user${index}`, label: `User ${index+1} of ${optionsCount}` };
}
)];
<AdvancedSelector
placeholder="Search users"
onSearchChanged={(e) => console.log(e.target.value)}
options={options}
isMultiSelect={false}
buttonLabel="Add members"
onSelect={(selectedOptions) => console.log("onSelect", selectedOptions)}
/>
```
#### Properties
| Props | Type | Required | Values | Default | Description |
| ------------------ | -------- | :------: | ----------------------------------------- | --------- | ----------------------------------------------------- |
| `placeholder` | `string` | - | | | |
| `options` | `array of objects` | - | | | |
| `isMultiSelect` | `bool` | - | - | | |
| `buttonLabel` | `string` | - | - | | |
| `onSearchChanged` | `func` | - | - | | |
| `onSelect` | `func` | - | - | | |