fixed-data-table-2
Advanced tools
Comparing version 0.6.5 to 0.6.6
@@ -23,2 +23,3 @@ /** | ||
var ReactWheelHandler = require('./ReactWheelHandler'); | ||
var ReactTouchHandler = require('./ReactTouchHandler'); | ||
var Scrollbar = require('./Scrollbar.react'); | ||
@@ -146,2 +147,8 @@ var FixedDataTableBufferedRows = require('./FixedDataTableBufferedRows.react'); | ||
/** | ||
* Boolean flag indicating of touch scrolling should be enabled | ||
* This feature is current in beta and may have bugs | ||
*/ | ||
touchScrollEnabled: PropTypes.bool, | ||
/** | ||
* Hide the scrollbar but still enable scroll functionality | ||
@@ -309,3 +316,4 @@ */ | ||
showScrollbarX: true, | ||
showScrollbarY: true | ||
showScrollbarY: true, | ||
touchScrollEnabled: false | ||
}; | ||
@@ -335,3 +343,7 @@ }, | ||
} | ||
this._wheelHandler = new ReactWheelHandler(this._onWheel, this._shouldHandleWheelX, this._shouldHandleWheelY); | ||
var touchEnabled = this.state.touchScrollEnabled === true; | ||
this._wheelHandler = new ReactWheelHandler(this._onScroll, this._shouldHandleWheelX, this._shouldHandleWheelY); | ||
this._touchHandler = new ReactTouchHandler(this._onScroll, touchEnabled && this._shouldHandleWheelX, touchEnabled && this._shouldHandleWheelY); | ||
}, | ||
@@ -400,6 +412,11 @@ | ||
var newOverflowY = nextProps.overflowY; | ||
var touchEnabled = nextProps.touchScrollEnabled === true; | ||
if (newOverflowX !== this.props.overflowX || newOverflowY !== this.props.overflowY) { | ||
this._wheelHandler = new ReactWheelHandler(this._onWheel, newOverflowX !== 'hidden', // Should handle horizontal scroll | ||
this._wheelHandler = new ReactWheelHandler(this._onScroll, newOverflowX !== 'hidden', // Should handle horizontal scroll | ||
newOverflowY !== 'hidden' // Should handle vertical scroll | ||
); | ||
this._touchHandler = new ReactTouchHandler(this._onScroll, newOverflowX !== 'hidden' && touchEnabled, // Should handle horizontal scroll | ||
newOverflowY !== 'hidden' && touchEnabled // Should handle vertical scroll | ||
); | ||
} | ||
@@ -563,2 +580,6 @@ | ||
onWheel: this._wheelHandler.onWheel, | ||
onTouchStart: this._touchHandler.onTouchStart, | ||
onTouchEnd: this._touchHandler.onTouchEnd, | ||
onTouchMove: this._touchHandler.onTouchMove, | ||
onTouchCancel: this._touchHandler.onTouchCancel, | ||
style: { height: state.height, width: state.width } }, | ||
@@ -946,3 +967,3 @@ React.createElement( | ||
_onWheel: function _onWheel( /*number*/deltaX, /*number*/deltaY) { | ||
_onScroll: function _onScroll( /*number*/deltaX, /*number*/deltaY) { | ||
if (this.isMounted()) { | ||
@@ -949,0 +970,0 @@ if (!this._isScrolling) { |
@@ -26,3 +26,3 @@ /** | ||
FixedDataTableRoot.version = '0.6.5'; | ||
FixedDataTableRoot.version = '0.6.6'; | ||
module.exports = FixedDataTableRoot; |
@@ -9,3 +9,3 @@ /** | ||
* | ||
* This is utility that hanlds onWheel events and calls provided wheel | ||
* This is utility that handles onWheel events and calls provided wheel | ||
* callback with correct frame rate. | ||
@@ -12,0 +12,0 @@ * |
{ | ||
"name": "fixed-data-table-2", | ||
"version": "0.6.5", | ||
"version": "0.6.6", | ||
"description": "A React table component designed to allow presenting thousands of rows of data.", | ||
@@ -5,0 +5,0 @@ "main": "main.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
642847
96
14581