Compare commits

...
13 Commits
Author SHA1 Message Date
Tanner Linsley 48e6d16d58 2.2.7 2016-10-27 16:39:04 -06:00
Tanner Linsley e4208e3b0f Allow column without accessor or id 2016-10-27 16:38:55 -06:00
Tanner Linsley e6d03673ff 2.2.6 2016-10-27 09:32:22 -06:00
Tanner Linsley c3fc84db01 Fixed Column Accessor bug 2016-10-27 09:32:15 -06:00
Tanner Linsley 3334796223 2.2.5 2016-10-27 09:20:21 -06:00
Tanner Linsley 92b70393fa Added rowValues as a prop & Readme Updates 2016-10-27 09:20:16 -06:00
Tanner Linsley efeabe3536 2.2.4 2016-10-27 08:59:34 -06:00
Tanner Linsley f018bac58f Fixed row value prop 2016-10-27 08:59:30 -06:00
Tanner Linsley a8f360a408 Remove Build Files 2016-10-26 19:39:18 -06:00
Tanner Linsley 82f3913034 2.2.3 2016-10-26 19:37:15 -06:00
Tanner Linsley cb3cc05a59 Fixed row references 2016-10-26 19:37:10 -06:00
Tanner Linsley e8146b5d14 2.2.2 2016-10-26 19:25:51 -06:00
Tanner Linsley eef59a559e Added stuff back to umd files array 2016-10-26 19:25:45 -06:00
8 changed files with 39 additions and 734 deletions
+6 -1
View File
@@ -151,7 +151,12 @@ Every React-Table instance requires a `columns` prop, which is an array of objec
style: {}, // Set the style of the `td` element of the column
innerClassName: '', // Set the classname of the `.-td-inner` element of the column
innerStyle: {}, // Set the style of the `.-td-inner` element of the column
render: JSX eg. ({row, value, index, viewIndex}) => <span>{value}</span>, // Provide a JSX element or stateless function to render whatever you want as the column's cell with access to the entire row
render: JSX eg. ({value, rowValues, row, index, viewIndex}) => <span>{value}</span>, // Provide a JSX element or stateless function to render whatever you want as the column's cell with access to the entire row
// value == the accessed value of the column
// rowValues == an object of all of the accessed values for the row
// row == the original row of data supplied to the table
// index == the original index of the data supplied to the table
// viewIndex == the index of the row in the current page
// Header & HeaderGroup Options
header: 'Header Name' or JSX eg. ({data, column}) => <div>Header Name</div>,
+16 -10
View File
File diff suppressed because one or more lines are too long
+2 -1
View File
@@ -21,7 +21,8 @@ export default Component({
accessor: 'firstName'
}, {
header: 'Last Name',
accessor: 'lastName'
id: 'lastName',
accessor: d => d.lastName
}]
}, {
header: 'Info',
-709
View File
File diff suppressed because one or more lines are too long
+8 -2
View File
@@ -1,6 +1,6 @@
{
"name": "react-table",
"version": "2.2.1",
"version": "2.2.7",
"description": "A fast, lightweight, opinionated table and datagrid built on React",
"license": "MIT",
"homepage": "https://github.com/tannerlinsley/react-table#readme",
@@ -15,6 +15,12 @@
"datagrid"
],
"main": "lib/index.js",
"files": [
"lib/",
"react-table.js",
"react-table.css",
"media/*.png"
],
"scripts": {
"build:node": "babel src --out-dir lib --source-maps inline",
"build:css": "rm -rf react-table.css && stylus src/index.styl --use ./node_modules/nib/lib/nib.js --compress -o react-table.css",
@@ -41,7 +47,7 @@
"nib": "^1.1.2",
"npm-run-all": "^3.1.1",
"onchange": "^3.0.2",
"standard": "8.0.0",
"standard": "^8.0.0",
"stylus": "^0.54.5",
"uglifyify": "3.0.3"
},
-1
View File
File diff suppressed because one or more lines are too long
-7
View File
File diff suppressed because one or more lines are too long
+7 -3
View File
@@ -131,7 +131,10 @@ export default React.createClass({
throw new Error('A column id is required if using a non-string accessor for column above.')
}
dcol.accessor = d => undefined
if (!dcol.accessor) {
dcol.accessor = d => undefined
}
return dcol
}
@@ -372,6 +375,7 @@ export default React.createClass({
{pageRows.map((row, i) => {
const rowInfo = {
row: row.__original,
rowValues: row,
index: row.__index,
viewIndex: i
}
@@ -398,11 +402,11 @@ export default React.createClass({
>
{typeof Cell === 'function' ? (
<Cell
value={row[column.id]}
{...rowInfo}
value={rowInfo.rowValues[column.id]}
/>
) : typeof Cell !== 'undefined' ? Cell
: row[column.id]}
: rowInfo.rowValues[column.id]}
</div>
</TdComponent>
)