Skip to content
This repository was archived by the owner on Mar 10, 2026. It is now read-only.

Commit 056839f

Browse files
author
Justin Slattery
committed
Update to React 15, babel 6
1 parent dde243c commit 056839f

File tree

5 files changed

+4484
-4095
lines changed

5 files changed

+4484
-4095
lines changed

package.json

Lines changed: 39 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
{
22
"name": "tabletable",
3-
"version": "0.3.2",
3+
"version": "0.4.0",
44
"description": "A simple and extremely flexible table component written in React.",
55
"main": "dist/entry.js",
66
"scripts": {
7-
"build": "$(npm bin)/babel --optional es7.decorators src/ -d dist/",
8-
"watch": "$(npm bin)/babel --optional es7.decorators src/ -d dist/ --watch",
9-
"demo-build": "$(npm bin)/browserify --extension=.jsx -e src/demo.jsx -t [ babelify --optional es7.objectRestSpread --optional es7.decorators ] -o test/index.js",
10-
"demo-watch": "$(npm bin)/watchify --extension=.jsx -e src/demo.jsx -t [ babelify --optional es7.objectRestSpread --optional es7.decorators ] -o test/index.js",
7+
"build": "$(npm bin)/babel src/ -d dist/",
8+
"watch": "$(npm bin)/babel src/ -d dist/ --watch",
9+
"demo-build": "$(npm bin)/browserify --extension=.jsx -e src/demo.jsx -o test/index.js",
10+
"demo-watch": "$(npm bin)/watchify --extension=.jsx -e src/demo.jsx -o test/index.js",
1111
"prepublish": "npm run build",
1212
"test": "echo \"Error: no test specified\" && exit 1"
1313
},
@@ -25,16 +25,46 @@
2525
"url": "https://github.com/ZeroarcSoftware/tabletable/issues"
2626
},
2727
"homepage": "https://github.com/ZeroarcSoftware/tabletable#readme",
28+
"browserify": {
29+
"transform": [
30+
[
31+
"babelify",
32+
{
33+
"presets": [
34+
"es2015",
35+
"react"
36+
],
37+
"plugins": [
38+
"transform-decorators-legacy"
39+
]
40+
}
41+
]
42+
]
43+
},
44+
"babel": {
45+
"presets": [
46+
"es2015",
47+
"react"
48+
],
49+
"plugins": [
50+
"transform-decorators-legacy"
51+
]
52+
},
2853
"devDependencies": {
29-
"babel": "^5.8.29",
30-
"react-dom": "^0.14.6",
54+
"babel-cli": "^6.7.5",
55+
"babel-plugin-transform-decorators-legacy": "^1.3.4",
56+
"babel-preset-es2015": "^6.6.0",
57+
"babel-preset-react": "^6.5.0",
58+
"babelify": "^7.2.0",
59+
"browserify": "^13.0.0",
60+
"react-dom": "^15.0.1",
3161
"watchify": "^3.7.0"
3262
},
3363
"dependencies": {
3464
"autobind-decorator": "^1.3.3",
3565
"classnames": "^2.2.3",
3666
"immutable": "^3.7.6",
37-
"react": "^0.14.6",
38-
"react-addons-shallow-compare": "^0.14.6"
67+
"react": "^15.0.1",
68+
"react-addons-shallow-compare": "^15.0.1"
3969
}
4070
}

src/Container.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ let ClassNames = require('classnames');
1313
let Autobind = require('autobind-decorator');
1414

1515
// Local
16-
let Pager = require('./Pager');
16+
import Pager from './Pager';
1717

1818

1919
@Autobind

src/Pager.jsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export default class TabletablePager extends React.Component {
2626
}
2727

2828
for(let i = startIndex; i <= endIndex; i++){
29-
let thisButtonClasses = ClassNames('btn', 'btn-primary', 'btn-sm', {
29+
let thisButtonClasses = ClassNames('btn', 'btn-white', 'btn-sm', {
3030
'label-success': this.props.currentPage === i
3131
});
3232
options.push(<button key={i} className={thisButtonClasses} data-value={i} onClick={this.pageChange}>{i}</button>);
@@ -35,19 +35,19 @@ export default class TabletablePager extends React.Component {
3535
return (
3636
<div className='btn-toolbar text-center' role='toolbar' style={{marginTop: '20px', marginBottom: '20px'}} >
3737
<div className='btn-group pull-left' role='group'>
38-
<button className='btn btn-primary btn-sm' onClick={this.firstPageChange}><i className='fa fa-step-backward'></i> First</button>
38+
<button className='btn btn-white btn-sm' onClick={this.firstPageChange}><i className='fa fa-step-backward'></i> First</button>
3939
</div>
4040
<div className='btn-group pull-right' role='group'>
41-
<button className='btn btn-primary btn-sm' onClick={this.lastPageChange}><i className='fa fa-step-forward'></i> Last</button>
41+
<button className='btn btn-white primary btn-sm' onClick={this.lastPageChange}><i className='fa fa-step-forward'></i> Last</button>
4242
</div>
4343
<div className='btn-group' role='group' style={{float:'none'}}>
44-
<button className='btn btn-primary btn-sm' onClick={this.previousPageChange}><i className='fa fa-chevron-left'></i> Prev</button>
44+
<button className='btn btn-white primary btn-sm' onClick={this.previousPageChange}><i className='fa fa-chevron-left'></i> Prev</button>
4545
</div>
4646
<div className='btn-group' role='group' style={{float:'none'}}>
4747
{options}
4848
</div>
4949
<div className='btn-group' role='group' style={{float:'none'}}>
50-
<button className='btn btn-primary btn-sm' onClick={this.nextPageChange}><i className='fa fa-chevron-right'></i> Next</button>
50+
<button className='btn btn-white primary btn-sm' onClick={this.nextPageChange}><i className='fa fa-chevron-right'></i> Next</button>
5151
</div>
5252
</div>
5353
)

src/demo.jsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ let Immutable = require('immutable');
1313
let Autobind = require('autobind-decorator');
1414

1515
// Local
16-
let Tabletable = require('./Container');
17-
let fakeData = require('../test/fake_data.json');
16+
import Tabletable from './Container';
17+
import fakeData from '../test/fake_data.json';
1818

1919

2020
@Autobind
@@ -59,6 +59,7 @@ class Demo extends React.Component {
5959
data={immutableData}
6060
columns={columnDefs}
6161
pagerSize={5}
62+
rowsPerPage={10}
6263
/>
6364
);
6465
}

0 commit comments

Comments
 (0)