Skip to content

Commit

Permalink
Version 0.8.6
Browse files Browse the repository at this point in the history
  • Loading branch information
wcjordan committed Nov 4, 2017
1 parent 9581f91 commit ff24111
Show file tree
Hide file tree
Showing 10 changed files with 69 additions and 12 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.8.5
* FixedDataTable v0.8.6
*
* Copyright Schrodinger, LLC
* All rights reserved.
Expand Down
2 changes: 1 addition & 1 deletion dist/fixed-data-table-base.min.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* FixedDataTable v0.8.5
* FixedDataTable v0.8.6
*
* Copyright Schrodinger, LLC
* All rights reserved.
Expand Down
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.8.5
* FixedDataTable v0.8.6
*
* Copyright Schrodinger, LLC
* All rights reserved.
Expand Down
2 changes: 1 addition & 1 deletion dist/fixed-data-table-style.min.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* FixedDataTable v0.8.5
* FixedDataTable v0.8.6
*
* Copyright Schrodinger, LLC
* All rights reserved.
Expand Down
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.8.5
* FixedDataTable v0.8.6
*
* Copyright Schrodinger, LLC
* All rights reserved.
Expand Down
61 changes: 59 additions & 2 deletions dist/fixed-data-table.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* FixedDataTable v0.8.5
* FixedDataTable v0.8.6
*
* Copyright Schrodinger, LLC
* All rights reserved.
Expand Down Expand Up @@ -2799,7 +2799,7 @@ var FixedDataTableRoot = {
Table: _FixedDataTable2.default
};

FixedDataTableRoot.version = '0.8.5';
FixedDataTableRoot.version = '0.8.6';
module.exports = FixedDataTableRoot;

/***/ }),
Expand Down Expand Up @@ -2913,6 +2913,7 @@ var BORDER_HEIGHT = 1;
var HEADER = 'header';
var FOOTER = 'footer';
var CELL = 'cell';
var ARROW_SCROLL_SPEED = 25;
var DRAG_SCROLL_SPEED = 15;
var DRAG_SCROLL_BUFFER = 100;

Expand Down Expand Up @@ -3018,6 +3019,12 @@ var FixedDataTable = (0, _createReactClass2.default)({
*/
touchScrollEnabled: _propTypes2.default.bool,

/**
* Boolean flags to control if scrolling with keys is enabled
*/
keyboardScrollEnabled: _propTypes2.default.bool,
keyboardPageEnabled: _propTypes2.default.bool,

/**
* Hide the scrollbar but still enable scroll functionality
*/
Expand Down Expand Up @@ -3281,6 +3288,8 @@ var FixedDataTable = (0, _createReactClass2.default)({
showScrollbarX: true,
showScrollbarY: true,
touchScrollEnabled: false,
keyboardScrollEnabled: false,
keyboardPageEnabled: false,
stopScrollPropagation: false
};
},
Expand Down Expand Up @@ -3335,6 +3344,51 @@ var FixedDataTable = (0, _createReactClass2.default)({

return delta < 0 && this.state.scrollY > 0 || delta >= 0 && this.state.scrollY < this.state.maxScrollY;
},
_onKeyDown: function _onKeyDown(event) {
if (this.props.keyboardPageEnabled) {
switch (event.key) {
case 'PageDown':
this._onScroll(0, this._scrollbarYHeight);
event.preventDefault();
break;

case 'PageUp':
this._onScroll(0, this._scrollbarYHeight * -1);
event.preventDefault();
break;

default:
break;
}
}
if (this.props.keyboardScrollEnabled) {
switch (event.key) {

case 'ArrowDown':
this._onScroll(0, ARROW_SCROLL_SPEED);
event.preventDefault();
break;

case 'ArrowUp':
this._onScroll(0, ARROW_SCROLL_SPEED * -1);
event.preventDefault();
break;

case 'ArrowRight':
this._onScroll(ARROW_SCROLL_SPEED, 0);
event.preventDefault();
break;

case 'ArrowLeft':
this._onScroll(ARROW_SCROLL_SPEED * -1, 0);
event.preventDefault();
break;

default:
break;
}
}
},
_reportContentHeight: function _reportContentHeight() {
var scrollContentHeight = this.state.scrollContentHeight;
var reservedHeight = this.state.reservedHeight;
Expand Down Expand Up @@ -3422,6 +3476,7 @@ var FixedDataTable = (0, _createReactClass2.default)({

scrollbarYHeight = Math.max(0, footOffsetTop - bodyOffsetTop);
}
this._scrollbarYHeight = scrollbarYHeight;

var verticalScrollbar;
if (showScrollbarY) {
Expand Down Expand Up @@ -3523,6 +3578,8 @@ var FixedDataTable = (0, _createReactClass2.default)({
'div',
{
className: (0, _joinClasses2.default)(this.state.className, (0, _cx2.default)('fixedDataTableLayout/main'), (0, _cx2.default)('public/fixedDataTable/main')),
tabIndex: 0,
onKeyDown: this._onKeyDown,
onWheel: this._wheelHandler.onWheel,
onTouchStart: this._touchHandler.onTouchStart,
onTouchEnd: this._touchHandler.onTouchEnd,
Expand Down
2 changes: 1 addition & 1 deletion dist/fixed-data-table.min.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* FixedDataTable v0.8.5
* FixedDataTable v0.8.6
*
* Copyright Schrodinger, LLC
* All rights reserved.
Expand Down
4 changes: 2 additions & 2 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.8.5",
"version": "0.8.6",
"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.8.5';
FixedDataTableRoot.version = '0.8.6';
module.exports = FixedDataTableRoot;

0 comments on commit ff24111

Please sign in to comment.