-
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.
FIX (label, value): [EXPERIMENTAL] allow dotted path in valueField an… (
#18) * FIX (label, value): allow dotted path in valueField, labelField, searchBy and sortBy issue #17
- Loading branch information
Showing
15 changed files
with
115 additions
and
64 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import React from 'react'; | ||
import styled from '@emotion/styled'; | ||
|
||
import Select from '../../../src'; | ||
import { options } from '../options'; | ||
|
||
const AccessDataByPath = ({ title }) => ( | ||
<React.Fragment> | ||
<Title> | ||
<h2>{title}</h2> | ||
<a href="https://github.com/sanusart/react-dropdown-select/tree/master/docs/src/examples/AccessDataByPath.js"> | ||
Source | ||
</a> | ||
</Title> | ||
<p>"Label" is accessed via <code>company.catchPhrase</code> nested property of the <a href="https://github.com/sanusart/react-dropdown-select/tree/master/docs/src/options.js#L21">options</a> object</p> | ||
<Select | ||
multi | ||
options={options} | ||
values={[]} | ||
valueField="address.city" | ||
labelField="company.catchPhrase" | ||
searchBy="company.catchPhrase" | ||
onChange={(value) => | ||
console.log(`%c > onChange ${title} `, 'background: #555; color: tomato', value) | ||
} | ||
/> | ||
</React.Fragment> | ||
); | ||
|
||
AccessDataByPath.propTypes = {}; | ||
|
||
const Title = styled.div` | ||
display: flex; | ||
justify-content: space-between; | ||
align-items: baseline; | ||
`; | ||
|
||
export default AccessDataByPath; |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.