-
Notifications
You must be signed in to change notification settings - Fork 431
Development/sorted classes and style #136
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
17 commits
Select commit
Hold shift + click to select a range
ece15fe
fix missing defaultSorted props for default sort sample
chunming-c 8a932d7
implement customized classes for sorted header
chunming-c fa43997
[test] test for sorted header classes
chunming-c 97a62ed
implement customized style for sorted header
chunming-c 5de10c5
[test] test for sorted header style
chunming-c 6770b4f
update document
chunming-c 2419146
add missing props check and fix typo
chunming-c 115ca19
seperate sorting style and header into two props
chunming-c e06bfbb
[test] add test case if column.headerStyle and column.headerClasses w…
chunming-c c75f239
implement customized header style and classes in column level
chunming-c eab1a63
[test] test for customized header style and classes in column level
chunming-c 61ca2e3
[DOC] document for customized classes and styles
chunming-c af095c0
sample for customized classes and styles
chunming-c 269ffb3
resolve conflict
chunming-c 1014de2
typo fix for document
chunming-c 249f8a6
resolve conflict
chunming-c 90cada4
tuning the wording for test and documents
chunming-c 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
61 changes: 61 additions & 0 deletions
61
packages/react-bootstrap-table2-example/examples/sort/header-sorting-classes.js
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,61 @@ | ||
| /* eslint | ||
| no-unused-vars: 0 | ||
| arrow-body-style: 0 | ||
| */ | ||
|
|
||
| import React from 'react'; | ||
|
|
||
| import BootstrapTable from 'react-bootstrap-table2'; | ||
| import Code from 'components/common/code-block'; | ||
| import { productsGenerator } from 'utils/common'; | ||
|
|
||
| const products = productsGenerator(); | ||
|
|
||
| const headerSortingClasses = (column, sortOrder, isLastSorting, colIndex) => ( | ||
| sortOrder === 'asc' ? 'demo-sorting-asc' : 'demo-sorting-desc' | ||
| ); | ||
|
|
||
| const columns = [{ | ||
| dataField: 'id', | ||
| text: 'Product ID', | ||
| sort: true, | ||
| headerSortingClasses | ||
| }, { | ||
| dataField: 'name', | ||
| text: 'Product Name', | ||
| sort: true, | ||
| headerSortingClasses | ||
| }, { | ||
| dataField: 'price', | ||
| text: 'Product Price' | ||
| }]; | ||
|
|
||
| const sourceCode = `\ | ||
| const headerSortingClasses = (column, sortOrder, isLastSorting, colIndex) => ( | ||
| sortOrder === 'asc' ? 'demo-sorting-asc' : 'demo-sorting-desc' | ||
| ); | ||
|
|
||
| const columns = [{ | ||
| dataField: 'id', | ||
| text: 'Product ID', | ||
| sort: true, | ||
| headerSortingClasses | ||
| }, { | ||
| dataField: 'name', | ||
| text: 'Product Name', | ||
| sort: true, | ||
| headerSortingClasses | ||
| }, { | ||
| dataField: 'price', | ||
| text: 'Product Price' | ||
| }]; | ||
|
|
||
| <BootstrapTable keyField="id" data={ products } columns={ columns } /> | ||
| `; | ||
|
|
||
| export default () => ( | ||
| <div> | ||
| <BootstrapTable keyField="id" data={ products } columns={ columns } /> | ||
| <Code>{ sourceCode }</Code> | ||
| </div> | ||
| ); |
54 changes: 54 additions & 0 deletions
54
packages/react-bootstrap-table2-example/examples/sort/header-sorting-style.js
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,54 @@ | ||
| /* eslint no-unused-vars: 0 */ | ||
| import React from 'react'; | ||
|
|
||
| import BootstrapTable from 'react-bootstrap-table2'; | ||
| import Code from 'components/common/code-block'; | ||
| import { productsGenerator } from 'utils/common'; | ||
|
|
||
| const products = productsGenerator(); | ||
|
|
||
| const headerSortingStyle = { backgroundColor: '#c8e6c9' }; | ||
|
|
||
| const columns = [{ | ||
| dataField: 'id', | ||
| text: 'Product ID', | ||
| sort: true, | ||
| headerSortingStyle | ||
| }, { | ||
| dataField: 'name', | ||
| text: 'Product Name', | ||
| sort: true, | ||
| headerSortingStyle | ||
| }, { | ||
| dataField: 'price', | ||
| text: 'Product Price' | ||
| }]; | ||
|
|
||
|
|
||
| const sourceCode = `\ | ||
| const headerSortingStyle = { backgroundColor: '#c8e6c9' }; | ||
|
|
||
| const columns = [{ | ||
| dataField: 'id', | ||
| text: 'Product ID', | ||
| sort: true, | ||
| headerSortingStyle | ||
| }, { | ||
| dataField: 'name', | ||
| text: 'Product Name', | ||
| sort: true, | ||
| headerSortingStyle | ||
| }, { | ||
| dataField: 'price', | ||
| text: 'Product Price' | ||
| }]; | ||
|
|
||
| <BootstrapTable keyField="id" data={ products } columns={ columns } /> | ||
| `; | ||
|
|
||
| export default () => ( | ||
| <div> | ||
| <BootstrapTable keyField="id" data={ products } columns={ columns } /> | ||
| <Code>{ sourceCode }</Code> | ||
| </div> | ||
| ); |
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
8 changes: 8 additions & 0 deletions
8
packages/react-bootstrap-table2-example/stories/stylesheet/sort/_index.scss
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,8 @@ | ||
| .demo-sorting, | ||
| .demo-sorting-asc { | ||
| background-color: $green-lighten-2; | ||
| } | ||
|
|
||
| .demo-sorting-desc { | ||
| background-color: $light-blue; | ||
| } |
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks