-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FEATURE (dropdown): allow to Select/clear all (#286)
- Loading branch information
Showing
6 changed files
with
159 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import React from 'react'; | ||
import { Heading } from './components/Heading'; | ||
import Select from '../../../src'; | ||
import { LiveProvider, LiveEditor, LiveError, LivePreview } from 'react-live'; | ||
import theme from 'prism-react-renderer/themes/github'; | ||
|
||
const code = `<Select | ||
options={options} | ||
multi | ||
selectAll | ||
selectAllLabel="Select all" // this is the default | ||
clearAllLabel="Clear all" // this is the default | ||
values={[]} | ||
onChange={(value) => console.log(value)} | ||
/>`; | ||
|
||
const SelectAll = ({ options, title }) => ( | ||
<React.Fragment> | ||
<Heading | ||
title={title} | ||
source="https://github.com/sanusart/react-dropdown-select/tree/master/docs/src/examples/Basic.js" | ||
/> | ||
|
||
<LiveProvider theme={theme} code={code} scope={{ Select, options }}> | ||
<LiveEditor /> | ||
<br /> | ||
<LiveError /> | ||
<LivePreview /> | ||
</LiveProvider> | ||
</React.Fragment> | ||
); | ||
|
||
export default SelectAll; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters