Skip to content

Commit aa4995b

Browse files
author
huaying
committed
update reactable
1 parent a81a879 commit aa4995b

File tree

9 files changed

+34
-9
lines changed

9 files changed

+34
-9
lines changed

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "reactable",
3-
"version": "0.14.0",
3+
"version": "0.14.1",
44
"main": "build/reactable.js",
55
"dependencies": {
66
"react": "0.14"

build/reactable.js

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ window.ReactDOM["default"] = window.ReactDOM;
1717

1818
exports.filterPropsFrom = filterPropsFrom;
1919
var internalProps = {
20+
hideTableHeader: true,
2021
column: true,
2122
columns: true,
2223
sortable: true,
@@ -37,6 +38,9 @@ window.ReactDOM["default"] = window.ReactDOM;
3738
hideFilterInput: true,
3839
noDataText: true,
3940
currentPage: true,
41+
onPageChange: true,
42+
previousPageLabel: true,
43+
nextPageLabel: true,
4044
pageButtonLimit: true,
4145
childNode: true,
4246
data: true,
@@ -509,6 +513,8 @@ window.ReactDOM["default"] = window.ReactDOM;
509513

510514
var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } };
511515

516+
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
517+
512518
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
513519

514520
function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
@@ -532,10 +538,14 @@ window.ReactDOM["default"] = window.ReactDOM;
532538
console.log(children);
533539
}
534540

535-
children = children.concat(this.props.columns.map((function (column, i) {
541+
children = children.concat(this.props.columns.map((function (_ref, i) {
542+
var _ref$props = _ref.props;
543+
var props = _ref$props === undefined ? {} : _ref$props;
544+
545+
var column = _objectWithoutProperties(_ref, ['props']);
546+
536547
if (this.props.data.hasOwnProperty(column.key)) {
537548
var value = this.props.data[column.key];
538-
var props = {};
539549

540550
if (typeof value !== 'undefined' && value !== null && value.__reactableMeta === true) {
541551
props = value.props;
@@ -748,6 +758,7 @@ window.ReactDOM["default"] = window.ReactDOM;
748758
var columns = [];
749759
_react['default'].Children.forEach(component.props.children, function (th) {
750760
var column = {};
761+
if (!th) return;
751762
if (typeof th.props !== 'undefined') {
752763
column.props = (0, _libFilter_props_from.filterPropsFrom)(th.props);
753764

lib/reactable/lib/filter_props_from.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
55
});
66
exports.filterPropsFrom = filterPropsFrom;
77
var internalProps = {
8+
hideTableHeader: true,
89
column: true,
910
columns: true,
1011
sortable: true,
@@ -25,6 +26,9 @@ var internalProps = {
2526
hideFilterInput: true,
2627
noDataText: true,
2728
currentPage: true,
29+
onPageChange: true,
30+
previousPageLabel: true,
31+
nextPageLabel: true,
2832
pageButtonLimit: true,
2933
childNode: true,
3034
data: true,

lib/reactable/thead.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ var Thead = (function (_React$Component) {
120120
var columns = [];
121121
_react2['default'].Children.forEach(component.props.children, function (th) {
122122
var column = {};
123+
if (!th) return;
123124
if (typeof th.props !== 'undefined') {
124125
column.props = (0, _libFilter_props_from.filterPropsFrom)(th.props);
125126

lib/reactable/tr.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_ag
1212

1313
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
1414

15+
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
16+
1517
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
1618

1719
function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
@@ -45,10 +47,14 @@ var Tr = (function (_React$Component) {
4547
console.log(children);
4648
}
4749

48-
children = children.concat(this.props.columns.map((function (column, i) {
50+
children = children.concat(this.props.columns.map((function (_ref, i) {
51+
var _ref$props = _ref.props;
52+
var props = _ref$props === undefined ? {} : _ref$props;
53+
54+
var column = _objectWithoutProperties(_ref, ['props']);
55+
4956
if (this.props.data.hasOwnProperty(column.key)) {
5057
var value = this.props.data[column.key];
51-
var props = {};
5258

5359
if (typeof value !== 'undefined' && value !== null && value.__reactableMeta === true) {
5460
props = value.props;

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "reactable",
3-
"version": "0.14.0",
3+
"version": "0.14.1",
44
"description": "Fast, flexible, simple data tables in React",
55
"main": "./lib/reactable.js",
66
"repository": {

src/reactable/lib/filter_props_from.jsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
const internalProps = {
2+
hideTableHeader: true,
23
column: true,
34
columns: true,
45
sortable: true,
@@ -19,6 +20,9 @@ const internalProps = {
1920
hideFilterInput: true,
2021
noDataText: true,
2122
currentPage: true,
23+
onPageChange: true,
24+
previousPageLabel: true,
25+
nextPageLabel: true,
2226
pageButtonLimit: true,
2327
childNode: true,
2428
data: true,
@@ -36,4 +40,3 @@ export function filterPropsFrom(baseProps) {
3640

3741
return props;
3842
}
39-

src/reactable/thead.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ export class Thead extends React.Component {
99
let columns = [];
1010
React.Children.forEach(component.props.children, th => {
1111
var column = {};
12+
if (!th) return;
1213
if (typeof th.props !== 'undefined') {
1314
column.props = filterPropsFrom(th.props);
1415

src/reactable/tr.jsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,9 @@ export class Tr extends React.Component {
1414
) {
1515
if (typeof(children.concat) === 'undefined') { console.log(children); }
1616

17-
children = children.concat(this.props.columns.map(function(column, i) {
17+
children = children.concat(this.props.columns.map(function({ props = {}, ...column}, i) {
1818
if (this.props.data.hasOwnProperty(column.key)) {
1919
var value = this.props.data[column.key];
20-
var props = {};
2120

2221
if (
2322
typeof(value) !== 'undefined' &&

0 commit comments

Comments
 (0)