-
Notifications
You must be signed in to change notification settings - Fork 376
feat(DataList): add compact data list #3807
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
43686c0
feat(DataList): add compact flag
kmcfaul 37477b3
feat(DataList): update tests, snapshots
kmcfaul 640e1f5
feat(DataList): add compact demo to integration
kmcfaul 2b5870d
feat(DataList): move integration demo back to integration
kmcfaul 1f39eee
docs(DataList): update aria label on example
kmcfaul File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
66 changes: 66 additions & 0 deletions
66
...s/react-integration/demo-app-ts/src/components/demos/DataListDemo/DataListCompactDemo.tsx
This file contains hidden or 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,66 @@ | ||
| import React from 'react'; | ||
| import { | ||
| DataList, | ||
| DataListProps, | ||
| DataListItem, | ||
| DataListItemRow, | ||
| DataListItemCells, | ||
| DataListCell | ||
| } from '@patternfly/react-core'; | ||
|
|
||
| interface DataListState { | ||
| selectedDataListItemId: string; | ||
| } | ||
|
|
||
| export class DataListCompactDemo extends React.Component<DataListProps, DataListState> { | ||
| constructor(props) { | ||
| super(props); | ||
| this.state = { | ||
| selectedDataListItemId: '' | ||
| }; | ||
| } | ||
|
|
||
| onSelectDataListItem = id => { | ||
| this.setState({ selectedDataListItemId: id }); | ||
| }; | ||
|
|
||
| render() { | ||
| return ( | ||
| <DataList | ||
| aria-label="Simple data list example" | ||
| selectedDataListItemId={this.state.selectedDataListItemId} | ||
| onSelectDataListItem={this.onSelectDataListItem} | ||
| isCompact | ||
| > | ||
| <DataListItem aria-labelledby="simple-item1" id="row1"> | ||
| <DataListItemRow> | ||
| <DataListItemCells | ||
| dataListCells={[ | ||
| <DataListCell key="primary content"> | ||
| <span id="simple-item1">Primary content</span> | ||
| </DataListCell>, | ||
| <DataListCell key="secondary content"> | ||
| <span id="simple-item2">Secondary content</span> | ||
| </DataListCell> | ||
| ]} | ||
| /> | ||
| </DataListItemRow> | ||
| </DataListItem> | ||
| <DataListItem aria-labelledby="simple-item2" id="row2"> | ||
| <DataListItemRow> | ||
| <DataListItemCells | ||
| dataListCells={[ | ||
| <DataListCell isFilled={false} key="secondary content fill"> | ||
| <span id="simple-item3">Secondary content (pf-m-no-fill)</span> | ||
| </DataListCell>, | ||
| <DataListCell isFilled={false} alignRight key="secondary content align"> | ||
| <span id="simple-item4">Secondary content (pf-m-align-right pf-m-no-fill)</span> | ||
| </DataListCell> | ||
| ]} | ||
| /> | ||
| </DataListItemRow> | ||
| </DataListItem> | ||
| </DataList> | ||
| ); | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.