Compare commits

..
Author SHA1 Message Date
Aaron Schwartz ad803c2d6d Remove unused prop from readme. 2017-05-11 12:03:02 -07:00
Aaron Schwartz 4a9ab56cae Remove unused prop 2017-05-11 12:02:10 -07:00
Aaron Schwartz 080e82abfe Cleanup Changelog and lint errors 2017-05-11 12:00:50 -07:00
Aaron Schwartz e3753d1733 Rename showFilters->filterable, hideFilter->filterable 2017-05-11 11:38:11 -07:00
Aaron Schwartz 8f0fb3536e Standardize global and column level resizable and sortable properties 2017-05-11 09:38:15 -07:00
Aaron Schwartz c5ce633049 Cleanup Readme 2017-05-11 08:50:07 -07:00
Aaron Schwartz ea2968b14c Rename onExpanded->onExpandedChange 2017-05-10 16:56:40 -07:00
Aaron Schwartz 171ff37bcd Rename resizing->resized, defaultResizing->defaultResized, onResize->onResizedChange 2017-05-10 16:52:45 -07:00
Aaron Schwartz 7e0bca8a17 Rename expandedRows->expanded, onExpandRow->onExpanded 2017-05-10 16:37:26 -07:00
Aaron Schwartz e9c27952b5 filtering->filtered, onFilteringChange->onFilteredChange, defaultFiltering->defaultFiltered 2017-05-10 16:28:02 -07:00
Aaron Schwartz e9bdc8e3c6 Rename sorting->sorted, onSortingChange->onSortedChange, defaultSorting->defaultSorted 2017-05-10 16:14:51 -07:00
Aaron Schwartz 6be71dc4a1 Add defaultExpanded prop 2017-05-10 15:52:34 -07:00
Tanner Linsley cfdc688501 Handle edge cases in expandable hover states and event handlers 2017-05-10 15:48:29 -06:00
Tanner Linsley 7c7e688811 Use Correct PivotingOptions source 2017-05-10 15:47:46 -06:00
Tanner Linsley 9cb9b2ba75 6.0.0 2017-05-10 15:24:36 -06:00
Tanner Linsley bdefce7e03 Updated Changelog 2017-05-10 15:23:38 -06:00
Tanner Linsley 31e852f387 Fix SubComponent Story 2017-05-10 15:21:40 -06:00
Tanner Linsley dff84eb368 Finish fixing up stories with better source 2017-05-10 14:42:13 -06:00
Tanner Linsley bdf759c8f8 Better custom sorting 2017-05-10 13:57:34 -06:00
Aaron Schwartz 53c6d17b40 Fix up stories. 2017-05-09 16:45:58 -07:00
Tanner Linsley 0191b3bc55 Trying generalize expanders to work on any column 2017-05-09 13:40:35 -06:00
Tanner Linsley ad7ea2f5d3 Remove console.log 2017-05-09 13:15:14 -06:00
Tanner Linsley c24cc37c7d +Key constants, prop/callback changes, controllable filters and resizing, subRow + pivoting expansion 2017-05-09 13:12:18 -06:00
Tanner Linsley 307d37421e Resizing Fixes, custom sorting, new api names 2017-05-09 01:23:04 -06:00
Tanner Linsley 2d35148c75 Fixed Typo 2017-05-08 17:27:34 -06:00
Tanner Linsley c90914f585 Updated Renderer Keys and Stories (+ story cleanup) 2017-05-08 17:26:18 -06:00
Tanner Linsley d236097201 Better expanding and aggregation control 2017-05-08 16:24:35 -06:00
Tanner Linsley 3babdd1f66 Use separate columns for Pivots and Expanders, more render options 2017-05-08 14:54:32 -06:00
50 changed files with 2256 additions and 7930 deletions
-1
View File
@@ -1,6 +1,5 @@
node_modules/
lib/
docs/build
react-table.js
react-table.css
*.log
+68
View File
@@ -0,0 +1,68 @@
import React from 'react'
import { configure, storiesOf } from '@kadira/storybook'
import './reset.css'
import './fonts.css'
import './layout.css'
import '../stories/utils/prism.css'
import 'github-markdown-css/github-markdown.css'
import '../react-table.css'
//
import Readme from '../README.md'
//
import Simple from '../stories/Simple.js'
import CellRenderers from '../stories/CellRenderers.js'
import DefaultSorting from '../stories/DefaultSorting.js'
import CustomSorting from '../stories/CustomSorting.js'
import CustomWidths from '../stories/CustomWidths.js'
import CustomComponentProps from '../stories/CustomComponentProps.js'
import ServerSide from '../stories/ServerSide.js'
import SubComponents from '../stories/SubComponents.js'
import Pivoting from '../stories/Pivoting.js'
import PivotingSubComponents from '../stories/PivotingSubComponents.js'
import OneHundredKRows from '../stories/OneHundredKRows.js'
import FunctionalRendering from '../stories/FunctionalRendering.js'
import CustomExpanderPosition from '../stories/CustomExpanderPosition.js'
import NoDataText from '../stories/NoDataText.js'
import Footers from '../stories/Footers.js'
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 SubRows from '../stories/SubRows.js'
//
configure(() => {
storiesOf('1. Docs')
.add('Readme', () => {
const ReadmeCmp = React.createClass({
render () {
return <span className='markdown-body' dangerouslySetInnerHTML={{__html: Readme}} />
},
componentDidMount () {
global.Prism.highlightAll()
}
})
return <ReadmeCmp />
})
storiesOf('2. Demos')
.add('Simple Table', Simple)
.add('Cell Renderers & Custom Components', CellRenderers)
.add('Default Sorting', DefaultSorting)
.add('Custom Sorting', CustomSorting)
.add('Custom Column Widths', CustomWidths)
.add('Custom Component Props', CustomComponentProps)
.add('Server-side Data', ServerSide)
.add('Sub Components', SubComponents)
.add('Pivoting & Aggregation', Pivoting)
.add('Pivoting & Aggregation w/ Sub Components', PivotingSubComponents)
.add('100k Rows w/ Pivoting & Sub Components', OneHundredKRows)
.add('Pivoting Options', PivotingOptions)
.add('Functional Rendering', FunctionalRendering)
.add('Custom Expander Position', CustomExpanderPosition)
.add('Custom "No Data" Text', NoDataText)
.add('Footers', Footers)
.add('Custom Filtering', Filtering)
.add('Controlled Component', ControlledTable)
.add('Editable table', EditableTable)
// .add('Sub Rows', SubRows)
}, module)
+11 -10
View File
@@ -46,7 +46,7 @@ Previous versions:
## Demos and examples
- <a href="http://codepen.io/tannerlinsley/pen/QpeZBa?editors=0010" target="\_blank">Codepen</a>
- <a href="http://react-table.js.org/#/story/simple-table" target="\_parent">Storybook</a>
- <a href="http://react-table.js.org/?selectedKind=2.%20Demos&selectedStory=Client-side%20Data&full=0&down=0&left=1&panelRight=0&downPanel=kadirahq%2Fstorybook-addon-actions%2Factions-panel" target="\_parent">Storybook</a>
## Table of Contents
- [Installation](#installation)
@@ -210,7 +210,7 @@ These are all of the available props (and their default values) for the main `<R
// Pivoting
pivotBy: undefined,
// Key Constants
pivotValKey: '_pivotVal',
pivotIDKey: '_pivotID',
@@ -801,7 +801,7 @@ Accessing internal state and wrapping with more UI:
The possibilities are endless!
## Sorting
Sorting comes built in with React-Table. Click column header to sort by its column. Click it again to reverse the sort.
Sorting comes built in with React-Table. Click column header to sort by its column. Click it again to reverse the sort.
## Multi-Sort
When clicking on a column header, hold shift to multi-sort! You can toggle `ascending` `descending` and `none` for multi-sort columns. Clicking on a header without holding shift will clear the multi-sort and replace it with the single sort of that column. It's quite handy!
@@ -846,7 +846,7 @@ If you want to override a particular column's filtering method, you can set the
To completely override the filter that is shown, you can set the `Filter` column option. Using this option you can specify the JSX that is shown. The option is passed an `onChange` method which must be called with the the value that you wan't to pass to the `filterMethod` option whenever the filter has changed.
See <a href="http://react-table.js.org/#/story/custom-filtering" target="\_parent">Custom Filtering</a> demo for examples.
See <a href="http://react-table.js.org/?selectedKind=2.%20Demos&selectedStory=Custom%20Filtering&full=0&down=1&left=1&panelRight=0&downPanel=kadirahq%2Fstorybook-addon-actions%2Factions-panel" target="\_parent">Custom Filtering</a> demo for examples.
## Component Overrides
Though we confidently stand by the markup and architecture behind it, `react-table` does offer the ability to change the core componentry it uses to render everything. You can extend or override these internal components by passing a react component to it's corresponding prop on either the global props or on a one-off basis like so:
@@ -891,18 +891,19 @@ To suggest a feature, create an issue if it does not already exist.
If you would like to help develop a suggested feature follow these steps:
- Fork this repo
- Install dependencies with `$ yarn`
- Auto-build files as you edit with `$ yarn run watch`
- `$ yarn`
- `$ yarn run storybook`
- Implement your changes to files in the `src/` directory
- Run the <a href="https://github.com/tannerlinsley/react-story">React Story</a> locally with `$ yarn run docs`
- View changes as you edit `docs/src`,
- View changes as you code via our <a href="https://github.com/storybooks/react-storybook" target="\_parent">React Storybook</a> `localhost:8000`
- Make changes to stories in `/stories`, or create a new one if needed
- Submit PR for review
#### Scripts
- `$ yarn run watch` Watches files and builds via babel
- `$ yarn run docs` Runs the storybook server
- `$ yarn run storybook` Runs the storybook server
- `$ yarn run test` Runs the test suite
- `$ yarn run prepublish` Builds the distributable bundle
- `$ yarn run docs` Builds the website/docs from the storybook for github pages
## Used By
+1
View File
@@ -0,0 +1 @@
react-table.js.org
-1623
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 KiB

+22
View File
@@ -0,0 +1,22 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<script>
if (window.parent !== window) {
window.__REACT_DEVTOOLS_GLOBAL_HOOK__ = window.parent.__REACT_DEVTOOLS_GLOBAL_HOOK__;
}
</script>
<title>React Storybook</title>
</head>
<body>
<div id="root"></div>
<div id="error-display"></div>
<script src="static/preview.b5270b38a18bc77dc351.bundle.js"></script>
</body>
</html>
+44
View File
@@ -0,0 +1,44 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="storybook-version" content="2.35.3">
<title>React Storybook</title>
<style>
/*
When resizing panels, the drag event breaks if the cursor
moves over the iframe. Add the 'dragging' class to the body
at drag start and remove it when the drag ends.
*/
.dragging iframe {
pointer-events: none;
}
/* Styling the fuzzy search box placeholders */
.searchBox::-webkit-input-placeholder { /* Chrome/Opera/Safari */
color: #ddd;
font-size: 16px;
}
.searchBox::-moz-placeholder { /* Firefox 19+ */
color: #ddd;
font-size: 16px;
}
.searchBox:focus{
border-color: #EEE !important;
}
.btn:hover{
background-color: #eee
}
</style>
</head>
<body style="margin: 0;">
<div id="root"></div>
<script src="static/manager.9a120eb2943ac2bf0331.bundle.js"></script>
</body>
</html>
-23
View File
@@ -1,23 +0,0 @@
{
"name": "new",
"version": "0.1.0",
"private": true,
"devDependencies": {
"react-scripts": "0.9.5",
"standard": "^10.0.2"
},
"dependencies": {
"github-markdown-css": "^2.6.0",
"marked": "^0.3.6",
"raw-loader": "^0.5.1",
"react": "^15.5.4",
"react-dom": "^15.5.4",
"react-story": "^0.0.6"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject"
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

-31
View File
@@ -1,31 +0,0 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico">
<!--
Notice the use of %PUBLIC_URL% in the tag above.
It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML.
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>React Table - A lightweight, fast and extendable datagrid built for React</title>
</head>
<body>
<div id="root"></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
You can add webfonts, meta tags, or analytics to this file.
The build step will place the bundled scripts into the <body> tag.
To begin the development, run `npm start`.
To create a production bundle, use `npm run build`.
-->
</body>
</html>
-94
View File
@@ -1,94 +0,0 @@
import React from 'react'
//
import ReactStory, { defaultProps } from 'react-story'
import './stories/utils/prism.css'
import '../../react-table.css'
import Readme from './stories/Readme.js'
import Simple from './stories/Simple.js'
import CellRenderers from './stories/CellRenderers.js'
import DefaultSorting from './stories/DefaultSorting.js'
import CustomSorting from './stories/CustomSorting.js'
import CustomWidths from './stories/CustomWidths.js'
import CustomComponentProps from './stories/CustomComponentProps.js'
import ServerSide from './stories/ServerSide.js'
import SubComponents from './stories/SubComponents.js'
import Pivoting from './stories/Pivoting.js'
import PivotingSubComponents from './stories/PivotingSubComponents.js'
import OneHundredKRows from './stories/OneHundredKRows.js'
import FunctionalRendering from './stories/FunctionalRendering.js'
import CustomExpanderPosition from './stories/CustomExpanderPosition.js'
import NoDataText from './stories/NoDataText.js'
import Footers from './stories/Footers.js'
import Filtering from './stories/Filtering.js'
import ControlledTable from './stories/ControlledTable.js'
import PivotingOptions from './stories/PivotingOptions.js'
import EditableTable from './stories/EditableTable.js'
export default class App extends React.Component {
render () {
return (
<ReactStory
style={{
display: 'block',
width: '100%',
height: '100%'
}}
pathPrefix='story/'
StoryWrapper={(props) => (
<defaultProps.StoryWrapper
css={{
padding: 0
}}
>
<a
href='//github.com/tannerlinsley/react-table'
style={{
display: 'block',
textAlign: 'center',
borderBottom: 'solid 3px #cccccc'
}}
>
<img
src='//npmcdn.com/react-table/media/Banner.png'
alt='React Table Logo'
style={{
width: '100px'
}}
/>
</a>
<div
{...props}
style={{
padding: '10px'
}}
/>
</defaultProps.StoryWrapper>
)}
stories={[
{ name: 'Readme', component: Readme },
{ name: 'Simple Table', component: Simple },
{ name: 'Cell Renderers & Custom Components', component: CellRenderers },
{ name: 'Default Sorting', component: DefaultSorting },
{ name: 'Custom Sorting', component: CustomSorting },
{ name: 'Custom Column Widths', component: CustomWidths },
{ name: 'Custom Component Props', component: CustomComponentProps },
{ 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 Options', component: PivotingOptions },
{ name: 'Functional Rendering', component: FunctionalRendering },
{ 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 }
]}
/>
)
}
}
-8
View File
@@ -1,8 +0,0 @@
html, body, #root {
height: 100%
}
body {
margin: 0;
padding: 0;
font-family: sans-serif;
}
-10
View File
@@ -1,10 +0,0 @@
import React from 'react'
import ReactDOM from 'react-dom'
//
import './index.css'
import App from './App.js'
ReactDOM.render(
<App />,
document.getElementById('root')
)
-15
View File
@@ -1,15 +0,0 @@
/* eslint-disable import/no-webpack-loader-syntax */
import React from 'react'
import marked from 'marked'
//
import Readme from '!raw!../../../README.md'
import 'github-markdown-css/github-markdown.css'
export default class Story extends React.Component {
render () {
return <span className='markdown-body' dangerouslySetInnerHTML={{__html: marked(Readme)}} />
}
componentDidMount () {
global.Prism.highlightAll()
}
}
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
{"version":3,"file":"static/manager.9a120eb2943ac2bf0331.bundle.js","sources":["webpack:///static/manager.9a120eb2943ac2bf0331.bundle.js"],"mappings":"AAAA;AAmuDA;AA64DA;AA28DA;AA00DA;AAsvEA;AAuhDA;AAsrDA;AAsiDA;AAg6DA;AA2nDA;AA++CA;AAkvDA;AAsnEA;AA2oDA;AAivCA;AA+nDA;AAkpDA;AA6lEA;AAs4DA;AAquDA;AA+pDA;AAoxDA;AAsrDA;AAizDA;AA88GA;AAj6CA;AAopGA;AAsuFA;AA+zEA;AAtMA;AAizEA","sourceRoot":""}
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
{"version":3,"file":"static/preview.b5270b38a18bc77dc351.bundle.js","sources":["webpack:///static/preview.b5270b38a18bc77dc351.bundle.js"],"mappings":"AAAA;AAmrDA;AA8uCA;AAqoIA;AA2wGA;AA0pPA;AA65CA;AAk2DA;AA88DA;AAg0DA;AAsgEA;AAmlDA;AAgjDA;AA2hDA;AA6+DA;AAslDA;AA4+CA;AAimDA;AA09DA;AAy4DA;AAwxCA;AAknDA;AA+qDA;AA+nEA;AA4yDA;AAwwCA;AA8tDA;AAuqGA;AA65FA;AAg3CA;AA+1CA;AAkqCA;AAqlCA;AAkgDA;AAo2CA;AAsCA;AA+jFA","sourceRoot":""}
-5744
View File
File diff suppressed because it is too large Load Diff
+7 -6
View File
@@ -1,6 +1,6 @@
{
"name": "react-table",
"version": "6.0.2",
"version": "6.0.0",
"description": "A fast, lightweight, opinionated table and datagrid built on React",
"license": "MIT",
"homepage": "https://github.com/tannerlinsley/react-table#readme",
@@ -34,16 +34,18 @@
"build": "npm-run-all build:*",
"prepublish": "npm run build && npm run umd",
"postpublish": "git push --tags",
"docs": "cd docs && yarn && yarn start",
"docs:build": "cd docs && yarn && yarn run build"
"storybook": "start-storybook -p 8000 -c .storybook",
"docs": "build-storybook -o docs && cp .storybook/CNAME docs/CNAME"
},
"dependencies": {
"classnames": "^2.2.5"
"classnames": "^2.2.5",
"raw-loader": "^0.5.1"
},
"peerDependencies": {
"react": "^15.x.x"
},
"devDependencies": {
"@kadira/storybook": "^2.35.1",
"autoprefixer": "^6.7.0",
"babel-cli": "6.14.0",
"babel-eslint": "6.1.2",
@@ -57,12 +59,11 @@
"npm-run-all": "^3.1.1",
"onchange": "^3.0.2",
"postcss-cli": "^2.6.0",
"raw-loader": "^0.5.1",
"react": "^15.4.2",
"react-dom": "^15.4.2",
"react-json-tree": "^0.10.1",
"rimraf": "^2.6.1",
"standard": "^10.0.2",
"standard": "^8.0.0",
"storybook": "^0.0.0",
"stylus": "^0.54.5",
"webpack": "^2.4.1"
+4 -4
View File
@@ -32,11 +32,11 @@ export default {
},
defaultSortMethod: (a, b) => {
// force null and undefined to the bottom
a = (a === null || a === undefined) ? '' : a
b = (b === null || b === undefined) ? '' : b
a = (a === null || a === undefined) ? -Infinity : a
b = (b === null || b === undefined) ? -Infinity : b
// force any string values to lowercase
a = typeof a === 'string' ? a.toLowerCase() : a
b = typeof b === 'string' ? b.toLowerCase() : b
a = a === 'string' ? a.toLowerCase() : a
b = b === 'string' ? b.toLowerCase() : b
// Return either 1 or -1 to indicate a sort priority
if (a > b) {
return 1
+8 -4
View File
@@ -509,11 +509,15 @@ export default class ReactTable extends Methods(Lifecycle(Component)) {
} else {
newExpanded = _.set(newExpanded, cellInfo.nestingPath, {})
}
if (onExpandedChange) {
onExpandedChange(newExpanded, cellInfo.nestingPath, e)
}
// If expanded is being controlled, don't manage internal state
if (this.props.expanded) {
return
}
return this.setStateWithData({
expanded: newExpanded
}, () => {
onExpandedChange && onExpandedChange(newExpanded, cellInfo.nestingPath, e)
})
}
@@ -634,7 +638,7 @@ export default class ReactTable extends Methods(Lifecycle(Component)) {
className={classnames(
'-padRow',
(pageRows.length + i) % 2 ? '-even' : '-odd',
trProps.className
trProps.className,
)}
style={trProps.style || {}}
>
+1
View File
@@ -1,4 +1,5 @@
export default Base => class extends Base {
componentWillMount () {
this.setStateWithData(this.getDataModel(this.getResolvedState()))
}
+32 -8
View File
@@ -403,13 +403,17 @@ export default Base => class extends Base {
// User actions
onPageChange (page) {
const {onPageChange, collapseOnPageChange} = this.props
onPageChange && onPageChange(page)
// If controlled, do not keep track of state
if (typeof this.props.page !== 'undefined') {
this.fireFetchData()
return
}
const newState = {page}
if (collapseOnPageChange) {
newState.expanded = {}
}
this.setStateWithData(newState, () => {
onPageChange && onPageChange(page)
this.fireFetchData()
})
}
@@ -422,11 +426,16 @@ export default Base => class extends Base {
const currentRow = pageSize * page
const newPage = Math.floor(currentRow / newPageSize)
onPageSizeChange && onPageSizeChange(newPageSize, newPage)
if (typeof this.props.page !== 'undefined') {
this.fireFetchData()
return
}
this.setStateWithData({
pageSize: newPageSize,
page: newPage
}, () => {
onPageSizeChange && onPageSizeChange(newPageSize, newPage)
this.fireFetchData()
})
}
@@ -519,12 +528,16 @@ export default Base => class extends Base {
}
}
}
// If controlled, do not keep track of state
onSortedChange && onSortedChange(newSorted, column, additive)
if (typeof this.props.sorted !== 'undefined') {
this.fireFetchData()
return
}
this.setStateWithData({
page: ((!sorted.length && newSorted.length) || !additive) ? 0 : this.state.page,
sorted: newSorted
}, () => {
onSortedChange && onSortedChange(newSorted, column, additive)
this.fireFetchData()
})
}
@@ -547,10 +560,17 @@ export default Base => class extends Base {
})
}
onFilteredChange && onFilteredChange(newFiltering, column, value)
// If filters is being controlled, do not manage state internally
if (this.props.filtered) {
this.fireFetchData()
return
}
this.setStateWithData({
filtered: newFiltering
}, () => {
onFilteredChange && onFilteredChange(newFiltering, column, value)
this.fireFetchData()
})
}
@@ -633,10 +653,14 @@ export default Base => class extends Base {
value: newWidth
})
onResizedChange && onResizedChange(newResized, event)
if (this.props.resized) {
return
}
this.setStateWithData({
resized: newResized
}, () => {
onResizedChange && onResizedChange(newResized, event)
})
}
}
+1 -1
View File
@@ -104,7 +104,7 @@ export default class ReactTablePagination extends Component {
</div>
) : (
<span className='-currentPage'>{page + 1}</span>
)} {this.props.ofText} <span className='-totalPages'>{pages || 1}</span>
)} {this.props.ofText} <span className='-totalPages'>{pages}</span>
</span>
{showPageSizeOptions && (
<span className='select-wrap -pageSizeOptions'>
@@ -1,11 +1,10 @@
/* eslint-disable import/no-webpack-loader-syntax */
import React from 'react'
import _ from 'lodash'
import namor from 'namor'
import ReactTable from '../../../lib/index'
import ReactTable from '../src/index'
class Story extends React.PureComponent {
class Story extends React.Component {
render () {
const data = _.map(_.range(5553), d => {
const statusChance = Math.random()
@@ -99,7 +98,7 @@ class Story extends React.PureComponent {
// Source Code
const CodeHighlight = require('./components/codeHighlight').default
const source = require('!raw!./CellRenderers')
const source = require('!raw-loader!./CellRenderers')
export default () => (
<div>
@@ -1,9 +1,8 @@
/* eslint-disable import/no-webpack-loader-syntax */
import React from 'react'
import _ from 'lodash'
import namor from 'namor'
import ReactTable from '../../../lib/index'
import ReactTable from '../src/index'
const data = _.map(_.range(5553), d => {
return {
@@ -31,7 +30,7 @@ const columns = [{
}]
}]
class Story extends React.PureComponent {
class Story extends React.Component {
constructor () {
super()
this.state = {
@@ -79,7 +78,7 @@ class Story extends React.PureComponent {
// Source Code
const CodeHighlight = require('./components/codeHighlight').default
const source = require('!raw!./ControlledTable')
const source = require('!raw-loader!./ControlledTable')
export default () => (
<div>
@@ -1,11 +1,10 @@
/* eslint-disable import/no-webpack-loader-syntax */
import React from 'react'
import _ from 'lodash'
import namor from 'namor'
import ReactTable from '../../../lib/index'
import ReactTable from '../src/index'
class Story extends React.PureComponent {
class Story extends React.Component {
render () {
const data = _.map(_.range(5553), d => {
return {
@@ -66,7 +65,7 @@ class Story extends React.PureComponent {
// Source Code
const CodeHighlight = require('./components/codeHighlight').default
const source = require('!raw!./CustomComponentProps')
const source = require('!raw-loader!./CustomComponentProps')
export default () => (
<div>
@@ -1,11 +1,10 @@
/* eslint-disable import/no-webpack-loader-syntax */
import React from 'react'
import _ from 'lodash'
import namor from 'namor'
import ReactTable from '../../../lib/index'
import ReactTable from '../src/index'
class Story extends React.PureComponent {
class Story extends React.Component {
render () {
const data = _.map(_.range(5553), d => {
return {
@@ -71,7 +70,7 @@ class Story extends React.PureComponent {
// Source Code
const CodeHighlight = require('./components/codeHighlight').default
const source = require('!raw!./CustomExpanderPosition')
const source = require('!raw-loader!./CustomExpanderPosition')
export default () => (
<div>
@@ -1,11 +1,10 @@
/* eslint-disable import/no-webpack-loader-syntax */
import React from 'react'
import _ from 'lodash'
import namor from 'namor'
import ReactTable from '../../../lib/index'
import ReactTable from '../src/index'
class Story extends React.PureComponent {
class Story extends React.Component {
render () {
const data = _.map(_.range(5553), d => {
return {
@@ -68,7 +67,7 @@ class Story extends React.PureComponent {
// Source Code
const CodeHighlight = require('./components/codeHighlight').default
const source = require('!raw!./CustomSorting')
const source = require('!raw-loader!./CustomSorting')
export default () => (
<div>
@@ -1,11 +1,10 @@
/* eslint-disable import/no-webpack-loader-syntax */
import React from 'react'
import _ from 'lodash'
import namor from 'namor'
import ReactTable from '../../../lib/index'
import ReactTable from '../src/index'
class Story extends React.PureComponent {
class Story extends React.Component {
render () {
const data = _.map(_.range(5553), d => {
return {
@@ -57,7 +56,7 @@ class Story extends React.PureComponent {
// Source Code
const CodeHighlight = require('./components/codeHighlight').default
const source = require('!raw!./CustomWidths')
const source = require('!raw-loader!./CustomWidths')
export default () => (
<div>
@@ -1,11 +1,10 @@
/* eslint-disable import/no-webpack-loader-syntax */
import React from 'react'
import _ from 'lodash'
import namor from 'namor'
import ReactTable from '../../../lib/index'
import ReactTable from '../src/index'
class Story extends React.PureComponent {
class Story extends React.Component {
render () {
const data = _.map(_.range(5553), d => {
return {
@@ -58,7 +57,7 @@ class Story extends React.PureComponent {
// Source Code
const CodeHighlight = require('./components/codeHighlight').default
const source = require('!raw!./DefaultSorting')
const source = require('!raw-loader!./DefaultSorting')
export default () => (
<div>
@@ -1,9 +1,8 @@
/* eslint-disable import/no-webpack-loader-syntax */
import React from 'react'
import ReactTable from '../../../lib/index'
import ReactTable from '../src/index'
class Story extends React.PureComponent {
class Story extends React.Component {
constructor (props, context) {
super(props, context)
this.renderEditable = this.renderEditable.bind(this)
@@ -60,7 +59,7 @@ class Story extends React.PureComponent {
// Source Code
const CodeHighlight = require('./components/codeHighlight').default
const source = require('!raw!./EditableTable')
const source = require('!raw-loader!./EditableTable')
export default () => (
<div>
@@ -1,13 +1,12 @@
/* eslint-disable import/no-webpack-loader-syntax */
import React from 'react'
import _ from 'lodash'
import namor from 'namor'
import CodeHighlight from './components/codeHighlight'
import ReactTable from '../../../lib/index'
import ReactTable from '../src/index'
class Story extends React.PureComponent {
class Story extends React.Component {
constructor (props) {
super(props)
@@ -88,7 +87,7 @@ class Story extends React.PureComponent {
return (
<div>
<div>
<div style={{float: 'left'}}>
<h1>Table Options</h1>
<table>
<tbody>
@@ -112,7 +111,7 @@ class Story extends React.PureComponent {
</tbody>
</table>
</div>
<div className='table-wrap'>
<div className='table-wrap' style={{paddingLeft: 240}}>
<ReactTable
className='-striped -highlight'
data={this.state.data}
@@ -184,7 +183,7 @@ class Story extends React.PureComponent {
}
// Source Code
const source = require('!raw!./Filtering')
const source = require('!raw-loader!./Filtering')
export default () => (
<div>
@@ -1,11 +1,10 @@
/* eslint-disable import/no-webpack-loader-syntax */
import React from 'react'
import _ from 'lodash'
import namor from 'namor'
import ReactTable from '../../../lib/index'
import ReactTable from '../src/index'
class Story extends React.PureComponent {
class Story extends React.Component {
render () {
const data = _.map(_.range(5553), d => {
return {
@@ -82,7 +81,7 @@ class Story extends React.PureComponent {
// Source Code
const CodeHighlight = require('./components/codeHighlight').default
const source = require('!raw!./Footers')
const source = require('!raw-loader!./Footers')
export default () => (
<div>
@@ -1,10 +1,9 @@
/* eslint-disable import/no-webpack-loader-syntax */
import React from 'react'
import _ from 'lodash'
import namor from 'namor'
import JSONTree from 'react-json-tree'
import ReactTable from '../../../lib/index'
import ReactTable from '../src/index'
const JSONtheme = {
scheme: 'monokai',
@@ -27,7 +26,7 @@ const JSONtheme = {
base0F: '#cc6633'
}
class Story extends React.PureComponent {
class Story extends React.Component {
render () {
const data = _.map(_.range(5553), d => {
return {
@@ -127,7 +126,7 @@ class Story extends React.PureComponent {
// Source Code
const CodeHighlight = require('./components/codeHighlight').default
const source = require('!raw!./FunctionalRendering')
const source = require('!raw-loader!./FunctionalRendering')
export default () => (
<div>
@@ -1,9 +1,8 @@
/* eslint-disable import/no-webpack-loader-syntax */
import React from 'react'
import ReactTable from '../../../lib/index'
import ReactTable from '../src/index'
class Story extends React.PureComponent {
class Story extends React.Component {
render () {
const columns = [{
Header: 'Name',
@@ -47,7 +46,7 @@ class Story extends React.PureComponent {
// Source Code
const CodeHighlight = require('./components/codeHighlight').default
const source = require('!raw!./NoDataText')
const source = require('!raw-loader!./NoDataText')
export default () => (
<div>
@@ -1,11 +1,10 @@
/* eslint-disable import/no-webpack-loader-syntax */
import React from 'react'
import _ from 'lodash'
import namor from 'namor'
import ReactTable from '../../../lib/index'
import ReactTable from '../src/index'
class Story extends React.PureComponent {
class Story extends React.Component {
render () {
const data = _.map(_.range(100000), d => {
return {
@@ -87,7 +86,7 @@ class Story extends React.PureComponent {
// Source Code
const CodeHighlight = require('./components/codeHighlight').default
const source = require('!raw!./OneHundredKRows')
const source = require('!raw-loader!./OneHundredKRows')
export default () => (
<div>
@@ -1,11 +1,10 @@
/* eslint-disable import/no-webpack-loader-syntax */
import React from 'react'
import _ from 'lodash'
import namor from 'namor'
import ReactTable from '../../../lib/index'
import ReactTable from '../src/index'
class Story extends React.PureComponent {
class Story extends React.Component {
render () {
const data = _.map(_.range(1000), d => {
return {
@@ -64,7 +63,7 @@ class Story extends React.PureComponent {
// Source Code
const CodeHighlight = require('./components/codeHighlight').default
const source = require('!raw!./Pivoting')
const source = require('!raw-loader!./Pivoting')
export default () => (
<div>
@@ -1,11 +1,10 @@
/* eslint-disable import/no-webpack-loader-syntax */
import React from 'react'
import _ from 'lodash'
import namor from 'namor'
import ReactTable from '../../../lib/index'
import ReactTable from '../src/index'
class Story extends React.PureComponent {
class Story extends React.Component {
render () {
const data = _.map(_.range(1000), d => {
return {
@@ -122,7 +121,7 @@ class Story extends React.PureComponent {
// Source Code
const CodeHighlight = require('./components/codeHighlight').default
const source = require('!raw!./PivotingOptions')
const source = require('!raw-loader!./PivotingOptions')
export default () => (
<div>
@@ -1,11 +1,10 @@
/* eslint-disable import/no-webpack-loader-syntax */
import React from 'react'
import _ from 'lodash'
import namor from 'namor'
import ReactTable from '../../../lib/index'
import ReactTable from '../src/index'
class Story extends React.PureComponent {
class Story extends React.Component {
render () {
const data = _.map(_.range(1000), d => {
return {
@@ -90,7 +89,7 @@ class Story extends React.PureComponent {
// Source Code
const CodeHighlight = require('./components/codeHighlight').default
const source = require('!raw!./PivotingSubComponents')
const source = require('!raw-loader!./PivotingSubComponents')
export default () => (
<div>
@@ -1,9 +1,8 @@
/* eslint-disable import/no-webpack-loader-syntax */
import React from 'react'
import _ from 'lodash'
import namor from 'namor'
import ReactTable from '../../../lib/index'
import ReactTable from '../src/index'
const rawData = _.map(_.range(3424), d => {
return {
@@ -49,7 +48,7 @@ const requestData = (pageSize, page, sorted, filtered) => {
})
}
class Story extends React.PureComponent {
class Story extends React.Component {
constructor () {
super()
this.state = {
@@ -111,7 +110,7 @@ class Story extends React.PureComponent {
// Source Code
const CodeHighlight = require('./components/codeHighlight').default
const source = require('!raw!./ServerSide')
const source = require('!raw-loader!./ServerSide')
export default () => (
<div>
@@ -1,11 +1,10 @@
/* eslint-disable import/no-webpack-loader-syntax */
import React from 'react'
import _ from 'lodash'
import namor from 'namor'
import ReactTable from '../../../lib/index'
import ReactTable from '../src/index'
class Story extends React.PureComponent {
class Story extends React.Component {
render () {
const data = _.map(_.range(5553), d => {
return {
@@ -60,7 +59,7 @@ class Story extends React.PureComponent {
}
const CodeHighlight = require('./components/codeHighlight').default
const source = require('!raw!./Simple')
const source = require('!raw-loader!./Simple')
export default () => (
<div>
@@ -1,11 +1,10 @@
/* eslint-disable import/no-webpack-loader-syntax */
import React from 'react'
import _ from 'lodash'
import namor from 'namor'
import ReactTable from '../../../lib/index'
import ReactTable from '../src/index'
class Story extends React.PureComponent {
class Story extends React.Component {
constructor (props) {
super(props)
@@ -57,7 +56,7 @@ class Story extends React.PureComponent {
return (
<div>
<div>
<div style={{float: 'left'}}>
<h1>Table Options</h1>
<table>
<tbody>
@@ -81,7 +80,7 @@ class Story extends React.PureComponent {
</tbody>
</table>
</div>
<div className='table-wrap'>
<div className='table-wrap' style={{paddingLeft: 240}}>
<ReactTable
className='-striped -highlight'
data={this.state.data}
@@ -136,7 +135,7 @@ class Story extends React.PureComponent {
// Source Code
const CodeHighlight = require('./components/codeHighlight').default
const source = require('!raw!./SubComponents')
const source = require('!raw-loader!./SubComponents')
export default () => (
<div>
@@ -1,11 +1,10 @@
/* eslint-disable import/no-webpack-loader-syntax */
import React from 'react'
import _ from 'lodash'
import namor from 'namor'
import ReactTable from '../../../lib/index'
import ReactTable from '../src/index'
class Story extends React.PureComponent {
class Story extends React.Component {
render () {
const data = _.map(_.range(5553), d => {
const children = _.map(_.range(10), d => {
@@ -68,7 +67,7 @@ class Story extends React.PureComponent {
// Source Code
const CodeHighlight = require('./components/codeHighlight').default
const source = require('!raw!./SubRows')
const source = require('!raw-loader!./SubRows')
export default () => (
<div>
@@ -1,7 +1,7 @@
import React from 'react'
import '../utils/prism'
export default class CodeHighlight extends React.Component {
export default React.createClass({
render () {
const { language, children } = this.props
return (
@@ -11,11 +11,11 @@ export default class CodeHighlight extends React.Component {
</code>
</pre>
)
}
},
componentDidMount () {
window.Prism.highlightAll()
}
},
componentDidUpdate () {
window.Prism.highlightAll()
}
}
})
File diff suppressed because one or more lines are too long
+1915 -259
View File
File diff suppressed because it is too large Load Diff