mirror of
https://github.com/gosticks/react-table.git
synced 2026-08-19 16:30:21 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ecd660ef10 | ||
|
|
be951a3252 | ||
|
|
f195b3243d | ||
|
|
19a0187720 |
@@ -2,13 +2,13 @@
|
||||
<a href="https://github.com/tannerlinsley/react-table"><img src="https://github.com/tannerlinsley/react-table/raw/master/media/Banner.png" alt="React Table Logo" style="width:450px;"/></a>
|
||||
<br />
|
||||
<br />
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
# react-table
|
||||
A fast, lightweight, opinionated table and datagrid built on React
|
||||
|
||||
[](https://travis-ci.org/tannerlinsley/react-table) []() [](https://react-table-slack.herokuapp.com/) []() [](https://twitter.com/tannerlinsley)
|
||||
[](https://travis-ci.org/tannerlinsley/react-table) [](https://npmjs.com/packag/react-table) [](https://react-table-slack.herokuapp.com/) [](https://github.com/tannerlinsley/react-table) [](https://twitter.com/tannerlinsley)
|
||||
|
||||
## Features
|
||||
|
||||
@@ -96,10 +96,14 @@ These are the default props for the main react component `<ReactTable />`
|
||||
|
||||
// Callbacks
|
||||
onChange: (state, instance) => null, // Anytime the internal state of the table changes, this will fire
|
||||
onTrClick: (row, event) => null, // Handler for row click events
|
||||
|
||||
// Text
|
||||
previousText: 'Previous',
|
||||
nextText: 'Next'
|
||||
nextText: 'Next',
|
||||
pageText: 'Page',
|
||||
ofText: 'of',
|
||||
rowsText: 'rows',
|
||||
|
||||
// Classes
|
||||
className: '-striped -highlight', // The most top level className for the component
|
||||
@@ -287,7 +291,7 @@ If you would like to help develop a suggested feature follow these steps:
|
||||
|
||||
- Fork this repo
|
||||
- `npm install`
|
||||
- `npm watch`
|
||||
- `npm run watch`
|
||||
- Implement your changes to files in the `src/` directory
|
||||
- Submit PR for review
|
||||
|
||||
@@ -297,7 +301,7 @@ If you would like to preview your changes, you can link and utilize the example
|
||||
- `cd example`
|
||||
- `npm install`
|
||||
- `npm link react-table`
|
||||
- `npm watch`
|
||||
- `npm run watch`
|
||||
- Make changes to the example in `src/screens/index.js` if needed
|
||||
- View changes at `localhost:8000`
|
||||
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "react-table",
|
||||
"version": "3.1.4",
|
||||
"version": "3.2.0",
|
||||
"description": "A fast, lightweight, opinionated table and datagrid built on React",
|
||||
"license": "MIT",
|
||||
"homepage": "https://github.com/tannerlinsley/react-table#readme",
|
||||
@@ -35,7 +35,7 @@
|
||||
"classnames": "^2.2.5"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": "^15.3.1"
|
||||
"react": "^15.x.x"
|
||||
},
|
||||
"devDependencies": {
|
||||
"babel-cli": "6.14.0",
|
||||
|
||||
@@ -23,6 +23,7 @@ export const ReactTableDefaults = {
|
||||
tbodyClassName: '',
|
||||
trClassName: '',
|
||||
trClassCallback: d => null,
|
||||
onTrClick: () => null,
|
||||
thClassName: '',
|
||||
thGroupClassName: '',
|
||||
tdClassName: '',
|
||||
@@ -54,6 +55,9 @@ export const ReactTableDefaults = {
|
||||
previousText: 'Previous',
|
||||
nextText: 'Next',
|
||||
loadingText: 'Loading...',
|
||||
pageText: 'Page',
|
||||
ofText: 'of',
|
||||
rowsText: 'rows',
|
||||
// Components
|
||||
tableComponent: (props) => <table {...props}>{props.children}</table>,
|
||||
theadComponent: (props) => <thead {...props}>{props.children}</thead>,
|
||||
@@ -355,6 +359,7 @@ export default React.createClass({
|
||||
return (
|
||||
<TrComponent
|
||||
key={i}
|
||||
onClick={event => this.props.onTrClick(rowInfo.row, event)}
|
||||
className={classnames(this.props.trClassName, this.props.trClassCallback(rowInfo))}
|
||||
style={Object.assign({}, this.props.trStyle, this.props.trStyleCallback(rowInfo))}
|
||||
>
|
||||
@@ -428,6 +433,9 @@ export default React.createClass({
|
||||
canNext={canNext}
|
||||
previousText={this.props.previousText}
|
||||
nextText={this.props.nextText}
|
||||
pageText={this.props.pageText}
|
||||
ofText={this.props.ofText}
|
||||
rowsText={this.props.rowsText}
|
||||
previousComponent={PreviousComponent}
|
||||
nextComponent={NextComponent}
|
||||
//
|
||||
|
||||
+3
-3
@@ -63,7 +63,7 @@ export default React.createClass({
|
||||
</div>
|
||||
<div className='-center'>
|
||||
<span className='-pageInfo'>
|
||||
Page {showPageJump ? (
|
||||
{this.props.pageText} {showPageJump ? (
|
||||
<form className='-pageJump'
|
||||
onSubmit={this.applyPage}
|
||||
>
|
||||
@@ -83,7 +83,7 @@ export default React.createClass({
|
||||
</form>
|
||||
) : (
|
||||
<span className='-currentPage'>{currentPage + 1}</span>
|
||||
)} of <span className='-totalPages'>{pagesLength}</span>
|
||||
)} {this.props.ofText} <span className='-totalPages'>{pagesLength}</span>
|
||||
</span>
|
||||
{showPageSizeOptions && (
|
||||
<span className='select-wrap -pageSizeOptions'>
|
||||
@@ -96,7 +96,7 @@ export default React.createClass({
|
||||
<option
|
||||
key={i}
|
||||
value={option}>
|
||||
{option} rows
|
||||
{option} {this.props.rowsText}
|
||||
</option>
|
||||
)
|
||||
})}
|
||||
|
||||
Reference in New Issue
Block a user