react-virtualized
Advanced tools
Comparing version 9.14.1 to 9.15.0
Changelog | ||
------------ | ||
##### 9.15.0 | ||
* 🎉 Detect `WindowScroller` container (not only window) resize similar to `AutoSizer` ([TrySound](https://github.com/TrySound) - [#918](https://github.com/bvaughn/react-virtualized/pull/918)) | ||
* 🐛 Prevent position breaking on `WindowScroller` container resize ([TrySound](https://github.com/TrySound) - [#920](https://github.com/bvaughn/react-virtualized/pull/920)) | ||
* 🎉 Published `AutoSizer` Flow types ([TrySound](https://github.com/TrySound) - [#934](https://github.com/bvaughn/react-virtualized/pull/934)) | ||
* 🎉 Published `WindowScroller` Flow types ([TrySound](https://github.com/TrySound) - [#915](https://github.com/bvaughn/react-virtualized/pull/915)) | ||
##### 9.14.1 | ||
@@ -5,0 +12,0 @@ * 🐛 Fixed server-side rendering bug in `WindowScroller` with undefined `window` variable. |
@@ -7,16 +7,30 @@ 'use strict'; | ||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); | ||
var _getPrototypeOf = require('babel-runtime/core-js/object/get-prototype-of'); | ||
var _react = require('react'); | ||
var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); | ||
var _react2 = _interopRequireDefault(_react); | ||
var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck'); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
var _createClass2 = require('babel-runtime/helpers/createClass'); | ||
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } | ||
var _createClass3 = _interopRequireDefault(_createClass2); | ||
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; } | ||
var _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn'); | ||
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); | ||
var _inherits2 = require('babel-runtime/helpers/inherits'); | ||
var _inherits3 = _interopRequireDefault(_inherits2); | ||
var _react = require('react'); | ||
var React = _interopRequireWildcard(_react); | ||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
var babelPluginFlowReactPropTypes_proptype_RenderedSection = require('../Grid').babelPluginFlowReactPropTypes_proptype_RenderedSection || require('prop-types').any; | ||
@@ -31,8 +45,8 @@ | ||
var ArrowKeyStepper = function (_React$PureComponent) { | ||
_inherits(ArrowKeyStepper, _React$PureComponent); | ||
(0, _inherits3.default)(ArrowKeyStepper, _React$PureComponent); | ||
function ArrowKeyStepper(props) { | ||
_classCallCheck(this, ArrowKeyStepper); | ||
(0, _classCallCheck3.default)(this, ArrowKeyStepper); | ||
var _this = _possibleConstructorReturn(this, (ArrowKeyStepper.__proto__ || Object.getPrototypeOf(ArrowKeyStepper)).call(this, props)); | ||
var _this = (0, _possibleConstructorReturn3.default)(this, (ArrowKeyStepper.__proto__ || (0, _getPrototypeOf2.default)(ArrowKeyStepper)).call(this, props)); | ||
@@ -109,3 +123,3 @@ _this._columnStartIndex = 0; | ||
_createClass(ArrowKeyStepper, [{ | ||
(0, _createClass3.default)(ArrowKeyStepper, [{ | ||
key: 'componentWillReceiveProps', | ||
@@ -157,3 +171,3 @@ value: function componentWillReceiveProps(nextProps) { | ||
return _react2.default.createElement( | ||
return React.createElement( | ||
'div', | ||
@@ -192,5 +206,4 @@ { className: className, onKeyDown: this._onKeyDown }, | ||
}]); | ||
return ArrowKeyStepper; | ||
}(_react2.default.PureComponent); | ||
}(React.PureComponent); | ||
@@ -197,0 +210,0 @@ ArrowKeyStepper.defaultProps = { |
"use strict"; | ||
var babelPluginFlowReactPropTypes_proptype_ScrollIndices = { | ||
scrollToColumn: require("prop-types").number.isRequired, | ||
scrollToRow: require("prop-types").number.isRequired | ||
}; | ||
if (typeof exports !== "undefined") Object.defineProperty(exports, "babelPluginFlowReactPropTypes_proptype_ScrollIndices", { | ||
value: { | ||
scrollToColumn: require("prop-types").number.isRequired, | ||
scrollToRow: require("prop-types").number.isRequired | ||
}, | ||
value: babelPluginFlowReactPropTypes_proptype_ScrollIndices, | ||
configurable: true | ||
}); |
@@ -7,7 +7,25 @@ 'use strict'; | ||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); | ||
var _getPrototypeOf = require('babel-runtime/core-js/object/get-prototype-of'); | ||
var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); | ||
var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck'); | ||
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); | ||
var _createClass2 = require('babel-runtime/helpers/createClass'); | ||
var _createClass3 = _interopRequireDefault(_createClass2); | ||
var _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn'); | ||
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); | ||
var _inherits2 = require('babel-runtime/helpers/inherits'); | ||
var _inherits3 = _interopRequireDefault(_inherits2); | ||
var _react = require('react'); | ||
var _react2 = _interopRequireDefault(_react); | ||
var React = _interopRequireWildcard(_react); | ||
@@ -18,14 +36,8 @@ var _detectElementResize = require('../vendor/detectElementResize'); | ||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } | ||
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; } | ||
var babelPluginFlowReactPropTypes_proptype_Size = require('./types').babelPluginFlowReactPropTypes_proptype_Size || require('prop-types').any; | ||
var AutoSizer = function (_React$PureComponent) { | ||
_inherits(AutoSizer, _React$PureComponent); | ||
(0, _inherits3.default)(AutoSizer, _React$PureComponent); | ||
@@ -37,3 +49,3 @@ function AutoSizer() { | ||
_classCallCheck(this, AutoSizer); | ||
(0, _classCallCheck3.default)(this, AutoSizer); | ||
@@ -44,3 +56,3 @@ for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { | ||
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = AutoSizer.__proto__ || Object.getPrototypeOf(AutoSizer)).call.apply(_ref, [this].concat(args))), _this), _this.state = { | ||
return _ret = (_temp = (_this = (0, _possibleConstructorReturn3.default)(this, (_ref = AutoSizer.__proto__ || (0, _getPrototypeOf2.default)(AutoSizer)).call.apply(_ref, [this].concat(args))), _this), _this.state = { | ||
height: _this.props.defaultHeight || 0, | ||
@@ -60,4 +72,4 @@ width: _this.props.defaultWidth || 0 | ||
var height = _this._parentNode.offsetHeight || 0; | ||
var width = _this._parentNode.offsetWidth || 0; | ||
var _height = _this._parentNode.offsetHeight || 0; | ||
var _width = _this._parentNode.offsetWidth || 0; | ||
@@ -70,12 +82,12 @@ var style = window.getComputedStyle(_this._parentNode) || {}; | ||
var newHeight = height - paddingTop - paddingBottom; | ||
var newWidth = width - paddingLeft - paddingRight; | ||
var newHeight = _height - paddingTop - paddingBottom; | ||
var newWidth = _width - paddingLeft - paddingRight; | ||
if (!disableHeight && _this.state.height !== newHeight || !disableWidth && _this.state.width !== newWidth) { | ||
_this.setState({ | ||
height: height - paddingTop - paddingBottom, | ||
width: width - paddingLeft - paddingRight | ||
height: _height - paddingTop - paddingBottom, | ||
width: _width - paddingLeft - paddingRight | ||
}); | ||
onResize({ height: height, width: width }); | ||
onResize({ height: _height, width: _width }); | ||
} | ||
@@ -85,6 +97,6 @@ } | ||
_this._autoSizer = autoSizer; | ||
}, _temp), _possibleConstructorReturn(_this, _ret); | ||
}, _temp), (0, _possibleConstructorReturn3.default)(_this, _ret); | ||
} | ||
_createClass(AutoSizer, [{ | ||
(0, _createClass3.default)(AutoSizer, [{ | ||
key: 'componentDidMount', | ||
@@ -156,3 +168,3 @@ value: function componentDidMount() { | ||
return _react2.default.createElement( | ||
return React.createElement( | ||
'div', | ||
@@ -164,5 +176,4 @@ { ref: this._setRef, style: outerStyle }, | ||
}]); | ||
return AutoSizer; | ||
}(_react2.default.PureComponent); | ||
}(React.PureComponent); | ||
@@ -175,10 +186,29 @@ AutoSizer.defaultProps = { | ||
AutoSizer.propTypes = { | ||
/** Function responsible for rendering children.*/ | ||
children: require('prop-types').func.isRequired, | ||
/** Default height to use for initial render; useful for SSR */ | ||
defaultHeight: require('prop-types').number, | ||
/** Default width to use for initial render; useful for SSR */ | ||
defaultWidth: require('prop-types').number, | ||
/** Disable dynamic :height property */ | ||
disableHeight: require('prop-types').bool.isRequired, | ||
/** Disable dynamic :width property */ | ||
disableWidth: require('prop-types').bool.isRequired, | ||
/** Nonce of the inlined stylesheet for Content Security Policy */ | ||
nonce: require('prop-types').string, | ||
/** Callback to be invoked on-resize */ | ||
onResize: require('prop-types').func.isRequired | ||
}; | ||
exports.default = AutoSizer; |
@@ -7,7 +7,25 @@ 'use strict'; | ||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); | ||
var _getPrototypeOf = require('babel-runtime/core-js/object/get-prototype-of'); | ||
var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); | ||
var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck'); | ||
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); | ||
var _createClass2 = require('babel-runtime/helpers/createClass'); | ||
var _createClass3 = _interopRequireDefault(_createClass2); | ||
var _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn'); | ||
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); | ||
var _inherits2 = require('babel-runtime/helpers/inherits'); | ||
var _inherits3 = _interopRequireDefault(_inherits2); | ||
var _react = require('react'); | ||
var _react2 = _interopRequireDefault(_react); | ||
var React = _interopRequireWildcard(_react); | ||
@@ -20,10 +38,6 @@ var _reactDom = require('react-dom'); | ||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } | ||
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; } | ||
/** | ||
@@ -35,3 +49,3 @@ * Wraps a cell and measures its rendered content. | ||
var CellMeasurer = function (_React$PureComponent) { | ||
_inherits(CellMeasurer, _React$PureComponent); | ||
(0, _inherits3.default)(CellMeasurer, _React$PureComponent); | ||
@@ -43,3 +57,3 @@ function CellMeasurer() { | ||
_classCallCheck(this, CellMeasurer); | ||
(0, _classCallCheck3.default)(this, CellMeasurer); | ||
@@ -50,3 +64,3 @@ for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { | ||
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = CellMeasurer.__proto__ || Object.getPrototypeOf(CellMeasurer)).call.apply(_ref, [this].concat(args))), _this), _this._measure = function () { | ||
return _ret = (_temp = (_this = (0, _possibleConstructorReturn3.default)(this, (_ref = CellMeasurer.__proto__ || (0, _getPrototypeOf2.default)(CellMeasurer)).call.apply(_ref, [this].concat(args))), _this), _this._measure = function () { | ||
var _this$props = _this.props, | ||
@@ -74,6 +88,6 @@ cache = _this$props.cache, | ||
} | ||
}, _temp), _possibleConstructorReturn(_this, _ret); | ||
}, _temp), (0, _possibleConstructorReturn3.default)(_this, _ret); | ||
} | ||
_createClass(CellMeasurer, [{ | ||
(0, _createClass3.default)(CellMeasurer, [{ | ||
key: 'componentDidMount', | ||
@@ -171,5 +185,4 @@ value: function componentDidMount() { | ||
}]); | ||
return CellMeasurer; | ||
}(_react2.default.PureComponent); | ||
}(React.PureComponent); | ||
@@ -182,3 +195,3 @@ // Used for DEV mode warning check | ||
cache: typeof _CellMeasurerCache2.default === 'function' ? require('prop-types').instanceOf(_CellMeasurerCache2.default).isRequired : require('prop-types').any.isRequired, | ||
children: require('prop-types').oneOfType([require('prop-types').func, typeof (_react2.default.Element == null ? {} : _react2.default.Element) === 'function' ? require('prop-types').instanceOf(_react2.default.Element == null ? {} : _react2.default.Element) : require('prop-types').any]).isRequired, | ||
children: require('prop-types').oneOfType([require('prop-types').func, require('prop-types').node]).isRequired, | ||
columnIndex: require('prop-types').number, | ||
@@ -185,0 +198,0 @@ index: require('prop-types').number, |
@@ -6,7 +6,14 @@ 'use strict'; | ||
}); | ||
exports.DEFAULT_WIDTH = exports.DEFAULT_HEIGHT = undefined; | ||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); | ||
var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck'); | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); | ||
var _createClass2 = require('babel-runtime/helpers/createClass'); | ||
var _createClass3 = _interopRequireDefault(_createClass2); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
var DEFAULT_HEIGHT = exports.DEFAULT_HEIGHT = 30; | ||
@@ -26,5 +33,3 @@ var DEFAULT_WIDTH = exports.DEFAULT_WIDTH = 100; | ||
var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
_classCallCheck(this, CellMeasurerCache); | ||
(0, _classCallCheck3.default)(this, CellMeasurerCache); | ||
this._cellHeightCache = {}; | ||
@@ -86,3 +91,3 @@ this._cellWidthCache = {}; | ||
_createClass(CellMeasurerCache, [{ | ||
(0, _createClass3.default)(CellMeasurerCache, [{ | ||
key: 'clear', | ||
@@ -207,3 +212,2 @@ value: function clear(rowIndex) { | ||
}]); | ||
return CellMeasurerCache; | ||
@@ -210,0 +214,0 @@ }(); |
@@ -7,6 +7,30 @@ 'use strict'; | ||
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; | ||
var _extends2 = require('babel-runtime/helpers/extends'); | ||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); | ||
var _extends3 = _interopRequireDefault(_extends2); | ||
var _objectWithoutProperties2 = require('babel-runtime/helpers/objectWithoutProperties'); | ||
var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2); | ||
var _getPrototypeOf = require('babel-runtime/core-js/object/get-prototype-of'); | ||
var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); | ||
var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck'); | ||
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); | ||
var _createClass2 = require('babel-runtime/helpers/createClass'); | ||
var _createClass3 = _interopRequireDefault(_createClass2); | ||
var _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn'); | ||
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); | ||
var _inherits2 = require('babel-runtime/helpers/inherits'); | ||
var _inherits3 = _interopRequireDefault(_inherits2); | ||
var _propTypes = require('prop-types'); | ||
@@ -34,10 +58,2 @@ | ||
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; } | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } | ||
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; } | ||
/** | ||
@@ -52,8 +68,8 @@ * Renders scattered or non-linear data. | ||
var Collection = function (_PureComponent) { | ||
_inherits(Collection, _PureComponent); | ||
(0, _inherits3.default)(Collection, _PureComponent); | ||
function Collection(props, context) { | ||
_classCallCheck(this, Collection); | ||
(0, _classCallCheck3.default)(this, Collection); | ||
var _this = _possibleConstructorReturn(this, (Collection.__proto__ || Object.getPrototypeOf(Collection)).call(this, props, context)); | ||
var _this = (0, _possibleConstructorReturn3.default)(this, (Collection.__proto__ || (0, _getPrototypeOf2.default)(Collection)).call(this, props, context)); | ||
@@ -71,3 +87,3 @@ _this._cellMetadata = []; | ||
_createClass(Collection, [{ | ||
(0, _createClass3.default)(Collection, [{ | ||
key: 'forceUpdate', | ||
@@ -94,5 +110,6 @@ value: function forceUpdate() { | ||
value: function render() { | ||
var props = _objectWithoutProperties(this.props, []); | ||
var props = (0, _objectWithoutProperties3.default)(this.props, []); | ||
return _react2.default.createElement(_CollectionView2.default, _extends({ | ||
return _react2.default.createElement(_CollectionView2.default, (0, _extends3.default)({ | ||
cellLayoutManager: this, | ||
@@ -235,3 +252,2 @@ isScrollingChange: this._isScrollingChange, | ||
}]); | ||
return Collection; | ||
@@ -238,0 +254,0 @@ }(_react.PureComponent); |
@@ -7,6 +7,26 @@ 'use strict'; | ||
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; | ||
var _extends2 = require('babel-runtime/helpers/extends'); | ||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); | ||
var _extends3 = _interopRequireDefault(_extends2); | ||
var _getPrototypeOf = require('babel-runtime/core-js/object/get-prototype-of'); | ||
var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); | ||
var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck'); | ||
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); | ||
var _createClass2 = require('babel-runtime/helpers/createClass'); | ||
var _createClass3 = _interopRequireDefault(_createClass2); | ||
var _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn'); | ||
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); | ||
var _inherits2 = require('babel-runtime/helpers/inherits'); | ||
var _inherits3 = _interopRequireDefault(_inherits2); | ||
var _propTypes = require('prop-types'); | ||
@@ -34,8 +54,2 @@ | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } | ||
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; } | ||
// @TODO Merge Collection and CollectionView | ||
@@ -53,2 +67,3 @@ | ||
*/ | ||
var SCROLL_POSITION_CHANGE_REASONS = { | ||
@@ -65,8 +80,8 @@ OBSERVED: 'observed', | ||
var CollectionView = function (_PureComponent) { | ||
_inherits(CollectionView, _PureComponent); | ||
(0, _inherits3.default)(CollectionView, _PureComponent); | ||
function CollectionView(props, context) { | ||
_classCallCheck(this, CollectionView); | ||
(0, _classCallCheck3.default)(this, CollectionView); | ||
var _this = _possibleConstructorReturn(this, (CollectionView.__proto__ || Object.getPrototypeOf(CollectionView)).call(this, props, context)); | ||
var _this = (0, _possibleConstructorReturn3.default)(this, (CollectionView.__proto__ || (0, _getPrototypeOf2.default)(CollectionView)).call(this, props, context)); | ||
@@ -100,3 +115,3 @@ _this.state = { | ||
_createClass(CollectionView, [{ | ||
(0, _createClass3.default)(CollectionView, [{ | ||
key: 'recomputeCellSizesAndPositions', | ||
@@ -322,3 +337,3 @@ value: function recomputeCellSizesAndPositions() { | ||
role: 'grid', | ||
style: _extends({}, collectionStyle, style), | ||
style: (0, _extends3.default)({}, collectionStyle, style), | ||
tabIndex: 0 }, | ||
@@ -542,3 +557,2 @@ cellCount > 0 && _react2.default.createElement( | ||
}]); | ||
return CollectionView; | ||
@@ -545,0 +559,0 @@ }(_react.PureComponent); |
@@ -7,6 +7,12 @@ 'use strict'; | ||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); | ||
var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck'); | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); | ||
var _createClass2 = require('babel-runtime/helpers/createClass'); | ||
var _createClass3 = _interopRequireDefault(_createClass2); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
/** | ||
@@ -29,5 +35,4 @@ * A section of the Window. | ||
y = _ref.y; | ||
(0, _classCallCheck3.default)(this, Section); | ||
_classCallCheck(this, Section); | ||
this.height = height; | ||
@@ -45,3 +50,3 @@ this.width = width; | ||
_createClass(Section, [{ | ||
(0, _createClass3.default)(Section, [{ | ||
key: 'addCellIndex', | ||
@@ -73,3 +78,2 @@ value: function addCellIndex(_ref2) { | ||
}]); | ||
return Section; | ||
@@ -76,0 +80,0 @@ }(); |
@@ -7,9 +7,14 @@ 'use strict'; | ||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /** | ||
* Window Sections are used to group nearby cells. | ||
* This enables us to more quickly determine which cells to display in a given region of the Window. | ||
* | ||
*/ | ||
var _keys = require('babel-runtime/core-js/object/keys'); | ||
var _keys2 = _interopRequireDefault(_keys); | ||
var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck'); | ||
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); | ||
var _createClass2 = require('babel-runtime/helpers/createClass'); | ||
var _createClass3 = _interopRequireDefault(_createClass2); | ||
var _Section = require('./Section'); | ||
@@ -21,5 +26,8 @@ | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
var babelPluginFlowReactPropTypes_proptype_SizeAndPositionInfo = require('./types').babelPluginFlowReactPropTypes_proptype_SizeAndPositionInfo || require('prop-types').any; /** | ||
* Window Sections are used to group nearby cells. | ||
* This enables us to more quickly determine which cells to display in a given region of the Window. | ||
* | ||
*/ | ||
var babelPluginFlowReactPropTypes_proptype_SizeAndPositionInfo = require('./types').babelPluginFlowReactPropTypes_proptype_SizeAndPositionInfo || require('prop-types').any; | ||
@@ -38,5 +46,4 @@ var babelPluginFlowReactPropTypes_proptype_Index = require('./types').babelPluginFlowReactPropTypes_proptype_Index || require('prop-types').any; | ||
var sectionSize = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : SECTION_SIZE; | ||
(0, _classCallCheck3.default)(this, SectionManager); | ||
_classCallCheck(this, SectionManager); | ||
this._sectionSize = sectionSize; | ||
@@ -54,3 +61,3 @@ | ||
_createClass(SectionManager, [{ | ||
(0, _createClass3.default)(SectionManager, [{ | ||
key: 'getCellIndices', | ||
@@ -72,3 +79,3 @@ value: function getCellIndices(_ref) { | ||
// Object keys are strings; this function returns numbers | ||
return Object.keys(indices).map(function (index) { | ||
return (0, _keys2.default)(indices).map(function (index) { | ||
return indices[index]; | ||
@@ -130,3 +137,3 @@ }); | ||
value: function getTotalSectionCount() { | ||
return Object.keys(this._sections).length; | ||
return (0, _keys2.default)(this._sections).length; | ||
} | ||
@@ -141,3 +148,3 @@ | ||
return Object.keys(this._sections).map(function (index) { | ||
return (0, _keys2.default)(this._sections).map(function (index) { | ||
return _this._sections[index].toString(); | ||
@@ -162,3 +169,2 @@ }); | ||
}]); | ||
return SectionManager; | ||
@@ -165,0 +171,0 @@ }(); |
"use strict"; | ||
var babelPluginFlowReactPropTypes_proptype_Index = { | ||
index: require("prop-types").number.isRequired | ||
}; | ||
if (typeof exports !== "undefined") Object.defineProperty(exports, "babelPluginFlowReactPropTypes_proptype_Index", { | ||
value: { | ||
index: require("prop-types").number.isRequired | ||
}, | ||
value: babelPluginFlowReactPropTypes_proptype_Index, | ||
configurable: true | ||
}); | ||
var babelPluginFlowReactPropTypes_proptype_PositionInfo = { | ||
x: require("prop-types").number.isRequired, | ||
y: require("prop-types").number.isRequired | ||
}; | ||
if (typeof exports !== "undefined") Object.defineProperty(exports, "babelPluginFlowReactPropTypes_proptype_PositionInfo", { | ||
value: { | ||
x: require("prop-types").number.isRequired, | ||
y: require("prop-types").number.isRequired | ||
}, | ||
value: babelPluginFlowReactPropTypes_proptype_PositionInfo, | ||
configurable: true | ||
}); | ||
var babelPluginFlowReactPropTypes_proptype_ScrollPosition = { | ||
scrollLeft: require("prop-types").number.isRequired, | ||
scrollTop: require("prop-types").number.isRequired | ||
}; | ||
if (typeof exports !== "undefined") Object.defineProperty(exports, "babelPluginFlowReactPropTypes_proptype_ScrollPosition", { | ||
value: { | ||
scrollLeft: require("prop-types").number.isRequired, | ||
scrollTop: require("prop-types").number.isRequired | ||
}, | ||
value: babelPluginFlowReactPropTypes_proptype_ScrollPosition, | ||
configurable: true | ||
}); | ||
var babelPluginFlowReactPropTypes_proptype_SizeAndPositionInfo = { | ||
height: require("prop-types").number.isRequired, | ||
width: require("prop-types").number.isRequired, | ||
x: require("prop-types").number.isRequired, | ||
y: require("prop-types").number.isRequired | ||
}; | ||
if (typeof exports !== "undefined") Object.defineProperty(exports, "babelPluginFlowReactPropTypes_proptype_SizeAndPositionInfo", { | ||
value: { | ||
height: require("prop-types").number.isRequired, | ||
width: require("prop-types").number.isRequired, | ||
x: require("prop-types").number.isRequired, | ||
y: require("prop-types").number.isRequired | ||
}, | ||
value: babelPluginFlowReactPropTypes_proptype_SizeAndPositionInfo, | ||
configurable: true | ||
}); | ||
var babelPluginFlowReactPropTypes_proptype_SizeInfo = { | ||
height: require("prop-types").number.isRequired, | ||
width: require("prop-types").number.isRequired | ||
}; | ||
if (typeof exports !== "undefined") Object.defineProperty(exports, "babelPluginFlowReactPropTypes_proptype_SizeInfo", { | ||
value: { | ||
height: require("prop-types").number.isRequired, | ||
width: require("prop-types").number.isRequired | ||
}, | ||
value: babelPluginFlowReactPropTypes_proptype_SizeInfo, | ||
configurable: true | ||
}); |
@@ -7,4 +7,22 @@ 'use strict'; | ||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); | ||
var _getPrototypeOf = require('babel-runtime/core-js/object/get-prototype-of'); | ||
var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); | ||
var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck'); | ||
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); | ||
var _createClass2 = require('babel-runtime/helpers/createClass'); | ||
var _createClass3 = _interopRequireDefault(_createClass2); | ||
var _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn'); | ||
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); | ||
var _inherits2 = require('babel-runtime/helpers/inherits'); | ||
var _inherits3 = _interopRequireDefault(_inherits2); | ||
var _propTypes = require('prop-types'); | ||
@@ -18,8 +36,2 @@ | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } | ||
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; } | ||
/** | ||
@@ -29,8 +41,8 @@ * High-order component that auto-calculates column-widths for `Grid` cells. | ||
var ColumnSizer = function (_PureComponent) { | ||
_inherits(ColumnSizer, _PureComponent); | ||
(0, _inherits3.default)(ColumnSizer, _PureComponent); | ||
function ColumnSizer(props, context) { | ||
_classCallCheck(this, ColumnSizer); | ||
(0, _classCallCheck3.default)(this, ColumnSizer); | ||
var _this = _possibleConstructorReturn(this, (ColumnSizer.__proto__ || Object.getPrototypeOf(ColumnSizer)).call(this, props, context)); | ||
var _this = (0, _possibleConstructorReturn3.default)(this, (ColumnSizer.__proto__ || (0, _getPrototypeOf2.default)(ColumnSizer)).call(this, props, context)); | ||
@@ -41,3 +53,3 @@ _this._registerChild = _this._registerChild.bind(_this); | ||
_createClass(ColumnSizer, [{ | ||
(0, _createClass3.default)(ColumnSizer, [{ | ||
key: 'componentDidUpdate', | ||
@@ -103,3 +115,2 @@ value: function componentDidUpdate(prevProps) { | ||
}]); | ||
return ColumnSizer; | ||
@@ -106,0 +117,0 @@ }(_react.PureComponent); |
@@ -8,9 +8,29 @@ 'use strict'; | ||
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; | ||
var _extends2 = require('babel-runtime/helpers/extends'); | ||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); | ||
var _extends3 = _interopRequireDefault(_extends2); | ||
var _getPrototypeOf = require('babel-runtime/core-js/object/get-prototype-of'); | ||
var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); | ||
var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck'); | ||
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); | ||
var _createClass2 = require('babel-runtime/helpers/createClass'); | ||
var _createClass3 = _interopRequireDefault(_createClass2); | ||
var _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn'); | ||
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); | ||
var _inherits2 = require('babel-runtime/helpers/inherits'); | ||
var _inherits3 = _interopRequireDefault(_inherits2); | ||
var _react = require('react'); | ||
var _react2 = _interopRequireDefault(_react); | ||
var React = _interopRequireWildcard(_react); | ||
@@ -51,12 +71,6 @@ var _classnames = require('classnames'); | ||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function _objectDestructuringEmpty(obj) { if (obj == null) throw new TypeError("Cannot destructure undefined"); } | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } | ||
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; } | ||
var babelPluginFlowReactPropTypes_proptype_Alignment = require('./types').babelPluginFlowReactPropTypes_proptype_Alignment || require('prop-types').any; | ||
@@ -110,9 +124,9 @@ | ||
var Grid = function (_React$PureComponent) { | ||
_inherits(Grid, _React$PureComponent); | ||
(0, _inherits3.default)(Grid, _React$PureComponent); | ||
// Invokes onSectionRendered callback only when start/stop row or column indices change | ||
function Grid(props) { | ||
_classCallCheck(this, Grid); | ||
(0, _classCallCheck3.default)(this, Grid); | ||
var _this = _possibleConstructorReturn(this, (Grid.__proto__ || Object.getPrototypeOf(Grid)).call(this, props)); | ||
var _this = (0, _possibleConstructorReturn3.default)(this, (Grid.__proto__ || (0, _getPrototypeOf2.default)(Grid)).call(this, props)); | ||
@@ -124,3 +138,4 @@ _this.state = { | ||
scrollLeft: 0, | ||
scrollTop: 0 | ||
scrollTop: 0, | ||
scrollPositionChangeReason: null | ||
}; | ||
@@ -213,3 +228,3 @@ _this._onGridRenderedMemoizer = (0, _createCallbackMemoizer2.default)(); | ||
_createClass(Grid, [{ | ||
(0, _createClass3.default)(Grid, [{ | ||
key: 'getOffsetForCell', | ||
@@ -225,3 +240,3 @@ value: function getOffsetForCell() { | ||
var offsetProps = _extends({}, this.props, { | ||
var offsetProps = (0, _extends3.default)({}, this.props, { | ||
scrollToAlignment: alignment, | ||
@@ -403,3 +418,3 @@ scrollToColumn: columnIndex, | ||
if (columnCount > 1 && columnIndex !== undefined) { | ||
this._updateScrollLeftForScrollToColumn(_extends({}, props, { | ||
this._updateScrollLeftForScrollToColumn((0, _extends3.default)({}, props, { | ||
scrollToColumn: columnIndex | ||
@@ -410,3 +425,3 @@ })); | ||
if (rowIndex !== undefined) { | ||
this._updateScrollTopForScrollToRow(_extends({}, props, { | ||
this._updateScrollTopForScrollToRow((0, _extends3.default)({}, props, { | ||
scrollToRow: rowIndex | ||
@@ -782,5 +797,5 @@ })); | ||
return _react2.default.createElement( | ||
return React.createElement( | ||
'div', | ||
_extends({ | ||
(0, _extends3.default)({ | ||
ref: this._setScrollingContainerRef | ||
@@ -794,5 +809,5 @@ }, containerProps, { | ||
role: role, | ||
style: _extends({}, gridStyle, style), | ||
style: (0, _extends3.default)({}, gridStyle, style), | ||
tabIndex: tabIndex }), | ||
childrenToDisplay.length > 0 && _react2.default.createElement( | ||
childrenToDisplay.length > 0 && React.createElement( | ||
'div', | ||
@@ -802,3 +817,3 @@ { | ||
role: containerRole, | ||
style: _extends({ | ||
style: (0, _extends3.default)({ | ||
width: autoContainerWidth ? 'auto' : totalColumnsWidth, | ||
@@ -1175,5 +1190,4 @@ height: totalRowsHeight, | ||
}]); | ||
return Grid; | ||
}(_react2.default.PureComponent); | ||
}(React.PureComponent); | ||
@@ -1193,9 +1207,5 @@ Grid.defaultProps = { | ||
noContentRenderer: renderNull, | ||
onScroll: function onScroll(_ref9) { | ||
_objectDestructuringEmpty(_ref9); | ||
}, | ||
onScroll: function onScroll() {}, | ||
onScrollbarPresenceChange: function onScrollbarPresenceChange() {}, | ||
onSectionRendered: function onSectionRendered(_ref10) { | ||
_objectDestructuringEmpty(_ref10); | ||
}, | ||
onSectionRendered: function onSectionRendered() {}, | ||
overscanColumnCount: 0, | ||
@@ -1215,40 +1225,195 @@ overscanIndicesGetter: _defaultOverscanIndicesGetter2.default, | ||
"aria-readonly": require('prop-types').bool, | ||
/** | ||
* Set the width of the inner scrollable container to 'auto'. | ||
* This is useful for single-column Grids to ensure that the column doesn't extend below a vertical scrollbar. | ||
*/ | ||
autoContainerWidth: require('prop-types').bool.isRequired, | ||
/** | ||
* Removes fixed height from the scrollingContainer so that the total height of rows can stretch the window. | ||
* Intended for use with WindowScroller | ||
*/ | ||
autoHeight: require('prop-types').bool.isRequired, | ||
/** | ||
* Removes fixed width from the scrollingContainer so that the total width of rows can stretch the window. | ||
* Intended for use with WindowScroller | ||
*/ | ||
autoWidth: require('prop-types').bool.isRequired, | ||
/** Responsible for rendering a cell given an row and column index. */ | ||
cellRenderer: typeof babelPluginFlowReactPropTypes_proptype_CellRenderer === 'function' ? babelPluginFlowReactPropTypes_proptype_CellRenderer.isRequired ? babelPluginFlowReactPropTypes_proptype_CellRenderer.isRequired : babelPluginFlowReactPropTypes_proptype_CellRenderer : require('prop-types').shape(babelPluginFlowReactPropTypes_proptype_CellRenderer).isRequired, | ||
/** Responsible for rendering a group of cells given their index ranges. */ | ||
cellRangeRenderer: typeof babelPluginFlowReactPropTypes_proptype_CellRangeRenderer === 'function' ? babelPluginFlowReactPropTypes_proptype_CellRangeRenderer.isRequired ? babelPluginFlowReactPropTypes_proptype_CellRangeRenderer.isRequired : babelPluginFlowReactPropTypes_proptype_CellRangeRenderer : require('prop-types').shape(babelPluginFlowReactPropTypes_proptype_CellRangeRenderer).isRequired, | ||
/** Optional custom CSS class name to attach to root Grid element. */ | ||
className: require('prop-types').string, | ||
/** Number of columns in grid. */ | ||
columnCount: require('prop-types').number.isRequired, | ||
/** Either a fixed column width (number) or a function that returns the width of a column given its index. */ | ||
columnWidth: typeof babelPluginFlowReactPropTypes_proptype_CellSize === 'function' ? babelPluginFlowReactPropTypes_proptype_CellSize.isRequired ? babelPluginFlowReactPropTypes_proptype_CellSize.isRequired : babelPluginFlowReactPropTypes_proptype_CellSize : require('prop-types').shape(babelPluginFlowReactPropTypes_proptype_CellSize).isRequired, | ||
/** Unfiltered props for the Grid container. */ | ||
containerProps: require('prop-types').object, | ||
/** ARIA role for the cell-container. */ | ||
containerRole: require('prop-types').string.isRequired, | ||
/** Optional inline style applied to inner cell-container */ | ||
containerStyle: require('prop-types').object.isRequired, | ||
/** | ||
* If CellMeasurer is used to measure this Grid's children, this should be a pointer to its CellMeasurerCache. | ||
* A shared CellMeasurerCache reference enables Grid and CellMeasurer to share measurement data. | ||
*/ | ||
deferredMeasurementCache: require('prop-types').object, | ||
/** | ||
* Used to estimate the total width of a Grid before all of its columns have actually been measured. | ||
* The estimated total width is adjusted as columns are rendered. | ||
*/ | ||
estimatedColumnSize: require('prop-types').number.isRequired, | ||
/** | ||
* Used to estimate the total height of a Grid before all of its rows have actually been measured. | ||
* The estimated total height is adjusted as rows are rendered. | ||
*/ | ||
estimatedRowSize: require('prop-types').number.isRequired, | ||
/** Exposed for testing purposes only. */ | ||
getScrollbarSize: require('prop-types').func.isRequired, | ||
/** Height of Grid; this property determines the number of visible (vs virtualized) rows. */ | ||
height: require('prop-types').number.isRequired, | ||
/** Optional custom id to attach to root Grid element. */ | ||
id: require('prop-types').string, | ||
/** | ||
* Override internal is-scrolling state tracking. | ||
* This property is primarily intended for use with the WindowScroller component. | ||
*/ | ||
isScrolling: require('prop-types').bool, | ||
/** Optional renderer to be used in place of rows when either :rowCount or :columnCount is 0. */ | ||
noContentRenderer: typeof babelPluginFlowReactPropTypes_proptype_NoContentRenderer === 'function' ? babelPluginFlowReactPropTypes_proptype_NoContentRenderer.isRequired ? babelPluginFlowReactPropTypes_proptype_NoContentRenderer.isRequired : babelPluginFlowReactPropTypes_proptype_NoContentRenderer : require('prop-types').shape(babelPluginFlowReactPropTypes_proptype_NoContentRenderer).isRequired, | ||
/** | ||
* Callback invoked whenever the scroll offset changes within the inner scrollable region. | ||
* This callback can be used to sync scrolling between lists, tables, or grids. | ||
*/ | ||
onScroll: require('prop-types').func.isRequired, | ||
/** | ||
* Called whenever a horizontal or vertical scrollbar is added or removed. | ||
* This prop is not intended for end-user use; | ||
* It is used by MultiGrid to support fixed-row/fixed-column scroll syncing. | ||
*/ | ||
onScrollbarPresenceChange: require('prop-types').func.isRequired, | ||
/** Callback invoked with information about the section of the Grid that was just rendered. */ | ||
onSectionRendered: require('prop-types').func.isRequired, | ||
/** | ||
* Number of columns to render before/after the visible section of the grid. | ||
* These columns can help for smoother scrolling on touch devices or browsers that send scroll events infrequently. | ||
*/ | ||
overscanColumnCount: require('prop-types').number.isRequired, | ||
/** | ||
* Calculates the number of cells to overscan before and after a specified range. | ||
* This function ensures that overscanning doesn't exceed the available cells. | ||
*/ | ||
overscanIndicesGetter: typeof babelPluginFlowReactPropTypes_proptype_OverscanIndicesGetter === 'function' ? babelPluginFlowReactPropTypes_proptype_OverscanIndicesGetter.isRequired ? babelPluginFlowReactPropTypes_proptype_OverscanIndicesGetter.isRequired : babelPluginFlowReactPropTypes_proptype_OverscanIndicesGetter : require('prop-types').shape(babelPluginFlowReactPropTypes_proptype_OverscanIndicesGetter).isRequired, | ||
/** | ||
* Number of rows to render above/below the visible section of the grid. | ||
* These rows can help for smoother scrolling on touch devices or browsers that send scroll events infrequently. | ||
*/ | ||
overscanRowCount: require('prop-types').number.isRequired, | ||
/** ARIA role for the grid element. */ | ||
role: require('prop-types').string.isRequired, | ||
/** | ||
* Either a fixed row height (number) or a function that returns the height of a row given its index. | ||
* Should implement the following interface: ({ index: number }): number | ||
*/ | ||
rowHeight: typeof babelPluginFlowReactPropTypes_proptype_CellSize === 'function' ? babelPluginFlowReactPropTypes_proptype_CellSize.isRequired ? babelPluginFlowReactPropTypes_proptype_CellSize.isRequired : babelPluginFlowReactPropTypes_proptype_CellSize : require('prop-types').shape(babelPluginFlowReactPropTypes_proptype_CellSize).isRequired, | ||
/** Number of rows in grid. */ | ||
rowCount: require('prop-types').number.isRequired, | ||
/** Wait this amount of time after the last scroll event before resetting Grid `pointer-events`. */ | ||
scrollingResetTimeInterval: require('prop-types').number.isRequired, | ||
/** Horizontal offset. */ | ||
scrollLeft: require('prop-types').number, | ||
/** | ||
* Controls scroll-to-cell behavior of the Grid. | ||
* The default ("auto") scrolls the least amount possible to ensure that the specified cell is fully visible. | ||
* Use "start" to align cells to the top/left of the Grid and "end" to align bottom/right. | ||
*/ | ||
scrollToAlignment: typeof babelPluginFlowReactPropTypes_proptype_Alignment === 'function' ? babelPluginFlowReactPropTypes_proptype_Alignment.isRequired ? babelPluginFlowReactPropTypes_proptype_Alignment.isRequired : babelPluginFlowReactPropTypes_proptype_Alignment : require('prop-types').shape(babelPluginFlowReactPropTypes_proptype_Alignment).isRequired, | ||
/** Column index to ensure visible (by forcefully scrolling if necessary) */ | ||
scrollToColumn: require('prop-types').number.isRequired, | ||
/** Vertical offset. */ | ||
scrollTop: require('prop-types').number, | ||
/** Row index to ensure visible (by forcefully scrolling if necessary) */ | ||
scrollToRow: require('prop-types').number.isRequired, | ||
/** Optional inline style */ | ||
style: require('prop-types').object.isRequired, | ||
/** Tab index for focus */ | ||
tabIndex: require('prop-types').number, | ||
/** Width of Grid; this property determines the number of visible (vs virtualized) columns. */ | ||
width: require('prop-types').number.isRequired | ||
}; | ||
exports.default = Grid; |
@@ -5,3 +5,3 @@ 'use strict'; | ||
var _react2 = _interopRequireDefault(_react); | ||
var React = _interopRequireWildcard(_react); | ||
@@ -14,128 +14,176 @@ var _ScalingCellSizeAndPositionManager = require('./utils/ScalingCellSizeAndPositionManager'); | ||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } | ||
var babelPluginFlowReactPropTypes_proptype_CellPosition = { | ||
columnIndex: require('prop-types').number.isRequired, | ||
rowIndex: require('prop-types').number.isRequired | ||
}; | ||
if (typeof exports !== 'undefined') Object.defineProperty(exports, 'babelPluginFlowReactPropTypes_proptype_CellPosition', { | ||
value: { | ||
columnIndex: require('prop-types').number.isRequired, | ||
rowIndex: require('prop-types').number.isRequired | ||
}, | ||
value: babelPluginFlowReactPropTypes_proptype_CellPosition, | ||
configurable: true | ||
}); | ||
var babelPluginFlowReactPropTypes_proptype_CellRendererParams = { | ||
columnIndex: require('prop-types').number.isRequired, | ||
isScrolling: require('prop-types').bool.isRequired, | ||
isVisible: require('prop-types').bool.isRequired, | ||
key: require('prop-types').string.isRequired, | ||
parent: require('prop-types').object.isRequired, | ||
rowIndex: require('prop-types').number.isRequired, | ||
style: require('prop-types').object.isRequired | ||
}; | ||
if (typeof exports !== 'undefined') Object.defineProperty(exports, 'babelPluginFlowReactPropTypes_proptype_CellRendererParams', { | ||
value: { | ||
columnIndex: require('prop-types').number.isRequired, | ||
isScrolling: require('prop-types').bool.isRequired, | ||
isVisible: require('prop-types').bool.isRequired, | ||
key: require('prop-types').string.isRequired, | ||
parent: require('prop-types').object.isRequired, | ||
rowIndex: require('prop-types').number.isRequired, | ||
style: require('prop-types').object.isRequired | ||
}, | ||
value: babelPluginFlowReactPropTypes_proptype_CellRendererParams, | ||
configurable: true | ||
}); | ||
var babelPluginFlowReactPropTypes_proptype_CellRenderer = require('prop-types').func; | ||
if (typeof exports !== 'undefined') Object.defineProperty(exports, 'babelPluginFlowReactPropTypes_proptype_CellRenderer', { | ||
value: require('prop-types').func, | ||
value: babelPluginFlowReactPropTypes_proptype_CellRenderer, | ||
configurable: true | ||
}); | ||
var babelPluginFlowReactPropTypes_proptype_CellRangeRendererParams = { | ||
cellCache: require('prop-types').object.isRequired, | ||
cellRenderer: require('prop-types').func.isRequired, | ||
columnSizeAndPositionManager: typeof _ScalingCellSizeAndPositionManager2.default === 'function' ? require('prop-types').instanceOf(_ScalingCellSizeAndPositionManager2.default).isRequired : require('prop-types').any.isRequired, | ||
columnStartIndex: require('prop-types').number.isRequired, | ||
columnStopIndex: require('prop-types').number.isRequired, | ||
deferredMeasurementCache: require('prop-types').object, | ||
horizontalOffsetAdjustment: require('prop-types').number.isRequired, | ||
isScrolling: require('prop-types').bool.isRequired, | ||
parent: require('prop-types').object.isRequired, | ||
rowSizeAndPositionManager: typeof _ScalingCellSizeAndPositionManager2.default === 'function' ? require('prop-types').instanceOf(_ScalingCellSizeAndPositionManager2.default).isRequired : require('prop-types').any.isRequired, | ||
rowStartIndex: require('prop-types').number.isRequired, | ||
rowStopIndex: require('prop-types').number.isRequired, | ||
scrollLeft: require('prop-types').number.isRequired, | ||
scrollTop: require('prop-types').number.isRequired, | ||
styleCache: require('prop-types').object.isRequired, | ||
verticalOffsetAdjustment: require('prop-types').number.isRequired, | ||
visibleColumnIndices: require('prop-types').object.isRequired, | ||
visibleRowIndices: require('prop-types').object.isRequired | ||
}; | ||
if (typeof exports !== 'undefined') Object.defineProperty(exports, 'babelPluginFlowReactPropTypes_proptype_CellRangeRendererParams', { | ||
value: { | ||
cellCache: require('prop-types').object.isRequired, | ||
cellRenderer: require('prop-types').func.isRequired, | ||
columnSizeAndPositionManager: typeof _ScalingCellSizeAndPositionManager2.default === 'function' ? require('prop-types').instanceOf(_ScalingCellSizeAndPositionManager2.default).isRequired : require('prop-types').any.isRequired, | ||
columnStartIndex: require('prop-types').number.isRequired, | ||
columnStopIndex: require('prop-types').number.isRequired, | ||
deferredMeasurementCache: require('prop-types').object, | ||
horizontalOffsetAdjustment: require('prop-types').number.isRequired, | ||
isScrolling: require('prop-types').bool.isRequired, | ||
parent: require('prop-types').object.isRequired, | ||
rowSizeAndPositionManager: typeof _ScalingCellSizeAndPositionManager2.default === 'function' ? require('prop-types').instanceOf(_ScalingCellSizeAndPositionManager2.default).isRequired : require('prop-types').any.isRequired, | ||
rowStartIndex: require('prop-types').number.isRequired, | ||
rowStopIndex: require('prop-types').number.isRequired, | ||
scrollLeft: require('prop-types').number.isRequired, | ||
scrollTop: require('prop-types').number.isRequired, | ||
styleCache: require('prop-types').object.isRequired, | ||
verticalOffsetAdjustment: require('prop-types').number.isRequired, | ||
visibleColumnIndices: require('prop-types').object.isRequired, | ||
visibleRowIndices: require('prop-types').object.isRequired | ||
}, | ||
value: babelPluginFlowReactPropTypes_proptype_CellRangeRendererParams, | ||
configurable: true | ||
}); | ||
var babelPluginFlowReactPropTypes_proptype_CellRangeRenderer = require('prop-types').func; | ||
if (typeof exports !== 'undefined') Object.defineProperty(exports, 'babelPluginFlowReactPropTypes_proptype_CellRangeRenderer', { | ||
value: require('prop-types').func, | ||
value: babelPluginFlowReactPropTypes_proptype_CellRangeRenderer, | ||
configurable: true | ||
}); | ||
var babelPluginFlowReactPropTypes_proptype_CellSizeGetter = require('prop-types').func; | ||
if (typeof exports !== 'undefined') Object.defineProperty(exports, 'babelPluginFlowReactPropTypes_proptype_CellSizeGetter', { | ||
value: require('prop-types').func, | ||
value: babelPluginFlowReactPropTypes_proptype_CellSizeGetter, | ||
configurable: true | ||
}); | ||
var babelPluginFlowReactPropTypes_proptype_CellSize = require('prop-types').oneOfType([require('prop-types').func, require('prop-types').number]); | ||
if (typeof exports !== 'undefined') Object.defineProperty(exports, 'babelPluginFlowReactPropTypes_proptype_CellSize', { | ||
value: require('prop-types').oneOfType([require('prop-types').func, require('prop-types').number]), | ||
value: babelPluginFlowReactPropTypes_proptype_CellSize, | ||
configurable: true | ||
}); | ||
var babelPluginFlowReactPropTypes_proptype_NoContentRenderer = require('prop-types').func; | ||
if (typeof exports !== 'undefined') Object.defineProperty(exports, 'babelPluginFlowReactPropTypes_proptype_NoContentRenderer', { | ||
value: require('prop-types').func, | ||
value: babelPluginFlowReactPropTypes_proptype_NoContentRenderer, | ||
configurable: true | ||
}); | ||
var babelPluginFlowReactPropTypes_proptype_Scroll = { | ||
clientHeight: require('prop-types').number.isRequired, | ||
clientWidth: require('prop-types').number.isRequired, | ||
scrollHeight: require('prop-types').number.isRequired, | ||
scrollLeft: require('prop-types').number.isRequired, | ||
scrollTop: require('prop-types').number.isRequired, | ||
scrollWidth: require('prop-types').number.isRequired | ||
}; | ||
if (typeof exports !== 'undefined') Object.defineProperty(exports, 'babelPluginFlowReactPropTypes_proptype_Scroll', { | ||
value: { | ||
clientHeight: require('prop-types').number.isRequired, | ||
clientWidth: require('prop-types').number.isRequired, | ||
scrollHeight: require('prop-types').number.isRequired, | ||
scrollLeft: require('prop-types').number.isRequired, | ||
scrollTop: require('prop-types').number.isRequired, | ||
scrollWidth: require('prop-types').number.isRequired | ||
}, | ||
value: babelPluginFlowReactPropTypes_proptype_Scroll, | ||
configurable: true | ||
}); | ||
var babelPluginFlowReactPropTypes_proptype_ScrollbarPresenceChange = { | ||
horizontal: require('prop-types').bool.isRequired, | ||
vertical: require('prop-types').bool.isRequired, | ||
size: require('prop-types').number.isRequired | ||
}; | ||
if (typeof exports !== 'undefined') Object.defineProperty(exports, 'babelPluginFlowReactPropTypes_proptype_ScrollbarPresenceChange', { | ||
value: { | ||
horizontal: require('prop-types').bool.isRequired, | ||
vertical: require('prop-types').bool.isRequired, | ||
size: require('prop-types').number.isRequired | ||
}, | ||
value: babelPluginFlowReactPropTypes_proptype_ScrollbarPresenceChange, | ||
configurable: true | ||
}); | ||
var babelPluginFlowReactPropTypes_proptype_RenderedSection = { | ||
columnOverscanStartIndex: require('prop-types').number.isRequired, | ||
columnOverscanStopIndex: require('prop-types').number.isRequired, | ||
columnStartIndex: require('prop-types').number.isRequired, | ||
columnStopIndex: require('prop-types').number.isRequired, | ||
rowOverscanStartIndex: require('prop-types').number.isRequired, | ||
rowOverscanStopIndex: require('prop-types').number.isRequired, | ||
rowStartIndex: require('prop-types').number.isRequired, | ||
rowStopIndex: require('prop-types').number.isRequired | ||
}; | ||
if (typeof exports !== 'undefined') Object.defineProperty(exports, 'babelPluginFlowReactPropTypes_proptype_RenderedSection', { | ||
value: { | ||
columnOverscanStartIndex: require('prop-types').number.isRequired, | ||
columnOverscanStopIndex: require('prop-types').number.isRequired, | ||
columnStartIndex: require('prop-types').number.isRequired, | ||
columnStopIndex: require('prop-types').number.isRequired, | ||
rowOverscanStartIndex: require('prop-types').number.isRequired, | ||
rowOverscanStopIndex: require('prop-types').number.isRequired, | ||
rowStartIndex: require('prop-types').number.isRequired, | ||
rowStopIndex: require('prop-types').number.isRequired | ||
}, | ||
value: babelPluginFlowReactPropTypes_proptype_RenderedSection, | ||
configurable: true | ||
}); | ||
var babelPluginFlowReactPropTypes_proptype_OverscanIndicesGetterParams = { | ||
// One of SCROLL_DIRECTION_HORIZONTAL or SCROLL_DIRECTION_VERTICAL | ||
direction: require('prop-types').oneOf(['horizontal', 'vertical']).isRequired, | ||
// One of SCROLL_DIRECTION_BACKWARD or SCROLL_DIRECTION_FORWARD | ||
scrollDirection: require('prop-types').oneOf([-1, 1]).isRequired, | ||
// Number of rows or columns in the current axis | ||
cellCount: require('prop-types').number.isRequired, | ||
// Maximum number of cells to over-render in either direction | ||
overscanCellsCount: require('prop-types').number.isRequired, | ||
// Begin of range of visible cells | ||
startIndex: require('prop-types').number.isRequired, | ||
// End of range of visible cells | ||
stopIndex: require('prop-types').number.isRequired | ||
}; | ||
if (typeof exports !== 'undefined') Object.defineProperty(exports, 'babelPluginFlowReactPropTypes_proptype_OverscanIndicesGetterParams', { | ||
value: { | ||
direction: require('prop-types').oneOf(['horizontal', 'vertical']).isRequired, | ||
scrollDirection: require('prop-types').oneOf([-1, 1]).isRequired, | ||
cellCount: require('prop-types').number.isRequired, | ||
overscanCellsCount: require('prop-types').number.isRequired, | ||
startIndex: require('prop-types').number.isRequired, | ||
stopIndex: require('prop-types').number.isRequired | ||
}, | ||
value: babelPluginFlowReactPropTypes_proptype_OverscanIndicesGetterParams, | ||
configurable: true | ||
}); | ||
var babelPluginFlowReactPropTypes_proptype_OverscanIndices = { | ||
overscanStartIndex: require('prop-types').number.isRequired, | ||
overscanStopIndex: require('prop-types').number.isRequired | ||
}; | ||
if (typeof exports !== 'undefined') Object.defineProperty(exports, 'babelPluginFlowReactPropTypes_proptype_OverscanIndices', { | ||
value: { | ||
overscanStartIndex: require('prop-types').number.isRequired, | ||
overscanStopIndex: require('prop-types').number.isRequired | ||
}, | ||
value: babelPluginFlowReactPropTypes_proptype_OverscanIndices, | ||
configurable: true | ||
}); | ||
var babelPluginFlowReactPropTypes_proptype_OverscanIndicesGetter = require('prop-types').func; | ||
if (typeof exports !== 'undefined') Object.defineProperty(exports, 'babelPluginFlowReactPropTypes_proptype_OverscanIndicesGetter', { | ||
value: require('prop-types').func, | ||
value: babelPluginFlowReactPropTypes_proptype_OverscanIndicesGetter, | ||
configurable: true | ||
}); | ||
var babelPluginFlowReactPropTypes_proptype_Alignment = require('prop-types').oneOf(['auto', 'end', 'start', 'center']); | ||
if (typeof exports !== 'undefined') Object.defineProperty(exports, 'babelPluginFlowReactPropTypes_proptype_Alignment', { | ||
value: require('prop-types').oneOf(['auto', 'end', 'start', 'center']), | ||
value: babelPluginFlowReactPropTypes_proptype_Alignment, | ||
configurable: true | ||
}); | ||
var babelPluginFlowReactPropTypes_proptype_VisibleCellRange = { | ||
start: require('prop-types').number, | ||
stop: require('prop-types').number | ||
}; | ||
if (typeof exports !== 'undefined') Object.defineProperty(exports, 'babelPluginFlowReactPropTypes_proptype_VisibleCellRange', { | ||
value: { | ||
start: require('prop-types').number, | ||
stop: require('prop-types').number | ||
}, | ||
value: babelPluginFlowReactPropTypes_proptype_VisibleCellRange, | ||
configurable: true | ||
}); |
@@ -7,6 +7,12 @@ 'use strict'; | ||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); | ||
var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck'); | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); | ||
var _createClass2 = require('babel-runtime/helpers/createClass'); | ||
var _createClass3 = _interopRequireDefault(_createClass2); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
var babelPluginFlowReactPropTypes_proptype_VisibleCellRange = require('../types').babelPluginFlowReactPropTypes_proptype_VisibleCellRange || require('prop-types').any; | ||
@@ -31,5 +37,3 @@ | ||
estimatedCellSize = _ref.estimatedCellSize; | ||
_classCallCheck(this, CellSizeAndPositionManager); | ||
(0, _classCallCheck3.default)(this, CellSizeAndPositionManager); | ||
this._cellSizeAndPositionData = {}; | ||
@@ -51,3 +55,3 @@ this._lastMeasuredIndex = -1; | ||
_createClass(CellSizeAndPositionManager, [{ | ||
(0, _createClass3.default)(CellSizeAndPositionManager, [{ | ||
key: 'areOffsetsAdjusted', | ||
@@ -327,3 +331,2 @@ value: function areOffsetsAdjusted() { | ||
}]); | ||
return CellSizeAndPositionManager; | ||
@@ -330,0 +333,0 @@ }(); |
@@ -8,4 +8,14 @@ 'use strict'; | ||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); | ||
var _objectWithoutProperties2 = require('babel-runtime/helpers/objectWithoutProperties'); | ||
var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2); | ||
var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck'); | ||
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); | ||
var _createClass2 = require('babel-runtime/helpers/createClass'); | ||
var _createClass3 = _interopRequireDefault(_createClass2); | ||
var _CellSizeAndPositionManager = require('./CellSizeAndPositionManager'); | ||
@@ -17,6 +27,2 @@ | ||
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; } | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
var babelPluginFlowReactPropTypes_proptype_VisibleCellRange = require('../types').babelPluginFlowReactPropTypes_proptype_VisibleCellRange || require('prop-types').any; | ||
@@ -42,6 +48,5 @@ | ||
maxScrollSize = _ref$maxScrollSize === undefined ? DEFAULT_MAX_SCROLL_SIZE : _ref$maxScrollSize, | ||
params = _objectWithoutProperties(_ref, ['maxScrollSize']); | ||
params = (0, _objectWithoutProperties3.default)(_ref, ['maxScrollSize']); | ||
(0, _classCallCheck3.default)(this, ScalingCellSizeAndPositionManager); | ||
_classCallCheck(this, ScalingCellSizeAndPositionManager); | ||
// Favor composition over inheritance to simplify IE10 support | ||
@@ -52,3 +57,3 @@ this._cellSizeAndPositionManager = new _CellSizeAndPositionManager2.default(params); | ||
_createClass(ScalingCellSizeAndPositionManager, [{ | ||
(0, _createClass3.default)(ScalingCellSizeAndPositionManager, [{ | ||
key: 'areOffsetsAdjusted', | ||
@@ -223,3 +228,2 @@ value: function areOffsetsAdjusted() { | ||
}]); | ||
return ScalingCellSizeAndPositionManager; | ||
@@ -226,0 +230,0 @@ }(); |
@@ -7,4 +7,22 @@ 'use strict'; | ||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); | ||
var _getPrototypeOf = require('babel-runtime/core-js/object/get-prototype-of'); | ||
var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); | ||
var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck'); | ||
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); | ||
var _createClass2 = require('babel-runtime/helpers/createClass'); | ||
var _createClass3 = _interopRequireDefault(_createClass2); | ||
var _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn'); | ||
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); | ||
var _inherits2 = require('babel-runtime/helpers/inherits'); | ||
var _inherits3 = _interopRequireDefault(_inherits2); | ||
exports.isRangeVisible = isRangeVisible; | ||
@@ -26,8 +44,2 @@ exports.scanForUnloadedRanges = scanForUnloadedRanges; | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } | ||
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; } | ||
/** | ||
@@ -39,8 +51,8 @@ * Higher-order component that manages lazy-loading for "infinite" data. | ||
var InfiniteLoader = function (_PureComponent) { | ||
_inherits(InfiniteLoader, _PureComponent); | ||
(0, _inherits3.default)(InfiniteLoader, _PureComponent); | ||
function InfiniteLoader(props, context) { | ||
_classCallCheck(this, InfiniteLoader); | ||
(0, _classCallCheck3.default)(this, InfiniteLoader); | ||
var _this = _possibleConstructorReturn(this, (InfiniteLoader.__proto__ || Object.getPrototypeOf(InfiniteLoader)).call(this, props, context)); | ||
var _this = (0, _possibleConstructorReturn3.default)(this, (InfiniteLoader.__proto__ || (0, _getPrototypeOf2.default)(InfiniteLoader)).call(this, props, context)); | ||
@@ -54,3 +66,3 @@ _this._loadMoreRowsMemoizer = (0, _createCallbackMemoizer2.default)(); | ||
_createClass(InfiniteLoader, [{ | ||
(0, _createClass3.default)(InfiniteLoader, [{ | ||
key: 'resetLoadMoreRowsCache', | ||
@@ -152,3 +164,2 @@ value: function resetLoadMoreRowsCache(autoReload) { | ||
}]); | ||
return InfiniteLoader; | ||
@@ -155,0 +166,0 @@ }(_react.PureComponent); |
@@ -7,6 +7,30 @@ 'use strict'; | ||
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; | ||
var _extends2 = require('babel-runtime/helpers/extends'); | ||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); | ||
var _extends3 = _interopRequireDefault(_extends2); | ||
var _getOwnPropertyDescriptor = require('babel-runtime/core-js/object/get-own-property-descriptor'); | ||
var _getOwnPropertyDescriptor2 = _interopRequireDefault(_getOwnPropertyDescriptor); | ||
var _getPrototypeOf = require('babel-runtime/core-js/object/get-prototype-of'); | ||
var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); | ||
var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck'); | ||
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); | ||
var _createClass2 = require('babel-runtime/helpers/createClass'); | ||
var _createClass3 = _interopRequireDefault(_createClass2); | ||
var _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn'); | ||
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); | ||
var _inherits2 = require('babel-runtime/helpers/inherits'); | ||
var _inherits3 = _interopRequireDefault(_inherits2); | ||
var _Grid = require('../Grid'); | ||
@@ -18,3 +42,3 @@ | ||
var _react2 = _interopRequireDefault(_react); | ||
var React = _interopRequireWildcard(_react); | ||
@@ -25,10 +49,6 @@ var _classnames = require('classnames'); | ||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } | ||
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; } | ||
var babelPluginFlowReactPropTypes_proptype_Scroll = require('../Grid').babelPluginFlowReactPropTypes_proptype_Scroll || require('prop-types').any; | ||
@@ -66,3 +86,3 @@ | ||
var List = function (_React$PureComponent) { | ||
_inherits(List, _React$PureComponent); | ||
(0, _inherits3.default)(List, _React$PureComponent); | ||
@@ -74,3 +94,3 @@ function List() { | ||
_classCallCheck(this, List); | ||
(0, _classCallCheck3.default)(this, List); | ||
@@ -81,3 +101,3 @@ for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { | ||
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = List.__proto__ || Object.getPrototypeOf(List)).call.apply(_ref, [this].concat(args))), _this), _this._cellRenderer = function (_ref2) { | ||
return _ret = (_temp = (_this = (0, _possibleConstructorReturn3.default)(this, (_ref = List.__proto__ || (0, _getPrototypeOf2.default)(List)).call.apply(_ref, [this].concat(args))), _this), _this._cellRenderer = function (_ref2) { | ||
var rowIndex = _ref2.rowIndex, | ||
@@ -96,3 +116,3 @@ style = _ref2.style, | ||
var _Object$getOwnPropert = Object.getOwnPropertyDescriptor(style, 'width'), | ||
var _Object$getOwnPropert = (0, _getOwnPropertyDescriptor2.default)(style, 'width'), | ||
writable = _Object$getOwnPropert.writable; | ||
@@ -138,6 +158,6 @@ | ||
}); | ||
}, _temp), _possibleConstructorReturn(_this, _ret); | ||
}, _temp), (0, _possibleConstructorReturn3.default)(_this, _ret); | ||
} | ||
_createClass(List, [{ | ||
(0, _createClass3.default)(List, [{ | ||
key: 'forceUpdateGrid', | ||
@@ -269,3 +289,3 @@ value: function forceUpdateGrid() { | ||
return _react2.default.createElement(_Grid2.default, _extends({}, this.props, { | ||
return React.createElement(_Grid2.default, (0, _extends3.default)({}, this.props, { | ||
autoContainerWidth: true, | ||
@@ -284,5 +304,4 @@ cellRenderer: this._cellRenderer, | ||
}]); | ||
return List; | ||
}(_react2.default.PureComponent); | ||
}(React.PureComponent); | ||
@@ -305,21 +324,88 @@ List.defaultProps = { | ||
"aria-label": require('prop-types').string, | ||
/** | ||
* Removes fixed height from the scrollingContainer so that the total height | ||
* of rows can stretch the window. Intended for use with WindowScroller | ||
*/ | ||
autoHeight: require('prop-types').bool.isRequired, | ||
/** Optional CSS class name */ | ||
className: require('prop-types').string, | ||
/** | ||
* Used to estimate the total height of a List before all of its rows have actually been measured. | ||
* The estimated total height is adjusted as rows are rendered. | ||
*/ | ||
estimatedRowSize: require('prop-types').number.isRequired, | ||
/** Height constraint for list (determines how many actual rows are rendered) */ | ||
height: require('prop-types').number.isRequired, | ||
/** Optional renderer to be used in place of rows when rowCount is 0 */ | ||
noRowsRenderer: typeof babelPluginFlowReactPropTypes_proptype_NoContentRenderer === 'function' ? babelPluginFlowReactPropTypes_proptype_NoContentRenderer.isRequired ? babelPluginFlowReactPropTypes_proptype_NoContentRenderer.isRequired : babelPluginFlowReactPropTypes_proptype_NoContentRenderer : require('prop-types').shape(babelPluginFlowReactPropTypes_proptype_NoContentRenderer).isRequired, | ||
/** Callback invoked with information about the slice of rows that were just rendered. */ | ||
onRowsRendered: require('prop-types').func.isRequired, | ||
/** | ||
* Callback invoked whenever the scroll offset changes within the inner scrollable region. | ||
* This callback can be used to sync scrolling between lists, tables, or grids. | ||
*/ | ||
onScroll: require('prop-types').func.isRequired, | ||
/** See Grid#overscanIndicesGetter */ | ||
overscanIndicesGetter: typeof babelPluginFlowReactPropTypes_proptype_OverscanIndicesGetter === 'function' ? babelPluginFlowReactPropTypes_proptype_OverscanIndicesGetter.isRequired ? babelPluginFlowReactPropTypes_proptype_OverscanIndicesGetter.isRequired : babelPluginFlowReactPropTypes_proptype_OverscanIndicesGetter : require('prop-types').shape(babelPluginFlowReactPropTypes_proptype_OverscanIndicesGetter).isRequired, | ||
/** | ||
* Number of rows to render above/below the visible bounds of the list. | ||
* These rows can help for smoother scrolling on touch devices. | ||
*/ | ||
overscanRowCount: require('prop-types').number.isRequired, | ||
/** Either a fixed row height (number) or a function that returns the height of a row given its index. */ | ||
rowHeight: typeof babelPluginFlowReactPropTypes_proptype_CellSize === 'function' ? babelPluginFlowReactPropTypes_proptype_CellSize.isRequired ? babelPluginFlowReactPropTypes_proptype_CellSize.isRequired : babelPluginFlowReactPropTypes_proptype_CellSize : require('prop-types').shape(babelPluginFlowReactPropTypes_proptype_CellSize).isRequired, | ||
/** Responsible for rendering a row given an index; ({ index: number }): node */ | ||
rowRenderer: typeof babelPluginFlowReactPropTypes_proptype_RowRenderer === 'function' ? babelPluginFlowReactPropTypes_proptype_RowRenderer.isRequired ? babelPluginFlowReactPropTypes_proptype_RowRenderer.isRequired : babelPluginFlowReactPropTypes_proptype_RowRenderer : require('prop-types').shape(babelPluginFlowReactPropTypes_proptype_RowRenderer).isRequired, | ||
/** Number of rows in list. */ | ||
rowCount: require('prop-types').number.isRequired, | ||
/** See Grid#scrollToAlignment */ | ||
scrollToAlignment: typeof babelPluginFlowReactPropTypes_proptype_Alignment === 'function' ? babelPluginFlowReactPropTypes_proptype_Alignment.isRequired ? babelPluginFlowReactPropTypes_proptype_Alignment.isRequired : babelPluginFlowReactPropTypes_proptype_Alignment : require('prop-types').shape(babelPluginFlowReactPropTypes_proptype_Alignment).isRequired, | ||
/** Row index to ensure visible (by forcefully scrolling if necessary) */ | ||
scrollToIndex: require('prop-types').number.isRequired, | ||
/** Vertical offset. */ | ||
scrollTop: require('prop-types').number, | ||
/** Optional inline style */ | ||
style: require('prop-types').object.isRequired, | ||
/** Tab index for focus */ | ||
tabIndex: require('prop-types').number, | ||
/** Width of list */ | ||
width: require('prop-types').number.isRequired | ||
}; | ||
exports.default = List; |
@@ -5,37 +5,43 @@ 'use strict'; | ||
var _react2 = _interopRequireDefault(_react); | ||
var React = _interopRequireWildcard(_react); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } | ||
var babelPluginFlowReactPropTypes_proptype_RowRendererParams = { | ||
index: require('prop-types').number.isRequired, | ||
isScrolling: require('prop-types').bool.isRequired, | ||
isVisible: require('prop-types').bool.isRequired, | ||
key: require('prop-types').string.isRequired, | ||
parent: require('prop-types').object.isRequired, | ||
style: require('prop-types').object.isRequired | ||
}; | ||
if (typeof exports !== 'undefined') Object.defineProperty(exports, 'babelPluginFlowReactPropTypes_proptype_RowRendererParams', { | ||
value: { | ||
index: require('prop-types').number.isRequired, | ||
isScrolling: require('prop-types').bool.isRequired, | ||
isVisible: require('prop-types').bool.isRequired, | ||
key: require('prop-types').string.isRequired, | ||
parent: require('prop-types').object.isRequired, | ||
style: require('prop-types').object.isRequired | ||
}, | ||
value: babelPluginFlowReactPropTypes_proptype_RowRendererParams, | ||
configurable: true | ||
}); | ||
var babelPluginFlowReactPropTypes_proptype_RowRenderer = require('prop-types').func; | ||
if (typeof exports !== 'undefined') Object.defineProperty(exports, 'babelPluginFlowReactPropTypes_proptype_RowRenderer', { | ||
value: require('prop-types').func, | ||
value: babelPluginFlowReactPropTypes_proptype_RowRenderer, | ||
configurable: true | ||
}); | ||
var babelPluginFlowReactPropTypes_proptype_RenderedRows = { | ||
overscanStartIndex: require('prop-types').number.isRequired, | ||
overscanStopIndex: require('prop-types').number.isRequired, | ||
startIndex: require('prop-types').number.isRequired, | ||
stopIndex: require('prop-types').number.isRequired | ||
}; | ||
if (typeof exports !== 'undefined') Object.defineProperty(exports, 'babelPluginFlowReactPropTypes_proptype_RenderedRows', { | ||
value: { | ||
overscanStartIndex: require('prop-types').number.isRequired, | ||
overscanStopIndex: require('prop-types').number.isRequired, | ||
startIndex: require('prop-types').number.isRequired, | ||
stopIndex: require('prop-types').number.isRequired | ||
}, | ||
value: babelPluginFlowReactPropTypes_proptype_RenderedRows, | ||
configurable: true | ||
}); | ||
var babelPluginFlowReactPropTypes_proptype_Scroll = { | ||
clientHeight: require('prop-types').number.isRequired, | ||
scrollHeight: require('prop-types').number.isRequired, | ||
scrollTop: require('prop-types').number.isRequired | ||
}; | ||
if (typeof exports !== 'undefined') Object.defineProperty(exports, 'babelPluginFlowReactPropTypes_proptype_Scroll', { | ||
value: { | ||
clientHeight: require('prop-types').number.isRequired, | ||
scrollHeight: require('prop-types').number.isRequired, | ||
scrollTop: require('prop-types').number.isRequired | ||
}, | ||
value: babelPluginFlowReactPropTypes_proptype_Scroll, | ||
configurable: true | ||
}); |
@@ -8,6 +8,26 @@ 'use strict'; | ||
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; | ||
var _extends2 = require('babel-runtime/helpers/extends'); | ||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); | ||
var _extends3 = _interopRequireDefault(_extends2); | ||
var _getPrototypeOf = require('babel-runtime/core-js/object/get-prototype-of'); | ||
var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); | ||
var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck'); | ||
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); | ||
var _createClass2 = require('babel-runtime/helpers/createClass'); | ||
var _createClass3 = _interopRequireDefault(_createClass2); | ||
var _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn'); | ||
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); | ||
var _inherits2 = require('babel-runtime/helpers/inherits'); | ||
var _inherits3 = _interopRequireDefault(_inherits2); | ||
var _react = require('react'); | ||
@@ -29,8 +49,2 @@ | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } | ||
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; } | ||
var babelPluginFlowReactPropTypes_proptype_AnimationTimeoutId = require('../utils/requestAnimationTimeout').babelPluginFlowReactPropTypes_proptype_AnimationTimeoutId || require('prop-types').any; | ||
@@ -76,8 +90,8 @@ | ||
var Masonry = function (_PureComponent) { | ||
_inherits(Masonry, _PureComponent); | ||
(0, _inherits3.default)(Masonry, _PureComponent); | ||
function Masonry(props, context) { | ||
_classCallCheck(this, Masonry); | ||
(0, _classCallCheck3.default)(this, Masonry); | ||
var _this = _possibleConstructorReturn(this, (Masonry.__proto__ || Object.getPrototypeOf(Masonry)).call(this, props, context)); | ||
var _this = (0, _possibleConstructorReturn3.default)(this, (Masonry.__proto__ || (0, _getPrototypeOf2.default)(Masonry)).call(this, props, context)); | ||
@@ -104,3 +118,3 @@ _this._invalidateOnUpdateStartIndex = null; | ||
_createClass(Masonry, [{ | ||
(0, _createClass3.default)(Masonry, [{ | ||
key: 'clearCellPositions', | ||
@@ -262,3 +276,3 @@ value: function clearCellPositions() { | ||
role: role, | ||
style: _extends({ | ||
style: (0, _extends3.default)({ | ||
boxSizing: 'border-box', | ||
@@ -431,3 +445,2 @@ direction: 'ltr', | ||
}]); | ||
return Masonry; | ||
@@ -456,14 +469,18 @@ }(_react.PureComponent); | ||
var babelPluginFlowReactPropTypes_proptype_CellMeasurerCache = { | ||
defaultHeight: require('prop-types').number.isRequired, | ||
defaultWidth: require('prop-types').number.isRequired, | ||
getHeight: require('prop-types').func.isRequired, | ||
getWidth: require('prop-types').func.isRequired | ||
}; | ||
if (typeof exports !== 'undefined') Object.defineProperty(exports, 'babelPluginFlowReactPropTypes_proptype_CellMeasurerCache', { | ||
value: { | ||
defaultHeight: require('prop-types').number.isRequired, | ||
defaultWidth: require('prop-types').number.isRequired, | ||
getHeight: require('prop-types').func.isRequired, | ||
getWidth: require('prop-types').func.isRequired | ||
}, | ||
value: babelPluginFlowReactPropTypes_proptype_CellMeasurerCache, | ||
configurable: true | ||
}); | ||
var babelPluginFlowReactPropTypes_proptype_Positioner = require('prop-types').func; | ||
if (typeof exports !== 'undefined') Object.defineProperty(exports, 'babelPluginFlowReactPropTypes_proptype_Positioner', { | ||
value: require('prop-types').func, | ||
value: babelPluginFlowReactPropTypes_proptype_Positioner, | ||
configurable: true | ||
}); |
@@ -7,6 +7,14 @@ 'use strict'; | ||
var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); | ||
var _slicedToArray2 = require('babel-runtime/helpers/slicedToArray'); | ||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); | ||
var _slicedToArray3 = _interopRequireDefault(_slicedToArray2); | ||
var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck'); | ||
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); | ||
var _createClass2 = require('babel-runtime/helpers/createClass'); | ||
var _createClass3 = _interopRequireDefault(_createClass2); | ||
var _intervalTree = require('../vendor/intervalTree'); | ||
@@ -18,4 +26,2 @@ | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
// Position cache requirements: | ||
@@ -26,4 +32,3 @@ // O(log(n)) lookup of cells to render for a given viewport size | ||
function PositionCache() { | ||
_classCallCheck(this, PositionCache); | ||
(0, _classCallCheck3.default)(this, PositionCache); | ||
this._columnSizeMap = {}; | ||
@@ -42,3 +47,3 @@ this._intervalTree = (0, _intervalTree2.default)(); | ||
_createClass(PositionCache, [{ | ||
(0, _createClass3.default)(PositionCache, [{ | ||
key: 'estimateTotalHeight', | ||
@@ -58,3 +63,3 @@ value: function estimateTotalHeight(cellCount, columnCount, defaultCellHeight) { | ||
this._intervalTree.queryInterval(scrollTop, scrollTop + clientHeight, function (_ref) { | ||
var _ref2 = _slicedToArray(_ref, 3), | ||
var _ref2 = (0, _slicedToArray3.default)(_ref, 3), | ||
top = _ref2[0], | ||
@@ -115,3 +120,2 @@ _ = _ref2[1], | ||
}]); | ||
return PositionCache; | ||
@@ -118,0 +122,0 @@ }(); |
@@ -7,7 +7,13 @@ 'use strict'; | ||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); | ||
var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck'); | ||
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); | ||
var _createClass2 = require('babel-runtime/helpers/createClass'); | ||
var _createClass3 = _interopRequireDefault(_createClass2); | ||
var _CellMeasurer = require('../CellMeasurer'); | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
@@ -22,5 +28,4 @@ /** | ||
var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
(0, _classCallCheck3.default)(this, CellMeasurerCacheDecorator); | ||
_classCallCheck(this, CellMeasurerCacheDecorator); | ||
this.columnWidth = function (_ref) { | ||
@@ -54,3 +59,3 @@ var index = _ref.index; | ||
_createClass(CellMeasurerCacheDecorator, [{ | ||
(0, _createClass3.default)(CellMeasurerCacheDecorator, [{ | ||
key: 'clear', | ||
@@ -112,3 +117,2 @@ value: function clear(rowIndex, columnIndex) { | ||
}]); | ||
return CellMeasurerCacheDecorator; | ||
@@ -115,0 +119,0 @@ }(); |
@@ -7,6 +7,30 @@ 'use strict'; | ||
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; | ||
var _extends2 = require('babel-runtime/helpers/extends'); | ||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); | ||
var _extends3 = _interopRequireDefault(_extends2); | ||
var _objectWithoutProperties2 = require('babel-runtime/helpers/objectWithoutProperties'); | ||
var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2); | ||
var _getPrototypeOf = require('babel-runtime/core-js/object/get-prototype-of'); | ||
var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); | ||
var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck'); | ||
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); | ||
var _createClass2 = require('babel-runtime/helpers/createClass'); | ||
var _createClass3 = _interopRequireDefault(_createClass2); | ||
var _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn'); | ||
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); | ||
var _inherits2 = require('babel-runtime/helpers/inherits'); | ||
var _inherits3 = _interopRequireDefault(_inherits2); | ||
var _propTypes = require('prop-types'); | ||
@@ -30,10 +54,2 @@ | ||
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; } | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } | ||
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; } | ||
var SCROLLBAR_SIZE_BUFFER = 20; | ||
@@ -50,8 +66,8 @@ | ||
var MultiGrid = function (_PureComponent) { | ||
_inherits(MultiGrid, _PureComponent); | ||
(0, _inherits3.default)(MultiGrid, _PureComponent); | ||
function MultiGrid(props, context) { | ||
_classCallCheck(this, MultiGrid); | ||
(0, _classCallCheck3.default)(this, MultiGrid); | ||
var _this = _possibleConstructorReturn(this, (MultiGrid.__proto__ || Object.getPrototypeOf(MultiGrid)).call(this, props, context)); | ||
var _this = (0, _possibleConstructorReturn3.default)(this, (MultiGrid.__proto__ || (0, _getPrototypeOf2.default)(MultiGrid)).call(this, props, context)); | ||
@@ -85,3 +101,3 @@ _this.state = { | ||
_createClass(MultiGrid, [{ | ||
(0, _createClass3.default)(MultiGrid, [{ | ||
key: 'forceUpdateGrids', | ||
@@ -264,3 +280,3 @@ value: function forceUpdateGrids() { | ||
scrollToRow = _props5.scrollToRow, | ||
rest = _objectWithoutProperties(_props5, ['onScroll', 'onSectionRendered', 'scrollLeft', 'scrollToColumn', 'scrollTop', 'scrollToRow']); | ||
rest = (0, _objectWithoutProperties3.default)(_props5, ['onScroll', 'onSectionRendered', 'scrollLeft', 'scrollToColumn', 'scrollTop', 'scrollToRow']); | ||
@@ -271,3 +287,2 @@ // Don't render any of our Grids if there are no cells. | ||
if (this.props.width === 0 || this.props.height === 0) { | ||
@@ -291,3 +306,3 @@ return null; | ||
this._renderTopLeftGrid(rest), | ||
this._renderTopRightGrid(_extends({}, rest, { | ||
this._renderTopRightGrid((0, _extends3.default)({}, rest, { | ||
onScroll: onScroll, | ||
@@ -300,7 +315,7 @@ scrollLeft: scrollLeft | ||
{ style: this._containerBottomStyle }, | ||
this._renderBottomLeftGrid(_extends({}, rest, { | ||
this._renderBottomLeftGrid((0, _extends3.default)({}, rest, { | ||
onScroll: onScroll, | ||
scrollTop: scrollTop | ||
})), | ||
this._renderBottomRightGrid(_extends({}, rest, { | ||
this._renderBottomRightGrid((0, _extends3.default)({}, rest, { | ||
onScroll: onScroll, | ||
@@ -330,4 +345,3 @@ onSectionRendered: onSectionRendered, | ||
var rowIndex = _ref3.rowIndex, | ||
rest = _objectWithoutProperties(_ref3, ['rowIndex']); | ||
rest = (0, _objectWithoutProperties3.default)(_ref3, ['rowIndex']); | ||
var _props6 = this.props, | ||
@@ -342,3 +356,3 @@ cellRenderer = _props6.cellRenderer, | ||
key: rest.key, | ||
style: _extends({}, rest.style, { | ||
style: (0, _extends3.default)({}, rest.style, { | ||
height: SCROLLBAR_SIZE_BUFFER | ||
@@ -348,3 +362,3 @@ }) | ||
} else { | ||
return cellRenderer(_extends({}, rest, { | ||
return cellRenderer((0, _extends3.default)({}, rest, { | ||
parent: this, | ||
@@ -360,4 +374,3 @@ rowIndex: rowIndex + fixedRowCount | ||
rowIndex = _ref4.rowIndex, | ||
rest = _objectWithoutProperties(_ref4, ['columnIndex', 'rowIndex']); | ||
rest = (0, _objectWithoutProperties3.default)(_ref4, ['columnIndex', 'rowIndex']); | ||
var _props7 = this.props, | ||
@@ -369,3 +382,3 @@ cellRenderer = _props7.cellRenderer, | ||
return cellRenderer(_extends({}, rest, { | ||
return cellRenderer((0, _extends3.default)({}, rest, { | ||
columnIndex: columnIndex + fixedColumnCount, | ||
@@ -380,4 +393,3 @@ parent: this, | ||
var columnIndex = _ref5.columnIndex, | ||
rest = _objectWithoutProperties(_ref5, ['columnIndex']); | ||
rest = (0, _objectWithoutProperties3.default)(_ref5, ['columnIndex']); | ||
var _props8 = this.props, | ||
@@ -392,3 +404,3 @@ cellRenderer = _props8.cellRenderer, | ||
key: rest.key, | ||
style: _extends({}, rest.style, { | ||
style: (0, _extends3.default)({}, rest.style, { | ||
width: SCROLLBAR_SIZE_BUFFER | ||
@@ -398,3 +410,3 @@ }) | ||
} else { | ||
return cellRenderer(_extends({}, rest, { | ||
return cellRenderer((0, _extends3.default)({}, rest, { | ||
columnIndex: columnIndex + fixedColumnCount, | ||
@@ -541,3 +553,3 @@ parent: this | ||
if (firstRender || sizeChange || style !== prevProps.style) { | ||
this._containerOuterStyle = _extends({ | ||
this._containerOuterStyle = (0, _extends3.default)({ | ||
height: height, | ||
@@ -565,3 +577,3 @@ overflow: 'visible', // Let :focus outline show through | ||
if (firstRender || styleBottomLeftGrid !== prevProps.styleBottomLeftGrid) { | ||
this._bottomLeftGridStyle = _extends({ | ||
this._bottomLeftGridStyle = (0, _extends3.default)({ | ||
left: 0, | ||
@@ -575,3 +587,3 @@ overflowX: 'hidden', | ||
if (firstRender || leftSizeChange || styleBottomRightGrid !== prevProps.styleBottomRightGrid) { | ||
this._bottomRightGridStyle = _extends({ | ||
this._bottomRightGridStyle = (0, _extends3.default)({ | ||
left: this._getLeftGridWidth(props), | ||
@@ -583,3 +595,3 @@ position: 'absolute' | ||
if (firstRender || styleTopLeftGrid !== prevProps.styleTopLeftGrid) { | ||
this._topLeftGridStyle = _extends({ | ||
this._topLeftGridStyle = (0, _extends3.default)({ | ||
left: 0, | ||
@@ -594,3 +606,3 @@ overflowX: 'hidden', | ||
if (firstRender || leftSizeChange || styleTopRightGrid !== prevProps.styleTopRightGrid) { | ||
this._topRightGridStyle = _extends({ | ||
this._topRightGridStyle = (0, _extends3.default)({ | ||
left: this._getLeftGridWidth(props), | ||
@@ -675,3 +687,3 @@ overflowX: enableFixedRowScroll ? 'auto' : 'hidden', | ||
return _react2.default.createElement(_Grid2.default, _extends({}, props, { | ||
return _react2.default.createElement(_Grid2.default, (0, _extends3.default)({}, props, { | ||
cellRenderer: this._cellRendererBottomLeftGrid, | ||
@@ -703,3 +715,3 @@ className: this.props.classNameBottomLeftGrid, | ||
return _react2.default.createElement(_Grid2.default, _extends({}, props, { | ||
return _react2.default.createElement(_Grid2.default, (0, _extends3.default)({}, props, { | ||
cellRenderer: this._cellRendererBottomRightGrid, | ||
@@ -733,3 +745,3 @@ className: this.props.classNameBottomRightGrid, | ||
return _react2.default.createElement(_Grid2.default, _extends({}, props, { | ||
return _react2.default.createElement(_Grid2.default, (0, _extends3.default)({}, props, { | ||
className: this.props.classNameTopLeftGrid, | ||
@@ -762,3 +774,3 @@ columnCount: fixedColumnCount, | ||
return _react2.default.createElement(_Grid2.default, _extends({}, props, { | ||
return _react2.default.createElement(_Grid2.default, (0, _extends3.default)({}, props, { | ||
cellRenderer: this._cellRendererTopRightGrid, | ||
@@ -813,3 +825,2 @@ className: this.props.classNameTopRightGrid, | ||
}]); | ||
return MultiGrid; | ||
@@ -816,0 +827,0 @@ }(_react.PureComponent); |
@@ -7,4 +7,22 @@ 'use strict'; | ||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); | ||
var _getPrototypeOf = require('babel-runtime/core-js/object/get-prototype-of'); | ||
var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); | ||
var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck'); | ||
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); | ||
var _createClass2 = require('babel-runtime/helpers/createClass'); | ||
var _createClass3 = _interopRequireDefault(_createClass2); | ||
var _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn'); | ||
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); | ||
var _inherits2 = require('babel-runtime/helpers/inherits'); | ||
var _inherits3 = _interopRequireDefault(_inherits2); | ||
var _propTypes = require('prop-types'); | ||
@@ -18,8 +36,2 @@ | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } | ||
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; } | ||
/** | ||
@@ -29,8 +41,8 @@ * HOC that simplifies the process of synchronizing scrolling between two or more virtualized components. | ||
var ScrollSync = function (_PureComponent) { | ||
_inherits(ScrollSync, _PureComponent); | ||
(0, _inherits3.default)(ScrollSync, _PureComponent); | ||
function ScrollSync(props, context) { | ||
_classCallCheck(this, ScrollSync); | ||
(0, _classCallCheck3.default)(this, ScrollSync); | ||
var _this = _possibleConstructorReturn(this, (ScrollSync.__proto__ || Object.getPrototypeOf(ScrollSync)).call(this, props, context)); | ||
var _this = (0, _possibleConstructorReturn3.default)(this, (ScrollSync.__proto__ || (0, _getPrototypeOf2.default)(ScrollSync)).call(this, props, context)); | ||
@@ -50,3 +62,3 @@ _this.state = { | ||
_createClass(ScrollSync, [{ | ||
(0, _createClass3.default)(ScrollSync, [{ | ||
key: 'render', | ||
@@ -94,3 +106,2 @@ value: function render() { | ||
}]); | ||
return ScrollSync; | ||
@@ -97,0 +108,0 @@ }(_react.PureComponent); |
@@ -7,2 +7,18 @@ 'use strict'; | ||
var _getPrototypeOf = require('babel-runtime/core-js/object/get-prototype-of'); | ||
var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); | ||
var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck'); | ||
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); | ||
var _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn'); | ||
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); | ||
var _inherits2 = require('babel-runtime/helpers/inherits'); | ||
var _inherits3 = _interopRequireDefault(_inherits2); | ||
var _propTypes = require('prop-types'); | ||
@@ -32,8 +48,2 @@ | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } | ||
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; } | ||
/** | ||
@@ -43,8 +53,7 @@ * Describes the header and cell contents of a table column. | ||
var Column = function (_Component) { | ||
_inherits(Column, _Component); | ||
(0, _inherits3.default)(Column, _Component); | ||
function Column() { | ||
_classCallCheck(this, Column); | ||
return _possibleConstructorReturn(this, (Column.__proto__ || Object.getPrototypeOf(Column)).apply(this, arguments)); | ||
(0, _classCallCheck3.default)(this, Column); | ||
return (0, _possibleConstructorReturn3.default)(this, (Column.__proto__ || (0, _getPrototypeOf2.default)(Column)).apply(this, arguments)); | ||
} | ||
@@ -51,0 +60,0 @@ |
@@ -7,4 +7,6 @@ 'use strict'; | ||
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; | ||
var _extends2 = require('babel-runtime/helpers/extends'); | ||
var _extends3 = _interopRequireDefault(_extends2); | ||
exports.default = defaultRowRenderer; | ||
@@ -71,3 +73,3 @@ | ||
'div', | ||
_extends({}, a11yProps, { | ||
(0, _extends3.default)({}, a11yProps, { | ||
className: className, | ||
@@ -74,0 +76,0 @@ key: key, |
@@ -7,6 +7,26 @@ 'use strict'; | ||
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; | ||
var _extends2 = require('babel-runtime/helpers/extends'); | ||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); | ||
var _extends3 = _interopRequireDefault(_extends2); | ||
var _getPrototypeOf = require('babel-runtime/core-js/object/get-prototype-of'); | ||
var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); | ||
var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck'); | ||
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); | ||
var _createClass2 = require('babel-runtime/helpers/createClass'); | ||
var _createClass3 = _interopRequireDefault(_createClass2); | ||
var _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn'); | ||
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); | ||
var _inherits2 = require('babel-runtime/helpers/inherits'); | ||
var _inherits3 = _interopRequireDefault(_inherits2); | ||
var _classnames = require('classnames'); | ||
@@ -48,8 +68,2 @@ | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } | ||
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; } | ||
var babelPluginFlowReactPropTypes_proptype_CellPosition = require('../Grid').babelPluginFlowReactPropTypes_proptype_CellPosition || require('prop-types').any; | ||
@@ -62,8 +76,8 @@ | ||
var Table = function (_PureComponent) { | ||
_inherits(Table, _PureComponent); | ||
(0, _inherits3.default)(Table, _PureComponent); | ||
function Table(props) { | ||
_classCallCheck(this, Table); | ||
(0, _classCallCheck3.default)(this, Table); | ||
var _this = _possibleConstructorReturn(this, (Table.__proto__ || Object.getPrototypeOf(Table)).call(this, props)); | ||
var _this = (0, _possibleConstructorReturn3.default)(this, (Table.__proto__ || (0, _getPrototypeOf2.default)(Table)).call(this, props)); | ||
@@ -82,3 +96,3 @@ _this.state = { | ||
_createClass(Table, [{ | ||
(0, _createClass3.default)(Table, [{ | ||
key: 'forceUpdateGrid', | ||
@@ -240,3 +254,3 @@ value: function forceUpdateGrid() { | ||
_this2._cachedColumnStyles[index] = _extends({}, flexStyles, { | ||
_this2._cachedColumnStyles[index] = (0, _extends3.default)({}, flexStyles, { | ||
overflow: 'hidden' | ||
@@ -259,3 +273,3 @@ }); | ||
columns: this._getHeaderColumns(), | ||
style: _extends({}, rowStyleObject, { | ||
style: (0, _extends3.default)({}, rowStyleObject, { | ||
height: headerHeight, | ||
@@ -267,3 +281,3 @@ overflow: 'hidden', | ||
}), | ||
_react2.default.createElement(_Grid3.default, _extends({}, this.props, { | ||
_react2.default.createElement(_Grid3.default, (0, _extends3.default)({}, this.props, { | ||
autoContainerWidth: true, | ||
@@ -283,3 +297,3 @@ className: (0, _classnames2.default)('ReactVirtualized__Table__Grid', gridClassName), | ||
scrollToRow: scrollToIndex, | ||
style: _extends({}, gridStyle, { | ||
style: (0, _extends3.default)({}, gridStyle, { | ||
overflowX: 'hidden' | ||
@@ -334,3 +348,3 @@ }) | ||
'div', | ||
_extends({}, a11yProps, { | ||
(0, _extends3.default)({}, a11yProps, { | ||
key: 'Row' + rowIndex + '-Col' + columnIndex, | ||
@@ -369,3 +383,3 @@ className: (0, _classnames2.default)('ReactVirtualized__Table__rowColumn', className), | ||
}); | ||
var style = this._getFlexStyleForColumn(column, _extends({}, headerStyle, column.props.headerStyle)); | ||
var style = this._getFlexStyleForColumn(column, (0, _extends3.default)({}, headerStyle, column.props.headerStyle)); | ||
@@ -423,3 +437,3 @@ var renderedHeader = headerRenderer({ | ||
'div', | ||
_extends({}, a11yProps, { | ||
(0, _extends3.default)({}, a11yProps, { | ||
key: 'Header-Col' + index, | ||
@@ -472,3 +486,3 @@ className: classNames, | ||
var className = (0, _classnames2.default)('ReactVirtualized__Table__row', rowClass); | ||
var flattenedStyle = _extends({}, style, rowStyleObject, { | ||
var flattenedStyle = (0, _extends3.default)({}, style, rowStyleObject, { | ||
height: this._getRowHeight(index), | ||
@@ -506,3 +520,3 @@ overflow: 'hidden', | ||
var style = _extends({}, customStyle, { | ||
var style = (0, _extends3.default)({}, customStyle, { | ||
flex: flexValue, | ||
@@ -592,3 +606,2 @@ msFlex: flexValue, | ||
}]); | ||
return Table; | ||
@@ -688,5 +701,5 @@ }(_react.PureComponent); | ||
/** | ||
* Optional callback when a column's header is clicked. | ||
* ({ columnData: any, dataKey: string }): void | ||
*/ | ||
* Optional callback when a column's header is clicked. | ||
* ({ columnData: any, dataKey: string }): void | ||
*/ | ||
onHeaderClick: _propTypes2.default.func, | ||
@@ -693,0 +706,0 @@ |
"use strict"; | ||
var babelPluginFlowReactPropTypes_proptype_CellDataGetterParams = { | ||
columnData: require("prop-types").any, | ||
dataKey: require("prop-types").string.isRequired, | ||
rowData: function rowData(props, propName, componentName) { | ||
if (!Object.prototype.hasOwnProperty.call(props, propName)) { | ||
throw new Error("Prop `" + propName + "` has type 'any' or 'mixed', but was not provided to `" + componentName + "`. Pass undefined or any other value."); | ||
} | ||
} | ||
}; | ||
if (typeof exports !== "undefined") Object.defineProperty(exports, "babelPluginFlowReactPropTypes_proptype_CellDataGetterParams", { | ||
value: { | ||
columnData: require("prop-types").any, | ||
dataKey: require("prop-types").string.isRequired, | ||
rowData: require("prop-types").any.isRequired | ||
}, | ||
value: babelPluginFlowReactPropTypes_proptype_CellDataGetterParams, | ||
configurable: true | ||
}); | ||
var babelPluginFlowReactPropTypes_proptype_CellRendererParams = { | ||
cellData: require("prop-types").any, | ||
columnData: require("prop-types").any, | ||
dataKey: require("prop-types").string.isRequired, | ||
rowData: function rowData(props, propName, componentName) { | ||
if (!Object.prototype.hasOwnProperty.call(props, propName)) { | ||
throw new Error("Prop `" + propName + "` has type 'any' or 'mixed', but was not provided to `" + componentName + "`. Pass undefined or any other value."); | ||
} | ||
}, | ||
rowIndex: require("prop-types").number.isRequired | ||
}; | ||
if (typeof exports !== "undefined") Object.defineProperty(exports, "babelPluginFlowReactPropTypes_proptype_CellRendererParams", { | ||
value: { | ||
cellData: require("prop-types").any, | ||
columnData: require("prop-types").any, | ||
dataKey: require("prop-types").string.isRequired, | ||
rowData: require("prop-types").any.isRequired, | ||
rowIndex: require("prop-types").number.isRequired | ||
}, | ||
value: babelPluginFlowReactPropTypes_proptype_CellRendererParams, | ||
configurable: true | ||
}); | ||
var babelPluginFlowReactPropTypes_proptype_HeaderRowRendererParams = { | ||
className: require("prop-types").string.isRequired, | ||
columns: require("prop-types").arrayOf(require("prop-types").any).isRequired, | ||
style: function style(props, propName, componentName) { | ||
if (!Object.prototype.hasOwnProperty.call(props, propName)) { | ||
throw new Error("Prop `" + propName + "` has type 'any' or 'mixed', but was not provided to `" + componentName + "`. Pass undefined or any other value."); | ||
} | ||
} | ||
}; | ||
if (typeof exports !== "undefined") Object.defineProperty(exports, "babelPluginFlowReactPropTypes_proptype_HeaderRowRendererParams", { | ||
value: { | ||
className: require("prop-types").string.isRequired, | ||
columns: require("prop-types").arrayOf(require("prop-types").any).isRequired, | ||
style: require("prop-types").any.isRequired | ||
}, | ||
value: babelPluginFlowReactPropTypes_proptype_HeaderRowRendererParams, | ||
configurable: true | ||
}); | ||
var babelPluginFlowReactPropTypes_proptype_HeaderRendererParams = { | ||
columnData: require("prop-types").any, | ||
dataKey: require("prop-types").string.isRequired, | ||
disableSort: require("prop-types").bool, | ||
label: require("prop-types").any, | ||
sortBy: require("prop-types").string, | ||
sortDirection: require("prop-types").string | ||
}; | ||
if (typeof exports !== "undefined") Object.defineProperty(exports, "babelPluginFlowReactPropTypes_proptype_HeaderRendererParams", { | ||
value: { | ||
columnData: require("prop-types").any, | ||
dataKey: require("prop-types").string.isRequired, | ||
disableSort: require("prop-types").bool, | ||
label: require("prop-types").any, | ||
sortBy: require("prop-types").string, | ||
sortDirection: require("prop-types").string | ||
}, | ||
value: babelPluginFlowReactPropTypes_proptype_HeaderRendererParams, | ||
configurable: true | ||
}); | ||
var babelPluginFlowReactPropTypes_proptype_RowRendererParams = { | ||
className: require("prop-types").string.isRequired, | ||
columns: require("prop-types").arrayOf(require("prop-types").any).isRequired, | ||
index: require("prop-types").number.isRequired, | ||
isScrolling: require("prop-types").bool.isRequired, | ||
onRowClick: require("prop-types").func, | ||
onRowDoubleClick: require("prop-types").func, | ||
onRowMouseOver: require("prop-types").func, | ||
onRowMouseOut: require("prop-types").func, | ||
rowData: function rowData(props, propName, componentName) { | ||
if (!Object.prototype.hasOwnProperty.call(props, propName)) { | ||
throw new Error("Prop `" + propName + "` has type 'any' or 'mixed', but was not provided to `" + componentName + "`. Pass undefined or any other value."); | ||
} | ||
}, | ||
style: function style(props, propName, componentName) { | ||
if (!Object.prototype.hasOwnProperty.call(props, propName)) { | ||
throw new Error("Prop `" + propName + "` has type 'any' or 'mixed', but was not provided to `" + componentName + "`. Pass undefined or any other value."); | ||
} | ||
} | ||
}; | ||
if (typeof exports !== "undefined") Object.defineProperty(exports, "babelPluginFlowReactPropTypes_proptype_RowRendererParams", { | ||
value: { | ||
className: require("prop-types").string.isRequired, | ||
columns: require("prop-types").arrayOf(require("prop-types").any).isRequired, | ||
index: require("prop-types").number.isRequired, | ||
isScrolling: require("prop-types").bool.isRequired, | ||
onRowClick: require("prop-types").func, | ||
onRowDoubleClick: require("prop-types").func, | ||
onRowMouseOver: require("prop-types").func, | ||
onRowMouseOut: require("prop-types").func, | ||
rowData: require("prop-types").any.isRequired, | ||
style: require("prop-types").any.isRequired | ||
}, | ||
value: babelPluginFlowReactPropTypes_proptype_RowRendererParams, | ||
configurable: true | ||
}); |
@@ -6,3 +6,11 @@ 'use strict'; | ||
}); | ||
var _keys = require('babel-runtime/core-js/object/keys'); | ||
var _keys2 = _interopRequireDefault(_keys); | ||
exports.default = createCallbackMemoizer; | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
/** | ||
@@ -20,3 +28,3 @@ * Helper utility that updates the specified callback whenever any of the specified indices have changed. | ||
var keys = Object.keys(indices); | ||
var keys = (0, _keys2.default)(indices); | ||
var allInitialized = !requireAllKeys || keys.every(function (key) { | ||
@@ -26,3 +34,3 @@ var value = indices[key]; | ||
}); | ||
var indexChanged = keys.length !== Object.keys(cachedIndices).length || keys.some(function (key) { | ||
var indexChanged = keys.length !== (0, _keys2.default)(cachedIndices).length || keys.some(function (key) { | ||
var cachedValue = cachedIndices[key]; | ||
@@ -29,0 +37,0 @@ var value = indices[key]; |
@@ -10,6 +10,7 @@ 'use strict'; | ||
var babelPluginFlowReactPropTypes_proptype_AnimationTimeoutId = { | ||
id: require('prop-types').number.isRequired | ||
}; | ||
if (typeof exports !== 'undefined') Object.defineProperty(exports, 'babelPluginFlowReactPropTypes_proptype_AnimationTimeoutId', { | ||
value: { | ||
id: require('prop-types').number.isRequired | ||
}, | ||
value: babelPluginFlowReactPropTypes_proptype_AnimationTimeoutId, | ||
configurable: true | ||
@@ -16,0 +17,0 @@ }); |
@@ -16,15 +16,30 @@ 'use strict'; | ||
var isWindow = function isWindow(element) { | ||
return element === window; | ||
}; | ||
// TODO Move this into WindowScroller and import from there | ||
var getBoundingBox = function getBoundingBox(element) { | ||
return element.getBoundingClientRect(); | ||
}; | ||
function getDimensions(scrollElement, props) { | ||
if (!scrollElement) { | ||
return { | ||
height: props.serverHeight || 0, | ||
width: props.serverWidth || 0 | ||
height: props.serverHeight, | ||
width: props.serverWidth | ||
}; | ||
} else if (scrollElement === window) { | ||
} else if (isWindow(scrollElement)) { | ||
var _window = window, | ||
innerHeight = _window.innerHeight, | ||
innerWidth = _window.innerWidth; | ||
return { | ||
height: typeof window.innerHeight === 'number' ? window.innerHeight : 0, | ||
width: typeof window.innerWidth === 'number' ? window.innerWidth : 0 | ||
height: typeof innerHeight === 'number' ? innerHeight : 0, | ||
width: typeof innerWidth === 'number' ? innerWidth : 0 | ||
}; | ||
} else { | ||
return scrollElement.getBoundingClientRect(); | ||
return getBoundingBox(scrollElement); | ||
} | ||
@@ -39,14 +54,20 @@ } | ||
*/ | ||
// TODO Move this into WindowScroller and import from there | ||
function getPositionOffset(element, container) { | ||
var scrollOffset = container === window ? { top: 0, left: 0 } : getScrollOffset(container); | ||
var containerElement = container === window ? document.documentElement : container; | ||
var elementRect = element.getBoundingClientRect(); | ||
var containerRect = containerElement.getBoundingClientRect(); | ||
return { | ||
top: elementRect.top + scrollOffset.top - containerRect.top, | ||
left: elementRect.left + scrollOffset.left - containerRect.left | ||
}; | ||
if (isWindow(container) && document.documentElement) { | ||
var containerElement = document.documentElement; | ||
var elementRect = getBoundingBox(element); | ||
var containerRect = getBoundingBox(containerElement); | ||
return { | ||
top: elementRect.top - containerRect.top, | ||
left: elementRect.left - containerRect.left | ||
}; | ||
} else { | ||
var scrollOffset = getScrollOffset(container); | ||
var _elementRect = getBoundingBox(element); | ||
var _containerRect = getBoundingBox(container); | ||
return { | ||
top: _elementRect.top + scrollOffset.top - _containerRect.top, | ||
left: _elementRect.left + scrollOffset.left - _containerRect.left | ||
}; | ||
} | ||
} | ||
@@ -59,3 +80,3 @@ | ||
function getScrollOffset(element) { | ||
if (element === window) { | ||
if (isWindow(element) && document.documentElement) { | ||
return { | ||
@@ -62,0 +83,0 @@ top: 'scrollY' in window ? window.scrollY : document.documentElement.scrollTop, |
@@ -11,2 +11,8 @@ 'use strict'; | ||
var _WindowScroller = require('../WindowScroller.js'); | ||
var _WindowScroller2 = _interopRequireDefault(_WindowScroller); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
var mountedInstances = []; | ||
@@ -20,3 +26,5 @@ var originalBodyPointerEvents = null; | ||
document.body.style.pointerEvents = originalBodyPointerEvents; | ||
if (document.body && originalBodyPointerEvents != null) { | ||
document.body.style.pointerEvents = originalBodyPointerEvents; | ||
} | ||
@@ -48,3 +56,3 @@ originalBodyPointerEvents = null; | ||
function onScrollWindow(event) { | ||
if (event.currentTarget === window && originalBodyPointerEvents == null) { | ||
if (event.currentTarget === window && originalBodyPointerEvents == null && document.body) { | ||
originalBodyPointerEvents = document.body.style.pointerEvents; | ||
@@ -56,4 +64,4 @@ | ||
mountedInstances.forEach(function (instance) { | ||
if (instance.scrollElement === event.currentTarget) { | ||
instance.__handleWindowScrollEvent(event); | ||
if (instance.props.scrollElement === event.currentTarget) { | ||
instance.__handleWindowScrollEvent(); | ||
} | ||
@@ -65,3 +73,3 @@ }); | ||
if (!mountedInstances.some(function (instance) { | ||
return instance.scrollElement === element; | ||
return instance.props.scrollElement === element; | ||
})) { | ||
@@ -68,0 +76,0 @@ element.addEventListener('scroll', onScrollWindow); |
@@ -8,4 +8,30 @@ 'use strict'; | ||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); | ||
var _extends2 = require('babel-runtime/helpers/extends'); | ||
var _extends3 = _interopRequireDefault(_extends2); | ||
var _getPrototypeOf = require('babel-runtime/core-js/object/get-prototype-of'); | ||
var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); | ||
var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck'); | ||
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); | ||
var _createClass2 = require('babel-runtime/helpers/createClass'); | ||
var _createClass3 = _interopRequireDefault(_createClass2); | ||
var _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn'); | ||
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); | ||
var _inherits2 = require('babel-runtime/helpers/inherits'); | ||
var _inherits3 = _interopRequireDefault(_inherits2); | ||
var _react = require('react'); | ||
var React = _interopRequireWildcard(_react); | ||
var _propTypes = require('prop-types'); | ||
@@ -15,4 +41,2 @@ | ||
var _react = require('react'); | ||
var _reactDom = require('react-dom'); | ||
@@ -26,9 +50,9 @@ | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
var _detectElementResize = require('../vendor/detectElementResize'); | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
var _detectElementResize2 = _interopRequireDefault(_detectElementResize); | ||
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } | ||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } | ||
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; } | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
@@ -41,35 +65,89 @@ /** | ||
var WindowScroller = function (_PureComponent) { | ||
_inherits(WindowScroller, _PureComponent); | ||
var getWindow = function getWindow() { | ||
return typeof window !== 'undefined' ? window : undefined; | ||
}; | ||
function WindowScroller(props) { | ||
_classCallCheck(this, WindowScroller); | ||
var WindowScroller = function (_React$PureComponent) { | ||
(0, _inherits3.default)(WindowScroller, _React$PureComponent); | ||
var _this = _possibleConstructorReturn(this, (WindowScroller.__proto__ || Object.getPrototypeOf(WindowScroller)).call(this, props)); | ||
function WindowScroller() { | ||
var _ref; | ||
var _getDimensions = (0, _dimensions.getDimensions)(props.scrollElement, props), | ||
width = _getDimensions.width, | ||
height = _getDimensions.height; | ||
var _temp, _this, _ret; | ||
_this.state = { | ||
height: height, | ||
width: width, | ||
(0, _classCallCheck3.default)(this, WindowScroller); | ||
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { | ||
args[_key] = arguments[_key]; | ||
} | ||
return _ret = (_temp = (_this = (0, _possibleConstructorReturn3.default)(this, (_ref = WindowScroller.__proto__ || (0, _getPrototypeOf2.default)(WindowScroller)).call.apply(_ref, [this].concat(args))), _this), _this._window = getWindow(), _this._isMounted = false, _this._positionFromTop = 0, _this._positionFromLeft = 0, _this._detectElementResize = (0, _detectElementResize2.default)(), _this.state = (0, _extends3.default)({}, (0, _dimensions.getDimensions)(_this.props.scrollElement, _this.props), { | ||
isScrolling: false, | ||
scrollLeft: 0, | ||
scrollTop: 0 | ||
}; | ||
}), _this._onChildScroll = function (_ref2) { | ||
var scrollTop = _ref2.scrollTop; | ||
_this._onResize = _this._onResize.bind(_this); | ||
_this._onChildScroll = _this._onChildScroll.bind(_this); | ||
_this.__handleWindowScrollEvent = _this.__handleWindowScrollEvent.bind(_this); | ||
_this.__resetIsScrolling = _this.__resetIsScrolling.bind(_this); | ||
return _this; | ||
} | ||
if (_this.state.scrollTop === scrollTop) { | ||
return; | ||
} | ||
// Can’t use defaultProps for scrollElement without breaking server-side rendering | ||
var scrollElement = _this.props.scrollElement; | ||
if (scrollElement) { | ||
if (typeof scrollElement.scrollTo === 'function') { | ||
scrollElement.scrollTo(0, scrollTop + _this._positionFromTop); | ||
} else { | ||
scrollElement.scrollTop = scrollTop + _this._positionFromTop; | ||
} | ||
} | ||
}, _this._registerResizeListener = function (element) { | ||
if (element === window) { | ||
window.addEventListener('resize', _this._onResize, false); | ||
} else { | ||
_this._detectElementResize.addResizeListener(element, _this._onResize); | ||
} | ||
}, _this._unregisterResizeListener = function (element) { | ||
if (element === window) { | ||
window.removeEventListener('resize', _this._onResize, false); | ||
} else if (element) { | ||
_this._detectElementResize.removeResizeListener(element, _this._onResize); | ||
} | ||
}, _this._onResize = function () { | ||
_this.updatePosition(); | ||
}, _this.__handleWindowScrollEvent = function () { | ||
if (!_this._isMounted) { | ||
return; | ||
} | ||
var onScroll = _this.props.onScroll; | ||
_createClass(WindowScroller, [{ | ||
var scrollElement = _this.props.scrollElement; | ||
if (scrollElement) { | ||
var scrollOffset = (0, _dimensions.getScrollOffset)(scrollElement); | ||
var _scrollLeft = Math.max(0, scrollOffset.left - _this._positionFromLeft); | ||
var _scrollTop = Math.max(0, scrollOffset.top - _this._positionFromTop); | ||
_this.setState({ | ||
isScrolling: true, | ||
scrollLeft: _scrollLeft, | ||
scrollTop: _scrollTop | ||
}); | ||
onScroll({ | ||
scrollLeft: _scrollLeft, | ||
scrollTop: _scrollTop | ||
}); | ||
} | ||
}, _this.__resetIsScrolling = function () { | ||
_this.setState({ | ||
isScrolling: false | ||
}); | ||
}, _temp), (0, _possibleConstructorReturn3.default)(_this, _ret); | ||
} | ||
(0, _createClass3.default)(WindowScroller, [{ | ||
key: 'updatePosition', | ||
value: function updatePosition(scrollElement) { | ||
value: function updatePosition() { | ||
var scrollElement = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.props.scrollElement; | ||
var props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.props; | ||
@@ -82,8 +160,9 @@ var onResize = this.props.onResize; | ||
scrollElement = scrollElement || this.props.scrollElement; | ||
var thisNode = _reactDom2.default.findDOMNode(this); | ||
if (thisNode instanceof Element && scrollElement) { | ||
var offset = (0, _dimensions.getPositionOffset)(thisNode, scrollElement); | ||
this._positionFromTop = offset.top; | ||
this._positionFromLeft = offset.left; | ||
} | ||
var offset = (0, _dimensions.getPositionOffset)(_reactDom2.default.findDOMNode(this), scrollElement); | ||
this._positionFromTop = offset.top; | ||
this._positionFromLeft = offset.left; | ||
var dimensions = (0, _dimensions.getDimensions)(scrollElement, props); | ||
@@ -108,6 +187,7 @@ if (height !== dimensions.height || width !== dimensions.width) { | ||
(0, _onScroll.registerScrollListener)(this, scrollElement); | ||
if (scrollElement) { | ||
(0, _onScroll.registerScrollListener)(this, scrollElement); | ||
this._registerResizeListener(scrollElement); | ||
} | ||
window.addEventListener('resize', this._onResize, false); | ||
this._isMounted = true; | ||
@@ -121,3 +201,3 @@ } | ||
if (scrollElement !== nextScrollElement) { | ||
if (scrollElement !== nextScrollElement && scrollElement && nextScrollElement) { | ||
this.updatePosition(nextScrollElement, nextProps); | ||
@@ -127,2 +207,5 @@ | ||
(0, _onScroll.registerScrollListener)(this, nextScrollElement); | ||
this._unregisterResizeListener(scrollElement); | ||
this._registerResizeListener(nextScrollElement); | ||
} | ||
@@ -133,4 +216,7 @@ } | ||
value: function componentWillUnmount() { | ||
(0, _onScroll.unregisterScrollListener)(this, this.props.scrollElement); | ||
window.removeEventListener('resize', this._onResize, false); | ||
var scrollElement = this.props.scrollElement; | ||
if (scrollElement) { | ||
(0, _onScroll.unregisterScrollListener)(this, scrollElement); | ||
this._unregisterResizeListener(scrollElement); | ||
} | ||
@@ -160,72 +246,11 @@ this._isMounted = false; | ||
} | ||
}, { | ||
key: '_onChildScroll', | ||
value: function _onChildScroll(_ref) { | ||
var scrollTop = _ref.scrollTop; | ||
if (this.state.scrollTop === scrollTop) { | ||
return; | ||
} | ||
var scrollElement = this.scrollElement; | ||
if (typeof scrollElement.scrollTo === 'function') { | ||
scrollElement.scrollTo(0, scrollTop + this._positionFromTop); | ||
} else { | ||
scrollElement.scrollTop = scrollTop + this._positionFromTop; | ||
} | ||
} | ||
}, { | ||
key: '_onResize', | ||
value: function _onResize() { | ||
this.updatePosition(); | ||
} | ||
// Referenced by utils/onScroll | ||
}, { | ||
key: '__handleWindowScrollEvent', | ||
value: function __handleWindowScrollEvent() { | ||
if (!this._isMounted) { | ||
return; | ||
} | ||
var onScroll = this.props.onScroll; | ||
var scrollElement = this.props.scrollElement; | ||
var scrollOffset = (0, _dimensions.getScrollOffset)(scrollElement); | ||
var scrollLeft = Math.max(0, scrollOffset.left - this._positionFromLeft); | ||
var scrollTop = Math.max(0, scrollOffset.top - this._positionFromTop); | ||
this.setState({ | ||
isScrolling: true, | ||
scrollLeft: scrollLeft, | ||
scrollTop: scrollTop | ||
}); | ||
onScroll({ | ||
scrollLeft: scrollLeft, | ||
scrollTop: scrollTop | ||
}); | ||
} | ||
// Referenced by utils/onScroll | ||
}, { | ||
key: '__resetIsScrolling', | ||
value: function __resetIsScrolling() { | ||
this.setState({ | ||
isScrolling: false | ||
}); | ||
} | ||
}, { | ||
key: 'scrollElement', | ||
get: function get() { | ||
return this.props.scrollElement; | ||
} | ||
}]); | ||
return WindowScroller; | ||
}(_react.PureComponent); | ||
}(React.PureComponent); | ||
@@ -235,9 +260,8 @@ WindowScroller.defaultProps = { | ||
onScroll: function onScroll() {}, | ||
scrollElement: typeof window !== 'undefined' ? window : undefined, | ||
scrollingResetTimeInterval: IS_SCROLLING_TIMEOUT, | ||
scrollElement: getWindow(), | ||
serverHeight: 0, | ||
serverWidth: 0 | ||
}; | ||
exports.default = WindowScroller; | ||
WindowScroller.propTypes = process.env.NODE_ENV !== "production" ? { | ||
WindowScroller.propTypes = { | ||
/** | ||
@@ -248,23 +272,30 @@ * Function responsible for rendering children. | ||
*/ | ||
children: _propTypes2.default.func.isRequired, | ||
children: require('prop-types').func.isRequired, | ||
/** Callback to be invoked on-resize: ({ height, width }) */ | ||
onResize: _propTypes2.default.func.isRequired, | ||
onResize: require('prop-types').func.isRequired, | ||
/** Callback to be invoked on-scroll: ({ scrollLeft, scrollTop }) */ | ||
onScroll: _propTypes2.default.func.isRequired, | ||
onScroll: require('prop-types').func.isRequired, | ||
/** Element to attach scroll event listeners. Defaults to window. */ | ||
scrollElement: _propTypes2.default.any, | ||
scrollElement: typeof Element === 'function' ? require('prop-types').instanceOf(Element) : require('prop-types').any, | ||
/** | ||
* Wait this amount of time after the last scroll event before resetting child `pointer-events`. | ||
*/ | ||
scrollingResetTimeInterval: _propTypes2.default.number.isRequired, | ||
scrollingResetTimeInterval: require('prop-types').number.isRequired, | ||
/** Height used for server-side rendering */ | ||
serverHeight: _propTypes2.default.number.isRequired, | ||
serverHeight: require('prop-types').number.isRequired, | ||
/** Width used for server-side rendering */ | ||
serverWidth: _propTypes2.default.number.isRequired | ||
} : {}; | ||
serverWidth: require('prop-types').number.isRequired | ||
}; | ||
exports.default = WindowScroller; |
@@ -11,3 +11,3 @@ import _Object$getPrototypeOf from 'babel-runtime/core-js/object/get-prototype-of'; | ||
import React from 'react'; | ||
import * as React from 'react'; | ||
@@ -14,0 +14,0 @@ /** |
@@ -0,7 +1,8 @@ | ||
var babelPluginFlowReactPropTypes_proptype_ScrollIndices = { | ||
scrollToColumn: require("prop-types").number.isRequired, | ||
scrollToRow: require("prop-types").number.isRequired | ||
}; | ||
if (typeof exports !== "undefined") Object.defineProperty(exports, "babelPluginFlowReactPropTypes_proptype_ScrollIndices", { | ||
value: { | ||
scrollToColumn: require("prop-types").number.isRequired, | ||
scrollToRow: require("prop-types").number.isRequired | ||
}, | ||
value: babelPluginFlowReactPropTypes_proptype_ScrollIndices, | ||
configurable: true | ||
}); |
@@ -6,6 +6,3 @@ import _Object$getPrototypeOf from 'babel-runtime/core-js/object/get-prototype-of'; | ||
import _inherits from 'babel-runtime/helpers/inherits'; | ||
var babelPluginFlowReactPropTypes_proptype_Size = require('./types').babelPluginFlowReactPropTypes_proptype_Size || require('prop-types').any; | ||
import React from 'react'; | ||
import * as React from 'react'; | ||
import createDetectElementResize from '../vendor/detectElementResize'; | ||
@@ -42,4 +39,4 @@ | ||
var height = _this._parentNode.offsetHeight || 0; | ||
var width = _this._parentNode.offsetWidth || 0; | ||
var _height = _this._parentNode.offsetHeight || 0; | ||
var _width = _this._parentNode.offsetWidth || 0; | ||
@@ -52,12 +49,12 @@ var style = window.getComputedStyle(_this._parentNode) || {}; | ||
var newHeight = height - paddingTop - paddingBottom; | ||
var newWidth = width - paddingLeft - paddingRight; | ||
var newHeight = _height - paddingTop - paddingBottom; | ||
var newWidth = _width - paddingLeft - paddingRight; | ||
if (!disableHeight && _this.state.height !== newHeight || !disableWidth && _this.state.width !== newWidth) { | ||
_this.setState({ | ||
height: height - paddingTop - paddingBottom, | ||
width: width - paddingLeft - paddingRight | ||
height: _height - paddingTop - paddingBottom, | ||
width: _width - paddingLeft - paddingRight | ||
}); | ||
onResize({ height: height, width: width }); | ||
onResize({ height: _height, width: _width }); | ||
} | ||
@@ -154,10 +151,29 @@ } | ||
AutoSizer.propTypes = { | ||
/** Function responsible for rendering children.*/ | ||
children: require('prop-types').func.isRequired, | ||
/** Default height to use for initial render; useful for SSR */ | ||
defaultHeight: require('prop-types').number, | ||
/** Default width to use for initial render; useful for SSR */ | ||
defaultWidth: require('prop-types').number, | ||
/** Disable dynamic :height property */ | ||
disableHeight: require('prop-types').bool.isRequired, | ||
/** Disable dynamic :width property */ | ||
disableWidth: require('prop-types').bool.isRequired, | ||
/** Nonce of the inlined stylesheet for Content Security Policy */ | ||
nonce: require('prop-types').string, | ||
/** Callback to be invoked on-resize */ | ||
onResize: require('prop-types').func.isRequired | ||
}; | ||
export default AutoSizer; |
@@ -1,5 +0,2 @@ | ||
export { default } from './AutoSizer'; | ||
export { default as AutoSizer } from './AutoSizer'; |
@@ -6,3 +6,3 @@ import _Object$getPrototypeOf from 'babel-runtime/core-js/object/get-prototype-of'; | ||
import _inherits from 'babel-runtime/helpers/inherits'; | ||
import React from 'react'; | ||
import * as React from 'react'; | ||
import { findDOMNode } from 'react-dom'; | ||
@@ -159,3 +159,3 @@ import CellMeasurerCache from './CellMeasurerCache.js'; | ||
cache: typeof CellMeasurerCache === 'function' ? require('prop-types').instanceOf(CellMeasurerCache).isRequired : require('prop-types').any.isRequired, | ||
children: require('prop-types').oneOfType([require('prop-types').func, typeof (React.Element == null ? {} : React.Element) === 'function' ? require('prop-types').instanceOf(React.Element == null ? {} : React.Element) : require('prop-types').any]).isRequired, | ||
children: require('prop-types').oneOfType([require('prop-types').func, require('prop-types').node]).isRequired, | ||
columnIndex: require('prop-types').number, | ||
@@ -162,0 +162,0 @@ index: require('prop-types').number, |
@@ -0,36 +1,41 @@ | ||
var babelPluginFlowReactPropTypes_proptype_Index = { | ||
index: require("prop-types").number.isRequired | ||
}; | ||
if (typeof exports !== "undefined") Object.defineProperty(exports, "babelPluginFlowReactPropTypes_proptype_Index", { | ||
value: { | ||
index: require("prop-types").number.isRequired | ||
}, | ||
value: babelPluginFlowReactPropTypes_proptype_Index, | ||
configurable: true | ||
}); | ||
var babelPluginFlowReactPropTypes_proptype_PositionInfo = { | ||
x: require("prop-types").number.isRequired, | ||
y: require("prop-types").number.isRequired | ||
}; | ||
if (typeof exports !== "undefined") Object.defineProperty(exports, "babelPluginFlowReactPropTypes_proptype_PositionInfo", { | ||
value: { | ||
x: require("prop-types").number.isRequired, | ||
y: require("prop-types").number.isRequired | ||
}, | ||
value: babelPluginFlowReactPropTypes_proptype_PositionInfo, | ||
configurable: true | ||
}); | ||
var babelPluginFlowReactPropTypes_proptype_ScrollPosition = { | ||
scrollLeft: require("prop-types").number.isRequired, | ||
scrollTop: require("prop-types").number.isRequired | ||
}; | ||
if (typeof exports !== "undefined") Object.defineProperty(exports, "babelPluginFlowReactPropTypes_proptype_ScrollPosition", { | ||
value: { | ||
scrollLeft: require("prop-types").number.isRequired, | ||
scrollTop: require("prop-types").number.isRequired | ||
}, | ||
value: babelPluginFlowReactPropTypes_proptype_ScrollPosition, | ||
configurable: true | ||
}); | ||
var babelPluginFlowReactPropTypes_proptype_SizeAndPositionInfo = { | ||
height: require("prop-types").number.isRequired, | ||
width: require("prop-types").number.isRequired, | ||
x: require("prop-types").number.isRequired, | ||
y: require("prop-types").number.isRequired | ||
}; | ||
if (typeof exports !== "undefined") Object.defineProperty(exports, "babelPluginFlowReactPropTypes_proptype_SizeAndPositionInfo", { | ||
value: { | ||
height: require("prop-types").number.isRequired, | ||
width: require("prop-types").number.isRequired, | ||
x: require("prop-types").number.isRequired, | ||
y: require("prop-types").number.isRequired | ||
}, | ||
value: babelPluginFlowReactPropTypes_proptype_SizeAndPositionInfo, | ||
configurable: true | ||
}); | ||
var babelPluginFlowReactPropTypes_proptype_SizeInfo = { | ||
height: require("prop-types").number.isRequired, | ||
width: require("prop-types").number.isRequired | ||
}; | ||
if (typeof exports !== "undefined") Object.defineProperty(exports, "babelPluginFlowReactPropTypes_proptype_SizeInfo", { | ||
value: { | ||
height: require("prop-types").number.isRequired, | ||
width: require("prop-types").number.isRequired | ||
}, | ||
value: babelPluginFlowReactPropTypes_proptype_SizeInfo, | ||
configurable: true | ||
}); |
@@ -1,2 +0,1 @@ | ||
import _objectDestructuringEmpty from 'babel-runtime/helpers/objectDestructuringEmpty'; | ||
import _extends from 'babel-runtime/helpers/extends'; | ||
@@ -33,3 +32,3 @@ import _Object$getPrototypeOf from 'babel-runtime/core-js/object/get-prototype-of'; | ||
import React from 'react'; | ||
import * as React from 'react'; | ||
import cn from 'classnames'; | ||
@@ -82,3 +81,4 @@ import calculateSizeAndPositionDataAndUpdateScrollOffset from './utils/calculateSizeAndPositionDataAndUpdateScrollOffset'; | ||
scrollLeft: 0, | ||
scrollTop: 0 | ||
scrollTop: 0, | ||
scrollPositionChangeReason: null | ||
}; | ||
@@ -1143,9 +1143,5 @@ _this._onGridRenderedMemoizer = createCallbackMemoizer(); | ||
noContentRenderer: renderNull, | ||
onScroll: function onScroll(_ref9) { | ||
_objectDestructuringEmpty(_ref9); | ||
}, | ||
onScroll: function onScroll() {}, | ||
onScrollbarPresenceChange: function onScrollbarPresenceChange() {}, | ||
onSectionRendered: function onSectionRendered(_ref10) { | ||
_objectDestructuringEmpty(_ref10); | ||
}, | ||
onSectionRendered: function onSectionRendered() {}, | ||
overscanColumnCount: 0, | ||
@@ -1165,40 +1161,195 @@ overscanIndicesGetter: defaultOverscanIndicesGetter, | ||
"aria-readonly": require('prop-types').bool, | ||
/** | ||
* Set the width of the inner scrollable container to 'auto'. | ||
* This is useful for single-column Grids to ensure that the column doesn't extend below a vertical scrollbar. | ||
*/ | ||
autoContainerWidth: require('prop-types').bool.isRequired, | ||
/** | ||
* Removes fixed height from the scrollingContainer so that the total height of rows can stretch the window. | ||
* Intended for use with WindowScroller | ||
*/ | ||
autoHeight: require('prop-types').bool.isRequired, | ||
/** | ||
* Removes fixed width from the scrollingContainer so that the total width of rows can stretch the window. | ||
* Intended for use with WindowScroller | ||
*/ | ||
autoWidth: require('prop-types').bool.isRequired, | ||
/** Responsible for rendering a cell given an row and column index. */ | ||
cellRenderer: typeof babelPluginFlowReactPropTypes_proptype_CellRenderer === 'function' ? babelPluginFlowReactPropTypes_proptype_CellRenderer.isRequired ? babelPluginFlowReactPropTypes_proptype_CellRenderer.isRequired : babelPluginFlowReactPropTypes_proptype_CellRenderer : require('prop-types').shape(babelPluginFlowReactPropTypes_proptype_CellRenderer).isRequired, | ||
/** Responsible for rendering a group of cells given their index ranges. */ | ||
cellRangeRenderer: typeof babelPluginFlowReactPropTypes_proptype_CellRangeRenderer === 'function' ? babelPluginFlowReactPropTypes_proptype_CellRangeRenderer.isRequired ? babelPluginFlowReactPropTypes_proptype_CellRangeRenderer.isRequired : babelPluginFlowReactPropTypes_proptype_CellRangeRenderer : require('prop-types').shape(babelPluginFlowReactPropTypes_proptype_CellRangeRenderer).isRequired, | ||
/** Optional custom CSS class name to attach to root Grid element. */ | ||
className: require('prop-types').string, | ||
/** Number of columns in grid. */ | ||
columnCount: require('prop-types').number.isRequired, | ||
/** Either a fixed column width (number) or a function that returns the width of a column given its index. */ | ||
columnWidth: typeof babelPluginFlowReactPropTypes_proptype_CellSize === 'function' ? babelPluginFlowReactPropTypes_proptype_CellSize.isRequired ? babelPluginFlowReactPropTypes_proptype_CellSize.isRequired : babelPluginFlowReactPropTypes_proptype_CellSize : require('prop-types').shape(babelPluginFlowReactPropTypes_proptype_CellSize).isRequired, | ||
/** Unfiltered props for the Grid container. */ | ||
containerProps: require('prop-types').object, | ||
/** ARIA role for the cell-container. */ | ||
containerRole: require('prop-types').string.isRequired, | ||
/** Optional inline style applied to inner cell-container */ | ||
containerStyle: require('prop-types').object.isRequired, | ||
/** | ||
* If CellMeasurer is used to measure this Grid's children, this should be a pointer to its CellMeasurerCache. | ||
* A shared CellMeasurerCache reference enables Grid and CellMeasurer to share measurement data. | ||
*/ | ||
deferredMeasurementCache: require('prop-types').object, | ||
/** | ||
* Used to estimate the total width of a Grid before all of its columns have actually been measured. | ||
* The estimated total width is adjusted as columns are rendered. | ||
*/ | ||
estimatedColumnSize: require('prop-types').number.isRequired, | ||
/** | ||
* Used to estimate the total height of a Grid before all of its rows have actually been measured. | ||
* The estimated total height is adjusted as rows are rendered. | ||
*/ | ||
estimatedRowSize: require('prop-types').number.isRequired, | ||
/** Exposed for testing purposes only. */ | ||
getScrollbarSize: require('prop-types').func.isRequired, | ||
/** Height of Grid; this property determines the number of visible (vs virtualized) rows. */ | ||
height: require('prop-types').number.isRequired, | ||
/** Optional custom id to attach to root Grid element. */ | ||
id: require('prop-types').string, | ||
/** | ||
* Override internal is-scrolling state tracking. | ||
* This property is primarily intended for use with the WindowScroller component. | ||
*/ | ||
isScrolling: require('prop-types').bool, | ||
/** Optional renderer to be used in place of rows when either :rowCount or :columnCount is 0. */ | ||
noContentRenderer: typeof babelPluginFlowReactPropTypes_proptype_NoContentRenderer === 'function' ? babelPluginFlowReactPropTypes_proptype_NoContentRenderer.isRequired ? babelPluginFlowReactPropTypes_proptype_NoContentRenderer.isRequired : babelPluginFlowReactPropTypes_proptype_NoContentRenderer : require('prop-types').shape(babelPluginFlowReactPropTypes_proptype_NoContentRenderer).isRequired, | ||
/** | ||
* Callback invoked whenever the scroll offset changes within the inner scrollable region. | ||
* This callback can be used to sync scrolling between lists, tables, or grids. | ||
*/ | ||
onScroll: require('prop-types').func.isRequired, | ||
/** | ||
* Called whenever a horizontal or vertical scrollbar is added or removed. | ||
* This prop is not intended for end-user use; | ||
* It is used by MultiGrid to support fixed-row/fixed-column scroll syncing. | ||
*/ | ||
onScrollbarPresenceChange: require('prop-types').func.isRequired, | ||
/** Callback invoked with information about the section of the Grid that was just rendered. */ | ||
onSectionRendered: require('prop-types').func.isRequired, | ||
/** | ||
* Number of columns to render before/after the visible section of the grid. | ||
* These columns can help for smoother scrolling on touch devices or browsers that send scroll events infrequently. | ||
*/ | ||
overscanColumnCount: require('prop-types').number.isRequired, | ||
/** | ||
* Calculates the number of cells to overscan before and after a specified range. | ||
* This function ensures that overscanning doesn't exceed the available cells. | ||
*/ | ||
overscanIndicesGetter: typeof babelPluginFlowReactPropTypes_proptype_OverscanIndicesGetter === 'function' ? babelPluginFlowReactPropTypes_proptype_OverscanIndicesGetter.isRequired ? babelPluginFlowReactPropTypes_proptype_OverscanIndicesGetter.isRequired : babelPluginFlowReactPropTypes_proptype_OverscanIndicesGetter : require('prop-types').shape(babelPluginFlowReactPropTypes_proptype_OverscanIndicesGetter).isRequired, | ||
/** | ||
* Number of rows to render above/below the visible section of the grid. | ||
* These rows can help for smoother scrolling on touch devices or browsers that send scroll events infrequently. | ||
*/ | ||
overscanRowCount: require('prop-types').number.isRequired, | ||
/** ARIA role for the grid element. */ | ||
role: require('prop-types').string.isRequired, | ||
/** | ||
* Either a fixed row height (number) or a function that returns the height of a row given its index. | ||
* Should implement the following interface: ({ index: number }): number | ||
*/ | ||
rowHeight: typeof babelPluginFlowReactPropTypes_proptype_CellSize === 'function' ? babelPluginFlowReactPropTypes_proptype_CellSize.isRequired ? babelPluginFlowReactPropTypes_proptype_CellSize.isRequired : babelPluginFlowReactPropTypes_proptype_CellSize : require('prop-types').shape(babelPluginFlowReactPropTypes_proptype_CellSize).isRequired, | ||
/** Number of rows in grid. */ | ||
rowCount: require('prop-types').number.isRequired, | ||
/** Wait this amount of time after the last scroll event before resetting Grid `pointer-events`. */ | ||
scrollingResetTimeInterval: require('prop-types').number.isRequired, | ||
/** Horizontal offset. */ | ||
scrollLeft: require('prop-types').number, | ||
/** | ||
* Controls scroll-to-cell behavior of the Grid. | ||
* The default ("auto") scrolls the least amount possible to ensure that the specified cell is fully visible. | ||
* Use "start" to align cells to the top/left of the Grid and "end" to align bottom/right. | ||
*/ | ||
scrollToAlignment: typeof babelPluginFlowReactPropTypes_proptype_Alignment === 'function' ? babelPluginFlowReactPropTypes_proptype_Alignment.isRequired ? babelPluginFlowReactPropTypes_proptype_Alignment.isRequired : babelPluginFlowReactPropTypes_proptype_Alignment : require('prop-types').shape(babelPluginFlowReactPropTypes_proptype_Alignment).isRequired, | ||
/** Column index to ensure visible (by forcefully scrolling if necessary) */ | ||
scrollToColumn: require('prop-types').number.isRequired, | ||
/** Vertical offset. */ | ||
scrollTop: require('prop-types').number, | ||
/** Row index to ensure visible (by forcefully scrolling if necessary) */ | ||
scrollToRow: require('prop-types').number.isRequired, | ||
/** Optional inline style */ | ||
style: require('prop-types').object.isRequired, | ||
/** Tab index for focus */ | ||
tabIndex: require('prop-types').number, | ||
/** Width of Grid; this property determines the number of visible (vs virtualized) columns. */ | ||
width: require('prop-types').number.isRequired | ||
}; | ||
export default Grid; |
@@ -1,130 +0,176 @@ | ||
import React from 'react'; | ||
import * as React from 'react'; | ||
import ScalingCellSizeAndPositionManager from './utils/ScalingCellSizeAndPositionManager'; | ||
var babelPluginFlowReactPropTypes_proptype_CellPosition = { | ||
columnIndex: require('prop-types').number.isRequired, | ||
rowIndex: require('prop-types').number.isRequired | ||
}; | ||
if (typeof exports !== 'undefined') Object.defineProperty(exports, 'babelPluginFlowReactPropTypes_proptype_CellPosition', { | ||
value: { | ||
columnIndex: require('prop-types').number.isRequired, | ||
rowIndex: require('prop-types').number.isRequired | ||
}, | ||
value: babelPluginFlowReactPropTypes_proptype_CellPosition, | ||
configurable: true | ||
}); | ||
var babelPluginFlowReactPropTypes_proptype_CellRendererParams = { | ||
columnIndex: require('prop-types').number.isRequired, | ||
isScrolling: require('prop-types').bool.isRequired, | ||
isVisible: require('prop-types').bool.isRequired, | ||
key: require('prop-types').string.isRequired, | ||
parent: require('prop-types').object.isRequired, | ||
rowIndex: require('prop-types').number.isRequired, | ||
style: require('prop-types').object.isRequired | ||
}; | ||
if (typeof exports !== 'undefined') Object.defineProperty(exports, 'babelPluginFlowReactPropTypes_proptype_CellRendererParams', { | ||
value: { | ||
columnIndex: require('prop-types').number.isRequired, | ||
isScrolling: require('prop-types').bool.isRequired, | ||
isVisible: require('prop-types').bool.isRequired, | ||
key: require('prop-types').string.isRequired, | ||
parent: require('prop-types').object.isRequired, | ||
rowIndex: require('prop-types').number.isRequired, | ||
style: require('prop-types').object.isRequired | ||
}, | ||
value: babelPluginFlowReactPropTypes_proptype_CellRendererParams, | ||
configurable: true | ||
}); | ||
var babelPluginFlowReactPropTypes_proptype_CellRenderer = require('prop-types').func; | ||
if (typeof exports !== 'undefined') Object.defineProperty(exports, 'babelPluginFlowReactPropTypes_proptype_CellRenderer', { | ||
value: require('prop-types').func, | ||
value: babelPluginFlowReactPropTypes_proptype_CellRenderer, | ||
configurable: true | ||
}); | ||
var babelPluginFlowReactPropTypes_proptype_CellRangeRendererParams = { | ||
cellCache: require('prop-types').object.isRequired, | ||
cellRenderer: require('prop-types').func.isRequired, | ||
columnSizeAndPositionManager: typeof ScalingCellSizeAndPositionManager === 'function' ? require('prop-types').instanceOf(ScalingCellSizeAndPositionManager).isRequired : require('prop-types').any.isRequired, | ||
columnStartIndex: require('prop-types').number.isRequired, | ||
columnStopIndex: require('prop-types').number.isRequired, | ||
deferredMeasurementCache: require('prop-types').object, | ||
horizontalOffsetAdjustment: require('prop-types').number.isRequired, | ||
isScrolling: require('prop-types').bool.isRequired, | ||
parent: require('prop-types').object.isRequired, | ||
rowSizeAndPositionManager: typeof ScalingCellSizeAndPositionManager === 'function' ? require('prop-types').instanceOf(ScalingCellSizeAndPositionManager).isRequired : require('prop-types').any.isRequired, | ||
rowStartIndex: require('prop-types').number.isRequired, | ||
rowStopIndex: require('prop-types').number.isRequired, | ||
scrollLeft: require('prop-types').number.isRequired, | ||
scrollTop: require('prop-types').number.isRequired, | ||
styleCache: require('prop-types').object.isRequired, | ||
verticalOffsetAdjustment: require('prop-types').number.isRequired, | ||
visibleColumnIndices: require('prop-types').object.isRequired, | ||
visibleRowIndices: require('prop-types').object.isRequired | ||
}; | ||
if (typeof exports !== 'undefined') Object.defineProperty(exports, 'babelPluginFlowReactPropTypes_proptype_CellRangeRendererParams', { | ||
value: { | ||
cellCache: require('prop-types').object.isRequired, | ||
cellRenderer: require('prop-types').func.isRequired, | ||
columnSizeAndPositionManager: typeof ScalingCellSizeAndPositionManager === 'function' ? require('prop-types').instanceOf(ScalingCellSizeAndPositionManager).isRequired : require('prop-types').any.isRequired, | ||
columnStartIndex: require('prop-types').number.isRequired, | ||
columnStopIndex: require('prop-types').number.isRequired, | ||
deferredMeasurementCache: require('prop-types').object, | ||
horizontalOffsetAdjustment: require('prop-types').number.isRequired, | ||
isScrolling: require('prop-types').bool.isRequired, | ||
parent: require('prop-types').object.isRequired, | ||
rowSizeAndPositionManager: typeof ScalingCellSizeAndPositionManager === 'function' ? require('prop-types').instanceOf(ScalingCellSizeAndPositionManager).isRequired : require('prop-types').any.isRequired, | ||
rowStartIndex: require('prop-types').number.isRequired, | ||
rowStopIndex: require('prop-types').number.isRequired, | ||
scrollLeft: require('prop-types').number.isRequired, | ||
scrollTop: require('prop-types').number.isRequired, | ||
styleCache: require('prop-types').object.isRequired, | ||
verticalOffsetAdjustment: require('prop-types').number.isRequired, | ||
visibleColumnIndices: require('prop-types').object.isRequired, | ||
visibleRowIndices: require('prop-types').object.isRequired | ||
}, | ||
value: babelPluginFlowReactPropTypes_proptype_CellRangeRendererParams, | ||
configurable: true | ||
}); | ||
var babelPluginFlowReactPropTypes_proptype_CellRangeRenderer = require('prop-types').func; | ||
if (typeof exports !== 'undefined') Object.defineProperty(exports, 'babelPluginFlowReactPropTypes_proptype_CellRangeRenderer', { | ||
value: require('prop-types').func, | ||
value: babelPluginFlowReactPropTypes_proptype_CellRangeRenderer, | ||
configurable: true | ||
}); | ||
var babelPluginFlowReactPropTypes_proptype_CellSizeGetter = require('prop-types').func; | ||
if (typeof exports !== 'undefined') Object.defineProperty(exports, 'babelPluginFlowReactPropTypes_proptype_CellSizeGetter', { | ||
value: require('prop-types').func, | ||
value: babelPluginFlowReactPropTypes_proptype_CellSizeGetter, | ||
configurable: true | ||
}); | ||
var babelPluginFlowReactPropTypes_proptype_CellSize = require('prop-types').oneOfType([require('prop-types').func, require('prop-types').number]); | ||
if (typeof exports !== 'undefined') Object.defineProperty(exports, 'babelPluginFlowReactPropTypes_proptype_CellSize', { | ||
value: require('prop-types').oneOfType([require('prop-types').func, require('prop-types').number]), | ||
value: babelPluginFlowReactPropTypes_proptype_CellSize, | ||
configurable: true | ||
}); | ||
var babelPluginFlowReactPropTypes_proptype_NoContentRenderer = require('prop-types').func; | ||
if (typeof exports !== 'undefined') Object.defineProperty(exports, 'babelPluginFlowReactPropTypes_proptype_NoContentRenderer', { | ||
value: require('prop-types').func, | ||
value: babelPluginFlowReactPropTypes_proptype_NoContentRenderer, | ||
configurable: true | ||
}); | ||
var babelPluginFlowReactPropTypes_proptype_Scroll = { | ||
clientHeight: require('prop-types').number.isRequired, | ||
clientWidth: require('prop-types').number.isRequired, | ||
scrollHeight: require('prop-types').number.isRequired, | ||
scrollLeft: require('prop-types').number.isRequired, | ||
scrollTop: require('prop-types').number.isRequired, | ||
scrollWidth: require('prop-types').number.isRequired | ||
}; | ||
if (typeof exports !== 'undefined') Object.defineProperty(exports, 'babelPluginFlowReactPropTypes_proptype_Scroll', { | ||
value: { | ||
clientHeight: require('prop-types').number.isRequired, | ||
clientWidth: require('prop-types').number.isRequired, | ||
scrollHeight: require('prop-types').number.isRequired, | ||
scrollLeft: require('prop-types').number.isRequired, | ||
scrollTop: require('prop-types').number.isRequired, | ||
scrollWidth: require('prop-types').number.isRequired | ||
}, | ||
value: babelPluginFlowReactPropTypes_proptype_Scroll, | ||
configurable: true | ||
}); | ||
var babelPluginFlowReactPropTypes_proptype_ScrollbarPresenceChange = { | ||
horizontal: require('prop-types').bool.isRequired, | ||
vertical: require('prop-types').bool.isRequired, | ||
size: require('prop-types').number.isRequired | ||
}; | ||
if (typeof exports !== 'undefined') Object.defineProperty(exports, 'babelPluginFlowReactPropTypes_proptype_ScrollbarPresenceChange', { | ||
value: { | ||
horizontal: require('prop-types').bool.isRequired, | ||
vertical: require('prop-types').bool.isRequired, | ||
size: require('prop-types').number.isRequired | ||
}, | ||
value: babelPluginFlowReactPropTypes_proptype_ScrollbarPresenceChange, | ||
configurable: true | ||
}); | ||
var babelPluginFlowReactPropTypes_proptype_RenderedSection = { | ||
columnOverscanStartIndex: require('prop-types').number.isRequired, | ||
columnOverscanStopIndex: require('prop-types').number.isRequired, | ||
columnStartIndex: require('prop-types').number.isRequired, | ||
columnStopIndex: require('prop-types').number.isRequired, | ||
rowOverscanStartIndex: require('prop-types').number.isRequired, | ||
rowOverscanStopIndex: require('prop-types').number.isRequired, | ||
rowStartIndex: require('prop-types').number.isRequired, | ||
rowStopIndex: require('prop-types').number.isRequired | ||
}; | ||
if (typeof exports !== 'undefined') Object.defineProperty(exports, 'babelPluginFlowReactPropTypes_proptype_RenderedSection', { | ||
value: { | ||
columnOverscanStartIndex: require('prop-types').number.isRequired, | ||
columnOverscanStopIndex: require('prop-types').number.isRequired, | ||
columnStartIndex: require('prop-types').number.isRequired, | ||
columnStopIndex: require('prop-types').number.isRequired, | ||
rowOverscanStartIndex: require('prop-types').number.isRequired, | ||
rowOverscanStopIndex: require('prop-types').number.isRequired, | ||
rowStartIndex: require('prop-types').number.isRequired, | ||
rowStopIndex: require('prop-types').number.isRequired | ||
}, | ||
value: babelPluginFlowReactPropTypes_proptype_RenderedSection, | ||
configurable: true | ||
}); | ||
var babelPluginFlowReactPropTypes_proptype_OverscanIndicesGetterParams = { | ||
// One of SCROLL_DIRECTION_HORIZONTAL or SCROLL_DIRECTION_VERTICAL | ||
direction: require('prop-types').oneOf(['horizontal', 'vertical']).isRequired, | ||
// One of SCROLL_DIRECTION_BACKWARD or SCROLL_DIRECTION_FORWARD | ||
scrollDirection: require('prop-types').oneOf([-1, 1]).isRequired, | ||
// Number of rows or columns in the current axis | ||
cellCount: require('prop-types').number.isRequired, | ||
// Maximum number of cells to over-render in either direction | ||
overscanCellsCount: require('prop-types').number.isRequired, | ||
// Begin of range of visible cells | ||
startIndex: require('prop-types').number.isRequired, | ||
// End of range of visible cells | ||
stopIndex: require('prop-types').number.isRequired | ||
}; | ||
if (typeof exports !== 'undefined') Object.defineProperty(exports, 'babelPluginFlowReactPropTypes_proptype_OverscanIndicesGetterParams', { | ||
value: { | ||
direction: require('prop-types').oneOf(['horizontal', 'vertical']).isRequired, | ||
scrollDirection: require('prop-types').oneOf([-1, 1]).isRequired, | ||
cellCount: require('prop-types').number.isRequired, | ||
overscanCellsCount: require('prop-types').number.isRequired, | ||
startIndex: require('prop-types').number.isRequired, | ||
stopIndex: require('prop-types').number.isRequired | ||
}, | ||
value: babelPluginFlowReactPropTypes_proptype_OverscanIndicesGetterParams, | ||
configurable: true | ||
}); | ||
var babelPluginFlowReactPropTypes_proptype_OverscanIndices = { | ||
overscanStartIndex: require('prop-types').number.isRequired, | ||
overscanStopIndex: require('prop-types').number.isRequired | ||
}; | ||
if (typeof exports !== 'undefined') Object.defineProperty(exports, 'babelPluginFlowReactPropTypes_proptype_OverscanIndices', { | ||
value: { | ||
overscanStartIndex: require('prop-types').number.isRequired, | ||
overscanStopIndex: require('prop-types').number.isRequired | ||
}, | ||
value: babelPluginFlowReactPropTypes_proptype_OverscanIndices, | ||
configurable: true | ||
}); | ||
var babelPluginFlowReactPropTypes_proptype_OverscanIndicesGetter = require('prop-types').func; | ||
if (typeof exports !== 'undefined') Object.defineProperty(exports, 'babelPluginFlowReactPropTypes_proptype_OverscanIndicesGetter', { | ||
value: require('prop-types').func, | ||
value: babelPluginFlowReactPropTypes_proptype_OverscanIndicesGetter, | ||
configurable: true | ||
}); | ||
var babelPluginFlowReactPropTypes_proptype_Alignment = require('prop-types').oneOf(['auto', 'end', 'start', 'center']); | ||
if (typeof exports !== 'undefined') Object.defineProperty(exports, 'babelPluginFlowReactPropTypes_proptype_Alignment', { | ||
value: require('prop-types').oneOf(['auto', 'end', 'start', 'center']), | ||
value: babelPluginFlowReactPropTypes_proptype_Alignment, | ||
configurable: true | ||
}); | ||
var babelPluginFlowReactPropTypes_proptype_VisibleCellRange = { | ||
start: require('prop-types').number, | ||
stop: require('prop-types').number | ||
}; | ||
if (typeof exports !== 'undefined') Object.defineProperty(exports, 'babelPluginFlowReactPropTypes_proptype_VisibleCellRange', { | ||
value: { | ||
start: require('prop-types').number, | ||
stop: require('prop-types').number | ||
}, | ||
value: babelPluginFlowReactPropTypes_proptype_VisibleCellRange, | ||
configurable: true | ||
}); |
@@ -32,3 +32,3 @@ import _extends from 'babel-runtime/helpers/extends'; | ||
import Grid, { accessibilityOverscanIndicesGetter } from '../Grid'; | ||
import React from 'react'; | ||
import * as React from 'react'; | ||
import cn from 'classnames'; | ||
@@ -278,21 +278,88 @@ | ||
"aria-label": require('prop-types').string, | ||
/** | ||
* Removes fixed height from the scrollingContainer so that the total height | ||
* of rows can stretch the window. Intended for use with WindowScroller | ||
*/ | ||
autoHeight: require('prop-types').bool.isRequired, | ||
/** Optional CSS class name */ | ||
className: require('prop-types').string, | ||
/** | ||
* Used to estimate the total height of a List before all of its rows have actually been measured. | ||
* The estimated total height is adjusted as rows are rendered. | ||
*/ | ||
estimatedRowSize: require('prop-types').number.isRequired, | ||
/** Height constraint for list (determines how many actual rows are rendered) */ | ||
height: require('prop-types').number.isRequired, | ||
/** Optional renderer to be used in place of rows when rowCount is 0 */ | ||
noRowsRenderer: typeof babelPluginFlowReactPropTypes_proptype_NoContentRenderer === 'function' ? babelPluginFlowReactPropTypes_proptype_NoContentRenderer.isRequired ? babelPluginFlowReactPropTypes_proptype_NoContentRenderer.isRequired : babelPluginFlowReactPropTypes_proptype_NoContentRenderer : require('prop-types').shape(babelPluginFlowReactPropTypes_proptype_NoContentRenderer).isRequired, | ||
/** Callback invoked with information about the slice of rows that were just rendered. */ | ||
onRowsRendered: require('prop-types').func.isRequired, | ||
/** | ||
* Callback invoked whenever the scroll offset changes within the inner scrollable region. | ||
* This callback can be used to sync scrolling between lists, tables, or grids. | ||
*/ | ||
onScroll: require('prop-types').func.isRequired, | ||
/** See Grid#overscanIndicesGetter */ | ||
overscanIndicesGetter: typeof babelPluginFlowReactPropTypes_proptype_OverscanIndicesGetter === 'function' ? babelPluginFlowReactPropTypes_proptype_OverscanIndicesGetter.isRequired ? babelPluginFlowReactPropTypes_proptype_OverscanIndicesGetter.isRequired : babelPluginFlowReactPropTypes_proptype_OverscanIndicesGetter : require('prop-types').shape(babelPluginFlowReactPropTypes_proptype_OverscanIndicesGetter).isRequired, | ||
/** | ||
* Number of rows to render above/below the visible bounds of the list. | ||
* These rows can help for smoother scrolling on touch devices. | ||
*/ | ||
overscanRowCount: require('prop-types').number.isRequired, | ||
/** Either a fixed row height (number) or a function that returns the height of a row given its index. */ | ||
rowHeight: typeof babelPluginFlowReactPropTypes_proptype_CellSize === 'function' ? babelPluginFlowReactPropTypes_proptype_CellSize.isRequired ? babelPluginFlowReactPropTypes_proptype_CellSize.isRequired : babelPluginFlowReactPropTypes_proptype_CellSize : require('prop-types').shape(babelPluginFlowReactPropTypes_proptype_CellSize).isRequired, | ||
/** Responsible for rendering a row given an index; ({ index: number }): node */ | ||
rowRenderer: typeof babelPluginFlowReactPropTypes_proptype_RowRenderer === 'function' ? babelPluginFlowReactPropTypes_proptype_RowRenderer.isRequired ? babelPluginFlowReactPropTypes_proptype_RowRenderer.isRequired : babelPluginFlowReactPropTypes_proptype_RowRenderer : require('prop-types').shape(babelPluginFlowReactPropTypes_proptype_RowRenderer).isRequired, | ||
/** Number of rows in list. */ | ||
rowCount: require('prop-types').number.isRequired, | ||
/** See Grid#scrollToAlignment */ | ||
scrollToAlignment: typeof babelPluginFlowReactPropTypes_proptype_Alignment === 'function' ? babelPluginFlowReactPropTypes_proptype_Alignment.isRequired ? babelPluginFlowReactPropTypes_proptype_Alignment.isRequired : babelPluginFlowReactPropTypes_proptype_Alignment : require('prop-types').shape(babelPluginFlowReactPropTypes_proptype_Alignment).isRequired, | ||
/** Row index to ensure visible (by forcefully scrolling if necessary) */ | ||
scrollToIndex: require('prop-types').number.isRequired, | ||
/** Vertical offset. */ | ||
scrollTop: require('prop-types').number, | ||
/** Optional inline style */ | ||
style: require('prop-types').object.isRequired, | ||
/** Tab index for focus */ | ||
tabIndex: require('prop-types').number, | ||
/** Width of list */ | ||
width: require('prop-types').number.isRequired | ||
}; | ||
export default List; |
@@ -1,34 +0,40 @@ | ||
import React from 'react'; | ||
import * as React from 'react'; | ||
var babelPluginFlowReactPropTypes_proptype_RowRendererParams = { | ||
index: require('prop-types').number.isRequired, | ||
isScrolling: require('prop-types').bool.isRequired, | ||
isVisible: require('prop-types').bool.isRequired, | ||
key: require('prop-types').string.isRequired, | ||
parent: require('prop-types').object.isRequired, | ||
style: require('prop-types').object.isRequired | ||
}; | ||
if (typeof exports !== 'undefined') Object.defineProperty(exports, 'babelPluginFlowReactPropTypes_proptype_RowRendererParams', { | ||
value: { | ||
index: require('prop-types').number.isRequired, | ||
isScrolling: require('prop-types').bool.isRequired, | ||
isVisible: require('prop-types').bool.isRequired, | ||
key: require('prop-types').string.isRequired, | ||
parent: require('prop-types').object.isRequired, | ||
style: require('prop-types').object.isRequired | ||
}, | ||
value: babelPluginFlowReactPropTypes_proptype_RowRendererParams, | ||
configurable: true | ||
}); | ||
var babelPluginFlowReactPropTypes_proptype_RowRenderer = require('prop-types').func; | ||
if (typeof exports !== 'undefined') Object.defineProperty(exports, 'babelPluginFlowReactPropTypes_proptype_RowRenderer', { | ||
value: require('prop-types').func, | ||
value: babelPluginFlowReactPropTypes_proptype_RowRenderer, | ||
configurable: true | ||
}); | ||
var babelPluginFlowReactPropTypes_proptype_RenderedRows = { | ||
overscanStartIndex: require('prop-types').number.isRequired, | ||
overscanStopIndex: require('prop-types').number.isRequired, | ||
startIndex: require('prop-types').number.isRequired, | ||
stopIndex: require('prop-types').number.isRequired | ||
}; | ||
if (typeof exports !== 'undefined') Object.defineProperty(exports, 'babelPluginFlowReactPropTypes_proptype_RenderedRows', { | ||
value: { | ||
overscanStartIndex: require('prop-types').number.isRequired, | ||
overscanStopIndex: require('prop-types').number.isRequired, | ||
startIndex: require('prop-types').number.isRequired, | ||
stopIndex: require('prop-types').number.isRequired | ||
}, | ||
value: babelPluginFlowReactPropTypes_proptype_RenderedRows, | ||
configurable: true | ||
}); | ||
var babelPluginFlowReactPropTypes_proptype_Scroll = { | ||
clientHeight: require('prop-types').number.isRequired, | ||
scrollHeight: require('prop-types').number.isRequired, | ||
scrollTop: require('prop-types').number.isRequired | ||
}; | ||
if (typeof exports !== 'undefined') Object.defineProperty(exports, 'babelPluginFlowReactPropTypes_proptype_Scroll', { | ||
value: { | ||
clientHeight: require('prop-types').number.isRequired, | ||
scrollHeight: require('prop-types').number.isRequired, | ||
scrollTop: require('prop-types').number.isRequired | ||
}, | ||
value: babelPluginFlowReactPropTypes_proptype_Scroll, | ||
configurable: true | ||
}); |
@@ -428,14 +428,18 @@ import _extends from 'babel-runtime/helpers/extends'; | ||
var babelPluginFlowReactPropTypes_proptype_CellMeasurerCache = { | ||
defaultHeight: require('prop-types').number.isRequired, | ||
defaultWidth: require('prop-types').number.isRequired, | ||
getHeight: require('prop-types').func.isRequired, | ||
getWidth: require('prop-types').func.isRequired | ||
}; | ||
if (typeof exports !== 'undefined') Object.defineProperty(exports, 'babelPluginFlowReactPropTypes_proptype_CellMeasurerCache', { | ||
value: { | ||
defaultHeight: require('prop-types').number.isRequired, | ||
defaultWidth: require('prop-types').number.isRequired, | ||
getHeight: require('prop-types').func.isRequired, | ||
getWidth: require('prop-types').func.isRequired | ||
}, | ||
value: babelPluginFlowReactPropTypes_proptype_CellMeasurerCache, | ||
configurable: true | ||
}); | ||
var babelPluginFlowReactPropTypes_proptype_Positioner = require('prop-types').func; | ||
if (typeof exports !== 'undefined') Object.defineProperty(exports, 'babelPluginFlowReactPropTypes_proptype_Positioner', { | ||
value: require('prop-types').func, | ||
value: babelPluginFlowReactPropTypes_proptype_Positioner, | ||
configurable: true | ||
}); |
@@ -342,29 +342,27 @@ import _extends from 'babel-runtime/helpers/extends'; | ||
if (sortEnabled || onHeaderClick) { | ||
(function () { | ||
// If this is a sortable header, clicking it should update the table data's sorting. | ||
var isFirstTimeSort = sortBy !== dataKey; | ||
// If this is a sortable header, clicking it should update the table data's sorting. | ||
var isFirstTimeSort = sortBy !== dataKey; | ||
// If this is the firstTime sort of this column, use the column default sort order. | ||
// Otherwise, invert the direction of the sort. | ||
var newSortDirection = isFirstTimeSort ? defaultSortDirection : sortDirection === SortDirection.DESC ? SortDirection.ASC : SortDirection.DESC; | ||
// If this is the firstTime sort of this column, use the column default sort order. | ||
// Otherwise, invert the direction of the sort. | ||
var newSortDirection = isFirstTimeSort ? defaultSortDirection : sortDirection === SortDirection.DESC ? SortDirection.ASC : SortDirection.DESC; | ||
var onClick = function onClick(event) { | ||
sortEnabled && sort({ | ||
sortBy: dataKey, | ||
sortDirection: newSortDirection | ||
}); | ||
onHeaderClick && onHeaderClick({ columnData: columnData, dataKey: dataKey, event: event }); | ||
}; | ||
var onClick = function onClick(event) { | ||
sortEnabled && sort({ | ||
sortBy: dataKey, | ||
sortDirection: newSortDirection | ||
}); | ||
onHeaderClick && onHeaderClick({ columnData: columnData, dataKey: dataKey, event: event }); | ||
}; | ||
var onKeyDown = function onKeyDown(event) { | ||
if (event.key === 'Enter' || event.key === ' ') { | ||
onClick(event); | ||
} | ||
}; | ||
var onKeyDown = function onKeyDown(event) { | ||
if (event.key === 'Enter' || event.key === ' ') { | ||
onClick(event); | ||
} | ||
}; | ||
a11yProps['aria-label'] = column.props['aria-label'] || label || dataKey; | ||
a11yProps.tabIndex = 0; | ||
a11yProps.onClick = onClick; | ||
a11yProps.onKeyDown = onKeyDown; | ||
})(); | ||
a11yProps['aria-label'] = column.props['aria-label'] || label || dataKey; | ||
a11yProps.tabIndex = 0; | ||
a11yProps.onClick = onClick; | ||
a11yProps.onKeyDown = onKeyDown; | ||
} | ||
@@ -643,5 +641,5 @@ | ||
/** | ||
* Optional callback when a column's header is clicked. | ||
* ({ columnData: any, dataKey: string }): void | ||
*/ | ||
* Optional callback when a column's header is clicked. | ||
* ({ columnData: any, dataKey: string }): void | ||
*/ | ||
onHeaderClick: PropTypes.func, | ||
@@ -648,0 +646,0 @@ |
@@ -0,52 +1,77 @@ | ||
var babelPluginFlowReactPropTypes_proptype_CellDataGetterParams = { | ||
columnData: require("prop-types").any, | ||
dataKey: require("prop-types").string.isRequired, | ||
rowData: function rowData(props, propName, componentName) { | ||
if (!Object.prototype.hasOwnProperty.call(props, propName)) { | ||
throw new Error("Prop `" + propName + "` has type 'any' or 'mixed', but was not provided to `" + componentName + "`. Pass undefined or any other value."); | ||
} | ||
} | ||
}; | ||
if (typeof exports !== "undefined") Object.defineProperty(exports, "babelPluginFlowReactPropTypes_proptype_CellDataGetterParams", { | ||
value: { | ||
columnData: require("prop-types").any, | ||
dataKey: require("prop-types").string.isRequired, | ||
rowData: require("prop-types").any.isRequired | ||
}, | ||
value: babelPluginFlowReactPropTypes_proptype_CellDataGetterParams, | ||
configurable: true | ||
}); | ||
var babelPluginFlowReactPropTypes_proptype_CellRendererParams = { | ||
cellData: require("prop-types").any, | ||
columnData: require("prop-types").any, | ||
dataKey: require("prop-types").string.isRequired, | ||
rowData: function rowData(props, propName, componentName) { | ||
if (!Object.prototype.hasOwnProperty.call(props, propName)) { | ||
throw new Error("Prop `" + propName + "` has type 'any' or 'mixed', but was not provided to `" + componentName + "`. Pass undefined or any other value."); | ||
} | ||
}, | ||
rowIndex: require("prop-types").number.isRequired | ||
}; | ||
if (typeof exports !== "undefined") Object.defineProperty(exports, "babelPluginFlowReactPropTypes_proptype_CellRendererParams", { | ||
value: { | ||
cellData: require("prop-types").any, | ||
columnData: require("prop-types").any, | ||
dataKey: require("prop-types").string.isRequired, | ||
rowData: require("prop-types").any.isRequired, | ||
rowIndex: require("prop-types").number.isRequired | ||
}, | ||
value: babelPluginFlowReactPropTypes_proptype_CellRendererParams, | ||
configurable: true | ||
}); | ||
var babelPluginFlowReactPropTypes_proptype_HeaderRowRendererParams = { | ||
className: require("prop-types").string.isRequired, | ||
columns: require("prop-types").arrayOf(require("prop-types").any).isRequired, | ||
style: function style(props, propName, componentName) { | ||
if (!Object.prototype.hasOwnProperty.call(props, propName)) { | ||
throw new Error("Prop `" + propName + "` has type 'any' or 'mixed', but was not provided to `" + componentName + "`. Pass undefined or any other value."); | ||
} | ||
} | ||
}; | ||
if (typeof exports !== "undefined") Object.defineProperty(exports, "babelPluginFlowReactPropTypes_proptype_HeaderRowRendererParams", { | ||
value: { | ||
className: require("prop-types").string.isRequired, | ||
columns: require("prop-types").arrayOf(require("prop-types").any).isRequired, | ||
style: require("prop-types").any.isRequired | ||
}, | ||
value: babelPluginFlowReactPropTypes_proptype_HeaderRowRendererParams, | ||
configurable: true | ||
}); | ||
var babelPluginFlowReactPropTypes_proptype_HeaderRendererParams = { | ||
columnData: require("prop-types").any, | ||
dataKey: require("prop-types").string.isRequired, | ||
disableSort: require("prop-types").bool, | ||
label: require("prop-types").any, | ||
sortBy: require("prop-types").string, | ||
sortDirection: require("prop-types").string | ||
}; | ||
if (typeof exports !== "undefined") Object.defineProperty(exports, "babelPluginFlowReactPropTypes_proptype_HeaderRendererParams", { | ||
value: { | ||
columnData: require("prop-types").any, | ||
dataKey: require("prop-types").string.isRequired, | ||
disableSort: require("prop-types").bool, | ||
label: require("prop-types").any, | ||
sortBy: require("prop-types").string, | ||
sortDirection: require("prop-types").string | ||
}, | ||
value: babelPluginFlowReactPropTypes_proptype_HeaderRendererParams, | ||
configurable: true | ||
}); | ||
var babelPluginFlowReactPropTypes_proptype_RowRendererParams = { | ||
className: require("prop-types").string.isRequired, | ||
columns: require("prop-types").arrayOf(require("prop-types").any).isRequired, | ||
index: require("prop-types").number.isRequired, | ||
isScrolling: require("prop-types").bool.isRequired, | ||
onRowClick: require("prop-types").func, | ||
onRowDoubleClick: require("prop-types").func, | ||
onRowMouseOver: require("prop-types").func, | ||
onRowMouseOut: require("prop-types").func, | ||
rowData: function rowData(props, propName, componentName) { | ||
if (!Object.prototype.hasOwnProperty.call(props, propName)) { | ||
throw new Error("Prop `" + propName + "` has type 'any' or 'mixed', but was not provided to `" + componentName + "`. Pass undefined or any other value."); | ||
} | ||
}, | ||
style: function style(props, propName, componentName) { | ||
if (!Object.prototype.hasOwnProperty.call(props, propName)) { | ||
throw new Error("Prop `" + propName + "` has type 'any' or 'mixed', but was not provided to `" + componentName + "`. Pass undefined or any other value."); | ||
} | ||
} | ||
}; | ||
if (typeof exports !== "undefined") Object.defineProperty(exports, "babelPluginFlowReactPropTypes_proptype_RowRendererParams", { | ||
value: { | ||
className: require("prop-types").string.isRequired, | ||
columns: require("prop-types").arrayOf(require("prop-types").any).isRequired, | ||
index: require("prop-types").number.isRequired, | ||
isScrolling: require("prop-types").bool.isRequired, | ||
onRowClick: require("prop-types").func, | ||
onRowDoubleClick: require("prop-types").func, | ||
onRowMouseOver: require("prop-types").func, | ||
onRowMouseOut: require("prop-types").func, | ||
rowData: require("prop-types").any.isRequired, | ||
style: require("prop-types").any.isRequired | ||
}, | ||
value: babelPluginFlowReactPropTypes_proptype_RowRendererParams, | ||
configurable: true | ||
}); |
import { caf, raf } from './animationFrame'; | ||
var babelPluginFlowReactPropTypes_proptype_AnimationTimeoutId = { | ||
id: require('prop-types').number.isRequired | ||
}; | ||
if (typeof exports !== 'undefined') Object.defineProperty(exports, 'babelPluginFlowReactPropTypes_proptype_AnimationTimeoutId', { | ||
value: { | ||
id: require('prop-types').number.isRequired | ||
}, | ||
value: babelPluginFlowReactPropTypes_proptype_AnimationTimeoutId, | ||
configurable: true | ||
@@ -8,0 +9,0 @@ }); |
@@ -8,15 +8,30 @@ | ||
var isWindow = function isWindow(element) { | ||
return element === window; | ||
}; | ||
// TODO Move this into WindowScroller and import from there | ||
var getBoundingBox = function getBoundingBox(element) { | ||
return element.getBoundingClientRect(); | ||
}; | ||
export function getDimensions(scrollElement, props) { | ||
if (!scrollElement) { | ||
return { | ||
height: props.serverHeight || 0, | ||
width: props.serverWidth || 0 | ||
height: props.serverHeight, | ||
width: props.serverWidth | ||
}; | ||
} else if (scrollElement === window) { | ||
} else if (isWindow(scrollElement)) { | ||
var _window = window, | ||
innerHeight = _window.innerHeight, | ||
innerWidth = _window.innerWidth; | ||
return { | ||
height: typeof window.innerHeight === 'number' ? window.innerHeight : 0, | ||
width: typeof window.innerWidth === 'number' ? window.innerWidth : 0 | ||
height: typeof innerHeight === 'number' ? innerHeight : 0, | ||
width: typeof innerWidth === 'number' ? innerWidth : 0 | ||
}; | ||
} else { | ||
return scrollElement.getBoundingClientRect(); | ||
return getBoundingBox(scrollElement); | ||
} | ||
@@ -31,14 +46,20 @@ } | ||
*/ | ||
// TODO Move this into WindowScroller and import from there | ||
export function getPositionOffset(element, container) { | ||
var scrollOffset = container === window ? { top: 0, left: 0 } : getScrollOffset(container); | ||
var containerElement = container === window ? document.documentElement : container; | ||
var elementRect = element.getBoundingClientRect(); | ||
var containerRect = containerElement.getBoundingClientRect(); | ||
return { | ||
top: elementRect.top + scrollOffset.top - containerRect.top, | ||
left: elementRect.left + scrollOffset.left - containerRect.left | ||
}; | ||
if (isWindow(container) && document.documentElement) { | ||
var containerElement = document.documentElement; | ||
var elementRect = getBoundingBox(element); | ||
var containerRect = getBoundingBox(containerElement); | ||
return { | ||
top: elementRect.top - containerRect.top, | ||
left: elementRect.left - containerRect.left | ||
}; | ||
} else { | ||
var scrollOffset = getScrollOffset(container); | ||
var _elementRect = getBoundingBox(element); | ||
var _containerRect = getBoundingBox(container); | ||
return { | ||
top: _elementRect.top + scrollOffset.top - _containerRect.top, | ||
left: _elementRect.left + scrollOffset.left - _containerRect.left | ||
}; | ||
} | ||
} | ||
@@ -51,3 +72,3 @@ | ||
export function getScrollOffset(element) { | ||
if (element === window) { | ||
if (isWindow(element) && document.documentElement) { | ||
return { | ||
@@ -54,0 +75,0 @@ top: 'scrollY' in window ? window.scrollY : document.documentElement.scrollTop, |
import { requestAnimationTimeout, cancelAnimationTimeout } from '../../utils/requestAnimationTimeout'; | ||
import WindowScroller from '../WindowScroller.js'; | ||
@@ -11,3 +12,5 @@ var mountedInstances = []; | ||
document.body.style.pointerEvents = originalBodyPointerEvents; | ||
if (document.body && originalBodyPointerEvents != null) { | ||
document.body.style.pointerEvents = originalBodyPointerEvents; | ||
} | ||
@@ -39,3 +42,3 @@ originalBodyPointerEvents = null; | ||
function onScrollWindow(event) { | ||
if (event.currentTarget === window && originalBodyPointerEvents == null) { | ||
if (event.currentTarget === window && originalBodyPointerEvents == null && document.body) { | ||
originalBodyPointerEvents = document.body.style.pointerEvents; | ||
@@ -47,4 +50,4 @@ | ||
mountedInstances.forEach(function (instance) { | ||
if (instance.scrollElement === event.currentTarget) { | ||
instance.__handleWindowScrollEvent(event); | ||
if (instance.props.scrollElement === event.currentTarget) { | ||
instance.__handleWindowScrollEvent(); | ||
} | ||
@@ -56,3 +59,3 @@ }); | ||
if (!mountedInstances.some(function (instance) { | ||
return instance.scrollElement === element; | ||
return instance.props.scrollElement === element; | ||
})) { | ||
@@ -59,0 +62,0 @@ element.addEventListener('scroll', onScrollWindow); |
@@ -0,1 +1,2 @@ | ||
import _extends from 'babel-runtime/helpers/extends'; | ||
import _Object$getPrototypeOf from 'babel-runtime/core-js/object/get-prototype-of'; | ||
@@ -6,7 +7,8 @@ import _classCallCheck from 'babel-runtime/helpers/classCallCheck'; | ||
import _inherits from 'babel-runtime/helpers/inherits'; | ||
import * as React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import { PureComponent } from 'react'; | ||
import ReactDOM from 'react-dom'; | ||
import { registerScrollListener, unregisterScrollListener } from './utils/onScroll'; | ||
import { getDimensions, getPositionOffset, getScrollOffset } from './utils/dimensions'; | ||
import createDetectElementResize from '../vendor/detectElementResize'; | ||
@@ -19,35 +21,89 @@ /** | ||
var WindowScroller = function (_PureComponent) { | ||
_inherits(WindowScroller, _PureComponent); | ||
var getWindow = function getWindow() { | ||
return typeof window !== 'undefined' ? window : undefined; | ||
}; | ||
function WindowScroller(props) { | ||
var WindowScroller = function (_React$PureComponent) { | ||
_inherits(WindowScroller, _React$PureComponent); | ||
function WindowScroller() { | ||
var _ref; | ||
var _temp, _this, _ret; | ||
_classCallCheck(this, WindowScroller); | ||
var _this = _possibleConstructorReturn(this, (WindowScroller.__proto__ || _Object$getPrototypeOf(WindowScroller)).call(this, props)); | ||
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { | ||
args[_key] = arguments[_key]; | ||
} | ||
var _getDimensions = getDimensions(props.scrollElement, props), | ||
width = _getDimensions.width, | ||
height = _getDimensions.height; | ||
_this.state = { | ||
height: height, | ||
width: width, | ||
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = WindowScroller.__proto__ || _Object$getPrototypeOf(WindowScroller)).call.apply(_ref, [this].concat(args))), _this), _this._window = getWindow(), _this._isMounted = false, _this._positionFromTop = 0, _this._positionFromLeft = 0, _this._detectElementResize = createDetectElementResize(), _this.state = _extends({}, getDimensions(_this.props.scrollElement, _this.props), { | ||
isScrolling: false, | ||
scrollLeft: 0, | ||
scrollTop: 0 | ||
}; | ||
}), _this._onChildScroll = function (_ref2) { | ||
var scrollTop = _ref2.scrollTop; | ||
_this._onResize = _this._onResize.bind(_this); | ||
_this._onChildScroll = _this._onChildScroll.bind(_this); | ||
_this.__handleWindowScrollEvent = _this.__handleWindowScrollEvent.bind(_this); | ||
_this.__resetIsScrolling = _this.__resetIsScrolling.bind(_this); | ||
return _this; | ||
} | ||
if (_this.state.scrollTop === scrollTop) { | ||
return; | ||
} | ||
// Can’t use defaultProps for scrollElement without breaking server-side rendering | ||
var scrollElement = _this.props.scrollElement; | ||
if (scrollElement) { | ||
if (typeof scrollElement.scrollTo === 'function') { | ||
scrollElement.scrollTo(0, scrollTop + _this._positionFromTop); | ||
} else { | ||
scrollElement.scrollTop = scrollTop + _this._positionFromTop; | ||
} | ||
} | ||
}, _this._registerResizeListener = function (element) { | ||
if (element === window) { | ||
window.addEventListener('resize', _this._onResize, false); | ||
} else { | ||
_this._detectElementResize.addResizeListener(element, _this._onResize); | ||
} | ||
}, _this._unregisterResizeListener = function (element) { | ||
if (element === window) { | ||
window.removeEventListener('resize', _this._onResize, false); | ||
} else if (element) { | ||
_this._detectElementResize.removeResizeListener(element, _this._onResize); | ||
} | ||
}, _this._onResize = function () { | ||
_this.updatePosition(); | ||
}, _this.__handleWindowScrollEvent = function () { | ||
if (!_this._isMounted) { | ||
return; | ||
} | ||
var onScroll = _this.props.onScroll; | ||
var scrollElement = _this.props.scrollElement; | ||
if (scrollElement) { | ||
var scrollOffset = getScrollOffset(scrollElement); | ||
var _scrollLeft = Math.max(0, scrollOffset.left - _this._positionFromLeft); | ||
var _scrollTop = Math.max(0, scrollOffset.top - _this._positionFromTop); | ||
_this.setState({ | ||
isScrolling: true, | ||
scrollLeft: _scrollLeft, | ||
scrollTop: _scrollTop | ||
}); | ||
onScroll({ | ||
scrollLeft: _scrollLeft, | ||
scrollTop: _scrollTop | ||
}); | ||
} | ||
}, _this.__resetIsScrolling = function () { | ||
_this.setState({ | ||
isScrolling: false | ||
}); | ||
}, _temp), _possibleConstructorReturn(_this, _ret); | ||
} | ||
_createClass(WindowScroller, [{ | ||
key: 'updatePosition', | ||
value: function updatePosition(scrollElement) { | ||
value: function updatePosition() { | ||
var scrollElement = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.props.scrollElement; | ||
var props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.props; | ||
@@ -60,8 +116,9 @@ var onResize = this.props.onResize; | ||
scrollElement = scrollElement || this.props.scrollElement; | ||
var thisNode = ReactDOM.findDOMNode(this); | ||
if (thisNode instanceof Element && scrollElement) { | ||
var offset = getPositionOffset(thisNode, scrollElement); | ||
this._positionFromTop = offset.top; | ||
this._positionFromLeft = offset.left; | ||
} | ||
var offset = getPositionOffset(ReactDOM.findDOMNode(this), scrollElement); | ||
this._positionFromTop = offset.top; | ||
this._positionFromLeft = offset.left; | ||
var dimensions = getDimensions(scrollElement, props); | ||
@@ -86,6 +143,7 @@ if (height !== dimensions.height || width !== dimensions.width) { | ||
registerScrollListener(this, scrollElement); | ||
if (scrollElement) { | ||
registerScrollListener(this, scrollElement); | ||
this._registerResizeListener(scrollElement); | ||
} | ||
window.addEventListener('resize', this._onResize, false); | ||
this._isMounted = true; | ||
@@ -99,3 +157,3 @@ } | ||
if (scrollElement !== nextScrollElement) { | ||
if (scrollElement !== nextScrollElement && scrollElement && nextScrollElement) { | ||
this.updatePosition(nextScrollElement, nextProps); | ||
@@ -105,2 +163,5 @@ | ||
registerScrollListener(this, nextScrollElement); | ||
this._unregisterResizeListener(scrollElement); | ||
this._registerResizeListener(nextScrollElement); | ||
} | ||
@@ -111,4 +172,7 @@ } | ||
value: function componentWillUnmount() { | ||
unregisterScrollListener(this, this.props.scrollElement); | ||
window.removeEventListener('resize', this._onResize, false); | ||
var scrollElement = this.props.scrollElement; | ||
if (scrollElement) { | ||
unregisterScrollListener(this, scrollElement); | ||
this._unregisterResizeListener(scrollElement); | ||
} | ||
@@ -138,72 +202,12 @@ this._isMounted = false; | ||
} | ||
}, { | ||
key: '_onChildScroll', | ||
value: function _onChildScroll(_ref) { | ||
var scrollTop = _ref.scrollTop; | ||
if (this.state.scrollTop === scrollTop) { | ||
return; | ||
} | ||
var scrollElement = this.scrollElement; | ||
if (typeof scrollElement.scrollTo === 'function') { | ||
scrollElement.scrollTo(0, scrollTop + this._positionFromTop); | ||
} else { | ||
scrollElement.scrollTop = scrollTop + this._positionFromTop; | ||
} | ||
} | ||
}, { | ||
key: '_onResize', | ||
value: function _onResize() { | ||
this.updatePosition(); | ||
} | ||
// Referenced by utils/onScroll | ||
}, { | ||
key: '__handleWindowScrollEvent', | ||
value: function __handleWindowScrollEvent() { | ||
if (!this._isMounted) { | ||
return; | ||
} | ||
var onScroll = this.props.onScroll; | ||
var scrollElement = this.props.scrollElement; | ||
var scrollOffset = getScrollOffset(scrollElement); | ||
var scrollLeft = Math.max(0, scrollOffset.left - this._positionFromLeft); | ||
var scrollTop = Math.max(0, scrollOffset.top - this._positionFromTop); | ||
this.setState({ | ||
isScrolling: true, | ||
scrollLeft: scrollLeft, | ||
scrollTop: scrollTop | ||
}); | ||
onScroll({ | ||
scrollLeft: scrollLeft, | ||
scrollTop: scrollTop | ||
}); | ||
} | ||
// Referenced by utils/onScroll | ||
}, { | ||
key: '__resetIsScrolling', | ||
value: function __resetIsScrolling() { | ||
this.setState({ | ||
isScrolling: false | ||
}); | ||
} | ||
}, { | ||
key: 'scrollElement', | ||
get: function get() { | ||
return this.props.scrollElement; | ||
} | ||
}]); | ||
return WindowScroller; | ||
}(PureComponent); | ||
}(React.PureComponent); | ||
@@ -213,9 +217,8 @@ WindowScroller.defaultProps = { | ||
onScroll: function onScroll() {}, | ||
scrollElement: typeof window !== 'undefined' ? window : undefined, | ||
scrollingResetTimeInterval: IS_SCROLLING_TIMEOUT, | ||
scrollElement: getWindow(), | ||
serverHeight: 0, | ||
serverWidth: 0 | ||
}; | ||
export default WindowScroller; | ||
WindowScroller.propTypes = process.env.NODE_ENV !== "production" ? { | ||
WindowScroller.propTypes = { | ||
/** | ||
@@ -226,23 +229,30 @@ * Function responsible for rendering children. | ||
*/ | ||
children: PropTypes.func.isRequired, | ||
children: require('prop-types').func.isRequired, | ||
/** Callback to be invoked on-resize: ({ height, width }) */ | ||
onResize: PropTypes.func.isRequired, | ||
onResize: require('prop-types').func.isRequired, | ||
/** Callback to be invoked on-scroll: ({ scrollLeft, scrollTop }) */ | ||
onScroll: PropTypes.func.isRequired, | ||
onScroll: require('prop-types').func.isRequired, | ||
/** Element to attach scroll event listeners. Defaults to window. */ | ||
scrollElement: PropTypes.any, | ||
scrollElement: typeof Element === 'function' ? require('prop-types').instanceOf(Element) : require('prop-types').any, | ||
/** | ||
* Wait this amount of time after the last scroll event before resetting child `pointer-events`. | ||
*/ | ||
scrollingResetTimeInterval: PropTypes.number.isRequired, | ||
scrollingResetTimeInterval: require('prop-types').number.isRequired, | ||
/** Height used for server-side rendering */ | ||
serverHeight: PropTypes.number.isRequired, | ||
serverHeight: require('prop-types').number.isRequired, | ||
/** Width used for server-side rendering */ | ||
serverWidth: PropTypes.number.isRequired | ||
} : {}; | ||
serverWidth: require('prop-types').number.isRequired | ||
}; | ||
export default WindowScroller; |
@@ -6,3 +6,3 @@ { | ||
"user": "bvaughn", | ||
"version": "9.14.1", | ||
"version": "9.15.0", | ||
"homepage": "https://github.com/bvaughn/react-virtualized", | ||
@@ -14,7 +14,8 @@ "main": "dist/commonjs/index.js", | ||
"scripts": { | ||
"build:types": "flow-copy-source --ignore \"**/*.{jest,e2e,example}.js\" source/WindowScroller dist/es/WindowScroller && flow-copy-source --ignore \"**/*.{jest,e2e,example}.js\" source/AutoSizer dist/es/AutoSizer ", | ||
"build": "npm run build:commonjs && npm run build:css && npm run build:es && npm run build:demo && npm run build:umd", | ||
"build:commonjs": "npm run clean:commonjs && cross-env NODE_ENV=production cross-env BABEL_ENV=commonjs babel source --out-dir dist/commonjs --ignore *.example.js,*.test.js,source/demo/,source/tests.js", | ||
"build:css": "postcss --config postcss.config.js --use autoprefixer source/styles.css > styles.css", | ||
"build:commonjs": "npm run clean:commonjs && cross-env NODE_ENV=production cross-env BABEL_ENV=commonjs babel source --out-dir dist/commonjs", | ||
"build:css": "postcss source/styles.css -o styles.css --use autoprefixer", | ||
"build:demo": "npm run clean:demo && cross-env NODE_ENV=production webpack --config webpack.config.demo.js -p --bail", | ||
"build:es": "npm run clean:es && cross-env NODE_ENV=production cross-env BABEL_ENV=es babel source --out-dir dist/es --ignore *.example.js,*.test.js,source/demo/,source/tests.js", | ||
"build:es": "npm run clean:es && npm run build:types && cross-env NODE_ENV=production cross-env BABEL_ENV=es babel source --out-dir dist/es", | ||
"build:umd": "npm run clean:umd && cross-env NODE_ENV=production webpack --config webpack.config.umd.js --bail", | ||
@@ -32,10 +33,10 @@ "check-all": "yarn prettier && yarn lint && yarn flow", | ||
"prebuild": "npm run typecheck && npm run lint", | ||
"prettier": "prettier --config .prettierrc --write '{playground,source}/**/*.js'", | ||
"prettier:diff": "prettier --config .prettierrc --list-different '{playground,source}/**/*.js'", | ||
"prettier": "prettier --write '{playground,source}/**/*.js'", | ||
"prettier:diff": "prettier --list-different '{playground,source}/**/*.js'", | ||
"postpublish": "npm run deploy", | ||
"prepublish": "npm run build", | ||
"start": "cross-env NODE_ENV=development webpack-dev-server --hot --inline --config webpack.config.dev.js", | ||
"start": "webpack-dev-server --hot --config webpack.config.dev.js", | ||
"test": "npm run test:jest", | ||
"test:jest": "jest --no-watchman --runInBand", | ||
"test:ci": "jest --no-watchman --maxWorkers 2 --coverage && codecov", | ||
"test:ci": "cross-env JEST=ci jest --testPathPattern=jest.js --no-watchman --maxWorkers 2 --coverage && codecov", | ||
"watch": "watch 'clear && npm run test -s' source", | ||
@@ -73,9 +74,13 @@ "watch:jest": "jest --no-watchman --watch" | ||
"jest": { | ||
"globalSetup": "./source/jest-global-setup.js", | ||
"globalTeardown": "./source/jest-global-teardown.js", | ||
"setupFiles": [ | ||
"./source/jest-setup.js" | ||
], | ||
"testPathDirs": [ | ||
"roots": [ | ||
"./source" | ||
], | ||
"coverageReporters": ["lcov"], | ||
"coverageReporters": [ | ||
"lcov" | ||
], | ||
"collectCoverageFrom": [ | ||
@@ -85,25 +90,23 @@ "source/**/*.js", | ||
"!source/demo/**", | ||
"!source/jest-setup.js", | ||
"!source/jest-*.js", | ||
"!source/TestUtils.js", | ||
"!**/*.example.js" | ||
], | ||
"testRegex": ".jest.js", | ||
"testRegex": ".(jest|e2e).js", | ||
"verbose": true | ||
}, | ||
"devDependencies": { | ||
"autoprefixer": "^6.2.3", | ||
"babel-cli": "^6.24.1", | ||
"babel-core": "^6.25.0", | ||
"babel-eslint": "^7.2.3", | ||
"babel-jest": "^20.0.3", | ||
"babel-loader": "6", | ||
"babel-plugin-__coverage__": "^11.0.0", | ||
"babel-plugin-flow-react-proptypes": "^3.4.3", | ||
"babel-plugin-react-transform": "^2.0.0", | ||
"babel-plugin-transform-react-inline-elements": "^6.22.0", | ||
"babel-plugin-transform-react-remove-prop-types": "^0.4.6", | ||
"autoprefixer": "^7.2.3", | ||
"babel-cli": "^6.26.0", | ||
"babel-core": "^6.26.0", | ||
"babel-eslint": "^8.1.2", | ||
"babel-jest": "^22.0.4", | ||
"babel-loader": "7.1.2", | ||
"babel-plugin-flow-react-proptypes": "^13.0.1", | ||
"babel-plugin-react-transform": "^3.0.0", | ||
"babel-plugin-transform-react-remove-prop-types": "^0.4.12", | ||
"babel-plugin-transform-runtime": "^6.23.0", | ||
"babel-polyfill": "^6.23.0", | ||
"babel-preset-es2015": "^6.24.1", | ||
"babel-preset-es2015-rollup": "3.0.0", | ||
"babel-polyfill": "^6.26.0", | ||
"babel-preset-env": "^1.6.1", | ||
"babel-preset-flow": "^6.23.0", | ||
"babel-preset-react": "^6.24.1", | ||
@@ -115,3 +118,3 @@ "babel-preset-stage-1": "^6.24.1", | ||
"cross-env": "^5.0.1", | ||
"css-loader": "^0.28.4", | ||
"css-loader": "^0.28.7", | ||
"eslint": "^4.2.0", | ||
@@ -128,16 +131,19 @@ "eslint-config-fbjs": "^2.0.0", | ||
"express": "^4.13.3", | ||
"extract-text-webpack-plugin": "^3.0.0", | ||
"file-loader": "^0.11.2", | ||
"flow-bin": "^0.50.0", | ||
"extract-text-webpack-plugin": "^3.0.2", | ||
"file-loader": "^1.1.6", | ||
"flow-bin": "^0.61.0", | ||
"flow-copy-source": "^1.2.1", | ||
"fs-extra": "^4.0.0", | ||
"gh-pages": "^1.0.0", | ||
"html-webpack-plugin": "^2.16.1", | ||
"html-webpack-plugin": "^2.30.1", | ||
"husky": "^0.14.3", | ||
"immutable": "^3.7.5", | ||
"jest": "^18.1.0", | ||
"postcss": "^5.0.14", | ||
"postcss-cli": "^2.3.3", | ||
"postcss-loader": "^0.9.1", | ||
"prettier": "^1.5.3", | ||
"raf": "^3.3.0", | ||
"jest": "^22.0.4", | ||
"jest-environment-node": "^22.0.4", | ||
"make-dir": "^1.1.0", | ||
"postcss": "^6.0.14", | ||
"postcss-cli": "^4.1.1", | ||
"postcss-loader": "^2.0.9", | ||
"prettier": "^1.9.2", | ||
"puppeteer": "^0.13.0", | ||
"react": "^16.0.0", | ||
@@ -152,10 +158,9 @@ "react-codemirror": "^1.0.0", | ||
"rimraf": "^2.4.3", | ||
"style-loader": "^0.13.0", | ||
"style-loader": "^0.19.1", | ||
"watch": "^1.0.2", | ||
"webpack": "^1.9.6", | ||
"webpack-dashboard": "^0.4.0", | ||
"webpack-dev-server": "^1.14.0" | ||
"webpack": "^3.10.0", | ||
"webpack-dev-server": "^2.9.7" | ||
}, | ||
"dependencies": { | ||
"babel-runtime": "^6.23.0", | ||
"babel-runtime": "^6.26.0", | ||
"classnames": "^2.2.3", | ||
@@ -162,0 +167,0 @@ "dom-helpers": "^2.4.0 || ^3.0.0", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
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
42
1208147
146
23363
Updatedbabel-runtime@^6.26.0