Compare commits

..
6 Commits
Author SHA1 Message Date
Tanner Linsley e70b29066b 6.0.3 2017-05-16 11:50:41 -06:00
Tanner Linsley 9d82cee707 Better vertical responsiveness & Fixed Header example 2017-05-16 11:50:34 -06:00
Tanner Linsley db1edf119d 6.0.2 2017-05-16 11:16:34 -06:00
theCmakerandTanner Linsley c5fa476b6d Fixed issue #210 - Ignore filters on hidden columns. (#265)
* Fixed issue #210 - Ignore filters on hidden columns.

* Fixed issue #210 - Ignore filters on hidden columns
2017-05-16 09:17:36 -06:00
atkawa7andTanner Linsley 550a1f7107 Fix default sorting documentation (#270) 2017-05-16 09:09:09 -06:00
Mark HatchandTanner Linsley 42e1a12ea9 Height on pagination button removed (#275) 2017-05-15 22:36:42 -06:00
6 changed files with 119 additions and 21 deletions
+2 -2
View File
@@ -821,8 +821,8 @@ defaultSortMethod = (a, b) => {
a = (a === null || a === undefined) ? -Infinity : a
b = (b === null || b === undefined) ? -Infinity : b
// force any string values to lowercase
a = a === 'string' ? a.toLowerCase() : a
b = b === 'string' ? b.toLowerCase() : b
a = typeof a === 'string' ? a.toLowerCase() : a
b = typeof b === 'string' ? b.toLowerCase() : b
// Return either 1 or -1 to indicate a sort priority
if (a > b) {
return 1
+25 -11
View File
@@ -25,9 +25,10 @@ import Filtering from './stories/Filtering.js'
import ControlledTable from './stories/ControlledTable.js'
import PivotingOptions from './stories/PivotingOptions.js'
import EditableTable from './stories/EditableTable.js'
import FixedHeader from './stories/FixedHeader.js'
export default class App extends React.Component {
render () {
render() {
return (
<ReactStory
style={{
@@ -35,15 +36,15 @@ export default class App extends React.Component {
width: '100%',
height: '100%'
}}
pathPrefix='story/'
StoryWrapper={(props) => (
pathPrefix="story/"
StoryWrapper={props => (
<defaultProps.StoryWrapper
css={{
padding: 0
}}
>
<a
href='//github.com/tannerlinsley/react-table'
href="//github.com/tannerlinsley/react-table"
style={{
display: 'block',
textAlign: 'center',
@@ -51,8 +52,8 @@ export default class App extends React.Component {
}}
>
<img
src='//npmcdn.com/react-table/media/Banner.png'
alt='React Table Logo'
src="//npmcdn.com/react-table/media/Banner.png"
alt="React Table Logo"
style={{
width: '100px'
}}
@@ -69,7 +70,10 @@ export default class App extends React.Component {
stories={[
{ name: 'Readme', component: Readme },
{ name: 'Simple Table', component: Simple },
{ name: 'Cell Renderers & Custom Components', component: CellRenderers },
{
name: 'Cell Renderers & Custom Components',
component: CellRenderers
},
{ name: 'Default Sorting', component: DefaultSorting },
{ name: 'Custom Sorting', component: CustomSorting },
{ name: 'Custom Column Widths', component: CustomWidths },
@@ -77,16 +81,26 @@ export default class App extends React.Component {
{ name: 'Server-side Data', component: ServerSide },
{ name: 'Sub Components', component: SubComponents },
{ name: 'Pivoting & Aggregation', component: Pivoting },
{ name: 'Pivoting & Aggregation w/ Sub Components', component: PivotingSubComponents },
{ name: '100k Rows w/ Pivoting & Sub Components', component: OneHundredKRows },
{
name: 'Pivoting & Aggregation w/ Sub Components',
component: PivotingSubComponents
},
{
name: '100k Rows w/ Pivoting & Sub Components',
component: OneHundredKRows
},
{ name: 'Pivoting Options', component: PivotingOptions },
{ name: 'Functional Rendering', component: FunctionalRendering },
{ name: 'Custom Expander Position', component: CustomExpanderPosition },
{
name: 'Custom Expander Position',
component: CustomExpanderPosition
},
{ name: 'Custom "No Data" Text', component: NoDataText },
{ name: 'Footers', component: Footers },
{ name: 'Custom Filtering', component: Filtering },
{ name: 'Controlled Component', component: ControlledTable },
{ name: 'Editable Table', component: EditableTable }
{ name: 'Editable Table', component: EditableTable },
{ name: 'Fixed Header w/ Vertical Scroll', component: FixedHeader }
]}
/>
)
+81
View File
@@ -0,0 +1,81 @@
/* eslint-disable import/no-webpack-loader-syntax */
import React from 'react'
import _ from 'lodash'
import namor from 'namor'
import ReactTable from '../../../lib/index'
class Story extends React.PureComponent {
render() {
const data = _.map(_.range(5553), d => {
return {
firstName: namor.generate({ words: 1, numLen: 0 }),
lastName: namor.generate({ words: 1, numLen: 0 }),
age: Math.floor(Math.random() * 30),
children: _.map(_.range(10), d => {
return {
firstName: namor.generate({ words: 1, numLen: 0 }),
lastName: namor.generate({ words: 1, numLen: 0 }),
age: Math.floor(Math.random() * 30)
}
})
}
})
const columns = [
{
Header: 'Name',
columns: [
{
Header: 'First Name',
accessor: 'firstName'
},
{
Header: 'Last Name',
id: 'lastName',
accessor: d => d.lastName
}
]
},
{
Header: 'Info',
columns: [
{
Header: 'Age',
accessor: 'age'
}
]
}
]
return (
<div>
<div className="table-wrap">
<ReactTable
className="-striped -highlight"
data={data}
columns={columns}
defaultPageSize={20}
style={{
height: '400px' // This will force the table body to overflow and scroll, since there is not enough room
}}
/>
</div>
<div style={{ textAlign: 'center' }}>
<br />
<em>Tip: Hold shift when sorting to multi-sort!</em>
</div>
</div>
)
}
}
const CodeHighlight = require('./components/codeHighlight').default
const source = require('!raw!./Simple')
export default () => (
<div>
<Story />
<CodeHighlight>{() => source}</CodeHighlight>
</div>
)
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "react-table",
"version": "6.0.2",
"version": "6.0.3",
"description": "A fast, lightweight, opinionated table and datagrid built on React",
"license": "MIT",
"homepage": "https://github.com/tannerlinsley/react-table#readme",
+9 -1
View File
@@ -4,10 +4,13 @@ $expandSize = 7px
.ReactTable
position:relative
display: flex
flex-direction: column
border: 1px solid alpha(black, .1)
*
box-sizing: border-box
.rt-table
flex: 1
display: flex
flex-direction: column
align-items: stretch
@@ -16,6 +19,7 @@ $expandSize = 7px
overflow: auto
.rt-thead
flex: 1 0 auto
display: flex
flex-direction: column
-webkit-user-select: none;
@@ -91,8 +95,10 @@ $expandSize = 7px
margin-top: -10px
.rt-tbody
flex: 99999 1 auto
display: flex
flex-direction: column
overflow: auto
// z-index:0
.rt-tr-group
border-bottom: solid 1px alpha(black, .05)
@@ -105,10 +111,12 @@ $expandSize = 7px
.rt-expandable
cursor: pointer
.rt-tr-group
flex: 1 0 auto
display: flex
flex-direction: column
align-items: stretch
.rt-tr
flex: 1 0 auto
display: inline-flex
.rt-th
.rt-td
@@ -191,7 +199,7 @@ $expandSize = 7px
appearance:none
display:block
width:100%
height: 100%
height:100%
border: 0
border-radius: 3px
padding: 6px
+1 -6
View File
@@ -323,12 +323,7 @@ export default Base => class extends Base {
(row) => {
let column
column = allVisibleColumns.find(x => x.id === nextFilter.id || (x.pivotColumns && x.pivotColumns.some(y => y.id === nextFilter.id)))
// Could possibly be in pivotColumns
if (column.id !== nextFilter.id && column.pivotColumns) {
column = column.pivotColumns.find(x => x.id === nextFilter.id)
}
column = allVisibleColumns.find(x => x.id === nextFilter.id)
// Don't filter hidden columns or columns that have had their filters disabled
if (!column || column.filterable === false) {