Skip to content

Commit

Permalink
Version 0.7.14
Browse files Browse the repository at this point in the history
  • Loading branch information
wcjordan committed Apr 4, 2017
1 parent 1c6b7e1 commit e476ca5
Show file tree
Hide file tree
Showing 10 changed files with 54 additions and 28 deletions.
2 changes: 1 addition & 1 deletion dist/fixed-data-table-base.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* FixedDataTable v0.7.13
* FixedDataTable v0.7.14
*
* Copyright Schrodinger, LLC
* All rights reserved.
Expand Down
2 changes: 1 addition & 1 deletion dist/fixed-data-table-base.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/fixed-data-table-style.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* FixedDataTable v0.7.13
* FixedDataTable v0.7.14
*
* Copyright Schrodinger, LLC
* All rights reserved.
Expand Down
2 changes: 1 addition & 1 deletion dist/fixed-data-table-style.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/fixed-data-table.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* FixedDataTable v0.7.13
* FixedDataTable v0.7.14
*
* Copyright Schrodinger, LLC
* All rights reserved.
Expand Down
58 changes: 42 additions & 16 deletions dist/fixed-data-table.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* FixedDataTable v0.7.13
* FixedDataTable v0.7.14
*
* Copyright Schrodinger, LLC
* All rights reserved.
Expand Down Expand Up @@ -208,7 +208,7 @@ return /******/ (function(modules) { // webpackBootstrap
Table: _FixedDataTable2.default
};

FixedDataTableRoot.version = '0.7.13';
FixedDataTableRoot.version = '0.7.14';
module.exports = FixedDataTableRoot;

/***/ },
Expand Down Expand Up @@ -932,7 +932,8 @@ return /******/ (function(modules) { // webpackBootstrap
},
_onColumnReorderMove: function _onColumnReorderMove(
/*number*/deltaX) {
var reorderingData = this.state.columnReorderingData;
//NOTE Need to clone this object when use pureRendering
var reorderingData = _extends({}, this.state.columnReorderingData);
reorderingData.dragDistance = deltaX;
reorderingData.columnBefore = undefined;
reorderingData.columnAfter = undefined;
Expand Down Expand Up @@ -5084,6 +5085,8 @@ return /******/ (function(modules) { // webpackBootstrap
var onColumnReorder = cellIsReorderable ? this.props.onColumnReorder : null;

var className = columnProps.cellClassName;
var pureRendering = columnProps.pureRendering || false;

return _React2.default.createElement(_FixedDataTableCell2.default, {
isScrolling: this.props.isScrolling,
align: columnProps.align,
Expand All @@ -5103,7 +5106,8 @@ return /******/ (function(modules) { // webpackBootstrap
width: columnProps.width,
left: left,
cell: columnProps.cell,
columnGroupWidth: columnGroupWidth
columnGroupWidth: columnGroupWidth,
pureRendering: pureRendering
});
},
_getColumnsWidth: function _getColumnsWidth( /*array*/columns) /*number*/{
Expand Down Expand Up @@ -5600,7 +5604,13 @@ return /******/ (function(modules) { // webpackBootstrap
* Setting the property to false will keep previous behaviour and keep
* cell rendered if the row it belongs to is visible.
*/
allowCellsRecycling: PropTypes.bool
allowCellsRecycling: PropTypes.bool,

/**
* Flag to enable performance check when rendering. Stops the component from
* rendering if none of it's passed in props have changed
*/
pureRendering: PropTypes.bool
},

getDefaultProps: function getDefaultProps() /*object*/{
Expand Down Expand Up @@ -5725,7 +5735,12 @@ return /******/ (function(modules) { // webpackBootstrap
/**
* The left offset in pixels of the cell.
*/
left: PropTypes.number
left: PropTypes.number,

/**
* Flag for enhanced performance check
*/
pureRendering: PropTypes.bool
},

getInitialState: function getInitialState() {
Expand All @@ -5736,26 +5751,37 @@ return /******/ (function(modules) { // webpackBootstrap
};
},
shouldComponentUpdate: function shouldComponentUpdate(nextProps) {
if (nextProps.isScrolling && this.props.rowIndex === nextProps.rowIndex) {
return false;
}

//Performance check not enabled
if (!nextProps.pureRendering) {
return true;
}

var _props = this.props,
cell = _props.cell,
props = _objectWithoutProperties(_props, ['cell']);
oldCell = _props.cell,
oldIsScrolling = _props.isScrolling,
oldProps = _objectWithoutProperties(_props, ['cell', 'isScrolling']);

var nextCell = nextProps.nextCell,
newProps = _objectWithoutProperties(nextProps, ['nextCell']);
var newCell = nextProps.cell,
newIsScrolling = nextProps.isScrolling,
newProps = _objectWithoutProperties(nextProps, ['cell', 'isScrolling']);

if (this.props.rowIndex !== nextProps.rowIndex) {
if (!(0, _shallowEqual2.default)(oldProps, newProps)) {
return true;
}

if (nextProps.isScrolling) {
return false;
if (!oldCell || !newCell || oldCell.type !== newCell.type) {
return true;
}

if ((0, _shallowEqual2.default)(this.props.cell.props, nextProps.cell.props)) {
return false;
if (!(0, _shallowEqual2.default)(oldCell.props, newCell.props)) {
return true;
}

return true;
return false;
},
componentWillReceiveProps: function componentWillReceiveProps(props) {
var left = props.left + this.state.displacement;
Expand Down
2 changes: 1 addition & 1 deletion dist/fixed-data-table.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions dist/fixed-data-table.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fixed-data-table-2",
"version": "0.7.13",
"version": "0.7.14",
"description": "A React table component designed to allow presenting thousands of rows of data.",
"main": "main.js",
"peerDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion src/FixedDataTableRoot.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ var FixedDataTableRoot = {
Table: FixedDataTable,
};

FixedDataTableRoot.version = '0.7.13';
FixedDataTableRoot.version = '0.7.14';
module.exports = FixedDataTableRoot;

0 comments on commit e476ca5

Please sign in to comment.