Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 16 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,21 +56,22 @@ export default Example;

## 👀 Props

| Prop | Description | Type | Default |
| --------------------- | ---------------------------------- | ------------------ | ------- |
| `labelledBy` | value for `aria-labelledby` | `string` | |
| `options` | options for dropdown | `[{label, value}]` | |
| `value` | pre-selected rows | `[{label, value}]` | `[]` |
| `focusSearchOnOpen` | focus on search input when opening | `boolean` | `true` |
| `hasSelectAll` | toggle 'Select All' option | `boolean` | `true` |
| `isLoading` | show spinner on select | `boolean` | `false` |
| `shouldToggleOnHover` | toggle dropdown on hover option | `boolean` | `false` |
| `overrideStrings` | Override default strings for i18n | `object` | |
| `onChange` | onChhange callback | `function` | |
| `disabled` | disable dropdown | `boolean` | `false` |
| `selectAllLabel` | _select all_ label | `string` | |
| `disableSearch` | hide search textbox | `boolean` | `false` |
| `filterOptions` | custom filter options | `function` | |
| Prop | Description | Type | Default |
| --------------------- | ---------------------------------- | ------------------ | -------------- |
| `labelledBy` | value for `aria-labelledby` | `string` | |
| `options` | options for dropdown | `[{label, value}]` | |
| `value` | pre-selected rows | `[{label, value}]` | `[]` |
| `focusSearchOnOpen` | focus on search input when opening | `boolean` | `true` |
| `hasSelectAll` | toggle 'Select All' option | `boolean` | `true` |
| `isLoading` | show spinner on select | `boolean` | `false` |
| `shouldToggleOnHover` | toggle dropdown on hover option | `boolean` | `false` |
| `overrideStrings` | Override default strings for i18n | `object` | |
| `onChange` | onChhange callback | `function` | |
| `disabled` | disable dropdown | `boolean` | `false` |
| `selectAllLabel` | _select all_ label | `string` | |
| `disableSearch` | hide search textbox | `boolean` | `false` |
| `filterOptions` | custom filter options | `function` | |
| `className` | class name for parent component | `string` | `multi-select` |

## 🌐 Internationalization

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-multi-select-component",
"version": "2.0.3",
"version": "2.0.4",
"description": "Simple and lightweight multiple selection dropdown component with checkboxes, search and select-all",
"author": "Harsh Zalavadiya",
"license": "MIT",
Expand Down
1 change: 1 addition & 0 deletions src/lib/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,5 @@ export interface ISelectProps {
filterOptions?: (options: Option[], filter: string) => Option[];
overrideStrings?: { [key: string]: string };
labelledBy: string;
className?: string;
}
3 changes: 2 additions & 1 deletion src/multi-select/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ const MultiSelect = ({
focusSearchOnOpen = true,
hasSelectAll = true,
shouldToggleOnHover = false,
className = "multi-select",
options,
value,
valueRenderer,
Expand All @@ -45,7 +46,7 @@ const MultiSelect = ({
}: ISelectProps) => {
const nvalue = value || [];
return (
<div className={`${MultiSelectBox} multi-select`}>
<div className={`${MultiSelectBox} ${className}`}>
<Dropdown
isLoading={isLoading}
contentComponent={SelectPanel}
Expand Down
1 change: 1 addition & 0 deletions stories/default.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export const toStorybook = () => {
disabled={boolean("disabled", false)}
onChange={setSelected}
labelledBy={text("labelledBy", "Select Fruits")}
className={text("className", "multi-select")}
/>
</div>
);
Expand Down